denchclaw 3.0.7 → 3.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/web/.next/standalone/apps/web/.next/BUILD_ID +1 -1
- package/apps/web/.next/standalone/apps/web/.next/app-build-manifest.json +160 -160
- package/apps/web/.next/standalone/apps/web/.next/app-path-routes-manifest.json +46 -46
- package/apps/web/.next/standalone/apps/web/.next/build-manifest.json +2 -2
- package/apps/web/.next/standalone/apps/web/.next/cache/config.json +3 -3
- package/apps/web/.next/standalone/apps/web/.next/prerender-manifest.json +3 -3
- package/apps/web/.next/standalone/apps/web/.next/required-server-files.json +1 -1
- package/apps/web/.next/standalone/apps/web/.next/routes-manifest.json +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/apps/cron/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/apps/proxy/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/apps/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/apps/serve/[...path]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/apps/store/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/apps/webhooks/[...path]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/active/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/runs/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/stop/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/stop/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/stream/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/subagents/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/callback/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/connect/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/connections/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/disconnect/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/status/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/composio/toolkits/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/calendar/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/calendar/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/companies/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/enrich/[type]/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/inbox/[threadId]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/inbox/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/people/[id]/activity/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/people/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/people/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/photos/proxy/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/crm/photos/sync/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/heartbeat/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/jobs/[jobId]/runs/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/jobs/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/runs/[sessionId]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/runs/search-transcript/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/feedback/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/feedback/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/gateway/channels/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/gateway/chat/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/gateway/chat/stream/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/gateway/sessions/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/gateway/sessions/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/integrations/[id]/toggle/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/integrations/repair/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/integrations/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/memories/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/connections/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/connections/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/dench-cloud/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/dench-cloud/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/identity/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/identity/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/state/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/state/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/sync/progress/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/sync/start/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/onboarding/sync/start/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/profiles/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/profiles/switch/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/sessions/[sessionId]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/settings/cloud/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/settings/mcp/connect/callback/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/settings/mcp/connect/start/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/settings/mcp/connect/token/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/settings/mcp/probe/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/settings/mcp/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/skills/[slug]/content/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/skills/[slug]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/skills/browse/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/skills/install/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/sync/poll-tick/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/sync/refresh/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/sync/status/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/terminal/port/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/voice/speech/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/voice/transcribe/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/voice/voices/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/web-sessions/[id]/messages/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/web-sessions/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/web-sessions/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/web-sessions/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/assets/[...path]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/browse/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/browse-file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/context/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/copy/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/db/introspect/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/db/query/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/delete/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/delete/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/enrichment-status/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/execute/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/init/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/init/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/link-preview/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/list/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/mkdir/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/move/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/actions/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/actions/runs/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/display-field/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/enrich/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/[id]/content/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/bulk-delete/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/options/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/fields/[fieldId]/enum-rename/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/fields/[fieldId]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/fields/reorder/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/fields/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/icon/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/views/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/open-file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/path-info/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/query/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/raw-file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/rename/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/reports/execute/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/reports/execute/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/search-index/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/suggest-files/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/switch/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/switch/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/thumbnail/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/tree/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/upload/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/upload/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/virtual-file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/watch/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/write-binary/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/page.js +2 -2
- package/apps/web/.next/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/workspace/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app-paths-manifest.json +46 -46
- package/apps/web/.next/standalone/apps/web/.next/server/chunks/44877.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/chunks/6787.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/functions-config-manifest.json +27 -27
- package/apps/web/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/pages-manifest.json +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/apps/web/.next/{static/chunks/app/layout-ee82511fd3b3535c.js → standalone/apps/web/.next/static/chunks/app/layout-85ffca38316611ae.js} +1 -1
- package/apps/web/.next/{static/chunks/app/page-9807308c53842594.js → standalone/apps/web/.next/static/chunks/app/page-4146c0b4d91e569a.js} +1 -1
- package/apps/web/.next/standalone/apps/web/server.js +1 -1
- package/apps/web/.next/standalone/extensions/posthog-analytics/lib/build-env.js +1 -1
- package/apps/web/.next/standalone/package.json +1 -1
- package/apps/web/.next/{standalone/apps/web/.next/static/chunks/app/layout-ee82511fd3b3535c.js → static/chunks/app/layout-85ffca38316611ae.js} +1 -1
- package/apps/web/.next/{standalone/apps/web/.next/static/chunks/app/page-9807308c53842594.js → static/chunks/app/page-4146c0b4d91e569a.js} +1 -1
- package/assets/seed/workspace.duckdb +0 -0
- package/extensions/posthog-analytics/lib/build-env.js +1 -1
- package/package.json +1 -1
- /package/apps/web/.next/standalone/apps/web/.next/static/{Kn0eGggG_93j-3RbQBLdh → WH35QoTAVVkSSaVAY2fY2}/_buildManifest.js +0 -0
- /package/apps/web/.next/standalone/apps/web/.next/static/{Kn0eGggG_93j-3RbQBLdh → WH35QoTAVVkSSaVAY2fY2}/_ssgManifest.js +0 -0
- /package/apps/web/.next/static/{Kn0eGggG_93j-3RbQBLdh → WH35QoTAVVkSSaVAY2fY2}/_buildManifest.js +0 -0
- /package/apps/web/.next/static/{Kn0eGggG_93j-3RbQBLdh → WH35QoTAVVkSSaVAY2fY2}/_ssgManifest.js +0 -0
|
@@ -187,7 +187,7 @@ ${a}</tr>
|
|
|
187
187
|
`}tablecell(a){let b=this.parser.parseInline(a.tokens),c=a.header?"th":"td";return(a.align?`<${c} align="${a.align}">`:`<${c}>`)+b+`</${c}>
|
|
188
188
|
`}strong({tokens:a}){return`<strong>${this.parser.parseInline(a)}</strong>`}em({tokens:a}){return`<em>${this.parser.parseInline(a)}</em>`}codespan({text:a}){return`<code>${an(a,!0)}</code>`}br(a){return"<br>"}del({tokens:a}){return`<del>${this.parser.parseInline(a)}</del>`}link({href:a,title:b,tokens:c}){let d=this.parser.parseInline(c),e=ao(a);if(null===e)return d;let f='<a href="'+(a=e)+'"';return b&&(f+=' title="'+an(b)+'"'),f+=">"+d+"</a>"}image({href:a,title:b,text:c,tokens:d}){d&&(c=this.parser.parseInline(d,this.parser.textRenderer));let e=ao(a);if(null===e)return an(c);a=e;let f=`<img src="${a}" alt="${an(c)}"`;return b&&(f+=` title="${an(b)}"`),f+=">"}text(a){return"tokens"in a&&a.tokens?this.parser.parseInline(a.tokens):"escaped"in a&&a.escaped?a.text:an(a.text)}},av=class{strong({text:a}){return a}em({text:a}){return a}codespan({text:a}){return a}del({text:a}){return a}html({text:a}){return a}text({text:a}){return a}link({text:a}){return""+a}image({text:a}){return""+a}br(){return""}checkbox({raw:a}){return a}},aw=class a{options;renderer;textRenderer;constructor(a){this.options=a||j,this.options.renderer=this.options.renderer||new au,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new av}static parse(b,c){return new a(c).parse(b)}static parseInline(b,c){return new a(c).parseInline(b)}parse(a){let b="";for(let c=0;c<a.length;c++){let d=a[c];if(this.options.extensions?.renderers?.[d.type]){let a=this.options.extensions.renderers[d.type].call({parser:this},d);if(!1!==a||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){b+=a||"";continue}}switch(d.type){case"space":b+=this.renderer.space(d);break;case"hr":b+=this.renderer.hr(d);break;case"heading":b+=this.renderer.heading(d);break;case"code":b+=this.renderer.code(d);break;case"table":b+=this.renderer.table(d);break;case"blockquote":b+=this.renderer.blockquote(d);break;case"list":b+=this.renderer.list(d);break;case"checkbox":b+=this.renderer.checkbox(d);break;case"html":b+=this.renderer.html(d);break;case"def":b+=this.renderer.def(d);break;case"paragraph":b+=this.renderer.paragraph(d);break;case"text":b+=this.renderer.text(d);break;default:{let a='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw Error(a)}}}return b}parseInline(a,b=this.renderer){let c="";for(let d=0;d<a.length;d++){let e=a[d];if(this.options.extensions?.renderers?.[e.type]){let a=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==a||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(e.type)){c+=a||"";continue}}switch(e.type){case"escape":case"text":c+=b.text(e);break;case"html":c+=b.html(e);break;case"link":c+=b.link(e);break;case"image":c+=b.image(e);break;case"checkbox":c+=b.checkbox(e);break;case"strong":c+=b.strong(e);break;case"em":c+=b.em(e);break;case"codespan":c+=b.codespan(e);break;case"br":c+=b.br(e);break;case"del":c+=b.del(e);break;default:{let a='Token with "'+e.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw Error(a)}}}return c}},ax=class{options;block;constructor(a){this.options=a||j}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(a){return a}postprocess(a){return a}processAllTokens(a){return a}emStrongMask(a){return a}provideLexer(){return this.block?at.lex:at.lexInline}provideParser(){return this.block?aw.parse:aw.parseInline}},ay=new class{defaults=i();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=aw;Renderer=au;TextRenderer=av;Lexer=at;Tokenizer=as;Hooks=ax;constructor(...a){this.use(...a)}walkTokens(a,b){let c=[];for(let d of a)switch(c=c.concat(b.call(this,d)),d.type){case"table":for(let a of d.header)c=c.concat(this.walkTokens(a.tokens,b));for(let a of d.rows)for(let d of a)c=c.concat(this.walkTokens(d.tokens,b));break;case"list":c=c.concat(this.walkTokens(d.items,b));break;default:{let a=d;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(d=>{let e=a[d].flat(1/0);c=c.concat(this.walkTokens(e,b))}):a.tokens&&(c=c.concat(this.walkTokens(a.tokens,b)))}}return c}use(...a){let b=this.defaults.extensions||{renderers:{},childTokens:{}};return a.forEach(a=>{let c={...a};if(c.async=this.defaults.async||c.async||!1,a.extensions&&(a.extensions.forEach(a=>{if(!a.name)throw Error("extension name required");if("renderer"in a){let c=b.renderers[a.name];c?b.renderers[a.name]=function(...b){let d=a.renderer.apply(this,b);return!1===d&&(d=c.apply(this,b)),d}:b.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||"block"!==a.level&&"inline"!==a.level)throw Error("extension level must be 'block' or 'inline'");let c=b[a.level];c?c.unshift(a.tokenizer):b[a.level]=[a.tokenizer],a.start&&("block"===a.level?b.startBlock?b.startBlock.push(a.start):b.startBlock=[a.start]:"inline"===a.level&&(b.startInline?b.startInline.push(a.start):b.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(b.childTokens[a.name]=a.childTokens)}),c.extensions=b),a.renderer){let b=this.defaults.renderer||new au(this.defaults);for(let c in a.renderer){if(!(c in b))throw Error(`renderer '${c}' does not exist`);if(["options","parser"].includes(c))continue;let d=a.renderer[c],e=b[c];b[c]=(...a)=>{let c=d.apply(b,a);return!1===c&&(c=e.apply(b,a)),c||""}}c.renderer=b}if(a.tokenizer){let b=this.defaults.tokenizer||new as(this.defaults);for(let c in a.tokenizer){if(!(c in b))throw Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;let d=a.tokenizer[c],e=b[c];b[c]=(...a)=>{let c=d.apply(b,a);return!1===c&&(c=e.apply(b,a)),c}}c.tokenizer=b}if(a.hooks){let b=this.defaults.hooks||new ax;for(let c in a.hooks){if(!(c in b))throw Error(`hook '${c}' does not exist`);if(["options","block"].includes(c))continue;let d=a.hooks[c],e=b[c];ax.passThroughHooks.has(c)?b[c]=a=>{if(this.defaults.async&&ax.passThroughHooksRespectAsync.has(c))return(async()=>{let c=await d.call(b,a);return e.call(b,c)})();let f=d.call(b,a);return e.call(b,f)}:b[c]=(...a)=>{if(this.defaults.async)return(async()=>{let c=await d.apply(b,a);return!1===c&&(c=await e.apply(b,a)),c})();let c=d.apply(b,a);return!1===c&&(c=e.apply(b,a)),c}}c.hooks=b}if(a.walkTokens){let b=this.defaults.walkTokens,d=a.walkTokens;c.walkTokens=function(a){let c=[];return c.push(d.call(this,a)),b&&(c=c.concat(b.call(this,a))),c}}this.defaults={...this.defaults,...c}}),this}setOptions(a){return this.defaults={...this.defaults,...a},this}lexer(a,b){return at.lex(a,b??this.defaults)}parser(a,b){return aw.parse(a,b??this.defaults)}parseMarkdown(a){return(b,c)=>{let d={...c},e={...this.defaults,...d},f=this.onError(!!e.silent,!!e.async);if(!0===this.defaults.async&&!1===d.async)return f(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof b>"u"||null===b)return f(Error("marked(): input parameter is undefined or null"));if("string"!=typeof b)return f(Error("marked(): input parameter is of type "+Object.prototype.toString.call(b)+", string expected"));if(e.hooks&&(e.hooks.options=e,e.hooks.block=a),e.async)return(async()=>{let c=e.hooks?await e.hooks.preprocess(b):b,d=await (e.hooks?await e.hooks.provideLexer():a?at.lex:at.lexInline)(c,e),f=e.hooks?await e.hooks.processAllTokens(d):d;e.walkTokens&&await Promise.all(this.walkTokens(f,e.walkTokens));let g=await (e.hooks?await e.hooks.provideParser():a?aw.parse:aw.parseInline)(f,e);return e.hooks?await e.hooks.postprocess(g):g})().catch(f);try{e.hooks&&(b=e.hooks.preprocess(b));let c=(e.hooks?e.hooks.provideLexer():a?at.lex:at.lexInline)(b,e);e.hooks&&(c=e.hooks.processAllTokens(c)),e.walkTokens&&this.walkTokens(c,e.walkTokens);let d=(e.hooks?e.hooks.provideParser():a?aw.parse:aw.parseInline)(c,e);return e.hooks&&(d=e.hooks.postprocess(d)),d}catch(a){return f(a)}}}onError(a,b){return c=>{if(c.message+=`
|
|
189
189
|
Please report this to https://github.com/markedjs/marked.`,a){let a="<p>An error occurred:</p><pre>"+an(c.message+"",!0)+"</pre>";return b?Promise.resolve(a):a}if(b)return Promise.reject(c);throw c}}};function az(a,b){return ay.parse(a,b)}function aA(a,b){let c=b.split("\n").flatMap(a=>[a,""]).map(b=>`${a}${b}`).join("\n");return c.slice(0,c.length-1)}function aB(a){let b=(a.raw||a.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return b?{isTask:!0,checked:"x"===b[2].toLowerCase(),indentLevel:b[1].length}:{isTask:!1,indentLevel:0}}function aC(a,b){return"string"!=typeof a?"json":b}az.options=az.setOptions=function(a){return ay.setOptions(a),az.defaults=ay.defaults,j=az.defaults,az},az.getDefaults=i,az.defaults=j,az.use=function(...a){return ay.use(...a),az.defaults=ay.defaults,j=az.defaults,az},az.walkTokens=function(a,b){return ay.walkTokens(a,b)},az.parseInline=ay.parseInline,az.Parser=aw,az.parser=aw.parse,az.Renderer=au,az.TextRenderer=av,az.Lexer=at,az.lexer=at.lex,az.Tokenizer=as,az.Hooks=ax,az.parse=az,az.options,az.setOptions,az.use,az.walkTokens,az.parseInline,aw.parse,at.lex;var aD=class{constructor(a){var b,c,d,e,f;this.baseExtensions=[],this.extensions=[],this.lastParseResult=null,this.markedInstance=null!=(b=null==a?void 0:a.marked)?b:az,this.lexer=new this.markedInstance.Lexer,this.indentStyle=null!=(d=null==(c=null==a?void 0:a.indentation)?void 0:c.style)?d:"space",this.indentSize=null!=(f=null==(e=null==a?void 0:a.indentation)?void 0:e.size)?f:2,this.baseExtensions=(null==a?void 0:a.extensions)||[],(null==a?void 0:a.markedOptions)&&"function"==typeof this.markedInstance.setOptions&&this.markedInstance.setOptions(a.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,(null==a?void 0:a.extensions)&&(this.baseExtensions=a.extensions,(0,h.tp)(a.extensions).forEach(a=>this.registerExtension(a,!1))),this.lexer=new this.markedInstance.Lexer}get instance(){return this.markedInstance}get indentCharacter(){return"space"===this.indentStyle?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(a,b=!0){var c,d;this.extensions.push(a);let e=a.name,f=(0,h.iI)(a,"markdownTokenName")||e,g=(0,h.iI)(a,"parseMarkdown"),i=(0,h.iI)(a,"renderMarkdown"),j=(0,h.iI)(a,"markdownTokenizer"),k=null!=(c=(0,h.iI)(a,"markdownOptions"))?c:null,l={tokenName:f,nodeName:e,parseMarkdown:g,renderMarkdown:i,isIndenting:null!=(d=null==k?void 0:k.indentsContent)&&d,tokenizer:j};if(f&&g){let a=this.registry.get(f)||[];a.push(l),this.registry.set(f,a)}if(i){let a=this.nodeTypeRegistry.get(e)||[];a.push(l),this.nodeTypeRegistry.set(e,a)}j&&this.hasMarked()&&(this.registerTokenizer(j),b&&(this.lexer=new this.markedInstance.Lexer))}registerTokenizer(a){if(!this.hasMarked())return;let{name:b,start:c,level:d="inline",tokenize:e}=a,f={inlineTokens:a=>this.lexer.inlineTokens(a),blockTokens:a=>this.lexer.blockTokens(a)};this.markedInstance.use({extensions:[{name:b,level:d,start:c?"function"==typeof c?c:a=>a.indexOf(c):a=>{let b=e(a,[],f);return b&&b.raw?a.indexOf(b.raw):-1},tokenizer:(a,c)=>{let d=e(a,c,f);if(d&&d.type)return{...d,type:d.type||b,raw:d.raw||"",tokens:d.tokens||[]}},childTokens:[]}]})}getHandlersForToken(a){try{return this.registry.get(a)||[]}catch{return[]}}getHandlerForToken(a){let b=this.getHandlersForToken(a);if(b.length>0)return b[0];let c=this.getHandlersForNodeType(a);return c.length>0?c[0]:void 0}getHandlersForNodeType(a){try{return this.nodeTypeRegistry.get(a)||[]}catch{return[]}}serialize(a){return a?(Array.isArray(a),this.renderNodes(a,a)):""}parse(a){if(!this.hasMarked())throw Error("No marked instance available for parsing");let b=this.markedInstance.lexer(a);return{type:"doc",content:this.parseTokens(b)}}parseTokens(a){return a.map(a=>this.parseToken(a)).filter(a=>null!==a).flatMap(a=>Array.isArray(a)?a:[a])}parseToken(a){if(!a.type)return null;if("list"===a.type)return this.parseListToken(a);let b=this.getHandlersForToken(a.type),c=this.createParseHelpers();if(b.find(b=>{if(!b.parseMarkdown)return!1;let d=b.parseMarkdown(a,c),e=this.normalizeParseResult(d);return!(!e||Array.isArray(e)&&!(e.length>0))&&(this.lastParseResult=e,!0)})&&this.lastParseResult){let a=this.lastParseResult;return this.lastParseResult=null,a}return this.parseFallbackToken(a)}parseListToken(a){if(!a.items||0===a.items.length)return this.parseTokenWithHandlers(a);let b=a.items.some(a=>aB(a).isTask),c=a.items.some(a=>!aB(a).isTask);if(!b||!c||0===this.getHandlersForToken("taskList").length)return this.parseTokenWithHandlers(a);let d=[],e=[],f=null;for(let b=0;b<a.items.length;b+=1){let c=a.items[b],{isTask:g,checked:h,indentLevel:i}=aB(c),j=c;if(g){let a=(c.raw||c.text||"").split("\n"),b=a[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),d=b?b[2]:"",e=[];if(a.length>1&&a.slice(1).join("\n").trim()){let b=a.slice(1),c=b.filter(a=>a.trim());if(c.length>0){let a=Math.min(...c.map(a=>a.length-a.trimStart().length)),d=b.map(b=>b.trim()?b.slice(a):"").join("\n").trim();d&&(e=this.markedInstance.lexer(`${d}
|
|
190
|
-
`))}}j={type:"taskItem",raw:"",mainContent:d,indentLevel:i,checked:null!=h&&h,text:d,tokens:this.lexer.inlineTokens(d),nestedTokens:e}}let k=g?"taskList":"list";f!==k?(e.length>0&&d.push({type:f,items:e}),e=[j],f=k):e.push(j)}e.length>0&&d.push({type:f,items:e});let g=[];for(let b=0;b<d.length;b+=1){let c=d[b],e={...a,type:c.type,items:c.items},f=this.parseToken(e);f&&(Array.isArray(f)?g.push(...f):g.push(f))}return g.length>0?g:null}parseTokenWithHandlers(a){if(!a.type)return null;let b=this.getHandlersForToken(a.type),c=this.createParseHelpers();if(b.find(b=>{if(!b.parseMarkdown)return!1;let d=b.parseMarkdown(a,c),e=this.normalizeParseResult(d);return!(!e||Array.isArray(e)&&!(e.length>0))&&(this.lastParseResult=e,!0)})&&this.lastParseResult){let a=this.lastParseResult;return this.lastParseResult=null,a}return this.parseFallbackToken(a)}createParseHelpers(){return{parseInline:a=>this.parseInlineTokens(a),parseChildren:a=>this.parseTokens(a),createTextNode:(a,b)=>({type:"text",text:a,marks:b||void 0}),createNode:(a,b,c)=>{let d={type:a,attrs:b||void 0,content:c||void 0};return b&&0!==Object.keys(b).length||delete d.attrs,d},applyMark:(a,b,c)=>({mark:a,content:b,attrs:c&&Object.keys(c).length>0?c:void 0})}}escapeRegex(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(a){var b,c,d,e;let f=[];for(let g=0;g<a.length;g+=1){let h=a[g];if("text"===h.type)f.push({type:"text",text:h.text||""});else if("html"===h.type){let i=(null!=(c=null!=(b=h.raw)?b:h.text)?c:"").toString(),j=/^<\/[\s]*[\w-]+/i.test(i),k=i.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!j&&k&&!/\/>$/.test(i)){let b=k[1],c=this.escapeRegex(b),h=RegExp(`^<\\/\\s*${c}\\b`,"i"),j=-1,l=[i];for(let b=g+1;b<a.length;b+=1){let c=a[b],f=(null!=(e=null!=(d=c.raw)?d:c.text)?e:"").toString();if(l.push(f),"html"===c.type&&h.test(f)){j=b;break}}if(-1!==j){let a=l.join(""),b={type:"html",raw:a,text:a,block:!1},c=this.parseHTMLToken(b);if(c){let a=this.normalizeParseResult(c);Array.isArray(a)?f.push(...a):a&&f.push(a)}g=j;continue}}let l=this.parseHTMLToken(h);if(l){let a=this.normalizeParseResult(l);Array.isArray(a)?f.push(...a):a&&f.push(a)}}else if(h.type){let a=this.getHandlerForToken(h.type);if(a&&a.parseMarkdown){let b=this.createParseHelpers(),c=a.parseMarkdown(h,b);if(this.isMarkResult(c)){let a=this.applyMarkToContent(c.mark,c.content,c.attrs);f.push(...a)}else{let a=this.normalizeParseResult(c);Array.isArray(a)?f.push(...a):a&&f.push(a)}}else h.tokens&&f.push(...this.parseInlineTokens(h.tokens))}}return f}applyMarkToContent(a,b,c){return b.map(b=>{if("text"===b.type){let d=b.marks||[],e=c?{type:a,attrs:c}:{type:a};return{...b,marks:[...d,e]}}return{...b,content:b.content?this.applyMarkToContent(a,b.content,c):void 0}})}isMarkResult(a){return a&&"object"==typeof a&&"mark"in a}normalizeParseResult(a){return a?this.isMarkResult(a)?a.content:a:null}parseFallbackToken(a){switch(a.type){case"paragraph":return{type:"paragraph",content:a.tokens?this.parseInlineTokens(a.tokens):[]};case"heading":return{type:"heading",attrs:{level:a.depth||1},content:a.tokens?this.parseInlineTokens(a.tokens):[]};case"text":return{type:"text",text:a.text||""};case"html":return this.parseHTMLToken(a);case"space":return null;default:if(a.tokens)return this.parseTokens(a.tokens);return null}}parseHTMLToken(a){let b=a.text||a.raw||"";if(!b.trim())return null;if("undefined"==typeof window)return a.block?{type:"paragraph",content:[{type:"text",text:b}]}:{type:"text",text:b};try{let c=(0,h.yQ)(b,this.baseExtensions);if("doc"===c.type&&c.content){if(a.block)return c.content;if(1===c.content.length&&"paragraph"===c.content[0].type&&c.content[0].content)return c.content[0].content;return c.content}return c}catch(a){throw Error(`Failed to parse HTML in markdown: ${a}`)}}renderNodeToMarkdown(a,b,c=0,d=0){var e;if("text"===a.type)return a.text||"";if(!a.type)return"";let f=this.getHandlerForToken(a.type);if(!f)return"";let g={index:c,level:d,parentType:null==b?void 0:b.type,meta:{parentAttrs:null==b?void 0:b.attrs}};return(null==(e=f.renderMarkdown)?void 0:e.call(f,a,{renderChildren:(b,e)=>{let g=f.isIndenting?d+1:d;return!Array.isArray(b)&&b.content?this.renderNodes(b.content,a,e||"",c,g):this.renderNodes(b,a,e||"",c,g)},indent:a=>this.indentString+a,wrapInBlock:aA},g))||""}renderNodes(a,b,c="",d=0,e=0){return Array.isArray(a)?this.renderNodesWithMarkBoundaries(a,b,c,e):a.type?this.renderNodeToMarkdown(a,b,d,e):""}renderNodesWithMarkBoundaries(a,b,c="",d=0){let e=[],f=new Map;return a.forEach((c,g)=>{let h=g<a.length-1?a[g+1]:null;if(c.type)if("text"===c.type){let a=c.text||"",b=new Map((c.marks||[]).map(a=>[a.type,a])),d=function(a,b){let c=[];return Array.from(b.entries()).forEach(([b,d])=>{a.has(b)||c.push({type:b,mark:d})}),c}(f,b),g=function(a,b){let c=[];return Array.from(a.keys()).forEach(a=>{b&&b.marks&&b.marks.map(a=>a.type).includes(a)||c.push(a)}),c}(b,h),i="";if(g.length>0){let b=a.match(/(\s+)$/);b&&(i=b[1],a=a.slice(0,-i.length))}g.forEach(c=>{let d=b.get(c),e=this.getMarkClosing(c,d);e&&(a+=e),f.has(c)&&f.delete(c)});let j="";if(d.length>0){let b=a.match(/^(\s+)/);b&&(j=b[1],a=a.slice(j.length))}d.forEach(({type:b,mark:c})=>{let d=this.getMarkOpening(b,c);d&&(a=d+a),g.includes(b)||f.set(b,c)}),a=j+a;let k=function(a,b,c,d){let e=!c,f=c&&"text"===c.type&&(!c.marks||0===c.marks.length),g=c&&"text"===c.type&&c.marks&&!d(b,new Map(c.marks.map(a=>[a.type,a]))),h=[];if(e||f||g)if(c&&"text"===c.type&&c.marks){let b=new Map(c.marks.map(a=>[a.type,a]));Array.from(a.keys()).forEach(a=>{b.has(a)||h.push(a)})}else(e||f)&&h.push(...Array.from(a.keys()));return h}(f,b,h,this.markSetsEqual.bind(this)),l="";if(k.length>0){let b=a.match(/(\s+)$/);b&&(l=b[1],a=a.slice(0,-l.length))}k.forEach(b=>{let c=f.get(b),d=this.getMarkClosing(b,c);d&&(a+=d),f.delete(b)}),a+=l,a+=i,e.push(a)}else{var i,j;let a,h,k=new Map(f),l=(i=this.getMarkClosing.bind(this),a="",Array.from(f.keys()).reverse().forEach(b=>{let c=f.get(b),d=i(b,c);d&&(a=d+a)}),f.clear(),a),m=this.renderNodeToMarkdown(c,b,g,d),n="hardBreak"===c.type?"":(j=this.getMarkOpening.bind(this),h="",Array.from(k.entries()).forEach(([a,b])=>{let c=j(a,b);c&&(h+=c),f.set(a,b)}),h);e.push(l+m+n)}}),e.join(c)}getMarkOpening(a,b){let c=this.getHandlersForNodeType(a),d=c.length>0?c[0]:void 0;if(!d||!d.renderMarkdown)return"";let e="__TIPTAP_MARKDOWN_PLACEHOLDER__",f={type:a,attrs:b.attrs||{},content:[{type:"text",text:e}]};try{let a=d.renderMarkdown(f,{renderChildren:()=>e,indent:a=>a,wrapInBlock:(a,b)=>a+b},{index:0,level:0,parentType:"text",meta:{}}),b=a.indexOf(e);return b>=0?a.substring(0,b):""}catch(b){throw Error(`Failed to get mark opening for ${a}: ${b}`)}}getMarkClosing(a,b){let c=this.getHandlersForNodeType(a),d=c.length>0?c[0]:void 0;if(!d||!d.renderMarkdown)return"";let e="__TIPTAP_MARKDOWN_PLACEHOLDER__",f={type:a,attrs:b.attrs||{},content:[{type:"text",text:e}]};try{let a=d.renderMarkdown(f,{renderChildren:()=>e,indent:a=>a,wrapInBlock:(a,b)=>a+b},{index:0,level:0,parentType:"text",meta:{}}),b=a.indexOf(e),c=b+e.length;return b>=0?a.substring(c):""}catch(b){throw Error(`Failed to get mark closing for ${a}: ${b}`)}}markSetsEqual(a,b){return a.size===b.size&&Array.from(a.keys()).every(a=>b.has(a))}},aE=h.YY.create({name:"markdown",addOptions:()=>({indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}),addCommands(){return{setContent:(a,b)=>{if(!(null==b?void 0:b.contentType)||"markdown"!==aC(a,null==b?void 0:b.contentType)||!this.editor.markdown)return h.Pi.setContent(a,b);let c=this.editor.markdown.parse(a);return h.Pi.setContent(c,b)},insertContent:(a,b)=>{if(!(null==b?void 0:b.contentType)||"markdown"!==aC(a,null==b?void 0:b.contentType)||!this.editor.markdown)return h.Pi.insertContent(a,b);let c=this.editor.markdown.parse(a);return h.Pi.insertContent(c,b)},insertContentAt:(a,b,c)=>{if(!(null==c?void 0:c.contentType)||"markdown"!==aC(b,null==c?void 0:c.contentType)||!this.editor.markdown)return h.Pi.insertContentAt(a,b,c);let d=this.editor.markdown.parse(b);return h.Pi.insertContentAt(a,d,c)}}},addStorage(){return{manager:new aD({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){if(this.editor.markdown)return void console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");if(this.storage.manager=new aD({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||"markdown"!==aC(this.editor.options.content,this.editor.options.contentType))return;if(!this.editor.markdown)throw Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(void 0===this.editor.options.content||"string"!=typeof this.editor.options.content)throw Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');let a=this.editor.markdown.parse(this.editor.options.content);this.editor.options.content=a}}),aF=c(422703),aG=c(585004),aH=c(250367),aI=c(565254),aJ=c(418398),aK=c(197143),aL=c(685343),aM=c(565744),aN=c(673977),aO=c(115962);let aP=(0,c(858404).default)(async()=>{},{loadableGenerated:{modules:["app/components/workspace/report-block-node.tsx -> ../../components/charts/report-card"]},ssr:!1,loading:()=>(0,d.jsx)("div",{className:"h-48 rounded-xl animate-pulse",style:{background:"var(--color-surface)"}})});function aQ({node:a,updateAttributes:b,deleteNode:c,selected:f}){let g=a.attrs.config,[h,i]=(0,aO.useState)(!1),[j,k]=(0,aO.useState)(g),l=null,m=null;try{let a=JSON.parse(g);a?.panels&&Array.isArray(a.panels)?l=a:m="Invalid report config: missing panels array"}catch{m="Invalid JSON in report block"}let n=(0,aO.useCallback)(()=>{try{JSON.parse(j),b({config:j}),i(!1)}catch{}},[j,b]);return(0,d.jsxs)(e.VR,{className:"report-block-wrapper","data-selected":f||void 0,children:[(0,d.jsxs)("div",{className:"report-block-toolbar",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>{h?n():(k(g),i(!0))},className:"report-block-btn",title:h?"Apply & show chart":"Edit JSON source",children:[h?(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,d.jsx)("polyline",{points:"8 6 2 12 8 18"})]}),(0,d.jsx)("span",{children:h?"Apply":"Edit JSON"})]}),(0,d.jsx)("button",{type:"button",onClick:c,className:"report-block-btn report-block-btn-danger",title:"Remove report block",children:(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M3 6h18"}),(0,d.jsx)("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),(0,d.jsx)("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]})})]}),h?(0,d.jsxs)("div",{className:"report-block-source",children:[(0,d.jsx)("div",{className:"report-block-source-label",children:"report-json"}),(0,d.jsx)("textarea",{className:"report-block-textarea",value:j,onChange:a=>k(a.target.value),spellCheck:!1,rows:Math.min(20,j.split("\n").length+2)})]}):m?(0,d.jsxs)("div",{className:"report-block-error",children:[(0,d.jsx)("span",{children:m}),(0,d.jsx)("button",{type:"button",onClick:()=>{k(g),i(!0)},className:"report-block-btn",children:"Fix JSON"})]}):(0,d.jsx)(aP,{config:l})]})}let aR=h.bP.create({name:"reportBlock",group:"block",atom:!0,addAttributes:()=>({config:{default:"{}",parseHTML:a=>a.getAttribute("data-config")||"{}",renderHTML:a=>({"data-config":a.config})}}),parseHTML:()=>[{tag:'div[data-type="report-block"]'}],renderHTML:({HTMLAttributes:a})=>["div",(0,h.KV)(a,{"data-type":"report-block"})],addNodeView:()=>(0,e.gu)(aQ)});var aS=c(405545),aT=c(381802),aU=c(249855),aV=c(991530),aW=c(86839);let aX=new aT.hs("slashCommand"),aY=new aT.hs("fileMention"),aZ=a=>(0,d.jsxs)("span",{className:"slash-cmd-icon-text",children:["H",a]}),a$=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"8",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"8",x2:"21",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"8",x2:"21",y1:"18",y2:"18"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"18",y2:"18"})]}),a_=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"10",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"10",x2:"21",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"10",x2:"21",y1:"18",y2:"18"}),(0,d.jsx)("path",{d:"M4 6h1v4"}),(0,d.jsx)("path",{d:"M4 10h2"}),(0,d.jsx)("path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"})]}),a0=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z"}),(0,d.jsx)("path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3z"})]}),a1=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,d.jsx)("polyline",{points:"8 6 2 12 8 18"})]}),a2=(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("line",{x1:"2",x2:"22",y1:"12",y2:"12"})}),a3=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,d.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,d.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]}),a4=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M12 3v18"}),(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M3 9h18"}),(0,d.jsx)("path",{d:"M3 15h18"})]}),a5=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{x:"3",y:"5",width:"6",height:"6",rx:"1"}),(0,d.jsx)("path",{d:"m3 17 2 2 4-4"}),(0,d.jsx)("line",{x1:"13",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"13",x2:"21",y1:"18",y2:"18"})]}),a6=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"12",x2:"12",y1:"20",y2:"10"}),(0,d.jsx)("line",{x1:"18",x2:"18",y1:"20",y2:"4"}),(0,d.jsx)("line",{x1:"6",x2:"6",y1:"20",y2:"14"})]}),a7=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z"}),(0,d.jsx)("path",{d:"M15 3v4a2 2 0 0 0 2 2h4"}),(0,d.jsx)("path",{d:"M10 16h4"}),(0,d.jsx)("path",{d:"M10 12h4"})]});function a8(a){if("entry"===a.kind){let b=a.label||`(${a.objectName} entry)`,c=a.objectName?(0,aW.A3)(a.objectName):"";return{title:a.label||(a.objectName?`(${c} entry)`:b),description:a.fields?Object.entries(a.fields).slice(0,2).map(([a,b])=>`${a}: ${b}`).join(" | "):void 0,badge:c||a.objectName,icon:a7,category:"entry",command:({editor:c,range:d})=>{let e=(0,aV.VE)(a.objectName,a.entryId);c.chain().focus().deleteRange(d).insertContent({type:"text",text:b,marks:[{type:"link",attrs:{href:e,target:null}}]}).run()}}}let b=a.nodeType??("object"===a.kind?"object":"file"),c=a.label||a.path||a.id;return{title:"object"===a.kind?(0,aW.PV)(c):c,description:a.sublabel,icon:function(a){switch(a){case"document":default:return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),(0,d.jsx)("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})]});case"object":return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M12 3v18"}),(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M3 9h18"}),(0,d.jsx)("path",{d:"M3 15h18"})]});case"report":return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"12",x2:"12",y1:"20",y2:"10"}),(0,d.jsx)("line",{x1:"18",x2:"18",y1:"20",y2:"4"}),(0,d.jsx)("line",{x1:"6",x2:"6",y1:"20",y2:"14"})]})}}(b),category:"file",command:({editor:b,range:d})=>{let e=(0,aV.bJ)(a.path??a.id);b.chain().focus().deleteRange(d).insertContent({type:"text",text:c,marks:[{type:"link",attrs:{href:e,target:null}}]}).run()}}}let a9=(0,aO.forwardRef)(({items:a,command:b},c)=>{let[e,f]=(0,aO.useState)(0),g=(0,aO.useRef)(null);(0,aO.useEffect)(()=>{f(0)},[a]),(0,aO.useEffect)(()=>{let a=g.current?.children[e];a?.scrollIntoView({block:"nearest"})},[e]);let h=(0,aO.useCallback)(c=>{let d=a[c];d&&b(d)},[a,b]);return((0,aO.useImperativeHandle)(c,()=>({onKeyDown:({event:b})=>"ArrowUp"===b.key?(f(b=>(b+a.length-1)%a.length),!0):"ArrowDown"===b.key?(f(b=>(b+1)%a.length),!0):"Enter"===b.key&&(h(e),!0)})),0===a.length)?(0,d.jsx)("div",{className:"slash-cmd-popup",children:(0,d.jsx)("div",{className:"slash-cmd-empty",children:"No results"})}):(0,d.jsx)("div",{className:"slash-cmd-popup",ref:g,children:a.map((a,b)=>(0,d.jsxs)("button",{type:"button",className:`slash-cmd-item ${b===e?"slash-cmd-item-active":""}`,onClick:()=>h(b),onMouseEnter:()=>f(b),children:[(0,d.jsx)("span",{className:"slash-cmd-item-icon",children:a.icon}),(0,d.jsxs)("span",{className:"slash-cmd-item-body",children:[(0,d.jsxs)("span",{className:"slash-cmd-item-title",children:[a.title,a.badge&&(0,d.jsx)("span",{className:"slash-cmd-item-badge",children:a.badge})]}),a.description&&(0,d.jsx)("span",{className:"slash-cmd-item-desc",children:a.description})]})]},`${a.category}-${a.title}-${b}`))})});function ba({items:a,command:b,clientRect:c,componentRef:e}){let f=(0,aO.useRef)(null);return(0,aU.createPortal)((0,d.jsx)("div",{ref:f,children:(0,d.jsx)(a9,{ref:e,items:a,command:b})}),document.body)}function bb(){return()=>{let a=null,b=null,e={current:null};return{onStart:f=>{a=document.createElement("div"),document.body.appendChild(a),c.e(70684).then(c.t.bind(c,570684,19)).then(({createRoot:c})=>{(b=c(a)).render((0,d.jsx)(ba,{items:f.items,command:f.command,clientRect:f.clientRect,componentRef:e}))})},onUpdate:a=>{b?.render((0,d.jsx)(ba,{items:a.items,command:a.command,clientRect:a.clientRect,componentRef:e}))},onKeyDown:c=>"Escape"===c.event.key?(b?.unmount(),a?.remove(),a=null,b=null,!0):e.current?.onKeyDown(c)??!1,onExit:()=>{b?.unmount(),a?.remove(),a=null,b=null}}}}function bc(a){return h.YY.create({name:"fileMention",addOptions:()=>({suggestion:{char:"@",pluginKey:aY,startOfLine:!1,command:({editor:a,range:b,props:c})=>{c.command({editor:a,range:b})},items:({query:b})=>a(b,15).map(a8),render:bb()}}),addProseMirrorPlugins(){return[(0,aS.Ay)({editor:this.editor,...this.options.suggestion})]}})}a9.displayName="CommandList";var bd=c(119590),be=c(29119);function bf({content:a,rawContent:b,filePath:c,tree:i,onSave:j,onDirty:k,onNavigate:l,searchFn:m}){let[n,o]=(0,aO.useState)(!1),[p,q]=(0,aO.useState)("idle"),[r,s]=(0,aO.useState)(!1),t=(0,aO.useRef)(a),u=(0,aO.useRef)(null),v=(0,aO.useRef)(function(a){let b=a.match(/^(---\s*\n[\s\S]*?\n---\s*\n)/);return b?b[1]:""}(b??"")),w=(0,aO.useMemo)(()=>(function(){let a=[{title:"Heading 1",description:"Large section heading",icon:aZ(1),category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading",icon:aZ(2),category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading",icon:aZ(3),category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Unordered list",icon:a$,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).toggleBulletList().run()}},{title:"Numbered List",description:"Ordered list",icon:a_,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).toggleOrderedList().run()}},{title:"Task List",description:"Checklist with checkboxes",icon:a5,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).toggleTaskList().run()}},{title:"Blockquote",description:"Quote block",icon:a0,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).toggleBlockquote().run()}},{title:"Code Block",description:"Fenced code block",icon:a1,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).toggleCodeBlock().run()}},{title:"Horizontal Rule",description:"Divider line",icon:a2,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).setHorizontalRule().run()}},{title:"Image",description:"Insert image from URL",icon:a3,category:"block",command:({editor:a,range:b})=>{let c=window.prompt("Image URL:");c&&a.chain().focus().deleteRange(b).setImage({src:c}).run()}},{title:"Table",description:"Insert a 3x3 table",icon:a4,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}},{title:"Report Chart",description:"Interactive report-json block",icon:a6,category:"block",command:({editor:a,range:b})=>{let c=JSON.stringify({version:1,title:"New Report",panels:[{id:"panel-1",title:"Chart",type:"bar",sql:"SELECT 1 as x, 10 as y",mapping:{xAxis:"x",yAxis:["y"]}}]},null,2);a.chain().focus().deleteRange(b).insertContent({type:"reportBlock",attrs:{config:c}}).run()}}];return h.YY.create({name:"slashCommand",addOptions:()=>({suggestion:{char:"/",pluginKey:aX,startOfLine:!1,command:({editor:a,range:b,props:c})=>{c.command({editor:a,range:b})},items:({query:b})=>{let c=b.toLowerCase();return c?a.filter(a=>a.title.toLowerCase().includes(c)||(a.description?.toLowerCase().includes(c)??!1)):a},render:bb()}}),addProseMirrorPlugins(){return[(0,aS.Ay)({editor:this.editor,...this.options.suggestion})]}})})(),[]),x=(0,aO.useMemo)(()=>m?bc(m):function(a){let b=(function a(b){let c=[];for(let d of b)"folder"!==d.type&&c.push(d),d.children&&c.push(...a(d.children));return c})(a).map(a=>({id:a.path,label:a.name.replace(/\.md$/,""),sublabel:a.path,kind:"object"===a.type?"object":"file",path:a.path,nodeType:a.type}));return bc((a,c=15)=>{if(!a)return b.slice(0,c);let d=a.toLowerCase();return b.filter(a=>a.label.toLowerCase().includes(d)||(a.sublabel?.toLowerCase().includes(d)??!1)).slice(0,c)})}(i),[m,i]),y=(0,e.hG)({extensions:[g.A.configure({codeBlock:{HTMLAttributes:{class:"code-block"}}}),aE.configure({markedOptions:{gfm:!0}}),aF.Ay.configure({inline:!1,allowBase64:!0,HTMLAttributes:{class:"editor-image"}}),aG.Ay.configure({openOnClick:!1,autolink:!0,HTMLAttributes:{class:"editor-link",rel:"noopener"}}),aH.XI.configure({resizable:!1}),aI.A,aJ.A,aK.h,aL.A,aM.A.configure({nested:!0}),aN.A.configure({placeholder:"Start writing, or type / for commands..."}),aR,w,x],content:a.replace(/```report-json\s*\n([\s\S]*?)```/g,(a,b)=>{let c=b.trim().replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">");return`<div data-type="report-block" data-config="${c}"></div>`}),contentType:"markdown",immediatelyRender:!1,onUpdate:()=>{s(!0),q("idle"),k?.()}}),z=(0,aO.useCallback)(async a=>{let b=new FormData;b.append("file",a);try{let a=await fetch("/api/workspace/upload",{method:"POST",body:b});if(!a.ok)return null;let c=await a.json();return`/api/workspace/assets/${c.path.replace(/^assets\//,"")}`}catch{return null}},[]),A=(0,aO.useCallback)(async a=>{if(y)for(let b of a){let a=await z(b);a&&y.chain().focus().setImage({src:a,alt:b.name}).run()}},[y,z]),B=(0,aO.useCallback)(async()=>{if(y&&!n){o(!0),q("idle");try{let b=("function"==typeof y.getMarkdown?y.getMarkdown():y.getHTML()).replace(/<div data-type="report-block" data-config="([^"]*)">\s*<\/div>/g,(a,b)=>"```report-json\n"+b.replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&")+"\n```"),d=v.current+b;(await fetch((0,be.nC)(c),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:c,content:d})})).ok?(q("saved"),s(!1),t.current=a,j?.(),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>q("idle"),2e3)):q("error")}catch{q("error")}finally{o(!1)}}},[y,c,n,j]);return y?(0,d.jsxs)("div",{className:"markdown-editor-container",children:[(0,d.jsxs)("div",{className:"editor-top-bar",children:[(0,d.jsxs)("div",{className:"editor-top-bar-left",children:[r&&(0,d.jsx)("span",{className:"editor-save-indicator editor-save-unsaved",children:"Unsaved changes"}),"saved"===p&&!r&&(0,d.jsx)("span",{className:"editor-save-indicator editor-save-saved",children:"Saved"}),"error"===p&&(0,d.jsx)("span",{className:"editor-save-indicator editor-save-error",children:"Save failed"})]}),(0,d.jsxs)("div",{className:"editor-top-bar-right",children:[(0,d.jsxs)("span",{className:"editor-save-hint",children:["undefined"!=typeof navigator&&navigator.platform?.includes("Mac")?"⌘":"Ctrl","+S"]}),(0,d.jsx)("button",{type:"button",onClick:()=>void B(),disabled:n||!r,className:"editor-save-button",children:n?"Saving...":"Save"})]})]}),(0,d.jsx)(bg,{editor:y,onUploadImages:A}),(0,d.jsx)(f.m,{editor:y,children:(0,d.jsxs)("div",{className:"bubble-menu",children:[(0,d.jsx)(bd.zM,{active:y.isActive("bold"),onClick:()=>y.chain().focus().toggleBold().run(),title:"Bold",children:(0,d.jsx)("strong",{children:"B"})}),(0,d.jsx)(bd.zM,{active:y.isActive("italic"),onClick:()=>y.chain().focus().toggleItalic().run(),title:"Italic",children:(0,d.jsx)("em",{children:"I"})}),(0,d.jsx)(bd.zM,{active:y.isActive("strike"),onClick:()=>y.chain().focus().toggleStrike().run(),title:"Strikethrough",children:(0,d.jsx)("s",{children:"S"})}),(0,d.jsx)(bd.zM,{active:y.isActive("code"),onClick:()=>y.chain().focus().toggleCode().run(),title:"Inline code",children:"<>"}),(0,d.jsx)(bd.zM,{active:y.isActive("link"),onClick:()=>{if(y.isActive("link"))y.chain().focus().unsetLink().run();else{let a=window.prompt("URL:");a&&y.chain().focus().setLink({href:a}).run()}},title:"Link",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),(0,d.jsx)("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})})]})}),(0,d.jsx)("div",{className:"editor-content-area workspace-prose",children:(0,d.jsx)(e.$Z,{editor:y})})]}):(0,d.jsxs)("div",{className:"animate-pulse space-y-3 py-4 px-6",children:[(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"80%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"60%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"70%"}})]})}function bg({editor:a,onUploadImages:b}){let c=(0,aO.useRef)(null);return a?(0,d.jsxs)("div",{className:"editor-toolbar",children:[(0,d.jsxs)(bd.$Q,{children:[(0,d.jsx)(bd.IB,{active:a.isActive("heading",{level:1}),onClick:()=>a.chain().focus().toggleHeading({level:1}).run(),title:"Heading 1",children:"H1"}),(0,d.jsx)(bd.IB,{active:a.isActive("heading",{level:2}),onClick:()=>a.chain().focus().toggleHeading({level:2}).run(),title:"Heading 2",children:"H2"}),(0,d.jsx)(bd.IB,{active:a.isActive("heading",{level:3}),onClick:()=>a.chain().focus().toggleHeading({level:3}).run(),title:"Heading 3",children:"H3"})]}),(0,d.jsx)(bd.x_,{}),(0,d.jsxs)(bd.$Q,{children:[(0,d.jsx)(bd.IB,{active:a.isActive("bold"),onClick:()=>a.chain().focus().toggleBold().run(),title:"Bold",children:(0,d.jsx)("strong",{children:"B"})}),(0,d.jsx)(bd.IB,{active:a.isActive("italic"),onClick:()=>a.chain().focus().toggleItalic().run(),title:"Italic",children:(0,d.jsx)("em",{children:"I"})}),(0,d.jsx)(bd.IB,{active:a.isActive("strike"),onClick:()=>a.chain().focus().toggleStrike().run(),title:"Strikethrough",children:(0,d.jsx)("s",{children:"S"})}),(0,d.jsx)(bd.IB,{active:a.isActive("code"),onClick:()=>a.chain().focus().toggleCode().run(),title:"Inline code",children:"<>"})]}),(0,d.jsx)(bd.x_,{}),(0,d.jsxs)(bd.$Q,{children:[(0,d.jsx)(bd.IB,{active:a.isActive("bulletList"),onClick:()=>a.chain().focus().toggleBulletList().run(),title:"Bullet list",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"8",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"8",x2:"21",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"8",x2:"21",y1:"18",y2:"18"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"18",y2:"18"})]})}),(0,d.jsx)(bd.IB,{active:a.isActive("orderedList"),onClick:()=>a.chain().focus().toggleOrderedList().run(),title:"Ordered list",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"10",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"10",x2:"21",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"10",x2:"21",y1:"18",y2:"18"}),(0,d.jsx)("path",{d:"M4 6h1v4"}),(0,d.jsx)("path",{d:"M4 10h2"}),(0,d.jsx)("path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"})]})}),(0,d.jsx)(bd.IB,{active:a.isActive("taskList"),onClick:()=>a.chain().focus().toggleTaskList().run(),title:"Task list",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{x:"3",y:"5",width:"6",height:"6",rx:"1"}),(0,d.jsx)("path",{d:"m3 17 2 2 4-4"}),(0,d.jsx)("line",{x1:"13",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"13",x2:"21",y1:"18",y2:"18"})]})}),(0,d.jsx)(bd.IB,{active:a.isActive("blockquote"),onClick:()=>a.chain().focus().toggleBlockquote().run(),title:"Blockquote",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z"}),(0,d.jsx)("path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3z"})]})}),(0,d.jsx)(bd.IB,{active:a.isActive("codeBlock"),onClick:()=>a.chain().focus().toggleCodeBlock().run(),title:"Code block",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,d.jsx)("polyline",{points:"8 6 2 12 8 18"})]})})]}),(0,d.jsx)(bd.x_,{}),(0,d.jsxs)(bd.$Q,{children:[(0,d.jsx)(bd.IB,{active:!1,onClick:()=>{let b=window.prompt("Link URL:");b&&a.chain().focus().setLink({href:b}).run()},title:"Insert link",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),(0,d.jsx)("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),(0,d.jsx)(bd.IB,{active:!1,onClick:()=>{if(b)c.current?.click();else{let b=window.prompt("Image URL:");b&&a.chain().focus().setImage({src:b}).run()}},title:"Insert image (click to upload, or drag & drop)",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,d.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,d.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})}),(0,d.jsx)("input",{ref:c,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:a=>{let c=Array.from(a.target.files??[]);c.length>0&&b&&b(c),a.target.value=""}}),(0,d.jsx)(bd.IB,{active:!1,onClick:()=>{a.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()},title:"Insert table",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M12 3v18"}),(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M3 9h18"}),(0,d.jsx)("path",{d:"M3 15h18"})]})}),(0,d.jsx)(bd.IB,{active:!1,onClick:()=>{a.chain().focus().setHorizontalRule().run()},title:"Horizontal rule",children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("line",{x1:"2",x2:"22",y1:"12",y2:"12"})})})]})]}):null}},166328:(a,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.camelCase=void 0;var c=/^--[a-zA-Z0-9_-]+$/,d=/-([a-z])/g,e=/^[^-]+$/,f=/^-(webkit|moz|ms|o|khtml)-/,g=/^-(ms)-/,h=function(a,b){return b.toUpperCase()},i=function(a,b){return"".concat(b,"-")};b.camelCase=function(a,b){var j;return(void 0===b&&(b={}),!(j=a)||e.test(j)||c.test(j))?a:(a=a.toLowerCase(),(a=b.reactCompat?a.replace(g,i):a.replace(f,i)).replace(d,h))}},167609:(a,b,c)=>{"use strict";c.d(b,{z:()=>n});var d=c(736927),e=c(115962),f=c(858404),g=c(273700),h=c(551651),i=c(991530),j=c(59448);let k=(0,f.default)(async()=>{},{loadableGenerated:{modules:["app/components/workspace/document-view.tsx -> ./markdown-content"]},ssr:!1,loading:()=>(0,d.jsxs)("div",{className:"animate-pulse space-y-3 py-4",children:[(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"80%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"60%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"70%"}})]})}),l=(0,f.default)(async()=>{},{loadableGenerated:{modules:["app/components/workspace/document-view.tsx -> ../charts/report-card"]},ssr:!1,loading:()=>(0,d.jsx)("div",{className:"h-48 rounded-xl animate-pulse my-4",style:{background:"var(--color-surface)"}})}),m=(0,f.default)(async()=>{},{loadableGenerated:{modules:["app/components/workspace/document-view.tsx -> ./markdown-editor"]},ssr:!1,loading:()=>(0,d.jsxs)("div",{className:"animate-pulse space-y-3 py-4 px-6",children:[(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"80%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"60%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"70%"}})]})});function n({content:a,title:b,filePath:c,tree:f,onSave:j,onDirty:l,onNavigate:n,searchFn:p}){let[q,r]=(0,e.useState)(!!c),s=a.replace(/^---\s*\n[\s\S]*?\n---\s*\n/,""),t=s.match(/^#\s+(.+)/m),u=b??t?.[1],v=u&&t?s.replace(/^#\s+.+\n?/,""):s;if(q&&c)return(0,d.jsx)(m,{content:s,rawContent:a,filePath:c,tree:f??[],onSave:j,onDirty:l,onNavigate:n,searchFn:p});let w=(0,g.x)(v)||(0,h.k)(v),x=(0,e.useCallback)(a=>{let b=a.target.closest("a");if(!b)return;let c=b.getAttribute("href");if(c){if(c.startsWith("#")){a.preventDefault(),a.stopPropagation();let b=c.slice(1),d=a.currentTarget,e=Array.from(d.querySelectorAll("h1, h2, h3, h4, h5, h6")).find(a=>(a.textContent||"").trim().toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-")===b)??d.querySelector(`[id="${CSS.escape(b)}"]`);e?.scrollIntoView({behavior:"smooth",block:"start"});return}if(n){if((0,i.m9)(c)||!c.startsWith("http://")&&!c.startsWith("https://")&&!c.startsWith("mailto:")){a.preventDefault(),a.stopPropagation(),n(c);return}a.preventDefault(),a.stopPropagation(),window.open(c,"_blank","noopener,noreferrer")}}},[n]);return(0,d.jsxs)("div",{className:"px-6 py-8",onClick:x,children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[u&&(0,d.jsx)("h1",{className:"text-3xl font-bold mb-6 flex-1",style:{color:"var(--color-text)"},children:u}),c&&(0,d.jsxs)("button",{type:"button",onClick:()=>r(!0),className:"editor-mode-toggle flex-shrink-0 mt-1",title:"Edit this document",children:[(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}),(0,d.jsx)("path",{d:"m15 5 4 4"})]}),(0,d.jsx)("span",{children:"Edit"})]})]}),w?(0,d.jsx)(o,{content:v}):(0,d.jsx)("div",{className:"workspace-prose",children:(0,d.jsx)(k,{content:v})})]})}function o({content:a}){let b=(0,g.R)(a),c=[];for(let a of b)if("text"===a.type&&(0,h.k)(a.text))for(let b of(0,h.g)(a.text))c.push(b);else c.push(a);return(0,d.jsx)("div",{className:"space-y-4",children:c.map((a,b)=>"report-artifact"===a.type?(0,d.jsx)("div",{className:"my-6",children:(0,d.jsx)(l,{config:a.config})},b):"diff-artifact"===a.type?(0,d.jsx)("div",{className:"my-4",children:(0,d.jsx)(j.a,{diff:a.diff})},b):(0,d.jsx)("div",{className:"workspace-prose",children:(0,d.jsx)(k,{content:a.text})},b))})}},173092:(a,b,c)=>{"use strict";c.d(b,{i:()=>h});var d,e=c(115962),f=c(880696),g=(d||(d=c.t(e,2)))[" useInsertionEffect ".trim().toString()]||f.N;function h({prop:a,defaultProp:b,onChange:c=()=>{},caller:d}){let[f,h,i]=function({defaultProp:a,onChange:b}){let[c,d]=e.useState(a),f=e.useRef(c),h=e.useRef(b);return g(()=>{h.current=b},[b]),e.useEffect(()=>{f.current!==c&&(h.current?.(c),f.current=c)},[c,f]),[c,d,h]}({defaultProp:b,onChange:c}),j=void 0!==a,k=j?a:f;{let b=e.useRef(void 0!==a);e.useEffect(()=>{let a=b.current;if(a!==j){let b=j?"controlled":"uncontrolled";console.warn(`${d} is changing from ${a?"controlled":"uncontrolled"} to ${b}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}b.current=j},[j,d])}return[k,e.useCallback(b=>{if(j){let c="function"==typeof b?b(a):b;c!==a&&i.current?.(c)}else h(b)},[j,a,h,i])]}Symbol("RADIX:SYNC_STATE")},173136:a=>{"use strict";a.exports=require("node:url")},174247:(a,b,c)=>{"use strict";c.d(b,{r:()=>k});var d=c(736927),e=c(115962),f=c(415182),g=c(843572),h=c(787950),i=c(970093);async function j(a,b){let c=(0,h.Kr)(a),d=null,e=[],f=await fetch("/api/composio/connections?include_toolkits=1&fresh=1");if(f.ok){let a=await f.json();e=(0,g.s$)(a).filter(a=>(0,h.Kr)(a.toolkit_slug)===c),d=(0,i.Q2)(Array.isArray(a.toolkits)?a.toolkits:[],c,b)}if(!d){let a=new URLSearchParams({search:b?.trim()||c,limit:"24"}),e=await fetch(`/api/composio/toolkits?${a.toString()}`);if(e.ok){let a=await e.json();d=(0,i.Q2)((0,g.O0)(a).items,c,b)}}return{toolkit:d,connections:e}}function k({request:a,onRequestHandled:b,onFallbackToIntegrations:c}){let[g,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)([]),[p,q]=(0,e.useState)("connect"),r=(0,e.useRef)(0),s=(0,e.useCallback)(async(a,b)=>{let d=a.toolkitSlug?.trim();if(!d){k(!1),m(null),o([]),c();return}let e=(0,h.Kr)(d),f=(0,i.TU)(e,a.toolkitName),g=r.current+1;r.current=g,q(a.action),b?.openModal!==!1&&(m(f),o([]),k(!0));try{let b=await j(e,a.toolkitName);if(g!==r.current)return;m(b.toolkit??f),o(b.connections)}catch{if(g!==r.current)return;m(a=>a??f)}},[c]),t=(0,e.useCallback)(a=>{let b=a?.connectedToolkitSlug??a?.toolkit?.slug??l?.slug??null;b&&s({action:p,toolkitSlug:b,toolkitName:a?.connectedToolkitName??a?.toolkit?.name??l?.name??null},{openModal:!1})},[s,p,l?.name,l?.slug]);return(0,d.jsx)(f.R,{toolkit:l,connections:n,open:g,preferredAction:p,onOpenChange:k,onConnectionChange:t})}},175151:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],f=(0,d.A)("chevron-down",e)},176139:(a,b,c)=>{"use strict";c.d(b,{H:()=>p,s:()=>j});var d=c(736927),e=c(115962);let f=new Set(["jpg","jpeg","png","gif","webp","svg","bmp","avif","heic","heif","ico","tiff","tif"]),g=new Set(["mp4","webm","mov","avi","mkv"]),h=new Set(["mp3","wav","ogg","m4a","aac","flac"]),i=new Set(["pdf"]);function j(a){let b=a.split(".").pop()?.toLowerCase()??"";return f.has(b)?"image":g.has(b)?"video":h.has(b)?"audio":i.has(b)?"pdf":null}function k(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,d.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,d.jsx)("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]})}function l(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M15 3h6v6"}),(0,d.jsx)("path",{d:"M10 14 21 3"}),(0,d.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function m(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,d.jsx)("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}),(0,d.jsx)("line",{x1:"11",x2:"11",y1:"8",y2:"14"}),(0,d.jsx)("line",{x1:"8",x2:"14",y1:"11",y2:"11"})]})}function n(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,d.jsx)("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}),(0,d.jsx)("line",{x1:"8",x2:"14",y1:"11",y2:"11"})]})}function o(a){switch(a){case"image":return"#60a5fa";case"video":return"#c084fc";case"audio":return"#f59e0b";case"pdf":return"#ef4444"}}function p({url:a,filename:b,mediaType:c,filePath:e}){return(0,d.jsxs)("div",{className:"flex flex-col h-full",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 px-5 py-3 border-b flex-shrink-0",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)(u,{mediaType:c}),(0,d.jsx)("span",{className:"text-sm font-medium truncate",style:{color:"var(--color-text)"},children:b}),(0,d.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full flex-shrink-0",style:{background:`${o(c)}18`,color:o(c),border:`1px solid ${o(c)}30`},children:function(a){switch(a){case"image":return"Image";case"video":return"Video";case"audio":return"Audio";case"pdf":return"PDF"}}(c)}),(0,d.jsxs)("div",{className:"flex items-center gap-1 ml-auto",children:[(0,d.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-md transition-colors duration-100",style:{color:"var(--color-text-muted)"},title:"Open in new tab",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,d.jsx)(l,{})}),(0,d.jsx)("a",{href:a,download:b,className:"p-1.5 rounded-md transition-colors duration-100",style:{color:"var(--color-text-muted)"},title:"Download",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,d.jsx)(k,{})})]})]}),(0,d.jsxs)("div",{className:"flex-1 overflow-auto flex items-center justify-center p-6",style:{background:"var(--color-surface)"},children:["image"===c&&(0,d.jsx)(q,{url:a,filename:b}),"video"===c&&(0,d.jsx)(r,{url:a}),"audio"===c&&(0,d.jsx)(s,{url:a,filename:b}),"pdf"===c&&(0,d.jsx)(t,{url:a})]}),e&&(0,d.jsx)("div",{className:"px-5 py-2 border-t flex-shrink-0 flex items-center",style:{borderColor:"var(--color-border)"},children:(0,d.jsx)("span",{className:"text-[11px] truncate",style:{color:"var(--color-text-muted)",fontFamily:"'SF Mono', 'Fira Code', monospace"},children:e})})]})}function q({url:a,filename:b}){let[c,f]=(0,e.useState)(1),[g,h]=(0,e.useState)(!1),i=(0,e.useCallback)(()=>f(a=>Math.min(1.5*a,5)),[]),j=(0,e.useCallback)(()=>f(a=>Math.max(a/1.5,.25)),[]),k=(0,e.useCallback)(()=>f(1),[]);return g?(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3 py-12",children:[(0,d.jsx)("span",{className:"text-4xl",style:{opacity:.3},children:"\uD83D\uDDBC"}),(0,d.jsx)("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"Failed to load image"})]}):(0,d.jsxs)("div",{className:"flex flex-col items-center gap-4 w-full",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:j,className:"p-1.5 rounded-md transition-colors duration-100 cursor-pointer",style:{color:"var(--color-text-muted)"},title:"Zoom out",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,d.jsx)(n,{})}),(0,d.jsxs)("button",{type:"button",onClick:k,className:"px-2 py-1 rounded-md text-[11px] tabular-nums transition-colors duration-100 cursor-pointer",style:{color:"var(--color-text-muted)"},title:"Reset zoom",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[Math.round(100*c),"%"]}),(0,d.jsx)("button",{type:"button",onClick:i,className:"p-1.5 rounded-md transition-colors duration-100 cursor-pointer",style:{color:"var(--color-text-muted)"},title:"Zoom in",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,d.jsx)(m,{})})]}),(0,d.jsx)("div",{className:"overflow-auto max-w-full max-h-[calc(100vh-260px)] rounded-xl border",style:{borderColor:"var(--color-border)",backgroundImage:"linear-gradient(45deg, var(--color-surface-hover) 25%, transparent 25%), linear-gradient(-45deg, var(--color-surface-hover) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--color-surface-hover) 75%), linear-gradient(-45deg, transparent 75%, var(--color-surface-hover) 75%)",backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px"},children:(0,d.jsx)("img",{src:a,alt:b,onError:()=>h(!0),style:{transform:`scale(${c})`,transformOrigin:"center center",transition:"transform 200ms ease",maxWidth:c<=1?"100%":"none",display:"block"},draggable:!1})})]})}function r({url:a}){return(0,d.jsx)("div",{className:"w-full max-w-4xl",children:(0,d.jsx)("video",{src:a,controls:!0,className:"w-full rounded-xl border",style:{borderColor:"var(--color-border)",maxHeight:"calc(100vh - 220px)",background:"#000"}})})}function s({url:a,filename:b}){return(0,d.jsxs)("div",{className:"flex flex-col items-center gap-6 py-8",children:[(0,d.jsx)("div",{className:"w-32 h-32 rounded-2xl flex items-center justify-center",style:{background:"linear-gradient(135deg, #f59e0b20, #f59e0b10)",border:"1px solid #f59e0b30"},children:(0,d.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"#f59e0b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M9 18V5l12-2v13"}),(0,d.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,d.jsx)("circle",{cx:"18",cy:"16",r:"3"})]})}),(0,d.jsx)("p",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:b}),(0,d.jsx)("audio",{src:a,controls:!0,className:"w-full max-w-md"})]})}function t({url:a}){return(0,d.jsx)("div",{className:"w-full h-full flex flex-col",children:(0,d.jsx)("iframe",{src:a,className:"w-full flex-1 rounded-xl border",style:{borderColor:"var(--color-border)",minHeight:"calc(100vh - 220px)",background:"white"},title:"PDF viewer"})})}function u({mediaType:a}){let b=o(a);switch(a){case"image":return(0,d.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:b,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,d.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,d.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]});case"video":return(0,d.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:b,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"}),(0,d.jsx)("rect",{x:"2",y:"6",width:"14",height:"12",rx:"2"})]});case"audio":return(0,d.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:b,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M9 18V5l12-2v13"}),(0,d.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,d.jsx)("circle",{cx:"18",cy:"16",r:"3"})]});case"pdf":return(0,d.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:b,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),(0,d.jsx)("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),(0,d.jsx)("path",{d:"M10 9H8"}),(0,d.jsx)("path",{d:"M16 13H8"}),(0,d.jsx)("path",{d:"M16 17H8"})]})}}},176760:a=>{"use strict";a.exports=require("node:path")},180533:(a,b,c)=>{"use strict";c.d(b,{X:()=>f});var d=c(736927),e=c(115962);function f({name:a,saveName:b}){let c=a?.trim()??"",f=0===c.length,[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(""),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(null),o=(0,e.useRef)(null),p=(0,e.useRef)(!1),q=(0,e.useCallback)(()=>{j(""),n(null),h(!0)},[]),r=(0,e.useCallback)(()=>{h(!1),j(""),n(null)},[]),s=(0,e.useCallback)(async()=>{if(p.current)return;let a=i.trim();if(!a)return void r();p.current=!0,l(!0),n(null);try{await b(a),h(!1),j("")}catch(a){n(a instanceof Error?a.message:"Failed to save name.")}finally{p.current=!1,l(!1)}},[i,r,b]);return g?(0,d.jsxs)("div",{className:"flex flex-1 items-center gap-3 min-w-0",children:[(0,d.jsx)("input",{ref:o,type:"text",value:i,onChange:a=>j(a.target.value),onBlur:()=>{s()},onKeyDown:a=>{"Enter"===a.key?(a.preventDefault(),s()):"Escape"===a.key&&(a.preventDefault(),r())},disabled:k,placeholder:"Add a name","aria-label":"Name",className:"font-instrument text-3xl tracking-tight w-full min-w-0",style:{color:"var(--color-text)",background:"transparent",border:"none",outline:"none",padding:0}}),m&&(0,d.jsx)("span",{className:"text-[12px] shrink-0",style:{color:"var(--color-error)"},role:"alert",children:m})]}):f?(0,d.jsxs)("button",{type:"button",onClick:q,title:"Add a name","aria-label":"Add a name",className:"font-instrument text-3xl tracking-tight inline-flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity outline-none focus-visible:ring-2 rounded-sm",style:{color:"var(--color-text-muted)",background:"transparent",border:"none",padding:0},children:[(0,d.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,d.jsx)("path",{d:"M12 20h9"}),(0,d.jsx)("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})]}),(0,d.jsx)("span",{style:{fontStyle:"italic"},children:"Add a name"})]}):(0,d.jsx)("h1",{className:"font-instrument text-3xl tracking-tight truncate",style:{color:"var(--color-text)"},children:c})}},180656:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.isBuffer=function(a){return"undefined"!=typeof Buffer&&Buffer.isBuffer(a)}},183410:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],f=(0,d.A)("server",e)},197143:(a,b,c)=>{"use strict";c.d(b,{h:()=>d});var d=c(250367).A0},199803:(a,b,c)=>{"use strict";c.d(b,{T:()=>ao});var d=c(736927),e=c(115962),f=c(215071),g=c(175151),h=c(604466),i=c(554989),j=c(66008),k=c(165046);function l({model:a,className:b}){let c=a.provider.trim().toLowerCase(),e={color:"currentColor"};if("minimax"===c||"mini-max"===c)return(0,d.jsx)("img",{src:"/models/minimax.png",alt:"",className:b,draggable:!1,"data-provider-icon":"minimax"});if("deepseek"===c)return(0,d.jsx)("img",{src:"/models/deepseek.ico",alt:"",className:b,draggable:!1,"data-provider-icon":"deepseek"});if("kimi"===c||"moonshot"===c||"moonshotai"===c)return(0,d.jsx)("img",{src:"/models/kimi.png",alt:"",className:b,draggable:!1,"data-provider-icon":"kimi"});switch(c){case"anthropic":case"claude":return(0,d.jsx)(i.phd,{className:b,style:e,"data-provider-icon":"claude"});case"openai":case"chatgpt":return(0,d.jsx)(i.pz8,{className:b,style:e,"data-provider-icon":"openai"});case"google":return(0,d.jsx)(i.UKz,{className:b,style:{color:"#4285F4"},"data-provider-icon":"google"});case"meta":return(0,d.jsx)(i.awM,{className:b,style:{color:"#0668E1"},"data-provider-icon":"meta"});case"mistral":return(0,d.jsx)(i.$7J,{className:b,style:{color:"#FF7000"},"data-provider-icon":"mistral"});case"perplexity":return(0,d.jsx)(i.X_y,{className:b,style:{color:"#20B8CD"},"data-provider-icon":"perplexity"});default:return(0,d.jsx)("span",{className:b,style:{color:"var(--color-text-muted)",fontSize:"0.75rem",fontWeight:600,lineHeight:1},"aria-hidden":!0,"data-provider-icon":"fallback",children:a.provider.slice(0,1).toUpperCase()})}}function m({models:a,selectedModel:b,onSelect:c,disabled:e=!1,loading:i=!1,disabledHint:m,fallbackToFirst:n=!0,placeholder:o="Choose a model...",ariaLabel:p="Select chat model",triggerClassName:q}){let r=function(a,b){let c="string"==typeof b?b.trim():"";if(c)return a.find(a=>a.stableId===c||"string"==typeof a.catalogId&&a.catalogId.trim()===c)}(a,b)??(n?a[0]??null:null);if(0===a.length)return null;let s=e&&i?"Switching model…":e&&m?.trim()?m.trim():r?.displayName??o;return(0,d.jsxs)(j.rI,{children:[(0,d.jsxs)(j.ty,{className:(0,k.cn)("inline-flex max-w-full items-center gap-1.5 rounded-lg p-0 text-sm font-medium transition-opacity hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-60",q),style:{color:"var(--color-text-secondary)",opacity:.9},"aria-label":p,title:s,disabled:e,children:[r?(0,d.jsx)(l,{model:r,className:"h-3.5 w-3.5 shrink-0"}):(0,d.jsx)("span",{className:"inline-block h-3.5 w-3.5 shrink-0 rounded-full",style:{background:"var(--color-surface-hover)"},"aria-hidden":!0}),(0,d.jsx)("span",{className:(0,k.cn)("max-w-[240px] truncate",!r&&"italic"),style:r?void 0:{color:"var(--color-text-muted)"},children:r?.displayName??o}),e&&i?(0,d.jsx)(f.default,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}):e?(0,d.jsx)(h.default,{className:"h-3.5 w-3.5 shrink-0 opacity-70","aria-hidden":!0}):(0,d.jsx)(g.default,{className:"h-3.5 w-3.5 shrink-0"})]}),(0,d.jsx)(j.SQ,{align:"start",side:"bottom",sideOffset:8,className:"min-w-[15rem] max-w-[20rem] p-1.5",children:(0,d.jsx)(j.Hr,{value:r?.stableId??"",onValueChange:a=>{e||c(a)},children:a.map(a=>(0,d.jsxs)(j.Ht,{value:a.stableId,disabled:e,children:[(0,d.jsx)(l,{model:a,className:"h-4 w-4 shrink-0"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"truncate text-sm font-medium",style:{color:"var(--color-text)"},children:a.displayName}),(0,d.jsxs)("div",{className:"mt-0.5 flex flex-wrap items-center gap-1.5 text-[10px]",style:{color:"var(--color-text-muted)"},children:[(0,d.jsx)("span",{children:a.provider}),a.reasoning&&(0,d.jsx)("span",{children:"Reasoning"}),a.isRecommended&&(0,d.jsx)("span",{className:"rounded-full px-1.5 py-0.5",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:"Recommended"})]})]})]},a.stableId))})})]})}var n=c(327629),o=c(42813),p=c(687193),q=c(155897),r=c(173092),s=c(534864),t=c(430792),u="Switch",[v,w]=(0,q.A)(u),[x,y]=v(u),z=e.forwardRef((a,b)=>{let{__scopeSwitch:c,name:f,checked:g,defaultChecked:h,required:i,disabled:j,value:k="on",onCheckedChange:l,form:m,...n}=a,[q,s]=e.useState(null),v=(0,p.s)(b,a=>s(a)),w=e.useRef(!1),y=!q||m||!!q.closest("form"),[z,A]=(0,r.i)({prop:g,defaultProp:h??!1,onChange:l,caller:u});return(0,d.jsxs)(x,{scope:c,checked:z,disabled:j,children:[(0,d.jsx)(t.sG.button,{type:"button",role:"switch","aria-checked":z,"aria-required":i,"data-state":D(z),"data-disabled":j?"":void 0,disabled:j,value:k,...n,ref:v,onClick:(0,o.mK)(a.onClick,a=>{A(a=>!a),y&&(w.current=a.isPropagationStopped(),w.current||a.stopPropagation())})}),y&&(0,d.jsx)(C,{control:q,bubbles:!w.current,name:f,value:k,checked:z,required:i,disabled:j,form:m,style:{transform:"translateX(-100%)"}})]})});z.displayName=u;var A="SwitchThumb",B=e.forwardRef((a,b)=>{let{__scopeSwitch:c,...e}=a,f=y(A,c);return(0,d.jsx)(t.sG.span,{"data-state":D(f.checked),"data-disabled":f.disabled?"":void 0,...e,ref:b})});B.displayName=A;var C=e.forwardRef(({__scopeSwitch:a,control:b,checked:c,bubbles:f=!0,...g},h)=>{let i=e.useRef(null),j=(0,p.s)(i,h),k=function(a){let b=e.useRef({value:a,previous:a});return e.useMemo(()=>(b.current.value!==a&&(b.current.previous=b.current.value,b.current.value=a),b.current.previous),[a])}(c),l=(0,s.X)(b);return e.useEffect(()=>{let a=i.current;if(!a)return;let b=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(k!==c&&b){let d=new Event("click",{bubbles:f});b.call(a,c),a.dispatchEvent(d)}},[k,c,f]),(0,d.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:c,...g,tabIndex:-1,ref:j,style:{...g.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function D(a){return a?"checked":"unchecked"}C.displayName="SwitchBubbleInput";let E=e.forwardRef(({className:a,...b},c)=>(0,d.jsx)(z,{className:(0,k.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border border-zinc-300 bg-zinc-200 shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-zinc-900 data-[state=unchecked]:bg-zinc-200 dark:border-zinc-700 dark:data-[state=checked]:bg-zinc-50 dark:data-[state=unchecked]:bg-zinc-700",a),...b,ref:c,children:(0,d.jsx)(B,{className:(0,k.cn)("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-md ring-1 ring-black/10 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-zinc-900 dark:ring-white/10")})}));function F({notice:a}){let b="success"===a.tone?"border-emerald-500/30 bg-emerald-500/10 text-emerald-100":"border-amber-500/30 bg-amber-500/10 text-amber-100";return(0,d.jsx)("div",{className:`rounded-xl border px-4 py-3 text-sm ${b}`,children:a.message})}function G(a){var b=a.id,c=a.label;switch(b){case"apollo":return"Dench Enrichments";case"exa":return c??"Exa";case"elevenlabs":return c??"ElevenLabs"}}E.displayName=z.displayName;let H={exa:"Search the web with Exa",apollo:"Enrich people and company data",elevenlabs:"Generate speech with ElevenLabs"};function I({integration:a,isSaving:b,onToggle:c}){let e=G(a),f=H[a.id],g=b?"Saving...":a.locked?"Unavailable until Dench Cloud is ready":f;return(0,d.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-xl px-1 py-2",style:{background:"transparent"},children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:function(a){switch(a){case"exa":return(0,d.jsx)("img",{src:"/integrations/exa-logomark.svg",alt:"",width:20,height:20,className:"h-5 w-5 shrink-0 object-contain",draggable:!1});case"apollo":return(0,d.jsx)("img",{src:"/dench-workspace-icon.png",alt:"",width:20,height:20,className:"h-5 w-5 shrink-0 rounded-md object-contain",draggable:!1});case"elevenlabs":return(0,d.jsx)(i.AHR,{className:"h-5 w-5 shrink-0","aria-hidden":!0})}}(a.id)}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("div",{className:"truncate text-sm font-medium text-foreground",children:e}),(0,d.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[11px] leading-4 text-muted-foreground",children:[(0,d.jsx)("span",{children:g}),a.lockBadge&&(0,d.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:a.lockBadge})]})]})]}),(0,d.jsx)(E,{"aria-label":`Toggle ${e}`,checked:a.enabled,disabled:b||a.locked,onCheckedChange:b=>c(a,b)})]})}function J(a={}){let b=void 0!==a.data||void 0!==a.loading||void 0!==a.error||void 0!==a.onToggle,[c,f]=(0,e.useState)(null),[g,h]=(0,e.useState)(!0),[i,j]=(0,e.useState)(null),[k,l]=(0,e.useState)(null),[m,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(null),r=(0,e.useCallback)(async()=>{h(!0),j(null);try{let a=await fetch("/api/integrations");if(!a.ok)throw Error(`Failed to load integrations (${a.status})`);let b=await a.json();f(b)}catch(a){j(a instanceof Error?a.message:"Failed to load integrations")}finally{h(!1)}},[]),s=b?a.data??null:c,t=b?a.loading??!1:g,u=b?a.error??null:i,v=b?a.savingId??null:k,w=b?a.repairing??!1:m,x=b?a.notice??null:p,y=(0,e.useMemo)(()=>s?.integrations??[],[s]),z=(0,e.useMemo)(()=>y.some(a=>("exa"===a.id||"apollo"===a.id)&&a.health.pluginMissing)||(s?.managedPlugins??[]).some(a=>a.required&&a.health.pluginMissing),[y,s?.managedPlugins]),A=(0,e.useCallback)(a=>{b||f(a)},[b]),B=(0,e.useCallback)(async(b,c)=>{if(a.onToggle)return void a.onToggle(b,c);let d=G(b);l(b.id),q(null);try{let a=await fetch(`/api/integrations/${b.id}/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:c})}),e=await a.json();if(!a.ok)throw Error("error"in e&&e.error?e.error:`Failed to update ${d}`);A(e),e.refresh.restarted?q({tone:"success",message:`${d} updated and the ${e.refresh.profile} gateway restarted successfully.`}):e.changed?q({tone:"warning",message:`${d} updated, but the gateway restart did not complete: ${e.refresh.error??"unknown error"}.`}):q({tone:"success",message:`${d} was already in the requested state.`})}catch(a){q({tone:"warning",message:a instanceof Error?a.message:`Failed to update ${d}.`})}finally{l(null)}},[A,a]),C=(0,e.useCallback)(async()=>{if(a.onRepair)return void a.onRepair();o(!0),q(null);try{let a=await fetch("/api/integrations/repair",{method:"POST"}),b=await a.json();if(!a.ok)throw Error("error"in b&&b.error?b.error:"Failed to repair integrations.");if(A(b),b.changed&&b.refresh.restarted){let a=b.repairedIds.length>0?b.repairedIds.map(a=>(function(a){switch(a){case"apollo":return"Dench Enrichments";case"exa":return"Exa";case"dench-ai-gateway":return"Dench AI Gateway";case"dench-identity":return"Dench Identity";case"posthog":return"PostHog"}})(a)).join(", "):"profiles";q({tone:"success",message:`Repair completed for ${a} and the ${b.refresh.profile} gateway restarted successfully.`})}else b.changed?q({tone:"warning",message:`Repair updated the profile, but the gateway restart did not complete: ${b.refresh.error??"unknown error"}.`}):q({tone:"success",message:"No repair changes were needed for this profile."})}catch(a){q({tone:"warning",message:a instanceof Error?a.message:"Failed to repair integrations."})}finally{o(!1)}},[A,a]);return t?(0,d.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,d.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}):u?(0,d.jsxs)("div",{className:"rounded-xl border px-4 py-4 text-center",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)("p",{className:"text-sm mb-2",style:{color:"var(--color-text-muted)"},children:u}),(0,d.jsx)(n.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{if(a.onRetry)return void a.onRetry();r()},children:"Retry"})]}):s?(0,d.jsxs)("div",{className:"space-y-4",children:[x&&(0,d.jsx)(F,{notice:x}),z&&(0,d.jsx)(n.$,{type:"button",variant:"outline",size:"sm",onClick:()=>void C(),disabled:w,children:w?"Repairing...":"Repair older profiles"}),(0,d.jsx)("div",{className:"space-y-1",children:y.map(a=>(0,d.jsx)(I,{integration:a,isSaving:v===a.id,onToggle:B},a.id))})]}):null}var K=c(183410),L=c(236705),M=c(332624),N=c(830004),O=c(792188),P=c(912886),Q=c(768996),R=c(306345);function S({onAddAndConnect:a,disabled:b=!1}){let[c,g]=(0,e.useState)(!1),[h,i]=(0,e.useState)(""),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(null),[o,p]=(0,e.useState)(!1),q=(0,e.useRef)(null),r=h.trim(),s=j.trim(),t=r.length>0&&s.length>0&&!o&&!b,u=()=>{g(!1),i(""),k(""),m(null),p(!1)},v=async()=>{if(t){p(!0),m(null);try{let b=await a({key:r,url:s});b.ok?u():m(b.error)}finally{p(!1)}}};return c?(0,d.jsx)("div",{className:"rounded-xl border px-4 py-4",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:(0,d.jsx)(K.default,{className:"h-5 w-5","aria-hidden":!0})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1 space-y-3",children:[(0,d.jsx)("div",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:"New MCP Server"}),(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"mcp-inline-key",className:"mb-1 block text-[11px] uppercase tracking-wide",style:{color:"var(--color-text-muted)"},children:"Server name"}),(0,d.jsx)("input",{id:"mcp-inline-key",ref:q,type:"text",value:h,onChange:a=>{i(a.target.value),m(null)},onKeyDown:a=>{"Enter"===a.key?(a.preventDefault(),v()):"Escape"===a.key&&(a.preventDefault(),u())},placeholder:"e.g. stripe",disabled:o,className:"w-full rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--color-accent)]",style:{background:"var(--color-bg)",border:"1px solid var(--color-border)",color:"var(--color-text)"},autoComplete:"off",spellCheck:!1})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"mcp-inline-url",className:"mb-1 block text-[11px] uppercase tracking-wide",style:{color:"var(--color-text-muted)"},children:"Server URL"}),(0,d.jsx)("input",{id:"mcp-inline-url",type:"url",value:j,onChange:a=>{k(a.target.value),m(null)},onKeyDown:a=>{"Enter"===a.key?(a.preventDefault(),v()):"Escape"===a.key&&(a.preventDefault(),u())},placeholder:"https://mcp.example.com",disabled:o,className:"w-full rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--color-accent)]",style:{background:"var(--color-bg)",border:"1px solid var(--color-border)",color:"var(--color-text)"},autoComplete:"off",spellCheck:!1})]})]}),l&&(0,d.jsx)("p",{className:"rounded-lg px-3 py-2 text-xs",style:{background:"rgba(220, 38, 38, 0.08)",color:"var(--color-error)"},children:l}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(n.$,{type:"button",variant:"ghost",size:"sm",className:"rounded-lg",onClick:u,disabled:o,style:{color:"var(--color-text-muted)",background:"transparent"},children:"Cancel"}),(0,d.jsx)(n.$,{type:"button",size:"sm",className:"rounded-lg",onClick:()=>void v(),disabled:!t,style:{background:t?"var(--color-accent)":"var(--color-surface-hover)",color:t?"var(--color-bg)":"var(--color-text-muted)"},children:(0,d.jsxs)("span",{className:"inline-flex items-center gap-2",children:[o?(0,d.jsx)(f.default,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):null,(0,d.jsx)("span",{children:o?"Connecting…":"Connect"})]})})]})]})]})}):(0,d.jsxs)("button",{type:"button",onClick:()=>{b||g(!0)},disabled:b,className:"flex w-full items-center gap-3 rounded-xl border px-4 py-4 text-left transition-colors hover:bg-[var(--color-surface-hover)] disabled:opacity-50",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:(0,d.jsx)(R.default,{className:"h-5 w-5","aria-hidden":!0})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("div",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:"New MCP Server"}),(0,d.jsx)("div",{className:"mt-0.5 text-xs leading-5",style:{color:"var(--color-text-muted)"},children:"Add a Custom MCP Server"})]})]})}var T=c(23581);function U({open:a,onOpenChange:b,serverKey:c,serverUrl:g,onSubmit:h,hint:i}){let j=(0,e.useRef)(null),[k,l]=(0,e.useState)(""),[m,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(!1),r=async()=>{if(!k.trim())return void o("Please enter an access token.");q(!0),o(null);try{let a=await h({authToken:k.trim()});if(a)return void o(a);b(!1)}finally{q(!1)}};return(0,d.jsx)(T.lG,{open:a,onOpenChange:b,children:(0,d.jsxs)(T.Cf,{className:"sm:max-w-lg",children:[(0,d.jsxs)(T.c7,{children:[(0,d.jsxs)(T.L3,{children:["Connect to ",c]}),(0,d.jsxs)(T.rr,{children:["Paste an access token for this MCP server. It will be sent as an",(0,d.jsx)("code",{className:"mx-1",children:"Authorization: Bearer ..."}),"header on every request."]})]}),(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"rounded-xl border px-3 py-2 text-xs leading-5",style:{borderColor:"var(--color-border)",background:"var(--color-surface)",color:"var(--color-text-muted)"},children:[(0,d.jsx)("div",{className:"text-[11px] uppercase tracking-wide",children:"Endpoint"}),(0,d.jsx)("div",{className:"mt-1 truncate",style:{color:"var(--color-text)"},title:g,children:g})]}),i?(0,d.jsxs)("p",{className:"rounded-lg px-3 py-2 text-xs leading-5",style:{background:"rgba(234, 179, 8, 0.08)",color:"var(--color-text-muted)"},children:["Server says: ",i]}):null,(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"mb-1.5 block text-sm font-medium",style:{color:"var(--color-text-secondary)"},children:"Access token"}),(0,d.jsx)("input",{ref:j,type:"password",value:k,onChange:a=>{l(a.target.value),o(null)},onKeyDown:a=>{"Enter"!==a.key||p||r()},placeholder:"sk-...",className:"w-full rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--color-accent)]",style:{background:"var(--color-bg)",border:"1px solid var(--color-border)",color:"var(--color-text)"}}),(0,d.jsxs)("p",{className:"mt-1 text-xs",style:{color:"var(--color-text-muted)"},children:["The ",(0,d.jsx)("code",{children:"Bearer"})," prefix is added automatically."]})]}),m&&(0,d.jsx)("p",{className:"rounded-lg px-3 py-2 text-sm",style:{background:"rgba(220, 38, 38, 0.08)",color:"var(--color-error)"},children:m})]}),(0,d.jsxs)(T.Es,{children:[(0,d.jsx)(n.$,{type:"button",variant:"ghost",onClick:()=>b(!1),disabled:p,className:"rounded-lg px-4",style:{color:"var(--color-text-muted)",background:"transparent"},children:"Cancel"}),(0,d.jsx)(n.$,{type:"button",onClick:()=>void r(),disabled:p||!k.trim(),className:"rounded-lg px-5",style:{background:"var(--color-accent)",color:"var(--color-bg)"},children:(0,d.jsxs)("span",{className:"inline-flex items-center gap-2",children:[p?(0,d.jsx)(f.default,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):null,(0,d.jsx)("span",{children:p?"Connecting...":"Connect"})]})})]})]})})}function V({notice:a}){let b="success"===a.tone?"border-emerald-500/30 bg-emerald-500/10 text-emerald-300":"border-red-500/30 bg-red-500/10 text-red-300";return(0,d.jsx)("div",{className:`rounded-xl border px-4 py-3 text-sm ${b}`,children:a.message})}async function W(a,b){try{let c=await a.json();return"string"==typeof c.error&&c.error.trim().length>0?c.error:b}catch{return b}}function X(a){return[...a].toSorted((a,b)=>a.key.localeCompare(b.key))}function Y(a,b){return X([...a.filter(a=>a.key!==b.key),b])}async function Z(a,b){return await new Promise(c=>{let d=!1,e=()=>{d||(d=!0,window.removeEventListener("message",f),clearInterval(g),clearTimeout(h),c())},f=c=>{if(c.source!==b)return;let d=c.data;if(d&&"denchclaw.mcp.connect"===d.source&&"string"==typeof d.serverKey&&d.serverKey===a){try{b.close()}catch{}e()}};window.addEventListener("message",f);let g=window.setInterval(()=>{b.closed&&e()},500),h=window.setTimeout(()=>{try{b.close()}catch{}e()},3e5)})}function _(){let[a,b]=(0,e.useState)([]),[c,f]=(0,e.useState)(!0),[g,h]=(0,e.useState)(null),[i,j]=(0,e.useState)(null),[k,l]=(0,e.useState)(null),[m,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(null),r=(0,e.useRef)(new Set),s=(0,e.useCallback)(async()=>{f(!0),h(null);try{let a=await fetch("/api/settings/mcp");if(!a.ok)throw Error(await W(a,`Failed to load MCP servers (${a.status}).`));let c=await a.json();b(X(Array.isArray(c.servers)?c.servers:[]))}catch(a){h(a instanceof Error?a.message:"Failed to load MCP servers.")}finally{f(!1)}},[]),t=(0,e.useCallback)(async a=>{q(a.key),j(null);try{let c=await fetch("/api/settings/mcp/probe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:a.key})});if(!c.ok)throw Error(await W(c,"Probe failed."));let d=await c.json();d.server&&b(a=>Y(a,d.server))}catch(a){j({tone:"error",message:a instanceof Error?a.message:"Probe failed."})}finally{q(null)}},[]),u=(0,e.useCallback)((a,b)=>{l({serverKey:a.key,serverUrl:a.url,hint:b})},[]),v=(0,e.useCallback)(async(a,c)=>{try{let d=await fetch("/api/settings/mcp/probe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:a})});if(!d.ok)return;let e=await d.json();e.server&&(b(a=>Y(a,e.server)),c?.showSuccessNotice!==!1&&"connected"===e.server.state&&j({tone:"success",message:`Connected '${a}'.`}))}catch{}},[]),w=(0,e.useCallback)(async a=>{q(a.key),j(null);try{let c=await fetch("/api/settings/mcp/connect/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:a.key})});if(!c.ok){let b=await W(c,"Failed to start Connect.");u(a,b);return}let d=await c.json();if(d.alreadyConnected&&d.server){b(a=>Y(a,d.server)),j({tone:"success",message:`'${a.key}' is already connected.`});return}if(!1===d.supportsOAuth)return void u(a,d.reason??a.lastDetail);if(!d.authorizationUrl)return void u(a,"OAuth start did not return an authorization URL.");let e=window.open(d.authorizationUrl,`mcp-connect-${a.key}`,"popup=yes,width=520,height=720,noopener=no");if(!e)return void u(a,"The browser blocked the OAuth popup. Allow popups and try again, or paste a token instead.");await Z(a.key,e),await v(a.key)}catch(b){u(a,b instanceof Error?b.message:"Connect failed.")}finally{q(null)}},[u,v]),x=(0,e.useCallback)(async a=>{j(null);try{let c=await fetch("/api/settings/mcp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!c.ok)return{ok:!1,error:await W(c,"Failed to add MCP server.")};let d=(await c.json()).server;if(!d)return{ok:!1,error:"Server was added but the response was malformed."};return r.current.delete(d.key),b(a=>Y(a,d)),w(d),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:"Failed to add MCP server."}}},[w]),y=(0,e.useCallback)(async a=>{if(!k)return"No server selected.";try{let c=await fetch("/api/settings/mcp/connect/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:k.serverKey,authToken:a.authToken})});if(!c.ok)return await W(c,"Failed to connect.");let d=await c.json();d.server&&b(a=>Y(a,d.server));let e=d.probe?.status;if("connected"===e)return j({tone:"success",message:`Connected to '${k.serverKey}'.`}),null;return d.probe?.detail??"The token was saved but the server still rejected the connection."}catch(a){return a instanceof Error?a.message:"Failed to connect."}},[k]),z=(0,e.useCallback)(async a=>{if(window.confirm(`Remove MCP server '${a.key}'?`)){o(a.key),j(null);try{let c=await fetch("/api/settings/mcp",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:a.key})});if(!c.ok)throw Error(await W(c,"Failed to remove MCP server."));b(b=>b.filter(b=>b.key!==a.key)),j({tone:"success",message:`Removed MCP server '${a.key}'.`})}catch(a){j({tone:"error",message:a instanceof Error?a.message:"Failed to remove MCP server."})}finally{o(null)}}},[]);return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"flex items-center justify-between gap-3",children:(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:"MCP Servers"}),(0,d.jsx)("p",{className:"mt-1 text-xs leading-5",style:{color:"var(--color-text-muted)"},children:"Connect remote MCP servers to expose additional tools in DenchClaw."})]})}),i?(0,d.jsx)(V,{notice:i}):null,c?(0,d.jsx)("div",{className:"flex items-center justify-center py-10",children:(0,d.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}):g?(0,d.jsxs)("div",{className:"rounded-xl border px-4 py-6 text-center",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)("p",{className:"mb-3 text-sm",style:{color:"var(--color-text-muted)"},children:g}),(0,d.jsx)(n.$,{type:"button",variant:"outline",onClick:()=>void s(),children:"Retry"})]}):(0,d.jsxs)("div",{className:"space-y-3",children:[a.map(a=>(0,d.jsx)(aa,{server:a,busy:p===a.key,deleting:m===a.key,onConnect:()=>w(a),onRetry:()=>void t(a),onDelete:()=>void z(a)},a.key)),(0,d.jsx)(S,{onAddAndConnect:x})]}),k?(0,d.jsx)(U,{open:!!k,onOpenChange:a=>{a||l(null)},serverKey:k.serverKey,serverUrl:k.serverUrl,hint:k.hint,onSubmit:y}):null]})}function aa({server:a,busy:b,deleting:c,onConnect:e,onRetry:g,onDelete:h}){return(0,d.jsx)("div",{className:"rounded-xl border px-4 py-4",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsxs)("div",{className:"flex min-w-0 gap-3",children:[(0,d.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:(0,d.jsx)(K.default,{className:"h-5 w-5","aria-hidden":!0})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("div",{className:"truncate text-sm font-medium",style:{color:"var(--color-text)"},children:a.key}),(0,d.jsx)(ab,{server:a}),(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:[a.hasAuth?(0,d.jsx)(L.default,{className:"h-3 w-3","aria-hidden":!0}):(0,d.jsx)(M.default,{className:"h-3 w-3","aria-hidden":!0}),(0,d.jsx)("span",{children:a.hasAuth?"Authenticated":"No auth"})]})]}),(0,d.jsx)("p",{className:"mt-2 text-[11px] uppercase tracking-wide",style:{color:"var(--color-text-muted)"},children:"Remote endpoint"}),(0,d.jsx)("div",{className:"mt-1 truncate text-xs leading-5",style:{color:"var(--color-text-muted)"},title:a.url,children:a.url}),a.lastDetail&&"connected"!==a.state?(0,d.jsx)("div",{className:"mt-2 text-xs leading-5",style:{color:"var(--color-text-muted)"},title:a.lastDetail,children:a.lastDetail}):null]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,d.jsx)(ac,{server:a,busy:b,onConnect:e,onRetry:g}),(0,d.jsx)(n.$,{type:"button",variant:"ghost",size:"icon",className:"rounded-lg",onClick:h,disabled:c,"aria-label":`Remove ${a.key}`,style:{color:"var(--color-text-muted)"},children:c?(0,d.jsx)(f.default,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):(0,d.jsx)(N.default,{className:"h-4 w-4","aria-hidden":!0})})]})]})})}function ab({server:a}){let b="inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium";if("connected"===a.state){let c=a.toolCount??0;return(0,d.jsxs)("span",{className:b,style:{background:"rgba(16, 185, 129, 0.12)",color:"rgb(110, 231, 183)"},children:[(0,d.jsx)(O.default,{className:"h-3 w-3","aria-hidden":!0}),(0,d.jsxs)("span",{children:[c," tool",1===c?"":"s"," enabled"]})]})}return"needs_auth"===a.state?(0,d.jsxs)("span",{className:b,style:{background:"rgba(234, 179, 8, 0.12)",color:"rgb(252, 211, 77)"},children:[(0,d.jsx)(M.default,{className:"h-3 w-3","aria-hidden":!0}),(0,d.jsx)("span",{children:"Needs authentication"})]}):"error"===a.state?(0,d.jsxs)("span",{className:b,style:{background:"rgba(239, 68, 68, 0.12)",color:"rgb(252, 165, 165)"},children:[(0,d.jsx)(P.default,{className:"h-3 w-3","aria-hidden":!0}),(0,d.jsx)("span",{children:"Error"})]}):(0,d.jsx)("span",{className:b,style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:a.transport})}function ac({server:a,busy:b,onConnect:c,onRetry:e}){return"connected"===a.state?(0,d.jsx)(n.$,{type:"button",variant:"ghost",size:"sm",className:"rounded-lg",onClick:e,disabled:b,"aria-label":`Re-check ${a.key}`,style:{color:"var(--color-text-muted)"},children:b?(0,d.jsx)(f.default,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):(0,d.jsx)(Q.default,{className:"h-4 w-4","aria-hidden":!0})}):"error"===a.state?(0,d.jsxs)(n.$,{type:"button",variant:"outline",size:"sm",className:"rounded-lg",onClick:e,disabled:b,children:[b?(0,d.jsx)(f.default,{className:"mr-1 h-4 w-4 animate-spin","aria-hidden":!0}):null,"Retry"]}):(0,d.jsxs)(n.$,{type:"button",variant:"outline",size:"sm",className:"rounded-lg",onClick:c,disabled:b,children:[b?(0,d.jsx)(f.default,{className:"mr-1 h-4 w-4 animate-spin","aria-hidden":!0}):null,"Connect"]})}let ad=[{id:"dench",name:"Dench",src:"/dench-workspace-icon.png",rounded:!0},{id:"aviato",name:"Aviato",src:"/integrations/aviato.ico",rounded:!0},{id:"apollo",name:"Apollo",src:"/integrations/apollo.ico",rounded:!0},{id:"pdl",name:"People Data Labs",src:"/integrations/people-data-labs.ico",rounded:!0},{id:"datagma",name:"Datagma",src:"/integrations/datagma.png",rounded:!0},{id:"rocketreach",name:"RocketReach",src:"/integrations/rocketreach.ico",rounded:!0},{id:"hunter",name:"Hunter",src:"/integrations/hunter.png",rounded:!0},{id:"bettercontacts",name:"Better Contacts",src:"/integrations/bettercontacts.png",rounded:!0},{id:"dropcontacts",name:"Dropcontact",src:"/integrations/dropcontacts.ico",rounded:!0},{id:"explorium",name:"Explorium",src:"/integrations/explorium.png",rounded:!0}],ae="__dench_default_voice__",af="w-full max-w-full rounded-xl border border-[color-mix(in_srgb,var(--color-border)_78%,transparent)] bg-[var(--color-surface)] px-3 py-2.5 hover:opacity-100";function ag(a){let b=new Map;for(let c of a?.integrations??[])b.set(c.id,c.enabled);return{exa:b.get("exa")??!1,apollo:b.get("apollo")??!1,elevenlabs:b.get("elevenlabs")??!1}}function ah({notice:a}){let b="success"===a.tone?"border-emerald-500/30 bg-emerald-500/10 text-emerald-300":"warning"===a.tone?"border-amber-500/30 bg-amber-500/10 text-amber-300":"border-red-500/30 bg-red-500/10 text-red-300";return(0,d.jsx)("div",{className:`rounded-xl border px-4 py-3 text-sm ${b}`,children:a.message})}function ai(){return(0,d.jsxs)("div",{className:"rounded-xl border px-4 py-4",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("div",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:"Dench Enrichment"}),(0,d.jsx)("div",{className:"max-w-[42rem] text-xs leading-5",style:{color:"var(--color-text-muted)"},children:"Waterfall providers"})]}),(0,d.jsx)("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:ad.map(a=>(0,d.jsx)("div",{className:"flex h-8 w-8 items-center justify-center",title:a.name,"aria-label":a.name,children:(0,d.jsx)("img",{src:a.src,alt:"",width:24,height:24,className:a.rounded?"h-6 w-6 rounded-[6px] object-contain":"h-6 w-6 object-contain",draggable:!1})},a.id))})]})}function aj(){return(0,d.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"})})}function ak(){return(0,d.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"}),(0,d.jsx)("path",{d:"m21 2-9.6 9.6"}),(0,d.jsx)("circle",{cx:"7.5",cy:"15.5",r:"5.5"})]})}function al(){return(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M15 3h6v6"}),(0,d.jsx)("path",{d:"M10 14 21 3"}),(0,d.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function am({onSave:a,saving:b,notice:c,validationError:f}){let[g,h]=(0,e.useState)("");return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border px-4 py-3",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg shrink-0",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:(0,d.jsx)(aj,{})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:"Dench Cloud"}),(0,d.jsx)("div",{className:"text-[11px] mt-0.5",style:{color:"var(--color-text-muted)"},children:f?"Your API key is invalid. Enter a new one below.":"Connect to Dench Cloud for AI model access."})]}),(0,d.jsxs)("a",{href:"https://dench.com/api",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded-lg transition-colors hover:bg-stone-200 dark:hover:bg-stone-700",style:{color:"var(--color-accent)"},children:["Get API Key ",(0,d.jsx)(al,{})]})]}),f&&(0,d.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-300",children:f}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)(ak,{})}),(0,d.jsx)("input",{type:"password",value:g,onChange:a=>h(a.target.value),onKeyDown:c=>{"Enter"===c.key&&g.trim()&&!b&&a(g.trim())},placeholder:"Paste your Dench API key...",className:"w-full pl-9 pr-3 py-2.5 rounded-xl text-sm outline-none transition-colors",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)",color:"var(--color-text)"},disabled:b})]}),(0,d.jsx)(n.$,{type:"button",onClick:()=>{g.trim()&&a(g.trim())},disabled:!g.trim()||b,children:b?"Validating...":"Save"})]}),c&&(0,d.jsx)(ah,{notice:c})]})}function an({models:a,selectedModel:b,selectedVoiceId:c,elevenLabsEnabled:e,isDenchPrimary:h,recommendedModelId:i,onSelect:k,onSelectVoice:l,selecting:n,savingVoice:o,voiceLoading:p,voices:q}){let r=a.map(a=>({stableId:a.stableId,...a.id.trim()&&a.id!==a.stableId?{catalogId:a.id}:{},displayName:a.displayName,provider:a.provider,reasoning:a.reasoning,isRecommended:a.id===i})),s=q.find(a=>a.voiceId===c)??null;return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border px-4 py-3",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("img",{src:"/dench-workspace-icon.png",alt:"",width:36,height:36,className:"h-9 w-9 shrink-0 rounded-lg object-contain",draggable:!1}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:"Dench Cloud"}),(0,d.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",style:{background:h?"rgba(16,185,129,0.15)":"var(--color-surface-hover)",color:h?"rgb(16,185,129)":"var(--color-text-muted)"},children:h?"Active":"Available"})]}),(0,d.jsx)("div",{className:"text-[11px] mt-0.5",style:{color:"var(--color-text-muted)"},children:h?"Connected and active as your primary provider.":"Connected. Select a model to use Dench Cloud as your primary provider."})]}),(0,d.jsxs)("a",{href:"https://dench.com/usage",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs font-medium shrink-0 transition-opacity hover:opacity-80",style:{color:"var(--color-accent)"},children:["Usage ",(0,d.jsx)(al,{})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium mb-2",style:{color:"var(--color-text-muted)"},children:"Primary Model"}),(0,d.jsx)("div",{className:"max-w-[420px]",children:(0,d.jsx)(m,{models:r,selectedModel:h?b:null,onSelect:k,disabled:n,loading:n,fallbackToFirst:h,placeholder:"Choose a model...",ariaLabel:"Select primary model",triggerClassName:af})})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium mb-2",style:{color:"var(--color-text-muted)"},children:"ElevenLabs Voice"}),(0,d.jsx)("div",{className:"max-w-[420px]",children:(0,d.jsxs)(j.rI,{children:[(0,d.jsxs)(j.ty,{className:`inline-flex items-center gap-1.5 text-sm font-medium transition-opacity disabled:cursor-default disabled:opacity-60 cursor-pointer outline-none ring-0 ${af}`,style:{color:"var(--color-text-secondary)",opacity:.9},"aria-label":"Select ElevenLabs voice",title:s?.name??void 0,disabled:p||o||0===q.length,children:[(0,d.jsx)("span",{className:"max-w-[240px] truncate",style:p||!s&&0===q.length?{color:"var(--color-text-muted)"}:void 0,children:p?"Loading voices...":0===q.length?"No voices available":s?`${s.name}${s.category?` \xb7 ${s.category}`:""}`:"Default voice (first available)"}),p||o?(0,d.jsx)(f.default,{className:"h-3.5 w-3.5 shrink-0 animate-spin","aria-hidden":!0}):(0,d.jsx)(g.default,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0})]}),(0,d.jsx)(j.SQ,{align:"start",side:"bottom",sideOffset:8,className:"min-w-[15rem] max-w-[20rem] p-1.5",children:(0,d.jsxs)(j.Hr,{value:c??ae,onValueChange:a=>{l(a===ae?null:a)},children:[(0,d.jsx)(j.Ht,{value:ae,children:"Default voice (first available)"}),q.map(a=>(0,d.jsx)(j.Ht,{value:a.voiceId,children:(0,d.jsxs)("span",{className:"truncate",children:[a.name,a.category?` \xb7 ${a.category}`:""]})},a.voiceId))]})})]})}),(0,d.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,d.jsx)("p",{className:"text-[11px]",style:{color:"var(--color-text-muted)"},children:e?"Used for message playback and server-side voice input.":"Choose a voice now. Playback and server-side voice input stay off until ElevenLabs is enabled in Integrations."}),s?.description&&(0,d.jsx)("p",{className:"text-[11px]",style:{color:"var(--color-text-muted)"},children:s.description})]})]})]})}function ao(){let[a,b]=(0,e.useState)(null),[c,g]=(0,e.useState)(null),[h,i]=(0,e.useState)([]),[j,k]=(0,e.useState)(!0),[l,m]=(0,e.useState)(!1),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)(null),[G,H]=(0,e.useState)({exa:!1,apollo:!1,elevenlabs:!1}),[I,K]=(0,e.useState)(0),L=(0,e.useCallback)(async()=>{k(!0),r(null);try{let a=await fetch("/api/settings/cloud");if(!a.ok)throw Error(`Failed to load cloud settings (${a.status})`);let c=await a.json();b(c)}catch(a){r(a instanceof Error?a.message:"Failed to load cloud settings.")}finally{k(!1)}},[]),M=(0,e.useCallback)(async()=>{m(!0),t(null);try{let a=await fetch("/api/integrations");if(!a.ok)throw Error(`Failed to load integrations (${a.status})`);let b=await a.json();g(b)}catch(a){t(a instanceof Error?a.message:"Failed to load integrations.")}finally{m(!1)}},[]);(0,e.useRef)(c).current=c;let N=(0,e.useCallback)(async a=>{v(!0),B(null);try{let c=await fetch("/api/settings/cloud",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"save_key",apiKey:a})}),d=await c.json();if(!c.ok)return void B({tone:"error",message:d.error??"Failed to save API key."});b(d.state);let e=d.refresh;e.restarted?B({tone:"success",message:`API key saved and the ${e.profile} gateway restarted successfully.`}):e.attempted?B({tone:"warning",message:`API key saved, but the gateway restart did not complete: ${e.error??"unknown error"}.`}):B({tone:"success",message:"API key saved successfully."})}catch(a){B({tone:"error",message:a instanceof Error?a.message:"Failed to save API key."})}finally{v(!1)}},[]),O=(0,e.useCallback)(a=>{B(null),D(a)},[]),P=(0,e.useCallback)(a=>{B(null),F(a)},[]),Q=(0,e.useCallback)((a,b)=>{B(null),H(c=>({...c,[a.id]:b}))},[]),R=(0,e.useCallback)(()=>{a?.status==="valid"&&c&&(B(null),D(a.isDenchPrimary?a.selectedDenchModel:null),F(a.selectedVoiceId),H(ag(c)))},[a,c]),S=a?.status==="valid"&&a.isDenchPrimary?a.selectedDenchModel:null,T=a?.status==="valid"?a.selectedVoiceId:null,U=(0,e.useMemo)(()=>ag(c),[c]),V=a?.status==="valid"&&(C!==S||E!==T||G.exa!==U.exa||G.apollo!==U.apollo||G.elevenlabs!==U.elevenlabs),W=!!C,X=(0,e.useMemo)(()=>c?{...c,denchCloud:{...c.denchCloud,isPrimaryProvider:W,primaryModel:c.denchCloud.primaryModel},integrations:c.integrations.map(a=>"dench_not_primary"!==a.lockReason?{...a,enabled:G[a.id]}:W?{...a,enabled:G[a.id],locked:!1,lockReason:null,lockBadge:null,available:a.auth.configured&&!!a.gatewayBaseUrl}:{...a,enabled:G[a.id],locked:!0,lockReason:"dench_not_primary",lockBadge:"Use Dench Cloud",available:!1})}:null,[G,W,c]),Y=(0,e.useCallback)(async()=>{x(!0),B(null);try{let a=await fetch("/api/settings/cloud",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"save_active_settings",stableId:C,voiceId:E,integrations:G})}),c=await a.json();if(!a.ok)return void B({tone:"error",message:c.error??"Failed to save cloud settings."});b(c.state),c.integrationsState?(g(c.integrationsState),K(a=>a+1)):(async()=>{await M(),K(a=>a+1)})();let d=c.refresh;c.changed?d.restarted?B({tone:"success",message:`Cloud settings saved and the ${d.profile} gateway restarted successfully.`}):d.attempted?B({tone:"warning",message:`Cloud settings saved, but the gateway restart did not complete: ${d.error??"unknown error"}.`}):B({tone:"success",message:"Cloud settings saved successfully."}):B({tone:"success",message:"No changes to save."})}catch(a){B({tone:"error",message:a instanceof Error?a.message:"Failed to save cloud settings."})}finally{x(!1)}},[G,C,E,M]),Z=(0,e.useCallback)(async()=>{z(!0),B(null);try{let a=await fetch("/api/integrations/repair",{method:"POST"}),b=await a.json();if(!a.ok)throw Error(b.error??"Failed to repair integrations.");if(g(b),K(a=>a+1),b.changed&&b.refresh.restarted){let a=b.repairedIds.length>0?b.repairedIds.join(", "):"profiles";B({tone:"success",message:`Repair completed for ${a} and the ${b.refresh.profile} gateway restarted successfully.`})}else b.changed?B({tone:"warning",message:`Repair updated the profile, but the gateway restart did not complete: ${b.refresh.error??"unknown error"}.`}):B({tone:"success",message:"No repair changes were needed for this profile."})}catch(a){B({tone:"error",message:a instanceof Error?a.message:"Failed to repair integrations."})}finally{z(!1)}},[]);return j?(0,d.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,d.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}):q?(0,d.jsxs)("div",{className:"rounded-xl border px-4 py-6 text-center",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)("p",{className:"text-sm mb-3",style:{color:"var(--color-text-muted)"},children:q}),(0,d.jsx)(n.$,{type:"button",variant:"outline",onClick:()=>void L(),children:"Retry"})]}):a?"no_key"===a.status||"invalid_key"===a.status?(0,d.jsxs)("div",{className:"space-y-8",children:[(0,d.jsx)(am,{onSave:N,saving:u,notice:A,validationError:"invalid_key"===a.status?a.validationError:void 0}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-medium mb-3",style:{color:"var(--color-text)"},children:"Integrations"}),(0,d.jsx)(J,{})]})]}):(0,d.jsxs)("div",{className:"space-y-8",children:[(0,d.jsx)(an,{models:a.models,selectedModel:C,selectedVoiceId:E,elevenLabsEnabled:G.elevenlabs,isDenchPrimary:W,recommendedModelId:a.recommendedModelId,onSelect:O,onSelectVoice:P,selecting:w,savingVoice:w,voiceLoading:o,voices:h}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-medium mb-3",style:{color:"var(--color-text)"},children:"Integrations"}),(0,d.jsx)(J,{data:X,loading:l,error:s,savingId:null,repairing:y,onToggle:Q,onRetry:()=>void M(),onRepair:()=>void Z()})]}),(0,d.jsx)(ai,{}),(0,d.jsx)(_,{}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-2",children:[(0,d.jsx)(n.$,{type:"button",variant:"ghost",className:"shrink-0 rounded-lg px-4 text-sm font-medium",style:{color:"var(--color-text-muted)",background:"transparent"},onClick:R,disabled:!V||w,children:"Reset"}),(0,d.jsx)(n.$,{type:"button",className:"min-w-28 shrink-0 rounded-lg px-5 text-sm font-semibold",style:{background:"var(--color-accent)",color:"var(--color-bg)"},onClick:()=>void Y(),disabled:!V||w||l||!!s,children:(0,d.jsxs)("span",{className:"inline-flex items-center justify-center gap-2 leading-none",children:[w?(0,d.jsx)(f.default,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):null,(0,d.jsx)("span",{children:w?"Saving...":"Save"})]})})]})]}):null}},200261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},202514:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.uniqBy=function(a,b){let c=new Map;for(let d=0;d<a.length;d++){let e=a[d],f=b(e,d,a);c.has(f)||c.set(f,e)}return Array.from(c.values())}},206274:(a,b,c)=>{"use strict";c.d(b,{W:()=>t});var d=c(736927),e=c(115962),f=c(327629),g=c(970093);function h({logo:a,name:b,slug:c}){let[f,h]=(0,e.useState)(!1),i=(0,g.m9)({toolkitSlug:c,toolkitName:b,initialLogo:a}),j=i.logo&&!f;return(0,d.jsx)("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center overflow-hidden",style:{background:"var(--color-surface-hover)",borderRadius:"13px",boxShadow:"inset 0 0 0 0.5px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.06)"},children:j?(0,d.jsx)("img",{src:i.logo??void 0,alt:"",className:"h-7 w-7 object-contain",loading:"lazy",decoding:"async",onError:()=>h(!0)}):(0,d.jsx)("span",{className:"text-sm font-semibold uppercase",style:{color:"var(--color-text-muted)"},children:b.slice(0,2)})})}function i({toolkit:a,activeConnections:b,totalConnections:c,mode:e="marketplace",onClick:f}){let g=b>0;return(0,d.jsxs)("div",{className:"group rounded-2xl p-3.5 flex items-start gap-3.5 cursor-pointer transition-shadow duration-200 hover:shadow-md",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},onClick:f,role:"button",tabIndex:0,onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&f()},"aria-label":`${g?"Manage":"Get"} ${a.name}`,children:[(0,d.jsx)(h,{logo:a.logo,name:a.name,slug:a.slug}),(0,d.jsxs)("div",{className:"flex-1 min-w-0 pt-0.5",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("div",{className:"text-[13px] font-semibold truncate leading-tight",style:{color:"var(--color-text)"},children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 text-[11px]",children:[g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"font-medium",style:{color:"var(--color-success, #34C759)"},children:[b," account",1===b?"":"s"]}),(a.tools_count>0||"number"==typeof c&&c>b)&&(0,d.jsx)("span",{style:{color:"var(--color-text-muted)"},children:"\xb7"})]}),g&&"number"==typeof c&&c>b&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{style:{color:"var(--color-text-muted)"},children:[c," total"]}),a.tools_count>0&&(0,d.jsx)("span",{style:{color:"var(--color-text-muted)"},children:"\xb7"})]}),a.tools_count>0&&(0,d.jsxs)("span",{style:{color:"var(--color-text-muted)"},children:[a.tools_count," tool",1===a.tools_count?"":"s"]})]})]}),(0,d.jsx)("span",{className:"shrink-0 rounded-full px-3.5 py-1 text-[12px] font-bold mt-0.5",style:g?{background:"var(--color-surface-hover)",color:"var(--color-accent)"}:{background:"var(--color-accent)",color:"#fff"},children:g?"Connected":"Connect"})]}),a.description&&(0,d.jsx)("p",{className:"text-[11px] leading-relaxed line-clamp-2 mt-1.5",style:{color:"var(--color-text-muted)"},children:a.description})]})]})}var j=c(415182),k=c(843572),l=c(554327);let m=["gmail","slack","github","notion","google-calendar","linear","airtable","hubspot","salesforce","jira","asana","discord"];function n(){return(0,d.jsxs)("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--color-text-muted)"},children:[(0,d.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,d.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}let o=null,p="composio-connected-apps-snapshot";function q(a){let b=new Map;for(let c of a)b.set((0,k.Kr)(c.slug),c);return Array.from(b.values())}function r(){return o||(o=function(){try{let a=localStorage.getItem(p);if(!a)return null;let b=JSON.parse(a);if(Array.isArray(b?.connectedToolkits)&&Array.isArray(b?.connections))return b}catch{}return null}()),{connectedToolkits:o?.connectedToolkits??[],marketplaceToolkits:[],marketplaceCursor:null,connections:o?.connections??[],categories:[],loading:null===o,marketplaceLoading:!1,marketplaceReady:!1,loadingMore:!1,error:null,connectionsError:null}}function s({eligible:a,lockBadge:b}){let[c,g]=(0,e.useState)(r),[h,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(""),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(null),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)([]);(0,e.useRef)(!1);let J=(0,e.useRef)(""),K=(0,e.useRef)(null),L=(0,e.useCallback)(async a=>{let b=new URLSearchParams;a?.search&&b.set("search",a.search),a?.category&&b.set("category",a.category),a?.cursor&&b.set("cursor",a.cursor),a?.limit&&b.set("limit",String(a.limit));let c=b.toString(),d=await fetch(`/api/composio/toolkits${c?`?${c}`:""}`);if(!d.ok)throw Error((await d.json().catch(()=>({}))).error??`Failed to load apps (${d.status})`);return(0,k.O0)(await d.json())},[]),M=(0,e.useCallback)(async a=>{try{let b=a?await fetch("/api/composio/status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:a})}):await fetch("/api/composio/status");if(b.ok){C(await b.json()),E(null);return}C(null);let c=await b.json().catch(()=>({}));E(c.error??(0,l.J)("load",b.status))}catch(a){C(null),E(a instanceof Error?a.message:(0,l.J)("load"))}},[]),N=(0,e.useCallback)(async a=>{g(a=>({...a,loading:0===a.connectedToolkits.length&&0===a.connections.length,error:null,connectionsError:null})),E(null),L({limit:24}).then(a=>{let b=new Set(m),c=[...a.items.filter(a=>b.has(a.slug)).sort((a,b)=>m.indexOf(a.slug)-m.indexOf(b.slug)),...a.items.filter(a=>!b.has(a.slug))];g(b=>b.marketplaceReady?b:{...b,marketplaceToolkits:c,marketplaceCursor:a.cursor,categories:a.categories,marketplaceReady:!0,marketplaceLoading:!1}),J.current="::"}).catch(()=>{});try{let c=await fetch(`/api/composio/connections?include_toolkits=1${a?.fresh?"&fresh=1":""}`),d={items:[]},e=null;c.ok?d=await c.json():e=(await c.json().catch(()=>({}))).error??`Failed to load connections (${c.status})`;let f=(0,k.s$)(d),h=q(d.toolkits??[]).sort((a,b)=>a.name.localeCompare(b.name));var b=o={connectedToolkits:h,connections:f};try{localStorage.setItem(p,JSON.stringify(b))}catch{}I(a=>a.filter(a=>!h.some(b=>(0,k.Kr)(b.slug)===(0,k.Kr)(a.slug)))),g(a=>({...a,connectedToolkits:h,connections:f,loading:!1,error:null,connectionsError:e})),window.setTimeout(()=>{M()},0)}catch(a){C(null),g(b=>({...b,loading:!1,error:b.connectedToolkits.length>0||b.connections.length>0?b.error:a instanceof Error?a.message:"Failed to load apps.",connectionsError:a instanceof Error?a.message:"Failed to load connections."}))}},[M,L]),O=(0,e.useCallback)(async a=>{let b=a?.reset??!1,d=t.trim(),e=`${d.toLowerCase()}::${v??""}`,f=b&&c.marketplaceReady;b?(J.current=e,g(a=>({...a,marketplaceToolkits:f?a.marketplaceToolkits:[],marketplaceCursor:null,categories:f?a.categories:[],marketplaceLoading:!0,marketplaceReady:f,loadingMore:!1,error:null}))):g(a=>({...a,loadingMore:!0}));try{let a=b?null:c.marketplaceCursor,f=await L({search:d||void 0,category:v??void 0,cursor:a,limit:24});if(J.current!==e)return;g(a=>{let c=b?f.items:q([...a.marketplaceToolkits,...f.items]),e=new Set(m),g=d||v?c:[...c.filter(a=>e.has(a.slug)).sort((a,b)=>m.indexOf(a.slug)-m.indexOf(b.slug)),...c.filter(a=>!e.has(a.slug))];return{...a,marketplaceToolkits:g,marketplaceCursor:f.cursor,categories:f.categories,marketplaceLoading:!1,marketplaceReady:!0,loadingMore:!1,error:null}})}catch(a){if(J.current!==e)return;g(b=>({...b,marketplaceLoading:!1,marketplaceReady:!0,loadingMore:!1,error:a instanceof Error?a.message:"Failed to load apps."}))}},[v,t,L,c.marketplaceCursor,c.marketplaceReady]),P=(0,e.useMemo)(()=>(0,k.eF)(c.connections),[c.connections]),Q=(0,e.useMemo)(()=>{let a=new Map;for(let b of P){let c=a.get(b.normalized_toolkit_slug);c?c.push(b):a.set(b.normalized_toolkit_slug,[b])}return a},[P]),R=(0,e.useMemo)(()=>{let a=new Map;for(let[b,c]of Q){let d=c.filter(a=>a.is_active);d.length>0&&a.set(b,d)}return a},[Q]),S=(0,e.useMemo)(()=>{let a=new Map;for(let[b,c]of R){let d=new Map;for(let a of c)d.has(a.account_identity)||d.set(a.account_identity,a);a.set(b,Array.from(d.values()))}return a},[R]),T=(0,e.useMemo)(()=>new Set(H.map(a=>(0,k.Kr)(a.slug))),[H]),U=(0,e.useMemo)(()=>q([...c.connectedToolkits,...H]).filter(a=>{let b=(0,k.Kr)(a.slug);return S.has(b)||T.has(b)}),[S,H,T,c.connectedToolkits]),V=(0,e.useMemo)(()=>{let a=t.trim().toLowerCase();return c.marketplaceToolkits.filter(b=>{let c=(0,k.Kr)(b.slug);return!(S.has(c)||T.has(c))&&(!a||b.name.toLowerCase().includes(a)||b.slug.toLowerCase().includes(a)||b.description.toLowerCase().includes(a))})},[S,t,T,c.marketplaceToolkits]),W=(0,e.useMemo)(()=>c.categories.slice(0,6),[c.categories]),X=x?Q.get((0,k.Kr)(x.slug))??[]:null,Y=(0,e.useCallback)(a=>{y(a),A(!0)},[]),Z=(0,e.useCallback)(a=>{if(a?.toolkit&&!1===a.connected){let b=(0,k.Kr)(a.toolkit.slug);I(a=>a.filter(a=>(0,k.Kr)(a.slug)!==b))}if(a?.connected){let d=a.connectedToolkitSlug??a.toolkit?.slug??null,e=a.connectedToolkitName??a.toolkit?.name??null;if(d&&e){var b;let f=(0,k.Kr)(d),g=[a.toolkit,...c.connectedToolkits,...c.marketplaceToolkits].filter(a=>!!a).find(a=>(0,k.Kr)(a.slug)===f)??null,h=g?{...g,slug:f,name:e}:(b=a.toolkit?.connect_slug??d,{slug:(0,k.Kr)(f),connect_slug:b??f,name:e,description:"",logo:null,categories:[],auth_schemes:[],tools_count:0});I(a=>q([...a.filter(a=>(0,k.Kr)(a.slug)!==f),h]))}}N({fresh:!0}),a?.connected&&window.setTimeout(()=>{N({fresh:!0})},1500),a?.shouldProbeLiveAgent&&window.setTimeout(()=>{M("probe_live_agent")},300),O({reset:!0})},[N,M,O,c.connectedToolkits,c.marketplaceToolkits]),_=(0,e.useCallback)(async()=>{G(!0),E(null);try{let a=await fetch("/api/composio/status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"repair_mcp"})}),b=await a.json().catch(()=>({}));if(!a.ok)return void E(b.error??(0,l.J)("update"));C(b)}catch(a){E(a instanceof Error?a.message:(0,l.J)("update"))}finally{G(!1)}},[]);if(!a)return(0,d.jsx)("div",{children:(0,d.jsx)("div",{className:"flex items-center justify-center rounded-2xl px-6 py-10",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"Available with Dench Cloud"}),b&&(0,d.jsx)("span",{className:"mt-2 inline-flex items-center rounded-full px-3 py-1 text-[11px] font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text)",border:"1px solid var(--color-border)"},children:b})]})})});let aa=t.trim();return(0,d.jsxs)("div",{children:[(D||B&&"healthy"!==B.summary.level)&&(0,d.jsxs)("div",{className:"mb-6 flex items-start justify-between gap-3 rounded-xl px-3 py-2 text-xs",style:{background:"color-mix(in srgb, var(--color-error, #ef4444) 8%, transparent)",color:"var(--color-error, #ef4444)",border:"1px solid color-mix(in srgb, var(--color-error, #ef4444) 20%, transparent)"},children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate",children:D??B?.summary.message??l.F.attentionLabel}),!D&&B?.liveAgent.detail&&"healthy"!==B.summary.level&&(0,d.jsx)("p",{className:"mt-1 text-[11px] opacity-80",children:B.liveAgent.detail}),!D&&(B?.liveAgent.evidence?.length??0)>0&&(0,d.jsxs)("p",{className:"mt-1 truncate text-[11px] opacity-70",children:["Evidence: ",B?.liveAgent.evidence.slice(0,3).join(", ")]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>void _(),disabled:F,className:"shrink-0 rounded-lg px-2 py-1 text-[11px] font-medium cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--color-error, #ef4444) 15%, transparent)"},children:F?"Repairing...":"Repair"})]}),c.loading&&(0,d.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,d.jsx)("div",{className:"w-6 h-6 border-2 rounded-full animate-spin",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}),!c.loading&&c.error&&(0,d.jsxs)("div",{className:"p-8 text-center rounded-2xl",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:[(0,d.jsx)("p",{className:"text-sm mb-3",style:{color:"var(--color-text-muted)"},children:c.error}),(0,d.jsx)(f.$,{type:"button",variant:"outline",size:"sm",onClick:()=>void N(),children:"Retry"})]}),!c.loading&&!c.error&&(0,d.jsxs)(d.Fragment,{children:[U.length>0&&(0,d.jsxs)("section",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2.5 mb-4",children:[(0,d.jsx)("h2",{className:"text-lg font-bold tracking-tight",style:{color:"var(--color-text)"},children:"Your Apps"}),(0,d.jsx)("span",{className:"text-[11px] font-medium rounded-full px-2 py-0.5",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:U.length})]}),(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:U.map(a=>{let b=(0,k.Kr)(a.slug),c=S.get(b)??[],e=Q.get(b)?.length??0;return(0,d.jsx)(i,{toolkit:a,activeConnections:c.length,totalConnections:e,mode:"connected",onClick:()=>Y(a)},a.slug)})})]}),(0,d.jsxs)("section",{children:[(0,d.jsx)("h2",{className:"text-lg font-bold tracking-tight mb-4",style:{color:"var(--color-text)"},children:"Discover"}),(0,d.jsxs)("div",{className:"relative mb-4",children:[(0,d.jsx)(n,{}),(0,d.jsx)("input",{type:"text",value:h,onChange:a=>s(a.target.value),placeholder:"Search apps...",className:"w-full pl-9 pr-4 py-2.5 rounded-xl text-sm outline-none transition-shadow focus:shadow-[0_0_0_3px_rgba(0,122,255,0.12)]",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"}})]}),W.length>0&&(0,d.jsxs)("div",{className:"mb-4 flex flex-wrap gap-1.5",children:[(0,d.jsx)("button",{type:"button",onClick:()=>w(null),className:"rounded-full px-3 py-1 text-[11px] font-medium transition-colors cursor-pointer",style:{background:v?"var(--color-surface)":"var(--color-accent)",color:v?"var(--color-text-muted)":"var(--color-bg, #fff)",border:`1px solid ${!v?"var(--color-accent)":"var(--color-border)"}`},children:"All"}),W.map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>w(v===a?null:a),className:"rounded-full px-3 py-1 text-[11px] font-medium transition-colors cursor-pointer",style:{background:v===a?"var(--color-accent)":"var(--color-surface)",color:v===a?"var(--color-bg, #fff)":"var(--color-text-muted)",border:`1px solid ${v===a?"var(--color-accent)":"var(--color-border)"}`},children:a},a))]}),c.marketplaceLoading&&c.marketplaceReady&&(0,d.jsx)("div",{className:"mb-4 text-xs",style:{color:"var(--color-text-muted)"},children:"Searching..."}),!c.marketplaceReady&&!c.loading&&(0,d.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,d.jsx)("div",{className:"w-5 h-5 border-2 rounded-full animate-spin",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}),c.marketplaceReady&&V.length>0&&(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:V.map(a=>(0,d.jsx)(i,{toolkit:a,activeConnections:0,mode:"marketplace",onClick:()=>Y(a)},a.slug))}),c.marketplaceReady&&!c.marketplaceLoading&&0===V.length&&(0,d.jsxs)("div",{className:"p-8 text-center rounded-2xl",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:[(0,d.jsx)("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:aa?`No apps found for "${aa}".`:v?`No apps found in "${v}".`:"No apps found."}),(aa||v)&&(0,d.jsx)("p",{className:"mt-2 text-xs",style:{color:"var(--color-text-muted)"},children:"Try clearing search or category filters."})]}),(!!c.marketplaceCursor||c.loadingMore)&&(0,d.jsx)("div",{ref:K,className:"flex items-center justify-center py-6 text-xs",style:{color:"var(--color-text-muted)"},children:c.loadingMore?"Loading more apps...":"Scroll to load more"})]})]}),(0,d.jsx)(j.R,{toolkit:x,connections:X??[],open:z,onOpenChange:A,onConnectionChange:Z})]})}function t({embedded:a}={}){let[b,c]=(0,e.useState)(null),[g,h]=(0,e.useState)(!0),[i,j]=(0,e.useState)(null),k=(0,e.useCallback)(async()=>{h(!0),j(null);try{let a=await fetch("/api/integrations");if(!a.ok)throw Error(`Failed to load integrations (${a.status})`);let b=await a.json();c(b)}catch(a){j(a instanceof Error?a.message:"Failed to load integrations")}finally{h(!1)}},[]);return(0,d.jsxs)("div",{className:"",children:[!a&&(0,d.jsxs)("div",{className:"mb-6 flex items-start justify-between gap-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h1",{className:"font-instrument text-3xl tracking-tight",style:{color:"var(--color-text)"},children:"Integrations"}),(0,d.jsx)("p",{className:"mt-1 text-sm",style:{color:"var(--color-text-muted)"},children:"Connect third-party apps to your Dench Cloud workspace."})]}),(0,d.jsxs)("a",{className:"flex shrink-0 items-center gap-1.5 rounded-full px-3 py-1.5 text-[11px] font-medium transition-opacity hover:opacity-80",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)",color:"var(--color-text-muted)"},children:["Powered by",(0,d.jsx)("img",{src:"/logo/composio.webp",alt:"Composio",className:"h-10 w-auto dark:invert"})]})]}),g&&(0,d.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,d.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}),!g&&i&&(0,d.jsxs)("div",{className:"rounded-xl border px-4 py-6 text-center",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)("p",{className:"text-sm mb-3",style:{color:"var(--color-text-muted)"},children:i}),(0,d.jsx)(f.$,{type:"button",variant:"outline",onClick:()=>void k(),children:"Retry"})]}),!g&&!i&&b&&(0,d.jsx)(s,{eligible:!!(b.denchCloud.hasKey&&b.denchCloud.isPrimaryProvider),lockBadge:b.denchCloud.hasKey?b.denchCloud.isPrimaryProvider?null:"Use Dench Cloud":"Get Dench Cloud API Key"})]})}},207346:(a,b,c)=>{"use strict";c.d(b,{k:()=>f});var d=c(286102),e=c(502714);function f(a,b){let{start:c,end:f}=(0,d.P)(b?.in,a),g=+c>+f,h=g?+c:+f,i=g?f:c;i.setHours(0,0,0,0);let j=b?.step??1;if(!j)return[];j<0&&(j=-j,g=!g);let k=[];for(;+i<=h;)k.push((0,e.w)(c,i)),i.setDate(i.getDate()+j),i.setHours(0,0,0,0);return g?k.reverse():k}},208732:a=>{"use strict";var b=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,c=/\n/g,d=/^\s*/,e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,f=/^:\s*/,g=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,h=/^[;\s]*/,i=/^\s+|\s+$/g;function j(a){return a?a.replace(i,""):""}a.exports=function(a,i){if("string"!=typeof a)throw TypeError("First argument must be a string");if(!a)return[];i=i||{};var k=1,l=1;function m(a){var b=a.match(c);b&&(k+=b.length);var d=a.lastIndexOf("\n");l=~d?a.length-d:l+a.length}function n(){var a={line:k,column:l};return function(b){return b.position=new o(a),q(d),b}}function o(a){this.start=a,this.end={line:k,column:l},this.source=i.source}function p(b){var c=Error(i.source+":"+k+":"+l+": "+b);if(c.reason=b,c.filename=i.source,c.line=k,c.column=l,c.source=a,i.silent);else throw c}function q(b){var c=b.exec(a);if(c){var d=c[0];return m(d),a=a.slice(d.length),c}}function r(a){var b;for(a=a||[];b=s();)!1!==b&&a.push(b);return a}function s(){var b=n();if("/"==a.charAt(0)&&"*"==a.charAt(1)){for(var c=2;""!=a.charAt(c)&&("*"!=a.charAt(c)||"/"!=a.charAt(c+1));)++c;if(c+=2,""===a.charAt(c-1))return p("End of comment missing");var d=a.slice(2,c-2);return l+=2,m(d),a=a.slice(c),l+=2,b({type:"comment",comment:d})}}o.prototype.content=a,q(d);var t,u=[];for(r(u);t=function(){var a=n(),c=q(e);if(c){if(s(),!q(f))return p("property missing ':'");var d=q(g),i=a({type:"declaration",property:j(c[0].replace(b,"")),value:d?j(d[0].replace(b,"")):""});return q(h),i}}();)!1!==t&&(u.push(t),r(u));return u}},210164:(a,b,c)=>{"use strict";c.d(b,{d:()=>e});let d={};function e(a,b){let c=b||d;return f(a,"boolean"!=typeof c.includeImageAlt||c.includeImageAlt,"boolean"!=typeof c.includeHtml||c.includeHtml)}function f(a,b,c){var d;if((d=a)&&"object"==typeof d){if("value"in a)return"html"!==a.type||c?a.value:"";if(b&&"alt"in a&&a.alt)return a.alt;if("children"in a)return g(a.children,b,c)}return Array.isArray(a)?g(a,b,c):""}function g(a,b,c){let d=[],e=-1;for(;++e<a.length;)d[e]=f(a[e],b,c);return d.join("")}},213203:(a,b,c)=>{"use strict";c.d(b,{F:()=>f,h:()=>g});var d=c(736927);let e=new Set(["xlsx","xls","xlsb","xlsm","xltx","xltm","ods","fods","csv","tsv","numbers"]);function f(a){let b=a.split(".").pop()?.toLowerCase()??"";return e.has(b)}function g(a){let{content:b,filename:c,type:e}=a,f=b.split("\n");return(0,d.jsxs)("div",{className:"max-w-4xl mx-auto px-6 py-8",children:[(0,d.jsx)(h,{filename:c,label:e.toUpperCase()}),(0,d.jsx)("div",{className:"rounded-b-lg border overflow-x-auto",style:{background:"var(--color-bg)",borderColor:"var(--color-border)"},children:(0,d.jsx)("pre",{className:"text-sm leading-6",style:{margin:0},children:(0,d.jsx)("code",{children:f.map((a,b)=>(0,d.jsxs)("div",{className:"flex hover:bg-[var(--color-surface-hover)] transition-colors duration-75",children:[(0,d.jsx)("span",{className:"select-none text-right pr-4 pl-4 flex-shrink-0 tabular-nums",style:{color:"var(--color-text-muted)",opacity:.5,minWidth:"3rem",userSelect:"none"},children:b+1}),(0,d.jsx)("span",{className:"pr-4 flex-1",style:{color:"var(--color-text)"},children:"yaml"===e?(0,d.jsx)(i,{line:a}):a||" "})]},b))})})})]})}function h({filename:a,label:b,icon:c}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2.5 rounded-t-lg border border-b-0",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:[c??(0,d.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--color-text-muted)"},children:[(0,d.jsx)("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),(0,d.jsx)("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})]}),(0,d.jsx)("span",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:a}),(0,d.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded ml-auto",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:b})]})}function i({line:a}){if(a.trim().startsWith("#"))return(0,d.jsx)("span",{style:{color:"var(--color-text-muted)"},children:a});let b=a.match(/^(\s*)([\w][\w_-]*)\s*(:)(.*)/);if(b){let[,a,c,e,f]=b;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{children:a}),(0,d.jsx)("span",{style:{color:"#60a5fa"},children:c}),(0,d.jsx)("span",{style:{color:"var(--color-text-muted)"},children:e}),(0,d.jsx)(j,{value:f})]})}let c=a.match(/^(\s*)(-)(\s*)(.*)/);if(c){let[,a,b,e,f]=c;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{children:a}),(0,d.jsx)("span",{style:{color:"var(--color-accent)"},children:b}),(0,d.jsx)("span",{children:e}),(0,d.jsx)("span",{style:{color:"var(--color-text)"},children:f})]})}return(0,d.jsx)("span",{children:a||" "})}function j({value:a}){let b=a.trim();return b.startsWith('"')&&b.endsWith('"')||b.startsWith("'")&&b.endsWith("'")?(0,d.jsxs)("span",{style:{color:"#a5d6a7"},children:[" ",b]}):"true"===b||"false"===b?(0,d.jsxs)("span",{style:{color:"#f59e0b"},children:[" ",b]}):/^-?\d+(\.\d+)?$/.test(b)?(0,d.jsxs)("span",{style:{color:"#c084fc"},children:[" ",b]}):"null"===b?(0,d.jsxs)("span",{style:{color:"var(--color-text-muted)",fontStyle:"italic"},children:[" ",b]}):(0,d.jsxs)("span",{style:{color:"var(--color-text)"},children:[" ",a]})}},215071:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],f=(0,d.A)("loader-circle",e)},215750:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(439384),e=c(958961),f=c(882351);function g(a,b,c,j){if(b===a)return!0;switch(typeof b){case"object":return function(a,b,c,d){if(null==b)return!0;if(Array.isArray(b))return h(a,b,c,d);if(b instanceof Map){var f=a,g=b,j=c,k=d;if(0===g.size)return!0;if(!(f instanceof Map))return!1;for(let[a,b]of g.entries())if(!1===j(f.get(a),b,a,f,g,k))return!1;return!0}if(b instanceof Set)return i(a,b,c,d);let l=Object.keys(b);if(null==a||e.isPrimitive(a))return 0===l.length;if(0===l.length)return!0;if(d?.has(b))return d.get(b)===a;d?.set(b,a);try{for(let f=0;f<l.length;f++){let g=l[f];if(!e.isPrimitive(a)&&!(g in a)||void 0===b[g]&&void 0!==a[g]||null===b[g]&&null!==a[g]||!c(a[g],b[g],g,a,b,d))return!1}return!0}finally{d?.delete(b)}}(a,b,c,j);case"function":if(Object.keys(b).length>0)return g(a,{...b},c,j);return f.isEqualsSameValueZero(a,b);default:if(!d.isObject(a))return f.isEqualsSameValueZero(a,b);if("string"==typeof b)return""===b;return!0}}function h(a,b,c,d){if(0===b.length)return!0;if(!Array.isArray(a))return!1;let e=new Set;for(let f=0;f<b.length;f++){let g=b[f],h=!1;for(let i=0;i<a.length;i++){if(e.has(i))continue;let j=a[i],k=!1;if(c(j,g,f,a,b,d)&&(k=!0),k){e.add(i),h=!0;break}}if(!h)return!1}return!0}function i(a,b,c,d){return 0===b.size||a instanceof Set&&h([...a],[...b],c,d)}b.isMatchWith=function a(b,c,d){return"function"!=typeof d?a(b,c,()=>void 0):g(b,c,function a(b,c,e,f,h,i){let j=d(b,c,e,f,h,i);return void 0!==j?!!j:g(b,c,a,i)},new Map)},b.isSetMatch=i},226713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},227443:function(a,b,c){"use strict";var d=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(b,"__esModule",{value:!0}),b.default=function(a,b){let c=null;if(!a||"string"!=typeof a)return c;let d=(0,e.default)(a),f="function"==typeof b;return d.forEach(a=>{if("declaration"!==a.type)return;let{property:d,value:e}=a;f?b(d,e,a):e&&((c=c||{})[d]=e)}),c};let e=d(c(208732))},228123:(a,b,c)=>{let d=c(512089),{FormulaHelpers:e,Types:f,Factorials:g,Criteria:h}=c(828358),{Infix:i}=c(341790),j=[],k=[];function l(a){return a<=100?g[a]:j[a]>0?j[a]:j[a]=l(a-1)*a}let m={ABS:a=>Math.abs(a=e.accept(a,f.NUMBER)),AGGREGATE:(a,b,c,...d)=>{},ARABIC:a=>{if(a=e.accept(a,f.STRING).toUpperCase(),!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(a))throw new d("#VALUE!","Invalid roman numeral in ARABIC evaluation.");let b=0;return a.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g,function(a){b+=({M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1})[a]}),b},BASE:(a,b,c)=>{if((a=e.accept(a,f.NUMBER))<0||a>=0x20000000000000||(b=e.accept(b,f.NUMBER))<2||b>36||(c=e.accept(c,f.NUMBER,0))<0)throw d.NUM;let g=a.toString(b).toUpperCase();return Array(Math.max(c+1-g.length,0)).join("0")+g},CEILING:(a,b)=>{if(a=e.accept(a,f.NUMBER),0===(b=e.accept(b,f.NUMBER)))return 0;if(a/b%1==0)return a;let c=Math.abs(b),d=Math.floor(Math.abs(a)/c);return a<0?b<0?-c*(d+1):-c*d:(d+1)*c},"CEILING.MATH":(a,b,c)=>{if(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER,a>0?1:-1),c=e.accept(c,f.NUMBER,0),a>=0)return m.CEILING(a,b);let d=c?b:0;return m.CEILING(a,b)-d},"CEILING.PRECISE":(a,b)=>(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER,1),m.CEILING(a,Math.abs(b))),COMBIN:(a,b)=>{if(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER),a<0||b<0||a<b)throw d.NUM;return m.FACT(a)/m.FACT(b)/m.FACT(a-b)},COMBINA:(a,b)=>{if(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER),(0===a||1===a)&&0===b)return 1;if(a<0||b<0)throw d.NUM;return m.COMBIN(a+b-1,a-1)},DECIMAL:(a,b)=>{if(a=e.accept(a,f.STRING),(b=Math.trunc(b=e.accept(b,f.NUMBER)))<2||b>36)throw d.NUM;let c=parseInt(a,b);if(isNaN(c))throw d.NUM;return c},DEGREES:a=>180/Math.PI*(a=e.accept(a,f.NUMBER)),EVEN:a=>m.CEILING(a,-2),EXP:a=>Math.exp(a=e.accept(a,f.NUMBER)),FACT:a=>{if((a=Math.trunc(a=e.accept(a,f.NUMBER)))>170||a<0)throw d.NUM;return a<=100?g[a]:l(a)},FACTDOUBLE:a=>{if((a=Math.trunc(a=e.accept(a,f.NUMBER)))<-1)throw d.NUM;return -1===a?1:function a(b){return 1===b||0===b?1:2===b?2:k[b]>0?k[b]:k[b]=a(b-2)*b}(a)},FLOOR:(a,b)=>{if(a=e.accept(a,f.NUMBER),0===(b=e.accept(b,f.NUMBER)))return 0;if(a>0&&b<0)throw d.NUM;if(a/b%1==0)return a;let c=Math.abs(b),g=Math.floor(Math.abs(a)/c);return a<0?b<0?-c*g:-c*(g+1):g*c},"FLOOR.MATH":(a,b,c)=>(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER,a>0?1:-1),0===(c=e.accept(c,f.NUMBER,0))||a>=0)?m.FLOOR(a,Math.abs(b)):m.FLOOR(a,b)+b,"FLOOR.PRECISE":(a,b)=>(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER,1),m.FLOOR(a,Math.abs(b))),GCD:(...a)=>{let b=[];e.flattenParams(a,null,!1,a=>{if(isNaN(a="boolean"==typeof a?NaN:Number(a)))throw d.VALUE;if(a<0||a>0x1ffffffffffffe)throw d.NUM;b.push(Math.trunc(a))},0);let c,f,g=a.length,h=Math.abs(b[0]);for(c=1;c<g;c++){for(f=Math.abs(b[c]);h&&f;)h>f?h%=f:f%=h;h+=f}return h},INT:a=>Math.floor(a=e.accept(a,f.NUMBER)),"ISO.CEILING":(...a)=>m["CEILING.PRECISE"](...a),LCM:(...a)=>{let b=[];e.flattenParams(a,null,!1,a=>{if(isNaN(a="boolean"==typeof a?NaN:Number(a)))throw d.VALUE;if(a<0||a>0x1ffffffffffffe)throw d.NUM;b.push(Math.trunc(a))},1);let c=b.length,f=Math.abs(b[0]);for(let a=1;a<c;a++){let c=Math.abs(b[a]),d=f;for(;f&&c;)f>c?f%=c:c%=f;f=Math.abs(d*b[a])/(f+c)}return f},LN:a=>Math.log(a=e.accept(a,f.NUMBER)),LOG:(a,b)=>Math.log(a=e.accept(a,f.NUMBER))/Math.log(b=e.accept(b,f.NUMBER,10)),LOG10:a=>Math.log10(a=e.accept(a,f.NUMBER)),MDETERM:a=>{if((a=e.accept(a,f.ARRAY,void 0,!1,!0))[0].length!==a.length)throw d.VALUE;let b=a.length,c=a[0].length,g=0,h,i;if(1===b)return a[0][0];if(2===b)return a[0][0]*a[1][1]-a[0][1]*a[1][0];for(let d=0;d<c;d++){h=a[0][d],i=a[0][d];for(let e=1;e<b;e++)i*=a[e][((d+e)%c+c)%c],h*=a[e][((d-e)%c+c)%c];g+=i-h}return g},MINVERSE:a=>{},MMULT:(a,b)=>{a=e.accept(a,f.ARRAY,void 0,!1,!0),b=e.accept(b,f.ARRAY,void 0,!1,!0);let c=a.length,g=a[0].length,h=b.length,i=b[0].length,j=Array(c);if(g!==h)throw d.VALUE;for(let e=0;e<c;e++){j[e]=Array(i);for(let c=0;c<i;c++){j[e][c]=0;for(let f=0;f<g;f++){let g=a[e][f],h=b[f][c];if("number"!=typeof g||"number"!=typeof h)throw d.VALUE;j[e][c]+=a[e][f]*b[f][c]}}}return j},MOD:(a,b)=>{if(a=e.accept(a,f.NUMBER),0===(b=e.accept(b,f.NUMBER)))throw d.DIV0;return a-b*m.INT(a/b)},MROUND:(a,b)=>{if(a=e.accept(a,f.NUMBER),0===(b=e.accept(b,f.NUMBER)))return 0;if(a>0&&b<0||a<0&&b>0)throw d.NUM;return a/b%1==0?a:Math.round(a/b)*b},MULTINOMIAL:(...a)=>{let b=0,c=1;return e.flattenParams(a,f.NUMBER,!1,a=>{if(a<0)throw d.NUM;b+=a,c*=l(a)}),l(b)/c},MUNIT:a=>{a=e.accept(a,f.NUMBER);let b=[];for(let c=0;c<a;c++){let d=[];for(let b=0;b<a;b++)c===b?d.push(1):d.push(0);b.push(d)}return b},ODD:a=>{if(0===(a=e.accept(a,f.NUMBER)))return 1;let b=Math.ceil(Math.abs(a));return b=1&b?b:b+1,a>0?b:-b},PI:()=>Math.PI,POWER:(a,b)=>(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER),a**b),PRODUCT:(...a)=>{let b=1;return e.flattenParams(a,null,!0,(a,c)=>{let d=Number(a);c.isLiteral&&!isNaN(d)?b*=d:"number"==typeof a&&(b*=a)},1),b},QUOTIENT:(a,b)=>Math.trunc((a=e.accept(a,f.NUMBER))/(b=e.accept(b,f.NUMBER))),RADIANS:a=>(a=e.accept(a,f.NUMBER))/180*Math.PI,RAND:()=>Math.random(),RANDBETWEEN:(a,b)=>(a=e.accept(a,f.NUMBER),Math.floor(Math.random()*((b=e.accept(b,f.NUMBER))-a+1)+a)),ROMAN:(a,b)=>{if(a=e.accept(a,f.NUMBER),0!==(b=e.accept(b,f.NUMBER,0)))throw Error("ROMAN: only allows form=0 (classic form).");let c=String(a).split(""),d=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"],g="",h=3;for(;h--;)g=(d[+c.pop()+10*h]||"")+g;return Array(+c.join("")+1).join("M")+g},ROUND:(a,b)=>{a=e.accept(a,f.NUMBER);let c=Math.pow(10,Math.abs(b=e.accept(b,f.NUMBER))),d=a>0?1:-1;return b>0?d*Math.round(Math.abs(a)*c)/c:0===b?d*Math.round(Math.abs(a)):d*Math.round(Math.abs(a)/c)*c},ROUNDDOWN:(a,b)=>{a=e.accept(a,f.NUMBER);let c=Math.pow(10,Math.abs(b=e.accept(b,f.NUMBER))),d=a>0?1:-1;return b>0?d*Math.round((Math.abs(a)-1/c*.5)*c)/c:0===b?d*Math.round(Math.abs(a)-.5):d*Math.round((Math.abs(a)-.5*c)/c)*c},ROUNDUP:(a,b)=>{a=e.accept(a,f.NUMBER);let c=Math.pow(10,Math.abs(b=e.accept(b,f.NUMBER))),d=a>0?1:-1;return b>0?d*Math.round((Math.abs(a)+1/c*.5)*c)/c:0===b?d*Math.round(Math.abs(a)+.5):d*Math.round((Math.abs(a)+.5*c)/c)*c},SERIESSUM:(a,b,c,g)=>{a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER),c=e.accept(c,f.NUMBER);let h=0,i;return e.flattenParams([g],f.NUMBER,!1,e=>{if("number"!=typeof e)throw d.VALUE;0===h?i=e*Math.pow(a,b):i+=e*Math.pow(a,b+h*c),h++}),i},SIGN:a=>(a=e.accept(a,f.NUMBER))>0?1:0===a?0:-1,SQRT:a=>{if((a=e.accept(a,f.NUMBER))<0)throw d.NUM;return Math.sqrt(a)},SQRTPI:a=>{if((a=e.accept(a,f.NUMBER))<0)throw d.NUM;return Math.sqrt(a*Math.PI)},SUBTOTAL:()=>{},SUM:(...a)=>{let b=0;return e.flattenParams(a,f.NUMBER,!0,(a,c)=>{c.isLiteral?b+=a:"number"==typeof a&&(b+=a)}),b},SUMIF:(a,b,c,d)=>{let f=e.retrieveRanges(a,b,d);b=f[0],d=f[1];let g=(c=e.retrieveArg(a,c)).isArray;c=h.parse(e.accept(c));let j=0;return b.forEach((a,b)=>{a.forEach((a,e)=>{let f=d[b][e];"number"==typeof f&&("wc"===c.op?c.match===c.value.test(a)&&(j+=f):i.compareOp(a,c.op,c.value,Array.isArray(a),g)&&(j+=f))})}),j},SUMIFS:()=>{},SUMPRODUCT:(a,...b)=>{a=e.accept(a,f.ARRAY,void 0,!1,!0),b.forEach(b=>{if(b=e.accept(b,f.ARRAY,void 0,!1,!0),a[0].length!==b[0].length||a.length!==b.length)throw d.VALUE;for(let c=0;c<a.length;c++)for(let d=0;d<a[0].length;d++)"number"!=typeof a[c][d]&&(a[c][d]=0),"number"!=typeof b[c][d]&&(b[c][d]=0),a[c][d]*=b[c][d]});let c=0;return a.forEach(a=>{a.forEach(a=>{c+=a})}),c},SUMSQ:(...a)=>{let b=0;return e.flattenParams(a,f.NUMBER,!0,(a,c)=>{c.isLiteral?b+=a**2:"number"==typeof a&&(b+=a**2)}),b},SUMX2MY2:(a,b)=>{let c=[],f=[],g=0;if(e.flattenParams([a],null,!1,(a,b)=>{c.push(a)}),e.flattenParams([b],null,!1,(a,b)=>{f.push(a)}),c.length!==f.length)throw d.NA;for(let a=0;a<c.length;a++)"number"==typeof c[a]&&"number"==typeof f[a]&&(g+=c[a]**2-f[a]**2);return g},SUMX2PY2:(a,b)=>{let c=[],f=[],g=0;if(e.flattenParams([a],null,!1,(a,b)=>{c.push(a)}),e.flattenParams([b],null,!1,(a,b)=>{f.push(a)}),c.length!==f.length)throw d.NA;for(let a=0;a<c.length;a++)"number"==typeof c[a]&&"number"==typeof f[a]&&(g+=c[a]**2+f[a]**2);return g},SUMXMY2:(a,b)=>{let c=[],f=[],g=0;if(e.flattenParams([a],null,!1,(a,b)=>{c.push(a)}),e.flattenParams([b],null,!1,(a,b)=>{f.push(a)}),c.length!==f.length)throw d.NA;for(let a=0;a<c.length;a++)"number"==typeof c[a]&&"number"==typeof f[a]&&(g+=(c[a]-f[a])**2);return g},TRUNC:a=>Math.trunc(a=e.accept(a,f.NUMBER))};a.exports=m},228760:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{a:()=>i});var e=c(736927),f=c(115962),g=c(278908),h=a([g]);g=(h.then?(await h)():h)[0];function i({filename:a,rawUrl:b,contentUrl:c}){let[d,g]=(0,f.useState)("rendered"),[h,i]=(0,f.useState)(null),[p,q]=(0,f.useState)(!1),r=(0,f.useCallback)(()=>{g("code"),null===h&&(q(!0),fetch(c).then(a=>a.json()).then(a=>i(a.content)).catch(()=>i("\x3c!-- Failed to load source --\x3e")).finally(()=>q(!1)))},[c,h]);return(0,e.jsxs)("div",{className:"flex flex-col h-full",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 px-5 py-3 border-b flex-shrink-0",style:{borderColor:"var(--color-border)"},children:[(0,e.jsx)(l,{}),(0,e.jsx)("span",{className:"text-sm font-medium truncate",style:{color:"var(--color-text)"},children:a}),(0,e.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full flex-shrink-0",style:{background:"#f9731618",color:"#f97316",border:"1px solid #f9731630"},children:"HTML"}),(0,e.jsxs)("div",{className:"flex items-center ml-auto rounded-lg p-0.5",style:{background:"var(--color-surface-hover)"},children:[(0,e.jsxs)("button",{type:"button",onClick:()=>g("rendered"),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors duration-100 cursor-pointer",style:{background:"rendered"===d?"var(--color-surface)":"transparent",color:"rendered"===d?"var(--color-text)":"var(--color-text-muted)",boxShadow:"rendered"===d?"0 1px 2px rgba(0,0,0,0.1)":"none"},children:[(0,e.jsx)(m,{}),"Preview"]}),(0,e.jsxs)("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors duration-100 cursor-pointer",style:{background:"code"===d?"var(--color-surface)":"transparent",color:"code"===d?"var(--color-text)":"var(--color-text-muted)",boxShadow:"code"===d?"0 1px 2px rgba(0,0,0,0.1)":"none"},children:[(0,e.jsx)(n,{}),"Code"]})]}),(0,e.jsx)("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-md transition-colors duration-100",style:{color:"var(--color-text-muted)"},title:"Open in new tab",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,e.jsx)(o,{})})]}),"rendered"===d?(0,e.jsx)(j,{rawUrl:b}):p||null===h?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsx)("div",{className:"w-6 h-6 border-2 rounded-full animate-spin",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}):(0,e.jsx)(k,{content:h})]})}function j({rawUrl:a}){return(0,e.jsx)("div",{className:"flex-1 overflow-hidden",style:{background:"white"},children:(0,e.jsx)("iframe",{src:a,className:"w-full h-full border-0",sandbox:"allow-same-origin allow-scripts allow-popups",title:"HTML preview",style:{minHeight:"calc(100vh - 120px)"}})})}function k({content:a}){let[b,c]=(0,f.useState)(null),d=(0,f.useMemo)(()=>a.split("\n").length,[a]);return(0,e.jsx)("div",{className:"flex-1 overflow-auto",style:{background:"var(--color-surface)"},children:(0,e.jsxs)("div",{className:"max-w-4xl mx-auto px-6 py-8",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2.5 rounded-t-lg border border-b-0",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:[(0,e.jsx)(n,{}),(0,e.jsx)("span",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:"HTML"}),(0,e.jsxs)("span",{className:"text-xs ml-auto",style:{color:"var(--color-text-muted)"},children:[d," lines"]})]}),(0,e.jsx)("div",{className:"code-viewer-content rounded-b-lg border overflow-x-auto",style:{background:"var(--color-bg)",borderColor:"var(--color-border)"},children:b?(0,e.jsx)("div",{className:"code-viewer-highlighted",dangerouslySetInnerHTML:{__html:b}}):(0,e.jsx)("pre",{className:"text-sm leading-6",style:{margin:0},children:(0,e.jsx)("code",{children:a.split("\n").map((a,b)=>(0,e.jsxs)("div",{className:"flex hover:bg-[var(--color-surface-hover)] transition-colors duration-75",children:[(0,e.jsx)("span",{className:"select-none text-right pr-4 pl-4 flex-shrink-0 tabular-nums",style:{color:"var(--color-text-muted)",opacity:.5,minWidth:"3rem",userSelect:"none"},children:b+1}),(0,e.jsx)("span",{className:"pr-4 flex-1",style:{color:"var(--color-text)"},children:a||" "})]},b))})})})]})})}function l(){return(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#f97316",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,e.jsx)("polyline",{points:"8 6 2 12 8 18"}),(0,e.jsx)("line",{x1:"12",x2:"10",y1:"2",y2:"22"})]})}function m(){return(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}function n(){return(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,e.jsx)("polyline",{points:"8 6 2 12 8 18"})]})}function o(){return(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("path",{d:"M15 3h6v6"}),(0,e.jsx)("path",{d:"M10 14 21 3"}),(0,e.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}d()}catch(a){d(a)}})},236705:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],f=(0,d.A)("shield-check",e)},236747:(a,b,c)=>{"use strict";c.d(b,{Ch:()=>X});var d=c(736927),e=c(115962);function f(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function g(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function h(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?g(Object(c),!0).forEach(function(b){var d;d=c[b],b in a?Object.defineProperty(a,b,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[b]=d}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):g(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}function i(a){return function b(){for(var c=this,d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return e.length>=a.length?a.apply(this,e):function(){for(var a=arguments.length,d=Array(a),f=0;f<a;f++)d[f]=arguments[f];return b.apply(c,[].concat(e,d))}}}function j(a){return({}).toString.call(a).includes("Object")}function k(a){return"function"==typeof a}var l=i(function(a,b){throw Error(a[b]||a.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),m={changes:function(a,b){return j(b)||l("changeType"),Object.keys(b).some(function(b){return!Object.prototype.hasOwnProperty.call(a,b)})&&l("changeField"),b},selector:function(a){k(a)||l("selectorType")},handler:function(a){k(a)||j(a)||l("handlerType"),j(a)&&Object.values(a).some(function(a){return!k(a)})&&l("handlersType")},initial:function(a){a||l("initialIsRequired"),j(a)||l("initialType"),Object.keys(a).length||l("initialContent")}};function n(a,b){return k(b)?b(a.current):b}function o(a,b){return a.current=h(h({},a.current),b),b}function p(a,b,c){return k(b)?b(a.current):Object.keys(c).forEach(function(c){var d;return null==(d=b[c])?void 0:d.call(b,a.current[c])}),c}var q={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},r=(function(a){return function b(){for(var c=this,d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return e.length>=a.length?a.apply(this,e):function(){for(var a=arguments.length,d=Array(a),f=0;f<a;f++)d[f]=arguments[f];return b.apply(c,[].concat(e,d))}}})(function(a,b){throw Error(a[b]||a.default)})(q),s=function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return function(a){return b.reduceRight(function(a,b){return b(a)},a)}},t={type:"cancelation",msg:"operation is manually canceled"};function u(a){var b=!1,c=new Promise(function(c,d){a.then(function(a){return b?d(t):c(a)}),a.catch(d)});return c.cancel=function(){return b=!0},c}var v=function(a,b){return function(a){if(Array.isArray(a))return a}(a)||function(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=c){var d,e,f,g,h=[],i=!0,j=!1;try{f=(c=c.call(a)).next,!1;for(;!(i=(d=f.call(c)).done)&&(h.push(d.value),h.length!==b);i=!0);}catch(a){j=!0,e=a}finally{try{if(!i&&null!=c.return&&(g=c.return(),Object(g)!==g))return}finally{if(j)throw e}}return h}}(a,2)||function(a,b){if(a){if("string"==typeof a)return f(a,b);var c=({}).toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?f(a,b):void 0}}(a,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(({create:function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m.initial(a),m.handler(b);var c={current:a},d=i(p)(c,b),e=i(o)(c),f=i(m.changes)(a),g=i(n)(c);return[function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(a){return a};return m.selector(a),a(c.current)},function(a){(function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return function(a){return b.reduceRight(function(a,b){return b(a)},a)}})(d,e,f,g)(a)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),2),w=v[0],x=v[1];function y(a){return document.body.appendChild(a)}function z(a){var b,c,d=w(function(a){return{config:a.config,reject:a.reject}}),e=(b="".concat(d.config.paths.vs,"/loader.js"),c=document.createElement("script"),b&&(c.src=b),c);return e.onload=function(){return a()},e.onerror=d.reject,e}function A(){var a=w(function(a){return{config:a.config,resolve:a.resolve,reject:a.reject}}),b=window.require;b.config(a.config),b(["vs/editor/editor.main"],function(b){var c=b.m||b;B(c),a.resolve(c)},function(b){a.reject(b)})}function B(a){w().monaco||x({monaco:a})}var C=new Promise(function(a,b){return x({resolve:a,reject:b})}),D={init:function(){var a=w(function(a){return{monaco:a.monaco,isInitialized:a.isInitialized,resolve:a.resolve}});if(!a.isInitialized){if(x({isInitialized:!0}),a.monaco)return a.resolve(a.monaco),u(C);if(window.monaco&&window.monaco.editor)return B(window.monaco),a.resolve(window.monaco),u(C);s(y,z)(A)}return u(C)}},E={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},F={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},G=function({children:a}){return e.createElement("div",{style:F.container},a)},H=(0,e.memo)(function({width:a,height:b,isEditorReady:c,loading:d,_ref:f,className:g,wrapperProps:h}){return e.createElement("section",{style:{...E.wrapper,width:a,height:b},...h},!c&&e.createElement(G,null,d),e.createElement("div",{ref:f,style:{...E.fullWidth,...!c&&E.hide},className:g}))}),I=function(a){(0,e.useEffect)(a,[])},J=function(a,b,c=!0){let d=(0,e.useRef)(!0);(0,e.useEffect)(d.current||!c?()=>{d.current=!1}:a,b)};function K(){}function L(a,b,c,d){var e,f,g,h,i,j;return e=a,f=d,e.editor.getModel(M(e,f))||(g=a,h=b,i=c,j=d,g.editor.createModel(h,i,j?M(g,j):void 0))}function M(a,b){return a.Uri.parse(b)}(0,e.memo)(function({original:a,modified:b,language:c,originalLanguage:d,modifiedLanguage:f,originalModelPath:g,modifiedModelPath:h,keepCurrentOriginalModel:i=!1,keepCurrentModifiedModel:j=!1,theme:k="light",loading:l="Loading...",options:m={},height:n="100%",width:o="100%",className:p,wrapperProps:q={},beforeMount:r=K,onMount:s=K}){let[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!0),x=(0,e.useRef)(null),y=(0,e.useRef)(null),z=(0,e.useRef)(null),A=(0,e.useRef)(s),B=(0,e.useRef)(r),C=(0,e.useRef)(!1);I(()=>{let a=D.init();return a.then(a=>(y.current=a)&&w(!1)).catch(a=>a?.type!=="cancelation"&&console.error("Monaco initialization: error:",a)),()=>{let b;return x.current?(b=x.current?.getModel(),void(i||b?.original?.dispose(),j||b?.modified?.dispose(),x.current?.dispose())):a.cancel()}}),J(()=>{if(x.current&&y.current){let b=x.current.getOriginalEditor(),e=L(y.current,a||"",d||c||"text",g||"");e!==b.getModel()&&b.setModel(e)}},[g],t),J(()=>{if(x.current&&y.current){let a=x.current.getModifiedEditor(),d=L(y.current,b||"",f||c||"text",h||"");d!==a.getModel()&&a.setModel(d)}},[h],t),J(()=>{let a=x.current.getModifiedEditor();a.getOption(y.current.editor.EditorOption.readOnly)?a.setValue(b||""):b!==a.getValue()&&(a.executeEdits("",[{range:a.getModel().getFullModelRange(),text:b||"",forceMoveMarkers:!0}]),a.pushUndoStop())},[b],t),J(()=>{x.current?.getModel()?.original.setValue(a||"")},[a],t),J(()=>{let{original:a,modified:b}=x.current.getModel();y.current.editor.setModelLanguage(a,d||c||"text"),y.current.editor.setModelLanguage(b,f||c||"text")},[c,d,f],t),J(()=>{y.current?.editor.setTheme(k)},[k],t),J(()=>{x.current?.updateOptions(m)},[m],t);let E=(0,e.useCallback)(()=>{if(!y.current)return;B.current(y.current);let e=L(y.current,a||"",d||c||"text",g||""),i=L(y.current,b||"",f||c||"text",h||"");x.current?.setModel({original:e,modified:i})},[c,b,f,a,d,g,h]),F=(0,e.useCallback)(()=>{!C.current&&z.current&&(x.current=y.current.editor.createDiffEditor(z.current,{automaticLayout:!0,...m}),E(),y.current?.editor.setTheme(k),u(!0),C.current=!0)},[m,k,E]);return(0,e.useEffect)(()=>{t&&A.current(x.current,y.current)},[t]),(0,e.useEffect)(()=>{v||t||F()},[v,t,F]),e.createElement(H,{width:o,height:n,isEditorReady:t,loading:l,_ref:z,className:p,wrapperProps:q})});var N=function(a){let b=(0,e.useRef)();return(0,e.useEffect)(()=>{b.current=a},[a]),b.current},O=new Map,P=(0,e.memo)(function({defaultValue:a,defaultLanguage:b,defaultPath:c,value:d,language:f,path:g,theme:h="light",line:i,loading:j="Loading...",options:k={},overrideServices:l={},saveViewState:m=!0,keepCurrentModel:n=!1,width:o="100%",height:p="100%",className:q,wrapperProps:r={},beforeMount:s=K,onMount:t=K,onChange:u,onValidate:v=K}){let[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!0),A=(0,e.useRef)(null),B=(0,e.useRef)(null),C=(0,e.useRef)(null),E=(0,e.useRef)(t),F=(0,e.useRef)(s),G=(0,e.useRef)(),M=(0,e.useRef)(d),P=N(g),Q=(0,e.useRef)(!1),R=(0,e.useRef)(!1);I(()=>{let a=D.init();return a.then(a=>(A.current=a)&&z(!1)).catch(a=>a?.type!=="cancelation"&&console.error("Monaco initialization: error:",a)),()=>B.current?void(G.current?.dispose(),n?m&&O.set(g,B.current.saveViewState()):B.current.getModel()?.dispose(),B.current.dispose()):a.cancel()}),J(()=>{let e=L(A.current,a||d||"",b||f||"",g||c||"");e!==B.current?.getModel()&&(m&&O.set(P,B.current?.saveViewState()),B.current?.setModel(e),m&&B.current?.restoreViewState(O.get(g)))},[g],w),J(()=>{B.current?.updateOptions(k)},[k],w),J(()=>{B.current&&void 0!==d&&(B.current.getOption(A.current.editor.EditorOption.readOnly)?B.current.setValue(d):d!==B.current.getValue()&&(R.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:d,forceMoveMarkers:!0}]),B.current.pushUndoStop(),R.current=!1))},[d],w),J(()=>{let a=B.current?.getModel();a&&f&&A.current?.editor.setModelLanguage(a,f)},[f],w),J(()=>{void 0!==i&&B.current?.revealLine(i)},[i],w),J(()=>{A.current?.editor.setTheme(h)},[h],w);let S=(0,e.useCallback)(()=>{if(!(!C.current||!A.current)&&!Q.current){F.current(A.current);let e=g||c,j=L(A.current,d||a||"",b||f||"",e||"");B.current=A.current?.editor.create(C.current,{model:j,automaticLayout:!0,...k},l),m&&B.current.restoreViewState(O.get(e)),A.current.editor.setTheme(h),void 0!==i&&B.current.revealLine(i),x(!0),Q.current=!0}},[a,b,c,d,f,g,k,l,m,h,i]);return(0,e.useEffect)(()=>{w&&E.current(B.current,A.current)},[w]),(0,e.useEffect)(()=>{y||w||S()},[y,w,S]),M.current=d,(0,e.useEffect)(()=>{w&&u&&(G.current?.dispose(),G.current=B.current?.onDidChangeModelContent(a=>{R.current||u(B.current.getValue(),a)}))},[w,u]),(0,e.useEffect)(()=>{if(w){let a=A.current.editor.onDidChangeMarkers(a=>{let b=B.current.getModel()?.uri;if(b&&a.find(a=>a.path===b.path)){let a=A.current.editor.getModelMarkers({resource:b});v?.(a)}});return()=>{a?.dispose()}}return()=>{}},[w,v]),e.createElement(H,{width:o,height:p,isEditorReady:w,loading:j,_ref:C,className:q,wrapperProps:r})}),Q=c(59448),R=c(29119);let S={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",css:"css",scss:"scss",less:"less",html:"html",htm:"html",xml:"xml",svg:"xml",json:"json",jsonc:"json",yaml:"yaml",yml:"yaml",toml:"plaintext",md:"markdown",mdx:"markdown",sh:"shell",bash:"shell",zsh:"shell",fish:"shell",ps1:"powershell",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",docker:"dockerfile",makefile:"plaintext",cmake:"plaintext",r:"r",lua:"lua",php:"php",vue:"html",svelte:"html",diff:"plaintext",patch:"plaintext",ini:"ini",env:"ini",tf:"plaintext",proto:"protobuf",zig:"plaintext",elixir:"plaintext",ex:"plaintext",erl:"plaintext",hs:"plaintext",scala:"scala",clj:"clojure",dart:"dart"};function T(a){let b=a.toLowerCase();return"dockerfile"===b||b.startsWith("dockerfile.")?"dockerfile":"makefile"===b||"gnumakefile"===b?"makefile":"cmakelists.txt"===b?"cmake":b.split(".").pop()??""}function U(a){return S[T(a)]??"plaintext"}let V=!1;function W(){return"undefined"!=typeof document&&document.documentElement.classList.contains("dark")}function X({content:a,filename:b,filePath:c,className:e,onDirty:f}){let g=T(b);return"diff"===g||"patch"===g?(0,d.jsx)("div",{className:"max-w-4xl mx-auto px-6 py-8",children:(0,d.jsx)(Q.a,{diff:a})}):(0,d.jsx)(Y,{content:a,filename:b,filePath:c,className:e,onDirty:f})}function Y({content:a,filename:b,filePath:c,className:f,onDirty:g}){let h=(0,e.useRef)(null),i=(0,e.useRef)(null),[j,k]=(0,e.useState)(W()?"denchclaw-dark":"denchclaw-light"),[l,m]=(0,e.useState)("clean"),[n,o]=(0,e.useState)({line:1,col:1}),p=(0,e.useRef)(null),q=(0,e.useRef)(a),r=U(b),s=!!c,t=(0,e.useCallback)(async()=>{if(!c||!h.current)return;let a=h.current.getValue();m("saving");try{if(!(await fetch((0,R.nC)(c),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:c,content:a})})).ok)throw Error("Save failed");q.current=a,m("saved"),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>m("clean"),2e3)}catch{m("error"),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>m("dirty"),3e3)}},[c]),u=(0,e.useCallback)((a,b)=>{h.current=a,i.current=b,V||(V=!0,b.editor.defineTheme("denchclaw-light",{base:"vs",inherit:!0,rules:[],colors:{"editor.background":"#ffffff","editor.foreground":"#1c1c1a","editor.lineHighlightBackground":"#f5f4f1","editor.selectionBackground":"#2563eb20","editor.inactiveSelectionBackground":"#2563eb10","editorLineNumber.foreground":"#8a8a82","editorLineNumber.activeForeground":"#44443e","editorIndentGuide.background":"#00000010","editorIndentGuide.activeBackground":"#00000020","editor.selectionHighlightBackground":"#2563eb12","editorCursor.foreground":"#2563eb","editorWhitespace.foreground":"#00000010","editorBracketMatch.background":"#2563eb15","editorBracketMatch.border":"#2563eb40","editorGutter.background":"#ffffff","editorWidget.background":"#ffffff","editorWidget.border":"#00000014","editorSuggestWidget.background":"#ffffff","editorSuggestWidget.border":"#00000014","editorSuggestWidget.selectedBackground":"#f5f4f1","editorHoverWidget.background":"#ffffff","editorHoverWidget.border":"#00000014","input.background":"#f5f5f4","input.border":"#00000014","input.foreground":"#1c1c1a","minimap.background":"#ffffff","scrollbarSlider.background":"#00000012","scrollbarSlider.hoverBackground":"#00000020","scrollbarSlider.activeBackground":"#0000002a"}}),b.editor.defineTheme("denchclaw-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{"editor.background":"#0c0c0b","editor.foreground":"#ececea","editor.lineHighlightBackground":"#1e1e1c","editor.selectionBackground":"#3b82f630","editor.inactiveSelectionBackground":"#3b82f618","editorLineNumber.foreground":"#78776f","editorLineNumber.activeForeground":"#b8b8b0","editorIndentGuide.background":"#ffffff08","editorIndentGuide.activeBackground":"#ffffff14","editor.selectionHighlightBackground":"#3b82f618","editorCursor.foreground":"#3b82f6","editorWhitespace.foreground":"#ffffff08","editorBracketMatch.background":"#3b82f620","editorBracketMatch.border":"#3b82f650","editorGutter.background":"#0c0c0b","editorWidget.background":"#161615","editorWidget.border":"#ffffff14","editorSuggestWidget.background":"#161615","editorSuggestWidget.border":"#ffffff14","editorSuggestWidget.selectedBackground":"#1e1e1c","editorHoverWidget.background":"#161615","editorHoverWidget.border":"#ffffff14","input.background":"#1e1e1c","input.border":"#ffffff14","input.foreground":"#ececea","minimap.background":"#0c0c0b","scrollbarSlider.background":"#ffffff12","scrollbarSlider.hoverBackground":"#ffffff20","scrollbarSlider.activeBackground":"#ffffff2a"}})),b.editor.setTheme(W()?"denchclaw-dark":"denchclaw-light"),a.addCommand(b.KeyMod.CtrlCmd|b.KeyCode.KeyS,()=>{t()}),a.onDidChangeCursorPosition(a=>{o({line:a.position.lineNumber,col:a.position.column})}),a.onDidChangeModelContent(()=>{a.getValue()!==q.current?(m("dirty"),g?.()):m("clean")}),a.focus()},[t,g]),v=function(a){let b=U(a);return"plaintext"===b?T(a)||"TEXT":b}(b),w=a.split("\n").length;return(0,d.jsxs)("div",{className:`flex flex-col h-full ${f??""}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 flex-shrink-0",style:{background:"var(--color-surface)",borderBottom:"1px solid var(--color-border)"},children:[(0,d.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--color-text-muted)",flexShrink:0},children:[(0,d.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,d.jsx)("polyline",{points:"8 6 2 12 8 18"})]}),(0,d.jsx)("span",{className:"text-sm font-medium truncate",style:{color:"var(--color-text)"},children:b}),"dirty"===l&&(0,d.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--color-text-muted)"},title:"Unsaved changes"}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("span",{className:"text-[11px] px-1.5 py-0.5 rounded font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:v.toUpperCase()}),(0,d.jsxs)("span",{className:"text-[11px] tabular-nums",style:{color:"var(--color-text-muted)"},children:[w," lines"]}),(0,d.jsxs)("span",{className:"text-[11px] tabular-nums",style:{color:"var(--color-text-muted)"},children:["Ln ",n.line,", Col ",n.col]}),s&&(0,d.jsxs)(d.Fragment,{children:["saving"===l&&(0,d.jsx)("span",{className:"text-[11px]",style:{color:"var(--color-text-muted)"},children:"Saving..."}),"saved"===l&&(0,d.jsx)("span",{className:"text-[11px]",style:{color:"var(--color-success)"},children:"Saved"}),"error"===l&&(0,d.jsx)("span",{className:"text-[11px]",style:{color:"var(--color-error)"},children:"Save failed"}),(0,d.jsx)("button",{type:"button",onClick:()=>void t(),disabled:"dirty"!==l,className:"text-[11px] px-2 py-0.5 rounded transition-colors",style:{background:"dirty"===l?"var(--color-accent)":"var(--color-surface-hover)",color:"dirty"===l?"#fff":"var(--color-text-muted)",cursor:"dirty"===l?"pointer":"default",opacity:"dirty"===l?1:.5},children:"Save"})]})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0",children:(0,d.jsx)(P,{defaultValue:a,language:r,theme:j,onMount:u,loading:(0,d.jsx)("div",{className:"flex items-center justify-center h-full",style:{background:"var(--color-bg)"},children:(0,d.jsx)("span",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"Loading editor..."})}),options:{readOnly:!s,fontSize:13,lineHeight:20,fontFamily:"'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Menlo, Monaco, 'Courier New', monospace",fontLigatures:!0,minimap:{enabled:!0,scale:1,showSlider:"mouseover"},scrollBeyondLastLine:!0,smoothScrolling:!0,cursorBlinking:"smooth",cursorSmoothCaretAnimation:"on",renderLineHighlight:"all",renderWhitespace:"selection",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0,highlightActiveIndentation:!0},stickyScroll:{enabled:!0},folding:!0,foldingHighlight:!0,showFoldingControls:"mouseover",links:!0,wordWrap:"off",padding:{top:8,bottom:8},scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10,verticalSliderSize:10,horizontalSliderSize:10},overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,automaticLayout:!0,tabSize:2,insertSpaces:!1,detectIndentation:!0,formatOnPaste:!1,formatOnType:!1,suggestOnTriggerCharacters:!0,quickSuggestions:!0,contextmenu:!0,mouseWheelZoom:!0,find:{addExtraSpaceOnTop:!1,autoFindInSelection:"multiline",seedSearchStringFromSelection:"selection"}}})})]})}},238182:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(261442),e=c(603182),f=c(505033);b.sortBy=function(a,...b){let c=b.length;return c>1&&f.isIterateeCall(a,b[0],b[1])?b=[]:c>2&&f.isIterateeCall(b[0],b[1],b[2])&&(b=[b[0]]),d.orderBy(a,e.flatten(b),["asc"])}},250367:(a,b,c)=>{"use strict";c.d(b,{A0:()=>h,Hj:()=>i,XI:()=>p,nA:()=>g});var d=c(720511),e=c(381802),f=c(63507),g=d.bP.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:a=>{var b,c;let d=a.getAttribute("colwidth"),e=d?d.split(",").map(a=>parseInt(a,10)):null;if(!e){let d=null==(b=a.closest("table"))?void 0:b.querySelectorAll("colgroup > col"),e=Array.from((null==(c=a.parentElement)?void 0:c.children)||[]).indexOf(a);if(e&&e>-1&&d&&d[e]){let a=d[e].getAttribute("width");return a?[parseInt(a,10)]:null}}return e}}}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML({HTMLAttributes:a}){return["td",(0,d.KV)(this.options.HTMLAttributes,a),0]}}),h=d.bP.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:a=>{let b=a.getAttribute("colwidth");return b?b.split(",").map(a=>parseInt(a,10)):null}}}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:a}){return["th",(0,d.KV)(this.options.HTMLAttributes,a),0]}}),i=d.bP.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:a}){return["tr",(0,d.KV)(this.options.HTMLAttributes,a),0]}});function j(a,b){return b?["width",`${Math.max(b,a)}px`]:["min-width",`${a}px`]}function k(a,b,c,d,e,f){var g;let h=0,i=!0,k=b.firstChild,l=a.firstChild;if(null!==l)for(let a=0,c=0;a<l.childCount;a+=1){let{colspan:g,colwidth:m}=l.child(a).attrs;for(let a=0;a<g;a+=1,c+=1){let g=e===c?f:m&&m[a],l=g?`${g}px`:"";if(h+=g||d,g||(i=!1),k){if(k.style.width!==l){let[a,b]=j(d,g);k.style.setProperty(a,b)}k=k.nextSibling}else{let a=document.createElement("col"),[c,e]=j(d,g);a.style.setProperty(c,e),b.appendChild(a)}}}for(;k;){let a=k.nextSibling;null==(g=k.parentNode)||g.removeChild(k),k=a}let m=a.attrs.style&&"string"==typeof a.attrs.style&&/\bwidth\s*:/i.test(a.attrs.style);i&&!m?(c.style.width=`${h}px`,c.style.minWidth=""):(c.style.width="",c.style.minWidth=`${h}px`)}var l=class{constructor(a,b){this.node=a,this.cellMinWidth=b,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),a.attrs.style&&(this.table.style.cssText=a.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),k(a,this.colgroup,this.table,b),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(a){return a.type===this.node.type&&(this.node=a,k(a,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(a){let b=a.target,c=this.dom.contains(b),d=this.contentDOM.contains(b);return!!c&&!d&&("attributes"===a.type||"childList"===a.type||"characterData"===a.type)}};function m(a,b){return b?a.createChecked(null,b):a.createAndFill()}var n=({editor:a})=>{let{selection:b}=a.state;if(!(b instanceof f.rn))return!1;let c=0,e=(0,d.eL)(b.ranges[0].$from,a=>"table"===a.type.name);return null==e||e.node.descendants(a=>{if("table"===a.type.name)return!1;["tableCell","tableHeader"].includes(a.type.name)&&(c+=1)}),c===b.ranges.length&&(a.commands.deleteTable(),!0)},o=function(a,b,c={}){var d;let e=null!=(d=c.cellLineSeparator)?d:"\x1f";if(!a||!a.content||0===a.content.length)return"";let f=[];a.content.forEach(a=>{let c=[];a.content&&a.content.forEach(a=>{let d=((a.content&&Array.isArray(a.content)&&a.content.length>1?a.content.map(a=>b.renderChildren(a)).join(e):a.content?b.renderChildren(a.content):"")||"").replace(/\s+/g," ").trim(),f="tableHeader"===a.type;c.push({text:d,isHeader:f})}),f.push(c)});let g=f.reduce((a,b)=>Math.max(a,b.length),0);if(0===g)return"";let h=Array(g).fill(0);f.forEach(a=>{var b;for(let c=0;c<g;c+=1){let d=((null==(b=a[c])?void 0:b.text)||"").length;d>h[c]&&(h[c]=d),h[c]<3&&(h[c]=3)}});let i=(a,b)=>a+" ".repeat(Math.max(0,b-a.length)),j=f[0],k=j.some(a=>a.isHeader),l="\n",m=Array(g).fill(0).map((a,b)=>k&&j[b]&&j[b].text||"");return l+=`| ${m.map((a,b)=>i(a,h[b])).join(" | ")} |
|
|
190
|
+
`))}}j={type:"taskItem",raw:"",mainContent:d,indentLevel:i,checked:null!=h&&h,text:d,tokens:this.lexer.inlineTokens(d),nestedTokens:e}}let k=g?"taskList":"list";f!==k?(e.length>0&&d.push({type:f,items:e}),e=[j],f=k):e.push(j)}e.length>0&&d.push({type:f,items:e});let g=[];for(let b=0;b<d.length;b+=1){let c=d[b],e={...a,type:c.type,items:c.items},f=this.parseToken(e);f&&(Array.isArray(f)?g.push(...f):g.push(f))}return g.length>0?g:null}parseTokenWithHandlers(a){if(!a.type)return null;let b=this.getHandlersForToken(a.type),c=this.createParseHelpers();if(b.find(b=>{if(!b.parseMarkdown)return!1;let d=b.parseMarkdown(a,c),e=this.normalizeParseResult(d);return!(!e||Array.isArray(e)&&!(e.length>0))&&(this.lastParseResult=e,!0)})&&this.lastParseResult){let a=this.lastParseResult;return this.lastParseResult=null,a}return this.parseFallbackToken(a)}createParseHelpers(){return{parseInline:a=>this.parseInlineTokens(a),parseChildren:a=>this.parseTokens(a),createTextNode:(a,b)=>({type:"text",text:a,marks:b||void 0}),createNode:(a,b,c)=>{let d={type:a,attrs:b||void 0,content:c||void 0};return b&&0!==Object.keys(b).length||delete d.attrs,d},applyMark:(a,b,c)=>({mark:a,content:b,attrs:c&&Object.keys(c).length>0?c:void 0})}}escapeRegex(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(a){var b,c,d,e;let f=[];for(let g=0;g<a.length;g+=1){let h=a[g];if("text"===h.type)f.push({type:"text",text:h.text||""});else if("html"===h.type){let i=(null!=(c=null!=(b=h.raw)?b:h.text)?c:"").toString(),j=/^<\/[\s]*[\w-]+/i.test(i),k=i.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!j&&k&&!/\/>$/.test(i)){let b=k[1],c=this.escapeRegex(b),h=RegExp(`^<\\/\\s*${c}\\b`,"i"),j=-1,l=[i];for(let b=g+1;b<a.length;b+=1){let c=a[b],f=(null!=(e=null!=(d=c.raw)?d:c.text)?e:"").toString();if(l.push(f),"html"===c.type&&h.test(f)){j=b;break}}if(-1!==j){let a=l.join(""),b={type:"html",raw:a,text:a,block:!1},c=this.parseHTMLToken(b);if(c){let a=this.normalizeParseResult(c);Array.isArray(a)?f.push(...a):a&&f.push(a)}g=j;continue}}let l=this.parseHTMLToken(h);if(l){let a=this.normalizeParseResult(l);Array.isArray(a)?f.push(...a):a&&f.push(a)}}else if(h.type){let a=this.getHandlerForToken(h.type);if(a&&a.parseMarkdown){let b=this.createParseHelpers(),c=a.parseMarkdown(h,b);if(this.isMarkResult(c)){let a=this.applyMarkToContent(c.mark,c.content,c.attrs);f.push(...a)}else{let a=this.normalizeParseResult(c);Array.isArray(a)?f.push(...a):a&&f.push(a)}}else h.tokens&&f.push(...this.parseInlineTokens(h.tokens))}}return f}applyMarkToContent(a,b,c){return b.map(b=>{if("text"===b.type){let d=b.marks||[],e=c?{type:a,attrs:c}:{type:a};return{...b,marks:[...d,e]}}return{...b,content:b.content?this.applyMarkToContent(a,b.content,c):void 0}})}isMarkResult(a){return a&&"object"==typeof a&&"mark"in a}normalizeParseResult(a){return a?this.isMarkResult(a)?a.content:a:null}parseFallbackToken(a){switch(a.type){case"paragraph":return{type:"paragraph",content:a.tokens?this.parseInlineTokens(a.tokens):[]};case"heading":return{type:"heading",attrs:{level:a.depth||1},content:a.tokens?this.parseInlineTokens(a.tokens):[]};case"text":return{type:"text",text:a.text||""};case"html":return this.parseHTMLToken(a);case"space":return null;default:if(a.tokens)return this.parseTokens(a.tokens);return null}}parseHTMLToken(a){let b=a.text||a.raw||"";if(!b.trim())return null;if("undefined"==typeof window)return a.block?{type:"paragraph",content:[{type:"text",text:b}]}:{type:"text",text:b};try{let c=(0,h.yQ)(b,this.baseExtensions);if("doc"===c.type&&c.content){if(a.block)return c.content;if(1===c.content.length&&"paragraph"===c.content[0].type&&c.content[0].content)return c.content[0].content;return c.content}return c}catch(a){throw Error(`Failed to parse HTML in markdown: ${a}`)}}renderNodeToMarkdown(a,b,c=0,d=0){var e;if("text"===a.type)return a.text||"";if(!a.type)return"";let f=this.getHandlerForToken(a.type);if(!f)return"";let g={index:c,level:d,parentType:null==b?void 0:b.type,meta:{parentAttrs:null==b?void 0:b.attrs}};return(null==(e=f.renderMarkdown)?void 0:e.call(f,a,{renderChildren:(b,e)=>{let g=f.isIndenting?d+1:d;return!Array.isArray(b)&&b.content?this.renderNodes(b.content,a,e||"",c,g):this.renderNodes(b,a,e||"",c,g)},indent:a=>this.indentString+a,wrapInBlock:aA},g))||""}renderNodes(a,b,c="",d=0,e=0){return Array.isArray(a)?this.renderNodesWithMarkBoundaries(a,b,c,e):a.type?this.renderNodeToMarkdown(a,b,d,e):""}renderNodesWithMarkBoundaries(a,b,c="",d=0){let e=[],f=new Map;return a.forEach((c,g)=>{let h=g<a.length-1?a[g+1]:null;if(c.type)if("text"===c.type){let a=c.text||"",b=new Map((c.marks||[]).map(a=>[a.type,a])),d=function(a,b){let c=[];return Array.from(b.entries()).forEach(([b,d])=>{a.has(b)||c.push({type:b,mark:d})}),c}(f,b),g=function(a,b){let c=[];return Array.from(a.keys()).forEach(a=>{b&&b.marks&&b.marks.map(a=>a.type).includes(a)||c.push(a)}),c}(b,h),i="";if(g.length>0){let b=a.match(/(\s+)$/);b&&(i=b[1],a=a.slice(0,-i.length))}g.forEach(c=>{let d=b.get(c),e=this.getMarkClosing(c,d);e&&(a+=e),f.has(c)&&f.delete(c)});let j="";if(d.length>0){let b=a.match(/^(\s+)/);b&&(j=b[1],a=a.slice(j.length))}d.forEach(({type:b,mark:c})=>{let d=this.getMarkOpening(b,c);d&&(a=d+a),g.includes(b)||f.set(b,c)}),a=j+a;let k=function(a,b,c,d){let e=!c,f=c&&"text"===c.type&&(!c.marks||0===c.marks.length),g=c&&"text"===c.type&&c.marks&&!d(b,new Map(c.marks.map(a=>[a.type,a]))),h=[];if(e||f||g)if(c&&"text"===c.type&&c.marks){let b=new Map(c.marks.map(a=>[a.type,a]));Array.from(a.keys()).forEach(a=>{b.has(a)||h.push(a)})}else(e||f)&&h.push(...Array.from(a.keys()));return h}(f,b,h,this.markSetsEqual.bind(this)),l="";if(k.length>0){let b=a.match(/(\s+)$/);b&&(l=b[1],a=a.slice(0,-l.length))}k.forEach(b=>{let c=f.get(b),d=this.getMarkClosing(b,c);d&&(a+=d),f.delete(b)}),a+=l,a+=i,e.push(a)}else{var i,j;let a,h,k=new Map(f),l=(i=this.getMarkClosing.bind(this),a="",Array.from(f.keys()).reverse().forEach(b=>{let c=f.get(b),d=i(b,c);d&&(a=d+a)}),f.clear(),a),m=this.renderNodeToMarkdown(c,b,g,d),n="hardBreak"===c.type?"":(j=this.getMarkOpening.bind(this),h="",Array.from(k.entries()).forEach(([a,b])=>{let c=j(a,b);c&&(h+=c),f.set(a,b)}),h);e.push(l+m+n)}}),e.join(c)}getMarkOpening(a,b){let c=this.getHandlersForNodeType(a),d=c.length>0?c[0]:void 0;if(!d||!d.renderMarkdown)return"";let e="__TIPTAP_MARKDOWN_PLACEHOLDER__",f={type:a,attrs:b.attrs||{},content:[{type:"text",text:e}]};try{let a=d.renderMarkdown(f,{renderChildren:()=>e,indent:a=>a,wrapInBlock:(a,b)=>a+b},{index:0,level:0,parentType:"text",meta:{}}),b=a.indexOf(e);return b>=0?a.substring(0,b):""}catch(b){throw Error(`Failed to get mark opening for ${a}: ${b}`)}}getMarkClosing(a,b){let c=this.getHandlersForNodeType(a),d=c.length>0?c[0]:void 0;if(!d||!d.renderMarkdown)return"";let e="__TIPTAP_MARKDOWN_PLACEHOLDER__",f={type:a,attrs:b.attrs||{},content:[{type:"text",text:e}]};try{let a=d.renderMarkdown(f,{renderChildren:()=>e,indent:a=>a,wrapInBlock:(a,b)=>a+b},{index:0,level:0,parentType:"text",meta:{}}),b=a.indexOf(e),c=b+e.length;return b>=0?a.substring(c):""}catch(b){throw Error(`Failed to get mark closing for ${a}: ${b}`)}}markSetsEqual(a,b){return a.size===b.size&&Array.from(a.keys()).every(a=>b.has(a))}},aE=h.YY.create({name:"markdown",addOptions:()=>({indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}),addCommands(){return{setContent:(a,b)=>{if(!(null==b?void 0:b.contentType)||"markdown"!==aC(a,null==b?void 0:b.contentType)||!this.editor.markdown)return h.Pi.setContent(a,b);let c=this.editor.markdown.parse(a);return h.Pi.setContent(c,b)},insertContent:(a,b)=>{if(!(null==b?void 0:b.contentType)||"markdown"!==aC(a,null==b?void 0:b.contentType)||!this.editor.markdown)return h.Pi.insertContent(a,b);let c=this.editor.markdown.parse(a);return h.Pi.insertContent(c,b)},insertContentAt:(a,b,c)=>{if(!(null==c?void 0:c.contentType)||"markdown"!==aC(b,null==c?void 0:c.contentType)||!this.editor.markdown)return h.Pi.insertContentAt(a,b,c);let d=this.editor.markdown.parse(b);return h.Pi.insertContentAt(a,d,c)}}},addStorage(){return{manager:new aD({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){if(this.editor.markdown)return void console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");if(this.storage.manager=new aD({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||"markdown"!==aC(this.editor.options.content,this.editor.options.contentType))return;if(!this.editor.markdown)throw Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(void 0===this.editor.options.content||"string"!=typeof this.editor.options.content)throw Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');let a=this.editor.markdown.parse(this.editor.options.content);this.editor.options.content=a}}),aF=c(422703),aG=c(585004),aH=c(250367),aI=c(565254),aJ=c(418398),aK=c(197143),aL=c(685343),aM=c(565744),aN=c(673977),aO=c(115962);let aP=(0,c(858404).default)(async()=>{},{loadableGenerated:{modules:["app/components/workspace/report-block-node.tsx -> ../../components/charts/report-card"]},ssr:!1,loading:()=>(0,d.jsx)("div",{className:"h-48 rounded-xl animate-pulse",style:{background:"var(--color-surface)"}})});function aQ({node:a,updateAttributes:b,deleteNode:c,selected:f}){let g=a.attrs.config,[h,i]=(0,aO.useState)(!1),[j,k]=(0,aO.useState)(g),l=null,m=null;try{let a=JSON.parse(g);a?.panels&&Array.isArray(a.panels)?l=a:m="Invalid report config: missing panels array"}catch{m="Invalid JSON in report block"}let n=(0,aO.useCallback)(()=>{try{JSON.parse(j),b({config:j}),i(!1)}catch{}},[j,b]);return(0,d.jsxs)(e.VR,{className:"report-block-wrapper","data-selected":f||void 0,children:[(0,d.jsxs)("div",{className:"report-block-toolbar",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>{h?n():(k(g),i(!0))},className:"report-block-btn",title:h?"Apply & show chart":"Edit JSON source",children:[h?(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,d.jsx)("polyline",{points:"8 6 2 12 8 18"})]}),(0,d.jsx)("span",{children:h?"Apply":"Edit JSON"})]}),(0,d.jsx)("button",{type:"button",onClick:c,className:"report-block-btn report-block-btn-danger",title:"Remove report block",children:(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M3 6h18"}),(0,d.jsx)("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),(0,d.jsx)("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]})})]}),h?(0,d.jsxs)("div",{className:"report-block-source",children:[(0,d.jsx)("div",{className:"report-block-source-label",children:"report-json"}),(0,d.jsx)("textarea",{className:"report-block-textarea",value:j,onChange:a=>k(a.target.value),spellCheck:!1,rows:Math.min(20,j.split("\n").length+2)})]}):m?(0,d.jsxs)("div",{className:"report-block-error",children:[(0,d.jsx)("span",{children:m}),(0,d.jsx)("button",{type:"button",onClick:()=>{k(g),i(!0)},className:"report-block-btn",children:"Fix JSON"})]}):(0,d.jsx)(aP,{config:l})]})}let aR=h.bP.create({name:"reportBlock",group:"block",atom:!0,addAttributes:()=>({config:{default:"{}",parseHTML:a=>a.getAttribute("data-config")||"{}",renderHTML:a=>({"data-config":a.config})}}),parseHTML:()=>[{tag:'div[data-type="report-block"]'}],renderHTML:({HTMLAttributes:a})=>["div",(0,h.KV)(a,{"data-type":"report-block"})],addNodeView:()=>(0,e.gu)(aQ)});var aS=c(405545),aT=c(381802),aU=c(249855),aV=c(991530),aW=c(86839);let aX=new aT.hs("slashCommand"),aY=new aT.hs("fileMention"),aZ=a=>(0,d.jsxs)("span",{className:"slash-cmd-icon-text",children:["H",a]}),a$=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"8",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"8",x2:"21",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"8",x2:"21",y1:"18",y2:"18"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"18",y2:"18"})]}),a_=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"10",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"10",x2:"21",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"10",x2:"21",y1:"18",y2:"18"}),(0,d.jsx)("path",{d:"M4 6h1v4"}),(0,d.jsx)("path",{d:"M4 10h2"}),(0,d.jsx)("path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"})]}),a0=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z"}),(0,d.jsx)("path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3z"})]}),a1=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,d.jsx)("polyline",{points:"8 6 2 12 8 18"})]}),a2=(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("line",{x1:"2",x2:"22",y1:"12",y2:"12"})}),a3=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,d.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,d.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]}),a4=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M12 3v18"}),(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M3 9h18"}),(0,d.jsx)("path",{d:"M3 15h18"})]}),a5=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{x:"3",y:"5",width:"6",height:"6",rx:"1"}),(0,d.jsx)("path",{d:"m3 17 2 2 4-4"}),(0,d.jsx)("line",{x1:"13",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"13",x2:"21",y1:"18",y2:"18"})]}),a6=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"12",x2:"12",y1:"20",y2:"10"}),(0,d.jsx)("line",{x1:"18",x2:"18",y1:"20",y2:"4"}),(0,d.jsx)("line",{x1:"6",x2:"6",y1:"20",y2:"14"})]}),a7=(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z"}),(0,d.jsx)("path",{d:"M15 3v4a2 2 0 0 0 2 2h4"}),(0,d.jsx)("path",{d:"M10 16h4"}),(0,d.jsx)("path",{d:"M10 12h4"})]});function a8(a){if("entry"===a.kind){let b=a.label||`(${a.objectName} entry)`,c=a.objectName?(0,aW.A3)(a.objectName):"";return{title:a.label||(a.objectName?`(${c} entry)`:b),description:a.fields?Object.entries(a.fields).slice(0,2).map(([a,b])=>`${a}: ${b}`).join(" | "):void 0,badge:c||a.objectName,icon:a7,category:"entry",command:({editor:c,range:d})=>{let e=(0,aV.VE)(a.objectName,a.entryId);c.chain().focus().deleteRange(d).insertContent({type:"text",text:b,marks:[{type:"link",attrs:{href:e,target:null}}]}).run()}}}let b=a.nodeType??("object"===a.kind?"object":"file"),c=a.label||a.path||a.id;return{title:"object"===a.kind?(0,aW.PV)(c):c,description:a.sublabel,icon:function(a){switch(a){case"document":default:return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),(0,d.jsx)("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})]});case"object":return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M12 3v18"}),(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M3 9h18"}),(0,d.jsx)("path",{d:"M3 15h18"})]});case"report":return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"12",x2:"12",y1:"20",y2:"10"}),(0,d.jsx)("line",{x1:"18",x2:"18",y1:"20",y2:"4"}),(0,d.jsx)("line",{x1:"6",x2:"6",y1:"20",y2:"14"})]})}}(b),category:"file",command:({editor:b,range:d})=>{let e=(0,aV.bJ)(a.path??a.id);b.chain().focus().deleteRange(d).insertContent({type:"text",text:c,marks:[{type:"link",attrs:{href:e,target:null}}]}).run()}}}let a9=(0,aO.forwardRef)(({items:a,command:b},c)=>{let[e,f]=(0,aO.useState)(0),g=(0,aO.useRef)(null);(0,aO.useEffect)(()=>{f(0)},[a]),(0,aO.useEffect)(()=>{let a=g.current?.children[e];a?.scrollIntoView({block:"nearest"})},[e]);let h=(0,aO.useCallback)(c=>{let d=a[c];d&&b(d)},[a,b]);return((0,aO.useImperativeHandle)(c,()=>({onKeyDown:({event:b})=>"ArrowUp"===b.key?(f(b=>(b+a.length-1)%a.length),!0):"ArrowDown"===b.key?(f(b=>(b+1)%a.length),!0):"Enter"===b.key&&(h(e),!0)})),0===a.length)?(0,d.jsx)("div",{className:"slash-cmd-popup",children:(0,d.jsx)("div",{className:"slash-cmd-empty",children:"No results"})}):(0,d.jsx)("div",{className:"slash-cmd-popup",ref:g,children:a.map((a,b)=>(0,d.jsxs)("button",{type:"button",className:`slash-cmd-item ${b===e?"slash-cmd-item-active":""}`,onClick:()=>h(b),onMouseEnter:()=>f(b),children:[(0,d.jsx)("span",{className:"slash-cmd-item-icon",children:a.icon}),(0,d.jsxs)("span",{className:"slash-cmd-item-body",children:[(0,d.jsxs)("span",{className:"slash-cmd-item-title",children:[a.title,a.badge&&(0,d.jsx)("span",{className:"slash-cmd-item-badge",children:a.badge})]}),a.description&&(0,d.jsx)("span",{className:"slash-cmd-item-desc",children:a.description})]})]},`${a.category}-${a.title}-${b}`))})});function ba({items:a,command:b,clientRect:c,componentRef:e}){let f=(0,aO.useRef)(null);return(0,aU.createPortal)((0,d.jsx)("div",{ref:f,children:(0,d.jsx)(a9,{ref:e,items:a,command:b})}),document.body)}function bb(){return()=>{let a=null,b=null,e={current:null};return{onStart:f=>{a=document.createElement("div"),document.body.appendChild(a),c.e(70684).then(c.t.bind(c,570684,19)).then(({createRoot:c})=>{(b=c(a)).render((0,d.jsx)(ba,{items:f.items,command:f.command,clientRect:f.clientRect,componentRef:e}))})},onUpdate:a=>{b?.render((0,d.jsx)(ba,{items:a.items,command:a.command,clientRect:a.clientRect,componentRef:e}))},onKeyDown:c=>"Escape"===c.event.key?(b?.unmount(),a?.remove(),a=null,b=null,!0):e.current?.onKeyDown(c)??!1,onExit:()=>{b?.unmount(),a?.remove(),a=null,b=null}}}}function bc(a){return h.YY.create({name:"fileMention",addOptions:()=>({suggestion:{char:"@",pluginKey:aY,startOfLine:!1,command:({editor:a,range:b,props:c})=>{c.command({editor:a,range:b})},items:({query:b})=>a(b,15).map(a8),render:bb()}}),addProseMirrorPlugins(){return[(0,aS.Ay)({editor:this.editor,...this.options.suggestion})]}})}a9.displayName="CommandList";var bd=c(119590),be=c(29119);function bf({content:a,rawContent:b,filePath:c,tree:i,onSave:j,onDirty:k,onNavigate:l,searchFn:m}){let[n,o]=(0,aO.useState)(!1),[p,q]=(0,aO.useState)("idle"),[r,s]=(0,aO.useState)(!1),t=(0,aO.useRef)(a),u=(0,aO.useRef)(null),v=(0,aO.useRef)(function(a){let b=a.match(/^(---\s*\n[\s\S]*?\n---\s*\n)/);return b?b[1]:""}(b??"")),w=(0,aO.useMemo)(()=>(function(){let a=[{title:"Heading 1",description:"Large section heading",icon:aZ(1),category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading",icon:aZ(2),category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading",icon:aZ(3),category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Unordered list",icon:a$,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).toggleBulletList().run()}},{title:"Numbered List",description:"Ordered list",icon:a_,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).toggleOrderedList().run()}},{title:"Task List",description:"Checklist with checkboxes",icon:a5,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).toggleTaskList().run()}},{title:"Blockquote",description:"Quote block",icon:a0,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).toggleBlockquote().run()}},{title:"Code Block",description:"Fenced code block",icon:a1,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).toggleCodeBlock().run()}},{title:"Horizontal Rule",description:"Divider line",icon:a2,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).setHorizontalRule().run()}},{title:"Image",description:"Insert image from URL",icon:a3,category:"block",command:({editor:a,range:b})=>{let c=window.prompt("Image URL:");c&&a.chain().focus().deleteRange(b).setImage({src:c}).run()}},{title:"Table",description:"Insert a 3x3 table",icon:a4,category:"block",command:({editor:a,range:b})=>{a.chain().focus().deleteRange(b).insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}},{title:"Report Chart",description:"Interactive report-json block",icon:a6,category:"block",command:({editor:a,range:b})=>{let c=JSON.stringify({version:1,title:"New Report",panels:[{id:"panel-1",title:"Chart",type:"bar",sql:"SELECT 1 as x, 10 as y",mapping:{xAxis:"x",yAxis:["y"]}}]},null,2);a.chain().focus().deleteRange(b).insertContent({type:"reportBlock",attrs:{config:c}}).run()}}];return h.YY.create({name:"slashCommand",addOptions:()=>({suggestion:{char:"/",pluginKey:aX,startOfLine:!1,command:({editor:a,range:b,props:c})=>{c.command({editor:a,range:b})},items:({query:b})=>{let c=b.toLowerCase();return c?a.filter(a=>a.title.toLowerCase().includes(c)||(a.description?.toLowerCase().includes(c)??!1)):a},render:bb()}}),addProseMirrorPlugins(){return[(0,aS.Ay)({editor:this.editor,...this.options.suggestion})]}})})(),[]),x=(0,aO.useMemo)(()=>m?bc(m):function(a){let b=(function a(b){let c=[];for(let d of b)"folder"!==d.type&&c.push(d),d.children&&c.push(...a(d.children));return c})(a).map(a=>({id:a.path,label:a.name.replace(/\.md$/,""),sublabel:a.path,kind:"object"===a.type?"object":"file",path:a.path,nodeType:a.type}));return bc((a,c=15)=>{if(!a)return b.slice(0,c);let d=a.toLowerCase();return b.filter(a=>a.label.toLowerCase().includes(d)||(a.sublabel?.toLowerCase().includes(d)??!1)).slice(0,c)})}(i),[m,i]),y=(0,e.hG)({extensions:[g.A.configure({codeBlock:{HTMLAttributes:{class:"code-block"}}}),aE.configure({markedOptions:{gfm:!0}}),aF.Ay.configure({inline:!1,allowBase64:!0,HTMLAttributes:{class:"editor-image"}}),aG.Ay.configure({openOnClick:!1,autolink:!0,HTMLAttributes:{class:"editor-link",rel:"noopener"}}),aH.XI.configure({resizable:!1}),aI.A,aJ.A,aK.h,aL.A,aM.A.configure({nested:!0}),aN.A.configure({placeholder:"Start writing, or type / for commands..."}),aR,w,x],content:a.replace(/```report-json\s*\n([\s\S]*?)```/g,(a,b)=>{let c=b.trim().replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">");return`<div data-type="report-block" data-config="${c}"></div>`}),contentType:"markdown",immediatelyRender:!1,onUpdate:()=>{s(!0),q("idle"),k?.()}}),z=(0,aO.useCallback)(async a=>{let b=new FormData;b.append("file",a);try{let a=await fetch("/api/workspace/upload",{method:"POST",body:b});if(!a.ok)return null;let c=await a.json();return`/api/workspace/assets/${c.path.replace(/^assets\//,"")}`}catch{return null}},[]),A=(0,aO.useCallback)(async a=>{if(y)for(let b of a){let a=await z(b);a&&y.chain().focus().setImage({src:a,alt:b.name}).run()}},[y,z]),B=(0,aO.useCallback)(async()=>{if(y&&!n){o(!0),q("idle");try{let b=("function"==typeof y.getMarkdown?y.getMarkdown():y.getHTML()).replace(/<div data-type="report-block" data-config="([^"]*)">\s*<\/div>/g,(a,b)=>"```report-json\n"+b.replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&")+"\n```"),d=v.current+b;(await fetch((0,be.nC)(c),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:c,content:d})})).ok?(q("saved"),s(!1),t.current=a,j?.(),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>q("idle"),2e3)):q("error")}catch{q("error")}finally{o(!1)}}},[y,c,n,j]);return y?(0,d.jsxs)("div",{className:"markdown-editor-container",children:[(0,d.jsxs)("div",{className:"editor-top-bar",children:[(0,d.jsxs)("div",{className:"editor-top-bar-left",children:[r&&(0,d.jsx)("span",{className:"editor-save-indicator editor-save-unsaved",children:"Unsaved changes"}),"saved"===p&&!r&&(0,d.jsx)("span",{className:"editor-save-indicator editor-save-saved",children:"Saved"}),"error"===p&&(0,d.jsx)("span",{className:"editor-save-indicator editor-save-error",children:"Save failed"})]}),(0,d.jsxs)("div",{className:"editor-top-bar-right",children:[(0,d.jsxs)("span",{className:"editor-save-hint",children:["undefined"!=typeof navigator&&navigator.platform?.includes("Mac")?"⌘":"Ctrl","+S"]}),(0,d.jsx)("button",{type:"button",onClick:()=>void B(),disabled:n||!r,className:"editor-save-button",children:n?"Saving...":"Save"})]})]}),(0,d.jsx)(bg,{editor:y,onUploadImages:A}),(0,d.jsx)(f.m,{editor:y,children:(0,d.jsxs)("div",{className:"bubble-menu",children:[(0,d.jsx)(bd.zM,{active:y.isActive("bold"),onClick:()=>y.chain().focus().toggleBold().run(),title:"Bold",children:(0,d.jsx)("strong",{children:"B"})}),(0,d.jsx)(bd.zM,{active:y.isActive("italic"),onClick:()=>y.chain().focus().toggleItalic().run(),title:"Italic",children:(0,d.jsx)("em",{children:"I"})}),(0,d.jsx)(bd.zM,{active:y.isActive("strike"),onClick:()=>y.chain().focus().toggleStrike().run(),title:"Strikethrough",children:(0,d.jsx)("s",{children:"S"})}),(0,d.jsx)(bd.zM,{active:y.isActive("code"),onClick:()=>y.chain().focus().toggleCode().run(),title:"Inline code",children:"<>"}),(0,d.jsx)(bd.zM,{active:y.isActive("link"),onClick:()=>{if(y.isActive("link"))y.chain().focus().unsetLink().run();else{let a=window.prompt("URL:");a&&y.chain().focus().setLink({href:a}).run()}},title:"Link",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),(0,d.jsx)("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})})]})}),(0,d.jsx)("div",{className:"editor-content-area workspace-prose",children:(0,d.jsx)(e.$Z,{editor:y})})]}):(0,d.jsxs)("div",{className:"animate-pulse space-y-3 py-4 px-6",children:[(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"80%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"60%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"70%"}})]})}function bg({editor:a,onUploadImages:b}){let c=(0,aO.useRef)(null);return a?(0,d.jsxs)("div",{className:"editor-toolbar",children:[(0,d.jsxs)(bd.$Q,{children:[(0,d.jsx)(bd.IB,{active:a.isActive("heading",{level:1}),onClick:()=>a.chain().focus().toggleHeading({level:1}).run(),title:"Heading 1",children:"H1"}),(0,d.jsx)(bd.IB,{active:a.isActive("heading",{level:2}),onClick:()=>a.chain().focus().toggleHeading({level:2}).run(),title:"Heading 2",children:"H2"}),(0,d.jsx)(bd.IB,{active:a.isActive("heading",{level:3}),onClick:()=>a.chain().focus().toggleHeading({level:3}).run(),title:"Heading 3",children:"H3"})]}),(0,d.jsx)(bd.x_,{}),(0,d.jsxs)(bd.$Q,{children:[(0,d.jsx)(bd.IB,{active:a.isActive("bold"),onClick:()=>a.chain().focus().toggleBold().run(),title:"Bold",children:(0,d.jsx)("strong",{children:"B"})}),(0,d.jsx)(bd.IB,{active:a.isActive("italic"),onClick:()=>a.chain().focus().toggleItalic().run(),title:"Italic",children:(0,d.jsx)("em",{children:"I"})}),(0,d.jsx)(bd.IB,{active:a.isActive("strike"),onClick:()=>a.chain().focus().toggleStrike().run(),title:"Strikethrough",children:(0,d.jsx)("s",{children:"S"})}),(0,d.jsx)(bd.IB,{active:a.isActive("code"),onClick:()=>a.chain().focus().toggleCode().run(),title:"Inline code",children:"<>"})]}),(0,d.jsx)(bd.x_,{}),(0,d.jsxs)(bd.$Q,{children:[(0,d.jsx)(bd.IB,{active:a.isActive("bulletList"),onClick:()=>a.chain().focus().toggleBulletList().run(),title:"Bullet list",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"8",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"8",x2:"21",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"8",x2:"21",y1:"18",y2:"18"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"3",x2:"3.01",y1:"18",y2:"18"})]})}),(0,d.jsx)(bd.IB,{active:a.isActive("orderedList"),onClick:()=>a.chain().focus().toggleOrderedList().run(),title:"Ordered list",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("line",{x1:"10",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"10",x2:"21",y1:"12",y2:"12"}),(0,d.jsx)("line",{x1:"10",x2:"21",y1:"18",y2:"18"}),(0,d.jsx)("path",{d:"M4 6h1v4"}),(0,d.jsx)("path",{d:"M4 10h2"}),(0,d.jsx)("path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"})]})}),(0,d.jsx)(bd.IB,{active:a.isActive("taskList"),onClick:()=>a.chain().focus().toggleTaskList().run(),title:"Task list",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{x:"3",y:"5",width:"6",height:"6",rx:"1"}),(0,d.jsx)("path",{d:"m3 17 2 2 4-4"}),(0,d.jsx)("line",{x1:"13",x2:"21",y1:"6",y2:"6"}),(0,d.jsx)("line",{x1:"13",x2:"21",y1:"18",y2:"18"})]})}),(0,d.jsx)(bd.IB,{active:a.isActive("blockquote"),onClick:()=>a.chain().focus().toggleBlockquote().run(),title:"Blockquote",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z"}),(0,d.jsx)("path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3z"})]})}),(0,d.jsx)(bd.IB,{active:a.isActive("codeBlock"),onClick:()=>a.chain().focus().toggleCodeBlock().run(),title:"Code block",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,d.jsx)("polyline",{points:"8 6 2 12 8 18"})]})})]}),(0,d.jsx)(bd.x_,{}),(0,d.jsxs)(bd.$Q,{children:[(0,d.jsx)(bd.IB,{active:!1,onClick:()=>{let b=window.prompt("Link URL:");b&&a.chain().focus().setLink({href:b}).run()},title:"Insert link",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),(0,d.jsx)("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),(0,d.jsx)(bd.IB,{active:!1,onClick:()=>{if(b)c.current?.click();else{let b=window.prompt("Image URL:");b&&a.chain().focus().setImage({src:b}).run()}},title:"Insert image (click to upload, or drag & drop)",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,d.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,d.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})}),(0,d.jsx)("input",{ref:c,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:a=>{let c=Array.from(a.target.files??[]);c.length>0&&b&&b(c),a.target.value=""}}),(0,d.jsx)(bd.IB,{active:!1,onClick:()=>{a.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()},title:"Insert table",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M12 3v18"}),(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M3 9h18"}),(0,d.jsx)("path",{d:"M3 15h18"})]})}),(0,d.jsx)(bd.IB,{active:!1,onClick:()=>{a.chain().focus().setHorizontalRule().run()},title:"Horizontal rule",children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("line",{x1:"2",x2:"22",y1:"12",y2:"12"})})})]})]}):null}},166328:(a,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.camelCase=void 0;var c=/^--[a-zA-Z0-9_-]+$/,d=/-([a-z])/g,e=/^[^-]+$/,f=/^-(webkit|moz|ms|o|khtml)-/,g=/^-(ms)-/,h=function(a,b){return b.toUpperCase()},i=function(a,b){return"".concat(b,"-")};b.camelCase=function(a,b){var j;return(void 0===b&&(b={}),!(j=a)||e.test(j)||c.test(j))?a:(a=a.toLowerCase(),(a=b.reactCompat?a.replace(g,i):a.replace(f,i)).replace(d,h))}},167609:(a,b,c)=>{"use strict";c.d(b,{z:()=>n});var d=c(736927),e=c(115962),f=c(858404),g=c(273700),h=c(551651),i=c(991530),j=c(59448);let k=(0,f.default)(async()=>{},{loadableGenerated:{modules:["app/components/workspace/document-view.tsx -> ./markdown-content"]},ssr:!1,loading:()=>(0,d.jsxs)("div",{className:"animate-pulse space-y-3 py-4",children:[(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"80%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"60%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"70%"}})]})}),l=(0,f.default)(async()=>{},{loadableGenerated:{modules:["app/components/workspace/document-view.tsx -> ../charts/report-card"]},ssr:!1,loading:()=>(0,d.jsx)("div",{className:"h-48 rounded-xl animate-pulse my-4",style:{background:"var(--color-surface)"}})}),m=(0,f.default)(async()=>{},{loadableGenerated:{modules:["app/components/workspace/document-view.tsx -> ./markdown-editor"]},ssr:!1,loading:()=>(0,d.jsxs)("div",{className:"animate-pulse space-y-3 py-4 px-6",children:[(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"80%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"60%"}}),(0,d.jsx)("div",{className:"h-4 rounded",style:{background:"var(--color-surface)",width:"70%"}})]})});function n({content:a,title:b,filePath:c,tree:f,onSave:j,onDirty:l,onNavigate:n,searchFn:p}){let[q,r]=(0,e.useState)(!!c),s=a.replace(/^---\s*\n[\s\S]*?\n---\s*\n/,""),t=s.match(/^#\s+(.+)/m),u=b??t?.[1],v=u&&t?s.replace(/^#\s+.+\n?/,""):s;if(q&&c)return(0,d.jsx)(m,{content:s,rawContent:a,filePath:c,tree:f??[],onSave:j,onDirty:l,onNavigate:n,searchFn:p});let w=(0,g.x)(v)||(0,h.k)(v),x=(0,e.useCallback)(a=>{let b=a.target.closest("a");if(!b)return;let c=b.getAttribute("href");if(c){if(c.startsWith("#")){a.preventDefault(),a.stopPropagation();let b=c.slice(1),d=a.currentTarget,e=Array.from(d.querySelectorAll("h1, h2, h3, h4, h5, h6")).find(a=>(a.textContent||"").trim().toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-")===b)??d.querySelector(`[id="${CSS.escape(b)}"]`);e?.scrollIntoView({behavior:"smooth",block:"start"});return}if(n){if((0,i.m9)(c)||!c.startsWith("http://")&&!c.startsWith("https://")&&!c.startsWith("mailto:")){a.preventDefault(),a.stopPropagation(),n(c);return}a.preventDefault(),a.stopPropagation(),window.open(c,"_blank","noopener,noreferrer")}}},[n]);return(0,d.jsxs)("div",{className:"px-6 py-8",onClick:x,children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[u&&(0,d.jsx)("h1",{className:"text-3xl font-bold mb-6 flex-1",style:{color:"var(--color-text)"},children:u}),c&&(0,d.jsxs)("button",{type:"button",onClick:()=>r(!0),className:"editor-mode-toggle flex-shrink-0 mt-1",title:"Edit this document",children:[(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}),(0,d.jsx)("path",{d:"m15 5 4 4"})]}),(0,d.jsx)("span",{children:"Edit"})]})]}),w?(0,d.jsx)(o,{content:v}):(0,d.jsx)("div",{className:"workspace-prose",children:(0,d.jsx)(k,{content:v})})]})}function o({content:a}){let b=(0,g.R)(a),c=[];for(let a of b)if("text"===a.type&&(0,h.k)(a.text))for(let b of(0,h.g)(a.text))c.push(b);else c.push(a);return(0,d.jsx)("div",{className:"space-y-4",children:c.map((a,b)=>"report-artifact"===a.type?(0,d.jsx)("div",{className:"my-6",children:(0,d.jsx)(l,{config:a.config})},b):"diff-artifact"===a.type?(0,d.jsx)("div",{className:"my-4",children:(0,d.jsx)(j.a,{diff:a.diff})},b):(0,d.jsx)("div",{className:"workspace-prose",children:(0,d.jsx)(k,{content:a.text})},b))})}},173092:(a,b,c)=>{"use strict";c.d(b,{i:()=>h});var d,e=c(115962),f=c(880696),g=(d||(d=c.t(e,2)))[" useInsertionEffect ".trim().toString()]||f.N;function h({prop:a,defaultProp:b,onChange:c=()=>{},caller:d}){let[f,h,i]=function({defaultProp:a,onChange:b}){let[c,d]=e.useState(a),f=e.useRef(c),h=e.useRef(b);return g(()=>{h.current=b},[b]),e.useEffect(()=>{f.current!==c&&(h.current?.(c),f.current=c)},[c,f]),[c,d,h]}({defaultProp:b,onChange:c}),j=void 0!==a,k=j?a:f;{let b=e.useRef(void 0!==a);e.useEffect(()=>{let a=b.current;if(a!==j){let b=j?"controlled":"uncontrolled";console.warn(`${d} is changing from ${a?"controlled":"uncontrolled"} to ${b}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}b.current=j},[j,d])}return[k,e.useCallback(b=>{if(j){let c="function"==typeof b?b(a):b;c!==a&&i.current?.(c)}else h(b)},[j,a,h,i])]}Symbol("RADIX:SYNC_STATE")},173136:a=>{"use strict";a.exports=require("node:url")},174247:(a,b,c)=>{"use strict";c.d(b,{r:()=>k});var d=c(736927),e=c(115962),f=c(415182),g=c(843572),h=c(787950),i=c(970093);async function j(a,b){let c=(0,h.Kr)(a),d=null,e=[],f=await fetch("/api/composio/connections?include_toolkits=1&fresh=1");if(f.ok){let a=await f.json();e=(0,g.s$)(a).filter(a=>(0,h.Kr)(a.toolkit_slug)===c),d=(0,i.Q2)(Array.isArray(a.toolkits)?a.toolkits:[],c,b)}if(!d){let a=new URLSearchParams({search:b?.trim()||c,limit:"24"}),e=await fetch(`/api/composio/toolkits?${a.toString()}`);if(e.ok){let a=await e.json();d=(0,i.Q2)((0,g.O0)(a).items,c,b)}}return{toolkit:d,connections:e}}function k({request:a,onRequestHandled:b,onFallbackToIntegrations:c}){let[g,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)([]),[p,q]=(0,e.useState)("connect"),r=(0,e.useRef)(0),s=(0,e.useCallback)(async(a,b)=>{let d=a.toolkitSlug?.trim();if(!d){k(!1),m(null),o([]),c();return}let e=(0,h.Kr)(d),f=(0,i.TU)(e,a.toolkitName),g=r.current+1;r.current=g,q(a.action),b?.openModal!==!1&&(m(f),o([]),k(!0));try{let b=await j(e,a.toolkitName);if(g!==r.current)return;m(b.toolkit??f),o(b.connections)}catch{if(g!==r.current)return;m(a=>a??f)}},[c]),t=(0,e.useCallback)(a=>{let b=a?.connectedToolkitSlug??a?.toolkit?.slug??l?.slug??null;b&&s({action:p,toolkitSlug:b,toolkitName:a?.connectedToolkitName??a?.toolkit?.name??l?.name??null},{openModal:!1})},[s,p,l?.name,l?.slug]);return(0,d.jsx)(f.R,{toolkit:l,connections:n,open:g,preferredAction:p,onOpenChange:k,onConnectionChange:t})}},175151:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],f=(0,d.A)("chevron-down",e)},176139:(a,b,c)=>{"use strict";c.d(b,{H:()=>p,s:()=>j});var d=c(736927),e=c(115962);let f=new Set(["jpg","jpeg","png","gif","webp","svg","bmp","avif","heic","heif","ico","tiff","tif"]),g=new Set(["mp4","webm","mov","avi","mkv"]),h=new Set(["mp3","wav","ogg","m4a","aac","flac"]),i=new Set(["pdf"]);function j(a){let b=a.split(".").pop()?.toLowerCase()??"";return f.has(b)?"image":g.has(b)?"video":h.has(b)?"audio":i.has(b)?"pdf":null}function k(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,d.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,d.jsx)("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]})}function l(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M15 3h6v6"}),(0,d.jsx)("path",{d:"M10 14 21 3"}),(0,d.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function m(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,d.jsx)("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}),(0,d.jsx)("line",{x1:"11",x2:"11",y1:"8",y2:"14"}),(0,d.jsx)("line",{x1:"8",x2:"14",y1:"11",y2:"11"})]})}function n(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,d.jsx)("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}),(0,d.jsx)("line",{x1:"8",x2:"14",y1:"11",y2:"11"})]})}function o(a){switch(a){case"image":return"#60a5fa";case"video":return"#c084fc";case"audio":return"#f59e0b";case"pdf":return"#ef4444"}}function p({url:a,filename:b,mediaType:c,filePath:e}){return(0,d.jsxs)("div",{className:"flex flex-col h-full",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 px-5 py-3 border-b flex-shrink-0",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)(u,{mediaType:c}),(0,d.jsx)("span",{className:"text-sm font-medium truncate",style:{color:"var(--color-text)"},children:b}),(0,d.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full flex-shrink-0",style:{background:`${o(c)}18`,color:o(c),border:`1px solid ${o(c)}30`},children:function(a){switch(a){case"image":return"Image";case"video":return"Video";case"audio":return"Audio";case"pdf":return"PDF"}}(c)}),(0,d.jsxs)("div",{className:"flex items-center gap-1 ml-auto",children:[(0,d.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-md transition-colors duration-100",style:{color:"var(--color-text-muted)"},title:"Open in new tab",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,d.jsx)(l,{})}),(0,d.jsx)("a",{href:a,download:b,className:"p-1.5 rounded-md transition-colors duration-100",style:{color:"var(--color-text-muted)"},title:"Download",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,d.jsx)(k,{})})]})]}),(0,d.jsxs)("div",{className:"flex-1 overflow-auto flex items-center justify-center p-6",style:{background:"var(--color-surface)"},children:["image"===c&&(0,d.jsx)(q,{url:a,filename:b}),"video"===c&&(0,d.jsx)(r,{url:a}),"audio"===c&&(0,d.jsx)(s,{url:a,filename:b}),"pdf"===c&&(0,d.jsx)(t,{url:a})]}),e&&(0,d.jsx)("div",{className:"px-5 py-2 border-t flex-shrink-0 flex items-center",style:{borderColor:"var(--color-border)"},children:(0,d.jsx)("span",{className:"text-[11px] truncate",style:{color:"var(--color-text-muted)",fontFamily:"'SF Mono', 'Fira Code', monospace"},children:e})})]})}function q({url:a,filename:b}){let[c,f]=(0,e.useState)(1),[g,h]=(0,e.useState)(!1),i=(0,e.useCallback)(()=>f(a=>Math.min(1.5*a,5)),[]),j=(0,e.useCallback)(()=>f(a=>Math.max(a/1.5,.25)),[]),k=(0,e.useCallback)(()=>f(1),[]);return g?(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3 py-12",children:[(0,d.jsx)("span",{className:"text-4xl",style:{opacity:.3},children:"\uD83D\uDDBC"}),(0,d.jsx)("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"Failed to load image"})]}):(0,d.jsxs)("div",{className:"flex flex-col items-center gap-4 w-full",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:j,className:"p-1.5 rounded-md transition-colors duration-100 cursor-pointer",style:{color:"var(--color-text-muted)"},title:"Zoom out",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,d.jsx)(n,{})}),(0,d.jsxs)("button",{type:"button",onClick:k,className:"px-2 py-1 rounded-md text-[11px] tabular-nums transition-colors duration-100 cursor-pointer",style:{color:"var(--color-text-muted)"},title:"Reset zoom",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[Math.round(100*c),"%"]}),(0,d.jsx)("button",{type:"button",onClick:i,className:"p-1.5 rounded-md transition-colors duration-100 cursor-pointer",style:{color:"var(--color-text-muted)"},title:"Zoom in",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,d.jsx)(m,{})})]}),(0,d.jsx)("div",{className:"overflow-auto max-w-full max-h-[calc(100vh-260px)] rounded-xl border",style:{borderColor:"var(--color-border)",backgroundImage:"linear-gradient(45deg, var(--color-surface-hover) 25%, transparent 25%), linear-gradient(-45deg, var(--color-surface-hover) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--color-surface-hover) 75%), linear-gradient(-45deg, transparent 75%, var(--color-surface-hover) 75%)",backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px"},children:(0,d.jsx)("img",{src:a,alt:b,onError:()=>h(!0),style:{transform:`scale(${c})`,transformOrigin:"center center",transition:"transform 200ms ease",maxWidth:c<=1?"100%":"none",display:"block"},draggable:!1})})]})}function r({url:a}){return(0,d.jsx)("div",{className:"w-full max-w-4xl",children:(0,d.jsx)("video",{src:a,controls:!0,className:"w-full rounded-xl border",style:{borderColor:"var(--color-border)",maxHeight:"calc(100vh - 220px)",background:"#000"}})})}function s({url:a,filename:b}){return(0,d.jsxs)("div",{className:"flex flex-col items-center gap-6 py-8",children:[(0,d.jsx)("div",{className:"w-32 h-32 rounded-2xl flex items-center justify-center",style:{background:"linear-gradient(135deg, #f59e0b20, #f59e0b10)",border:"1px solid #f59e0b30"},children:(0,d.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"#f59e0b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M9 18V5l12-2v13"}),(0,d.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,d.jsx)("circle",{cx:"18",cy:"16",r:"3"})]})}),(0,d.jsx)("p",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:b}),(0,d.jsx)("audio",{src:a,controls:!0,className:"w-full max-w-md"})]})}function t({url:a}){return(0,d.jsx)("div",{className:"w-full h-full flex flex-col",children:(0,d.jsx)("iframe",{src:a,className:"w-full flex-1 rounded-xl border",style:{borderColor:"var(--color-border)",minHeight:"calc(100vh - 220px)",background:"white"},title:"PDF viewer"})})}function u({mediaType:a}){let b=o(a);switch(a){case"image":return(0,d.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:b,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,d.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,d.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]});case"video":return(0,d.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:b,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"}),(0,d.jsx)("rect",{x:"2",y:"6",width:"14",height:"12",rx:"2"})]});case"audio":return(0,d.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:b,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M9 18V5l12-2v13"}),(0,d.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,d.jsx)("circle",{cx:"18",cy:"16",r:"3"})]});case"pdf":return(0,d.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:b,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),(0,d.jsx)("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),(0,d.jsx)("path",{d:"M10 9H8"}),(0,d.jsx)("path",{d:"M16 13H8"}),(0,d.jsx)("path",{d:"M16 17H8"})]})}}},176760:a=>{"use strict";a.exports=require("node:path")},180533:(a,b,c)=>{"use strict";c.d(b,{X:()=>f});var d=c(736927),e=c(115962);function f({name:a,saveName:b}){let c=a?.trim()??"",f=0===c.length,[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(""),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(null),o=(0,e.useRef)(null),p=(0,e.useRef)(!1),q=(0,e.useCallback)(()=>{j(""),n(null),h(!0)},[]),r=(0,e.useCallback)(()=>{h(!1),j(""),n(null)},[]),s=(0,e.useCallback)(async()=>{if(p.current)return;let a=i.trim();if(!a)return void r();p.current=!0,l(!0),n(null);try{await b(a),h(!1),j("")}catch(a){n(a instanceof Error?a.message:"Failed to save name.")}finally{p.current=!1,l(!1)}},[i,r,b]);return g?(0,d.jsxs)("div",{className:"flex flex-1 items-center gap-3 min-w-0",children:[(0,d.jsx)("input",{ref:o,type:"text",value:i,onChange:a=>j(a.target.value),onBlur:()=>{s()},onKeyDown:a=>{"Enter"===a.key?(a.preventDefault(),s()):"Escape"===a.key&&(a.preventDefault(),r())},disabled:k,placeholder:"Add a name","aria-label":"Name",className:"font-instrument text-3xl tracking-tight w-full min-w-0",style:{color:"var(--color-text)",background:"transparent",border:"none",outline:"none",padding:0}}),m&&(0,d.jsx)("span",{className:"text-[12px] shrink-0",style:{color:"var(--color-error)"},role:"alert",children:m})]}):f?(0,d.jsxs)("button",{type:"button",onClick:q,title:"Add a name","aria-label":"Add a name",className:"font-instrument text-3xl tracking-tight inline-flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity outline-none focus-visible:ring-2 rounded-sm",style:{color:"var(--color-text-muted)",background:"transparent",border:"none",padding:0},children:[(0,d.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,d.jsx)("path",{d:"M12 20h9"}),(0,d.jsx)("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})]}),(0,d.jsx)("span",{style:{fontStyle:"italic"},children:"Add a name"})]}):(0,d.jsx)("h1",{className:"font-instrument text-3xl tracking-tight truncate",style:{color:"var(--color-text)"},children:c})}},180656:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.isBuffer=function(a){return"undefined"!=typeof Buffer&&Buffer.isBuffer(a)}},183410:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],f=(0,d.A)("server",e)},197143:(a,b,c)=>{"use strict";c.d(b,{h:()=>d});var d=c(250367).A0},199803:(a,b,c)=>{"use strict";c.d(b,{T:()=>ao});var d=c(736927),e=c(115962),f=c(215071),g=c(175151),h=c(604466),i=c(554989),j=c(66008),k=c(165046);function l({model:a,className:b}){let c=a.provider.trim().toLowerCase(),e={color:"currentColor"};if("minimax"===c||"mini-max"===c)return(0,d.jsx)("img",{src:"/models/minimax.png",alt:"",className:b,draggable:!1,"data-provider-icon":"minimax"});if("deepseek"===c)return(0,d.jsx)("img",{src:"/models/deepseek.ico",alt:"",className:b,draggable:!1,"data-provider-icon":"deepseek"});if("kimi"===c||"moonshot"===c||"moonshotai"===c)return(0,d.jsx)("img",{src:"/models/kimi.png",alt:"",className:b,draggable:!1,"data-provider-icon":"kimi"});switch(c){case"anthropic":case"claude":return(0,d.jsx)(i.phd,{className:b,style:e,"data-provider-icon":"claude"});case"openai":case"chatgpt":return(0,d.jsx)(i.pz8,{className:b,style:e,"data-provider-icon":"openai"});case"google":return(0,d.jsx)(i.UKz,{className:b,style:{color:"#4285F4"},"data-provider-icon":"google"});case"meta":return(0,d.jsx)(i.awM,{className:b,style:{color:"#0668E1"},"data-provider-icon":"meta"});case"mistral":return(0,d.jsx)(i.$7J,{className:b,style:{color:"#FF7000"},"data-provider-icon":"mistral"});case"perplexity":return(0,d.jsx)(i.X_y,{className:b,style:{color:"#20B8CD"},"data-provider-icon":"perplexity"});default:return(0,d.jsx)("span",{className:b,style:{color:"var(--color-text-muted)",fontSize:"0.75rem",fontWeight:600,lineHeight:1},"aria-hidden":!0,"data-provider-icon":"fallback",children:a.provider.slice(0,1).toUpperCase()})}}function m({models:a,selectedModel:b,onSelect:c,disabled:e=!1,loading:i=!1,disabledHint:m,fallbackToFirst:n=!0,placeholder:o="Choose a model...",ariaLabel:p="Select chat model",triggerClassName:q}){let r=function(a,b){let c="string"==typeof b?b.trim():"";if(c)return a.find(a=>a.stableId===c||"string"==typeof a.catalogId&&a.catalogId.trim()===c)}(a,b)??(n?a[0]??null:null);if(0===a.length)return null;let s=e&&i?"Switching model…":e&&m?.trim()?m.trim():r?.displayName??o;return(0,d.jsxs)(j.rI,{children:[(0,d.jsxs)(j.ty,{className:(0,k.cn)("inline-flex max-w-full items-center gap-1.5 rounded-lg p-0 text-sm font-medium transition-opacity hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-60",q),style:{color:"var(--color-text-secondary)",opacity:.9},"aria-label":p,title:s,disabled:e,children:[r?(0,d.jsx)(l,{model:r,className:"h-3.5 w-3.5 shrink-0"}):(0,d.jsx)("span",{className:"inline-block h-3.5 w-3.5 shrink-0 rounded-full",style:{background:"var(--color-surface-hover)"},"aria-hidden":!0}),(0,d.jsx)("span",{className:(0,k.cn)("max-w-[240px] truncate",!r&&"italic"),style:r?void 0:{color:"var(--color-text-muted)"},children:r?.displayName??o}),e&&i?(0,d.jsx)(f.default,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}):e?(0,d.jsx)(h.default,{className:"h-3.5 w-3.5 shrink-0 opacity-70","aria-hidden":!0}):(0,d.jsx)(g.default,{className:"h-3.5 w-3.5 shrink-0"})]}),(0,d.jsx)(j.SQ,{align:"start",side:"bottom",sideOffset:8,className:"min-w-[15rem] max-w-[20rem] p-1.5",children:(0,d.jsx)(j.Hr,{value:r?.stableId??"",onValueChange:a=>{e||c(a)},children:a.map(a=>(0,d.jsxs)(j.Ht,{value:a.stableId,disabled:e,children:[(0,d.jsx)(l,{model:a,className:"h-4 w-4 shrink-0"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"truncate text-sm font-medium",style:{color:"var(--color-text)"},children:a.displayName}),(0,d.jsxs)("div",{className:"mt-0.5 flex flex-wrap items-center gap-1.5 text-[10px]",style:{color:"var(--color-text-muted)"},children:[(0,d.jsx)("span",{children:a.provider}),a.reasoning&&(0,d.jsx)("span",{children:"Reasoning"}),a.isRecommended&&(0,d.jsx)("span",{className:"rounded-full px-1.5 py-0.5",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:"Recommended"})]})]})]},a.stableId))})})]})}var n=c(327629),o=c(42813),p=c(687193),q=c(155897),r=c(173092),s=c(534864),t=c(430792),u="Switch",[v,w]=(0,q.A)(u),[x,y]=v(u),z=e.forwardRef((a,b)=>{let{__scopeSwitch:c,name:f,checked:g,defaultChecked:h,required:i,disabled:j,value:k="on",onCheckedChange:l,form:m,...n}=a,[q,s]=e.useState(null),v=(0,p.s)(b,a=>s(a)),w=e.useRef(!1),y=!q||m||!!q.closest("form"),[z,A]=(0,r.i)({prop:g,defaultProp:h??!1,onChange:l,caller:u});return(0,d.jsxs)(x,{scope:c,checked:z,disabled:j,children:[(0,d.jsx)(t.sG.button,{type:"button",role:"switch","aria-checked":z,"aria-required":i,"data-state":D(z),"data-disabled":j?"":void 0,disabled:j,value:k,...n,ref:v,onClick:(0,o.mK)(a.onClick,a=>{A(a=>!a),y&&(w.current=a.isPropagationStopped(),w.current||a.stopPropagation())})}),y&&(0,d.jsx)(C,{control:q,bubbles:!w.current,name:f,value:k,checked:z,required:i,disabled:j,form:m,style:{transform:"translateX(-100%)"}})]})});z.displayName=u;var A="SwitchThumb",B=e.forwardRef((a,b)=>{let{__scopeSwitch:c,...e}=a,f=y(A,c);return(0,d.jsx)(t.sG.span,{"data-state":D(f.checked),"data-disabled":f.disabled?"":void 0,...e,ref:b})});B.displayName=A;var C=e.forwardRef(({__scopeSwitch:a,control:b,checked:c,bubbles:f=!0,...g},h)=>{let i=e.useRef(null),j=(0,p.s)(i,h),k=function(a){let b=e.useRef({value:a,previous:a});return e.useMemo(()=>(b.current.value!==a&&(b.current.previous=b.current.value,b.current.value=a),b.current.previous),[a])}(c),l=(0,s.X)(b);return e.useEffect(()=>{let a=i.current;if(!a)return;let b=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(k!==c&&b){let d=new Event("click",{bubbles:f});b.call(a,c),a.dispatchEvent(d)}},[k,c,f]),(0,d.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:c,...g,tabIndex:-1,ref:j,style:{...g.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function D(a){return a?"checked":"unchecked"}C.displayName="SwitchBubbleInput";let E=e.forwardRef(({className:a,...b},c)=>(0,d.jsx)(z,{className:(0,k.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border border-zinc-300 bg-zinc-200 shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-zinc-900 data-[state=unchecked]:bg-zinc-200 dark:border-zinc-700 dark:data-[state=checked]:bg-zinc-50 dark:data-[state=unchecked]:bg-zinc-700",a),...b,ref:c,children:(0,d.jsx)(B,{className:(0,k.cn)("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-md ring-1 ring-black/10 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-zinc-900 dark:ring-white/10")})}));function F({notice:a}){let b="success"===a.tone?"border-emerald-500/30 bg-emerald-500/10 text-emerald-100":"border-amber-500/30 bg-amber-500/10 text-amber-100";return(0,d.jsx)("div",{className:`rounded-xl border px-4 py-3 text-sm ${b}`,children:a.message})}function G(a){var b=a.id,c=a.label;switch(b){case"apollo":return"Dench Enrichments";case"exa":return c??"Exa";case"elevenlabs":return c??"ElevenLabs"}}E.displayName=z.displayName;let H={exa:"Search the web with Exa",apollo:"Enrich people and company data",elevenlabs:"Generate speech with ElevenLabs"};function I({integration:a,isSaving:b,onToggle:c}){let e=G(a),f=H[a.id],g=b?"Saving...":a.locked?"Unavailable until Dench Cloud is ready":f;return(0,d.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-xl px-1 py-2",style:{background:"transparent"},children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:function(a){switch(a){case"exa":return(0,d.jsx)("img",{src:"/integrations/exa-logomark.svg",alt:"",width:20,height:20,className:"h-5 w-5 shrink-0 object-contain",draggable:!1});case"apollo":return(0,d.jsx)("img",{src:"/dench-workspace-icon.png",alt:"",width:20,height:20,className:"h-5 w-5 shrink-0 rounded-md object-contain",draggable:!1});case"elevenlabs":return(0,d.jsx)(i.AHR,{className:"h-5 w-5 shrink-0","aria-hidden":!0})}}(a.id)}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("div",{className:"truncate text-sm font-medium text-foreground",children:e}),(0,d.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[11px] leading-4 text-muted-foreground",children:[(0,d.jsx)("span",{children:g}),a.lockBadge&&(0,d.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:a.lockBadge})]})]})]}),(0,d.jsx)(E,{"aria-label":`Toggle ${e}`,checked:a.enabled,disabled:b||a.locked,onCheckedChange:b=>c(a,b)})]})}function J(a={}){let b=void 0!==a.data||void 0!==a.loading||void 0!==a.error||void 0!==a.onToggle,[c,f]=(0,e.useState)(null),[g,h]=(0,e.useState)(!0),[i,j]=(0,e.useState)(null),[k,l]=(0,e.useState)(null),[m,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(null),r=(0,e.useCallback)(async()=>{h(!0),j(null);try{let a=await fetch("/api/integrations");if(!a.ok)throw Error(`Failed to load integrations (${a.status})`);let b=await a.json();f(b)}catch(a){j(a instanceof Error?a.message:"Failed to load integrations")}finally{h(!1)}},[]),s=b?a.data??null:c,t=b?a.loading??!1:g,u=b?a.error??null:i,v=b?a.savingId??null:k,w=b?a.repairing??!1:m,x=b?a.notice??null:p,y=(0,e.useMemo)(()=>s?.integrations??[],[s]),z=(0,e.useMemo)(()=>new Set(a.excludeIntegrationIds??[]),[a.excludeIntegrationIds]),A=(0,e.useMemo)(()=>y.filter(a=>!z.has(a.id)),[y,z]),B=(0,e.useMemo)(()=>y.some(a=>("exa"===a.id||"apollo"===a.id)&&a.health.pluginMissing)||(s?.managedPlugins??[]).some(a=>a.required&&a.health.pluginMissing),[y,s?.managedPlugins]),C=(0,e.useCallback)(a=>{b||f(a)},[b]),D=(0,e.useCallback)(async(b,c)=>{if(a.onToggle)return void a.onToggle(b,c);let d=G(b);l(b.id),q(null);try{let a=await fetch(`/api/integrations/${b.id}/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:c})}),e=await a.json();if(!a.ok)throw Error("error"in e&&e.error?e.error:`Failed to update ${d}`);C(e),e.refresh.restarted?q({tone:"success",message:`${d} updated and the ${e.refresh.profile} gateway restarted successfully.`}):e.changed?q({tone:"warning",message:`${d} updated, but the gateway restart did not complete: ${e.refresh.error??"unknown error"}.`}):q({tone:"success",message:`${d} was already in the requested state.`})}catch(a){q({tone:"warning",message:a instanceof Error?a.message:`Failed to update ${d}.`})}finally{l(null)}},[C,a]),E=(0,e.useCallback)(async()=>{if(a.onRepair)return void a.onRepair();o(!0),q(null);try{let a=await fetch("/api/integrations/repair",{method:"POST"}),b=await a.json();if(!a.ok)throw Error("error"in b&&b.error?b.error:"Failed to repair integrations.");if(C(b),b.changed&&b.refresh.restarted){let a=b.repairedIds.length>0?b.repairedIds.map(a=>(function(a){switch(a){case"apollo":return"Dench Enrichments";case"exa":return"Exa";case"dench-ai-gateway":return"Dench AI Gateway";case"dench-identity":return"Dench Identity";case"posthog":return"PostHog"}})(a)).join(", "):"profiles";q({tone:"success",message:`Repair completed for ${a} and the ${b.refresh.profile} gateway restarted successfully.`})}else b.changed?q({tone:"warning",message:`Repair updated the profile, but the gateway restart did not complete: ${b.refresh.error??"unknown error"}.`}):q({tone:"success",message:"No repair changes were needed for this profile."})}catch(a){q({tone:"warning",message:a instanceof Error?a.message:"Failed to repair integrations."})}finally{o(!1)}},[C,a]);return t?(0,d.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,d.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}):u?(0,d.jsxs)("div",{className:"rounded-xl border px-4 py-4 text-center",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)("p",{className:"text-sm mb-2",style:{color:"var(--color-text-muted)"},children:u}),(0,d.jsx)(n.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{if(a.onRetry)return void a.onRetry();r()},children:"Retry"})]}):s?(0,d.jsxs)("div",{className:"space-y-4",children:[x&&(0,d.jsx)(F,{notice:x}),B&&(0,d.jsx)(n.$,{type:"button",variant:"outline",size:"sm",onClick:()=>void E(),disabled:w,children:w?"Repairing...":"Repair older profiles"}),(0,d.jsx)("div",{className:"space-y-1",children:A.map(a=>(0,d.jsx)(I,{integration:a,isSaving:v===a.id,onToggle:D},a.id))})]}):null}var K=c(183410),L=c(236705),M=c(332624),N=c(830004),O=c(792188),P=c(912886),Q=c(768996),R=c(306345);function S({onAddAndConnect:a,disabled:b=!1}){let[c,g]=(0,e.useState)(!1),[h,i]=(0,e.useState)(""),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(null),[o,p]=(0,e.useState)(!1),q=(0,e.useRef)(null),r=h.trim(),s=j.trim(),t=r.length>0&&s.length>0&&!o&&!b,u=()=>{g(!1),i(""),k(""),m(null),p(!1)},v=async()=>{if(t){p(!0),m(null);try{let b=await a({key:r,url:s});b.ok?u():m(b.error)}finally{p(!1)}}};return c?(0,d.jsx)("div",{className:"rounded-xl border px-4 py-4",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:(0,d.jsx)(K.default,{className:"h-5 w-5","aria-hidden":!0})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1 space-y-3",children:[(0,d.jsx)("div",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:"New MCP Server"}),(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"mcp-inline-key",className:"mb-1 block text-[11px] uppercase tracking-wide",style:{color:"var(--color-text-muted)"},children:"Server name"}),(0,d.jsx)("input",{id:"mcp-inline-key",ref:q,type:"text",value:h,onChange:a=>{i(a.target.value),m(null)},onKeyDown:a=>{"Enter"===a.key?(a.preventDefault(),v()):"Escape"===a.key&&(a.preventDefault(),u())},placeholder:"e.g. stripe",disabled:o,className:"w-full rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--color-accent)]",style:{background:"var(--color-bg)",border:"1px solid var(--color-border)",color:"var(--color-text)"},autoComplete:"off",spellCheck:!1})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"mcp-inline-url",className:"mb-1 block text-[11px] uppercase tracking-wide",style:{color:"var(--color-text-muted)"},children:"Server URL"}),(0,d.jsx)("input",{id:"mcp-inline-url",type:"url",value:j,onChange:a=>{k(a.target.value),m(null)},onKeyDown:a=>{"Enter"===a.key?(a.preventDefault(),v()):"Escape"===a.key&&(a.preventDefault(),u())},placeholder:"https://mcp.example.com",disabled:o,className:"w-full rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--color-accent)]",style:{background:"var(--color-bg)",border:"1px solid var(--color-border)",color:"var(--color-text)"},autoComplete:"off",spellCheck:!1})]})]}),l&&(0,d.jsx)("p",{className:"rounded-lg px-3 py-2 text-xs",style:{background:"rgba(220, 38, 38, 0.08)",color:"var(--color-error)"},children:l}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(n.$,{type:"button",variant:"ghost",size:"sm",className:"rounded-lg",onClick:u,disabled:o,style:{color:"var(--color-text-muted)",background:"transparent"},children:"Cancel"}),(0,d.jsx)(n.$,{type:"button",size:"sm",className:"rounded-lg",onClick:()=>void v(),disabled:!t,style:{background:t?"var(--color-accent)":"var(--color-surface-hover)",color:t?"var(--color-bg)":"var(--color-text-muted)"},children:(0,d.jsxs)("span",{className:"inline-flex items-center gap-2",children:[o?(0,d.jsx)(f.default,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):null,(0,d.jsx)("span",{children:o?"Connecting…":"Connect"})]})})]})]})]})}):(0,d.jsxs)("button",{type:"button",onClick:()=>{b||g(!0)},disabled:b,className:"flex w-full items-center gap-3 rounded-xl border px-4 py-4 text-left transition-colors hover:bg-[var(--color-surface-hover)] disabled:opacity-50",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:(0,d.jsx)(R.default,{className:"h-5 w-5","aria-hidden":!0})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("div",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:"New MCP Server"}),(0,d.jsx)("div",{className:"mt-0.5 text-xs leading-5",style:{color:"var(--color-text-muted)"},children:"Add a Custom MCP Server"})]})]})}var T=c(23581);function U({open:a,onOpenChange:b,serverKey:c,serverUrl:g,onSubmit:h,hint:i}){let j=(0,e.useRef)(null),[k,l]=(0,e.useState)(""),[m,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(!1),r=async()=>{if(!k.trim())return void o("Please enter an access token.");q(!0),o(null);try{let a=await h({authToken:k.trim()});if(a)return void o(a);b(!1)}finally{q(!1)}};return(0,d.jsx)(T.lG,{open:a,onOpenChange:b,children:(0,d.jsxs)(T.Cf,{className:"sm:max-w-lg",children:[(0,d.jsxs)(T.c7,{children:[(0,d.jsxs)(T.L3,{children:["Connect to ",c]}),(0,d.jsxs)(T.rr,{children:["Paste an access token for this MCP server. It will be sent as an",(0,d.jsx)("code",{className:"mx-1",children:"Authorization: Bearer ..."}),"header on every request."]})]}),(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"rounded-xl border px-3 py-2 text-xs leading-5",style:{borderColor:"var(--color-border)",background:"var(--color-surface)",color:"var(--color-text-muted)"},children:[(0,d.jsx)("div",{className:"text-[11px] uppercase tracking-wide",children:"Endpoint"}),(0,d.jsx)("div",{className:"mt-1 truncate",style:{color:"var(--color-text)"},title:g,children:g})]}),i?(0,d.jsxs)("p",{className:"rounded-lg px-3 py-2 text-xs leading-5",style:{background:"rgba(234, 179, 8, 0.08)",color:"var(--color-text-muted)"},children:["Server says: ",i]}):null,(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"mb-1.5 block text-sm font-medium",style:{color:"var(--color-text-secondary)"},children:"Access token"}),(0,d.jsx)("input",{ref:j,type:"password",value:k,onChange:a=>{l(a.target.value),o(null)},onKeyDown:a=>{"Enter"!==a.key||p||r()},placeholder:"sk-...",className:"w-full rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--color-accent)]",style:{background:"var(--color-bg)",border:"1px solid var(--color-border)",color:"var(--color-text)"}}),(0,d.jsxs)("p",{className:"mt-1 text-xs",style:{color:"var(--color-text-muted)"},children:["The ",(0,d.jsx)("code",{children:"Bearer"})," prefix is added automatically."]})]}),m&&(0,d.jsx)("p",{className:"rounded-lg px-3 py-2 text-sm",style:{background:"rgba(220, 38, 38, 0.08)",color:"var(--color-error)"},children:m})]}),(0,d.jsxs)(T.Es,{children:[(0,d.jsx)(n.$,{type:"button",variant:"ghost",onClick:()=>b(!1),disabled:p,className:"rounded-lg px-4",style:{color:"var(--color-text-muted)",background:"transparent"},children:"Cancel"}),(0,d.jsx)(n.$,{type:"button",onClick:()=>void r(),disabled:p||!k.trim(),className:"rounded-lg px-5",style:{background:"var(--color-accent)",color:"var(--color-bg)"},children:(0,d.jsxs)("span",{className:"inline-flex items-center gap-2",children:[p?(0,d.jsx)(f.default,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):null,(0,d.jsx)("span",{children:p?"Connecting...":"Connect"})]})})]})]})})}function V({notice:a}){let b="success"===a.tone?"border-emerald-500/30 bg-emerald-500/10 text-emerald-300":"border-red-500/30 bg-red-500/10 text-red-300";return(0,d.jsx)("div",{className:`rounded-xl border px-4 py-3 text-sm ${b}`,children:a.message})}async function W(a,b){try{let c=await a.json();return"string"==typeof c.error&&c.error.trim().length>0?c.error:b}catch{return b}}function X(a){return[...a].toSorted((a,b)=>a.key.localeCompare(b.key))}function Y(a,b){return X([...a.filter(a=>a.key!==b.key),b])}async function Z(a,b){return await new Promise(c=>{let d=!1,e=()=>{d||(d=!0,window.removeEventListener("message",f),clearInterval(g),clearTimeout(h),c())},f=c=>{if(c.source!==b)return;let d=c.data;if(d&&"denchclaw.mcp.connect"===d.source&&"string"==typeof d.serverKey&&d.serverKey===a){try{b.close()}catch{}e()}};window.addEventListener("message",f);let g=window.setInterval(()=>{b.closed&&e()},500),h=window.setTimeout(()=>{try{b.close()}catch{}e()},3e5)})}function _(){let[a,b]=(0,e.useState)([]),[c,f]=(0,e.useState)(!0),[g,h]=(0,e.useState)(null),[i,j]=(0,e.useState)(null),[k,l]=(0,e.useState)(null),[m,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(null),r=(0,e.useRef)(new Set),s=(0,e.useCallback)(async()=>{f(!0),h(null);try{let a=await fetch("/api/settings/mcp");if(!a.ok)throw Error(await W(a,`Failed to load MCP servers (${a.status}).`));let c=await a.json();b(X(Array.isArray(c.servers)?c.servers:[]))}catch(a){h(a instanceof Error?a.message:"Failed to load MCP servers.")}finally{f(!1)}},[]),t=(0,e.useCallback)(async a=>{q(a.key),j(null);try{let c=await fetch("/api/settings/mcp/probe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:a.key})});if(!c.ok)throw Error(await W(c,"Probe failed."));let d=await c.json();d.server&&b(a=>Y(a,d.server))}catch(a){j({tone:"error",message:a instanceof Error?a.message:"Probe failed."})}finally{q(null)}},[]),u=(0,e.useCallback)((a,b)=>{l({serverKey:a.key,serverUrl:a.url,hint:b})},[]),v=(0,e.useCallback)(async(a,c)=>{try{let d=await fetch("/api/settings/mcp/probe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:a})});if(!d.ok)return;let e=await d.json();e.server&&(b(a=>Y(a,e.server)),c?.showSuccessNotice!==!1&&"connected"===e.server.state&&j({tone:"success",message:`Connected '${a}'.`}))}catch{}},[]),w=(0,e.useCallback)(async a=>{q(a.key),j(null);try{let c=await fetch("/api/settings/mcp/connect/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:a.key})});if(!c.ok){let b=await W(c,"Failed to start Connect.");u(a,b);return}let d=await c.json();if(d.alreadyConnected&&d.server){b(a=>Y(a,d.server)),j({tone:"success",message:`'${a.key}' is already connected.`});return}if(!1===d.supportsOAuth)return void u(a,d.reason??a.lastDetail);if(!d.authorizationUrl)return void u(a,"OAuth start did not return an authorization URL.");let e=window.open(d.authorizationUrl,`mcp-connect-${a.key}`,"popup=yes,width=520,height=720,noopener=no");if(!e)return void u(a,"The browser blocked the OAuth popup. Allow popups and try again, or paste a token instead.");await Z(a.key,e),await v(a.key)}catch(b){u(a,b instanceof Error?b.message:"Connect failed.")}finally{q(null)}},[u,v]),x=(0,e.useCallback)(async a=>{j(null);try{let c=await fetch("/api/settings/mcp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!c.ok)return{ok:!1,error:await W(c,"Failed to add MCP server.")};let d=(await c.json()).server;if(!d)return{ok:!1,error:"Server was added but the response was malformed."};return r.current.delete(d.key),b(a=>Y(a,d)),w(d),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:"Failed to add MCP server."}}},[w]),y=(0,e.useCallback)(async a=>{if(!k)return"No server selected.";try{let c=await fetch("/api/settings/mcp/connect/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:k.serverKey,authToken:a.authToken})});if(!c.ok)return await W(c,"Failed to connect.");let d=await c.json();d.server&&b(a=>Y(a,d.server));let e=d.probe?.status;if("connected"===e)return j({tone:"success",message:`Connected to '${k.serverKey}'.`}),null;return d.probe?.detail??"The token was saved but the server still rejected the connection."}catch(a){return a instanceof Error?a.message:"Failed to connect."}},[k]),z=(0,e.useCallback)(async a=>{if(window.confirm(`Remove MCP server '${a.key}'?`)){o(a.key),j(null);try{let c=await fetch("/api/settings/mcp",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:a.key})});if(!c.ok)throw Error(await W(c,"Failed to remove MCP server."));b(b=>b.filter(b=>b.key!==a.key)),j({tone:"success",message:`Removed MCP server '${a.key}'.`})}catch(a){j({tone:"error",message:a instanceof Error?a.message:"Failed to remove MCP server."})}finally{o(null)}}},[]);return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"flex items-center justify-between gap-3",children:(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:"MCP Servers"}),(0,d.jsx)("p",{className:"mt-1 text-xs leading-5",style:{color:"var(--color-text-muted)"},children:"Connect remote MCP servers to expose additional tools in DenchClaw."})]})}),i?(0,d.jsx)(V,{notice:i}):null,c?(0,d.jsx)("div",{className:"flex items-center justify-center py-10",children:(0,d.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}):g?(0,d.jsxs)("div",{className:"rounded-xl border px-4 py-6 text-center",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)("p",{className:"mb-3 text-sm",style:{color:"var(--color-text-muted)"},children:g}),(0,d.jsx)(n.$,{type:"button",variant:"outline",onClick:()=>void s(),children:"Retry"})]}):(0,d.jsxs)("div",{className:"space-y-3",children:[a.map(a=>(0,d.jsx)(aa,{server:a,busy:p===a.key,deleting:m===a.key,onConnect:()=>w(a),onRetry:()=>void t(a),onDelete:()=>void z(a)},a.key)),(0,d.jsx)(S,{onAddAndConnect:x})]}),k?(0,d.jsx)(U,{open:!!k,onOpenChange:a=>{a||l(null)},serverKey:k.serverKey,serverUrl:k.serverUrl,hint:k.hint,onSubmit:y}):null]})}function aa({server:a,busy:b,deleting:c,onConnect:e,onRetry:g,onDelete:h}){return(0,d.jsx)("div",{className:"rounded-xl border px-4 py-4",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsxs)("div",{className:"flex min-w-0 gap-3",children:[(0,d.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:(0,d.jsx)(K.default,{className:"h-5 w-5","aria-hidden":!0})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("div",{className:"truncate text-sm font-medium",style:{color:"var(--color-text)"},children:a.key}),(0,d.jsx)(ab,{server:a}),(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:[a.hasAuth?(0,d.jsx)(L.default,{className:"h-3 w-3","aria-hidden":!0}):(0,d.jsx)(M.default,{className:"h-3 w-3","aria-hidden":!0}),(0,d.jsx)("span",{children:a.hasAuth?"Authenticated":"No auth"})]})]}),(0,d.jsx)("p",{className:"mt-2 text-[11px] uppercase tracking-wide",style:{color:"var(--color-text-muted)"},children:"Remote endpoint"}),(0,d.jsx)("div",{className:"mt-1 truncate text-xs leading-5",style:{color:"var(--color-text-muted)"},title:a.url,children:a.url}),a.lastDetail&&"connected"!==a.state?(0,d.jsx)("div",{className:"mt-2 text-xs leading-5",style:{color:"var(--color-text-muted)"},title:a.lastDetail,children:a.lastDetail}):null]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,d.jsx)(ac,{server:a,busy:b,onConnect:e,onRetry:g}),(0,d.jsx)(n.$,{type:"button",variant:"ghost",size:"icon",className:"rounded-lg",onClick:h,disabled:c,"aria-label":`Remove ${a.key}`,style:{color:"var(--color-text-muted)"},children:c?(0,d.jsx)(f.default,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):(0,d.jsx)(N.default,{className:"h-4 w-4","aria-hidden":!0})})]})]})})}function ab({server:a}){let b="inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium";if("connected"===a.state){let c=a.toolCount??0;return(0,d.jsxs)("span",{className:b,style:{background:"rgba(16, 185, 129, 0.12)",color:"rgb(110, 231, 183)"},children:[(0,d.jsx)(O.default,{className:"h-3 w-3","aria-hidden":!0}),(0,d.jsxs)("span",{children:[c," tool",1===c?"":"s"," enabled"]})]})}return"needs_auth"===a.state?(0,d.jsxs)("span",{className:b,style:{background:"rgba(234, 179, 8, 0.12)",color:"rgb(252, 211, 77)"},children:[(0,d.jsx)(M.default,{className:"h-3 w-3","aria-hidden":!0}),(0,d.jsx)("span",{children:"Needs authentication"})]}):"error"===a.state?(0,d.jsxs)("span",{className:b,style:{background:"rgba(239, 68, 68, 0.12)",color:"rgb(252, 165, 165)"},children:[(0,d.jsx)(P.default,{className:"h-3 w-3","aria-hidden":!0}),(0,d.jsx)("span",{children:"Error"})]}):(0,d.jsx)("span",{className:b,style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:a.transport})}function ac({server:a,busy:b,onConnect:c,onRetry:e}){return"connected"===a.state?(0,d.jsx)(n.$,{type:"button",variant:"ghost",size:"sm",className:"rounded-lg",onClick:e,disabled:b,"aria-label":`Re-check ${a.key}`,style:{color:"var(--color-text-muted)"},children:b?(0,d.jsx)(f.default,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):(0,d.jsx)(Q.default,{className:"h-4 w-4","aria-hidden":!0})}):"error"===a.state?(0,d.jsxs)(n.$,{type:"button",variant:"outline",size:"sm",className:"rounded-lg",onClick:e,disabled:b,children:[b?(0,d.jsx)(f.default,{className:"mr-1 h-4 w-4 animate-spin","aria-hidden":!0}):null,"Retry"]}):(0,d.jsxs)(n.$,{type:"button",variant:"outline",size:"sm",className:"rounded-lg",onClick:c,disabled:b,children:[b?(0,d.jsx)(f.default,{className:"mr-1 h-4 w-4 animate-spin","aria-hidden":!0}):null,"Connect"]})}let ad=[{id:"dench",name:"Dench",src:"/dench-workspace-icon.png",rounded:!0},{id:"aviato",name:"Aviato",src:"/integrations/aviato.ico",rounded:!0},{id:"apollo",name:"Apollo",src:"/integrations/apollo.ico",rounded:!0},{id:"pdl",name:"People Data Labs",src:"/integrations/people-data-labs.ico",rounded:!0},{id:"datagma",name:"Datagma",src:"/integrations/datagma.png",rounded:!0},{id:"rocketreach",name:"RocketReach",src:"/integrations/rocketreach.ico",rounded:!0},{id:"hunter",name:"Hunter",src:"/integrations/hunter.png",rounded:!0},{id:"bettercontacts",name:"Better Contacts",src:"/integrations/bettercontacts.png",rounded:!0},{id:"dropcontacts",name:"Dropcontact",src:"/integrations/dropcontacts.ico",rounded:!0},{id:"explorium",name:"Explorium",src:"/integrations/explorium.png",rounded:!0}],ae="__dench_default_voice__",af="w-full max-w-full rounded-xl border border-[color-mix(in_srgb,var(--color-border)_78%,transparent)] bg-[var(--color-surface)] px-3 py-2.5 hover:opacity-100";function ag(a){let b=new Map;for(let c of a?.integrations??[])b.set(c.id,c.enabled);return{exa:b.get("exa")??!1,apollo:b.get("apollo")??!1,elevenlabs:b.get("elevenlabs")??!1}}function ah({notice:a}){let b="success"===a.tone?"border-emerald-500/30 bg-emerald-500/10 text-emerald-300":"warning"===a.tone?"border-amber-500/30 bg-amber-500/10 text-amber-300":"border-red-500/30 bg-red-500/10 text-red-300";return(0,d.jsx)("div",{className:`rounded-xl border px-4 py-3 text-sm ${b}`,children:a.message})}function ai({enrichmentIntegration:a,onToggleEnrichment:b}){return(0,d.jsxs)("div",{className:"rounded-xl border px-4 py-4",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,d.jsx)("div",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:"Dench Enrichment"}),(0,d.jsx)("div",{className:"max-w-[42rem] text-xs leading-5",style:{color:"var(--color-text-muted)"},children:"Enrich people and company data with multiple providers."})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[a?.lockBadge?(0,d.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:a.lockBadge}):null,(0,d.jsx)(E,{"aria-label":"Toggle Dench Enrichments",checked:a?.enabled??!1,disabled:!a||a.locked,onCheckedChange:c=>{a&&b(a,c)}})]})]}),(0,d.jsx)("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:ad.map(a=>(0,d.jsx)("div",{className:"flex h-8 w-8 items-center justify-center",title:a.name,"aria-label":a.name,children:(0,d.jsx)("img",{src:a.src,alt:"",width:24,height:24,className:a.rounded?"h-6 w-6 rounded-[6px] object-contain":"h-6 w-6 object-contain",draggable:!1})},a.id))})]})}function aj(){return(0,d.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"})})}function ak(){return(0,d.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"}),(0,d.jsx)("path",{d:"m21 2-9.6 9.6"}),(0,d.jsx)("circle",{cx:"7.5",cy:"15.5",r:"5.5"})]})}function al(){return(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M15 3h6v6"}),(0,d.jsx)("path",{d:"M10 14 21 3"}),(0,d.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function am({onSave:a,saving:b,notice:c,validationError:f}){let[g,h]=(0,e.useState)("");return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border px-4 py-3",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg shrink-0",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"},children:(0,d.jsx)(aj,{})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:"Dench Cloud"}),(0,d.jsx)("div",{className:"text-[11px] mt-0.5",style:{color:"var(--color-text-muted)"},children:f?"Your API key is invalid. Enter a new one below.":"Connect to Dench Cloud for AI model access."})]}),(0,d.jsxs)("a",{href:"https://dench.com/api",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded-lg transition-colors hover:bg-stone-200 dark:hover:bg-stone-700",style:{color:"var(--color-accent)"},children:["Get API Key ",(0,d.jsx)(al,{})]})]}),f&&(0,d.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-300",children:f}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)(ak,{})}),(0,d.jsx)("input",{type:"password",value:g,onChange:a=>h(a.target.value),onKeyDown:c=>{"Enter"===c.key&&g.trim()&&!b&&a(g.trim())},placeholder:"Paste your Dench API key...",className:"w-full pl-9 pr-3 py-2.5 rounded-xl text-sm outline-none transition-colors",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)",color:"var(--color-text)"},disabled:b})]}),(0,d.jsx)(n.$,{type:"button",onClick:()=>{g.trim()&&a(g.trim())},disabled:!g.trim()||b,children:b?"Validating...":"Save"})]}),c&&(0,d.jsx)(ah,{notice:c})]})}function an({models:a,selectedModel:b,selectedVoiceId:c,elevenLabsEnabled:e,isDenchPrimary:h,recommendedModelId:i,onSelect:k,onSelectVoice:l,selecting:n,savingVoice:o,voiceLoading:p,voices:q}){let r=a.map(a=>({stableId:a.stableId,...a.id.trim()&&a.id!==a.stableId?{catalogId:a.id}:{},displayName:a.displayName,provider:a.provider,reasoning:a.reasoning,isRecommended:a.id===i})),s=q.find(a=>a.voiceId===c)??null;return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border px-4 py-3",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsx)("img",{src:"/dench-workspace-icon.png",alt:"",width:36,height:36,className:"h-9 w-9 shrink-0 rounded-lg object-contain",draggable:!1}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:"Dench Cloud"}),(0,d.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",style:{background:h?"rgba(16,185,129,0.15)":"var(--color-surface-hover)",color:h?"rgb(16,185,129)":"var(--color-text-muted)"},children:h?"Active":"Available"})]}),(0,d.jsx)("div",{className:"text-[11px] mt-0.5",style:{color:"var(--color-text-muted)"},children:h?"Connected and active as your primary provider.":"Connected. Select a model to use Dench Cloud as your primary provider."})]}),(0,d.jsxs)("a",{href:"https://dench.com/usage",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs font-medium shrink-0 transition-opacity hover:opacity-80",style:{color:"var(--color-accent)"},children:["Usage ",(0,d.jsx)(al,{})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium mb-2",style:{color:"var(--color-text-muted)"},children:"Primary Model"}),(0,d.jsx)("div",{className:"max-w-[420px]",children:(0,d.jsx)(m,{models:r,selectedModel:h?b:null,onSelect:k,disabled:n,loading:n,fallbackToFirst:h,placeholder:"Choose a model...",ariaLabel:"Select primary model",triggerClassName:af})})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-medium mb-2",style:{color:"var(--color-text-muted)"},children:"ElevenLabs Voice"}),(0,d.jsx)("div",{className:"max-w-[420px]",children:(0,d.jsxs)(j.rI,{children:[(0,d.jsxs)(j.ty,{className:`inline-flex items-center gap-1.5 text-sm font-medium transition-opacity disabled:cursor-default disabled:opacity-60 cursor-pointer outline-none ring-0 ${af}`,style:{color:"var(--color-text-secondary)",opacity:.9},"aria-label":"Select ElevenLabs voice",title:s?.name??void 0,disabled:p||o||0===q.length,children:[(0,d.jsx)("span",{className:"max-w-[240px] truncate",style:p||!s&&0===q.length?{color:"var(--color-text-muted)"}:void 0,children:p?"Loading voices...":0===q.length?"No voices available":s?`${s.name}${s.category?` \xb7 ${s.category}`:""}`:"Default voice (first available)"}),p||o?(0,d.jsx)(f.default,{className:"h-3.5 w-3.5 shrink-0 animate-spin","aria-hidden":!0}):(0,d.jsx)(g.default,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0})]}),(0,d.jsx)(j.SQ,{align:"start",side:"bottom",sideOffset:8,className:"min-w-[15rem] max-w-[20rem] p-1.5",children:(0,d.jsxs)(j.Hr,{value:c??ae,onValueChange:a=>{l(a===ae?null:a)},children:[(0,d.jsx)(j.Ht,{value:ae,children:"Default voice (first available)"}),q.map(a=>(0,d.jsx)(j.Ht,{value:a.voiceId,children:(0,d.jsxs)("span",{className:"truncate",children:[a.name,a.category?` \xb7 ${a.category}`:""]})},a.voiceId))]})})]})}),(0,d.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,d.jsx)("p",{className:"text-[11px]",style:{color:"var(--color-text-muted)"},children:e?"Used for message playback and server-side voice input.":"Choose a voice now. Playback and server-side voice input stay off until ElevenLabs is enabled in Integrations."}),s?.description&&(0,d.jsx)("p",{className:"text-[11px]",style:{color:"var(--color-text-muted)"},children:s.description})]})]})]})}function ao(){let[a,b]=(0,e.useState)(null),[c,g]=(0,e.useState)(null),[h,i]=(0,e.useState)([]),[j,k]=(0,e.useState)(!0),[l,m]=(0,e.useState)(!1),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)(null),[G,H]=(0,e.useState)({exa:!1,apollo:!1,elevenlabs:!1}),[I,K]=(0,e.useState)(0),L=(0,e.useCallback)(async()=>{k(!0),r(null);try{let a=await fetch("/api/settings/cloud");if(!a.ok)throw Error(`Failed to load cloud settings (${a.status})`);let c=await a.json();b(c)}catch(a){r(a instanceof Error?a.message:"Failed to load cloud settings.")}finally{k(!1)}},[]),M=(0,e.useCallback)(async()=>{m(!0),t(null);try{let a=await fetch("/api/integrations");if(!a.ok)throw Error(`Failed to load integrations (${a.status})`);let b=await a.json();g(b)}catch(a){t(a instanceof Error?a.message:"Failed to load integrations.")}finally{m(!1)}},[]);(0,e.useRef)(c).current=c;let N=(0,e.useCallback)(async a=>{v(!0),B(null);try{let c=await fetch("/api/settings/cloud",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"save_key",apiKey:a})}),d=await c.json();if(!c.ok)return void B({tone:"error",message:d.error??"Failed to save API key."});b(d.state);let e=d.refresh;e.restarted?B({tone:"success",message:`API key saved and the ${e.profile} gateway restarted successfully.`}):e.attempted?B({tone:"warning",message:`API key saved, but the gateway restart did not complete: ${e.error??"unknown error"}.`}):B({tone:"success",message:"API key saved successfully."})}catch(a){B({tone:"error",message:a instanceof Error?a.message:"Failed to save API key."})}finally{v(!1)}},[]),O=(0,e.useCallback)(a=>{B(null),D(a)},[]),P=(0,e.useCallback)(a=>{B(null),F(a)},[]),Q=(0,e.useCallback)((a,b)=>{B(null),H(c=>({...c,[a.id]:b}))},[]),R=(0,e.useCallback)(()=>{a?.status==="valid"&&c&&(B(null),D(a.isDenchPrimary?a.selectedDenchModel:null),F(a.selectedVoiceId),H(ag(c)))},[a,c]),S=a?.status==="valid"&&a.isDenchPrimary?a.selectedDenchModel:null,T=a?.status==="valid"?a.selectedVoiceId:null,U=(0,e.useMemo)(()=>ag(c),[c]),V=a?.status==="valid"&&(C!==S||E!==T||G.exa!==U.exa||G.apollo!==U.apollo||G.elevenlabs!==U.elevenlabs),W=!!C,X=(0,e.useMemo)(()=>c?{...c,denchCloud:{...c.denchCloud,isPrimaryProvider:W,primaryModel:c.denchCloud.primaryModel},integrations:c.integrations.map(a=>"dench_not_primary"!==a.lockReason?{...a,enabled:G[a.id]}:W?{...a,enabled:G[a.id],locked:!1,lockReason:null,lockBadge:null,available:a.auth.configured&&!!a.gatewayBaseUrl}:{...a,enabled:G[a.id],locked:!0,lockReason:"dench_not_primary",lockBadge:"Use Dench Cloud",available:!1})}:null,[G,W,c]),Y=(0,e.useCallback)(async()=>{x(!0),B(null);try{let a=await fetch("/api/settings/cloud",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"save_active_settings",stableId:C,voiceId:E,integrations:G})}),c=await a.json();if(!a.ok)return void B({tone:"error",message:c.error??"Failed to save cloud settings."});b(c.state),c.integrationsState?(g(c.integrationsState),K(a=>a+1)):(async()=>{await M(),K(a=>a+1)})();let d=c.refresh;c.changed?d.restarted?B({tone:"success",message:`Cloud settings saved and the ${d.profile} gateway restarted successfully.`}):d.attempted?B({tone:"warning",message:`Cloud settings saved, but the gateway restart did not complete: ${d.error??"unknown error"}.`}):B({tone:"success",message:"Cloud settings saved successfully."}):B({tone:"success",message:"No changes to save."})}catch(a){B({tone:"error",message:a instanceof Error?a.message:"Failed to save cloud settings."})}finally{x(!1)}},[G,C,E,M]),Z=(0,e.useCallback)(async()=>{z(!0),B(null);try{let a=await fetch("/api/integrations/repair",{method:"POST"}),b=await a.json();if(!a.ok)throw Error(b.error??"Failed to repair integrations.");if(g(b),K(a=>a+1),b.changed&&b.refresh.restarted){let a=b.repairedIds.length>0?b.repairedIds.join(", "):"profiles";B({tone:"success",message:`Repair completed for ${a} and the ${b.refresh.profile} gateway restarted successfully.`})}else b.changed?B({tone:"warning",message:`Repair updated the profile, but the gateway restart did not complete: ${b.refresh.error??"unknown error"}.`}):B({tone:"success",message:"No repair changes were needed for this profile."})}catch(a){B({tone:"error",message:a instanceof Error?a.message:"Failed to repair integrations."})}finally{z(!1)}},[]);return j?(0,d.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,d.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}):q?(0,d.jsxs)("div",{className:"rounded-xl border px-4 py-6 text-center",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)("p",{className:"text-sm mb-3",style:{color:"var(--color-text-muted)"},children:q}),(0,d.jsx)(n.$,{type:"button",variant:"outline",onClick:()=>void L(),children:"Retry"})]}):a?"no_key"===a.status||"invalid_key"===a.status?(0,d.jsxs)("div",{className:"space-y-8",children:[(0,d.jsx)(am,{onSave:N,saving:u,notice:A,validationError:"invalid_key"===a.status?a.validationError:void 0}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-medium mb-3",style:{color:"var(--color-text)"},children:"Integrations"}),(0,d.jsx)(J,{})]})]}):(0,d.jsxs)("div",{className:"space-y-8",children:[(0,d.jsx)(an,{models:a.models,selectedModel:C,selectedVoiceId:E,elevenLabsEnabled:G.elevenlabs,isDenchPrimary:W,recommendedModelId:a.recommendedModelId,onSelect:O,onSelectVoice:P,selecting:w,savingVoice:w,voiceLoading:o,voices:h}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-medium mb-3",style:{color:"var(--color-text)"},children:"Integrations"}),(0,d.jsx)(J,{data:X,loading:l,error:s,savingId:null,repairing:y,excludeIntegrationIds:["apollo"],onToggle:Q,onRetry:()=>void M(),onRepair:()=>void Z()})]}),(0,d.jsx)(ai,{enrichmentIntegration:X?.integrations.find(a=>"apollo"===a.id)??null,onToggleEnrichment:Q}),(0,d.jsx)(_,{}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-2",children:[(0,d.jsx)(n.$,{type:"button",variant:"ghost",className:"shrink-0 rounded-lg px-4 text-sm font-medium",style:{color:"var(--color-text-muted)",background:"transparent"},onClick:R,disabled:!V||w,children:"Reset"}),(0,d.jsx)(n.$,{type:"button",className:"min-w-28 shrink-0 rounded-lg px-5 text-sm font-semibold",style:{background:"var(--color-accent)",color:"var(--color-bg)"},onClick:()=>void Y(),disabled:!V||w||l||!!s,children:(0,d.jsxs)("span",{className:"inline-flex items-center justify-center gap-2 leading-none",children:[w?(0,d.jsx)(f.default,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):null,(0,d.jsx)("span",{children:w?"Saving...":"Save"})]})})]})]}):null}},200261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},202514:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.uniqBy=function(a,b){let c=new Map;for(let d=0;d<a.length;d++){let e=a[d],f=b(e,d,a);c.has(f)||c.set(f,e)}return Array.from(c.values())}},206274:(a,b,c)=>{"use strict";c.d(b,{W:()=>t});var d=c(736927),e=c(115962),f=c(327629),g=c(970093);function h({logo:a,name:b,slug:c}){let[f,h]=(0,e.useState)(!1),i=(0,g.m9)({toolkitSlug:c,toolkitName:b,initialLogo:a}),j=i.logo&&!f;return(0,d.jsx)("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center overflow-hidden",style:{background:"var(--color-surface-hover)",borderRadius:"13px",boxShadow:"inset 0 0 0 0.5px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.06)"},children:j?(0,d.jsx)("img",{src:i.logo??void 0,alt:"",className:"h-7 w-7 object-contain",loading:"lazy",decoding:"async",onError:()=>h(!0)}):(0,d.jsx)("span",{className:"text-sm font-semibold uppercase",style:{color:"var(--color-text-muted)"},children:b.slice(0,2)})})}function i({toolkit:a,activeConnections:b,totalConnections:c,mode:e="marketplace",onClick:f}){let g=b>0;return(0,d.jsxs)("div",{className:"group rounded-2xl p-3.5 flex items-start gap-3.5 cursor-pointer transition-shadow duration-200 hover:shadow-md",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},onClick:f,role:"button",tabIndex:0,onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&f()},"aria-label":`${g?"Manage":"Get"} ${a.name}`,children:[(0,d.jsx)(h,{logo:a.logo,name:a.name,slug:a.slug}),(0,d.jsxs)("div",{className:"flex-1 min-w-0 pt-0.5",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("div",{className:"text-[13px] font-semibold truncate leading-tight",style:{color:"var(--color-text)"},children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 text-[11px]",children:[g&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:"font-medium",style:{color:"var(--color-success, #34C759)"},children:[b," account",1===b?"":"s"]}),(a.tools_count>0||"number"==typeof c&&c>b)&&(0,d.jsx)("span",{style:{color:"var(--color-text-muted)"},children:"\xb7"})]}),g&&"number"==typeof c&&c>b&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{style:{color:"var(--color-text-muted)"},children:[c," total"]}),a.tools_count>0&&(0,d.jsx)("span",{style:{color:"var(--color-text-muted)"},children:"\xb7"})]}),a.tools_count>0&&(0,d.jsxs)("span",{style:{color:"var(--color-text-muted)"},children:[a.tools_count," tool",1===a.tools_count?"":"s"]})]})]}),(0,d.jsx)("span",{className:"shrink-0 rounded-full px-3.5 py-1 text-[12px] font-bold mt-0.5",style:g?{background:"var(--color-surface-hover)",color:"var(--color-accent)"}:{background:"var(--color-accent)",color:"#fff"},children:g?"Connected":"Connect"})]}),a.description&&(0,d.jsx)("p",{className:"text-[11px] leading-relaxed line-clamp-2 mt-1.5",style:{color:"var(--color-text-muted)"},children:a.description})]})]})}var j=c(415182),k=c(843572),l=c(554327);let m=["gmail","slack","github","notion","google-calendar","linear","airtable","hubspot","salesforce","jira","asana","discord"];function n(){return(0,d.jsxs)("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--color-text-muted)"},children:[(0,d.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,d.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}let o=null,p="composio-connected-apps-snapshot";function q(a){let b=new Map;for(let c of a)b.set((0,k.Kr)(c.slug),c);return Array.from(b.values())}function r(){return o||(o=function(){try{let a=localStorage.getItem(p);if(!a)return null;let b=JSON.parse(a);if(Array.isArray(b?.connectedToolkits)&&Array.isArray(b?.connections))return b}catch{}return null}()),{connectedToolkits:o?.connectedToolkits??[],marketplaceToolkits:[],marketplaceCursor:null,connections:o?.connections??[],categories:[],loading:null===o,marketplaceLoading:!1,marketplaceReady:!1,loadingMore:!1,error:null,connectionsError:null}}function s({eligible:a,lockBadge:b}){let[c,g]=(0,e.useState)(r),[h,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(""),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(null),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)([]);(0,e.useRef)(!1);let J=(0,e.useRef)(""),K=(0,e.useRef)(null),L=(0,e.useCallback)(async a=>{let b=new URLSearchParams;a?.search&&b.set("search",a.search),a?.category&&b.set("category",a.category),a?.cursor&&b.set("cursor",a.cursor),a?.limit&&b.set("limit",String(a.limit));let c=b.toString(),d=await fetch(`/api/composio/toolkits${c?`?${c}`:""}`);if(!d.ok)throw Error((await d.json().catch(()=>({}))).error??`Failed to load apps (${d.status})`);return(0,k.O0)(await d.json())},[]),M=(0,e.useCallback)(async a=>{try{let b=a?await fetch("/api/composio/status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:a})}):await fetch("/api/composio/status");if(b.ok){C(await b.json()),E(null);return}C(null);let c=await b.json().catch(()=>({}));E(c.error??(0,l.J)("load",b.status))}catch(a){C(null),E(a instanceof Error?a.message:(0,l.J)("load"))}},[]),N=(0,e.useCallback)(async a=>{g(a=>({...a,loading:0===a.connectedToolkits.length&&0===a.connections.length,error:null,connectionsError:null})),E(null),L({limit:24}).then(a=>{let b=new Set(m),c=[...a.items.filter(a=>b.has(a.slug)).sort((a,b)=>m.indexOf(a.slug)-m.indexOf(b.slug)),...a.items.filter(a=>!b.has(a.slug))];g(b=>b.marketplaceReady?b:{...b,marketplaceToolkits:c,marketplaceCursor:a.cursor,categories:a.categories,marketplaceReady:!0,marketplaceLoading:!1}),J.current="::"}).catch(()=>{});try{let c=await fetch(`/api/composio/connections?include_toolkits=1${a?.fresh?"&fresh=1":""}`),d={items:[]},e=null;c.ok?d=await c.json():e=(await c.json().catch(()=>({}))).error??`Failed to load connections (${c.status})`;let f=(0,k.s$)(d),h=q(d.toolkits??[]).sort((a,b)=>a.name.localeCompare(b.name));var b=o={connectedToolkits:h,connections:f};try{localStorage.setItem(p,JSON.stringify(b))}catch{}I(a=>a.filter(a=>!h.some(b=>(0,k.Kr)(b.slug)===(0,k.Kr)(a.slug)))),g(a=>({...a,connectedToolkits:h,connections:f,loading:!1,error:null,connectionsError:e})),window.setTimeout(()=>{M()},0)}catch(a){C(null),g(b=>({...b,loading:!1,error:b.connectedToolkits.length>0||b.connections.length>0?b.error:a instanceof Error?a.message:"Failed to load apps.",connectionsError:a instanceof Error?a.message:"Failed to load connections."}))}},[M,L]),O=(0,e.useCallback)(async a=>{let b=a?.reset??!1,d=t.trim(),e=`${d.toLowerCase()}::${v??""}`,f=b&&c.marketplaceReady;b?(J.current=e,g(a=>({...a,marketplaceToolkits:f?a.marketplaceToolkits:[],marketplaceCursor:null,categories:f?a.categories:[],marketplaceLoading:!0,marketplaceReady:f,loadingMore:!1,error:null}))):g(a=>({...a,loadingMore:!0}));try{let a=b?null:c.marketplaceCursor,f=await L({search:d||void 0,category:v??void 0,cursor:a,limit:24});if(J.current!==e)return;g(a=>{let c=b?f.items:q([...a.marketplaceToolkits,...f.items]),e=new Set(m),g=d||v?c:[...c.filter(a=>e.has(a.slug)).sort((a,b)=>m.indexOf(a.slug)-m.indexOf(b.slug)),...c.filter(a=>!e.has(a.slug))];return{...a,marketplaceToolkits:g,marketplaceCursor:f.cursor,categories:f.categories,marketplaceLoading:!1,marketplaceReady:!0,loadingMore:!1,error:null}})}catch(a){if(J.current!==e)return;g(b=>({...b,marketplaceLoading:!1,marketplaceReady:!0,loadingMore:!1,error:a instanceof Error?a.message:"Failed to load apps."}))}},[v,t,L,c.marketplaceCursor,c.marketplaceReady]),P=(0,e.useMemo)(()=>(0,k.eF)(c.connections),[c.connections]),Q=(0,e.useMemo)(()=>{let a=new Map;for(let b of P){let c=a.get(b.normalized_toolkit_slug);c?c.push(b):a.set(b.normalized_toolkit_slug,[b])}return a},[P]),R=(0,e.useMemo)(()=>{let a=new Map;for(let[b,c]of Q){let d=c.filter(a=>a.is_active);d.length>0&&a.set(b,d)}return a},[Q]),S=(0,e.useMemo)(()=>{let a=new Map;for(let[b,c]of R){let d=new Map;for(let a of c)d.has(a.account_identity)||d.set(a.account_identity,a);a.set(b,Array.from(d.values()))}return a},[R]),T=(0,e.useMemo)(()=>new Set(H.map(a=>(0,k.Kr)(a.slug))),[H]),U=(0,e.useMemo)(()=>q([...c.connectedToolkits,...H]).filter(a=>{let b=(0,k.Kr)(a.slug);return S.has(b)||T.has(b)}),[S,H,T,c.connectedToolkits]),V=(0,e.useMemo)(()=>{let a=t.trim().toLowerCase();return c.marketplaceToolkits.filter(b=>{let c=(0,k.Kr)(b.slug);return!(S.has(c)||T.has(c))&&(!a||b.name.toLowerCase().includes(a)||b.slug.toLowerCase().includes(a)||b.description.toLowerCase().includes(a))})},[S,t,T,c.marketplaceToolkits]),W=(0,e.useMemo)(()=>c.categories.slice(0,6),[c.categories]),X=x?Q.get((0,k.Kr)(x.slug))??[]:null,Y=(0,e.useCallback)(a=>{y(a),A(!0)},[]),Z=(0,e.useCallback)(a=>{if(a?.toolkit&&!1===a.connected){let b=(0,k.Kr)(a.toolkit.slug);I(a=>a.filter(a=>(0,k.Kr)(a.slug)!==b))}if(a?.connected){let d=a.connectedToolkitSlug??a.toolkit?.slug??null,e=a.connectedToolkitName??a.toolkit?.name??null;if(d&&e){var b;let f=(0,k.Kr)(d),g=[a.toolkit,...c.connectedToolkits,...c.marketplaceToolkits].filter(a=>!!a).find(a=>(0,k.Kr)(a.slug)===f)??null,h=g?{...g,slug:f,name:e}:(b=a.toolkit?.connect_slug??d,{slug:(0,k.Kr)(f),connect_slug:b??f,name:e,description:"",logo:null,categories:[],auth_schemes:[],tools_count:0});I(a=>q([...a.filter(a=>(0,k.Kr)(a.slug)!==f),h]))}}N({fresh:!0}),a?.connected&&window.setTimeout(()=>{N({fresh:!0})},1500),a?.shouldProbeLiveAgent&&window.setTimeout(()=>{M("probe_live_agent")},300),O({reset:!0})},[N,M,O,c.connectedToolkits,c.marketplaceToolkits]),_=(0,e.useCallback)(async()=>{G(!0),E(null);try{let a=await fetch("/api/composio/status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"repair_mcp"})}),b=await a.json().catch(()=>({}));if(!a.ok)return void E(b.error??(0,l.J)("update"));C(b)}catch(a){E(a instanceof Error?a.message:(0,l.J)("update"))}finally{G(!1)}},[]);if(!a)return(0,d.jsx)("div",{children:(0,d.jsx)("div",{className:"flex items-center justify-center rounded-2xl px-6 py-10",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"Available with Dench Cloud"}),b&&(0,d.jsx)("span",{className:"mt-2 inline-flex items-center rounded-full px-3 py-1 text-[11px] font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text)",border:"1px solid var(--color-border)"},children:b})]})})});let aa=t.trim();return(0,d.jsxs)("div",{children:[(D||B&&"healthy"!==B.summary.level)&&(0,d.jsxs)("div",{className:"mb-6 flex items-start justify-between gap-3 rounded-xl px-3 py-2 text-xs",style:{background:"color-mix(in srgb, var(--color-error, #ef4444) 8%, transparent)",color:"var(--color-error, #ef4444)",border:"1px solid color-mix(in srgb, var(--color-error, #ef4444) 20%, transparent)"},children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate",children:D??B?.summary.message??l.F.attentionLabel}),!D&&B?.liveAgent.detail&&"healthy"!==B.summary.level&&(0,d.jsx)("p",{className:"mt-1 text-[11px] opacity-80",children:B.liveAgent.detail}),!D&&(B?.liveAgent.evidence?.length??0)>0&&(0,d.jsxs)("p",{className:"mt-1 truncate text-[11px] opacity-70",children:["Evidence: ",B?.liveAgent.evidence.slice(0,3).join(", ")]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>void _(),disabled:F,className:"shrink-0 rounded-lg px-2 py-1 text-[11px] font-medium cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--color-error, #ef4444) 15%, transparent)"},children:F?"Repairing...":"Repair"})]}),c.loading&&(0,d.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,d.jsx)("div",{className:"w-6 h-6 border-2 rounded-full animate-spin",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}),!c.loading&&c.error&&(0,d.jsxs)("div",{className:"p-8 text-center rounded-2xl",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:[(0,d.jsx)("p",{className:"text-sm mb-3",style:{color:"var(--color-text-muted)"},children:c.error}),(0,d.jsx)(f.$,{type:"button",variant:"outline",size:"sm",onClick:()=>void N(),children:"Retry"})]}),!c.loading&&!c.error&&(0,d.jsxs)(d.Fragment,{children:[U.length>0&&(0,d.jsxs)("section",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2.5 mb-4",children:[(0,d.jsx)("h2",{className:"text-lg font-bold tracking-tight",style:{color:"var(--color-text)"},children:"Your Apps"}),(0,d.jsx)("span",{className:"text-[11px] font-medium rounded-full px-2 py-0.5",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:U.length})]}),(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:U.map(a=>{let b=(0,k.Kr)(a.slug),c=S.get(b)??[],e=Q.get(b)?.length??0;return(0,d.jsx)(i,{toolkit:a,activeConnections:c.length,totalConnections:e,mode:"connected",onClick:()=>Y(a)},a.slug)})})]}),(0,d.jsxs)("section",{children:[(0,d.jsx)("h2",{className:"text-lg font-bold tracking-tight mb-4",style:{color:"var(--color-text)"},children:"Discover"}),(0,d.jsxs)("div",{className:"relative mb-4",children:[(0,d.jsx)(n,{}),(0,d.jsx)("input",{type:"text",value:h,onChange:a=>s(a.target.value),placeholder:"Search apps...",className:"w-full pl-9 pr-4 py-2.5 rounded-xl text-sm outline-none transition-shadow focus:shadow-[0_0_0_3px_rgba(0,122,255,0.12)]",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"}})]}),W.length>0&&(0,d.jsxs)("div",{className:"mb-4 flex flex-wrap gap-1.5",children:[(0,d.jsx)("button",{type:"button",onClick:()=>w(null),className:"rounded-full px-3 py-1 text-[11px] font-medium transition-colors cursor-pointer",style:{background:v?"var(--color-surface)":"var(--color-accent)",color:v?"var(--color-text-muted)":"var(--color-bg, #fff)",border:`1px solid ${!v?"var(--color-accent)":"var(--color-border)"}`},children:"All"}),W.map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>w(v===a?null:a),className:"rounded-full px-3 py-1 text-[11px] font-medium transition-colors cursor-pointer",style:{background:v===a?"var(--color-accent)":"var(--color-surface)",color:v===a?"var(--color-bg, #fff)":"var(--color-text-muted)",border:`1px solid ${v===a?"var(--color-accent)":"var(--color-border)"}`},children:a},a))]}),c.marketplaceLoading&&c.marketplaceReady&&(0,d.jsx)("div",{className:"mb-4 text-xs",style:{color:"var(--color-text-muted)"},children:"Searching..."}),!c.marketplaceReady&&!c.loading&&(0,d.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,d.jsx)("div",{className:"w-5 h-5 border-2 rounded-full animate-spin",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}),c.marketplaceReady&&V.length>0&&(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:V.map(a=>(0,d.jsx)(i,{toolkit:a,activeConnections:0,mode:"marketplace",onClick:()=>Y(a)},a.slug))}),c.marketplaceReady&&!c.marketplaceLoading&&0===V.length&&(0,d.jsxs)("div",{className:"p-8 text-center rounded-2xl",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)"},children:[(0,d.jsx)("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:aa?`No apps found for "${aa}".`:v?`No apps found in "${v}".`:"No apps found."}),(aa||v)&&(0,d.jsx)("p",{className:"mt-2 text-xs",style:{color:"var(--color-text-muted)"},children:"Try clearing search or category filters."})]}),(!!c.marketplaceCursor||c.loadingMore)&&(0,d.jsx)("div",{ref:K,className:"flex items-center justify-center py-6 text-xs",style:{color:"var(--color-text-muted)"},children:c.loadingMore?"Loading more apps...":"Scroll to load more"})]})]}),(0,d.jsx)(j.R,{toolkit:x,connections:X??[],open:z,onOpenChange:A,onConnectionChange:Z})]})}function t({embedded:a}={}){let[b,c]=(0,e.useState)(null),[g,h]=(0,e.useState)(!0),[i,j]=(0,e.useState)(null),k=(0,e.useCallback)(async()=>{h(!0),j(null);try{let a=await fetch("/api/integrations");if(!a.ok)throw Error(`Failed to load integrations (${a.status})`);let b=await a.json();c(b)}catch(a){j(a instanceof Error?a.message:"Failed to load integrations")}finally{h(!1)}},[]);return(0,d.jsxs)("div",{className:"",children:[!a&&(0,d.jsxs)("div",{className:"mb-6 flex items-start justify-between gap-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h1",{className:"font-instrument text-3xl tracking-tight",style:{color:"var(--color-text)"},children:"Integrations"}),(0,d.jsx)("p",{className:"mt-1 text-sm",style:{color:"var(--color-text-muted)"},children:"Connect third-party apps to your Dench Cloud workspace."})]}),(0,d.jsxs)("a",{className:"flex shrink-0 items-center gap-1.5 rounded-full px-3 py-1.5 text-[11px] font-medium transition-opacity hover:opacity-80",style:{background:"var(--color-surface)",border:"1px solid var(--color-border)",color:"var(--color-text-muted)"},children:["Powered by",(0,d.jsx)("img",{src:"/logo/composio.webp",alt:"Composio",className:"h-10 w-auto dark:invert"})]})]}),g&&(0,d.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,d.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}),!g&&i&&(0,d.jsxs)("div",{className:"rounded-xl border px-4 py-6 text-center",style:{borderColor:"var(--color-border)"},children:[(0,d.jsx)("p",{className:"text-sm mb-3",style:{color:"var(--color-text-muted)"},children:i}),(0,d.jsx)(f.$,{type:"button",variant:"outline",onClick:()=>void k(),children:"Retry"})]}),!g&&!i&&b&&(0,d.jsx)(s,{eligible:!!(b.denchCloud.hasKey&&b.denchCloud.isPrimaryProvider),lockBadge:b.denchCloud.hasKey?b.denchCloud.isPrimaryProvider?null:"Use Dench Cloud":"Get Dench Cloud API Key"})]})}},207346:(a,b,c)=>{"use strict";c.d(b,{k:()=>f});var d=c(286102),e=c(502714);function f(a,b){let{start:c,end:f}=(0,d.P)(b?.in,a),g=+c>+f,h=g?+c:+f,i=g?f:c;i.setHours(0,0,0,0);let j=b?.step??1;if(!j)return[];j<0&&(j=-j,g=!g);let k=[];for(;+i<=h;)k.push((0,e.w)(c,i)),i.setDate(i.getDate()+j),i.setHours(0,0,0,0);return g?k.reverse():k}},208732:a=>{"use strict";var b=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,c=/\n/g,d=/^\s*/,e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,f=/^:\s*/,g=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,h=/^[;\s]*/,i=/^\s+|\s+$/g;function j(a){return a?a.replace(i,""):""}a.exports=function(a,i){if("string"!=typeof a)throw TypeError("First argument must be a string");if(!a)return[];i=i||{};var k=1,l=1;function m(a){var b=a.match(c);b&&(k+=b.length);var d=a.lastIndexOf("\n");l=~d?a.length-d:l+a.length}function n(){var a={line:k,column:l};return function(b){return b.position=new o(a),q(d),b}}function o(a){this.start=a,this.end={line:k,column:l},this.source=i.source}function p(b){var c=Error(i.source+":"+k+":"+l+": "+b);if(c.reason=b,c.filename=i.source,c.line=k,c.column=l,c.source=a,i.silent);else throw c}function q(b){var c=b.exec(a);if(c){var d=c[0];return m(d),a=a.slice(d.length),c}}function r(a){var b;for(a=a||[];b=s();)!1!==b&&a.push(b);return a}function s(){var b=n();if("/"==a.charAt(0)&&"*"==a.charAt(1)){for(var c=2;""!=a.charAt(c)&&("*"!=a.charAt(c)||"/"!=a.charAt(c+1));)++c;if(c+=2,""===a.charAt(c-1))return p("End of comment missing");var d=a.slice(2,c-2);return l+=2,m(d),a=a.slice(c),l+=2,b({type:"comment",comment:d})}}o.prototype.content=a,q(d);var t,u=[];for(r(u);t=function(){var a=n(),c=q(e);if(c){if(s(),!q(f))return p("property missing ':'");var d=q(g),i=a({type:"declaration",property:j(c[0].replace(b,"")),value:d?j(d[0].replace(b,"")):""});return q(h),i}}();)!1!==t&&(u.push(t),r(u));return u}},210164:(a,b,c)=>{"use strict";c.d(b,{d:()=>e});let d={};function e(a,b){let c=b||d;return f(a,"boolean"!=typeof c.includeImageAlt||c.includeImageAlt,"boolean"!=typeof c.includeHtml||c.includeHtml)}function f(a,b,c){var d;if((d=a)&&"object"==typeof d){if("value"in a)return"html"!==a.type||c?a.value:"";if(b&&"alt"in a&&a.alt)return a.alt;if("children"in a)return g(a.children,b,c)}return Array.isArray(a)?g(a,b,c):""}function g(a,b,c){let d=[],e=-1;for(;++e<a.length;)d[e]=f(a[e],b,c);return d.join("")}},213203:(a,b,c)=>{"use strict";c.d(b,{F:()=>f,h:()=>g});var d=c(736927);let e=new Set(["xlsx","xls","xlsb","xlsm","xltx","xltm","ods","fods","csv","tsv","numbers"]);function f(a){let b=a.split(".").pop()?.toLowerCase()??"";return e.has(b)}function g(a){let{content:b,filename:c,type:e}=a,f=b.split("\n");return(0,d.jsxs)("div",{className:"max-w-4xl mx-auto px-6 py-8",children:[(0,d.jsx)(h,{filename:c,label:e.toUpperCase()}),(0,d.jsx)("div",{className:"rounded-b-lg border overflow-x-auto",style:{background:"var(--color-bg)",borderColor:"var(--color-border)"},children:(0,d.jsx)("pre",{className:"text-sm leading-6",style:{margin:0},children:(0,d.jsx)("code",{children:f.map((a,b)=>(0,d.jsxs)("div",{className:"flex hover:bg-[var(--color-surface-hover)] transition-colors duration-75",children:[(0,d.jsx)("span",{className:"select-none text-right pr-4 pl-4 flex-shrink-0 tabular-nums",style:{color:"var(--color-text-muted)",opacity:.5,minWidth:"3rem",userSelect:"none"},children:b+1}),(0,d.jsx)("span",{className:"pr-4 flex-1",style:{color:"var(--color-text)"},children:"yaml"===e?(0,d.jsx)(i,{line:a}):a||" "})]},b))})})})]})}function h({filename:a,label:b,icon:c}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2.5 rounded-t-lg border border-b-0",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:[c??(0,d.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--color-text-muted)"},children:[(0,d.jsx)("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),(0,d.jsx)("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})]}),(0,d.jsx)("span",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:a}),(0,d.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded ml-auto",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:b})]})}function i({line:a}){if(a.trim().startsWith("#"))return(0,d.jsx)("span",{style:{color:"var(--color-text-muted)"},children:a});let b=a.match(/^(\s*)([\w][\w_-]*)\s*(:)(.*)/);if(b){let[,a,c,e,f]=b;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{children:a}),(0,d.jsx)("span",{style:{color:"#60a5fa"},children:c}),(0,d.jsx)("span",{style:{color:"var(--color-text-muted)"},children:e}),(0,d.jsx)(j,{value:f})]})}let c=a.match(/^(\s*)(-)(\s*)(.*)/);if(c){let[,a,b,e,f]=c;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{children:a}),(0,d.jsx)("span",{style:{color:"var(--color-accent)"},children:b}),(0,d.jsx)("span",{children:e}),(0,d.jsx)("span",{style:{color:"var(--color-text)"},children:f})]})}return(0,d.jsx)("span",{children:a||" "})}function j({value:a}){let b=a.trim();return b.startsWith('"')&&b.endsWith('"')||b.startsWith("'")&&b.endsWith("'")?(0,d.jsxs)("span",{style:{color:"#a5d6a7"},children:[" ",b]}):"true"===b||"false"===b?(0,d.jsxs)("span",{style:{color:"#f59e0b"},children:[" ",b]}):/^-?\d+(\.\d+)?$/.test(b)?(0,d.jsxs)("span",{style:{color:"#c084fc"},children:[" ",b]}):"null"===b?(0,d.jsxs)("span",{style:{color:"var(--color-text-muted)",fontStyle:"italic"},children:[" ",b]}):(0,d.jsxs)("span",{style:{color:"var(--color-text)"},children:[" ",a]})}},215071:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],f=(0,d.A)("loader-circle",e)},215750:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(439384),e=c(958961),f=c(882351);function g(a,b,c,j){if(b===a)return!0;switch(typeof b){case"object":return function(a,b,c,d){if(null==b)return!0;if(Array.isArray(b))return h(a,b,c,d);if(b instanceof Map){var f=a,g=b,j=c,k=d;if(0===g.size)return!0;if(!(f instanceof Map))return!1;for(let[a,b]of g.entries())if(!1===j(f.get(a),b,a,f,g,k))return!1;return!0}if(b instanceof Set)return i(a,b,c,d);let l=Object.keys(b);if(null==a||e.isPrimitive(a))return 0===l.length;if(0===l.length)return!0;if(d?.has(b))return d.get(b)===a;d?.set(b,a);try{for(let f=0;f<l.length;f++){let g=l[f];if(!e.isPrimitive(a)&&!(g in a)||void 0===b[g]&&void 0!==a[g]||null===b[g]&&null!==a[g]||!c(a[g],b[g],g,a,b,d))return!1}return!0}finally{d?.delete(b)}}(a,b,c,j);case"function":if(Object.keys(b).length>0)return g(a,{...b},c,j);return f.isEqualsSameValueZero(a,b);default:if(!d.isObject(a))return f.isEqualsSameValueZero(a,b);if("string"==typeof b)return""===b;return!0}}function h(a,b,c,d){if(0===b.length)return!0;if(!Array.isArray(a))return!1;let e=new Set;for(let f=0;f<b.length;f++){let g=b[f],h=!1;for(let i=0;i<a.length;i++){if(e.has(i))continue;let j=a[i],k=!1;if(c(j,g,f,a,b,d)&&(k=!0),k){e.add(i),h=!0;break}}if(!h)return!1}return!0}function i(a,b,c,d){return 0===b.size||a instanceof Set&&h([...a],[...b],c,d)}b.isMatchWith=function a(b,c,d){return"function"!=typeof d?a(b,c,()=>void 0):g(b,c,function a(b,c,e,f,h,i){let j=d(b,c,e,f,h,i);return void 0!==j?!!j:g(b,c,a,i)},new Map)},b.isSetMatch=i},226713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},227443:function(a,b,c){"use strict";var d=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(b,"__esModule",{value:!0}),b.default=function(a,b){let c=null;if(!a||"string"!=typeof a)return c;let d=(0,e.default)(a),f="function"==typeof b;return d.forEach(a=>{if("declaration"!==a.type)return;let{property:d,value:e}=a;f?b(d,e,a):e&&((c=c||{})[d]=e)}),c};let e=d(c(208732))},228123:(a,b,c)=>{let d=c(512089),{FormulaHelpers:e,Types:f,Factorials:g,Criteria:h}=c(828358),{Infix:i}=c(341790),j=[],k=[];function l(a){return a<=100?g[a]:j[a]>0?j[a]:j[a]=l(a-1)*a}let m={ABS:a=>Math.abs(a=e.accept(a,f.NUMBER)),AGGREGATE:(a,b,c,...d)=>{},ARABIC:a=>{if(a=e.accept(a,f.STRING).toUpperCase(),!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(a))throw new d("#VALUE!","Invalid roman numeral in ARABIC evaluation.");let b=0;return a.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g,function(a){b+=({M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1})[a]}),b},BASE:(a,b,c)=>{if((a=e.accept(a,f.NUMBER))<0||a>=0x20000000000000||(b=e.accept(b,f.NUMBER))<2||b>36||(c=e.accept(c,f.NUMBER,0))<0)throw d.NUM;let g=a.toString(b).toUpperCase();return Array(Math.max(c+1-g.length,0)).join("0")+g},CEILING:(a,b)=>{if(a=e.accept(a,f.NUMBER),0===(b=e.accept(b,f.NUMBER)))return 0;if(a/b%1==0)return a;let c=Math.abs(b),d=Math.floor(Math.abs(a)/c);return a<0?b<0?-c*(d+1):-c*d:(d+1)*c},"CEILING.MATH":(a,b,c)=>{if(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER,a>0?1:-1),c=e.accept(c,f.NUMBER,0),a>=0)return m.CEILING(a,b);let d=c?b:0;return m.CEILING(a,b)-d},"CEILING.PRECISE":(a,b)=>(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER,1),m.CEILING(a,Math.abs(b))),COMBIN:(a,b)=>{if(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER),a<0||b<0||a<b)throw d.NUM;return m.FACT(a)/m.FACT(b)/m.FACT(a-b)},COMBINA:(a,b)=>{if(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER),(0===a||1===a)&&0===b)return 1;if(a<0||b<0)throw d.NUM;return m.COMBIN(a+b-1,a-1)},DECIMAL:(a,b)=>{if(a=e.accept(a,f.STRING),(b=Math.trunc(b=e.accept(b,f.NUMBER)))<2||b>36)throw d.NUM;let c=parseInt(a,b);if(isNaN(c))throw d.NUM;return c},DEGREES:a=>180/Math.PI*(a=e.accept(a,f.NUMBER)),EVEN:a=>m.CEILING(a,-2),EXP:a=>Math.exp(a=e.accept(a,f.NUMBER)),FACT:a=>{if((a=Math.trunc(a=e.accept(a,f.NUMBER)))>170||a<0)throw d.NUM;return a<=100?g[a]:l(a)},FACTDOUBLE:a=>{if((a=Math.trunc(a=e.accept(a,f.NUMBER)))<-1)throw d.NUM;return -1===a?1:function a(b){return 1===b||0===b?1:2===b?2:k[b]>0?k[b]:k[b]=a(b-2)*b}(a)},FLOOR:(a,b)=>{if(a=e.accept(a,f.NUMBER),0===(b=e.accept(b,f.NUMBER)))return 0;if(a>0&&b<0)throw d.NUM;if(a/b%1==0)return a;let c=Math.abs(b),g=Math.floor(Math.abs(a)/c);return a<0?b<0?-c*g:-c*(g+1):g*c},"FLOOR.MATH":(a,b,c)=>(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER,a>0?1:-1),0===(c=e.accept(c,f.NUMBER,0))||a>=0)?m.FLOOR(a,Math.abs(b)):m.FLOOR(a,b)+b,"FLOOR.PRECISE":(a,b)=>(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER,1),m.FLOOR(a,Math.abs(b))),GCD:(...a)=>{let b=[];e.flattenParams(a,null,!1,a=>{if(isNaN(a="boolean"==typeof a?NaN:Number(a)))throw d.VALUE;if(a<0||a>0x1ffffffffffffe)throw d.NUM;b.push(Math.trunc(a))},0);let c,f,g=a.length,h=Math.abs(b[0]);for(c=1;c<g;c++){for(f=Math.abs(b[c]);h&&f;)h>f?h%=f:f%=h;h+=f}return h},INT:a=>Math.floor(a=e.accept(a,f.NUMBER)),"ISO.CEILING":(...a)=>m["CEILING.PRECISE"](...a),LCM:(...a)=>{let b=[];e.flattenParams(a,null,!1,a=>{if(isNaN(a="boolean"==typeof a?NaN:Number(a)))throw d.VALUE;if(a<0||a>0x1ffffffffffffe)throw d.NUM;b.push(Math.trunc(a))},1);let c=b.length,f=Math.abs(b[0]);for(let a=1;a<c;a++){let c=Math.abs(b[a]),d=f;for(;f&&c;)f>c?f%=c:c%=f;f=Math.abs(d*b[a])/(f+c)}return f},LN:a=>Math.log(a=e.accept(a,f.NUMBER)),LOG:(a,b)=>Math.log(a=e.accept(a,f.NUMBER))/Math.log(b=e.accept(b,f.NUMBER,10)),LOG10:a=>Math.log10(a=e.accept(a,f.NUMBER)),MDETERM:a=>{if((a=e.accept(a,f.ARRAY,void 0,!1,!0))[0].length!==a.length)throw d.VALUE;let b=a.length,c=a[0].length,g=0,h,i;if(1===b)return a[0][0];if(2===b)return a[0][0]*a[1][1]-a[0][1]*a[1][0];for(let d=0;d<c;d++){h=a[0][d],i=a[0][d];for(let e=1;e<b;e++)i*=a[e][((d+e)%c+c)%c],h*=a[e][((d-e)%c+c)%c];g+=i-h}return g},MINVERSE:a=>{},MMULT:(a,b)=>{a=e.accept(a,f.ARRAY,void 0,!1,!0),b=e.accept(b,f.ARRAY,void 0,!1,!0);let c=a.length,g=a[0].length,h=b.length,i=b[0].length,j=Array(c);if(g!==h)throw d.VALUE;for(let e=0;e<c;e++){j[e]=Array(i);for(let c=0;c<i;c++){j[e][c]=0;for(let f=0;f<g;f++){let g=a[e][f],h=b[f][c];if("number"!=typeof g||"number"!=typeof h)throw d.VALUE;j[e][c]+=a[e][f]*b[f][c]}}}return j},MOD:(a,b)=>{if(a=e.accept(a,f.NUMBER),0===(b=e.accept(b,f.NUMBER)))throw d.DIV0;return a-b*m.INT(a/b)},MROUND:(a,b)=>{if(a=e.accept(a,f.NUMBER),0===(b=e.accept(b,f.NUMBER)))return 0;if(a>0&&b<0||a<0&&b>0)throw d.NUM;return a/b%1==0?a:Math.round(a/b)*b},MULTINOMIAL:(...a)=>{let b=0,c=1;return e.flattenParams(a,f.NUMBER,!1,a=>{if(a<0)throw d.NUM;b+=a,c*=l(a)}),l(b)/c},MUNIT:a=>{a=e.accept(a,f.NUMBER);let b=[];for(let c=0;c<a;c++){let d=[];for(let b=0;b<a;b++)c===b?d.push(1):d.push(0);b.push(d)}return b},ODD:a=>{if(0===(a=e.accept(a,f.NUMBER)))return 1;let b=Math.ceil(Math.abs(a));return b=1&b?b:b+1,a>0?b:-b},PI:()=>Math.PI,POWER:(a,b)=>(a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER),a**b),PRODUCT:(...a)=>{let b=1;return e.flattenParams(a,null,!0,(a,c)=>{let d=Number(a);c.isLiteral&&!isNaN(d)?b*=d:"number"==typeof a&&(b*=a)},1),b},QUOTIENT:(a,b)=>Math.trunc((a=e.accept(a,f.NUMBER))/(b=e.accept(b,f.NUMBER))),RADIANS:a=>(a=e.accept(a,f.NUMBER))/180*Math.PI,RAND:()=>Math.random(),RANDBETWEEN:(a,b)=>(a=e.accept(a,f.NUMBER),Math.floor(Math.random()*((b=e.accept(b,f.NUMBER))-a+1)+a)),ROMAN:(a,b)=>{if(a=e.accept(a,f.NUMBER),0!==(b=e.accept(b,f.NUMBER,0)))throw Error("ROMAN: only allows form=0 (classic form).");let c=String(a).split(""),d=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"],g="",h=3;for(;h--;)g=(d[+c.pop()+10*h]||"")+g;return Array(+c.join("")+1).join("M")+g},ROUND:(a,b)=>{a=e.accept(a,f.NUMBER);let c=Math.pow(10,Math.abs(b=e.accept(b,f.NUMBER))),d=a>0?1:-1;return b>0?d*Math.round(Math.abs(a)*c)/c:0===b?d*Math.round(Math.abs(a)):d*Math.round(Math.abs(a)/c)*c},ROUNDDOWN:(a,b)=>{a=e.accept(a,f.NUMBER);let c=Math.pow(10,Math.abs(b=e.accept(b,f.NUMBER))),d=a>0?1:-1;return b>0?d*Math.round((Math.abs(a)-1/c*.5)*c)/c:0===b?d*Math.round(Math.abs(a)-.5):d*Math.round((Math.abs(a)-.5*c)/c)*c},ROUNDUP:(a,b)=>{a=e.accept(a,f.NUMBER);let c=Math.pow(10,Math.abs(b=e.accept(b,f.NUMBER))),d=a>0?1:-1;return b>0?d*Math.round((Math.abs(a)+1/c*.5)*c)/c:0===b?d*Math.round(Math.abs(a)+.5):d*Math.round((Math.abs(a)+.5*c)/c)*c},SERIESSUM:(a,b,c,g)=>{a=e.accept(a,f.NUMBER),b=e.accept(b,f.NUMBER),c=e.accept(c,f.NUMBER);let h=0,i;return e.flattenParams([g],f.NUMBER,!1,e=>{if("number"!=typeof e)throw d.VALUE;0===h?i=e*Math.pow(a,b):i+=e*Math.pow(a,b+h*c),h++}),i},SIGN:a=>(a=e.accept(a,f.NUMBER))>0?1:0===a?0:-1,SQRT:a=>{if((a=e.accept(a,f.NUMBER))<0)throw d.NUM;return Math.sqrt(a)},SQRTPI:a=>{if((a=e.accept(a,f.NUMBER))<0)throw d.NUM;return Math.sqrt(a*Math.PI)},SUBTOTAL:()=>{},SUM:(...a)=>{let b=0;return e.flattenParams(a,f.NUMBER,!0,(a,c)=>{c.isLiteral?b+=a:"number"==typeof a&&(b+=a)}),b},SUMIF:(a,b,c,d)=>{let f=e.retrieveRanges(a,b,d);b=f[0],d=f[1];let g=(c=e.retrieveArg(a,c)).isArray;c=h.parse(e.accept(c));let j=0;return b.forEach((a,b)=>{a.forEach((a,e)=>{let f=d[b][e];"number"==typeof f&&("wc"===c.op?c.match===c.value.test(a)&&(j+=f):i.compareOp(a,c.op,c.value,Array.isArray(a),g)&&(j+=f))})}),j},SUMIFS:()=>{},SUMPRODUCT:(a,...b)=>{a=e.accept(a,f.ARRAY,void 0,!1,!0),b.forEach(b=>{if(b=e.accept(b,f.ARRAY,void 0,!1,!0),a[0].length!==b[0].length||a.length!==b.length)throw d.VALUE;for(let c=0;c<a.length;c++)for(let d=0;d<a[0].length;d++)"number"!=typeof a[c][d]&&(a[c][d]=0),"number"!=typeof b[c][d]&&(b[c][d]=0),a[c][d]*=b[c][d]});let c=0;return a.forEach(a=>{a.forEach(a=>{c+=a})}),c},SUMSQ:(...a)=>{let b=0;return e.flattenParams(a,f.NUMBER,!0,(a,c)=>{c.isLiteral?b+=a**2:"number"==typeof a&&(b+=a**2)}),b},SUMX2MY2:(a,b)=>{let c=[],f=[],g=0;if(e.flattenParams([a],null,!1,(a,b)=>{c.push(a)}),e.flattenParams([b],null,!1,(a,b)=>{f.push(a)}),c.length!==f.length)throw d.NA;for(let a=0;a<c.length;a++)"number"==typeof c[a]&&"number"==typeof f[a]&&(g+=c[a]**2-f[a]**2);return g},SUMX2PY2:(a,b)=>{let c=[],f=[],g=0;if(e.flattenParams([a],null,!1,(a,b)=>{c.push(a)}),e.flattenParams([b],null,!1,(a,b)=>{f.push(a)}),c.length!==f.length)throw d.NA;for(let a=0;a<c.length;a++)"number"==typeof c[a]&&"number"==typeof f[a]&&(g+=c[a]**2+f[a]**2);return g},SUMXMY2:(a,b)=>{let c=[],f=[],g=0;if(e.flattenParams([a],null,!1,(a,b)=>{c.push(a)}),e.flattenParams([b],null,!1,(a,b)=>{f.push(a)}),c.length!==f.length)throw d.NA;for(let a=0;a<c.length;a++)"number"==typeof c[a]&&"number"==typeof f[a]&&(g+=(c[a]-f[a])**2);return g},TRUNC:a=>Math.trunc(a=e.accept(a,f.NUMBER))};a.exports=m},228760:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{a:()=>i});var e=c(736927),f=c(115962),g=c(278908),h=a([g]);g=(h.then?(await h)():h)[0];function i({filename:a,rawUrl:b,contentUrl:c}){let[d,g]=(0,f.useState)("rendered"),[h,i]=(0,f.useState)(null),[p,q]=(0,f.useState)(!1),r=(0,f.useCallback)(()=>{g("code"),null===h&&(q(!0),fetch(c).then(a=>a.json()).then(a=>i(a.content)).catch(()=>i("\x3c!-- Failed to load source --\x3e")).finally(()=>q(!1)))},[c,h]);return(0,e.jsxs)("div",{className:"flex flex-col h-full",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 px-5 py-3 border-b flex-shrink-0",style:{borderColor:"var(--color-border)"},children:[(0,e.jsx)(l,{}),(0,e.jsx)("span",{className:"text-sm font-medium truncate",style:{color:"var(--color-text)"},children:a}),(0,e.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full flex-shrink-0",style:{background:"#f9731618",color:"#f97316",border:"1px solid #f9731630"},children:"HTML"}),(0,e.jsxs)("div",{className:"flex items-center ml-auto rounded-lg p-0.5",style:{background:"var(--color-surface-hover)"},children:[(0,e.jsxs)("button",{type:"button",onClick:()=>g("rendered"),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors duration-100 cursor-pointer",style:{background:"rendered"===d?"var(--color-surface)":"transparent",color:"rendered"===d?"var(--color-text)":"var(--color-text-muted)",boxShadow:"rendered"===d?"0 1px 2px rgba(0,0,0,0.1)":"none"},children:[(0,e.jsx)(m,{}),"Preview"]}),(0,e.jsxs)("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors duration-100 cursor-pointer",style:{background:"code"===d?"var(--color-surface)":"transparent",color:"code"===d?"var(--color-text)":"var(--color-text-muted)",boxShadow:"code"===d?"0 1px 2px rgba(0,0,0,0.1)":"none"},children:[(0,e.jsx)(n,{}),"Code"]})]}),(0,e.jsx)("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-md transition-colors duration-100",style:{color:"var(--color-text-muted)"},title:"Open in new tab",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,e.jsx)(o,{})})]}),"rendered"===d?(0,e.jsx)(j,{rawUrl:b}):p||null===h?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsx)("div",{className:"w-6 h-6 border-2 rounded-full animate-spin",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}})}):(0,e.jsx)(k,{content:h})]})}function j({rawUrl:a}){return(0,e.jsx)("div",{className:"flex-1 overflow-hidden",style:{background:"white"},children:(0,e.jsx)("iframe",{src:a,className:"w-full h-full border-0",sandbox:"allow-same-origin allow-scripts allow-popups",title:"HTML preview",style:{minHeight:"calc(100vh - 120px)"}})})}function k({content:a}){let[b,c]=(0,f.useState)(null),d=(0,f.useMemo)(()=>a.split("\n").length,[a]);return(0,e.jsx)("div",{className:"flex-1 overflow-auto",style:{background:"var(--color-surface)"},children:(0,e.jsxs)("div",{className:"max-w-4xl mx-auto px-6 py-8",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2.5 rounded-t-lg border border-b-0",style:{background:"var(--color-surface)",borderColor:"var(--color-border)"},children:[(0,e.jsx)(n,{}),(0,e.jsx)("span",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:"HTML"}),(0,e.jsxs)("span",{className:"text-xs ml-auto",style:{color:"var(--color-text-muted)"},children:[d," lines"]})]}),(0,e.jsx)("div",{className:"code-viewer-content rounded-b-lg border overflow-x-auto",style:{background:"var(--color-bg)",borderColor:"var(--color-border)"},children:b?(0,e.jsx)("div",{className:"code-viewer-highlighted",dangerouslySetInnerHTML:{__html:b}}):(0,e.jsx)("pre",{className:"text-sm leading-6",style:{margin:0},children:(0,e.jsx)("code",{children:a.split("\n").map((a,b)=>(0,e.jsxs)("div",{className:"flex hover:bg-[var(--color-surface-hover)] transition-colors duration-75",children:[(0,e.jsx)("span",{className:"select-none text-right pr-4 pl-4 flex-shrink-0 tabular-nums",style:{color:"var(--color-text-muted)",opacity:.5,minWidth:"3rem",userSelect:"none"},children:b+1}),(0,e.jsx)("span",{className:"pr-4 flex-1",style:{color:"var(--color-text)"},children:a||" "})]},b))})})})]})})}function l(){return(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#f97316",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,e.jsx)("polyline",{points:"8 6 2 12 8 18"}),(0,e.jsx)("line",{x1:"12",x2:"10",y1:"2",y2:"22"})]})}function m(){return(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}function n(){return(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,e.jsx)("polyline",{points:"8 6 2 12 8 18"})]})}function o(){return(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("path",{d:"M15 3h6v6"}),(0,e.jsx)("path",{d:"M10 14 21 3"}),(0,e.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}d()}catch(a){d(a)}})},236705:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__iconNode:()=>e,default:()=>f});var d=c(863928);let e=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],f=(0,d.A)("shield-check",e)},236747:(a,b,c)=>{"use strict";c.d(b,{Ch:()=>X});var d=c(736927),e=c(115962);function f(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function g(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function h(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?g(Object(c),!0).forEach(function(b){var d;d=c[b],b in a?Object.defineProperty(a,b,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[b]=d}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):g(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}function i(a){return function b(){for(var c=this,d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return e.length>=a.length?a.apply(this,e):function(){for(var a=arguments.length,d=Array(a),f=0;f<a;f++)d[f]=arguments[f];return b.apply(c,[].concat(e,d))}}}function j(a){return({}).toString.call(a).includes("Object")}function k(a){return"function"==typeof a}var l=i(function(a,b){throw Error(a[b]||a.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),m={changes:function(a,b){return j(b)||l("changeType"),Object.keys(b).some(function(b){return!Object.prototype.hasOwnProperty.call(a,b)})&&l("changeField"),b},selector:function(a){k(a)||l("selectorType")},handler:function(a){k(a)||j(a)||l("handlerType"),j(a)&&Object.values(a).some(function(a){return!k(a)})&&l("handlersType")},initial:function(a){a||l("initialIsRequired"),j(a)||l("initialType"),Object.keys(a).length||l("initialContent")}};function n(a,b){return k(b)?b(a.current):b}function o(a,b){return a.current=h(h({},a.current),b),b}function p(a,b,c){return k(b)?b(a.current):Object.keys(c).forEach(function(c){var d;return null==(d=b[c])?void 0:d.call(b,a.current[c])}),c}var q={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},r=(function(a){return function b(){for(var c=this,d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return e.length>=a.length?a.apply(this,e):function(){for(var a=arguments.length,d=Array(a),f=0;f<a;f++)d[f]=arguments[f];return b.apply(c,[].concat(e,d))}}})(function(a,b){throw Error(a[b]||a.default)})(q),s=function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return function(a){return b.reduceRight(function(a,b){return b(a)},a)}},t={type:"cancelation",msg:"operation is manually canceled"};function u(a){var b=!1,c=new Promise(function(c,d){a.then(function(a){return b?d(t):c(a)}),a.catch(d)});return c.cancel=function(){return b=!0},c}var v=function(a,b){return function(a){if(Array.isArray(a))return a}(a)||function(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=c){var d,e,f,g,h=[],i=!0,j=!1;try{f=(c=c.call(a)).next,!1;for(;!(i=(d=f.call(c)).done)&&(h.push(d.value),h.length!==b);i=!0);}catch(a){j=!0,e=a}finally{try{if(!i&&null!=c.return&&(g=c.return(),Object(g)!==g))return}finally{if(j)throw e}}return h}}(a,2)||function(a,b){if(a){if("string"==typeof a)return f(a,b);var c=({}).toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?f(a,b):void 0}}(a,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(({create:function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m.initial(a),m.handler(b);var c={current:a},d=i(p)(c,b),e=i(o)(c),f=i(m.changes)(a),g=i(n)(c);return[function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(a){return a};return m.selector(a),a(c.current)},function(a){(function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return function(a){return b.reduceRight(function(a,b){return b(a)},a)}})(d,e,f,g)(a)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),2),w=v[0],x=v[1];function y(a){return document.body.appendChild(a)}function z(a){var b,c,d=w(function(a){return{config:a.config,reject:a.reject}}),e=(b="".concat(d.config.paths.vs,"/loader.js"),c=document.createElement("script"),b&&(c.src=b),c);return e.onload=function(){return a()},e.onerror=d.reject,e}function A(){var a=w(function(a){return{config:a.config,resolve:a.resolve,reject:a.reject}}),b=window.require;b.config(a.config),b(["vs/editor/editor.main"],function(b){var c=b.m||b;B(c),a.resolve(c)},function(b){a.reject(b)})}function B(a){w().monaco||x({monaco:a})}var C=new Promise(function(a,b){return x({resolve:a,reject:b})}),D={init:function(){var a=w(function(a){return{monaco:a.monaco,isInitialized:a.isInitialized,resolve:a.resolve}});if(!a.isInitialized){if(x({isInitialized:!0}),a.monaco)return a.resolve(a.monaco),u(C);if(window.monaco&&window.monaco.editor)return B(window.monaco),a.resolve(window.monaco),u(C);s(y,z)(A)}return u(C)}},E={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},F={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},G=function({children:a}){return e.createElement("div",{style:F.container},a)},H=(0,e.memo)(function({width:a,height:b,isEditorReady:c,loading:d,_ref:f,className:g,wrapperProps:h}){return e.createElement("section",{style:{...E.wrapper,width:a,height:b},...h},!c&&e.createElement(G,null,d),e.createElement("div",{ref:f,style:{...E.fullWidth,...!c&&E.hide},className:g}))}),I=function(a){(0,e.useEffect)(a,[])},J=function(a,b,c=!0){let d=(0,e.useRef)(!0);(0,e.useEffect)(d.current||!c?()=>{d.current=!1}:a,b)};function K(){}function L(a,b,c,d){var e,f,g,h,i,j;return e=a,f=d,e.editor.getModel(M(e,f))||(g=a,h=b,i=c,j=d,g.editor.createModel(h,i,j?M(g,j):void 0))}function M(a,b){return a.Uri.parse(b)}(0,e.memo)(function({original:a,modified:b,language:c,originalLanguage:d,modifiedLanguage:f,originalModelPath:g,modifiedModelPath:h,keepCurrentOriginalModel:i=!1,keepCurrentModifiedModel:j=!1,theme:k="light",loading:l="Loading...",options:m={},height:n="100%",width:o="100%",className:p,wrapperProps:q={},beforeMount:r=K,onMount:s=K}){let[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!0),x=(0,e.useRef)(null),y=(0,e.useRef)(null),z=(0,e.useRef)(null),A=(0,e.useRef)(s),B=(0,e.useRef)(r),C=(0,e.useRef)(!1);I(()=>{let a=D.init();return a.then(a=>(y.current=a)&&w(!1)).catch(a=>a?.type!=="cancelation"&&console.error("Monaco initialization: error:",a)),()=>{let b;return x.current?(b=x.current?.getModel(),void(i||b?.original?.dispose(),j||b?.modified?.dispose(),x.current?.dispose())):a.cancel()}}),J(()=>{if(x.current&&y.current){let b=x.current.getOriginalEditor(),e=L(y.current,a||"",d||c||"text",g||"");e!==b.getModel()&&b.setModel(e)}},[g],t),J(()=>{if(x.current&&y.current){let a=x.current.getModifiedEditor(),d=L(y.current,b||"",f||c||"text",h||"");d!==a.getModel()&&a.setModel(d)}},[h],t),J(()=>{let a=x.current.getModifiedEditor();a.getOption(y.current.editor.EditorOption.readOnly)?a.setValue(b||""):b!==a.getValue()&&(a.executeEdits("",[{range:a.getModel().getFullModelRange(),text:b||"",forceMoveMarkers:!0}]),a.pushUndoStop())},[b],t),J(()=>{x.current?.getModel()?.original.setValue(a||"")},[a],t),J(()=>{let{original:a,modified:b}=x.current.getModel();y.current.editor.setModelLanguage(a,d||c||"text"),y.current.editor.setModelLanguage(b,f||c||"text")},[c,d,f],t),J(()=>{y.current?.editor.setTheme(k)},[k],t),J(()=>{x.current?.updateOptions(m)},[m],t);let E=(0,e.useCallback)(()=>{if(!y.current)return;B.current(y.current);let e=L(y.current,a||"",d||c||"text",g||""),i=L(y.current,b||"",f||c||"text",h||"");x.current?.setModel({original:e,modified:i})},[c,b,f,a,d,g,h]),F=(0,e.useCallback)(()=>{!C.current&&z.current&&(x.current=y.current.editor.createDiffEditor(z.current,{automaticLayout:!0,...m}),E(),y.current?.editor.setTheme(k),u(!0),C.current=!0)},[m,k,E]);return(0,e.useEffect)(()=>{t&&A.current(x.current,y.current)},[t]),(0,e.useEffect)(()=>{v||t||F()},[v,t,F]),e.createElement(H,{width:o,height:n,isEditorReady:t,loading:l,_ref:z,className:p,wrapperProps:q})});var N=function(a){let b=(0,e.useRef)();return(0,e.useEffect)(()=>{b.current=a},[a]),b.current},O=new Map,P=(0,e.memo)(function({defaultValue:a,defaultLanguage:b,defaultPath:c,value:d,language:f,path:g,theme:h="light",line:i,loading:j="Loading...",options:k={},overrideServices:l={},saveViewState:m=!0,keepCurrentModel:n=!1,width:o="100%",height:p="100%",className:q,wrapperProps:r={},beforeMount:s=K,onMount:t=K,onChange:u,onValidate:v=K}){let[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!0),A=(0,e.useRef)(null),B=(0,e.useRef)(null),C=(0,e.useRef)(null),E=(0,e.useRef)(t),F=(0,e.useRef)(s),G=(0,e.useRef)(),M=(0,e.useRef)(d),P=N(g),Q=(0,e.useRef)(!1),R=(0,e.useRef)(!1);I(()=>{let a=D.init();return a.then(a=>(A.current=a)&&z(!1)).catch(a=>a?.type!=="cancelation"&&console.error("Monaco initialization: error:",a)),()=>B.current?void(G.current?.dispose(),n?m&&O.set(g,B.current.saveViewState()):B.current.getModel()?.dispose(),B.current.dispose()):a.cancel()}),J(()=>{let e=L(A.current,a||d||"",b||f||"",g||c||"");e!==B.current?.getModel()&&(m&&O.set(P,B.current?.saveViewState()),B.current?.setModel(e),m&&B.current?.restoreViewState(O.get(g)))},[g],w),J(()=>{B.current?.updateOptions(k)},[k],w),J(()=>{B.current&&void 0!==d&&(B.current.getOption(A.current.editor.EditorOption.readOnly)?B.current.setValue(d):d!==B.current.getValue()&&(R.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:d,forceMoveMarkers:!0}]),B.current.pushUndoStop(),R.current=!1))},[d],w),J(()=>{let a=B.current?.getModel();a&&f&&A.current?.editor.setModelLanguage(a,f)},[f],w),J(()=>{void 0!==i&&B.current?.revealLine(i)},[i],w),J(()=>{A.current?.editor.setTheme(h)},[h],w);let S=(0,e.useCallback)(()=>{if(!(!C.current||!A.current)&&!Q.current){F.current(A.current);let e=g||c,j=L(A.current,d||a||"",b||f||"",e||"");B.current=A.current?.editor.create(C.current,{model:j,automaticLayout:!0,...k},l),m&&B.current.restoreViewState(O.get(e)),A.current.editor.setTheme(h),void 0!==i&&B.current.revealLine(i),x(!0),Q.current=!0}},[a,b,c,d,f,g,k,l,m,h,i]);return(0,e.useEffect)(()=>{w&&E.current(B.current,A.current)},[w]),(0,e.useEffect)(()=>{y||w||S()},[y,w,S]),M.current=d,(0,e.useEffect)(()=>{w&&u&&(G.current?.dispose(),G.current=B.current?.onDidChangeModelContent(a=>{R.current||u(B.current.getValue(),a)}))},[w,u]),(0,e.useEffect)(()=>{if(w){let a=A.current.editor.onDidChangeMarkers(a=>{let b=B.current.getModel()?.uri;if(b&&a.find(a=>a.path===b.path)){let a=A.current.editor.getModelMarkers({resource:b});v?.(a)}});return()=>{a?.dispose()}}return()=>{}},[w,v]),e.createElement(H,{width:o,height:p,isEditorReady:w,loading:j,_ref:C,className:q,wrapperProps:r})}),Q=c(59448),R=c(29119);let S={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",css:"css",scss:"scss",less:"less",html:"html",htm:"html",xml:"xml",svg:"xml",json:"json",jsonc:"json",yaml:"yaml",yml:"yaml",toml:"plaintext",md:"markdown",mdx:"markdown",sh:"shell",bash:"shell",zsh:"shell",fish:"shell",ps1:"powershell",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",docker:"dockerfile",makefile:"plaintext",cmake:"plaintext",r:"r",lua:"lua",php:"php",vue:"html",svelte:"html",diff:"plaintext",patch:"plaintext",ini:"ini",env:"ini",tf:"plaintext",proto:"protobuf",zig:"plaintext",elixir:"plaintext",ex:"plaintext",erl:"plaintext",hs:"plaintext",scala:"scala",clj:"clojure",dart:"dart"};function T(a){let b=a.toLowerCase();return"dockerfile"===b||b.startsWith("dockerfile.")?"dockerfile":"makefile"===b||"gnumakefile"===b?"makefile":"cmakelists.txt"===b?"cmake":b.split(".").pop()??""}function U(a){return S[T(a)]??"plaintext"}let V=!1;function W(){return"undefined"!=typeof document&&document.documentElement.classList.contains("dark")}function X({content:a,filename:b,filePath:c,className:e,onDirty:f}){let g=T(b);return"diff"===g||"patch"===g?(0,d.jsx)("div",{className:"max-w-4xl mx-auto px-6 py-8",children:(0,d.jsx)(Q.a,{diff:a})}):(0,d.jsx)(Y,{content:a,filename:b,filePath:c,className:e,onDirty:f})}function Y({content:a,filename:b,filePath:c,className:f,onDirty:g}){let h=(0,e.useRef)(null),i=(0,e.useRef)(null),[j,k]=(0,e.useState)(W()?"denchclaw-dark":"denchclaw-light"),[l,m]=(0,e.useState)("clean"),[n,o]=(0,e.useState)({line:1,col:1}),p=(0,e.useRef)(null),q=(0,e.useRef)(a),r=U(b),s=!!c,t=(0,e.useCallback)(async()=>{if(!c||!h.current)return;let a=h.current.getValue();m("saving");try{if(!(await fetch((0,R.nC)(c),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:c,content:a})})).ok)throw Error("Save failed");q.current=a,m("saved"),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>m("clean"),2e3)}catch{m("error"),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>m("dirty"),3e3)}},[c]),u=(0,e.useCallback)((a,b)=>{h.current=a,i.current=b,V||(V=!0,b.editor.defineTheme("denchclaw-light",{base:"vs",inherit:!0,rules:[],colors:{"editor.background":"#ffffff","editor.foreground":"#1c1c1a","editor.lineHighlightBackground":"#f5f4f1","editor.selectionBackground":"#2563eb20","editor.inactiveSelectionBackground":"#2563eb10","editorLineNumber.foreground":"#8a8a82","editorLineNumber.activeForeground":"#44443e","editorIndentGuide.background":"#00000010","editorIndentGuide.activeBackground":"#00000020","editor.selectionHighlightBackground":"#2563eb12","editorCursor.foreground":"#2563eb","editorWhitespace.foreground":"#00000010","editorBracketMatch.background":"#2563eb15","editorBracketMatch.border":"#2563eb40","editorGutter.background":"#ffffff","editorWidget.background":"#ffffff","editorWidget.border":"#00000014","editorSuggestWidget.background":"#ffffff","editorSuggestWidget.border":"#00000014","editorSuggestWidget.selectedBackground":"#f5f4f1","editorHoverWidget.background":"#ffffff","editorHoverWidget.border":"#00000014","input.background":"#f5f5f4","input.border":"#00000014","input.foreground":"#1c1c1a","minimap.background":"#ffffff","scrollbarSlider.background":"#00000012","scrollbarSlider.hoverBackground":"#00000020","scrollbarSlider.activeBackground":"#0000002a"}}),b.editor.defineTheme("denchclaw-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{"editor.background":"#0c0c0b","editor.foreground":"#ececea","editor.lineHighlightBackground":"#1e1e1c","editor.selectionBackground":"#3b82f630","editor.inactiveSelectionBackground":"#3b82f618","editorLineNumber.foreground":"#78776f","editorLineNumber.activeForeground":"#b8b8b0","editorIndentGuide.background":"#ffffff08","editorIndentGuide.activeBackground":"#ffffff14","editor.selectionHighlightBackground":"#3b82f618","editorCursor.foreground":"#3b82f6","editorWhitespace.foreground":"#ffffff08","editorBracketMatch.background":"#3b82f620","editorBracketMatch.border":"#3b82f650","editorGutter.background":"#0c0c0b","editorWidget.background":"#161615","editorWidget.border":"#ffffff14","editorSuggestWidget.background":"#161615","editorSuggestWidget.border":"#ffffff14","editorSuggestWidget.selectedBackground":"#1e1e1c","editorHoverWidget.background":"#161615","editorHoverWidget.border":"#ffffff14","input.background":"#1e1e1c","input.border":"#ffffff14","input.foreground":"#ececea","minimap.background":"#0c0c0b","scrollbarSlider.background":"#ffffff12","scrollbarSlider.hoverBackground":"#ffffff20","scrollbarSlider.activeBackground":"#ffffff2a"}})),b.editor.setTheme(W()?"denchclaw-dark":"denchclaw-light"),a.addCommand(b.KeyMod.CtrlCmd|b.KeyCode.KeyS,()=>{t()}),a.onDidChangeCursorPosition(a=>{o({line:a.position.lineNumber,col:a.position.column})}),a.onDidChangeModelContent(()=>{a.getValue()!==q.current?(m("dirty"),g?.()):m("clean")}),a.focus()},[t,g]),v=function(a){let b=U(a);return"plaintext"===b?T(a)||"TEXT":b}(b),w=a.split("\n").length;return(0,d.jsxs)("div",{className:`flex flex-col h-full ${f??""}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 flex-shrink-0",style:{background:"var(--color-surface)",borderBottom:"1px solid var(--color-border)"},children:[(0,d.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--color-text-muted)",flexShrink:0},children:[(0,d.jsx)("polyline",{points:"16 18 22 12 16 6"}),(0,d.jsx)("polyline",{points:"8 6 2 12 8 18"})]}),(0,d.jsx)("span",{className:"text-sm font-medium truncate",style:{color:"var(--color-text)"},children:b}),"dirty"===l&&(0,d.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--color-text-muted)"},title:"Unsaved changes"}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("span",{className:"text-[11px] px-1.5 py-0.5 rounded font-medium",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)"},children:v.toUpperCase()}),(0,d.jsxs)("span",{className:"text-[11px] tabular-nums",style:{color:"var(--color-text-muted)"},children:[w," lines"]}),(0,d.jsxs)("span",{className:"text-[11px] tabular-nums",style:{color:"var(--color-text-muted)"},children:["Ln ",n.line,", Col ",n.col]}),s&&(0,d.jsxs)(d.Fragment,{children:["saving"===l&&(0,d.jsx)("span",{className:"text-[11px]",style:{color:"var(--color-text-muted)"},children:"Saving..."}),"saved"===l&&(0,d.jsx)("span",{className:"text-[11px]",style:{color:"var(--color-success)"},children:"Saved"}),"error"===l&&(0,d.jsx)("span",{className:"text-[11px]",style:{color:"var(--color-error)"},children:"Save failed"}),(0,d.jsx)("button",{type:"button",onClick:()=>void t(),disabled:"dirty"!==l,className:"text-[11px] px-2 py-0.5 rounded transition-colors",style:{background:"dirty"===l?"var(--color-accent)":"var(--color-surface-hover)",color:"dirty"===l?"#fff":"var(--color-text-muted)",cursor:"dirty"===l?"pointer":"default",opacity:"dirty"===l?1:.5},children:"Save"})]})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0",children:(0,d.jsx)(P,{defaultValue:a,language:r,theme:j,onMount:u,loading:(0,d.jsx)("div",{className:"flex items-center justify-center h-full",style:{background:"var(--color-bg)"},children:(0,d.jsx)("span",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"Loading editor..."})}),options:{readOnly:!s,fontSize:13,lineHeight:20,fontFamily:"'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Menlo, Monaco, 'Courier New', monospace",fontLigatures:!0,minimap:{enabled:!0,scale:1,showSlider:"mouseover"},scrollBeyondLastLine:!0,smoothScrolling:!0,cursorBlinking:"smooth",cursorSmoothCaretAnimation:"on",renderLineHighlight:"all",renderWhitespace:"selection",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0,highlightActiveIndentation:!0},stickyScroll:{enabled:!0},folding:!0,foldingHighlight:!0,showFoldingControls:"mouseover",links:!0,wordWrap:"off",padding:{top:8,bottom:8},scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10,verticalSliderSize:10,horizontalSliderSize:10},overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,automaticLayout:!0,tabSize:2,insertSpaces:!1,detectIndentation:!0,formatOnPaste:!1,formatOnType:!1,suggestOnTriggerCharacters:!0,quickSuggestions:!0,contextmenu:!0,mouseWheelZoom:!0,find:{addExtraSpaceOnTop:!1,autoFindInSelection:"multiline",seedSearchStringFromSelection:"selection"}}})})]})}},238182:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(261442),e=c(603182),f=c(505033);b.sortBy=function(a,...b){let c=b.length;return c>1&&f.isIterateeCall(a,b[0],b[1])?b=[]:c>2&&f.isIterateeCall(b[0],b[1],b[2])&&(b=[b[0]]),d.orderBy(a,e.flatten(b),["asc"])}},250367:(a,b,c)=>{"use strict";c.d(b,{A0:()=>h,Hj:()=>i,XI:()=>p,nA:()=>g});var d=c(720511),e=c(381802),f=c(63507),g=d.bP.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:a=>{var b,c;let d=a.getAttribute("colwidth"),e=d?d.split(",").map(a=>parseInt(a,10)):null;if(!e){let d=null==(b=a.closest("table"))?void 0:b.querySelectorAll("colgroup > col"),e=Array.from((null==(c=a.parentElement)?void 0:c.children)||[]).indexOf(a);if(e&&e>-1&&d&&d[e]){let a=d[e].getAttribute("width");return a?[parseInt(a,10)]:null}}return e}}}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML({HTMLAttributes:a}){return["td",(0,d.KV)(this.options.HTMLAttributes,a),0]}}),h=d.bP.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:a=>{let b=a.getAttribute("colwidth");return b?b.split(",").map(a=>parseInt(a,10)):null}}}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:a}){return["th",(0,d.KV)(this.options.HTMLAttributes,a),0]}}),i=d.bP.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:a}){return["tr",(0,d.KV)(this.options.HTMLAttributes,a),0]}});function j(a,b){return b?["width",`${Math.max(b,a)}px`]:["min-width",`${a}px`]}function k(a,b,c,d,e,f){var g;let h=0,i=!0,k=b.firstChild,l=a.firstChild;if(null!==l)for(let a=0,c=0;a<l.childCount;a+=1){let{colspan:g,colwidth:m}=l.child(a).attrs;for(let a=0;a<g;a+=1,c+=1){let g=e===c?f:m&&m[a],l=g?`${g}px`:"";if(h+=g||d,g||(i=!1),k){if(k.style.width!==l){let[a,b]=j(d,g);k.style.setProperty(a,b)}k=k.nextSibling}else{let a=document.createElement("col"),[c,e]=j(d,g);a.style.setProperty(c,e),b.appendChild(a)}}}for(;k;){let a=k.nextSibling;null==(g=k.parentNode)||g.removeChild(k),k=a}let m=a.attrs.style&&"string"==typeof a.attrs.style&&/\bwidth\s*:/i.test(a.attrs.style);i&&!m?(c.style.width=`${h}px`,c.style.minWidth=""):(c.style.width="",c.style.minWidth=`${h}px`)}var l=class{constructor(a,b){this.node=a,this.cellMinWidth=b,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),a.attrs.style&&(this.table.style.cssText=a.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),k(a,this.colgroup,this.table,b),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(a){return a.type===this.node.type&&(this.node=a,k(a,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(a){let b=a.target,c=this.dom.contains(b),d=this.contentDOM.contains(b);return!!c&&!d&&("attributes"===a.type||"childList"===a.type||"characterData"===a.type)}};function m(a,b){return b?a.createChecked(null,b):a.createAndFill()}var n=({editor:a})=>{let{selection:b}=a.state;if(!(b instanceof f.rn))return!1;let c=0,e=(0,d.eL)(b.ranges[0].$from,a=>"table"===a.type.name);return null==e||e.node.descendants(a=>{if("table"===a.type.name)return!1;["tableCell","tableHeader"].includes(a.type.name)&&(c+=1)}),c===b.ranges.length&&(a.commands.deleteTable(),!0)},o=function(a,b,c={}){var d;let e=null!=(d=c.cellLineSeparator)?d:"\x1f";if(!a||!a.content||0===a.content.length)return"";let f=[];a.content.forEach(a=>{let c=[];a.content&&a.content.forEach(a=>{let d=((a.content&&Array.isArray(a.content)&&a.content.length>1?a.content.map(a=>b.renderChildren(a)).join(e):a.content?b.renderChildren(a.content):"")||"").replace(/\s+/g," ").trim(),f="tableHeader"===a.type;c.push({text:d,isHeader:f})}),f.push(c)});let g=f.reduce((a,b)=>Math.max(a,b.length),0);if(0===g)return"";let h=Array(g).fill(0);f.forEach(a=>{var b;for(let c=0;c<g;c+=1){let d=((null==(b=a[c])?void 0:b.text)||"").length;d>h[c]&&(h[c]=d),h[c]<3&&(h[c]=3)}});let i=(a,b)=>a+" ".repeat(Math.max(0,b-a.length)),j=f[0],k=j.some(a=>a.isHeader),l="\n",m=Array(g).fill(0).map((a,b)=>k&&j[b]&&j[b].text||"");return l+=`| ${m.map((a,b)=>i(a,h[b])).join(" | ")} |
|
|
191
191
|
| ${h.map(a=>"-".repeat(Math.max(3,a))).join(" | ")} |
|
|
192
192
|
`,(k?f.slice(1):f).forEach(a=>{l+=`| ${Array(g).fill(0).map((b,c)=>i(a[c]&&a[c].text||"",h[c])).join(" | ")} |
|
|
193
193
|
`}),l},p=d.bP.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:l,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML({node:a,HTMLAttributes:b}){let{colgroup:c,tableWidth:e,tableMinWidth:f}=function(a,b,c,d){let e=0,f=!0,g=[],h=a.firstChild;if(!h)return{};for(let a=0,c=0;a<h.childCount;a+=1){let{colspan:d,colwidth:i}=h.child(a).attrs;for(let a=0;a<d;a+=1,c+=1){let d=void 0===c?void 0:i&&i[a];e+=d||b,d||(f=!1);let[h,k]=j(b,d);g.push(["col",{style:`${h}: ${k}`}])}}return{colgroup:["colgroup",{},...g],tableWidth:f?`${e}px`:"",tableMinWidth:f?"":`${e}px`}}(a,this.options.cellMinWidth),g=b.style,h=["table",(0,d.KV)(this.options.HTMLAttributes,b,{style:g||(e?`width: ${e}`:`min-width: ${f}`)}),c,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},h]:h},parseMarkdown:(a,b)=>{let c=[];if(a.header){let d=[];a.header.forEach(a=>{d.push(b.createNode("tableHeader",{},[{type:"paragraph",content:b.parseInline(a.tokens)}]))}),c.push(b.createNode("tableRow",{},d))}return a.rows&&a.rows.forEach(a=>{let d=[];a.forEach(a=>{d.push(b.createNode("tableCell",{},[{type:"paragraph",content:b.parseInline(a.tokens)}]))}),c.push(b.createNode("tableRow",{},d))}),b.createNode("table",void 0,c)},renderMarkdown:(a,b)=>o(a,b),addCommands:()=>({insertTable:({rows:a=3,cols:b=3,withHeaderRow:c=!0}={})=>({tr:d,dispatch:f,editor:g})=>{let h=function(a,b,c,d,e){let f=function(a){if(a.cached.tableNodeTypes)return a.cached.tableNodeTypes;let b={};return Object.keys(a.nodes).forEach(c=>{let d=a.nodes[c];d.spec.tableRole&&(b[d.spec.tableRole]=d)}),a.cached.tableNodeTypes=b,b}(a),g=[],h=[];for(let a=0;a<c;a+=1){let a=m(f.cell,void 0);if(a&&h.push(a),d){let a=m(f.header_cell,void 0);a&&g.push(a)}}let i=[];for(let a=0;a<b;a+=1)i.push(f.row.createChecked(null,d&&0===a?g:h));return f.table.createChecked(null,i)}(g.schema,a,b,c);if(f){let a=d.selection.from+1;d.replaceSelectionWith(h).scrollIntoView().setSelection(e.U3.near(d.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:a,dispatch:b})=>(0,f.RC)(a,b),addColumnAfter:()=>({state:a,dispatch:b})=>(0,f.GU)(a,b),deleteColumn:()=>({state:a,dispatch:b})=>(0,f.gR)(a,b),addRowBefore:()=>({state:a,dispatch:b})=>(0,f.JD)(a,b),addRowAfter:()=>({state:a,dispatch:b})=>(0,f.gC)(a,b),deleteRow:()=>({state:a,dispatch:b})=>(0,f.aR)(a,b),deleteTable:()=>({state:a,dispatch:b})=>(0,f.kG)(a,b),mergeCells:()=>({state:a,dispatch:b})=>(0,f.w7)(a,b),splitCell:()=>({state:a,dispatch:b})=>(0,f.L0)(a,b),toggleHeaderColumn:()=>({state:a,dispatch:b})=>(0,f.iS)("column")(a,b),toggleHeaderRow:()=>({state:a,dispatch:b})=>(0,f.iS)("row")(a,b),toggleHeaderCell:()=>({state:a,dispatch:b})=>(0,f._G)(a,b),mergeOrSplit:()=>({state:a,dispatch:b})=>!!(0,f.w7)(a,b)||(0,f.L0)(a,b),setCellAttribute:(a,b)=>({state:c,dispatch:d})=>(0,f.i4)(a,b)(c,d),goToNextCell:()=>({state:a,dispatch:b})=>(0,f.D8)(1)(a,b),goToPreviousCell:()=>({state:a,dispatch:b})=>(0,f.D8)(-1)(a,b),fixTables:()=>({state:a,dispatch:b})=>(b&&(0,f.rP)(a),!0),setCellSelection:a=>({tr:b,dispatch:c})=>{if(c){let c=f.rn.create(b.doc,a.anchorCell,a.headCell);b.setSelection(c)}return!0}}),addKeyboardShortcuts(){return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:n,"Mod-Backspace":n,Delete:n,"Mod-Delete":n}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[(0,f.AL)({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],(0,f.LF)({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(a){let b={name:a.name,options:a.options,storage:a.storage};return{tableRole:(0,d.gk)((0,d.iI)(a,"tableRole",b))}}});d.YY.create({name:"tableKit",addExtensions(){let a=[];return!1!==this.options.table&&a.push(p.configure(this.options.table)),!1!==this.options.tableCell&&a.push(g.configure(this.options.tableCell)),!1!==this.options.tableHeader&&a.push(h.configure(this.options.tableHeader)),!1!==this.options.tableRow&&a.push(i.configure(this.options.tableRow)),a}})},250924:(a,b,c)=>{"use strict";c.d(b,{O:()=>h});var d=c(736927),e=c(115962);let f="undefined"!=typeof globalThis?globalThis:window;function g(a,b){return`/api/apps/serve/${a}/${b}`}function h({appPath:a,manifest:b,onToast:c,onNavigate:f}){let h=(0,e.useRef)(null),[j,k]=(0,e.useState)(!0),[l,m]=(0,e.useState)(null);(0,e.useRef)(null),(0,e.useRef)(new Set),(0,e.useRef)(new Map),(0,e.useRef)(new Map);let n=g(a,b.entry||"index.html");b.permissions,a.split("/").pop();let o=(0,e.useCallback)(()=>{k(!0),m(null),h.current&&(h.current.src=`${n}?_t=${Date.now()}`)},[n]),p=(0,e.useCallback)(()=>{k(!1)},[]),q=(0,e.useCallback)(()=>{k(!1),m("Failed to load app")},[]),r=b.icon&&(b.icon.endsWith(".png")||b.icon.endsWith(".svg")||b.icon.endsWith(".jpg")||b.icon.endsWith(".jpeg")||b.icon.endsWith(".webp"));return(0,d.jsxs)("div",{className:"flex flex-col h-full",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 px-5 py-2.5 border-b flex-shrink-0",style:{borderColor:"var(--color-border)"},children:[r?(0,d.jsx)("img",{src:g(a,b.icon),alt:"",width:20,height:20,className:"rounded flex-shrink-0",style:{objectFit:"cover"}}):(0,d.jsx)(i,{}),(0,d.jsx)("span",{className:"text-sm font-medium truncate",style:{color:"var(--color-text)"},children:b.name}),b.version&&(0,d.jsxs)("span",{className:"text-[10px] px-2 py-0.5 rounded-full flex-shrink-0",style:{background:"var(--color-accent-light)",color:"var(--color-accent)",border:"1px solid color-mix(in srgb, var(--color-accent) 20%, transparent)"},children:["v",b.version]}),(0,d.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full flex-shrink-0",style:{background:"#6366f118",color:"#6366f1",border:"1px solid #6366f130"},children:"APP"}),(0,d.jsxs)("div",{className:"flex items-center gap-1 ml-auto",children:[(0,d.jsx)("button",{type:"button",onClick:o,className:"p-1.5 rounded-md transition-colors duration-100 cursor-pointer",style:{color:"var(--color-text-muted)"},title:"Reload app",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),(0,d.jsx)("path",{d:"M3 3v5h5"}),(0,d.jsx)("path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"}),(0,d.jsx)("path",{d:"M16 16h5v5"})]})}),(0,d.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-md transition-colors duration-100",style:{color:"var(--color-text-muted)"},title:"Open in new tab",onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M15 3h6v6"}),(0,d.jsx)("path",{d:"M10 14 21 3"}),(0,d.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})})]})]}),(0,d.jsxs)("div",{className:"flex-1 overflow-hidden relative",style:{background:"white"},children:[j&&(0,d.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 z-10",style:{background:"var(--color-bg)"},children:[r?(0,d.jsx)("img",{src:g(a,b.icon),alt:"",width:48,height:48,className:"rounded-xl",style:{objectFit:"cover"}}):(0,d.jsx)("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center",style:{background:"var(--color-accent-light)"},children:(0,d.jsx)(i,{size:24})}),(0,d.jsx)("div",{className:"w-5 h-5 border-2 rounded-full animate-spin",style:{borderColor:"var(--color-border)",borderTopColor:"var(--color-accent)"}}),(0,d.jsxs)("p",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:["Loading ",b.name,"..."]})]}),l&&(0,d.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 z-10",style:{background:"var(--color-bg)"},children:[(0,d.jsx)("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center",style:{background:"color-mix(in srgb, var(--color-error) 10%, transparent)"},children:(0,d.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-error)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("line",{x1:"15",x2:"9",y1:"9",y2:"15"}),(0,d.jsx)("line",{x1:"9",x2:"15",y1:"9",y2:"15"})]})}),(0,d.jsx)("p",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:l}),(0,d.jsx)("button",{type:"button",onClick:o,className:"text-xs px-3 py-1.5 rounded-md cursor-pointer",style:{color:"var(--color-accent)",background:"var(--color-accent-light)"},children:"Try again"})]}),(0,d.jsx)("iframe",{ref:h,src:n,className:"w-full h-full border-0",sandbox:"allow-same-origin allow-scripts allow-popups allow-forms",title:b.name,onLoad:p,onError:q,style:{minHeight:"calc(100vh - 120px)"}})]})]})}function i({size:a=18}){return(0,d.jsxs)("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"#6366f1",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"})]})}f.__denchAppRegistry||(f.__denchAppRegistry=new Map),f.__denchAppMessageHandlers||(f.__denchAppMessageHandlers=new Set),f.__denchAppRegistry,f.__denchAppMessageHandlers},257975:a=>{"use strict";a.exports=require("node:util")},261442:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(92135),e=c(593637),f=c(963302);b.orderBy=function(a,b,c,g){if(null==a)return[];c=g?void 0:c,Array.isArray(a)||(a=Object.values(a)),Array.isArray(b)||(b=null==b?[null]:[b]),0===b.length&&(b=[null]),Array.isArray(c)||(c=null==c?[]:[c]),c=c.map(a=>String(a));let h=(a,b)=>{let c=a;for(let a=0;a<b.length&&null!=c;++a)c=c[b[a]];return c},i=b.map(a=>(Array.isArray(a)&&1===a.length&&(a=a[0]),null==a||"function"==typeof a||Array.isArray(a)||e.isKey(a))?a:{key:a,path:f.toPath(a)});return a.map(a=>({original:a,criteria:i.map(b=>{var c,d;return c=b,null==(d=a)||null==c?d:"object"==typeof c&&"key"in c?Object.hasOwn(d,c.key)?d[c.key]:h(d,c.path):"function"==typeof c?c(d):Array.isArray(c)?h(d,c):"object"==typeof d?d[c]:d})})).slice().sort((a,b)=>{for(let e=0;e<i.length;e++){let f=d.compareValues(a.criteria[e],b.criteria[e],c[e]);if(0!==f)return f}return 0}).map(a=>a.original)}},266196:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.getTag=function(a){return null==a?void 0===a?"[object Undefined]":"[object Null]":Object.prototype.toString.call(a)}},272772:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{q:()=>h});var e=c(736927),f=c(338177),g=a([f]);function h({job:a,run:b,sessionId:c,onBack:d,onBackToJob:g}){var h;let i="ok"===b.status?"var(--color-success, #22c55e)":"error"===b.status?"var(--color-error, #ef4444)":"var(--color-warning, #f59e0b)";return(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsxs)("div",{className:"px-4 py-3 flex items-center gap-3 flex-shrink-0",style:{borderBottom:"1px solid var(--color-border)",background:"var(--color-bg-glass)"},children:[(0,e.jsx)("button",{type:"button",onClick:d,className:"p-1.5 rounded-lg flex-shrink-0 cursor-pointer",style:{color:"var(--color-text-muted)"},title:"Back to Cron",children:(0,e.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("path",{d:"m12 19-7-7 7-7"}),(0,e.jsx)("path",{d:"M19 12H5"})]})}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("button",{type:"button",onClick:g,className:"text-sm font-semibold truncate cursor-pointer hover:underline",style:{color:"var(--color-text)"},title:"Back to job detail",children:a.name}),(0,e.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full flex-shrink-0",style:{background:`color-mix(in srgb, ${i} 12%, transparent)`,color:i},children:b.status??"unknown"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3 text-xs",style:{color:"var(--color-text-muted)"},children:[(0,e.jsx)("span",{children:new Date(b.ts).toLocaleString()}),null!=b.durationMs&&(0,e.jsx)("span",{children:(h=b.durationMs)<1e3?`${h}ms`:h<6e4?`${(h/1e3).toFixed(1)}s`:`${Math.floor(h/6e4)}m ${Math.floor(h%6e4/1e3)}s`}),b.summary&&(0,e.jsx)("span",{className:"truncate",children:b.summary})]})]})]}),(0,e.jsx)("div",{className:"flex-1 min-h-0",children:(0,e.jsx)(f.Xe,{initialSessionId:c,sessionTitle:`${a.name} - Run ${new Date(b.ts).toLocaleString()}`})})]})}f=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},273700:(a,b,c)=>{"use strict";function d(a){let b=[],c=0;for(let d of a.matchAll(/```report-json\s*\n([\s\S]*?)```/g)){let e=a.slice(c,d.index);e.trim()&&b.push({type:"text",text:e});try{let a=JSON.parse(d[1]);a.panels&&Array.isArray(a.panels)?b.push({type:"report-artifact",config:a}):b.push({type:"text",text:d[0]})}catch{b.push({type:"text",text:d[0]})}c=(d.index??0)+d[0].length}let d=a.slice(c);return d.trim()&&b.push({type:"text",text:d}),b}function e(a){return a.includes("```report-json")}c.d(b,{R:()=>d,x:()=>e})},274529:(a,b,c)=>{"use strict";c.d(b,{A:()=>i,k:()=>g});var d=c(115962);let e={"a-arrow-down":()=>c.e(80727).then(c.bind(c,680727)),"a-arrow-up":()=>c.e(14218).then(c.bind(c,814218)),"a-large-small":()=>c.e(54078).then(c.bind(c,654078)),accessibility:()=>c.e(18381).then(c.bind(c,918381)),activity:()=>c.e(20524).then(c.bind(c,220524)),"air-vent":()=>c.e(44725).then(c.bind(c,944725)),airplay:()=>c.e(73091).then(c.bind(c,473091)),"alarm-clock-check":()=>c.e(64470).then(c.bind(c,264470)),"alarm-check":()=>c.e(64470).then(c.bind(c,264470)),"alarm-clock-minus":()=>c.e(33930).then(c.bind(c,133930)),"alarm-minus":()=>c.e(33930).then(c.bind(c,133930)),"alarm-clock-off":()=>c.e(28807).then(c.bind(c,228807)),"alarm-clock-plus":()=>c.e(20123).then(c.bind(c,342504)),"alarm-plus":()=>c.e(20123).then(c.bind(c,342504)),"alarm-clock":()=>c.e(42835).then(c.bind(c,442835)),"alarm-smoke":()=>c.e(39036).then(c.bind(c,439036)),album:()=>c.e(9766).then(c.bind(c,109766)),"align-center-horizontal":()=>c.e(35733).then(c.bind(c,935733)),"align-center-vertical":()=>c.e(94007).then(c.bind(c,94007)),"align-end-horizontal":()=>c.e(64429).then(c.bind(c,164429)),"align-end-vertical":()=>c.e(28351).then(c.bind(c,328351)),"align-horizontal-distribute-center":()=>c.e(81367).then(c.bind(c,481367)),"align-horizontal-distribute-end":()=>c.e(66677).then(c.bind(c,66677)),"align-horizontal-distribute-start":()=>c.e(78372).then(c.bind(c,478372)),"align-horizontal-justify-center":()=>c.e(39780).then(c.bind(c,439780)),"align-horizontal-justify-end":()=>c.e(28460).then(c.bind(c,28460)),"align-horizontal-justify-start":()=>c.e(76285).then(c.bind(c,176285)),"align-horizontal-space-around":()=>c.e(97658).then(c.bind(c,597658)),"align-horizontal-space-between":()=>c.e(39911).then(c.bind(c,839911)),"align-start-horizontal":()=>c.e(90134).then(c.bind(c,90134)),"align-start-vertical":()=>c.e(71936).then(c.bind(c,971936)),"align-vertical-distribute-center":()=>c.e(88929).then(c.bind(c,388929)),"align-vertical-distribute-end":()=>c.e(59059).then(c.bind(c,459059)),"align-vertical-distribute-start":()=>c.e(44086).then(c.bind(c,144086)),"align-vertical-justify-center":()=>c.e(20426).then(c.bind(c,720426)),"align-vertical-justify-end":()=>c.e(30278).then(c.bind(c,730278)),"align-vertical-justify-start":()=>c.e(3683).then(c.bind(c,303683)),"align-vertical-space-around":()=>c.e(37844).then(c.bind(c,237844)),"align-vertical-space-between":()=>c.e(78349).then(c.bind(c,178349)),ambulance:()=>c.e(94727).then(c.bind(c,294727)),ampersand:()=>c.e(70022).then(c.bind(c,270022)),ampersands:()=>c.e(57313).then(c.bind(c,457313)),amphora:()=>c.e(139).then(c.bind(c,139)),anchor:()=>c.e(47896).then(c.bind(c,147896)),angry:()=>c.e(46332).then(c.bind(c,146332)),annoyed:()=>c.e(2987).then(c.bind(c,602987)),antenna:()=>c.e(26402).then(c.bind(c,826402)),anvil:()=>c.e(97039).then(c.bind(c,797039)),aperture:()=>c.e(49397).then(c.bind(c,949397)),"app-window-mac":()=>c.e(18421).then(c.bind(c,818421)),"app-window":()=>c.e(45107).then(c.bind(c,145107)),apple:()=>c.e(46193).then(c.bind(c,946193)),"archive-restore":()=>c.e(71644).then(c.bind(c,371644)),"archive-x":()=>c.e(37450).then(c.bind(c,237450)),archive:()=>c.e(15883).then(c.bind(c,115883)),armchair:()=>c.e(24102).then(c.bind(c,324102)),"arrow-big-down-dash":()=>c.e(32997).then(c.bind(c,332997)),"arrow-big-down":()=>c.e(37528).then(c.bind(c,437528)),"arrow-big-left-dash":()=>c.e(76110).then(c.bind(c,976110)),"arrow-big-left":()=>c.e(25441).then(c.bind(c,925441)),"arrow-big-right-dash":()=>c.e(5229).then(c.bind(c,505229)),"arrow-big-right":()=>c.e(54736).then(c.bind(c,554736)),"arrow-big-up-dash":()=>c.e(39394).then(c.bind(c,439394)),"arrow-big-up":()=>c.e(50173).then(c.bind(c,550173)),"arrow-down-0-1":()=>c.e(4406).then(c.bind(c,204406)),"arrow-down-01":()=>c.e(4406).then(c.bind(c,204406)),"arrow-down-1-0":()=>c.e(17514).then(c.bind(c,217514)),"arrow-down-10":()=>c.e(17514).then(c.bind(c,217514)),"arrow-down-a-z":()=>c.e(46652).then(c.bind(c,846652)),"arrow-down-az":()=>c.e(46652).then(c.bind(c,846652)),"arrow-down-from-line":()=>c.e(5649).then(c.bind(c,705649)),"arrow-down-left":()=>c.e(97831).then(c.bind(c,397831)),"arrow-down-narrow-wide":()=>c.e(80969).then(c.bind(c,180969)),"arrow-down-right":()=>c.e(98070).then(c.bind(c,998070)),"arrow-down-to-dot":()=>c.e(64373).then(c.bind(c,364373)),"arrow-down-to-line":()=>c.e(61106).then(c.bind(c,261106)),"arrow-down-up":()=>c.e(88423).then(c.bind(c,388423)),"arrow-down-wide-narrow":()=>c.e(13001).then(c.bind(c,513001)),"sort-desc":()=>c.e(13001).then(c.bind(c,513001)),"arrow-down-z-a":()=>c.e(84404).then(c.bind(c,284404)),"arrow-down-za":()=>c.e(84404).then(c.bind(c,284404)),"arrow-down":()=>c.e(28489).then(c.bind(c,528489)),"arrow-left-from-line":()=>c.e(74256).then(c.bind(c,774256)),"arrow-left-right":()=>c.e(53971).then(c.bind(c,253971)),"arrow-left-to-line":()=>c.e(95447).then(c.bind(c,95447)),"arrow-left":()=>c.e(1056).then(c.bind(c,301056)),"arrow-right-from-line":()=>c.e(39191).then(c.bind(c,339191)),"arrow-right-left":()=>c.e(35773).then(c.bind(c,735773)),"arrow-right-to-line":()=>c.e(97472).then(c.bind(c,897472)),"arrow-right":()=>c.e(59111).then(c.bind(c,659111)),"arrow-up-0-1":()=>c.e(89739).then(c.bind(c,489739)),"arrow-up-01":()=>c.e(89739).then(c.bind(c,489739)),"arrow-up-1-0":()=>c.e(95455).then(c.bind(c,295455)),"arrow-up-10":()=>c.e(95455).then(c.bind(c,295455)),"arrow-up-a-z":()=>c.e(85205).then(c.bind(c,585205)),"arrow-up-az":()=>c.e(85205).then(c.bind(c,585205)),"arrow-up-down":()=>c.e(39901).then(c.bind(c,939901)),"arrow-up-from-dot":()=>c.e(559).then(c.bind(c,500559)),"arrow-up-from-line":()=>c.e(30096).then(c.bind(c,630096)),"arrow-up-left":()=>c.e(36964).then(c.bind(c,636964)),"arrow-up-narrow-wide":()=>c.e(97324).then(c.bind(c,97324)),"sort-asc":()=>c.e(97324).then(c.bind(c,97324)),"arrow-up-right":()=>c.e(31251).then(c.bind(c,931251)),"arrow-up-to-line":()=>c.e(1143).then(c.bind(c,601143)),"arrow-up-wide-narrow":()=>c.e(10868).then(c.bind(c,710868)),"arrow-up-z-a":()=>c.e(89901).then(c.bind(c,889901)),"arrow-up-za":()=>c.e(89901).then(c.bind(c,889901)),"arrow-up":()=>c.e(56928).then(c.bind(c,256928)),"arrows-up-from-line":()=>c.e(36609).then(c.bind(c,236609)),asterisk:()=>c.e(3273).then(c.bind(c,3273)),"at-sign":()=>c.e(29880).then(c.bind(c,929880)),atom:()=>c.e(65420).then(c.bind(c,65420)),"audio-lines":()=>c.e(18657).then(c.bind(c,718657)),"audio-waveform":()=>c.e(21023).then(c.bind(c,221023)),award:()=>c.e(64692).then(c.bind(c,64692)),axe:()=>c.e(62021).then(c.bind(c,862021)),"axis-3d":()=>c.e(97350).then(c.bind(c,297350)),"axis-3-d":()=>c.e(97350).then(c.bind(c,297350)),baby:()=>c.e(56769).then(c.bind(c,356769)),backpack:()=>c.e(50007).then(c.bind(c,550007)),"badge-alert":()=>c.e(40557).then(c.bind(c,640557)),"badge-cent":()=>c.e(49869).then(c.bind(c,449869)),"badge-check":()=>c.e(61663).then(c.bind(c,661663)),verified:()=>c.e(61663).then(c.bind(c,661663)),"badge-dollar-sign":()=>c.e(85711).then(c.bind(c,485711)),"badge-euro":()=>c.e(96850).then(c.bind(c,196850)),"badge-indian-rupee":()=>c.e(85532).then(c.bind(c,785532)),"badge-info":()=>c.e(66403).then(c.bind(c,966403)),"badge-japanese-yen":()=>c.e(20897).then(c.bind(c,120897)),"badge-minus":()=>c.e(49215).then(c.bind(c,849215)),"badge-percent":()=>c.e(51618).then(c.bind(c,951618)),"badge-plus":()=>c.e(61271).then(c.bind(c,561271)),"badge-pound-sterling":()=>c.e(75174).then(c.bind(c,675174)),"badge-question-mark":()=>c.e(6629).then(c.bind(c,506629)),"badge-help":()=>c.e(6629).then(c.bind(c,506629)),"badge-russian-ruble":()=>c.e(40149).then(c.bind(c,840149)),"badge-swiss-franc":()=>c.e(41229).then(c.bind(c,941229)),"badge-turkish-lira":()=>c.e(79598).then(c.bind(c,779598)),"badge-x":()=>c.e(67647).then(c.bind(c,367647)),badge:()=>c.e(16574).then(c.bind(c,916574)),"baggage-claim":()=>c.e(1422).then(c.bind(c,901422)),balloon:()=>c.e(63490).then(c.bind(c,763490)),ban:()=>c.e(87804).then(c.bind(c,587804)),banana:()=>c.e(86052).then(c.bind(c,986052)),bandage:()=>c.e(49243).then(c.bind(c,49243)),"banknote-arrow-down":()=>c.e(25260).then(c.bind(c,725260)),"banknote-arrow-up":()=>c.e(37097).then(c.bind(c,137097)),"banknote-x":()=>c.e(31170).then(c.bind(c,231170)),banknote:()=>c.e(18883).then(c.bind(c,118883)),barcode:()=>c.e(45437).then(c.bind(c,145437)),barrel:()=>c.e(5165).then(c.bind(c,305165)),baseline:()=>c.e(10082).then(c.bind(c,110082)),bath:()=>c.e(75748).then(c.bind(c,575748)),"battery-charging":()=>c.e(84066).then(c.bind(c,784066)),"battery-full":()=>c.e(20160).then(c.bind(c,520160)),"battery-low":()=>c.e(97731).then(c.bind(c,597731)),"battery-medium":()=>c.e(34382).then(c.bind(c,234382)),"battery-plus":()=>c.e(98857).then(c.bind(c,498857)),"battery-warning":()=>c.e(15993).then(c.bind(c,515993)),battery:()=>c.e(52704).then(c.bind(c,652704)),beaker:()=>c.e(32731).then(c.bind(c,932731)),"bean-off":()=>c.e(36459).then(c.bind(c,36459)),bean:()=>c.e(70407).then(c.bind(c,670407)),"bed-double":()=>c.e(37086).then(c.bind(c,537086)),"bed-single":()=>c.e(5619).then(c.bind(c,205619)),bed:()=>c.e(77630).then(c.bind(c,77630)),beef:()=>c.e(68971).then(c.bind(c,568971)),"beer-off":()=>c.e(69027).then(c.bind(c,569027)),beer:()=>c.e(7103).then(c.bind(c,607103)),"bell-dot":()=>c.e(60922).then(c.bind(c,60922)),"bell-electric":()=>c.e(58622).then(c.bind(c,358622)),"bell-minus":()=>c.e(26493).then(c.bind(c,926493)),"bell-off":()=>c.e(61408).then(c.bind(c,161408)),"bell-plus":()=>c.e(62293).then(c.bind(c,862293)),"bell-ring":()=>c.e(31679).then(c.bind(c,531679)),bell:()=>c.e(83212).then(c.bind(c,183212)),"between-horizontal-end":()=>c.e(89302).then(c.bind(c,89302)),"between-horizonal-end":()=>c.e(89302).then(c.bind(c,89302)),"between-horizontal-start":()=>c.e(1331).then(c.bind(c,601331)),"between-horizonal-start":()=>c.e(1331).then(c.bind(c,601331)),"between-vertical-end":()=>c.e(57724).then(c.bind(c,657724)),"between-vertical-start":()=>c.e(52429).then(c.bind(c,552429)),"biceps-flexed":()=>c.e(91152).then(c.bind(c,391152)),bike:()=>c.e(7004).then(c.bind(c,107004)),binary:()=>c.e(36608).then(c.bind(c,236608)),binoculars:()=>c.e(69939).then(c.bind(c,669939)),biohazard:()=>c.e(78959).then(c.bind(c,578959)),bird:()=>c.e(2010).then(c.bind(c,402010)),birdhouse:()=>c.e(15664).then(c.bind(c,715664)),bitcoin:()=>c.e(35151).then(c.bind(c,735151)),blend:()=>c.e(73654).then(c.bind(c,473654)),blinds:()=>c.e(73477).then(c.bind(c,773477)),blocks:()=>c.e(18983).then(c.bind(c,718983)),"bluetooth-connected":()=>c.e(40577).then(c.bind(c,740577)),"bluetooth-off":()=>c.e(90259).then(c.bind(c,290259)),"bluetooth-searching":()=>c.e(64218).then(c.bind(c,564218)),bluetooth:()=>c.e(15279).then(c.bind(c,715279)),bold:()=>c.e(22466).then(c.bind(c,22466)),bolt:()=>c.e(70514).then(c.bind(c,770514)),bomb:()=>c.e(51129).then(c.bind(c,651129)),bone:()=>c.e(64247).then(c.bind(c,964247)),"book-a":()=>c.e(27082).then(c.bind(c,427082)),"book-alert":()=>c.e(7319).then(c.bind(c,7319)),"book-audio":()=>c.e(84307).then(c.bind(c,384307)),"book-check":()=>c.e(66049).then(c.bind(c,766049)),"book-copy":()=>c.e(31776).then(c.bind(c,931776)),"book-dashed":()=>c.e(13156).then(c.bind(c,113156)),"book-template":()=>c.e(13156).then(c.bind(c,113156)),"book-down":()=>c.e(17529).then(c.bind(c,17529)),"book-headphones":()=>c.e(562).then(c.bind(c,400562)),"book-heart":()=>c.e(46085).then(c.bind(c,46085)),"book-image":()=>c.e(86008).then(c.bind(c,686008)),"book-key":()=>c.e(25018).then(c.bind(c,425018)),"book-lock":()=>c.e(5198).then(c.bind(c,705198)),"book-marked":()=>c.e(37529).then(c.bind(c,137529)),"book-minus":()=>c.e(51693).then(c.bind(c,851693)),"book-open-check":()=>c.e(39096).then(c.bind(c,639096)),"book-open-text":()=>c.e(61565).then(c.bind(c,461565)),"book-open":()=>c.e(19945).then(c.bind(c,919945)),"book-plus":()=>c.e(23557).then(c.bind(c,123557)),"book-search":()=>c.e(42329).then(c.bind(c,942329)),"book-text":()=>c.e(5498).then(c.bind(c,405498)),"book-type":()=>c.e(57681).then(c.bind(c,257681)),"book-up-2":()=>c.e(83955).then(c.bind(c,683955)),"book-up":()=>c.e(59792).then(c.bind(c,859792)),"book-user":()=>c.e(32934).then(c.bind(c,332934)),"book-x":()=>c.e(3677).then(c.bind(c,903677)),book:()=>c.e(80476).then(c.bind(c,580476)),"bookmark-check":()=>c.e(18172).then(c.bind(c,818172)),"bookmark-minus":()=>c.e(83172).then(c.bind(c,983172)),"bookmark-plus":()=>c.e(72298).then(c.bind(c,72298)),"bookmark-x":()=>c.e(19876).then(c.bind(c,619876)),bookmark:()=>c.e(68477).then(c.bind(c,168477)),"boom-box":()=>c.e(86842).then(c.bind(c,386842)),"bot-message-square":()=>c.e(73840).then(c.bind(c,673840)),"bot-off":()=>c.e(5516).then(c.bind(c,905516)),bot:()=>c.e(49976).then(c.bind(c,749976)),"bottle-wine":()=>c.e(74708).then(c.bind(c,152327)),"bow-arrow":()=>c.e(68837).then(c.bind(c,568837)),box:()=>c.e(39380).then(c.bind(c,839380)),boxes:()=>c.e(5412).then(c.bind(c,905412)),braces:()=>c.e(67053).then(c.bind(c,667053)),"curly-braces":()=>c.e(67053).then(c.bind(c,667053)),brackets:()=>c.e(81008).then(c.bind(c,281008)),"brain-circuit":()=>c.e(51155).then(c.bind(c,951155)),"brain-cog":()=>c.e(28844).then(c.bind(c,806463)),brain:()=>c.e(60673).then(c.bind(c,560673)),"brick-wall-fire":()=>c.e(15673).then(c.bind(c,938054)),"brick-wall-shield":()=>c.e(95995).then(c.bind(c,995995)),"brick-wall":()=>c.e(44485).then(c.bind(c,544485)),"briefcase-business":()=>c.e(79148).then(c.bind(c,979148)),"briefcase-conveyor-belt":()=>c.e(13417).then(c.bind(c,513417)),"briefcase-medical":()=>c.e(36723).then(c.bind(c,636723)),briefcase:()=>c.e(79465).then(c.bind(c,479465)),"bring-to-front":()=>c.e(8781).then(c.bind(c,8781)),"brush-cleaning":()=>c.e(32517).then(c.bind(c,632517)),brush:()=>c.e(43589).then(c.bind(c,643589)),bubbles:()=>c.e(79994).then(c.bind(c,579994)),"bug-off":()=>c.e(14911).then(c.bind(c,714911)),"bug-play":()=>c.e(81682).then(c.bind(c,281682)),bug:()=>c.e(24939).then(c.bind(c,724939)),"building-2":()=>c.e(7982).then(c.bind(c,307982)),building:()=>c.e(87969).then(c.bind(c,187969)),"bus-front":()=>c.e(28581).then(c.bind(c,428581)),bus:()=>c.e(41119).then(c.bind(c,341119)),"cable-car":()=>c.e(37123).then(c.bind(c,237123)),cable:()=>c.e(22124).then(c.bind(c,222124)),"cake-slice":()=>c.e(86250).then(c.bind(c,86250)),cake:()=>c.e(16977).then(c.bind(c,516977)),calculator:()=>c.e(17125).then(c.bind(c,617125)),"calendar-1":()=>c.e(71801).then(c.bind(c,671801)),"calendar-arrow-down":()=>c.e(12976).then(c.bind(c,612976)),"calendar-arrow-up":()=>c.e(629).then(c.bind(c,100629)),"calendar-check-2":()=>c.e(79905).then(c.bind(c,479905)),"calendar-check":()=>c.e(57074).then(c.bind(c,957074)),"calendar-clock":()=>c.e(19100).then(c.bind(c,19100)),"calendar-cog":()=>c.e(80545).then(c.bind(c,680545)),"calendar-days":()=>c.e(39615).then(c.bind(c,639615)),"calendar-fold":()=>c.e(6099).then(c.bind(c,206099)),"calendar-heart":()=>c.e(65814).then(c.bind(c,765814)),"calendar-minus-2":()=>c.e(397).then(c.bind(c,397)),"calendar-minus":()=>c.e(87350).then(c.bind(c,87350)),"calendar-off":()=>c.e(72547).then(c.bind(c,72547)),"calendar-plus-2":()=>c.e(48588).then(c.bind(c,226207)),"calendar-plus":()=>c.e(66852).then(c.bind(c,966852)),"calendar-range":()=>c.e(93979).then(c.bind(c,293979)),"calendar-search":()=>c.e(15280).then(c.bind(c,615280)),"calendar-sync":()=>c.e(55983).then(c.bind(c,555983)),"calendar-x-2":()=>c.e(36477).then(c.bind(c,336477)),"calendar-x":()=>c.e(26310).then(c.bind(c,526310)),calendar:()=>c.e(53823).then(c.bind(c,353823)),calendars:()=>c.e(14274).then(c.bind(c,14274)),"camera-off":()=>c.e(94590).then(c.bind(c,494590)),camera:()=>c.e(39062).then(c.bind(c,639062)),"candy-cane":()=>c.e(45600).then(c.bind(c,345600)),"candy-off":()=>c.e(76376).then(c.bind(c,876376)),candy:()=>c.e(39268).then(c.bind(c,539268)),"cannabis-off":()=>c.e(52574).then(c.bind(c,952574)),cannabis:()=>c.e(35094).then(c.bind(c,635094)),"captions-off":()=>c.e(38930).then(c.bind(c,938930)),captions:()=>c.e(92666).then(c.bind(c,292666)),subtitles:()=>c.e(92666).then(c.bind(c,292666)),"car-front":()=>c.e(99653).then(c.bind(c,199653)),"car-taxi-front":()=>c.e(50718).then(c.bind(c,150718)),car:()=>c.e(68620).then(c.bind(c,746239)),caravan:()=>c.e(60939).then(c.bind(c,160939)),"card-sim":()=>c.e(98105).then(c.bind(c,498105)),carrot:()=>c.e(43622).then(c.bind(c,343622)),"case-lower":()=>c.e(969).then(c.bind(c,800969)),"case-sensitive":()=>c.e(94464).then(c.bind(c,894464)),"case-upper":()=>c.e(57400).then(c.bind(c,57400)),"cassette-tape":()=>c.e(90658).then(c.bind(c,190658)),cast:()=>c.e(80062).then(c.bind(c,980062)),castle:()=>c.e(3073).then(c.bind(c,303073)),cat:()=>c.e(95897).then(c.bind(c,995897)),cctv:()=>c.e(54289).then(c.bind(c,254289)),"chart-area":()=>c.e(90011).then(c.bind(c,90011)),"area-chart":()=>c.e(90011).then(c.bind(c,90011)),"chart-bar-big":()=>c.e(3306).then(c.bind(c,203306)),"bar-chart-horizontal-big":()=>c.e(3306).then(c.bind(c,203306)),"chart-bar-decreasing":()=>c.e(30545).then(c.bind(c,530545)),"chart-bar-increasing":()=>c.e(55925).then(c.bind(c,555925)),"chart-bar-stacked":()=>c.e(83613).then(c.bind(c,883613)),"chart-bar":()=>c.e(21817).then(c.bind(c,921817)),"bar-chart-horizontal":()=>c.e(21817).then(c.bind(c,921817)),"chart-candlestick":()=>c.e(10879).then(c.bind(c,110879)),"candlestick-chart":()=>c.e(10879).then(c.bind(c,110879)),"chart-column-big":()=>c.e(56151).then(c.bind(c,556151)),"bar-chart-big":()=>c.e(56151).then(c.bind(c,556151)),"chart-column-decreasing":()=>c.e(9570).then(c.bind(c,509570)),"chart-column-increasing":()=>c.e(60466).then(c.bind(c,560466)),"bar-chart-4":()=>c.e(60466).then(c.bind(c,560466)),"chart-column-stacked":()=>c.e(77872).then(c.bind(c,77872)),"chart-column":()=>Promise.resolve().then(c.bind(c,601784)),"bar-chart-3":()=>Promise.resolve().then(c.bind(c,601784)),"chart-gantt":()=>c.e(12914).then(c.bind(c,712914)),"chart-line":()=>c.e(22056).then(c.bind(c,322056)),"line-chart":()=>c.e(22056).then(c.bind(c,322056)),"chart-network":()=>c.e(31638).then(c.bind(c,631638)),"chart-no-axes-column-decreasing":()=>c.e(13528).then(c.bind(c,113528)),"chart-no-axes-column-increasing":()=>c.e(17268).then(c.bind(c,817268)),"bar-chart":()=>c.e(17268).then(c.bind(c,817268)),"chart-no-axes-column":()=>c.e(39550).then(c.bind(c,239550)),"bar-chart-2":()=>c.e(39550).then(c.bind(c,239550)),"chart-no-axes-combined":()=>c.e(36651).then(c.bind(c,836651)),"chart-no-axes-gantt":()=>c.e(18416).then(c.bind(c,418416)),"gantt-chart":()=>c.e(18416).then(c.bind(c,418416)),"chart-pie":()=>c.e(76902).then(c.bind(c,476902)),"pie-chart":()=>c.e(76902).then(c.bind(c,476902)),"chart-scatter":()=>c.e(36818).then(c.bind(c,736818)),"scatter-chart":()=>c.e(36818).then(c.bind(c,736818)),"chart-spline":()=>c.e(51379).then(c.bind(c,51379)),"check-check":()=>c.e(91940).then(c.bind(c,191940)),"check-line":()=>c.e(87468).then(c.bind(c,487468)),check:()=>Promise.resolve().then(c.bind(c,111893)),"chef-hat":()=>c.e(26569).then(c.bind(c,326569)),cherry:()=>c.e(4144).then(c.bind(c,104144)),"chess-bishop":()=>c.e(88267).then(c.bind(c,288267)),"chess-king":()=>c.e(57337).then(c.bind(c,857337)),"chess-knight":()=>c.e(52895).then(c.bind(c,352895)),"chess-pawn":()=>c.e(12944).then(c.bind(c,212944)),"chess-queen":()=>c.e(18134).then(c.bind(c,918134)),"chess-rook":()=>c.e(51011).then(c.bind(c,851011)),"chevron-down":()=>Promise.resolve().then(c.bind(c,175151)),"chevron-first":()=>c.e(85457).then(c.bind(c,185457)),"chevron-last":()=>c.e(3267).then(c.bind(c,603267)),"chevron-left":()=>c.e(61310).then(c.bind(c,861310)),"chevron-right":()=>c.e(44357).then(c.bind(c,744357)),"chevron-up":()=>c.e(61026).then(c.bind(c,261026)),"chevrons-down-up":()=>c.e(55730).then(c.bind(c,55730)),"chevrons-down":()=>c.e(31130).then(c.bind(c,31130)),"chevrons-left-right-ellipsis":()=>c.e(19226).then(c.bind(c,419226)),"chevrons-left-right":()=>c.e(51568).then(c.bind(c,651568)),"chevrons-left":()=>c.e(8507).then(c.bind(c,408507)),"chevrons-right-left":()=>c.e(56790).then(c.bind(c,956790)),"chevrons-right":()=>c.e(97842).then(c.bind(c,997842)),"chevrons-up-down":()=>c.e(78336).then(c.bind(c,878336)),"chevrons-up":()=>c.e(37219).then(c.bind(c,437219)),chromium:()=>c.e(91285).then(c.bind(c,291285)),chrome:()=>c.e(91285).then(c.bind(c,291285)),church:()=>c.e(53350).then(c.bind(c,253350)),"cigarette-off":()=>c.e(35413).then(c.bind(c,135413)),cigarette:()=>c.e(9477).then(c.bind(c,409477)),"circle-alert":()=>c.e(55310).then(c.bind(c,255310)),"alert-circle":()=>c.e(55310).then(c.bind(c,255310)),"circle-arrow-down":()=>c.e(79550).then(c.bind(c,179550)),"arrow-down-circle":()=>c.e(79550).then(c.bind(c,179550)),"circle-arrow-left":()=>c.e(26047).then(c.bind(c,426047)),"arrow-left-circle":()=>c.e(26047).then(c.bind(c,426047)),"circle-arrow-out-down-left":()=>c.e(58195).then(c.bind(c,358195)),"arrow-down-left-from-circle":()=>c.e(58195).then(c.bind(c,358195)),"circle-arrow-out-down-right":()=>c.e(85322).then(c.bind(c,785322)),"arrow-down-right-from-circle":()=>c.e(85322).then(c.bind(c,785322)),"circle-arrow-out-up-left":()=>c.e(41976).then(c.bind(c,541976)),"arrow-up-left-from-circle":()=>c.e(41976).then(c.bind(c,541976)),"circle-arrow-out-up-right":()=>c.e(33759).then(c.bind(c,333759)),"arrow-up-right-from-circle":()=>c.e(33759).then(c.bind(c,333759)),"circle-arrow-right":()=>c.e(51694).then(c.bind(c,651694)),"arrow-right-circle":()=>c.e(51694).then(c.bind(c,651694)),"circle-arrow-up":()=>c.e(72623).then(c.bind(c,572623)),"arrow-up-circle":()=>c.e(72623).then(c.bind(c,572623)),"circle-check-big":()=>c.e(86923).then(c.bind(c,86923)),"check-circle":()=>c.e(86923).then(c.bind(c,86923)),"circle-check":()=>Promise.resolve().then(c.bind(c,792188)),"check-circle-2":()=>Promise.resolve().then(c.bind(c,792188)),"circle-chevron-down":()=>c.e(57648).then(c.bind(c,757648)),"chevron-down-circle":()=>c.e(57648).then(c.bind(c,757648)),"circle-chevron-left":()=>c.e(48009).then(c.bind(c,648009)),"chevron-left-circle":()=>c.e(48009).then(c.bind(c,648009)),"circle-chevron-right":()=>c.e(16824).then(c.bind(c,816824)),"chevron-right-circle":()=>c.e(16824).then(c.bind(c,816824)),"circle-chevron-up":()=>c.e(34869).then(c.bind(c,434869)),"chevron-up-circle":()=>c.e(34869).then(c.bind(c,434869)),"circle-dashed":()=>c.e(2719).then(c.bind(c,202719)),"circle-divide":()=>c.e(89915).then(c.bind(c,989915)),"divide-circle":()=>c.e(89915).then(c.bind(c,989915)),"circle-dollar-sign":()=>c.e(56872).then(c.bind(c,556872)),"circle-dot-dashed":()=>c.e(75397).then(c.bind(c,175397)),"circle-dot":()=>c.e(34731).then(c.bind(c,934731)),"circle-ellipsis":()=>c.e(1101).then(c.bind(c,501101)),"circle-equal":()=>c.e(87140).then(c.bind(c,987140)),"circle-fading-arrow-up":()=>c.e(277).then(c.bind(c,500277)),"circle-fading-plus":()=>c.e(60068).then(c.bind(c,660068)),"circle-gauge":()=>c.e(44243).then(c.bind(c,44243)),"gauge-circle":()=>c.e(44243).then(c.bind(c,44243)),"circle-minus":()=>c.e(73540).then(c.bind(c,473540)),"minus-circle":()=>c.e(73540).then(c.bind(c,473540)),"circle-off":()=>c.e(99437).then(c.bind(c,599437)),"circle-parking-off":()=>c.e(75144).then(c.bind(c,975144)),"parking-circle-off":()=>c.e(75144).then(c.bind(c,975144)),"circle-parking":()=>c.e(53268).then(c.bind(c,253268)),"parking-circle":()=>c.e(53268).then(c.bind(c,253268)),"circle-pause":()=>c.e(56650).then(c.bind(c,856650)),"pause-circle":()=>c.e(56650).then(c.bind(c,856650)),"circle-percent":()=>c.e(39781).then(c.bind(c,39781)),"percent-circle":()=>c.e(39781).then(c.bind(c,39781)),"circle-pile":()=>c.e(9970).then(c.bind(c,609970)),"circle-play":()=>c.e(14592).then(c.bind(c,314592)),"play-circle":()=>c.e(14592).then(c.bind(c,314592)),"circle-plus":()=>c.e(84330).then(c.bind(c,284330)),"plus-circle":()=>c.e(84330).then(c.bind(c,284330)),"circle-pound-sterling":()=>c.e(52091).then(c.bind(c,252091)),"circle-power":()=>c.e(45817).then(c.bind(c,745817)),"power-circle":()=>c.e(45817).then(c.bind(c,745817)),"circle-question-mark":()=>c.e(91054).then(c.bind(c,291054)),"help-circle":()=>c.e(91054).then(c.bind(c,291054)),"circle-help":()=>c.e(91054).then(c.bind(c,291054)),"circle-slash-2":()=>c.e(3458).then(c.bind(c,703458)),"circle-slashed":()=>c.e(3458).then(c.bind(c,703458)),"circle-slash":()=>c.e(68621).then(c.bind(c,868621)),"circle-small":()=>c.e(18423).then(c.bind(c,618423)),"circle-star":()=>c.e(86942).then(c.bind(c,886942)),"circle-stop":()=>c.e(48346).then(c.bind(c,648346)),"stop-circle":()=>c.e(48346).then(c.bind(c,648346)),"circle-user-round":()=>c.e(47360).then(c.bind(c,347360)),"user-circle-2":()=>c.e(47360).then(c.bind(c,347360)),"circle-user":()=>c.e(63301).then(c.bind(c,763301)),"user-circle":()=>c.e(63301).then(c.bind(c,763301)),"circle-x":()=>c.e(17892).then(c.bind(c,817892)),"x-circle":()=>c.e(17892).then(c.bind(c,817892)),circle:()=>c.e(58525).then(c.bind(c,58525)),"circuit-board":()=>c.e(99851).then(c.bind(c,199851)),citrus:()=>c.e(78811).then(c.bind(c,678811)),clapperboard:()=>c.e(77969).then(c.bind(c,900350)),"clipboard-check":()=>c.e(11565).then(c.bind(c,633946)),"clipboard-clock":()=>c.e(36084).then(c.bind(c,636084)),"clipboard-copy":()=>c.e(38178).then(c.bind(c,715797)),"clipboard-list":()=>c.e(55200).then(c.bind(c,755200)),"clipboard-minus":()=>c.e(91150).then(c.bind(c,791150)),"clipboard-paste":()=>c.e(20153).then(c.bind(c,620153)),"clipboard-pen-line":()=>c.e(23048).then(c.bind(c,223048)),"clipboard-signature":()=>c.e(23048).then(c.bind(c,223048)),"clipboard-pen":()=>c.e(87417).then(c.bind(c,287417)),"clipboard-edit":()=>c.e(87417).then(c.bind(c,287417)),"clipboard-plus":()=>c.e(78988).then(c.bind(c,878988)),"clipboard-type":()=>c.e(92032).then(c.bind(c,92032)),"clipboard-x":()=>c.e(98097).then(c.bind(c,620478)),clipboard:()=>c.e(86103).then(c.bind(c,786103)),"clock-1":()=>c.e(4233).then(c.bind(c,704233)),"clock-10":()=>c.e(46317).then(c.bind(c,646317)),"clock-11":()=>c.e(68642).then(c.bind(c,768642)),"clock-12":()=>c.e(25999).then(c.bind(c,125999)),"clock-2":()=>c.e(75544).then(c.bind(c,675544)),"clock-3":()=>c.e(86443).then(c.bind(c,586443)),"clock-4":()=>c.e(20418).then(c.bind(c,20418)),"clock-5":()=>c.e(98093).then(c.bind(c,898093)),"clock-6":()=>c.e(37612).then(c.bind(c,137612)),"clock-7":()=>c.e(77775).then(c.bind(c,377775)),"clock-8":()=>c.e(54742).then(c.bind(c,454742)),"clock-9":()=>c.e(2129).then(c.bind(c,202129)),"clock-alert":()=>c.e(17524).then(c.bind(c,317524)),"clock-arrow-down":()=>c.e(14016).then(c.bind(c,114016)),"clock-arrow-up":()=>c.e(84197).then(c.bind(c,84197)),"clock-check":()=>c.e(15650).then(c.bind(c,215650)),"clock-fading":()=>c.e(44689).then(c.bind(c,644689)),"clock-plus":()=>c.e(70740).then(c.bind(c,70740)),clock:()=>Promise.resolve().then(c.bind(c,855087)),"closed-caption":()=>c.e(35774).then(c.bind(c,235774)),"cloud-alert":()=>c.e(95791).then(c.bind(c,95791)),"cloud-backup":()=>c.e(84931).then(c.bind(c,984931)),"cloud-check":()=>c.e(18569).then(c.bind(c,818569)),"cloud-cog":()=>c.e(57954).then(c.bind(c,257954)),"cloud-download":()=>c.e(62809).then(c.bind(c,462809)),"download-cloud":()=>c.e(62809).then(c.bind(c,462809)),"cloud-drizzle":()=>c.e(95823).then(c.bind(c,195823)),"cloud-fog":()=>c.e(23153).then(c.bind(c,723153)),"cloud-hail":()=>c.e(93759).then(c.bind(c,993759)),"cloud-lightning":()=>c.e(27407).then(c.bind(c,627407)),"cloud-moon-rain":()=>c.e(82811).then(c.bind(c,382811)),"cloud-moon":()=>c.e(11768).then(c.bind(c,911768)),"cloud-off":()=>c.e(42408).then(c.bind(c,842408)),"cloud-rain-wind":()=>c.e(36858).then(c.bind(c,336858)),"cloud-rain":()=>c.e(23631).then(c.bind(c,323631)),"cloud-snow":()=>c.e(12950).then(c.bind(c,512950)),"cloud-sun-rain":()=>c.e(34874).then(c.bind(c,534874)),"cloud-sun":()=>c.e(58371).then(c.bind(c,358371)),"cloud-sync":()=>c.e(89906).then(c.bind(c,489906)),"cloud-upload":()=>c.e(75472).then(c.bind(c,575472)),"upload-cloud":()=>c.e(75472).then(c.bind(c,575472)),cloud:()=>c.e(55540).then(c.bind(c,755540)),cloudy:()=>c.e(63421).then(c.bind(c,163421)),clover:()=>c.e(42876).then(c.bind(c,942876)),club:()=>c.e(50081).then(c.bind(c,250081)),"code-xml":()=>c.e(61712).then(c.bind(c,161712)),"code-2":()=>c.e(61712).then(c.bind(c,161712)),code:()=>c.e(64300).then(c.bind(c,564300)),codepen:()=>c.e(73573).then(c.bind(c,673573)),codesandbox:()=>c.e(7069).then(c.bind(c,807069)),coffee:()=>c.e(85689).then(c.bind(c,985689)),cog:()=>c.e(62710).then(c.bind(c,862710)),coins:()=>c.e(90811).then(c.bind(c,390811)),"columns-2":()=>c.e(72997).then(c.bind(c,972997)),columns:()=>c.e(72997).then(c.bind(c,972997)),"columns-3-cog":()=>c.e(4772).then(c.bind(c,804772)),"columns-settings":()=>c.e(4772).then(c.bind(c,804772)),"table-config":()=>c.e(4772).then(c.bind(c,804772)),"columns-3":()=>c.e(77402).then(c.bind(c,77402)),"panels-left-right":()=>c.e(77402).then(c.bind(c,77402)),"columns-4":()=>c.e(20355).then(c.bind(c,920355)),combine:()=>c.e(64596).then(c.bind(c,864596)),command:()=>c.e(73752).then(c.bind(c,73752)),compass:()=>c.e(61593).then(c.bind(c,461593)),component:()=>c.e(61974).then(c.bind(c,61974)),computer:()=>c.e(82668).then(c.bind(c,782668)),"concierge-bell":()=>c.e(26002).then(c.bind(c,626002)),cone:()=>c.e(31550).then(c.bind(c,931550)),construction:()=>c.e(22220).then(c.bind(c,522220)),"contact-round":()=>c.e(22544).then(c.bind(c,622544)),"contact-2":()=>c.e(22544).then(c.bind(c,622544)),contact:()=>c.e(85397).then(c.bind(c,85397)),container:()=>c.e(95158).then(c.bind(c,195158)),contrast:()=>c.e(30312).then(c.bind(c,507931)),cookie:()=>c.e(45347).then(c.bind(c,345347)),"cooking-pot":()=>c.e(42271).then(c.bind(c,642271)),"copy-check":()=>c.e(44801).then(c.bind(c,444801)),"copy-minus":()=>c.e(24429).then(c.bind(c,724429)),"copy-plus":()=>c.e(98309).then(c.bind(c,698309)),"copy-slash":()=>c.e(6683).then(c.bind(c,812712)),"copy-x":()=>c.e(38602).then(c.bind(c,416221)),copy:()=>c.e(32284).then(c.bind(c,832284)),copyleft:()=>c.e(3041).then(c.bind(c,303041)),copyright:()=>c.e(95280).then(c.bind(c,295280)),"corner-down-left":()=>c.e(40363).then(c.bind(c,140363)),"corner-down-right":()=>c.e(95029).then(c.bind(c,717410)),"corner-left-down":()=>c.e(22881).then(c.bind(c,722881)),"corner-left-up":()=>c.e(85208).then(c.bind(c,385208)),"corner-right-down":()=>c.e(46704).then(c.bind(c,746704)),"corner-right-up":()=>c.e(32821).then(c.bind(c,632821)),"corner-up-left":()=>c.e(15760).then(c.bind(c,815760)),"corner-up-right":()=>c.e(36695).then(c.bind(c,936695)),cpu:()=>c.e(82431).then(c.bind(c,282431)),"creative-commons":()=>c.e(14347).then(c.bind(c,814347)),"credit-card":()=>c.e(85631).then(c.bind(c,285631)),croissant:()=>c.e(54033).then(c.bind(c,54033)),crop:()=>c.e(63983).then(c.bind(c,63983)),cross:()=>c.e(24629).then(c.bind(c,424629)),crosshair:()=>c.e(81165).then(c.bind(c,81165)),crown:()=>c.e(47658).then(c.bind(c,347658)),cuboid:()=>c.e(60891).then(c.bind(c,860891)),"cup-soda":()=>c.e(99311).then(c.bind(c,99311)),currency:()=>c.e(21454).then(c.bind(c,221454)),cylinder:()=>c.e(15703).then(c.bind(c,415703)),dam:()=>c.e(2639).then(c.bind(c,602639)),"database-backup":()=>c.e(96363).then(c.bind(c,696363)),"database-search":()=>c.e(32841).then(c.bind(c,932841)),"database-zap":()=>c.e(74402).then(c.bind(c,74402)),database:()=>Promise.resolve().then(c.bind(c,811916)),"decimals-arrow-left":()=>c.e(98203).then(c.bind(c,298203)),"decimals-arrow-right":()=>c.e(74034).then(c.bind(c,474034)),delete:()=>c.e(63522).then(c.bind(c,163522)),dessert:()=>c.e(74095).then(c.bind(c,674095)),diameter:()=>c.e(60590).then(c.bind(c,60590)),"diamond-minus":()=>c.e(66092).then(c.bind(c,266092)),"diamond-percent":()=>c.e(63437).then(c.bind(c,763437)),"percent-diamond":()=>c.e(63437).then(c.bind(c,763437)),"diamond-plus":()=>c.e(33474).then(c.bind(c,233474)),diamond:()=>c.e(85125).then(c.bind(c,885125)),"dice-1":()=>c.e(99284).then(c.bind(c,899284)),"dice-2":()=>c.e(2453).then(c.bind(c,502453)),"dice-3":()=>c.e(22826).then(c.bind(c,522826)),"dice-4":()=>c.e(26355).then(c.bind(c,726355)),"dice-5":()=>c.e(13280).then(c.bind(c,813280)),"dice-6":()=>c.e(36465).then(c.bind(c,336465)),dices:()=>c.e(31705).then(c.bind(c,231705)),diff:()=>c.e(40630).then(c.bind(c,840630)),"disc-2":()=>c.e(72263).then(c.bind(c,872263)),"disc-3":()=>c.e(11876).then(c.bind(c,11876)),"disc-album":()=>c.e(60114).then(c.bind(c,660114)),disc:()=>c.e(32604).then(c.bind(c,332604)),divide:()=>c.e(27287).then(c.bind(c,649668)),"dna-off":()=>c.e(41648).then(c.bind(c,341648)),dna:()=>c.e(85148).then(c.bind(c,185148)),dock:()=>c.e(26570).then(c.bind(c,326570)),dog:()=>c.e(15115).then(c.bind(c,715115)),"dollar-sign":()=>c.e(77317).then(c.bind(c,177317)),donut:()=>c.e(28989).then(c.bind(c,228989)),"door-closed-locked":()=>c.e(47645).then(c.bind(c,647645)),"door-closed":()=>c.e(77846).then(c.bind(c,177846)),"door-open":()=>c.e(17498).then(c.bind(c,17498)),dot:()=>c.e(87486).then(c.bind(c,987486)),download:()=>c.e(80906).then(c.bind(c,280906)),"drafting-compass":()=>c.e(95037).then(c.bind(c,595037)),drama:()=>c.e(2334).then(c.bind(c,302334)),dribbble:()=>c.e(90403).then(c.bind(c,390403)),drill:()=>c.e(46176).then(c.bind(c,846176)),drone:()=>c.e(19255).then(c.bind(c,119255)),"droplet-off":()=>c.e(77255).then(c.bind(c,777255)),droplet:()=>c.e(92979).then(c.bind(c,292979)),droplets:()=>c.e(94558).then(c.bind(c,594558)),drum:()=>c.e(87889).then(c.bind(c,287889)),drumstick:()=>c.e(40649).then(c.bind(c,840649)),dumbbell:()=>c.e(44824).then(c.bind(c,444824)),"ear-off":()=>c.e(33853).then(c.bind(c,333853)),ear:()=>c.e(89133).then(c.bind(c,89133)),"earth-lock":()=>c.e(62473).then(c.bind(c,62473)),earth:()=>c.e(62561).then(c.bind(c,562561)),"globe-2":()=>c.e(62561).then(c.bind(c,562561)),eclipse:()=>c.e(9596).then(c.bind(c,509596)),"egg-fried":()=>c.e(75699).then(c.bind(c,775699)),"egg-off":()=>c.e(51852).then(c.bind(c,51852)),egg:()=>c.e(85080).then(c.bind(c,785080)),"ellipsis-vertical":()=>c.e(79877).then(c.bind(c,379877)),"more-vertical":()=>c.e(79877).then(c.bind(c,379877)),ellipsis:()=>c.e(71754).then(c.bind(c,71754)),"more-horizontal":()=>c.e(71754).then(c.bind(c,71754)),"equal-approximately":()=>c.e(25289).then(c.bind(c,825289)),"equal-not":()=>c.e(35321).then(c.bind(c,735321)),equal:()=>c.e(58505).then(c.bind(c,358505)),eraser:()=>c.e(66273).then(c.bind(c,566273)),"ethernet-port":()=>c.e(51728).then(c.bind(c,451728)),euro:()=>c.e(5384).then(c.bind(c,105384)),"ev-charger":()=>c.e(52041).then(c.bind(c,652041)),expand:()=>c.e(92241).then(c.bind(c,792241)),"external-link":()=>c.e(87663).then(c.bind(c,787663)),"eye-closed":()=>c.e(75697).then(c.bind(c,75697)),"eye-off":()=>c.e(26276).then(c.bind(c,426276)),eye:()=>c.e(78896).then(c.bind(c,878896)),facebook:()=>c.e(15161).then(c.bind(c,215161)),factory:()=>c.e(86719).then(c.bind(c,586719)),fan:()=>c.e(26152).then(c.bind(c,326152)),"fast-forward":()=>c.e(16575).then(c.bind(c,116575)),feather:()=>c.e(79618).then(c.bind(c,679618)),fence:()=>c.e(86992).then(c.bind(c,686992)),"ferris-wheel":()=>c.e(30738).then(c.bind(c,30738)),figma:()=>c.e(66109).then(c.bind(c,366109)),"file-archive":()=>c.e(17480).then(c.bind(c,617480)),"file-axis-3d":()=>c.e(30121).then(c.bind(c,630121)),"file-axis-3-d":()=>c.e(30121).then(c.bind(c,630121)),"file-badge":()=>c.e(49509).then(c.bind(c,949509)),"file-badge-2":()=>c.e(49509).then(c.bind(c,949509)),"file-box":()=>c.e(39055).then(c.bind(c,939055)),"file-braces-corner":()=>c.e(6812).then(c.bind(c,906812)),"file-json-2":()=>c.e(6812).then(c.bind(c,906812)),"file-braces":()=>c.e(45956).then(c.bind(c,445956)),"file-json":()=>c.e(45956).then(c.bind(c,445956)),"file-chart-column-increasing":()=>c.e(7009).then(c.bind(c,507009)),"file-bar-chart":()=>c.e(7009).then(c.bind(c,507009)),"file-chart-column":()=>c.e(64885).then(c.bind(c,164885)),"file-bar-chart-2":()=>c.e(64885).then(c.bind(c,164885)),"file-chart-line":()=>c.e(8869).then(c.bind(c,108869)),"file-line-chart":()=>c.e(8869).then(c.bind(c,108869)),"file-chart-pie":()=>c.e(65165).then(c.bind(c,965165)),"file-pie-chart":()=>c.e(65165).then(c.bind(c,965165)),"file-check-corner":()=>c.e(15298).then(c.bind(c,915298)),"file-check-2":()=>c.e(15298).then(c.bind(c,915298)),"file-check":()=>c.e(79402).then(c.bind(c,379402)),"file-clock":()=>c.e(34404).then(c.bind(c,434404)),"file-code-corner":()=>c.e(85179).then(c.bind(c,785179)),"file-code-2":()=>c.e(85179).then(c.bind(c,785179)),"file-code":()=>c.e(68933).then(c.bind(c,368933)),"file-cog":()=>c.e(11465).then(c.bind(c,911465)),"file-cog-2":()=>c.e(11465).then(c.bind(c,911465)),"file-diff":()=>c.e(99971).then(c.bind(c,999971)),"file-digit":()=>c.e(62151).then(c.bind(c,662151)),"file-down":()=>c.e(21652).then(c.bind(c,821652)),"file-exclamation-point":()=>c.e(42088).then(c.bind(c,642088)),"file-warning":()=>c.e(42088).then(c.bind(c,642088)),"file-headphone":()=>c.e(17992).then(c.bind(c,117992)),"file-audio":()=>c.e(17992).then(c.bind(c,117992)),"file-audio-2":()=>c.e(17992).then(c.bind(c,117992)),"file-heart":()=>c.e(92382).then(c.bind(c,892382)),"file-image":()=>c.e(23347).then(c.bind(c,123347)),"file-input":()=>c.e(12710).then(c.bind(c,612710)),"file-key":()=>c.e(95533).then(c.bind(c,695533)),"file-key-2":()=>c.e(95533).then(c.bind(c,695533)),"file-lock":()=>c.e(22327).then(c.bind(c,822327)),"file-lock-2":()=>c.e(22327).then(c.bind(c,822327)),"file-minus-corner":()=>c.e(8222).then(c.bind(c,708222)),"file-minus-2":()=>c.e(8222).then(c.bind(c,708222)),"file-minus":()=>c.e(79134).then(c.bind(c,79134)),"file-music":()=>c.e(6361).then(c.bind(c,706361)),"file-output":()=>c.e(93321).then(c.bind(c,93321)),"file-pen-line":()=>c.e(77656).then(c.bind(c,977656)),"file-signature":()=>c.e(77656).then(c.bind(c,977656)),"file-pen":()=>c.e(20745).then(c.bind(c,20745)),"file-edit":()=>c.e(20745).then(c.bind(c,20745)),"file-play":()=>c.e(78854).then(c.bind(c,178854)),"file-video":()=>c.e(78854).then(c.bind(c,178854)),"file-plus-corner":()=>c.e(276).then(c.bind(c,100276)),"file-plus-2":()=>c.e(276).then(c.bind(c,100276)),"file-plus":()=>c.e(69724).then(c.bind(c,369724)),"file-question-mark":()=>c.e(76036).then(c.bind(c,176036)),"file-question":()=>c.e(76036).then(c.bind(c,176036)),"file-scan":()=>c.e(61869).then(c.bind(c,661869)),"file-search-corner":()=>c.e(53640).then(c.bind(c,553640)),"file-search-2":()=>c.e(53640).then(c.bind(c,553640)),"file-search":()=>c.e(11432).then(c.bind(c,211432)),"file-signal":()=>c.e(56032).then(c.bind(c,156032)),"file-volume-2":()=>c.e(56032).then(c.bind(c,156032)),"file-sliders":()=>c.e(3160).then(c.bind(c,603160)),"file-spreadsheet":()=>c.e(35084).then(c.bind(c,535084)),"file-stack":()=>c.e(85802).then(c.bind(c,585802)),"file-symlink":()=>c.e(53213).then(c.bind(c,653213)),"file-terminal":()=>c.e(74444).then(c.bind(c,374444)),"file-text":()=>c.e(35303).then(c.bind(c,635303)),"file-type-corner":()=>c.e(84880).then(c.bind(c,284880)),"file-type-2":()=>c.e(84880).then(c.bind(c,284880)),"file-type":()=>c.e(38736).then(c.bind(c,538736)),"file-up":()=>c.e(88017).then(c.bind(c,588017)),"file-user":()=>c.e(95979).then(c.bind(c,895979)),"file-video-camera":()=>c.e(45661).then(c.bind(c,345661)),"file-video-2":()=>c.e(45661).then(c.bind(c,345661)),"file-volume":()=>c.e(84706).then(c.bind(c,184706)),"file-x-corner":()=>c.e(85966).then(c.bind(c,685966)),"file-x-2":()=>c.e(85966).then(c.bind(c,685966)),"file-x":()=>c.e(5646).then(c.bind(c,805646)),file:()=>c.e(31399).then(c.bind(c,31399)),files:()=>c.e(53658).then(c.bind(c,53658)),film:()=>c.e(68639).then(c.bind(c,468639)),"fingerprint-pattern":()=>c.e(89214).then(c.bind(c,189214)),fingerprint:()=>c.e(89214).then(c.bind(c,189214)),"fire-extinguisher":()=>c.e(36029).then(c.bind(c,36029)),"fish-off":()=>c.e(26315).then(c.bind(c,426315)),"fish-symbol":()=>c.e(672).then(c.bind(c,300672)),fish:()=>c.e(263).then(c.bind(c,300263)),"fishing-hook":()=>c.e(1871).then(c.bind(c,101871)),"flag-off":()=>c.e(38739).then(c.bind(c,738739)),"flag-triangle-left":()=>c.e(58456).then(c.bind(c,558456)),"flag-triangle-right":()=>c.e(47327).then(c.bind(c,447327)),flag:()=>c.e(90863).then(c.bind(c,90863)),"flame-kindling":()=>c.e(4966).then(c.bind(c,482585)),flame:()=>c.e(47866).then(c.bind(c,747866)),"flashlight-off":()=>c.e(28307).then(c.bind(c,428307)),flashlight:()=>c.e(76335).then(c.bind(c,976335)),"flask-conical-off":()=>c.e(57002).then(c.bind(c,557002)),"flask-conical":()=>c.e(17266).then(c.bind(c,617266)),"flask-round":()=>c.e(62015).then(c.bind(c,262015)),"flip-horizontal-2":()=>c.e(80568).then(c.bind(c,180568)),"flip-vertical-2":()=>c.e(97950).then(c.bind(c,197950)),"flower-2":()=>c.e(36317).then(c.bind(c,636317)),flower:()=>c.e(57126).then(c.bind(c,257126)),focus:()=>c.e(91721).then(c.bind(c,891721)),"fold-horizontal":()=>c.e(46415).then(c.bind(c,646415)),"fold-vertical":()=>c.e(82513).then(c.bind(c,782513)),"folder-archive":()=>c.e(41946).then(c.bind(c,141946)),"folder-check":()=>c.e(40644).then(c.bind(c,140644)),"folder-clock":()=>c.e(20834).then(c.bind(c,220834)),"folder-closed":()=>c.e(46082).then(c.bind(c,946082)),"folder-code":()=>c.e(14223).then(c.bind(c,14223)),"folder-cog":()=>c.e(44011).then(c.bind(c,244011)),"folder-cog-2":()=>c.e(44011).then(c.bind(c,244011)),"folder-dot":()=>c.e(75683).then(c.bind(c,975683)),"folder-down":()=>c.e(8194).then(c.bind(c,808194)),"folder-git-2":()=>c.e(82339).then(c.bind(c,682339)),"folder-git":()=>c.e(64224).then(c.bind(c,664224)),"folder-heart":()=>c.e(19352).then(c.bind(c,219352)),"folder-input":()=>c.e(24776).then(c.bind(c,624776)),"folder-kanban":()=>c.e(61145).then(c.bind(c,261145)),"folder-key":()=>c.e(31983).then(c.bind(c,731983)),"folder-lock":()=>c.e(21421).then(c.bind(c,421421)),"folder-minus":()=>c.e(63151).then(c.bind(c,885532)),"folder-open-dot":()=>c.e(77880).then(c.bind(c,677880)),"folder-open":()=>c.e(11838).then(c.bind(c,111838)),"folder-output":()=>c.e(53039).then(c.bind(c,153039)),"folder-pen":()=>c.e(85051).then(c.bind(c,885051)),"folder-edit":()=>c.e(85051).then(c.bind(c,885051)),"folder-plus":()=>c.e(77010).then(c.bind(c,377010)),"folder-root":()=>c.e(41002).then(c.bind(c,741002)),"folder-search-2":()=>c.e(67781).then(c.bind(c,67781)),"folder-search":()=>c.e(44926).then(c.bind(c,244926)),"folder-symlink":()=>c.e(10103).then(c.bind(c,410103)),"folder-sync":()=>c.e(3661).then(c.bind(c,103661)),"folder-tree":()=>c.e(90426).then(c.bind(c,290426)),"folder-up":()=>c.e(45867).then(c.bind(c,945867)),"folder-x":()=>c.e(59036).then(c.bind(c,859036)),folder:()=>c.e(5333).then(c.bind(c,305333)),folders:()=>c.e(47456).then(c.bind(c,847456)),footprints:()=>c.e(59381).then(c.bind(c,159381)),forklift:()=>c.e(91676).then(c.bind(c,991676)),form:()=>c.e(91703).then(c.bind(c,91703)),forward:()=>c.e(79244).then(c.bind(c,179244)),frame:()=>c.e(89048).then(c.bind(c,89048)),framer:()=>c.e(87616).then(c.bind(c,887616)),frown:()=>c.e(75101).then(c.bind(c,75101)),fuel:()=>c.e(83557).then(c.bind(c,683557)),fullscreen:()=>c.e(9700).then(c.bind(c,709700)),"funnel-plus":()=>c.e(72586).then(c.bind(c,672586)),"funnel-x":()=>c.e(68804).then(c.bind(c,68804)),"filter-x":()=>c.e(68804).then(c.bind(c,68804)),funnel:()=>c.e(12797).then(c.bind(c,12797)),filter:()=>c.e(12797).then(c.bind(c,12797)),"gallery-horizontal-end":()=>c.e(12276).then(c.bind(c,612276)),"gallery-horizontal":()=>c.e(10944).then(c.bind(c,810944)),"gallery-thumbnails":()=>c.e(65665).then(c.bind(c,165665)),"gallery-vertical-end":()=>c.e(69098).then(c.bind(c,169098)),"gallery-vertical":()=>c.e(130).then(c.bind(c,130)),"gamepad-2":()=>c.e(56561).then(c.bind(c,556561)),"gamepad-directional":()=>c.e(67767).then(c.bind(c,467767)),gamepad:()=>c.e(50402).then(c.bind(c,850402)),gauge:()=>c.e(23022).then(c.bind(c,623022)),gavel:()=>c.e(12874).then(c.bind(c,190493)),gem:()=>c.e(66286).then(c.bind(c,966286)),"georgian-lari":()=>c.e(60985).then(c.bind(c,883366)),ghost:()=>c.e(90142).then(c.bind(c,990142)),gift:()=>c.e(69595).then(c.bind(c,669595)),"git-branch-minus":()=>c.e(68003).then(c.bind(c,868003)),"git-branch-plus":()=>c.e(95835).then(c.bind(c,195835)),"git-branch":()=>c.e(5394).then(c.bind(c,205394)),"git-commit-horizontal":()=>c.e(12712).then(c.bind(c,12712)),"git-commit":()=>c.e(12712).then(c.bind(c,12712)),"git-commit-vertical":()=>c.e(73818).then(c.bind(c,73818)),"git-compare-arrows":()=>c.e(66846).then(c.bind(c,866846)),"git-compare":()=>c.e(24607).then(c.bind(c,624607)),"git-fork":()=>c.e(68630).then(c.bind(c,668630)),"git-graph":()=>c.e(94268).then(c.bind(c,194268)),"git-merge-conflict":()=>c.e(4415).then(c.bind(c,604415)),"git-merge":()=>c.e(39300).then(c.bind(c,839300)),"git-pull-request-arrow":()=>c.e(13709).then(c.bind(c,313709)),"git-pull-request-closed":()=>c.e(81550).then(c.bind(c,781550)),"git-pull-request-create-arrow":()=>c.e(24338).then(c.bind(c,524338)),"git-pull-request-create":()=>c.e(32566).then(c.bind(c,232566)),"git-pull-request-draft":()=>c.e(96139).then(c.bind(c,896139)),"git-pull-request":()=>c.e(12337).then(c.bind(c,612337)),github:()=>c.e(70310).then(c.bind(c,870310)),gitlab:()=>c.e(51622).then(c.bind(c,351622)),"glass-water":()=>c.e(32815).then(c.bind(c,232815)),glasses:()=>c.e(17025).then(c.bind(c,317025)),"globe-lock":()=>c.e(66606).then(c.bind(c,666606)),"globe-off":()=>c.e(46832).then(c.bind(c,146832)),"globe-x":()=>c.e(44925).then(c.bind(c,244925)),globe:()=>Promise.resolve().then(c.bind(c,423932)),goal:()=>c.e(43354).then(c.bind(c,343354)),gpu:()=>c.e(59515).then(c.bind(c,759515)),"graduation-cap":()=>c.e(86132).then(c.bind(c,286132)),grape:()=>c.e(79398).then(c.bind(c,479398)),"grid-2x2-check":()=>c.e(28769).then(c.bind(c,428769)),"grid-2-x-2-check":()=>c.e(28769).then(c.bind(c,428769)),"grid-2x2-plus":()=>c.e(65061).then(c.bind(c,465061)),"grid-2-x-2-plus":()=>c.e(65061).then(c.bind(c,465061)),"grid-2x2-x":()=>c.e(4861).then(c.bind(c,804861)),"grid-2-x-2-x":()=>c.e(4861).then(c.bind(c,804861)),"grid-2x2":()=>c.e(56860).then(c.bind(c,156860)),"grid-2-x-2":()=>c.e(56860).then(c.bind(c,156860)),"grid-3x2":()=>c.e(86375).then(c.bind(c,786375)),"grid-3x3":()=>c.e(25988).then(c.bind(c,925988)),grid:()=>c.e(25988).then(c.bind(c,925988)),"grid-3-x-3":()=>c.e(25988).then(c.bind(c,925988)),"grip-horizontal":()=>c.e(78106).then(c.bind(c,578106)),"grip-vertical":()=>c.e(87132).then(c.bind(c,787132)),grip:()=>c.e(30249).then(c.bind(c,730249)),group:()=>c.e(44186).then(c.bind(c,344186)),guitar:()=>c.e(68783).then(c.bind(c,268783)),ham:()=>c.e(29035).then(c.bind(c,329035)),hamburger:()=>c.e(40562).then(c.bind(c,840562)),hammer:()=>c.e(34975).then(c.bind(c,834975)),"hand-coins":()=>c.e(67535).then(c.bind(c,267535)),"hand-fist":()=>c.e(71351).then(c.bind(c,771351)),"hand-grab":()=>c.e(34839).then(c.bind(c,434839)),grab:()=>c.e(34839).then(c.bind(c,434839)),"hand-heart":()=>c.e(95093).then(c.bind(c,395093)),"hand-helping":()=>c.e(54940).then(c.bind(c,754940)),"helping-hand":()=>c.e(54940).then(c.bind(c,754940)),"hand-metal":()=>c.e(62170).then(c.bind(c,662170)),"hand-platter":()=>c.e(95741).then(c.bind(c,495741)),hand:()=>c.e(40524).then(c.bind(c,640524)),handbag:()=>c.e(86444).then(c.bind(c,486444)),handshake:()=>c.e(51560).then(c.bind(c,351560)),"hard-drive-download":()=>c.e(95330).then(c.bind(c,695330)),"hard-drive-upload":()=>c.e(64667).then(c.bind(c,64667)),"hard-drive":()=>c.e(34129).then(c.bind(c,34129)),"hard-hat":()=>c.e(55432).then(c.bind(c,155432)),hash:()=>c.e(97353).then(c.bind(c,997353)),"hat-glasses":()=>c.e(35025).then(c.bind(c,235025)),haze:()=>c.e(62291).then(c.bind(c,862291)),hd:()=>c.e(82009).then(c.bind(c,982009)),"hdmi-port":()=>c.e(78683).then(c.bind(c,178683)),"heading-1":()=>c.e(85289).then(c.bind(c,685289)),"heading-2":()=>c.e(72952).then(c.bind(c,172952)),"heading-3":()=>c.e(67499).then(c.bind(c,567499)),"heading-4":()=>c.e(1474).then(c.bind(c,1474)),"heading-5":()=>c.e(79149).then(c.bind(c,879149)),"heading-6":()=>c.e(18668).then(c.bind(c,118668)),heading:()=>c.e(12591).then(c.bind(c,12591)),"headphone-off":()=>c.e(79271).then(c.bind(c,679271)),headphones:()=>c.e(15774).then(c.bind(c,115774)),headset:()=>c.e(95271).then(c.bind(c,195271)),"heart-crack":()=>c.e(4202).then(c.bind(c,104202)),"heart-handshake":()=>c.e(84541).then(c.bind(c,384541)),"heart-minus":()=>c.e(25656).then(c.bind(c,125656)),"heart-off":()=>c.e(38305).then(c.bind(c,538305)),"heart-plus":()=>c.e(60238).then(c.bind(c,60238)),"heart-pulse":()=>c.e(36261).then(c.bind(c,136261)),heart:()=>c.e(99841).then(c.bind(c,199841)),heater:()=>c.e(89448).then(c.bind(c,389448)),helicopter:()=>c.e(69540).then(c.bind(c,869540)),hexagon:()=>c.e(69217).then(c.bind(c,569217)),highlighter:()=>c.e(74478).then(c.bind(c,474478)),history:()=>c.e(69709).then(c.bind(c,269709)),"hop-off":()=>c.e(1862).then(c.bind(c,501862)),hop:()=>c.e(95710).then(c.bind(c,795710)),hospital:()=>c.e(23531).then(c.bind(c,23531)),hotel:()=>c.e(82871).then(c.bind(c,382871)),hourglass:()=>c.e(82479).then(c.bind(c,282479)),"house-heart":()=>c.e(91400).then(c.bind(c,691400)),"house-plug":()=>c.e(6750).then(c.bind(c,806750)),"house-plus":()=>c.e(49602).then(c.bind(c,549602)),"house-wifi":()=>c.e(35147).then(c.bind(c,635147)),house:()=>c.e(49797).then(c.bind(c,349797)),home:()=>c.e(49797).then(c.bind(c,349797)),"ice-cream-bowl":()=>c.e(1202).then(c.bind(c,1202)),"ice-cream-2":()=>c.e(1202).then(c.bind(c,1202)),"ice-cream-cone":()=>c.e(53333).then(c.bind(c,53333)),"ice-cream":()=>c.e(53333).then(c.bind(c,53333)),"id-card-lanyard":()=>c.e(4085).then(c.bind(c,904085)),"id-card":()=>c.e(93407).then(c.bind(c,393407)),"image-down":()=>c.e(39481).then(c.bind(c,839481)),"image-minus":()=>c.e(28493).then(c.bind(c,728493)),"image-off":()=>c.e(20080).then(c.bind(c,720080)),"image-play":()=>c.e(43075).then(c.bind(c,643075)),"image-plus":()=>c.e(61861).then(c.bind(c,461861)),"image-up":()=>c.e(83824).then(c.bind(c,783824)),"image-upscale":()=>c.e(32272).then(c.bind(c,632272)),image:()=>c.e(94396).then(c.bind(c,94396)),images:()=>c.e(84396).then(c.bind(c,662015)),import:()=>c.e(13212).then(c.bind(c,913212)),inbox:()=>c.e(12245).then(c.bind(c,412245)),"indian-rupee":()=>c.e(86158).then(c.bind(c,286158)),infinity:()=>c.e(47237).then(c.bind(c,547237)),info:()=>c.e(61637).then(c.bind(c,661637)),"inspection-panel":()=>c.e(9924).then(c.bind(c,909924)),instagram:()=>c.e(10373).then(c.bind(c,910373)),italic:()=>c.e(7705).then(c.bind(c,207705)),"iteration-ccw":()=>c.e(85156).then(c.bind(c,185156)),"iteration-cw":()=>c.e(85393).then(c.bind(c,785393)),"japanese-yen":()=>c.e(2423).then(c.bind(c,602423)),joystick:()=>c.e(21199).then(c.bind(c,821199)),kanban:()=>c.e(47574).then(c.bind(c,747574)),kayak:()=>c.e(68738).then(c.bind(c,568738)),"key-round":()=>c.e(46367).then(c.bind(c,146367)),"key-square":()=>c.e(92336).then(c.bind(c,692336)),key:()=>c.e(52062).then(c.bind(c,652062)),"keyboard-music":()=>c.e(61578).then(c.bind(c,561578)),"keyboard-off":()=>c.e(4056).then(c.bind(c,804056)),keyboard:()=>c.e(87076).then(c.bind(c,187076)),"lamp-ceiling":()=>c.e(42609).then(c.bind(c,542609)),"lamp-desk":()=>c.e(81081).then(c.bind(c,581081)),"lamp-floor":()=>c.e(78972).then(c.bind(c,578972)),"lamp-wall-down":()=>c.e(31697).then(c.bind(c,531697)),"lamp-wall-up":()=>c.e(99816).then(c.bind(c,999816)),lamp:()=>c.e(57623).then(c.bind(c,757623)),"land-plot":()=>c.e(25930).then(c.bind(c,725930)),landmark:()=>c.e(46209).then(c.bind(c,246209)),languages:()=>c.e(96550).then(c.bind(c,196550)),"laptop-minimal-check":()=>c.e(48606).then(c.bind(c,248606)),"laptop-minimal":()=>c.e(99755).then(c.bind(c,699755)),"laptop-2":()=>c.e(99755).then(c.bind(c,699755)),laptop:()=>c.e(86469).then(c.bind(c,386469)),"lasso-select":()=>c.e(24244).then(c.bind(c,224244)),lasso:()=>c.e(4819).then(c.bind(c,404819)),laugh:()=>c.e(6320).then(c.bind(c,906320)),"layers-2":()=>c.e(59272).then(c.bind(c,959272)),"layers-plus":()=>c.e(49540).then(c.bind(c,849540)),layers:()=>c.e(74527).then(c.bind(c,74527)),"layers-3":()=>c.e(74527).then(c.bind(c,74527)),"layout-dashboard":()=>c.e(46050).then(c.bind(c,946050)),"layout-grid":()=>c.e(64956).then(c.bind(c,264956)),"layout-list":()=>c.e(16435).then(c.bind(c,838816)),"layout-panel-left":()=>c.e(25060).then(c.bind(c,225060)),"layout-panel-top":()=>c.e(51746).then(c.bind(c,51746)),"layout-template":()=>c.e(81030).then(c.bind(c,881030)),leaf:()=>c.e(66065).then(c.bind(c,266065)),"leafy-green":()=>c.e(26560).then(c.bind(c,526560)),lectern:()=>c.e(85886).then(c.bind(c,285886)),"lens-concave":()=>c.e(11589).then(c.bind(c,311589)),"lens-convex":()=>c.e(58057).then(c.bind(c,358057)),"library-big":()=>c.e(34441).then(c.bind(c,734441)),library:()=>c.e(22362).then(c.bind(c,722362)),"life-buoy":()=>c.e(52561).then(c.bind(c,952561)),ligature:()=>c.e(37456).then(c.bind(c,137456)),"lightbulb-off":()=>c.e(58498).then(c.bind(c,258498)),lightbulb:()=>c.e(51722).then(c.bind(c,51722)),"line-dot-right-horizontal":()=>c.e(979).then(c.bind(c,100979)),"line-squiggle":()=>c.e(99803).then(c.bind(c,999803)),"link-2-off":()=>c.e(77434).then(c.bind(c,577434)),"link-2":()=>c.e(80610).then(c.bind(c,980610)),link:()=>c.e(32877).then(c.bind(c,432877)),linkedin:()=>c.e(60043).then(c.bind(c,960043)),"list-check":()=>c.e(74016).then(c.bind(c,274016)),"list-checks":()=>c.e(42635).then(c.bind(c,42635)),"list-chevrons-down-up":()=>c.e(17809).then(c.bind(c,517809)),"list-chevrons-up-down":()=>c.e(28895).then(c.bind(c,328895)),"list-collapse":()=>c.e(11173).then(c.bind(c,911173)),"list-end":()=>c.e(28321).then(c.bind(c,628321)),"list-filter-plus":()=>c.e(88921).then(c.bind(c,688921)),"list-filter":()=>c.e(28720).then(c.bind(c,128720)),"list-indent-decrease":()=>c.e(46865).then(c.bind(c,446865)),outdent:()=>c.e(46865).then(c.bind(c,446865)),"indent-decrease":()=>c.e(46865).then(c.bind(c,446865)),"list-indent-increase":()=>c.e(63225).then(c.bind(c,663225)),indent:()=>c.e(63225).then(c.bind(c,663225)),"indent-increase":()=>c.e(63225).then(c.bind(c,663225)),"list-minus":()=>c.e(79896).then(c.bind(c,479896)),"list-music":()=>c.e(81139).then(c.bind(c,81139)),"list-ordered":()=>c.e(9901).then(c.bind(c,309901)),"list-plus":()=>c.e(65710).then(c.bind(c,565710)),"list-restart":()=>c.e(58843).then(c.bind(c,858843)),"list-start":()=>c.e(51176).then(c.bind(c,351176)),"list-todo":()=>c.e(93894).then(c.bind(c,793894)),"list-tree":()=>c.e(69070).then(c.bind(c,169070)),"list-video":()=>c.e(47080).then(c.bind(c,924699)),"list-x":()=>c.e(66880).then(c.bind(c,566880)),list:()=>c.e(83233).then(c.bind(c,883233)),"loader-circle":()=>Promise.resolve().then(c.bind(c,215071)),"loader-2":()=>Promise.resolve().then(c.bind(c,215071)),"loader-pinwheel":()=>c.e(44209).then(c.bind(c,144209)),loader:()=>c.e(95970).then(c.bind(c,695970)),"locate-fixed":()=>c.e(80068).then(c.bind(c,880068)),"locate-off":()=>c.e(32939).then(c.bind(c,232939)),locate:()=>c.e(52647).then(c.bind(c,952647)),"lock-keyhole-open":()=>c.e(68871).then(c.bind(c,68871)),"unlock-keyhole":()=>c.e(68871).then(c.bind(c,68871)),"lock-keyhole":()=>c.e(29286).then(c.bind(c,829286)),"lock-open":()=>c.e(21387).then(c.bind(c,421387)),unlock:()=>c.e(21387).then(c.bind(c,421387)),lock:()=>Promise.resolve().then(c.bind(c,604466)),"log-in":()=>c.e(28055).then(c.bind(c,28055)),"log-out":()=>c.e(81110).then(c.bind(c,81110)),logs:()=>c.e(27742).then(c.bind(c,427742)),lollipop:()=>c.e(44206).then(c.bind(c,644206)),luggage:()=>c.e(62789).then(c.bind(c,462789)),magnet:()=>c.e(59980).then(c.bind(c,437599)),"mail-check":()=>c.e(20151).then(c.bind(c,520151)),"mail-minus":()=>c.e(47655).then(c.bind(c,347655)),"mail-open":()=>c.e(871).then(c.bind(c,500871)),"mail-plus":()=>c.e(14767).then(c.bind(c,714767)),"mail-question-mark":()=>c.e(69885).then(c.bind(c,769885)),"mail-question":()=>c.e(69885).then(c.bind(c,769885)),"mail-search":()=>c.e(32571).then(c.bind(c,532571)),"mail-warning":()=>c.e(44971).then(c.bind(c,444971)),"mail-x":()=>c.e(80871).then(c.bind(c,880871)),mail:()=>c.e(98790).then(c.bind(c,498790)),mailbox:()=>c.e(41969).then(c.bind(c,141969)),mails:()=>c.e(12289).then(c.bind(c,412289)),"map-minus":()=>c.e(25374).then(c.bind(c,825374)),"map-pin-check-inside":()=>c.e(33893).then(c.bind(c,833893)),"map-pin-check":()=>c.e(38748).then(c.bind(c,538748)),"map-pin-house":()=>c.e(97072).then(c.bind(c,897072)),"map-pin-minus-inside":()=>c.e(70109).then(c.bind(c,170109)),"map-pin-minus":()=>c.e(20100).then(c.bind(c,220100)),"map-pin-off":()=>c.e(60333).then(c.bind(c,560333)),"map-pin-pen":()=>c.e(47459).then(c.bind(c,747459)),"location-edit":()=>c.e(47459).then(c.bind(c,747459)),"map-pin-plus-inside":()=>c.e(44831).then(c.bind(c,944831)),"map-pin-plus":()=>c.e(1514).then(c.bind(c,401514)),"map-pin-x-inside":()=>c.e(3453).then(c.bind(c,703453)),"map-pin-x":()=>c.e(50052).then(c.bind(c,350052)),"map-pin":()=>c.e(4957).then(c.bind(c,804957)),"map-pinned":()=>c.e(86322).then(c.bind(c,786322)),"map-plus":()=>c.e(99324).then(c.bind(c,299324)),map:()=>c.e(97063).then(c.bind(c,297063)),"mars-stroke":()=>c.e(60310).then(c.bind(c,637929)),mars:()=>c.e(35216).then(c.bind(c,235216)),martini:()=>c.e(92775).then(c.bind(c,592775)),"maximize-2":()=>c.e(35260).then(c.bind(c,935260)),maximize:()=>c.e(50811).then(c.bind(c,550811)),medal:()=>c.e(33289).then(c.bind(c,555670)),"megaphone-off":()=>c.e(3767).then(c.bind(c,703767)),megaphone:()=>c.e(40144).then(c.bind(c,417763)),meh:()=>c.e(58883).then(c.bind(c,358883)),"memory-stick":()=>c.e(27819).then(c.bind(c,427819)),menu:()=>c.e(93402).then(c.bind(c,693402)),merge:()=>c.e(89173).then(c.bind(c,489173)),"message-circle-check":()=>c.e(10486).then(c.bind(c,810486)),"message-circle-code":()=>c.e(27081).then(c.bind(c,327081)),"message-circle-dashed":()=>c.e(98429).then(c.bind(c,698429)),"message-circle-heart":()=>c.e(76946).then(c.bind(c,76946)),"message-circle-more":()=>c.e(4725).then(c.bind(c,204725)),"message-circle-off":()=>c.e(33799).then(c.bind(c,133799)),"message-circle-plus":()=>c.e(76968).then(c.bind(c,176968)),"message-circle-question-mark":()=>c.e(89632).then(c.bind(c,289632)),"message-circle-question":()=>c.e(89632).then(c.bind(c,289632)),"message-circle-reply":()=>c.e(16470).then(c.bind(c,16470)),"message-circle-warning":()=>c.e(13510).then(c.bind(c,613510)),"message-circle-x":()=>c.e(78482).then(c.bind(c,578482)),"message-circle":()=>c.e(34419).then(c.bind(c,834419)),"message-square-check":()=>c.e(56605).then(c.bind(c,56605)),"message-square-code":()=>c.e(68980).then(c.bind(c,668980)),"message-square-dashed":()=>c.e(49192).then(c.bind(c,249192)),"message-square-diff":()=>c.e(13086).then(c.bind(c,313086)),"message-square-dot":()=>c.e(95702).then(c.bind(c,95702)),"message-square-heart":()=>c.e(53913).then(c.bind(c,453913)),"message-square-lock":()=>c.e(2586).then(c.bind(c,202586)),"message-square-more":()=>c.e(6240).then(c.bind(c,206240)),"message-square-off":()=>c.e(36844).then(c.bind(c,936844)),"message-square-plus":()=>c.e(68817).then(c.bind(c,668817)),"message-square-quote":()=>c.e(85313).then(c.bind(c,385313)),"message-square-reply":()=>c.e(65457).then(c.bind(c,365457)),"message-square-share":()=>c.e(42134).then(c.bind(c,542134)),"message-square-text":()=>c.e(55374).then(c.bind(c,355374)),"message-square-warning":()=>c.e(19665).then(c.bind(c,319665)),"message-square-x":()=>c.e(7153).then(c.bind(c,507153)),"message-square":()=>c.e(73432).then(c.bind(c,773432)),"messages-square":()=>c.e(97117).then(c.bind(c,397117)),metronome:()=>c.e(25821).then(c.bind(c,625821)),"mic-off":()=>c.e(17066).then(c.bind(c,117066)),"mic-vocal":()=>c.e(23606).then(c.bind(c,523606)),"mic-2":()=>c.e(23606).then(c.bind(c,523606)),mic:()=>c.e(76210).then(c.bind(c,476210)),microchip:()=>c.e(13263).then(c.bind(c,913263)),microscope:()=>c.e(89045).then(c.bind(c,789045)),microwave:()=>c.e(3156).then(c.bind(c,803156)),milestone:()=>c.e(79071).then(c.bind(c,979071)),"milk-off":()=>c.e(85838).then(c.bind(c,185838)),milk:()=>c.e(74918).then(c.bind(c,174918)),"minimize-2":()=>c.e(5738).then(c.bind(c,705738)),minimize:()=>c.e(24613).then(c.bind(c,524613)),minus:()=>c.e(22929).then(c.bind(c,122929)),"mirror-rectangular":()=>c.e(93015).then(c.bind(c,593015)),"mirror-round":()=>c.e(92579).then(c.bind(c,992579)),"monitor-check":()=>c.e(18322).then(c.bind(c,418322)),"monitor-cloud":()=>c.e(96899).then(c.bind(c,796899)),"monitor-cog":()=>c.e(87361).then(c.bind(c,587361)),"monitor-dot":()=>c.e(8857).then(c.bind(c,308857)),"monitor-down":()=>c.e(50892).then(c.bind(c,350892)),"monitor-off":()=>c.e(95715).then(c.bind(c,495715)),"monitor-pause":()=>c.e(11136).then(c.bind(c,311136)),"monitor-play":()=>c.e(31537).then(c.bind(c,853918)),"monitor-smartphone":()=>c.e(41891).then(c.bind(c,241891)),"monitor-speaker":()=>c.e(90075).then(c.bind(c,90075)),"monitor-stop":()=>c.e(25432).then(c.bind(c,725432)),"monitor-up":()=>c.e(82057).then(c.bind(c,182057)),"monitor-x":()=>c.e(86662).then(c.bind(c,786662)),monitor:()=>c.e(27487).then(c.bind(c,27487)),"moon-star":()=>c.e(41297).then(c.bind(c,541297)),moon:()=>c.e(63140).then(c.bind(c,663140)),motorbike:()=>c.e(37542).then(c.bind(c,415161)),"mountain-snow":()=>c.e(34220).then(c.bind(c,634220)),mountain:()=>c.e(59518).then(c.bind(c,559518)),"mouse-left":()=>c.e(22018).then(c.bind(c,422018)),"mouse-off":()=>c.e(49830).then(c.bind(c,149830)),"mouse-pointer-2-off":()=>c.e(80993).then(c.bind(c,380993)),"mouse-pointer-2":()=>c.e(60641).then(c.bind(c,660641)),"mouse-pointer-ban":()=>c.e(2470).then(c.bind(c,502470)),"mouse-pointer-click":()=>c.e(21203).then(c.bind(c,421203)),"mouse-pointer":()=>c.e(15570).then(c.bind(c,415570)),"mouse-right":()=>c.e(74497).then(c.bind(c,374497)),mouse:()=>c.e(37278).then(c.bind(c,637278)),"move-3d":()=>c.e(40078).then(c.bind(c,340078)),"move-3-d":()=>c.e(40078).then(c.bind(c,340078)),"move-diagonal-2":()=>c.e(50861).then(c.bind(c,450861)),"move-diagonal":()=>c.e(29718).then(c.bind(c,29718)),"move-down-left":()=>c.e(3503).then(c.bind(c,703503)),"move-down-right":()=>c.e(62654).then(c.bind(c,462654)),"move-down":()=>c.e(8097).then(c.bind(c,808097)),"move-horizontal":()=>c.e(44677).then(c.bind(c,944677)),"move-left":()=>c.e(63624).then(c.bind(c,663624)),"move-right":()=>c.e(85423).then(c.bind(c,85423)),"move-up-left":()=>c.e(69964).then(c.bind(c,369964)),"move-up-right":()=>c.e(71867).then(c.bind(c,71867)),"move-up":()=>c.e(43416).then(c.bind(c,243416)),"move-vertical":()=>c.e(8103).then(c.bind(c,608103)),move:()=>c.e(13892).then(c.bind(c,413892)),"music-2":()=>c.e(32549).then(c.bind(c,132549)),"music-3":()=>c.e(36954).then(c.bind(c,236954)),"music-4":()=>c.e(79907).then(c.bind(c,79907)),music:()=>c.e(24414).then(c.bind(c,724414)),"navigation-2-off":()=>c.e(4728).then(c.bind(c,604728)),"navigation-2":()=>c.e(44356).then(c.bind(c,744356)),"navigation-off":()=>c.e(80455).then(c.bind(c,80455)),navigation:()=>c.e(71731).then(c.bind(c,971731)),network:()=>c.e(36811).then(c.bind(c,736811)),newspaper:()=>c.e(89294).then(c.bind(c,89294)),nfc:()=>c.e(5404).then(c.bind(c,205404)),"non-binary":()=>c.e(56722).then(c.bind(c,556722)),"notebook-pen":()=>c.e(37210).then(c.bind(c,237210)),"notebook-tabs":()=>c.e(88697).then(c.bind(c,888697)),"notebook-text":()=>c.e(75470).then(c.bind(c,675470)),notebook:()=>c.e(16888).then(c.bind(c,116888)),"notepad-text-dashed":()=>c.e(90122).then(c.bind(c,990122)),"notepad-text":()=>c.e(24114).then(c.bind(c,624114)),"nut-off":()=>c.e(59474).then(c.bind(c,759474)),nut:()=>c.e(36730).then(c.bind(c,236730)),"octagon-alert":()=>c.e(64097).then(c.bind(c,364097)),"alert-octagon":()=>c.e(64097).then(c.bind(c,364097)),"octagon-minus":()=>c.e(96819).then(c.bind(c,796819)),"octagon-pause":()=>c.e(39421).then(c.bind(c,739421)),"pause-octagon":()=>c.e(39421).then(c.bind(c,739421)),"octagon-x":()=>c.e(57067).then(c.bind(c,657067)),"x-octagon":()=>c.e(57067).then(c.bind(c,657067)),octagon:()=>c.e(13858).then(c.bind(c,113858)),omega:()=>c.e(95590).then(c.bind(c,995590)),option:()=>c.e(94028).then(c.bind(c,994028)),orbit:()=>c.e(73909).then(c.bind(c,173909)),origami:()=>c.e(11759).then(c.bind(c,911759)),"package-2":()=>c.e(10186).then(c.bind(c,410186)),"package-check":()=>c.e(20468).then(c.bind(c,20468)),"package-minus":()=>c.e(16876).then(c.bind(c,16876)),"package-open":()=>c.e(14414).then(c.bind(c,314414)),"package-plus":()=>c.e(162).then(c.bind(c,900162)),"package-search":()=>c.e(82190).then(c.bind(c,382190)),"package-x":()=>c.e(35404).then(c.bind(c,835404)),package:()=>c.e(72229).then(c.bind(c,172229)),"paint-bucket":()=>c.e(26904).then(c.bind(c,226904)),"paint-roller":()=>c.e(36234).then(c.bind(c,236234)),"paintbrush-vertical":()=>c.e(10156).then(c.bind(c,910156)),"paintbrush-2":()=>c.e(10156).then(c.bind(c,910156)),paintbrush:()=>c.e(27961).then(c.bind(c,927961)),palette:()=>c.e(8338).then(c.bind(c,708338)),panda:()=>c.e(53893).then(c.bind(c,753893)),"panel-bottom-close":()=>c.e(74306).then(c.bind(c,374306)),"panel-bottom-dashed":()=>c.e(89365).then(c.bind(c,789365)),"panel-bottom-inactive":()=>c.e(89365).then(c.bind(c,789365)),"panel-bottom-open":()=>c.e(52840).then(c.bind(c,252840)),"panel-bottom":()=>c.e(48667).then(c.bind(c,848667)),"panel-left-close":()=>c.e(90076).then(c.bind(c,290076)),"sidebar-close":()=>c.e(90076).then(c.bind(c,290076)),"panel-left-dashed":()=>c.e(32635).then(c.bind(c,532635)),"panel-left-inactive":()=>c.e(32635).then(c.bind(c,532635)),"panel-left-open":()=>c.e(95314).then(c.bind(c,595314)),"sidebar-open":()=>c.e(95314).then(c.bind(c,595314)),"panel-left-right-dashed":()=>c.e(29806).then(c.bind(c,529806)),"panel-left":()=>c.e(98833).then(c.bind(c,98833)),sidebar:()=>c.e(98833).then(c.bind(c,98833)),"panel-right-close":()=>c.e(40289).then(c.bind(c,640289)),"panel-right-dashed":()=>c.e(77824).then(c.bind(c,77824)),"panel-right-inactive":()=>c.e(77824).then(c.bind(c,77824)),"panel-right-open":()=>c.e(56773).then(c.bind(c,56773)),"panel-right":()=>c.e(58752).then(c.bind(c,258752)),"panel-top-bottom-dashed":()=>c.e(88475).then(c.bind(c,888475)),"panel-top-close":()=>c.e(68956).then(c.bind(c,368956)),"panel-top-dashed":()=>c.e(21339).then(c.bind(c,321339)),"panel-top-inactive":()=>c.e(21339).then(c.bind(c,321339)),"panel-top-open":()=>c.e(69042).then(c.bind(c,569042)),"panel-top":()=>c.e(83729).then(c.bind(c,183729)),"panels-left-bottom":()=>c.e(8520).then(c.bind(c,8520)),"panels-right-bottom":()=>c.e(35593).then(c.bind(c,435593)),"panels-top-left":()=>c.e(27272).then(c.bind(c,927272)),layout:()=>c.e(27272).then(c.bind(c,927272)),paperclip:()=>c.e(53581).then(c.bind(c,553581)),parentheses:()=>c.e(17145).then(c.bind(c,317145)),"parking-meter":()=>c.e(99577).then(c.bind(c,899577)),"party-popper":()=>c.e(62768).then(c.bind(c,862768)),pause:()=>c.e(94215).then(c.bind(c,694215)),"paw-print":()=>c.e(17471).then(c.bind(c,517471)),"pc-case":()=>c.e(8421).then(c.bind(c,608421)),"pen-line":()=>c.e(60469).then(c.bind(c,560469)),"edit-3":()=>c.e(60469).then(c.bind(c,560469)),"pen-off":()=>c.e(80154).then(c.bind(c,280154)),"pen-tool":()=>c.e(42125).then(c.bind(c,642125)),pen:()=>c.e(23010).then(c.bind(c,323010)),"edit-2":()=>c.e(23010).then(c.bind(c,323010)),"pencil-line":()=>c.e(31023).then(c.bind(c,31023)),"pencil-off":()=>c.e(98408).then(c.bind(c,98408)),"pencil-ruler":()=>c.e(1385).then(c.bind(c,201385)),pencil:()=>c.e(16692).then(c.bind(c,716692)),pentagon:()=>c.e(42913).then(c.bind(c,842913)),percent:()=>c.e(78960).then(c.bind(c,878960)),"person-standing":()=>c.e(64345).then(c.bind(c,464345)),"philippine-peso":()=>c.e(7125).then(c.bind(c,407125)),"phone-call":()=>c.e(326).then(c.bind(c,100326)),"phone-forwarded":()=>c.e(63712).then(c.bind(c,463712)),"phone-incoming":()=>c.e(5870).then(c.bind(c,5870)),"phone-missed":()=>c.e(3995).then(c.bind(c,803995)),"phone-off":()=>c.e(69637).then(c.bind(c,169637)),"phone-outgoing":()=>c.e(32624).then(c.bind(c,932624)),phone:()=>Promise.resolve().then(c.bind(c,693)),pi:()=>c.e(76498).then(c.bind(c,176498)),piano:()=>c.e(37088).then(c.bind(c,37088)),pickaxe:()=>c.e(45042).then(c.bind(c,345042)),"picture-in-picture-2":()=>c.e(11203).then(c.bind(c,911203)),"picture-in-picture":()=>c.e(51712).then(c.bind(c,751712)),"piggy-bank":()=>c.e(54080).then(c.bind(c,554080)),"pilcrow-left":()=>c.e(1413).then(c.bind(c,901413)),"pilcrow-right":()=>c.e(84252).then(c.bind(c,384252)),pilcrow:()=>c.e(64895).then(c.bind(c,864895)),"pill-bottle":()=>c.e(96723).then(c.bind(c,396723)),pill:()=>c.e(35250).then(c.bind(c,935250)),"pin-off":()=>c.e(64918).then(c.bind(c,164918)),pin:()=>c.e(26574).then(c.bind(c,826574)),pipette:()=>c.e(58022).then(c.bind(c,958022)),pizza:()=>c.e(11607).then(c.bind(c,11607)),"plane-landing":()=>c.e(75341).then(c.bind(c,875341)),"plane-takeoff":()=>c.e(38866).then(c.bind(c,538866)),plane:()=>c.e(50367).then(c.bind(c,650367)),play:()=>c.e(76431).then(c.bind(c,76431)),"plug-2":()=>c.e(55122).then(c.bind(c,355122)),"plug-zap":()=>c.e(1119).then(c.bind(c,101119)),"plug-zap-2":()=>c.e(1119).then(c.bind(c,101119)),plug:()=>c.e(89373).then(c.bind(c,789373)),plus:()=>Promise.resolve().then(c.bind(c,306345)),"pocket-knife":()=>c.e(87527).then(c.bind(c,587527)),pocket:()=>c.e(93763).then(c.bind(c,693763)),podcast:()=>c.e(45353).then(c.bind(c,845353)),"pointer-off":()=>c.e(660).then(c.bind(c,900660)),pointer:()=>c.e(35616).then(c.bind(c,935616)),popcorn:()=>c.e(82788).then(c.bind(c,282788)),popsicle:()=>c.e(89938).then(c.bind(c,289938)),"pound-sterling":()=>c.e(25508).then(c.bind(c,25508)),"power-off":()=>c.e(50028).then(c.bind(c,750028)),power:()=>c.e(70328).then(c.bind(c,270328)),presentation:()=>c.e(15569).then(c.bind(c,915569)),"printer-check":()=>c.e(62616).then(c.bind(c,562616)),"printer-x":()=>c.e(488).then(c.bind(c,488)),printer:()=>c.e(23561).then(c.bind(c,23561)),projector:()=>c.e(67325).then(c.bind(c,167325)),proportions:()=>c.e(54090).then(c.bind(c,554090)),puzzle:()=>c.e(20121).then(c.bind(c,920121)),pyramid:()=>c.e(90641).then(c.bind(c,190641)),"qr-code":()=>c.e(33310).then(c.bind(c,933310)),quote:()=>c.e(76681).then(c.bind(c,876681)),rabbit:()=>c.e(87849).then(c.bind(c,887849)),radar:()=>c.e(83629).then(c.bind(c,383629)),radiation:()=>c.e(72414).then(c.bind(c,272414)),radical:()=>c.e(6083).then(c.bind(c,406083)),"radio-receiver":()=>c.e(44558).then(c.bind(c,944558)),"radio-tower":()=>c.e(97454).then(c.bind(c,797454)),radio:()=>c.e(83918).then(c.bind(c,483918)),radius:()=>c.e(91163).then(c.bind(c,213544)),"rail-symbol":()=>c.e(87450).then(c.bind(c,887450)),rainbow:()=>c.e(72495).then(c.bind(c,372495)),rat:()=>c.e(38650).then(c.bind(c,238650)),ratio:()=>c.e(83934).then(c.bind(c,283934)),"receipt-cent":()=>c.e(45148).then(c.bind(c,645148)),"receipt-euro":()=>c.e(76347).then(c.bind(c,376347)),"receipt-indian-rupee":()=>c.e(12677).then(c.bind(c,312677)),"receipt-japanese-yen":()=>c.e(59132).then(c.bind(c,59132)),"receipt-pound-sterling":()=>c.e(46859).then(c.bind(c,446859)),"receipt-russian-ruble":()=>c.e(69722).then(c.bind(c,969722)),"receipt-swiss-franc":()=>c.e(5054).then(c.bind(c,405054)),"receipt-text":()=>c.e(21529).then(c.bind(c,621529)),"receipt-turkish-lira":()=>c.e(78955).then(c.bind(c,978955)),receipt:()=>c.e(27725).then(c.bind(c,727725)),"rectangle-circle":()=>c.e(54669).then(c.bind(c,454669)),"rectangle-ellipsis":()=>c.e(47194).then(c.bind(c,147194)),"form-input":()=>c.e(47194).then(c.bind(c,147194)),"rectangle-goggles":()=>c.e(68865).then(c.bind(c,468865)),"rectangle-horizontal":()=>c.e(35545).then(c.bind(c,335545)),"rectangle-vertical":()=>c.e(38720).then(c.bind(c,816339)),recycle:()=>c.e(36052).then(c.bind(c,236052)),"redo-2":()=>c.e(70202).then(c.bind(c,870202)),"redo-dot":()=>c.e(14499).then(c.bind(c,214499)),redo:()=>c.e(74133).then(c.bind(c,74133)),"refresh-ccw-dot":()=>c.e(16794).then(c.bind(c,816794)),"refresh-ccw":()=>c.e(62028).then(c.bind(c,662028)),"refresh-cw-off":()=>c.e(8361).then(c.bind(c,8361)),"refresh-cw":()=>c.e(85161).then(c.bind(c,685161)),refrigerator:()=>c.e(22543).then(c.bind(c,822543)),regex:()=>c.e(98386).then(c.bind(c,498386)),"remove-formatting":()=>c.e(8837).then(c.bind(c,608837)),"repeat-1":()=>c.e(81112).then(c.bind(c,81112)),"repeat-2":()=>c.e(9801).then(c.bind(c,109801)),repeat:()=>c.e(1098).then(c.bind(c,101098)),"replace-all":()=>c.e(1379).then(c.bind(c,701379)),replace:()=>c.e(64353).then(c.bind(c,164353)),"reply-all":()=>c.e(94235).then(c.bind(c,794235)),reply:()=>c.e(22057).then(c.bind(c,822057)),rewind:()=>c.e(8318).then(c.bind(c,608318)),ribbon:()=>c.e(88281).then(c.bind(c,788281)),rocket:()=>Promise.resolve().then(c.bind(c,712557)),"rocking-chair":()=>c.e(43682).then(c.bind(c,643682)),"roller-coaster":()=>c.e(72749).then(c.bind(c,572749)),rose:()=>c.e(43154).then(c.bind(c,143154)),"rotate-3d":()=>c.e(95296).then(c.bind(c,195296)),"rotate-3-d":()=>c.e(95296).then(c.bind(c,195296)),"rotate-ccw-key":()=>c.e(41938).then(c.bind(c,541938)),"rotate-ccw-square":()=>c.e(45834).then(c.bind(c,245834)),"rotate-ccw":()=>Promise.resolve().then(c.bind(c,768996)),"rotate-cw-square":()=>c.e(55949).then(c.bind(c,855949)),"rotate-cw":()=>c.e(27153).then(c.bind(c,427153)),"route-off":()=>c.e(8324).then(c.bind(c,808324)),route:()=>c.e(20624).then(c.bind(c,20624)),router:()=>c.e(67752).then(c.bind(c,167752)),"rows-2":()=>c.e(96743).then(c.bind(c,796743)),rows:()=>c.e(96743).then(c.bind(c,796743)),"rows-3":()=>c.e(36356).then(c.bind(c,936356)),"panels-top-bottom":()=>c.e(36356).then(c.bind(c,936356)),"rows-4":()=>c.e(97505).then(c.bind(c,97505)),rss:()=>c.e(47993).then(c.bind(c,447993)),"ruler-dimension-line":()=>c.e(18651).then(c.bind(c,618651)),ruler:()=>c.e(45391).then(c.bind(c,500629)),"russian-ruble":()=>c.e(21303).then(c.bind(c,421303)),sailboat:()=>c.e(62190).then(c.bind(c,962190)),salad:()=>c.e(21688).then(c.bind(c,721688)),sandwich:()=>c.e(18400).then(c.bind(c,818400)),"satellite-dish":()=>c.e(82013).then(c.bind(c,682013)),satellite:()=>c.e(99384).then(c.bind(c,599384)),"saudi-riyal":()=>c.e(31829).then(c.bind(c,431829)),"save-all":()=>c.e(36338).then(c.bind(c,536338)),"save-off":()=>c.e(93416).then(c.bind(c,93416)),save:()=>c.e(9492).then(c.bind(c,209492)),"scale-3d":()=>c.e(28363).then(c.bind(c,828363)),"scale-3-d":()=>c.e(28363).then(c.bind(c,828363)),scale:()=>c.e(24299).then(c.bind(c,624299)),scaling:()=>c.e(5240).then(c.bind(c,905240)),"scan-barcode":()=>c.e(24273).then(c.bind(c,324273)),"scan-eye":()=>c.e(13756).then(c.bind(c,513756)),"scan-face":()=>c.e(9764).then(c.bind(c,509764)),"scan-heart":()=>c.e(51277).then(c.bind(c,51277)),"scan-line":()=>c.e(14175).then(c.bind(c,614175)),"scan-qr-code":()=>c.e(8266).then(c.bind(c,808266)),"scan-search":()=>c.e(53233).then(c.bind(c,853233)),"scan-text":()=>c.e(34130).then(c.bind(c,434130)),scan:()=>c.e(95684).then(c.bind(c,795684)),school:()=>c.e(2513).then(c.bind(c,202513)),"scissors-line-dashed":()=>c.e(3059).then(c.bind(c,703059)),scissors:()=>c.e(59790).then(c.bind(c,459790)),scooter:()=>c.e(78686).then(c.bind(c,978686)),"screen-share-off":()=>c.e(22083).then(c.bind(c,822083)),"screen-share":()=>c.e(28447).then(c.bind(c,728447)),"scroll-text":()=>c.e(47550).then(c.bind(c,747550)),scroll:()=>c.e(60936).then(c.bind(c,760936)),"search-alert":()=>c.e(18374).then(c.bind(c,818374)),"search-check":()=>c.e(76996).then(c.bind(c,776996)),"search-code":()=>c.e(72175).then(c.bind(c,572175)),"search-slash":()=>c.e(55413).then(c.bind(c,155413)),"search-x":()=>c.e(50396).then(c.bind(c,850396)),search:()=>Promise.resolve().then(c.bind(c,525365)),section:()=>c.e(32842).then(c.bind(c,432842)),"send-horizontal":()=>c.e(47916).then(c.bind(c,947916)),"send-horizonal":()=>c.e(47916).then(c.bind(c,947916)),"send-to-back":()=>c.e(39813).then(c.bind(c,439813)),send:()=>c.e(99395).then(c.bind(c,399395)),"separator-horizontal":()=>c.e(64955).then(c.bind(c,64955)),"separator-vertical":()=>c.e(1669).then(c.bind(c,801669)),"server-cog":()=>c.e(39516).then(c.bind(c,639516)),"server-crash":()=>c.e(85600).then(c.bind(c,785600)),"server-off":()=>c.e(5162).then(c.bind(c,305162)),server:()=>Promise.resolve().then(c.bind(c,183410)),"settings-2":()=>c.e(63).then(c.bind(c,900063)),settings:()=>c.e(94532).then(c.bind(c,894532)),shapes:()=>c.e(46375).then(c.bind(c,546375)),"share-2":()=>c.e(2981).then(c.bind(c,402981)),share:()=>c.e(63774).then(c.bind(c,263774)),sheet:()=>c.e(30754).then(c.bind(c,330754)),shell:()=>c.e(29839).then(c.bind(c,929839)),"shelving-unit":()=>c.e(2104).then(c.bind(c,102104)),"shield-alert":()=>c.e(10263).then(c.bind(c,610263)),"shield-ban":()=>c.e(104).then(c.bind(c,900104)),"shield-check":()=>Promise.resolve().then(c.bind(c,236705)),"shield-ellipsis":()=>c.e(31534).then(c.bind(c,831534)),"shield-half":()=>c.e(99712).then(c.bind(c,799712)),"shield-minus":()=>c.e(38573).then(c.bind(c,38573)),"shield-off":()=>Promise.resolve().then(c.bind(c,332624)),"shield-plus":()=>c.e(17477).then(c.bind(c,717477)),"shield-question-mark":()=>c.e(42823).then(c.bind(c,42823)),"shield-question":()=>c.e(42823).then(c.bind(c,42823)),"shield-user":()=>c.e(40710).then(c.bind(c,840710)),"shield-x":()=>c.e(95485).then(c.bind(c,295485)),"shield-close":()=>c.e(95485).then(c.bind(c,295485)),shield:()=>c.e(75452).then(c.bind(c,475452)),"ship-wheel":()=>c.e(9121).then(c.bind(c,509121)),ship:()=>c.e(19).then(c.bind(c,200019)),shirt:()=>c.e(30177).then(c.bind(c,430177)),"shopping-bag":()=>c.e(6634).then(c.bind(c,606634)),"shopping-basket":()=>c.e(70540).then(c.bind(c,970540)),"shopping-cart":()=>c.e(96840).then(c.bind(c,796840)),shovel:()=>c.e(76082).then(c.bind(c,976082)),"shower-head":()=>c.e(46582).then(c.bind(c,746582)),shredder:()=>c.e(22048).then(c.bind(c,322048)),shrimp:()=>c.e(56498).then(c.bind(c,156498)),shrink:()=>c.e(75408).then(c.bind(c,275408)),shrub:()=>c.e(8005).then(c.bind(c,708005)),shuffle:()=>c.e(39328).then(c.bind(c,39328)),sigma:()=>c.e(34326).then(c.bind(c,34326)),"signal-high":()=>c.e(46346).then(c.bind(c,746346)),"signal-low":()=>c.e(75894).then(c.bind(c,475894)),"signal-medium":()=>c.e(9841).then(c.bind(c,209841)),"signal-zero":()=>c.e(78328).then(c.bind(c,378328)),signal:()=>c.e(45837).then(c.bind(c,545837)),signature:()=>c.e(34003).then(c.bind(c,334003)),"signpost-big":()=>c.e(20517).then(c.bind(c,920517)),signpost:()=>c.e(43558).then(c.bind(c,143558)),siren:()=>c.e(54436).then(c.bind(c,954436)),"skip-back":()=>c.e(82748).then(c.bind(c,782748)),"skip-forward":()=>c.e(65614).then(c.bind(c,265614)),skull:()=>c.e(9212).then(c.bind(c,409212)),slack:()=>c.e(27245).then(c.bind(c,627245)),slash:()=>c.e(80956).then(c.bind(c,180956)),slice:()=>c.e(7931).then(c.bind(c,7931)),"sliders-horizontal":()=>c.e(8896).then(c.bind(c,708896)),"sliders-vertical":()=>c.e(68962).then(c.bind(c,268962)),sliders:()=>c.e(68962).then(c.bind(c,268962)),"smartphone-charging":()=>c.e(99196).then(c.bind(c,499196)),"smartphone-nfc":()=>c.e(87669).then(c.bind(c,510050)),smartphone:()=>c.e(48146).then(c.bind(c,248146)),"smile-plus":()=>c.e(91182).then(c.bind(c,91182)),smile:()=>c.e(26817).then(c.bind(c,626817)),snail:()=>c.e(52196).then(c.bind(c,852196)),snowflake:()=>c.e(86485).then(c.bind(c,386485)),"soap-dispenser-droplet":()=>c.e(7611).then(c.bind(c,807611)),sofa:()=>c.e(15162).then(c.bind(c,315162)),"solar-panel":()=>c.e(15395).then(c.bind(c,415395)),soup:()=>c.e(73038).then(c.bind(c,73038)),space:()=>c.e(11191).then(c.bind(c,711191)),spade:()=>c.e(58336).then(c.bind(c,758336)),sparkle:()=>c.e(57207).then(c.bind(c,57207)),sparkles:()=>c.e(95786).then(c.bind(c,695786)),stars:()=>c.e(95786).then(c.bind(c,695786)),speaker:()=>c.e(39944).then(c.bind(c,739944)),speech:()=>c.e(98931).then(c.bind(c,798931)),"spell-check-2":()=>c.e(46121).then(c.bind(c,846121)),"spell-check":()=>c.e(68042).then(c.bind(c,168042)),"spline-pointer":()=>c.e(59872).then(c.bind(c,559872)),spline:()=>c.e(73984).then(c.bind(c,173984)),split:()=>c.e(93581).then(c.bind(c,93581)),spool:()=>c.e(91110).then(c.bind(c,491110)),spotlight:()=>c.e(62761).then(c.bind(c,562761)),"spray-can":()=>c.e(67259).then(c.bind(c,667259)),sprout:()=>c.e(23896).then(c.bind(c,823896)),"square-activity":()=>c.e(18502).then(c.bind(c,918502)),"activity-square":()=>c.e(18502).then(c.bind(c,918502)),"square-arrow-down-left":()=>c.e(10317).then(c.bind(c,610317)),"arrow-down-left-square":()=>c.e(10317).then(c.bind(c,610317)),"square-arrow-down-right":()=>c.e(55492).then(c.bind(c,755492)),"arrow-down-right-square":()=>c.e(55492).then(c.bind(c,755492)),"square-arrow-down":()=>c.e(3319).then(c.bind(c,903319)),"arrow-down-square":()=>c.e(3319).then(c.bind(c,903319)),"square-arrow-left":()=>c.e(51286).then(c.bind(c,351286)),"arrow-left-square":()=>c.e(51286).then(c.bind(c,351286)),"square-arrow-out-down-left":()=>c.e(88832).then(c.bind(c,88832)),"arrow-down-left-from-square":()=>c.e(88832).then(c.bind(c,88832)),"square-arrow-out-down-right":()=>c.e(15239).then(c.bind(c,315239)),"arrow-down-right-from-square":()=>c.e(15239).then(c.bind(c,315239)),"square-arrow-out-up-left":()=>c.e(82695).then(c.bind(c,282695)),"arrow-up-left-from-square":()=>c.e(82695).then(c.bind(c,282695)),"square-arrow-out-up-right":()=>c.e(37238).then(c.bind(c,37238)),"arrow-up-right-from-square":()=>c.e(37238).then(c.bind(c,37238)),"square-arrow-right-enter":()=>c.e(72410).then(c.bind(c,72410)),"square-arrow-right-exit":()=>c.e(82906).then(c.bind(c,382906)),"square-arrow-right":()=>c.e(701).then(c.bind(c,600701)),"arrow-right-square":()=>c.e(701).then(c.bind(c,600701)),"square-arrow-up-left":()=>c.e(57374).then(c.bind(c,457374)),"arrow-up-left-square":()=>c.e(57374).then(c.bind(c,457374)),"square-arrow-up-right":()=>c.e(4645).then(c.bind(c,704645)),"arrow-up-right-square":()=>c.e(4645).then(c.bind(c,704645)),"square-arrow-up":()=>c.e(91562).then(c.bind(c,591562)),"arrow-up-square":()=>c.e(91562).then(c.bind(c,591562)),"square-asterisk":()=>c.e(53851).then(c.bind(c,853851)),"asterisk-square":()=>c.e(53851).then(c.bind(c,853851)),"square-bottom-dashed-scissors":()=>c.e(50986).then(c.bind(c,650986)),"scissors-square-dashed-bottom":()=>c.e(50986).then(c.bind(c,650986)),"square-centerline-dashed-horizontal":()=>c.e(36021).then(c.bind(c,836021)),"flip-horizontal":()=>c.e(36021).then(c.bind(c,836021)),"square-centerline-dashed-vertical":()=>c.e(46295).then(c.bind(c,546295)),"flip-vertical":()=>c.e(46295).then(c.bind(c,546295)),"square-chart-gantt":()=>c.e(69816).then(c.bind(c,669816)),"gantt-chart-square":()=>c.e(69816).then(c.bind(c,669816)),"square-gantt-chart":()=>c.e(69816).then(c.bind(c,669816)),"square-check-big":()=>c.e(26048).then(c.bind(c,126048)),"check-square":()=>c.e(26048).then(c.bind(c,126048)),"square-check":()=>c.e(1063).then(c.bind(c,301063)),"check-square-2":()=>c.e(1063).then(c.bind(c,301063)),"square-chevron-down":()=>c.e(71929).then(c.bind(c,871929)),"chevron-down-square":()=>c.e(71929).then(c.bind(c,871929)),"square-chevron-left":()=>c.e(31792).then(c.bind(c,131792)),"chevron-left-square":()=>c.e(31792).then(c.bind(c,131792)),"square-chevron-right":()=>c.e(31447).then(c.bind(c,331447)),"chevron-right-square":()=>c.e(31447).then(c.bind(c,331447)),"square-chevron-up":()=>c.e(20816).then(c.bind(c,420816)),"chevron-up-square":()=>c.e(20816).then(c.bind(c,420816)),"square-code":()=>c.e(76078).then(c.bind(c,276078)),"code-square":()=>c.e(76078).then(c.bind(c,276078)),"square-dashed-bottom-code":()=>c.e(27376).then(c.bind(c,527376)),"square-dashed-bottom":()=>c.e(39804).then(c.bind(c,739804)),"square-dashed-kanban":()=>c.e(76792).then(c.bind(c,676792)),"kanban-square-dashed":()=>c.e(76792).then(c.bind(c,676792)),"square-dashed-mouse-pointer":()=>c.e(13276).then(c.bind(c,413276)),"mouse-pointer-square-dashed":()=>c.e(13276).then(c.bind(c,413276)),"square-dashed-top-solid":()=>c.e(21198).then(c.bind(c,221198)),"square-dashed":()=>c.e(81798).then(c.bind(c,481798)),"box-select":()=>c.e(81798).then(c.bind(c,481798)),"square-divide":()=>c.e(14021).then(c.bind(c,936402)),"divide-square":()=>c.e(14021).then(c.bind(c,936402)),"square-dot":()=>c.e(32592).then(c.bind(c,632592)),"dot-square":()=>c.e(32592).then(c.bind(c,632592)),"square-equal":()=>c.e(55463).then(c.bind(c,655463)),"equal-square":()=>c.e(55463).then(c.bind(c,655463)),"square-function":()=>c.e(46487).then(c.bind(c,446487)),"function-square":()=>c.e(46487).then(c.bind(c,446487)),"square-kanban":()=>c.e(38632).then(c.bind(c,838632)),"kanban-square":()=>c.e(38632).then(c.bind(c,838632)),"square-library":()=>c.e(27412).then(c.bind(c,27412)),"library-square":()=>c.e(27412).then(c.bind(c,27412)),"square-m":()=>c.e(51408).then(c.bind(c,351408)),"m-square":()=>c.e(51408).then(c.bind(c,351408)),"square-menu":()=>c.e(39680).then(c.bind(c,139680)),"menu-square":()=>c.e(39680).then(c.bind(c,139680)),"square-minus":()=>c.e(62327).then(c.bind(c,462327)),"minus-square":()=>c.e(62327).then(c.bind(c,462327)),"square-mouse-pointer":()=>c.e(54860).then(c.bind(c,54860)),inspect:()=>c.e(54860).then(c.bind(c,54860)),"square-parking-off":()=>c.e(23955).then(c.bind(c,323955)),"parking-square-off":()=>c.e(23955).then(c.bind(c,323955)),"square-parking":()=>c.e(48879).then(c.bind(c,248879)),"parking-square":()=>c.e(48879).then(c.bind(c,248879)),"square-pause":()=>c.e(90681).then(c.bind(c,690681)),"square-pen":()=>c.e(30108).then(c.bind(c,730108)),"pen-box":()=>c.e(30108).then(c.bind(c,730108)),edit:()=>c.e(30108).then(c.bind(c,730108)),"pen-square":()=>c.e(30108).then(c.bind(c,730108)),"square-percent":()=>c.e(45562).then(c.bind(c,445562)),"percent-square":()=>c.e(45562).then(c.bind(c,445562)),"square-pi":()=>c.e(39604).then(c.bind(c,939604)),"pi-square":()=>c.e(39604).then(c.bind(c,939604)),"square-pilcrow":()=>c.e(82709).then(c.bind(c,782709)),"pilcrow-square":()=>c.e(82709).then(c.bind(c,782709)),"square-play":()=>c.e(34793).then(c.bind(c,234793)),"play-square":()=>c.e(34793).then(c.bind(c,234793)),"square-plus":()=>c.e(46623).then(c.bind(c,746623)),"plus-square":()=>c.e(46623).then(c.bind(c,746623)),"square-power":()=>c.e(98213).then(c.bind(c,720594)),"power-square":()=>c.e(98213).then(c.bind(c,720594)),"square-radical":()=>c.e(74897).then(c.bind(c,874897)),"square-round-corner":()=>c.e(11165).then(c.bind(c,811165)),"square-scissors":()=>c.e(49532).then(c.bind(c,349532)),"scissors-square":()=>c.e(49532).then(c.bind(c,349532)),"square-sigma":()=>c.e(94580).then(c.bind(c,494580)),"sigma-square":()=>c.e(94580).then(c.bind(c,494580)),"square-slash":()=>c.e(36146).then(c.bind(c,636146)),"slash-square":()=>c.e(36146).then(c.bind(c,636146)),"square-split-horizontal":()=>c.e(57072).then(c.bind(c,357072)),"split-square-horizontal":()=>c.e(57072).then(c.bind(c,357072)),"square-split-vertical":()=>c.e(41874).then(c.bind(c,641874)),"split-square-vertical":()=>c.e(41874).then(c.bind(c,641874)),"square-square":()=>c.e(17864).then(c.bind(c,717864)),"square-stack":()=>c.e(48679).then(c.bind(c,448679)),"square-star":()=>c.e(74239).then(c.bind(c,874239)),"square-stop":()=>c.e(75783).then(c.bind(c,975783)),"square-terminal":()=>c.e(80375).then(c.bind(c,480375)),"terminal-square":()=>c.e(80375).then(c.bind(c,480375)),"square-user-round":()=>c.e(38577).then(c.bind(c,438577)),"user-square-2":()=>c.e(38577).then(c.bind(c,438577)),"square-user":()=>c.e(80543).then(c.bind(c,802924)),"user-square":()=>c.e(80543).then(c.bind(c,802924)),"square-x":()=>c.e(51991).then(c.bind(c,751991)),"x-square":()=>c.e(51991).then(c.bind(c,751991)),square:()=>c.e(62038).then(c.bind(c,62038)),"squares-exclude":()=>c.e(6162).then(c.bind(c,906162)),"squares-intersect":()=>c.e(50221).then(c.bind(c,250221)),"squares-subtract":()=>c.e(15258).then(c.bind(c,615258)),"squares-unite":()=>c.e(70061).then(c.bind(c,570061)),"squircle-dashed":()=>c.e(72745).then(c.bind(c,572745)),squircle:()=>c.e(66535).then(c.bind(c,666535)),squirrel:()=>c.e(75058).then(c.bind(c,175058)),stamp:()=>c.e(22694).then(c.bind(c,822694)),"star-half":()=>c.e(9303).then(c.bind(c,509303)),"star-off":()=>c.e(95013).then(c.bind(c,595013)),star:()=>c.e(4181).then(c.bind(c,4181)),"step-back":()=>c.e(45131).then(c.bind(c,545131)),"step-forward":()=>c.e(42887).then(c.bind(c,142887)),stethoscope:()=>c.e(81972).then(c.bind(c,781972)),sticker:()=>c.e(71642).then(c.bind(c,671642)),"sticky-note":()=>c.e(16651).then(c.bind(c,716651)),stone:()=>c.e(18396).then(c.bind(c,618396)),store:()=>c.e(27448).then(c.bind(c,127448)),"stretch-horizontal":()=>c.e(16741).then(c.bind(c,816741)),"stretch-vertical":()=>c.e(90823).then(c.bind(c,790823)),strikethrough:()=>c.e(44494).then(c.bind(c,44494)),subscript:()=>c.e(18832).then(c.bind(c,18832)),"sun-dim":()=>c.e(89384).then(c.bind(c,89384)),"sun-medium":()=>c.e(26271).then(c.bind(c,326271)),"sun-moon":()=>c.e(65501).then(c.bind(c,665501)),"sun-snow":()=>c.e(41851).then(c.bind(c,341851)),sun:()=>c.e(63751).then(c.bind(c,663751)),sunrise:()=>c.e(12462).then(c.bind(c,912462)),sunset:()=>c.e(44487).then(c.bind(c,44487)),superscript:()=>c.e(17425).then(c.bind(c,17425)),"swatch-book":()=>c.e(65707).then(c.bind(c,965707)),"swiss-franc":()=>c.e(10983).then(c.bind(c,10983)),"switch-camera":()=>c.e(31377).then(c.bind(c,131377)),sword:()=>c.e(36340).then(c.bind(c,36340)),swords:()=>c.e(77844).then(c.bind(c,755463)),syringe:()=>c.e(42504).then(c.bind(c,120123)),"table-2":()=>c.e(61366).then(c.bind(c,961366)),"table-cells-merge":()=>c.e(19936).then(c.bind(c,119936)),"table-cells-split":()=>c.e(89132).then(c.bind(c,189132)),"table-columns-split":()=>c.e(68842).then(c.bind(c,168842)),"table-of-contents":()=>c.e(1186).then(c.bind(c,201186)),"table-properties":()=>c.e(80163).then(c.bind(c,780163)),"table-rows-split":()=>c.e(55246).then(c.bind(c,155246)),table:()=>c.e(79833).then(c.bind(c,479833)),"tablet-smartphone":()=>c.e(98513).then(c.bind(c,498513)),tablet:()=>c.e(5465).then(c.bind(c,605465)),tablets:()=>c.e(65276).then(c.bind(c,865276)),tag:()=>c.e(72741).then(c.bind(c,272741)),tags:()=>c.e(3152).then(c.bind(c,3152)),"tally-1":()=>c.e(16685).then(c.bind(c,416685)),"tally-2":()=>c.e(29356).then(c.bind(c,529356)),"tally-3":()=>c.e(50383).then(c.bind(c,350383)),"tally-4":()=>c.e(39054).then(c.bind(c,339054)),"tally-5":()=>c.e(21993).then(c.bind(c,821993)),tangent:()=>c.e(44432).then(c.bind(c,544432)),target:()=>Promise.resolve().then(c.bind(c,25016)),telescope:()=>c.e(86489).then(c.bind(c,786489)),"tent-tree":()=>c.e(72693).then(c.bind(c,472693)),tent:()=>c.e(79780).then(c.bind(c,879780)),terminal:()=>c.e(57349).then(c.bind(c,257349)),"test-tube-diagonal":()=>c.e(90654).then(c.bind(c,790654)),"test-tube-2":()=>c.e(90654).then(c.bind(c,790654)),"test-tube":()=>c.e(46156).then(c.bind(c,746156)),"test-tubes":()=>c.e(111).then(c.bind(c,200111)),"text-align-center":()=>c.e(40194).then(c.bind(c,40194)),"align-center":()=>c.e(40194).then(c.bind(c,40194)),"text-align-end":()=>c.e(94734).then(c.bind(c,294734)),"align-right":()=>c.e(94734).then(c.bind(c,294734)),"text-align-justify":()=>c.e(90615).then(c.bind(c,990615)),"align-justify":()=>c.e(90615).then(c.bind(c,990615)),"text-align-start":()=>c.e(50747).then(c.bind(c,650747)),text:()=>c.e(50747).then(c.bind(c,650747)),"align-left":()=>c.e(50747).then(c.bind(c,650747)),"text-cursor-input":()=>c.e(19772).then(c.bind(c,519772)),"text-cursor":()=>c.e(51801).then(c.bind(c,151801)),"text-initial":()=>c.e(57571).then(c.bind(c,157571)),"letter-text":()=>c.e(57571).then(c.bind(c,157571)),"text-quote":()=>c.e(78563).then(c.bind(c,678563)),"text-search":()=>c.e(51611).then(c.bind(c,251611)),"text-select":()=>c.e(17991).then(c.bind(c,117991)),"text-selection":()=>c.e(17991).then(c.bind(c,117991)),"text-wrap":()=>c.e(81603).then(c.bind(c,781603)),"wrap-text":()=>c.e(81603).then(c.bind(c,781603)),theater:()=>c.e(57672).then(c.bind(c,657672)),"thermometer-snowflake":()=>c.e(42712).then(c.bind(c,842712)),"thermometer-sun":()=>c.e(84914).then(c.bind(c,684914)),thermometer:()=>c.e(19369).then(c.bind(c,619369)),"thumbs-down":()=>c.e(69421).then(c.bind(c,469421)),"thumbs-up":()=>c.e(2924).then(c.bind(c,102924)),"ticket-check":()=>c.e(11664).then(c.bind(c,511664)),"ticket-minus":()=>c.e(55816).then(c.bind(c,755816)),"ticket-percent":()=>c.e(82817).then(c.bind(c,682817)),"ticket-plus":()=>c.e(93406).then(c.bind(c,893406)),"ticket-slash":()=>c.e(54270).then(c.bind(c,531889)),"ticket-x":()=>c.e(12816).then(c.bind(c,812816)),ticket:()=>c.e(45297).then(c.bind(c,845297)),"tickets-plane":()=>c.e(1939).then(c.bind(c,401939)),tickets:()=>c.e(41892).then(c.bind(c,141892)),"timer-off":()=>c.e(71580).then(c.bind(c,671580)),"timer-reset":()=>c.e(7026).then(c.bind(c,207026)),timer:()=>c.e(54792).then(c.bind(c,54792)),"toggle-left":()=>c.e(53131).then(c.bind(c,753131)),"toggle-right":()=>c.e(30018).then(c.bind(c,30018)),toilet:()=>c.e(17280).then(c.bind(c,117280)),"tool-case":()=>c.e(17276).then(c.bind(c,717276)),toolbox:()=>c.e(43098).then(c.bind(c,743098)),tornado:()=>c.e(20704).then(c.bind(c,420704)),torus:()=>c.e(45868).then(c.bind(c,345868)),"touchpad-off":()=>c.e(45741).then(c.bind(c,845741)),touchpad:()=>c.e(64637).then(c.bind(c,664637)),"towel-rack":()=>c.e(75340).then(c.bind(c,875340)),"tower-control":()=>c.e(76672).then(c.bind(c,776672)),"toy-brick":()=>c.e(59981).then(c.bind(c,459981)),tractor:()=>c.e(52518).then(c.bind(c,252518)),"traffic-cone":()=>c.e(51850).then(c.bind(c,451850)),"train-front-tunnel":()=>c.e(98224).then(c.bind(c,698224)),"train-front":()=>c.e(78433).then(c.bind(c,878433)),"train-track":()=>c.e(417).then(c.bind(c,800417)),"tram-front":()=>c.e(32843).then(c.bind(c,732843)),train:()=>c.e(32843).then(c.bind(c,732843)),transgender:()=>c.e(88374).then(c.bind(c,288374)),"trash-2":()=>Promise.resolve().then(c.bind(c,830004)),trash:()=>c.e(3075).then(c.bind(c,3075)),"tree-deciduous":()=>c.e(32409).then(c.bind(c,532409)),"tree-palm":()=>c.e(63006).then(c.bind(c,663006)),palmtree:()=>c.e(63006).then(c.bind(c,663006)),"tree-pine":()=>c.e(23892).then(c.bind(c,423892)),trees:()=>c.e(10828).then(c.bind(c,310828)),trello:()=>c.e(90611).then(c.bind(c,490611)),"trending-down":()=>c.e(99101).then(c.bind(c,499101)),"trending-up-down":()=>c.e(44697).then(c.bind(c,844697)),"trending-up":()=>Promise.resolve().then(c.bind(c,392796)),"triangle-alert":()=>Promise.resolve().then(c.bind(c,912886)),"alert-triangle":()=>Promise.resolve().then(c.bind(c,912886)),"triangle-dashed":()=>c.e(26615).then(c.bind(c,926615)),"triangle-right":()=>c.e(10778).then(c.bind(c,310778)),triangle:()=>c.e(74661).then(c.bind(c,674661)),trophy:()=>c.e(65239).then(c.bind(c,465239)),"truck-electric":()=>c.e(4724).then(c.bind(c,4724)),truck:()=>c.e(99738).then(c.bind(c,499738)),"turkish-lira":()=>c.e(76948).then(c.bind(c,876948)),turntable:()=>c.e(17048).then(c.bind(c,117048)),turtle:()=>c.e(80219).then(c.bind(c,80219)),"tv-minimal-play":()=>c.e(91564).then(c.bind(c,791564)),"tv-minimal":()=>c.e(20929).then(c.bind(c,120929)),"tv-2":()=>c.e(20929).then(c.bind(c,120929)),tv:()=>c.e(15463).then(c.bind(c,715463)),twitch:()=>c.e(90558).then(c.bind(c,90558)),twitter:()=>c.e(44653).then(c.bind(c,967034)),"type-outline":()=>c.e(93154).then(c.bind(c,793154)),type:()=>c.e(94309).then(c.bind(c,394309)),"umbrella-off":()=>c.e(48065).then(c.bind(c,848065)),umbrella:()=>c.e(52385).then(c.bind(c,852385)),underline:()=>c.e(30713).then(c.bind(c,130713)),"undo-2":()=>c.e(97404).then(c.bind(c,997404)),"undo-dot":()=>c.e(3701).then(c.bind(c,203701)),undo:()=>c.e(12443).then(c.bind(c,612443)),"unfold-horizontal":()=>c.e(69034).then(c.bind(c,369034)),"unfold-vertical":()=>c.e(58444).then(c.bind(c,458444)),ungroup:()=>c.e(61971).then(c.bind(c,61971)),university:()=>c.e(42469).then(c.bind(c,242469)),"school-2":()=>c.e(42469).then(c.bind(c,242469)),"unlink-2":()=>c.e(32121).then(c.bind(c,632121)),unlink:()=>c.e(33946).then(c.bind(c,433946)),unplug:()=>c.e(75482).then(c.bind(c,875482)),upload:()=>c.e(29308).then(c.bind(c,129308)),usb:()=>c.e(63867).then(c.bind(c,463867)),"user-check":()=>c.e(87787).then(c.bind(c,987787)),"user-cog":()=>c.e(84804).then(c.bind(c,284804)),"user-key":()=>c.e(25084).then(c.bind(c,25084)),"user-lock":()=>c.e(77364).then(c.bind(c,677364)),"user-minus":()=>c.e(11979).then(c.bind(c,11979)),"user-pen":()=>c.e(81384).then(c.bind(c,481384)),"user-plus":()=>c.e(65555).then(c.bind(c,65555)),"user-round-check":()=>c.e(67270).then(c.bind(c,467270)),"user-check-2":()=>c.e(67270).then(c.bind(c,467270)),"user-round-cog":()=>c.e(99885).then(c.bind(c,499885)),"user-cog-2":()=>c.e(99885).then(c.bind(c,499885)),"user-round-key":()=>c.e(85561).then(c.bind(c,585561)),"user-round-minus":()=>c.e(13370).then(c.bind(c,113370)),"user-minus-2":()=>c.e(13370).then(c.bind(c,113370)),"user-round-pen":()=>c.e(28701).then(c.bind(c,628701)),"user-round-plus":()=>c.e(20888).then(c.bind(c,820888)),"user-plus-2":()=>c.e(20888).then(c.bind(c,820888)),"user-round-search":()=>c.e(85116).then(c.bind(c,785116)),"user-round-x":()=>c.e(77410).then(c.bind(c,877410)),"user-x-2":()=>c.e(77410).then(c.bind(c,877410)),"user-round":()=>c.e(47619).then(c.bind(c,447619)),"user-2":()=>c.e(47619).then(c.bind(c,447619)),"user-search":()=>c.e(3287).then(c.bind(c,403287)),"user-star":()=>c.e(41067).then(c.bind(c,241067)),"user-x":()=>c.e(33059).then(c.bind(c,733059)),user:()=>c.e(72442).then(c.bind(c,272442)),"users-round":()=>c.e(77992).then(c.bind(c,877992)),"users-2":()=>c.e(77992).then(c.bind(c,877992)),users:()=>c.e(62845).then(c.bind(c,862845)),"utensils-crossed":()=>c.e(75674).then(c.bind(c,675674)),"fork-knife-crossed":()=>c.e(75674).then(c.bind(c,675674)),utensils:()=>c.e(60270).then(c.bind(c,260270)),"fork-knife":()=>c.e(60270).then(c.bind(c,260270)),"utility-pole":()=>c.e(53564).then(c.bind(c,53564)),van:()=>c.e(38616).then(c.bind(c,638616)),variable:()=>c.e(33985).then(c.bind(c,933985)),vault:()=>c.e(16857).then(c.bind(c,416857)),"vector-square":()=>c.e(72915).then(c.bind(c,995296)),vegan:()=>c.e(5568).then(c.bind(c,605568)),"venetian-mask":()=>c.e(44970).then(c.bind(c,44970)),"venus-and-mars":()=>c.e(15764).then(c.bind(c,615764)),venus:()=>c.e(57668).then(c.bind(c,57668)),"vibrate-off":()=>c.e(69834).then(c.bind(c,669834)),vibrate:()=>c.e(13490).then(c.bind(c,413490)),"video-off":()=>c.e(76366).then(c.bind(c,676366)),video:()=>c.e(26233).then(c.bind(c,848614)),videotape:()=>c.e(59878).then(c.bind(c,259878)),view:()=>c.e(78024).then(c.bind(c,578024)),voicemail:()=>c.e(79152).then(c.bind(c,579152)),volleyball:()=>c.e(62389).then(c.bind(c,962389)),"volume-1":()=>c.e(16761).then(c.bind(c,116761)),"volume-2":()=>c.e(83208).then(c.bind(c,883208)),"volume-off":()=>c.e(163).then(c.bind(c,700163)),"volume-x":()=>c.e(57222).then(c.bind(c,257222)),volume:()=>c.e(87071).then(c.bind(c,187071)),vote:()=>c.e(24713).then(c.bind(c,724713)),"wallet-cards":()=>c.e(5230).then(c.bind(c,705230)),"wallet-minimal":()=>c.e(92306).then(c.bind(c,392306)),"wallet-2":()=>c.e(92306).then(c.bind(c,392306)),wallet:()=>c.e(59560).then(c.bind(c,459560)),wallpaper:()=>c.e(66431).then(c.bind(c,166431)),"wand-sparkles":()=>c.e(71319).then(c.bind(c,571319)),"wand-2":()=>c.e(71319).then(c.bind(c,571319)),wand:()=>c.e(88779).then(c.bind(c,888779)),warehouse:()=>c.e(37270).then(c.bind(c,37270)),"washing-machine":()=>c.e(64028).then(c.bind(c,964028)),watch:()=>c.e(97926).then(c.bind(c,397926)),"waves-arrow-down":()=>c.e(78420).then(c.bind(c,378420)),"waves-arrow-up":()=>c.e(33937).then(c.bind(c,433937)),"waves-ladder":()=>c.e(36516).then(c.bind(c,936516)),waves:()=>c.e(25739).then(c.bind(c,925739)),waypoints:()=>c.e(42493).then(c.bind(c,542493)),webcam:()=>c.e(65488).then(c.bind(c,165488)),"webhook-off":()=>c.e(7940).then(c.bind(c,7940)),webhook:()=>c.e(73456).then(c.bind(c,773456)),"weight-tilde":()=>c.e(30246).then(c.bind(c,430246)),weight:()=>c.e(65437).then(c.bind(c,165437)),"wheat-off":()=>c.e(61474).then(c.bind(c,761474)),wheat:()=>c.e(62154).then(c.bind(c,262154)),"whole-word":()=>c.e(46719).then(c.bind(c,346719)),"wifi-cog":()=>c.e(49842).then(c.bind(c,949842)),"wifi-high":()=>c.e(59361).then(c.bind(c,459361)),"wifi-low":()=>c.e(34327).then(c.bind(c,934327)),"wifi-off":()=>c.e(89080).then(c.bind(c,389080)),"wifi-pen":()=>c.e(33614).then(c.bind(c,833614)),"wifi-sync":()=>c.e(25762).then(c.bind(c,725762)),"wifi-zero":()=>c.e(70591).then(c.bind(c,570591)),wifi:()=>c.e(53892).then(c.bind(c,653892)),"wind-arrow-down":()=>c.e(90204).then(c.bind(c,190204)),wind:()=>c.e(25779).then(c.bind(c,625779)),"wine-off":()=>c.e(34932).then(c.bind(c,434932)),wine:()=>c.e(6528).then(c.bind(c,6528)),workflow:()=>Promise.resolve().then(c.bind(c,442184)),worm:()=>c.e(68302).then(c.bind(c,68302)),wrench:()=>c.e(36328).then(c.bind(c,236328)),"x-line-top":()=>c.e(24650).then(c.bind(c,924650)),x:()=>Promise.resolve().then(c.bind(c,547193)),youtube:()=>c.e(56236).then(c.bind(c,156236)),"zap-off":()=>c.e(52582).then(c.bind(c,752582)),zap:()=>Promise.resolve().then(c.bind(c,131038)),"zoom-in":()=>c.e(25368).then(c.bind(c,325368)),"zoom-out":()=>c.e(467).then(c.bind(c,800467))};var f=c(150819);let g=Object.keys(e);async function h(a){if(!(a in e))throw Error("[lucide-react]: Name in Lucide DynamicIcon not found");return(await e[a]()).__iconNode}let i=(0,d.forwardRef)(({name:a,fallback:b,...c},e)=>{let[g,i]=(0,d.useState)();return((0,d.useEffect)(()=>{h(a).then(i).catch(a=>{console.error(a)})},[a]),null==g)?null==b?null:(0,d.createElement)(b):(0,d.createElement)(f.A,{ref:e,...c,iconNode:g})})},278070:(a,b,c)=>{"use strict";c.d(b,{D:()=>E});var d=c(736927),e=c(115962),f=c(569607),g=c(534487),h=c(411202),i=c(347751),j=c(502714),k=c(845722),l=c(207346),m=c(626624),n=c(286102),o=c(355403),p=c(410658),q=c(530858),r=c(712410),s=c(94400);function t(a,b,c){let[d,e]=(0,r.x)(c?.in,a,b),f=u(d,e),g=Math.abs((0,s.m)(d,e));d.setDate(d.getDate()-f*g);let h=Number(u(d,e)===-f),i=f*(g-h);return 0===i?0:i}function u(a,b){let c=a.getFullYear()-b.getFullYear()||a.getMonth()-b.getMonth()||a.getDate()-b.getDate()||a.getHours()-b.getHours()||a.getMinutes()-b.getMinutes()||a.getSeconds()-b.getSeconds()||a.getMilliseconds()-b.getMilliseconds();return c<0?-1:c>0?1:c}var v=c(479466),w=c(18886),x=c(130526);let y={day:{dayWidth:80,headerFormat:"MMM d"},week:{dayWidth:30,headerFormat:"MMM d"},month:{dayWidth:10,headerFormat:"MMM yyyy"},quarter:{dayWidth:4,headerFormat:"QQQ yyyy"}},z=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#14b8a6","#f97316","#6366f1"];function A(a){return null==a?"":"string"==typeof a?a:"number"==typeof a||"boolean"==typeof a||"bigint"==typeof a?String(a):"object"==typeof a?JSON.stringify(a):""}function B(a){return(0,m.GP)(a,"yyyy-MM-dd")}function C({item:a,x:b,w:c,dayWidth:f,onEntryClick:h,onEntryDateChange:i}){let[j,k]=(0,e.useState)(null),[l,n]=(0,e.useState)(0),[o,p]=(0,e.useState)(0),q=(0,e.useRef)(0),r=!!i,s=(0,e.useCallback)(a=>Math.round(a/f)*f,[f]),t=(0,e.useCallback)(a=>Math.round(a/f),[f]),u=(0,e.useCallback)((a,b)=>{r&&(a.preventDefault(),a.stopPropagation(),q.current=a.clientX,k(b),a.target.setPointerCapture(a.pointerId))},[r]),v=(0,e.useCallback)(a=>{if(!j)return;let b=s(a.clientX-q.current);"move"===j?n(b):"resize-left"===j?(n(b),p(-b)):p(b)},[j,s]),x=(0,e.useCallback)(b=>{if(!j||!i)return void k(null);let c=t(b.clientX-q.current);if(0===c&&"move"===j){k(null),n(0),p(0);return}let d=a.startDate,e=a.endDate;"move"===j?(d=(0,g.f)(a.startDate,c),e=(0,g.f)(a.endDate,c)):"resize-left"===j?(d=(0,g.f)(a.startDate,c))>=e&&(d=(0,g.f)(e,-1)):(e=(0,g.f)(a.endDate,c))<=d&&(e=(0,g.f)(d,1)),i({entryId:a.id,newStartDate:B(d),newEndDate:B(e)}),k(null),n(0),p(0)},[j,i,a,t]),y=Math.max(c+o,.5*f);return(0,d.jsxs)("div",{className:"absolute rounded flex items-center text-[11px] truncate select-none",style:{left:b+l,width:y,top:6,height:28,backgroundColor:a.color,color:"#fff",zIndex:j?20:2,cursor:r?"move"===j?"grabbing":"grab":"pointer",opacity:j?.85:1,transition:j?"none":"left 0.15s, width 0.15s"},onPointerDown:a=>u(a,"move"),onPointerMove:v,onPointerUp:x,onClick:b=>{j||(b.stopPropagation(),h?.(a.id))},title:`${a.title}
|
|
@@ -215,7 +215,7 @@ see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__
|
|
|
215
215
|
${p}px !important;
|
|
216
216
|
${q}px !important;
|
|
217
217
|
}
|
|
218
|
-
`),()=>{s.contains(r)&&s.removeChild(r)}},[b]),(0,d.jsx)(m,{isPresent:b,childRef:j,sizeRef:n,pop:h,children:!1===h?a:e.cloneElement(a,{ref:p})})}let o=({children:a,initial:b,isPresent:c,onExitComplete:f,custom:h,presenceAffectsLayout:j,mode:k,anchorX:l,anchorY:m,root:o})=>{let q=(0,g.M)(p),r=(0,e.useId)(),s=!0,t=(0,e.useMemo)(()=>(s=!1,{id:r,initial:b,isPresent:c,custom:h,onExitComplete:a=>{for(let b of(q.set(a,!0),q.values()))if(!b)return;f&&f()},register:a=>(q.set(a,!1),()=>q.delete(a))}),[c,q,f]);return j&&s&&(t={...t}),(0,e.useMemo)(()=>{q.forEach((a,b)=>q.set(b,!1))},[c]),e.useEffect(()=>{c||q.size||!f||f()},[c]),a=(0,d.jsx)(n,{pop:"popLayout"===k,isPresent:c,anchorX:l,anchorY:m,root:o,children:a}),(0,d.jsx)(i.t.Provider,{value:t,children:a})};function p(){return new Map}var q=c(15086);let r=a=>a.key||"";function s(a){let b=[];return e.Children.forEach(a,a=>{(0,e.isValidElement)(a)&&b.push(a)}),b}let t=({children:a,custom:b,initial:c=!0,onExitComplete:i,presenceAffectsLayout:j=!0,mode:k="sync",propagate:l=!1,anchorX:m="left",anchorY:n="top",root:p})=>{let[t,u]=(0,q.xQ)(l),v=(0,e.useMemo)(()=>s(a),[a]),w=l&&!t?[]:v.map(r),x=(0,e.useRef)(!0),y=(0,e.useRef)(v),z=(0,g.M)(()=>new Map),A=(0,e.useRef)(new Set),[B,C]=(0,e.useState)(v),[D,E]=(0,e.useState)(v);(0,h.E)(()=>{x.current=!1,y.current=v;for(let a=0;a<D.length;a++){let b=r(D[a]);w.includes(b)?(z.delete(b),A.current.delete(b)):!0!==z.get(b)&&z.set(b,!1)}},[D,w.length,w.join("-")]);let F=[];if(v!==B){let a=[...v];for(let b=0;b<D.length;b++){let c=D[b],d=r(c);w.includes(d)||(a.splice(b,0,c),F.push(c))}return"wait"===k&&F.length&&(a=F),E(s(a)),C(v),null}let{forceRender:G}=(0,e.useContext)(f.L);return(0,d.jsx)(d.Fragment,{children:D.map(a=>{let e=r(a),f=(!l||!!t)&&(v===D||w.includes(e));return(0,d.jsx)(o,{isPresent:f,initial:(!x.current||!!c)&&void 0,custom:b,presenceAffectsLayout:j,mode:k,root:p,onExitComplete:f?void 0:()=>{if(A.current.has(e)||(A.current.add(e),!z.has(e)))return;z.set(e,!0);let a=!0;z.forEach(b=>{b||(a=!1)}),a&&(G?.(),E(y.current),l&&u?.(),i&&i())},anchorX:m,anchorY:n,children:a},e)})})}},656159:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.isDeepKey=function(a){switch(typeof a){case"number":case"symbol":return!1;case"string":return a.includes(".")||a.includes("[")||a.includes("]")}}},658422:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(452171),e=c(266196),f=c(606461);b.cloneDeepWith=function(a,b){return d.cloneDeepWith(a,(c,g,h,i)=>{let j=b?.(c,g,h,i);if(void 0!==j)return j;if("object"==typeof a){if(e.getTag(a)===f.objectTag&&"function"!=typeof a.constructor){let b={};return i.set(a,b),d.copyProperties(b,a,h,i),b}switch(Object.prototype.toString.call(a)){case f.numberTag:case f.stringTag:case f.booleanTag:{let b=new a.constructor(a?.valueOf());return d.copyProperties(b,a),b}case f.argumentsTag:{let b={};return d.copyProperties(b,a),b.length=a.length,b[Symbol.iterator]=a[Symbol.iterator],b}default:return}}})}},658556:(a,b,c)=>{"use strict";function d(a,b){let c=String(a);if("string"!=typeof b)throw TypeError("Expected character");let d=0,e=c.indexOf(b);for(;-1!==e;)d++,e=c.indexOf(b,e+b.length);return d}c.d(b,{A:()=>aI});var e=c(972421),f=c(145214),g=c(423721),h=c(348445);let i="phrasing",j=["autolink","link","image","label"];function k(a){this.enter({type:"link",title:null,url:"",children:[]},a)}function l(a){this.config.enter.autolinkProtocol.call(this,a)}function m(a){this.config.exit.autolinkProtocol.call(this,a)}function n(a){this.config.exit.data.call(this,a);let b=this.stack[this.stack.length-1];(0,e.ok)("link"===b.type),b.url="http://"+this.sliceSerialize(a)}function o(a){this.config.exit.autolinkEmail.call(this,a)}function p(a){this.exit(a)}function q(a){!function(a,b,c){let d=(0,h.C)((c||{}).ignore||[]),e=function(a){let b=[];if(!Array.isArray(a))throw TypeError("Expected find and replace tuple or list of tuples");let c=!a[0]||Array.isArray(a[0])?a:[a],d=-1;for(;++d<c.length;){var e;let a=c[d];b.push(["string"==typeof(e=a[0])?RegExp(function(a){if("string"!=typeof a)throw TypeError("Expected a string");return a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e,function(a){return"function"==typeof a?a:function(){return a}}(a[1])])}return b}(b),f=-1;for(;++f<e.length;)(0,g.VG)(a,"text",i);function i(a,b){let c,g=-1;for(;++g<b.length;){let a=b[g],e=c?c.children:void 0;if(d(a,e?e.indexOf(a):void 0,c))return;c=a}if(c)return function(a,b){let c=b[b.length-1],d=e[f][0],g=e[f][1],h=0,i=c.children.indexOf(a),j=!1,k=[];d.lastIndex=0;let l=d.exec(a.value);for(;l;){let c=l.index,e={index:l.index,input:l.input,stack:[...b,a]},f=g(...l,e);if("string"==typeof f&&(f=f.length>0?{type:"text",value:f}:void 0),!1===f?d.lastIndex=c+1:(h!==c&&k.push({type:"text",value:a.value.slice(h,c)}),Array.isArray(f)?k.push(...f):f&&k.push(f),h=c+l[0].length,j=!0),!d.global)break;l=d.exec(a.value)}return j?(h<a.value.length&&k.push({type:"text",value:a.value.slice(h)}),c.children.splice(i,1,...k)):k=[a],i+k.length}(a,b)}}(a,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,r],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,s]],{ignore:["link","linkReference"]})}function r(a,b,c,e,f){let g="";if(!t(f)||(/^w/i.test(b)&&(c=b+c,b="",g="http://"),!function(a){let b=a.split(".");return!(b.length<2||b[b.length-1]&&(/_/.test(b[b.length-1])||!/[a-zA-Z\d]/.test(b[b.length-1]))||b[b.length-2]&&(/_/.test(b[b.length-2])||!/[a-zA-Z\d]/.test(b[b.length-2])))}(c)))return!1;let h=function(a){let b=/[!"&'),.:;<>?\]}]+$/.exec(a);if(!b)return[a,void 0];a=a.slice(0,b.index);let c=b[0],e=c.indexOf(")"),f=d(a,"("),g=d(a,")");for(;-1!==e&&f>g;)a+=c.slice(0,e+1),e=(c=c.slice(e+1)).indexOf(")"),g++;return[a,c]}(c+e);if(!h[0])return!1;let i={type:"link",title:null,url:g+b+h[0],children:[{type:"text",value:b+h[0]}]};return h[1]?[i,{type:"text",value:h[1]}]:i}function s(a,b,c,d){return!(!t(d,!0)||/[-\d_]$/.test(c))&&{type:"link",title:null,url:"mailto:"+b+"@"+c,children:[{type:"text",value:b+"@"+c}]}}function t(a,b){let c=a.input.charCodeAt(a.index-1);return(0===a.index||(0,f.Ny)(c)||(0,f.es)(c))&&(!b||47!==c)}var u=c(732347);function v(){this.buffer()}function w(a){this.enter({type:"footnoteReference",identifier:"",label:""},a)}function x(){this.buffer()}function y(a){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},a)}function z(a){let b=this.resume(),c=this.stack[this.stack.length-1];(0,e.ok)("footnoteReference"===c.type),c.identifier=(0,u.B)(this.sliceSerialize(a)).toLowerCase(),c.label=b}function A(a){this.exit(a)}function B(a){let b=this.resume(),c=this.stack[this.stack.length-1];(0,e.ok)("footnoteDefinition"===c.type),c.identifier=(0,u.B)(this.sliceSerialize(a)).toLowerCase(),c.label=b}function C(a){this.exit(a)}function D(a,b,c,d){let e=c.createTracker(d),f=e.move("[^"),g=c.enter("footnoteReference"),h=c.enter("reference");return f+=e.move(c.safe(c.associationId(a),{after:"]",before:f})),h(),g(),f+=e.move("]")}function E(a,b,c){return 0===b?a:F(a,b,c)}function F(a,b,c){return(c?"":" ")+a}D.peek=function(){return"["};let G=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function H(a){this.enter({type:"delete",children:[]},a)}function I(a){this.exit(a)}function J(a,b,c,d){let e=c.createTracker(d),f=c.enter("strikethrough"),g=e.move("~~");return g+=c.containerPhrasing(a,{...e.current(),before:g,after:"~"}),g+=e.move("~~"),f(),g}function K(a){return a.length}function L(a){let b="string"==typeof a?a.codePointAt(0):0;return 67===b||99===b?99:76===b||108===b?108:114*(82===b||114===b)}J.peek=function(){return"~"};var M=c(294401);c(320608);c(210164);function N(a,b,c){let d=a.value||"",e="`",f=-1;for(;RegExp("(^|[^`])"+e+"([^`]|$)").test(d);)e+="`";for(/[^ \r\n]/.test(d)&&(/^[ \r\n]/.test(d)&&/[ \r\n]$/.test(d)||/^`|`$/.test(d))&&(d=" "+d+" ");++f<c.unsafe.length;){let a,b=c.unsafe[f],e=c.compilePattern(b);if(b.atBreak)for(;a=e.exec(d);){let b=a.index;10===d.charCodeAt(b)&&13===d.charCodeAt(b-1)&&b--,d=d.slice(0,b)+" "+d.slice(a.index+1)}}return e+d+e}N.peek=function(){return"`"};(0,h.C)(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let O={inlineCode:N,listItem:function(a,b,c,d){let e=function(a){let b=a.options.listItemIndent||"one";if("tab"!==b&&"one"!==b&&"mixed"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return b}(c),f=c.bulletCurrent||function(a){let b=a.options.bullet||"*";if("*"!==b&&"+"!==b&&"-"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.bullet`, expected `*`, `+`, or `-`");return b}(c);b&&"list"===b.type&&b.ordered&&(f=("number"==typeof b.start&&b.start>-1?b.start:1)+(!1===c.options.incrementListMarker?0:b.children.indexOf(a))+f);let g=f.length+1;("tab"===e||"mixed"===e&&(b&&"list"===b.type&&b.spread||a.spread))&&(g=4*Math.ceil(g/4));let h=c.createTracker(d);h.move(f+" ".repeat(g-f.length)),h.shift(g);let i=c.enter("listItem"),j=c.indentLines(c.containerFlow(a,h.current()),function(a,b,c){return b?(c?"":" ".repeat(g))+a:(c?f:f+" ".repeat(g-f.length))+a});return i(),j}};function P(a){let b=a._align;(0,e.ok)(b,"expected `_align` on table"),this.enter({type:"table",align:b.map(function(a){return"none"===a?null:a}),children:[]},a),this.data.inTable=!0}function Q(a){this.exit(a),this.data.inTable=void 0}function R(a){this.enter({type:"tableRow",children:[]},a)}function S(a){this.exit(a)}function T(a){this.enter({type:"tableCell",children:[]},a)}function U(a){let b=this.resume();this.data.inTable&&(b=b.replace(/\\([\\|])/g,V));let c=this.stack[this.stack.length-1];(0,e.ok)("inlineCode"===c.type),c.value=b,this.exit(a)}function V(a,b){return"|"===b?b:a}function W(a){let b=this.stack[this.stack.length-2];(0,e.ok)("listItem"===b.type),b.checked="taskListCheckValueChecked"===a.type}function X(a){let b=this.stack[this.stack.length-2];if(b&&"listItem"===b.type&&"boolean"==typeof b.checked){let a=this.stack[this.stack.length-1];(0,e.ok)("paragraph"===a.type);let c=a.children[0];if(c&&"text"===c.type){let d,e=b.children,f=-1;for(;++f<e.length;){let a=e[f];if("paragraph"===a.type){d=a;break}}d===a&&(c.value=c.value.slice(1),0===c.value.length?a.children.shift():a.position&&c.position&&"number"==typeof c.position.start.offset&&(c.position.start.column++,c.position.start.offset++,a.position.start=Object.assign({},c.position.start)))}}this.exit(a)}function Y(a,b,c,d){let e=a.children[0],f="boolean"==typeof a.checked&&e&&"paragraph"===e.type,g="["+(a.checked?"x":" ")+"] ",h=c.createTracker(d);f&&h.move(g);let i=O.listItem(a,b,c,{...d,...h.current()});return f&&(i=i.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(a){return a+g})),i}var Z=c(161693);let _={tokenize:function(a,b,c){let d=0;return function b(f){return(87===f||119===f)&&d<3?(d++,a.consume(f),b):46===f&&3===d?(a.consume(f),e):c(f)};function e(a){return null===a?c(a):b(a)}},partial:!0},aa={tokenize:function(a,b,c){let d,e,g;return h;function h(b){return 46===b||95===b?a.check(ac,j,i)(b):null===b||(0,f.Ee)(b)||(0,f.Ny)(b)||45!==b&&(0,f.es)(b)?j(b):(g=!0,a.consume(b),h)}function i(b){return 95===b?d=!0:(e=d,d=void 0),a.consume(b),h}function j(a){return e||d||!g?c(a):b(a)}},partial:!0},ab={tokenize:function(a,b){let c=0,d=0;return e;function e(h){return 40===h?(c++,a.consume(h),e):41===h&&d<c?g(h):33===h||34===h||38===h||39===h||41===h||42===h||44===h||46===h||58===h||59===h||60===h||63===h||93===h||95===h||126===h?a.check(ac,b,g)(h):null===h||(0,f.Ee)(h)||(0,f.Ny)(h)?b(h):(a.consume(h),e)}function g(b){return 41===b&&d++,a.consume(b),e}},partial:!0},ac={tokenize:function(a,b,c){return d;function d(h){return 33===h||34===h||39===h||41===h||42===h||44===h||46===h||58===h||59===h||63===h||95===h||126===h?(a.consume(h),d):38===h?(a.consume(h),g):93===h?(a.consume(h),e):60===h||null===h||(0,f.Ee)(h)||(0,f.Ny)(h)?b(h):c(h)}function e(a){return null===a||40===a||91===a||(0,f.Ee)(a)||(0,f.Ny)(a)?b(a):d(a)}function g(b){return(0,f.CW)(b)?function b(e){return 59===e?(a.consume(e),d):(0,f.CW)(e)?(a.consume(e),b):c(e)}(b):c(b)}},partial:!0},ad={tokenize:function(a,b,c){return function(b){return a.consume(b),d};function d(a){return(0,f.lV)(a)?c(a):b(a)}},partial:!0},ae={name:"wwwAutolink",tokenize:function(a,b,c){let d=this;return function(b){return 87!==b&&119!==b||!aj.call(d,d.previous)||an(d.events)?c(b):(a.enter("literalAutolink"),a.enter("literalAutolinkWww"),a.check(_,a.attempt(aa,a.attempt(ab,e),c),c)(b))};function e(c){return a.exit("literalAutolinkWww"),a.exit("literalAutolink"),b(c)}},previous:aj},af={name:"protocolAutolink",tokenize:function(a,b,c){let d=this,e="",g=!1;return function(b){return(72===b||104===b)&&ak.call(d,d.previous)&&!an(d.events)?(a.enter("literalAutolink"),a.enter("literalAutolinkHttp"),e+=String.fromCodePoint(b),a.consume(b),h):c(b)};function h(b){if((0,f.CW)(b)&&e.length<5)return e+=String.fromCodePoint(b),a.consume(b),h;if(58===b){let c=e.toLowerCase();if("http"===c||"https"===c)return a.consume(b),i}return c(b)}function i(b){return 47===b?(a.consume(b),g)?j:(g=!0,i):c(b)}function j(b){return null===b||(0,f.JQ)(b)||(0,f.Ee)(b)||(0,f.Ny)(b)||(0,f.es)(b)?c(b):a.attempt(aa,a.attempt(ab,k),c)(b)}function k(c){return a.exit("literalAutolinkHttp"),a.exit("literalAutolink"),b(c)}},previous:ak},ag={name:"emailAutolink",tokenize:function(a,b,c){let d,e,g=this;return function(b){return!am(b)||!al.call(g,g.previous)||an(g.events)?c(b):(a.enter("literalAutolink"),a.enter("literalAutolinkEmail"),function b(d){return am(d)?(a.consume(d),b):64===d?(a.consume(d),h):c(d)}(b))};function h(b){return 46===b?a.check(ad,j,i)(b):45===b||95===b||(0,f.lV)(b)?(e=!0,a.consume(b),h):j(b)}function i(b){return a.consume(b),d=!0,h}function j(h){return e&&d&&(0,f.CW)(g.previous)?(a.exit("literalAutolinkEmail"),a.exit("literalAutolink"),b(h)):c(h)}},previous:al},ah={},ai=48;for(;ai<123;)ah[ai]=ag,58==++ai?ai=65:91===ai&&(ai=97);function aj(a){return null===a||40===a||42===a||95===a||91===a||93===a||126===a||(0,f.Ee)(a)}function ak(a){return!(0,f.CW)(a)}function al(a){return!(47===a||am(a))}function am(a){return 43===a||45===a||46===a||95===a||(0,f.lV)(a)}function an(a){let b=a.length,c=!1;for(;b--;){let d=a[b][1];if(("labelLink"===d.type||"labelImage"===d.type)&&!d._balanced){c=!0;break}if(d._gfmAutolinkLiteralWalkedInto){c=!1;break}}return a.length>0&&!c&&(a[a.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),c}ah[43]=ag,ah[45]=ag,ah[46]=ag,ah[95]=ag,ah[72]=[ag,af],ah[104]=[ag,af],ah[87]=[ag,ae],ah[119]=[ag,ae];var ao=c(360478),ap=c(621405);let aq={tokenize:function(a,b,c){let d=this;return(0,ap.N)(a,function(a){let e=d.events[d.events.length-1];return e&&"gfmFootnoteDefinitionIndent"===e[1].type&&4===e[2].sliceSerialize(e[1],!0).length?b(a):c(a)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function ar(a,b,c){let d,e=this,f=e.events.length,g=e.parser.gfmFootnotes||(e.parser.gfmFootnotes=[]);for(;f--;){let a=e.events[f][1];if("labelImage"===a.type){d=a;break}if("gfmFootnoteCall"===a.type||"labelLink"===a.type||"label"===a.type||"image"===a.type||"link"===a.type)break}return function(f){if(!d||!d._balanced)return c(f);let h=(0,u.B)(e.sliceSerialize({start:d.end,end:e.now()}));return 94===h.codePointAt(0)&&g.includes(h.slice(1))?(a.enter("gfmFootnoteCallLabelMarker"),a.consume(f),a.exit("gfmFootnoteCallLabelMarker"),b(f)):c(f)}}function as(a,b){let c=a.length;for(;c--;)if("labelImage"===a[c][1].type&&"enter"===a[c][0]){a[c][1];break}a[c+1][1].type="data",a[c+3][1].type="gfmFootnoteCallLabelMarker";let d={type:"gfmFootnoteCall",start:Object.assign({},a[c+3][1].start),end:Object.assign({},a[a.length-1][1].end)},e={type:"gfmFootnoteCallMarker",start:Object.assign({},a[c+3][1].end),end:Object.assign({},a[c+3][1].end)};e.end.column++,e.end.offset++,e.end._bufferIndex++;let f={type:"gfmFootnoteCallString",start:Object.assign({},e.end),end:Object.assign({},a[a.length-1][1].start)},g={type:"chunkString",contentType:"string",start:Object.assign({},f.start),end:Object.assign({},f.end)},h=[a[c+1],a[c+2],["enter",d,b],a[c+3],a[c+4],["enter",e,b],["exit",e,b],["enter",f,b],["enter",g,b],["exit",g,b],["exit",f,b],a[a.length-2],a[a.length-1],["exit",d,b]];return a.splice(c,a.length-c+1,...h),a}function at(a,b,c){let d,e=this,g=e.parser.gfmFootnotes||(e.parser.gfmFootnotes=[]),h=0;return function(b){return a.enter("gfmFootnoteCall"),a.enter("gfmFootnoteCallLabelMarker"),a.consume(b),a.exit("gfmFootnoteCallLabelMarker"),i};function i(b){return 94!==b?c(b):(a.enter("gfmFootnoteCallMarker"),a.consume(b),a.exit("gfmFootnoteCallMarker"),a.enter("gfmFootnoteCallString"),a.enter("chunkString").contentType="string",j)}function j(i){if(h>999||93===i&&!d||null===i||91===i||(0,f.Ee)(i))return c(i);if(93===i){a.exit("chunkString");let d=a.exit("gfmFootnoteCallString");return g.includes((0,u.B)(e.sliceSerialize(d)))?(a.enter("gfmFootnoteCallLabelMarker"),a.consume(i),a.exit("gfmFootnoteCallLabelMarker"),a.exit("gfmFootnoteCall"),b):c(i)}return(0,f.Ee)(i)||(d=!0),h++,a.consume(i),92===i?k:j}function k(b){return 91===b||92===b||93===b?(a.consume(b),h++,j):j(b)}}function au(a,b,c){let d,e,g=this,h=g.parser.gfmFootnotes||(g.parser.gfmFootnotes=[]),i=0;return function(b){return a.enter("gfmFootnoteDefinition")._container=!0,a.enter("gfmFootnoteDefinitionLabel"),a.enter("gfmFootnoteDefinitionLabelMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionLabelMarker"),j};function j(b){return 94===b?(a.enter("gfmFootnoteDefinitionMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionMarker"),a.enter("gfmFootnoteDefinitionLabelString"),a.enter("chunkString").contentType="string",k):c(b)}function k(b){if(i>999||93===b&&!e||null===b||91===b||(0,f.Ee)(b))return c(b);if(93===b){a.exit("chunkString");let c=a.exit("gfmFootnoteDefinitionLabelString");return d=(0,u.B)(g.sliceSerialize(c)),a.enter("gfmFootnoteDefinitionLabelMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionLabelMarker"),a.exit("gfmFootnoteDefinitionLabel"),m}return(0,f.Ee)(b)||(e=!0),i++,a.consume(b),92===b?l:k}function l(b){return 91===b||92===b||93===b?(a.consume(b),i++,k):k(b)}function m(b){return 58===b?(a.enter("definitionMarker"),a.consume(b),a.exit("definitionMarker"),h.includes(d)||h.push(d),(0,ap.N)(a,n,"gfmFootnoteDefinitionWhitespace")):c(b)}function n(a){return b(a)}}function av(a,b,c){return a.check(ao.B,b,a.attempt(aq,b,c))}function aw(a){a.exit("gfmFootnoteDefinition")}var ax=c(962349),ay=c(598525);class az{constructor(){this.map=[]}add(a,b,c){!function(a,b,c,d){let e=0;if(0!==c||0!==d.length){for(;e<a.map.length;){if(a.map[e][0]===b){a.map[e][1]+=c,a.map[e][2].push(...d);return}e+=1}a.map.push([b,c,d])}}(this,a,b,c)}consume(a){if(this.map.sort(function(a,b){return a[0]-b[0]}),0===this.map.length)return;let b=this.map.length,c=[];for(;b>0;)b-=1,c.push(a.slice(this.map[b][0]+this.map[b][1]),this.map[b][2]),a.length=this.map[b][0];c.push(a.slice()),a.length=0;let d=c.pop();for(;d;){for(let b of d)a.push(b);d=c.pop()}this.map.length=0}}function aA(a,b,c){let d,e=this,g=0,h=0;return function(a){let b=e.events.length-1;for(;b>-1;){let a=e.events[b][1].type;if("lineEnding"===a||"linePrefix"===a)b--;else break}let d=b>-1?e.events[b][1].type:null,f="tableHead"===d||"tableRow"===d?t:i;return f===t&&e.parser.lazy[e.now().line]?c(a):f(a)};function i(b){var c;return a.enter("tableHead"),a.enter("tableRow"),124===(c=b)||(d=!0,h+=1),j(c)}function j(b){return null===b?c(b):(0,f.HP)(b)?h>1?(h=0,e.interrupt=!0,a.exit("tableRow"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),m):c(b):(0,f.On)(b)?(0,ap.N)(a,j,"whitespace")(b):(h+=1,d&&(d=!1,g+=1),124===b)?(a.enter("tableCellDivider"),a.consume(b),a.exit("tableCellDivider"),d=!0,j):(a.enter("data"),k(b))}function k(b){return null===b||124===b||(0,f.Ee)(b)?(a.exit("data"),j(b)):(a.consume(b),92===b?l:k)}function l(b){return 92===b||124===b?(a.consume(b),k):k(b)}function m(b){return(e.interrupt=!1,e.parser.lazy[e.now().line])?c(b):(a.enter("tableDelimiterRow"),d=!1,(0,f.On)(b))?(0,ap.N)(a,n,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):n(b)}function n(b){return 45===b||58===b?p(b):124===b?(d=!0,a.enter("tableCellDivider"),a.consume(b),a.exit("tableCellDivider"),o):c(b)}function o(b){return(0,f.On)(b)?(0,ap.N)(a,p,"whitespace")(b):p(b)}function p(b){return 58===b?(h+=1,d=!0,a.enter("tableDelimiterMarker"),a.consume(b),a.exit("tableDelimiterMarker"),q):45===b?(h+=1,q(b)):null===b||(0,f.HP)(b)?s(b):c(b)}function q(b){return 45===b?(a.enter("tableDelimiterFiller"),function b(c){return 45===c?(a.consume(c),b):58===c?(d=!0,a.exit("tableDelimiterFiller"),a.enter("tableDelimiterMarker"),a.consume(c),a.exit("tableDelimiterMarker"),r):(a.exit("tableDelimiterFiller"),r(c))}(b)):c(b)}function r(b){return(0,f.On)(b)?(0,ap.N)(a,s,"whitespace")(b):s(b)}function s(e){if(124===e)return n(e);if(null===e||(0,f.HP)(e))return d&&g===h?(a.exit("tableDelimiterRow"),a.exit("tableHead"),b(e)):c(e);return c(e)}function t(b){return a.enter("tableRow"),u(b)}function u(c){return 124===c?(a.enter("tableCellDivider"),a.consume(c),a.exit("tableCellDivider"),u):null===c||(0,f.HP)(c)?(a.exit("tableRow"),b(c)):(0,f.On)(c)?(0,ap.N)(a,u,"whitespace")(c):(a.enter("data"),v(c))}function v(b){return null===b||124===b||(0,f.Ee)(b)?(a.exit("data"),u(b)):(a.consume(b),92===b?w:v)}function w(b){return 92===b||124===b?(a.consume(b),v):v(b)}}function aB(a,b){let c,d,e,f=-1,g=!0,h=0,i=[0,0,0,0],j=[0,0,0,0],k=!1,l=0,m=new az;for(;++f<a.length;){let n=a[f],o=n[1];"enter"===n[0]?"tableHead"===o.type?(k=!1,0!==l&&(aD(m,b,l,c,d),d=void 0,l=0),c={type:"table",start:Object.assign({},o.start),end:Object.assign({},o.end)},m.add(f,0,[["enter",c,b]])):"tableRow"===o.type||"tableDelimiterRow"===o.type?(g=!0,e=void 0,i=[0,0,0,0],j=[0,f+1,0,0],k&&(k=!1,d={type:"tableBody",start:Object.assign({},o.start),end:Object.assign({},o.end)},m.add(f,0,[["enter",d,b]])),h="tableDelimiterRow"===o.type?2:d?3:1):h&&("data"===o.type||"tableDelimiterMarker"===o.type||"tableDelimiterFiller"===o.type)?(g=!1,0===j[2]&&(0!==i[1]&&(j[0]=j[1],e=aC(m,b,i,h,void 0,e),i=[0,0,0,0]),j[2]=f)):"tableCellDivider"===o.type&&(g?g=!1:(0!==i[1]&&(j[0]=j[1],e=aC(m,b,i,h,void 0,e)),j=[(i=j)[1],f,0,0])):"tableHead"===o.type?(k=!0,l=f):"tableRow"===o.type||"tableDelimiterRow"===o.type?(l=f,0!==i[1]?(j[0]=j[1],e=aC(m,b,i,h,f,e)):0!==j[1]&&(e=aC(m,b,j,h,f,e)),h=0):h&&("data"===o.type||"tableDelimiterMarker"===o.type||"tableDelimiterFiller"===o.type)&&(j[3]=f)}for(0!==l&&aD(m,b,l,c,d),m.consume(b.events),f=-1;++f<b.events.length;){let a=b.events[f];"enter"===a[0]&&"table"===a[1].type&&(a[1]._align=function(a,b){let c=!1,d=[];for(;b<a.length;){let e=a[b];if(c){if("enter"===e[0])"tableContent"===e[1].type&&d.push("tableDelimiterMarker"===a[b+1][1].type?"left":"none");else if("tableContent"===e[1].type){if("tableDelimiterMarker"===a[b-1][1].type){let a=d.length-1;d[a]="left"===d[a]?"center":"right"}}else if("tableDelimiterRow"===e[1].type)break}else"enter"===e[0]&&"tableDelimiterRow"===e[1].type&&(c=!0);b+=1}return d}(b.events,f))}return a}function aC(a,b,c,d,e,f){0!==c[0]&&(f.end=Object.assign({},aE(b.events,c[0])),a.add(c[0],0,[["exit",f,b]]));let g=aE(b.events,c[1]);if(f={type:1===d?"tableHeader":2===d?"tableDelimiter":"tableData",start:Object.assign({},g),end:Object.assign({},g)},a.add(c[1],0,[["enter",f,b]]),0!==c[2]){let e=aE(b.events,c[2]),f=aE(b.events,c[3]),g={type:"tableContent",start:Object.assign({},e),end:Object.assign({},f)};if(a.add(c[2],0,[["enter",g,b]]),2!==d){let d=b.events[c[2]],e=b.events[c[3]];if(d[1].end=Object.assign({},e[1].end),d[1].type="chunkText",d[1].contentType="text",c[3]>c[2]+1){let b=c[2]+1,d=c[3]-c[2]-1;a.add(b,d,[])}}a.add(c[3]+1,0,[["exit",g,b]])}return void 0!==e&&(f.end=Object.assign({},aE(b.events,e)),a.add(e,0,[["exit",f,b]]),f=void 0),f}function aD(a,b,c,d,e){let f=[],g=aE(b.events,c);e&&(e.end=Object.assign({},g),f.push(["exit",e,b])),d.end=Object.assign({},g),f.push(["exit",d,b]),a.add(c+1,0,f)}function aE(a,b){let c=a[b],d="enter"===c[0]?"start":"end";return c[1][d]}let aF={name:"tasklistCheck",tokenize:function(a,b,c){let d=this;return function(b){return null===d.previous&&d._gfmTasklistFirstContentOfListItem?(a.enter("taskListCheck"),a.enter("taskListCheckMarker"),a.consume(b),a.exit("taskListCheckMarker"),e):c(b)};function e(b){return(0,f.Ee)(b)?(a.enter("taskListCheckValueUnchecked"),a.consume(b),a.exit("taskListCheckValueUnchecked"),g):88===b||120===b?(a.enter("taskListCheckValueChecked"),a.consume(b),a.exit("taskListCheckValueChecked"),g):c(b)}function g(b){return 93===b?(a.enter("taskListCheckMarker"),a.consume(b),a.exit("taskListCheckMarker"),a.exit("taskListCheck"),h):c(b)}function h(d){return(0,f.HP)(d)?b(d):(0,f.On)(d)?a.check({tokenize:aG},b,c)(d):c(d)}}};function aG(a,b,c){return(0,ap.N)(a,function(a){return null===a?c(a):b(a)},"whitespace")}let aH={};function aI(a){let b,c=a||aH,d=this.data(),e=d.micromarkExtensions||(d.micromarkExtensions=[]),f=d.fromMarkdownExtensions||(d.fromMarkdownExtensions=[]),g=d.toMarkdownExtensions||(d.toMarkdownExtensions=[]);e.push((0,Z.y)([{text:ah},{document:{91:{name:"gfmFootnoteDefinition",tokenize:au,continuation:{tokenize:av},exit:aw}},text:{91:{name:"gfmFootnoteCall",tokenize:at},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ar,resolveTo:as}}},function(a){let b=(a||{}).singleTilde,c={name:"strikethrough",tokenize:function(a,c,d){let e=this.previous,f=this.events,g=0;return function(h){return 126===e&&"characterEscape"!==f[f.length-1][1].type?d(h):(a.enter("strikethroughSequenceTemporary"),function f(h){let i=(0,M.S)(e);if(126===h)return g>1?d(h):(a.consume(h),g++,f);if(g<2&&!b)return d(h);let j=a.exit("strikethroughSequenceTemporary"),k=(0,M.S)(h);return j._open=!k||2===k&&!!i,j._close=!i||2===i&&!!k,c(h)}(h))}},resolveAll:function(a,b){let c=-1;for(;++c<a.length;)if("enter"===a[c][0]&&"strikethroughSequenceTemporary"===a[c][1].type&&a[c][1]._close){let d=c;for(;d--;)if("exit"===a[d][0]&&"strikethroughSequenceTemporary"===a[d][1].type&&a[d][1]._open&&a[c][1].end.offset-a[c][1].start.offset==a[d][1].end.offset-a[d][1].start.offset){a[c][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";let e={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[c][1].end)},f={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[c][1].start)},g=[["enter",e,b],["enter",a[d][1],b],["exit",a[d][1],b],["enter",f,b]],h=b.parser.constructs.insideSpan.null;h&&(0,ax.m)(g,g.length,0,(0,ay.W)(h,a.slice(d+1,c),b)),(0,ax.m)(g,g.length,0,[["exit",f,b],["enter",a[c][1],b],["exit",a[c][1],b],["exit",e,b]]),(0,ax.m)(a,d-1,c-d+3,g),c=d+g.length-2;break}}for(c=-1;++c<a.length;)"strikethroughSequenceTemporary"===a[c][1].type&&(a[c][1].type="data");return a}};return null==b&&(b=!0),{text:{126:c},insideSpan:{null:[c]},attentionMarkers:{null:[126]}}}(c),{flow:{null:{name:"table",tokenize:aA,resolveAll:aB}}},{text:{91:aF}}])),f.push([{transforms:[q],enter:{literalAutolink:k,literalAutolinkEmail:l,literalAutolinkHttp:l,literalAutolinkWww:l},exit:{literalAutolink:p,literalAutolinkEmail:o,literalAutolinkHttp:m,literalAutolinkWww:n}},{enter:{gfmFootnoteCallString:v,gfmFootnoteCall:w,gfmFootnoteDefinitionLabelString:x,gfmFootnoteDefinition:y},exit:{gfmFootnoteCallString:z,gfmFootnoteCall:A,gfmFootnoteDefinitionLabelString:B,gfmFootnoteDefinition:C}},{canContainEols:["delete"],enter:{strikethrough:H},exit:{strikethrough:I}},{enter:{table:P,tableData:T,tableHeader:T,tableRow:R},exit:{codeText:U,table:Q,tableData:S,tableHeader:S,tableRow:S}},{exit:{taskListCheckValueChecked:W,taskListCheckValueUnchecked:W,paragraph:X}}]),g.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:i,notInConstruct:j},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:i,notInConstruct:j},{character:":",before:"[ps]",after:"\\/",inConstruct:i,notInConstruct:j}]},(b=!1,c&&c.firstLineBlank&&(b=!0),{handlers:{footnoteDefinition:function(a,c,d,e){let f=d.createTracker(e),g=f.move("[^"),h=d.enter("footnoteDefinition"),i=d.enter("label");return g+=f.move(d.safe(d.associationId(a),{before:g,after:"]"})),i(),g+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),g+=f.move((b?"\n":" ")+d.indentLines(d.containerFlow(a,f.current()),b?F:E))),h(),g},footnoteReference:D},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:G}],handlers:{delete:J}},function(a){let b=a||{},c=b.tableCellPadding,d=b.tablePipeAlign,e=b.stringLength,f=c?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(a,b,c){let d=O.inlineCode(a,b,c);return c.stack.includes("tableCell")&&(d=d.replace(/\|/g,"\\$&")),d},table:function(a,b,c,d){return h(function(a,b,c){let d=a.children,e=-1,f=[],g=b.enter("table");for(;++e<d.length;)f[e]=i(d[e],b,c);return g(),f}(a,c,d),a.align)},tableCell:g,tableRow:function(a,b,c,d){let e=h([i(a,c,d)]);return e.slice(0,e.indexOf("\n"))}}};function g(a,b,c,d){let e=c.enter("tableCell"),g=c.enter("phrasing"),h=c.containerPhrasing(a,{...d,before:f,after:f});return g(),e(),h}function h(a,b){return function(a,b){let c=b||{},d=(c.align||[]).concat(),e=c.stringLength||K,f=[],g=[],h=[],i=[],j=0,k=-1;for(;++k<a.length;){let b=[],d=[],f=-1;for(a[k].length>j&&(j=a[k].length);++f<a[k].length;){var l;let g=null==(l=a[k][f])?"":String(l);if(!1!==c.alignDelimiters){let a=e(g);d[f]=a,(void 0===i[f]||a>i[f])&&(i[f]=a)}b.push(g)}g[k]=b,h[k]=d}let m=-1;if("object"==typeof d&&"length"in d)for(;++m<j;)f[m]=L(d[m]);else{let a=L(d);for(;++m<j;)f[m]=a}m=-1;let n=[],o=[];for(;++m<j;){let a=f[m],b="",d="";99===a?(b=":",d=":"):108===a?b=":":114===a&&(d=":");let e=!1===c.alignDelimiters?1:Math.max(1,i[m]-b.length-d.length),g=b+"-".repeat(e)+d;!1!==c.alignDelimiters&&((e=b.length+e+d.length)>i[m]&&(i[m]=e),o[m]=e),n[m]=g}g.splice(1,0,n),h.splice(1,0,o),k=-1;let p=[];for(;++k<g.length;){let a=g[k],b=h[k];m=-1;let d=[];for(;++m<j;){let e=a[m]||"",g="",h="";if(!1!==c.alignDelimiters){let a=i[m]-(b[m]||0),c=f[m];114===c?g=" ".repeat(a):99===c?a%2?(g=" ".repeat(a/2+.5),h=" ".repeat(a/2-.5)):h=g=" ".repeat(a/2):h=" ".repeat(a)}!1===c.delimiterStart||m||d.push("|"),!1!==c.padding&&(!1!==c.alignDelimiters||""!==e)&&(!1!==c.delimiterStart||m)&&d.push(" "),!1!==c.alignDelimiters&&d.push(g),d.push(e),!1!==c.alignDelimiters&&d.push(h),!1!==c.padding&&d.push(" "),(!1!==c.delimiterEnd||m!==j-1)&&d.push("|")}p.push(!1===c.delimiterEnd?d.join("").replace(/ +$/,""):d.join(""))}return p.join("\n")}(a,{align:b,alignDelimiters:d,padding:c,stringLength:e})}function i(a,b,c){let d=a.children,e=-1,f=[],h=b.enter("tableRow");for(;++e<d.length;)f[e]=g(d[e],a,b,c);return h(),f}}(c),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Y}}]})}},663033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},665466:(a,b,c)=>{"use strict";c.d(b,{E:()=>i,I:()=>j});var d=c(736927),e=c(115962),f=c(437503),g=c(930439),h=c(535798);function i({event:a,expanded:b,onToggle:c,onOpenPerson:e,onOpenCompany:g}){let i=a.start_at?new Date(a.start_at):null,k=a.end_at?new Date(a.end_at):null,l=i?k?`${o(i)} – ${o(k)}`:o(i):"",m=(a.attendees??[]).slice(0,5),p=(a.attendees?.length??0)-m.length;return(0,d.jsxs)("li",{className:"overflow-hidden",style:{background:b?"var(--color-surface-hover)":"transparent",transition:"background 120ms ease"},children:[(0,d.jsxs)("div",{role:"button",tabIndex:0,"aria-expanded":b,onClick:c,onKeyDown:a=>{a.target===a.currentTarget&&("Enter"===a.key||" "===a.key)&&(a.preventDefault(),c())},className:"group/event w-full flex items-center gap-3 px-3 py-2 text-left cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)] transition-colors",onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:[(0,d.jsx)("div",{className:"text-[12px] tabular-nums shrink-0 whitespace-nowrap",style:{color:"var(--color-text-muted)",width:"11rem"},children:l||(a.start_at?(0,h.wI)(a.start_at):"")}),(0,d.jsxs)("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[(0,d.jsx)("p",{className:"truncate text-[13.5px]",style:{color:"var(--color-text)",fontWeight:500},children:a.title?.trim()||"(no title)"}),a.meeting_type&&(0,d.jsx)("span",{className:"shrink-0 rounded-full px-1.5 py-0 text-[10px] uppercase tracking-[0.06em]",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)",fontWeight:600},children:a.meeting_type})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[m.length>0&&(0,d.jsxs)("div",{className:"flex items-center -space-x-1.5",children:[m.slice(0,4).map(a=>(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),e?.(a.id)},disabled:!e,title:a.name??a.email??void 0,className:"disabled:cursor-default rounded-full",style:{boxShadow:"0 0 0 2px var(--color-background)"},children:(0,d.jsx)(f.X,{src:a.avatar_url,name:a.name,seed:a.email??a.id,size:"sm"})},a.id)),p>0&&(0,d.jsxs)("span",{className:"ml-1 text-[11px] tabular-nums",style:{color:"var(--color-text-muted)"},children:["+",p]})]}),(0,d.jsx)(n,{expanded:b})]})]}),(0,d.jsx)("div",{className:"grid transition-[grid-template-rows] duration-[220ms] ease-out motion-reduce:transition-none",style:{gridTemplateRows:b?"1fr":"0fr"},children:(0,d.jsx)("div",{className:"overflow-hidden",children:b&&(0,d.jsx)(j,{eventId:a.id,fallbackEvent:a,onOpenPerson:e,onOpenCompany:g})})})]})}function j({eventId:a,fallbackEvent:b,onOpenPerson:c,onOpenCompany:f}){var g;let[h,i]=(0,e.useState)(null),[j,n]=(0,e.useState)(!0),[p,q]=(0,e.useState)(null),r=h?.event.start_at??b.start_at?new Date(h?.event.start_at??b.start_at):null,s=h?.event.end_at??b.end_at?new Date(h?.event.end_at??b.end_at):null,t=r?(g=r,new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(g)):null,u=r?s?`${o(r)} – ${o(s)}`:o(r):null,v=r&&s?function(a,b){let c=b.getTime()-a.getTime();if(c<=0)return"";let d=Math.round(c/6e4);if(d>=1440){let a=Math.round(d/1440);return`${a} day${1===a?"":"s"}`}let e=Math.floor(d/60),f=d%60;return 0===e?`${f} min`:0===f?`${e}h`:`${e}h ${f}m`}(r,s):null,w=h?.organizer??null,x=h?.attendees??b.attendees??[],y=h?.companies??[];return(0,d.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border)",background:"var(--color-background)"},children:[(t||u||v)&&(0,d.jsx)(k,{label:"When",children:(0,d.jsxs)("div",{className:"text-[13px]",style:{color:"var(--color-text)"},children:[t&&(0,d.jsx)("div",{className:"font-medium",children:t}),(u||v)&&(0,d.jsxs)("div",{className:"mt-0.5",style:{color:"var(--color-text-muted)"},children:[u,u&&v&&" \xb7 ",v]})]})}),w&&(0,d.jsx)(k,{label:"Organizer",children:(0,d.jsx)(l,{person:w,onOpenPerson:c})}),x.length>0&&(0,d.jsx)(k,{label:`Attendees \xb7 ${x.length}`,children:(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:x.map(a=>(0,d.jsx)(l,{person:a,onOpenPerson:c},a.id))})}),y.length>0&&(0,d.jsx)(k,{label:1===y.length?"Company":"Companies",children:(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:y.map(a=>(0,d.jsx)(m,{company:a,onOpenCompany:f},a.id))})}),j&&!h&&(0,d.jsx)("p",{className:"text-[12px]",style:{color:"var(--color-text-muted)"},children:"Loading meeting details…"}),p&&(0,d.jsxs)("p",{className:"text-[12px]",style:{color:"var(--color-text-muted)"},children:["Couldn’t load meeting details (",p,"). Showing what we have."]}),!j&&!p&&h&&0===x.length&&!w&&0===y.length&&(0,d.jsx)("p",{className:"text-[12px]",style:{color:"var(--color-text-muted)"},children:"No additional details for this meeting."})]})}function k({label:a,children:b}){return(0,d.jsxs)("div",{className:"mb-4 last:mb-0",children:[(0,d.jsx)("h4",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:a}),b]})}function l({person:a,onOpenPerson:b}){let c=a.name?.trim()||a.email||"Unknown",e=a.name?.trim()&&a.email?a.email:null;return(0,d.jsxs)("button",{type:"button",onClick:()=>b?.(a.id),disabled:!b,className:"flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left transition-colors disabled:cursor-default",style:{color:"var(--color-text)"},onMouseEnter:a=>{b&&(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsx)(f.X,{src:a.avatar_url,name:c,seed:a.email??a.id,size:"sm"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-[13px] font-medium",style:{color:"var(--color-text)"},children:c}),e&&(0,d.jsx)("p",{className:"truncate text-[11px]",style:{color:"var(--color-text-muted)"},children:e})]})]})}function m({company:a,onOpenCompany:b}){let c=a.name?.trim()||a.domain||"Unknown company";return(0,d.jsxs)("button",{type:"button",onClick:()=>b?.(a.id),disabled:!b,className:"flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left transition-colors disabled:cursor-default",onMouseEnter:a=>{b&&(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsx)(g.g,{domain:a.domain,name:a.name,size:"sm"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-[13px] font-medium",style:{color:"var(--color-text)"},children:c}),a.domain&&a.name&&(0,d.jsx)("p",{className:"truncate text-[11px]",style:{color:"var(--color-text-muted)"},children:a.domain})]})]})}function n({expanded:a}){return(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,className:"motion-reduce:transition-none",style:{color:"var(--color-text-muted)",transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"},children:(0,d.jsx)("path",{d:"m6 9 6 6 6-6"})})}function o(a){return new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(a)}},669661:(a,b,c)=>{"use strict";c.d(b,{Lz:()=>bR,NZ:()=>br,zF:()=>bu});var d=c(381802),e=c(331480),f=c(731626);let g=function(a){for(var b=0;;b++)if(!(a=a.previousSibling))return b},h=function(a){let b=a.assignedSlot||a.parentNode;return b&&11==b.nodeType?b.host:b},i=null,j=function(a,b,c){let d=i||(i=document.createRange());return d.setEnd(a,null==c?a.nodeValue.length:c),d.setStart(a,b||0),d},k=function(){i=null},l=function(a,b,c,d){return c&&(n(a,b,c,d,-1)||n(a,b,c,d,1))},m=/^(img|br|input|textarea|hr)$/i;function n(a,b,c,d,e){for(var f;;){if(a==c&&b==d)return!0;if(b==(e<0?0:o(a))){let c=a.parentNode;if(!c||1!=c.nodeType||p(a)||m.test(a.nodeName)||"false"==a.contentEditable)return!1;b=g(a)+(e<0?0:1),a=c}else{if(1!=a.nodeType)return!1;let c=a.childNodes[b+(e<0?-1:0)];if(1==c.nodeType&&"false"==c.contentEditable)if(null==(f=c.pmViewDesc)||!f.ignoreForSelection)return!1;else b+=e;else a=c,b=e<0?o(a):0}}}function o(a){return 3==a.nodeType?a.nodeValue.length:a.childNodes.length}function p(a){let b;for(let c=a;c&&!(b=c.pmViewDesc);c=c.parentNode);return b&&b.node&&b.node.isBlock&&(b.dom==a||b.contentDOM==a)}let q=function(a){return a.focusNode&&l(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset)};function r(a,b){let c=document.createEvent("Event");return c.initEvent("keydown",!0,!0),c.keyCode=a,c.key=c.code=b,c}let s="undefined"!=typeof navigator?navigator:null,t="undefined"!=typeof document?document:null,u=s&&s.userAgent||"",v=/Edge\/(\d+)/.exec(u),w=/MSIE \d/.exec(u),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(u),y=!!(w||x||v),z=w?document.documentMode:x?+x[1]:v?+v[1]:0,A=!y&&/gecko\/(\d+)/i.test(u);A&&(/Firefox\/(\d+)/.exec(u)||[0,0])[1];let B=!y&&/Chrome\/(\d+)/.exec(u),C=!!B,D=B?+B[1]:0,E=!y&&!!s&&/Apple Computer/.test(s.vendor),F=E&&(/Mobile\/\w+/.test(u)||!!s&&s.maxTouchPoints>2),G=F||!!s&&/Mac/.test(s.platform),H=!!s&&/Win/.test(s.platform),I=/Android \d/.test(u),J=!!t&&"webkitFontSmoothing"in t.documentElement.style,K=J?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function L(a,b){return"number"==typeof a?a:a[b]}function M(a,b,c){let d=a.someProp("scrollThreshold")||0,e=a.someProp("scrollMargin")||5,f=a.dom.ownerDocument;for(let g=c||a.dom;g;){if(1!=g.nodeType){g=h(g);continue}let a=g,c=a==f.body,i=c?function(a){let b=a.defaultView&&a.defaultView.visualViewport;return b?{left:0,right:b.width,top:0,bottom:b.height}:{left:0,right:a.documentElement.clientWidth,top:0,bottom:a.documentElement.clientHeight}}(f):function(a){let b=a.getBoundingClientRect(),c=b.width/a.offsetWidth||1,d=b.height/a.offsetHeight||1;return{left:b.left,right:b.left+a.clientWidth*c,top:b.top,bottom:b.top+a.clientHeight*d}}(a),j=0,k=0;if(b.top<i.top+L(d,"top")?k=-(i.top-b.top+L(e,"top")):b.bottom>i.bottom-L(d,"bottom")&&(k=b.bottom-b.top>i.bottom-i.top?b.top+L(e,"top")-i.top:b.bottom-i.bottom+L(e,"bottom")),b.left<i.left+L(d,"left")?j=-(i.left-b.left+L(e,"left")):b.right>i.right-L(d,"right")&&(j=b.right-i.right+L(e,"right")),j||k)if(c)f.defaultView.scrollBy(j,k);else{let c=a.scrollLeft,d=a.scrollTop;k&&(a.scrollTop+=k),j&&(a.scrollLeft+=j);let e=a.scrollLeft-c,f=a.scrollTop-d;b={left:b.left-e,top:b.top-f,right:b.right-e,bottom:b.bottom-f}}let l=c?"fixed":getComputedStyle(g).position;if(/^(fixed|sticky)$/.test(l))break;g="absolute"==l?g.offsetParent:h(g)}}function N(a){let b=[],c=a.ownerDocument;for(let d=a;d&&(b.push({dom:d,top:d.scrollTop,left:d.scrollLeft}),a!=c);d=h(d));return b}function O(a,b){for(let c=0;c<a.length;c++){let{dom:d,top:e,left:f}=a[c];d.scrollTop!=e+b&&(d.scrollTop=e+b),d.scrollLeft!=f&&(d.scrollLeft=f)}}let P=null;function Q(a,b){return a.left>=b.left-1&&a.left<=b.right+1&&a.top>=b.top-1&&a.top<=b.bottom+1}function R(a){return a.top<a.bottom||a.left<a.right}function S(a,b){let c=a.getClientRects();if(c.length){let a=c[b<0?0:c.length-1];if(R(a))return a}return Array.prototype.find.call(c,R)||a.getBoundingClientRect()}let T=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function U(a,b,c){let{node:d,offset:e,atom:f}=a.docView.domFromPos(b,c<0?-1:1),g=J||A;if(3==d.nodeType)if(g&&(T.test(d.nodeValue)||(c<0?!e:e==d.nodeValue.length))){let a=S(j(d,e,e),c);if(A&&e&&/\s/.test(d.nodeValue[e-1])&&e<d.nodeValue.length){let b=S(j(d,e-1,e-1),-1);if(b.top==a.top){let c=S(j(d,e,e+1),-1);if(c.top!=a.top)return V(c,c.left<b.left)}}return a}else{let a=e,b=e,f=c<0?1:-1;return c<0&&!e?(b++,f=-1):c>=0&&e==d.nodeValue.length?(a--,f=1):c<0?a--:b++,V(S(j(d,a,b),f),f<0)}if(!a.state.doc.resolve(b-(f||0)).parent.inlineContent){if(null==f&&e&&(c<0||e==o(d))){let a=d.childNodes[e-1];if(1==a.nodeType)return W(a.getBoundingClientRect(),!1)}if(null==f&&e<o(d)){let a=d.childNodes[e];if(1==a.nodeType)return W(a.getBoundingClientRect(),!0)}return W(d.getBoundingClientRect(),c>=0)}if(null==f&&e&&(c<0||e==o(d))){let a=d.childNodes[e-1],b=3==a.nodeType?j(a,o(a)-!g):1!=a.nodeType||"BR"==a.nodeName&&a.nextSibling?null:a;if(b)return V(S(b,1),!1)}if(null==f&&e<o(d)){let a=d.childNodes[e];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let b=a?3==a.nodeType?j(a,0,+!g):1==a.nodeType?a:null:null;if(b)return V(S(b,-1),!0)}return V(S(3==d.nodeType?j(d):d,-c),c>=0)}function V(a,b){if(0==a.width)return a;let c=b?a.left:a.right;return{top:a.top,bottom:a.bottom,left:c,right:c}}function W(a,b){if(0==a.height)return a;let c=b?a.top:a.bottom;return{top:c,bottom:c,left:a.left,right:a.right}}function X(a,b,c){let d=a.state,e=a.root.activeElement;d!=b&&a.updateState(b),e!=a.dom&&a.focus();try{return c()}finally{d!=b&&a.updateState(d),e!=a.dom&&e&&e.focus()}}let Y=/[\u0590-\u08ac]/,Z=null,_=null,aa=!1;class ab{constructor(a,b,c,d){this.parent=a,this.children=b,this.dom=c,this.contentDOM=d,this.dirty=0,c.pmViewDesc=this}matchesWidget(a){return!1}matchesMark(a){return!1}matchesNode(a,b,c){return!1}matchesHack(a){return!1}parseRule(){return null}stopEvent(a){return!1}get size(){let a=0;for(let b=0;b<this.children.length;b++)a+=this.children[b].size;return a}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let a=0;a<this.children.length;a++)this.children[a].destroy()}posBeforeChild(a){for(let b=0,c=this.posAtStart;;b++){let d=this.children[b];if(d==a)return c;c+=d.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(a,b,c){let d;if(this.contentDOM&&this.contentDOM.contains(1==a.nodeType?a:a.parentNode))if(c<0){let c,d;if(a==this.contentDOM)c=a.childNodes[b-1];else{for(;a.parentNode!=this.contentDOM;)a=a.parentNode;c=a.previousSibling}for(;c&&!((d=c.pmViewDesc)&&d.parent==this);)c=c.previousSibling;return c?this.posBeforeChild(d)+d.size:this.posAtStart}else{let c,d;if(a==this.contentDOM)c=a.childNodes[b];else{for(;a.parentNode!=this.contentDOM;)a=a.parentNode;c=a.nextSibling}for(;c&&!((d=c.pmViewDesc)&&d.parent==this);)c=c.nextSibling;return c?this.posBeforeChild(d):this.posAtEnd}if(a==this.dom&&this.contentDOM)d=b>g(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))d=2&a.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==b)for(let b=a;;b=b.parentNode){if(b==this.dom){d=!1;break}if(b.previousSibling)break}if(null==d&&b==a.childNodes.length)for(let b=a;;b=b.parentNode){if(b==this.dom){d=!0;break}if(b.nextSibling)break}}return(null==d?c>0:d)?this.posAtEnd:this.posAtStart}nearestDesc(a,b=!1){for(let c=!0,d=a;d;d=d.parentNode){let e=this.getDesc(d),f;if(e&&(!b||e.node))if(!c||!(f=e.nodeDOM)||(1==f.nodeType?f.contains(1==a.nodeType?a:a.parentNode):f==a))return e;else c=!1}}getDesc(a){let b=a.pmViewDesc;for(let a=b;a;a=a.parent)if(a==this)return b}posFromDOM(a,b,c){for(let d=a;d;d=d.parentNode){let e=this.getDesc(d);if(e)return e.localPosFromDOM(a,b,c)}return -1}descAt(a){for(let b=0,c=0;b<this.children.length;b++){let d=this.children[b],e=c+d.size;if(c==a&&e!=c){for(;!d.border&&d.children.length;)for(let a=0;a<d.children.length;a++){let b=d.children[a];if(b.size){d=b;break}}return d}if(a<e)return d.descAt(a-c-d.border);c=e}}domFromPos(a,b){if(!this.contentDOM)return{node:this.dom,offset:0,atom:a+1};let c=0,d=0;for(let b=0;c<this.children.length;c++){let e=this.children[c],f=b+e.size;if(f>a||e instanceof ai){d=a-b;break}b=f}if(d)return this.children[c].domFromPos(d-this.children[c].border,b);for(let a;c&&!(a=this.children[c-1]).size&&a instanceof ac&&a.side>=0;c--);if(b<=0){let a,d=!0;for(;(a=c?this.children[c-1]:null)&&a.dom.parentNode!=this.contentDOM;c--,d=!1);return a&&b&&d&&!a.border&&!a.domAtom?a.domFromPos(a.size,b):{node:this.contentDOM,offset:a?g(a.dom)+1:0}}{let a,d=!0;for(;(a=c<this.children.length?this.children[c]:null)&&a.dom.parentNode!=this.contentDOM;c++,d=!1);return a&&d&&!a.border&&!a.domAtom?a.domFromPos(0,b):{node:this.contentDOM,offset:a?g(a.dom):this.contentDOM.childNodes.length}}}parseRange(a,b,c=0){if(0==this.children.length)return{node:this.contentDOM,from:a,to:b,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let d=-1,e=-1;for(let f=c,h=0;;h++){let c=this.children[h],i=f+c.size;if(-1==d&&a<=i){let e=f+c.border;if(a>=e&&b<=i-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(a,b,e);a=f;for(let b=h;b>0;b--){let c=this.children[b-1];if(c.size&&c.dom.parentNode==this.contentDOM&&!c.emptyChildAt(1)){d=g(c.dom)+1;break}a-=c.size}-1==d&&(d=0)}if(d>-1&&(i>b||h==this.children.length-1)){b=i;for(let a=h+1;a<this.children.length;a++){let c=this.children[a];if(c.size&&c.dom.parentNode==this.contentDOM&&!c.emptyChildAt(-1)){e=g(c.dom);break}b+=c.size}-1==e&&(e=this.contentDOM.childNodes.length);break}f=i}return{node:this.contentDOM,from:a,to:b,fromOffset:d,toOffset:e}}emptyChildAt(a){if(this.border||!this.contentDOM||!this.children.length)return!1;let b=this.children[a<0?0:this.children.length-1];return 0==b.size||b.emptyChildAt(a)}domAfterPos(a){let{node:b,offset:c}=this.domFromPos(a,0);if(1!=b.nodeType||c==b.childNodes.length)throw RangeError("No node after pos "+a);return b.childNodes[c]}setSelection(a,b,c,d=!1){let e=Math.min(a,b),f=Math.max(a,b);for(let g=0,h=0;g<this.children.length;g++){let i=this.children[g],j=h+i.size;if(e>h&&f<j)return i.setSelection(a-h-i.border,b-h-i.border,c,d);h=j}let h=this.domFromPos(a,a?-1:1),i=b==a?h:this.domFromPos(b,b?-1:1),j=c.root.getSelection(),k=c.domSelectionRange(),m=!1;if((A||E)&&a==b){let{node:a,offset:b}=h;if(3==a.nodeType){if((m=!!(b&&"\n"==a.nodeValue[b-1]))&&b==a.nodeValue.length)for(let b=a,c;b;b=b.parentNode){if(c=b.nextSibling){"BR"==c.nodeName&&(h=i={node:c.parentNode,offset:g(c)+1});break}let a=b.pmViewDesc;if(a&&a.node&&a.node.isBlock)break}}else{let c=a.childNodes[b-1];m=c&&("BR"==c.nodeName||"false"==c.contentEditable)}}if(A&&k.focusNode&&k.focusNode!=i.node&&1==k.focusNode.nodeType){let a=k.focusNode.childNodes[k.focusOffset];a&&"false"==a.contentEditable&&(d=!0)}if(!(d||m&&E)&&l(h.node,h.offset,k.anchorNode,k.anchorOffset)&&l(i.node,i.offset,k.focusNode,k.focusOffset))return;let n=!1;if((j.extend||a==b)&&!(m&&A)){j.collapse(h.node,h.offset);try{a!=b&&j.extend(i.node,i.offset),n=!0}catch(a){}}if(!n){if(a>b){let a=h;h=i,i=a}let c=document.createRange();c.setEnd(i.node,i.offset),c.setStart(h.node,h.offset),j.removeAllRanges(),j.addRange(c)}}ignoreMutation(a){return!this.contentDOM&&"selection"!=a.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(a,b){for(let c=0,d=0;d<this.children.length;d++){let e=this.children[d],f=c+e.size;if(c==f?a<=f&&b>=c:a<f&&b>c){let d=c+e.border,g=f-e.border;if(a>=d&&b<=g){this.dirty=a==c||b==f?2:1,a==d&&b==g&&(e.contentLost||e.dom.parentNode!=this.contentDOM)?e.dirty=3:e.markDirty(a-d,b-d);return}e.dirty=e.dom!=e.contentDOM||e.dom.parentNode!=this.contentDOM||e.children.length?3:2}c=f}this.dirty=2}markParentsDirty(){let a=1;for(let b=this.parent;b;b=b.parent,a++){let c=1==a?2:1;b.dirty<c&&(b.dirty=c)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(a){return!1}}class ac extends ab{constructor(a,b,c,d){let e,f=b.type.toDOM;if("function"==typeof f&&(f=f(c,()=>e?e.parent?e.parent.posBeforeChild(e):void 0:d)),!b.type.spec.raw){if(1!=f.nodeType){let a=document.createElement("span");a.appendChild(f),f=a}f.contentEditable="false",f.classList.add("ProseMirror-widget")}super(a,[],f,null),this.widget=b,this.widget=b,e=this}matchesWidget(a){return 0==this.dirty&&a.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(a){let b=this.widget.spec.stopEvent;return!!b&&b(a)}ignoreMutation(a){return"selection"!=a.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class ad extends ab{constructor(a,b,c,d){super(a,[],b,null),this.textDOM=c,this.text=d}get size(){return this.text.length}localPosFromDOM(a,b){return a!=this.textDOM?this.posAtStart+(b?this.size:0):this.posAtStart+b}domFromPos(a){return{node:this.textDOM,offset:a}}ignoreMutation(a){return"characterData"===a.type&&a.target.nodeValue==a.oldValue}}class ae extends ab{constructor(a,b,c,d,e){super(a,[],c,d),this.mark=b,this.spec=e}static create(a,b,c,d){let f=d.nodeViews[b.type.name],g=f&&f(b,d,c);return g&&g.dom||(g=e.ZF.renderSpec(document,b.type.spec.toDOM(b,c),null,b.attrs)),new ae(a,b,g.dom,g.contentDOM||g.dom,g)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(a){return 3!=this.dirty&&this.mark.eq(a)}markDirty(a,b){if(super.markDirty(a,b),0!=this.dirty){let a=this.parent;for(;!a.node;)a=a.parent;a.dirty<this.dirty&&(a.dirty=this.dirty),this.dirty=0}}slice(a,b,c){let d=ae.create(this.parent,this.mark,!0,c),e=this.children,f=this.size;b<f&&(e=at(e,b,f,c)),a>0&&(e=at(e,0,a,c));for(let a=0;a<e.length;a++)e[a].parent=d;return d.children=e,d}ignoreMutation(a){return this.spec.ignoreMutation?this.spec.ignoreMutation(a):super.ignoreMutation(a)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class af extends ab{constructor(a,b,c,d,e,f,g,h,i){super(a,[],e,f),this.node=b,this.outerDeco=c,this.innerDeco=d,this.nodeDOM=g}static create(a,b,c,d,f,g){let h=f.nodeViews[b.type.name],i,j=h&&h(b,f,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:g,c,d),k=j&&j.dom,l=j&&j.contentDOM;if(b.isText)if(k){if(3!=k.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else k=document.createTextNode(b.text);else if(!k){let a=e.ZF.renderSpec(document,b.type.spec.toDOM(b),null,b.attrs);({dom:k,contentDOM:l}=a)}l||b.isText||"BR"==k.nodeName||(k.hasAttribute("contenteditable")||(k.contentEditable="false"),b.type.spec.draggable&&(k.draggable=!0));let m=k;return(k=ao(k,c,b),j)?i=new aj(a,b,c,d,k,l||null,m,j,f,g+1):b.isText?new ah(a,b,c,d,k,m,f):new af(a,b,c,d,k,l||null,m,f,g+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let a={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(a.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let b=this.children.length-1;b>=0;b--){let c=this.children[b];if(this.dom.contains(c.dom.parentNode)){a.contentElement=c.dom.parentNode;break}}a.contentElement||(a.getContent=()=>e.FK.empty)}else a.contentElement=this.contentDOM;else a.getContent=()=>this.node.content;return a}matchesNode(a,b,c){return 0==this.dirty&&a.eq(this.node)&&ap(b,this.outerDeco)&&c.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(a,b){let c=this.node.inlineContent,d=b,f=a.composing?this.localCompositionInfo(a,b):null,g=f&&f.pos>-1?f:null,h=f&&f.pos<0,i=new ar(this,g&&g.node,a);(function(a,b,c,d){let e=b.locals(a),f=0;if(0==e.length){for(let c=0;c<a.childCount;c++){let g=a.child(c);d(g,e,b.forChild(f,g),c),f+=g.nodeSize}return}let g=0,h=[],i=null;for(let j=0;;){let k,l,m,n;for(;g<e.length&&e[g].to==f;){let a=e[g++];a.widget&&(k?(l||(l=[k])).push(a):k=a)}if(k)if(l){l.sort(as);for(let a=0;a<l.length;a++)c(l[a],j,!!i)}else c(k,j,!!i);if(i)n=-1,m=i,i=null;else if(j<a.childCount)n=j,m=a.child(j++);else break;for(let a=0;a<h.length;a++)h[a].to<=f&&h.splice(a--,1);for(;g<e.length&&e[g].from<=f&&e[g].to>f;)h.push(e[g++]);let o=f+m.nodeSize;if(m.isText){let a=o;g<e.length&&e[g].from<a&&(a=e[g].from);for(let b=0;b<h.length;b++)h[b].to<a&&(a=h[b].to);a<o&&(i=m.cut(a-f),m=m.cut(0,a-f),o=a,n=-1)}else for(;g<e.length&&e[g].to<o;)g++;let p=m.isInline&&!m.isLeaf?h.filter(a=>!a.inline):h.slice();d(m,p,b.forChild(f,m),n),f=o}})(this.node,this.innerDeco,(b,f,g)=>{b.spec.marks?i.syncToMarks(b.spec.marks,c,a,f):b.type.side>=0&&!g&&i.syncToMarks(f==this.node.childCount?e.CU.none:this.node.child(f).marks,c,a,f),i.placeWidget(b,a,d)},(b,e,g,j)=>{let k;i.syncToMarks(b.marks,c,a,j),i.findNodeMatch(b,e,g,j)||h&&a.state.selection.from>d&&a.state.selection.to<d+b.nodeSize&&(k=i.findIndexWithChild(f.node))>-1&&i.updateNodeAt(b,e,g,k,a)||i.updateNextNode(b,e,g,a,j,d)||i.addNode(b,e,g,a,d),d+=b.nodeSize}),i.syncToMarks([],c,a,0),this.node.isTextblock&&i.addTextblockHacks(),i.destroyRest(),(i.changed||2==this.dirty)&&(g&&this.protectLocalComposition(a,g),function a(b,c,d){let e=b.firstChild,f=!1;for(let g=0;g<c.length;g++){let h=c[g],i=h.dom;if(i.parentNode==b){for(;i!=e;)e=aq(e),f=!0;e=e.nextSibling}else f=!0,b.insertBefore(i,e);if(h instanceof ae){let c=e?e.previousSibling:b.lastChild;a(h.contentDOM,h.children,d),e=c?c.nextSibling:b.firstChild}}for(;e;)e=aq(e),f=!0;f&&d.trackWrites==b&&(d.trackWrites=null)}(this.contentDOM,this.children,a),F&&function(a){if("UL"==a.nodeName||"OL"==a.nodeName){let b=a.style.cssText;a.style.cssText=b+"; list-style: square !important",window.getComputedStyle(a).listStyle,a.style.cssText=b}}(this.dom))}localCompositionInfo(a,b){let{from:c,to:e}=a.state.selection;if(!(a.state.selection instanceof d.U3)||c<b||e>b+this.node.content.size)return null;let f=a.input.compositionNode;if(!f||!this.dom.contains(f.parentNode))return null;if(!this.node.inlineContent)return{node:f,pos:-1,text:""};{let a=f.nodeValue,d=function(a,b,c,d){for(let e=0,f=0;e<a.childCount&&f<=d;){let g=a.child(e++),h=f;if(f+=g.nodeSize,!g.isText)continue;let i=g.text;for(;e<a.childCount;){let b=a.child(e++);if(f+=b.nodeSize,!b.isText)break;i+=b.text}if(f>=c){if(f>=d&&i.slice(d-b.length-h,d-h)==b)return d-b.length;let a=h<d?i.lastIndexOf(b,d-h-1):-1;if(a>=0&&a+b.length+h>=c)return h+a;if(c==d&&i.length>=d+b.length-h&&i.slice(d-h,d-h+b.length)==b)return d}}return -1}(this.node.content,a,c-b,e-b);return d<0?null:{node:f,pos:d,text:a}}}protectLocalComposition(a,{node:b,pos:c,text:d}){if(this.getDesc(b))return;let e=b;for(;e.parentNode!=this.contentDOM;e=e.parentNode){for(;e.previousSibling;)e.parentNode.removeChild(e.previousSibling);for(;e.nextSibling;)e.parentNode.removeChild(e.nextSibling);e.pmViewDesc&&(e.pmViewDesc=void 0)}let f=new ad(this,e,b,d);a.input.compositionNodes.push(f),this.children=at(this.children,c,c+d.length,a,f)}update(a,b,c,d){return 3!=this.dirty&&!!a.sameMarkup(this.node)&&(this.updateInner(a,b,c,d),!0)}updateInner(a,b,c,d){this.updateOuterDeco(b),this.node=a,this.innerDeco=c,this.contentDOM&&this.updateChildren(d,this.posAtStart),this.dirty=0}updateOuterDeco(a){if(ap(a,this.outerDeco))return;let b=1!=this.nodeDOM.nodeType,c=this.dom;this.dom=an(this.dom,this.nodeDOM,am(this.outerDeco,this.node,b),am(a,this.node,b)),this.dom!=c&&(c.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=a}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ag(a,b,c,d,e){ao(d,b,a);let f=new af(void 0,a,b,c,d,d,d,e,0);return f.contentDOM&&f.updateChildren(e,0),f}class ah extends af{constructor(a,b,c,d,e,f,g){super(a,b,c,d,e,null,f,g,0)}parseRule(){let a=this.nodeDOM.parentNode;for(;a&&a!=this.dom&&!a.pmIsDeco;)a=a.parentNode;return{skip:a||!0}}update(a,b,c,d){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!a.sameMarkup(this.node)&&(this.updateOuterDeco(b),(0!=this.dirty||a.text!=this.node.text)&&a.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=a.text,d.trackWrites==this.nodeDOM&&(d.trackWrites=null)),this.node=a,this.dirty=0,!0)}inParent(){let a=this.parent.contentDOM;for(let b=this.nodeDOM;b;b=b.parentNode)if(b==a)return!0;return!1}domFromPos(a){return{node:this.nodeDOM,offset:a}}localPosFromDOM(a,b,c){return a==this.nodeDOM?this.posAtStart+Math.min(b,this.node.text.length):super.localPosFromDOM(a,b,c)}ignoreMutation(a){return"characterData"!=a.type&&"selection"!=a.type}slice(a,b,c){let d=this.node.cut(a,b),e=document.createTextNode(d.text);return new ah(this.parent,d,this.outerDeco,this.innerDeco,e,e,c)}markDirty(a,b){super.markDirty(a,b),this.dom!=this.nodeDOM&&(0==a||b==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(a){return this.node.text==a}}class ai extends ab{parseRule(){return{ignore:!0}}matchesHack(a){return 0==this.dirty&&this.dom.nodeName==a}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class aj extends af{constructor(a,b,c,d,e,f,g,h,i,j){super(a,b,c,d,e,f,g,i,j),this.spec=h}update(a,b,c,d){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==a.type||this.spec.multiType)){let e=this.spec.update(a,b,c);return e&&this.updateInner(a,b,c,d),e}return(!!this.contentDOM||!!a.isLeaf)&&super.update(a,b,c,d)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(a,b,c,d){this.spec.setSelection?this.spec.setSelection(a,b,c.root):super.setSelection(a,b,c,d)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(a){return!!this.spec.stopEvent&&this.spec.stopEvent(a)}ignoreMutation(a){return this.spec.ignoreMutation?this.spec.ignoreMutation(a):super.ignoreMutation(a)}}let ak=function(a){a&&(this.nodeName=a)};ak.prototype=Object.create(null);let al=[new ak];function am(a,b,c){if(0==a.length)return al;let d=c?al[0]:new ak,e=[d];for(let f=0;f<a.length;f++){let g=a[f].type.attrs;if(g)for(let a in g.nodeName&&e.push(d=new ak(g.nodeName)),g){let f=g[a];null!=f&&(c&&1==e.length&&e.push(d=new ak(b.isInline?"span":"div")),"class"==a?d.class=(d.class?d.class+" ":"")+f:"style"==a?d.style=(d.style?d.style+";":"")+f:"nodeName"!=a&&(d[a]=f))}}return e}function an(a,b,c,d){if(c==al&&d==al)return b;let e=b;for(let b=0;b<d.length;b++){let f=d[b],g=c[b];if(b){let b;g&&g.nodeName==f.nodeName&&e!=a&&(b=e.parentNode)&&b.nodeName.toLowerCase()==f.nodeName||((b=document.createElement(f.nodeName)).pmIsDeco=!0,b.appendChild(e),g=al[0]),e=b}!function(a,b,c){for(let d in b)"class"==d||"style"==d||"nodeName"==d||d in c||a.removeAttribute(d);for(let d in c)"class"!=d&&"style"!=d&&"nodeName"!=d&&c[d]!=b[d]&&a.setAttribute(d,c[d]);if(b.class!=c.class){let d=b.class?b.class.split(" ").filter(Boolean):[],e=c.class?c.class.split(" ").filter(Boolean):[];for(let b=0;b<d.length;b++)-1==e.indexOf(d[b])&&a.classList.remove(d[b]);for(let b=0;b<e.length;b++)-1==d.indexOf(e[b])&&a.classList.add(e[b]);0==a.classList.length&&a.removeAttribute("class")}if(b.style!=c.style){if(b.style){let c=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,d;for(;d=c.exec(b.style);)a.style.removeProperty(d[1])}c.style&&(a.style.cssText+=c.style)}}(e,g||al[0],f)}return e}function ao(a,b,c){return an(a,a,al,am(b,c,1!=a.nodeType))}function ap(a,b){if(a.length!=b.length)return!1;for(let c=0;c<a.length;c++)if(!a[c].type.eq(b[c].type))return!1;return!0}function aq(a){let b=a.nextSibling;return a.parentNode.removeChild(a),b}class ar{constructor(a,b,c){this.lock=b,this.view=c,this.index=0,this.stack=[],this.changed=!1,this.top=a,this.preMatch=function(a,b){let c=b,d=c.children.length,e=a.childCount,f=new Map,g=[];a:for(;e>0;){let h;for(;;)if(d){let a=c.children[d-1];if(a instanceof ae)c=a,d=a.children.length;else{h=a,d--;break}}else if(c==b)break a;else d=c.parent.children.indexOf(c),c=c.parent;let i=h.node;if(i){if(i!=a.child(e-1))break;--e,f.set(h,e),g.push(h)}}return{index:e,matched:f,matches:g.reverse()}}(a.node.content,a)}destroyBetween(a,b){if(a!=b){for(let c=a;c<b;c++)this.top.children[c].destroy();this.top.children.splice(a,b-a),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(a,b,c,d){let e=0,f=this.stack.length>>1,g=Math.min(f,a.length);for(;e<g&&(e==f-1?this.top:this.stack[e+1<<1]).matchesMark(a[e])&&!1!==a[e].type.spec.spanning;)e++;for(;e<f;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),f--;for(;f<a.length;){this.stack.push(this.top,this.index+1);let e=-1,g=this.top.children.length;d<this.preMatch.index&&(g=Math.min(this.index+3,g));for(let b=this.index;b<g;b++){let c=this.top.children[b];if(c.matchesMark(a[f])&&!this.isLocked(c.dom)){e=b;break}}if(e>-1)e>this.index&&(this.changed=!0,this.destroyBetween(this.index,e)),this.top=this.top.children[this.index];else{let d=ae.create(this.top,a[f],b,c);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,f++}}findNodeMatch(a,b,c,d){let e=-1,f;if(d>=this.preMatch.index&&(f=this.preMatch.matches[d-this.preMatch.index]).parent==this.top&&f.matchesNode(a,b,c))e=this.top.children.indexOf(f,this.index);else for(let d=this.index,f=Math.min(this.top.children.length,d+5);d<f;d++){let f=this.top.children[d];if(f.matchesNode(a,b,c)&&!this.preMatch.matched.has(f)){e=d;break}}return!(e<0)&&(this.destroyBetween(this.index,e),this.index++,!0)}updateNodeAt(a,b,c,d,e){let f=this.top.children[d];return 3==f.dirty&&f.dom==f.contentDOM&&(f.dirty=2),!!f.update(a,b,c,e)&&(this.destroyBetween(this.index,d),this.index++,!0)}findIndexWithChild(a){for(;;){let b=a.parentNode;if(!b)return -1;if(b==this.top.contentDOM){let b=a.pmViewDesc;if(b){for(let a=this.index;a<this.top.children.length;a++)if(this.top.children[a]==b)return a}return -1}a=b}}updateNextNode(a,b,c,d,e,f){for(let g=this.index;g<this.top.children.length;g++){let h=this.top.children[g];if(h instanceof af){let i=this.preMatch.matched.get(h);if(null!=i&&i!=e)return!1;let j=h.dom,k,l=this.isLocked(j)&&!(a.isText&&h.node&&h.node.isText&&h.nodeDOM.nodeValue==a.text&&3!=h.dirty&&ap(b,h.outerDeco));if(!l&&h.update(a,b,c,d))return this.destroyBetween(this.index,g),h.dom!=j&&(this.changed=!0),this.index++,!0;if(!l&&(k=this.recreateWrapper(h,a,b,c,d,f)))return this.destroyBetween(this.index,g),this.top.children[this.index]=k,k.contentDOM&&(k.dirty=2,k.updateChildren(d,f+1),k.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(a,b,c,d,e,f){if(a.dirty||b.isAtom||!a.children.length||!a.node.content.eq(b.content)||!ap(c,a.outerDeco)||!d.eq(a.innerDeco))return null;let g=af.create(this.top,b,c,d,e,f);if(g.contentDOM)for(let b of(g.children=a.children,a.children=[],g.children))b.parent=g;return a.destroy(),g}addNode(a,b,c,d,e){let f=af.create(this.top,a,b,c,d,e);f.contentDOM&&f.updateChildren(d,e+1),this.top.children.splice(this.index++,0,f),this.changed=!0}placeWidget(a,b,c){let d=this.index<this.top.children.length?this.top.children[this.index]:null;if(d&&d.matchesWidget(a)&&(a==d.widget||!d.widget.type.toDOM.parentNode))this.index++;else{let d=new ac(this.top,a,b,c);this.top.children.splice(this.index++,0,d),this.changed=!0}}addTextblockHacks(){let a=this.top.children[this.index-1],b=this.top;for(;a instanceof ae;)a=(b=a).children[b.children.length-1];(!a||!(a instanceof ah)||/\n$/.test(a.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(a.node.text))&&((E||C)&&a&&"false"==a.dom.contentEditable&&this.addHackNode("IMG",b),this.addHackNode("BR",this.top))}addHackNode(a,b){if(b==this.top&&this.index<b.children.length&&b.children[this.index].matchesHack(a))this.index++;else{let c=document.createElement(a);"IMG"==a&&(c.className="ProseMirror-separator",c.alt=""),"BR"==a&&(c.className="ProseMirror-trailingBreak");let d=new ai(this.top,[],c,null);b!=this.top?b.children.push(d):b.children.splice(this.index++,0,d),this.changed=!0}}isLocked(a){return this.lock&&(a==this.lock||1==a.nodeType&&a.contains(this.lock.parentNode))}}function as(a,b){return a.type.side-b.type.side}function at(a,b,c,d,e){let f=[];for(let g=0,h=0;g<a.length;g++){let i=a[g],j=h,k=h+=i.size;j>=c||k<=b?f.push(i):(j<b&&f.push(i.slice(0,b-j,d)),e&&(f.push(e),e=void 0),k>c&&f.push(i.slice(c-j,i.size,d)))}return f}function au(a,b=null){let c=a.domSelectionRange(),e=a.state.doc;if(!c.focusNode)return null;let f=a.docView.nearestDesc(c.focusNode),h=f&&0==f.size,i=a.docView.posFromDOM(c.focusNode,c.focusOffset,1);if(i<0)return null;let j=e.resolve(i),k,l;if(q(c)){for(k=i;f&&!f.node;)f=f.parent;let a=f.node;if(f&&a.isAtom&&d.nh.isSelectable(a)&&f.parent&&!(a.isInline&&function(a,b,c){for(let d=0==b,e=b==o(a);d||e;){if(a==c)return!0;let b=g(a);if(!(a=a.parentNode))return!1;d=d&&0==b,e=e&&b==o(a)}}(c.focusNode,c.focusOffset,f.dom))){let a=f.posBefore;l=new d.nh(i==a?j:e.resolve(a))}}else{if(c instanceof a.dom.ownerDocument.defaultView.Selection&&c.rangeCount>1){let b=i,d=i;for(let e=0;e<c.rangeCount;e++){let f=c.getRangeAt(e);b=Math.min(b,a.docView.posFromDOM(f.startContainer,f.startOffset,1)),d=Math.max(d,a.docView.posFromDOM(f.endContainer,f.endOffset,-1))}if(b<0)return null;[k,i]=d==a.state.selection.anchor?[d,b]:[b,d],j=e.resolve(i)}else k=a.docView.posFromDOM(c.anchorNode,c.anchorOffset,1);if(k<0)return null}let m=e.resolve(k);if(!l){let c="pointer"==b||a.state.selection.head<j.pos&&!h?1:-1;l=aD(a,m,j,c)}return l}function av(a){return a.editable?a.hasFocus():aF(a)&&document.activeElement&&document.activeElement.contains(a.dom)}function aw(a,b=!1){let c=a.state.selection;if(aB(a,c),av(a)){if(!b&&a.input.mouseDown&&a.input.mouseDown.allowDefault&&C){let b=a.domSelectionRange(),c=a.domObserver.currentSelection;if(b.anchorNode&&c.anchorNode&&l(b.anchorNode,b.anchorOffset,c.anchorNode,c.anchorOffset)){a.input.mouseDown.delayedSelectionSync=!0,a.domObserver.setCurSelection();return}}if(a.domObserver.disconnectSelection(),a.cursorWrapper)!function(a){let b=a.domSelection();if(!b)return;let c=a.cursorWrapper.dom,d="IMG"==c.nodeName;d?b.collapse(c.parentNode,g(c)+1):b.collapse(c,0),!d&&!a.state.selection.visible&&y&&z<=11&&(c.disabled=!0,c.disabled=!1)}(a);else{var e;let f,g,h,i,{anchor:j,head:k}=c,l,m;ax&&!(c instanceof d.U3)&&(c.$from.parent.inlineContent||(l=ay(a,c.from)),c.empty||c.$from.parent.inlineContent||(m=ay(a,c.to))),a.docView.setSelection(j,k,a,b),ax&&(l&&aA(l),m&&aA(m)),c.visible?a.dom.classList.remove("ProseMirror-hideselection"):(a.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((f=(e=a).dom.ownerDocument).removeEventListener("selectionchange",e.input.hideSelectionGuard),h=(g=e.domSelectionRange()).anchorNode,i=g.anchorOffset,f.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(g.anchorNode!=h||g.anchorOffset!=i)&&(f.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!av(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})))}a.domObserver.setCurSelection(),a.domObserver.connectSelection()}}let ax=E||C&&D<63;function ay(a,b){let{node:c,offset:d}=a.docView.domFromPos(b,0),e=d<c.childNodes.length?c.childNodes[d]:null,f=d?c.childNodes[d-1]:null;if(E&&e&&"false"==e.contentEditable)return az(e);if((!e||"false"==e.contentEditable)&&(!f||"false"==f.contentEditable)){if(e)return az(e);else if(f)return az(f)}}function az(a){return a.contentEditable="true",E&&a.draggable&&(a.draggable=!1,a.wasDraggable=!0),a}function aA(a){a.contentEditable="false",a.wasDraggable&&(a.draggable=!0,a.wasDraggable=null)}function aB(a,b){if(b instanceof d.nh){let c=a.docView.descAt(b.from);c!=a.lastSelectedViewDesc&&(aC(a),c&&c.selectNode(),a.lastSelectedViewDesc=c)}else aC(a)}function aC(a){a.lastSelectedViewDesc&&(a.lastSelectedViewDesc.parent&&a.lastSelectedViewDesc.deselectNode(),a.lastSelectedViewDesc=void 0)}function aD(a,b,c,e){return a.someProp("createSelectionBetween",d=>d(a,b,c))||d.U3.between(b,c,e)}function aE(a){return(!a.editable||!!a.hasFocus())&&aF(a)}function aF(a){let b=a.domSelectionRange();if(!b.anchorNode)return!1;try{return a.dom.contains(3==b.anchorNode.nodeType?b.anchorNode.parentNode:b.anchorNode)&&(a.editable||a.dom.contains(3==b.focusNode.nodeType?b.focusNode.parentNode:b.focusNode))}catch(a){return!1}}function aG(a,b){let{$anchor:c,$head:e}=a.selection,f=b>0?c.max(e):c.min(e),g=f.parent.inlineContent?f.depth?a.doc.resolve(b>0?f.after():f.before()):null:f;return g&&d.LN.findFrom(g,b)}function aH(a,b){return a.dispatch(a.state.tr.setSelection(b).scrollIntoView()),!0}function aI(a,b,c){let e=a.state.selection;if(e instanceof d.U3){if(c.indexOf("s")>-1){let{$head:c}=e,f=c.textOffset?null:b<0?c.nodeBefore:c.nodeAfter;if(!f||f.isText||!f.isLeaf)return!1;let g=a.state.doc.resolve(c.pos+f.nodeSize*(b<0?-1:1));return aH(a,new d.U3(e.$anchor,g))}else if(!e.empty)return!1;else if(a.endOfTextblock(b>0?"forward":"backward")){let c=aG(a.state,b);return!!c&&c instanceof d.nh&&aH(a,c)}else if(!(G&&c.indexOf("m")>-1)){let c=e.$head,f=c.textOffset?null:b<0?c.nodeBefore:c.nodeAfter,g;if(!f||f.isText)return!1;let h=b<0?c.pos-f.nodeSize:c.pos;return!!(f.isAtom||(g=a.docView.descAt(h))&&!g.contentDOM)&&(d.nh.isSelectable(f)?aH(a,new d.nh(b<0?a.state.doc.resolve(c.pos-f.nodeSize):c)):!!J&&aH(a,new d.U3(a.state.doc.resolve(b<0?h:h+f.nodeSize))))}}else{if(e instanceof d.nh&&e.node.isInline)return aH(a,new d.U3(b>0?e.$to:e.$from));let c=aG(a.state,b);return!!c&&aH(a,c)}}function aJ(a){return 3==a.nodeType?a.nodeValue.length:a.childNodes.length}function aK(a,b){let c=a.pmViewDesc;return c&&0==c.size&&(b<0||a.nextSibling||"BR"!=a.nodeName)}function aL(a,b){return b<0?function(a){let b=a.domSelectionRange(),c=b.focusNode,d=b.focusOffset;if(!c)return;let e,f,h=!1;for(A&&1==c.nodeType&&d<aJ(c)&&aK(c.childNodes[d],-1)&&(h=!0);;)if(d>0)if(1!=c.nodeType)break;else{let a=c.childNodes[d-1];if(aK(a,-1))e=c,f=--d;else if(3==a.nodeType)d=(c=a).nodeValue.length;else break}else if(aM(c))break;else{let b=c.previousSibling;for(;b&&aK(b,-1);)e=c.parentNode,f=g(b),b=b.previousSibling;if(b)d=aJ(c=b);else{if((c=c.parentNode)==a.dom)break;d=0}}h?aN(a,c,d):e&&aN(a,e,f)}(a):function(a){let b,c,d=a.domSelectionRange(),e=d.focusNode,f=d.focusOffset;if(!e)return;let h=aJ(e);for(;;)if(f<h){if(1!=e.nodeType)break;if(aK(e.childNodes[f],1))b=e,c=++f;else break}else if(aM(e))break;else{let d=e.nextSibling;for(;d&&aK(d,1);)b=d.parentNode,c=g(d)+1,d=d.nextSibling;if(d)f=0,h=aJ(e=d);else{if((e=e.parentNode)==a.dom)break;f=h=0}}b&&aN(a,b,c)}(a)}function aM(a){let b=a.pmViewDesc;return b&&b.node&&b.node.isBlock}function aN(a,b,c){if(3!=b.nodeType){let a,d;(d=function(a,b){for(;a&&b==a.childNodes.length&&!p(a);)b=g(a)+1,a=a.parentNode;for(;a&&b<a.childNodes.length;){let c=a.childNodes[b];if(3==c.nodeType)return c;if(1==c.nodeType&&"false"==c.contentEditable)break;a=c,b=0}}(b,c))?(b=d,c=0):(a=function(a,b){for(;a&&!b&&!p(a);)b=g(a),a=a.parentNode;for(;a&&b;){let c=a.childNodes[b-1];if(3==c.nodeType)return c;if(1==c.nodeType&&"false"==c.contentEditable)break;b=(a=c).childNodes.length}}(b,c))&&(b=a,c=a.nodeValue.length)}let d=a.domSelection();if(!d)return;if(q(d)){let a=document.createRange();a.setEnd(b,c),a.setStart(b,c),d.removeAllRanges(),d.addRange(a)}else d.extend&&d.extend(b,c);a.domObserver.setCurSelection();let{state:e}=a;setTimeout(()=>{a.state==e&&aw(a)},50)}function aO(a,b){let c=a.state.doc.resolve(b);if(!(C||H)&&c.parent.inlineContent){let d=a.coordsAtPos(b);if(b>c.start()){let c=a.coordsAtPos(b-1),e=(c.top+c.bottom)/2;if(e>d.top&&e<d.bottom&&Math.abs(c.left-d.left)>1)return c.left<d.left?"ltr":"rtl"}if(b<c.end()){let c=a.coordsAtPos(b+1),e=(c.top+c.bottom)/2;if(e>d.top&&e<d.bottom&&Math.abs(c.left-d.left)>1)return c.left>d.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(a.dom).direction?"rtl":"ltr"}function aP(a,b,c){let e=a.state.selection;if(e instanceof d.U3&&!e.empty||c.indexOf("s")>-1||G&&c.indexOf("m")>-1)return!1;let{$from:f,$to:g}=e;if(!f.parent.inlineContent||a.endOfTextblock(b<0?"up":"down")){let c=aG(a.state,b);if(c&&c instanceof d.nh)return aH(a,c)}if(!f.parent.inlineContent){let c=b<0?f:g,h=e instanceof d.i5?d.LN.near(c,b):d.LN.findFrom(c,b);return!!h&&aH(a,h)}return!1}function aQ(a,b){if(!(a.state.selection instanceof d.U3))return!0;let{$head:c,$anchor:e,empty:f}=a.state.selection;if(!c.sameParent(e))return!0;if(!f)return!1;if(a.endOfTextblock(b>0?"forward":"backward"))return!0;let g=!c.textOffset&&(b<0?c.nodeBefore:c.nodeAfter);if(g&&!g.isText){let d=a.state.tr;return b<0?d.delete(c.pos-g.nodeSize,c.pos):d.delete(c.pos,c.pos+g.nodeSize),a.dispatch(d),!0}return!1}function aR(a,b,c){a.domObserver.stop(),b.contentEditable=c,a.domObserver.start()}function aS(a,b){a.someProp("transformCopied",c=>{b=c(b,a)});let c=[],{content:d,openStart:f,openEnd:g}=b;for(;f>1&&g>1&&1==d.childCount&&1==d.firstChild.childCount;){f--,g--;let a=d.firstChild;c.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),d=a.content}let h=a.someProp("clipboardSerializer")||e.ZF.fromSchema(a.state.schema),i=a$(),j=i.createElement("div");j.appendChild(h.serializeFragment(d,{document:i}));let k=j.firstChild,l,m=0;for(;k&&1==k.nodeType&&(l=aY[k.nodeName.toLowerCase()]);){for(let a=l.length-1;a>=0;a--){let b=i.createElement(l[a]);for(;j.firstChild;)b.appendChild(j.firstChild);j.appendChild(b),m++}k=j.firstChild}return k&&1==k.nodeType&&k.setAttribute("data-pm-slice",`${f} ${g}${m?` -${m}`:""} ${JSON.stringify(c)}`),{dom:j,text:a.someProp("clipboardTextSerializer",c=>c(b,a))||b.content.textBetween(0,b.content.size,"\n\n"),slice:b}}function aT(a,b,c,d,f){let g,h,i=f.parent.type.spec.code;if(!c&&!b)return null;let j=!!b&&(d||i||!c);if(j){if(a.someProp("transformPastedText",c=>{b=c(b,i||d,a)}),i)return h=new e.Ji(e.FK.from(a.state.schema.text(b.replace(/\r\n?/g,"\n"))),0,0),a.someProp("transformPasted",b=>{h=b(h,a,!0)}),h;let c=a.someProp("clipboardTextParser",c=>c(b,f,d,a));if(c)h=c;else{let c=f.marks(),{schema:d}=a.state,h=e.ZF.fromSchema(d);g=document.createElement("div"),b.split(/(?:\r\n?|\n)+/).forEach(a=>{let b=g.appendChild(document.createElement("p"));a&&b.appendChild(h.serializeNode(d.text(a,c)))})}}else a.someProp("transformPastedHTML",b=>{c=b(c,a)}),g=function(a){var b;let c,d=/^(\s*<meta [^>]*>)*/.exec(a);d&&(a=a.slice(d[0].length));let e=a$().createElement("div"),f=/<([a-z][^>\s]+)/i.exec(a),g;if((g=f&&aY[f[1].toLowerCase()])&&(a=g.map(a=>"<"+a+">").join("")+a+g.map(a=>"</"+a+">").reverse().join("")),e.innerHTML=(b=a,(c=window.trustedTypes)?(a_||(a_=c.defaultPolicy||c.createPolicy("ProseMirrorClipboard",{createHTML:a=>a})),a_.createHTML(b)):b),g)for(let a=0;a<g.length;a++)e=e.querySelector(g[a])||e;return e}(c),J&&function(a){let b=a.querySelectorAll(C?"span:not([class]):not([style])":"span.Apple-converted-space");for(let c=0;c<b.length;c++){let d=b[c];1==d.childNodes.length&&"\xa0"==d.textContent&&d.parentNode&&d.parentNode.replaceChild(a.ownerDocument.createTextNode(" "),d)}}(g);let k=g&&g.querySelector("[data-pm-slice]"),l=k&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(k.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let a=+l[3];a>0;a--){let a=g.firstChild;for(;a&&1!=a.nodeType;)a=a.nextSibling;if(!a)break;g=a}if(h||(h=(a.someProp("clipboardParser")||a.someProp("domParser")||e.S4.fromSchema(a.state.schema)).parseSlice(g,{preserveWhitespace:!!(j||l),context:f,ruleFromNode:a=>"BR"!=a.nodeName||a.nextSibling||!a.parentNode||aU.test(a.parentNode.nodeName)?null:{ignore:!0}})),l)h=function(a,b){if(!a.size)return a;let c=a.content.firstChild.type.schema,d;try{d=JSON.parse(b)}catch(b){return a}let{content:f,openStart:g,openEnd:h}=a;for(let a=d.length-2;a>=0;a-=2){let b=c.nodes[d[a]];if(!b||b.hasRequiredAttrs())break;f=e.FK.from(b.create(d[a+1],f)),g++,h++}return new e.Ji(f,g,h)}(aX(h,+l[1],+l[2]),l[4]);else if((h=e.Ji.maxOpen(function(a,b){if(a.childCount<2)return a;for(let c=b.depth;c>=0;c--){let d=b.node(c).contentMatchAt(b.index(c)),f,g=[];if(a.forEach(a=>{if(!g)return;let b=d.findWrapping(a.type),c;if(!b)return g=null;if(c=g.length&&f.length&&function a(b,c,d,f,g){if(g<b.length&&g<c.length&&b[g]==c[g]){let h=a(b,c,d,f.lastChild,g+1);if(h)return f.copy(f.content.replaceChild(f.childCount-1,h));if(f.contentMatchAt(f.childCount).matchType(g==b.length-1?d.type:b[g+1]))return f.copy(f.content.append(e.FK.from(aV(d,b,g+1))))}}(b,f,a,g[g.length-1],0))g[g.length-1]=c;else{g.length&&(g[g.length-1]=function a(b,c){if(0==c)return b;let d=b.content.replaceChild(b.childCount-1,a(b.lastChild,c-1)),f=b.contentMatchAt(b.childCount).fillBefore(e.FK.empty,!0);return b.copy(d.append(f))}(g[g.length-1],f.length));let c=aV(a,b);g.push(c),d=d.matchType(c.type),f=b}}),g)return e.FK.from(g)}return a}(h.content,f),!0)).openStart||h.openEnd){let a=0,b=0;for(let b=h.content.firstChild;a<h.openStart&&!b.type.spec.isolating;a++,b=b.firstChild);for(let a=h.content.lastChild;b<h.openEnd&&!a.type.spec.isolating;b++,a=a.lastChild);h=aX(h,a,b)}return a.someProp("transformPasted",b=>{h=b(h,a,j)}),h}let aU=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function aV(a,b,c=0){for(let d=b.length-1;d>=c;d--)a=b[d].create(null,e.FK.from(a));return a}function aW(a,b,c,d,f,g){let h=b<0?a.firstChild:a.lastChild,i=h.content;return a.childCount>1&&(g=0),f<d-1&&(i=aW(i,b,c,d,f+1,g)),f>=c&&(i=b<0?h.contentMatchAt(0).fillBefore(i,g<=f).append(i):i.append(h.contentMatchAt(h.childCount).fillBefore(e.FK.empty,!0))),a.replaceChild(b<0?0:a.childCount-1,h.copy(i))}function aX(a,b,c){return b<a.openStart&&(a=new e.Ji(aW(a.content,-1,b,a.openStart,0,a.openEnd),b,a.openEnd)),c<a.openEnd&&(a=new e.Ji(aW(a.content,1,c,a.openEnd,0,0),a.openStart,c)),a}let aY={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},aZ=null;function a$(){return aZ||(aZ=document.implementation.createHTMLDocument("title"))}let a_=null,a0={},a1={},a2={touchstart:!0,touchmove:!0};class a3{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function a4(a,b){a.input.lastSelectionOrigin=b,a.input.lastSelectionTime=Date.now()}function a5(a){a.someProp("handleDOMEvents",b=>{for(let c in b)a.input.eventHandlers[c]||a.dom.addEventListener(c,a.input.eventHandlers[c]=b=>a6(a,b))})}function a6(a,b){return a.someProp("handleDOMEvents",c=>{let d=c[b.type];return!!d&&(d(a,b)||b.defaultPrevented)})}function a7(a){return{left:a.clientX,top:a.clientY}}function a8(a,b,c,d,e){if(-1==d)return!1;let f=a.state.doc.resolve(d);for(let d=f.depth+1;d>0;d--)if(a.someProp(b,b=>d>f.depth?b(a,c,f.nodeAfter,f.before(d),e,!0):b(a,c,f.node(d),f.before(d),e,!1)))return!0;return!1}function a9(a,b,c){if(a.focused||a.focus(),a.state.selection.eq(b))return;let d=a.state.tr.setSelection(b);"pointer"==c&&d.setMeta("pointer",!0),a.dispatch(d)}a1.keydown=(a,b)=>{if((a.input.shiftKey=16==b.keyCode||b.shiftKey,!bc(a,b))&&(a.input.lastKeyCode=b.keyCode,a.input.lastKeyCodeTime=Date.now(),!I||!C||13!=b.keyCode))if(229!=b.keyCode&&a.domObserver.forceFlush(),!F||13!=b.keyCode||b.ctrlKey||b.altKey||b.metaKey)a.someProp("handleKeyDown",c=>c(a,b))||function(a,b){let c,d=b.keyCode,e=(c="",b.ctrlKey&&(c+="c"),b.metaKey&&(c+="m"),b.altKey&&(c+="a"),b.shiftKey&&(c+="s"),c);if(8==d||G&&72==d&&"c"==e)return aQ(a,-1)||aL(a,-1);if(46==d&&!b.shiftKey||G&&68==d&&"c"==e)return aQ(a,1)||aL(a,1);if(13==d||27==d)return!0;if(37==d||G&&66==d&&"c"==e){let b=37==d?"ltr"==aO(a,a.state.selection.from)?-1:1:-1;return aI(a,b,e)||aL(a,b)}if(39==d||G&&70==d&&"c"==e){let b=39==d?"ltr"==aO(a,a.state.selection.from)?1:-1:1;return aI(a,b,e)||aL(a,b)}else if(38==d||G&&80==d&&"c"==e)return aP(a,-1,e)||aL(a,-1);else if(40==d||G&&78==d&&"c"==e)return function(a){if(!E||a.state.selection.$head.parentOffset>0)return!1;let{focusNode:b,focusOffset:c}=a.domSelectionRange();if(b&&1==b.nodeType&&0==c&&b.firstChild&&"false"==b.firstChild.contentEditable){let c=b.firstChild;aR(a,c,"true"),setTimeout(()=>aR(a,c,"false"),20)}return!1}(a)||aP(a,1,e)||aL(a,1);else if(e==(G?"m":"c")&&(66==d||73==d||89==d||90==d))return!0;return!1}(a,b)?b.preventDefault():a4(a,"key");else{let b=Date.now();a.input.lastIOSEnter=b,a.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{a.input.lastIOSEnter==b&&(a.someProp("handleKeyDown",b=>b(a,r(13,"Enter"))),a.input.lastIOSEnter=0)},200)}},a1.keyup=(a,b)=>{16==b.keyCode&&(a.input.shiftKey=!1)},a1.keypress=(a,b)=>{if(bc(a,b)||!b.charCode||b.ctrlKey&&!b.altKey||G&&b.metaKey)return;if(a.someProp("handleKeyPress",c=>c(a,b)))return void b.preventDefault();let c=a.state.selection;if(!(c instanceof d.U3)||!c.$from.sameParent(c.$to)){let d=String.fromCharCode(b.charCode),e=()=>a.state.tr.insertText(d).scrollIntoView();/[\r\n]/.test(d)||a.someProp("handleTextInput",b=>b(a,c.$from.pos,c.$to.pos,d,e))||a.dispatch(e()),b.preventDefault()}};let ba=G?"metaKey":"ctrlKey";a0.mousedown=(a,b)=>{a.input.shiftKey=b.shiftKey;let c=bg(a),e=Date.now(),f="singleClick";e-a.input.lastClick.time<500&&function(a,b){let c=b.x-a.clientX,d=b.y-a.clientY;return c*c+d*d<100}(b,a.input.lastClick)&&!b[ba]&&a.input.lastClick.button==b.button&&("singleClick"==a.input.lastClick.type?f="doubleClick":"doubleClick"==a.input.lastClick.type&&(f="tripleClick")),a.input.lastClick={time:e,x:b.clientX,y:b.clientY,type:f,button:b.button};let g=a.posAtCoords(a7(b));g&&("singleClick"==f?(a.input.mouseDown&&a.input.mouseDown.done(),a.input.mouseDown=new bb(a,g,b,!!c)):("doubleClick"==f?function(a,b,c,d){return a8(a,"handleDoubleClickOn",b,c,d)||a.someProp("handleDoubleClick",c=>c(a,b,d))}:function(a,b,c,e){return a8(a,"handleTripleClickOn",b,c,e)||a.someProp("handleTripleClick",c=>c(a,b,e))||function(a,b,c){if(0!=c.button)return!1;let e=a.state.doc;if(-1==b)return!!e.inlineContent&&(a9(a,d.U3.create(e,0,e.content.size),"pointer"),!0);let f=e.resolve(b);for(let b=f.depth+1;b>0;b--){let c=b>f.depth?f.nodeAfter:f.node(b),g=f.before(b);if(c.inlineContent)a9(a,d.U3.create(e,g+1,g+1+c.content.size),"pointer");else{if(!d.nh.isSelectable(c))continue;a9(a,d.nh.create(e,g),"pointer")}return!0}}(a,c,e)})(a,g.pos,g.inside,b)?b.preventDefault():a4(a,"pointer"))};class bb{constructor(a,b,c,e){let f,g;if(this.view=a,this.pos=b,this.event=c,this.flushed=e,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=a.state.doc,this.selectNode=!!c[ba],this.allowDefault=c.shiftKey,b.inside>-1)f=a.state.doc.nodeAt(b.inside),g=b.inside;else{let c=a.state.doc.resolve(b.pos);f=c.parent,g=c.depth?c.before():0}let h=e?null:c.target,i=h?a.docView.nearestDesc(h,!0):null;this.target=i&&1==i.nodeDOM.nodeType?i.nodeDOM:null;let{selection:j}=a.state;(0==c.button&&f.type.spec.draggable&&!1!==f.type.spec.selectable||j instanceof d.nh&&j.from<=g&&j.to>g)&&(this.mightDrag={node:f,pos:g,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&A&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),a.root.addEventListener("mouseup",this.up=this.up.bind(this)),a.root.addEventListener("mousemove",this.move=this.move.bind(this)),a4(a,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>aw(this.view)),this.view.input.mouseDown=null}up(a){if(this.done(),!this.view.dom.contains(a.target))return;let b=this.pos;if(this.view.state.doc!=this.startDoc&&(b=this.view.posAtCoords(a7(a))),this.updateAllowDefault(a),this.allowDefault||!b)a4(this.view,"pointer");else{var c,e,f,g;(c=this.view,e=b.pos,f=b.inside,g=this.selectNode,a8(c,"handleClickOn",e,f,a)||c.someProp("handleClick",b=>b(c,e,a))||(g?function(a,b){if(-1==b)return!1;let c=a.state.selection,e,f;c instanceof d.nh&&(e=c.node);let g=a.state.doc.resolve(b);for(let a=g.depth+1;a>0;a--){let b=a>g.depth?g.nodeAfter:g.node(a);if(d.nh.isSelectable(b)){f=e&&c.$from.depth>0&&a>=c.$from.depth&&g.before(c.$from.depth+1)==c.$from.pos?g.before(c.$from.depth):g.before(a);break}}return null!=f&&(a9(a,d.nh.create(a.state.doc,f),"pointer"),!0)}(c,f):function(a,b){if(-1==b)return!1;let c=a.state.doc.resolve(b),e=c.nodeAfter;return!!(e&&e.isAtom&&d.nh.isSelectable(e))&&(a9(a,new d.nh(c),"pointer"),!0)}(c,f)))?a.preventDefault():0==a.button&&(this.flushed||E&&this.mightDrag&&!this.mightDrag.node.isAtom||C&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(b.pos-this.view.state.selection.from),Math.abs(b.pos-this.view.state.selection.to)))?(a9(this.view,d.LN.near(this.view.state.doc.resolve(b.pos)),"pointer"),a.preventDefault()):a4(this.view,"pointer")}}move(a){this.updateAllowDefault(a),a4(this.view,"pointer"),0==a.buttons&&this.done()}updateAllowDefault(a){!this.allowDefault&&(Math.abs(this.event.x-a.clientX)>4||Math.abs(this.event.y-a.clientY)>4)&&(this.allowDefault=!0)}}function bc(a,b){return!!a.composing||!!(E&&500>Math.abs(b.timeStamp-a.input.compositionEndedAt))&&(a.input.compositionEndedAt=-2e8,!0)}a0.touchstart=a=>{a.input.lastTouch=Date.now(),bg(a),a4(a,"pointer")},a0.touchmove=a=>{a.input.lastTouch=Date.now(),a4(a,"pointer")},a0.contextmenu=a=>bg(a);let bd=I?5e3:-1;function be(a,b){clearTimeout(a.input.composingTimeout),b>-1&&(a.input.composingTimeout=setTimeout(()=>bg(a),b))}function bf(a){let b;for(a.composing&&(a.input.composing=!1,a.input.compositionEndedAt=((b=document.createEvent("Event")).initEvent("event",!0,!0),b.timeStamp));a.input.compositionNodes.length>0;)a.input.compositionNodes.pop().markParentsDirty()}function bg(a,b=!1){if(!I||!(a.domObserver.flushingSoon>=0)){if(a.domObserver.forceFlush(),bf(a),b||a.docView&&a.docView.dirty){let c=au(a),d=a.state.selection;return c&&!c.eq(d)?a.dispatch(a.state.tr.setSelection(c)):(a.markCursor||b)&&!d.$from.node(d.$from.sharedDepth(d.to)).inlineContent?a.dispatch(a.state.tr.deleteSelection()):a.updateState(a.state),!0}return!1}}a1.compositionstart=a1.compositionupdate=a=>{if(!a.composing){a.domObserver.flush();let{state:b}=a,c=b.selection.$to;if(b.selection instanceof d.U3&&(b.storedMarks||!c.textOffset&&c.parentOffset&&c.nodeBefore.marks.some(a=>!1===a.type.spec.inclusive)||C&&H&&function(a){let{focusNode:b,focusOffset:c}=a.domSelectionRange();if(!b||1!=b.nodeType||c>=b.childNodes.length)return!1;let d=b.childNodes[c];return 1==d.nodeType&&"false"==d.contentEditable}(a)))a.markCursor=a.state.storedMarks||c.marks(),bg(a,!0),a.markCursor=null;else if(bg(a,!b.selection.empty),A&&b.selection.empty&&c.parentOffset&&!c.textOffset&&c.nodeBefore.marks.length){let b=a.domSelectionRange();for(let c=b.focusNode,d=b.focusOffset;c&&1==c.nodeType&&0!=d;){let b=d<0?c.lastChild:c.childNodes[d-1];if(!b)break;if(3==b.nodeType){let c=a.domSelection();c&&c.collapse(b,b.nodeValue.length);break}c=b,d=-1}}a.input.composing=!0}be(a,bd)},a1.compositionend=(a,b)=>{a.composing&&(a.input.composing=!1,a.input.compositionEndedAt=b.timeStamp,a.input.compositionPendingChanges=a.domObserver.pendingRecords().length?a.input.compositionID:0,a.input.compositionNode=null,a.input.badSafariComposition?a.domObserver.forceFlush():a.input.compositionPendingChanges&&Promise.resolve().then(()=>a.domObserver.flush()),a.input.compositionID++,be(a,20))};let bh=y&&z<15||F&&K<604;function bi(a,b,c,d,f){let g=aT(a,b,c,d,a.state.selection.$from);if(a.someProp("handlePaste",b=>b(a,f,g||e.Ji.empty)))return!0;if(!g)return!1;let h=0==g.openStart&&0==g.openEnd&&1==g.content.childCount?g.content.firstChild:null,i=h?a.state.tr.replaceSelectionWith(h,d):a.state.tr.replaceSelection(g);return a.dispatch(i.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function bj(a){let b=a.getData("text/plain")||a.getData("Text");if(b)return b;let c=a.getData("text/uri-list");return c?c.replace(/\r?\n/g," "):""}a0.copy=a1.cut=(a,b)=>{let c=a.state.selection,d="cut"==b.type;if(c.empty)return;let e=bh?null:b.clipboardData,{dom:f,text:g}=aS(a,c.content());e?(b.preventDefault(),e.clearData(),e.setData("text/html",f.innerHTML),e.setData("text/plain",g)):function(a,b){if(!a.dom.parentNode)return;let c=a.dom.parentNode.appendChild(document.createElement("div"));c.appendChild(b),c.style.cssText="position: fixed; left: -10000px; top: 10px";let d=getSelection(),e=document.createRange();e.selectNodeContents(b),a.dom.blur(),d.removeAllRanges(),d.addRange(e),setTimeout(()=>{c.parentNode&&c.parentNode.removeChild(c),a.focus()},50)}(a,f),d&&a.dispatch(a.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},a1.paste=(a,b)=>{if(a.composing&&!I)return;let c=bh?null:b.clipboardData,d=a.input.shiftKey&&45!=a.input.lastKeyCode;c&&bi(a,bj(c),c.getData("text/html"),d,b)?b.preventDefault():function(a,b){if(!a.dom.parentNode)return;let c=a.input.shiftKey||a.state.selection.$from.parent.type.spec.code,d=a.dom.parentNode.appendChild(document.createElement(c?"textarea":"div"));c||(d.contentEditable="true"),d.style.cssText="position: fixed; left: -10000px; top: 10px",d.focus();let e=a.input.shiftKey&&45!=a.input.lastKeyCode;setTimeout(()=>{a.focus(),d.parentNode&&d.parentNode.removeChild(d),c?bi(a,d.value,null,e,b):bi(a,d.textContent,d.innerHTML,e,b)},50)}(a,b)};class bk{constructor(a,b,c){this.slice=a,this.move=b,this.node=c}}let bl=G?"altKey":"ctrlKey";function bm(a,b){let c=a.someProp("dragCopies",a=>!a(b));return null!=c?c:!b[bl]}for(let a in a0.dragstart=(a,b)=>{let c,e=a.input.mouseDown;if(e&&e.done(),!b.dataTransfer)return;let f=a.state.selection,g=f.empty?null:a.posAtCoords(a7(b));if(g&&g.pos>=f.from&&g.pos<=(f instanceof d.nh?f.to-1:f.to));else if(e&&e.mightDrag)c=d.nh.create(a.state.doc,e.mightDrag.pos);else if(b.target&&1==b.target.nodeType){let e=a.docView.nearestDesc(b.target,!0);e&&e.node.type.spec.draggable&&e!=a.docView&&(c=d.nh.create(a.state.doc,e.posBefore))}let h=(c||a.state.selection).content(),{dom:i,text:j,slice:k}=aS(a,h);b.dataTransfer.files.length&&C&&!(D>120)||b.dataTransfer.clearData(),b.dataTransfer.setData(bh?"Text":"text/html",i.innerHTML),b.dataTransfer.effectAllowed="copyMove",bh||b.dataTransfer.setData("text/plain",j),a.dragging=new bk(k,bm(a,b),c)},a0.dragend=a=>{let b=a.dragging;window.setTimeout(()=>{a.dragging==b&&(a.dragging=null)},50)},a1.dragover=a1.dragenter=(a,b)=>b.preventDefault(),a1.drop=(a,b)=>{try{!function(a,b,c){if(!b.dataTransfer)return;let g=a.posAtCoords(a7(b));if(!g)return;let h=a.state.doc.resolve(g.pos),i=c&&c.slice;i?a.someProp("transformPasted",b=>{i=b(i,a,!1)}):i=aT(a,bj(b.dataTransfer),bh?null:b.dataTransfer.getData("text/html"),!1,h);let j=!!(c&&bm(a,b));if(a.someProp("handleDrop",c=>c(a,b,i||e.Ji.empty,j)))return b.preventDefault();if(!i)return;b.preventDefault();let k=i?(0,f.Um)(a.state.doc,h.pos,i):h.pos;null==k&&(k=h.pos);let l=a.state.tr;if(j){let{node:a}=c;a?a.replace(l):l.deleteSelection()}let m=l.mapping.map(k),n=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,o=l.doc;if(n?l.replaceRangeWith(m,m,i.content.firstChild):l.replaceRange(m,m,i),l.doc.eq(o))return;let p=l.doc.resolve(m);if(n&&d.nh.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new d.nh(p));else{let b=l.mapping.map(k);l.mapping.maps[l.mapping.maps.length-1].forEach((a,c,d,e)=>b=e),l.setSelection(aD(a,p,l.doc.resolve(b)))}a.focus(),a.dispatch(l.setMeta("uiEvent","drop"))}(a,b,a.dragging)}finally{a.dragging=null}},a0.focus=a=>{a.input.lastFocus=Date.now(),a.focused||(a.domObserver.stop(),a.dom.classList.add("ProseMirror-focused"),a.domObserver.start(),a.focused=!0,setTimeout(()=>{a.docView&&a.hasFocus()&&!a.domObserver.currentSelection.eq(a.domSelectionRange())&&aw(a)},20))},a0.blur=(a,b)=>{a.focused&&(a.domObserver.stop(),a.dom.classList.remove("ProseMirror-focused"),a.domObserver.start(),b.relatedTarget&&a.dom.contains(b.relatedTarget)&&a.domObserver.currentSelection.clear(),a.focused=!1)},a0.beforeinput=(a,b)=>{if(C&&I&&"deleteContentBackward"==b.inputType){a.domObserver.flushSoon();let{domChangeCount:b}=a.input;setTimeout(()=>{if(a.input.domChangeCount!=b||(a.dom.blur(),a.focus(),a.someProp("handleKeyDown",b=>b(a,r(8,"Backspace")))))return;let{$cursor:c}=a.state.selection;c&&c.pos>0&&a.dispatch(a.state.tr.delete(c.pos-1,c.pos).scrollIntoView())},50)}},a1)a0[a]=a1[a];function bn(a,b){if(a==b)return!0;for(let c in a)if(a[c]!==b[c])return!1;for(let c in b)if(!(c in a))return!1;return!0}class bo{constructor(a,b){this.toDOM=a,this.spec=b||bt,this.side=this.spec.side||0}map(a,b,c,d){let{pos:e,deleted:f}=a.mapResult(b.from+d,this.side<0?-1:1);return f?null:new br(e-c,e-c,this)}valid(){return!0}eq(a){return this==a||a instanceof bo&&(this.spec.key&&this.spec.key==a.spec.key||this.toDOM==a.toDOM&&bn(this.spec,a.spec))}destroy(a){this.spec.destroy&&this.spec.destroy(a)}}class bp{constructor(a,b){this.attrs=a,this.spec=b||bt}map(a,b,c,d){let e=a.map(b.from+d,this.spec.inclusiveStart?-1:1)-c,f=a.map(b.to+d,this.spec.inclusiveEnd?1:-1)-c;return e>=f?null:new br(e,f,this)}valid(a,b){return b.from<b.to}eq(a){return this==a||a instanceof bp&&bn(this.attrs,a.attrs)&&bn(this.spec,a.spec)}static is(a){return a.type instanceof bp}destroy(){}}class bq{constructor(a,b){this.attrs=a,this.spec=b||bt}map(a,b,c,d){let e=a.mapResult(b.from+d,1);if(e.deleted)return null;let f=a.mapResult(b.to+d,-1);return f.deleted||f.pos<=e.pos?null:new br(e.pos-c,f.pos-c,this)}valid(a,b){let{index:c,offset:d}=a.content.findIndex(b.from),e;return d==b.from&&!(e=a.child(c)).isText&&d+e.nodeSize==b.to}eq(a){return this==a||a instanceof bq&&bn(this.attrs,a.attrs)&&bn(this.spec,a.spec)}destroy(){}}class br{constructor(a,b,c){this.from=a,this.to=b,this.type=c}copy(a,b){return new br(a,b,this.type)}eq(a,b=0){return this.type.eq(a.type)&&this.from+b==a.from&&this.to+b==a.to}map(a,b,c){return this.type.map(a,this,b,c)}static widget(a,b,c){return new br(a,a,new bo(b,c))}static inline(a,b,c,d){return new br(a,b,new bp(c,d))}static node(a,b,c,d){return new br(a,b,new bq(c,d))}get spec(){return this.type.spec}get inline(){return this.type instanceof bp}get widget(){return this.type instanceof bo}}let bs=[],bt={};class bu{constructor(a,b){this.local=a.length?a:bs,this.children=b.length?b:bs}static create(a,b){return b.length?bA(b,a,0,bt):bv}find(a,b,c){let d=[];return this.findInner(null==a?0:a,null==b?1e9:b,d,0,c),d}findInner(a,b,c,d,e){for(let f=0;f<this.local.length;f++){let g=this.local[f];g.from<=b&&g.to>=a&&(!e||e(g.spec))&&c.push(g.copy(g.from+d,g.to+d))}for(let f=0;f<this.children.length;f+=3)if(this.children[f]<b&&this.children[f+1]>a){let g=this.children[f]+1;this.children[f+2].findInner(a-g,b-g,c,d+g,e)}}map(a,b,c){return this==bv||0==a.maps.length?this:this.mapInner(a,b,0,0,c||bt)}mapInner(a,b,c,d,e){let f;for(let g=0;g<this.local.length;g++){let h=this.local[g].map(a,c,d);h&&h.type.valid(b,h)?(f||(f=[])).push(h):e.onRemove&&e.onRemove(this.local[g].spec)}return this.children.length?function(a,b,c,d,e,f,g){let h=a.slice();for(let a=0,b=f;a<c.maps.length;a++){let d=0;c.maps[a].forEach((a,c,e,f)=>{let g=f-e-(c-a);for(let e=0;e<h.length;e+=3){let f=h[e+1];if(f<0||a>f+b-d)continue;let i=h[e]+b-d;c>=i?h[e+1]=a<=i?-2:-1:a>=b&&g&&(h[e]+=g,h[e+1]+=g)}d+=g}),b=c.maps[a].map(b,-1)}let i=!1;for(let b=0;b<h.length;b+=3)if(h[b+1]<0){if(-2==h[b+1]){i=!0,h[b+1]=-1;continue}let j=c.map(a[b]+f),k=j-e;if(k<0||k>=d.content.size){i=!0;continue}let l=c.map(a[b+1]+f,-1)-e,{index:m,offset:n}=d.content.findIndex(k),o=d.maybeChild(m);if(o&&n==k&&n+o.nodeSize==l){let d=h[b+2].mapInner(c,o,j+1,a[b]+f+1,g);d!=bv?(h[b]=k,h[b+1]=l,h[b+2]=d):(h[b+1]=-2,i=!0)}else i=!0}if(i){let i=bA(function(a,b,c,d,e,f,g){for(let h=0;h<a.length;h+=3)-1==a[h+1]&&function a(b,f){for(let a=0;a<b.local.length;a++){let h=b.local[a].map(d,e,f);h?c.push(h):g.onRemove&&g.onRemove(b.local[a].spec)}for(let c=0;c<b.children.length;c+=3)a(b.children[c+2],b.children[c]+f+1)}(a[h+2],b[h]+f+1);return c}(h,a,b,c,e,f,g),d,0,g);b=i.local;for(let a=0;a<h.length;a+=3)h[a+1]<0&&(h.splice(a,3),a-=3);for(let a=0,b=0;a<i.children.length;a+=3){let c=i.children[a];for(;b<h.length&&h[b]<c;)b+=3;h.splice(b,0,i.children[a],i.children[a+1],i.children[a+2])}}return new bu(b.sort(bB),h)}(this.children,f||[],a,b,c,d,e):f?new bu(f.sort(bB),bs):bv}add(a,b){return b.length?this==bv?bu.create(a,b):this.addInner(a,b,0):this}addInner(a,b,c){let d,e=0;a.forEach((a,f)=>{let g=f+c,h;if(h=by(b,a,g)){for(d||(d=this.children.slice());e<d.length&&d[e]<f;)e+=3;d[e]==f?d[e+2]=d[e+2].addInner(a,h,g+1):d.splice(e,0,f,f+a.nodeSize,bA(h,a,g+1,bt)),e+=3}});let f=bx(e?bz(b):b,-c);for(let b=0;b<f.length;b++)f[b].type.valid(a,f[b])||f.splice(b--,1);return new bu(f.length?this.local.concat(f).sort(bB):this.local,d||this.children)}remove(a){return 0==a.length||this==bv?this:this.removeInner(a,0)}removeInner(a,b){let c=this.children,d=this.local;for(let d=0;d<c.length;d+=3){let e,f=c[d]+b,g=c[d+1]+b;for(let b=0,c;b<a.length;b++)(c=a[b])&&c.from>f&&c.to<g&&(a[b]=null,(e||(e=[])).push(c));if(!e)continue;c==this.children&&(c=this.children.slice());let h=c[d+2].removeInner(e,f+1);h!=bv?c[d+2]=h:(c.splice(d,3),d-=3)}if(d.length){for(let c=0,e;c<a.length;c++)if(e=a[c])for(let a=0;a<d.length;a++)d[a].eq(e,b)&&(d==this.local&&(d=this.local.slice()),d.splice(a--,1))}return c==this.children&&d==this.local?this:d.length||c.length?new bu(d,c):bv}forChild(a,b){let c,d;if(this==bv)return this;if(b.isLeaf)return bu.empty;for(let b=0;b<this.children.length;b+=3)if(this.children[b]>=a){this.children[b]==a&&(c=this.children[b+2]);break}let e=a+1,f=e+b.content.size;for(let a=0;a<this.local.length;a++){let b=this.local[a];if(b.from<f&&b.to>e&&b.type instanceof bp){let a=Math.max(e,b.from)-e,c=Math.min(f,b.to)-e;a<c&&(d||(d=[])).push(b.copy(a,c))}}if(d){let a=new bu(d.sort(bB),bs);return c?new bw([a,c]):a}return c||bv}eq(a){if(this==a)return!0;if(!(a instanceof bu)||this.local.length!=a.local.length||this.children.length!=a.children.length)return!1;for(let b=0;b<this.local.length;b++)if(!this.local[b].eq(a.local[b]))return!1;for(let b=0;b<this.children.length;b+=3)if(this.children[b]!=a.children[b]||this.children[b+1]!=a.children[b+1]||!this.children[b+2].eq(a.children[b+2]))return!1;return!0}locals(a){return bC(this.localsInner(a))}localsInner(a){if(this==bv)return bs;if(a.inlineContent||!this.local.some(bp.is))return this.local;let b=[];for(let a=0;a<this.local.length;a++)this.local[a].type instanceof bp||b.push(this.local[a]);return b}forEachSet(a){a(this)}}bu.empty=new bu([],[]),bu.removeOverlap=bC;let bv=bu.empty;class bw{constructor(a){this.members=a}map(a,b){let c=this.members.map(c=>c.map(a,b,bt));return bw.from(c)}forChild(a,b){if(b.isLeaf)return bu.empty;let c=[];for(let d=0;d<this.members.length;d++){let e=this.members[d].forChild(a,b);e!=bv&&(e instanceof bw?c=c.concat(e.members):c.push(e))}return bw.from(c)}eq(a){if(!(a instanceof bw)||a.members.length!=this.members.length)return!1;for(let b=0;b<this.members.length;b++)if(!this.members[b].eq(a.members[b]))return!1;return!0}locals(a){let b,c=!0;for(let d=0;d<this.members.length;d++){let e=this.members[d].localsInner(a);if(e.length)if(b){c&&(b=b.slice(),c=!1);for(let a=0;a<e.length;a++)b.push(e[a])}else b=e}return b?bC(c?b:b.sort(bB)):bs}static from(a){switch(a.length){case 0:return bv;case 1:return a[0];default:return new bw(a.every(a=>a instanceof bu)?a:a.reduce((a,b)=>a.concat(b instanceof bu?b:b.members),[]))}}forEachSet(a){for(let b=0;b<this.members.length;b++)this.members[b].forEachSet(a)}}function bx(a,b){if(!b||!a.length)return a;let c=[];for(let d=0;d<a.length;d++){let e=a[d];c.push(new br(e.from+b,e.to+b,e.type))}return c}function by(a,b,c){if(b.isLeaf)return null;let d=c+b.nodeSize,e=null;for(let b=0,f;b<a.length;b++)(f=a[b])&&f.from>c&&f.to<d&&((e||(e=[])).push(f),a[b]=null);return e}function bz(a){let b=[];for(let c=0;c<a.length;c++)null!=a[c]&&b.push(a[c]);return b}function bA(a,b,c,d){let e=[],f=!1;b.forEach((b,g)=>{let h=by(a,b,g+c);if(h){f=!0;let a=bA(h,b,c+g+1,d);a!=bv&&e.push(g,g+b.nodeSize,a)}});let g=bx(f?bz(a):a,-c).sort(bB);for(let a=0;a<g.length;a++)g[a].type.valid(b,g[a])||(d.onRemove&&d.onRemove(g[a].spec),g.splice(a--,1));return g.length||e.length?new bu(g,e):bv}function bB(a,b){return a.from-b.from||a.to-b.to}function bC(a){let b=a;for(let c=0;c<b.length-1;c++){let d=b[c];if(d.from!=d.to)for(let e=c+1;e<b.length;e++){let f=b[e];if(f.from==d.from){f.to!=d.to&&(b==a&&(b=a.slice()),b[e]=f.copy(f.from,d.to),bD(b,e+1,f.copy(d.to,f.to)));continue}f.from<d.to&&(b==a&&(b=a.slice()),b[c]=d.copy(d.from,f.from),bD(b,e,d.copy(f.from,d.to)));break}}return b}function bD(a,b,c){for(;b<a.length&&bB(c,a[b])>0;)b++;a.splice(b,0,c)}function bE(a){let b=[];return a.someProp("decorations",c=>{let d=c(a.state);d&&d!=bv&&b.push(d)}),a.cursorWrapper&&b.push(bu.create(a.state.doc,[a.cursorWrapper.deco])),bw.from(b)}let bF={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},bG=y&&z<=11;class bH{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(a){this.anchorNode=a.anchorNode,this.anchorOffset=a.anchorOffset,this.focusNode=a.focusNode,this.focusOffset=a.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(a){return a.anchorNode==this.anchorNode&&a.anchorOffset==this.anchorOffset&&a.focusNode==this.focusNode&&a.focusOffset==this.focusOffset}}class bI{constructor(a,b){this.view=a,this.handleDOMChange=b,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new bH,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(b=>{for(let a=0;a<b.length;a++)this.queue.push(b[a]);y&&z<=11&&b.some(a=>"childList"==a.type&&a.removedNodes.length||"characterData"==a.type&&a.oldValue.length>a.target.nodeValue.length)?this.flushSoon():E&&a.composing&&b.some(a=>"childList"==a.type&&"TR"==a.target.nodeName)?(a.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),bG&&(this.onCharData=a=>{this.queue.push({target:a.target,type:"characterData",oldValue:a.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,bF)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let a=this.observer.takeRecords();if(a.length){for(let b=0;b<a.length;b++)this.queue.push(a[b]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(aE(this.view)){if(this.suppressingSelectionUpdates)return aw(this.view);if(y&&z<=11&&!this.view.state.selection.empty){let a=this.view.domSelectionRange();if(a.focusNode&&l(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(a){if(!a.focusNode)return!0;let b=new Set,c;for(let c=a.focusNode;c;c=h(c))b.add(c);for(let d=a.anchorNode;d;d=h(d))if(b.has(d)){c=d;break}let d=c&&this.view.docView.nearestDesc(c);if(d&&d.ignoreMutation({type:"selection",target:3==c.nodeType?c.parentNode:c}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let a of this.observer.takeRecords())this.queue.push(a);return this.queue}flush(){var a;let{view:b}=this;if(!b.docView||this.flushingSoon>-1)return;let c=this.pendingRecords();c.length&&(this.queue=[]);let e=b.domSelectionRange(),f=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&aE(b)&&!this.ignoreSelectionChange(e),g=-1,h=-1,i=!1,j=[];if(b.editable)for(let a=0;a<c.length;a++){let b=this.registerMutation(c[a],j);b&&(g=g<0?b.from:Math.min(b.from,g),h=h<0?b.to:Math.max(b.to,h),b.typeOver&&(i=!0))}if(j.some(a=>"BR"==a.nodeName)&&(8==b.input.lastKeyCode||46==b.input.lastKeyCode)){for(let a of j)if("BR"==a.nodeName&&a.parentNode){let b=a.nextSibling;b&&1==b.nodeType&&"false"==b.contentEditable&&a.parentNode.removeChild(a)}}else if(A&&j.length){let a=j.filter(a=>"BR"==a.nodeName);if(2==a.length){let[b,c]=a;b.parentNode&&b.parentNode.parentNode==c.parentNode?c.remove():b.remove()}else{let{focusNode:c}=this.currentSelection;for(let d of a){let a=d.parentNode;a&&"LI"==a.nodeName&&(!c||function(a,b){for(let c=b.parentNode;c&&c!=a.dom;c=c.parentNode){let b=a.docView.nearestDesc(c,!0);if(b&&b.node.isBlock)return c}return null}(b,c)!=a)&&d.remove()}}}let k=null;g<0&&f&&b.input.lastFocus>Date.now()-200&&Math.max(b.input.lastTouch,b.input.lastClick.time)<Date.now()-300&&q(e)&&(k=au(b))&&k.eq(d.LN.near(b.state.doc.resolve(0),1))?(b.input.lastFocus=0,aw(b),this.currentSelection.set(e),b.scrollToSelection()):(g>-1||f)&&(g>-1&&(b.docView.markDirty(g,h),a=b,!bJ.has(a)&&(bJ.set(a,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(a.dom).whiteSpace))&&(a.requiresGeckoHackNode=A,bK||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),bK=!0))),b.input.badSafariComposition&&(b.input.badSafariComposition=!1,function(a,b){var c;let{focusNode:d,focusOffset:e}=a.domSelectionRange();for(let f of b)if((null==(c=f.parentNode)?void 0:c.nodeName)=="TR"){let b=f.nextSibling;for(;b&&"TD"!=b.nodeName&&"TH"!=b.nodeName;)b=b.nextSibling;if(b){let c=b;for(;;){let a=c.firstChild;if(!a||1!=a.nodeType||"false"==a.contentEditable||/^(BR|IMG)$/.test(a.nodeName))break;c=a}c.insertBefore(f,c.firstChild),d==f&&a.domSelection().collapse(f,e)}else f.parentNode.removeChild(f)}}(b,j)),this.handleDOMChange(g,h,i,j),b.docView&&b.docView.dirty?b.updateState(b.state):this.currentSelection.eq(e)||aw(b),this.currentSelection.set(e))}registerMutation(a,b){if(b.indexOf(a.target)>-1)return null;let c=this.view.docView.nearestDesc(a.target);if("attributes"==a.type&&(c==this.view.docView||"contenteditable"==a.attributeName||"style"==a.attributeName&&!a.oldValue&&!a.target.getAttribute("style"))||!c||c.ignoreMutation(a))return null;if("childList"==a.type){for(let c=0;c<a.addedNodes.length;c++){let d=a.addedNodes[c];b.push(d),3==d.nodeType&&(this.lastChangedTextNode=d)}if(c.contentDOM&&c.contentDOM!=c.dom&&!c.contentDOM.contains(a.target))return{from:c.posBefore,to:c.posAfter};let d=a.previousSibling,e=a.nextSibling;if(y&&z<=11&&a.addedNodes.length)for(let b=0;b<a.addedNodes.length;b++){let{previousSibling:c,nextSibling:f}=a.addedNodes[b];(!c||0>Array.prototype.indexOf.call(a.addedNodes,c))&&(d=c),(!f||0>Array.prototype.indexOf.call(a.addedNodes,f))&&(e=f)}let f=d&&d.parentNode==a.target?g(d)+1:0,h=c.localPosFromDOM(a.target,f,-1),i=e&&e.parentNode==a.target?g(e):a.target.childNodes.length;return{from:h,to:c.localPosFromDOM(a.target,i,1)}}return"attributes"==a.type?{from:c.posAtStart-c.border,to:c.posAtEnd+c.border}:(this.lastChangedTextNode=a.target,{from:c.posAtStart,to:c.posAtEnd,typeOver:a.target.nodeValue==a.oldValue})}}let bJ=new WeakMap,bK=!1;function bL(a,b){let c=b.startContainer,d=b.startOffset,e=b.endContainer,f=b.endOffset,g=a.domAtPos(a.state.selection.anchor);return l(g.node,g.offset,e,f)&&([c,d,e,f]=[e,f,c,d]),{anchorNode:c,anchorOffset:d,focusNode:e,focusOffset:f}}function bM(a){let b=a.pmViewDesc;if(b)return b.parseRule();if("BR"==a.nodeName&&a.parentNode){if(E&&/^(ul|ol)$/i.test(a.parentNode.nodeName)){let a=document.createElement("div");return a.appendChild(document.createElement("li")),{skip:a}}else if(a.parentNode.lastChild==a||E&&/^(tr|table)$/i.test(a.parentNode.nodeName))return{ignore:!0}}else if("IMG"==a.nodeName&&a.getAttribute("mark-placeholder"))return{ignore:!0};return null}let bN=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function bO(a,b,c){return Math.max(c.anchor,c.head)>b.content.size?null:aD(a,b.resolve(c.anchor),b.resolve(c.head))}function bP(a,b,c){let d=a.depth,e=b?a.end():a.pos;for(;d>0&&(b||a.indexAfter(d)==a.node(d).childCount);)d--,e++,b=!1;if(c){let b=a.node(d).maybeChild(a.indexAfter(d));for(;b&&!b.isLeaf;)b=b.firstChild,e++}return e}function bQ(a){if(2!=a.length)return!1;let b=a.charCodeAt(0),c=a.charCodeAt(1);return b>=56320&&b<=57343&&c>=55296&&c<=56319}class bR{constructor(a,b){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new a3,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=b,this.state=b.state,this.directPlugins=b.plugins||[],this.directPlugins.forEach(bW),this.dispatch=this.dispatch.bind(this),this.dom=a&&a.mount||document.createElement("div"),a&&(a.appendChild?a.appendChild(this.dom):"function"==typeof a?a(this.dom):a.mount&&(this.mounted=!0)),this.editable=bU(this),bT(this),this.nodeViews=bV(this),this.docView=ag(this.state.doc,bS(this),bE(this),this.dom,this),this.domObserver=new bI(this,(a,b,c,f)=>(function(a,b,c,f,g){let h,i,j,k=a.input.compositionPendingChanges||(a.composing?a.input.compositionID:0);if(a.input.compositionPendingChanges=0,b<0){let b=a.input.lastSelectionTime>Date.now()-50?a.input.lastSelectionOrigin:null,c=au(a,b);if(c&&!a.state.selection.eq(c)){if(C&&I&&13===a.input.lastKeyCode&&Date.now()-100<a.input.lastKeyCodeTime&&a.someProp("handleKeyDown",b=>b(a,r(13,"Enter"))))return;let d=a.state.tr.setSelection(c);"pointer"==b?d.setMeta("pointer",!0):"key"==b&&d.scrollIntoView(),k&&d.setMeta("composition",k),a.dispatch(d)}return}let l=a.state.doc.resolve(b),m=l.sharedDepth(c);b=l.before(m+1),c=a.state.doc.resolve(c).after(m+1);let n=a.state.selection,o=function(a,b,c){let d,{node:f,fromOffset:g,toOffset:h,from:i,to:j}=a.docView.parseRange(b,c),k=a.domSelectionRange(),l=k.anchorNode;if(l&&a.dom.contains(1==l.nodeType?l:l.parentNode)&&(d=[{node:l,offset:k.anchorOffset}],q(k)||d.push({node:k.focusNode,offset:k.focusOffset})),C&&8===a.input.lastKeyCode)for(let a=h;a>g;a--){let b=f.childNodes[a-1],c=b.pmViewDesc;if("BR"==b.nodeName&&!c){h=a;break}if(!c||c.size)break}let m=a.state.doc,n=a.someProp("domParser")||e.S4.fromSchema(a.state.schema),o=m.resolve(i),p=null,r=n.parse(f,{topNode:o.parent,topMatch:o.parent.contentMatchAt(o.index()),topOpen:!0,from:g,to:h,preserveWhitespace:"pre"!=o.parent.type.whitespace||"full",findPositions:d,ruleFromNode:bM,context:o});if(d&&null!=d[0].pos){let a=d[0].pos,b=d[1]&&d[1].pos;null==b&&(b=a),p={anchor:a+i,head:b+i}}return{doc:r,sel:p,from:i,to:j}}(a,b,c),p=a.state.doc,s=p.slice(o.from,o.to);8===a.input.lastKeyCode&&Date.now()-100<a.input.lastKeyCodeTime?(h=a.state.selection.to,i="end"):(h=a.state.selection.from,i="start"),a.input.lastKeyCode=null;let t=function(a,b,c,d,e){let f=a.findDiffStart(b,c);if(null==f)return null;let{a:g,b:h}=a.findDiffEnd(b,c+a.size,c+b.size);if("end"==e){let a=Math.max(0,f-Math.min(g,h));d-=g+a-f}if(g<f&&a.size<b.size){let a=d<=f&&d>=g?f-d:0;(f-=a)&&f<b.size&&bQ(b.textBetween(f-1,f+1))&&(f+=a?1:-1),h=f+(h-g),g=f}else if(h<f){let b=d<=f&&d>=h?f-d:0;(f-=b)&&f<a.size&&bQ(a.textBetween(f-1,f+1))&&(f+=b?1:-1),g=f+(g-h),h=f}return{start:f,endA:g,endB:h}}(s.content,o.doc.content,o.from,h,i);if(t&&a.input.domChangeCount++,(F&&a.input.lastIOSEnter>Date.now()-225||I)&&g.some(a=>1==a.nodeType&&!bN.test(a.nodeName))&&(!t||t.endA>=t.endB)&&a.someProp("handleKeyDown",b=>b(a,r(13,"Enter")))){a.input.lastIOSEnter=0;return}if(!t)if(f&&n instanceof d.U3&&!n.empty&&n.$head.sameParent(n.$anchor)&&!a.composing&&!(o.sel&&o.sel.anchor!=o.sel.head))t={start:n.from,endA:n.to,endB:n.to};else{if(o.sel){let b=bO(a,a.state.doc,o.sel);if(b&&!b.eq(a.state.selection)){let c=a.state.tr.setSelection(b);k&&c.setMeta("composition",k),a.dispatch(c)}}return}a.state.selection.from<a.state.selection.to&&t.start==t.endB&&a.state.selection instanceof d.U3&&(t.start>a.state.selection.from&&t.start<=a.state.selection.from+2&&a.state.selection.from>=o.from?t.start=a.state.selection.from:t.endA<a.state.selection.to&&t.endA>=a.state.selection.to-2&&a.state.selection.to<=o.to&&(t.endB+=a.state.selection.to-t.endA,t.endA=a.state.selection.to)),y&&z<=11&&t.endB==t.start+1&&t.endA==t.start&&t.start>o.from&&" \xa0"==o.doc.textBetween(t.start-o.from-1,t.start-o.from+1)&&(t.start--,t.endA--,t.endB--);let u=o.doc.resolveNoCache(t.start-o.from),v=o.doc.resolveNoCache(t.endB-o.from),w=p.resolve(t.start),x=u.sameParent(v)&&u.parent.inlineContent&&w.end()>=t.endA;if((F&&a.input.lastIOSEnter>Date.now()-225&&(!x||g.some(a=>"DIV"==a.nodeName||"P"==a.nodeName))||!x&&u.pos<o.doc.content.size&&(!u.sameParent(v)||!u.parent.inlineContent)&&u.pos<v.pos&&!/\S/.test(o.doc.textBetween(u.pos,v.pos,"","")))&&a.someProp("handleKeyDown",b=>b(a,r(13,"Enter")))){a.input.lastIOSEnter=0;return}if(a.state.selection.anchor>t.start&&function(a,b,c,d,e){if(c-b<=e.pos-d.pos||bP(d,!0,!1)<e.pos)return!1;let f=a.resolve(b);if(!d.parent.isTextblock){let a=f.nodeAfter;return null!=a&&c==b+a.nodeSize}if(f.parentOffset<f.parent.content.size||!f.parent.isTextblock)return!1;let g=a.resolve(bP(f,!0,!0));return!(!g.parent.isTextblock||g.pos>c||bP(g,!0,!1)<c)&&d.parent.content.cut(d.parentOffset).eq(g.parent.content)}(p,t.start,t.endA,u,v)&&a.someProp("handleKeyDown",b=>b(a,r(8,"Backspace")))){I&&C&&a.domObserver.suppressSelectionUpdates();return}C&&t.endB==t.start&&(a.input.lastChromeDelete=Date.now()),I&&!x&&u.start()!=v.start()&&0==v.parentOffset&&u.depth==v.depth&&o.sel&&o.sel.anchor==o.sel.head&&o.sel.head==t.endA&&(t.endB-=2,v=o.doc.resolveNoCache(t.endB-o.from),setTimeout(()=>{a.someProp("handleKeyDown",function(b){return b(a,r(13,"Enter"))})},20));let A=t.start,B=t.endA,D=b=>{let c=b||a.state.tr.replace(A,B,o.doc.slice(t.start-o.from,t.endB-o.from));if(o.sel){let b=bO(a,c.doc,o.sel);b&&!(C&&a.composing&&b.empty&&(t.start!=t.endB||a.input.lastChromeDelete<Date.now()-100)&&(b.head==A||b.head==c.mapping.map(B)-1)||y&&b.empty&&b.head==A)&&c.setSelection(b)}return k&&c.setMeta("composition",k),c.scrollIntoView()};if(x)if(u.pos==v.pos){y&&z<=11&&0==u.parentOffset&&(a.domObserver.suppressSelectionUpdates(),setTimeout(()=>aw(a),20));let b=D(a.state.tr.delete(A,B)),c=p.resolve(t.start).marksAcross(p.resolve(t.endA));c&&b.ensureMarks(c),a.dispatch(b)}else if(t.endA==t.endB&&(j=function(a,b){let c=a.firstChild.marks,d=b.firstChild.marks,f=c,g=d,h,i,j;for(let a=0;a<d.length;a++)f=d[a].removeFromSet(f);for(let a=0;a<c.length;a++)g=c[a].removeFromSet(g);if(1==f.length&&0==g.length)i=f[0],h="add",j=a=>a.mark(i.addToSet(a.marks));else{if(0!=f.length||1!=g.length)return null;i=g[0],h="remove",j=a=>a.mark(i.removeFromSet(a.marks))}let k=[];for(let a=0;a<b.childCount;a++)k.push(j(b.child(a)));if(e.FK.from(k).eq(a))return{mark:i,type:h}}(u.parent.content.cut(u.parentOffset,v.parentOffset),w.parent.content.cut(w.parentOffset,t.endA-w.start())))){let b=D(a.state.tr);"add"==j.type?b.addMark(A,B,j.mark):b.removeMark(A,B,j.mark),a.dispatch(b)}else if(u.parent.child(u.index()).isText&&u.index()==v.index()-!v.textOffset){let b=u.parent.textBetween(u.parentOffset,v.parentOffset),c=()=>D(a.state.tr.insertText(b,A,B));a.someProp("handleTextInput",d=>d(a,A,B,b,c))||a.dispatch(c())}else a.dispatch(D());else a.dispatch(D())})(this,a,b,c,f)),this.domObserver.start(),function(a){for(let b in a0){let c=a0[b];a.dom.addEventListener(b,a.input.eventHandlers[b]=b=>{!function(a,b){if(!b.bubbles)return!0;if(b.defaultPrevented)return!1;for(let c=b.target;c!=a.dom;c=c.parentNode)if(!c||11==c.nodeType||c.pmViewDesc&&c.pmViewDesc.stopEvent(b))return!1;return!0}(a,b)||a6(a,b)||!a.editable&&b.type in a1||c(a,b)},a2[b]?{passive:!0}:void 0)}E&&a.dom.addEventListener("input",()=>null),a5(a)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let a=this._props;for(let b in this._props={},a)this._props[b]=a[b];this._props.state=this.state}return this._props}update(a){a.handleDOMEvents!=this._props.handleDOMEvents&&a5(this);let b=this._props;this._props=a,a.plugins&&(a.plugins.forEach(bW),this.directPlugins=a.plugins),this.updateStateInner(a.state,b)}setProps(a){let b={};for(let a in this._props)b[a]=this._props[a];for(let c in b.state=this.state,a)b[c]=a[c];this.update(b)}updateState(a){this.updateStateInner(a,this._props)}updateStateInner(a,b){var c,d,e;let f=this.state,h=!1,i=!1;a.storedMarks&&this.composing&&(bf(this),i=!0),this.state=a;let j=f.plugins!=a.plugins||this._props.plugins!=b.plugins;if(j||this._props.plugins!=b.plugins||this._props.nodeViews!=b.nodeViews){let a=bV(this);(function(a,b){let c=0,d=0;for(let d in a){if(a[d]!=b[d])return!0;c++}for(let a in b)d++;return c!=d})(a,this.nodeViews)&&(this.nodeViews=a,h=!0)}(j||b.handleDOMEvents!=this._props.handleDOMEvents)&&a5(this),this.editable=bU(this),bT(this);let k=bE(this),m=bS(this),n=f.plugins==a.plugins||f.doc.eq(a.doc)?a.scrollToSelection>f.scrollToSelection?"to selection":"preserve":"reset",q=h||!this.docView.matchesNode(a.doc,m,k);(q||!a.selection.eq(f.selection))&&(i=!0);let r="preserve"==n&&i&&null==this.dom.style.overflowAnchor&&function(a){let b,c,d=a.dom.getBoundingClientRect(),e=Math.max(0,d.top);for(let f=(d.left+d.right)/2,g=e+1;g<Math.min(innerHeight,d.bottom);g+=5){let d=a.root.elementFromPoint(f,g);if(!d||d==a.dom||!a.dom.contains(d))continue;let h=d.getBoundingClientRect();if(h.top>=e-20){b=d,c=h.top;break}}return{refDOM:b,refTop:c,stack:N(a.dom)}}(this);if(i){let b,c,i;this.domObserver.stop();let j=q&&(y||C)&&!this.composing&&!f.selection.empty&&!a.selection.empty&&(d=f.selection,e=a.selection,i=Math.min(d.$anchor.sharedDepth(d.head),e.$anchor.sharedDepth(e.head)),d.$anchor.start(i)!=e.$anchor.start(i));if(q){let b=C?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(a){let b=a.domSelectionRange();if(!b.focusNode)return null;let c=function(a,b){for(;;){if(3==a.nodeType&&b)return a;if(1==a.nodeType&&b>0){if("false"==a.contentEditable)return null;b=o(a=a.childNodes[b-1])}else{if(!a.parentNode||p(a))return null;b=g(a),a=a.parentNode}}}(b.focusNode,b.focusOffset),d=function(a,b){for(;;){if(3==a.nodeType&&b<a.nodeValue.length)return a;if(1==a.nodeType&&b<a.childNodes.length){if("false"==a.contentEditable)return null;a=a.childNodes[b],b=0}else{if(!a.parentNode||p(a))return null;b=g(a)+1,a=a.parentNode}}}(b.focusNode,b.focusOffset);if(c&&d&&c!=d){let b=d.pmViewDesc,e=a.domObserver.lastChangedTextNode;if(c==e||d==e)return e;if(!b||!b.isText(d.nodeValue))return d;if(a.input.compositionNode==d){let a=c.pmViewDesc;if(!(!a||!a.isText(c.nodeValue)))return d}}return c||d}(this)),(h||!this.docView.update(a.doc,m,k,this))&&(this.docView.updateOuterDeco(m),this.docView.destroy(),this.docView=ag(a.doc,m,k,this.dom,this)),!b||this.trackWrites&&this.dom.contains(this.trackWrites)||(j=!0)}j||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(b=this.docView.domFromPos(this.state.selection.anchor,0),c=this.domSelectionRange(),l(b.node,b.offset,c.anchorNode,c.anchorOffset)))?aw(this,j):(aB(this,a.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(f),(null==(c=this.dragging)?void 0:c.node)&&!f.doc.eq(a.doc)&&this.updateDraggedNode(this.dragging,f),"reset"==n?this.dom.scrollTop=0:"to selection"==n?this.scrollToSelection():r&&function({refDOM:a,refTop:b,stack:c}){let d=a?a.getBoundingClientRect().top:0;O(c,0==d?0:d-b)}(r)}scrollToSelection(){let a=this.domSelectionRange().focusNode;if(a&&this.dom.contains(1==a.nodeType?a:a.parentNode))if(this.someProp("handleScrollToSelection",a=>a(this)));else if(this.state.selection instanceof d.nh){let b=this.docView.domAfterPos(this.state.selection.from);1==b.nodeType&&M(this,b.getBoundingClientRect(),a)}else M(this,this.coordsAtPos(this.state.selection.head,1),a)}destroyPluginViews(){let a;for(;a=this.pluginViews.pop();)a.destroy&&a.destroy()}updatePluginViews(a){if(a&&a.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let b=0;b<this.pluginViews.length;b++){let c=this.pluginViews[b];c.update&&c.update(this,a)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let a=0;a<this.directPlugins.length;a++){let b=this.directPlugins[a];b.spec.view&&this.pluginViews.push(b.spec.view(this))}for(let a=0;a<this.state.plugins.length;a++){let b=this.state.plugins[a];b.spec.view&&this.pluginViews.push(b.spec.view(this))}}}updateDraggedNode(a,b){let c=a.node,e=-1;if(this.state.doc.nodeAt(c.from)==c.node)e=c.from;else{let a=c.from+(this.state.doc.content.size-b.doc.content.size);(a>0&&this.state.doc.nodeAt(a))==c.node&&(e=a)}this.dragging=new bk(a.slice,a.move,e<0?void 0:d.nh.create(this.state.doc,e))}someProp(a,b){let c=this._props&&this._props[a],d;if(null!=c&&(d=b?b(c):c))return d;for(let c=0;c<this.directPlugins.length;c++){let e=this.directPlugins[c].props[a];if(null!=e&&(d=b?b(e):e))return d}let e=this.state.plugins;if(e)for(let c=0;c<e.length;c++){let f=e[c].props[a];if(null!=f&&(d=b?b(f):f))return d}}hasFocus(){if(y){let a=this.root.activeElement;if(a==this.dom)return!0;if(!a||!this.dom.contains(a))return!1;for(;a&&this.dom!=a&&this.dom.contains(a);){if("false"==a.contentEditable)return!1;a=a.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(a){if(a.setActive)return a.setActive();if(P)return a.focus(P);let b=N(a);a.focus(null==P?{get preventScroll(){return P={preventScroll:!0},!0}}:void 0),P||(P=!1,O(b,0))}(this.dom),aw(this),this.domObserver.start()}get root(){let a=this._root;if(null==a){for(let a=this.dom.parentNode;a;a=a.parentNode)if(9==a.nodeType||11==a.nodeType&&a.host)return a.getSelection||(Object.getPrototypeOf(a).getSelection=()=>a.ownerDocument.getSelection()),this._root=a}return a||document}updateRoot(){this._root=null}posAtCoords(a){return function(a,b){var c;let d,e,f=a.dom.ownerDocument,g,i=0,k=function(a,b,c){if(a.caretPositionFromPoint)try{let d=a.caretPositionFromPoint(b,c);if(d)return{node:d.offsetNode,offset:Math.min(o(d.offsetNode),d.offset)}}catch(a){}if(a.caretRangeFromPoint){let d=a.caretRangeFromPoint(b,c);if(d)return{node:d.startContainer,offset:Math.min(o(d.startContainer),d.startOffset)}}}(f,b.left,b.top);k&&({node:g,offset:i}=k);let l=(a.root.elementFromPoint?a.root:f).elementFromPoint(b.left,b.top);if(!l||!a.dom.contains(1!=l.nodeType?l.parentNode:l)){let c=a.dom.getBoundingClientRect();if(!Q(b,c)||!(l=function a(b,c,d){let e=b.childNodes.length;if(e&&d.top<d.bottom)for(let f=Math.max(0,Math.min(e-1,Math.floor(e*(c.top-d.top)/(d.bottom-d.top))-2)),g=f;;){let d=b.childNodes[g];if(1==d.nodeType){let b=d.getClientRects();for(let e=0;e<b.length;e++){let f=b[e];if(Q(c,f))return a(d,c,f)}}if((g=(g+1)%e)==f)break}return b}(a.dom,b,c)))return null}if(E)for(let a=l;g&&a;a=h(a))a.draggable&&(g=void 0);if(l=(d=(c=l).parentNode)&&/^li$/i.test(d.nodeName)&&b.left<c.getBoundingClientRect().left?d:c,g){let c;if(A&&1==g.nodeType&&(i=Math.min(i,g.childNodes.length))<g.childNodes.length){let a=g.childNodes[i],c;"IMG"==a.nodeName&&(c=a.getBoundingClientRect()).right<=b.left&&c.bottom>b.top&&i++}J&&i&&1==g.nodeType&&1==(c=g.childNodes[i-1]).nodeType&&"false"==c.contentEditable&&c.getBoundingClientRect().top>=b.top&&i--,g==a.dom&&i==g.childNodes.length-1&&1==g.lastChild.nodeType&&b.top>g.lastChild.getBoundingClientRect().bottom?e=a.state.doc.content.size:(0==i||1!=g.nodeType||"BR"!=g.childNodes[i-1].nodeName)&&(e=function(a,b,c,d){let e=-1;for(let c=b,f=!1;c!=a.dom;){let b=a.docView.nearestDesc(c,!0),g;if(!b)return null;if(1==b.dom.nodeType&&(b.node.isBlock&&b.parent||!b.contentDOM)&&((g=b.dom.getBoundingClientRect()).width||g.height)&&(b.node.isBlock&&b.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(b.dom.nodeName)&&(!f&&g.left>d.left||g.top>d.top?e=b.posBefore:(!f&&g.right<d.left||g.bottom<d.top)&&(e=b.posAfter),f=!0),!b.contentDOM&&e<0&&!b.node.isText))return(b.node.isBlock?d.top<(g.top+g.bottom)/2:d.left<(g.left+g.right)/2)?b.posBefore:b.posAfter;c=b.dom.parentNode}return e>-1?e:a.docView.posFromDOM(b,c,-1)}(a,g,i,b))}null==e&&(e=function(a,b,c){let{node:d,offset:e}=function a(b,c){let d,e,f,g=2e8,h,i=0,k=c.top,l=c.top;for(let a=b.firstChild,m=0;a;a=a.nextSibling,m++){let b;if(1==a.nodeType)b=a.getClientRects();else{if(3!=a.nodeType)continue;b=j(a).getClientRects()}for(let j=0;j<b.length;j++){let n=b[j];if(n.top<=k&&n.bottom>=l){k=Math.max(n.bottom,k),l=Math.min(n.top,l);let b=n.left>c.left?n.left-c.left:n.right<c.left?c.left-n.right:0;if(b<g){f=a,g=b,h=b&&3==f.nodeType?{left:n.right<c.left?n.right:n.left,top:c.top}:c,1==a.nodeType&&b&&(i=m+ +(c.left>=(n.left+n.right)/2));continue}}else n.top>c.top&&!d&&n.left<=c.left&&n.right>=c.left&&(d=a,e={left:Math.max(n.left,Math.min(n.right,c.left)),top:n.top});!f&&(c.left>=n.right&&c.top>=n.top||c.left>=n.left&&c.top>=n.bottom)&&(i=m+1)}}return(!f&&d&&(f=d,h=e,g=0),f&&3==f.nodeType)?function(a,b){let c=a.nodeValue.length,d=document.createRange(),e;for(let f=0;f<c;f++){d.setEnd(a,f+1),d.setStart(a,f);let c=S(d,1);if(c.top!=c.bottom&&Q(b,c)){e={node:a,offset:f+ +(b.left>=(c.left+c.right)/2)};break}}return d.detach(),e||{node:a,offset:0}}(f,h):!f||g&&1==f.nodeType?{node:b,offset:i}:a(f,h)}(b,c),f=-1;if(1==d.nodeType&&!d.firstChild){let a=d.getBoundingClientRect();f=a.left!=a.right&&c.left>(a.left+a.right)/2?1:-1}return a.docView.posFromDOM(d,e,f)}(a,l,b));let m=a.docView.nearestDesc(l,!0);return{pos:e,inside:m?m.posAtStart-m.border:-1}}(this,a)}coordsAtPos(a,b=1){return U(this,a,b)}domAtPos(a,b=0){return this.docView.domFromPos(a,b)}nodeDOM(a){let b=this.docView.descAt(a);return b?b.nodeDOM:null}posAtDOM(a,b,c=-1){let d=this.docView.posFromDOM(a,b,c);if(null==d)throw RangeError("DOM position not inside the editor");return d}endOfTextblock(a,b){return function(a,b,c){let d,e;return Z==b&&_==c?aa:(Z=b,_=c,aa="up"==c||"down"==c?(d=b.selection,e="up"==c?d.$from:d.$to,X(a,b,()=>{let{node:b}=a.docView.domFromPos(e.pos,"up"==c?-1:1);for(;;){let c=a.docView.nearestDesc(b,!0);if(!c)break;if(c.node.isBlock){b=c.contentDOM||c.dom;break}b=c.dom.parentNode}let d=U(a,e.pos,1);for(let a=b.firstChild;a;a=a.nextSibling){let b;if(1==a.nodeType)b=a.getClientRects();else{if(3!=a.nodeType)continue;b=j(a,0,a.nodeValue.length).getClientRects()}for(let a=0;a<b.length;a++){let e=b[a];if(e.bottom>e.top+1&&("up"==c?d.top-e.top>(e.bottom-d.top)*2:e.bottom-d.bottom>(d.bottom-e.top)*2))return!1}}return!0})):function(a,b,c){let{$head:d}=b.selection;if(!d.parent.isTextblock)return!1;let e=d.parentOffset,f=e==d.parent.content.size,g=a.domSelection();return g?Y.test(d.parent.textContent)&&g.modify?X(a,b,()=>{let{focusNode:b,focusOffset:e,anchorNode:f,anchorOffset:h}=a.domSelectionRange(),i=g.caretBidiLevel;g.modify("move",c,"character");let j=d.depth?a.docView.domAfterPos(d.before()):a.dom,{focusNode:k,focusOffset:l}=a.domSelectionRange(),m=k&&!j.contains(1==k.nodeType?k:k.parentNode)||b==k&&e==l;try{g.collapse(f,h),b&&(b!=f||e!=h)&&g.extend&&g.extend(b,e)}catch(a){}return null!=i&&(g.caretBidiLevel=i),m}):"left"==c||"backward"==c?!e:f:d.pos==d.start()||d.pos==d.end()}(a,b,c))}(this,b||this.state,a)}pasteHTML(a,b){return bi(this,"",a,!1,b||new ClipboardEvent("paste"))}pasteText(a,b){return bi(this,a,null,!0,b||new ClipboardEvent("paste"))}serializeForClipboard(a){return aS(this,a)}destroy(){if(this.docView){for(let a in this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(a,this.input.eventHandlers[a]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],bE(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,k()}}get isDestroyed(){return null==this.docView}dispatchEvent(a){!a6(this,a)&&a0[a.type]&&(this.editable||!(a.type in a1))&&a0[a.type](this,a)}domSelectionRange(){let a=this.domSelection();return a?E&&11===this.root.nodeType&&function(a){let b=a.activeElement;for(;b&&b.shadowRoot;)b=b.shadowRoot.activeElement;return b}(this.dom.ownerDocument)==this.dom&&function(a,b){let c;if(b.getComposedRanges){let c=b.getComposedRanges(a.root)[0];if(c)return bL(a,c)}function d(a){a.preventDefault(),a.stopImmediatePropagation(),c=a.getTargetRanges()[0]}return a.dom.addEventListener("beforeinput",d,!0),document.execCommand("indent"),a.dom.removeEventListener("beforeinput",d,!0),c?bL(a,c):null}(this,a)||a:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function bS(a){let b=Object.create(null);return b.class="ProseMirror",b.contenteditable=String(a.editable),a.someProp("attributes",c=>{if("function"==typeof c&&(c=c(a.state)),c)for(let a in c)"class"==a?b.class+=" "+c[a]:"style"==a?b.style=(b.style?b.style+";":"")+c[a]:b[a]||"contenteditable"==a||"nodeName"==a||(b[a]=String(c[a]))}),b.translate||(b.translate="no"),[br.node(0,a.state.doc.content.size,b)]}function bT(a){if(a.markCursor){let b=document.createElement("img");b.className="ProseMirror-separator",b.setAttribute("mark-placeholder","true"),b.setAttribute("alt",""),a.cursorWrapper={dom:b,deco:br.widget(a.state.selection.from,b,{raw:!0,marks:a.markCursor})}}else a.cursorWrapper=null}function bU(a){return!a.someProp("editable",b=>!1===b(a.state))}function bV(a){let b=Object.create(null);function c(a){for(let c in a)Object.prototype.hasOwnProperty.call(b,c)||(b[c]=a[c])}return a.someProp("nodeViews",c),a.someProp("markViews",c),b}function bW(a){if(a.spec.state||a.spec.filterTransaction||a.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}bR.prototype.dispatch=function(a){let b=this._props.dispatchTransaction;b?b.call(this,a):this.updateState(this.state.apply(a))}},670016:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(789253);b.property=function(a){return function(b){return d.get(b,a)}}},673977:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});var d=c(356103).Or},676029:(a,b,c)=>{"use strict";c.d(b,{q:()=>Y});var d=c(115962);function e(a){return Array.isArray?Array.isArray(a):"[object Array]"===l(a)}let f=1/0;function g(a){return"string"==typeof a}function h(a){return"number"==typeof a}function i(a){return"object"==typeof a}function j(a){return null!=a}function k(a){return!a.trim().length}function l(a){return null==a?void 0===a?"[object Undefined]":"[object Null]":Object.prototype.toString.call(a)}let m=Object.prototype.hasOwnProperty;class n{constructor(a){this._keys=[],this._keyMap={};let b=0;a.forEach(a=>{let c=o(a);this._keys.push(c),this._keyMap[c.id]=c,b+=c.weight}),this._keys.forEach(a=>{a.weight/=b})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function o(a){let b=null,c=null,d=null,f=1,h=null;if(g(a)||e(a))d=a,b=p(a),c=q(a);else{if(!m.call(a,"name"))throw Error("Missing name property in key");let e=a.name;if(d=e,m.call(a,"weight")&&(f=a.weight)<=0)throw Error(`Property 'weight' in key '${e}' must be a positive integer`);b=p(e),c=q(e),h=a.getFn}return{path:b,id:c,weight:f,src:d,getFn:h}}function p(a){return e(a)?a:a.split(".")}function q(a){return e(a)?a.join("."):a}var r={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(a,b)=>a.score===b.score?a.idx<b.idx?-1:1:a.score<b.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(a,b){let c=[],d=!1,k=(a,b,m)=>{if(j(a))if(b[m]){var n,o;let p=a[b[m]];if(!j(p))return;if(m===b.length-1&&(g(p)||h(p)||!0===(n=p)||!1===n||i(o=n)&&null!==o&&"[object Boolean]"==l(n)))c.push(null==p?"":function(a){if("string"==typeof a)return a;let b=a+"";return"0"==b&&1/a==-f?"-0":b}(p));else if(e(p)){d=!0;for(let a=0,c=p.length;a<c;a+=1)k(p[a],b,m+1)}else b.length&&k(p,b,m+1)}else c.push(a)};return k(a,g(b)?b.split("."):b,0),d?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};let s=/[^ ]+/g;class t{constructor({getFn:a=r.getFn,fieldNormWeight:b=r.fieldNormWeight}={}){this.norm=function(a=1,b=3){let c=new Map,d=Math.pow(10,b);return{get(b){let e=b.match(s).length;if(c.has(e))return c.get(e);let f=parseFloat(Math.round(1/Math.pow(e,.5*a)*d)/d);return c.set(e,f),f},clear(){c.clear()}}}(b,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((a,b)=>{this._keysMap[a.id]=b})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,g(this.docs[0])?this.docs.forEach((a,b)=>{this._addString(a,b)}):this.docs.forEach((a,b)=>{this._addObject(a,b)}),this.norm.clear())}add(a){let b=this.size();g(a)?this._addString(a,b):this._addObject(a,b)}removeAt(a){this.records.splice(a,1);for(let b=a,c=this.size();b<c;b+=1)this.records[b].i-=1}getValueForItemAtKeyId(a,b){return a[this._keysMap[b]]}size(){return this.records.length}_addString(a,b){if(!j(a)||k(a))return;let c={v:a,i:b,n:this.norm.get(a)};this.records.push(c)}_addObject(a,b){let c={i:b,$:{}};this.keys.forEach((b,d)=>{let f=b.getFn?b.getFn(a):this.getFn(a,b.path);if(j(f)){if(e(f)){let a=[],b=[{nestedArrIndex:-1,value:f}];for(;b.length;){let{nestedArrIndex:c,value:d}=b.pop();if(j(d))if(g(d)&&!k(d)){let b={v:d,i:c,n:this.norm.get(d)};a.push(b)}else e(d)&&d.forEach((a,c)=>{b.push({nestedArrIndex:c,value:a})})}c.$[d]=a}else if(g(f)&&!k(f)){let a={v:f,n:this.norm.get(f)};c.$[d]=a}}}),this.records.push(c)}toJSON(){return{keys:this.keys,records:this.records}}}function u(a,b,{getFn:c=r.getFn,fieldNormWeight:d=r.fieldNormWeight}={}){let e=new t({getFn:c,fieldNormWeight:d});return e.setKeys(a.map(o)),e.setSources(b),e.create(),e}function v(a,{errors:b=0,currentLocation:c=0,expectedLocation:d=0,distance:e=r.distance,ignoreLocation:f=r.ignoreLocation}={}){let g=b/a.length;if(f)return g;let h=Math.abs(d-c);return e?g+h/e:h?1:g}let w=String.prototype.normalize?a=>a.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):a=>a;class x{constructor(a,{location:b=r.location,threshold:c=r.threshold,distance:d=r.distance,includeMatches:e=r.includeMatches,findAllMatches:f=r.findAllMatches,minMatchCharLength:g=r.minMatchCharLength,isCaseSensitive:h=r.isCaseSensitive,ignoreDiacritics:i=r.ignoreDiacritics,ignoreLocation:j=r.ignoreLocation}={}){if(this.options={location:b,threshold:c,distance:d,includeMatches:e,findAllMatches:f,minMatchCharLength:g,isCaseSensitive:h,ignoreDiacritics:i,ignoreLocation:j},a=h?a:a.toLowerCase(),a=i?w(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;let k=(a,b)=>{this.chunks.push({pattern:a,alphabet:function(a){let b={};for(let c=0,d=a.length;c<d;c+=1){let e=a.charAt(c);b[e]=(b[e]||0)|1<<d-c-1}return b}(a),startIndex:b})},l=this.pattern.length;if(l>32){let a=0,b=l%32,c=l-b;for(;a<c;)k(this.pattern.substr(a,32),a),a+=32;if(b){let a=l-32;k(this.pattern.substr(a),a)}}else k(this.pattern,0)}searchIn(a){let{isCaseSensitive:b,ignoreDiacritics:c,includeMatches:d}=this.options;if(a=b?a:a.toLowerCase(),a=c?w(a):a,this.pattern===a){let b={isMatch:!0,score:0};return d&&(b.indices=[[0,a.length-1]]),b}let{location:e,distance:f,threshold:g,findAllMatches:h,minMatchCharLength:i,ignoreLocation:j}=this.options,k=[],l=0,m=!1;this.chunks.forEach(({pattern:b,alphabet:c,startIndex:n})=>{let{isMatch:o,score:p,indices:q}=function(a,b,c,{location:d=r.location,distance:e=r.distance,threshold:f=r.threshold,findAllMatches:g=r.findAllMatches,minMatchCharLength:h=r.minMatchCharLength,includeMatches:i=r.includeMatches,ignoreLocation:j=r.ignoreLocation}={}){let k;if(b.length>32)throw Error("Pattern length exceeds max of 32.");let l=b.length,m=a.length,n=Math.max(0,Math.min(d,m)),o=f,p=n,q=h>1||i,s=q?Array(m):[];for(;(k=a.indexOf(b,p))>-1;)if(o=Math.min(v(b,{currentLocation:k,expectedLocation:n,distance:e,ignoreLocation:j}),o),p=k+l,q){let a=0;for(;a<l;)s[k+a]=1,a+=1}p=-1;let t=[],u=1,w=l+m,x=1<<l-1;for(let d=0;d<l;d+=1){let f=0,h=w;for(;f<h;)v(b,{errors:d,currentLocation:n+h,expectedLocation:n,distance:e,ignoreLocation:j})<=o?f=h:w=h,h=Math.floor((w-f)/2+f);w=h;let i=Math.max(1,n-h+1),k=g?m:Math.min(n+h,m)+l,r=Array(k+2);r[k+1]=(1<<d)-1;for(let f=k;f>=i;f-=1){let g=f-1,h=c[a.charAt(g)];if(q&&(s[g]=+!!h),r[f]=(r[f+1]<<1|1)&h,d&&(r[f]|=(t[f+1]|t[f])<<1|1|t[f+1]),r[f]&x&&(u=v(b,{errors:d,currentLocation:g,expectedLocation:n,distance:e,ignoreLocation:j}))<=o){if(o=u,(p=g)<=n)break;i=Math.max(1,2*n-p)}}if(v(b,{errors:d+1,currentLocation:n,expectedLocation:n,distance:e,ignoreLocation:j})>o)break;t=r}let y={isMatch:p>=0,score:Math.max(.001,u)};if(q){let a=function(a=[],b=r.minMatchCharLength){let c=[],d=-1,e=-1,f=0;for(let g=a.length;f<g;f+=1){let g=a[f];g&&-1===d?d=f:g||-1===d||((e=f-1)-d+1>=b&&c.push([d,e]),d=-1)}return a[f-1]&&f-d>=b&&c.push([d,f-1]),c}(s,h);a.length?i&&(y.indices=a):y.isMatch=!1}return y}(a,b,c,{location:e+n,distance:f,threshold:g,findAllMatches:h,minMatchCharLength:i,includeMatches:d,ignoreLocation:j});o&&(m=!0),l+=p,o&&q&&(k=[...k,...q])});let n={isMatch:m,score:m?l/this.chunks.length:1};return m&&d&&(n.indices=k),n}}class y{constructor(a){this.pattern=a}static isMultiMatch(a){return z(a,this.multiRegex)}static isSingleMatch(a){return z(a,this.singleRegex)}search(){}}function z(a,b){let c=a.match(b);return c?c[1]:null}class A extends y{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){let b=a===this.pattern;return{isMatch:b,score:+!b,indices:[0,this.pattern.length-1]}}}class B extends y{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){let b=-1===a.indexOf(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class C extends y{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){let b=a.startsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,this.pattern.length-1]}}}class D extends y{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){let b=!a.startsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class E extends y{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){let b=a.endsWith(this.pattern);return{isMatch:b,score:+!b,indices:[a.length-this.pattern.length,a.length-1]}}}class F extends y{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){let b=!a.endsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class G extends y{constructor(a,{location:b=r.location,threshold:c=r.threshold,distance:d=r.distance,includeMatches:e=r.includeMatches,findAllMatches:f=r.findAllMatches,minMatchCharLength:g=r.minMatchCharLength,isCaseSensitive:h=r.isCaseSensitive,ignoreDiacritics:i=r.ignoreDiacritics,ignoreLocation:j=r.ignoreLocation}={}){super(a),this._bitapSearch=new x(a,{location:b,threshold:c,distance:d,includeMatches:e,findAllMatches:f,minMatchCharLength:g,isCaseSensitive:h,ignoreDiacritics:i,ignoreLocation:j})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class H extends y{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let b,c=0,d=[],e=this.pattern.length;for(;(b=a.indexOf(this.pattern,c))>-1;)c=b+e,d.push([b,c-1]);let f=!!d.length;return{isMatch:f,score:+!f,indices:d}}}let I=[A,H,C,D,F,E,B,G],J=I.length,K=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,L=new Set([G.type,H.type]);class M{constructor(a,{isCaseSensitive:b=r.isCaseSensitive,ignoreDiacritics:c=r.ignoreDiacritics,includeMatches:d=r.includeMatches,minMatchCharLength:e=r.minMatchCharLength,ignoreLocation:f=r.ignoreLocation,findAllMatches:g=r.findAllMatches,location:h=r.location,threshold:i=r.threshold,distance:j=r.distance}={}){this.query=null,this.options={isCaseSensitive:b,ignoreDiacritics:c,includeMatches:d,minMatchCharLength:e,findAllMatches:g,ignoreLocation:f,location:h,threshold:i,distance:j},a=b?a:a.toLowerCase(),a=c?w(a):a,this.pattern=a,this.query=function(a,b={}){return a.split("|").map(a=>{let c=a.trim().split(K).filter(a=>a&&!!a.trim()),d=[];for(let a=0,e=c.length;a<e;a+=1){let e=c[a],f=!1,g=-1;for(;!f&&++g<J;){let a=I[g],c=a.isMultiMatch(e);c&&(d.push(new a(c,b)),f=!0)}if(!f)for(g=-1;++g<J;){let a=I[g],c=a.isSingleMatch(e);if(c){d.push(new a(c,b));break}}}return d})}(this.pattern,this.options)}static condition(a,b){return b.useExtendedSearch}searchIn(a){let b=this.query;if(!b)return{isMatch:!1,score:1};let{includeMatches:c,isCaseSensitive:d,ignoreDiacritics:e}=this.options;a=d?a:a.toLowerCase(),a=e?w(a):a;let f=0,g=[],h=0;for(let d=0,e=b.length;d<e;d+=1){let e=b[d];g.length=0,f=0;for(let b=0,d=e.length;b<d;b+=1){let d=e[b],{isMatch:i,indices:j,score:k}=d.search(a);if(i){if(f+=1,h+=k,c){let a=d.constructor.type;L.has(a)?g=[...g,...j]:g.push(j)}}else{h=0,f=0,g.length=0;break}}if(f){let a={isMatch:!0,score:h/f};return c&&(a.indices=g),a}}return{isMatch:!1,score:1}}}let N=[];function O(a,b){for(let c=0,d=N.length;c<d;c+=1){let d=N[c];if(d.condition(a,b))return new d(a,b)}return new x(a,b)}let P={AND:"$and",OR:"$or"},Q={PATH:"$path",PATTERN:"$val"},R=a=>!!(a[P.AND]||a[P.OR]),S=a=>({[P.AND]:Object.keys(a).map(b=>({[b]:a[b]}))});function T(a,b,{auto:c=!0}={}){let d=a=>{let f=Object.keys(a),h=!!a[Q.PATH];if(!h&&f.length>1&&!R(a))return d(S(a));if(!e(a)&&i(a)&&!R(a)){let d=h?a[Q.PATH]:f[0],e=h?a[Q.PATTERN]:a[d];if(!g(e))throw Error(`Invalid value for key ${d}`);let i={keyId:q(d),pattern:e};return c&&(i.searcher=O(e,b)),i}let j={children:[],operator:f[0]};return f.forEach(b=>{let c=a[b];e(c)&&c.forEach(a=>{j.children.push(d(a))})}),j};return R(a)||(a=S(a)),d(a)}function U(a,b){let c=a.matches;b.matches=[],j(c)&&c.forEach(a=>{if(!j(a.indices)||!a.indices.length)return;let{indices:c,value:d}=a,e={indices:c,value:d};a.key&&(e.key=a.key.src),a.idx>-1&&(e.refIndex=a.idx),b.matches.push(e)})}function V(a,b){b.score=a.score}class W{constructor(a,b={},c){this.options={...r,...b},this.options.useExtendedSearch,this._keyStore=new n(this.options.keys),this.setCollection(a,c)}setCollection(a,b){if(this._docs=a,b&&!(b instanceof t))throw Error("Incorrect 'index' type");this._myIndex=b||u(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){j(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){let b=[];for(let c=0,d=this._docs.length;c<d;c+=1){let e=this._docs[c];a(e,c)&&(this.removeAt(c),c-=1,d-=1,b.push(e))}return b}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:b=-1}={}){let{includeMatches:c,includeScore:d,shouldSort:e,sortFn:f,ignoreFieldNorm:i}=this.options,j=g(a)?g(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return!function(a,{ignoreFieldNorm:b=r.ignoreFieldNorm}){a.forEach(a=>{let c=1;a.matches.forEach(({key:a,norm:d,score:e})=>{let f=a?a.weight:null;c*=Math.pow(0===e&&f?Number.EPSILON:e,(f||1)*(b?1:d))}),a.score=c})}(j,{ignoreFieldNorm:i}),e&&j.sort(f),h(b)&&b>-1&&(j=j.slice(0,b)),function(a,b,{includeMatches:c=r.includeMatches,includeScore:d=r.includeScore}={}){let e=[];return c&&e.push(U),d&&e.push(V),a.map(a=>{let{idx:c}=a,d={item:b[c],refIndex:c};return e.length&&e.forEach(b=>{b(a,d)}),d})}(j,this._docs,{includeMatches:c,includeScore:d})}_searchStringList(a){let b=O(a,this.options),{records:c}=this._myIndex,d=[];return c.forEach(({v:a,i:c,n:e})=>{if(!j(a))return;let{isMatch:f,score:g,indices:h}=b.searchIn(a);f&&d.push({item:a,idx:c,matches:[{score:g,value:a,norm:e,indices:h}]})}),d}_searchLogical(a){let b=T(a,this.options),c=(a,b,d)=>{if(!a.children){let{keyId:c,searcher:e}=a,f=this._findMatches({key:this._keyStore.get(c),value:this._myIndex.getValueForItemAtKeyId(b,c),searcher:e});return f&&f.length?[{idx:d,item:b,matches:f}]:[]}let e=[];for(let f=0,g=a.children.length;f<g;f+=1){let g=c(a.children[f],b,d);if(g.length)e.push(...g);else if(a.operator===P.AND)return[]}return e},d=this._myIndex.records,e={},f=[];return d.forEach(({$:a,i:d})=>{if(j(a)){let g=c(b,a,d);g.length&&(e[d]||(e[d]={idx:d,item:a,matches:[]},f.push(e[d])),g.forEach(({matches:a})=>{e[d].matches.push(...a)}))}}),f}_searchObjectList(a){let b=O(a,this.options),{keys:c,records:d}=this._myIndex,e=[];return d.forEach(({$:a,i:d})=>{if(!j(a))return;let f=[];c.forEach((c,d)=>{f.push(...this._findMatches({key:c,value:a[d],searcher:b}))}),f.length&&e.push({idx:d,item:a,matches:f})}),e}_findMatches({key:a,value:b,searcher:c}){if(!j(b))return[];let d=[];if(e(b))b.forEach(({v:b,i:e,n:f})=>{if(!j(b))return;let{isMatch:g,score:h,indices:i}=c.searchIn(b);g&&d.push({score:h,key:a,value:b,idx:e,norm:f,indices:i})});else{let{v:e,n:f}=b,{isMatch:g,score:h,indices:i}=c.searchIn(e);g&&d.push({score:h,key:a,value:e,norm:f,indices:i})}return d}}W.version="7.1.0",W.createIndex=u,W.parseIndex=function(a,{getFn:b=r.getFn,fieldNormWeight:c=r.fieldNormWeight}={}){let{keys:d,records:e}=a,f=new t({getFn:b,fieldNormWeight:c});return f.setKeys(d),f.setIndexRecords(e),f},W.config=r,W.parseQuery=T,function(...a){N.push(...a)}(M);let X={keys:[{name:"label",weight:3},{name:"sublabel",weight:1},{name:"objectName",weight:1.5},{name:"fieldValues",weight:2}],threshold:.4,distance:200,includeScore:!0,shouldSort:!0,minMatchCharLength:1};function Y(a){let[b,c]=(0,d.useState)([]),[e,f]=(0,d.useState)(!0),g=(0,d.useRef)(!0);(0,d.useCallback)(async()=>{try{let a=await fetch("/api/workspace/search-index"),b=await a.json();g.current&&(c(b.items??[]),f(!1))}catch{g.current&&f(!1)}},[]);let h=(0,d.useMemo)(()=>0===b.length?null:new W(b.map(a=>({...a,fieldValues:a.fields?Object.values(a.fields).join(" "):void 0})),X),[b]),i=(0,d.useCallback)((a,c=20)=>a.trim()?h?h.search(a,{limit:c}).map(a=>a.item):[]:[...b].toSorted((a,b)=>{let c={object:0,file:1,entry:2};return(c[a.kind]??9)-(c[b.kind]??9)}).slice(0,c),[h,b]),j=(0,d.useRef)(i);return j.current=i,{items:b,loading:e,search:(0,d.useCallback)((a,b)=>j.current(a,b),[])}}},681560:(a,b,c)=>{"use strict";c.d(b,{I:()=>n});var d=c(736927),e=c(115962),f=c(681713),g=c(612563),h=c(379924),i=c(18886),j=c(130526);function k(a){return null==a?"":"string"==typeof a?a:"number"==typeof a||"boolean"==typeof a||"bigint"==typeof a?String(a):"object"==typeof a?JSON.stringify(a):""}function l({entry:a,fields:b,titleField:c,coverField:l,onEntryClick:m}){let n=k(a.entry_id??a.id),o=function(a,b,c){if(c){let b=k(a[c]);if(b)return b}let d=b.find(a=>"text"===a.type&&/name|title/i.test(a.name))??b.find(a=>"text"===a.type);return d?k(a[d.name]):k(a.id)}(a,b,c),p=(0,j.I)(a,b),q=(0,e.useMemo)(()=>b.filter(a=>a.name!==c&&a.name!==l).slice(0,4),[b,c,l]),r=b.find(a=>"enum"===a.type&&a.enum_values?.length),s=r?k(a[r.name]):null,t=r&&s?function(a,b){if(!a||!b.enum_values)return null;let c=b.enum_values.indexOf(a);return{text:a,color:c>=0&&b.enum_colors?.[c]?b.enum_colors[c]:"#94a3b8"}}(s,r):null;return(0,d.jsxs)("button",{type:"button",onClick:()=>m?.(n),className:"text-left rounded-xl border p-4 hover:shadow-md transition-all cursor-pointer w-full group",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[p?.faviconUrl&&(0,d.jsx)(i.A,{src:p.faviconUrl,className:"w-4 h-4 rounded-[4px] shrink-0 mt-0.5"}),(0,d.jsx)("h4",{className:"text-[13px] font-semibold leading-tight line-clamp-2 group-hover:underline",style:{color:"var(--color-text)"},children:o||"Untitled"})]}),t&&(0,d.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full flex-shrink-0 whitespace-nowrap",style:{backgroundColor:t.color,color:"#fff"},children:t.text})]}),(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:q.map(b=>{let c=a[b.name];if(null==c||""===k(c))return null;let e="tags"===b.type?(0,h.k)(c):[];return(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("span",{className:"text-[10px] flex-shrink-0 min-w-[60px]",style:{color:"var(--color-text-muted)"},children:b.name}),(0,d.jsx)("div",{className:"text-[12px] whitespace-pre-line line-clamp-2",style:{color:"var(--color-text)"},children:"tags"===b.type?(0,d.jsxs)("span",{className:"flex items-center gap-0.5 flex-wrap",children:[e.slice(0,3).map(a=>{let b=(0,g.KJ)(a),c="link"===b.kind&&b.href,e="url"===b.linkType&&!!b.faviconUrl;return c?(0,d.jsxs)("a",{href:b.href,target:"url"===b.linkType||"file"===b.linkType?"_blank":void 0,rel:"url"===b.linkType||"file"===b.linkType?"noopener noreferrer":void 0,onClick:a=>a.stopPropagation(),className:"inline-flex items-center gap-1 px-1.5 py-0 rounded text-[11px] font-medium hover:underline underline-offset-2 max-w-[220px]",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-accent)"},children:[e&&(0,d.jsx)(i.A,{src:b.faviconUrl,className:"w-3 h-3 rounded-[2px] shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:b.text})]},a):(0,d.jsx)("span",{className:"inline-flex items-center px-1.5 py-0 rounded text-[11px] font-medium",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-text-muted)"},children:a},a)}),e.length>3&&(0,d.jsxs)("span",{className:"text-[10px]",style:{color:"var(--color-text-muted)"},children:["+",e.length-3]})]}):(0,d.jsx)(f.E,{value:c,fieldType:b.type,mode:"table",showUrlFavicon:!0})})]},b.id)})}),null!=a.created_at&&(0,d.jsx)("div",{className:"mt-3 text-[10px]",style:{color:"var(--color-text-muted)",opacity:.6},children:k(a.created_at).slice(0,10)})]})}function m(){return(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 gap-2",children:[(0,d.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",style:{color:"var(--color-text-muted)",opacity:.4},children:[(0,d.jsx)("rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"})]}),(0,d.jsx)("span",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"No entries to display in gallery view."})]})}function n({objectName:a,fields:b,entries:c,titleField:e,coverField:f,members:g,relationLabels:h,onEntryClick:i}){return 0===c.length?(0,d.jsx)(m,{}):(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:c.map(a=>(0,d.jsx)(l,{entry:a,fields:b,titleField:e,coverField:f,onEntryClick:i},k(a.entry_id??a.id)))})}},681713:(a,b,c)=>{"use strict";c.d(b,{E:()=>m});var d=c(736927),e=c(115962),f=c(612563),g=c(18886),h=c(545182),i=c(888973);function j(){return(0,d.jsx)("span",{style:{color:"var(--color-text-muted)",opacity:.5},children:"--"})}function k({mediaType:a,url:b,label:c}){return"image"===a?(0,d.jsx)("div",{className:"mt-2 rounded-lg overflow-hidden border",style:{borderColor:"var(--color-border)"},children:(0,d.jsx)("img",{src:b,alt:c,className:"max-h-64 w-auto"})}):"video"===a?(0,d.jsx)("video",{src:b,controls:!0,className:"mt-2 w-full max-h-72 rounded-lg border",style:{borderColor:"var(--color-border)",background:"#000"}}):"audio"===a?(0,d.jsx)("audio",{src:b,controls:!0,className:"mt-2 w-full"}):(0,d.jsx)("iframe",{src:`${b}#toolbar=0&navpanes=0&scrollbar=1`,title:c,className:"mt-2 w-full h-72 rounded-lg border",style:{borderColor:"var(--color-border)",background:"white"}})}function l({text:a,fieldType:b,showUrlFavicon:c=!1,linkInteractionMode:e="inline",isTableMode:j=!1}){let k=a.trim();if(!k)return(0,d.jsx)(d.Fragment,{children:a});let l=b&&"text"!==b&&"richtext"!==b?b:void 0,m=(0,f.KJ)(k,l);if("link"===m.kind&&m.href){if(!l&&"file"===m.linkType&&k.includes(" "))return(0,d.jsx)(d.Fragment,{children:m.text});let a="url"===m.linkType||"file"===m.linkType,b=c&&"url"===m.linkType&&!!m.faviconUrl;if("button"===e){let c=(0,d.jsxs)("span",{className:"inline-flex min-w-0 max-w-full items-center gap-1.5 align-middle",style:{color:"var(--color-accent)"},children:[b&&(0,d.jsx)(g.A,{src:m.faviconUrl}),(0,d.jsx)("span",{className:j?"min-w-0 truncate":"min-w-0 break-all",children:m.text}),(0,d.jsx)(h.x,{href:m.href,openInNewTab:a,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm hover:bg-black/5"})]});return"url"===m.linkType?(0,d.jsx)(i.k,{href:m.href,children:c}):c}return(0,d.jsx)(i.U,{href:m.href,text:m.text,linkType:m.linkType??"url",faviconUrl:m.faviconUrl,showFavicon:b})}return"number"===m.kind||"currency"===m.kind?(0,d.jsx)("span",{className:"tabular-nums",children:m.text}):(0,d.jsx)(d.Fragment,{children:m.text})}function m({value:a,fieldType:b,mode:c="table",className:m,showUrlFavicon:n=!1,linkInteractionMode:o="inline"}){let p=(0,f.KJ)(a,b),q="table"===c;if("empty"===p.kind)return(0,d.jsx)(j,{});let r=p.text.replace(/\\r\\n/g,"\n").replace(/\\n/g,"\n").replace(/\\r/g,"\n");if(r.includes("\n")){let a=r.split("\n"),c=m??(q?"block max-w-[300px] line-clamp-3":"break-words");return(0,d.jsx)("span",{className:c,children:a.map((a,c)=>(0,d.jsxs)(e.Fragment,{children:[c>0&&(0,d.jsx)("br",{}),(0,d.jsx)(l,{text:a,fieldType:b,showUrlFavicon:n,linkInteractionMode:o,isTableMode:q})]},c))})}let s=m??(q?"truncate block max-w-[300px]":"break-words");if("link"===p.kind&&p.href){let a="url"===p.linkType||"file"===p.linkType,b=!q&&!!p.embedUrl&&!!p.mediaType,c=n&&"url"===p.linkType&&!!p.faviconUrl;if("button"===o){let e=(0,d.jsxs)("div",{className:q?"block max-w-[300px]":"w-full",children:[(0,d.jsxs)("span",{className:"flex w-full min-w-0 items-center gap-1.5",style:{color:"var(--color-accent)"},children:[c&&(0,d.jsx)(g.A,{src:p.faviconUrl}),(0,d.jsx)("span",{className:q?"min-w-0 truncate":"min-w-0 break-all",children:p.text}),(0,d.jsx)(h.x,{href:p.href,openInNewTab:a})]}),b&&(0,d.jsx)(k,{mediaType:p.mediaType,url:p.embedUrl,label:p.text})]});return"url"===p.linkType?(0,d.jsx)(i.k,{href:p.href,children:e}):e}return(0,d.jsxs)("div",{className:q?"block max-w-[300px]":"w-full",children:[(0,d.jsx)(i.U,{href:p.href,text:p.text,linkType:p.linkType??"url",faviconUrl:p.faviconUrl,showFavicon:c,layout:"block",className:q?"truncate":""}),b&&(0,d.jsx)(k,{mediaType:p.mediaType,url:p.embedUrl,label:p.text})]})}return"number"===p.kind||"currency"===p.kind?(0,d.jsx)("span",{className:`tabular-nums ${s}`,children:p.text}):(0,d.jsx)("span",{className:s,children:r})}},685233:(a,b,c)=>{"use strict";c.d(b,{X:()=>a6,S:()=>a7});var d=c(736927),e=c(115962),f=c(213505),g=c(492081),h=c(755726),i=c(922123),j=c(478105),k=c(363269),l=c(515016),m=c(558287),n=c(631608),o=c(846069),p=c(744277),q=c(68200),r=c(316780),s=c(398367),t=c(405287),u=c(587464),v=c(173961),w=c(760687),x=c(840512);let y=e.createContext(void 0),z=e.createContext(void 0),A=e.createContext(void 0),B=e.createContext("");function C(){let a=e.useContext(y);if(!a)throw Error((0,x.A)(22));return a}function D(){let a=e.useContext(z);if(!a)throw Error((0,x.A)(23));return a}function E(){let a=e.useContext(A);if(!a)throw Error((0,x.A)(24));return a}var F=c(569869);let G=(a,b)=>Object.is(a,b);function H(a,b,c){return null==a||null==b?Object.is(a,b):c(a,b)}function I(a,b,c){return a&&0!==a.length?a.findIndex(a=>void 0!==a&&H(a,b,c)):-1}function J(a){if(null==a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function K(a){return null!=a&&a.length>0&&"object"==typeof a[0]&&null!=a[0]&&"items"in a[0]}function L(a,b){if(b&&null!=a)return b(a)??"";if(a&&"object"==typeof a){if("label"in a&&null!=a.label)return String(a.label);if("value"in a)return String(a.value)}return J(a)}function M(a,b){return b&&null!=a?b(a)??"":a&&"object"==typeof a&&"value"in a&&"label"in a?J(a.value):J(a)}let N={id:(0,F.M)(a=>a.id),query:(0,F.M)(a=>a.query),items:(0,F.M)(a=>a.items),selectedValue:(0,F.M)(a=>a.selectedValue),hasSelectionChips:(0,F.M)(a=>{let b=a.selectedValue;return Array.isArray(b)&&b.length>0}),hasSelectedValue:(0,F.M)(a=>{let{selectedValue:b,selectionMode:c}=a;return null!=b&&(!("multiple"===c&&Array.isArray(b))||b.length>0)}),hasNullItemLabel:(0,F.M)((a,b)=>!!b&&function(a){if(!Array.isArray(a))return null!=a&&!("null"in a);if(K(a)){for(let b of a)for(let a of b.items)if(a&&null==a.value&&null!=a.label)return!0;return!1}for(let b of a)if(b&&null==b.value&&null!=b.label)return!0;return!1}(a.items)),open:(0,F.M)(a=>a.open),mounted:(0,F.M)(a=>a.mounted),forceMounted:(0,F.M)(a=>a.forceMounted),inline:(0,F.M)(a=>a.inline),activeIndex:(0,F.M)(a=>a.activeIndex),selectedIndex:(0,F.M)(a=>a.selectedIndex),isActive:(0,F.M)((a,b)=>a.activeIndex===b),isSelected:(0,F.M)((a,b)=>{let c=a.isItemEqualToValue,d=a.selectedValue;return Array.isArray(d)?d.some(a=>H(b,a,c)):H(b,d,c)}),transitionStatus:(0,F.M)(a=>a.transitionStatus),popupProps:(0,F.M)(a=>a.popupProps),inputProps:(0,F.M)(a=>a.inputProps),triggerProps:(0,F.M)(a=>a.triggerProps),getItemProps:(0,F.M)(a=>a.getItemProps),positionerElement:(0,F.M)(a=>a.positionerElement),listElement:(0,F.M)(a=>a.listElement),triggerElement:(0,F.M)(a=>a.triggerElement),inputElement:(0,F.M)(a=>a.inputElement),popupSide:(0,F.M)(a=>a.popupSide),openMethod:(0,F.M)(a=>a.openMethod),inputInsidePopup:(0,F.M)(a=>a.inputInsidePopup),selectionMode:(0,F.M)(a=>a.selectionMode),listRef:(0,F.M)(a=>a.listRef),labelsRef:(0,F.M)(a=>a.labelsRef),popupRef:(0,F.M)(a=>a.popupRef),emptyRef:(0,F.M)(a=>a.emptyRef),inputRef:(0,F.M)(a=>a.inputRef),keyboardActiveRef:(0,F.M)(a=>a.keyboardActiveRef),chipsContainerRef:(0,F.M)(a=>a.chipsContainerRef),clearRef:(0,F.M)(a=>a.clearRef),valuesRef:(0,F.M)(a=>a.valuesRef),allValuesRef:(0,F.M)(a=>a.allValuesRef),name:(0,F.M)(a=>a.name),disabled:(0,F.M)(a=>a.disabled),readOnly:(0,F.M)(a=>a.readOnly),required:(0,F.M)(a=>a.required),grid:(0,F.M)(a=>a.grid),isGrouped:(0,F.M)(a=>a.isGrouped),virtualized:(0,F.M)(a=>a.virtualized),onOpenChangeComplete:(0,F.M)(a=>a.onOpenChangeComplete),openOnInputClick:(0,F.M)(a=>a.openOnInputClick),itemToStringLabel:(0,F.M)(a=>a.itemToStringLabel),isItemEqualToValue:(0,F.M)(a=>a.isItemEqualToValue),modal:(0,F.M)(a=>a.modal),autoHighlight:(0,F.M)(a=>a.autoHighlight),submitOnItemClick:(0,F.M)(a=>a.submitOnItemClick)};var O=c(230652),P=c(577225);let Q=function(a){return a.disabled="data-disabled",a.valid="data-valid",a.invalid="data-invalid",a.touched="data-touched",a.dirty="data-dirty",a.filled="data-filled",a.focused="data-focused",a}({}),R=e.createContext({invalid:void 0,name:void 0,validityData:{state:{badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},errors:[],error:"",value:"",initialValue:null},setValidityData:P.tE,disabled:void 0,touched:!1,setTouched:P.tE,dirty:!1,setDirty:P.tE,filled:!1,setFilled:P.tE,focused:!1,setFocused:P.tE,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(a=P.t0)=>a,getInputValidationProps:(a=P.t0)=>a,inputRef:{current:null},commit:async()=>{}}});function S(a=!0){let b=e.useContext(R);if(b.setValidityData===P.tE&&!a)throw Error((0,x.A)(28));return b}var T=c(249855);let U=e.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:P.tE,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function V(){return e.useContext(U)}var W=c(725427),X=c(840507);let Y=e.createContext({controlId:void 0,registerControlId:P.tE,labelId:void 0,setLabelId:P.tE,messageIds:[],setMessageIds:P.tE,getDescriptionProps:a=>a});function Z(){return e.useContext(Y)}let _=new Map;var aa=c(735328),ab=c(192083);function ac(a,b){let c=e.useRef(a),d=(0,i.K)(b);(0,g.g)(()=>{c.current!==a&&d(c.current)},[a,d]),(0,g.g)(()=>{c.current=a},[a])}let ad=Symbol("none"),ae={value:ad,index:-1};function af(a){let b,c,x,{id:C,onOpenChangeComplete:D,defaultSelectedValue:E=null,selectedValue:F,onSelectedValueChange:J,defaultInputValue:Q,inputValue:R,selectionMode:U="none",onItemHighlighted:Y,name:af,disabled:ag=!1,readOnly:ah=!1,required:ai=!1,inputRef:aj,grid:ak=!1,items:al,filteredItems:am,filter:an,openOnInputClick:ao=!0,autoHighlight:ap=!1,keepHighlight:aq=!1,highlightItemOnHover:ar=!0,loopFocus:as=!0,itemToStringLabel:at,itemToStringValue:au,isItemEqualToValue:av=G,virtualized:aw=!1,inline:ax=!1,fillInputOnItemPress:ay=!0,modal:az=!1,limit:aA=-1,autoComplete:aB="list",formAutoComplete:aC,locale:aD,submitOnItemClick:aE=!1}=a,{clearErrors:aF}=V(),{setDirty:aG,validityData:aH,shouldValidateOnChange:aI,setFilled:aJ,name:aK,disabled:aL,setTouched:aM,setFocused:aN,validationMode:aO,validation:aP}=S(),aQ=function(a={}){let{id:b,implicit:c=!1,controlRef:d}=a,{controlId:f,registerControlId:h}=Z(),j=(0,X.e)(b),k=c?f:void 0,m=(0,l.j)(()=>Symbol("labelable-control")),n=e.useRef(!1),o=e.useRef(null!=b),p=(0,i.K)(()=>{n.current&&h!==P.tE&&(n.current=!1,h(m.current,void 0))});return(0,g.g)(()=>{let a;if(h!==P.tE){if(c){let c=d?.current;a=(0,W.vq)(c)&&null!=c.closest("label")?b??null:k??j}else if(null!=b)o.current=!0,a=b;else{if(!o.current)return void p();a=j}if(void 0===a)return void p();n.current=!0,h(m.current,a)}},[b,d,k,h,c,j,m,p]),e.useEffect(()=>p,[p]),f??j}({id:C}),aR=function(a={}){let b={usage:"search",sensitivity:"base",ignorePunctuation:!0,...a},c=`${function a(b){return Array.isArray(b)?b.map(b=>a(b)).join(","):null==b?"":String(b)}(a.locale)}|${JSON.stringify(b)}`,d=_.get(c);if(d)return d;let e=new Intl.Collator(a.locale,b),f={contains(a,b,c){if(!b)return!0;let d=L(a,c);for(let a=0;a<=d.length-b.length;a+=1)if(0===e.compare(d.slice(a,a+b.length),b))return!0;return!1},startsWith(a,b,c){if(!b)return!0;let d=L(a,c);return 0===e.compare(d.slice(0,b.length),b)},endsWith(a,b,c){if(!b)return!0;let d=L(a,c),f=b.length;return d.length>=f&&0===e.compare(d.slice(d.length-f),b)}};return _.set(c,f),f}({locale:aD}),[aS,aT]=e.useState(!1),[aU,aV]=e.useState(null),aW=e.useRef([]),aX=e.useRef([]),aY=e.useRef(null),aZ=e.useRef(null),a$=e.useRef(null),a_=e.useRef(!0),a0=e.useRef(!1),a1=e.useRef(null),a2=e.useRef(null),a3=e.useRef(null),a4=e.useRef(ae),a5=e.useRef(null),a6=e.useRef([]),a7=e.useRef([]),a8=aL||ag,a9=aK??af,ba="multiple"===U,bb="single"===U,bc=void 0!==R||void 0!==Q,bd=void 0!==al,be=void 0!==am;b="always"===ap?"always":!!ap&&"input-change";let[bf,bg]=(0,f.q)({controlled:F,default:ba?E??P.Ml:E,name:"Combobox",state:"selectedValue"}),bh=e.useMemo(()=>null===an?()=>!0:void 0!==an?an:bb&&!aS?(a,b)=>{if(null==a)return!1;if(!b)return!0;let c=L(a,at),d=null!=bf?L(bf,at):"";return!!(d&&aR.contains(d,b))&&d.length===b.length||aR.contains(c,b)}:(a,b)=>{if(null==a)return!1;let c=L(a,at);return aR.contains(c,b)},[an,bb,bf,aS,aR,at]),bi=(0,l.j)(()=>bc?Q??"":bb?L(bf,at):"").current,[bj,bk]=(0,f.q)({controlled:R,default:bi,name:"Combobox",state:"inputValue"}),[bl,bm]=(0,f.q)({controlled:a.open,default:a.defaultOpen,name:"Combobox",state:"open"}),bn=K(al),bo=aU??(""===bj?"":String(bj).trim()),bp=bb?L(bf,at):"",bq=bb&&!aS&&""!==bo&&""!==bp&&bp.length===bo.length&&aR.contains(bp,bo),br=bq?"":bo,bs=bd&&be&&bq,bt=e.useMemo(()=>al?bn?al.flatMap(a=>a.items):al:P.Ml,[al,bn]),bu=e.useMemo(()=>{if(am&&!bs)return am;if(!al)return P.Ml;if(bn){let a=[],b=0;for(let c of al){if(aA>-1&&b>=aA)break;let d=""===br?c.items:c.items.filter(a=>bh(a,br,at));if(0===d.length)continue;let e=aA>-1?aA-b:1/0,f=d.slice(0,e);if(f.length>0){let d={...c,items:f};a.push(d),b+=f.length}}return a}if(""===br)return aA>-1?bt.slice(0,aA):bt;let a=[];for(let b of bt){if(aA>-1&&a.length>=aA)break;bh(b,br,at)&&a.push(b)}return a},[am,bs,al,bn,br,aA,bh,at,bt]),bv=e.useMemo(()=>bn?bu.flatMap(a=>a.items):bu,[bu,bn]),bw=(0,l.j)(()=>new m.i({id:aQ,selectedValue:bf,open:bl,filter:bh,query:bo,items:al,selectionMode:U,listRef:aW,labelsRef:aX,popupRef:aY,emptyRef:a$,inputRef:aZ,keyboardActiveRef:a_,chipsContainerRef:a1,clearRef:a2,valuesRef:a6,allValuesRef:a7,selectionEventRef:a3,name:a9,disabled:a8,readOnly:ah,required:ai,grid:ak,isGrouped:bn,virtualized:aw,openOnInputClick:ao,itemToStringLabel:at,isItemEqualToValue:av,modal:az,autoHighlight:b,submitOnItemClick:aE,hasInputValue:bc,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:ax,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:D||P.tE,setOpen:P.tE,setInputValue:P.tE,setSelectedValue:P.tE,setIndices:P.tE,onItemHighlighted:P.tE,handleSelection:P.tE,getItemProps:()=>P.t0,forceMount:P.tE,requestSubmit:P.tE})).current,bx="none"===U?bj:bf,by=e.useMemo(()=>"none"===U?bx:Array.isArray(bf)?bf.map(a=>M(a,au)):M(bf,au),[bx,au,U,bf]),bz=(0,i.K)(Y),bA=(0,i.K)(D),bB=(0,n.P)(bw,N.activeIndex),bC=(0,n.P)(bw,N.selectedIndex),bD=(0,n.P)(bw,N.positionerElement),bE=(0,n.P)(bw,N.listElement),bF=(0,n.P)(bw,N.triggerElement),bG=(0,n.P)(bw,N.inputElement),bH=(0,n.P)(bw,N.inline),bI=(0,n.P)(bw,N.inputInsidePopup),bJ=(0,o.u)(bF),{mounted:bK,setMounted:bL,transitionStatus:bM}=(0,aa.$)(bl),{openMethod:bN,triggerProps:bO,reset:bP}=(0,ab.G)(bl);!function(a){let{enabled:b=!0,value:c,id:d,name:e,controlRef:f,commit:h}=a,{formRef:j}=V(),{invalid:k,markedDirtyRef:l,validityData:m,setValidityData:n}=S(),o=(0,i.K)(a.getValue);(0,g.g)(()=>{if(!b)return;let a=c;void 0===a&&(a=o()),null===m.initialValue&&null!==a&&n(b=>({...b,initialValue:a}))},[b,n,c,m.initialValue,o]),(0,g.g)(()=>{b&&d&&j.current.fields.set(d,{getValue:o,name:e,controlRef:f,validityData:{...m,state:{...m.state,valid:!k&&m.state.valid}},validate(a=!0){let b=c;void 0===b&&(b=o()),l.current=!0,a?T.flushSync(()=>h(b)):h(b)}})},[h,f,b,j,o,d,k,l,e,m,c]),(0,g.g)(()=>{let a=j.current.fields;return()=>{d&&a.delete(d)}},[j,d])}({id:aQ,name:a9,commit:aP.commit,value:bx,controlRef:bI?bJ:aZ,getValue:()=>by});let bQ=(0,i.K)(()=>{al?aX.current=bv.map(a=>L(a,at)):bw.set("forceMounted",!0)}),bR=e.useRef(bf);(0,g.g)(()=>{bf!==bR.current&&bQ()},[bQ,bf]);let bS=(0,i.K)(a=>{bw.update(a);let b=a.type||"none";if(void 0!==a.activeIndex)if(null===a.activeIndex)a4.current!==ae&&(a4.current=ae,bz(void 0,(0,v.M)(b,void 0,{index:-1})));else{let c=a6.current[a.activeIndex];a4.current={value:c,index:a.activeIndex},bz(c,(0,v.M)(b,void 0,{index:a.activeIndex}))}}),bT=(0,i.K)((c,d)=>{if(a0.current=d.reason===w.qs,a.onInputValueChange?.(c,d),!d.isCanceled){if(d.reason===w.pf){let a=d.event,e=a.inputType;if("compositionend"===a.type||null!=e&&""!==e&&"insertReplacementText"!==e){let a=""!==c.trim();a&&aT(!0),a5.current={hasQuery:a},a&&b&&null==bw.state.activeIndex&&bw.set("activeIndex",0)}}bk(c)}}),bU=(0,i.K)((b,c)=>{if(bl!==b&&("escape-key"===c.reason&&bd&&0===bv.length&&!bw.state.emptyRef.current&&c.allowPropagation(),a.onOpenChange?.(b,c),!c.isCanceled&&(!b&&aS&&(bb?(bH||aV(bo),""===bo&&aT(!1)):ba&&(bH||bI?bS({activeIndex:null}):aV(bo),bT("",(0,v.d)(w.qs,c.event)))),bm(b),!b&&bI&&(c.reason===w.Xn||c.reason===w.Np))&&(aM(!0),aN(!1),"onBlur"===aO))){let a="none"===U?bj:bf;aP.commit(a)}}),bV=(0,i.K)((a,b)=>{J?.(a,b),!b.isCanceled&&(bg(a),("none"===U&&aY.current&&ay||bb&&!bw.state.inputInsidePopup)&&bT(L(a,at),(0,v.d)(b.reason,b.event)),bb&&null!=a&&b.reason!==w.pf&&aS&&!bH&&aV(bo))}),bW=(0,i.K)((a,b)=>{let c=b;if(void 0===c){if(null===bB)return;c=a6.current[bB]}let d=(0,u.EW)(a),e=a3.current??a;a3.current=null;let f=(0,v.d)(w.Bo,e),g=d?.closest("a")?.getAttribute("href");if(g){g.startsWith("#")&&bU(!1,f);return}if(ba){var h,i,j,k;let a=Array.isArray(bf)?bf:[];if(bV((h=c,i=bw.state.isItemEqualToValue,a&&0!==a.length&&a.some(a=>void 0!==a&&H(h,a,i)))?(j=c,k=bw.state.isItemEqualToValue,a.filter(a=>!H(j,a,k))):[...a,c],f),!(aZ.current&&""!==aZ.current.value.trim()))return;bw.state.inputInsidePopup?bT("",(0,v.d)(w.qs,f.event)):bU(!1,f)}else bV(c,f),bU(!1,f)}),bX=(0,i.K)(()=>{if(!bw.state.submitOnItemClick)return;let a=bw.state.inputElement?.form;a&&"function"==typeof a.requestSubmit&&a.requestSubmit()}),bY=(0,i.K)(()=>{if(bL(!1),bA?.(!1),aT(!1),bP(),aV(null),"none"===U?bS({activeIndex:null,selectedIndex:null}):bS({activeIndex:null}),ba&&aZ.current&&""!==aZ.current.value&&!a0.current&&bT("",(0,v.d)(w.qs)),bb)if(bw.state.inputInsidePopup)aZ.current&&""!==aZ.current.value&&bT("",(0,v.d)(w.qs));else{let a=L(bf,at);if(aZ.current&&aZ.current.value!==a){let b=""===a?w.qs:w.dv;bT(a,(0,v.d)(b))}}}),bZ=e.useMemo(()=>bH&&bD?{current:bD.closest('[role="dialog"]')}:aY,[bH,bD]);(0,O.v)({enabled:!a.actionsRef,open:bl,ref:bZ,onComplete(){bl||bY()}}),e.useImperativeHandle(a.actionsRef,()=>({unmount:bY}),[bY]),(0,g.g)(function(){if(bl||"none"===U)return;let a=al?bt:a7.current;if(ba){let b=Array.isArray(bf)?bf:[],c=I(a,b[b.length-1],av);bS({selectedIndex:-1===c?null:c})}else{let b=I(a,bf,av);bS({selectedIndex:-1===b?null:b})}},[bl,bf,al,U,bt,ba,av,bS]),(0,g.g)(()=>{al&&(a6.current=bv,aW.current.length=bv.length)},[al,bv]),(0,g.g)(()=>{let a=a5.current;if(a&&(a.hasQuery?b&&bw.set("activeIndex",0):"always"===b&&bw.set("activeIndex",0),a5.current=null),!bl&&!bH)return;let c=bd||be?bv:a6.current,d=bw.state.activeIndex;if(null==d)return"always"===b&&c.length>0?void bw.set("activeIndex",0):void(a4.current!==ae&&(a4.current=ae,bw.state.onItemHighlighted(void 0,(0,v.M)(w.dv,void 0,{index:-1}))));if(d>=c.length){a4.current!==ae&&(a4.current=ae,bw.state.onItemHighlighted(void 0,(0,v.M)(w.dv,void 0,{index:-1}))),bw.set("activeIndex",null);return}let e=c[d],f=a4.current.value,g=f!==ad&&H(e,f,bw.state.isItemEqualToValue);a4.current.index===d&&g||(a4.current={value:e,index:d},bw.state.onItemHighlighted(e,(0,v.M)(w.dv,void 0,{index:d})))},[bB,b,be,bd,bv,bH,bl,bw]),(0,g.g)(()=>{if("none"===U)return void aJ(""!==String(bj));aJ(ba?Array.isArray(bf)&&bf.length>0:null!=bf)},[aJ,U,bj,bf,ba]),e.useEffect(()=>{bd&&b&&0===bv.length&&bS({activeIndex:null})},[bd,b,bv.length,bS]),ac(bo,()=>{bl&&""!==bo&&bo!==String(bi)&&aT(!0)}),ac(bf,()=>{if("none"!==U&&(aF(a9),aG(bf!==aH.initialValue),aI()?aP.commit(bf):aP.commit(bf,!0),bb&&!bc&&!bI)){let a=L(bf,at);bj!==a&&bT(a,(0,v.d)(w.dv))}}),ac(bj,()=>{"none"===U&&(aF(a9),aG(bj!==aH.initialValue),aI()?aP.commit(bj):aP.commit(bj,!0))}),ac(al,()=>{if(!bb||bc||bI||aS)return;let a=L(bf,at);bj!==a&&bT(a,(0,v.d)(w.dv))});let b$=(0,p.P)({open:!!bH||bl,onOpenChange:bU,elements:{reference:bI?bF:bG,floating:bD}});bH||(c=ak?"grid":"listbox",x=bl?"true":"false");let b_=e.useMemo(()=>{let a=bG?.tagName==="INPUT",b=a||bl,d=a?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return b&&(d.role="combobox",d["aria-expanded"]=x,d["aria-haspopup"]=c,d["aria-controls"]=bl?bE?.id:void 0,d["aria-autocomplete"]=aB),{reference:d,floating:{role:"presentation"}}},[bG,bl,x,c,bE?.id,aB]),b0=(0,q.k)(b$,{enabled:!ah&&!a8&&ao,event:"mousedown-only",toggle:!1,touchOpenDelay:50*!bI,reason:w._J}),b1=(0,r.s)(b$,{enabled:!ah&&!a8&&!bH,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:!!bH||void 0,outsidePress(a){let b=(0,u.EW)(a);return!(0,u.gR)(bF,b)&&!(0,u.gR)(a2.current,b)&&!(0,u.gR)(a1.current,b)}}),b2=(0,s.C)(b$,{enabled:!ah&&!a8,id:aQ,listRef:aW,activeIndex:bB,selectedIndex:bC,virtual:!0,loopFocus:as,allowEscape:as&&!b,focusItemOnOpen:!aS&&("none"!==U||!!b)&&"auto",focusItemOnHover:ar,resetOnPointerLeave:!aq,cols:ak?2:1,orientation:ak?"horizontal":void 0,disabledIndices:P.Ml,onNavigate(a,b){(b||bl)&&"ending"!==bM&&(b?bS({activeIndex:a,type:a_.current?"keyboard":"pointer"}):bS({activeIndex:a}))}}),{getReferenceProps:b3,getFloatingProps:b4,getItemProps:b5}=(0,t.b)([b_,b0,b1,b2]);(0,h.j)(()=>{bw.update({inline:ax,popupProps:b4(),inputProps:b3(),triggerProps:bO,getItemProps:b5,setOpen:bU,setInputValue:bT,setSelectedValue:bV,setIndices:bS,onItemHighlighted:bz,handleSelection:bW,forceMount:bQ,requestSubmit:bX})}),(0,g.g)(()=>{bw.update({id:aQ,selectedValue:bf,open:bl,mounted:bK,transitionStatus:bM,items:al,inline:ax,popupProps:b4(),inputProps:b3(),triggerProps:bO,openMethod:bN,getItemProps:b5,selectionMode:U,name:a9,disabled:a8,readOnly:ah,required:ai,grid:ak,isGrouped:bn,virtualized:aw,onOpenChangeComplete:bA,openOnInputClick:ao,itemToStringLabel:at,modal:az,autoHighlight:b,isItemEqualToValue:av,submitOnItemClick:aE,hasInputValue:bc,requestSubmit:bX})},[bw,aQ,bf,bl,bK,bM,al,b4,b3,b5,bN,bO,U,a9,a8,ah,ai,aP,ak,bn,aw,bA,ao,at,az,av,aE,bc,ax,bX,b]);let b6=(0,j.a)(aj,aP.inputRef),b7=e.useMemo(()=>({query:bo,hasItems:bd,filteredItems:bu,flatFilteredItems:bv}),[bo,bd,bu,bv]),b8=e.useMemo(()=>Array.isArray(bx)?"":M(bx,au),[bx,au]),b9=ba&&Array.isArray(bf)&&bf.length>0,ca=ba||"none"===U?void 0:a9,cb=e.useMemo(()=>ba&&Array.isArray(bf)&&a9?bf.map(a=>{let b=M(a,au);return(0,d.jsx)("input",{type:"hidden",name:a9,value:b},b)}):null,[ba,bf,a9,au]),cc=(0,d.jsxs)(e.Fragment,{children:[a.children,(0,d.jsx)("input",{...aP.getInputValidationProps({onFocus(){if(bI)return void bF?.focus();(aZ.current||bF)?.focus()},onChange(a){if(a.nativeEvent.defaultPrevented)return;let b=a.target.value,c=(0,v.d)(w.dv,a.nativeEvent);function d(){if(ba)return;if("none"===U){aG(b!==aH.initialValue),bT(b,c),aI()&&aP.commit(b);return}let a=a6.current.find(a=>M(a,au).toLowerCase()===b.toLowerCase());null!=a&&(aG(a!==aH.initialValue),bV?.(a,c),aI()&&aP.commit(a))}al?d():(bQ(),queueMicrotask(d))}}),id:aQ&&null==ca?`${aQ}-hidden-input`:void 0,name:ca,autoComplete:aC,disabled:a8,required:ai&&!b9,readOnly:ah,value:b8,ref:b6,style:ca?k.a:k.Q,tabIndex:-1,"aria-hidden":!0}),cb]});return(0,d.jsx)(y.Provider,{value:bw,children:(0,d.jsx)(z.Provider,{value:b$,children:(0,d.jsx)(A.Provider,{value:b7,children:(0,d.jsx)(B.Provider,{value:bj,children:cc})})})})}var ag=c(504745),ah=c(577979),ai=c(654277);let aj={...ai.jL,valid:a=>null===a?null:a?{[Q.valid]:""}:{[Q.invalid]:""},popupSide:a=>a?{"data-popup-side":a}:null,listEmpty:a=>a?{"data-list-empty":""}:null},ak=e.createContext(void 0);var al=c(20960);let am=e.createContext(void 0);function an(a){let b=e.useContext(am);if(void 0===b&&!a)throw Error((0,x.A)(21));return b}var ao=c(729406);let ap=e.forwardRef(function(a,b){let{render:c,className:d,disabled:f=!1,id:g,...h}=a,{state:j,disabled:k,setTouched:l,setFocused:m,validationMode:o,validation:p}=S(),{labelId:q}=Z(),r=e.useContext(ak),s=!!an(!0),t=C(),{filteredItems:u}=E(),x=e.useContext(B),y=(0,ao.j)(),z=(0,n.P)(t,N.required),A=(0,n.P)(t,N.disabled),D=(0,n.P)(t,N.readOnly),F=(0,n.P)(t,N.name),G=(0,n.P)(t,N.selectionMode),H=(0,n.P)(t,N.autoHighlight),I=(0,n.P)(t,N.inputProps),J=(0,n.P)(t,N.triggerProps),K=(0,n.P)(t,N.open),L=(0,n.P)(t,N.mounted),M=(0,n.P)(t,N.selectedValue),O=(0,n.P)(t,N.popupSide),P=(0,n.P)(t,N.positionerElement),Q=(0,n.P)(t,N.id),R=(0,n.P)(t,N.inline),T=!!H,U=k||A||f,V=0===u.length,W=s||R,Y=(0,X.e)(g??(W?void 0:Q)),[_,aa]=e.useState(null),ab=e.useRef(!1),ac=e.useRef(null),ad=e.useRef(!1),ae=(0,i.K)(a=>{let b=s||t.state.inline;b&&!t.state.hasInputValue&&t.state.setInputValue("",(0,v.d)(w.dv)),t.update({inputElement:a,inputInsidePopup:b})}),af={...j,open:K,disabled:U,readOnly:D,popupSide:L&&P?O:null,listEmpty:V};return(0,ah.o)("input",a,{state:af,ref:[b,t.state.inputRef,ae],props:[I,J,{type:"text",value:a.value??_??x,"aria-readonly":D||void 0,"aria-required":z||void 0,"aria-labelledby":q,disabled:U,readOnly:D,required:"none"===G?z:void 0,..."none"===G&&F&&{name:F},id:Y,onFocus(){if(m(!0),!R||!ad.current)return;ad.current=!1;let a=ac.current;null!=a&&Object.hasOwn(t.state.valuesRef.current,a)&&t.state.setIndices({activeIndex:a})},onBlur(){l(!0),m(!1);let a=t.state.activeIndex;if(R&&null!==a&&"always"!==H&&(ac.current=a,ad.current=!0,t.state.setIndices({activeIndex:null})),"onBlur"===o){let a="none"===G?x:M;p.commit(a)}},onCompositionStart(a){ag.m0||(ab.current=!0,aa(a.currentTarget.value))},onCompositionEnd(a){ab.current=!1;let b=a.currentTarget.value;aa(null),t.state.setInputValue(b,(0,v.d)(w.pf,a.nativeEvent))},onChange(a){let b=a.nativeEvent.inputType,c=ab.current||!(!b||"insertReplacementText"===b);if(ab.current){let b=a.currentTarget.value;aa(b),""!==b||t.state.openOnInputClick||t.state.inputInsidePopup||t.state.setOpen(!1,(0,v.d)(w.qs,a.nativeEvent));let d=b.trim();!D&&!U&&d&&c&&(t.state.setOpen(!0,(0,v.d)(w.pf,a.nativeEvent)),T||t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&null!==t.state.activeIndex&&!(T&&""!==d)&&t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"});return}t.state.setInputValue(a.currentTarget.value,(0,v.d)(w.pf,a.nativeEvent));let d=""===a.currentTarget.value,e=(0,v.d)(w.qs,a.nativeEvent);d&&!t.state.inputInsidePopup&&("single"===G&&t.state.setSelectedValue(null,e),t.state.openOnInputClick||t.state.setOpen(!1,e));let f=a.currentTarget.value.trim();!D&&!U&&f&&c&&(t.state.setOpen(!0,(0,v.d)(w.pf,a.nativeEvent)),T||t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&null!==t.state.activeIndex&&!T&&t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(a){if(U||D||a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)return;t.state.keyboardActiveRef.current=!0;let b=a.currentTarget,c=b.scrollWidth-b.clientWidth,d="rtl"===y;if("Home"===a.key){(0,al.jo)(a);let c=ag.gm&&d?b.value.length:0;b.setSelectionRange(c,c),b.scrollLeft=0;return}if("End"===a.key){(0,al.jo)(a);let e=ag.gm&&d?0:b.value.length;b.setSelectionRange(e,e),b.scrollLeft=d?-c:c;return}if(!L&&"Escape"===a.key){let b="multiple"===G&&Array.isArray(M)?0===M.length:null===M,c=(0,v.d)(w.jv,a.nativeEvent);t.state.setInputValue("",c),t.state.setSelectedValue("multiple"===G?[]:null,c),b||t.state.inline||c.isPropagationAllowed||a.stopPropagation();return}if(r&&"Backspace"===a.key&&""===b.value&&void 0===r.highlightedChipIndex&&Array.isArray(M)&&M.length>0){let b=M.slice(0,-1);t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"}),t.state.setSelectedValue(b,(0,v.d)(w.dv,a.nativeEvent));return}let e=r?.highlightedChipIndex!==void 0,f=function(a){let b;if(!r)return;let{highlightedChipIndex:c}=r;if(void 0!==c){if("ArrowLeft"===a.key)a.preventDefault(),b=c>0?c-1:void 0;else if("ArrowRight"===a.key)a.preventDefault(),b=c<M.length-1?c+1:void 0;else if("Backspace"===a.key||"Delete"===a.key){a.preventDefault();let d=c>=M.length-1?M.length-2:c;b=d>=0?d:void 0,t.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return b}return"ArrowLeft"===a.key&&(a.currentTarget.selectionStart??0)===0&&M.length>0?(a.preventDefault(),b=Math.max(M.length-1,0)):"Backspace"===a.key&&""===a.currentTarget.value&&M.length>0&&(t.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),a.preventDefault()),b}(a);if(r?.setHighlightedChipIndex(f),void 0!==f?r?.chipsRef.current[f]?.focus():e&&t.state.inputRef.current?.focus(),229!==a.which&&"Enter"===a.key&&K){let b=t.state.activeIndex,c=a.nativeEvent;if(null===b)return void t.state.setOpen(!1,(0,v.d)(w.dv,c));(0,al.jo)(a);let d=t.state.listRef.current[b];d&&(t.state.selectionEventRef.current=c,d.click(),t.state.selectionEventRef.current=null)}},onPointerMove(){t.state.keyboardActiveRef.current=!1},onPointerDown(){t.state.keyboardActiveRef.current=!1}},p?p.getValidationProps(h):h],stateAttributesMapping:aj})});var aq=c(402831);let ar=e.createContext(void 0),as=e.forwardRef(function(a,b){let{keepMounted:c=!1,...e}=a,f=C(),g=(0,n.P)(f,N.mounted),h=(0,n.P)(f,N.forceMounted);return g||c||h?(0,d.jsx)(ar.Provider,{value:c,children:(0,d.jsx)(aq.XF,{ref:b,...e})}):null});var at=c(640023),au=c(568069),av=c(275819),aw=c(293863),ax=c(994152),ay=c(929035);let az=e.forwardRef(function(a,b){let{render:c,className:f,anchor:h,positionMethod:j="absolute",side:k="bottom",align:l="center",sideOffset:m=0,alignOffset:o=0,collisionBoundary:p="clipping-ancestors",collisionPadding:q=5,arrowPadding:r=5,sticky:s=!1,disableAnchorTracking:t=!1,collisionAvoidance:u=aw.uD,...v}=a,w=C(),{filteredItems:y}=E(),z=D(),A=function(){let a=e.useContext(ar);if(void 0===a)throw Error((0,x.A)(20));return a}(),B=(0,n.P)(w,N.modal),F=(0,n.P)(w,N.open),G=(0,n.P)(w,N.mounted),H=(0,n.P)(w,N.openMethod),I=(0,n.P)(w,N.triggerElement),J=(0,n.P)(w,N.inputElement),K=(0,n.P)(w,N.inputInsidePopup),L=(0,n.P)(w,N.transitionStatus),M=0===y.length,O=h??(K?I:J),P=(0,av.s)({anchor:O,floatingRootContext:z,positionMethod:j,mounted:G,side:k,sideOffset:m,align:l,alignOffset:o,arrowPadding:r,collisionBoundary:p,collisionPadding:q,sticky:s,disableAnchorTracking:t,keepMounted:A,collisionAvoidance:u,lazyFlip:!0});(0,au.K)(F&&B&&"touch"!==H,I);let Q=e.useMemo(()=>{let a={...P.positionerStyles};return F||(a.pointerEvents="none"),{role:"presentation",hidden:!G,style:a}},[F,G,P.positionerStyles]),R={open:F,side:P.side,align:P.align,anchorHidden:P.anchorHidden,empty:M};(0,g.g)(()=>{w.set("popupSide",P.side)},[w,P.side]);let S=e.useMemo(()=>({side:P.side,align:P.align,arrowRef:P.arrowRef,arrowUncentered:P.arrowUncentered,arrowStyles:P.arrowStyles,anchorHidden:P.anchorHidden,isPositioned:P.isPositioned}),[P.side,P.align,P.arrowRef,P.arrowUncentered,P.arrowStyles,P.anchorHidden,P.isPositioned]),T=(0,i.K)(a=>{w.set("positionerElement",a)}),U=(0,ah.o)("div",a,{state:R,ref:[b,T],props:[Q,(0,ax.d)(L),v],stateAttributesMapping:ai.GW});return(0,d.jsxs)(am.Provider,{value:S,children:[G&&B&&(0,d.jsx)(ay.W,{inert:(0,at.Y)(!F),cutout:J??I}),U]})});var aA=c(474228),aB=c(238978);let aC={...ai.GW,...aB.G},aD=e.forwardRef(function(a,b){let c,{render:e,className:f,initialFocus:g,finalFocus:h,...i}=a,j=C(),k=an(),l=D(),{filteredItems:m}=E(),o=(0,n.P)(j,N.mounted),p=(0,n.P)(j,N.open),q=(0,n.P)(j,N.openMethod),r=(0,n.P)(j,N.transitionStatus),s=(0,n.P)(j,N.inputInsidePopup),t=(0,n.P)(j,N.inputElement),v=0===m.length;(0,O.v)({open:p,ref:j.state.popupRef,onComplete(){p&&j.state.onOpenChangeComplete(!0)}});let w={open:p,side:k.side,align:k.align,anchorHidden:k.anchorHidden,transitionStatus:r,empty:v},x=(0,ah.o)("div",a,{state:w,ref:[b,j.state.popupRef],props:[{role:s?"dialog":"presentation",tabIndex:-1,onFocus(a){let b=(0,u.EW)(a.nativeEvent);"touch"!==q&&((0,u.gR)(j.state.listElement,b)||b===a.currentTarget)&&j.state.inputRef.current?.focus()}},(0,ax.d)(r),i],stateAttributesMapping:aC}),y=!!s&&(a=>"touch"===a?j.state.popupRef.current:t);return c=null!=h?h:!!s&&void 0,(0,d.jsx)(aA.s,{context:l,disabled:!o,modal:!s,openInteractionType:q,initialFocus:void 0===g?y:g,returnFocus:c,children:x})}),aE=e.createContext(null);function aF(a){let{children:b}=a,{filteredItems:c}=E(),f=e.useContext(aE),g=f?f.items:c;return g?(0,d.jsx)(e.Fragment,{children:g.map(b)}):null}var aG=c(987038);let aH=e.forwardRef(function(a,b){var c;let{render:f,className:g,children:h,...j}=a,k=C(),l=D(),m=!!an(!0),{filteredItems:o}=E(),p=(0,n.P)(k,N.items),q=(0,n.P)(k,N.labelsRef),r=(0,n.P)(k,N.listRef),s=(0,n.P)(k,N.selectionMode),t=(0,n.P)(k,N.grid),u=(0,n.P)(k,N.popupProps),v=(0,n.P)(k,N.disabled),w=(0,n.P)(k,N.readOnly),x=(0,n.P)(k,N.virtualized),y=0===o.length,z=(0,i.K)(a=>{k.set("positionerElement",a)}),A=(0,i.K)(a=>{k.set("listElement",a)}),B=e.useMemo(()=>"function"==typeof h?c||(c=(0,d.jsx)(aF,{children:h})):h,[h]),F=l.useState("floatingId"),G=(0,ah.o)("div",a,{state:{empty:y},ref:[b,A,m?null:z],props:[u,{children:B,tabIndex:-1,id:F,role:t?"grid":"listbox","aria-multiselectable":"multiple"===s?"true":void 0,onKeyDown(a){if(!v&&!w&&"Enter"===a.key){let b=k.state.activeIndex;if(null==b)return;(0,al.jo)(a);let c=a.nativeEvent,d=k.state.listRef.current[b];d&&(k.state.selectionEventRef.current=c,d.click(),k.state.selectionEventRef.current=null)}},onKeyDownCapture(){k.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){k.state.keyboardActiveRef.current=!1}},j]});return x?G:(0,d.jsx)(aG.u,{elementsRef:r,labelsRef:p?void 0:q,children:G})});var aI=c(360412);let aJ=e.createContext(void 0);var aK=c(642228);let aL=e.createContext(!1),aM=e.memo(e.forwardRef(function(a,b){let{render:c,className:f,value:h=null,index:i,disabled:j=!1,nativeButton:k=!1,...l}=a,m=e.useRef(!1),o=e.useRef(null),p=(0,aI.q)({index:i,textRef:o,indexGuessBehavior:aI.G.GuessFromOrder}),q=C(),r=e.useContext(aL),{flatFilteredItems:s,hasItems:t}=E(),u=(0,n.P)(q,N.open),v=(0,n.P)(q,N.selectionMode),w=(0,n.P)(q,N.readOnly),x=(0,n.P)(q,N.virtualized),y=(0,n.P)(q,N.isItemEqualToValue),z="none"!==v,A=i??(x?I(s,h,y):p.index),B=-1!==p.index,D=(0,n.P)(q,N.id),F=(0,n.P)(q,N.isActive,A),G=(0,n.P)(q,N.isSelected,h),J=(0,n.P)(q,N.getItemProps),K=e.useRef(null),L=null!=D&&B?`${D}-${A}`:void 0,M=G&&z;(0,g.g)(()=>{if(!(B&&(x||null!=i)))return;let a=q.state.listRef.current;return a[A]=K.current,()=>{delete a[A]}},[B,x,A,i,q]),(0,g.g)(()=>{if(!B||t)return;let a=q.state.valuesRef.current;return a[A]=h,"none"!==v&&q.state.allValuesRef.current.push(h),()=>{delete a[A]}},[B,t,A,h,q,v]),(0,g.g)(()=>{if(!u){m.current=!1;return}if(!B||t)return;let a=q.state.selectedValue;H(h,Array.isArray(a)?a[a.length-1]:a,y)&&q.set("selectedIndex",A)},[B,t,u,q,A,h,y]);let O=J({active:F,selected:M});O.id=void 0,O.onFocus=void 0;let{getButtonProps:P,buttonRef:Q}=(0,aK.s)({disabled:j,focusableWhenDisabled:!0,native:k});function R(a){function b(){q.state.handleSelection(a,h)}q.state.submitOnItemClick?(T.flushSync(b),q.state.requestSubmit()):b()}let S=(0,ah.o)("div",a,{ref:[Q,b,p.ref,K],state:{disabled:j,selected:M,highlighted:F},props:[O,{id:L,role:r?"gridcell":"option","aria-selected":z?M:void 0,tabIndex:void 0,onPointerDownCapture(a){m.current=!0,a.preventDefault()},onClick(a){j||w||R(a.nativeEvent)},onMouseUp(a){let b=m.current;m.current=!1,j||w||0!==a.button||b||!F||R(a.nativeEvent)}},l,P]}),U=e.useMemo(()=>({selected:M,textRef:o}),[M,o]);return(0,d.jsx)(aJ.Provider,{value:U,children:S})}));var aN=c(165046);let aO=function(a){let{multiple:b=!1,defaultValue:c,value:e,onValueChange:f,autoComplete:g,...h}=a;return(0,d.jsx)(af,{...h,selectionMode:b?"multiple":"single",selectedValue:e,defaultSelectedValue:c,onSelectedValueChange:f,formAutoComplete:g})},aP=e.forwardRef(({className:a,...b},c)=>(0,d.jsx)(ap,{ref:c,"data-slot":"combobox-input",className:(0,aN.cn)("w-full rounded-xl py-2 text-sm outline-none transition-colors",a),...b}));function aQ({className:a,side:b="bottom",sideOffset:c=8,align:e="start",alignOffset:f=0,anchor:g,...h}){return(0,d.jsx)(as,{children:(0,d.jsx)(az,{side:b,sideOffset:c,align:e,alignOffset:f,anchor:g,className:"isolate z-[10000]",children:(0,d.jsx)(aD,{"data-slot":"combobox-content",className:(0,aN.cn)("bg-neutral-100/[0.67] dark:bg-neutral-900/[0.67] border border-white dark:border-white/10 backdrop-blur-md text-[var(--color-text)] max-h-[var(--available-height)] w-[calc(var(--anchor-width)+48px)] overflow-hidden rounded-3xl p-1 shadow-[0_0_25px_0_rgba(0,0,0,0.16)] outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",a),...h})})})}function aR({className:a,...b}){return(0,d.jsx)(aH,{"data-slot":"combobox-list",className:(0,aN.cn)("max-h-[300px] overflow-y-auto overscroll-contain thin-scrollbar",a),...b})}function aS({className:a,children:b,...c}){return(0,d.jsx)(aM,{"data-slot":"combobox-item",className:(0,aN.cn)("bg-transparent data-highlighted:bg-neutral-400/15 text-sm transition-all relative flex w-full cursor-pointer items-center gap-2.5 rounded-2xl px-3 py-2 outline-none select-none","data-disabled:pointer-events-none data-disabled:opacity-50",a),...c,children:b})}aP.displayName="ComboboxInput";var aT=c(941809),aU=c(896703),aV=c(490654),aW=c(75567);function aX(a){return(0,aW.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7.875 2.292a.114.114 0 0 0-.032.018A7.239 7.239 0 0 0 4.75 8.25a7.248 7.248 0 0 0 3.654 6.297c.57.327.982.955.941 1.682v.002l-.317 6.058a.75.75 0 1 1-1.498-.078l.317-6.062v-.004c.006-.09-.047-.215-.188-.296A8.749 8.749 0 0 1 3.25 8.25a8.738 8.738 0 0 1 3.732-7.169 1.547 1.547 0 0 1 1.709-.064c.484.292.809.835.809 1.46v4.714a.25.25 0 0 0 .119.213l2.25 1.385c.08.05.182.05.262 0l2.25-1.385a.25.25 0 0 0 .119-.213V2.478c0-.626.325-1.169.81-1.461a1.547 1.547 0 0 1 1.708.064 8.741 8.741 0 0 1 3.732 7.17 8.747 8.747 0 0 1-4.41 7.598c-.14.081-.193.206-.188.296v.004l.318 6.062a.75.75 0 1 1-1.498.078l-.317-6.058v-.002c-.041-.727.37-1.355.94-1.682A7.247 7.247 0 0 0 19.25 8.25a7.239 7.239 0 0 0-3.093-5.94.114.114 0 0 0-.032-.018l-.01-.001c-.003 0-.014 0-.031.01-.036.022-.084.079-.084.177V7.19c0 .608-.315 1.172-.833 1.49l-2.25 1.385a1.75 1.75 0 0 1-1.834 0l-2.25-1.384A1.752 1.752 0 0 1 8 7.192V2.477c0-.098-.048-.155-.084-.176a.068.068 0 0 0-.031-.011l-.01.001Z"},child:[]}]})(a)}function aY(a){return(0,aW.k5)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M2.5 7C2.5 9.48528 4.51472 11.5 7 11.5C9.48528 11.5 11.5 9.48528 11.5 7C11.5 4.51472 9.48528 2.5 7 2.5C4.51472 2.5 2.5 4.51472 2.5 7ZM2.5 17C2.5 19.4853 4.51472 21.5 7 21.5C9.48528 21.5 11.5 19.4853 11.5 17C11.5 14.5147 9.48528 12.5 7 12.5C4.51472 12.5 2.5 14.5147 2.5 17ZM12.5 17C12.5 19.4853 14.5147 21.5 17 21.5C19.4853 21.5 21.5 19.4853 21.5 17C21.5 14.5147 19.4853 12.5 17 12.5C14.5147 12.5 12.5 14.5147 12.5 17ZM9.5 7C9.5 8.38071 8.38071 9.5 7 9.5C5.61929 9.5 4.5 8.38071 4.5 7C4.5 5.61929 5.61929 4.5 7 4.5C8.38071 4.5 9.5 5.61929 9.5 7ZM9.5 17C9.5 18.3807 8.38071 19.5 7 19.5C5.61929 19.5 4.5 18.3807 4.5 17C4.5 15.6193 5.61929 14.5 7 14.5C8.38071 14.5 9.5 15.6193 9.5 17ZM19.5 17C19.5 18.3807 18.3807 19.5 17 19.5C15.6193 19.5 14.5 18.3807 14.5 17C14.5 15.6193 15.6193 14.5 17 14.5C18.3807 14.5 19.5 15.6193 19.5 17ZM17.5252 11.155L17.8026 10.5186C18.297 9.38398 19.1876 8.48059 20.2988 7.98638L21.1534 7.60631C21.6155 7.4008 21.6155 6.7284 21.1534 6.52289L20.3467 6.16406C19.2068 5.65713 18.3002 4.72031 17.8143 3.54712L17.5295 2.85945C17.3309 2.38018 16.669 2.38018 16.4705 2.85945L16.1856 3.54712C15.6997 4.72031 14.7932 5.65713 13.6534 6.16406L12.8466 6.52289C12.3845 6.7284 12.3845 7.4008 12.8466 7.60631L13.7011 7.98638C14.8124 8.48059 15.7029 9.38398 16.1974 10.5186L16.4748 11.155C16.6778 11.6209 17.3222 11.6209 17.5252 11.155Z"},child:[]}]})(a)}var aZ=c(826948),a$=c(57137),a_=c(489619),a0=c(86839),a1=c(981188);function a2(a){let b=a.path??a.id,c=b.split("/").pop()??a.label;return{name:"object"===a.kind?(0,a0.PV)(a.label):c,path:b,type:a.nodeType??("object"===a.kind?"folder":"file")}}function a3(){let{resolvedTheme:a,setTheme:b}=(0,aZ.D)(),[c,f]=(0,e.useState)(!1);if(!c)return(0,d.jsx)("div",{className:"w-[26px] h-[26px]"});let g="dark"===a;return(0,d.jsx)("button",{type:"button",onClick:()=>b(g?"light":"dark"),className:"p-1.5 rounded-lg transition-colors",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:g?"Switch to light mode":"Switch to dark mode",children:g?(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,d.jsx)("path",{d:"M12 2v2"}),(0,d.jsx)("path",{d:"M12 20v2"}),(0,d.jsx)("path",{d:"m4.93 4.93 1.41 1.41"}),(0,d.jsx)("path",{d:"m17.66 17.66 1.41 1.41"}),(0,d.jsx)("path",{d:"M2 12h2"}),(0,d.jsx)("path",{d:"M20 12h2"}),(0,d.jsx)("path",{d:"m6.34 17.66-1.41 1.41"}),(0,d.jsx)("path",{d:"m19.07 4.93-1.41 1.41"})]}):(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})})}function a4(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,d.jsx)("path",{d:"m21 21-4.3-4.3"})]})}function a5({type:a}){switch(a){case"folder":return(0,d.jsx)(aT.A,{size:16,style:{flexShrink:0,color:"#60a5fa"}});case"document":default:return(0,d.jsx)(aU.A,{size:16,style:{flexShrink:0,opacity:.7}});case"database":return(0,d.jsx)(aV.A,{size:16,style:{flexShrink:0}})}}function a6({onSelect:a,searchFn:b}){let[c,f]=(0,e.useState)([]),[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(""),k=(0,e.useRef)(!1),l=(0,e.useRef)(null),m=(0,e.useRef)(null),n=(0,e.useCallback)(a=>{if(k.current){k.current=!1;return}if(j(a),!a.trim()){f([]),h(!1);return}b?(f(b(a.trim(),20).map(a2)),h(!0)):(l.current&&clearTimeout(l.current),l.current=setTimeout(async()=>{try{let b=await fetch(`/api/workspace/suggest-files?q=${encodeURIComponent(a.trim())}`),c=await b.json();f(c.items??[]),h(!0)}catch{f([])}},150))},[b]);return(0,d.jsxs)(aO,{value:null,open:g,onOpenChange:a=>{a||h(!1)},onValueChange:b=>{b&&(k.current=!0,a(b),h(!1),j(""),f([]))},onInputValueChange:n,filter:null,itemToStringLabel:()=>"",children:[(0,d.jsxs)("div",{ref:m,className:"relative",children:[(0,d.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none z-10",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)(a4,{})}),(0,d.jsx)(aP,{placeholder:"Search",className:"w-full pl-9 pr-10 py-1.5 rounded-xl text-sm outline-none transition-colors",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"}})]}),(0,d.jsxs)(aQ,{anchor:m,children:[(0,d.jsx)(aR,{children:c.map(a=>(0,d.jsxs)(aS,{value:a,children:[(0,d.jsx)("span",{className:"flex-shrink-0",style:{color:"var(--color-text-muted)",opacity:.55},children:(0,d.jsx)(a5,{type:a.type})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"truncate font-medium",children:a.name}),(0,d.jsx)("div",{className:"truncate text-xs",style:{color:"var(--color-text-muted)"},children:a.path.split("/").slice(0,-1).join("/")})]})]},a.path))}),i.trim()&&0===c.length&&(0,d.jsx)("div",{className:"py-3 text-center text-sm",style:{color:"var(--color-text-muted)"},children:"No files found"})]})]})}function a7({orgName:a,onFileSearchSelect:b,mobile:c,onClose:f,showHidden:g,onToggleHidden:h,width:i,onCollapse:j,compact:k=!1,onToggleCompact:l,activeWorkspace:m,onWorkspaceChanged:n,onNavigate:o,activeCrmTarget:p=null,customCrmObjects:q,activeCrmObjectName:r=null,onNavigateToCrmObject:s,chatsPanel:t,onNewChatSession:u}){let v=c?"280px":i??260,[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)("home"),A=[{id:"crm-people",label:"People",target:"people",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),(0,d.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,d.jsx)("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),(0,d.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})},{id:"crm-companies",label:"Companies",target:"companies",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("path",{d:"M3 21h18"}),(0,d.jsx)("path",{d:"M5 21V7l8-4v18"}),(0,d.jsx)("path",{d:"M19 21V11l-6-4"}),(0,d.jsx)("path",{d:"M9 9h0"}),(0,d.jsx)("path",{d:"M9 13h0"}),(0,d.jsx)("path",{d:"M9 17h0"})]})},{id:"crm-inbox",label:"Inbox",target:"inbox",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),(0,d.jsx)("path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11Z"})]})},{id:"crm-calendar",label:"Calendar",target:"calendar",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),(0,d.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,d.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,d.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}],B=[{id:"cloud",label:"Cloud",icon:(0,d.jsx)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,d.jsx)("path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"})})},{id:"integrations",label:"Integrations",icon:(0,d.jsx)(aY,{className:"h-4 w-4 shrink-0","aria-hidden":!0})},{id:"skills",label:"Skills",icon:(0,d.jsx)(aX,{className:"h-4 w-4 shrink-0","aria-hidden":!0})},{id:"cron",label:"Cron",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("polyline",{points:"12 6 12 12 16 14"})]})}],C=(0,d.jsxs)("aside",{className:"flex flex-col h-screen shrink-0 border-r",style:{width:"number"==typeof v?`${v}px`:v,minWidth:"number"==typeof v?`${v}px`:v,background:"var(--color-bg)",borderColor:"var(--color-border)"},children:[l&&(0,d.jsx)("div",{className:"flex items-center justify-center h-[44px] shrink-0",children:(0,d.jsx)("button",{type:"button",onClick:l,className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:"Expand sidebar",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M15 3v18"})]})})}),(0,d.jsx)("div",{className:"flex items-center justify-center pb-0.5 shrink-0",children:(0,d.jsx)(a$.N,{activeWorkspaceHint:m??null,onWorkspaceSwitch:()=>{n?.()},onWorkspaceDelete:()=>{n?.()},onCreateWorkspace:()=>{x(!0)},trigger:({onClick:b,activeWorkspace:c,switching:e})=>(0,d.jsx)("button",{type:"button",onClick:b,disabled:e,className:"w-7 h-7 mx-auto rounded-lg overflow-hidden flex items-center justify-center transition-opacity hover:opacity-90",title:`${a||"Workspace"}${c?` — ${c}`:""}`,children:(0,d.jsx)("img",{src:"/dench-workspace-icon.png",alt:"",className:"w-7 h-7 object-cover",draggable:!1})})})}),o&&(0,d.jsxs)("div",{className:"flex flex-col items-center gap-0.5 pt-1 pb-1",children:[A.map(a=>{let b=p===a.target;return(0,d.jsx)("button",{type:"button",onClick:()=>o(a.id),className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},title:a.label,"aria-label":a.label,children:a.icon},a.id)}),q&&q.length>0&&s&&q.map(a=>{let b=r===a.name,c=(0,a0.PV)(a.name);return(0,d.jsx)("button",{type:"button",onClick:()=>s(a.name),className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},title:c,"aria-label":c,children:(0,d.jsx)(a1.P,{name:a.icon,size:16})},`crm-object-${a.name}`)})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0"}),o&&(0,d.jsx)("div",{className:"flex flex-col items-center gap-0.5 py-1",children:B.map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>o(a.id),className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:a.label,"aria-label":a.label,children:a.icon},a.id))}),(0,d.jsxs)("div",{className:"flex flex-col items-center py-1.5 gap-0.5",children:[h&&(0,d.jsx)("button",{type:"button",onClick:h,className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:g?"var(--color-text)":"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:g?"Hide dotfiles":"Show dotfiles",children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),(0,d.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),(0,d.jsx)("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),(0,d.jsx)("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),(0,d.jsx)("path",{d:"m2 2 20 20"})]})})}),(0,d.jsx)(a3,{})]})]}),D=(0,d.jsxs)("aside",{className:`flex flex-col h-screen shrink-0 ${c?"drawer-left":"border-r"}`,style:{width:"number"==typeof v?`${v}px`:v,minWidth:"number"==typeof v?`${v}px`:v,background:"var(--color-bg)",borderColor:"var(--color-border)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-1 px-2 h-[44px] shrink-0",children:[(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(a$.N,{activeWorkspaceHint:m??null,onWorkspaceSwitch:()=>{n?.()},onWorkspaceDelete:()=>{n?.()},onCreateWorkspace:()=>{x(!0)},trigger:({onClick:b,activeWorkspace:c,switching:e})=>(0,d.jsxs)("button",{type:"button",onClick:b,disabled:e,className:"text-[13px] flex items-center gap-1.5 truncate w-full transition-colors rounded-lg px-2 py-1.5",style:{color:"var(--color-text)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:"Switch workspace",children:[(0,d.jsx)("span",{className:"truncate font-semibold",children:a||"Workspace"}),c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"shrink-0 opacity-40",children:"/"}),(0,d.jsx)("span",{className:"truncate text-[12px]",style:{color:"var(--color-text-muted)"},children:c})]}),(0,d.jsx)("span",{className:"flex-1"}),(0,d.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)("path",{d:"m6 9 6 6 6-6"})})]})})}),(l||j)&&(0,d.jsx)("button",{type:"button",onClick:l??j,className:"p-1.5 rounded-lg shrink-0 transition-colors",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:l?"Collapse to icons":"Hide sidebar (⌘B)",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M9 3v18"})]})})]}),t&&(0,d.jsxs)("div",{className:"px-2 pt-1 pb-1 flex items-center gap-1",children:[[{id:"home",label:"Home"},{id:"chats",label:"Chats"}].map(a=>{let b=y===a.id;return(0,d.jsx)("button",{type:"button",onClick:()=>z(a.id),className:"flex-1 px-2 py-1 rounded-md text-[12px] font-medium transition-colors cursor-pointer",style:{color:b?"var(--color-text)":"var(--color-text-muted)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:a.label},a.id)}),"chats"===y&&u&&(0,d.jsx)("button",{type:"button",onClick:u,className:"p-1 rounded-md transition-colors cursor-pointer shrink-0",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:"New chat","aria-label":"New chat",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("path",{d:"M5 12h14"}),(0,d.jsx)("path",{d:"M12 5v14"})]})})]}),"chats"===y&&t?(0,d.jsx)("div",{className:"flex-1 min-h-0 flex flex-col relative",children:t}):(0,d.jsxs)(d.Fragment,{children:[o&&(0,d.jsxs)("div",{className:"px-2 pt-1 pb-1",children:[(0,d.jsx)("div",{className:"px-2 pt-2 pb-1 text-[9px] lowercase",style:{color:"var(--color-text-muted)",letterSpacing:"0.05em"},children:"workspace"}),(0,d.jsxs)("div",{className:"space-y-0.5",children:[A.map(a=>{let b=p===a.target;return(0,d.jsxs)("button",{type:"button",onClick:()=>o(a.id),className:"w-full flex items-center gap-2.5 px-2 py-1.5 rounded-lg text-[13px] transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:[(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--color-text-muted)"},children:a.icon}),a.label]},a.id)}),q&&q.length>0&&s&&q.map(a=>{let b=r===a.name,c=(0,a0.PV)(a.name);return(0,d.jsxs)("button",{type:"button",onClick:()=>s(a.name),className:"w-full flex items-center gap-2.5 px-2 py-1.5 rounded-lg text-[13px] transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},title:c,children:[(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)(a1.P,{name:a.icon,size:16})}),c]},`crm-object-${a.name}`)})]})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0"}),o&&(0,d.jsx)("div",{className:"px-2 py-1 space-y-0.5",children:B.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>o(a.id),className:"w-full flex items-center gap-2.5 px-2 py-1.5 rounded-lg text-[13px] transition-colors",style:{color:"var(--color-text)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--color-text-muted)"},children:a.icon}),a.label]},a.id))})]}),(0,d.jsxs)("div",{className:"px-2 py-1.5 flex items-center justify-between",children:[(0,d.jsxs)("a",{href:"https://dench.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-2 py-1 rounded-lg text-[11px]",style:{color:"var(--color-text-muted)"},children:["dench.com"," v3.0.7"]}),(0,d.jsxs)("div",{className:"flex items-center gap-0.5",children:[h&&(0,d.jsx)("button",{type:"button",onClick:h,className:"p-1.5 rounded-lg transition-colors",style:{color:g?"var(--color-text)":"var(--color-text-muted)"},title:g?"Hide dotfiles":"Show dotfiles",children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),(0,d.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),(0,d.jsx)("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),(0,d.jsx)("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),(0,d.jsx)("path",{d:"m2 2 20 20"})]})})}),(0,d.jsx)(a3,{})]})]})]});return c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"drawer-backdrop",onClick:()=>void f?.(),children:(0,d.jsx)("div",{onClick:a=>a.stopPropagation(),className:"fixed inset-y-0 left-0 z-50",children:D})}),(0,d.jsx)(a_.s,{isOpen:w,onClose:()=>x(!1),onCreated:()=>{n?.()}})]}):(0,d.jsxs)(d.Fragment,{children:[!c&&k?C:D,(0,d.jsx)(a_.s,{isOpen:w,onClose:()=>x(!1),onCreated:()=>{n?.()}})]})}},685343:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});var d=c(95253)._0},686937:a=>{"use strict";var b=Object.prototype.hasOwnProperty,c=Object.prototype.toString,d=Object.defineProperty,e=Object.getOwnPropertyDescriptor,f=function(a){return"function"==typeof Array.isArray?Array.isArray(a):"[object Array]"===c.call(a)},g=function(a){if(!a||"[object Object]"!==c.call(a))return!1;var d,e=b.call(a,"constructor"),f=a.constructor&&a.constructor.prototype&&b.call(a.constructor.prototype,"isPrototypeOf");if(a.constructor&&!e&&!f)return!1;for(d in a);return void 0===d||b.call(a,d)},h=function(a,b){d&&"__proto__"===b.name?d(a,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):a[b.name]=b.newValue},i=function(a,c){if("__proto__"===c){if(!b.call(a,c))return;else if(e)return e(a,c).value}return a[c]};a.exports=function a(){var b,c,d,e,j,k,l=arguments[0],m=1,n=arguments.length,o=!1;for("boolean"==typeof l&&(o=l,l=arguments[1]||{},m=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});m<n;++m)if(b=arguments[m],null!=b)for(c in b)d=i(l,c),l!==(e=i(b,c))&&(o&&e&&(g(e)||(j=f(e)))?(j?(j=!1,k=d&&f(d)?d:[]):k=d&&g(d)?d:{},h(l,{name:c,newValue:a(o,k,e)})):void 0!==e&&h(l,{name:c,newValue:e}));return l}},688094:(a,b,c)=>{"use strict";c.d(b,{y:()=>E});var d=c(736927),e=c(115962),f=c(327648),g=c(327770),h=c(673977),i=c(405545),j=c(720511),k=c(381802),l=c(86839);let m=new k.hs("chatFileMention"),n=j.bP.create({name:"chatFileMention",group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!0,addAttributes:()=>({label:{default:""},path:{default:""},mentionType:{default:"file"},objectName:{default:""},defaultView:{default:""}}),parseHTML:()=>[{tag:"span[data-chat-file-mention]"}],renderHTML({HTMLAttributes:a}){let b=a.label||"file",c=a.mentionType||"file",d=a.defaultView||"",e={bg:"rgba(120, 113, 108, 0.1)",fg:"inherit"},f="object"===c?(0,l.PV)(b):b;return["span",(0,j.KV)({"data-chat-file-mention":"","data-mention-type":c,...d?{"data-default-view":d}:{},class:"chat-file-mention",style:`--mention-bg: ${e.bg}; --mention-fg: ${e.fg};`,title:a.path||""},a),f]}});var o=c(249855),p=c(941809),q=c(478425);let r=(0,q.A)("outline","photo","Photo",[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]]),s=(0,q.A)("outline","video","Video",[["path",{d:"M15 10l4.553 -2.276a1 1 0 0 1 1.447 .894v6.764a1 1 0 0 1 -1.447 .894l-4.553 -2.276v-4",key:"svg-0"}],["path",{d:"M3 8a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2l0 -8",key:"svg-1"}]]),t=(0,q.A)("outline","music","Music",[["path",{d:"M3 17a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-0"}],["path",{d:"M13 17a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}],["path",{d:"M9 17v-13h10v13",key:"svg-2"}],["path",{d:"M9 8h10",key:"svg-3"}]]);var u=c(896703);let v=(0,q.A)("outline","code","Code",[["path",{d:"M7 8l-4 4l4 4",key:"svg-0"}],["path",{d:"M17 8l4 4l-4 4",key:"svg-1"}],["path",{d:"M14 4l-4 16",key:"svg-2"}]]);var w=c(490654);let x=(0,q.A)("filled","layout-kanban-filled","LayoutKanbanFilled",[["path",{d:"M10 3a1 1 0 0 1 0 2h-6a1 1 0 1 1 0 -2z",key:"svg-0"}],["path",{d:"M20 3a1 1 0 0 1 0 2h-6a1 1 0 0 1 0 -2z",key:"svg-1"}],["path",{d:"M8 7a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3z",key:"svg-2"}],["path",{d:"M18 7a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-2a3 3 0 0 1 -3 -3v-2a3 3 0 0 1 3 -3z",key:"svg-3"}]]);var y=c(118475);let z=(0,q.A)("filled","user-filled","UserFilled",[["path",{d:"M12 2a5 5 0 1 1 -5 5l.005 -.217a5 5 0 0 1 4.995 -4.783z",key:"svg-0"}],["path",{d:"M14 14a5 5 0 0 1 5 5v1a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-1a5 5 0 0 1 5 -5h4z",key:"svg-1"}]]);function A({category:a,defaultView:b}){let c={flexShrink:0};switch(a){case"folder":return(0,d.jsx)(p.A,{size:18,style:{...c,color:"#60a5fa"}});case"image":return(0,d.jsx)(r,{size:18,style:{...c,color:"#10b981"}});case"video":return(0,d.jsx)(s,{size:18,style:{...c,color:"#8b5cf6"}});case"audio":return(0,d.jsx)(t,{size:18,style:{...c,color:"#f59e0b"}});case"pdf":return(0,d.jsx)(u.A,{size:18,style:{...c,color:"#ef4444"}});case"code":return(0,d.jsx)(v,{size:18,style:{...c,color:"#3b82f6"}});case"database":return(0,d.jsx)(w.A,{size:18,style:c});case"object":return"kanban"===b?(0,d.jsx)(x,{size:18,style:{...c,color:"#8b7cf6"}}):(0,d.jsx)(y.A,{size:18,style:{...c,color:"#42a97a"}});case"entry":return(0,d.jsx)(z,{size:18,style:{...c,color:"#22c55e"}});default:return(0,d.jsx)(u.A,{size:18,style:{...c,opacity:.7}})}}let B=(0,e.forwardRef)(({items:a,command:b,loading:c},f)=>{let[g,h]=(0,e.useState)(0),i=(0,e.useRef)(null);(0,e.useEffect)(()=>{h(0)},[a]),(0,e.useEffect)(()=>{let a=i.current?.children[g];a?.scrollIntoView({block:"nearest"})},[g]);let j=(0,e.useCallback)(c=>{let d=a[c];d&&b(d)},[a,b]);(0,e.useImperativeHandle)(f,()=>({onKeyDown:({event:b})=>"ArrowUp"===b.key?(h(b=>(b+a.length-1)%a.length),!0):"ArrowDown"===b.key?(h(b=>(b+1)%a.length),!0):("Enter"===b.key||"Tab"===b.key)&&(j(g),!0)}));let k="bg-neutral-100/[0.67] dark:bg-neutral-900/[0.67] border border-white dark:border-white/10 backdrop-blur-md shadow-[0_0_25px_0_rgba(0,0,0,0.16)]";return c?(0,d.jsx)("div",{className:`rounded-3xl p-3 ${k}`,style:{minWidth:280,maxWidth:400},children:(0,d.jsx)("span",{className:"text-xs animate-pulse",style:{color:"var(--color-text-muted)"},children:"Searching..."})}):0===a.length?(0,d.jsx)("div",{className:`rounded-3xl p-3 text-center ${k}`,style:{minWidth:280,maxWidth:400},children:(0,d.jsx)("span",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:"No results found"})}):(0,d.jsx)("div",{ref:i,className:`rounded-3xl p-1 overflow-y-auto thin-scrollbar ${k}`,style:{minWidth:280,maxWidth:400,maxHeight:300},children:a.map((a,b)=>{let c=function(a,b){if("folder"===b)return"folder";if("database"===b)return"database";if("object"===b)return"object";if("entry"===b)return"entry";let c=a.split(".").pop()?.toLowerCase()??"";return["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","heic"].includes(c)?"image":["mp4","webm","mov","avi","mkv","flv"].includes(c)?"video":["mp3","wav","ogg","aac","flac","m4a"].includes(c)?"audio":"pdf"===c?"pdf":["js","ts","tsx","jsx","py","rb","go","rs","java","cpp","c","h","css","html","json","yaml","yml","toml","sh","bash","sql","swift","kt"].includes(c)?"code":"document"===b?"document":"other"}(a.name,a.type),e=a.icon&&/\p{Emoji_Presentation}/u.test(a.icon),f="object"===a.type||"entry"===a.type,i="object"===a.type?(0,l.PV)(a.name):a.name,k="entry"===a.type&&a.objectName?(0,l.A3)(a.objectName):f?"kanban"===a.defaultView?"Board":"Table":a.path.replace(/^\/Users\/[^/]+/,"~").replace(/^\/home\/[^/]+/,"~").replace(/^[A-Z]:\\Users\\[^\\]+/,"~");return(0,d.jsxs)("button",{type:"button",className:`w-full flex items-center gap-2.5 px-2.5 py-1.5 text-left transition-all rounded-2xl select-none ${b===g?"bg-neutral-400/15":""}`,style:{color:"var(--color-text)"},onClick:()=>j(b),onMouseEnter:()=>h(b),children:[(0,d.jsx)("span",{className:"flex-shrink-0 flex items-center",style:{opacity:.55},children:e?(0,d.jsx)("span",{className:"text-[15px] leading-none",children:a.icon}):(0,d.jsx)(A,{category:c,defaultView:a.defaultView})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"text-sm font-medium truncate",children:i}),(0,d.jsx)("div",{className:"text-xs truncate",style:{color:"var(--color-text-muted)"},title:f?k:a.path,children:k})]})]},a.path)})})});function C({items:a,command:b,clientRect:c,componentRef:f,loading:g}){let h=(0,e.useRef)(null);return(0,o.createPortal)((0,d.jsx)("div",{ref:h,children:(0,d.jsx)(B,{ref:f,items:a,command:b,loading:g})}),document.body)}function D(a){if(!a)return{text:"",mentionedFiles:[]};let b=[],c=[];return a.state.doc.forEach(a=>{if("paragraph"===a.type.name||"hardBreak"===a.type.name){let d="";a.descendants(a=>{if("chatFileMention"===a.type.name){let c=a.attrs.label,e=a.attrs.path,f=a.attrs.mentionType,g=a.attrs.objectName;return b.push({name:c,path:e}),"object"===f?d+=`[object: ${c}]`:"entry"===f?d+=`[entry: ${g?`${g}/`:""}${c}]`:d+=`[file: ${e}]`,!1}return a.isText&&a.text&&(d+=a.text),"hardBreak"===a.type.name&&(d+="\n"),!0}),c.push(d)}}),{text:c.join("\n").trim(),mentionedFiles:b}}B.displayName="FileMentionList";let E=(0,e.forwardRef)(function({onSubmit:a,onChange:b,onNativeFileDrop:k,placeholder:l,disabled:o,compact:p,searchFn:q},r){let s=(0,e.useRef)(a);s.current=a;let t=(0,e.useRef)(k);t.current=k;let u=(0,e.useRef)(q??null);u.current=q??null;let v=(0,e.useRef)(null),w=(0,f.hG)({immediatelyRender:!1,extensions:[g.A.configure({heading:!1,codeBlock:!1,blockquote:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1}),h.A.configure({placeholder:l??"Ask anything...",showOnlyWhenEditable:!1}),n,j.YY.create({name:"chatFileMentionSuggestion",addProseMirrorPlugins(){return[(0,i.Ay)({editor:this.editor,char:"@",pluginKey:m,startOfLine:!1,allowSpaces:!0,command:({editor:a,range:b,props:c})=>{let d="object"===c.type?"object":"entry"===c.type?"entry":"folder"===c.type?"folder":"file";a.chain().focus().deleteRange(b).insertContent([{type:"chatFileMention",attrs:{label:c.name,path:c.path,mentionType:d,objectName:c.objectName??"",defaultView:c.defaultView??""}},{type:"text",text:" "}]).run()},items:({query:a})=>[],render:()=>{let a=null,b=null,e={current:null},f="",g=[],h=!1,i=null,j=null,k=null;function l(){b&&j&&b.render((0,d.jsx)(C,{items:g,command:j,clientRect:k,componentRef:e,loading:h}))}function m(a){let b=a.path??a.id,c=b.split("/").pop()??a.label;return{name:"object"===a.kind||"entry"===a.kind?a.label:c,path:b,type:"entry"===a.kind?"entry":"object"===a.kind?"object":a.nodeType??"file",icon:a.icon,objectName:a.objectName,entryId:a.entryId,defaultView:a.defaultView}}function n(a){let b=u?.current;return!!b&&(g=b(a,20).map(m),h=!1,l(),!0)}async function o(a){if(!n(a)){h=!0,l();try{let b=a.startsWith("/")||a.startsWith("~/")||a.startsWith("../")||a.startsWith("./")||a.includes("/")?`path=${encodeURIComponent(a)}`:a?`q=${encodeURIComponent(a)}`:"",c=`/api/workspace/suggest-files${b?`?${b}`:""}`,d=await fetch(c);g=(await d.json()).items??[]}catch{g=[]}h=!1,l()}}function p(a){n(a)||(i&&clearTimeout(i),i=setTimeout(()=>{o(a)},120))}return{onStart:d=>{a=document.createElement("div"),document.body.appendChild(a),j=d.command,k=d.clientRect??null,f=d.query,c.e(70684).then(c.t.bind(c,570684,19)).then(({createRoot:c})=>{b=c(a),p(f)})},onUpdate:a=>{j=a.command,k=a.clientRect??null,p(f=a.query)},onKeyDown:c=>{if("Escape"===c.event.key)return b?.unmount(),a?.remove(),a=null,b=null,!0;let d=e.current?.onKeyDown(c)??!1;return d&&c.event.stopImmediatePropagation(),d},onExit:()=>{i&&clearTimeout(i),b?.unmount(),a?.remove(),a=null,b=null}}}})]}})],editorProps:{attributes:{class:`chat-editor-content ${p?"chat-editor-compact":""}`,style:"color: var(--color-text);"},handleKeyDown:(a,b)=>{if("Enter"===b.key&&!b.shiftKey&&!b.isComposing){let b=m.getState(a.state);return!b?.active}return!1},handleDOMEvents:{paste:(a,b)=>{let c=b.clipboardData;if(!c)return!1;let d=[];if(c.items){for(let a of Array.from(c.items))if("file"===a.kind){let b=a.getAsFile();b&&d.push(b)}}if(d.length>0){b.preventDefault();let a=new DataTransfer;for(let b of d)a.items.add(b);return t.current?.(a.files),!0}return!1},dragover:(a,b)=>!!(b.dataTransfer?.types.includes("application/x-file-mention")||b.dataTransfer?.types.includes("Files"))&&(b.preventDefault(),b.dataTransfer.dropEffect="copy",!0),drop:(a,b)=>{let c=()=>{let a=b.target instanceof HTMLElement?b.target.closest("[data-chat-drop-target]"):null;a?.removeAttribute("data-drag-hover")},d=b.dataTransfer?.getData("application/x-file-mention");if(d){b.preventDefault(),b.stopPropagation(),c();try{let{name:a,path:b}=JSON.parse(d);a&&b&&v.current?.chain().focus().insertContent([{type:"chatFileMention",attrs:{label:a,path:b}},{type:"text",text:" "}]).run()}catch{}return!0}let e=b.dataTransfer?.files;return!!e&&e.length>0&&(b.preventDefault(),b.stopPropagation(),c(),t.current?.(e),!0)}}},onUpdate:({editor:a})=>{b?.(a.isEmpty)}});return(0,e.useEffect)(()=>{v.current=w??null},[w]),(0,e.useEffect)(()=>{if(!w)return;let a=a=>{if("Enter"===a.key&&!a.shiftKey&&!a.isComposing){let b=m.getState(w.state);if(b?.active)return;a.preventDefault();let{text:c,mentionedFiles:d}=D(w),e=w.getHTML();s.current(c,d,e),(c.trim()||d.length>0)&&w.commands.clearContent(!0),requestAnimationFrame(()=>w.commands.focus())}},b=w.view.dom;return b.addEventListener("keydown",a),()=>b.removeEventListener("keydown",a)},[w]),(0,e.useEffect)(()=>{w&&w.setEditable(!o)},[w,o]),(0,e.useImperativeHandle)(r,()=>({insertFileMention:(a,b)=>{w?.chain().focus().insertContent([{type:"chatFileMention",attrs:{label:a,path:b}},{type:"text",text:" "}]).run()},clear:()=>{w?.commands.clearContent(!0)},focus:()=>{w?.commands.focus()},isEmpty:()=>w?.isEmpty??!0,submit:()=>{if(!w)return;let{text:a,mentionedFiles:b}=D(w);if(a.trim()||b.length>0){let c=w.getHTML();s.current(a,b,c),w.commands.clearContent(!0),requestAnimationFrame(()=>w.commands.focus())}},setText:a=>{w?.commands.setContent(a),w?.commands.focus("end")},appendText:a=>{if(!w)return;let b=a.trim();if(!b)return;let{text:c}=D(w),d=c.trim().length>0?" ":"";w.chain().focus("end").insertContent(`${d}${b}`).run()}})),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.$Z,{editor:w}),(0,d.jsx)("style",{children:`
|
|
218
|
+
`),()=>{s.contains(r)&&s.removeChild(r)}},[b]),(0,d.jsx)(m,{isPresent:b,childRef:j,sizeRef:n,pop:h,children:!1===h?a:e.cloneElement(a,{ref:p})})}let o=({children:a,initial:b,isPresent:c,onExitComplete:f,custom:h,presenceAffectsLayout:j,mode:k,anchorX:l,anchorY:m,root:o})=>{let q=(0,g.M)(p),r=(0,e.useId)(),s=!0,t=(0,e.useMemo)(()=>(s=!1,{id:r,initial:b,isPresent:c,custom:h,onExitComplete:a=>{for(let b of(q.set(a,!0),q.values()))if(!b)return;f&&f()},register:a=>(q.set(a,!1),()=>q.delete(a))}),[c,q,f]);return j&&s&&(t={...t}),(0,e.useMemo)(()=>{q.forEach((a,b)=>q.set(b,!1))},[c]),e.useEffect(()=>{c||q.size||!f||f()},[c]),a=(0,d.jsx)(n,{pop:"popLayout"===k,isPresent:c,anchorX:l,anchorY:m,root:o,children:a}),(0,d.jsx)(i.t.Provider,{value:t,children:a})};function p(){return new Map}var q=c(15086);let r=a=>a.key||"";function s(a){let b=[];return e.Children.forEach(a,a=>{(0,e.isValidElement)(a)&&b.push(a)}),b}let t=({children:a,custom:b,initial:c=!0,onExitComplete:i,presenceAffectsLayout:j=!0,mode:k="sync",propagate:l=!1,anchorX:m="left",anchorY:n="top",root:p})=>{let[t,u]=(0,q.xQ)(l),v=(0,e.useMemo)(()=>s(a),[a]),w=l&&!t?[]:v.map(r),x=(0,e.useRef)(!0),y=(0,e.useRef)(v),z=(0,g.M)(()=>new Map),A=(0,e.useRef)(new Set),[B,C]=(0,e.useState)(v),[D,E]=(0,e.useState)(v);(0,h.E)(()=>{x.current=!1,y.current=v;for(let a=0;a<D.length;a++){let b=r(D[a]);w.includes(b)?(z.delete(b),A.current.delete(b)):!0!==z.get(b)&&z.set(b,!1)}},[D,w.length,w.join("-")]);let F=[];if(v!==B){let a=[...v];for(let b=0;b<D.length;b++){let c=D[b],d=r(c);w.includes(d)||(a.splice(b,0,c),F.push(c))}return"wait"===k&&F.length&&(a=F),E(s(a)),C(v),null}let{forceRender:G}=(0,e.useContext)(f.L);return(0,d.jsx)(d.Fragment,{children:D.map(a=>{let e=r(a),f=(!l||!!t)&&(v===D||w.includes(e));return(0,d.jsx)(o,{isPresent:f,initial:(!x.current||!!c)&&void 0,custom:b,presenceAffectsLayout:j,mode:k,root:p,onExitComplete:f?void 0:()=>{if(A.current.has(e)||(A.current.add(e),!z.has(e)))return;z.set(e,!0);let a=!0;z.forEach(b=>{b||(a=!1)}),a&&(G?.(),E(y.current),l&&u?.(),i&&i())},anchorX:m,anchorY:n,children:a},e)})})}},656159:(a,b)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b.isDeepKey=function(a){switch(typeof a){case"number":case"symbol":return!1;case"string":return a.includes(".")||a.includes("[")||a.includes("]")}}},658422:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(452171),e=c(266196),f=c(606461);b.cloneDeepWith=function(a,b){return d.cloneDeepWith(a,(c,g,h,i)=>{let j=b?.(c,g,h,i);if(void 0!==j)return j;if("object"==typeof a){if(e.getTag(a)===f.objectTag&&"function"!=typeof a.constructor){let b={};return i.set(a,b),d.copyProperties(b,a,h,i),b}switch(Object.prototype.toString.call(a)){case f.numberTag:case f.stringTag:case f.booleanTag:{let b=new a.constructor(a?.valueOf());return d.copyProperties(b,a),b}case f.argumentsTag:{let b={};return d.copyProperties(b,a),b.length=a.length,b[Symbol.iterator]=a[Symbol.iterator],b}default:return}}})}},658556:(a,b,c)=>{"use strict";function d(a,b){let c=String(a);if("string"!=typeof b)throw TypeError("Expected character");let d=0,e=c.indexOf(b);for(;-1!==e;)d++,e=c.indexOf(b,e+b.length);return d}c.d(b,{A:()=>aI});var e=c(972421),f=c(145214),g=c(423721),h=c(348445);let i="phrasing",j=["autolink","link","image","label"];function k(a){this.enter({type:"link",title:null,url:"",children:[]},a)}function l(a){this.config.enter.autolinkProtocol.call(this,a)}function m(a){this.config.exit.autolinkProtocol.call(this,a)}function n(a){this.config.exit.data.call(this,a);let b=this.stack[this.stack.length-1];(0,e.ok)("link"===b.type),b.url="http://"+this.sliceSerialize(a)}function o(a){this.config.exit.autolinkEmail.call(this,a)}function p(a){this.exit(a)}function q(a){!function(a,b,c){let d=(0,h.C)((c||{}).ignore||[]),e=function(a){let b=[];if(!Array.isArray(a))throw TypeError("Expected find and replace tuple or list of tuples");let c=!a[0]||Array.isArray(a[0])?a:[a],d=-1;for(;++d<c.length;){var e;let a=c[d];b.push(["string"==typeof(e=a[0])?RegExp(function(a){if("string"!=typeof a)throw TypeError("Expected a string");return a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e,function(a){return"function"==typeof a?a:function(){return a}}(a[1])])}return b}(b),f=-1;for(;++f<e.length;)(0,g.VG)(a,"text",i);function i(a,b){let c,g=-1;for(;++g<b.length;){let a=b[g],e=c?c.children:void 0;if(d(a,e?e.indexOf(a):void 0,c))return;c=a}if(c)return function(a,b){let c=b[b.length-1],d=e[f][0],g=e[f][1],h=0,i=c.children.indexOf(a),j=!1,k=[];d.lastIndex=0;let l=d.exec(a.value);for(;l;){let c=l.index,e={index:l.index,input:l.input,stack:[...b,a]},f=g(...l,e);if("string"==typeof f&&(f=f.length>0?{type:"text",value:f}:void 0),!1===f?d.lastIndex=c+1:(h!==c&&k.push({type:"text",value:a.value.slice(h,c)}),Array.isArray(f)?k.push(...f):f&&k.push(f),h=c+l[0].length,j=!0),!d.global)break;l=d.exec(a.value)}return j?(h<a.value.length&&k.push({type:"text",value:a.value.slice(h)}),c.children.splice(i,1,...k)):k=[a],i+k.length}(a,b)}}(a,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,r],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,s]],{ignore:["link","linkReference"]})}function r(a,b,c,e,f){let g="";if(!t(f)||(/^w/i.test(b)&&(c=b+c,b="",g="http://"),!function(a){let b=a.split(".");return!(b.length<2||b[b.length-1]&&(/_/.test(b[b.length-1])||!/[a-zA-Z\d]/.test(b[b.length-1]))||b[b.length-2]&&(/_/.test(b[b.length-2])||!/[a-zA-Z\d]/.test(b[b.length-2])))}(c)))return!1;let h=function(a){let b=/[!"&'),.:;<>?\]}]+$/.exec(a);if(!b)return[a,void 0];a=a.slice(0,b.index);let c=b[0],e=c.indexOf(")"),f=d(a,"("),g=d(a,")");for(;-1!==e&&f>g;)a+=c.slice(0,e+1),e=(c=c.slice(e+1)).indexOf(")"),g++;return[a,c]}(c+e);if(!h[0])return!1;let i={type:"link",title:null,url:g+b+h[0],children:[{type:"text",value:b+h[0]}]};return h[1]?[i,{type:"text",value:h[1]}]:i}function s(a,b,c,d){return!(!t(d,!0)||/[-\d_]$/.test(c))&&{type:"link",title:null,url:"mailto:"+b+"@"+c,children:[{type:"text",value:b+"@"+c}]}}function t(a,b){let c=a.input.charCodeAt(a.index-1);return(0===a.index||(0,f.Ny)(c)||(0,f.es)(c))&&(!b||47!==c)}var u=c(732347);function v(){this.buffer()}function w(a){this.enter({type:"footnoteReference",identifier:"",label:""},a)}function x(){this.buffer()}function y(a){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},a)}function z(a){let b=this.resume(),c=this.stack[this.stack.length-1];(0,e.ok)("footnoteReference"===c.type),c.identifier=(0,u.B)(this.sliceSerialize(a)).toLowerCase(),c.label=b}function A(a){this.exit(a)}function B(a){let b=this.resume(),c=this.stack[this.stack.length-1];(0,e.ok)("footnoteDefinition"===c.type),c.identifier=(0,u.B)(this.sliceSerialize(a)).toLowerCase(),c.label=b}function C(a){this.exit(a)}function D(a,b,c,d){let e=c.createTracker(d),f=e.move("[^"),g=c.enter("footnoteReference"),h=c.enter("reference");return f+=e.move(c.safe(c.associationId(a),{after:"]",before:f})),h(),g(),f+=e.move("]")}function E(a,b,c){return 0===b?a:F(a,b,c)}function F(a,b,c){return(c?"":" ")+a}D.peek=function(){return"["};let G=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function H(a){this.enter({type:"delete",children:[]},a)}function I(a){this.exit(a)}function J(a,b,c,d){let e=c.createTracker(d),f=c.enter("strikethrough"),g=e.move("~~");return g+=c.containerPhrasing(a,{...e.current(),before:g,after:"~"}),g+=e.move("~~"),f(),g}function K(a){return a.length}function L(a){let b="string"==typeof a?a.codePointAt(0):0;return 67===b||99===b?99:76===b||108===b?108:114*(82===b||114===b)}J.peek=function(){return"~"};var M=c(294401);c(320608);c(210164);function N(a,b,c){let d=a.value||"",e="`",f=-1;for(;RegExp("(^|[^`])"+e+"([^`]|$)").test(d);)e+="`";for(/[^ \r\n]/.test(d)&&(/^[ \r\n]/.test(d)&&/[ \r\n]$/.test(d)||/^`|`$/.test(d))&&(d=" "+d+" ");++f<c.unsafe.length;){let a,b=c.unsafe[f],e=c.compilePattern(b);if(b.atBreak)for(;a=e.exec(d);){let b=a.index;10===d.charCodeAt(b)&&13===d.charCodeAt(b-1)&&b--,d=d.slice(0,b)+" "+d.slice(a.index+1)}}return e+d+e}N.peek=function(){return"`"};(0,h.C)(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let O={inlineCode:N,listItem:function(a,b,c,d){let e=function(a){let b=a.options.listItemIndent||"one";if("tab"!==b&&"one"!==b&&"mixed"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return b}(c),f=c.bulletCurrent||function(a){let b=a.options.bullet||"*";if("*"!==b&&"+"!==b&&"-"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.bullet`, expected `*`, `+`, or `-`");return b}(c);b&&"list"===b.type&&b.ordered&&(f=("number"==typeof b.start&&b.start>-1?b.start:1)+(!1===c.options.incrementListMarker?0:b.children.indexOf(a))+f);let g=f.length+1;("tab"===e||"mixed"===e&&(b&&"list"===b.type&&b.spread||a.spread))&&(g=4*Math.ceil(g/4));let h=c.createTracker(d);h.move(f+" ".repeat(g-f.length)),h.shift(g);let i=c.enter("listItem"),j=c.indentLines(c.containerFlow(a,h.current()),function(a,b,c){return b?(c?"":" ".repeat(g))+a:(c?f:f+" ".repeat(g-f.length))+a});return i(),j}};function P(a){let b=a._align;(0,e.ok)(b,"expected `_align` on table"),this.enter({type:"table",align:b.map(function(a){return"none"===a?null:a}),children:[]},a),this.data.inTable=!0}function Q(a){this.exit(a),this.data.inTable=void 0}function R(a){this.enter({type:"tableRow",children:[]},a)}function S(a){this.exit(a)}function T(a){this.enter({type:"tableCell",children:[]},a)}function U(a){let b=this.resume();this.data.inTable&&(b=b.replace(/\\([\\|])/g,V));let c=this.stack[this.stack.length-1];(0,e.ok)("inlineCode"===c.type),c.value=b,this.exit(a)}function V(a,b){return"|"===b?b:a}function W(a){let b=this.stack[this.stack.length-2];(0,e.ok)("listItem"===b.type),b.checked="taskListCheckValueChecked"===a.type}function X(a){let b=this.stack[this.stack.length-2];if(b&&"listItem"===b.type&&"boolean"==typeof b.checked){let a=this.stack[this.stack.length-1];(0,e.ok)("paragraph"===a.type);let c=a.children[0];if(c&&"text"===c.type){let d,e=b.children,f=-1;for(;++f<e.length;){let a=e[f];if("paragraph"===a.type){d=a;break}}d===a&&(c.value=c.value.slice(1),0===c.value.length?a.children.shift():a.position&&c.position&&"number"==typeof c.position.start.offset&&(c.position.start.column++,c.position.start.offset++,a.position.start=Object.assign({},c.position.start)))}}this.exit(a)}function Y(a,b,c,d){let e=a.children[0],f="boolean"==typeof a.checked&&e&&"paragraph"===e.type,g="["+(a.checked?"x":" ")+"] ",h=c.createTracker(d);f&&h.move(g);let i=O.listItem(a,b,c,{...d,...h.current()});return f&&(i=i.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(a){return a+g})),i}var Z=c(161693);let _={tokenize:function(a,b,c){let d=0;return function b(f){return(87===f||119===f)&&d<3?(d++,a.consume(f),b):46===f&&3===d?(a.consume(f),e):c(f)};function e(a){return null===a?c(a):b(a)}},partial:!0},aa={tokenize:function(a,b,c){let d,e,g;return h;function h(b){return 46===b||95===b?a.check(ac,j,i)(b):null===b||(0,f.Ee)(b)||(0,f.Ny)(b)||45!==b&&(0,f.es)(b)?j(b):(g=!0,a.consume(b),h)}function i(b){return 95===b?d=!0:(e=d,d=void 0),a.consume(b),h}function j(a){return e||d||!g?c(a):b(a)}},partial:!0},ab={tokenize:function(a,b){let c=0,d=0;return e;function e(h){return 40===h?(c++,a.consume(h),e):41===h&&d<c?g(h):33===h||34===h||38===h||39===h||41===h||42===h||44===h||46===h||58===h||59===h||60===h||63===h||93===h||95===h||126===h?a.check(ac,b,g)(h):null===h||(0,f.Ee)(h)||(0,f.Ny)(h)?b(h):(a.consume(h),e)}function g(b){return 41===b&&d++,a.consume(b),e}},partial:!0},ac={tokenize:function(a,b,c){return d;function d(h){return 33===h||34===h||39===h||41===h||42===h||44===h||46===h||58===h||59===h||63===h||95===h||126===h?(a.consume(h),d):38===h?(a.consume(h),g):93===h?(a.consume(h),e):60===h||null===h||(0,f.Ee)(h)||(0,f.Ny)(h)?b(h):c(h)}function e(a){return null===a||40===a||91===a||(0,f.Ee)(a)||(0,f.Ny)(a)?b(a):d(a)}function g(b){return(0,f.CW)(b)?function b(e){return 59===e?(a.consume(e),d):(0,f.CW)(e)?(a.consume(e),b):c(e)}(b):c(b)}},partial:!0},ad={tokenize:function(a,b,c){return function(b){return a.consume(b),d};function d(a){return(0,f.lV)(a)?c(a):b(a)}},partial:!0},ae={name:"wwwAutolink",tokenize:function(a,b,c){let d=this;return function(b){return 87!==b&&119!==b||!aj.call(d,d.previous)||an(d.events)?c(b):(a.enter("literalAutolink"),a.enter("literalAutolinkWww"),a.check(_,a.attempt(aa,a.attempt(ab,e),c),c)(b))};function e(c){return a.exit("literalAutolinkWww"),a.exit("literalAutolink"),b(c)}},previous:aj},af={name:"protocolAutolink",tokenize:function(a,b,c){let d=this,e="",g=!1;return function(b){return(72===b||104===b)&&ak.call(d,d.previous)&&!an(d.events)?(a.enter("literalAutolink"),a.enter("literalAutolinkHttp"),e+=String.fromCodePoint(b),a.consume(b),h):c(b)};function h(b){if((0,f.CW)(b)&&e.length<5)return e+=String.fromCodePoint(b),a.consume(b),h;if(58===b){let c=e.toLowerCase();if("http"===c||"https"===c)return a.consume(b),i}return c(b)}function i(b){return 47===b?(a.consume(b),g)?j:(g=!0,i):c(b)}function j(b){return null===b||(0,f.JQ)(b)||(0,f.Ee)(b)||(0,f.Ny)(b)||(0,f.es)(b)?c(b):a.attempt(aa,a.attempt(ab,k),c)(b)}function k(c){return a.exit("literalAutolinkHttp"),a.exit("literalAutolink"),b(c)}},previous:ak},ag={name:"emailAutolink",tokenize:function(a,b,c){let d,e,g=this;return function(b){return!am(b)||!al.call(g,g.previous)||an(g.events)?c(b):(a.enter("literalAutolink"),a.enter("literalAutolinkEmail"),function b(d){return am(d)?(a.consume(d),b):64===d?(a.consume(d),h):c(d)}(b))};function h(b){return 46===b?a.check(ad,j,i)(b):45===b||95===b||(0,f.lV)(b)?(e=!0,a.consume(b),h):j(b)}function i(b){return a.consume(b),d=!0,h}function j(h){return e&&d&&(0,f.CW)(g.previous)?(a.exit("literalAutolinkEmail"),a.exit("literalAutolink"),b(h)):c(h)}},previous:al},ah={},ai=48;for(;ai<123;)ah[ai]=ag,58==++ai?ai=65:91===ai&&(ai=97);function aj(a){return null===a||40===a||42===a||95===a||91===a||93===a||126===a||(0,f.Ee)(a)}function ak(a){return!(0,f.CW)(a)}function al(a){return!(47===a||am(a))}function am(a){return 43===a||45===a||46===a||95===a||(0,f.lV)(a)}function an(a){let b=a.length,c=!1;for(;b--;){let d=a[b][1];if(("labelLink"===d.type||"labelImage"===d.type)&&!d._balanced){c=!0;break}if(d._gfmAutolinkLiteralWalkedInto){c=!1;break}}return a.length>0&&!c&&(a[a.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),c}ah[43]=ag,ah[45]=ag,ah[46]=ag,ah[95]=ag,ah[72]=[ag,af],ah[104]=[ag,af],ah[87]=[ag,ae],ah[119]=[ag,ae];var ao=c(360478),ap=c(621405);let aq={tokenize:function(a,b,c){let d=this;return(0,ap.N)(a,function(a){let e=d.events[d.events.length-1];return e&&"gfmFootnoteDefinitionIndent"===e[1].type&&4===e[2].sliceSerialize(e[1],!0).length?b(a):c(a)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function ar(a,b,c){let d,e=this,f=e.events.length,g=e.parser.gfmFootnotes||(e.parser.gfmFootnotes=[]);for(;f--;){let a=e.events[f][1];if("labelImage"===a.type){d=a;break}if("gfmFootnoteCall"===a.type||"labelLink"===a.type||"label"===a.type||"image"===a.type||"link"===a.type)break}return function(f){if(!d||!d._balanced)return c(f);let h=(0,u.B)(e.sliceSerialize({start:d.end,end:e.now()}));return 94===h.codePointAt(0)&&g.includes(h.slice(1))?(a.enter("gfmFootnoteCallLabelMarker"),a.consume(f),a.exit("gfmFootnoteCallLabelMarker"),b(f)):c(f)}}function as(a,b){let c=a.length;for(;c--;)if("labelImage"===a[c][1].type&&"enter"===a[c][0]){a[c][1];break}a[c+1][1].type="data",a[c+3][1].type="gfmFootnoteCallLabelMarker";let d={type:"gfmFootnoteCall",start:Object.assign({},a[c+3][1].start),end:Object.assign({},a[a.length-1][1].end)},e={type:"gfmFootnoteCallMarker",start:Object.assign({},a[c+3][1].end),end:Object.assign({},a[c+3][1].end)};e.end.column++,e.end.offset++,e.end._bufferIndex++;let f={type:"gfmFootnoteCallString",start:Object.assign({},e.end),end:Object.assign({},a[a.length-1][1].start)},g={type:"chunkString",contentType:"string",start:Object.assign({},f.start),end:Object.assign({},f.end)},h=[a[c+1],a[c+2],["enter",d,b],a[c+3],a[c+4],["enter",e,b],["exit",e,b],["enter",f,b],["enter",g,b],["exit",g,b],["exit",f,b],a[a.length-2],a[a.length-1],["exit",d,b]];return a.splice(c,a.length-c+1,...h),a}function at(a,b,c){let d,e=this,g=e.parser.gfmFootnotes||(e.parser.gfmFootnotes=[]),h=0;return function(b){return a.enter("gfmFootnoteCall"),a.enter("gfmFootnoteCallLabelMarker"),a.consume(b),a.exit("gfmFootnoteCallLabelMarker"),i};function i(b){return 94!==b?c(b):(a.enter("gfmFootnoteCallMarker"),a.consume(b),a.exit("gfmFootnoteCallMarker"),a.enter("gfmFootnoteCallString"),a.enter("chunkString").contentType="string",j)}function j(i){if(h>999||93===i&&!d||null===i||91===i||(0,f.Ee)(i))return c(i);if(93===i){a.exit("chunkString");let d=a.exit("gfmFootnoteCallString");return g.includes((0,u.B)(e.sliceSerialize(d)))?(a.enter("gfmFootnoteCallLabelMarker"),a.consume(i),a.exit("gfmFootnoteCallLabelMarker"),a.exit("gfmFootnoteCall"),b):c(i)}return(0,f.Ee)(i)||(d=!0),h++,a.consume(i),92===i?k:j}function k(b){return 91===b||92===b||93===b?(a.consume(b),h++,j):j(b)}}function au(a,b,c){let d,e,g=this,h=g.parser.gfmFootnotes||(g.parser.gfmFootnotes=[]),i=0;return function(b){return a.enter("gfmFootnoteDefinition")._container=!0,a.enter("gfmFootnoteDefinitionLabel"),a.enter("gfmFootnoteDefinitionLabelMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionLabelMarker"),j};function j(b){return 94===b?(a.enter("gfmFootnoteDefinitionMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionMarker"),a.enter("gfmFootnoteDefinitionLabelString"),a.enter("chunkString").contentType="string",k):c(b)}function k(b){if(i>999||93===b&&!e||null===b||91===b||(0,f.Ee)(b))return c(b);if(93===b){a.exit("chunkString");let c=a.exit("gfmFootnoteDefinitionLabelString");return d=(0,u.B)(g.sliceSerialize(c)),a.enter("gfmFootnoteDefinitionLabelMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionLabelMarker"),a.exit("gfmFootnoteDefinitionLabel"),m}return(0,f.Ee)(b)||(e=!0),i++,a.consume(b),92===b?l:k}function l(b){return 91===b||92===b||93===b?(a.consume(b),i++,k):k(b)}function m(b){return 58===b?(a.enter("definitionMarker"),a.consume(b),a.exit("definitionMarker"),h.includes(d)||h.push(d),(0,ap.N)(a,n,"gfmFootnoteDefinitionWhitespace")):c(b)}function n(a){return b(a)}}function av(a,b,c){return a.check(ao.B,b,a.attempt(aq,b,c))}function aw(a){a.exit("gfmFootnoteDefinition")}var ax=c(962349),ay=c(598525);class az{constructor(){this.map=[]}add(a,b,c){!function(a,b,c,d){let e=0;if(0!==c||0!==d.length){for(;e<a.map.length;){if(a.map[e][0]===b){a.map[e][1]+=c,a.map[e][2].push(...d);return}e+=1}a.map.push([b,c,d])}}(this,a,b,c)}consume(a){if(this.map.sort(function(a,b){return a[0]-b[0]}),0===this.map.length)return;let b=this.map.length,c=[];for(;b>0;)b-=1,c.push(a.slice(this.map[b][0]+this.map[b][1]),this.map[b][2]),a.length=this.map[b][0];c.push(a.slice()),a.length=0;let d=c.pop();for(;d;){for(let b of d)a.push(b);d=c.pop()}this.map.length=0}}function aA(a,b,c){let d,e=this,g=0,h=0;return function(a){let b=e.events.length-1;for(;b>-1;){let a=e.events[b][1].type;if("lineEnding"===a||"linePrefix"===a)b--;else break}let d=b>-1?e.events[b][1].type:null,f="tableHead"===d||"tableRow"===d?t:i;return f===t&&e.parser.lazy[e.now().line]?c(a):f(a)};function i(b){var c;return a.enter("tableHead"),a.enter("tableRow"),124===(c=b)||(d=!0,h+=1),j(c)}function j(b){return null===b?c(b):(0,f.HP)(b)?h>1?(h=0,e.interrupt=!0,a.exit("tableRow"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),m):c(b):(0,f.On)(b)?(0,ap.N)(a,j,"whitespace")(b):(h+=1,d&&(d=!1,g+=1),124===b)?(a.enter("tableCellDivider"),a.consume(b),a.exit("tableCellDivider"),d=!0,j):(a.enter("data"),k(b))}function k(b){return null===b||124===b||(0,f.Ee)(b)?(a.exit("data"),j(b)):(a.consume(b),92===b?l:k)}function l(b){return 92===b||124===b?(a.consume(b),k):k(b)}function m(b){return(e.interrupt=!1,e.parser.lazy[e.now().line])?c(b):(a.enter("tableDelimiterRow"),d=!1,(0,f.On)(b))?(0,ap.N)(a,n,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):n(b)}function n(b){return 45===b||58===b?p(b):124===b?(d=!0,a.enter("tableCellDivider"),a.consume(b),a.exit("tableCellDivider"),o):c(b)}function o(b){return(0,f.On)(b)?(0,ap.N)(a,p,"whitespace")(b):p(b)}function p(b){return 58===b?(h+=1,d=!0,a.enter("tableDelimiterMarker"),a.consume(b),a.exit("tableDelimiterMarker"),q):45===b?(h+=1,q(b)):null===b||(0,f.HP)(b)?s(b):c(b)}function q(b){return 45===b?(a.enter("tableDelimiterFiller"),function b(c){return 45===c?(a.consume(c),b):58===c?(d=!0,a.exit("tableDelimiterFiller"),a.enter("tableDelimiterMarker"),a.consume(c),a.exit("tableDelimiterMarker"),r):(a.exit("tableDelimiterFiller"),r(c))}(b)):c(b)}function r(b){return(0,f.On)(b)?(0,ap.N)(a,s,"whitespace")(b):s(b)}function s(e){if(124===e)return n(e);if(null===e||(0,f.HP)(e))return d&&g===h?(a.exit("tableDelimiterRow"),a.exit("tableHead"),b(e)):c(e);return c(e)}function t(b){return a.enter("tableRow"),u(b)}function u(c){return 124===c?(a.enter("tableCellDivider"),a.consume(c),a.exit("tableCellDivider"),u):null===c||(0,f.HP)(c)?(a.exit("tableRow"),b(c)):(0,f.On)(c)?(0,ap.N)(a,u,"whitespace")(c):(a.enter("data"),v(c))}function v(b){return null===b||124===b||(0,f.Ee)(b)?(a.exit("data"),u(b)):(a.consume(b),92===b?w:v)}function w(b){return 92===b||124===b?(a.consume(b),v):v(b)}}function aB(a,b){let c,d,e,f=-1,g=!0,h=0,i=[0,0,0,0],j=[0,0,0,0],k=!1,l=0,m=new az;for(;++f<a.length;){let n=a[f],o=n[1];"enter"===n[0]?"tableHead"===o.type?(k=!1,0!==l&&(aD(m,b,l,c,d),d=void 0,l=0),c={type:"table",start:Object.assign({},o.start),end:Object.assign({},o.end)},m.add(f,0,[["enter",c,b]])):"tableRow"===o.type||"tableDelimiterRow"===o.type?(g=!0,e=void 0,i=[0,0,0,0],j=[0,f+1,0,0],k&&(k=!1,d={type:"tableBody",start:Object.assign({},o.start),end:Object.assign({},o.end)},m.add(f,0,[["enter",d,b]])),h="tableDelimiterRow"===o.type?2:d?3:1):h&&("data"===o.type||"tableDelimiterMarker"===o.type||"tableDelimiterFiller"===o.type)?(g=!1,0===j[2]&&(0!==i[1]&&(j[0]=j[1],e=aC(m,b,i,h,void 0,e),i=[0,0,0,0]),j[2]=f)):"tableCellDivider"===o.type&&(g?g=!1:(0!==i[1]&&(j[0]=j[1],e=aC(m,b,i,h,void 0,e)),j=[(i=j)[1],f,0,0])):"tableHead"===o.type?(k=!0,l=f):"tableRow"===o.type||"tableDelimiterRow"===o.type?(l=f,0!==i[1]?(j[0]=j[1],e=aC(m,b,i,h,f,e)):0!==j[1]&&(e=aC(m,b,j,h,f,e)),h=0):h&&("data"===o.type||"tableDelimiterMarker"===o.type||"tableDelimiterFiller"===o.type)&&(j[3]=f)}for(0!==l&&aD(m,b,l,c,d),m.consume(b.events),f=-1;++f<b.events.length;){let a=b.events[f];"enter"===a[0]&&"table"===a[1].type&&(a[1]._align=function(a,b){let c=!1,d=[];for(;b<a.length;){let e=a[b];if(c){if("enter"===e[0])"tableContent"===e[1].type&&d.push("tableDelimiterMarker"===a[b+1][1].type?"left":"none");else if("tableContent"===e[1].type){if("tableDelimiterMarker"===a[b-1][1].type){let a=d.length-1;d[a]="left"===d[a]?"center":"right"}}else if("tableDelimiterRow"===e[1].type)break}else"enter"===e[0]&&"tableDelimiterRow"===e[1].type&&(c=!0);b+=1}return d}(b.events,f))}return a}function aC(a,b,c,d,e,f){0!==c[0]&&(f.end=Object.assign({},aE(b.events,c[0])),a.add(c[0],0,[["exit",f,b]]));let g=aE(b.events,c[1]);if(f={type:1===d?"tableHeader":2===d?"tableDelimiter":"tableData",start:Object.assign({},g),end:Object.assign({},g)},a.add(c[1],0,[["enter",f,b]]),0!==c[2]){let e=aE(b.events,c[2]),f=aE(b.events,c[3]),g={type:"tableContent",start:Object.assign({},e),end:Object.assign({},f)};if(a.add(c[2],0,[["enter",g,b]]),2!==d){let d=b.events[c[2]],e=b.events[c[3]];if(d[1].end=Object.assign({},e[1].end),d[1].type="chunkText",d[1].contentType="text",c[3]>c[2]+1){let b=c[2]+1,d=c[3]-c[2]-1;a.add(b,d,[])}}a.add(c[3]+1,0,[["exit",g,b]])}return void 0!==e&&(f.end=Object.assign({},aE(b.events,e)),a.add(e,0,[["exit",f,b]]),f=void 0),f}function aD(a,b,c,d,e){let f=[],g=aE(b.events,c);e&&(e.end=Object.assign({},g),f.push(["exit",e,b])),d.end=Object.assign({},g),f.push(["exit",d,b]),a.add(c+1,0,f)}function aE(a,b){let c=a[b],d="enter"===c[0]?"start":"end";return c[1][d]}let aF={name:"tasklistCheck",tokenize:function(a,b,c){let d=this;return function(b){return null===d.previous&&d._gfmTasklistFirstContentOfListItem?(a.enter("taskListCheck"),a.enter("taskListCheckMarker"),a.consume(b),a.exit("taskListCheckMarker"),e):c(b)};function e(b){return(0,f.Ee)(b)?(a.enter("taskListCheckValueUnchecked"),a.consume(b),a.exit("taskListCheckValueUnchecked"),g):88===b||120===b?(a.enter("taskListCheckValueChecked"),a.consume(b),a.exit("taskListCheckValueChecked"),g):c(b)}function g(b){return 93===b?(a.enter("taskListCheckMarker"),a.consume(b),a.exit("taskListCheckMarker"),a.exit("taskListCheck"),h):c(b)}function h(d){return(0,f.HP)(d)?b(d):(0,f.On)(d)?a.check({tokenize:aG},b,c)(d):c(d)}}};function aG(a,b,c){return(0,ap.N)(a,function(a){return null===a?c(a):b(a)},"whitespace")}let aH={};function aI(a){let b,c=a||aH,d=this.data(),e=d.micromarkExtensions||(d.micromarkExtensions=[]),f=d.fromMarkdownExtensions||(d.fromMarkdownExtensions=[]),g=d.toMarkdownExtensions||(d.toMarkdownExtensions=[]);e.push((0,Z.y)([{text:ah},{document:{91:{name:"gfmFootnoteDefinition",tokenize:au,continuation:{tokenize:av},exit:aw}},text:{91:{name:"gfmFootnoteCall",tokenize:at},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ar,resolveTo:as}}},function(a){let b=(a||{}).singleTilde,c={name:"strikethrough",tokenize:function(a,c,d){let e=this.previous,f=this.events,g=0;return function(h){return 126===e&&"characterEscape"!==f[f.length-1][1].type?d(h):(a.enter("strikethroughSequenceTemporary"),function f(h){let i=(0,M.S)(e);if(126===h)return g>1?d(h):(a.consume(h),g++,f);if(g<2&&!b)return d(h);let j=a.exit("strikethroughSequenceTemporary"),k=(0,M.S)(h);return j._open=!k||2===k&&!!i,j._close=!i||2===i&&!!k,c(h)}(h))}},resolveAll:function(a,b){let c=-1;for(;++c<a.length;)if("enter"===a[c][0]&&"strikethroughSequenceTemporary"===a[c][1].type&&a[c][1]._close){let d=c;for(;d--;)if("exit"===a[d][0]&&"strikethroughSequenceTemporary"===a[d][1].type&&a[d][1]._open&&a[c][1].end.offset-a[c][1].start.offset==a[d][1].end.offset-a[d][1].start.offset){a[c][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";let e={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[c][1].end)},f={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[c][1].start)},g=[["enter",e,b],["enter",a[d][1],b],["exit",a[d][1],b],["enter",f,b]],h=b.parser.constructs.insideSpan.null;h&&(0,ax.m)(g,g.length,0,(0,ay.W)(h,a.slice(d+1,c),b)),(0,ax.m)(g,g.length,0,[["exit",f,b],["enter",a[c][1],b],["exit",a[c][1],b],["exit",e,b]]),(0,ax.m)(a,d-1,c-d+3,g),c=d+g.length-2;break}}for(c=-1;++c<a.length;)"strikethroughSequenceTemporary"===a[c][1].type&&(a[c][1].type="data");return a}};return null==b&&(b=!0),{text:{126:c},insideSpan:{null:[c]},attentionMarkers:{null:[126]}}}(c),{flow:{null:{name:"table",tokenize:aA,resolveAll:aB}}},{text:{91:aF}}])),f.push([{transforms:[q],enter:{literalAutolink:k,literalAutolinkEmail:l,literalAutolinkHttp:l,literalAutolinkWww:l},exit:{literalAutolink:p,literalAutolinkEmail:o,literalAutolinkHttp:m,literalAutolinkWww:n}},{enter:{gfmFootnoteCallString:v,gfmFootnoteCall:w,gfmFootnoteDefinitionLabelString:x,gfmFootnoteDefinition:y},exit:{gfmFootnoteCallString:z,gfmFootnoteCall:A,gfmFootnoteDefinitionLabelString:B,gfmFootnoteDefinition:C}},{canContainEols:["delete"],enter:{strikethrough:H},exit:{strikethrough:I}},{enter:{table:P,tableData:T,tableHeader:T,tableRow:R},exit:{codeText:U,table:Q,tableData:S,tableHeader:S,tableRow:S}},{exit:{taskListCheckValueChecked:W,taskListCheckValueUnchecked:W,paragraph:X}}]),g.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:i,notInConstruct:j},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:i,notInConstruct:j},{character:":",before:"[ps]",after:"\\/",inConstruct:i,notInConstruct:j}]},(b=!1,c&&c.firstLineBlank&&(b=!0),{handlers:{footnoteDefinition:function(a,c,d,e){let f=d.createTracker(e),g=f.move("[^"),h=d.enter("footnoteDefinition"),i=d.enter("label");return g+=f.move(d.safe(d.associationId(a),{before:g,after:"]"})),i(),g+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),g+=f.move((b?"\n":" ")+d.indentLines(d.containerFlow(a,f.current()),b?F:E))),h(),g},footnoteReference:D},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:G}],handlers:{delete:J}},function(a){let b=a||{},c=b.tableCellPadding,d=b.tablePipeAlign,e=b.stringLength,f=c?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(a,b,c){let d=O.inlineCode(a,b,c);return c.stack.includes("tableCell")&&(d=d.replace(/\|/g,"\\$&")),d},table:function(a,b,c,d){return h(function(a,b,c){let d=a.children,e=-1,f=[],g=b.enter("table");for(;++e<d.length;)f[e]=i(d[e],b,c);return g(),f}(a,c,d),a.align)},tableCell:g,tableRow:function(a,b,c,d){let e=h([i(a,c,d)]);return e.slice(0,e.indexOf("\n"))}}};function g(a,b,c,d){let e=c.enter("tableCell"),g=c.enter("phrasing"),h=c.containerPhrasing(a,{...d,before:f,after:f});return g(),e(),h}function h(a,b){return function(a,b){let c=b||{},d=(c.align||[]).concat(),e=c.stringLength||K,f=[],g=[],h=[],i=[],j=0,k=-1;for(;++k<a.length;){let b=[],d=[],f=-1;for(a[k].length>j&&(j=a[k].length);++f<a[k].length;){var l;let g=null==(l=a[k][f])?"":String(l);if(!1!==c.alignDelimiters){let a=e(g);d[f]=a,(void 0===i[f]||a>i[f])&&(i[f]=a)}b.push(g)}g[k]=b,h[k]=d}let m=-1;if("object"==typeof d&&"length"in d)for(;++m<j;)f[m]=L(d[m]);else{let a=L(d);for(;++m<j;)f[m]=a}m=-1;let n=[],o=[];for(;++m<j;){let a=f[m],b="",d="";99===a?(b=":",d=":"):108===a?b=":":114===a&&(d=":");let e=!1===c.alignDelimiters?1:Math.max(1,i[m]-b.length-d.length),g=b+"-".repeat(e)+d;!1!==c.alignDelimiters&&((e=b.length+e+d.length)>i[m]&&(i[m]=e),o[m]=e),n[m]=g}g.splice(1,0,n),h.splice(1,0,o),k=-1;let p=[];for(;++k<g.length;){let a=g[k],b=h[k];m=-1;let d=[];for(;++m<j;){let e=a[m]||"",g="",h="";if(!1!==c.alignDelimiters){let a=i[m]-(b[m]||0),c=f[m];114===c?g=" ".repeat(a):99===c?a%2?(g=" ".repeat(a/2+.5),h=" ".repeat(a/2-.5)):h=g=" ".repeat(a/2):h=" ".repeat(a)}!1===c.delimiterStart||m||d.push("|"),!1!==c.padding&&(!1!==c.alignDelimiters||""!==e)&&(!1!==c.delimiterStart||m)&&d.push(" "),!1!==c.alignDelimiters&&d.push(g),d.push(e),!1!==c.alignDelimiters&&d.push(h),!1!==c.padding&&d.push(" "),(!1!==c.delimiterEnd||m!==j-1)&&d.push("|")}p.push(!1===c.delimiterEnd?d.join("").replace(/ +$/,""):d.join(""))}return p.join("\n")}(a,{align:b,alignDelimiters:d,padding:c,stringLength:e})}function i(a,b,c){let d=a.children,e=-1,f=[],h=b.enter("tableRow");for(;++e<d.length;)f[e]=g(d[e],a,b,c);return h(),f}}(c),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Y}}]})}},663033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},665466:(a,b,c)=>{"use strict";c.d(b,{E:()=>i,I:()=>j});var d=c(736927),e=c(115962),f=c(437503),g=c(930439),h=c(535798);function i({event:a,expanded:b,onToggle:c,onOpenPerson:e,onOpenCompany:g}){let i=a.start_at?new Date(a.start_at):null,k=a.end_at?new Date(a.end_at):null,l=i?k?`${o(i)} – ${o(k)}`:o(i):"",m=(a.attendees??[]).slice(0,5),p=(a.attendees?.length??0)-m.length;return(0,d.jsxs)("li",{className:"overflow-hidden",style:{background:b?"var(--color-surface-hover)":"transparent",transition:"background 120ms ease"},children:[(0,d.jsxs)("div",{role:"button",tabIndex:0,"aria-expanded":b,onClick:c,onKeyDown:a=>{a.target===a.currentTarget&&("Enter"===a.key||" "===a.key)&&(a.preventDefault(),c())},className:"group/event w-full flex items-center gap-3 px-3 py-2 text-left cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)] transition-colors",onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:[(0,d.jsx)("div",{className:"text-[12px] tabular-nums shrink-0 whitespace-nowrap",style:{color:"var(--color-text-muted)",width:"11rem"},children:l||(a.start_at?(0,h.wI)(a.start_at):"")}),(0,d.jsxs)("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[(0,d.jsx)("p",{className:"truncate text-[13.5px]",style:{color:"var(--color-text)",fontWeight:500},children:a.title?.trim()||"(no title)"}),a.meeting_type&&(0,d.jsx)("span",{className:"shrink-0 rounded-full px-1.5 py-0 text-[10px] uppercase tracking-[0.06em]",style:{background:"var(--color-surface-hover)",color:"var(--color-text-muted)",fontWeight:600},children:a.meeting_type})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[m.length>0&&(0,d.jsxs)("div",{className:"flex items-center -space-x-1.5",children:[m.slice(0,4).map(a=>(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),e?.(a.id)},disabled:!e,title:a.name??a.email??void 0,className:"disabled:cursor-default rounded-full",style:{boxShadow:"0 0 0 2px var(--color-background)"},children:(0,d.jsx)(f.X,{src:a.avatar_url,name:a.name,seed:a.email??a.id,size:"sm"})},a.id)),p>0&&(0,d.jsxs)("span",{className:"ml-1 text-[11px] tabular-nums",style:{color:"var(--color-text-muted)"},children:["+",p]})]}),(0,d.jsx)(n,{expanded:b})]})]}),(0,d.jsx)("div",{className:"grid transition-[grid-template-rows] duration-[220ms] ease-out motion-reduce:transition-none",style:{gridTemplateRows:b?"1fr":"0fr"},children:(0,d.jsx)("div",{className:"overflow-hidden",children:b&&(0,d.jsx)(j,{eventId:a.id,fallbackEvent:a,onOpenPerson:e,onOpenCompany:g})})})]})}function j({eventId:a,fallbackEvent:b,onOpenPerson:c,onOpenCompany:f}){var g;let[h,i]=(0,e.useState)(null),[j,n]=(0,e.useState)(!0),[p,q]=(0,e.useState)(null),r=h?.event.start_at??b.start_at?new Date(h?.event.start_at??b.start_at):null,s=h?.event.end_at??b.end_at?new Date(h?.event.end_at??b.end_at):null,t=r?(g=r,new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(g)):null,u=r?s?`${o(r)} – ${o(s)}`:o(r):null,v=r&&s?function(a,b){let c=b.getTime()-a.getTime();if(c<=0)return"";let d=Math.round(c/6e4);if(d>=1440){let a=Math.round(d/1440);return`${a} day${1===a?"":"s"}`}let e=Math.floor(d/60),f=d%60;return 0===e?`${f} min`:0===f?`${e}h`:`${e}h ${f}m`}(r,s):null,w=h?.organizer??null,x=h?.attendees??b.attendees??[],y=h?.companies??[];return(0,d.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border)",background:"var(--color-background)"},children:[(t||u||v)&&(0,d.jsx)(k,{label:"When",children:(0,d.jsxs)("div",{className:"text-[13px]",style:{color:"var(--color-text)"},children:[t&&(0,d.jsx)("div",{className:"font-medium",children:t}),(u||v)&&(0,d.jsxs)("div",{className:"mt-0.5",style:{color:"var(--color-text-muted)"},children:[u,u&&v&&" \xb7 ",v]})]})}),w&&(0,d.jsx)(k,{label:"Organizer",children:(0,d.jsx)(l,{person:w,onOpenPerson:c})}),x.length>0&&(0,d.jsx)(k,{label:`Attendees \xb7 ${x.length}`,children:(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:x.map(a=>(0,d.jsx)(l,{person:a,onOpenPerson:c},a.id))})}),y.length>0&&(0,d.jsx)(k,{label:1===y.length?"Company":"Companies",children:(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:y.map(a=>(0,d.jsx)(m,{company:a,onOpenCompany:f},a.id))})}),j&&!h&&(0,d.jsx)("p",{className:"text-[12px]",style:{color:"var(--color-text-muted)"},children:"Loading meeting details…"}),p&&(0,d.jsxs)("p",{className:"text-[12px]",style:{color:"var(--color-text-muted)"},children:["Couldn’t load meeting details (",p,"). Showing what we have."]}),!j&&!p&&h&&0===x.length&&!w&&0===y.length&&(0,d.jsx)("p",{className:"text-[12px]",style:{color:"var(--color-text-muted)"},children:"No additional details for this meeting."})]})}function k({label:a,children:b}){return(0,d.jsxs)("div",{className:"mb-4 last:mb-0",children:[(0,d.jsx)("h4",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-[0.16em]",style:{color:"var(--color-text-muted)"},children:a}),b]})}function l({person:a,onOpenPerson:b}){let c=a.name?.trim()||a.email||"Unknown",e=a.name?.trim()&&a.email?a.email:null;return(0,d.jsxs)("button",{type:"button",onClick:()=>b?.(a.id),disabled:!b,className:"flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left transition-colors disabled:cursor-default",style:{color:"var(--color-text)"},onMouseEnter:a=>{b&&(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsx)(f.X,{src:a.avatar_url,name:c,seed:a.email??a.id,size:"sm"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-[13px] font-medium",style:{color:"var(--color-text)"},children:c}),e&&(0,d.jsx)("p",{className:"truncate text-[11px]",style:{color:"var(--color-text-muted)"},children:e})]})]})}function m({company:a,onOpenCompany:b}){let c=a.name?.trim()||a.domain||"Unknown company";return(0,d.jsxs)("button",{type:"button",onClick:()=>b?.(a.id),disabled:!b,className:"flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left transition-colors disabled:cursor-default",onMouseEnter:a=>{b&&(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsx)(g.g,{domain:a.domain,name:a.name,size:"sm"}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"truncate text-[13px] font-medium",style:{color:"var(--color-text)"},children:c}),a.domain&&a.name&&(0,d.jsx)("p",{className:"truncate text-[11px]",style:{color:"var(--color-text-muted)"},children:a.domain})]})]})}function n({expanded:a}){return(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,className:"motion-reduce:transition-none",style:{color:"var(--color-text-muted)",transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"},children:(0,d.jsx)("path",{d:"m6 9 6 6 6-6"})})}function o(a){return new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(a)}},669661:(a,b,c)=>{"use strict";c.d(b,{Lz:()=>bR,NZ:()=>br,zF:()=>bu});var d=c(381802),e=c(331480),f=c(731626);let g=function(a){for(var b=0;;b++)if(!(a=a.previousSibling))return b},h=function(a){let b=a.assignedSlot||a.parentNode;return b&&11==b.nodeType?b.host:b},i=null,j=function(a,b,c){let d=i||(i=document.createRange());return d.setEnd(a,null==c?a.nodeValue.length:c),d.setStart(a,b||0),d},k=function(){i=null},l=function(a,b,c,d){return c&&(n(a,b,c,d,-1)||n(a,b,c,d,1))},m=/^(img|br|input|textarea|hr)$/i;function n(a,b,c,d,e){for(var f;;){if(a==c&&b==d)return!0;if(b==(e<0?0:o(a))){let c=a.parentNode;if(!c||1!=c.nodeType||p(a)||m.test(a.nodeName)||"false"==a.contentEditable)return!1;b=g(a)+(e<0?0:1),a=c}else{if(1!=a.nodeType)return!1;let c=a.childNodes[b+(e<0?-1:0)];if(1==c.nodeType&&"false"==c.contentEditable)if(null==(f=c.pmViewDesc)||!f.ignoreForSelection)return!1;else b+=e;else a=c,b=e<0?o(a):0}}}function o(a){return 3==a.nodeType?a.nodeValue.length:a.childNodes.length}function p(a){let b;for(let c=a;c&&!(b=c.pmViewDesc);c=c.parentNode);return b&&b.node&&b.node.isBlock&&(b.dom==a||b.contentDOM==a)}let q=function(a){return a.focusNode&&l(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset)};function r(a,b){let c=document.createEvent("Event");return c.initEvent("keydown",!0,!0),c.keyCode=a,c.key=c.code=b,c}let s="undefined"!=typeof navigator?navigator:null,t="undefined"!=typeof document?document:null,u=s&&s.userAgent||"",v=/Edge\/(\d+)/.exec(u),w=/MSIE \d/.exec(u),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(u),y=!!(w||x||v),z=w?document.documentMode:x?+x[1]:v?+v[1]:0,A=!y&&/gecko\/(\d+)/i.test(u);A&&(/Firefox\/(\d+)/.exec(u)||[0,0])[1];let B=!y&&/Chrome\/(\d+)/.exec(u),C=!!B,D=B?+B[1]:0,E=!y&&!!s&&/Apple Computer/.test(s.vendor),F=E&&(/Mobile\/\w+/.test(u)||!!s&&s.maxTouchPoints>2),G=F||!!s&&/Mac/.test(s.platform),H=!!s&&/Win/.test(s.platform),I=/Android \d/.test(u),J=!!t&&"webkitFontSmoothing"in t.documentElement.style,K=J?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function L(a,b){return"number"==typeof a?a:a[b]}function M(a,b,c){let d=a.someProp("scrollThreshold")||0,e=a.someProp("scrollMargin")||5,f=a.dom.ownerDocument;for(let g=c||a.dom;g;){if(1!=g.nodeType){g=h(g);continue}let a=g,c=a==f.body,i=c?function(a){let b=a.defaultView&&a.defaultView.visualViewport;return b?{left:0,right:b.width,top:0,bottom:b.height}:{left:0,right:a.documentElement.clientWidth,top:0,bottom:a.documentElement.clientHeight}}(f):function(a){let b=a.getBoundingClientRect(),c=b.width/a.offsetWidth||1,d=b.height/a.offsetHeight||1;return{left:b.left,right:b.left+a.clientWidth*c,top:b.top,bottom:b.top+a.clientHeight*d}}(a),j=0,k=0;if(b.top<i.top+L(d,"top")?k=-(i.top-b.top+L(e,"top")):b.bottom>i.bottom-L(d,"bottom")&&(k=b.bottom-b.top>i.bottom-i.top?b.top+L(e,"top")-i.top:b.bottom-i.bottom+L(e,"bottom")),b.left<i.left+L(d,"left")?j=-(i.left-b.left+L(e,"left")):b.right>i.right-L(d,"right")&&(j=b.right-i.right+L(e,"right")),j||k)if(c)f.defaultView.scrollBy(j,k);else{let c=a.scrollLeft,d=a.scrollTop;k&&(a.scrollTop+=k),j&&(a.scrollLeft+=j);let e=a.scrollLeft-c,f=a.scrollTop-d;b={left:b.left-e,top:b.top-f,right:b.right-e,bottom:b.bottom-f}}let l=c?"fixed":getComputedStyle(g).position;if(/^(fixed|sticky)$/.test(l))break;g="absolute"==l?g.offsetParent:h(g)}}function N(a){let b=[],c=a.ownerDocument;for(let d=a;d&&(b.push({dom:d,top:d.scrollTop,left:d.scrollLeft}),a!=c);d=h(d));return b}function O(a,b){for(let c=0;c<a.length;c++){let{dom:d,top:e,left:f}=a[c];d.scrollTop!=e+b&&(d.scrollTop=e+b),d.scrollLeft!=f&&(d.scrollLeft=f)}}let P=null;function Q(a,b){return a.left>=b.left-1&&a.left<=b.right+1&&a.top>=b.top-1&&a.top<=b.bottom+1}function R(a){return a.top<a.bottom||a.left<a.right}function S(a,b){let c=a.getClientRects();if(c.length){let a=c[b<0?0:c.length-1];if(R(a))return a}return Array.prototype.find.call(c,R)||a.getBoundingClientRect()}let T=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function U(a,b,c){let{node:d,offset:e,atom:f}=a.docView.domFromPos(b,c<0?-1:1),g=J||A;if(3==d.nodeType)if(g&&(T.test(d.nodeValue)||(c<0?!e:e==d.nodeValue.length))){let a=S(j(d,e,e),c);if(A&&e&&/\s/.test(d.nodeValue[e-1])&&e<d.nodeValue.length){let b=S(j(d,e-1,e-1),-1);if(b.top==a.top){let c=S(j(d,e,e+1),-1);if(c.top!=a.top)return V(c,c.left<b.left)}}return a}else{let a=e,b=e,f=c<0?1:-1;return c<0&&!e?(b++,f=-1):c>=0&&e==d.nodeValue.length?(a--,f=1):c<0?a--:b++,V(S(j(d,a,b),f),f<0)}if(!a.state.doc.resolve(b-(f||0)).parent.inlineContent){if(null==f&&e&&(c<0||e==o(d))){let a=d.childNodes[e-1];if(1==a.nodeType)return W(a.getBoundingClientRect(),!1)}if(null==f&&e<o(d)){let a=d.childNodes[e];if(1==a.nodeType)return W(a.getBoundingClientRect(),!0)}return W(d.getBoundingClientRect(),c>=0)}if(null==f&&e&&(c<0||e==o(d))){let a=d.childNodes[e-1],b=3==a.nodeType?j(a,o(a)-!g):1!=a.nodeType||"BR"==a.nodeName&&a.nextSibling?null:a;if(b)return V(S(b,1),!1)}if(null==f&&e<o(d)){let a=d.childNodes[e];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let b=a?3==a.nodeType?j(a,0,+!g):1==a.nodeType?a:null:null;if(b)return V(S(b,-1),!0)}return V(S(3==d.nodeType?j(d):d,-c),c>=0)}function V(a,b){if(0==a.width)return a;let c=b?a.left:a.right;return{top:a.top,bottom:a.bottom,left:c,right:c}}function W(a,b){if(0==a.height)return a;let c=b?a.top:a.bottom;return{top:c,bottom:c,left:a.left,right:a.right}}function X(a,b,c){let d=a.state,e=a.root.activeElement;d!=b&&a.updateState(b),e!=a.dom&&a.focus();try{return c()}finally{d!=b&&a.updateState(d),e!=a.dom&&e&&e.focus()}}let Y=/[\u0590-\u08ac]/,Z=null,_=null,aa=!1;class ab{constructor(a,b,c,d){this.parent=a,this.children=b,this.dom=c,this.contentDOM=d,this.dirty=0,c.pmViewDesc=this}matchesWidget(a){return!1}matchesMark(a){return!1}matchesNode(a,b,c){return!1}matchesHack(a){return!1}parseRule(){return null}stopEvent(a){return!1}get size(){let a=0;for(let b=0;b<this.children.length;b++)a+=this.children[b].size;return a}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let a=0;a<this.children.length;a++)this.children[a].destroy()}posBeforeChild(a){for(let b=0,c=this.posAtStart;;b++){let d=this.children[b];if(d==a)return c;c+=d.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(a,b,c){let d;if(this.contentDOM&&this.contentDOM.contains(1==a.nodeType?a:a.parentNode))if(c<0){let c,d;if(a==this.contentDOM)c=a.childNodes[b-1];else{for(;a.parentNode!=this.contentDOM;)a=a.parentNode;c=a.previousSibling}for(;c&&!((d=c.pmViewDesc)&&d.parent==this);)c=c.previousSibling;return c?this.posBeforeChild(d)+d.size:this.posAtStart}else{let c,d;if(a==this.contentDOM)c=a.childNodes[b];else{for(;a.parentNode!=this.contentDOM;)a=a.parentNode;c=a.nextSibling}for(;c&&!((d=c.pmViewDesc)&&d.parent==this);)c=c.nextSibling;return c?this.posBeforeChild(d):this.posAtEnd}if(a==this.dom&&this.contentDOM)d=b>g(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))d=2&a.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==b)for(let b=a;;b=b.parentNode){if(b==this.dom){d=!1;break}if(b.previousSibling)break}if(null==d&&b==a.childNodes.length)for(let b=a;;b=b.parentNode){if(b==this.dom){d=!0;break}if(b.nextSibling)break}}return(null==d?c>0:d)?this.posAtEnd:this.posAtStart}nearestDesc(a,b=!1){for(let c=!0,d=a;d;d=d.parentNode){let e=this.getDesc(d),f;if(e&&(!b||e.node))if(!c||!(f=e.nodeDOM)||(1==f.nodeType?f.contains(1==a.nodeType?a:a.parentNode):f==a))return e;else c=!1}}getDesc(a){let b=a.pmViewDesc;for(let a=b;a;a=a.parent)if(a==this)return b}posFromDOM(a,b,c){for(let d=a;d;d=d.parentNode){let e=this.getDesc(d);if(e)return e.localPosFromDOM(a,b,c)}return -1}descAt(a){for(let b=0,c=0;b<this.children.length;b++){let d=this.children[b],e=c+d.size;if(c==a&&e!=c){for(;!d.border&&d.children.length;)for(let a=0;a<d.children.length;a++){let b=d.children[a];if(b.size){d=b;break}}return d}if(a<e)return d.descAt(a-c-d.border);c=e}}domFromPos(a,b){if(!this.contentDOM)return{node:this.dom,offset:0,atom:a+1};let c=0,d=0;for(let b=0;c<this.children.length;c++){let e=this.children[c],f=b+e.size;if(f>a||e instanceof ai){d=a-b;break}b=f}if(d)return this.children[c].domFromPos(d-this.children[c].border,b);for(let a;c&&!(a=this.children[c-1]).size&&a instanceof ac&&a.side>=0;c--);if(b<=0){let a,d=!0;for(;(a=c?this.children[c-1]:null)&&a.dom.parentNode!=this.contentDOM;c--,d=!1);return a&&b&&d&&!a.border&&!a.domAtom?a.domFromPos(a.size,b):{node:this.contentDOM,offset:a?g(a.dom)+1:0}}{let a,d=!0;for(;(a=c<this.children.length?this.children[c]:null)&&a.dom.parentNode!=this.contentDOM;c++,d=!1);return a&&d&&!a.border&&!a.domAtom?a.domFromPos(0,b):{node:this.contentDOM,offset:a?g(a.dom):this.contentDOM.childNodes.length}}}parseRange(a,b,c=0){if(0==this.children.length)return{node:this.contentDOM,from:a,to:b,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let d=-1,e=-1;for(let f=c,h=0;;h++){let c=this.children[h],i=f+c.size;if(-1==d&&a<=i){let e=f+c.border;if(a>=e&&b<=i-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(a,b,e);a=f;for(let b=h;b>0;b--){let c=this.children[b-1];if(c.size&&c.dom.parentNode==this.contentDOM&&!c.emptyChildAt(1)){d=g(c.dom)+1;break}a-=c.size}-1==d&&(d=0)}if(d>-1&&(i>b||h==this.children.length-1)){b=i;for(let a=h+1;a<this.children.length;a++){let c=this.children[a];if(c.size&&c.dom.parentNode==this.contentDOM&&!c.emptyChildAt(-1)){e=g(c.dom);break}b+=c.size}-1==e&&(e=this.contentDOM.childNodes.length);break}f=i}return{node:this.contentDOM,from:a,to:b,fromOffset:d,toOffset:e}}emptyChildAt(a){if(this.border||!this.contentDOM||!this.children.length)return!1;let b=this.children[a<0?0:this.children.length-1];return 0==b.size||b.emptyChildAt(a)}domAfterPos(a){let{node:b,offset:c}=this.domFromPos(a,0);if(1!=b.nodeType||c==b.childNodes.length)throw RangeError("No node after pos "+a);return b.childNodes[c]}setSelection(a,b,c,d=!1){let e=Math.min(a,b),f=Math.max(a,b);for(let g=0,h=0;g<this.children.length;g++){let i=this.children[g],j=h+i.size;if(e>h&&f<j)return i.setSelection(a-h-i.border,b-h-i.border,c,d);h=j}let h=this.domFromPos(a,a?-1:1),i=b==a?h:this.domFromPos(b,b?-1:1),j=c.root.getSelection(),k=c.domSelectionRange(),m=!1;if((A||E)&&a==b){let{node:a,offset:b}=h;if(3==a.nodeType){if((m=!!(b&&"\n"==a.nodeValue[b-1]))&&b==a.nodeValue.length)for(let b=a,c;b;b=b.parentNode){if(c=b.nextSibling){"BR"==c.nodeName&&(h=i={node:c.parentNode,offset:g(c)+1});break}let a=b.pmViewDesc;if(a&&a.node&&a.node.isBlock)break}}else{let c=a.childNodes[b-1];m=c&&("BR"==c.nodeName||"false"==c.contentEditable)}}if(A&&k.focusNode&&k.focusNode!=i.node&&1==k.focusNode.nodeType){let a=k.focusNode.childNodes[k.focusOffset];a&&"false"==a.contentEditable&&(d=!0)}if(!(d||m&&E)&&l(h.node,h.offset,k.anchorNode,k.anchorOffset)&&l(i.node,i.offset,k.focusNode,k.focusOffset))return;let n=!1;if((j.extend||a==b)&&!(m&&A)){j.collapse(h.node,h.offset);try{a!=b&&j.extend(i.node,i.offset),n=!0}catch(a){}}if(!n){if(a>b){let a=h;h=i,i=a}let c=document.createRange();c.setEnd(i.node,i.offset),c.setStart(h.node,h.offset),j.removeAllRanges(),j.addRange(c)}}ignoreMutation(a){return!this.contentDOM&&"selection"!=a.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(a,b){for(let c=0,d=0;d<this.children.length;d++){let e=this.children[d],f=c+e.size;if(c==f?a<=f&&b>=c:a<f&&b>c){let d=c+e.border,g=f-e.border;if(a>=d&&b<=g){this.dirty=a==c||b==f?2:1,a==d&&b==g&&(e.contentLost||e.dom.parentNode!=this.contentDOM)?e.dirty=3:e.markDirty(a-d,b-d);return}e.dirty=e.dom!=e.contentDOM||e.dom.parentNode!=this.contentDOM||e.children.length?3:2}c=f}this.dirty=2}markParentsDirty(){let a=1;for(let b=this.parent;b;b=b.parent,a++){let c=1==a?2:1;b.dirty<c&&(b.dirty=c)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(a){return!1}}class ac extends ab{constructor(a,b,c,d){let e,f=b.type.toDOM;if("function"==typeof f&&(f=f(c,()=>e?e.parent?e.parent.posBeforeChild(e):void 0:d)),!b.type.spec.raw){if(1!=f.nodeType){let a=document.createElement("span");a.appendChild(f),f=a}f.contentEditable="false",f.classList.add("ProseMirror-widget")}super(a,[],f,null),this.widget=b,this.widget=b,e=this}matchesWidget(a){return 0==this.dirty&&a.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(a){let b=this.widget.spec.stopEvent;return!!b&&b(a)}ignoreMutation(a){return"selection"!=a.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class ad extends ab{constructor(a,b,c,d){super(a,[],b,null),this.textDOM=c,this.text=d}get size(){return this.text.length}localPosFromDOM(a,b){return a!=this.textDOM?this.posAtStart+(b?this.size:0):this.posAtStart+b}domFromPos(a){return{node:this.textDOM,offset:a}}ignoreMutation(a){return"characterData"===a.type&&a.target.nodeValue==a.oldValue}}class ae extends ab{constructor(a,b,c,d,e){super(a,[],c,d),this.mark=b,this.spec=e}static create(a,b,c,d){let f=d.nodeViews[b.type.name],g=f&&f(b,d,c);return g&&g.dom||(g=e.ZF.renderSpec(document,b.type.spec.toDOM(b,c),null,b.attrs)),new ae(a,b,g.dom,g.contentDOM||g.dom,g)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(a){return 3!=this.dirty&&this.mark.eq(a)}markDirty(a,b){if(super.markDirty(a,b),0!=this.dirty){let a=this.parent;for(;!a.node;)a=a.parent;a.dirty<this.dirty&&(a.dirty=this.dirty),this.dirty=0}}slice(a,b,c){let d=ae.create(this.parent,this.mark,!0,c),e=this.children,f=this.size;b<f&&(e=at(e,b,f,c)),a>0&&(e=at(e,0,a,c));for(let a=0;a<e.length;a++)e[a].parent=d;return d.children=e,d}ignoreMutation(a){return this.spec.ignoreMutation?this.spec.ignoreMutation(a):super.ignoreMutation(a)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class af extends ab{constructor(a,b,c,d,e,f,g,h,i){super(a,[],e,f),this.node=b,this.outerDeco=c,this.innerDeco=d,this.nodeDOM=g}static create(a,b,c,d,f,g){let h=f.nodeViews[b.type.name],i,j=h&&h(b,f,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:g,c,d),k=j&&j.dom,l=j&&j.contentDOM;if(b.isText)if(k){if(3!=k.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else k=document.createTextNode(b.text);else if(!k){let a=e.ZF.renderSpec(document,b.type.spec.toDOM(b),null,b.attrs);({dom:k,contentDOM:l}=a)}l||b.isText||"BR"==k.nodeName||(k.hasAttribute("contenteditable")||(k.contentEditable="false"),b.type.spec.draggable&&(k.draggable=!0));let m=k;return(k=ao(k,c,b),j)?i=new aj(a,b,c,d,k,l||null,m,j,f,g+1):b.isText?new ah(a,b,c,d,k,m,f):new af(a,b,c,d,k,l||null,m,f,g+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let a={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(a.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let b=this.children.length-1;b>=0;b--){let c=this.children[b];if(this.dom.contains(c.dom.parentNode)){a.contentElement=c.dom.parentNode;break}}a.contentElement||(a.getContent=()=>e.FK.empty)}else a.contentElement=this.contentDOM;else a.getContent=()=>this.node.content;return a}matchesNode(a,b,c){return 0==this.dirty&&a.eq(this.node)&&ap(b,this.outerDeco)&&c.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(a,b){let c=this.node.inlineContent,d=b,f=a.composing?this.localCompositionInfo(a,b):null,g=f&&f.pos>-1?f:null,h=f&&f.pos<0,i=new ar(this,g&&g.node,a);(function(a,b,c,d){let e=b.locals(a),f=0;if(0==e.length){for(let c=0;c<a.childCount;c++){let g=a.child(c);d(g,e,b.forChild(f,g),c),f+=g.nodeSize}return}let g=0,h=[],i=null;for(let j=0;;){let k,l,m,n;for(;g<e.length&&e[g].to==f;){let a=e[g++];a.widget&&(k?(l||(l=[k])).push(a):k=a)}if(k)if(l){l.sort(as);for(let a=0;a<l.length;a++)c(l[a],j,!!i)}else c(k,j,!!i);if(i)n=-1,m=i,i=null;else if(j<a.childCount)n=j,m=a.child(j++);else break;for(let a=0;a<h.length;a++)h[a].to<=f&&h.splice(a--,1);for(;g<e.length&&e[g].from<=f&&e[g].to>f;)h.push(e[g++]);let o=f+m.nodeSize;if(m.isText){let a=o;g<e.length&&e[g].from<a&&(a=e[g].from);for(let b=0;b<h.length;b++)h[b].to<a&&(a=h[b].to);a<o&&(i=m.cut(a-f),m=m.cut(0,a-f),o=a,n=-1)}else for(;g<e.length&&e[g].to<o;)g++;let p=m.isInline&&!m.isLeaf?h.filter(a=>!a.inline):h.slice();d(m,p,b.forChild(f,m),n),f=o}})(this.node,this.innerDeco,(b,f,g)=>{b.spec.marks?i.syncToMarks(b.spec.marks,c,a,f):b.type.side>=0&&!g&&i.syncToMarks(f==this.node.childCount?e.CU.none:this.node.child(f).marks,c,a,f),i.placeWidget(b,a,d)},(b,e,g,j)=>{let k;i.syncToMarks(b.marks,c,a,j),i.findNodeMatch(b,e,g,j)||h&&a.state.selection.from>d&&a.state.selection.to<d+b.nodeSize&&(k=i.findIndexWithChild(f.node))>-1&&i.updateNodeAt(b,e,g,k,a)||i.updateNextNode(b,e,g,a,j,d)||i.addNode(b,e,g,a,d),d+=b.nodeSize}),i.syncToMarks([],c,a,0),this.node.isTextblock&&i.addTextblockHacks(),i.destroyRest(),(i.changed||2==this.dirty)&&(g&&this.protectLocalComposition(a,g),function a(b,c,d){let e=b.firstChild,f=!1;for(let g=0;g<c.length;g++){let h=c[g],i=h.dom;if(i.parentNode==b){for(;i!=e;)e=aq(e),f=!0;e=e.nextSibling}else f=!0,b.insertBefore(i,e);if(h instanceof ae){let c=e?e.previousSibling:b.lastChild;a(h.contentDOM,h.children,d),e=c?c.nextSibling:b.firstChild}}for(;e;)e=aq(e),f=!0;f&&d.trackWrites==b&&(d.trackWrites=null)}(this.contentDOM,this.children,a),F&&function(a){if("UL"==a.nodeName||"OL"==a.nodeName){let b=a.style.cssText;a.style.cssText=b+"; list-style: square !important",window.getComputedStyle(a).listStyle,a.style.cssText=b}}(this.dom))}localCompositionInfo(a,b){let{from:c,to:e}=a.state.selection;if(!(a.state.selection instanceof d.U3)||c<b||e>b+this.node.content.size)return null;let f=a.input.compositionNode;if(!f||!this.dom.contains(f.parentNode))return null;if(!this.node.inlineContent)return{node:f,pos:-1,text:""};{let a=f.nodeValue,d=function(a,b,c,d){for(let e=0,f=0;e<a.childCount&&f<=d;){let g=a.child(e++),h=f;if(f+=g.nodeSize,!g.isText)continue;let i=g.text;for(;e<a.childCount;){let b=a.child(e++);if(f+=b.nodeSize,!b.isText)break;i+=b.text}if(f>=c){if(f>=d&&i.slice(d-b.length-h,d-h)==b)return d-b.length;let a=h<d?i.lastIndexOf(b,d-h-1):-1;if(a>=0&&a+b.length+h>=c)return h+a;if(c==d&&i.length>=d+b.length-h&&i.slice(d-h,d-h+b.length)==b)return d}}return -1}(this.node.content,a,c-b,e-b);return d<0?null:{node:f,pos:d,text:a}}}protectLocalComposition(a,{node:b,pos:c,text:d}){if(this.getDesc(b))return;let e=b;for(;e.parentNode!=this.contentDOM;e=e.parentNode){for(;e.previousSibling;)e.parentNode.removeChild(e.previousSibling);for(;e.nextSibling;)e.parentNode.removeChild(e.nextSibling);e.pmViewDesc&&(e.pmViewDesc=void 0)}let f=new ad(this,e,b,d);a.input.compositionNodes.push(f),this.children=at(this.children,c,c+d.length,a,f)}update(a,b,c,d){return 3!=this.dirty&&!!a.sameMarkup(this.node)&&(this.updateInner(a,b,c,d),!0)}updateInner(a,b,c,d){this.updateOuterDeco(b),this.node=a,this.innerDeco=c,this.contentDOM&&this.updateChildren(d,this.posAtStart),this.dirty=0}updateOuterDeco(a){if(ap(a,this.outerDeco))return;let b=1!=this.nodeDOM.nodeType,c=this.dom;this.dom=an(this.dom,this.nodeDOM,am(this.outerDeco,this.node,b),am(a,this.node,b)),this.dom!=c&&(c.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=a}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ag(a,b,c,d,e){ao(d,b,a);let f=new af(void 0,a,b,c,d,d,d,e,0);return f.contentDOM&&f.updateChildren(e,0),f}class ah extends af{constructor(a,b,c,d,e,f,g){super(a,b,c,d,e,null,f,g,0)}parseRule(){let a=this.nodeDOM.parentNode;for(;a&&a!=this.dom&&!a.pmIsDeco;)a=a.parentNode;return{skip:a||!0}}update(a,b,c,d){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!a.sameMarkup(this.node)&&(this.updateOuterDeco(b),(0!=this.dirty||a.text!=this.node.text)&&a.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=a.text,d.trackWrites==this.nodeDOM&&(d.trackWrites=null)),this.node=a,this.dirty=0,!0)}inParent(){let a=this.parent.contentDOM;for(let b=this.nodeDOM;b;b=b.parentNode)if(b==a)return!0;return!1}domFromPos(a){return{node:this.nodeDOM,offset:a}}localPosFromDOM(a,b,c){return a==this.nodeDOM?this.posAtStart+Math.min(b,this.node.text.length):super.localPosFromDOM(a,b,c)}ignoreMutation(a){return"characterData"!=a.type&&"selection"!=a.type}slice(a,b,c){let d=this.node.cut(a,b),e=document.createTextNode(d.text);return new ah(this.parent,d,this.outerDeco,this.innerDeco,e,e,c)}markDirty(a,b){super.markDirty(a,b),this.dom!=this.nodeDOM&&(0==a||b==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(a){return this.node.text==a}}class ai extends ab{parseRule(){return{ignore:!0}}matchesHack(a){return 0==this.dirty&&this.dom.nodeName==a}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class aj extends af{constructor(a,b,c,d,e,f,g,h,i,j){super(a,b,c,d,e,f,g,i,j),this.spec=h}update(a,b,c,d){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==a.type||this.spec.multiType)){let e=this.spec.update(a,b,c);return e&&this.updateInner(a,b,c,d),e}return(!!this.contentDOM||!!a.isLeaf)&&super.update(a,b,c,d)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(a,b,c,d){this.spec.setSelection?this.spec.setSelection(a,b,c.root):super.setSelection(a,b,c,d)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(a){return!!this.spec.stopEvent&&this.spec.stopEvent(a)}ignoreMutation(a){return this.spec.ignoreMutation?this.spec.ignoreMutation(a):super.ignoreMutation(a)}}let ak=function(a){a&&(this.nodeName=a)};ak.prototype=Object.create(null);let al=[new ak];function am(a,b,c){if(0==a.length)return al;let d=c?al[0]:new ak,e=[d];for(let f=0;f<a.length;f++){let g=a[f].type.attrs;if(g)for(let a in g.nodeName&&e.push(d=new ak(g.nodeName)),g){let f=g[a];null!=f&&(c&&1==e.length&&e.push(d=new ak(b.isInline?"span":"div")),"class"==a?d.class=(d.class?d.class+" ":"")+f:"style"==a?d.style=(d.style?d.style+";":"")+f:"nodeName"!=a&&(d[a]=f))}}return e}function an(a,b,c,d){if(c==al&&d==al)return b;let e=b;for(let b=0;b<d.length;b++){let f=d[b],g=c[b];if(b){let b;g&&g.nodeName==f.nodeName&&e!=a&&(b=e.parentNode)&&b.nodeName.toLowerCase()==f.nodeName||((b=document.createElement(f.nodeName)).pmIsDeco=!0,b.appendChild(e),g=al[0]),e=b}!function(a,b,c){for(let d in b)"class"==d||"style"==d||"nodeName"==d||d in c||a.removeAttribute(d);for(let d in c)"class"!=d&&"style"!=d&&"nodeName"!=d&&c[d]!=b[d]&&a.setAttribute(d,c[d]);if(b.class!=c.class){let d=b.class?b.class.split(" ").filter(Boolean):[],e=c.class?c.class.split(" ").filter(Boolean):[];for(let b=0;b<d.length;b++)-1==e.indexOf(d[b])&&a.classList.remove(d[b]);for(let b=0;b<e.length;b++)-1==d.indexOf(e[b])&&a.classList.add(e[b]);0==a.classList.length&&a.removeAttribute("class")}if(b.style!=c.style){if(b.style){let c=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,d;for(;d=c.exec(b.style);)a.style.removeProperty(d[1])}c.style&&(a.style.cssText+=c.style)}}(e,g||al[0],f)}return e}function ao(a,b,c){return an(a,a,al,am(b,c,1!=a.nodeType))}function ap(a,b){if(a.length!=b.length)return!1;for(let c=0;c<a.length;c++)if(!a[c].type.eq(b[c].type))return!1;return!0}function aq(a){let b=a.nextSibling;return a.parentNode.removeChild(a),b}class ar{constructor(a,b,c){this.lock=b,this.view=c,this.index=0,this.stack=[],this.changed=!1,this.top=a,this.preMatch=function(a,b){let c=b,d=c.children.length,e=a.childCount,f=new Map,g=[];a:for(;e>0;){let h;for(;;)if(d){let a=c.children[d-1];if(a instanceof ae)c=a,d=a.children.length;else{h=a,d--;break}}else if(c==b)break a;else d=c.parent.children.indexOf(c),c=c.parent;let i=h.node;if(i){if(i!=a.child(e-1))break;--e,f.set(h,e),g.push(h)}}return{index:e,matched:f,matches:g.reverse()}}(a.node.content,a)}destroyBetween(a,b){if(a!=b){for(let c=a;c<b;c++)this.top.children[c].destroy();this.top.children.splice(a,b-a),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(a,b,c,d){let e=0,f=this.stack.length>>1,g=Math.min(f,a.length);for(;e<g&&(e==f-1?this.top:this.stack[e+1<<1]).matchesMark(a[e])&&!1!==a[e].type.spec.spanning;)e++;for(;e<f;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),f--;for(;f<a.length;){this.stack.push(this.top,this.index+1);let e=-1,g=this.top.children.length;d<this.preMatch.index&&(g=Math.min(this.index+3,g));for(let b=this.index;b<g;b++){let c=this.top.children[b];if(c.matchesMark(a[f])&&!this.isLocked(c.dom)){e=b;break}}if(e>-1)e>this.index&&(this.changed=!0,this.destroyBetween(this.index,e)),this.top=this.top.children[this.index];else{let d=ae.create(this.top,a[f],b,c);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,f++}}findNodeMatch(a,b,c,d){let e=-1,f;if(d>=this.preMatch.index&&(f=this.preMatch.matches[d-this.preMatch.index]).parent==this.top&&f.matchesNode(a,b,c))e=this.top.children.indexOf(f,this.index);else for(let d=this.index,f=Math.min(this.top.children.length,d+5);d<f;d++){let f=this.top.children[d];if(f.matchesNode(a,b,c)&&!this.preMatch.matched.has(f)){e=d;break}}return!(e<0)&&(this.destroyBetween(this.index,e),this.index++,!0)}updateNodeAt(a,b,c,d,e){let f=this.top.children[d];return 3==f.dirty&&f.dom==f.contentDOM&&(f.dirty=2),!!f.update(a,b,c,e)&&(this.destroyBetween(this.index,d),this.index++,!0)}findIndexWithChild(a){for(;;){let b=a.parentNode;if(!b)return -1;if(b==this.top.contentDOM){let b=a.pmViewDesc;if(b){for(let a=this.index;a<this.top.children.length;a++)if(this.top.children[a]==b)return a}return -1}a=b}}updateNextNode(a,b,c,d,e,f){for(let g=this.index;g<this.top.children.length;g++){let h=this.top.children[g];if(h instanceof af){let i=this.preMatch.matched.get(h);if(null!=i&&i!=e)return!1;let j=h.dom,k,l=this.isLocked(j)&&!(a.isText&&h.node&&h.node.isText&&h.nodeDOM.nodeValue==a.text&&3!=h.dirty&&ap(b,h.outerDeco));if(!l&&h.update(a,b,c,d))return this.destroyBetween(this.index,g),h.dom!=j&&(this.changed=!0),this.index++,!0;if(!l&&(k=this.recreateWrapper(h,a,b,c,d,f)))return this.destroyBetween(this.index,g),this.top.children[this.index]=k,k.contentDOM&&(k.dirty=2,k.updateChildren(d,f+1),k.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(a,b,c,d,e,f){if(a.dirty||b.isAtom||!a.children.length||!a.node.content.eq(b.content)||!ap(c,a.outerDeco)||!d.eq(a.innerDeco))return null;let g=af.create(this.top,b,c,d,e,f);if(g.contentDOM)for(let b of(g.children=a.children,a.children=[],g.children))b.parent=g;return a.destroy(),g}addNode(a,b,c,d,e){let f=af.create(this.top,a,b,c,d,e);f.contentDOM&&f.updateChildren(d,e+1),this.top.children.splice(this.index++,0,f),this.changed=!0}placeWidget(a,b,c){let d=this.index<this.top.children.length?this.top.children[this.index]:null;if(d&&d.matchesWidget(a)&&(a==d.widget||!d.widget.type.toDOM.parentNode))this.index++;else{let d=new ac(this.top,a,b,c);this.top.children.splice(this.index++,0,d),this.changed=!0}}addTextblockHacks(){let a=this.top.children[this.index-1],b=this.top;for(;a instanceof ae;)a=(b=a).children[b.children.length-1];(!a||!(a instanceof ah)||/\n$/.test(a.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(a.node.text))&&((E||C)&&a&&"false"==a.dom.contentEditable&&this.addHackNode("IMG",b),this.addHackNode("BR",this.top))}addHackNode(a,b){if(b==this.top&&this.index<b.children.length&&b.children[this.index].matchesHack(a))this.index++;else{let c=document.createElement(a);"IMG"==a&&(c.className="ProseMirror-separator",c.alt=""),"BR"==a&&(c.className="ProseMirror-trailingBreak");let d=new ai(this.top,[],c,null);b!=this.top?b.children.push(d):b.children.splice(this.index++,0,d),this.changed=!0}}isLocked(a){return this.lock&&(a==this.lock||1==a.nodeType&&a.contains(this.lock.parentNode))}}function as(a,b){return a.type.side-b.type.side}function at(a,b,c,d,e){let f=[];for(let g=0,h=0;g<a.length;g++){let i=a[g],j=h,k=h+=i.size;j>=c||k<=b?f.push(i):(j<b&&f.push(i.slice(0,b-j,d)),e&&(f.push(e),e=void 0),k>c&&f.push(i.slice(c-j,i.size,d)))}return f}function au(a,b=null){let c=a.domSelectionRange(),e=a.state.doc;if(!c.focusNode)return null;let f=a.docView.nearestDesc(c.focusNode),h=f&&0==f.size,i=a.docView.posFromDOM(c.focusNode,c.focusOffset,1);if(i<0)return null;let j=e.resolve(i),k,l;if(q(c)){for(k=i;f&&!f.node;)f=f.parent;let a=f.node;if(f&&a.isAtom&&d.nh.isSelectable(a)&&f.parent&&!(a.isInline&&function(a,b,c){for(let d=0==b,e=b==o(a);d||e;){if(a==c)return!0;let b=g(a);if(!(a=a.parentNode))return!1;d=d&&0==b,e=e&&b==o(a)}}(c.focusNode,c.focusOffset,f.dom))){let a=f.posBefore;l=new d.nh(i==a?j:e.resolve(a))}}else{if(c instanceof a.dom.ownerDocument.defaultView.Selection&&c.rangeCount>1){let b=i,d=i;for(let e=0;e<c.rangeCount;e++){let f=c.getRangeAt(e);b=Math.min(b,a.docView.posFromDOM(f.startContainer,f.startOffset,1)),d=Math.max(d,a.docView.posFromDOM(f.endContainer,f.endOffset,-1))}if(b<0)return null;[k,i]=d==a.state.selection.anchor?[d,b]:[b,d],j=e.resolve(i)}else k=a.docView.posFromDOM(c.anchorNode,c.anchorOffset,1);if(k<0)return null}let m=e.resolve(k);if(!l){let c="pointer"==b||a.state.selection.head<j.pos&&!h?1:-1;l=aD(a,m,j,c)}return l}function av(a){return a.editable?a.hasFocus():aF(a)&&document.activeElement&&document.activeElement.contains(a.dom)}function aw(a,b=!1){let c=a.state.selection;if(aB(a,c),av(a)){if(!b&&a.input.mouseDown&&a.input.mouseDown.allowDefault&&C){let b=a.domSelectionRange(),c=a.domObserver.currentSelection;if(b.anchorNode&&c.anchorNode&&l(b.anchorNode,b.anchorOffset,c.anchorNode,c.anchorOffset)){a.input.mouseDown.delayedSelectionSync=!0,a.domObserver.setCurSelection();return}}if(a.domObserver.disconnectSelection(),a.cursorWrapper)!function(a){let b=a.domSelection();if(!b)return;let c=a.cursorWrapper.dom,d="IMG"==c.nodeName;d?b.collapse(c.parentNode,g(c)+1):b.collapse(c,0),!d&&!a.state.selection.visible&&y&&z<=11&&(c.disabled=!0,c.disabled=!1)}(a);else{var e;let f,g,h,i,{anchor:j,head:k}=c,l,m;ax&&!(c instanceof d.U3)&&(c.$from.parent.inlineContent||(l=ay(a,c.from)),c.empty||c.$from.parent.inlineContent||(m=ay(a,c.to))),a.docView.setSelection(j,k,a,b),ax&&(l&&aA(l),m&&aA(m)),c.visible?a.dom.classList.remove("ProseMirror-hideselection"):(a.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((f=(e=a).dom.ownerDocument).removeEventListener("selectionchange",e.input.hideSelectionGuard),h=(g=e.domSelectionRange()).anchorNode,i=g.anchorOffset,f.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(g.anchorNode!=h||g.anchorOffset!=i)&&(f.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!av(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})))}a.domObserver.setCurSelection(),a.domObserver.connectSelection()}}let ax=E||C&&D<63;function ay(a,b){let{node:c,offset:d}=a.docView.domFromPos(b,0),e=d<c.childNodes.length?c.childNodes[d]:null,f=d?c.childNodes[d-1]:null;if(E&&e&&"false"==e.contentEditable)return az(e);if((!e||"false"==e.contentEditable)&&(!f||"false"==f.contentEditable)){if(e)return az(e);else if(f)return az(f)}}function az(a){return a.contentEditable="true",E&&a.draggable&&(a.draggable=!1,a.wasDraggable=!0),a}function aA(a){a.contentEditable="false",a.wasDraggable&&(a.draggable=!0,a.wasDraggable=null)}function aB(a,b){if(b instanceof d.nh){let c=a.docView.descAt(b.from);c!=a.lastSelectedViewDesc&&(aC(a),c&&c.selectNode(),a.lastSelectedViewDesc=c)}else aC(a)}function aC(a){a.lastSelectedViewDesc&&(a.lastSelectedViewDesc.parent&&a.lastSelectedViewDesc.deselectNode(),a.lastSelectedViewDesc=void 0)}function aD(a,b,c,e){return a.someProp("createSelectionBetween",d=>d(a,b,c))||d.U3.between(b,c,e)}function aE(a){return(!a.editable||!!a.hasFocus())&&aF(a)}function aF(a){let b=a.domSelectionRange();if(!b.anchorNode)return!1;try{return a.dom.contains(3==b.anchorNode.nodeType?b.anchorNode.parentNode:b.anchorNode)&&(a.editable||a.dom.contains(3==b.focusNode.nodeType?b.focusNode.parentNode:b.focusNode))}catch(a){return!1}}function aG(a,b){let{$anchor:c,$head:e}=a.selection,f=b>0?c.max(e):c.min(e),g=f.parent.inlineContent?f.depth?a.doc.resolve(b>0?f.after():f.before()):null:f;return g&&d.LN.findFrom(g,b)}function aH(a,b){return a.dispatch(a.state.tr.setSelection(b).scrollIntoView()),!0}function aI(a,b,c){let e=a.state.selection;if(e instanceof d.U3){if(c.indexOf("s")>-1){let{$head:c}=e,f=c.textOffset?null:b<0?c.nodeBefore:c.nodeAfter;if(!f||f.isText||!f.isLeaf)return!1;let g=a.state.doc.resolve(c.pos+f.nodeSize*(b<0?-1:1));return aH(a,new d.U3(e.$anchor,g))}else if(!e.empty)return!1;else if(a.endOfTextblock(b>0?"forward":"backward")){let c=aG(a.state,b);return!!c&&c instanceof d.nh&&aH(a,c)}else if(!(G&&c.indexOf("m")>-1)){let c=e.$head,f=c.textOffset?null:b<0?c.nodeBefore:c.nodeAfter,g;if(!f||f.isText)return!1;let h=b<0?c.pos-f.nodeSize:c.pos;return!!(f.isAtom||(g=a.docView.descAt(h))&&!g.contentDOM)&&(d.nh.isSelectable(f)?aH(a,new d.nh(b<0?a.state.doc.resolve(c.pos-f.nodeSize):c)):!!J&&aH(a,new d.U3(a.state.doc.resolve(b<0?h:h+f.nodeSize))))}}else{if(e instanceof d.nh&&e.node.isInline)return aH(a,new d.U3(b>0?e.$to:e.$from));let c=aG(a.state,b);return!!c&&aH(a,c)}}function aJ(a){return 3==a.nodeType?a.nodeValue.length:a.childNodes.length}function aK(a,b){let c=a.pmViewDesc;return c&&0==c.size&&(b<0||a.nextSibling||"BR"!=a.nodeName)}function aL(a,b){return b<0?function(a){let b=a.domSelectionRange(),c=b.focusNode,d=b.focusOffset;if(!c)return;let e,f,h=!1;for(A&&1==c.nodeType&&d<aJ(c)&&aK(c.childNodes[d],-1)&&(h=!0);;)if(d>0)if(1!=c.nodeType)break;else{let a=c.childNodes[d-1];if(aK(a,-1))e=c,f=--d;else if(3==a.nodeType)d=(c=a).nodeValue.length;else break}else if(aM(c))break;else{let b=c.previousSibling;for(;b&&aK(b,-1);)e=c.parentNode,f=g(b),b=b.previousSibling;if(b)d=aJ(c=b);else{if((c=c.parentNode)==a.dom)break;d=0}}h?aN(a,c,d):e&&aN(a,e,f)}(a):function(a){let b,c,d=a.domSelectionRange(),e=d.focusNode,f=d.focusOffset;if(!e)return;let h=aJ(e);for(;;)if(f<h){if(1!=e.nodeType)break;if(aK(e.childNodes[f],1))b=e,c=++f;else break}else if(aM(e))break;else{let d=e.nextSibling;for(;d&&aK(d,1);)b=d.parentNode,c=g(d)+1,d=d.nextSibling;if(d)f=0,h=aJ(e=d);else{if((e=e.parentNode)==a.dom)break;f=h=0}}b&&aN(a,b,c)}(a)}function aM(a){let b=a.pmViewDesc;return b&&b.node&&b.node.isBlock}function aN(a,b,c){if(3!=b.nodeType){let a,d;(d=function(a,b){for(;a&&b==a.childNodes.length&&!p(a);)b=g(a)+1,a=a.parentNode;for(;a&&b<a.childNodes.length;){let c=a.childNodes[b];if(3==c.nodeType)return c;if(1==c.nodeType&&"false"==c.contentEditable)break;a=c,b=0}}(b,c))?(b=d,c=0):(a=function(a,b){for(;a&&!b&&!p(a);)b=g(a),a=a.parentNode;for(;a&&b;){let c=a.childNodes[b-1];if(3==c.nodeType)return c;if(1==c.nodeType&&"false"==c.contentEditable)break;b=(a=c).childNodes.length}}(b,c))&&(b=a,c=a.nodeValue.length)}let d=a.domSelection();if(!d)return;if(q(d)){let a=document.createRange();a.setEnd(b,c),a.setStart(b,c),d.removeAllRanges(),d.addRange(a)}else d.extend&&d.extend(b,c);a.domObserver.setCurSelection();let{state:e}=a;setTimeout(()=>{a.state==e&&aw(a)},50)}function aO(a,b){let c=a.state.doc.resolve(b);if(!(C||H)&&c.parent.inlineContent){let d=a.coordsAtPos(b);if(b>c.start()){let c=a.coordsAtPos(b-1),e=(c.top+c.bottom)/2;if(e>d.top&&e<d.bottom&&Math.abs(c.left-d.left)>1)return c.left<d.left?"ltr":"rtl"}if(b<c.end()){let c=a.coordsAtPos(b+1),e=(c.top+c.bottom)/2;if(e>d.top&&e<d.bottom&&Math.abs(c.left-d.left)>1)return c.left>d.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(a.dom).direction?"rtl":"ltr"}function aP(a,b,c){let e=a.state.selection;if(e instanceof d.U3&&!e.empty||c.indexOf("s")>-1||G&&c.indexOf("m")>-1)return!1;let{$from:f,$to:g}=e;if(!f.parent.inlineContent||a.endOfTextblock(b<0?"up":"down")){let c=aG(a.state,b);if(c&&c instanceof d.nh)return aH(a,c)}if(!f.parent.inlineContent){let c=b<0?f:g,h=e instanceof d.i5?d.LN.near(c,b):d.LN.findFrom(c,b);return!!h&&aH(a,h)}return!1}function aQ(a,b){if(!(a.state.selection instanceof d.U3))return!0;let{$head:c,$anchor:e,empty:f}=a.state.selection;if(!c.sameParent(e))return!0;if(!f)return!1;if(a.endOfTextblock(b>0?"forward":"backward"))return!0;let g=!c.textOffset&&(b<0?c.nodeBefore:c.nodeAfter);if(g&&!g.isText){let d=a.state.tr;return b<0?d.delete(c.pos-g.nodeSize,c.pos):d.delete(c.pos,c.pos+g.nodeSize),a.dispatch(d),!0}return!1}function aR(a,b,c){a.domObserver.stop(),b.contentEditable=c,a.domObserver.start()}function aS(a,b){a.someProp("transformCopied",c=>{b=c(b,a)});let c=[],{content:d,openStart:f,openEnd:g}=b;for(;f>1&&g>1&&1==d.childCount&&1==d.firstChild.childCount;){f--,g--;let a=d.firstChild;c.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),d=a.content}let h=a.someProp("clipboardSerializer")||e.ZF.fromSchema(a.state.schema),i=a$(),j=i.createElement("div");j.appendChild(h.serializeFragment(d,{document:i}));let k=j.firstChild,l,m=0;for(;k&&1==k.nodeType&&(l=aY[k.nodeName.toLowerCase()]);){for(let a=l.length-1;a>=0;a--){let b=i.createElement(l[a]);for(;j.firstChild;)b.appendChild(j.firstChild);j.appendChild(b),m++}k=j.firstChild}return k&&1==k.nodeType&&k.setAttribute("data-pm-slice",`${f} ${g}${m?` -${m}`:""} ${JSON.stringify(c)}`),{dom:j,text:a.someProp("clipboardTextSerializer",c=>c(b,a))||b.content.textBetween(0,b.content.size,"\n\n"),slice:b}}function aT(a,b,c,d,f){let g,h,i=f.parent.type.spec.code;if(!c&&!b)return null;let j=!!b&&(d||i||!c);if(j){if(a.someProp("transformPastedText",c=>{b=c(b,i||d,a)}),i)return h=new e.Ji(e.FK.from(a.state.schema.text(b.replace(/\r\n?/g,"\n"))),0,0),a.someProp("transformPasted",b=>{h=b(h,a,!0)}),h;let c=a.someProp("clipboardTextParser",c=>c(b,f,d,a));if(c)h=c;else{let c=f.marks(),{schema:d}=a.state,h=e.ZF.fromSchema(d);g=document.createElement("div"),b.split(/(?:\r\n?|\n)+/).forEach(a=>{let b=g.appendChild(document.createElement("p"));a&&b.appendChild(h.serializeNode(d.text(a,c)))})}}else a.someProp("transformPastedHTML",b=>{c=b(c,a)}),g=function(a){var b;let c,d=/^(\s*<meta [^>]*>)*/.exec(a);d&&(a=a.slice(d[0].length));let e=a$().createElement("div"),f=/<([a-z][^>\s]+)/i.exec(a),g;if((g=f&&aY[f[1].toLowerCase()])&&(a=g.map(a=>"<"+a+">").join("")+a+g.map(a=>"</"+a+">").reverse().join("")),e.innerHTML=(b=a,(c=window.trustedTypes)?(a_||(a_=c.defaultPolicy||c.createPolicy("ProseMirrorClipboard",{createHTML:a=>a})),a_.createHTML(b)):b),g)for(let a=0;a<g.length;a++)e=e.querySelector(g[a])||e;return e}(c),J&&function(a){let b=a.querySelectorAll(C?"span:not([class]):not([style])":"span.Apple-converted-space");for(let c=0;c<b.length;c++){let d=b[c];1==d.childNodes.length&&"\xa0"==d.textContent&&d.parentNode&&d.parentNode.replaceChild(a.ownerDocument.createTextNode(" "),d)}}(g);let k=g&&g.querySelector("[data-pm-slice]"),l=k&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(k.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let a=+l[3];a>0;a--){let a=g.firstChild;for(;a&&1!=a.nodeType;)a=a.nextSibling;if(!a)break;g=a}if(h||(h=(a.someProp("clipboardParser")||a.someProp("domParser")||e.S4.fromSchema(a.state.schema)).parseSlice(g,{preserveWhitespace:!!(j||l),context:f,ruleFromNode:a=>"BR"!=a.nodeName||a.nextSibling||!a.parentNode||aU.test(a.parentNode.nodeName)?null:{ignore:!0}})),l)h=function(a,b){if(!a.size)return a;let c=a.content.firstChild.type.schema,d;try{d=JSON.parse(b)}catch(b){return a}let{content:f,openStart:g,openEnd:h}=a;for(let a=d.length-2;a>=0;a-=2){let b=c.nodes[d[a]];if(!b||b.hasRequiredAttrs())break;f=e.FK.from(b.create(d[a+1],f)),g++,h++}return new e.Ji(f,g,h)}(aX(h,+l[1],+l[2]),l[4]);else if((h=e.Ji.maxOpen(function(a,b){if(a.childCount<2)return a;for(let c=b.depth;c>=0;c--){let d=b.node(c).contentMatchAt(b.index(c)),f,g=[];if(a.forEach(a=>{if(!g)return;let b=d.findWrapping(a.type),c;if(!b)return g=null;if(c=g.length&&f.length&&function a(b,c,d,f,g){if(g<b.length&&g<c.length&&b[g]==c[g]){let h=a(b,c,d,f.lastChild,g+1);if(h)return f.copy(f.content.replaceChild(f.childCount-1,h));if(f.contentMatchAt(f.childCount).matchType(g==b.length-1?d.type:b[g+1]))return f.copy(f.content.append(e.FK.from(aV(d,b,g+1))))}}(b,f,a,g[g.length-1],0))g[g.length-1]=c;else{g.length&&(g[g.length-1]=function a(b,c){if(0==c)return b;let d=b.content.replaceChild(b.childCount-1,a(b.lastChild,c-1)),f=b.contentMatchAt(b.childCount).fillBefore(e.FK.empty,!0);return b.copy(d.append(f))}(g[g.length-1],f.length));let c=aV(a,b);g.push(c),d=d.matchType(c.type),f=b}}),g)return e.FK.from(g)}return a}(h.content,f),!0)).openStart||h.openEnd){let a=0,b=0;for(let b=h.content.firstChild;a<h.openStart&&!b.type.spec.isolating;a++,b=b.firstChild);for(let a=h.content.lastChild;b<h.openEnd&&!a.type.spec.isolating;b++,a=a.lastChild);h=aX(h,a,b)}return a.someProp("transformPasted",b=>{h=b(h,a,j)}),h}let aU=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function aV(a,b,c=0){for(let d=b.length-1;d>=c;d--)a=b[d].create(null,e.FK.from(a));return a}function aW(a,b,c,d,f,g){let h=b<0?a.firstChild:a.lastChild,i=h.content;return a.childCount>1&&(g=0),f<d-1&&(i=aW(i,b,c,d,f+1,g)),f>=c&&(i=b<0?h.contentMatchAt(0).fillBefore(i,g<=f).append(i):i.append(h.contentMatchAt(h.childCount).fillBefore(e.FK.empty,!0))),a.replaceChild(b<0?0:a.childCount-1,h.copy(i))}function aX(a,b,c){return b<a.openStart&&(a=new e.Ji(aW(a.content,-1,b,a.openStart,0,a.openEnd),b,a.openEnd)),c<a.openEnd&&(a=new e.Ji(aW(a.content,1,c,a.openEnd,0,0),a.openStart,c)),a}let aY={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},aZ=null;function a$(){return aZ||(aZ=document.implementation.createHTMLDocument("title"))}let a_=null,a0={},a1={},a2={touchstart:!0,touchmove:!0};class a3{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function a4(a,b){a.input.lastSelectionOrigin=b,a.input.lastSelectionTime=Date.now()}function a5(a){a.someProp("handleDOMEvents",b=>{for(let c in b)a.input.eventHandlers[c]||a.dom.addEventListener(c,a.input.eventHandlers[c]=b=>a6(a,b))})}function a6(a,b){return a.someProp("handleDOMEvents",c=>{let d=c[b.type];return!!d&&(d(a,b)||b.defaultPrevented)})}function a7(a){return{left:a.clientX,top:a.clientY}}function a8(a,b,c,d,e){if(-1==d)return!1;let f=a.state.doc.resolve(d);for(let d=f.depth+1;d>0;d--)if(a.someProp(b,b=>d>f.depth?b(a,c,f.nodeAfter,f.before(d),e,!0):b(a,c,f.node(d),f.before(d),e,!1)))return!0;return!1}function a9(a,b,c){if(a.focused||a.focus(),a.state.selection.eq(b))return;let d=a.state.tr.setSelection(b);"pointer"==c&&d.setMeta("pointer",!0),a.dispatch(d)}a1.keydown=(a,b)=>{if((a.input.shiftKey=16==b.keyCode||b.shiftKey,!bc(a,b))&&(a.input.lastKeyCode=b.keyCode,a.input.lastKeyCodeTime=Date.now(),!I||!C||13!=b.keyCode))if(229!=b.keyCode&&a.domObserver.forceFlush(),!F||13!=b.keyCode||b.ctrlKey||b.altKey||b.metaKey)a.someProp("handleKeyDown",c=>c(a,b))||function(a,b){let c,d=b.keyCode,e=(c="",b.ctrlKey&&(c+="c"),b.metaKey&&(c+="m"),b.altKey&&(c+="a"),b.shiftKey&&(c+="s"),c);if(8==d||G&&72==d&&"c"==e)return aQ(a,-1)||aL(a,-1);if(46==d&&!b.shiftKey||G&&68==d&&"c"==e)return aQ(a,1)||aL(a,1);if(13==d||27==d)return!0;if(37==d||G&&66==d&&"c"==e){let b=37==d?"ltr"==aO(a,a.state.selection.from)?-1:1:-1;return aI(a,b,e)||aL(a,b)}if(39==d||G&&70==d&&"c"==e){let b=39==d?"ltr"==aO(a,a.state.selection.from)?1:-1:1;return aI(a,b,e)||aL(a,b)}else if(38==d||G&&80==d&&"c"==e)return aP(a,-1,e)||aL(a,-1);else if(40==d||G&&78==d&&"c"==e)return function(a){if(!E||a.state.selection.$head.parentOffset>0)return!1;let{focusNode:b,focusOffset:c}=a.domSelectionRange();if(b&&1==b.nodeType&&0==c&&b.firstChild&&"false"==b.firstChild.contentEditable){let c=b.firstChild;aR(a,c,"true"),setTimeout(()=>aR(a,c,"false"),20)}return!1}(a)||aP(a,1,e)||aL(a,1);else if(e==(G?"m":"c")&&(66==d||73==d||89==d||90==d))return!0;return!1}(a,b)?b.preventDefault():a4(a,"key");else{let b=Date.now();a.input.lastIOSEnter=b,a.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{a.input.lastIOSEnter==b&&(a.someProp("handleKeyDown",b=>b(a,r(13,"Enter"))),a.input.lastIOSEnter=0)},200)}},a1.keyup=(a,b)=>{16==b.keyCode&&(a.input.shiftKey=!1)},a1.keypress=(a,b)=>{if(bc(a,b)||!b.charCode||b.ctrlKey&&!b.altKey||G&&b.metaKey)return;if(a.someProp("handleKeyPress",c=>c(a,b)))return void b.preventDefault();let c=a.state.selection;if(!(c instanceof d.U3)||!c.$from.sameParent(c.$to)){let d=String.fromCharCode(b.charCode),e=()=>a.state.tr.insertText(d).scrollIntoView();/[\r\n]/.test(d)||a.someProp("handleTextInput",b=>b(a,c.$from.pos,c.$to.pos,d,e))||a.dispatch(e()),b.preventDefault()}};let ba=G?"metaKey":"ctrlKey";a0.mousedown=(a,b)=>{a.input.shiftKey=b.shiftKey;let c=bg(a),e=Date.now(),f="singleClick";e-a.input.lastClick.time<500&&function(a,b){let c=b.x-a.clientX,d=b.y-a.clientY;return c*c+d*d<100}(b,a.input.lastClick)&&!b[ba]&&a.input.lastClick.button==b.button&&("singleClick"==a.input.lastClick.type?f="doubleClick":"doubleClick"==a.input.lastClick.type&&(f="tripleClick")),a.input.lastClick={time:e,x:b.clientX,y:b.clientY,type:f,button:b.button};let g=a.posAtCoords(a7(b));g&&("singleClick"==f?(a.input.mouseDown&&a.input.mouseDown.done(),a.input.mouseDown=new bb(a,g,b,!!c)):("doubleClick"==f?function(a,b,c,d){return a8(a,"handleDoubleClickOn",b,c,d)||a.someProp("handleDoubleClick",c=>c(a,b,d))}:function(a,b,c,e){return a8(a,"handleTripleClickOn",b,c,e)||a.someProp("handleTripleClick",c=>c(a,b,e))||function(a,b,c){if(0!=c.button)return!1;let e=a.state.doc;if(-1==b)return!!e.inlineContent&&(a9(a,d.U3.create(e,0,e.content.size),"pointer"),!0);let f=e.resolve(b);for(let b=f.depth+1;b>0;b--){let c=b>f.depth?f.nodeAfter:f.node(b),g=f.before(b);if(c.inlineContent)a9(a,d.U3.create(e,g+1,g+1+c.content.size),"pointer");else{if(!d.nh.isSelectable(c))continue;a9(a,d.nh.create(e,g),"pointer")}return!0}}(a,c,e)})(a,g.pos,g.inside,b)?b.preventDefault():a4(a,"pointer"))};class bb{constructor(a,b,c,e){let f,g;if(this.view=a,this.pos=b,this.event=c,this.flushed=e,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=a.state.doc,this.selectNode=!!c[ba],this.allowDefault=c.shiftKey,b.inside>-1)f=a.state.doc.nodeAt(b.inside),g=b.inside;else{let c=a.state.doc.resolve(b.pos);f=c.parent,g=c.depth?c.before():0}let h=e?null:c.target,i=h?a.docView.nearestDesc(h,!0):null;this.target=i&&1==i.nodeDOM.nodeType?i.nodeDOM:null;let{selection:j}=a.state;(0==c.button&&f.type.spec.draggable&&!1!==f.type.spec.selectable||j instanceof d.nh&&j.from<=g&&j.to>g)&&(this.mightDrag={node:f,pos:g,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&A&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),a.root.addEventListener("mouseup",this.up=this.up.bind(this)),a.root.addEventListener("mousemove",this.move=this.move.bind(this)),a4(a,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>aw(this.view)),this.view.input.mouseDown=null}up(a){if(this.done(),!this.view.dom.contains(a.target))return;let b=this.pos;if(this.view.state.doc!=this.startDoc&&(b=this.view.posAtCoords(a7(a))),this.updateAllowDefault(a),this.allowDefault||!b)a4(this.view,"pointer");else{var c,e,f,g;(c=this.view,e=b.pos,f=b.inside,g=this.selectNode,a8(c,"handleClickOn",e,f,a)||c.someProp("handleClick",b=>b(c,e,a))||(g?function(a,b){if(-1==b)return!1;let c=a.state.selection,e,f;c instanceof d.nh&&(e=c.node);let g=a.state.doc.resolve(b);for(let a=g.depth+1;a>0;a--){let b=a>g.depth?g.nodeAfter:g.node(a);if(d.nh.isSelectable(b)){f=e&&c.$from.depth>0&&a>=c.$from.depth&&g.before(c.$from.depth+1)==c.$from.pos?g.before(c.$from.depth):g.before(a);break}}return null!=f&&(a9(a,d.nh.create(a.state.doc,f),"pointer"),!0)}(c,f):function(a,b){if(-1==b)return!1;let c=a.state.doc.resolve(b),e=c.nodeAfter;return!!(e&&e.isAtom&&d.nh.isSelectable(e))&&(a9(a,new d.nh(c),"pointer"),!0)}(c,f)))?a.preventDefault():0==a.button&&(this.flushed||E&&this.mightDrag&&!this.mightDrag.node.isAtom||C&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(b.pos-this.view.state.selection.from),Math.abs(b.pos-this.view.state.selection.to)))?(a9(this.view,d.LN.near(this.view.state.doc.resolve(b.pos)),"pointer"),a.preventDefault()):a4(this.view,"pointer")}}move(a){this.updateAllowDefault(a),a4(this.view,"pointer"),0==a.buttons&&this.done()}updateAllowDefault(a){!this.allowDefault&&(Math.abs(this.event.x-a.clientX)>4||Math.abs(this.event.y-a.clientY)>4)&&(this.allowDefault=!0)}}function bc(a,b){return!!a.composing||!!(E&&500>Math.abs(b.timeStamp-a.input.compositionEndedAt))&&(a.input.compositionEndedAt=-2e8,!0)}a0.touchstart=a=>{a.input.lastTouch=Date.now(),bg(a),a4(a,"pointer")},a0.touchmove=a=>{a.input.lastTouch=Date.now(),a4(a,"pointer")},a0.contextmenu=a=>bg(a);let bd=I?5e3:-1;function be(a,b){clearTimeout(a.input.composingTimeout),b>-1&&(a.input.composingTimeout=setTimeout(()=>bg(a),b))}function bf(a){let b;for(a.composing&&(a.input.composing=!1,a.input.compositionEndedAt=((b=document.createEvent("Event")).initEvent("event",!0,!0),b.timeStamp));a.input.compositionNodes.length>0;)a.input.compositionNodes.pop().markParentsDirty()}function bg(a,b=!1){if(!I||!(a.domObserver.flushingSoon>=0)){if(a.domObserver.forceFlush(),bf(a),b||a.docView&&a.docView.dirty){let c=au(a),d=a.state.selection;return c&&!c.eq(d)?a.dispatch(a.state.tr.setSelection(c)):(a.markCursor||b)&&!d.$from.node(d.$from.sharedDepth(d.to)).inlineContent?a.dispatch(a.state.tr.deleteSelection()):a.updateState(a.state),!0}return!1}}a1.compositionstart=a1.compositionupdate=a=>{if(!a.composing){a.domObserver.flush();let{state:b}=a,c=b.selection.$to;if(b.selection instanceof d.U3&&(b.storedMarks||!c.textOffset&&c.parentOffset&&c.nodeBefore.marks.some(a=>!1===a.type.spec.inclusive)||C&&H&&function(a){let{focusNode:b,focusOffset:c}=a.domSelectionRange();if(!b||1!=b.nodeType||c>=b.childNodes.length)return!1;let d=b.childNodes[c];return 1==d.nodeType&&"false"==d.contentEditable}(a)))a.markCursor=a.state.storedMarks||c.marks(),bg(a,!0),a.markCursor=null;else if(bg(a,!b.selection.empty),A&&b.selection.empty&&c.parentOffset&&!c.textOffset&&c.nodeBefore.marks.length){let b=a.domSelectionRange();for(let c=b.focusNode,d=b.focusOffset;c&&1==c.nodeType&&0!=d;){let b=d<0?c.lastChild:c.childNodes[d-1];if(!b)break;if(3==b.nodeType){let c=a.domSelection();c&&c.collapse(b,b.nodeValue.length);break}c=b,d=-1}}a.input.composing=!0}be(a,bd)},a1.compositionend=(a,b)=>{a.composing&&(a.input.composing=!1,a.input.compositionEndedAt=b.timeStamp,a.input.compositionPendingChanges=a.domObserver.pendingRecords().length?a.input.compositionID:0,a.input.compositionNode=null,a.input.badSafariComposition?a.domObserver.forceFlush():a.input.compositionPendingChanges&&Promise.resolve().then(()=>a.domObserver.flush()),a.input.compositionID++,be(a,20))};let bh=y&&z<15||F&&K<604;function bi(a,b,c,d,f){let g=aT(a,b,c,d,a.state.selection.$from);if(a.someProp("handlePaste",b=>b(a,f,g||e.Ji.empty)))return!0;if(!g)return!1;let h=0==g.openStart&&0==g.openEnd&&1==g.content.childCount?g.content.firstChild:null,i=h?a.state.tr.replaceSelectionWith(h,d):a.state.tr.replaceSelection(g);return a.dispatch(i.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function bj(a){let b=a.getData("text/plain")||a.getData("Text");if(b)return b;let c=a.getData("text/uri-list");return c?c.replace(/\r?\n/g," "):""}a0.copy=a1.cut=(a,b)=>{let c=a.state.selection,d="cut"==b.type;if(c.empty)return;let e=bh?null:b.clipboardData,{dom:f,text:g}=aS(a,c.content());e?(b.preventDefault(),e.clearData(),e.setData("text/html",f.innerHTML),e.setData("text/plain",g)):function(a,b){if(!a.dom.parentNode)return;let c=a.dom.parentNode.appendChild(document.createElement("div"));c.appendChild(b),c.style.cssText="position: fixed; left: -10000px; top: 10px";let d=getSelection(),e=document.createRange();e.selectNodeContents(b),a.dom.blur(),d.removeAllRanges(),d.addRange(e),setTimeout(()=>{c.parentNode&&c.parentNode.removeChild(c),a.focus()},50)}(a,f),d&&a.dispatch(a.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},a1.paste=(a,b)=>{if(a.composing&&!I)return;let c=bh?null:b.clipboardData,d=a.input.shiftKey&&45!=a.input.lastKeyCode;c&&bi(a,bj(c),c.getData("text/html"),d,b)?b.preventDefault():function(a,b){if(!a.dom.parentNode)return;let c=a.input.shiftKey||a.state.selection.$from.parent.type.spec.code,d=a.dom.parentNode.appendChild(document.createElement(c?"textarea":"div"));c||(d.contentEditable="true"),d.style.cssText="position: fixed; left: -10000px; top: 10px",d.focus();let e=a.input.shiftKey&&45!=a.input.lastKeyCode;setTimeout(()=>{a.focus(),d.parentNode&&d.parentNode.removeChild(d),c?bi(a,d.value,null,e,b):bi(a,d.textContent,d.innerHTML,e,b)},50)}(a,b)};class bk{constructor(a,b,c){this.slice=a,this.move=b,this.node=c}}let bl=G?"altKey":"ctrlKey";function bm(a,b){let c=a.someProp("dragCopies",a=>!a(b));return null!=c?c:!b[bl]}for(let a in a0.dragstart=(a,b)=>{let c,e=a.input.mouseDown;if(e&&e.done(),!b.dataTransfer)return;let f=a.state.selection,g=f.empty?null:a.posAtCoords(a7(b));if(g&&g.pos>=f.from&&g.pos<=(f instanceof d.nh?f.to-1:f.to));else if(e&&e.mightDrag)c=d.nh.create(a.state.doc,e.mightDrag.pos);else if(b.target&&1==b.target.nodeType){let e=a.docView.nearestDesc(b.target,!0);e&&e.node.type.spec.draggable&&e!=a.docView&&(c=d.nh.create(a.state.doc,e.posBefore))}let h=(c||a.state.selection).content(),{dom:i,text:j,slice:k}=aS(a,h);b.dataTransfer.files.length&&C&&!(D>120)||b.dataTransfer.clearData(),b.dataTransfer.setData(bh?"Text":"text/html",i.innerHTML),b.dataTransfer.effectAllowed="copyMove",bh||b.dataTransfer.setData("text/plain",j),a.dragging=new bk(k,bm(a,b),c)},a0.dragend=a=>{let b=a.dragging;window.setTimeout(()=>{a.dragging==b&&(a.dragging=null)},50)},a1.dragover=a1.dragenter=(a,b)=>b.preventDefault(),a1.drop=(a,b)=>{try{!function(a,b,c){if(!b.dataTransfer)return;let g=a.posAtCoords(a7(b));if(!g)return;let h=a.state.doc.resolve(g.pos),i=c&&c.slice;i?a.someProp("transformPasted",b=>{i=b(i,a,!1)}):i=aT(a,bj(b.dataTransfer),bh?null:b.dataTransfer.getData("text/html"),!1,h);let j=!!(c&&bm(a,b));if(a.someProp("handleDrop",c=>c(a,b,i||e.Ji.empty,j)))return b.preventDefault();if(!i)return;b.preventDefault();let k=i?(0,f.Um)(a.state.doc,h.pos,i):h.pos;null==k&&(k=h.pos);let l=a.state.tr;if(j){let{node:a}=c;a?a.replace(l):l.deleteSelection()}let m=l.mapping.map(k),n=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,o=l.doc;if(n?l.replaceRangeWith(m,m,i.content.firstChild):l.replaceRange(m,m,i),l.doc.eq(o))return;let p=l.doc.resolve(m);if(n&&d.nh.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new d.nh(p));else{let b=l.mapping.map(k);l.mapping.maps[l.mapping.maps.length-1].forEach((a,c,d,e)=>b=e),l.setSelection(aD(a,p,l.doc.resolve(b)))}a.focus(),a.dispatch(l.setMeta("uiEvent","drop"))}(a,b,a.dragging)}finally{a.dragging=null}},a0.focus=a=>{a.input.lastFocus=Date.now(),a.focused||(a.domObserver.stop(),a.dom.classList.add("ProseMirror-focused"),a.domObserver.start(),a.focused=!0,setTimeout(()=>{a.docView&&a.hasFocus()&&!a.domObserver.currentSelection.eq(a.domSelectionRange())&&aw(a)},20))},a0.blur=(a,b)=>{a.focused&&(a.domObserver.stop(),a.dom.classList.remove("ProseMirror-focused"),a.domObserver.start(),b.relatedTarget&&a.dom.contains(b.relatedTarget)&&a.domObserver.currentSelection.clear(),a.focused=!1)},a0.beforeinput=(a,b)=>{if(C&&I&&"deleteContentBackward"==b.inputType){a.domObserver.flushSoon();let{domChangeCount:b}=a.input;setTimeout(()=>{if(a.input.domChangeCount!=b||(a.dom.blur(),a.focus(),a.someProp("handleKeyDown",b=>b(a,r(8,"Backspace")))))return;let{$cursor:c}=a.state.selection;c&&c.pos>0&&a.dispatch(a.state.tr.delete(c.pos-1,c.pos).scrollIntoView())},50)}},a1)a0[a]=a1[a];function bn(a,b){if(a==b)return!0;for(let c in a)if(a[c]!==b[c])return!1;for(let c in b)if(!(c in a))return!1;return!0}class bo{constructor(a,b){this.toDOM=a,this.spec=b||bt,this.side=this.spec.side||0}map(a,b,c,d){let{pos:e,deleted:f}=a.mapResult(b.from+d,this.side<0?-1:1);return f?null:new br(e-c,e-c,this)}valid(){return!0}eq(a){return this==a||a instanceof bo&&(this.spec.key&&this.spec.key==a.spec.key||this.toDOM==a.toDOM&&bn(this.spec,a.spec))}destroy(a){this.spec.destroy&&this.spec.destroy(a)}}class bp{constructor(a,b){this.attrs=a,this.spec=b||bt}map(a,b,c,d){let e=a.map(b.from+d,this.spec.inclusiveStart?-1:1)-c,f=a.map(b.to+d,this.spec.inclusiveEnd?1:-1)-c;return e>=f?null:new br(e,f,this)}valid(a,b){return b.from<b.to}eq(a){return this==a||a instanceof bp&&bn(this.attrs,a.attrs)&&bn(this.spec,a.spec)}static is(a){return a.type instanceof bp}destroy(){}}class bq{constructor(a,b){this.attrs=a,this.spec=b||bt}map(a,b,c,d){let e=a.mapResult(b.from+d,1);if(e.deleted)return null;let f=a.mapResult(b.to+d,-1);return f.deleted||f.pos<=e.pos?null:new br(e.pos-c,f.pos-c,this)}valid(a,b){let{index:c,offset:d}=a.content.findIndex(b.from),e;return d==b.from&&!(e=a.child(c)).isText&&d+e.nodeSize==b.to}eq(a){return this==a||a instanceof bq&&bn(this.attrs,a.attrs)&&bn(this.spec,a.spec)}destroy(){}}class br{constructor(a,b,c){this.from=a,this.to=b,this.type=c}copy(a,b){return new br(a,b,this.type)}eq(a,b=0){return this.type.eq(a.type)&&this.from+b==a.from&&this.to+b==a.to}map(a,b,c){return this.type.map(a,this,b,c)}static widget(a,b,c){return new br(a,a,new bo(b,c))}static inline(a,b,c,d){return new br(a,b,new bp(c,d))}static node(a,b,c,d){return new br(a,b,new bq(c,d))}get spec(){return this.type.spec}get inline(){return this.type instanceof bp}get widget(){return this.type instanceof bo}}let bs=[],bt={};class bu{constructor(a,b){this.local=a.length?a:bs,this.children=b.length?b:bs}static create(a,b){return b.length?bA(b,a,0,bt):bv}find(a,b,c){let d=[];return this.findInner(null==a?0:a,null==b?1e9:b,d,0,c),d}findInner(a,b,c,d,e){for(let f=0;f<this.local.length;f++){let g=this.local[f];g.from<=b&&g.to>=a&&(!e||e(g.spec))&&c.push(g.copy(g.from+d,g.to+d))}for(let f=0;f<this.children.length;f+=3)if(this.children[f]<b&&this.children[f+1]>a){let g=this.children[f]+1;this.children[f+2].findInner(a-g,b-g,c,d+g,e)}}map(a,b,c){return this==bv||0==a.maps.length?this:this.mapInner(a,b,0,0,c||bt)}mapInner(a,b,c,d,e){let f;for(let g=0;g<this.local.length;g++){let h=this.local[g].map(a,c,d);h&&h.type.valid(b,h)?(f||(f=[])).push(h):e.onRemove&&e.onRemove(this.local[g].spec)}return this.children.length?function(a,b,c,d,e,f,g){let h=a.slice();for(let a=0,b=f;a<c.maps.length;a++){let d=0;c.maps[a].forEach((a,c,e,f)=>{let g=f-e-(c-a);for(let e=0;e<h.length;e+=3){let f=h[e+1];if(f<0||a>f+b-d)continue;let i=h[e]+b-d;c>=i?h[e+1]=a<=i?-2:-1:a>=b&&g&&(h[e]+=g,h[e+1]+=g)}d+=g}),b=c.maps[a].map(b,-1)}let i=!1;for(let b=0;b<h.length;b+=3)if(h[b+1]<0){if(-2==h[b+1]){i=!0,h[b+1]=-1;continue}let j=c.map(a[b]+f),k=j-e;if(k<0||k>=d.content.size){i=!0;continue}let l=c.map(a[b+1]+f,-1)-e,{index:m,offset:n}=d.content.findIndex(k),o=d.maybeChild(m);if(o&&n==k&&n+o.nodeSize==l){let d=h[b+2].mapInner(c,o,j+1,a[b]+f+1,g);d!=bv?(h[b]=k,h[b+1]=l,h[b+2]=d):(h[b+1]=-2,i=!0)}else i=!0}if(i){let i=bA(function(a,b,c,d,e,f,g){for(let h=0;h<a.length;h+=3)-1==a[h+1]&&function a(b,f){for(let a=0;a<b.local.length;a++){let h=b.local[a].map(d,e,f);h?c.push(h):g.onRemove&&g.onRemove(b.local[a].spec)}for(let c=0;c<b.children.length;c+=3)a(b.children[c+2],b.children[c]+f+1)}(a[h+2],b[h]+f+1);return c}(h,a,b,c,e,f,g),d,0,g);b=i.local;for(let a=0;a<h.length;a+=3)h[a+1]<0&&(h.splice(a,3),a-=3);for(let a=0,b=0;a<i.children.length;a+=3){let c=i.children[a];for(;b<h.length&&h[b]<c;)b+=3;h.splice(b,0,i.children[a],i.children[a+1],i.children[a+2])}}return new bu(b.sort(bB),h)}(this.children,f||[],a,b,c,d,e):f?new bu(f.sort(bB),bs):bv}add(a,b){return b.length?this==bv?bu.create(a,b):this.addInner(a,b,0):this}addInner(a,b,c){let d,e=0;a.forEach((a,f)=>{let g=f+c,h;if(h=by(b,a,g)){for(d||(d=this.children.slice());e<d.length&&d[e]<f;)e+=3;d[e]==f?d[e+2]=d[e+2].addInner(a,h,g+1):d.splice(e,0,f,f+a.nodeSize,bA(h,a,g+1,bt)),e+=3}});let f=bx(e?bz(b):b,-c);for(let b=0;b<f.length;b++)f[b].type.valid(a,f[b])||f.splice(b--,1);return new bu(f.length?this.local.concat(f).sort(bB):this.local,d||this.children)}remove(a){return 0==a.length||this==bv?this:this.removeInner(a,0)}removeInner(a,b){let c=this.children,d=this.local;for(let d=0;d<c.length;d+=3){let e,f=c[d]+b,g=c[d+1]+b;for(let b=0,c;b<a.length;b++)(c=a[b])&&c.from>f&&c.to<g&&(a[b]=null,(e||(e=[])).push(c));if(!e)continue;c==this.children&&(c=this.children.slice());let h=c[d+2].removeInner(e,f+1);h!=bv?c[d+2]=h:(c.splice(d,3),d-=3)}if(d.length){for(let c=0,e;c<a.length;c++)if(e=a[c])for(let a=0;a<d.length;a++)d[a].eq(e,b)&&(d==this.local&&(d=this.local.slice()),d.splice(a--,1))}return c==this.children&&d==this.local?this:d.length||c.length?new bu(d,c):bv}forChild(a,b){let c,d;if(this==bv)return this;if(b.isLeaf)return bu.empty;for(let b=0;b<this.children.length;b+=3)if(this.children[b]>=a){this.children[b]==a&&(c=this.children[b+2]);break}let e=a+1,f=e+b.content.size;for(let a=0;a<this.local.length;a++){let b=this.local[a];if(b.from<f&&b.to>e&&b.type instanceof bp){let a=Math.max(e,b.from)-e,c=Math.min(f,b.to)-e;a<c&&(d||(d=[])).push(b.copy(a,c))}}if(d){let a=new bu(d.sort(bB),bs);return c?new bw([a,c]):a}return c||bv}eq(a){if(this==a)return!0;if(!(a instanceof bu)||this.local.length!=a.local.length||this.children.length!=a.children.length)return!1;for(let b=0;b<this.local.length;b++)if(!this.local[b].eq(a.local[b]))return!1;for(let b=0;b<this.children.length;b+=3)if(this.children[b]!=a.children[b]||this.children[b+1]!=a.children[b+1]||!this.children[b+2].eq(a.children[b+2]))return!1;return!0}locals(a){return bC(this.localsInner(a))}localsInner(a){if(this==bv)return bs;if(a.inlineContent||!this.local.some(bp.is))return this.local;let b=[];for(let a=0;a<this.local.length;a++)this.local[a].type instanceof bp||b.push(this.local[a]);return b}forEachSet(a){a(this)}}bu.empty=new bu([],[]),bu.removeOverlap=bC;let bv=bu.empty;class bw{constructor(a){this.members=a}map(a,b){let c=this.members.map(c=>c.map(a,b,bt));return bw.from(c)}forChild(a,b){if(b.isLeaf)return bu.empty;let c=[];for(let d=0;d<this.members.length;d++){let e=this.members[d].forChild(a,b);e!=bv&&(e instanceof bw?c=c.concat(e.members):c.push(e))}return bw.from(c)}eq(a){if(!(a instanceof bw)||a.members.length!=this.members.length)return!1;for(let b=0;b<this.members.length;b++)if(!this.members[b].eq(a.members[b]))return!1;return!0}locals(a){let b,c=!0;for(let d=0;d<this.members.length;d++){let e=this.members[d].localsInner(a);if(e.length)if(b){c&&(b=b.slice(),c=!1);for(let a=0;a<e.length;a++)b.push(e[a])}else b=e}return b?bC(c?b:b.sort(bB)):bs}static from(a){switch(a.length){case 0:return bv;case 1:return a[0];default:return new bw(a.every(a=>a instanceof bu)?a:a.reduce((a,b)=>a.concat(b instanceof bu?b:b.members),[]))}}forEachSet(a){for(let b=0;b<this.members.length;b++)this.members[b].forEachSet(a)}}function bx(a,b){if(!b||!a.length)return a;let c=[];for(let d=0;d<a.length;d++){let e=a[d];c.push(new br(e.from+b,e.to+b,e.type))}return c}function by(a,b,c){if(b.isLeaf)return null;let d=c+b.nodeSize,e=null;for(let b=0,f;b<a.length;b++)(f=a[b])&&f.from>c&&f.to<d&&((e||(e=[])).push(f),a[b]=null);return e}function bz(a){let b=[];for(let c=0;c<a.length;c++)null!=a[c]&&b.push(a[c]);return b}function bA(a,b,c,d){let e=[],f=!1;b.forEach((b,g)=>{let h=by(a,b,g+c);if(h){f=!0;let a=bA(h,b,c+g+1,d);a!=bv&&e.push(g,g+b.nodeSize,a)}});let g=bx(f?bz(a):a,-c).sort(bB);for(let a=0;a<g.length;a++)g[a].type.valid(b,g[a])||(d.onRemove&&d.onRemove(g[a].spec),g.splice(a--,1));return g.length||e.length?new bu(g,e):bv}function bB(a,b){return a.from-b.from||a.to-b.to}function bC(a){let b=a;for(let c=0;c<b.length-1;c++){let d=b[c];if(d.from!=d.to)for(let e=c+1;e<b.length;e++){let f=b[e];if(f.from==d.from){f.to!=d.to&&(b==a&&(b=a.slice()),b[e]=f.copy(f.from,d.to),bD(b,e+1,f.copy(d.to,f.to)));continue}f.from<d.to&&(b==a&&(b=a.slice()),b[c]=d.copy(d.from,f.from),bD(b,e,d.copy(f.from,d.to)));break}}return b}function bD(a,b,c){for(;b<a.length&&bB(c,a[b])>0;)b++;a.splice(b,0,c)}function bE(a){let b=[];return a.someProp("decorations",c=>{let d=c(a.state);d&&d!=bv&&b.push(d)}),a.cursorWrapper&&b.push(bu.create(a.state.doc,[a.cursorWrapper.deco])),bw.from(b)}let bF={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},bG=y&&z<=11;class bH{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(a){this.anchorNode=a.anchorNode,this.anchorOffset=a.anchorOffset,this.focusNode=a.focusNode,this.focusOffset=a.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(a){return a.anchorNode==this.anchorNode&&a.anchorOffset==this.anchorOffset&&a.focusNode==this.focusNode&&a.focusOffset==this.focusOffset}}class bI{constructor(a,b){this.view=a,this.handleDOMChange=b,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new bH,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(b=>{for(let a=0;a<b.length;a++)this.queue.push(b[a]);y&&z<=11&&b.some(a=>"childList"==a.type&&a.removedNodes.length||"characterData"==a.type&&a.oldValue.length>a.target.nodeValue.length)?this.flushSoon():E&&a.composing&&b.some(a=>"childList"==a.type&&"TR"==a.target.nodeName)?(a.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),bG&&(this.onCharData=a=>{this.queue.push({target:a.target,type:"characterData",oldValue:a.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,bF)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let a=this.observer.takeRecords();if(a.length){for(let b=0;b<a.length;b++)this.queue.push(a[b]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(aE(this.view)){if(this.suppressingSelectionUpdates)return aw(this.view);if(y&&z<=11&&!this.view.state.selection.empty){let a=this.view.domSelectionRange();if(a.focusNode&&l(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(a){if(!a.focusNode)return!0;let b=new Set,c;for(let c=a.focusNode;c;c=h(c))b.add(c);for(let d=a.anchorNode;d;d=h(d))if(b.has(d)){c=d;break}let d=c&&this.view.docView.nearestDesc(c);if(d&&d.ignoreMutation({type:"selection",target:3==c.nodeType?c.parentNode:c}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let a of this.observer.takeRecords())this.queue.push(a);return this.queue}flush(){var a;let{view:b}=this;if(!b.docView||this.flushingSoon>-1)return;let c=this.pendingRecords();c.length&&(this.queue=[]);let e=b.domSelectionRange(),f=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&aE(b)&&!this.ignoreSelectionChange(e),g=-1,h=-1,i=!1,j=[];if(b.editable)for(let a=0;a<c.length;a++){let b=this.registerMutation(c[a],j);b&&(g=g<0?b.from:Math.min(b.from,g),h=h<0?b.to:Math.max(b.to,h),b.typeOver&&(i=!0))}if(j.some(a=>"BR"==a.nodeName)&&(8==b.input.lastKeyCode||46==b.input.lastKeyCode)){for(let a of j)if("BR"==a.nodeName&&a.parentNode){let b=a.nextSibling;b&&1==b.nodeType&&"false"==b.contentEditable&&a.parentNode.removeChild(a)}}else if(A&&j.length){let a=j.filter(a=>"BR"==a.nodeName);if(2==a.length){let[b,c]=a;b.parentNode&&b.parentNode.parentNode==c.parentNode?c.remove():b.remove()}else{let{focusNode:c}=this.currentSelection;for(let d of a){let a=d.parentNode;a&&"LI"==a.nodeName&&(!c||function(a,b){for(let c=b.parentNode;c&&c!=a.dom;c=c.parentNode){let b=a.docView.nearestDesc(c,!0);if(b&&b.node.isBlock)return c}return null}(b,c)!=a)&&d.remove()}}}let k=null;g<0&&f&&b.input.lastFocus>Date.now()-200&&Math.max(b.input.lastTouch,b.input.lastClick.time)<Date.now()-300&&q(e)&&(k=au(b))&&k.eq(d.LN.near(b.state.doc.resolve(0),1))?(b.input.lastFocus=0,aw(b),this.currentSelection.set(e),b.scrollToSelection()):(g>-1||f)&&(g>-1&&(b.docView.markDirty(g,h),a=b,!bJ.has(a)&&(bJ.set(a,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(a.dom).whiteSpace))&&(a.requiresGeckoHackNode=A,bK||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),bK=!0))),b.input.badSafariComposition&&(b.input.badSafariComposition=!1,function(a,b){var c;let{focusNode:d,focusOffset:e}=a.domSelectionRange();for(let f of b)if((null==(c=f.parentNode)?void 0:c.nodeName)=="TR"){let b=f.nextSibling;for(;b&&"TD"!=b.nodeName&&"TH"!=b.nodeName;)b=b.nextSibling;if(b){let c=b;for(;;){let a=c.firstChild;if(!a||1!=a.nodeType||"false"==a.contentEditable||/^(BR|IMG)$/.test(a.nodeName))break;c=a}c.insertBefore(f,c.firstChild),d==f&&a.domSelection().collapse(f,e)}else f.parentNode.removeChild(f)}}(b,j)),this.handleDOMChange(g,h,i,j),b.docView&&b.docView.dirty?b.updateState(b.state):this.currentSelection.eq(e)||aw(b),this.currentSelection.set(e))}registerMutation(a,b){if(b.indexOf(a.target)>-1)return null;let c=this.view.docView.nearestDesc(a.target);if("attributes"==a.type&&(c==this.view.docView||"contenteditable"==a.attributeName||"style"==a.attributeName&&!a.oldValue&&!a.target.getAttribute("style"))||!c||c.ignoreMutation(a))return null;if("childList"==a.type){for(let c=0;c<a.addedNodes.length;c++){let d=a.addedNodes[c];b.push(d),3==d.nodeType&&(this.lastChangedTextNode=d)}if(c.contentDOM&&c.contentDOM!=c.dom&&!c.contentDOM.contains(a.target))return{from:c.posBefore,to:c.posAfter};let d=a.previousSibling,e=a.nextSibling;if(y&&z<=11&&a.addedNodes.length)for(let b=0;b<a.addedNodes.length;b++){let{previousSibling:c,nextSibling:f}=a.addedNodes[b];(!c||0>Array.prototype.indexOf.call(a.addedNodes,c))&&(d=c),(!f||0>Array.prototype.indexOf.call(a.addedNodes,f))&&(e=f)}let f=d&&d.parentNode==a.target?g(d)+1:0,h=c.localPosFromDOM(a.target,f,-1),i=e&&e.parentNode==a.target?g(e):a.target.childNodes.length;return{from:h,to:c.localPosFromDOM(a.target,i,1)}}return"attributes"==a.type?{from:c.posAtStart-c.border,to:c.posAtEnd+c.border}:(this.lastChangedTextNode=a.target,{from:c.posAtStart,to:c.posAtEnd,typeOver:a.target.nodeValue==a.oldValue})}}let bJ=new WeakMap,bK=!1;function bL(a,b){let c=b.startContainer,d=b.startOffset,e=b.endContainer,f=b.endOffset,g=a.domAtPos(a.state.selection.anchor);return l(g.node,g.offset,e,f)&&([c,d,e,f]=[e,f,c,d]),{anchorNode:c,anchorOffset:d,focusNode:e,focusOffset:f}}function bM(a){let b=a.pmViewDesc;if(b)return b.parseRule();if("BR"==a.nodeName&&a.parentNode){if(E&&/^(ul|ol)$/i.test(a.parentNode.nodeName)){let a=document.createElement("div");return a.appendChild(document.createElement("li")),{skip:a}}else if(a.parentNode.lastChild==a||E&&/^(tr|table)$/i.test(a.parentNode.nodeName))return{ignore:!0}}else if("IMG"==a.nodeName&&a.getAttribute("mark-placeholder"))return{ignore:!0};return null}let bN=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function bO(a,b,c){return Math.max(c.anchor,c.head)>b.content.size?null:aD(a,b.resolve(c.anchor),b.resolve(c.head))}function bP(a,b,c){let d=a.depth,e=b?a.end():a.pos;for(;d>0&&(b||a.indexAfter(d)==a.node(d).childCount);)d--,e++,b=!1;if(c){let b=a.node(d).maybeChild(a.indexAfter(d));for(;b&&!b.isLeaf;)b=b.firstChild,e++}return e}function bQ(a){if(2!=a.length)return!1;let b=a.charCodeAt(0),c=a.charCodeAt(1);return b>=56320&&b<=57343&&c>=55296&&c<=56319}class bR{constructor(a,b){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new a3,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=b,this.state=b.state,this.directPlugins=b.plugins||[],this.directPlugins.forEach(bW),this.dispatch=this.dispatch.bind(this),this.dom=a&&a.mount||document.createElement("div"),a&&(a.appendChild?a.appendChild(this.dom):"function"==typeof a?a(this.dom):a.mount&&(this.mounted=!0)),this.editable=bU(this),bT(this),this.nodeViews=bV(this),this.docView=ag(this.state.doc,bS(this),bE(this),this.dom,this),this.domObserver=new bI(this,(a,b,c,f)=>(function(a,b,c,f,g){let h,i,j,k=a.input.compositionPendingChanges||(a.composing?a.input.compositionID:0);if(a.input.compositionPendingChanges=0,b<0){let b=a.input.lastSelectionTime>Date.now()-50?a.input.lastSelectionOrigin:null,c=au(a,b);if(c&&!a.state.selection.eq(c)){if(C&&I&&13===a.input.lastKeyCode&&Date.now()-100<a.input.lastKeyCodeTime&&a.someProp("handleKeyDown",b=>b(a,r(13,"Enter"))))return;let d=a.state.tr.setSelection(c);"pointer"==b?d.setMeta("pointer",!0):"key"==b&&d.scrollIntoView(),k&&d.setMeta("composition",k),a.dispatch(d)}return}let l=a.state.doc.resolve(b),m=l.sharedDepth(c);b=l.before(m+1),c=a.state.doc.resolve(c).after(m+1);let n=a.state.selection,o=function(a,b,c){let d,{node:f,fromOffset:g,toOffset:h,from:i,to:j}=a.docView.parseRange(b,c),k=a.domSelectionRange(),l=k.anchorNode;if(l&&a.dom.contains(1==l.nodeType?l:l.parentNode)&&(d=[{node:l,offset:k.anchorOffset}],q(k)||d.push({node:k.focusNode,offset:k.focusOffset})),C&&8===a.input.lastKeyCode)for(let a=h;a>g;a--){let b=f.childNodes[a-1],c=b.pmViewDesc;if("BR"==b.nodeName&&!c){h=a;break}if(!c||c.size)break}let m=a.state.doc,n=a.someProp("domParser")||e.S4.fromSchema(a.state.schema),o=m.resolve(i),p=null,r=n.parse(f,{topNode:o.parent,topMatch:o.parent.contentMatchAt(o.index()),topOpen:!0,from:g,to:h,preserveWhitespace:"pre"!=o.parent.type.whitespace||"full",findPositions:d,ruleFromNode:bM,context:o});if(d&&null!=d[0].pos){let a=d[0].pos,b=d[1]&&d[1].pos;null==b&&(b=a),p={anchor:a+i,head:b+i}}return{doc:r,sel:p,from:i,to:j}}(a,b,c),p=a.state.doc,s=p.slice(o.from,o.to);8===a.input.lastKeyCode&&Date.now()-100<a.input.lastKeyCodeTime?(h=a.state.selection.to,i="end"):(h=a.state.selection.from,i="start"),a.input.lastKeyCode=null;let t=function(a,b,c,d,e){let f=a.findDiffStart(b,c);if(null==f)return null;let{a:g,b:h}=a.findDiffEnd(b,c+a.size,c+b.size);if("end"==e){let a=Math.max(0,f-Math.min(g,h));d-=g+a-f}if(g<f&&a.size<b.size){let a=d<=f&&d>=g?f-d:0;(f-=a)&&f<b.size&&bQ(b.textBetween(f-1,f+1))&&(f+=a?1:-1),h=f+(h-g),g=f}else if(h<f){let b=d<=f&&d>=h?f-d:0;(f-=b)&&f<a.size&&bQ(a.textBetween(f-1,f+1))&&(f+=b?1:-1),g=f+(g-h),h=f}return{start:f,endA:g,endB:h}}(s.content,o.doc.content,o.from,h,i);if(t&&a.input.domChangeCount++,(F&&a.input.lastIOSEnter>Date.now()-225||I)&&g.some(a=>1==a.nodeType&&!bN.test(a.nodeName))&&(!t||t.endA>=t.endB)&&a.someProp("handleKeyDown",b=>b(a,r(13,"Enter")))){a.input.lastIOSEnter=0;return}if(!t)if(f&&n instanceof d.U3&&!n.empty&&n.$head.sameParent(n.$anchor)&&!a.composing&&!(o.sel&&o.sel.anchor!=o.sel.head))t={start:n.from,endA:n.to,endB:n.to};else{if(o.sel){let b=bO(a,a.state.doc,o.sel);if(b&&!b.eq(a.state.selection)){let c=a.state.tr.setSelection(b);k&&c.setMeta("composition",k),a.dispatch(c)}}return}a.state.selection.from<a.state.selection.to&&t.start==t.endB&&a.state.selection instanceof d.U3&&(t.start>a.state.selection.from&&t.start<=a.state.selection.from+2&&a.state.selection.from>=o.from?t.start=a.state.selection.from:t.endA<a.state.selection.to&&t.endA>=a.state.selection.to-2&&a.state.selection.to<=o.to&&(t.endB+=a.state.selection.to-t.endA,t.endA=a.state.selection.to)),y&&z<=11&&t.endB==t.start+1&&t.endA==t.start&&t.start>o.from&&" \xa0"==o.doc.textBetween(t.start-o.from-1,t.start-o.from+1)&&(t.start--,t.endA--,t.endB--);let u=o.doc.resolveNoCache(t.start-o.from),v=o.doc.resolveNoCache(t.endB-o.from),w=p.resolve(t.start),x=u.sameParent(v)&&u.parent.inlineContent&&w.end()>=t.endA;if((F&&a.input.lastIOSEnter>Date.now()-225&&(!x||g.some(a=>"DIV"==a.nodeName||"P"==a.nodeName))||!x&&u.pos<o.doc.content.size&&(!u.sameParent(v)||!u.parent.inlineContent)&&u.pos<v.pos&&!/\S/.test(o.doc.textBetween(u.pos,v.pos,"","")))&&a.someProp("handleKeyDown",b=>b(a,r(13,"Enter")))){a.input.lastIOSEnter=0;return}if(a.state.selection.anchor>t.start&&function(a,b,c,d,e){if(c-b<=e.pos-d.pos||bP(d,!0,!1)<e.pos)return!1;let f=a.resolve(b);if(!d.parent.isTextblock){let a=f.nodeAfter;return null!=a&&c==b+a.nodeSize}if(f.parentOffset<f.parent.content.size||!f.parent.isTextblock)return!1;let g=a.resolve(bP(f,!0,!0));return!(!g.parent.isTextblock||g.pos>c||bP(g,!0,!1)<c)&&d.parent.content.cut(d.parentOffset).eq(g.parent.content)}(p,t.start,t.endA,u,v)&&a.someProp("handleKeyDown",b=>b(a,r(8,"Backspace")))){I&&C&&a.domObserver.suppressSelectionUpdates();return}C&&t.endB==t.start&&(a.input.lastChromeDelete=Date.now()),I&&!x&&u.start()!=v.start()&&0==v.parentOffset&&u.depth==v.depth&&o.sel&&o.sel.anchor==o.sel.head&&o.sel.head==t.endA&&(t.endB-=2,v=o.doc.resolveNoCache(t.endB-o.from),setTimeout(()=>{a.someProp("handleKeyDown",function(b){return b(a,r(13,"Enter"))})},20));let A=t.start,B=t.endA,D=b=>{let c=b||a.state.tr.replace(A,B,o.doc.slice(t.start-o.from,t.endB-o.from));if(o.sel){let b=bO(a,c.doc,o.sel);b&&!(C&&a.composing&&b.empty&&(t.start!=t.endB||a.input.lastChromeDelete<Date.now()-100)&&(b.head==A||b.head==c.mapping.map(B)-1)||y&&b.empty&&b.head==A)&&c.setSelection(b)}return k&&c.setMeta("composition",k),c.scrollIntoView()};if(x)if(u.pos==v.pos){y&&z<=11&&0==u.parentOffset&&(a.domObserver.suppressSelectionUpdates(),setTimeout(()=>aw(a),20));let b=D(a.state.tr.delete(A,B)),c=p.resolve(t.start).marksAcross(p.resolve(t.endA));c&&b.ensureMarks(c),a.dispatch(b)}else if(t.endA==t.endB&&(j=function(a,b){let c=a.firstChild.marks,d=b.firstChild.marks,f=c,g=d,h,i,j;for(let a=0;a<d.length;a++)f=d[a].removeFromSet(f);for(let a=0;a<c.length;a++)g=c[a].removeFromSet(g);if(1==f.length&&0==g.length)i=f[0],h="add",j=a=>a.mark(i.addToSet(a.marks));else{if(0!=f.length||1!=g.length)return null;i=g[0],h="remove",j=a=>a.mark(i.removeFromSet(a.marks))}let k=[];for(let a=0;a<b.childCount;a++)k.push(j(b.child(a)));if(e.FK.from(k).eq(a))return{mark:i,type:h}}(u.parent.content.cut(u.parentOffset,v.parentOffset),w.parent.content.cut(w.parentOffset,t.endA-w.start())))){let b=D(a.state.tr);"add"==j.type?b.addMark(A,B,j.mark):b.removeMark(A,B,j.mark),a.dispatch(b)}else if(u.parent.child(u.index()).isText&&u.index()==v.index()-!v.textOffset){let b=u.parent.textBetween(u.parentOffset,v.parentOffset),c=()=>D(a.state.tr.insertText(b,A,B));a.someProp("handleTextInput",d=>d(a,A,B,b,c))||a.dispatch(c())}else a.dispatch(D());else a.dispatch(D())})(this,a,b,c,f)),this.domObserver.start(),function(a){for(let b in a0){let c=a0[b];a.dom.addEventListener(b,a.input.eventHandlers[b]=b=>{!function(a,b){if(!b.bubbles)return!0;if(b.defaultPrevented)return!1;for(let c=b.target;c!=a.dom;c=c.parentNode)if(!c||11==c.nodeType||c.pmViewDesc&&c.pmViewDesc.stopEvent(b))return!1;return!0}(a,b)||a6(a,b)||!a.editable&&b.type in a1||c(a,b)},a2[b]?{passive:!0}:void 0)}E&&a.dom.addEventListener("input",()=>null),a5(a)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let a=this._props;for(let b in this._props={},a)this._props[b]=a[b];this._props.state=this.state}return this._props}update(a){a.handleDOMEvents!=this._props.handleDOMEvents&&a5(this);let b=this._props;this._props=a,a.plugins&&(a.plugins.forEach(bW),this.directPlugins=a.plugins),this.updateStateInner(a.state,b)}setProps(a){let b={};for(let a in this._props)b[a]=this._props[a];for(let c in b.state=this.state,a)b[c]=a[c];this.update(b)}updateState(a){this.updateStateInner(a,this._props)}updateStateInner(a,b){var c,d,e;let f=this.state,h=!1,i=!1;a.storedMarks&&this.composing&&(bf(this),i=!0),this.state=a;let j=f.plugins!=a.plugins||this._props.plugins!=b.plugins;if(j||this._props.plugins!=b.plugins||this._props.nodeViews!=b.nodeViews){let a=bV(this);(function(a,b){let c=0,d=0;for(let d in a){if(a[d]!=b[d])return!0;c++}for(let a in b)d++;return c!=d})(a,this.nodeViews)&&(this.nodeViews=a,h=!0)}(j||b.handleDOMEvents!=this._props.handleDOMEvents)&&a5(this),this.editable=bU(this),bT(this);let k=bE(this),m=bS(this),n=f.plugins==a.plugins||f.doc.eq(a.doc)?a.scrollToSelection>f.scrollToSelection?"to selection":"preserve":"reset",q=h||!this.docView.matchesNode(a.doc,m,k);(q||!a.selection.eq(f.selection))&&(i=!0);let r="preserve"==n&&i&&null==this.dom.style.overflowAnchor&&function(a){let b,c,d=a.dom.getBoundingClientRect(),e=Math.max(0,d.top);for(let f=(d.left+d.right)/2,g=e+1;g<Math.min(innerHeight,d.bottom);g+=5){let d=a.root.elementFromPoint(f,g);if(!d||d==a.dom||!a.dom.contains(d))continue;let h=d.getBoundingClientRect();if(h.top>=e-20){b=d,c=h.top;break}}return{refDOM:b,refTop:c,stack:N(a.dom)}}(this);if(i){let b,c,i;this.domObserver.stop();let j=q&&(y||C)&&!this.composing&&!f.selection.empty&&!a.selection.empty&&(d=f.selection,e=a.selection,i=Math.min(d.$anchor.sharedDepth(d.head),e.$anchor.sharedDepth(e.head)),d.$anchor.start(i)!=e.$anchor.start(i));if(q){let b=C?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(a){let b=a.domSelectionRange();if(!b.focusNode)return null;let c=function(a,b){for(;;){if(3==a.nodeType&&b)return a;if(1==a.nodeType&&b>0){if("false"==a.contentEditable)return null;b=o(a=a.childNodes[b-1])}else{if(!a.parentNode||p(a))return null;b=g(a),a=a.parentNode}}}(b.focusNode,b.focusOffset),d=function(a,b){for(;;){if(3==a.nodeType&&b<a.nodeValue.length)return a;if(1==a.nodeType&&b<a.childNodes.length){if("false"==a.contentEditable)return null;a=a.childNodes[b],b=0}else{if(!a.parentNode||p(a))return null;b=g(a)+1,a=a.parentNode}}}(b.focusNode,b.focusOffset);if(c&&d&&c!=d){let b=d.pmViewDesc,e=a.domObserver.lastChangedTextNode;if(c==e||d==e)return e;if(!b||!b.isText(d.nodeValue))return d;if(a.input.compositionNode==d){let a=c.pmViewDesc;if(!(!a||!a.isText(c.nodeValue)))return d}}return c||d}(this)),(h||!this.docView.update(a.doc,m,k,this))&&(this.docView.updateOuterDeco(m),this.docView.destroy(),this.docView=ag(a.doc,m,k,this.dom,this)),!b||this.trackWrites&&this.dom.contains(this.trackWrites)||(j=!0)}j||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(b=this.docView.domFromPos(this.state.selection.anchor,0),c=this.domSelectionRange(),l(b.node,b.offset,c.anchorNode,c.anchorOffset)))?aw(this,j):(aB(this,a.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(f),(null==(c=this.dragging)?void 0:c.node)&&!f.doc.eq(a.doc)&&this.updateDraggedNode(this.dragging,f),"reset"==n?this.dom.scrollTop=0:"to selection"==n?this.scrollToSelection():r&&function({refDOM:a,refTop:b,stack:c}){let d=a?a.getBoundingClientRect().top:0;O(c,0==d?0:d-b)}(r)}scrollToSelection(){let a=this.domSelectionRange().focusNode;if(a&&this.dom.contains(1==a.nodeType?a:a.parentNode))if(this.someProp("handleScrollToSelection",a=>a(this)));else if(this.state.selection instanceof d.nh){let b=this.docView.domAfterPos(this.state.selection.from);1==b.nodeType&&M(this,b.getBoundingClientRect(),a)}else M(this,this.coordsAtPos(this.state.selection.head,1),a)}destroyPluginViews(){let a;for(;a=this.pluginViews.pop();)a.destroy&&a.destroy()}updatePluginViews(a){if(a&&a.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let b=0;b<this.pluginViews.length;b++){let c=this.pluginViews[b];c.update&&c.update(this,a)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let a=0;a<this.directPlugins.length;a++){let b=this.directPlugins[a];b.spec.view&&this.pluginViews.push(b.spec.view(this))}for(let a=0;a<this.state.plugins.length;a++){let b=this.state.plugins[a];b.spec.view&&this.pluginViews.push(b.spec.view(this))}}}updateDraggedNode(a,b){let c=a.node,e=-1;if(this.state.doc.nodeAt(c.from)==c.node)e=c.from;else{let a=c.from+(this.state.doc.content.size-b.doc.content.size);(a>0&&this.state.doc.nodeAt(a))==c.node&&(e=a)}this.dragging=new bk(a.slice,a.move,e<0?void 0:d.nh.create(this.state.doc,e))}someProp(a,b){let c=this._props&&this._props[a],d;if(null!=c&&(d=b?b(c):c))return d;for(let c=0;c<this.directPlugins.length;c++){let e=this.directPlugins[c].props[a];if(null!=e&&(d=b?b(e):e))return d}let e=this.state.plugins;if(e)for(let c=0;c<e.length;c++){let f=e[c].props[a];if(null!=f&&(d=b?b(f):f))return d}}hasFocus(){if(y){let a=this.root.activeElement;if(a==this.dom)return!0;if(!a||!this.dom.contains(a))return!1;for(;a&&this.dom!=a&&this.dom.contains(a);){if("false"==a.contentEditable)return!1;a=a.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(a){if(a.setActive)return a.setActive();if(P)return a.focus(P);let b=N(a);a.focus(null==P?{get preventScroll(){return P={preventScroll:!0},!0}}:void 0),P||(P=!1,O(b,0))}(this.dom),aw(this),this.domObserver.start()}get root(){let a=this._root;if(null==a){for(let a=this.dom.parentNode;a;a=a.parentNode)if(9==a.nodeType||11==a.nodeType&&a.host)return a.getSelection||(Object.getPrototypeOf(a).getSelection=()=>a.ownerDocument.getSelection()),this._root=a}return a||document}updateRoot(){this._root=null}posAtCoords(a){return function(a,b){var c;let d,e,f=a.dom.ownerDocument,g,i=0,k=function(a,b,c){if(a.caretPositionFromPoint)try{let d=a.caretPositionFromPoint(b,c);if(d)return{node:d.offsetNode,offset:Math.min(o(d.offsetNode),d.offset)}}catch(a){}if(a.caretRangeFromPoint){let d=a.caretRangeFromPoint(b,c);if(d)return{node:d.startContainer,offset:Math.min(o(d.startContainer),d.startOffset)}}}(f,b.left,b.top);k&&({node:g,offset:i}=k);let l=(a.root.elementFromPoint?a.root:f).elementFromPoint(b.left,b.top);if(!l||!a.dom.contains(1!=l.nodeType?l.parentNode:l)){let c=a.dom.getBoundingClientRect();if(!Q(b,c)||!(l=function a(b,c,d){let e=b.childNodes.length;if(e&&d.top<d.bottom)for(let f=Math.max(0,Math.min(e-1,Math.floor(e*(c.top-d.top)/(d.bottom-d.top))-2)),g=f;;){let d=b.childNodes[g];if(1==d.nodeType){let b=d.getClientRects();for(let e=0;e<b.length;e++){let f=b[e];if(Q(c,f))return a(d,c,f)}}if((g=(g+1)%e)==f)break}return b}(a.dom,b,c)))return null}if(E)for(let a=l;g&&a;a=h(a))a.draggable&&(g=void 0);if(l=(d=(c=l).parentNode)&&/^li$/i.test(d.nodeName)&&b.left<c.getBoundingClientRect().left?d:c,g){let c;if(A&&1==g.nodeType&&(i=Math.min(i,g.childNodes.length))<g.childNodes.length){let a=g.childNodes[i],c;"IMG"==a.nodeName&&(c=a.getBoundingClientRect()).right<=b.left&&c.bottom>b.top&&i++}J&&i&&1==g.nodeType&&1==(c=g.childNodes[i-1]).nodeType&&"false"==c.contentEditable&&c.getBoundingClientRect().top>=b.top&&i--,g==a.dom&&i==g.childNodes.length-1&&1==g.lastChild.nodeType&&b.top>g.lastChild.getBoundingClientRect().bottom?e=a.state.doc.content.size:(0==i||1!=g.nodeType||"BR"!=g.childNodes[i-1].nodeName)&&(e=function(a,b,c,d){let e=-1;for(let c=b,f=!1;c!=a.dom;){let b=a.docView.nearestDesc(c,!0),g;if(!b)return null;if(1==b.dom.nodeType&&(b.node.isBlock&&b.parent||!b.contentDOM)&&((g=b.dom.getBoundingClientRect()).width||g.height)&&(b.node.isBlock&&b.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(b.dom.nodeName)&&(!f&&g.left>d.left||g.top>d.top?e=b.posBefore:(!f&&g.right<d.left||g.bottom<d.top)&&(e=b.posAfter),f=!0),!b.contentDOM&&e<0&&!b.node.isText))return(b.node.isBlock?d.top<(g.top+g.bottom)/2:d.left<(g.left+g.right)/2)?b.posBefore:b.posAfter;c=b.dom.parentNode}return e>-1?e:a.docView.posFromDOM(b,c,-1)}(a,g,i,b))}null==e&&(e=function(a,b,c){let{node:d,offset:e}=function a(b,c){let d,e,f,g=2e8,h,i=0,k=c.top,l=c.top;for(let a=b.firstChild,m=0;a;a=a.nextSibling,m++){let b;if(1==a.nodeType)b=a.getClientRects();else{if(3!=a.nodeType)continue;b=j(a).getClientRects()}for(let j=0;j<b.length;j++){let n=b[j];if(n.top<=k&&n.bottom>=l){k=Math.max(n.bottom,k),l=Math.min(n.top,l);let b=n.left>c.left?n.left-c.left:n.right<c.left?c.left-n.right:0;if(b<g){f=a,g=b,h=b&&3==f.nodeType?{left:n.right<c.left?n.right:n.left,top:c.top}:c,1==a.nodeType&&b&&(i=m+ +(c.left>=(n.left+n.right)/2));continue}}else n.top>c.top&&!d&&n.left<=c.left&&n.right>=c.left&&(d=a,e={left:Math.max(n.left,Math.min(n.right,c.left)),top:n.top});!f&&(c.left>=n.right&&c.top>=n.top||c.left>=n.left&&c.top>=n.bottom)&&(i=m+1)}}return(!f&&d&&(f=d,h=e,g=0),f&&3==f.nodeType)?function(a,b){let c=a.nodeValue.length,d=document.createRange(),e;for(let f=0;f<c;f++){d.setEnd(a,f+1),d.setStart(a,f);let c=S(d,1);if(c.top!=c.bottom&&Q(b,c)){e={node:a,offset:f+ +(b.left>=(c.left+c.right)/2)};break}}return d.detach(),e||{node:a,offset:0}}(f,h):!f||g&&1==f.nodeType?{node:b,offset:i}:a(f,h)}(b,c),f=-1;if(1==d.nodeType&&!d.firstChild){let a=d.getBoundingClientRect();f=a.left!=a.right&&c.left>(a.left+a.right)/2?1:-1}return a.docView.posFromDOM(d,e,f)}(a,l,b));let m=a.docView.nearestDesc(l,!0);return{pos:e,inside:m?m.posAtStart-m.border:-1}}(this,a)}coordsAtPos(a,b=1){return U(this,a,b)}domAtPos(a,b=0){return this.docView.domFromPos(a,b)}nodeDOM(a){let b=this.docView.descAt(a);return b?b.nodeDOM:null}posAtDOM(a,b,c=-1){let d=this.docView.posFromDOM(a,b,c);if(null==d)throw RangeError("DOM position not inside the editor");return d}endOfTextblock(a,b){return function(a,b,c){let d,e;return Z==b&&_==c?aa:(Z=b,_=c,aa="up"==c||"down"==c?(d=b.selection,e="up"==c?d.$from:d.$to,X(a,b,()=>{let{node:b}=a.docView.domFromPos(e.pos,"up"==c?-1:1);for(;;){let c=a.docView.nearestDesc(b,!0);if(!c)break;if(c.node.isBlock){b=c.contentDOM||c.dom;break}b=c.dom.parentNode}let d=U(a,e.pos,1);for(let a=b.firstChild;a;a=a.nextSibling){let b;if(1==a.nodeType)b=a.getClientRects();else{if(3!=a.nodeType)continue;b=j(a,0,a.nodeValue.length).getClientRects()}for(let a=0;a<b.length;a++){let e=b[a];if(e.bottom>e.top+1&&("up"==c?d.top-e.top>(e.bottom-d.top)*2:e.bottom-d.bottom>(d.bottom-e.top)*2))return!1}}return!0})):function(a,b,c){let{$head:d}=b.selection;if(!d.parent.isTextblock)return!1;let e=d.parentOffset,f=e==d.parent.content.size,g=a.domSelection();return g?Y.test(d.parent.textContent)&&g.modify?X(a,b,()=>{let{focusNode:b,focusOffset:e,anchorNode:f,anchorOffset:h}=a.domSelectionRange(),i=g.caretBidiLevel;g.modify("move",c,"character");let j=d.depth?a.docView.domAfterPos(d.before()):a.dom,{focusNode:k,focusOffset:l}=a.domSelectionRange(),m=k&&!j.contains(1==k.nodeType?k:k.parentNode)||b==k&&e==l;try{g.collapse(f,h),b&&(b!=f||e!=h)&&g.extend&&g.extend(b,e)}catch(a){}return null!=i&&(g.caretBidiLevel=i),m}):"left"==c||"backward"==c?!e:f:d.pos==d.start()||d.pos==d.end()}(a,b,c))}(this,b||this.state,a)}pasteHTML(a,b){return bi(this,"",a,!1,b||new ClipboardEvent("paste"))}pasteText(a,b){return bi(this,a,null,!0,b||new ClipboardEvent("paste"))}serializeForClipboard(a){return aS(this,a)}destroy(){if(this.docView){for(let a in this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(a,this.input.eventHandlers[a]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],bE(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,k()}}get isDestroyed(){return null==this.docView}dispatchEvent(a){!a6(this,a)&&a0[a.type]&&(this.editable||!(a.type in a1))&&a0[a.type](this,a)}domSelectionRange(){let a=this.domSelection();return a?E&&11===this.root.nodeType&&function(a){let b=a.activeElement;for(;b&&b.shadowRoot;)b=b.shadowRoot.activeElement;return b}(this.dom.ownerDocument)==this.dom&&function(a,b){let c;if(b.getComposedRanges){let c=b.getComposedRanges(a.root)[0];if(c)return bL(a,c)}function d(a){a.preventDefault(),a.stopImmediatePropagation(),c=a.getTargetRanges()[0]}return a.dom.addEventListener("beforeinput",d,!0),document.execCommand("indent"),a.dom.removeEventListener("beforeinput",d,!0),c?bL(a,c):null}(this,a)||a:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function bS(a){let b=Object.create(null);return b.class="ProseMirror",b.contenteditable=String(a.editable),a.someProp("attributes",c=>{if("function"==typeof c&&(c=c(a.state)),c)for(let a in c)"class"==a?b.class+=" "+c[a]:"style"==a?b.style=(b.style?b.style+";":"")+c[a]:b[a]||"contenteditable"==a||"nodeName"==a||(b[a]=String(c[a]))}),b.translate||(b.translate="no"),[br.node(0,a.state.doc.content.size,b)]}function bT(a){if(a.markCursor){let b=document.createElement("img");b.className="ProseMirror-separator",b.setAttribute("mark-placeholder","true"),b.setAttribute("alt",""),a.cursorWrapper={dom:b,deco:br.widget(a.state.selection.from,b,{raw:!0,marks:a.markCursor})}}else a.cursorWrapper=null}function bU(a){return!a.someProp("editable",b=>!1===b(a.state))}function bV(a){let b=Object.create(null);function c(a){for(let c in a)Object.prototype.hasOwnProperty.call(b,c)||(b[c]=a[c])}return a.someProp("nodeViews",c),a.someProp("markViews",c),b}function bW(a){if(a.spec.state||a.spec.filterTransaction||a.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}bR.prototype.dispatch=function(a){let b=this._props.dispatchTransaction;b?b.call(this,a):this.updateState(this.state.apply(a))}},670016:(a,b,c)=>{"use strict";Object.defineProperty(b,Symbol.toStringTag,{value:"Module"});let d=c(789253);b.property=function(a){return function(b){return d.get(b,a)}}},673977:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});var d=c(356103).Or},676029:(a,b,c)=>{"use strict";c.d(b,{q:()=>Y});var d=c(115962);function e(a){return Array.isArray?Array.isArray(a):"[object Array]"===l(a)}let f=1/0;function g(a){return"string"==typeof a}function h(a){return"number"==typeof a}function i(a){return"object"==typeof a}function j(a){return null!=a}function k(a){return!a.trim().length}function l(a){return null==a?void 0===a?"[object Undefined]":"[object Null]":Object.prototype.toString.call(a)}let m=Object.prototype.hasOwnProperty;class n{constructor(a){this._keys=[],this._keyMap={};let b=0;a.forEach(a=>{let c=o(a);this._keys.push(c),this._keyMap[c.id]=c,b+=c.weight}),this._keys.forEach(a=>{a.weight/=b})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function o(a){let b=null,c=null,d=null,f=1,h=null;if(g(a)||e(a))d=a,b=p(a),c=q(a);else{if(!m.call(a,"name"))throw Error("Missing name property in key");let e=a.name;if(d=e,m.call(a,"weight")&&(f=a.weight)<=0)throw Error(`Property 'weight' in key '${e}' must be a positive integer`);b=p(e),c=q(e),h=a.getFn}return{path:b,id:c,weight:f,src:d,getFn:h}}function p(a){return e(a)?a:a.split(".")}function q(a){return e(a)?a.join("."):a}var r={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(a,b)=>a.score===b.score?a.idx<b.idx?-1:1:a.score<b.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(a,b){let c=[],d=!1,k=(a,b,m)=>{if(j(a))if(b[m]){var n,o;let p=a[b[m]];if(!j(p))return;if(m===b.length-1&&(g(p)||h(p)||!0===(n=p)||!1===n||i(o=n)&&null!==o&&"[object Boolean]"==l(n)))c.push(null==p?"":function(a){if("string"==typeof a)return a;let b=a+"";return"0"==b&&1/a==-f?"-0":b}(p));else if(e(p)){d=!0;for(let a=0,c=p.length;a<c;a+=1)k(p[a],b,m+1)}else b.length&&k(p,b,m+1)}else c.push(a)};return k(a,g(b)?b.split("."):b,0),d?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};let s=/[^ ]+/g;class t{constructor({getFn:a=r.getFn,fieldNormWeight:b=r.fieldNormWeight}={}){this.norm=function(a=1,b=3){let c=new Map,d=Math.pow(10,b);return{get(b){let e=b.match(s).length;if(c.has(e))return c.get(e);let f=parseFloat(Math.round(1/Math.pow(e,.5*a)*d)/d);return c.set(e,f),f},clear(){c.clear()}}}(b,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((a,b)=>{this._keysMap[a.id]=b})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,g(this.docs[0])?this.docs.forEach((a,b)=>{this._addString(a,b)}):this.docs.forEach((a,b)=>{this._addObject(a,b)}),this.norm.clear())}add(a){let b=this.size();g(a)?this._addString(a,b):this._addObject(a,b)}removeAt(a){this.records.splice(a,1);for(let b=a,c=this.size();b<c;b+=1)this.records[b].i-=1}getValueForItemAtKeyId(a,b){return a[this._keysMap[b]]}size(){return this.records.length}_addString(a,b){if(!j(a)||k(a))return;let c={v:a,i:b,n:this.norm.get(a)};this.records.push(c)}_addObject(a,b){let c={i:b,$:{}};this.keys.forEach((b,d)=>{let f=b.getFn?b.getFn(a):this.getFn(a,b.path);if(j(f)){if(e(f)){let a=[],b=[{nestedArrIndex:-1,value:f}];for(;b.length;){let{nestedArrIndex:c,value:d}=b.pop();if(j(d))if(g(d)&&!k(d)){let b={v:d,i:c,n:this.norm.get(d)};a.push(b)}else e(d)&&d.forEach((a,c)=>{b.push({nestedArrIndex:c,value:a})})}c.$[d]=a}else if(g(f)&&!k(f)){let a={v:f,n:this.norm.get(f)};c.$[d]=a}}}),this.records.push(c)}toJSON(){return{keys:this.keys,records:this.records}}}function u(a,b,{getFn:c=r.getFn,fieldNormWeight:d=r.fieldNormWeight}={}){let e=new t({getFn:c,fieldNormWeight:d});return e.setKeys(a.map(o)),e.setSources(b),e.create(),e}function v(a,{errors:b=0,currentLocation:c=0,expectedLocation:d=0,distance:e=r.distance,ignoreLocation:f=r.ignoreLocation}={}){let g=b/a.length;if(f)return g;let h=Math.abs(d-c);return e?g+h/e:h?1:g}let w=String.prototype.normalize?a=>a.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):a=>a;class x{constructor(a,{location:b=r.location,threshold:c=r.threshold,distance:d=r.distance,includeMatches:e=r.includeMatches,findAllMatches:f=r.findAllMatches,minMatchCharLength:g=r.minMatchCharLength,isCaseSensitive:h=r.isCaseSensitive,ignoreDiacritics:i=r.ignoreDiacritics,ignoreLocation:j=r.ignoreLocation}={}){if(this.options={location:b,threshold:c,distance:d,includeMatches:e,findAllMatches:f,minMatchCharLength:g,isCaseSensitive:h,ignoreDiacritics:i,ignoreLocation:j},a=h?a:a.toLowerCase(),a=i?w(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;let k=(a,b)=>{this.chunks.push({pattern:a,alphabet:function(a){let b={};for(let c=0,d=a.length;c<d;c+=1){let e=a.charAt(c);b[e]=(b[e]||0)|1<<d-c-1}return b}(a),startIndex:b})},l=this.pattern.length;if(l>32){let a=0,b=l%32,c=l-b;for(;a<c;)k(this.pattern.substr(a,32),a),a+=32;if(b){let a=l-32;k(this.pattern.substr(a),a)}}else k(this.pattern,0)}searchIn(a){let{isCaseSensitive:b,ignoreDiacritics:c,includeMatches:d}=this.options;if(a=b?a:a.toLowerCase(),a=c?w(a):a,this.pattern===a){let b={isMatch:!0,score:0};return d&&(b.indices=[[0,a.length-1]]),b}let{location:e,distance:f,threshold:g,findAllMatches:h,minMatchCharLength:i,ignoreLocation:j}=this.options,k=[],l=0,m=!1;this.chunks.forEach(({pattern:b,alphabet:c,startIndex:n})=>{let{isMatch:o,score:p,indices:q}=function(a,b,c,{location:d=r.location,distance:e=r.distance,threshold:f=r.threshold,findAllMatches:g=r.findAllMatches,minMatchCharLength:h=r.minMatchCharLength,includeMatches:i=r.includeMatches,ignoreLocation:j=r.ignoreLocation}={}){let k;if(b.length>32)throw Error("Pattern length exceeds max of 32.");let l=b.length,m=a.length,n=Math.max(0,Math.min(d,m)),o=f,p=n,q=h>1||i,s=q?Array(m):[];for(;(k=a.indexOf(b,p))>-1;)if(o=Math.min(v(b,{currentLocation:k,expectedLocation:n,distance:e,ignoreLocation:j}),o),p=k+l,q){let a=0;for(;a<l;)s[k+a]=1,a+=1}p=-1;let t=[],u=1,w=l+m,x=1<<l-1;for(let d=0;d<l;d+=1){let f=0,h=w;for(;f<h;)v(b,{errors:d,currentLocation:n+h,expectedLocation:n,distance:e,ignoreLocation:j})<=o?f=h:w=h,h=Math.floor((w-f)/2+f);w=h;let i=Math.max(1,n-h+1),k=g?m:Math.min(n+h,m)+l,r=Array(k+2);r[k+1]=(1<<d)-1;for(let f=k;f>=i;f-=1){let g=f-1,h=c[a.charAt(g)];if(q&&(s[g]=+!!h),r[f]=(r[f+1]<<1|1)&h,d&&(r[f]|=(t[f+1]|t[f])<<1|1|t[f+1]),r[f]&x&&(u=v(b,{errors:d,currentLocation:g,expectedLocation:n,distance:e,ignoreLocation:j}))<=o){if(o=u,(p=g)<=n)break;i=Math.max(1,2*n-p)}}if(v(b,{errors:d+1,currentLocation:n,expectedLocation:n,distance:e,ignoreLocation:j})>o)break;t=r}let y={isMatch:p>=0,score:Math.max(.001,u)};if(q){let a=function(a=[],b=r.minMatchCharLength){let c=[],d=-1,e=-1,f=0;for(let g=a.length;f<g;f+=1){let g=a[f];g&&-1===d?d=f:g||-1===d||((e=f-1)-d+1>=b&&c.push([d,e]),d=-1)}return a[f-1]&&f-d>=b&&c.push([d,f-1]),c}(s,h);a.length?i&&(y.indices=a):y.isMatch=!1}return y}(a,b,c,{location:e+n,distance:f,threshold:g,findAllMatches:h,minMatchCharLength:i,includeMatches:d,ignoreLocation:j});o&&(m=!0),l+=p,o&&q&&(k=[...k,...q])});let n={isMatch:m,score:m?l/this.chunks.length:1};return m&&d&&(n.indices=k),n}}class y{constructor(a){this.pattern=a}static isMultiMatch(a){return z(a,this.multiRegex)}static isSingleMatch(a){return z(a,this.singleRegex)}search(){}}function z(a,b){let c=a.match(b);return c?c[1]:null}class A extends y{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){let b=a===this.pattern;return{isMatch:b,score:+!b,indices:[0,this.pattern.length-1]}}}class B extends y{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){let b=-1===a.indexOf(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class C extends y{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){let b=a.startsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,this.pattern.length-1]}}}class D extends y{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){let b=!a.startsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class E extends y{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){let b=a.endsWith(this.pattern);return{isMatch:b,score:+!b,indices:[a.length-this.pattern.length,a.length-1]}}}class F extends y{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){let b=!a.endsWith(this.pattern);return{isMatch:b,score:+!b,indices:[0,a.length-1]}}}class G extends y{constructor(a,{location:b=r.location,threshold:c=r.threshold,distance:d=r.distance,includeMatches:e=r.includeMatches,findAllMatches:f=r.findAllMatches,minMatchCharLength:g=r.minMatchCharLength,isCaseSensitive:h=r.isCaseSensitive,ignoreDiacritics:i=r.ignoreDiacritics,ignoreLocation:j=r.ignoreLocation}={}){super(a),this._bitapSearch=new x(a,{location:b,threshold:c,distance:d,includeMatches:e,findAllMatches:f,minMatchCharLength:g,isCaseSensitive:h,ignoreDiacritics:i,ignoreLocation:j})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class H extends y{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let b,c=0,d=[],e=this.pattern.length;for(;(b=a.indexOf(this.pattern,c))>-1;)c=b+e,d.push([b,c-1]);let f=!!d.length;return{isMatch:f,score:+!f,indices:d}}}let I=[A,H,C,D,F,E,B,G],J=I.length,K=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,L=new Set([G.type,H.type]);class M{constructor(a,{isCaseSensitive:b=r.isCaseSensitive,ignoreDiacritics:c=r.ignoreDiacritics,includeMatches:d=r.includeMatches,minMatchCharLength:e=r.minMatchCharLength,ignoreLocation:f=r.ignoreLocation,findAllMatches:g=r.findAllMatches,location:h=r.location,threshold:i=r.threshold,distance:j=r.distance}={}){this.query=null,this.options={isCaseSensitive:b,ignoreDiacritics:c,includeMatches:d,minMatchCharLength:e,findAllMatches:g,ignoreLocation:f,location:h,threshold:i,distance:j},a=b?a:a.toLowerCase(),a=c?w(a):a,this.pattern=a,this.query=function(a,b={}){return a.split("|").map(a=>{let c=a.trim().split(K).filter(a=>a&&!!a.trim()),d=[];for(let a=0,e=c.length;a<e;a+=1){let e=c[a],f=!1,g=-1;for(;!f&&++g<J;){let a=I[g],c=a.isMultiMatch(e);c&&(d.push(new a(c,b)),f=!0)}if(!f)for(g=-1;++g<J;){let a=I[g],c=a.isSingleMatch(e);if(c){d.push(new a(c,b));break}}}return d})}(this.pattern,this.options)}static condition(a,b){return b.useExtendedSearch}searchIn(a){let b=this.query;if(!b)return{isMatch:!1,score:1};let{includeMatches:c,isCaseSensitive:d,ignoreDiacritics:e}=this.options;a=d?a:a.toLowerCase(),a=e?w(a):a;let f=0,g=[],h=0;for(let d=0,e=b.length;d<e;d+=1){let e=b[d];g.length=0,f=0;for(let b=0,d=e.length;b<d;b+=1){let d=e[b],{isMatch:i,indices:j,score:k}=d.search(a);if(i){if(f+=1,h+=k,c){let a=d.constructor.type;L.has(a)?g=[...g,...j]:g.push(j)}}else{h=0,f=0,g.length=0;break}}if(f){let a={isMatch:!0,score:h/f};return c&&(a.indices=g),a}}return{isMatch:!1,score:1}}}let N=[];function O(a,b){for(let c=0,d=N.length;c<d;c+=1){let d=N[c];if(d.condition(a,b))return new d(a,b)}return new x(a,b)}let P={AND:"$and",OR:"$or"},Q={PATH:"$path",PATTERN:"$val"},R=a=>!!(a[P.AND]||a[P.OR]),S=a=>({[P.AND]:Object.keys(a).map(b=>({[b]:a[b]}))});function T(a,b,{auto:c=!0}={}){let d=a=>{let f=Object.keys(a),h=!!a[Q.PATH];if(!h&&f.length>1&&!R(a))return d(S(a));if(!e(a)&&i(a)&&!R(a)){let d=h?a[Q.PATH]:f[0],e=h?a[Q.PATTERN]:a[d];if(!g(e))throw Error(`Invalid value for key ${d}`);let i={keyId:q(d),pattern:e};return c&&(i.searcher=O(e,b)),i}let j={children:[],operator:f[0]};return f.forEach(b=>{let c=a[b];e(c)&&c.forEach(a=>{j.children.push(d(a))})}),j};return R(a)||(a=S(a)),d(a)}function U(a,b){let c=a.matches;b.matches=[],j(c)&&c.forEach(a=>{if(!j(a.indices)||!a.indices.length)return;let{indices:c,value:d}=a,e={indices:c,value:d};a.key&&(e.key=a.key.src),a.idx>-1&&(e.refIndex=a.idx),b.matches.push(e)})}function V(a,b){b.score=a.score}class W{constructor(a,b={},c){this.options={...r,...b},this.options.useExtendedSearch,this._keyStore=new n(this.options.keys),this.setCollection(a,c)}setCollection(a,b){if(this._docs=a,b&&!(b instanceof t))throw Error("Incorrect 'index' type");this._myIndex=b||u(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){j(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){let b=[];for(let c=0,d=this._docs.length;c<d;c+=1){let e=this._docs[c];a(e,c)&&(this.removeAt(c),c-=1,d-=1,b.push(e))}return b}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:b=-1}={}){let{includeMatches:c,includeScore:d,shouldSort:e,sortFn:f,ignoreFieldNorm:i}=this.options,j=g(a)?g(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return!function(a,{ignoreFieldNorm:b=r.ignoreFieldNorm}){a.forEach(a=>{let c=1;a.matches.forEach(({key:a,norm:d,score:e})=>{let f=a?a.weight:null;c*=Math.pow(0===e&&f?Number.EPSILON:e,(f||1)*(b?1:d))}),a.score=c})}(j,{ignoreFieldNorm:i}),e&&j.sort(f),h(b)&&b>-1&&(j=j.slice(0,b)),function(a,b,{includeMatches:c=r.includeMatches,includeScore:d=r.includeScore}={}){let e=[];return c&&e.push(U),d&&e.push(V),a.map(a=>{let{idx:c}=a,d={item:b[c],refIndex:c};return e.length&&e.forEach(b=>{b(a,d)}),d})}(j,this._docs,{includeMatches:c,includeScore:d})}_searchStringList(a){let b=O(a,this.options),{records:c}=this._myIndex,d=[];return c.forEach(({v:a,i:c,n:e})=>{if(!j(a))return;let{isMatch:f,score:g,indices:h}=b.searchIn(a);f&&d.push({item:a,idx:c,matches:[{score:g,value:a,norm:e,indices:h}]})}),d}_searchLogical(a){let b=T(a,this.options),c=(a,b,d)=>{if(!a.children){let{keyId:c,searcher:e}=a,f=this._findMatches({key:this._keyStore.get(c),value:this._myIndex.getValueForItemAtKeyId(b,c),searcher:e});return f&&f.length?[{idx:d,item:b,matches:f}]:[]}let e=[];for(let f=0,g=a.children.length;f<g;f+=1){let g=c(a.children[f],b,d);if(g.length)e.push(...g);else if(a.operator===P.AND)return[]}return e},d=this._myIndex.records,e={},f=[];return d.forEach(({$:a,i:d})=>{if(j(a)){let g=c(b,a,d);g.length&&(e[d]||(e[d]={idx:d,item:a,matches:[]},f.push(e[d])),g.forEach(({matches:a})=>{e[d].matches.push(...a)}))}}),f}_searchObjectList(a){let b=O(a,this.options),{keys:c,records:d}=this._myIndex,e=[];return d.forEach(({$:a,i:d})=>{if(!j(a))return;let f=[];c.forEach((c,d)=>{f.push(...this._findMatches({key:c,value:a[d],searcher:b}))}),f.length&&e.push({idx:d,item:a,matches:f})}),e}_findMatches({key:a,value:b,searcher:c}){if(!j(b))return[];let d=[];if(e(b))b.forEach(({v:b,i:e,n:f})=>{if(!j(b))return;let{isMatch:g,score:h,indices:i}=c.searchIn(b);g&&d.push({score:h,key:a,value:b,idx:e,norm:f,indices:i})});else{let{v:e,n:f}=b,{isMatch:g,score:h,indices:i}=c.searchIn(e);g&&d.push({score:h,key:a,value:e,norm:f,indices:i})}return d}}W.version="7.1.0",W.createIndex=u,W.parseIndex=function(a,{getFn:b=r.getFn,fieldNormWeight:c=r.fieldNormWeight}={}){let{keys:d,records:e}=a,f=new t({getFn:b,fieldNormWeight:c});return f.setKeys(d),f.setIndexRecords(e),f},W.config=r,W.parseQuery=T,function(...a){N.push(...a)}(M);let X={keys:[{name:"label",weight:3},{name:"sublabel",weight:1},{name:"objectName",weight:1.5},{name:"fieldValues",weight:2}],threshold:.4,distance:200,includeScore:!0,shouldSort:!0,minMatchCharLength:1};function Y(a){let[b,c]=(0,d.useState)([]),[e,f]=(0,d.useState)(!0),g=(0,d.useRef)(!0);(0,d.useCallback)(async()=>{try{let a=await fetch("/api/workspace/search-index"),b=await a.json();g.current&&(c(b.items??[]),f(!1))}catch{g.current&&f(!1)}},[]);let h=(0,d.useMemo)(()=>0===b.length?null:new W(b.map(a=>({...a,fieldValues:a.fields?Object.values(a.fields).join(" "):void 0})),X),[b]),i=(0,d.useCallback)((a,c=20)=>a.trim()?h?h.search(a,{limit:c}).map(a=>a.item):[]:[...b].toSorted((a,b)=>{let c={object:0,file:1,entry:2};return(c[a.kind]??9)-(c[b.kind]??9)}).slice(0,c),[h,b]),j=(0,d.useRef)(i);return j.current=i,{items:b,loading:e,search:(0,d.useCallback)((a,b)=>j.current(a,b),[])}}},681560:(a,b,c)=>{"use strict";c.d(b,{I:()=>n});var d=c(736927),e=c(115962),f=c(681713),g=c(612563),h=c(379924),i=c(18886),j=c(130526);function k(a){return null==a?"":"string"==typeof a?a:"number"==typeof a||"boolean"==typeof a||"bigint"==typeof a?String(a):"object"==typeof a?JSON.stringify(a):""}function l({entry:a,fields:b,titleField:c,coverField:l,onEntryClick:m}){let n=k(a.entry_id??a.id),o=function(a,b,c){if(c){let b=k(a[c]);if(b)return b}let d=b.find(a=>"text"===a.type&&/name|title/i.test(a.name))??b.find(a=>"text"===a.type);return d?k(a[d.name]):k(a.id)}(a,b,c),p=(0,j.I)(a,b),q=(0,e.useMemo)(()=>b.filter(a=>a.name!==c&&a.name!==l).slice(0,4),[b,c,l]),r=b.find(a=>"enum"===a.type&&a.enum_values?.length),s=r?k(a[r.name]):null,t=r&&s?function(a,b){if(!a||!b.enum_values)return null;let c=b.enum_values.indexOf(a);return{text:a,color:c>=0&&b.enum_colors?.[c]?b.enum_colors[c]:"#94a3b8"}}(s,r):null;return(0,d.jsxs)("button",{type:"button",onClick:()=>m?.(n),className:"text-left rounded-xl border p-4 hover:shadow-md transition-all cursor-pointer w-full group",style:{borderColor:"var(--color-border)",background:"var(--color-surface)"},children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[p?.faviconUrl&&(0,d.jsx)(i.A,{src:p.faviconUrl,className:"w-4 h-4 rounded-[4px] shrink-0 mt-0.5"}),(0,d.jsx)("h4",{className:"text-[13px] font-semibold leading-tight line-clamp-2 group-hover:underline",style:{color:"var(--color-text)"},children:o||"Untitled"})]}),t&&(0,d.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full flex-shrink-0 whitespace-nowrap",style:{backgroundColor:t.color,color:"#fff"},children:t.text})]}),(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:q.map(b=>{let c=a[b.name];if(null==c||""===k(c))return null;let e="tags"===b.type?(0,h.k)(c):[];return(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("span",{className:"text-[10px] flex-shrink-0 min-w-[60px]",style:{color:"var(--color-text-muted)"},children:b.name}),(0,d.jsx)("div",{className:"text-[12px] whitespace-pre-line line-clamp-2",style:{color:"var(--color-text)"},children:"tags"===b.type?(0,d.jsxs)("span",{className:"flex items-center gap-0.5 flex-wrap",children:[e.slice(0,3).map(a=>{let b=(0,g.KJ)(a),c="link"===b.kind&&b.href,e="url"===b.linkType&&!!b.faviconUrl;return c?(0,d.jsxs)("a",{href:b.href,target:"url"===b.linkType||"file"===b.linkType?"_blank":void 0,rel:"url"===b.linkType||"file"===b.linkType?"noopener noreferrer":void 0,onClick:a=>a.stopPropagation(),className:"inline-flex items-center gap-1 px-1.5 py-0 rounded text-[11px] font-medium hover:underline underline-offset-2 max-w-[220px]",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-accent)"},children:[e&&(0,d.jsx)(i.A,{src:b.faviconUrl,className:"w-3 h-3 rounded-[2px] shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:b.text})]},a):(0,d.jsx)("span",{className:"inline-flex items-center px-1.5 py-0 rounded text-[11px] font-medium",style:{background:"rgba(148, 163, 184, 0.12)",color:"var(--color-text-muted)"},children:a},a)}),e.length>3&&(0,d.jsxs)("span",{className:"text-[10px]",style:{color:"var(--color-text-muted)"},children:["+",e.length-3]})]}):(0,d.jsx)(f.E,{value:c,fieldType:b.type,mode:"table",showUrlFavicon:!0})})]},b.id)})}),null!=a.created_at&&(0,d.jsx)("div",{className:"mt-3 text-[10px]",style:{color:"var(--color-text-muted)",opacity:.6},children:k(a.created_at).slice(0,10)})]})}function m(){return(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 gap-2",children:[(0,d.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",style:{color:"var(--color-text-muted)",opacity:.4},children:[(0,d.jsx)("rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}),(0,d.jsx)("rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"})]}),(0,d.jsx)("span",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"No entries to display in gallery view."})]})}function n({objectName:a,fields:b,entries:c,titleField:e,coverField:f,members:g,relationLabels:h,onEntryClick:i}){return 0===c.length?(0,d.jsx)(m,{}):(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:c.map(a=>(0,d.jsx)(l,{entry:a,fields:b,titleField:e,coverField:f,onEntryClick:i},k(a.entry_id??a.id)))})}},681713:(a,b,c)=>{"use strict";c.d(b,{E:()=>m});var d=c(736927),e=c(115962),f=c(612563),g=c(18886),h=c(545182),i=c(888973);function j(){return(0,d.jsx)("span",{style:{color:"var(--color-text-muted)",opacity:.5},children:"--"})}function k({mediaType:a,url:b,label:c}){return"image"===a?(0,d.jsx)("div",{className:"mt-2 rounded-lg overflow-hidden border",style:{borderColor:"var(--color-border)"},children:(0,d.jsx)("img",{src:b,alt:c,className:"max-h-64 w-auto"})}):"video"===a?(0,d.jsx)("video",{src:b,controls:!0,className:"mt-2 w-full max-h-72 rounded-lg border",style:{borderColor:"var(--color-border)",background:"#000"}}):"audio"===a?(0,d.jsx)("audio",{src:b,controls:!0,className:"mt-2 w-full"}):(0,d.jsx)("iframe",{src:`${b}#toolbar=0&navpanes=0&scrollbar=1`,title:c,className:"mt-2 w-full h-72 rounded-lg border",style:{borderColor:"var(--color-border)",background:"white"}})}function l({text:a,fieldType:b,showUrlFavicon:c=!1,linkInteractionMode:e="inline",isTableMode:j=!1}){let k=a.trim();if(!k)return(0,d.jsx)(d.Fragment,{children:a});let l=b&&"text"!==b&&"richtext"!==b?b:void 0,m=(0,f.KJ)(k,l);if("link"===m.kind&&m.href){if(!l&&"file"===m.linkType&&k.includes(" "))return(0,d.jsx)(d.Fragment,{children:m.text});let a="url"===m.linkType||"file"===m.linkType,b=c&&"url"===m.linkType&&!!m.faviconUrl;if("button"===e){let c=(0,d.jsxs)("span",{className:"inline-flex min-w-0 max-w-full items-center gap-1.5 align-middle",style:{color:"var(--color-accent)"},children:[b&&(0,d.jsx)(g.A,{src:m.faviconUrl}),(0,d.jsx)("span",{className:j?"min-w-0 truncate":"min-w-0 break-all",children:m.text}),(0,d.jsx)(h.x,{href:m.href,openInNewTab:a,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm hover:bg-black/5"})]});return"url"===m.linkType?(0,d.jsx)(i.k,{href:m.href,children:c}):c}return(0,d.jsx)(i.U,{href:m.href,text:m.text,linkType:m.linkType??"url",faviconUrl:m.faviconUrl,showFavicon:b})}return"number"===m.kind||"currency"===m.kind?(0,d.jsx)("span",{className:"tabular-nums",children:m.text}):(0,d.jsx)(d.Fragment,{children:m.text})}function m({value:a,fieldType:b,mode:c="table",className:m,showUrlFavicon:n=!1,linkInteractionMode:o="inline"}){let p=(0,f.KJ)(a,b),q="table"===c;if("empty"===p.kind)return(0,d.jsx)(j,{});let r=p.text.replace(/\\r\\n/g,"\n").replace(/\\n/g,"\n").replace(/\\r/g,"\n");if(r.includes("\n")){let a=r.split("\n"),c=m??(q?"block max-w-[300px] line-clamp-3":"break-words");return(0,d.jsx)("span",{className:c,children:a.map((a,c)=>(0,d.jsxs)(e.Fragment,{children:[c>0&&(0,d.jsx)("br",{}),(0,d.jsx)(l,{text:a,fieldType:b,showUrlFavicon:n,linkInteractionMode:o,isTableMode:q})]},c))})}let s=m??(q?"truncate block max-w-[300px]":"break-words");if("link"===p.kind&&p.href){let a="url"===p.linkType||"file"===p.linkType,b=!q&&!!p.embedUrl&&!!p.mediaType,c=n&&"url"===p.linkType&&!!p.faviconUrl;if("button"===o){let e=(0,d.jsxs)("div",{className:q?"block max-w-[300px]":"w-full",children:[(0,d.jsxs)("span",{className:"flex w-full min-w-0 items-center gap-1.5",style:{color:"var(--color-accent)"},children:[c&&(0,d.jsx)(g.A,{src:p.faviconUrl}),(0,d.jsx)("span",{className:q?"min-w-0 truncate":"min-w-0 break-all",children:p.text}),(0,d.jsx)(h.x,{href:p.href,openInNewTab:a})]}),b&&(0,d.jsx)(k,{mediaType:p.mediaType,url:p.embedUrl,label:p.text})]});return"url"===p.linkType?(0,d.jsx)(i.k,{href:p.href,children:e}):e}return(0,d.jsxs)("div",{className:q?"block max-w-[300px]":"w-full",children:[(0,d.jsx)(i.U,{href:p.href,text:p.text,linkType:p.linkType??"url",faviconUrl:p.faviconUrl,showFavicon:c,layout:"block",className:q?"truncate":""}),b&&(0,d.jsx)(k,{mediaType:p.mediaType,url:p.embedUrl,label:p.text})]})}return"number"===p.kind||"currency"===p.kind?(0,d.jsx)("span",{className:`tabular-nums ${s}`,children:p.text}):(0,d.jsx)("span",{className:s,children:r})}},685233:(a,b,c)=>{"use strict";c.d(b,{X:()=>a6,S:()=>a7});var d=c(736927),e=c(115962),f=c(213505),g=c(492081),h=c(755726),i=c(922123),j=c(478105),k=c(363269),l=c(515016),m=c(558287),n=c(631608),o=c(846069),p=c(744277),q=c(68200),r=c(316780),s=c(398367),t=c(405287),u=c(587464),v=c(173961),w=c(760687),x=c(840512);let y=e.createContext(void 0),z=e.createContext(void 0),A=e.createContext(void 0),B=e.createContext("");function C(){let a=e.useContext(y);if(!a)throw Error((0,x.A)(22));return a}function D(){let a=e.useContext(z);if(!a)throw Error((0,x.A)(23));return a}function E(){let a=e.useContext(A);if(!a)throw Error((0,x.A)(24));return a}var F=c(569869);let G=(a,b)=>Object.is(a,b);function H(a,b,c){return null==a||null==b?Object.is(a,b):c(a,b)}function I(a,b,c){return a&&0!==a.length?a.findIndex(a=>void 0!==a&&H(a,b,c)):-1}function J(a){if(null==a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function K(a){return null!=a&&a.length>0&&"object"==typeof a[0]&&null!=a[0]&&"items"in a[0]}function L(a,b){if(b&&null!=a)return b(a)??"";if(a&&"object"==typeof a){if("label"in a&&null!=a.label)return String(a.label);if("value"in a)return String(a.value)}return J(a)}function M(a,b){return b&&null!=a?b(a)??"":a&&"object"==typeof a&&"value"in a&&"label"in a?J(a.value):J(a)}let N={id:(0,F.M)(a=>a.id),query:(0,F.M)(a=>a.query),items:(0,F.M)(a=>a.items),selectedValue:(0,F.M)(a=>a.selectedValue),hasSelectionChips:(0,F.M)(a=>{let b=a.selectedValue;return Array.isArray(b)&&b.length>0}),hasSelectedValue:(0,F.M)(a=>{let{selectedValue:b,selectionMode:c}=a;return null!=b&&(!("multiple"===c&&Array.isArray(b))||b.length>0)}),hasNullItemLabel:(0,F.M)((a,b)=>!!b&&function(a){if(!Array.isArray(a))return null!=a&&!("null"in a);if(K(a)){for(let b of a)for(let a of b.items)if(a&&null==a.value&&null!=a.label)return!0;return!1}for(let b of a)if(b&&null==b.value&&null!=b.label)return!0;return!1}(a.items)),open:(0,F.M)(a=>a.open),mounted:(0,F.M)(a=>a.mounted),forceMounted:(0,F.M)(a=>a.forceMounted),inline:(0,F.M)(a=>a.inline),activeIndex:(0,F.M)(a=>a.activeIndex),selectedIndex:(0,F.M)(a=>a.selectedIndex),isActive:(0,F.M)((a,b)=>a.activeIndex===b),isSelected:(0,F.M)((a,b)=>{let c=a.isItemEqualToValue,d=a.selectedValue;return Array.isArray(d)?d.some(a=>H(b,a,c)):H(b,d,c)}),transitionStatus:(0,F.M)(a=>a.transitionStatus),popupProps:(0,F.M)(a=>a.popupProps),inputProps:(0,F.M)(a=>a.inputProps),triggerProps:(0,F.M)(a=>a.triggerProps),getItemProps:(0,F.M)(a=>a.getItemProps),positionerElement:(0,F.M)(a=>a.positionerElement),listElement:(0,F.M)(a=>a.listElement),triggerElement:(0,F.M)(a=>a.triggerElement),inputElement:(0,F.M)(a=>a.inputElement),popupSide:(0,F.M)(a=>a.popupSide),openMethod:(0,F.M)(a=>a.openMethod),inputInsidePopup:(0,F.M)(a=>a.inputInsidePopup),selectionMode:(0,F.M)(a=>a.selectionMode),listRef:(0,F.M)(a=>a.listRef),labelsRef:(0,F.M)(a=>a.labelsRef),popupRef:(0,F.M)(a=>a.popupRef),emptyRef:(0,F.M)(a=>a.emptyRef),inputRef:(0,F.M)(a=>a.inputRef),keyboardActiveRef:(0,F.M)(a=>a.keyboardActiveRef),chipsContainerRef:(0,F.M)(a=>a.chipsContainerRef),clearRef:(0,F.M)(a=>a.clearRef),valuesRef:(0,F.M)(a=>a.valuesRef),allValuesRef:(0,F.M)(a=>a.allValuesRef),name:(0,F.M)(a=>a.name),disabled:(0,F.M)(a=>a.disabled),readOnly:(0,F.M)(a=>a.readOnly),required:(0,F.M)(a=>a.required),grid:(0,F.M)(a=>a.grid),isGrouped:(0,F.M)(a=>a.isGrouped),virtualized:(0,F.M)(a=>a.virtualized),onOpenChangeComplete:(0,F.M)(a=>a.onOpenChangeComplete),openOnInputClick:(0,F.M)(a=>a.openOnInputClick),itemToStringLabel:(0,F.M)(a=>a.itemToStringLabel),isItemEqualToValue:(0,F.M)(a=>a.isItemEqualToValue),modal:(0,F.M)(a=>a.modal),autoHighlight:(0,F.M)(a=>a.autoHighlight),submitOnItemClick:(0,F.M)(a=>a.submitOnItemClick)};var O=c(230652),P=c(577225);let Q=function(a){return a.disabled="data-disabled",a.valid="data-valid",a.invalid="data-invalid",a.touched="data-touched",a.dirty="data-dirty",a.filled="data-filled",a.focused="data-focused",a}({}),R=e.createContext({invalid:void 0,name:void 0,validityData:{state:{badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},errors:[],error:"",value:"",initialValue:null},setValidityData:P.tE,disabled:void 0,touched:!1,setTouched:P.tE,dirty:!1,setDirty:P.tE,filled:!1,setFilled:P.tE,focused:!1,setFocused:P.tE,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(a=P.t0)=>a,getInputValidationProps:(a=P.t0)=>a,inputRef:{current:null},commit:async()=>{}}});function S(a=!0){let b=e.useContext(R);if(b.setValidityData===P.tE&&!a)throw Error((0,x.A)(28));return b}var T=c(249855);let U=e.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:P.tE,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function V(){return e.useContext(U)}var W=c(725427),X=c(840507);let Y=e.createContext({controlId:void 0,registerControlId:P.tE,labelId:void 0,setLabelId:P.tE,messageIds:[],setMessageIds:P.tE,getDescriptionProps:a=>a});function Z(){return e.useContext(Y)}let _=new Map;var aa=c(735328),ab=c(192083);function ac(a,b){let c=e.useRef(a),d=(0,i.K)(b);(0,g.g)(()=>{c.current!==a&&d(c.current)},[a,d]),(0,g.g)(()=>{c.current=a},[a])}let ad=Symbol("none"),ae={value:ad,index:-1};function af(a){let b,c,x,{id:C,onOpenChangeComplete:D,defaultSelectedValue:E=null,selectedValue:F,onSelectedValueChange:J,defaultInputValue:Q,inputValue:R,selectionMode:U="none",onItemHighlighted:Y,name:af,disabled:ag=!1,readOnly:ah=!1,required:ai=!1,inputRef:aj,grid:ak=!1,items:al,filteredItems:am,filter:an,openOnInputClick:ao=!0,autoHighlight:ap=!1,keepHighlight:aq=!1,highlightItemOnHover:ar=!0,loopFocus:as=!0,itemToStringLabel:at,itemToStringValue:au,isItemEqualToValue:av=G,virtualized:aw=!1,inline:ax=!1,fillInputOnItemPress:ay=!0,modal:az=!1,limit:aA=-1,autoComplete:aB="list",formAutoComplete:aC,locale:aD,submitOnItemClick:aE=!1}=a,{clearErrors:aF}=V(),{setDirty:aG,validityData:aH,shouldValidateOnChange:aI,setFilled:aJ,name:aK,disabled:aL,setTouched:aM,setFocused:aN,validationMode:aO,validation:aP}=S(),aQ=function(a={}){let{id:b,implicit:c=!1,controlRef:d}=a,{controlId:f,registerControlId:h}=Z(),j=(0,X.e)(b),k=c?f:void 0,m=(0,l.j)(()=>Symbol("labelable-control")),n=e.useRef(!1),o=e.useRef(null!=b),p=(0,i.K)(()=>{n.current&&h!==P.tE&&(n.current=!1,h(m.current,void 0))});return(0,g.g)(()=>{let a;if(h!==P.tE){if(c){let c=d?.current;a=(0,W.vq)(c)&&null!=c.closest("label")?b??null:k??j}else if(null!=b)o.current=!0,a=b;else{if(!o.current)return void p();a=j}if(void 0===a)return void p();n.current=!0,h(m.current,a)}},[b,d,k,h,c,j,m,p]),e.useEffect(()=>p,[p]),f??j}({id:C}),aR=function(a={}){let b={usage:"search",sensitivity:"base",ignorePunctuation:!0,...a},c=`${function a(b){return Array.isArray(b)?b.map(b=>a(b)).join(","):null==b?"":String(b)}(a.locale)}|${JSON.stringify(b)}`,d=_.get(c);if(d)return d;let e=new Intl.Collator(a.locale,b),f={contains(a,b,c){if(!b)return!0;let d=L(a,c);for(let a=0;a<=d.length-b.length;a+=1)if(0===e.compare(d.slice(a,a+b.length),b))return!0;return!1},startsWith(a,b,c){if(!b)return!0;let d=L(a,c);return 0===e.compare(d.slice(0,b.length),b)},endsWith(a,b,c){if(!b)return!0;let d=L(a,c),f=b.length;return d.length>=f&&0===e.compare(d.slice(d.length-f),b)}};return _.set(c,f),f}({locale:aD}),[aS,aT]=e.useState(!1),[aU,aV]=e.useState(null),aW=e.useRef([]),aX=e.useRef([]),aY=e.useRef(null),aZ=e.useRef(null),a$=e.useRef(null),a_=e.useRef(!0),a0=e.useRef(!1),a1=e.useRef(null),a2=e.useRef(null),a3=e.useRef(null),a4=e.useRef(ae),a5=e.useRef(null),a6=e.useRef([]),a7=e.useRef([]),a8=aL||ag,a9=aK??af,ba="multiple"===U,bb="single"===U,bc=void 0!==R||void 0!==Q,bd=void 0!==al,be=void 0!==am;b="always"===ap?"always":!!ap&&"input-change";let[bf,bg]=(0,f.q)({controlled:F,default:ba?E??P.Ml:E,name:"Combobox",state:"selectedValue"}),bh=e.useMemo(()=>null===an?()=>!0:void 0!==an?an:bb&&!aS?(a,b)=>{if(null==a)return!1;if(!b)return!0;let c=L(a,at),d=null!=bf?L(bf,at):"";return!!(d&&aR.contains(d,b))&&d.length===b.length||aR.contains(c,b)}:(a,b)=>{if(null==a)return!1;let c=L(a,at);return aR.contains(c,b)},[an,bb,bf,aS,aR,at]),bi=(0,l.j)(()=>bc?Q??"":bb?L(bf,at):"").current,[bj,bk]=(0,f.q)({controlled:R,default:bi,name:"Combobox",state:"inputValue"}),[bl,bm]=(0,f.q)({controlled:a.open,default:a.defaultOpen,name:"Combobox",state:"open"}),bn=K(al),bo=aU??(""===bj?"":String(bj).trim()),bp=bb?L(bf,at):"",bq=bb&&!aS&&""!==bo&&""!==bp&&bp.length===bo.length&&aR.contains(bp,bo),br=bq?"":bo,bs=bd&&be&&bq,bt=e.useMemo(()=>al?bn?al.flatMap(a=>a.items):al:P.Ml,[al,bn]),bu=e.useMemo(()=>{if(am&&!bs)return am;if(!al)return P.Ml;if(bn){let a=[],b=0;for(let c of al){if(aA>-1&&b>=aA)break;let d=""===br?c.items:c.items.filter(a=>bh(a,br,at));if(0===d.length)continue;let e=aA>-1?aA-b:1/0,f=d.slice(0,e);if(f.length>0){let d={...c,items:f};a.push(d),b+=f.length}}return a}if(""===br)return aA>-1?bt.slice(0,aA):bt;let a=[];for(let b of bt){if(aA>-1&&a.length>=aA)break;bh(b,br,at)&&a.push(b)}return a},[am,bs,al,bn,br,aA,bh,at,bt]),bv=e.useMemo(()=>bn?bu.flatMap(a=>a.items):bu,[bu,bn]),bw=(0,l.j)(()=>new m.i({id:aQ,selectedValue:bf,open:bl,filter:bh,query:bo,items:al,selectionMode:U,listRef:aW,labelsRef:aX,popupRef:aY,emptyRef:a$,inputRef:aZ,keyboardActiveRef:a_,chipsContainerRef:a1,clearRef:a2,valuesRef:a6,allValuesRef:a7,selectionEventRef:a3,name:a9,disabled:a8,readOnly:ah,required:ai,grid:ak,isGrouped:bn,virtualized:aw,openOnInputClick:ao,itemToStringLabel:at,isItemEqualToValue:av,modal:az,autoHighlight:b,submitOnItemClick:aE,hasInputValue:bc,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:ax,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:D||P.tE,setOpen:P.tE,setInputValue:P.tE,setSelectedValue:P.tE,setIndices:P.tE,onItemHighlighted:P.tE,handleSelection:P.tE,getItemProps:()=>P.t0,forceMount:P.tE,requestSubmit:P.tE})).current,bx="none"===U?bj:bf,by=e.useMemo(()=>"none"===U?bx:Array.isArray(bf)?bf.map(a=>M(a,au)):M(bf,au),[bx,au,U,bf]),bz=(0,i.K)(Y),bA=(0,i.K)(D),bB=(0,n.P)(bw,N.activeIndex),bC=(0,n.P)(bw,N.selectedIndex),bD=(0,n.P)(bw,N.positionerElement),bE=(0,n.P)(bw,N.listElement),bF=(0,n.P)(bw,N.triggerElement),bG=(0,n.P)(bw,N.inputElement),bH=(0,n.P)(bw,N.inline),bI=(0,n.P)(bw,N.inputInsidePopup),bJ=(0,o.u)(bF),{mounted:bK,setMounted:bL,transitionStatus:bM}=(0,aa.$)(bl),{openMethod:bN,triggerProps:bO,reset:bP}=(0,ab.G)(bl);!function(a){let{enabled:b=!0,value:c,id:d,name:e,controlRef:f,commit:h}=a,{formRef:j}=V(),{invalid:k,markedDirtyRef:l,validityData:m,setValidityData:n}=S(),o=(0,i.K)(a.getValue);(0,g.g)(()=>{if(!b)return;let a=c;void 0===a&&(a=o()),null===m.initialValue&&null!==a&&n(b=>({...b,initialValue:a}))},[b,n,c,m.initialValue,o]),(0,g.g)(()=>{b&&d&&j.current.fields.set(d,{getValue:o,name:e,controlRef:f,validityData:{...m,state:{...m.state,valid:!k&&m.state.valid}},validate(a=!0){let b=c;void 0===b&&(b=o()),l.current=!0,a?T.flushSync(()=>h(b)):h(b)}})},[h,f,b,j,o,d,k,l,e,m,c]),(0,g.g)(()=>{let a=j.current.fields;return()=>{d&&a.delete(d)}},[j,d])}({id:aQ,name:a9,commit:aP.commit,value:bx,controlRef:bI?bJ:aZ,getValue:()=>by});let bQ=(0,i.K)(()=>{al?aX.current=bv.map(a=>L(a,at)):bw.set("forceMounted",!0)}),bR=e.useRef(bf);(0,g.g)(()=>{bf!==bR.current&&bQ()},[bQ,bf]);let bS=(0,i.K)(a=>{bw.update(a);let b=a.type||"none";if(void 0!==a.activeIndex)if(null===a.activeIndex)a4.current!==ae&&(a4.current=ae,bz(void 0,(0,v.M)(b,void 0,{index:-1})));else{let c=a6.current[a.activeIndex];a4.current={value:c,index:a.activeIndex},bz(c,(0,v.M)(b,void 0,{index:a.activeIndex}))}}),bT=(0,i.K)((c,d)=>{if(a0.current=d.reason===w.qs,a.onInputValueChange?.(c,d),!d.isCanceled){if(d.reason===w.pf){let a=d.event,e=a.inputType;if("compositionend"===a.type||null!=e&&""!==e&&"insertReplacementText"!==e){let a=""!==c.trim();a&&aT(!0),a5.current={hasQuery:a},a&&b&&null==bw.state.activeIndex&&bw.set("activeIndex",0)}}bk(c)}}),bU=(0,i.K)((b,c)=>{if(bl!==b&&("escape-key"===c.reason&&bd&&0===bv.length&&!bw.state.emptyRef.current&&c.allowPropagation(),a.onOpenChange?.(b,c),!c.isCanceled&&(!b&&aS&&(bb?(bH||aV(bo),""===bo&&aT(!1)):ba&&(bH||bI?bS({activeIndex:null}):aV(bo),bT("",(0,v.d)(w.qs,c.event)))),bm(b),!b&&bI&&(c.reason===w.Xn||c.reason===w.Np))&&(aM(!0),aN(!1),"onBlur"===aO))){let a="none"===U?bj:bf;aP.commit(a)}}),bV=(0,i.K)((a,b)=>{J?.(a,b),!b.isCanceled&&(bg(a),("none"===U&&aY.current&&ay||bb&&!bw.state.inputInsidePopup)&&bT(L(a,at),(0,v.d)(b.reason,b.event)),bb&&null!=a&&b.reason!==w.pf&&aS&&!bH&&aV(bo))}),bW=(0,i.K)((a,b)=>{let c=b;if(void 0===c){if(null===bB)return;c=a6.current[bB]}let d=(0,u.EW)(a),e=a3.current??a;a3.current=null;let f=(0,v.d)(w.Bo,e),g=d?.closest("a")?.getAttribute("href");if(g){g.startsWith("#")&&bU(!1,f);return}if(ba){var h,i,j,k;let a=Array.isArray(bf)?bf:[];if(bV((h=c,i=bw.state.isItemEqualToValue,a&&0!==a.length&&a.some(a=>void 0!==a&&H(h,a,i)))?(j=c,k=bw.state.isItemEqualToValue,a.filter(a=>!H(j,a,k))):[...a,c],f),!(aZ.current&&""!==aZ.current.value.trim()))return;bw.state.inputInsidePopup?bT("",(0,v.d)(w.qs,f.event)):bU(!1,f)}else bV(c,f),bU(!1,f)}),bX=(0,i.K)(()=>{if(!bw.state.submitOnItemClick)return;let a=bw.state.inputElement?.form;a&&"function"==typeof a.requestSubmit&&a.requestSubmit()}),bY=(0,i.K)(()=>{if(bL(!1),bA?.(!1),aT(!1),bP(),aV(null),"none"===U?bS({activeIndex:null,selectedIndex:null}):bS({activeIndex:null}),ba&&aZ.current&&""!==aZ.current.value&&!a0.current&&bT("",(0,v.d)(w.qs)),bb)if(bw.state.inputInsidePopup)aZ.current&&""!==aZ.current.value&&bT("",(0,v.d)(w.qs));else{let a=L(bf,at);if(aZ.current&&aZ.current.value!==a){let b=""===a?w.qs:w.dv;bT(a,(0,v.d)(b))}}}),bZ=e.useMemo(()=>bH&&bD?{current:bD.closest('[role="dialog"]')}:aY,[bH,bD]);(0,O.v)({enabled:!a.actionsRef,open:bl,ref:bZ,onComplete(){bl||bY()}}),e.useImperativeHandle(a.actionsRef,()=>({unmount:bY}),[bY]),(0,g.g)(function(){if(bl||"none"===U)return;let a=al?bt:a7.current;if(ba){let b=Array.isArray(bf)?bf:[],c=I(a,b[b.length-1],av);bS({selectedIndex:-1===c?null:c})}else{let b=I(a,bf,av);bS({selectedIndex:-1===b?null:b})}},[bl,bf,al,U,bt,ba,av,bS]),(0,g.g)(()=>{al&&(a6.current=bv,aW.current.length=bv.length)},[al,bv]),(0,g.g)(()=>{let a=a5.current;if(a&&(a.hasQuery?b&&bw.set("activeIndex",0):"always"===b&&bw.set("activeIndex",0),a5.current=null),!bl&&!bH)return;let c=bd||be?bv:a6.current,d=bw.state.activeIndex;if(null==d)return"always"===b&&c.length>0?void bw.set("activeIndex",0):void(a4.current!==ae&&(a4.current=ae,bw.state.onItemHighlighted(void 0,(0,v.M)(w.dv,void 0,{index:-1}))));if(d>=c.length){a4.current!==ae&&(a4.current=ae,bw.state.onItemHighlighted(void 0,(0,v.M)(w.dv,void 0,{index:-1}))),bw.set("activeIndex",null);return}let e=c[d],f=a4.current.value,g=f!==ad&&H(e,f,bw.state.isItemEqualToValue);a4.current.index===d&&g||(a4.current={value:e,index:d},bw.state.onItemHighlighted(e,(0,v.M)(w.dv,void 0,{index:d})))},[bB,b,be,bd,bv,bH,bl,bw]),(0,g.g)(()=>{if("none"===U)return void aJ(""!==String(bj));aJ(ba?Array.isArray(bf)&&bf.length>0:null!=bf)},[aJ,U,bj,bf,ba]),e.useEffect(()=>{bd&&b&&0===bv.length&&bS({activeIndex:null})},[bd,b,bv.length,bS]),ac(bo,()=>{bl&&""!==bo&&bo!==String(bi)&&aT(!0)}),ac(bf,()=>{if("none"!==U&&(aF(a9),aG(bf!==aH.initialValue),aI()?aP.commit(bf):aP.commit(bf,!0),bb&&!bc&&!bI)){let a=L(bf,at);bj!==a&&bT(a,(0,v.d)(w.dv))}}),ac(bj,()=>{"none"===U&&(aF(a9),aG(bj!==aH.initialValue),aI()?aP.commit(bj):aP.commit(bj,!0))}),ac(al,()=>{if(!bb||bc||bI||aS)return;let a=L(bf,at);bj!==a&&bT(a,(0,v.d)(w.dv))});let b$=(0,p.P)({open:!!bH||bl,onOpenChange:bU,elements:{reference:bI?bF:bG,floating:bD}});bH||(c=ak?"grid":"listbox",x=bl?"true":"false");let b_=e.useMemo(()=>{let a=bG?.tagName==="INPUT",b=a||bl,d=a?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return b&&(d.role="combobox",d["aria-expanded"]=x,d["aria-haspopup"]=c,d["aria-controls"]=bl?bE?.id:void 0,d["aria-autocomplete"]=aB),{reference:d,floating:{role:"presentation"}}},[bG,bl,x,c,bE?.id,aB]),b0=(0,q.k)(b$,{enabled:!ah&&!a8&&ao,event:"mousedown-only",toggle:!1,touchOpenDelay:50*!bI,reason:w._J}),b1=(0,r.s)(b$,{enabled:!ah&&!a8&&!bH,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:!!bH||void 0,outsidePress(a){let b=(0,u.EW)(a);return!(0,u.gR)(bF,b)&&!(0,u.gR)(a2.current,b)&&!(0,u.gR)(a1.current,b)}}),b2=(0,s.C)(b$,{enabled:!ah&&!a8,id:aQ,listRef:aW,activeIndex:bB,selectedIndex:bC,virtual:!0,loopFocus:as,allowEscape:as&&!b,focusItemOnOpen:!aS&&("none"!==U||!!b)&&"auto",focusItemOnHover:ar,resetOnPointerLeave:!aq,cols:ak?2:1,orientation:ak?"horizontal":void 0,disabledIndices:P.Ml,onNavigate(a,b){(b||bl)&&"ending"!==bM&&(b?bS({activeIndex:a,type:a_.current?"keyboard":"pointer"}):bS({activeIndex:a}))}}),{getReferenceProps:b3,getFloatingProps:b4,getItemProps:b5}=(0,t.b)([b_,b0,b1,b2]);(0,h.j)(()=>{bw.update({inline:ax,popupProps:b4(),inputProps:b3(),triggerProps:bO,getItemProps:b5,setOpen:bU,setInputValue:bT,setSelectedValue:bV,setIndices:bS,onItemHighlighted:bz,handleSelection:bW,forceMount:bQ,requestSubmit:bX})}),(0,g.g)(()=>{bw.update({id:aQ,selectedValue:bf,open:bl,mounted:bK,transitionStatus:bM,items:al,inline:ax,popupProps:b4(),inputProps:b3(),triggerProps:bO,openMethod:bN,getItemProps:b5,selectionMode:U,name:a9,disabled:a8,readOnly:ah,required:ai,grid:ak,isGrouped:bn,virtualized:aw,onOpenChangeComplete:bA,openOnInputClick:ao,itemToStringLabel:at,modal:az,autoHighlight:b,isItemEqualToValue:av,submitOnItemClick:aE,hasInputValue:bc,requestSubmit:bX})},[bw,aQ,bf,bl,bK,bM,al,b4,b3,b5,bN,bO,U,a9,a8,ah,ai,aP,ak,bn,aw,bA,ao,at,az,av,aE,bc,ax,bX,b]);let b6=(0,j.a)(aj,aP.inputRef),b7=e.useMemo(()=>({query:bo,hasItems:bd,filteredItems:bu,flatFilteredItems:bv}),[bo,bd,bu,bv]),b8=e.useMemo(()=>Array.isArray(bx)?"":M(bx,au),[bx,au]),b9=ba&&Array.isArray(bf)&&bf.length>0,ca=ba||"none"===U?void 0:a9,cb=e.useMemo(()=>ba&&Array.isArray(bf)&&a9?bf.map(a=>{let b=M(a,au);return(0,d.jsx)("input",{type:"hidden",name:a9,value:b},b)}):null,[ba,bf,a9,au]),cc=(0,d.jsxs)(e.Fragment,{children:[a.children,(0,d.jsx)("input",{...aP.getInputValidationProps({onFocus(){if(bI)return void bF?.focus();(aZ.current||bF)?.focus()},onChange(a){if(a.nativeEvent.defaultPrevented)return;let b=a.target.value,c=(0,v.d)(w.dv,a.nativeEvent);function d(){if(ba)return;if("none"===U){aG(b!==aH.initialValue),bT(b,c),aI()&&aP.commit(b);return}let a=a6.current.find(a=>M(a,au).toLowerCase()===b.toLowerCase());null!=a&&(aG(a!==aH.initialValue),bV?.(a,c),aI()&&aP.commit(a))}al?d():(bQ(),queueMicrotask(d))}}),id:aQ&&null==ca?`${aQ}-hidden-input`:void 0,name:ca,autoComplete:aC,disabled:a8,required:ai&&!b9,readOnly:ah,value:b8,ref:b6,style:ca?k.a:k.Q,tabIndex:-1,"aria-hidden":!0}),cb]});return(0,d.jsx)(y.Provider,{value:bw,children:(0,d.jsx)(z.Provider,{value:b$,children:(0,d.jsx)(A.Provider,{value:b7,children:(0,d.jsx)(B.Provider,{value:bj,children:cc})})})})}var ag=c(504745),ah=c(577979),ai=c(654277);let aj={...ai.jL,valid:a=>null===a?null:a?{[Q.valid]:""}:{[Q.invalid]:""},popupSide:a=>a?{"data-popup-side":a}:null,listEmpty:a=>a?{"data-list-empty":""}:null},ak=e.createContext(void 0);var al=c(20960);let am=e.createContext(void 0);function an(a){let b=e.useContext(am);if(void 0===b&&!a)throw Error((0,x.A)(21));return b}var ao=c(729406);let ap=e.forwardRef(function(a,b){let{render:c,className:d,disabled:f=!1,id:g,...h}=a,{state:j,disabled:k,setTouched:l,setFocused:m,validationMode:o,validation:p}=S(),{labelId:q}=Z(),r=e.useContext(ak),s=!!an(!0),t=C(),{filteredItems:u}=E(),x=e.useContext(B),y=(0,ao.j)(),z=(0,n.P)(t,N.required),A=(0,n.P)(t,N.disabled),D=(0,n.P)(t,N.readOnly),F=(0,n.P)(t,N.name),G=(0,n.P)(t,N.selectionMode),H=(0,n.P)(t,N.autoHighlight),I=(0,n.P)(t,N.inputProps),J=(0,n.P)(t,N.triggerProps),K=(0,n.P)(t,N.open),L=(0,n.P)(t,N.mounted),M=(0,n.P)(t,N.selectedValue),O=(0,n.P)(t,N.popupSide),P=(0,n.P)(t,N.positionerElement),Q=(0,n.P)(t,N.id),R=(0,n.P)(t,N.inline),T=!!H,U=k||A||f,V=0===u.length,W=s||R,Y=(0,X.e)(g??(W?void 0:Q)),[_,aa]=e.useState(null),ab=e.useRef(!1),ac=e.useRef(null),ad=e.useRef(!1),ae=(0,i.K)(a=>{let b=s||t.state.inline;b&&!t.state.hasInputValue&&t.state.setInputValue("",(0,v.d)(w.dv)),t.update({inputElement:a,inputInsidePopup:b})}),af={...j,open:K,disabled:U,readOnly:D,popupSide:L&&P?O:null,listEmpty:V};return(0,ah.o)("input",a,{state:af,ref:[b,t.state.inputRef,ae],props:[I,J,{type:"text",value:a.value??_??x,"aria-readonly":D||void 0,"aria-required":z||void 0,"aria-labelledby":q,disabled:U,readOnly:D,required:"none"===G?z:void 0,..."none"===G&&F&&{name:F},id:Y,onFocus(){if(m(!0),!R||!ad.current)return;ad.current=!1;let a=ac.current;null!=a&&Object.hasOwn(t.state.valuesRef.current,a)&&t.state.setIndices({activeIndex:a})},onBlur(){l(!0),m(!1);let a=t.state.activeIndex;if(R&&null!==a&&"always"!==H&&(ac.current=a,ad.current=!0,t.state.setIndices({activeIndex:null})),"onBlur"===o){let a="none"===G?x:M;p.commit(a)}},onCompositionStart(a){ag.m0||(ab.current=!0,aa(a.currentTarget.value))},onCompositionEnd(a){ab.current=!1;let b=a.currentTarget.value;aa(null),t.state.setInputValue(b,(0,v.d)(w.pf,a.nativeEvent))},onChange(a){let b=a.nativeEvent.inputType,c=ab.current||!(!b||"insertReplacementText"===b);if(ab.current){let b=a.currentTarget.value;aa(b),""!==b||t.state.openOnInputClick||t.state.inputInsidePopup||t.state.setOpen(!1,(0,v.d)(w.qs,a.nativeEvent));let d=b.trim();!D&&!U&&d&&c&&(t.state.setOpen(!0,(0,v.d)(w.pf,a.nativeEvent)),T||t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&null!==t.state.activeIndex&&!(T&&""!==d)&&t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"});return}t.state.setInputValue(a.currentTarget.value,(0,v.d)(w.pf,a.nativeEvent));let d=""===a.currentTarget.value,e=(0,v.d)(w.qs,a.nativeEvent);d&&!t.state.inputInsidePopup&&("single"===G&&t.state.setSelectedValue(null,e),t.state.openOnInputClick||t.state.setOpen(!1,e));let f=a.currentTarget.value.trim();!D&&!U&&f&&c&&(t.state.setOpen(!0,(0,v.d)(w.pf,a.nativeEvent)),T||t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&null!==t.state.activeIndex&&!T&&t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(a){if(U||D||a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)return;t.state.keyboardActiveRef.current=!0;let b=a.currentTarget,c=b.scrollWidth-b.clientWidth,d="rtl"===y;if("Home"===a.key){(0,al.jo)(a);let c=ag.gm&&d?b.value.length:0;b.setSelectionRange(c,c),b.scrollLeft=0;return}if("End"===a.key){(0,al.jo)(a);let e=ag.gm&&d?0:b.value.length;b.setSelectionRange(e,e),b.scrollLeft=d?-c:c;return}if(!L&&"Escape"===a.key){let b="multiple"===G&&Array.isArray(M)?0===M.length:null===M,c=(0,v.d)(w.jv,a.nativeEvent);t.state.setInputValue("",c),t.state.setSelectedValue("multiple"===G?[]:null,c),b||t.state.inline||c.isPropagationAllowed||a.stopPropagation();return}if(r&&"Backspace"===a.key&&""===b.value&&void 0===r.highlightedChipIndex&&Array.isArray(M)&&M.length>0){let b=M.slice(0,-1);t.state.setIndices({activeIndex:null,selectedIndex:null,type:t.state.keyboardActiveRef.current?"keyboard":"pointer"}),t.state.setSelectedValue(b,(0,v.d)(w.dv,a.nativeEvent));return}let e=r?.highlightedChipIndex!==void 0,f=function(a){let b;if(!r)return;let{highlightedChipIndex:c}=r;if(void 0!==c){if("ArrowLeft"===a.key)a.preventDefault(),b=c>0?c-1:void 0;else if("ArrowRight"===a.key)a.preventDefault(),b=c<M.length-1?c+1:void 0;else if("Backspace"===a.key||"Delete"===a.key){a.preventDefault();let d=c>=M.length-1?M.length-2:c;b=d>=0?d:void 0,t.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return b}return"ArrowLeft"===a.key&&(a.currentTarget.selectionStart??0)===0&&M.length>0?(a.preventDefault(),b=Math.max(M.length-1,0)):"Backspace"===a.key&&""===a.currentTarget.value&&M.length>0&&(t.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),a.preventDefault()),b}(a);if(r?.setHighlightedChipIndex(f),void 0!==f?r?.chipsRef.current[f]?.focus():e&&t.state.inputRef.current?.focus(),229!==a.which&&"Enter"===a.key&&K){let b=t.state.activeIndex,c=a.nativeEvent;if(null===b)return void t.state.setOpen(!1,(0,v.d)(w.dv,c));(0,al.jo)(a);let d=t.state.listRef.current[b];d&&(t.state.selectionEventRef.current=c,d.click(),t.state.selectionEventRef.current=null)}},onPointerMove(){t.state.keyboardActiveRef.current=!1},onPointerDown(){t.state.keyboardActiveRef.current=!1}},p?p.getValidationProps(h):h],stateAttributesMapping:aj})});var aq=c(402831);let ar=e.createContext(void 0),as=e.forwardRef(function(a,b){let{keepMounted:c=!1,...e}=a,f=C(),g=(0,n.P)(f,N.mounted),h=(0,n.P)(f,N.forceMounted);return g||c||h?(0,d.jsx)(ar.Provider,{value:c,children:(0,d.jsx)(aq.XF,{ref:b,...e})}):null});var at=c(640023),au=c(568069),av=c(275819),aw=c(293863),ax=c(994152),ay=c(929035);let az=e.forwardRef(function(a,b){let{render:c,className:f,anchor:h,positionMethod:j="absolute",side:k="bottom",align:l="center",sideOffset:m=0,alignOffset:o=0,collisionBoundary:p="clipping-ancestors",collisionPadding:q=5,arrowPadding:r=5,sticky:s=!1,disableAnchorTracking:t=!1,collisionAvoidance:u=aw.uD,...v}=a,w=C(),{filteredItems:y}=E(),z=D(),A=function(){let a=e.useContext(ar);if(void 0===a)throw Error((0,x.A)(20));return a}(),B=(0,n.P)(w,N.modal),F=(0,n.P)(w,N.open),G=(0,n.P)(w,N.mounted),H=(0,n.P)(w,N.openMethod),I=(0,n.P)(w,N.triggerElement),J=(0,n.P)(w,N.inputElement),K=(0,n.P)(w,N.inputInsidePopup),L=(0,n.P)(w,N.transitionStatus),M=0===y.length,O=h??(K?I:J),P=(0,av.s)({anchor:O,floatingRootContext:z,positionMethod:j,mounted:G,side:k,sideOffset:m,align:l,alignOffset:o,arrowPadding:r,collisionBoundary:p,collisionPadding:q,sticky:s,disableAnchorTracking:t,keepMounted:A,collisionAvoidance:u,lazyFlip:!0});(0,au.K)(F&&B&&"touch"!==H,I);let Q=e.useMemo(()=>{let a={...P.positionerStyles};return F||(a.pointerEvents="none"),{role:"presentation",hidden:!G,style:a}},[F,G,P.positionerStyles]),R={open:F,side:P.side,align:P.align,anchorHidden:P.anchorHidden,empty:M};(0,g.g)(()=>{w.set("popupSide",P.side)},[w,P.side]);let S=e.useMemo(()=>({side:P.side,align:P.align,arrowRef:P.arrowRef,arrowUncentered:P.arrowUncentered,arrowStyles:P.arrowStyles,anchorHidden:P.anchorHidden,isPositioned:P.isPositioned}),[P.side,P.align,P.arrowRef,P.arrowUncentered,P.arrowStyles,P.anchorHidden,P.isPositioned]),T=(0,i.K)(a=>{w.set("positionerElement",a)}),U=(0,ah.o)("div",a,{state:R,ref:[b,T],props:[Q,(0,ax.d)(L),v],stateAttributesMapping:ai.GW});return(0,d.jsxs)(am.Provider,{value:S,children:[G&&B&&(0,d.jsx)(ay.W,{inert:(0,at.Y)(!F),cutout:J??I}),U]})});var aA=c(474228),aB=c(238978);let aC={...ai.GW,...aB.G},aD=e.forwardRef(function(a,b){let c,{render:e,className:f,initialFocus:g,finalFocus:h,...i}=a,j=C(),k=an(),l=D(),{filteredItems:m}=E(),o=(0,n.P)(j,N.mounted),p=(0,n.P)(j,N.open),q=(0,n.P)(j,N.openMethod),r=(0,n.P)(j,N.transitionStatus),s=(0,n.P)(j,N.inputInsidePopup),t=(0,n.P)(j,N.inputElement),v=0===m.length;(0,O.v)({open:p,ref:j.state.popupRef,onComplete(){p&&j.state.onOpenChangeComplete(!0)}});let w={open:p,side:k.side,align:k.align,anchorHidden:k.anchorHidden,transitionStatus:r,empty:v},x=(0,ah.o)("div",a,{state:w,ref:[b,j.state.popupRef],props:[{role:s?"dialog":"presentation",tabIndex:-1,onFocus(a){let b=(0,u.EW)(a.nativeEvent);"touch"!==q&&((0,u.gR)(j.state.listElement,b)||b===a.currentTarget)&&j.state.inputRef.current?.focus()}},(0,ax.d)(r),i],stateAttributesMapping:aC}),y=!!s&&(a=>"touch"===a?j.state.popupRef.current:t);return c=null!=h?h:!!s&&void 0,(0,d.jsx)(aA.s,{context:l,disabled:!o,modal:!s,openInteractionType:q,initialFocus:void 0===g?y:g,returnFocus:c,children:x})}),aE=e.createContext(null);function aF(a){let{children:b}=a,{filteredItems:c}=E(),f=e.useContext(aE),g=f?f.items:c;return g?(0,d.jsx)(e.Fragment,{children:g.map(b)}):null}var aG=c(987038);let aH=e.forwardRef(function(a,b){var c;let{render:f,className:g,children:h,...j}=a,k=C(),l=D(),m=!!an(!0),{filteredItems:o}=E(),p=(0,n.P)(k,N.items),q=(0,n.P)(k,N.labelsRef),r=(0,n.P)(k,N.listRef),s=(0,n.P)(k,N.selectionMode),t=(0,n.P)(k,N.grid),u=(0,n.P)(k,N.popupProps),v=(0,n.P)(k,N.disabled),w=(0,n.P)(k,N.readOnly),x=(0,n.P)(k,N.virtualized),y=0===o.length,z=(0,i.K)(a=>{k.set("positionerElement",a)}),A=(0,i.K)(a=>{k.set("listElement",a)}),B=e.useMemo(()=>"function"==typeof h?c||(c=(0,d.jsx)(aF,{children:h})):h,[h]),F=l.useState("floatingId"),G=(0,ah.o)("div",a,{state:{empty:y},ref:[b,A,m?null:z],props:[u,{children:B,tabIndex:-1,id:F,role:t?"grid":"listbox","aria-multiselectable":"multiple"===s?"true":void 0,onKeyDown(a){if(!v&&!w&&"Enter"===a.key){let b=k.state.activeIndex;if(null==b)return;(0,al.jo)(a);let c=a.nativeEvent,d=k.state.listRef.current[b];d&&(k.state.selectionEventRef.current=c,d.click(),k.state.selectionEventRef.current=null)}},onKeyDownCapture(){k.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){k.state.keyboardActiveRef.current=!1}},j]});return x?G:(0,d.jsx)(aG.u,{elementsRef:r,labelsRef:p?void 0:q,children:G})});var aI=c(360412);let aJ=e.createContext(void 0);var aK=c(642228);let aL=e.createContext(!1),aM=e.memo(e.forwardRef(function(a,b){let{render:c,className:f,value:h=null,index:i,disabled:j=!1,nativeButton:k=!1,...l}=a,m=e.useRef(!1),o=e.useRef(null),p=(0,aI.q)({index:i,textRef:o,indexGuessBehavior:aI.G.GuessFromOrder}),q=C(),r=e.useContext(aL),{flatFilteredItems:s,hasItems:t}=E(),u=(0,n.P)(q,N.open),v=(0,n.P)(q,N.selectionMode),w=(0,n.P)(q,N.readOnly),x=(0,n.P)(q,N.virtualized),y=(0,n.P)(q,N.isItemEqualToValue),z="none"!==v,A=i??(x?I(s,h,y):p.index),B=-1!==p.index,D=(0,n.P)(q,N.id),F=(0,n.P)(q,N.isActive,A),G=(0,n.P)(q,N.isSelected,h),J=(0,n.P)(q,N.getItemProps),K=e.useRef(null),L=null!=D&&B?`${D}-${A}`:void 0,M=G&&z;(0,g.g)(()=>{if(!(B&&(x||null!=i)))return;let a=q.state.listRef.current;return a[A]=K.current,()=>{delete a[A]}},[B,x,A,i,q]),(0,g.g)(()=>{if(!B||t)return;let a=q.state.valuesRef.current;return a[A]=h,"none"!==v&&q.state.allValuesRef.current.push(h),()=>{delete a[A]}},[B,t,A,h,q,v]),(0,g.g)(()=>{if(!u){m.current=!1;return}if(!B||t)return;let a=q.state.selectedValue;H(h,Array.isArray(a)?a[a.length-1]:a,y)&&q.set("selectedIndex",A)},[B,t,u,q,A,h,y]);let O=J({active:F,selected:M});O.id=void 0,O.onFocus=void 0;let{getButtonProps:P,buttonRef:Q}=(0,aK.s)({disabled:j,focusableWhenDisabled:!0,native:k});function R(a){function b(){q.state.handleSelection(a,h)}q.state.submitOnItemClick?(T.flushSync(b),q.state.requestSubmit()):b()}let S=(0,ah.o)("div",a,{ref:[Q,b,p.ref,K],state:{disabled:j,selected:M,highlighted:F},props:[O,{id:L,role:r?"gridcell":"option","aria-selected":z?M:void 0,tabIndex:void 0,onPointerDownCapture(a){m.current=!0,a.preventDefault()},onClick(a){j||w||R(a.nativeEvent)},onMouseUp(a){let b=m.current;m.current=!1,j||w||0!==a.button||b||!F||R(a.nativeEvent)}},l,P]}),U=e.useMemo(()=>({selected:M,textRef:o}),[M,o]);return(0,d.jsx)(aJ.Provider,{value:U,children:S})}));var aN=c(165046);let aO=function(a){let{multiple:b=!1,defaultValue:c,value:e,onValueChange:f,autoComplete:g,...h}=a;return(0,d.jsx)(af,{...h,selectionMode:b?"multiple":"single",selectedValue:e,defaultSelectedValue:c,onSelectedValueChange:f,formAutoComplete:g})},aP=e.forwardRef(({className:a,...b},c)=>(0,d.jsx)(ap,{ref:c,"data-slot":"combobox-input",className:(0,aN.cn)("w-full rounded-xl py-2 text-sm outline-none transition-colors",a),...b}));function aQ({className:a,side:b="bottom",sideOffset:c=8,align:e="start",alignOffset:f=0,anchor:g,...h}){return(0,d.jsx)(as,{children:(0,d.jsx)(az,{side:b,sideOffset:c,align:e,alignOffset:f,anchor:g,className:"isolate z-[10000]",children:(0,d.jsx)(aD,{"data-slot":"combobox-content",className:(0,aN.cn)("bg-neutral-100/[0.67] dark:bg-neutral-900/[0.67] border border-white dark:border-white/10 backdrop-blur-md text-[var(--color-text)] max-h-[var(--available-height)] w-[calc(var(--anchor-width)+48px)] overflow-hidden rounded-3xl p-1 shadow-[0_0_25px_0_rgba(0,0,0,0.16)] outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",a),...h})})})}function aR({className:a,...b}){return(0,d.jsx)(aH,{"data-slot":"combobox-list",className:(0,aN.cn)("max-h-[300px] overflow-y-auto overscroll-contain thin-scrollbar",a),...b})}function aS({className:a,children:b,...c}){return(0,d.jsx)(aM,{"data-slot":"combobox-item",className:(0,aN.cn)("bg-transparent data-highlighted:bg-neutral-400/15 text-sm transition-all relative flex w-full cursor-pointer items-center gap-2.5 rounded-2xl px-3 py-2 outline-none select-none","data-disabled:pointer-events-none data-disabled:opacity-50",a),...c,children:b})}aP.displayName="ComboboxInput";var aT=c(941809),aU=c(896703),aV=c(490654),aW=c(75567);function aX(a){return(0,aW.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7.875 2.292a.114.114 0 0 0-.032.018A7.239 7.239 0 0 0 4.75 8.25a7.248 7.248 0 0 0 3.654 6.297c.57.327.982.955.941 1.682v.002l-.317 6.058a.75.75 0 1 1-1.498-.078l.317-6.062v-.004c.006-.09-.047-.215-.188-.296A8.749 8.749 0 0 1 3.25 8.25a8.738 8.738 0 0 1 3.732-7.169 1.547 1.547 0 0 1 1.709-.064c.484.292.809.835.809 1.46v4.714a.25.25 0 0 0 .119.213l2.25 1.385c.08.05.182.05.262 0l2.25-1.385a.25.25 0 0 0 .119-.213V2.478c0-.626.325-1.169.81-1.461a1.547 1.547 0 0 1 1.708.064 8.741 8.741 0 0 1 3.732 7.17 8.747 8.747 0 0 1-4.41 7.598c-.14.081-.193.206-.188.296v.004l.318 6.062a.75.75 0 1 1-1.498.078l-.317-6.058v-.002c-.041-.727.37-1.355.94-1.682A7.247 7.247 0 0 0 19.25 8.25a7.239 7.239 0 0 0-3.093-5.94.114.114 0 0 0-.032-.018l-.01-.001c-.003 0-.014 0-.031.01-.036.022-.084.079-.084.177V7.19c0 .608-.315 1.172-.833 1.49l-2.25 1.385a1.75 1.75 0 0 1-1.834 0l-2.25-1.384A1.752 1.752 0 0 1 8 7.192V2.477c0-.098-.048-.155-.084-.176a.068.068 0 0 0-.031-.011l-.01.001Z"},child:[]}]})(a)}function aY(a){return(0,aW.k5)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M2.5 7C2.5 9.48528 4.51472 11.5 7 11.5C9.48528 11.5 11.5 9.48528 11.5 7C11.5 4.51472 9.48528 2.5 7 2.5C4.51472 2.5 2.5 4.51472 2.5 7ZM2.5 17C2.5 19.4853 4.51472 21.5 7 21.5C9.48528 21.5 11.5 19.4853 11.5 17C11.5 14.5147 9.48528 12.5 7 12.5C4.51472 12.5 2.5 14.5147 2.5 17ZM12.5 17C12.5 19.4853 14.5147 21.5 17 21.5C19.4853 21.5 21.5 19.4853 21.5 17C21.5 14.5147 19.4853 12.5 17 12.5C14.5147 12.5 12.5 14.5147 12.5 17ZM9.5 7C9.5 8.38071 8.38071 9.5 7 9.5C5.61929 9.5 4.5 8.38071 4.5 7C4.5 5.61929 5.61929 4.5 7 4.5C8.38071 4.5 9.5 5.61929 9.5 7ZM9.5 17C9.5 18.3807 8.38071 19.5 7 19.5C5.61929 19.5 4.5 18.3807 4.5 17C4.5 15.6193 5.61929 14.5 7 14.5C8.38071 14.5 9.5 15.6193 9.5 17ZM19.5 17C19.5 18.3807 18.3807 19.5 17 19.5C15.6193 19.5 14.5 18.3807 14.5 17C14.5 15.6193 15.6193 14.5 17 14.5C18.3807 14.5 19.5 15.6193 19.5 17ZM17.5252 11.155L17.8026 10.5186C18.297 9.38398 19.1876 8.48059 20.2988 7.98638L21.1534 7.60631C21.6155 7.4008 21.6155 6.7284 21.1534 6.52289L20.3467 6.16406C19.2068 5.65713 18.3002 4.72031 17.8143 3.54712L17.5295 2.85945C17.3309 2.38018 16.669 2.38018 16.4705 2.85945L16.1856 3.54712C15.6997 4.72031 14.7932 5.65713 13.6534 6.16406L12.8466 6.52289C12.3845 6.7284 12.3845 7.4008 12.8466 7.60631L13.7011 7.98638C14.8124 8.48059 15.7029 9.38398 16.1974 10.5186L16.4748 11.155C16.6778 11.6209 17.3222 11.6209 17.5252 11.155Z"},child:[]}]})(a)}var aZ=c(826948),a$=c(57137),a_=c(489619),a0=c(86839),a1=c(981188);function a2(a){let b=a.path??a.id,c=b.split("/").pop()??a.label;return{name:"object"===a.kind?(0,a0.PV)(a.label):c,path:b,type:a.nodeType??("object"===a.kind?"folder":"file")}}function a3(){let{resolvedTheme:a,setTheme:b}=(0,aZ.D)(),[c,f]=(0,e.useState)(!1);if(!c)return(0,d.jsx)("div",{className:"w-[26px] h-[26px]"});let g="dark"===a;return(0,d.jsx)("button",{type:"button",onClick:()=>b(g?"light":"dark"),className:"p-1.5 rounded-lg transition-colors",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:g?"Switch to light mode":"Switch to dark mode",children:g?(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,d.jsx)("path",{d:"M12 2v2"}),(0,d.jsx)("path",{d:"M12 20v2"}),(0,d.jsx)("path",{d:"m4.93 4.93 1.41 1.41"}),(0,d.jsx)("path",{d:"m17.66 17.66 1.41 1.41"}),(0,d.jsx)("path",{d:"M2 12h2"}),(0,d.jsx)("path",{d:"M20 12h2"}),(0,d.jsx)("path",{d:"m6.34 17.66-1.41 1.41"}),(0,d.jsx)("path",{d:"m19.07 4.93-1.41 1.41"})]}):(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})})}function a4(){return(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,d.jsx)("path",{d:"m21 21-4.3-4.3"})]})}function a5({type:a}){switch(a){case"folder":return(0,d.jsx)(aT.A,{size:16,style:{flexShrink:0,color:"#60a5fa"}});case"document":default:return(0,d.jsx)(aU.A,{size:16,style:{flexShrink:0,opacity:.7}});case"database":return(0,d.jsx)(aV.A,{size:16,style:{flexShrink:0}})}}function a6({onSelect:a,searchFn:b}){let[c,f]=(0,e.useState)([]),[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(""),k=(0,e.useRef)(!1),l=(0,e.useRef)(null),m=(0,e.useRef)(null),n=(0,e.useCallback)(a=>{if(k.current){k.current=!1;return}if(j(a),!a.trim()){f([]),h(!1);return}b?(f(b(a.trim(),20).map(a2)),h(!0)):(l.current&&clearTimeout(l.current),l.current=setTimeout(async()=>{try{let b=await fetch(`/api/workspace/suggest-files?q=${encodeURIComponent(a.trim())}`),c=await b.json();f(c.items??[]),h(!0)}catch{f([])}},150))},[b]);return(0,d.jsxs)(aO,{value:null,open:g,onOpenChange:a=>{a||h(!1)},onValueChange:b=>{b&&(k.current=!0,a(b),h(!1),j(""),f([]))},onInputValueChange:n,filter:null,itemToStringLabel:()=>"",children:[(0,d.jsxs)("div",{ref:m,className:"relative",children:[(0,d.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none z-10",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)(a4,{})}),(0,d.jsx)(aP,{placeholder:"Search",className:"w-full pl-9 pr-10 py-1.5 rounded-xl text-sm outline-none transition-colors",style:{background:"var(--color-surface-hover)",color:"var(--color-text)"}})]}),(0,d.jsxs)(aQ,{anchor:m,children:[(0,d.jsx)(aR,{children:c.map(a=>(0,d.jsxs)(aS,{value:a,children:[(0,d.jsx)("span",{className:"flex-shrink-0",style:{color:"var(--color-text-muted)",opacity:.55},children:(0,d.jsx)(a5,{type:a.type})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"truncate font-medium",children:a.name}),(0,d.jsx)("div",{className:"truncate text-xs",style:{color:"var(--color-text-muted)"},children:a.path.split("/").slice(0,-1).join("/")})]})]},a.path))}),i.trim()&&0===c.length&&(0,d.jsx)("div",{className:"py-3 text-center text-sm",style:{color:"var(--color-text-muted)"},children:"No files found"})]})]})}function a7({orgName:a,onFileSearchSelect:b,mobile:c,onClose:f,showHidden:g,onToggleHidden:h,width:i,onCollapse:j,compact:k=!1,onToggleCompact:l,activeWorkspace:m,onWorkspaceChanged:n,onNavigate:o,activeCrmTarget:p=null,customCrmObjects:q,activeCrmObjectName:r=null,onNavigateToCrmObject:s,chatsPanel:t,onNewChatSession:u}){let v=c?"280px":i??260,[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)("home"),A=[{id:"crm-people",label:"People",target:"people",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),(0,d.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,d.jsx)("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),(0,d.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})},{id:"crm-companies",label:"Companies",target:"companies",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("path",{d:"M3 21h18"}),(0,d.jsx)("path",{d:"M5 21V7l8-4v18"}),(0,d.jsx)("path",{d:"M19 21V11l-6-4"}),(0,d.jsx)("path",{d:"M9 9h0"}),(0,d.jsx)("path",{d:"M9 13h0"}),(0,d.jsx)("path",{d:"M9 17h0"})]})},{id:"crm-inbox",label:"Inbox",target:"inbox",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),(0,d.jsx)("path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11Z"})]})},{id:"crm-calendar",label:"Calendar",target:"calendar",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),(0,d.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,d.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,d.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}],B=[{id:"cloud",label:"Cloud",icon:(0,d.jsx)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,d.jsx)("path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"})})},{id:"integrations",label:"Integrations",icon:(0,d.jsx)(aY,{className:"h-4 w-4 shrink-0","aria-hidden":!0})},{id:"skills",label:"Skills",icon:(0,d.jsx)(aX,{className:"h-4 w-4 shrink-0","aria-hidden":!0})},{id:"cron",label:"Cron",icon:(0,d.jsxs)("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("polyline",{points:"12 6 12 12 16 14"})]})}],C=(0,d.jsxs)("aside",{className:"flex flex-col h-screen shrink-0 border-r",style:{width:"number"==typeof v?`${v}px`:v,minWidth:"number"==typeof v?`${v}px`:v,background:"var(--color-bg)",borderColor:"var(--color-border)"},children:[l&&(0,d.jsx)("div",{className:"flex items-center justify-center h-[44px] shrink-0",children:(0,d.jsx)("button",{type:"button",onClick:l,className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:"Expand sidebar",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M15 3v18"})]})})}),(0,d.jsx)("div",{className:"flex items-center justify-center pb-0.5 shrink-0",children:(0,d.jsx)(a$.N,{activeWorkspaceHint:m??null,onWorkspaceSwitch:()=>{n?.()},onWorkspaceDelete:()=>{n?.()},onCreateWorkspace:()=>{x(!0)},trigger:({onClick:b,activeWorkspace:c,switching:e})=>(0,d.jsx)("button",{type:"button",onClick:b,disabled:e,className:"w-7 h-7 mx-auto rounded-lg overflow-hidden flex items-center justify-center transition-opacity hover:opacity-90",title:`${a||"Workspace"}${c?` — ${c}`:""}`,children:(0,d.jsx)("img",{src:"/dench-workspace-icon.png",alt:"",className:"w-7 h-7 object-cover",draggable:!1})})})}),o&&(0,d.jsxs)("div",{className:"flex flex-col items-center gap-0.5 pt-1 pb-1",children:[A.map(a=>{let b=p===a.target;return(0,d.jsx)("button",{type:"button",onClick:()=>o(a.id),className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},title:a.label,"aria-label":a.label,children:a.icon},a.id)}),q&&q.length>0&&s&&q.map(a=>{let b=r===a.name,c=(0,a0.PV)(a.name);return(0,d.jsx)("button",{type:"button",onClick:()=>s(a.name),className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},title:c,"aria-label":c,children:(0,d.jsx)(a1.P,{name:a.icon,size:16})},`crm-object-${a.name}`)})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0"}),o&&(0,d.jsx)("div",{className:"flex flex-col items-center gap-0.5 py-1",children:B.map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>o(a.id),className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--color-text)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:a.label,"aria-label":a.label,children:a.icon},a.id))}),(0,d.jsxs)("div",{className:"flex flex-col items-center py-1.5 gap-0.5",children:[h&&(0,d.jsx)("button",{type:"button",onClick:h,className:"w-9 h-9 rounded-lg flex items-center justify-center transition-colors",style:{color:g?"var(--color-text)":"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:g?"Hide dotfiles":"Show dotfiles",children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),(0,d.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),(0,d.jsx)("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),(0,d.jsx)("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),(0,d.jsx)("path",{d:"m2 2 20 20"})]})})}),(0,d.jsx)(a3,{})]})]}),D=(0,d.jsxs)("aside",{className:`flex flex-col h-screen shrink-0 ${c?"drawer-left":"border-r"}`,style:{width:"number"==typeof v?`${v}px`:v,minWidth:"number"==typeof v?`${v}px`:v,background:"var(--color-bg)",borderColor:"var(--color-border)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-1 px-2 h-[44px] shrink-0",children:[(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(a$.N,{activeWorkspaceHint:m??null,onWorkspaceSwitch:()=>{n?.()},onWorkspaceDelete:()=>{n?.()},onCreateWorkspace:()=>{x(!0)},trigger:({onClick:b,activeWorkspace:c,switching:e})=>(0,d.jsxs)("button",{type:"button",onClick:b,disabled:e,className:"text-[13px] flex items-center gap-1.5 truncate w-full transition-colors rounded-lg px-2 py-1.5",style:{color:"var(--color-text)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:"Switch workspace",children:[(0,d.jsx)("span",{className:"truncate font-semibold",children:a||"Workspace"}),c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"shrink-0 opacity-40",children:"/"}),(0,d.jsx)("span",{className:"truncate text-[12px]",style:{color:"var(--color-text-muted)"},children:c})]}),(0,d.jsx)("span",{className:"flex-1"}),(0,d.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)("path",{d:"m6 9 6 6 6-6"})})]})})}),(l||j)&&(0,d.jsx)("button",{type:"button",onClick:l??j,className:"p-1.5 rounded-lg shrink-0 transition-colors",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:l?"Collapse to icons":"Hide sidebar (⌘B)",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,d.jsx)("path",{d:"M9 3v18"})]})})]}),t&&(0,d.jsxs)("div",{className:"px-2 pt-1 pb-1 flex items-center gap-1",children:[[{id:"home",label:"Home"},{id:"chats",label:"Chats"}].map(a=>{let b=y===a.id;return(0,d.jsx)("button",{type:"button",onClick:()=>z(a.id),className:"flex-1 px-2 py-1 rounded-md text-[12px] font-medium transition-colors cursor-pointer",style:{color:b?"var(--color-text)":"var(--color-text-muted)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:a.label},a.id)}),"chats"===y&&u&&(0,d.jsx)("button",{type:"button",onClick:u,className:"p-1 rounded-md transition-colors cursor-pointer shrink-0",style:{color:"var(--color-text-muted)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},title:"New chat","aria-label":"New chat",children:(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("path",{d:"M5 12h14"}),(0,d.jsx)("path",{d:"M12 5v14"})]})})]}),"chats"===y&&t?(0,d.jsx)("div",{className:"flex-1 min-h-0 flex flex-col relative",children:t}):(0,d.jsxs)(d.Fragment,{children:[o&&(0,d.jsxs)("div",{className:"px-2 pt-1 pb-1",children:[(0,d.jsx)("div",{className:"px-2 pt-2 pb-1 text-[9px] lowercase",style:{color:"var(--color-text-muted)",letterSpacing:"0.05em"},children:"workspace"}),(0,d.jsxs)("div",{className:"space-y-0.5",children:[A.map(a=>{let b=p===a.target;return(0,d.jsxs)("button",{type:"button",onClick:()=>o(a.id),className:"w-full flex items-center gap-2.5 px-2 py-1.5 rounded-lg text-[13px] transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},children:[(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--color-text-muted)"},children:a.icon}),a.label]},a.id)}),q&&q.length>0&&s&&q.map(a=>{let b=r===a.name,c=(0,a0.PV)(a.name);return(0,d.jsxs)("button",{type:"button",onClick:()=>s(a.name),className:"w-full flex items-center gap-2.5 px-2 py-1.5 rounded-lg text-[13px] transition-colors",style:{color:"var(--color-text)",background:b?"var(--color-surface-hover)":"transparent"},onMouseEnter:a=>{b||(a.currentTarget.style.background="var(--color-surface-hover)")},onMouseLeave:a=>{b||(a.currentTarget.style.background="transparent")},title:c,children:[(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--color-text-muted)"},children:(0,d.jsx)(a1.P,{name:a.icon,size:16})}),c]},`crm-object-${a.name}`)})]})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0"}),o&&(0,d.jsx)("div",{className:"px-2 py-1 space-y-0.5",children:B.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>o(a.id),className:"w-full flex items-center gap-2.5 px-2 py-1.5 rounded-lg text-[13px] transition-colors",style:{color:"var(--color-text)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--color-text-muted)"},children:a.icon}),a.label]},a.id))})]}),(0,d.jsxs)("div",{className:"px-2 py-1.5 flex items-center justify-between",children:[(0,d.jsxs)("a",{href:"https://dench.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-2 py-1 rounded-lg text-[11px]",style:{color:"var(--color-text-muted)"},children:["dench.com"," v3.0.9"]}),(0,d.jsxs)("div",{className:"flex items-center gap-0.5",children:[h&&(0,d.jsx)("button",{type:"button",onClick:h,className:"p-1.5 rounded-lg transition-colors",style:{color:g?"var(--color-text)":"var(--color-text-muted)"},title:g?"Hide dotfiles":"Show dotfiles",children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),(0,d.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),(0,d.jsx)("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),(0,d.jsx)("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),(0,d.jsx)("path",{d:"m2 2 20 20"})]})})}),(0,d.jsx)(a3,{})]})]})]});return c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"drawer-backdrop",onClick:()=>void f?.(),children:(0,d.jsx)("div",{onClick:a=>a.stopPropagation(),className:"fixed inset-y-0 left-0 z-50",children:D})}),(0,d.jsx)(a_.s,{isOpen:w,onClose:()=>x(!1),onCreated:()=>{n?.()}})]}):(0,d.jsxs)(d.Fragment,{children:[!c&&k?C:D,(0,d.jsx)(a_.s,{isOpen:w,onClose:()=>x(!1),onCreated:()=>{n?.()}})]})}},685343:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});var d=c(95253)._0},686937:a=>{"use strict";var b=Object.prototype.hasOwnProperty,c=Object.prototype.toString,d=Object.defineProperty,e=Object.getOwnPropertyDescriptor,f=function(a){return"function"==typeof Array.isArray?Array.isArray(a):"[object Array]"===c.call(a)},g=function(a){if(!a||"[object Object]"!==c.call(a))return!1;var d,e=b.call(a,"constructor"),f=a.constructor&&a.constructor.prototype&&b.call(a.constructor.prototype,"isPrototypeOf");if(a.constructor&&!e&&!f)return!1;for(d in a);return void 0===d||b.call(a,d)},h=function(a,b){d&&"__proto__"===b.name?d(a,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):a[b.name]=b.newValue},i=function(a,c){if("__proto__"===c){if(!b.call(a,c))return;else if(e)return e(a,c).value}return a[c]};a.exports=function a(){var b,c,d,e,j,k,l=arguments[0],m=1,n=arguments.length,o=!1;for("boolean"==typeof l&&(o=l,l=arguments[1]||{},m=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});m<n;++m)if(b=arguments[m],null!=b)for(c in b)d=i(l,c),l!==(e=i(b,c))&&(o&&e&&(g(e)||(j=f(e)))?(j?(j=!1,k=d&&f(d)?d:[]):k=d&&g(d)?d:{},h(l,{name:c,newValue:a(o,k,e)})):void 0!==e&&h(l,{name:c,newValue:e}));return l}},688094:(a,b,c)=>{"use strict";c.d(b,{y:()=>E});var d=c(736927),e=c(115962),f=c(327648),g=c(327770),h=c(673977),i=c(405545),j=c(720511),k=c(381802),l=c(86839);let m=new k.hs("chatFileMention"),n=j.bP.create({name:"chatFileMention",group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!0,addAttributes:()=>({label:{default:""},path:{default:""},mentionType:{default:"file"},objectName:{default:""},defaultView:{default:""}}),parseHTML:()=>[{tag:"span[data-chat-file-mention]"}],renderHTML({HTMLAttributes:a}){let b=a.label||"file",c=a.mentionType||"file",d=a.defaultView||"",e={bg:"rgba(120, 113, 108, 0.1)",fg:"inherit"},f="object"===c?(0,l.PV)(b):b;return["span",(0,j.KV)({"data-chat-file-mention":"","data-mention-type":c,...d?{"data-default-view":d}:{},class:"chat-file-mention",style:`--mention-bg: ${e.bg}; --mention-fg: ${e.fg};`,title:a.path||""},a),f]}});var o=c(249855),p=c(941809),q=c(478425);let r=(0,q.A)("outline","photo","Photo",[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]]),s=(0,q.A)("outline","video","Video",[["path",{d:"M15 10l4.553 -2.276a1 1 0 0 1 1.447 .894v6.764a1 1 0 0 1 -1.447 .894l-4.553 -2.276v-4",key:"svg-0"}],["path",{d:"M3 8a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2l0 -8",key:"svg-1"}]]),t=(0,q.A)("outline","music","Music",[["path",{d:"M3 17a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-0"}],["path",{d:"M13 17a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}],["path",{d:"M9 17v-13h10v13",key:"svg-2"}],["path",{d:"M9 8h10",key:"svg-3"}]]);var u=c(896703);let v=(0,q.A)("outline","code","Code",[["path",{d:"M7 8l-4 4l4 4",key:"svg-0"}],["path",{d:"M17 8l4 4l-4 4",key:"svg-1"}],["path",{d:"M14 4l-4 16",key:"svg-2"}]]);var w=c(490654);let x=(0,q.A)("filled","layout-kanban-filled","LayoutKanbanFilled",[["path",{d:"M10 3a1 1 0 0 1 0 2h-6a1 1 0 1 1 0 -2z",key:"svg-0"}],["path",{d:"M20 3a1 1 0 0 1 0 2h-6a1 1 0 0 1 0 -2z",key:"svg-1"}],["path",{d:"M8 7a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3z",key:"svg-2"}],["path",{d:"M18 7a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-2a3 3 0 0 1 -3 -3v-2a3 3 0 0 1 3 -3z",key:"svg-3"}]]);var y=c(118475);let z=(0,q.A)("filled","user-filled","UserFilled",[["path",{d:"M12 2a5 5 0 1 1 -5 5l.005 -.217a5 5 0 0 1 4.995 -4.783z",key:"svg-0"}],["path",{d:"M14 14a5 5 0 0 1 5 5v1a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-1a5 5 0 0 1 5 -5h4z",key:"svg-1"}]]);function A({category:a,defaultView:b}){let c={flexShrink:0};switch(a){case"folder":return(0,d.jsx)(p.A,{size:18,style:{...c,color:"#60a5fa"}});case"image":return(0,d.jsx)(r,{size:18,style:{...c,color:"#10b981"}});case"video":return(0,d.jsx)(s,{size:18,style:{...c,color:"#8b5cf6"}});case"audio":return(0,d.jsx)(t,{size:18,style:{...c,color:"#f59e0b"}});case"pdf":return(0,d.jsx)(u.A,{size:18,style:{...c,color:"#ef4444"}});case"code":return(0,d.jsx)(v,{size:18,style:{...c,color:"#3b82f6"}});case"database":return(0,d.jsx)(w.A,{size:18,style:c});case"object":return"kanban"===b?(0,d.jsx)(x,{size:18,style:{...c,color:"#8b7cf6"}}):(0,d.jsx)(y.A,{size:18,style:{...c,color:"#42a97a"}});case"entry":return(0,d.jsx)(z,{size:18,style:{...c,color:"#22c55e"}});default:return(0,d.jsx)(u.A,{size:18,style:{...c,opacity:.7}})}}let B=(0,e.forwardRef)(({items:a,command:b,loading:c},f)=>{let[g,h]=(0,e.useState)(0),i=(0,e.useRef)(null);(0,e.useEffect)(()=>{h(0)},[a]),(0,e.useEffect)(()=>{let a=i.current?.children[g];a?.scrollIntoView({block:"nearest"})},[g]);let j=(0,e.useCallback)(c=>{let d=a[c];d&&b(d)},[a,b]);(0,e.useImperativeHandle)(f,()=>({onKeyDown:({event:b})=>"ArrowUp"===b.key?(h(b=>(b+a.length-1)%a.length),!0):"ArrowDown"===b.key?(h(b=>(b+1)%a.length),!0):("Enter"===b.key||"Tab"===b.key)&&(j(g),!0)}));let k="bg-neutral-100/[0.67] dark:bg-neutral-900/[0.67] border border-white dark:border-white/10 backdrop-blur-md shadow-[0_0_25px_0_rgba(0,0,0,0.16)]";return c?(0,d.jsx)("div",{className:`rounded-3xl p-3 ${k}`,style:{minWidth:280,maxWidth:400},children:(0,d.jsx)("span",{className:"text-xs animate-pulse",style:{color:"var(--color-text-muted)"},children:"Searching..."})}):0===a.length?(0,d.jsx)("div",{className:`rounded-3xl p-3 text-center ${k}`,style:{minWidth:280,maxWidth:400},children:(0,d.jsx)("span",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:"No results found"})}):(0,d.jsx)("div",{ref:i,className:`rounded-3xl p-1 overflow-y-auto thin-scrollbar ${k}`,style:{minWidth:280,maxWidth:400,maxHeight:300},children:a.map((a,b)=>{let c=function(a,b){if("folder"===b)return"folder";if("database"===b)return"database";if("object"===b)return"object";if("entry"===b)return"entry";let c=a.split(".").pop()?.toLowerCase()??"";return["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","heic"].includes(c)?"image":["mp4","webm","mov","avi","mkv","flv"].includes(c)?"video":["mp3","wav","ogg","aac","flac","m4a"].includes(c)?"audio":"pdf"===c?"pdf":["js","ts","tsx","jsx","py","rb","go","rs","java","cpp","c","h","css","html","json","yaml","yml","toml","sh","bash","sql","swift","kt"].includes(c)?"code":"document"===b?"document":"other"}(a.name,a.type),e=a.icon&&/\p{Emoji_Presentation}/u.test(a.icon),f="object"===a.type||"entry"===a.type,i="object"===a.type?(0,l.PV)(a.name):a.name,k="entry"===a.type&&a.objectName?(0,l.A3)(a.objectName):f?"kanban"===a.defaultView?"Board":"Table":a.path.replace(/^\/Users\/[^/]+/,"~").replace(/^\/home\/[^/]+/,"~").replace(/^[A-Z]:\\Users\\[^\\]+/,"~");return(0,d.jsxs)("button",{type:"button",className:`w-full flex items-center gap-2.5 px-2.5 py-1.5 text-left transition-all rounded-2xl select-none ${b===g?"bg-neutral-400/15":""}`,style:{color:"var(--color-text)"},onClick:()=>j(b),onMouseEnter:()=>h(b),children:[(0,d.jsx)("span",{className:"flex-shrink-0 flex items-center",style:{opacity:.55},children:e?(0,d.jsx)("span",{className:"text-[15px] leading-none",children:a.icon}):(0,d.jsx)(A,{category:c,defaultView:a.defaultView})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"text-sm font-medium truncate",children:i}),(0,d.jsx)("div",{className:"text-xs truncate",style:{color:"var(--color-text-muted)"},title:f?k:a.path,children:k})]})]},a.path)})})});function C({items:a,command:b,clientRect:c,componentRef:f,loading:g}){let h=(0,e.useRef)(null);return(0,o.createPortal)((0,d.jsx)("div",{ref:h,children:(0,d.jsx)(B,{ref:f,items:a,command:b,loading:g})}),document.body)}function D(a){if(!a)return{text:"",mentionedFiles:[]};let b=[],c=[];return a.state.doc.forEach(a=>{if("paragraph"===a.type.name||"hardBreak"===a.type.name){let d="";a.descendants(a=>{if("chatFileMention"===a.type.name){let c=a.attrs.label,e=a.attrs.path,f=a.attrs.mentionType,g=a.attrs.objectName;return b.push({name:c,path:e}),"object"===f?d+=`[object: ${c}]`:"entry"===f?d+=`[entry: ${g?`${g}/`:""}${c}]`:d+=`[file: ${e}]`,!1}return a.isText&&a.text&&(d+=a.text),"hardBreak"===a.type.name&&(d+="\n"),!0}),c.push(d)}}),{text:c.join("\n").trim(),mentionedFiles:b}}B.displayName="FileMentionList";let E=(0,e.forwardRef)(function({onSubmit:a,onChange:b,onNativeFileDrop:k,placeholder:l,disabled:o,compact:p,searchFn:q},r){let s=(0,e.useRef)(a);s.current=a;let t=(0,e.useRef)(k);t.current=k;let u=(0,e.useRef)(q??null);u.current=q??null;let v=(0,e.useRef)(null),w=(0,f.hG)({immediatelyRender:!1,extensions:[g.A.configure({heading:!1,codeBlock:!1,blockquote:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1}),h.A.configure({placeholder:l??"Ask anything...",showOnlyWhenEditable:!1}),n,j.YY.create({name:"chatFileMentionSuggestion",addProseMirrorPlugins(){return[(0,i.Ay)({editor:this.editor,char:"@",pluginKey:m,startOfLine:!1,allowSpaces:!0,command:({editor:a,range:b,props:c})=>{let d="object"===c.type?"object":"entry"===c.type?"entry":"folder"===c.type?"folder":"file";a.chain().focus().deleteRange(b).insertContent([{type:"chatFileMention",attrs:{label:c.name,path:c.path,mentionType:d,objectName:c.objectName??"",defaultView:c.defaultView??""}},{type:"text",text:" "}]).run()},items:({query:a})=>[],render:()=>{let a=null,b=null,e={current:null},f="",g=[],h=!1,i=null,j=null,k=null;function l(){b&&j&&b.render((0,d.jsx)(C,{items:g,command:j,clientRect:k,componentRef:e,loading:h}))}function m(a){let b=a.path??a.id,c=b.split("/").pop()??a.label;return{name:"object"===a.kind||"entry"===a.kind?a.label:c,path:b,type:"entry"===a.kind?"entry":"object"===a.kind?"object":a.nodeType??"file",icon:a.icon,objectName:a.objectName,entryId:a.entryId,defaultView:a.defaultView}}function n(a){let b=u?.current;return!!b&&(g=b(a,20).map(m),h=!1,l(),!0)}async function o(a){if(!n(a)){h=!0,l();try{let b=a.startsWith("/")||a.startsWith("~/")||a.startsWith("../")||a.startsWith("./")||a.includes("/")?`path=${encodeURIComponent(a)}`:a?`q=${encodeURIComponent(a)}`:"",c=`/api/workspace/suggest-files${b?`?${b}`:""}`,d=await fetch(c);g=(await d.json()).items??[]}catch{g=[]}h=!1,l()}}function p(a){n(a)||(i&&clearTimeout(i),i=setTimeout(()=>{o(a)},120))}return{onStart:d=>{a=document.createElement("div"),document.body.appendChild(a),j=d.command,k=d.clientRect??null,f=d.query,c.e(70684).then(c.t.bind(c,570684,19)).then(({createRoot:c})=>{b=c(a),p(f)})},onUpdate:a=>{j=a.command,k=a.clientRect??null,p(f=a.query)},onKeyDown:c=>{if("Escape"===c.event.key)return b?.unmount(),a?.remove(),a=null,b=null,!0;let d=e.current?.onKeyDown(c)??!1;return d&&c.event.stopImmediatePropagation(),d},onExit:()=>{i&&clearTimeout(i),b?.unmount(),a?.remove(),a=null,b=null}}}})]}})],editorProps:{attributes:{class:`chat-editor-content ${p?"chat-editor-compact":""}`,style:"color: var(--color-text);"},handleKeyDown:(a,b)=>{if("Enter"===b.key&&!b.shiftKey&&!b.isComposing){let b=m.getState(a.state);return!b?.active}return!1},handleDOMEvents:{paste:(a,b)=>{let c=b.clipboardData;if(!c)return!1;let d=[];if(c.items){for(let a of Array.from(c.items))if("file"===a.kind){let b=a.getAsFile();b&&d.push(b)}}if(d.length>0){b.preventDefault();let a=new DataTransfer;for(let b of d)a.items.add(b);return t.current?.(a.files),!0}return!1},dragover:(a,b)=>!!(b.dataTransfer?.types.includes("application/x-file-mention")||b.dataTransfer?.types.includes("Files"))&&(b.preventDefault(),b.dataTransfer.dropEffect="copy",!0),drop:(a,b)=>{let c=()=>{let a=b.target instanceof HTMLElement?b.target.closest("[data-chat-drop-target]"):null;a?.removeAttribute("data-drag-hover")},d=b.dataTransfer?.getData("application/x-file-mention");if(d){b.preventDefault(),b.stopPropagation(),c();try{let{name:a,path:b}=JSON.parse(d);a&&b&&v.current?.chain().focus().insertContent([{type:"chatFileMention",attrs:{label:a,path:b}},{type:"text",text:" "}]).run()}catch{}return!0}let e=b.dataTransfer?.files;return!!e&&e.length>0&&(b.preventDefault(),b.stopPropagation(),c(),t.current?.(e),!0)}}},onUpdate:({editor:a})=>{b?.(a.isEmpty)}});return(0,e.useEffect)(()=>{v.current=w??null},[w]),(0,e.useEffect)(()=>{if(!w)return;let a=a=>{if("Enter"===a.key&&!a.shiftKey&&!a.isComposing){let b=m.getState(w.state);if(b?.active)return;a.preventDefault();let{text:c,mentionedFiles:d}=D(w),e=w.getHTML();s.current(c,d,e),(c.trim()||d.length>0)&&w.commands.clearContent(!0),requestAnimationFrame(()=>w.commands.focus())}},b=w.view.dom;return b.addEventListener("keydown",a),()=>b.removeEventListener("keydown",a)},[w]),(0,e.useEffect)(()=>{w&&w.setEditable(!o)},[w,o]),(0,e.useImperativeHandle)(r,()=>({insertFileMention:(a,b)=>{w?.chain().focus().insertContent([{type:"chatFileMention",attrs:{label:a,path:b}},{type:"text",text:" "}]).run()},clear:()=>{w?.commands.clearContent(!0)},focus:()=>{w?.commands.focus()},isEmpty:()=>w?.isEmpty??!0,submit:()=>{if(!w)return;let{text:a,mentionedFiles:b}=D(w);if(a.trim()||b.length>0){let c=w.getHTML();s.current(a,b,c),w.commands.clearContent(!0),requestAnimationFrame(()=>w.commands.focus())}},setText:a=>{w?.commands.setContent(a),w?.commands.focus("end")},appendText:a=>{if(!w)return;let b=a.trim();if(!b)return;let{text:c}=D(w),d=c.trim().length>0?" ":"";w.chain().focus("end").insertContent(`${d}${b}`).run()}})),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.$Z,{editor:w}),(0,d.jsx)("style",{children:`
|
|
219
219
|
.chat-editor-content {
|
|
220
220
|
outline: none;
|
|
221
221
|
min-height: ${p?"16px":"28px"};
|