@avocadostudio-ai/cli 0.17.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PuckPrototypeRoute-DRZlpZPw.js","assets/PuckPrototypeRoute-Bn1rE5xN.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PuckPrototypeRoute-4PdBTH7w.js","assets/PuckPrototypeRoute-Bn1rE5xN.css"])))=>i.map(i=>d[i]);
2
2
  var xB=Object.defineProperty;var vB=(e,t,n)=>t in e?xB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Te=(e,t,n)=>vB(e,typeof t!="symbol"?t+"":t,n);function kB(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Bd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ux={exports:{}},Bf={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -368,8 +368,46 @@ Error generating stack: `+b.message+`
368
368
  * This source code is licensed under the ISC license.
369
369
  * See the LICENSE file in the root directory of this source tree.
370
370
  */const jF=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],zT=st("zoom-in",jF),IF={"header.siteSettings":"Site settings","header.syncFromSite":"Pull from site","header.syncFromSiteTitle":"Pull latest content from this site's source","header.allSites":"All sites","header.page":"Page","header.language":"Language","header.defaultLanguage":"Default","header.pagesWithoutLanguage":"Not language-specific","header.viewAllSites":"View all sites","header.limited":"Limited","noKey.title":"AI editing is running without an API key","noKey.body":"Visual editing already works in full — the pages render, click-to-select works, and the property panel edits real fields. Only AI editing needs a model, and right now it is answering from a built-in planner that handles simple, literal edits.","noKey.step1":"Add a key to","noKey.bodyShort":"Visual editing still works in full — click a block, edit its fields in the property panel, publish. Only AI editing is limited: a built-in demo planner handles simple, literal edits until you add a key.","noKey.whichKey":"Which key should I use?","noKey.step1Path":".env.local in your project root","noKey.anthropic":"the best-tested planner. Chat only; no image generation.","noKey.openai":"planner plus image generation, and gpt-image editing.","noKey.google":"planner plus image generation. Also needs npm install @google/genai, an optional peer dependency nothing installs for you.","noKey.step2":"Restart the dev server. Keys are read at startup, so a running server will not pick one up.","noKey.reopen":"Show details","noKey.dismiss":"Dismiss","noKey.foot":"Keys are read at startup, so restart the dev server afterwards. Avocado runs on your key and never resells tokens.","header.noKeyBadge":"Add an API key","header.noKeyTooltip":"AI editing is running on the built-in demo planner, which only handles simple, literal edits. Visual editing is unaffected. Add ANTHROPIC_API_KEY (or OPENAI_API_KEY) to .env.local and restart the dev server.","demo.bannerTitle":"You're in demo mode","demo.bannerBody":"This is a live playground. You can edit the Hero section with plain language — everything else is locked for now.","demo.tryExample1":'Change the hero headline to "Welcome to my new site"',"demo.tryExample2":"Make the hero subheading sound more playful","demo.tryExample3":'Update the hero CTA to "Get Started"',"demo.placeholder":"Try: change the hero headline to …","demoGuide.title":"Getting started","demoGuide.try":"Try it","demoGuide.dismiss":"Dismiss","demoGuide.step1Title":"Rewrite the hero heading & subheading","demoGuide.step1Prompt":"Rewrite the hero heading and subheading to be more compelling and benefit-driven","demoGuide.step2Title":"Add a stats band","demoGuide.step2Prompt":"Add a stats band below the hero with a few impressive numbers","demoGuide.step3Title":"Swap the hero image","demoGuide.step3Prompt":"Give the whole site a warm, earthy green color theme","demoGuide.step4Title":"Translate the page","demoGuide.step4Prompt":"Translate the whole page into German","header.moreOptions":"More options","header.publish":"Publish","header.publishing":"Publishing","header.unpublishedTooltip":"{{count}} unpublished change(s) since the last deploy.","header.viewDeploy":"View deploy","header.openLiveSite":"Open live site","header.openImmersive":"Open in immersive mode","header.syncedPage":"Pulled 1 page from site.","header.syncedPages":"Pulled {{count}} pages from site.","header.syncFailedNetwork":"Couldn't reach this site. Check that it's running and try again.","header.syncFailedEmpty":"This site has no source content to pull from.","tabs.chat":"Chat","tabs.properties":"Properties","stream.shapingUpdate":"Shaping your update...","stream.gettingReady":"Getting things ready...","stream.updating":"Updating...","stream.thinking":"Thinking","chat.thinking.streaming":"Thinking…","chat.thinking.doneSeconds":"Thought for {{seconds}}s","chat.thinking.done":"Thought process","chat.thinking.showMore":"Show thinking","chat.thinking.showLess":"Hide thinking","chat.expandDetails":"Expand details","chat.copied":"Copied","chat.copyDebug":"Copy debug bubble","chat.copy":"Copy","chat.undone":"Undone","chat.undo":"Undo","chat.appliedDraft":"Applied to your draft","chat.keep":"Keep","chat.revert":"Revert","chat.reverted":"Reverted","chat.kept":"Kept","chat.redo":"Redo","chat.undoTooltip":"Undo (Ctrl+Z)","chat.redoTooltip":"Redo (Ctrl+Y)","history.title":"Version History","history.loading":"Loading history...","history.empty":"No changes yet.","history.operation":"operation","history.operations":"operations","history.tooltip":"Version history","history.restore":"Restore this","history.restoring":"Restoring…","history.current":"Current","history.today":"Today","history.yesterday":"Yesterday","history.undidChange":"Undid v{{version}} · {{summary}}","history.redidChange":"Redid v{{version}} · {{summary}}","history.undidUnknown":"Undid the previous change","history.redidUnknown":"Redid the last undone change","history.showDetails":"Show details","history.hideDetails":"Hide details","history.version":"Version","history.page":"Page","history.changes":"Changes","history.publish":"Publish","history.deploying":"Deploying…","history.live":"Live","history.deployFailed":"Failed","history.viewDeploy":"View deploy","history.pagesPublished":"{{count}} pages","history.pagePublished":"1 page","history.pagesChanged":"{{changed}} of {{total}} pages changed","history.noContentChanges":"No content changes · {{count}} pages live","history.selectChange":"Select this change","history.selectChangeNamed":"Select v{{version}} to discard","history.selectedCount":"{{count}} selected","history.clearSelection":"Clear","history.discard":"Discard","history.discarding":"Discarding…","history.discardSweeps":"Rolls back {{total}} changes across {{pages}} pages — later edits to those pages go too.","history.discardBlocked":"{{count}} cannot be discarded: nothing is recorded before them.","history.discardUnavailable":"Nothing recorded before this change","history.discardPartly":"{{count}} change(s) could not be discarded.","history.discardFailed":"Could not discard those changes.","chat.goodResponse":"Good response","chat.badResponse":"Bad response","chat.feedbackThanks":"Thanks!","chat.feedbackNoted":"Noted","chat.feedbackPlaceholder":"What went wrong? (optional)","chat.feedbackSend":"Send","variation.title":"Choose a Variation","variation.close":"Close variation picker","variation.applying":"Applying...","variation.apply":'Apply "{{title}}"',"addBlock.title":"Add block","addBlock.close":"Close add block picker","addBlock.insertAbove":"Select block type to insert above the selected section.","addBlock.insertBelow":"Select block type to insert below the selected section.","addBlock.searchPlaceholder":"Search block types","resize.inputPanel":"Resize input panel","resize.chatPanel":"Resize chat panel","preview.title":"Live preview","preview.loading":"Loading preview…","settings.title":"Settings","settings.devTitle":"Developer mode","settings.groupAppearance":"Appearance","settings.groupEditing":"Editing","settings.groupAgent":"Agent","settings.groupDeveloper":"Developer","settings.developerMode":"Developer mode","settings.developerModeHint":"Show the Developer group above: preview overlay diagnostics and the per-message debug cards.","settings.streaming":"Streaming","settings.streamingHint":"Show the agent's reply as it is written, instead of waiting for the whole answer.","settings.nestedLabels":"Nested labels","settings.nestedLabelsHint":"Name each editable field inside a selected block in the preview.","settings.fieldDraftTelemetry":"Field draft telemetry","settings.fieldDraftTelemetryHint":"Record which fields the live preview updated during an edit, and show it on the debug card.","settings.darkMode":"Dark mode","settings.theme":"Theme","settings.themeHint":"System follows your operating system's light or dark setting.","settings.themeSystem":"System","settings.themeLight":"Light","settings.themeDark":"Dark","settings.autoScrollTracking":"Follow generated content","settings.autoScrollTrackingHint":"Scroll the preview to each block as the agent edits it.","settings.autoOpenProperties":"Open properties on select","settings.autoOpenPropertiesHint":"Open the properties rail when you click a block in the preview. Off keeps the preview full width.","settings.debugMode":"Debug mode","settings.debugModeHint":"Add a card under each reply with the plan, the operations applied and the timings.","settings.agentMode":"Agent mode","settings.agentModeOn":"On","settings.agentModeOff":"Not configured","settings.agentModeOnHint":"The agent can use tools to edit your site directly, rather than proposing a plan.","settings.agentModeOffHint":"Agent mode needs an API key on the orchestrator. Add this variable to its .env and restart it:","settings.copyEnvVar":"Copy {{name}}","settings.cancel":"Cancel","settings.clearChatConfirm":"Clear chat — click again","settings.modelHint":"Which model plans your edits. Larger models plan better and cost more.","settings.model":"Model","settings.modelNoProvider":"No API key is configured, so no model is available. Add one to your project's .env.local and restart the dev server.","settings.advanced":"Advanced","settings.clearChat":"Clear chat","settings.language":"Language","password.title":"Editor Access","password.placeholder":"Password","password.incorrect":"Incorrect password","password.checking":"Checking…","password.continue":"Continue","password.closedTitle":"This orchestrator is refusing every request","password.closedBody":"It is running with NODE_ENV=production and no credential configured, so every route answers 401 — including the ones this editor needs to load your site.","password.closedFix":"Set ACCESS_PASSWORD_HASH or ORCHESTRATOR_ACCESS_TOKEN in the site's environment and restart it, or pass auth to createOrchestrator(). Running the site with npm run dev instead also opens it, because the closed default applies only to production.","password.unreachableTitle":"Cannot reach the orchestrator","password.unreachableBody":"Whether this editor is behind an access gate is decided by the orchestrator, and it did not answer. Until it does, access cannot be determined — so it is refused.","password.retry":"Try again","password.retryingIn":"Retrying automatically in {{seconds}}s…","sites.title":"Sites","sites.subtitle":"Choose a site to edit.","sites.addSite":"Add site","sites.addSiteTitle":"Add Site","sites.close":"Close","sites.siteName":"Site name","sites.siteNamePlaceholder":"My Site","sites.previewUrl":"Preview URL","sites.previewUrlPlaceholder":"http://localhost:3000","sites.enablePuck":"Use visual editor (Puck)","sites.editorialBrief":"Editorial brief","sites.overview":"Overview","sites.tone":"Tone","sites.constraints":"Constraints","sites.templates":"Templates","sites.overviewPlaceholder":"What this site is for.","sites.tonePlaceholder":"How the writing should sound.","sites.constraintsPlaceholder":`Rules for content output.
371
- One per line.`,"sites.templateName":"Template name (e.g. Campaign Landing Page)","sites.templateDescription":"Describe the page structure: which sections, in what order, with what content focus.","sites.settings":"Settings","sites.openEditor":"Open editor","sites.deleteSite":"Delete","sites.confirmDelete":'Remove "{{name}}" from your site list?',"sites.confirmDeleteTitle":"Remove site","sites.confirmDeleteBody":'This removes "{{name}}" from your local site list. The site itself is not deleted.',"sites.switchingTo":"Switching to","sites.switchInFlight":"A chat request is still in progress. Switch sites anyway and discard it?","sites.allOffline":"No reachable sites","sites.allOfflineHint":'All sites in your list failed a quick reachability check. Toggle "Show offline sites" to see them, or check that the sites are running.',"sites.previewUrlOverride":"Overridden by ?previewUrl= in the current URL.","sites.orchestratorUrl":"Orchestrator URL","sites.orchestratorUrlPlaceholder":"https://example.com/api/avocado","sites.orchestratorUrlHint":"Only for a site that runs the orchestrator itself (library mode). Leave empty to use the editor's own orchestrator.","sites.cancel":"Cancel","sites.create":"Create","sites.siteConfig":"Site Config","sites.general":"General","sites.media":"Media","sites.hosting":"Hosting","sites.brief":"Brief","sites.deploy":"Deploy","sites.coreSettings":"Core settings","sites.header":"Header","sites.siteHeaderName":"Site header name","sites.logoUrl":"Logo URL","sites.logoUrlPlaceholder":"https://example.com/logo.svg","sites.pageTemplates":"Page templates","sites.pageTemplatesHint":"Define reusable page structures. The AI will match templates by name or intent when creating pages.","sites.removeTemplate":"Remove","sites.addTemplate":"+ Add template","sites.preferredTone":"Preferred tone","sites.writingConstraints":"Writing constraints","sites.hostingPlaceholder":"Vercel production site","sites.vercelProjectId":"Vercel project ID","sites.vercelProjectIdPlaceholder":"prj_...","sites.vercelTeamId":"Vercel team ID","sites.vercelTeamIdPlaceholder":"team_...","sites.vercelProductionUrl":"Vercel production URL","sites.vercelProductionUrlPlaceholder":"https://example.vercel.app","sites.vercelDeployHook":"Vercel deploy hook URL","sites.vercelDeployHookPlaceholder":"https://api.vercel.com/v1/integrations/deploy/...","sites.googleDrive":"Google Drive","sites.googleDriveFolderId":"Google Drive folder ID","sites.googleDrivePlaceholder":"e.g. 1aBcDeFgHiJkLmNoPqRsTuVwXyZ","sites.testing":"Testing...","sites.test":"Test","sites.driveConnectedImages":"Connected (images found)","sites.driveConnectedEmpty":"Connected (folder empty)","sites.driveError":"Could not reach orchestrator","sites.cmsMedia":"CMS Media","sites.provider":"Provider","sites.none":"None","sites.spaceId":"Space ID","sites.spaceIdPlaceholder":"abc123","sites.deliveryToken":"Delivery Token","sites.deliveryTokenPlaceholder":"Content Delivery API token","sites.projectId":"Project ID","sites.dataset":"Dataset","sites.datasetPlaceholder":"production","sites.strapiUrl":"Strapi URL","sites.strapiUrlPlaceholder":"http://localhost:1337","sites.apiToken":"API Token","sites.apiTokenPlaceholder":"Read-only API token","sites.versionHistory":"Version History","sites.restoreDescription":"Restore a previous published snapshot into","sites.snapshotVersion":"Snapshot version","sites.loadingSnapshots":"Loading snapshots...","sites.restoring":"Restoring...","sites.restore":"Restore","sites.noSnapshots":"No snapshots available yet.","sites.snapshotCommit":"Commit","sites.snapshotPages":"Pages","sites.snapshotHeading":"Heading","sites.snapshotDate":"Date","sites.checkingManifest":"Checking manifest...","sites.limitedEditing":"Limited editing","sites.editingReady":"Editing ready","sites.checking":"Checking...","chatInput.placeholder":"Ask anything","chatInput.listening":"Listening","chatInput.transcribing":"Transcribing...","chatInput.attachFile":"Attach file","chatInput.removeAttachment":"Remove attachment","chatInput.exitSelector":"Exit selector mode","chatInput.selectElement":"Select an element","chatInput.editingBlock":"Editing: {{block}}","chatInput.clearSelection":"Clear selection","chatInput.voiceActions":"Voice and send actions","chatInput.cancelVoice":"Cancel voice input","chatInput.sendRecorded":"Send recorded message","chatInput.startVoice":"Start voice input","chatInput.stopGeneration":"Stop generation","chatInput.sendMessage":"Send message","chatInput.speechUnsupported":"Speech input is not supported in this browser.","chatInput.noSpeechDetected":"No speech detected. Try recording again.","chatInput.micBlocked":"Microphone access is blocked. Please allow mic permissions and try again.","chatInput.unsupportedFile":"Only images and PDF files are supported.","chatInput.attachmentOnlyMessage":"Use the attached file(s).","chatInput.uploadFailed":"Upload failed. Please try again.","chatInput.transcribeFailed":"Failed to transcribe audio.","imagePicker.title":"Asset Manager","imagePicker.close":"Close","imagePicker.drive":"Drive","imagePicker.cms":"CMS","imagePicker.searchCms":"Search media library…","imagePicker.unsplash":"Unsplash","imagePicker.upload":"Upload","imagePicker.generate":"Generate","imagePicker.searchDrive":"Search Drive images...","imagePicker.searchUnsplash":"Search Unsplash photos...","imagePicker.search":"Search...","imagePicker.refreshDrive":"Refresh from Drive","imagePicker.searching":"Searching...","imagePicker.typeToSearch":"Type to search Unsplash","imagePicker.noImages":"No images found","imagePicker.loadMore":"Load more","imagePicker.loading":"Loading...","imagePicker.uploadFromComputer":"Upload from computer","imagePicker.uploading":"Uploading...","imagePicker.chooseDifferent":"Choose different file","imagePicker.orPasteUrl":"or paste a URL","imagePicker.urlPlaceholder":"https://example.com/image.jpg","imagePicker.uploadedImage":"Uploaded image","imagePicker.needsKeyTitle":"Image generation is off","imagePicker.needsKeyBody":"No image key is configured, so this tab cannot generate anything yet. Either key below switches it on — an Anthropic key alone does not, because it has no image model.","imagePicker.needsKeyOpenAI":"generates images, and powers gpt-image editing","imagePicker.needsKeyGoogle":"generates images, and enables the conversational Generate tab. Also needs npm install @google/genai, which is an optional peer dependency no package manager installs for you.","imagePicker.needsKeyRestart":"Add one to .env.local and restart the dev server.","imagePicker.examplePrompt":"Make it warmer","imagePicker.editPrompt":"Describe how to change this image…","imagePicker.generatePrompt":"Describe the image you want…","imagePicker.followUpPrompt":"Ask for changes…","imagePicker.refine":"Refine","imagePicker.edit":"Edit","imagePicker.closePreview":"Close preview","imagePicker.ready":"Ready","imagePicker.editThisImage":"Edit this image","imagePicker.editThisImageDesc":"Describe changes to the current image","imagePicker.generateNew":"Generate new","imagePicker.generateNewDesc":"Create a completely new image from scratch","imagePicker.useImage":"Use image","imagePicker.applyUrl":"Apply URL","imagePicker.removeReference":"Remove reference","imagePicker.attachReference":"Attach example images for AI to reference (up to {{max}})","imagePicker.showOriginal":"Show original","imagePicker.showEdited":"Show edited","propertyPanel.loading":"Loading...","propertyPanel.loadFailed":"Failed to load block properties","propertyPanel.loadFailedMissing":"This block is not in the page the orchestrator returned","propertyPanel.loadFailedMissingHint":"The preview and the orchestrator may be pointed at different sites. Check the site's Orchestrator URL in its settings.","propertyPanel.loadFailedNoPage":"This page is not in the draft","propertyPanel.loadFailedNoPageHint":"The orchestrator answered, but it has no page at this address for this session — either the editor is on a page this draft does not have, or it is asking an orchestrator that does not host this site.","propertyPanel.loadFailedUnreachableHint":"Nothing answered at this address. Check that the orchestrator is running.","propertyPanel.retry":"Try again","orchestratorMismatch.title":"You are editing another site's content","orchestratorMismatch.detail":"{{orchestrator}} does not host this site, so the pages, preview and properties on this screen belong to whatever it does host.","orchestratorMismatch.detailHosts":"{{orchestrator}} hosts {{hosted}} — not this site — so the pages, preview and properties on this screen are that site's, under this site's name.","orchestratorMismatch.useDefault":"Use the editor's own orchestrator","orchestratorMismatch.ownTitle":"This site keeps its content somewhere else","orchestratorMismatch.ownDetail":"The editor is reading drafts from {{orchestrator}}, while the site runs its own orchestrator at {{siteOrchestrator}}. Its media library, and anything else only the site knows, is missing until they match.","orchestratorMismatch.useSiteOwn":"Use this site's orchestrator","propertyPanel.unknownBlock":"Unknown block type:","propertyPanel.page":"Page","propertyPanel.close":"Close properties","propertyPanel.navLabel":"Nav label","propertyPanel.change":"Change","propertyPanel.chooseImage":"Choose image","propertyPanel.remove":"Remove","propertyPanel.addItem":"Add item","propertyPanel.removeItem":"Remove item","propertyPanel.altText":"Alt text","propertyPanel.altPlaceholder":"Describe what's in this image","propertyPanel.navPlaceholder":"Page","propertyPanel.linkPlaceholder":"Page, URL, email or phone","propertyPanel.linkBrowsePages":"Browse pages","propertyPanel.linkNoPage":"No page at this path","propertyPanel.linkNoFile":"No document at this path","propertyPanel.linkDidYouMean":"Did you mean {{page}}?","propertyPanel.linkNoMatches":"No matching page — this is used as typed","propertyPanel.linkUseInternal":"Link to {{path}} on this site instead","propertyPanel.linkNewTab":"Open in new tab","propertyPanel.seo":"SEO","propertyPanel.seoTitle":"SEO title","propertyPanel.seoTitlePlaceholder":"Defaults to page title","propertyPanel.metaDescription":"Meta description","propertyPanel.metaDescPlaceholder":"Defaults to generated description","propertyPanel.ogImage":"Open Graph image URL","welcome.greeting":"Welcome to {{name}}! Tell me what you'd like to change — I can add sections, rewrite copy, create new pages, and more. Avocado Studio is a research preview, so expect rough edges.","welcome.greetingFallback":"Let's shape your site into something people remember. Tell me what you'd like to change. Avocado Studio is a research preview, so expect rough edges.","welcome.greetingDemo":"Welcome to {{name}} — a research preview, and a demo site so you can try things out. Edit anything you like, browse the [component catalogue]({{catalogueUrl}}) to see what's available, and when you're ready, [onboard your own site](https://docs.avocadostudio.dev/sites). Expect rough edges, and tell us about them.","welcome.greetingScaffold":"Welcome to {{name}} — a research preview of Avocado Studio, running on the Avocado Hub demo content. Edit anything you like; expect rough edges. When you want Avocado on your own site, see [the integration guide](https://docs.avocadostudio.dev/sites).","suggestion.rewriteHero":"Rewrite the hero headline","suggestion.addTestimonials":"Add a testimonials section","suggestion.addFaq":"Add an FAQ section","suggestion.addCta":"Add a call-to-action","suggestion.changeHeadline":"Change the headline and subheading","suggestion.addSection":"Add a new section","suggestion.rewriteTone":"Rewrite the copy to sound more {{tone}}","suggestion.createFromTemplate":"Create a new {{name}} page","suggestion.createAbout":"Create a new /about page","suggestion.demoAddTestimonials":"Add a testimonials section","suggestion.demoAddSection":"Add a closing call-to-action section","suggestion.keylessAddTestimonials":"Add testimonials","suggestion.keylessRichText":"Add a rich text section","suggestion.keylessMetaDescription":'Set the meta description to "Fresh avocado recipes, wellness tips, and sustainability stories."',"suggestion.demoTranslate":"Translate the whole page to German","suggestion.demoAddFaq":"Add an FAQ section","suggestion.demoHeroCta":"Turn the hero into a bold call-to-action","streamError.failed":"Streaming request failed.","streamError.retrying":"Streaming failed, retrying with standard request...","streamError.canceling":"Canceling...","streamError.canceled":"Stopped this request.","streamError.structuralDisabled":"Structural edits are disabled for this site context.","streamError.demoQuotaExhausted":"This live demo is shared by everyone and has reached its usage limit for now. Please try again in a few minutes — anything you've already created is still here.","ops.addedItem":"Added list item.","ops.deletedBlock":"Deleted block.","ops.changedImage":"Changed image.","ops.replacedImageAt":"{{block}} · {{field}}","ops.imageChangeFailed":"Couldn't change the image. Please try again.","ops.imageSwap.pickAnother":"Change","ops.imageSwap.retry":"Try again","ops.continueNext":"Continue to next step","plan.apply":"Apply","plan.applyDestructive":"Apply changes","plan.deletePage":"Delete page","plan.deletePages":"Delete {{count}} pages","plan.discard":"Discard","fieldAi.generateAlt":"Generate alt text","fieldAi.improveAccessibility":"Improve accessibility","fieldAi.makeDescriptive":"Make more descriptive","fieldAi.optimizeSearch":"Optimize for search ranking","fieldAi.fitTitle":"Fit within 60 characters","fieldAi.addKeyword":"Add primary keyword","fieldAi.suggest3":"Suggest 3 alternatives","fieldAi.optimizeCtr":"Optimize for click-through rate","fieldAi.fitDescription":"Fit within 160 characters","fieldAi.addCallToAction":"Add a call to action","fieldAi.simplifyLanguage":"Simplify language","fieldAi.expandDetail":"Expand with more detail","fieldAi.makeConcise":"Make more concise","fieldAi.improveClarity":"Improve clarity","fieldAi.adjustTone":"Adjust tone to be more professional","error.heading":"Something went wrong","error.message":"An unexpected error occurred while loading this page. Please try again.","error.tryAgain":"Try again","notFound.code":"404","notFound.heading":"Page not found","notFound.message":"The page you're looking for doesn't exist or has been moved.","notFound.backHome":"Back to home","theme.switchLight":"Switch site to light mode","theme.switchDark":"Switch site to dark mode","theme.light":"Light mode","theme.dark":"Dark mode","sitesAgent.title":"Onboarding agent","sitesAgent.clear":"Clear chat","sitesAgent.welcome":"I can create a new site from scratch, migrate an existing website from its URL, or integrate the editor into your Next.js project. Heads up: this is early — treat my first pass as a draft you'll refine in the editor, especially for migrations of complex sites. What would you like to do?","sitesAgent.placeholder":"Ask me anything...","sitesAgent.suggestion1":"Create a new site from scratch","sitesAgent.suggestion1Desc":"Describe your site's purpose and I'll scaffold it","sitesAgent.suggestion2":"Migrate a website from URL","sitesAgent.suggestion2Desc":"Give me a URL and I'll analyze and recreate it","sitesAgent.suggestion3":"Integrate using a GitHub project","sitesAgent.suggestion3Desc":"Connect the editor to your existing Next.js app","sitesAgent.stop":"Stop","sitesAgent.showMore":"Show more","sitesAgent.showLess":"Show less","propertyPanel.content":"Content","propertyPanel.navigation":"Navigation","health.tooltip":"Site health","health.issueCount":"{{count}} issue","health.issueCountPlural":"{{count}} issues","health.title":"Site health","health.run":"Run checks now","health.close":"Close","health.loading":"Checking…","health.emptyTitle":"Nothing to fix","health.emptyBody":"The last check found no problems on this site.","health.goTo":"Go to","health.snooze":"Snooze","health.snoozeTitle":"Hide for a week, then show it again if it is still wrong","health.dismiss":"Dismiss","health.dismissTitle":"Never show this again for this page","health.notDurable":"Findings are being kept in memory only — they will be lost when the server restarts.","linkPicker.title":"Link to","linkPicker.placeholder":"Page, document, or URL","linkPicker.noPage":"No page at this path","linkPicker.noFile":"No document at this path","linkPicker.noMatches":"No pages or documents match","linkPicker.externalHint":"Links to an external site","linkPicker.emailHint":"Opens a new email","linkPicker.phoneHint":"Dials a phone number","linkPicker.anchorHint":"Jumps to a spot on this page","linkPicker.loadingFiles":"Looking up this site's documents...","linkPicker.filesUnavailable":"{{orchestrator}} has no document list for this site, so the path is used as typed.","linkPicker.dropHere":"Drop to upload","linkPicker.upload":"Upload a document","linkPicker.uploadHint":"Or drop a file onto this panel","linkPicker.uploading":"Uploading...","linkPicker.uploadNoUrl":"The upload succeeded but the site returned no URL to link to.","linkPicker.remove":"Remove link","linkPicker.apply":"Apply","common.cancel":"Cancel"},OF={"header.siteSettings":"Seiteneinstellungen","header.syncFromSite":"Von Seite laden","header.syncFromSiteTitle":"Neueste Inhalte aus der Quelle dieser Seite laden","header.allSites":"Alle Seiten","header.page":"Seite","header.language":"Sprache","header.defaultLanguage":"Standard","header.pagesWithoutLanguage":"Ohne Sprachzuordnung","header.viewAllSites":"Alle Websites anzeigen","header.limited":"Eingeschränkt","noKey.title":"KI-Bearbeitung läuft ohne API-Key","noKey.body":"Visuelles Bearbeiten funktioniert bereits vollständig — die Seiten rendern, Klick-zum-Auswählen funktioniert, und das Eigenschaften-Panel bearbeitet echte Felder. Nur die KI-Bearbeitung braucht ein Modell, und im Moment antwortet ein eingebauter Planer, der einfache, wörtliche Änderungen beherrscht.","noKey.step1":"Key eintragen in","noKey.bodyShort":"Visuelles Bearbeiten funktioniert vollständig — Block anklicken, Felder im Eigenschaften-Panel ändern, veröffentlichen. Nur die KI-Bearbeitung ist eingeschränkt: Ohne Key übernimmt ein eingebauter Demo-Planer und schafft nur einfache, wörtliche Änderungen.","noKey.whichKey":"Welchen Key soll ich nehmen?","noKey.step1Path":".env.local im Projektverzeichnis","noKey.anthropic":"der am besten getestete Planer. Nur Chat, keine Bildgenerierung.","noKey.openai":"Planer plus Bildgenerierung und gpt-image-Bearbeitung.","noKey.google":"Planer plus Bildgenerierung. Braucht zusätzlich npm install @google/genai, eine optionale Peer-Abhängigkeit, die kein Paketmanager für dich installiert.","noKey.step2":"Starte den Dev-Server neu. Keys werden beim Start gelesen, ein laufender Server übernimmt keinen neuen.","noKey.reopen":"Details anzeigen","noKey.dismiss":"Schließen","noKey.foot":"Keys werden beim Start gelesen — starte den Dev-Server danach neu. Avocado nutzt deinen Key und verkauft keine Tokens weiter.","header.noKeyBadge":"API-Key hinzufügen","header.noKeyTooltip":"Die KI-Bearbeitung läuft auf dem eingebauten Demo-Planer und beherrscht nur einfache, wörtliche Änderungen. Visuelles Bearbeiten ist nicht betroffen. Trage ANTHROPIC_API_KEY (oder OPENAI_API_KEY) in .env.local ein und starte den Dev-Server neu.","demo.bannerTitle":"Du bist im Demomodus","demo.bannerBody":"Das ist ein Live-Playground. Du kannst die Hero-Sektion per Klartext bearbeiten — alles andere ist vorerst gesperrt.","demo.tryExample1":'Ändere die Hero-Überschrift zu "Willkommen auf meiner neuen Seite"',"demo.tryExample2":"Lass die Hero-Unterzeile verspielter klingen","demo.tryExample3":'Aktualisiere den Hero-CTA zu "Jetzt starten"',"demo.placeholder":"Versuch: ändere die Hero-Überschrift zu …","demoGuide.title":"Erste Schritte","demoGuide.try":"Ausprobieren","demoGuide.dismiss":"Schließen","demoGuide.step1Title":"Hero-Überschrift & Unterzeile neu schreiben","demoGuide.step1Prompt":"Schreibe die Hero-Überschrift und Unterzeile überzeugender und nutzenorientierter","demoGuide.step2Title":"Statistik-Leiste hinzufügen","demoGuide.step2Prompt":"Füge unter dem Hero eine Statistik-Leiste mit ein paar beeindruckenden Zahlen hinzu","demoGuide.step3Title":"Hero-Bild austauschen","demoGuide.step3Prompt":"Gib der ganzen Seite ein warmes, erdiges grünes Farbthema","demoGuide.step4Title":"Seite übersetzen","demoGuide.step4Prompt":"Übersetze die ganze Seite ins Deutsche","header.moreOptions":"Weitere Optionen","header.publish":"Veröffentlichen","header.publishing":"Wird veröffentlicht","header.unpublishedTooltip":"{{count}} unveröffentlichte Änderung(en) seit der letzten Veröffentlichung.","header.viewDeploy":"Deployment ansehen","header.openLiveSite":"Live-Seite öffnen","header.openImmersive":"Im Immersive-Modus öffnen","header.syncedPage":"1 Seite von der Website geladen.","header.syncedPages":"{{count}} Seiten von der Website geladen.","header.syncFailedNetwork":"Diese Seite ist nicht erreichbar. Prüfe, ob sie läuft, und versuch es erneut.","header.syncFailedEmpty":"Diese Seite hat keine Quellinhalte zum Laden.","tabs.chat":"Chat","tabs.properties":"Eigenschaften","stream.shapingUpdate":"Änderung wird vorbereitet…","stream.gettingReady":"Wird vorbereitet…","stream.updating":"Wird aktualisiert…","stream.thinking":"Denkt nach","chat.thinking.streaming":"Denkt nach…","chat.thinking.doneSeconds":"{{seconds}} s nachgedacht","chat.thinking.done":"Gedankengang","chat.thinking.showMore":"Gedanken anzeigen","chat.thinking.showLess":"Gedanken ausblenden","chat.expandDetails":"Details anzeigen","chat.copied":"Kopiert","chat.copyDebug":"Debug-Nachricht kopieren","chat.copy":"Kopieren","chat.undone":"Rückgängig gemacht","chat.undo":"Rückgängig","chat.appliedDraft":"Auf deinen Entwurf angewendet","chat.keep":"Behalten","chat.revert":"Zurücksetzen","chat.reverted":"Zurückgesetzt","chat.kept":"Behalten","chat.redo":"Wiederherstellen","chat.undoTooltip":"Rückgängig (Strg+Z)","chat.redoTooltip":"Wiederherstellen (Strg+Y)","history.title":"Versionshistorie","history.loading":"Historie wird geladen...","history.empty":"Noch keine Änderungen.","history.operation":"Operation","history.operations":"Operationen","history.tooltip":"Versionshistorie","history.restore":"Wiederherstellen","history.restoring":"Wird wiederhergestellt…","history.current":"Aktuell","history.today":"Heute","history.yesterday":"Gestern","history.undidChange":"v{{version}} rückgängig gemacht · {{summary}}","history.redidChange":"v{{version}} wiederholt · {{summary}}","history.undidUnknown":"Vorherige Änderung rückgängig gemacht","history.redidUnknown":"Zuletzt rückgängig gemachte Änderung wiederholt","history.showDetails":"Details anzeigen","history.hideDetails":"Details ausblenden","history.version":"Version","history.page":"Seite","history.changes":"Änderungen","history.publish":"Veröffentlichung","history.deploying":"Wird bereitgestellt…","history.live":"Live","history.deployFailed":"Fehlgeschlagen","history.viewDeploy":"Deploy ansehen","history.pagesPublished":"{{count}} Seiten","history.pagePublished":"1 Seite","history.pagesChanged":"{{changed}} von {{total}} Seiten geändert","history.noContentChanges":"Keine inhaltlichen Änderungen · {{count}} Seiten live","history.selectChange":"Diese Änderung auswählen","history.selectChangeNamed":"v{{version}} zum Verwerfen auswählen","history.selectedCount":"{{count}} ausgewählt","history.clearSelection":"Auswahl aufheben","history.discard":"Verwerfen","history.discarding":"Wird verworfen…","history.discardSweeps":"Setzt {{total}} Änderungen auf {{pages}} Seiten zurück — spätere Bearbeitungen dieser Seiten ebenfalls.","history.discardBlocked":"{{count}} lassen sich nicht verwerfen: davor ist nichts aufgezeichnet.","history.discardUnavailable":"Vor dieser Änderung ist nichts aufgezeichnet","history.discardPartly":"{{count}} Änderung(en) konnten nicht verworfen werden.","history.discardFailed":"Diese Änderungen konnten nicht verworfen werden.","chat.goodResponse":"Gute Antwort","chat.badResponse":"Schlechte Antwort","chat.feedbackThanks":"Danke!","chat.feedbackNoted":"Notiert","chat.feedbackPlaceholder":"Was war falsch? (optional)","chat.feedbackSend":"Senden","variation.title":"Variante wählen","variation.close":"Variantenauswahl schließen","variation.applying":"Wird angewendet…","variation.apply":'"{{title}}" anwenden',"addBlock.title":"Block hinzufügen","addBlock.close":"Blockauswahl schließen","addBlock.insertAbove":"Blocktyp auswählen, der oberhalb des ausgewählten Bereichs eingefügt wird.","addBlock.insertBelow":"Blocktyp auswählen, der unterhalb des ausgewählten Bereichs eingefügt wird.","addBlock.searchPlaceholder":"Blocktypen durchsuchen","resize.inputPanel":"Eingabebereich skalieren","resize.chatPanel":"Chatbereich skalieren","preview.title":"Live-Vorschau","preview.loading":"Vorschau wird geladen…","settings.title":"Einstellungen","settings.devTitle":"Entwicklermodus","settings.groupAppearance":"Darstellung","settings.groupEditing":"Bearbeiten","settings.groupAgent":"Agent","settings.groupDeveloper":"Entwickler","settings.developerMode":"Entwicklermodus","settings.developerModeHint":"Blendet die Gruppe „Entwickler“ oben ein: Diagnose der Vorschau-Overlays und die Debug-Karten je Nachricht.","settings.streaming":"Streaming","settings.streamingHint":"Die Antwort des Agenten beim Schreiben anzeigen, statt auf die vollständige Antwort zu warten.","settings.nestedLabels":"Verschachtelte Labels","settings.nestedLabelsHint":"Benennt in der Vorschau jedes bearbeitbare Feld innerhalb eines ausgewählten Blocks.","settings.fieldDraftTelemetry":"Feld-Entwurfs-Telemetrie","settings.fieldDraftTelemetryHint":"Zeichnet auf, welche Felder die Live-Vorschau während einer Bearbeitung aktualisiert hat, und zeigt es auf der Debug-Karte.","settings.darkMode":"Dunkler Modus","settings.theme":"Design","settings.themeHint":"„System“ folgt der Hell-/Dunkel-Einstellung deines Betriebssystems.","settings.themeSystem":"System","settings.themeLight":"Hell","settings.themeDark":"Dunkel","settings.agentMode":"Agentenmodus","settings.agentModeOn":"An","settings.agentModeOff":"Nicht konfiguriert","settings.agentModeOnHint":"Der Agent kann Werkzeuge nutzen, um deine Website direkt zu bearbeiten, statt einen Plan vorzuschlagen.","settings.agentModeOffHint":"Der Agentenmodus benötigt einen API-Schlüssel im Orchestrator. Füge diese Variable in dessen .env ein und starte ihn neu:","settings.copyEnvVar":"{{name}} kopieren","settings.cancel":"Abbrechen","settings.clearChatConfirm":"Chat leeren — erneut klicken","settings.modelHint":"Welches Modell deine Änderungen plant. Größere Modelle planen besser und kosten mehr.","settings.autoScrollTracking":"Generiertem Inhalt folgen","settings.autoScrollTrackingHint":"Scrollt die Vorschau zu jedem Block, während der Agent ihn bearbeitet.","settings.autoOpenProperties":"Eigenschaften bei Auswahl öffnen","settings.autoOpenPropertiesHint":"Öffnet die Eigenschaftenleiste, wenn du in der Vorschau einen Block anklickst. Aus lässt die Vorschau in voller Breite.","settings.debugMode":"Debug-Modus","settings.debugModeHint":"Fügt unter jeder Antwort eine Karte mit Plan, angewendeten Operationen und Laufzeiten hinzu.","settings.model":"Modell","settings.modelNoProvider":"Kein API-Key konfiguriert, daher ist kein Modell verf\\u00FCgbar. Trage einen in die .env.local deines Projekts ein und starte den Dev-Server neu.","settings.advanced":"Erweitert","settings.clearChat":"Chat leeren","settings.language":"Sprache","password.title":"Editor-Zugang","password.placeholder":"Passwort","password.incorrect":"Falsches Passwort","password.checking":"Wird geprüft…","password.continue":"Weiter","password.closedTitle":"Dieser Orchestrator weist jede Anfrage ab","password.closedBody":"Er läuft mit NODE_ENV=production und ohne konfigurierte Zugangsdaten, also antwortet jede Route mit 401 — auch die, die dieser Editor zum Laden deiner Website braucht.","password.closedFix":"Setze ACCESS_PASSWORD_HASH oder ORCHESTRATOR_ACCESS_TOKEN in der Umgebung der Website und starte sie neu, oder übergib auth an createOrchestrator(). Die Website stattdessen mit npm run dev zu starten öffnet sie ebenfalls, denn die geschlossene Voreinstellung gilt nur für Produktion.","password.unreachableTitle":"Orchestrator nicht erreichbar","password.unreachableBody":"Ob dieser Editor durch eine Zugangssperre geschützt ist, entscheidet der Orchestrator — und er hat nicht geantwortet. Solange das so bleibt, lässt sich der Zugang nicht feststellen und wird deshalb verweigert.","password.retry":"Erneut versuchen","password.retryingIn":"Automatischer neuer Versuch in {{seconds}}s…","sites.title":"Websites","sites.subtitle":"Wähle eine Website zum Bearbeiten.","sites.addSite":"Website hinzufügen","sites.addSiteTitle":"Website hinzufügen","sites.close":"Schließen","sites.siteName":"Seitenname","sites.siteNamePlaceholder":"Meine Website","sites.previewUrl":"Vorschau-URL","sites.previewUrlPlaceholder":"http://localhost:3000","sites.enablePuck":"Visuellen Editor (Puck) verwenden","sites.editorialBrief":"Redaktionelles Briefing","sites.overview":"Übersicht","sites.tone":"Tonalität","sites.constraints":"Einschränkungen","sites.templates":"Vorlagen","sites.overviewPlaceholder":"Wofür diese Seite gedacht ist.","sites.tonePlaceholder":"Wie der Text klingen soll.","sites.constraintsPlaceholder":`Regeln für die Inhaltsausgabe.
372
- Eine pro Zeile.`,"sites.templateName":"Vorlagenname (z. B. Kampagnen-Landingpage)","sites.templateDescription":"Beschreibe die Seitenstruktur: welche Bereiche, in welcher Reihenfolge, mit welchem inhaltlichen Fokus.","sites.settings":"Einstellungen","sites.openEditor":"Editor öffnen","sites.deleteSite":"Löschen","sites.confirmDelete":'"{{name}}" aus der Siteliste entfernen?',"sites.confirmDeleteTitle":"Site entfernen","sites.confirmDeleteBody":'Damit wird "{{name}}" aus deiner lokalen Siteliste entfernt. Die Site selbst wird nicht gelöscht.',"sites.switchingTo":"Wechsle zu","sites.switchInFlight":"Eine Chat-Anfrage läuft noch. Trotzdem die Site wechseln und sie verwerfen?","sites.allOffline":"Keine erreichbaren Sites","sites.allOfflineHint":'Alle Sites in deiner Liste haben den Erreichbarkeitstest nicht bestanden. Aktiviere "Offline-Sites anzeigen" oder prüfe, ob die Sites laufen.',"sites.previewUrlOverride":"Wird durch ?previewUrl= in der aktuellen URL überschrieben.","sites.orchestratorUrl":"Orchestrator-URL","sites.orchestratorUrlPlaceholder":"https://example.com/api/avocado","sites.orchestratorUrlHint":"Nur für Sites, die den Orchestrator selbst betreiben (Library-Modus). Leer lassen, um den Orchestrator des Editors zu verwenden.","sites.cancel":"Abbrechen","sites.create":"Erstellen","sites.siteConfig":"Seitenkonfiguration","sites.general":"Allgemein","sites.media":"Medien","sites.hosting":"Hosting","sites.brief":"Briefing","sites.deploy":"Deployment","sites.coreSettings":"Grundeinstellungen","sites.header":"Kopfzeile","sites.siteHeaderName":"Name in der Kopfzeile","sites.logoUrl":"Logo-URL","sites.logoUrlPlaceholder":"https://example.com/logo.svg","sites.pageTemplates":"Seitenvorlagen","sites.pageTemplatesHint":"Definiere wiederverwendbare Seitenstrukturen. Die KI ordnet Vorlagen bei der Seitenerstellung nach Name oder Absicht zu.","sites.removeTemplate":"Entfernen","sites.addTemplate":"+ Vorlage hinzufügen","sites.preferredTone":"Bevorzugte Tonalität","sites.writingConstraints":"Schreibregeln","sites.hostingPlaceholder":"Vercel-Produktionsseite","sites.vercelProjectId":"Vercel-Projekt-ID","sites.vercelProjectIdPlaceholder":"prj_...","sites.vercelTeamId":"Vercel-Team-ID","sites.vercelTeamIdPlaceholder":"team_...","sites.vercelProductionUrl":"Vercel-Produktions-URL","sites.vercelProductionUrlPlaceholder":"https://example.vercel.app","sites.vercelDeployHook":"Vercel-Deploy-Hook-URL","sites.vercelDeployHookPlaceholder":"https://api.vercel.com/v1/integrations/deploy/...","sites.googleDrive":"Google Drive","sites.googleDriveFolderId":"Google-Drive-Ordner-ID","sites.googleDrivePlaceholder":"z. B. 1aBcDeFgHiJkLmNoPqRsTuVwXyZ","sites.testing":"Wird getestet…","sites.test":"Testen","sites.driveConnectedImages":"Verbunden (Bilder gefunden)","sites.driveConnectedEmpty":"Verbunden (Ordner leer)","sites.driveError":"Orchestrator nicht erreichbar","sites.cmsMedia":"CMS-Medien","sites.provider":"Anbieter","sites.none":"Keiner","sites.spaceId":"Space-ID","sites.spaceIdPlaceholder":"abc123","sites.deliveryToken":"Delivery-Token","sites.deliveryTokenPlaceholder":"Content-Delivery-API-Token","sites.projectId":"Projekt-ID","sites.dataset":"Dataset","sites.datasetPlaceholder":"production","sites.strapiUrl":"Strapi-URL","sites.strapiUrlPlaceholder":"http://localhost:1337","sites.apiToken":"API-Token","sites.apiTokenPlaceholder":"Nur-Lese-API-Token","sites.versionHistory":"Versionshistorie","sites.restoreDescription":"Einen früheren veröffentlichten Snapshot wiederherstellen in","sites.snapshotVersion":"Snapshot-Version","sites.loadingSnapshots":"Snapshots werden geladen…","sites.restoring":"Wird wiederhergestellt…","sites.restore":"Wiederherstellen","sites.noSnapshots":"Noch keine Snapshots vorhanden.","sites.snapshotCommit":"Commit","sites.snapshotPages":"Seiten","sites.snapshotHeading":"Überschrift","sites.snapshotDate":"Datum","sites.checkingManifest":"Manifest wird geprüft…","sites.limitedEditing":"Eingeschränktes Bearbeiten","sites.editingReady":"Bearbeitung bereit","sites.checking":"Wird geprüft…","chatInput.placeholder":"Frag mich etwas","chatInput.listening":"Hört zu","chatInput.transcribing":"Wird transkribiert…","chatInput.attachFile":"Datei anhängen","chatInput.removeAttachment":"Anhang entfernen","chatInput.exitSelector":"Auswahlmodus beenden","chatInput.selectElement":"Element auswählen","chatInput.editingBlock":"Bearbeiten: {{block}}","chatInput.clearSelection":"Auswahl aufheben","chatInput.voiceActions":"Sprach- und Sendeaktionen","chatInput.cancelVoice":"Spracheingabe abbrechen","chatInput.sendRecorded":"Aufgenommene Nachricht senden","chatInput.startVoice":"Spracheingabe starten","chatInput.stopGeneration":"Generierung stoppen","chatInput.sendMessage":"Nachricht senden","chatInput.speechUnsupported":"Spracheingabe wird in diesem Browser nicht unterstützt.","chatInput.noSpeechDetected":"Keine Sprache erkannt. Bitte erneut aufnehmen.","chatInput.micBlocked":"Mikrofonzugriff ist blockiert. Bitte Mikrofonberechtigungen erlauben und erneut versuchen.","chatInput.unsupportedFile":"Nur Bilder und PDF-Dateien werden unterstützt.","chatInput.attachmentOnlyMessage":"Verwende die angehängte(n) Datei(en).","chatInput.uploadFailed":"Upload fehlgeschlagen. Bitte erneut versuchen.","chatInput.transcribeFailed":"Audiotranskription fehlgeschlagen.","imagePicker.title":"Asset-Manager","imagePicker.close":"Schließen","imagePicker.drive":"Drive","imagePicker.cms":"CMS","imagePicker.searchCms":"Medienbibliothek durchsuchen…","imagePicker.unsplash":"Unsplash","imagePicker.upload":"Hochladen","imagePicker.generate":"Generieren","imagePicker.searchDrive":"Drive-Bilder durchsuchen…","imagePicker.searchUnsplash":"Unsplash-Fotos durchsuchen…","imagePicker.search":"Suchen…","imagePicker.refreshDrive":"Von Drive aktualisieren","imagePicker.searching":"Wird gesucht…","imagePicker.typeToSearch":"Suchbegriff eingeben","imagePicker.noImages":"Keine Bilder gefunden","imagePicker.loadMore":"Mehr laden","imagePicker.loading":"Wird geladen…","imagePicker.uploadFromComputer":"Vom Computer hochladen","imagePicker.uploading":"Wird hochgeladen…","imagePicker.chooseDifferent":"Andere Datei wählen","imagePicker.orPasteUrl":"oder URL einfügen","imagePicker.urlPlaceholder":"https://example.com/image.jpg","imagePicker.uploadedImage":"Hochgeladenes Bild","imagePicker.needsKeyTitle":"Bildgenerierung ist deaktiviert","imagePicker.needsKeyBody":"Es ist kein Bild-Schlüssel konfiguriert, daher kann dieser Tab noch nichts generieren. Einer der beiden Schlüssel unten aktiviert sie — ein Anthropic-Schlüssel allein genügt nicht, da er kein Bildmodell hat.","imagePicker.needsKeyOpenAI":"generiert Bilder und ermöglicht die Bearbeitung mit gpt-image","imagePicker.needsKeyGoogle":"generiert Bilder und aktiviert den dialogbasierten Generieren-Tab. Benötigt zusätzlich npm install @google/genai — eine optionale Peer-Abhängigkeit, die kein Paketmanager automatisch installiert.","imagePicker.needsKeyRestart":"Füge einen in .env.local hinzu und starte den Dev-Server neu.","imagePicker.examplePrompt":"Wärmer machen","imagePicker.editPrompt":"Beschreibe, wie das Bild geändert werden soll…","imagePicker.generatePrompt":"Beschreibe das gewünschte Bild…","imagePicker.followUpPrompt":"Änderungen beschreiben…","imagePicker.refine":"Verfeinern","imagePicker.edit":"Bearbeiten","imagePicker.closePreview":"Vorschau schließen","imagePicker.ready":"Fertig","imagePicker.editThisImage":"Dieses Bild bearbeiten","imagePicker.editThisImageDesc":"Änderungen am aktuellen Bild beschreiben","imagePicker.generateNew":"Neu generieren","imagePicker.generateNewDesc":"Ein komplett neues Bild von Grund auf erstellen","imagePicker.useImage":"Bild verwenden","imagePicker.applyUrl":"URL anwenden","imagePicker.removeReference":"Referenz entfernen","imagePicker.attachReference":"Beispielbilder als Referenz anhängen (bis zu {{max}})","imagePicker.showOriginal":"Original anzeigen","imagePicker.showEdited":"Bearbeitet anzeigen","propertyPanel.loading":"Wird geladen…","propertyPanel.loadFailed":"Blockeigenschaften konnten nicht geladen werden","propertyPanel.loadFailedMissing":"Dieser Block ist nicht in der Seite, die der Orchestrator zurückgegeben hat","propertyPanel.loadFailedMissingHint":"Vorschau und Orchestrator zeigen möglicherweise auf verschiedene Sites. Prüfe die Orchestrator-URL in den Einstellungen der Site.","propertyPanel.loadFailedNoPage":"Diese Seite ist nicht im Entwurf","propertyPanel.loadFailedNoPageHint":"Der Orchestrator hat geantwortet, kennt aber unter dieser Adresse keine Seite für diese Session — entweder ist der Editor auf einer Seite, die dieser Entwurf nicht hat, oder er fragt einen Orchestrator, der diese Site nicht bereitstellt.","propertyPanel.loadFailedUnreachableHint":"Unter dieser Adresse hat nichts geantwortet. Prüfe, ob der Orchestrator läuft.","propertyPanel.retry":"Erneut versuchen","orchestratorMismatch.title":"Du bearbeitest die Inhalte einer anderen Site","orchestratorMismatch.detail":"{{orchestrator}} stellt diese Site nicht bereit — Seiten, Vorschau und Eigenschaften auf diesem Bildschirm gehören zu der Site, die dort tatsächlich liegt.","orchestratorMismatch.detailHosts":"{{orchestrator}} stellt {{hosted}} bereit — nicht diese Site. Seiten, Vorschau und Eigenschaften auf diesem Bildschirm gehören zu jener Site, unter dem Namen dieser.","orchestratorMismatch.useDefault":"Orchestrator des Editors verwenden","orchestratorMismatch.ownTitle":"Diese Website verwaltet ihre Inhalte woanders","orchestratorMismatch.ownDetail":"Der Editor liest Entwürfe von {{orchestrator}}, während die Website unter {{siteOrchestrator}} ihren eigenen Orchestrator betreibt. Ihre Medienbibliothek – und alles andere, was nur die Website kennt – fehlt, solange beide nicht übereinstimmen.","orchestratorMismatch.useSiteOwn":"Orchestrator dieser Website verwenden","propertyPanel.unknownBlock":"Unbekannter Blocktyp:","propertyPanel.page":"Seite","propertyPanel.close":"Eigenschaften schließen","propertyPanel.navLabel":"Nav-Label","propertyPanel.change":"Ändern","propertyPanel.chooseImage":"Bild wählen","propertyPanel.remove":"Entfernen","propertyPanel.addItem":"Eintrag hinzufügen","propertyPanel.removeItem":"Eintrag entfernen","propertyPanel.altText":"Alt-Text","propertyPanel.altPlaceholder":"Beschreibe, was auf dem Bild zu sehen ist","propertyPanel.navPlaceholder":"Seite","propertyPanel.linkPlaceholder":"Seite, URL, E-Mail oder Telefon","propertyPanel.linkBrowsePages":"Seiten durchsuchen","propertyPanel.linkNoPage":"Keine Seite unter diesem Pfad","propertyPanel.linkNoFile":"Kein Dokument unter diesem Pfad","propertyPanel.linkDidYouMean":"Meintest du {{page}}?","propertyPanel.linkNoMatches":"Keine passende Seite — wird so übernommen","propertyPanel.linkUseInternal":"Stattdessen auf {{path}} dieser Website verlinken","propertyPanel.linkNewTab":"In neuem Tab öffnen","propertyPanel.seo":"SEO","propertyPanel.seoTitle":"SEO-Titel","propertyPanel.seoTitlePlaceholder":"Standardmäßig der Seitentitel","propertyPanel.metaDescription":"Meta-Beschreibung","propertyPanel.metaDescPlaceholder":"Standardmäßig generierte Beschreibung","propertyPanel.ogImage":"Open-Graph-Bild-URL","welcome.greeting":"Willkommen bei {{name}}! Sag mir, was du ändern möchtest — ich kann Bereiche hinzufügen, Texte umschreiben, neue Seiten erstellen und mehr. Avocado Studio ist eine Research Preview, rechne also mit Ecken und Kanten.","welcome.greetingFallback":"Lass uns deine Seite in etwas Besonderes verwandeln. Ich kann Bereiche hinzufügen, Texte umschreiben, Blöcke umordnen, neue Seiten erstellen und mehr. Klicke auf etwas in der Vorschau oder sag mir, was du ändern möchtest. Avocado Studio ist eine Research Preview, rechne also mit Ecken und Kanten.","welcome.greetingDemo":"Willkommen bei {{name}} — eine Research Preview und eine Demo-Site zum Ausprobieren. Bearbeite, was du willst, schau dir den [Komponenten-Katalog]({{catalogueUrl}}) an, um zu sehen, was verfügbar ist, und wenn du bereit bist, [onboarde deine eigene Site](https://docs.avocadostudio.dev/sites). Rechne mit Ecken und Kanten — und sag uns Bescheid.","welcome.greetingScaffold":"Willkommen bei {{name}} — eine Research Preview von Avocado Studio mit dem Demo-Inhalt des Avocado Hub. Bearbeite alles, was du willst; rechne mit Ecken und Kanten. Wenn du Avocado auf deiner eigenen Site nutzen willst, siehe [die Integrationsanleitung](https://docs.avocadostudio.dev/sites).","suggestion.rewriteHero":"Hero-Überschrift umschreiben","suggestion.addTestimonials":"Einen Testimonial-Bereich hinzufügen","suggestion.addFaq":"Einen FAQ-Bereich hinzufügen","suggestion.addCta":"Einen Call-to-Action hinzufügen","suggestion.changeHeadline":"Überschrift und Untertitel ändern","suggestion.addSection":"Neuen Bereich hinzufügen","suggestion.rewriteTone":"Text umschreiben: mehr {{tone}}","suggestion.createFromTemplate":"Neue {{name}}-Seite erstellen","suggestion.createAbout":"Eine neue /about-Seite erstellen","suggestion.demoAddTestimonials":"Einen Testimonials-Bereich hinzufügen","suggestion.demoAddSection":"Einen abschließenden Call-to-Action-Bereich hinzufügen","suggestion.keylessAddTestimonials":"Add testimonials","suggestion.keylessRichText":"Add a rich text section","suggestion.keylessMetaDescription":'Set the meta description to "Fresh avocado recipes, wellness tips, and sustainability stories."',"suggestion.demoTranslate":"Übersetze die ganze Seite ins Deutsche","suggestion.demoAddFaq":"Einen FAQ-Bereich hinzufügen","suggestion.demoHeroCta":"Mach aus dem Hero einen starken Call-to-Action","streamError.failed":"Streaming-Anfrage fehlgeschlagen.","streamError.retrying":"Streaming fehlgeschlagen, wird mit Standardanfrage wiederholt…","streamError.canceling":"Wird abgebrochen…","streamError.canceled":"Vorgang gestoppt.","streamError.structuralDisabled":"Strukturelle Bearbeitungen sind für diesen Seitenkontext deaktiviert.","streamError.demoQuotaExhausted":"Diese Live-Demo wird von allen genutzt und hat vorerst ihr Nutzungslimit erreicht. Bitte versuchen Sie es in ein paar Minuten erneut – alles, was Sie bereits erstellt haben, bleibt erhalten.","ops.addedItem":"Listenelement hinzugefügt.","ops.deletedBlock":"Block gelöscht.","ops.changedImage":"Bild geändert.","ops.replacedImageAt":"{{block}} · {{field}}","ops.imageChangeFailed":"Bild konnte nicht geändert werden. Bitte erneut versuchen.","ops.imageSwap.pickAnother":"Ändern","ops.imageSwap.retry":"Erneut versuchen","ops.continueNext":"Weiter zum nächsten Schritt","plan.apply":"Übernehmen","plan.applyDestructive":"Änderungen übernehmen","plan.deletePage":"Seite löschen","plan.deletePages":"{{count}} Seiten löschen","plan.discard":"Verwerfen","fieldAi.generateAlt":"Alt-Text generieren","fieldAi.improveAccessibility":"Barrierefreiheit verbessern","fieldAi.makeDescriptive":"Beschreibender gestalten","fieldAi.optimizeSearch":"Für Suchranking optimieren","fieldAi.fitTitle":"Auf 60 Zeichen kürzen","fieldAi.addKeyword":"Primäres Schlüsselwort hinzufügen","fieldAi.suggest3":"3 Alternativen vorschlagen","fieldAi.optimizeCtr":"Für Klickrate optimieren","fieldAi.fitDescription":"Auf 160 Zeichen kürzen","fieldAi.addCallToAction":"Handlungsaufforderung hinzufügen","fieldAi.simplifyLanguage":"Sprache vereinfachen","fieldAi.expandDetail":"Mit mehr Details erweitern","fieldAi.makeConcise":"Prägnanter formulieren","fieldAi.improveClarity":"Verständlichkeit verbessern","fieldAi.adjustTone":"Ton professioneller gestalten","error.heading":"Etwas ist schiefgelaufen","error.message":"Beim Laden dieser Seite ist ein unerwarteter Fehler aufgetreten. Bitte versuche es erneut.","error.tryAgain":"Erneut versuchen","notFound.code":"404","notFound.heading":"Seite nicht gefunden","notFound.message":"Die gesuchte Seite existiert nicht oder wurde verschoben.","notFound.backHome":"Zurück zur Startseite","theme.switchLight":"Seite in den hellen Modus wechseln","theme.switchDark":"Seite in den dunklen Modus wechseln","theme.light":"Heller Modus","theme.dark":"Dunkler Modus","sitesAgent.title":"Onboarding-Agent","sitesAgent.clear":"Chat leeren","sitesAgent.welcome":"Ich kann eine neue Seite erstellen, eine bestehende Website von ihrer URL migrieren oder den Editor in dein Next.js-Projekt integrieren. Hinweis: Das ist noch früh — behandle meinen ersten Wurf als Entwurf, den du im Editor verfeinerst, besonders bei Migrationen komplexer Seiten. Was möchtest du tun?","sitesAgent.placeholder":"Frag mich etwas...","sitesAgent.suggestion1":"Neue Seite von Grund auf erstellen","sitesAgent.suggestion1Desc":"Beschreibe den Zweck deiner Seite und ich erstelle sie","sitesAgent.suggestion2":"Website von URL migrieren","sitesAgent.suggestion2Desc":"Gib mir eine URL und ich analysiere und erstelle sie neu","sitesAgent.suggestion3":"Über ein GitHub-Projekt integrieren","sitesAgent.suggestion3Desc":"Verbinde den Editor mit deiner bestehenden Next.js-App","sitesAgent.stop":"Stopp","sitesAgent.showMore":"Mehr anzeigen","sitesAgent.showLess":"Weniger anzeigen","propertyPanel.content":"Inhalt","propertyPanel.navigation":"Navigation","health.tooltip":"Website-Zustand","health.issueCount":"{{count}} Problem","health.issueCountPlural":"{{count}} Probleme","health.title":"Website-Zustand","health.run":"Prüfung jetzt starten","health.close":"Schließen","health.loading":"Wird geprüft…","health.emptyTitle":"Nichts zu beheben","health.emptyBody":"Die letzte Prüfung hat auf dieser Website keine Probleme gefunden.","health.goTo":"Anzeigen","health.snooze":"Später","health.snoozeTitle":"Eine Woche ausblenden und erneut anzeigen, falls es dann noch fehlerhaft ist","health.dismiss":"Ausblenden","health.dismissTitle":"Für diese Seite nie wieder anzeigen","health.notDurable":"Befunde werden nur im Arbeitsspeicher gehalten — sie gehen beim Neustart des Servers verloren.","linkPicker.title":"Verlinken mit","linkPicker.placeholder":"Seite, Dokument oder URL","linkPicker.noPage":"Keine Seite unter diesem Pfad","linkPicker.noFile":"Kein Dokument unter diesem Pfad","linkPicker.noMatches":"Keine passenden Seiten oder Dokumente","linkPicker.externalHint":"Verweist auf eine externe Website","linkPicker.emailHint":"Öffnet eine neue E-Mail","linkPicker.phoneHint":"Wählt eine Telefonnummer","linkPicker.anchorHint":"Springt zu einer Stelle auf dieser Seite","linkPicker.loadingFiles":"Dokumente dieser Website werden geladen ...","linkPicker.filesUnavailable":"{{orchestrator}} hat keine Dokumentliste für diese Website – der Pfad wird wie eingegeben übernommen.","linkPicker.dropHere":"Zum Hochladen loslassen","linkPicker.upload":"Dokument hochladen","linkPicker.uploadHint":"Oder eine Datei auf dieses Feld ziehen","linkPicker.uploading":"Wird hochgeladen ...","linkPicker.uploadNoUrl":"Der Upload war erfolgreich, aber die Website hat keine URL zurückgegeben.","linkPicker.remove":"Link entfernen","linkPicker.apply":"Übernehmen","common.cancel":"Abbrechen"},hk={en:IF,de:OF},hR="editor-locale",pR={en:"English",de:"Deutsch"};function mR(){try{const e=localStorage.getItem(hR);if(e&&e in hk)return e}catch{}return"en"}function gR(e){return(t,n)=>{let r=hk[e][t]??hk.en[t]??t;if(n)for(const[i,s]of Object.entries(n))r=r.replaceAll(`{{${i}}}`,String(s));return r}}function PF(e){return gR(e)}const bR=E.createContext(null);function zF({children:e}){const[t,n]=E.useState(mR),r=E.useCallback(o=>{try{localStorage.setItem(hR,o)}catch{}n(o)},[]),i=E.useMemo(()=>gR(t),[t]),s=E.useMemo(()=>({locale:t,setLocale:r,t:i}),[t,r,i]);return p.jsx(bR,{value:s,children:e})}function Mn(){const e=E.useContext(bR);if(!e)throw new Error("useT must be used within <LocaleProvider>");return e}const LT=e=>{let t;const n=new Set,r=(d,f)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const g=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(y=>y(t,g))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=t=e(r,i,a);return a},LF=(e=>e?LT(e):LT),BF=e=>e;function FF(e,t=BF){const n=qn.useSyncExternalStore(e.subscribe,qn.useCallback(()=>t(e.getState()),[e,t]),qn.useCallback(()=>t(e.getInitialState()),[e,t]));return qn.useDebugValue(n),n}const BT=e=>{const t=LF(e),n=r=>FF(t,r);return Object.assign(n,t),n},yR=(e=>e?BT(e):BT),$F=e=>(t,n,r)=>{const i=r.subscribe;return r.subscribe=((o,a,u)=>{let d=o;if(a){const f=(u==null?void 0:u.equalityFn)||Object.is;let m=o(r.getState());d=g=>{const y=o(g);if(!f(m,y)){const x=m;a(m=y,x)}},u!=null&&u.fireImmediately&&a(m,m)}return i(d)}),e(t,n,r)},UF=$F,HF=new Set(["1","true","yes","on"]),VF=new Set(["0","false","no","off"]);function zo(e,t){const n=e==null?void 0:e.trim().toLowerCase();return n?HF.has(n)?!0:VF.has(n)?!1:t:t}function qF(e){return e.replace(/imageUrl$/i,"imageAlt").replace(/\.src$/i,".alt")}function xe(e,t,n){function r(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,u);const d=o.prototype,f=Object.keys(d);for(let m=0;m<f.length;m++){const g=f[m];g in a||(a[g]=d[g].bind(a))}}const i=(n==null?void 0:n.Parent)??Object;class s extends i{}Object.defineProperty(s,"name",{value:e});function o(a){var u;const d=n!=null&&n.Parent?new s:this;r(d,a),(u=d._zod).deferred??(u.deferred=[]);for(const f of d._zod.deferred)f();return d}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>{var u,d;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(d=(u=a==null?void 0:a._zod)==null?void 0:u.traits)==null?void 0:d.has(e)}}),Object.defineProperty(o,"name",{value:e}),o}class ud extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class xR extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const vR={};function Pl(e){return vR}function kR(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function pk(e,t){return typeof t=="bigint"?t.toString():t}function pb(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function QS(e){return e==null}function ew(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function KF(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const u=r.match(/\d?e-(\d?)/);u!=null&&u[1]&&(i=Number.parseInt(u[1]))}const s=n>i?n:i,o=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return o%a/10**s}const FT=Symbol("evaluating");function Jt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==FT)return r===void 0&&(r=FT,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function nc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ql(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function $T(e){return JSON.stringify(e)}function GF(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const SR="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ih(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const WF=pb(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function vd(e){if(Ih(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Ih(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function wR(e){return vd(e)?{...e}:Array.isArray(e)?[...e]:e}const ZF=new Set(["string","number","symbol"]);function kd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Kl(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function Xe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function YF(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const JF={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function XF(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=ql(e._zod.def,{get shape(){const o={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=n.shape[a])}return nc(this,"shape",o),o},checks:[]});return Kl(e,s)}function QF(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=ql(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete o[a]}return nc(this,"shape",o),o},checks:[]});return Kl(e,s)}function e$(e,t){if(!vd(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=ql(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return nc(this,"shape",s),s}});return Kl(e,i)}function t$(e,t){if(!vd(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ql(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return nc(this,"shape",r),r}});return Kl(e,n)}function n$(e,t){const n=ql(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return nc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Kl(e,n)}function r$(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=ql(t._zod.def,{get shape(){const a=t._zod.def.shape,u={...a};if(n)for(const d in n){if(!(d in a))throw new Error(`Unrecognized key: "${d}"`);n[d]&&(u[d]=e?new e({type:"optional",innerType:a[d]}):a[d])}else for(const d in a)u[d]=e?new e({type:"optional",innerType:a[d]}):a[d];return nc(this,"shape",u),u},checks:[]});return Kl(t,o)}function i$(e,t,n){const r=ql(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(n)for(const o in n){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(s[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)s[o]=new e({type:"nonoptional",innerType:i[o]});return nc(this,"shape",s),s}});return Kl(t,r)}function od(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function ad(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function qm(e){return typeof e=="string"?e:e==null?void 0:e.message}function zl(e,t,n){var i,s,o,a,u,d;const r={...e,path:e.path??[]};if(!e.message){const f=qm((o=(s=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:s.error)==null?void 0:o.call(s,e))??qm((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??qm((u=n.customError)==null?void 0:u.call(n,e))??qm((d=n.localeError)==null?void 0:d.call(n,e))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function tw(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Oh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const CR=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,pk,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ER=xe("$ZodError",CR),_R=xe("$ZodError",CR,{Parent:Error});function s$(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function o$(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>r({issues:o}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let o=n,a=0;for(;a<s.path.length;){const u=s.path[a];a===s.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(s))):o[u]=o[u]||{_errors:[]},o=o[u],a++}}};return r(e),n}const nw=e=>(t,n,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new ud;if(o.issues.length){const a=new((i==null?void 0:i.Err)??e)(o.issues.map(u=>zl(u,s,Pl())));throw SR(a,i==null?void 0:i.callee),a}return o.value},rw=e=>async(t,n,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new((i==null?void 0:i.Err)??e)(o.issues.map(u=>zl(u,s,Pl())));throw SR(a,i==null?void 0:i.callee),a}return o.value},mb=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new ud;return s.issues.length?{success:!1,error:new(e??ER)(s.issues.map(o=>zl(o,i,Pl())))}:{success:!0,data:s.value}},a$=mb(_R),gb=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(o=>zl(o,i,Pl())))}:{success:!0,data:s.value}},l$=gb(_R),u$=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return nw(e)(t,n,i)},c$=e=>(t,n,r)=>nw(e)(t,n,r),d$=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return rw(e)(t,n,i)},f$=e=>async(t,n,r)=>rw(e)(t,n,r),h$=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return mb(e)(t,n,i)},p$=e=>(t,n,r)=>mb(e)(t,n,r),m$=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gb(e)(t,n,i)},g$=e=>async(t,n,r)=>gb(e)(t,n,r),b$=/^[cC][^\s-]{8,}$/,y$=/^[0-9a-z]+$/,x$=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,v$=/^[0-9a-vA-V]{20}$/,k$=/^[A-Za-z0-9]{27}$/,S$=/^[a-zA-Z0-9_-]{21}$/,w$=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,C$=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,UT=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,E$=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function T$(){return new RegExp(_$,"u")}const A$=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,N$=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,M$=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,D$=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,R$=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,TR=/^[A-Za-z0-9_-]*$/,j$=/^\+[1-9]\d{6,14}$/,AR="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",I$=new RegExp(`^${AR}$`);function NR(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function O$(e){return new RegExp(`^${NR(e)}$`)}function P$(e){const t=NR({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${AR}T(?:${r})$`)}const z$=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},L$=/^-?\d+$/,MR=/^-?\d+(?:\.\d+)?$/,B$=/^(?:true|false)$/i,F$=/^[^A-Z]*$/,$$=/^[^a-z]*$/,qi=xe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),DR={number:"number",bigint:"bigint",object:"date"},RR=xe("$ZodCheckLessThan",(e,t)=>{qi.init(e,t);const n=DR[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),jR=xe("$ZodCheckGreaterThan",(e,t)=>{qi.init(e,t);const n=DR[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),U$=xe("$ZodCheckMultipleOf",(e,t)=>{qi.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):KF(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),H$=xe("$ZodCheckNumberFormat",(e,t)=>{var o;qi.init(e,t),t.format=t.format||"float64";const n=(o=t.format)==null?void 0:o.includes("int"),r=n?"int":"number",[i,s]=JF[t.format];e._zod.onattach.push(a=>{const u=a._zod.bag;u.format=t.format,u.minimum=i,u.maximum=s,n&&(u.pattern=L$)}),e._zod.check=a=>{const u=a.value;if(n){if(!Number.isInteger(u)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?a.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}u<i&&a.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>s&&a.issues.push({origin:"number",input:u,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),V$=xe("$ZodCheckMaxLength",(e,t)=>{var n;qi.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!QS(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=tw(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),q$=xe("$ZodCheckMinLength",(e,t)=>{var n;qi.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!QS(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=tw(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),K$=xe("$ZodCheckLengthEquals",(e,t)=>{var n;qi.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!QS(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,s=i.length;if(s===t.length)return;const o=tw(i),a=s>t.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),bb=xe("$ZodCheckStringFormat",(e,t)=>{var n,r;qi.init(e,t),e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),G$=xe("$ZodCheckRegex",(e,t)=>{bb.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),W$=xe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=F$),bb.init(e,t)}),Z$=xe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$$),bb.init(e,t)}),Y$=xe("$ZodCheckIncludes",(e,t)=>{qi.init(e,t);const n=kd(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),J$=xe("$ZodCheckStartsWith",(e,t)=>{qi.init(e,t);const n=new RegExp(`^${kd(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),X$=xe("$ZodCheckEndsWith",(e,t)=>{qi.init(e,t);const n=new RegExp(`.*${kd(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Q$=xe("$ZodCheckOverwrite",(e,t)=>{qi.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class e7{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
371
+ One per line.`,"sites.templateName":"Template name (e.g. Campaign Landing Page)","sites.templateDescription":"Describe the page structure: which sections, in what order, with what content focus.","sites.settings":"Settings","sites.openEditor":"Open editor","sites.deleteSite":"Delete","sites.confirmDelete":'Remove "{{name}}" from your site list?',"sites.confirmDeleteTitle":"Remove site","sites.confirmDeleteBody":'This removes "{{name}}" from your local site list. The site itself is not deleted.',"sites.switchingTo":"Switching to","sites.switchInFlight":"A chat request is still in progress. Switch sites anyway and discard it?","sites.allOffline":"No reachable sites","sites.allOfflineHint":'All sites in your list failed a quick reachability check. Toggle "Show offline sites" to see them, or check that the sites are running.',"sites.previewUrlOverride":"Overridden by ?previewUrl= in the current URL.","sites.orchestratorUrl":"Orchestrator URL","sites.orchestratorUrlPlaceholder":"https://example.com/api/avocado","sites.orchestratorUrlHint":"Only for a site that runs the orchestrator itself (library mode). Leave empty to use the editor's own orchestrator.","sites.cancel":"Cancel","sites.create":"Create","sites.siteConfig":"Site Config","sites.general":"General","sites.media":"Media","sites.hosting":"Hosting","sites.brief":"Brief","sites.deploy":"Deploy","sites.coreSettings":"Core settings","sites.header":"Header","sites.siteHeaderName":"Site header name","sites.logoUrl":"Logo URL","sites.logoUrlPlaceholder":"https://example.com/logo.svg","sites.pageTemplates":"Page templates","sites.pageTemplatesHint":"Define reusable page structures. The AI will match templates by name or intent when creating pages.","sites.removeTemplate":"Remove","sites.addTemplate":"+ Add template","sites.preferredTone":"Preferred tone","sites.writingConstraints":"Writing constraints","sites.hostingPlaceholder":"Vercel production site","sites.vercelProjectId":"Vercel project ID","sites.vercelProjectIdPlaceholder":"prj_...","sites.vercelTeamId":"Vercel team ID","sites.vercelTeamIdPlaceholder":"team_...","sites.vercelProductionUrl":"Vercel production URL","sites.vercelProductionUrlPlaceholder":"https://example.vercel.app","sites.vercelDeployHook":"Vercel deploy hook URL","sites.vercelDeployHookPlaceholder":"https://api.vercel.com/v1/integrations/deploy/...","sites.googleDrive":"Google Drive","sites.googleDriveFolderId":"Google Drive folder ID","sites.googleDrivePlaceholder":"e.g. 1aBcDeFgHiJkLmNoPqRsTuVwXyZ","sites.testing":"Testing...","sites.test":"Test","sites.driveConnectedImages":"Connected (images found)","sites.driveConnectedEmpty":"Connected (folder empty)","sites.driveError":"Could not reach orchestrator","sites.cmsMedia":"CMS Media","sites.provider":"Provider","sites.none":"None","sites.spaceId":"Space ID","sites.spaceIdPlaceholder":"abc123","sites.deliveryToken":"Delivery Token","sites.deliveryTokenPlaceholder":"Content Delivery API token","sites.projectId":"Project ID","sites.dataset":"Dataset","sites.datasetPlaceholder":"production","sites.strapiUrl":"Strapi URL","sites.strapiUrlPlaceholder":"http://localhost:1337","sites.apiToken":"API Token","sites.apiTokenPlaceholder":"Read-only API token","sites.versionHistory":"Version History","sites.restoreDescription":"Restore a previous published snapshot into","sites.snapshotVersion":"Snapshot version","sites.loadingSnapshots":"Loading snapshots...","sites.restoring":"Restoring...","sites.restore":"Restore","sites.noSnapshots":"No snapshots available yet.","sites.snapshotCommit":"Commit","sites.snapshotPages":"Pages","sites.snapshotHeading":"Heading","sites.snapshotDate":"Date","sites.checkingManifest":"Checking manifest...","sites.limitedEditing":"Limited editing","sites.editingReady":"Editing ready","sites.checking":"Checking...","chatInput.placeholder":"Ask anything","chatInput.listening":"Listening","chatInput.transcribing":"Transcribing...","chatInput.attachFile":"Attach file","chatInput.removeAttachment":"Remove attachment","chatInput.exitSelector":"Exit selector mode","chatInput.selectElement":"Select an element","chatInput.editingBlock":"Editing: {{block}}","chatInput.clearSelection":"Clear selection","chatInput.voiceActions":"Voice and send actions","chatInput.cancelVoice":"Cancel voice input","chatInput.sendRecorded":"Send recorded message","chatInput.startVoice":"Start voice input","chatInput.stopGeneration":"Stop generation","chatInput.sendMessage":"Send message","chatInput.speechUnsupported":"Speech input is not supported in this browser.","chatInput.noSpeechDetected":"No speech detected. Try recording again.","chatInput.micBlocked":"Microphone access is blocked. Please allow mic permissions and try again.","chatInput.unsupportedFile":"Only images and PDF files are supported.","chatInput.attachmentOnlyMessage":"Use the attached file(s).","chatInput.uploadFailed":"Upload failed. Please try again.","chatInput.transcribeFailed":"Failed to transcribe audio.","imagePicker.title":"Asset Manager","imagePicker.close":"Close","imagePicker.drive":"Drive","imagePicker.cms":"CMS","imagePicker.searchCms":"Search media library…","imagePicker.unsplash":"Unsplash","imagePicker.upload":"Upload","imagePicker.generate":"Generate","imagePicker.searchDrive":"Search Drive images...","imagePicker.searchUnsplash":"Search Unsplash photos...","imagePicker.search":"Search...","imagePicker.refreshDrive":"Refresh from Drive","imagePicker.searching":"Searching...","imagePicker.typeToSearch":"Type to search Unsplash","imagePicker.noImages":"No images found","imagePicker.loadMore":"Load more","imagePicker.loading":"Loading...","imagePicker.uploadFromComputer":"Upload from computer","imagePicker.uploading":"Uploading...","imagePicker.chooseDifferent":"Choose different file","imagePicker.orPasteUrl":"or paste a URL","imagePicker.urlPlaceholder":"https://example.com/image.jpg","imagePicker.uploadedImage":"Uploaded image","imagePicker.needsKeyTitle":"Image generation is off","imagePicker.needsKeyBody":"No image key is configured, so this tab cannot generate anything yet. Either key below switches it on — an Anthropic key alone does not, because it has no image model.","imagePicker.needsKeyOpenAI":"generates images, and powers gpt-image editing","imagePicker.needsKeyGoogle":"generates images, and enables the conversational Generate tab. Also needs npm install @google/genai, which is an optional peer dependency no package manager installs for you.","imagePicker.needsKeyRestart":"Add one to .env.local and restart the dev server.","imagePicker.examplePrompt":"Make it warmer","imagePicker.editPrompt":"Describe how to change this image…","imagePicker.generatePrompt":"Describe the image you want…","imagePicker.followUpPrompt":"Ask for changes…","imagePicker.refine":"Refine","imagePicker.edit":"Edit","imagePicker.closePreview":"Close preview","imagePicker.ready":"Ready","imagePicker.editThisImage":"Edit this image","imagePicker.editThisImageDesc":"Describe changes to the current image","imagePicker.generateNew":"Generate new","imagePicker.generateNewDesc":"Create a completely new image from scratch","imagePicker.useImage":"Use image","imagePicker.applyUrl":"Apply URL","imagePicker.removeReference":"Remove reference","imagePicker.attachReference":"Attach example images for AI to reference (up to {{max}})","imagePicker.showOriginal":"Show original","imagePicker.showEdited":"Show edited","propertyPanel.loading":"Loading...","propertyPanel.loadFailed":"Failed to load block properties","propertyPanel.loadFailedMissing":"This block is not in the page the orchestrator returned","propertyPanel.loadFailedMissingHint":"The preview and the orchestrator may be pointed at different sites. Check the site's Orchestrator URL in its settings.","propertyPanel.loadFailedNoPage":"This page is not in the draft","propertyPanel.loadFailedNoPageHint":"The orchestrator answered, but it has no page at this address for this session — either the editor is on a page this draft does not have, or it is asking an orchestrator that does not host this site.","propertyPanel.loadFailedUnreachableHint":"Nothing answered at this address. Check that the orchestrator is running.","propertyPanel.retry":"Try again","orchestratorMismatch.title":"You are editing another site's content","orchestratorMismatch.detail":"{{orchestrator}} does not host this site, so the pages, preview and properties on this screen belong to whatever it does host.","orchestratorMismatch.detailHosts":"{{orchestrator}} hosts {{hosted}} — not this site — so the pages, preview and properties on this screen are that site's, under this site's name.","orchestratorMismatch.useDefault":"Use the editor's own orchestrator","orchestratorMismatch.ownTitle":"This site keeps its content somewhere else","orchestratorMismatch.ownDetail":"The editor is reading drafts from {{orchestrator}}, while the site runs its own orchestrator at {{siteOrchestrator}}. Its media library, and anything else only the site knows, is missing until they match.","orchestratorMismatch.useSiteOwn":"Use this site's orchestrator","propertyPanel.unknownBlock":"Unknown block type:","propertyPanel.page":"Page","propertyPanel.close":"Close properties","propertyPanel.navLabel":"Nav label","propertyPanel.change":"Change","propertyPanel.chooseImage":"Choose image","propertyPanel.remove":"Remove","propertyPanel.addItem":"Add item","propertyPanel.removeItem":"Remove item","propertyPanel.altText":"Alt text","propertyPanel.altPlaceholder":"Describe what's in this image","propertyPanel.navPlaceholder":"Page","propertyPanel.linkPlaceholder":"Page, URL, email or phone","propertyPanel.linkBrowsePages":"Browse pages","propertyPanel.linkNoPage":"No page at this path","propertyPanel.linkNoFile":"No document at this path","propertyPanel.linkDidYouMean":"Did you mean {{page}}?","propertyPanel.linkNoMatches":"No matching page — this is used as typed","propertyPanel.linkUseInternal":"Link to {{path}} on this site instead","propertyPanel.linkNewTab":"Open in new tab","propertyPanel.seo":"SEO","propertyPanel.seoTitle":"SEO title","propertyPanel.seoTitlePlaceholder":"Defaults to page title","propertyPanel.metaDescription":"Meta description","propertyPanel.metaDescPlaceholder":"Defaults to generated description","propertyPanel.ogImage":"Open Graph image URL","welcome.greeting":`**Tell me what to change** and I’ll edit the page as you describe it.
372
+
373
+ - Sections, copy, images, whole new pages.
374
+ - Click anything in the preview to point at it.
375
+ - Research preview, so expect rough edges.`,"welcome.greetingFallback":`**Tell me what to change** and I’ll edit the page as you describe it.
376
+
377
+ - Sections, copy, images, whole new pages.
378
+ - Click anything in the preview to point at it.
379
+ - Research preview, so expect rough edges.`,"welcome.greetingDemo":`**Tell me what to change** and I’ll edit {{name}} as you describe it.
380
+
381
+ - Demo site — edit anything, nothing here is precious.
382
+ - See what you can add in the [component catalogue]({{catalogueUrl}}).
383
+ - Research preview, so expect rough edges.
384
+
385
+ **[Set up your own site →](https://docs.avocadostudio.dev/sites)**`,"welcome.greetingScaffold":`**Tell me what to change** and I’ll edit {{name}} as you describe it.
386
+
387
+ - You’re on the Avocado Hub demo content, so edit freely.
388
+ - Research preview, so expect rough edges.
389
+
390
+ **[Set up your own site →](https://docs.avocadostudio.dev/sites)**`,"suggestion.rewriteHero":"Rewrite the hero headline","suggestion.addTestimonials":"Add a testimonials section","suggestion.addFaq":"Add an FAQ section","suggestion.addCta":"Add a call-to-action","suggestion.changeHeadline":"Change the headline and subheading","suggestion.addSection":"Add a new section","suggestion.rewriteTone":"Rewrite the copy to sound more {{tone}}","suggestion.createFromTemplate":"Create a new {{name}} page","suggestion.createAbout":"Create a new /about page","suggestion.demoAddTestimonials":"Add a testimonials section","suggestion.demoAddSection":"Add a closing call-to-action section","suggestion.keylessAddTestimonials":"Add testimonials","suggestion.keylessRichText":"Add a rich text section","suggestion.keylessMetaDescription":'Set the meta description to "Fresh avocado recipes, wellness tips, and sustainability stories."',"suggestion.demoTranslate":"Translate the whole page to German","suggestion.demoAddFaq":"Add an FAQ section","suggestion.demoHeroCta":"Turn the hero into a bold call-to-action","streamError.failed":"Streaming request failed.","streamError.retrying":"Streaming failed, retrying with standard request...","streamError.canceling":"Canceling...","streamError.canceled":"Stopped this request.","streamError.structuralDisabled":"Structural edits are disabled for this site context.","streamError.demoQuotaExhausted":"This live demo is shared by everyone and has reached its usage limit for now. Please try again in a few minutes — anything you've already created is still here.","ops.addedItem":"Added list item.","ops.deletedBlock":"Deleted block.","ops.changedImage":"Changed image.","ops.replacedImageAt":"{{block}} · {{field}}","ops.imageChangeFailed":"Couldn't change the image. Please try again.","ops.imageSwap.pickAnother":"Change","ops.imageSwap.retry":"Try again","ops.continueNext":"Continue to next step","plan.apply":"Apply","plan.applyDestructive":"Apply changes","plan.deletePage":"Delete page","plan.deletePages":"Delete {{count}} pages","plan.discard":"Discard","fieldAi.generateAlt":"Generate alt text","fieldAi.improveAccessibility":"Improve accessibility","fieldAi.makeDescriptive":"Make more descriptive","fieldAi.optimizeSearch":"Optimize for search ranking","fieldAi.fitTitle":"Fit within 60 characters","fieldAi.addKeyword":"Add primary keyword","fieldAi.suggest3":"Suggest 3 alternatives","fieldAi.optimizeCtr":"Optimize for click-through rate","fieldAi.fitDescription":"Fit within 160 characters","fieldAi.addCallToAction":"Add a call to action","fieldAi.simplifyLanguage":"Simplify language","fieldAi.expandDetail":"Expand with more detail","fieldAi.makeConcise":"Make more concise","fieldAi.improveClarity":"Improve clarity","fieldAi.adjustTone":"Adjust tone to be more professional","error.heading":"Something went wrong","error.message":"An unexpected error occurred while loading this page. Please try again.","error.tryAgain":"Try again","notFound.code":"404","notFound.heading":"Page not found","notFound.message":"The page you're looking for doesn't exist or has been moved.","notFound.backHome":"Back to home","theme.switchLight":"Switch site to light mode","theme.switchDark":"Switch site to dark mode","theme.light":"Light mode","theme.dark":"Dark mode","sitesAgent.title":"Onboarding agent","sitesAgent.clear":"Clear chat","sitesAgent.welcome":"I can create a new site from scratch, migrate an existing website from its URL, or integrate the editor into your Next.js project. Heads up: this is early — treat my first pass as a draft you'll refine in the editor, especially for migrations of complex sites. What would you like to do?","sitesAgent.placeholder":"Ask me anything...","sitesAgent.suggestion1":"Create a new site from scratch","sitesAgent.suggestion1Desc":"Describe your site's purpose and I'll scaffold it","sitesAgent.suggestion2":"Migrate a website from URL","sitesAgent.suggestion2Desc":"Give me a URL and I'll analyze and recreate it","sitesAgent.suggestion3":"Integrate using a GitHub project","sitesAgent.suggestion3Desc":"Connect the editor to your existing Next.js app","sitesAgent.stop":"Stop","sitesAgent.showMore":"Show more","sitesAgent.showLess":"Show less","propertyPanel.content":"Content","propertyPanel.navigation":"Navigation","health.tooltip":"Site health","health.issueCount":"{{count}} issue","health.issueCountPlural":"{{count}} issues","health.title":"Site health","health.run":"Run checks now","health.close":"Close","health.loading":"Checking…","health.emptyTitle":"Nothing to fix","health.emptyBody":"The last check found no problems on this site.","health.goTo":"Go to","health.snooze":"Snooze","health.snoozeTitle":"Hide for a week, then show it again if it is still wrong","health.dismiss":"Dismiss","health.dismissTitle":"Never show this again for this page","health.notDurable":"Findings are being kept in memory only — they will be lost when the server restarts.","linkPicker.title":"Link to","linkPicker.placeholder":"Page, document, or URL","linkPicker.noPage":"No page at this path","linkPicker.noFile":"No document at this path","linkPicker.noMatches":"No pages or documents match","linkPicker.externalHint":"Links to an external site","linkPicker.emailHint":"Opens a new email","linkPicker.phoneHint":"Dials a phone number","linkPicker.anchorHint":"Jumps to a spot on this page","linkPicker.loadingFiles":"Looking up this site's documents...","linkPicker.filesUnavailable":"{{orchestrator}} has no document list for this site, so the path is used as typed.","linkPicker.dropHere":"Drop to upload","linkPicker.upload":"Upload a document","linkPicker.uploadHint":"Or drop a file onto this panel","linkPicker.uploading":"Uploading...","linkPicker.uploadNoUrl":"The upload succeeded but the site returned no URL to link to.","linkPicker.remove":"Remove link","linkPicker.apply":"Apply","common.cancel":"Cancel"},OF={"header.siteSettings":"Seiteneinstellungen","header.syncFromSite":"Von Seite laden","header.syncFromSiteTitle":"Neueste Inhalte aus der Quelle dieser Seite laden","header.allSites":"Alle Seiten","header.page":"Seite","header.language":"Sprache","header.defaultLanguage":"Standard","header.pagesWithoutLanguage":"Ohne Sprachzuordnung","header.viewAllSites":"Alle Websites anzeigen","header.limited":"Eingeschränkt","noKey.title":"KI-Bearbeitung läuft ohne API-Key","noKey.body":"Visuelles Bearbeiten funktioniert bereits vollständig — die Seiten rendern, Klick-zum-Auswählen funktioniert, und das Eigenschaften-Panel bearbeitet echte Felder. Nur die KI-Bearbeitung braucht ein Modell, und im Moment antwortet ein eingebauter Planer, der einfache, wörtliche Änderungen beherrscht.","noKey.step1":"Key eintragen in","noKey.bodyShort":"Visuelles Bearbeiten funktioniert vollständig — Block anklicken, Felder im Eigenschaften-Panel ändern, veröffentlichen. Nur die KI-Bearbeitung ist eingeschränkt: Ohne Key übernimmt ein eingebauter Demo-Planer und schafft nur einfache, wörtliche Änderungen.","noKey.whichKey":"Welchen Key soll ich nehmen?","noKey.step1Path":".env.local im Projektverzeichnis","noKey.anthropic":"der am besten getestete Planer. Nur Chat, keine Bildgenerierung.","noKey.openai":"Planer plus Bildgenerierung und gpt-image-Bearbeitung.","noKey.google":"Planer plus Bildgenerierung. Braucht zusätzlich npm install @google/genai, eine optionale Peer-Abhängigkeit, die kein Paketmanager für dich installiert.","noKey.step2":"Starte den Dev-Server neu. Keys werden beim Start gelesen, ein laufender Server übernimmt keinen neuen.","noKey.reopen":"Details anzeigen","noKey.dismiss":"Schließen","noKey.foot":"Keys werden beim Start gelesen — starte den Dev-Server danach neu. Avocado nutzt deinen Key und verkauft keine Tokens weiter.","header.noKeyBadge":"API-Key hinzufügen","header.noKeyTooltip":"Die KI-Bearbeitung läuft auf dem eingebauten Demo-Planer und beherrscht nur einfache, wörtliche Änderungen. Visuelles Bearbeiten ist nicht betroffen. Trage ANTHROPIC_API_KEY (oder OPENAI_API_KEY) in .env.local ein und starte den Dev-Server neu.","demo.bannerTitle":"Du bist im Demomodus","demo.bannerBody":"Das ist ein Live-Playground. Du kannst die Hero-Sektion per Klartext bearbeiten — alles andere ist vorerst gesperrt.","demo.tryExample1":'Ändere die Hero-Überschrift zu "Willkommen auf meiner neuen Seite"',"demo.tryExample2":"Lass die Hero-Unterzeile verspielter klingen","demo.tryExample3":'Aktualisiere den Hero-CTA zu "Jetzt starten"',"demo.placeholder":"Versuch: ändere die Hero-Überschrift zu …","demoGuide.title":"Erste Schritte","demoGuide.try":"Ausprobieren","demoGuide.dismiss":"Schließen","demoGuide.step1Title":"Hero-Überschrift & Unterzeile neu schreiben","demoGuide.step1Prompt":"Schreibe die Hero-Überschrift und Unterzeile überzeugender und nutzenorientierter","demoGuide.step2Title":"Statistik-Leiste hinzufügen","demoGuide.step2Prompt":"Füge unter dem Hero eine Statistik-Leiste mit ein paar beeindruckenden Zahlen hinzu","demoGuide.step3Title":"Hero-Bild austauschen","demoGuide.step3Prompt":"Gib der ganzen Seite ein warmes, erdiges grünes Farbthema","demoGuide.step4Title":"Seite übersetzen","demoGuide.step4Prompt":"Übersetze die ganze Seite ins Deutsche","header.moreOptions":"Weitere Optionen","header.publish":"Veröffentlichen","header.publishing":"Wird veröffentlicht","header.unpublishedTooltip":"{{count}} unveröffentlichte Änderung(en) seit der letzten Veröffentlichung.","header.viewDeploy":"Deployment ansehen","header.openLiveSite":"Live-Seite öffnen","header.openImmersive":"Im Immersive-Modus öffnen","header.syncedPage":"1 Seite von der Website geladen.","header.syncedPages":"{{count}} Seiten von der Website geladen.","header.syncFailedNetwork":"Diese Seite ist nicht erreichbar. Prüfe, ob sie läuft, und versuch es erneut.","header.syncFailedEmpty":"Diese Seite hat keine Quellinhalte zum Laden.","tabs.chat":"Chat","tabs.properties":"Eigenschaften","stream.shapingUpdate":"Änderung wird vorbereitet…","stream.gettingReady":"Wird vorbereitet…","stream.updating":"Wird aktualisiert…","stream.thinking":"Denkt nach","chat.thinking.streaming":"Denkt nach…","chat.thinking.doneSeconds":"{{seconds}} s nachgedacht","chat.thinking.done":"Gedankengang","chat.thinking.showMore":"Gedanken anzeigen","chat.thinking.showLess":"Gedanken ausblenden","chat.expandDetails":"Details anzeigen","chat.copied":"Kopiert","chat.copyDebug":"Debug-Nachricht kopieren","chat.copy":"Kopieren","chat.undone":"Rückgängig gemacht","chat.undo":"Rückgängig","chat.appliedDraft":"Auf deinen Entwurf angewendet","chat.keep":"Behalten","chat.revert":"Zurücksetzen","chat.reverted":"Zurückgesetzt","chat.kept":"Behalten","chat.redo":"Wiederherstellen","chat.undoTooltip":"Rückgängig (Strg+Z)","chat.redoTooltip":"Wiederherstellen (Strg+Y)","history.title":"Versionshistorie","history.loading":"Historie wird geladen...","history.empty":"Noch keine Änderungen.","history.operation":"Operation","history.operations":"Operationen","history.tooltip":"Versionshistorie","history.restore":"Wiederherstellen","history.restoring":"Wird wiederhergestellt…","history.current":"Aktuell","history.today":"Heute","history.yesterday":"Gestern","history.undidChange":"v{{version}} rückgängig gemacht · {{summary}}","history.redidChange":"v{{version}} wiederholt · {{summary}}","history.undidUnknown":"Vorherige Änderung rückgängig gemacht","history.redidUnknown":"Zuletzt rückgängig gemachte Änderung wiederholt","history.showDetails":"Details anzeigen","history.hideDetails":"Details ausblenden","history.version":"Version","history.page":"Seite","history.changes":"Änderungen","history.publish":"Veröffentlichung","history.deploying":"Wird bereitgestellt…","history.live":"Live","history.deployFailed":"Fehlgeschlagen","history.viewDeploy":"Deploy ansehen","history.pagesPublished":"{{count}} Seiten","history.pagePublished":"1 Seite","history.pagesChanged":"{{changed}} von {{total}} Seiten geändert","history.noContentChanges":"Keine inhaltlichen Änderungen · {{count}} Seiten live","history.selectChange":"Diese Änderung auswählen","history.selectChangeNamed":"v{{version}} zum Verwerfen auswählen","history.selectedCount":"{{count}} ausgewählt","history.clearSelection":"Auswahl aufheben","history.discard":"Verwerfen","history.discarding":"Wird verworfen…","history.discardSweeps":"Setzt {{total}} Änderungen auf {{pages}} Seiten zurück — spätere Bearbeitungen dieser Seiten ebenfalls.","history.discardBlocked":"{{count}} lassen sich nicht verwerfen: davor ist nichts aufgezeichnet.","history.discardUnavailable":"Vor dieser Änderung ist nichts aufgezeichnet","history.discardPartly":"{{count}} Änderung(en) konnten nicht verworfen werden.","history.discardFailed":"Diese Änderungen konnten nicht verworfen werden.","chat.goodResponse":"Gute Antwort","chat.badResponse":"Schlechte Antwort","chat.feedbackThanks":"Danke!","chat.feedbackNoted":"Notiert","chat.feedbackPlaceholder":"Was war falsch? (optional)","chat.feedbackSend":"Senden","variation.title":"Variante wählen","variation.close":"Variantenauswahl schließen","variation.applying":"Wird angewendet…","variation.apply":'"{{title}}" anwenden',"addBlock.title":"Block hinzufügen","addBlock.close":"Blockauswahl schließen","addBlock.insertAbove":"Blocktyp auswählen, der oberhalb des ausgewählten Bereichs eingefügt wird.","addBlock.insertBelow":"Blocktyp auswählen, der unterhalb des ausgewählten Bereichs eingefügt wird.","addBlock.searchPlaceholder":"Blocktypen durchsuchen","resize.inputPanel":"Eingabebereich skalieren","resize.chatPanel":"Chatbereich skalieren","preview.title":"Live-Vorschau","preview.loading":"Vorschau wird geladen…","settings.title":"Einstellungen","settings.devTitle":"Entwicklermodus","settings.groupAppearance":"Darstellung","settings.groupEditing":"Bearbeiten","settings.groupAgent":"Agent","settings.groupDeveloper":"Entwickler","settings.developerMode":"Entwicklermodus","settings.developerModeHint":"Blendet die Gruppe „Entwickler“ oben ein: Diagnose der Vorschau-Overlays und die Debug-Karten je Nachricht.","settings.streaming":"Streaming","settings.streamingHint":"Die Antwort des Agenten beim Schreiben anzeigen, statt auf die vollständige Antwort zu warten.","settings.nestedLabels":"Verschachtelte Labels","settings.nestedLabelsHint":"Benennt in der Vorschau jedes bearbeitbare Feld innerhalb eines ausgewählten Blocks.","settings.fieldDraftTelemetry":"Feld-Entwurfs-Telemetrie","settings.fieldDraftTelemetryHint":"Zeichnet auf, welche Felder die Live-Vorschau während einer Bearbeitung aktualisiert hat, und zeigt es auf der Debug-Karte.","settings.darkMode":"Dunkler Modus","settings.theme":"Design","settings.themeHint":"„System“ folgt der Hell-/Dunkel-Einstellung deines Betriebssystems.","settings.themeSystem":"System","settings.themeLight":"Hell","settings.themeDark":"Dunkel","settings.agentMode":"Agentenmodus","settings.agentModeOn":"An","settings.agentModeOff":"Nicht konfiguriert","settings.agentModeOnHint":"Der Agent kann Werkzeuge nutzen, um deine Website direkt zu bearbeiten, statt einen Plan vorzuschlagen.","settings.agentModeOffHint":"Der Agentenmodus benötigt einen API-Schlüssel im Orchestrator. Füge diese Variable in dessen .env ein und starte ihn neu:","settings.copyEnvVar":"{{name}} kopieren","settings.cancel":"Abbrechen","settings.clearChatConfirm":"Chat leeren — erneut klicken","settings.modelHint":"Welches Modell deine Änderungen plant. Größere Modelle planen besser und kosten mehr.","settings.autoScrollTracking":"Generiertem Inhalt folgen","settings.autoScrollTrackingHint":"Scrollt die Vorschau zu jedem Block, während der Agent ihn bearbeitet.","settings.autoOpenProperties":"Eigenschaften bei Auswahl öffnen","settings.autoOpenPropertiesHint":"Öffnet die Eigenschaftenleiste, wenn du in der Vorschau einen Block anklickst. Aus lässt die Vorschau in voller Breite.","settings.debugMode":"Debug-Modus","settings.debugModeHint":"Fügt unter jeder Antwort eine Karte mit Plan, angewendeten Operationen und Laufzeiten hinzu.","settings.model":"Modell","settings.modelNoProvider":"Kein API-Key konfiguriert, daher ist kein Modell verf\\u00FCgbar. Trage einen in die .env.local deines Projekts ein und starte den Dev-Server neu.","settings.advanced":"Erweitert","settings.clearChat":"Chat leeren","settings.language":"Sprache","password.title":"Editor-Zugang","password.placeholder":"Passwort","password.incorrect":"Falsches Passwort","password.checking":"Wird geprüft…","password.continue":"Weiter","password.closedTitle":"Dieser Orchestrator weist jede Anfrage ab","password.closedBody":"Er läuft mit NODE_ENV=production und ohne konfigurierte Zugangsdaten, also antwortet jede Route mit 401 — auch die, die dieser Editor zum Laden deiner Website braucht.","password.closedFix":"Setze ACCESS_PASSWORD_HASH oder ORCHESTRATOR_ACCESS_TOKEN in der Umgebung der Website und starte sie neu, oder übergib auth an createOrchestrator(). Die Website stattdessen mit npm run dev zu starten öffnet sie ebenfalls, denn die geschlossene Voreinstellung gilt nur für Produktion.","password.unreachableTitle":"Orchestrator nicht erreichbar","password.unreachableBody":"Ob dieser Editor durch eine Zugangssperre geschützt ist, entscheidet der Orchestrator — und er hat nicht geantwortet. Solange das so bleibt, lässt sich der Zugang nicht feststellen und wird deshalb verweigert.","password.retry":"Erneut versuchen","password.retryingIn":"Automatischer neuer Versuch in {{seconds}}s…","sites.title":"Websites","sites.subtitle":"Wähle eine Website zum Bearbeiten.","sites.addSite":"Website hinzufügen","sites.addSiteTitle":"Website hinzufügen","sites.close":"Schließen","sites.siteName":"Seitenname","sites.siteNamePlaceholder":"Meine Website","sites.previewUrl":"Vorschau-URL","sites.previewUrlPlaceholder":"http://localhost:3000","sites.enablePuck":"Visuellen Editor (Puck) verwenden","sites.editorialBrief":"Redaktionelles Briefing","sites.overview":"Übersicht","sites.tone":"Tonalität","sites.constraints":"Einschränkungen","sites.templates":"Vorlagen","sites.overviewPlaceholder":"Wofür diese Seite gedacht ist.","sites.tonePlaceholder":"Wie der Text klingen soll.","sites.constraintsPlaceholder":`Regeln für die Inhaltsausgabe.
391
+ Eine pro Zeile.`,"sites.templateName":"Vorlagenname (z. B. Kampagnen-Landingpage)","sites.templateDescription":"Beschreibe die Seitenstruktur: welche Bereiche, in welcher Reihenfolge, mit welchem inhaltlichen Fokus.","sites.settings":"Einstellungen","sites.openEditor":"Editor öffnen","sites.deleteSite":"Löschen","sites.confirmDelete":'"{{name}}" aus der Siteliste entfernen?',"sites.confirmDeleteTitle":"Site entfernen","sites.confirmDeleteBody":'Damit wird "{{name}}" aus deiner lokalen Siteliste entfernt. Die Site selbst wird nicht gelöscht.',"sites.switchingTo":"Wechsle zu","sites.switchInFlight":"Eine Chat-Anfrage läuft noch. Trotzdem die Site wechseln und sie verwerfen?","sites.allOffline":"Keine erreichbaren Sites","sites.allOfflineHint":'Alle Sites in deiner Liste haben den Erreichbarkeitstest nicht bestanden. Aktiviere "Offline-Sites anzeigen" oder prüfe, ob die Sites laufen.',"sites.previewUrlOverride":"Wird durch ?previewUrl= in der aktuellen URL überschrieben.","sites.orchestratorUrl":"Orchestrator-URL","sites.orchestratorUrlPlaceholder":"https://example.com/api/avocado","sites.orchestratorUrlHint":"Nur für Sites, die den Orchestrator selbst betreiben (Library-Modus). Leer lassen, um den Orchestrator des Editors zu verwenden.","sites.cancel":"Abbrechen","sites.create":"Erstellen","sites.siteConfig":"Seitenkonfiguration","sites.general":"Allgemein","sites.media":"Medien","sites.hosting":"Hosting","sites.brief":"Briefing","sites.deploy":"Deployment","sites.coreSettings":"Grundeinstellungen","sites.header":"Kopfzeile","sites.siteHeaderName":"Name in der Kopfzeile","sites.logoUrl":"Logo-URL","sites.logoUrlPlaceholder":"https://example.com/logo.svg","sites.pageTemplates":"Seitenvorlagen","sites.pageTemplatesHint":"Definiere wiederverwendbare Seitenstrukturen. Die KI ordnet Vorlagen bei der Seitenerstellung nach Name oder Absicht zu.","sites.removeTemplate":"Entfernen","sites.addTemplate":"+ Vorlage hinzufügen","sites.preferredTone":"Bevorzugte Tonalität","sites.writingConstraints":"Schreibregeln","sites.hostingPlaceholder":"Vercel-Produktionsseite","sites.vercelProjectId":"Vercel-Projekt-ID","sites.vercelProjectIdPlaceholder":"prj_...","sites.vercelTeamId":"Vercel-Team-ID","sites.vercelTeamIdPlaceholder":"team_...","sites.vercelProductionUrl":"Vercel-Produktions-URL","sites.vercelProductionUrlPlaceholder":"https://example.vercel.app","sites.vercelDeployHook":"Vercel-Deploy-Hook-URL","sites.vercelDeployHookPlaceholder":"https://api.vercel.com/v1/integrations/deploy/...","sites.googleDrive":"Google Drive","sites.googleDriveFolderId":"Google-Drive-Ordner-ID","sites.googleDrivePlaceholder":"z. B. 1aBcDeFgHiJkLmNoPqRsTuVwXyZ","sites.testing":"Wird getestet…","sites.test":"Testen","sites.driveConnectedImages":"Verbunden (Bilder gefunden)","sites.driveConnectedEmpty":"Verbunden (Ordner leer)","sites.driveError":"Orchestrator nicht erreichbar","sites.cmsMedia":"CMS-Medien","sites.provider":"Anbieter","sites.none":"Keiner","sites.spaceId":"Space-ID","sites.spaceIdPlaceholder":"abc123","sites.deliveryToken":"Delivery-Token","sites.deliveryTokenPlaceholder":"Content-Delivery-API-Token","sites.projectId":"Projekt-ID","sites.dataset":"Dataset","sites.datasetPlaceholder":"production","sites.strapiUrl":"Strapi-URL","sites.strapiUrlPlaceholder":"http://localhost:1337","sites.apiToken":"API-Token","sites.apiTokenPlaceholder":"Nur-Lese-API-Token","sites.versionHistory":"Versionshistorie","sites.restoreDescription":"Einen früheren veröffentlichten Snapshot wiederherstellen in","sites.snapshotVersion":"Snapshot-Version","sites.loadingSnapshots":"Snapshots werden geladen…","sites.restoring":"Wird wiederhergestellt…","sites.restore":"Wiederherstellen","sites.noSnapshots":"Noch keine Snapshots vorhanden.","sites.snapshotCommit":"Commit","sites.snapshotPages":"Seiten","sites.snapshotHeading":"Überschrift","sites.snapshotDate":"Datum","sites.checkingManifest":"Manifest wird geprüft…","sites.limitedEditing":"Eingeschränktes Bearbeiten","sites.editingReady":"Bearbeitung bereit","sites.checking":"Wird geprüft…","chatInput.placeholder":"Frag mich etwas","chatInput.listening":"Hört zu","chatInput.transcribing":"Wird transkribiert…","chatInput.attachFile":"Datei anhängen","chatInput.removeAttachment":"Anhang entfernen","chatInput.exitSelector":"Auswahlmodus beenden","chatInput.selectElement":"Element auswählen","chatInput.editingBlock":"Bearbeiten: {{block}}","chatInput.clearSelection":"Auswahl aufheben","chatInput.voiceActions":"Sprach- und Sendeaktionen","chatInput.cancelVoice":"Spracheingabe abbrechen","chatInput.sendRecorded":"Aufgenommene Nachricht senden","chatInput.startVoice":"Spracheingabe starten","chatInput.stopGeneration":"Generierung stoppen","chatInput.sendMessage":"Nachricht senden","chatInput.speechUnsupported":"Spracheingabe wird in diesem Browser nicht unterstützt.","chatInput.noSpeechDetected":"Keine Sprache erkannt. Bitte erneut aufnehmen.","chatInput.micBlocked":"Mikrofonzugriff ist blockiert. Bitte Mikrofonberechtigungen erlauben und erneut versuchen.","chatInput.unsupportedFile":"Nur Bilder und PDF-Dateien werden unterstützt.","chatInput.attachmentOnlyMessage":"Verwende die angehängte(n) Datei(en).","chatInput.uploadFailed":"Upload fehlgeschlagen. Bitte erneut versuchen.","chatInput.transcribeFailed":"Audiotranskription fehlgeschlagen.","imagePicker.title":"Asset-Manager","imagePicker.close":"Schließen","imagePicker.drive":"Drive","imagePicker.cms":"CMS","imagePicker.searchCms":"Medienbibliothek durchsuchen…","imagePicker.unsplash":"Unsplash","imagePicker.upload":"Hochladen","imagePicker.generate":"Generieren","imagePicker.searchDrive":"Drive-Bilder durchsuchen…","imagePicker.searchUnsplash":"Unsplash-Fotos durchsuchen…","imagePicker.search":"Suchen…","imagePicker.refreshDrive":"Von Drive aktualisieren","imagePicker.searching":"Wird gesucht…","imagePicker.typeToSearch":"Suchbegriff eingeben","imagePicker.noImages":"Keine Bilder gefunden","imagePicker.loadMore":"Mehr laden","imagePicker.loading":"Wird geladen…","imagePicker.uploadFromComputer":"Vom Computer hochladen","imagePicker.uploading":"Wird hochgeladen…","imagePicker.chooseDifferent":"Andere Datei wählen","imagePicker.orPasteUrl":"oder URL einfügen","imagePicker.urlPlaceholder":"https://example.com/image.jpg","imagePicker.uploadedImage":"Hochgeladenes Bild","imagePicker.needsKeyTitle":"Bildgenerierung ist deaktiviert","imagePicker.needsKeyBody":"Es ist kein Bild-Schlüssel konfiguriert, daher kann dieser Tab noch nichts generieren. Einer der beiden Schlüssel unten aktiviert sie — ein Anthropic-Schlüssel allein genügt nicht, da er kein Bildmodell hat.","imagePicker.needsKeyOpenAI":"generiert Bilder und ermöglicht die Bearbeitung mit gpt-image","imagePicker.needsKeyGoogle":"generiert Bilder und aktiviert den dialogbasierten Generieren-Tab. Benötigt zusätzlich npm install @google/genai — eine optionale Peer-Abhängigkeit, die kein Paketmanager automatisch installiert.","imagePicker.needsKeyRestart":"Füge einen in .env.local hinzu und starte den Dev-Server neu.","imagePicker.examplePrompt":"Wärmer machen","imagePicker.editPrompt":"Beschreibe, wie das Bild geändert werden soll…","imagePicker.generatePrompt":"Beschreibe das gewünschte Bild…","imagePicker.followUpPrompt":"Änderungen beschreiben…","imagePicker.refine":"Verfeinern","imagePicker.edit":"Bearbeiten","imagePicker.closePreview":"Vorschau schließen","imagePicker.ready":"Fertig","imagePicker.editThisImage":"Dieses Bild bearbeiten","imagePicker.editThisImageDesc":"Änderungen am aktuellen Bild beschreiben","imagePicker.generateNew":"Neu generieren","imagePicker.generateNewDesc":"Ein komplett neues Bild von Grund auf erstellen","imagePicker.useImage":"Bild verwenden","imagePicker.applyUrl":"URL anwenden","imagePicker.removeReference":"Referenz entfernen","imagePicker.attachReference":"Beispielbilder als Referenz anhängen (bis zu {{max}})","imagePicker.showOriginal":"Original anzeigen","imagePicker.showEdited":"Bearbeitet anzeigen","propertyPanel.loading":"Wird geladen…","propertyPanel.loadFailed":"Blockeigenschaften konnten nicht geladen werden","propertyPanel.loadFailedMissing":"Dieser Block ist nicht in der Seite, die der Orchestrator zurückgegeben hat","propertyPanel.loadFailedMissingHint":"Vorschau und Orchestrator zeigen möglicherweise auf verschiedene Sites. Prüfe die Orchestrator-URL in den Einstellungen der Site.","propertyPanel.loadFailedNoPage":"Diese Seite ist nicht im Entwurf","propertyPanel.loadFailedNoPageHint":"Der Orchestrator hat geantwortet, kennt aber unter dieser Adresse keine Seite für diese Session — entweder ist der Editor auf einer Seite, die dieser Entwurf nicht hat, oder er fragt einen Orchestrator, der diese Site nicht bereitstellt.","propertyPanel.loadFailedUnreachableHint":"Unter dieser Adresse hat nichts geantwortet. Prüfe, ob der Orchestrator läuft.","propertyPanel.retry":"Erneut versuchen","orchestratorMismatch.title":"Du bearbeitest die Inhalte einer anderen Site","orchestratorMismatch.detail":"{{orchestrator}} stellt diese Site nicht bereit — Seiten, Vorschau und Eigenschaften auf diesem Bildschirm gehören zu der Site, die dort tatsächlich liegt.","orchestratorMismatch.detailHosts":"{{orchestrator}} stellt {{hosted}} bereit — nicht diese Site. Seiten, Vorschau und Eigenschaften auf diesem Bildschirm gehören zu jener Site, unter dem Namen dieser.","orchestratorMismatch.useDefault":"Orchestrator des Editors verwenden","orchestratorMismatch.ownTitle":"Diese Website verwaltet ihre Inhalte woanders","orchestratorMismatch.ownDetail":"Der Editor liest Entwürfe von {{orchestrator}}, während die Website unter {{siteOrchestrator}} ihren eigenen Orchestrator betreibt. Ihre Medienbibliothek – und alles andere, was nur die Website kennt – fehlt, solange beide nicht übereinstimmen.","orchestratorMismatch.useSiteOwn":"Orchestrator dieser Website verwenden","propertyPanel.unknownBlock":"Unbekannter Blocktyp:","propertyPanel.page":"Seite","propertyPanel.close":"Eigenschaften schließen","propertyPanel.navLabel":"Nav-Label","propertyPanel.change":"Ändern","propertyPanel.chooseImage":"Bild wählen","propertyPanel.remove":"Entfernen","propertyPanel.addItem":"Eintrag hinzufügen","propertyPanel.removeItem":"Eintrag entfernen","propertyPanel.altText":"Alt-Text","propertyPanel.altPlaceholder":"Beschreibe, was auf dem Bild zu sehen ist","propertyPanel.navPlaceholder":"Seite","propertyPanel.linkPlaceholder":"Seite, URL, E-Mail oder Telefon","propertyPanel.linkBrowsePages":"Seiten durchsuchen","propertyPanel.linkNoPage":"Keine Seite unter diesem Pfad","propertyPanel.linkNoFile":"Kein Dokument unter diesem Pfad","propertyPanel.linkDidYouMean":"Meintest du {{page}}?","propertyPanel.linkNoMatches":"Keine passende Seite — wird so übernommen","propertyPanel.linkUseInternal":"Stattdessen auf {{path}} dieser Website verlinken","propertyPanel.linkNewTab":"In neuem Tab öffnen","propertyPanel.seo":"SEO","propertyPanel.seoTitle":"SEO-Titel","propertyPanel.seoTitlePlaceholder":"Standardmäßig der Seitentitel","propertyPanel.metaDescription":"Meta-Beschreibung","propertyPanel.metaDescPlaceholder":"Standardmäßig generierte Beschreibung","propertyPanel.ogImage":"Open-Graph-Bild-URL","welcome.greeting":`**Sag mir, was ich ändern soll** — ich bearbeite die Seite, wie du es beschreibst.
392
+
393
+ - Bereiche, Texte, Bilder, ganze neue Seiten.
394
+ - Klicke in der Vorschau auf etwas, um darauf zu zeigen.
395
+ - Research Preview, rechne mit Ecken und Kanten.`,"welcome.greetingFallback":`**Sag mir, was ich ändern soll** — ich bearbeite die Seite, wie du es beschreibst.
396
+
397
+ - Bereiche, Texte, Bilder, ganze neue Seiten.
398
+ - Klicke in der Vorschau auf etwas, um darauf zu zeigen.
399
+ - Research Preview, rechne mit Ecken und Kanten.`,"welcome.greetingDemo":`**Sag mir, was ich ändern soll** — ich bearbeite {{name}}, wie du es beschreibst.
400
+
401
+ - Demo-Site — bearbeite alles, hier ist nichts heilig.
402
+ - Was möglich ist, zeigt der [Komponenten-Katalog]({{catalogueUrl}}).
403
+ - Research Preview, rechne mit Ecken und Kanten.
404
+
405
+ **[Eigene Site einrichten →](https://docs.avocadostudio.dev/sites)**`,"welcome.greetingScaffold":`**Sag mir, was ich ändern soll** — ich bearbeite {{name}}, wie du es beschreibst.
406
+
407
+ - Du bist auf dem Demo-Inhalt des Avocado Hub, bearbeite frei.
408
+ - Research Preview, rechne mit Ecken und Kanten.
409
+
410
+ **[Eigene Site einrichten →](https://docs.avocadostudio.dev/sites)**`,"suggestion.rewriteHero":"Hero-Überschrift umschreiben","suggestion.addTestimonials":"Einen Testimonial-Bereich hinzufügen","suggestion.addFaq":"Einen FAQ-Bereich hinzufügen","suggestion.addCta":"Einen Call-to-Action hinzufügen","suggestion.changeHeadline":"Überschrift und Untertitel ändern","suggestion.addSection":"Neuen Bereich hinzufügen","suggestion.rewriteTone":"Text umschreiben: mehr {{tone}}","suggestion.createFromTemplate":"Neue {{name}}-Seite erstellen","suggestion.createAbout":"Eine neue /about-Seite erstellen","suggestion.demoAddTestimonials":"Einen Testimonials-Bereich hinzufügen","suggestion.demoAddSection":"Einen abschließenden Call-to-Action-Bereich hinzufügen","suggestion.keylessAddTestimonials":"Add testimonials","suggestion.keylessRichText":"Add a rich text section","suggestion.keylessMetaDescription":'Set the meta description to "Fresh avocado recipes, wellness tips, and sustainability stories."',"suggestion.demoTranslate":"Übersetze die ganze Seite ins Deutsche","suggestion.demoAddFaq":"Einen FAQ-Bereich hinzufügen","suggestion.demoHeroCta":"Mach aus dem Hero einen starken Call-to-Action","streamError.failed":"Streaming-Anfrage fehlgeschlagen.","streamError.retrying":"Streaming fehlgeschlagen, wird mit Standardanfrage wiederholt…","streamError.canceling":"Wird abgebrochen…","streamError.canceled":"Vorgang gestoppt.","streamError.structuralDisabled":"Strukturelle Bearbeitungen sind für diesen Seitenkontext deaktiviert.","streamError.demoQuotaExhausted":"Diese Live-Demo wird von allen genutzt und hat vorerst ihr Nutzungslimit erreicht. Bitte versuchen Sie es in ein paar Minuten erneut – alles, was Sie bereits erstellt haben, bleibt erhalten.","ops.addedItem":"Listenelement hinzugefügt.","ops.deletedBlock":"Block gelöscht.","ops.changedImage":"Bild geändert.","ops.replacedImageAt":"{{block}} · {{field}}","ops.imageChangeFailed":"Bild konnte nicht geändert werden. Bitte erneut versuchen.","ops.imageSwap.pickAnother":"Ändern","ops.imageSwap.retry":"Erneut versuchen","ops.continueNext":"Weiter zum nächsten Schritt","plan.apply":"Übernehmen","plan.applyDestructive":"Änderungen übernehmen","plan.deletePage":"Seite löschen","plan.deletePages":"{{count}} Seiten löschen","plan.discard":"Verwerfen","fieldAi.generateAlt":"Alt-Text generieren","fieldAi.improveAccessibility":"Barrierefreiheit verbessern","fieldAi.makeDescriptive":"Beschreibender gestalten","fieldAi.optimizeSearch":"Für Suchranking optimieren","fieldAi.fitTitle":"Auf 60 Zeichen kürzen","fieldAi.addKeyword":"Primäres Schlüsselwort hinzufügen","fieldAi.suggest3":"3 Alternativen vorschlagen","fieldAi.optimizeCtr":"Für Klickrate optimieren","fieldAi.fitDescription":"Auf 160 Zeichen kürzen","fieldAi.addCallToAction":"Handlungsaufforderung hinzufügen","fieldAi.simplifyLanguage":"Sprache vereinfachen","fieldAi.expandDetail":"Mit mehr Details erweitern","fieldAi.makeConcise":"Prägnanter formulieren","fieldAi.improveClarity":"Verständlichkeit verbessern","fieldAi.adjustTone":"Ton professioneller gestalten","error.heading":"Etwas ist schiefgelaufen","error.message":"Beim Laden dieser Seite ist ein unerwarteter Fehler aufgetreten. Bitte versuche es erneut.","error.tryAgain":"Erneut versuchen","notFound.code":"404","notFound.heading":"Seite nicht gefunden","notFound.message":"Die gesuchte Seite existiert nicht oder wurde verschoben.","notFound.backHome":"Zurück zur Startseite","theme.switchLight":"Seite in den hellen Modus wechseln","theme.switchDark":"Seite in den dunklen Modus wechseln","theme.light":"Heller Modus","theme.dark":"Dunkler Modus","sitesAgent.title":"Onboarding-Agent","sitesAgent.clear":"Chat leeren","sitesAgent.welcome":"Ich kann eine neue Seite erstellen, eine bestehende Website von ihrer URL migrieren oder den Editor in dein Next.js-Projekt integrieren. Hinweis: Das ist noch früh — behandle meinen ersten Wurf als Entwurf, den du im Editor verfeinerst, besonders bei Migrationen komplexer Seiten. Was möchtest du tun?","sitesAgent.placeholder":"Frag mich etwas...","sitesAgent.suggestion1":"Neue Seite von Grund auf erstellen","sitesAgent.suggestion1Desc":"Beschreibe den Zweck deiner Seite und ich erstelle sie","sitesAgent.suggestion2":"Website von URL migrieren","sitesAgent.suggestion2Desc":"Gib mir eine URL und ich analysiere und erstelle sie neu","sitesAgent.suggestion3":"Über ein GitHub-Projekt integrieren","sitesAgent.suggestion3Desc":"Verbinde den Editor mit deiner bestehenden Next.js-App","sitesAgent.stop":"Stopp","sitesAgent.showMore":"Mehr anzeigen","sitesAgent.showLess":"Weniger anzeigen","propertyPanel.content":"Inhalt","propertyPanel.navigation":"Navigation","health.tooltip":"Website-Zustand","health.issueCount":"{{count}} Problem","health.issueCountPlural":"{{count}} Probleme","health.title":"Website-Zustand","health.run":"Prüfung jetzt starten","health.close":"Schließen","health.loading":"Wird geprüft…","health.emptyTitle":"Nichts zu beheben","health.emptyBody":"Die letzte Prüfung hat auf dieser Website keine Probleme gefunden.","health.goTo":"Anzeigen","health.snooze":"Später","health.snoozeTitle":"Eine Woche ausblenden und erneut anzeigen, falls es dann noch fehlerhaft ist","health.dismiss":"Ausblenden","health.dismissTitle":"Für diese Seite nie wieder anzeigen","health.notDurable":"Befunde werden nur im Arbeitsspeicher gehalten — sie gehen beim Neustart des Servers verloren.","linkPicker.title":"Verlinken mit","linkPicker.placeholder":"Seite, Dokument oder URL","linkPicker.noPage":"Keine Seite unter diesem Pfad","linkPicker.noFile":"Kein Dokument unter diesem Pfad","linkPicker.noMatches":"Keine passenden Seiten oder Dokumente","linkPicker.externalHint":"Verweist auf eine externe Website","linkPicker.emailHint":"Öffnet eine neue E-Mail","linkPicker.phoneHint":"Wählt eine Telefonnummer","linkPicker.anchorHint":"Springt zu einer Stelle auf dieser Seite","linkPicker.loadingFiles":"Dokumente dieser Website werden geladen ...","linkPicker.filesUnavailable":"{{orchestrator}} hat keine Dokumentliste für diese Website – der Pfad wird wie eingegeben übernommen.","linkPicker.dropHere":"Zum Hochladen loslassen","linkPicker.upload":"Dokument hochladen","linkPicker.uploadHint":"Oder eine Datei auf dieses Feld ziehen","linkPicker.uploading":"Wird hochgeladen ...","linkPicker.uploadNoUrl":"Der Upload war erfolgreich, aber die Website hat keine URL zurückgegeben.","linkPicker.remove":"Link entfernen","linkPicker.apply":"Übernehmen","common.cancel":"Abbrechen"},hk={en:IF,de:OF},hR="editor-locale",pR={en:"English",de:"Deutsch"};function mR(){try{const e=localStorage.getItem(hR);if(e&&e in hk)return e}catch{}return"en"}function gR(e){return(t,n)=>{let r=hk[e][t]??hk.en[t]??t;if(n)for(const[i,s]of Object.entries(n))r=r.replaceAll(`{{${i}}}`,String(s));return r}}function PF(e){return gR(e)}const bR=E.createContext(null);function zF({children:e}){const[t,n]=E.useState(mR),r=E.useCallback(o=>{try{localStorage.setItem(hR,o)}catch{}n(o)},[]),i=E.useMemo(()=>gR(t),[t]),s=E.useMemo(()=>({locale:t,setLocale:r,t:i}),[t,r,i]);return p.jsx(bR,{value:s,children:e})}function Mn(){const e=E.useContext(bR);if(!e)throw new Error("useT must be used within <LocaleProvider>");return e}const LT=e=>{let t;const n=new Set,r=(d,f)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const g=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(y=>y(t,g))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=t=e(r,i,a);return a},LF=(e=>e?LT(e):LT),BF=e=>e;function FF(e,t=BF){const n=qn.useSyncExternalStore(e.subscribe,qn.useCallback(()=>t(e.getState()),[e,t]),qn.useCallback(()=>t(e.getInitialState()),[e,t]));return qn.useDebugValue(n),n}const BT=e=>{const t=LF(e),n=r=>FF(t,r);return Object.assign(n,t),n},yR=(e=>e?BT(e):BT),$F=e=>(t,n,r)=>{const i=r.subscribe;return r.subscribe=((o,a,u)=>{let d=o;if(a){const f=(u==null?void 0:u.equalityFn)||Object.is;let m=o(r.getState());d=g=>{const y=o(g);if(!f(m,y)){const x=m;a(m=y,x)}},u!=null&&u.fireImmediately&&a(m,m)}return i(d)}),e(t,n,r)},UF=$F,HF=new Set(["1","true","yes","on"]),VF=new Set(["0","false","no","off"]);function zo(e,t){const n=e==null?void 0:e.trim().toLowerCase();return n?HF.has(n)?!0:VF.has(n)?!1:t:t}function qF(e){return e.replace(/imageUrl$/i,"imageAlt").replace(/\.src$/i,".alt")}function xe(e,t,n){function r(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,u);const d=o.prototype,f=Object.keys(d);for(let m=0;m<f.length;m++){const g=f[m];g in a||(a[g]=d[g].bind(a))}}const i=(n==null?void 0:n.Parent)??Object;class s extends i{}Object.defineProperty(s,"name",{value:e});function o(a){var u;const d=n!=null&&n.Parent?new s:this;r(d,a),(u=d._zod).deferred??(u.deferred=[]);for(const f of d._zod.deferred)f();return d}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>{var u,d;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(d=(u=a==null?void 0:a._zod)==null?void 0:u.traits)==null?void 0:d.has(e)}}),Object.defineProperty(o,"name",{value:e}),o}class ud extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class xR extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const vR={};function Pl(e){return vR}function kR(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function pk(e,t){return typeof t=="bigint"?t.toString():t}function pb(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function QS(e){return e==null}function ew(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function KF(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const u=r.match(/\d?e-(\d?)/);u!=null&&u[1]&&(i=Number.parseInt(u[1]))}const s=n>i?n:i,o=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return o%a/10**s}const FT=Symbol("evaluating");function Jt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==FT)return r===void 0&&(r=FT,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function nc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ql(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function $T(e){return JSON.stringify(e)}function GF(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const SR="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ih(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const WF=pb(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function vd(e){if(Ih(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Ih(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function wR(e){return vd(e)?{...e}:Array.isArray(e)?[...e]:e}const ZF=new Set(["string","number","symbol"]);function kd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Kl(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function Xe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function YF(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const JF={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function XF(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=ql(e._zod.def,{get shape(){const o={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=n.shape[a])}return nc(this,"shape",o),o},checks:[]});return Kl(e,s)}function QF(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=ql(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete o[a]}return nc(this,"shape",o),o},checks:[]});return Kl(e,s)}function e$(e,t){if(!vd(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=ql(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return nc(this,"shape",s),s}});return Kl(e,i)}function t$(e,t){if(!vd(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ql(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return nc(this,"shape",r),r}});return Kl(e,n)}function n$(e,t){const n=ql(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return nc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Kl(e,n)}function r$(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=ql(t._zod.def,{get shape(){const a=t._zod.def.shape,u={...a};if(n)for(const d in n){if(!(d in a))throw new Error(`Unrecognized key: "${d}"`);n[d]&&(u[d]=e?new e({type:"optional",innerType:a[d]}):a[d])}else for(const d in a)u[d]=e?new e({type:"optional",innerType:a[d]}):a[d];return nc(this,"shape",u),u},checks:[]});return Kl(t,o)}function i$(e,t,n){const r=ql(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(n)for(const o in n){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(s[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)s[o]=new e({type:"nonoptional",innerType:i[o]});return nc(this,"shape",s),s}});return Kl(t,r)}function od(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function ad(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function qm(e){return typeof e=="string"?e:e==null?void 0:e.message}function zl(e,t,n){var i,s,o,a,u,d;const r={...e,path:e.path??[]};if(!e.message){const f=qm((o=(s=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:s.error)==null?void 0:o.call(s,e))??qm((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??qm((u=n.customError)==null?void 0:u.call(n,e))??qm((d=n.localeError)==null?void 0:d.call(n,e))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function tw(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Oh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const CR=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,pk,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ER=xe("$ZodError",CR),_R=xe("$ZodError",CR,{Parent:Error});function s$(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function o$(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>r({issues:o}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let o=n,a=0;for(;a<s.path.length;){const u=s.path[a];a===s.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(s))):o[u]=o[u]||{_errors:[]},o=o[u],a++}}};return r(e),n}const nw=e=>(t,n,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new ud;if(o.issues.length){const a=new((i==null?void 0:i.Err)??e)(o.issues.map(u=>zl(u,s,Pl())));throw SR(a,i==null?void 0:i.callee),a}return o.value},rw=e=>async(t,n,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new((i==null?void 0:i.Err)??e)(o.issues.map(u=>zl(u,s,Pl())));throw SR(a,i==null?void 0:i.callee),a}return o.value},mb=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new ud;return s.issues.length?{success:!1,error:new(e??ER)(s.issues.map(o=>zl(o,i,Pl())))}:{success:!0,data:s.value}},a$=mb(_R),gb=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(o=>zl(o,i,Pl())))}:{success:!0,data:s.value}},l$=gb(_R),u$=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return nw(e)(t,n,i)},c$=e=>(t,n,r)=>nw(e)(t,n,r),d$=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return rw(e)(t,n,i)},f$=e=>async(t,n,r)=>rw(e)(t,n,r),h$=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return mb(e)(t,n,i)},p$=e=>(t,n,r)=>mb(e)(t,n,r),m$=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gb(e)(t,n,i)},g$=e=>async(t,n,r)=>gb(e)(t,n,r),b$=/^[cC][^\s-]{8,}$/,y$=/^[0-9a-z]+$/,x$=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,v$=/^[0-9a-vA-V]{20}$/,k$=/^[A-Za-z0-9]{27}$/,S$=/^[a-zA-Z0-9_-]{21}$/,w$=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,C$=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,UT=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,E$=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function T$(){return new RegExp(_$,"u")}const A$=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,N$=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,M$=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,D$=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,R$=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,TR=/^[A-Za-z0-9_-]*$/,j$=/^\+[1-9]\d{6,14}$/,AR="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",I$=new RegExp(`^${AR}$`);function NR(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function O$(e){return new RegExp(`^${NR(e)}$`)}function P$(e){const t=NR({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${AR}T(?:${r})$`)}const z$=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},L$=/^-?\d+$/,MR=/^-?\d+(?:\.\d+)?$/,B$=/^(?:true|false)$/i,F$=/^[^A-Z]*$/,$$=/^[^a-z]*$/,qi=xe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),DR={number:"number",bigint:"bigint",object:"date"},RR=xe("$ZodCheckLessThan",(e,t)=>{qi.init(e,t);const n=DR[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),jR=xe("$ZodCheckGreaterThan",(e,t)=>{qi.init(e,t);const n=DR[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),U$=xe("$ZodCheckMultipleOf",(e,t)=>{qi.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):KF(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),H$=xe("$ZodCheckNumberFormat",(e,t)=>{var o;qi.init(e,t),t.format=t.format||"float64";const n=(o=t.format)==null?void 0:o.includes("int"),r=n?"int":"number",[i,s]=JF[t.format];e._zod.onattach.push(a=>{const u=a._zod.bag;u.format=t.format,u.minimum=i,u.maximum=s,n&&(u.pattern=L$)}),e._zod.check=a=>{const u=a.value;if(n){if(!Number.isInteger(u)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?a.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}u<i&&a.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>s&&a.issues.push({origin:"number",input:u,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),V$=xe("$ZodCheckMaxLength",(e,t)=>{var n;qi.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!QS(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=tw(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),q$=xe("$ZodCheckMinLength",(e,t)=>{var n;qi.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!QS(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=tw(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),K$=xe("$ZodCheckLengthEquals",(e,t)=>{var n;qi.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!QS(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,s=i.length;if(s===t.length)return;const o=tw(i),a=s>t.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),bb=xe("$ZodCheckStringFormat",(e,t)=>{var n,r;qi.init(e,t),e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),G$=xe("$ZodCheckRegex",(e,t)=>{bb.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),W$=xe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=F$),bb.init(e,t)}),Z$=xe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$$),bb.init(e,t)}),Y$=xe("$ZodCheckIncludes",(e,t)=>{qi.init(e,t);const n=kd(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),J$=xe("$ZodCheckStartsWith",(e,t)=>{qi.init(e,t);const n=new RegExp(`^${kd(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),X$=xe("$ZodCheckEndsWith",(e,t)=>{qi.init(e,t);const n=new RegExp(`.*${kd(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Q$=xe("$ZodCheckOverwrite",(e,t)=>{qi.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class e7{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
373
411
  `).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),s=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of s)this.content.push(o)}compile(){const t=Function,n=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new t(...n,i.join(`
374
412
  `))}}const t7={major:4,minor:3,patch:6},Yn=xe("$ZodType",(e,t)=>{var i;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=t7;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const s of r)for(const o of s._zod.onattach)o(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const s=(a,u,d)=>{let f=od(a),m;for(const g of u){if(g._zod.def.when){if(!g._zod.def.when(a))continue}else if(f)continue;const y=a.issues.length,x=g._zod.check(a);if(x instanceof Promise&&(d==null?void 0:d.async)===!1)throw new ud;if(m||x instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await x,a.issues.length!==y&&(f||(f=od(a,y)))});else{if(a.issues.length===y)continue;f||(f=od(a,y))}}return m?m.then(()=>a):a},o=(a,u,d)=>{if(od(a))return a.aborted=!0,a;const f=s(u,r,d);if(f instanceof Promise){if(d.async===!1)throw new ud;return f.then(m=>e._zod.parse(m,d))}return e._zod.parse(f,d)};e._zod.run=(a,u)=>{if(u.skipChecks)return e._zod.parse(a,u);if(u.direction==="backward"){const f=e._zod.parse({value:a.value,issues:[]},{...u,skipChecks:!0});return f instanceof Promise?f.then(m=>o(m,a,u)):o(f,a,u)}const d=e._zod.parse(a,u);if(d instanceof Promise){if(u.async===!1)throw new ud;return d.then(f=>s(f,r,u))}return s(d,r,u)}}Jt(e,"~standard",()=>({validate:s=>{var o;try{const a=a$(e,s);return a.success?{value:a.data}:{issues:(o=a.error)==null?void 0:o.issues}}catch{return l$(e,s).then(u=>{var d;return u.success?{value:u.data}:{issues:(d=u.error)==null?void 0:d.issues}})}},vendor:"zod",version:1}))}),iw=xe("$ZodString",(e,t)=>{var n;Yn.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??z$(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Jn=xe("$ZodStringFormat",(e,t)=>{bb.init(e,t),iw.init(e,t)}),n7=xe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=C$),Jn.init(e,t)}),r7=xe("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=UT(r))}else t.pattern??(t.pattern=UT());Jn.init(e,t)}),i7=xe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=E$),Jn.init(e,t)}),s7=xe("$ZodURL",(e,t)=>{Jn.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),o7=xe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=T$()),Jn.init(e,t)}),a7=xe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=S$),Jn.init(e,t)}),l7=xe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=b$),Jn.init(e,t)}),u7=xe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=y$),Jn.init(e,t)}),c7=xe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=x$),Jn.init(e,t)}),d7=xe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=v$),Jn.init(e,t)}),f7=xe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=k$),Jn.init(e,t)}),h7=xe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=P$(t)),Jn.init(e,t)}),p7=xe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=I$),Jn.init(e,t)}),m7=xe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=O$(t)),Jn.init(e,t)}),g7=xe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=w$),Jn.init(e,t)}),b7=xe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=A$),Jn.init(e,t),e._zod.bag.format="ipv4"}),y7=xe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=N$),Jn.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),x7=xe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=M$),Jn.init(e,t)}),v7=xe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=D$),Jn.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,s]=r;if(!s)throw new Error;const o=Number(s);if(`${o}`!==s)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function IR(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const k7=xe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=R$),Jn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{IR(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function S7(e){if(!TR.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return IR(n)}const w7=xe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=TR),Jn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{S7(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),C7=xe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=j$),Jn.init(e,t)});function E7(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const _7=xe("$ZodJWT",(e,t)=>{Jn.init(e,t),e._zod.check=n=>{E7(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),OR=xe("$ZodNumber",(e,t)=>{Yn.init(e,t),e._zod.pattern=e._zod.bag.pattern??MR,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}}),T7=xe("$ZodNumberFormat",(e,t)=>{H$.init(e,t),OR.init(e,t)}),A7=xe("$ZodBoolean",(e,t)=>{Yn.init(e,t),e._zod.pattern=B$,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),N7=xe("$ZodUnknown",(e,t)=>{Yn.init(e,t),e._zod.parse=n=>n}),M7=xe("$ZodNever",(e,t)=>{Yn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function HT(e,t,n){e.issues.length&&t.issues.push(...ad(n,e.issues)),t.value[n]=e.value}const D7=xe("$ZodArray",(e,t)=>{Yn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const s=[];for(let o=0;o<i.length;o++){const a=i[o],u=t.element._zod.run({value:a,issues:[]},r);u instanceof Promise?s.push(u.then(d=>HT(d,n,o))):HT(u,n,o)}return s.length?Promise.all(s).then(()=>n):n}});function Hg(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...ad(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function PR(e){var r,i,s,o;const t=Object.keys(e.shape);for(const a of t)if(!((o=(s=(i=(r=e.shape)==null?void 0:r[a])==null?void 0:i._zod)==null?void 0:s.traits)!=null&&o.has("$ZodType")))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=YF(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function zR(e,t,n,r,i,s){const o=[],a=i.keySet,u=i.catchall._zod,d=u.def.type,f=u.optout==="optional";for(const m in t){if(a.has(m))continue;if(d==="never"){o.push(m);continue}const g=u.run({value:t[m],issues:[]},r);g instanceof Promise?e.push(g.then(y=>Hg(y,n,m,t,f))):Hg(g,n,m,t,f)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const R7=xe("$ZodObject",(e,t)=>{Yn.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const u={...a};return Object.defineProperty(t,"shape",{value:u}),u}})}const r=pb(()=>PR(t));Jt(e._zod,"propValues",()=>{const a=t.shape,u={};for(const d in a){const f=a[d]._zod;if(f.values){u[d]??(u[d]=new Set);for(const m of f.values)u[d].add(m)}}return u});const i=Ih,s=t.catchall;let o;e._zod.parse=(a,u)=>{o??(o=r.value);const d=a.value;if(!i(d))return a.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),a;a.value={};const f=[],m=o.shape;for(const g of o.keys){const y=m[g],x=y._zod.optout==="optional",v=y._zod.run({value:d[g],issues:[]},u);v instanceof Promise?f.push(v.then(S=>Hg(S,a,g,d,x))):Hg(v,a,g,d,x)}return s?zR(f,d,a,u,r.value,e):f.length?Promise.all(f).then(()=>a):a}}),j7=xe("$ZodObjectJIT",(e,t)=>{R7.init(e,t);const n=e._zod.parse,r=pb(()=>PR(t)),i=g=>{var A;const y=new e7(["shape","payload","ctx"]),x=r.value,v=M=>{const j=$T(M);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};y.write("const input = payload.value;");const S=Object.create(null);let w=0;for(const M of x.keys)S[M]=`key_${w++}`;y.write("const newResult = {};");for(const M of x.keys){const j=S[M],D=$T(M),P=g[M],R=((A=P==null?void 0:P._zod)==null?void 0:A.optout)==="optional";y.write(`const ${j} = ${v(M)};`),R?y.write(`
375
413
  if (${j}.issues.length) {
@@ -447,7 +485,7 @@ All features are included in every plan.`},{label:"Pricing",content:`View our fl
447
485
  `);return{type:"code",index:t,code:m,...a?{language:a}:{}}}if(r.length===1&&Uq.test(r[0]))return{type:"rule",index:t};const s=Bq.exec(r[0]);if(s){const a=r.slice(1).join(" ").trim();return{type:"heading",index:t,level:s[1].length,inline:dh(s[2].trim()),...a?{trailing:dh(a)}:{}}}if(r.every(a=>gA.test(a))){const a=n.map(d=>{var f;return((f=gA.exec(d.trim()))==null?void 0:f[1])??""}).join(`
448
486
  `),u=xj(a);if(u.length>0)return{type:"blockquote",index:t,children:u}}const o=Jq(n,t);return o||{type:"paragraph",index:t,inline:dh(e),raw:e}}function Qq(e){const t=[];let n=[],r=null;const i=()=>{const s=n.join(`
449
487
  `).trim();s.length>0&&t.push(s),n=[]};for(const s of e.split(`
450
- `)){const o=s.trim();if(r!==null){n.push(s),o.startsWith(r)&&(r=null,i());continue}const a=kk.exec(o);if(a){i(),r=a[1],n.push(s);continue}if(o.length===0){i();continue}n.push(s)}return i(),t}function xj(e){return Qq(e).map(Xq).filter(t=>t!==null)}function eK(e){return xj(Zq(e))}const yt={paragraph:"paragraph",heading:"heading",bulletList:"bulletList",orderedList:"orderedList",listItem:"listItem",blockquote:"blockquote",codeBlock:"codeBlock",horizontalRule:"horizontalRule",hardBreak:"hardBreak",text:"text",unknown:"avocadoUnknownBlock",unknownInline:"avocadoUnknownInline"},Ut={bold:"bold",italic:"italic",strike:"strike",code:"code",underline:"underline",link:"link",unknownHtml:"avocadoUnknownHtml"};function yA(){return{type:"doc",content:[]}}const tK={p:yt.paragraph,h1:yt.heading,h2:yt.heading,h3:yt.heading,h4:yt.heading,h5:yt.heading,h6:yt.heading,ul:yt.bulletList,ol:yt.orderedList,li:yt.listItem,blockquote:yt.blockquote,pre:yt.codeBlock,hr:yt.horizontalRule},nK={strong:Ut.bold,b:Ut.bold,em:Ut.italic,i:Ut.italic,s:Ut.strike,del:Ut.strike,strike:Ut.strike,code:Ut.code,u:Ut.underline,a:Ut.link},vj={[Ut.bold]:"strong",[Ut.italic]:"em",[Ut.strike]:"s",[Ut.code]:"code",[Ut.underline]:"u",[Ut.link]:"a"},kj=new Set(["br","hr","img","input","meta","link","source","wbr","area","col","embed","track"]),rK={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};function Sj(e){return e.replace(/&(#x?[0-9a-f]+|[a-z]+);/gi,(t,n)=>{if(n[0]==="#"){const r=n[1]==="x"||n[1]==="X"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isFinite(r)&&r>0?String.fromCodePoint(r):t}return rK[n.toLowerCase()]??t})}function iK(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/ /g,"&nbsp;")}function Gg(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/ /g,"&nbsp;")}const Wm=/<(\/?)([a-zA-Z][a-zA-Z0-9-]*)((?:\s+[^\s/>"'=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*(\/?)>/g,xx=/([^\s/>"'=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function sK(e){const t=[];let n=0;Wm.lastIndex=0;for(let r=Wm.exec(e);r!==null;r=Wm.exec(e)){r.index>n&&t.push({kind:"text",text:e.slice(n,r.index)}),n=Wm.lastIndex;const i=r[2].toLowerCase();if(r[1]==="/"){t.push({kind:"close",tag:i});continue}const s=[];xx.lastIndex=0;for(let o=xx.exec(r[3]??"");o!==null;o=xx.exec(r[3]??""))s.push([o[1],Sj(o[2]??o[3]??o[4]??"")]);t.push({kind:"open",tag:i,attrs:s,selfClosing:r[4]==="/"||kj.has(i)})}return n<e.length&&t.push({kind:"text",text:e.slice(n)}),t}function wj(e){return Array.isArray(e)?e.map(([t,n])=>` ${t}="${Gg(String(n))}"`).join(""):""}function vx(e,t,n){const r=t.map(([i,s])=>` ${i}="${Gg(s)}"`).join("");return n&&kj.has(e)?`<${e}${r} />`:`<${e}${r}></${e}>`}function xA(e){if(typeof e!="string"||e.trim().length===0)return yA();const t=yA(),n=[],r=[],i=[],s=()=>{for(let g=n.length-1;g>=0;g--){const y=n[g];return y.content||(y.content=[]),y.content}return t.content},o=new Set([yt.paragraph,yt.heading,yt.codeBlock]);let a=null;const u=()=>{const g=s(),y=n[n.length-1];if(y&&o.has(y.type))return g;const x=g[g.length-1];if(a&&x===a)return x.content||(x.content=[]),x.content;const v={type:yt.paragraph,content:[]};return g.push(v),a=v,v.content},d=g=>{const y=n[n.length-1];if(y&&o.has(y.type)||a!==null){u().push({type:yt.unknownInline,attrs:{data:{html:g}}});return}s().push({type:yt.unknown,attrs:{data:{html:g}}})};let f=0;const m=g=>{if(g.length===0)return;const y={type:yt.text,text:g};r.length>0&&(y.marks=r.map(x=>({...x}))),u().push(y),f++};for(const g of sK(e)){if(g.kind==="text"){m(Sj(g.text));continue}if(g.kind==="close"){for(let A=i.length-1;A>=0;A--){if(i[A].tag!==g.tag)continue;const M=i.splice(A,1)[0];if(M.mark){const j=r.lastIndexOf(M.mark);j>=0&&r.splice(j,1),M.unknownHtml!==void 0&&f===M.textCountAtOpen&&d(M.unknownHtml)}else{const j=n.lastIndexOf(M.node);j>=0&&n.splice(j,1),a=null}break}continue}const{tag:y,attrs:x,selfClosing:v}=g;if(y==="br"){x.length===0?u().push({type:yt.hardBreak}):d(vx(y,x,!0));continue}const S=tK[y];if(S!==void 0){const A={type:S};S===yt.heading&&(A.attrs={level:Number(y[1])}),x.length>0&&(A.attrs={...A.attrs??{},htmlAttributes:x}),S!==yt.horizontalRule&&(A.content=[]),s().push(A),a=null,S!==yt.horizontalRule&&(n.push(A),i.push({tag:y,node:A}));continue}const w=nK[y];if(w!==void 0&&!v){const A={type:w};if(w===Ut.link){const M={};for(const[j,D]of x)M[j]=D;A.attrs=M}else x.length>0&&(A.attrs={htmlAttributes:x});r.push(A),i.push({tag:y,node:{type:yt.text},mark:A});continue}if(v){d(vx(y,x,!0));continue}const T={type:Ut.unknownHtml,attrs:{tag:y,attributes:x.map(([A,M])=>[A,M])}};r.push(T),i.push({tag:y,node:{type:yt.text},mark:T,unknownHtml:vx(y,x,!1),textCountAtOpen:f})}return t}function Cj(e){var n,r,i;if(e.type===Ut.unknownHtml){const s=String(((n=e.attrs)==null?void 0:n.tag)??"span"),o=Array.isArray((r=e.attrs)==null?void 0:r.attributes)?e.attrs.attributes:[];return`<${s}${o.map(([a,u])=>` ${a}="${Gg(String(u))}"`).join("")}>`}const t=vj[e.type];if(!t)return"";if(e.type===Ut.link){const s=e.attrs??{};return`<a${Object.entries(s).filter(([,a])=>a!=null).map(([a,u])=>` ${a}="${Gg(String(u))}"`).join("")}>`}return`<${t}${wj((i=e.attrs)==null?void 0:i.htmlAttributes)}>`}function oK(e){var n;const t=e.type===Ut.unknownHtml?String(((n=e.attrs)==null?void 0:n.tag)??"span"):vj[e.type];return t?`</${t}>`:""}function vA(e){return e.type===Ut.unknownHtml?`${e.type}:${Cj(e)}`:`${e.type}:${JSON.stringify(e.attrs??null)}`}function td(e){var i;let t="",n=[];const r=s=>{for(let o=n.length-1;o>=s;o--)t+=oK(n[o]);n=n.slice(0,s)};for(const s of e){if(s.type===yt.hardBreak){r(0),t+="<br />";continue}if(s.type===yt.unknownInline||s.type===yt.unknown){r(0);const u=(i=s.attrs)==null?void 0:i.data;typeof(u==null?void 0:u.html)=="string"&&(t+=u.html);continue}if(s.type!==yt.text||typeof s.text!="string")continue;const o=s.marks??[];let a=0;for(;a<o.length&&a<n.length&&vA(o[a])===vA(n[a]);)a++;r(a);for(let u=a;u<o.length;u++)t+=Cj(o[u]),n.push(o[u]);t+=iK(s.text)}return r(0),t}function ih(e){var r,i,s;const t=e.content?e.content:[],n=wj((r=e.attrs)==null?void 0:r.htmlAttributes);switch(e.type){case yt.paragraph:return`<p${n}>${td(t)}</p>`;case yt.heading:{const o=Number(((i=e.attrs)==null?void 0:i.level)??1),a=`h${o>=1&&o<=6?o:1}`;return`<${a}${n}>${td(t)}</${a}>`}case yt.bulletList:return`<ul${n}>${t.map(ih).join("")}</ul>`;case yt.orderedList:return`<ol${n}>${t.map(ih).join("")}</ol>`;case yt.listItem:return`<li${n}>${t.map(o=>{var a;return o.type===yt.paragraph&&!((a=o.attrs)!=null&&a.htmlAttributes)?td(o.content??[]):ih(o)}).join("")}</li>`;case yt.blockquote:return`<blockquote${n}>${t.map(ih).join("")}</blockquote>`;case yt.codeBlock:return`<pre${n}>${td(t)}</pre>`;case yt.horizontalRule:return`<hr${n} />`;case yt.unknownInline:case yt.unknown:{const o=(s=e.attrs)==null?void 0:s.data;return typeof(o==null?void 0:o.html)=="string"?o.html:""}default:return td(t)}}function aK(e){var n;if(typeof e!="object"||e===null)return"";const t=e.content;return!Array.isArray(t)||t.length===0?"":t.length===1&&t[0].type===yt.paragraph&&!((n=t[0].attrs)!=null&&n.htmlAttributes)?td(t[0].content??[]):t.map(ih).join("")}const lK={strong:Ut.bold,em:Ut.italic,underline:Ut.underline,"strike-through":Ut.strike,code:Ut.code};Object.fromEntries(Object.entries(lK).map(([e,t])=>[t,e]));const uK={bold:Ut.bold,italic:Ut.italic,underline:Ut.underline,code:Ut.code,strikethrough:Ut.strike};Object.fromEntries(Object.entries(uK).map(([e,t])=>[t,e]));const cK={bold:Ut.bold,italic:Ut.italic,underline:Ut.underline,strikethrough:Ut.strike,code:Ut.code};Object.fromEntries(Object.entries(cK).map(([e,t])=>[t,e]));const dK={bullet_list:yt.bulletList,ordered_list:yt.orderedList,list_item:yt.listItem,code_block:yt.codeBlock,horizontal_rule:yt.horizontalRule,hard_break:yt.hardBreak,blok:yt.unknown};Object.fromEntries(Object.entries(dK).map(([e,t])=>[t,e]));const fK=Me({brandColor:H().optional().describe("Primary brand color (sets --brand, --brand-hover, --link). Any CSS color."),accentColor:H().optional().describe("Secondary accent color (sets --accent, --accent-hover)."),backgroundColor:H().optional().describe("Page background color (sets --bg-0, --bg-000)."),surfaceColor:H().optional().describe("Card/panel surface color (sets --surface, --card-bg, --bg-100)."),headingColor:H().optional().describe("Heading text color (sets --heading, --text-100)."),textColor:H().optional().describe("Body text color (sets --body, --text-200)."),mutedTextColor:H().optional().describe("Secondary/muted text color (sets --body-secondary, --text-300, --caption)."),headingFont:H().optional().describe("Heading font stack (sets --font-heading), e.g. 'Georgia, serif'."),bodyFont:H().optional().describe("Body font stack (sets --font-body)."),radius:H().optional().describe("Corner radius applied across buttons/cards/inputs (sets --radius and friends), e.g. '12px'.")});Me({name:H().optional(),logo:H().optional(),purpose:H().optional(),tone:H().optional(),constraints:lt(H()).optional(),navLabels:lr(H(),H()).optional(),navGroups:lr(H(),lt(H())).optional(),themeOverrides:lr(H(),H()).optional()});const hK=Me({title:H().optional(),description:H().optional(),ogImage:H().optional(),path:H().optional()}),Ej={id:H().min(1),slug:H().min(1),title:H().min(1),updatedAt:H().min(1),meta:hK.optional()};Me({...Ej,blocks:lt(rj)});const pK=Me({...Ej,blocks:lt(ij)}),mK=Me({op:Lt("create_page"),page:pK}),gK=Me({op:Lt("add_block"),pageSlug:H().min(1),afterBlockId:H().min(1).optional(),block:ij}),bK=Me({op:Lt("update_props"),pageSlug:H().min(1),blockId:H().min(1),patch:lr(H(),ys()),imageQuery:H().optional()}),yK=Me({op:Lt("remove_block"),pageSlug:H().min(1),blockId:H().min(1)}),xK=Me({op:Lt("move_block"),pageSlug:H().min(1),blockId:H().min(1),afterBlockId:H().min(1).optional()}),vK=Me({op:Lt("duplicate_block"),pageSlug:H().min(1),blockId:H().min(1),toPageSlug:H().min(1).optional(),newBlockId:H().min(1).optional(),afterBlockId:H().min(1).optional()}),kK=Me({op:Lt("add_item"),pageSlug:H().min(1),blockId:H().min(1),listKey:H().min(1),item:lr(H(),ys()),afterItemId:H().min(1).optional(),afterIndex:Nn().int().min(0).optional()}),SK=Me({op:Lt("update_item"),pageSlug:H().min(1),blockId:H().min(1),listKey:H().min(1),itemId:H().min(1).optional(),index:Nn().int().min(0).optional(),patch:lr(H(),ys())}),wK=Me({op:Lt("remove_item"),pageSlug:H().min(1),blockId:H().min(1),listKey:H().min(1),itemId:H().min(1).optional(),index:Nn().int().min(0).optional()}),CK=Me({op:Lt("move_item"),pageSlug:H().min(1),blockId:H().min(1),listKey:H().min(1),itemId:H().min(1).optional(),index:Nn().int().min(0).optional(),afterItemId:H().min(1).optional(),afterIndex:Nn().int().min(0).optional()}),EK=Me({op:Lt("reorder_items"),pageSlug:H().min(1),blockId:H().min(1),listKey:H().min(1),order:lt(zh([H().min(1),Nn().int().min(0)])).min(1)}),_K=Me({op:Lt("reorder_blocks"),pageSlug:H().min(1),order:lt(H().min(1)).min(1)}),TK=Me({op:Lt("rename_page"),pageSlug:H().min(1),newPageSlug:H().min(1).optional(),newTitle:H().min(1).optional()}),AK=Me({op:Lt("remove_page"),pageSlug:H().min(1)}),NK=Me({op:Lt("move_page"),pageSlug:H().min(1),afterPageSlug:H().min(1).optional()}),MK=Me({op:Lt("duplicate_page"),pageSlug:H().min(1),newPageSlug:H().min(1).optional(),newTitle:H().min(1).optional(),afterPageSlug:H().min(1).optional()}),DK=["title","description","ogImage"],RK=Me({op:Lt("update_page_meta"),pageSlug:H().min(1),patch:iV({title:H().optional(),description:H().optional(),ogImage:H().optional()},{error:e=>{if(e.code!=="unrecognized_keys")return;const t=e.keys,n=t.map(i=>`\`${i}\``).join(", "),r=t.includes("path")?" `path` reports where the site already serves this page and is supplied by the site's adapter, so Avocado cannot reassign it here.":"";return`Invalid update_page_meta patch: unrecognized key ${n}. This patch accepts ${DK.join(", ")}.${r}`}})}),jK=Me({op:Lt("update_site_config"),patch:Me({name:H().optional(),logo:H().optional(),navLabels:lr(H(),H()).optional(),navGroups:lr(H(),lt(H())).optional()})}),IK=Me({op:Lt("update_theme"),patch:fK,cssVars:lr(H(),H()).optional()}),yb=JR("op",[mK,gK,bK,yK,xK,vK,kK,SK,wK,CK,EK,_K,TK,AK,NK,MK,RK,jK,IK]);Me({intent:ur(["edit_plan","needs_clarification","content_answer"]),summary_for_user:H().min(1),change_log:lt(H()),ops:lt(yb),suggested_next_actions:lt(H()).max(5).optional()});const _j=Ph({status:H().optional(),summary:H().optional(),changes:lt(H()).optional(),suggestions:lt(H()).optional(),previewVersion:Nn().optional(),focusBlockId:H().nullable().optional(),updatedSlug:H().optional(),error:H().optional(),debug:Ph({}).optional()}),OK=Me({type:Lt("status"),message:H()}),PK=Me({type:Lt("heartbeat"),stage:H(),label:H(),elapsedMs:Nn()}),zK=Me({type:Lt("token"),text:H()}),LK=Me({type:Lt("field_draft"),blockId:H(),editablePath:H(),value:H(),pageSlug:H().optional()}),BK=Me({type:Lt("summary_token"),text:H()}),FK=Me({type:Lt("thinking_start")}),$K=Me({type:Lt("thinking_token"),text:H()}),UK=Me({type:Lt("thinking_end"),durationMs:Nn().optional()}),HK=Me({type:Lt("changelog_entry"),entry:H()}),VK=Me({type:Lt("op_candidate"),index:Nn(),op:yb.or(Ph({}))}),qK=Me({type:Lt("op_skipped"),index:Nn(),total:Nn(),op:yb.or(Ph({})).optional(),reason:H().optional()}),KK=Me({type:Lt("plan_meta"),intent:H().optional(),summary:H().optional(),estimatedOps:Nn().optional()}),GK=Me({type:Lt("op_applied"),index:Nn(),total:Nn(),op:yb.or(Ph({})).optional(),previewVersion:Nn(),focusBlockId:H().nullable().optional(),updatedSlug:H().optional()}),WK=Me({type:Lt("rollback_started"),appliedCount:Nn(),reason:H().optional()}),ZK=Me({type:Lt("rollback_done"),restoredVersion:Nn().optional()}),YK=Me({type:Lt("image_progress"),percent:Nn().optional(),stage:H().optional()}).loose(),JK=Me({type:Lt("final"),result:_j}),XK=Me({type:Lt("error"),result:_j.optional(),code:Nn().optional()}),QK=Me({type:Lt("canceled"),message:H().optional()}),eG=JR("type",[OK,PK,zK,LK,BK,FK,$K,UK,HK,VK,qK,KK,GK,WK,ZK,YK,JK,XK,QK]);function tG(e){const t=eG.safeParse(e);if(!t.success)return null;const n=e==null?void 0:e._seq;return typeof n=="number"?{...t.data,_seq:n}:t.data}const nG=Me({chainId:H(),currentStep:Nn(),totalSteps:Nn(),nextStepLabel:H()}).passthrough(),rG=Me({id:H(),title:H(),summary:H(),patch:lr(H(),ys()),changedKeys:lt(H())}).passthrough(),iG=Me({blockId:H(),blockType:H(),pageSlug:H(),baseProps:lr(H(),ys()),options:lt(rG)}).passthrough(),sG=Me({status:H().optional(),summary:H().optional(),changes:lt(H()).optional(),mentionedSlugs:lt(H()).optional(),previewVersion:Nn().optional(),validationErrors:zh([lt(H()),Me({fieldErrors:lr(H(),lt(H())).optional(),formErrors:lt(H()).optional()}).passthrough()]).optional(),modelUsed:H().optional(),modelKey:H().optional(),plannerSource:ur(["openai","anthropic","gemini","demo"]).optional(),pendingPlanId:H().optional(),destructiveReasons:lt(H()).optional(),continuation:nG.optional(),focusBlockId:H().optional(),updatedSlug:H().optional(),undoSlug:H().optional(),suggestions:lt(H()).optional(),suggestionsV2:lt(Me({id:H(),label:H(),prompt:H(),kind:H(),source:H(),score:Nn(),evidence:H().optional()}).passthrough()).optional(),variations:iG.optional(),debug:lr(H(),ys()).optional(),error:H().optional()}).passthrough(),oG=Me({streamId:H().optional(),error:H().optional()}).passthrough(),aG=Me({slugs:lt(H()).optional(),pages:lt(Me({slug:H(),path:H().optional(),title:H().optional()}).passthrough()).optional()}).passthrough(),lG=Me({slugs:lt(H()).optional()}).passthrough(),uG=Me({status:H().optional(),error:H().optional()}).passthrough(),cG={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function cp(){return typeof window>"u"?{}:window.__AVOCADO_CONFIG__??{}}function Ni(){return cG??{}}function Wg(e){const t=e==null?void 0:e.trim();if(t)return t.replace(/\/+$/,"")}function Sk(){return Wg(cp().orchestratorUrl)??Wg(Ni().VITE_ORCHESTRATOR_URL)??"http://localhost:4200"}function dG(){return Wg(cp().siteOrigin)??Wg(Ni().VITE_SITE_ORIGIN)??"http://localhost:3000"}function fG(){return cp().publishToken??Ni().VITE_PUBLISH_TOKEN}function hG(){var e,t;return((e=cp().siteDraftSecret)==null?void 0:e.trim())??((t=Ni().VITE_SITE_DRAFT_SECRET)==null?void 0:t.trim())??""}function pG(){const e=cp().enablePatchTransport;return typeof e=="boolean"?e:Ni().VITE_ENABLE_PATCH_TRANSPORT==="1"}const hw=Ni().VITE_DEMO_MODE==="1",dd=Ni().VITE_PUBLIC_DEMO==="1";function dp(e){if(!(typeof window>"u"))try{return window.localStorage.getItem(e)??void 0}catch{return}}const kA="__ai_justification__:",SA="__ai_performance__:",Tj="editor-debug-mode-v1",Aj="editor-model-key-v1",Nj="editor-provider-v1",Sd="editor-chat-theme-v2",wk="editor-dev-options-v1",Ck="editor-chat-width-v1",Ek="editor-props-width-v1",wA=340,mG=720,CA=300,gG=560;function _k(e,t){const n=typeof window<"u"?window.innerWidth:1440,r=Math.max(wA,Math.min(mG,n*.5));return Math.max(wA,Math.min(e,r))}function bG(){if(typeof window>"u")return null;const e=window.localStorage.getItem(Ck);if(!e)return null;const t=Number.parseInt(e,10);return!Number.isFinite(t)||t<=0?null:_k(t)}function Tk(e,t){const n=typeof window<"u"?window.innerWidth:1440,r=Math.max(CA,Math.min(gG,n*.4));return Math.max(CA,Math.min(e,r))}function yG(){if(typeof window>"u")return null;const e=window.localStorage.getItem(Ek);if(!e)return null;const t=Number.parseInt(e,10);return!Number.isFinite(t)||t<=0?null:Tk(t)}function xG(){const e=zo(Ni().VITE_SHOW_DEV_OPTIONS,!1);if(typeof window>"u")return e;const t=new URLSearchParams(window.location.search).get("dev");if(t!==null){const n=zo(t,!1);try{window.localStorage.setItem(wk,n?"1":"0")}catch{}return n}return zo(dp(wk),e)}const vG={desktop:1200};function Bh(){return`${Date.now()}-${Math.random().toString(36).slice(2,7)}`}function kG(){return zo(Ni().VITE_CHAT_DEBUG,!1)?!0:zo(dp(Tj),!1)}const SG=new Set(["fast","balanced","reasoning","codex"]),wG=new Set(["openai","anthropic","gemini"]);function CG(){if(typeof window>"u")return"balanced";const e=window.localStorage.getItem(Aj);return e&&SG.has(e)?e:"balanced"}function EG(){if(typeof window>"u")return"anthropic";const e=window.localStorage.getItem(Nj);return e&&wG.has(e)?e:"anthropic"}function pw(){if(typeof window>"u")return null;let e=null;try{e=window.sessionStorage.getItem(Sd)??window.localStorage.getItem(Sd)}catch{}return e==="dark"?!0:e==="light"?!1:null}function Mj(){var e,t;return typeof window>"u"?!1:((t=(e=window.matchMedia)==null?void 0:e.call(window,"(prefers-color-scheme: dark)"))==null?void 0:t.matches)??!1}function _G(){return pw()??Mj()}function TG(){const e=pw();return e===null?"system":e?"dark":"light"}function AG(){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(Sd),window.localStorage.removeItem(Sd)}catch{}}const NG="editor-anchored-composer-v1",Dj="editor-auto-scroll-tracking-v1";function MG(){return zo(dp(Dj),!0)}const Rj="editor-auto-open-properties-v1";function DG(){return zo(dp(Rj),!0)}function RG(){return zo(Ni().VITE_ANCHORED_COMPOSER,zo(dp(NG),!0))}function jG(e,t){return{...e,...t}}function IG(e){const t=Array.isArray(e)?e:[];let n,r;const i=[];for(const s of t)if(typeof s=="string"&&/\w/.test(s)){if(s.startsWith(kA)){const o=s.slice(kA.length).trim();o&&(n=o);continue}if(s.startsWith(SA)){const o=s.slice(SA.length).trim();o&&(r=o);continue}i.push(s)}return{changes:i,aiJustification:n,aiPerformanceNote:r}}function OG(){if(typeof window>"u")return"/";const e=new URLSearchParams(window.location.search).get("slug");if(!e)return"/";const t=e.trim();return!t||t==="/"?"/":t.startsWith("/")?t:`/${t}`}function PG(e){if(!e)return[];if(Array.isArray(e))return e.map(String);const t=Object.values(e.fieldErrors??{}).flat().map(String);return[...(e.formErrors??[]).map(String),...t]}const fe=yR()(UF(e=>({activeBlockId:void 0,activeBlockType:void 0,activeEditablePath:void 0,slug:OG(),availableSlugs:["/"],availablePages:[],availableFiles:void 0,filesStatus:"unknown",canUploadFiles:!1,isLoadingSlugs:!1,chatLog:[],chatAttachments:[],isLoading:!1,streamStatus:null,streamingText:null,streamingChanges:[],streamingThinking:null,streamSteps:[],opChecklist:[],streamTokenCount:0,latestStreamFocusBlockId:null,imageProgress:null,continuationChainId:null,pendingPlanId:null,plannerBadgeState:"checking",variationModal:null,isApplyingVariation:!1,composerHeight:56,chatWidth:bG(),propsWidth:yG(),activeTab:"chat",showSettingsModal:!1,showDebugDetails:kG(),addBlockPicker:null,addBlockSearch:"",isAddingBlock:!1,imagePickerTarget:null,chatDarkMode:_G(),chatThemePreference:TG(),selectionModeEnabled:!1,anchorRect:null,anchoredExpanded:!1,selectedVariationId:null,showSiteSwitcher:!1,copiedDebugEntryId:null,feedbackNoteEntryId:null,feedbackNoteText:"",siteConfigTab:"overview",configModalTab:"general",modelKey:CG(),provider:EG(),availableProviders:[],useStreaming:!0,autoOpenPropertiesEnabled:DG(),autoScrollTrackingEnabled:MG(),autoScrollSuppressed:!1,backendFeatures:{},backendSite:{},fieldDraftDebugEnabled:!1,fieldDraftDebug:{eventsPerSecond:0,charsPerSecond:0,totalEvents:0,totalChars:0,typingLagChars:0,activeTarget:null},setActiveBlock:(t,n)=>e(r=>{const i=n===void 0&&t===r.activeBlockId?r.activeBlockType:n;return r.activeBlockId===t&&r.activeBlockType===i?r:{...r,activeBlockId:t,activeBlockType:i}}),setActiveEditablePath:t=>e(n=>n.activeEditablePath===t?n:{...n,activeEditablePath:t}),setSlug:t=>e(n=>n.slug===t?n:{...n,slug:t}),setAvailableSlugs:t=>e({availableSlugs:t}),setAvailablePages:t=>e({availablePages:t}),setAvailableFiles:t=>e({availableFiles:t}),setFilesStatus:t=>e({filesStatus:t}),setCanUploadFiles:t=>e({canUploadFiles:t}),setIsLoadingSlugs:t=>e(n=>n.isLoadingSlugs===t?n:{...n,isLoadingSlugs:t}),setChatLog:t=>e(n=>({...n,chatLog:typeof t=="function"?t(n.chatLog):t})),appendChatEntry:t=>e(n=>({...n,chatLog:[...n.chatLog,t]})),setChatAttachments:t=>e(n=>({...n,chatAttachments:typeof t=="function"?t(n.chatAttachments):t})),setIsLoading:t=>e(n=>n.isLoading===t?n:{...n,isLoading:t}),setStreamStatus:t=>e({streamStatus:t}),setStreamingText:t=>e(n=>({...n,streamingText:typeof t=="function"?t(n.streamingText):t})),setStreamingChanges:t=>e(n=>({...n,streamingChanges:typeof t=="function"?t(n.streamingChanges):t})),setStreamingThinking:t=>e(n=>({...n,streamingThinking:typeof t=="function"?t(n.streamingThinking):t})),setStreamSteps:t=>e(n=>({...n,streamSteps:typeof t=="function"?t(n.streamSteps):t})),setOpChecklist:t=>e(n=>({...n,opChecklist:typeof t=="function"?t(n.opChecklist):t})),setStreamTokenCount:t=>e(n=>({...n,streamTokenCount:typeof t=="function"?t(n.streamTokenCount):t})),setLatestStreamFocusBlockId:t=>e({latestStreamFocusBlockId:t}),setImageProgress:t=>e({imageProgress:t}),setContinuationChainId:t=>e({continuationChainId:t}),setPendingPlanId:t=>e({pendingPlanId:t}),setPlannerBadgeState:t=>e({plannerBadgeState:t}),setKeyFilePath:t=>e({keyFilePath:t}),setVariationModal:t=>e({variationModal:t}),setIsApplyingVariation:t=>e({isApplyingVariation:t}),patchVariationOption:(t,n)=>e(r=>{if(!r.variationModal)return r;const i=r.variationModal.options.map(s=>s.id===t?{...s,patch:n.patch,changedKeys:n.changedKeys,imagePending:!1}:s);return{...r,variationModal:{...r.variationModal,options:i}}}),setComposerHeight:t=>e(n=>{const r=typeof t=="function"?t(n.composerHeight):t;return n.composerHeight===r?n:{...n,composerHeight:r}}),setChatWidth:t=>e(n=>{const r=typeof t=="function"?t(n.chatWidth):t;return n.chatWidth===r?n:{...n,chatWidth:r}}),setPropsWidth:t=>e(n=>{const r=typeof t=="function"?t(n.propsWidth):t;return n.propsWidth===r?n:{...n,propsWidth:r}}),setActiveTab:t=>e(n=>n.activeTab===t?n:{...n,activeTab:t}),setShowSettingsModal:t=>e({showSettingsModal:t}),setShowDebugDetails:t=>e({showDebugDetails:t}),setAddBlockPicker:t=>e({addBlockPicker:t}),setAddBlockSearch:t=>e({addBlockSearch:t}),setIsAddingBlock:t=>e({isAddingBlock:t}),setImagePickerTarget:t=>e({imagePickerTarget:t}),setChatDarkMode:(t,n)=>{(n==null?void 0:n.persist)!==!1&&EA(t),e(r=>{const i=(n==null?void 0:n.persist)===!1?r.chatThemePreference:t?"dark":"light";return r.chatDarkMode===t&&r.chatThemePreference===i?r:{...r,chatDarkMode:t,chatThemePreference:i}})},setChatThemePreference:t=>{const n=t==="system"?Mj():t==="dark";t==="system"?AG():EA(n),e(r=>r.chatDarkMode===n&&r.chatThemePreference===t?r:{...r,chatDarkMode:n,chatThemePreference:t})},setSelectionModeEnabled:t=>e({selectionModeEnabled:t}),setAnchorRect:t=>e({anchorRect:t}),setAnchoredExpanded:t=>e({anchoredExpanded:t}),setSelectedVariationId:t=>e({selectedVariationId:t}),setShowSiteSwitcher:t=>e({showSiteSwitcher:t}),setCopiedDebugEntryId:t=>e({copiedDebugEntryId:t}),setFeedbackNoteEntryId:t=>e({feedbackNoteEntryId:t}),setFeedbackNoteText:t=>e({feedbackNoteText:t}),setSiteConfigTab:t=>e({siteConfigTab:t}),setConfigModalTab:t=>e({configModalTab:t}),setModelKey:t=>e(n=>n.modelKey===t?n:{...n,modelKey:t}),setProvider:t=>e(n=>n.provider===t?n:{...n,provider:t}),setAvailableProviders:t=>e({availableProviders:t}),setUseStreaming:t=>e({useStreaming:t}),setAutoOpenPropertiesEnabled:t=>e(n=>n.autoOpenPropertiesEnabled===t?n:{...n,autoOpenPropertiesEnabled:t}),setAutoScrollTrackingEnabled:t=>e(n=>n.autoScrollTrackingEnabled===t?n:{...n,autoScrollTrackingEnabled:t}),setAutoScrollSuppressed:t=>e(n=>n.autoScrollSuppressed===t?n:{...n,autoScrollSuppressed:t}),setBackendFeatures:t=>e({backendFeatures:t}),setBackendSite:t=>e({backendSite:t}),setFieldDraftDebugEnabled:t=>e({fieldDraftDebugEnabled:t}),setFieldDraftDebug:t=>e({fieldDraftDebug:t}),pushAssistantFromResult:(t,n)=>{const r=PG(t.validationErrors),i=IG(t.changes),s={id:Bh(),role:"assistant",text:t.summary??t.error??"Request failed.",status:t.status,canUndo:(n==null?void 0:n.canUndo)??!1,wasUndone:!1,undoSlug:n==null?void 0:n.undoSlug,changes:i.changes,mentionedSlugs:Array.isArray(t.mentionedSlugs)?t.mentionedSlugs.filter(o=>typeof o=="string"):[],suggestions:t.suggestions??[],suggestionsV2:t.suggestionsV2,variations:t.variations,errors:r,meta:t.modelUsed?`${t.modelUsed}${t.modelKey?` (${t.modelKey})`:""}`:void 0,debug:t.debug,aiJustification:i.aiJustification,aiPerformanceNote:i.aiPerformanceNote,pendingPlanId:typeof t.pendingPlanId=="string"?t.pendingPlanId:void 0,planApplied:t.planApplied===!0?!0:void 0,planPreview:t.planPreview??void 0,destructiveReasons:Array.isArray(t.destructiveReasons)?t.destructiveReasons.filter(o=>typeof o=="string"):void 0,continuation:t.continuation??void 0,imageSwap:n==null?void 0:n.imageSwap,thinking:n==null?void 0:n.thinking};e(o=>{if(!s.canUndo)return{...o,chatLog:[...o.chatLog,s]};const a=o.chatLog.map(u=>u.canUndo?{...u,canUndo:!1,wasUndone:!1}:u);return{...o,chatLog:[...a,s]}})}})));function jj(e){typeof window>"u"||window.document.documentElement.classList.toggle("editor-dark",e)}function EA(e){if(!(typeof window>"u"))try{window.sessionStorage.setItem(Sd,e?"dark":"light"),window.localStorage.setItem(Sd,e?"dark":"light")}catch{}}jj(fe.getState().chatDarkMode);fe.subscribe(e=>e.chatDarkMode,jj);fe.subscribe(e=>e.modelKey,e=>{typeof window>"u"||window.localStorage.setItem(Aj,e)});fe.subscribe(e=>e.provider,e=>{typeof window>"u"||window.localStorage.setItem(Nj,e)});fe.subscribe(e=>e.showDebugDetails,e=>{typeof window>"u"||window.localStorage.setItem(Tj,e?"1":"0")});fe.subscribe(e=>e.chatWidth,e=>{typeof window>"u"||(e==null?window.localStorage.removeItem(Ck):window.localStorage.setItem(Ck,String(Math.round(e))))});fe.subscribe(e=>e.propsWidth,e=>{typeof window>"u"||(e==null?window.localStorage.removeItem(Ek):window.localStorage.setItem(Ek,String(Math.round(e))))});fe.subscribe(e=>e.autoOpenPropertiesEnabled,e=>{typeof window>"u"||window.localStorage.setItem(Rj,e?"1":"0")});fe.subscribe(e=>e.autoScrollTrackingEnabled,e=>{typeof window>"u"||window.localStorage.setItem(Dj,e?"1":"0")});const Zg={sessionId:"dev",siteId:""};function Bi(){return Zg.sessionId}function Fi(){return Zg.siteId}function zG(e){Zg.sessionId=e.sessionId,Zg.siteId=e.siteId}const LG="image/png,image/jpeg,image/webp,image/gif,application/pdf";function _A(e){return e.type.startsWith("image/")||e.type==="application/pdf"}function BG(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${r.toString().padStart(2,"0")}`}function Ij(e){const{message:t,isLoading:n,onMessageChange:r,onSubmit:i,onCancel:s,onTranscribeAudio:o,onUploadAttachment:a,attachments:u,onAttachmentsChange:d,onAutoHeightChange:f,selectionModeEnabled:m,onToggleSelectionMode:g,compact:y}=e,{t:x}=Mn(),v=fe(ce=>ce.backendFeatures.audioTranscription)!==!1,[S,w]=E.useState(!1),[T,A]=E.useState(0),[M,j]=E.useState(!1),[D,P]=E.useState([]),[R,L]=E.useState(null),[F,q]=E.useState(null),W=E.useRef(null),K=E.useRef(null),Y=E.useRef(null),V=E.useRef(null),O=E.useRef(null),U=E.useRef([]),Q=E.useRef(null);function le(){const ce=K.current;if(!ce)return;const ve=W.current;if(ve){ve.style.height="0px",ve.style.overflowY="hidden";const He=ve.scrollHeight,bt=Math.min(220,Math.max(20,He));ve.style.height=`${bt}px`,ve.style.overflowY=He>bt?"auto":"hidden"}const Oe=ce.closest(".composer"),oe=Oe?Oe.scrollHeight:ce.scrollHeight;f(oe)}E.useEffect(()=>()=>{var ce,ve;try{(ce=V.current)==null||ce.stop()}catch{}(ve=O.current)==null||ve.getTracks().forEach(Oe=>Oe.stop()),V.current=null,O.current=null},[]),E.useLayoutEffect(()=>{le()},[t,S,M,D,u,R,F,f]),E.useEffect(()=>{var Oe;const ce=requestAnimationFrame(()=>le());let ve=!1;return typeof document<"u"&&((Oe=document.fonts)!=null&&Oe.ready)&&document.fonts.ready.then(()=>{ve||le()}).catch(()=>{}),()=>{cancelAnimationFrame(ce),ve=!0}},[]),E.useEffect(()=>{const ce=()=>le();return window.addEventListener("resize",ce),()=>window.removeEventListener("resize",ce)},[]),E.useEffect(()=>{const ce=K.current;if(!ce)return;const ve=ce.closest(".composer");let Oe;typeof ResizeObserver<"u"&&(Oe=new ResizeObserver(()=>le()),Oe.observe(ce),ve&&Oe.observe(ve));let oe;return ve&&typeof MutationObserver<"u"&&(oe=new MutationObserver(()=>le()),oe.observe(ve,{childList:!0})),()=>{Oe==null||Oe.disconnect(),oe==null||oe.disconnect()}},[]),E.useEffect(()=>{if(!S){A(0);return}const ce=performance.now();A(0);const ve=window.setInterval(()=>{A(performance.now()-ce)},250);return()=>window.clearInterval(ve)},[S]);function I(){var ce;return typeof window<"u"&&typeof window.MediaRecorder<"u"&&!!((ce=navigator.mediaDevices)!=null&&ce.getUserMedia)}function $(ce){const ve=ce.trim();if(!ve)return;const Oe=t.trim().length>0?`${t.trim()} `:"";r(`${Oe}${ve}`.trim())}async function X(ce){if(ce.length===0)return;q(null);const ve=[];let Oe=!1;for(const oe of ce)_A(oe)?ve.push(oe):Oe=!0;Oe&&q(x("chatInput.unsupportedFile")),ve.length!==0&&await Promise.all(ve.map(async oe=>{P(He=>[...He,oe.name]);try{const He=await a(oe);d($e=>[...$e,He])}catch(He){const $e=He instanceof Error?He.message:x("chatInput.uploadFailed");q($e)}finally{P(He=>{const $e=He.indexOf(oe.name);return $e===-1?He:[...He.slice(0,$e),...He.slice($e+1)]})}}))}function z(ce){d(ve=>ve.filter(Oe=>Oe.id!==ce))}async function Z(){var ce;if(L(null),!I()){L(x("chatInput.speechUnsupported"));return}if(!(n||M)){if(S){(ce=V.current)==null||ce.stop(),w(!1);return}try{const ve=await navigator.mediaDevices.getUserMedia({audio:!0});O.current=ve;const Oe=new MediaRecorder(ve);V.current=Oe,U.current=[],Oe.ondataavailable=oe=>{oe.data&&oe.data.size>0&&U.current.push(oe.data)},Oe.onstop=async()=>{const oe=Q.current;Q.current=null;const He=Oe.mimeType||"audio/webm",$e=U.current;if(U.current=[],ve.getTracks().forEach(bt=>bt.stop()),O.current=null,V.current=null,w(!1),!(oe==="cancel"||$e.length===0)){j(!0);try{const bt=new Blob($e,{type:He}),Ct=(await o(bt,He)).trim();if(!Ct){L(x("chatInput.noSpeechDetected"));return}const ct=[t.trim(),Ct].filter(Boolean).join(" ").trim();oe==="confirm"?i(ct):$(Ct)}catch(bt){const Gt=bt instanceof Error?bt.message:x("chatInput.transcribeFailed");L(Gt)}finally{j(!1)}}},Oe.start(),w(!0)}catch{L(x("chatInput.micBlocked"))}}}function se(){var ce;S&&(Q.current="cancel",(ce=V.current)==null||ce.stop(),U.current=[])}function ee(){var ce;S&&(Q.current="confirm",(ce=V.current)==null||ce.stop())}const ne=S||M,Ae=D.length>0,_e=u.length>0,ze=!n&&!ne&&!Ae&&(t.trim().length>0||_e);return p.jsxs("div",{className:`composer-shell${n?" is-loading":""}`,ref:K,children:[p.jsx("input",{ref:Y,type:"file",multiple:!0,accept:LG,style:{display:"none"},onChange:ce=>{const ve=Array.from(ce.target.files??[]);ce.target.value="",X(ve)}}),p.jsxs("div",{className:"composer-input-area",children:[(_e||Ae)&&!S?p.jsxs("div",{className:"composer-attachments",children:[u.map(ce=>p.jsxs("div",{className:"composer-attachment-chip",title:ce.name,children:[ce.kind==="image"?p.jsx("img",{className:"composer-attachment-thumb",src:ce.url,alt:""}):p.jsx("span",{className:"composer-attachment-icon","aria-hidden":"true",children:p.jsx(fb,{size:14})}),p.jsx("span",{className:"composer-attachment-name",children:ce.name??(ce.kind==="pdf"?"document.pdf":"image")}),p.jsx("button",{type:"button",className:"composer-attachment-remove",onClick:()=>z(ce.id),"aria-label":x("chatInput.removeAttachment"),children:p.jsx(bs,{size:12})})]},ce.id)),D.map((ce,ve)=>p.jsxs("div",{className:"composer-attachment-chip is-uploading",title:ce,children:[p.jsx("span",{className:"composer-attachment-icon","aria-hidden":"true",children:p.jsx(fk,{size:14,className:"composer-spin"})}),p.jsx("span",{className:"composer-attachment-name",children:ce})]},`uploading-${ve}-${ce}`))]}):null,!S&&p.jsx("textarea",{ref:W,placeholder:x(hw?"demo.placeholder":"chatInput.placeholder"),value:t,onChange:ce=>{r(ce.target.value),le()},onInput:()=>le(),onPaste:ce=>{var oe;const ve=(oe=ce.clipboardData)==null?void 0:oe.items;if(!ve)return;const Oe=[];for(const He of ve){if(He.kind!=="file")continue;const $e=He.getAsFile();$e&&_A($e)&&Oe.push($e)}Oe.length!==0&&(ce.preventDefault(),X(Oe))},onKeyDown:ce=>{ce.key==="Enter"&&!ce.shiftKey&&!ne&&!Ae&&(ce.preventDefault(),i())},rows:1}),S?p.jsxs("div",{className:"composer-input-note composer-input-note-listening",children:[p.jsx("span",{className:"composer-rec-dot","aria-hidden":"true"}),p.jsx("span",{className:"composer-rec-label",children:x("chatInput.listening")}),p.jsx("span",{className:"composer-rec-timer","aria-hidden":"true",children:BG(T)})]}):null,M?p.jsx("div",{className:"composer-input-note",children:x("chatInput.transcribing")}):null,R?p.jsx("div",{className:"composer-input-note composer-input-note-error",children:R}):null,F?p.jsx("div",{className:"composer-input-note composer-input-note-error",children:F}):null]}),p.jsxs("div",{className:"composer-actions",children:[!y&&!S&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"composer-ghost-btn composer-plus-btn",onClick:()=>{var ce;return(ce=Y.current)==null?void 0:ce.click()},disabled:n||Ae,"aria-label":x("chatInput.attachFile"),"data-tooltip":x("chatInput.attachFile"),children:p.jsx(oF,{size:16})}),g&&p.jsx("button",{type:"button",className:`composer-ghost-btn composer-selector-btn${m?" is-active":""}`,onClick:g,"aria-label":x(m?"chatInput.exitSelector":"chatInput.selectElement"),"data-tooltip":x(m?"chatInput.exitSelector":"chatInput.selectElement"),"aria-pressed":m,children:p.jsx(Q9,{size:16})})]}),p.jsx("div",{className:"composer-actions-spacer"}),p.jsx("div",{className:"composer-actions-right",role:"group","aria-label":x("chatInput.voiceActions"),children:!y&&S?p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"composer-ghost-btn composer-cancel-btn",onClick:se,disabled:n||M,"aria-label":x("chatInput.cancelVoice"),children:p.jsx(bs,{size:16})}),p.jsx("button",{type:"button",className:"composer-send-btn",onClick:ee,disabled:n||M,"aria-label":x("chatInput.sendRecorded"),children:p.jsx(Fd,{size:16})})]}):p.jsxs(p.Fragment,{children:[!y&&v&&p.jsx("button",{type:"button",className:"composer-ghost-btn",onClick:()=>void Z(),disabled:n||M,"aria-label":x("chatInput.startVoice"),children:p.jsx(J9,{size:16})}),p.jsxs("button",{type:"button",className:`composer-send-btn${n&&s?" is-stop":""}`,onClick:n&&s?s:()=>i(),disabled:!(n&&s)&&!ze,"aria-label":x(n&&s?"chatInput.stopGeneration":"chatInput.sendMessage"),children:[p.jsx("span",{className:"icon-send",children:p.jsx(GS,{size:16,strokeWidth:2.8})}),p.jsx("span",{className:"icon-stop",children:p.jsx(YS,{size:12,fill:"currentColor"})})]})]})})]})]})}function FG(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const $G=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,UG=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,HG={};function TA(e,t){return(HG.jsx?UG:$G).test(e)}const VG=/[ \t\n\f\r]/g;function qG(e){return typeof e=="object"?e.type==="text"?AA(e.value):!1:AA(e)}function AA(e){return e.replace(VG,"")===""}let fp=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};fp.prototype.normal={};fp.prototype.property={};fp.prototype.space=void 0;function Oj(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new fp(n,r,t)}function Ak(e){return e.toLowerCase()}class Ki{constructor(t,n){this.attribute=n,this.property=t}}Ki.prototype.attribute="";Ki.prototype.booleanish=!1;Ki.prototype.boolean=!1;Ki.prototype.commaOrSpaceSeparated=!1;Ki.prototype.commaSeparated=!1;Ki.prototype.defined=!1;Ki.prototype.mustUseProperty=!1;Ki.prototype.number=!1;Ki.prototype.overloadedBoolean=!1;Ki.prototype.property="";Ki.prototype.spaceSeparated=!1;Ki.prototype.space=void 0;let KG=0;const At=rc(),Sr=rc(),Nk=rc(),Ie=rc(),In=rc(),fd=rc(),ds=rc();function rc(){return 2**++KG}const Mk=Object.freeze(Object.defineProperty({__proto__:null,boolean:At,booleanish:Sr,commaOrSpaceSeparated:ds,commaSeparated:fd,number:Ie,overloadedBoolean:Nk,spaceSeparated:In},Symbol.toStringTag,{value:"Module"})),kx=Object.keys(Mk);class mw extends Ki{constructor(t,n,r,i){let s=-1;if(super(t,n),NA(this,"space",i),typeof r=="number")for(;++s<kx.length;){const o=kx[s];NA(this,kx[s],(r&Mk[o])===Mk[o])}}}mw.prototype.defined=!0;function NA(e,t,n){n&&(e[t]=n)}function Ud(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new mw(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Ak(r)]=r,n[Ak(s.attribute)]=r}return new fp(t,n,e.space)}const Pj=Ud({properties:{ariaActiveDescendant:null,ariaAtomic:Sr,ariaAutoComplete:null,ariaBusy:Sr,ariaChecked:Sr,ariaColCount:Ie,ariaColIndex:Ie,ariaColSpan:Ie,ariaControls:In,ariaCurrent:null,ariaDescribedBy:In,ariaDetails:null,ariaDisabled:Sr,ariaDropEffect:In,ariaErrorMessage:null,ariaExpanded:Sr,ariaFlowTo:In,ariaGrabbed:Sr,ariaHasPopup:null,ariaHidden:Sr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:In,ariaLevel:Ie,ariaLive:null,ariaModal:Sr,ariaMultiLine:Sr,ariaMultiSelectable:Sr,ariaOrientation:null,ariaOwns:In,ariaPlaceholder:null,ariaPosInSet:Ie,ariaPressed:Sr,ariaReadOnly:Sr,ariaRelevant:null,ariaRequired:Sr,ariaRoleDescription:In,ariaRowCount:Ie,ariaRowIndex:Ie,ariaRowSpan:Ie,ariaSelected:Sr,ariaSetSize:Ie,ariaSort:null,ariaValueMax:Ie,ariaValueMin:Ie,ariaValueNow:Ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function zj(e,t){return t in e?e[t]:t}function Lj(e,t){return zj(e,t.toLowerCase())}const GG=Ud({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fd,acceptCharset:In,accessKey:In,action:null,allow:null,allowFullScreen:At,allowPaymentRequest:At,allowUserMedia:At,alt:null,as:null,async:At,autoCapitalize:null,autoComplete:In,autoFocus:At,autoPlay:At,blocking:In,capture:null,charSet:null,checked:At,cite:null,className:In,cols:Ie,colSpan:null,content:null,contentEditable:Sr,controls:At,controlsList:In,coords:Ie|fd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:At,defer:At,dir:null,dirName:null,disabled:At,download:Nk,draggable:Sr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:At,formTarget:null,headers:In,height:Ie,hidden:Nk,high:Ie,href:null,hrefLang:null,htmlFor:In,httpEquiv:In,id:null,imageSizes:null,imageSrcSet:null,inert:At,inputMode:null,integrity:null,is:null,isMap:At,itemId:null,itemProp:In,itemRef:In,itemScope:At,itemType:In,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:At,low:Ie,manifest:null,max:null,maxLength:Ie,media:null,method:null,min:null,minLength:Ie,multiple:At,muted:At,name:null,nonce:null,noModule:At,noValidate:At,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:At,optimum:Ie,pattern:null,ping:In,placeholder:null,playsInline:At,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:At,referrerPolicy:null,rel:In,required:At,reversed:At,rows:Ie,rowSpan:Ie,sandbox:In,scope:null,scoped:At,seamless:At,selected:At,shadowRootClonable:At,shadowRootDelegatesFocus:At,shadowRootMode:null,shape:null,size:Ie,sizes:null,slot:null,span:Ie,spellCheck:Sr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ie,step:null,style:null,tabIndex:Ie,target:null,title:null,translate:null,type:null,typeMustMatch:At,useMap:null,value:Sr,width:Ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:In,axis:null,background:null,bgColor:null,border:Ie,borderColor:null,bottomMargin:Ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:At,declare:At,event:null,face:null,frame:null,frameBorder:null,hSpace:Ie,leftMargin:Ie,link:null,longDesc:null,lowSrc:null,marginHeight:Ie,marginWidth:Ie,noResize:At,noHref:At,noShade:At,noWrap:At,object:null,profile:null,prompt:null,rev:null,rightMargin:Ie,rules:null,scheme:null,scrolling:Sr,standby:null,summary:null,text:null,topMargin:Ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ie,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:At,disableRemotePlayback:At,prefix:null,property:null,results:Ie,security:null,unselectable:null},space:"html",transform:Lj}),WG=Ud({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:ds,accentHeight:Ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ie,amplitude:Ie,arabicForm:null,ascent:Ie,attributeName:null,attributeType:null,azimuth:Ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ie,by:null,calcMode:null,capHeight:Ie,className:In,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:Ie,diffuseConstant:Ie,direction:null,display:null,dur:null,divisor:Ie,dominantBaseline:null,download:At,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ie,enableBackground:null,end:null,event:null,exponent:Ie,externalResourcesRequired:null,fill:null,fillOpacity:Ie,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:fd,g2:fd,glyphName:fd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ie,horizOriginX:Ie,horizOriginY:Ie,id:null,ideographic:Ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ie,k:Ie,k1:Ie,k2:Ie,k3:Ie,k4:Ie,kernelMatrix:ds,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ie,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:Ie,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:Ie,overlineThickness:Ie,paintOrder:null,panose1:null,path:null,pathLength:Ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:In,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ie,pointsAtY:Ie,pointsAtZ:Ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ds,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ds,rev:ds,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ds,requiredFeatures:ds,requiredFonts:ds,requiredFormats:ds,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:Ie,specularExponent:Ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ie,strikethroughThickness:Ie,string:null,stroke:null,strokeDashArray:ds,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ie,strokeOpacity:Ie,strokeWidth:null,style:null,surfaceScale:Ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ds,tabIndex:Ie,tableValues:null,target:null,targetX:Ie,targetY:Ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ds,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ie,underlineThickness:Ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ie,values:null,vAlphabetic:Ie,vMathematical:Ie,vectorEffect:null,vHanging:Ie,vIdeographic:Ie,version:null,vertAdvY:Ie,vertOriginX:Ie,vertOriginY:Ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zj}),Bj=Ud({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Fj=Ud({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Lj}),$j=Ud({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ZG={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"},YG=/[A-Z]/g,MA=/-[a-z]/g,JG=/^data[-\w.:]+$/i;function XG(e,t){const n=Ak(t);let r=t,i=Ki;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&JG.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(MA,eW);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!MA.test(s)){let o=s.replace(YG,QG);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=mw}return new i(r,t)}function QG(e){return"-"+e.toLowerCase()}function eW(e){return e.charAt(1).toUpperCase()}const tW=Oj([Pj,GG,Bj,Fj,$j],"html"),gw=Oj([Pj,WG,Bj,Fj,$j],"svg");function nW(e){return e.join(" ").trim()}var Vc={},Sx,DA;function rW(){if(DA)return Sx;DA=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
488
+ `)){const o=s.trim();if(r!==null){n.push(s),o.startsWith(r)&&(r=null,i());continue}const a=kk.exec(o);if(a){i(),r=a[1],n.push(s);continue}if(o.length===0){i();continue}n.push(s)}return i(),t}function xj(e){return Qq(e).map(Xq).filter(t=>t!==null)}function eK(e){return xj(Zq(e))}const yt={paragraph:"paragraph",heading:"heading",bulletList:"bulletList",orderedList:"orderedList",listItem:"listItem",blockquote:"blockquote",codeBlock:"codeBlock",horizontalRule:"horizontalRule",hardBreak:"hardBreak",text:"text",unknown:"avocadoUnknownBlock",unknownInline:"avocadoUnknownInline"},Ut={bold:"bold",italic:"italic",strike:"strike",code:"code",underline:"underline",link:"link",unknownHtml:"avocadoUnknownHtml"};function yA(){return{type:"doc",content:[]}}const tK={p:yt.paragraph,h1:yt.heading,h2:yt.heading,h3:yt.heading,h4:yt.heading,h5:yt.heading,h6:yt.heading,ul:yt.bulletList,ol:yt.orderedList,li:yt.listItem,blockquote:yt.blockquote,pre:yt.codeBlock,hr:yt.horizontalRule},nK={strong:Ut.bold,b:Ut.bold,em:Ut.italic,i:Ut.italic,s:Ut.strike,del:Ut.strike,strike:Ut.strike,code:Ut.code,u:Ut.underline,a:Ut.link},vj={[Ut.bold]:"strong",[Ut.italic]:"em",[Ut.strike]:"s",[Ut.code]:"code",[Ut.underline]:"u",[Ut.link]:"a"},kj=new Set(["br","hr","img","input","meta","link","source","wbr","area","col","embed","track"]),rK={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};function Sj(e){return e.replace(/&(#x?[0-9a-f]+|[a-z]+);/gi,(t,n)=>{if(n[0]==="#"){const r=n[1]==="x"||n[1]==="X"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isFinite(r)&&r>0?String.fromCodePoint(r):t}return rK[n.toLowerCase()]??t})}function iK(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/ /g,"&nbsp;")}function Gg(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/ /g,"&nbsp;")}const Wm=/<(\/?)([a-zA-Z][a-zA-Z0-9-]*)((?:\s+[^\s/>"'=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*(\/?)>/g,xx=/([^\s/>"'=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function sK(e){const t=[];let n=0;Wm.lastIndex=0;for(let r=Wm.exec(e);r!==null;r=Wm.exec(e)){r.index>n&&t.push({kind:"text",text:e.slice(n,r.index)}),n=Wm.lastIndex;const i=r[2].toLowerCase();if(r[1]==="/"){t.push({kind:"close",tag:i});continue}const s=[];xx.lastIndex=0;for(let o=xx.exec(r[3]??"");o!==null;o=xx.exec(r[3]??""))s.push([o[1],Sj(o[2]??o[3]??o[4]??"")]);t.push({kind:"open",tag:i,attrs:s,selfClosing:r[4]==="/"||kj.has(i)})}return n<e.length&&t.push({kind:"text",text:e.slice(n)}),t}function wj(e){return Array.isArray(e)?e.map(([t,n])=>` ${t}="${Gg(String(n))}"`).join(""):""}function vx(e,t,n){const r=t.map(([i,s])=>` ${i}="${Gg(s)}"`).join("");return n&&kj.has(e)?`<${e}${r} />`:`<${e}${r}></${e}>`}function xA(e){if(typeof e!="string"||e.trim().length===0)return yA();const t=yA(),n=[],r=[],i=[],s=()=>{for(let g=n.length-1;g>=0;g--){const y=n[g];return y.content||(y.content=[]),y.content}return t.content},o=new Set([yt.paragraph,yt.heading,yt.codeBlock]);let a=null;const u=()=>{const g=s(),y=n[n.length-1];if(y&&o.has(y.type))return g;const x=g[g.length-1];if(a&&x===a)return x.content||(x.content=[]),x.content;const v={type:yt.paragraph,content:[]};return g.push(v),a=v,v.content},d=g=>{const y=n[n.length-1];if(y&&o.has(y.type)||a!==null){u().push({type:yt.unknownInline,attrs:{data:{html:g}}});return}s().push({type:yt.unknown,attrs:{data:{html:g}}})};let f=0;const m=g=>{if(g.length===0)return;const y={type:yt.text,text:g};r.length>0&&(y.marks=r.map(x=>({...x}))),u().push(y),f++};for(const g of sK(e)){if(g.kind==="text"){m(Sj(g.text));continue}if(g.kind==="close"){for(let A=i.length-1;A>=0;A--){if(i[A].tag!==g.tag)continue;const M=i.splice(A,1)[0];if(M.mark){const j=r.lastIndexOf(M.mark);j>=0&&r.splice(j,1),M.unknownHtml!==void 0&&f===M.textCountAtOpen&&d(M.unknownHtml)}else{const j=n.lastIndexOf(M.node);j>=0&&n.splice(j,1),a=null}break}continue}const{tag:y,attrs:x,selfClosing:v}=g;if(y==="br"){x.length===0?u().push({type:yt.hardBreak}):d(vx(y,x,!0));continue}const S=tK[y];if(S!==void 0){const A={type:S};S===yt.heading&&(A.attrs={level:Number(y[1])}),x.length>0&&(A.attrs={...A.attrs??{},htmlAttributes:x}),S!==yt.horizontalRule&&(A.content=[]),s().push(A),a=null,S!==yt.horizontalRule&&(n.push(A),i.push({tag:y,node:A}));continue}const w=nK[y];if(w!==void 0&&!v){const A={type:w};if(w===Ut.link){const M={};for(const[j,D]of x)M[j]=D;A.attrs=M}else x.length>0&&(A.attrs={htmlAttributes:x});r.push(A),i.push({tag:y,node:{type:yt.text},mark:A});continue}if(v){d(vx(y,x,!0));continue}const T={type:Ut.unknownHtml,attrs:{tag:y,attributes:x.map(([A,M])=>[A,M])}};r.push(T),i.push({tag:y,node:{type:yt.text},mark:T,unknownHtml:vx(y,x,!1),textCountAtOpen:f})}return t}function Cj(e){var n,r,i;if(e.type===Ut.unknownHtml){const s=String(((n=e.attrs)==null?void 0:n.tag)??"span"),o=Array.isArray((r=e.attrs)==null?void 0:r.attributes)?e.attrs.attributes:[];return`<${s}${o.map(([a,u])=>` ${a}="${Gg(String(u))}"`).join("")}>`}const t=vj[e.type];if(!t)return"";if(e.type===Ut.link){const s=e.attrs??{};return`<a${Object.entries(s).filter(([,a])=>a!=null).map(([a,u])=>` ${a}="${Gg(String(u))}"`).join("")}>`}return`<${t}${wj((i=e.attrs)==null?void 0:i.htmlAttributes)}>`}function oK(e){var n;const t=e.type===Ut.unknownHtml?String(((n=e.attrs)==null?void 0:n.tag)??"span"):vj[e.type];return t?`</${t}>`:""}function vA(e){return e.type===Ut.unknownHtml?`${e.type}:${Cj(e)}`:`${e.type}:${JSON.stringify(e.attrs??null)}`}function td(e){var i;let t="",n=[];const r=s=>{for(let o=n.length-1;o>=s;o--)t+=oK(n[o]);n=n.slice(0,s)};for(const s of e){if(s.type===yt.hardBreak){r(0),t+="<br />";continue}if(s.type===yt.unknownInline||s.type===yt.unknown){r(0);const u=(i=s.attrs)==null?void 0:i.data;typeof(u==null?void 0:u.html)=="string"&&(t+=u.html);continue}if(s.type!==yt.text||typeof s.text!="string")continue;const o=s.marks??[];let a=0;for(;a<o.length&&a<n.length&&vA(o[a])===vA(n[a]);)a++;r(a);for(let u=a;u<o.length;u++)t+=Cj(o[u]),n.push(o[u]);t+=iK(s.text)}return r(0),t}function ih(e){var r,i,s;const t=e.content?e.content:[],n=wj((r=e.attrs)==null?void 0:r.htmlAttributes);switch(e.type){case yt.paragraph:return`<p${n}>${td(t)}</p>`;case yt.heading:{const o=Number(((i=e.attrs)==null?void 0:i.level)??1),a=`h${o>=1&&o<=6?o:1}`;return`<${a}${n}>${td(t)}</${a}>`}case yt.bulletList:return`<ul${n}>${t.map(ih).join("")}</ul>`;case yt.orderedList:return`<ol${n}>${t.map(ih).join("")}</ol>`;case yt.listItem:return`<li${n}>${t.map(o=>{var a;return o.type===yt.paragraph&&!((a=o.attrs)!=null&&a.htmlAttributes)?td(o.content??[]):ih(o)}).join("")}</li>`;case yt.blockquote:return`<blockquote${n}>${t.map(ih).join("")}</blockquote>`;case yt.codeBlock:return`<pre${n}>${td(t)}</pre>`;case yt.horizontalRule:return`<hr${n} />`;case yt.unknownInline:case yt.unknown:{const o=(s=e.attrs)==null?void 0:s.data;return typeof(o==null?void 0:o.html)=="string"?o.html:""}default:return td(t)}}function aK(e){var n;if(typeof e!="object"||e===null)return"";const t=e.content;return!Array.isArray(t)||t.length===0?"":t.length===1&&t[0].type===yt.paragraph&&!((n=t[0].attrs)!=null&&n.htmlAttributes)?td(t[0].content??[]):t.map(ih).join("")}const lK={strong:Ut.bold,em:Ut.italic,underline:Ut.underline,"strike-through":Ut.strike,code:Ut.code};Object.fromEntries(Object.entries(lK).map(([e,t])=>[t,e]));const uK={bold:Ut.bold,italic:Ut.italic,underline:Ut.underline,code:Ut.code,strikethrough:Ut.strike};Object.fromEntries(Object.entries(uK).map(([e,t])=>[t,e]));const cK={bold:Ut.bold,italic:Ut.italic,underline:Ut.underline,strikethrough:Ut.strike,code:Ut.code};Object.fromEntries(Object.entries(cK).map(([e,t])=>[t,e]));const dK={bullet_list:yt.bulletList,ordered_list:yt.orderedList,list_item:yt.listItem,code_block:yt.codeBlock,horizontal_rule:yt.horizontalRule,hard_break:yt.hardBreak,blok:yt.unknown};Object.fromEntries(Object.entries(dK).map(([e,t])=>[t,e]));const fK=Me({brandColor:H().optional().describe("Primary brand color (sets --brand, --brand-hover, --link). Any CSS color."),accentColor:H().optional().describe("Secondary accent color (sets --accent, --accent-hover)."),backgroundColor:H().optional().describe("Page background color (sets --bg-0, --bg-000)."),surfaceColor:H().optional().describe("Card/panel surface color (sets --surface, --card-bg, --bg-100)."),headingColor:H().optional().describe("Heading text color (sets --heading, --text-100)."),textColor:H().optional().describe("Body text color (sets --body, --text-200)."),mutedTextColor:H().optional().describe("Secondary/muted text color (sets --body-secondary, --text-300, --caption)."),headingFont:H().optional().describe("Heading font stack (sets --font-heading), e.g. 'Georgia, serif'."),bodyFont:H().optional().describe("Body font stack (sets --font-body)."),radius:H().optional().describe("Corner radius applied across buttons/cards/inputs (sets --radius and friends), e.g. '12px'.")});Me({name:H().optional(),logo:H().optional(),purpose:H().optional(),tone:H().optional(),constraints:lt(H()).optional(),navLabels:lr(H(),H()).optional(),navGroups:lr(H(),lt(H())).optional(),themeOverrides:lr(H(),H()).optional()});const hK=Me({title:H().optional(),description:H().optional(),ogImage:H().optional(),path:H().optional()}),Ej={id:H().min(1),slug:H().min(1),title:H().min(1),updatedAt:H().min(1),meta:hK.optional()};Me({...Ej,blocks:lt(rj)});const pK=Me({...Ej,blocks:lt(ij)}),mK=Me({op:Lt("create_page"),page:pK}),gK=Me({op:Lt("add_block"),pageSlug:H().min(1),afterBlockId:H().min(1).optional(),block:ij}),bK=Me({op:Lt("update_props"),pageSlug:H().min(1),blockId:H().min(1),patch:lr(H(),ys()),imageQuery:H().optional()}),yK=Me({op:Lt("remove_block"),pageSlug:H().min(1),blockId:H().min(1)}),xK=Me({op:Lt("move_block"),pageSlug:H().min(1),blockId:H().min(1),afterBlockId:H().min(1).optional()}),vK=Me({op:Lt("duplicate_block"),pageSlug:H().min(1),blockId:H().min(1),toPageSlug:H().min(1).optional(),newBlockId:H().min(1).optional(),afterBlockId:H().min(1).optional()}),kK=Me({op:Lt("add_item"),pageSlug:H().min(1),blockId:H().min(1),listKey:H().min(1),item:lr(H(),ys()),afterItemId:H().min(1).optional(),afterIndex:Nn().int().min(0).optional()}),SK=Me({op:Lt("update_item"),pageSlug:H().min(1),blockId:H().min(1),listKey:H().min(1),itemId:H().min(1).optional(),index:Nn().int().min(0).optional(),patch:lr(H(),ys())}),wK=Me({op:Lt("remove_item"),pageSlug:H().min(1),blockId:H().min(1),listKey:H().min(1),itemId:H().min(1).optional(),index:Nn().int().min(0).optional()}),CK=Me({op:Lt("move_item"),pageSlug:H().min(1),blockId:H().min(1),listKey:H().min(1),itemId:H().min(1).optional(),index:Nn().int().min(0).optional(),afterItemId:H().min(1).optional(),afterIndex:Nn().int().min(0).optional()}),EK=Me({op:Lt("reorder_items"),pageSlug:H().min(1),blockId:H().min(1),listKey:H().min(1),order:lt(zh([H().min(1),Nn().int().min(0)])).min(1)}),_K=Me({op:Lt("reorder_blocks"),pageSlug:H().min(1),order:lt(H().min(1)).min(1)}),TK=Me({op:Lt("rename_page"),pageSlug:H().min(1),newPageSlug:H().min(1).optional(),newTitle:H().min(1).optional()}),AK=Me({op:Lt("remove_page"),pageSlug:H().min(1)}),NK=Me({op:Lt("move_page"),pageSlug:H().min(1),afterPageSlug:H().min(1).optional()}),MK=Me({op:Lt("duplicate_page"),pageSlug:H().min(1),newPageSlug:H().min(1).optional(),newTitle:H().min(1).optional(),afterPageSlug:H().min(1).optional()}),DK=["title","description","ogImage"],RK=Me({op:Lt("update_page_meta"),pageSlug:H().min(1),patch:iV({title:H().optional(),description:H().optional(),ogImage:H().optional()},{error:e=>{if(e.code!=="unrecognized_keys")return;const t=e.keys,n=t.map(i=>`\`${i}\``).join(", "),r=t.includes("path")?" `path` reports where the site already serves this page and is supplied by the site's adapter, so Avocado cannot reassign it here.":"";return`Invalid update_page_meta patch: unrecognized key ${n}. This patch accepts ${DK.join(", ")}.${r}`}})}),jK=Me({op:Lt("update_site_config"),patch:Me({name:H().optional(),logo:H().optional(),navLabels:lr(H(),H()).optional(),navGroups:lr(H(),lt(H())).optional()})}),IK=Me({op:Lt("update_theme"),patch:fK,cssVars:lr(H(),H()).optional()}),yb=JR("op",[mK,gK,bK,yK,xK,vK,kK,SK,wK,CK,EK,_K,TK,AK,NK,MK,RK,jK,IK]);Me({intent:ur(["edit_plan","needs_clarification","content_answer"]),summary_for_user:H().min(1),change_log:lt(H()),ops:lt(yb),suggested_next_actions:lt(H()).max(5).optional()});const _j=Ph({status:H().optional(),summary:H().optional(),changes:lt(H()).optional(),suggestions:lt(H()).optional(),previewVersion:Nn().optional(),focusBlockId:H().nullable().optional(),updatedSlug:H().optional(),error:H().optional(),debug:Ph({}).optional()}),OK=Me({type:Lt("status"),message:H()}),PK=Me({type:Lt("heartbeat"),stage:H(),label:H(),elapsedMs:Nn()}),zK=Me({type:Lt("token"),text:H()}),LK=Me({type:Lt("field_draft"),blockId:H(),editablePath:H(),value:H(),pageSlug:H().optional()}),BK=Me({type:Lt("summary_token"),text:H()}),FK=Me({type:Lt("thinking_start")}),$K=Me({type:Lt("thinking_token"),text:H()}),UK=Me({type:Lt("thinking_end"),durationMs:Nn().optional()}),HK=Me({type:Lt("changelog_entry"),entry:H()}),VK=Me({type:Lt("op_candidate"),index:Nn(),op:yb.or(Ph({}))}),qK=Me({type:Lt("op_skipped"),index:Nn(),total:Nn(),op:yb.or(Ph({})).optional(),reason:H().optional()}),KK=Me({type:Lt("plan_meta"),intent:H().optional(),summary:H().optional(),estimatedOps:Nn().optional()}),GK=Me({type:Lt("op_applied"),index:Nn(),total:Nn(),op:yb.or(Ph({})).optional(),previewVersion:Nn(),focusBlockId:H().nullable().optional(),updatedSlug:H().optional()}),WK=Me({type:Lt("rollback_started"),appliedCount:Nn(),reason:H().optional()}),ZK=Me({type:Lt("rollback_done"),restoredVersion:Nn().optional()}),YK=Me({type:Lt("image_progress"),percent:Nn().optional(),stage:H().optional()}).loose(),JK=Me({type:Lt("final"),result:_j}),XK=Me({type:Lt("error"),result:_j.optional(),code:Nn().optional()}),QK=Me({type:Lt("canceled"),message:H().optional()}),eG=JR("type",[OK,PK,zK,LK,BK,FK,$K,UK,HK,VK,qK,KK,GK,WK,ZK,YK,JK,XK,QK]);function tG(e){const t=eG.safeParse(e);if(!t.success)return null;const n=e==null?void 0:e._seq;return typeof n=="number"?{...t.data,_seq:n}:t.data}const nG=Me({chainId:H(),currentStep:Nn(),totalSteps:Nn(),nextStepLabel:H()}).passthrough(),rG=Me({id:H(),title:H(),summary:H(),patch:lr(H(),ys()),changedKeys:lt(H())}).passthrough(),iG=Me({blockId:H(),blockType:H(),pageSlug:H(),baseProps:lr(H(),ys()),options:lt(rG)}).passthrough(),sG=Me({status:H().optional(),summary:H().optional(),changes:lt(H()).optional(),mentionedSlugs:lt(H()).optional(),previewVersion:Nn().optional(),validationErrors:zh([lt(H()),Me({fieldErrors:lr(H(),lt(H())).optional(),formErrors:lt(H()).optional()}).passthrough()]).optional(),modelUsed:H().optional(),modelKey:H().optional(),plannerSource:ur(["openai","anthropic","gemini","demo"]).optional(),pendingPlanId:H().optional(),destructiveReasons:lt(H()).optional(),continuation:nG.optional(),focusBlockId:H().optional(),updatedSlug:H().optional(),undoSlug:H().optional(),suggestions:lt(H()).optional(),suggestionsV2:lt(Me({id:H(),label:H(),prompt:H(),kind:H(),source:H(),score:Nn(),evidence:H().optional()}).passthrough()).optional(),variations:iG.optional(),debug:lr(H(),ys()).optional(),error:H().optional()}).passthrough(),oG=Me({streamId:H().optional(),error:H().optional()}).passthrough(),aG=Me({slugs:lt(H()).optional(),pages:lt(Me({slug:H(),path:H().optional(),title:H().optional()}).passthrough()).optional()}).passthrough(),lG=Me({slugs:lt(H()).optional()}).passthrough(),uG=Me({status:H().optional(),error:H().optional()}).passthrough(),cG={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function cp(){return typeof window>"u"?{}:window.__AVOCADO_CONFIG__??{}}function Ni(){return cG??{}}function Wg(e){const t=e==null?void 0:e.trim();if(t)return t.replace(/\/+$/,"")}function Sk(){return Wg(cp().orchestratorUrl)??Wg(Ni().VITE_ORCHESTRATOR_URL)??"http://localhost:4200"}function dG(){return Wg(cp().siteOrigin)??Wg(Ni().VITE_SITE_ORIGIN)??"http://localhost:3000"}function fG(){return cp().publishToken??Ni().VITE_PUBLISH_TOKEN}function hG(){var e,t;return((e=cp().siteDraftSecret)==null?void 0:e.trim())??((t=Ni().VITE_SITE_DRAFT_SECRET)==null?void 0:t.trim())??""}function pG(){const e=cp().enablePatchTransport;return typeof e=="boolean"?e:Ni().VITE_ENABLE_PATCH_TRANSPORT==="1"}const hw=Ni().VITE_DEMO_MODE==="1",dd=Ni().VITE_PUBLIC_DEMO==="1";function dp(e){if(!(typeof window>"u"))try{return window.localStorage.getItem(e)??void 0}catch{return}}const kA="__ai_justification__:",SA="__ai_performance__:",Tj="editor-debug-mode-v1",Aj="editor-model-key-v1",Nj="editor-provider-v1",Sd="editor-chat-theme-v2",wk="editor-dev-options-v1",Ck="editor-chat-width-v1",Ek="editor-props-width-v1",wA=280,mG=720,CA=260,gG=560;function _k(e,t){const n=typeof window<"u"?window.innerWidth:1440,r=Math.max(wA,Math.min(mG,n*.5));return Math.max(wA,Math.min(e,r))}function bG(){if(typeof window>"u")return null;const e=window.localStorage.getItem(Ck);if(!e)return null;const t=Number.parseInt(e,10);return!Number.isFinite(t)||t<=0?null:_k(t)}function Tk(e,t){const n=typeof window<"u"?window.innerWidth:1440,r=Math.max(CA,Math.min(gG,n*.4));return Math.max(CA,Math.min(e,r))}function yG(){if(typeof window>"u")return null;const e=window.localStorage.getItem(Ek);if(!e)return null;const t=Number.parseInt(e,10);return!Number.isFinite(t)||t<=0?null:Tk(t)}function xG(){const e=zo(Ni().VITE_SHOW_DEV_OPTIONS,!1);if(typeof window>"u")return e;const t=new URLSearchParams(window.location.search).get("dev");if(t!==null){const n=zo(t,!1);try{window.localStorage.setItem(wk,n?"1":"0")}catch{}return n}return zo(dp(wk),e)}const vG={desktop:1200};function Bh(){return`${Date.now()}-${Math.random().toString(36).slice(2,7)}`}function kG(){return zo(Ni().VITE_CHAT_DEBUG,!1)?!0:zo(dp(Tj),!1)}const SG=new Set(["fast","balanced","reasoning","codex"]),wG=new Set(["openai","anthropic","gemini"]);function CG(){if(typeof window>"u")return"balanced";const e=window.localStorage.getItem(Aj);return e&&SG.has(e)?e:"balanced"}function EG(){if(typeof window>"u")return"anthropic";const e=window.localStorage.getItem(Nj);return e&&wG.has(e)?e:"anthropic"}function pw(){if(typeof window>"u")return null;let e=null;try{e=window.sessionStorage.getItem(Sd)??window.localStorage.getItem(Sd)}catch{}return e==="dark"?!0:e==="light"?!1:null}function Mj(){var e,t;return typeof window>"u"?!1:((t=(e=window.matchMedia)==null?void 0:e.call(window,"(prefers-color-scheme: dark)"))==null?void 0:t.matches)??!1}function _G(){return pw()??Mj()}function TG(){const e=pw();return e===null?"system":e?"dark":"light"}function AG(){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(Sd),window.localStorage.removeItem(Sd)}catch{}}const NG="editor-anchored-composer-v1",Dj="editor-auto-scroll-tracking-v1";function MG(){return zo(dp(Dj),!0)}const Rj="editor-auto-open-properties-v1";function DG(){return zo(dp(Rj),!0)}function RG(){return zo(Ni().VITE_ANCHORED_COMPOSER,zo(dp(NG),!0))}function jG(e,t){return{...e,...t}}function IG(e){const t=Array.isArray(e)?e:[];let n,r;const i=[];for(const s of t)if(typeof s=="string"&&/\w/.test(s)){if(s.startsWith(kA)){const o=s.slice(kA.length).trim();o&&(n=o);continue}if(s.startsWith(SA)){const o=s.slice(SA.length).trim();o&&(r=o);continue}i.push(s)}return{changes:i,aiJustification:n,aiPerformanceNote:r}}function OG(){if(typeof window>"u")return"/";const e=new URLSearchParams(window.location.search).get("slug");if(!e)return"/";const t=e.trim();return!t||t==="/"?"/":t.startsWith("/")?t:`/${t}`}function PG(e){if(!e)return[];if(Array.isArray(e))return e.map(String);const t=Object.values(e.fieldErrors??{}).flat().map(String);return[...(e.formErrors??[]).map(String),...t]}const fe=yR()(UF(e=>({activeBlockId:void 0,activeBlockType:void 0,activeEditablePath:void 0,slug:OG(),availableSlugs:["/"],availablePages:[],availableFiles:void 0,filesStatus:"unknown",canUploadFiles:!1,isLoadingSlugs:!1,chatLog:[],chatAttachments:[],isLoading:!1,streamStatus:null,streamingText:null,streamingChanges:[],streamingThinking:null,streamSteps:[],opChecklist:[],streamTokenCount:0,latestStreamFocusBlockId:null,imageProgress:null,continuationChainId:null,pendingPlanId:null,plannerBadgeState:"checking",variationModal:null,isApplyingVariation:!1,composerHeight:56,chatWidth:bG(),propsWidth:yG(),activeTab:"chat",showSettingsModal:!1,showDebugDetails:kG(),addBlockPicker:null,addBlockSearch:"",isAddingBlock:!1,imagePickerTarget:null,chatDarkMode:_G(),chatThemePreference:TG(),selectionModeEnabled:!1,anchorRect:null,anchoredExpanded:!1,selectedVariationId:null,showSiteSwitcher:!1,copiedDebugEntryId:null,feedbackNoteEntryId:null,feedbackNoteText:"",siteConfigTab:"overview",configModalTab:"general",modelKey:CG(),provider:EG(),availableProviders:[],useStreaming:!0,autoOpenPropertiesEnabled:DG(),autoScrollTrackingEnabled:MG(),autoScrollSuppressed:!1,backendFeatures:{},backendSite:{},fieldDraftDebugEnabled:!1,fieldDraftDebug:{eventsPerSecond:0,charsPerSecond:0,totalEvents:0,totalChars:0,typingLagChars:0,activeTarget:null},setActiveBlock:(t,n)=>e(r=>{const i=n===void 0&&t===r.activeBlockId?r.activeBlockType:n;return r.activeBlockId===t&&r.activeBlockType===i?r:{...r,activeBlockId:t,activeBlockType:i}}),setActiveEditablePath:t=>e(n=>n.activeEditablePath===t?n:{...n,activeEditablePath:t}),setSlug:t=>e(n=>n.slug===t?n:{...n,slug:t}),setAvailableSlugs:t=>e({availableSlugs:t}),setAvailablePages:t=>e({availablePages:t}),setAvailableFiles:t=>e({availableFiles:t}),setFilesStatus:t=>e({filesStatus:t}),setCanUploadFiles:t=>e({canUploadFiles:t}),setIsLoadingSlugs:t=>e(n=>n.isLoadingSlugs===t?n:{...n,isLoadingSlugs:t}),setChatLog:t=>e(n=>({...n,chatLog:typeof t=="function"?t(n.chatLog):t})),appendChatEntry:t=>e(n=>({...n,chatLog:[...n.chatLog,t]})),setChatAttachments:t=>e(n=>({...n,chatAttachments:typeof t=="function"?t(n.chatAttachments):t})),setIsLoading:t=>e(n=>n.isLoading===t?n:{...n,isLoading:t}),setStreamStatus:t=>e({streamStatus:t}),setStreamingText:t=>e(n=>({...n,streamingText:typeof t=="function"?t(n.streamingText):t})),setStreamingChanges:t=>e(n=>({...n,streamingChanges:typeof t=="function"?t(n.streamingChanges):t})),setStreamingThinking:t=>e(n=>({...n,streamingThinking:typeof t=="function"?t(n.streamingThinking):t})),setStreamSteps:t=>e(n=>({...n,streamSteps:typeof t=="function"?t(n.streamSteps):t})),setOpChecklist:t=>e(n=>({...n,opChecklist:typeof t=="function"?t(n.opChecklist):t})),setStreamTokenCount:t=>e(n=>({...n,streamTokenCount:typeof t=="function"?t(n.streamTokenCount):t})),setLatestStreamFocusBlockId:t=>e({latestStreamFocusBlockId:t}),setImageProgress:t=>e({imageProgress:t}),setContinuationChainId:t=>e({continuationChainId:t}),setPendingPlanId:t=>e({pendingPlanId:t}),setPlannerBadgeState:t=>e({plannerBadgeState:t}),setKeyFilePath:t=>e({keyFilePath:t}),setVariationModal:t=>e({variationModal:t}),setIsApplyingVariation:t=>e({isApplyingVariation:t}),patchVariationOption:(t,n)=>e(r=>{if(!r.variationModal)return r;const i=r.variationModal.options.map(s=>s.id===t?{...s,patch:n.patch,changedKeys:n.changedKeys,imagePending:!1}:s);return{...r,variationModal:{...r.variationModal,options:i}}}),setComposerHeight:t=>e(n=>{const r=typeof t=="function"?t(n.composerHeight):t;return n.composerHeight===r?n:{...n,composerHeight:r}}),setChatWidth:t=>e(n=>{const r=typeof t=="function"?t(n.chatWidth):t;return n.chatWidth===r?n:{...n,chatWidth:r}}),setPropsWidth:t=>e(n=>{const r=typeof t=="function"?t(n.propsWidth):t;return n.propsWidth===r?n:{...n,propsWidth:r}}),setActiveTab:t=>e(n=>n.activeTab===t?n:{...n,activeTab:t}),setShowSettingsModal:t=>e({showSettingsModal:t}),setShowDebugDetails:t=>e({showDebugDetails:t}),setAddBlockPicker:t=>e({addBlockPicker:t}),setAddBlockSearch:t=>e({addBlockSearch:t}),setIsAddingBlock:t=>e({isAddingBlock:t}),setImagePickerTarget:t=>e({imagePickerTarget:t}),setChatDarkMode:(t,n)=>{(n==null?void 0:n.persist)!==!1&&EA(t),e(r=>{const i=(n==null?void 0:n.persist)===!1?r.chatThemePreference:t?"dark":"light";return r.chatDarkMode===t&&r.chatThemePreference===i?r:{...r,chatDarkMode:t,chatThemePreference:i}})},setChatThemePreference:t=>{const n=t==="system"?Mj():t==="dark";t==="system"?AG():EA(n),e(r=>r.chatDarkMode===n&&r.chatThemePreference===t?r:{...r,chatDarkMode:n,chatThemePreference:t})},setSelectionModeEnabled:t=>e({selectionModeEnabled:t}),setAnchorRect:t=>e({anchorRect:t}),setAnchoredExpanded:t=>e({anchoredExpanded:t}),setSelectedVariationId:t=>e({selectedVariationId:t}),setShowSiteSwitcher:t=>e({showSiteSwitcher:t}),setCopiedDebugEntryId:t=>e({copiedDebugEntryId:t}),setFeedbackNoteEntryId:t=>e({feedbackNoteEntryId:t}),setFeedbackNoteText:t=>e({feedbackNoteText:t}),setSiteConfigTab:t=>e({siteConfigTab:t}),setConfigModalTab:t=>e({configModalTab:t}),setModelKey:t=>e(n=>n.modelKey===t?n:{...n,modelKey:t}),setProvider:t=>e(n=>n.provider===t?n:{...n,provider:t}),setAvailableProviders:t=>e({availableProviders:t}),setUseStreaming:t=>e({useStreaming:t}),setAutoOpenPropertiesEnabled:t=>e(n=>n.autoOpenPropertiesEnabled===t?n:{...n,autoOpenPropertiesEnabled:t}),setAutoScrollTrackingEnabled:t=>e(n=>n.autoScrollTrackingEnabled===t?n:{...n,autoScrollTrackingEnabled:t}),setAutoScrollSuppressed:t=>e(n=>n.autoScrollSuppressed===t?n:{...n,autoScrollSuppressed:t}),setBackendFeatures:t=>e({backendFeatures:t}),setBackendSite:t=>e({backendSite:t}),setFieldDraftDebugEnabled:t=>e({fieldDraftDebugEnabled:t}),setFieldDraftDebug:t=>e({fieldDraftDebug:t}),pushAssistantFromResult:(t,n)=>{const r=PG(t.validationErrors),i=IG(t.changes),s={id:Bh(),role:"assistant",text:t.summary??t.error??"Request failed.",status:t.status,canUndo:(n==null?void 0:n.canUndo)??!1,wasUndone:!1,undoSlug:n==null?void 0:n.undoSlug,changes:i.changes,mentionedSlugs:Array.isArray(t.mentionedSlugs)?t.mentionedSlugs.filter(o=>typeof o=="string"):[],suggestions:t.suggestions??[],suggestionsV2:t.suggestionsV2,variations:t.variations,errors:r,meta:t.modelUsed?`${t.modelUsed}${t.modelKey?` (${t.modelKey})`:""}`:void 0,debug:t.debug,aiJustification:i.aiJustification,aiPerformanceNote:i.aiPerformanceNote,pendingPlanId:typeof t.pendingPlanId=="string"?t.pendingPlanId:void 0,planApplied:t.planApplied===!0?!0:void 0,planPreview:t.planPreview??void 0,destructiveReasons:Array.isArray(t.destructiveReasons)?t.destructiveReasons.filter(o=>typeof o=="string"):void 0,continuation:t.continuation??void 0,imageSwap:n==null?void 0:n.imageSwap,thinking:n==null?void 0:n.thinking};e(o=>{if(!s.canUndo)return{...o,chatLog:[...o.chatLog,s]};const a=o.chatLog.map(u=>u.canUndo?{...u,canUndo:!1,wasUndone:!1}:u);return{...o,chatLog:[...a,s]}})}})));function jj(e){typeof window>"u"||window.document.documentElement.classList.toggle("editor-dark",e)}function EA(e){if(!(typeof window>"u"))try{window.sessionStorage.setItem(Sd,e?"dark":"light"),window.localStorage.setItem(Sd,e?"dark":"light")}catch{}}jj(fe.getState().chatDarkMode);fe.subscribe(e=>e.chatDarkMode,jj);fe.subscribe(e=>e.modelKey,e=>{typeof window>"u"||window.localStorage.setItem(Aj,e)});fe.subscribe(e=>e.provider,e=>{typeof window>"u"||window.localStorage.setItem(Nj,e)});fe.subscribe(e=>e.showDebugDetails,e=>{typeof window>"u"||window.localStorage.setItem(Tj,e?"1":"0")});fe.subscribe(e=>e.chatWidth,e=>{typeof window>"u"||(e==null?window.localStorage.removeItem(Ck):window.localStorage.setItem(Ck,String(Math.round(e))))});fe.subscribe(e=>e.propsWidth,e=>{typeof window>"u"||(e==null?window.localStorage.removeItem(Ek):window.localStorage.setItem(Ek,String(Math.round(e))))});fe.subscribe(e=>e.autoOpenPropertiesEnabled,e=>{typeof window>"u"||window.localStorage.setItem(Rj,e?"1":"0")});fe.subscribe(e=>e.autoScrollTrackingEnabled,e=>{typeof window>"u"||window.localStorage.setItem(Dj,e?"1":"0")});const Zg={sessionId:"dev",siteId:""};function Bi(){return Zg.sessionId}function Fi(){return Zg.siteId}function zG(e){Zg.sessionId=e.sessionId,Zg.siteId=e.siteId}const LG="image/png,image/jpeg,image/webp,image/gif,application/pdf";function _A(e){return e.type.startsWith("image/")||e.type==="application/pdf"}function BG(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${r.toString().padStart(2,"0")}`}function Ij(e){const{message:t,isLoading:n,onMessageChange:r,onSubmit:i,onCancel:s,onTranscribeAudio:o,onUploadAttachment:a,attachments:u,onAttachmentsChange:d,onAutoHeightChange:f,selectionModeEnabled:m,onToggleSelectionMode:g,compact:y}=e,{t:x}=Mn(),v=fe(ce=>ce.backendFeatures.audioTranscription)!==!1,[S,w]=E.useState(!1),[T,A]=E.useState(0),[M,j]=E.useState(!1),[D,P]=E.useState([]),[R,L]=E.useState(null),[F,q]=E.useState(null),W=E.useRef(null),K=E.useRef(null),Y=E.useRef(null),V=E.useRef(null),O=E.useRef(null),U=E.useRef([]),Q=E.useRef(null);function le(){const ce=K.current;if(!ce)return;const ve=W.current;if(ve){ve.style.height="0px",ve.style.overflowY="hidden";const He=ve.scrollHeight,bt=Math.min(220,Math.max(20,He));ve.style.height=`${bt}px`,ve.style.overflowY=He>bt?"auto":"hidden"}const Oe=ce.closest(".composer"),oe=Oe?Oe.scrollHeight:ce.scrollHeight;f(oe)}E.useEffect(()=>()=>{var ce,ve;try{(ce=V.current)==null||ce.stop()}catch{}(ve=O.current)==null||ve.getTracks().forEach(Oe=>Oe.stop()),V.current=null,O.current=null},[]),E.useLayoutEffect(()=>{le()},[t,S,M,D,u,R,F,f]),E.useEffect(()=>{var Oe;const ce=requestAnimationFrame(()=>le());let ve=!1;return typeof document<"u"&&((Oe=document.fonts)!=null&&Oe.ready)&&document.fonts.ready.then(()=>{ve||le()}).catch(()=>{}),()=>{cancelAnimationFrame(ce),ve=!0}},[]),E.useEffect(()=>{const ce=()=>le();return window.addEventListener("resize",ce),()=>window.removeEventListener("resize",ce)},[]),E.useEffect(()=>{const ce=K.current;if(!ce)return;const ve=ce.closest(".composer");let Oe;typeof ResizeObserver<"u"&&(Oe=new ResizeObserver(()=>le()),Oe.observe(ce),ve&&Oe.observe(ve));let oe;return ve&&typeof MutationObserver<"u"&&(oe=new MutationObserver(()=>le()),oe.observe(ve,{childList:!0})),()=>{Oe==null||Oe.disconnect(),oe==null||oe.disconnect()}},[]),E.useEffect(()=>{if(!S){A(0);return}const ce=performance.now();A(0);const ve=window.setInterval(()=>{A(performance.now()-ce)},250);return()=>window.clearInterval(ve)},[S]);function I(){var ce;return typeof window<"u"&&typeof window.MediaRecorder<"u"&&!!((ce=navigator.mediaDevices)!=null&&ce.getUserMedia)}function $(ce){const ve=ce.trim();if(!ve)return;const Oe=t.trim().length>0?`${t.trim()} `:"";r(`${Oe}${ve}`.trim())}async function X(ce){if(ce.length===0)return;q(null);const ve=[];let Oe=!1;for(const oe of ce)_A(oe)?ve.push(oe):Oe=!0;Oe&&q(x("chatInput.unsupportedFile")),ve.length!==0&&await Promise.all(ve.map(async oe=>{P(He=>[...He,oe.name]);try{const He=await a(oe);d($e=>[...$e,He])}catch(He){const $e=He instanceof Error?He.message:x("chatInput.uploadFailed");q($e)}finally{P(He=>{const $e=He.indexOf(oe.name);return $e===-1?He:[...He.slice(0,$e),...He.slice($e+1)]})}}))}function z(ce){d(ve=>ve.filter(Oe=>Oe.id!==ce))}async function Z(){var ce;if(L(null),!I()){L(x("chatInput.speechUnsupported"));return}if(!(n||M)){if(S){(ce=V.current)==null||ce.stop(),w(!1);return}try{const ve=await navigator.mediaDevices.getUserMedia({audio:!0});O.current=ve;const Oe=new MediaRecorder(ve);V.current=Oe,U.current=[],Oe.ondataavailable=oe=>{oe.data&&oe.data.size>0&&U.current.push(oe.data)},Oe.onstop=async()=>{const oe=Q.current;Q.current=null;const He=Oe.mimeType||"audio/webm",$e=U.current;if(U.current=[],ve.getTracks().forEach(bt=>bt.stop()),O.current=null,V.current=null,w(!1),!(oe==="cancel"||$e.length===0)){j(!0);try{const bt=new Blob($e,{type:He}),Ct=(await o(bt,He)).trim();if(!Ct){L(x("chatInput.noSpeechDetected"));return}const ct=[t.trim(),Ct].filter(Boolean).join(" ").trim();oe==="confirm"?i(ct):$(Ct)}catch(bt){const Gt=bt instanceof Error?bt.message:x("chatInput.transcribeFailed");L(Gt)}finally{j(!1)}}},Oe.start(),w(!0)}catch{L(x("chatInput.micBlocked"))}}}function se(){var ce;S&&(Q.current="cancel",(ce=V.current)==null||ce.stop(),U.current=[])}function ee(){var ce;S&&(Q.current="confirm",(ce=V.current)==null||ce.stop())}const ne=S||M,Ae=D.length>0,_e=u.length>0,ze=!n&&!ne&&!Ae&&(t.trim().length>0||_e);return p.jsxs("div",{className:`composer-shell${n?" is-loading":""}`,ref:K,children:[p.jsx("input",{ref:Y,type:"file",multiple:!0,accept:LG,style:{display:"none"},onChange:ce=>{const ve=Array.from(ce.target.files??[]);ce.target.value="",X(ve)}}),p.jsxs("div",{className:"composer-input-area",children:[(_e||Ae)&&!S?p.jsxs("div",{className:"composer-attachments",children:[u.map(ce=>p.jsxs("div",{className:"composer-attachment-chip",title:ce.name,children:[ce.kind==="image"?p.jsx("img",{className:"composer-attachment-thumb",src:ce.url,alt:""}):p.jsx("span",{className:"composer-attachment-icon","aria-hidden":"true",children:p.jsx(fb,{size:14})}),p.jsx("span",{className:"composer-attachment-name",children:ce.name??(ce.kind==="pdf"?"document.pdf":"image")}),p.jsx("button",{type:"button",className:"composer-attachment-remove",onClick:()=>z(ce.id),"aria-label":x("chatInput.removeAttachment"),children:p.jsx(bs,{size:12})})]},ce.id)),D.map((ce,ve)=>p.jsxs("div",{className:"composer-attachment-chip is-uploading",title:ce,children:[p.jsx("span",{className:"composer-attachment-icon","aria-hidden":"true",children:p.jsx(fk,{size:14,className:"composer-spin"})}),p.jsx("span",{className:"composer-attachment-name",children:ce})]},`uploading-${ve}-${ce}`))]}):null,!S&&p.jsx("textarea",{ref:W,placeholder:x(hw?"demo.placeholder":"chatInput.placeholder"),value:t,onChange:ce=>{r(ce.target.value),le()},onInput:()=>le(),onPaste:ce=>{var oe;const ve=(oe=ce.clipboardData)==null?void 0:oe.items;if(!ve)return;const Oe=[];for(const He of ve){if(He.kind!=="file")continue;const $e=He.getAsFile();$e&&_A($e)&&Oe.push($e)}Oe.length!==0&&(ce.preventDefault(),X(Oe))},onKeyDown:ce=>{ce.key==="Enter"&&!ce.shiftKey&&!ne&&!Ae&&(ce.preventDefault(),i())},rows:1}),S?p.jsxs("div",{className:"composer-input-note composer-input-note-listening",children:[p.jsx("span",{className:"composer-rec-dot","aria-hidden":"true"}),p.jsx("span",{className:"composer-rec-label",children:x("chatInput.listening")}),p.jsx("span",{className:"composer-rec-timer","aria-hidden":"true",children:BG(T)})]}):null,M?p.jsx("div",{className:"composer-input-note",children:x("chatInput.transcribing")}):null,R?p.jsx("div",{className:"composer-input-note composer-input-note-error",children:R}):null,F?p.jsx("div",{className:"composer-input-note composer-input-note-error",children:F}):null]}),p.jsxs("div",{className:"composer-actions",children:[!y&&!S&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"composer-ghost-btn composer-plus-btn",onClick:()=>{var ce;return(ce=Y.current)==null?void 0:ce.click()},disabled:n||Ae,"aria-label":x("chatInput.attachFile"),"data-tooltip":x("chatInput.attachFile"),children:p.jsx(oF,{size:16})}),g&&p.jsx("button",{type:"button",className:`composer-ghost-btn composer-selector-btn${m?" is-active":""}`,onClick:g,"aria-label":x(m?"chatInput.exitSelector":"chatInput.selectElement"),"data-tooltip":x(m?"chatInput.exitSelector":"chatInput.selectElement"),"aria-pressed":m,children:p.jsx(Q9,{size:16})})]}),p.jsx("div",{className:"composer-actions-spacer"}),p.jsx("div",{className:"composer-actions-right",role:"group","aria-label":x("chatInput.voiceActions"),children:!y&&S?p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"composer-ghost-btn composer-cancel-btn",onClick:se,disabled:n||M,"aria-label":x("chatInput.cancelVoice"),children:p.jsx(bs,{size:16})}),p.jsx("button",{type:"button",className:"composer-send-btn",onClick:ee,disabled:n||M,"aria-label":x("chatInput.sendRecorded"),children:p.jsx(Fd,{size:16})})]}):p.jsxs(p.Fragment,{children:[!y&&v&&p.jsx("button",{type:"button",className:"composer-ghost-btn",onClick:()=>void Z(),disabled:n||M,"aria-label":x("chatInput.startVoice"),children:p.jsx(J9,{size:16})}),p.jsxs("button",{type:"button",className:`composer-send-btn${n&&s?" is-stop":""}`,onClick:n&&s?s:()=>i(),disabled:!(n&&s)&&!ze,"aria-label":x(n&&s?"chatInput.stopGeneration":"chatInput.sendMessage"),children:[p.jsx("span",{className:"icon-send",children:p.jsx(GS,{size:16,strokeWidth:2.8})}),p.jsx("span",{className:"icon-stop",children:p.jsx(YS,{size:12,fill:"currentColor"})})]})]})})]})]})}function FG(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const $G=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,UG=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,HG={};function TA(e,t){return(HG.jsx?UG:$G).test(e)}const VG=/[ \t\n\f\r]/g;function qG(e){return typeof e=="object"?e.type==="text"?AA(e.value):!1:AA(e)}function AA(e){return e.replace(VG,"")===""}let fp=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};fp.prototype.normal={};fp.prototype.property={};fp.prototype.space=void 0;function Oj(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new fp(n,r,t)}function Ak(e){return e.toLowerCase()}class Ki{constructor(t,n){this.attribute=n,this.property=t}}Ki.prototype.attribute="";Ki.prototype.booleanish=!1;Ki.prototype.boolean=!1;Ki.prototype.commaOrSpaceSeparated=!1;Ki.prototype.commaSeparated=!1;Ki.prototype.defined=!1;Ki.prototype.mustUseProperty=!1;Ki.prototype.number=!1;Ki.prototype.overloadedBoolean=!1;Ki.prototype.property="";Ki.prototype.spaceSeparated=!1;Ki.prototype.space=void 0;let KG=0;const At=rc(),Sr=rc(),Nk=rc(),Ie=rc(),In=rc(),fd=rc(),ds=rc();function rc(){return 2**++KG}const Mk=Object.freeze(Object.defineProperty({__proto__:null,boolean:At,booleanish:Sr,commaOrSpaceSeparated:ds,commaSeparated:fd,number:Ie,overloadedBoolean:Nk,spaceSeparated:In},Symbol.toStringTag,{value:"Module"})),kx=Object.keys(Mk);class mw extends Ki{constructor(t,n,r,i){let s=-1;if(super(t,n),NA(this,"space",i),typeof r=="number")for(;++s<kx.length;){const o=kx[s];NA(this,kx[s],(r&Mk[o])===Mk[o])}}}mw.prototype.defined=!0;function NA(e,t,n){n&&(e[t]=n)}function Ud(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new mw(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Ak(r)]=r,n[Ak(s.attribute)]=r}return new fp(t,n,e.space)}const Pj=Ud({properties:{ariaActiveDescendant:null,ariaAtomic:Sr,ariaAutoComplete:null,ariaBusy:Sr,ariaChecked:Sr,ariaColCount:Ie,ariaColIndex:Ie,ariaColSpan:Ie,ariaControls:In,ariaCurrent:null,ariaDescribedBy:In,ariaDetails:null,ariaDisabled:Sr,ariaDropEffect:In,ariaErrorMessage:null,ariaExpanded:Sr,ariaFlowTo:In,ariaGrabbed:Sr,ariaHasPopup:null,ariaHidden:Sr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:In,ariaLevel:Ie,ariaLive:null,ariaModal:Sr,ariaMultiLine:Sr,ariaMultiSelectable:Sr,ariaOrientation:null,ariaOwns:In,ariaPlaceholder:null,ariaPosInSet:Ie,ariaPressed:Sr,ariaReadOnly:Sr,ariaRelevant:null,ariaRequired:Sr,ariaRoleDescription:In,ariaRowCount:Ie,ariaRowIndex:Ie,ariaRowSpan:Ie,ariaSelected:Sr,ariaSetSize:Ie,ariaSort:null,ariaValueMax:Ie,ariaValueMin:Ie,ariaValueNow:Ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function zj(e,t){return t in e?e[t]:t}function Lj(e,t){return zj(e,t.toLowerCase())}const GG=Ud({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fd,acceptCharset:In,accessKey:In,action:null,allow:null,allowFullScreen:At,allowPaymentRequest:At,allowUserMedia:At,alt:null,as:null,async:At,autoCapitalize:null,autoComplete:In,autoFocus:At,autoPlay:At,blocking:In,capture:null,charSet:null,checked:At,cite:null,className:In,cols:Ie,colSpan:null,content:null,contentEditable:Sr,controls:At,controlsList:In,coords:Ie|fd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:At,defer:At,dir:null,dirName:null,disabled:At,download:Nk,draggable:Sr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:At,formTarget:null,headers:In,height:Ie,hidden:Nk,high:Ie,href:null,hrefLang:null,htmlFor:In,httpEquiv:In,id:null,imageSizes:null,imageSrcSet:null,inert:At,inputMode:null,integrity:null,is:null,isMap:At,itemId:null,itemProp:In,itemRef:In,itemScope:At,itemType:In,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:At,low:Ie,manifest:null,max:null,maxLength:Ie,media:null,method:null,min:null,minLength:Ie,multiple:At,muted:At,name:null,nonce:null,noModule:At,noValidate:At,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:At,optimum:Ie,pattern:null,ping:In,placeholder:null,playsInline:At,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:At,referrerPolicy:null,rel:In,required:At,reversed:At,rows:Ie,rowSpan:Ie,sandbox:In,scope:null,scoped:At,seamless:At,selected:At,shadowRootClonable:At,shadowRootDelegatesFocus:At,shadowRootMode:null,shape:null,size:Ie,sizes:null,slot:null,span:Ie,spellCheck:Sr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ie,step:null,style:null,tabIndex:Ie,target:null,title:null,translate:null,type:null,typeMustMatch:At,useMap:null,value:Sr,width:Ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:In,axis:null,background:null,bgColor:null,border:Ie,borderColor:null,bottomMargin:Ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:At,declare:At,event:null,face:null,frame:null,frameBorder:null,hSpace:Ie,leftMargin:Ie,link:null,longDesc:null,lowSrc:null,marginHeight:Ie,marginWidth:Ie,noResize:At,noHref:At,noShade:At,noWrap:At,object:null,profile:null,prompt:null,rev:null,rightMargin:Ie,rules:null,scheme:null,scrolling:Sr,standby:null,summary:null,text:null,topMargin:Ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ie,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:At,disableRemotePlayback:At,prefix:null,property:null,results:Ie,security:null,unselectable:null},space:"html",transform:Lj}),WG=Ud({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:ds,accentHeight:Ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ie,amplitude:Ie,arabicForm:null,ascent:Ie,attributeName:null,attributeType:null,azimuth:Ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ie,by:null,calcMode:null,capHeight:Ie,className:In,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:Ie,diffuseConstant:Ie,direction:null,display:null,dur:null,divisor:Ie,dominantBaseline:null,download:At,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ie,enableBackground:null,end:null,event:null,exponent:Ie,externalResourcesRequired:null,fill:null,fillOpacity:Ie,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:fd,g2:fd,glyphName:fd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ie,horizOriginX:Ie,horizOriginY:Ie,id:null,ideographic:Ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ie,k:Ie,k1:Ie,k2:Ie,k3:Ie,k4:Ie,kernelMatrix:ds,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ie,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:Ie,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:Ie,overlineThickness:Ie,paintOrder:null,panose1:null,path:null,pathLength:Ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:In,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ie,pointsAtY:Ie,pointsAtZ:Ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ds,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ds,rev:ds,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ds,requiredFeatures:ds,requiredFonts:ds,requiredFormats:ds,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:Ie,specularExponent:Ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ie,strikethroughThickness:Ie,string:null,stroke:null,strokeDashArray:ds,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ie,strokeOpacity:Ie,strokeWidth:null,style:null,surfaceScale:Ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ds,tabIndex:Ie,tableValues:null,target:null,targetX:Ie,targetY:Ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ds,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ie,underlineThickness:Ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ie,values:null,vAlphabetic:Ie,vMathematical:Ie,vectorEffect:null,vHanging:Ie,vIdeographic:Ie,version:null,vertAdvY:Ie,vertOriginX:Ie,vertOriginY:Ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zj}),Bj=Ud({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Fj=Ud({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Lj}),$j=Ud({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ZG={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"},YG=/[A-Z]/g,MA=/-[a-z]/g,JG=/^data[-\w.:]+$/i;function XG(e,t){const n=Ak(t);let r=t,i=Ki;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&JG.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(MA,eW);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!MA.test(s)){let o=s.replace(YG,QG);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=mw}return new i(r,t)}function QG(e){return"-"+e.toLowerCase()}function eW(e){return e.charAt(1).toUpperCase()}const tW=Oj([Pj,GG,Bj,Fj,$j],"html"),gw=Oj([Pj,WG,Bj,Fj,$j],"svg");function nW(e){return e.join(" ").trim()}var Vc={},Sx,DA;function rW(){if(DA)return Sx;DA=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
451
489
  `,d="/",f="*",m="",g="comment",y="declaration";function x(S,w){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];w=w||{};var T=1,A=1;function M(Y){var V=Y.match(t);V&&(T+=V.length);var O=Y.lastIndexOf(u);A=~O?Y.length-O:A+Y.length}function j(){var Y={line:T,column:A};return function(V){return V.position=new D(Y),L(),V}}function D(Y){this.start=Y,this.end={line:T,column:A},this.source=w.source}D.prototype.content=S;function P(Y){var V=new Error(w.source+":"+T+":"+A+": "+Y);if(V.reason=Y,V.filename=w.source,V.line=T,V.column=A,V.source=S,!w.silent)throw V}function R(Y){var V=Y.exec(S);if(V){var O=V[0];return M(O),S=S.slice(O.length),V}}function L(){R(n)}function F(Y){var V;for(Y=Y||[];V=q();)V!==!1&&Y.push(V);return Y}function q(){var Y=j();if(!(d!=S.charAt(0)||f!=S.charAt(1))){for(var V=2;m!=S.charAt(V)&&(f!=S.charAt(V)||d!=S.charAt(V+1));)++V;if(V+=2,m===S.charAt(V-1))return P("End of comment missing");var O=S.slice(2,V-2);return A+=2,M(O),S=S.slice(V),A+=2,Y({type:g,comment:O})}}function W(){var Y=j(),V=R(r);if(V){if(q(),!R(i))return P("property missing ':'");var O=R(s),U=Y({type:y,property:v(V[0].replace(e,m)),value:O?v(O[0].replace(e,m)):m});return R(o),U}}function K(){var Y=[];F(Y);for(var V;V=W();)V!==!1&&(Y.push(V),F(Y));return Y}return L(),K()}function v(S){return S?S.replace(a,m):m}return Sx=x,Sx}var RA;function iW(){if(RA)return Vc;RA=1;var e=Vc&&Vc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.default=n;const t=e(rW());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const o=(0,t.default)(r),a=typeof i=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:f}=u;a?i(d,f,u):f&&(s=s||{},s[d]=f)}),s}return Vc}var Hf={},jA;function sW(){if(jA)return Hf;jA=1,Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(d){return!d||n.test(d)||e.test(d)},o=function(d,f){return f.toUpperCase()},a=function(d,f){return"".concat(f,"-")},u=function(d,f){return f===void 0&&(f={}),s(d)?d:(d=d.toLowerCase(),f.reactCompat?d=d.replace(i,a):d=d.replace(r,a),d.replace(t,o))};return Hf.camelCase=u,Hf}var Vf,IA;function oW(){if(IA)return Vf;IA=1;var e=Vf&&Vf.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(iW()),n=sW();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(a,u){a&&u&&(o[(0,n.camelCase)(a,s)]=u)}),o}return r.default=r,Vf=r,Vf}var aW=oW();const lW=Bd(aW),Uj=Hj("end"),bw=Hj("start");function Hj(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function uW(e){const t=bw(e),n=Uj(e);if(t&&n)return{start:t,end:n}}function fh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?OA(e.position):"start"in e||"end"in e?OA(e):"line"in e||"column"in e?Dk(e):""}function Dk(e){return PA(e&&e.line)+":"+PA(e&&e.column)}function OA(e){return Dk(e&&e.start)+"-"+Dk(e&&e.end)}function PA(e){return e&&typeof e=="number"?e:1}class pi extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=fh(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}pi.prototype.file="";pi.prototype.name="";pi.prototype.reason="";pi.prototype.message="";pi.prototype.stack="";pi.prototype.column=void 0;pi.prototype.line=void 0;pi.prototype.ancestors=void 0;pi.prototype.cause=void 0;pi.prototype.fatal=void 0;pi.prototype.place=void 0;pi.prototype.ruleId=void 0;pi.prototype.source=void 0;const yw={}.hasOwnProperty,cW=new Map,dW=/[A-Z]/g,fW=new Set(["table","tbody","thead","tfoot","tr"]),hW=new Set(["td","th"]),Vj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pW(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=SW(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=kW(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?gw:tW,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=qj(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function qj(e,t,n){if(t.type==="element")return mW(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return gW(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return yW(e,t,n);if(t.type==="mdxjsEsm")return bW(e,t);if(t.type==="root")return xW(e,t,n);if(t.type==="text")return vW(e,t)}function mW(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=gw,e.schema=i),e.ancestors.push(t);const s=Gj(e,t.tagName,!1),o=wW(e,t);let a=vw(e,t);return fW.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!qG(u):!0})),Kj(e,o,s,t),xw(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function gW(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Fh(e,t.position)}function bW(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Fh(e,t.position)}function yW(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=gw,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Gj(e,t.name,!0),o=CW(e,t),a=vw(e,t);return Kj(e,o,s,t),xw(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function xW(e,t,n){const r={};return xw(r,vw(e,t)),e.create(t,e.Fragment,r,n)}function vW(e,t){return t.value}function Kj(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function xw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function kW(e,t,n){return r;function r(i,s,o,a){const d=Array.isArray(o.children)?n:t;return a?d(s,o,a):d(s,o)}}function SW(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),u=bw(r);return t(i,s,o,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function wW(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&yw.call(t.properties,i)){const s=EW(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&hW.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function CW(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Fh(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else Fh(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function vw(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:cW;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const d=i.get(u)||0;o=u+"-"+d,i.set(u,d+1)}}const a=qj(e,s,o);a!==void 0&&n.push(a)}return n}function EW(e,t,n){const r=XG(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?FG(n):nW(n)),r.property==="style"){let i=typeof n=="object"?n:_W(e,String(n));return e.stylePropertyNameCase==="css"&&(i=TW(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?ZG[r.property]||r.property:r.attribute,n]}}function _W(e,t){try{return lW(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new pi("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Vj+"#cannot-parse-style-attribute",i}}function Gj(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=TA(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=TA(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return yw.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Fh(e)}function Fh(e,t){const n=new pi("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Vj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function TW(e){const t={};let n;for(n in e)yw.call(e,n)&&(t[AW(n)]=e[n]);return t}function AW(e){let t=e.replace(dW,NW);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function NW(e){return"-"+e.toLowerCase()}const wx={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},MW={};function kw(e,t){const n=MW,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Wj(e,r,i)}function Wj(e,t,n){if(DW(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return zA(e.children,t,n)}return Array.isArray(e)?zA(e,t,n):""}function zA(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Wj(e[i],t,n);return r.join("")}function DW(e){return!!(e&&typeof e=="object")}const LA=document.createElement("i");function Sw(e){const t="&"+e+";";LA.innerHTML=t;const n=LA.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ps(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function Fs(e,t){return e.length>0?(ps(e,e.length,0,t),e):t}const BA={}.hasOwnProperty;function Zj(e){const t={};let n=-1;for(;++n<e.length;)RW(t,e[n]);return t}function RW(e,t){let n;for(n in t){const i=(BA.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){BA.call(i,o)||(i[o]=[]);const a=s[o];jW(i[o],Array.isArray(a)?a:a?[a]:[])}}}function jW(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ps(e,0,0,r)}function Yj(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function uo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ci=Gl(/[A-Za-z]/),di=Gl(/[\dA-Za-z]/),IW=Gl(/[#-'*+\--9=?A-Z^-~]/);function Yg(e){return e!==null&&(e<32||e===127)}const Rk=Gl(/\d/),OW=Gl(/[\dA-Fa-f]/),PW=Gl(/[!-/:-@[-`{-~]/);function pt(e){return e!==null&&e<-2}function jn(e){return e!==null&&(e<0||e===32)}function Ht(e){return e===-2||e===-1||e===32}const xb=Gl(new RegExp("\\p{P}|\\p{S}","u")),Hu=Gl(/\s/);function Gl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Hd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&di(e.charCodeAt(n+1))&&di(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function en(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(u){return Ht(u)?(e.enter(n),a(u)):t(u)}function a(u){return Ht(u)&&s++<i?(e.consume(u),a):(e.exit(n),t(u))}}const zW={tokenize:LW};function LW(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),en(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return pt(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const BW={tokenize:FW},FA={tokenize:$W};function FW(e){const t=this,n=[];let r=0,i,s,o;return a;function a(A){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,u,d)(A)}return d(A)}function u(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&T();const M=t.events.length;let j=M,D;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){D=t.events[j][1].end;break}w(r);let P=M;for(;P<t.events.length;)t.events[P][1].end={...D},P++;return ps(t.events,j+1,0,t.events.slice(M)),t.events.length=P,d(A)}return a(A)}function d(A){if(r===n.length){if(!i)return g(A);if(i.currentConstruct&&i.currentConstruct.concrete)return x(A);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(FA,f,m)(A)}function f(A){return i&&T(),w(r),g(A)}function m(A){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,x(A)}function g(A){return t.containerState={},e.attempt(FA,y,x)(A)}function y(A){return r++,n.push([t.currentConstruct,t.containerState]),g(A)}function x(A){if(A===null){i&&T(),w(0),e.consume(A);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),v(A)}function v(A){if(A===null){S(e.exit("chunkFlow"),!0),w(0),e.consume(A);return}return pt(A)?(e.consume(A),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(A),v)}function S(A,M){const j=t.sliceStream(A);if(M&&j.push(null),A.previous=s,s&&(s.next=A),s=A,i.defineSkip(A.start),i.write(j),t.parser.lazy[A.start.line]){let D=i.events.length;for(;D--;)if(i.events[D][1].start.offset<o&&(!i.events[D][1].end||i.events[D][1].end.offset>o))return;const P=t.events.length;let R=P,L,F;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(L){F=t.events[R][1].end;break}L=!0}for(w(r),D=P;D<t.events.length;)t.events[D][1].end={...F},D++;ps(t.events,R+1,0,t.events.slice(P)),t.events.length=D}}function w(A){let M=n.length;for(;M-- >A;){const j=n[M];t.containerState=j[1],j[0].exit.call(t,e)}n.length=A}function T(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function $W(e,t,n){return en(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wd(e){if(e===null||jn(e)||Hu(e))return 1;if(xb(e))return 2}function vb(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const jk={name:"attention",resolveAll:UW,tokenize:HW};function UW(e,t){let n=-1,r,i,s,o,a,u,d,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},g={...e[n][1].start};$A(m,-u),$A(g,u),o={type:u>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},s={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Fs(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Fs(d,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),d=Fs(d,vb(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Fs(d,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,d=Fs(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,ps(e,r-1,n-r+3,d),n=r+d.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function HW(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=wd(r);let s;return o;function o(u){return s=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===s)return e.consume(u),a;const d=e.exit("attentionSequence"),f=wd(u),m=!f||f===2&&i||n.includes(u),g=!i||i===2&&f||n.includes(r);return d._open=!!(s===42?m:m&&(i||!g)),d._close=!!(s===42?g:g&&(f||!m)),t(u)}}function $A(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const VW={name:"autolink",tokenize:qW};function qW(e,t,n){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(y){return Ci(y)?(e.consume(y),o):y===64?n(y):d(y)}function o(y){return y===43||y===45||y===46||di(y)?(r=1,a(y)):d(y)}function a(y){return y===58?(e.consume(y),r=0,u):(y===43||y===45||y===46||di(y))&&r++<32?(e.consume(y),a):(r=0,d(y))}function u(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||Yg(y)?n(y):(e.consume(y),u)}function d(y){return y===64?(e.consume(y),f):IW(y)?(e.consume(y),d):n(y)}function f(y){return di(y)?m(y):n(y)}function m(y){return y===46?(e.consume(y),r=0,f):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):g(y)}function g(y){if((y===45||di(y))&&r++<63){const x=y===45?g:m;return e.consume(y),x}return n(y)}}const hp={partial:!0,tokenize:KW};function KW(e,t,n){return r;function r(s){return Ht(s)?en(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||pt(s)?t(s):n(s)}}const Jj={continuation:{tokenize:WW},exit:ZW,name:"blockQuote",tokenize:GW};function GW(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return Ht(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function WW(e,t,n){const r=this;return i;function i(o){return Ht(o)?en(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(Jj,t,n)(o)}}function ZW(e){e.exit("blockQuote")}const Xj={name:"characterEscape",tokenize:YW};function YW(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return PW(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Qj={name:"characterReference",tokenize:JW};function JW(e,t,n){const r=this;let i=0,s,o;return a;function a(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),u}function u(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),s=31,o=di,f(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=OW,f):(e.enter("characterReferenceValue"),s=7,o=Rk,f(m))}function f(m){if(m===59&&i){const g=e.exit("characterReferenceValue");return o===di&&!Sw(r.sliceSerialize(g))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(m)&&i++<s?(e.consume(m),f):n(m)}}const UA={partial:!0,tokenize:QW},HA={concrete:!0,name:"codeFenced",tokenize:XW};function XW(e,t,n){const r=this,i={partial:!0,tokenize:j};let s=0,o=0,a;return u;function u(D){return d(D)}function d(D){const P=r.events[r.events.length-1];return s=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,a=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(D)}function f(D){return D===a?(o++,e.consume(D),f):o<3?n(D):(e.exit("codeFencedFenceSequence"),Ht(D)?en(e,m,"whitespace")(D):m(D))}function m(D){return D===null||pt(D)?(e.exit("codeFencedFence"),r.interrupt?t(D):e.check(UA,v,M)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(D))}function g(D){return D===null||pt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(D)):Ht(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),en(e,y,"whitespace")(D)):D===96&&D===a?n(D):(e.consume(D),g)}function y(D){return D===null||pt(D)?m(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(D))}function x(D){return D===null||pt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(D)):D===96&&D===a?n(D):(e.consume(D),x)}function v(D){return e.attempt(i,M,S)(D)}function S(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),w}function w(D){return s>0&&Ht(D)?en(e,T,"linePrefix",s+1)(D):T(D)}function T(D){return D===null||pt(D)?e.check(UA,v,M)(D):(e.enter("codeFlowValue"),A(D))}function A(D){return D===null||pt(D)?(e.exit("codeFlowValue"),T(D)):(e.consume(D),A)}function M(D){return e.exit("codeFenced"),t(D)}function j(D,P,R){let L=0;return F;function F(V){return D.enter("lineEnding"),D.consume(V),D.exit("lineEnding"),q}function q(V){return D.enter("codeFencedFence"),Ht(V)?en(D,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):W(V)}function W(V){return V===a?(D.enter("codeFencedFenceSequence"),K(V)):R(V)}function K(V){return V===a?(L++,D.consume(V),K):L>=o?(D.exit("codeFencedFenceSequence"),Ht(V)?en(D,Y,"whitespace")(V):Y(V)):R(V)}function Y(V){return V===null||pt(V)?(D.exit("codeFencedFence"),P(V)):R(V)}}}function QW(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Cx={name:"codeIndented",tokenize:tZ},eZ={partial:!0,tokenize:nZ};function tZ(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),en(e,s,"linePrefix",5)(d)}function s(d){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?u(d):pt(d)?e.attempt(eZ,o,u)(d):(e.enter("codeFlowValue"),a(d))}function a(d){return d===null||pt(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),a)}function u(d){return e.exit("codeIndented"),t(d)}}function nZ(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):pt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):en(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):pt(o)?i(o):n(o)}}const rZ={name:"codeText",previous:sZ,resolve:iZ,tokenize:oZ};function iZ(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function sZ(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function oZ(e,t,n){let r=0,i,s;return o;function o(m){return e.enter("codeText"),e.enter("codeTextSequence"),a(m)}function a(m){return m===96?(e.consume(m),r++,a):(e.exit("codeTextSequence"),u(m))}function u(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),u):m===96?(s=e.enter("codeTextSequence"),i=0,f(m)):pt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||pt(m)?(e.exit("codeTextData"),u(m)):(e.consume(m),d)}function f(m){return m===96?(e.consume(m),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(s.type="codeTextData",d(m))}}class aZ{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&qf(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),qf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);qf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qf(this.left,n.reverse())}}}function qf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function e4(e){const t={};let n=-1,r,i,s,o,a,u,d;const f=new aZ(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,lZ(f,n)),n=t[n],d=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=f.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return ps(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!d}function lZ(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,u=[],d={};let f,m,g=-1,y=n,x=0,v=0;const S=[v];for(;y;){for(;e.get(++i)[1]!==y;);s.push(i),y._tokenizer||(f=r.sliceStream(y),y.next||f.push(null),m&&o.defineSkip(y.start),y._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(f),y._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=y,y=y.next}for(y=n;++g<a.length;)a[g][0]==="exit"&&a[g-1][0]==="enter"&&a[g][1].type===a[g-1][1].type&&a[g][1].start.line!==a[g][1].end.line&&(v=g+1,S.push(v),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(o.events=[],y?(y._tokenizer=void 0,y.previous=void 0):S.pop(),g=S.length;g--;){const w=a.slice(S[g],S[g+1]),T=s.pop();u.push([T,T+w.length-1]),e.splice(T,2,w)}for(u.reverse(),g=-1;++g<u.length;)d[x+u[g][0]]=x+u[g][1],x+=u[g][1]-u[g][0]-1;return d}const uZ={resolve:dZ,tokenize:fZ},cZ={partial:!0,tokenize:hZ};function dZ(e){return e4(e),e}function fZ(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):pt(a)?e.check(cZ,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function hZ(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),en(e,s,"linePrefix")}function s(o){if(o===null||pt(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function t4(e,t,n,r,i,s,o,a,u){const d=u||Number.POSITIVE_INFINITY;let f=0;return m;function m(w){return w===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(w),e.exit(s),g):w===null||w===32||w===41||Yg(w)?n(w):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),v(w))}function g(w){return w===62?(e.enter(s),e.consume(w),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),y(w))}function y(w){return w===62?(e.exit("chunkString"),e.exit(a),g(w)):w===null||w===60||pt(w)?n(w):(e.consume(w),w===92?x:y)}function x(w){return w===60||w===62||w===92?(e.consume(w),y):y(w)}function v(w){return!f&&(w===null||w===41||jn(w))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(w)):f<d&&w===40?(e.consume(w),f++,v):w===41?(e.consume(w),f--,v):w===null||w===32||w===40||Yg(w)?n(w):(e.consume(w),w===92?S:v)}function S(w){return w===40||w===41||w===92?(e.consume(w),v):v(w)}}function n4(e,t,n,r,i,s){const o=this;let a=0,u;return d;function d(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(s),f}function f(y){return a>999||y===null||y===91||y===93&&!u||y===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(y):y===93?(e.exit(s),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):pt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===null||y===91||y===93||pt(y)||a++>999?(e.exit("chunkString"),f(y)):(e.consume(y),u||(u=!Ht(y)),y===92?g:m)}function g(y){return y===91||y===92||y===93?(e.consume(y),a++,m):m(y)}}function r4(e,t,n,r,i,s){let o;return a;function a(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),o=g===40?41:g,u):n(g)}function u(g){return g===o?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(s),d(g))}function d(g){return g===o?(e.exit(s),u(o)):g===null?n(g):pt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),en(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===o||g===null||pt(g)?(e.exit("chunkString"),d(g)):(e.consume(g),g===92?m:f)}function m(g){return g===o||g===92?(e.consume(g),f):f(g)}}function hh(e,t){let n;return r;function r(i){return pt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ht(i)?en(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const pZ={name:"definition",tokenize:gZ},mZ={partial:!0,tokenize:bZ};function gZ(e,t,n){const r=this;let i;return s;function s(y){return e.enter("definition"),o(y)}function o(y){return n4.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function a(y){return i=uo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),u):n(y)}function u(y){return jn(y)?hh(e,d)(y):d(y)}function d(y){return t4(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function f(y){return e.attempt(mZ,m,m)(y)}function m(y){return Ht(y)?en(e,g,"whitespace")(y):g(y)}function g(y){return y===null||pt(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function bZ(e,t,n){return r;function r(a){return jn(a)?hh(e,i)(a):n(a)}function i(a){return r4(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return Ht(a)?en(e,o,"whitespace")(a):o(a)}function o(a){return a===null||pt(a)?t(a):n(a)}}const yZ={name:"hardBreakEscape",tokenize:xZ};function xZ(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return pt(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const vZ={name:"headingAtx",resolve:kZ,tokenize:SZ};function kZ(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ps(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function SZ(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),s(f)}function s(f){return e.enter("atxHeadingSequence"),o(f)}function o(f){return f===35&&r++<6?(e.consume(f),o):f===null||jn(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||pt(f)?(e.exit("atxHeading"),t(f)):Ht(f)?en(e,a,"whitespace")(f):(e.enter("atxHeadingText"),d(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function d(f){return f===null||f===35||jn(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),d)}}const wZ=["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"],VA=["pre","script","style","textarea"],CZ={concrete:!0,name:"htmlFlow",resolveTo:TZ,tokenize:AZ},EZ={partial:!0,tokenize:MZ},_Z={partial:!0,tokenize:NZ};function TZ(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function AZ(e,t,n){const r=this;let i,s,o,a,u;return d;function d(z){return f(z)}function f(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),m}function m(z){return z===33?(e.consume(z),g):z===47?(e.consume(z),s=!0,v):z===63?(e.consume(z),i=3,r.interrupt?t:I):Ci(z)?(e.consume(z),o=String.fromCharCode(z),S):n(z)}function g(z){return z===45?(e.consume(z),i=2,y):z===91?(e.consume(z),i=5,a=0,x):Ci(z)?(e.consume(z),i=4,r.interrupt?t:I):n(z)}function y(z){return z===45?(e.consume(z),r.interrupt?t:I):n(z)}function x(z){const Z="CDATA[";return z===Z.charCodeAt(a++)?(e.consume(z),a===Z.length?r.interrupt?t:W:x):n(z)}function v(z){return Ci(z)?(e.consume(z),o=String.fromCharCode(z),S):n(z)}function S(z){if(z===null||z===47||z===62||jn(z)){const Z=z===47,se=o.toLowerCase();return!Z&&!s&&VA.includes(se)?(i=1,r.interrupt?t(z):W(z)):wZ.includes(o.toLowerCase())?(i=6,Z?(e.consume(z),w):r.interrupt?t(z):W(z)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(z):s?T(z):A(z))}return z===45||di(z)?(e.consume(z),o+=String.fromCharCode(z),S):n(z)}function w(z){return z===62?(e.consume(z),r.interrupt?t:W):n(z)}function T(z){return Ht(z)?(e.consume(z),T):F(z)}function A(z){return z===47?(e.consume(z),F):z===58||z===95||Ci(z)?(e.consume(z),M):Ht(z)?(e.consume(z),A):F(z)}function M(z){return z===45||z===46||z===58||z===95||di(z)?(e.consume(z),M):j(z)}function j(z){return z===61?(e.consume(z),D):Ht(z)?(e.consume(z),j):A(z)}function D(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),u=z,P):Ht(z)?(e.consume(z),D):R(z)}function P(z){return z===u?(e.consume(z),u=null,L):z===null||pt(z)?n(z):(e.consume(z),P)}function R(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||jn(z)?j(z):(e.consume(z),R)}function L(z){return z===47||z===62||Ht(z)?A(z):n(z)}function F(z){return z===62?(e.consume(z),q):n(z)}function q(z){return z===null||pt(z)?W(z):Ht(z)?(e.consume(z),q):n(z)}function W(z){return z===45&&i===2?(e.consume(z),O):z===60&&i===1?(e.consume(z),U):z===62&&i===4?(e.consume(z),$):z===63&&i===3?(e.consume(z),I):z===93&&i===5?(e.consume(z),le):pt(z)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(EZ,X,K)(z)):z===null||pt(z)?(e.exit("htmlFlowData"),K(z)):(e.consume(z),W)}function K(z){return e.check(_Z,Y,X)(z)}function Y(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),V}function V(z){return z===null||pt(z)?K(z):(e.enter("htmlFlowData"),W(z))}function O(z){return z===45?(e.consume(z),I):W(z)}function U(z){return z===47?(e.consume(z),o="",Q):W(z)}function Q(z){if(z===62){const Z=o.toLowerCase();return VA.includes(Z)?(e.consume(z),$):W(z)}return Ci(z)&&o.length<8?(e.consume(z),o+=String.fromCharCode(z),Q):W(z)}function le(z){return z===93?(e.consume(z),I):W(z)}function I(z){return z===62?(e.consume(z),$):z===45&&i===2?(e.consume(z),I):W(z)}function $(z){return z===null||pt(z)?(e.exit("htmlFlowData"),X(z)):(e.consume(z),$)}function X(z){return e.exit("htmlFlow"),t(z)}}function NZ(e,t,n){const r=this;return i;function i(o){return pt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function MZ(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(hp,t,n)}}const DZ={name:"htmlText",tokenize:RZ};function RZ(e,t,n){const r=this;let i,s,o;return a;function a(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),u}function u(I){return I===33?(e.consume(I),d):I===47?(e.consume(I),j):I===63?(e.consume(I),A):Ci(I)?(e.consume(I),R):n(I)}function d(I){return I===45?(e.consume(I),f):I===91?(e.consume(I),s=0,x):Ci(I)?(e.consume(I),T):n(I)}function f(I){return I===45?(e.consume(I),y):n(I)}function m(I){return I===null?n(I):I===45?(e.consume(I),g):pt(I)?(o=m,U(I)):(e.consume(I),m)}function g(I){return I===45?(e.consume(I),y):m(I)}function y(I){return I===62?O(I):I===45?g(I):m(I)}function x(I){const $="CDATA[";return I===$.charCodeAt(s++)?(e.consume(I),s===$.length?v:x):n(I)}function v(I){return I===null?n(I):I===93?(e.consume(I),S):pt(I)?(o=v,U(I)):(e.consume(I),v)}function S(I){return I===93?(e.consume(I),w):v(I)}function w(I){return I===62?O(I):I===93?(e.consume(I),w):v(I)}function T(I){return I===null||I===62?O(I):pt(I)?(o=T,U(I)):(e.consume(I),T)}function A(I){return I===null?n(I):I===63?(e.consume(I),M):pt(I)?(o=A,U(I)):(e.consume(I),A)}function M(I){return I===62?O(I):A(I)}function j(I){return Ci(I)?(e.consume(I),D):n(I)}function D(I){return I===45||di(I)?(e.consume(I),D):P(I)}function P(I){return pt(I)?(o=P,U(I)):Ht(I)?(e.consume(I),P):O(I)}function R(I){return I===45||di(I)?(e.consume(I),R):I===47||I===62||jn(I)?L(I):n(I)}function L(I){return I===47?(e.consume(I),O):I===58||I===95||Ci(I)?(e.consume(I),F):pt(I)?(o=L,U(I)):Ht(I)?(e.consume(I),L):O(I)}function F(I){return I===45||I===46||I===58||I===95||di(I)?(e.consume(I),F):q(I)}function q(I){return I===61?(e.consume(I),W):pt(I)?(o=q,U(I)):Ht(I)?(e.consume(I),q):L(I)}function W(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),i=I,K):pt(I)?(o=W,U(I)):Ht(I)?(e.consume(I),W):(e.consume(I),Y)}function K(I){return I===i?(e.consume(I),i=void 0,V):I===null?n(I):pt(I)?(o=K,U(I)):(e.consume(I),K)}function Y(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||jn(I)?L(I):(e.consume(I),Y)}function V(I){return I===47||I===62||jn(I)?L(I):n(I)}function O(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function U(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),Q}function Q(I){return Ht(I)?en(e,le,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):le(I)}function le(I){return e.enter("htmlTextData"),o(I)}}const ww={name:"labelEnd",resolveAll:PZ,resolveTo:zZ,tokenize:LZ},jZ={tokenize:BZ},IZ={tokenize:FZ},OZ={tokenize:$Z};function PZ(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ps(e,0,e.length,n),e}function zZ(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const u={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},f={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",u,t],["enter",d,t]],a=Fs(a,e.slice(s+1,s+r+3)),a=Fs(a,[["enter",f,t]]),a=Fs(a,vb(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=Fs(a,[["exit",f,t],e[o-2],e[o-1],["exit",d,t]]),a=Fs(a,e.slice(o+1)),a=Fs(a,[["exit",u,t]]),ps(e,s,e.length,a),e}function LZ(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(g){return s?s._inactive?m(g):(o=r.parser.defined.includes(uo(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),u):n(g)}function u(g){return g===40?e.attempt(jZ,f,o?f:m)(g):g===91?e.attempt(IZ,f,o?d:m)(g):o?f(g):m(g)}function d(g){return e.attempt(OZ,f,m)(g)}function f(g){return t(g)}function m(g){return s._balanced=!0,n(g)}}function BZ(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),i}function i(m){return jn(m)?hh(e,s)(m):s(m)}function s(m){return m===41?f(m):t4(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return jn(m)?hh(e,u)(m):f(m)}function a(m){return n(m)}function u(m){return m===34||m===39||m===40?r4(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):f(m)}function d(m){return jn(m)?hh(e,f)(m):f(m)}function f(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function FZ(e,t,n){const r=this;return i;function i(a){return n4.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(uo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function $Z(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const UZ={name:"labelStartImage",resolveAll:ww.resolveAll,tokenize:HZ};function HZ(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const VZ={name:"labelStartLink",resolveAll:ww.resolveAll,tokenize:qZ};function qZ(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Ex={name:"lineEnding",tokenize:KZ};function KZ(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),en(e,t,"linePrefix")}}const Dg={name:"thematicBreak",tokenize:GZ};function GZ(e,t,n){let r=0,i;return s;function s(d){return e.enter("thematicBreak"),o(d)}function o(d){return i=d,a(d)}function a(d){return d===i?(e.enter("thematicBreakSequence"),u(d)):r>=3&&(d===null||pt(d))?(e.exit("thematicBreak"),t(d)):n(d)}function u(d){return d===i?(e.consume(d),r++,u):(e.exit("thematicBreakSequence"),Ht(d)?en(e,a,"whitespace")(d):a(d))}}const Li={continuation:{tokenize:JZ},exit:QZ,name:"list",tokenize:YZ},WZ={partial:!0,tokenize:eY},ZZ={partial:!0,tokenize:XZ};function YZ(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(y){const x=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Rk(y)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Dg,n,d)(y):d(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(y)}return n(y)}function u(y){return Rk(y)&&++o<10?(e.consume(y),u):(!r.interrupt||o<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),d(y)):n(y)}function d(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(hp,r.interrupt?n:f,e.attempt(WZ,g,m))}function f(y){return r.containerState.initialBlankLine=!0,s++,g(y)}function m(y){return Ht(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),g):n(y)}function g(y){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function JZ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(hp,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,en(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!Ht(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ZZ,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,en(e,e.attempt(Li,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function XZ(e,t,n){const r=this;return en(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function QZ(e){e.exit(this.containerState.type)}function eY(e,t,n){const r=this;return en(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!Ht(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const qA={name:"setextUnderline",resolveTo:tY,tokenize:nY};function tY(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function nY(e,t,n){const r=this;let i;return s;function s(d){let f=r.events.length,m;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){m=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=d,o(d)):n(d)}function o(d){return e.enter("setextHeadingLineSequence"),a(d)}function a(d){return d===i?(e.consume(d),a):(e.exit("setextHeadingLineSequence"),Ht(d)?en(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||pt(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const rY={tokenize:iY};function iY(e){const t=this,n=e.attempt(hp,r,e.attempt(this.parser.constructs.flowInitial,i,en(e,e.attempt(this.parser.constructs.flow,i,e.attempt(uZ,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const sY={resolveAll:s4()},oY=i4("string"),aY=i4("text");function i4(e){return{resolveAll:s4(e==="text"?lY:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(f){return d(f)?s(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return d(f)?(n.exit("data"),s(f)):(n.consume(f),u)}function d(f){if(f===null)return!0;const m=i[f];let g=-1;if(m)for(;++g<m.length;){const y=m[g];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function s4(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function lY(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,u;for(;s--;){const d=i[s];if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(d===-2)u=!0,a++;else if(d!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const d={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const uY={42:Li,43:Li,45:Li,48:Li,49:Li,50:Li,51:Li,52:Li,53:Li,54:Li,55:Li,56:Li,57:Li,62:Jj},cY={91:pZ},dY={[-2]:Cx,[-1]:Cx,32:Cx},fY={35:vZ,42:Dg,45:[qA,Dg],60:CZ,61:qA,95:Dg,96:HA,126:HA},hY={38:Qj,92:Xj},pY={[-5]:Ex,[-4]:Ex,[-3]:Ex,33:UZ,38:Qj,42:jk,60:[VW,DZ],91:VZ,92:[yZ,Xj],93:ww,95:jk,96:rZ},mY={null:[jk,sY]},gY={null:[42,95]},bY={null:[]},yY=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:gY,contentInitial:cY,disable:bY,document:uY,flow:fY,flowInitial:dY,insideSpan:mY,string:hY,text:pY},Symbol.toStringTag,{value:"Module"}));function xY(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const u={attempt:P(j),check:P(D),consume:T,enter:A,exit:M,interrupt:P(D,{interrupt:!0})},d={code:null,containerState:{},defineSkip:v,events:[],now:x,parser:e,previous:null,sliceSerialize:g,sliceStream:y,write:m};let f=t.tokenize.call(d,u);return t.resolveAll&&s.push(t),d;function m(q){return o=Fs(o,q),S(),o[o.length-1]!==null?[]:(R(t,0),d.events=vb(s,d.events,d),d.events)}function g(q,W){return kY(y(q),W)}function y(q){return vY(o,q)}function x(){const{_bufferIndex:q,_index:W,line:K,column:Y,offset:V}=r;return{_bufferIndex:q,_index:W,line:K,column:Y,offset:V}}function v(q){i[q.line]=q.column,F()}function S(){let q;for(;r._index<o.length;){const W=o[r._index];if(typeof W=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<W.length;)w(W.charCodeAt(r._bufferIndex));else w(W)}}function w(q){f=f(q)}function T(q){pt(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,F()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=q}function A(q,W){const K=W||{};return K.type=q,K.start=x(),d.events.push(["enter",K,d]),a.push(K),K}function M(q){const W=a.pop();return W.end=x(),d.events.push(["exit",W,d]),W}function j(q,W){R(q,W.from)}function D(q,W){W.restore()}function P(q,W){return K;function K(Y,V,O){let U,Q,le,I;return Array.isArray(Y)?X(Y):"tokenize"in Y?X([Y]):$(Y);function $(ee){return ne;function ne(Ae){const _e=Ae!==null&&ee[Ae],ze=Ae!==null&&ee.null,ce=[...Array.isArray(_e)?_e:_e?[_e]:[],...Array.isArray(ze)?ze:ze?[ze]:[]];return X(ce)(Ae)}}function X(ee){return U=ee,Q=0,ee.length===0?O:z(ee[Q])}function z(ee){return ne;function ne(Ae){return I=L(),le=ee,ee.partial||(d.currentConstruct=ee),ee.name&&d.parser.constructs.disable.null.includes(ee.name)?se():ee.tokenize.call(W?Object.assign(Object.create(d),W):d,u,Z,se)(Ae)}}function Z(ee){return q(le,I),V}function se(ee){return I.restore(),++Q<U.length?z(U[Q]):O}}}function R(q,W){q.resolveAll&&!s.includes(q)&&s.push(q),q.resolve&&ps(d.events,W,d.events.length-W,q.resolve(d.events.slice(W),d)),q.resolveTo&&(d.events=q.resolveTo(d.events,d))}function L(){const q=x(),W=d.previous,K=d.currentConstruct,Y=d.events.length,V=Array.from(a);return{from:Y,restore:O};function O(){r=q,d.previous=W,d.currentConstruct=K,d.events.length=Y,a=V,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function vY(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function kY(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
452
490
  `;break}case-3:{o=`\r
453
491
  `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function SY(e){const r={constructs:Zj([yY,...(e||{}).extensions||[]]),content:i(zW),defined:[],document:i(BW),flow:i(rY),lazy:{},string:i(oY),text:i(aY)};return r;function i(s){return o;function o(a){return xY(r,s,a)}}}function wY(e){for(;!e4(e););return e}const KA=/[\0\t\n\r]/g;function CY(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const u=[];let d,f,m,g,y;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),m=0,t="",n&&(s.charCodeAt(0)===65279&&m++,n=void 0);m<s.length;){if(KA.lastIndex=m,d=KA.exec(s),g=d&&d.index!==void 0?d.index:s.length,y=s.charCodeAt(g),!d){t=s.slice(m);break}if(y===10&&m===g&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),m<g&&(u.push(s.slice(m,g)),e+=g-m),y){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}m=g+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const EY=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _Y(e){return e.replace(EY,TY)}function TY(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Yj(n.slice(s?2:1),s?16:10)}return Sw(n)||e}const o4={}.hasOwnProperty;function AY(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),NY(n)(wY(SY(n).document().write(CY()(e,t,!0))))}function NY(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Ct),autolinkProtocol:L,autolinkEmail:L,atxHeading:s(He),blockQuote:s(ze),characterEscape:L,characterReference:L,codeFenced:s(ce),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(ce,o),codeText:s(ve,o),codeTextData:L,data:L,codeFlowValue:L,definition:s(Oe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(oe),hardBreakEscape:s($e),hardBreakTrailing:s($e),htmlFlow:s(bt,o),htmlFlowData:L,htmlText:s(bt,o),htmlTextData:L,image:s(Gt),label:o,link:s(Ct),listItem:s(Xt),listItemValue:g,listOrdered:s(ct,m),listUnordered:s(ct),paragraph:s(kt),reference:z,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(He),strong:s(St),thematicBreak:s(gn)},exit:{atxHeading:u(),atxHeadingSequence:j,autolink:u(),autolinkEmail:_e,autolinkProtocol:Ae,blockQuote:u(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ee,characterReference:ne,codeFenced:u(S),codeFencedFence:v,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:F,codeIndented:u(w),codeText:u(V),codeTextData:F,data:F,definition:u(),definitionDestinationString:M,definitionLabelString:T,definitionTitleString:A,emphasis:u(),hardBreakEscape:u(W),hardBreakTrailing:u(W),htmlFlow:u(K),htmlFlowData:F,htmlText:u(Y),htmlTextData:F,image:u(U),label:le,labelText:Q,lineEnding:q,link:u(O),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Z,resourceDestinationString:I,resourceTitleString:$,resource:X,setextHeading:u(R),setextHeadingLineSequence:P,setextHeadingText:D,strong:u(),thematicBreak:u()}};a4(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(he){let me={type:"root",children:[]};const Fe={stack:[me],tokenStack:[],config:t,enter:a,exit:d,buffer:o,resume:f,data:n},et=[];let ft=-1;for(;++ft<he.length;)if(he[ft][1].type==="listOrdered"||he[ft][1].type==="listUnordered")if(he[ft][0]==="enter")et.push(ft);else{const Ot=et.pop();ft=i(he,Ot,ft)}for(ft=-1;++ft<he.length;){const Ot=t[he[ft][0]];o4.call(Ot,he[ft][1].type)&&Ot[he[ft][1].type].call(Object.assign({sliceSerialize:he[ft][2].sliceSerialize},Fe),he[ft][1])}if(Fe.tokenStack.length>0){const Ot=Fe.tokenStack[Fe.tokenStack.length-1];(Ot[1]||GA).call(Fe,void 0,Ot[0])}for(me.position={start:ul(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:ul(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},ft=-1;++ft<t.transforms.length;)me=t.transforms[ft](me)||me;return me}function i(he,me,Fe){let et=me-1,ft=-1,Ot=!1,cr,fn,Nt,zn;for(;++et<=Fe;){const tn=he[et];switch(tn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tn[0]==="enter"?ft++:ft--,zn=void 0;break}case"lineEndingBlank":{tn[0]==="enter"&&(cr&&!zn&&!ft&&!Nt&&(Nt=et),zn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:zn=void 0}if(!ft&&tn[0]==="enter"&&tn[1].type==="listItemPrefix"||ft===-1&&tn[0]==="exit"&&(tn[1].type==="listUnordered"||tn[1].type==="listOrdered")){if(cr){let Tr=et;for(fn=void 0;Tr--;){const Ar=he[Tr];if(Ar[1].type==="lineEnding"||Ar[1].type==="lineEndingBlank"){if(Ar[0]==="exit")continue;fn&&(he[fn][1].type="lineEndingBlank",Ot=!0),Ar[1].type="lineEnding",fn=Tr}else if(!(Ar[1].type==="linePrefix"||Ar[1].type==="blockQuotePrefix"||Ar[1].type==="blockQuotePrefixWhitespace"||Ar[1].type==="blockQuoteMarker"||Ar[1].type==="listItemIndent"))break}Nt&&(!fn||Nt<fn)&&(cr._spread=!0),cr.end=Object.assign({},fn?he[fn][1].start:tn[1].end),he.splice(fn||et,0,["exit",cr,tn[2]]),et++,Fe++}if(tn[1].type==="listItemPrefix"){const Tr={type:"listItem",_spread:!1,start:Object.assign({},tn[1].start),end:void 0};cr=Tr,he.splice(et,0,["enter",Tr,tn[2]]),et++,Fe++,Nt=void 0,zn=!0}}}return he[me][1]._spread=Ot,Fe}function s(he,me){return Fe;function Fe(et){a.call(this,he(et),et),me&&me.call(this,et)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(he,me,Fe){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([me,Fe||void 0]),he.position={start:ul(me.start),end:void 0}}function u(he){return me;function me(Fe){he&&he.call(this,Fe),d.call(this,Fe)}}function d(he,me){const Fe=this.stack.pop(),et=this.tokenStack.pop();if(et)et[0].type!==he.type&&(me?me.call(this,he,et[0]):(et[1]||GA).call(this,he,et[0]));else throw new Error("Cannot close `"+he.type+"` ("+fh({start:he.start,end:he.end})+"): it’s not open");Fe.position.end=ul(he.end)}function f(){return kw(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function g(he){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function y(){const he=this.resume(),me=this.stack[this.stack.length-1];me.lang=he}function x(){const he=this.resume(),me=this.stack[this.stack.length-1];me.meta=he}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he.replace(/(\r?\n|\r)$/g,"")}function T(he){const me=this.resume(),Fe=this.stack[this.stack.length-1];Fe.label=me,Fe.identifier=uo(this.sliceSerialize(he)).toLowerCase()}function A(){const he=this.resume(),me=this.stack[this.stack.length-1];me.title=he}function M(){const he=this.resume(),me=this.stack[this.stack.length-1];me.url=he}function j(he){const me=this.stack[this.stack.length-1];if(!me.depth){const Fe=this.sliceSerialize(he).length;me.depth=Fe}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function P(he){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function L(he){const Fe=this.stack[this.stack.length-1].children;let et=Fe[Fe.length-1];(!et||et.type!=="text")&&(et=nt(),et.position={start:ul(he.start),end:void 0},Fe.push(et)),this.stack.push(et)}function F(he){const me=this.stack.pop();me.value+=this.sliceSerialize(he),me.position.end=ul(he.end)}function q(he){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Fe=me.children[me.children.length-1];Fe.position.end=ul(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(L.call(this,he),F.call(this,he))}function W(){this.data.atHardBreak=!0}function K(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he}function Y(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he}function V(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he}function O(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=me,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function U(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=me,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Q(he){const me=this.sliceSerialize(he),Fe=this.stack[this.stack.length-2];Fe.label=_Y(me),Fe.identifier=uo(me).toLowerCase()}function le(){const he=this.stack[this.stack.length-1],me=this.resume(),Fe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Fe.type==="link"){const et=he.children;Fe.children=et}else Fe.alt=me}function I(){const he=this.resume(),me=this.stack[this.stack.length-1];me.url=he}function $(){const he=this.resume(),me=this.stack[this.stack.length-1];me.title=he}function X(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function Z(he){const me=this.resume(),Fe=this.stack[this.stack.length-1];Fe.label=me,Fe.identifier=uo(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function se(he){this.data.characterReferenceType=he.type}function ee(he){const me=this.sliceSerialize(he),Fe=this.data.characterReferenceType;let et;Fe?(et=Yj(me,Fe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):et=Sw(me);const ft=this.stack[this.stack.length-1];ft.value+=et}function ne(he){const me=this.stack.pop();me.position.end=ul(he.end)}function Ae(he){F.call(this,he);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(he)}function _e(he){F.call(this,he);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(he)}function ze(){return{type:"blockquote",children:[]}}function ce(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function Oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function oe(){return{type:"emphasis",children:[]}}function He(){return{type:"heading",depth:0,children:[]}}function $e(){return{type:"break"}}function bt(){return{type:"html",value:""}}function Gt(){return{type:"image",title:null,url:"",alt:null}}function Ct(){return{type:"link",title:null,url:"",children:[]}}function ct(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Xt(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function kt(){return{type:"paragraph",children:[]}}function St(){return{type:"strong",children:[]}}function nt(){return{type:"text",value:""}}function gn(){return{type:"thematicBreak"}}}function ul(e){return{line:e.line,column:e.column,offset:e.offset}}function a4(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?a4(e,r):MY(e,r)}}function MY(e,t){let n;for(n in t)if(o4.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function GA(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+fh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+fh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+fh({start:t.start,end:t.end})+") is still open")}function DY(e){const t=this;t.parser=n;function n(r){return AY(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function RY(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function jY(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
@@ -727,7 +765,7 @@ ${n.innerHTML}
727
765
  `);return}},parse:{}}}}}),Ixe=dn.create({name:"heading"}),Oxe=Ixe.extend({addStorage(){return{markdown:{serialize:Ko.nodes.heading,parse:{}}}}}),Pxe=dn.create({name:"horizontalRule"}),zxe=Pxe.extend({addStorage(){return{markdown:{serialize:Ko.nodes.horizontal_rule,parse:{}}}}}),Lxe=dn.create({name:"image"}),Bxe=Lxe.extend({addStorage(){return{markdown:{serialize:Ko.nodes.image,parse:{}}}}}),Fxe=dn.create({name:"listItem"}),$xe=Fxe.extend({addStorage(){return{markdown:{serialize:Ko.nodes.list_item,parse:{}}}}}),Uxe=dn.create({name:"orderedList"});function Hxe(e,t,n){let r=0;for(;n-r>0&&t.child(n-r-1).type.name===e.type.name;r++);return r}const Vxe=Uxe.extend({addStorage(){return{markdown:{serialize(e,t,n,r){const i=t.attrs.start||1,s=String(i+t.childCount-1).length,o=e.repeat(" ",s+2),u=Hxe(t,n,r)%2?") ":". ";e.renderList(t,o,d=>{const f=String(i+d);return e.repeat(" ",s-f.length)+f+u})},parse:{}}}}}),qxe=dn.create({name:"paragraph"}),Kxe=qxe.extend({addStorage(){return{markdown:{serialize:Ko.nodes.paragraph,parse:{}}}}});function ik(e){var t,n;return(t=e==null||(n=e.content)===null||n===void 0?void 0:n.content)!==null&&t!==void 0?t:[]}const Gxe=dn.create({name:"table"}),Wxe=Gxe.extend({addStorage(){return{markdown:{serialize(e,t,n){if(!Zxe(t)){oy.storage.markdown.serialize.call(this,e,t,n);return}e.inTable=!0,t.forEach((r,i,s)=>{if(e.write("| "),r.forEach((o,a,u)=>{u&&e.write(" | ");const d=o.firstChild;d.textContent.trim()&&e.renderInline(d)}),e.write(" |"),e.ensureNewLine(),!s){const o=Array.from({length:r.childCount}).map(()=>"---").join(" | ");e.write(`| ${o} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1},parse:{}}}}});function JD(e){return e.attrs.colspan>1||e.attrs.rowspan>1}function Zxe(e){const t=ik(e),n=t[0],r=t.slice(1);return!(ik(n).some(i=>i.type.name!=="tableHeader"||JD(i)||i.childCount>1)||r.some(i=>ik(i).some(s=>s.type.name==="tableHeader"||JD(s)||s.childCount>1)))}const Yxe=dn.create({name:"taskItem"}),Jxe=Yxe.extend({addStorage(){return{markdown:{serialize(e,t){const n=t.attrs.checked?"[x]":"[ ]";e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(".task-list-item")].forEach(t=>{const n=t.querySelector("input");t.setAttribute("data-type","taskItem"),n&&(t.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),Xxe=dn.create({name:"taskList"}),Qxe=Xxe.extend({addStorage(){return{markdown:{serialize:zL.storage.markdown.serialize,parse:{setup(e){e.use(mxe)},updateDOM(e){[...e.querySelectorAll(".contains-task-list")].forEach(t=>{t.setAttribute("data-type","taskList")})}}}}}}),eve=dn.create({name:"text"}),tve=eve.extend({addStorage(){return{markdown:{serialize(e,t){e.text(wxe(t.text))},parse:{}}}}}),nve=gi.create({name:"bold"}),rve=nve.extend({addStorage(){return{markdown:{serialize:Ko.marks.strong,parse:{}}}}}),ive=gi.create({name:"code"}),sve=ive.extend({addStorage(){return{markdown:{serialize:Ko.marks.code,parse:{}}}}}),ove=gi.create({name:"italic"}),ave=ove.extend({addStorage(){return{markdown:{serialize:Ko.marks.em,parse:{}}}}}),lve=gi.create({name:"link"}),uve=lve.extend({addStorage(){return{markdown:{serialize:Ko.marks.link,parse:{}}}}}),cve=gi.create({name:"strike"}),dve=cve.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),fve=[Nxe,zL,Rxe,LL,Oxe,zxe,oy,Bxe,$xe,Vxe,Kxe,Wxe,Jxe,Qxe,tve,rve,sve,PL,ave,uve,dve];function db(e){var t,n;const r=(t=e.storage)===null||t===void 0?void 0:t.markdown,i=(n=fve.find(s=>s.name===e.name))===null||n===void 0?void 0:n.storage.markdown;return r||i?{...i,...r}:null}class hve{constructor(t){cb(this,"editor",null),this.editor=t}serialize(t){const n=new Sxe(this.nodes,this.marks,{hardBreakNodeName:LL.name});return n.renderContent(t),n.out}get nodes(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(oy)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&t!==void 0?t:[])}}get marks(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(PL)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&t!==void 0?t:[])}}serializeNode(t){var n;return(n=db(t))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:t.options})}serializeMark(t){var n;const r=(n=db(t))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:t.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:t.options}):r.close}:null}}class pve{constructor(t,n){cb(this,"editor",null),cb(this,"md",null);let{html:r,linkify:i,breaks:s}=n;this.editor=t,this.md=this.withPatchedRenderer(Vi({html:r,linkify:i,breaks:s}))}parse(t){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"){this.editor.extensionManager.extensions.forEach(s=>{var o;return(o=db(s))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.setup)===null||o===void 0?void 0:o.call({editor:this.editor,options:s.options},this.md)});const r=this.md.render(t),i=fC(r);return this.editor.extensionManager.extensions.forEach(s=>{var o;return(o=db(s))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.updateDOM)===null||o===void 0?void 0:o.call({editor:this.editor,options:s.options},i)}),this.normalizeDOM(i,{inline:n,content:t}),i.innerHTML}return t}normalizeDOM(t,n){let{inline:r,content:i}=n;return this.normalizeBlocks(t),t.querySelectorAll("*").forEach(s=>{var o;((o=s.nextSibling)===null||o===void 0?void 0:o.nodeType)===Node.TEXT_NODE&&!s.closest("pre")&&(s.nextSibling.textContent=s.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(t,i),t}normalizeBlocks(t){const r=Object.values(this.editor.schema.nodes).filter(i=>i.isBlock).map(i=>{var s;return(s=i.spec.parseDOM)===null||s===void 0?void 0:s.map(o=>o.tag)}).flat().filter(Boolean).join(",");r&&[...t.querySelectorAll(r)].forEach(i=>{i.parentElement.matches("p")&&Cxe(i)})}normalizeInline(t,n){var r;if((r=t.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var i,s,o,a;const u=t.firstElementChild,{nextElementSibling:d}=u,f=(i=(s=n.match(/^\s+/))===null||s===void 0?void 0:s[0])!==null&&i!==void 0?i:"",m=d?"":(o=(a=n.match(/\s+$/))===null||a===void 0?void 0:a[0])!==null&&o!==void 0?o:"";if(n.match(/^\n\n/)){u.innerHTML=`${u.innerHTML}${m}`;return}Exe(u),t.innerHTML=`${f}${t.innerHTML}${m}`}}withPatchedRenderer(t){const n=r=>function(){const i=r(...arguments);return i===`
728
766
  `?i:i[i.length-1]===`
729
767
  `?i.slice(0,-1):i};return t.renderer.rules.hardbreak=n(t.renderer.rules.hardbreak),t.renderer.rules.softbreak=n(t.renderer.rules.softbreak),t.renderer.rules.fence=n(t.renderer.rules.fence),t.renderer.rules.code_block=n(t.renderer.rules.code_block),t.renderer.renderToken=n(t.renderer.renderToken.bind(t.renderer)),t}}const mve=Pn.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new Qn({key:new _r("markdownClipboard"),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(e,{inline:!0});return ka.fromSchema(this.editor.schema).parseSlice(fC(r),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),gve=Pn.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const e=gz.Commands.config.addCommands();return{setContent:(t,n)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n)(r),insertContentAt:(t,n,r)=>i=>e.insertContentAt(t,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new pve(this.editor,this.options),serializer:new hve(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[yxe.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),mve.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),BL=Kz.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),anchor:{default:null},uuid:{default:null},linktype:{default:null}}}}).configure({openOnClick:!1}),FL=gi.create({name:"textStyle",addAttributes(){return{color:{default:null}}},parseHTML(){return[{tag:"span",getAttrs:e=>{var t;return(t=e.style)!=null&&t.color?{}:!1}}]},renderHTML({HTMLAttributes:e}){return["span",Zn(e),0]}}),$L=Pn.create({name:"avocadoBlockKeys",addGlobalAttributes(){return[{types:["paragraph","heading","bulletList","orderedList","listItem","blockquote","codeBlock"],attributes:{_key:{default:null,rendered:!1}}}]}});function bve(e){if(e&&typeof e=="object"){const t=e;for(const n of["_type","nodeType","type"])if(typeof t[n]=="string")return t[n]}return"Embedded content"}const yve=dn.create({name:"avocadoUnknownBlock",group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes(){return{data:{default:null,rendered:!1},_key:{default:null,rendered:!1}}},parseHTML(){return[{tag:"div[data-avocado-unknown-block]"}]},renderHTML({node:e,HTMLAttributes:t}){return["div",Zn(t,{"data-avocado-unknown-block":"",class:"rte-unknown-block"}),bve(e.attrs.data)]}}),UL=gi.create({name:"avocadoUnknownHtml",addAttributes(){return{tag:{default:"span",rendered:!1},attributes:{default:null,rendered:!1}}},parseHTML(){return[{tag:"span[data-avocado-unknown-html]"}]},renderHTML({HTMLAttributes:e}){return["span",Zn(e,{"data-avocado-unknown-html":"",class:"rte-unknown-html"}),0]}}),HL=dn.create({name:"avocadoUnknownInline",group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{data:{default:null,rendered:!1}}},parseHTML(){return[{tag:"span[data-avocado-unknown-inline]"}]},renderHTML({HTMLAttributes:e}){return["span",Zn(e,{"data-avocado-unknown-inline":"",class:"rte-unknown-inline"})]}}),VL=Pn.create({name:"avocadoHtmlAttributes",addGlobalAttributes(){return[{types:["paragraph","heading","bulletList","orderedList","listItem","blockquote","codeBlock","horizontalRule","bold","italic","strike","code"],attributes:{htmlAttributes:{default:null,rendered:!1}}}]}}),xve=[rC.configure({heading:{levels:[1,2,3,4,5,6]},link:!1}),BL,FL,$L,VL,yve,HL,UL],vve=dn.create({name:"doc",topNode:!0,content:"paragraph"}),kve=[rC.configure({document:!1,heading:!1,bulletList:!1,orderedList:!1,listItem:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,link:!1}),vve,BL,FL,$L,VL,HL,UL],Sve=new Set(["bold","italic","strike","code","underline","link","textStyle","avocadoUnknownHtml"]);function wve(e){return gi.create({name:e,parseHTML(){return[{tag:`span[data-decorator="${e}"]`}]},renderHTML(){return["span",{"data-decorator":e,class:"rte-decorator"},0]}})}function Cve(e=[],t={}){const n=new Set(Sve),r=[];for(const s of e){const o=s==null?void 0:s.name;typeof o!="string"||o.length===0||n.has(o)||(n.add(o),r.push(wve(o)))}const i=t.inline?kve:xve;return r.length>0?[...i,...r]:i}const XD=340,Eve=340,_ve=Aq().map(e=>`.${e}`).join(",");function Tve(e){return e==null||!Number.isFinite(e)||e<=0?"":e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Ave(e){var i;const t=(i=e.contentType)==null?void 0:i.split("/").pop(),n=e.path.split(".").pop(),r=t&&t!=="octet-stream"?t:n;return r&&r.length<=5?r.toUpperCase():""}function Nve({anchorRef:e,initialValue:t,canUpload:n,onCommit:r,onCancel:i}){const{t:s}=Mn(),o=fe(O=>O.availablePages),a=fe(O=>O.availableFiles),u=fe(O=>O.filesStatus),d=fe(O=>O.setAvailableFiles),f=fe(O=>O.setFilesStatus);E.useEffect(()=>{m2()},[]);const[m,g]=E.useState(null);E.useLayoutEffect(()=>{const O=()=>{var $;const U=($=e.current)==null?void 0:$.getBoundingClientRect();if(!U)return;const le=window.innerHeight-U.bottom>=XD?U.bottom+6:Math.max(8,U.top-XD-6),I=Math.min(Math.max(8,U.left),Math.max(8,window.innerWidth-Eve-8));g({top:le,left:I})};return O(),window.addEventListener("resize",O),window.addEventListener("scroll",O,!0),()=>{window.removeEventListener("resize",O),window.removeEventListener("scroll",O,!0)}},[e]);const[y,x]=E.useState(t),[v,S]=E.useState(!1),[w,T]=E.useState(null),[A,M]=E.useState(!1),j=E.useRef(null),D=E.useRef(null),P=E.useRef(null);E.useEffect(()=>{var O,U;(O=j.current)==null||O.focus(),(U=j.current)==null||U.select()},[]),E.useEffect(()=>{const O=U=>{var le,I;const Q=U.target;(le=P.current)!=null&&le.contains(Q)||(I=e.current)!=null&&I.contains(Q)||i()};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[e,i]);const R=y.trim(),L=cw(R,o,a),{pages:F,files:q}=E.useMemo(()=>bj(R,{pages:o,files:a,limit:6,browseFiles:!0}),[o,a,R]),W=L.kind==="file"&&u==="loading",K=L.kind==="file"&&u==="unavailable",Y=O=>r(O),V=async O=>{S(!0),T(null);try{const U=await Jue(O),Q={path:U.url??"",...U.name?{name:U.name}:{},...U.contentType?{contentType:U.contentType}:{},...U.size!=null?{size:U.size}:{}};if(Q.path){d([...(a??[]).filter(le=>le.path!==Q.path),Q]),f("ready"),Y(Q.path);return}T(s("linkPicker.uploadNoUrl"))}catch(U){T(U instanceof Error?U.message:String(U))}finally{S(!1)}};return m?qd.createPortal(p.jsxs("div",{ref:P,className:`link-picker${A?" is-dropping":""}`,role:"dialog","aria-label":s("linkPicker.title"),style:{top:m.top,left:m.left},onDragOver:n?O=>{O.dataTransfer.types.includes("Files")&&(O.preventDefault(),O.dataTransfer.dropEffect="copy",M(!0))}:void 0,onDragLeave:n?O=>{O.currentTarget.contains(O.relatedTarget)||M(!1)}:void 0,onDrop:n?O=>{var Q;O.preventDefault(),M(!1);const U=(Q=O.dataTransfer.files)==null?void 0:Q[0];U&&V(U)}:void 0,children:[A?p.jsxs("div",{className:"link-picker-drop","aria-hidden":"true",children:[p.jsx(Ug,{size:16})," ",s("linkPicker.dropHere")]}):null,p.jsxs("div",{className:"link-picker-head",children:[p.jsx("span",{className:"link-picker-title",children:s("linkPicker.title")}),p.jsx("button",{type:"button",className:"link-picker-close",onClick:i,"aria-label":s("common.cancel"),children:p.jsx(bs,{size:13,"aria-hidden":"true"})})]}),p.jsx("input",{ref:j,type:"text",className:"link-picker-input",placeholder:s("linkPicker.placeholder"),value:y,title:y,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",onChange:O=>x(O.target.value),onKeyDown:O=>{O.key==="Escape"&&(O.stopPropagation(),i()),O.key==="Enter"&&(O.preventDefault(),Y(R))}}),R!==""&&L.missing===!0?p.jsxs("div",{className:"link-picker-warn",children:[p.jsx(XS,{size:11,"aria-hidden":"true"})," ",s(L.kind==="file"?"linkPicker.noFile":"linkPicker.noPage")]}):null,K?p.jsx("div",{className:"link-picker-note",children:s("linkPicker.filesUnavailable",{orchestrator:Be})}):null,p.jsxs("div",{className:"link-picker-list",role:"listbox",children:[F.map(O=>{var U;return p.jsxs("button",{type:"button",role:"option","aria-selected":((U=L.page)==null?void 0:U.slug)===O.slug,className:"link-picker-option",onMouseDown:Q=>Q.preventDefault(),onClick:()=>Y(O.path??O.slug),children:[p.jsx(fb,{size:12,"aria-hidden":"true"}),p.jsx("span",{className:"link-picker-option-title",children:O.title||O.slug}),p.jsx("span",{className:"link-picker-option-path",title:O.path??O.slug,children:O.path??O.slug})]},`p:${O.slug}`)}),q.map(O=>{var U;return p.jsxs("button",{type:"button",role:"option","aria-selected":((U=L.file)==null?void 0:U.path)===O.path,className:"link-picker-option",onMouseDown:Q=>Q.preventDefault(),title:O.path,onClick:()=>Y(O.path),children:[p.jsx(hb,{size:12,"aria-hidden":"true"}),p.jsx("span",{className:"link-picker-option-title",children:O.name??O.path.split("/").pop()}),p.jsx("span",{className:"link-picker-option-meta",children:[Ave(O),Tve(O.size)].filter(Boolean).join(" · ")})]},`f:${O.path}`)}),W&&q.length===0?p.jsxs("div",{className:"link-picker-empty",children:[p.jsx(fk,{size:12,className:"link-picker-spin","aria-hidden":"true"})," ",s("linkPicker.loadingFiles")]}):null,!W&&F.length===0&&q.length===0?p.jsx("div",{className:"link-picker-empty",children:L.kind==="external"?p.jsxs(p.Fragment,{children:[p.jsx($g,{size:12,"aria-hidden":"true"})," ",s("linkPicker.externalHint")]}):L.kind==="email"?s("linkPicker.emailHint"):L.kind==="phone"?s("linkPicker.phoneHint"):L.kind==="anchor"?s("linkPicker.anchorHint"):s("linkPicker.noMatches")}):null]}),w?p.jsx("div",{className:"link-picker-warn",children:w}):null,p.jsxs("div",{className:"link-picker-foot",children:[n?p.jsxs(p.Fragment,{children:[p.jsx("input",{ref:D,type:"file",hidden:!0,accept:_ve,onChange:O=>{var Q;const U=(Q=O.target.files)==null?void 0:Q[0];O.target.value="",U&&V(U)}}),p.jsxs("button",{type:"button",className:"link-picker-upload",disabled:v,title:s("linkPicker.uploadHint"),onClick:()=>{var O;return(O=D.current)==null?void 0:O.click()},children:[v?p.jsx(fk,{size:12,className:"link-picker-spin","aria-hidden":"true"}):p.jsx(Ug,{size:12,"aria-hidden":"true"})," ",s(v?"linkPicker.uploading":"linkPicker.upload")]})]}):p.jsx("span",{}),p.jsxs("div",{className:"link-picker-actions",children:[t!==""?p.jsx("button",{type:"button",className:"link-picker-remove",onClick:()=>Y(""),children:s("linkPicker.remove")}):null,p.jsx("button",{type:"button",className:"link-picker-apply",onClick:()=>Y(R),children:s("linkPicker.apply")})]})]})]}),document.body):null}const ga=14,Mve=[rC.configure({heading:{levels:[2,3,4,5,6]},link:!1,underline:!1}),Kz.configure({openOnClick:!1}),gve.configure({html:!1,transformPastedText:!0,transformCopiedText:!0})];function Dve(e){var n,r;const t=(r=(n=e.storage.markdown)==null?void 0:n.getMarkdown)==null?void 0:r.call(n);return typeof t=="string"?t:""}function To({active:e,onClick:t,title:n,className:r,children:i}){return p.jsx("button",{type:"button",className:`rte-toolbar-btn${e?" is-active":""}${r?` ${r}`:""}`,onClick:t,title:n,onMouseDown:s=>s.preventDefault(),children:i})}function qL({editor:e,trailing:t,decorators:n,inline:r}){const[i,s]=E.useState(!1),o=E.useRef(null),a=fe(f=>f.canUploadFiles),u=e.getAttributes("link").href??"",d=E.useCallback(f=>{if(s(!1),f===""){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:f}).run()},[e]);return p.jsxs("div",{className:`rte-toolbar${t?" rte-toolbar--with-trailing":""}`,children:[p.jsx(To,{active:e.isActive("bold"),onClick:()=>e.chain().focus().toggleBold().run(),title:"Bold",children:p.jsx(QB,{size:ga})}),p.jsx(To,{active:e.isActive("italic"),onClick:()=>e.chain().focus().toggleItalic().run(),title:"Italic",children:p.jsx($9,{size:ga})}),p.jsx(To,{active:e.isActive("strike"),onClick:()=>e.chain().focus().toggleStrike().run(),title:"Strikethrough",children:p.jsx(kF,{size:ga})}),!r&&p.jsx("span",{className:"rte-toolbar-sep"}),!r&&p.jsx(To,{active:e.isActive("heading",{level:2}),onClick:()=>e.chain().focus().toggleHeading({level:2}).run(),title:"Heading 2",children:p.jsx(N9,{size:ga})}),!r&&p.jsx(To,{active:e.isActive("heading",{level:3}),onClick:()=>e.chain().focus().toggleHeading({level:3}).run(),title:"Heading 3",children:p.jsx(j9,{size:ga})}),!r&&p.jsx(To,{active:e.isActive("heading",{level:4}),onClick:()=>e.chain().focus().toggleHeading({level:4}).run(),title:"Heading 4",children:p.jsx(D9,{size:ga})}),!r&&p.jsx("span",{className:"rte-toolbar-sep"}),!r&&p.jsx(To,{active:e.isActive("bulletList"),onClick:()=>e.chain().focus().toggleBulletList().run(),title:"Bullet list",children:p.jsx(K9,{size:ga})}),!r&&p.jsx(To,{active:e.isActive("orderedList"),onClick:()=>e.chain().focus().toggleOrderedList().run(),title:"Ordered list",children:p.jsx(V9,{size:ga})}),p.jsx("span",{className:"rte-toolbar-sep"}),p.jsxs("span",{className:"rte-link-anchor",ref:o,children:[p.jsx(To,{active:e.isActive("link"),onClick:()=>s(f=>!f),title:"Link",children:p.jsx(dR,{size:ga})}),i?p.jsx(Nve,{anchorRef:o,initialValue:u,canUpload:a,onCommit:d,onCancel:()=>s(!1)}):null]}),(n??[]).map(f=>p.jsx(To,{className:"rte-toolbar-btn--tag",active:e.isActive(f.name),onClick:()=>e.chain().focus().toggleMark(f.name).run(),title:f.title??f.name,children:f.title??f.name},f.name)),t?p.jsx("div",{className:"rte-toolbar-trailing",children:t}):null]})}function Rve({value:e,onChange:t,onFocus:n,onBlur:r,trailing:i}){const s=E.useRef(!1),o=E.useRef(e),a=Rz({extensions:Mve,content:bA(e),onUpdate:({editor:u})=>{if(s.current)return;const d=Dve(u);o.current=d,t(d)},onFocus:()=>n==null?void 0:n(),onBlur:()=>r==null?void 0:r()});return E.useEffect(()=>{if(!a||a.isDestroyed||e===o.current)return;o.current=e,s.current=!0;const{from:u,to:d}=a.state.selection;a.commands.setContent(bA(e));const f=a.state.doc.content.size,m=Math.min(u,f),g=Math.min(d,f);try{a.commands.setTextSelection({from:m,to:g})}catch{}s.current=!1},[e,a]),a?p.jsxs("div",{className:"rte-wrap",children:[p.jsx(qL,{editor:a,trailing:i}),p.jsx(V2,{editor:a,className:"rte-content"})]}):null}function KL({value:e,onChange:t,onFocus:n,onBlur:r,decorators:i,inline:s}){const o=E.useRef(!1),a=E.useRef(JSON.stringify(e)),u=`${s?"inline":"block"}:${(i??[]).map(m=>m.name).join(",")}`,d=E.useMemo(()=>Cve(i??[],{inline:s}),[u]),f=Rz({extensions:d,content:e,onUpdate:({editor:m})=>{if(o.current)return;const g=m.getJSON();a.current=JSON.stringify(g),t(g)},onFocus:()=>n==null?void 0:n(),onBlur:()=>r==null?void 0:r()},[u]);return E.useEffect(()=>{if(!f||f.isDestroyed)return;const m=JSON.stringify(e);if(m===a.current)return;a.current=m,o.current=!0;const{from:g,to:y}=f.state.selection;f.commands.setContent(e);const x=f.state.doc.content.size;try{f.commands.setTextSelection({from:Math.min(g,x),to:Math.min(y,x)})}catch{}o.current=!1},[e,f]),f?p.jsxs("div",{className:`rte-wrap${s?" rte-wrap--inline":""}`,children:[p.jsx(qL,{editor:f,decorators:i,inline:s}),p.jsx(V2,{editor:f,className:"rte-content"})]}):null}const QD=new Set(["text","richtext","imageAlt"]),jve=()=>{};function hC(e,t){const n=E.useRef(null),r=E.useRef(void 0);return E.useEffect(()=>{if(!e||!t||t!==e){r.current=t;return}if(r.current===t)return;const i=r.current;r.current=t;const s=n.current;if(!s)return;s.scrollIntoView({behavior:"smooth",block:"nearest"}),s.classList.add("property-field--flash");const o=setTimeout(()=>s.classList.remove("property-field--flash"),1800);return()=>{clearTimeout(o),s.classList.remove("property-field--flash"),r.current=i}},[e,t]),n}const Ive=qn.memo(function({style:t,blockId:n,blockType:r,props:i,status:s,failure:o,failedSlug:a,failedOrigin:u,onRetry:d,onFieldChange:f,onImageClick:m,onAiAssist:g,slug:y,pageName:x,navLabel:v,onNavLabelChange:S,pageMeta:w,onPageMetaChange:T,onDeselectBlock:A,onPageAiAssist:M,onAiQuickAction:j,onPageAiQuickAction:D,aiLoading:P,aiLoadingPath:R,onAddListItem:L,onRemoveListItem:F,highlightPath:q,manifestByType:W,siteOrigin:K,onClose:Y}){const V=fe(ve=>ve.activeBlockId),O=fe(ve=>ve.activeBlockType),U=fe(ve=>ve.slug),Q=fe(ve=>ve.isLoading),le=fe(ve=>ve.activeEditablePath),I=n??V,$=r??O,X=y??U,z=P??Q,Z=R??le,se=q??le,{t:ee}=Mn(),ne=Y?p.jsx("button",{type:"button",className:"property-panel-context-close",onClick:Y,"aria-label":ee("propertyPanel.close"),title:ee("propertyPanel.close"),children:p.jsx(bs,{size:16})}):null,Ae=p.jsxs("div",{className:"property-panel-context property-panel-context--page",children:[p.jsxs("svg",{className:"property-panel-context-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none","aria-hidden":"true",children:[p.jsx("path",{d:"M3.5 1.5h6L13 5v9a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5v-12a.5.5 0 0 1 .5-.5Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),p.jsx("path",{d:"M9.5 1.5V5h3.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})]}),p.jsx("div",{className:"property-panel-context-text",children:p.jsx("span",{className:"property-panel-context-breadcrumb",children:p.jsx("span",{className:"property-panel-context-breadcrumb-current",children:ee("propertyPanel.page")})})}),ne]});if(!I||!$)return p.jsxs("div",{className:"property-panel",style:t,children:[Ae,p.jsxs("div",{className:"property-panel-fields",children:[X&&X!=="/"&&S?p.jsx(Kve,{slug:X,navLabel:v??"",onNavLabelChange:S,onAiAssist:M,onAiQuickAction:D,aiLoading:z,fieldShimmer:z===!0&&Z==="Nav label"}):null,X&&T?p.jsx(Gve,{pageMeta:w??{},onPageMetaChange:T,onAiAssist:M,onAiQuickAction:D,aiLoading:z,aiLoadingPath:Z}):null]})]});const _e=Au(),ze=W==null?void 0:W.get($),ce=ze?Sq(ze,_e[$]):_e[$];return ce?p.jsxs("div",{className:"property-panel",style:t,children:[p.jsxs("div",{className:"property-panel-context property-panel-context--component",children:[p.jsxs("svg",{className:"property-panel-context-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none","aria-hidden":"true",children:[p.jsx("rect",{x:"1.5",y:"1.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),p.jsx("rect",{x:"9.5",y:"1.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),p.jsx("rect",{x:"1.5",y:"9.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),p.jsx("rect",{x:"9.5",y:"9.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"})]}),p.jsx("div",{className:"property-panel-context-text",children:p.jsxs("span",{className:"property-panel-context-breadcrumb",children:[p.jsx("button",{type:"button",className:"property-panel-context-breadcrumb-link",onClick:A,children:ee("propertyPanel.page")}),p.jsx("span",{className:"property-panel-context-breadcrumb-sep","aria-hidden":"true",children:"›"}),p.jsx("span",{className:"property-panel-context-breadcrumb-current",children:ce.displayName})]})}),ne]}),(s==="loading"||s==="idle"&&!i)&&!i?p.jsx("div",{className:"property-panel-empty",children:ee("propertyPanel.loading")}):s==="error"?p.jsx(Ove,{failure:o??"unreachable",slug:a??X,origin:u,onRetry:d}):i?p.jsxs("div",{className:"property-panel-fields",children:[Object.keys(ce.fields).length>0?p.jsx(ay,{id:`block:${$}:fields`,title:ee("propertyPanel.content"),count:Object.keys(ce.fields).length,children:GL(Object.entries(ce.fields),i,"",$,f,m,g,j,z,Z,se,K)}):null,ce.listFields?Object.entries(ce.listFields).map(([ve,Oe])=>{const oe=Array.isArray(i[ve])?i[ve]:[];return p.jsx(Uve,{listKey:ve,listField:Oe,items:oe,blockType:$,onFieldChange:f,onImageClick:m,onAiAssist:g,onAiQuickAction:j,aiLoading:z,aiLoadingPath:Z,highlightPath:se,onAddItem:L?()=>L(ve):void 0,onRemoveItem:F?He=>F(ve,He):void 0,siteOrigin:K},ve)}):null]}):null]}):p.jsxs("div",{className:"property-panel",style:t,children:[Ae,p.jsxs("div",{className:"property-panel-empty",children:[ee("propertyPanel.unknownBlock"),": ",$]})]})});function ay({id:e,title:t,count:n,headerExtra:r,children:i}){const[s,o]=f6(e);return p.jsxs("div",{className:`property-section${s?" is-collapsed":""}`,children:[p.jsxs("div",{className:"property-section-header",children:[p.jsxs("button",{type:"button",className:"property-section-toggle",onClick:o,"aria-expanded":!s,children:[p.jsx("span",{className:"property-section-chevron","aria-hidden":"true"}),p.jsx("span",{className:"property-section-title",children:t}),typeof n=="number"?p.jsx("span",{className:"property-section-count",children:n}):null]}),r]}),s?null:p.jsx("div",{className:"property-section-body",children:i})]})}function Ove({failure:e,slug:t,origin:n,onRetry:r}){const{t:i}=Mn(),s=i(e==="blockMissing"?"propertyPanel.loadFailedMissing":e==="pageMissing"?"propertyPanel.loadFailedNoPage":"propertyPanel.loadFailed"),o=i(e==="blockMissing"?"propertyPanel.loadFailedMissingHint":e==="pageMissing"?"propertyPanel.loadFailedNoPageHint":"propertyPanel.loadFailedUnreachableHint");return p.jsxs("div",{className:"property-panel-empty",children:[s,p.jsx("div",{className:"sites-form-hint",style:{marginTop:8},children:o}),e!=="unreachable"||n?p.jsxs("div",{className:"sites-form-hint",style:{marginTop:8},children:[p.jsx("code",{children:t}),n?p.jsxs(p.Fragment,{children:[" · ",p.jsx("code",{children:n})]}):null]}):null,r?p.jsx("button",{type:"button",className:"property-panel-retry",onClick:r,style:{marginTop:12},children:i("propertyPanel.retry")}):null]})}function eR(e,t){return!!(e==="imageUrl"&&t==="imageAlt"||e==="src"&&t==="alt"||e.endsWith(".src")&&t===e.replace(/\.src$/,".alt"))}function tR(e){try{const n=new URL(e,"http://localhost").pathname.split("/").pop()||"";return n.length>30?n.slice(0,27)+"...":n||"(image)"}catch{return e.length>30?e.slice(0,27)+"...":e||"(empty)"}}function GL(e,t,n,r,i,s,o,a,u,d,f,m){const g=new Set,y=new Set,x=new Set(e.map(([S])=>S));for(let S=0;S<e.length;S++){const[w,T]=e[S];if(T.kind==="image")for(const[A,M]of e)M.kind==="imageAlt"&&eR(w,A)&&g.add(A);if(T.kind==="link"||T.kind==="file"){const A=mA(w);x.has(A)&&y.add(A)}}const v=[];for(const[S,w]of e)if(!w.internal&&!g.has(S)&&!y.has(S))if(w.kind==="stringList"){const T=t[S];v.push(p.jsx(Fve,{label:w.label??S,values:Array.isArray(T)?T.map(A=>A==null?"":String(A)):[],basePath:n+S,onFieldChange:i},S))}else if(w.kind==="imageList"){const T=t[S];v.push(p.jsx($ve,{label:w.label??S,rows:Array.isArray(T)?T:[],basePath:n+S,blockType:r,siteOrigin:m,onFieldChange:i,onImageClick:s},S))}else if(w.kind==="image"){const T=e.find(([j,D])=>D.kind==="imageAlt"&&eR(S,j)),A=T==null?void 0:T[0],M=A?t[A]==null?"":String(t[A]):void 0;v.push(p.jsx(ZL,{label:w.label??S,blockType:r,imageUrl:t[S]==null?"":String(t[S]),altText:M,onChangeClick:()=>s==null?void 0:s(n+S,t[S]==null?"":String(t[S])),onRemove:()=>{i(n+S,""),A&&i(n+A,"")},onAltCommit:A?j=>i(n+A,j):void 0,onAltAiAssist:A&&o?()=>o(n+A,"Alt text","imageAlt",M??""):void 0,onAltAiQuickAction:A&&a?j=>a(n+A,"Alt text","imageAlt",M??"",j):void 0,fieldPath:n+S,...A?{altFieldPath:n+A}:{},highlightPath:f,aiLoading:u,fieldShimmer:u===!0&&A!=null&&d===n+A,siteOrigin:m},S))}else if(w.kind==="link"||w.kind==="file"){const T=mA(S),A=y.has(T);v.push(p.jsx(Lve,{label:w.label??S,required:w.required,value:t[S]==null?"":String(t[S]),newTab:A?t[T]===!0:void 0,onCommit:M=>i(n+S,M),onNewTabCommit:A?M=>i(n+T,M):void 0,fieldPath:n+S,highlightPath:f,siteOrigin:m},S))}else v.push(p.jsx(qve,{fieldKey:S,field:w,value:t[S],blockType:r,onCommit:T=>i(n+S,T),onAiAssist:QD.has(w.kind)&&o?()=>o(n+S,w.label??S,w.kind,t[S]==null?"":String(t[S])):void 0,onAiQuickAction:QD.has(w.kind)&&a?T=>a(n+S,w.label??S,w.kind,t[S]==null?"":String(t[S]),T):void 0,aiLoading:u,fieldShimmer:u===!0&&d===n+S,highlightPath:f,fieldPath:n+S},S));return v}const Pve={empty:dR,page:fb,file:hb,external:$g,email:Z9,phone:iF,anchor:T9},zve=8;function sk(e){var n;const t=(n=e.title)==null?void 0:n.trim();return t&&t.length>0?t:e.slug}function Lve({label:e,required:t,value:n,newTab:r,onCommit:i,onNewTabCommit:s,fieldPath:o,highlightPath:a,siteOrigin:u}){const{t:d}=Mn(),f=fe(U=>U.availablePages),m=fe(U=>U.availableFiles),g=a!=null&&a===o,y=hC(g?a:void 0,a),[x,v]=E.useState(!1),[S,w]=E.useState(n),[T,A]=E.useState(!1),M=E.useRef(null),{debouncedCommit:j,flushCommit:D}=Yd(i,400),P=T?S:n,R=cw(n,f,m),L=Pve[R.kind],F=R.kind==="external"?Pq(n,u):void 0,{pages:q,files:W}=E.useMemo(()=>bj(T?S:"",{pages:f,files:m,limit:zve}),[f,m,S,T]),K=E.useMemo(()=>T?void 0:Oq(n,f),[n,f,T]);E.useEffect(()=>{if(!x)return;const U=Q=>{var le;(le=M.current)!=null&&le.contains(Q.target)||v(!1)};return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[x]);const Y=U=>{const Q=U.path??U.slug;w(Q),D(),i(Q),v(!1)},V=U=>{w(U.path),D(),i(U.path),v(!1)},O=s!=null&&R.kind==="external";return p.jsxs("div",{className:`property-field${g?" is-targeted":""}`,ref:y,children:[p.jsx("div",{className:"property-field-label",children:p.jsxs("span",{children:[e,t&&p.jsx("span",{className:"property-field-required",children:"*"})]})}),p.jsxs("div",{className:"property-field-link",ref:M,children:[p.jsxs("div",{className:"property-field-link-input-wrap",children:[p.jsx(L,{size:13,className:"property-field-link-icon","aria-hidden":"true"}),p.jsx("input",{type:"text",className:"property-field-input property-field-link-input",placeholder:d("propertyPanel.linkPlaceholder"),value:P,onFocus:()=>{m2(),w(n),A(!0),v(!0)},onChange:U=>{w(U.target.value),v(!0),j(U.target.value)},onBlur:()=>{A(!1),D()},onKeyDown:U=>{if(U.key==="Escape"&&x&&(U.stopPropagation(),v(!1)),U.key==="Enter"&&x){const Q=q[0];Q&&S.trim()!==""&&S!==n?(U.preventDefault(),Y(Q)):v(!1)}}}),p.jsx("button",{type:"button",className:"property-field-link-toggle","aria-label":d("propertyPanel.linkBrowsePages"),"aria-expanded":x,onClick:()=>v(U=>!U),children:p.jsx(Na,{size:13,"aria-hidden":"true"})})]}),!T&&R.kind==="page"&&R.page?p.jsx("div",{className:"property-field-link-note",children:sk(R.page)}):null,!T&&R.kind==="file"&&R.file?p.jsx("div",{className:"property-field-link-note",children:R.file.name??tR(R.file.path)}):null,R.missing===!0?p.jsxs("div",{className:"property-field-link-note property-field-link-note--warn",children:[p.jsx(XS,{size:11,"aria-hidden":"true"})," ",d(R.kind==="file"?"propertyPanel.linkNoFile":"propertyPanel.linkNoPage")]}):null,K?p.jsx("button",{type:"button",className:"property-field-link-convert",onClick:()=>{const U=K.path??K.slug;w(U),i(U)},children:d("propertyPanel.linkDidYouMean",{page:sk(K)})}):null,F?p.jsx("button",{type:"button",className:"property-field-link-convert",onClick:()=>{w(F),i(F)},children:d("propertyPanel.linkUseInternal",{path:F})}):null,O?p.jsxs("label",{className:"property-field-link-newtab",children:[p.jsx("input",{type:"checkbox",checked:r===!0,onChange:U=>s==null?void 0:s(U.target.checked)}),p.jsx("span",{children:d("propertyPanel.linkNewTab")})]}):null,x?p.jsxs("div",{className:"property-field-link-menu",role:"listbox",children:[q.map(U=>{var Q,le;return p.jsxs("button",{type:"button",role:"option","aria-selected":((Q=R.page)==null?void 0:Q.slug)===U.slug,className:`property-field-link-option${((le=R.page)==null?void 0:le.slug)===U.slug?" is-current":""}`,onMouseDown:I=>I.preventDefault(),onClick:()=>Y(U),children:[p.jsx(fb,{size:12,"aria-hidden":"true"}),p.jsx("span",{className:"property-field-link-option-title",children:sk(U)}),p.jsx("span",{className:"property-field-link-option-slug",children:U.path??U.slug})]},U.slug)}),W.map(U=>{var Q,le;return p.jsxs("button",{type:"button",role:"option","aria-selected":((Q=R.file)==null?void 0:Q.path)===U.path,className:`property-field-link-option${((le=R.file)==null?void 0:le.path)===U.path?" is-current":""}`,onMouseDown:I=>I.preventDefault(),onClick:()=>V(U),children:[p.jsx(hb,{size:12,"aria-hidden":"true"}),p.jsx("span",{className:"property-field-link-option-title",children:U.name??tR(U.path)}),p.jsx("span",{className:"property-field-link-option-slug",children:U.path})]},U.path)}),q.length===0&&W.length===0?p.jsx("div",{className:"property-field-link-empty",children:d("propertyPanel.linkNoMatches")}):null]}):null]})]})}function lp({onClick:e,fieldKind:t,fieldLabel:n,blockType:r,currentValue:i,onQuickAction:s,onCustomPrompt:o,aiLoading:a,variant:u="overlay"}){const[d,f]=E.useState(null);if(fe(x=>x.plannerBadgeState)==="demo")return null;const g=x=>{s&&t&&n&&r!==void 0?f(x.currentTarget.getBoundingClientRect()):e()},y=u==="toolbar"?"rte-toolbar-ai-btn":"property-field-ai-btn";return p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:`${y}${a?` ${y}--loading`:""}`,onClick:g,onMouseDown:x=>x.preventDefault(),title:"AI suggestions",children:a?p.jsx(jh,{size:14,"aria-hidden":"true"}):p.jsx(fR,{size:14,"aria-hidden":"true"})}),d&&t&&n&&r!==void 0&&p.jsx(Bve,{anchorRect:d,fieldKind:t,fieldLabel:n,blockType:r,currentValue:i??"",aiLoading:a,onSelect:x=>{f(null),s==null||s(x)},onCustomPrompt:()=>{f(null),(o??e)()},onDismiss:()=>f(null)})]})}function Bve({anchorRect:e,fieldKind:t,fieldLabel:n,blockType:r,currentValue:i,aiLoading:s,onSelect:o,onCustomPrompt:a,onDismiss:u}){const d=Ace(t,n,r,i),m=window.innerHeight-e.bottom<160,g=m?void 0:e.bottom+4,y=m?window.innerHeight-e.top+4:void 0,x=window.innerWidth-e.right;return E.useEffect(()=>{const v=S=>{S.key==="Escape"&&u()};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[u]),p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"ai-quick-actions-backdrop",onClick:u}),p.jsxs("div",{className:"ai-quick-actions-menu",style:{top:g,bottom:y,right:x},children:[d.map(v=>p.jsxs("button",{type:"button",className:"ai-quick-actions-item",disabled:s,onClick:()=>o(v),children:[p.jsx(fR,{size:12,"aria-hidden":"true"}),v]},v)),p.jsx("div",{className:"ai-quick-actions-divider"}),p.jsxs("button",{type:"button",className:"ai-quick-actions-item ai-quick-actions-item--custom",onClick:a,children:[p.jsx(nF,{size:12,"aria-hidden":"true"}),"Custom prompt..."]})]})]})}function WL(e,t){return!e||!t||/^https?:\/\//i.test(e)?e:e.startsWith("/")?`${t}${e}`:e}function Fve({label:e,values:t,basePath:n,onFieldChange:r}){const{t:i}=Mn();return p.jsxs("div",{className:"property-field property-field--list",children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:e})}),p.jsx("div",{className:"property-list-rows",children:t.map((s,o)=>p.jsxs("div",{className:"property-list-row",children:[p.jsx("input",{className:"property-field-input",value:s,onChange:a=>r(`${n}[${o}]`,a.target.value)}),p.jsx("button",{type:"button",className:"property-list-item-remove-btn",title:i("propertyPanel.removeItem"),onClick:()=>r(n,t.filter((a,u)=>u!==o)),children:"×"})]},`${n}-${o}`))}),p.jsx("button",{type:"button",className:"property-list-add-btn",onClick:()=>r(n,[...t,""]),children:i("propertyPanel.addItem")})]})}function $ve({label:e,rows:t,basePath:n,blockType:r,siteOrigin:i,onFieldChange:s,onImageClick:o}){const{t:a}=Mn(),u=t.find(m=>m&&typeof m=="object")??{},d=["url","imageUrl","src","image"].find(m=>m in u)??"url",f=["alt","imageAlt","image_alt"].find(m=>m in u)??"alt";return p.jsxs("div",{className:"property-field property-field--list",children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:e})}),p.jsx("div",{className:"property-list-rows",children:t.map((m,g)=>{const y=`${n}[${g}]`,x=(m==null?void 0:m[d])==null?"":String(m[d]),v=(m==null?void 0:m[f])==null?"":String(m[f]);return p.jsx(ZL,{label:`${e} ${g+1}`,blockType:r,imageUrl:x,altText:v,fieldPath:`${y}.${d}`,altFieldPath:`${y}.${f}`,onChangeClick:()=>o==null?void 0:o(`${y}.${d}`,x),onRemove:()=>s(n,t.filter((S,w)=>w!==g)),onAltCommit:S=>s(`${y}.${f}`,S),siteOrigin:i},y)})}),p.jsx("button",{type:"button",className:"property-list-add-btn",onClick:()=>s(n,[...t,{[d]:"",[f]:""}]),children:a("propertyPanel.addItem")})]})}function ZL({label:e,blockType:t,imageUrl:n,altText:r,fieldPath:i,altFieldPath:s,highlightPath:o,onChangeClick:a,onRemove:u,onAltCommit:d,onAltAiAssist:f,onAltAiQuickAction:m,aiLoading:g,fieldShimmer:y,siteOrigin:x}){const{t:v}=Mn(),S=o&&(o===i||o===s),w=hC(S?o:void 0,o),T=S&&o===s,A=`property-field${S?" is-targeted":""}`,[M,j]=E.useState(r??""),[D,P]=E.useState(!1),[R,L]=E.useState(!1),F=D?M:r??"",{debouncedCommit:q,flushCommit:W}=Yd(d??jve,400);return p.jsxs("div",{className:A,ref:w,children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:e})}),p.jsxs("div",{className:"property-field-image-widget",children:[n&&!R?p.jsxs("div",{className:"property-field-image-preview",children:[p.jsx("img",{className:"property-field-image-thumb",src:WL(n,x),alt:"",onError:()=>L(!0)}),p.jsxs("div",{className:"property-field-image-actions",children:[p.jsxs("button",{type:"button",className:"property-field-image-change",onClick:a,children:[p.jsx(dF,{size:13})," ",v("propertyPanel.change")]}),u?p.jsxs("button",{type:"button",className:"property-field-image-remove",onClick:u,children:[p.jsx(JS,{size:13})," ",v("propertyPanel.remove")]}):null]})]}):p.jsxs("button",{type:"button",className:"property-field-image-empty",onClick:a,children:[p.jsx(O9,{size:18,"aria-hidden":"true"}),p.jsx("span",{children:v("propertyPanel.chooseImage")})]}),d!==void 0&&p.jsxs("div",{className:"property-field-image-alt-group",children:[p.jsx("div",{className:"property-field-image-alt-label",children:p.jsx("span",{children:v("propertyPanel.altText")})}),p.jsxs("div",{className:`property-field-input-wrap${y?" property-field-input-wrap--ai-loading":""}`,children:[p.jsx("input",{type:"text",className:`property-field-image-alt${T?" is-targeted":""}`,placeholder:v("propertyPanel.altPlaceholder"),value:F,onFocus:()=>{j(r??""),P(!0)},onChange:K=>{j(K.target.value),q(K.target.value)},onBlur:()=>{P(!1),W()}}),f?p.jsx(lp,{onClick:f,fieldKind:"imageAlt",fieldLabel:v("propertyPanel.altText"),blockType:t??"",currentValue:r??"",onQuickAction:m,onCustomPrompt:f,aiLoading:y}):null]})]})]})]})}function Uve({listKey:e,listField:t,items:n,blockType:r,onFieldChange:i,onImageClick:s,onAiAssist:o,onAiQuickAction:a,aiLoading:u,aiLoadingPath:d,highlightPath:f,onAddItem:m,onRemoveItem:g,siteOrigin:y}){const[x,v]=E.useState(null),S=t.label??e;return E.useEffect(()=>{if(!f)return;const w=`${e}[`;if(!f.startsWith(w))return;const T=f.slice(w.length),A=T.indexOf("]");if(A<0)return;const M=Number(T.slice(0,A));!Number.isNaN(M)&&M>=0&&M<n.length&&v(M)},[f,e,n.length]),p.jsxs(ay,{id:`list:${r}:${e}`,title:S,count:n.length,children:[n.map((w,T)=>{const A=x===T,{fields:M,discriminantValue:j}=wq(t,w),D=Object.keys(M).find(W=>M[W].kind==="image"),P=D&&w[D]!=null?String(w[D]):"",L=Cq(M,w,T,{...t.discriminator?{discriminator:t.discriminator}:{}}).label,F=j?`[${j}] ${L}`:L,q=F.length>40?F.slice(0,40)+"...":F;return p.jsxs("div",{className:"property-list-item",children:[p.jsxs("button",{type:"button",className:`property-list-item-toggle ${A?"is-expanded":""}`,onClick:()=>v(A?null:T),children:[p.jsx("span",{className:"property-list-item-chevron","aria-hidden":"true"}),P?p.jsx("img",{className:"property-list-item-thumb",src:WL(P,y),alt:"",loading:"lazy"}):null,p.jsx("span",{className:"property-list-item-preview",children:q})]}),A?p.jsxs("div",{className:"property-list-item-fields",children:[GL(Object.entries(M),w,`${e}[${T}].`,r,i,s,o,a,u,d,f,y),g?p.jsxs("button",{type:"button",className:"property-list-item-remove-btn",onClick:()=>g(T),children:[p.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:p.jsx("path",{d:"M2.5 4h11M6 4V2.5h4V4M5 4l.5 9h5l.5-9M6.5 6.5v4M9.5 6.5v4"})}),"Remove item"]}):null]}):null]},T)}),m?p.jsxs("button",{type:"button",className:"property-list-add-btn",onClick:m,children:[p.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",children:p.jsx("path",{d:"M8 3v10M3 8h10"})}),"Add"]}):null]})}const Hve={h1:"H1 — Page title",h2:"H2 — Section",h3:"H3 — Subsection",h4:"H4",h5:"H5",h6:"H6"};function Vve({value:e,onCommit:t,onFocus:n,onBlur:r,inline:i}){const s=E.useRef(null),[o,a]=E.useState(()=>xA(e)),{debouncedCommit:u,flushCommit:d}=Yd(t,400);return E.useEffect(()=>{e!==s.current&&(s.current=null,a(xA(e)))},[e]),p.jsx(KL,{value:o,onChange:f=>{a(f);const m=aK(f);s.current=m,u(m)},onFocus:n,onBlur:()=>{d(),r==null||r()},inline:i})}function qve({fieldKey:e,field:t,value:n,blockType:r,onCommit:i,onAiAssist:s,onAiQuickAction:o,aiLoading:a,fieldShimmer:u,highlightPath:d,fieldPath:f}){const m=Nce(n),g=m?m.text:n==null?"":String(n),[y,x]=E.useState(g),[v,S]=E.useState(!1),{debouncedCommit:w,flushCommit:T}=Yd(i,400),A=hC(f,d),M=`property-field${f&&f===d?" is-targeted":""}`,j=v?y:g,D=t.label??e,P=()=>{x(g),S(!0)},R=()=>{S(!1),T()};if(t.kind==="reference"){const W=BV(n,t.referenceLabelKey);return p.jsxs("div",{className:M,ref:A,children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:D})}),p.jsxs("div",{className:"property-field-reference",title:W?`${W} — managed in the CMS`:"No reference set",children:[p.jsx("span",{className:"property-field-reference-target",children:W||"(not set)"}),p.jsx("span",{className:"property-field-reference-note",children:"CMS"})]})]})}if(m)return p.jsxs("div",{className:M,ref:A,children:[p.jsx("div",{className:"property-field-label",children:p.jsxs("span",{children:[D,t.required&&p.jsx("span",{className:"property-field-required",children:"*"})]})}),p.jsx("div",{className:"property-field-input-wrap",children:p.jsx("textarea",{className:"property-field-textarea",rows:Math.min(8,Math.max(3,g.split(`
730
- `).length)),readOnly:!m.editable,value:j,onFocus:m.editable?P:void 0,onBlur:m.editable?R:void 0,onChange:m.editable?W=>{x(W.target.value),w(Mce(W.target.value))}:void 0})})]});if(t.kind==="headingLevel"){const W=(r&&sj[r])??"h2",K=g&&/^h[1-6]$/.test(g)?g:"";return p.jsxs("div",{className:"property-field",children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:D})}),p.jsxs("select",{className:"property-field-input property-field-select",value:K,onChange:Y=>i(Y.target.value),children:[p.jsxs("option",{value:"",children:["Auto (",W.toUpperCase(),")"]}),["h1","h2","h3","h4","h5","h6"].map(Y=>p.jsx("option",{value:Y,children:Hve[Y]},Y))]})]})}if(t.kind==="image")return p.jsxs("div",{className:"property-field",children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:D})}),p.jsx("div",{className:"property-field-image-url",title:g,children:g||"(empty)"})]});if(t.kind==="enum"&&t.options){const W=t.options.includes(g);return p.jsxs("div",{className:M,ref:A,children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:D})}),p.jsxs("select",{className:"property-field-input property-field-select",value:g,onChange:K=>i(K.target.value),children:[!W&&p.jsx("option",{value:g,children:g||"—"}),t.options.map(K=>p.jsx("option",{value:K,children:K},K))]})]})}if(t.kind==="boolean"){const W=g==="true"||g==="1";return p.jsx("div",{className:`${M} property-field--inline`,ref:A,children:p.jsxs("div",{className:"property-field-label",children:[p.jsxs("span",{children:[D,t.required&&p.jsx("span",{className:"property-field-required",children:"*"})]}),p.jsx("button",{type:"button",role:"switch","aria-checked":W,"aria-label":D,className:`property-field-switch${W?" is-on":""}`,onClick:()=>i(W?"false":"true"),children:p.jsx("span",{className:"property-field-switch-knob","aria-hidden":"true"})})]})})}if(t.kind==="color")return p.jsxs("div",{className:"property-field",children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:D})}),p.jsx("input",{type:"color",className:"property-field-color",value:g||"#000000",onChange:W=>i(W.target.value)})]});if(t.kind==="html")return p.jsxs("div",{className:M,ref:A,children:[p.jsx("div",{className:"property-field-label",children:p.jsxs("span",{children:[D,t.required&&p.jsx("span",{className:"property-field-required",children:"*"})]})}),p.jsx("div",{className:"property-field-input-wrap",children:p.jsx(Vve,{value:g,onCommit:W=>i(W),onFocus:P,onBlur:R,inline:t.inline})})]});if(t.kind==="richtext")return n!==null&&typeof n=="object"?p.jsxs("div",{className:M,ref:A,children:[p.jsx("div",{className:"property-field-label",children:p.jsxs("span",{children:[D,t.required&&p.jsx("span",{className:"property-field-required",children:"*"})]})}),p.jsx("div",{className:"property-field-input-wrap",children:p.jsx(KL,{value:n,onChange:W=>w(W),onFocus:P,onBlur:R,decorators:t.decorators,inline:t.inline})})]}):p.jsxs("div",{className:M,ref:A,children:[p.jsx("div",{className:"property-field-label",children:p.jsxs("span",{children:[D,t.required&&p.jsx("span",{className:"property-field-required",children:"*"})]})}),p.jsx("div",{className:`property-field-input-wrap${u?" property-field-input-wrap--ai-loading":""}`,children:p.jsx(Rve,{value:g,onChange:W=>{x(W),w(W)},onFocus:P,onBlur:R,trailing:s?p.jsx(lp,{variant:"toolbar",onClick:s,fieldKind:t.kind,fieldLabel:t.label??e,blockType:r??"",currentValue:g,onQuickAction:o,onCustomPrompt:s,aiLoading:u}):null})})]});const L=t.multiline===!0,F=t.kind==="number"?"number":t.kind==="url"?"url":"text",q={value:j,onFocus:P,onChange:W=>{x(W.target.value),w(W.target.value)},onBlur:R};return p.jsxs("div",{className:M,ref:A,children:[p.jsx("div",{className:"property-field-label",children:p.jsxs("span",{children:[D,t.required&&p.jsx("span",{className:"property-field-required",children:"*"})]})}),p.jsxs("div",{className:`property-field-input-wrap${u?" property-field-input-wrap--ai-loading":""}`,children:[L?p.jsx("textarea",{className:"property-field-textarea",rows:3,...q}):p.jsx("input",{type:F,className:"property-field-input",...q}),s?p.jsx(lp,{onClick:s,fieldKind:t.kind,fieldLabel:t.label??e,blockType:r??"",currentValue:g,onQuickAction:o,onCustomPrompt:s,aiLoading:u}):null]})]})}function Kve({slug:e,navLabel:t,onNavLabelChange:n,onAiAssist:r,onAiQuickAction:i,aiLoading:s,fieldShimmer:o}){const{t:a}=Mn(),[u,d]=E.useState(t),[f,m]=E.useState(!1),g=f?u:t,{debouncedCommit:y,flushCommit:x}=Yd(v=>n(e,v),400);return p.jsx(ay,{id:"page:nav",title:a("propertyPanel.navigation"),count:1,children:p.jsxs("div",{className:"property-field",children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:a("propertyPanel.navLabel")})}),p.jsxs("div",{className:`property-field-input-wrap${o?" property-field-input-wrap--ai-loading":""}`,children:[p.jsx("input",{type:"text",className:"property-field-input",placeholder:a("propertyPanel.navPlaceholder"),value:g,onFocus:()=>{d(t),m(!0)},onChange:v=>{d(v.target.value),y(v.target.value)},onBlur:()=>{m(!1),x()}}),r?p.jsx(lp,{onClick:()=>r("Nav label","text",t),fieldKind:"text",fieldLabel:"Nav label",blockType:"Page",currentValue:t,onQuickAction:i?v=>i("Nav label","text",t,v):void 0,onCustomPrompt:()=>r("Nav label","text",t),aiLoading:o}):null]})]})})}function Gve({pageMeta:e,onPageMetaChange:t,onAiAssist:n,onAiQuickAction:r,aiLoading:i,aiLoadingPath:s}){const{t:o}=Mn();return p.jsxs(ay,{id:"page:seo",title:o("propertyPanel.seo"),count:3,children:[p.jsx(ok,{label:o("propertyPanel.seoTitle"),fieldKind:"text",blockType:"Page",value:e.title??"",placeholder:o("propertyPanel.seoTitlePlaceholder"),multiline:!0,autosizeRows:{min:2,max:2},recommendedMax:60,onCommit:a=>t("title",a),onAiAssist:n?()=>n("SEO title","text",e.title??""):void 0,onAiQuickAction:r?a=>r("SEO title","text",e.title??"",a):void 0,aiLoading:i,fieldShimmer:i===!0&&s==="SEO title"}),p.jsx(ok,{label:o("propertyPanel.metaDescription"),fieldKind:"richtext",blockType:"Page",value:e.description??"",placeholder:o("propertyPanel.metaDescPlaceholder"),multiline:!0,autosizeRows:{min:3,max:6},recommendedMax:160,onCommit:a=>t("description",a),onAiAssist:n?()=>n("Meta description","richtext",e.description??""):void 0,onAiQuickAction:r?a=>r("Meta description","richtext",e.description??"",a):void 0,aiLoading:i,fieldShimmer:i===!0&&s==="Meta description"}),p.jsx(ok,{label:o("propertyPanel.ogImage"),fieldKind:"url",blockType:"Page",value:e.ogImage??"",placeholder:"https://...",onCommit:a=>t("ogImage",a)})]})}function ok({label:e,fieldKind:t,blockType:n,value:r,placeholder:i,multiline:s,autosizeRows:o,recommendedMax:a,onCommit:u,onAiAssist:d,onAiQuickAction:f,aiLoading:m,fieldShimmer:g}){const[y,x]=E.useState(r),[v,S]=E.useState(!1),w=E.useRef(null),T=v?y:r,{debouncedCommit:A,flushCommit:M}=Yd(u,400),j=s===!0&&o!=null,D=E.useCallback(()=>{if(!j||!w.current||!o)return;const L=w.current,F=getComputedStyle(L),q=Number.parseFloat(F.lineHeight),W=Number.parseFloat(F.fontSize)||15,K=Number.isFinite(q)?q:W*1.2,Y=(Number.parseFloat(F.paddingTop)||0)+(Number.parseFloat(F.paddingBottom)||0),V=(Number.parseFloat(F.borderTopWidth)||0)+(Number.parseFloat(F.borderBottomWidth)||0),O=o.min*K+Y+V,U=o.max*K+Y+V;L.style.height="0px";const Q=L.scrollHeight,le=Math.max(O,Math.min(U,Q));L.style.height=`${le}px`,L.style.overflowY=Q>U?"auto":"hidden"},[j,o]);E.useLayoutEffect(()=>{D()},[D,T,v,r]),E.useEffect(()=>{if(!j)return;const L=()=>D();return window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[j,D]);const P={placeholder:i,value:T,onFocus:()=>{x(r),S(!0)},onChange:L=>{x(L.target.value),A(L.target.value)},onBlur:()=>{S(!1),M()}},R=(v?y:r).length;return p.jsxs("div",{className:"property-field",children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:e})}),p.jsxs("div",{className:`property-field-input-wrap${g?" property-field-input-wrap--ai-loading":""}`,children:[s?p.jsx("textarea",{ref:j?w:void 0,className:`property-field-textarea${j?" property-field-textarea--autosize":""}`,rows:(o==null?void 0:o.min)??3,...P}):p.jsx("input",{type:"text",className:"property-field-input",...P}),d?p.jsx(lp,{onClick:d,fieldKind:t,fieldLabel:e,blockType:n,currentValue:v?y:r,onQuickAction:f,onCustomPrompt:d,aiLoading:g}):null]}),a!=null&&p.jsxs("span",{className:`property-field-char-count${R>a?" property-field-char-count--over":""}`,children:[R," / ",a]})]})}class ak extends E.Component{constructor(){super(...arguments);Te(this,"state",{error:null});Te(this,"reset",()=>{var n,r;(r=(n=this.props).onReset)==null||r.call(n),this.setState({error:null})})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){var i,s;console.error("[editor] Uncaught error in component tree:",n,r.componentStack),(s=(i=this.props).onError)==null||s.call(i,n,r)}render(){return this.state.error?p.jsxs("div",{style:this.props.style,className:"flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground h-full",children:[p.jsx("p",{className:"font-medium text-foreground",children:this.props.fallbackLabel??"Something went wrong"}),p.jsx("p",{className:"max-w-xs opacity-70 text-xs",children:this.state.error.message}),p.jsx("button",{type:"button",onClick:this.reset,className:"rounded-md border px-3 py-1.5 text-xs hover:bg-accent transition-colors",children:"Try again"})]}):this.props.children}}function Wve({siteId:e,orchestratorUrl:t,hostedIds:n,siteOwnOrchestrator:r}){const{t:i}=Mn(),s=()=>{uce(e),window.location.href=cce(window.location.href)},o=()=>{r&&(lce(e,r),window.location.reload())};return r?p.jsxs("div",{className:"orchestrator-mismatch",role:"alert",children:[p.jsxs("div",{className:"orchestrator-mismatch-body",children:[p.jsx("strong",{children:i("orchestratorMismatch.ownTitle")}),p.jsx("span",{children:i("orchestratorMismatch.ownDetail",{orchestrator:t,siteOrchestrator:r})})]}),p.jsx("button",{type:"button",className:"orchestrator-mismatch-action",onClick:o,children:i("orchestratorMismatch.useSiteOwn")})]}):p.jsxs("div",{className:"orchestrator-mismatch",role:"alert",children:[p.jsxs("div",{className:"orchestrator-mismatch-body",children:[p.jsx("strong",{children:i("orchestratorMismatch.title")}),p.jsx("span",{children:n.length>0?i("orchestratorMismatch.detailHosts",{orchestrator:t,hosted:n.join(", ")}):i("orchestratorMismatch.detail",{orchestrator:t})})]}),p.jsx("button",{type:"button",className:"orchestrator-mismatch-action",onClick:s,children:i("orchestratorMismatch.useDefault")})]})}const Ag=3e3;function Zve(e){const[t,n]=E.useState({status:"loading",blocks:[],manifest:null});E.useEffect(()=>{let i=!0,s=null;const o=async()=>{try{const u=await fetch(`${e||Vd}/api/editor/blocks`);if(!u.ok){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:`Manifest endpoint returned ${u.status}`}),s=setTimeout(()=>{i&&o()},Ag);return}const d=await u.json(),f=lj.safeParse(d);if(!f.success){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:"Manifest response shape is invalid"}),s=setTimeout(()=>{i&&o()},Ag);return}const m=fj(f.data.blocks);if(m){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:m}),s=setTimeout(()=>{i&&o()},Ag);return}if(!i)return;n({status:"ready",blocks:f.data.blocks,version:f.data.version,manifest:f.data})}catch(a){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:a instanceof Error?a.message:"Manifest fetch failed"}),s=setTimeout(()=>{i&&o()},Ag)}};return o(),()=>{i=!1,s&&clearTimeout(s)}},[e]);const r=E.useMemo(()=>{const i=new Map;for(const s of t.blocks)i.set(s.type,s);return i},[t.blocks]);return{...t,byType:r,siteCapabilities:{allowStructuralEdits:t.status==="ready",manifestStatus:t.status,reason:t.reason,manifestVersion:t.version,blockCount:t.blocks.length,checkedAt:new Date().toISOString()},allowStructuralEdits:t.status==="ready"}}function Yve(e){const[t,n]=E.useState(void 0);return E.useEffect(()=>{if($k)return;let r=!1;return ace(e).then(i=>{r||!i||i.replace(/\/+$/,"")!==Be.replace(/\/+$/,"")&&n(i)}),()=>{r=!0}},[e]),t}function Jve(e){const t=e==null?void 0:e.trim().toLowerCase();return t?t==="text"?"text":t==="legacy"||t==="sparkle"||t==="dots"||t==="sparkle-dots"?"legacy":null:null}function Xve(){const e=Jve(Ni().VITE_STREAMING_INDICATOR_STYLE);return e||"text"}const Qve=/^[a-z]{2}(?:-[a-z0-9]{2,8})?$/i,Ol="default",eke=2;let th;function tke(e){if(!Qve.test(e))return!1;if(th===void 0)try{th=new Intl.DisplayNames(["en"],{type:"language",fallback:"none"})}catch{th=null}if(!th)return!1;try{return typeof th.of(e)=="string"}catch{return!1}}function ly(e){return e.split("/").filter(Boolean)}function tc(e){const t=ly(e);return t.length===0?"/":`/${t.join("/")}`}function nke(e){const t={},n=[];for(const u of e){const d=ly(u)[0];if(d&&tke(d)){const f=d.toLowerCase();(t[f]||(t[f]=[])).push(u)}else n.push(u)}const r=Object.keys(t).sort();if(r.length<2)return null;const i=new Map;for(const u of r)for(const d of new Set(t[u].map(f=>pC(f,u))))i.set(d,(i.get(d)??0)+1);if(![...i.values()].some(u=>u>=2))return null;const o=n.filter(u=>i.has(tc(u))).length>=eke,a=o?[]:n;o&&(t[Ol]=n,r.unshift(Ol));for(const u of r){const d=u===Ol?"/":`/${u}`;t[u].sort((f,m)=>f===d?-1:m===d?1:0)}return{locales:r,byLocale:t,shared:a}}function YL(e,t){var i;const n=(i=ly(e)[0])==null?void 0:i.toLowerCase();if(n&&t.byLocale[n])return n;const r=t.byLocale[Ol];return r!=null&&r.some(s=>tc(s)===tc(e))?Ol:void 0}function pC(e,t){var i;if(!t||t===Ol)return tc(e);const n=ly(e);if(((i=n[0])==null?void 0:i.toLowerCase())!==t.toLowerCase())return tc(e);const r=n.slice(1);return r.length===0?"/":`/${r.join("/")}`}function rke(e,t){return`${V4(pC(e,t))} (${e})`}function ike(e,t,n){const r=n.byLocale[t];if(!r||r.length===0)return e;const i=pC(e,YL(e,n)),s=t===Ol?i:i==="/"?`/${t}`:`/${t}${i}`;return r.find(a=>tc(a)===tc(s))??r[0]}function ske(e){try{const t=new Intl.DisplayNames([e],{type:"language"}).of(e);if(t&&t.toLowerCase()!==e.toLowerCase())return t.charAt(0).toUpperCase()+t.slice(1)}catch{}return e.toUpperCase()}const nR=Xve(),oke=!1,ake=dd||oke,lke=xG(),uke=E.lazy(()=>HB(()=>import("./PuckPrototypeRoute-DRZlpZPw.js").then(e=>e.P),__vite__mapDeps([0,1])).then(e=>({default:e.PuckPrototypeRoute}))),cke=new Set(["/editor/puck","/editor/puck/"]),dke=3e4,JL="site-reachable-v1:",fke=5e3;function XL(e){if(typeof sessionStorage>"u")return null;try{const t=sessionStorage.getItem(JL+e);if(!t)return null;const n=JSON.parse(t);return Date.now()-n.ts>dke?null:n.ok}catch{return null}}function rR(e,t){if(!(typeof sessionStorage>"u"))try{sessionStorage.setItem(JL+e,JSON.stringify({ok:t,ts:Date.now()}))}catch{}}function hke({name:e,origin:t,statusClass:n,active:r,dimmed:i,onSelect:s}){const o=t.replace(/^https?:\/\//,"");return p.jsxs("button",{type:"button",role:"menuitem",className:`site-switcher-item${r?" is-active":""}${i?" is-dimmed":""}`,onClick:s,title:t,children:[p.jsx("span",{className:`site-switcher-item-dot site-switcher-item-dot-${n}`,"aria-hidden":"true"}),p.jsxs("span",{className:"site-switcher-item-body",children:[p.jsx("span",{className:"site-switcher-item-name",children:e}),p.jsx("span",{className:"site-switcher-item-origin",children:o})]}),r?p.jsx(Fd,{size:12,"aria-hidden":"true"}):null]})}function iR(e){if(typeof sessionStorage>"u")return null;const t=new Set;let n=!1;for(const r of e){const i=XL(r);i!==null&&(n=!0,i&&t.add(r))}return n?t:null}function pke(e,t){if(e===t)return!0;if(!e||!t||e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function mke(){const e=typeof window<"u"?window.location.pathname:"/",t=e==="/"||e==="/editor"||e==="/editor/",n=cke.has(e),r=e==="/sites"||e==="/sites/";fe(d=>d.chatDarkMode);const i=fe(d=>d.setChatDarkMode),s=E.useMemo(()=>Iw(),[]),o=E.useMemo(()=>Q4(),[]),a=E.useRef(!1);a.current||(a.current=!0,zG({sessionId:s,siteId:o}));const u=fce(o,s);return E.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia("(prefers-color-scheme: dark)"),f=m=>{pw()===null&&i(m.matches,{persist:!1})};return d.addEventListener("change",f),()=>d.removeEventListener("change",f)},[i]),n?p.jsx(E.Suspense,{fallback:p.jsx("div",{style:{height:"100vh",display:"grid",placeItems:"center"},children:"Loading prototype…"}),children:p.jsx(uke,{})}):r?p.jsx(RN,{sites:u,session:s}):t?p.jsx(bke,{sites:u}):p.jsx(RN,{sites:u,session:s})}function gke(e){return e.split(".").map(t=>{const n=t.match(/^([a-zA-Z_]+)\[(\d+)\]$/);return n?`${sR(n[1])} ${Number(n[2])+1}`:sR(t)}).join(" · ")}function sR(e){const n=e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s*url\s*$/i,"").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e}function bke({sites:e}){var sf,of,fc;const{t}=Mn(),n=Bi(),r=Fi(),i=fe(_=>_.chatDarkMode),s=fe(_=>_.chatThemePreference),o=fe(_=>_.setChatThemePreference),{activeSiteConfig:a}=e,u=E.useMemo(()=>Pu(a),[a]),d=Zve(u),f=typeof window<"u"?window.location.origin:"http://localhost:4100",m=Yve(u),g=e.siteHosting==="notHosted"||m!=null,y=fe(_=>_.slug),x=fe(_=>_.setSlug),v=fe(_=>_.availableSlugs);fe(_=>_.setAvailableSlugs);const S=fe(_=>_.isLoadingSlugs),w=fe(_=>_.modelKey),T=fe(_=>_.setModelKey),A=fe(_=>_.provider),M=fe(_=>_.setProvider),j=fe(_=>_.availableProviders),D=fe(_=>_.setAvailableProviders),[P,R]=E.useState(""),L=fe(_=>_.activeBlockId),F=fe(_=>_.activeBlockType),q=fe(_=>_.activeEditablePath),W=_=>fe.getState().setActiveBlock(_),K=_=>{const G=fe.getState();G.setActiveBlock(G.activeBlockId,_)},Y=(_,G)=>fe.getState().setActiveBlock(_,G),V=fe(_=>_.setActiveEditablePath),O=fe(_=>_.useStreaming),U=fe(_=>_.setUseStreaming),Q=fe(_=>_.autoScrollTrackingEnabled),le=fe(_=>_.setAutoScrollTrackingEnabled),I=fe(_=>_.autoOpenPropertiesEnabled),$=fe(_=>_.setAutoOpenPropertiesEnabled),[X,z]=E.useState(!1),[Z,se]=E.useState(lke),ee=E.useCallback(_=>{se(_);try{window.localStorage.setItem(wk,_?"1":"0")}catch{}},[]),ne=E.useMemo(()=>!dd||new URLSearchParams(window.location.search).has("dev"),[]),Ae=ne&&Z,[_e,ze]=E.useState(!1),[ce,ve]=E.useState(0),Oe=E.useCallback(()=>ve(_=>_+1),[]),oe=fe(_=>_.showSettingsModal),He=fe(_=>_.setShowSettingsModal),$e=fe(_=>_.showDebugDetails),bt=fe(_=>_.setShowDebugDetails),Gt=fe(_=>_.composerHeight),Ct=fe(_=>_.setComposerHeight),ct=fe(_=>_.addBlockPicker),Xt=fe(_=>_.setAddBlockPicker),kt=fe(_=>_.addBlockSearch),St=fe(_=>_.setAddBlockSearch),nt=fe(_=>_.isAddingBlock),gn=fe(_=>_.setIsAddingBlock),he=fe(_=>_.copiedDebugEntryId),me=fe(_=>_.setCopiedDebugEntryId),Fe=fe(_=>_.feedbackNoteEntryId),et=fe(_=>_.setFeedbackNoteEntryId),ft=fe(_=>_.feedbackNoteText),Ot=fe(_=>_.setFeedbackNoteText),cr=fe(_=>_.selectedVariationId),fn=fe(_=>_.setSelectedVariationId),Nt=fe(_=>_.imagePickerTarget),zn=fe(_=>_.setImagePickerTarget),tn=Nt!==null,Tr=fe(_=>_.backendFeatures),Ar=fe(_=>_.setBackendFeatures),ke=fe(_=>_.setBackendSite),Ue=fe(_=>_.selectionModeEnabled),ge=fe(_=>_.setSelectionModeEnabled),je=fe(_=>_.anchorRect),Le=fe(_=>_.setAnchorRect),Pe=fe(_=>_.anchoredExpanded),tt=fe(_=>_.setAnchoredExpanded),Ke=fe(_=>_.activeTab),ht=fe(_=>_.setActiveTab),[Bt,Wt]=E.useState(!1),[wn,Ln]=E.useState(!1),nr=E.useRef(null);E.useEffect(()=>{if(!wn)return;const _=ie=>{nr.current&&!nr.current.contains(ie.target)&&Ln(!1)},G=ie=>{ie.key==="Escape"&&Ln(!1)};return document.addEventListener("mousedown",_),document.addEventListener("keydown",G),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("keydown",G)}},[wn]);const[Gi,Gs]=E.useState(()=>iR(e.siteList.map(_=>_.id))),qr=E.useCallback(_=>{Gs(G=>pke(G,_)?G:_)},[]);E.useEffect(()=>{if(!wn)return;qr(iR(e.siteList.map(ie=>ie.id)));let _=!0;return(async()=>{let ie=!0;const Ce=await Promise.all(e.siteList.map(async De=>{const Ve=XL(De.id);if(Ve!==null)return{id:De.id,ok:Ve};ie=!1;const Qe=Pu(De);try{const pn=await fetch(`${Qe}/api/editor/blocks?siteId=${encodeURIComponent(De.id)}`,{signal:AbortSignal.timeout(2500)});return rR(De.id,pn.ok),{id:De.id,ok:pn.ok}}catch{return rR(De.id,!1),{id:De.id,ok:!1}}}));_&&!ie&&qr(new Set(Ce.filter(De=>De.ok).map(De=>De.id)))})(),()=>{_=!1}},[wn,e.siteList,qr]);const Kr=E.useMemo(()=>{const _=Gi===null;return e.siteList.map(G=>{const ie=_||G.id===r||Gi.has(G.id);return{site:G,origin:Pu(G),online:ie,probing:_}}).sort((G,ie)=>G.site.id===r?-1:ie.site.id===r?1:G.online!==ie.online?G.online?-1:1:G.site.name.localeCompare(ie.site.name))},[Gi,e.siteList,r]),{onlineEntries:Ws,activeEntry:Nr}=E.useMemo(()=>({onlineEntries:Kr.filter(_=>_.online),activeEntry:Kr.find(_=>_.site.id===r)}),[Kr,r]),jt=E.useRef(null),Bn=E.useRef(null),jr=E.useRef(!0),ks=E.useRef(!1),Ss=E.useRef(null),bi=E.useRef(void 0),mr=E.useRef(!1),Wi=E.useRef(null),Zi=E.useRef(!1),si=E.useRef(0),oi=E.useRef(null),Fn=E.useRef(null),an=fe(_=>_.chatWidth),Mt=fe(_=>_.setChatWidth),ws=fe(_=>_.propsWidth),Gr=fe(_=>_.setPropsWidth),gr=E.useRef(null),Wr=E.useRef(null),[Yi,Go]=E.useState(1),Cs=E.useRef(null),go=E.useRef(null),Ji=E.useRef(!1),Es=E.useRef(!1);E.useEffect(()=>{if(!Es.current&&!(S||v.length===0)){if(y!=="/"||v.includes("/")){Es.current=!0;return}Es.current=!0,mr.current=!1,x(v[0])}},[v,S,y,x]);const Ir=E.useMemo(()=>{const _=Array.from(new Set([...v,y].filter(Boolean)));return _.includes("/")?["/",..._.filter(G=>G!=="/")]:_},[v,y]),hn=E.useMemo(()=>nke(Ir),[Ir]),Or=hn?YL(y,hn)??hn.locales[0]:void 0,Wo=E.useMemo(()=>!hn||!Or?Ir:hn.byLocale[Or]??[],[hn,Or,Ir]),Xi=E.useMemo(()=>{if(!d.allowStructuralEdits)return[];if(d.blocks.length>0)return d.blocks.map(G=>({type:G.type,label:G.displayName??G.type,category:"content"})).sort((G,ie)=>G.label.localeCompare(ie.label));const _=Au();return[...bk].map(G=>{var ie,Ce;return{type:G,label:((ie=_[G])==null?void 0:ie.displayName)??G,category:((Ce=_[G])==null?void 0:Ce.category)??"content"}}).sort((G,ie)=>G.label.localeCompare(ie.label))},[d.allowStructuralEdits,d.blocks]),ja=E.useMemo(()=>{const _=kt.trim().toLowerCase(),G=_?Xi.filter(De=>De.label.toLowerCase().includes(_)||De.type.toLowerCase().includes(_)):Xi,ie=new Map;for(const De of G){const Ve=De.category||"content",Qe=ie.get(Ve);Qe?Qe.push(De):ie.set(Ve,[De])}const Ce=["content","layout","conversion","navigation","media"];return[...ie.entries()].sort((De,Ve)=>{const Qe=Ce.indexOf(De[0]),pn=Ce.indexOf(Ve[0]),rr=Qe===-1?Number.MAX_SAFE_INTEGER:Qe,En=pn===-1?Number.MAX_SAFE_INTEGER:pn;return rr!==En?rr-En:De[0].localeCompare(Ve[0])}).map(([De,Ve])=>({category:De,options:Ve}))},[kt,Xi]),Mi=()=>{const _=Date.now();_-si.current<1200||(si.current=_,Ge.pushAssistantFromResult({status:"needs_clarification",summary:t("streamError.structuralDisabled"),changes:SP(d.reason)}))},eu=E.useRef(()=>{}),Cn=E.useCallback(_=>{fe.getState().slug!==_&&(Zi.current=!0,x(_))},[x]),Zs=E.useMemo(()=>({onBlockClicked:(_,G,ie,Ce,De,Ve)=>{Cn(_),Y(G,ie),V(Ce),Le(G?Ve:null);const Qe=fe.getState();G?Qe.autoOpenPropertiesEnabled&&Qe.setActiveTab("properties"):Qe.setActiveTab("chat")},onRouteChanged:_=>{fe.getState().slug!==_&&Y(void 0,void 0),Cn(_),V(void 0),Le(null),yi.current("setSelectionMode",{enabled:fe.getState().selectionModeEnabled}),eu.current(_)},onBlockReordered:(_,G,ie)=>{if(!d.allowStructuralEdits){Mi();return}_!==y&&Cn(_),V(void 0),Ge.reorderBlock(_,G,ie)},onBlockDeleteRequested:(_,G)=>{if(!d.allowStructuralEdits){Mi();return}_!==y&&Cn(_),V(void 0),Ge.deleteBlock(_,G)},onBlockAddRequested:(_,G)=>{if(!d.allowStructuralEdits){Mi();return}_!==y&&Cn(_),!(!G.afterBlockId&&!G.beforeBlockId)&&Xt({slug:_,afterBlockId:G.afterBlockId,beforeBlockId:G.beforeBlockId})},onListItemAddRequested:(_,G,ie,Ce,De)=>{if(!d.allowStructuralEdits){Mi();return}_!==y&&Cn(_),V(void 0),Ge.addListItem(_,G,ie,Ce,De)},onListItemRemoveRequested:(_,G,ie,Ce,De)=>{if(!d.allowStructuralEdits){Mi();return}_!==y&&Cn(_),V(void 0),Ge.removeListItem(_,G,ie,Ce,De)},onListItemMoveRequested:(_,G,ie,Ce,De,Ve)=>{if(!d.allowStructuralEdits){Mi();return}_!==y&&Cn(_),V(void 0),Ge.moveListItem(_,G,ie,Ce,De,Ve)},onOpenImagePicker:(_,G,ie,Ce,De)=>{zn({slug:_,blockId:G,editablePath:ie,currentUrl:Ce,blockType:De??(G===L?F:void 0)})},onEditBlockRequested:(_,G)=>{tt(!0)},onInlineTextCommitted:(_,G,ie,Ce)=>{_!==y&&Cn(_),ie&&V(ie),Ge.inlineEditCommit(_,G,ie,Ce)},onIframeScrolled:()=>{Le(null),fe.getState().isLoading&&fe.getState().setAutoScrollSuppressed(!0)}}),[d.allowStructuralEdits,Cn,y]),Ia=E.useCallback(async()=>{var _;try{const G=`${Be}/draft/pages?session=${encodeURIComponent(n)}&siteId=${encodeURIComponent(r)}&slug=${encodeURIComponent(y)}`,ie=await fetch(G,{cache:"no-store"});if(!ie.ok)return;const De=((await ie.json()).blocks??[]).find(Ve=>Ve.type==="Hero");if(!De)return;Y(De.id,De.type),zn({slug:y,blockId:De.id,editablePath:"imageUrl",currentUrl:typeof((_=De.props)==null?void 0:_.imageUrl)=="string"?De.props.imageUrl:void 0,blockType:De.type})}catch{}},[n,r,y,zn]),Qt=hce(y,Zs,u),yi=E.useRef(Qt.postToSite);E.useEffect(()=>{yi.current=Qt.postToSite},[Qt.postToSite]);const Ys=E.useCallback(_=>{const G=_??!Ue;ge(G),Qt.postToSite("setSelectionMode",{enabled:G})},[Ue,Qt]);E.useEffect(()=>{const _=G=>{G.key==="Escape"&&Ue&&Ys(!1)};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[Ue,Ys]),E.useEffect(()=>{if(Ke!=="history")return;const _=G=>{G.key==="Escape"&&fe.getState().setActiveTab("chat")};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[Ke]);const Zo=E.useCallback((_,G)=>{(_==="draftUpdated"||_==="liveDraft")&&Oe(),Qt.postToSite(_,G)},[Qt,Oe]),xi=E.useCallback((_,G,ie,Ce)=>(Oe(),Qt.postPatchToSite(_,G,ie,Ce)),[Qt,Oe]),Ge=xce({activeSiteConfig:a,siteRegistryChecked:e.siteRegistryChecked,postToSite:Zo,postPatchToSite:xi,componentManifest:d.manifest,siteCapabilities:d.siteCapabilities,allowStructuralEdits:d.allowStructuralEdits,getBlockDefaultProps:_=>{var G;return((G=d.byType.get(_))==null?void 0:G.defaultProps)??null},onApplied:()=>{var _;(_=bi.current)==null||_.call(bi)},agentModeEnabled:Tr.agentMode??!1}),ai=fe(_=>_.chatLog),Oa=fe(_=>_.chatAttachments),bo=fe(_=>_.setChatAttachments),Kn=fe(_=>_.isLoading),br=fe(_=>_.streamStatus),Js=fe(_=>_.streamingText),Qi=fe(_=>_.streamingChanges),tu=fe(_=>_.streamSteps),Xs=fe(_=>_.streamTokenCount),es=fe(_=>_.latestStreamFocusBlockId),Pr=fe(_=>_.imageProgress),Di=fe(_=>_.plannerBadgeState),[yo,_s]=E.useState(!1),Qs=fe(_=>_.setPlannerBadgeState),dt=fe(_=>_.pendingPlanId),mt=fe(_=>_.variationModal),we=fe(_=>_.isApplyingVariation),Pt=fe(_=>_.setVariationModal),Ri=fe(_=>_.continuationChainId),vi=fe(_=>_.fieldDraftDebugEnabled),li=fe(_=>_.setFieldDraftDebugEnabled),zr=fe(_=>_.fieldDraftDebug);E.useEffect(()=>{X4.has(r)||(T("balanced"),Ge.clearChat())},[r]);function it(_){var G,ie;typeof _.navigateToSlug=="string"&&_.navigateToSlug.length>0&&_.navigateToSlug!==y&&x(_.navigateToSlug),typeof _.canUndo=="boolean"&&((G=Ge.setCanUndoServer)==null||G.call(Ge,_.canUndo)),typeof _.canRedo=="boolean"&&((ie=Ge.setCanRedoServer)==null||ie.call(Ge,_.canRedo)),Qt.postToSite("draftUpdated",{focusBlockId:null}),Oe()}async function xt(_){Wt(!0);try{const ie=await(await fetch(`${Be}/history/restore`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:n,siteId:r,targetVersion:_})})).json();ie.status==="applied"&&it(ie)}catch{}finally{Wt(!1)}}const _t=Sce(n,r,u,ce),Vt=kce(n,r,Kn,Ge.pushAssistantFromResult,u,()=>{Qt.postToSite("draftUpdated",{focusBlockId:null}),_t.markPublished()}),dr=_t.summary?_t.summary.total>0:!0,zt=wce(),bn=Ke==="properties"&&Ge.hasBootstrapped,ln=_ce(n,r,y,L,bn),nn=Tce(n,r,y,bn);E.useEffect(()=>{!L||F||!ln.blockType||K(ln.blockType)},[L,F,ln.blockType]);const Mr=$ee(n,r,!!n),nu=Uee(Mr.findings),Zr=E.useRef(null),eo=E.useCallback((_,G,ie)=>{Y(_,G),V(ie),Le(null),fe.getState().selectionModeEnabled||(fe.getState().setSelectionModeEnabled(!0),yi.current("setSelectionMode",{enabled:!0})),yi.current("highlightBlock",{blockId:_,editablePath:ie??null,scrollIntoView:!0})},[]),xo=E.useCallback(_=>{const G=Zr.current;!G||G.slug!==_||(Zr.current=null,!(G.expiresAt!==void 0&&Date.now()>G.expiresAt)&&eo(G.blockId,G.blockType,G.path))},[eo]);E.useEffect(()=>{if(!Zr.current)return;const _=setTimeout(()=>xo(y),400);return()=>clearTimeout(_)},[y,xo]),E.useEffect(()=>{eu.current=xo},[xo]);const uy=E.useCallback((_,G,ie,Ce)=>{if(!G){_!==fe.getState().slug&&x(_),Y(void 0,void 0),V(void 0),ht("properties");return}if(_!==fe.getState().slug){Zr.current={slug:_,blockId:G,blockType:ie,path:Ce},x(_),ht("properties");return}ht("properties"),Zr.current={slug:_,blockId:G,...ie?{blockType:ie}:{},...Ce?{path:Ce}:{},expiresAt:Date.now()+fke},eo(G,ie,Ce)},[eo]);bi.current=()=>{ln.refetch(),nn.refetch(),Oe()};const[cc,cy]=E.useState(()=>Uk(y,{session:n,siteId:r,editorOrigin:f},u)),[dy,Tp]=E.useState(!1);E.useEffect(()=>{Tp(!1)},[cc]),E.useEffect(()=>{Wi.current!==u&&(Wi.current=u,mr.current=!1);const _={session:n,siteId:r,editorOrigin:f};if(Zi.current){Zi.current=!1;return}if(e0&&mr.current){Qt.postToSite("navigate",{href:Hk(y,_)});return}const G=Uk(y,_,u);cy(ie=>ie===G?ie:G)},[u,f,n,r,y]);const Ap=E.useMemo(()=>{var ie;const _=(ie=a.vercelProductionUrl)==null?void 0:ie.trim(),G=_&&/^https?:\/\//i.test(_)?_:u;try{const Ce=new URL(G);return Ce.origin===u?xee(y,{},u):(Ce.pathname=y==="/"?"/":y,Ce.search="",Ce.hash="",Ce.toString())}catch{return}},[a.vercelProductionUrl,u,y]),Np=E.useMemo(()=>u?`${u}${Hk(y,{session:n,siteId:r,editorOrigin:f,immersive:"1"})}`:void 0,[u,f,n,r,y]);E.useEffect(()=>{let _=!0;const G=async()=>{const Ce=[`${Be}/status/planner`];Be.includes("localhost")&&Ce.push(`${Be.replace("localhost","127.0.0.1")}/status/planner`);try{for(const De of Ce){const Ve=await fetch(De);if(!Ve.ok)continue;const Qe=await Ve.json();if(!_)return;if(Qe.features&&Ar(Qe.features),Qe.site&&ke(Qe.site),Array.isArray(Qe.availableProviders)&&Qe.availableProviders.length>0&&(D(Qe.availableProviders),(!Qe.availableProviders.includes(A)||A!=="anthropic"&&Qe.availableProviders.includes("anthropic"))&&M(Qe.availableProviders.includes("anthropic")?"anthropic":Qe.availableProviders[0])),typeof Qe.keyFilePath=="string"&&Qe.keyFilePath.length>0&&fe.getState().setKeyFilePath(Qe.keyFilePath),Qe.plannerSource==="openai"||Qe.plannerSource==="anthropic"||Qe.plannerSource==="gemini"||Qe.plannerSource==="demo"){Qs(Qe.plannerSource);return}}_&&Qs("error")}catch{_&&Qs("error")}};G();const ie=window.setInterval(()=>{G()},1e4);return()=>{_=!1,window.clearInterval(ie)}},[]);const Qd=E.useRef(0),Mp=E.useRef(0);E.useEffect(()=>{const _=Bn.current;if(!_)return;const G=()=>{const ie=Math.abs(_.scrollHeight-_.scrollTop-_.clientHeight)<2||_.scrollHeight<=_.clientHeight;!ie&&_.scrollTop<Qd.current?jr.current=!1:ie&&(jr.current=!0),Qd.current=_.scrollTop};return _.addEventListener("scroll",G,{passive:!0}),()=>{_.removeEventListener("scroll",G)}},[]),E.useEffect(()=>{const _=Bn.current;if(!_||!(ai.length>0||!!br||!!Js))return;const ie=ai.reduce((pn,rr)=>rr.role==="user"?pn+1:pn,0);ie>Mp.current&&(jr.current=!0),Mp.current=ie;const Ce=!ks.current,De=ai.some(pn=>pn.role==="user");if(Ce&&!De&&!br&&!Js){ks.current=!0,jr.current=!1;return}if(!Ce&&!jr.current)return;const Qe=window.requestAnimationFrame(()=>{_.scrollTop=_.scrollHeight,jr.current=!0,ks.current=!0});return()=>window.cancelAnimationFrame(Qe)},[ai.length,br,Js,tu.length,Qi.length]),E.useEffect(()=>{Qt.postToSite("setNestedLabelsVisibility",{visible:X})},[X]),E.useEffect(()=>{const _=yi.current;if(!Kn){Ji.current&&_("aiFieldLoading",{blockId:"",active:!1}),go.current=null,Ji.current=!1;return}const G=es??L??"",Ce=G&&G===(L??"")?q??"":"";_("aiFieldLoading",{blockId:G,editablePath:Ce,active:!0}),go.current={blockId:G,editablePath:Ce},Ji.current=!0},[Kn,es,L,q]),E.useEffect(()=>{if(!Kn)return;const _=window.setInterval(()=>{const G=go.current;G&&yi.current("aiFieldLoading",{blockId:G.blockId,editablePath:G.editablePath,active:!0})},1200);return()=>window.clearInterval(_)},[Kn]),E.useEffect(()=>{L&&Qt.postToSite("highlightBlock",{blockId:L,editablePath:q??null})},[L,q]),E.useEffect(()=>{Ge.clearFieldAiContext()},[L]),E.useEffect(()=>{L||Le(null)},[L]),E.useEffect(()=>{tt(!1)},[je]),E.useEffect(()=>{const _=()=>Le(null);return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const fy=RG(),Pa=E.useMemo(()=>{if(!fy||!je||!Ue||!L||typeof window>"u"||window.innerWidth<=1040)return null;const _=Qt.iframeRef.current;if(!_)return null;const G=_.getBoundingClientRect(),ie=380,Ce=36,De=26,Ve=8,Qe=G.top+je.top*Yi;if(Qe+je.height*Yi<G.top||Qe>G.bottom)return null;const rr=Qe+Ve-(Ce-De)/2;let En=G.left+(je.left+je.width)*Yi-Ce-Ve;return En=Math.max(G.left+Ve,Math.min(En,G.right-Ce-Ve)),{top:rr,left:En,width:ie}},[je,Ue,L,Qt.iframeRef,Yi]);E.useEffect(()=>{Pa&&Pe&&requestAnimationFrame(()=>{var _,G;(G=(_=Cs.current)==null?void 0:_.querySelector("textarea"))==null||G.focus()})},[!!Pa,Pe]);const hy=E.useCallback((_,G,ie,Ce)=>{var rr;if(!L||!F)return;const Ve=((rr=Au()[F])==null?void 0:rr.displayName)??F;V(_);const Qe=dS(ie,G,F,Ce),pn={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: ${Ve} → ${G}`,fieldAiContext:{blockId:L,blockType:F,fieldPath:_,fieldLabel:G,blockDisplayName:Ve},suggestions:Qe};Ge.setFieldAiContext(pn)},[L,F]),ef=E.useCallback((_,G,ie)=>{const Ce=dS(G,_,"Page",ie),De={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: Page → ${_}`,fieldAiContext:{blockId:"__page__",blockType:"__page__",fieldPath:_,fieldLabel:_,blockDisplayName:"Page"},suggestions:Ce};Ge.setFieldAiContext(De)},[]),py=E.useCallback((_,G,ie,Ce,De)=>{var rr;if(!L||!F)return;const Qe=((rr=Au()[F])==null?void 0:rr.displayName)??F;V(_),Qt.postToSite("aiFieldLoading",{blockId:L,editablePath:_,active:!0}),go.current={blockId:L,editablePath:_},Ji.current=!0;const pn={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: ${Qe} → ${G}`,fieldAiContext:{blockId:L,blockType:F,fieldPath:_,fieldLabel:G,blockDisplayName:Qe}};Ge.setFieldAiContext(pn),Ge.submitChat(De)},[L,F]),my=E.useCallback((_,G,ie,Ce)=>{V(_);const De={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: Page → ${_}`,fieldAiContext:{blockId:"__page__",blockType:"__page__",fieldPath:_,fieldLabel:_,blockDisplayName:"Page"}};Ge.setFieldAiContext(De),Ge.submitChat(Ce)},[]);E.useEffect(()=>{Ge.refreshRouteSlugs()},[n,r,e.siteRegistryChecked]);const tf=_=>{const ie=jt.current,Ce=Bn.current;if(!ie||!Ce)return Math.max(56,_);const De=120,Ve=10,Qe=Ce.offsetTop,pn=Math.max(56,ie.clientHeight-Qe-Ve-De);return Math.min(pn,Math.max(56,_))},Dp=E.useCallback(_=>{Ct(G=>{const ie=tf(_);return ie===G?G:ie})},[]);E.useEffect(()=>{const _=ie=>{const Ce=oi.current;if(Ce){const Ve=ie.clientY-Ce.y,Qe=tf(Ce.composerHeight-Ve);Ct(Qe)}const De=Fn.current;if(De){const Ve=ie.clientX-De.x;De.target==="chat"?Mt(_k(De.width+Ve)):Gr(Tk(De.width-Ve))}},G=()=>{const ie=!!Fn.current;oi.current=null,Fn.current=null,document.body.style.userSelect="",ie&&document.body.classList.remove("panel-resizing")};return window.addEventListener("pointermove",_),window.addEventListener("pointerup",G),()=>{window.removeEventListener("pointermove",_),window.removeEventListener("pointerup",G),document.body.style.userSelect="",document.body.classList.remove("panel-resizing")}},[]),E.useEffect(()=>{const _=()=>{Ct(G=>tf(G)),Mt(G=>G&&_k(G)),Gr(G=>G&&Tk(G))};return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[Mt,Gr]),E.useEffect(()=>{if(!mt)return;const _=G=>{G.key==="Escape"&&!we&&Pt(null)};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[mt,we]),E.useEffect(()=>{mt!=null&&mt.options.length?fn(mt.options[0].id):fn(null)},[mt]),E.useEffect(()=>{ct||St("")},[ct]),E.useEffect(()=>{if(!ct)return;const _=G=>{G.key==="Escape"&&!nt&&Xt(null)};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[ct,nt]);const nf=br?/failed|error/i.test(br):!1,[Rp,jp]=E.useState(0),gy=Pr==null?void 0:Pr.stage;E.useEffect(()=>{if(jp(0),!Kn)return;const _=window.setInterval(()=>jp(G=>G+1),1e3);return()=>window.clearInterval(_)},[Kn,br,gy]);const Ip=Kn&&!nf&&Rp>=5?` · ${Rp}s`:"",by=(Pr?Pr.stage:br??(Xs>0?t("stream.shapingUpdate"):t("stream.gettingReady")))+Ip,Op=(Pr?Pr.stage:br??(Xs>0?t("stream.updating"):t("stream.thinking")))+Ip,to=(br==null?void 0:br.match(/reconnecting(?:\s+agent\s+stream)?(?:\s+\((\d+)\/(\d+)\))?/i))??null,Pp=to!=null&&to[1]?Number(to[1]):null,dc=to!=null&&to[2]?Number(to[2]):null,vo=to?Pp&&dc?`Reconnect ${Pp}/${dc}`:"Reconnecting":null,zp=`field_draft ${zr.eventsPerSecond}/s · chars ${zr.charsPerSecond}/s · lag ${zr.typingLagChars}`,Lp={"--composer-height":`${Gt}px`},ko=Ke==="properties",za=Ke==="history",ru=Ke==="health",rf=E.useCallback(()=>{W(void 0),K(void 0),ht("chat")},[]);E.useLayoutEffect(()=>{const _=Wr.current,G=Qt.iframeRef.current;if(!_||!G)return;const ie=Ve=>{var ts;if(Ve?G.classList.remove("preview-iframe-no-transition"):G.classList.add("preview-iframe-no-transition"),!ko){G.style.removeProperty("width"),G.style.removeProperty("height"),G.style.removeProperty("transform"),Go(Ts=>Ts===1?Ts:1);return}const Qe=_.offsetWidth,pn=((ts=gr.current)==null?void 0:ts.offsetWidth)??0;if(Qe<=0||pn<=0)return;const rr=Qe+pn,En=Qe/rr;G.style.width=`${rr}px`,G.style.height=`${100/En}%`,G.style.transform=`scale(${En})`,Go(Ts=>Math.abs(Ts-En)<5e-4?Ts:En)};ie(!0);const Ce=new ResizeObserver(()=>ie(!1)),De=window.setTimeout(()=>{Ce.observe(_);const Ve=gr.current;Ve&&Ce.observe(Ve)},240);return()=>{window.clearTimeout(De),G.classList.remove("preview-iframe-no-transition"),Ce.disconnect()}},[ko,Qt.iframeRef]);const La={...an?{"--chat-width":`${an}px`}:{},...ws?{"--props-width":`${ws}px`}:{}},Bp=ai.some(_=>_.role==="user"),Fp=E.useCallback(_=>{const G=[];_.text&&G.push(_.text),_.status&&!_.canUndo&&_.status!=="needs_clarification"&&_.status!=="plan_ready"&&G.push(`status: ${_.status}`);const ie=(_.changes??[]).filter(Ce=>!q4(_.text,Ce));if(ie.length>0&&G.push(`changes: ${ie.join(`
768
+ `).length)),readOnly:!m.editable,value:j,onFocus:m.editable?P:void 0,onBlur:m.editable?R:void 0,onChange:m.editable?W=>{x(W.target.value),w(Mce(W.target.value))}:void 0})})]});if(t.kind==="headingLevel"){const W=(r&&sj[r])??"h2",K=g&&/^h[1-6]$/.test(g)?g:"";return p.jsxs("div",{className:"property-field",children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:D})}),p.jsxs("select",{className:"property-field-input property-field-select",value:K,onChange:Y=>i(Y.target.value),children:[p.jsxs("option",{value:"",children:["Auto (",W.toUpperCase(),")"]}),["h1","h2","h3","h4","h5","h6"].map(Y=>p.jsx("option",{value:Y,children:Hve[Y]},Y))]})]})}if(t.kind==="image")return p.jsxs("div",{className:"property-field",children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:D})}),p.jsx("div",{className:"property-field-image-url",title:g,children:g||"(empty)"})]});if(t.kind==="enum"&&t.options){const W=t.options.includes(g);return p.jsxs("div",{className:M,ref:A,children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:D})}),p.jsxs("select",{className:"property-field-input property-field-select",value:g,onChange:K=>i(K.target.value),children:[!W&&p.jsx("option",{value:g,children:g||"—"}),t.options.map(K=>p.jsx("option",{value:K,children:K},K))]})]})}if(t.kind==="boolean"){const W=g==="true"||g==="1";return p.jsx("div",{className:`${M} property-field--inline`,ref:A,children:p.jsxs("div",{className:"property-field-label",children:[p.jsxs("span",{children:[D,t.required&&p.jsx("span",{className:"property-field-required",children:"*"})]}),p.jsx("button",{type:"button",role:"switch","aria-checked":W,"aria-label":D,className:`property-field-switch${W?" is-on":""}`,onClick:()=>i(W?"false":"true"),children:p.jsx("span",{className:"property-field-switch-knob","aria-hidden":"true"})})]})})}if(t.kind==="color")return p.jsxs("div",{className:"property-field",children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:D})}),p.jsx("input",{type:"color",className:"property-field-color",value:g||"#000000",onChange:W=>i(W.target.value)})]});if(t.kind==="html")return p.jsxs("div",{className:M,ref:A,children:[p.jsx("div",{className:"property-field-label",children:p.jsxs("span",{children:[D,t.required&&p.jsx("span",{className:"property-field-required",children:"*"})]})}),p.jsx("div",{className:"property-field-input-wrap",children:p.jsx(Vve,{value:g,onCommit:W=>i(W),onFocus:P,onBlur:R,inline:t.inline})})]});if(t.kind==="richtext")return n!==null&&typeof n=="object"?p.jsxs("div",{className:M,ref:A,children:[p.jsx("div",{className:"property-field-label",children:p.jsxs("span",{children:[D,t.required&&p.jsx("span",{className:"property-field-required",children:"*"})]})}),p.jsx("div",{className:"property-field-input-wrap",children:p.jsx(KL,{value:n,onChange:W=>w(W),onFocus:P,onBlur:R,decorators:t.decorators,inline:t.inline})})]}):p.jsxs("div",{className:M,ref:A,children:[p.jsx("div",{className:"property-field-label",children:p.jsxs("span",{children:[D,t.required&&p.jsx("span",{className:"property-field-required",children:"*"})]})}),p.jsx("div",{className:`property-field-input-wrap${u?" property-field-input-wrap--ai-loading":""}`,children:p.jsx(Rve,{value:g,onChange:W=>{x(W),w(W)},onFocus:P,onBlur:R,trailing:s?p.jsx(lp,{variant:"toolbar",onClick:s,fieldKind:t.kind,fieldLabel:t.label??e,blockType:r??"",currentValue:g,onQuickAction:o,onCustomPrompt:s,aiLoading:u}):null})})]});const L=t.multiline===!0,F=t.kind==="number"?"number":t.kind==="url"?"url":"text",q={value:j,onFocus:P,onChange:W=>{x(W.target.value),w(W.target.value)},onBlur:R};return p.jsxs("div",{className:M,ref:A,children:[p.jsx("div",{className:"property-field-label",children:p.jsxs("span",{children:[D,t.required&&p.jsx("span",{className:"property-field-required",children:"*"})]})}),p.jsxs("div",{className:`property-field-input-wrap${u?" property-field-input-wrap--ai-loading":""}`,children:[L?p.jsx("textarea",{className:"property-field-textarea",rows:3,...q}):p.jsx("input",{type:F,className:"property-field-input",...q}),s?p.jsx(lp,{onClick:s,fieldKind:t.kind,fieldLabel:t.label??e,blockType:r??"",currentValue:g,onQuickAction:o,onCustomPrompt:s,aiLoading:u}):null]})]})}function Kve({slug:e,navLabel:t,onNavLabelChange:n,onAiAssist:r,onAiQuickAction:i,aiLoading:s,fieldShimmer:o}){const{t:a}=Mn(),[u,d]=E.useState(t),[f,m]=E.useState(!1),g=f?u:t,{debouncedCommit:y,flushCommit:x}=Yd(v=>n(e,v),400);return p.jsx(ay,{id:"page:nav",title:a("propertyPanel.navigation"),count:1,children:p.jsxs("div",{className:"property-field",children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:a("propertyPanel.navLabel")})}),p.jsxs("div",{className:`property-field-input-wrap${o?" property-field-input-wrap--ai-loading":""}`,children:[p.jsx("input",{type:"text",className:"property-field-input",placeholder:a("propertyPanel.navPlaceholder"),value:g,onFocus:()=>{d(t),m(!0)},onChange:v=>{d(v.target.value),y(v.target.value)},onBlur:()=>{m(!1),x()}}),r?p.jsx(lp,{onClick:()=>r("Nav label","text",t),fieldKind:"text",fieldLabel:"Nav label",blockType:"Page",currentValue:t,onQuickAction:i?v=>i("Nav label","text",t,v):void 0,onCustomPrompt:()=>r("Nav label","text",t),aiLoading:o}):null]})]})})}function Gve({pageMeta:e,onPageMetaChange:t,onAiAssist:n,onAiQuickAction:r,aiLoading:i,aiLoadingPath:s}){const{t:o}=Mn();return p.jsxs(ay,{id:"page:seo",title:o("propertyPanel.seo"),count:3,children:[p.jsx(ok,{label:o("propertyPanel.seoTitle"),fieldKind:"text",blockType:"Page",value:e.title??"",placeholder:o("propertyPanel.seoTitlePlaceholder"),multiline:!0,autosizeRows:{min:2,max:2},recommendedMax:60,onCommit:a=>t("title",a),onAiAssist:n?()=>n("SEO title","text",e.title??""):void 0,onAiQuickAction:r?a=>r("SEO title","text",e.title??"",a):void 0,aiLoading:i,fieldShimmer:i===!0&&s==="SEO title"}),p.jsx(ok,{label:o("propertyPanel.metaDescription"),fieldKind:"richtext",blockType:"Page",value:e.description??"",placeholder:o("propertyPanel.metaDescPlaceholder"),multiline:!0,autosizeRows:{min:3,max:6},recommendedMax:160,onCommit:a=>t("description",a),onAiAssist:n?()=>n("Meta description","richtext",e.description??""):void 0,onAiQuickAction:r?a=>r("Meta description","richtext",e.description??"",a):void 0,aiLoading:i,fieldShimmer:i===!0&&s==="Meta description"}),p.jsx(ok,{label:o("propertyPanel.ogImage"),fieldKind:"url",blockType:"Page",value:e.ogImage??"",placeholder:"https://...",onCommit:a=>t("ogImage",a)})]})}function ok({label:e,fieldKind:t,blockType:n,value:r,placeholder:i,multiline:s,autosizeRows:o,recommendedMax:a,onCommit:u,onAiAssist:d,onAiQuickAction:f,aiLoading:m,fieldShimmer:g}){const[y,x]=E.useState(r),[v,S]=E.useState(!1),w=E.useRef(null),T=v?y:r,{debouncedCommit:A,flushCommit:M}=Yd(u,400),j=s===!0&&o!=null,D=E.useCallback(()=>{if(!j||!w.current||!o)return;const L=w.current,F=getComputedStyle(L),q=Number.parseFloat(F.lineHeight),W=Number.parseFloat(F.fontSize)||15,K=Number.isFinite(q)?q:W*1.2,Y=(Number.parseFloat(F.paddingTop)||0)+(Number.parseFloat(F.paddingBottom)||0),V=(Number.parseFloat(F.borderTopWidth)||0)+(Number.parseFloat(F.borderBottomWidth)||0),O=o.min*K+Y+V,U=o.max*K+Y+V;L.style.height="0px";const Q=L.scrollHeight,le=Math.max(O,Math.min(U,Q));L.style.height=`${le}px`,L.style.overflowY=Q>U?"auto":"hidden"},[j,o]);E.useLayoutEffect(()=>{D()},[D,T,v,r]),E.useEffect(()=>{if(!j)return;const L=()=>D();return window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[j,D]);const P={placeholder:i,value:T,onFocus:()=>{x(r),S(!0)},onChange:L=>{x(L.target.value),A(L.target.value)},onBlur:()=>{S(!1),M()}},R=(v?y:r).length;return p.jsxs("div",{className:"property-field",children:[p.jsx("div",{className:"property-field-label",children:p.jsx("span",{children:e})}),p.jsxs("div",{className:`property-field-input-wrap${g?" property-field-input-wrap--ai-loading":""}`,children:[s?p.jsx("textarea",{ref:j?w:void 0,className:`property-field-textarea${j?" property-field-textarea--autosize":""}`,rows:(o==null?void 0:o.min)??3,...P}):p.jsx("input",{type:"text",className:"property-field-input",...P}),d?p.jsx(lp,{onClick:d,fieldKind:t,fieldLabel:e,blockType:n,currentValue:v?y:r,onQuickAction:f,onCustomPrompt:d,aiLoading:g}):null]}),a!=null&&p.jsxs("span",{className:`property-field-char-count${R>a?" property-field-char-count--over":""}`,children:[R," / ",a]})]})}class ak extends E.Component{constructor(){super(...arguments);Te(this,"state",{error:null});Te(this,"reset",()=>{var n,r;(r=(n=this.props).onReset)==null||r.call(n),this.setState({error:null})})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){var i,s;console.error("[editor] Uncaught error in component tree:",n,r.componentStack),(s=(i=this.props).onError)==null||s.call(i,n,r)}render(){return this.state.error?p.jsxs("div",{style:this.props.style,className:"flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground h-full",children:[p.jsx("p",{className:"font-medium text-foreground",children:this.props.fallbackLabel??"Something went wrong"}),p.jsx("p",{className:"max-w-xs opacity-70 text-xs",children:this.state.error.message}),p.jsx("button",{type:"button",onClick:this.reset,className:"rounded-md border px-3 py-1.5 text-xs hover:bg-accent transition-colors",children:"Try again"})]}):this.props.children}}function Wve({siteId:e,orchestratorUrl:t,hostedIds:n,siteOwnOrchestrator:r}){const{t:i}=Mn(),s=()=>{uce(e),window.location.href=cce(window.location.href)},o=()=>{r&&(lce(e,r),window.location.reload())};return r?p.jsxs("div",{className:"orchestrator-mismatch",role:"alert",children:[p.jsxs("div",{className:"orchestrator-mismatch-body",children:[p.jsx("strong",{children:i("orchestratorMismatch.ownTitle")}),p.jsx("span",{children:i("orchestratorMismatch.ownDetail",{orchestrator:t,siteOrchestrator:r})})]}),p.jsx("button",{type:"button",className:"orchestrator-mismatch-action",onClick:o,children:i("orchestratorMismatch.useSiteOwn")})]}):p.jsxs("div",{className:"orchestrator-mismatch",role:"alert",children:[p.jsxs("div",{className:"orchestrator-mismatch-body",children:[p.jsx("strong",{children:i("orchestratorMismatch.title")}),p.jsx("span",{children:n.length>0?i("orchestratorMismatch.detailHosts",{orchestrator:t,hosted:n.join(", ")}):i("orchestratorMismatch.detail",{orchestrator:t})})]}),p.jsx("button",{type:"button",className:"orchestrator-mismatch-action",onClick:s,children:i("orchestratorMismatch.useDefault")})]})}const Ag=3e3;function Zve(e){const[t,n]=E.useState({status:"loading",blocks:[],manifest:null});E.useEffect(()=>{let i=!0,s=null;const o=async()=>{try{const u=await fetch(`${e||Vd}/api/editor/blocks`);if(!u.ok){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:`Manifest endpoint returned ${u.status}`}),s=setTimeout(()=>{i&&o()},Ag);return}const d=await u.json(),f=lj.safeParse(d);if(!f.success){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:"Manifest response shape is invalid"}),s=setTimeout(()=>{i&&o()},Ag);return}const m=fj(f.data.blocks);if(m){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:m}),s=setTimeout(()=>{i&&o()},Ag);return}if(!i)return;n({status:"ready",blocks:f.data.blocks,version:f.data.version,manifest:f.data})}catch(a){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:a instanceof Error?a.message:"Manifest fetch failed"}),s=setTimeout(()=>{i&&o()},Ag)}};return o(),()=>{i=!1,s&&clearTimeout(s)}},[e]);const r=E.useMemo(()=>{const i=new Map;for(const s of t.blocks)i.set(s.type,s);return i},[t.blocks]);return{...t,byType:r,siteCapabilities:{allowStructuralEdits:t.status==="ready",manifestStatus:t.status,reason:t.reason,manifestVersion:t.version,blockCount:t.blocks.length,checkedAt:new Date().toISOString()},allowStructuralEdits:t.status==="ready"}}function Yve(e){const[t,n]=E.useState(void 0);return E.useEffect(()=>{if($k)return;let r=!1;return ace(e).then(i=>{r||!i||i.replace(/\/+$/,"")!==Be.replace(/\/+$/,"")&&n(i)}),()=>{r=!0}},[e]),t}function Jve(e){const t=e==null?void 0:e.trim().toLowerCase();return t?t==="text"?"text":t==="legacy"||t==="sparkle"||t==="dots"||t==="sparkle-dots"?"legacy":null:null}function Xve(){const e=Jve(Ni().VITE_STREAMING_INDICATOR_STYLE);return e||"text"}const Qve=/^[a-z]{2}(?:-[a-z0-9]{2,8})?$/i,Ol="default",eke=2;let th;function tke(e){if(!Qve.test(e))return!1;if(th===void 0)try{th=new Intl.DisplayNames(["en"],{type:"language",fallback:"none"})}catch{th=null}if(!th)return!1;try{return typeof th.of(e)=="string"}catch{return!1}}function ly(e){return e.split("/").filter(Boolean)}function tc(e){const t=ly(e);return t.length===0?"/":`/${t.join("/")}`}function nke(e){const t={},n=[];for(const u of e){const d=ly(u)[0];if(d&&tke(d)){const f=d.toLowerCase();(t[f]||(t[f]=[])).push(u)}else n.push(u)}const r=Object.keys(t).sort();if(r.length<2)return null;const i=new Map;for(const u of r)for(const d of new Set(t[u].map(f=>pC(f,u))))i.set(d,(i.get(d)??0)+1);if(![...i.values()].some(u=>u>=2))return null;const o=n.filter(u=>i.has(tc(u))).length>=eke,a=o?[]:n;o&&(t[Ol]=n,r.unshift(Ol));for(const u of r){const d=u===Ol?"/":`/${u}`;t[u].sort((f,m)=>f===d?-1:m===d?1:0)}return{locales:r,byLocale:t,shared:a}}function YL(e,t){var i;const n=(i=ly(e)[0])==null?void 0:i.toLowerCase();if(n&&t.byLocale[n])return n;const r=t.byLocale[Ol];return r!=null&&r.some(s=>tc(s)===tc(e))?Ol:void 0}function pC(e,t){var i;if(!t||t===Ol)return tc(e);const n=ly(e);if(((i=n[0])==null?void 0:i.toLowerCase())!==t.toLowerCase())return tc(e);const r=n.slice(1);return r.length===0?"/":`/${r.join("/")}`}function rke(e,t){return`${V4(pC(e,t))} (${e})`}function ike(e,t,n){const r=n.byLocale[t];if(!r||r.length===0)return e;const i=pC(e,YL(e,n)),s=t===Ol?i:i==="/"?`/${t}`:`/${t}${i}`;return r.find(a=>tc(a)===tc(s))??r[0]}function ske(e){try{const t=new Intl.DisplayNames([e],{type:"language"}).of(e);if(t&&t.toLowerCase()!==e.toLowerCase())return t.charAt(0).toUpperCase()+t.slice(1)}catch{}return e.toUpperCase()}const nR=Xve(),oke=!1,ake=dd||oke,lke=xG(),uke=E.lazy(()=>HB(()=>import("./PuckPrototypeRoute-4PdBTH7w.js").then(e=>e.P),__vite__mapDeps([0,1])).then(e=>({default:e.PuckPrototypeRoute}))),cke=new Set(["/editor/puck","/editor/puck/"]),dke=3e4,JL="site-reachable-v1:",fke=5e3;function XL(e){if(typeof sessionStorage>"u")return null;try{const t=sessionStorage.getItem(JL+e);if(!t)return null;const n=JSON.parse(t);return Date.now()-n.ts>dke?null:n.ok}catch{return null}}function rR(e,t){if(!(typeof sessionStorage>"u"))try{sessionStorage.setItem(JL+e,JSON.stringify({ok:t,ts:Date.now()}))}catch{}}function hke({name:e,origin:t,statusClass:n,active:r,dimmed:i,onSelect:s}){const o=t.replace(/^https?:\/\//,"");return p.jsxs("button",{type:"button",role:"menuitem",className:`site-switcher-item${r?" is-active":""}${i?" is-dimmed":""}`,onClick:s,title:t,children:[p.jsx("span",{className:`site-switcher-item-dot site-switcher-item-dot-${n}`,"aria-hidden":"true"}),p.jsxs("span",{className:"site-switcher-item-body",children:[p.jsx("span",{className:"site-switcher-item-name",children:e}),p.jsx("span",{className:"site-switcher-item-origin",children:o})]}),r?p.jsx(Fd,{size:12,"aria-hidden":"true"}):null]})}function iR(e){if(typeof sessionStorage>"u")return null;const t=new Set;let n=!1;for(const r of e){const i=XL(r);i!==null&&(n=!0,i&&t.add(r))}return n?t:null}function pke(e,t){if(e===t)return!0;if(!e||!t||e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function mke(){const e=typeof window<"u"?window.location.pathname:"/",t=e==="/"||e==="/editor"||e==="/editor/",n=cke.has(e),r=e==="/sites"||e==="/sites/";fe(d=>d.chatDarkMode);const i=fe(d=>d.setChatDarkMode),s=E.useMemo(()=>Iw(),[]),o=E.useMemo(()=>Q4(),[]),a=E.useRef(!1);a.current||(a.current=!0,zG({sessionId:s,siteId:o}));const u=fce(o,s);return E.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia("(prefers-color-scheme: dark)"),f=m=>{pw()===null&&i(m.matches,{persist:!1})};return d.addEventListener("change",f),()=>d.removeEventListener("change",f)},[i]),n?p.jsx(E.Suspense,{fallback:p.jsx("div",{style:{height:"100vh",display:"grid",placeItems:"center"},children:"Loading prototype…"}),children:p.jsx(uke,{})}):r?p.jsx(RN,{sites:u,session:s}):t?p.jsx(bke,{sites:u}):p.jsx(RN,{sites:u,session:s})}function gke(e){return e.split(".").map(t=>{const n=t.match(/^([a-zA-Z_]+)\[(\d+)\]$/);return n?`${sR(n[1])} ${Number(n[2])+1}`:sR(t)}).join(" · ")}function sR(e){const n=e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s*url\s*$/i,"").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e}function bke({sites:e}){var sf,of,fc;const{t}=Mn(),n=Bi(),r=Fi(),i=fe(_=>_.chatDarkMode),s=fe(_=>_.chatThemePreference),o=fe(_=>_.setChatThemePreference),{activeSiteConfig:a}=e,u=E.useMemo(()=>Pu(a),[a]),d=Zve(u),f=typeof window<"u"?window.location.origin:"http://localhost:4100",m=Yve(u),g=e.siteHosting==="notHosted"||m!=null,y=fe(_=>_.slug),x=fe(_=>_.setSlug),v=fe(_=>_.availableSlugs);fe(_=>_.setAvailableSlugs);const S=fe(_=>_.isLoadingSlugs),w=fe(_=>_.modelKey),T=fe(_=>_.setModelKey),A=fe(_=>_.provider),M=fe(_=>_.setProvider),j=fe(_=>_.availableProviders),D=fe(_=>_.setAvailableProviders),[P,R]=E.useState(""),L=fe(_=>_.activeBlockId),F=fe(_=>_.activeBlockType),q=fe(_=>_.activeEditablePath),W=_=>fe.getState().setActiveBlock(_),K=_=>{const G=fe.getState();G.setActiveBlock(G.activeBlockId,_)},Y=(_,G)=>fe.getState().setActiveBlock(_,G),V=fe(_=>_.setActiveEditablePath),O=fe(_=>_.useStreaming),U=fe(_=>_.setUseStreaming),Q=fe(_=>_.autoScrollTrackingEnabled),le=fe(_=>_.setAutoScrollTrackingEnabled),I=fe(_=>_.autoOpenPropertiesEnabled),$=fe(_=>_.setAutoOpenPropertiesEnabled),[X,z]=E.useState(!1),[Z,se]=E.useState(lke),ee=E.useCallback(_=>{se(_);try{window.localStorage.setItem(wk,_?"1":"0")}catch{}},[]),ne=E.useMemo(()=>!dd||new URLSearchParams(window.location.search).has("dev"),[]),Ae=ne&&Z,[_e,ze]=E.useState(!1),[ce,ve]=E.useState(0),Oe=E.useCallback(()=>ve(_=>_+1),[]),oe=fe(_=>_.showSettingsModal),He=fe(_=>_.setShowSettingsModal),$e=fe(_=>_.showDebugDetails),bt=fe(_=>_.setShowDebugDetails),Gt=fe(_=>_.composerHeight),Ct=fe(_=>_.setComposerHeight),ct=fe(_=>_.addBlockPicker),Xt=fe(_=>_.setAddBlockPicker),kt=fe(_=>_.addBlockSearch),St=fe(_=>_.setAddBlockSearch),nt=fe(_=>_.isAddingBlock),gn=fe(_=>_.setIsAddingBlock),he=fe(_=>_.copiedDebugEntryId),me=fe(_=>_.setCopiedDebugEntryId),Fe=fe(_=>_.feedbackNoteEntryId),et=fe(_=>_.setFeedbackNoteEntryId),ft=fe(_=>_.feedbackNoteText),Ot=fe(_=>_.setFeedbackNoteText),cr=fe(_=>_.selectedVariationId),fn=fe(_=>_.setSelectedVariationId),Nt=fe(_=>_.imagePickerTarget),zn=fe(_=>_.setImagePickerTarget),tn=Nt!==null,Tr=fe(_=>_.backendFeatures),Ar=fe(_=>_.setBackendFeatures),ke=fe(_=>_.setBackendSite),Ue=fe(_=>_.selectionModeEnabled),ge=fe(_=>_.setSelectionModeEnabled),je=fe(_=>_.anchorRect),Le=fe(_=>_.setAnchorRect),Pe=fe(_=>_.anchoredExpanded),tt=fe(_=>_.setAnchoredExpanded),Ke=fe(_=>_.activeTab),ht=fe(_=>_.setActiveTab),[Bt,Wt]=E.useState(!1),[wn,Ln]=E.useState(!1),nr=E.useRef(null);E.useEffect(()=>{if(!wn)return;const _=ie=>{nr.current&&!nr.current.contains(ie.target)&&Ln(!1)},G=ie=>{ie.key==="Escape"&&Ln(!1)};return document.addEventListener("mousedown",_),document.addEventListener("keydown",G),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("keydown",G)}},[wn]);const[Gi,Gs]=E.useState(()=>iR(e.siteList.map(_=>_.id))),qr=E.useCallback(_=>{Gs(G=>pke(G,_)?G:_)},[]);E.useEffect(()=>{if(!wn)return;qr(iR(e.siteList.map(ie=>ie.id)));let _=!0;return(async()=>{let ie=!0;const Ce=await Promise.all(e.siteList.map(async De=>{const Ve=XL(De.id);if(Ve!==null)return{id:De.id,ok:Ve};ie=!1;const Qe=Pu(De);try{const pn=await fetch(`${Qe}/api/editor/blocks?siteId=${encodeURIComponent(De.id)}`,{signal:AbortSignal.timeout(2500)});return rR(De.id,pn.ok),{id:De.id,ok:pn.ok}}catch{return rR(De.id,!1),{id:De.id,ok:!1}}}));_&&!ie&&qr(new Set(Ce.filter(De=>De.ok).map(De=>De.id)))})(),()=>{_=!1}},[wn,e.siteList,qr]);const Kr=E.useMemo(()=>{const _=Gi===null;return e.siteList.map(G=>{const ie=_||G.id===r||Gi.has(G.id);return{site:G,origin:Pu(G),online:ie,probing:_}}).sort((G,ie)=>G.site.id===r?-1:ie.site.id===r?1:G.online!==ie.online?G.online?-1:1:G.site.name.localeCompare(ie.site.name))},[Gi,e.siteList,r]),{onlineEntries:Ws,activeEntry:Nr}=E.useMemo(()=>({onlineEntries:Kr.filter(_=>_.online),activeEntry:Kr.find(_=>_.site.id===r)}),[Kr,r]),jt=E.useRef(null),Bn=E.useRef(null),jr=E.useRef(!0),ks=E.useRef(!1),Ss=E.useRef(null),bi=E.useRef(void 0),mr=E.useRef(!1),Wi=E.useRef(null),Zi=E.useRef(!1),si=E.useRef(0),oi=E.useRef(null),Fn=E.useRef(null),an=fe(_=>_.chatWidth),Mt=fe(_=>_.setChatWidth),ws=fe(_=>_.propsWidth),Gr=fe(_=>_.setPropsWidth),gr=E.useRef(null),Wr=E.useRef(null),[Yi,Go]=E.useState(1),Cs=E.useRef(null),go=E.useRef(null),Ji=E.useRef(!1),Es=E.useRef(!1);E.useEffect(()=>{if(!Es.current&&!(S||v.length===0)){if(y!=="/"||v.includes("/")){Es.current=!0;return}Es.current=!0,mr.current=!1,x(v[0])}},[v,S,y,x]);const Ir=E.useMemo(()=>{const _=Array.from(new Set([...v,y].filter(Boolean)));return _.includes("/")?["/",..._.filter(G=>G!=="/")]:_},[v,y]),hn=E.useMemo(()=>nke(Ir),[Ir]),Or=hn?YL(y,hn)??hn.locales[0]:void 0,Wo=E.useMemo(()=>!hn||!Or?Ir:hn.byLocale[Or]??[],[hn,Or,Ir]),Xi=E.useMemo(()=>{if(!d.allowStructuralEdits)return[];if(d.blocks.length>0)return d.blocks.map(G=>({type:G.type,label:G.displayName??G.type,category:"content"})).sort((G,ie)=>G.label.localeCompare(ie.label));const _=Au();return[...bk].map(G=>{var ie,Ce;return{type:G,label:((ie=_[G])==null?void 0:ie.displayName)??G,category:((Ce=_[G])==null?void 0:Ce.category)??"content"}}).sort((G,ie)=>G.label.localeCompare(ie.label))},[d.allowStructuralEdits,d.blocks]),ja=E.useMemo(()=>{const _=kt.trim().toLowerCase(),G=_?Xi.filter(De=>De.label.toLowerCase().includes(_)||De.type.toLowerCase().includes(_)):Xi,ie=new Map;for(const De of G){const Ve=De.category||"content",Qe=ie.get(Ve);Qe?Qe.push(De):ie.set(Ve,[De])}const Ce=["content","layout","conversion","navigation","media"];return[...ie.entries()].sort((De,Ve)=>{const Qe=Ce.indexOf(De[0]),pn=Ce.indexOf(Ve[0]),rr=Qe===-1?Number.MAX_SAFE_INTEGER:Qe,En=pn===-1?Number.MAX_SAFE_INTEGER:pn;return rr!==En?rr-En:De[0].localeCompare(Ve[0])}).map(([De,Ve])=>({category:De,options:Ve}))},[kt,Xi]),Mi=()=>{const _=Date.now();_-si.current<1200||(si.current=_,Ge.pushAssistantFromResult({status:"needs_clarification",summary:t("streamError.structuralDisabled"),changes:SP(d.reason)}))},eu=E.useRef(()=>{}),Cn=E.useCallback(_=>{fe.getState().slug!==_&&(Zi.current=!0,x(_))},[x]),Zs=E.useMemo(()=>({onBlockClicked:(_,G,ie,Ce,De,Ve)=>{Cn(_),Y(G,ie),V(Ce),Le(G?Ve:null);const Qe=fe.getState();G?Qe.autoOpenPropertiesEnabled&&Qe.setActiveTab("properties"):Qe.setActiveTab("chat")},onRouteChanged:_=>{fe.getState().slug!==_&&Y(void 0,void 0),Cn(_),V(void 0),Le(null),yi.current("setSelectionMode",{enabled:fe.getState().selectionModeEnabled}),eu.current(_)},onBlockReordered:(_,G,ie)=>{if(!d.allowStructuralEdits){Mi();return}_!==y&&Cn(_),V(void 0),Ge.reorderBlock(_,G,ie)},onBlockDeleteRequested:(_,G)=>{if(!d.allowStructuralEdits){Mi();return}_!==y&&Cn(_),V(void 0),Ge.deleteBlock(_,G)},onBlockAddRequested:(_,G)=>{if(!d.allowStructuralEdits){Mi();return}_!==y&&Cn(_),!(!G.afterBlockId&&!G.beforeBlockId)&&Xt({slug:_,afterBlockId:G.afterBlockId,beforeBlockId:G.beforeBlockId})},onListItemAddRequested:(_,G,ie,Ce,De)=>{if(!d.allowStructuralEdits){Mi();return}_!==y&&Cn(_),V(void 0),Ge.addListItem(_,G,ie,Ce,De)},onListItemRemoveRequested:(_,G,ie,Ce,De)=>{if(!d.allowStructuralEdits){Mi();return}_!==y&&Cn(_),V(void 0),Ge.removeListItem(_,G,ie,Ce,De)},onListItemMoveRequested:(_,G,ie,Ce,De,Ve)=>{if(!d.allowStructuralEdits){Mi();return}_!==y&&Cn(_),V(void 0),Ge.moveListItem(_,G,ie,Ce,De,Ve)},onOpenImagePicker:(_,G,ie,Ce,De)=>{zn({slug:_,blockId:G,editablePath:ie,currentUrl:Ce,blockType:De??(G===L?F:void 0)})},onEditBlockRequested:(_,G)=>{tt(!0)},onInlineTextCommitted:(_,G,ie,Ce)=>{_!==y&&Cn(_),ie&&V(ie),Ge.inlineEditCommit(_,G,ie,Ce)},onIframeScrolled:()=>{Le(null),fe.getState().isLoading&&fe.getState().setAutoScrollSuppressed(!0)}}),[d.allowStructuralEdits,Cn,y]),Ia=E.useCallback(async()=>{var _;try{const G=`${Be}/draft/pages?session=${encodeURIComponent(n)}&siteId=${encodeURIComponent(r)}&slug=${encodeURIComponent(y)}`,ie=await fetch(G,{cache:"no-store"});if(!ie.ok)return;const De=((await ie.json()).blocks??[]).find(Ve=>Ve.type==="Hero");if(!De)return;Y(De.id,De.type),zn({slug:y,blockId:De.id,editablePath:"imageUrl",currentUrl:typeof((_=De.props)==null?void 0:_.imageUrl)=="string"?De.props.imageUrl:void 0,blockType:De.type})}catch{}},[n,r,y,zn]),Qt=hce(y,Zs,u),yi=E.useRef(Qt.postToSite);E.useEffect(()=>{yi.current=Qt.postToSite},[Qt.postToSite]);const Ys=E.useCallback(_=>{const G=_??!Ue;ge(G),Qt.postToSite("setSelectionMode",{enabled:G})},[Ue,Qt]);E.useEffect(()=>{const _=G=>{G.key==="Escape"&&Ue&&Ys(!1)};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[Ue,Ys]),E.useEffect(()=>{if(Ke!=="history")return;const _=G=>{G.key==="Escape"&&fe.getState().setActiveTab("chat")};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[Ke]);const Zo=E.useCallback((_,G)=>{(_==="draftUpdated"||_==="liveDraft")&&Oe(),Qt.postToSite(_,G)},[Qt,Oe]),xi=E.useCallback((_,G,ie,Ce)=>(Oe(),Qt.postPatchToSite(_,G,ie,Ce)),[Qt,Oe]),Ge=xce({activeSiteConfig:a,siteRegistryChecked:e.siteRegistryChecked,postToSite:Zo,postPatchToSite:xi,componentManifest:d.manifest,siteCapabilities:d.siteCapabilities,allowStructuralEdits:d.allowStructuralEdits,getBlockDefaultProps:_=>{var G;return((G=d.byType.get(_))==null?void 0:G.defaultProps)??null},onApplied:()=>{var _;(_=bi.current)==null||_.call(bi)},agentModeEnabled:Tr.agentMode??!1}),ai=fe(_=>_.chatLog),Oa=fe(_=>_.chatAttachments),bo=fe(_=>_.setChatAttachments),Kn=fe(_=>_.isLoading),br=fe(_=>_.streamStatus),Js=fe(_=>_.streamingText),Qi=fe(_=>_.streamingChanges),tu=fe(_=>_.streamSteps),Xs=fe(_=>_.streamTokenCount),es=fe(_=>_.latestStreamFocusBlockId),Pr=fe(_=>_.imageProgress),Di=fe(_=>_.plannerBadgeState),[yo,_s]=E.useState(!1),Qs=fe(_=>_.setPlannerBadgeState),dt=fe(_=>_.pendingPlanId),mt=fe(_=>_.variationModal),we=fe(_=>_.isApplyingVariation),Pt=fe(_=>_.setVariationModal),Ri=fe(_=>_.continuationChainId),vi=fe(_=>_.fieldDraftDebugEnabled),li=fe(_=>_.setFieldDraftDebugEnabled),zr=fe(_=>_.fieldDraftDebug);E.useEffect(()=>{X4.has(r)||(T("balanced"),Ge.clearChat())},[r]);function it(_){var G,ie;typeof _.navigateToSlug=="string"&&_.navigateToSlug.length>0&&_.navigateToSlug!==y&&x(_.navigateToSlug),typeof _.canUndo=="boolean"&&((G=Ge.setCanUndoServer)==null||G.call(Ge,_.canUndo)),typeof _.canRedo=="boolean"&&((ie=Ge.setCanRedoServer)==null||ie.call(Ge,_.canRedo)),Qt.postToSite("draftUpdated",{focusBlockId:null}),Oe()}async function xt(_){Wt(!0);try{const ie=await(await fetch(`${Be}/history/restore`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:n,siteId:r,targetVersion:_})})).json();ie.status==="applied"&&it(ie)}catch{}finally{Wt(!1)}}const _t=Sce(n,r,u,ce),Vt=kce(n,r,Kn,Ge.pushAssistantFromResult,u,()=>{Qt.postToSite("draftUpdated",{focusBlockId:null}),_t.markPublished()}),dr=_t.summary?_t.summary.total>0:!0,zt=wce(),bn=Ke==="properties"&&Ge.hasBootstrapped,ln=_ce(n,r,y,L,bn),nn=Tce(n,r,y,bn);E.useEffect(()=>{!L||F||!ln.blockType||K(ln.blockType)},[L,F,ln.blockType]);const Mr=$ee(n,r,!!n),nu=Uee(Mr.findings),Zr=E.useRef(null),eo=E.useCallback((_,G,ie)=>{Y(_,G),V(ie),Le(null),fe.getState().selectionModeEnabled||(fe.getState().setSelectionModeEnabled(!0),yi.current("setSelectionMode",{enabled:!0})),yi.current("highlightBlock",{blockId:_,editablePath:ie??null,scrollIntoView:!0})},[]),xo=E.useCallback(_=>{const G=Zr.current;!G||G.slug!==_||(Zr.current=null,!(G.expiresAt!==void 0&&Date.now()>G.expiresAt)&&eo(G.blockId,G.blockType,G.path))},[eo]);E.useEffect(()=>{if(!Zr.current)return;const _=setTimeout(()=>xo(y),400);return()=>clearTimeout(_)},[y,xo]),E.useEffect(()=>{eu.current=xo},[xo]);const uy=E.useCallback((_,G,ie,Ce)=>{if(!G){_!==fe.getState().slug&&x(_),Y(void 0,void 0),V(void 0),ht("properties");return}if(_!==fe.getState().slug){Zr.current={slug:_,blockId:G,blockType:ie,path:Ce},x(_),ht("properties");return}ht("properties"),Zr.current={slug:_,blockId:G,...ie?{blockType:ie}:{},...Ce?{path:Ce}:{},expiresAt:Date.now()+fke},eo(G,ie,Ce)},[eo]);bi.current=()=>{ln.refetch(),nn.refetch(),Oe()};const[cc,cy]=E.useState(()=>Uk(y,{session:n,siteId:r,editorOrigin:f},u)),[dy,Tp]=E.useState(!1);E.useEffect(()=>{Tp(!1)},[cc]),E.useEffect(()=>{Wi.current!==u&&(Wi.current=u,mr.current=!1);const _={session:n,siteId:r,editorOrigin:f};if(Zi.current){Zi.current=!1;return}if(e0&&mr.current){Qt.postToSite("navigate",{href:Hk(y,_)});return}const G=Uk(y,_,u);cy(ie=>ie===G?ie:G)},[u,f,n,r,y]);const Ap=E.useMemo(()=>{var ie;const _=(ie=a.vercelProductionUrl)==null?void 0:ie.trim(),G=_&&/^https?:\/\//i.test(_)?_:u;try{const Ce=new URL(G);return Ce.origin===u?xee(y,{},u):(Ce.pathname=y==="/"?"/":y,Ce.search="",Ce.hash="",Ce.toString())}catch{return}},[a.vercelProductionUrl,u,y]),Np=E.useMemo(()=>u?`${u}${Hk(y,{session:n,siteId:r,editorOrigin:f,immersive:"1"})}`:void 0,[u,f,n,r,y]);E.useEffect(()=>{let _=!0;const G=async()=>{const Ce=[`${Be}/status/planner`];Be.includes("localhost")&&Ce.push(`${Be.replace("localhost","127.0.0.1")}/status/planner`);try{for(const De of Ce){const Ve=await fetch(De);if(!Ve.ok)continue;const Qe=await Ve.json();if(!_)return;if(Qe.features&&Ar(Qe.features),Qe.site&&ke(Qe.site),Array.isArray(Qe.availableProviders)&&Qe.availableProviders.length>0&&(D(Qe.availableProviders),(!Qe.availableProviders.includes(A)||A!=="anthropic"&&Qe.availableProviders.includes("anthropic"))&&M(Qe.availableProviders.includes("anthropic")?"anthropic":Qe.availableProviders[0])),typeof Qe.keyFilePath=="string"&&Qe.keyFilePath.length>0&&fe.getState().setKeyFilePath(Qe.keyFilePath),Qe.plannerSource==="openai"||Qe.plannerSource==="anthropic"||Qe.plannerSource==="gemini"||Qe.plannerSource==="demo"){Qs(Qe.plannerSource);return}}_&&Qs("error")}catch{_&&Qs("error")}};G();const ie=window.setInterval(()=>{G()},1e4);return()=>{_=!1,window.clearInterval(ie)}},[]);const Qd=E.useRef(0),Mp=E.useRef(0);E.useEffect(()=>{const _=Bn.current;if(!_)return;const G=()=>{const ie=Math.abs(_.scrollHeight-_.scrollTop-_.clientHeight)<2||_.scrollHeight<=_.clientHeight;!ie&&_.scrollTop<Qd.current?jr.current=!1:ie&&(jr.current=!0),Qd.current=_.scrollTop};return _.addEventListener("scroll",G,{passive:!0}),()=>{_.removeEventListener("scroll",G)}},[]),E.useEffect(()=>{const _=Bn.current;if(!_||!(ai.length>0||!!br||!!Js))return;const ie=ai.reduce((pn,rr)=>rr.role==="user"?pn+1:pn,0);ie>Mp.current&&(jr.current=!0),Mp.current=ie;const Ce=!ks.current,De=ai.some(pn=>pn.role==="user");if(Ce&&!De&&!br&&!Js){ks.current=!0,jr.current=!1;return}if(!Ce&&!jr.current)return;const Qe=window.requestAnimationFrame(()=>{_.scrollTop=_.scrollHeight,jr.current=!0,ks.current=!0});return()=>window.cancelAnimationFrame(Qe)},[ai.length,br,Js,tu.length,Qi.length]),E.useEffect(()=>{Qt.postToSite("setNestedLabelsVisibility",{visible:X})},[X]),E.useEffect(()=>{const _=yi.current;if(!Kn){Ji.current&&_("aiFieldLoading",{blockId:"",active:!1}),go.current=null,Ji.current=!1;return}const G=es??L??"",Ce=G&&G===(L??"")?q??"":"";_("aiFieldLoading",{blockId:G,editablePath:Ce,active:!0}),go.current={blockId:G,editablePath:Ce},Ji.current=!0},[Kn,es,L,q]),E.useEffect(()=>{if(!Kn)return;const _=window.setInterval(()=>{const G=go.current;G&&yi.current("aiFieldLoading",{blockId:G.blockId,editablePath:G.editablePath,active:!0})},1200);return()=>window.clearInterval(_)},[Kn]),E.useEffect(()=>{L&&Qt.postToSite("highlightBlock",{blockId:L,editablePath:q??null})},[L,q]),E.useEffect(()=>{Ge.clearFieldAiContext()},[L]),E.useEffect(()=>{L||Le(null)},[L]),E.useEffect(()=>{tt(!1)},[je]),E.useEffect(()=>{const _=()=>Le(null);return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const fy=RG(),Pa=E.useMemo(()=>{if(!fy||!je||!Ue||!L||typeof window>"u"||window.innerWidth<=1040)return null;const _=Qt.iframeRef.current;if(!_)return null;const G=_.getBoundingClientRect(),ie=380,Ce=36,De=26,Ve=8,Qe=G.top+je.top*Yi;if(Qe+je.height*Yi<G.top||Qe>G.bottom)return null;const rr=Qe+Ve-(Ce-De)/2;let En=G.left+(je.left+je.width)*Yi-Ce-Ve;return En=Math.max(G.left+Ve,Math.min(En,G.right-Ce-Ve)),{top:rr,left:En,width:ie}},[je,Ue,L,Qt.iframeRef,Yi]);E.useEffect(()=>{Pa&&Pe&&requestAnimationFrame(()=>{var _,G;(G=(_=Cs.current)==null?void 0:_.querySelector("textarea"))==null||G.focus()})},[!!Pa,Pe]);const hy=E.useCallback((_,G,ie,Ce)=>{var rr;if(!L||!F)return;const Ve=((rr=Au()[F])==null?void 0:rr.displayName)??F;V(_);const Qe=dS(ie,G,F,Ce),pn={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: ${Ve} → ${G}`,fieldAiContext:{blockId:L,blockType:F,fieldPath:_,fieldLabel:G,blockDisplayName:Ve},suggestions:Qe};Ge.setFieldAiContext(pn)},[L,F]),ef=E.useCallback((_,G,ie)=>{const Ce=dS(G,_,"Page",ie),De={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: Page → ${_}`,fieldAiContext:{blockId:"__page__",blockType:"__page__",fieldPath:_,fieldLabel:_,blockDisplayName:"Page"},suggestions:Ce};Ge.setFieldAiContext(De)},[]),py=E.useCallback((_,G,ie,Ce,De)=>{var rr;if(!L||!F)return;const Qe=((rr=Au()[F])==null?void 0:rr.displayName)??F;V(_),Qt.postToSite("aiFieldLoading",{blockId:L,editablePath:_,active:!0}),go.current={blockId:L,editablePath:_},Ji.current=!0;const pn={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: ${Qe} → ${G}`,fieldAiContext:{blockId:L,blockType:F,fieldPath:_,fieldLabel:G,blockDisplayName:Qe}};Ge.setFieldAiContext(pn),Ge.submitChat(De)},[L,F]),my=E.useCallback((_,G,ie,Ce)=>{V(_);const De={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: Page → ${_}`,fieldAiContext:{blockId:"__page__",blockType:"__page__",fieldPath:_,fieldLabel:_,blockDisplayName:"Page"}};Ge.setFieldAiContext(De),Ge.submitChat(Ce)},[]);E.useEffect(()=>{Ge.refreshRouteSlugs()},[n,r,e.siteRegistryChecked]);const tf=_=>{const ie=jt.current,Ce=Bn.current;if(!ie||!Ce)return Math.max(56,_);const De=120,Ve=10,Qe=Ce.offsetTop,pn=Math.max(56,ie.clientHeight-Qe-Ve-De);return Math.min(pn,Math.max(56,_))},Dp=E.useCallback(_=>{Ct(G=>{const ie=tf(_);return ie===G?G:ie})},[]);E.useEffect(()=>{const _=ie=>{const Ce=oi.current;if(Ce){const Ve=ie.clientY-Ce.y,Qe=tf(Ce.composerHeight-Ve);Ct(Qe)}const De=Fn.current;if(De){const Ve=ie.clientX-De.x;De.target==="chat"?Mt(_k(De.width+Ve)):Gr(Tk(De.width-Ve))}},G=()=>{const ie=!!Fn.current;oi.current=null,Fn.current=null,document.body.style.userSelect="",ie&&document.body.classList.remove("panel-resizing")};return window.addEventListener("pointermove",_),window.addEventListener("pointerup",G),()=>{window.removeEventListener("pointermove",_),window.removeEventListener("pointerup",G),document.body.style.userSelect="",document.body.classList.remove("panel-resizing")}},[]),E.useEffect(()=>{const _=()=>{Ct(G=>tf(G)),Mt(G=>G&&_k(G)),Gr(G=>G&&Tk(G))};return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[Mt,Gr]),E.useEffect(()=>{if(!mt)return;const _=G=>{G.key==="Escape"&&!we&&Pt(null)};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[mt,we]),E.useEffect(()=>{mt!=null&&mt.options.length?fn(mt.options[0].id):fn(null)},[mt]),E.useEffect(()=>{ct||St("")},[ct]),E.useEffect(()=>{if(!ct)return;const _=G=>{G.key==="Escape"&&!nt&&Xt(null)};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[ct,nt]);const nf=br?/failed|error/i.test(br):!1,[Rp,jp]=E.useState(0),gy=Pr==null?void 0:Pr.stage;E.useEffect(()=>{if(jp(0),!Kn)return;const _=window.setInterval(()=>jp(G=>G+1),1e3);return()=>window.clearInterval(_)},[Kn,br,gy]);const Ip=Kn&&!nf&&Rp>=5?` · ${Rp}s`:"",by=(Pr?Pr.stage:br??(Xs>0?t("stream.shapingUpdate"):t("stream.gettingReady")))+Ip,Op=(Pr?Pr.stage:br??(Xs>0?t("stream.updating"):t("stream.thinking")))+Ip,to=(br==null?void 0:br.match(/reconnecting(?:\s+agent\s+stream)?(?:\s+\((\d+)\/(\d+)\))?/i))??null,Pp=to!=null&&to[1]?Number(to[1]):null,dc=to!=null&&to[2]?Number(to[2]):null,vo=to?Pp&&dc?`Reconnect ${Pp}/${dc}`:"Reconnecting":null,zp=`field_draft ${zr.eventsPerSecond}/s · chars ${zr.charsPerSecond}/s · lag ${zr.typingLagChars}`,Lp={"--composer-height":`${Gt}px`},ko=Ke==="properties",za=Ke==="history",ru=Ke==="health",rf=E.useCallback(()=>{W(void 0),K(void 0),ht("chat")},[]);E.useLayoutEffect(()=>{const _=Wr.current,G=Qt.iframeRef.current;if(!_||!G)return;const ie=Ve=>{var ts;if(Ve?G.classList.remove("preview-iframe-no-transition"):G.classList.add("preview-iframe-no-transition"),!ko){G.style.removeProperty("width"),G.style.removeProperty("height"),G.style.removeProperty("transform"),Go(Ts=>Ts===1?Ts:1);return}const Qe=_.offsetWidth,pn=((ts=gr.current)==null?void 0:ts.offsetWidth)??0;if(Qe<=0||pn<=0)return;const rr=Qe+pn,En=Qe/rr;G.style.width=`${rr}px`,G.style.height=`${100/En}%`,G.style.transform=`scale(${En})`,Go(Ts=>Math.abs(Ts-En)<5e-4?Ts:En)};ie(!0);const Ce=new ResizeObserver(()=>ie(!1)),De=window.setTimeout(()=>{Ce.observe(_);const Ve=gr.current;Ve&&Ce.observe(Ve)},240);return()=>{window.clearTimeout(De),G.classList.remove("preview-iframe-no-transition"),Ce.disconnect()}},[ko,Qt.iframeRef]);const La={...an?{"--chat-width":`${an}px`}:{},...ws?{"--props-width":`${ws}px`}:{}},Bp=ai.some(_=>_.role==="user"),Fp=E.useCallback(_=>{const G=[];_.text&&G.push(_.text),_.status&&!_.canUndo&&_.status!=="needs_clarification"&&_.status!=="plan_ready"&&G.push(`status: ${_.status}`);const ie=(_.changes??[]).filter(Ce=>!q4(_.text,Ce));if(ie.length>0&&G.push(`changes: ${ie.join(`
731
769
  `)}`),(_.errors??[]).length>0&&G.push(`errors: ${(_.errors??[]).join(`
732
770
  `)}`),_.debug){if(G.push(""),G.push("Debug"),_.debug.traceId&&G.push(`traceId: ${_.debug.traceId}`),_.debug.promptHash&&G.push(`promptHash: ${_.debug.promptHash}`),_.debug.outcome&&G.push(`outcome: ${_.debug.outcome}`),_.debug.reasonCategory&&G.push(`reason: ${_.debug.reasonCategory}`),_.debug.reason&&_.debug.reason!==_.debug.reasonCategory&&G.push(`reasonDetail: ${_.debug.reason}`),_.debug.intent&&G.push(`intent: ${_.debug.intent}`),_.debug.plannerTier&&G.push(`plannerTier: ${_.debug.plannerTier}`),_.debug.modelUsed&&G.push(`model: ${_.debug.modelUsed}${_.debug.plannerSource?` (${_.debug.plannerSource})`:""}`),typeof _.debug.planningAttempts=="number"&&_.debug.planningAttempts>1&&G.push(`planningAttempts: ${_.debug.planningAttempts}`),typeof _.debug.opCount=="number"&&G.push(`opCount: ${_.debug.opCount}`),Array.isArray(_.debug.skippedOps)&&_.debug.skippedOps.length>0){const De=_.debug.skippedOps.map(Ve=>`[${Ve.index}] ${Ve.op} ${Ve.pageSlug??""}${Ve.blockId?"#"+Ve.blockId:""}: ${Ve.reason}`).join(", ");G.push(`skippedOps: ${De}`)}else typeof _.debug.skippedOpCount=="number"&&_.debug.skippedOpCount>0&&G.push(`skippedOps: ${_.debug.skippedOpCount}`);if(Array.isArray(_.debug.opTypes)&&_.debug.opTypes.length>0&&G.push(`ops: ${_.debug.opTypes.join(", ")}`),typeof _.debug.totalTokens=="number"&&G.push(`tokens: in:${_.debug.inputTokens??"?"} out:${_.debug.outputTokens??"?"} total:${_.debug.totalTokens}`),typeof _.debug.estimatedUsd=="number"&&G.push(`cost: $${_.debug.estimatedUsd.toFixed(4)}`),Array.isArray(_.debug.timeline)&&_.debug.timeline.length>0){const De=_.debug.timeline.map(Ve=>`${Ve.stage}:${Ve.atMs}ms`).join(" -> ");G.push(`timeline: ${De}`)}_.debug.promptExcerpt&&G.push(`prompt: ${_.debug.promptExcerpt}`);const Ce=[];_.debug.currentPage&&Ce.push(`page: ${_.debug.currentPage}`),_.debug.siteId&&Ce.push(`site: ${_.debug.siteId}`),_.debug.activeBlockId&&Ce.push(`block: ${_.debug.activeBlockId}`),_.debug.activeEditablePath&&Ce.push(`path: ${_.debug.activeEditablePath}`),Ce.length>0&&G.push(`context: ${Ce.join(", ")}`)}return G.join(`
733
771
  `)},[]),yy=E.useCallback(async _=>{const G=Fp(_);if(G.trim())try{await navigator.clipboard.writeText(G),me(_.id),window.setTimeout(()=>{fe.getState().copiedDebugEntryId===_.id&&me(null)},1400)}catch{}},[Fp]),$p=E.useCallback(_=>{var ie;if(!_.debug)return t("chat.expandDetails");const G=[];if(_.debug.outcome&&G.push(_.debug.outcome.replace(/_/g," ")),typeof _.debug.opCount=="number"){const Ce=_.debug.opCount;G.push(`${Ce} op${Ce===1?"":"s"}`)}if(_.debug.intent&&G.push(`intent: ${_.debug.intent.replace(/_/g," ")}`),_.debug.plannerTier&&G.push(_.debug.plannerTier.replace(/_/g," ")),Array.isArray(_.debug.timeline)&&_.debug.timeline.length>0){const Ce=(ie=_.debug.timeline[_.debug.timeline.length-1])==null?void 0:ie.atMs;typeof Ce=="number"&&G.push(`${Ce}ms`)}return G.join(" · ")||t("chat.expandDetails")},[t]),So=Mr.findings.length,Ba=So===1?t("health.issueCount",{count:String(So)}):t("health.issueCountPlural",{count:String(So)}),iu=So>0?`${t("health.tooltip")}, ${Ba}`:t("health.tooltip"),xy=So>0?`${t("health.tooltip")}: ${Ba}`:t("health.tooltip"),su=p.jsxs("div",{className:"chat-header-slug-actions",children:[p.jsx("button",{type:"button",className:`chat-header-icon-btn${ko?" is-active":""}`,"aria-label":t("tabs.properties"),"data-tooltip":t("tabs.properties"),"aria-pressed":ko,onClick:()=>{ko?rf():(W(void 0),K(void 0),ht("properties"))},children:p.jsx(bF,{size:14,"aria-hidden":"true"})}),p.jsx("button",{type:"button",className:`chat-header-icon-btn${za?" is-active":""}`,"aria-label":t("history.tooltip"),"data-tooltip":t("history.tooltip"),"aria-pressed":za,onClick:()=>ht(za?"chat":"history"),children:p.jsx(c9,{size:14,"aria-hidden":"true"})}),p.jsxs("button",{type:"button",className:`chat-header-icon-btn${ru?" is-active":""}`,"aria-label":iu,"data-tooltip":xy,"aria-pressed":ru,onClick:()=>ht(ru?"chat":"health"),children:[p.jsx(YB,{size:14,"aria-hidden":"true"}),So>0?p.jsx("span",{className:`health-badge health-badge--${nu??"info"}`,"aria-hidden":"true",children:So}):null]}),Np?p.jsx("a",{className:"chat-header-icon-btn",href:Np,target:"_blank",rel:"noreferrer","aria-label":t("header.openImmersive"),"data-tooltip":t("header.openImmersive"),children:p.jsx(w9,{size:14,"aria-hidden":"true"})}):null,ne?p.jsx("button",{type:"button",className:"chat-header-icon-btn","aria-label":t("header.moreOptions"),"data-tooltip":t("header.moreOptions"),onClick:()=>He(!0),children:p.jsx(m9,{size:14,"aria-hidden":"true"})}):null]});return p.jsxs("div",{className:`layout${ko?" layout--props-open":""}${g?" layout--banner":""}`,style:La,children:[g?p.jsx(Wve,{siteId:r,orchestratorUrl:Be,hostedIds:e.hostedSiteIds??[],...e.siteHosting==="notHosted"?{}:{siteOwnOrchestrator:m}}):null,p.jsxs("aside",{className:"chat-panel",ref:jt,style:Lp,children:[p.jsxs("header",{className:"chat-header",children:[p.jsxs("div",{className:"chat-header-top",children:[p.jsxs("div",{className:"chat-header-site-name",ref:nr,children:[e.siteList.length>1?p.jsxs("button",{type:"button",className:`site-switcher-trigger${wn?" is-open":""}`,onClick:()=>Ln(_=>!_),"aria-expanded":wn,"aria-haspopup":"menu",children:[p.jsx("span",{className:`site-switcher-item-dot site-switcher-item-dot-${Nr!=null&&Nr.probing?"probing":Nr!=null&&Nr.online?"online":"offline"}`,"aria-hidden":"true"}),p.jsx("span",{className:"site-switcher-trigger-label",children:a.name}),p.jsx(Na,{size:12,className:`site-switcher-chevron${wn?" is-open":""}`,"aria-hidden":"true"})]}):p.jsx("span",{className:"site-switcher-trigger-label",children:a.name}),wn&&p.jsxs("div",{className:"site-switcher-dropdown",role:"menu","aria-label":t("header.allSites"),children:[p.jsxs("div",{className:"site-switcher-header",children:[p.jsx("span",{children:t("header.allSites")}),p.jsxs("a",{href:"/sites",className:"site-switcher-add-link",onClick:()=>Ln(!1),children:["+ ",t("sites.addSite")]})]}),p.jsx("div",{className:"site-switcher-list",children:Ws.map(_=>p.jsx(hke,{name:_.site.name,origin:_.origin,statusClass:_.probing?"probing":"online",active:_.site.id===r,onSelect:()=>{_.site.id!==r&&e.openEditorForSite(_.site.id),Ln(!1)}},_.site.id))}),p.jsxs("div",{className:"site-switcher-actions",role:"group",children:[p.jsxs("button",{type:"button",role:"menuitem",className:"site-switcher-action",onClick:()=>{Ln(!1),e.setConfigSiteId(r)},children:[p.jsx(mF,{size:14,"aria-hidden":"true"}),p.jsx("span",{children:t("header.siteSettings")})]}),Ge.siteHasCmsContent!==!1&&p.jsxs("button",{type:"button",role:"menuitem",className:"site-switcher-action",title:t("header.syncFromSiteTitle"),disabled:Kn,onClick:async()=>{Ln(!1);const _=await Ge.syncFromSite();_.ok&&_.count>0?Ge.pushAssistantFromResult({status:"applied",summary:_.count===1?t("header.syncedPage"):t("header.syncedPages",{count:_.count}),changes:[]}):_.ok||Ge.pushAssistantFromResult({status:"error",summary:_.reason==="network"?t("header.syncFailedNetwork"):t("header.syncFailedEmpty"),changes:[]})},children:[p.jsx(ZS,{size:14,"aria-hidden":"true"}),p.jsx("span",{children:t("header.syncFromSite")})]})]}),p.jsxs("a",{href:"/sites",className:"site-switcher-footer",onClick:()=>Ln(!1),children:[t("header.viewAllSites"),p.jsx($g,{size:11,"aria-hidden":"true"})]})]})]}),p.jsxs("div",{className:"chat-header-right",children:[d.status==="degraded"?p.jsx("span",{className:"planner-badge",title:d.reason??"Components unavailable",children:t("header.limited")}):null,!dd&&(dr||Vt.publishInProgress)?p.jsxs("button",{type:"button",className:"publish-preview-btn",onClick:()=>ze(!0),disabled:Kn||Vt.isPublishing,title:_t.summary&&_t.summary.total>0?t("header.unpublishedTooltip",{count:String(_t.summary.total)}):void 0,children:[Vt.publishInProgress?p.jsx("span",{className:"publish-spinner","aria-hidden":"true"}):null,Vt.publishInProgress?t("header.publishing"):t("header.publish"),_t.summary&&_t.summary.total>0?p.jsx("span",{className:"publish-preview-badge","aria-hidden":"true",children:_t.summary.total}):null]}):null,!dd&&Vt.publishStatus?p.jsxs(p.Fragment,{children:[Vt.publishStatus.inspectUrl?p.jsx("a",{className:"publish-view-link",href:Vt.publishStatus.inspectUrl,target:"_blank",rel:"noreferrer",children:t("header.viewDeploy")}):null,Ap?p.jsx("a",{className:"live-site-icon-btn",href:Ap,target:"_blank",rel:"noreferrer","aria-label":t("header.openLiveSite"),title:t("header.openLiveSite"),children:p.jsx($g,{size:16,"aria-hidden":"true"})}):null]}):null]})]}),hn&&Or?p.jsxs("div",{className:"chat-header-lang-row",children:[p.jsx("label",{className:"chat-header-lang",children:p.jsx("select",{value:Or,"aria-label":t("header.language"),title:t("header.language"),onChange:_=>x(ike(y,_.target.value,hn)),disabled:S,children:hn.locales.map(_=>p.jsx("option",{value:_,children:_===Ol?t("header.defaultLanguage"):ske(_)},_))})}),su]}):null,p.jsxs("div",{className:"chat-header-slug-row",children:[p.jsx("label",{className:"chat-header-slug",children:p.jsx("select",{value:y,"aria-label":t("header.page"),onChange:_=>x(_.target.value||"/"),disabled:S,children:hn&&Or?p.jsxs(p.Fragment,{children:[Wo.map(_=>p.jsx("option",{value:_,children:rke(_,Or)},_)),hn.shared.length>0?p.jsx("optgroup",{label:t("header.pagesWithoutLanguage"),children:hn.shared.map(_=>p.jsx("option",{value:_,children:Lx(_)},_))}):null]}):Ir.map(_=>p.jsx("option",{value:_,children:Lx(_)},_))})}),hn&&Or?null:su]})]}),p.jsxs("div",{className:"chat-thread-region",children:[hw?p.jsxs("div",{className:"demo-banner",role:"note","aria-label":"Demo mode notice",children:[p.jsx("div",{className:"demo-banner-title",children:t("demo.bannerTitle")}),p.jsx("div",{className:"demo-banner-body",children:t("demo.bannerBody")}),p.jsxs("div",{className:"demo-banner-examples",children:[p.jsx("button",{type:"button",className:"demo-banner-example",disabled:Kn,onClick:()=>void Ge.submitChat(t("demo.tryExample1")),children:t("demo.tryExample1")}),p.jsx("button",{type:"button",className:"demo-banner-example",disabled:Kn,onClick:()=>void Ge.submitChat(t("demo.tryExample2")),children:t("demo.tryExample2")}),p.jsx("button",{type:"button",className:"demo-banner-example",disabled:Kn,onClick:()=>void Ge.submitChat(t("demo.tryExample3")),children:t("demo.tryExample3")})]})]}):null,p.jsx(ak,{fallbackLabel:"Chat unavailable — try refreshing",onReset:()=>window.location.reload(),children:p.jsx(vee,{ref:Bn,className:"chat-thread",streamStatusLabel:Op,undoInFlightEntryId:Ge.undoInFlightEntryId,onSuggestionClick:(_,G)=>void Ge.submitChat(_,void 0,{clickedSuggestionId:G}),onUndo:_=>void Ge.applyUndoHistory(_),undoLabel:t("chat.undo"),undoneLabel:t("chat.undone"),appliedDraftLabel:t("chat.appliedDraft"),keepLabel:t("chat.keep"),revertLabel:t("chat.revert"),revertedLabel:t("chat.reverted"),keptLabel:t("chat.kept"),renderEntryExtras:_=>{var G;return p.jsxs(p.Fragment,{children:[_.variations&&Array.isArray(_.variations.options)&&_.variations.options.length>0?p.jsx("div",{className:"msg-variations",children:_.variations.options.map((ie,Ce)=>p.jsxs("button",{type:"button",className:"msg-variation-card",disabled:Kn,onClick:async()=>{const De=_.variations;try{(await fetch(`${Be}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:n,siteId:r,ops:[{op:"update_props",pageSlug:De.pageSlug,blockId:De.blockId,patch:ie.patch}]})})).ok&&(Qt.postToSite("draftUpdated",{focusBlockId:De.blockId}),Oe(),Ge.pushAssistantFromResult({status:"applied",summary:`Applied variation: ${ie.title}`,changes:[ie.summary]}))}catch{}},children:[p.jsx("div",{className:"msg-variation-preview-wrap",children:p.jsx(kN,{block:{id:_.variations.blockId,type:_.variations.blockType,props:{..._.variations.baseProps,...ie.patch}},virtualWidth:1280})}),p.jsxs("div",{className:"msg-variation-meta",children:[p.jsx("span",{className:"msg-variation-badge",children:String.fromCharCode(65+Ce)}),p.jsxs("div",{className:"msg-variation-content",children:[p.jsx("span",{className:"msg-variation-title",children:ie.title}),p.jsx("span",{className:"msg-variation-summary",children:ie.summary})]})]})]},ie.id??`${_.id}-v-${Ce}`))}):null,_.status==="plan_ready"&&_.pendingPlanId?p.jsxs("div",{className:"msg-plan-actions",children:[_.planPreview?p.jsx(Qse,{preview:_.planPreview}):null,_.destructiveReasons&&_.destructiveReasons.length>0?p.jsx("div",{className:"msg-destructive-warning",role:"alert",children:_.destructiveReasons.map((ie,Ce)=>p.jsxs("div",{className:"msg-destructive-warning-line",children:["⚠ ",ie]},Ce))}):null,(()=>{var pn;const ie=_.pendingPlanId,Ce=Kn||dt!==ie,De=!!(_.destructiveReasons&&_.destructiveReasons.length>0),Ve=((pn=_.planPreview)==null?void 0:pn.diff.pages.filter(rr=>rr.status==="removed").length)??0,Qe=Ve===1?t("plan.deletePage"):Ve>1?t("plan.deletePages",{count:Ve}):t(De?"plan.applyDestructive":"plan.apply");return p.jsxs("div",{className:"msg-plan-btn-row",children:[p.jsx("button",{type:"button",className:`primary-btn msg-plan-btn${De?" is-destructive":""}`,onClick:()=>void Ge.approvePendingPlan(ie),disabled:Ce,children:Qe}),p.jsx("button",{type:"button",className:"secondary-btn msg-plan-btn",onClick:()=>void Ge.stopPendingPlan(ie),disabled:Ce,children:t("plan.discard")})]})})()]}):null,_.imageSwap?(()=>{const ie=_.imageSwap,Ce=/^image$/i.test((ie.fieldLabel??"").trim()),De=ie.fieldLabel&&!(ie.blockDisplayName&&Ce),Ve=ie.blockDisplayName??(De?ie.fieldLabel:null),Qe=ie.blockDisplayName&&De?ie.fieldLabel:null;return p.jsxs("button",{type:"button",className:"msg-image-swap-card",onClick:()=>{zn({slug:ie.slug,blockId:ie.blockId,editablePath:ie.editablePath,currentUrl:ie.imageUrl,blockType:L===ie.blockId?F:void 0})},title:t("ops.imageSwap.pickAnother"),children:[p.jsx("img",{src:ie.imageUrl,alt:ie.altText??""}),p.jsxs("div",{className:"msg-image-swap-meta",children:[Ve?p.jsx("span",{className:"msg-image-swap-block",children:Ve}):null,Qe?p.jsx("span",{className:"msg-image-swap-field",children:Qe}):null,p.jsx("span",{className:"msg-image-swap-action",children:t("ops.imageSwap.pickAnother")})]})]})})():null,_.continuation?p.jsx("div",{className:"msg-plan-actions",children:p.jsxs("button",{type:"button",className:"primary-btn msg-plan-btn",onClick:()=>void Ge.continueChain(_.continuation.chainId),disabled:Kn||Ri!==_.continuation.chainId,children:["Continue: ",_.continuation.nextStepLabel," (",_.continuation.currentStep," of ",_.continuation.totalSteps,")"]})}):null,(()=>{if(_.wasUndone)return null;const ie=(_.mentionedSlugs??[]).filter(Ce=>Ce!==y);return ie.length===0?null:p.jsx("div",{className:"msg-suggestions msg-page-links",children:ie.map((Ce,De)=>p.jsxs("button",{type:"button",className:"msg-suggestion msg-page-link",onClick:()=>{x(Ce)},disabled:Kn,children:["Open ",Ce]},`${_.id}-route-${De}`))})})(),(_.errors??[]).length>0?p.jsx("ul",{className:"msg-errors",children:(G=_.errors)==null?void 0:G.map((ie,Ce)=>p.jsx("li",{children:ie},Ce))}):null,$e&&_.role==="assistant"&&_.debug?p.jsxs("div",{className:"msg-debug-shell",children:[p.jsxs("details",{className:"msg-debug-details",children:[p.jsxs("summary",{className:"msg-debug-summary",children:[p.jsxs("span",{className:"msg-debug-summary-left",children:[p.jsx("span",{className:"msg-debug-title",children:"Debug"}),p.jsx("span",{className:"msg-debug-summary-text",children:$p(_)})]}),p.jsx("span",{className:"msg-debug-chevron","aria-hidden":"true"})]}),p.jsx("div",{className:"msg-debug",children:p.jsxs("ul",{children:[_.debug.traceId?p.jsxs("li",{children:["traceId: ",_.debug.traceId]}):null,_.debug.promptHash?p.jsxs("li",{children:["promptHash: ",_.debug.promptHash]}):null,_.debug.outcome?p.jsxs("li",{children:["outcome: ",_.debug.outcome]}):null,_.debug.reasonCategory?p.jsxs("li",{children:["reason: ",_.debug.reasonCategory]}):null,_.debug.reason&&_.debug.reason!==_.debug.reasonCategory?p.jsxs("li",{children:["reasonDetail: ",_.debug.reason]}):null,_.debug.intent?p.jsxs("li",{children:["intent: ",_.debug.intent]}):null,_.debug.plannerTier?p.jsxs("li",{children:["plannerTier: ",_.debug.plannerTier]}):null,_.debug.modelUsed?p.jsxs("li",{children:["model: ",_.debug.modelUsed,_.debug.plannerSource?` (${_.debug.plannerSource})`:""]}):null,typeof _.debug.planningAttempts=="number"&&_.debug.planningAttempts>1?p.jsxs("li",{children:["planningAttempts: ",_.debug.planningAttempts]}):null,typeof _.debug.opCount=="number"?p.jsxs("li",{children:["opCount: ",_.debug.opCount]}):null,Array.isArray(_.debug.skippedOps)&&_.debug.skippedOps.length>0?p.jsxs("li",{children:["skippedOps: ",_.debug.skippedOps.map(ie=>`[${ie.index}] ${ie.op} ${ie.pageSlug??""}${ie.blockId?"#"+ie.blockId:""}: ${ie.reason}`).join(", ")]}):typeof _.debug.skippedOpCount=="number"&&_.debug.skippedOpCount>0?p.jsxs("li",{children:["skippedOps: ",_.debug.skippedOpCount]}):null,Array.isArray(_.debug.opTypes)&&_.debug.opTypes.length>0?p.jsxs("li",{children:["ops: ",_.debug.opTypes.join(", ")]}):null,typeof _.debug.totalTokens=="number"?p.jsxs("li",{children:["tokens: in:",_.debug.inputTokens??"?"," out:",_.debug.outputTokens??"?"," total:",_.debug.totalTokens]}):null,typeof _.debug.estimatedUsd=="number"?p.jsxs("li",{children:["cost: $",_.debug.estimatedUsd.toFixed(4)]}):null,Array.isArray(_.debug.timeline)&&_.debug.timeline.length>0?p.jsxs("li",{children:["timeline: ",_.debug.timeline.map(ie=>`${ie.stage}:${ie.atMs}ms`).join(" -> ")]}):null,_.debug.promptExcerpt?p.jsxs("li",{children:["prompt: ",_.debug.promptExcerpt]}):null,_.debug.currentPage||_.debug.siteId||_.debug.activeBlockId||_.debug.activeEditablePath?p.jsxs("li",{children:["context: ",[_.debug.currentPage?`page: ${_.debug.currentPage}`:null,_.debug.siteId?`site: ${_.debug.siteId}`:null,_.debug.activeBlockId?`block: ${_.debug.activeBlockId}`:null,_.debug.activeEditablePath?`path: ${_.debug.activeEditablePath}`:null].filter(Boolean).join(", ")]}):null]})})]}),p.jsx("button",{type:"button",className:"msg-debug-copy-btn",onClick:()=>void yy(_),"aria-label":he===_.id?t("chat.copied"):t("chat.copyDebug"),title:he===_.id?t("chat.copied"):t("chat.copy"),children:he===_.id?p.jsx(Fd,{"aria-hidden":"true",size:14}):p.jsx(WS,{"aria-hidden":"true",size:14})})]}):null]})},renderEntryActions:(_,G)=>{var ie,Ce,De;return G&&_.role==="assistant"&&((ie=_.debug)!=null&&ie.traceId)&&_.id!=="welcome"?p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:`msg-feedback-btn ${((Ce=_.feedback)==null?void 0:Ce.rating)==="up"?"msg-feedback-btn--active":""}`,onClick:()=>{_.feedback||Ge.submitFeedback(_.id,"up")},disabled:!!_.feedback,title:t("chat.goodResponse"),children:p.jsx(EF,{"aria-hidden":"true",size:13})}),p.jsx("button",{type:"button",className:`msg-feedback-btn ${((De=_.feedback)==null?void 0:De.rating)==="down"?"msg-feedback-btn--active":""}`,onClick:()=>{_.feedback||(et(Fe===_.id?null:_.id),Ot(""))},disabled:!!_.feedback,title:t("chat.badResponse"),children:p.jsx(wF,{"aria-hidden":"true",size:13})}),_.feedback?p.jsxs("span",{className:"msg-feedback-label",children:[_.feedback.rating==="up"?t("chat.feedbackThanks"):t("chat.feedbackNoted"),_.feedback.note?` — "${_.feedback.note}"`:""]}):null,Fe===_.id&&!_.feedback?p.jsxs("form",{className:"msg-feedback-note-form",onSubmit:Ve=>{Ve.preventDefault(),Ge.submitFeedback(_.id,"down",ft||void 0),et(null),Ot("")},children:[p.jsx("input",{className:"msg-feedback-note-input",placeholder:t("chat.feedbackPlaceholder"),value:ft,onChange:Ve=>Ot(Ve.target.value),autoFocus:!0}),p.jsx("button",{type:"submit",className:"msg-feedback-note-submit",children:t("chat.feedbackSend")})]}):null]}):null},renderStreamingExtras:()=>p.jsxs(p.Fragment,{children:[vo?p.jsx("span",{className:"stream-reconnect-badge stream-reconnect-badge-inline",title:br??void 0,children:vo}):null,$e&&vi?p.jsx("div",{className:"streaming-debug-inline",children:zp}):null]}),renderStreamStatusFallback:()=>p.jsxs("div",{className:`streaming-pill ${nf?"is-error":"is-active"} ${nR==="text"?"is-text":"is-legacy"}`,children:[nR==="text"?p.jsx("span",{className:"streaming-pill-status streaming-pill-status-text",children:Op}):p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"streaming-pill-title",children:p.jsx("span",{className:"streaming-pill-sparkle",children:"✦"})}),p.jsx("span",{className:"streaming-pill-status",children:by}),nf?null:p.jsxs("span",{className:"streaming-dots","aria-hidden":"true",children:[p.jsx("i",{}),p.jsx("i",{}),p.jsx("i",{})]})]}),vo?p.jsx("span",{className:"stream-reconnect-badge",title:br??void 0,children:vo}):null,Pr?p.jsx("div",{className:"image-gen-progress",children:p.jsx("div",{className:"image-gen-progress-fill",style:{width:`${Pr.percent}%`}})}):null,es?p.jsx("button",{type:"button",className:"streaming-jump-btn",onClick:()=>Qt.postToSite("highlightBlock",{blockId:es,editablePath:null,scrollIntoView:!0}),children:"Jump to latest change"}):null,$e&&vi?p.jsx("div",{className:"streaming-debug-inline",children:zp}):null]})})})]}),p.jsx("div",{ref:Ss,className:"composer-splitter",role:"separator","aria-orientation":"horizontal","aria-label":t("resize.inputPanel"),onPointerDown:_=>{oi.current={y:_.clientY,composerHeight:Gt},document.body.style.userSelect="none"}}),Di==="demo"?p.jsx(Kse,{collapsed:yo,onToggle:()=>_s(_=>!_)}):null,p.jsx(kee,{className:"composer",message:P,isLoading:Kn,hasUserEntry:Bp,onMessageChange:R,onSubmit:_=>{R(""),Ge.submitChat(_,P)},onTranscribeAudio:zt.transcribeAudio,onUploadAttachment:zt.uploadAttachment,attachments:Oa,onAttachmentsChange:bo,onCancel:Ge.cancelChat,onAutoHeightChange:Dp,selectionModeEnabled:Ue,onToggleSelectionMode:()=>Ys(),canUndoServer:Ge.canUndoServer,canRedoServer:Ge.canRedoServer,onGlobalUndo:()=>void Ge.applyGlobalUndo(),onGlobalRedo:()=>void Ge.applyGlobalRedo(),undoTooltip:t("chat.undoTooltip"),redoTooltip:t("chat.redoTooltip"),contextChip:L&&F?{label:t("chatInput.editingBlock",{block:((sf=Au()[F])==null?void 0:sf.displayName)??F}),clearLabel:t("chatInput.clearSelection"),onClear:()=>{W(void 0),K(void 0)}}:null})]}),p.jsx("div",{className:"panel-splitter",role:"separator","aria-orientation":"vertical","aria-label":t("resize.chatPanel"),onPointerDown:_=>{const G=jt.current;G&&(Fn.current={x:_.clientX,width:G.offsetWidth,target:"chat"},document.body.style.userSelect="none",document.body.classList.add("panel-resizing"))}}),p.jsx("div",{className:"preview",children:p.jsxs("div",{className:"preview-canvas",ref:Wr,children:[dy?null:p.jsx("div",{className:"preview-loading",role:"status","aria-label":t("preview.loading"),children:p.jsx("span",{className:"preview-loading-spinner","aria-hidden":"true"})}),p.jsx("iframe",{ref:Qt.iframeRef,title:t("preview.title"),src:cc,style:{colorScheme:"light dark"},onLoad:()=>{Tp(!0),e0&&!mr.current&&(mr.current=!0,Wi.current=u),Qt.postToSite("setNestedLabelsVisibility",{visible:X})}})]})}),ko?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"panel-splitter panel-splitter--props",role:"separator","aria-orientation":"vertical","aria-label":t("resize.chatPanel"),onPointerDown:_=>{const G=gr.current;G&&(Fn.current={x:_.clientX,width:G.offsetWidth,target:"props"},document.body.style.userSelect="none",document.body.classList.add("panel-resizing"))}}),p.jsx("aside",{className:"props-panel",ref:gr,children:p.jsx(ak,{fallbackLabel:"Properties panel unavailable — try refreshing",children:p.jsx(Ive,{props:ln.props,status:ln.status,failure:ln.failure,failedSlug:ln.failedSlug,failedOrigin:ln.failedOrigin,onRetry:ln.retry,pageName:Lx(y),onDeselectBlock:()=>{W(void 0),K(void 0)},onClose:rf,navLabel:((of=e.headerConfig.navLabels)==null?void 0:of[y])??"",onNavLabelChange:(_,G)=>{e.updateHeaderConfig({navLabels:{[_]:G}}),Qt.postToSite("draftUpdated",{}),Oe()},pageMeta:nn.meta,onPageMetaChange:(_,G)=>{const ie={...nn.meta,[_]:G};nn.setMeta(ie),(async()=>{try{const Ce=await fetch(`${Be}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:n,siteId:r,ops:[{op:"update_page_meta",pageSlug:y,patch:{[_]:G}}]})}),De=await Ce.json();if(!Ce.ok||De.status!=="applied"){nn.refetch();return}Qt.postToSite("draftUpdated",{}),Oe()}catch{nn.refetch()}})()},onFieldChange:async(_,G)=>{await Ge.inlineEditCommit(y,L,_,G,{silent:!0}),ln.refetch()},onImageClick:(_,G)=>{L&&zn({slug:y,blockId:L,editablePath:_,currentUrl:G,blockType:F})},onAiAssist:hy,onPageAiAssist:ef,onAiQuickAction:py,onPageAiQuickAction:my,onAddListItem:L&&F?_=>{Ge.addListItem(y,L,F,_).then(()=>ln.refetch())}:void 0,onRemoveListItem:L&&F?(_,G)=>{Ge.removeListItem(y,L,F,_,G).then(()=>ln.refetch())}:void 0,manifestByType:d.byType,siteOrigin:u})})})]}):null,ru?p.jsx("div",{className:"history-drawer-backdrop",onClick:()=>ht("chat"),children:p.jsx("aside",{className:"history-drawer",role:"dialog","aria-label":t("health.title"),onClick:_=>_.stopPropagation(),children:p.jsx(ak,{children:p.jsx(Lee,{findings:Mr.findings,isLoading:Mr.isLoading,isRunning:Mr.isRunning,error:Mr.error,durable:Mr.durable,onRun:()=>void Mr.run(),onDismiss:_=>void Mr.setStatus(_,"dismissed"),onSnooze:_=>void Mr.setStatus(_,"snoozed"),onGoTo:uy,onClose:()=>ht("chat")})})})}):null,za?p.jsx("div",{className:"history-drawer-backdrop",onClick:()=>ht("chat"),children:p.jsx("aside",{className:"history-drawer",role:"dialog","aria-label":t("history.title"),onClick:_=>_.stopPropagation(),children:p.jsx(Mee,{session:n,siteId:r,slug:y,visible:za,onRestore:xt,isRestoring:Bt,onDiscarded:it,onClose:()=>ht("chat")})})}):null,Pa&&Pe?p.jsx("div",{ref:Cs,className:"composer--anchored is-expanded",style:{top:Pa.top,left:Pa.left,width:Pa.width},children:p.jsx(Ij,{message:P,isLoading:Kn,hasUserEntry:Bp,onMessageChange:R,onSubmit:_=>{R(""),Ge.submitChat(_,P)},onTranscribeAudio:zt.transcribeAudio,onUploadAttachment:zt.uploadAttachment,attachments:Oa,onAttachmentsChange:bo,onCancel:Ge.cancelChat,onAutoHeightChange:()=>{},compact:!0})}):null,mt?(()=>{const _=mt,G=_.options.find(ie=>ie.id===cr)??null;return p.jsx("div",{className:"variation-modal-backdrop",onClick:()=>{we||Pt(null)},children:p.jsxs("div",{className:"variation-modal",role:"dialog","aria-modal":"true","aria-label":t("variation.title"),onClick:ie=>ie.stopPropagation(),children:[p.jsxs("div",{className:"variation-modal-header",children:[p.jsx("h2",{children:"Choose a Variation"}),p.jsx("button",{type:"button",className:"settings-close-btn","aria-label":t("variation.close"),onClick:()=>Pt(null),disabled:we,children:"×"})]}),p.jsx("div",{className:"variation-modal-body",children:_.options.map((ie,Ce)=>p.jsxs("article",{className:`variation-card${ie.id===cr?" is-selected":""}`,onClick:()=>fn(ie.id),children:[p.jsxs("div",{className:"variation-card-preview-wrap",children:[p.jsx("span",{className:"variation-card-badge",children:String.fromCharCode(65+Ce)}),p.jsx(kN,{virtualWidth:vG.desktop,block:{id:_.blockId,type:_.blockType,props:jG(_.baseProps,ie.patch)}}),ie.imagePending?p.jsxs("div",{className:"variation-card-image-pending","aria-live":"polite",children:[p.jsx("span",{className:"variation-card-image-pending-spinner","aria-hidden":"true"}),p.jsx("span",{className:"variation-card-image-pending-label",children:"Generating image…"})]}):null]}),p.jsx("h3",{className:"variation-card-title",children:ie.title}),p.jsx("p",{className:"variation-card-summary",children:ie.summary})]},ie.id))}),p.jsx("div",{className:"variation-modal-footer",children:p.jsx("button",{type:"button",className:"publish-preview-btn variation-apply-btn",onClick:()=>{G&&Ge.applyVariation(G)},disabled:we||!G,children:we?t("variation.applying"):t("variation.apply",{title:(G==null?void 0:G.title)??""})})})]})})})():null,ct?p.jsx("div",{className:"add-block-modal-backdrop",onClick:()=>{nt||Xt(null)},children:p.jsxs("div",{className:"add-block-modal",role:"dialog","aria-modal":"true","aria-label":t("addBlock.title"),onClick:_=>_.stopPropagation(),children:[p.jsxs("div",{className:"add-block-modal-header",children:[p.jsx("h2",{children:"Add block"}),p.jsx("p",{children:ct.beforeBlockId&&!ct.afterBlockId?t("addBlock.insertAbove"):t("addBlock.insertBelow")}),p.jsx("button",{type:"button",className:"settings-close-btn","aria-label":t("addBlock.close"),onClick:()=>Xt(null),disabled:nt,children:"×"})]}),p.jsxs("div",{className:"add-block-modal-body",children:[p.jsx("label",{className:"add-block-search",children:p.jsx("input",{type:"search",value:kt,onChange:_=>St(_.target.value),placeholder:t("addBlock.searchPlaceholder"),disabled:nt})}),ja.length===0?p.jsx("p",{className:"add-block-empty",children:"No block types match your search."}):p.jsx("div",{className:"add-block-flat-list",children:ja.flatMap(_=>_.options).map(_=>p.jsxs("button",{type:"button",className:"add-block-option",disabled:nt,onClick:async()=>{var Ce;if(!ct||nt)return;gn(!0);const G=(Ce=d.byType.get(_.type))==null?void 0:Ce.defaultProps,ie=await Ge.addBlockAfter(ct.slug,ct.afterBlockId,_.type,ct.beforeBlockId,G);gn(!1),ie&&Xt(null)},children:[p.jsx("span",{className:"add-block-option-label",children:_.label}),p.jsx("span",{className:"add-block-option-actions","aria-hidden":"true",children:p.jsx("span",{className:"add-block-option-plus",children:"+"})})]},_.type))})]})]})}):null,p.jsx(Tse,{open:oe,onOpenChange:He,useStreaming:O,onStreamingChange:U,showNestedLabels:X,onNestedLabelsChange:z,chatDarkMode:i,chatThemePreference:s,onChatThemePreferenceChange:o,showDebugDetails:$e,onDebugDetailsChange:bt,fieldDraftDebugEnabled:vi,onFieldDraftDebugChange:li,autoScrollTrackingEnabled:Q,onAutoScrollTrackingChange:le,autoOpenPropertiesEnabled:I,onAutoOpenPropertiesChange:$,provider:A,modelKey:w,availableProviders:j,onModelChange:(_,G)=>{M(_),T(G)},onClearChat:Ge.clearChat,agentModeEnabled:Tr.agentMode??!1,showDevOptions:Ae,onShowDevOptionsChange:ne?ee:void 0}),p.jsx(qse,{open:_e,onOpenChange:ze,onConfirm:_=>void Vt.publishSite(_),chatLog:ai,isPublishing:Vt.isPublishing,session:n,siteId:r,siteOrigin:u}),p.jsx(_O,{sites:e,onPreviewRefresh:()=>{Qt.postToSite("draftUpdated",{}),Oe()}}),p.jsx(tce,{open:tn,features:{...Tr,googleDrive:Tr.googleDrive||!!((fc=a.gdriveFolderId)!=null&&fc.trim())},currentUrl:Nt==null?void 0:Nt.currentUrl,gdriveFolderId:a.gdriveFolderId,cmsMedia:a.cmsMedia,siteOrigin:u,onClose:()=>zn(null),onSelect:(_,G)=>{var mc;if(!Nt)return;const{slug:ie,blockId:Ce,editablePath:De,currentUrl:Ve,blockType:Qe}=Nt,pn=qF(De),rr=De.match(/^([a-zA-Z_]+)\[(\d+)\]\.(.+)$/),En=pn!==De?pn.match(/^([a-zA-Z_]+)\[(\d+)\]\.(.+)$/):null;let ts,Ts;if(rr){const[,ns,rs,gc]=rr,Fa={[gc]:_};En&&(Fa[En[3]]=G),ts=[{op:"update_item",pageSlug:ie,blockId:Ce,listKey:ns,index:Number(rs),patch:Fa}],Ts=`${ns}[${rs}].${gc}`}else{const ns={[De]:_};pn!==De&&(ns[pn]=G),ts=[{op:"update_props",pageSlug:ie,blockId:Ce,patch:ns}],Ts=De}const hc=Qe??(Ce===L?F:void 0)??(Ce===L&&ln.blockType?ln.blockType:void 0),Up=hc?((mc=Au()[hc])==null?void 0:mc.displayName)??hc:void 0,pc={imageUrl:_,previousUrl:Ve,altText:G,slug:ie,blockId:Ce,editablePath:De,blockDisplayName:Up,fieldLabel:gke(Ts)};(async()=>{try{const ns=await fetch(`${Be}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Ls({session:n,siteId:r,ops:ts},d.manifest))}),rs=await ns.json();ns.ok&&rs.status==="applied"?(Qt.postToSite("draftUpdated",{focusBlockId:Ce}),Oe(),Ge.pushAssistantFromResult({status:"applied",summary:t("ops.changedImage")},{canUndo:!0,imageSwap:pc}),ln.refetch()):(console.error("[ImagePicker] ops failed:",ns.status,rs.error,rs.details??"","ops:",JSON.stringify(ts)),Ge.pushAssistantFromResult({status:"error",summary:t("ops.imageChangeFailed")},{imageSwap:{...pc,imageUrl:Ve??_}}))}catch(ns){console.error("[ImagePicker] ops failed:",ns),Ge.pushAssistantFromResult({status:"error",summary:t("ops.imageChangeFailed")},{imageSwap:{...pc,imageUrl:Ve??_}})}})()}}),ake?p.jsx(_ee,{onTry:_=>void Ge.submitChat(_),onAction:_=>{_==="heroImage"&&Ia()}}):null]})}const Ng=Be,lk={position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"#0a0a0a",fontFamily:"system-ui, sans-serif",zIndex:99999},uk={display:"flex",flexDirection:"column",gap:12,width:320,padding:32,borderRadius:12,background:"#18181b",border:"1px solid #27272a"},ck={padding:"10px 16px",borderRadius:8,border:"none",background:"#3b82f6",color:"#fff",fontSize:14,fontWeight:500,cursor:"pointer"};function yke({children:e}){const{t}=Mn(),[n,r]=E.useState("checking"),[i,s]=E.useState(""),[o,a]=E.useState(!1),[u,d]=E.useState(""),[f,m]=E.useState(!1),[g,y]=E.useState(0),v=Math.min(15e3,1500*2**Math.max(0,g-1));E.useEffect(()=>{let w=!0;return r("checking"),fetch(`${Ng}/auth/status`).then(T=>{if(!T.ok)throw new Error(`auth/status ${T.status}`);return T.json()}).then(T=>{if(w){if(T.mode==="closed"){lg(),d(typeof T.reason=="string"?T.reason:""),r("closed");return}if(!T.gateEnabled)lg(),r("open");else{const A=!!localStorage.getItem(sS),M=r2().length>0;r(A&&M?"open":"locked")}}}).catch(()=>{w&&r("unreachable")}),()=>{w=!1}},[g]),E.useEffect(()=>{if(n!=="unreachable")return;const w=setTimeout(()=>y(T=>T+1),v);return()=>clearTimeout(w)},[n,g,v]);const S=async w=>{w.preventDefault(),m(!0),a(!1);try{const T=await fetch(`${Ng}/auth/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:i.trim()})}),A=await T.json().catch(()=>({}));T.ok?(localStorage.setItem(sS,"1"),Qoe(A.accessToken??""),r("open")):(lg(),a(!0))}catch{lg(),a(!0)}m(!1)};return n==="checking"?null:n==="open"?p.jsx(p.Fragment,{children:e}):n==="closed"?p.jsx("div",{style:lk,children:p.jsxs("div",{style:{...uk,width:420},children:[p.jsx("h2",{style:{margin:0,color:"#fafafa",fontSize:18},children:t("password.closedTitle")}),p.jsx("p",{style:{margin:0,color:"#a1a1aa",fontSize:13,lineHeight:1.5},children:u||t("password.closedBody")}),p.jsx("p",{style:{margin:0,color:"#a1a1aa",fontSize:13,lineHeight:1.5},children:t("password.closedFix")}),p.jsxs("code",{style:{color:"#71717a",fontSize:12,wordBreak:"break-all"},children:[Ng,"/auth/status"]}),p.jsx("button",{type:"button",onClick:()=>y(w=>w+1),style:ck,children:t("password.retry")})]})}):n==="unreachable"?p.jsx("div",{style:lk,children:p.jsxs("div",{style:{...uk,width:380},children:[p.jsx("h2",{style:{margin:0,color:"#fafafa",fontSize:18},children:t("password.unreachableTitle")}),p.jsx("p",{style:{margin:0,color:"#a1a1aa",fontSize:13,lineHeight:1.5},children:t("password.unreachableBody")}),p.jsxs("code",{style:{color:"#71717a",fontSize:12,wordBreak:"break-all"},children:[Ng,"/auth/status"]}),p.jsx("button",{type:"button",onClick:()=>y(w=>w+1),style:ck,children:t("password.retry")}),p.jsx("p",{style:{margin:0,color:"#71717a",fontSize:12},"aria-live":"polite",children:t("password.retryingIn",{seconds:String(Math.round(v/1e3))})})]})}):p.jsx("div",{style:lk,children:p.jsxs("form",{onSubmit:S,style:uk,children:[p.jsx("h2",{style:{margin:0,color:"#fafafa",fontSize:18},children:t("password.title")}),p.jsx("input",{type:"password",value:i,onChange:w=>s(w.target.value),placeholder:t("password.placeholder"),autoFocus:!0,style:{padding:"10px 12px",borderRadius:8,border:o?"1px solid #ef4444":"1px solid #3f3f46",background:"#09090b",color:"#fafafa",fontSize:14,outline:"none"}}),o&&p.jsx("span",{style:{color:"#ef4444",fontSize:13},children:t("password.incorrect")}),p.jsx("button",{type:"submit",disabled:f||!i.trim(),style:{...ck,opacity:f||!i.trim()?.5:1},children:t(f?"password.checking":"password.continue")})]})})}nae();MB.createRoot(document.getElementById("root")).render(p.jsx(E.StrictMode,{children:p.jsxs(zF,{children:[p.jsx(yke,{children:p.jsx(mke,{})}),p.jsx(FB,{})]})}));export{kke as $,Pre as A,wke as B,zre as C,Pw as D,Au as E,zw as F,lF as G,U4 as H,mp as I,wce as J,kee as K,tce as L,Be as M,Uh as N,Q4 as O,kn as P,Lx as Q,Ore as R,Noe as S,Vd as T,NF as U,Mee as V,Cb as W,EG as X,CG as Y,r6 as Z,HB as _,hd as a,Fk as a0,fe as a1,xce as a2,kce as a3,ka as a4,Dl as a5,lc as a6,Qn as a7,_r as a8,vt as a9,a5 as aA,Ub as aB,_de as aC,Tde as aD,Mde as aE,d5 as aF,Ude as aG,u5 as aH,gs as aI,s5 as aJ,l5 as aK,Ide as aL,zde as aM,Pde as aN,mM as aO,qde as aP,Sa as aQ,qe as aR,Lde as aS,Bde as aT,$r as aU,Hr as aV,Rt as aa,ut as ab,S0e as ac,bD as ad,Q2 as ae,Vz as af,J6 as ag,Cge as ah,kge as ai,h6 as aj,x2 as ak,Jl as al,g2 as am,QP as an,ld as ao,W5 as ap,Ohe as aq,lo as ar,Ne as as,Jd as at,c5 as au,k2 as av,Dde as aw,Ade as ax,Nde as ay,r5 as az,Wn as b,st as c,on as d,Eb as e,Lw as f,hI as g,N6 as h,Bw as i,p as j,gp as k,Ed as l,v6 as m,Lre as n,qn as o,Bd as p,FF as q,E as r,yR as s,UF as t,t0 as u,qd as v,LF as w,kq as x,xj as y,yj as z};