wizards 0.2.20 → 0.2.22
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/runtime/dist/authoring/guide.js +32 -4
- package/apps/runtime/dist/engine/prepare.js +37 -2
- package/apps/runtime/dist/engine/requirements.js +22 -1
- package/apps/runtime/dist/engine/runner.js +7 -1
- package/apps/runtime/dist/engine/steps.js +8 -1
- package/apps/runtime/dist/engine/template.js +8 -0
- package/apps/runtime/dist/files/storage.js +8 -1
- package/apps/runtime/dist/film/project.js +195 -0
- package/apps/runtime/dist/film/skills.js +91 -0
- package/apps/runtime/dist/film/sounds.js +122 -0
- package/apps/runtime/dist/film/step.js +286 -0
- package/apps/runtime/dist/film/tools.js +99 -0
- package/apps/runtime/dist/index.js +2 -1
- package/apps/runtime/dist/media/transcribe.js +150 -0
- package/apps/runtime/dist/models.js +109 -2
- package/apps/runtime/dist/render/downloads.js +1 -1
- package/apps/runtime/dist/widgets/render.js +20 -3
- package/apps/runtime/dist/widgets/runtime.js +2 -1
- package/apps/runtime/dist/widgets/step.js +16 -0
- package/apps/web/dist/assets/Account-DBtSpuEQ.js +1 -0
- package/apps/web/dist/assets/{ChangelogDialog-BBmJedTW.js → ChangelogDialog-BlFyzslp.js} +1 -1
- package/apps/web/dist/assets/{ChatPanel-Bi3tnxOD.js → ChatPanel-ofw0p02m.js} +1 -1
- package/apps/web/dist/assets/{CreditsDialog-C_lMgenE.js → CreditsDialog-CMa3Igqt.js} +1 -1
- package/apps/web/dist/assets/EditorPage-D2v_Levn.js +2 -0
- package/apps/web/dist/assets/{FlowPreview-DBroqouz.js → FlowPreview-DkdzInU8.js} +1 -1
- package/apps/web/dist/assets/{Harness-Dkw5Zldw.js → Harness-Dkn6KCJV.js} +2 -2
- package/apps/web/dist/assets/{HomePage-D9f7DKEw.js → HomePage-Dd-y_p7u.js} +1 -1
- package/apps/web/dist/assets/{ImportWizard-Br-Ys-Np.js → ImportWizard-C3OT94hv.js} +1 -1
- package/apps/web/dist/assets/LocalRuntime-BkRQm0GM.js +1 -0
- package/apps/web/dist/assets/NewWizardPage--DdPF3l9.js +2 -0
- package/apps/web/dist/assets/ProjectPage-CsoEkwhy.js +5 -0
- package/apps/web/dist/assets/PublicRunner-BVPl_WNQ.js +1 -0
- package/apps/web/dist/assets/RunnerView-C6mpXHeH.js +70 -0
- package/apps/web/dist/assets/SettingsPage-BhM74zXG.js +1 -0
- package/apps/web/dist/assets/{SetupPage-GWL_IhbR.js → SetupPage-yfG5gOaZ.js} +1 -1
- package/apps/web/dist/assets/SharePage-C5Vy5zJy.js +1 -0
- package/apps/web/dist/assets/{api-Byy4NRvQ.js → api-C-JIx8M5.js} +2 -2
- package/apps/web/dist/assets/changelog-CyoGUe5a.js +1 -0
- package/apps/web/dist/assets/definition-BznNdlhf.js +55 -0
- package/apps/web/dist/assets/{esm-WstF63Ly.js → esm-BpXlr_Mv.js} +1 -1
- package/apps/web/dist/assets/image-CC_2mJd6.js +1 -0
- package/apps/web/dist/assets/index-Bb5l3tTJ.js +10 -0
- package/apps/web/dist/assets/meta-C-2h0-O5.js +1 -0
- package/apps/web/dist/assets/{settings-menu-GUFlmH3n.js → settings-menu-DK8T02Tt.js} +1 -1
- package/apps/web/dist/assets/ui-Djd0WhVb.js +1 -0
- package/apps/web/dist/assets/volume-2-DE67_rue.js +1 -0
- package/apps/web/dist/index.html +3 -3
- package/apps/web/dist/mcp/flow.html +43 -43
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +146 -0
- package/node_modules/@engenty-wizards/shared/dist/definition.js +101 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.js +3 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace.d.ts +6 -1
- package/node_modules/@engenty-wizards/shared/dist/marketplace.js +12 -0
- package/node_modules/@engenty-wizards/shared/dist/run.d.ts +30 -0
- package/node_modules/@engenty-wizards/shared/dist/run.js +18 -0
- package/package.json +1 -1
- package/apps/web/dist/assets/Account-0f8W571o.js +0 -1
- package/apps/web/dist/assets/EditorPage-2-DypFBB.js +0 -2
- package/apps/web/dist/assets/LocalRuntime-CbA3kdFH.js +0 -1
- package/apps/web/dist/assets/NewWizardPage-Cvt9fKwq.js +0 -2
- package/apps/web/dist/assets/ProjectPage-CWn7fwSr.js +0 -5
- package/apps/web/dist/assets/PublicRunner-DFUM0aP5.js +0 -1
- package/apps/web/dist/assets/RunnerView-BAmePlD3.js +0 -70
- package/apps/web/dist/assets/SettingsPage-CLLlnzeS.js +0 -1
- package/apps/web/dist/assets/SharePage-DZzIMn0m.js +0 -1
- package/apps/web/dist/assets/changelog-DMAoeotb.js +0 -1
- package/apps/web/dist/assets/definition-Dp0DR2D6.js +0 -55
- package/apps/web/dist/assets/image-BShbErBm.js +0 -1
- package/apps/web/dist/assets/index-udMtduDM.js +0 -10
- package/apps/web/dist/assets/meta-CUWuppZ0.js +0 -1
- package/apps/web/dist/assets/ui-CwU0VR_B.js +0 -1
- package/apps/web/dist/assets/volume-2-Bp2tyaKE.js +0 -1
|
@@ -112,7 +112,7 @@ Boolean requesting whether a visible border and background is provided by the ho
|
|
|
112
112
|
- omitted: host decides border`)}),H({method:q(`ui/request-display-mode`),params:H({mode:ng.describe(`The display mode being requested.`)})});var yg=H({mode:ng.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),bg=W([q(`model`),q(`app`)]).describe(`Tool visibility scope - who can access the tool.`);H({resourceUri:L().optional(),visibility:V(bg).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
113
113
|
- "model": Tool visible to and callable by the agent
|
|
114
114
|
- "app": Tool callable by the app from this server only`),csp:Pc().optional(),permissions:Pc().optional()}),H({mimeTypes:V(L()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),H({method:q(`ui/download-file`),params:H({contents:V(W([dd,fd])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),H({method:q(`ui/message`),params:H({role:q(`user`).describe(`Message role, currently only "user" is supported.`),content:V(pd).describe(`Message content blocks (text, image, etc.).`)})}),H({method:q(`ui/notifications/sandbox-resource-ready`),params:H({html:L().describe(`HTML content to load into the inner iframe.`),sandbox:L().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:sg.optional().describe(`CSP configuration from resource metadata.`),permissions:cg.optional().describe(`Sandbox permissions from resource metadata.`)})});var xg=H({method:q(`ui/notifications/tool-result`),params:Sd.describe(`Standard MCP tool execution result.`)}),Sg=H({toolInfo:H({id:ql.optional().describe(`JSON-RPC id of the tools/call request.`),tool:yd.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:tg.optional().describe(`Current color theme preference.`),styles:pg.optional().describe(`Style configuration for theming the app.`),displayMode:ng.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:V(ng).optional().describe(`Display modes the host supports.`),containerDimensions:W([H({height:R().describe(`Fixed container height in pixels.`)}),H({maxHeight:W([R(),Dc()]).optional().describe(`Maximum container height in pixels.`)})]).and(W([H({width:R().describe(`Fixed container width in pixels.`)}),H({maxWidth:W([R(),Dc()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
115
|
-
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:L().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:L().optional().describe(`User's timezone in IANA format.`),userAgent:L().optional().describe(`Host application identifier.`),platform:W([q(`web`),q(`desktop`),q(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:H({touch:z().optional().describe(`Whether the device supports touch input.`),hover:z().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:H({top:R().describe(`Top safe area inset in pixels.`),right:R().describe(`Right safe area inset in pixels.`),bottom:R().describe(`Bottom safe area inset in pixels.`),left:R().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),Cg=H({method:q(`ui/notifications/host-context-changed`),params:Sg.describe(`Partial context update containing only changed fields.`)});H({method:q(`ui/update-model-context`),params:H({content:V(pd).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:G(L(),B().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),H({method:q(`ui/initialize`),params:H({appInfo:ou.describe(`App identification (name and version).`),appCapabilities:vg.describe(`Features and capabilities this app provides.`),protocolVersion:L().describe(`Protocol version this app supports.`)})});var wg=H({protocolVersion:L().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:ou.describe(`Host application identification and version.`),hostCapabilities:_g.describe(`Features and capabilities provided by the host.`),hostContext:Sg.describe(`Rich context about the host environment.`)}).passthrough(),Tg={target:`draft-2020-12`};async function Eg(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](Tg);throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Dg(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}function Og(e,t){let n={...e,...t};return t.experimental!==void 0&&(n.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(n.tools={...e.tools,...t.tools}),n}var kg=class e extends Ch{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new Jh;_methods=new Yh;setRequestHandler=(...e)=>{let[t,...n]=Zh(`request`,e)??e;this._methods.claim(t,`setRequestHandler`),super.setRequestHandler.call(this,t,...n)};setNotificationHandler=(...e)=>{let[t,...n]=Zh(`notification`,e)??e;this._methods.claim(t,`setNotificationHandler`),super.setNotificationHandler.call(this,t,...n)};removeRequestHandler=e=>{this._methods.release(e),super.removeRequestHandler(e)};removeNotificationHandler=e=>{this._methods.release(e),super.removeNotificationHandler(e)};replaceRequestHandler=(e,...t)=>{this._methods.replace(e),super.setRequestHandler.call(this,e,...t)};_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:lg,toolinputpartial:ug,toolresult:xg,toolcancelled:dg,hostcontextchanged:Cg};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.setHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.addEventListener(e,t)}removeEventListener(e,t){this._events.removeEventListener(e,t)}_ensureEventSlot(e){if(this._registeredEvents.has(e))return;let t=this.eventSchemas[e];if(!t)throw Error(`Unknown event: ${String(e)}`);this.setNotificationHandler(t.shape.method.value,{params:t.shape.params},t=>{let n=t;e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...n}),this._events.dispatch(e,n)}),this._registeredEvents.add(e)}getEventHandler(e){return this._events.getHandler(e)}warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._appCapabilities=t,this.options=n,this._methods.replace(`notifications/cancelled`),this._methods.replace(`notifications/progress`),!n.allowUnsafeEval&&dt({jitless:!0}),this.replaceRequestHandler(`ping`,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}buildContext(e){return e}registerAppCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._appCapabilities=Og(this._appCapabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._appCapabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await Dg(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await Dg(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await Eg(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await Eg(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(`ui/resource-teardown`,{params:mg.shape.params,result:hg},(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(`tools/call`,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(`tools/list`,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;default:return}}assertNotificationCapability(e){}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},t)}async createSamplingMessage(e,t){return this._assertInitialized(`createSamplingMessage`),await this.request({method:`sampling/createMessage`,params:e},t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},og,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},eu,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},ig,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},ag,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},yg,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new eg(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1;try{await super.connect(e);let n=await this.request({method:`ui/initialize`,params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:$h}},wg,t);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);this._hostCapabilities=n.hostCapabilities,this._hostInfo=n.hostInfo,this._hostContext=n.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}},Ag=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function jg(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Ag(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Mg=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},Ng=e=>{let t=Mg(e);return t.charAt(0).toUpperCase()+t.slice(1)},Pg=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Fg={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Ig(e){return e!=null}function Lg(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Fg.width,a=e.size??e.height??Fg.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Pg(...c):Pg(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Fg[`stroke-width`])*Number(e.size??e.width??Fg.width)/Number(t.size??t.width??Fg.width):t.strokeWidth??Fg[`stroke-width`];return[`svg`,{...Object.entries(Fg).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Ig(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Ig(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Ig(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Rg(e,t={}){return Lg(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var zg=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Bg=(0,y.createContext)({}),Vg=()=>(0,y.useContext)(Bg),Hg=(0,y.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=Vg()??{},b=!!c||zg(d),[x,S,C=[]]=Rg(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Pg(v,s),hasA11yProp:b,attributes:d});return(0,y.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Y(e,t=[],n=[]){let r=typeof e==`string`?jg(e,t,n):e,i=(0,y.forwardRef)(({className:e,...t},n)=>(0,y.createElement)(Hg,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Ng(r.name)),i}var Ug={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};Ug.node;var Wg=Y(Ug),Gg={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};Gg.node;var Kg=Y(Gg),qg={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};qg.node;var Jg=Y(qg),Yg={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};Yg.node;var Xg=Y(Yg),Zg={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Zg.node;var Qg=Y(Zg),$g={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};$g.node;var e_=Y($g),t_={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};t_.node;var n_=Y(t_),r_={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};r_.node;var i_=Y(r_),a_={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};a_.node;var o_=Y(a_),s_={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};s_.node;var c_=Y(s_),l_={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};l_.node;var u_=Y(l_),d_={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};d_.node;var f_=Y(d_),p_={name:`corner-down-left`,size:24,node:[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]};p_.node;var m_=Y(p_),h_={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};h_.node;var g_=Y(h_),__={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};__.node;var v_=Y(__),y_={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};y_.node;var b_=Y(y_),x_={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};x_.node;var S_=Y(x_),C_={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};C_.node;var w_=Y(C_),T_={name:`file-headphone`,size:24,node:[[`path`,{d:`M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343`,key:`1vfytu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0`,key:`1etmh7`}]],aliases:[`file-audio`,`file-audio-2`]};T_.node;var E_=Y(T_),D_={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};D_.node;var O_=Y(D_),k_={name:`film`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]};k_.node;var A_=Y(k_),j_={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};j_.node;var M_=Y(j_),N_={name:`flashlight-off`,size:24,node:[[`path`,{d:`M11.652 6H18`,key:`voqkpr`}],[`path`,{d:`M12 13v1`,key:`176q98`}],[`path`,{d:`M16 16v4a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V6`,key:`dzyf92`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M7.649 2H17a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8a4 4 0 0 0-.55 1.007`,key:`1hvcfn`}]]};N_.node;var P_=Y(N_),F_={name:`flashlight`,size:24,node:[[`path`,{d:`M12 13v1`,key:`176q98`}],[`path`,{d:`M17 2a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8A4 4 0 0 0 16 12v8a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V3a1 1 0 0 1 1-1z`,key:`17vh7j`}],[`path`,{d:`M6 6h12`,key:`n6hhss`}]]};F_.node;var I_=Y(F_),L_={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};L_.node;var R_=Y(L_),z_={name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};z_.node;var B_=Y(z_),V_={name:`image-up`,size:24,node:[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19.5 3-3 3 3`,key:`9vmjn0`}],[`path`,{d:`M17 22v-5.5`,key:`1aa6fl`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};V_.node;var H_=Y(V_),U_={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};U_.node;var W_=Y(U_),G_={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};G_.node;var K_=Y(G_),q_={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};q_.node;var J_=Y(q_),Y_={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Y_.node;var X_=Y(Y_),Z_={name:`locate-fixed`,size:24,node:[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Z_.node;var Q_=Y(Z_),$_={name:`lock-keyhole`,size:24,node:[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]};$_.node;var ev=Y($_),tv={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};tv.node;var nv=Y(tv),rv={name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]};rv.node;var iv=Y(rv),av={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};av.node;var ov=Y(av),sv={name:`mic`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]};sv.node;var cv=Y(sv),lv={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};lv.node;var uv=Y(lv),dv={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};dv.node;var fv=Y(dv),pv={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};pv.node;var mv=Y(pv),hv={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};hv.node;var gv=Y(hv),_v={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};_v.node;var vv=Y(_v),yv={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};yv.node;var bv=Y(yv),xv={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};xv.node;var Sv=Y(xv),Cv={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Cv.node;var wv=Y(Cv),Tv={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Tv.node;var Ev=Y(Tv),Dv={name:`scan-line`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}]]};Dv.node;var Ov=Y(Dv),kv={name:`scan`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]};kv.node;var Av=Y(kv),jv={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};jv.node;var Mv=Y(jv),Nv={name:`share`,size:24,node:[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]};Nv.node;var Pv=Y(Nv),Fv={name:`shield-check`,size:24,node:[[`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`}]]};Fv.node;var Iv=Y(Fv),Lv={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};Lv.node;var Rv=Y(Lv),zv={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};zv.node;var Bv=Y(zv),Vv={name:`switch-camera`,size:24,node:[[`path`,{d:`M11 19H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5`,key:`mtk2lu`}],[`path`,{d:`M13 5h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-5`,key:`120jsl`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m18 22-3-3 3-3`,key:`kgdoj7`}],[`path`,{d:`m6 2 3 3-3 3`,key:`1fnbkv`}]]};Vv.node;var Hv=Y(Vv),Uv={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Uv.node;var Wv=Y(Uv),Gv={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Gv.node;var Kv=Y(Gv),qv={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};qv.node;var Jv=Y(qv),Yv={name:`unplug`,size:24,node:[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]};Yv.node;var Xv=Y(Yv),Zv={name:`video`,size:24,node:[[`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`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]};Zv.node;var Qv=Y(Zv),$v={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};$v.node;var ey=Y($v),ty={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};ty.node;var ny=Y(ty),ry={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};ry.node;var iy=Y(ry),ay,oy,sy,cy=o((()=>{ay={cobalt:`var(--engenty-cobalt, oklch(60% 0.23 262))`,amber:`var(--engenty-amber, oklch(82% 0.17 78))`,moss:`var(--engenty-moss, oklch(72% 0.22 145))`,rose:`var(--engenty-rose, oklch(64% 0.25 18))`,ember:`var(--engenty-ember, oklch(70% 0.21 42))`,teal:`var(--engenty-teal, oklch(74% 0.16 192))`,violet:`var(--engenty-violet, oklch(60% 0.25 300))`,magenta:`var(--engenty-magenta, oklch(65% 0.28 345))`,citron:`var(--engenty-citron, oklch(89% 0.2 118))`,slate:`var(--engenty-slate, oklch(66% 0.13 235))`},oy=[`round`,`drop`,`dome`,`flame`,`oval`],[...oy],sy={bean:`teal`,dome:`moss`,drop:`amber`,flame:`rose`,oval:`ember`,pebble:`slate`,round:`cobalt`,sprout:`citron`,tower:`violet`,wedge:`magenta`}}));function ly(e){return Math.max(...e.blobs.map(e=>e.r*Math.min(e.rx??1,e.ry??1)))}function uy(e){let t=new Float32Array(py*4);for(let n=0;n<py;n++){let r=e.blobs[n];if(!r){t[n*4]=1e4,t[n*4+1]=1e4,t[n*4+2]=0,t[n*4+3]=0;continue}t[n*4]=r.x,t[n*4+1]=r.y,t[n*4+2]=r.r*(r.rx??1),t[n*4+3]=r.r*(r.ry??1)}return t}function dy(e){let t=new Float32Array(my*4),n=new Float32Array(my*4);return e.extras?.forEach((e,r)=>{let i=r*4;switch(n[i]=hy[e.type],n[i+1]=e.alpha??1,e.type){case`ink-dot`:t.set([e.x,e.y,e.r,0],i);break;case`body-dot`:t.set([e.x,e.y,e.r,e.bob??0],i);break;case`arc`:t.set([e.cx,e.cy,e.r,e.half*Math.PI/180],i),n[i+2]=e.width,n[i+3]=+!!e.body;break;case`bar`:t.set([e.x,e.y,e.half,0],i),n[i+2]=e.width;break;case`wave`:t.set([e.x,e.y,e.len,e.amp],i),n[i+2]=e.width}}),{geometry:t,meta:n}}var fy,py,my,hy,gy=o((()=>{fy={round:{blobs:[{x:60,y:61,r:36,rx:1,ry:1.06}],extras:[{type:`body-dot`,x:97,y:34,r:6,alpha:.5,bob:3},{type:`body-dot`,x:106,y:24,r:3.5,alpha:.35,bob:3.5}],falloff:2.2,fur:9,period:3.6,eye:{x:68,y:58,r:8},shadowRx:26},drop:{blobs:[{x:60,y:70,r:30,rx:1,ry:.95},{x:60,y:40,r:20,rx:.85,ry:1.15},{x:60,y:22,r:9,rx:.7,ry:1}],extras:[{type:`wave`,x:48,y:76,len:24,amp:2,width:2.6}],falloff:1.7,fur:8.5,period:4.4,eye:{x:60,y:56,r:8},shadowRx:24},dome:{blobs:[{x:60,y:72,r:32,rx:1.02,ry:.82},{x:60,y:46,r:28,rx:1,ry:1}],extras:[{type:`bar`,x:46,y:85,half:5,width:2.4,alpha:.5},{type:`bar`,x:60,y:87,half:5,width:2.4,alpha:.5},{type:`bar`,x:74,y:85,half:5,width:2.4,alpha:.5},{type:`body-dot`,x:60,y:6,r:3,bob:2.5}],falloff:1.7,fur:9,period:3,eye:{x:60,y:54,r:8.5},shadowRx:27},flame:{blobs:[{x:60,y:80,r:22,rx:1,ry:.95},{x:60,y:54,r:19,rx:.95,ry:1.1},{x:60,y:30,r:12,rx:.72,ry:1.25},{x:60,y:16,r:5,rx:.6,ry:1.1}],extras:[{type:`arc`,cx:60,cy:45,r:32,half:39,width:3,alpha:.55,body:!0},{type:`ink-dot`,x:60,y:82,r:2.6}],falloff:1.6,fur:7.5,period:2.6,eye:{x:60,y:62,r:8},shadowRx:22},oval:{blobs:[{x:60,y:64,r:40,rx:1.06,ry:.76}],extras:[{type:`arc`,cx:60,cy:223,r:172,half:10.7,width:2.2,alpha:.45},{type:`arc`,cx:60,cy:261,r:191,half:10.3,width:2.2,alpha:.45}],falloff:2.2,fur:10,period:4,eye:{x:66,y:58,r:8},shadowRx:32},bean:{blobs:[{x:46,y:76,r:24},{x:74,y:54,r:22}],extras:[{type:`body-dot`,x:32,y:94,r:4,alpha:.4}],falloff:1.7,fur:9,period:3.8,eye:{x:70,y:58,r:8},shadowRx:26},pebble:{blobs:[{x:56,y:76,r:32,rx:1.3,ry:.66},{x:86,y:74,r:18,rx:1,ry:.7}],extras:[{type:`ink-dot`,x:42,y:76,r:3,alpha:.32},{type:`ink-dot`,x:56,y:86,r:2.2,alpha:.32},{type:`ink-dot`,x:86,y:80,r:2.6,alpha:.32}],falloff:1.8,fur:9.5,period:4.6,eye:{x:68,y:72,r:7.5},shadowRx:34},sprout:{blobs:[{x:60,y:74,r:28},{x:48,y:34,r:8,rx:.75,ry:1.15},{x:72,y:32,r:7,rx:.75,ry:1.15}],falloff:1.7,fur:8.5,period:3.2,eye:{x:60,y:68,r:8.5},shadowRx:26},tower:{blobs:[{x:60,y:86,r:19},{x:60,y:60,r:17},{x:60,y:36,r:14}],extras:[{type:`arc`,cx:60,cy:154,r:80,half:13,width:2.2,alpha:.4},{type:`arc`,cx:60,cy:187,r:99,half:11.7,width:2.2,alpha:.4}],falloff:1.6,fur:8,period:4,eye:{x:60,y:52,r:8},shadowRx:20},wedge:{blobs:[{x:44,y:84,r:20},{x:76,y:84,r:20},{x:60,y:48,r:14}],extras:[{type:`arc`,cx:60,cy:28,r:10,half:53,width:3,alpha:.5,body:!0}],falloff:1.7,fur:8.5,period:2.9,eye:{x:60,y:70,r:8},shadowRx:28}},py=Math.max(...Object.values(fy).map(e=>e.blobs.length)),my=Math.max(...Object.values(fy).map(e=>e.extras?.length??0)),hy={"ink-dot":1,"body-dot":2,arc:3,bar:4,wave:5}})),_y=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),vy=s(((e,t)=>{t.exports=_y()}));function yy(e,t){let n=1/0,r=-1/0;for(let i of fy[e].blobs){let e=i.r*(i.rx??1),a=i.r*(i.ry??1),o=(t-i.y)/a;if(Math.abs(o)>=1)continue;let s=e*Math.sqrt(1-o*o);n=Math.min(n,i.x-s),r=Math.max(r,i.x+s)}return[n,r]}function by(e){let{x:t,y:n,r}=fy[e].eye,i=r*1.45,a=r*.42,[o,s]=yy(e,n);return{band:r*.95,left:o,lens:i,outer:i+a/2,right:s,rim:a,x:t,y:n}}function xy({g:e}){let t=(t,n)=>n-t>1?(0,Cy.jsxs)(`g`,{children:[(0,Cy.jsx)(`rect`,{fill:wy,height:e.band,rx:e.band*.3,width:n-t,x:t,y:e.y-e.band/2}),(0,Cy.jsx)(`line`,{stroke:Ty,strokeDasharray:`1.6 1.6`,strokeWidth:.6,x1:t+1,x2:n-1,y1:e.y,y2:e.y})]}):null;return(0,Cy.jsxs)(`g`,{className:`e-goggles`,children:[t(e.left+1.5,e.x-e.outer+.5),t(e.x+e.outer-.5,e.right-1.5),(0,Cy.jsx)(`circle`,{cx:e.x,cy:e.y,fill:Oy,r:e.lens}),(0,Cy.jsx)(`circle`,{cx:e.x,cy:e.y,fill:`none`,r:e.lens,stroke:Ey,strokeWidth:e.rim}),(0,Cy.jsx)(`circle`,{cx:e.x,cy:e.y,fill:`none`,r:e.outer,stroke:Dy,strokeWidth:.7}),[45,135,225,315].map(t=>(0,Cy.jsx)(`circle`,{cx:e.x+Math.cos(t*Math.PI/180)*e.lens,cy:e.y+Math.sin(t*Math.PI/180)*e.lens,fill:Dy,r:.9},t)),(0,Cy.jsx)(`path`,{d:`M ${e.x-e.lens*.62} ${e.y-e.lens*.2} A ${e.lens*.66} ${e.lens*.66} 0 0 1 ${e.x-e.lens*.1} ${e.y-e.lens*.64}`,fill:`none`,opacity:.75,stroke:`#fff`,strokeLinecap:`round`,strokeWidth:1.3})]})}function Sy({kind:e}){return(0,Cy.jsx)(xy,{g:by(e)})}var Cy,wy,Ty,Ey,Dy,Oy,ky=o((()=>{gy(),Cy=vy(),wy=`oklch(40% 0.07 50)`,Ty=`oklch(30% 0.06 45)`,Ey=`oklch(74% 0.12 80)`,Dy=`oklch(55% 0.1 70)`,Oy=`oklch(88% 0.05 220 / 0.32)`}));function Ay(){zy=0;let e=window.innerHeight,t=!1;for(let n of Ly){let r=n.svg.getBoundingClientRect();if(r.bottom<-40||r.top>e+40)continue;let i=r.left+r.width*.5,a=r.top+r.height*.48,o=Ry.x-i,s=Ry.y-a,c=Math.hypot(o,s)||1,l=o/c,u=s/c,d=Math.min(r.width,r.height)*2.4,f=.35+Math.min(1,c/d)*.65,p=l*5.5*f,m=u*3.5*f,h=l*7*f+u*1.2*f;n.tx=Hy(n.tx,p,.16),n.ty=Hy(n.ty,m,.16),n.rot=Hy(n.rot,h,.14),n.lean&&n.lean.setAttribute(`transform`,`translate(${n.tx.toFixed(2)} ${n.ty.toFixed(2)}) rotate(${n.rot.toFixed(2)} 60 62)`),n.shadow&&(n.shadow.setAttribute(`cx`,(60-n.tx*.35).toFixed(2)),n.shadow.setAttribute(`opacity`,String(Math.max(.08,.14-Math.abs(n.ty)*.008))));let g=n.ex+l*n.max*f,_=n.ey+1+u*n.max*.9*f;n.px=Hy(n.px,g,.24),n.py=Hy(n.py,_,.24),n.pupil&&(n.pupil.setAttribute(`cx`,n.px.toFixed(2)),n.pupil.setAttribute(`cy`,n.py.toFixed(2))),n.glint&&(n.glint.setAttribute(`cx`,(n.px-2).toFixed(2)),n.glint.setAttribute(`cy`,(n.py-3.4).toFixed(2))),(Math.abs(n.tx-p)>.05||Math.abs(n.px-g)>.05)&&(t=!0)}(t||By-->0)&&(zy=requestAnimationFrame(Ay))}function jy(){By=48,zy||=requestAnimationFrame(Ay)}function My(e){Ry.x=e.clientX,Ry.y=e.clientY,jy()}function Ny(){Vy||typeof window>`u`||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||(Vy=!0,Ry.x=window.innerWidth*.62,Ry.y=window.innerHeight*.28,window.addEventListener(`pointermove`,My,{passive:!0}),jy())}function Py(){Ly.size>0||Vy&&(Vy=!1,window.removeEventListener(`pointermove`,My),zy&&=(cancelAnimationFrame(zy),0))}function Fy(e,t,n=!0){let r=(0,Iy.useRef)(t);r.current=t,(0,Iy.useEffect)(()=>{let t=e.current;if(!(t&&n)||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let{ex:i,ey:a,max:o=3.2}=r.current,s={svg:t,lean:t.querySelector(`.e-lean`),pupil:t.querySelector(`.e-pupil`),glint:t.querySelector(`.e-glint`),shadow:t.querySelector(`.e-shadow`),ex:i,ey:a,max:o,tx:0,ty:0,rot:0,px:i,py:a+1};return Ly.add(s),Ny(),jy(),()=>{Ly.delete(s),Py()}},[e,n,t.ex,t.ey,t.max])}var Iy,Ly,Ry,zy,By,Vy,Hy,Uy=o((()=>{Iy=u(f(),1),Ly=new Set,Ry={x:0,y:0},zy=0,By=0,Vy=!1,Hy=(e,t,n)=>e+(t-e)*n}));function Wy({ex:e,ey:t,max:n,ink:r,r:i,blink:a=`5.2s`}){let o=i*1.15;return(0,X.jsxs)(`g`,{className:`e-eye`,"data-ex":e,"data-ey":t,"data-max":n,children:[(0,X.jsx)(`ellipse`,{cx:e,cy:t,fill:`#fff`,rx:i,ry:o,children:(0,X.jsx)(`animate`,{attributeName:`ry`,dur:a,keyTimes:`0;0.92;0.95;1`,repeatCount:`indefinite`,values:`${o};${o};${i*.1};${o}`})}),(0,X.jsx)(`circle`,{className:`e-pupil`,cx:e,cy:t+1,fill:r,r:i*.48}),(0,X.jsx)(`circle`,{className:`e-glint`,cx:e-i*.25,cy:t-i*.3,fill:`#fff`,r:i*.18})]})}function Gy(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:ay.cobalt,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`3.6s`,repeatCount:`indefinite`,values:`M60 22 Q96 26 96 62 Q96 96 60 100 Q24 96 24 62 Q24 26 60 22 Z;M60 30 Q100 20 94 62 Q98 102 60 95 Q22 102 26 62 Q20 22 60 30 Z;M60 22 Q96 26 96 62 Q96 96 60 100 Q24 96 24 62 Q24 26 60 22 Z`})}),(0,X.jsx)(`circle`,{cx:`97`,cy:`34`,fill:ay.cobalt,opacity:`0.5`,r:`6`,children:(0,X.jsx)(`animate`,{attributeName:`cy`,dur:`3.6s`,repeatCount:`indefinite`,values:`34;28;34`})}),(0,X.jsx)(`circle`,{cx:`106`,cy:`24`,fill:ay.cobalt,opacity:`0.35`,r:`3.5`,children:(0,X.jsx)(`animate`,{attributeName:`cy`,begin:`0.4s`,dur:`3.6s`,repeatCount:`indefinite`,values:`24;17;24`})}),(0,X.jsx)(Wy,{blink:`5.2s`,ex:68,ey:58,ink:`oklch(18% 0.08 260)`,max:3.4,r:8})]})}function Ky(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:ay.amber,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`4.4s`,repeatCount:`indefinite`,values:`M60 16 Q90 34 90 66 Q90 96 60 98 Q30 96 30 66 Q30 34 60 16 Z;M50 20 Q92 30 88 66 Q92 98 60 96 Q28 98 32 66 Q26 36 50 20 Z;M70 20 Q94 36 90 66 Q88 98 60 96 Q32 98 32 66 Q30 30 70 20 Z;M60 16 Q90 34 90 66 Q90 96 60 98 Q30 96 30 66 Q30 34 60 16 Z`})}),(0,X.jsx)(Wy,{blink:`4.4s`,ex:60,ey:56,ink:`oklch(30% 0.10 60)`,max:3.2,r:8}),(0,X.jsx)(`path`,{d:`M48 76 Q54 72 60 76 Q66 80 72 76`,fill:`none`,stroke:`oklch(30% 0.10 55)`,strokeLinecap:`round`,strokeWidth:`2.6`})]})}function qy(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:ay.moss,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`3s`,repeatCount:`indefinite`,values:`M60 20 Q92 30 92 70 Q92 96 60 96 Q28 96 28 70 Q28 30 60 20 Z;M60 30 Q98 36 96 74 Q96 98 60 98 Q24 98 24 74 Q22 36 60 30 Z;M60 12 Q88 26 88 68 Q88 94 60 94 Q32 94 32 68 Q32 26 60 12 Z;M60 20 Q92 30 92 70 Q92 96 60 96 Q28 96 28 70 Q28 30 60 20 Z`})}),(0,X.jsx)(`path`,{d:`M46 90 L46 80 M60 92 L60 82 M74 90 L74 80`,opacity:`0.5`,stroke:`oklch(28% 0.10 155)`,strokeLinecap:`round`,strokeWidth:`2.4`}),(0,X.jsx)(`circle`,{cx:`60`,cy:`6`,fill:ay.moss,r:`3`,children:(0,X.jsx)(`animate`,{attributeName:`cy`,dur:`3s`,repeatCount:`indefinite`,values:`8;3;8`})}),(0,X.jsx)(Wy,{blink:`4.6s`,ex:60,ey:54,ink:`oklch(16% 0.08 160)`,max:3.4,r:8.5})]})}function Jy(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:ay.rose,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`2.6s`,repeatCount:`indefinite`,values:`M60 14 Q84 44 80 76 Q78 98 60 98 Q42 98 40 76 Q36 44 60 14 Z;M52 18 Q86 40 82 76 Q80 98 60 98 Q40 98 38 76 Q32 46 52 18 Z;M68 18 Q88 46 82 76 Q80 98 60 98 Q40 98 38 76 Q34 40 68 18 Z;M60 14 Q84 44 80 76 Q78 98 60 98 Q42 98 40 76 Q36 44 60 14 Z`})}),(0,X.jsx)(`path`,{d:`M40 20 Q60 6 80 20`,fill:`none`,opacity:`0.55`,stroke:ay.rose,strokeLinecap:`round`,strokeWidth:`3`,children:(0,X.jsx)(`animate`,{attributeName:`opacity`,dur:`2.6s`,repeatCount:`indefinite`,values:`0.55;0.15;0.55`})}),(0,X.jsx)(Wy,{blink:`3.8s`,ex:60,ey:62,ink:`oklch(22% 0.10 18)`,max:3.2,r:8}),(0,X.jsx)(`circle`,{cx:`60`,cy:`82`,fill:`oklch(22% 0.10 18)`,r:`2.6`})]})}function Yy(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:ay.ember,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M60 34 Q100 38 100 64 Q100 92 60 94 Q20 92 20 64 Q20 38 60 34 Z;M60 40 Q110 40 108 66 Q108 96 60 96 Q12 96 12 66 Q10 40 60 40 Z;M60 28 Q92 36 92 62 Q92 88 60 90 Q28 88 28 62 Q28 36 60 28 Z;M60 34 Q100 38 100 64 Q100 92 60 94 Q20 92 20 64 Q20 38 60 34 Z`})}),(0,X.jsxs)(`g`,{fill:`none`,opacity:`0.45`,stroke:`oklch(40% 0.16 30)`,strokeWidth:`2.2`,children:[(0,X.jsx)(`path`,{d:`M28 54 Q60 48 92 54`,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M28 54 Q60 48 92 54;M20 56 Q60 50 100 56;M32 52 Q60 46 88 52;M28 54 Q60 48 92 54`})}),(0,X.jsx)(`path`,{d:`M26 70 Q60 64 94 70`,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M26 70 Q60 64 94 70;M18 72 Q60 66 102 72;M30 68 Q60 62 90 68;M26 70 Q60 64 94 70`})})]}),(0,X.jsx)(Wy,{blink:`4.2s`,ex:66,ey:58,ink:`oklch(24% 0.10 30)`,max:3.2,r:8})]})}function Xy(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:ay.teal,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`3.8s`,repeatCount:`indefinite`,values:`M48 96 Q24 92 26 68 Q28 44 52 38 Q78 32 88 50 Q98 66 84 84 Q70 100 48 96 Z;M46 98 Q20 92 24 66 Q28 40 54 36 Q80 30 90 50 Q100 68 84 86 Q68 102 46 98 Z;M50 94 Q28 90 28 68 Q30 46 52 40 Q76 34 86 50 Q94 64 82 82 Q72 98 50 94 Z;M48 96 Q24 92 26 68 Q28 44 52 38 Q78 32 88 50 Q98 66 84 84 Q70 100 48 96 Z`})}),(0,X.jsx)(`circle`,{cx:`32`,cy:`94`,fill:ay.teal,opacity:`0.4`,r:`4`,children:(0,X.jsx)(`animate`,{attributeName:`cx`,dur:`3.8s`,repeatCount:`indefinite`,values:`32;27;32`})}),(0,X.jsx)(Wy,{blink:`4.8s`,ex:70,ey:58,ink:`oklch(18% 0.08 200)`,max:3.4,r:8})]})}function Zy(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:ay.slate,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`4.6s`,repeatCount:`indefinite`,values:`M60 96 Q20 96 18 78 Q16 60 46 56 Q78 52 98 62 Q110 72 104 86 Q98 96 60 96 Z;M60 98 Q14 98 14 78 Q14 58 46 54 Q80 50 102 62 Q114 74 106 88 Q98 98 60 98 Z;M60 94 Q26 94 22 78 Q20 62 46 58 Q76 54 94 62 Q106 70 100 84 Q94 94 60 94 Z;M60 96 Q20 96 18 78 Q16 60 46 56 Q78 52 98 62 Q110 72 104 86 Q98 96 60 96 Z`})}),(0,X.jsxs)(`g`,{fill:`oklch(30% 0.05 244)`,opacity:`0.32`,children:[(0,X.jsx)(`circle`,{cx:`42`,cy:`76`,r:`3`}),(0,X.jsx)(`circle`,{cx:`56`,cy:`86`,r:`2.2`}),(0,X.jsx)(`circle`,{cx:`86`,cy:`80`,r:`2.6`})]}),(0,X.jsx)(Wy,{blink:`5.6s`,ex:68,ey:72,ink:`oklch(20% 0.06 244)`,max:3,r:7.5})]})}function Qy(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`g`,{fill:ay.citron,children:[(0,X.jsx)(`ellipse`,{cx:`48`,cy:`34`,rx:`6`,ry:`10`,children:(0,X.jsx)(`animate`,{attributeName:`cy`,dur:`3.2s`,repeatCount:`indefinite`,values:`34;30;34`})}),(0,X.jsx)(`ellipse`,{cx:`72`,cy:`32`,rx:`5.5`,ry:`9`,children:(0,X.jsx)(`animate`,{attributeName:`cy`,begin:`0.5s`,dur:`3.2s`,repeatCount:`indefinite`,values:`32;28;32`})})]}),(0,X.jsx)(`path`,{fill:ay.citron,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`3.2s`,repeatCount:`indefinite`,values:`M60 100 Q28 98 28 72 Q28 46 60 44 Q92 46 92 72 Q92 98 60 100 Z;M60 102 Q24 100 24 72 Q24 42 60 40 Q96 42 96 72 Q96 100 60 102 Z;M60 98 Q32 96 32 72 Q32 50 60 48 Q88 50 88 72 Q88 96 60 98 Z;M60 100 Q28 98 28 72 Q28 46 60 44 Q92 46 92 72 Q92 98 60 100 Z`})}),(0,X.jsx)(Wy,{blink:`4.2s`,ex:60,ey:68,ink:`oklch(24% 0.09 108)`,max:3.4,r:8.5})]})}function $y(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:ay.violet,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M60 102 Q36 100 38 78 Q40 58 42 44 Q44 26 60 24 Q76 26 78 44 Q80 58 82 78 Q84 100 60 102 Z;M60 104 Q32 102 36 78 Q40 56 40 42 Q40 22 60 20 Q80 22 80 42 Q80 56 84 78 Q88 102 60 104 Z;M60 100 Q40 98 40 78 Q42 60 44 46 Q46 30 60 28 Q74 30 76 46 Q78 60 80 78 Q80 98 60 100 Z;M60 102 Q36 100 38 78 Q40 58 42 44 Q44 26 60 24 Q76 26 78 44 Q80 58 82 78 Q84 100 60 102 Z`})}),(0,X.jsxs)(`g`,{fill:`none`,opacity:`0.4`,stroke:`oklch(28% 0.10 308)`,strokeLinecap:`round`,strokeWidth:`2.2`,children:[(0,X.jsx)(`path`,{d:`M42 74 Q60 70 78 74`}),(0,X.jsx)(`path`,{d:`M40 88 Q60 84 80 88`})]}),(0,X.jsx)(Wy,{blink:`5s`,ex:60,ey:52,ink:`oklch(20% 0.09 308)`,max:3.2,r:8})]})}function eb(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:ay.magenta,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`2.9s`,repeatCount:`indefinite`,values:`M60 30 Q74 40 86 70 Q96 92 78 98 Q60 102 42 98 Q24 92 34 70 Q46 40 60 30 Z;M60 24 Q78 38 90 70 Q100 94 78 100 Q60 104 42 100 Q20 94 30 70 Q42 38 60 24 Z;M60 34 Q72 44 82 70 Q92 90 76 96 Q60 100 44 96 Q28 90 38 70 Q48 44 60 34 Z;M60 30 Q74 40 86 70 Q96 92 78 98 Q60 102 42 98 Q24 92 34 70 Q46 40 60 30 Z`})}),(0,X.jsx)(`path`,{d:`M52 22 Q60 14 68 22`,fill:`none`,opacity:`0.5`,stroke:ay.magenta,strokeLinecap:`round`,strokeWidth:`3`,children:(0,X.jsx)(`animate`,{attributeName:`opacity`,dur:`2.9s`,repeatCount:`indefinite`,values:`0.5;0.12;0.5`})}),(0,X.jsx)(Wy,{blink:`3.6s`,ex:60,ey:70,ink:`oklch(22% 0.10 345)`,max:3.2,r:8})]})}function tb({kind:e}){switch(e){case`drop`:return(0,X.jsx)(Ky,{});case`dome`:return(0,X.jsx)(qy,{});case`flame`:return(0,X.jsx)(Jy,{});case`oval`:return(0,X.jsx)(Yy,{});case`bean`:return(0,X.jsx)(Xy,{});case`pebble`:return(0,X.jsx)(Zy,{});case`sprout`:return(0,X.jsx)(Qy,{});case`tower`:return(0,X.jsx)($y,{});case`wedge`:return(0,X.jsx)(eb,{});default:return(0,X.jsx)(Gy,{})}}function nb({animated:e=!0,goggles:t=!1,kind:n=`round`,size:r=160,className:i}){let a=(0,rb.useRef)(null),o=ib[n],s=ab[n];return Fy(a,o,e),(0,rb.useEffect)(()=>{let t=a.current;if(!t)return;let n=typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(e&&!n){t.unpauseAnimations();return}t.pauseAnimations(),t.setCurrentTime(0)},[e]),(0,X.jsxs)(`svg`,{"aria-hidden":`true`,className:i,height:r,overflow:`visible`,ref:a,style:{display:`block`},viewBox:`0 0 120 120`,width:r,children:[(0,X.jsx)(`ellipse`,{className:`e-shadow`,cx:`60`,cy:s.cy,fill:`#000`,opacity:`0.14`,rx:s.rx,ry:`4.5`,children:(0,X.jsx)(`animate`,{attributeName:`rx`,dur:s.dur,repeatCount:`indefinite`,values:`${s.rx};${s.rx*.8};${s.rx}`})}),(0,X.jsxs)(`g`,{className:`e-lean`,children:[(0,X.jsx)(tb,{kind:n}),t?(0,X.jsx)(Sy,{kind:n}):null]})]})}var rb,X,ib,ab,ob=o((()=>{rb=u(f(),1),cy(),ky(),Uy(),X=vy(),ib={round:{ex:68,ey:58,max:3.4},drop:{ex:60,ey:56,max:3.2},dome:{ex:60,ey:54,max:3.4},flame:{ex:60,ey:62,max:3.2},oval:{ex:66,ey:58,max:3.2},bean:{ex:70,ey:58,max:3.4},pebble:{ex:68,ey:72,max:3},sprout:{ex:60,ey:68,max:3.4},tower:{ex:60,ey:52,max:3.2},wedge:{ex:60,ey:70,max:3.2}},ab={round:{cy:108,rx:26,dur:`3.6s`},drop:{cy:106,rx:24,dur:`4.4s`},dome:{cy:104,rx:27,dur:`3s`},flame:{cy:106,rx:22,dur:`2.6s`},oval:{cy:102,rx:32,dur:`4s`},bean:{cy:102,rx:26,dur:`3.8s`},pebble:{cy:102,rx:34,dur:`4.6s`},sprout:{cy:106,rx:26,dur:`3.2s`},tower:{cy:108,rx:20,dur:`4s`},wedge:{cy:106,rx:28,dur:`2.9s`}}}));cy(),ob();var Z=vy(),sb={batchDone:{de:`{done} von {total} fertig`,en:`{done} of {total} done`},editing:{de:`Bearbeitet {n} von {total}`,en:`Editing {n} of {total}`},filming:{de:`Dreht {n} von {total}`,en:`Filming {n} of {total}`},clipsRendering:{de:`{count} Clips werden gerendert – das dauert einige Minuten.`,en:`Rendering {count} clips – this takes a few minutes.`},videoRendering:{de:`Das Video wird gerendert – das dauert meist 1–3 Minuten.`,en:`Rendering the video – this usually takes 1–3 minutes.`},photo:{de:`Sieht sich Foto {n} von {total} an`,en:`Looking at photo {n} of {total}`},listen:{de:`Hört „{label}“ an …`,en:`Listening to “{label}” …`},listenFailed:{de:`„{label}“ konnte nicht verschriftlicht werden.`,en:`“{label}” could not be written down.`},filmCutting:{de:`Der Film wird geschnitten – das dauert etwa eine Minute.`,en:`Cutting the film – this takes about a minute.`},filmProgress:{de:`{pct} % geschnitten`,en:`{pct} % cut`},filmError:{de:`Der Film meldet: {detail}`,en:`The film reports: {detail}`},widgetError:{de:`Das Widget meldet einen Fehler: {detail}`,en:`The widget reports an error: {detail}`},mcpConnected:{de:`Verbunden mit {names}`,en:`Connected to {names}`},mcpUnreachable:{de:`MCP-Server nicht erreichbar: {detail}`,en:`MCP server unreachable: {detail}`},reads:{de:`Liest {name}`,en:`Reading {name}`},readsMany:{de:`Liest {count} Dokumente`,en:`Reading {count} documents`},opens:{de:`Öffnet {name}`,en:`Opening {name}`},clicks:{de:`Klickt im Browser`,en:`Clicking in the browser`},types:{de:`Tippt im Browser`,en:`Typing in the browser`},looksAtPage:{de:`Sieht sich die Seite an`,en:`Looking at the page`},waitsForSignIn:{de:`Wartet auf deine Anmeldung bei {name}`,en:`Waiting for you to sign in at {name}`},downloads:{de:`Lädt {name} herunter`,en:`Downloading {name}`},runs:{de:`Führt aus: {command}`,en:`Running: {command}`},python:{de:`Führt Python aus`,en:`Running Python`},drawing:{de:`Zeichnet ein Bild`,en:`Drawing an image`},writesPage:{de:`Schreibt die Seite „{title}“`,en:`Writing the page “{title}”`},searchesDocuments:{de:`Sucht in den Dokumenten: {query}`,en:`Searching the documents: {query}`},searchesKnowledge:{de:`Sucht in Wissen: {query} – {relevant} von {candidates} passen`,en:`Searching the knowledge: {query} – {relevant} of {candidates} fit`},listsKnowledge:{de:`Listet Wissen`,en:`Listing the knowledge`},searchesMail:{de:`Durchsucht {label}`,en:`Searching {label}`},savesReceipts:{de:`Speichert {count} Belege aus {label}`,en:`Saving {count} receipts from {label}`},remembers:{de:`Merkt sich {title}`,en:`Remembering {title}`},files:{de:`Legt {count} Dateien ab`,en:`Filing {count} files`}};function cb(e,t){let n=sb[e.code];return n?n[t].replace(/\{(\w+)\}/g,(t,n)=>e.params?.[n]===void 0?t:String(e.params[n])):``}var lb={"brand.tagline":`Wünsch dir was. Wir bauen deinen Wizard.`,"brand.sub":`Er führt dich Schritt für Schritt zum Ergebnis. Die KI erledigt die Arbeit.`,"auth.dev":`Dev-Login (lokal)`,"auth.legal":`Kein Passwort, keine Registrierung – du meldest dich mit einem bestehenden Konto an.`,"auth.signIn":`Anmelden oder Konto erstellen`,"auth.failed":`Die Anmeldung hat nicht geklappt. Bitte noch einmal versuchen.`,"auth.localLink":`Öffne den Link, den die App beim Start ausgegeben hat – er meldet dich an diesem Gerät an.`,"nav.account":`Konto & Guthaben`,"setup.keysInAccount":`API-Schlüssel für Skripte gehören zu deinem Konto. Du legst sie dort an und ziehst sie dort zurück.`,"setup.openAccount":`Konto öffnen`,"class.label":`Modell-Klasse`,"class.classifier":`Classifier`,"class.standard":`Standard`,"class.high":`High`,"class.highest":`Highest`,"class.image":`Bild`,"class.video":`Video`,"class.audio":`Audio`,"class.speech":`Sprachausgabe`,"class.classifier.hint":`Zuordnen, Ja/Nein, wenige Werte aus Text ziehen. Am günstigsten.`,"class.standard.hint":`Kurze Texte, eine API aufrufen, umformatieren.`,"class.high.hint":`Recherche mit Werkzeugen, lange Dokumente, Abwägen vieler Quellen.`,"class.highest.hint":`Schweres Abwägen oder Code. Mehrfach so teuer wie High.`,"class.effort":`Denkaufwand`,"class.effortAuto":`Automatisch`,"class.effort.low":`Niedrig`,"class.effort.medium":`Mittel`,"class.effort.high":`Hoch`,"estimate.step":`≈ {n} Credits, selten mehr als {high}`,"estimate.measured":`gemessen aus den letzten Läufen`,"estimate.formula":`geschätzt, wird nach fünf Läufen genauer`,"estimate.share":`Ein Lauf kostet etwa {run} Credits. Beim Tageslimit sind es höchstens {day} Credits am Tag.`,"local.title":`Modelle`,"local.accountWaiting":`Warte auf die Anmeldung im Browser …`,"local.accountFailed":`Der Konto-Dienst ist gerade nicht erreichbar.`,"local.accountExpired":`Die Anmeldung ist abgelaufen. Bitte neu anmelden.`,"local.sourceNeedsAccount":`Dafür brauchst du ein Konto.`,"local.toAccount":`Zu Einstellungen → Konto`,"local.sourceOwn":`Eigene Schlüssel`,"local.keys":`Schlüssel`,"local.keysHint":`Ein Schlüssel reicht. Schlüssel liegen im Schlüsselbund dieses Geräts, nie in der Datenbank.`,"local.keySet":`hinterlegt`,"local.keyEmpty":`nicht hinterlegt`,"local.keyRemove":`Entfernen`,"local.classes":`Modell je Klasse`,"local.classesHint":`Ein Schritt nennt nur die Klasse. Hier steht, welches Modell sie bedient, z. B. anthropic/claude-haiku-4.5, openai:gpt-5.4-mini oder ollama:qwen3.`,"local.save":`Speichern`,"local.saved":`Gespeichert`,"local.chat":`Der Chat im Studio antwortet über`,"local.chatModels":`Modell-Klasse Highest`,"local.chatClaude":`Claude-Abo (Claude Code)`,"local.subscription":`Mit dem Abo baut das auf diesem Gerät installierte Claude Code den Wizard – mit deiner Anmeldung dort. Läufe nutzen weiter Schlüssel oder Guthaben.`,"harness.hint":`Texte denkt das auf diesem Gerät installierte {name} – mit deinem {sub} und deiner Anmeldung dort. Kein Schlüssel nötig. Bilder, Videos und Audio brauchen weiter einen Schlüssel.`,"harness.hintImages":`Texte und Bilder macht das auf diesem Gerät installierte {name} – mit deinem {sub} und deiner Anmeldung dort. Kein Schlüssel nötig. Videos und Audio brauchen weiter einen Schlüssel.`,"harness.found":`{name} {version} gefunden`,"harness.missing":`{name} ist auf diesem Gerät nicht installiert.`,"harness.install":`Oder in deinem eigenen Terminal:`,"harness.installButton":`{name} installieren`,"harness.installing":`{name} wird im Terminal unten installiert – das dauert etwa eine Minute. Danach meldest du es an.`,"harness.installEnded":`Die Installation ist zu Ende, aber {name} ist nicht da. Was oben steht, sagt warum.`,"harness.appHere":`Die {app}-App ist auf diesem Computer: {name} meldet sich mit demselben {sub} an.`,"harness.notInstalled":`nicht installiert`,"harness.authSubscription":`Angemeldet mit deinem {sub}.`,"harness.authKey":`Angemeldet mit einem API-Schlüssel aus deiner Shell – nicht mit dem Abo. Melde dich hier an, damit es über dein {sub} läuft.`,"harness.authNone":`Noch nicht angemeldet.`,"harness.signIn":`Hier anmelden`,"harness.signingIn":`Die Anmeldung läuft im Terminal unten – dein Browser öffnet sich dafür. Das Terminal schließt sich, sobald die Anmeldung da ist.`,"harness.signInInteractive":`Unten startet {name}. Wähle dort die Anmeldung mit deinem {sub} und melde dich im Browser an. Das Terminal schließt sich, sobald die Anmeldung da ist.`,"harness.loginEnded":`Die Anmeldung wurde beendet, ohne dass {name} angemeldet ist.`,"harness.sub.claude":`Claude-Abo`,"harness.sub.codex":`ChatGPT-Abo`,"harness.sub.gemini":`Google-Konto`,"harness.sub.cursor":`Cursor-Abo`,"harness.desc.claude":`Mit deinem Claude-Abo – kein Schlüssel nötig.`,"harness.desc.codex":`Mit deinem ChatGPT-Abo – kein Schlüssel nötig.`,"harness.desc.gemini":`Mit deinem Google-Konto – kein Schlüssel nötig.`,"harness.desc.cursor":`Mit deinem Cursor-Abo – kein Schlüssel nötig.`,"harness.ready":`angemeldet`,"local.recheck":`Erneut prüfen`,"local.test":`Testen`,"local.testHint":`Ein kurzer Aufruf zeigt, ob der Weg zum Modell offen ist.`,"local.testOk":`Antwort in {s} s über {ref}: „{reply}“`,"local.testFailed":`Der Test hat nicht geklappt: {error}`,"models.groupCaps":`Fähigkeiten`,"models.groupAccess":`Zugänge`,"models.groupMore":`Weitere Anbieter`,"models.cap.text":`Text & Denken`,"models.cap.text.hint":`Schreibt, fasst zusammen, recherchiert und entscheidet – in fast jedem Schritt.`,"models.cap.image":`Bilder`,"models.cap.image.hint":`Erzeugt Bilder: Logos, Produktfotos, Illustrationen.`,"models.cap.video":`Videos`,"models.cap.video.hint":`Erzeugt kurze Clips aus Text oder aus einem Bild.`,"models.cap.speech":`Sprachausgabe`,"models.cap.speech.hint":`Liest Texte vor: Voice-over, Hörfassungen, Ansagen.`,"models.cap.listening":`Sprachnotizen`,"models.cap.listening.hint":`Versteht Gesprochenes und macht aus Sprachnotizen Text.`,"models.way.local":`Lokales Modell`,"models.way.credits":`Guthaben`,"models.way.creditsTeam":`Guthaben des Teams`,"models.way.none":`nicht eingerichtet`,"models.who":`Wer macht das?`,"models.optSubscription":`Dein Abo`,"models.optKey":`Eigener API Key`,"models.optLocal":`Lokales Modell`,"models.optLocalNote":`Ollama auf diesem Computer`,"models.noteIncluded":`im Abo enthalten`,"models.noteSignedOut":`nicht angemeldet`,"models.noteMissing":`nicht installiert`,"models.noteKey":`API Key hinterlegt`,"models.noteKeyShort":`Key`,"models.noteSignedIn":`angemeldet`,"models.noteShellKey":`API Key aus der Shell`,"models.optOther":`Sonst`,"models.optCreditsGroup":`engenty`,"models.noteNoKey":`API Key fehlt`,"models.noteNeedsAccount":`Konto nötig`,"models.notePerImage":`≈ {n} Credits je Bild`,"models.notePerSecond":`≈ {n} Credits je Sekunde`,"models.notePer1k":`≈ {n} Credits je 1000 Zeichen`,"models.notePerMinute":`≈ {n} Credits je Minute`,"models.creditsAuto":`engenty wählt: {model}`,"models.creditsAutoNone":`engenty wählt das Modell`,"models.creditsPickHint":`Abgerechnet in Credits – ohne eigenen API Key.`,"models.viaCredits":`{name} über engenty Guthaben`,"models.viaCreditsHint":`Ohne eigenen API Key, abgerechnet in Credits.`,"models.viaCreditsNeedsAccount":`Mit einem engenty-Konto, abgerechnet in Credits.`,"models.noteUsage":`Credits nach Verbrauch`,"models.model":`Modell`,"models.modelCustom":`Eigenes Modell …`,"models.textSimple":`Einfache Schritte`,"models.textDemanding":`Anspruchsvolle Schritte`,"models.perClass":`Je Klasse anpassen`,"models.manageKey":`API Key von {name}`,"models.key":`API Key`,"models.keyFor":`API Key von {name}`,"models.keyGet":`Key bei {name} holen`,"models.keySave":`Prüfen und speichern`,"models.keyStored":`API Key hinterlegt`,"models.keyNone":`Kein API Key`,"models.keyCheck":`Prüfen`,"models.keyReplace":`Ersetzen`,"models.keyRemove":`Entfernen`,"models.keyOk":`Der Key gilt.`,"models.keyBad":`Der Key wurde nicht angenommen.`,"models.keyWhereLocal":`Der Key bleibt auf diesem Gerät, nie in der Datenbank.`,"models.keyWhereCloud":`Der Key liegt verschlüsselt beim Team. Niemand sieht ihn wieder.`,"models.keyFallback":`Bis der Key da ist, springt das Guthaben ein.`,"models.uses":`Wofür`,"models.useFor":`Nutzen`,"models.inUse":`wird genutzt`,"models.try":`Ausprobieren`,"models.try.text":`Testen`,"models.try.image":`Probebild erzeugen`,"models.try.video":`Probeclip erzeugen`,"models.try.speech":`Probe anhören`,"models.try.listening":`Zuhören testen`,"models.tryCost":`Kostet wie ein echter Aufruf.`,"models.tryCostVideo":`Ein Clip von 4 Sekunden – kostet wie ein echter.`,"models.tryWait":`Wird erzeugt …`,"models.tryWaitVideo":`Ein Clip dauert ein bis zwei Minuten …`,"models.tryOk":`In {s} s mit {model}`,"models.tryHeard":`Gehört: „{text}“`,"models.tryHeardNothing":`Nichts gehört – der Weg ist offen.`,"models.tryFailed":`Hat nicht geklappt: {error}`,"models.creditsName":`engenty Guthaben`,"models.creditsTeam":`Guthaben des Teams`,"models.creditsLocalLead":`Springt ein, wo kein Abo und kein eigener API Key eingerichtet ist.`,"models.creditsCloudHint":`Alles ohne eigenen API Key läuft über das Guthaben. Eigene Keys gehen vor und kosten keine Credits.`,"models.creditsConnectTitle":`Mit einem Konto`,"models.creditsLocalHint":`Mit einem engenty-Konto springt das Guthaben ein, wo nichts Eigenes eingerichtet ist – etwa für Videos ohne eigenen API Key.`,"models.creditsConnect":`Konto verbinden`,"models.creditsFallback":`Guthaben springt ein`,"models.creditsFallbackOn":`Was kein Abo und keinen eigenen API Key hat, läuft über das Guthaben.`,"models.creditsFallbackOff":`Aus: Was kein Abo und keinen eigenen API Key hat, läuft nicht.`,"models.creditsOn":`Läuft über das Guthaben`,"models.creditsNone":`Gerade läuft nichts über das Guthaben.`,"models.creditsTopUp":`Aufladen`,"models.creditsPicks":`engenty wählt das Modell und rechnet in Credits ab.`,"models.creditsModel":`Gerade: {model}.`,"models.clientSignIn":`Anmeldung`,"models.clientImages":`{name} erzeugt Bilder mit deinem {sub} – ohne eigenen API Key.`,"models.clientNotChosen":`Text läuft gerade nicht über {name}.`,"models.ollamaHint":`Adresse von Ollama und das Modell, das dort läuft.`,"models.readOnly":`Nur Admins des Teams ändern die Modelle.`,"models.viewAs":`Vorschau als`,"models.view.auto":`wie es ist`,"models.view.local":`lokal`,"models.view.linked":`lokal + Konto`,"models.view.cloud":`Cloud-Studio`,"setup.title":`Setup`,"setup.sub":`Engenty kann deine vorhandenen Konten auf deinem Computer nutzen.`,"setup.source":`Womit soll die Engenty denken?`,"setup.local":`Läuft lokal auf diesem Gerät.`,"setup.stage.connect":`Verbinden`,"setup.stage.test":`Testen`,"setup.stage.done":`Fertig`,"setup.h.install":`Installiere {name}`,"setup.h.signIn":`Melde {name} an`,"setup.h.keys":`Trage einen Schlüssel ein`,"setup.h.test":`Ein kurzer Test`,"setup.h.done":`Verbunden.`,"setup.ready":`Alles bereit.`,"setup.noHarness":`Noch kein KI-Client installiert. Wähle einen – er wird hier installiert – oder trage eigene Schlüssel ein.`,"setup.ownDesc":`AI Gateway, OpenAI, Anthropic oder Ollama.`,"setup.recommended":`Empfohlen`,"setup.done":`Zum Studio`,"setup.untilWorks":`Das Studio öffnet sich, sobald der Test klappt.`,"cloud.onPublish":`Sobald du den Wizard veröffentlichst, geht die Version auch in die Cloud deines Kontos und läuft dort hinter einem eigenen Link.`,"cloud.notSent":`Diese Version ist noch nicht in der Cloud.`,"cloud.send":`Jetzt senden`,"cloud.resend":`Erneut senden`,"cloud.again":`Um {when} wird es noch einmal versucht.`,"cloud.sent":`Version {v} · gesendet am {when}`,"cloud.notRunnable":`Version {v} läuft in der Cloud nicht.`,"cloud.keepsRunning":`Dort läuft weiter Version {v}.`,"cloud.nothingRuns":`Dort läuft deshalb noch nichts.`,"cloud.notes":`Was in der Cloud anders läuft:`,"cloud.check":`Was dem jetzigen Stand in der Cloud fehlen würde:`,"cloud.checkBlocking":`So, wie der Wizard jetzt ist, würde er in der Cloud nicht laufen:`,"cloud.documents":`Die Dokumente des Space bleiben auf diesem Gerät. In der Cloud arbeiten die Schritte ohne sie.`,"cloud.stepName":`„{title}“`,"cloud.problem.sandbox":`Der Server hat keine Maschine für Code. Dort läuft das ohne sie.`,"cloud.problem.mcp":`Die MCP-Server des Space gibt es auf dem Server nicht: {detail}.`,"cloud.problem.model":`Dafür gibt es in der Cloud kein Modell.`,"cloud.problem.connector":`Dem Space fehlt in der Cloud ein Connector.`,"cloud.problem.invalid":`So nimmt der Server den Wizard nicht an.`,"cloud.spaceLimit":`In der Cloud deines Kontos liegt schon der Space einer anderen Installation:`,"cloud.replace":`Bisherigen Space ersetzen`,"cloud.replaceConfirm":`Den bisherigen Space aus der Cloud entfernen? Seine Wizards und ihre Links verschwinden dort. Danach wird gesendet, was hier veröffentlicht ist.`,"cloud.noticeError":`Hier veröffentlicht. In der Cloud ist diese Version nicht angekommen – mehr dazu unten.`,"cloud.noticeNotRunnable":`Hier veröffentlicht. In der Cloud läuft diese Version nicht – mehr dazu unten.`,"readonly.wizard":`Dieser Wizard kommt aus deiner lokalen Installation und wird dort geändert. Hier läuft, was du dort veröffentlichst.`,"readonly.project":`Dieser Space kommt aus deiner lokalen Installation und wird dort geändert.`,"readonly.server":`Auf diesem Server wird nichts gebaut. Hier laufen die Wizards, die deine lokale Installation veröffentlicht.`,"nav.wizards":`Wizards`,"nav.settings":`Einstellungen`,"nav.project":`Space`,"account.title":`Konto`,"account.hint":`Wie dich die App nennt und wie man dich erreicht.`,"account.initials":`Dein Kürzel im Menü oben rechts: die Anfangsbuchstaben deines Namens.`,"account.name":`Name`,"account.nameHint":`Anfangs steht hier der Benutzername dieses Geräts.`,"account.fromAccount":`Name und E-Mail kommen aus deinem Konto.`,"account.about":`Über dich`,"account.aboutHint":`Wer du bist und was du machst.`,"account.email":`E-Mail`,"account.phone":`Telefon`,"account.connection":`engenty.ai`,"account.connectionHint":`Anmeldung, Guthaben und die Cloud, in der deine Wizards für alle laufen.`,"account.profile":`Profil`,"account.local":`Lokale Installation`,"account.localText":`Diese App läuft auf deinem Gerät und ist mit keinem Konto verbunden. Wizards, Space und Dateien bleiben hier.`,"account.linked":`Verbunden`,"account.with":`Mit einem Konto`,"account.withCredits":`Guthaben für die Modelle, wo kein KI-Client installiert ist. Kein API Key nötig.`,"account.withCloud":`Was du veröffentlichst, läuft auch auf engenty.ai – hinter einem öffentlichen Link, auch wenn dieses Gerät aus ist.`,"account.signIn":`Anmelden`,"account.signInAgain":`Neu anmelden`,"account.new":`Noch kein Konto?`,"account.newHint":`Ein neues Konto braucht einen Einladungscode. Trag ihn hier ein, dann steht er bei der Registrierung schon im Formular.`,"account.code":`Einladungscode`,"account.create":`Konto erstellen`,"account.credits":`Guthaben`,"account.topUp":`Aufladen`,"account.expires":`{n} Credits gültig bis {date}`,"account.kind.start":`Startguthaben`,"account.kind.monthly":`Monatsguthaben`,"account.kind.gift":`Geschenkt`,"account.cloud":`Was du hier veröffentlichst, läuft auch auf {host}.`,"account.look":`Darstellung`,"account.lookHint":`Sprache und Design der App in diesem Browser.`,"nav.logout":`Abmelden`,"nav.connected":`Verbunden mit {host}`,"nav.expired":`Anmeldung abgelaufen`,"nav.onlyHere":`Nur auf diesem Computer`,"nav.local":`lokal`,"nav.language":`Sprache`,"nav.theme":`Design`,"nav.credits":`{n} Credits`,"footer.billing":`Guthaben`,"footer.usage":`Verbrauch`,"footer.invoices":`Rechnungen`,"footer.account":`Konto`,"about.version":`Version {v}`,"about.update.available":`Version {v} von engenty wizards ist da.`,"about.update.install":`Aktualisieren`,"about.update.installing":`Version {v} wird installiert …`,"about.update.restarting":`Startet neu mit Version {v} …`,"about.update.done":`Installiert. Starte engenty wizards neu, um {v} zu nutzen.`,"about.update.failed":`Das Update ist fehlgeschlagen. Logs: logs/update.log`,"about.update.notes":`Was ist neu`,"about.changelog":`Changelog`,"about.changelogHint":`Was sich von Version zu Version geändert hat.`,"about.changelogEmpty":`Noch keine Einträge.`,"about.unreleased":`Noch nicht veröffentlicht`,"about.breaking":`breaking`,"about.credits":`Open Source`,"about.creditsHint":`engenty wizards und die Open-Source-Software, auf der es aufbaut.`,"about.creditsProduct":`engenty`,"about.creditsBuiltWith":`Gebaut mit`,"about.creditsDeps":`Direkte Abhängigkeiten`,"about.creditsDepsHint":`Was die Teile dieser App selbst einbinden, mit Version und Lizenz – ohne deren eigene Abhängigkeiten.`,"about.creditsShared":`Von mehreren Teilen genutzt`,"about.search":`Suchen …`,"about.noMatches":`Keine Treffer.`,"theme.dark":`Dunkles Design`,"theme.light":`Helles Design`,"home.title":`Deine Wizards`,"home.new":`Neuer Wizard`,"home.import":`Importieren`,"import.failed":`Import hat nicht geklappt`,"home.empty":`Noch keine Wizards in diesem Space.`,"home.live":`Live`,"home.draft":`Entwurf`,"where.here":`Lokal`,"where.hereVersion":`Lokal · Version {v}`,"where.hereHint":`Läuft nur auf diesem Computer, solange die App läuft.`,"where.liveHint":`Läuft auf {host} – für alle mit dem Link.`,"where.liveAt":`Live auf {host} · Version {v}`,"where.note":`1 Hinweis`,"where.notes":`{n} Hinweise`,"where.sending":`Wird gesendet`,"where.missing":`Nicht in der Cloud`,"home.steps":`{n} Schritte`,"home.newProject":`Neuer Space`,"home.projectName":`Name des Space`,"home.projectLimit":`Höchstens {n} Spaces`,"team.title":`Team`,"team.hint":`Wer im Team ist und auf welchem Paket es läuft. Eingeladen und verwaltet wird im Konto.`,"team.plan":`Paket`,"team.planFree":`Free`,"team.seats":`{taken} von {limit} Plätzen`,"team.seatsUnlimited":`Plätze ohne Limit`,"team.members":`Mitglieder`,"team.invited":`eingeladen`,"team.you":`du`,"team.manage":`Mitglieder verwalten`,"team.changePlan":`Paket ansehen`,"team.roles":`Inhaber und Admins legen Wizards und Spaces an und löschen sie; Mitglieder bearbeiten die Wizards, die es gibt.`,"team.memberNote":`Du bist Mitglied: Du bearbeitest Wizards, Admins legen neue an und löschen.`,"team.failed":`Das Team ließ sich nicht laden.`,"team.role.owner":`Inhaber`,"team.role.admin":`Admin`,"team.role.member":`Mitglied`,"models.ownKeysPlan":`Eigene API Keys gibt es ab dem Pro-Paket. Hier zahlen die Credits des Teams.`,"home.fromLocal":`Aus deiner lokalen Installation – geändert wird dort.`,"home.syncedAt":`Zuletzt angekommen: {when}.`,"home.local.title":`Hier laufen die Wizards aus deiner lokalen Installation`,"home.local.text":`Du baust auf deinem eigenen Computer. Was du dort veröffentlichst, läuft hier – für alle, hinter einem Link.`,"home.local.install":`Installiere engenty wizards auf deinem Computer:`,"home.local.signIn":`Melde dich dort unter Einstellungen → Konto mit diesem Konto an.`,"home.local.publish":`Veröffentliche einen Wizard. Er erscheint dann hier.`,"new.title":`Was soll dein Wizard können?`,"new.placeholder":`z. B. Kunden geben ihr Produkt und ihre Zielgruppe ein, der Wizard recherchiert Wettbewerber und erstellt daraus ein Positionierungs-Briefing als PDF.`,"new.build":`Wizard bauen`,"new.orStarter":`Oder beginne mit einer Vorlage`,"new.import":`Wizard-Paket importieren`,"new.hint":`Du kannst alles danach im Gespräch ändern.`,"editor.resize":`Breite ändern – Doppelklick setzt zurück`,"editor.resizeSheet":`Höhe ändern – Tippen klappt ein und aus`,"editor.export":`Als Paket exportieren (.wizard)`,"editor.chat":`Gespräch`,"editor.step":`Schritte`,"editor.runs":`Durchläufe`,"editor.reviewEditable":`bearbeitbar`,"editor.reviewRedo":`neu erstellbar`,"editor.otherwise":`sonst`,"editor.whenFilled":`{field} ausgefüllt`,"editor.whenEmpty":`{field} leer`,"tool.web_search":`Websuche`,"tool.web_fetch":`Webseiten lesen`,"tool.browser":`Browser`,"tool.sandbox":`Code & Shell`,"tool.image":`Bilder`,"tool.http":`API`,"tool.pages":`Seiten`,"editor.test":`Testen`,"editor.share":`Teilen`,"editor.publish":`Veröffentlichen`,"editor.published":`Live · Version {v}`,"editor.unpublishedChanges":`Änderungen nicht veröffentlicht`,"editor.notPublished":`Noch nicht veröffentlicht`,"editor.composer":`Beschreibe, was sich ändern soll …`,"editor.attach":`Dateien anhängen`,"editor.detach":`Entfernen`,"editor.attached":`Angehängt`,"editor.thread":`Verlauf`,"editor.voice":`Diktieren`,"editor.voiceStop":`Diktat beenden`,"editor.listening":`Ich höre zu …`,"editor.transcribing":`Wird verschriftlicht …`,"editor.micDenied":`Das Mikrofon ist für diese Seite nicht freigegeben.`,"editor.building":`Baue den Ablauf …`,"editor.files":`Dateien`,"files.explain":`Was dein Wizard bei jedem Durchlauf braucht: Widget-Code, Bibliotheken, Kartenumrisse, Preislisten. Der Assistent legt sie im Gespräch an – du kannst auch eigene hochladen.`,"files.upload":`Hochladen`,"files.count":`{n} Dateien · {size}`,"files.empty":`Noch keine Dateien. Zieh Dateien hierher oder bitte den Assistenten, ein Widget zu bauen.`,"files.download":`Herunterladen`,"files.delete":`Löschen`,"files.confirmDelete":`„{path}“ löschen?`,"files.none":`Dieser Wizard hat keine Dateien.`,"editor.thinking":`Denkt nach …`,"editor.chatBroken":`Die Verbindung ist abgebrochen. Was schon gebaut war, ist gespeichert – schick die Nachricht bitte noch einmal.`,"editor.issues":`Bevor du testest oder teilst, braucht der Wizard noch Korrekturen:`,"editor.fixWithChat":`Vom Assistenten beheben lassen`,"editor.models.blocking":`So kann der Wizard nicht starten. Es fehlen Modelle:`,"editor.models.optional":`Diese Schritte laufen so nicht. Wähle beim Testen einen Weg ohne sie oder richte die Modelle ein:`,"editor.models.settings":`Modelle einrichten`,"editor.prevStep":`Vorheriger Schritt`,"editor.nextStep":`Nächster Schritt`,"editor.deleteStep":`Schritt löschen`,"editor.moveUp":`Nach oben`,"editor.moveDown":`Nach unten`,"editor.noRuns":`Noch keine Durchläufe.`,"editor.restart":`Neu starten`,"editor.close":`Schließen`,"editor.chatHello":`Beschreibe mir, was dein Wizard tun soll. Ich baue den Ablauf und du siehst ihn links als Diagramm.`,"shareRun.button":`Teilen`,"shareRun.title":`Ergebnis teilen`,"shareRun.email":`E-Mail`,"shareRun.more":`Mehr …`,"shareRun.until":`Der Link ist bis {date} gültig.`,"shareRun.kept":`Der Link bleibt gültig, bis du ihn zurückziehst.`,"shareRun.withdraw":`Link zurückziehen`,"sharePage.gone":`Dieser Link ist abgelaufen oder wurde zurückgezogen.`,"sharePage.own":`Selbst ausprobieren`,"sharePage.until":`Geteilt · verfügbar bis {date}`,"sharePage.shared":`Geteilt am {date}`,"share.title":`Wizard teilen`,"share.link":`Link`,"share.copy":`Kopieren`,"share.copied":`Kopiert`,"share.enabled":`Link ist aktiv`,"share.limit":`Durchläufe pro Tag`,"share.rotate":`Neuen Link erzeugen`,"share.rotateHint":`Der alte Link funktioniert danach nicht mehr.`,"share.publishFirst":`Veröffentliche den Wizard, damit der Link funktioniert.`,"share.unpublished":`Deine Änderungen sind noch nicht veröffentlicht: der Link läuft mit der Version davor.`,"share.website":`Website`,"share.openHere":`Auf diesem Computer testen`,"share.settings":`Einstellungen`,"share.on":`aktiv`,"share.off":`aus`,"share.perDay":`{n} pro Tag`,"share.rotateCloud":`Der alte Link funktioniert danach nicht mehr – auch der in der Cloud.`,"share.others":`Mit anderen teilen`,"share.othersHint":`Mit einem Konto läuft der Wizard auch auf engenty.ai: ein Link, ein QR-Code und ein Tag für deine Website – für alle, auch wenn dein Computer aus ist.`,"share.details":`Details`,"teaser.website":`Eine Website braucht einen Link, den jeder erreicht. Mit einem Konto läuft der Wizard auch auf engenty.ai – dann steht hier der Tag für deine Seite.`,"teaser.qr":`Ein QR-Code braucht einen Link, den jedes Handy erreicht. Mit einem Konto läuft der Wizard auch auf engenty.ai – dann stehen hier der QR-Code und die ID für die App.`,"teaser.link":`Dieser Link geht nur auf diesem Computer, solange die App läuft. Mit einem Konto läuft der Wizard auch auf engenty.ai – mit einem Link für alle.`,"teaser.models":`Ohne eigenen API Key: mit einem Konto laufen Text, Bilder und Videos über Guthaben.`,"teaser.connect":`Konto verbinden`,"teaser.modelsLinked":`Oder über das Guthaben deines Kontos: unter Modelle „Guthaben des Kontos“ wählen.`,"share.open":`Öffnen`,"share.qr":`QR-Code`,"share.qrHint":`Mit der Kamera des Handys scannen: der Wizard öffnet sich, in der App engenty wizards, wenn sie installiert ist.`,"share.code":`ID für die App:`,"share.readOnly":`Ob der Link aktiv ist und wie viele Durchläufe er am Tag zulässt, stellst du in deiner lokalen Installation ein.`,"embed.inline":`In der Seite`,"embed.modal":`Button + Fenster`,"embed.inlineHint":`Füge das Tag in den HTML-Code deiner Seite ein. Der Wizard erscheint an dieser Stelle.`,"embed.modalHint":`Füge das Tag in den HTML-Code deiner Seite ein. An dieser Stelle erscheint ein Button, der den Wizard in einem Fenster öffnet.`,"type.page":`Seite`,"type.agent":`KI-Schritt`,"type.generate":`Erzeugen`,"type.widget":`Widget`,"type.review":`Prüfen`,"type.result":`Ergebnis`,"run.start":`Los geht's`,"run.closed":`Hier gerade nicht verfügbar, dafür fehlt: {list}`,"run.cls.text":`Text`,"run.cls.image":`Bilder`,"run.cls.video":`Videos`,"run.cls.speech":`Sprachausgabe`,"run.cls.audio":`Sprachnotizen`,"run.next":`Weiter`,"run.back":`Zurück`,"run.accept":`Passt so`,"run.regenerate":`Neue Variante`,"run.edit":`Bearbeiten`,"run.resume":`Letzten Durchlauf fortsetzen`,"run.regenerateNote":`Was soll anders werden?`,"run.pickItem":`Nr. {n}`,"run.pickedItem":`Nr. {n} neu`,"run.regeneratePicked":`Neu erstellt wird nur Nr. {n}.`,"run.regenerateAll":`Alle werden neu erstellt. Tippe oben auf eine Nummer, um nur einzelne zu erneuern.`,"check.progress":`{done} von {total} geprüft`,"check.onlyOpen":`Nur offene`,"check.noFile":`Zu dieser Zeile gibt es keine Datei.`,"check.noPreview":`Für diese Datei gibt es keine Vorschau – öffne sie mit dem Link oben.`,"check.reopen":`Wieder offen`,"market.search":`Vorlage suchen …`,"market.all":`Alle`,"market.industry":`Branche`,"market.format":`Ergebnis`,"market.capability":`Fähigkeit`,"market.unavailable":`nicht eingerichtet`,"market.without":`Geht auch ohne: {list}`,"market.optional":`nicht eingerichtet, geht auch ohne`,"market.optionalHint":`Läuft hier ohne {list}: Antworten, die das bräuchten, sind im Wizard gesperrt. Einrichten unter Modelle.`,"market.missing":`Hier nicht eingerichtet: {list}`,"market.missingHint":`Dafür fehlt hier ein Modell: {list}. Richte es unter Modelle ein.`,"market.none":`Keine Vorlage passt zu dieser Auswahl.`,"market.notFound":`Diese Vorlage gibt es nicht (mehr).`,"market.star":`Merken`,"market.starred":`Gemerkt`,"market.starHint":`Gemerkte Vorlagen liegen auf diesem Rechner auch ohne Verbindung bereit.`,"market.noneStarred":`Du hast noch keine Vorlage gemerkt.`,"market.offline":`Keine Verbindung zum Marktplatz: du siehst die Vorlagen, die hier bereitliegen.`,"market.more":`Mehr anzeigen`,"market.reset":`Auswahl zurücksetzen`,"market.count":`{n} Vorlagen`,"market.countOf":`{n} von {all} Vorlagen`,"market.countOfShort":`{n} von {all}`,"market.resetShort":`Zurücksetzen`,"market.minutes":`~ {n} Min.`,"market.credits":`~ {n} Credits pro Lauf`,"market.needsUpdate":`Braucht eine neuere App`,"market.needsUpdateHint":`Diese Vorlage nutzt Funktionen, die deine App noch nicht kennt. Aktualisiere die App, dann kannst du sie verwenden.`,"market.use":`Mit dieser Vorlage starten`,"market.steps":`So läuft der Wizard ab`,"market.duration":`Dauer`,"market.durationHint":`vom Start bis zum Ergebnis, mit {n} Angaben von dir`,"market.result":`Ergebnis`,"market.creditsRange":`~ {n} Credits`,"market.creditsHint":`pro Lauf geschätzt, selten mehr als das Doppelte`,"market.needs":`Braucht`,"market.cost":`Kosten`,"new.forWebsite":`Kleine Helfer für deine Website`,"run.feedbackPlaceholder":`Passt etwas nicht? Schreib, was anders sein soll …`,"run.feedbackTarget":`Was soll sich ändern?`,"run.feedbackPick":`Wähle oben, was sich ändern soll.`,"ai.generated":`KI-generiert`,"ai.modified":`Mit KI verändert`,"ai.publish":`Mit KI erstellt: Wer das veröffentlicht, muss es als KI-generiert kennzeichnen (EU AI Act, Art. 50). Die Datei trägt die Kennzeichnung bereits in ihren Metadaten.`,"run.regenerateGo":`Neu erstellen`,"run.retry":`Erneut versuchen`,"run.again":`Nochmal`,"run.download":`Herunterladen`,"run.copy":`Text kopieren`,"run.failed":`Da hat etwas nicht geklappt.`,"run.unavailable":`Dieser Wizard ist gerade nicht verfügbar.`,"run.notFound":`Diesen Wizard gibt es nicht (mehr).`,"run.madeWith":`Erstellt mit engenty wizards`,"run.working":`Einen Moment …`,"run.elapsed":`{s} s`,"run.cancelled":`Abgebrochen.`,"run.addRow":`Zeile hinzufügen`,"run.upload":`Datei wählen oder hierher ziehen`,"run.uploading":`Lädt hoch …`,"run.required":`Pflichtfeld`,"run.net":`Netto`,"run.vat":`USt. {r} %`,"run.total":`Gesamt`,"settings.title":`Einstellungen`,"settings.name":`Name`,"settings.mcp":`Verbundene Systeme (MCP)`,"settings.mcpHint":`KI-Schritte können in diese Systeme schreiben oder daraus lesen – nur, wenn du sie im Schritt freigibst.`,"settings.addServer":`System verbinden`,"settings.serverName":`Name`,"settings.serverUrl":`MCP-URL`,"settings.serverHeader":`Authorization-Header (optional)`,"settings.save":`Speichern`,"settings.saved":`Gespeichert`,"settings.delete":`Space löschen`,"settings.noProject":`Hier erscheint dein Space, sobald deine lokale Installation den ersten Wizard veröffentlicht hat.`,"settings.copy":`Kopieren`,"settings.copied":`Kopiert`,"settings.lastUsed":`zuletzt {when}`,"settings.neverUsed":`noch nie benutzt`,"settings.revoke":`Schlüssel löschen`,"mcp.appsDisconnect":`Austragen`,"plugins.title":`Plugins`,"plugins.hint":`Plugins erweitern diese App um Seiten, Einstellungen und Werkzeuge für Schritte. Sie laufen mit allen Rechten der App: installiere nur, was du kennst.`,"plugins.hintManaged":`Diese Plugins sind für dein Konto freigeschaltet.`,"plugins.reload":`Neu laden`,"plugins.rescan":`Neu suchen`,"plugins.tools":`Werkzeuge für Schritte`,"plugins.serverFailed":`Der Server-Teil hat nicht geladen: {error}`,"plugins.studioFailed":`Der Studio-Teil hat nicht geladen: {error}`,"plugins.problems":`Kein Plugin`,"plugins.crashed":`Dieser Teil eines Plugins ist abgestürzt.`,"mcp.notReverse":`Nicht verwechseln mit „Verbundene Systeme (MCP)“ unter Connectors: Dort ruft engenty andere Server auf, hier ruft dein Client engenty auf.`,"integrate.nav":`Einbinden`,"integrate.groupApps":`KI-Apps`,"integrate.groupShare":`Teilen`,"integrate.shareLink":`Per Link teilen`,"integrate.shareSite":`In eine Website einbinden`,"integrate.soon":`bald`,"integrate.stateWorks":`funktioniert`,"integrate.stateConnected":`eingetragen`,"integrate.stateInstalled":`auf diesem Computer`,"integrate.kindMcp":`Werkzeuge im Chat: Wizards finden, starten, ausfüllen – und bauen.`,"integrate.kindMcpShort":`Werkzeuge im Chat`,"integrate.kindAppShort":`der Wizard als Widget`,"integrate.kindAppNoShort":`zeigt diese App nicht`,"integrate.kindApp":`Der Wizard selbst im Chat, Seite für Seite, als Widget.`,"integrate.kindAppNo":`Zeigt diese App nicht – ein Lauf kommt als Text.`,"integrate.where":`Wo läuft die App?`,"integrate.here":`Auf diesem Computer`,"integrate.hereHint":`Ein Klick, kein Schlüssel. Die App startet engenty wizards selbst.`,"integrate.hereManaged":`Nur mit engenty wizards auf deinem Computer.`,"integrate.address":`Über die Adresse`,"integrate.addressHint":`Von überall, wo die Adresse erreichbar ist – mit Schlüssel.`,"integrate.connectTitle":`Eintragen`,"integrate.connectHint":`Trägt engenty wizards in die Einstellungen von {app} ein.`,"integrate.connect":`In {app} eintragen`,"integrate.connected":`In {app} eingetragen`,"integrate.notInstalled":`{app} ist auf diesem Computer nicht zu finden. Eintragen geht trotzdem – es wirkt, sobald {app} da ist.`,"integrate.file":`In {file} eintragen:`,"integrate.vscode":`In VS Code: „MCP: Open User Configuration“, dann eintragen:`,"integrate.chatgpt":`In ChatGPT: Einstellungen → Apps & Connectors → Erweitert → Entwicklermodus, dann „Erstellen“ mit dieser Adresse:`,"integrate.generic":`In den MCP-Einstellungen der App einen Server mit dieser Adresse anlegen (Streamable HTTP):`,"integrate.oauthLocal":`Diese App verbindet sich von den Servern ihres Herstellers aus – diesen Computer erreicht sie nicht. Nimm hier „Auf diesem Computer“ oder eine App, die hier läuft.`,"integrate.test":`Testen`,"integrate.seen":`{app} meldet sich`,"integrate.restart":`Beende {app} ganz und starte es neu – dann meldet es sich hier.`,"integrate.reload":`Lade die MCP-Server in {app} neu oder starte es neu.`,"integrate.tool":`Ein Werkzeug aufgerufen`,"integrate.askHint":`Schreib in {app} in einem neuen Chat:`,"integrate.askTool":`Welche Wizards habe ich in engenty?`,"integrate.widget":`Wizard als Widget gezeigt`,"integrate.widgetHint":`Starte einen veröffentlichten Wizard:`,"integrate.askWidget":`Starte einen meiner engenty Wizards.`,"integrate.works":`{app} arbeitet mit deinen Wizards.`,"mcp.notHere":`Geht mit diesem Server nicht`,"mcp.needsPublic":`claude.ai verbindet sich von Anthropics Servern aus. Das geht nur, wenn dieser Server öffentlich über HTTPS erreichbar ist.`,"mcp.keyTitle":`Schlüssel erstellen`,"mcp.keyHint":`Mit dem Schlüssel meldet sich dein Client an. Er wird nur einmal angezeigt und steht dann gleich im Befehl im nächsten Schritt.`,"mcp.keyCreate":`Schlüssel für {client} erstellen`,"mcp.keyReady":`Schlüssel erstellt – er steht schon im Befehl unten.`,"mcp.keyFirst":`Erst den Schlüssel erstellen – dann steht hier der fertige Befehl.`,"mcp.add":`Server eintragen`,"mcp.terminal":`Im Terminal ausführen:`,"mcp.ccPlugin":`Optional das Plugin – es bringt den Befehl /wizard mit:`,"mcp.codexKey":`Im Terminal ausführen – Codex liest den Schlüssel aus einer Umgebungsvariable:`,"mcp.claudeAi":`In claude.ai: Einstellungen → Konnektoren → Eigenen Konnektor hinzufügen, diese Adresse eintragen:`,"mcp.oauth":`Kein Schlüssel nötig: Beim ersten Aufruf meldet sich dein Client im Browser an.`,"mcp.addressPublic":`Öffentlich erreichbar.`,"mcp.addressLocal":`Nur auf diesem Rechner erreichbar, und nur solange engenty wizards läuft.`,"mcp.keys":`Schlüssel`,"mcp.keysHint":`Jeder Schlüssel meldet einen Client an und hat alle Rechte – behandle ihn wie ein Passwort. Löschst du ihn, ist der Client abgemeldet.`,"editor.viaClient":`Über {client}`,"editor.changedVia":`Geändert über {client}`,"editor.merged":`Mit Änderungen von außen zusammengeführt`,"run.uploadMore":`Weitere Datei`,"run.camera":`Kamera`,"camera.title":`Mit der Kamera aufnehmen`,"camera.hint":`Gerade und gut beleuchtet ins Bild halten.`,"camera.taken":`{n} aufgenommen`,"camera.shoot":`Aufnehmen`,"camera.done":`Fertig`,"camera.denied":`Die Kamera ist für diese Seite nicht freigegeben. Erlaube sie in den Website-Einstellungen deines Browsers (Schloss-Symbol in der Adresszeile) – oder nimm das Foto mit der Kamera-App auf.`,"connect.go":`Verbinden`,"connect.connected":`Verbunden über {name}`,"connect.disconnect":`Trennen`,"connect.none":`Auf diesem Server ist noch kein Anbieter zum Verbinden eingerichtet.`,"connect.openLink":`Hier klicken, um die Anmeldung in einem neuen Tab zu öffnen`,"list.empty":`Noch keine Einträge.`,"list.delete":`Zeile löschen`,"ask.typeInto":`Text in die Seite tippen …`,"ask.hide":`verdeckt`,"ask.up":`Nach oben`,"ask.down":`Nach unten`,"ask.pictureHint":`Das ist die Seite, die der Wizard geöffnet hat. Du kannst auch direkt ins Bild klicken und tippen.`,"ask.remember":`Anmeldung für nächstes Mal merken`,"ask.private":`Was du eingibst, geht direkt in die Seite. Die KI bekommt es nicht zu sehen. Gemerkte Anmeldungen werden verschlüsselt gespeichert.`,"ask.skip":`Überspringen`,"ask.done":`Ich bin angemeldet`,"ask.signIn":`Anmelden`,"ask.wants":`Der Wizard möchte in {service} Folgendes ausführen:`,"ask.allowRest":`Für den Rest dieses Durchlaufs erlauben`,"ask.allow":`Erlauben`,"ask.deny":`Nicht erlauben`,"store.open":`Was dieser Wizard sich merkt`,"store.title":`Gespeichert für dich`,"store.explain":`Dieser Wizard merkt sich Listen, Dateien und verbundene Konten für deinen nächsten Durchlauf. Nur du siehst sie.`,"store.empty":`Noch nichts gespeichert.`,"store.rows":`{n} Einträge`,"store.signIns":`Gemerkte Anmeldungen im Browser`,"store.files":`{n} Dateien · {size}`,"store.delete":`Alles löschen`,"store.confirmDelete":`Wirklich alles löschen`,"common.close":`Schließen`,"connectors.title":`Connectors`,"connectors.hint":`Dienste, in denen ein Wizard für die Person arbeiten kann – sie verbindet beim Durchlauf ihr eigenes Konto. Die wichtigsten sind eingebaut; jeden weiteren findest du im Verzeichnis integrations.sh und importierst ihn aus seiner OpenAPI-Beschreibung oder seinem MCP-Server.`,"connectors.imported":`Aus dem Verzeichnis`,"connectors.noneImported":`Hier ist kein Connector aus dem Verzeichnis importiert.`,"connectors.notSetUp":`nicht eingerichtet`,"connectors.setup":`Auf dem Server fehlen:`,"connectors.search":`Dienst suchen, z. B. Notion, Stripe, GitHub`,"connectors.find":`Suchen`,"connectors.none":`Nichts gefunden.`,"connectors.import":`Importieren`,"connectors.exists":`Schon importiert.`,"connectors.ownClient":`Eigener OAuth-Client`,"connectors.refresh":`Aktionen neu laden`,"connectors.remove":`Entfernen`,"connectors.actions":`{n} Aktionen, {r} lesend`,"connectors.pending":`Aktionen erscheinen, sobald ein Konto verbunden ist`,"connectors.needsClient":`Dieser Dienst braucht einen OAuth-Client (ID und Secret). Entfernen und mit „Eigener OAuth-Client“ neu importieren.`,"connectors.authNone":`ohne Anmeldung`,"connectors.authOauth":`Anmeldung per OAuth`,"connectors.authKey":`API-Schlüssel`,"connectors.group.read":`liest`,"connectors.group.write":`ändert`,"connectors.group.destructive":`löscht`,"run.uploadTouch":`Datei wählen`,"run.maxFiles":`Hier gehen höchstens {n} – die übrigen habe ich weggelassen.`,"run.filesMin":`{n} von mindestens {min}`,"run.filesOf":`{n} von höchstens {max}`,"run.moveFile":`Nr. {n} verschieben`,"run.moveFileHint":`Ziehen, um die Reihenfolge zu ändern`,"run.removeFile":`Entfernen`,"run.awake":`Der Bildschirm bleibt an, solange der Wizard arbeitet.`,"run.openFull":`Groß öffnen`,"run.yes":`Ja`,"run.no":`Nein`,"run.share":`Teilen`,"run.shareNow":`Jetzt teilen`,"run.shareFile":`Als Datei teilen oder in einer App öffnen`,"camera.asking":`Dein Browser fragt gleich nach der Kamera. Das Bild bleibt in diesem Wizard.`,"camera.missing":`An diesem Gerät wurde keine Kamera gefunden. Lade stattdessen ein Foto hoch.`,"camera.busy":`Die Kamera wird gerade von einer anderen App verwendet. Schließe sie und versuche es noch einmal.`,"camera.native":`Kamera-App öffnen`,"camera.pick":`Foto auswählen`,"camera.torch":`Licht`,"camera.flip":`Kamera wechseln`,"camera.photo":`Foto`,"camera.video":`Video`,"camera.record":`Aufnahme starten`,"camera.stop":`Aufnahme beenden`,"camera.recording":`Nimmt auf – tippe zum Beenden.`,"camera.clipHint":`Ein kurzer Clip, höchstens {s} Sekunden.`,"camera.hintMany":`Seite für Seite aufnehmen, dann „Fertig“.`,"scan.button":`Scannen`,"scan.title":`Code scannen`,"scan.asking":`Dein Browser fragt gleich nach der Kamera – sie liest nur den Code.`,"scan.hint":`Halte den QR- oder Strichcode in den Rahmen.`,"scan.hintQr":`Halte den QR-Code in den Rahmen. Strichcodes liest dieses Gerät hier nicht.`,"scan.miss":`Auf dem Foto war kein Code zu erkennen. Versuch es näher und schärfer.`,"scan.fromPhoto":`Foto mit dem Code wählen`,"scan.typeInstead":`Lieber eintippen`,"location.use":`Meinen Standort übernehmen`,"location.locating":`Standort wird bestimmt …`,"location.refining":`wird noch genauer …`,"location.accuracy":`auf etwa {m} m genau`,"location.map":`Karte`,"location.remove":`Standort entfernen`,"location.why":`Dein Browser fragt nach deinem Standort. Er wird nur für diesen Wizard verwendet. Du kannst auch einfach die Adresse eintippen.`,"location.denied":`Der Standort ist für diese Seite nicht freigegeben. Erlaube ihn in den Website-Einstellungen deines Browsers (Schloss-Symbol in der Adresszeile) – oder tippe die Adresse unten ein.`,"location.unavailable":`Dein Gerät konnte den Standort gerade nicht bestimmen. Versuch es im Freien noch einmal oder tippe die Adresse ein.`,"location.timeout":`Das hat zu lange gedauert. Versuch es noch einmal oder tippe die Adresse ein.`,"location.manual":`Adresse oder Ort eintippen`,"location.label":`Adresse oder Beschreibung des Orts`,"voice.start":`Sprachnotiz aufnehmen`,"voice.stop":`Stopp`,"voice.recording":`Aufnahme läuft …`,"voice.left":`noch {s} s`,"voice.again":`Neu aufnehmen`,"voice.remove":`Löschen`,"voice.pick":`Audiodatei wählen`,"voice.why":`Dein Browser fragt nach dem Mikrofon. Die Aufnahme wird danach in Text umgewandelt.`,"voice.denied":`Das Mikrofon ist für diese Seite nicht freigegeben. Erlaube es in den Website-Einstellungen deines Browsers – oder nimm die Notiz mit der Diktier-App auf und wähle die Datei.`,"voice.noRecorder":`Dieser Browser kann hier nicht aufnehmen. Nimm die Notiz mit der Diktier-App auf und wähle die Datei.`,"sign.open":`Hier unterschreiben`,"sign.hint":`Mit dem Finger unterschreiben`,"sign.pad":`Unterschriftsfeld`,"sign.clear":`Löschen`,"sign.accept":`Übernehmen`,"sign.again":`Neu unterschreiben`,"sign.remove":`Unterschrift entfernen`,"notify.ask":`Bescheid geben, wenn es fertig ist`,"notify.on":`Du bekommst Bescheid`,"notify.why":`Mit Ton, Vibration oder einer Mitteilung. Dein Browser fragt dafür einmal um Erlaubnis.`,"notify.onHint":`Du kannst die App wechseln – eine Mitteilung holt dich zurück.`,"notify.quiet":`Mit Ton und Vibration, solange diese Seite offen ist.`,"notify.blocked":`Mitteilungen sind für diese Seite blockiert – es gibt Ton und Vibration, solange sie offen ist. Erlauben kannst du sie in den Website-Einstellungen deines Browsers.`,"notify.done":`Dein Ergebnis ist fertig.`,"notify.next":`Es geht weiter – wirf einen Blick darauf.`,"notify.needsYou":`Der Wizard braucht dich kurz.`,"install.add":`Zum Startbildschirm hinzufügen`,"install.ios":`Tippe unten auf „Teilen“ und dann auf „Zum Home-Bildschirm“.`,"install.bookmark":`Als Lesezeichen speichern`,"install.bookmark.mac":`Drücke ⌘ D, dann liegt dieser Wizard in deinen Lesezeichen.`,"install.bookmark.pc":`Drücke Strg + D, dann liegt dieser Wizard in deinen Lesezeichen.`,"install.app":`In der App öffnen`,"install.app.offer":`Installiere das Studio als App: eigenes Fenster, eigenes Symbol im Dock oder in der Taskleiste.`,"install.app.browser":`In Chrome oder Edge lässt sich das Studio als App installieren: eigenes Fenster, eigenes Symbol.`,"install.app.action":`Als App installieren`,"install.app.close":`Schließen`,"common.offline":`Keine Verbindung. Prüfe dein Netz und versuch es noch einmal.`,"common.retry":`Erneut versuchen`,"common.cancel":`Abbrechen`,"common.loading":`Lädt …`,"common.error":`Fehler`,"data.hint":`Tabellen und Seiten, die der Space und seine Wizards behalten.`,"data.all":`Alle Daten`,"data.own":`Allgemein`,"data.table":`Tabelle`,"data.page":`Seite`,"data.newTable":`Neue Tabelle`,"data.newPage":`Neue Seite`,"data.title":`Titel`,"data.owner":`Gehört zu`,"data.create":`Anlegen`,"data.empty":`Noch keine Tabellen und Seiten. Leg eine an – bald schreiben auch deine Wizards hier.`,"data.rows":`{n} Zeilen`,"data.addRow":`Zeile`,"data.noRows":`Noch keine Zeilen.`,"data.deleteRow":`Zeile löschen`,"data.deleteTable":`Tabelle löschen`,"data.deletePage":`Seite löschen`,"data.confirmDelete":`„{title}“ löschen?`,"data.newColumn":`Neue Spalte`,"data.columnName":`Name`,"data.columnType":`Typ`,"data.required":`Muss ausgefüllt werden`,"data.deleteColumn":`Spalte löschen`,"data.removeOption":`Entfernen`,"data.fromList":`Eine Liste des Wizards: jeder Durchlauf schreibt hier hinein. Die Spalten kommen aus dem Wizard.`,"data.badCell":`Dieser Wert passt nicht in „{column}“ und ist nicht gespeichert.`,"data.type.text":`Text`,"data.type.number":`Zahl`,"data.type.date":`Datum`,"data.type.duration":`Dauer`,"data.type.select":`Auswahl`,"data.type.boolean":`Ja / Nein`,"data.text.single":`Eine Zeile`,"data.text.multiline":`Mehrere Zeilen`,"data.number.integer":`Ganze Zahl`,"data.number.decimal":`Dezimalzahl`,"data.number.percent":`Prozent`,"data.number.currency":`Betrag`,"data.currency":`Währung (z. B. EUR)`,"data.date.date":`Datum`,"data.date.datetime":`Datum und Uhrzeit`,"data.date.time":`Uhrzeit`,"data.unit":`Eingabe in`,"data.unit.milliseconds":`ms`,"data.unit.seconds":`Sekunden`,"data.unit.minutes":`Minuten`,"data.unit.hours":`Stunden`,"data.unit.days":`Tage`,"data.options":`Auswahlmöglichkeiten, eine je Zeile`,"data.multiple":`Mehrere wählbar`,"data.write":`Schreiben`,"data.preview":`Vorschau`,"data.pageEmpty":`Diese Seite ist noch leer.`,"data.markdownHint":`Markdown: # Überschrift, **fett**, - Liste`,"space.info":`Info & Marke`,"space.knowledge":`Wissen`,"space.data":`Daten`,"space.results":`Ergebnisse`,"space.resultsAll":`Alle Ergebnisse`,"space.resultsHint":`Läufe deiner Wizards, die ihr Ergebnis erreicht haben, die neuesten zuerst.`,"space.resultsEmpty":`Noch keine Ergebnisse. Ein Lauf steht hier, sobald er fertig ist.`,"space.resultCredits":`{n} Credits`,"space.resultsSearch":`Suchen: Wizard, Eingaben, Ergebnis …`,"space.resultsModeAll":`Live & Test`,"space.resultsAnyTime":`Jederzeit`,"space.resultsDay":`Letzte 24 Stunden`,"space.resultsDays":`Letzte {n} Tage`,"space.resultsNone":`Keine Ergebnisse zu dieser Suche.`,"space.resultFiles":`{n} Dateien`,"project.rename":`Space umbenennen`,"project.saving":`Speichert …`,"project.base":`Basis`,"project.baseHint":`Wer hinter den Wizards steht. Jeder KI-Schritt kennt das.`,"project.title":`Titel`,"project.titleHint":`Firma, Marke oder Vorhaben – so sehen es auch Endnutzer.`,"project.about":`Über`,"project.aboutHint":`Was ihr macht, für wen, und in welchem Ton ihr schreibt.`,"project.logos":`Logos`,"project.logosHint":`Das erste Logo sehen Endnutzer. Eine Beschreibung sagt, wofür eine Variante gedacht ist.`,"project.logoAdd":`Logo`,"project.logoMain":`Hauptlogo`,"project.logoMakeMain":`Als Hauptlogo`,"project.colors":`Farben`,"project.colorsHint":`Die erste Farbe ist der Akzent in Dokumenten, Dashboards und auf öffentlichen Seiten.`,"project.colorAdd":`Farbe`,"project.colorName":`z. B. Primär – Buttons und Überschriften`,"project.colorUse":`Beschreibe, wie engenty diese Farbe einsetzen soll.`,"project.colorAddTitle":`Farbe hinzufügen`,"project.colorValue":`Farbwert`,"project.colorUseLabel":`Verwendung`,"project.add":`Hinzufügen`,"project.colorAccent":`Akzent`,"project.colorFirst":`Als Akzent`,"project.assets":`Assets`,"project.assetsHint":`Bilder, Grafiken, Videos. KI-Schritte setzen sie in Dokumente und wählen nach der Beschreibung.`,"project.assetAdd":`Dateien`,"project.assetSearch":`Assets filtern …`,"know.all":`Alles`,"know.title":`Wissen`,"know.hint":`Was die Schritte deiner Wizards nachschlagen. Dokumente werden beim Hochladen zu Seiten und Tabellen; Kategorien halten die Einträge auseinander.`,"know.empty":`Noch nichts da. Lade Dokumente hoch, leg eine Seite an oder gib dem Assistenten eine Website.`,"know.drop":`Dokumente hierher ziehen oder`,"know.pick":`auswählen`,"know.page":`Seite`,"know.table":`Tabelle`,"know.faq":`FAQ`,"know.file":`Datei`,"know.category":`Kategorie`,"know.categories":`Kategorien`,"know.newPage":`Neue Seite`,"know.newTable":`Neue Tabelle`,"know.asFaq":`Als FAQ: Frage und Antwort je Zeile`,"know.newCategory":`Neue Kategorie`,"know.search":`Suche testen …`,"know.searchNone":`Nichts Relevantes gefunden.`,"know.searchStats":`{candidates} Kandidaten geprüft, {hits} relevant`,"know.searchUnchecked":`{hits} Treffer, ungeprüft`,"know.unchecked":`Ohne Classifier bleiben Treffer ungeprüft. Er braucht einen AI-Gateway- oder TypeSafe-Key oder ein Konto.`,"know.keywordsOnly":`Ohne Embedding-Modell findet die Suche nach Wörtern, nicht nach Bedeutung.`,"know.clear":`Zurücksetzen`,"know.sub":`{n} Unterseiten`,"know.rows":`{n} Zeilen`,"know.review":`Prüfen`,"know.reviewed":`Geprüft`,"know.from":`Aus {label}`,"know.kept":`Von Hand geändert: {label} schreibt sie nicht mehr.`,"know.original":`Original`,"know.reading":`Wird gelesen …`,"know.subPages":`Unterseiten`,"know.addSub":`Unterseite`,"know.type.choice":`Auswahl`,"know.type.date":`Datum`,"know.type.number":`Zahl`,"know.type.text":`Text`,"know.type.boolean":`Ja / Nein`,"know.name":`Name`,"know.type":`Typ`,"know.unit":`Einheit`,"know.unitHint":`z. B. h, €, kg`,"know.multiple":`Mehrere Werte je Eintrag`,"know.ordered":`Die Werte sind gestuft (niedrig → hoch)`,"know.values":`Werte`,"know.valuesHint":`Einer je Zeile. Weitere kommen mit den Einträgen dazu.`,"know.hintField":`Woher die Werte kommen`,"know.hintFieldHint":`Kurz, z. B. Kopfzeile, Dateiname, Filter der Website.`,"know.create":`Anlegen`,"know.proposed":`Vorgeschlagen`,"know.proposedHint":`Erst übernommen wird sie gefüllt.`,"know.accept":`Übernehmen`,"know.dismiss":`Verwerfen`,"know.alike":`„{a}“ und „{b}“ sehen nach einem Wert aus.`,"know.merge":`Zusammenführen`,"know.items":`{n} Einträge`,"know.item":`1 Eintrag`,"know.row":`1 Zeile`,"know.oneSub":`1 Unterseite`,"know.addValue":`Wert hinzufügen`,"know.range":`{min} bis {max}`,"know.summary":`Übersicht`,"know.summaryHint":`Ein Modell fasst die Einträge dieses Werts zusammen. Die Suche findet die Übersicht wie eine Seite.`,"know.summaryWrite":`Übersicht schreiben`,"know.summaryAgain":`Neu schreiben`,"know.summaryEmpty":`Noch keine Übersicht.`,"know.toc":`Inhaltsverzeichnis`,"know.tocRows":`{n} Zeilen in {table}`,"know.deleteCategory":`Kategorie löschen`,"know.confirmCategory":`„{name}“ löschen? Die Einträge bleiben, nur die Kategorie geht.`,"know.deleteValue":`Wert löschen`,"know.yes":`Ja`,"know.no":`Nein`,"know.minimum":`ab`,"know.maximum":`bis`,"know.contains":`enthält`,"know.by.person":`von Hand gesetzt`,"know.by.origin":`aus der Quelle`,"know.by.model":`von einem Modell gelesen`,"know.remove":`Entfernen`,"know.unset":`Nicht gesetzt`,"know.deleteFile":`Datei löschen`,"project.documents":`Dokumente`,"project.documentsHint":`PDFs, Listen, Excel, Word, Text. Sie werden gelesen und kommen in einen Index, den jeder KI-Schritt durchsucht.`,"project.documentAdd":`Dokumente`,"project.drop":`Hierher ziehen oder`,"project.staysLocal":`Bleibt in deiner lokalen Installation und wird nicht hierher gesendet.`,"project.description":`Beschreibung hinzufügen …`,"project.describing":`Wird angesehen …`,"project.reading":`Wird gelesen …`,"project.indexed":`Im Index`,"project.indexedKeywords":`Im Index (Stichwörter)`,"project.notIndexed":`Kein Text gefunden`,"project.reindex":`Neu einlesen`,"project.pages":`{n} Seiten`,"project.keywordsOnly":`Der Index sucht gerade nach Stichwörtern. Mit einem AI-Gateway- oder OpenAI-Schlüssel kommt die Suche nach Bedeutung dazu.`,"project.preview":`Vorschau`,"project.viewList":`Als Liste zeigen`,"project.viewCards":`Als Karten zeigen`,"project.original":`Original`,"project.readText":`Gelesener Text`,"project.openOriginal":`Original öffnen`,"project.noText":`Noch kein Text: das Dokument wird gerade gelesen oder ließ sich nicht lesen.`,"project.textCut":`Die Vorschau zeigt den Anfang ({shown} von {total} Zeichen).`,"project.searchTest":`Im Index suchen …`,"project.searchNone":`Nichts gefunden.`,"project.remove":`Entfernen`,"project.removeConfirm":`„{name}“ entfernen?`,"project.facts":`Fakten`,"project.factsHint":`Was Wizards wissen sollen: Adresse, UID, Öffnungszeiten – alles, was passt.`,"project.factLabel":`Bezeichnung`,"project.factValue":`Wert`,"project.factAdd":`Eintrag`,"project.factType":`Typ`,"project.factAuto":`Automatisch`,"project.type.text":`Text`,"project.type.longtext":`Langer Text`,"project.type.number":`Zahl`,"project.type.date":`Datum`,"project.type.url":`Link`,"project.type.email":`E-Mail`,"project.type.phone":`Telefon`,"project.type.boolean":`Ja / Nein`,"project.yes":`Ja`,"project.no":`Nein`,"project.assistant":`Assistent`,"project.assistantTitle":`Erzähl mir von euch`,"project.assistantHello":`Nenn mir eure Website oder gib mir Dateien. Ich trage ein, was ich finde: Titel, Beschreibung, Logo, Farben und Fakten.`,"project.assistantComposer":`z. B. „Lies unsere Website example.at“ …`,"project.assistantTitleKnowledge":`Was sollen deine Wizards wissen?`,"project.assistantHelloKnowledge":`Gib mir Dokumente oder sag mir, wo das Wissen steht. Ich lese es ein – unten siehst du, was hineinkommt.`,"project.assistantComposerKnowledge":`Dokumente anhängen oder sagen, wo das Wissen steht …`,"project.assistantChanged":`Space aktualisiert`,"flowApp.loading":`Der Wizard kommt …`,"flowApp.draft":`Entwurf`,"flowApp.published":`Veröffentlicht`,"flowApp.issues":`{n} Fehler im Entwurf`,"flowApp.flow":`Ablauf`,"flowApp.notPublished":`Veröffentliche ihn im Studio, dann läuft er hier.`,"flowApp.runPage":`Im Browser weiter`,"flowApp.inBrowser":`Nur im Browser: {fields}`,"flowApp.done":`Fertig`,"flowApp.credits":`{n} Credits`,"flowApp.ask":`Der Wizard fragt`,"flowApp.allow":`Erlauben`,"flowApp.skip":`Überspringen`,"flowApp.signIn":`Eine Anmeldung bei {site} – das geht nur im Browser.`,"flowApp.fullscreen":`Größer`,"flowApp.inline":`Kleiner`,"flowApp.failed":`Das hat nicht geklappt: {error}`},ub={"brand.tagline":`Build AI wizards, no code.`,"brand.sub":`Describe a flow in your own words. engenty turns it into a wizard you share with a link.`,"auth.dev":`Dev login (local)`,"auth.legal":`No password, no sign-up form — you sign in with an account you already have.`,"auth.signIn":`Sign in or create an account`,"auth.failed":`Sign-in did not work. Please try again.`,"auth.localLink":`Open the link the app printed at start — it signs you in on this device.`,"nav.account":`Account & credits`,"setup.keysInAccount":`API keys for scripts belong to your account. You create and revoke them there.`,"setup.openAccount":`Open account`,"class.label":`Model class`,"class.classifier":`Classifier`,"class.standard":`Standard`,"class.high":`High`,"class.highest":`Highest`,"class.image":`Image`,"class.video":`Video`,"class.audio":`Audio`,"class.speech":`Speech`,"class.classifier.hint":`Routing, yes/no, pulling a few values out of text. Cheapest.`,"class.standard.hint":`Short copy, calling an API, reformatting.`,"class.high.hint":`Research with tools, long documents, weighing many sources.`,"class.highest.hint":`Hard reasoning or code. Several times the cost of High.`,"class.effort":`Thinking effort`,"class.effortAuto":`Automatic`,"class.effort.low":`Low`,"class.effort.medium":`Medium`,"class.effort.high":`High`,"estimate.step":`≈ {n} credits, rarely more than {high}`,"estimate.measured":`measured from the latest runs`,"estimate.formula":`estimated, gets exact after five runs`,"estimate.share":`A run costs about {run} credits. At the daily limit that is at most {day} credits a day.`,"local.title":`Models`,"local.accountWaiting":`Waiting for the sign-in in your browser …`,"local.accountFailed":`The account service cannot be reached right now.`,"local.accountExpired":`The sign-in has expired. Please sign in again.`,"local.sourceNeedsAccount":`This needs an account.`,"local.toAccount":`Go to Settings → Account`,"local.sourceOwn":`Own keys`,"local.keys":`Keys`,"local.keysHint":`One key is enough. Keys live in this device's keychain, never in the database.`,"local.keySet":`stored`,"local.keyEmpty":`not stored`,"local.keyRemove":`Remove`,"local.classes":`Model per class`,"local.classesHint":`A step names only the class. Here is which model serves it, e.g. anthropic/claude-haiku-4.5, openai:gpt-5.4-mini or ollama:qwen3.`,"local.save":`Save`,"local.saved":`Saved`,"local.chat":`The studio chat answers on`,"local.chatModels":`Model class Highest`,"local.chatClaude":`Claude subscription (Claude Code)`,"local.subscription":`With the subscription, the Claude Code installed on this device builds the wizard — on your sign-in there. Runs keep using keys or credits.`,"harness.hint":`Text thinks on the {name} installed on this device — on your {sub} and your sign-in there. No key needed. Images, video and audio still need a key.`,"harness.hintImages":`Text and images come from the {name} installed on this device — on your {sub} and your sign-in there. No key needed. Video and audio still need a key.`,"harness.found":`{name} {version} found`,"harness.missing":`{name} is not installed on this device.`,"harness.install":`Or in your own terminal:`,"harness.installButton":`Install {name}`,"harness.installing":`{name} installs in the terminal below — it takes about a minute. Then you sign it in.`,"harness.installEnded":`The install ended, but {name} is not there. What it printed above says why.`,"harness.appHere":`The {app} app is on this computer: {name} signs in with the same {sub}.`,"harness.notInstalled":`not installed`,"harness.authSubscription":`Signed in with your {sub}.`,"harness.authKey":`Signed in with an API key from your shell — not the subscription. Sign in here so it runs on your {sub}.`,"harness.authNone":`Not signed in yet.`,"harness.signIn":`Sign in here`,"harness.signingIn":`The sign-in runs in the terminal below — your browser opens for it. The terminal closes once the sign-in is there.`,"harness.signInInteractive":`{name} starts below. Pick the sign-in with your {sub} there and sign in in the browser. The terminal closes once the sign-in is there.`,"harness.loginEnded":`The sign-in ended without {name} being signed in.`,"harness.sub.claude":`Claude subscription`,"harness.sub.codex":`ChatGPT subscription`,"harness.sub.gemini":`Google account`,"harness.sub.cursor":`Cursor subscription`,"harness.desc.claude":`On your Claude subscription — no key needed.`,"harness.desc.codex":`On your ChatGPT subscription — no key needed.`,"harness.desc.gemini":`On your Google account — no key needed.`,"harness.desc.cursor":`On your Cursor subscription — no key needed.`,"harness.ready":`signed in`,"local.recheck":`Check again`,"local.test":`Test`,"local.testHint":`One short call shows whether the way to the model is open.`,"local.testOk":`Answered in {s} s on {ref}: “{reply}”`,"local.testFailed":`The test did not work: {error}`,"models.groupCaps":`Capabilities`,"models.groupAccess":`Access`,"models.groupMore":`More providers`,"models.cap.text":`Text & reasoning`,"models.cap.text.hint":`Writes, summarizes, researches and decides – in almost every step.`,"models.cap.image":`Images`,"models.cap.image.hint":`Makes images: logos, product shots, illustrations.`,"models.cap.video":`Videos`,"models.cap.video.hint":`Makes short clips from text or from an image.`,"models.cap.speech":`Voice`,"models.cap.speech.hint":`Reads text aloud: voice-overs, audio versions, announcements.`,"models.cap.listening":`Voice notes`,"models.cap.listening.hint":`Understands speech and turns voice notes into text.`,"models.way.local":`Local model`,"models.way.credits":`Credits`,"models.way.creditsTeam":`Team credits`,"models.way.none":`not set up`,"models.who":`Who does it?`,"models.optSubscription":`Your subscription`,"models.optKey":`Own API key`,"models.optLocal":`Local model`,"models.optLocalNote":`Ollama on this computer`,"models.noteIncluded":`included in the plan`,"models.noteSignedOut":`not signed in`,"models.noteMissing":`not installed`,"models.noteKey":`API key stored`,"models.noteKeyShort":`key`,"models.noteSignedIn":`signed in`,"models.noteShellKey":`API key from the shell`,"models.optOther":`Other`,"models.optCreditsGroup":`engenty`,"models.noteNoKey":`API key missing`,"models.noteNeedsAccount":`needs an account`,"models.notePerImage":`≈ {n} credits per image`,"models.notePerSecond":`≈ {n} credits per second`,"models.notePer1k":`≈ {n} credits per 1000 characters`,"models.notePerMinute":`≈ {n} credits per minute`,"models.creditsAuto":`engenty picks: {model}`,"models.creditsAutoNone":`engenty picks the model`,"models.creditsPickHint":`Billed in credits – no API key of your own.`,"models.viaCredits":`{name} on engenty credits`,"models.viaCreditsHint":`No API key of your own, billed in credits.`,"models.viaCreditsNeedsAccount":`With an engenty account, billed in credits.`,"models.noteUsage":`credits by usage`,"models.model":`Model`,"models.modelCustom":`Another model …`,"models.textSimple":`Simple steps`,"models.textDemanding":`Demanding steps`,"models.perClass":`Adjust per class`,"models.manageKey":`{name} API key`,"models.key":`API key`,"models.keyFor":`{name} API key`,"models.keyGet":`Get a key from {name}`,"models.keySave":`Check and save`,"models.keyStored":`API key stored`,"models.keyNone":`No API key`,"models.keyCheck":`Check`,"models.keyReplace":`Replace`,"models.keyRemove":`Remove`,"models.keyOk":`The key works.`,"models.keyBad":`The key was not accepted.`,"models.keyWhereLocal":`The key stays on this device, never in the database.`,"models.keyWhereCloud":`The key is kept encrypted for the team. Nobody sees it again.`,"models.keyFallback":`Until the key is there, credits step in.`,"models.uses":`Used for`,"models.useFor":`Use`,"models.inUse":`in use`,"models.try":`Try it`,"models.try.text":`Test`,"models.try.image":`Make a test image`,"models.try.video":`Make a test clip`,"models.try.speech":`Hear a sample`,"models.try.listening":`Test listening`,"models.tryCost":`Costs like a real call.`,"models.tryCostVideo":`A 4-second clip – costs like a real one.`,"models.tryWait":`Generating …`,"models.tryWaitVideo":`A clip takes a minute or two …`,"models.tryOk":`In {s} s with {model}`,"models.tryHeard":`Heard: “{text}”`,"models.tryHeardNothing":`Nothing heard – the way is open.`,"models.tryFailed":`That did not work: {error}`,"models.creditsName":`engenty credits`,"models.creditsTeam":`Team credits`,"models.creditsLocalLead":`Step in where no subscription and no own API key is set up.`,"models.creditsCloudHint":`Everything without an own API key runs on the credits. Own keys come first and cost no credits.`,"models.creditsConnectTitle":`With an account`,"models.creditsLocalHint":`With an engenty account, credits step in where nothing of your own is set up – for videos without an own API key, say.`,"models.creditsConnect":`Connect an account`,"models.creditsFallback":`Credits step in`,"models.creditsFallbackOn":`What has no subscription and no own API key runs on the credits.`,"models.creditsFallbackOff":`Off: what has no subscription and no own API key does not run.`,"models.creditsOn":`Runs on credits`,"models.creditsNone":`Nothing runs on credits right now.`,"models.creditsTopUp":`Top up`,"models.creditsPicks":`engenty picks the model and bills in credits.`,"models.creditsModel":`Right now: {model}.`,"models.clientSignIn":`Sign-in`,"models.clientImages":`{name} makes images with your {sub} – no API key of your own.`,"models.clientNotChosen":`Text does not run on {name} right now.`,"models.ollamaHint":`Where Ollama runs and the model it serves.`,"models.readOnly":`Only the team's admins change its models.`,"models.viewAs":`Preview as`,"models.view.auto":`as it is`,"models.view.local":`local`,"models.view.linked":`local + account`,"models.view.cloud":`cloud studio`,"setup.title":`Setup`,"setup.sub":`Engenty can use your existing accounts on your computer.`,"setup.source":`Choose your Engine`,"setup.local":`Runs locally on this device.`,"setup.stage.connect":`Connect`,"setup.stage.test":`Test`,"setup.stage.done":`Done`,"setup.h.install":`Install {name}`,"setup.h.signIn":`Sign in to {name}`,"setup.h.keys":`Enter a key`,"setup.h.test":`One short test`,"setup.h.done":`Connected.`,"setup.ready":`All set.`,"setup.noHarness":`No AI client installed yet. Pick one — it installs right here — or enter your own keys.`,"setup.ownDesc":`AI Gateway, OpenAI, Anthropic or Ollama.`,"setup.recommended":`Recommended`,"setup.done":`Open the studio`,"setup.untilWorks":`The studio opens once the test works.`,"cloud.onPublish":`When you publish the wizard, the version also goes to your account's cloud and runs there behind a link of its own.`,"cloud.notSent":`This version is not in the cloud yet.`,"cloud.send":`Send now`,"cloud.resend":`Send again`,"cloud.again":`It is tried again at {when}.`,"cloud.sent":`Version {v} · sent {when}`,"cloud.notRunnable":`Version {v} does not run in the cloud.`,"cloud.keepsRunning":`Version {v} keeps running there.`,"cloud.nothingRuns":`So nothing runs there yet.`,"cloud.notes":`What runs differently in the cloud:`,"cloud.check":`What the cloud would lack for the wizard as it is now:`,"cloud.checkBlocking":`As it is now, the wizard would not run in the cloud:`,"cloud.documents":`The space's documents stay on this device. In the cloud the steps work without them.`,"cloud.stepName":`“{title}”`,"cloud.problem.sandbox":`The server has no machine for code. There it works without one.`,"cloud.problem.mcp":`The space's MCP servers are not on the server: {detail}.`,"cloud.problem.model":`The cloud has no model for this.`,"cloud.problem.connector":`The space lacks a connector in the cloud.`,"cloud.problem.invalid":`The server does not take the wizard like this.`,"cloud.spaceLimit":`Your account's cloud already holds the space of another install:`,"cloud.replace":`Replace that space`,"cloud.replaceConfirm":`Remove that space from the cloud? Its wizards and their links go from there. Then everything published here is sent.`,"cloud.noticeError":`Published here. This version did not arrive in the cloud — see below.`,"cloud.noticeNotRunnable":`Published here. This version does not run in the cloud — see below.`,"readonly.wizard":`This wizard comes from your local install and is changed there. What you publish there runs here.`,"readonly.project":`This space comes from your local install and is changed there.`,"readonly.server":`Nothing is built on this server. The wizards your local install publishes run here.`,"nav.wizards":`Wizards`,"nav.settings":`Settings`,"nav.project":`Space`,"account.title":`Account`,"account.hint":`What the app calls you and how to reach you.`,"account.initials":`Your initials in the menu at the top right: the first letters of your name.`,"account.name":`Name`,"account.nameHint":`It starts as this device's user name.`,"account.fromAccount":`Name and e-mail come from your account.`,"account.about":`About you`,"account.aboutHint":`Who you are and what you do.`,"account.email":`E-mail`,"account.phone":`Phone`,"account.connection":`engenty.ai`,"account.connectionHint":`Sign-in, credits and the cloud that runs your wizards for everyone.`,"account.profile":`Profile`,"account.local":`Local install`,"account.localText":`This app runs on your device and is not connected to an account. Wizards, the space and files stay here.`,"account.linked":`Connected`,"account.with":`With an account`,"account.withCredits":`Credits for the models where no AI client is installed. No API key needed.`,"account.withCloud":`What you publish also runs on engenty.ai, behind a public link, even when this device is off.`,"account.signIn":`Sign in`,"account.signInAgain":`Sign in again`,"account.new":`No account yet?`,"account.newHint":`A new account needs an invitation code. Enter it here and the sign-up page has it filled in.`,"account.code":`Invitation code`,"account.create":`Create account`,"account.credits":`Credits`,"account.topUp":`Top up`,"account.expires":`{n} credits valid until {date}`,"account.kind.start":`Starting credits`,"account.kind.monthly":`Monthly credits`,"account.kind.gift":`Gift`,"account.cloud":`What you publish here also runs on {host}.`,"account.look":`Appearance`,"account.lookHint":`Language and theme of the app in this browser.`,"nav.logout":`Sign out`,"nav.connected":`Connected to {host}`,"nav.expired":`Sign-in expired`,"nav.onlyHere":`Only on this computer`,"nav.local":`local`,"nav.language":`Language`,"nav.theme":`Theme`,"nav.credits":`{n} credits`,"footer.billing":`Credits`,"footer.usage":`Usage`,"footer.invoices":`Invoices`,"footer.account":`Account`,"about.version":`Version {v}`,"about.update.available":`Version {v} of engenty wizards is out.`,"about.update.install":`Update`,"about.update.installing":`Installing version {v} …`,"about.update.restarting":`Restarting with version {v} …`,"about.update.done":`Installed. Restart engenty wizards to use {v}.`,"about.update.failed":`The update failed. Logs: logs/update.log`,"about.update.notes":`What's new`,"about.changelog":`Changelog`,"about.changelogHint":`What changed from release to release.`,"about.changelogEmpty":`Nothing here yet.`,"about.unreleased":`Unreleased`,"about.breaking":`breaking`,"about.credits":`Open source`,"about.creditsHint":`engenty wizards and the open-source software it builds on.`,"about.creditsProduct":`engenty`,"about.creditsBuiltWith":`Built with`,"about.creditsDeps":`Direct dependencies`,"about.creditsDepsHint":`What the parts of this app include themselves, with version and license — without their own dependencies.`,"about.creditsShared":`Used by more than one part`,"about.search":`Search …`,"about.noMatches":`No matches.`,"theme.dark":`Dark theme`,"theme.light":`Light theme`,"home.title":`Your wizards`,"home.new":`New wizard`,"home.import":`Import`,"import.failed":`The import did not work`,"home.empty":`No wizards in this space yet.`,"home.live":`Live`,"home.draft":`Draft`,"where.here":`Local`,"where.hereVersion":`Local · version {v}`,"where.hereHint":`Runs only on this computer, while the app is running.`,"where.liveHint":`Runs on {host}, for everyone with the link.`,"where.liveAt":`Live on {host} · version {v}`,"where.note":`1 note`,"where.notes":`{n} notes`,"where.sending":`Being sent`,"where.missing":`Not in the cloud`,"home.steps":`{n} steps`,"home.newProject":`New space`,"home.projectName":`Space name`,"home.projectLimit":`At most {n} spaces`,"team.title":`Team`,"team.hint":`Who is in the team and which plan it is on. Inviting and managing happens in the account.`,"team.plan":`Plan`,"team.planFree":`Free`,"team.seats":`{taken} of {limit} seats`,"team.seatsUnlimited":`Unlimited seats`,"team.members":`Members`,"team.invited":`invited`,"team.you":`you`,"team.manage":`Manage members`,"team.changePlan":`See plans`,"team.roles":`Owners and admins create and delete wizards and spaces; members edit the wizards there are.`,"team.memberNote":`You are a member: you edit wizards, admins create new ones and delete.`,"team.failed":`The team could not be loaded.`,"team.role.owner":`Owner`,"team.role.admin":`Admin`,"team.role.member":`Member`,"models.ownKeysPlan":`Your own API keys come with the Pro plan. Here the team's credits pay.`,"home.fromLocal":`From your local install — changed there.`,"home.syncedAt":`Last arrived: {when}.`,"home.local.title":`The wizards from your local install run here`,"home.local.text":`You build on your own computer. What you publish there runs here — for everyone, behind a link.`,"home.local.install":`Install engenty wizards on your computer:`,"home.local.signIn":`Sign in there with this account, under Settings → Account.`,"home.local.publish":`Publish a wizard. It then shows up here.`,"new.title":`What should your wizard do?`,"new.placeholder":`e.g. Customers enter their product and audience, the wizard researches competitors and writes a positioning briefing as a PDF.`,"new.build":`Build wizard`,"new.orStarter":`Or start from a template`,"new.import":`Import a wizard package`,"new.hint":`You can change everything afterwards in the conversation.`,"editor.resize":`Resize — double-click resets`,"editor.resizeSheet":`Resize — tap folds and unfolds`,"editor.export":`Export as a package (.wizard)`,"editor.chat":`Conversation`,"editor.step":`Steps`,"editor.runs":`Runs`,"editor.reviewEditable":`editable`,"editor.reviewRedo":`can be redone`,"editor.otherwise":`otherwise`,"editor.whenFilled":`{field} filled in`,"editor.whenEmpty":`{field} empty`,"tool.web_search":`Web search`,"tool.web_fetch":`Read web pages`,"tool.browser":`Browser`,"tool.sandbox":`Code & shell`,"tool.image":`Images`,"tool.http":`API`,"tool.pages":`Pages`,"editor.test":`Test`,"editor.share":`Share`,"editor.publish":`Publish`,"editor.published":`Live · version {v}`,"editor.unpublishedChanges":`Unpublished changes`,"editor.notPublished":`Not published yet`,"editor.composer":`Describe what should change …`,"editor.attach":`Attach files`,"editor.detach":`Remove`,"editor.attached":`Attached`,"editor.thread":`Thread`,"editor.voice":`Dictate`,"editor.voiceStop":`Stop dictating`,"editor.listening":`Listening …`,"editor.transcribing":`Writing it down …`,"editor.micDenied":`The microphone is not allowed for this page.`,"editor.building":`Building the flow …`,"editor.files":`Files`,"files.explain":`What your wizard needs on every run: widget code, libraries, map outlines, price lists. The assistant creates them in the chat – you can upload your own too.`,"files.upload":`Upload`,"files.count":`{n} files · {size}`,"files.empty":`No files yet. Drop files here or ask the assistant to build a widget.`,"files.download":`Download`,"files.delete":`Delete`,"files.confirmDelete":`Delete “{path}”?`,"files.none":`This wizard has no files.`,"editor.thinking":`Thinking …`,"editor.chatBroken":`The connection dropped. What was already built is saved – please send your message again.`,"editor.issues":`Before you test or share, the wizard needs a few fixes:`,"editor.fixWithChat":`Let the assistant fix it`,"editor.models.blocking":`The wizard can't start like this. Models are missing:`,"editor.models.optional":`These steps won't run like this. Choose a path without them when testing, or set up the models:`,"editor.models.settings":`Set up models`,"editor.prevStep":`Previous step`,"editor.nextStep":`Next step`,"editor.deleteStep":`Delete step`,"editor.moveUp":`Move up`,"editor.moveDown":`Move down`,"editor.noRuns":`No runs yet.`,"editor.restart":`Restart`,"editor.close":`Close`,"editor.chatHello":`Tell me what your wizard should do. I'll build the flow and you'll see it as a diagram on the left.`,"shareRun.button":`Share`,"shareRun.title":`Share result`,"shareRun.email":`Email`,"shareRun.more":`More …`,"shareRun.until":`The link works until {date}.`,"shareRun.kept":`The link works until you withdraw it.`,"shareRun.withdraw":`Withdraw link`,"sharePage.gone":`This link has expired or was withdrawn.`,"sharePage.own":`Try it yourself`,"sharePage.until":`Shared · available until {date}`,"sharePage.shared":`Shared on {date}`,"share.title":`Share wizard`,"share.link":`Link`,"share.copy":`Copy`,"share.copied":`Copied`,"share.enabled":`Link is active`,"share.limit":`Runs per day`,"share.rotate":`Create a new link`,"share.rotateHint":`The old link stops working.`,"share.publishFirst":`Publish the wizard so the link works.`,"share.open":`Open`,"share.unpublished":`Your changes are not published yet: the link runs the version before.`,"share.website":`Website`,"share.openHere":`Test on this computer`,"share.settings":`Settings`,"share.on":`on`,"share.off":`off`,"share.perDay":`{n} a day`,"share.rotateCloud":`The old link stops working, the one in the cloud too.`,"share.others":`Share with others`,"share.othersHint":`With an account the wizard also runs on engenty.ai: a link, a QR code and a tag for your website, for everyone, also while your computer is off.`,"share.details":`Details`,"teaser.website":`A website needs a link everyone can reach. With an account the wizard also runs on engenty.ai, and the tag for your page is here.`,"teaser.qr":`A QR code needs a link every phone can reach. With an account the wizard also runs on engenty.ai, and its QR code and the ID for the app are here.`,"teaser.link":`This link only works on this computer, while the app is running. With an account the wizard also runs on engenty.ai, with a link for everyone.`,"teaser.models":`No API key of your own: with an account, text, images and videos run on credits.`,"teaser.connect":`Connect an account`,"teaser.modelsLinked":`Or on your account's credits: under Models, choose "The account's credits".`,"share.qr":`QR code`,"share.qrHint":`Scan it with a phone's camera: the wizard opens, in the engenty wizards app when it is installed.`,"share.code":`ID for the app:`,"share.readOnly":`Whether the link is active and how many runs a day it allows is set in your local install.`,"embed.inline":`Inline`,"embed.modal":`Button + modal`,"embed.inlineHint":`Paste the tag into your page's HTML. The wizard appears in that place.`,"embed.modalHint":`Paste the tag into your page's HTML. A button appears in that place and opens the wizard in a window.`,"type.page":`Page`,"type.agent":`AI step`,"type.generate":`Generate`,"type.widget":`Widget`,"type.review":`Review`,"type.result":`Result`,"run.start":`Let's go`,"run.closed":`Not available here right now, it needs: {list}`,"run.cls.text":`text`,"run.cls.image":`images`,"run.cls.video":`video`,"run.cls.speech":`speech output`,"run.cls.audio":`voice notes`,"run.next":`Continue`,"run.back":`Back`,"run.accept":`Looks good`,"run.regenerate":`New version`,"run.edit":`Edit`,"run.resume":`Continue your last run`,"run.regenerateNote":`What should change?`,"run.pickItem":`No. {n}`,"run.pickedItem":`No. {n} again`,"run.regeneratePicked":`Only no. {n} will be made again.`,"run.regenerateAll":`Applies to all. Tap a number to change single ones only.`,"check.progress":`{done} of {total} checked`,"check.onlyOpen":`Open only`,"check.noFile":`There is no file for this row.`,"check.noPreview":`This file has no preview – open it with the link above.`,"check.reopen":`Open again`,"market.search":`Search templates …`,"market.all":`All`,"market.industry":`Industry`,"market.format":`Result`,"market.capability":`Capability`,"market.unavailable":`not set up`,"market.without":`Works without: {list}`,"market.optional":`not set up, works without`,"market.optionalHint":`Runs here without {list}: answers that would need it are locked in the wizard. Set it up under Models.`,"market.missing":`Not set up here: {list}`,"market.missingHint":`This needs a model that isn't set up here: {list}. Set it up under Models.`,"market.none":`No template matches this selection.`,"market.notFound":`There is no such template (any more).`,"market.star":`Star`,"market.starred":`Starred`,"market.starHint":`Starred templates are kept on this computer, ready without a connection.`,"market.noneStarred":`You haven't starred a template yet.`,"market.offline":`No connection to the marketplace: you see the templates kept here.`,"market.more":`Show more`,"market.reset":`Reset selection`,"market.count":`{n} templates`,"market.countOf":`{n} of {all} templates`,"market.countOfShort":`{n} of {all}`,"market.resetShort":`Reset`,"market.minutes":`~ {n} min`,"market.credits":`~ {n} credits per run`,"market.needsUpdate":`Needs a newer app`,"market.needsUpdateHint":`This template uses features your app does not know yet. Update the app, then you can use it.`,"market.use":`Start with this template`,"market.steps":`How the wizard runs`,"market.duration":`Duration`,"market.durationHint":`from start to result, with {n} inputs from you`,"market.result":`Result`,"market.creditsRange":`~ {n} credits`,"market.creditsHint":`estimated per run, rarely more than twice that`,"market.needs":`Needs`,"market.cost":`Cost`,"new.forWebsite":`Small helpers for your website`,"run.feedbackPlaceholder":`Something not right? Write what should be different …`,"run.feedbackTarget":`What should change?`,"run.feedbackPick":`Pick above what should change.`,"ai.generated":`AI generated`,"ai.modified":`AI modified`,"ai.publish":`Made with AI: whoever publishes this has to label it as AI-generated (EU AI Act, Art. 50). The file already carries the marking in its metadata.`,"run.regenerateGo":`Recreate`,"run.retry":`Try again`,"run.again":`Start over`,"run.download":`Download`,"run.copy":`Copy text`,"run.failed":`Something went wrong.`,"run.unavailable":`This wizard is not available right now.`,"run.notFound":`This wizard does not exist (anymore).`,"run.madeWith":`Made with engenty wizards`,"run.working":`One moment …`,"run.elapsed":`{s} s`,"run.cancelled":`Cancelled.`,"run.addRow":`Add row`,"run.upload":`Choose a file or drop it here`,"run.uploading":`Uploading …`,"run.required":`Required`,"run.net":`Net`,"run.vat":`VAT {r} %`,"run.total":`Total`,"settings.title":`Settings`,"settings.name":`Name`,"settings.mcp":`Connected systems (MCP)`,"settings.mcpHint":`AI steps can read from and write to these systems — only when you allow it on the step.`,"settings.addServer":`Connect a system`,"settings.serverName":`Name`,"settings.serverUrl":`MCP URL`,"settings.serverHeader":`Authorization header (optional)`,"settings.save":`Save`,"settings.saved":`Saved`,"settings.delete":`Delete space`,"settings.noProject":`Your space shows up here once your local install has published its first wizard.`,"settings.copy":`Copy`,"settings.copied":`Copied`,"settings.lastUsed":`last used {when}`,"settings.neverUsed":`never used`,"settings.revoke":`Delete key`,"mcp.appsDisconnect":`Remove`,"plugins.title":`Plugins`,"plugins.hint":`Plugins add pages, settings and tools for steps to this app. They run with the app's full rights: install only what you know.`,"plugins.hintManaged":`These plugins are switched on for your account.`,"plugins.reload":`Reload`,"plugins.rescan":`Look again`,"plugins.tools":`Tools for steps`,"plugins.serverFailed":`The server half did not load: {error}`,"plugins.studioFailed":`The studio half did not load: {error}`,"plugins.problems":`Not a plugin`,"plugins.crashed":`This part of a plugin crashed.`,"mcp.notReverse":`Not the same as “Connected systems (MCP)” under Connectors: there engenty calls other servers, here your client calls engenty.`,"integrate.nav":`Integrate`,"integrate.groupApps":`AI apps`,"integrate.groupShare":`Share`,"integrate.shareLink":`Share by link`,"integrate.shareSite":`Put on a website`,"integrate.soon":`soon`,"integrate.stateWorks":`works`,"integrate.stateConnected":`added`,"integrate.stateInstalled":`on this computer`,"integrate.kindMcp":`Tools in the chat: find, run and fill in wizards — and build them.`,"integrate.kindMcpShort":`tools in the chat`,"integrate.kindAppShort":`the wizard as a widget`,"integrate.kindAppNoShort":`this app does not show it`,"integrate.kindApp":`The wizard itself in the chat, page by page, as a widget.`,"integrate.kindAppNo":`This app does not show them — a run comes as text.`,"integrate.where":`Where does the app run?`,"integrate.here":`On this computer`,"integrate.hereHint":`One click, no key. The app starts engenty wizards itself.`,"integrate.hereManaged":`Only with engenty wizards on your computer.`,"integrate.address":`At the address`,"integrate.addressHint":`From anywhere the address can be reached — with a key.`,"integrate.connectTitle":`Add`,"integrate.connectHint":`Adds engenty wizards to the settings of {app}.`,"integrate.connect":`Add to {app}`,"integrate.connected":`Added to {app}`,"integrate.notInstalled":`{app} is not on this computer. You can add it anyway — it works once {app} is there.`,"integrate.file":`Put this into {file}:`,"integrate.vscode":`In VS Code: "MCP: Open User Configuration", then add:`,"integrate.chatgpt":`In ChatGPT: Settings → Apps & Connectors → Advanced → Developer mode, then "Create" with this address:`,"integrate.generic":`In the app's MCP settings, add a server at this address (Streamable HTTP):`,"integrate.oauthLocal":`This app connects from its maker's servers — it cannot reach this computer. Use "On this computer" or an app that runs here.`,"integrate.test":`Test`,"integrate.seen":`{app} checks in`,"integrate.restart":`Quit {app} completely and start it again — then it checks in here.`,"integrate.reload":`Reload the MCP servers in {app}, or restart it.`,"integrate.tool":`Called a tool`,"integrate.askHint":`In a new chat in {app}, write:`,"integrate.askTool":`Which wizards do I have in engenty?`,"integrate.widget":`Showed the wizard as a widget`,"integrate.widgetHint":`Start a published wizard:`,"integrate.askWidget":`Start one of my engenty wizards.`,"integrate.works":`{app} works with your wizards.`,"mcp.notHere":`Not possible with this server`,"mcp.needsPublic":`claude.ai connects from Anthropic's servers. That only works when this server is reachable publicly over HTTPS.`,"mcp.keyTitle":`Create a key`,"mcp.keyHint":`The key signs your client in. It is shown once and goes straight into the command in the next step.`,"mcp.keyCreate":`Create a key for {client}`,"mcp.keyReady":`Key created — it is already in the command below.`,"mcp.keyFirst":`Create the key first — then the finished command shows up here.`,"mcp.add":`Add the server`,"mcp.terminal":`Run in the terminal:`,"mcp.ccPlugin":`Optionally the plugin — it adds the /wizard command:`,"mcp.codexKey":`Run in the terminal — Codex reads the key from an environment variable:`,"mcp.claudeAi":`In claude.ai: Settings → Connectors → Add custom connector, and enter this address:`,"mcp.oauth":`No key needed: on first use your client signs in in the browser.`,"mcp.addressPublic":`Reachable publicly.`,"mcp.addressLocal":`Reachable on this computer only, and only while engenty wizards runs.`,"mcp.keys":`Keys`,"mcp.keysHint":`Each key signs one client in and has every right — treat it like a password. Delete it and that client is signed out.`,"editor.viaClient":`Via {client}`,"editor.changedVia":`Changed via {client}`,"editor.merged":`Merged with changes from elsewhere`,"run.uploadMore":`Another file`,"run.camera":`Camera`,"camera.title":`Take a picture`,"camera.hint":`Hold it flat and well lit.`,"camera.taken":`{n} taken`,"camera.shoot":`Capture`,"camera.done":`Done`,"camera.denied":`The camera is not allowed for this page. Allow it in your browser's site settings (the lock icon in the address bar) — or take the photo with your camera app.`,"connect.go":`Connect`,"connect.connected":`Connected through {name}`,"connect.disconnect":`Disconnect`,"connect.none":`No provider is set up for connecting on this server yet.`,"connect.openLink":`Click here to open the sign-in in a new tab`,"list.empty":`No entries yet.`,"list.delete":`Delete row`,"ask.typeInto":`Type into the page …`,"ask.hide":`hidden`,"ask.up":`Scroll up`,"ask.down":`Scroll down`,"ask.pictureHint":`This is the page the wizard has open. You can also click and type right in the picture.`,"ask.remember":`Remember this sign-in for next time`,"ask.private":`What you enter goes straight into the page. The AI never sees it. Remembered sign-ins are stored encrypted.`,"ask.skip":`Skip`,"ask.done":`I am signed in`,"ask.signIn":`Sign in`,"ask.wants":`The wizard wants to run this in {service}:`,"ask.allowRest":`Allow for the rest of this run`,"ask.allow":`Allow`,"ask.deny":`Don't allow`,"store.open":`What this wizard remembers`,"store.title":`Kept for you`,"store.explain":`This wizard keeps lists, files and connected accounts for your next run. Only you see them.`,"store.empty":`Nothing kept yet.`,"store.rows":`{n} entries`,"store.signIns":`Remembered sign-ins in the browser`,"store.files":`{n} files · {size}`,"store.delete":`Delete everything`,"store.confirmDelete":`Really delete everything`,"common.close":`Close`,"connectors.title":`Connectors`,"connectors.hint":`Services a wizard can work in for the person — they connect their own account during a run. The main ones are built in; any other you find in the integrations.sh registry and import from its OpenAPI spec or its MCP server.`,"connectors.imported":`From the registry`,"connectors.noneImported":`No connector from the registry is imported here.`,"connectors.notSetUp":`not set up`,"connectors.setup":`The server still needs:`,"connectors.search":`Find a service, e.g. Notion, Stripe, GitHub`,"connectors.find":`Search`,"connectors.none":`Nothing found.`,"connectors.import":`Import`,"connectors.exists":`Already imported.`,"connectors.ownClient":`Own OAuth client`,"connectors.refresh":`Reload actions`,"connectors.remove":`Remove`,"connectors.actions":`{n} actions, {r} read-only`,"connectors.pending":`Actions appear once an account is connected`,"connectors.needsClient":`This service needs an OAuth client (id and secret). Remove it and import again with “Own OAuth client”.`,"connectors.authNone":`no sign-in`,"connectors.authOauth":`OAuth sign-in`,"connectors.authKey":`API key`,"connectors.group.read":`reads`,"connectors.group.write":`changes`,"connectors.group.destructive":`deletes`,"run.uploadTouch":`Choose a file`,"run.maxFiles":`At most {n} fit here – I left out the rest.`,"run.filesMin":`{n} of at least {min}`,"run.filesOf":`{n} of at most {max}`,"run.moveFile":`Move no. {n}`,"run.moveFileHint":`Drag to change the order`,"run.removeFile":`Remove`,"run.awake":`The screen stays on while the wizard works.`,"run.openFull":`Open full size`,"run.yes":`Yes`,"run.no":`No`,"run.share":`Share`,"run.shareNow":`Share now`,"run.shareFile":`Share as a file or open in an app`,"camera.asking":`Your browser is about to ask for the camera. The picture stays in this wizard.`,"camera.missing":`No camera was found on this device. Upload a photo instead.`,"camera.busy":`Another app is using the camera. Close it and try again.`,"camera.native":`Open the camera app`,"camera.pick":`Choose a photo`,"camera.torch":`Light`,"camera.flip":`Switch camera`,"camera.photo":`Photo`,"camera.video":`Video`,"camera.record":`Start recording`,"camera.stop":`Stop recording`,"camera.recording":`Recording — tap to stop.`,"camera.clipHint":`A short clip, {s} seconds at most.`,"camera.hintMany":`Capture page after page, then “Done”.`,"scan.button":`Scan`,"scan.title":`Scan a code`,"scan.asking":`Your browser is about to ask for the camera — it only reads the code.`,"scan.hint":`Hold the QR code or barcode inside the frame.`,"scan.hintQr":`Hold the QR code inside the frame. This device does not read barcodes here.`,"scan.miss":`No code was found in the photo. Try closer and sharper.`,"scan.fromPhoto":`Choose a photo of the code`,"scan.typeInstead":`Type it instead`,"location.use":`Use my location`,"location.locating":`Finding your location …`,"location.refining":`getting more exact …`,"location.accuracy":`exact to about {m} m`,"location.map":`Map`,"location.remove":`Remove location`,"location.why":`Your browser asks for your location. It is only used for this wizard. You can also just type the address.`,"location.denied":`Location is not allowed for this page. Allow it in your browser's site settings (the lock icon in the address bar) — or type the address below.`,"location.unavailable":`Your device could not find its location right now. Try again outdoors or type the address.`,"location.timeout":`That took too long. Try again or type the address.`,"location.manual":`Type an address or place`,"location.label":`Address or description of the place`,"voice.start":`Record a voice note`,"voice.stop":`Stop`,"voice.recording":`Recording …`,"voice.left":`{s} s left`,"voice.again":`Record again`,"voice.remove":`Delete`,"voice.pick":`Choose an audio file`,"voice.why":`Your browser asks for the microphone. The recording is turned into text afterwards.`,"voice.denied":`The microphone is not allowed for this page. Allow it in your browser's site settings — or record the note with your voice memo app and choose the file.`,"voice.noRecorder":`This browser cannot record here. Record the note with your voice memo app and choose the file.`,"sign.open":`Sign here`,"sign.hint":`Sign with your finger`,"sign.pad":`Signature pad`,"sign.clear":`Clear`,"sign.accept":`Use it`,"sign.again":`Sign again`,"sign.remove":`Remove signature`,"notify.ask":`Tell me when it is done`,"notify.on":`You will be told`,"notify.why":`With a sound, a buzz or a notification. Your browser asks once for permission.`,"notify.onHint":`You can switch apps — a notification brings you back.`,"notify.quiet":`With a sound and a buzz while this page is open.`,"notify.blocked":`Notifications are blocked for this page — you get a sound and a buzz while it is open. You can allow them in your browser's site settings.`,"notify.done":`Your result is ready.`,"notify.next":`It goes on — have a look.`,"notify.needsYou":`The wizard needs you for a moment.`,"install.add":`Add to home screen`,"install.ios":`Tap “Share” below, then “Add to Home Screen”.`,"install.bookmark":`Bookmark this wizard`,"install.bookmark.mac":`Press ⌘ D to keep this wizard in your bookmarks.`,"install.bookmark.pc":`Press Ctrl + D to keep this wizard in your bookmarks.`,"install.app":`Open in the app`,"install.app.offer":`Install the studio as an app: its own window, its own icon in the Dock or taskbar.`,"install.app.browser":`In Chrome or Edge the studio installs as an app: its own window, its own icon.`,"install.app.action":`Install as app`,"install.app.close":`Close`,"common.offline":`No connection. Check your network and try again.`,"common.retry":`Try again`,"common.cancel":`Cancel`,"common.loading":`Loading …`,"common.error":`Error`,"data.hint":`Tables and pages the space and its wizards keep.`,"data.all":`All data`,"data.own":`General`,"data.table":`Table`,"data.page":`Page`,"data.newTable":`New table`,"data.newPage":`New page`,"data.title":`Title`,"data.owner":`Belongs to`,"data.create":`Create`,"data.empty":`No tables or pages yet. Create one – soon your wizards will write here too.`,"data.rows":`{n} rows`,"data.addRow":`Row`,"data.noRows":`No rows yet.`,"data.deleteRow":`Delete row`,"data.deleteTable":`Delete table`,"data.deletePage":`Delete page`,"data.confirmDelete":`Delete “{title}”?`,"data.newColumn":`New column`,"data.columnName":`Name`,"data.columnType":`Type`,"data.required":`Must be filled in`,"data.deleteColumn":`Delete column`,"data.removeOption":`Remove`,"data.fromList":`A list of the wizard: every run writes into it. The columns come from the wizard.`,"data.badCell":`This value does not fit “{column}” and is not saved.`,"data.type.text":`Text`,"data.type.number":`Number`,"data.type.date":`Date`,"data.type.duration":`Duration`,"data.type.select":`Choice`,"data.type.boolean":`Yes / no`,"data.text.single":`One line`,"data.text.multiline":`Several lines`,"data.number.integer":`Whole number`,"data.number.decimal":`Decimal`,"data.number.percent":`Percent`,"data.number.currency":`Amount`,"data.currency":`Currency (e.g. EUR)`,"data.date.date":`Date`,"data.date.datetime":`Date and time`,"data.date.time":`Time`,"data.unit":`Entered in`,"data.unit.milliseconds":`ms`,"data.unit.seconds":`seconds`,"data.unit.minutes":`minutes`,"data.unit.hours":`hours`,"data.unit.days":`days`,"data.options":`Choices, one per line`,"data.multiple":`Several can be chosen`,"data.write":`Write`,"data.preview":`Preview`,"data.pageEmpty":`This page is still empty.`,"data.markdownHint":`Markdown: # heading, **bold**, - list`,"space.info":`Info & brand`,"space.knowledge":`Knowledge`,"space.data":`Data`,"space.results":`Results`,"space.resultsAll":`All results`,"space.resultsHint":`Runs of your wizards that reached their result, newest first.`,"space.resultsEmpty":`No results yet. A run shows up here once it is done.`,"space.resultCredits":`{n} credits`,"space.resultsSearch":`Search: wizard, answers, result …`,"space.resultsModeAll":`Live & test`,"space.resultsAnyTime":`Any time`,"space.resultsDay":`Last 24 hours`,"space.resultsDays":`Last {n} days`,"space.resultsNone":`No results for this search.`,"space.resultFiles":`{n} files`,"project.rename":`Rename space`,"project.saving":`Saving …`,"project.base":`Basics`,"project.baseHint":`Who is behind the wizards. Every AI step knows this.`,"project.title":`Title`,"project.titleHint":`Company, brand or undertaking — end users see it too.`,"project.about":`About`,"project.aboutHint":`What you do, for whom, and the tone you write in.`,"project.logos":`Logos`,"project.logosHint":`End users see the first logo. A description says what a variant is for.`,"project.logoAdd":`Logo`,"project.logoMain":`Main logo`,"project.logoMakeMain":`Make main logo`,"project.colors":`Colours`,"project.colorsHint":`The first colour is the accent of documents, dashboards and public pages.`,"project.colorAdd":`Colour`,"project.colorName":`e.g. Primary — buttons and headings`,"project.colorUse":`Describe how engenty should use this color.`,"project.colorAddTitle":`Add a colour`,"project.colorValue":`Colour value`,"project.colorUseLabel":`Use`,"project.add":`Add`,"project.colorAccent":`Accent`,"project.colorFirst":`Make accent`,"project.assets":`Assets`,"project.assetsHint":`Images, graphics, videos. AI steps place them in documents and choose by the description.`,"project.assetAdd":`Files`,"project.assetSearch":`Filter assets …`,"know.all":`All`,"know.title":`Knowledge`,"know.hint":`What your wizards' steps look things up in. Documents become pages and tables when they arrive; Kategorien keep the items apart.`,"know.empty":`Nothing here yet. Upload documents, add a page or give the assistant a website.`,"know.drop":`Drop documents here or`,"know.pick":`choose`,"know.page":`Page`,"know.table":`Table`,"know.faq":`FAQ`,"know.file":`File`,"know.category":`Kategorie`,"know.categories":`Kategorien`,"know.newPage":`New page`,"know.newTable":`New table`,"know.asFaq":`As an FAQ: a question and its answer per row`,"know.newCategory":`New Kategorie`,"know.search":`Try a search …`,"know.searchNone":`Nothing relevant found.`,"know.searchStats":`{candidates} candidates checked, {hits} relevant`,"know.searchUnchecked":`{hits} hits, unchecked`,"know.unchecked":`Without a classifier hits stay unchecked. It needs an AI Gateway or TypeSafe key, or an account.`,"know.keywordsOnly":`Without an embedding model the search finds words, not meaning.`,"know.clear":`Reset`,"know.sub":`{n} sub-pages`,"know.rows":`{n} rows`,"know.review":`Check`,"know.reviewed":`Checked`,"know.from":`From {label}`,"know.kept":`Changed by hand: {label} no longer writes it.`,"know.original":`Original`,"know.reading":`Reading …`,"know.subPages":`Sub-pages`,"know.addSub":`Sub-page`,"know.type.choice":`Choice`,"know.type.date":`Date`,"know.type.number":`Number`,"know.type.text":`Text`,"know.type.boolean":`Yes / no`,"know.name":`Name`,"know.type":`Type`,"know.unit":`Unit`,"know.unitHint":`e.g. h, €, kg`,"know.multiple":`Several values per item`,"know.ordered":`The values are ranked (low → high)`,"know.values":`Values`,"know.valuesHint":`One per line. More come with the items.`,"know.hintField":`Where the values come from`,"know.hintFieldHint":`Short, e.g. header, file name, the website's filter.`,"know.create":`Create`,"know.proposed":`Proposed`,"know.proposedHint":`It is filled once it is taken.`,"know.accept":`Take`,"know.dismiss":`Dismiss`,"know.alike":`“{a}” and “{b}” look like one value.`,"know.merge":`Merge`,"know.items":`{n} items`,"know.item":`1 item`,"know.row":`1 row`,"know.oneSub":`1 sub-page`,"know.addValue":`Add a value`,"know.range":`{min} to {max}`,"know.summary":`Overview`,"know.summaryHint":`A model sums up the items of this value. The search finds the overview like a page.`,"know.summaryWrite":`Write the overview`,"know.summaryAgain":`Write again`,"know.summaryEmpty":`No overview yet.`,"know.toc":`Contents`,"know.tocRows":`{n} rows in {table}`,"know.deleteCategory":`Delete Kategorie`,"know.confirmCategory":`Delete “{name}”? The items stay, only the Kategorie goes.`,"know.deleteValue":`Delete value`,"know.yes":`Yes`,"know.no":`No`,"know.minimum":`from`,"know.maximum":`to`,"know.contains":`contains`,"know.by.person":`set by hand`,"know.by.origin":`from the source`,"know.by.model":`read by a model`,"know.remove":`Remove`,"know.unset":`Not set`,"know.deleteFile":`Delete file`,"project.documents":`Documents`,"project.documentsHint":`PDFs, lists, Excel, Word, text. They are read and put into an index every AI step searches.`,"project.documentAdd":`Documents`,"project.drop":`Drop here or`,"project.staysLocal":`Stays in your local install and is not sent here.`,"project.description":`Add a description …`,"project.describing":`Looking at it …`,"project.reading":`Reading …`,"project.indexed":`In the index`,"project.indexedKeywords":`In the index (keywords)`,"project.notIndexed":`No text found`,"project.reindex":`Read again`,"project.pages":`{n} pages`,"project.keywordsOnly":`The index searches by keywords right now. With an AI Gateway or OpenAI key it also searches by meaning.`,"project.preview":`Preview`,"project.viewList":`Show as a list`,"project.viewCards":`Show as cards`,"project.original":`Original`,"project.readText":`Text as read`,"project.openOriginal":`Open the original`,"project.noText":`No text yet: the document is still being read, or could not be read.`,"project.textCut":`The preview shows the start ({shown} of {total} characters).`,"project.searchTest":`Search the index …`,"project.searchNone":`Nothing found.`,"project.remove":`Remove`,"project.removeConfirm":`Remove “{name}”?`,"project.facts":`Facts`,"project.factsHint":`What wizards should know: address, VAT id, opening hours — anything that fits.`,"project.factLabel":`Label`,"project.factValue":`Value`,"project.factAdd":`Entry`,"project.factType":`Type`,"project.factAuto":`Automatic`,"project.type.text":`Text`,"project.type.longtext":`Long text`,"project.type.number":`Number`,"project.type.date":`Date`,"project.type.url":`Link`,"project.type.email":`Email`,"project.type.phone":`Phone`,"project.type.boolean":`Yes / No`,"project.yes":`Yes`,"project.no":`No`,"project.assistant":`Assistant`,"project.assistantTitle":`Tell me about yourselves`,"project.assistantHello":`Name your website or give me files. I fill in what I find: title, description, logo, colours and facts.`,"project.assistantComposer":`e.g. “Read our website example.com” …`,"project.assistantTitleKnowledge":`What should your wizards know?`,"project.assistantHelloKnowledge":`Give me documents or tell me where the knowledge is. I read it in – below you see what goes in.`,"project.assistantComposerKnowledge":`Attach documents or say where the knowledge is …`,"project.assistantChanged":`Space updated`,"flowApp.loading":`The wizard is on its way …`,"flowApp.draft":`Draft`,"flowApp.published":`Published`,"flowApp.issues":`{n} issues in the draft`,"flowApp.flow":`Flow`,"flowApp.notPublished":`Publish it in the studio to run it here.`,"flowApp.runPage":`Continue in the browser`,"flowApp.inBrowser":`Only in the browser: {fields}`,"flowApp.done":`Done`,"flowApp.credits":`{n} credits`,"flowApp.ask":`The wizard asks`,"flowApp.allow":`Allow`,"flowApp.skip":`Skip`,"flowApp.signIn":`A sign-in at {site} — only in the browser.`,"flowApp.fullscreen":`Larger`,"flowApp.inline":`Smaller`,"flowApp.failed":`That did not work: {error}`},db=`wizards.lang`;function fb(){try{let e=localStorage.getItem(db);return e===`de`||e===`en`?e:null}catch{return null}}var pb=fb()??(typeof navigator<`u`&&!navigator.language.toLowerCase().startsWith(`de`)?`en`:`de`),mb=pb===`de`?lb:ub,hb=new Set;function gb(e){if(e!==pb){pb=e,mb=e===`de`?lb:ub,document.documentElement.lang=e;try{localStorage.setItem(db,e)}catch{}for(let e of hb)e()}}function _b(e){return e.note&&cb(e.note,pb)||e.message}function Q(e,t){let n=mb[e]??lb[e]??e;for(let[e,r]of Object.entries(t??{}))n=n.replace(`{${e}}`,String(r));return n}typeof document<`u`&&(document.documentElement.lang=pb),cy();var vb=`wizards.theme`,yb=new Set,bb=window.matchMedia(`(prefers-color-scheme: dark)`);function xb(){try{let e=localStorage.getItem(vb);return e===`light`||e===`dark`?e:null}catch{return null}}var Sb=0;function Cb(){return Sb>0?`dark`:xb()??(bb.matches?`dark`:`light`)}function wb(){requestAnimationFrame(()=>{let e=document.querySelector(`meta[name="theme-color"]`),t=document.createElement(`canvas`).getContext(`2d`);if(!e||!t||!document.body)return;t.fillStyle=getComputedStyle(document.body).backgroundColor,t.fillRect(0,0,1,1);let[n,r,i]=t.getImageData(0,0,1,1).data;e.content=`#${[n,r,i].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`})}function Tb(){let e=Cb()===`dark`;document.documentElement.classList.toggle(`dark`,e),wb();for(let e of yb)e()}bb.addEventListener(`change`,Tb),Tb();function Eb(){return(0,y.useSyncExternalStore)(e=>(yb.add(e),()=>yb.delete(e)),()=>document.documentElement.classList.contains(`dark`)?`dark`:`light`)}var Db=e=>`oklch(from ${ay[sy[e]??`cobalt`]} 0.34 calc(c * 0.6) h)`;function $(...e){return e.filter(Boolean).join(` `)}var Ob={primary:`bg-primary text-primary-foreground hover:brightness-[1.06] active:brightness-95 shadow-[0_1px_0_oklch(0%_0_0/0.08)]`,secondary:`bg-card text-ink border border-border hover:bg-paper-2`,ghost:`text-ink-2 hover:text-ink hover:bg-accent`,quiet:`bg-paper-2 text-ink hover:bg-paper-3`,danger:`text-rose hover:bg-rose-tint`},kb=(0,y.forwardRef)(function({variant:e=`primary`,size:t=`md`,busy:n,className:r,children:i,disabled:a,...o},s){return(0,Z.jsxs)(`button`,{ref:s,type:`button`,disabled:a||n,className:$(`inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-full font-medium transition-[background,filter,color,transform] duration-150 active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50`,t===`sm`&&`h-8 px-3 text-[0.8125rem] coarse:h-11 coarse:px-4`,t===`md`&&`h-10 px-4 text-sm coarse:h-11`,t===`lg`&&`h-12 px-6 text-[0.9375rem]`,Ob[e],r),...o,children:[n?(0,Z.jsx)(Bb,{className:`size-4`}):null,i]})});function Ab({label:e,className:t,children:n,...r}){return(0,Z.jsx)(`button`,{type:`button`,"aria-label":e,title:e,className:$(`inline-flex size-9 shrink-0 items-center justify-center rounded-full text-ink-3 transition hover:bg-accent hover:text-ink disabled:opacity-40 coarse:size-11`,t),...r,children:n})}var jb=`rounded-lg border border-input bg-card px-3.5 text-[0.9375rem] text-ink shadow-[inset_0_1px_0_oklch(0%_0_0/0.02)] outline-none transition placeholder:text-ink-4 focus:border-focus focus:ring-4 focus:ring-focus-glow disabled:opacity-60`;function Mb(e){return/(^|\s)w-/.test(e??``)?null:`w-full`}var Nb=(0,y.forwardRef)(function({className:e,...t},n){return(0,Z.jsx)(`input`,{ref:n,className:$(jb,Mb(e),`h-11`,e),...t})});function Pb(e){return(0,Z.jsx)(`input`,{type:`color`,className:`swatch size-11 shrink-0 cursor-pointer rounded-lg border border-input bg-card p-1`,...e})}var Fb=(0,y.forwardRef)(function({className:e,minRows:t=3,maxRows:n=14,onChange:r,...i},a){let o=(0,y.useRef)(null),s=()=>{let e=o.current;if(!e)return;let r=Number.parseFloat(getComputedStyle(e).lineHeight)||22;e.style.height=`auto`;let i=r*n+20;e.style.height=`${Math.min(Math.max(e.scrollHeight,r*t+20),i)}px`,e.style.overflowY=e.scrollHeight>i?`auto`:`hidden`};return(0,y.useLayoutEffect)(s),(0,Z.jsx)(`textarea`,{ref:e=>{o.current=e,typeof a==`function`?a(e):a&&(a.current=e)},className:$(jb,Mb(e),`resize-none py-2.5 leading-[1.5]`,e),onChange:e=>{s(),r?.(e)},...i})});function Ib({value:e,onChange:t,options:n,className:r,placeholder:i}){return(0,Z.jsxs)(`div`,{className:$(`relative`,r),children:[(0,Z.jsxs)(`select`,{value:e,onChange:e=>t(e.target.value),className:$(jb,`h-11 w-full appearance-none pr-9`),children:[i===void 0?null:(0,Z.jsx)(`option`,{value:``,children:i}),n.map(e=>(0,Z.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))]}),(0,Z.jsx)(`svg`,{className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 size-4 text-ink-3`,viewBox:`0 0 16 16`,fill:`none`,children:(0,Z.jsx)(`path`,{d:`M4 6l4 4 4-4`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})]})}function Lb({value:e,onChange:t,options:n,multi:r,disabled:i}){let a=new Set(Array.isArray(e)?e:e?[e]:[]);return(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>{let o=a.has(e);return(0,Z.jsx)(`button`,{type:`button`,"aria-pressed":o,disabled:i?.includes(e),onClick:()=>{if(r){let r=new Set(a);o?r.delete(e):r.add(e),t(n.filter(e=>r.has(e)))}else t(e)},className:$(`h-10 rounded-full border px-4 text-sm transition disabled:pointer-events-none disabled:opacity-60 disabled:line-through coarse:h-11`,o?`border-ember bg-ember-tint text-ink`:`border-input bg-card text-ink-2 hover:border-ink-4 hover:text-ink`),children:e},e)})})}function Rb({checked:e,onChange:t,label:n,disabled:r}){return(0,Z.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":n,disabled:r,onClick:()=>t(!e),className:$(`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition before:absolute before:-inset-x-1 before:-inset-y-2.5 before:content-[''] disabled:pointer-events-none disabled:opacity-60`,e?`bg-primary`:`bg-paper-3`),children:(0,Z.jsx)(`span`,{className:$(`inline-block size-5 rounded-full bg-white shadow-sm transition-transform`,e?`translate-x-[22px]`:`translate-x-[2px]`)})})}function zb({children:e,hint:t,required:n}){return(0,Z.jsxs)(`div`,{className:`mb-2`,children:[(0,Z.jsxs)(`div`,{className:`font-medium text-[0.875rem] text-ink`,children:[e,n?(0,Z.jsx)(`span`,{className:`ml-1 text-ember`,children:`*`}):null]}),t?(0,Z.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:t}):null]})}function Bb({className:e}){return(0,Z.jsxs)(`svg`,{className:$(`size-5 animate-spin`,e),viewBox:`0 0 24 24`,fill:`none`,children:[(0,Z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,stroke:`currentColor`,strokeOpacity:`0.2`,strokeWidth:`3`}),(0,Z.jsx)(`path`,{d:`M21 12a9 9 0 0 0-9-9`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`})]})}function Vb({className:e,children:t,...n}){return(0,Z.jsx)(`div`,{className:$(`rounded-xl bg-card shadow-soft ring-1 ring-border-soft`,e),...n,children:t})}function Hb({children:e,tone:t=`neutral`,icon:n,title:r}){return(0,Z.jsxs)(`span`,{title:r,className:$(`inline-flex h-6 items-center gap-1.5 whitespace-nowrap rounded-full px-2.5 font-medium text-[0.75rem]`,t===`neutral`&&`bg-paper-2 text-ink-2`,t===`live`&&`bg-moss-tint text-moss`,t===`warn`&&`bg-amber-tint text-ink-2`,t===`ember`&&`bg-ember-tint text-ember-strong`),children:[n??(t===`live`?(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-moss`}):null),e]})}function Ub({open:e,onClose:t,title:n,children:r,wide:i,bare:a}){let o=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=o.current;t&&(e&&!t.open?(t.showModal(),t.querySelector(`[data-autofocus]`)?.focus()):!e&&t.open&&t.close())},[e]),(0,Z.jsx)(`dialog`,{ref:o,onClose:t,onClick:e=>{e.target===o.current&&t()},className:$(`m-auto p-0 text-ink backdrop:bg-[oklch(20%_0.01_60/0.28)] backdrop:backdrop-blur-[2px]`,a?`w-[calc(100%-48px)] overflow-visible bg-transparent max-sm:m-0 max-sm:h-dvh max-sm:max-h-none max-sm:w-full max-sm:max-w-none`:`max-h-[calc(100dvh-32px)] w-[calc(100%-32px)] overflow-y-auto overscroll-contain rounded-2xl bg-card shadow-overlay`,i===`page`?`sm:max-w-4xl`:i?`sm:max-w-2xl`:`sm:max-w-md`,!a&&(i===`page`?`max-w-4xl`:i?`max-w-2xl`:`max-w-md`)),children:e&&a?r:e?(0,Z.jsxs)(`div`,{className:`p-5 sm:p-7`,children:[n?(0,Z.jsxs)(`div`,{className:`mb-5 flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`h2`,{className:`min-w-0 font-display font-semibold text-xl`,children:n}),(0,Z.jsx)(Ab,{label:Q(`common.close`),onClick:t,className:`-mt-1.5 -mr-2`,children:(0,Z.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,className:`size-4`,"aria-hidden":`true`,children:(0,Z.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})})]}):null,r]}):null})}function Wb(e){let t=qb.get(e);if(t)return t;if(!Jb){let e=document.createElement(`canvas`);e.width=1,e.height=1,Jb=e.getContext(`2d`,{willReadFrequently:!0})}let n=[.5,.5,.5];if(Jb){Jb.clearRect(0,0,1,1),Jb.fillStyle=`#808080`,Jb.fillStyle=e,Jb.fillRect(0,0,1,1);let[t,r,i]=Jb.getImageData(0,0,1,1).data;n=[t/255,r/255,i/255]}return qb.set(e,n),n}function Gb(e,t){let n=Yb.get(e);return n||(n=document.createElement(`span`),n.setAttribute(`aria-hidden`,`true`),n.style.cssText=`position:absolute;width:0;height:0;overflow:hidden;visibility:hidden`,e.appendChild(n),Yb.set(e,n)),n.style.color=``,n.style.color=t,Wb(getComputedStyle(n).color||`#808080`)}function Kb(e,t){let n=Gb(e,ay[sy[t]]),r=Math.max(...n),i=[Math.min(1,n[0]+n[0]/(r||1)*.45),Math.min(1,n[1]+n[1]/(r||1)*.45),Math.min(1,n[2]+n[2]/(r||1)*.45)];return{body:Xb(n,[1,1,1],.12),deep:Xb(n,[.03,.02,.06],.62),tip:Xb(i,[1,1,1],.12)}}var qb,Jb,Yb,Xb,Zb=o((()=>{cy(),qb=new Map,Jb=null,Yb=new WeakMap,Xb=(e,t,n)=>[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n]})),Qb,$b=o((()=>{Qb=`
|
|
115
|
+
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:L().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:L().optional().describe(`User's timezone in IANA format.`),userAgent:L().optional().describe(`Host application identifier.`),platform:W([q(`web`),q(`desktop`),q(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:H({touch:z().optional().describe(`Whether the device supports touch input.`),hover:z().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:H({top:R().describe(`Top safe area inset in pixels.`),right:R().describe(`Right safe area inset in pixels.`),bottom:R().describe(`Bottom safe area inset in pixels.`),left:R().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),Cg=H({method:q(`ui/notifications/host-context-changed`),params:Sg.describe(`Partial context update containing only changed fields.`)});H({method:q(`ui/update-model-context`),params:H({content:V(pd).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:G(L(),B().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),H({method:q(`ui/initialize`),params:H({appInfo:ou.describe(`App identification (name and version).`),appCapabilities:vg.describe(`Features and capabilities this app provides.`),protocolVersion:L().describe(`Protocol version this app supports.`)})});var wg=H({protocolVersion:L().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:ou.describe(`Host application identification and version.`),hostCapabilities:_g.describe(`Features and capabilities provided by the host.`),hostContext:Sg.describe(`Rich context about the host environment.`)}).passthrough(),Tg={target:`draft-2020-12`};async function Eg(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](Tg);throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Dg(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}function Og(e,t){let n={...e,...t};return t.experimental!==void 0&&(n.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(n.tools={...e.tools,...t.tools}),n}var kg=class e extends Ch{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new Jh;_methods=new Yh;setRequestHandler=(...e)=>{let[t,...n]=Zh(`request`,e)??e;this._methods.claim(t,`setRequestHandler`),super.setRequestHandler.call(this,t,...n)};setNotificationHandler=(...e)=>{let[t,...n]=Zh(`notification`,e)??e;this._methods.claim(t,`setNotificationHandler`),super.setNotificationHandler.call(this,t,...n)};removeRequestHandler=e=>{this._methods.release(e),super.removeRequestHandler(e)};removeNotificationHandler=e=>{this._methods.release(e),super.removeNotificationHandler(e)};replaceRequestHandler=(e,...t)=>{this._methods.replace(e),super.setRequestHandler.call(this,e,...t)};_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:lg,toolinputpartial:ug,toolresult:xg,toolcancelled:dg,hostcontextchanged:Cg};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.setHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.addEventListener(e,t)}removeEventListener(e,t){this._events.removeEventListener(e,t)}_ensureEventSlot(e){if(this._registeredEvents.has(e))return;let t=this.eventSchemas[e];if(!t)throw Error(`Unknown event: ${String(e)}`);this.setNotificationHandler(t.shape.method.value,{params:t.shape.params},t=>{let n=t;e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...n}),this._events.dispatch(e,n)}),this._registeredEvents.add(e)}getEventHandler(e){return this._events.getHandler(e)}warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._appCapabilities=t,this.options=n,this._methods.replace(`notifications/cancelled`),this._methods.replace(`notifications/progress`),!n.allowUnsafeEval&&dt({jitless:!0}),this.replaceRequestHandler(`ping`,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}buildContext(e){return e}registerAppCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._appCapabilities=Og(this._appCapabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._appCapabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await Dg(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await Dg(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await Eg(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await Eg(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(`ui/resource-teardown`,{params:mg.shape.params,result:hg},(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(`tools/call`,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(`tools/list`,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;default:return}}assertNotificationCapability(e){}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},t)}async createSamplingMessage(e,t){return this._assertInitialized(`createSamplingMessage`),await this.request({method:`sampling/createMessage`,params:e},t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},og,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},eu,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},ig,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},ag,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},yg,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new eg(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1;try{await super.connect(e);let n=await this.request({method:`ui/initialize`,params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:$h}},wg,t);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);this._hostCapabilities=n.hostCapabilities,this._hostInfo=n.hostInfo,this._hostContext=n.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}},Ag=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function jg(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Ag(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Mg=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},Ng=e=>{let t=Mg(e);return t.charAt(0).toUpperCase()+t.slice(1)},Pg=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Fg={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Ig(e){return e!=null}function Lg(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Fg.width,a=e.size??e.height??Fg.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Pg(...c):Pg(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Fg[`stroke-width`])*Number(e.size??e.width??Fg.width)/Number(t.size??t.width??Fg.width):t.strokeWidth??Fg[`stroke-width`];return[`svg`,{...Object.entries(Fg).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Ig(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Ig(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Ig(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Rg(e,t={}){return Lg(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var zg=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Bg=(0,y.createContext)({}),Vg=()=>(0,y.useContext)(Bg),Hg=(0,y.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=Vg()??{},b=!!c||zg(d),[x,S,C=[]]=Rg(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Pg(v,s),hasA11yProp:b,attributes:d});return(0,y.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Y(e,t=[],n=[]){let r=typeof e==`string`?jg(e,t,n):e,i=(0,y.forwardRef)(({className:e,...t},n)=>(0,y.createElement)(Hg,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Ng(r.name)),i}var Ug={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};Ug.node;var Wg=Y(Ug),Gg={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};Gg.node;var Kg=Y(Gg),qg={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};qg.node;var Jg=Y(qg),Yg={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};Yg.node;var Xg=Y(Yg),Zg={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Zg.node;var Qg=Y(Zg),$g={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};$g.node;var e_=Y($g),t_={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};t_.node;var n_=Y(t_),r_={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};r_.node;var i_=Y(r_),a_={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};a_.node;var o_=Y(a_),s_={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};s_.node;var c_=Y(s_),l_={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};l_.node;var u_=Y(l_),d_={name:`clapperboard`,size:24,node:[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]};d_.node;var f_=Y(d_),p_={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};p_.node;var m_=Y(p_),h_={name:`corner-down-left`,size:24,node:[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]};h_.node;var g_=Y(h_),__={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};__.node;var v_=Y(__),y_={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};y_.node;var b_=Y(y_),x_={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};x_.node;var S_=Y(x_),C_={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};C_.node;var w_=Y(C_),T_={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};T_.node;var E_=Y(T_),D_={name:`file-headphone`,size:24,node:[[`path`,{d:`M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343`,key:`1vfytu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0`,key:`1etmh7`}]],aliases:[`file-audio`,`file-audio-2`]};D_.node;var O_=Y(D_),k_={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};k_.node;var A_=Y(k_),j_={name:`film`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]};j_.node;var M_=Y(j_),N_={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};N_.node;var P_=Y(N_),F_={name:`flashlight-off`,size:24,node:[[`path`,{d:`M11.652 6H18`,key:`voqkpr`}],[`path`,{d:`M12 13v1`,key:`176q98`}],[`path`,{d:`M16 16v4a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V6`,key:`dzyf92`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M7.649 2H17a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8a4 4 0 0 0-.55 1.007`,key:`1hvcfn`}]]};F_.node;var I_=Y(F_),L_={name:`flashlight`,size:24,node:[[`path`,{d:`M12 13v1`,key:`176q98`}],[`path`,{d:`M17 2a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8A4 4 0 0 0 16 12v8a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V3a1 1 0 0 1 1-1z`,key:`17vh7j`}],[`path`,{d:`M6 6h12`,key:`n6hhss`}]]};L_.node;var R_=Y(L_),z_={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};z_.node;var B_=Y(z_),V_={name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};V_.node;var H_=Y(V_),U_={name:`image-up`,size:24,node:[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19.5 3-3 3 3`,key:`9vmjn0`}],[`path`,{d:`M17 22v-5.5`,key:`1aa6fl`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};U_.node;var W_=Y(U_),G_={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};G_.node;var K_=Y(G_),q_={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};q_.node;var J_=Y(q_),Y_={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};Y_.node;var X_=Y(Y_),Z_={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Z_.node;var Q_=Y(Z_),$_={name:`locate-fixed`,size:24,node:[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};$_.node;var ev=Y($_),tv={name:`lock-keyhole`,size:24,node:[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]};tv.node;var nv=Y(tv),rv={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};rv.node;var iv=Y(rv),av={name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]};av.node;var ov=Y(av),sv={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};sv.node;var cv=Y(sv),lv={name:`mic`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]};lv.node;var uv=Y(lv),dv={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};dv.node;var fv=Y(dv),pv={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};pv.node;var mv=Y(pv),hv={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};hv.node;var gv=Y(hv),_v={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};_v.node;var vv=Y(_v),yv={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};yv.node;var bv=Y(yv),xv={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};xv.node;var Sv=Y(xv),Cv={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Cv.node;var wv=Y(Cv),Tv={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Tv.node;var Ev=Y(Tv),Dv={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Dv.node;var Ov=Y(Dv),kv={name:`scan-line`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}]]};kv.node;var Av=Y(kv),jv={name:`scan`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]};jv.node;var Mv=Y(jv),Nv={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};Nv.node;var Pv=Y(Nv),Fv={name:`share`,size:24,node:[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]};Fv.node;var Iv=Y(Fv),Lv={name:`shield-check`,size:24,node:[[`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`}]]};Lv.node;var Rv=Y(Lv),zv={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};zv.node;var Bv=Y(zv),Vv={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};Vv.node;var Hv=Y(Vv),Uv={name:`switch-camera`,size:24,node:[[`path`,{d:`M11 19H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5`,key:`mtk2lu`}],[`path`,{d:`M13 5h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-5`,key:`120jsl`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m18 22-3-3 3-3`,key:`kgdoj7`}],[`path`,{d:`m6 2 3 3-3 3`,key:`1fnbkv`}]]};Uv.node;var Wv=Y(Uv),Gv={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Gv.node;var Kv=Y(Gv),qv={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};qv.node;var Jv=Y(qv),Yv={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Yv.node;var Xv=Y(Yv),Zv={name:`unplug`,size:24,node:[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]};Zv.node;var Qv=Y(Zv),$v={name:`video`,size:24,node:[[`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`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]};$v.node;var ey=Y($v),ty={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};ty.node;var ny=Y(ty),ry={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};ry.node;var iy=Y(ry),ay={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};ay.node;var oy=Y(ay),sy,cy,ly,uy=o((()=>{sy={cobalt:`var(--engenty-cobalt, oklch(60% 0.23 262))`,amber:`var(--engenty-amber, oklch(82% 0.17 78))`,moss:`var(--engenty-moss, oklch(72% 0.22 145))`,rose:`var(--engenty-rose, oklch(64% 0.25 18))`,ember:`var(--engenty-ember, oklch(70% 0.21 42))`,teal:`var(--engenty-teal, oklch(74% 0.16 192))`,violet:`var(--engenty-violet, oklch(60% 0.25 300))`,magenta:`var(--engenty-magenta, oklch(65% 0.28 345))`,citron:`var(--engenty-citron, oklch(89% 0.2 118))`,slate:`var(--engenty-slate, oklch(66% 0.13 235))`},cy=[`round`,`drop`,`dome`,`flame`,`oval`],[...cy],ly={bean:`teal`,dome:`moss`,drop:`amber`,flame:`rose`,oval:`ember`,pebble:`slate`,round:`cobalt`,sprout:`citron`,tower:`violet`,wedge:`magenta`}}));function dy(e){return Math.max(...e.blobs.map(e=>e.r*Math.min(e.rx??1,e.ry??1)))}function fy(e){let t=new Float32Array(hy*4);for(let n=0;n<hy;n++){let r=e.blobs[n];if(!r){t[n*4]=1e4,t[n*4+1]=1e4,t[n*4+2]=0,t[n*4+3]=0;continue}t[n*4]=r.x,t[n*4+1]=r.y,t[n*4+2]=r.r*(r.rx??1),t[n*4+3]=r.r*(r.ry??1)}return t}function py(e){let t=new Float32Array(gy*4),n=new Float32Array(gy*4);return e.extras?.forEach((e,r)=>{let i=r*4;switch(n[i]=_y[e.type],n[i+1]=e.alpha??1,e.type){case`ink-dot`:t.set([e.x,e.y,e.r,0],i);break;case`body-dot`:t.set([e.x,e.y,e.r,e.bob??0],i);break;case`arc`:t.set([e.cx,e.cy,e.r,e.half*Math.PI/180],i),n[i+2]=e.width,n[i+3]=+!!e.body;break;case`bar`:t.set([e.x,e.y,e.half,0],i),n[i+2]=e.width;break;case`wave`:t.set([e.x,e.y,e.len,e.amp],i),n[i+2]=e.width}}),{geometry:t,meta:n}}var my,hy,gy,_y,vy=o((()=>{my={round:{blobs:[{x:60,y:61,r:36,rx:1,ry:1.06}],extras:[{type:`body-dot`,x:97,y:34,r:6,alpha:.5,bob:3},{type:`body-dot`,x:106,y:24,r:3.5,alpha:.35,bob:3.5}],falloff:2.2,fur:9,period:3.6,eye:{x:68,y:58,r:8},shadowRx:26},drop:{blobs:[{x:60,y:70,r:30,rx:1,ry:.95},{x:60,y:40,r:20,rx:.85,ry:1.15},{x:60,y:22,r:9,rx:.7,ry:1}],extras:[{type:`wave`,x:48,y:76,len:24,amp:2,width:2.6}],falloff:1.7,fur:8.5,period:4.4,eye:{x:60,y:56,r:8},shadowRx:24},dome:{blobs:[{x:60,y:72,r:32,rx:1.02,ry:.82},{x:60,y:46,r:28,rx:1,ry:1}],extras:[{type:`bar`,x:46,y:85,half:5,width:2.4,alpha:.5},{type:`bar`,x:60,y:87,half:5,width:2.4,alpha:.5},{type:`bar`,x:74,y:85,half:5,width:2.4,alpha:.5},{type:`body-dot`,x:60,y:6,r:3,bob:2.5}],falloff:1.7,fur:9,period:3,eye:{x:60,y:54,r:8.5},shadowRx:27},flame:{blobs:[{x:60,y:80,r:22,rx:1,ry:.95},{x:60,y:54,r:19,rx:.95,ry:1.1},{x:60,y:30,r:12,rx:.72,ry:1.25},{x:60,y:16,r:5,rx:.6,ry:1.1}],extras:[{type:`arc`,cx:60,cy:45,r:32,half:39,width:3,alpha:.55,body:!0},{type:`ink-dot`,x:60,y:82,r:2.6}],falloff:1.6,fur:7.5,period:2.6,eye:{x:60,y:62,r:8},shadowRx:22},oval:{blobs:[{x:60,y:64,r:40,rx:1.06,ry:.76}],extras:[{type:`arc`,cx:60,cy:223,r:172,half:10.7,width:2.2,alpha:.45},{type:`arc`,cx:60,cy:261,r:191,half:10.3,width:2.2,alpha:.45}],falloff:2.2,fur:10,period:4,eye:{x:66,y:58,r:8},shadowRx:32},bean:{blobs:[{x:46,y:76,r:24},{x:74,y:54,r:22}],extras:[{type:`body-dot`,x:32,y:94,r:4,alpha:.4}],falloff:1.7,fur:9,period:3.8,eye:{x:70,y:58,r:8},shadowRx:26},pebble:{blobs:[{x:56,y:76,r:32,rx:1.3,ry:.66},{x:86,y:74,r:18,rx:1,ry:.7}],extras:[{type:`ink-dot`,x:42,y:76,r:3,alpha:.32},{type:`ink-dot`,x:56,y:86,r:2.2,alpha:.32},{type:`ink-dot`,x:86,y:80,r:2.6,alpha:.32}],falloff:1.8,fur:9.5,period:4.6,eye:{x:68,y:72,r:7.5},shadowRx:34},sprout:{blobs:[{x:60,y:74,r:28},{x:48,y:34,r:8,rx:.75,ry:1.15},{x:72,y:32,r:7,rx:.75,ry:1.15}],falloff:1.7,fur:8.5,period:3.2,eye:{x:60,y:68,r:8.5},shadowRx:26},tower:{blobs:[{x:60,y:86,r:19},{x:60,y:60,r:17},{x:60,y:36,r:14}],extras:[{type:`arc`,cx:60,cy:154,r:80,half:13,width:2.2,alpha:.4},{type:`arc`,cx:60,cy:187,r:99,half:11.7,width:2.2,alpha:.4}],falloff:1.6,fur:8,period:4,eye:{x:60,y:52,r:8},shadowRx:20},wedge:{blobs:[{x:44,y:84,r:20},{x:76,y:84,r:20},{x:60,y:48,r:14}],extras:[{type:`arc`,cx:60,cy:28,r:10,half:53,width:3,alpha:.5,body:!0}],falloff:1.7,fur:8.5,period:2.9,eye:{x:60,y:70,r:8},shadowRx:28}},hy=Math.max(...Object.values(my).map(e=>e.blobs.length)),gy=Math.max(...Object.values(my).map(e=>e.extras?.length??0)),_y={"ink-dot":1,"body-dot":2,arc:3,bar:4,wave:5}})),yy=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),by=s(((e,t)=>{t.exports=yy()}));function xy(e,t){let n=1/0,r=-1/0;for(let i of my[e].blobs){let e=i.r*(i.rx??1),a=i.r*(i.ry??1),o=(t-i.y)/a;if(Math.abs(o)>=1)continue;let s=e*Math.sqrt(1-o*o);n=Math.min(n,i.x-s),r=Math.max(r,i.x+s)}return[n,r]}function Sy(e){let{x:t,y:n,r}=my[e].eye,i=r*1.45,a=r*.42,[o,s]=xy(e,n);return{band:r*.95,left:o,lens:i,outer:i+a/2,right:s,rim:a,x:t,y:n}}function Cy({g:e}){let t=(t,n)=>n-t>1?(0,Ty.jsxs)(`g`,{children:[(0,Ty.jsx)(`rect`,{fill:Ey,height:e.band,rx:e.band*.3,width:n-t,x:t,y:e.y-e.band/2}),(0,Ty.jsx)(`line`,{stroke:Dy,strokeDasharray:`1.6 1.6`,strokeWidth:.6,x1:t+1,x2:n-1,y1:e.y,y2:e.y})]}):null;return(0,Ty.jsxs)(`g`,{className:`e-goggles`,children:[t(e.left+1.5,e.x-e.outer+.5),t(e.x+e.outer-.5,e.right-1.5),(0,Ty.jsx)(`circle`,{cx:e.x,cy:e.y,fill:Ay,r:e.lens}),(0,Ty.jsx)(`circle`,{cx:e.x,cy:e.y,fill:`none`,r:e.lens,stroke:Oy,strokeWidth:e.rim}),(0,Ty.jsx)(`circle`,{cx:e.x,cy:e.y,fill:`none`,r:e.outer,stroke:ky,strokeWidth:.7}),[45,135,225,315].map(t=>(0,Ty.jsx)(`circle`,{cx:e.x+Math.cos(t*Math.PI/180)*e.lens,cy:e.y+Math.sin(t*Math.PI/180)*e.lens,fill:ky,r:.9},t)),(0,Ty.jsx)(`path`,{d:`M ${e.x-e.lens*.62} ${e.y-e.lens*.2} A ${e.lens*.66} ${e.lens*.66} 0 0 1 ${e.x-e.lens*.1} ${e.y-e.lens*.64}`,fill:`none`,opacity:.75,stroke:`#fff`,strokeLinecap:`round`,strokeWidth:1.3})]})}function wy({kind:e}){return(0,Ty.jsx)(Cy,{g:Sy(e)})}var Ty,Ey,Dy,Oy,ky,Ay,jy=o((()=>{vy(),Ty=by(),Ey=`oklch(40% 0.07 50)`,Dy=`oklch(30% 0.06 45)`,Oy=`oklch(74% 0.12 80)`,ky=`oklch(55% 0.1 70)`,Ay=`oklch(88% 0.05 220 / 0.32)`}));function My(){Vy=0;let e=window.innerHeight,t=!1;for(let n of zy){let r=n.svg.getBoundingClientRect();if(r.bottom<-40||r.top>e+40)continue;let i=r.left+r.width*.5,a=r.top+r.height*.48,o=By.x-i,s=By.y-a,c=Math.hypot(o,s)||1,l=o/c,u=s/c,d=Math.min(r.width,r.height)*2.4,f=.35+Math.min(1,c/d)*.65,p=l*5.5*f,m=u*3.5*f,h=l*7*f+u*1.2*f;n.tx=Wy(n.tx,p,.16),n.ty=Wy(n.ty,m,.16),n.rot=Wy(n.rot,h,.14),n.lean&&n.lean.setAttribute(`transform`,`translate(${n.tx.toFixed(2)} ${n.ty.toFixed(2)}) rotate(${n.rot.toFixed(2)} 60 62)`),n.shadow&&(n.shadow.setAttribute(`cx`,(60-n.tx*.35).toFixed(2)),n.shadow.setAttribute(`opacity`,String(Math.max(.08,.14-Math.abs(n.ty)*.008))));let g=n.ex+l*n.max*f,_=n.ey+1+u*n.max*.9*f;n.px=Wy(n.px,g,.24),n.py=Wy(n.py,_,.24),n.pupil&&(n.pupil.setAttribute(`cx`,n.px.toFixed(2)),n.pupil.setAttribute(`cy`,n.py.toFixed(2))),n.glint&&(n.glint.setAttribute(`cx`,(n.px-2).toFixed(2)),n.glint.setAttribute(`cy`,(n.py-3.4).toFixed(2))),(Math.abs(n.tx-p)>.05||Math.abs(n.px-g)>.05)&&(t=!0)}(t||Hy-->0)&&(Vy=requestAnimationFrame(My))}function Ny(){Hy=48,Vy||=requestAnimationFrame(My)}function Py(e){By.x=e.clientX,By.y=e.clientY,Ny()}function Fy(){Uy||typeof window>`u`||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||(Uy=!0,By.x=window.innerWidth*.62,By.y=window.innerHeight*.28,window.addEventListener(`pointermove`,Py,{passive:!0}),Ny())}function Iy(){zy.size>0||Uy&&(Uy=!1,window.removeEventListener(`pointermove`,Py),Vy&&=(cancelAnimationFrame(Vy),0))}function Ly(e,t,n=!0){let r=(0,Ry.useRef)(t);r.current=t,(0,Ry.useEffect)(()=>{let t=e.current;if(!(t&&n)||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let{ex:i,ey:a,max:o=3.2}=r.current,s={svg:t,lean:t.querySelector(`.e-lean`),pupil:t.querySelector(`.e-pupil`),glint:t.querySelector(`.e-glint`),shadow:t.querySelector(`.e-shadow`),ex:i,ey:a,max:o,tx:0,ty:0,rot:0,px:i,py:a+1};return zy.add(s),Fy(),Ny(),()=>{zy.delete(s),Iy()}},[e,n,t.ex,t.ey,t.max])}var Ry,zy,By,Vy,Hy,Uy,Wy,Gy=o((()=>{Ry=u(f(),1),zy=new Set,By={x:0,y:0},Vy=0,Hy=0,Uy=!1,Wy=(e,t,n)=>e+(t-e)*n}));function Ky({ex:e,ey:t,max:n,ink:r,r:i,blink:a=`5.2s`}){let o=i*1.15;return(0,X.jsxs)(`g`,{className:`e-eye`,"data-ex":e,"data-ey":t,"data-max":n,children:[(0,X.jsx)(`ellipse`,{cx:e,cy:t,fill:`#fff`,rx:i,ry:o,children:(0,X.jsx)(`animate`,{attributeName:`ry`,dur:a,keyTimes:`0;0.92;0.95;1`,repeatCount:`indefinite`,values:`${o};${o};${i*.1};${o}`})}),(0,X.jsx)(`circle`,{className:`e-pupil`,cx:e,cy:t+1,fill:r,r:i*.48}),(0,X.jsx)(`circle`,{className:`e-glint`,cx:e-i*.25,cy:t-i*.3,fill:`#fff`,r:i*.18})]})}function qy(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:sy.cobalt,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`3.6s`,repeatCount:`indefinite`,values:`M60 22 Q96 26 96 62 Q96 96 60 100 Q24 96 24 62 Q24 26 60 22 Z;M60 30 Q100 20 94 62 Q98 102 60 95 Q22 102 26 62 Q20 22 60 30 Z;M60 22 Q96 26 96 62 Q96 96 60 100 Q24 96 24 62 Q24 26 60 22 Z`})}),(0,X.jsx)(`circle`,{cx:`97`,cy:`34`,fill:sy.cobalt,opacity:`0.5`,r:`6`,children:(0,X.jsx)(`animate`,{attributeName:`cy`,dur:`3.6s`,repeatCount:`indefinite`,values:`34;28;34`})}),(0,X.jsx)(`circle`,{cx:`106`,cy:`24`,fill:sy.cobalt,opacity:`0.35`,r:`3.5`,children:(0,X.jsx)(`animate`,{attributeName:`cy`,begin:`0.4s`,dur:`3.6s`,repeatCount:`indefinite`,values:`24;17;24`})}),(0,X.jsx)(Ky,{blink:`5.2s`,ex:68,ey:58,ink:`oklch(18% 0.08 260)`,max:3.4,r:8})]})}function Jy(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:sy.amber,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`4.4s`,repeatCount:`indefinite`,values:`M60 16 Q90 34 90 66 Q90 96 60 98 Q30 96 30 66 Q30 34 60 16 Z;M50 20 Q92 30 88 66 Q92 98 60 96 Q28 98 32 66 Q26 36 50 20 Z;M70 20 Q94 36 90 66 Q88 98 60 96 Q32 98 32 66 Q30 30 70 20 Z;M60 16 Q90 34 90 66 Q90 96 60 98 Q30 96 30 66 Q30 34 60 16 Z`})}),(0,X.jsx)(Ky,{blink:`4.4s`,ex:60,ey:56,ink:`oklch(30% 0.10 60)`,max:3.2,r:8}),(0,X.jsx)(`path`,{d:`M48 76 Q54 72 60 76 Q66 80 72 76`,fill:`none`,stroke:`oklch(30% 0.10 55)`,strokeLinecap:`round`,strokeWidth:`2.6`})]})}function Yy(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:sy.moss,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`3s`,repeatCount:`indefinite`,values:`M60 20 Q92 30 92 70 Q92 96 60 96 Q28 96 28 70 Q28 30 60 20 Z;M60 30 Q98 36 96 74 Q96 98 60 98 Q24 98 24 74 Q22 36 60 30 Z;M60 12 Q88 26 88 68 Q88 94 60 94 Q32 94 32 68 Q32 26 60 12 Z;M60 20 Q92 30 92 70 Q92 96 60 96 Q28 96 28 70 Q28 30 60 20 Z`})}),(0,X.jsx)(`path`,{d:`M46 90 L46 80 M60 92 L60 82 M74 90 L74 80`,opacity:`0.5`,stroke:`oklch(28% 0.10 155)`,strokeLinecap:`round`,strokeWidth:`2.4`}),(0,X.jsx)(`circle`,{cx:`60`,cy:`6`,fill:sy.moss,r:`3`,children:(0,X.jsx)(`animate`,{attributeName:`cy`,dur:`3s`,repeatCount:`indefinite`,values:`8;3;8`})}),(0,X.jsx)(Ky,{blink:`4.6s`,ex:60,ey:54,ink:`oklch(16% 0.08 160)`,max:3.4,r:8.5})]})}function Xy(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:sy.rose,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`2.6s`,repeatCount:`indefinite`,values:`M60 14 Q84 44 80 76 Q78 98 60 98 Q42 98 40 76 Q36 44 60 14 Z;M52 18 Q86 40 82 76 Q80 98 60 98 Q40 98 38 76 Q32 46 52 18 Z;M68 18 Q88 46 82 76 Q80 98 60 98 Q40 98 38 76 Q34 40 68 18 Z;M60 14 Q84 44 80 76 Q78 98 60 98 Q42 98 40 76 Q36 44 60 14 Z`})}),(0,X.jsx)(`path`,{d:`M40 20 Q60 6 80 20`,fill:`none`,opacity:`0.55`,stroke:sy.rose,strokeLinecap:`round`,strokeWidth:`3`,children:(0,X.jsx)(`animate`,{attributeName:`opacity`,dur:`2.6s`,repeatCount:`indefinite`,values:`0.55;0.15;0.55`})}),(0,X.jsx)(Ky,{blink:`3.8s`,ex:60,ey:62,ink:`oklch(22% 0.10 18)`,max:3.2,r:8}),(0,X.jsx)(`circle`,{cx:`60`,cy:`82`,fill:`oklch(22% 0.10 18)`,r:`2.6`})]})}function Zy(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:sy.ember,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M60 34 Q100 38 100 64 Q100 92 60 94 Q20 92 20 64 Q20 38 60 34 Z;M60 40 Q110 40 108 66 Q108 96 60 96 Q12 96 12 66 Q10 40 60 40 Z;M60 28 Q92 36 92 62 Q92 88 60 90 Q28 88 28 62 Q28 36 60 28 Z;M60 34 Q100 38 100 64 Q100 92 60 94 Q20 92 20 64 Q20 38 60 34 Z`})}),(0,X.jsxs)(`g`,{fill:`none`,opacity:`0.45`,stroke:`oklch(40% 0.16 30)`,strokeWidth:`2.2`,children:[(0,X.jsx)(`path`,{d:`M28 54 Q60 48 92 54`,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M28 54 Q60 48 92 54;M20 56 Q60 50 100 56;M32 52 Q60 46 88 52;M28 54 Q60 48 92 54`})}),(0,X.jsx)(`path`,{d:`M26 70 Q60 64 94 70`,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M26 70 Q60 64 94 70;M18 72 Q60 66 102 72;M30 68 Q60 62 90 68;M26 70 Q60 64 94 70`})})]}),(0,X.jsx)(Ky,{blink:`4.2s`,ex:66,ey:58,ink:`oklch(24% 0.10 30)`,max:3.2,r:8})]})}function Qy(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:sy.teal,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`3.8s`,repeatCount:`indefinite`,values:`M48 96 Q24 92 26 68 Q28 44 52 38 Q78 32 88 50 Q98 66 84 84 Q70 100 48 96 Z;M46 98 Q20 92 24 66 Q28 40 54 36 Q80 30 90 50 Q100 68 84 86 Q68 102 46 98 Z;M50 94 Q28 90 28 68 Q30 46 52 40 Q76 34 86 50 Q94 64 82 82 Q72 98 50 94 Z;M48 96 Q24 92 26 68 Q28 44 52 38 Q78 32 88 50 Q98 66 84 84 Q70 100 48 96 Z`})}),(0,X.jsx)(`circle`,{cx:`32`,cy:`94`,fill:sy.teal,opacity:`0.4`,r:`4`,children:(0,X.jsx)(`animate`,{attributeName:`cx`,dur:`3.8s`,repeatCount:`indefinite`,values:`32;27;32`})}),(0,X.jsx)(Ky,{blink:`4.8s`,ex:70,ey:58,ink:`oklch(18% 0.08 200)`,max:3.4,r:8})]})}function $y(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:sy.slate,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`4.6s`,repeatCount:`indefinite`,values:`M60 96 Q20 96 18 78 Q16 60 46 56 Q78 52 98 62 Q110 72 104 86 Q98 96 60 96 Z;M60 98 Q14 98 14 78 Q14 58 46 54 Q80 50 102 62 Q114 74 106 88 Q98 98 60 98 Z;M60 94 Q26 94 22 78 Q20 62 46 58 Q76 54 94 62 Q106 70 100 84 Q94 94 60 94 Z;M60 96 Q20 96 18 78 Q16 60 46 56 Q78 52 98 62 Q110 72 104 86 Q98 96 60 96 Z`})}),(0,X.jsxs)(`g`,{fill:`oklch(30% 0.05 244)`,opacity:`0.32`,children:[(0,X.jsx)(`circle`,{cx:`42`,cy:`76`,r:`3`}),(0,X.jsx)(`circle`,{cx:`56`,cy:`86`,r:`2.2`}),(0,X.jsx)(`circle`,{cx:`86`,cy:`80`,r:`2.6`})]}),(0,X.jsx)(Ky,{blink:`5.6s`,ex:68,ey:72,ink:`oklch(20% 0.06 244)`,max:3,r:7.5})]})}function eb(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`g`,{fill:sy.citron,children:[(0,X.jsx)(`ellipse`,{cx:`48`,cy:`34`,rx:`6`,ry:`10`,children:(0,X.jsx)(`animate`,{attributeName:`cy`,dur:`3.2s`,repeatCount:`indefinite`,values:`34;30;34`})}),(0,X.jsx)(`ellipse`,{cx:`72`,cy:`32`,rx:`5.5`,ry:`9`,children:(0,X.jsx)(`animate`,{attributeName:`cy`,begin:`0.5s`,dur:`3.2s`,repeatCount:`indefinite`,values:`32;28;32`})})]}),(0,X.jsx)(`path`,{fill:sy.citron,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`3.2s`,repeatCount:`indefinite`,values:`M60 100 Q28 98 28 72 Q28 46 60 44 Q92 46 92 72 Q92 98 60 100 Z;M60 102 Q24 100 24 72 Q24 42 60 40 Q96 42 96 72 Q96 100 60 102 Z;M60 98 Q32 96 32 72 Q32 50 60 48 Q88 50 88 72 Q88 96 60 98 Z;M60 100 Q28 98 28 72 Q28 46 60 44 Q92 46 92 72 Q92 98 60 100 Z`})}),(0,X.jsx)(Ky,{blink:`4.2s`,ex:60,ey:68,ink:`oklch(24% 0.09 108)`,max:3.4,r:8.5})]})}function tb(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:sy.violet,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M60 102 Q36 100 38 78 Q40 58 42 44 Q44 26 60 24 Q76 26 78 44 Q80 58 82 78 Q84 100 60 102 Z;M60 104 Q32 102 36 78 Q40 56 40 42 Q40 22 60 20 Q80 22 80 42 Q80 56 84 78 Q88 102 60 104 Z;M60 100 Q40 98 40 78 Q42 60 44 46 Q46 30 60 28 Q74 30 76 46 Q78 60 80 78 Q80 98 60 100 Z;M60 102 Q36 100 38 78 Q40 58 42 44 Q44 26 60 24 Q76 26 78 44 Q80 58 82 78 Q84 100 60 102 Z`})}),(0,X.jsxs)(`g`,{fill:`none`,opacity:`0.4`,stroke:`oklch(28% 0.10 308)`,strokeLinecap:`round`,strokeWidth:`2.2`,children:[(0,X.jsx)(`path`,{d:`M42 74 Q60 70 78 74`}),(0,X.jsx)(`path`,{d:`M40 88 Q60 84 80 88`})]}),(0,X.jsx)(Ky,{blink:`5s`,ex:60,ey:52,ink:`oklch(20% 0.09 308)`,max:3.2,r:8})]})}function nb(){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{fill:sy.magenta,children:(0,X.jsx)(`animate`,{attributeName:`d`,dur:`2.9s`,repeatCount:`indefinite`,values:`M60 30 Q74 40 86 70 Q96 92 78 98 Q60 102 42 98 Q24 92 34 70 Q46 40 60 30 Z;M60 24 Q78 38 90 70 Q100 94 78 100 Q60 104 42 100 Q20 94 30 70 Q42 38 60 24 Z;M60 34 Q72 44 82 70 Q92 90 76 96 Q60 100 44 96 Q28 90 38 70 Q48 44 60 34 Z;M60 30 Q74 40 86 70 Q96 92 78 98 Q60 102 42 98 Q24 92 34 70 Q46 40 60 30 Z`})}),(0,X.jsx)(`path`,{d:`M52 22 Q60 14 68 22`,fill:`none`,opacity:`0.5`,stroke:sy.magenta,strokeLinecap:`round`,strokeWidth:`3`,children:(0,X.jsx)(`animate`,{attributeName:`opacity`,dur:`2.9s`,repeatCount:`indefinite`,values:`0.5;0.12;0.5`})}),(0,X.jsx)(Ky,{blink:`3.6s`,ex:60,ey:70,ink:`oklch(22% 0.10 345)`,max:3.2,r:8})]})}function rb({kind:e}){switch(e){case`drop`:return(0,X.jsx)(Jy,{});case`dome`:return(0,X.jsx)(Yy,{});case`flame`:return(0,X.jsx)(Xy,{});case`oval`:return(0,X.jsx)(Zy,{});case`bean`:return(0,X.jsx)(Qy,{});case`pebble`:return(0,X.jsx)($y,{});case`sprout`:return(0,X.jsx)(eb,{});case`tower`:return(0,X.jsx)(tb,{});case`wedge`:return(0,X.jsx)(nb,{});default:return(0,X.jsx)(qy,{})}}function ib({animated:e=!0,goggles:t=!1,kind:n=`round`,size:r=160,className:i}){let a=(0,ab.useRef)(null),o=ob[n],s=sb[n];return Ly(a,o,e),(0,ab.useEffect)(()=>{let t=a.current;if(!t)return;let n=typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(e&&!n){t.unpauseAnimations();return}t.pauseAnimations(),t.setCurrentTime(0)},[e]),(0,X.jsxs)(`svg`,{"aria-hidden":`true`,className:i,height:r,overflow:`visible`,ref:a,style:{display:`block`},viewBox:`0 0 120 120`,width:r,children:[(0,X.jsx)(`ellipse`,{className:`e-shadow`,cx:`60`,cy:s.cy,fill:`#000`,opacity:`0.14`,rx:s.rx,ry:`4.5`,children:(0,X.jsx)(`animate`,{attributeName:`rx`,dur:s.dur,repeatCount:`indefinite`,values:`${s.rx};${s.rx*.8};${s.rx}`})}),(0,X.jsxs)(`g`,{className:`e-lean`,children:[(0,X.jsx)(rb,{kind:n}),t?(0,X.jsx)(wy,{kind:n}):null]})]})}var ab,X,ob,sb,cb=o((()=>{ab=u(f(),1),uy(),jy(),Gy(),X=by(),ob={round:{ex:68,ey:58,max:3.4},drop:{ex:60,ey:56,max:3.2},dome:{ex:60,ey:54,max:3.4},flame:{ex:60,ey:62,max:3.2},oval:{ex:66,ey:58,max:3.2},bean:{ex:70,ey:58,max:3.4},pebble:{ex:68,ey:72,max:3},sprout:{ex:60,ey:68,max:3.4},tower:{ex:60,ey:52,max:3.2},wedge:{ex:60,ey:70,max:3.2}},sb={round:{cy:108,rx:26,dur:`3.6s`},drop:{cy:106,rx:24,dur:`4.4s`},dome:{cy:104,rx:27,dur:`3s`},flame:{cy:106,rx:22,dur:`2.6s`},oval:{cy:102,rx:32,dur:`4s`},bean:{cy:102,rx:26,dur:`3.8s`},pebble:{cy:102,rx:34,dur:`4.6s`},sprout:{cy:106,rx:26,dur:`3.2s`},tower:{cy:108,rx:20,dur:`4s`},wedge:{cy:106,rx:28,dur:`2.9s`}}}));uy(),cb();var Z=by(),lb={batchDone:{de:`{done} von {total} fertig`,en:`{done} of {total} done`},editing:{de:`Bearbeitet {n} von {total}`,en:`Editing {n} of {total}`},filming:{de:`Dreht {n} von {total}`,en:`Filming {n} of {total}`},clipsRendering:{de:`{count} Clips werden gerendert – das dauert einige Minuten.`,en:`Rendering {count} clips – this takes a few minutes.`},videoRendering:{de:`Das Video wird gerendert – das dauert meist 1–3 Minuten.`,en:`Rendering the video – this usually takes 1–3 minutes.`},photo:{de:`Sieht sich Foto {n} von {total} an`,en:`Looking at photo {n} of {total}`},listen:{de:`Hört „{label}“ an …`,en:`Listening to “{label}” …`},listenFailed:{de:`„{label}“ konnte nicht verschriftlicht werden.`,en:`“{label}” could not be written down.`},filmCutting:{de:`Der Film wird geschnitten – das dauert etwa eine Minute.`,en:`Cutting the film – this takes about a minute.`},filmProgress:{de:`{pct} % geschnitten`,en:`{pct} % cut`},filmError:{de:`Der Film meldet: {detail}`,en:`The film reports: {detail}`},widgetError:{de:`Das Widget meldet einen Fehler: {detail}`,en:`The widget reports an error: {detail}`},mcpConnected:{de:`Verbunden mit {names}`,en:`Connected to {names}`},mcpUnreachable:{de:`MCP-Server nicht erreichbar: {detail}`,en:`MCP server unreachable: {detail}`},reads:{de:`Liest {name}`,en:`Reading {name}`},readsMany:{de:`Liest {count} Dokumente`,en:`Reading {count} documents`},opens:{de:`Öffnet {name}`,en:`Opening {name}`},clicks:{de:`Klickt im Browser`,en:`Clicking in the browser`},types:{de:`Tippt im Browser`,en:`Typing in the browser`},looksAtPage:{de:`Sieht sich die Seite an`,en:`Looking at the page`},waitsForSignIn:{de:`Wartet auf deine Anmeldung bei {name}`,en:`Waiting for you to sign in at {name}`},downloads:{de:`Lädt {name} herunter`,en:`Downloading {name}`},runs:{de:`Führt aus: {command}`,en:`Running: {command}`},python:{de:`Führt Python aus`,en:`Running Python`},drawing:{de:`Zeichnet ein Bild`,en:`Drawing an image`},writesPage:{de:`Schreibt die Seite „{title}“`,en:`Writing the page “{title}”`},searchesDocuments:{de:`Sucht in den Dokumenten: {query}`,en:`Searching the documents: {query}`},searchesKnowledge:{de:`Sucht in Wissen: {query} – {relevant} von {candidates} passen`,en:`Searching the knowledge: {query} – {relevant} of {candidates} fit`},listsKnowledge:{de:`Listet Wissen`,en:`Listing the knowledge`},searchesMail:{de:`Durchsucht {label}`,en:`Searching {label}`},savesReceipts:{de:`Speichert {count} Belege aus {label}`,en:`Saving {count} receipts from {label}`},remembers:{de:`Merkt sich {title}`,en:`Remembering {title}`},files:{de:`Legt {count} Dateien ab`,en:`Filing {count} files`},filmSetup:{de:`Richtet den Arbeitsordner für den Film ein`,en:`Setting up the folder for the film`},filmClient:{de:`{client} arbeitet am Film – das dauert meist 10–40 Minuten.`,en:`{client} is working on the film – this usually takes 10–40 minutes.`},filmTask:{de:`Am Film: {task}`,en:`On the film: {task}`},filmLooks:{de:`Sieht sich Bilder des Films an`,en:`Looking at frames of the film`},filmFix:{de:`Der Film ließ sich nicht rendern – Claude Code bessert nach`,en:`The film did not render – Claude Code is fixing it`},filmResume:{de:`Macht dort weiter, wo der Film stehen geblieben ist`,en:`Picking the film up where it stopped`}};function ub(e,t){let n=lb[e.code];return n?n[t].replace(/\{(\w+)\}/g,(t,n)=>e.params?.[n]===void 0?t:String(e.params[n])):``}var db={"brand.tagline":`Wünsch dir was. Wir bauen deinen Wizard.`,"brand.sub":`Er führt dich Schritt für Schritt zum Ergebnis. Die KI erledigt die Arbeit.`,"auth.dev":`Dev-Login (lokal)`,"auth.legal":`Kein Passwort, keine Registrierung – du meldest dich mit einem bestehenden Konto an.`,"auth.signIn":`Anmelden oder Konto erstellen`,"auth.failed":`Die Anmeldung hat nicht geklappt. Bitte noch einmal versuchen.`,"auth.localLink":`Öffne den Link, den die App beim Start ausgegeben hat – er meldet dich an diesem Gerät an.`,"nav.account":`Konto & Guthaben`,"setup.keysInAccount":`API-Schlüssel für Skripte gehören zu deinem Konto. Du legst sie dort an und ziehst sie dort zurück.`,"setup.openAccount":`Konto öffnen`,"class.label":`Modell-Klasse`,"class.classifier":`Classifier`,"class.standard":`Standard`,"class.high":`High`,"class.highest":`Highest`,"class.image":`Bild`,"class.video":`Video`,"class.audio":`Audio`,"class.speech":`Sprachausgabe`,"class.classifier.hint":`Zuordnen, Ja/Nein, wenige Werte aus Text ziehen. Am günstigsten.`,"class.standard.hint":`Kurze Texte, eine API aufrufen, umformatieren.`,"class.high.hint":`Recherche mit Werkzeugen, lange Dokumente, Abwägen vieler Quellen.`,"class.highest.hint":`Schweres Abwägen oder Code. Mehrfach so teuer wie High.`,"class.effort":`Denkaufwand`,"class.effortAuto":`Automatisch`,"class.effort.low":`Niedrig`,"class.effort.medium":`Mittel`,"class.effort.high":`Hoch`,"estimate.step":`≈ {n} Credits, selten mehr als {high}`,"estimate.measured":`gemessen aus den letzten Läufen`,"estimate.formula":`geschätzt, wird nach fünf Läufen genauer`,"estimate.share":`Ein Lauf kostet etwa {run} Credits. Beim Tageslimit sind es höchstens {day} Credits am Tag.`,"local.title":`Modelle`,"local.accountWaiting":`Warte auf die Anmeldung im Browser …`,"local.accountFailed":`Der Konto-Dienst ist gerade nicht erreichbar.`,"local.accountExpired":`Die Anmeldung ist abgelaufen. Bitte neu anmelden.`,"local.sourceNeedsAccount":`Dafür brauchst du ein Konto.`,"local.toAccount":`Zu Einstellungen → Konto`,"local.sourceOwn":`Eigene Schlüssel`,"local.keys":`Schlüssel`,"local.keysHint":`Ein Schlüssel reicht. Schlüssel liegen im Schlüsselbund dieses Geräts, nie in der Datenbank.`,"local.keySet":`hinterlegt`,"local.keyEmpty":`nicht hinterlegt`,"local.keyRemove":`Entfernen`,"local.classes":`Modell je Klasse`,"local.classesHint":`Ein Schritt nennt nur die Klasse. Hier steht, welches Modell sie bedient, z. B. anthropic/claude-haiku-4.5, openai:gpt-5.4-mini oder ollama:qwen3.`,"local.save":`Speichern`,"local.saved":`Gespeichert`,"local.chat":`Der Chat im Studio antwortet über`,"local.chatModels":`Modell-Klasse Highest`,"local.chatClaude":`Claude-Abo (Claude Code)`,"local.subscription":`Mit dem Abo baut das auf diesem Gerät installierte Claude Code den Wizard – mit deiner Anmeldung dort. Läufe nutzen weiter Schlüssel oder Guthaben.`,"harness.hint":`Texte denkt das auf diesem Gerät installierte {name} – mit deinem {sub} und deiner Anmeldung dort. Kein Schlüssel nötig. Bilder, Videos und Audio brauchen weiter einen Schlüssel.`,"harness.hintImages":`Texte und Bilder macht das auf diesem Gerät installierte {name} – mit deinem {sub} und deiner Anmeldung dort. Kein Schlüssel nötig. Videos und Audio brauchen weiter einen Schlüssel.`,"harness.found":`{name} {version} gefunden`,"harness.missing":`{name} ist auf diesem Gerät nicht installiert.`,"harness.install":`Oder in deinem eigenen Terminal:`,"harness.installButton":`{name} installieren`,"harness.installing":`{name} wird im Terminal unten installiert – das dauert etwa eine Minute. Danach meldest du es an.`,"harness.installEnded":`Die Installation ist zu Ende, aber {name} ist nicht da. Was oben steht, sagt warum.`,"harness.appHere":`Die {app}-App ist auf diesem Computer: {name} meldet sich mit demselben {sub} an.`,"harness.notInstalled":`nicht installiert`,"harness.authSubscription":`Angemeldet mit deinem {sub}.`,"harness.authKey":`Angemeldet mit einem API-Schlüssel aus deiner Shell – nicht mit dem Abo. Melde dich hier an, damit es über dein {sub} läuft.`,"harness.authNone":`Noch nicht angemeldet.`,"harness.signIn":`Hier anmelden`,"harness.signingIn":`Die Anmeldung läuft im Terminal unten – dein Browser öffnet sich dafür. Das Terminal schließt sich, sobald die Anmeldung da ist.`,"harness.signInInteractive":`Unten startet {name}. Wähle dort die Anmeldung mit deinem {sub} und melde dich im Browser an. Das Terminal schließt sich, sobald die Anmeldung da ist.`,"harness.loginEnded":`Die Anmeldung wurde beendet, ohne dass {name} angemeldet ist.`,"harness.sub.claude":`Claude-Abo`,"harness.sub.codex":`ChatGPT-Abo`,"harness.sub.gemini":`Google-Konto`,"harness.sub.cursor":`Cursor-Abo`,"harness.desc.claude":`Mit deinem Claude-Abo – kein Schlüssel nötig.`,"harness.desc.codex":`Mit deinem ChatGPT-Abo – kein Schlüssel nötig.`,"harness.desc.gemini":`Mit deinem Google-Konto – kein Schlüssel nötig.`,"harness.desc.cursor":`Mit deinem Cursor-Abo – kein Schlüssel nötig.`,"harness.ready":`angemeldet`,"local.recheck":`Erneut prüfen`,"local.test":`Testen`,"local.testHint":`Ein kurzer Aufruf zeigt, ob der Weg zum Modell offen ist.`,"local.testOk":`Antwort in {s} s über {ref}: „{reply}“`,"local.testFailed":`Der Test hat nicht geklappt: {error}`,"models.groupCaps":`Fähigkeiten`,"models.groupAccess":`Zugänge`,"models.groupMore":`Weitere Anbieter`,"models.cap.text":`Text & Denken`,"models.cap.text.hint":`Schreibt, fasst zusammen, recherchiert und entscheidet – in fast jedem Schritt.`,"models.cap.image":`Bilder`,"models.cap.image.hint":`Erzeugt Bilder: Logos, Produktfotos, Illustrationen.`,"models.cap.video":`Videos`,"models.cap.video.hint":`Erzeugt kurze Clips aus Text oder aus einem Bild.`,"models.cap.speech":`Sprachausgabe`,"models.cap.speech.hint":`Liest Texte vor: Voice-over, Hörfassungen, Ansagen.`,"models.cap.listening":`Sprachnotizen`,"models.cap.listening.hint":`Versteht Gesprochenes und macht aus Sprachnotizen Text.`,"models.way.local":`Lokales Modell`,"models.way.credits":`Guthaben`,"models.way.creditsTeam":`Guthaben des Teams`,"models.way.none":`nicht eingerichtet`,"models.who":`Wer macht das?`,"models.optSubscription":`Dein Abo`,"models.optKey":`Eigener API Key`,"models.optLocal":`Lokales Modell`,"models.optLocalNote":`Ollama auf diesem Computer`,"models.noteIncluded":`im Abo enthalten`,"models.noteSignedOut":`nicht angemeldet`,"models.noteMissing":`nicht installiert`,"models.noteKey":`API Key hinterlegt`,"models.noteKeyShort":`Key`,"models.noteSignedIn":`angemeldet`,"models.noteShellKey":`API Key aus der Shell`,"models.optOther":`Sonst`,"models.optCreditsGroup":`engenty`,"models.noteNoKey":`API Key fehlt`,"models.noteNeedsAccount":`Konto nötig`,"models.notePerImage":`≈ {n} Credits je Bild`,"models.notePerSecond":`≈ {n} Credits je Sekunde`,"models.notePer1k":`≈ {n} Credits je 1000 Zeichen`,"models.notePerMinute":`≈ {n} Credits je Minute`,"models.creditsAuto":`engenty wählt: {model}`,"models.creditsAutoNone":`engenty wählt das Modell`,"models.creditsPickHint":`Abgerechnet in Credits – ohne eigenen API Key.`,"models.viaCredits":`{name} über engenty Guthaben`,"models.viaCreditsHint":`Ohne eigenen API Key, abgerechnet in Credits.`,"models.viaCreditsNeedsAccount":`Mit einem engenty-Konto, abgerechnet in Credits.`,"models.noteUsage":`Credits nach Verbrauch`,"models.model":`Modell`,"models.modelCustom":`Eigenes Modell …`,"models.textSimple":`Einfache Schritte`,"models.textDemanding":`Anspruchsvolle Schritte`,"models.perClass":`Je Klasse anpassen`,"models.manageKey":`API Key von {name}`,"models.key":`API Key`,"models.keyFor":`API Key von {name}`,"models.keyGet":`Key bei {name} holen`,"models.keySave":`Prüfen und speichern`,"models.keyStored":`API Key hinterlegt`,"models.keyNone":`Kein API Key`,"models.keyCheck":`Prüfen`,"models.keyReplace":`Ersetzen`,"models.keyRemove":`Entfernen`,"models.keyOk":`Der Key gilt.`,"models.keyBad":`Der Key wurde nicht angenommen.`,"models.keyWhereLocal":`Der Key bleibt auf diesem Gerät, nie in der Datenbank.`,"models.keyWhereCloud":`Der Key liegt verschlüsselt beim Team. Niemand sieht ihn wieder.`,"models.keyFallback":`Bis der Key da ist, springt das Guthaben ein.`,"models.uses":`Wofür`,"models.useFor":`Nutzen`,"models.inUse":`wird genutzt`,"models.try":`Ausprobieren`,"models.try.text":`Testen`,"models.try.image":`Probebild erzeugen`,"models.try.video":`Probeclip erzeugen`,"models.try.speech":`Probe anhören`,"models.try.listening":`Zuhören testen`,"models.tryCost":`Kostet wie ein echter Aufruf.`,"models.tryCostVideo":`Ein Clip von 4 Sekunden – kostet wie ein echter.`,"models.tryWait":`Wird erzeugt …`,"models.tryWaitVideo":`Ein Clip dauert ein bis zwei Minuten …`,"models.tryOk":`In {s} s mit {model}`,"models.tryHeard":`Gehört: „{text}“`,"models.tryHeardNothing":`Nichts gehört – der Weg ist offen.`,"models.tryFailed":`Hat nicht geklappt: {error}`,"models.creditsName":`engenty Guthaben`,"models.creditsTeam":`Guthaben des Teams`,"models.creditsLocalLead":`Springt ein, wo kein Abo und kein eigener API Key eingerichtet ist.`,"models.creditsCloudHint":`Alles ohne eigenen API Key läuft über das Guthaben. Eigene Keys gehen vor und kosten keine Credits.`,"models.creditsConnectTitle":`Mit einem Konto`,"models.creditsLocalHint":`Mit einem engenty-Konto springt das Guthaben ein, wo nichts Eigenes eingerichtet ist – etwa für Videos ohne eigenen API Key.`,"models.creditsConnect":`Konto verbinden`,"models.creditsFallback":`Guthaben springt ein`,"models.creditsFallbackOn":`Was kein Abo und keinen eigenen API Key hat, läuft über das Guthaben.`,"models.creditsFallbackOff":`Aus: Was kein Abo und keinen eigenen API Key hat, läuft nicht.`,"models.creditsOn":`Läuft über das Guthaben`,"models.creditsNone":`Gerade läuft nichts über das Guthaben.`,"models.creditsTopUp":`Aufladen`,"models.creditsPicks":`engenty wählt das Modell und rechnet in Credits ab.`,"models.creditsModel":`Gerade: {model}.`,"models.clientSignIn":`Anmeldung`,"models.clientImages":`{name} erzeugt Bilder mit deinem {sub} – ohne eigenen API Key.`,"models.clientNotChosen":`Text läuft gerade nicht über {name}.`,"models.ollamaHint":`Adresse von Ollama und das Modell, das dort läuft.`,"models.readOnly":`Nur Admins des Teams ändern die Modelle.`,"models.viewAs":`Vorschau als`,"models.view.auto":`wie es ist`,"models.view.local":`lokal`,"models.view.linked":`lokal + Konto`,"models.view.cloud":`Cloud-Studio`,"setup.title":`Setup`,"setup.sub":`Engenty kann deine vorhandenen Konten auf deinem Computer nutzen.`,"setup.source":`Womit soll die Engenty denken?`,"setup.local":`Läuft lokal auf diesem Gerät.`,"setup.stage.connect":`Verbinden`,"setup.stage.test":`Testen`,"setup.stage.done":`Fertig`,"setup.h.install":`Installiere {name}`,"setup.h.signIn":`Melde {name} an`,"setup.h.keys":`Trage einen Schlüssel ein`,"setup.h.test":`Ein kurzer Test`,"setup.h.done":`Verbunden.`,"setup.ready":`Alles bereit.`,"setup.noHarness":`Noch kein KI-Client installiert. Wähle einen – er wird hier installiert – oder trage eigene Schlüssel ein.`,"setup.ownDesc":`AI Gateway, OpenAI, Anthropic oder Ollama.`,"setup.recommended":`Empfohlen`,"setup.done":`Zum Studio`,"setup.untilWorks":`Das Studio öffnet sich, sobald der Test klappt.`,"cloud.onPublish":`Sobald du den Wizard veröffentlichst, geht die Version auch in die Cloud deines Kontos und läuft dort hinter einem eigenen Link.`,"cloud.notSent":`Diese Version ist noch nicht in der Cloud.`,"cloud.send":`Jetzt senden`,"cloud.resend":`Erneut senden`,"cloud.again":`Um {when} wird es noch einmal versucht.`,"cloud.sent":`Version {v} · gesendet am {when}`,"cloud.notRunnable":`Version {v} läuft in der Cloud nicht.`,"cloud.keepsRunning":`Dort läuft weiter Version {v}.`,"cloud.nothingRuns":`Dort läuft deshalb noch nichts.`,"cloud.notes":`Was in der Cloud anders läuft:`,"cloud.check":`Was dem jetzigen Stand in der Cloud fehlen würde:`,"cloud.checkBlocking":`So, wie der Wizard jetzt ist, würde er in der Cloud nicht laufen:`,"cloud.documents":`Die Dokumente des Space bleiben auf diesem Gerät. In der Cloud arbeiten die Schritte ohne sie.`,"cloud.stepName":`„{title}“`,"cloud.problem.sandbox":`Der Server hat keine Maschine für Code. Dort läuft das ohne sie.`,"cloud.problem.mcp":`Die MCP-Server des Space gibt es auf dem Server nicht: {detail}.`,"cloud.problem.model":`Dafür gibt es in der Cloud kein Modell.`,"cloud.problem.connector":`Dem Space fehlt in der Cloud ein Connector.`,"cloud.problem.invalid":`So nimmt der Server den Wizard nicht an.`,"cloud.spaceLimit":`In der Cloud deines Kontos liegt schon der Space einer anderen Installation:`,"cloud.replace":`Bisherigen Space ersetzen`,"cloud.replaceConfirm":`Den bisherigen Space aus der Cloud entfernen? Seine Wizards und ihre Links verschwinden dort. Danach wird gesendet, was hier veröffentlicht ist.`,"cloud.noticeError":`Hier veröffentlicht. In der Cloud ist diese Version nicht angekommen – mehr dazu unten.`,"cloud.noticeNotRunnable":`Hier veröffentlicht. In der Cloud läuft diese Version nicht – mehr dazu unten.`,"readonly.wizard":`Dieser Wizard kommt aus deiner lokalen Installation und wird dort geändert. Hier läuft, was du dort veröffentlichst.`,"readonly.project":`Dieser Space kommt aus deiner lokalen Installation und wird dort geändert.`,"readonly.server":`Auf diesem Server wird nichts gebaut. Hier laufen die Wizards, die deine lokale Installation veröffentlicht.`,"nav.wizards":`Wizards`,"nav.settings":`Einstellungen`,"nav.project":`Space`,"account.title":`Konto`,"account.hint":`Wie dich die App nennt und wie man dich erreicht.`,"account.initials":`Dein Kürzel im Menü oben rechts: die Anfangsbuchstaben deines Namens.`,"account.name":`Name`,"account.nameHint":`Anfangs steht hier der Benutzername dieses Geräts.`,"account.fromAccount":`Name und E-Mail kommen aus deinem Konto.`,"account.about":`Über dich`,"account.aboutHint":`Wer du bist und was du machst.`,"account.email":`E-Mail`,"account.phone":`Telefon`,"account.connection":`engenty.ai`,"account.connectionHint":`Anmeldung, Guthaben und die Cloud, in der deine Wizards für alle laufen.`,"account.profile":`Profil`,"account.local":`Lokale Installation`,"account.localText":`Diese App läuft auf deinem Gerät und ist mit keinem Konto verbunden. Wizards, Space und Dateien bleiben hier.`,"account.linked":`Verbunden`,"account.with":`Mit einem Konto`,"account.withCredits":`Guthaben für die Modelle, wo kein KI-Client installiert ist. Kein API Key nötig.`,"account.withCloud":`Was du veröffentlichst, läuft auch auf engenty.ai – hinter einem öffentlichen Link, auch wenn dieses Gerät aus ist.`,"account.signIn":`Anmelden`,"account.signInAgain":`Neu anmelden`,"account.new":`Noch kein Konto?`,"account.newHint":`Ein neues Konto braucht einen Einladungscode. Trag ihn hier ein, dann steht er bei der Registrierung schon im Formular.`,"account.code":`Einladungscode`,"account.create":`Konto erstellen`,"account.credits":`Guthaben`,"account.topUp":`Aufladen`,"account.expires":`{n} Credits gültig bis {date}`,"account.kind.start":`Startguthaben`,"account.kind.monthly":`Monatsguthaben`,"account.kind.gift":`Geschenkt`,"account.cloud":`Was du hier veröffentlichst, läuft auch auf {host}.`,"account.look":`Darstellung`,"account.lookHint":`Sprache und Design der App in diesem Browser.`,"nav.logout":`Abmelden`,"nav.connected":`Verbunden mit {host}`,"nav.expired":`Anmeldung abgelaufen`,"nav.onlyHere":`Nur auf diesem Computer`,"nav.local":`lokal`,"nav.language":`Sprache`,"nav.theme":`Design`,"nav.credits":`{n} Credits`,"footer.billing":`Guthaben`,"footer.usage":`Verbrauch`,"footer.invoices":`Rechnungen`,"footer.account":`Konto`,"about.version":`Version {v}`,"about.update.available":`Version {v} von engenty wizards ist da.`,"about.update.install":`Aktualisieren`,"about.update.installing":`Version {v} wird installiert …`,"about.update.restarting":`Startet neu mit Version {v} …`,"about.update.done":`Installiert. Starte engenty wizards neu, um {v} zu nutzen.`,"about.update.failed":`Das Update ist fehlgeschlagen. Logs: logs/update.log`,"about.update.notes":`Was ist neu`,"about.changelog":`Changelog`,"about.changelogHint":`Was sich von Version zu Version geändert hat.`,"about.changelogEmpty":`Noch keine Einträge.`,"about.unreleased":`Noch nicht veröffentlicht`,"about.breaking":`breaking`,"about.credits":`Open Source`,"about.creditsHint":`engenty wizards und die Open-Source-Software, auf der es aufbaut.`,"about.creditsProduct":`engenty`,"about.creditsBuiltWith":`Gebaut mit`,"about.creditsDeps":`Direkte Abhängigkeiten`,"about.creditsDepsHint":`Was die Teile dieser App selbst einbinden, mit Version und Lizenz – ohne deren eigene Abhängigkeiten.`,"about.creditsShared":`Von mehreren Teilen genutzt`,"about.search":`Suchen …`,"about.noMatches":`Keine Treffer.`,"theme.dark":`Dunkles Design`,"theme.light":`Helles Design`,"home.title":`Deine Wizards`,"home.new":`Neuer Wizard`,"home.import":`Importieren`,"import.failed":`Import hat nicht geklappt`,"home.empty":`Noch keine Wizards in diesem Space.`,"home.live":`Live`,"home.draft":`Entwurf`,"where.here":`Lokal`,"where.hereVersion":`Lokal · Version {v}`,"where.hereHint":`Läuft nur auf diesem Computer, solange die App läuft.`,"where.liveHint":`Läuft auf {host} – für alle mit dem Link.`,"where.liveAt":`Live auf {host} · Version {v}`,"where.note":`1 Hinweis`,"where.notes":`{n} Hinweise`,"where.sending":`Wird gesendet`,"where.missing":`Nicht in der Cloud`,"home.steps":`{n} Schritte`,"home.newProject":`Neuer Space`,"home.projectName":`Name des Space`,"home.projectLimit":`Höchstens {n} Spaces`,"team.title":`Team`,"team.hint":`Wer im Team ist und auf welchem Paket es läuft. Eingeladen und verwaltet wird im Konto.`,"team.plan":`Paket`,"team.planFree":`Free`,"team.seats":`{taken} von {limit} Plätzen`,"team.seatsUnlimited":`Plätze ohne Limit`,"team.members":`Mitglieder`,"team.invited":`eingeladen`,"team.you":`du`,"team.manage":`Mitglieder verwalten`,"team.changePlan":`Paket ansehen`,"team.roles":`Inhaber und Admins legen Wizards und Spaces an und löschen sie; Mitglieder bearbeiten die Wizards, die es gibt.`,"team.memberNote":`Du bist Mitglied: Du bearbeitest Wizards, Admins legen neue an und löschen.`,"team.failed":`Das Team ließ sich nicht laden.`,"team.role.owner":`Inhaber`,"team.role.admin":`Admin`,"team.role.member":`Mitglied`,"models.ownKeysPlan":`Eigene API Keys gibt es ab dem Pro-Paket. Hier zahlen die Credits des Teams.`,"home.fromLocal":`Aus deiner lokalen Installation – geändert wird dort.`,"home.syncedAt":`Zuletzt angekommen: {when}.`,"home.local.title":`Hier laufen die Wizards aus deiner lokalen Installation`,"home.local.text":`Du baust auf deinem eigenen Computer. Was du dort veröffentlichst, läuft hier – für alle, hinter einem Link.`,"home.local.install":`Installiere engenty wizards auf deinem Computer:`,"home.local.signIn":`Melde dich dort unter Einstellungen → Konto mit diesem Konto an.`,"home.local.publish":`Veröffentliche einen Wizard. Er erscheint dann hier.`,"new.title":`Was soll dein Wizard können?`,"new.placeholder":`z. B. Kunden geben ihr Produkt und ihre Zielgruppe ein, der Wizard recherchiert Wettbewerber und erstellt daraus ein Positionierungs-Briefing als PDF.`,"new.build":`Wizard bauen`,"new.orStarter":`Oder beginne mit einer Vorlage`,"new.import":`Wizard-Paket importieren`,"new.hint":`Du kannst alles danach im Gespräch ändern.`,"editor.resize":`Breite ändern – Doppelklick setzt zurück`,"editor.resizeSheet":`Höhe ändern – Tippen klappt ein und aus`,"editor.export":`Als Paket exportieren (.wizard)`,"editor.chat":`Gespräch`,"editor.step":`Schritte`,"editor.runs":`Durchläufe`,"editor.reviewEditable":`bearbeitbar`,"editor.reviewRedo":`neu erstellbar`,"editor.otherwise":`sonst`,"editor.whenFilled":`{field} ausgefüllt`,"editor.whenEmpty":`{field} leer`,"tool.web_search":`Websuche`,"tool.web_fetch":`Webseiten lesen`,"tool.browser":`Browser`,"tool.sandbox":`Code & Shell`,"tool.image":`Bilder`,"tool.http":`API`,"tool.pages":`Seiten`,"editor.test":`Testen`,"editor.share":`Teilen`,"editor.publish":`Veröffentlichen`,"editor.published":`Live · Version {v}`,"editor.unpublishedChanges":`Änderungen nicht veröffentlicht`,"editor.notPublished":`Noch nicht veröffentlicht`,"editor.composer":`Beschreibe, was sich ändern soll …`,"editor.attach":`Dateien anhängen`,"editor.detach":`Entfernen`,"editor.attached":`Angehängt`,"editor.thread":`Verlauf`,"editor.voice":`Diktieren`,"editor.voiceStop":`Diktat beenden`,"editor.listening":`Ich höre zu …`,"editor.transcribing":`Wird verschriftlicht …`,"editor.micDenied":`Das Mikrofon ist für diese Seite nicht freigegeben.`,"editor.building":`Baue den Ablauf …`,"editor.files":`Dateien`,"files.explain":`Was dein Wizard bei jedem Durchlauf braucht: Widget-Code, Bibliotheken, Kartenumrisse, Preislisten. Der Assistent legt sie im Gespräch an – du kannst auch eigene hochladen.`,"files.upload":`Hochladen`,"files.count":`{n} Dateien · {size}`,"files.empty":`Noch keine Dateien. Zieh Dateien hierher oder bitte den Assistenten, ein Widget zu bauen.`,"files.download":`Herunterladen`,"files.delete":`Löschen`,"files.confirmDelete":`„{path}“ löschen?`,"files.none":`Dieser Wizard hat keine Dateien.`,"editor.thinking":`Denkt nach …`,"editor.chatBroken":`Die Verbindung ist abgebrochen. Was schon gebaut war, ist gespeichert – schick die Nachricht bitte noch einmal.`,"editor.issues":`Bevor du testest oder teilst, braucht der Wizard noch Korrekturen:`,"editor.fixWithChat":`Vom Assistenten beheben lassen`,"editor.models.blocking":`So kann der Wizard nicht starten. Es fehlen Modelle:`,"editor.models.optional":`Diese Schritte laufen so nicht. Wähle beim Testen einen Weg ohne sie oder richte die Modelle ein:`,"editor.models.settings":`Modelle einrichten`,"editor.prevStep":`Vorheriger Schritt`,"editor.nextStep":`Nächster Schritt`,"editor.deleteStep":`Schritt löschen`,"editor.moveUp":`Nach oben`,"editor.moveDown":`Nach unten`,"editor.noRuns":`Noch keine Durchläufe.`,"editor.restart":`Neu starten`,"editor.close":`Schließen`,"editor.chatHello":`Beschreibe mir, was dein Wizard tun soll. Ich baue den Ablauf und du siehst ihn links als Diagramm.`,"shareRun.button":`Teilen`,"shareRun.title":`Ergebnis teilen`,"shareRun.email":`E-Mail`,"shareRun.more":`Mehr …`,"shareRun.until":`Der Link ist bis {date} gültig.`,"shareRun.kept":`Der Link bleibt gültig, bis du ihn zurückziehst.`,"shareRun.withdraw":`Link zurückziehen`,"sharePage.gone":`Dieser Link ist abgelaufen oder wurde zurückgezogen.`,"sharePage.own":`Selbst ausprobieren`,"sharePage.until":`Geteilt · verfügbar bis {date}`,"sharePage.shared":`Geteilt am {date}`,"share.title":`Wizard teilen`,"share.link":`Link`,"share.copy":`Kopieren`,"share.copied":`Kopiert`,"share.enabled":`Link ist aktiv`,"share.limit":`Durchläufe pro Tag`,"share.rotate":`Neuen Link erzeugen`,"share.rotateHint":`Der alte Link funktioniert danach nicht mehr.`,"share.publishFirst":`Veröffentliche den Wizard, damit der Link funktioniert.`,"share.unpublished":`Deine Änderungen sind noch nicht veröffentlicht: der Link läuft mit der Version davor.`,"share.website":`Website`,"share.openHere":`Auf diesem Computer testen`,"share.settings":`Einstellungen`,"share.on":`aktiv`,"share.off":`aus`,"share.perDay":`{n} pro Tag`,"share.rotateCloud":`Der alte Link funktioniert danach nicht mehr – auch der in der Cloud.`,"share.others":`Mit anderen teilen`,"share.othersHint":`Mit einem Konto läuft der Wizard auch auf engenty.ai: ein Link, ein QR-Code und ein Tag für deine Website – für alle, auch wenn dein Computer aus ist.`,"share.details":`Details`,"teaser.website":`Eine Website braucht einen Link, den jeder erreicht. Mit einem Konto läuft der Wizard auch auf engenty.ai – dann steht hier der Tag für deine Seite.`,"teaser.qr":`Ein QR-Code braucht einen Link, den jedes Handy erreicht. Mit einem Konto läuft der Wizard auch auf engenty.ai – dann stehen hier der QR-Code und die ID für die App.`,"teaser.link":`Dieser Link geht nur auf diesem Computer, solange die App läuft. Mit einem Konto läuft der Wizard auch auf engenty.ai – mit einem Link für alle.`,"teaser.models":`Ohne eigenen API Key: mit einem Konto laufen Text, Bilder und Videos über Guthaben.`,"teaser.connect":`Konto verbinden`,"teaser.modelsLinked":`Oder über das Guthaben deines Kontos: unter Modelle „Guthaben des Kontos“ wählen.`,"share.open":`Öffnen`,"share.qr":`QR-Code`,"share.qrHint":`Mit der Kamera des Handys scannen: der Wizard öffnet sich, in der App engenty wizards, wenn sie installiert ist.`,"share.code":`ID für die App:`,"share.readOnly":`Ob der Link aktiv ist und wie viele Durchläufe er am Tag zulässt, stellst du in deiner lokalen Installation ein.`,"embed.inline":`In der Seite`,"embed.modal":`Button + Fenster`,"embed.inlineHint":`Füge das Tag in den HTML-Code deiner Seite ein. Der Wizard erscheint an dieser Stelle.`,"embed.modalHint":`Füge das Tag in den HTML-Code deiner Seite ein. An dieser Stelle erscheint ein Button, der den Wizard in einem Fenster öffnet.`,"type.page":`Seite`,"type.agent":`KI-Schritt`,"type.generate":`Erzeugen`,"type.widget":`Widget`,"type.film":`Film`,"type.review":`Prüfen`,"type.result":`Ergebnis`,"run.start":`Los geht's`,"run.closed":`Hier gerade nicht verfügbar, dafür fehlt: {list}`,"run.cls.text":`Text`,"run.cls.image":`Bilder`,"run.cls.video":`Videos`,"run.cls.speech":`Sprachausgabe`,"run.cls.audio":`Sprachnotizen`,"run.next":`Weiter`,"run.back":`Zurück`,"run.accept":`Passt so`,"run.regenerate":`Neue Variante`,"run.edit":`Bearbeiten`,"run.resume":`Letzten Durchlauf fortsetzen`,"run.regenerateNote":`Was soll anders werden?`,"run.pickItem":`Nr. {n}`,"run.pickedItem":`Nr. {n} neu`,"run.regeneratePicked":`Neu erstellt wird nur Nr. {n}.`,"run.regenerateAll":`Alle werden neu erstellt. Tippe oben auf eine Nummer, um nur einzelne zu erneuern.`,"check.progress":`{done} von {total} geprüft`,"check.onlyOpen":`Nur offene`,"check.noFile":`Zu dieser Zeile gibt es keine Datei.`,"check.noPreview":`Für diese Datei gibt es keine Vorschau – öffne sie mit dem Link oben.`,"check.reopen":`Wieder offen`,"market.search":`Vorlage suchen …`,"market.all":`Alle`,"market.industry":`Branche`,"market.format":`Ergebnis`,"market.capability":`Fähigkeit`,"market.unavailable":`nicht eingerichtet`,"market.without":`Geht auch ohne: {list}`,"market.optional":`nicht eingerichtet, geht auch ohne`,"market.optionalHint":`Läuft hier ohne {list}: Antworten, die das bräuchten, sind im Wizard gesperrt. Einrichten unter Modelle.`,"market.missing":`Hier nicht eingerichtet: {list}`,"market.missingHint":`Dafür fehlt hier ein Modell: {list}. Richte es unter Modelle ein.`,"market.none":`Keine Vorlage passt zu dieser Auswahl.`,"market.notFound":`Diese Vorlage gibt es nicht (mehr).`,"market.star":`Merken`,"market.starred":`Gemerkt`,"market.starHint":`Gemerkte Vorlagen liegen auf diesem Rechner auch ohne Verbindung bereit.`,"market.noneStarred":`Du hast noch keine Vorlage gemerkt.`,"market.offline":`Keine Verbindung zum Marktplatz: du siehst die Vorlagen, die hier bereitliegen.`,"market.more":`Mehr anzeigen`,"market.reset":`Auswahl zurücksetzen`,"market.count":`{n} Vorlagen`,"market.countOf":`{n} von {all} Vorlagen`,"market.countOfShort":`{n} von {all}`,"market.resetShort":`Zurücksetzen`,"market.minutes":`~ {n} Min.`,"market.credits":`~ {n} Credits pro Lauf`,"market.needsUpdate":`Braucht eine neuere App`,"market.needsUpdateHint":`Diese Vorlage nutzt Funktionen, die deine App noch nicht kennt. Aktualisiere die App, dann kannst du sie verwenden.`,"market.use":`Mit dieser Vorlage starten`,"market.steps":`So läuft der Wizard ab`,"market.duration":`Dauer`,"market.durationHint":`vom Start bis zum Ergebnis, mit {n} Angaben von dir`,"market.result":`Ergebnis`,"market.creditsRange":`~ {n} Credits`,"market.creditsHint":`pro Lauf geschätzt, selten mehr als das Doppelte`,"market.needs":`Braucht`,"market.cost":`Kosten`,"new.forWebsite":`Kleine Helfer für deine Website`,"run.feedbackPlaceholder":`Passt etwas nicht? Schreib, was anders sein soll …`,"run.feedbackTarget":`Was soll sich ändern?`,"run.feedbackPick":`Wähle oben, was sich ändern soll.`,"ai.generated":`KI-generiert`,"ai.modified":`Mit KI verändert`,"ai.publish":`Mit KI erstellt: Wer das veröffentlicht, muss es als KI-generiert kennzeichnen (EU AI Act, Art. 50). Die Datei trägt die Kennzeichnung bereits in ihren Metadaten.`,"run.regenerateGo":`Neu erstellen`,"run.retry":`Erneut versuchen`,"run.again":`Nochmal`,"run.download":`Herunterladen`,"run.copy":`Text kopieren`,"run.failed":`Da hat etwas nicht geklappt.`,"run.unavailable":`Dieser Wizard ist gerade nicht verfügbar.`,"run.notFound":`Diesen Wizard gibt es nicht (mehr).`,"run.madeWith":`Erstellt mit engenty wizards`,"run.working":`Einen Moment …`,"run.elapsed":`{s} s`,"run.cancelled":`Abgebrochen.`,"run.addRow":`Zeile hinzufügen`,"run.upload":`Datei wählen oder hierher ziehen`,"run.uploading":`Lädt hoch …`,"run.required":`Pflichtfeld`,"run.net":`Netto`,"run.vat":`USt. {r} %`,"run.total":`Gesamt`,"settings.title":`Einstellungen`,"settings.name":`Name`,"settings.mcp":`Verbundene Systeme (MCP)`,"settings.mcpHint":`KI-Schritte können in diese Systeme schreiben oder daraus lesen – nur, wenn du sie im Schritt freigibst.`,"settings.addServer":`System verbinden`,"settings.serverName":`Name`,"settings.serverUrl":`MCP-URL`,"settings.serverHeader":`Authorization-Header (optional)`,"settings.save":`Speichern`,"settings.saved":`Gespeichert`,"settings.delete":`Space löschen`,"settings.noProject":`Hier erscheint dein Space, sobald deine lokale Installation den ersten Wizard veröffentlicht hat.`,"settings.copy":`Kopieren`,"settings.copied":`Kopiert`,"settings.lastUsed":`zuletzt {when}`,"settings.neverUsed":`noch nie benutzt`,"settings.revoke":`Schlüssel löschen`,"mcp.appsDisconnect":`Austragen`,"plugins.title":`Plugins`,"plugins.hint":`Plugins erweitern diese App um Seiten, Einstellungen und Werkzeuge für Schritte. Sie laufen mit allen Rechten der App: installiere nur, was du kennst.`,"plugins.hintManaged":`Diese Plugins sind für dein Konto freigeschaltet.`,"plugins.reload":`Neu laden`,"plugins.rescan":`Neu suchen`,"plugins.tools":`Werkzeuge für Schritte`,"plugins.serverFailed":`Der Server-Teil hat nicht geladen: {error}`,"plugins.studioFailed":`Der Studio-Teil hat nicht geladen: {error}`,"plugins.problems":`Kein Plugin`,"plugins.crashed":`Dieser Teil eines Plugins ist abgestürzt.`,"mcp.notReverse":`Nicht verwechseln mit „Verbundene Systeme (MCP)“ unter Connectors: Dort ruft engenty andere Server auf, hier ruft dein Client engenty auf.`,"integrate.nav":`Einbinden`,"integrate.groupApps":`KI-Apps`,"integrate.groupShare":`Teilen`,"integrate.shareLink":`Per Link teilen`,"integrate.shareSite":`In eine Website einbinden`,"integrate.soon":`bald`,"integrate.stateWorks":`funktioniert`,"integrate.stateConnected":`eingetragen`,"integrate.stateInstalled":`auf diesem Computer`,"integrate.kindMcp":`Werkzeuge im Chat: Wizards finden, starten, ausfüllen – und bauen.`,"integrate.kindMcpShort":`Werkzeuge im Chat`,"integrate.kindAppShort":`der Wizard als Widget`,"integrate.kindAppNoShort":`zeigt diese App nicht`,"integrate.kindApp":`Der Wizard selbst im Chat, Seite für Seite, als Widget.`,"integrate.kindAppNo":`Zeigt diese App nicht – ein Lauf kommt als Text.`,"integrate.where":`Wo läuft die App?`,"integrate.here":`Auf diesem Computer`,"integrate.hereHint":`Ein Klick, kein Schlüssel. Die App startet engenty wizards selbst.`,"integrate.hereManaged":`Nur mit engenty wizards auf deinem Computer.`,"integrate.address":`Über die Adresse`,"integrate.addressHint":`Von überall, wo die Adresse erreichbar ist – mit Schlüssel.`,"integrate.connectTitle":`Eintragen`,"integrate.connectHint":`Trägt engenty wizards in die Einstellungen von {app} ein.`,"integrate.connect":`In {app} eintragen`,"integrate.connected":`In {app} eingetragen`,"integrate.notInstalled":`{app} ist auf diesem Computer nicht zu finden. Eintragen geht trotzdem – es wirkt, sobald {app} da ist.`,"integrate.file":`In {file} eintragen:`,"integrate.vscode":`In VS Code: „MCP: Open User Configuration“, dann eintragen:`,"integrate.chatgpt":`In ChatGPT: Einstellungen → Apps & Connectors → Erweitert → Entwicklermodus, dann „Erstellen“ mit dieser Adresse:`,"integrate.generic":`In den MCP-Einstellungen der App einen Server mit dieser Adresse anlegen (Streamable HTTP):`,"integrate.oauthLocal":`Diese App verbindet sich von den Servern ihres Herstellers aus – diesen Computer erreicht sie nicht. Nimm hier „Auf diesem Computer“ oder eine App, die hier läuft.`,"integrate.test":`Testen`,"integrate.seen":`{app} meldet sich`,"integrate.restart":`Beende {app} ganz und starte es neu – dann meldet es sich hier.`,"integrate.reload":`Lade die MCP-Server in {app} neu oder starte es neu.`,"integrate.tool":`Ein Werkzeug aufgerufen`,"integrate.askHint":`Schreib in {app} in einem neuen Chat:`,"integrate.askTool":`Welche Wizards habe ich in engenty?`,"integrate.widget":`Wizard als Widget gezeigt`,"integrate.widgetHint":`Starte einen veröffentlichten Wizard:`,"integrate.askWidget":`Starte einen meiner engenty Wizards.`,"integrate.works":`{app} arbeitet mit deinen Wizards.`,"mcp.notHere":`Geht mit diesem Server nicht`,"mcp.needsPublic":`claude.ai verbindet sich von Anthropics Servern aus. Das geht nur, wenn dieser Server öffentlich über HTTPS erreichbar ist.`,"mcp.keyTitle":`Schlüssel erstellen`,"mcp.keyHint":`Mit dem Schlüssel meldet sich dein Client an. Er wird nur einmal angezeigt und steht dann gleich im Befehl im nächsten Schritt.`,"mcp.keyCreate":`Schlüssel für {client} erstellen`,"mcp.keyReady":`Schlüssel erstellt – er steht schon im Befehl unten.`,"mcp.keyFirst":`Erst den Schlüssel erstellen – dann steht hier der fertige Befehl.`,"mcp.add":`Server eintragen`,"mcp.terminal":`Im Terminal ausführen:`,"mcp.ccPlugin":`Optional das Plugin – es bringt den Befehl /wizard mit:`,"mcp.codexKey":`Im Terminal ausführen – Codex liest den Schlüssel aus einer Umgebungsvariable:`,"mcp.claudeAi":`In claude.ai: Einstellungen → Konnektoren → Eigenen Konnektor hinzufügen, diese Adresse eintragen:`,"mcp.oauth":`Kein Schlüssel nötig: Beim ersten Aufruf meldet sich dein Client im Browser an.`,"mcp.addressPublic":`Öffentlich erreichbar.`,"mcp.addressLocal":`Nur auf diesem Rechner erreichbar, und nur solange engenty wizards läuft.`,"mcp.keys":`Schlüssel`,"mcp.keysHint":`Jeder Schlüssel meldet einen Client an und hat alle Rechte – behandle ihn wie ein Passwort. Löschst du ihn, ist der Client abgemeldet.`,"editor.viaClient":`Über {client}`,"editor.changedVia":`Geändert über {client}`,"editor.merged":`Mit Änderungen von außen zusammengeführt`,"run.uploadMore":`Weitere Datei`,"run.camera":`Kamera`,"camera.title":`Mit der Kamera aufnehmen`,"camera.hint":`Gerade und gut beleuchtet ins Bild halten.`,"camera.taken":`{n} aufgenommen`,"camera.shoot":`Aufnehmen`,"camera.done":`Fertig`,"camera.denied":`Die Kamera ist für diese Seite nicht freigegeben. Erlaube sie in den Website-Einstellungen deines Browsers (Schloss-Symbol in der Adresszeile) – oder nimm das Foto mit der Kamera-App auf.`,"connect.go":`Verbinden`,"connect.connected":`Verbunden über {name}`,"connect.disconnect":`Trennen`,"connect.none":`Auf diesem Server ist noch kein Anbieter zum Verbinden eingerichtet.`,"connect.openLink":`Hier klicken, um die Anmeldung in einem neuen Tab zu öffnen`,"list.empty":`Noch keine Einträge.`,"list.delete":`Zeile löschen`,"ask.typeInto":`Text in die Seite tippen …`,"ask.hide":`verdeckt`,"ask.up":`Nach oben`,"ask.down":`Nach unten`,"ask.pictureHint":`Das ist die Seite, die der Wizard geöffnet hat. Du kannst auch direkt ins Bild klicken und tippen.`,"ask.remember":`Anmeldung für nächstes Mal merken`,"ask.private":`Was du eingibst, geht direkt in die Seite. Die KI bekommt es nicht zu sehen. Gemerkte Anmeldungen werden verschlüsselt gespeichert.`,"ask.skip":`Überspringen`,"ask.done":`Ich bin angemeldet`,"ask.signIn":`Anmelden`,"ask.wants":`Der Wizard möchte in {service} Folgendes ausführen:`,"ask.allowRest":`Für den Rest dieses Durchlaufs erlauben`,"ask.allow":`Erlauben`,"ask.deny":`Nicht erlauben`,"store.open":`Was dieser Wizard sich merkt`,"store.title":`Gespeichert für dich`,"store.explain":`Dieser Wizard merkt sich Listen, Dateien und verbundene Konten für deinen nächsten Durchlauf. Nur du siehst sie.`,"store.empty":`Noch nichts gespeichert.`,"store.rows":`{n} Einträge`,"store.signIns":`Gemerkte Anmeldungen im Browser`,"store.files":`{n} Dateien · {size}`,"store.delete":`Alles löschen`,"store.confirmDelete":`Wirklich alles löschen`,"common.close":`Schließen`,"connectors.title":`Connectors`,"connectors.hint":`Dienste, in denen ein Wizard für die Person arbeiten kann – sie verbindet beim Durchlauf ihr eigenes Konto. Die wichtigsten sind eingebaut; jeden weiteren findest du im Verzeichnis integrations.sh und importierst ihn aus seiner OpenAPI-Beschreibung oder seinem MCP-Server.`,"connectors.imported":`Aus dem Verzeichnis`,"connectors.noneImported":`Hier ist kein Connector aus dem Verzeichnis importiert.`,"connectors.notSetUp":`nicht eingerichtet`,"connectors.setup":`Auf dem Server fehlen:`,"connectors.search":`Dienst suchen, z. B. Notion, Stripe, GitHub`,"connectors.find":`Suchen`,"connectors.none":`Nichts gefunden.`,"connectors.import":`Importieren`,"connectors.exists":`Schon importiert.`,"connectors.ownClient":`Eigener OAuth-Client`,"connectors.refresh":`Aktionen neu laden`,"connectors.remove":`Entfernen`,"connectors.actions":`{n} Aktionen, {r} lesend`,"connectors.pending":`Aktionen erscheinen, sobald ein Konto verbunden ist`,"connectors.needsClient":`Dieser Dienst braucht einen OAuth-Client (ID und Secret). Entfernen und mit „Eigener OAuth-Client“ neu importieren.`,"connectors.authNone":`ohne Anmeldung`,"connectors.authOauth":`Anmeldung per OAuth`,"connectors.authKey":`API-Schlüssel`,"connectors.group.read":`liest`,"connectors.group.write":`ändert`,"connectors.group.destructive":`löscht`,"run.uploadTouch":`Datei wählen`,"run.maxFiles":`Hier gehen höchstens {n} – die übrigen habe ich weggelassen.`,"run.filesMin":`{n} von mindestens {min}`,"run.filesOf":`{n} von höchstens {max}`,"run.moveFile":`Nr. {n} verschieben`,"run.moveFileHint":`Ziehen, um die Reihenfolge zu ändern`,"run.removeFile":`Entfernen`,"run.awake":`Der Bildschirm bleibt an, solange der Wizard arbeitet.`,"run.openFull":`Groß öffnen`,"run.yes":`Ja`,"run.no":`Nein`,"run.share":`Teilen`,"run.shareNow":`Jetzt teilen`,"run.shareFile":`Als Datei teilen oder in einer App öffnen`,"camera.asking":`Dein Browser fragt gleich nach der Kamera. Das Bild bleibt in diesem Wizard.`,"camera.missing":`An diesem Gerät wurde keine Kamera gefunden. Lade stattdessen ein Foto hoch.`,"camera.busy":`Die Kamera wird gerade von einer anderen App verwendet. Schließe sie und versuche es noch einmal.`,"camera.native":`Kamera-App öffnen`,"camera.pick":`Foto auswählen`,"camera.torch":`Licht`,"camera.flip":`Kamera wechseln`,"camera.photo":`Foto`,"camera.video":`Video`,"camera.record":`Aufnahme starten`,"camera.stop":`Aufnahme beenden`,"camera.recording":`Nimmt auf – tippe zum Beenden.`,"camera.clipHint":`Ein kurzer Clip, höchstens {s} Sekunden.`,"camera.hintMany":`Seite für Seite aufnehmen, dann „Fertig“.`,"scan.button":`Scannen`,"scan.title":`Code scannen`,"scan.asking":`Dein Browser fragt gleich nach der Kamera – sie liest nur den Code.`,"scan.hint":`Halte den QR- oder Strichcode in den Rahmen.`,"scan.hintQr":`Halte den QR-Code in den Rahmen. Strichcodes liest dieses Gerät hier nicht.`,"scan.miss":`Auf dem Foto war kein Code zu erkennen. Versuch es näher und schärfer.`,"scan.fromPhoto":`Foto mit dem Code wählen`,"scan.typeInstead":`Lieber eintippen`,"location.use":`Meinen Standort übernehmen`,"location.locating":`Standort wird bestimmt …`,"location.refining":`wird noch genauer …`,"location.accuracy":`auf etwa {m} m genau`,"location.map":`Karte`,"location.remove":`Standort entfernen`,"location.why":`Dein Browser fragt nach deinem Standort. Er wird nur für diesen Wizard verwendet. Du kannst auch einfach die Adresse eintippen.`,"location.denied":`Der Standort ist für diese Seite nicht freigegeben. Erlaube ihn in den Website-Einstellungen deines Browsers (Schloss-Symbol in der Adresszeile) – oder tippe die Adresse unten ein.`,"location.unavailable":`Dein Gerät konnte den Standort gerade nicht bestimmen. Versuch es im Freien noch einmal oder tippe die Adresse ein.`,"location.timeout":`Das hat zu lange gedauert. Versuch es noch einmal oder tippe die Adresse ein.`,"location.manual":`Adresse oder Ort eintippen`,"location.label":`Adresse oder Beschreibung des Orts`,"voice.start":`Sprachnotiz aufnehmen`,"voice.stop":`Stopp`,"voice.recording":`Aufnahme läuft …`,"voice.left":`noch {s} s`,"voice.again":`Neu aufnehmen`,"voice.remove":`Löschen`,"voice.pick":`Audiodatei wählen`,"voice.why":`Dein Browser fragt nach dem Mikrofon. Die Aufnahme wird danach in Text umgewandelt.`,"voice.denied":`Das Mikrofon ist für diese Seite nicht freigegeben. Erlaube es in den Website-Einstellungen deines Browsers – oder nimm die Notiz mit der Diktier-App auf und wähle die Datei.`,"voice.noRecorder":`Dieser Browser kann hier nicht aufnehmen. Nimm die Notiz mit der Diktier-App auf und wähle die Datei.`,"sign.open":`Hier unterschreiben`,"sign.hint":`Mit dem Finger unterschreiben`,"sign.pad":`Unterschriftsfeld`,"sign.clear":`Löschen`,"sign.accept":`Übernehmen`,"sign.again":`Neu unterschreiben`,"sign.remove":`Unterschrift entfernen`,"notify.ask":`Bescheid geben, wenn es fertig ist`,"notify.on":`Du bekommst Bescheid`,"notify.why":`Mit Ton, Vibration oder einer Mitteilung. Dein Browser fragt dafür einmal um Erlaubnis.`,"notify.onHint":`Du kannst die App wechseln – eine Mitteilung holt dich zurück.`,"notify.quiet":`Mit Ton und Vibration, solange diese Seite offen ist.`,"notify.blocked":`Mitteilungen sind für diese Seite blockiert – es gibt Ton und Vibration, solange sie offen ist. Erlauben kannst du sie in den Website-Einstellungen deines Browsers.`,"notify.done":`Dein Ergebnis ist fertig.`,"notify.next":`Es geht weiter – wirf einen Blick darauf.`,"notify.needsYou":`Der Wizard braucht dich kurz.`,"install.add":`Zum Startbildschirm hinzufügen`,"install.ios":`Tippe unten auf „Teilen“ und dann auf „Zum Home-Bildschirm“.`,"install.bookmark":`Als Lesezeichen speichern`,"install.bookmark.mac":`Drücke ⌘ D, dann liegt dieser Wizard in deinen Lesezeichen.`,"install.bookmark.pc":`Drücke Strg + D, dann liegt dieser Wizard in deinen Lesezeichen.`,"install.app":`In der App öffnen`,"install.app.offer":`Installiere das Studio als App: eigenes Fenster, eigenes Symbol im Dock oder in der Taskleiste.`,"install.app.browser":`In Chrome oder Edge lässt sich das Studio als App installieren: eigenes Fenster, eigenes Symbol.`,"install.app.action":`Als App installieren`,"install.app.close":`Schließen`,"common.offline":`Keine Verbindung. Prüfe dein Netz und versuch es noch einmal.`,"common.retry":`Erneut versuchen`,"common.cancel":`Abbrechen`,"common.loading":`Lädt …`,"common.error":`Fehler`,"data.hint":`Tabellen und Seiten, die der Space und seine Wizards behalten.`,"data.all":`Alle Daten`,"data.own":`Allgemein`,"data.table":`Tabelle`,"data.page":`Seite`,"data.newTable":`Neue Tabelle`,"data.newPage":`Neue Seite`,"data.title":`Titel`,"data.owner":`Gehört zu`,"data.create":`Anlegen`,"data.empty":`Noch keine Tabellen und Seiten. Leg eine an – bald schreiben auch deine Wizards hier.`,"data.rows":`{n} Zeilen`,"data.addRow":`Zeile`,"data.noRows":`Noch keine Zeilen.`,"data.deleteRow":`Zeile löschen`,"data.deleteTable":`Tabelle löschen`,"data.deletePage":`Seite löschen`,"data.confirmDelete":`„{title}“ löschen?`,"data.newColumn":`Neue Spalte`,"data.columnName":`Name`,"data.columnType":`Typ`,"data.required":`Muss ausgefüllt werden`,"data.deleteColumn":`Spalte löschen`,"data.removeOption":`Entfernen`,"data.fromList":`Eine Liste des Wizards: jeder Durchlauf schreibt hier hinein. Die Spalten kommen aus dem Wizard.`,"data.badCell":`Dieser Wert passt nicht in „{column}“ und ist nicht gespeichert.`,"data.type.text":`Text`,"data.type.number":`Zahl`,"data.type.date":`Datum`,"data.type.duration":`Dauer`,"data.type.select":`Auswahl`,"data.type.boolean":`Ja / Nein`,"data.text.single":`Eine Zeile`,"data.text.multiline":`Mehrere Zeilen`,"data.number.integer":`Ganze Zahl`,"data.number.decimal":`Dezimalzahl`,"data.number.percent":`Prozent`,"data.number.currency":`Betrag`,"data.currency":`Währung (z. B. EUR)`,"data.date.date":`Datum`,"data.date.datetime":`Datum und Uhrzeit`,"data.date.time":`Uhrzeit`,"data.unit":`Eingabe in`,"data.unit.milliseconds":`ms`,"data.unit.seconds":`Sekunden`,"data.unit.minutes":`Minuten`,"data.unit.hours":`Stunden`,"data.unit.days":`Tage`,"data.options":`Auswahlmöglichkeiten, eine je Zeile`,"data.multiple":`Mehrere wählbar`,"data.write":`Schreiben`,"data.preview":`Vorschau`,"data.pageEmpty":`Diese Seite ist noch leer.`,"data.markdownHint":`Markdown: # Überschrift, **fett**, - Liste`,"space.info":`Info & Marke`,"space.knowledge":`Wissen`,"space.data":`Daten`,"space.results":`Ergebnisse`,"space.resultsAll":`Alle Ergebnisse`,"space.resultsHint":`Läufe deiner Wizards, die ihr Ergebnis erreicht haben, die neuesten zuerst.`,"space.resultsEmpty":`Noch keine Ergebnisse. Ein Lauf steht hier, sobald er fertig ist.`,"space.resultCredits":`{n} Credits`,"space.resultsSearch":`Suchen: Wizard, Eingaben, Ergebnis …`,"space.resultsModeAll":`Live & Test`,"space.resultsAnyTime":`Jederzeit`,"space.resultsDay":`Letzte 24 Stunden`,"space.resultsDays":`Letzte {n} Tage`,"space.resultsNone":`Keine Ergebnisse zu dieser Suche.`,"space.resultFiles":`{n} Dateien`,"project.rename":`Space umbenennen`,"project.saving":`Speichert …`,"project.base":`Basis`,"project.baseHint":`Wer hinter den Wizards steht. Jeder KI-Schritt kennt das.`,"project.title":`Titel`,"project.titleHint":`Firma, Marke oder Vorhaben – so sehen es auch Endnutzer.`,"project.about":`Über`,"project.aboutHint":`Was ihr macht, für wen, und in welchem Ton ihr schreibt.`,"project.logos":`Logos`,"project.logosHint":`Das erste Logo sehen Endnutzer. Eine Beschreibung sagt, wofür eine Variante gedacht ist.`,"project.logoAdd":`Logo`,"project.logoMain":`Hauptlogo`,"project.logoMakeMain":`Als Hauptlogo`,"project.colors":`Farben`,"project.colorsHint":`Die erste Farbe ist der Akzent in Dokumenten, Dashboards und auf öffentlichen Seiten.`,"project.colorAdd":`Farbe`,"project.colorName":`z. B. Primär – Buttons und Überschriften`,"project.colorUse":`Beschreibe, wie engenty diese Farbe einsetzen soll.`,"project.colorAddTitle":`Farbe hinzufügen`,"project.colorValue":`Farbwert`,"project.colorUseLabel":`Verwendung`,"project.add":`Hinzufügen`,"project.colorAccent":`Akzent`,"project.colorFirst":`Als Akzent`,"project.assets":`Assets`,"project.assetsHint":`Bilder, Grafiken, Videos. KI-Schritte setzen sie in Dokumente und wählen nach der Beschreibung.`,"project.assetAdd":`Dateien`,"project.assetSearch":`Assets filtern …`,"know.all":`Alles`,"know.title":`Wissen`,"know.hint":`Was die Schritte deiner Wizards nachschlagen. Dokumente werden beim Hochladen zu Seiten und Tabellen; Kategorien halten die Einträge auseinander.`,"know.empty":`Noch nichts da. Lade Dokumente hoch, leg eine Seite an oder gib dem Assistenten eine Website.`,"know.drop":`Dokumente hierher ziehen oder`,"know.pick":`auswählen`,"know.page":`Seite`,"know.table":`Tabelle`,"know.faq":`FAQ`,"know.file":`Datei`,"know.category":`Kategorie`,"know.categories":`Kategorien`,"know.newPage":`Neue Seite`,"know.newTable":`Neue Tabelle`,"know.asFaq":`Als FAQ: Frage und Antwort je Zeile`,"know.newCategory":`Neue Kategorie`,"know.search":`Suche testen …`,"know.searchNone":`Nichts Relevantes gefunden.`,"know.searchStats":`{candidates} Kandidaten geprüft, {hits} relevant`,"know.searchUnchecked":`{hits} Treffer, ungeprüft`,"know.unchecked":`Ohne Classifier bleiben Treffer ungeprüft. Er braucht einen AI-Gateway- oder TypeSafe-Key oder ein Konto.`,"know.keywordsOnly":`Ohne Embedding-Modell findet die Suche nach Wörtern, nicht nach Bedeutung.`,"know.clear":`Zurücksetzen`,"know.sub":`{n} Unterseiten`,"know.rows":`{n} Zeilen`,"know.review":`Prüfen`,"know.reviewed":`Geprüft`,"know.from":`Aus {label}`,"know.kept":`Von Hand geändert: {label} schreibt sie nicht mehr.`,"know.original":`Original`,"know.reading":`Wird gelesen …`,"know.subPages":`Unterseiten`,"know.addSub":`Unterseite`,"know.type.choice":`Auswahl`,"know.type.date":`Datum`,"know.type.number":`Zahl`,"know.type.text":`Text`,"know.type.boolean":`Ja / Nein`,"know.name":`Name`,"know.type":`Typ`,"know.unit":`Einheit`,"know.unitHint":`z. B. h, €, kg`,"know.multiple":`Mehrere Werte je Eintrag`,"know.ordered":`Die Werte sind gestuft (niedrig → hoch)`,"know.values":`Werte`,"know.valuesHint":`Einer je Zeile. Weitere kommen mit den Einträgen dazu.`,"know.hintField":`Woher die Werte kommen`,"know.hintFieldHint":`Kurz, z. B. Kopfzeile, Dateiname, Filter der Website.`,"know.create":`Anlegen`,"know.proposed":`Vorgeschlagen`,"know.proposedHint":`Erst übernommen wird sie gefüllt.`,"know.accept":`Übernehmen`,"know.dismiss":`Verwerfen`,"know.alike":`„{a}“ und „{b}“ sehen nach einem Wert aus.`,"know.merge":`Zusammenführen`,"know.items":`{n} Einträge`,"know.item":`1 Eintrag`,"know.row":`1 Zeile`,"know.oneSub":`1 Unterseite`,"know.addValue":`Wert hinzufügen`,"know.range":`{min} bis {max}`,"know.summary":`Übersicht`,"know.summaryHint":`Ein Modell fasst die Einträge dieses Werts zusammen. Die Suche findet die Übersicht wie eine Seite.`,"know.summaryWrite":`Übersicht schreiben`,"know.summaryAgain":`Neu schreiben`,"know.summaryEmpty":`Noch keine Übersicht.`,"know.toc":`Inhaltsverzeichnis`,"know.tocRows":`{n} Zeilen in {table}`,"know.deleteCategory":`Kategorie löschen`,"know.confirmCategory":`„{name}“ löschen? Die Einträge bleiben, nur die Kategorie geht.`,"know.deleteValue":`Wert löschen`,"know.yes":`Ja`,"know.no":`Nein`,"know.minimum":`ab`,"know.maximum":`bis`,"know.contains":`enthält`,"know.by.person":`von Hand gesetzt`,"know.by.origin":`aus der Quelle`,"know.by.model":`von einem Modell gelesen`,"know.remove":`Entfernen`,"know.unset":`Nicht gesetzt`,"know.deleteFile":`Datei löschen`,"project.documents":`Dokumente`,"project.documentsHint":`PDFs, Listen, Excel, Word, Text. Sie werden gelesen und kommen in einen Index, den jeder KI-Schritt durchsucht.`,"project.documentAdd":`Dokumente`,"project.drop":`Hierher ziehen oder`,"project.staysLocal":`Bleibt in deiner lokalen Installation und wird nicht hierher gesendet.`,"project.description":`Beschreibung hinzufügen …`,"project.describing":`Wird angesehen …`,"project.reading":`Wird gelesen …`,"project.indexed":`Im Index`,"project.indexedKeywords":`Im Index (Stichwörter)`,"project.notIndexed":`Kein Text gefunden`,"project.reindex":`Neu einlesen`,"project.pages":`{n} Seiten`,"project.keywordsOnly":`Der Index sucht gerade nach Stichwörtern. Mit einem AI-Gateway- oder OpenAI-Schlüssel kommt die Suche nach Bedeutung dazu.`,"project.preview":`Vorschau`,"project.viewList":`Als Liste zeigen`,"project.viewCards":`Als Karten zeigen`,"project.original":`Original`,"project.readText":`Gelesener Text`,"project.openOriginal":`Original öffnen`,"project.noText":`Noch kein Text: das Dokument wird gerade gelesen oder ließ sich nicht lesen.`,"project.textCut":`Die Vorschau zeigt den Anfang ({shown} von {total} Zeichen).`,"project.searchTest":`Im Index suchen …`,"project.searchNone":`Nichts gefunden.`,"project.remove":`Entfernen`,"project.removeConfirm":`„{name}“ entfernen?`,"project.facts":`Fakten`,"project.factsHint":`Was Wizards wissen sollen: Adresse, UID, Öffnungszeiten – alles, was passt.`,"project.factLabel":`Bezeichnung`,"project.factValue":`Wert`,"project.factAdd":`Eintrag`,"project.factType":`Typ`,"project.factAuto":`Automatisch`,"project.type.text":`Text`,"project.type.longtext":`Langer Text`,"project.type.number":`Zahl`,"project.type.date":`Datum`,"project.type.url":`Link`,"project.type.email":`E-Mail`,"project.type.phone":`Telefon`,"project.type.boolean":`Ja / Nein`,"project.yes":`Ja`,"project.no":`Nein`,"project.assistant":`Assistent`,"project.assistantTitle":`Erzähl mir von euch`,"project.assistantHello":`Nenn mir eure Website oder gib mir Dateien. Ich trage ein, was ich finde: Titel, Beschreibung, Logo, Farben und Fakten.`,"project.assistantComposer":`z. B. „Lies unsere Website example.at“ …`,"project.assistantTitleKnowledge":`Was sollen deine Wizards wissen?`,"project.assistantHelloKnowledge":`Gib mir Dokumente oder sag mir, wo das Wissen steht. Ich lese es ein – unten siehst du, was hineinkommt.`,"project.assistantComposerKnowledge":`Dokumente anhängen oder sagen, wo das Wissen steht …`,"project.assistantChanged":`Space aktualisiert`,"flowApp.loading":`Der Wizard kommt …`,"flowApp.draft":`Entwurf`,"flowApp.published":`Veröffentlicht`,"flowApp.issues":`{n} Fehler im Entwurf`,"flowApp.flow":`Ablauf`,"flowApp.notPublished":`Veröffentliche ihn im Studio, dann läuft er hier.`,"flowApp.runPage":`Im Browser weiter`,"flowApp.inBrowser":`Nur im Browser: {fields}`,"flowApp.done":`Fertig`,"flowApp.credits":`{n} Credits`,"flowApp.ask":`Der Wizard fragt`,"flowApp.allow":`Erlauben`,"flowApp.skip":`Überspringen`,"flowApp.signIn":`Eine Anmeldung bei {site} – das geht nur im Browser.`,"flowApp.fullscreen":`Größer`,"flowApp.inline":`Kleiner`,"flowApp.failed":`Das hat nicht geklappt: {error}`},fb={"brand.tagline":`Build AI wizards, no code.`,"brand.sub":`Describe a flow in your own words. engenty turns it into a wizard you share with a link.`,"auth.dev":`Dev login (local)`,"auth.legal":`No password, no sign-up form — you sign in with an account you already have.`,"auth.signIn":`Sign in or create an account`,"auth.failed":`Sign-in did not work. Please try again.`,"auth.localLink":`Open the link the app printed at start — it signs you in on this device.`,"nav.account":`Account & credits`,"setup.keysInAccount":`API keys for scripts belong to your account. You create and revoke them there.`,"setup.openAccount":`Open account`,"class.label":`Model class`,"class.classifier":`Classifier`,"class.standard":`Standard`,"class.high":`High`,"class.highest":`Highest`,"class.image":`Image`,"class.video":`Video`,"class.audio":`Audio`,"class.speech":`Speech`,"class.classifier.hint":`Routing, yes/no, pulling a few values out of text. Cheapest.`,"class.standard.hint":`Short copy, calling an API, reformatting.`,"class.high.hint":`Research with tools, long documents, weighing many sources.`,"class.highest.hint":`Hard reasoning or code. Several times the cost of High.`,"class.effort":`Thinking effort`,"class.effortAuto":`Automatic`,"class.effort.low":`Low`,"class.effort.medium":`Medium`,"class.effort.high":`High`,"estimate.step":`≈ {n} credits, rarely more than {high}`,"estimate.measured":`measured from the latest runs`,"estimate.formula":`estimated, gets exact after five runs`,"estimate.share":`A run costs about {run} credits. At the daily limit that is at most {day} credits a day.`,"local.title":`Models`,"local.accountWaiting":`Waiting for the sign-in in your browser …`,"local.accountFailed":`The account service cannot be reached right now.`,"local.accountExpired":`The sign-in has expired. Please sign in again.`,"local.sourceNeedsAccount":`This needs an account.`,"local.toAccount":`Go to Settings → Account`,"local.sourceOwn":`Own keys`,"local.keys":`Keys`,"local.keysHint":`One key is enough. Keys live in this device's keychain, never in the database.`,"local.keySet":`stored`,"local.keyEmpty":`not stored`,"local.keyRemove":`Remove`,"local.classes":`Model per class`,"local.classesHint":`A step names only the class. Here is which model serves it, e.g. anthropic/claude-haiku-4.5, openai:gpt-5.4-mini or ollama:qwen3.`,"local.save":`Save`,"local.saved":`Saved`,"local.chat":`The studio chat answers on`,"local.chatModels":`Model class Highest`,"local.chatClaude":`Claude subscription (Claude Code)`,"local.subscription":`With the subscription, the Claude Code installed on this device builds the wizard — on your sign-in there. Runs keep using keys or credits.`,"harness.hint":`Text thinks on the {name} installed on this device — on your {sub} and your sign-in there. No key needed. Images, video and audio still need a key.`,"harness.hintImages":`Text and images come from the {name} installed on this device — on your {sub} and your sign-in there. No key needed. Video and audio still need a key.`,"harness.found":`{name} {version} found`,"harness.missing":`{name} is not installed on this device.`,"harness.install":`Or in your own terminal:`,"harness.installButton":`Install {name}`,"harness.installing":`{name} installs in the terminal below — it takes about a minute. Then you sign it in.`,"harness.installEnded":`The install ended, but {name} is not there. What it printed above says why.`,"harness.appHere":`The {app} app is on this computer: {name} signs in with the same {sub}.`,"harness.notInstalled":`not installed`,"harness.authSubscription":`Signed in with your {sub}.`,"harness.authKey":`Signed in with an API key from your shell — not the subscription. Sign in here so it runs on your {sub}.`,"harness.authNone":`Not signed in yet.`,"harness.signIn":`Sign in here`,"harness.signingIn":`The sign-in runs in the terminal below — your browser opens for it. The terminal closes once the sign-in is there.`,"harness.signInInteractive":`{name} starts below. Pick the sign-in with your {sub} there and sign in in the browser. The terminal closes once the sign-in is there.`,"harness.loginEnded":`The sign-in ended without {name} being signed in.`,"harness.sub.claude":`Claude subscription`,"harness.sub.codex":`ChatGPT subscription`,"harness.sub.gemini":`Google account`,"harness.sub.cursor":`Cursor subscription`,"harness.desc.claude":`On your Claude subscription — no key needed.`,"harness.desc.codex":`On your ChatGPT subscription — no key needed.`,"harness.desc.gemini":`On your Google account — no key needed.`,"harness.desc.cursor":`On your Cursor subscription — no key needed.`,"harness.ready":`signed in`,"local.recheck":`Check again`,"local.test":`Test`,"local.testHint":`One short call shows whether the way to the model is open.`,"local.testOk":`Answered in {s} s on {ref}: “{reply}”`,"local.testFailed":`The test did not work: {error}`,"models.groupCaps":`Capabilities`,"models.groupAccess":`Access`,"models.groupMore":`More providers`,"models.cap.text":`Text & reasoning`,"models.cap.text.hint":`Writes, summarizes, researches and decides – in almost every step.`,"models.cap.image":`Images`,"models.cap.image.hint":`Makes images: logos, product shots, illustrations.`,"models.cap.video":`Videos`,"models.cap.video.hint":`Makes short clips from text or from an image.`,"models.cap.speech":`Voice`,"models.cap.speech.hint":`Reads text aloud: voice-overs, audio versions, announcements.`,"models.cap.listening":`Voice notes`,"models.cap.listening.hint":`Understands speech and turns voice notes into text.`,"models.way.local":`Local model`,"models.way.credits":`Credits`,"models.way.creditsTeam":`Team credits`,"models.way.none":`not set up`,"models.who":`Who does it?`,"models.optSubscription":`Your subscription`,"models.optKey":`Own API key`,"models.optLocal":`Local model`,"models.optLocalNote":`Ollama on this computer`,"models.noteIncluded":`included in the plan`,"models.noteSignedOut":`not signed in`,"models.noteMissing":`not installed`,"models.noteKey":`API key stored`,"models.noteKeyShort":`key`,"models.noteSignedIn":`signed in`,"models.noteShellKey":`API key from the shell`,"models.optOther":`Other`,"models.optCreditsGroup":`engenty`,"models.noteNoKey":`API key missing`,"models.noteNeedsAccount":`needs an account`,"models.notePerImage":`≈ {n} credits per image`,"models.notePerSecond":`≈ {n} credits per second`,"models.notePer1k":`≈ {n} credits per 1000 characters`,"models.notePerMinute":`≈ {n} credits per minute`,"models.creditsAuto":`engenty picks: {model}`,"models.creditsAutoNone":`engenty picks the model`,"models.creditsPickHint":`Billed in credits – no API key of your own.`,"models.viaCredits":`{name} on engenty credits`,"models.viaCreditsHint":`No API key of your own, billed in credits.`,"models.viaCreditsNeedsAccount":`With an engenty account, billed in credits.`,"models.noteUsage":`credits by usage`,"models.model":`Model`,"models.modelCustom":`Another model …`,"models.textSimple":`Simple steps`,"models.textDemanding":`Demanding steps`,"models.perClass":`Adjust per class`,"models.manageKey":`{name} API key`,"models.key":`API key`,"models.keyFor":`{name} API key`,"models.keyGet":`Get a key from {name}`,"models.keySave":`Check and save`,"models.keyStored":`API key stored`,"models.keyNone":`No API key`,"models.keyCheck":`Check`,"models.keyReplace":`Replace`,"models.keyRemove":`Remove`,"models.keyOk":`The key works.`,"models.keyBad":`The key was not accepted.`,"models.keyWhereLocal":`The key stays on this device, never in the database.`,"models.keyWhereCloud":`The key is kept encrypted for the team. Nobody sees it again.`,"models.keyFallback":`Until the key is there, credits step in.`,"models.uses":`Used for`,"models.useFor":`Use`,"models.inUse":`in use`,"models.try":`Try it`,"models.try.text":`Test`,"models.try.image":`Make a test image`,"models.try.video":`Make a test clip`,"models.try.speech":`Hear a sample`,"models.try.listening":`Test listening`,"models.tryCost":`Costs like a real call.`,"models.tryCostVideo":`A 4-second clip – costs like a real one.`,"models.tryWait":`Generating …`,"models.tryWaitVideo":`A clip takes a minute or two …`,"models.tryOk":`In {s} s with {model}`,"models.tryHeard":`Heard: “{text}”`,"models.tryHeardNothing":`Nothing heard – the way is open.`,"models.tryFailed":`That did not work: {error}`,"models.creditsName":`engenty credits`,"models.creditsTeam":`Team credits`,"models.creditsLocalLead":`Step in where no subscription and no own API key is set up.`,"models.creditsCloudHint":`Everything without an own API key runs on the credits. Own keys come first and cost no credits.`,"models.creditsConnectTitle":`With an account`,"models.creditsLocalHint":`With an engenty account, credits step in where nothing of your own is set up – for videos without an own API key, say.`,"models.creditsConnect":`Connect an account`,"models.creditsFallback":`Credits step in`,"models.creditsFallbackOn":`What has no subscription and no own API key runs on the credits.`,"models.creditsFallbackOff":`Off: what has no subscription and no own API key does not run.`,"models.creditsOn":`Runs on credits`,"models.creditsNone":`Nothing runs on credits right now.`,"models.creditsTopUp":`Top up`,"models.creditsPicks":`engenty picks the model and bills in credits.`,"models.creditsModel":`Right now: {model}.`,"models.clientSignIn":`Sign-in`,"models.clientImages":`{name} makes images with your {sub} – no API key of your own.`,"models.clientNotChosen":`Text does not run on {name} right now.`,"models.ollamaHint":`Where Ollama runs and the model it serves.`,"models.readOnly":`Only the team's admins change its models.`,"models.viewAs":`Preview as`,"models.view.auto":`as it is`,"models.view.local":`local`,"models.view.linked":`local + account`,"models.view.cloud":`cloud studio`,"setup.title":`Setup`,"setup.sub":`Engenty can use your existing accounts on your computer.`,"setup.source":`Choose your Engine`,"setup.local":`Runs locally on this device.`,"setup.stage.connect":`Connect`,"setup.stage.test":`Test`,"setup.stage.done":`Done`,"setup.h.install":`Install {name}`,"setup.h.signIn":`Sign in to {name}`,"setup.h.keys":`Enter a key`,"setup.h.test":`One short test`,"setup.h.done":`Connected.`,"setup.ready":`All set.`,"setup.noHarness":`No AI client installed yet. Pick one — it installs right here — or enter your own keys.`,"setup.ownDesc":`AI Gateway, OpenAI, Anthropic or Ollama.`,"setup.recommended":`Recommended`,"setup.done":`Open the studio`,"setup.untilWorks":`The studio opens once the test works.`,"cloud.onPublish":`When you publish the wizard, the version also goes to your account's cloud and runs there behind a link of its own.`,"cloud.notSent":`This version is not in the cloud yet.`,"cloud.send":`Send now`,"cloud.resend":`Send again`,"cloud.again":`It is tried again at {when}.`,"cloud.sent":`Version {v} · sent {when}`,"cloud.notRunnable":`Version {v} does not run in the cloud.`,"cloud.keepsRunning":`Version {v} keeps running there.`,"cloud.nothingRuns":`So nothing runs there yet.`,"cloud.notes":`What runs differently in the cloud:`,"cloud.check":`What the cloud would lack for the wizard as it is now:`,"cloud.checkBlocking":`As it is now, the wizard would not run in the cloud:`,"cloud.documents":`The space's documents stay on this device. In the cloud the steps work without them.`,"cloud.stepName":`“{title}”`,"cloud.problem.sandbox":`The server has no machine for code. There it works without one.`,"cloud.problem.mcp":`The space's MCP servers are not on the server: {detail}.`,"cloud.problem.model":`The cloud has no model for this.`,"cloud.problem.connector":`The space lacks a connector in the cloud.`,"cloud.problem.invalid":`The server does not take the wizard like this.`,"cloud.spaceLimit":`Your account's cloud already holds the space of another install:`,"cloud.replace":`Replace that space`,"cloud.replaceConfirm":`Remove that space from the cloud? Its wizards and their links go from there. Then everything published here is sent.`,"cloud.noticeError":`Published here. This version did not arrive in the cloud — see below.`,"cloud.noticeNotRunnable":`Published here. This version does not run in the cloud — see below.`,"readonly.wizard":`This wizard comes from your local install and is changed there. What you publish there runs here.`,"readonly.project":`This space comes from your local install and is changed there.`,"readonly.server":`Nothing is built on this server. The wizards your local install publishes run here.`,"nav.wizards":`Wizards`,"nav.settings":`Settings`,"nav.project":`Space`,"account.title":`Account`,"account.hint":`What the app calls you and how to reach you.`,"account.initials":`Your initials in the menu at the top right: the first letters of your name.`,"account.name":`Name`,"account.nameHint":`It starts as this device's user name.`,"account.fromAccount":`Name and e-mail come from your account.`,"account.about":`About you`,"account.aboutHint":`Who you are and what you do.`,"account.email":`E-mail`,"account.phone":`Phone`,"account.connection":`engenty.ai`,"account.connectionHint":`Sign-in, credits and the cloud that runs your wizards for everyone.`,"account.profile":`Profile`,"account.local":`Local install`,"account.localText":`This app runs on your device and is not connected to an account. Wizards, the space and files stay here.`,"account.linked":`Connected`,"account.with":`With an account`,"account.withCredits":`Credits for the models where no AI client is installed. No API key needed.`,"account.withCloud":`What you publish also runs on engenty.ai, behind a public link, even when this device is off.`,"account.signIn":`Sign in`,"account.signInAgain":`Sign in again`,"account.new":`No account yet?`,"account.newHint":`A new account needs an invitation code. Enter it here and the sign-up page has it filled in.`,"account.code":`Invitation code`,"account.create":`Create account`,"account.credits":`Credits`,"account.topUp":`Top up`,"account.expires":`{n} credits valid until {date}`,"account.kind.start":`Starting credits`,"account.kind.monthly":`Monthly credits`,"account.kind.gift":`Gift`,"account.cloud":`What you publish here also runs on {host}.`,"account.look":`Appearance`,"account.lookHint":`Language and theme of the app in this browser.`,"nav.logout":`Sign out`,"nav.connected":`Connected to {host}`,"nav.expired":`Sign-in expired`,"nav.onlyHere":`Only on this computer`,"nav.local":`local`,"nav.language":`Language`,"nav.theme":`Theme`,"nav.credits":`{n} credits`,"footer.billing":`Credits`,"footer.usage":`Usage`,"footer.invoices":`Invoices`,"footer.account":`Account`,"about.version":`Version {v}`,"about.update.available":`Version {v} of engenty wizards is out.`,"about.update.install":`Update`,"about.update.installing":`Installing version {v} …`,"about.update.restarting":`Restarting with version {v} …`,"about.update.done":`Installed. Restart engenty wizards to use {v}.`,"about.update.failed":`The update failed. Logs: logs/update.log`,"about.update.notes":`What's new`,"about.changelog":`Changelog`,"about.changelogHint":`What changed from release to release.`,"about.changelogEmpty":`Nothing here yet.`,"about.unreleased":`Unreleased`,"about.breaking":`breaking`,"about.credits":`Open source`,"about.creditsHint":`engenty wizards and the open-source software it builds on.`,"about.creditsProduct":`engenty`,"about.creditsBuiltWith":`Built with`,"about.creditsDeps":`Direct dependencies`,"about.creditsDepsHint":`What the parts of this app include themselves, with version and license — without their own dependencies.`,"about.creditsShared":`Used by more than one part`,"about.search":`Search …`,"about.noMatches":`No matches.`,"theme.dark":`Dark theme`,"theme.light":`Light theme`,"home.title":`Your wizards`,"home.new":`New wizard`,"home.import":`Import`,"import.failed":`The import did not work`,"home.empty":`No wizards in this space yet.`,"home.live":`Live`,"home.draft":`Draft`,"where.here":`Local`,"where.hereVersion":`Local · version {v}`,"where.hereHint":`Runs only on this computer, while the app is running.`,"where.liveHint":`Runs on {host}, for everyone with the link.`,"where.liveAt":`Live on {host} · version {v}`,"where.note":`1 note`,"where.notes":`{n} notes`,"where.sending":`Being sent`,"where.missing":`Not in the cloud`,"home.steps":`{n} steps`,"home.newProject":`New space`,"home.projectName":`Space name`,"home.projectLimit":`At most {n} spaces`,"team.title":`Team`,"team.hint":`Who is in the team and which plan it is on. Inviting and managing happens in the account.`,"team.plan":`Plan`,"team.planFree":`Free`,"team.seats":`{taken} of {limit} seats`,"team.seatsUnlimited":`Unlimited seats`,"team.members":`Members`,"team.invited":`invited`,"team.you":`you`,"team.manage":`Manage members`,"team.changePlan":`See plans`,"team.roles":`Owners and admins create and delete wizards and spaces; members edit the wizards there are.`,"team.memberNote":`You are a member: you edit wizards, admins create new ones and delete.`,"team.failed":`The team could not be loaded.`,"team.role.owner":`Owner`,"team.role.admin":`Admin`,"team.role.member":`Member`,"models.ownKeysPlan":`Your own API keys come with the Pro plan. Here the team's credits pay.`,"home.fromLocal":`From your local install — changed there.`,"home.syncedAt":`Last arrived: {when}.`,"home.local.title":`The wizards from your local install run here`,"home.local.text":`You build on your own computer. What you publish there runs here — for everyone, behind a link.`,"home.local.install":`Install engenty wizards on your computer:`,"home.local.signIn":`Sign in there with this account, under Settings → Account.`,"home.local.publish":`Publish a wizard. It then shows up here.`,"new.title":`What should your wizard do?`,"new.placeholder":`e.g. Customers enter their product and audience, the wizard researches competitors and writes a positioning briefing as a PDF.`,"new.build":`Build wizard`,"new.orStarter":`Or start from a template`,"new.import":`Import a wizard package`,"new.hint":`You can change everything afterwards in the conversation.`,"editor.resize":`Resize — double-click resets`,"editor.resizeSheet":`Resize — tap folds and unfolds`,"editor.export":`Export as a package (.wizard)`,"editor.chat":`Conversation`,"editor.step":`Steps`,"editor.runs":`Runs`,"editor.reviewEditable":`editable`,"editor.reviewRedo":`can be redone`,"editor.otherwise":`otherwise`,"editor.whenFilled":`{field} filled in`,"editor.whenEmpty":`{field} empty`,"tool.web_search":`Web search`,"tool.web_fetch":`Read web pages`,"tool.browser":`Browser`,"tool.sandbox":`Code & shell`,"tool.image":`Images`,"tool.http":`API`,"tool.pages":`Pages`,"editor.test":`Test`,"editor.share":`Share`,"editor.publish":`Publish`,"editor.published":`Live · version {v}`,"editor.unpublishedChanges":`Unpublished changes`,"editor.notPublished":`Not published yet`,"editor.composer":`Describe what should change …`,"editor.attach":`Attach files`,"editor.detach":`Remove`,"editor.attached":`Attached`,"editor.thread":`Thread`,"editor.voice":`Dictate`,"editor.voiceStop":`Stop dictating`,"editor.listening":`Listening …`,"editor.transcribing":`Writing it down …`,"editor.micDenied":`The microphone is not allowed for this page.`,"editor.building":`Building the flow …`,"editor.files":`Files`,"files.explain":`What your wizard needs on every run: widget code, libraries, map outlines, price lists. The assistant creates them in the chat – you can upload your own too.`,"files.upload":`Upload`,"files.count":`{n} files · {size}`,"files.empty":`No files yet. Drop files here or ask the assistant to build a widget.`,"files.download":`Download`,"files.delete":`Delete`,"files.confirmDelete":`Delete “{path}”?`,"files.none":`This wizard has no files.`,"editor.thinking":`Thinking …`,"editor.chatBroken":`The connection dropped. What was already built is saved – please send your message again.`,"editor.issues":`Before you test or share, the wizard needs a few fixes:`,"editor.fixWithChat":`Let the assistant fix it`,"editor.models.blocking":`The wizard can't start like this. Models are missing:`,"editor.models.optional":`These steps won't run like this. Choose a path without them when testing, or set up the models:`,"editor.models.settings":`Set up models`,"editor.prevStep":`Previous step`,"editor.nextStep":`Next step`,"editor.deleteStep":`Delete step`,"editor.moveUp":`Move up`,"editor.moveDown":`Move down`,"editor.noRuns":`No runs yet.`,"editor.restart":`Restart`,"editor.close":`Close`,"editor.chatHello":`Tell me what your wizard should do. I'll build the flow and you'll see it as a diagram on the left.`,"shareRun.button":`Share`,"shareRun.title":`Share result`,"shareRun.email":`Email`,"shareRun.more":`More …`,"shareRun.until":`The link works until {date}.`,"shareRun.kept":`The link works until you withdraw it.`,"shareRun.withdraw":`Withdraw link`,"sharePage.gone":`This link has expired or was withdrawn.`,"sharePage.own":`Try it yourself`,"sharePage.until":`Shared · available until {date}`,"sharePage.shared":`Shared on {date}`,"share.title":`Share wizard`,"share.link":`Link`,"share.copy":`Copy`,"share.copied":`Copied`,"share.enabled":`Link is active`,"share.limit":`Runs per day`,"share.rotate":`Create a new link`,"share.rotateHint":`The old link stops working.`,"share.publishFirst":`Publish the wizard so the link works.`,"share.open":`Open`,"share.unpublished":`Your changes are not published yet: the link runs the version before.`,"share.website":`Website`,"share.openHere":`Test on this computer`,"share.settings":`Settings`,"share.on":`on`,"share.off":`off`,"share.perDay":`{n} a day`,"share.rotateCloud":`The old link stops working, the one in the cloud too.`,"share.others":`Share with others`,"share.othersHint":`With an account the wizard also runs on engenty.ai: a link, a QR code and a tag for your website, for everyone, also while your computer is off.`,"share.details":`Details`,"teaser.website":`A website needs a link everyone can reach. With an account the wizard also runs on engenty.ai, and the tag for your page is here.`,"teaser.qr":`A QR code needs a link every phone can reach. With an account the wizard also runs on engenty.ai, and its QR code and the ID for the app are here.`,"teaser.link":`This link only works on this computer, while the app is running. With an account the wizard also runs on engenty.ai, with a link for everyone.`,"teaser.models":`No API key of your own: with an account, text, images and videos run on credits.`,"teaser.connect":`Connect an account`,"teaser.modelsLinked":`Or on your account's credits: under Models, choose "The account's credits".`,"share.qr":`QR code`,"share.qrHint":`Scan it with a phone's camera: the wizard opens, in the engenty wizards app when it is installed.`,"share.code":`ID for the app:`,"share.readOnly":`Whether the link is active and how many runs a day it allows is set in your local install.`,"embed.inline":`Inline`,"embed.modal":`Button + modal`,"embed.inlineHint":`Paste the tag into your page's HTML. The wizard appears in that place.`,"embed.modalHint":`Paste the tag into your page's HTML. A button appears in that place and opens the wizard in a window.`,"type.page":`Page`,"type.agent":`AI step`,"type.generate":`Generate`,"type.widget":`Widget`,"type.film":`Film`,"type.review":`Review`,"type.result":`Result`,"run.start":`Let's go`,"run.closed":`Not available here right now, it needs: {list}`,"run.cls.text":`text`,"run.cls.image":`images`,"run.cls.video":`video`,"run.cls.speech":`speech output`,"run.cls.audio":`voice notes`,"run.next":`Continue`,"run.back":`Back`,"run.accept":`Looks good`,"run.regenerate":`New version`,"run.edit":`Edit`,"run.resume":`Continue your last run`,"run.regenerateNote":`What should change?`,"run.pickItem":`No. {n}`,"run.pickedItem":`No. {n} again`,"run.regeneratePicked":`Only no. {n} will be made again.`,"run.regenerateAll":`Applies to all. Tap a number to change single ones only.`,"check.progress":`{done} of {total} checked`,"check.onlyOpen":`Open only`,"check.noFile":`There is no file for this row.`,"check.noPreview":`This file has no preview – open it with the link above.`,"check.reopen":`Open again`,"market.search":`Search templates …`,"market.all":`All`,"market.industry":`Industry`,"market.format":`Result`,"market.capability":`Capability`,"market.unavailable":`not set up`,"market.without":`Works without: {list}`,"market.optional":`not set up, works without`,"market.optionalHint":`Runs here without {list}: answers that would need it are locked in the wizard. Set it up under Models.`,"market.missing":`Not set up here: {list}`,"market.missingHint":`This needs a model that isn't set up here: {list}. Set it up under Models.`,"market.none":`No template matches this selection.`,"market.notFound":`There is no such template (any more).`,"market.star":`Star`,"market.starred":`Starred`,"market.starHint":`Starred templates are kept on this computer, ready without a connection.`,"market.noneStarred":`You haven't starred a template yet.`,"market.offline":`No connection to the marketplace: you see the templates kept here.`,"market.more":`Show more`,"market.reset":`Reset selection`,"market.count":`{n} templates`,"market.countOf":`{n} of {all} templates`,"market.countOfShort":`{n} of {all}`,"market.resetShort":`Reset`,"market.minutes":`~ {n} min`,"market.credits":`~ {n} credits per run`,"market.needsUpdate":`Needs a newer app`,"market.needsUpdateHint":`This template uses features your app does not know yet. Update the app, then you can use it.`,"market.use":`Start with this template`,"market.steps":`How the wizard runs`,"market.duration":`Duration`,"market.durationHint":`from start to result, with {n} inputs from you`,"market.result":`Result`,"market.creditsRange":`~ {n} credits`,"market.creditsHint":`estimated per run, rarely more than twice that`,"market.needs":`Needs`,"market.cost":`Cost`,"new.forWebsite":`Small helpers for your website`,"run.feedbackPlaceholder":`Something not right? Write what should be different …`,"run.feedbackTarget":`What should change?`,"run.feedbackPick":`Pick above what should change.`,"ai.generated":`AI generated`,"ai.modified":`AI modified`,"ai.publish":`Made with AI: whoever publishes this has to label it as AI-generated (EU AI Act, Art. 50). The file already carries the marking in its metadata.`,"run.regenerateGo":`Recreate`,"run.retry":`Try again`,"run.again":`Start over`,"run.download":`Download`,"run.copy":`Copy text`,"run.failed":`Something went wrong.`,"run.unavailable":`This wizard is not available right now.`,"run.notFound":`This wizard does not exist (anymore).`,"run.madeWith":`Made with engenty wizards`,"run.working":`One moment …`,"run.elapsed":`{s} s`,"run.cancelled":`Cancelled.`,"run.addRow":`Add row`,"run.upload":`Choose a file or drop it here`,"run.uploading":`Uploading …`,"run.required":`Required`,"run.net":`Net`,"run.vat":`VAT {r} %`,"run.total":`Total`,"settings.title":`Settings`,"settings.name":`Name`,"settings.mcp":`Connected systems (MCP)`,"settings.mcpHint":`AI steps can read from and write to these systems — only when you allow it on the step.`,"settings.addServer":`Connect a system`,"settings.serverName":`Name`,"settings.serverUrl":`MCP URL`,"settings.serverHeader":`Authorization header (optional)`,"settings.save":`Save`,"settings.saved":`Saved`,"settings.delete":`Delete space`,"settings.noProject":`Your space shows up here once your local install has published its first wizard.`,"settings.copy":`Copy`,"settings.copied":`Copied`,"settings.lastUsed":`last used {when}`,"settings.neverUsed":`never used`,"settings.revoke":`Delete key`,"mcp.appsDisconnect":`Remove`,"plugins.title":`Plugins`,"plugins.hint":`Plugins add pages, settings and tools for steps to this app. They run with the app's full rights: install only what you know.`,"plugins.hintManaged":`These plugins are switched on for your account.`,"plugins.reload":`Reload`,"plugins.rescan":`Look again`,"plugins.tools":`Tools for steps`,"plugins.serverFailed":`The server half did not load: {error}`,"plugins.studioFailed":`The studio half did not load: {error}`,"plugins.problems":`Not a plugin`,"plugins.crashed":`This part of a plugin crashed.`,"mcp.notReverse":`Not the same as “Connected systems (MCP)” under Connectors: there engenty calls other servers, here your client calls engenty.`,"integrate.nav":`Integrate`,"integrate.groupApps":`AI apps`,"integrate.groupShare":`Share`,"integrate.shareLink":`Share by link`,"integrate.shareSite":`Put on a website`,"integrate.soon":`soon`,"integrate.stateWorks":`works`,"integrate.stateConnected":`added`,"integrate.stateInstalled":`on this computer`,"integrate.kindMcp":`Tools in the chat: find, run and fill in wizards — and build them.`,"integrate.kindMcpShort":`tools in the chat`,"integrate.kindAppShort":`the wizard as a widget`,"integrate.kindAppNoShort":`this app does not show it`,"integrate.kindApp":`The wizard itself in the chat, page by page, as a widget.`,"integrate.kindAppNo":`This app does not show them — a run comes as text.`,"integrate.where":`Where does the app run?`,"integrate.here":`On this computer`,"integrate.hereHint":`One click, no key. The app starts engenty wizards itself.`,"integrate.hereManaged":`Only with engenty wizards on your computer.`,"integrate.address":`At the address`,"integrate.addressHint":`From anywhere the address can be reached — with a key.`,"integrate.connectTitle":`Add`,"integrate.connectHint":`Adds engenty wizards to the settings of {app}.`,"integrate.connect":`Add to {app}`,"integrate.connected":`Added to {app}`,"integrate.notInstalled":`{app} is not on this computer. You can add it anyway — it works once {app} is there.`,"integrate.file":`Put this into {file}:`,"integrate.vscode":`In VS Code: "MCP: Open User Configuration", then add:`,"integrate.chatgpt":`In ChatGPT: Settings → Apps & Connectors → Advanced → Developer mode, then "Create" with this address:`,"integrate.generic":`In the app's MCP settings, add a server at this address (Streamable HTTP):`,"integrate.oauthLocal":`This app connects from its maker's servers — it cannot reach this computer. Use "On this computer" or an app that runs here.`,"integrate.test":`Test`,"integrate.seen":`{app} checks in`,"integrate.restart":`Quit {app} completely and start it again — then it checks in here.`,"integrate.reload":`Reload the MCP servers in {app}, or restart it.`,"integrate.tool":`Called a tool`,"integrate.askHint":`In a new chat in {app}, write:`,"integrate.askTool":`Which wizards do I have in engenty?`,"integrate.widget":`Showed the wizard as a widget`,"integrate.widgetHint":`Start a published wizard:`,"integrate.askWidget":`Start one of my engenty wizards.`,"integrate.works":`{app} works with your wizards.`,"mcp.notHere":`Not possible with this server`,"mcp.needsPublic":`claude.ai connects from Anthropic's servers. That only works when this server is reachable publicly over HTTPS.`,"mcp.keyTitle":`Create a key`,"mcp.keyHint":`The key signs your client in. It is shown once and goes straight into the command in the next step.`,"mcp.keyCreate":`Create a key for {client}`,"mcp.keyReady":`Key created — it is already in the command below.`,"mcp.keyFirst":`Create the key first — then the finished command shows up here.`,"mcp.add":`Add the server`,"mcp.terminal":`Run in the terminal:`,"mcp.ccPlugin":`Optionally the plugin — it adds the /wizard command:`,"mcp.codexKey":`Run in the terminal — Codex reads the key from an environment variable:`,"mcp.claudeAi":`In claude.ai: Settings → Connectors → Add custom connector, and enter this address:`,"mcp.oauth":`No key needed: on first use your client signs in in the browser.`,"mcp.addressPublic":`Reachable publicly.`,"mcp.addressLocal":`Reachable on this computer only, and only while engenty wizards runs.`,"mcp.keys":`Keys`,"mcp.keysHint":`Each key signs one client in and has every right — treat it like a password. Delete it and that client is signed out.`,"editor.viaClient":`Via {client}`,"editor.changedVia":`Changed via {client}`,"editor.merged":`Merged with changes from elsewhere`,"run.uploadMore":`Another file`,"run.camera":`Camera`,"camera.title":`Take a picture`,"camera.hint":`Hold it flat and well lit.`,"camera.taken":`{n} taken`,"camera.shoot":`Capture`,"camera.done":`Done`,"camera.denied":`The camera is not allowed for this page. Allow it in your browser's site settings (the lock icon in the address bar) — or take the photo with your camera app.`,"connect.go":`Connect`,"connect.connected":`Connected through {name}`,"connect.disconnect":`Disconnect`,"connect.none":`No provider is set up for connecting on this server yet.`,"connect.openLink":`Click here to open the sign-in in a new tab`,"list.empty":`No entries yet.`,"list.delete":`Delete row`,"ask.typeInto":`Type into the page …`,"ask.hide":`hidden`,"ask.up":`Scroll up`,"ask.down":`Scroll down`,"ask.pictureHint":`This is the page the wizard has open. You can also click and type right in the picture.`,"ask.remember":`Remember this sign-in for next time`,"ask.private":`What you enter goes straight into the page. The AI never sees it. Remembered sign-ins are stored encrypted.`,"ask.skip":`Skip`,"ask.done":`I am signed in`,"ask.signIn":`Sign in`,"ask.wants":`The wizard wants to run this in {service}:`,"ask.allowRest":`Allow for the rest of this run`,"ask.allow":`Allow`,"ask.deny":`Don't allow`,"store.open":`What this wizard remembers`,"store.title":`Kept for you`,"store.explain":`This wizard keeps lists, files and connected accounts for your next run. Only you see them.`,"store.empty":`Nothing kept yet.`,"store.rows":`{n} entries`,"store.signIns":`Remembered sign-ins in the browser`,"store.files":`{n} files · {size}`,"store.delete":`Delete everything`,"store.confirmDelete":`Really delete everything`,"common.close":`Close`,"connectors.title":`Connectors`,"connectors.hint":`Services a wizard can work in for the person — they connect their own account during a run. The main ones are built in; any other you find in the integrations.sh registry and import from its OpenAPI spec or its MCP server.`,"connectors.imported":`From the registry`,"connectors.noneImported":`No connector from the registry is imported here.`,"connectors.notSetUp":`not set up`,"connectors.setup":`The server still needs:`,"connectors.search":`Find a service, e.g. Notion, Stripe, GitHub`,"connectors.find":`Search`,"connectors.none":`Nothing found.`,"connectors.import":`Import`,"connectors.exists":`Already imported.`,"connectors.ownClient":`Own OAuth client`,"connectors.refresh":`Reload actions`,"connectors.remove":`Remove`,"connectors.actions":`{n} actions, {r} read-only`,"connectors.pending":`Actions appear once an account is connected`,"connectors.needsClient":`This service needs an OAuth client (id and secret). Remove it and import again with “Own OAuth client”.`,"connectors.authNone":`no sign-in`,"connectors.authOauth":`OAuth sign-in`,"connectors.authKey":`API key`,"connectors.group.read":`reads`,"connectors.group.write":`changes`,"connectors.group.destructive":`deletes`,"run.uploadTouch":`Choose a file`,"run.maxFiles":`At most {n} fit here – I left out the rest.`,"run.filesMin":`{n} of at least {min}`,"run.filesOf":`{n} of at most {max}`,"run.moveFile":`Move no. {n}`,"run.moveFileHint":`Drag to change the order`,"run.removeFile":`Remove`,"run.awake":`The screen stays on while the wizard works.`,"run.openFull":`Open full size`,"run.yes":`Yes`,"run.no":`No`,"run.share":`Share`,"run.shareNow":`Share now`,"run.shareFile":`Share as a file or open in an app`,"camera.asking":`Your browser is about to ask for the camera. The picture stays in this wizard.`,"camera.missing":`No camera was found on this device. Upload a photo instead.`,"camera.busy":`Another app is using the camera. Close it and try again.`,"camera.native":`Open the camera app`,"camera.pick":`Choose a photo`,"camera.torch":`Light`,"camera.flip":`Switch camera`,"camera.photo":`Photo`,"camera.video":`Video`,"camera.record":`Start recording`,"camera.stop":`Stop recording`,"camera.recording":`Recording — tap to stop.`,"camera.clipHint":`A short clip, {s} seconds at most.`,"camera.hintMany":`Capture page after page, then “Done”.`,"scan.button":`Scan`,"scan.title":`Scan a code`,"scan.asking":`Your browser is about to ask for the camera — it only reads the code.`,"scan.hint":`Hold the QR code or barcode inside the frame.`,"scan.hintQr":`Hold the QR code inside the frame. This device does not read barcodes here.`,"scan.miss":`No code was found in the photo. Try closer and sharper.`,"scan.fromPhoto":`Choose a photo of the code`,"scan.typeInstead":`Type it instead`,"location.use":`Use my location`,"location.locating":`Finding your location …`,"location.refining":`getting more exact …`,"location.accuracy":`exact to about {m} m`,"location.map":`Map`,"location.remove":`Remove location`,"location.why":`Your browser asks for your location. It is only used for this wizard. You can also just type the address.`,"location.denied":`Location is not allowed for this page. Allow it in your browser's site settings (the lock icon in the address bar) — or type the address below.`,"location.unavailable":`Your device could not find its location right now. Try again outdoors or type the address.`,"location.timeout":`That took too long. Try again or type the address.`,"location.manual":`Type an address or place`,"location.label":`Address or description of the place`,"voice.start":`Record a voice note`,"voice.stop":`Stop`,"voice.recording":`Recording …`,"voice.left":`{s} s left`,"voice.again":`Record again`,"voice.remove":`Delete`,"voice.pick":`Choose an audio file`,"voice.why":`Your browser asks for the microphone. The recording is turned into text afterwards.`,"voice.denied":`The microphone is not allowed for this page. Allow it in your browser's site settings — or record the note with your voice memo app and choose the file.`,"voice.noRecorder":`This browser cannot record here. Record the note with your voice memo app and choose the file.`,"sign.open":`Sign here`,"sign.hint":`Sign with your finger`,"sign.pad":`Signature pad`,"sign.clear":`Clear`,"sign.accept":`Use it`,"sign.again":`Sign again`,"sign.remove":`Remove signature`,"notify.ask":`Tell me when it is done`,"notify.on":`You will be told`,"notify.why":`With a sound, a buzz or a notification. Your browser asks once for permission.`,"notify.onHint":`You can switch apps — a notification brings you back.`,"notify.quiet":`With a sound and a buzz while this page is open.`,"notify.blocked":`Notifications are blocked for this page — you get a sound and a buzz while it is open. You can allow them in your browser's site settings.`,"notify.done":`Your result is ready.`,"notify.next":`It goes on — have a look.`,"notify.needsYou":`The wizard needs you for a moment.`,"install.add":`Add to home screen`,"install.ios":`Tap “Share” below, then “Add to Home Screen”.`,"install.bookmark":`Bookmark this wizard`,"install.bookmark.mac":`Press ⌘ D to keep this wizard in your bookmarks.`,"install.bookmark.pc":`Press Ctrl + D to keep this wizard in your bookmarks.`,"install.app":`Open in the app`,"install.app.offer":`Install the studio as an app: its own window, its own icon in the Dock or taskbar.`,"install.app.browser":`In Chrome or Edge the studio installs as an app: its own window, its own icon.`,"install.app.action":`Install as app`,"install.app.close":`Close`,"common.offline":`No connection. Check your network and try again.`,"common.retry":`Try again`,"common.cancel":`Cancel`,"common.loading":`Loading …`,"common.error":`Error`,"data.hint":`Tables and pages the space and its wizards keep.`,"data.all":`All data`,"data.own":`General`,"data.table":`Table`,"data.page":`Page`,"data.newTable":`New table`,"data.newPage":`New page`,"data.title":`Title`,"data.owner":`Belongs to`,"data.create":`Create`,"data.empty":`No tables or pages yet. Create one – soon your wizards will write here too.`,"data.rows":`{n} rows`,"data.addRow":`Row`,"data.noRows":`No rows yet.`,"data.deleteRow":`Delete row`,"data.deleteTable":`Delete table`,"data.deletePage":`Delete page`,"data.confirmDelete":`Delete “{title}”?`,"data.newColumn":`New column`,"data.columnName":`Name`,"data.columnType":`Type`,"data.required":`Must be filled in`,"data.deleteColumn":`Delete column`,"data.removeOption":`Remove`,"data.fromList":`A list of the wizard: every run writes into it. The columns come from the wizard.`,"data.badCell":`This value does not fit “{column}” and is not saved.`,"data.type.text":`Text`,"data.type.number":`Number`,"data.type.date":`Date`,"data.type.duration":`Duration`,"data.type.select":`Choice`,"data.type.boolean":`Yes / no`,"data.text.single":`One line`,"data.text.multiline":`Several lines`,"data.number.integer":`Whole number`,"data.number.decimal":`Decimal`,"data.number.percent":`Percent`,"data.number.currency":`Amount`,"data.currency":`Currency (e.g. EUR)`,"data.date.date":`Date`,"data.date.datetime":`Date and time`,"data.date.time":`Time`,"data.unit":`Entered in`,"data.unit.milliseconds":`ms`,"data.unit.seconds":`seconds`,"data.unit.minutes":`minutes`,"data.unit.hours":`hours`,"data.unit.days":`days`,"data.options":`Choices, one per line`,"data.multiple":`Several can be chosen`,"data.write":`Write`,"data.preview":`Preview`,"data.pageEmpty":`This page is still empty.`,"data.markdownHint":`Markdown: # heading, **bold**, - list`,"space.info":`Info & brand`,"space.knowledge":`Knowledge`,"space.data":`Data`,"space.results":`Results`,"space.resultsAll":`All results`,"space.resultsHint":`Runs of your wizards that reached their result, newest first.`,"space.resultsEmpty":`No results yet. A run shows up here once it is done.`,"space.resultCredits":`{n} credits`,"space.resultsSearch":`Search: wizard, answers, result …`,"space.resultsModeAll":`Live & test`,"space.resultsAnyTime":`Any time`,"space.resultsDay":`Last 24 hours`,"space.resultsDays":`Last {n} days`,"space.resultsNone":`No results for this search.`,"space.resultFiles":`{n} files`,"project.rename":`Rename space`,"project.saving":`Saving …`,"project.base":`Basics`,"project.baseHint":`Who is behind the wizards. Every AI step knows this.`,"project.title":`Title`,"project.titleHint":`Company, brand or undertaking — end users see it too.`,"project.about":`About`,"project.aboutHint":`What you do, for whom, and the tone you write in.`,"project.logos":`Logos`,"project.logosHint":`End users see the first logo. A description says what a variant is for.`,"project.logoAdd":`Logo`,"project.logoMain":`Main logo`,"project.logoMakeMain":`Make main logo`,"project.colors":`Colours`,"project.colorsHint":`The first colour is the accent of documents, dashboards and public pages.`,"project.colorAdd":`Colour`,"project.colorName":`e.g. Primary — buttons and headings`,"project.colorUse":`Describe how engenty should use this color.`,"project.colorAddTitle":`Add a colour`,"project.colorValue":`Colour value`,"project.colorUseLabel":`Use`,"project.add":`Add`,"project.colorAccent":`Accent`,"project.colorFirst":`Make accent`,"project.assets":`Assets`,"project.assetsHint":`Images, graphics, videos. AI steps place them in documents and choose by the description.`,"project.assetAdd":`Files`,"project.assetSearch":`Filter assets …`,"know.all":`All`,"know.title":`Knowledge`,"know.hint":`What your wizards' steps look things up in. Documents become pages and tables when they arrive; Kategorien keep the items apart.`,"know.empty":`Nothing here yet. Upload documents, add a page or give the assistant a website.`,"know.drop":`Drop documents here or`,"know.pick":`choose`,"know.page":`Page`,"know.table":`Table`,"know.faq":`FAQ`,"know.file":`File`,"know.category":`Kategorie`,"know.categories":`Kategorien`,"know.newPage":`New page`,"know.newTable":`New table`,"know.asFaq":`As an FAQ: a question and its answer per row`,"know.newCategory":`New Kategorie`,"know.search":`Try a search …`,"know.searchNone":`Nothing relevant found.`,"know.searchStats":`{candidates} candidates checked, {hits} relevant`,"know.searchUnchecked":`{hits} hits, unchecked`,"know.unchecked":`Without a classifier hits stay unchecked. It needs an AI Gateway or TypeSafe key, or an account.`,"know.keywordsOnly":`Without an embedding model the search finds words, not meaning.`,"know.clear":`Reset`,"know.sub":`{n} sub-pages`,"know.rows":`{n} rows`,"know.review":`Check`,"know.reviewed":`Checked`,"know.from":`From {label}`,"know.kept":`Changed by hand: {label} no longer writes it.`,"know.original":`Original`,"know.reading":`Reading …`,"know.subPages":`Sub-pages`,"know.addSub":`Sub-page`,"know.type.choice":`Choice`,"know.type.date":`Date`,"know.type.number":`Number`,"know.type.text":`Text`,"know.type.boolean":`Yes / no`,"know.name":`Name`,"know.type":`Type`,"know.unit":`Unit`,"know.unitHint":`e.g. h, €, kg`,"know.multiple":`Several values per item`,"know.ordered":`The values are ranked (low → high)`,"know.values":`Values`,"know.valuesHint":`One per line. More come with the items.`,"know.hintField":`Where the values come from`,"know.hintFieldHint":`Short, e.g. header, file name, the website's filter.`,"know.create":`Create`,"know.proposed":`Proposed`,"know.proposedHint":`It is filled once it is taken.`,"know.accept":`Take`,"know.dismiss":`Dismiss`,"know.alike":`“{a}” and “{b}” look like one value.`,"know.merge":`Merge`,"know.items":`{n} items`,"know.item":`1 item`,"know.row":`1 row`,"know.oneSub":`1 sub-page`,"know.addValue":`Add a value`,"know.range":`{min} to {max}`,"know.summary":`Overview`,"know.summaryHint":`A model sums up the items of this value. The search finds the overview like a page.`,"know.summaryWrite":`Write the overview`,"know.summaryAgain":`Write again`,"know.summaryEmpty":`No overview yet.`,"know.toc":`Contents`,"know.tocRows":`{n} rows in {table}`,"know.deleteCategory":`Delete Kategorie`,"know.confirmCategory":`Delete “{name}”? The items stay, only the Kategorie goes.`,"know.deleteValue":`Delete value`,"know.yes":`Yes`,"know.no":`No`,"know.minimum":`from`,"know.maximum":`to`,"know.contains":`contains`,"know.by.person":`set by hand`,"know.by.origin":`from the source`,"know.by.model":`read by a model`,"know.remove":`Remove`,"know.unset":`Not set`,"know.deleteFile":`Delete file`,"project.documents":`Documents`,"project.documentsHint":`PDFs, lists, Excel, Word, text. They are read and put into an index every AI step searches.`,"project.documentAdd":`Documents`,"project.drop":`Drop here or`,"project.staysLocal":`Stays in your local install and is not sent here.`,"project.description":`Add a description …`,"project.describing":`Looking at it …`,"project.reading":`Reading …`,"project.indexed":`In the index`,"project.indexedKeywords":`In the index (keywords)`,"project.notIndexed":`No text found`,"project.reindex":`Read again`,"project.pages":`{n} pages`,"project.keywordsOnly":`The index searches by keywords right now. With an AI Gateway or OpenAI key it also searches by meaning.`,"project.preview":`Preview`,"project.viewList":`Show as a list`,"project.viewCards":`Show as cards`,"project.original":`Original`,"project.readText":`Text as read`,"project.openOriginal":`Open the original`,"project.noText":`No text yet: the document is still being read, or could not be read.`,"project.textCut":`The preview shows the start ({shown} of {total} characters).`,"project.searchTest":`Search the index …`,"project.searchNone":`Nothing found.`,"project.remove":`Remove`,"project.removeConfirm":`Remove “{name}”?`,"project.facts":`Facts`,"project.factsHint":`What wizards should know: address, VAT id, opening hours — anything that fits.`,"project.factLabel":`Label`,"project.factValue":`Value`,"project.factAdd":`Entry`,"project.factType":`Type`,"project.factAuto":`Automatic`,"project.type.text":`Text`,"project.type.longtext":`Long text`,"project.type.number":`Number`,"project.type.date":`Date`,"project.type.url":`Link`,"project.type.email":`Email`,"project.type.phone":`Phone`,"project.type.boolean":`Yes / No`,"project.yes":`Yes`,"project.no":`No`,"project.assistant":`Assistant`,"project.assistantTitle":`Tell me about yourselves`,"project.assistantHello":`Name your website or give me files. I fill in what I find: title, description, logo, colours and facts.`,"project.assistantComposer":`e.g. “Read our website example.com” …`,"project.assistantTitleKnowledge":`What should your wizards know?`,"project.assistantHelloKnowledge":`Give me documents or tell me where the knowledge is. I read it in – below you see what goes in.`,"project.assistantComposerKnowledge":`Attach documents or say where the knowledge is …`,"project.assistantChanged":`Space updated`,"flowApp.loading":`The wizard is on its way …`,"flowApp.draft":`Draft`,"flowApp.published":`Published`,"flowApp.issues":`{n} issues in the draft`,"flowApp.flow":`Flow`,"flowApp.notPublished":`Publish it in the studio to run it here.`,"flowApp.runPage":`Continue in the browser`,"flowApp.inBrowser":`Only in the browser: {fields}`,"flowApp.done":`Done`,"flowApp.credits":`{n} credits`,"flowApp.ask":`The wizard asks`,"flowApp.allow":`Allow`,"flowApp.skip":`Skip`,"flowApp.signIn":`A sign-in at {site} — only in the browser.`,"flowApp.fullscreen":`Larger`,"flowApp.inline":`Smaller`,"flowApp.failed":`That did not work: {error}`},pb=`wizards.lang`;function mb(){try{let e=localStorage.getItem(pb);return e===`de`||e===`en`?e:null}catch{return null}}var hb=mb()??(typeof navigator<`u`&&!navigator.language.toLowerCase().startsWith(`de`)?`en`:`de`),gb=hb===`de`?db:fb,_b=new Set;function vb(e){if(e!==hb){hb=e,gb=e===`de`?db:fb,document.documentElement.lang=e;try{localStorage.setItem(pb,e)}catch{}for(let e of _b)e()}}function yb(e){return e.note&&ub(e.note,hb)||e.message}function Q(e,t){let n=gb[e]??db[e]??e;for(let[e,r]of Object.entries(t??{}))n=n.replace(`{${e}}`,String(r));return n}typeof document<`u`&&(document.documentElement.lang=hb),uy();var bb=`wizards.theme`,xb=new Set,Sb=window.matchMedia(`(prefers-color-scheme: dark)`);function Cb(){try{let e=localStorage.getItem(bb);return e===`light`||e===`dark`?e:null}catch{return null}}var wb=0;function Tb(){return wb>0?`dark`:Cb()??(Sb.matches?`dark`:`light`)}function Eb(){requestAnimationFrame(()=>{let e=document.querySelector(`meta[name="theme-color"]`),t=document.createElement(`canvas`).getContext(`2d`);if(!e||!t||!document.body)return;t.fillStyle=getComputedStyle(document.body).backgroundColor,t.fillRect(0,0,1,1);let[n,r,i]=t.getImageData(0,0,1,1).data;e.content=`#${[n,r,i].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`})}function Db(){let e=Tb()===`dark`;document.documentElement.classList.toggle(`dark`,e),Eb();for(let e of xb)e()}Sb.addEventListener(`change`,Db),Db();function Ob(){return(0,y.useSyncExternalStore)(e=>(xb.add(e),()=>xb.delete(e)),()=>document.documentElement.classList.contains(`dark`)?`dark`:`light`)}var kb=e=>`oklch(from ${sy[ly[e]??`cobalt`]} 0.34 calc(c * 0.6) h)`;function $(...e){return e.filter(Boolean).join(` `)}var Ab={primary:`bg-primary text-primary-foreground hover:brightness-[1.06] active:brightness-95 shadow-[0_1px_0_oklch(0%_0_0/0.08)]`,secondary:`bg-card text-ink border border-border hover:bg-paper-2`,ghost:`text-ink-2 hover:text-ink hover:bg-accent`,quiet:`bg-paper-2 text-ink hover:bg-paper-3`,danger:`text-rose hover:bg-rose-tint`},jb=(0,y.forwardRef)(function({variant:e=`primary`,size:t=`md`,busy:n,className:r,children:i,disabled:a,...o},s){return(0,Z.jsxs)(`button`,{ref:s,type:`button`,disabled:a||n,className:$(`inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-full font-medium transition-[background,filter,color,transform] duration-150 active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50`,t===`sm`&&`h-8 px-3 text-[0.8125rem] coarse:h-11 coarse:px-4`,t===`md`&&`h-10 px-4 text-sm coarse:h-11`,t===`lg`&&`h-12 px-6 text-[0.9375rem]`,Ab[e],r),...o,children:[n?(0,Z.jsx)(Hb,{className:`size-4`}):null,i]})});function Mb({label:e,className:t,children:n,...r}){return(0,Z.jsx)(`button`,{type:`button`,"aria-label":e,title:e,className:$(`inline-flex size-9 shrink-0 items-center justify-center rounded-full text-ink-3 transition hover:bg-accent hover:text-ink disabled:opacity-40 coarse:size-11`,t),...r,children:n})}var Nb=`rounded-lg border border-input bg-card px-3.5 text-[0.9375rem] text-ink shadow-[inset_0_1px_0_oklch(0%_0_0/0.02)] outline-none transition placeholder:text-ink-4 focus:border-focus focus:ring-4 focus:ring-focus-glow disabled:opacity-60`;function Pb(e){return/(^|\s)w-/.test(e??``)?null:`w-full`}var Fb=(0,y.forwardRef)(function({className:e,...t},n){return(0,Z.jsx)(`input`,{ref:n,className:$(Nb,Pb(e),`h-11`,e),...t})});function Ib(e){return(0,Z.jsx)(`input`,{type:`color`,className:`swatch size-11 shrink-0 cursor-pointer rounded-lg border border-input bg-card p-1`,...e})}var Lb=(0,y.forwardRef)(function({className:e,minRows:t=3,maxRows:n=14,onChange:r,...i},a){let o=(0,y.useRef)(null),s=()=>{let e=o.current;if(!e)return;let r=Number.parseFloat(getComputedStyle(e).lineHeight)||22;e.style.height=`auto`;let i=r*n+20;e.style.height=`${Math.min(Math.max(e.scrollHeight,r*t+20),i)}px`,e.style.overflowY=e.scrollHeight>i?`auto`:`hidden`};return(0,y.useLayoutEffect)(s),(0,Z.jsx)(`textarea`,{ref:e=>{o.current=e,typeof a==`function`?a(e):a&&(a.current=e)},className:$(Nb,Pb(e),`resize-none py-2.5 leading-[1.5]`,e),onChange:e=>{s(),r?.(e)},...i})});function Rb({value:e,onChange:t,options:n,className:r,placeholder:i}){return(0,Z.jsxs)(`div`,{className:$(`relative`,r),children:[(0,Z.jsxs)(`select`,{value:e,onChange:e=>t(e.target.value),className:$(Nb,`h-11 w-full appearance-none pr-9`),children:[i===void 0?null:(0,Z.jsx)(`option`,{value:``,children:i}),n.map(e=>(0,Z.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))]}),(0,Z.jsx)(`svg`,{className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 size-4 text-ink-3`,viewBox:`0 0 16 16`,fill:`none`,children:(0,Z.jsx)(`path`,{d:`M4 6l4 4 4-4`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})]})}function zb({value:e,onChange:t,options:n,multi:r,disabled:i}){let a=new Set(Array.isArray(e)?e:e?[e]:[]);return(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>{let o=a.has(e);return(0,Z.jsx)(`button`,{type:`button`,"aria-pressed":o,disabled:i?.includes(e),onClick:()=>{if(r){let r=new Set(a);o?r.delete(e):r.add(e),t(n.filter(e=>r.has(e)))}else t(e)},className:$(`h-10 rounded-full border px-4 text-sm transition disabled:pointer-events-none disabled:opacity-60 disabled:line-through coarse:h-11`,o?`border-ember bg-ember-tint text-ink`:`border-input bg-card text-ink-2 hover:border-ink-4 hover:text-ink`),children:e},e)})})}function Bb({checked:e,onChange:t,label:n,disabled:r}){return(0,Z.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":n,disabled:r,onClick:()=>t(!e),className:$(`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition before:absolute before:-inset-x-1 before:-inset-y-2.5 before:content-[''] disabled:pointer-events-none disabled:opacity-60`,e?`bg-primary`:`bg-paper-3`),children:(0,Z.jsx)(`span`,{className:$(`inline-block size-5 rounded-full bg-white shadow-sm transition-transform`,e?`translate-x-[22px]`:`translate-x-[2px]`)})})}function Vb({children:e,hint:t,required:n}){return(0,Z.jsxs)(`div`,{className:`mb-2`,children:[(0,Z.jsxs)(`div`,{className:`font-medium text-[0.875rem] text-ink`,children:[e,n?(0,Z.jsx)(`span`,{className:`ml-1 text-ember`,children:`*`}):null]}),t?(0,Z.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:t}):null]})}function Hb({className:e}){return(0,Z.jsxs)(`svg`,{className:$(`size-5 animate-spin`,e),viewBox:`0 0 24 24`,fill:`none`,children:[(0,Z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,stroke:`currentColor`,strokeOpacity:`0.2`,strokeWidth:`3`}),(0,Z.jsx)(`path`,{d:`M21 12a9 9 0 0 0-9-9`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`})]})}function Ub({className:e,children:t,...n}){return(0,Z.jsx)(`div`,{className:$(`rounded-xl bg-card shadow-soft ring-1 ring-border-soft`,e),...n,children:t})}function Wb({children:e,tone:t=`neutral`,icon:n,title:r}){return(0,Z.jsxs)(`span`,{title:r,className:$(`inline-flex h-6 items-center gap-1.5 whitespace-nowrap rounded-full px-2.5 font-medium text-[0.75rem]`,t===`neutral`&&`bg-paper-2 text-ink-2`,t===`live`&&`bg-moss-tint text-moss`,t===`warn`&&`bg-amber-tint text-ink-2`,t===`ember`&&`bg-ember-tint text-ember-strong`),children:[n??(t===`live`?(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-moss`}):null),e]})}function Gb({open:e,onClose:t,title:n,children:r,wide:i,bare:a}){let o=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=o.current;t&&(e&&!t.open?(t.showModal(),t.querySelector(`[data-autofocus]`)?.focus()):!e&&t.open&&t.close())},[e]),(0,Z.jsx)(`dialog`,{ref:o,onClose:t,onClick:e=>{e.target===o.current&&t()},className:$(`m-auto p-0 text-ink backdrop:bg-[oklch(20%_0.01_60/0.28)] backdrop:backdrop-blur-[2px]`,a?`w-[calc(100%-48px)] overflow-visible bg-transparent max-sm:m-0 max-sm:h-dvh max-sm:max-h-none max-sm:w-full max-sm:max-w-none`:`max-h-[calc(100dvh-32px)] w-[calc(100%-32px)] overflow-y-auto overscroll-contain rounded-2xl bg-card shadow-overlay`,i===`page`?`sm:max-w-4xl`:i?`sm:max-w-2xl`:`sm:max-w-md`,!a&&(i===`page`?`max-w-4xl`:i?`max-w-2xl`:`max-w-md`)),children:e&&a?r:e?(0,Z.jsxs)(`div`,{className:`p-5 sm:p-7`,children:[n?(0,Z.jsxs)(`div`,{className:`mb-5 flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`h2`,{className:`min-w-0 font-display font-semibold text-xl`,children:n}),(0,Z.jsx)(Mb,{label:Q(`common.close`),onClick:t,className:`-mt-1.5 -mr-2`,children:(0,Z.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,className:`size-4`,"aria-hidden":`true`,children:(0,Z.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})})]}):null,r]}):null})}function Kb({text:e}){return e.split(/(https?:\/\/[^\s)]+)/).map((e,t)=>t%2?(0,Z.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`font-medium text-ink underline underline-offset-2`,children:new URL(e).host},e):e)}function qb(e){let t=Xb.get(e);if(t)return t;if(!Zb){let e=document.createElement(`canvas`);e.width=1,e.height=1,Zb=e.getContext(`2d`,{willReadFrequently:!0})}let n=[.5,.5,.5];if(Zb){Zb.clearRect(0,0,1,1),Zb.fillStyle=`#808080`,Zb.fillStyle=e,Zb.fillRect(0,0,1,1);let[t,r,i]=Zb.getImageData(0,0,1,1).data;n=[t/255,r/255,i/255]}return Xb.set(e,n),n}function Jb(e,t){let n=Qb.get(e);return n||(n=document.createElement(`span`),n.setAttribute(`aria-hidden`,`true`),n.style.cssText=`position:absolute;width:0;height:0;overflow:hidden;visibility:hidden`,e.appendChild(n),Qb.set(e,n)),n.style.color=``,n.style.color=t,qb(getComputedStyle(n).color||`#808080`)}function Yb(e,t){let n=Jb(e,sy[ly[t]]),r=Math.max(...n),i=[Math.min(1,n[0]+n[0]/(r||1)*.45),Math.min(1,n[1]+n[1]/(r||1)*.45),Math.min(1,n[2]+n[2]/(r||1)*.45)];return{body:$b(n,[1,1,1],.12),deep:$b(n,[.03,.02,.06],.62),tip:$b(i,[1,1,1],.12)}}var Xb,Zb,Qb,$b,ex=o((()=>{uy(),Xb=new Map,Zb=null,Qb=new WeakMap,$b=(e,t,n)=>[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n]})),tx,nx=o((()=>{tx=`
|
|
116
116
|
vec4 gogglesOver(vec2 p, float aa, float front) {
|
|
117
117
|
if (uGoggles < 0.5) return vec4(0.0);
|
|
118
118
|
vec2 q = p - eyeCentre();
|
|
@@ -133,7 +133,7 @@ vec4 gogglesOver(vec2 p, float aa, float front) {
|
|
|
133
133
|
vec4 acc = vec4(leather * band, band);
|
|
134
134
|
return acc;
|
|
135
135
|
}
|
|
136
|
-
`})),
|
|
136
|
+
`})),rx,ix=o((()=>{rx=`
|
|
137
137
|
vec3 deformJelly(vec3 p) {
|
|
138
138
|
vec3 q=p-vec3(60.0,60.0,0.0);
|
|
139
139
|
vec3 local=q/max(uScale,1.0);
|
|
@@ -157,10 +157,10 @@ vec3 deformJelly(vec3 p) {
|
|
|
157
157
|
q.z-=length(uPull.zw)*softness*influence*0.15;
|
|
158
158
|
return q+vec3(60.0,60.0,0.0);
|
|
159
159
|
}
|
|
160
|
-
`})),
|
|
160
|
+
`})),ax,ox=o((()=>{nx(),vy(),ix(),ax=`#version 300 es
|
|
161
161
|
precision highp float;
|
|
162
|
-
#define BLOBS ${
|
|
163
|
-
#define EXTRAS ${
|
|
162
|
+
#define BLOBS ${hy}
|
|
163
|
+
#define EXTRAS ${gy}
|
|
164
164
|
#define VIEW ${152 .toFixed(1)}
|
|
165
165
|
#define ORIGIN ${(-16).toFixed(1)}
|
|
166
166
|
#define TAU 6.2831853
|
|
@@ -191,7 +191,7 @@ uniform float uClarity;
|
|
|
191
191
|
uniform float uSoftness;
|
|
192
192
|
uniform vec4 uPull;
|
|
193
193
|
#ifdef JELLY_COAT
|
|
194
|
-
${
|
|
194
|
+
${rx}
|
|
195
195
|
#endif
|
|
196
196
|
vec2 eyeCentre() { return uEye.xy; }
|
|
197
197
|
float bodyK(vec2 p) {
|
|
@@ -261,8 +261,8 @@ vec4 extrasOver(vec2 p,vec3 ink,vec3 bodyCol,float aa){
|
|
|
261
261
|
}
|
|
262
262
|
return acc;
|
|
263
263
|
}
|
|
264
|
-
${
|
|
265
|
-
`}));function
|
|
264
|
+
${tx}
|
|
265
|
+
`}));function sx(e){let t=[];for(let n=0;n<e.extraMeta.length/4;n++){let[r,,i,a]=e.extraMeta.slice(n*4,n*4+4);if(r!==2&&!(r===3&&a>.5))continue;let[o,s,c,l]=e.extras.slice(n*4,n*4+4),u=r===2?16:32,d=(e,t)=>{let a=e/u*(r===2?Math.PI:l*2)-(r===2?0:l),d=t/16*Math.PI*2,f=r===2?[Math.sin(a)*Math.cos(d),-Math.cos(a),Math.sin(a)*Math.sin(d)]:[Math.sin(a)*Math.cos(d),-Math.cos(a)*Math.cos(d),Math.sin(d)],p=r===2?[o,s,0]:[o+Math.sin(a)*c,s-Math.cos(a)*c,0],m=r===2?c:i*.5;return[...p.map((e,t)=>e+f[t]*m),...f,n]},f=(e,n,r)=>{let i=n.map((t,n)=>t-e[n]),a=r.map((t,n)=>t-e[n]),o=[i[1]*a[2]-i[2]*a[1],i[2]*a[0]-i[0]*a[2],i[0]*a[1]-i[1]*a[0]].reduce((t,n,r)=>t+n*e[r+3],0)<0?[e,r,n]:[e,n,r];for(let e of o)t.push(...e)};for(let e=0;e<u;e++)for(let t=0;t<16;t++){let n=d(e,t),r=d(e+1,t),i=d(e+1,t+1),a=d(e,t+1);f(n,r,i),f(n,i,a)}}return new Float32Array(t)}function cx(e,t){let n=new Map,r=[[`aPosition`,3,0],[`aNormal`,3,12],[`aExtra`,1,24]];return{draw(i){let a=`${i.extras.join(`,`)}:${i.extraMeta.join(`,`)}`,o=n.get(a);if(!o){let t=e.createBuffer();if(!t)throw Error(`engenty: accessory allocation failed`);let r=sx(i);if(e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW),o={buffer:t,count:r.length/7},n.set(a,o),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,o.buffer);for(let[n,i,a]of r){let r=e.getAttribLocation(t,n);e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i,e.FLOAT,!1,28,a)}e.drawArrays(e.TRIANGLES,0,o.count)},dispose(){for(let t of n.values())e.deleteBuffer(t.buffer);n.clear()}}}var lx=o((()=>{})),ux,dx,fx=o((()=>{ox(),ux=`${ax}
|
|
266
266
|
in vec3 aPosition;
|
|
267
267
|
in vec3 aNormal;
|
|
268
268
|
in float aExtra;
|
|
@@ -277,7 +277,7 @@ void main(){
|
|
|
277
277
|
vAlpha=mix(uExtraMeta[index].y,1.0,0.65);
|
|
278
278
|
gl_Position=projectCoat(poseCoat(p));
|
|
279
279
|
}
|
|
280
|
-
`,
|
|
280
|
+
`,dx=`${ax}
|
|
281
281
|
in vec3 vNormal;
|
|
282
282
|
in float vAlpha;
|
|
283
283
|
out vec4 outColor;
|
|
@@ -290,7 +290,7 @@ void main(){
|
|
|
290
290
|
color+=uTip*pow(1.0-abs(n.z),3.0)*0.2;
|
|
291
291
|
outColor=vec4(color*vAlpha,vAlpha);
|
|
292
292
|
}
|
|
293
|
-
`})),
|
|
293
|
+
`})),px,mx=o((()=>{px={inflate:27,softness:.05,clarity:.15}}));function hx(e,t,n){let r=e.createShader(t);if(!r)throw Error(`engenty fur: could not create shader`);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){let t=e.getShaderInfoLog(r);throw e.deleteShader(r),Error(`engenty fur: shader compile failed — ${t}`)}return r}function gx(e,t,n){let r=e.getContext(`webgl2`,{alpha:!0,antialias:!0,depth:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,stencil:!1});if(!r)return null;let i=null;try{let e=hx(r,r.VERTEX_SHADER,n.vertex),a=hx(r,r.FRAGMENT_SHADER,t);if(i=r.createProgram(),!i)throw Error(`engenty fur: could not create program`);if(r.attachShader(i,e),r.attachShader(i,a),r.linkProgram(i),r.deleteShader(e),r.deleteShader(a),!r.getProgramParameter(i,r.LINK_STATUS))throw Error(`engenty fur: link failed — ${r.getProgramInfoLog(i)}`)}catch(e){return i&&r.deleteProgram(i),console.error(e),null}let a={};for(let e of _x)a[e]=r.getUniformLocation(i,e);let o=r.createVertexArray();r.bindVertexArray(o);let s=n.geometry(r,i),c=r.useProgram.bind(r);r.enable(r.BLEND),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA);let l=!1,u=1;return{dispose(){l||(l=!0,s.dispose(),r.deleteVertexArray(o),r.deleteProgram(i))},render(e){l||(c(i),r.bindVertexArray(o),r.uniform2f(a.uResolution,u,u),r.uniform1f(a.uTime,e.time),r.uniform4fv(a.uBlobs,e.blobs),r.uniform1f(a.uFalloff,e.falloff),r.uniform1f(a.uScale,e.scale),r.uniform1f(a.uFur,e.fur),r.uniform1f(a.uPeriod,e.period),r.uniform1f(a.uInflate,e.inflate),r.uniform1f(a.uDensity,e.density),r.uniform1f(a.uThick,e.thick),r.uniform1f(a.uClarity,e.clarity),r.uniform1f(a.uSoftness,e.softness??px.softness),r.uniform4fv(a.uPull,e.pull??[60,60,0,0]),r.uniform2fv(a.uLean,e.lean),r.uniform3fv(a.uLight,e.light),r.uniform3fv(a.uBody,e.body),r.uniform3fv(a.uDeep,e.deep),r.uniform3fv(a.uTip,e.tip),r.uniform3fv(a.uEye,e.eye),r.uniform1f(a.uWind,e.wind),r.uniform2fv(a.uGaze,e.gaze),r.uniform2fv(a.uTurn,e.turn??[0,0]),r.uniform1f(a.uGoggles,+!!e.goggles),r.uniform4fv(a.uExtras,e.extras),r.uniform4fv(a.uExtraMeta,e.extraMeta),r.uniform2fv(a.uWobble,e.wobble),r.enable(r.SCISSOR_TEST),r.scissor(0,0,u,u),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL),r.depthMask(!0),r.frontFace(r.CW),n.doubleSided?r.disable(r.CULL_FACE):(r.enable(r.CULL_FACE),r.cullFace(r.BACK)),n.clear!==!1&&(r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT)),r.depthMask(n.depthWrite!==!1),s.draw(e))},viewport(e){l||(u=e,r.viewport(0,0,e,e))}}}var _x,vx=o((()=>{mx(),_x=`uResolution.uTime.uBlobs.uFalloff.uScale.uFur.uPeriod.uInflate.uDensity.uThick.uLean.uLight.uBody.uDeep.uTip.uEye.uWind.uGaze.uTurn.uGoggles.uExtras.uExtraMeta.uWobble.uClarity.uSoftness.uPull`.split(`.`)}));function yx(e){return`${e.blobs.join(`,`)}:${e.falloff}:${e.inflate}`}function bx(e,t){let n=0,r=[0,0,0];for(let i=0;i<t.blobs.length;i+=4){let a=t.blobs[i+2],o=t.blobs[i+3];if(a<=0||o<=0)continue;let s=a*t.inflate/30,c=e[0]-t.blobs[i],l=e[1]-t.blobs[i+1],u=e[2],d=Math.exp(-t.falloff*(c*c/(a*a)+l*l/(o*o)+u*u/(s*s)));n+=d,r[0]+=d*c/(a*a),r[1]+=d*l/(o*o),r[2]+=d*u/(s*s)}let i=Math.hypot(...r)||1;return{value:n,normal:[r[0]/i,r[1]/i,r[2]/i]}}function xx(e){let t=yx(e),n=Sx.get(t);if(n)return n;let r=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0];for(let t=0;t<e.blobs.length;t+=4){if(e.blobs[t+2]<=0)continue;let n=[e.blobs[t],e.blobs[t+1],0],a=[e.blobs[t+2],e.blobs[t+3],e.blobs[t+2]*e.inflate/30];for(let e=0;e<3;e++)r[e]=Math.min(r[e],n[e]-a[e]*1.5),i[e]=Math.max(i[e],n[e]+a[e]*1.5)}let a=2.7,[o,s,c]=i.map((e,t)=>Math.ceil((e-r[t])/a)+1),l=[],u=[];for(let t=0;t<c;t++)for(let n=0;n<s;n++)for(let i=0;i<o;i++){let o=[r[0]+i*a,r[1]+n*a,r[2]+t*a];l.push(o),u.push(bx(o,e).value)}let d=Math.exp(-e.falloff),f=[],p=0,m=(e,t)=>{let n=(d-u[e])/(u[t]-u[e]);return[0,1,2].map(r=>l[e][r]+(l[t][r]-l[e][r])*n)},h=(t,n,r)=>{let i=n.map((e,n)=>e-t[n]),a=r.map((e,n)=>e-t[n]),o=[i[1]*a[2]-i[2]*a[1],i[2]*a[0]-i[0]*a[2],i[0]*a[1]-i[1]*a[0]],s=Math.hypot(...o)*.5;if(s<1e-9)return;let c=bx(t,e).normal,l=o.reduce((e,t,n)=>e+t*c[n],0)<0?[t,r,n]:[t,n,r];for(let t of l)f.push(...t,...bx(t,e).normal);p+=s};for(let e=0;e<c-1;e++)for(let t=0;t<s-1;t++)for(let n=0;n<o-1;n++){let r=n+o*(t+s*e),i=o*s,a=[r,r+1,r+o+1,r+o,r+i,r+i+1,r+i+o+1,r+i+o];if(!(a.every(e=>u[e]<d)||a.every(e=>u[e]>=d)))for(let e of Cx){let t=e.map(e=>a[e]).filter(e=>u[e]>=d),n=e.map(e=>a[e]).filter(e=>u[e]<d);if(t.length===1)h(...n.map(e=>m(t[0],e)));else if(t.length===3)h(...t.map(e=>m(n[0],e)));else if(t.length===2){let e=m(t[0],n[0]),r=m(t[0],n[1]),i=m(t[1],n[0]),a=m(t[1],n[1]);h(e,r,i),h(r,a,i)}}}let g={vertices:new Float32Array(f),area:p};if(Sx.set(t,g),Sx.size>24){let e=Sx.keys().next().value;e&&Sx.delete(e)}return g}var Sx,Cx,wx=o((()=>{Sx=new Map,Cx=[[0,5,1,6],[0,1,2,6],[0,2,3,6],[0,3,7,6],[0,7,4,6],[0,4,5,6]]}));function Tx(e,t,n){let r=0,i=200;for(let a=0;a<24;a++){let a=(r+i)/2,o=0;for(let r=0;r<e.blobs.length;r+=4){let[i,s,c,l]=e.blobs.slice(r,r+4);c<=0||(o+=Math.exp(-e.falloff*(((t-i)/c)**2+((n-s)/l)**2+(a/(c*e.inflate/30))**2)))}o>Math.exp(-e.falloff)?r=a:i=a}return(r+i)/2}function Ex(e){let t=[],[n,r,i]=e.eye,a=i*1.35,o=Tx(e,n,r),s=(e,n,r)=>{let i=n.map((t,n)=>t-e[n]),a=r.map((t,n)=>t-e[n]),o=[i[1]*a[2]-i[2]*a[1],i[2]*a[0]-i[0]*a[2],i[0]*a[1]-i[1]*a[0]];for(let i of o.reduce((t,n,r)=>t+n*e[r+3],0)<0?[e,r,n]:[e,n,r])t.push(...i)},c=(e,t,n)=>{for(let r=0;r<e;r++)for(let i=0;i<t;i++){let a=n(r/e,i/t),o=n((r+1)/e,i/t),c=n((r+1)/e,(i+1)/t),l=n(r/e,(i+1)/t);s(a,o,c),s(a,c,l)}},l=(e,t,i,a,s)=>c(96,16,(c,l)=>{let u=c*Math.PI*2,d=l*Math.PI*2,f=Math.cos(u)*Math.cos(d)/t,p=Math.sin(u)*Math.cos(d)/t,m=Math.sin(d)/a,h=Math.hypot(f,p,m);return[n+Math.cos(u)*(e+Math.cos(d)*t),r+Math.sin(u)*(e+Math.cos(d)*t),o+i+Math.sin(d)*a,f/h,p/h,m/h,s]});l(a*1.14,a*.2,.3,1.5,0),l(a*1.13,a*.14,2.1,1.8,1);for(let e=0;e<4;e++){let t=Math.PI/4+e*Math.PI/2,i=n+Math.cos(t)*a*1.13,s=r+Math.sin(t)*a*1.13;c(10,12,(e,t)=>{let n=e*Math.PI,r=t*Math.PI*2,a=[Math.sin(n)*Math.cos(r),Math.sin(n)*Math.sin(r),Math.cos(n)];return[i+a[0]*.65,s+a[1]*.65,o+3.9+a[2]*.4,...a,2]})}return c(18,96,(e,t)=>{let i=t*Math.PI*2,s=Math.cos(i)*e,c=Math.sin(i)*e,l=[s*.45,c*.45,1],u=Math.hypot(...l);return[n+s*a,r+c*a,o+2.4+2.3*(1-e*e),l[0]/u,l[1]/u,l[2]/u,3]}),new Float32Array(t)}function Dx(e,t){let n=new Map,r=[[`aPosition`,3,0],[`aNormal`,3,12],[`aMaterial`,1,24]];return{draw(i){if(!i.goggles)return;let a=`${yx(i)}:${i.eye.join(`,`)}`,o=n.get(a);if(!o){let t=e.createBuffer();if(!t)throw Error(`engenty: goggle allocation failed`);let r=Ex(i);if(e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW),o={buffer:t,count:r.length/7},n.set(a,o),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,o.buffer);for(let[n,i,a]of r){let r=e.getAttribLocation(t,n);e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i,e.FLOAT,!1,28,a)}e.drawArrays(e.TRIANGLES,0,o.count)},dispose(){for(let{buffer:t}of n.values())e.deleteBuffer(t);n.clear()}}}var Ox=o((()=>{wx()})),kx,Ax,jx=o((()=>{ox(),kx=`${ax}
|
|
294
294
|
in vec3 aPosition;
|
|
295
295
|
in vec3 aNormal;
|
|
296
296
|
in float aMaterial;
|
|
@@ -301,7 +301,7 @@ void main(){
|
|
|
301
301
|
vMaterial=int(aMaterial+0.5);
|
|
302
302
|
gl_Position=projectCoat(poseCoat(aPosition));
|
|
303
303
|
}
|
|
304
|
-
`,
|
|
304
|
+
`,Ax=`${ax}
|
|
305
305
|
in vec3 vNormal;
|
|
306
306
|
flat in int vMaterial;
|
|
307
307
|
out vec4 outColor;
|
|
@@ -321,7 +321,7 @@ void main(){
|
|
|
321
321
|
vec3 color=base*(0.4+diffuse*0.75)+reflected*(vMaterial==0?0.04:0.27)+vec3(1.0,0.9,0.65)*spec*(vMaterial==0?0.1:0.8);
|
|
322
322
|
outColor=vec4(color,1.0);
|
|
323
323
|
}
|
|
324
|
-
`})),
|
|
324
|
+
`})),Mx,Nx,Px,Fx=o((()=>{ox(),Mx=`${ax}
|
|
325
325
|
in vec3 aPosition;
|
|
326
326
|
in vec3 aNormal;
|
|
327
327
|
out vec3 vLocal;
|
|
@@ -331,11 +331,11 @@ void main(){
|
|
|
331
331
|
vNormal=poseNormal(aPosition,aNormal);
|
|
332
332
|
gl_Position=projectCoat(poseCoat(aPosition));
|
|
333
333
|
}
|
|
334
|
-
`,
|
|
334
|
+
`,Nx=`
|
|
335
335
|
in vec3 vLocal;
|
|
336
336
|
in vec3 vNormal;
|
|
337
337
|
out vec4 outColor;
|
|
338
|
-
`,
|
|
338
|
+
`,Px=`${ax}${Nx}
|
|
339
339
|
void main(){
|
|
340
340
|
vec2 p=vLocal.xy;
|
|
341
341
|
vec3 n=normalize(vNormal),light=normalize(uLight);
|
|
@@ -368,7 +368,7 @@ void main(){
|
|
|
368
368
|
vec4 goggles=gogglesOver(p,aa,front);
|
|
369
369
|
outColor=vec4(goggles.rgb+color*(1.0-goggles.a),1.0);
|
|
370
370
|
}
|
|
371
|
-
`})),
|
|
371
|
+
`})),Ix,Lx=o((()=>{ox(),Fx(),Ix=`${ax}${Nx}
|
|
372
372
|
/** Luminance, for turning a reflection into coverage. */
|
|
373
373
|
float lum(vec3 c) { return dot(c, vec3(0.2126, 0.7152, 0.0722)); }
|
|
374
374
|
|
|
@@ -509,7 +509,7 @@ void main(){
|
|
|
509
509
|
vec4 goggles = gogglesOver(p, aaPx, front);
|
|
510
510
|
outColor = goggles + acc * (1.0 - goggles.a);
|
|
511
511
|
}
|
|
512
|
-
`}));function
|
|
512
|
+
`}));function Rx(e,t,n,r,i){let a=-Math.sin(n[0]),o=Math.cos(n[0])*Math.sin(n[1]),s=Math.cos(n[0])*Math.cos(n[1]),c=1/0,l=-1/0;for(let t=0;t<e.length;t+=Bx){let n=e[t]*a+e[t+1]*o+e[t+2]*s;c=Math.min(c,n),l=Math.max(l,n)}i.fill(0);let u=255/Math.max(l-c,.001);for(let t=0;t<r.length;t++){let n=t*Bx,l=e[n]*a+e[n+1]*o+e[n+2]*s,d=Math.min(255,Math.max(0,Math.floor((l-c)*u)));r[t]=d,i[d]++}let d=0;for(let e=0;e<Vx;e++){let t=i[e];i[e]=d,d+=t}for(let n=0;n<r.length;n++){let a=i[r[n]]++*Bx;for(let r=0;r<Bx;r++)t[a+r]=e[n*Bx+r]}}function zx(e){return{roots:e,sorted:new Float32Array(e.length),buckets:new Uint16Array(e.length/Bx),counts:new Uint32Array(Vx),yaw:NaN,pitch:NaN}}var Bx,Vx,Hx=o((()=>{Bx=8,Vx=256}));function Ux(e){let t=xx(e),n=781,r=()=>(n=(n*1664525+1013904223)%4294967296,n/4294967296),i=[],a=Math.min(200,Math.max(10,e.density))**2/4e3,o=t.vertices;for(let e=0;e<o.length;e+=18){let t=[o[e+6]-o[e],o[e+7]-o[e+1],o[e+8]-o[e+2]],n=[o[e+12]-o[e],o[e+13]-o[e+1],o[e+14]-o[e+2]],s=Math.hypot(t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0])*.5*a,c=Math.floor(s)+ +(r()<s%1);for(let t=0;t<c;t++){let t=Math.sqrt(r()),n=r(),a=[1-t,t*(1-n),t*n],s=Array.from({length:6},(t,n)=>a.reduce((t,r,i)=>t+r*o[e+i*6+n],0)),c=Math.hypot(s[3],s[4],s[5]);i.push(s[0],s[1],s[2],s[3]/c,s[4]/c,s[5]/c,r(),r())}}return new Float32Array(i)}function Wx(e,t){let n=new Map,r=e.getAttribLocation(t,`aRoot`),i=e.getAttribLocation(t,`aNormal`),a=e.getAttribLocation(t,`aRandom`);return{draw(t){let o=`${yx(t)}:${t.density}`,s=n.get(o);if(!s){let r=e.createBuffer();if(!r)throw Error(`engenty: strand allocation failed`);let i=Ux(t);if(e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,i,e.DYNAMIC_DRAW),s={buffer:r,count:i.length/8,order:zx(i)},n.set(o,s),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,s.buffer);let c=t.turn??[0,0],l=s.order;(l.yaw!==c[0]||l.pitch!==c[1])&&(Rx(l.roots,l.sorted,c,l.buckets,l.counts),e.bufferSubData(e.ARRAY_BUFFER,0,l.sorted),l.yaw=c[0],l.pitch=c[1]);for(let[t,n,o]of[[r,3,0],[i,3,12],[a,2,24]])e.enableVertexAttribArray(t),e.vertexAttribPointer(t,n,e.FLOAT,!1,32,o),e.vertexAttribDivisor(t,1);e.drawArraysInstanced(e.TRIANGLE_STRIP,0,18,s.count)},dispose(){for(let t of n.values())e.deleteBuffer(t.buffer);n.clear()}}}var Gx=o((()=>{Hx(),wx()})),Kx,qx,Jx=o((()=>{ox(),Kx=`${ax}
|
|
513
513
|
in vec3 aRoot;
|
|
514
514
|
in vec3 aNormal;
|
|
515
515
|
in vec2 aRandom;
|
|
@@ -554,7 +554,7 @@ void main(){
|
|
|
554
554
|
vAcross=side;
|
|
555
555
|
vCoverage=min(1.0,radius/(pixel*0.7))*socket*(1.0-strap*0.85);
|
|
556
556
|
}
|
|
557
|
-
`,
|
|
557
|
+
`,qx=`#version 300 es
|
|
558
558
|
precision highp float;
|
|
559
559
|
in vec3 vColor;
|
|
560
560
|
in float vAcross;
|
|
@@ -565,18 +565,18 @@ void main(){
|
|
|
565
565
|
if(alpha<0.025)discard;
|
|
566
566
|
outColor=vec4(vColor*alpha,alpha);
|
|
567
567
|
}
|
|
568
|
-
`}));function
|
|
569
|
-
#define JELLY_COAT`),geometry:
|
|
570
|
-
#define JELLY_COAT`):
|
|
571
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BS(e,t){return LS(e)||RS(e,t)||VS(e,t)||zS()}function VS(e,t){if(e){if(typeof e==`string`)return IS(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?IS(e,t):void 0}}function HS(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof FS;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}HS.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},HS.prototype.next=function(e){return this._invoke(`next`,e)},HS.prototype.throw=function(e){return this._invoke(`throw`,e)},HS.prototype.return=function(e){return this._invoke(`return`,e)};var US=Object.entries,WS=Object.setPrototypeOf,GS=Object.isFrozen,KS=Object.getPrototypeOf,qS=Object.getOwnPropertyDescriptor,JS=Object.freeze,YS=Object.seal,XS=Object.create,ZS=typeof Reflect<`u`&&Reflect,QS=ZS.apply,$S=ZS.construct;JS||=function(e){return e},YS||=function(e){return e},QS||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},$S||=function(e){return new e(...[...arguments].slice(1))};var eC=bC(Array.prototype.forEach);Array.prototype.indexOf;var tC=bC(Array.prototype.lastIndexOf),nC=bC(Array.prototype.pop),rC=bC(Array.prototype.push);Array.prototype.slice;var iC=bC(Array.prototype.splice),aC=Array.isArray,oC=bC(String.prototype.toLowerCase),sC=bC(String.prototype.toString),cC=bC(String.prototype.match),lC=bC(String.prototype.replace),uC=bC(String.prototype.indexOf),dC=bC(String.prototype.trim),fC=bC(Number.prototype.toString),pC=bC(Boolean.prototype.toString),mC=typeof BigInt>`u`?null:bC(BigInt.prototype.toString),hC=typeof Symbol>`u`?null:bC(Symbol.prototype.toString),gC=bC(Object.prototype.hasOwnProperty),_C=bC(Object.prototype.toString),vC=bC(RegExp.prototype.test),yC=xC(TypeError);function bC(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return QS(e,t,n)}}function xC(e){return function(){return $S(e,[...arguments])}}function SC(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:oC;if(WS&&WS(e,null),!aC(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(GS(t)||(t[r]=e),i=e)}e[i]=!0}return e}function CC(e){for(let t=0;t<e.length;t++)gC(e,t)||(e[t]=null);return e}function wC(e){let t=XS(null);for(let r of US(e)){var n=BS(r,2);let i=n[0],a=n[1];gC(e,i)&&(t[i]=aC(a)?CC(a):a&&typeof a==`object`&&a.constructor===Object?wC(a):a)}return t}function TC(e){switch(typeof e){case`string`:return e;case`number`:return fC(e);case`boolean`:return pC(e);case`bigint`:return mC?mC(e):`0`;case`symbol`:return hC?hC(e):`Symbol()`;case`undefined`:return _C(e);case`function`:case`object`:{if(e===null)return _C(e);let t=e,n=EC(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:_C(e)}return _C(e)}default:return _C(e)}}function EC(e,t){for(;e!==null;){let n=qS(e,t);if(n){if(n.get)return bC(n.get);if(typeof n.value==`function`)return bC(n.value)}e=KS(e)}function n(){return null}return n}function DC(e){try{return vC(e,``),!0}catch{return!1}}var OC=JS(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),kC=JS(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),AC=JS([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),jC=JS([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),MC=JS(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),NC=JS([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),PC=JS([`#text`]),FC=JS(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),IC=JS(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),LC=JS(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),RC=JS([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),zC=YS(/{{[\w\W]*|^[\w\W]*}}/g),BC=YS(/<%[\w\W]*|^[\w\W]*%>/g),VC=YS(/\${[\w\W]*/g),HC=YS(/^data-[\-\w.\u00B7-\uFFFF]+$/),UC=YS(/^aria-[\-\w]+$/),WC=YS(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),GC=YS(/^(?:\w+script|data):/i),KC=YS(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qC=YS(/^html$/i),JC=YS(/^[a-z][.\w]*(-[.\w]+)+$/i),YC=YS(/<[/\w!]/g),XC=YS(/<[/\w]/g),ZC=YS(/<\/no(script|embed|frames)/i),QC=YS(/\/>/i),$C={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ew=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],tw=JS(SC({},ew)),nw=function(){let e={};return eC(ew,t=>{e[t]=YS(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),JS(e)}(),rw=function(){return typeof window>`u`?null:window},iw=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},aw=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ow=function(e,t,n,r){return gC(e,t)&&aC(e[t])?SC(r.base?wC(r.base):{},e[t],r.transform):n},sw=function(e,t,n){let r=gC(e,t)?e[t]:void 0;return r&&typeof r==`object`?wC(r):n()};function cw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rw(),t=e=>cw(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==$C.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=EC(d,`cloneNode`),p=EC(d,`remove`),m=EC(d,`removeAttributeNode`),h=EC(d,`nextSibling`),g=EC(d,`childNodes`),_=EC(d,`parentNode`),v=EC(d,`shadowRoot`),y=EC(d,`attributes`),b=o&&o.prototype?EC(o.prototype,`nodeType`):null,x=o&&o.prototype?EC(o.prototype,`nodeName`):null,S=o&&o.prototype?EC(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,D,ee=!1,O=0,k=function(){if(O>0)throw yC(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},A=function(e){k(),O++;try{return T.createHTML(e)}finally{O--}},te=function(e){k(),O++;try{return T.createScriptURL(e)}finally{O--}},ne=function(){return ee||=(D=iw(u,i),!0),D},re=n,ie=re.implementation,ae=re.createNodeIterator,oe=re.createDocumentFragment,se=re.getElementsByTagName,ce=r.importNode,j=aw();t.isSupported=typeof US==`function`&&typeof _==`function`&&ie&&ie.createHTMLDocument!==void 0;let le=zC,ue=BC,de=VC,fe=HC,pe=UC,me=GC,he=KC,ge=JC,_e=WC,ve=null,M=SC({},[...OC,...kC,...AC,...MC,...PC]),N=null,ye=SC({},[...FC,...IC,...LC,...RC]),be=Object.seal(XS(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),P=null,xe=null,Se=Object.seal(XS(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ce=!0,we=!0,Te=!1,Ee=!0,De=!1,Oe=!0,ke=!1,Ae=!1,je=null,Me=null,Ne=!1,Pe=!1,Fe=!1,Ie=!1,Le=!0,Re=!1,ze=`user-content-`,Be=!0,Ve=!1,He={},Ue=null,We=SC({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ge=null,Ke=SC({},[`audio`,`video`,`img`,`source`,`image`,`track`]),qe=null,Je=SC({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ye=`http://www.w3.org/1998/Math/MathML`,Xe=`http://www.w3.org/2000/svg`,Ze=`http://www.w3.org/1999/xhtml`,Qe=Ze,$e=!1,F=null,et=SC({},[Ye,Xe,Ze],sC),tt=JS([`mi`,`mo`,`mn`,`ms`,`mtext`]),nt=SC({},tt),rt=JS([`annotation-xml`]),it=SC({},rt),at=SC({},[`title`,`style`,`font`,`a`,`script`]),ot=null,st=[`application/xhtml+xml`,`text/html`],I=null,ct=null,lt=n.createElement(`form`),ut=function(e){return e instanceof RegExp||e instanceof Function},dt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ct&&ct===e)return;(!e||typeof e!=`object`)&&(e={}),e=wC(e),ot=st.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,I=ot===`application/xhtml+xml`?sC:oC,ve=ow(e,`ALLOWED_TAGS`,M,{transform:I}),N=ow(e,`ALLOWED_ATTR`,ye,{transform:I}),F=ow(e,`ALLOWED_NAMESPACES`,et,{transform:sC}),qe=ow(e,`ADD_URI_SAFE_ATTR`,Je,{transform:I,base:Je}),Ge=ow(e,`ADD_DATA_URI_TAGS`,Ke,{transform:I,base:Ke}),Ue=ow(e,`FORBID_CONTENTS`,We,{transform:I}),P=ow(e,`FORBID_TAGS`,wC({}),{transform:I}),xe=ow(e,`FORBID_ATTR`,wC({}),{transform:I}),He=gC(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?wC(e.USE_PROFILES):e.USE_PROFILES:!1,Ce=e.ALLOW_ARIA_ATTR!==!1,we=e.ALLOW_DATA_ATTR!==!1,Te=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=e.SAFE_FOR_TEMPLATES||!1,Oe=e.SAFE_FOR_XML!==!1,ke=e.WHOLE_DOCUMENT||!1,Pe=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,Ie=e.RETURN_TRUSTED_TYPE||!1,Ne=e.FORCE_BODY||!1,Le=e.SANITIZE_DOM!==!1,Re=e.SANITIZE_NAMED_PROPS||!1,Be=e.KEEP_CONTENT!==!1,Ve=e.IN_PLACE||!1,_e=DC(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:WC,Qe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ze,nt=sw(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>SC({},tt)),it=sw(e,`HTML_INTEGRATION_POINTS`,()=>SC({},rt));let t=sw(e,`CUSTOM_ELEMENT_HANDLING`,()=>XS(null));if(be=XS(null),gC(t,`tagNameCheck`)&&ut(t.tagNameCheck)&&(be.tagNameCheck=t.tagNameCheck),gC(t,`attributeNameCheck`)&&ut(t.attributeNameCheck)&&(be.attributeNameCheck=t.attributeNameCheck),gC(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(be.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),YS(be),De&&(we=!1),Fe&&(Pe=!0),He&&(ve=SC({},PC),N=XS(null),He.html===!0&&(SC(ve,OC),SC(N,FC)),He.svg===!0&&(SC(ve,kC),SC(N,IC),SC(N,RC)),He.svgFilters===!0&&(SC(ve,AC),SC(N,IC),SC(N,RC)),He.mathMl===!0&&(SC(ve,MC),SC(N,LC),SC(N,RC))),Se.tagCheck=null,Se.attributeCheck=null,gC(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Se.tagCheck=e.ADD_TAGS:aC(e.ADD_TAGS)&&(ve===M&&(ve=wC(ve)),SC(ve,e.ADD_TAGS,I))),gC(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Se.attributeCheck=e.ADD_ATTR:aC(e.ADD_ATTR)&&(N===ye&&(N=wC(N)),SC(N,e.ADD_ATTR,I))),gC(e,`ADD_FORBID_CONTENTS`)&&aC(e.ADD_FORBID_CONTENTS)&&(Ue===We&&(Ue=wC(Ue)),SC(Ue,e.ADD_FORBID_CONTENTS,I)),Be&&(ve[`#text`]=!0),ke&&SC(ve,[`html`,`head`,`body`]),ve.table&&(SC(ve,[`tbody`]),delete P.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw yC(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw yC(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=A(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=ne()),T&&typeof E==`string`&&(E=A(``)));JS&&JS(e),ct=e},ft=SC({},[...kC,...AC,...jC]),pt=SC({},[...MC,...NC]),mt=function(e,t,n){return t.namespaceURI===Ze?e===`svg`:t.namespaceURI===Ye?e===`svg`&&(n===`annotation-xml`||nt[n]):!!ft[e]},ht=function(e,t,n){return t.namespaceURI===Ze?e===`math`:t.namespaceURI===Xe?e===`math`&&it[n]:!!pt[e]},gt=function(e,t,n){return t.namespaceURI===Xe&&!it[n]||t.namespaceURI===Ye&&!nt[n]?!1:!pt[e]&&(at[e]||!ft[e])},_t=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Qe,tagName:`template`});let n=oC(e.tagName),r=oC(t.tagName);return F[e.namespaceURI]?e.namespaceURI===Xe?mt(n,t,r):e.namespaceURI===Ye?ht(n,t,r):e.namespaceURI===Ze?gt(n,t,r):!!(ot===`application/xhtml+xml`&&F[e.namespaceURI]):!1},vt=function(e){rC(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw yC(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},yt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},bt=function(e){Ct(e);let t=g(e);if(t){let e=[];eC(t,t=>{rC(e,t)}),eC(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&yt(e,r,i)}},xt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}rC(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Pe||Fe)try{vt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},St=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||N[I(i)]||yt(e,r,i)}},Ct=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===$C.element&&St(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},wt=function(e,t){return Oe?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Tt=function(e){if(!Oe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===$C.processingInstruction||n===$C.comment&&vC(XC,e.data)){try{p(e)}catch{}continue}if(n===$C.element){let t=e,n=I(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&wt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Et=function(e){let t=null,r=null;if(Ne)e=`<remove></remove>`+e;else{let t=cC(e,/^[\r\n\t ]+/);r=t&&t[0]}ot===`application/xhtml+xml`&&Qe===Ze&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?A(e):e;if(Qe===Ze)try{t=new l().parseFromString(i,ot)}catch{}if(!t||!t.documentElement){t=ie.createDocument(Qe,`template`,null);try{t.documentElement.innerHTML=$e?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Qe===Ze?se.call(t,ke?`html`:`body`)[0]:ke?t.documentElement:a},Dt=function(e){let t=S?S(e):e.ownerDocument;return ae.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ot=function(e){return e=lC(e,le,` `),e=lC(e,ue,` `),e=lC(e,de,` `),e},kt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ae.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Ot(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&eC(i,e=>{jt(e.content)&&kt(e.content)})},At=function(e){let t=x?x(e):null;return typeof t!=`string`||I(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},jt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===$C.documentFragment}catch{return!1}},Mt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Nt(e,n,r){e.length!==0&&eC(e,e=>{e.call(t,n,r,ct)})}let Pt=function(e,t){return!!(Oe&&e.hasChildNodes()&&!Mt(e.firstElementChild)&&vC(YC,e.textContent)&&vC(YC,e.innerHTML)||Oe&&e.namespaceURI===Ze&&tw[t]&&(Mt(e.firstElementChild)||typeof e.textContent==`string`&&vC(nw[t],e.textContent))||e.nodeType===$C.processingInstruction||Oe&&e.nodeType===$C.comment&&vC(XC,e.data))},Ft=function(e,t){return e instanceof RegExp?vC(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},It=function(e,t,n){if(!P[t]&&Ht(t)&&Ft(be.tagNameCheck,t))return!1;if(Be&&!Ue[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return vt(e),!0},Lt=function(e,t,n,r){return e.length===0?t:t===n||t===r?wC(t):t},Rt=function(e,t){return e===t||_(e)!==null?!1:(Ve&&Ct(e),!0)},zt=function(e,n){if(Nt(j.beforeSanitizeElements,e,null),Rt(e,n))return!0;if(At(e))return vt(e),!0;let r=I(w(e));if(ve=Lt(j.uponSanitizeElement,ve,M,je),Nt(j.uponSanitizeElement,e,{tagName:r,allowedTags:ve}),Rt(e,n))return!0;if(Pt(e,r))return vt(e),!0;if(P[r]||!(Se.tagCheck instanceof Function&&Se.tagCheck(r))&&!ve[r]){let t=It(e,r,n);return t===!1&&(Nt(j.afterSanitizeElements,e,null),Rt(e,n))?!0:t}if(C(e)===$C.element&&!_t(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&vC(ZC,e.innerHTML))return vt(e),!0;if(De&&e.nodeType===$C.text){let n=Ot(e.textContent);e.textContent!==n&&(rC(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Nt(j.afterSanitizeElements,e,null),Rt(e,n)},Bt=function(e,t,r){if(xe[t]||wt(t,e)||Le&&(t===`id`||t===`name`)&&(r in n||r in lt))return!1;let i=N[t]||Se.attributeCheck instanceof Function&&Se.attributeCheck(t,e);return we&&vC(fe,t)||Ce&&vC(pe,t)?!0:i?qe[t]||vC(_e,lC(r,he,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&uC(r,`data:`)===0&&Ge[e]||Te&&!vC(me,lC(r,he,``))?!0:!r:Ht(e)&&Ft(be.tagNameCheck,e)&&Ft(be.attributeNameCheck,t,e)||t===`is`&&be.allowCustomizedBuiltInElements&&Ft(be.tagNameCheck,r)},Vt=SC({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Ht=function(e){return!Vt[oC(e)]&&vC(ge,e)},Ut=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return A(r);case`TrustedScriptURL`:return te(r)}return r},Wt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!At(e)||(vt(e),!1)}catch{return xt(t,e),!1}},Gt=function(e,n){if(Nt(j.beforeSanitizeAttributes,e,null),Rt(e,n))return;let r=e.attributes;if(!r||At(e))return;N=Lt(j.uponSanitizeAttribute,N,ye,Me);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:N,forceKeepAttr:void 0},a=r.length,o=I(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=I(s),d=l,f=s===`value`?d:dC(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Nt(j.uponSanitizeAttribute,e,i),f=i.attrValue,Re&&(u===`id`||u===`name`)&&uC(f,ze)!==0&&(xt(s,e,n),f=ze+f,p=!0),Oe&&vC(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){xt(s,e,n);continue}if(u===`attributename`&&cC(f,`href`)){xt(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){xt(s,e,n);continue}if(!Ee&&vC(QC,f)){xt(s,e,n);continue}if(De&&(f=Ot(f)),!Bt(o,u,f)){xt(s,e,n);continue}f=Ut(o,u,c,f),f!==d&&Wt(e,s,c,f)&&p&&nC(t.removed)}}Nt(j.afterSanitizeAttributes,e,null),Rt(e,n)},Kt=function(e){let t=null,n=Dt(e);for(Nt(j.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Nt(j.uponSanitizeShadowNode,t,null),zt(t,e),Gt(t,e),jt(t.content)&&Kt(t.content),C(t)===$C.element){let e=v(t);jt(e)&&(qt(e),Kt(e))}Nt(j.afterSanitizeShadowDOM,e,null)},qt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Kt(e.shadow);continue}let n=e.node,r=C(n)===$C.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&I(e)===`template`){let e=n.content;jt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);jt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if($e=!e,$e&&(e=`\x3C!-->`),typeof e!=`string`&&!Mt(e)&&(e=TC(e),typeof e!=`string`))throw yC(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ae?(ve=je,N=Me):dt(n),(j.uponSanitizeElement.length>0||j.uponSanitizeAttribute.length>0)&&(ve=wC(ve)),j.uponSanitizeAttribute.length>0&&(N=wC(N)),t.removed=[];let c=Ve&&typeof e!=`string`&&Mt(e);if(c){Tt(e);let t=w(e);if(typeof t==`string`){let n=I(t);if(!ve[n]||P[n])throw bt(e),yC(`root node is forbidden and cannot be sanitized in-place`)}if(At(e))throw bt(e),yC(`root node is clobbered and cannot be sanitized in-place`);try{qt(e)}catch(t){throw bt(e),t}}else if(Mt(e))i=Et(`\x3C!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===$C.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),qt(i);else{if(!Pe&&!De&&!ke&&e.indexOf(`<`)===-1)return T&&Ie?A(e):e;if(i=Et(e),!i)return Pe?null:Ie?E:``}i&&Ne&&vt(i.firstChild);let l=c?e:i;try{let e=Dt(l);for(;o=e.nextNode();)zt(o,l),Gt(o,l),jt(o.content)&&Kt(o.content)}catch(n){throw c&&(bt(e),eC(t.removed,e=>{e.element&&Ct(e.element)})),n}if(c){let n=!1;if(eC(t.removed,t=>{t.element&&(t.element===e&&(n=!0),Ct(t.element))}),n)throw yC(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return De&&kt(e),e}if(Pe){if(De&&kt(i),Fe)for(s=oe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(N.shadowroot||N.shadowrootmode)&&(s=ce.call(r,s,!0)),s}let u=ke?i.outerHTML:i.innerHTML;return ke&&ve[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&vC(qC,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
572
|
-
`+u),De&&(u=Ot(u)),T&&Ie?A(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(e),Ae=!0,je=ve,Me=N},t.clearConfig=function(){ct=null,Ae=!1,je=null,Me=null,T=D,E=``},t.isValidAttribute=function(e,t,n){ct||dt({});let r=I(e),i=I(t);return Bt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&
|
|
573
|
-
]`).replace(`lheading`,
|
|
574
|
-
`),n=t.length-1;for(;n>=0&&
|
|
575
|
-
`)}function
|
|
568
|
+
`}));function Yx(e,t){let n=new Map,r=e.getAttribLocation(t,`aPosition`),i=e.getAttribLocation(t,`aNormal`);return{draw(t){let a=yx(t),o=n.get(a);if(!o){let r=e.createBuffer();if(!r)throw Error(`engenty: body allocation failed`);let i=xx(t);if(e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,i.vertices,e.STATIC_DRAW),o={buffer:r,count:i.vertices.length/6},n.set(a,o),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,o.buffer);for(let[t,n]of[[r,0],[i,12]])e.enableVertexAttribArray(t),e.vertexAttribPointer(t,3,e.FLOAT,!1,24,n);e.drawArrays(e.TRIANGLES,0,o.count)},dispose(){for(let t of n.values())e.deleteBuffer(t.buffer);n.clear()}}}var Xx=o((()=>{wx()}));function Zx(e,t){let n=gx(e,t===`fur`?Px:Ix,{vertex:t===`fur`?Mx:Mx.replace(`#version 300 es`,`#version 300 es
|
|
569
|
+
#define JELLY_COAT`),geometry:Yx});if(!n)return null;let r=[n];if(t===`fur`){let t=gx(e,qx,{vertex:Kx,geometry:Wx,clear:!1,doubleSided:!0,depthWrite:!1});if(!t)return n.dispose(),null;r.push(t)}let i=gx(e,dx,{vertex:ux,geometry:cx,clear:!1});if(!i){for(let e of r)e.dispose();return null}r.push(i);let a=gx(e,Ax,{vertex:t===`jelly`?kx.replace(`#version 300 es`,`#version 300 es
|
|
570
|
+
#define JELLY_COAT`):kx,geometry:Dx,clear:!1});if(!a){for(let e of r)e.dispose();return null}return r.push(a),{render(e){for(let t of r)t.render(e)},viewport(e){for(let t of r)t.viewport(e)},dispose(){for(let e of r)e.dispose()}}}var Qx=o((()=>{lx(),fx(),vx(),Ox(),jx(),Lx(),Gx(),Jx(),Xx(),Fx()}));function $x(e){if(nS.has(e)||typeof document>`u`)return null;let t=document.createElement(`canvas`);t.width=1,t.height=1;let n=Zx(t,e);return n?(t.addEventListener(`webglcontextlost`,t=>{t.preventDefault(),tS.delete(e)}),{canvas:t,refs:0,renderer:n,size:0}):(nS.add(e),null)}function eS(e=`fur`){let t=tS.get(e);if(!t){let n=$x(e);if(!n)return null;tS.set(e,n),t=n}let n=t;n.refs+=1;let r=!1;return{drawInto(t,i,a){if(r||tS.get(e)!==n)return;let o=i;o>n.size&&(n.size=o,n.canvas.width=o,n.canvas.height=o),n.renderer.viewport(o),n.renderer.render(a),t.clearRect(0,0,t.canvas.width,t.canvas.height),t.drawImage(n.canvas,0,n.canvas.height-o,o,o,0,0,t.canvas.width,t.canvas.height)},release(){r||(r=!0,--n.refs,n.refs<=0&&tS.get(e)===n&&(n.renderer.dispose(),tS.delete(e)))}}}var tS,nS,rS=o((()=>{Qx(),tS=new Map,nS=new Set}));function iS(e,t){let n=aS/Math.max(1,Math.hypot(e,t));return[e*n,t===0?0:-t*n]}var aS,oS=o((()=>{aS=Math.PI/18}));function sS(e,t,n){if(n<=0)return;let r=3.8,i=Math.sqrt(110-r*r),a=Math.exp(-3.8*n),o=Math.cos(i*n),s=Math.sin(i*n);for(let[n,c,l]of[[`x`,`vx`,t[0]],[`y`,`vy`,t[1]]]){let t=e[n]-l,u=e[c];e[n]=l+a*(t*o+(u+r*t)/i*s),e[c]=a*(u*o-(r*u+110*t)/i*s)}}var cS=o((()=>{}));function lS(e,t){let n={x:0,y:0,vx:0,vy:0},r=[60,60],i=null,a=[0,0],o=!1,s=n=>{if(!t()||n.button!==0||i!==null)return;let s=e.getBoundingClientRect(),c=(n.clientX-s.left)/s.width*152+-16,l=(n.clientY-s.top)/s.height*152+-16;Math.hypot(c-60,l-60)>48||(r[0]=c,r[1]=l,a=[n.clientX,n.clientY],i=n.pointerId,o=!1,e.setPointerCapture(i))},c=r=>{if(r.pointerId!==i)return;if(!t()){l(r);return}let s=e.getBoundingClientRect(),c=(r.clientX-a[0])/s.width*152,u=(r.clientY-a[1])/s.height*152,d=Math.min(1,18/(Math.hypot(c,u)||1));n.x=c*d,n.y=u*d,n.vx=0,n.vy=0,o||=Math.hypot(r.clientX-a[0],r.clientY-a[1])>4},l=t=>{t.pointerId===i&&(i=null,e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId))},u=e=>{o&&=(e.preventDefault(),e.stopPropagation(),!1)};return e.addEventListener(`pointerdown`,s),e.addEventListener(`pointermove`,c),e.addEventListener(`pointerup`,l),e.addEventListener(`pointercancel`,l),e.addEventListener(`lostpointercapture`,l),e.addEventListener(`click`,u,!0),{step(e){return i===null&&sS(n,[0,0],e),[r[0],r[1],n.x,n.y]},dispose(){i!==null&&e.hasPointerCapture(i)&&e.releasePointerCapture(i),e.removeEventListener(`pointerdown`,s),e.removeEventListener(`pointermove`,c),e.removeEventListener(`pointerup`,l),e.removeEventListener(`pointercancel`,l),e.removeEventListener(`lostpointercapture`,l),e.removeEventListener(`click`,u,!0)}}}var uS=o((()=>{ox(),cS()}));function dS(e){mS.x=e.clientX,mS.y=e.clientY;for(let e of hS)e()}function fS(){return mS}function pS(e){return!gS&&typeof window<`u`&&(gS=!0,mS.x=window.innerWidth*.62,mS.y=window.innerHeight*.28,window.addEventListener(`pointermove`,dS,{passive:!0})),hS.add(e),()=>{hS.delete(e)}}var mS,hS,gS,_S=o((()=>{mS={x:0,y:0},hS=new Set,gS=!1})),vS=c({FluffyEngenty:()=>yS});function yS({className:e,motion:t=`auto`,animationSpeed:n=1,turn:r,coat:i=`fur`,goggles:a=!1,interactive:o=!0,look:s=null,kind:c=`round`,overrides:l,quality:u=`high`,size:d=260}){let f=(0,bS.useRef)(null),p=(0,bS.useRef)(null),m=(0,bS.useRef)(0);m.current===0&&(wS+=1,m.current=wS*TS);let h=(0,bS.useRef)(null),[g,_]=(0,bS.useState)(!0),v=my[c],y=(0,bS.useMemo)(()=>fy(v),[v]),b=(0,bS.useMemo)(()=>py(v),[v]),x=(0,bS.useMemo)(()=>dy(v),[v]),S=(0,bS.useRef)({animationSpeed:n,motion:t,turn:r,goggles:a,blobs:y,extras:b,form:v,interactive:o,kind:c,look:s,overrides:l,quality:u,scale:x,size:d});return S.current={animationSpeed:n,motion:t,turn:r,goggles:a,blobs:y,extras:b,form:v,interactive:o,kind:c,look:s,overrides:l,quality:u,scale:x,size:d},(0,bS.useEffect)(()=>{f.current?.()},[c,l,u,d,o,s,a,t,n,r]),(0,bS.useEffect)(()=>{let e=p.current,t=h.current;if(!(e&&t))return;let n=e.getContext(`2d`),r=n?eS(i):null;if(!(n&&r)){_(!1);return}let a=m.current,o=window.matchMedia(`(prefers-reduced-motion: reduce)`),s={x:0,y:0},c={x:0,y:0},l={vx:0,vy:0,x:0,y:0},u=0,d=!0,g=0,v=0,y=i===`jelly`?lS(t,()=>S.current.interactive&&S.current.motion!==`pause`&&(S.current.motion===`play`||!o.matches)):null,b=f=>{u=0;let p=S.current,m=SS[p.quality],h=p.motion===`pause`||p.motion===`auto`&&o.matches,_=h?0:Math.min((f-(v||f))/1e3,.1);g+=_*Math.max(.1,Math.min(2,p.animationSpeed)),v=f;let x=Math.min(window.devicePixelRatio||1,m.dprCap),C=Math.max(1,Math.round(p.size*x));e.width!==C&&(e.width=C,e.height=C);let w=120*C/(CS*152),T=p.overrides?.fur??p.form.fur;if((p.interactive||p.look)&&!h){let e,n,r,i;if(p.look)e=p.look.x,n=p.look.y,r=Math.hypot(e,n)||1,i=Math.min(1,r);else{let a=t.getBoundingClientRect(),o=fS();e=o.x-(a.left+a.width*.5),n=o.y-(a.top+a.height*.48),r=Math.hypot(e,n)||1,i=.35+Math.min(1,r/(a.width*2.4||1))*.65}s.x+=(e/r*5.5*i-s.x)*.16,s.y+=(n/r*3.5*i-s.y)*.16,c.x+=(e/r*i-c.x)*.24,c.y+=(n/r*.9*i-c.y)*.24}sS(l,[s.x,s.y],_*Math.max(.1,Math.min(2,p.animationSpeed)));let E=Yb(t,p.kind);r.drawInto(n,C,{blobs:p.blobs,clarity:p.overrides?.clarity??px.clarity,softness:p.overrides?.softness??px.softness,pull:y?.step(_*Math.max(.1,Math.min(2,p.animationSpeed))),body:E.body,deep:E.deep,density:Math.min(p.overrides?.density??m.density,w),extraMeta:p.extras.meta,extras:p.extras.geometry,eye:[p.form.eye.x,p.form.eye.y,p.form.eye.r],gaze:[c.x,c.y],goggles:p.goggles,turn:p.turn?iS(p.turn.yaw/aS,p.turn.pitch/aS):iS(c.x,c.y),fur:T,inflate:p.overrides?.inflate??(i===`jelly`?px.inflate:DS),lean:[s.x,s.y],light:ES,period:p.form.period,scale:p.scale,falloff:p.form.falloff,thick:p.overrides?.thick??m.thick,time:g+a,tip:E.tip,wind:p.overrides?.wind??OS,wobble:[l.x-s.x,l.y-s.y]}),d&&!h&&(u=requestAnimationFrame(b))},x=()=>{u||=(v=0,requestAnimationFrame(b))},C=new IntersectionObserver(([e])=>{d=e?.isIntersecting??!0,d?x():u&&=(cancelAnimationFrame(u),0)},{rootMargin:`120px`});C.observe(t),f.current=x;let w=pS(x);return o.addEventListener(`change`,x),x(),()=>{f.current=null,C.disconnect(),y?.dispose(),w(),o.removeEventListener(`change`,x),u&&cancelAnimationFrame(u),r.release()}},[i]),g?(0,xS.jsxs)(`div`,{"aria-hidden":`true`,className:e,ref:h,style:{height:d,position:`relative`,width:d},children:[(0,xS.jsx)(`div`,{style:{background:`radial-gradient(closest-side, rgb(0 0 0 / 0.2), transparent)`,filter:`blur(4px)`,height:`${v.shadowRx*50/152}%`,left:`50%`,position:`absolute`,top:`${kS(110)}%`,transform:`translate(-50%, -50%)`,width:`${v.shadowRx*2.5*100/152}%`}}),(0,xS.jsx)(`canvas`,{ref:p,style:{display:`block`,height:d,width:d,touchAction:i===`jelly`&&o&&t!==`pause`?`none`:void 0,cursor:i===`jelly`&&o?`grab`:void 0}})]}):(0,xS.jsx)(ib,{className:e,goggles:a,kind:c,size:d})}var bS,xS,SS,CS,wS,TS,ES,DS,OS,kS,AS=o((()=>{bS=u(f(),1),cb(),vy(),ex(),ox(),rS(),oS(),mx(),uS(),cS(),_S(),xS=by(),SS={high:{density:68,dprCap:2,thick:1},low:{density:40,dprCap:1,thick:1.15},medium:{density:55,dprCap:1.5,thick:1.05}},CS=1.7,wS=0,TS=2.399963,ES=[-.42,-.72,.75],DS=30,OS=.5,kS=e=>(e- -16)/152*100}));cb(),Kh();var jS=(0,y.lazy)(()=>Gh(()=>Promise.resolve().then(()=>(AS(),vS)).then(e=>({default:e.FluffyEngenty})),void 0,import.meta.url));function MS({kind:e,size:t=64,fluffy:n,coat:r,goggles:i=!1,interactive:a=!0}){let o=e||`round`,s=Ob(),c=r??(s===`dark`?`jelly`:`fur`);if(n&&t>=120&&(c===`fur`||s===`dark`))return(0,Z.jsx)(y.Suspense,{fallback:(0,Z.jsx)(ib,{goggles:i,kind:o,size:Math.round(t*.62)}),children:(0,Z.jsx)(jS,{goggles:i,coat:c,kind:o,size:t,quality:`medium`,interactive:a})});if(n&&t>=120){let e=Math.round(t*1.08);return(0,Z.jsxs)(`div`,{"aria-hidden":`true`,className:`relative flex items-center justify-center overflow-hidden`,style:{background:kb(o),borderRadius:t*.28,height:t,width:t},children:[(0,Z.jsx)(`span`,{className:`pointer-events-none absolute rounded-full bg-white`,style:{filter:`blur(${t*.18}px)`,height:t*.8,opacity:.16,right:-t*.3,top:-t*.3,width:t*.8}}),(0,Z.jsx)(`div`,{className:`relative`,style:{marginTop:t*.04},children:(0,Z.jsx)(y.Suspense,{fallback:(0,Z.jsx)(ib,{goggles:i,kind:o,size:Math.round(e*.62)}),children:(0,Z.jsx)(jS,{goggles:i,coat:`jelly`,kind:o,size:e,quality:`medium`,interactive:a})})})]})}return(0,Z.jsx)(ib,{goggles:i,kind:o,size:t,animated:a})}var NS=``.replace(/\/+$/,``);`${NS}`;var PS=null;function FS(e){PS=e?{base:e.base.replace(/\/+$/,``),ticket:e.ticket}:null}function IS(e){return PS&&e.startsWith(`/api/`)?`${PS.base}${e}${e.includes(`?`)?`&`:`?`}rt=${encodeURIComponent(PS.ticket)}`:!NS||!e.startsWith(`/`)||e.startsWith(`//`)||e===NS||e.startsWith(`${NS}/`)?e:`${NS}${e}`}function LS(e){return`./${e.replace(/^\/+/,``)}`}function RS(e,t){this.v=e,this.k=t}function zS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function BS(e){if(Array.isArray(e))return e}function VS(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function HS(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
571
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function US(e,t){return BS(e)||VS(e,t)||WS(e,t)||HS()}function WS(e,t){if(e){if(typeof e==`string`)return zS(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zS(e,t):void 0}}function GS(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof RS;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}GS.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},GS.prototype.next=function(e){return this._invoke(`next`,e)},GS.prototype.throw=function(e){return this._invoke(`throw`,e)},GS.prototype.return=function(e){return this._invoke(`return`,e)};var KS=Object.entries,qS=Object.setPrototypeOf,JS=Object.isFrozen,YS=Object.getPrototypeOf,XS=Object.getOwnPropertyDescriptor,ZS=Object.freeze,QS=Object.seal,$S=Object.create,eC=typeof Reflect<`u`&&Reflect,tC=eC.apply,nC=eC.construct;ZS||=function(e){return e},QS||=function(e){return e},tC||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},nC||=function(e){return new e(...[...arguments].slice(1))};var rC=CC(Array.prototype.forEach);Array.prototype.indexOf;var iC=CC(Array.prototype.lastIndexOf),aC=CC(Array.prototype.pop),oC=CC(Array.prototype.push);Array.prototype.slice;var sC=CC(Array.prototype.splice),cC=Array.isArray,lC=CC(String.prototype.toLowerCase),uC=CC(String.prototype.toString),dC=CC(String.prototype.match),fC=CC(String.prototype.replace),pC=CC(String.prototype.indexOf),mC=CC(String.prototype.trim),hC=CC(Number.prototype.toString),gC=CC(Boolean.prototype.toString),_C=typeof BigInt>`u`?null:CC(BigInt.prototype.toString),vC=typeof Symbol>`u`?null:CC(Symbol.prototype.toString),yC=CC(Object.prototype.hasOwnProperty),bC=CC(Object.prototype.toString),xC=CC(RegExp.prototype.test),SC=wC(TypeError);function CC(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return tC(e,t,n)}}function wC(e){return function(){return nC(e,[...arguments])}}function TC(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lC;if(qS&&qS(e,null),!cC(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(JS(t)||(t[r]=e),i=e)}e[i]=!0}return e}function EC(e){for(let t=0;t<e.length;t++)yC(e,t)||(e[t]=null);return e}function DC(e){let t=$S(null);for(let r of KS(e)){var n=US(r,2);let i=n[0],a=n[1];yC(e,i)&&(t[i]=cC(a)?EC(a):a&&typeof a==`object`&&a.constructor===Object?DC(a):a)}return t}function OC(e){switch(typeof e){case`string`:return e;case`number`:return hC(e);case`boolean`:return gC(e);case`bigint`:return _C?_C(e):`0`;case`symbol`:return vC?vC(e):`Symbol()`;case`undefined`:return bC(e);case`function`:case`object`:{if(e===null)return bC(e);let t=e,n=kC(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:bC(e)}return bC(e)}default:return bC(e)}}function kC(e,t){for(;e!==null;){let n=XS(e,t);if(n){if(n.get)return CC(n.get);if(typeof n.value==`function`)return CC(n.value)}e=YS(e)}function n(){return null}return n}function AC(e){try{return xC(e,``),!0}catch{return!1}}var jC=ZS(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),MC=ZS(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),NC=ZS([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),PC=ZS([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),FC=ZS(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),IC=ZS([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),LC=ZS([`#text`]),RC=ZS(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),zC=ZS(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),BC=ZS(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),VC=ZS([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),HC=QS(/{{[\w\W]*|^[\w\W]*}}/g),UC=QS(/<%[\w\W]*|^[\w\W]*%>/g),WC=QS(/\${[\w\W]*/g),GC=QS(/^data-[\-\w.\u00B7-\uFFFF]+$/),KC=QS(/^aria-[\-\w]+$/),qC=QS(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),JC=QS(/^(?:\w+script|data):/i),YC=QS(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),XC=QS(/^html$/i),ZC=QS(/^[a-z][.\w]*(-[.\w]+)+$/i),QC=QS(/<[/\w!]/g),$C=QS(/<[/\w]/g),ew=QS(/<\/no(script|embed|frames)/i),tw=QS(/\/>/i),nw={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},rw=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],iw=ZS(TC({},rw)),aw=function(){let e={};return rC(rw,t=>{e[t]=QS(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),ZS(e)}(),ow=function(){return typeof window>`u`?null:window},sw=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},cw=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},lw=function(e,t,n,r){return yC(e,t)&&cC(e[t])?TC(r.base?DC(r.base):{},e[t],r.transform):n},uw=function(e,t,n){let r=yC(e,t)?e[t]:void 0;return r&&typeof r==`object`?DC(r):n()};function dw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ow(),t=e=>dw(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==nw.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=kC(d,`cloneNode`),p=kC(d,`remove`),m=kC(d,`removeAttributeNode`),h=kC(d,`nextSibling`),g=kC(d,`childNodes`),_=kC(d,`parentNode`),v=kC(d,`shadowRoot`),y=kC(d,`attributes`),b=o&&o.prototype?kC(o.prototype,`nodeType`):null,x=o&&o.prototype?kC(o.prototype,`nodeName`):null,S=o&&o.prototype?kC(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,D,ee=!1,O=0,k=function(){if(O>0)throw SC(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},A=function(e){k(),O++;try{return T.createHTML(e)}finally{O--}},te=function(e){k(),O++;try{return T.createScriptURL(e)}finally{O--}},ne=function(){return ee||=(D=sw(u,i),!0),D},re=n,ie=re.implementation,ae=re.createNodeIterator,oe=re.createDocumentFragment,se=re.getElementsByTagName,ce=r.importNode,j=cw();t.isSupported=typeof KS==`function`&&typeof _==`function`&&ie&&ie.createHTMLDocument!==void 0;let le=HC,ue=UC,de=WC,fe=GC,pe=KC,me=JC,he=YC,ge=ZC,_e=qC,ve=null,M=TC({},[...jC,...MC,...NC,...FC,...LC]),N=null,ye=TC({},[...RC,...zC,...BC,...VC]),be=Object.seal($S(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),P=null,xe=null,Se=Object.seal($S(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ce=!0,we=!0,Te=!1,Ee=!0,De=!1,Oe=!0,ke=!1,Ae=!1,je=null,Me=null,Ne=!1,Pe=!1,Fe=!1,Ie=!1,Le=!0,Re=!1,ze=`user-content-`,Be=!0,Ve=!1,He={},Ue=null,We=TC({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ge=null,Ke=TC({},[`audio`,`video`,`img`,`source`,`image`,`track`]),qe=null,Je=TC({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ye=`http://www.w3.org/1998/Math/MathML`,Xe=`http://www.w3.org/2000/svg`,Ze=`http://www.w3.org/1999/xhtml`,Qe=Ze,$e=!1,F=null,et=TC({},[Ye,Xe,Ze],uC),tt=ZS([`mi`,`mo`,`mn`,`ms`,`mtext`]),nt=TC({},tt),rt=ZS([`annotation-xml`]),it=TC({},rt),at=TC({},[`title`,`style`,`font`,`a`,`script`]),ot=null,st=[`application/xhtml+xml`,`text/html`],I=null,ct=null,lt=n.createElement(`form`),ut=function(e){return e instanceof RegExp||e instanceof Function},dt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ct&&ct===e)return;(!e||typeof e!=`object`)&&(e={}),e=DC(e),ot=st.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,I=ot===`application/xhtml+xml`?uC:lC,ve=lw(e,`ALLOWED_TAGS`,M,{transform:I}),N=lw(e,`ALLOWED_ATTR`,ye,{transform:I}),F=lw(e,`ALLOWED_NAMESPACES`,et,{transform:uC}),qe=lw(e,`ADD_URI_SAFE_ATTR`,Je,{transform:I,base:Je}),Ge=lw(e,`ADD_DATA_URI_TAGS`,Ke,{transform:I,base:Ke}),Ue=lw(e,`FORBID_CONTENTS`,We,{transform:I}),P=lw(e,`FORBID_TAGS`,DC({}),{transform:I}),xe=lw(e,`FORBID_ATTR`,DC({}),{transform:I}),He=yC(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?DC(e.USE_PROFILES):e.USE_PROFILES:!1,Ce=e.ALLOW_ARIA_ATTR!==!1,we=e.ALLOW_DATA_ATTR!==!1,Te=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=e.SAFE_FOR_TEMPLATES||!1,Oe=e.SAFE_FOR_XML!==!1,ke=e.WHOLE_DOCUMENT||!1,Pe=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,Ie=e.RETURN_TRUSTED_TYPE||!1,Ne=e.FORCE_BODY||!1,Le=e.SANITIZE_DOM!==!1,Re=e.SANITIZE_NAMED_PROPS||!1,Be=e.KEEP_CONTENT!==!1,Ve=e.IN_PLACE||!1,_e=AC(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:qC,Qe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ze,nt=uw(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>TC({},tt)),it=uw(e,`HTML_INTEGRATION_POINTS`,()=>TC({},rt));let t=uw(e,`CUSTOM_ELEMENT_HANDLING`,()=>$S(null));if(be=$S(null),yC(t,`tagNameCheck`)&&ut(t.tagNameCheck)&&(be.tagNameCheck=t.tagNameCheck),yC(t,`attributeNameCheck`)&&ut(t.attributeNameCheck)&&(be.attributeNameCheck=t.attributeNameCheck),yC(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(be.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),QS(be),De&&(we=!1),Fe&&(Pe=!0),He&&(ve=TC({},LC),N=$S(null),He.html===!0&&(TC(ve,jC),TC(N,RC)),He.svg===!0&&(TC(ve,MC),TC(N,zC),TC(N,VC)),He.svgFilters===!0&&(TC(ve,NC),TC(N,zC),TC(N,VC)),He.mathMl===!0&&(TC(ve,FC),TC(N,BC),TC(N,VC))),Se.tagCheck=null,Se.attributeCheck=null,yC(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Se.tagCheck=e.ADD_TAGS:cC(e.ADD_TAGS)&&(ve===M&&(ve=DC(ve)),TC(ve,e.ADD_TAGS,I))),yC(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Se.attributeCheck=e.ADD_ATTR:cC(e.ADD_ATTR)&&(N===ye&&(N=DC(N)),TC(N,e.ADD_ATTR,I))),yC(e,`ADD_FORBID_CONTENTS`)&&cC(e.ADD_FORBID_CONTENTS)&&(Ue===We&&(Ue=DC(Ue)),TC(Ue,e.ADD_FORBID_CONTENTS,I)),Be&&(ve[`#text`]=!0),ke&&TC(ve,[`html`,`head`,`body`]),ve.table&&(TC(ve,[`tbody`]),delete P.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw SC(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw SC(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=A(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=ne()),T&&typeof E==`string`&&(E=A(``)));ZS&&ZS(e),ct=e},ft=TC({},[...MC,...NC,...PC]),pt=TC({},[...FC,...IC]),mt=function(e,t,n){return t.namespaceURI===Ze?e===`svg`:t.namespaceURI===Ye?e===`svg`&&(n===`annotation-xml`||nt[n]):!!ft[e]},ht=function(e,t,n){return t.namespaceURI===Ze?e===`math`:t.namespaceURI===Xe?e===`math`&&it[n]:!!pt[e]},gt=function(e,t,n){return t.namespaceURI===Xe&&!it[n]||t.namespaceURI===Ye&&!nt[n]?!1:!pt[e]&&(at[e]||!ft[e])},_t=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Qe,tagName:`template`});let n=lC(e.tagName),r=lC(t.tagName);return F[e.namespaceURI]?e.namespaceURI===Xe?mt(n,t,r):e.namespaceURI===Ye?ht(n,t,r):e.namespaceURI===Ze?gt(n,t,r):!!(ot===`application/xhtml+xml`&&F[e.namespaceURI]):!1},vt=function(e){oC(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw SC(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},yt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},bt=function(e){Ct(e);let t=g(e);if(t){let e=[];rC(t,t=>{oC(e,t)}),rC(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&yt(e,r,i)}},xt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}oC(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Pe||Fe)try{vt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},St=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||N[I(i)]||yt(e,r,i)}},Ct=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===nw.element&&St(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},wt=function(e,t){return Oe?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Tt=function(e){if(!Oe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===nw.processingInstruction||n===nw.comment&&xC($C,e.data)){try{p(e)}catch{}continue}if(n===nw.element){let t=e,n=I(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&wt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Et=function(e){let t=null,r=null;if(Ne)e=`<remove></remove>`+e;else{let t=dC(e,/^[\r\n\t ]+/);r=t&&t[0]}ot===`application/xhtml+xml`&&Qe===Ze&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?A(e):e;if(Qe===Ze)try{t=new l().parseFromString(i,ot)}catch{}if(!t||!t.documentElement){t=ie.createDocument(Qe,`template`,null);try{t.documentElement.innerHTML=$e?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Qe===Ze?se.call(t,ke?`html`:`body`)[0]:ke?t.documentElement:a},Dt=function(e){let t=S?S(e):e.ownerDocument;return ae.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ot=function(e){return e=fC(e,le,` `),e=fC(e,ue,` `),e=fC(e,de,` `),e},kt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ae.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Ot(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&rC(i,e=>{jt(e.content)&&kt(e.content)})},At=function(e){let t=x?x(e):null;return typeof t!=`string`||I(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},jt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===nw.documentFragment}catch{return!1}},Mt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Nt(e,n,r){e.length!==0&&rC(e,e=>{e.call(t,n,r,ct)})}let Pt=function(e,t){return!!(Oe&&e.hasChildNodes()&&!Mt(e.firstElementChild)&&xC(QC,e.textContent)&&xC(QC,e.innerHTML)||Oe&&e.namespaceURI===Ze&&iw[t]&&(Mt(e.firstElementChild)||typeof e.textContent==`string`&&xC(aw[t],e.textContent))||e.nodeType===nw.processingInstruction||Oe&&e.nodeType===nw.comment&&xC($C,e.data))},Ft=function(e,t){return e instanceof RegExp?xC(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},It=function(e,t,n){if(!P[t]&&Ht(t)&&Ft(be.tagNameCheck,t))return!1;if(Be&&!Ue[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return vt(e),!0},Lt=function(e,t,n,r){return e.length===0?t:t===n||t===r?DC(t):t},Rt=function(e,t){return e===t||_(e)!==null?!1:(Ve&&Ct(e),!0)},zt=function(e,n){if(Nt(j.beforeSanitizeElements,e,null),Rt(e,n))return!0;if(At(e))return vt(e),!0;let r=I(w(e));if(ve=Lt(j.uponSanitizeElement,ve,M,je),Nt(j.uponSanitizeElement,e,{tagName:r,allowedTags:ve}),Rt(e,n))return!0;if(Pt(e,r))return vt(e),!0;if(P[r]||!(Se.tagCheck instanceof Function&&Se.tagCheck(r))&&!ve[r]){let t=It(e,r,n);return t===!1&&(Nt(j.afterSanitizeElements,e,null),Rt(e,n))?!0:t}if(C(e)===nw.element&&!_t(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&xC(ew,e.innerHTML))return vt(e),!0;if(De&&e.nodeType===nw.text){let n=Ot(e.textContent);e.textContent!==n&&(oC(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Nt(j.afterSanitizeElements,e,null),Rt(e,n)},Bt=function(e,t,r){if(xe[t]||wt(t,e)||Le&&(t===`id`||t===`name`)&&(r in n||r in lt))return!1;let i=N[t]||Se.attributeCheck instanceof Function&&Se.attributeCheck(t,e);return we&&xC(fe,t)||Ce&&xC(pe,t)?!0:i?qe[t]||xC(_e,fC(r,he,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&pC(r,`data:`)===0&&Ge[e]||Te&&!xC(me,fC(r,he,``))?!0:!r:Ht(e)&&Ft(be.tagNameCheck,e)&&Ft(be.attributeNameCheck,t,e)||t===`is`&&be.allowCustomizedBuiltInElements&&Ft(be.tagNameCheck,r)},Vt=TC({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Ht=function(e){return!Vt[lC(e)]&&xC(ge,e)},Ut=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return A(r);case`TrustedScriptURL`:return te(r)}return r},Wt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!At(e)||(vt(e),!1)}catch{return xt(t,e),!1}},Gt=function(e,n){if(Nt(j.beforeSanitizeAttributes,e,null),Rt(e,n))return;let r=e.attributes;if(!r||At(e))return;N=Lt(j.uponSanitizeAttribute,N,ye,Me);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:N,forceKeepAttr:void 0},a=r.length,o=I(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=I(s),d=l,f=s===`value`?d:mC(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Nt(j.uponSanitizeAttribute,e,i),f=i.attrValue,Re&&(u===`id`||u===`name`)&&pC(f,ze)!==0&&(xt(s,e,n),f=ze+f,p=!0),Oe&&xC(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){xt(s,e,n);continue}if(u===`attributename`&&dC(f,`href`)){xt(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){xt(s,e,n);continue}if(!Ee&&xC(tw,f)){xt(s,e,n);continue}if(De&&(f=Ot(f)),!Bt(o,u,f)){xt(s,e,n);continue}f=Ut(o,u,c,f),f!==d&&Wt(e,s,c,f)&&p&&aC(t.removed)}}Nt(j.afterSanitizeAttributes,e,null),Rt(e,n)},Kt=function(e){let t=null,n=Dt(e);for(Nt(j.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Nt(j.uponSanitizeShadowNode,t,null),zt(t,e),Gt(t,e),jt(t.content)&&Kt(t.content),C(t)===nw.element){let e=v(t);jt(e)&&(qt(e),Kt(e))}Nt(j.afterSanitizeShadowDOM,e,null)},qt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Kt(e.shadow);continue}let n=e.node,r=C(n)===nw.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&I(e)===`template`){let e=n.content;jt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);jt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if($e=!e,$e&&(e=`\x3C!-->`),typeof e!=`string`&&!Mt(e)&&(e=OC(e),typeof e!=`string`))throw SC(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ae?(ve=je,N=Me):dt(n),(j.uponSanitizeElement.length>0||j.uponSanitizeAttribute.length>0)&&(ve=DC(ve)),j.uponSanitizeAttribute.length>0&&(N=DC(N)),t.removed=[];let c=Ve&&typeof e!=`string`&&Mt(e);if(c){Tt(e);let t=w(e);if(typeof t==`string`){let n=I(t);if(!ve[n]||P[n])throw bt(e),SC(`root node is forbidden and cannot be sanitized in-place`)}if(At(e))throw bt(e),SC(`root node is clobbered and cannot be sanitized in-place`);try{qt(e)}catch(t){throw bt(e),t}}else if(Mt(e))i=Et(`\x3C!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===nw.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),qt(i);else{if(!Pe&&!De&&!ke&&e.indexOf(`<`)===-1)return T&&Ie?A(e):e;if(i=Et(e),!i)return Pe?null:Ie?E:``}i&&Ne&&vt(i.firstChild);let l=c?e:i;try{let e=Dt(l);for(;o=e.nextNode();)zt(o,l),Gt(o,l),jt(o.content)&&Kt(o.content)}catch(n){throw c&&(bt(e),rC(t.removed,e=>{e.element&&Ct(e.element)})),n}if(c){let n=!1;if(rC(t.removed,t=>{t.element&&(t.element===e&&(n=!0),Ct(t.element))}),n)throw SC(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return De&&kt(e),e}if(Pe){if(De&&kt(i),Fe)for(s=oe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(N.shadowroot||N.shadowrootmode)&&(s=ce.call(r,s,!0)),s}let u=ke?i.outerHTML:i.innerHTML;return ke&&ve[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&xC(XC,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
572
|
+
`+u),De&&(u=Ot(u)),T&&Ie?A(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(e),Ae=!0,je=ve,Me=N},t.clearConfig=function(){ct=null,Ae=!1,je=null,Me=null,T=D,E=``},t.isValidAttribute=function(e,t,n){ct||dt({});let r=I(e),i=I(t);return Bt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&yC(j,e)&&oC(j[e],t)},t.removeHook=function(e,t){if(yC(j,e)){if(t!==void 0){let n=iC(j[e],t);return n===-1?void 0:sC(j[e],n,1)[0]}return aC(j[e])}},t.removeHooks=function(e){yC(j,e)&&(j[e]=[])},t.removeAllHooks=function(){j=cw()},t}var fw=dw();function pw(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var mw=pw();function hw(e){mw=e}var gw={exec:()=>null};function _w(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function vw(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(bw.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var yw=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),bw={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:_w(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:_w(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:_w(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:_w(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:_w(e=>RegExp(`^ {0,${e}}(?:</?(?:${Fw})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:_w(e=>RegExp(`^ {0,${e}}>`))},xw=/^(?:[ \t]*(?:\n|$))+/,Sw=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Cw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ww=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Tw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ew=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Dw=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ow=vw(Dw).replace(/bull/g,Ew).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),kw=vw(Dw).replace(/bull/g,Ew).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Aw=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,jw=/^[^\n]+/,Mw=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Nw=vw(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Mw).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Pw=vw(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ew).getRegex(),Fw=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Iw=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,Lw=vw(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Iw).replace(`tag`,Fw).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Rw=e=>vw(Aw).replace(`hr`,ww).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Fw).getRegex(),zw=Rw(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Bw=Rw(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Vw={blockquote:vw(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Bw).getRegex(),code:Sw,def:Nw,fences:Cw,heading:Tw,hr:ww,html:Lw,lheading:Ow,list:Pw,newline:xw,paragraph:zw,table:gw,text:jw},Hw=vw(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,ww).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Fw).getRegex(),Uw={...Vw,lheading:kw,table:Hw,paragraph:vw(Aw).replace(`hr`,ww).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Hw).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Fw).getRegex()},Ww={...Vw,html:vw(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Iw).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:gw,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:vw(Aw).replace(`hr`,ww).replace(`heading`,` *#{1,6} *[^
|
|
573
|
+
]`).replace(`lheading`,Ow).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Gw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Kw=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qw=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Jw=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Yw=/[\p{P}\p{S}]/u,Xw=/[\s\p{P}\p{S}]/u,Zw=/[^\s\p{P}\p{S}]/u,Qw=vw(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Xw).getRegex(),$w=/[\p{Pi}\p{Ps}"']/u,eT=/(?!~)[\p{P}\p{S}]/u,tT=/(?!~)[\s\p{P}\p{S}]/u,nT=/(?:[^\s\p{P}\p{S}]|~)/u,rT=vw(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,yw?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),iT=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,aT=vw(iT,`u`).replace(/punct/g,Yw).getRegex(),oT=vw(iT,`u`).replace(/punct/g,eT).getRegex(),sT=vw(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,$w).replace(/punct/g,Yw).getRegex(),cT=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,lT=vw(cT,`gu`).replace(/notPunctSpace/g,Zw).replace(/punctSpace/g,Xw).replace(/punct/g,Yw).getRegex(),uT=vw(cT,`gu`).replace(/notPunctSpace/g,nT).replace(/punctSpace/g,tT).replace(/punct/g,eT).getRegex(),dT=vw(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Zw).replace(/punctSpace/g,Xw).replace(/punct/g,Yw).getRegex(),fT=vw(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Zw).replace(/punctSpace/g,Xw).replace(/punct/g,Yw).getRegex(),pT=vw(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Zw).replace(/punctSpace/g,Xw).replace(/punct/g,Yw).getRegex(),mT=vw(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Yw).getRegex(),hT=vw(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Zw).replace(/punctSpace/g,Xw).replace(/punct/g,Yw).getRegex(),gT=vw(/\\(punct)/,`gu`).replace(/punct/g,Yw).getRegex(),_T=vw(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),vT=vw(Iw).replace(`(?:-->|$)`,`-->`).getRegex(),yT=vw(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,vT).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),bT=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,xT=vw(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,bT).getRegex(),ST=vw(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,xT).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),CT=vw(/^!?\[(label)\]\[(ref)\]/).replace(`label`,xT).replace(`ref`,Mw).getRegex(),wT=vw(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Mw).getRegex(),TT=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,ET=vw(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,bT).getRegex(),DT=vw(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,vw(/^!?\[(label)\]\[(ref)\]/).replace(`label`,ET).replace(`ref`,TT).getRegex()).replace(`nolink`,vw(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,TT).getRegex()).getRegex(),OT=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,kT=vw(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),AT={_backpedal:gw,anyPunctuation:gT,autolink:_T,blockSkip:rT,br:qw,code:Kw,del:gw,delLDelim:gw,delRDelim:gw,emStrongLDelim:aT,emStrongRDelimAst:lT,emStrongRDelimUnd:fT,escape:Gw,link:ST,nolink:wT,punctuation:Qw,reflink:CT,reflinkSearch:DT,tag:yT,text:Jw,url:gw},jT={...AT,emStrongLDelim:sT,emStrongRDelimAst:dT,emStrongRDelimUnd:pT,link:vw(/^!?\[(label)\]\((.*?)\)/).replace(`label`,xT).getRegex(),reflink:vw(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,xT).getRegex()},MT={...AT,emStrongRDelimAst:uT,emStrongLDelim:oT,delLDelim:mT,delRDelim:hT,url:vw(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,kT).replace(`protocol`,OT).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:vw(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,OT).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},NT={...MT,br:vw(qw).replace(`{2,}`,`*`).getRegex(),text:vw(MT.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},PT={normal:Vw,gfm:Uw,pedantic:Ww},FT={normal:AT,gfm:MT,breaks:NT,pedantic:jT},IT={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},LT=e=>IT[e];function RT(e,t){if(t){if(bw.escapeTest.test(e))return e.replace(bw.escapeReplace,LT)}else if(bw.escapeTestNoEncode.test(e))return e.replace(bw.escapeReplaceNoEncode,LT);return e}function zT(e){return e.replace(bw.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function BT(e){try{e=encodeURI(e).replace(bw.percentDecode,`%`)}catch{return null}return e}function VT(e,t){let n=e.replace(bw.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(bw.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(bw.slashPipe,`|`);return n}function HT(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function UT(e){let t=e.split(`
|
|
574
|
+
`),n=t.length-1;for(;n>=0&&bw.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
575
|
+
`)}function WT(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function GT(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function KT(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function qT(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function JT(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
576
576
|
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
|
|
577
|
-
`)}function
|
|
578
|
-
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:
|
|
579
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=
|
|
577
|
+
`)}function YT(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var XT=class{options;rules;lexer;constructor(e){this.options=e||mw}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:UT(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=JT(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=HT(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:HT(t[0],`
|
|
578
|
+
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:HT(t[0],`
|
|
579
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=HT(t[0],`
|
|
580
580
|
`).split(`
|
|
581
581
|
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
582
582
|
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -591,19 +591,19 @@ ${d.join(`
|
|
|
591
591
|
`+e.join(`
|
|
592
592
|
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
593
593
|
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
594
|
-
`,1)[0],l=t[1].length,u=this.options.pedantic?
|
|
594
|
+
`,1)[0],l=t[1].length,u=this.options.pedantic?KT(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>KT(e,l)),d=e.split(`
|
|
595
595
|
`,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
|
|
596
596
|
`,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
|
|
597
597
|
`,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
|
|
598
598
|
`+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
|
|
599
599
|
`+d}f=!d.trim(),r+=l+`
|
|
600
|
-
`,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=
|
|
601
|
-
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=
|
|
602
|
-
`):[],a={type:`table`,raw:
|
|
603
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(
|
|
600
|
+
`,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=UT(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=WT(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:HT(t[0],`
|
|
601
|
+
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=VT(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
602
|
+
`):[],a={type:`table`,raw:HT(t[0],`
|
|
603
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(VT(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:HT(t[0],`
|
|
604
604
|
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
605
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&
|
|
606
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(
|
|
605
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&YT(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=HT(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=GT(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),qT(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&YT(e,n[1],r,this.rules))return;let i=t[WT((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return qT(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:zT(t[0]),escaped:e}}}},ZT=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||mw,this.options.tokenizer=this.options.tokenizer||new XT,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:bw,block:PT.normal,inline:FT.normal};this.options.pedantic?(t.block=PT.pedantic,t.inline=FT.pedantic):this.options.gfm&&(t.block=PT.gfm,t.inline=this.options.breaks?FT.breaks:FT.gfm),this.tokenizer.rules=t}static get rules(){return{block:PT,inline:FT}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(bw.carriageReturn,`
|
|
606
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(bw.tabCharGlobal,` `).replace(bw.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
607
607
|
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
608
608
|
`)?``:`
|
|
609
609
|
`)+i.raw,n.text+=`
|
|
@@ -616,9 +616,9 @@ ${d.join(`
|
|
|
616
616
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
617
617
|
`)?``:`
|
|
618
618
|
`)+i.raw,n.text+=`
|
|
619
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,
|
|
620
|
-
`:``;return r?`<pre><code class="language-`+
|
|
621
|
-
`:`<pre><code>`+(n?i:
|
|
619
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,WT(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,WT(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},QT=class{options;parser;constructor(e){this.options=e||mw}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(bw.notSpaceStart)?.[0],i=e?e.replace(bw.endingNewline,``)+`
|
|
620
|
+
`:``;return r?`<pre><code class="language-`+RT(r)+`">`+(n?i:RT(i,!0))+`</code></pre>
|
|
621
|
+
`:`<pre><code>`+(n?i:RT(i,!0))+`</code></pre>
|
|
622
622
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
623
623
|
${this.parser.parse(e)}</blockquote>
|
|
624
624
|
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
@@ -634,8 +634,8 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
634
634
|
`}tablerow({text:e}){return`<tr>
|
|
635
635
|
${e}</tr>
|
|
636
636
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
637
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${
|
|
638
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+FT(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function eE(e,t){return $T.parse(e,t)}eE.options=eE.setOptions=function(e){return $T.setOptions(e),eE.defaults=$T.defaults,fw(eE.defaults),eE},eE.getDefaults=uw,eE.defaults=dw;function tE(...e){return $T.use(...e),eE.defaults=$T.defaults,fw(eE.defaults),eE}eE.use=tE,eE.walkTokens=function(e,t){return $T.walkTokens(e,t)},eE.parseInline=$T.parseInline,eE.Parser=ZT,eE.parser=ZT.parse,eE.Renderer=YT,eE.TextRenderer=XT,eE.Lexer=JT,eE.lexer=JT.lex,eE.Tokenizer=qT,eE.Hooks=QT,eE.parse=eE,eE.options,eE.setOptions,eE.walkTokens,eE.parseInline,ZT.parse,JT.lex;function nE(){if(typeof window>`u`)return null;let e=window.engentyApp;return e&&typeof e.call==`function`&&Array.isArray(e.can)?e:null}var rE=nE();(rE!==null||typeof window<`u`&&new URLSearchParams(window.location.search).get(`app`)===`1`)&&typeof document<`u`&&document.documentElement.classList.add(`in-app`);var iE=e=>rE?.can.includes(e)===!0;function aE(e,t){return rE&&iE(e)?rE.call(e,t):Promise.reject(Error(`the app cannot ${e}`))}function oE(e,t){iE(e)&&aE(e,t).catch(()=>void 0)}function sE(e,t,n){return iE(`download`)?(e.preventDefault(),aE(`download`,{url:new URL(t,window.location.href).href,filename:n}).catch(()=>void 0),!0):!1}var cE=typeof window<`u`&&window.matchMedia?.(`(pointer: coarse)`).matches===!0,lE=typeof navigator<`u`&&!!navigator.mediaDevices?.getUserMedia;function uE(){(0,y.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let t=document.documentElement,n=()=>{let n=e.scale>1.01?0:window.innerHeight-e.height-e.offsetTop,r=n>80;t.style.setProperty(`--kb`,r?`${Math.round(n)}px`:`0px`),t.classList.toggle(`keyboard-open`,r)};return n(),e.addEventListener(`resize`,n),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`resize`,n),e.removeEventListener(`scroll`,n),t.style.removeProperty(`--kb`),t.classList.remove(`keyboard-open`)}},[])}function dE(e){let[t,n]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{if(e&&iE(`keepAwake`))return oE(`keepAwake`,!0),n(!0),()=>{oE(`keepAwake`,!1),n(!1)};if(!e||!(`wakeLock`in navigator))return;let t=null,r=!1,i=async()=>{if(!(r||t||document.visibilityState!==`visible`))try{let e=await navigator.wakeLock.request(`screen`);if(r){e.release().catch(()=>void 0);return}t=e,n(!0),e.addEventListener(`release`,()=>{t===e&&(t=null,n(!1))})}catch{}};return i(),document.addEventListener(`visibilitychange`,i),()=>{r=!0,document.removeEventListener(`visibilitychange`,i),t?.release().catch(()=>void 0),t=null,n(!1)}},[e]),t}var fE=`wz.notify`,pE=new Set,mE=null;function hE(){try{return localStorage.getItem(fE)===`1`}catch{return!1}}function gE(e){try{e?localStorage.setItem(fE,`1`):localStorage.removeItem(fE)}catch{}for(let e of pE)e()}var _E=typeof window<`u`&&`Notification`in window,vE=null;function yE(){return hE()?iE(`notify`)?vE===!1?`quiet`:`on`:_E&&Notification.permission===`granted`?`on`:`quiet`:`off`}function bE(){return(0,y.useSyncExternalStore)(e=>(pE.add(e),()=>pE.delete(e)),yE,()=>`off`)}function xE(){return iE(`notify`)?vE===!1:_E&&Notification.permission===`denied`}async function SE(){if(gE(!0),iE(`notify`)){vE=!iE(`notifyPermission`)||await aE(`notifyPermission`).catch(()=>!1);for(let e of pE)e();return yE()}try{mE??=new AudioContext,mE.resume()}catch{mE=null}if(_E&&Notification.permission==="default")try{await Notification.requestPermission()}catch{}_E&&Notification.permission===`granted`&&await navigator.serviceWorker?.register(`${AS}/sw.js`).catch(()=>void 0);for(let e of pE)e();return yE()}function CE(){gE(!1)}function wE(){let e=mE;if(e?.state!==`running`)return;let t=e.currentTime;for(let[n,r]of[660,880].entries()){let i=e.createOscillator(),a=e.createGain();i.frequency.value=r,a.gain.setValueAtTime(0,t+n*.16),a.gain.linearRampToValueAtTime(.18,t+n*.16+.02),a.gain.exponentialRampToValueAtTime(.001,t+n*.16+.32),i.connect(a).connect(e.destination),i.start(t+n*.16),i.stop(t+n*.16+.34)}}async function TE(e){if(!hE())return;if(iE(`notify`)){oE(`notify`,e);return}if(document.visibilityState===`visible`){wE(),navigator.vibrate?.([120,60,120]);return}if(!_E||Notification.permission!==`granted`)return;let t={body:e.body,tag:e.tag,icon:PS(`icons/icon-192.png`),badge:PS(`icons/icon-192.png`),data:{url:location.href}};try{let n=await navigator.serviceWorker?.getRegistration();if(n?.active){await n.showNotification(e.title,t);return}}catch{}try{new Notification(e.title,t)}catch{}}function EE(){if(typeof navigator>`u`||!navigator.canShare)return!1;try{return navigator.canShare({files:[new File([`x`],`x.pdf`,{type:`application/pdf`})]})}catch{return!1}}function DE({text:e,className:t}){let n=(0,y.useMemo)(()=>lw.sanitize(eE.parse(e,{async:!1})),[e]);return(0,Z.jsx)(`div`,{className:$(`prose-zen`,t),dangerouslySetInnerHTML:{__html:n}})}function OE({src:e,page:t,height:n,fit:r}){let i=(0,y.useRef)(null),[a,o]=(0,y.useState)(0);(0,y.useEffect)(()=>{let e=i.current;if(!e)return;let t=new ResizeObserver(()=>o(e.clientWidth));return t.observe(e),o(e.clientWidth),()=>t.disconnect()},[]);let[s,c]=(0,y.useState)(null);(0,y.useEffect)(()=>{let t=!0;return fetch(e,{credentials:`include`}).then(e=>e.ok?e.text():``).then(n=>t&&c({src:e,text:n})),()=>{t=!1}},[e]);let l=t??Math.max(a,900),u=a?r?a/l:Math.min(1,a/l):1;return(0,Z.jsxs)(`div`,{ref:i,className:`relative overflow-hidden rounded-lg bg-white ring-1 ring-border-soft`,style:{height:n*u},children:[s?.src===e?(0,Z.jsx)(`iframe`,{title:`preview`,srcDoc:s.text,sandbox:`allow-scripts allow-popups allow-popups-to-escape-sandbox`,className:`absolute top-0 left-0 origin-top-left border-0`,style:{width:l,height:n,transform:`scale(${u})`}},e):(0,Z.jsx)(`div`,{className:`absolute inset-0 animate-pulse bg-paper-2`}),(0,Z.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`absolute top-3 right-3 inline-flex size-9 items-center justify-center rounded-full bg-card/90 text-ink-2 shadow-soft ring-1 ring-border-soft backdrop-blur hover:text-ink coarse:size-11`,"aria-label":Q(`run.openFull`),children:(0,Z.jsx)(ov,{className:`size-4`})})]})}var kE={disc:{file:`ai`,box:566.93,x:89.28,y:100.72,w:365.49,h:365.49},generated:{file:`ai-generated`,box:1789.84,x:207.3,y:144.36,w:1384.24,h:266.41},edited:{file:`ai-modified`,box:1700.79,x:231.11,y:144.36,w:1230.56,h:266.41}};function AE({icon:e,tone:t,size:n,className:r}){let i=kE[e],a=n/i.h;return(0,Z.jsx)(`img`,{src:PS(`ai-labels/${i.file}-${t}.svg`),alt:``,draggable:!1,className:$(`pointer-events-none absolute max-w-none select-none`,r),style:{width:i.box*a,height:566.93*a,left:-i.x*a,top:-i.y*a}})}function jE({ai:e,className:t}){let[n,r]=(0,y.useState)(!1);if(!e)return null;let i=kE[e],a=t===`static`,o=a?[[`black`,`dark:hidden`],[`white`,`hidden dark:block`]]:[[`white`,``]];return(0,Z.jsx)(`button`,{type:`button`,"aria-label":Q(e===`edited`?`ai.modified`:`ai.generated`),"aria-expanded":n,"data-open":n,onClick:()=>r(e=>!e),className:$(`group block cursor-default overflow-hidden rounded-full backdrop-blur-md transition-[width] duration-200`,`w-[var(--ai-disc)] hover:w-[var(--ai-long)] focus-visible:w-[var(--ai-long)] data-[open=true]:w-[var(--ai-long)]`,a?`relative`:$(`absolute shadow-[0_1px_3px_rgba(0,0,0,0.25)]`,t??`bottom-2 left-2`)),style:{height:18,"--ai-disc":`18px`,"--ai-long":`${i.w/i.h*18}px`},children:o.map(([t,r])=>(0,Z.jsxs)(`span`,{className:r,children:[(0,Z.jsx)(AE,{icon:`disc`,tone:t,size:18,className:$(`transition-opacity duration-200`,n?`opacity-0`:`opacity-100 group-hover:opacity-0 group-focus-visible:opacity-0`)}),(0,Z.jsx)(AE,{icon:e,tone:t,size:18,className:$(`transition-opacity duration-200`,n?`opacity-100`:`opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100`)})]},t))})}function ME(e,t){return e.type===`agent`?e.output.fields?.find(e=>e.id===t)?.description??t:t}function NE({step:e,json:t}){return!t||typeof t!=`object`?(0,Z.jsx)(`pre`,{className:`text-[0.8125rem]`,children:JSON.stringify(t,null,2)}):(0,Z.jsx)(`div`,{className:`flex flex-col gap-4`,children:Object.entries(t).map(([t,n])=>(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`mb-1 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:ME(e,t)}),typeof n==`boolean`?(0,Z.jsx)(`div`,{className:`text-[0.9375rem]`,children:Q(n?`run.yes`:`run.no`)}):typeof n==`string`||typeof n==`number`?(0,Z.jsx)(`div`,{className:`whitespace-pre-wrap text-[0.9375rem]`,children:String(n)}):Array.isArray(n)&&n.every(e=>typeof e!=`object`)?(0,Z.jsx)(`ul`,{className:`list-disc pl-5 text-[0.875rem]`,children:n.map((e,t)=>(0,Z.jsx)(`li`,{className:`break-words`,children:String(e)},t))}):Array.isArray(n)&&n.length&&typeof n[0]==`object`?(0,Z.jsx)(PE,{rows:n}):(0,Z.jsx)(`pre`,{className:`overflow-auto rounded-lg bg-paper-2 p-3 text-[0.75rem]`,children:JSON.stringify(n,null,2)})]},t))})}function PE({rows:e}){let t=[...new Set(e.flatMap(e=>Object.keys(e)))];return(0,Z.jsx)(`div`,{className:`overflow-x-auto rounded-lg ring-1 ring-border-soft`,children:(0,Z.jsxs)(`table`,{className:`w-full text-[0.8125rem]`,children:[(0,Z.jsx)(`thead`,{className:`bg-paper-2 text-ink-2`,children:(0,Z.jsx)(`tr`,{children:t.map(e=>(0,Z.jsx)(`th`,{className:`px-3 py-2 text-left font-medium`,children:e},e))})}),(0,Z.jsx)(`tbody`,{children:e.map((e,n)=>(0,Z.jsx)(`tr`,{className:`border-border-soft border-t`,children:t.map(t=>(0,Z.jsx)(`td`,{className:`px-3 py-2 tabular-nums`,children:e[t]===null||e[t]===void 0?``:String(e[t])},t))},n))})]})})}function FE({text:e}){let[t,n]=(0,y.useState)(!1);return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)},className:`inline-flex h-8 items-center gap-1.5 rounded-full bg-paper-2 px-3 text-[0.8125rem] text-ink-2 hover:text-ink coarse:h-11 coarse:px-4`,children:[t?(0,Z.jsx)(c_,{className:`size-3.5`}):(0,Z.jsx)(f_,{className:`size-3.5`}),Q(t?`share.copied`:`run.copy`)]})}function IE({base:e,step:t,output:n,editable:r,draft:i,onDraft:a,picked:o,onPick:s}){if(!n)return null;let c=t=>NS(`${e}/assets/${t}`);if(t.type===`widget`){let e=n.assets?.find(e=>e.kind===`video`);if(e){let r=n.assets?.find(e=>e.kind===`poster`),i=(t.size?.height??0)>(t.size?.width??1);return(0,Z.jsxs)(`div`,{className:$(`relative mx-auto`,i?`w-fit`:`w-full`),children:[(0,Z.jsx)(`video`,{src:c(e.id),poster:r?c(r.id):void 0,controls:!0,playsInline:!0,className:$(`rounded-lg bg-black ring-1 ring-border-soft`,i?`max-h-[76vh]`:`w-full`)}),(0,Z.jsx)(jE,{ai:e.ai,className:`top-2 right-2`})]})}let r=n.assets?.find(e=>e.mime===`text/html`),i=t.size??{width:1280,height:720};return r?(0,Z.jsx)(OE,{src:c(r.id),page:i.width,height:i.height,fit:!0}):null}if(t.type===`generate`){let e=n.assets?.[0];if(!e)return null;if(t.asset===`voice`)return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(`audio`,{src:c(e.id),controls:!0,className:`w-full`}),(0,Z.jsx)(jE,{ai:e.ai,className:`static`}),n.text?(0,Z.jsx)(`p`,{className:`text-[0.875rem] text-ink-2 leading-relaxed`,children:n.text}):null]});if((n.assets?.length??0)>1&&(t.asset===`image`||t.asset===`video`)){let e=t.options?.aspectRatio===`9:16`||t.options?.aspectRatio===`2:3`;return(0,Z.jsx)(`div`,{className:$(`grid gap-3`,e?`grid-cols-2 sm:grid-cols-3`:`sm:grid-cols-2`),children:n.assets?.map((e,n)=>{let r=o?.includes(n);return(0,Z.jsxs)(`figure`,{className:$(`relative overflow-hidden rounded-lg bg-paper-2 ring-1 ring-border-soft`,r&&`ring-2 ring-ember`),children:[t.asset===`image`?(0,Z.jsx)(`img`,{src:c(e.id),alt:`${t.title} ${n+1}`,className:`w-full`}):(0,Z.jsx)(`video`,{src:c(e.id),controls:!0,playsInline:!0,loop:!0,className:`w-full`}),s?(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>s(n),className:$(`absolute top-2 left-2 inline-flex h-8 items-center gap-1.5 rounded-full px-3 font-medium text-[0.75rem] shadow-soft backdrop-blur coarse:h-11`,r?`bg-ember text-white`:`bg-card/90 text-ink-2 hover:text-ink`),children:[r?(0,Z.jsx)(c_,{className:`size-3.5`}):null,Q(r?`run.pickedItem`:`run.pickItem`,{n:n+1})]}):(0,Z.jsx)(`span`,{className:`absolute top-2 left-2 rounded-full bg-card/90 px-2.5 py-1 font-medium text-[0.75rem] text-ink-2`,children:n+1}),(0,Z.jsx)(jE,{ai:e.ai,className:t.asset===`image`?`bottom-2 left-2`:`top-2 right-2`})]},e.id)})})}if(t.asset===`image`)return(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`img`,{src:c(e.id),alt:t.title,className:`w-full rounded-lg bg-paper-2 ring-1 ring-border-soft`}),(0,Z.jsx)(jE,{ai:e.ai})]});if(t.asset===`video`){let n=t.options?.aspectRatio===`9:16`;return(0,Z.jsxs)(`div`,{className:$(`relative mx-auto`,n?`w-fit`:`w-full`),children:[(0,Z.jsx)(`video`,{src:c(e.id),controls:!0,playsInline:!0,loop:!0,className:$(`rounded-lg bg-black ring-1 ring-border-soft`,n?`max-h-[70vh]`:`w-full`)}),(0,Z.jsx)(jE,{ai:e.ai,className:`top-2 left-2`})]})}return t.asset===`document`?(0,Z.jsx)(OE,{src:c(e.id),page:820,height:1100}):(0,Z.jsx)(OE,{src:c(e.id),page:null,height:760})}if(t.type===`agent`){let e=n.assets?.filter(e=>e.kind!==`file`&&e.mime.startsWith(`image/`))??[],o=n.assets?.filter(e=>e.kind===`file`)??[];return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[t.output.format===`json`&&n.json!==void 0?(0,Z.jsx)(NE,{step:t,json:n.json}):r?(0,Z.jsx)(Fb,{value:i??n.text??``,onChange:e=>a?.(e.target.value),minRows:4,maxRows:24}):t.output.format===`markdown`?(0,Z.jsx)(DE,{text:n.text??``}):(0,Z.jsx)(`div`,{className:`whitespace-pre-wrap text-[1rem] leading-relaxed`,children:n.text}),e.map(e=>(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`img`,{src:c(e.id),alt:``,className:`w-full rounded-lg ring-1 ring-border-soft`}),(0,Z.jsx)(jE,{ai:e.ai})]},e.id)),o.length?(0,Z.jsx)(`ul`,{className:`overflow-hidden rounded-lg ring-1 ring-border-soft`,children:o.map(e=>(0,Z.jsx)(`li`,{className:`border-border-soft border-b last:border-0`,children:(0,Z.jsxs)(`a`,{href:c(e.id),download:e.name,onClick:t=>sE(t,c(e.id),e.name),className:`flex items-center gap-2 px-3 py-2 text-[0.8125rem] hover:bg-paper-2 coarse:min-h-11`,children:[(0,Z.jsx)(O_,{className:`size-3.5 shrink-0 text-ink-3`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name})]})},e.id))}):null,t.output.format!==`json`&&!r&&n.text?(0,Z.jsx)(`div`,{children:(0,Z.jsx)(FE,{text:n.text})}):null]})}return null}var LE={png:`PNG`,mp4:`MP4`,mp3:`MP3`,pdf:`PDF`,docx:`Word`,html:`HTML`,md:`Markdown`,txt:`Text`,csv:`CSV`,xlsx:`Excel`,json:`JSON`,zip:`ZIP`};function RE(e,t){return(e.headers.get(`content-disposition`)??``).match(/filename="([^"]+)"/)?.[1]??t}function zE({url:e,format:t,title:n}){let[r,i]=(0,y.useState)(`idle`),a=(0,y.useRef)(null),o=async()=>{if(iE(`share`)){i(`busy`),await aE(`share`,{url:new URL(e,location.href).href,title:n}).catch(()=>void 0),i(`idle`);return}try{if(!a.current){i(`busy`);let n=await fetch(e,{credentials:`include`});if(!n.ok)throw Error(String(n.status));let r=await n.blob();a.current=new File([r],RE(n,`download.${t}`),{type:r.type.split(`;`)[0]})}let r={files:[a.current],title:n};if(!navigator.canShare(r)){location.href=e,i(`idle`);return}await navigator.share(r),i(`idle`)}catch(e){i(a.current&&e.name===`NotAllowedError`?`ready`:`idle`)}};return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>void o(),disabled:r===`busy`,"aria-label":Q(`run.shareFile`),title:Q(`run.shareFile`),className:$(`inline-flex h-9 items-center gap-1.5 rounded-full px-3 font-medium text-[0.8125rem] transition coarse:h-11 coarse:px-4`,r===`ready`?`bg-ember-tint text-ink ring-1 ring-ember`:`bg-paper-2 text-ink-2 hover:bg-paper-3 hover:text-ink`),children:[r===`busy`?(0,Z.jsx)(Bb,{className:`size-3.5`}):(0,Z.jsx)(Pv,{className:`size-3.5`}),Q(r===`ready`?`run.shareNow`:`run.share`)]})}var BE=iE(`share`)||EE();function VE({base:e,stepId:t,formats:n,title:r}){let i=n=>NS(`${e}/steps/${t}/download?format=${n}`);return(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[n.map((e,t)=>(0,Z.jsxs)(`a`,{href:i(e),onClick:t=>sE(t,i(e)),className:$(`inline-flex h-9 items-center gap-1.5 rounded-full px-3.5 font-medium text-[0.8125rem] transition coarse:h-11 coarse:px-4`,t===0?`bg-primary text-primary-foreground hover:brightness-105`:`bg-paper-2 text-ink-2 hover:bg-paper-3 hover:text-ink`),children:[t===0?(0,Z.jsx)(v_,{className:`size-3.5`}):null,LE[e]]},e)),BE&&n.length?(0,Z.jsx)(zE,{url:i(n[0]),format:n[0],title:r},i(n[0])):null]})}var HE=class extends Error{status;body;constructor(e,t,n){super(e),this.status=t,this.body=n}};async function UE(e,t,n){let r=await fetch(NS(t),{method:e,credentials:`include`,headers:n!==void 0&&!(n instanceof FormData)?{"content-type":`application/json`}:void 0,body:n===void 0?void 0:n instanceof FormData?n:JSON.stringify(n)}).catch(()=>{throw new HE(Q(`common.offline`),0,null)}),i=await r.text(),a=i?WE(i):null;if(!r.ok)throw new HE(a?.error??r.statusText,r.status,a);return a}function WE(e){try{return JSON.parse(e)}catch{return{error:e}}}var GE={get:e=>UE(`GET`,e),post:(e,t)=>UE(`POST`,e,t??{}),put:(e,t)=>UE(`PUT`,e,t),patch:(e,t)=>UE(`PATCH`,e,t),del:e=>UE(`DELETE`,e),upload:(e,t)=>{let n=new FormData;return n.set(`file`,t),UE(`POST`,e,n)}};function KE(e,t){let n=encodeURIComponent(e),r=encodeURIComponent(t);return[{id:`mail`,label:Q(`shareRun.email`),href:`mailto:?subject=${r}&body=${r}%0A%0A${n}`},{id:`x`,label:`X`,href:`https://x.com/intent/post?text=${r}&url=${n}`},{id:`linkedin`,label:`LinkedIn`,href:`https://www.linkedin.com/sharing/share-offsite/?url=${n}`},{id:`whatsapp`,label:`WhatsApp`,href:`https://wa.me/?text=${r}%20${n}`},{id:`facebook`,label:`Facebook`,href:`https://www.facebook.com/sharer/sharer.php?u=${n}`}]}var qE={x:`𝕏`,linkedin:`in`,whatsapp:`WA`,facebook:`f`};function JE({runId:e,title:t,initial:n}){let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(n),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(null),p=async()=>{if(i(!0),!a){c(!0),f(null);try{o(await GE.post(`/api/runs/${e}/share`))}catch(e){f(e.message)}finally{c(!1)}}},m=async()=>{await GE.del(`/api/runs/${e}/share`),o(null),i(!1)},h=()=>{a&&(navigator.clipboard.writeText(a.url),u(!0),setTimeout(()=>u(!1),1500))},g=iE(`share`)||typeof navigator<`u`&&`share`in navigator,_=a?.expiresAt?new Intl.DateTimeFormat(pb,{dateStyle:`long`}).format(new Date(a.expiresAt)):null;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(kb,{variant:`secondary`,onClick:()=>void p(),children:[(0,Z.jsx)(Mv,{className:`size-4`}),` `,Q(`shareRun.button`)]}),(0,Z.jsx)(Ub,{open:r,onClose:()=>i(!1),title:Q(`shareRun.title`),children:s?(0,Z.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,Z.jsx)(Bb,{})}):d?(0,Z.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:d}):a?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-paper-2 p-1.5 pl-3`,children:[(0,Z.jsx)(J_,{className:`size-4 shrink-0 text-ink-3`}),(0,Z.jsx)(`input`,{readOnly:!0,value:a.url,onFocus:e=>e.target.select(),"aria-label":Q(`share.link`),className:`min-w-0 flex-1 bg-transparent text-[0.875rem] outline-none coarse:h-11`}),(0,Z.jsxs)(kb,{size:`sm`,onClick:h,children:[l?(0,Z.jsx)(c_,{className:`size-3.5`}):(0,Z.jsx)(f_,{className:`size-3.5`}),Q(l?`share.copied`:`share.copy`)]})]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 sm:grid-cols-6`,children:[KE(a.url,t).map(e=>(0,Z.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`flex flex-col items-center gap-1.5 text-[0.75rem] text-ink-2 hover:text-ink`,children:[(0,Z.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 font-semibold text-[0.9375rem] transition hover:bg-paper-3`,children:e.id===`mail`?(0,Z.jsx)(nv,{className:`size-5`}):qE[e.id]}),e.label]},e.id)),g?(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>void(iE(`share`)?aE(`share`,{link:a.url,title:t}):navigator.share({title:t,url:a.url})).catch(()=>void 0),className:`flex flex-col items-center gap-1.5 text-[0.75rem] text-ink-2 hover:text-ink`,children:[(0,Z.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 transition hover:bg-paper-3`,children:(0,Z.jsx)(Mv,{className:`size-5`})}),Q(`shareRun.more`)]}):null]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[0.8125rem] text-ink-3`,children:[(0,Z.jsx)(`span`,{children:_?Q(`shareRun.until`,{date:_}):Q(`shareRun.kept`)}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>void m(),className:`shrink-0 hover:text-rose coarse:min-h-11`,children:Q(`shareRun.withdraw`)})]})]}):null})]})}function YE({runId:e,ask:t}){return t.kind===`confirm`?(0,Z.jsx)(XE,{runId:e,ask:t}):(0,Z.jsx)(ZE,{runId:e,ask:t})}function XE({runId:e,ask:t}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(null),c=async n=>{a(!0),s(null);try{await GE.post(`/api/runs/${e}/ask/${t.id}`,n)}catch(e){s(e.message),a(!1)}},l=t.action.destructive?Kv:vv;return(0,Z.jsxs)(`div`,{className:`animate-rise`,children:[(0,Z.jsxs)(`div`,{className:`mb-5 flex items-start gap-3`,children:[(0,Z.jsx)(`div`,{className:$(`flex size-10 shrink-0 items-center justify-center rounded-full`,t.action.destructive?`bg-rose-tint text-rose`:`bg-ember-tint text-ember-strong`),children:(0,Z.jsx)(l,{className:`size-5`})}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:Q(`ask.wants`,{service:t.service})}),(0,Z.jsx)(`h2`,{className:`font-display font-semibold text-[1.25rem] leading-snug tracking-tight`,children:t.reason})]})]}),(0,Z.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-xl bg-paper-2 p-4 text-[0.8125rem] leading-relaxed ring-1 ring-border-soft`,children:t.input}),(0,Z.jsxs)(`div`,{className:`mt-5 flex items-center gap-4`,children:[(0,Z.jsx)(Rb,{checked:n,onChange:r,label:Q(`ask.allowRest`)}),(0,Z.jsx)(`span`,{className:`flex-1 text-[0.8125rem] text-ink-2`,children:Q(`ask.allowRest`)})]}),o?(0,Z.jsx)(`div`,{className:`mt-3 rounded-lg bg-rose-tint px-4 py-3 text-[0.875rem] text-rose`,children:o}):null,(0,Z.jsxs)(`div`,{className:`action-bar mt-6 flex items-center justify-between gap-3`,children:[(0,Z.jsx)(kb,{variant:`ghost`,disabled:i,onClick:()=>void c({type:`skip`}),children:Q(`ask.deny`)}),(0,Z.jsx)(kb,{busy:i,onClick:()=>void c({type:`done`,remember:n}),children:Q(`ask.allow`)})]})]})}function ZE({runId:e,ask:t}){let[n,r]=(0,y.useState)({}),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(0),[f,p]=(0,y.useState)(``),[m,h]=(0,y.useState)(!1),g=(0,y.useRef)(null),_=(0,y.useCallback)(()=>d(e=>e+1),[]);(0,y.useEffect)(()=>{let e=setInterval(_,2500);return()=>clearInterval(e)},[_]);let v=async n=>{s(!0),l(null);try{await GE.post(`/api/runs/${e}/ask/${t.id}`,n)}catch(e){l(e.message),s(!1)}},b=async t=>{l(null);try{await GE.post(`/api/runs/${e}/browser/act`,t)}catch(e){l(e.message)}_()},x=e=>{let t=g.current;if(!t?.naturalWidth)return;let n=t.getBoundingClientRect();b({type:`click`,x:Math.round((e.clientX-n.left)/n.width*t.naturalWidth),y:Math.round((e.clientY-n.top)/n.height*t.naturalHeight)})},S=t.fields.some(e=>n[e.id]);return(0,Z.jsxs)(`div`,{className:`animate-rise`,children:[(0,Z.jsxs)(`div`,{className:`mb-5 flex items-start gap-3`,children:[(0,Z.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-ember-tint text-ember-strong`,children:(0,Z.jsx)(ev,{className:`size-5`})}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`h2`,{className:`font-display font-semibold text-[1.25rem] leading-snug tracking-tight`,children:t.reason}),(0,Z.jsxs)(`p`,{className:`mt-0.5 truncate text-[0.8125rem] text-ink-3`,children:[t.site.host,t.site.title?` · ${t.site.title}`:``]})]})]}),(0,Z.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-paper-2 ring-1 ring-border-soft`,children:[(0,Z.jsx)(`img`,{ref:g,src:NS(`/api/runs/${e}/browser/screen?t=${u}`),alt:t.site.host,onClick:x,className:`block w-full cursor-pointer`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-border-soft border-t bg-card p-2`,children:[(0,Z.jsx)(Nb,{type:m?`password`:`text`,autoComplete:`off`,value:f,placeholder:Q(`ask.typeInto`),onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),b({type:`type`,text:f}).then(()=>p(``)))},autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,enterKeyHint:`send`,className:`h-9 min-w-[9rem] flex-1 basis-full text-[0.8125rem] sm:basis-0 coarse:h-11`}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>h(e=>!e),className:$(`h-9 shrink-0 rounded-md px-2.5 text-[0.75rem] coarse:h-11 coarse:px-3.5`,m?`bg-ember-veil text-ink`:`text-ink-3 hover:bg-paper-2`),children:Q(`ask.hide`)}),(0,Z.jsx)(QE,{label:`Enter`,onClick:()=>void b({type:`key`,key:`Enter`}),children:(0,Z.jsx)(m_,{className:`size-4`})}),(0,Z.jsx)(QE,{label:Q(`ask.up`),onClick:()=>void b({type:`scroll`,dy:-500}),children:(0,Z.jsx)(Qg,{className:`size-4`})}),(0,Z.jsx)(QE,{label:Q(`ask.down`),onClick:()=>void b({type:`scroll`,dy:500}),children:(0,Z.jsx)(Kg,{className:`size-4`})})]})]}),(0,Z.jsx)(`p`,{className:`mt-2 text-[0.75rem] text-ink-4`,children:Q(`ask.pictureHint`)}),t.fields.length?(0,Z.jsxs)(`form`,{className:`mt-5 flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),v({type:`fill`,values:n,remember:i})},children:[t.fields.map((e,i)=>(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(zb,{children:e.label}),(0,Z.jsx)(Nb,{autoFocus:i===0,type:e.secret?`password`:`text`,autoComplete:`off`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,enterKeyHint:i===t.fields.length-1?`go`:`next`,value:n[e.id]??``,onChange:t=>r(n=>({...n,[e.id]:t.target.value}))})]},e.id)),(0,Z.jsx)(`button`,{type:`submit`,hidden:!0})]}):null,(0,Z.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-4`,children:[(0,Z.jsx)(Rb,{checked:i,onChange:a,label:Q(`ask.remember`)}),(0,Z.jsx)(`span`,{className:`flex-1 text-[0.8125rem] text-ink-2`,children:Q(`ask.remember`)})]}),(0,Z.jsxs)(`p`,{className:`mt-3 flex items-start gap-2 text-[0.8125rem] text-ink-3`,children:[(0,Z.jsx)(Iv,{className:`mt-0.5 size-4 shrink-0 text-moss`}),` `,Q(`ask.private`)]}),c?(0,Z.jsx)(`div`,{className:`mt-3 rounded-lg bg-rose-tint px-4 py-3 text-[0.875rem] text-rose`,children:c}):null,(0,Z.jsxs)(`div`,{className:`action-bar mt-6 flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsx)(kb,{variant:`ghost`,disabled:o,onClick:()=>void v({type:`skip`}),children:Q(`ask.skip`)}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.fields.length?(0,Z.jsx)(kb,{variant:`secondary`,disabled:o,onClick:()=>void v({type:`done`,remember:i}),children:Q(`ask.done`)}):null,t.fields.length?(0,Z.jsx)(kb,{busy:o,disabled:!S,onClick:()=>void v({type:`fill`,values:n,remember:i}),children:Q(`ask.signIn`)}):(0,Z.jsx)(kb,{busy:o,onClick:()=>void v({type:`done`,remember:i}),children:Q(`ask.done`)})]})]})]})}function QE({label:e,onClick:t,children:n}){return(0,Z.jsx)(`button`,{type:`button`,"aria-label":e,title:e,onClick:t,className:`flex size-9 shrink-0 items-center justify-center rounded-md text-ink-3 hover:bg-paper-2 hover:text-ink coarse:size-11`,children:n})}var $E=H({description:L().max(1024).optional(),edit:K([`inline`,`popout`]).optional(),id:L().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/,`column id must be a lowercase slug (a-z, 0-9, _)`),name:L().min(1).max(128),required:z().optional()}),eD=K([`integer`,`decimal`,`percent`,`currency`]),tD=H({currency:L().regex(/^[A-Z]{3}$/,`currency must be an ISO 4217 code`).optional(),fractionDigits:R().int().min(0).max(8).optional(),grouping:z().optional(),style:eD}).superRefine((e,t)=>{e.style===`currency`&&!e.currency&&t.addIssue({code:`custom`,message:`currency style needs an ISO 4217 code`,path:[`currency`]}),e.style!==`currency`&&e.currency&&t.addIssue({code:`custom`,message:`currency is only valid on currency columns`,path:[`currency`]})}),nD=K([`date`,`datetime`,`time`]),rD=K([`short`,`medium`,`long`,`iso`]),iD=K([`hours`,`minutes`,`seconds`]),aD=H({dateStyle:rD.optional(),kind:nD,timePrecision:iD.optional()}),oD=K([`milliseconds`,`seconds`,`minutes`,`hours`,`days`]),sD=K([`hms`,`hours`,`minutes`,`decimal-hours`,`iso`]),cD=H({display:sD,inputUnit:oD}),lD=H({id:L().min(1).max(64),label:L().min(1).max(128)}),uD=H({allowCustom:z(),multiple:z().optional(),options:V(lD).max(200)}),dD=H({style:K([`single`,`multiline`,`markdown`]).default(`single`)}),fD=V(zc(`type`,[$E.extend({format:dD.optional(),type:q(`text`)}),$E.extend({format:tD,type:q(`number`)}),$E.extend({format:aD,type:q(`date`)}),$E.extend({format:cD,type:q(`duration`)}),$E.extend({format:uD,type:q(`select`)}),$E.extend({type:q(`boolean`)})])).min(1).max(64).superRefine((e,t)=>{let n=new Set;for(let r=0;r<e.length;r++){let i=e[r]?.id;i&&(n.has(i)&&t.addIssue({code:`custom`,message:`duplicate column id "${i}"`,path:[r,`id`]}),n.add(i))}});H({description:L().optional(),edit:K([`inline`,`popout`]).optional(),format:H({allowCustom:z().optional(),currency:L().optional(),dateStyle:K([`short`,`medium`,`long`,`iso`]).optional(),display:sD.optional(),fractionDigits:R().int().optional(),grouping:z().optional(),inputUnit:oD.optional(),kind:nD.optional(),multiple:z().optional(),options:V(lD).optional(),style:K([`single`,`multiline`,`markdown`,`integer`,`decimal`,`percent`,`currency`]).optional(),timePrecision:iD.optional()}).optional(),id:L(),name:L(),required:z().optional(),type:K([`text`,`number`,`date`,`duration`,`select`,`boolean`])}),H({table_id:L().uuid()});var pD=36e5,mD=6e4,hD=1e3;function gD(e){return e.fractionDigits===void 0?e.style===`integer`?0:2:e.fractionDigits}function _D(e,t,n=`en`){if(typeof e!=`number`||!Number.isFinite(e))return``;let r=gD(t),i=t.grouping!==!1;return t.style===`percent`?new Intl.NumberFormat(n,{maximumFractionDigits:r,minimumFractionDigits:r,style:`percent`,useGrouping:i}).format(e):t.style===`currency`&&t.currency?new Intl.NumberFormat(n,{currency:t.currency,maximumFractionDigits:r,minimumFractionDigits:r,style:`currency`,useGrouping:i}).format(e):new Intl.NumberFormat(n,{maximumFractionDigits:r,minimumFractionDigits:r,useGrouping:i}).format(e)}function vD(e,t,n=`en`){if(typeof e!=`string`||e.length===0)return``;if(t.kind===`time`)return yD(e,t.timePrecision??`minutes`);if(t.dateStyle===`iso`)return t.kind===`date`?e.slice(0,10):e;let r=t.kind===`date`?new Date(`${e}T00:00:00`):new Date(e);if(Number.isNaN(r.getTime()))return e;let i=t.dateStyle??`medium`;if(t.kind===`date`)return new Intl.DateTimeFormat(n,{dateStyle:i}).format(r);let a=t.timePrecision??`minutes`;return new Intl.DateTimeFormat(n,{dateStyle:i,timeStyle:a===`hours`?`short`:`medium`}).format(r)}function yD(e,t){let[n=`0`,r=`00`,i=`00`]=e.split(`:`);return t===`hours`?`${n.padStart(2,`0`)}:00`:t===`minutes`?`${n.padStart(2,`0`)}:${r.padStart(2,`0`)}`:`${n.padStart(2,`0`)}:${r.padStart(2,`0`)}:${i.padStart(2,`0`)}`}function bD(e,t){if(typeof e!=`number`||!Number.isFinite(e))return``;let n=Math.max(0,Math.round(e));if(t.display===`iso`)return xD(n);if(t.display===`minutes`)return`${Math.round(n/mD)} min`;if(t.display===`hours`)return`${(n/pD).toFixed(2)} h`;if(t.display===`decimal-hours`)return(n/pD).toFixed(2);let r=Math.floor(n/pD),i=Math.floor(n%pD/mD),a=Math.floor(n%mD/hD);return`${r}:${String(i).padStart(2,`0`)}:${String(a).padStart(2,`0`)}`}function xD(e){let t=Math.floor(e/pD),n=Math.floor(e%pD/mD),r=Math.floor(e%mD/hD);return`${t>=24?`P${Math.floor(t/24)}D`:`P`}T${t%24}H${n}M${r}S`}function SD(e,t,n=`en`){if(t==null)return``;switch(e.type){case`number`:return _D(t,e.format,n);case`date`:return vD(t,e.format,n);case`duration`:return bD(t,e.format);case`boolean`:return t===!0?`true`:t===!1?`false`:``;case`select`:return CD(e,t);default:return String(t)}}function CD(e,t){let n=Array.isArray(t)?t:[t],r=e.format.options.reduce((e,t)=>(e[t.id]=t.label,e),{});return n.filter(e=>typeof e==`string`&&e.length>0).map(e=>r[e]??e).join(`, `)}var wD=[`mail`],TD=[`round`,`drop`,`dome`,`flame`,`oval`,`bean`,`pebble`,`sprout`,`tower`,`wedge`],ED=[`text`,`textarea`,`number`,`select`,`multiselect`,`date`,`email`,`url`,`toggle`,`color`,`image`,`file`,`items`,`connection`,`list`,`location`,`audio`,`signature`];function DD(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let{lat:t,lng:n,label:r}=e;return typeof t==`number`&&typeof n==`number`||typeof r==`string`&&r.trim().length>0}function OD(e){return!!(e&&typeof e==`object`&&typeof e.asset==`string`&&e.asset)}var kD=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`],AD=/^[a-z][a-z0-9-]{0,39}$/,jD=/^[a-z][a-z0-9_]{0,39}$/,MD=[`classifier`,`standard`,`high`,`highest`];[...MD];var ND=[`low`,`medium`,`high`],PD=[`image`,`video`,`voice`,`document`,`dashboard`],FD=[`png`,`mp4`,`mp3`,`pdf`,`docx`,`html`,`md`,`txt`,`csv`,`xlsx`,`json`,`zip`],ID=[`1:1`,`16:9`,`9:16`,`4:5`,`3:2`,`2:3`],LD=[`720p`,`480p`],RD=L().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,40}$/,`ids are letters, digits and _ and start with a letter`),zD=H({id:RD,label:L().min(1),kind:K([`text`,`number`,`money`])}),BD=H({id:RD,label:L().min(1),kind:K(ED),required:z().optional(),placeholder:L().optional(),help:L().optional(),options:V(L()).optional(),default:W([L(),R(),z(),V(L())]).optional(),columns:V(zD).optional(),vat:H({rate:R().optional(),field:L().optional()}).optional(),currency:L().optional(),multiple:z().optional(),min:R().int().min(1).max(30).optional(),max:R().int().min(1).max(30).optional(),camera:z().optional(),video:z().optional(),scan:z().optional(),connection:L().optional(),list:L().optional(),prefill:L().optional()}),VD=H({when:H({field:L(),op:K([`equals`,`notEquals`,`in`,`notEmpty`,`empty`]),value:W([L(),R(),z(),V(L())]).optional()}),goto:L()}),HD={id:RD,title:L().min(1),description:L().optional(),next:V(VD).optional()},UD=H({id:RD,kind:K([`text`,`number`,`list`,`table`,`yesno`,`choice`]),description:L().optional(),columns:V(L().min(1)).optional(),options:V(L().min(1)).min(2).max(40).optional()}).refine(e=>e.kind!==`choice`||!!e.options?.length,{message:`A choice field lists its options.`,path:[`options`]}),WD=H({...HD,type:q(`page`),fields:V(BD).min(1),cta:L().optional()}),GD=H({...HD,type:q(`agent`),instructions:L().min(1),tools:V(W([K(kD),fl([L().regex(AD),`.`,L().regex(jD)])])).default([]),mcp:V(L()).optional(),connections:V(L()).optional(),output:H({format:K([`text`,`markdown`,`json`]),fields:V(UD).optional()}).default({format:`markdown`}),model:K(MD).optional(),effort:K(ND).optional(),working:L().optional()}),KD=H({...HD,type:q(`generate`),asset:K(PD),prompt:L().min(1),options:H({aspectRatio:K(ID).optional(),duration:R().optional(),resolution:K(LD).optional(),style:L().optional(),template:K([`invoice`,`offer`,`briefing`,`letter`,`report`,`free`]).optional()}).optional(),referenceImage:L().optional(),each:L().optional(),model:K(MD).optional(),effort:K(ND).optional(),working:L().optional()}),qD=H({...HD,type:q(`widget`),entry:L().min(1),data:G(L(),L()).default({}),sample:L().optional(),size:H({width:R().int().min(200).max(3840),height:R().int().min(200).max(3840)}).optional(),video:z().optional(),working:L().optional()}),JD=H({...HD,type:q(`review`),show:V(L()).min(1),edit:z().optional(),regenerate:z().optional()}),YD=H({from:L(),label:L().optional(),formats:V(K(FD)).min(1)}),XD=zc(`type`,[WD,GD,KD,qD,JD,H({...HD,type:q(`result`),message:L().optional(),deliverables:V(YD)})]),ZD=H({id:RD,title:L().min(1),description:L().optional(),columns:fD,key:L().optional(),check:H({file:L().optional(),status:L().optional()}).optional(),shared:z().optional()}),QD=H({id:RD,kind:K(wD).optional(),connector:L().optional(),actions:V(L()).max(200).optional(),policy:G(L(),K([`allow`,`ask`])).optional(),title:L().optional(),description:L().optional()});H({version:q(1).default(1),title:L().min(1),description:L().default(``),avatar:K(TD).default(`round`),intro:L().optional(),lists:V(ZD).max(12).optional(),connections:V(QD).max(12).optional(),steps:V(XD).min(1)});function $D(e,t,n){let r=Array.isArray(t)?t:[],i=(e.columns??[]).filter(e=>e.kind!==`text`),a=r.map(e=>{let t=i.length?i.reduce((t,n)=>t*eO(e[n.id]),1):0;return{...e,amount:tO(t)}}),o=tO(a.reduce((e,t)=>e+t.amount,0)),s=e.vat?.rate??0;if(e.vat?.field){let t=n[e.vat.field],r=Number.parseFloat(String(t??``).replace(`,`,`.`));Number.isFinite(r)&&(s=r)}let c=tO(o*s/100);return{rows:a,net:o,vatRate:s,vat:c,gross:tO(o+c),currency:e.currency??`EUR`}}function eO(e){let t=Number(typeof e==`string`?e.replace(/\s/g,``).replace(`,`,`.`):e);return Number.isFinite(t)?t:0}function tO(e){return Math.round(e*100)/100}async function nO(e,t=2400){if(!/^image\/(jpeg|png|webp)$/.test(e.type)||e.size<12e5)return e;try{let n=await createImageBitmap(e),r=Math.min(1,t/Math.max(n.width,n.height)),i=document.createElement(`canvas`);i.width=Math.round(n.width*r),i.height=Math.round(n.height*r),i.getContext(`2d`)?.drawImage(n,0,0,i.width,i.height);let a=await new Promise(e=>i.toBlob(e,`image/jpeg`,.86));return a&&a.size<e.size?new File([a],`${e.name.replace(/\.[^.]+$/,``)}.jpg`,{type:`image/jpeg`}):e}catch{return e}}function rO(){return new Date().toISOString().slice(0,19).replace(/[:T]/g,`-`)}function iO(e){let t=e?.name;return t===`NotFoundError`||t===`OverconstrainedError`?`missing`:t===`NotReadableError`||t===`AbortError`?`busy`:`denied`}function aO(e){return!!e?.getCapabilities?.()?.torch}function oO(e,t,n=!1){let r=(0,y.useRef)(null),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)(1),[u,d]=(0,y.useState)(!1),[f,p]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{if(!e)return;let r=null,i=!1;s(null),a(null),d(!1),p(!1);let o={facingMode:{ideal:t},width:{ideal:2560},height:{ideal:1440}};return(async()=>{if(!navigator.mediaDevices?.getUserMedia)throw new DOMException(`no camera api`,`NotAllowedError`);try{r=await navigator.mediaDevices.getUserMedia({video:o,audio:n})}catch(e){if(!n)throw e;r=await navigator.mediaDevices.getUserMedia({video:o})}if(i){for(let e of r.getTracks())e.stop();return}a(r);let e=r.getVideoTracks()[0],t=()=>!i&&d(aO(e));t(),setTimeout(t,600);let s=await navigator.mediaDevices.enumerateDevices().catch(()=>[]);i||l(s.filter(e=>e.kind===`videoinput`).length)})().catch(e=>!i&&s(iO(e))),()=>{i=!0;for(let e of r?.getTracks()??[])e.stop()}},[e,t,n]),(0,y.useEffect)(()=>{r.current&&i&&(r.current.srcObject=i)},[i]),{video:r,stream:i,error:o,cameras:c,torchable:u,torch:f,setTorch:async e=>{let t=i?.getVideoTracks()[0];try{await t?.applyConstraints({advanced:[{torch:e}]}),p(e)}catch{d(!1)}},mirrored:i?.getVideoTracks()[0]?.getSettings().facingMode===`user`}}function sO({open:e,onClose:t,label:n,children:r}){let i=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=i.current;t&&(e&&!t.open?t.showModal():!e&&t.open&&t.close())},[e]),(0,Z.jsx)(`dialog`,{ref:i,onClose:t,"aria-label":n,className:`media-sheet`,children:e?(0,Z.jsx)(`div`,{className:`flex h-full flex-col`,children:r}):null})}function cO({label:e,onClick:t,active:n,children:r}){return(0,Z.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"aria-pressed":n,onClick:t,className:$(`flex size-11 shrink-0 items-center justify-center rounded-full transition`,n?`bg-white text-black`:`bg-white/12 text-white hover:bg-white/20`),children:r})}function lO({title:e,onClose:t,camera:n,onFlip:r}){return(0,Z.jsx)(`div`,{className:`safe-top`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,Z.jsx)(cO,{label:Q(`common.close`),onClick:t,children:(0,Z.jsx)(iy,{className:`size-5`})}),(0,Z.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-center font-medium text-[0.9375rem]`,children:e}),n.torchable?(0,Z.jsx)(cO,{label:Q(`camera.torch`),active:n.torch,onClick:()=>void n.setTorch(!n.torch),children:n.torch?(0,Z.jsx)(I_,{className:`size-5`}):(0,Z.jsx)(P_,{className:`size-5`})}):null,n.stream&&(n.cameras>1||cE)?(0,Z.jsx)(cO,{label:Q(`camera.flip`),onClick:r,children:(0,Z.jsx)(Hv,{className:`size-5`})}):(0,Z.jsx)(`span`,{className:`size-11`})]})})}function uO({camera:e,asking:t,children:n,actions:r}){return(0,Z.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[(0,Z.jsx)(`video`,{ref:e.video,autoPlay:!0,playsInline:!0,muted:!0,className:$(`absolute inset-0 size-full object-contain`,e.mirrored&&`-scale-x-100`)}),e.error?(0,Z.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-5 bg-black px-8 text-center`,children:[(0,Z.jsx)(`p`,{className:`max-w-sm text-[0.9375rem] text-white/85 leading-relaxed`,children:Q(`camera.${e.error}`)}),r]}):e.stream?n:(0,Z.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-4 px-8 text-center text-white/75`,children:[(0,Z.jsx)(Bb,{}),(0,Z.jsx)(`p`,{className:`max-w-xs text-[0.875rem] leading-relaxed`,children:t})]})]})}var dO=30;function fO(){if(typeof MediaRecorder<`u`)return[`video/mp4;codecs=avc1.42E01E,mp4a.40.2`,`video/mp4`,`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`,`video/webm`].find(e=>MediaRecorder.isTypeSupported(e))}var pO=!!fO();function mO({open:e,multiple:t,video:n,onClose:r,onCapture:i,onNative:a}){let[o,s]=(0,y.useState)(`environment`),[c,l]=(0,y.useState)(`photo`),[u,d]=(0,y.useState)(0),[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(null),g=(0,y.useRef)(null),_=oO(e,o,c===`video`);(0,y.useEffect)(()=>{e&&(d(0),l(`photo`),h(null))},[e]);let v=async e=>{p(!0);try{await i(e),d(e=>e+1),t||r()}finally{p(!1)}},b=async()=>{let e=_.video.current;if(!e?.videoWidth)return;let t=document.createElement(`canvas`);t.width=e.videoWidth,t.height=e.videoHeight,t.getContext(`2d`)?.drawImage(e,0,0);let n=await new Promise(e=>t.toBlob(e,`image/jpeg`,.9));n&&await v(new File([n],`foto-${rO()}.jpg`,{type:`image/jpeg`}))},x=()=>{g.current?.state===`recording`&&g.current.stop()},S=()=>{let e=fO();if(!_.stream||!e)return;let t=[],n=new MediaRecorder(_.stream,{mimeType:e,videoBitsPerSecond:25e5,audioBitsPerSecond:96e3});n.ondataavailable=e=>e.data.size&&t.push(e.data),n.onstop=()=>{h(null),g.current=null;let n=e.split(`;`)[0];if(t.length){let e=n===`video/mp4`?`mp4`:`webm`;v(new File(t,`video-${rO()}.${e}`,{type:n}))}},g.current=n,n.start(1e3),h(0)};(0,y.useEffect)(()=>{if(m===null)return;if(m>=dO){g.current?.state===`recording`&&g.current.stop();return}let e=setTimeout(()=>h(e=>e===null?null:e+1),1e3);return()=>clearTimeout(e)},[m]),(0,y.useEffect)(()=>{!e&&g.current&&(g.current.onstop=null,g.current.stop(),g.current=null)},[e]);let C=e=>`0:${String(e).padStart(2,`0`)}`;return(0,Z.jsxs)(sO,{open:e,onClose:r,label:Q(`camera.title`),children:[(0,Z.jsx)(lO,{title:m===null?u?Q(`camera.taken`,{n:u}):Q(`camera.title`):`${C(m)} / ${C(dO)}`,onClose:r,camera:_,onFlip:()=>s(e=>e===`environment`?`user`:`environment`)}),(0,Z.jsx)(uO,{camera:_,asking:Q(`camera.asking`),actions:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a?(0,Z.jsxs)(hO,{onClick:()=>{r(),a()},children:[(0,Z.jsx)(o_,{className:`size-4`}),` `,Q(cE?`camera.native`:`camera.pick`)]}):null,(0,Z.jsx)(hO,{quiet:!0,onClick:r,children:Q(`common.close`)})]})}),(0,Z.jsxs)(`div`,{className:$(`safe-bottom px-4 pt-3`,_.error&&`invisible`),children:[n&&pO&&m===null?(0,Z.jsx)(`div`,{className:`mb-3 flex justify-center gap-1 text-[0.8125rem]`,children:[`photo`,`video`].map(e=>(0,Z.jsx)(`button`,{type:`button`,"aria-pressed":c===e,onClick:()=>l(e),className:$(`h-9 rounded-full px-4 font-medium transition`,c===e?`bg-white text-black`:`text-white/70 hover:text-white`),children:Q(e===`photo`?`camera.photo`:`camera.video`)},e))}):null,(0,Z.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_1fr] items-center gap-3`,children:[(0,Z.jsx)(`span`,{className:`text-[0.8125rem] text-white/70 leading-snug`,children:m===null?c===`video`?Q(`camera.clipHint`,{s:dO}):Q(t?`camera.hintMany`:`camera.hint`):Q(`camera.recording`)}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":Q(c===`photo`?`camera.shoot`:m===null?`camera.record`:`camera.stop`),disabled:!_.stream||f,onClick:()=>c===`photo`?void b():m===null?S():x(),className:`flex size-[72px] items-center justify-center rounded-full border-4 border-white transition active:scale-95 disabled:opacity-40`,children:f?(0,Z.jsx)(Bb,{className:`text-white`}):c===`photo`?(0,Z.jsx)(`span`,{className:`size-[54px] rounded-full bg-white`}):m===null?(0,Z.jsx)(`span`,{className:`flex size-[54px] items-center justify-center rounded-full bg-[#e5484d]`,children:(0,Z.jsx)(Qv,{className:`size-6 text-white`})}):(0,Z.jsx)(`span`,{className:`size-7 rounded-md bg-[#e5484d]`})}),(0,Z.jsx)(`div`,{className:`flex justify-end`,children:t&&u&&m===null?(0,Z.jsxs)(hO,{onClick:r,children:[(0,Z.jsx)(c_,{className:`size-4`}),` `,Q(`camera.done`)]}):null})]})]})]})}function hO({onClick:e,quiet:t,children:n}){return(0,Z.jsx)(`button`,{type:`button`,onClick:e,className:$(`inline-flex h-11 items-center justify-center gap-2 rounded-full px-5 font-medium text-[0.875rem] transition`,t?`text-white/75 hover:text-white`:`bg-white text-black hover:bg-white/90`),children:n})}var gO=25,_O=9e3;function vO(e){return e.code===e.PERMISSION_DENIED?`denied`:e.code===e.TIMEOUT?`timeout`:`unavailable`}function yO({value:e,runId:t,placeholder:n,onChange:r,onBusy:i}){let a=DD(e)?e:null,[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),u=(0,y.useRef)(null),d=(0,y.useRef)(!!a?.label),f=(0,y.useRef)(a);f.current=a;let p=a?.lat!==void 0&&a.lng!==void 0,m=typeof navigator<`u`&&`geolocation`in navigator,h=()=>{u.current!==null&&(navigator.geolocation.clearWatch(u.current),u.current=null),s(!1),i?.(!1)};(0,y.useEffect)(()=>()=>{u.current!==null&&navigator.geolocation.clearWatch(u.current)},[]);let g=async(e,n)=>{try{let{label:i}=await GE.post(`/api/runs/${t}/geocode`,{lat:e,lng:n,language:pb}),a=f.current;i&&!d.current&&a?.lat===e&&a.lng===n&&r({...a,label:i})}catch{}},_=()=>{l(null),s(!0),i?.(!0);let e=Date.now(),t=1/0;u.current=navigator.geolocation.watchPosition(n=>{let{latitude:i,longitude:a,accuracy:o}=n.coords;if(o<t){t=o;let e=Math.round(i*1e6)/1e6,n=Math.round(a*1e6)/1e6,s=d.current?f.current?.label:void 0,c={lat:e,lng:n,accuracy:Math.round(o),...s?{label:s}:{}};f.current=c,r(c)}if(t<=gO||Date.now()-e>_O){h();let e=f.current;e?.lat!==void 0&&e.lng!==void 0&&g(e.lat,e.lng)}},e=>{h(),t===1/0&&l(vO(e))},{enableHighAccuracy:!0,timeout:15e3,maximumAge:1e4})},v=e=>{d.current=e.trim().length>0;let t={...p?a:{},label:e};r(p||e.trim()?t:void 0)};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[p?(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,Z.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-moss-tint text-moss`,children:(0,Z.jsx)(iv,{className:`size-5`})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`truncate font-medium text-[0.9375rem] tabular-nums`,children:[a.lat?.toFixed(5),`, `,a.lng?.toFixed(5)]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 text-[0.8125rem] text-ink-3`,children:[(0,Z.jsx)(`span`,{children:o?Q(`location.refining`):a.accuracy?Q(`location.accuracy`,{m:a.accuracy}):null}),(0,Z.jsxs)(`a`,{href:`https://www.openstreetmap.org/?mlat=${a.lat}&mlon=${a.lng}#map=17/${a.lat}/${a.lng}`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 underline-offset-2 hover:text-ink hover:underline coarse:-my-3 coarse:min-h-11 coarse:min-w-11`,children:[Q(`location.map`),` `,(0,Z.jsx)(S_,{className:`size-3`})]})]})]}),(0,Z.jsx)(Ab,{label:Q(`location.remove`),onClick:()=>{h(),d.current=!1,r(void 0)},children:(0,Z.jsx)(iy,{className:`size-4`})})]}):m?(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(kb,{variant:`secondary`,size:`lg`,busy:o,onClick:_,className:`w-full sm:w-auto`,children:[o?null:(0,Z.jsx)(Q_,{className:`size-4`}),Q(o?`location.locating`:`location.use`)]}),c?(0,Z.jsx)(`p`,{className:`mt-2 rounded-lg bg-amber-tint px-3 py-2 text-[0.8125rem] text-ink-2 leading-relaxed`,children:Q(`location.${c}`)}):(0,Z.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3 leading-relaxed`,children:Q(`location.why`)})]}):null,(0,Z.jsx)(Nb,{value:a?.label??``,placeholder:n??Q(p?`location.label`:`location.manual`),autoComplete:`street-address`,enterKeyHint:`done`,"aria-label":Q(`location.manual`),onChange:e=>v(e.target.value)})]})}var bO=c({createWorker:()=>xO}),xO,SO=o((()=>{xO=()=>new Worker(URL.createObjectURL(new Blob([`class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}
|
|
637
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${RT(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?RT(n,!0):this.parser.parseInline(r),o=BT(e);if(o===null)return a;e=RT(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+RT(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=BT(e);if(i===null)return RT(n);e=i;let a=`<img src="${RT(e)}" alt="${RT(n)}"`;return t&&(a+=` title="${RT(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:RT(e.text)}},$T=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},eE=class e{options;renderer;textRenderer;constructor(e){this.options=e||mw,this.options.renderer=this.options.renderer||new QT,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $T}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},tE=class{options;block;constructor(e){this.options=e||mw}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ZT.lex:ZT.lexInline}provideParser(e=this.block){return e?eE.parse:eE.parseInline}},nE=new class{defaults=pw();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=eE;Renderer=QT;TextRenderer=$T;Lexer=ZT;Tokenizer=XT;Hooks=tE;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new QT(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new XT(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new tE;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=tE.passThroughHooks.has(n)?e=>{if(this.defaults.async&&tE.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ZT.lex(e,t??this.defaults)}parser(e,t){return eE.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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 t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?ZT.lex:ZT.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?eE.parse:eE.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?ZT.lex:ZT.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?eE.parse:eE.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
638
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+RT(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function rE(e,t){return nE.parse(e,t)}rE.options=rE.setOptions=function(e){return nE.setOptions(e),rE.defaults=nE.defaults,hw(rE.defaults),rE},rE.getDefaults=pw,rE.defaults=mw;function iE(...e){return nE.use(...e),rE.defaults=nE.defaults,hw(rE.defaults),rE}rE.use=iE,rE.walkTokens=function(e,t){return nE.walkTokens(e,t)},rE.parseInline=nE.parseInline,rE.Parser=eE,rE.parser=eE.parse,rE.Renderer=QT,rE.TextRenderer=$T,rE.Lexer=ZT,rE.lexer=ZT.lex,rE.Tokenizer=XT,rE.Hooks=tE,rE.parse=rE,rE.options,rE.setOptions,rE.walkTokens,rE.parseInline,eE.parse,ZT.lex;function aE(){if(typeof window>`u`)return null;let e=window.engentyApp;return e&&typeof e.call==`function`&&Array.isArray(e.can)?e:null}var oE=aE();(oE!==null||typeof window<`u`&&new URLSearchParams(window.location.search).get(`app`)===`1`)&&typeof document<`u`&&document.documentElement.classList.add(`in-app`);var sE=e=>oE?.can.includes(e)===!0;function cE(e,t){return oE&&sE(e)?oE.call(e,t):Promise.reject(Error(`the app cannot ${e}`))}function lE(e,t){sE(e)&&cE(e,t).catch(()=>void 0)}function uE(e,t,n){return sE(`download`)?(e.preventDefault(),cE(`download`,{url:new URL(t,window.location.href).href,filename:n}).catch(()=>void 0),!0):!1}var dE=typeof window<`u`&&window.matchMedia?.(`(pointer: coarse)`).matches===!0,fE=typeof navigator<`u`&&!!navigator.mediaDevices?.getUserMedia;function pE(){(0,y.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let t=document.documentElement,n=()=>{let n=e.scale>1.01?0:window.innerHeight-e.height-e.offsetTop,r=n>80;t.style.setProperty(`--kb`,r?`${Math.round(n)}px`:`0px`),t.classList.toggle(`keyboard-open`,r)};return n(),e.addEventListener(`resize`,n),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`resize`,n),e.removeEventListener(`scroll`,n),t.style.removeProperty(`--kb`),t.classList.remove(`keyboard-open`)}},[])}function mE(e){let[t,n]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{if(e&&sE(`keepAwake`))return lE(`keepAwake`,!0),n(!0),()=>{lE(`keepAwake`,!1),n(!1)};if(!e||!(`wakeLock`in navigator))return;let t=null,r=!1,i=async()=>{if(!(r||t||document.visibilityState!==`visible`))try{let e=await navigator.wakeLock.request(`screen`);if(r){e.release().catch(()=>void 0);return}t=e,n(!0),e.addEventListener(`release`,()=>{t===e&&(t=null,n(!1))})}catch{}};return i(),document.addEventListener(`visibilitychange`,i),()=>{r=!0,document.removeEventListener(`visibilitychange`,i),t?.release().catch(()=>void 0),t=null,n(!1)}},[e]),t}var hE=`wz.notify`,gE=new Set,_E=null;function vE(){try{return localStorage.getItem(hE)===`1`}catch{return!1}}function yE(e){try{e?localStorage.setItem(hE,`1`):localStorage.removeItem(hE)}catch{}for(let e of gE)e()}var bE=typeof window<`u`&&`Notification`in window,xE=null;function SE(){return vE()?sE(`notify`)?xE===!1?`quiet`:`on`:bE&&Notification.permission===`granted`?`on`:`quiet`:`off`}function CE(){return(0,y.useSyncExternalStore)(e=>(gE.add(e),()=>gE.delete(e)),SE,()=>`off`)}function wE(){return sE(`notify`)?xE===!1:bE&&Notification.permission===`denied`}async function TE(){if(yE(!0),sE(`notify`)){xE=!sE(`notifyPermission`)||await cE(`notifyPermission`).catch(()=>!1);for(let e of gE)e();return SE()}try{_E??=new AudioContext,_E.resume()}catch{_E=null}if(bE&&Notification.permission==="default")try{await Notification.requestPermission()}catch{}bE&&Notification.permission===`granted`&&await navigator.serviceWorker?.register(`${NS}/sw.js`).catch(()=>void 0);for(let e of gE)e();return SE()}function EE(){yE(!1)}function DE(){let e=_E;if(e?.state!==`running`)return;let t=e.currentTime;for(let[n,r]of[660,880].entries()){let i=e.createOscillator(),a=e.createGain();i.frequency.value=r,a.gain.setValueAtTime(0,t+n*.16),a.gain.linearRampToValueAtTime(.18,t+n*.16+.02),a.gain.exponentialRampToValueAtTime(.001,t+n*.16+.32),i.connect(a).connect(e.destination),i.start(t+n*.16),i.stop(t+n*.16+.34)}}async function OE(e){if(!vE())return;if(sE(`notify`)){lE(`notify`,e);return}if(document.visibilityState===`visible`){DE(),navigator.vibrate?.([120,60,120]);return}if(!bE||Notification.permission!==`granted`)return;let t={body:e.body,tag:e.tag,icon:LS(`icons/icon-192.png`),badge:LS(`icons/icon-192.png`),data:{url:location.href}};try{let n=await navigator.serviceWorker?.getRegistration();if(n?.active){await n.showNotification(e.title,t);return}}catch{}try{new Notification(e.title,t)}catch{}}function kE(){if(typeof navigator>`u`||!navigator.canShare)return!1;try{return navigator.canShare({files:[new File([`x`],`x.pdf`,{type:`application/pdf`})]})}catch{return!1}}function AE({text:e,className:t}){let n=(0,y.useMemo)(()=>fw.sanitize(rE.parse(e,{async:!1})),[e]);return(0,Z.jsx)(`div`,{className:$(`prose-zen`,t),dangerouslySetInnerHTML:{__html:n}})}function jE({src:e,page:t,height:n,fit:r}){let i=(0,y.useRef)(null),[a,o]=(0,y.useState)(0);(0,y.useEffect)(()=>{let e=i.current;if(!e)return;let t=new ResizeObserver(()=>o(e.clientWidth));return t.observe(e),o(e.clientWidth),()=>t.disconnect()},[]);let[s,c]=(0,y.useState)(null);(0,y.useEffect)(()=>{let t=!0;return fetch(e,{credentials:`include`}).then(e=>e.ok?e.text():``).then(n=>t&&c({src:e,text:n})),()=>{t=!1}},[e]);let l=t??Math.max(a,900),u=a?r?a/l:Math.min(1,a/l):1;return(0,Z.jsxs)(`div`,{ref:i,className:`relative overflow-hidden rounded-lg bg-white ring-1 ring-border-soft`,style:{height:n*u},children:[s?.src===e?(0,Z.jsx)(`iframe`,{title:`preview`,srcDoc:s.text,sandbox:`allow-scripts allow-popups allow-popups-to-escape-sandbox`,className:`absolute top-0 left-0 origin-top-left border-0`,style:{width:l,height:n,transform:`scale(${u})`}},e):(0,Z.jsx)(`div`,{className:`absolute inset-0 animate-pulse bg-paper-2`}),(0,Z.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`absolute top-3 right-3 inline-flex size-9 items-center justify-center rounded-full bg-card/90 text-ink-2 shadow-soft ring-1 ring-border-soft backdrop-blur hover:text-ink coarse:size-11`,"aria-label":Q(`run.openFull`),children:(0,Z.jsx)(cv,{className:`size-4`})})]})}var ME={disc:{file:`ai`,box:566.93,x:89.28,y:100.72,w:365.49,h:365.49},generated:{file:`ai-generated`,box:1789.84,x:207.3,y:144.36,w:1384.24,h:266.41},edited:{file:`ai-modified`,box:1700.79,x:231.11,y:144.36,w:1230.56,h:266.41}};function NE({icon:e,tone:t,size:n,className:r}){let i=ME[e],a=n/i.h;return(0,Z.jsx)(`img`,{src:LS(`ai-labels/${i.file}-${t}.svg`),alt:``,draggable:!1,className:$(`pointer-events-none absolute max-w-none select-none`,r),style:{width:i.box*a,height:566.93*a,left:-i.x*a,top:-i.y*a}})}function PE({ai:e,className:t}){let[n,r]=(0,y.useState)(!1);if(!e)return null;let i=ME[e],a=t===`static`,o=a?[[`black`,`dark:hidden`],[`white`,`hidden dark:block`]]:[[`white`,``]];return(0,Z.jsx)(`button`,{type:`button`,"aria-label":Q(e===`edited`?`ai.modified`:`ai.generated`),"aria-expanded":n,"data-open":n,onClick:()=>r(e=>!e),className:$(`group block cursor-default overflow-hidden rounded-full backdrop-blur-md transition-[width] duration-200`,`w-[var(--ai-disc)] hover:w-[var(--ai-long)] focus-visible:w-[var(--ai-long)] data-[open=true]:w-[var(--ai-long)]`,a?`relative`:$(`absolute shadow-[0_1px_3px_rgba(0,0,0,0.25)]`,t??`bottom-2 left-2`)),style:{height:18,"--ai-disc":`18px`,"--ai-long":`${i.w/i.h*18}px`},children:o.map(([t,r])=>(0,Z.jsxs)(`span`,{className:r,children:[(0,Z.jsx)(NE,{icon:`disc`,tone:t,size:18,className:$(`transition-opacity duration-200`,n?`opacity-0`:`opacity-100 group-hover:opacity-0 group-focus-visible:opacity-0`)}),(0,Z.jsx)(NE,{icon:e,tone:t,size:18,className:$(`transition-opacity duration-200`,n?`opacity-100`:`opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100`)})]},t))})}function FE(e,t){return e.type===`agent`?e.output.fields?.find(e=>e.id===t)?.description??t:t}function IE({step:e,json:t}){return!t||typeof t!=`object`?(0,Z.jsx)(`pre`,{className:`text-[0.8125rem]`,children:JSON.stringify(t,null,2)}):(0,Z.jsx)(`div`,{className:`flex flex-col gap-4`,children:Object.entries(t).map(([t,n])=>(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`mb-1 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:FE(e,t)}),typeof n==`boolean`?(0,Z.jsx)(`div`,{className:`text-[0.9375rem]`,children:Q(n?`run.yes`:`run.no`)}):typeof n==`string`||typeof n==`number`?(0,Z.jsx)(`div`,{className:`whitespace-pre-wrap text-[0.9375rem]`,children:String(n)}):Array.isArray(n)&&n.every(e=>typeof e!=`object`)?(0,Z.jsx)(`ul`,{className:`list-disc pl-5 text-[0.875rem]`,children:n.map((e,t)=>(0,Z.jsx)(`li`,{className:`break-words`,children:String(e)},t))}):Array.isArray(n)&&n.length&&typeof n[0]==`object`?(0,Z.jsx)(LE,{rows:n}):(0,Z.jsx)(`pre`,{className:`overflow-auto rounded-lg bg-paper-2 p-3 text-[0.75rem]`,children:JSON.stringify(n,null,2)})]},t))})}function LE({rows:e}){let t=[...new Set(e.flatMap(e=>Object.keys(e)))];return(0,Z.jsx)(`div`,{className:`overflow-x-auto rounded-lg ring-1 ring-border-soft`,children:(0,Z.jsxs)(`table`,{className:`w-full text-[0.8125rem]`,children:[(0,Z.jsx)(`thead`,{className:`bg-paper-2 text-ink-2`,children:(0,Z.jsx)(`tr`,{children:t.map(e=>(0,Z.jsx)(`th`,{className:`px-3 py-2 text-left font-medium`,children:e},e))})}),(0,Z.jsx)(`tbody`,{children:e.map((e,n)=>(0,Z.jsx)(`tr`,{className:`border-border-soft border-t`,children:t.map(t=>(0,Z.jsx)(`td`,{className:`px-3 py-2 tabular-nums`,children:e[t]===null||e[t]===void 0?``:String(e[t])},t))},n))})]})})}function RE({text:e}){let[t,n]=(0,y.useState)(!1);return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)},className:`inline-flex h-8 items-center gap-1.5 rounded-full bg-paper-2 px-3 text-[0.8125rem] text-ink-2 hover:text-ink coarse:h-11 coarse:px-4`,children:[t?(0,Z.jsx)(c_,{className:`size-3.5`}):(0,Z.jsx)(m_,{className:`size-3.5`}),Q(t?`share.copied`:`run.copy`)]})}function zE({base:e,step:t,output:n,editable:r,draft:i,onDraft:a,picked:o,onPick:s}){if(!n)return null;let c=t=>IS(`${e}/assets/${t}`);if(t.type===`widget`||t.type===`film`){let e=n.assets?.find(e=>e.kind===`video`);if(e){let r=n.assets?.find(e=>e.kind===`poster`),i=t.type===`film`?t.format===`9:16`:(t.size?.height??0)>(t.size?.width??1);return(0,Z.jsxs)(`div`,{className:$(`relative mx-auto`,i?`w-fit`:`w-full`),children:[(0,Z.jsx)(`video`,{src:c(e.id),poster:r?c(r.id):void 0,controls:!0,playsInline:!0,className:$(`rounded-lg bg-black ring-1 ring-border-soft`,i?`max-h-[76vh]`:`w-full`)}),(0,Z.jsx)(PE,{ai:e.ai,className:`top-2 right-2`})]})}if(t.type===`film`)return null;let r=n.assets?.find(e=>e.mime===`text/html`),i=t.size??{width:1280,height:720};return r?(0,Z.jsx)(jE,{src:c(r.id),page:i.width,height:i.height,fit:!0}):null}if(t.type===`generate`){let e=n.assets?.[0];if(!e)return null;if(t.asset===`voice`)return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(`audio`,{src:c(e.id),controls:!0,className:`w-full`}),(0,Z.jsx)(PE,{ai:e.ai,className:`static`}),n.text?(0,Z.jsx)(`p`,{className:`text-[0.875rem] text-ink-2 leading-relaxed`,children:n.text}):null]});if((n.assets?.length??0)>1&&(t.asset===`image`||t.asset===`video`)){let e=t.options?.aspectRatio===`9:16`||t.options?.aspectRatio===`2:3`;return(0,Z.jsx)(`div`,{className:$(`grid gap-3`,e?`grid-cols-2 sm:grid-cols-3`:`sm:grid-cols-2`),children:n.assets?.map((e,n)=>{let r=o?.includes(n);return(0,Z.jsxs)(`figure`,{className:$(`relative overflow-hidden rounded-lg bg-paper-2 ring-1 ring-border-soft`,r&&`ring-2 ring-ember`),children:[t.asset===`image`?(0,Z.jsx)(`img`,{src:c(e.id),alt:`${t.title} ${n+1}`,className:`w-full`}):(0,Z.jsx)(`video`,{src:c(e.id),controls:!0,playsInline:!0,loop:!0,className:`w-full`}),s?(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>s(n),className:$(`absolute top-2 left-2 inline-flex h-8 items-center gap-1.5 rounded-full px-3 font-medium text-[0.75rem] shadow-soft backdrop-blur coarse:h-11`,r?`bg-ember text-white`:`bg-card/90 text-ink-2 hover:text-ink`),children:[r?(0,Z.jsx)(c_,{className:`size-3.5`}):null,Q(r?`run.pickedItem`:`run.pickItem`,{n:n+1})]}):(0,Z.jsx)(`span`,{className:`absolute top-2 left-2 rounded-full bg-card/90 px-2.5 py-1 font-medium text-[0.75rem] text-ink-2`,children:n+1}),(0,Z.jsx)(PE,{ai:e.ai,className:t.asset===`image`?`bottom-2 left-2`:`top-2 right-2`})]},e.id)})})}if(t.asset===`image`)return(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`img`,{src:c(e.id),alt:t.title,className:`w-full rounded-lg bg-paper-2 ring-1 ring-border-soft`}),(0,Z.jsx)(PE,{ai:e.ai})]});if(t.asset===`video`){let n=t.options?.aspectRatio===`9:16`;return(0,Z.jsxs)(`div`,{className:$(`relative mx-auto`,n?`w-fit`:`w-full`),children:[(0,Z.jsx)(`video`,{src:c(e.id),controls:!0,playsInline:!0,loop:!0,className:$(`rounded-lg bg-black ring-1 ring-border-soft`,n?`max-h-[70vh]`:`w-full`)}),(0,Z.jsx)(PE,{ai:e.ai,className:`top-2 left-2`})]})}return t.asset===`document`?(0,Z.jsx)(jE,{src:c(e.id),page:820,height:1100}):(0,Z.jsx)(jE,{src:c(e.id),page:null,height:760})}if(t.type===`agent`){let e=n.assets?.filter(e=>e.kind!==`file`&&e.mime.startsWith(`image/`))??[],o=n.assets?.filter(e=>e.kind===`file`)??[];return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[t.output.format===`json`&&n.json!==void 0?(0,Z.jsx)(IE,{step:t,json:n.json}):r?(0,Z.jsx)(Lb,{value:i??n.text??``,onChange:e=>a?.(e.target.value),minRows:4,maxRows:24}):t.output.format===`markdown`?(0,Z.jsx)(AE,{text:n.text??``}):(0,Z.jsx)(`div`,{className:`whitespace-pre-wrap text-[1rem] leading-relaxed`,children:n.text}),e.map(e=>(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`img`,{src:c(e.id),alt:``,className:`w-full rounded-lg ring-1 ring-border-soft`}),(0,Z.jsx)(PE,{ai:e.ai})]},e.id)),o.length?(0,Z.jsx)(`ul`,{className:`overflow-hidden rounded-lg ring-1 ring-border-soft`,children:o.map(e=>(0,Z.jsx)(`li`,{className:`border-border-soft border-b last:border-0`,children:(0,Z.jsxs)(`a`,{href:c(e.id),download:e.name,onClick:t=>uE(t,c(e.id),e.name),className:`flex items-center gap-2 px-3 py-2 text-[0.8125rem] hover:bg-paper-2 coarse:min-h-11`,children:[(0,Z.jsx)(A_,{className:`size-3.5 shrink-0 text-ink-3`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name})]})},e.id))}):null,t.output.format!==`json`&&!r&&n.text?(0,Z.jsx)(`div`,{children:(0,Z.jsx)(RE,{text:n.text})}):null]})}return null}var BE={png:`PNG`,mp4:`MP4`,mp3:`MP3`,pdf:`PDF`,docx:`Word`,html:`HTML`,md:`Markdown`,txt:`Text`,csv:`CSV`,xlsx:`Excel`,json:`JSON`,zip:`ZIP`};function VE(e,t){return(e.headers.get(`content-disposition`)??``).match(/filename="([^"]+)"/)?.[1]??t}function HE({url:e,format:t,title:n}){let[r,i]=(0,y.useState)(`idle`),a=(0,y.useRef)(null),o=async()=>{if(sE(`share`)){i(`busy`),await cE(`share`,{url:new URL(e,location.href).href,title:n}).catch(()=>void 0),i(`idle`);return}try{if(!a.current){i(`busy`);let n=await fetch(e,{credentials:`include`});if(!n.ok)throw Error(String(n.status));let r=await n.blob();a.current=new File([r],VE(n,`download.${t}`),{type:r.type.split(`;`)[0]})}let r={files:[a.current],title:n};if(!navigator.canShare(r)){location.href=e,i(`idle`);return}await navigator.share(r),i(`idle`)}catch(e){i(a.current&&e.name===`NotAllowedError`?`ready`:`idle`)}};return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>void o(),disabled:r===`busy`,"aria-label":Q(`run.shareFile`),title:Q(`run.shareFile`),className:$(`inline-flex h-9 items-center gap-1.5 rounded-full px-3 font-medium text-[0.8125rem] transition coarse:h-11 coarse:px-4`,r===`ready`?`bg-ember-tint text-ink ring-1 ring-ember`:`bg-paper-2 text-ink-2 hover:bg-paper-3 hover:text-ink`),children:[r===`busy`?(0,Z.jsx)(Hb,{className:`size-3.5`}):(0,Z.jsx)(Iv,{className:`size-3.5`}),Q(r===`ready`?`run.shareNow`:`run.share`)]})}var UE=sE(`share`)||kE();function WE({base:e,stepId:t,formats:n,title:r}){let i=n=>IS(`${e}/steps/${t}/download?format=${n}`);return(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[n.map((e,t)=>(0,Z.jsxs)(`a`,{href:i(e),onClick:t=>uE(t,i(e)),className:$(`inline-flex h-9 items-center gap-1.5 rounded-full px-3.5 font-medium text-[0.8125rem] transition coarse:h-11 coarse:px-4`,t===0?`bg-primary text-primary-foreground hover:brightness-105`:`bg-paper-2 text-ink-2 hover:bg-paper-3 hover:text-ink`),children:[t===0?(0,Z.jsx)(b_,{className:`size-3.5`}):null,BE[e]]},e)),UE&&n.length?(0,Z.jsx)(HE,{url:i(n[0]),format:n[0],title:r},i(n[0])):null]})}var GE=class extends Error{status;body;constructor(e,t,n){super(e),this.status=t,this.body=n}};async function KE(e,t,n){let r=await fetch(IS(t),{method:e,credentials:`include`,headers:n!==void 0&&!(n instanceof FormData)?{"content-type":`application/json`}:void 0,body:n===void 0?void 0:n instanceof FormData?n:JSON.stringify(n)}).catch(()=>{throw new GE(Q(`common.offline`),0,null)}),i=await r.text(),a=i?qE(i):null;if(!r.ok)throw new GE(a?.error??r.statusText,r.status,a);return a}function qE(e){try{return JSON.parse(e)}catch{return{error:e}}}var JE={get:e=>KE(`GET`,e),post:(e,t)=>KE(`POST`,e,t??{}),put:(e,t)=>KE(`PUT`,e,t),patch:(e,t)=>KE(`PATCH`,e,t),del:e=>KE(`DELETE`,e),upload:(e,t)=>{let n=new FormData;return n.set(`file`,t),KE(`POST`,e,n)}};function YE(e,t){let n=encodeURIComponent(e),r=encodeURIComponent(t);return[{id:`mail`,label:Q(`shareRun.email`),href:`mailto:?subject=${r}&body=${r}%0A%0A${n}`},{id:`x`,label:`X`,href:`https://x.com/intent/post?text=${r}&url=${n}`},{id:`linkedin`,label:`LinkedIn`,href:`https://www.linkedin.com/sharing/share-offsite/?url=${n}`},{id:`whatsapp`,label:`WhatsApp`,href:`https://wa.me/?text=${r}%20${n}`},{id:`facebook`,label:`Facebook`,href:`https://www.facebook.com/sharer/sharer.php?u=${n}`}]}var XE={x:`𝕏`,linkedin:`in`,whatsapp:`WA`,facebook:`f`};function ZE({runId:e,title:t,initial:n}){let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(n),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(null),p=async()=>{if(i(!0),!a){c(!0),f(null);try{o(await JE.post(`/api/runs/${e}/share`))}catch(e){f(e.message)}finally{c(!1)}}},m=async()=>{await JE.del(`/api/runs/${e}/share`),o(null),i(!1)},h=()=>{a&&(navigator.clipboard.writeText(a.url),u(!0),setTimeout(()=>u(!1),1500))},g=sE(`share`)||typeof navigator<`u`&&`share`in navigator,_=a?.expiresAt?new Intl.DateTimeFormat(hb,{dateStyle:`long`}).format(new Date(a.expiresAt)):null;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(jb,{variant:`secondary`,onClick:()=>void p(),children:[(0,Z.jsx)(Pv,{className:`size-4`}),` `,Q(`shareRun.button`)]}),(0,Z.jsx)(Gb,{open:r,onClose:()=>i(!1),title:Q(`shareRun.title`),children:s?(0,Z.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,Z.jsx)(Hb,{})}):d?(0,Z.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:d}):a?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-paper-2 p-1.5 pl-3`,children:[(0,Z.jsx)(X_,{className:`size-4 shrink-0 text-ink-3`}),(0,Z.jsx)(`input`,{readOnly:!0,value:a.url,onFocus:e=>e.target.select(),"aria-label":Q(`share.link`),className:`min-w-0 flex-1 bg-transparent text-[0.875rem] outline-none coarse:h-11`}),(0,Z.jsxs)(jb,{size:`sm`,onClick:h,children:[l?(0,Z.jsx)(c_,{className:`size-3.5`}):(0,Z.jsx)(m_,{className:`size-3.5`}),Q(l?`share.copied`:`share.copy`)]})]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 sm:grid-cols-6`,children:[YE(a.url,t).map(e=>(0,Z.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`flex flex-col items-center gap-1.5 text-[0.75rem] text-ink-2 hover:text-ink`,children:[(0,Z.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 font-semibold text-[0.9375rem] transition hover:bg-paper-3`,children:e.id===`mail`?(0,Z.jsx)(iv,{className:`size-5`}):XE[e.id]}),e.label]},e.id)),g?(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>void(sE(`share`)?cE(`share`,{link:a.url,title:t}):navigator.share({title:t,url:a.url})).catch(()=>void 0),className:`flex flex-col items-center gap-1.5 text-[0.75rem] text-ink-2 hover:text-ink`,children:[(0,Z.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 transition hover:bg-paper-3`,children:(0,Z.jsx)(Pv,{className:`size-5`})}),Q(`shareRun.more`)]}):null]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[0.8125rem] text-ink-3`,children:[(0,Z.jsx)(`span`,{children:_?Q(`shareRun.until`,{date:_}):Q(`shareRun.kept`)}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>void m(),className:`shrink-0 hover:text-rose coarse:min-h-11`,children:Q(`shareRun.withdraw`)})]})]}):null})]})}function QE({runId:e,ask:t}){return t.kind===`confirm`?(0,Z.jsx)($E,{runId:e,ask:t}):(0,Z.jsx)(eD,{runId:e,ask:t})}function $E({runId:e,ask:t}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(null),c=async n=>{a(!0),s(null);try{await JE.post(`/api/runs/${e}/ask/${t.id}`,n)}catch(e){s(e.message),a(!1)}},l=t.action.destructive?Jv:bv;return(0,Z.jsxs)(`div`,{className:`animate-rise`,children:[(0,Z.jsxs)(`div`,{className:`mb-5 flex items-start gap-3`,children:[(0,Z.jsx)(`div`,{className:$(`flex size-10 shrink-0 items-center justify-center rounded-full`,t.action.destructive?`bg-rose-tint text-rose`:`bg-ember-tint text-ember-strong`),children:(0,Z.jsx)(l,{className:`size-5`})}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:Q(`ask.wants`,{service:t.service})}),(0,Z.jsx)(`h2`,{className:`font-display font-semibold text-[1.25rem] leading-snug tracking-tight`,children:t.reason})]})]}),(0,Z.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-xl bg-paper-2 p-4 text-[0.8125rem] leading-relaxed ring-1 ring-border-soft`,children:t.input}),(0,Z.jsxs)(`div`,{className:`mt-5 flex items-center gap-4`,children:[(0,Z.jsx)(Bb,{checked:n,onChange:r,label:Q(`ask.allowRest`)}),(0,Z.jsx)(`span`,{className:`flex-1 text-[0.8125rem] text-ink-2`,children:Q(`ask.allowRest`)})]}),o?(0,Z.jsx)(`div`,{className:`mt-3 rounded-lg bg-rose-tint px-4 py-3 text-[0.875rem] text-rose`,children:o}):null,(0,Z.jsxs)(`div`,{className:`action-bar mt-6 flex items-center justify-between gap-3`,children:[(0,Z.jsx)(jb,{variant:`ghost`,disabled:i,onClick:()=>void c({type:`skip`}),children:Q(`ask.deny`)}),(0,Z.jsx)(jb,{busy:i,onClick:()=>void c({type:`done`,remember:n}),children:Q(`ask.allow`)})]})]})}function eD({runId:e,ask:t}){let[n,r]=(0,y.useState)({}),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(0),[f,p]=(0,y.useState)(``),[m,h]=(0,y.useState)(!1),g=(0,y.useRef)(null),_=(0,y.useCallback)(()=>d(e=>e+1),[]);(0,y.useEffect)(()=>{let e=setInterval(_,2500);return()=>clearInterval(e)},[_]);let v=async n=>{s(!0),l(null);try{await JE.post(`/api/runs/${e}/ask/${t.id}`,n)}catch(e){l(e.message),s(!1)}},b=async t=>{l(null);try{await JE.post(`/api/runs/${e}/browser/act`,t)}catch(e){l(e.message)}_()},x=e=>{let t=g.current;if(!t?.naturalWidth)return;let n=t.getBoundingClientRect();b({type:`click`,x:Math.round((e.clientX-n.left)/n.width*t.naturalWidth),y:Math.round((e.clientY-n.top)/n.height*t.naturalHeight)})},S=t.fields.some(e=>n[e.id]);return(0,Z.jsxs)(`div`,{className:`animate-rise`,children:[(0,Z.jsxs)(`div`,{className:`mb-5 flex items-start gap-3`,children:[(0,Z.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-ember-tint text-ember-strong`,children:(0,Z.jsx)(nv,{className:`size-5`})}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`h2`,{className:`font-display font-semibold text-[1.25rem] leading-snug tracking-tight`,children:t.reason}),(0,Z.jsxs)(`p`,{className:`mt-0.5 truncate text-[0.8125rem] text-ink-3`,children:[t.site.host,t.site.title?` · ${t.site.title}`:``]})]})]}),(0,Z.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-paper-2 ring-1 ring-border-soft`,children:[(0,Z.jsx)(`img`,{ref:g,src:IS(`/api/runs/${e}/browser/screen?t=${u}`),alt:t.site.host,onClick:x,className:`block w-full cursor-pointer`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-border-soft border-t bg-card p-2`,children:[(0,Z.jsx)(Fb,{type:m?`password`:`text`,autoComplete:`off`,value:f,placeholder:Q(`ask.typeInto`),onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),b({type:`type`,text:f}).then(()=>p(``)))},autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,enterKeyHint:`send`,className:`h-9 min-w-[9rem] flex-1 basis-full text-[0.8125rem] sm:basis-0 coarse:h-11`}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>h(e=>!e),className:$(`h-9 shrink-0 rounded-md px-2.5 text-[0.75rem] coarse:h-11 coarse:px-3.5`,m?`bg-ember-veil text-ink`:`text-ink-3 hover:bg-paper-2`),children:Q(`ask.hide`)}),(0,Z.jsx)(tD,{label:`Enter`,onClick:()=>void b({type:`key`,key:`Enter`}),children:(0,Z.jsx)(g_,{className:`size-4`})}),(0,Z.jsx)(tD,{label:Q(`ask.up`),onClick:()=>void b({type:`scroll`,dy:-500}),children:(0,Z.jsx)(Qg,{className:`size-4`})}),(0,Z.jsx)(tD,{label:Q(`ask.down`),onClick:()=>void b({type:`scroll`,dy:500}),children:(0,Z.jsx)(Kg,{className:`size-4`})})]})]}),(0,Z.jsx)(`p`,{className:`mt-2 text-[0.75rem] text-ink-4`,children:Q(`ask.pictureHint`)}),t.fields.length?(0,Z.jsxs)(`form`,{className:`mt-5 flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),v({type:`fill`,values:n,remember:i})},children:[t.fields.map((e,i)=>(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(Vb,{children:e.label}),(0,Z.jsx)(Fb,{autoFocus:i===0,type:e.secret?`password`:`text`,autoComplete:`off`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,enterKeyHint:i===t.fields.length-1?`go`:`next`,value:n[e.id]??``,onChange:t=>r(n=>({...n,[e.id]:t.target.value}))})]},e.id)),(0,Z.jsx)(`button`,{type:`submit`,hidden:!0})]}):null,(0,Z.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-4`,children:[(0,Z.jsx)(Bb,{checked:i,onChange:a,label:Q(`ask.remember`)}),(0,Z.jsx)(`span`,{className:`flex-1 text-[0.8125rem] text-ink-2`,children:Q(`ask.remember`)})]}),(0,Z.jsxs)(`p`,{className:`mt-3 flex items-start gap-2 text-[0.8125rem] text-ink-3`,children:[(0,Z.jsx)(Rv,{className:`mt-0.5 size-4 shrink-0 text-moss`}),` `,Q(`ask.private`)]}),c?(0,Z.jsx)(`div`,{className:`mt-3 rounded-lg bg-rose-tint px-4 py-3 text-[0.875rem] text-rose`,children:c}):null,(0,Z.jsxs)(`div`,{className:`action-bar mt-6 flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsx)(jb,{variant:`ghost`,disabled:o,onClick:()=>void v({type:`skip`}),children:Q(`ask.skip`)}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.fields.length?(0,Z.jsx)(jb,{variant:`secondary`,disabled:o,onClick:()=>void v({type:`done`,remember:i}),children:Q(`ask.done`)}):null,t.fields.length?(0,Z.jsx)(jb,{busy:o,disabled:!S,onClick:()=>void v({type:`fill`,values:n,remember:i}),children:Q(`ask.signIn`)}):(0,Z.jsx)(jb,{busy:o,onClick:()=>void v({type:`done`,remember:i}),children:Q(`ask.done`)})]})]})]})}function tD({label:e,onClick:t,children:n}){return(0,Z.jsx)(`button`,{type:`button`,"aria-label":e,title:e,onClick:t,className:`flex size-9 shrink-0 items-center justify-center rounded-md text-ink-3 hover:bg-paper-2 hover:text-ink coarse:size-11`,children:n})}var nD=H({description:L().max(1024).optional(),edit:K([`inline`,`popout`]).optional(),id:L().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/,`column id must be a lowercase slug (a-z, 0-9, _)`),name:L().min(1).max(128),required:z().optional()}),rD=K([`integer`,`decimal`,`percent`,`currency`]),iD=H({currency:L().regex(/^[A-Z]{3}$/,`currency must be an ISO 4217 code`).optional(),fractionDigits:R().int().min(0).max(8).optional(),grouping:z().optional(),style:rD}).superRefine((e,t)=>{e.style===`currency`&&!e.currency&&t.addIssue({code:`custom`,message:`currency style needs an ISO 4217 code`,path:[`currency`]}),e.style!==`currency`&&e.currency&&t.addIssue({code:`custom`,message:`currency is only valid on currency columns`,path:[`currency`]})}),aD=K([`date`,`datetime`,`time`]),oD=K([`short`,`medium`,`long`,`iso`]),sD=K([`hours`,`minutes`,`seconds`]),cD=H({dateStyle:oD.optional(),kind:aD,timePrecision:sD.optional()}),lD=K([`milliseconds`,`seconds`,`minutes`,`hours`,`days`]),uD=K([`hms`,`hours`,`minutes`,`decimal-hours`,`iso`]),dD=H({display:uD,inputUnit:lD}),fD=H({id:L().min(1).max(64),label:L().min(1).max(128)}),pD=H({allowCustom:z(),multiple:z().optional(),options:V(fD).max(200)}),mD=H({style:K([`single`,`multiline`,`markdown`]).default(`single`)}),hD=V(zc(`type`,[nD.extend({format:mD.optional(),type:q(`text`)}),nD.extend({format:iD,type:q(`number`)}),nD.extend({format:cD,type:q(`date`)}),nD.extend({format:dD,type:q(`duration`)}),nD.extend({format:pD,type:q(`select`)}),nD.extend({type:q(`boolean`)})])).min(1).max(64).superRefine((e,t)=>{let n=new Set;for(let r=0;r<e.length;r++){let i=e[r]?.id;i&&(n.has(i)&&t.addIssue({code:`custom`,message:`duplicate column id "${i}"`,path:[r,`id`]}),n.add(i))}});H({description:L().optional(),edit:K([`inline`,`popout`]).optional(),format:H({allowCustom:z().optional(),currency:L().optional(),dateStyle:K([`short`,`medium`,`long`,`iso`]).optional(),display:uD.optional(),fractionDigits:R().int().optional(),grouping:z().optional(),inputUnit:lD.optional(),kind:aD.optional(),multiple:z().optional(),options:V(fD).optional(),style:K([`single`,`multiline`,`markdown`,`integer`,`decimal`,`percent`,`currency`]).optional(),timePrecision:sD.optional()}).optional(),id:L(),name:L(),required:z().optional(),type:K([`text`,`number`,`date`,`duration`,`select`,`boolean`])}),H({table_id:L().uuid()});var gD=36e5,_D=6e4,vD=1e3;function yD(e){return e.fractionDigits===void 0?e.style===`integer`?0:2:e.fractionDigits}function bD(e,t,n=`en`){if(typeof e!=`number`||!Number.isFinite(e))return``;let r=yD(t),i=t.grouping!==!1;return t.style===`percent`?new Intl.NumberFormat(n,{maximumFractionDigits:r,minimumFractionDigits:r,style:`percent`,useGrouping:i}).format(e):t.style===`currency`&&t.currency?new Intl.NumberFormat(n,{currency:t.currency,maximumFractionDigits:r,minimumFractionDigits:r,style:`currency`,useGrouping:i}).format(e):new Intl.NumberFormat(n,{maximumFractionDigits:r,minimumFractionDigits:r,useGrouping:i}).format(e)}function xD(e,t,n=`en`){if(typeof e!=`string`||e.length===0)return``;if(t.kind===`time`)return SD(e,t.timePrecision??`minutes`);if(t.dateStyle===`iso`)return t.kind===`date`?e.slice(0,10):e;let r=t.kind===`date`?new Date(`${e}T00:00:00`):new Date(e);if(Number.isNaN(r.getTime()))return e;let i=t.dateStyle??`medium`;if(t.kind===`date`)return new Intl.DateTimeFormat(n,{dateStyle:i}).format(r);let a=t.timePrecision??`minutes`;return new Intl.DateTimeFormat(n,{dateStyle:i,timeStyle:a===`hours`?`short`:`medium`}).format(r)}function SD(e,t){let[n=`0`,r=`00`,i=`00`]=e.split(`:`);return t===`hours`?`${n.padStart(2,`0`)}:00`:t===`minutes`?`${n.padStart(2,`0`)}:${r.padStart(2,`0`)}`:`${n.padStart(2,`0`)}:${r.padStart(2,`0`)}:${i.padStart(2,`0`)}`}function CD(e,t){if(typeof e!=`number`||!Number.isFinite(e))return``;let n=Math.max(0,Math.round(e));if(t.display===`iso`)return wD(n);if(t.display===`minutes`)return`${Math.round(n/_D)} min`;if(t.display===`hours`)return`${(n/gD).toFixed(2)} h`;if(t.display===`decimal-hours`)return(n/gD).toFixed(2);let r=Math.floor(n/gD),i=Math.floor(n%gD/_D),a=Math.floor(n%_D/vD);return`${r}:${String(i).padStart(2,`0`)}:${String(a).padStart(2,`0`)}`}function wD(e){let t=Math.floor(e/gD),n=Math.floor(e%gD/_D),r=Math.floor(e%_D/vD);return`${t>=24?`P${Math.floor(t/24)}D`:`P`}T${t%24}H${n}M${r}S`}function TD(e,t,n=`en`){if(t==null)return``;switch(e.type){case`number`:return bD(t,e.format,n);case`date`:return xD(t,e.format,n);case`duration`:return CD(t,e.format);case`boolean`:return t===!0?`true`:t===!1?`false`:``;case`select`:return ED(e,t);default:return String(t)}}function ED(e,t){let n=Array.isArray(t)?t:[t],r=e.format.options.reduce((e,t)=>(e[t.id]=t.label,e),{});return n.filter(e=>typeof e==`string`&&e.length>0).map(e=>r[e]??e).join(`, `)}var DD=[`mail`],OD=[`round`,`drop`,`dome`,`flame`,`oval`,`bean`,`pebble`,`sprout`,`tower`,`wedge`],kD=[`text`,`textarea`,`number`,`select`,`multiselect`,`date`,`email`,`url`,`toggle`,`color`,`image`,`file`,`items`,`connection`,`list`,`location`,`audio`,`signature`];function AD(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let{lat:t,lng:n,label:r}=e;return typeof t==`number`&&typeof n==`number`||typeof r==`string`&&r.trim().length>0}function jD(e){return!!(e&&typeof e==`object`&&typeof e.asset==`string`&&e.asset)}var MD=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`],ND=/^[a-z][a-z0-9-]{0,39}$/,PD=/^[a-z][a-z0-9_]{0,39}$/,FD=[`classifier`,`standard`,`high`,`highest`];[...FD];var ID=[`low`,`medium`,`high`],LD=[`image`,`video`,`voice`,`document`,`dashboard`],RD=[`png`,`mp4`,`mp3`,`pdf`,`docx`,`html`,`md`,`txt`,`csv`,`xlsx`,`json`,`zip`],zD=[`1:1`,`16:9`,`9:16`,`4:5`,`3:2`,`2:3`],BD=[`720p`,`480p`],VD=L().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,40}$/,`ids are letters, digits and _ and start with a letter`),HD=H({id:VD,label:L().min(1),kind:K([`text`,`number`,`money`])}),UD=H({id:VD,label:L().min(1),kind:K(kD),required:z().optional(),placeholder:L().optional(),help:L().optional(),options:V(L()).optional(),default:W([L(),R(),z(),V(L())]).optional(),columns:V(HD).optional(),vat:H({rate:R().optional(),field:L().optional()}).optional(),currency:L().optional(),multiple:z().optional(),min:R().int().min(1).max(30).optional(),max:R().int().min(1).max(30).optional(),camera:z().optional(),video:z().optional(),listen:z().optional(),scan:z().optional(),connection:L().optional(),list:L().optional(),prefill:L().optional()}),WD=H({when:H({field:L(),op:K([`equals`,`notEquals`,`in`,`notEmpty`,`empty`]),value:W([L(),R(),z(),V(L())]).optional()}),goto:L()}),GD={id:VD,title:L().min(1),description:L().optional(),next:V(WD).optional()},KD=H({id:VD,kind:K([`text`,`number`,`list`,`table`,`yesno`,`choice`]),description:L().optional(),columns:V(L().min(1)).optional(),options:V(L().min(1)).min(2).max(40).optional()}).refine(e=>e.kind!==`choice`||!!e.options?.length,{message:`A choice field lists its options.`,path:[`options`]}),qD=H({...GD,type:q(`page`),fields:V(UD).min(1),cta:L().optional()}),JD=H({...GD,type:q(`agent`),instructions:L().min(1),tools:V(W([K(MD),fl([L().regex(ND),`.`,L().regex(PD)])])).default([]),mcp:V(L()).optional(),connections:V(L()).optional(),output:H({format:K([`text`,`markdown`,`json`]),fields:V(KD).optional()}).default({format:`markdown`}),model:K(FD).optional(),effort:K(ID).optional(),working:L().optional()}),YD=H({...GD,type:q(`generate`),asset:K(LD),prompt:L().min(1),options:H({aspectRatio:K(zD).optional(),duration:R().optional(),resolution:K(BD).optional(),style:L().optional(),template:K([`invoice`,`offer`,`briefing`,`letter`,`report`,`free`]).optional()}).optional(),referenceImage:L().optional(),each:L().optional(),model:K(FD).optional(),effort:K(ID).optional(),working:L().optional()}),XD=H({...GD,type:q(`widget`),entry:L().min(1),data:G(L(),L()).default({}),sample:L().optional(),size:H({width:R().int().min(200).max(3840),height:R().int().min(200).max(3840)}).optional(),video:z().optional(),working:L().optional()}),ZD=[`16:9`,`9:16`,`1:1`],QD=H({...GD,type:q(`film`),brief:L().min(1),skills:V(L().min(1)).max(12).default([`hyperframes`]),kit:L().optional(),inputs:G(L(),L()).default({}),format:K(ZD).default(`16:9`),seconds:R().int().min(3).max(600).optional(),model:K(FD).optional(),effort:K(ID).optional(),working:L().optional()}),$D=H({...GD,type:q(`review`),show:V(L()).min(1),edit:z().optional(),regenerate:z().optional()}),eO=H({from:L(),label:L().optional(),formats:V(K(RD)).min(1)}),tO=zc(`type`,[qD,JD,YD,XD,QD,$D,H({...GD,type:q(`result`),message:L().optional(),deliverables:V(eO)})]),nO=H({id:VD,title:L().min(1),description:L().optional(),columns:hD,key:L().optional(),check:H({file:L().optional(),status:L().optional()}).optional(),shared:z().optional()}),rO=H({id:VD,kind:K(DD).optional(),connector:L().optional(),actions:V(L()).max(200).optional(),policy:G(L(),K([`allow`,`ask`])).optional(),title:L().optional(),description:L().optional()});H({version:q(1).default(1),title:L().min(1),description:L().default(``),avatar:K(OD).default(`round`),intro:L().optional(),lists:V(nO).max(12).optional(),connections:V(rO).max(12).optional(),steps:V(tO).min(1)});function iO(e,t,n){let r=Array.isArray(t)?t:[],i=(e.columns??[]).filter(e=>e.kind!==`text`),a=r.map(e=>{let t=i.length?i.reduce((t,n)=>t*aO(e[n.id]),1):0;return{...e,amount:oO(t)}}),o=oO(a.reduce((e,t)=>e+t.amount,0)),s=e.vat?.rate??0;if(e.vat?.field){let t=n[e.vat.field],r=Number.parseFloat(String(t??``).replace(`,`,`.`));Number.isFinite(r)&&(s=r)}let c=oO(o*s/100);return{rows:a,net:o,vatRate:s,vat:c,gross:oO(o+c),currency:e.currency??`EUR`}}function aO(e){let t=Number(typeof e==`string`?e.replace(/\s/g,``).replace(`,`,`.`):e);return Number.isFinite(t)?t:0}function oO(e){return Math.round(e*100)/100}async function sO(e,t=2400){if(!/^image\/(jpeg|png|webp)$/.test(e.type)||e.size<12e5)return e;try{let n=await createImageBitmap(e),r=Math.min(1,t/Math.max(n.width,n.height)),i=document.createElement(`canvas`);i.width=Math.round(n.width*r),i.height=Math.round(n.height*r),i.getContext(`2d`)?.drawImage(n,0,0,i.width,i.height);let a=await new Promise(e=>i.toBlob(e,`image/jpeg`,.86));return a&&a.size<e.size?new File([a],`${e.name.replace(/\.[^.]+$/,``)}.jpg`,{type:`image/jpeg`}):e}catch{return e}}function cO(){return new Date().toISOString().slice(0,19).replace(/[:T]/g,`-`)}function lO(e){let t=e?.name;return t===`NotFoundError`||t===`OverconstrainedError`?`missing`:t===`NotReadableError`||t===`AbortError`?`busy`:`denied`}function uO(e){return!!e?.getCapabilities?.()?.torch}function dO(e,t,n=!1){let r=(0,y.useRef)(null),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)(1),[u,d]=(0,y.useState)(!1),[f,p]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{if(!e)return;let r=null,i=!1;s(null),a(null),d(!1),p(!1);let o={facingMode:{ideal:t},width:{ideal:2560},height:{ideal:1440}};return(async()=>{if(!navigator.mediaDevices?.getUserMedia)throw new DOMException(`no camera api`,`NotAllowedError`);try{r=await navigator.mediaDevices.getUserMedia({video:o,audio:n})}catch(e){if(!n)throw e;r=await navigator.mediaDevices.getUserMedia({video:o})}if(i){for(let e of r.getTracks())e.stop();return}a(r);let e=r.getVideoTracks()[0],t=()=>!i&&d(uO(e));t(),setTimeout(t,600);let s=await navigator.mediaDevices.enumerateDevices().catch(()=>[]);i||l(s.filter(e=>e.kind===`videoinput`).length)})().catch(e=>!i&&s(lO(e))),()=>{i=!0;for(let e of r?.getTracks()??[])e.stop()}},[e,t,n]),(0,y.useEffect)(()=>{r.current&&i&&(r.current.srcObject=i)},[i]),{video:r,stream:i,error:o,cameras:c,torchable:u,torch:f,setTorch:async e=>{let t=i?.getVideoTracks()[0];try{await t?.applyConstraints({advanced:[{torch:e}]}),p(e)}catch{d(!1)}},mirrored:i?.getVideoTracks()[0]?.getSettings().facingMode===`user`}}function fO({open:e,onClose:t,label:n,children:r}){let i=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=i.current;t&&(e&&!t.open?t.showModal():!e&&t.open&&t.close())},[e]),(0,Z.jsx)(`dialog`,{ref:i,onClose:t,"aria-label":n,className:`media-sheet`,children:e?(0,Z.jsx)(`div`,{className:`flex h-full flex-col`,children:r}):null})}function pO({label:e,onClick:t,active:n,children:r}){return(0,Z.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"aria-pressed":n,onClick:t,className:$(`flex size-11 shrink-0 items-center justify-center rounded-full transition`,n?`bg-white text-black`:`bg-white/12 text-white hover:bg-white/20`),children:r})}function mO({title:e,onClose:t,camera:n,onFlip:r}){return(0,Z.jsx)(`div`,{className:`safe-top`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,Z.jsx)(pO,{label:Q(`common.close`),onClick:t,children:(0,Z.jsx)(oy,{className:`size-5`})}),(0,Z.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-center font-medium text-[0.9375rem]`,children:e}),n.torchable?(0,Z.jsx)(pO,{label:Q(`camera.torch`),active:n.torch,onClick:()=>void n.setTorch(!n.torch),children:n.torch?(0,Z.jsx)(R_,{className:`size-5`}):(0,Z.jsx)(I_,{className:`size-5`})}):null,n.stream&&(n.cameras>1||dE)?(0,Z.jsx)(pO,{label:Q(`camera.flip`),onClick:r,children:(0,Z.jsx)(Wv,{className:`size-5`})}):(0,Z.jsx)(`span`,{className:`size-11`})]})})}function hO({camera:e,asking:t,children:n,actions:r}){return(0,Z.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[(0,Z.jsx)(`video`,{ref:e.video,autoPlay:!0,playsInline:!0,muted:!0,className:$(`absolute inset-0 size-full object-contain`,e.mirrored&&`-scale-x-100`)}),e.error?(0,Z.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-5 bg-black px-8 text-center`,children:[(0,Z.jsx)(`p`,{className:`max-w-sm text-[0.9375rem] text-white/85 leading-relaxed`,children:Q(`camera.${e.error}`)}),r]}):e.stream?n:(0,Z.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-4 px-8 text-center text-white/75`,children:[(0,Z.jsx)(Hb,{}),(0,Z.jsx)(`p`,{className:`max-w-xs text-[0.875rem] leading-relaxed`,children:t})]})]})}var gO=30;function _O(){if(typeof MediaRecorder<`u`)return[`video/mp4;codecs=avc1.42E01E,mp4a.40.2`,`video/mp4`,`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`,`video/webm`].find(e=>MediaRecorder.isTypeSupported(e))}var vO=!!_O();function yO({open:e,multiple:t,video:n,onClose:r,onCapture:i,onNative:a}){let[o,s]=(0,y.useState)(`environment`),[c,l]=(0,y.useState)(`photo`),[u,d]=(0,y.useState)(0),[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(null),g=(0,y.useRef)(null),_=dO(e,o,c===`video`);(0,y.useEffect)(()=>{e&&(d(0),l(`photo`),h(null))},[e]);let v=async e=>{p(!0);try{await i(e),d(e=>e+1),t||r()}finally{p(!1)}},b=async()=>{let e=_.video.current;if(!e?.videoWidth)return;let t=document.createElement(`canvas`);t.width=e.videoWidth,t.height=e.videoHeight,t.getContext(`2d`)?.drawImage(e,0,0);let n=await new Promise(e=>t.toBlob(e,`image/jpeg`,.9));n&&await v(new File([n],`foto-${cO()}.jpg`,{type:`image/jpeg`}))},x=()=>{g.current?.state===`recording`&&g.current.stop()},S=()=>{let e=_O();if(!_.stream||!e)return;let t=[],n=new MediaRecorder(_.stream,{mimeType:e,videoBitsPerSecond:25e5,audioBitsPerSecond:96e3});n.ondataavailable=e=>e.data.size&&t.push(e.data),n.onstop=()=>{h(null),g.current=null;let n=e.split(`;`)[0];if(t.length){let e=n===`video/mp4`?`mp4`:`webm`;v(new File(t,`video-${cO()}.${e}`,{type:n}))}},g.current=n,n.start(1e3),h(0)};(0,y.useEffect)(()=>{if(m===null)return;if(m>=gO){g.current?.state===`recording`&&g.current.stop();return}let e=setTimeout(()=>h(e=>e===null?null:e+1),1e3);return()=>clearTimeout(e)},[m]),(0,y.useEffect)(()=>{!e&&g.current&&(g.current.onstop=null,g.current.stop(),g.current=null)},[e]);let C=e=>`0:${String(e).padStart(2,`0`)}`;return(0,Z.jsxs)(fO,{open:e,onClose:r,label:Q(`camera.title`),children:[(0,Z.jsx)(mO,{title:m===null?u?Q(`camera.taken`,{n:u}):Q(`camera.title`):`${C(m)} / ${C(gO)}`,onClose:r,camera:_,onFlip:()=>s(e=>e===`environment`?`user`:`environment`)}),(0,Z.jsx)(hO,{camera:_,asking:Q(`camera.asking`),actions:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a?(0,Z.jsxs)(bO,{onClick:()=>{r(),a()},children:[(0,Z.jsx)(o_,{className:`size-4`}),` `,Q(dE?`camera.native`:`camera.pick`)]}):null,(0,Z.jsx)(bO,{quiet:!0,onClick:r,children:Q(`common.close`)})]})}),(0,Z.jsxs)(`div`,{className:$(`safe-bottom px-4 pt-3`,_.error&&`invisible`),children:[n&&vO&&m===null?(0,Z.jsx)(`div`,{className:`mb-3 flex justify-center gap-1 text-[0.8125rem]`,children:[`photo`,`video`].map(e=>(0,Z.jsx)(`button`,{type:`button`,"aria-pressed":c===e,onClick:()=>l(e),className:$(`h-9 rounded-full px-4 font-medium transition`,c===e?`bg-white text-black`:`text-white/70 hover:text-white`),children:Q(e===`photo`?`camera.photo`:`camera.video`)},e))}):null,(0,Z.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_1fr] items-center gap-3`,children:[(0,Z.jsx)(`span`,{className:`text-[0.8125rem] text-white/70 leading-snug`,children:m===null?c===`video`?Q(`camera.clipHint`,{s:gO}):Q(t?`camera.hintMany`:`camera.hint`):Q(`camera.recording`)}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":Q(c===`photo`?`camera.shoot`:m===null?`camera.record`:`camera.stop`),disabled:!_.stream||f,onClick:()=>c===`photo`?void b():m===null?S():x(),className:`flex size-[72px] items-center justify-center rounded-full border-4 border-white transition active:scale-95 disabled:opacity-40`,children:f?(0,Z.jsx)(Hb,{className:`text-white`}):c===`photo`?(0,Z.jsx)(`span`,{className:`size-[54px] rounded-full bg-white`}):m===null?(0,Z.jsx)(`span`,{className:`flex size-[54px] items-center justify-center rounded-full bg-[#e5484d]`,children:(0,Z.jsx)(ey,{className:`size-6 text-white`})}):(0,Z.jsx)(`span`,{className:`size-7 rounded-md bg-[#e5484d]`})}),(0,Z.jsx)(`div`,{className:`flex justify-end`,children:t&&u&&m===null?(0,Z.jsxs)(bO,{onClick:r,children:[(0,Z.jsx)(c_,{className:`size-4`}),` `,Q(`camera.done`)]}):null})]})]})]})}function bO({onClick:e,quiet:t,children:n}){return(0,Z.jsx)(`button`,{type:`button`,onClick:e,className:$(`inline-flex h-11 items-center justify-center gap-2 rounded-full px-5 font-medium text-[0.875rem] transition`,t?`text-white/75 hover:text-white`:`bg-white text-black hover:bg-white/90`),children:n})}var xO=25,SO=9e3;function CO(e){return e.code===e.PERMISSION_DENIED?`denied`:e.code===e.TIMEOUT?`timeout`:`unavailable`}function wO({value:e,runId:t,placeholder:n,onChange:r,onBusy:i}){let a=AD(e)?e:null,[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),u=(0,y.useRef)(null),d=(0,y.useRef)(!!a?.label),f=(0,y.useRef)(a);f.current=a;let p=a?.lat!==void 0&&a.lng!==void 0,m=typeof navigator<`u`&&`geolocation`in navigator,h=()=>{u.current!==null&&(navigator.geolocation.clearWatch(u.current),u.current=null),s(!1),i?.(!1)};(0,y.useEffect)(()=>()=>{u.current!==null&&navigator.geolocation.clearWatch(u.current)},[]);let g=async(e,n)=>{try{let{label:i}=await JE.post(`/api/runs/${t}/geocode`,{lat:e,lng:n,language:hb}),a=f.current;i&&!d.current&&a?.lat===e&&a.lng===n&&r({...a,label:i})}catch{}},_=()=>{l(null),s(!0),i?.(!0);let e=Date.now(),t=1/0;u.current=navigator.geolocation.watchPosition(n=>{let{latitude:i,longitude:a,accuracy:o}=n.coords;if(o<t){t=o;let e=Math.round(i*1e6)/1e6,n=Math.round(a*1e6)/1e6,s=d.current?f.current?.label:void 0,c={lat:e,lng:n,accuracy:Math.round(o),...s?{label:s}:{}};f.current=c,r(c)}if(t<=xO||Date.now()-e>SO){h();let e=f.current;e?.lat!==void 0&&e.lng!==void 0&&g(e.lat,e.lng)}},e=>{h(),t===1/0&&l(CO(e))},{enableHighAccuracy:!0,timeout:15e3,maximumAge:1e4})},v=e=>{d.current=e.trim().length>0;let t={...p?a:{},label:e};r(p||e.trim()?t:void 0)};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[p?(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,Z.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-moss-tint text-moss`,children:(0,Z.jsx)(ov,{className:`size-5`})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`truncate font-medium text-[0.9375rem] tabular-nums`,children:[a.lat?.toFixed(5),`, `,a.lng?.toFixed(5)]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 text-[0.8125rem] text-ink-3`,children:[(0,Z.jsx)(`span`,{children:o?Q(`location.refining`):a.accuracy?Q(`location.accuracy`,{m:a.accuracy}):null}),(0,Z.jsxs)(`a`,{href:`https://www.openstreetmap.org/?mlat=${a.lat}&mlon=${a.lng}#map=17/${a.lat}/${a.lng}`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 underline-offset-2 hover:text-ink hover:underline coarse:-my-3 coarse:min-h-11 coarse:min-w-11`,children:[Q(`location.map`),` `,(0,Z.jsx)(w_,{className:`size-3`})]})]})]}),(0,Z.jsx)(Mb,{label:Q(`location.remove`),onClick:()=>{h(),d.current=!1,r(void 0)},children:(0,Z.jsx)(oy,{className:`size-4`})})]}):m?(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(jb,{variant:`secondary`,size:`lg`,busy:o,onClick:_,className:`w-full sm:w-auto`,children:[o?null:(0,Z.jsx)(ev,{className:`size-4`}),Q(o?`location.locating`:`location.use`)]}),c?(0,Z.jsx)(`p`,{className:`mt-2 rounded-lg bg-amber-tint px-3 py-2 text-[0.8125rem] text-ink-2 leading-relaxed`,children:Q(`location.${c}`)}):(0,Z.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3 leading-relaxed`,children:Q(`location.why`)})]}):null,(0,Z.jsx)(Fb,{value:a?.label??``,placeholder:n??Q(p?`location.label`:`location.manual`),autoComplete:`street-address`,enterKeyHint:`done`,"aria-label":Q(`location.manual`),onChange:e=>v(e.target.value)})]})}var TO=c({createWorker:()=>EO}),EO,DO=o((()=>{EO=()=>new Worker(URL.createObjectURL(new Blob([`class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}
|
|
639
639
|
class A{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,b){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}
|
|
640
640
|
class ba{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,a-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,
|
|
641
641
|
this.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var B,C=B||(B={});C.Numeric="numeric";C.Alphanumeric="alphanumeric";C.Byte="byte";C.Kanji="kanji";C.ECI="eci";C.StructuredAppend="structuredappend";var D,E=D||(D={});E[E.Terminator=0]="Terminator";E[E.Numeric=1]="Numeric";E[E.Alphanumeric=2]="Alphanumeric";E[E.Byte=4]="Byte";E[E.Kanji=8]="Kanji";E[E.ECI=7]="ECI";E[E.StructuredAppend=3]="StructuredAppend";let F="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");
|
|
@@ -732,13 +732,13 @@ u.set(r,q,v)}h?(q=new Uint8ClampedArray(a.buffer,m,k),m+=k,q=new x(q,b)):q=x.cre
|
|
|
732
732
|
y:z))||"attemptBoth"!==e.inversionAttempts&&"invertFirst"!==e.inversionAttempts||(f=V(d?z:y));return f}X.default=X;let Y="dontInvert",Z={red:77,green:150,blue:29,useIntegerApproximation:!0};
|
|
733
733
|
self.onmessage=a=>{let b=a.data.id,c=a.data.data;switch(a.data.type){case "decode":(a=X(c.data,c.width,c.height,{inversionAttempts:Y,greyScaleWeights:Z}))?self.postMessage({id:b,type:"qrResult",data:a.data,cornerPoints:[a.location.topLeftCorner,a.location.topRightCorner,a.location.bottomRightCorner,a.location.bottomLeftCorner]}):self.postMessage({id:b,type:"qrResult",data:null});break;case "grayscaleWeights":Z.red=c.red;Z.green=c.green;Z.blue=c.blue;Z.useIntegerApproximation=c.useIntegerApproximation;
|
|
734
734
|
break;case "inversionMode":switch(c){case "original":Y="dontInvert";break;case "invert":Y="onlyInvert";break;case "both":Y="attemptBoth";break;default:throw Error("Invalid inversion mode");}break;case "close":self.close()}}
|
|
735
|
-
`]),{type:`application/javascript`}))})),CO=c({default:()=>wO}),wO,TO=o((()=>{Kh(),wO=class e{constructor(t,n,r,i,a){this._legacyCanvasSize=e.DEFAULT_CANVAS_SIZE,this._preferredCamera=`environment`,this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=t,this.$canvas=document.createElement(`canvas`),r&&typeof r==`object`?this._onDecode=n:(console.warn(r||i||a?`You're using a deprecated version of the QrScanner constructor which will be removed in the future`:`Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true.`),this._legacyOnDecode=n),n=typeof r==`object`?r:{},this._onDecodeError=n.onDecodeError||(typeof r==`function`?r:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||(typeof i==`function`?i:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||a||this._preferredCamera,this._legacyCanvasSize=typeof r==`number`?r:typeof i==`number`?i:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),t.disablePictureInPicture=!0,t.playsInline=!0,t.muted=!0;let o=!1;if(t.hidden&&(t.hidden=!1,o=!0),document.body.contains(t)||(document.body.appendChild(t),o=!0),r=t.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(i=!!n.overlay,this.$overlay=n.overlay||document.createElement(`div`),a=this.$overlay.style,a.position=`absolute`,a.display=`none`,a.pointerEvents=`none`,this.$overlay.classList.add(`scan-region-highlight`),!i&&n.highlightScanRegion){this.$overlay.innerHTML=`<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>`;try{this.$overlay.firstElementChild.animate({transform:[`scale(.98)`,`scale(1.01)`]},{duration:400,iterations:1/0,direction:`alternate`,easing:`ease-in-out`})}catch{}r.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML(`beforeend`,`<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>`),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(t),requestAnimationFrame(()=>{let e=window.getComputedStyle(t);e.display===`none`&&(t.style.setProperty(`display`,`block`,`important`),o=!0),e.visibility!==`visible`&&(t.style.setProperty(`visibility`,`visible`,`important`),o=!0),o&&(console.warn(`QrScanner has overwritten the video hiding style to avoid Safari stopping the playback.`),t.style.opacity=`0`,t.style.width=`0`,t.style.height=`0`,this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),t.addEventListener(`play`,this._onPlay),t.addEventListener(`loadedmetadata`,this._onLoadedMetaData),document.addEventListener(`visibilitychange`,this._onVisibilityChange),window.addEventListener(`resize`,this._updateOverlay),this._qrEnginePromise=e.createQrEngine()}static set WORKER_PATH(e){console.warn(`Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.`)}static async hasCamera(){try{return!!(await e.listCameras(!1)).length}catch{return!1}}static async listCameras(t=!1){if(!navigator.mediaDevices)return[];let n=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`videoinput`),r;try{t&&(await n()).every(e=>!e.label)&&(r=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await n()).map((e,t)=>({id:e.deviceId,label:e.label||(t===0?`Default Camera`:`Camera ${t+1}`)}))}finally{r&&(console.warn(`Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream`),e._stopVideoStream(r))}}async hasFlash(){let t;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;t=this.$video.srcObject}else t=(await this._getCameraStream()).stream;return`torch`in t.getVideoTracks()[0].getSettings()}catch{return!1}finally{t&&t!==this.$video.srcObject&&(console.warn(`Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream`),e._stopVideoStream(t))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw`No flash available`;await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(e){throw this._flashOn=!1,e}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener(`loadedmetadata`,this._onLoadedMetaData),this.$video.removeEventListener(`play`,this._onPlay),document.removeEventListener(`visibilitychange`,this._onVisibilityChange),window.removeEventListener(`resize`,this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),e._postWorkerMessage(this._qrEnginePromise,`close`)}async start(){if(this._destroyed)throw Error(`The QR scanner can not be started as it had been destroyed.`);if((!this._active||this._paused)&&(window.location.protocol!==`https:`&&console.warn(`The camera stream is only accessible if the page is transferred via https.`),this._active=!0,!document.hidden)){if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:t,facingMode:n}=await this._getCameraStream();!this._active||this._paused?e._stopVideoStream(t):(this._setVideoMirror(n),this.$video.srcObject=t,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(e){if(!this._paused)throw this._active=!1,e}}}stop(){this.pause(),this._active=!1}async pause(t=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display=`none`);let n=()=>{this.$video.srcObject instanceof MediaStream&&(e._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return t?(n(),!0):(await new Promise(e=>setTimeout(e,300)),this._paused?(n(),!0):!1)}async setCamera(e){e!==this._preferredCamera&&(this._preferredCamera=e,await this._restartVideoStream())}static async scanImage(t,n,r,i,a=!1,o=!1){let s,c=!1;n&&(`scanRegion`in n||`qrEngine`in n||`canvas`in n||`disallowCanvasResizing`in n||`alsoTryWithoutScanRegion`in n||`returnDetailedScanResult`in n)?(s=n.scanRegion,r=n.qrEngine,i=n.canvas,a=n.disallowCanvasResizing||!1,o=n.alsoTryWithoutScanRegion||!1,c=!0):console.warn(n||r||i||a||o?`You're using a deprecated api for scanImage which will be removed in the future.`:`Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true.`),n=!!r;try{let l,u;[r,l]=await Promise.all([r||e.createQrEngine(),e._loadImage(t)]),[i,u]=e._drawToCanvas(l,s,i,a);let d;if(r instanceof Worker){let t=r;n||e._postWorkerMessageSync(t,`inversionMode`,`both`),d=await new Promise((n,r)=>{let a,o,c,l=-1;o=i=>{i.data.id===l&&(t.removeEventListener(`message`,o),t.removeEventListener(`error`,c),clearTimeout(a),i.data.data===null?r(e.NO_QR_CODE_FOUND):n({data:i.data.data,cornerPoints:e._convertPoints(i.data.cornerPoints,s)}))},c=e=>{t.removeEventListener(`message`,o),t.removeEventListener(`error`,c),clearTimeout(a),r(`Scanner error: `+(e?e.message||e:`Unknown Error`))},t.addEventListener(`message`,o),t.addEventListener(`error`,c),a=setTimeout(()=>c(`timeout`),1e4);let d=u.getImageData(0,0,i.width,i.height);l=e._postWorkerMessageSync(t,`decode`,d,[d.data.buffer])})}else d=await Promise.race([new Promise((e,t)=>window.setTimeout(()=>t(`Scanner error: timeout`),1e4)),(async()=>{try{var[n]=await r.detect(i);if(!n)throw e.NO_QR_CODE_FOUND;return{data:n.rawValue,cornerPoints:e._convertPoints(n.cornerPoints,s)}}catch(r){if(n=r.message||r,/not implemented|service unavailable/.test(n))return e._disableBarcodeDetector=!0,e.scanImage(t,{scanRegion:s,canvas:i,disallowCanvasResizing:a,alsoTryWithoutScanRegion:o});throw`Scanner error: ${n}`}})()]);return c?d:d.data}catch(n){if(!s||!o)throw n;let l=await e.scanImage(t,{qrEngine:r,canvas:i,disallowCanvasResizing:a});return c?l:l.data}finally{n||e._postWorkerMessage(r,`close`)}}setGrayscaleWeights(t,n,r,i=!0){e._postWorkerMessage(this._qrEnginePromise,`grayscaleWeights`,{red:t,green:n,blue:r,useIntegerApproximation:i})}setInversionMode(t){e._postWorkerMessage(this._qrEnginePromise,`inversionMode`,t)}static async createQrEngine(t){if(t&&console.warn(`Specifying a worker path is not required and not supported anymore.`),t=()=>Gh(()=>Promise.resolve().then(()=>(SO(),bO)).then(e=>e.createWorker()),void 0,import.meta.url),!(!e._disableBarcodeDetector&&`BarcodeDetector`in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes(`qr_code`)))return t();let n=navigator.userAgentData;return n&&n.brands.some(({brand:e})=>/Chromium/i.test(e))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues([`architecture`,`platformVersion`]).then(({architecture:e,platformVersion:t})=>/arm/i.test(e||`arm`)&&13<=parseInt(t||`13`)).catch(()=>!0)?t():new BarcodeDetector({formats:[`qr_code`]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=``),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){let t=Math.round(2/3*Math.min(e.videoWidth,e.videoHeight));return{x:Math.round((e.videoWidth-t)/2),y:Math.round((e.videoHeight-t)/2),width:t,height:t,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var e=this.$video,t=e.videoWidth,n=e.videoHeight,r=e.offsetWidth,i=e.offsetHeight,a=e.offsetLeft,o=e.offsetTop,s=window.getComputedStyle(e),c=s.objectFit,l=t/n,u=r/i;switch(c){case`none`:var d=t,f=n;break;case`fill`:d=r,f=i;break;default:(c===`cover`?l>u:l<u)?(f=i,d=f*l):(d=r,f=d/l),c===`scale-down`&&(d=Math.min(d,t),f=Math.min(f,n))}var[p,m]=s.objectPosition.split(` `).map((e,t)=>{let n=parseFloat(e);return e.endsWith(`%`)?(t?i-f:r-d)*n/100:n});s=this._scanRegion.width||t,u=this._scanRegion.height||n,c=this._scanRegion.x||0;var h=this._scanRegion.y||0;l=this.$overlay.style,l.width=`${s/t*d}px`,l.height=`${u/n*f}px`,l.top=`${o+m+h/n*f}px`,n=/scaleX\(-1\)/.test(e.style.transform),l.left=`${a+(n?r-p-d:p)+(n?t-c-s:c)/t*d}px`,l.transform=e.style.transform}})}static _convertPoints(e,t){if(!t)return e;let n=t.x||0,r=t.y||0,i=t.width&&t.downScaledWidth?t.width/t.downScaledWidth:1;t=t.height&&t.downScaledHeight?t.height/t.downScaledHeight:1;for(let a of e)a.x=a.x*i+n,a.y=a.y*t+r;return e}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||(`requestVideoFrameCallback`in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var t=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;t<n&&await new Promise(e=>setTimeout(e,n-t)),this._lastScanTimestamp=Date.now();try{var r=await e.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(e){if(!this._active)return;this._onDecodeError(e)}!e._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=e.createQrEngine()),r?(this._onDecode?this._onDecode(r):this._legacyOnDecode&&this._legacyOnDecode(r.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute(`viewBox`,`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute(`points`,r.cornerPoints.map(({x:e,y:t})=>`${e},${t}`).join(` `)),this.$codeOutlineHighlight.style.display=``)):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display=`none`,100))}this._scanFrame()})}_onDecodeError(t){t!==e.NO_QR_CODE_FOUND&&console.log(t)}async _getCameraStream(){if(!navigator.mediaDevices)throw`Camera not found.`;let e=/^(environment|user)$/.test(this._preferredCamera)?`facingMode`:`deviceId`,t=[{width:{min:1024}},{width:{min:768}},{}],n=t.map(t=>Object.assign({},t,{[e]:{exact:this._preferredCamera}}));for(let e of[...n,...t])try{let t=await navigator.mediaDevices.getUserMedia({video:e,audio:!1});return{stream:t,facingMode:this._getFacingMode(t)||(e.facingMode?this._preferredCamera:this._preferredCamera===`environment`?`user`:`environment`)}}catch{}throw`Camera not found.`}async _restartVideoStream(){let e=this._paused;await this.pause(!0)&&!e&&this._active&&await this.start()}static _stopVideoStream(e){for(let t of e.getTracks())t.stop(),e.removeTrack(t)}_setVideoMirror(e){this.$video.style.transform=`scaleX(`+(e===`user`?-1:1)+`)`}_getFacingMode(e){return(e=e.getVideoTracks()[0])?/rear|back|environment/i.test(e.label)?`environment`:/front|user|face/i.test(e.label)?`user`:null:null}static _drawToCanvas(e,t,n,r=!1){n||=document.createElement(`canvas`);let i=t&&t.x?t.x:0,a=t&&t.y?t.y:0,o=t&&t.width?t.width:e.videoWidth||e.width,s=t&&t.height?t.height:e.videoHeight||e.height;return r||(r=t&&t.downScaledWidth?t.downScaledWidth:o,t=t&&t.downScaledHeight?t.downScaledHeight:s,n.width!==r&&(n.width=r),n.height!==t&&(n.height=t)),t=n.getContext(`2d`,{alpha:!1}),t.imageSmoothingEnabled=!1,t.drawImage(e,i,a,o,s,0,0,n.width,n.height),[n,t]}static async _loadImage(t){if(t instanceof Image)return await e._awaitImageLoad(t),t;if(t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||t instanceof SVGImageElement||`OffscreenCanvas`in window&&t instanceof OffscreenCanvas||`ImageBitmap`in window&&t instanceof ImageBitmap)return t;if(t instanceof File||t instanceof Blob||t instanceof URL||typeof t==`string`){let n=new Image;n.src=t instanceof File||t instanceof Blob?URL.createObjectURL(t):t.toString();try{return await e._awaitImageLoad(n),n}finally{(t instanceof File||t instanceof Blob)&&URL.revokeObjectURL(n.src)}}else throw`Unsupported image type.`}static async _awaitImageLoad(e){e.complete&&e.naturalWidth!==0||await new Promise((t,n)=>{let r=i=>{e.removeEventListener(`load`,r),e.removeEventListener(`error`,r),i instanceof ErrorEvent?n(`Image load error`):t()};e.addEventListener(`load`,r),e.addEventListener(`error`,r)})}static async _postWorkerMessage(t,n,r,i){return e._postWorkerMessageSync(await t,n,r,i)}static _postWorkerMessageSync(t,n,r,i){if(!(t instanceof Worker))return-1;let a=e._workerMessageId++;return t.postMessage({id:a,type:n,data:r},i),a}},wO.DEFAULT_CANVAS_SIZE=400,wO.NO_QR_CODE_FOUND=`No QR code found`,wO._disableBarcodeDetector=!1,wO._workerMessageId=0}));Kh();var EO=null;function DO(){return EO??=(async()=>{let e=window.BarcodeDetector;if(e)try{let t=await e.getSupportedFormats();if(t.includes(`qr_code`)){let n=new e({formats:t});return{qrOnly:!1,detect:async e=>(await n.detect(e))[0]?.rawValue||null}}}catch{}let{default:t}=await Gh(async()=>{let{default:e}=await Promise.resolve().then(()=>(TO(),CO));return{default:e}},void 0,import.meta.url),n=t.createQrEngine();return{qrOnly:!0,detect:async e=>{try{return(await t.scanImage(e,{qrEngine:n,returnDetailedScanResult:!0})).data||null}catch{return null}}}})(),EO}function OO({open:e,onClose:t,onResult:n}){let r=(0,y.useRef)(n);r.current=n;let i=(0,y.useRef)(t);return i.current=t,(0,y.useEffect)(()=>{e&&aE(`scan`).then(e=>{e&&r.current(e)}).catch(()=>void 0).finally(()=>i.current())},[e]),null}function kO(e){return iE(`scan`)?(0,Z.jsx)(OO,{...e}):(0,Z.jsx)(AO,{...e})}function AO({open:e,onClose:t,onResult:n}){let[r,i]=(0,y.useState)(`environment`),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),l=(0,y.useRef)(null),u=oO(e,r),d=(0,y.useRef)(n);d.current=n;let f=(0,y.useRef)(t);f.current=t,(0,y.useEffect)(()=>{e&&(c(!1),DO().then(e=>o(e.qrOnly)))},[e]),(0,y.useEffect)(()=>{if(!e||!u.stream)return;let t=!1,n,r=async()=>{let e=u.video.current;if(!t&&e&&e.readyState>=2&&e.videoWidth){let n=await(await DO()).detect(e).catch(()=>null);if(n&&!t){navigator.vibrate?.(60),d.current(n),f.current();return}}t||(n=setTimeout(r,200))};return r(),()=>{t=!0,clearTimeout(n)}},[e,u.stream,u.video]);let p=async e=>{if(!e)return;c(!1);let r=await createImageBitmap(e).catch(()=>null),i=r?await(await DO()).detect(r).catch(()=>null):null;i?(n(i),t()):c(!0)};return(0,Z.jsxs)(sO,{open:e,onClose:t,label:Q(`scan.title`),children:[(0,Z.jsx)(lO,{title:Q(`scan.title`),onClose:t,camera:u,onFlip:()=>i(e=>e===`environment`?`user`:`environment`)}),(0,Z.jsx)(uO,{camera:u,asking:Q(`scan.asking`),actions:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(hO,{onClick:()=>l.current?.click(),children:[(0,Z.jsx)(H_,{className:`size-4`}),` `,Q(`scan.fromPhoto`)]}),(0,Z.jsx)(hO,{quiet:!0,onClick:t,children:Q(`scan.typeInstead`)})]}),children:(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,Z.jsx)(`div`,{className:`aspect-square w-[min(68%,320px)] rounded-3xl border-2 border-white/90 shadow-[0_0_0_100vmax_rgb(0_0_0/0.35)]`})})}),(0,Z.jsxs)(`div`,{className:`safe-bottom flex flex-col items-center gap-3 px-5 pt-3 text-center`,children:[(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-white/75 leading-snug`,children:Q(s?`scan.miss`:a?`scan.hintQr`:`scan.hint`)}),u.stream?(0,Z.jsxs)(hO,{quiet:!0,onClick:()=>l.current?.click(),children:[(0,Z.jsx)(H_,{className:`size-4`}),` `,Q(`scan.fromPhoto`)]}):null]}),(0,Z.jsx)(`input`,{ref:l,type:`file`,hidden:!0,accept:`image/*`,onChange:e=>{p(e.target.files?.[0]),e.target.value=``}})]})}var jO=`#1d1a17`,MO={width:1200,height:480};function NO(e,t,n,r,i){e.lineCap=`round`,e.lineJoin=`round`,e.strokeStyle=jO,e.fillStyle=jO,e.lineWidth=i;for(let a of t){if(a.length===1){e.beginPath(),e.arc(a[0].x*n,a[0].y*r,i/2,0,Math.PI*2),e.fill();continue}e.beginPath(),e.moveTo(a[0].x*n,a[0].y*r);for(let t=1;t<a.length-1;t++){let i=a[t],o=a[t+1];e.quadraticCurveTo(i.x*n,i.y*r,(i.x+o.x)/2*n,(i.y+o.y)/2*r)}let t=a[a.length-1];e.lineTo(t.x*n,t.y*r),e.stroke()}}function PO({strokes:e,onStrokes:t}){let n=(0,y.useRef)(null),r=(0,y.useRef)(null),i=(0,y.useRef)(e);i.current=e;let a=()=>{let e=n.current,t=e?.getContext(`2d`);if(!e||!t)return;let a=window.devicePixelRatio||1,o=Math.round(e.clientWidth*a),s=Math.round(e.clientHeight*a);(e.width!==o||e.height!==s)&&(e.width=o,e.height=s),t.clearRect(0,0,o,s),NO(t,r.current?[...i.current,r.current]:i.current,o,s,2.4*a)};(0,y.useEffect)(()=>{a();let e=n.current;if(!e)return;let t=new ResizeObserver(a);return t.observe(e),()=>t.disconnect()},[e]);let o=e=>{let t=e.currentTarget.getBoundingClientRect();return{x:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),y:Math.min(1,Math.max(0,(e.clientY-t.top)/t.height))}};return(0,Z.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl bg-white ring-1 ring-input`,children:[(0,Z.jsx)(`canvas`,{ref:n,"aria-label":Q(`sign.pad`),className:`block aspect-[5/2] w-full cursor-crosshair touch-none select-none`,onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),r.current=[o(e)],a()},onPointerMove:e=>{r.current&&(r.current.push(o(e)),a())},onPointerUp:()=>{if(r.current){let e=r.current;r.current=null,t([...i.current,e])}},onPointerCancel:()=>{r.current=null,a()}}),(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-6 bottom-[22%] border-[#1d1a17]/25 border-b`}),e.length?null:(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center text-[#1d1a17]/40 text-[0.875rem]`,children:Q(`sign.hint`)})]})}async function FO(e){let t=document.createElement(`canvas`);t.width=MO.width,t.height=MO.height;let n=t.getContext(`2d`);if(!n)return null;NO(n,e,MO.width,MO.height,7);let r=await new Promise(e=>t.toBlob(e,`image/png`));return r?new File([r],`unterschrift.png`,{type:`image/png`}):null}function IO({label:e,value:t,runId:n,onChange:r}){let[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)([]),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(null),f=typeof t==`string`&&t?t:null,p=async()=>{l(!0),d(null);try{let e=await FO(o);if(!e)return;r((await GE.upload(`/api/runs/${n}/uploads`,e)).id),a(!1)}catch(e){d(e.message)}finally{l(!1)}};return(0,Z.jsxs)(`div`,{children:[f?(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-2 ring-1 ring-input`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>{s([]),a(!0)},className:`min-w-0 flex-1 rounded-lg bg-white px-3`,"aria-label":Q(`sign.again`),children:(0,Z.jsx)(`img`,{src:NS(`/api/runs/${n}/assets/${f}`),alt:e,className:`mx-auto h-20 object-contain`})}),(0,Z.jsx)(Ab,{label:Q(`sign.remove`),onClick:()=>r(void 0),children:(0,Z.jsx)(iy,{className:`size-4`})})]}):(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{s([]),a(!0)},className:`flex w-full flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-4 py-7 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink`,children:[(0,Z.jsx)(gv,{className:`size-6`}),Q(`sign.open`)]}),(0,Z.jsxs)(Ub,{open:i,onClose:()=>a(!1),title:e,wide:!0,children:[(0,Z.jsx)(PO,{strokes:o,onStrokes:s}),u?(0,Z.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:u}):null,(0,Z.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(kb,{variant:`ghost`,disabled:!o.length||c,onClick:()=>s([]),children:[(0,Z.jsx)(b_,{className:`size-4`}),` `,Q(`sign.clear`)]}),(0,Z.jsx)(kb,{busy:c,disabled:!o.length,onClick:()=>void p(),children:Q(`sign.accept`)})]})]})]})}function LO({runId:e,connectionId:t,connector:n,onCancel:r}){let[i,a]=(0,y.useState)({}),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),u=async()=>{s(!0),l(null);try{await GE.post(`/api/runs/${e}/connections/${t}/credentials/${n.id}`,{values:i})}catch(e){l(e.message)}finally{s(!1)}};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl bg-card p-4 ring-1 ring-input`,children:[(n.fields??[]).map(e=>(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(zb,{children:e.label}),(0,Z.jsx)(Nb,{type:e.secret?`password`:`text`,autoComplete:`off`,value:i[e.key]??``,placeholder:e.placeholder,onChange:t=>a(n=>({...n,[e.key]:t.target.value})),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),u())}})]},e.key)),n.hint?(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:n.hint}):null,c?(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:c}):null,(0,Z.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Z.jsx)(kb,{variant:`ghost`,size:`sm`,onClick:r,children:Q(`common.cancel`)}),(0,Z.jsx)(kb,{size:`sm`,busy:o,onClick:()=>void u(),children:Q(`connect.go`)})]})]})}function RO({runId:e,connection:t}){let[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(null);if(!t)return null;if(t.account){let n=t.connectors.find(e=>e.id===t.account?.connector)?.name??``;return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,Z.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-moss-tint text-moss`,children:(0,Z.jsx)(c_,{className:`size-5`})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`truncate font-medium text-[0.9375rem]`,children:t.account.label}),(0,Z.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:Q(`connect.connected`,{name:n})})]}),(0,Z.jsx)(Ab,{label:Q(`connect.disconnect`),onClick:()=>void GE.del(`/api/runs/${e}/connections/${t.id}`),children:(0,Z.jsx)(Xv,{className:`size-4`})})]})}let c=async n=>{if(s(null),a(null),iE(`signIn`)){try{let{url:r}=await GE.post(`/api/runs/${e}/connections/${t.id}/oauth/${n.id}`);await aE(`signIn`,{url:r})}catch(e){s(e.message)}return}let r=window.open(`about:blank`,`wizard-connect`,`width=540,height=700`);try{let{url:i}=await GE.post(`/api/runs/${e}/connections/${t.id}/oauth/${n.id}`);r?r.location.replace(i):a(i)}catch(e){r?.close(),s(e.message)}},l=t.connectors.find(e=>e.id===n);return t.connectors.length?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.connectors.map(e=>(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>e.auth===`oauth2`?void c(e):r(n===e.id?null:e.id),className:$(`inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[0.875rem] ring-1 transition`,n===e.id?`bg-ember-veil text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink hover:ring-ember`),children:[(0,Z.jsx)(J_,{className:`size-4`}),` `,e.name]},e.id))}),l?(0,Z.jsx)(LO,{runId:e,connectionId:t.id,connector:l,onCancel:()=>r(null)}):null,i?(0,Z.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,className:`text-[0.875rem] text-ember underline`,children:Q(`connect.openLink`)}):null,o?(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:o}):null]}):(0,Z.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Q(`connect.none`)})}function zO(e){return e==null?``:Array.isArray(e)?e.join(`, `):String(e)}function BO(e,t){if(t.trim()===``)return null;if(e.type===`number`){let e=Number(t.replace(/\s/g,``).replace(`,`,`.`));return Number.isFinite(e)?e:t}return e.type===`boolean`?t===`true`:t}function VO({column:e,value:t,boxed:n,onCommit:r}){let[i,a]=(0,y.useState)(zO(t));(0,y.useEffect)(()=>a(zO(t)),[t]);let o=$(`w-full min-w-0 rounded-md border border-transparent px-2 text-[0.8125rem] outline-none focus:border-ember focus:bg-card`,n?`h-11 bg-paper-2`:`h-9 bg-transparent hover:bg-paper-2 coarse:h-11`);return e.type===`boolean`?(0,Z.jsx)(`label`,{className:`flex size-9 cursor-pointer items-center justify-center coarse:size-11`,children:(0,Z.jsx)(`input`,{type:`checkbox`,"aria-label":e.name,checked:t===!0,onChange:e=>r(e.target.checked),className:`size-4 accent-[var(--ember)] coarse:size-6`})}):e.type===`select`&&!e.format.multiple&&!e.format.allowCustom?(0,Z.jsxs)(`select`,{value:i,onChange:e=>r(e.target.value||null),className:o,children:[(0,Z.jsx)(`option`,{value:``}),e.format.options.map(e=>(0,Z.jsx)(`option`,{value:e.id,children:e.label},e.id))]}):(0,Z.jsx)(`input`,{"aria-label":e.name,type:e.type===`date`&&e.format.kind===`date`?`date`:`text`,inputMode:e.type===`number`?`decimal`:void 0,enterKeyHint:`done`,autoComplete:`off`,value:i,onChange:e=>a(e.target.value),onBlur:()=>{i!==zO(t)&&r(BO(e,i))},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.target.blur())},className:$(o,e.type===`number`&&`text-right tabular-nums`)})}function HO({runId:e,list:t,editable:n}){let{def:r,rows:i}=t,[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)({}),l=`/api/runs/${e}/lists/${r.id}/rows`,u=async e=>{o(null);try{await e()}catch(e){o(e instanceof HE?e.message:String(e))}},d=()=>u(async()=>{await GE.post(l,{cells:s}),c({})}),f=Object.values(s).some(e=>e!=null&&e!==``);if(!i.length&&!n)return(0,Z.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Q(`list.empty`)});let p=(e,t)=>t===0||e.type===`text`&&e.format?.style===`multiline`,m=(e,t,n)=>void u(()=>GE.patch(`${l}/${e}`,{cells:{[t]:n}}));return(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 sm:hidden`,children:[i.map(e=>(0,Z.jsxs)(`div`,{className:`rounded-lg bg-paper p-2 ring-1 ring-border-soft`,children:[(0,Z.jsx)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-1.5`,children:r.columns.map((t,r)=>(0,Z.jsxs)(`div`,{className:$(`min-w-0`,p(t,r)&&`col-span-2`),children:[(0,Z.jsx)(`div`,{className:`px-1 pb-0.5 text-[0.6875rem] text-ink-3`,children:t.name}),n?(0,Z.jsx)(VO,{boxed:!0,column:t,value:e.cells[t.id],onCommit:n=>m(e.id,t.id,n)}):(0,Z.jsx)(`div`,{className:$(`break-words px-1 text-[0.875rem]`,t.type===`number`&&`tabular-nums`),children:SD(t,e.cells[t.id],pb)||`—`})]},t.id))}),n?(0,Z.jsx)(`div`,{className:`mt-1 flex justify-end`,children:(0,Z.jsx)(Ab,{label:Q(`list.delete`),onClick:()=>void u(()=>GE.del(`${l}/${e.id}`)),children:(0,Z.jsx)(Wv,{className:`size-4`})})}):null]},e.id)),n?(0,Z.jsxs)(`div`,{className:`rounded-lg border border-input border-dashed p-2`,children:[(0,Z.jsx)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-1.5`,children:r.columns.map((e,t)=>(0,Z.jsxs)(`div`,{className:$(`min-w-0`,p(e,t)&&`col-span-2`),children:[(0,Z.jsx)(`div`,{className:`px-1 pb-0.5 text-[0.6875rem] text-ink-3`,children:e.name}),(0,Z.jsx)(VO,{boxed:!0,column:e,value:s[e.id],onCommit:t=>c(n=>({...n,[e.id]:t}))})]},e.id))}),(0,Z.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,Z.jsxs)(kb,{variant:`secondary`,size:`sm`,onClick:()=>f?void d():void 0,children:[(0,Z.jsx)(Sv,{className:`size-4`}),` `,Q(`run.addRow`)]})})]}):null]}),(0,Z.jsx)(`div`,{className:`hidden overflow-x-auto rounded-lg ring-1 ring-border-soft sm:block`,children:(0,Z.jsxs)(`table`,{className:`w-full text-[0.8125rem]`,children:[(0,Z.jsx)(`thead`,{className:`bg-paper-2 text-ink-2`,children:(0,Z.jsxs)(`tr`,{children:[r.columns.map(e=>(0,Z.jsx)(`th`,{className:`whitespace-nowrap px-3 py-2 text-left font-medium`,children:e.name},e.id)),n?(0,Z.jsx)(`th`,{className:`w-10`}):null]})}),(0,Z.jsxs)(`tbody`,{children:[i.map(e=>(0,Z.jsxs)(`tr`,{className:`border-border-soft border-t align-top`,children:[r.columns.map(t=>(0,Z.jsx)(`td`,{className:$(`min-w-[7.5rem]`,n?`px-1 py-0.5`:`px-3 py-2`),children:n?(0,Z.jsx)(VO,{column:t,value:e.cells[t.id],onCommit:n=>m(e.id,t.id,n)}):(0,Z.jsx)(`span`,{className:$(t.type===`number`&&`tabular-nums`),children:SD(t,e.cells[t.id],pb)})},t.id)),n?(0,Z.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,Z.jsx)(Ab,{label:Q(`list.delete`),className:`size-9`,onClick:()=>void u(()=>GE.del(`${l}/${e.id}`)),children:(0,Z.jsx)(Wv,{className:`size-3.5`})})}):null]},e.id)),n?(0,Z.jsxs)(`tr`,{className:`border-border-soft border-t bg-paper`,children:[r.columns.map(e=>(0,Z.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,Z.jsx)(VO,{column:e,value:s[e.id],onCommit:t=>c(n=>({...n,[e.id]:t}))})},e.id)),(0,Z.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,Z.jsx)(Ab,{label:Q(`run.addRow`),className:`size-9`,onClick:()=>f?void d():void 0,children:(0,Z.jsx)(Sv,{className:`size-4`})})})]}):null]})]})}),a?(0,Z.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:a}):null]})}function UO(e,t,n){return NS(`/api/runs/${e}/store/files/${t.split(`/`).map(encodeURIComponent).join(`/`)}${n?`?inline=1`:``}`)}var WO=[`bg-paper-3 text-ink-3`,`bg-moss-tint text-moss`,`bg-rose-tint text-rose`,`bg-ember-tint text-ember-strong`];function GO({runId:e,list:t}){let{def:n,rows:r}=t,i=n.columns.find(e=>e.id===n.check?.file),a=n.columns.find(e=>e.id===n.check?.status),o=a?.type===`select`?a.format.options:[],s=o[0]?.id,c=e=>a?String(e.cells[a.id]??s??``):``,l=e=>!a||c(e)===s,[u,d]=(0,y.useState)(()=>(r.find(l)??r[0])?.id??null),[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(null),g=`/api/runs/${e}/lists/${n.id}/rows`,_=r.find(e=>e.id===u)??r[0],v=f?r.filter(e=>l(e)||e.id===_?.id):r,b=r.filter(e=>!l(e)).length,x=n.columns.filter(e=>e!==i&&e!==a),S=x.filter(e=>e.id!==n.key),C=S.find(e=>e.type===`text`)??S[0],w=S.filter(e=>e!==C),T=async(e,t)=>{h(null);try{await GE.patch(`${g}/${e}`,{cells:t})}catch(e){h(e instanceof HE?e.message:String(e))}},E=e=>{let t=v.findIndex(e=>e.id===_?.id),n=v[Math.min(v.length-1,Math.max(0,t+e))];n&&d(n.id)},D=async e=>{if(!_||!a)return;let t=r.findIndex(e=>e.id===_.id),n=[...r.slice(t+1),...r.slice(0,t)].find(l);await T(_.id,{[a.id]:e}),n&&e!==s&&d(n.id)},ee=e=>{e.target.closest(`input, textarea, select`)||(e.key===`ArrowDown`||e.key===`ArrowUp`?(e.preventDefault(),E(e.key===`ArrowDown`?1:-1)):/^[1-9]$/.test(e.key)&&o[Number(e.key)]&&(e.preventDefault(),D(o[Number(e.key)].id)))};if(!r.length)return(0,Z.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Q(`list.empty`)});let O=i&&_?String(_.cells[i.id]??``).trim():``,k=O.split(`.`).pop()?.toLowerCase()??``,A=e=>WO[Math.min(Math.max(0,o.findIndex(t=>t.id===c(e))),3)];return(0,Z.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(280px,360px)_minmax(0,1fr)]`,onKeyDown:ee,children:[(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-col`,children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:Q(`check.progress`,{done:b,total:r.length})}),a?(0,Z.jsx)(`button`,{type:`button`,"aria-pressed":f,onClick:()=>p(e=>!e),className:$(`inline-flex h-8 items-center rounded-full px-3 text-[0.8125rem] ring-1 transition coarse:h-11`,f?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink`),children:Q(`check.onlyOpen`)}):null]}),(0,Z.jsx)(`ul`,{className:`flex max-h-[38vh] flex-col gap-1.5 overflow-y-auto p-0.5 pr-1 lg:max-h-[calc(100vh-15rem)]`,children:v.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>d(e.id),"aria-current":e.id===_?.id,className:$(`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left ring-1 transition`,e.id===_?.id?`bg-card shadow-soft ring-ember`:`bg-paper ring-border-soft hover:bg-card`),children:[(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`block truncate font-medium text-[0.875rem]`,children:C&&SD(C,e.cells[C.id],pb)||`—`}),(0,Z.jsx)(`span`,{className:`block truncate text-[0.75rem] text-ink-3 tabular-nums`,children:w.slice(0,2).map(t=>SD(t,e.cells[t.id],pb)).filter(Boolean).join(` · `)})]}),a?(0,Z.jsx)(`span`,{className:$(`shrink-0 rounded-full px-2 py-0.5 font-medium text-[0.6875rem]`,A(e)),children:o.find(t=>t.id===c(e))?.label??c(e)}):null]})},e.id))})]}),_?(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[o.length>1?(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[o.slice(1).map((e,t)=>(0,Z.jsxs)(kb,{size:`md`,variant:c(_)===e.id?`primary`:`secondary`,onClick:()=>void D(e.id),children:[c(_)===e.id?(0,Z.jsx)(c_,{className:`size-4`}):null,e.label,(0,Z.jsx)(`kbd`,{className:`ml-1 hidden rounded bg-black/10 px-1.5 text-[0.6875rem] lg:inline`,children:t+1})]},e.id)),c(_)===s?null:(0,Z.jsx)(kb,{size:`md`,variant:`ghost`,onClick:()=>void D(s??``),children:Q(`check.reopen`)})]}):null,(0,Z.jsx)(`div`,{className:`overflow-hidden rounded-lg bg-paper-2 ring-1 ring-border-soft`,children:O?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 border-border-soft border-b bg-card px-3 py-2 text-[0.8125rem]`,children:[(0,Z.jsx)(O_,{className:`size-3.5 shrink-0 text-ink-3`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:O.split(`/`).pop()}),(0,Z.jsx)(`a`,{href:UO(e,O,k===`pdf`),target:`_blank`,rel:`noreferrer`,className:`shrink-0 text-ink-2 underline-offset-2 hover:text-ink hover:underline`,children:Q(`run.openFull`)})]}),k===`pdf`?(0,Z.jsx)(`iframe`,{title:O,src:`${UO(e,O,!0)}#toolbar=0&navpanes=0&view=FitH`,className:`h-[46vh] w-full border-0 bg-white lg:h-[calc(100vh-27rem)] lg:min-h-[360px]`},O):[`png`,`jpg`,`jpeg`,`webp`].includes(k)?(0,Z.jsx)(`div`,{className:`flex max-h-[46vh] justify-center overflow-auto bg-white lg:max-h-[calc(100vh-27rem)]`,children:(0,Z.jsx)(`img`,{src:UO(e,O,!0),alt:O,className:`max-w-full object-contain`},O)}):(0,Z.jsx)(`p`,{className:`px-4 py-10 text-center text-[0.875rem] text-ink-3`,children:Q(`check.noPreview`)})]}):(0,Z.jsx)(`p`,{className:`px-4 py-14 text-center text-[0.875rem] text-ink-3`,children:Q(`check.noFile`)})}),(0,Z.jsx)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-2 sm:grid-cols-3`,children:x.map(e=>(0,Z.jsxs)(`div`,{className:$(`min-w-0`,e.type===`text`&&e.format?.style===`multiline`&&`col-span-full`),children:[(0,Z.jsx)(`div`,{className:`px-1 pb-0.5 text-[0.6875rem] text-ink-3`,children:e.name}),(0,Z.jsx)(VO,{boxed:!0,column:e,value:_.cells[e.id],onCommit:t=>void T(_.id,{[e.id]:t})})]},e.id))}),m?(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:m}):null]}):null]})}var KO={xlsx:`Excel`,csv:`CSV`,json:`JSON`,md:`Markdown`,zip:`ZIP`};function qO({runId:e,list:t}){return(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.formats.map(n=>(0,Z.jsx)(`a`,{href:NS(`/api/runs/${e}/lists/${t.def.id}/download?format=${n}`),className:`inline-flex h-9 items-center rounded-full bg-paper-2 px-3.5 font-medium text-[0.8125rem] text-ink-2 transition hover:bg-paper-3 hover:text-ink coarse:h-11 coarse:px-4`,children:KO[n]??n},n))})}function JO(e){return e>1e6?`${(e/1e6).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1e3))} KB`}function YO({runId:e}){let[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(!1);(0,y.useEffect)(()=>{t&&(o(!1),GE.get(`/api/runs/${e}/store`).then(i))},[t,e]);let s=r&&!r.files.length&&!r.connections.length&&!r.keepsSignIns&&r.lists.every(e=>!e.rows);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>n(!0),className:`inline-flex items-center gap-1.5 text-[0.8125rem] text-ink-4 transition hover:text-ink-2 coarse:min-h-11`,children:[(0,Z.jsx)(g_,{className:`size-3.5`}),` `,Q(`store.open`)]}),(0,Z.jsx)(Ub,{open:t,onClose:()=>n(!1),title:Q(`store.title`),wide:!0,children:r?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-5 text-[0.875rem]`,children:[(0,Z.jsx)(`p`,{className:`text-ink-3`,children:Q(`store.explain`)}),s?(0,Z.jsx)(`p`,{className:`text-ink-2`,children:Q(`store.empty`)}):null,r.lists.some(e=>e.rows)?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1`,children:r.lists.filter(e=>e.rows).map(e=>(0,Z.jsxs)(`li`,{className:`flex justify-between gap-3`,children:[(0,Z.jsx)(`span`,{children:e.title}),(0,Z.jsx)(`span`,{className:`text-ink-3 tabular-nums`,children:Q(`store.rows`,{n:e.rows})})]},e.id))}):null,r.connections.map(e=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(J_,{className:`size-4 text-ink-3`}),` `,e.account?.label]},e.id)),r.keepsSignIns?(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(c_,{className:`size-4 text-ink-3`}),` `,Q(`store.signIns`)]}):null,r.files.length?(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`mb-1 text-ink-3`,children:Q(`store.files`,{n:r.files.length,size:JO(r.files.reduce((e,t)=>e+t.size,0))})}),(0,Z.jsx)(`ul`,{className:`max-h-56 overflow-y-auto rounded-lg ring-1 ring-border-soft`,children:r.files.map(t=>(0,Z.jsx)(`li`,{className:`border-border-soft border-b last:border-0`,children:(0,Z.jsxs)(`a`,{href:NS(`/api/runs/${e}/store/files/${t.path}`),className:`flex items-center gap-2 px-3 py-2 text-[0.8125rem] hover:bg-paper-2 coarse:min-h-11`,title:t.source??void 0,children:[(0,Z.jsx)(O_,{className:`size-3.5 shrink-0 text-ink-3`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.path}),(0,Z.jsx)(`span`,{className:`text-ink-4 tabular-nums`,children:JO(t.size)})]})},t.path))})]}):null,(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 pt-1`,children:[s?(0,Z.jsx)(`span`,{}):a?(0,Z.jsxs)(kb,{variant:`secondary`,onClick:async()=>{await GE.del(`/api/runs/${e}/store`),i(await GE.get(`/api/runs/${e}/store`)),o(!1)},children:[(0,Z.jsx)(Wv,{className:`size-4`}),` `,Q(`store.confirmDelete`)]}):(0,Z.jsxs)(kb,{variant:`ghost`,onClick:()=>o(!0),children:[(0,Z.jsx)(Wv,{className:`size-4`}),` `,Q(`store.delete`)]}),(0,Z.jsx)(kb,{onClick:()=>n(!1),children:Q(`common.close`)})]})]}):(0,Z.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,Z.jsx)(Bb,{})})})]})}var XO=300;function ZO(){if(typeof MediaRecorder<`u`)return[`audio/webm;codecs=opus`,`audio/mp4`,`audio/webm`,`audio/ogg;codecs=opus`].find(e=>MediaRecorder.isTypeSupported(e))}function QO(e){return`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`}function $O({value:e,runId:t,onChange:n,onBusy:r}){let i=OD(e)?e:null,[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(0),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(null),[p,m]=(0,y.useState)(!1),[h,g]=(0,y.useState)(null),_=(0,y.useRef)(null),v=(0,y.useRef)(null),b=ZO(),x=lE&&!!b;(0,y.useEffect)(()=>()=>{_.current&&(_.current.recorder.onstop=null,_.current.stop())},[]),(0,y.useEffect)(()=>()=>{h&&URL.revokeObjectURL(h.url)},[h]);let S=async(e,i)=>{u(!0),r?.(!0),f(null);try{let r=await GE.upload(`/api/runs/${t}/uploads`,e);g({asset:r.id,url:URL.createObjectURL(e)}),n({asset:r.id,...i===void 0?{}:{seconds:i}})}catch(e){f(e.message)}finally{u(!1),r?.(!1)}},C=async()=>{f(null),m(!1);let e;try{e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}})}catch{m(!0);return}let t=[],n=new MediaRecorder(e,{mimeType:b,audioBitsPerSecond:48e3}),i=Date.now(),a=new AudioContext,s=a.createAnalyser();s.fftSize=256,a.createMediaStreamSource(e).connect(s);let l=new Uint8Array(s.fftSize),u=0,d=()=>{s.getByteTimeDomainData(l);let e=0;for(let t of l)e=Math.max(e,Math.abs(t-128));if(c(Math.min(1,e/64)),o((Date.now()-i)/1e3),(Date.now()-i)/1e3>=XO){p();return}u=requestAnimationFrame(d)},p=()=>{cancelAnimationFrame(u),n.state!==`inactive`&&n.stop();for(let t of e.getTracks())t.stop();a.close().catch(()=>void 0),_.current=null,o(null),c(0)};n.ondataavailable=e=>e.data.size&&t.push(e.data),n.onstop=()=>{let e=(n.mimeType||b||`audio/webm`).split(`;`)[0],r=e===`audio/mp4`?`m4a`:e===`audio/ogg`?`ogg`:`webm`,a=Math.max(1,Math.round((Date.now()-i)/1e3));S(new File(t,`sprachnotiz-${rO()}.${r}`,{type:e}),a)},_.current={recorder:n,stop:p},r?.(!0),n.start(1e3),u=requestAnimationFrame(d)},w=a!==null,T=(0,Z.jsxs)(kb,{variant:`secondary`,onClick:()=>v.current?.click(),children:[(0,Z.jsx)(E_,{className:`size-4`}),` `,Q(`voice.pick`)]});return(0,Z.jsxs)(`div`,{children:[w?(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-ember`,children:[(0,Z.jsxs)(`span`,{className:`relative flex size-11 shrink-0 items-center justify-center`,children:[(0,Z.jsx)(`span`,{className:`absolute inset-0 rounded-full bg-rose-tint transition-transform duration-75`,style:{transform:`scale(${.7+s*.5})`}}),(0,Z.jsx)(`span`,{className:`relative size-3.5 animate-pulse-dot rounded-full bg-rose`})]}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`font-medium text-[0.9375rem] tabular-nums`,children:QO(a)}),(0,Z.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:a>270?Q(`voice.left`,{s:Math.ceil(XO-a)}):Q(`voice.recording`)})]}),(0,Z.jsxs)(kb,{onClick:()=>_.current?.stop(),children:[(0,Z.jsx)(Bv,{className:`size-3.5 fill-current`}),` `,Q(`voice.stop`)]})]}):l?(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-4 text-[0.875rem] text-ink-3 ring-1 ring-input`,children:[(0,Z.jsx)(Bb,{className:`size-4`}),` `,Q(`run.uploading`)]}):i?(0,Z.jsxs)(`div`,{className:`rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,Z.jsx)(`audio`,{controls:!0,preload:`metadata`,src:h?.asset===i.asset?h.url:`/api/runs/${t}/assets/${i.asset}`,className:`h-11 w-full`}),i.transcript?(0,Z.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap px-1 text-[0.875rem] text-ink-2 leading-relaxed`,children:i.transcript}):null,(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:`px-1 text-[0.8125rem] text-ink-3`,children:i.seconds?QO(i.seconds):null}),(0,Z.jsxs)(`div`,{className:`flex gap-1`,children:[x?(0,Z.jsxs)(kb,{variant:`ghost`,size:`sm`,onClick:()=>void C(),children:[(0,Z.jsx)(Ev,{className:`size-3.5`}),` `,Q(`voice.again`)]}):null,(0,Z.jsx)(kb,{variant:`ghost`,size:`sm`,onClick:()=>n(void 0),children:Q(`voice.remove`)})]})]})]}):(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[x?(0,Z.jsxs)(kb,{variant:`secondary`,size:`lg`,onClick:()=>void C(),className:`w-full sm:w-auto`,children:[(0,Z.jsx)(cv,{className:`size-4`}),` `,Q(`voice.start`)]}):T,x&&p?T:null]}),p?(0,Z.jsx)(`p`,{className:`mt-2 rounded-lg bg-amber-tint px-3 py-2 text-[0.8125rem] text-ink-2 leading-relaxed`,children:Q(`voice.denied`)}):(0,Z.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3 leading-relaxed`,children:Q(x?`voice.why`:`voice.noRecorder`)})]}),(0,Z.jsx)(`input`,{ref:v,type:`file`,hidden:!0,accept:`audio/*`,capture:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&S(t,void 0)}}),d?(0,Z.jsx)(`div`,{className:`mt-2 text-[0.8125rem] text-rose`,children:d}):null]})}function ek(e,t){try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t}).format(e)}catch{return`${e.toFixed(2)} ${t}`}}function tk({field:e,value:t,values:n,onChange:r}){let i=e.columns??[],a=Array.isArray(t)&&t.length?t:[{}],o=$D(e,a,n),s=(e,t,n)=>{r(a.map((r,i)=>i===e?{...r,[t]:n}:r))},c=i.map(e=>e.kind===`text`&&e===i[0]?`minmax(0,3fr)`:`minmax(0,1fr)`).join(` `);return(0,Z.jsxs)(`div`,{className:`rounded-xl bg-card p-2 ring-1 ring-input`,children:[(0,Z.jsx)(`div`,{className:`hidden gap-2 px-2 pt-1 pb-2 text-[0.75rem] text-ink-3 sm:grid`,style:{gridTemplateColumns:`${c} 36px`},children:i.map(e=>(0,Z.jsx)(`div`,{className:e.kind===`text`?``:`text-right`,children:e.label},e.id))}),(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:a.map((e,t)=>(0,Z.jsxs)(`div`,{className:`grid grid-cols-6 gap-2 rounded-lg bg-paper p-2 sm:bg-transparent sm:p-0 sm:[grid-template-columns:var(--cols)]`,style:{"--cols":`${c} 36px`},children:[i.map((n,r)=>(0,Z.jsxs)(`label`,{className:$(`flex min-w-0 flex-col gap-1 sm:col-span-1`,r===0?`col-span-5`:i.length-1<=2?`col-span-3`:`col-span-2`),children:[(0,Z.jsx)(`span`,{className:`px-0.5 text-[0.6875rem] text-ink-3 sm:hidden`,children:n.label}),(0,Z.jsx)(`input`,{"aria-label":n.label,placeholder:n.label,inputMode:n.kind===`text`?`text`:`decimal`,autoComplete:`off`,value:String(e[n.id]??``),onChange:e=>s(t,n.id,e.target.value),className:$(`h-11 w-full min-w-0 rounded-md border border-transparent bg-paper-2 px-2.5 text-[0.875rem] outline-none placeholder:text-transparent focus:border-focus focus:bg-card sm:placeholder:text-ink-4`,n.kind!==`text`&&`text-right tabular-nums`)})]},n.id)),(0,Z.jsx)(Ab,{label:Q(`list.delete`),onClick:()=>r(a.filter((e,n)=>n!==t)),className:`order-first col-start-6 row-start-1 size-11 justify-self-end self-end sm:order-none sm:col-start-auto sm:row-start-auto`,children:(0,Z.jsx)(Wv,{className:`size-4`})})]},t))}),(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-end justify-between gap-3 px-2 pb-1`,children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>r([...a,{}]),className:`inline-flex h-9 items-center gap-1.5 rounded-full px-3 text-[0.8125rem] text-ink-2 hover:bg-accent coarse:h-11`,children:[(0,Z.jsx)(Sv,{className:`size-4`}),` `,Q(`run.addRow`)]}),(0,Z.jsxs)(`div`,{className:`text-right text-[0.8125rem] tabular-nums`,children:[(0,Z.jsxs)(`div`,{className:`text-ink-3`,children:[Q(`run.net`),` `,ek(o.net,o.currency)]}),o.vatRate?(0,Z.jsxs)(`div`,{className:`text-ink-3`,children:[Q(`run.vat`,{r:o.vatRate}),` `,ek(o.vat,o.currency)]}):null,(0,Z.jsxs)(`div`,{className:`font-semibold text-[0.9375rem] text-ink`,children:[Q(`run.total`),` `,ek(o.gross,o.currency)]})]})]})]})}function nk(e){return!!e?.closest(`input, textarea, [contenteditable='true']`)}function rk({field:e,value:t,runId:n,onChange:r,onBusy:i}){let a=(0,y.useRef)(null),o=(0,y.useRef)(null),s=(0,y.useRef)(null),c=(0,y.useRef)(null),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)({}),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(!1),[_,v]=(0,y.useState)(!1),[b,x]=(0,y.useState)(null),S=(0,y.useRef)(null),C=e=>{S.current=e,x(e)},w=e.kind===`image`,T=!!e.multiple,E=T?e.max??30:1,D=w||!!e.camera||!!e.video,ee=!w&&!!e.video,O=Array.isArray(t)?t:typeof t==`string`&&t?[t]:[],k=(0,y.useRef)(O);k.current=O;let A=O.length<E,te=async e=>{let t=(w?e.filter(e=>e.type.startsWith(`image/`)):e).sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0}));if(!t.length)return;let a=E-(T?k.current.length:0);u(!0),i?.(!0),m(t.length>a&&T?Q(`run.maxFiles`,{n:E}):null);try{for(let e of t.slice(0,Math.max(0,a))){let t=await nO(e),i=await GE.upload(`/api/runs/${n}/uploads`,t);f(e=>({...e,[i.id]:{name:i.name,mime:i.mime}}));let a=T?[...k.current,i.id]:i.id;k.current=T?a:[i.id],r(a)}}catch(e){m(e.message)}finally{u(!1),i?.(!1)}},ne=(0,y.useRef)(te);ne.current=te;let re=e=>{let t=O.filter(t=>t!==e);r(T?t:void 0)},ie=(e,t)=>{let n=k.current.indexOf(e),i=Math.min(k.current.length-1,Math.max(0,t));if(n<0||n===i)return;let a=k.current.filter(t=>t!==e);a.splice(i,0,e),k.current=a,r(a)},ae=T&&O.length>1;(0,y.useEffect)(()=>{if(!A)return;let e=e=>{let t=Array.from(e.clipboardData?.files??[]),n=a.current;if(!t.length||!n||nk(document.activeElement))return;let r=document.querySelectorAll(`[data-upload-field]`);(n.matches(`:hover`)||n.contains(document.activeElement)||r.length===1)&&(e.preventDefault(),ne.current(t))};return document.addEventListener(`paste`,e),()=>document.removeEventListener(`paste`,e)},[A]);let oe=$(`flex flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-3 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink`,O.length?`py-4`:`py-8`);return(0,Z.jsxs)(`div`,{ref:a,"data-upload-field":``,onDragOver:e=>{A&&(e.preventDefault(),v(!0))},onDragLeave:()=>v(!1),onDrop:e=>{v(!1),A&&(e.preventDefault(),te(Array.from(e.dataTransfer.files)))},children:[O.length?(0,Z.jsx)(`div`,{className:`mb-2 flex flex-col gap-2`,children:O.map((e,t)=>{let r=d[e],i=r?.mime??(w?`image/`:``);return(0,Z.jsxs)(`div`,{"data-file-id":e,className:$(`flex items-center gap-3 rounded-xl bg-card p-2 ring-1 ring-input transition-shadow`,b===e&&`relative z-10 shadow-elevated ring-2 ring-ember`),children:[ae?(0,Z.jsxs)(`button`,{type:`button`,"aria-label":Q(`run.moveFile`,{n:t+1}),title:Q(`run.moveFileHint`),className:$(`-mr-1 flex h-14 w-9 shrink-0 touch-none flex-col items-center justify-center gap-0.5 rounded-lg text-ink-3 hover:bg-paper-2 hover:text-ink`,b===e?`cursor-grabbing`:`cursor-grab`),onPointerDown:t=>{try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}C(e)},onPointerMove:t=>{if(S.current!==e)return;let n=document.elementFromPoint(t.clientX,t.clientY)?.closest(`[data-file-id]`),r=n?.getAttribute(`data-file-id`);r&&r!==e&&a.current?.contains(n??null)&&ie(e,k.current.indexOf(r))},onPointerUp:()=>C(null),onPointerCancel:()=>C(null),onKeyDown:n=>{(n.key===`ArrowUp`||n.key===`ArrowDown`)&&(n.preventDefault(),ie(e,t+(n.key===`ArrowUp`?-1:1)))},children:[(0,Z.jsx)(`span`,{className:`font-medium text-[0.75rem] tabular-nums`,children:t+1}),(0,Z.jsx)(R_,{className:`size-4`})]}):null,i.startsWith(`image/`)?(0,Z.jsx)(`img`,{src:NS(`/api/runs/${n}/assets/${e}`),alt:``,className:`size-14 rounded-lg object-cover`}):(0,Z.jsx)(`div`,{className:`flex size-12 shrink-0 items-center justify-center rounded-lg bg-paper-2`,children:i.startsWith(`video/`)?(0,Z.jsx)(A_,{className:`size-5 text-ink-3`}):(0,Z.jsx)(mv,{className:`size-5 text-ink-3`})}),(0,Z.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-[0.875rem]`,children:r?.name??`✓`}),(0,Z.jsx)(Ab,{label:Q(`run.removeFile`),onClick:()=>re(e),children:(0,Z.jsx)(iy,{className:`size-4`})})]},e)})}):null,A?(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>o.current?.click(),className:$(oe,`min-w-[9rem] flex-1 px-4`,_&&`border-ember text-ink`),children:[w?(0,Z.jsx)(B_,{className:`size-6`}):(0,Z.jsx)(mv,{className:`size-6`}),l?Q(`run.uploading`):O.length?Q(`run.uploadMore`):Q(cE?`run.uploadTouch`:`run.upload`)]}),D?(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>lE?g(!0):s.current?.click(),className:$(oe,`w-28`),children:[(0,Z.jsx)(o_,{className:`size-6`}),Q(`run.camera`)]}):null,ee&&!(lE&&pO)?(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>c.current?.click(),className:$(oe,`w-28`),children:[(0,Z.jsx)(Qv,{className:`size-6`}),Q(`camera.video`)]}):null]}):null,(0,Z.jsx)(`input`,{ref:o,type:`file`,hidden:!0,multiple:T,accept:w?`image/*`:void 0,onChange:e=>{te(Array.from(e.target.files??[])),e.target.value=``}}),(0,Z.jsx)(`input`,{ref:s,type:`file`,hidden:!0,accept:`image/*`,capture:`environment`,onChange:e=>{te(Array.from(e.target.files??[])),e.target.value=``}}),ee?(0,Z.jsx)(`input`,{ref:c,type:`file`,hidden:!0,accept:`video/*`,capture:`environment`,onChange:e=>{te(Array.from(e.target.files??[])),e.target.value=``}}):null,(0,Z.jsx)(mO,{open:h,multiple:T,video:ee,onClose:()=>g(!1),onCapture:e=>te([e]),onNative:()=>s.current?.click()}),T&&(e.min||e.max)?(0,Z.jsx)(`div`,{className:`mt-2 text-[0.8125rem] text-ink-3 tabular-nums`,children:e.min&&O.length<e.min?Q(`run.filesMin`,{n:O.length,min:e.min}):e.max?Q(`run.filesOf`,{n:O.length,max:e.max}):null}):null,p?(0,Z.jsx)(`div`,{className:`mt-2 text-[0.8125rem] text-rose`,children:p}):null]})}function ik(e){let t=`${e.id} ${e.label}`.toLowerCase();return/telefon|phone|handy|mobil(?!it)|\btel\b|rückruf/.test(t)?{type:`tel`,inputMode:`tel`,autoComplete:`tel`}:/\bplz\b|postleitzahl|postal|zip/.test(t)?{inputMode:`numeric`,autoComplete:`postal-code`}:/iban/.test(t)?{autoCapitalize:`characters`,autoCorrect:`off`,spellCheck:!1}:/vorname|first.?name/.test(t)?{autoComplete:`given-name`,autoCapitalize:`words`}:/nachname|last.?name|surname/.test(t)?{autoComplete:`family-name`,autoCapitalize:`words`}:/firma|unternehmen|company|organi[sz]ation/.test(t)?{autoComplete:`organization`,autoCapitalize:`words`}:/straße|strasse|street|anschrift|adresse|address/.test(t)?{autoComplete:`street-address`,autoCapitalize:`words`}:/\b(ort|stadt|city|town)\b/.test(t)?{autoComplete:`address-level2`,autoCapitalize:`words`}:/\bname\b|ansprechp/.test(t)?{autoComplete:`name`,autoCapitalize:`words`}:{autoCapitalize:`sentences`}}function ak({field:e,value:t,onChange:n}){let[r,i]=(0,y.useState)(!1);return(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(Nb,{value:t,placeholder:e.placeholder,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,onChange:e=>n(e.target.value)}),(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`inline-flex h-11 shrink-0 items-center gap-2 rounded-lg border border-input bg-card px-3.5 font-medium text-[0.875rem] text-ink-2 transition hover:border-ember hover:text-ink`,children:[(0,Z.jsx)(Ov,{className:`size-4`}),` `,Q(`scan.button`)]}),(0,Z.jsx)(kO,{open:r,onClose:()=>i(!1),onResult:n})]})}function ok({field:e,value:t,values:n,runId:r,view:i,onChange:a,onBusy:o,error:s,closed:c}){let l=t==null?``:String(t),u=new Set(c?.values.map(String)),d;switch(e.kind){case`textarea`:d=(0,Z.jsx)(Fb,{value:l,placeholder:e.placeholder,autoCapitalize:`sentences`,enterKeyHint:`enter`,onChange:e=>a(e.target.value)});break;case`number`:d=(0,Z.jsx)(Nb,{inputMode:`decimal`,autoComplete:`off`,value:l,placeholder:e.placeholder,onChange:e=>a(e.target.value)});break;case`select`:{let t=e.options??[];d=t.length<=5&&t.every(e=>e.length<=28)?(0,Z.jsx)(Lb,{value:l,options:t,onChange:a,disabled:[...u]}):(0,Z.jsx)(Ib,{value:l,placeholder:`—`,onChange:a,options:t.map(e=>({value:e,label:e,disabled:u.has(e)}))});break}case`multiselect`:d=(0,Z.jsx)(Lb,{multi:!0,value:Array.isArray(t)?t:[],options:e.options??[],onChange:a});break;case`date`:d=(0,Z.jsx)(Nb,{type:`date`,value:l,onChange:e=>a(e.target.value),className:`w-full sm:w-56`});break;case`email`:d=(0,Z.jsx)(Nb,{type:`email`,inputMode:`email`,autoComplete:`email`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,value:l,placeholder:e.placeholder,onChange:e=>a(e.target.value)});break;case`url`:d=(0,Z.jsx)(Nb,{type:`url`,inputMode:`url`,autoComplete:`url`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,value:l,placeholder:e.placeholder??`https://`,onChange:e=>a(e.target.value)});break;case`toggle`:d=(0,Z.jsx)(Rb,{checked:t===!0,onChange:a,label:e.label,disabled:u.has(String(t!==!0))});break;case`color`:d=(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Pb,{value:l||`#e0531b`,onChange:e=>a(e.target.value)}),(0,Z.jsx)(Nb,{value:l,placeholder:`#e0531b`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,onChange:e=>a(e.target.value),className:`w-36`})]});break;case`image`:case`file`:d=(0,Z.jsx)(rk,{field:e,value:t,runId:r,onChange:a,onBusy:o});break;case`items`:d=(0,Z.jsx)(tk,{field:e,value:t,values:n,onChange:a});break;case`connection`:d=(0,Z.jsx)(RO,{runId:r,connection:i?.connections.find(t=>t.id===e.connection)});break;case`list`:{let t=i?.lists.find(t=>t.def.id===e.list);d=t?(0,Z.jsx)(HO,{runId:r,list:t,editable:!0}):null;break}case`location`:d=(0,Z.jsx)(yO,{value:t,runId:r,placeholder:e.placeholder,onChange:a,onBusy:o});break;case`audio`:d=c?null:(0,Z.jsx)($O,{value:t,runId:r,onChange:a,onBusy:o});break;case`signature`:d=(0,Z.jsx)(IO,{label:e.label,value:t,runId:r,onChange:a});break;default:d=e.scan?(0,Z.jsx)(ak,{field:e,value:l,onChange:a}):(0,Z.jsx)(Nb,{...ik(e),value:l,placeholder:e.placeholder,onChange:e=>a(e.target.value)})}return(0,Z.jsxs)(`div`,{children:[e.kind===`toggle`?(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-6`,children:[(0,Z.jsx)(zb,{hint:e.help,children:e.label}),d]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(zb,{hint:e.help,required:e.required,children:e.label}),d]}),c?(0,Z.jsx)(`div`,{className:`mt-1.5 text-[0.8125rem] text-ink-3`,children:Q(`run.closed`,{list:c.classes.map(e=>Q(`run.cls.${sk[e]}`)).join(`, `)})}):null,s?(0,Z.jsx)(`div`,{className:`mt-1.5 text-[0.8125rem] text-rose`,children:s}):null]})}var sk={classifier:`text`,standard:`text`,high:`text`,highest:`text`,image:`image`,video:`video`,speech:`speech`,audio:`audio`},ck=45e3;function lk(e){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)({});(0,y.useEffect)(()=>{if(n(null),o(!1),!e)return;let t=!1,r=0,i,a=null,s=Date.now(),c=()=>{t=!0,a?.close(),o(!0)},l=async()=>{try{let r=await GE.get(`/api/runs/${e}`);t||n(r)}catch(e){e instanceof HE&&e.status===404&&c()}},u=()=>{if(clearTimeout(i),a?.close(),t)return;let o=new EventSource(NS(`/api/runs/${e}/stream`),{withCredentials:!0});a=o,s=Date.now(),o.addEventListener(`view`,e=>{r=0,s=Date.now(),n(JSON.parse(e.data))}),o.addEventListener(`ping`,()=>{s=Date.now()}),o.onerror=()=>{o.close(),!(t||a!==o)&&(a=null,l(),r=Math.min(r+1,6),i=setTimeout(u,500*2**r))}},d=()=>{t||document.visibilityState!==`visible`||(!a||a.readyState===EventSource.CLOSED||Date.now()-s>ck?(r=0,u()):l())},f=setInterval(()=>{!t&&a&&Date.now()-s>ck&&(r=0,u())},15e3);return u(),document.addEventListener(`visibilitychange`,d),window.addEventListener(`pageshow`,d),window.addEventListener(`online`,d),()=>{t=!0,clearTimeout(i),clearInterval(f),document.removeEventListener(`visibilitychange`,d),window.removeEventListener(`pageshow`,d),window.removeEventListener(`online`,d),a?.close()}},[e]);let d=(0,y.useCallback)(async(t,n)=>{if(!e)return!1;c(!0),i(null),u({});try{return await GE.post(`/api/runs/${e}/${t}`,n),!0}catch(e){return e instanceof HE&&e.status===422&&Array.isArray(e.body?.fields)&&u(Object.fromEntries(e.body.fields.map(e=>[e.field,e.message]))),i(e.message),!1}finally{c(!1)}},[e]);return{view:t,notFound:a,error:r,busy:s,fieldErrors:l,submitPage:(e,t)=>d(`pages/${e}`,{values:t}),accept:(e,t)=>d(`reviews/${e}`,{type:`accept`,edits:t}),regenerate:(e,t,n,r)=>d(`reviews/${e}`,{type:`regenerate`,target:t,note:n,items:r?.length?r:void 0}),back:()=>d(`back`),retry:()=>d(`retry`)}}function uk({view:e}){let t=Math.round(Math.min(e.progress.done,e.progress.total)/Math.max(1,e.progress.total)*100);return(0,Z.jsx)(`div`,{className:`h-[3px] w-full bg-paper-2`,children:(0,Z.jsx)(`div`,{className:`h-full bg-ember transition-[width] duration-700 ease-out`,style:{width:`${t}%`}})})}function dk({title:e,description:t,kicker:n}){return(0,Z.jsxs)(`div`,{className:`mb-8`,children:[n?(0,Z.jsx)(`p`,{className:`mb-4 text-[0.9375rem] text-ink-2 leading-relaxed`,children:n}):null,(0,Z.jsx)(`h1`,{className:`font-display font-semibold text-[1.75rem] leading-[1.15] tracking-tight sm:text-[2rem]`,children:e}),t?(0,Z.jsx)(`p`,{className:`mt-2 text-[0.9375rem] text-ink-3 leading-relaxed`,children:t}):null]})}function fk(e,t){let n={};for(let r of e.fields)n[r.id]=t.values[r.id]??t.prefill?.[r.id]??r.default??(r.kind===`multiselect`?[]:void 0);return n}function pk(e){return Array.from(e.querySelectorAll(`input:not([type="hidden"], [type="file"], [type="checkbox"], [type="color"], [type="range"], [disabled]), textarea:not([disabled])`)).filter(e=>!e.closest(`dialog`)&&e.offsetParent!==null)}function mk({view:e,run:t,step:n}){let[r,i]=(0,y.useState)(()=>fk(n,e)),[a,o]=(0,y.useState)(new Set),s=(0,y.useRef)(null),c=e.progress.done===0,l=()=>void t.submitPage(n.id,r);return(0,y.useEffect)(()=>{if(!s.current)return;let e=pk(s.current).filter(e=>e instanceof HTMLInputElement);for(let[t,n]of e.entries())(n.dataset.hint||!n.hasAttribute(`enterkeyhint`))&&(n.dataset.hint=`1`,n.setAttribute(`enterkeyhint`,t===e.length-1?`go`:`next`))}),(0,Z.jsxs)(`form`,{ref:s,className:`animate-rise`,onSubmit:e=>{e.preventDefault(),a.size||l()},onKeyDown:e=>{let t=e.target;if(e.key!==`Enter`||e.defaultPrevented||e.nativeEvent.isComposing||!(t instanceof HTMLInputElement)||t.closest(`dialog`))return;let n=pk(e.currentTarget),r=n[n.indexOf(t)+1];r&&(e.preventDefault(),r.focus())},children:[(0,Z.jsx)(dk,{title:n.title,description:n.description,kicker:c?e.wizard.intro:null}),(0,Z.jsx)(`div`,{className:`flex flex-col gap-7`,children:n.fields.map(n=>(0,Z.jsx)(ok,{field:n,value:r[n.id],values:r,runId:e.id,view:e,error:t.fieldErrors[n.id],closed:e.closed?.[n.id],onChange:e=>i(t=>({...t,[n.id]:e})),onBusy:e=>o(t=>{if(t.has(n.id)===e)return t;let r=new Set(t);return e?r.add(n.id):r.delete(n.id),r})},n.id))}),(0,Z.jsx)(hk,{view:e,run:t,sticky:!0,children:(0,Z.jsxs)(kb,{type:`submit`,size:`lg`,busy:t.busy,disabled:a.size>0,children:[n.cta||Q(`run.next`),` `,(0,Z.jsx)(Xg,{className:`size-4`})]})})]})}function hk({view:e,run:t,sticky:n,children:r}){return(0,Z.jsxs)(`div`,{className:$(`mt-10 flex items-center justify-between gap-3`,n&&`action-bar`),children:[e.canBack?(0,Z.jsxs)(kb,{variant:`ghost`,onClick:()=>void t.back(),disabled:t.busy,children:[(0,Z.jsx)(Jg,{className:`size-4`}),` `,Q(`run.back`)]}):(0,Z.jsx)(`span`,{}),r]})}function gk(){let e=bE(),[t,n]=(0,y.useState)(!1),r=e!==`off`;return(0,Z.jsxs)(`div`,{className:`mt-6 flex flex-col items-center gap-2`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":r,disabled:t,onClick:async()=>{if(r){CE();return}n(!0),await SE(),n(!1)},className:$(`inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[0.875rem] ring-1 transition`,r?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink hover:ring-ink-4`),children:[r?(0,Z.jsx)(e_,{className:`size-4 text-ember-strong`}):(0,Z.jsx)(n_,{className:`size-4`}),Q(r?`notify.on`:`notify.ask`)]}),(0,Z.jsx)(`p`,{className:`max-w-xs text-[0.75rem] text-ink-4 leading-relaxed`,children:Q(e===`off`?`notify.why`:e===`on`?`notify.onHint`:xE()?`notify.blocked`:`notify.quiet`)})]})}function _k({view:e,compact:t,awake:n}){let r=(0,y.useMemo)(()=>{let t=[...e.events].reverse().find(t=>t.type===`step_started`&&t.stepId===e.step?.id);return t?new Date(t.at).getTime():Date.now()},[e.events,e.step?.id]),[i,a]=(0,y.useState)(Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(e)},[]);let o=[...e.events].reverse().find(t=>t.type===`step_started`&&t.stepId===e.step?.id)?.message??e.step?.title??Q(`run.working`),s=e.events.filter(e=>(e.type===`tool`||e.type===`info`)&&new Date(e.at).getTime()>=r-500),c=s.slice(-4),l=[...new Set(s.map(e=>e.asset).filter(e=>!!e))],u=[...s].reverse().find(e=>e.asset)?.asset;return(0,Z.jsxs)(`div`,{className:`flex animate-rise flex-col items-center pt-6 text-center`,children:[(0,Z.jsx)(kS,{kind:e.wizard.avatar,size:t?130:170,fluffy:!0}),(0,Z.jsx)(`h2`,{className:`mt-4 font-display font-semibold text-[1.375rem] tracking-tight`,children:o}),(0,Z.jsx)(`div`,{className:`mt-1 text-[0.8125rem] text-ink-4 tabular-nums`,children:Q(`run.elapsed`,{s:Math.max(0,Math.round((i-r)/1e3))})}),l.length?(0,Z.jsx)(`div`,{className:`mt-5 flex max-w-full flex-wrap justify-center gap-2`,children:l.slice(-8).map(t=>(0,Z.jsx)(`img`,{src:NS(`/api/runs/${e.id}/assets/${t}`),alt:``,className:$(`size-16 animate-rise rounded-lg bg-paper-2 object-cover ring-1 ring-border-soft transition sm:size-20`,t===u?`ring-2 ring-ember`:`opacity-70`)},t))}):null,(0,Z.jsx)(`div`,{className:`mt-6 flex min-h-[7rem] w-full max-w-sm flex-col gap-1.5`,children:c.map((e,t)=>(0,Z.jsxs)(`div`,{className:$(`flex items-center justify-center gap-2 text-[0.8125rem] transition-opacity`,t===c.length-1?`text-ink-2`:`text-ink-4`),children:[t===c.length-1?(0,Z.jsx)(Rv,{className:`size-3.5 animate-breathe text-ember`}):null,(0,Z.jsx)(`span`,{className:`truncate`,children:_b(e)})]},e.id))}),t?null:(0,Z.jsx)(gk,{}),n?(0,Z.jsx)(`p`,{className:`mt-3 text-[0.75rem] text-ink-4`,children:Q(`run.awake`)}):null]})}function vk(e){let t=(0,y.useRef)({running:!1,since:0,ask:null});(0,y.useEffect)(()=>{if(!e)return;let n=t.current,r=e.status===`running`,i=r?n.running?n.since:Date.now():0,a=t=>{document.visibilityState!==`visible`&&!document.title.startsWith(`● `)&&(document.title=`● ${document.title}`),TE({title:e.wizard.title,body:t,tag:e.id})};r&&e.ask&&e.ask.id!==n.ask?a(Q(`notify.needsYou`)):!r&&n.running&&Date.now()-n.since>8e3&&a(e.status===`failed`?Q(`run.failed`):e.status===`done`?Q(`notify.done`):Q(`notify.next`)),t.current={running:r,since:i,ask:e.ask?.id??null}},[e]),(0,y.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&document.title.startsWith(`● `)&&(document.title=document.title.slice(2))};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[])}function yk({view:e,run:t,step:n}){let[r,i]=(0,y.useState)({}),[a,o]=(0,y.useState)({}),[s,c]=(0,y.useState)(``),l=e.shown.filter(e=>e.output),[u,d]=(0,y.useState)(l.length===1?l[0].step.id:null),[f,p]=(0,y.useState)({}),m=(0,y.useRef)(null),h=l.find(e=>e.step.id===u),g=h?.step.type===`generate`&&(h.output?.assets?.length??0)>1,_=()=>{h&&s.trim()&&t.regenerate(n.id,h.step.id,s.trim(),f[h.step.id])};return(0,Z.jsxs)(`div`,{className:`animate-rise`,children:[(0,Z.jsx)(dk,{title:n.title,description:n.description}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[e.shown.map(({step:t,output:s})=>{let c=!!n.edit&&t.type===`agent`&&t.output.format!==`json`;return(0,Z.jsxs)(`section`,{children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`h3`,{className:`font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]`,children:t.title}),(0,Z.jsx)(`div`,{className:`flex items-center`,children:c&&!a[t.id]?(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>({...e,[t.id]:!0})),className:`inline-flex h-8 items-center gap-1.5 rounded-full px-3 text-[0.8125rem] text-ink-2 hover:bg-accent hover:text-ink coarse:h-11`,children:[(0,Z.jsx)(bv,{className:`size-3.5`}),` `,Q(`run.edit`)]}):null})]}),(0,Z.jsx)(IE,{base:`/api/runs/${e.id}`,step:t,output:s,editable:c&&a[t.id],draft:r[t.id],onDraft:e=>i(n=>({...n,[t.id]:e})),picked:f[t.id],onPick:n.regenerate?e=>{d(t.id),p(n=>{let r=n[t.id]??[];return{...n,[t.id]:r.includes(e)?r.filter(t=>t!==e):[...r,e]}}),m.current?.focus()}:void 0})]},t.id)}),e.lists.map(t=>(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h3`,{className:`mb-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]`,children:t.def.title}),t.def.check?(0,Z.jsx)(GO,{runId:e.id,list:t}):(0,Z.jsx)(HO,{runId:e.id,list:t,editable:!0})]},t.def.id)),n.regenerate&&l.length?(0,Z.jsxs)(Vb,{className:`p-3`,children:[l.length>1?(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-1 pb-2`,children:[(0,Z.jsx)(`span`,{className:`mr-1 text-[0.8125rem] text-ink-3`,children:Q(`run.feedbackTarget`)}),l.map(({step:e})=>(0,Z.jsx)(`button`,{type:`button`,"aria-pressed":u===e.id,onClick:()=>{d(e.id),m.current?.focus()},className:$(`inline-flex h-8 items-center rounded-full px-3 text-[0.8125rem] ring-1 transition coarse:h-11`,u===e.id?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink`),children:e.title},e.id))]}):null,(0,Z.jsx)(Fb,{ref:m,minRows:2,maxRows:8,value:s,placeholder:Q(`run.feedbackPlaceholder`),onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())},className:`border-0 bg-transparent shadow-none focus:ring-0`}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1 pt-1`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 text-[0.75rem] text-ink-3`,children:g?f[h.step.id]?.length?Q(`run.regeneratePicked`,{n:[...f[h.step.id]].sort((e,t)=>e-t).map(e=>e+1).join(`, `)}):Q(`run.regenerateAll`):!h&&s.trim()?Q(`run.feedbackPick`):null}),(0,Z.jsxs)(kb,{size:`sm`,variant:`secondary`,busy:t.busy,disabled:!s.trim()||!h,onClick:_,children:[(0,Z.jsx)(wv,{className:`size-3.5`}),` `,Q(`run.regenerateGo`)]})]})]}):null]}),(0,Z.jsx)(hk,{view:e,run:t,sticky:!0,children:(0,Z.jsxs)(kb,{size:`lg`,busy:t.busy,onClick:()=>void t.accept(n.id,Object.keys(r).length?r:void 0),children:[Q(`run.accept`),` `,(0,Z.jsx)(Xg,{className:`size-4`})]})})]})}function bk({view:e,run:t,step:n,onRestart:r}){let i=e.shown.filter(e=>e.output);return(0,Z.jsxs)(`div`,{className:`animate-rise`,children:[(0,Z.jsxs)(`div`,{className:`mb-8 flex flex-wrap items-center gap-x-4 gap-y-5`,children:[(0,Z.jsx)(kS,{kind:e.wizard.avatar,size:64}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 basis-[12rem]`,children:[(0,Z.jsx)(`h1`,{className:`text-balance font-display font-semibold text-[1.75rem] leading-tight tracking-tight sm:text-[2rem]`,children:n.title}),n.message?(0,Z.jsx)(`p`,{className:`mt-1 text-[0.9375rem] text-ink-3`,children:n.message}):null]}),e.shown.some(e=>e.output)?(0,Z.jsx)(`div`,{className:`max-sm:basis-full`,children:(0,Z.jsx)(JE,{runId:e.id,title:`${n.title} · ${e.wizard.title}`,initial:e.shareUrl?{url:e.shareUrl,expiresAt:e.expiresAt}:null})}):null]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i.map(({step:t,output:n,formats:r,label:i})=>(0,Z.jsxs)(Vb,{className:`p-4 sm:p-5`,children:[(0,Z.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsx)(`h3`,{className:`font-display font-semibold text-[1.0625rem]`,children:i??t.title}),(0,Z.jsx)(VE,{base:`/api/runs/${e.id}`,stepId:t.id,formats:r,title:i??t.title})]}),(0,Z.jsx)(IE,{base:`/api/runs/${e.id}`,step:t,output:n}),n?.assets?.some(e=>e.ai)?(0,Z.jsx)(`p`,{className:`mt-3 text-[0.75rem] text-ink-3 leading-relaxed`,children:Q(`ai.publish`)}):null]},t.id)),e.lists.map(t=>(0,Z.jsxs)(Vb,{className:`p-4 sm:p-5`,children:[(0,Z.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsx)(`h3`,{className:`font-display font-semibold text-[1.0625rem]`,children:t.label??t.def.title}),(0,Z.jsx)(qO,{runId:e.id,list:t})]}),(0,Z.jsx)(HO,{runId:e.id,list:t,editable:!0})]},t.def.id))]}),(0,Z.jsx)(hk,{view:e,run:t,children:r?(0,Z.jsxs)(kb,{variant:`secondary`,onClick:r,children:[(0,Z.jsx)(Ev,{className:`size-4`}),` `,Q(`run.again`)]}):(0,Z.jsx)(`span`,{})})]})}function xk({view:e,run:t}){return(0,Z.jsxs)(`div`,{className:`flex animate-rise flex-col items-center pt-8 text-center`,children:[(0,Z.jsx)(kS,{kind:e.wizard.avatar,size:90}),(0,Z.jsx)(`h2`,{className:`mt-4 font-display font-semibold text-[1.375rem]`,children:Q(`run.failed`)}),(0,Z.jsx)(`p`,{className:`mt-2 max-w-md text-[0.9375rem] text-ink-3`,children:e.error}),(0,Z.jsxs)(`div`,{className:`mt-8 flex gap-3`,children:[e.canBack?(0,Z.jsxs)(kb,{variant:`ghost`,onClick:()=>void t.back(),children:[(0,Z.jsx)(Jg,{className:`size-4`}),` `,Q(`run.back`)]}):null,(0,Z.jsxs)(kb,{onClick:()=>void t.retry(),busy:t.busy,children:[(0,Z.jsx)(Ev,{className:`size-4`}),` `,Q(`run.retry`)]})]})]})}function Sk({runId:e,compact:t,onRestart:n,onView:r,stickyProgress:i}){let a=lk(e),{view:o}=a;(0,y.useEffect)(()=>{r?.(o)},[o,r]),uE();let s=dE(o?.status===`running`&&!o.ask);if(vk(o),a.notFound)return(0,Z.jsx)(`div`,{className:`py-24 text-center text-ink-3`,children:Q(`run.notFound`)});if(!o)return(0,Z.jsx)(`div`,{className:`flex justify-center py-24 text-ink-4`,children:(0,Z.jsx)(Bb,{})});let c=o.step,l=null;if(o.status===`running`&&o.ask)l=(0,Z.jsx)(YE,{runId:o.id,ask:o.ask},o.ask.id);else if(o.status===`running`)l=(0,Z.jsx)(_k,{view:o,compact:t,awake:s});else if(o.status===`failed`)l=(0,Z.jsx)(xk,{view:o,run:a});else if(o.status===`cancelled`)l=(0,Z.jsx)(`div`,{className:`py-24 text-center text-ink-3`,children:Q(`run.cancelled`)});else if(c?.type===`page`)l=(0,Z.jsx)(mk,{view:o,run:a,step:c},c.id);else if(c?.type===`review`){let e=o.shown.map(e=>e.output?.at??``).join(`|`);l=(0,Z.jsx)(yk,{view:o,run:a,step:c},`${c.id}:${e}`)}else c?.type===`result`&&(l=(0,Z.jsx)(bk,{view:o,run:a,step:c,onRestart:n}));let u=c?.type===`review`&&o.status===`waiting_input`&&o.lists.some(e=>e.def.check);return(0,Z.jsxs)(`div`,{className:`flex min-h-full flex-col`,children:[i?(0,Z.jsx)(`div`,{className:`sticky top-0 z-10`,children:(0,Z.jsx)(uk,{view:o})}):(0,Z.jsx)(uk,{view:o}),(0,Z.jsxs)(`div`,{className:$(`safe-x mx-auto w-full flex-1`,u?`max-w-[1240px] py-8`:t?`max-w-[620px] py-8`:`max-w-[640px] py-8 sm:py-16`),children:[l,a.error&&o.status!==`failed`?(0,Z.jsx)(`div`,{className:`mt-4 rounded-lg bg-rose-tint px-4 py-3 text-[0.875rem] text-rose`,children:a.error}):null,o.keeps&&o.status!==`running`?(0,Z.jsx)(`div`,{className:`mt-10 flex justify-center`,children:(0,Z.jsx)(YO,{runId:o.id})}):null]})]})}var Ck=Object.defineProperty,wk=(e,t,n)=>t in e?Ck(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tk=(e,t)=>{for(var n in t)Ck(e,n,{get:t[n],enumerable:!0})},Ek=(e,t,n)=>wk(e,typeof t==`symbol`?t:t+``,n),Dk={};Tk(Dk,{Graph:()=>fA,alg:()=>Bk});var Ok=Object.defineProperty,kk=(e,t)=>{for(var n in t)Ok(e,n,{get:t[n],enumerable:!0})},Ak=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=Nk(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=Pk(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,jk(this._preds[a],i),jk(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?Fk(this._isDirected,e):Nk(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?Fk(this._isDirected,e):Nk(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?Fk(this._isDirected,e):Nk(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],Mk(this._preds[t],e),Mk(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function jk(e,t){e[t]?e[t]++:e[t]=1}function Mk(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Nk(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function Pk(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function Fk(e,t){return Nk(e,t.v,t.w,t.name)}kk({},{read:()=>zk,write:()=>Ik});function Ik(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Lk(e),edges:Rk(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Lk(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function Rk(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function zk(e){let t=new Ak(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var Bk={};kk(Bk,{CycleException:()=>tA,bellmanFord:()=>Hk,components:()=>Wk,dijkstra:()=>qk,dijkstraAll:()=>Yk,findCycles:()=>Zk,floydWarshall:()=>$k,isAcyclic:()=>rA,postorder:()=>sA,preorder:()=>cA,prim:()=>lA,shortestPaths:()=>uA,tarjan:()=>Xk,topsort:()=>nA});var Vk=()=>1;function Hk(e,t,n,r){return Uk(e,String(t),n||Vk,r||function(t){return e.outEdges(t)??[]})}function Uk(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+o<r.distance&&(i[e.w]={distance:t.distance+o,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function Wk(e){let t={},n=[],r;function i(n){var a,o;n in t||(t[n]=!0,r.push(n),(a=e.successors(n))==null||a.forEach(i),(o=e.predecessors(n))==null||o.forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var Gk=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},Kk=()=>1;function qk(e,t,n,r){return Jk(e,String(t),n||Kk,r||function(t){return e.outEdges(t)??[]})}function Jk(e,t,n,r){let i={},a=new Gk,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function Yk(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=qk(e,i,t,n),r},{})}function Xk(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function Zk(e){return Xk(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var Qk=()=>1;function $k(e,t,n){return eA(e,t||Qk,n||function(t){return e.outEdges(t)??[]})}function eA(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e<o.distance&&(o.distance=e,o.predecessor=i.predecessor)}})})}),r}var tA=class extends Error{constructor(e){super(e),this.name=`CycleException`}};function nA(e){let t={},n={},r=[];function i(a){var o;if(a in n)throw new tA;a in t||(n[a]=!0,t[a]=!0,(o=e.predecessors(a))==null||o.forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new tA;return r}function rA(e){try{nA(e)}catch(e){if(e instanceof tA)return!1;throw e}return!0}function iA(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=aA(e,t,n===`post`,o,a,r,i)}),i}function aA(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=aA(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function oA(e,t,n){return iA(e,t,n,function(e,t){return e.push(t),e},[])}function sA(e,t){return oA(e,t,`post`)}function cA(e,t){return oA(e,t,`pre`)}function lA(e,t){var n;let r=new Ak,i={},a=new Gk,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s<r&&(i[n]=o,a.decrease(n,s))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(e){a.add(e,1/0),r.setNode(e)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let l=!1;for(;a.size()>0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function uA(e,t,n,r){return dA(e,t,n,r??(t=>e.outEdges(t)??[]))}function dA(e,t,n,r){if(n===void 0)return qk(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=a[o];if(s===void 0)continue;let c=r(s);for(let e=0;e<c.length;e++){let t=c[e];if(!t)continue;let r=t.v===s?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return Hk(e,t,n,r)}return qk(e,t,n,r)}var fA=Ak;function pA(e,t,n,r){let i=r;for(;e.hasNode(i);)i=kA(r);return n.dummy=t,e.setNode(i,n),i}function mA(e){let t=new fA().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function hA(e){let t=new fA({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function gA(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function _A(e){let t=AA(wA(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function vA(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=CA(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function yA(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=CA(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function bA(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),pA(e,`border`,i,t)}function xA(e,t=SA){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var SA=65535;function CA(e,t){return t.length>SA?e(...xA(t).map(t=>e(...t))):e(...t)}function wA(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return CA(Math.max,t)}function TA(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function EA(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function DA(e,t){return t()}var OA=0;function kA(e){return e+(``+ ++OA)}function AA(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function jA(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function MA(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function NA(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var PA=`\0`;function FA(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var IA=`3.1.1`,LA=class{constructor(){Ek(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return RA(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&RA(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,zA)),n=n._prev;return`[`+e.join(`, `)+`]`}};function RA(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function zA(e,t){if(e!==`_next`&&e!==`_prev`)return t}var BA=LA,VA=()=>1;function HA(e,t){if(e.nodeCount()<=1)return[];let n=GA(e,t||VA);return UA(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function UA(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)WA(e,t,n,o);for(;o=i.dequeue();)WA(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(WA(e,t,n,o,!0)||[]);break}}}return r}function WA(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,KA(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,KA(t,n,o)}),e.removeNode(r.v),o}function GA(e,t){let n=new fA,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=qA(i+r+3).map(()=>new BA),o=r+1;return n.nodes().forEach(e=>{KA(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function KA(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function qA(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function JA(e,t){(e.graph().acyclicer===`greedy`?HA(e,n(e)):YA(e,t??null)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,kA(`rev`))});function n(e){return t=>e.edge(t).weight}}function YA(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&ZA(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function XA(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function ZA(e,t,n){let r=new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function QA(e){e.graph().dummyChains=[],e.edges().forEach(t=>$A(e,t))}function $A(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=pA(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function ej(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function tj(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=CA(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function nj(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var rj=ij;function ij(e){let t=new fA({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;aj(t,e)<i&&(a=oj(t,e),a);)o=t.hasNode(a.v)?nj(e,a):-nj(e,a),sj(t,e,o);return t}function aj(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!nj(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function oj(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=nj(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function sj(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:cj,postorder:lj}=Bk,uj=dj;dj.initLowLimValues=hj,dj.initCutValues=fj,dj.calcCutValue=mj,dj.leaveEdge=_j,dj.enterEdge=vj,dj.exchangeEdges=yj;function dj(e){e=mA(e),tj(e);let t=rj(e);hj(t),fj(t,e);let n,r;for(;n=_j(t);)r=vj(t,e,n),yj(t,e,n,r)}function fj(e,t){let n=lj(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>pj(e,t,n))}function pj(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=mj(e,t,n)}function mj(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,xj(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function hj(e,t){arguments.length<2&&(t=e.nodes()[0]),gj(e,{},1,t)}function gj(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=gj(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function _j(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function vj(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===Sj(e,e.node(t.v),s)&&c!==Sj(e,e.node(t.w),s)).reduce((e,n)=>nj(t,n)<nj(t,e)?n:e)}function yj(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),hj(e),fj(e,t),bj(e,t)}function bj(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=cj(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function xj(e,t,n){return e.hasEdge(t,n)}function Sj(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Cj=wj;function wj(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:Dj(e);break;case`tight-tree`:Ej(e);break;case`longest-path`:Tj(e);break;case`none`:break;default:Dj(e)}}var Tj=tj;function Ej(e){tj(e),rj(e)}function Dj(e){uj(e)}var Oj=kj;function kj(e){let t=jj(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=Aj(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function Aj(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function jj(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(PA).forEach(r),t}function Mj(e){let t=pA(e,`root`,{},`_root`),n=Pj(e),r=Object.values(n),i=CA(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=Fj(e)+1;e.children(PA).forEach(r=>{Nj(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function Nj(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=bA(e,`_bt`),l=bA(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{Nj(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function Pj(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(PA).forEach(e=>n(e,1)),t}function Fj(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Ij(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var Lj=Rj;function Rj(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)zj(e,`borderLeft`,`_bl`,n,i,t),zj(e,`borderRight`,`_br`,n,i,t)}}e.children(PA).forEach(t)}function zj(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=pA(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Bj(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&Hj(e)}function Vj(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&Wj(e),(t===`lr`||t===`rl`)&&(Kj(e),Hj(e))}function Hj(e){e.nodes().forEach(t=>Uj(e.node(t))),e.edges().forEach(t=>Uj(e.edge(t)))}function Uj(e){let t=e.width;e.width=e.height,e.height=t}function Wj(e){e.nodes().forEach(t=>Gj(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Gj),Object.hasOwn(r,`y`)&&Gj(r)})}function Gj(e){e.y=-e.y}function Kj(e){e.nodes().forEach(t=>qj(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(qj),Object.hasOwn(r,`x`)&&qj(r)})}function qj(e){let t=e.x;e.x=e.y,e.y=t}function Jj(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=AA(CA(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return FA(t,e.node(n),e.node(r))}return a}function Yj(e,t){let n=0;for(let r=1;r<t.length;++r)n+=Xj(e,t[r-1],t[r]);return n}function Xj(e,t,n){let r=NA(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function Zj(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function Qj(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),$j(Object.values(n).filter(e=>!e.indegree))}function $j(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&eM(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>jA(e,[`vs`,`i`,`barycenter`,`weight`]))}function eM(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function tM(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=TA(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(rM(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=nM(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=nM(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function nM(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function rM(e,t,n){return(r,i)=>{if(r.barycenter<i.barycenter)return-1;if(r.barycenter>i.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=FA(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function iM(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=Zj(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=iM(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&oM(t,r)}});let h=Qj(m,n);aM(h,p);let g={},_=!1;for(let t=0;t<h.length;t++)for(let n=t+1;n<h.length;n++)if(h[t]&&h[n]&&(a=h[t])!=null&&a.barycenter&&(o=h[n])!=null&&o.barycenter&&h[t]?.barycenter===h[n].barycenter){let r=h[t]?.vs[0]??``,i=h[n]?.vs[0]??``,a=e.node(r),o=e.node(i);if(a.dummy===`edge`&&o.dummy===`edge`&&a.edgeObj?.v===o.edgeObj?.v&&a.edgeObj?.w===o.edgeObj?.w){if(a.edgeLabel.reversed){g[i]=h[t],h.splice(t,1),t--;break}g[r]=h[n],h.splice(n,1),n--}else _=!0}let v=tM(h,g,s,e,c);if(d&&f){v.vs=[d,v.vs,f].flat(1);let t=e.predecessors(d);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(f),i=e.node(r[0]);Object.hasOwn(v,`barycenter`)||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+n.order+i.order)/(v.weight+2),v.weight+=2}}return Object.defineProperty(v,"result",{value:v,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(v,"usedBias",{value:_,enumerable:!1,configurable:!0,writable:!0}),v}function aM(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function oM(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function sM(e,t,n,r){r||=e.nodes();let i=cM(e),a=new fA({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function cM(e){let t;for(;e.hasNode(t=kA(`_root`)););return t}function lM(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function uM(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,uM);return}let r=wA(e),i=dM(e,AA(1,r+1),`inEdges`),a=dM(e,AA(r-1,-1,-1),`outEdges`),o=Jj(e,n);if(pM(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){fM(t%2?i:a,t%4>=2,l,n),o=_A(e);let u=Yj(e,o);u<s?(r=0,c=Object.assign({},o),s=u):u===s&&(c=structuredClone(o))}pM(e,c)}function dM(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return sM(e,t,n,r.get(t)||[])})}function fM(e,t,n,r){let i=!0,a=new fA;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=iM(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),lM(e,a,s.vs)})}function pM(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function mM(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=gM(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&_M(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function hM(e,t){let n={};function r(t,r,i,a,o){AA(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&_M(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function gM(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function _M(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function vM(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function yM(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||OM(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>OM(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c<d&&s[i]!==l&&!vM(n,t,i)){let e=a[i];e!==void 0&&(o[i]=t,o[t]=a[t]=e,c=d,u&&=(c=-1,l=s[i]??-1,!1))}}}})}),{root:a,align:o}}function bM(e,t,n,r,i=!1){let a={},o=xM(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function xM(e,t,n,r){let i=new fA,a=e.graph(),o=EM(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function SM(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=DM(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function CM(e,t){let n=Object.values(t),r=CA(Math.min,n),i=CA(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-CA(Math.min,c);a!==`l`&&(l=i-CA(Math.max,c)),l&&(e[o]=MA(s,e=>e+l))})})}function wM(e,t=void 0){let n=e.ul;return n?MA(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function TM(e,t){let n=_A(e),r=Object.assign(mM(e,n),hM(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=yM(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=bM(e,a,s.root,s.align,n===`r`);n===`r`&&(c=MA(c,e=>-e)),i[o+n]=c})}),CM(i,SM(e,i)),wM(i,e.graph().align)}function EM(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function DM(e,t){return e.node(t).width}function OM(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function kM(e,t){e=hA(e),AM(e),Object.entries(TM(e,t)).forEach(([t,n])=>e.node(t).x=n)}function AM(e){let t=_A(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var jM=new WeakMap;function MM(e,t={}){return PM(e,DA,t),e}function NM(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function PM(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new fA({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=new Set;e.edges().forEach(t=>{let n=NM(e,t.v,r),i=NM(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),PM(o,t,n);let l=GM(o);FM(l,t,n,null),IM(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=GM(e),g=FM(h,t,n,jM.get(e)??null);jM.set(e,g),IM(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function FM(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>KM(e)),t(` removeSelfEdges`,()=>tN(e)),t(` acyclic`,()=>JA(e,s)),t(` nestingGraph.run`,()=>Mj(e)),t(` rank`,()=>Cj(hA(e))),t(` injectEdgeLabelProxies`,()=>qM(e)),t(` removeEmptyRanks`,()=>yA(e)),t(` nestingGraph.cleanup`,()=>Ij(e)),t(` normalizeRanks`,()=>vA(e)),t(` assignRankMinMax`,()=>JM(e)),t(` removeEdgeLabelProxies`,()=>YM(e)),t(` normalize.run`,()=>QA(e)),t(` parentDummyChains`,()=>Oj(e)),t(` addBorderSegments`,()=>Lj(e)),t(` order`,()=>uM(e,n,c)),t(` insertSelfEdges`,()=>nN(e)),t(` adjustCoordinateSystem`,()=>Bj(e)),t(` position`,()=>kM(e,n.corePath)),t(` positionSelfEdges`,()=>rN(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>eN(e)),t(` normalize.undo`,()=>ej(e)),t(` fixupEdgeLabelCoords`,()=>QM(e)),t(` undoCoordinateSystem`,()=>Vj(e)),t(` translateGraph`,()=>XM(e)),t(` assignNodeIntersects`,()=>ZM(e)),t(` reversePoints`,()=>$M(e)),t(` acyclic.undo`,()=>XA(e)),{graph:e,rawNodes:l}}function IM(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var LM=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],RM={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},zM=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],BM=[`width`,`height`,`rank`],VM={width:0,height:0},HM=[`minlen`,`weight`,`width`,`height`,`labeloffset`],UM={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},WM=[`labelpos`];function GM(e){let t=new fA({multigraph:!0,compound:!0}),n=aN(e.graph());return t.setGraph(Object.assign({},RM,iN(n,LM),jA(n,zM))),e.nodes().forEach(n=>{let r=iN(aN(e.node(n)),BM);Object.keys(VM).forEach(e=>{r[e]===void 0&&(r[e]=VM[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=aN(e.edge(n));t.setEdge(n,Object.assign({},UM,iN(r,HM),jA(r,WM)))}),t}function KM(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function qM(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);pA(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function JM(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function YM(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function XM(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function ZM(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(gA(r,a)),n.points.push(gA(i,o))})}function QM(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function $M(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function eN(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function tN(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function nN(e){_A(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{pA(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function rN(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function iN(e,t){return MA(jA(e,t),Number)}function aN(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function oN(e){let t=_A(e),n=new fA({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var sN={graphlib:Dk,version:IA,layout:MM,debug:oN,util:{time:EA,notime:DA}};function cN(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=cN(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var lN={value:()=>{}};function uN(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new dN(n)}function dN(e){this._=e}function fN(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}dN.prototype=uN.prototype={constructor:dN,on:function(e,t){var n=this._,r=fN(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=pN(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=mN(n[i],e.name,t);else if(t==null)for(i in n)n[i]=mN(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new dN(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function pN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function mN(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=lN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var hN={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function gN(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),hN.hasOwnProperty(t)?{space:hN[t],local:e}:e}function _N(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function vN(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function yN(e){var t=gN(e);return(t.local?vN:_N)(t)}function bN(){}function xN(e){return e==null?bN:function(){return this.querySelector(e)}}function SN(e){typeof e!=`function`&&(e=xN(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new uF(r,this._parents)}function CN(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function wN(){return[]}function TN(e){return e==null?wN:function(){return this.querySelectorAll(e)}}function EN(e){return function(){return CN(e.apply(this,arguments))}}function DN(e){e=typeof e==`function`?EN(e):TN(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new uF(r,i)}function ON(e){return function(){return this.matches(e)}}function kN(e){return function(t){return t.matches(e)}}var AN=Array.prototype.find;function jN(e){return function(){return AN.call(this.children,e)}}function MN(){return this.firstElementChild}function NN(e){return this.select(e==null?MN:jN(typeof e==`function`?e:kN(e)))}var PN=Array.prototype.filter;function FN(){return Array.from(this.children)}function IN(e){return function(){return PN.call(this.children,e)}}function LN(e){return this.selectAll(e==null?FN:IN(typeof e==`function`?e:kN(e)))}function RN(e){typeof e!=`function`&&(e=ON(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new uF(r,this._parents)}function zN(e){return Array(e.length)}function BN(){return new uF(this._enter||this._groups.map(zN),this._parents)}function VN(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}VN.prototype={constructor:VN,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function HN(e){return function(){return e}}function UN(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new VN(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function WN(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new VN(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function GN(e){return e.__data__}function KN(e,t){if(!arguments.length)return Array.from(this,GN);var n=t?WN:UN,r=this._parents,i=this._groups;typeof e!=`function`&&(e=HN(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=qN(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new uF(o,r),o._enter=s,o._exit=c,o}function qN(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function JN(){return new uF(this._exit||this._groups.map(zN),this._parents)}function YN(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function XN(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new uF(s,this._parents)}function ZN(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function QN(e){e||=$N;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new uF(i,this._parents).order()}function $N(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function eP(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function tP(){return Array.from(this)}function nP(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function rP(){let e=0;for(let t of this)++e;return e}function iP(){return!this.node()}function aP(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function oP(e){return function(){this.removeAttribute(e)}}function sP(e){return function(){this.removeAttributeNS(e.space,e.local)}}function cP(e,t){return function(){this.setAttribute(e,t)}}function lP(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function uP(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function dP(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function fP(e,t){var n=gN(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?sP:oP:typeof t==`function`?n.local?dP:uP:n.local?lP:cP)(n,t))}function pP(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function mP(e){return function(){this.style.removeProperty(e)}}function hP(e,t,n){return function(){this.style.setProperty(e,t,n)}}function gP(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function _P(e,t,n){return arguments.length>1?this.each((t==null?mP:typeof t==`function`?gP:hP)(e,t,n??``)):vP(this.node(),e)}function vP(e,t){return e.style.getPropertyValue(t)||pP(e).getComputedStyle(e,null).getPropertyValue(t)}function yP(e){return function(){delete this[e]}}function bP(e,t){return function(){this[e]=t}}function xP(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function SP(e,t){return arguments.length>1?this.each((t==null?yP:typeof t==`function`?xP:bP)(e,t)):this.node()[e]}function CP(e){return e.trim().split(/^|\s+/)}function wP(e){return e.classList||new TP(e)}function TP(e){this._node=e,this._names=CP(e.getAttribute(`class`)||``)}TP.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function EP(e,t){for(var n=wP(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function DP(e,t){for(var n=wP(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function OP(e){return function(){EP(this,e)}}function kP(e){return function(){DP(this,e)}}function AP(e,t){return function(){(t.apply(this,arguments)?EP:DP)(this,e)}}function jP(e,t){var n=CP(e+``);if(arguments.length<2){for(var r=wP(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?AP:t?OP:kP)(n,t))}function MP(){this.textContent=``}function NP(e){return function(){this.textContent=e}}function PP(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function FP(e){return arguments.length?this.each(e==null?MP:(typeof e==`function`?PP:NP)(e)):this.node().textContent}function IP(){this.innerHTML=``}function LP(e){return function(){this.innerHTML=e}}function RP(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function zP(e){return arguments.length?this.each(e==null?IP:(typeof e==`function`?RP:LP)(e)):this.node().innerHTML}function BP(){this.nextSibling&&this.parentNode.appendChild(this)}function VP(){return this.each(BP)}function HP(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function UP(){return this.each(HP)}function WP(e){var t=typeof e==`function`?e:yN(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function GP(){return null}function KP(e,t){var n=typeof e==`function`?e:yN(e),r=t==null?GP:typeof t==`function`?t:xN(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function qP(){var e=this.parentNode;e&&e.removeChild(this)}function JP(){return this.each(qP)}function YP(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function XP(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ZP(e){return this.select(e?XP:YP)}function QP(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function $P(e){return function(t){e.call(this,t,this.__data__)}}function eF(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function tF(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function nF(e,t,n){return function(){var r=this.__on,i,a=$P(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function rF(e,t,n){var r=eF(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?nF:tF,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function iF(e,t,n){var r=pP(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function aF(e,t){return function(){return iF(this,e,t)}}function oF(e,t){return function(){return iF(this,e,t.apply(this,arguments))}}function sF(e,t){return this.each((typeof t==`function`?oF:aF)(e,t))}function*cF(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var lF=[null];function uF(e,t){this._groups=e,this._parents=t}function dF(){return new uF([[document.documentElement]],lF)}function fF(){return this}uF.prototype=dF.prototype={constructor:uF,select:SN,selectAll:DN,selectChild:NN,selectChildren:LN,filter:RN,data:KN,enter:BN,exit:JN,join:YN,merge:XN,selection:fF,order:ZN,sort:QN,call:eP,nodes:tP,node:nP,size:rP,empty:iP,each:aP,attr:fP,style:_P,property:SP,classed:jP,text:FP,html:zP,raise:VP,lower:UP,append:WP,insert:KP,remove:JP,clone:ZP,datum:QP,on:rF,dispatch:sF,[Symbol.iterator]:cF};function pF(e){return typeof e==`string`?new uF([[document.querySelector(e)]],[document.documentElement]):new uF([[e]],lF)}function mF(e){let t;for(;t=e.sourceEvent;)e=t;return e}function hF(e,t){if(e=mF(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var gF={passive:!1},_F={capture:!0,passive:!1};function vF(e){e.stopImmediatePropagation()}function yF(e){e.preventDefault(),e.stopImmediatePropagation()}function bF(e){var t=e.document.documentElement,n=pF(e).on(`dragstart.drag`,yF,_F);`onselectstart`in t?n.on(`selectstart.drag`,yF,_F):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function xF(e,t){var n=e.document.documentElement,r=pF(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,yF,_F),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var SF=e=>()=>e;function CF(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}CF.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function wF(e){return!e.ctrlKey&&!e.button}function TF(){return this.parentNode}function EF(e,t){return t??{x:e.x,y:e.y}}function DF(){return navigator.maxTouchPoints||`ontouchstart`in this}function OF(){var e=wF,t=TF,n=EF,r=DF,i={},a=uN(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,gF).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(pF(n.view).on(`mousemove.drag`,m,_F).on(`mouseup.drag`,h,_F),bF(n.view),vF(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(yF(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){pF(e.view).on(`mousemove.drag mouseup.drag`,null),xF(e.view,l),yF(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(vF(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(yF(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(vF(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=hF(l||r,t),p,m,h;if((h=n.call(e,new CF(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=hF(l||a,t),_=o}u.call(r,e,new CF(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:SF(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:SF(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:SF(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:SF(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function kF(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function AF(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function jF(){}var MF=.7,NF=1/MF,PF=`\\s*([+-]?\\d+)\\s*`,FF=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,IF=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,LF=/^#([0-9a-f]{3,8})$/,RF=RegExp(`^rgb\\(${PF},${PF},${PF}\\)$`),zF=RegExp(`^rgb\\(${IF},${IF},${IF}\\)$`),BF=RegExp(`^rgba\\(${PF},${PF},${PF},${FF}\\)$`),VF=RegExp(`^rgba\\(${IF},${IF},${IF},${FF}\\)$`),HF=RegExp(`^hsl\\(${FF},${IF},${IF}\\)$`),UF=RegExp(`^hsla\\(${FF},${IF},${IF},${FF}\\)$`),WF={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};kF(jF,YF,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:GF,formatHex:GF,formatHex8:KF,formatHsl:qF,formatRgb:JF,toString:JF});function GF(){return this.rgb().formatHex()}function KF(){return this.rgb().formatHex8()}function qF(){return cI(this).formatHsl()}function JF(){return this.rgb().formatRgb()}function YF(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=LF.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?XF(t):n===3?new eI(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ZF(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ZF(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=RF.exec(e))?new eI(t[1],t[2],t[3],1):(t=zF.exec(e))?new eI(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=BF.exec(e))?ZF(t[1],t[2],t[3],t[4]):(t=VF.exec(e))?ZF(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=HF.exec(e))?sI(t[1],t[2]/100,t[3]/100,1):(t=UF.exec(e))?sI(t[1],t[2]/100,t[3]/100,t[4]):WF.hasOwnProperty(e)?XF(WF[e]):e===`transparent`?new eI(NaN,NaN,NaN,0):null}function XF(e){return new eI(e>>16&255,e>>8&255,e&255,1)}function ZF(e,t,n,r){return r<=0&&(e=t=n=NaN),new eI(e,t,n,r)}function QF(e){return e instanceof jF||(e=YF(e)),e?(e=e.rgb(),new eI(e.r,e.g,e.b,e.opacity)):new eI}function $F(e,t,n,r){return arguments.length===1?QF(e):new eI(e,t,n,r??1)}function eI(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}kF(eI,$F,AF(jF,{brighter(e){return e=e==null?NF:NF**+e,new eI(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?MF:MF**+e,new eI(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new eI(aI(this.r),aI(this.g),aI(this.b),iI(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tI,formatHex:tI,formatHex8:nI,formatRgb:rI,toString:rI}));function tI(){return`#${oI(this.r)}${oI(this.g)}${oI(this.b)}`}function nI(){return`#${oI(this.r)}${oI(this.g)}${oI(this.b)}${oI((isNaN(this.opacity)?1:this.opacity)*255)}`}function rI(){let e=iI(this.opacity);return`${e===1?`rgb(`:`rgba(`}${aI(this.r)}, ${aI(this.g)}, ${aI(this.b)}${e===1?`)`:`, ${e})`}`}function iI(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function aI(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function oI(e){return e=aI(e),(e<16?`0`:``)+e.toString(16)}function sI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new uI(e,t,n,r)}function cI(e){if(e instanceof uI)return new uI(e.h,e.s,e.l,e.opacity);if(e instanceof jF||(e=YF(e)),!e)return new uI;if(e instanceof uI)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new uI(o,s,c,e.opacity)}function lI(e,t,n,r){return arguments.length===1?cI(e):new uI(e,t,n,r??1)}function uI(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}kF(uI,lI,AF(jF,{brighter(e){return e=e==null?NF:NF**+e,new uI(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?MF:MF**+e,new uI(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new eI(pI(e>=240?e-240:e+120,i,r),pI(e,i,r),pI(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new uI(dI(this.h),fI(this.s),fI(this.l),iI(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=iI(this.opacity);return`${e===1?`hsl(`:`hsla(`}${dI(this.h)}, ${fI(this.s)*100}%, ${fI(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function dI(e){return e=(e||0)%360,e<0?e+360:e}function fI(e){return Math.max(0,Math.min(1,e||0))}function pI(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var mI=e=>()=>e;function hI(e,t){return function(n){return e+n*t}}function gI(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function _I(e){return(e=+e)==1?vI:function(t,n){return n-t?gI(t,n,e):mI(isNaN(t)?n:t)}}function vI(e,t){var n=t-e;return n?hI(e,n):mI(isNaN(e)?t:e)}var yI=(function e(t){var n=_I(t);function r(e,t){var r=n((e=$F(e)).r,(t=$F(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=vI(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function bI(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function xI(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function SI(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=jI(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function CI(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function wI(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function TI(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=jI(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var EI=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,DI=new RegExp(EI.source,`g`);function OI(e){return function(){return e}}function kI(e){return function(t){return e(t)+``}}function AI(e,t){var n=EI.lastIndex=DI.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=EI.exec(e))&&(i=DI.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:wI(r,i)})),n=DI.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?kI(c[0].x):OI(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function jI(e,t){var n=typeof t,r;return t==null||n===`boolean`?mI(t):(n===`number`?wI:n===`string`?(r=YF(t))?(t=r,yI):AI:t instanceof YF?yI:t instanceof Date?CI:xI(t)?bI:Array.isArray(t)?SI:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?TI:wI)(e,t)}var MI=180/Math.PI,NI={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function PI(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*MI,skewX:Math.atan(c)*MI,scaleX:o,scaleY:s}}var FI;function II(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?NI:PI(t.a,t.b,t.c,t.d,t.e,t.f)}function LI(e){return e==null||(FI||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),FI.setAttribute(`transform`,e),!(e=FI.transform.baseVal.consolidate()))?NI:(e=e.matrix,PI(e.a,e.b,e.c,e.d,e.e,e.f))}function RI(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:wI(e,i)},{i:c-2,x:wI(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:wI(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:wI(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:wI(e,n)},{i:s-2,x:wI(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var zI=RI(II,`px, `,`px)`,`deg)`),BI=RI(LI,`, `,`)`,`)`),VI=1e-12;function HI(e){return((e=Math.exp(e))+1/e)/2}function UI(e){return((e=Math.exp(e))-1/e)/2}function WI(e){return((e=Math.exp(2*e))-1)/(e+1)}var GI=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<VI)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=HI(y),c=s/(n*g)*(i*WI(t*r+y)-UI(y));return[a+c*d,o+c*f,s*i/HI(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),KI=0,qI=0,JI=0,YI=1e3,XI,ZI,QI=0,$I=0,eL=0,tL=typeof performance==`object`&&performance.now?performance:Date,nL=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function rL(){return $I||=(nL(iL),tL.now()+eL)}function iL(){$I=0}function aL(){this._call=this._time=this._next=null}aL.prototype=oL.prototype={constructor:aL,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?rL():+n)+(t==null?0:+t),!this._next&&ZI!==this&&(ZI?ZI._next=this:XI=this,ZI=this),this._call=e,this._time=n,dL()},stop:function(){this._call&&(this._call=null,this._time=1/0,dL())}};function oL(e,t,n){var r=new aL;return r.restart(e,t,n),r}function sL(){rL(),++KI;for(var e=XI,t;e;)(t=$I-e._time)>=0&&e._call.call(void 0,t),e=e._next;--KI}function cL(){$I=(QI=tL.now())+eL,KI=qI=0;try{sL()}finally{KI=0,uL(),$I=0}}function lL(){var e=tL.now(),t=e-QI;t>YI&&(eL-=t,QI=e)}function uL(){for(var e,t=XI,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:XI=n);ZI=e,dL(r)}function dL(e){KI||(qI&&=clearTimeout(qI),e-$I>24?(e<1/0&&(qI=setTimeout(cL,e-tL.now()-eL)),JI&&=clearInterval(JI)):(JI||=(QI=tL.now(),setInterval(lL,YI)),KI=1,nL(cL)))}function fL(e,t,n){var r=new aL;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var pL=uN(`start`,`end`,`cancel`,`interrupt`),mL=[];function hL(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;yL(e,n,{name:t,index:r,group:i,on:pL,tween:mL,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function gL(e,t){var n=vL(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function _L(e,t){var n=vL(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function vL(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function yL(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=oL(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return fL(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(fL(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function bL(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function xL(e){return this.each(function(){bL(this,e)})}function SL(e,t){var n,r;return function(){var i=_L(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function CL(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=_L(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function wL(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=vL(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?SL:CL)(n,e,t))}function TL(e,t,n){var r=e._id;return e.each(function(){var e=_L(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return vL(e,r).value[t]}}function EL(e,t){var n;return(typeof t==`number`?wI:t instanceof YF?yI:(n=YF(t))?(t=n,yI):AI)(e,t)}function DL(e){return function(){this.removeAttribute(e)}}function OL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kL(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function AL(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function jL(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function ML(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function NL(e,t){var n=gN(e),r=n===`transform`?BI:EL;return this.attrTween(e,typeof t==`function`?(n.local?ML:jL)(n,r,TL(this,`attr.`+e,t)):t==null?(n.local?OL:DL)(n):(n.local?AL:kL)(n,r,t))}function PL(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function FL(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function IL(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&FL(e,i)),n}return i._value=t,i}function LL(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&PL(e,i)),n}return i._value=t,i}function RL(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=gN(e);return this.tween(n,(r.local?IL:LL)(r,t))}function zL(e,t){return function(){gL(this,e).delay=+t.apply(this,arguments)}}function BL(e,t){return t=+t,function(){gL(this,e).delay=t}}function VL(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?zL:BL)(t,e)):vL(this.node(),t).delay}function HL(e,t){return function(){_L(this,e).duration=+t.apply(this,arguments)}}function UL(e,t){return t=+t,function(){_L(this,e).duration=t}}function WL(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?HL:UL)(t,e)):vL(this.node(),t).duration}function GL(e,t){if(typeof t!=`function`)throw Error();return function(){_L(this,e).ease=t}}function KL(e){var t=this._id;return arguments.length?this.each(GL(t,e)):vL(this.node(),t).ease}function qL(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();_L(this,e).ease=n}}function JL(e){if(typeof e!=`function`)throw Error();return this.each(qL(this._id,e))}function YL(e){typeof e!=`function`&&(e=ON(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new wR(r,this._parents,this._name,this._id)}function XL(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new wR(o,this._parents,this._name,this._id)}function ZL(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function QL(e,t,n){var r,i,a=ZL(t)?gL:_L;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function $L(e,t){var n=this._id;return arguments.length<2?vL(this.node(),n).on.on(e):this.each(QL(n,e,t))}function eR(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function tR(){return this.on(`end.remove`,eR(this._id))}function nR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=xN(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,hL(l[f],t,n,f,l,vL(u,n)));return new wR(a,this._parents,t,n)}function rR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=TN(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=vL(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&hL(p,t,n,h,f,m);a.push(f),o.push(u)}return new wR(a,o,t,n)}var iR=dF.prototype.constructor;function aR(){return new iR(this._groups,this._parents)}function oR(e,t){var n,r,i;return function(){var a=vP(this,e),o=(this.style.removeProperty(e),vP(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function sR(e){return function(){this.style.removeProperty(e)}}function cR(e,t,n){var r,i=n+``,a;return function(){var o=vP(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function lR(e,t,n){var r,i,a;return function(){var o=vP(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),vP(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function uR(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=_L(this,e),l=c.on,u=c.value[a]==null?s||=sR(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function dR(e,t,n){var r=(e+=``)==`transform`?zI:EL;return t==null?this.styleTween(e,oR(e,r)).on(`end.style.`+e,sR(e)):typeof t==`function`?this.styleTween(e,lR(e,r,TL(this,`style.`+e,t))).each(uR(this._id,e)):this.styleTween(e,cR(e,r,t),n).on(`end.style.`+e,null)}function fR(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function pR(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&fR(e,a,n)),r}return a._value=t,a}function mR(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,pR(e,t,n??``))}function hR(e){return function(){this.textContent=e}}function gR(e){return function(){var t=e(this);this.textContent=t??``}}function _R(e){return this.tween(`text`,typeof e==`function`?gR(TL(this,`text`,e)):hR(e==null?``:e+``))}function vR(e){return function(t){this.textContent=e.call(this,t)}}function yR(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&vR(r)),t}return r._value=e,r}function bR(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,yR(e))}function xR(){for(var e=this._name,t=this._id,n=TR(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=vL(c,t);hL(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new wR(r,this._parents,e,n)}function SR(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=_L(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var CR=0;function wR(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function TR(){return++CR}var ER=dF.prototype;wR.prototype={constructor:wR,select:nR,selectAll:rR,selectChild:ER.selectChild,selectChildren:ER.selectChildren,filter:YL,merge:XL,selection:aR,transition:xR,call:ER.call,nodes:ER.nodes,node:ER.node,size:ER.size,empty:ER.empty,each:ER.each,on:$L,attr:NL,attrTween:RL,style:dR,styleTween:mR,text:_R,textTween:bR,remove:tR,tween:wL,delay:VL,duration:WL,ease:KL,easeVarying:JL,end:SR,[Symbol.iterator]:ER[Symbol.iterator]};function DR(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var OR={time:null,delay:0,duration:250,ease:DR};function kR(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function AR(e){var t,n;e instanceof wR?(t=e._id,e=e._name):(t=TR(),(n=OR).time=rL(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&hL(c,e,t,l,o,n||kR(c,t));return new wR(r,this._parents,e,t)}dF.prototype.interrupt=xL,dF.prototype.transition=AR;var jR=e=>()=>e;function MR(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function NR(e,t,n){this.k=e,this.x=t,this.y=n}NR.prototype={constructor:NR,scale:function(e){return e===1?this:new NR(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new NR(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var PR=new NR(1,0,0);FR.prototype=NR.prototype;function FR(e){for(;!e.__zoom;)if(!(e=e.parentNode))return PR;return e.__zoom}function IR(e){e.stopImmediatePropagation()}function LR(e){e.preventDefault(),e.stopImmediatePropagation()}function RR(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function zR(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function BR(){return this.__zoom||PR}function VR(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function HR(){return navigator.maxTouchPoints||`ontouchstart`in this}function UR(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function WR(){var e=RR,t=zR,n=UR,r=VR,i=HR,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=GI,l=uN(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,BR).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,ee).on(`touchend.zoom touchcancel.zoom`,O).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,BR),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(PR.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new NR(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new NR(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new NR(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=pF(this.that).datum();l.call(e,this.that,new MR(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=hF(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],bL(this),s.start();LR(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=pF(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=hF(t,i),l=t.clientX,u=t.clientY;bF(t.view),IR(t),a.mouse=[c,this.__zoom.invert(c)],bL(this),a.start();function d(e){if(LR(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=hF(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),xF(e.view,a.moved),LR(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=hF(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);LR(r),s>0?pF(this).transition().duration(s).call(x,d,c,r):pF(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(IR(t),s=0;s<i;++s)c=r[s],l=hF(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),bL(this),a.start())}}function ee(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(LR(e),s=0;s<a;++s)c=i[s],l=hF(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function O(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(IR(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=hF(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=pF(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:jR(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:jR(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:jR(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:jR([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var GR={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},KR=[[-1/0,-1/0],[1/0,1/0]],qR=[`Enter`,` `,`Escape`],JR={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},YR;(function(e){e.Strict=`strict`,e.Loose=`loose`})(YR||={});var XR;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(XR||={});var ZR;(function(e){e.Partial=`partial`,e.Full=`full`})(ZR||={});var QR={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},$R;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})($R||={});var ez;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(ez||={});var tz;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(tz||={});var nz={[tz.Left]:tz.Right,[tz.Right]:tz.Left,[tz.Top]:tz.Bottom,[tz.Bottom]:tz.Top},rz=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,iz=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),az=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),oz=(e,t=[0,0])=>{let{width:n,height:r}=Bz(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},sz=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):az(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,bz(e,wz(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?Sz(r):{x:0,y:0,width:0,height:0}},cz=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=bz(n,wz(e)),r=!0)}),r?Sz(n):{x:0,y:0,width:0,height:0}},lz=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=Ez(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},uz=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function dz(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=Bz(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function fz({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=Lz(cz(dz(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function pz({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,GR.error005());else{let{width:e,height:t}=Bz(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&zz(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=zz(d)?gz(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,GR.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function mz({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=uz(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var hz=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),gz=(e={x:0,y:0},t,n)=>({x:hz(e.x,t[0][0],t[1][0]-(n?.width??0)),y:hz(e.y,t[0][1],t[1][1]-(n?.height??0))});function _z(e,t,n){let{width:r,height:i}=Bz(n),{x:a,y:o}=n.internals.positionAbsolute;return gz(e,[[a,o],[a+r,o+i]],t)}var vz=(e,t,n)=>e<t?hz(Math.abs(e-t),1,t)/t:e>n?-hz(Math.abs(e-n),1,t)/t:0,yz=(e,t,n=15,r=40)=>[vz(e.x,r,t.width-r)*n,vz(e.y,r,t.height-r)*n],bz=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),xz=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Sz=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Cz=(e,t=[0,0])=>{let{x:n,y:r}=az(e)?e.internals.positionAbsolute:oz(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},wz=(e,t=[0,0])=>{let{x:n,y:r}=az(e)?e.internals.positionAbsolute:oz(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Tz=(e,t)=>Sz(bz(xz(e),xz(t))),Ez=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},Dz=(e,t)=>Ez(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Oz=e=>kz(e.width)&&kz(e.height)&&kz(e.x)&&kz(e.y),kz=e=>!isNaN(e)&&isFinite(e),Az=(e,t)=>(e,t)=>{},jz=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Mz=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?jz(s,o):s},Nz=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Pz(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Fz(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=Pz(e,n),i=Pz(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=Pz(e.top??e.y??0,n),i=Pz(e.bottom??e.y??0,n),a=Pz(e.left??e.x??0,t),o=Pz(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Iz(e,t,n,r,i,a){let{x:o,y:s}=Nz(e,[t,n,r]),{x:c,y:l}=Nz({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var Lz=(e,t,n,r,i,a)=>{let o=Fz(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=hz(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=Iz(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},Rz=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function zz(e){return e!=null&&e!==`parent`}function Bz(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Vz(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Hz(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function Uz(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Wz(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Gz(e){return{...JR,...e||{}}}function Kz(e){return e===null?null:e?`valid`:`invalid`}function qz(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=$z(e),s=Mz({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?jz(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var Jz=e=>({width:e.offsetWidth,height:e.offsetHeight}),Yz=e=>e?.getRootNode?.()||window?.document,Xz=[`INPUT`,`SELECT`,`TEXTAREA`];function Zz(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?Xz.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var Qz=e=>`clientX`in e,$z=(e,t)=>{let n=Qz(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},eB=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Jz(t)}})};function tB({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function nB(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function rB({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case tz.Left:return[t-nB(t-r,a),n];case tz.Right:return[t+nB(r-t,a),n];case tz.Top:return[t,n-nB(n-i,a)];case tz.Bottom:return[t,n+nB(i-n,a)]}}function iB({sourceX:e,sourceY:t,sourcePosition:n=tz.Bottom,targetX:r,targetY:i,targetPosition:a=tz.Top,curvature:o=.25}){let[s,c]=rB({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=rB({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=tB({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function aB({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function oB({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function sB({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=bz(wz(e),wz(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Dz({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},Sz(a))>0}var cB=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,lB=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),uB=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,GR.error006()),t;let r=n.getEdgeId||cB,i;return i=rz(e)?{...e}:{...e,id:r(e)},lB(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function dB({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=aB({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var fB={[tz.Left]:{x:-1,y:0},[tz.Right]:{x:1,y:0},[tz.Top]:{x:0,y:-1},[tz.Bottom]:{x:0,y:1}},pB=({source:e,sourcePosition:t=tz.Bottom,target:n})=>t===tz.Left||t===tz.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},mB=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function hB({source:e,sourcePosition:t=tz.Bottom,target:n,targetPosition:r=tz.Top,center:i,offset:a,stepPosition:o}){let s=fB[t],c=fB[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=pB({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=aB({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function gB(e,t,n,r){let i=Math.min(mB(e,t)/2,mB(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function _B({sourceX:e,sourceY:t,sourcePosition:n=tz.Bottom,targetX:r,targetY:i,targetPosition:a=tz.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=hB({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=gB(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function vB(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function yB(e){let{sourceNode:t,targetNode:n}=e;if(!vB(t)||!vB(n))return null;let r=t.internals.handleBounds||bB(t.handles),i=n.internals.handleBounds||bB(n.handles),a=SB(r?.source??[],e.sourceHandle),o=SB(e.connectionMode===YR.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,GR.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||tz.Bottom,c=o?.position||tz.Top,l=xB(t,a,s),u=xB(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function bB(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function xB(e,t,n=tz.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??Bz(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case tz.Top:return{x:i+o/2,y:a};case tz.Right:return{x:i+o,y:a+s/2};case tz.Bottom:return{x:i+o/2,y:a+s};case tz.Left:return{x:i,y:a+s/2}}}function SB(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function CB(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function wB(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=CB(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var TB=1e3,EB=10,DB={nodeOrigin:[0,0],nodeExtent:KR,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},OB={...DB,checkEquality:!0};function kB(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function AB(e,t,n){let r=kB(DB,n);for(let n of e.values())if(n.parentId)FB(n,e,t,r);else{let e=gz(oz(n,r.nodeOrigin),zz(n.extent)?n.extent:r.nodeExtent,Bz(n));n.internals.positionAbsolute=e}}function jB(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function MB(e){return e===`manual`}function NB(e,t,n,r={}){let i=kB(OB,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!MB(i.zIndexMode)?TB:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=gz(oz(u,i.nodeOrigin),zz(u.extent)?u.extent:i.nodeExtent,Bz(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:jB(u,e),z:IB(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&FB(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function PB(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function FB(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=kB(DB,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}PB(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*EB),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=LB(e,u,o,s,a&&!MB(c)?TB:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function IB(e,t,n){let r=kz(e.zIndex)?e.zIndex:0;return MB(n)?r:r+(e.selected?t:0)}function LB(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=Bz(e),l=oz(e,n),u=zz(e.extent)?gz(l,e.extent,c):l,d=gz({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=_z(d,c,t));let f=IB(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function RB(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=Tz(a.get(n.parentId)?.expandedRect??Cz(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=Bz(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function zB(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=Jz(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=zz(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=_z(h,s,n))}else m&&(h=gz(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:eB(`source`,r.nodeElement,p,d,e.id),target:eB(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&FB(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:Cz(g,i)}))}}if(f.length>0){let e=RB(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function BB({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function VB(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function HB(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;VB(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),VB(`target`,s,c,e,i,o),t.set(r.id,r)}}function UB(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:UB(n,t):!1}function WB(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function GB(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!UB(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function KB({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function qB({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=jz(a,t);return{x:o.x-a.x,y:o.y-a.y}}function JB({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=pF(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?xz(cz(s)):null,x=v&&l?qB({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:jz(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=pz({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=KB({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=yz(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=qz(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=GB(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=KB({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=OF().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=qz(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=$z(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=qz(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=$z(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=$z(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=KB({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!WB(t,`.${g}`,v))&&(!_||WB(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function YB(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())Dz(i,Cz(e))>0&&r.push(e);return r}var XB=250;function ZB(e,t,n,r){let i=[],a=1/0,o=YB(e,n,t+XB);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=xB(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function QB(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...xB(o,c,c.position,!0)}:c}function $B(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function eV(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var tV=()=>!0;function nV(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=tV,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=Yz(e.target),E=0,D,{x:ee,y:O}=$z(e),k=$B(a,w),A=s?.getBoundingClientRect(),te=!1;if(!A||!k)return;let ne=QB(i,k,r,c,t);if(!ne)return;let re=$z(e,A),ie=!1,ae=null,oe=!1,se=null;function ce(){if(!u||!A)return;let[e,t]=yz(re,A,S);f({x:e,y:t}),E=requestAnimationFrame(ce)}let j={...ne,nodeId:i,type:k,position:ne.position},le=c.get(i),ue={inProgress:!0,isValid:null,from:xB(le,j,tz.Left,!0),fromHandle:j,fromPosition:j.position,fromNode:le,to:re,toHandle:null,toPosition:nz[j.position],toNode:null,pointer:re};function de(){te=!0,y(ue),m?.(e,{nodeId:i,handleId:r,handleType:k})}C===0&&de();function fe(e){if(!te){let{x:t,y:n}=$z(e),r=t-ee,i=n-O;if(!(r*r+i*i>C*C))return;de()}if(!x()||!j){pe(e);return}let a=b();re=$z(e,A),D=ZB(Mz(re,a,!1,[1,1]),n,c,j),ie||=(ce(),!0);let s=rV(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});se=s.handleDomNode,ae=s.connection,oe=eV(!!D,s.isValid);let u=c.get(i),f=u?xB(u,j,tz.Left,!0):ue.from,p={...ue,from:f,isValid:oe,to:s.toHandle&&oe?Nz({x:s.toHandle.x,y:s.toHandle.y},a):re,toHandle:s.toHandle,toPosition:oe&&s.toHandle?s.toHandle.position:nz[j.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:re};y(p),ue=p}function pe(e){if(!(`touches`in e&&e.touches.length>0)){if(te){(D||se)&&ae&&oe&&h?.(ae);let{inProgress:t,...n}=ue,r={...n,toPosition:ue.toHandle?ue.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),ie=!1,oe=!1,ae=null,se=null,T.removeEventListener(`mousemove`,fe),T.removeEventListener(`mouseup`,pe),T.removeEventListener(`touchmove`,fe),T.removeEventListener(`touchend`,pe)}}T.addEventListener(`mousemove`,fe),T.addEventListener(`mouseup`,pe),T.addEventListener(`touchmove`,fe),T.addEventListener(`touchend`,pe)}function rV(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=tV,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=$z(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=$B(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===YR.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=QB(t,e,a,u,n,!0)}return _}var iV={onPointerDown:nV,isValid:rV};function aV({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=pF(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&Rz()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=WR().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:hF}}var oV=e=>({x:e.x,y:e.y,zoom:e.k}),sV=({x:e,y:t,zoom:n})=>PR.translate(e,t).scale(n),cV=(e,t)=>e.target.closest(`.${t}`),lV=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),uV=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,dV=(e,t=0,n=uV,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},fV=e=>{let t=e.ctrlKey&&Rz()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function pV({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(cV(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=hF(u),t=d*2**fV(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===XR.Vertical?0:u.deltaX*f,m=i===XR.Horizontal?0:u.deltaY*f;!Rz()&&u.shiftKey&&i!==XR.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=oV(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function mV({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=cV(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function hV({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=oV(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function gV({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&lV(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,oV(a.transform))}}function _V({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&lV(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=oV(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function vV({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(cV(f,`${u}-flow__node`)||cV(f,`${u}-flow__edge`)||cV(f,`${u}-flow__selection`)||cV(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||cV(f,c)&&h||cV(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function yV({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=WR().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=pF(e).call(f);y({x:i.x,y:i.y,zoom:hz(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(fV);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?jI:GI).transform(dV(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,panActivationKeyPressed:S=!1,zoomActivationKeyPressed:C,lib:w,onTransformChange:T,connectionInProgress:E,paneClickDistance:D,selectionOnDrag:ee}){r&&!l.isZoomingOrPanning&&v();let O=i&&!C&&!r;f.clickDistance(ee?1/0:!kz(D)||D<0?0:D);let k=O?pV({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):mV({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,k,{passive:!1});let A=hV({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,A);let te=gV({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:T});f.on(`zoom`,te);let ne=_V({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,ne);let re=vV({panActivationKeyPressed:S,zoomActivationKeyPressed:C,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:w,connectionInProgress:E});f.filter(re),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=sV(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=sV(e);return await g(n,t),n}function x(e){if(p){let t=sV(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?FR(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?jI:GI).scaleTo(dV(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?jI:GI).scaleBy(dV(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!kz(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var bV;(function(e){e.Line=`line`,e.Handle=`handle`})(bV||={});function xV({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function SV(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function CV(e,t){return Math.max(0,t-e)}function wV(e,t){return Math.max(0,e-t)}function TV(e,t,n){return Math.max(0,t-e,e-n)}function EV(e,t){return e?!t:t}function DV(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),ee=-a[0]*x,O=-a[1]*S,k=TV(E,h,g),A=TV(D,_,v);if(o){let e=0,t=0;c&&w<0?e=CV(y+w+ee,o[0][0]):!c&&w>0&&(e=wV(y+E+ee,o[1][0])),l&&T<0?t=CV(b+T+O,o[0][1]):!l&&T>0&&(t=wV(b+D+O,o[1][1])),k=Math.max(k,e),A=Math.max(A,t)}if(s){let e=0,t=0;c&&w>0?e=wV(y+w,s[0][0]):!c&&w<0&&(e=CV(y+E,s[1][0])),l&&T>0?t=wV(b+T,s[0][1]):!l&&T<0&&(t=CV(b+D,s[1][1])),k=Math.max(k,e),A=Math.max(A,t)}if(i){if(u){let e=TV(E/C,_,v)*C;if(k=Math.max(k,e),o){let e=0;e=!c&&!l||c&&!l&&f?wV(b+O+E/C,o[1][1])*C:CV(b+O+(c?w:-w)/C,o[0][1])*C,k=Math.max(k,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?CV(b+E/C,s[1][1])*C:wV(b+(c?w:-w)/C,s[0][1])*C,k=Math.max(k,e)}}if(d){let e=TV(D*C,h,g)/C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||l&&!c&&f?wV(y+D*C+ee,o[1][0])/C:CV(y+(l?T:-T)*C+ee,o[0][0])/C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?CV(y+D*C,s[1][0])/C:wV(y+(l?T:-T)*C,s[0][0])/C,A=Math.max(A,e)}}}T+=T<0?A:-A,w+=w<0?k:-k,i&&(f?E>D*C?T=(EV(c,l)?-w:w)/C:w=(EV(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let te=c?y+w:y,ne=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+te,y:a[1]*T*(l?-1:1)+ne}}var OV={width:0,height:0,x:0,y:0},kV={...OV,pointerX:0,pointerY:0,aspectRatio:1};function AV(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function jV({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=pF(e),o={controlDirection:SV(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...OV},h={...kV};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:SV(e)};let g,_=null,v=[],y,b,x,S=OF().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=qz(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=zz(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=AV(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=qz(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:S,height:C}=m,w={},T=g.origin??s,{width:E,height:D,x:ee,y:O}=DV(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,T,b,x),k=E!==S,A=D!==C,te=ee!==u&&k,ne=O!==f&&A;if(!te&&!ne&&!k&&!A)return;let re={prevValues:{...m},startX:h.x,startY:h.y,childNodes:v.map(e=>({...e,position:{...e.position}}))};if((te||ne||T[0]===1||T[1]===1)&&(w.x=te?ee:m.x,w.y=ne?O:m.y,m.x=w.x,m.y=w.y,v.length>0)){let e=ee-u,t=O-f;for(let n of v)n.position={x:n.position.x-e+T[0]*(E-S),y:n.position.y-t+T[1]*(D-C)},l.push(n)}if((k||A)&&(w.width=k&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?E:m.width,w.height=A&&(!o.resizeDirection||o.resizeDirection===`vertical`)?D:m.height,m.width=w.width,m.height=w.height),y&&g.expandParent){let e=T[0]*(w.width??0);w.x&&w.x<e&&(m.x=e,h.x-=w.x-e);let t=T[1]*(w.height??0);w.y&&w.y<t&&(m.y=t,h.y-=w.y-t)}let ie=xV({width:m.width,prevWidth:S,height:m.height,prevHeight:C,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),ae={...m,direction:ie};if(p?.(e,ae)===!1){m=re.prevValues,h.x=re.startX,h.y=re.startY,v.forEach((e,t)=>{e.position=re.childNodes[t].position});return}d?.(e,ae),r(w,l)}).on(`end`,e=>{f?.(e,{...m}),i?.({...m})});a.call(S)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var MV=s((e=>{var t=f();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),NV=s(((e,t)=>{t.exports=MV()})),PV=s((e=>{var t=f(),n=NV();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),FV=u(s(((e,t)=>{t.exports=PV()}))(),1),IV=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},LV=e=>e?IV(e):IV,{useDebugValue:RV}=y.default,{useSyncExternalStoreWithSelector:zV}=FV.default,BV=e=>e;function VV(e,t=BV,n){let r=zV(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return RV(r),r}var HV=(e,t)=>{let n=LV(e),r=(e,r=t)=>VV(n,e,r);return Object.assign(r,n),r},UV=(e,t)=>e?HV(e,t):HV;function WV(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}g();var GV=(0,y.createContext)(null),KV=GV.Provider,qV=GR.error001(`react`);function JV(e,t){let n=(0,y.useContext)(GV);if(n===null)throw Error(qV);return VV(n,e,t)}function YV(){let e=(0,y.useContext)(GV);if(e===null)throw Error(qV);return(0,y.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var XV={display:`none`},ZV={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},QV=`react-flow__node-desc`,$V=`react-flow__edge-desc`,eH=`react-flow__aria-live`,tH=e=>e.ariaLiveMessage,nH=e=>e.ariaLabelConfig;function rH({rfId:e}){let t=JV(tH);return(0,Z.jsx)(`div`,{id:`${eH}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:ZV,children:t})}function iH({rfId:e,disableKeyboardA11y:t}){let n=JV(nH);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{id:`${QV}-${e}`,style:XV,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,Z.jsx)(`div`,{id:`${$V}-${e}`,style:XV,children:n[`edge.a11yDescription.default`]}),!t&&(0,Z.jsx)(rH,{rfId:e})]})}var aH=(0,y.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,Z.jsx)(`div`,{className:cN([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});aH.displayName=`Panel`;var oH=`https://reactflow.dev?utm_source=attribution`;function sH({proOptions:e,position:t=`bottom-right`}){return(0,y.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,Z.jsx)(aH,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${oH}`,children:(0,Z.jsx)(`a`,{href:oH,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var cH=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},lH=e=>e.id;function uH(e,t){return WV(e.selectedNodes.map(lH),t.selectedNodes.map(lH))&&WV(e.selectedEdges.map(lH),t.selectedEdges.map(lH))}function dH({onSelectionChange:e}){let t=YV(),{selectedNodes:n,selectedEdges:r}=JV(cH,uH);return(0,y.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var fH=e=>!!e.onSelectionChangeHandlers;function pH({onSelectionChange:e}){let t=JV(fH);return e||t?(0,Z.jsx)(dH,{onSelectionChange:e}):null}var mH=[0,0],hH={x:0,y:0,zoom:1},gH=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],_H=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),vH={translateExtent:KR,nodeOrigin:mH,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function yH(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=JV(_H,WV),l=YV();(0,y.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=vH,s()}),[]);let u=(0,y.useRef)(vH);return(0,y.useEffect)(()=>{for(let s of gH){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:Gz(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},gH.map(t=>e[t])),null}function bH(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function xH(e){let[t,n]=(0,y.useState)(e===`system`?null:e);return(0,y.useEffect)(()=>{if(e!==`system`){n(e);return}let t=bH(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?bH()?.matches?`dark`:`light`:t}var SH=typeof document<`u`?document:null;function CH(e=null,t={target:SH,actInsideInputWithModifier:!0}){let[n,r]=(0,y.useState)(!1),i=(0,y.useRef)(!1),a=(0,y.useRef)(new Set([])),[o,s]=(0,y.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
|
|
735
|
+
`]),{type:`application/javascript`}))})),OO=c({default:()=>kO}),kO,AO=o((()=>{Kh(),kO=class e{constructor(t,n,r,i,a){this._legacyCanvasSize=e.DEFAULT_CANVAS_SIZE,this._preferredCamera=`environment`,this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=t,this.$canvas=document.createElement(`canvas`),r&&typeof r==`object`?this._onDecode=n:(console.warn(r||i||a?`You're using a deprecated version of the QrScanner constructor which will be removed in the future`:`Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true.`),this._legacyOnDecode=n),n=typeof r==`object`?r:{},this._onDecodeError=n.onDecodeError||(typeof r==`function`?r:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||(typeof i==`function`?i:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||a||this._preferredCamera,this._legacyCanvasSize=typeof r==`number`?r:typeof i==`number`?i:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),t.disablePictureInPicture=!0,t.playsInline=!0,t.muted=!0;let o=!1;if(t.hidden&&(t.hidden=!1,o=!0),document.body.contains(t)||(document.body.appendChild(t),o=!0),r=t.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(i=!!n.overlay,this.$overlay=n.overlay||document.createElement(`div`),a=this.$overlay.style,a.position=`absolute`,a.display=`none`,a.pointerEvents=`none`,this.$overlay.classList.add(`scan-region-highlight`),!i&&n.highlightScanRegion){this.$overlay.innerHTML=`<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>`;try{this.$overlay.firstElementChild.animate({transform:[`scale(.98)`,`scale(1.01)`]},{duration:400,iterations:1/0,direction:`alternate`,easing:`ease-in-out`})}catch{}r.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML(`beforeend`,`<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>`),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(t),requestAnimationFrame(()=>{let e=window.getComputedStyle(t);e.display===`none`&&(t.style.setProperty(`display`,`block`,`important`),o=!0),e.visibility!==`visible`&&(t.style.setProperty(`visibility`,`visible`,`important`),o=!0),o&&(console.warn(`QrScanner has overwritten the video hiding style to avoid Safari stopping the playback.`),t.style.opacity=`0`,t.style.width=`0`,t.style.height=`0`,this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),t.addEventListener(`play`,this._onPlay),t.addEventListener(`loadedmetadata`,this._onLoadedMetaData),document.addEventListener(`visibilitychange`,this._onVisibilityChange),window.addEventListener(`resize`,this._updateOverlay),this._qrEnginePromise=e.createQrEngine()}static set WORKER_PATH(e){console.warn(`Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.`)}static async hasCamera(){try{return!!(await e.listCameras(!1)).length}catch{return!1}}static async listCameras(t=!1){if(!navigator.mediaDevices)return[];let n=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`videoinput`),r;try{t&&(await n()).every(e=>!e.label)&&(r=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await n()).map((e,t)=>({id:e.deviceId,label:e.label||(t===0?`Default Camera`:`Camera ${t+1}`)}))}finally{r&&(console.warn(`Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream`),e._stopVideoStream(r))}}async hasFlash(){let t;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;t=this.$video.srcObject}else t=(await this._getCameraStream()).stream;return`torch`in t.getVideoTracks()[0].getSettings()}catch{return!1}finally{t&&t!==this.$video.srcObject&&(console.warn(`Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream`),e._stopVideoStream(t))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw`No flash available`;await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(e){throw this._flashOn=!1,e}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener(`loadedmetadata`,this._onLoadedMetaData),this.$video.removeEventListener(`play`,this._onPlay),document.removeEventListener(`visibilitychange`,this._onVisibilityChange),window.removeEventListener(`resize`,this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),e._postWorkerMessage(this._qrEnginePromise,`close`)}async start(){if(this._destroyed)throw Error(`The QR scanner can not be started as it had been destroyed.`);if((!this._active||this._paused)&&(window.location.protocol!==`https:`&&console.warn(`The camera stream is only accessible if the page is transferred via https.`),this._active=!0,!document.hidden)){if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:t,facingMode:n}=await this._getCameraStream();!this._active||this._paused?e._stopVideoStream(t):(this._setVideoMirror(n),this.$video.srcObject=t,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(e){if(!this._paused)throw this._active=!1,e}}}stop(){this.pause(),this._active=!1}async pause(t=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display=`none`);let n=()=>{this.$video.srcObject instanceof MediaStream&&(e._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return t?(n(),!0):(await new Promise(e=>setTimeout(e,300)),this._paused?(n(),!0):!1)}async setCamera(e){e!==this._preferredCamera&&(this._preferredCamera=e,await this._restartVideoStream())}static async scanImage(t,n,r,i,a=!1,o=!1){let s,c=!1;n&&(`scanRegion`in n||`qrEngine`in n||`canvas`in n||`disallowCanvasResizing`in n||`alsoTryWithoutScanRegion`in n||`returnDetailedScanResult`in n)?(s=n.scanRegion,r=n.qrEngine,i=n.canvas,a=n.disallowCanvasResizing||!1,o=n.alsoTryWithoutScanRegion||!1,c=!0):console.warn(n||r||i||a||o?`You're using a deprecated api for scanImage which will be removed in the future.`:`Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true.`),n=!!r;try{let l,u;[r,l]=await Promise.all([r||e.createQrEngine(),e._loadImage(t)]),[i,u]=e._drawToCanvas(l,s,i,a);let d;if(r instanceof Worker){let t=r;n||e._postWorkerMessageSync(t,`inversionMode`,`both`),d=await new Promise((n,r)=>{let a,o,c,l=-1;o=i=>{i.data.id===l&&(t.removeEventListener(`message`,o),t.removeEventListener(`error`,c),clearTimeout(a),i.data.data===null?r(e.NO_QR_CODE_FOUND):n({data:i.data.data,cornerPoints:e._convertPoints(i.data.cornerPoints,s)}))},c=e=>{t.removeEventListener(`message`,o),t.removeEventListener(`error`,c),clearTimeout(a),r(`Scanner error: `+(e?e.message||e:`Unknown Error`))},t.addEventListener(`message`,o),t.addEventListener(`error`,c),a=setTimeout(()=>c(`timeout`),1e4);let d=u.getImageData(0,0,i.width,i.height);l=e._postWorkerMessageSync(t,`decode`,d,[d.data.buffer])})}else d=await Promise.race([new Promise((e,t)=>window.setTimeout(()=>t(`Scanner error: timeout`),1e4)),(async()=>{try{var[n]=await r.detect(i);if(!n)throw e.NO_QR_CODE_FOUND;return{data:n.rawValue,cornerPoints:e._convertPoints(n.cornerPoints,s)}}catch(r){if(n=r.message||r,/not implemented|service unavailable/.test(n))return e._disableBarcodeDetector=!0,e.scanImage(t,{scanRegion:s,canvas:i,disallowCanvasResizing:a,alsoTryWithoutScanRegion:o});throw`Scanner error: ${n}`}})()]);return c?d:d.data}catch(n){if(!s||!o)throw n;let l=await e.scanImage(t,{qrEngine:r,canvas:i,disallowCanvasResizing:a});return c?l:l.data}finally{n||e._postWorkerMessage(r,`close`)}}setGrayscaleWeights(t,n,r,i=!0){e._postWorkerMessage(this._qrEnginePromise,`grayscaleWeights`,{red:t,green:n,blue:r,useIntegerApproximation:i})}setInversionMode(t){e._postWorkerMessage(this._qrEnginePromise,`inversionMode`,t)}static async createQrEngine(t){if(t&&console.warn(`Specifying a worker path is not required and not supported anymore.`),t=()=>Gh(()=>Promise.resolve().then(()=>(DO(),TO)).then(e=>e.createWorker()),void 0,import.meta.url),!(!e._disableBarcodeDetector&&`BarcodeDetector`in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes(`qr_code`)))return t();let n=navigator.userAgentData;return n&&n.brands.some(({brand:e})=>/Chromium/i.test(e))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues([`architecture`,`platformVersion`]).then(({architecture:e,platformVersion:t})=>/arm/i.test(e||`arm`)&&13<=parseInt(t||`13`)).catch(()=>!0)?t():new BarcodeDetector({formats:[`qr_code`]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=``),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){let t=Math.round(2/3*Math.min(e.videoWidth,e.videoHeight));return{x:Math.round((e.videoWidth-t)/2),y:Math.round((e.videoHeight-t)/2),width:t,height:t,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var e=this.$video,t=e.videoWidth,n=e.videoHeight,r=e.offsetWidth,i=e.offsetHeight,a=e.offsetLeft,o=e.offsetTop,s=window.getComputedStyle(e),c=s.objectFit,l=t/n,u=r/i;switch(c){case`none`:var d=t,f=n;break;case`fill`:d=r,f=i;break;default:(c===`cover`?l>u:l<u)?(f=i,d=f*l):(d=r,f=d/l),c===`scale-down`&&(d=Math.min(d,t),f=Math.min(f,n))}var[p,m]=s.objectPosition.split(` `).map((e,t)=>{let n=parseFloat(e);return e.endsWith(`%`)?(t?i-f:r-d)*n/100:n});s=this._scanRegion.width||t,u=this._scanRegion.height||n,c=this._scanRegion.x||0;var h=this._scanRegion.y||0;l=this.$overlay.style,l.width=`${s/t*d}px`,l.height=`${u/n*f}px`,l.top=`${o+m+h/n*f}px`,n=/scaleX\(-1\)/.test(e.style.transform),l.left=`${a+(n?r-p-d:p)+(n?t-c-s:c)/t*d}px`,l.transform=e.style.transform}})}static _convertPoints(e,t){if(!t)return e;let n=t.x||0,r=t.y||0,i=t.width&&t.downScaledWidth?t.width/t.downScaledWidth:1;t=t.height&&t.downScaledHeight?t.height/t.downScaledHeight:1;for(let a of e)a.x=a.x*i+n,a.y=a.y*t+r;return e}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||(`requestVideoFrameCallback`in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var t=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;t<n&&await new Promise(e=>setTimeout(e,n-t)),this._lastScanTimestamp=Date.now();try{var r=await e.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(e){if(!this._active)return;this._onDecodeError(e)}!e._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=e.createQrEngine()),r?(this._onDecode?this._onDecode(r):this._legacyOnDecode&&this._legacyOnDecode(r.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute(`viewBox`,`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute(`points`,r.cornerPoints.map(({x:e,y:t})=>`${e},${t}`).join(` `)),this.$codeOutlineHighlight.style.display=``)):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display=`none`,100))}this._scanFrame()})}_onDecodeError(t){t!==e.NO_QR_CODE_FOUND&&console.log(t)}async _getCameraStream(){if(!navigator.mediaDevices)throw`Camera not found.`;let e=/^(environment|user)$/.test(this._preferredCamera)?`facingMode`:`deviceId`,t=[{width:{min:1024}},{width:{min:768}},{}],n=t.map(t=>Object.assign({},t,{[e]:{exact:this._preferredCamera}}));for(let e of[...n,...t])try{let t=await navigator.mediaDevices.getUserMedia({video:e,audio:!1});return{stream:t,facingMode:this._getFacingMode(t)||(e.facingMode?this._preferredCamera:this._preferredCamera===`environment`?`user`:`environment`)}}catch{}throw`Camera not found.`}async _restartVideoStream(){let e=this._paused;await this.pause(!0)&&!e&&this._active&&await this.start()}static _stopVideoStream(e){for(let t of e.getTracks())t.stop(),e.removeTrack(t)}_setVideoMirror(e){this.$video.style.transform=`scaleX(`+(e===`user`?-1:1)+`)`}_getFacingMode(e){return(e=e.getVideoTracks()[0])?/rear|back|environment/i.test(e.label)?`environment`:/front|user|face/i.test(e.label)?`user`:null:null}static _drawToCanvas(e,t,n,r=!1){n||=document.createElement(`canvas`);let i=t&&t.x?t.x:0,a=t&&t.y?t.y:0,o=t&&t.width?t.width:e.videoWidth||e.width,s=t&&t.height?t.height:e.videoHeight||e.height;return r||(r=t&&t.downScaledWidth?t.downScaledWidth:o,t=t&&t.downScaledHeight?t.downScaledHeight:s,n.width!==r&&(n.width=r),n.height!==t&&(n.height=t)),t=n.getContext(`2d`,{alpha:!1}),t.imageSmoothingEnabled=!1,t.drawImage(e,i,a,o,s,0,0,n.width,n.height),[n,t]}static async _loadImage(t){if(t instanceof Image)return await e._awaitImageLoad(t),t;if(t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||t instanceof SVGImageElement||`OffscreenCanvas`in window&&t instanceof OffscreenCanvas||`ImageBitmap`in window&&t instanceof ImageBitmap)return t;if(t instanceof File||t instanceof Blob||t instanceof URL||typeof t==`string`){let n=new Image;n.src=t instanceof File||t instanceof Blob?URL.createObjectURL(t):t.toString();try{return await e._awaitImageLoad(n),n}finally{(t instanceof File||t instanceof Blob)&&URL.revokeObjectURL(n.src)}}else throw`Unsupported image type.`}static async _awaitImageLoad(e){e.complete&&e.naturalWidth!==0||await new Promise((t,n)=>{let r=i=>{e.removeEventListener(`load`,r),e.removeEventListener(`error`,r),i instanceof ErrorEvent?n(`Image load error`):t()};e.addEventListener(`load`,r),e.addEventListener(`error`,r)})}static async _postWorkerMessage(t,n,r,i){return e._postWorkerMessageSync(await t,n,r,i)}static _postWorkerMessageSync(t,n,r,i){if(!(t instanceof Worker))return-1;let a=e._workerMessageId++;return t.postMessage({id:a,type:n,data:r},i),a}},kO.DEFAULT_CANVAS_SIZE=400,kO.NO_QR_CODE_FOUND=`No QR code found`,kO._disableBarcodeDetector=!1,kO._workerMessageId=0}));Kh();var jO=null;function MO(){return jO??=(async()=>{let e=window.BarcodeDetector;if(e)try{let t=await e.getSupportedFormats();if(t.includes(`qr_code`)){let n=new e({formats:t});return{qrOnly:!1,detect:async e=>(await n.detect(e))[0]?.rawValue||null}}}catch{}let{default:t}=await Gh(async()=>{let{default:e}=await Promise.resolve().then(()=>(AO(),OO));return{default:e}},void 0,import.meta.url),n=t.createQrEngine();return{qrOnly:!0,detect:async e=>{try{return(await t.scanImage(e,{qrEngine:n,returnDetailedScanResult:!0})).data||null}catch{return null}}}})(),jO}function NO({open:e,onClose:t,onResult:n}){let r=(0,y.useRef)(n);r.current=n;let i=(0,y.useRef)(t);return i.current=t,(0,y.useEffect)(()=>{e&&cE(`scan`).then(e=>{e&&r.current(e)}).catch(()=>void 0).finally(()=>i.current())},[e]),null}function PO(e){return sE(`scan`)?(0,Z.jsx)(NO,{...e}):(0,Z.jsx)(FO,{...e})}function FO({open:e,onClose:t,onResult:n}){let[r,i]=(0,y.useState)(`environment`),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),l=(0,y.useRef)(null),u=dO(e,r),d=(0,y.useRef)(n);d.current=n;let f=(0,y.useRef)(t);f.current=t,(0,y.useEffect)(()=>{e&&(c(!1),MO().then(e=>o(e.qrOnly)))},[e]),(0,y.useEffect)(()=>{if(!e||!u.stream)return;let t=!1,n,r=async()=>{let e=u.video.current;if(!t&&e&&e.readyState>=2&&e.videoWidth){let n=await(await MO()).detect(e).catch(()=>null);if(n&&!t){navigator.vibrate?.(60),d.current(n),f.current();return}}t||(n=setTimeout(r,200))};return r(),()=>{t=!0,clearTimeout(n)}},[e,u.stream,u.video]);let p=async e=>{if(!e)return;c(!1);let r=await createImageBitmap(e).catch(()=>null),i=r?await(await MO()).detect(r).catch(()=>null):null;i?(n(i),t()):c(!0)};return(0,Z.jsxs)(fO,{open:e,onClose:t,label:Q(`scan.title`),children:[(0,Z.jsx)(mO,{title:Q(`scan.title`),onClose:t,camera:u,onFlip:()=>i(e=>e===`environment`?`user`:`environment`)}),(0,Z.jsx)(hO,{camera:u,asking:Q(`scan.asking`),actions:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(bO,{onClick:()=>l.current?.click(),children:[(0,Z.jsx)(W_,{className:`size-4`}),` `,Q(`scan.fromPhoto`)]}),(0,Z.jsx)(bO,{quiet:!0,onClick:t,children:Q(`scan.typeInstead`)})]}),children:(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,Z.jsx)(`div`,{className:`aspect-square w-[min(68%,320px)] rounded-3xl border-2 border-white/90 shadow-[0_0_0_100vmax_rgb(0_0_0/0.35)]`})})}),(0,Z.jsxs)(`div`,{className:`safe-bottom flex flex-col items-center gap-3 px-5 pt-3 text-center`,children:[(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-white/75 leading-snug`,children:Q(s?`scan.miss`:a?`scan.hintQr`:`scan.hint`)}),u.stream?(0,Z.jsxs)(bO,{quiet:!0,onClick:()=>l.current?.click(),children:[(0,Z.jsx)(W_,{className:`size-4`}),` `,Q(`scan.fromPhoto`)]}):null]}),(0,Z.jsx)(`input`,{ref:l,type:`file`,hidden:!0,accept:`image/*`,onChange:e=>{p(e.target.files?.[0]),e.target.value=``}})]})}var IO=`#1d1a17`,LO={width:1200,height:480};function RO(e,t,n,r,i){e.lineCap=`round`,e.lineJoin=`round`,e.strokeStyle=IO,e.fillStyle=IO,e.lineWidth=i;for(let a of t){if(a.length===1){e.beginPath(),e.arc(a[0].x*n,a[0].y*r,i/2,0,Math.PI*2),e.fill();continue}e.beginPath(),e.moveTo(a[0].x*n,a[0].y*r);for(let t=1;t<a.length-1;t++){let i=a[t],o=a[t+1];e.quadraticCurveTo(i.x*n,i.y*r,(i.x+o.x)/2*n,(i.y+o.y)/2*r)}let t=a[a.length-1];e.lineTo(t.x*n,t.y*r),e.stroke()}}function zO({strokes:e,onStrokes:t}){let n=(0,y.useRef)(null),r=(0,y.useRef)(null),i=(0,y.useRef)(e);i.current=e;let a=()=>{let e=n.current,t=e?.getContext(`2d`);if(!e||!t)return;let a=window.devicePixelRatio||1,o=Math.round(e.clientWidth*a),s=Math.round(e.clientHeight*a);(e.width!==o||e.height!==s)&&(e.width=o,e.height=s),t.clearRect(0,0,o,s),RO(t,r.current?[...i.current,r.current]:i.current,o,s,2.4*a)};(0,y.useEffect)(()=>{a();let e=n.current;if(!e)return;let t=new ResizeObserver(a);return t.observe(e),()=>t.disconnect()},[e]);let o=e=>{let t=e.currentTarget.getBoundingClientRect();return{x:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),y:Math.min(1,Math.max(0,(e.clientY-t.top)/t.height))}};return(0,Z.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl bg-white ring-1 ring-input`,children:[(0,Z.jsx)(`canvas`,{ref:n,"aria-label":Q(`sign.pad`),className:`block aspect-[5/2] w-full cursor-crosshair touch-none select-none`,onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),r.current=[o(e)],a()},onPointerMove:e=>{r.current&&(r.current.push(o(e)),a())},onPointerUp:()=>{if(r.current){let e=r.current;r.current=null,t([...i.current,e])}},onPointerCancel:()=>{r.current=null,a()}}),(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-6 bottom-[22%] border-[#1d1a17]/25 border-b`}),e.length?null:(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center text-[#1d1a17]/40 text-[0.875rem]`,children:Q(`sign.hint`)})]})}async function BO(e){let t=document.createElement(`canvas`);t.width=LO.width,t.height=LO.height;let n=t.getContext(`2d`);if(!n)return null;RO(n,e,LO.width,LO.height,7);let r=await new Promise(e=>t.toBlob(e,`image/png`));return r?new File([r],`unterschrift.png`,{type:`image/png`}):null}function VO({label:e,value:t,runId:n,onChange:r}){let[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)([]),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(null),f=typeof t==`string`&&t?t:null,p=async()=>{l(!0),d(null);try{let e=await BO(o);if(!e)return;r((await JE.upload(`/api/runs/${n}/uploads`,e)).id),a(!1)}catch(e){d(e.message)}finally{l(!1)}};return(0,Z.jsxs)(`div`,{children:[f?(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-2 ring-1 ring-input`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>{s([]),a(!0)},className:`min-w-0 flex-1 rounded-lg bg-white px-3`,"aria-label":Q(`sign.again`),children:(0,Z.jsx)(`img`,{src:IS(`/api/runs/${n}/assets/${f}`),alt:e,className:`mx-auto h-20 object-contain`})}),(0,Z.jsx)(Mb,{label:Q(`sign.remove`),onClick:()=>r(void 0),children:(0,Z.jsx)(oy,{className:`size-4`})})]}):(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{s([]),a(!0)},className:`flex w-full flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-4 py-7 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink`,children:[(0,Z.jsx)(vv,{className:`size-6`}),Q(`sign.open`)]}),(0,Z.jsxs)(Gb,{open:i,onClose:()=>a(!1),title:e,wide:!0,children:[(0,Z.jsx)(zO,{strokes:o,onStrokes:s}),u?(0,Z.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:u}):null,(0,Z.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(jb,{variant:`ghost`,disabled:!o.length||c,onClick:()=>s([]),children:[(0,Z.jsx)(S_,{className:`size-4`}),` `,Q(`sign.clear`)]}),(0,Z.jsx)(jb,{busy:c,disabled:!o.length,onClick:()=>void p(),children:Q(`sign.accept`)})]})]})]})}function HO({runId:e,connectionId:t,connector:n,onCancel:r}){let[i,a]=(0,y.useState)({}),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),u=async()=>{s(!0),l(null);try{await JE.post(`/api/runs/${e}/connections/${t}/credentials/${n.id}`,{values:i})}catch(e){l(e.message)}finally{s(!1)}};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl bg-card p-4 ring-1 ring-input`,children:[(n.fields??[]).map(e=>(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(Vb,{children:e.label}),(0,Z.jsx)(Fb,{type:e.secret?`password`:`text`,autoComplete:`off`,value:i[e.key]??``,placeholder:e.placeholder,onChange:t=>a(n=>({...n,[e.key]:t.target.value})),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),u())}})]},e.key)),n.hint?(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:n.hint}):null,c?(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:c}):null,(0,Z.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Z.jsx)(jb,{variant:`ghost`,size:`sm`,onClick:r,children:Q(`common.cancel`)}),(0,Z.jsx)(jb,{size:`sm`,busy:o,onClick:()=>void u(),children:Q(`connect.go`)})]})]})}function UO({runId:e,connection:t}){let[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(null);if(!t)return null;if(t.account){let n=t.connectors.find(e=>e.id===t.account?.connector)?.name??``;return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,Z.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-moss-tint text-moss`,children:(0,Z.jsx)(c_,{className:`size-5`})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`truncate font-medium text-[0.9375rem]`,children:t.account.label}),(0,Z.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:Q(`connect.connected`,{name:n})})]}),(0,Z.jsx)(Mb,{label:Q(`connect.disconnect`),onClick:()=>void JE.del(`/api/runs/${e}/connections/${t.id}`),children:(0,Z.jsx)(Qv,{className:`size-4`})})]})}let c=async n=>{if(s(null),a(null),sE(`signIn`)){try{let{url:r}=await JE.post(`/api/runs/${e}/connections/${t.id}/oauth/${n.id}`);await cE(`signIn`,{url:r})}catch(e){s(e.message)}return}let r=window.open(`about:blank`,`wizard-connect`,`width=540,height=700`);try{let{url:i}=await JE.post(`/api/runs/${e}/connections/${t.id}/oauth/${n.id}`);r?r.location.replace(i):a(i)}catch(e){r?.close(),s(e.message)}},l=t.connectors.find(e=>e.id===n);return t.connectors.length?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.connectors.map(e=>(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>e.auth===`oauth2`?void c(e):r(n===e.id?null:e.id),className:$(`inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[0.875rem] ring-1 transition`,n===e.id?`bg-ember-veil text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink hover:ring-ember`),children:[(0,Z.jsx)(X_,{className:`size-4`}),` `,e.name]},e.id))}),l?(0,Z.jsx)(HO,{runId:e,connectionId:t.id,connector:l,onCancel:()=>r(null)}):null,i?(0,Z.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,className:`text-[0.875rem] text-ember underline`,children:Q(`connect.openLink`)}):null,o?(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:o}):null]}):(0,Z.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Q(`connect.none`)})}function WO(e){return e==null?``:Array.isArray(e)?e.join(`, `):String(e)}function GO(e,t){if(t.trim()===``)return null;if(e.type===`number`){let e=Number(t.replace(/\s/g,``).replace(`,`,`.`));return Number.isFinite(e)?e:t}return e.type===`boolean`?t===`true`:t}function KO({column:e,value:t,boxed:n,onCommit:r}){let[i,a]=(0,y.useState)(WO(t));(0,y.useEffect)(()=>a(WO(t)),[t]);let o=$(`w-full min-w-0 rounded-md border border-transparent px-2 text-[0.8125rem] outline-none focus:border-ember focus:bg-card`,n?`h-11 bg-paper-2`:`h-9 bg-transparent hover:bg-paper-2 coarse:h-11`);return e.type===`boolean`?(0,Z.jsx)(`label`,{className:`flex size-9 cursor-pointer items-center justify-center coarse:size-11`,children:(0,Z.jsx)(`input`,{type:`checkbox`,"aria-label":e.name,checked:t===!0,onChange:e=>r(e.target.checked),className:`size-4 accent-[var(--ember)] coarse:size-6`})}):e.type===`select`&&!e.format.multiple&&!e.format.allowCustom?(0,Z.jsxs)(`select`,{value:i,onChange:e=>r(e.target.value||null),className:o,children:[(0,Z.jsx)(`option`,{value:``}),e.format.options.map(e=>(0,Z.jsx)(`option`,{value:e.id,children:e.label},e.id))]}):(0,Z.jsx)(`input`,{"aria-label":e.name,type:e.type===`date`&&e.format.kind===`date`?`date`:`text`,inputMode:e.type===`number`?`decimal`:void 0,enterKeyHint:`done`,autoComplete:`off`,value:i,onChange:e=>a(e.target.value),onBlur:()=>{i!==WO(t)&&r(GO(e,i))},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.target.blur())},className:$(o,e.type===`number`&&`text-right tabular-nums`)})}function qO({runId:e,list:t,editable:n}){let{def:r,rows:i}=t,[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)({}),l=`/api/runs/${e}/lists/${r.id}/rows`,u=async e=>{o(null);try{await e()}catch(e){o(e instanceof GE?e.message:String(e))}},d=()=>u(async()=>{await JE.post(l,{cells:s}),c({})}),f=Object.values(s).some(e=>e!=null&&e!==``);if(!i.length&&!n)return(0,Z.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Q(`list.empty`)});let p=(e,t)=>t===0||e.type===`text`&&e.format?.style===`multiline`,m=(e,t,n)=>void u(()=>JE.patch(`${l}/${e}`,{cells:{[t]:n}}));return(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 sm:hidden`,children:[i.map(e=>(0,Z.jsxs)(`div`,{className:`rounded-lg bg-paper p-2 ring-1 ring-border-soft`,children:[(0,Z.jsx)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-1.5`,children:r.columns.map((t,r)=>(0,Z.jsxs)(`div`,{className:$(`min-w-0`,p(t,r)&&`col-span-2`),children:[(0,Z.jsx)(`div`,{className:`px-1 pb-0.5 text-[0.6875rem] text-ink-3`,children:t.name}),n?(0,Z.jsx)(KO,{boxed:!0,column:t,value:e.cells[t.id],onCommit:n=>m(e.id,t.id,n)}):(0,Z.jsx)(`div`,{className:$(`break-words px-1 text-[0.875rem]`,t.type===`number`&&`tabular-nums`),children:TD(t,e.cells[t.id],hb)||`—`})]},t.id))}),n?(0,Z.jsx)(`div`,{className:`mt-1 flex justify-end`,children:(0,Z.jsx)(Mb,{label:Q(`list.delete`),onClick:()=>void u(()=>JE.del(`${l}/${e.id}`)),children:(0,Z.jsx)(Kv,{className:`size-4`})})}):null]},e.id)),n?(0,Z.jsxs)(`div`,{className:`rounded-lg border border-input border-dashed p-2`,children:[(0,Z.jsx)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-1.5`,children:r.columns.map((e,t)=>(0,Z.jsxs)(`div`,{className:$(`min-w-0`,p(e,t)&&`col-span-2`),children:[(0,Z.jsx)(`div`,{className:`px-1 pb-0.5 text-[0.6875rem] text-ink-3`,children:e.name}),(0,Z.jsx)(KO,{boxed:!0,column:e,value:s[e.id],onCommit:t=>c(n=>({...n,[e.id]:t}))})]},e.id))}),(0,Z.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,Z.jsxs)(jb,{variant:`secondary`,size:`sm`,onClick:()=>f?void d():void 0,children:[(0,Z.jsx)(wv,{className:`size-4`}),` `,Q(`run.addRow`)]})})]}):null]}),(0,Z.jsx)(`div`,{className:`hidden overflow-x-auto rounded-lg ring-1 ring-border-soft sm:block`,children:(0,Z.jsxs)(`table`,{className:`w-full text-[0.8125rem]`,children:[(0,Z.jsx)(`thead`,{className:`bg-paper-2 text-ink-2`,children:(0,Z.jsxs)(`tr`,{children:[r.columns.map(e=>(0,Z.jsx)(`th`,{className:`whitespace-nowrap px-3 py-2 text-left font-medium`,children:e.name},e.id)),n?(0,Z.jsx)(`th`,{className:`w-10`}):null]})}),(0,Z.jsxs)(`tbody`,{children:[i.map(e=>(0,Z.jsxs)(`tr`,{className:`border-border-soft border-t align-top`,children:[r.columns.map(t=>(0,Z.jsx)(`td`,{className:$(`min-w-[7.5rem]`,n?`px-1 py-0.5`:`px-3 py-2`),children:n?(0,Z.jsx)(KO,{column:t,value:e.cells[t.id],onCommit:n=>m(e.id,t.id,n)}):(0,Z.jsx)(`span`,{className:$(t.type===`number`&&`tabular-nums`),children:TD(t,e.cells[t.id],hb)})},t.id)),n?(0,Z.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,Z.jsx)(Mb,{label:Q(`list.delete`),className:`size-9`,onClick:()=>void u(()=>JE.del(`${l}/${e.id}`)),children:(0,Z.jsx)(Kv,{className:`size-3.5`})})}):null]},e.id)),n?(0,Z.jsxs)(`tr`,{className:`border-border-soft border-t bg-paper`,children:[r.columns.map(e=>(0,Z.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,Z.jsx)(KO,{column:e,value:s[e.id],onCommit:t=>c(n=>({...n,[e.id]:t}))})},e.id)),(0,Z.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,Z.jsx)(Mb,{label:Q(`run.addRow`),className:`size-9`,onClick:()=>f?void d():void 0,children:(0,Z.jsx)(wv,{className:`size-4`})})})]}):null]})]})}),a?(0,Z.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:a}):null]})}function JO(e,t,n){return IS(`/api/runs/${e}/store/files/${t.split(`/`).map(encodeURIComponent).join(`/`)}${n?`?inline=1`:``}`)}var YO=[`bg-paper-3 text-ink-3`,`bg-moss-tint text-moss`,`bg-rose-tint text-rose`,`bg-ember-tint text-ember-strong`];function XO({runId:e,list:t}){let{def:n,rows:r}=t,i=n.columns.find(e=>e.id===n.check?.file),a=n.columns.find(e=>e.id===n.check?.status),o=a?.type===`select`?a.format.options:[],s=o[0]?.id,c=e=>a?String(e.cells[a.id]??s??``):``,l=e=>!a||c(e)===s,[u,d]=(0,y.useState)(()=>(r.find(l)??r[0])?.id??null),[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(null),g=`/api/runs/${e}/lists/${n.id}/rows`,_=r.find(e=>e.id===u)??r[0],v=f?r.filter(e=>l(e)||e.id===_?.id):r,b=r.filter(e=>!l(e)).length,x=n.columns.filter(e=>e!==i&&e!==a),S=x.filter(e=>e.id!==n.key),C=S.find(e=>e.type===`text`)??S[0],w=S.filter(e=>e!==C),T=async(e,t)=>{h(null);try{await JE.patch(`${g}/${e}`,{cells:t})}catch(e){h(e instanceof GE?e.message:String(e))}},E=e=>{let t=v.findIndex(e=>e.id===_?.id),n=v[Math.min(v.length-1,Math.max(0,t+e))];n&&d(n.id)},D=async e=>{if(!_||!a)return;let t=r.findIndex(e=>e.id===_.id),n=[...r.slice(t+1),...r.slice(0,t)].find(l);await T(_.id,{[a.id]:e}),n&&e!==s&&d(n.id)},ee=e=>{e.target.closest(`input, textarea, select`)||(e.key===`ArrowDown`||e.key===`ArrowUp`?(e.preventDefault(),E(e.key===`ArrowDown`?1:-1)):/^[1-9]$/.test(e.key)&&o[Number(e.key)]&&(e.preventDefault(),D(o[Number(e.key)].id)))};if(!r.length)return(0,Z.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Q(`list.empty`)});let O=i&&_?String(_.cells[i.id]??``).trim():``,k=O.split(`.`).pop()?.toLowerCase()??``,A=e=>YO[Math.min(Math.max(0,o.findIndex(t=>t.id===c(e))),3)];return(0,Z.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(280px,360px)_minmax(0,1fr)]`,onKeyDown:ee,children:[(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-col`,children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:Q(`check.progress`,{done:b,total:r.length})}),a?(0,Z.jsx)(`button`,{type:`button`,"aria-pressed":f,onClick:()=>p(e=>!e),className:$(`inline-flex h-8 items-center rounded-full px-3 text-[0.8125rem] ring-1 transition coarse:h-11`,f?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink`),children:Q(`check.onlyOpen`)}):null]}),(0,Z.jsx)(`ul`,{className:`flex max-h-[38vh] flex-col gap-1.5 overflow-y-auto p-0.5 pr-1 lg:max-h-[calc(100vh-15rem)]`,children:v.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>d(e.id),"aria-current":e.id===_?.id,className:$(`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left ring-1 transition`,e.id===_?.id?`bg-card shadow-soft ring-ember`:`bg-paper ring-border-soft hover:bg-card`),children:[(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`block truncate font-medium text-[0.875rem]`,children:C&&TD(C,e.cells[C.id],hb)||`—`}),(0,Z.jsx)(`span`,{className:`block truncate text-[0.75rem] text-ink-3 tabular-nums`,children:w.slice(0,2).map(t=>TD(t,e.cells[t.id],hb)).filter(Boolean).join(` · `)})]}),a?(0,Z.jsx)(`span`,{className:$(`shrink-0 rounded-full px-2 py-0.5 font-medium text-[0.6875rem]`,A(e)),children:o.find(t=>t.id===c(e))?.label??c(e)}):null]})},e.id))})]}),_?(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[o.length>1?(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[o.slice(1).map((e,t)=>(0,Z.jsxs)(jb,{size:`md`,variant:c(_)===e.id?`primary`:`secondary`,onClick:()=>void D(e.id),children:[c(_)===e.id?(0,Z.jsx)(c_,{className:`size-4`}):null,e.label,(0,Z.jsx)(`kbd`,{className:`ml-1 hidden rounded bg-black/10 px-1.5 text-[0.6875rem] lg:inline`,children:t+1})]},e.id)),c(_)===s?null:(0,Z.jsx)(jb,{size:`md`,variant:`ghost`,onClick:()=>void D(s??``),children:Q(`check.reopen`)})]}):null,(0,Z.jsx)(`div`,{className:`overflow-hidden rounded-lg bg-paper-2 ring-1 ring-border-soft`,children:O?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 border-border-soft border-b bg-card px-3 py-2 text-[0.8125rem]`,children:[(0,Z.jsx)(A_,{className:`size-3.5 shrink-0 text-ink-3`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:O.split(`/`).pop()}),(0,Z.jsx)(`a`,{href:JO(e,O,k===`pdf`),target:`_blank`,rel:`noreferrer`,className:`shrink-0 text-ink-2 underline-offset-2 hover:text-ink hover:underline`,children:Q(`run.openFull`)})]}),k===`pdf`?(0,Z.jsx)(`iframe`,{title:O,src:`${JO(e,O,!0)}#toolbar=0&navpanes=0&view=FitH`,className:`h-[46vh] w-full border-0 bg-white lg:h-[calc(100vh-27rem)] lg:min-h-[360px]`},O):[`png`,`jpg`,`jpeg`,`webp`].includes(k)?(0,Z.jsx)(`div`,{className:`flex max-h-[46vh] justify-center overflow-auto bg-white lg:max-h-[calc(100vh-27rem)]`,children:(0,Z.jsx)(`img`,{src:JO(e,O,!0),alt:O,className:`max-w-full object-contain`},O)}):(0,Z.jsx)(`p`,{className:`px-4 py-10 text-center text-[0.875rem] text-ink-3`,children:Q(`check.noPreview`)})]}):(0,Z.jsx)(`p`,{className:`px-4 py-14 text-center text-[0.875rem] text-ink-3`,children:Q(`check.noFile`)})}),(0,Z.jsx)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-2 sm:grid-cols-3`,children:x.map(e=>(0,Z.jsxs)(`div`,{className:$(`min-w-0`,e.type===`text`&&e.format?.style===`multiline`&&`col-span-full`),children:[(0,Z.jsx)(`div`,{className:`px-1 pb-0.5 text-[0.6875rem] text-ink-3`,children:e.name}),(0,Z.jsx)(KO,{boxed:!0,column:e,value:_.cells[e.id],onCommit:t=>void T(_.id,{[e.id]:t})})]},e.id))}),m?(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:m}):null]}):null]})}var ZO={xlsx:`Excel`,csv:`CSV`,json:`JSON`,md:`Markdown`,zip:`ZIP`};function QO({runId:e,list:t}){return(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.formats.map(n=>(0,Z.jsx)(`a`,{href:IS(`/api/runs/${e}/lists/${t.def.id}/download?format=${n}`),className:`inline-flex h-9 items-center rounded-full bg-paper-2 px-3.5 font-medium text-[0.8125rem] text-ink-2 transition hover:bg-paper-3 hover:text-ink coarse:h-11 coarse:px-4`,children:ZO[n]??n},n))})}function $O(e){return e>1e6?`${(e/1e6).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1e3))} KB`}function ek({runId:e}){let[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(!1);(0,y.useEffect)(()=>{t&&(o(!1),JE.get(`/api/runs/${e}/store`).then(i))},[t,e]);let s=r&&!r.files.length&&!r.connections.length&&!r.keepsSignIns&&r.lists.every(e=>!e.rows);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>n(!0),className:`inline-flex items-center gap-1.5 text-[0.8125rem] text-ink-4 transition hover:text-ink-2 coarse:min-h-11`,children:[(0,Z.jsx)(v_,{className:`size-3.5`}),` `,Q(`store.open`)]}),(0,Z.jsx)(Gb,{open:t,onClose:()=>n(!1),title:Q(`store.title`),wide:!0,children:r?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-5 text-[0.875rem]`,children:[(0,Z.jsx)(`p`,{className:`text-ink-3`,children:Q(`store.explain`)}),s?(0,Z.jsx)(`p`,{className:`text-ink-2`,children:Q(`store.empty`)}):null,r.lists.some(e=>e.rows)?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1`,children:r.lists.filter(e=>e.rows).map(e=>(0,Z.jsxs)(`li`,{className:`flex justify-between gap-3`,children:[(0,Z.jsx)(`span`,{children:e.title}),(0,Z.jsx)(`span`,{className:`text-ink-3 tabular-nums`,children:Q(`store.rows`,{n:e.rows})})]},e.id))}):null,r.connections.map(e=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(X_,{className:`size-4 text-ink-3`}),` `,e.account?.label]},e.id)),r.keepsSignIns?(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(c_,{className:`size-4 text-ink-3`}),` `,Q(`store.signIns`)]}):null,r.files.length?(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`mb-1 text-ink-3`,children:Q(`store.files`,{n:r.files.length,size:$O(r.files.reduce((e,t)=>e+t.size,0))})}),(0,Z.jsx)(`ul`,{className:`max-h-56 overflow-y-auto rounded-lg ring-1 ring-border-soft`,children:r.files.map(t=>(0,Z.jsx)(`li`,{className:`border-border-soft border-b last:border-0`,children:(0,Z.jsxs)(`a`,{href:IS(`/api/runs/${e}/store/files/${t.path}`),className:`flex items-center gap-2 px-3 py-2 text-[0.8125rem] hover:bg-paper-2 coarse:min-h-11`,title:t.source??void 0,children:[(0,Z.jsx)(A_,{className:`size-3.5 shrink-0 text-ink-3`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.path}),(0,Z.jsx)(`span`,{className:`text-ink-4 tabular-nums`,children:$O(t.size)})]})},t.path))})]}):null,(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 pt-1`,children:[s?(0,Z.jsx)(`span`,{}):a?(0,Z.jsxs)(jb,{variant:`secondary`,onClick:async()=>{await JE.del(`/api/runs/${e}/store`),i(await JE.get(`/api/runs/${e}/store`)),o(!1)},children:[(0,Z.jsx)(Kv,{className:`size-4`}),` `,Q(`store.confirmDelete`)]}):(0,Z.jsxs)(jb,{variant:`ghost`,onClick:()=>o(!0),children:[(0,Z.jsx)(Kv,{className:`size-4`}),` `,Q(`store.delete`)]}),(0,Z.jsx)(jb,{onClick:()=>n(!1),children:Q(`common.close`)})]})]}):(0,Z.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,Z.jsx)(Hb,{})})})]})}var tk=300;function nk(){if(typeof MediaRecorder<`u`)return[`audio/webm;codecs=opus`,`audio/mp4`,`audio/webm`,`audio/ogg;codecs=opus`].find(e=>MediaRecorder.isTypeSupported(e))}function rk(e){return`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`}function ik({value:e,runId:t,onChange:n,onBusy:r}){let i=jD(e)?e:null,[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(0),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(null),[p,m]=(0,y.useState)(!1),[h,g]=(0,y.useState)(null),_=(0,y.useRef)(null),v=(0,y.useRef)(null),b=nk(),x=fE&&!!b;(0,y.useEffect)(()=>()=>{_.current&&(_.current.recorder.onstop=null,_.current.stop())},[]),(0,y.useEffect)(()=>()=>{h&&URL.revokeObjectURL(h.url)},[h]);let S=async(e,i)=>{u(!0),r?.(!0),f(null);try{let r=await JE.upload(`/api/runs/${t}/uploads`,e);g({asset:r.id,url:URL.createObjectURL(e)}),n({asset:r.id,...i===void 0?{}:{seconds:i}})}catch(e){f(e.message)}finally{u(!1),r?.(!1)}},C=async()=>{f(null),m(!1);let e;try{e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}})}catch{m(!0);return}let t=[],n=new MediaRecorder(e,{mimeType:b,audioBitsPerSecond:48e3}),i=Date.now(),a=new AudioContext,s=a.createAnalyser();s.fftSize=256,a.createMediaStreamSource(e).connect(s);let l=new Uint8Array(s.fftSize),u=0,d=()=>{s.getByteTimeDomainData(l);let e=0;for(let t of l)e=Math.max(e,Math.abs(t-128));if(c(Math.min(1,e/64)),o((Date.now()-i)/1e3),(Date.now()-i)/1e3>=tk){p();return}u=requestAnimationFrame(d)},p=()=>{cancelAnimationFrame(u),n.state!==`inactive`&&n.stop();for(let t of e.getTracks())t.stop();a.close().catch(()=>void 0),_.current=null,o(null),c(0)};n.ondataavailable=e=>e.data.size&&t.push(e.data),n.onstop=()=>{let e=(n.mimeType||b||`audio/webm`).split(`;`)[0],r=e===`audio/mp4`?`m4a`:e===`audio/ogg`?`ogg`:`webm`,a=Math.max(1,Math.round((Date.now()-i)/1e3));S(new File(t,`sprachnotiz-${cO()}.${r}`,{type:e}),a)},_.current={recorder:n,stop:p},r?.(!0),n.start(1e3),u=requestAnimationFrame(d)},w=a!==null,T=(0,Z.jsxs)(jb,{variant:`secondary`,onClick:()=>v.current?.click(),children:[(0,Z.jsx)(O_,{className:`size-4`}),` `,Q(`voice.pick`)]});return(0,Z.jsxs)(`div`,{children:[w?(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-ember`,children:[(0,Z.jsxs)(`span`,{className:`relative flex size-11 shrink-0 items-center justify-center`,children:[(0,Z.jsx)(`span`,{className:`absolute inset-0 rounded-full bg-rose-tint transition-transform duration-75`,style:{transform:`scale(${.7+s*.5})`}}),(0,Z.jsx)(`span`,{className:`relative size-3.5 animate-pulse-dot rounded-full bg-rose`})]}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`font-medium text-[0.9375rem] tabular-nums`,children:rk(a)}),(0,Z.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:a>270?Q(`voice.left`,{s:Math.ceil(tk-a)}):Q(`voice.recording`)})]}),(0,Z.jsxs)(jb,{onClick:()=>_.current?.stop(),children:[(0,Z.jsx)(Hv,{className:`size-3.5 fill-current`}),` `,Q(`voice.stop`)]})]}):l?(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-4 text-[0.875rem] text-ink-3 ring-1 ring-input`,children:[(0,Z.jsx)(Hb,{className:`size-4`}),` `,Q(`run.uploading`)]}):i?(0,Z.jsxs)(`div`,{className:`rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,Z.jsx)(`audio`,{controls:!0,preload:`metadata`,src:h?.asset===i.asset?h.url:`/api/runs/${t}/assets/${i.asset}`,className:`h-11 w-full`}),i.transcript?(0,Z.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap px-1 text-[0.875rem] text-ink-2 leading-relaxed`,children:i.transcript}):null,(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:`px-1 text-[0.8125rem] text-ink-3`,children:i.seconds?rk(i.seconds):null}),(0,Z.jsxs)(`div`,{className:`flex gap-1`,children:[x?(0,Z.jsxs)(jb,{variant:`ghost`,size:`sm`,onClick:()=>void C(),children:[(0,Z.jsx)(Ov,{className:`size-3.5`}),` `,Q(`voice.again`)]}):null,(0,Z.jsx)(jb,{variant:`ghost`,size:`sm`,onClick:()=>n(void 0),children:Q(`voice.remove`)})]})]})]}):(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[x?(0,Z.jsxs)(jb,{variant:`secondary`,size:`lg`,onClick:()=>void C(),className:`w-full sm:w-auto`,children:[(0,Z.jsx)(uv,{className:`size-4`}),` `,Q(`voice.start`)]}):T,x&&p?T:null]}),p?(0,Z.jsx)(`p`,{className:`mt-2 rounded-lg bg-amber-tint px-3 py-2 text-[0.8125rem] text-ink-2 leading-relaxed`,children:Q(`voice.denied`)}):(0,Z.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3 leading-relaxed`,children:Q(x?`voice.why`:`voice.noRecorder`)})]}),(0,Z.jsx)(`input`,{ref:v,type:`file`,hidden:!0,accept:`audio/*`,capture:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&S(t,void 0)}}),d?(0,Z.jsx)(`div`,{className:`mt-2 text-[0.8125rem] text-rose`,children:d}):null]})}function ak(e,t){try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t}).format(e)}catch{return`${e.toFixed(2)} ${t}`}}function ok({field:e,value:t,values:n,onChange:r}){let i=e.columns??[],a=Array.isArray(t)&&t.length?t:[{}],o=iO(e,a,n),s=(e,t,n)=>{r(a.map((r,i)=>i===e?{...r,[t]:n}:r))},c=i.map(e=>e.kind===`text`&&e===i[0]?`minmax(0,3fr)`:`minmax(0,1fr)`).join(` `);return(0,Z.jsxs)(`div`,{className:`rounded-xl bg-card p-2 ring-1 ring-input`,children:[(0,Z.jsx)(`div`,{className:`hidden gap-2 px-2 pt-1 pb-2 text-[0.75rem] text-ink-3 sm:grid`,style:{gridTemplateColumns:`${c} 36px`},children:i.map(e=>(0,Z.jsx)(`div`,{className:e.kind===`text`?``:`text-right`,children:e.label},e.id))}),(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:a.map((e,t)=>(0,Z.jsxs)(`div`,{className:`grid grid-cols-6 gap-2 rounded-lg bg-paper p-2 sm:bg-transparent sm:p-0 sm:[grid-template-columns:var(--cols)]`,style:{"--cols":`${c} 36px`},children:[i.map((n,r)=>(0,Z.jsxs)(`label`,{className:$(`flex min-w-0 flex-col gap-1 sm:col-span-1`,r===0?`col-span-5`:i.length-1<=2?`col-span-3`:`col-span-2`),children:[(0,Z.jsx)(`span`,{className:`px-0.5 text-[0.6875rem] text-ink-3 sm:hidden`,children:n.label}),(0,Z.jsx)(`input`,{"aria-label":n.label,placeholder:n.label,inputMode:n.kind===`text`?`text`:`decimal`,autoComplete:`off`,value:String(e[n.id]??``),onChange:e=>s(t,n.id,e.target.value),className:$(`h-11 w-full min-w-0 rounded-md border border-transparent bg-paper-2 px-2.5 text-[0.875rem] outline-none placeholder:text-transparent focus:border-focus focus:bg-card sm:placeholder:text-ink-4`,n.kind!==`text`&&`text-right tabular-nums`)})]},n.id)),(0,Z.jsx)(Mb,{label:Q(`list.delete`),onClick:()=>r(a.filter((e,n)=>n!==t)),className:`order-first col-start-6 row-start-1 size-11 justify-self-end self-end sm:order-none sm:col-start-auto sm:row-start-auto`,children:(0,Z.jsx)(Kv,{className:`size-4`})})]},t))}),(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-end justify-between gap-3 px-2 pb-1`,children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>r([...a,{}]),className:`inline-flex h-9 items-center gap-1.5 rounded-full px-3 text-[0.8125rem] text-ink-2 hover:bg-accent coarse:h-11`,children:[(0,Z.jsx)(wv,{className:`size-4`}),` `,Q(`run.addRow`)]}),(0,Z.jsxs)(`div`,{className:`text-right text-[0.8125rem] tabular-nums`,children:[(0,Z.jsxs)(`div`,{className:`text-ink-3`,children:[Q(`run.net`),` `,ak(o.net,o.currency)]}),o.vatRate?(0,Z.jsxs)(`div`,{className:`text-ink-3`,children:[Q(`run.vat`,{r:o.vatRate}),` `,ak(o.vat,o.currency)]}):null,(0,Z.jsxs)(`div`,{className:`font-semibold text-[0.9375rem] text-ink`,children:[Q(`run.total`),` `,ak(o.gross,o.currency)]})]})]})]})}function sk(e){return!!e?.closest(`input, textarea, [contenteditable='true']`)}function ck({field:e,value:t,runId:n,onChange:r,onBusy:i}){let a=(0,y.useRef)(null),o=(0,y.useRef)(null),s=(0,y.useRef)(null),c=(0,y.useRef)(null),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)({}),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(!1),[_,v]=(0,y.useState)(!1),[b,x]=(0,y.useState)(null),S=(0,y.useRef)(null),C=e=>{S.current=e,x(e)},w=e.kind===`image`,T=!!e.multiple,E=T?e.max??30:1,D=w||!!e.camera||!!e.video,ee=!w&&!!e.video,O=Array.isArray(t)?t:typeof t==`string`&&t?[t]:[],k=(0,y.useRef)(O);k.current=O;let A=O.length<E,te=async e=>{let t=(w?e.filter(e=>e.type.startsWith(`image/`)):e).sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0}));if(!t.length)return;let a=E-(T?k.current.length:0);u(!0),i?.(!0),m(t.length>a&&T?Q(`run.maxFiles`,{n:E}):null);try{for(let e of t.slice(0,Math.max(0,a))){let t=await sO(e),i=await JE.upload(`/api/runs/${n}/uploads`,t);f(e=>({...e,[i.id]:{name:i.name,mime:i.mime}}));let a=T?[...k.current,i.id]:i.id;k.current=T?a:[i.id],r(a)}}catch(e){m(e.message)}finally{u(!1),i?.(!1)}},ne=(0,y.useRef)(te);ne.current=te;let re=e=>{let t=O.filter(t=>t!==e);r(T?t:void 0)},ie=(e,t)=>{let n=k.current.indexOf(e),i=Math.min(k.current.length-1,Math.max(0,t));if(n<0||n===i)return;let a=k.current.filter(t=>t!==e);a.splice(i,0,e),k.current=a,r(a)},ae=T&&O.length>1;(0,y.useEffect)(()=>{if(!A)return;let e=e=>{let t=Array.from(e.clipboardData?.files??[]),n=a.current;if(!t.length||!n||sk(document.activeElement))return;let r=document.querySelectorAll(`[data-upload-field]`);(n.matches(`:hover`)||n.contains(document.activeElement)||r.length===1)&&(e.preventDefault(),ne.current(t))};return document.addEventListener(`paste`,e),()=>document.removeEventListener(`paste`,e)},[A]);let oe=$(`flex flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-3 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink`,O.length?`py-4`:`py-8`);return(0,Z.jsxs)(`div`,{ref:a,"data-upload-field":``,onDragOver:e=>{A&&(e.preventDefault(),v(!0))},onDragLeave:()=>v(!1),onDrop:e=>{v(!1),A&&(e.preventDefault(),te(Array.from(e.dataTransfer.files)))},children:[O.length?(0,Z.jsx)(`div`,{className:`mb-2 flex flex-col gap-2`,children:O.map((e,t)=>{let r=d[e],i=r?.mime??(w?`image/`:``);return(0,Z.jsxs)(`div`,{"data-file-id":e,className:$(`flex items-center gap-3 rounded-xl bg-card p-2 ring-1 ring-input transition-shadow`,b===e&&`relative z-10 shadow-elevated ring-2 ring-ember`),children:[ae?(0,Z.jsxs)(`button`,{type:`button`,"aria-label":Q(`run.moveFile`,{n:t+1}),title:Q(`run.moveFileHint`),className:$(`-mr-1 flex h-14 w-9 shrink-0 touch-none flex-col items-center justify-center gap-0.5 rounded-lg text-ink-3 hover:bg-paper-2 hover:text-ink`,b===e?`cursor-grabbing`:`cursor-grab`),onPointerDown:t=>{try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}C(e)},onPointerMove:t=>{if(S.current!==e)return;let n=document.elementFromPoint(t.clientX,t.clientY)?.closest(`[data-file-id]`),r=n?.getAttribute(`data-file-id`);r&&r!==e&&a.current?.contains(n??null)&&ie(e,k.current.indexOf(r))},onPointerUp:()=>C(null),onPointerCancel:()=>C(null),onKeyDown:n=>{(n.key===`ArrowUp`||n.key===`ArrowDown`)&&(n.preventDefault(),ie(e,t+(n.key===`ArrowUp`?-1:1)))},children:[(0,Z.jsx)(`span`,{className:`font-medium text-[0.75rem] tabular-nums`,children:t+1}),(0,Z.jsx)(B_,{className:`size-4`})]}):null,i.startsWith(`image/`)?(0,Z.jsx)(`img`,{src:IS(`/api/runs/${n}/assets/${e}`),alt:``,className:`size-14 rounded-lg object-cover`}):(0,Z.jsx)(`div`,{className:`flex size-12 shrink-0 items-center justify-center rounded-lg bg-paper-2`,children:i.startsWith(`video/`)?(0,Z.jsx)(M_,{className:`size-5 text-ink-3`}):(0,Z.jsx)(gv,{className:`size-5 text-ink-3`})}),(0,Z.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-[0.875rem]`,children:r?.name??`✓`}),(0,Z.jsx)(Mb,{label:Q(`run.removeFile`),onClick:()=>re(e),children:(0,Z.jsx)(oy,{className:`size-4`})})]},e)})}):null,A?(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>o.current?.click(),className:$(oe,`min-w-[9rem] flex-1 px-4`,_&&`border-ember text-ink`),children:[w?(0,Z.jsx)(H_,{className:`size-6`}):(0,Z.jsx)(gv,{className:`size-6`}),l?Q(`run.uploading`):O.length?Q(`run.uploadMore`):Q(dE?`run.uploadTouch`:`run.upload`)]}),D?(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>fE?g(!0):s.current?.click(),className:$(oe,`w-28`),children:[(0,Z.jsx)(o_,{className:`size-6`}),Q(`run.camera`)]}):null,ee&&!(fE&&vO)?(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>c.current?.click(),className:$(oe,`w-28`),children:[(0,Z.jsx)(ey,{className:`size-6`}),Q(`camera.video`)]}):null]}):null,(0,Z.jsx)(`input`,{ref:o,type:`file`,hidden:!0,multiple:T,accept:w?`image/*`:void 0,onChange:e=>{te(Array.from(e.target.files??[])),e.target.value=``}}),(0,Z.jsx)(`input`,{ref:s,type:`file`,hidden:!0,accept:`image/*`,capture:`environment`,onChange:e=>{te(Array.from(e.target.files??[])),e.target.value=``}}),ee?(0,Z.jsx)(`input`,{ref:c,type:`file`,hidden:!0,accept:`video/*`,capture:`environment`,onChange:e=>{te(Array.from(e.target.files??[])),e.target.value=``}}):null,(0,Z.jsx)(yO,{open:h,multiple:T,video:ee,onClose:()=>g(!1),onCapture:e=>te([e]),onNative:()=>s.current?.click()}),T&&(e.min||e.max)?(0,Z.jsx)(`div`,{className:`mt-2 text-[0.8125rem] text-ink-3 tabular-nums`,children:e.min&&O.length<e.min?Q(`run.filesMin`,{n:O.length,min:e.min}):e.max?Q(`run.filesOf`,{n:O.length,max:e.max}):null}):null,p?(0,Z.jsx)(`div`,{className:`mt-2 text-[0.8125rem] text-rose`,children:p}):null]})}function lk(e){let t=`${e.id} ${e.label}`.toLowerCase();return/telefon|phone|handy|mobil(?!it)|\btel\b|rückruf/.test(t)?{type:`tel`,inputMode:`tel`,autoComplete:`tel`}:/\bplz\b|postleitzahl|postal|zip/.test(t)?{inputMode:`numeric`,autoComplete:`postal-code`}:/iban/.test(t)?{autoCapitalize:`characters`,autoCorrect:`off`,spellCheck:!1}:/vorname|first.?name/.test(t)?{autoComplete:`given-name`,autoCapitalize:`words`}:/nachname|last.?name|surname/.test(t)?{autoComplete:`family-name`,autoCapitalize:`words`}:/firma|unternehmen|company|organi[sz]ation/.test(t)?{autoComplete:`organization`,autoCapitalize:`words`}:/straße|strasse|street|anschrift|adresse|address/.test(t)?{autoComplete:`street-address`,autoCapitalize:`words`}:/\b(ort|stadt|city|town)\b/.test(t)?{autoComplete:`address-level2`,autoCapitalize:`words`}:/\bname\b|ansprechp/.test(t)?{autoComplete:`name`,autoCapitalize:`words`}:{autoCapitalize:`sentences`}}function uk({field:e,value:t,onChange:n}){let[r,i]=(0,y.useState)(!1);return(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(Fb,{value:t,placeholder:e.placeholder,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,onChange:e=>n(e.target.value)}),(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`inline-flex h-11 shrink-0 items-center gap-2 rounded-lg border border-input bg-card px-3.5 font-medium text-[0.875rem] text-ink-2 transition hover:border-ember hover:text-ink`,children:[(0,Z.jsx)(Av,{className:`size-4`}),` `,Q(`scan.button`)]}),(0,Z.jsx)(PO,{open:r,onClose:()=>i(!1),onResult:n})]})}function dk({field:e,value:t,values:n,runId:r,view:i,onChange:a,onBusy:o,error:s,closed:c}){let l=t==null?``:String(t),u=new Set(c?.values.map(String)),d;switch(e.kind){case`textarea`:d=(0,Z.jsx)(Lb,{value:l,placeholder:e.placeholder,autoCapitalize:`sentences`,enterKeyHint:`enter`,onChange:e=>a(e.target.value)});break;case`number`:d=(0,Z.jsx)(Fb,{inputMode:`decimal`,autoComplete:`off`,value:l,placeholder:e.placeholder,onChange:e=>a(e.target.value)});break;case`select`:{let t=e.options??[];d=t.length<=5&&t.every(e=>e.length<=28)?(0,Z.jsx)(zb,{value:l,options:t,onChange:a,disabled:[...u]}):(0,Z.jsx)(Rb,{value:l,placeholder:`—`,onChange:a,options:t.map(e=>({value:e,label:e,disabled:u.has(e)}))});break}case`multiselect`:d=(0,Z.jsx)(zb,{multi:!0,value:Array.isArray(t)?t:[],options:e.options??[],onChange:a});break;case`date`:d=(0,Z.jsx)(Fb,{type:`date`,value:l,onChange:e=>a(e.target.value),className:`w-full sm:w-56`});break;case`email`:d=(0,Z.jsx)(Fb,{type:`email`,inputMode:`email`,autoComplete:`email`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,value:l,placeholder:e.placeholder,onChange:e=>a(e.target.value)});break;case`url`:d=(0,Z.jsx)(Fb,{type:`url`,inputMode:`url`,autoComplete:`url`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,value:l,placeholder:e.placeholder??`https://`,onChange:e=>a(e.target.value)});break;case`toggle`:d=(0,Z.jsx)(Bb,{checked:t===!0,onChange:a,label:e.label,disabled:u.has(String(t!==!0))});break;case`color`:d=(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Ib,{value:l||`#e0531b`,onChange:e=>a(e.target.value)}),(0,Z.jsx)(Fb,{value:l,placeholder:`#e0531b`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,onChange:e=>a(e.target.value),className:`w-36`})]});break;case`image`:case`file`:d=(0,Z.jsx)(ck,{field:e,value:t,runId:r,onChange:a,onBusy:o});break;case`items`:d=(0,Z.jsx)(ok,{field:e,value:t,values:n,onChange:a});break;case`connection`:d=(0,Z.jsx)(UO,{runId:r,connection:i?.connections.find(t=>t.id===e.connection)});break;case`list`:{let t=i?.lists.find(t=>t.def.id===e.list);d=t?(0,Z.jsx)(qO,{runId:r,list:t,editable:!0}):null;break}case`location`:d=(0,Z.jsx)(wO,{value:t,runId:r,placeholder:e.placeholder,onChange:a,onBusy:o});break;case`audio`:d=c?null:(0,Z.jsx)(ik,{value:t,runId:r,onChange:a,onBusy:o});break;case`signature`:d=(0,Z.jsx)(VO,{label:e.label,value:t,runId:r,onChange:a});break;default:d=e.scan?(0,Z.jsx)(uk,{field:e,value:l,onChange:a}):(0,Z.jsx)(Fb,{...lk(e),value:l,placeholder:e.placeholder,onChange:e=>a(e.target.value)})}return(0,Z.jsxs)(`div`,{children:[e.kind===`toggle`?(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-6`,children:[(0,Z.jsx)(Vb,{hint:e.help,children:e.label}),d]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Vb,{hint:e.help,required:e.required,children:e.label}),d]}),c?(0,Z.jsx)(`div`,{className:`mt-1.5 text-[0.8125rem] text-ink-3`,children:Q(`run.closed`,{list:c.classes.map(e=>Q(`run.cls.${fk[e]}`)).join(`, `)})}):null,s?(0,Z.jsx)(`div`,{className:`mt-1.5 text-[0.8125rem] text-rose`,children:s}):null]})}var fk={classifier:`text`,standard:`text`,high:`text`,highest:`text`,image:`image`,video:`video`,speech:`speech`,audio:`audio`},pk=45e3;function mk(e){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)({});(0,y.useEffect)(()=>{if(n(null),o(!1),!e)return;let t=!1,r=0,i,a=null,s=Date.now(),c=()=>{t=!0,a?.close(),o(!0)},l=async()=>{try{let r=await JE.get(`/api/runs/${e}`);t||n(r)}catch(e){e instanceof GE&&e.status===404&&c()}},u=()=>{if(clearTimeout(i),a?.close(),t)return;let o=new EventSource(IS(`/api/runs/${e}/stream`),{withCredentials:!0});a=o,s=Date.now(),o.addEventListener(`view`,e=>{r=0,s=Date.now(),n(JSON.parse(e.data))}),o.addEventListener(`ping`,()=>{s=Date.now()}),o.onerror=()=>{o.close(),!(t||a!==o)&&(a=null,l(),r=Math.min(r+1,6),i=setTimeout(u,500*2**r))}},d=()=>{t||document.visibilityState!==`visible`||(!a||a.readyState===EventSource.CLOSED||Date.now()-s>pk?(r=0,u()):l())},f=setInterval(()=>{!t&&a&&Date.now()-s>pk&&(r=0,u())},15e3);return u(),document.addEventListener(`visibilitychange`,d),window.addEventListener(`pageshow`,d),window.addEventListener(`online`,d),()=>{t=!0,clearTimeout(i),clearInterval(f),document.removeEventListener(`visibilitychange`,d),window.removeEventListener(`pageshow`,d),window.removeEventListener(`online`,d),a?.close()}},[e]);let d=(0,y.useCallback)(async(t,n)=>{if(!e)return!1;c(!0),i(null),u({});try{return await JE.post(`/api/runs/${e}/${t}`,n),!0}catch(e){return e instanceof GE&&e.status===422&&Array.isArray(e.body?.fields)&&u(Object.fromEntries(e.body.fields.map(e=>[e.field,e.message]))),i(e.message),!1}finally{c(!1)}},[e]);return{view:t,notFound:a,error:r,busy:s,fieldErrors:l,submitPage:(e,t)=>d(`pages/${e}`,{values:t}),accept:(e,t)=>d(`reviews/${e}`,{type:`accept`,edits:t}),regenerate:(e,t,n,r)=>d(`reviews/${e}`,{type:`regenerate`,target:t,note:n,items:r?.length?r:void 0}),back:()=>d(`back`),retry:()=>d(`retry`)}}function hk({view:e}){let t=Math.round(Math.min(e.progress.done,e.progress.total)/Math.max(1,e.progress.total)*100);return(0,Z.jsx)(`div`,{className:`h-[3px] w-full bg-paper-2`,children:(0,Z.jsx)(`div`,{className:`h-full bg-ember transition-[width] duration-700 ease-out`,style:{width:`${t}%`}})})}function gk({title:e,description:t,kicker:n}){return(0,Z.jsxs)(`div`,{className:`mb-8`,children:[n?(0,Z.jsx)(`p`,{className:`mb-4 text-[0.9375rem] text-ink-2 leading-relaxed`,children:n}):null,(0,Z.jsx)(`h1`,{className:`font-display font-semibold text-[1.75rem] leading-[1.15] tracking-tight sm:text-[2rem]`,children:e}),t?(0,Z.jsx)(`p`,{className:`mt-2 text-[0.9375rem] text-ink-3 leading-relaxed`,children:t}):null]})}function _k(e,t){let n={};for(let r of e.fields)n[r.id]=t.values[r.id]??t.prefill?.[r.id]??r.default??(r.kind===`multiselect`?[]:void 0);return n}function vk(e){return Array.from(e.querySelectorAll(`input:not([type="hidden"], [type="file"], [type="checkbox"], [type="color"], [type="range"], [disabled]), textarea:not([disabled])`)).filter(e=>!e.closest(`dialog`)&&e.offsetParent!==null)}function yk({view:e,run:t,step:n}){let[r,i]=(0,y.useState)(()=>_k(n,e)),[a,o]=(0,y.useState)(new Set),s=(0,y.useRef)(null),c=e.progress.done===0,l=()=>void t.submitPage(n.id,r);return(0,y.useEffect)(()=>{if(!s.current)return;let e=vk(s.current).filter(e=>e instanceof HTMLInputElement);for(let[t,n]of e.entries())(n.dataset.hint||!n.hasAttribute(`enterkeyhint`))&&(n.dataset.hint=`1`,n.setAttribute(`enterkeyhint`,t===e.length-1?`go`:`next`))}),(0,Z.jsxs)(`form`,{ref:s,className:`animate-rise`,onSubmit:e=>{e.preventDefault(),a.size||l()},onKeyDown:e=>{let t=e.target;if(e.key!==`Enter`||e.defaultPrevented||e.nativeEvent.isComposing||!(t instanceof HTMLInputElement)||t.closest(`dialog`))return;let n=vk(e.currentTarget),r=n[n.indexOf(t)+1];r&&(e.preventDefault(),r.focus())},children:[(0,Z.jsx)(gk,{title:n.title,description:n.description,kicker:c?e.wizard.intro:null}),(0,Z.jsx)(`div`,{className:`flex flex-col gap-7`,children:n.fields.map(n=>(0,Z.jsx)(dk,{field:n,value:r[n.id],values:r,runId:e.id,view:e,error:t.fieldErrors[n.id],closed:e.closed?.[n.id],onChange:e=>i(t=>({...t,[n.id]:e})),onBusy:e=>o(t=>{if(t.has(n.id)===e)return t;let r=new Set(t);return e?r.add(n.id):r.delete(n.id),r})},n.id))}),(0,Z.jsx)(bk,{view:e,run:t,sticky:!0,children:(0,Z.jsxs)(jb,{type:`submit`,size:`lg`,busy:t.busy,disabled:a.size>0,children:[n.cta||Q(`run.next`),` `,(0,Z.jsx)(Xg,{className:`size-4`})]})})]})}function bk({view:e,run:t,sticky:n,children:r}){return(0,Z.jsxs)(`div`,{className:$(`mt-10 flex items-center justify-between gap-3`,n&&`action-bar`),children:[e.canBack?(0,Z.jsxs)(jb,{variant:`ghost`,onClick:()=>void t.back(),disabled:t.busy,children:[(0,Z.jsx)(Jg,{className:`size-4`}),` `,Q(`run.back`)]}):(0,Z.jsx)(`span`,{}),r]})}function xk(){let e=CE(),[t,n]=(0,y.useState)(!1),r=e!==`off`;return(0,Z.jsxs)(`div`,{className:`mt-6 flex flex-col items-center gap-2`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":r,disabled:t,onClick:async()=>{if(r){EE();return}n(!0),await TE(),n(!1)},className:$(`inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[0.875rem] ring-1 transition`,r?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink hover:ring-ink-4`),children:[r?(0,Z.jsx)(e_,{className:`size-4 text-ember-strong`}):(0,Z.jsx)(n_,{className:`size-4`}),Q(r?`notify.on`:`notify.ask`)]}),(0,Z.jsx)(`p`,{className:`max-w-xs text-[0.75rem] text-ink-4 leading-relaxed`,children:Q(e===`off`?`notify.why`:e===`on`?`notify.onHint`:wE()?`notify.blocked`:`notify.quiet`)})]})}function Sk({view:e,compact:t,awake:n}){let r=(0,y.useMemo)(()=>{let t=[...e.events].reverse().find(t=>t.type===`step_started`&&t.stepId===e.step?.id);return t?new Date(t.at).getTime():Date.now()},[e.events,e.step?.id]),[i,a]=(0,y.useState)(Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(e)},[]);let o=[...e.events].reverse().find(t=>t.type===`step_started`&&t.stepId===e.step?.id)?.message??e.step?.title??Q(`run.working`),s=e.events.filter(e=>(e.type===`tool`||e.type===`info`)&&new Date(e.at).getTime()>=r-500),c=s.slice(-4),l=[...new Set(s.map(e=>e.asset).filter(e=>!!e))],u=[...s].reverse().find(e=>e.asset)?.asset;return(0,Z.jsxs)(`div`,{className:`flex animate-rise flex-col items-center pt-6 text-center`,children:[(0,Z.jsx)(MS,{kind:e.wizard.avatar,size:t?130:170,fluffy:!0}),(0,Z.jsx)(`h2`,{className:`mt-4 font-display font-semibold text-[1.375rem] tracking-tight`,children:o}),(0,Z.jsx)(`div`,{className:`mt-1 text-[0.8125rem] text-ink-4 tabular-nums`,children:Q(`run.elapsed`,{s:Math.max(0,Math.round((i-r)/1e3))})}),l.length?(0,Z.jsx)(`div`,{className:`mt-5 flex max-w-full flex-wrap justify-center gap-2`,children:l.slice(-8).map(t=>(0,Z.jsx)(`img`,{src:IS(`/api/runs/${e.id}/assets/${t}`),alt:``,className:$(`size-16 animate-rise rounded-lg bg-paper-2 object-cover ring-1 ring-border-soft transition sm:size-20`,t===u?`ring-2 ring-ember`:`opacity-70`)},t))}):null,(0,Z.jsx)(`div`,{className:`mt-6 flex min-h-[7rem] w-full max-w-sm flex-col gap-1.5`,children:c.map((e,t)=>(0,Z.jsxs)(`div`,{className:$(`flex items-center justify-center gap-2 text-[0.8125rem] transition-opacity`,t===c.length-1?`text-ink-2`:`text-ink-4`),children:[t===c.length-1?(0,Z.jsx)(Bv,{className:`size-3.5 animate-breathe text-ember`}):null,(0,Z.jsx)(`span`,{className:`truncate`,children:yb(e)})]},e.id))}),t?null:(0,Z.jsx)(xk,{}),n?(0,Z.jsx)(`p`,{className:`mt-3 text-[0.75rem] text-ink-4`,children:Q(`run.awake`)}):null]})}function Ck(e){let t=(0,y.useRef)({running:!1,since:0,ask:null});(0,y.useEffect)(()=>{if(!e)return;let n=t.current,r=e.status===`running`,i=r?n.running?n.since:Date.now():0,a=t=>{document.visibilityState!==`visible`&&!document.title.startsWith(`● `)&&(document.title=`● ${document.title}`),OE({title:e.wizard.title,body:t,tag:e.id})};r&&e.ask&&e.ask.id!==n.ask?a(Q(`notify.needsYou`)):!r&&n.running&&Date.now()-n.since>8e3&&a(e.status===`failed`?Q(`run.failed`):e.status===`done`?Q(`notify.done`):Q(`notify.next`)),t.current={running:r,since:i,ask:e.ask?.id??null}},[e]),(0,y.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&document.title.startsWith(`● `)&&(document.title=document.title.slice(2))};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[])}function wk({view:e,run:t,step:n}){let[r,i]=(0,y.useState)({}),[a,o]=(0,y.useState)({}),[s,c]=(0,y.useState)(``),l=e.shown.filter(e=>e.output),[u,d]=(0,y.useState)(l.length===1?l[0].step.id:null),[f,p]=(0,y.useState)({}),m=(0,y.useRef)(null),h=l.find(e=>e.step.id===u),g=h?.step.type===`generate`&&(h.output?.assets?.length??0)>1,_=()=>{h&&s.trim()&&t.regenerate(n.id,h.step.id,s.trim(),f[h.step.id])};return(0,Z.jsxs)(`div`,{className:`animate-rise`,children:[(0,Z.jsx)(gk,{title:n.title,description:n.description}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[e.shown.filter(e=>e.output).map(({step:t,output:s})=>{let c=!!n.edit&&t.type===`agent`&&t.output.format!==`json`;return(0,Z.jsxs)(`section`,{children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`h3`,{className:`font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]`,children:t.title}),(0,Z.jsx)(`div`,{className:`flex items-center`,children:c&&!a[t.id]?(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>({...e,[t.id]:!0})),className:`inline-flex h-8 items-center gap-1.5 rounded-full px-3 text-[0.8125rem] text-ink-2 hover:bg-accent hover:text-ink coarse:h-11`,children:[(0,Z.jsx)(Sv,{className:`size-3.5`}),` `,Q(`run.edit`)]}):null})]}),(0,Z.jsx)(zE,{base:`/api/runs/${e.id}`,step:t,output:s,editable:c&&a[t.id],draft:r[t.id],onDraft:e=>i(n=>({...n,[t.id]:e})),picked:f[t.id],onPick:n.regenerate?e=>{d(t.id),p(n=>{let r=n[t.id]??[];return{...n,[t.id]:r.includes(e)?r.filter(t=>t!==e):[...r,e]}}),m.current?.focus()}:void 0})]},t.id)}),e.lists.map(t=>(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h3`,{className:`mb-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]`,children:t.def.title}),t.def.check?(0,Z.jsx)(XO,{runId:e.id,list:t}):(0,Z.jsx)(qO,{runId:e.id,list:t,editable:!0})]},t.def.id)),n.regenerate&&l.length?(0,Z.jsxs)(Ub,{className:`p-3`,children:[l.length>1?(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-1 pb-2`,children:[(0,Z.jsx)(`span`,{className:`mr-1 text-[0.8125rem] text-ink-3`,children:Q(`run.feedbackTarget`)}),l.map(({step:e})=>(0,Z.jsx)(`button`,{type:`button`,"aria-pressed":u===e.id,onClick:()=>{d(e.id),m.current?.focus()},className:$(`inline-flex h-8 items-center rounded-full px-3 text-[0.8125rem] ring-1 transition coarse:h-11`,u===e.id?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink`),children:e.title},e.id))]}):null,(0,Z.jsx)(Lb,{ref:m,minRows:2,maxRows:8,value:s,placeholder:Q(`run.feedbackPlaceholder`),onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())},className:`border-0 bg-transparent shadow-none focus:ring-0`}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1 pt-1`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 text-[0.75rem] text-ink-3`,children:g?f[h.step.id]?.length?Q(`run.regeneratePicked`,{n:[...f[h.step.id]].sort((e,t)=>e-t).map(e=>e+1).join(`, `)}):Q(`run.regenerateAll`):!h&&s.trim()?Q(`run.feedbackPick`):null}),(0,Z.jsxs)(jb,{size:`sm`,variant:`secondary`,busy:t.busy,disabled:!s.trim()||!h,onClick:_,children:[(0,Z.jsx)(Ev,{className:`size-3.5`}),` `,Q(`run.regenerateGo`)]})]})]}):null]}),(0,Z.jsx)(bk,{view:e,run:t,sticky:!0,children:(0,Z.jsxs)(jb,{size:`lg`,busy:t.busy,onClick:()=>void t.accept(n.id,Object.keys(r).length?r:void 0),children:[Q(`run.accept`),` `,(0,Z.jsx)(Xg,{className:`size-4`})]})})]})}function Tk({view:e,run:t,step:n,onRestart:r}){let i=e.shown.filter(e=>e.output);return(0,Z.jsxs)(`div`,{className:`animate-rise`,children:[(0,Z.jsxs)(`div`,{className:`mb-8 flex flex-wrap items-center gap-x-4 gap-y-5`,children:[(0,Z.jsx)(MS,{kind:e.wizard.avatar,size:64}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 basis-[12rem]`,children:[(0,Z.jsx)(`h1`,{className:`text-balance font-display font-semibold text-[1.75rem] leading-tight tracking-tight sm:text-[2rem]`,children:n.title}),n.message?(0,Z.jsx)(`p`,{className:`mt-1 text-[0.9375rem] text-ink-3`,children:n.message}):null]}),e.shown.some(e=>e.output)?(0,Z.jsx)(`div`,{className:`max-sm:basis-full`,children:(0,Z.jsx)(ZE,{runId:e.id,title:`${n.title} · ${e.wizard.title}`,initial:e.shareUrl?{url:e.shareUrl,expiresAt:e.expiresAt}:null})}):null]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i.map(({step:t,output:n,formats:r,label:i})=>(0,Z.jsxs)(Ub,{className:`p-4 sm:p-5`,children:[(0,Z.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsx)(`h3`,{className:`font-display font-semibold text-[1.0625rem]`,children:i??t.title}),(0,Z.jsx)(WE,{base:`/api/runs/${e.id}`,stepId:t.id,formats:r,title:i??t.title})]}),(0,Z.jsx)(zE,{base:`/api/runs/${e.id}`,step:t,output:n}),n?.assets?.some(e=>e.ai)?(0,Z.jsx)(`p`,{className:`mt-3 text-[0.75rem] text-ink-3 leading-relaxed`,children:Q(`ai.publish`)}):null]},t.id)),e.lists.map(t=>(0,Z.jsxs)(Ub,{className:`p-4 sm:p-5`,children:[(0,Z.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsx)(`h3`,{className:`font-display font-semibold text-[1.0625rem]`,children:t.label??t.def.title}),(0,Z.jsx)(QO,{runId:e.id,list:t})]}),(0,Z.jsx)(qO,{runId:e.id,list:t,editable:!0})]},t.def.id))]}),(0,Z.jsx)(bk,{view:e,run:t,children:r?(0,Z.jsxs)(jb,{variant:`secondary`,onClick:r,children:[(0,Z.jsx)(Ov,{className:`size-4`}),` `,Q(`run.again`)]}):(0,Z.jsx)(`span`,{})})]})}function Ek({view:e,run:t}){return(0,Z.jsxs)(`div`,{className:`flex animate-rise flex-col items-center pt-8 text-center`,children:[(0,Z.jsx)(MS,{kind:e.wizard.avatar,size:90}),(0,Z.jsx)(`h2`,{className:`mt-4 font-display font-semibold text-[1.375rem]`,children:Q(`run.failed`)}),(0,Z.jsx)(`p`,{className:`mt-2 max-w-md text-[0.9375rem] text-ink-3`,children:(0,Z.jsx)(Kb,{text:e.error??``})}),(0,Z.jsxs)(`div`,{className:`mt-8 flex gap-3`,children:[e.canBack?(0,Z.jsxs)(jb,{variant:`ghost`,onClick:()=>void t.back(),children:[(0,Z.jsx)(Jg,{className:`size-4`}),` `,Q(`run.back`)]}):null,(0,Z.jsxs)(jb,{onClick:()=>void t.retry(),busy:t.busy,children:[(0,Z.jsx)(Ov,{className:`size-4`}),` `,Q(`run.retry`)]})]})]})}function Dk({runId:e,compact:t,onRestart:n,onView:r,stickyProgress:i}){let a=mk(e),{view:o}=a;(0,y.useEffect)(()=>{r?.(o)},[o,r]),pE();let s=mE(o?.status===`running`&&!o.ask);if(Ck(o),a.notFound)return(0,Z.jsx)(`div`,{className:`py-24 text-center text-ink-3`,children:Q(`run.notFound`)});if(!o)return(0,Z.jsx)(`div`,{className:`flex justify-center py-24 text-ink-4`,children:(0,Z.jsx)(Hb,{})});let c=o.step,l=null;if(o.status===`running`&&o.ask)l=(0,Z.jsx)(QE,{runId:o.id,ask:o.ask},o.ask.id);else if(o.status===`running`)l=(0,Z.jsx)(Sk,{view:o,compact:t,awake:s});else if(o.status===`failed`)l=(0,Z.jsx)(Ek,{view:o,run:a});else if(o.status===`cancelled`)l=(0,Z.jsx)(`div`,{className:`py-24 text-center text-ink-3`,children:Q(`run.cancelled`)});else if(c?.type===`page`)l=(0,Z.jsx)(yk,{view:o,run:a,step:c},c.id);else if(c?.type===`review`){let e=o.shown.map(e=>e.output?.at??``).join(`|`);l=(0,Z.jsx)(wk,{view:o,run:a,step:c},`${c.id}:${e}`)}else c?.type===`result`&&(l=(0,Z.jsx)(Tk,{view:o,run:a,step:c,onRestart:n}));let u=c?.type===`review`&&o.status===`waiting_input`&&o.lists.some(e=>e.def.check);return(0,Z.jsxs)(`div`,{className:`flex min-h-full flex-col`,children:[i?(0,Z.jsx)(`div`,{className:`sticky top-0 z-10`,children:(0,Z.jsx)(hk,{view:o})}):(0,Z.jsx)(hk,{view:o}),(0,Z.jsxs)(`div`,{className:$(`safe-x mx-auto w-full flex-1`,u?`max-w-[1240px] py-8`:t?`max-w-[620px] py-8`:`max-w-[640px] py-8 sm:py-16`),children:[l,a.error&&o.status!==`failed`?(0,Z.jsx)(`div`,{className:`mt-4 rounded-lg bg-rose-tint px-4 py-3 text-[0.875rem] text-rose`,children:a.error}):null,o.keeps&&o.status!==`running`?(0,Z.jsx)(`div`,{className:`mt-10 flex justify-center`,children:(0,Z.jsx)(ek,{runId:o.id})}):null]})]})}var Ok=Object.defineProperty,kk=(e,t,n)=>t in e?Ok(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ak=(e,t)=>{for(var n in t)Ok(e,n,{get:t[n],enumerable:!0})},jk=(e,t,n)=>kk(e,typeof t==`symbol`?t:t+``,n),Mk={};Ak(Mk,{Graph:()=>_A,alg:()=>Gk});var Nk=Object.defineProperty,Pk=(e,t)=>{for(var n in t)Nk(e,n,{get:t[n],enumerable:!0})},Fk=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=Rk(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=zk(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,Ik(this._preds[a],i),Ik(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?Bk(this._isDirected,e):Rk(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?Bk(this._isDirected,e):Rk(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?Bk(this._isDirected,e):Rk(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],Lk(this._preds[t],e),Lk(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function Ik(e,t){e[t]?e[t]++:e[t]=1}function Lk(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Rk(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function zk(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function Bk(e,t){return Rk(e,t.v,t.w,t.name)}Pk({},{read:()=>Wk,write:()=>Vk});function Vk(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Hk(e),edges:Uk(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Hk(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function Uk(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function Wk(e){let t=new Fk(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var Gk={};Pk(Gk,{CycleException:()=>oA,bellmanFord:()=>qk,components:()=>Yk,dijkstra:()=>Qk,dijkstraAll:()=>eA,findCycles:()=>nA,floydWarshall:()=>iA,isAcyclic:()=>cA,postorder:()=>fA,preorder:()=>pA,prim:()=>mA,shortestPaths:()=>hA,tarjan:()=>tA,topsort:()=>sA});var Kk=()=>1;function qk(e,t,n,r){return Jk(e,String(t),n||Kk,r||function(t){return e.outEdges(t)??[]})}function Jk(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+o<r.distance&&(i[e.w]={distance:t.distance+o,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function Yk(e){let t={},n=[],r;function i(n){var a,o;n in t||(t[n]=!0,r.push(n),(a=e.successors(n))==null||a.forEach(i),(o=e.predecessors(n))==null||o.forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var Xk=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},Zk=()=>1;function Qk(e,t,n,r){return $k(e,String(t),n||Zk,r||function(t){return e.outEdges(t)??[]})}function $k(e,t,n,r){let i={},a=new Xk,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function eA(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=Qk(e,i,t,n),r},{})}function tA(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function nA(e){return tA(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var rA=()=>1;function iA(e,t,n){return aA(e,t||rA,n||function(t){return e.outEdges(t)??[]})}function aA(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e<o.distance&&(o.distance=e,o.predecessor=i.predecessor)}})})}),r}var oA=class extends Error{constructor(e){super(e),this.name=`CycleException`}};function sA(e){let t={},n={},r=[];function i(a){var o;if(a in n)throw new oA;a in t||(n[a]=!0,t[a]=!0,(o=e.predecessors(a))==null||o.forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new oA;return r}function cA(e){try{sA(e)}catch(e){if(e instanceof oA)return!1;throw e}return!0}function lA(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=uA(e,t,n===`post`,o,a,r,i)}),i}function uA(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=uA(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function dA(e,t,n){return lA(e,t,n,function(e,t){return e.push(t),e},[])}function fA(e,t){return dA(e,t,`post`)}function pA(e,t){return dA(e,t,`pre`)}function mA(e,t){var n;let r=new Fk,i={},a=new Xk,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s<r&&(i[n]=o,a.decrease(n,s))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(e){a.add(e,1/0),r.setNode(e)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let l=!1;for(;a.size()>0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function hA(e,t,n,r){return gA(e,t,n,r??(t=>e.outEdges(t)??[]))}function gA(e,t,n,r){if(n===void 0)return Qk(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=a[o];if(s===void 0)continue;let c=r(s);for(let e=0;e<c.length;e++){let t=c[e];if(!t)continue;let r=t.v===s?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return qk(e,t,n,r)}return Qk(e,t,n,r)}var _A=Fk;function vA(e,t,n,r){let i=r;for(;e.hasNode(i);)i=PA(r);return n.dummy=t,e.setNode(i,n),i}function yA(e){let t=new _A().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function bA(e){let t=new _A({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function xA(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function SA(e){let t=FA(kA(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function CA(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=OA(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function wA(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=OA(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function TA(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),vA(e,`border`,i,t)}function EA(e,t=DA){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var DA=65535;function OA(e,t){return t.length>DA?e(...EA(t).map(t=>e(...t))):e(...t)}function kA(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return OA(Math.max,t)}function AA(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function jA(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function MA(e,t){return t()}var NA=0;function PA(e){return e+(``+ ++NA)}function FA(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function IA(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function LA(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function RA(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var zA=`\0`;function BA(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var VA=`3.1.1`,HA=class{constructor(){jk(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return UA(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&UA(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,WA)),n=n._prev;return`[`+e.join(`, `)+`]`}};function UA(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function WA(e,t){if(e!==`_next`&&e!==`_prev`)return t}var GA=HA,KA=()=>1;function qA(e,t){if(e.nodeCount()<=1)return[];let n=XA(e,t||KA);return JA(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function JA(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)YA(e,t,n,o);for(;o=i.dequeue();)YA(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(YA(e,t,n,o,!0)||[]);break}}}return r}function YA(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,ZA(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,ZA(t,n,o)}),e.removeNode(r.v),o}function XA(e,t){let n=new _A,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=QA(i+r+3).map(()=>new GA),o=r+1;return n.nodes().forEach(e=>{ZA(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function ZA(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function QA(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function $A(e,t){(e.graph().acyclicer===`greedy`?qA(e,n(e)):ej(e,t??null)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,PA(`rev`))});function n(e){return t=>e.edge(t).weight}}function ej(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&nj(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function tj(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function nj(e,t,n){let r=new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function rj(e){e.graph().dummyChains=[],e.edges().forEach(t=>ij(e,t))}function ij(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=vA(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function aj(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function oj(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=OA(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function sj(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var cj=lj;function lj(e){let t=new _A({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;uj(t,e)<i&&(a=dj(t,e),a);)o=t.hasNode(a.v)?sj(e,a):-sj(e,a),fj(t,e,o);return t}function uj(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!sj(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function dj(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=sj(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function fj(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:pj,postorder:mj}=Gk,hj=gj;gj.initLowLimValues=bj,gj.initCutValues=_j,gj.calcCutValue=yj,gj.leaveEdge=Sj,gj.enterEdge=Cj,gj.exchangeEdges=wj;function gj(e){e=yA(e),oj(e);let t=cj(e);bj(t),_j(t,e);let n,r;for(;n=Sj(t);)r=Cj(t,e,n),wj(t,e,n,r)}function _j(e,t){let n=mj(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>vj(e,t,n))}function vj(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=yj(e,t,n)}function yj(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,Ej(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function bj(e,t){arguments.length<2&&(t=e.nodes()[0]),xj(e,{},1,t)}function xj(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=xj(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Sj(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function Cj(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===Dj(e,e.node(t.v),s)&&c!==Dj(e,e.node(t.w),s)).reduce((e,n)=>sj(t,n)<sj(t,e)?n:e)}function wj(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),bj(e),_j(e,t),Tj(e,t)}function Tj(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=pj(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Ej(e,t,n){return e.hasEdge(t,n)}function Dj(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Oj=kj;function kj(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:Mj(e);break;case`tight-tree`:jj(e);break;case`longest-path`:Aj(e);break;case`none`:break;default:Mj(e)}}var Aj=oj;function jj(e){oj(e),cj(e)}function Mj(e){hj(e)}var Nj=Pj;function Pj(e){let t=Ij(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=Fj(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function Fj(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function Ij(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(zA).forEach(r),t}function Lj(e){let t=vA(e,`root`,{},`_root`),n=zj(e),r=Object.values(n),i=OA(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=Bj(e)+1;e.children(zA).forEach(r=>{Rj(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function Rj(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=TA(e,`_bt`),l=TA(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{Rj(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function zj(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(zA).forEach(e=>n(e,1)),t}function Bj(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Vj(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var Hj=Uj;function Uj(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)Wj(e,`borderLeft`,`_bl`,n,i,t),Wj(e,`borderRight`,`_br`,n,i,t)}}e.children(zA).forEach(t)}function Wj(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=vA(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Gj(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&qj(e)}function Kj(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&Yj(e),(t===`lr`||t===`rl`)&&(Zj(e),qj(e))}function qj(e){e.nodes().forEach(t=>Jj(e.node(t))),e.edges().forEach(t=>Jj(e.edge(t)))}function Jj(e){let t=e.width;e.width=e.height,e.height=t}function Yj(e){e.nodes().forEach(t=>Xj(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Xj),Object.hasOwn(r,`y`)&&Xj(r)})}function Xj(e){e.y=-e.y}function Zj(e){e.nodes().forEach(t=>Qj(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Qj),Object.hasOwn(r,`x`)&&Qj(r)})}function Qj(e){let t=e.x;e.x=e.y,e.y=t}function $j(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=FA(OA(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return BA(t,e.node(n),e.node(r))}return a}function eM(e,t){let n=0;for(let r=1;r<t.length;++r)n+=tM(e,t[r-1],t[r]);return n}function tM(e,t,n){let r=RA(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function nM(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function rM(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),iM(Object.values(n).filter(e=>!e.indegree))}function iM(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&aM(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>IA(e,[`vs`,`i`,`barycenter`,`weight`]))}function aM(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function oM(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=AA(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(cM(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=sM(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=sM(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function sM(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function cM(e,t,n){return(r,i)=>{if(r.barycenter<i.barycenter)return-1;if(r.barycenter>i.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=BA(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function lM(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=nM(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=lM(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&dM(t,r)}});let h=rM(m,n);uM(h,p);let g={},_=!1;for(let t=0;t<h.length;t++)for(let n=t+1;n<h.length;n++)if(h[t]&&h[n]&&(a=h[t])!=null&&a.barycenter&&(o=h[n])!=null&&o.barycenter&&h[t]?.barycenter===h[n].barycenter){let r=h[t]?.vs[0]??``,i=h[n]?.vs[0]??``,a=e.node(r),o=e.node(i);if(a.dummy===`edge`&&o.dummy===`edge`&&a.edgeObj?.v===o.edgeObj?.v&&a.edgeObj?.w===o.edgeObj?.w){if(a.edgeLabel.reversed){g[i]=h[t],h.splice(t,1),t--;break}g[r]=h[n],h.splice(n,1),n--}else _=!0}let v=oM(h,g,s,e,c);if(d&&f){v.vs=[d,v.vs,f].flat(1);let t=e.predecessors(d);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(f),i=e.node(r[0]);Object.hasOwn(v,`barycenter`)||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+n.order+i.order)/(v.weight+2),v.weight+=2}}return Object.defineProperty(v,"result",{value:v,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(v,"usedBias",{value:_,enumerable:!1,configurable:!0,writable:!0}),v}function uM(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function dM(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function fM(e,t,n,r){r||=e.nodes();let i=pM(e),a=new _A({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function pM(e){let t;for(;e.hasNode(t=PA(`_root`)););return t}function mM(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function hM(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,hM);return}let r=kA(e),i=gM(e,FA(1,r+1),`inEdges`),a=gM(e,FA(r-1,-1,-1),`outEdges`),o=$j(e,n);if(vM(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){_M(t%2?i:a,t%4>=2,l,n),o=SA(e);let u=eM(e,o);u<s?(r=0,c=Object.assign({},o),s=u):u===s&&(c=structuredClone(o))}vM(e,c)}function gM(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return fM(e,t,n,r.get(t)||[])})}function _M(e,t,n,r){let i=!0,a=new _A;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=lM(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),mM(e,a,s.vs)})}function vM(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function yM(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=xM(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&SM(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function bM(e,t){let n={};function r(t,r,i,a,o){FA(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&SM(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function xM(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function SM(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function CM(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function wM(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||NM(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>NM(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c<d&&s[i]!==l&&!CM(n,t,i)){let e=a[i];e!==void 0&&(o[i]=t,o[t]=a[t]=e,c=d,u&&=(c=-1,l=s[i]??-1,!1))}}}})}),{root:a,align:o}}function TM(e,t,n,r,i=!1){let a={},o=EM(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function EM(e,t,n,r){let i=new _A,a=e.graph(),o=jM(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function DM(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=MM(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function OM(e,t){let n=Object.values(t),r=OA(Math.min,n),i=OA(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-OA(Math.min,c);a!==`l`&&(l=i-OA(Math.max,c)),l&&(e[o]=LA(s,e=>e+l))})})}function kM(e,t=void 0){let n=e.ul;return n?LA(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function AM(e,t){let n=SA(e),r=Object.assign(yM(e,n),bM(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=wM(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=TM(e,a,s.root,s.align,n===`r`);n===`r`&&(c=LA(c,e=>-e)),i[o+n]=c})}),OM(i,DM(e,i)),kM(i,e.graph().align)}function jM(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function MM(e,t){return e.node(t).width}function NM(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function PM(e,t){e=bA(e),FM(e),Object.entries(AM(e,t)).forEach(([t,n])=>e.node(t).x=n)}function FM(e){let t=SA(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var IM=new WeakMap;function LM(e,t={}){return zM(e,MA,t),e}function RM(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function zM(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new _A({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=new Set;e.edges().forEach(t=>{let n=RM(e,t.v,r),i=RM(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),zM(o,t,n);let l=XM(o);BM(l,t,n,null),VM(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=XM(e),g=BM(h,t,n,IM.get(e)??null);IM.set(e,g),VM(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function BM(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>ZM(e)),t(` removeSelfEdges`,()=>oN(e)),t(` acyclic`,()=>$A(e,s)),t(` nestingGraph.run`,()=>Lj(e)),t(` rank`,()=>Oj(bA(e))),t(` injectEdgeLabelProxies`,()=>QM(e)),t(` removeEmptyRanks`,()=>wA(e)),t(` nestingGraph.cleanup`,()=>Vj(e)),t(` normalizeRanks`,()=>CA(e)),t(` assignRankMinMax`,()=>$M(e)),t(` removeEdgeLabelProxies`,()=>eN(e)),t(` normalize.run`,()=>rj(e)),t(` parentDummyChains`,()=>Nj(e)),t(` addBorderSegments`,()=>Hj(e)),t(` order`,()=>hM(e,n,c)),t(` insertSelfEdges`,()=>sN(e)),t(` adjustCoordinateSystem`,()=>Gj(e)),t(` position`,()=>PM(e,n.corePath)),t(` positionSelfEdges`,()=>cN(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>aN(e)),t(` normalize.undo`,()=>aj(e)),t(` fixupEdgeLabelCoords`,()=>rN(e)),t(` undoCoordinateSystem`,()=>Kj(e)),t(` translateGraph`,()=>tN(e)),t(` assignNodeIntersects`,()=>nN(e)),t(` reversePoints`,()=>iN(e)),t(` acyclic.undo`,()=>tj(e)),{graph:e,rawNodes:l}}function VM(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var HM=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],UM={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},WM=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],GM=[`width`,`height`,`rank`],KM={width:0,height:0},qM=[`minlen`,`weight`,`width`,`height`,`labeloffset`],JM={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},YM=[`labelpos`];function XM(e){let t=new _A({multigraph:!0,compound:!0}),n=uN(e.graph());return t.setGraph(Object.assign({},UM,lN(n,HM),IA(n,WM))),e.nodes().forEach(n=>{let r=lN(uN(e.node(n)),GM);Object.keys(KM).forEach(e=>{r[e]===void 0&&(r[e]=KM[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=uN(e.edge(n));t.setEdge(n,Object.assign({},JM,lN(r,qM),IA(r,YM)))}),t}function ZM(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function QM(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);vA(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function $M(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function eN(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function tN(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function nN(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(xA(r,a)),n.points.push(xA(i,o))})}function rN(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function iN(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function aN(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function oN(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function sN(e){SA(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{vA(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function cN(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function lN(e,t){return LA(IA(e,t),Number)}function uN(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function dN(e){let t=SA(e),n=new _A({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var fN={graphlib:Mk,version:VA,layout:LM,debug:dN,util:{time:jA,notime:MA}};function pN(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=pN(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var mN={value:()=>{}};function hN(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new gN(n)}function gN(e){this._=e}function _N(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}gN.prototype=hN.prototype={constructor:gN,on:function(e,t){var n=this._,r=_N(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=vN(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=yN(n[i],e.name,t);else if(t==null)for(i in n)n[i]=yN(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new gN(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function vN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function yN(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=mN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var bN={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function xN(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),bN.hasOwnProperty(t)?{space:bN[t],local:e}:e}function SN(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function CN(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function wN(e){var t=xN(e);return(t.local?CN:SN)(t)}function TN(){}function EN(e){return e==null?TN:function(){return this.querySelector(e)}}function DN(e){typeof e!=`function`&&(e=EN(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new hF(r,this._parents)}function ON(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function kN(){return[]}function AN(e){return e==null?kN:function(){return this.querySelectorAll(e)}}function jN(e){return function(){return ON(e.apply(this,arguments))}}function MN(e){e=typeof e==`function`?jN(e):AN(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new hF(r,i)}function NN(e){return function(){return this.matches(e)}}function PN(e){return function(t){return t.matches(e)}}var FN=Array.prototype.find;function IN(e){return function(){return FN.call(this.children,e)}}function LN(){return this.firstElementChild}function RN(e){return this.select(e==null?LN:IN(typeof e==`function`?e:PN(e)))}var zN=Array.prototype.filter;function BN(){return Array.from(this.children)}function VN(e){return function(){return zN.call(this.children,e)}}function HN(e){return this.selectAll(e==null?BN:VN(typeof e==`function`?e:PN(e)))}function UN(e){typeof e!=`function`&&(e=NN(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new hF(r,this._parents)}function WN(e){return Array(e.length)}function GN(){return new hF(this._enter||this._groups.map(WN),this._parents)}function KN(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}KN.prototype={constructor:KN,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function qN(e){return function(){return e}}function JN(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new KN(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function YN(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new KN(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function XN(e){return e.__data__}function ZN(e,t){if(!arguments.length)return Array.from(this,XN);var n=t?YN:JN,r=this._parents,i=this._groups;typeof e!=`function`&&(e=qN(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=QN(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new hF(o,r),o._enter=s,o._exit=c,o}function QN(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function $N(){return new hF(this._exit||this._groups.map(WN),this._parents)}function eP(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function tP(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new hF(s,this._parents)}function nP(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function rP(e){e||=iP;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new hF(i,this._parents).order()}function iP(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function aP(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function oP(){return Array.from(this)}function sP(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function cP(){let e=0;for(let t of this)++e;return e}function lP(){return!this.node()}function uP(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function dP(e){return function(){this.removeAttribute(e)}}function fP(e){return function(){this.removeAttributeNS(e.space,e.local)}}function pP(e,t){return function(){this.setAttribute(e,t)}}function mP(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function hP(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function gP(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function _P(e,t){var n=xN(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?fP:dP:typeof t==`function`?n.local?gP:hP:n.local?mP:pP)(n,t))}function vP(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function yP(e){return function(){this.style.removeProperty(e)}}function bP(e,t,n){return function(){this.style.setProperty(e,t,n)}}function xP(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function SP(e,t,n){return arguments.length>1?this.each((t==null?yP:typeof t==`function`?xP:bP)(e,t,n??``)):CP(this.node(),e)}function CP(e,t){return e.style.getPropertyValue(t)||vP(e).getComputedStyle(e,null).getPropertyValue(t)}function wP(e){return function(){delete this[e]}}function TP(e,t){return function(){this[e]=t}}function EP(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function DP(e,t){return arguments.length>1?this.each((t==null?wP:typeof t==`function`?EP:TP)(e,t)):this.node()[e]}function OP(e){return e.trim().split(/^|\s+/)}function kP(e){return e.classList||new AP(e)}function AP(e){this._node=e,this._names=OP(e.getAttribute(`class`)||``)}AP.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function jP(e,t){for(var n=kP(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function MP(e,t){for(var n=kP(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function NP(e){return function(){jP(this,e)}}function PP(e){return function(){MP(this,e)}}function FP(e,t){return function(){(t.apply(this,arguments)?jP:MP)(this,e)}}function IP(e,t){var n=OP(e+``);if(arguments.length<2){for(var r=kP(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?FP:t?NP:PP)(n,t))}function LP(){this.textContent=``}function RP(e){return function(){this.textContent=e}}function zP(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function BP(e){return arguments.length?this.each(e==null?LP:(typeof e==`function`?zP:RP)(e)):this.node().textContent}function VP(){this.innerHTML=``}function HP(e){return function(){this.innerHTML=e}}function UP(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function WP(e){return arguments.length?this.each(e==null?VP:(typeof e==`function`?UP:HP)(e)):this.node().innerHTML}function GP(){this.nextSibling&&this.parentNode.appendChild(this)}function KP(){return this.each(GP)}function qP(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function JP(){return this.each(qP)}function YP(e){var t=typeof e==`function`?e:wN(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function XP(){return null}function ZP(e,t){var n=typeof e==`function`?e:wN(e),r=t==null?XP:typeof t==`function`?t:EN(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function QP(){var e=this.parentNode;e&&e.removeChild(this)}function $P(){return this.each(QP)}function eF(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tF(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nF(e){return this.select(e?tF:eF)}function rF(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function iF(e){return function(t){e.call(this,t,this.__data__)}}function aF(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function oF(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function sF(e,t,n){return function(){var r=this.__on,i,a=iF(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function cF(e,t,n){var r=aF(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?sF:oF,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function lF(e,t,n){var r=vP(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function uF(e,t){return function(){return lF(this,e,t)}}function dF(e,t){return function(){return lF(this,e,t.apply(this,arguments))}}function fF(e,t){return this.each((typeof t==`function`?dF:uF)(e,t))}function*pF(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var mF=[null];function hF(e,t){this._groups=e,this._parents=t}function gF(){return new hF([[document.documentElement]],mF)}function _F(){return this}hF.prototype=gF.prototype={constructor:hF,select:DN,selectAll:MN,selectChild:RN,selectChildren:HN,filter:UN,data:ZN,enter:GN,exit:$N,join:eP,merge:tP,selection:_F,order:nP,sort:rP,call:aP,nodes:oP,node:sP,size:cP,empty:lP,each:uP,attr:_P,style:SP,property:DP,classed:IP,text:BP,html:WP,raise:KP,lower:JP,append:YP,insert:ZP,remove:$P,clone:nF,datum:rF,on:cF,dispatch:fF,[Symbol.iterator]:pF};function vF(e){return typeof e==`string`?new hF([[document.querySelector(e)]],[document.documentElement]):new hF([[e]],mF)}function yF(e){let t;for(;t=e.sourceEvent;)e=t;return e}function bF(e,t){if(e=yF(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var xF={passive:!1},SF={capture:!0,passive:!1};function CF(e){e.stopImmediatePropagation()}function wF(e){e.preventDefault(),e.stopImmediatePropagation()}function TF(e){var t=e.document.documentElement,n=vF(e).on(`dragstart.drag`,wF,SF);`onselectstart`in t?n.on(`selectstart.drag`,wF,SF):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function EF(e,t){var n=e.document.documentElement,r=vF(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,wF,SF),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var DF=e=>()=>e;function OF(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}OF.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function kF(e){return!e.ctrlKey&&!e.button}function AF(){return this.parentNode}function jF(e,t){return t??{x:e.x,y:e.y}}function MF(){return navigator.maxTouchPoints||`ontouchstart`in this}function NF(){var e=kF,t=AF,n=jF,r=MF,i={},a=hN(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,xF).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(vF(n.view).on(`mousemove.drag`,m,SF).on(`mouseup.drag`,h,SF),TF(n.view),CF(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(wF(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){vF(e.view).on(`mousemove.drag mouseup.drag`,null),EF(e.view,l),wF(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(CF(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(wF(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(CF(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=bF(l||r,t),p,m,h;if((h=n.call(e,new OF(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=bF(l||a,t),_=o}u.call(r,e,new OF(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:DF(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:DF(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:DF(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:DF(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function PF(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function FF(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function IF(){}var LF=.7,RF=1/LF,zF=`\\s*([+-]?\\d+)\\s*`,BF=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,VF=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,HF=/^#([0-9a-f]{3,8})$/,UF=RegExp(`^rgb\\(${zF},${zF},${zF}\\)$`),WF=RegExp(`^rgb\\(${VF},${VF},${VF}\\)$`),GF=RegExp(`^rgba\\(${zF},${zF},${zF},${BF}\\)$`),KF=RegExp(`^rgba\\(${VF},${VF},${VF},${BF}\\)$`),qF=RegExp(`^hsl\\(${BF},${VF},${VF}\\)$`),JF=RegExp(`^hsla\\(${BF},${VF},${VF},${BF}\\)$`),YF={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};PF(IF,eI,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:XF,formatHex:XF,formatHex8:ZF,formatHsl:QF,formatRgb:$F,toString:$F});function XF(){return this.rgb().formatHex()}function ZF(){return this.rgb().formatHex8()}function QF(){return pI(this).formatHsl()}function $F(){return this.rgb().formatRgb()}function eI(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=HF.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?tI(t):n===3?new aI(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?nI(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?nI(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=UF.exec(e))?new aI(t[1],t[2],t[3],1):(t=WF.exec(e))?new aI(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=GF.exec(e))?nI(t[1],t[2],t[3],t[4]):(t=KF.exec(e))?nI(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qF.exec(e))?fI(t[1],t[2]/100,t[3]/100,1):(t=JF.exec(e))?fI(t[1],t[2]/100,t[3]/100,t[4]):YF.hasOwnProperty(e)?tI(YF[e]):e===`transparent`?new aI(NaN,NaN,NaN,0):null}function tI(e){return new aI(e>>16&255,e>>8&255,e&255,1)}function nI(e,t,n,r){return r<=0&&(e=t=n=NaN),new aI(e,t,n,r)}function rI(e){return e instanceof IF||(e=eI(e)),e?(e=e.rgb(),new aI(e.r,e.g,e.b,e.opacity)):new aI}function iI(e,t,n,r){return arguments.length===1?rI(e):new aI(e,t,n,r??1)}function aI(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}PF(aI,iI,FF(IF,{brighter(e){return e=e==null?RF:RF**+e,new aI(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?LF:LF**+e,new aI(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new aI(uI(this.r),uI(this.g),uI(this.b),lI(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oI,formatHex:oI,formatHex8:sI,formatRgb:cI,toString:cI}));function oI(){return`#${dI(this.r)}${dI(this.g)}${dI(this.b)}`}function sI(){return`#${dI(this.r)}${dI(this.g)}${dI(this.b)}${dI((isNaN(this.opacity)?1:this.opacity)*255)}`}function cI(){let e=lI(this.opacity);return`${e===1?`rgb(`:`rgba(`}${uI(this.r)}, ${uI(this.g)}, ${uI(this.b)}${e===1?`)`:`, ${e})`}`}function lI(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function uI(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dI(e){return e=uI(e),(e<16?`0`:``)+e.toString(16)}function fI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new hI(e,t,n,r)}function pI(e){if(e instanceof hI)return new hI(e.h,e.s,e.l,e.opacity);if(e instanceof IF||(e=eI(e)),!e)return new hI;if(e instanceof hI)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new hI(o,s,c,e.opacity)}function mI(e,t,n,r){return arguments.length===1?pI(e):new hI(e,t,n,r??1)}function hI(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}PF(hI,mI,FF(IF,{brighter(e){return e=e==null?RF:RF**+e,new hI(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?LF:LF**+e,new hI(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new aI(vI(e>=240?e-240:e+120,i,r),vI(e,i,r),vI(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new hI(gI(this.h),_I(this.s),_I(this.l),lI(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=lI(this.opacity);return`${e===1?`hsl(`:`hsla(`}${gI(this.h)}, ${_I(this.s)*100}%, ${_I(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function gI(e){return e=(e||0)%360,e<0?e+360:e}function _I(e){return Math.max(0,Math.min(1,e||0))}function vI(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var yI=e=>()=>e;function bI(e,t){return function(n){return e+n*t}}function xI(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function SI(e){return(e=+e)==1?CI:function(t,n){return n-t?xI(t,n,e):yI(isNaN(t)?n:t)}}function CI(e,t){var n=t-e;return n?bI(e,n):yI(isNaN(e)?t:e)}var wI=(function e(t){var n=SI(t);function r(e,t){var r=n((e=iI(e)).r,(t=iI(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=CI(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function TI(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function EI(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function DI(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=II(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function OI(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function kI(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function AI(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=II(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var jI=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,MI=new RegExp(jI.source,`g`);function NI(e){return function(){return e}}function PI(e){return function(t){return e(t)+``}}function FI(e,t){var n=jI.lastIndex=MI.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=jI.exec(e))&&(i=MI.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:kI(r,i)})),n=MI.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?PI(c[0].x):NI(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function II(e,t){var n=typeof t,r;return t==null||n===`boolean`?yI(t):(n===`number`?kI:n===`string`?(r=eI(t))?(t=r,wI):FI:t instanceof eI?wI:t instanceof Date?OI:EI(t)?TI:Array.isArray(t)?DI:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?AI:kI)(e,t)}var LI=180/Math.PI,RI={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function zI(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*LI,skewX:Math.atan(c)*LI,scaleX:o,scaleY:s}}var BI;function VI(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?RI:zI(t.a,t.b,t.c,t.d,t.e,t.f)}function HI(e){return e==null||(BI||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),BI.setAttribute(`transform`,e),!(e=BI.transform.baseVal.consolidate()))?RI:(e=e.matrix,zI(e.a,e.b,e.c,e.d,e.e,e.f))}function UI(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:kI(e,i)},{i:c-2,x:kI(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:kI(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:kI(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:kI(e,n)},{i:s-2,x:kI(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var WI=UI(VI,`px, `,`px)`,`deg)`),GI=UI(HI,`, `,`)`,`)`),KI=1e-12;function qI(e){return((e=Math.exp(e))+1/e)/2}function JI(e){return((e=Math.exp(e))-1/e)/2}function YI(e){return((e=Math.exp(2*e))-1)/(e+1)}var XI=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<KI)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=qI(y),c=s/(n*g)*(i*YI(t*r+y)-JI(y));return[a+c*d,o+c*f,s*i/qI(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),ZI=0,QI=0,$I=0,eL=1e3,tL,nL,rL=0,iL=0,aL=0,oL=typeof performance==`object`&&performance.now?performance:Date,sL=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function cL(){return iL||=(sL(lL),oL.now()+aL)}function lL(){iL=0}function uL(){this._call=this._time=this._next=null}uL.prototype=dL.prototype={constructor:uL,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?cL():+n)+(t==null?0:+t),!this._next&&nL!==this&&(nL?nL._next=this:tL=this,nL=this),this._call=e,this._time=n,gL()},stop:function(){this._call&&(this._call=null,this._time=1/0,gL())}};function dL(e,t,n){var r=new uL;return r.restart(e,t,n),r}function fL(){cL(),++ZI;for(var e=tL,t;e;)(t=iL-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ZI}function pL(){iL=(rL=oL.now())+aL,ZI=QI=0;try{fL()}finally{ZI=0,hL(),iL=0}}function mL(){var e=oL.now(),t=e-rL;t>eL&&(aL-=t,rL=e)}function hL(){for(var e,t=tL,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:tL=n);nL=e,gL(r)}function gL(e){ZI||(QI&&=clearTimeout(QI),e-iL>24?(e<1/0&&(QI=setTimeout(pL,e-oL.now()-aL)),$I&&=clearInterval($I)):($I||=(rL=oL.now(),setInterval(mL,eL)),ZI=1,sL(pL)))}function _L(e,t,n){var r=new uL;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var vL=hN(`start`,`end`,`cancel`,`interrupt`),yL=[];function bL(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;wL(e,n,{name:t,index:r,group:i,on:vL,tween:yL,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function xL(e,t){var n=CL(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function SL(e,t){var n=CL(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function CL(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function wL(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=dL(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return _L(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(_L(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function TL(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function EL(e){return this.each(function(){TL(this,e)})}function DL(e,t){var n,r;return function(){var i=SL(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function OL(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=SL(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function kL(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=CL(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?DL:OL)(n,e,t))}function AL(e,t,n){var r=e._id;return e.each(function(){var e=SL(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return CL(e,r).value[t]}}function jL(e,t){var n;return(typeof t==`number`?kI:t instanceof eI?wI:(n=eI(t))?(t=n,wI):FI)(e,t)}function ML(e){return function(){this.removeAttribute(e)}}function NL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function PL(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function FL(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function IL(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function LL(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function RL(e,t){var n=xN(e),r=n===`transform`?GI:jL;return this.attrTween(e,typeof t==`function`?(n.local?LL:IL)(n,r,AL(this,`attr.`+e,t)):t==null?(n.local?NL:ML)(n):(n.local?FL:PL)(n,r,t))}function zL(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function BL(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function VL(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&BL(e,i)),n}return i._value=t,i}function HL(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&zL(e,i)),n}return i._value=t,i}function UL(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=xN(e);return this.tween(n,(r.local?VL:HL)(r,t))}function WL(e,t){return function(){xL(this,e).delay=+t.apply(this,arguments)}}function GL(e,t){return t=+t,function(){xL(this,e).delay=t}}function KL(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?WL:GL)(t,e)):CL(this.node(),t).delay}function qL(e,t){return function(){SL(this,e).duration=+t.apply(this,arguments)}}function JL(e,t){return t=+t,function(){SL(this,e).duration=t}}function YL(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?qL:JL)(t,e)):CL(this.node(),t).duration}function XL(e,t){if(typeof t!=`function`)throw Error();return function(){SL(this,e).ease=t}}function ZL(e){var t=this._id;return arguments.length?this.each(XL(t,e)):CL(this.node(),t).ease}function QL(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();SL(this,e).ease=n}}function $L(e){if(typeof e!=`function`)throw Error();return this.each(QL(this._id,e))}function eR(e){typeof e!=`function`&&(e=NN(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new kR(r,this._parents,this._name,this._id)}function tR(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new kR(o,this._parents,this._name,this._id)}function nR(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function rR(e,t,n){var r,i,a=nR(t)?xL:SL;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function iR(e,t){var n=this._id;return arguments.length<2?CL(this.node(),n).on.on(e):this.each(rR(n,e,t))}function aR(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function oR(){return this.on(`end.remove`,aR(this._id))}function sR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=EN(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,bL(l[f],t,n,f,l,CL(u,n)));return new kR(a,this._parents,t,n)}function cR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=AN(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=CL(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&bL(p,t,n,h,f,m);a.push(f),o.push(u)}return new kR(a,o,t,n)}var lR=gF.prototype.constructor;function uR(){return new lR(this._groups,this._parents)}function dR(e,t){var n,r,i;return function(){var a=CP(this,e),o=(this.style.removeProperty(e),CP(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function fR(e){return function(){this.style.removeProperty(e)}}function pR(e,t,n){var r,i=n+``,a;return function(){var o=CP(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function mR(e,t,n){var r,i,a;return function(){var o=CP(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),CP(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function hR(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=SL(this,e),l=c.on,u=c.value[a]==null?s||=fR(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function gR(e,t,n){var r=(e+=``)==`transform`?WI:jL;return t==null?this.styleTween(e,dR(e,r)).on(`end.style.`+e,fR(e)):typeof t==`function`?this.styleTween(e,mR(e,r,AL(this,`style.`+e,t))).each(hR(this._id,e)):this.styleTween(e,pR(e,r,t),n).on(`end.style.`+e,null)}function _R(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function vR(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&_R(e,a,n)),r}return a._value=t,a}function yR(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,vR(e,t,n??``))}function bR(e){return function(){this.textContent=e}}function xR(e){return function(){var t=e(this);this.textContent=t??``}}function SR(e){return this.tween(`text`,typeof e==`function`?xR(AL(this,`text`,e)):bR(e==null?``:e+``))}function CR(e){return function(t){this.textContent=e.call(this,t)}}function wR(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&CR(r)),t}return r._value=e,r}function TR(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,wR(e))}function ER(){for(var e=this._name,t=this._id,n=AR(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=CL(c,t);bL(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new kR(r,this._parents,e,n)}function DR(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=SL(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var OR=0;function kR(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function AR(){return++OR}var jR=gF.prototype;kR.prototype={constructor:kR,select:sR,selectAll:cR,selectChild:jR.selectChild,selectChildren:jR.selectChildren,filter:eR,merge:tR,selection:uR,transition:ER,call:jR.call,nodes:jR.nodes,node:jR.node,size:jR.size,empty:jR.empty,each:jR.each,on:iR,attr:RL,attrTween:UL,style:gR,styleTween:yR,text:SR,textTween:TR,remove:oR,tween:kL,delay:KL,duration:YL,ease:ZL,easeVarying:$L,end:DR,[Symbol.iterator]:jR[Symbol.iterator]};function MR(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var NR={time:null,delay:0,duration:250,ease:MR};function PR(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function FR(e){var t,n;e instanceof kR?(t=e._id,e=e._name):(t=AR(),(n=NR).time=cL(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&bL(c,e,t,l,o,n||PR(c,t));return new kR(r,this._parents,e,t)}gF.prototype.interrupt=EL,gF.prototype.transition=FR;var IR=e=>()=>e;function LR(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function RR(e,t,n){this.k=e,this.x=t,this.y=n}RR.prototype={constructor:RR,scale:function(e){return e===1?this:new RR(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new RR(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var zR=new RR(1,0,0);BR.prototype=RR.prototype;function BR(e){for(;!e.__zoom;)if(!(e=e.parentNode))return zR;return e.__zoom}function VR(e){e.stopImmediatePropagation()}function HR(e){e.preventDefault(),e.stopImmediatePropagation()}function UR(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function WR(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function GR(){return this.__zoom||zR}function KR(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function qR(){return navigator.maxTouchPoints||`ontouchstart`in this}function JR(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function YR(){var e=UR,t=WR,n=JR,r=KR,i=qR,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=XI,l=hN(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,GR).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,ee).on(`touchend.zoom touchcancel.zoom`,O).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,GR),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(zR.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new RR(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new RR(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new RR(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=vF(this.that).datum();l.call(e,this.that,new LR(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=bF(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],TL(this),s.start();HR(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=vF(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=bF(t,i),l=t.clientX,u=t.clientY;TF(t.view),VR(t),a.mouse=[c,this.__zoom.invert(c)],TL(this),a.start();function d(e){if(HR(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=bF(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),EF(e.view,a.moved),HR(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=bF(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);HR(r),s>0?vF(this).transition().duration(s).call(x,d,c,r):vF(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(VR(t),s=0;s<i;++s)c=r[s],l=bF(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),TL(this),a.start())}}function ee(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(HR(e),s=0;s<a;++s)c=i[s],l=bF(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function O(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(VR(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=bF(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=vF(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:IR(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:IR(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:IR(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:IR([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var XR={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},ZR=[[-1/0,-1/0],[1/0,1/0]],QR=[`Enter`,` `,`Escape`],$R={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},ez;(function(e){e.Strict=`strict`,e.Loose=`loose`})(ez||={});var tz;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(tz||={});var nz;(function(e){e.Partial=`partial`,e.Full=`full`})(nz||={});var rz={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},iz;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(iz||={});var az;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(az||={});var oz;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(oz||={});var sz={[oz.Left]:oz.Right,[oz.Right]:oz.Left,[oz.Top]:oz.Bottom,[oz.Bottom]:oz.Top},cz=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,lz=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),uz=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),dz=(e,t=[0,0])=>{let{width:n,height:r}=Gz(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},fz=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):uz(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,Tz(e,kz(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?Dz(r):{x:0,y:0,width:0,height:0}},pz=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=Tz(n,kz(e)),r=!0)}),r?Dz(n):{x:0,y:0,width:0,height:0}},mz=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=jz(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},hz=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function gz(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=Gz(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function _z({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=Hz(pz(gz(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function vz({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,XR.error005());else{let{width:e,height:t}=Gz(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&Wz(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=Wz(d)?xz(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,XR.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function yz({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=hz(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var bz=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),xz=(e={x:0,y:0},t,n)=>({x:bz(e.x,t[0][0],t[1][0]-(n?.width??0)),y:bz(e.y,t[0][1],t[1][1]-(n?.height??0))});function Sz(e,t,n){let{width:r,height:i}=Gz(n),{x:a,y:o}=n.internals.positionAbsolute;return xz(e,[[a,o],[a+r,o+i]],t)}var Cz=(e,t,n)=>e<t?bz(Math.abs(e-t),1,t)/t:e>n?-bz(Math.abs(e-n),1,t)/t:0,wz=(e,t,n=15,r=40)=>[Cz(e.x,r,t.width-r)*n,Cz(e.y,r,t.height-r)*n],Tz=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ez=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Dz=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Oz=(e,t=[0,0])=>{let{x:n,y:r}=uz(e)?e.internals.positionAbsolute:dz(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},kz=(e,t=[0,0])=>{let{x:n,y:r}=uz(e)?e.internals.positionAbsolute:dz(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Az=(e,t)=>Dz(Tz(Ez(e),Ez(t))),jz=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},Mz=(e,t)=>jz(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Nz=e=>Pz(e.width)&&Pz(e.height)&&Pz(e.x)&&Pz(e.y),Pz=e=>!isNaN(e)&&isFinite(e),Fz=(e,t)=>(e,t)=>{},Iz=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Lz=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?Iz(s,o):s},Rz=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function zz(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Bz(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=zz(e,n),i=zz(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=zz(e.top??e.y??0,n),i=zz(e.bottom??e.y??0,n),a=zz(e.left??e.x??0,t),o=zz(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Vz(e,t,n,r,i,a){let{x:o,y:s}=Rz(e,[t,n,r]),{x:c,y:l}=Rz({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var Hz=(e,t,n,r,i,a)=>{let o=Bz(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=bz(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=Vz(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},Uz=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function Wz(e){return e!=null&&e!==`parent`}function Gz(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Kz(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function qz(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function Jz(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Yz(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Xz(e){return{...$R,...e||{}}}function Zz(e){return e===null?null:e?`valid`:`invalid`}function Qz(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=iB(e),s=Lz({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?Iz(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var $z=e=>({width:e.offsetWidth,height:e.offsetHeight}),eB=e=>e?.getRootNode?.()||window?.document,tB=[`INPUT`,`SELECT`,`TEXTAREA`];function nB(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?tB.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var rB=e=>`clientX`in e,iB=(e,t)=>{let n=rB(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},aB=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...$z(t)}})};function oB({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function sB(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function cB({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case oz.Left:return[t-sB(t-r,a),n];case oz.Right:return[t+sB(r-t,a),n];case oz.Top:return[t,n-sB(n-i,a)];case oz.Bottom:return[t,n+sB(i-n,a)]}}function lB({sourceX:e,sourceY:t,sourcePosition:n=oz.Bottom,targetX:r,targetY:i,targetPosition:a=oz.Top,curvature:o=.25}){let[s,c]=cB({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=cB({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=oB({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function uB({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function dB({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function fB({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=Tz(kz(e),kz(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Mz({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},Dz(a))>0}var pB=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,mB=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),hB=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,XR.error006()),t;let r=n.getEdgeId||pB,i;return i=cz(e)?{...e}:{...e,id:r(e)},mB(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function gB({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=uB({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var _B={[oz.Left]:{x:-1,y:0},[oz.Right]:{x:1,y:0},[oz.Top]:{x:0,y:-1},[oz.Bottom]:{x:0,y:1}},vB=({source:e,sourcePosition:t=oz.Bottom,target:n})=>t===oz.Left||t===oz.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},yB=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function bB({source:e,sourcePosition:t=oz.Bottom,target:n,targetPosition:r=oz.Top,center:i,offset:a,stepPosition:o}){let s=_B[t],c=_B[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=vB({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=uB({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function xB(e,t,n,r){let i=Math.min(yB(e,t)/2,yB(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function SB({sourceX:e,sourceY:t,sourcePosition:n=oz.Bottom,targetX:r,targetY:i,targetPosition:a=oz.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=bB({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=xB(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function CB(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function wB(e){let{sourceNode:t,targetNode:n}=e;if(!CB(t)||!CB(n))return null;let r=t.internals.handleBounds||TB(t.handles),i=n.internals.handleBounds||TB(n.handles),a=DB(r?.source??[],e.sourceHandle),o=DB(e.connectionMode===ez.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,XR.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||oz.Bottom,c=o?.position||oz.Top,l=EB(t,a,s),u=EB(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function TB(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function EB(e,t,n=oz.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??Gz(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case oz.Top:return{x:i+o/2,y:a};case oz.Right:return{x:i+o,y:a+s/2};case oz.Bottom:return{x:i+o/2,y:a+s};case oz.Left:return{x:i,y:a+s/2}}}function DB(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function OB(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function kB(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=OB(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var AB=1e3,jB=10,MB={nodeOrigin:[0,0],nodeExtent:ZR,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},NB={...MB,checkEquality:!0};function PB(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function FB(e,t,n){let r=PB(MB,n);for(let n of e.values())if(n.parentId)BB(n,e,t,r);else{let e=xz(dz(n,r.nodeOrigin),Wz(n.extent)?n.extent:r.nodeExtent,Gz(n));n.internals.positionAbsolute=e}}function IB(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function LB(e){return e===`manual`}function RB(e,t,n,r={}){let i=PB(NB,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!LB(i.zIndexMode)?AB:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=xz(dz(u,i.nodeOrigin),Wz(u.extent)?u.extent:i.nodeExtent,Gz(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:IB(u,e),z:VB(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&BB(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function zB(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function BB(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=PB(MB,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}zB(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*jB),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=HB(e,u,o,s,a&&!LB(c)?AB:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function VB(e,t,n){let r=Pz(e.zIndex)?e.zIndex:0;return LB(n)?r:r+(e.selected?t:0)}function HB(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=Gz(e),l=dz(e,n),u=Wz(e.extent)?xz(l,e.extent,c):l,d=xz({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=Sz(d,c,t));let f=VB(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function UB(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=Az(a.get(n.parentId)?.expandedRect??Oz(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=Gz(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function WB(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=$z(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=Wz(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=Sz(h,s,n))}else m&&(h=xz(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:aB(`source`,r.nodeElement,p,d,e.id),target:aB(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&BB(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:Oz(g,i)}))}}if(f.length>0){let e=UB(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function GB({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function KB(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function qB(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;KB(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),KB(`target`,s,c,e,i,o),t.set(r.id,r)}}function JB(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:JB(n,t):!1}function YB(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function XB(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!JB(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function ZB({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function QB({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=Iz(a,t);return{x:o.x-a.x,y:o.y-a.y}}function $B({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=vF(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?Ez(pz(s)):null,x=v&&l?QB({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:Iz(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=vz({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=ZB({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=wz(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=Qz(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=XB(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=ZB({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=NF().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=Qz(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=iB(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=Qz(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=iB(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=iB(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=ZB({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!YB(t,`.${g}`,v))&&(!_||YB(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function eV(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())Mz(i,Oz(e))>0&&r.push(e);return r}var tV=250;function nV(e,t,n,r){let i=[],a=1/0,o=eV(e,n,t+tV);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=EB(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function rV(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...EB(o,c,c.position,!0)}:c}function iV(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function aV(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var oV=()=>!0;function sV(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=oV,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=eB(e.target),E=0,D,{x:ee,y:O}=iB(e),k=iV(a,w),A=s?.getBoundingClientRect(),te=!1;if(!A||!k)return;let ne=rV(i,k,r,c,t);if(!ne)return;let re=iB(e,A),ie=!1,ae=null,oe=!1,se=null;function ce(){if(!u||!A)return;let[e,t]=wz(re,A,S);f({x:e,y:t}),E=requestAnimationFrame(ce)}let j={...ne,nodeId:i,type:k,position:ne.position},le=c.get(i),ue={inProgress:!0,isValid:null,from:EB(le,j,oz.Left,!0),fromHandle:j,fromPosition:j.position,fromNode:le,to:re,toHandle:null,toPosition:sz[j.position],toNode:null,pointer:re};function de(){te=!0,y(ue),m?.(e,{nodeId:i,handleId:r,handleType:k})}C===0&&de();function fe(e){if(!te){let{x:t,y:n}=iB(e),r=t-ee,i=n-O;if(!(r*r+i*i>C*C))return;de()}if(!x()||!j){pe(e);return}let a=b();re=iB(e,A),D=nV(Lz(re,a,!1,[1,1]),n,c,j),ie||=(ce(),!0);let s=cV(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});se=s.handleDomNode,ae=s.connection,oe=aV(!!D,s.isValid);let u=c.get(i),f=u?EB(u,j,oz.Left,!0):ue.from,p={...ue,from:f,isValid:oe,to:s.toHandle&&oe?Rz({x:s.toHandle.x,y:s.toHandle.y},a):re,toHandle:s.toHandle,toPosition:oe&&s.toHandle?s.toHandle.position:sz[j.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:re};y(p),ue=p}function pe(e){if(!(`touches`in e&&e.touches.length>0)){if(te){(D||se)&&ae&&oe&&h?.(ae);let{inProgress:t,...n}=ue,r={...n,toPosition:ue.toHandle?ue.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),ie=!1,oe=!1,ae=null,se=null,T.removeEventListener(`mousemove`,fe),T.removeEventListener(`mouseup`,pe),T.removeEventListener(`touchmove`,fe),T.removeEventListener(`touchend`,pe)}}T.addEventListener(`mousemove`,fe),T.addEventListener(`mouseup`,pe),T.addEventListener(`touchmove`,fe),T.addEventListener(`touchend`,pe)}function cV(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=oV,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=iB(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=iV(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===ez.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=rV(t,e,a,u,n,!0)}return _}var lV={onPointerDown:sV,isValid:cV};function uV({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=vF(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&Uz()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=YR().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:bF}}var dV=e=>({x:e.x,y:e.y,zoom:e.k}),fV=({x:e,y:t,zoom:n})=>zR.translate(e,t).scale(n),pV=(e,t)=>e.target.closest(`.${t}`),mV=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),hV=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,gV=(e,t=0,n=hV,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},_V=e=>{let t=e.ctrlKey&&Uz()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function vV({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(pV(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=bF(u),t=d*2**_V(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===tz.Vertical?0:u.deltaX*f,m=i===tz.Horizontal?0:u.deltaY*f;!Uz()&&u.shiftKey&&i!==tz.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=dV(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function yV({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=pV(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function bV({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=dV(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function xV({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&mV(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,dV(a.transform))}}function SV({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&mV(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=dV(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function CV({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(pV(f,`${u}-flow__node`)||pV(f,`${u}-flow__edge`)||pV(f,`${u}-flow__selection`)||pV(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||pV(f,c)&&h||pV(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function wV({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=YR().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=vF(e).call(f);y({x:i.x,y:i.y,zoom:bz(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(_V);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?II:XI).transform(gV(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,panActivationKeyPressed:S=!1,zoomActivationKeyPressed:C,lib:w,onTransformChange:T,connectionInProgress:E,paneClickDistance:D,selectionOnDrag:ee}){r&&!l.isZoomingOrPanning&&v();let O=i&&!C&&!r;f.clickDistance(ee?1/0:!Pz(D)||D<0?0:D);let k=O?vV({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):yV({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,k,{passive:!1});let A=bV({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,A);let te=xV({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:T});f.on(`zoom`,te);let ne=SV({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,ne);let re=CV({panActivationKeyPressed:S,zoomActivationKeyPressed:C,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:w,connectionInProgress:E});f.filter(re),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=fV(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=fV(e);return await g(n,t),n}function x(e){if(p){let t=fV(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?BR(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?II:XI).scaleTo(gV(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?II:XI).scaleBy(gV(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!Pz(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var TV;(function(e){e.Line=`line`,e.Handle=`handle`})(TV||={});function EV({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function DV(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function OV(e,t){return Math.max(0,t-e)}function kV(e,t){return Math.max(0,e-t)}function AV(e,t,n){return Math.max(0,t-e,e-n)}function jV(e,t){return e?!t:t}function MV(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),ee=-a[0]*x,O=-a[1]*S,k=AV(E,h,g),A=AV(D,_,v);if(o){let e=0,t=0;c&&w<0?e=OV(y+w+ee,o[0][0]):!c&&w>0&&(e=kV(y+E+ee,o[1][0])),l&&T<0?t=OV(b+T+O,o[0][1]):!l&&T>0&&(t=kV(b+D+O,o[1][1])),k=Math.max(k,e),A=Math.max(A,t)}if(s){let e=0,t=0;c&&w>0?e=kV(y+w,s[0][0]):!c&&w<0&&(e=OV(y+E,s[1][0])),l&&T>0?t=kV(b+T,s[0][1]):!l&&T<0&&(t=OV(b+D,s[1][1])),k=Math.max(k,e),A=Math.max(A,t)}if(i){if(u){let e=AV(E/C,_,v)*C;if(k=Math.max(k,e),o){let e=0;e=!c&&!l||c&&!l&&f?kV(b+O+E/C,o[1][1])*C:OV(b+O+(c?w:-w)/C,o[0][1])*C,k=Math.max(k,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?OV(b+E/C,s[1][1])*C:kV(b+(c?w:-w)/C,s[0][1])*C,k=Math.max(k,e)}}if(d){let e=AV(D*C,h,g)/C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||l&&!c&&f?kV(y+D*C+ee,o[1][0])/C:OV(y+(l?T:-T)*C+ee,o[0][0])/C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?OV(y+D*C,s[1][0])/C:kV(y+(l?T:-T)*C,s[0][0])/C,A=Math.max(A,e)}}}T+=T<0?A:-A,w+=w<0?k:-k,i&&(f?E>D*C?T=(jV(c,l)?-w:w)/C:w=(jV(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let te=c?y+w:y,ne=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+te,y:a[1]*T*(l?-1:1)+ne}}var NV={width:0,height:0,x:0,y:0},PV={...NV,pointerX:0,pointerY:0,aspectRatio:1};function FV(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function IV({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=vF(e),o={controlDirection:DV(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...NV},h={...PV};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:DV(e)};let g,_=null,v=[],y,b,x,S=NF().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=Qz(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=Wz(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=FV(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=Qz(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:S,height:C}=m,w={},T=g.origin??s,{width:E,height:D,x:ee,y:O}=MV(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,T,b,x),k=E!==S,A=D!==C,te=ee!==u&&k,ne=O!==f&&A;if(!te&&!ne&&!k&&!A)return;let re={prevValues:{...m},startX:h.x,startY:h.y,childNodes:v.map(e=>({...e,position:{...e.position}}))};if((te||ne||T[0]===1||T[1]===1)&&(w.x=te?ee:m.x,w.y=ne?O:m.y,m.x=w.x,m.y=w.y,v.length>0)){let e=ee-u,t=O-f;for(let n of v)n.position={x:n.position.x-e+T[0]*(E-S),y:n.position.y-t+T[1]*(D-C)},l.push(n)}if((k||A)&&(w.width=k&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?E:m.width,w.height=A&&(!o.resizeDirection||o.resizeDirection===`vertical`)?D:m.height,m.width=w.width,m.height=w.height),y&&g.expandParent){let e=T[0]*(w.width??0);w.x&&w.x<e&&(m.x=e,h.x-=w.x-e);let t=T[1]*(w.height??0);w.y&&w.y<t&&(m.y=t,h.y-=w.y-t)}let ie=EV({width:m.width,prevWidth:S,height:m.height,prevHeight:C,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),ae={...m,direction:ie};if(p?.(e,ae)===!1){m=re.prevValues,h.x=re.startX,h.y=re.startY,v.forEach((e,t)=>{e.position=re.childNodes[t].position});return}d?.(e,ae),r(w,l)}).on(`end`,e=>{f?.(e,{...m}),i?.({...m})});a.call(S)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var LV=s((e=>{var t=f();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),RV=s(((e,t)=>{t.exports=LV()})),zV=s((e=>{var t=f(),n=RV();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),BV=u(s(((e,t)=>{t.exports=zV()}))(),1),VV=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},HV=e=>e?VV(e):VV,{useDebugValue:UV}=y.default,{useSyncExternalStoreWithSelector:WV}=BV.default,GV=e=>e;function KV(e,t=GV,n){let r=WV(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return UV(r),r}var qV=(e,t)=>{let n=HV(e),r=(e,r=t)=>KV(n,e,r);return Object.assign(r,n),r},JV=(e,t)=>e?qV(e,t):qV;function YV(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}g();var XV=(0,y.createContext)(null),ZV=XV.Provider,QV=XR.error001(`react`);function $V(e,t){let n=(0,y.useContext)(XV);if(n===null)throw Error(QV);return KV(n,e,t)}function eH(){let e=(0,y.useContext)(XV);if(e===null)throw Error(QV);return(0,y.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var tH={display:`none`},nH={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},rH=`react-flow__node-desc`,iH=`react-flow__edge-desc`,aH=`react-flow__aria-live`,oH=e=>e.ariaLiveMessage,sH=e=>e.ariaLabelConfig;function cH({rfId:e}){let t=$V(oH);return(0,Z.jsx)(`div`,{id:`${aH}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:nH,children:t})}function lH({rfId:e,disableKeyboardA11y:t}){let n=$V(sH);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{id:`${rH}-${e}`,style:tH,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,Z.jsx)(`div`,{id:`${iH}-${e}`,style:tH,children:n[`edge.a11yDescription.default`]}),!t&&(0,Z.jsx)(cH,{rfId:e})]})}var uH=(0,y.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,Z.jsx)(`div`,{className:pN([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});uH.displayName=`Panel`;var dH=`https://reactflow.dev?utm_source=attribution`;function fH({proOptions:e,position:t=`bottom-right`}){return(0,y.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,Z.jsx)(uH,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${dH}`,children:(0,Z.jsx)(`a`,{href:dH,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var pH=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},mH=e=>e.id;function hH(e,t){return YV(e.selectedNodes.map(mH),t.selectedNodes.map(mH))&&YV(e.selectedEdges.map(mH),t.selectedEdges.map(mH))}function gH({onSelectionChange:e}){let t=eH(),{selectedNodes:n,selectedEdges:r}=$V(pH,hH);return(0,y.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var _H=e=>!!e.onSelectionChangeHandlers;function vH({onSelectionChange:e}){let t=$V(_H);return e||t?(0,Z.jsx)(gH,{onSelectionChange:e}):null}var yH=[0,0],bH={x:0,y:0,zoom:1},xH=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],SH=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),CH={translateExtent:ZR,nodeOrigin:yH,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function wH(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=$V(SH,YV),l=eH();(0,y.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=CH,s()}),[]);let u=(0,y.useRef)(CH);return(0,y.useEffect)(()=>{for(let s of xH){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:Xz(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},xH.map(t=>e[t])),null}function TH(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function EH(e){let[t,n]=(0,y.useState)(e===`system`?null:e);return(0,y.useEffect)(()=>{if(e!==`system`){n(e);return}let t=TH(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?TH()?.matches?`dark`:`light`:t}var DH=typeof document<`u`?document:null;function OH(e=null,t={target:DH,actInsideInputWithModifier:!0}){let[n,r]=(0,y.useState)(!1),i=(0,y.useRef)(!1),a=(0,y.useRef)(new Set([])),[o,s]=(0,y.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
|
|
736
736
|
`).replace(`
|
|
737
737
|
|
|
738
738
|
`,`
|
|
739
739
|
+`).split(`
|
|
740
|
-
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,y.useEffect)(()=>{let n=t?.target??SH,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&Zz(e))return!1;let n=TH(e.code,s);if(a.current.add(e[n]),wH(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=TH(e.code,s);wH(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function wH(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function TH(e,t){return t.includes(e)?`code`:`key`}var EH=()=>{let e=YV();return(0,y.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=Lz(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return Mz(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=Nz(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function DH(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)OH(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function OH(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing)}}function kH(e,t){return DH(e,t)}function AH(e,t){return DH(e,t)}function jH(e,t){return{id:e,type:`select`,selected:t}}function MH(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);(a.selected!==void 0||e)&&a.selected!==e&&(n&&(a.selected=e),r.push(jH(a.id,e)))}return r}function NH({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function PH(e){return{id:e.id,type:`remove`}}var FH=Az(`React Flow`,`https://reactflow.dev/`);function IH(e,t,n={}){return uB(e,t,{...n,onError:n.onError??FH})}var LH=e=>iz(e),RH=e=>rz(e);function zH(e){return(0,y.forwardRef)(e)}var BH=typeof window<`u`?y.useLayoutEffect:y.useEffect;function VH(e){let[t,n]=(0,y.useState)(BigInt(0)),[r]=(0,y.useState)(()=>HH(()=>n(e=>e+BigInt(1))));return BH(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function HH(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var UH=(0,y.createContext)(null);function WH({children:e}){let t=YV(),n=VH((0,y.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=NH({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=VH((0,y.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(NH({items:s,lookup:o}))},[])),i=(0,y.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,Z.jsx)(UH.Provider,{value:i,children:e})}function GH(){let e=(0,y.useContext)(UH);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var KH=e=>!!e.panZoom;function qH(){let e=EH(),t=YV(),n=GH(),r=JV(KH),i=(0,y.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=LH(e)?e:n.get(e.id),a=i.parentId?Hz(i.position,i.measured,i.parentId,n,r):i.position;return Cz({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&LH(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&RH(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await mz({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(PH);o?.(f),c(e)}if(m){let e=d.map(PH);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=Oz(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=Cz(s?r:a),l=Dz(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=Oz(e)?e:a(e);if(!r)return!1;let i=Dz(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return sz(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??Wz();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,y.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var JH=e=>e.selected,YH=typeof window<`u`?window:void 0;function XH({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=YV(),{deleteElements:r}=qH(),i=CH(e,{actInsideInputWithModifier:!1}),a=CH(t,{target:YH});(0,y.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(JH),edges:e.filter(JH)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,y.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function ZH(e){let t=YV();(0,y.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=Jz(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,GR.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var QH={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},$H=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function eU({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=XR.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:g,noPanClassName:_,onViewportChange:v,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:S}){let C=YV(),w=(0,y.useRef)(null),{userSelectionActive:T,lib:E,connectionInProgress:D}=JV($H,WV),ee=CH(p),O=(0,y.useRef)();ZH(w);let k=(0,y.useCallback)(e=>{v?.({x:e[0],y:e[1],zoom:e[2]}),b||C.setState({transform:e})},[v,b]);return(0,y.useEffect)(()=>{if(w.current){O.current=yV({domNode:w.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>C.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=C.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=C.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=C.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=O.current.getViewport();return C.setState({panZoom:O.current,transform:[e,t,n],domNode:w.current.closest(`.react-flow`)}),()=>{O.current?.destroy()}}},[]),(0,y.useEffect)(()=>{O.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:ee,preventScrolling:m,noPanClassName:_,userSelectionActive:T,noWheelClassName:g,lib:E,onTransformChange:k,connectionInProgress:D,selectionOnDrag:S,paneClickDistance:x})},[e,t,n,r,i,a,o,s,c,ee,m,_,T,g,E,k,D,S,x]),(0,Z.jsx)(`div`,{className:`react-flow__renderer`,ref:w,style:QH,children:h})}var tU=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function nU(){let{userSelectionActive:e,userSelectionRect:t}=JV(tU,WV);return e&&t?(0,Z.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var rU=(e,t)=>n=>{n.target===t.current&&e?.(n)},iU=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function aU({isSelecting:e,selectionKeyPressed:t,selectionMode:n=ZR.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,y.useRef)(0),_=YV(),{userSelectionActive:v,elementsSelectable:b,dragging:x,panBy:S,autoPanSpeed:C}=JV(iU,WV),w=b&&(e||v),T=(0,y.useRef)(null),E=(0,y.useRef)(),D=(0,y.useRef)(new Set),ee=(0,y.useRef)(new Set),O=(0,y.useRef)(!1),k=(0,y.useRef)(!1),A=(0,y.useRef)({x:0,y:0}),te=(0,y.useRef)(!1),ne=e=>{if(k.current||O.current||_.getState().connection.inProgress){k.current=!1,O.current=!1;return}l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},re=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},ie=d?e=>d(e):void 0,ae=e=>{k.current&&=(e.stopPropagation(),!1)},oe=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=_.getState();if(E.current=i?.getBoundingClientRect(),!E.current)return;let s=n.target===T.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),k.current=!1;let{x:c,y:l}=$z(n.nativeEvent,E.current),u=Mz({x:c,y:l},a);_.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function se(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=Nz(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=D.current,g=ee.current;D.current=new Set(lz(a,m,i,n===ZR.Partial,!0).map(e=>e.id)),ee.current=new Set;let v=u?.selectable??!0;for(let e of D.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&ee.current.add(e)}}Uz(h,D.current)||c(MH(a,D.current,!0)),Uz(g,ee.current)||l(MH(o,ee.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function ce(){if(!i||!E.current)return;let[e,t]=yz(A.current,E.current,C);S({x:e,y:t}).then(e=>{if(!k.current||!e){g.current=requestAnimationFrame(ce);return}let{x:t,y:n}=A.current;se(t,n),g.current=requestAnimationFrame(ce)})}let j=()=>{cancelAnimationFrame(g.current),g.current=0,te.current=!1};(0,y.useEffect)(()=>()=>j(),[]);let le=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!E.current||!n)return;let{x:o,y:c}=$z(e.nativeEvent,E.current);A.current={x:o,y:c};let l=Nz({x:n.startX,y:n.startY},r);if(!k.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}k.current=!0,te.current||=(ce(),!0),se(o,c)},ue=e=>{if(!w){e.target===T.current&&_.getState().connection.inProgress&&(O.current=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===T.current&&_.getState().userSelectionRect&&ne?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(c?.(e),_.setState({nodesSelectionActive:D.current.size>0})),j())},de=e=>{e.target?.releasePointerCapture?.(e.pointerId),j()},fe=r===!0||Array.isArray(r)&&r.includes(0);return(0,Z.jsxs)(`div`,{className:cN([`react-flow__pane`,{draggable:fe,dragging:x,selection:e}]),onClick:w?void 0:rU(ne,T),onContextMenu:rU(re,T),onWheel:rU(ie,T),onPointerEnter:w?void 0:f,onPointerMove:w?le:p,onPointerUp:ue,onPointerCancel:w?de:void 0,onPointerDownCapture:w?oe:void 0,onClickCapture:w?ae:void 0,onPointerLeave:m,ref:T,style:QH,children:[h,(0,Z.jsx)(nU,{})]})}function oU({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,GR.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function sU({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=YV(),[c,l]=(0,y.useState)(!1),u=(0,y.useRef)();return(0,y.useEffect)(()=>{if(!t)return u.current=JB({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{oU({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,y.useEffect)(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var cU=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function lU(){let e=YV();return(0,y.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=cU(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=jz(t,i));let{position:a,positionAbsolute:s}=pz({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var uU=(0,y.createContext)(null),dU=uU.Provider;uU.Consumer;var fU=()=>(0,y.useContext)(uU),pU=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),mU=(0,y.createContext)(null);function hU({children:e}){let t=JV(pU,WV);return(0,Z.jsx)(mU.Provider,{value:t,children:e})}function gU(){let e=(0,y.useContext)(mU);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var _U={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},vU=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return _U;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===YR.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function yU({type:e=`source`,position:t=tz.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=YV(),_=fU(),{connectOnClick:v,noPanClassName:y,rfId:b}=gU(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=JV(vU(_,m,e),WV);_||g.getState().onError?.(`010`,GR.error010());let ee=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(IH(i,e,{onError:n}))}n?.(i),s?.(i)},O=e=>{if(!_)return;let t=Qz(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();iV.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:ee,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,Z.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:cN([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:O,onTouchStart:O,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=Yz(t.target),h=n||c,{connection:v,isValid:y}=iV.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&ee(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var bU=(0,y.memo)(zH(yU));function xU({data:e,isConnectable:t,sourcePosition:n=tz.Bottom}){return(0,Z.jsxs)(Z.Fragment,{children:[e?.label,(0,Z.jsx)(bU,{type:`source`,position:n,isConnectable:t})]})}function SU({data:e,isConnectable:t,targetPosition:n=tz.Top,sourcePosition:r=tz.Bottom}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(bU,{type:`target`,position:n,isConnectable:t}),e?.label,(0,Z.jsx)(bU,{type:`source`,position:r,isConnectable:t})]})}function CU(){return null}function wU({data:e,isConnectable:t,targetPosition:n=tz.Top}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(bU,{type:`target`,position:n,isConnectable:t}),e?.label]})}var TU={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},EU={input:xU,default:SU,output:wU,group:CU};function DU(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var OU=e=>{let{width:t,height:n,x:r,y:i}=cz(e.nodeLookup,{filter:e=>!!e.selected});return{width:kz(t)?t:null,height:kz(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function kU({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=YV(),{width:i,height:a,transformString:o,userSelectionActive:s}=JV(OU,WV),c=lU(),l=(0,y.useRef)(null);(0,y.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(sU({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,Z.jsx)(`div`,{className:cN([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,Z.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(TU,e.key)&&(e.preventDefault(),c({direction:TU[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var AU=typeof window<`u`?window:void 0,jU=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function MU({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:ee,maxZoom:O,preventScrolling:k,onSelectionContextMenu:A,noWheelClassName:te,noPanClassName:ne,disableKeyboardA11y:re,onViewportChange:ie,isControlledViewport:ae}){let{nodesSelectionActive:oe,userSelectionActive:se}=JV(jU,WV),ce=CH(l,{target:AU}),j=CH(h,{target:AU}),le=j||w,ue=j||b,de=u&&le!==!0,fe=ce||se||de;return XH({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,Z.jsx)(eU,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ue,panActivationKeyPressed:j,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!ce&&le,defaultViewport:E,translateExtent:D,minZoom:ee,maxZoom:O,zoomActivationKeyCode:g,preventScrolling:k,noWheelClassName:te,noPanClassName:ne,onViewportChange:ie,isControlledViewport:ae,paneClickDistance:s,selectionOnDrag:de,children:(0,Z.jsxs)(aU,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:le,autoPanOnSelection:T,isSelecting:!!fe,selectionMode:d,selectionKeyPressed:ce,paneClickDistance:s,selectionOnDrag:de,children:[e,oe&&(0,Z.jsx)(kU,{onSelectionContextMenu:A,noPanClassName:ne,disableKeyboardA11y:re})]})})}MU.displayName=`FlowRenderer`;var NU=(0,y.memo)(MU),PU=e=>t=>e?lz(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function FU(e){return JV((0,y.useCallback)(PU(e),[e]),WV)}var IU=e=>e.updateNodeInternals;function LU(){let e=JV(IU),[t]=(0,y.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,y.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function RU({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=YV(),a=(0,y.useRef)(null),o=(0,y.useRef)(null),s=(0,y.useRef)(e.sourcePosition),c=(0,y.useRef)(e.targetPosition),l=(0,y.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,y.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,y.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,y.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function zU({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=JV(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},WV),S=y.type||`default`,C=g?.[S]||EU[S];C===void 0&&(v?.(`003`,GR.error003(S)),S=`default`,C=g?.default||EU.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),ee=YV(),O=Vz(y),k=RU({node:y,nodeType:S,hasDimensions:O,resizeObserver:d}),A=sU({nodeRef:k,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),te=lU();if(y.hidden)return null;let ne=Bz(y),re=DU(y),ie=T||w||t||n||r||i,ae=n?e=>n(e,{...b.userNode}):void 0,oe=r?e=>r(e,{...b.userNode}):void 0,se=i?e=>i(e,{...b.userNode}):void 0,ce=a?e=>a(e,{...b.userNode}):void 0,j=o?e=>o(e,{...b.userNode}):void 0,le=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=ee.getState();T&&(!r||!w||i>0)&&oU({id:e,store:ee,nodeRef:k}),t&&t(n,{...b.userNode})},ue=t=>{if(!(Zz(t.nativeEvent)||m)){if(qR.includes(t.key)&&T){let n=t.key===`Escape`;oU({id:e,store:ee,unselect:n,nodeRef:k})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(TU,t.key)){t.preventDefault();let{ariaLabelConfig:e}=ee.getState();ee.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),te({direction:TU[t.key],factor:t.shiftKey?4:1})}}},de=()=>{if(m||!k.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=ee.getState();i&&(lz(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+ne.width/2,y.position.y+ne.height/2,{zoom:t[2]}))};return(0,Z.jsx)(`div`,{className:cN([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:A}]),ref:k,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:ie?`all`:`none`,visibility:O?`visible`:`hidden`,...y.style,...re},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:ae,onMouseMove:oe,onMouseLeave:se,onContextMenu:ce,onClick:le,onDoubleClick:j,onKeyDown:D?ue:void 0,tabIndex:D?0:void 0,onFocus:D?de:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${QV}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,Z.jsx)(dU,{value:e,children:(0,Z.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:A,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...ne})})})}var BU=(0,y.memo)(zU),VU=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function HU(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=JV(VU,WV),a=FU(e.onlyRenderVisibleElements),o=LU();return(0,Z.jsx)(`div`,{className:`react-flow__nodes`,style:QH,children:a.map(a=>(0,Z.jsx)(BU,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}HU.displayName=`NodeRenderer`;var UU=(0,y.memo)(HU);function WU(e){return JV((0,y.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&sB({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),WV)}var GU=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,Z.jsx)(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},KU=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,Z.jsx)(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},qU={[ez.Arrow]:GU,[ez.ArrowClosed]:KU};function JU(e){let t=YV();return(0,y.useMemo)(()=>Object.prototype.hasOwnProperty.call(qU,e)?qU[e]:(t.getState().onError?.(`009`,GR.error009(e)),null),[e])}var YU=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=JU(t);return c?(0,Z.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,Z.jsx)(c,{color:n,strokeWidth:o})}):null},XU=({defaultColor:e,rfId:t})=>{let n=JV(e=>e.edges),r=JV(e=>e.defaultEdgeOptions),i=(0,y.useMemo)(()=>wB(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,Z.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,Z.jsx)(`defs`,{children:i.map(e=>(0,Z.jsx)(YU,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};XU.displayName=`MarkerDefinitions`;var ZU=(0,y.memo)(XU);function QU({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,y.useState)({x:1,y:0,width:0,height:0}),p=cN([`react-flow__edge-textwrapper`,l]),m=(0,y.useRef)(null);return(0,y.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,Z.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,Z.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,Z.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}QU.displayName=`EdgeText`;var $U=(0,y.memo)(QU);function eW({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{...u,d:e,fill:`none`,className:cN([`react-flow__edge-path`,u.className])}),l?(0,Z.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&kz(t)&&kz(n)?(0,Z.jsx)($U,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function tW({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===tz.Left||e===tz.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function nW({sourceX:e,sourceY:t,sourcePosition:n=tz.Bottom,targetX:r,targetY:i,targetPosition:a=tz.Top}){let[o,s]=tW({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=tW({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=tB({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function rW(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=nW({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,Z.jsx)(eW,{id:x,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var iW=rW({isInternal:!1}),aW=rW({isInternal:!0});iW.displayName=`SimpleBezierEdge`,aW.displayName=`SimpleBezierEdgeInternal`;function oW(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=tz.Bottom,targetPosition:m=tz.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=_B({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),S=e.isInternal?void 0:t;return(0,Z.jsx)(eW,{id:S,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var sW=oW({isInternal:!1}),cW=oW({isInternal:!0});sW.displayName=`SmoothStepEdge`,cW.displayName=`SmoothStepEdgeInternal`;function lW(e){return(0,y.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,Z.jsx)(sW,{...n,id:r,pathOptions:(0,y.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var uW=lW({isInternal:!1}),dW=lW({isInternal:!0});uW.displayName=`StepEdge`,dW.displayName=`StepEdgeInternal`;function fW(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=dB({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return(0,Z.jsx)(eW,{id:y,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var pW=fW({isInternal:!1}),mW=fW({isInternal:!0});pW.displayName=`StraightEdge`,mW.displayName=`StraightEdgeInternal`;function hW(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=tz.Bottom,targetPosition:s=tz.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=iB({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return(0,Z.jsx)(eW,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var gW=hW({isInternal:!1}),_W=hW({isInternal:!0});gW.displayName=`BezierEdge`,_W.displayName=`BezierEdgeInternal`;var vW={default:_W,straight:mW,step:dW,smoothstep:cW,simplebezier:aW},yW={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},bW=(e,t,n)=>n===tz.Left?e-t:n===tz.Right?e+t:e,xW=(e,t,n)=>n===tz.Top?e-t:n===tz.Bottom?e+t:e,SW=`react-flow__edgeupdater`;function CW({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,Z.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:cN([SW,`${SW}-${s}`]),cx:bW(t,r,e),cy:xW(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function wW({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=YV(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;iV.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,Z.jsxs)(Z.Fragment,{children:[(e===!0||e===`source`)&&(0,Z.jsx)(CW,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,Z.jsx)(CW,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function TW({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let b=JV(t=>t.edgeLookup.get(e)),x=JV(e=>e.defaultEdgeOptions);b=x?{...x,...b}:b;let S=b.type||`default`,C=h?.[S]||vW[S];C===void 0&&(_?.(`011`,GR.error011(S)),S=`default`,C=h?.default||vW.default);let w=!!(b.focusable||t&&b.focusable===void 0),T=d!==void 0&&(b.reconnectable||n&&b.reconnectable===void 0),E=!!(b.selectable||r&&b.selectable===void 0),D=(0,y.useRef)(null),[ee,O]=(0,y.useState)(!1),[k,A]=(0,y.useState)(!1),te=YV(),{zIndex:ne=b.zIndex,sourceX:re,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce}=JV((0,y.useCallback)(t=>{let n=t.nodeLookup.get(b.source),r=t.nodeLookup.get(b.target);if(!n||!r)return yW;let i=yB({id:e,sourceNode:n,targetNode:r,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=oB({selected:b.selected,zIndex:b.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||yW,zIndex:a}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex,_]),WV),j=(0,y.useMemo)(()=>b.markerStart?`url('#${CB(b.markerStart,m)}')`:void 0,[b.markerStart,m]),le=(0,y.useMemo)(()=>b.markerEnd?`url('#${CB(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||re===null||ie===null||ae===null||oe===null)return null;let ue=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=te.getState();E&&(te.setState({nodesSelectionActive:!1}),b.selected&&a?(r({nodes:[],edges:[b]}),D.current?.blur()):n([e])),i&&i(t,b)},de=a?e=>{a(e,{...b})}:void 0,fe=o?e=>{o(e,{...b})}:void 0,pe=s?e=>{s(e,{...b})}:void 0,me=c?e=>{c(e,{...b})}:void 0,he=l?e=>{l(e,{...b})}:void 0;return(0,Z.jsx)(`svg`,{style:{zIndex:ne},children:(0,Z.jsxs)(`g`,{className:cN([`react-flow__edge`,`react-flow__edge-${S}`,b.className,g,{selected:b.selected,animated:b.animated,inactive:!E&&!i,updating:ee,selectable:E}]),onClick:ue,onDoubleClick:de,onContextMenu:fe,onMouseEnter:pe,onMouseMove:me,onMouseLeave:he,onKeyDown:w?t=>{if(!v&&qR.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=te.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[b]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:b.ariaRole??(w?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":w?`${$V}-${m}`:void 0,ref:D,...b.domAttributes,children:[!k&&(0,Z.jsx)(C,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:E,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:re,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:j,markerEnd:le,pathOptions:`pathOptions`in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),T&&(0,Z.jsx)(wW,{edge:b,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:re,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce,setUpdateHover:O,setReconnecting:A})]})})}var EW=(0,y.memo)(TW),DW=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function OW({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=JV(DW,WV),b=WU(t);return(0,Z.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,Z.jsx)(ZU,{defaultColor:e,rfId:n}),b.map(e=>(0,Z.jsx)(EW,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}OW.displayName=`EdgeRenderer`;var kW=(0,y.memo)(OW),AW=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function jW({children:e}){let t=YV(),n=(0,y.useRef)(null),[r]=(0,y.useState)(()=>t.getState().transform);return BH(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=AW(r)))};return r(),t.subscribe(r)},[t]),(0,Z.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:AW(r)},children:e})}function MW(e){let t=qH(),n=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var NW=e=>e.panZoom?.syncViewport;function PW(e){let t=JV(NW),n=YV();return(0,y.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function FW(e){return e.connection.inProgress?{...e.connection,to:Mz(e.connection.to,e.transform)}:{...e.connection}}function IW(e){return e?t=>e(FW(t)):FW}function LW(e){return JV(IW(e),WV)}var RW=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function zW({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=JV(RW,WV);return a&&i&&c?(0,Z.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,Z.jsx)(`g`,{className:cN([`react-flow__connection`,Kz(s)]),children:(0,Z.jsx)(BW,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var BW=({style:e,type:t=$R.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=LW();if(!i)return;if(n)return(0,Z.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:Kz(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case $R.Bezier:[m]=iB(h);break;case $R.SimpleBezier:[m]=nW(h);break;case $R.Step:[m]=_B({...h,borderRadius:0});break;case $R.SmoothStep:[m]=_B(h);break;default:[m]=dB(h)}return(0,Z.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};BW.displayName=`ConnectionLine`;var VW={};function HW(e=VW){(0,y.useRef)(e),YV(),(0,y.useEffect)(()=>{},[e])}function UW(){YV(),(0,y.useRef)(!1),(0,y.useEffect)(()=>{},[])}function WW({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:ee,minZoom:O,maxZoom:k,preventScrolling:A,defaultMarkerColor:te,zoomOnScroll:ne,zoomOnPinch:re,panOnScroll:ie,panOnScrollSpeed:ae,panOnScrollMode:oe,zoomOnDoubleClick:se,panOnDrag:ce,autoPanOnSelection:j,onPaneClick:le,onPaneMouseEnter:ue,onPaneMouseMove:de,onPaneMouseLeave:fe,onPaneScroll:pe,onPaneContextMenu:me,paneClickDistance:he,nodeClickDistance:ge,onEdgeContextMenu:_e,onEdgeMouseEnter:ve,onEdgeMouseMove:M,onEdgeMouseLeave:N,reconnectRadius:ye,onReconnect:be,onReconnectStart:P,onReconnectEnd:xe,noDragClassName:Se,noWheelClassName:Ce,noPanClassName:we,disableKeyboardA11y:Te,nodeExtent:Ee,rfId:De,viewport:Oe,onViewportChange:ke,nodesDraggable:Ae}){return HW(e),HW(t),UW(),MW(n),PW(Oe),(0,Z.jsx)(NU,{onPaneClick:le,onPaneMouseEnter:ue,onPaneMouseMove:de,onPaneMouseLeave:fe,onPaneContextMenu:me,onPaneScroll:pe,paneClickDistance:he,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:ne,zoomOnPinch:re,zoomOnDoubleClick:se,panOnScroll:ie,panOnScrollSpeed:ae,panOnScrollMode:oe,panOnDrag:ce,autoPanOnSelection:j,defaultViewport:D,translateExtent:ee,minZoom:O,maxZoom:k,onSelectionContextMenu:d,preventScrolling:A,noDragClassName:Se,noWheelClassName:Ce,noPanClassName:we,disableKeyboardA11y:Te,onViewportChange:ke,isControlledViewport:!!Oe,children:(0,Z.jsxs)(jW,{children:[(0,Z.jsx)(kW,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:be,onReconnectStart:P,onReconnectEnd:xe,onlyRenderVisibleElements:T,onEdgeContextMenu:_e,onEdgeMouseEnter:ve,onEdgeMouseMove:M,onEdgeMouseLeave:N,reconnectRadius:ye,defaultMarkerColor:te,noPanClassName:we,disableKeyboardA11y:Te,rfId:De}),(0,Z.jsx)(zW,{style:h,type:m,component:g,containerStyle:_}),(0,Z.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,Z.jsx)(UU,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:ge,onlyRenderVisibleElements:T,noPanClassName:we,noDragClassName:Se,disableKeyboardA11y:Te,nodeExtent:Ee,rfId:De,nodesDraggable:Ae}),(0,Z.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}WW.displayName=`GraphView`;var GW=(0,y.memo)(WW),KW=Az(`React Flow`,`https://reactflow.dev/`),qW=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??KR;HB(h,g,_);let{nodesInitialized:x}=NB(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=Lz(cz(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:KR,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:YR.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...QR},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:KW,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:JR,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},JW=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>UV((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await fz({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...qW({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=NB(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();HB(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=zB(e,n,r,i,a,o,l);d&&(AB(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=xB(e,o.fromHandle,tz.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=RB(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(kH(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(AH(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>jH(e,!0)));return}i(MH(r,new Set([...e]),!0)),a(MH(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>jH(e,!0)));return}a(MH(n,new Set([...e]))),i(MH(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(jH(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(jH(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,jH(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,jH(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(NB(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return BB({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...QR}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...qW()})}},Object.is);function YW({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,y.useState)(()=>JW({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,Z.jsx)(KV,{value:m,children:(0,Z.jsx)(WH,{children:(0,Z.jsx)(hU,{children:p})})})}function XW({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,y.useContext)(GV)?(0,Z.jsx)(Z.Fragment,{children:e}):(0,Z.jsx)(YW,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var ZW={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function QW({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onNodesDelete:D,onEdgesDelete:ee,onDelete:O,onSelectionChange:k,onSelectionDragStart:A,onSelectionDrag:te,onSelectionDragStop:ne,onSelectionContextMenu:re,onSelectionStart:ie,onSelectionEnd:ae,onBeforeDelete:oe,connectionMode:se,connectionLineType:ce=$R.Bezier,connectionLineStyle:j,connectionLineComponent:le,connectionLineContainerStyle:ue,deleteKeyCode:de=`Backspace`,selectionKeyCode:fe=`Shift`,selectionOnDrag:pe=!1,selectionMode:me=ZR.Full,panActivationKeyCode:he=`Space`,multiSelectionKeyCode:ge=Rz()?`Meta`:`Control`,zoomActivationKeyCode:_e=Rz()?`Meta`:`Control`,snapToGrid:ve,snapGrid:M,onlyRenderVisibleElements:N=!1,selectNodesOnDrag:ye,nodesDraggable:be,autoPanOnNodeFocus:P,nodesConnectable:xe,nodesFocusable:Se,nodeOrigin:Ce=mH,edgesFocusable:we,edgesReconnectable:Te,elementsSelectable:Ee=!0,defaultViewport:De=hH,minZoom:Oe=.5,maxZoom:ke=2,translateExtent:Ae=KR,preventScrolling:je=!0,nodeExtent:Me,defaultMarkerColor:Ne=`#b1b1b7`,zoomOnScroll:Pe=!0,zoomOnPinch:Fe=!0,panOnScroll:Ie=!1,panOnScrollSpeed:Le=.5,panOnScrollMode:Re=XR.Free,zoomOnDoubleClick:ze=!0,panOnDrag:Be=!0,onPaneClick:Ve,onPaneMouseEnter:He,onPaneMouseMove:Ue,onPaneMouseLeave:We,onPaneScroll:Ge,onPaneContextMenu:Ke,paneClickDistance:qe=1,nodeClickDistance:Je=0,children:Ye,onReconnect:Xe,onReconnectStart:Ze,onReconnectEnd:Qe,onEdgeContextMenu:$e,onEdgeDoubleClick:F,onEdgeMouseEnter:et,onEdgeMouseMove:tt,onEdgeMouseLeave:nt,reconnectRadius:rt=10,onNodesChange:it,onEdgesChange:at,noDragClassName:ot=`nodrag`,noWheelClassName:st=`nowheel`,noPanClassName:I=`nopan`,fitView:ct,fitViewOptions:lt,connectOnClick:ut,attributionPosition:dt,proOptions:ft,defaultEdgeOptions:pt,elevateNodesOnSelect:mt=!0,elevateEdgesOnSelect:ht=!1,disableKeyboardA11y:gt=!1,autoPanOnConnect:_t,autoPanOnNodeDrag:vt,autoPanOnSelection:yt=!0,autoPanSpeed:bt,connectionRadius:xt,isValidConnection:St,onError:Ct,style:wt,id:Tt,nodeDragThreshold:Et,connectionDragThreshold:Dt,viewport:Ot,onViewportChange:kt,width:At,height:jt,colorMode:Mt=`light`,debug:Nt,onScroll:Pt,ariaLabelConfig:Ft,zIndexMode:It=`basic`,...Lt},Rt){let zt=Tt||`1`,Bt=xH(Mt),Vt=(0,y.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Pt?.(e)},[Pt]);return(0,Z.jsx)(`div`,{"data-testid":`rf__wrapper`,...Lt,onScroll:Vt,style:{...wt,...ZW},ref:Rt,className:cN([`react-flow`,i,Bt]),id:Tt,role:`application`,children:(0,Z.jsxs)(XW,{nodes:e,edges:t,width:At,height:jt,fitView:ct,fitViewOptions:lt,minZoom:Oe,maxZoom:ke,nodeOrigin:Ce,nodeExtent:Me,zIndexMode:It,children:[(0,Z.jsx)(yH,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:be,autoPanOnNodeFocus:P,nodesConnectable:xe,nodesFocusable:Se,edgesFocusable:we,edgesReconnectable:Te,elementsSelectable:Ee,elevateNodesOnSelect:mt,elevateEdgesOnSelect:ht,minZoom:Oe,maxZoom:ke,nodeExtent:Me,onNodesChange:it,onEdgesChange:at,snapToGrid:ve,snapGrid:M,connectionMode:se,translateExtent:Ae,connectOnClick:ut,defaultEdgeOptions:pt,fitView:ct,fitViewOptions:lt,onNodesDelete:D,onEdgesDelete:ee,onDelete:O,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onSelectionDrag:te,onSelectionDragStart:A,onSelectionDragStop:ne,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:I,nodeOrigin:Ce,rfId:zt,autoPanOnConnect:_t,autoPanOnNodeDrag:vt,autoPanSpeed:bt,onError:Ct,connectionRadius:xt,isValidConnection:St,selectNodesOnDrag:ye,nodeDragThreshold:Et,connectionDragThreshold:Dt,onBeforeDelete:oe,debug:Nt,ariaLabelConfig:Ft,zIndexMode:It}),(0,Z.jsx)(GW,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,nodeTypes:a,edgeTypes:o,connectionLineType:ce,connectionLineStyle:j,connectionLineComponent:le,connectionLineContainerStyle:ue,selectionKeyCode:fe,selectionOnDrag:pe,selectionMode:me,deleteKeyCode:de,multiSelectionKeyCode:ge,panActivationKeyCode:he,zoomActivationKeyCode:_e,onlyRenderVisibleElements:N,defaultViewport:De,translateExtent:Ae,minZoom:Oe,maxZoom:ke,preventScrolling:je,zoomOnScroll:Pe,zoomOnPinch:Fe,zoomOnDoubleClick:ze,panOnScroll:Ie,panOnScrollSpeed:Le,panOnScrollMode:Re,panOnDrag:Be,autoPanOnSelection:yt,onPaneClick:Ve,onPaneMouseEnter:He,onPaneMouseMove:Ue,onPaneMouseLeave:We,onPaneScroll:Ge,onPaneContextMenu:Ke,paneClickDistance:qe,nodeClickDistance:Je,onSelectionContextMenu:re,onSelectionStart:ie,onSelectionEnd:ae,onReconnect:Xe,onReconnectStart:Ze,onReconnectEnd:Qe,onEdgeContextMenu:$e,onEdgeDoubleClick:F,onEdgeMouseEnter:et,onEdgeMouseMove:tt,onEdgeMouseLeave:nt,reconnectRadius:rt,defaultMarkerColor:Ne,noDragClassName:ot,noWheelClassName:st,noPanClassName:I,rfId:zt,disableKeyboardA11y:gt,nodeExtent:Me,viewport:Ot,onViewportChange:kt,nodesDraggable:be}),(0,Z.jsx)(pH,{onSelectionChange:k}),Ye,(0,Z.jsx)(sH,{proOptions:ft,position:dt}),(0,Z.jsx)(iH,{rfId:zt,disableKeyboardA11y:gt})]})})}var $W=zH(QW);GR.error014();function eG({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,Z.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:cN([`react-flow__background-pattern`,n,r])})}function tG({radius:e,className:t}){return(0,Z.jsx)(`circle`,{cx:e,cy:e,r:e,className:cN([`react-flow__background-pattern`,`dots`,t])})}var nG;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(nG||={});var rG={[nG.Dots]:1,[nG.Lines]:1,[nG.Cross]:6},iG=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function aG({id:e,variant:t=nG.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,y.useRef)(null),{transform:f,patternId:p}=JV(iG,WV),m=r||rG[t],h=t===nG.Dots,g=t===nG.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],b=m*f[2],x=Array.isArray(a)?a:[a,a],S=g?[b,b]:v,C=[x[0]*f[2]+S[0]/2,x[1]*f[2]+S[1]/2],w=`${p}${e||``}`;return(0,Z.jsxs)(`svg`,{className:cN([`react-flow__background`,l]),style:{...c,...QH,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,Z.jsx)(`pattern`,{id:w,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${C[0]},-${C[1]})`,children:h?(0,Z.jsx)(tG,{radius:b/2,className:u}):(0,Z.jsx)(eG,{dimensions:S,lineWidth:i,variant:t,className:u})}),(0,Z.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}aG.displayName=`Background`,(0,y.memo)(aG);function oG(){return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,Z.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function sG(){return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,Z.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function cG(){return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,Z.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function lG(){return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,Z.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function uG(){return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,Z.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function dG({children:e,className:t,...n}){return(0,Z.jsx)(`button`,{type:`button`,className:cN([`react-flow__controls-button`,t]),...n,children:e})}var fG=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function pG({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=YV(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=JV(fG,WV),{zoomIn:y,zoomOut:b,fitView:x}=qH();return(0,Z.jsxs)(aH,{className:cN([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(dG,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,Z.jsx)(oG,{})}),(0,Z.jsx)(dG,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,Z.jsx)(sG,{})})]}),n&&(0,Z.jsx)(dG,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,Z.jsx)(cG,{})}),r&&(0,Z.jsx)(dG,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,Z.jsx)(uG,{}):(0,Z.jsx)(lG,{})}),u]})}pG.displayName=`Controls`,(0,y.memo)(pG);function mG({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,Z.jsx)(`rect`,{className:cN([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var hG=(0,y.memo)(mG),gG=e=>e.nodes.map(e=>e.id),_G=e=>e instanceof Function?e:()=>e;function vG({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=hG,onClick:o}){let s=JV(gG,WV),c=_G(t),l=_G(e),u=_G(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,Z.jsx)(Z.Fragment,{children:s.map(e=>(0,Z.jsx)(bG,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function yG({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=JV(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=Bz(r);return{node:r,x:i,y:a,width:o,height:s}},WV);return!l||l.hidden||!Vz(l)?null:(0,Z.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var bG=(0,y.memo)(yG),xG=(0,y.memo)(vG),SG=200,CG=150,wG=e=>!e.hidden,TG=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?Tz(cz(e.nodeLookup,{filter:wG}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},EG=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,DG=(e,t)=>EG(e.viewBB,t.viewBB)&&EG(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,OG=`react-flow__minimap-desc`;function kG({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:b=1,offsetScale:x=5}){let S=YV(),C=(0,y.useRef)(null),{boundingRect:w,panZoom:T,viewBB:E,rfId:D,translateExtent:ee,flowWidth:O,flowHeight:k,ariaLabelConfig:A}=JV(TG,DG),te=e?.width??SG,ne=e?.height??CG,re=w.width/te,ie=w.height/ne,ae=Math.max(re,ie),oe=ae*te,se=ae*ne,ce=x*ae,j=w.x-(oe-w.width)/2-ce,le=w.y-(se-w.height)/2-ce,ue=oe+ce*2,de=se+ce*2,fe=`${OG}-${D}`,pe=(0,y.useRef)(0),me=(0,y.useRef)();pe.current=ae,(0,y.useEffect)(()=>{let e=S.getState().panZoom;if(C.current&&e)return me.current=aV({domNode:C.current,panZoom:e,getTransform:()=>S.getState().transform,getViewScale:()=>pe.current}),()=>{me.current?.destroy()}},[T]),(0,y.useEffect)(()=>{me.current?.update({translateExtent:ee,width:O,height:k,inversePan:v,pannable:h,zoomStep:b,zoomable:g})},[h,g,v,b,ee,O,k]);let he=p?e=>{let[t,n]=me.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,ge=(0,y.useCallback)((e,t)=>{let n=S.getState().nodeLookup.get(t).internals.userNode;m?.(e,n)},[m]),_e=m?ge:void 0,ve=_??A[`minimap.ariaLabel`];return(0,Z.jsx)(aH,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*ae:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:cN([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,Z.jsxs)(`svg`,{width:te,height:ne,viewBox:`${j} ${le} ${ue} ${de}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":fe,ref:C,onClick:he,children:[ve&&(0,Z.jsx)(`title`,{id:fe,children:ve}),(0,Z.jsx)(xG,{onClick:_e,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,Z.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${j-ce},${le-ce}h${ue+ce*2}v${de+ce*2}h${-ue-ce*2}z
|
|
741
|
-
M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}kG.displayName=`MiniMap`,(0,y.memo)(kG);var AG=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,jG={[bV.Line]:`right`,[bV.Handle]:`bottom-right`};function MG({nodeId:e,position:t,variant:n=bV.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=fU(),b=typeof e==`string`?e:v,x=YV(),S=(0,y.useRef)(null),C=n===bV.Handle,w=JV((0,y.useCallback)(AG(C&&p),[C,p]),WV),T=(0,y.useRef)(null),E=t??jG[n];(0,y.useEffect)(()=>{if(S.current&&b)return T.current||=jV({domNode:S.current,nodeId:b,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=x.getState(),o=[],s={x:e.x,y:e.y},c=r.get(b);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=RB([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...Hz({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:b,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:b,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:b,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,h,g,_,m]);let D=E.split(`-`);return(0,Z.jsx)(`div`,{className:cN([`react-flow__resize-control`,`nodrag`,...D,n,r]),ref:S,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}(0,y.memo)(MG);function NG(e){switch(e.type){case`page`:return X_;case`agent`:return i_;case`generate`:return e.asset===`image`?W_:e.asset===`video`?Qv:e.asset===`dashboard`?K_:O_;case`widget`:return Wg;case`review`:return w_;case`result`:return M_}return ey}var PG={page:`bg-cobalt-tint text-cobalt`,agent:`bg-ember-tint text-ember-strong`,generate:`bg-amber-tint text-ink-2`,widget:`bg-ember-veil text-ember-strong`,review:`bg-moss-tint text-moss`,result:`bg-paper-2 text-ink-2`};function FG(e){return Q(`type.${e.type}`)}var IG=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`];function LG(e){return IG.includes(e)?Q(`tool.${e}`):e}function RG(e){switch(e.type){case`page`:return e.fields.map(e=>e.label).join(` · `);case`agent`:{let t=e.tools.map(LG),n=e.mcp?.length?[`MCP: ${e.mcp.join(`, `)}`]:[];return[...t,...n].join(` · `)||e.instructions.slice(0,90)}case`generate`:{let t=[e.asset];return e.options?.aspectRatio&&t.push(e.options.aspectRatio),e.options?.duration&&t.push(`${e.options.duration}s`),e.options?.resolution&&t.push(e.options.resolution),e.options?.template&&t.push(e.options.template),t.join(` · `)}case`widget`:return[e.entry,Object.keys(e.data).join(`, `)].filter(Boolean).join(` · `);case`review`:return[e.edit?Q(`editor.reviewEditable`):null,e.regenerate?Q(`editor.reviewRedo`):null].filter(Boolean).join(` · `);case`result`:return e.deliverables.map(e=>`${e.label??e.from} (${e.formats.join(`, `)})`).join(` · `)}return``}var zG=280,BG=92;function VG({data:e}){let{step:t,selected:n,issue:r,active:i,pulse:a,cost:o,passed:s}=e,c=NG(t);return(0,Z.jsxs)(`div`,{className:$(`relative w-[280px] cursor-pointer rounded-xl bg-card px-4 py-3 text-left shadow-soft ring-1 transition`,n?`shadow-elevated ring-2 ring-ember`:i?`ring-2 ring-moss`:a?`ring-2 ring-ember/60`:`ring-border-soft hover:shadow-elevated`),children:[i?(0,Z.jsx)(`span`,{className:`-top-1 -right-1 absolute size-3 animate-breathe rounded-full bg-moss`}):a?(0,Z.jsx)(`span`,{className:`-top-1 -right-1 absolute size-3 animate-breathe rounded-full bg-ember`}):null,(0,Z.jsx)(bU,{type:`target`,position:tz.Top}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:$(`inline-flex size-6 items-center justify-center rounded-md`,PG[t.type]),children:(0,Z.jsx)(c,{className:`size-3.5`})}),(0,Z.jsx)(`span`,{className:`font-medium text-[0.6875rem] text-ink-3 uppercase tracking-[0.07em]`,children:FG(t)}),r?(0,Z.jsx)(u_,{className:`ml-auto size-4 text-rose`}):s&&!i?(0,Z.jsx)(c_,{className:`ml-auto size-4 text-moss`}):o===null?null:(0,Z.jsxs)(`span`,{className:`ml-auto text-[0.6875rem] text-ink-3 tabular-nums`,children:[`≈`,` `,o<10?o.toLocaleString(void 0,{maximumFractionDigits:1}):Math.round(o),` `,`cr`]})]}),(0,Z.jsx)(`div`,{className:`mt-1.5 truncate font-display font-semibold text-[0.9375rem] text-ink`,children:t.title}),(0,Z.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:RG(t)||`\xA0`}),(0,Z.jsx)(bU,{type:`source`,position:tz.Bottom})]})}function HG({data:e}){return(0,Z.jsxs)(`div`,{className:$(`flex w-[280px] cursor-pointer items-center gap-3 rounded-full bg-paper-2 py-1.5 pr-5 pl-2 transition`,e.selected?`ring-2 ring-ember`:`hover:bg-paper-3`),children:[(0,Z.jsx)(kS,{kind:e.avatar,size:40,interactive:!1}),(0,Z.jsx)(`span`,{className:`truncate font-display font-semibold text-[0.9375rem]`,children:e.title}),(0,Z.jsx)(bU,{type:`source`,position:tz.Bottom})]})}function UG(e){let{data:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s}=e,c={label:e.label,labelStyle:e.labelStyle,labelBgStyle:e.labelBgStyle,labelBgPadding:e.labelBgPadding,labelBgBorderRadius:e.labelBgBorderRadius,style:e.style,markerEnd:e.markerEnd};if(!t?.points.length){let[e,t,l]=iB({sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s});return(0,Z.jsx)(eW,{path:e,labelX:t,labelY:l,...c})}let l=[{x:n,y:r},...t.points,{x:i,y:a}],u=l.map((e,t)=>{let n=l[t-1];if(!n)return`M ${e.x} ${e.y}`;let r=(n.y+e.y)/2;return`C ${n.x} ${r} ${e.x} ${r} ${e.x} ${e.y}`}).join(` `);return(0,Z.jsx)(eW,{path:u,labelX:t.labelX,labelY:t.labelY,...c})}var WG={step:VG,start:HG},GG={branch:UG},KG=34,qG={};function JG(e){let t=Array.isArray(e.when.value)?e.when.value.join(` / `):String(e.when.value??``);switch(e.when.op){case`equals`:return`${e.when.field} = ${t}`;case`notEquals`:return`${e.when.field} ≠ ${t}`;case`in`:return`${e.when.field} ∈ ${t}`;case`notEmpty`:return Q(`editor.whenFilled`,{field:e.when.field});case`empty`:return Q(`editor.whenEmpty`,{field:e.when.field})}}function YG(e,t,n,r,i,a,o){let s=new sN.graphlib.Graph;s.setGraph({rankdir:`TB`,nodesep:48,ranksep:46,marginx:20,marginy:20}),s.setDefaultEdgeLabel(()=>({})),s.setNode(`__start`,{width:zG,height:52});for(let t of e.steps)s.setNode(t.id,{width:zG,height:BG});let c=[],l={markerEnd:{type:ez.ArrowClosed,width:14,height:14,color:`var(--ink-4)`}};e.steps[0]&&(s.setEdge(`__start`,e.steps[0].id),c.push({id:`e-start`,source:`__start`,target:e.steps[0].id,...l})),e.steps.forEach((t,n)=>{let r=e.steps[n+1],i=new Map;for(let n of t.next??[])n.goto!==`end`&&e.steps.some(e=>e.id===n.goto)&&i.set(n.goto,[...i.get(n.goto)??[],JG(n)]);for(let[e,n]of i){let r=n.join(` · `),i=r.length>KG?`${r.slice(0,33)}…`:r;s.setEdge(t.id,e,{width:i.length*6.2+16,height:22,labelpos:`c`}),c.push({id:`b-${t.id}-${e}`,type:`branch`,source:t.id,target:e,label:i,labelStyle:{fontSize:11,fill:`var(--ink-2)`},labelBgStyle:{fill:`var(--paper-2)`},labelBgPadding:[6,3],labelBgBorderRadius:8,style:{strokeDasharray:`5 4`},...l})}r&&t.type!==`result`&&(s.hasEdge(t.id,r.id)||s.setEdge(t.id,r.id),c.push({id:`n-${t.id}`,source:t.id,target:r.id,...t.next?.length?{label:Q(`editor.otherwise`),labelStyle:{fontSize:11,fill:`var(--ink-3)`},labelBgStyle:{fill:`var(--background)`}}:{},...l}))}),sN.layout(s);for(let e of c){if(e.type!==`branch`)continue;let t=s.edge(e.source,e.target),n=(t.points??[]).slice(1,-1);n.length&&t.x!==void 0&&t.y!==void 0&&(e.data={points:n,labelX:t.x,labelY:t.y})}return{nodes:[{id:`__start`,type:`start`,position:{x:s.node(`__start`).x-zG/2,y:s.node(`__start`).y-26},data:{title:e.title,avatar:e.avatar,selected:t===`__wizard`},draggable:!1},...e.steps.map((e,c)=>{let l=s.node(e.id);return{id:e.id,type:`step`,position:{x:l.x-zG/2,y:l.y-BG/2},data:{step:e,selected:t===e.id,issue:n.has(e.id),index:c,active:r===e.id,pulse:i.includes(e.id),cost:a[e.id]?.credits??null,passed:o.has(e.id)},draggable:!1}})],edges:c}}function XG(){let e=qH(),t=`inline-flex size-8 items-center justify-center rounded-full text-ink-3 hover:bg-accent hover:text-ink`;return(0,Z.jsxs)(`div`,{className:`absolute bottom-4 left-4 z-10 flex items-center gap-0.5 rounded-full bg-card p-1 shadow-soft ring-1 ring-border-soft`,children:[(0,Z.jsx)(`button`,{type:`button`,className:t,onClick:()=>e.zoomOut(),"aria-label":`Zoom out`,children:(0,Z.jsx)(fv,{className:`size-4`})}),(0,Z.jsx)(`button`,{type:`button`,className:t,onClick:()=>e.fitView({padding:.2,duration:300}),"aria-label":`Fit`,children:(0,Z.jsx)(Av,{className:`size-4`})}),(0,Z.jsx)(`button`,{type:`button`,className:t,onClick:()=>e.zoomIn(),"aria-label":`Zoom in`,children:(0,Z.jsx)(Sv,{className:`size-4`})})]})}var ZG=.8,QG=new Set;function $G({def:e,selected:t,onSelect:n,issueSteps:r,activeStep:i,pulse:a,costs:o=qG,passed:s=QG,minFitZoom:c=ZG,fitKey:l}){let{nodes:u,edges:d}=(0,y.useMemo)(()=>YG(e,t,r,i,a??[],o,s),[e,t,r,i,a,o,s]),f=qH(),p=(0,y.useRef)(null),m=e.steps.map(e=>e.id).join(`|`);return(0,y.useEffect)(()=>{let e=requestAnimationFrame(()=>{let e=p.current;if(!e||!u.length)return;let t=u.map(e=>e.position.x),n=u.map(e=>e.position.y),r={x:Math.min(...t),y:Math.min(...n),width:Math.max(...t)+zG-Math.min(...t),height:Math.max(...n)+BG-Math.min(...n)},i=Math.min(e.clientWidth/(r.width*1.2),e.clientHeight/(r.height*1.15),1),a=Math.max(i,c),o=(e.clientWidth-r.width*a)/2-r.x*a,s=i>=c?(e.clientHeight-r.height*a)/2-r.y*a:24-r.y*a;f.setViewport({x:o,y:s,zoom:a},{duration:400})});return()=>cancelAnimationFrame(e)},[m,l,f]),(0,Z.jsx)(`div`,{ref:p,className:`h-full w-full`,children:(0,Z.jsx)($W,{nodes:u,edges:d,nodeTypes:WG,edgeTypes:GG,onNodeClick:(e,t)=>n(t.id===`__start`?`__wizard`:t.id),onPaneClick:()=>n(null),nodesConnectable:!1,nodesDraggable:!1,elementsSelectable:!1,panOnScroll:!0,zoomOnScroll:!1,zoomOnPinch:!0,minZoom:.3,maxZoom:1.4,proOptions:{hideAttribution:!0},children:(0,Z.jsx)(XG,{})})})}function eK(e){return(0,Z.jsx)(YW,{children:(0,Z.jsx)($G,{...e})})}var tK=`engenty/flow`,nK=new Set([`text`,`textarea`,`number`,`select`,`multiselect`,`date`,`email`,`url`,`toggle`,`color`,`location`]),rK=420,iK=600,aK=320,oK=new Set;function sK(e){if(e.structuredContent)return e.structuredContent;let t=e.content?.find(e=>e.type===`text`);try{return t&&`text`in t?JSON.parse(t.text):null}catch{return t&&`text`in t?t.text:null}}function cK(e){let t=sK(e);if(e.isError){let e=t&&typeof t==`object`&&`error`in t?String(t.error):String(t);throw Object.assign(Error(e),{body:t})}return t}function lK(e){e&&(e.theme&&document.documentElement.classList.toggle(`dark`,e.theme===`dark`),e.locale&&gb(e.locale.toLowerCase().startsWith(`de`)?`de`:`en`))}function uK(){let e=(0,y.useMemo)(()=>new kg({name:`engenty-wizards-flow`,version:`1.0.0`},{},{autoResize:!0}),[]),[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(`asking`);(0,y.useEffect)(()=>{e.ontoolresult=e=>{let t=e._meta?.[tK];t&&(n(t),i(t.run??null))},e.onhostcontextchanged=e=>{o(t=>({...t,...e})),lK(e)},e.connect().then(()=>{let t=e.getHostContext();o(t),lK(t)}).catch(e=>console.error(`[flow widget]`,e))},[e]);let d=(0,y.useCallback)(async(t,n)=>cK(await e.callServerTool({name:t,arguments:n})),[e]),f=(0,y.useCallback)(t=>{let n=t.outputs.map(e=>e.title).join(`, `),r=[`engenty wizards run ${t.runId}: ${t.status}${t.step?` at "${t.step.title}"`:``}.`,n?`Made so far: ${n}.`:``,t.status===`done`?`The person finished it in the widget; get_run has the outputs and download links.`:`The person answers this run in the widget; get_run has the details.`].filter(Boolean).join(` `);e.updateModelContext({content:[{type:`text`,text:r}]}).catch(()=>void 0)},[e]),p=(0,y.useRef)(``),m=(0,y.useCallback)(t=>{let n=t?`${t.status}:${t.step?.id??``}`:``;if(!t||n===p.current)return;p.current=n;let r=[`engenty wizards run ${t.id}: ${t.status}${t.step?` at "${t.step.title}"`:``}.`,t.status===`done`?`The person finished it in the widget; get_run has the outputs and download links.`:`The person answers this run in the widget; get_run has the details.`].join(` `);e.updateModelContext({content:[{type:`text`,text:r}]}).catch(()=>void 0)},[e]),h=(0,y.useRef)(null),g=(0,y.useRef)(``),_=(0,y.useCallback)(e=>{m(e);let t=e?`${e.status}:${e.step?.id??``}`:``;t!==g.current&&(g.current=t,h.current?.scrollTo({top:0}))},[m]),v=r?.runId,b=t?.runtime;(0,y.useEffect)(()=>{if(!v||!b){u(`no`);return}MS(b),u(`asking`);let e=!0;return fetch(NS(`/api/runs/${v}`),{credentials:`include`}).then(t=>e&&u(t.ok?`yes`:`no`)).catch(()=>e&&u(`no`)),()=>{e=!1}},[v,b]);let x=(0,y.useCallback)(async t=>{let r=await e.callServerTool({name:`run_wizard`,arguments:{wizardId:t}});cK(r);let a=r._meta?.[tK];a&&(n(a),i(a.run??null))},[e]),S=r?.status===`running`;(0,y.useEffect)(()=>{if(!v||!S||l!==`no`)return;let e=!0;return(async()=>{for(;e;)try{let t=await d(`get_run`,{runId:v,waitSeconds:20});if(!e)return;if(i(t),t.status!==`running`){f(t);return}}catch{await new Promise(e=>setTimeout(e,3e3))}})(),()=>{e=!1}},[v,S,l,d,f]);let C=(0,y.useMemo)(()=>new Set(r?.passed??[]),[r]),w=a?.displayMode===`fullscreen`,T=a?.availableDisplayModes?.includes(`fullscreen`),E=t=>{e.openLink({url:t}).catch(()=>window.open(t,`_blank`,`noopener`))};if(!t||r&&l===`asking`)return(0,Z.jsxs)(`div`,{className:`flex items-center justify-center gap-2 text-ink-3 text-sm`,style:{height:160},children:[(0,Z.jsx)(Bb,{className:`size-4`}),Q(`flowApp.loading`)]});if(r&&l===`yes`)return(0,Z.jsx)(`div`,{ref:h,className:`overflow-y-auto overscroll-contain bg-background text-ink`,style:{maxHeight:iK},children:(0,Z.jsx)(Sk,{runId:r.runId,compact:!0,stickyProgress:!0,onView:_})});if(!r)return(0,Z.jsx)(dK,{view:t,onStart:()=>x(t.wizard.id)});let D=r&&r.status!==`done`?r.step?.id??null:null;return(0,Z.jsxs)(`div`,{className:$(`flex bg-background text-ink`,w?`h-screen flex-row`:`flex-col`),children:[(0,Z.jsx)(`div`,{className:$(`relative min-w-0`,w?`flex-1`:``),style:w?void 0:{height:aK},children:(0,Z.jsx)(eK,{def:t.definition,selected:s,onSelect:c,issueSteps:oK,activeStep:D,passed:C,minFitZoom:.45,fitKey:String(w)})}),(0,Z.jsxs)(`aside`,{className:$(`flex flex-col gap-3 border-border-soft bg-card p-4`,w?`w-[380px] overflow-y-auto border-l`:`border-t`),children:[(0,Z.jsxs)(`header`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate font-display font-semibold text-[0.9375rem]`,children:t.wizard.title}),(0,Z.jsx)(Hb,{children:t.wizard.shows===`published`?Q(`flowApp.published`):Q(`flowApp.draft`)}),t.wizard.issues?(0,Z.jsx)(`span`,{className:`text-[0.75rem] text-rose`,children:Q(`flowApp.issues`,{n:t.wizard.issues})}):null,(0,Z.jsx)(`span`,{className:`ml-auto flex items-center gap-1`,children:T?(0,Z.jsxs)(kb,{size:`sm`,variant:`ghost`,onClick:()=>e.requestDisplayMode({mode:w?`inline`:`fullscreen`}).then(({mode:e})=>o(t=>({...t,displayMode:e}))).catch(()=>void 0),children:[w?(0,Z.jsx)(uv,{className:`size-4`}):(0,Z.jsx)(ov,{className:`size-4`}),Q(w?`flowApp.inline`:`flowApp.fullscreen`)]}):null})]}),(0,Z.jsx)(fK,{report:r,selected:s,call:d,onReport:e=>{i(e),f(e)},open:E})]})]})}function dK({view:e,onStart:t}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1),c=e.wizard.description??e.definition.description;return(0,Z.jsxs)(`div`,{className:`flex flex-col overflow-y-auto overscroll-contain bg-background text-ink`,style:{maxHeight:iK},children:[(0,Z.jsxs)(`div`,{className:`mx-auto flex max-w-lg flex-col items-center px-6 pt-6 pb-6 text-center`,children:[(0,Z.jsx)(kS,{kind:e.wizard.avatar??e.definition.avatar,size:120,fluffy:!0}),(0,Z.jsx)(`h1`,{className:`mt-2 text-balance font-display font-semibold text-[1.625rem] leading-[1.1] tracking-tight`,children:e.wizard.title}),c?(0,Z.jsx)(`p`,{className:`mt-3 text-[0.9375rem] text-ink-2 leading-relaxed`,children:c}):null,e.wizard.published?(0,Z.jsxs)(kb,{size:`lg`,className:`mt-8 min-w-48`,busy:n,onClick:async()=>{r(!0),a(null);try{await t()}catch(e){a(e.message),r(!1)}},children:[Q(`run.start`),` `,(0,Z.jsx)(Xg,{className:`size-4`})]}):(0,Z.jsx)(`p`,{className:`mt-8 rounded-xl bg-paper-2 px-5 py-4 text-[0.875rem] text-ink-2`,children:Q(`flowApp.notPublished`)}),i?(0,Z.jsx)(`p`,{className:`mt-4 text-[0.875rem] text-rose`,children:i}):null,(0,Z.jsxs)(kb,{size:`sm`,variant:`ghost`,className:`mt-4`,onClick:()=>s(!o),children:[(0,Z.jsx)(ny,{className:`size-4`}),Q(`flowApp.flow`)]})]}),o?(0,Z.jsx)(`div`,{className:`relative border-border-soft border-t`,style:{height:rK},children:(0,Z.jsx)(eK,{def:e.definition,selected:null,onSelect:()=>void 0,issueSteps:oK,activeStep:null,minFitZoom:.45})}):null]})}function fK({report:e,selected:t,call:n,onReport:r,open:i}){let[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null),l=async(t,i)=>{o(!0),c(null);try{r(await n(t,{runId:e.runId,...i}))}catch(e){c(e.message)}finally{o(!1)}},u=e.waitingFor,d=t?e.outputs.filter(e=>e.stepId===t):[],f=e.events.at(-1),p=e.browserUrl,m=p?()=>i(p):void 0,h=null;return e.status===`running`&&!(u&&`ask`in u)?h=(0,Z.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.8125rem] text-ink-2`,children:[(0,Z.jsx)(Bb,{className:`size-4`}),f&&_b(f)||Q(`run.working`)]}):u&&`page`in u?h=(0,Z.jsx)(mK,{fields:u.fields,busy:a,onSubmit:e=>l(`answer_page`,{stepId:u.page,values:e,waitSeconds:3}),onBrowser:m},`${e.runId}-${u.page}`):u&&`review`in u?h=(0,Z.jsx)(gK,{outputs:e.outputs.filter(e=>u.show.includes(e.stepId)),targets:u.show,busy:a,onAccept:()=>l(`review_step`,{stepId:u.review,action:{type:`accept`}}),onRegenerate:(e,t)=>l(`review_step`,{stepId:u.review,action:{type:`regenerate`,target:e,note:t}}),open:i}):u&&`ask`in u?h=u.kind===`confirm`?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`font-medium text-[0.8125rem]`,children:Q(`flowApp.ask`)}),(0,Z.jsxs)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:[u.reason,` — `,u.service,`: `,u.action]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(kb,{size:`sm`,busy:a,onClick:()=>l(`answer_ask`,{askId:u.ask,answer:`allow`}),children:Q(`flowApp.allow`)}),(0,Z.jsx)(kb,{size:`sm`,variant:`ghost`,disabled:a,onClick:()=>l(`answer_ask`,{askId:u.ask,answer:`skip`}),children:Q(`flowApp.skip`)})]})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:Q(`flowApp.signIn`,{site:u.site})}),m?(0,Z.jsxs)(kb,{size:`sm`,onClick:m,children:[(0,Z.jsx)(S_,{className:`size-4`}),Q(`flowApp.runPage`)]}):null]}):e.status===`failed`?h=(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:e.error||Q(`run.failed`)}),(0,Z.jsx)(kb,{size:`sm`,busy:a,onClick:()=>l(`control_run`,{action:`retry`}),children:Q(`run.retry`)})]}):e.status===`cancelled`?h=(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:Q(`run.cancelled`)}):e.status===`done`&&(h=(0,Z.jsx)(_K,{outputs:e.outputs,open:i})),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-[0.75rem] text-ink-3`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-ink-2`,children:e.status===`done`?Q(`flowApp.done`):e.step?.title}),(0,Z.jsxs)(`span`,{children:[`· `,Q(`flowApp.credits`,{n:e.credits})]}),(0,Z.jsxs)(`span`,{className:`ml-auto flex gap-1`,children:[e.status===`waiting_input`&&e.passed.length?(0,Z.jsxs)(kb,{size:`sm`,variant:`ghost`,disabled:a,onClick:()=>l(`control_run`,{action:`back`}),children:[(0,Z.jsx)(Jv,{className:`size-4`}),Q(`run.back`)]}):null,m?(0,Z.jsxs)(kb,{size:`sm`,variant:`ghost`,onClick:m,children:[(0,Z.jsx)(S_,{className:`size-4`}),Q(`flowApp.runPage`)]}):null]})]}),h,s?(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:Q(`flowApp.failed`,{error:s})}):null,d.length&&e.status!==`done`?(0,Z.jsx)(_K,{outputs:d,open:i}):null]})}function pK(e){return e.value??e.default??(e.kind===`multiselect`?[]:e.kind!==`toggle`&&``)}function mK({fields:e,busy:t,onSubmit:n,onBrowser:r}){let i=e.filter(e=>nK.has(e.kind)),a=e.filter(e=>!nK.has(e.kind)),[o,s]=(0,y.useState)(()=>Object.fromEntries(i.map(e=>[e.id,pK(e)]))),c=(e,t)=>s(n=>({...n,[e]:t})),l=i.some(e=>{let t=o[e.id];return e.required&&(t===``||t===void 0||Array.isArray(t)&&!t.length)});return a.some(e=>e.required)?(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:Q(`flowApp.inBrowser`,{fields:a.map(e=>e.label).join(`, `)})}),r?(0,Z.jsxs)(kb,{size:`sm`,onClick:r,children:[(0,Z.jsx)(S_,{className:`size-4`}),Q(`flowApp.runPage`)]}):null]}):(0,Z.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault();let t={};for(let e of i){let n=o[e.id];n!==``&&n!==void 0&&(t[e.id]=e.kind===`number`?Number(n):e.kind===`location`?{label:String(n)}:n)}n(t)},children:[i.map(e=>(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(zb,{required:e.required,hint:e.help,children:e.label}),(0,Z.jsx)(`div`,{className:`mt-1.5`,children:(0,Z.jsx)(hK,{field:e,value:o[e.id],onChange:t=>c(e.id,t)})})]},e.id)),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(kb,{type:`submit`,busy:t,disabled:l,children:Q(`run.next`)}),a.length?(0,Z.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:Q(`flowApp.inBrowser`,{fields:a.map(e=>e.label).join(`, `)})}):null]})]})}function hK({field:e,value:t,onChange:n}){let r=typeof t==`string`||typeof t==`number`?String(t):``;switch(e.kind){case`textarea`:return(0,Z.jsx)(Fb,{value:r,rows:4,placeholder:e.placeholder,onChange:e=>n(e.target.value)});case`select`:return(0,Z.jsx)(Ib,{value:r,onChange:n,placeholder:``,options:(e.options??[]).map(e=>({value:e,label:e}))});case`multiselect`:return(0,Z.jsx)(Lb,{multi:!0,value:Array.isArray(t)?t:[],onChange:n,options:e.options??[]});case`toggle`:return(0,Z.jsx)(Rb,{checked:t===!0,onChange:n});case`location`:return(0,Z.jsx)(Nb,{value:t&&typeof t==`object`&&`label`in t?String(t.label??``):r,placeholder:e.placeholder,onChange:e=>n(e.target.value)});default:return(0,Z.jsx)(Nb,{type:e.kind===`number`?`number`:e.kind===`date`?`date`:e.kind===`email`?`email`:e.kind===`url`?`url`:e.kind===`color`?`color`:`text`,value:r,placeholder:e.placeholder,onChange:e=>n(e.target.value)})}}function gK({outputs:e,targets:t,busy:n,onAccept:r,onRegenerate:i,open:a}){let[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(t[0]??``);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(_K,{outputs:e,open:a}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[t.length>1?(0,Z.jsx)(Ib,{value:c,onChange:l,options:e.map(e=>({value:e.stepId,label:e.title}))}):null,(0,Z.jsx)(Fb,{rows:2,value:o,placeholder:Q(`run.regenerateNote`),onChange:e=>s(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(kb,{busy:n,onClick:r,children:Q(`run.accept`)}),(0,Z.jsx)(kb,{variant:`ghost`,disabled:n||!o.trim()||!c,onClick:()=>i(c,o.trim()),children:Q(`run.regenerateGo`)})]})]})]})}function _K({outputs:e,open:t}){return(0,Z.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map(e=>(0,Z.jsxs)(`section`,{className:`rounded-xl bg-paper-2 p-3`,children:[(0,Z.jsx)(`div`,{className:`mb-1.5 font-medium text-[0.8125rem] text-ink-2`,children:e.title}),e.text?(0,Z.jsx)(DE,{text:e.text,className:`text-[0.8125rem]`}):null,e.assets.filter(e=>e.mime.startsWith(`image/`)).map(e=>(0,Z.jsx)(`img`,{src:e.url,alt:e.name,className:`mt-2 max-h-64 rounded-lg`},e.url)),Object.keys(e.downloads).length?(0,Z.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:Object.entries(e.downloads).map(([e,n])=>(0,Z.jsxs)(kb,{size:`sm`,variant:`secondary`,onClick:()=>t(n),children:[(0,Z.jsx)(v_,{className:`size-4`}),e.toUpperCase()]},e))}):null]},e.stepId))})}(0,b.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(y.StrictMode,{children:(0,Z.jsx)(uK,{})}));</script>
|
|
740
|
+
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,y.useEffect)(()=>{let n=t?.target??DH,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&nB(e))return!1;let n=AH(e.code,s);if(a.current.add(e[n]),kH(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=AH(e.code,s);kH(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function kH(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function AH(e,t){return t.includes(e)?`code`:`key`}var jH=()=>{let e=eH();return(0,y.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=Hz(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return Lz(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=Rz(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function MH(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)NH(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function NH(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing)}}function PH(e,t){return MH(e,t)}function FH(e,t){return MH(e,t)}function IH(e,t){return{id:e,type:`select`,selected:t}}function LH(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);(a.selected!==void 0||e)&&a.selected!==e&&(n&&(a.selected=e),r.push(IH(a.id,e)))}return r}function RH({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function zH(e){return{id:e.id,type:`remove`}}var BH=Fz(`React Flow`,`https://reactflow.dev/`);function VH(e,t,n={}){return hB(e,t,{...n,onError:n.onError??BH})}var HH=e=>lz(e),UH=e=>cz(e);function WH(e){return(0,y.forwardRef)(e)}var GH=typeof window<`u`?y.useLayoutEffect:y.useEffect;function KH(e){let[t,n]=(0,y.useState)(BigInt(0)),[r]=(0,y.useState)(()=>qH(()=>n(e=>e+BigInt(1))));return GH(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function qH(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var JH=(0,y.createContext)(null);function YH({children:e}){let t=eH(),n=KH((0,y.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=RH({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=KH((0,y.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(RH({items:s,lookup:o}))},[])),i=(0,y.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,Z.jsx)(JH.Provider,{value:i,children:e})}function XH(){let e=(0,y.useContext)(JH);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var ZH=e=>!!e.panZoom;function QH(){let e=jH(),t=eH(),n=XH(),r=$V(ZH),i=(0,y.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=HH(e)?e:n.get(e.id),a=i.parentId?qz(i.position,i.measured,i.parentId,n,r):i.position;return Oz({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&HH(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&UH(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await yz({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(zH);o?.(f),c(e)}if(m){let e=d.map(zH);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=Nz(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=Oz(s?r:a),l=Mz(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=Nz(e)?e:a(e);if(!r)return!1;let i=Mz(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return fz(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??Yz();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,y.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var $H=e=>e.selected,eU=typeof window<`u`?window:void 0;function tU({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=eH(),{deleteElements:r}=QH(),i=OH(e,{actInsideInputWithModifier:!1}),a=OH(t,{target:eU});(0,y.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter($H),edges:e.filter($H)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,y.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function nU(e){let t=eH();(0,y.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=$z(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,XR.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var rU={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},iU=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function aU({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=tz.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:g,noPanClassName:_,onViewportChange:v,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:S}){let C=eH(),w=(0,y.useRef)(null),{userSelectionActive:T,lib:E,connectionInProgress:D}=$V(iU,YV),ee=OH(p),O=(0,y.useRef)();nU(w);let k=(0,y.useCallback)(e=>{v?.({x:e[0],y:e[1],zoom:e[2]}),b||C.setState({transform:e})},[v,b]);return(0,y.useEffect)(()=>{if(w.current){O.current=wV({domNode:w.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>C.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=C.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=C.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=C.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=O.current.getViewport();return C.setState({panZoom:O.current,transform:[e,t,n],domNode:w.current.closest(`.react-flow`)}),()=>{O.current?.destroy()}}},[]),(0,y.useEffect)(()=>{O.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:ee,preventScrolling:m,noPanClassName:_,userSelectionActive:T,noWheelClassName:g,lib:E,onTransformChange:k,connectionInProgress:D,selectionOnDrag:S,paneClickDistance:x})},[e,t,n,r,i,a,o,s,c,ee,m,_,T,g,E,k,D,S,x]),(0,Z.jsx)(`div`,{className:`react-flow__renderer`,ref:w,style:rU,children:h})}var oU=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function sU(){let{userSelectionActive:e,userSelectionRect:t}=$V(oU,YV);return e&&t?(0,Z.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var cU=(e,t)=>n=>{n.target===t.current&&e?.(n)},lU=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function uU({isSelecting:e,selectionKeyPressed:t,selectionMode:n=nz.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,y.useRef)(0),_=eH(),{userSelectionActive:v,elementsSelectable:b,dragging:x,panBy:S,autoPanSpeed:C}=$V(lU,YV),w=b&&(e||v),T=(0,y.useRef)(null),E=(0,y.useRef)(),D=(0,y.useRef)(new Set),ee=(0,y.useRef)(new Set),O=(0,y.useRef)(!1),k=(0,y.useRef)(!1),A=(0,y.useRef)({x:0,y:0}),te=(0,y.useRef)(!1),ne=e=>{if(k.current||O.current||_.getState().connection.inProgress){k.current=!1,O.current=!1;return}l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},re=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},ie=d?e=>d(e):void 0,ae=e=>{k.current&&=(e.stopPropagation(),!1)},oe=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=_.getState();if(E.current=i?.getBoundingClientRect(),!E.current)return;let s=n.target===T.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),k.current=!1;let{x:c,y:l}=iB(n.nativeEvent,E.current),u=Lz({x:c,y:l},a);_.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function se(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=Rz(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=D.current,g=ee.current;D.current=new Set(mz(a,m,i,n===nz.Partial,!0).map(e=>e.id)),ee.current=new Set;let v=u?.selectable??!0;for(let e of D.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&ee.current.add(e)}}Jz(h,D.current)||c(LH(a,D.current,!0)),Jz(g,ee.current)||l(LH(o,ee.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function ce(){if(!i||!E.current)return;let[e,t]=wz(A.current,E.current,C);S({x:e,y:t}).then(e=>{if(!k.current||!e){g.current=requestAnimationFrame(ce);return}let{x:t,y:n}=A.current;se(t,n),g.current=requestAnimationFrame(ce)})}let j=()=>{cancelAnimationFrame(g.current),g.current=0,te.current=!1};(0,y.useEffect)(()=>()=>j(),[]);let le=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!E.current||!n)return;let{x:o,y:c}=iB(e.nativeEvent,E.current);A.current={x:o,y:c};let l=Rz({x:n.startX,y:n.startY},r);if(!k.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}k.current=!0,te.current||=(ce(),!0),se(o,c)},ue=e=>{if(!w){e.target===T.current&&_.getState().connection.inProgress&&(O.current=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===T.current&&_.getState().userSelectionRect&&ne?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(c?.(e),_.setState({nodesSelectionActive:D.current.size>0})),j())},de=e=>{e.target?.releasePointerCapture?.(e.pointerId),j()},fe=r===!0||Array.isArray(r)&&r.includes(0);return(0,Z.jsxs)(`div`,{className:pN([`react-flow__pane`,{draggable:fe,dragging:x,selection:e}]),onClick:w?void 0:cU(ne,T),onContextMenu:cU(re,T),onWheel:cU(ie,T),onPointerEnter:w?void 0:f,onPointerMove:w?le:p,onPointerUp:ue,onPointerCancel:w?de:void 0,onPointerDownCapture:w?oe:void 0,onClickCapture:w?ae:void 0,onPointerLeave:m,ref:T,style:rU,children:[h,(0,Z.jsx)(sU,{})]})}function dU({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,XR.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function fU({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=eH(),[c,l]=(0,y.useState)(!1),u=(0,y.useRef)();return(0,y.useEffect)(()=>{if(!t)return u.current=$B({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{dU({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,y.useEffect)(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var pU=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function mU(){let e=eH();return(0,y.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=pU(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=Iz(t,i));let{position:a,positionAbsolute:s}=vz({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var hU=(0,y.createContext)(null),gU=hU.Provider;hU.Consumer;var _U=()=>(0,y.useContext)(hU),vU=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),yU=(0,y.createContext)(null);function bU({children:e}){let t=$V(vU,YV);return(0,Z.jsx)(yU.Provider,{value:t,children:e})}function xU(){let e=(0,y.useContext)(yU);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var SU={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},CU=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return SU;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===ez.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function wU({type:e=`source`,position:t=oz.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=eH(),_=_U(),{connectOnClick:v,noPanClassName:y,rfId:b}=xU(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=$V(CU(_,m,e),YV);_||g.getState().onError?.(`010`,XR.error010());let ee=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(VH(i,e,{onError:n}))}n?.(i),s?.(i)},O=e=>{if(!_)return;let t=rB(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();lV.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:ee,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,Z.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:pN([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:O,onTouchStart:O,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=eB(t.target),h=n||c,{connection:v,isValid:y}=lV.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&ee(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var TU=(0,y.memo)(WH(wU));function EU({data:e,isConnectable:t,sourcePosition:n=oz.Bottom}){return(0,Z.jsxs)(Z.Fragment,{children:[e?.label,(0,Z.jsx)(TU,{type:`source`,position:n,isConnectable:t})]})}function DU({data:e,isConnectable:t,targetPosition:n=oz.Top,sourcePosition:r=oz.Bottom}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(TU,{type:`target`,position:n,isConnectable:t}),e?.label,(0,Z.jsx)(TU,{type:`source`,position:r,isConnectable:t})]})}function OU(){return null}function kU({data:e,isConnectable:t,targetPosition:n=oz.Top}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(TU,{type:`target`,position:n,isConnectable:t}),e?.label]})}var AU={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},jU={input:EU,default:DU,output:kU,group:OU};function MU(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var NU=e=>{let{width:t,height:n,x:r,y:i}=pz(e.nodeLookup,{filter:e=>!!e.selected});return{width:Pz(t)?t:null,height:Pz(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function PU({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=eH(),{width:i,height:a,transformString:o,userSelectionActive:s}=$V(NU,YV),c=mU(),l=(0,y.useRef)(null);(0,y.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(fU({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,Z.jsx)(`div`,{className:pN([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,Z.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(AU,e.key)&&(e.preventDefault(),c({direction:AU[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var FU=typeof window<`u`?window:void 0,IU=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function LU({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:ee,maxZoom:O,preventScrolling:k,onSelectionContextMenu:A,noWheelClassName:te,noPanClassName:ne,disableKeyboardA11y:re,onViewportChange:ie,isControlledViewport:ae}){let{nodesSelectionActive:oe,userSelectionActive:se}=$V(IU,YV),ce=OH(l,{target:FU}),j=OH(h,{target:FU}),le=j||w,ue=j||b,de=u&&le!==!0,fe=ce||se||de;return tU({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,Z.jsx)(aU,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ue,panActivationKeyPressed:j,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!ce&&le,defaultViewport:E,translateExtent:D,minZoom:ee,maxZoom:O,zoomActivationKeyCode:g,preventScrolling:k,noWheelClassName:te,noPanClassName:ne,onViewportChange:ie,isControlledViewport:ae,paneClickDistance:s,selectionOnDrag:de,children:(0,Z.jsxs)(uU,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:le,autoPanOnSelection:T,isSelecting:!!fe,selectionMode:d,selectionKeyPressed:ce,paneClickDistance:s,selectionOnDrag:de,children:[e,oe&&(0,Z.jsx)(PU,{onSelectionContextMenu:A,noPanClassName:ne,disableKeyboardA11y:re})]})})}LU.displayName=`FlowRenderer`;var RU=(0,y.memo)(LU),zU=e=>t=>e?mz(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function BU(e){return $V((0,y.useCallback)(zU(e),[e]),YV)}var VU=e=>e.updateNodeInternals;function HU(){let e=$V(VU),[t]=(0,y.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,y.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function UU({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=eH(),a=(0,y.useRef)(null),o=(0,y.useRef)(null),s=(0,y.useRef)(e.sourcePosition),c=(0,y.useRef)(e.targetPosition),l=(0,y.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,y.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,y.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,y.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function WU({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=$V(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},YV),S=y.type||`default`,C=g?.[S]||jU[S];C===void 0&&(v?.(`003`,XR.error003(S)),S=`default`,C=g?.default||jU.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),ee=eH(),O=Kz(y),k=UU({node:y,nodeType:S,hasDimensions:O,resizeObserver:d}),A=fU({nodeRef:k,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),te=mU();if(y.hidden)return null;let ne=Gz(y),re=MU(y),ie=T||w||t||n||r||i,ae=n?e=>n(e,{...b.userNode}):void 0,oe=r?e=>r(e,{...b.userNode}):void 0,se=i?e=>i(e,{...b.userNode}):void 0,ce=a?e=>a(e,{...b.userNode}):void 0,j=o?e=>o(e,{...b.userNode}):void 0,le=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=ee.getState();T&&(!r||!w||i>0)&&dU({id:e,store:ee,nodeRef:k}),t&&t(n,{...b.userNode})},ue=t=>{if(!(nB(t.nativeEvent)||m)){if(QR.includes(t.key)&&T){let n=t.key===`Escape`;dU({id:e,store:ee,unselect:n,nodeRef:k})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(AU,t.key)){t.preventDefault();let{ariaLabelConfig:e}=ee.getState();ee.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),te({direction:AU[t.key],factor:t.shiftKey?4:1})}}},de=()=>{if(m||!k.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=ee.getState();i&&(mz(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+ne.width/2,y.position.y+ne.height/2,{zoom:t[2]}))};return(0,Z.jsx)(`div`,{className:pN([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:A}]),ref:k,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:ie?`all`:`none`,visibility:O?`visible`:`hidden`,...y.style,...re},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:ae,onMouseMove:oe,onMouseLeave:se,onContextMenu:ce,onClick:le,onDoubleClick:j,onKeyDown:D?ue:void 0,tabIndex:D?0:void 0,onFocus:D?de:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${rH}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,Z.jsx)(gU,{value:e,children:(0,Z.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:A,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...ne})})})}var GU=(0,y.memo)(WU),KU=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function qU(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=$V(KU,YV),a=BU(e.onlyRenderVisibleElements),o=HU();return(0,Z.jsx)(`div`,{className:`react-flow__nodes`,style:rU,children:a.map(a=>(0,Z.jsx)(GU,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}qU.displayName=`NodeRenderer`;var JU=(0,y.memo)(qU);function YU(e){return $V((0,y.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&fB({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),YV)}var XU=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,Z.jsx)(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},ZU=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,Z.jsx)(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},QU={[az.Arrow]:XU,[az.ArrowClosed]:ZU};function $U(e){let t=eH();return(0,y.useMemo)(()=>Object.prototype.hasOwnProperty.call(QU,e)?QU[e]:(t.getState().onError?.(`009`,XR.error009(e)),null),[e])}var eW=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=$U(t);return c?(0,Z.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,Z.jsx)(c,{color:n,strokeWidth:o})}):null},tW=({defaultColor:e,rfId:t})=>{let n=$V(e=>e.edges),r=$V(e=>e.defaultEdgeOptions),i=(0,y.useMemo)(()=>kB(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,Z.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,Z.jsx)(`defs`,{children:i.map(e=>(0,Z.jsx)(eW,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};tW.displayName=`MarkerDefinitions`;var nW=(0,y.memo)(tW);function rW({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,y.useState)({x:1,y:0,width:0,height:0}),p=pN([`react-flow__edge-textwrapper`,l]),m=(0,y.useRef)(null);return(0,y.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,Z.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,Z.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,Z.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}rW.displayName=`EdgeText`;var iW=(0,y.memo)(rW);function aW({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{...u,d:e,fill:`none`,className:pN([`react-flow__edge-path`,u.className])}),l?(0,Z.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&Pz(t)&&Pz(n)?(0,Z.jsx)(iW,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function oW({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===oz.Left||e===oz.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function sW({sourceX:e,sourceY:t,sourcePosition:n=oz.Bottom,targetX:r,targetY:i,targetPosition:a=oz.Top}){let[o,s]=oW({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=oW({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=oB({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function cW(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=sW({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,Z.jsx)(aW,{id:x,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var lW=cW({isInternal:!1}),uW=cW({isInternal:!0});lW.displayName=`SimpleBezierEdge`,uW.displayName=`SimpleBezierEdgeInternal`;function dW(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=oz.Bottom,targetPosition:m=oz.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=SB({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),S=e.isInternal?void 0:t;return(0,Z.jsx)(aW,{id:S,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var fW=dW({isInternal:!1}),pW=dW({isInternal:!0});fW.displayName=`SmoothStepEdge`,pW.displayName=`SmoothStepEdgeInternal`;function mW(e){return(0,y.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,Z.jsx)(fW,{...n,id:r,pathOptions:(0,y.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var hW=mW({isInternal:!1}),gW=mW({isInternal:!0});hW.displayName=`StepEdge`,gW.displayName=`StepEdgeInternal`;function _W(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=gB({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return(0,Z.jsx)(aW,{id:y,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var vW=_W({isInternal:!1}),yW=_W({isInternal:!0});vW.displayName=`StraightEdge`,yW.displayName=`StraightEdgeInternal`;function bW(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=oz.Bottom,targetPosition:s=oz.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=lB({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return(0,Z.jsx)(aW,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var xW=bW({isInternal:!1}),SW=bW({isInternal:!0});xW.displayName=`BezierEdge`,SW.displayName=`BezierEdgeInternal`;var CW={default:SW,straight:yW,step:gW,smoothstep:pW,simplebezier:uW},wW={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},TW=(e,t,n)=>n===oz.Left?e-t:n===oz.Right?e+t:e,EW=(e,t,n)=>n===oz.Top?e-t:n===oz.Bottom?e+t:e,DW=`react-flow__edgeupdater`;function OW({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,Z.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:pN([DW,`${DW}-${s}`]),cx:TW(t,r,e),cy:EW(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function kW({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=eH(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;lV.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,Z.jsxs)(Z.Fragment,{children:[(e===!0||e===`source`)&&(0,Z.jsx)(OW,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,Z.jsx)(OW,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function AW({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let b=$V(t=>t.edgeLookup.get(e)),x=$V(e=>e.defaultEdgeOptions);b=x?{...x,...b}:b;let S=b.type||`default`,C=h?.[S]||CW[S];C===void 0&&(_?.(`011`,XR.error011(S)),S=`default`,C=h?.default||CW.default);let w=!!(b.focusable||t&&b.focusable===void 0),T=d!==void 0&&(b.reconnectable||n&&b.reconnectable===void 0),E=!!(b.selectable||r&&b.selectable===void 0),D=(0,y.useRef)(null),[ee,O]=(0,y.useState)(!1),[k,A]=(0,y.useState)(!1),te=eH(),{zIndex:ne=b.zIndex,sourceX:re,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce}=$V((0,y.useCallback)(t=>{let n=t.nodeLookup.get(b.source),r=t.nodeLookup.get(b.target);if(!n||!r)return wW;let i=wB({id:e,sourceNode:n,targetNode:r,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=dB({selected:b.selected,zIndex:b.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||wW,zIndex:a}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex,_]),YV),j=(0,y.useMemo)(()=>b.markerStart?`url('#${OB(b.markerStart,m)}')`:void 0,[b.markerStart,m]),le=(0,y.useMemo)(()=>b.markerEnd?`url('#${OB(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||re===null||ie===null||ae===null||oe===null)return null;let ue=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=te.getState();E&&(te.setState({nodesSelectionActive:!1}),b.selected&&a?(r({nodes:[],edges:[b]}),D.current?.blur()):n([e])),i&&i(t,b)},de=a?e=>{a(e,{...b})}:void 0,fe=o?e=>{o(e,{...b})}:void 0,pe=s?e=>{s(e,{...b})}:void 0,me=c?e=>{c(e,{...b})}:void 0,he=l?e=>{l(e,{...b})}:void 0;return(0,Z.jsx)(`svg`,{style:{zIndex:ne},children:(0,Z.jsxs)(`g`,{className:pN([`react-flow__edge`,`react-flow__edge-${S}`,b.className,g,{selected:b.selected,animated:b.animated,inactive:!E&&!i,updating:ee,selectable:E}]),onClick:ue,onDoubleClick:de,onContextMenu:fe,onMouseEnter:pe,onMouseMove:me,onMouseLeave:he,onKeyDown:w?t=>{if(!v&&QR.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=te.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[b]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:b.ariaRole??(w?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":w?`${iH}-${m}`:void 0,ref:D,...b.domAttributes,children:[!k&&(0,Z.jsx)(C,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:E,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:re,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:j,markerEnd:le,pathOptions:`pathOptions`in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),T&&(0,Z.jsx)(kW,{edge:b,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:re,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce,setUpdateHover:O,setReconnecting:A})]})})}var jW=(0,y.memo)(AW),MW=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function NW({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=$V(MW,YV),b=YU(t);return(0,Z.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,Z.jsx)(nW,{defaultColor:e,rfId:n}),b.map(e=>(0,Z.jsx)(jW,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}NW.displayName=`EdgeRenderer`;var PW=(0,y.memo)(NW),FW=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function IW({children:e}){let t=eH(),n=(0,y.useRef)(null),[r]=(0,y.useState)(()=>t.getState().transform);return GH(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=FW(r)))};return r(),t.subscribe(r)},[t]),(0,Z.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:FW(r)},children:e})}function LW(e){let t=QH(),n=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var RW=e=>e.panZoom?.syncViewport;function zW(e){let t=$V(RW),n=eH();return(0,y.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function BW(e){return e.connection.inProgress?{...e.connection,to:Lz(e.connection.to,e.transform)}:{...e.connection}}function VW(e){return e?t=>e(BW(t)):BW}function HW(e){return $V(VW(e),YV)}var UW=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function WW({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=$V(UW,YV);return a&&i&&c?(0,Z.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,Z.jsx)(`g`,{className:pN([`react-flow__connection`,Zz(s)]),children:(0,Z.jsx)(GW,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var GW=({style:e,type:t=iz.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=HW();if(!i)return;if(n)return(0,Z.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:Zz(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case iz.Bezier:[m]=lB(h);break;case iz.SimpleBezier:[m]=sW(h);break;case iz.Step:[m]=SB({...h,borderRadius:0});break;case iz.SmoothStep:[m]=SB(h);break;default:[m]=gB(h)}return(0,Z.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};GW.displayName=`ConnectionLine`;var KW={};function qW(e=KW){(0,y.useRef)(e),eH(),(0,y.useEffect)(()=>{},[e])}function JW(){eH(),(0,y.useRef)(!1),(0,y.useEffect)(()=>{},[])}function YW({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:ee,minZoom:O,maxZoom:k,preventScrolling:A,defaultMarkerColor:te,zoomOnScroll:ne,zoomOnPinch:re,panOnScroll:ie,panOnScrollSpeed:ae,panOnScrollMode:oe,zoomOnDoubleClick:se,panOnDrag:ce,autoPanOnSelection:j,onPaneClick:le,onPaneMouseEnter:ue,onPaneMouseMove:de,onPaneMouseLeave:fe,onPaneScroll:pe,onPaneContextMenu:me,paneClickDistance:he,nodeClickDistance:ge,onEdgeContextMenu:_e,onEdgeMouseEnter:ve,onEdgeMouseMove:M,onEdgeMouseLeave:N,reconnectRadius:ye,onReconnect:be,onReconnectStart:P,onReconnectEnd:xe,noDragClassName:Se,noWheelClassName:Ce,noPanClassName:we,disableKeyboardA11y:Te,nodeExtent:Ee,rfId:De,viewport:Oe,onViewportChange:ke,nodesDraggable:Ae}){return qW(e),qW(t),JW(),LW(n),zW(Oe),(0,Z.jsx)(RU,{onPaneClick:le,onPaneMouseEnter:ue,onPaneMouseMove:de,onPaneMouseLeave:fe,onPaneContextMenu:me,onPaneScroll:pe,paneClickDistance:he,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:ne,zoomOnPinch:re,zoomOnDoubleClick:se,panOnScroll:ie,panOnScrollSpeed:ae,panOnScrollMode:oe,panOnDrag:ce,autoPanOnSelection:j,defaultViewport:D,translateExtent:ee,minZoom:O,maxZoom:k,onSelectionContextMenu:d,preventScrolling:A,noDragClassName:Se,noWheelClassName:Ce,noPanClassName:we,disableKeyboardA11y:Te,onViewportChange:ke,isControlledViewport:!!Oe,children:(0,Z.jsxs)(IW,{children:[(0,Z.jsx)(PW,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:be,onReconnectStart:P,onReconnectEnd:xe,onlyRenderVisibleElements:T,onEdgeContextMenu:_e,onEdgeMouseEnter:ve,onEdgeMouseMove:M,onEdgeMouseLeave:N,reconnectRadius:ye,defaultMarkerColor:te,noPanClassName:we,disableKeyboardA11y:Te,rfId:De}),(0,Z.jsx)(WW,{style:h,type:m,component:g,containerStyle:_}),(0,Z.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,Z.jsx)(JU,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:ge,onlyRenderVisibleElements:T,noPanClassName:we,noDragClassName:Se,disableKeyboardA11y:Te,nodeExtent:Ee,rfId:De,nodesDraggable:Ae}),(0,Z.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}YW.displayName=`GraphView`;var XW=(0,y.memo)(YW),ZW=Fz(`React Flow`,`https://reactflow.dev/`),QW=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??ZR;qB(h,g,_);let{nodesInitialized:x}=RB(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=Hz(pz(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:ZR,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ez.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...rz},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ZW,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:$R,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},$W=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>JV((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await _z({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...QW({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=RB(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();qB(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=WB(e,n,r,i,a,o,l);d&&(FB(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=EB(e,o.fromHandle,oz.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=UB(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(PH(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(FH(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>IH(e,!0)));return}i(LH(r,new Set([...e]),!0)),a(LH(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>IH(e,!0)));return}a(LH(n,new Set([...e]))),i(LH(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(IH(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(IH(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,IH(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,IH(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(RB(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return GB({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...rz}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...QW()})}},Object.is);function eG({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,y.useState)(()=>$W({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,Z.jsx)(ZV,{value:m,children:(0,Z.jsx)(YH,{children:(0,Z.jsx)(bU,{children:p})})})}function tG({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,y.useContext)(XV)?(0,Z.jsx)(Z.Fragment,{children:e}):(0,Z.jsx)(eG,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var nG={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function rG({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onNodesDelete:D,onEdgesDelete:ee,onDelete:O,onSelectionChange:k,onSelectionDragStart:A,onSelectionDrag:te,onSelectionDragStop:ne,onSelectionContextMenu:re,onSelectionStart:ie,onSelectionEnd:ae,onBeforeDelete:oe,connectionMode:se,connectionLineType:ce=iz.Bezier,connectionLineStyle:j,connectionLineComponent:le,connectionLineContainerStyle:ue,deleteKeyCode:de=`Backspace`,selectionKeyCode:fe=`Shift`,selectionOnDrag:pe=!1,selectionMode:me=nz.Full,panActivationKeyCode:he=`Space`,multiSelectionKeyCode:ge=Uz()?`Meta`:`Control`,zoomActivationKeyCode:_e=Uz()?`Meta`:`Control`,snapToGrid:ve,snapGrid:M,onlyRenderVisibleElements:N=!1,selectNodesOnDrag:ye,nodesDraggable:be,autoPanOnNodeFocus:P,nodesConnectable:xe,nodesFocusable:Se,nodeOrigin:Ce=yH,edgesFocusable:we,edgesReconnectable:Te,elementsSelectable:Ee=!0,defaultViewport:De=bH,minZoom:Oe=.5,maxZoom:ke=2,translateExtent:Ae=ZR,preventScrolling:je=!0,nodeExtent:Me,defaultMarkerColor:Ne=`#b1b1b7`,zoomOnScroll:Pe=!0,zoomOnPinch:Fe=!0,panOnScroll:Ie=!1,panOnScrollSpeed:Le=.5,panOnScrollMode:Re=tz.Free,zoomOnDoubleClick:ze=!0,panOnDrag:Be=!0,onPaneClick:Ve,onPaneMouseEnter:He,onPaneMouseMove:Ue,onPaneMouseLeave:We,onPaneScroll:Ge,onPaneContextMenu:Ke,paneClickDistance:qe=1,nodeClickDistance:Je=0,children:Ye,onReconnect:Xe,onReconnectStart:Ze,onReconnectEnd:Qe,onEdgeContextMenu:$e,onEdgeDoubleClick:F,onEdgeMouseEnter:et,onEdgeMouseMove:tt,onEdgeMouseLeave:nt,reconnectRadius:rt=10,onNodesChange:it,onEdgesChange:at,noDragClassName:ot=`nodrag`,noWheelClassName:st=`nowheel`,noPanClassName:I=`nopan`,fitView:ct,fitViewOptions:lt,connectOnClick:ut,attributionPosition:dt,proOptions:ft,defaultEdgeOptions:pt,elevateNodesOnSelect:mt=!0,elevateEdgesOnSelect:ht=!1,disableKeyboardA11y:gt=!1,autoPanOnConnect:_t,autoPanOnNodeDrag:vt,autoPanOnSelection:yt=!0,autoPanSpeed:bt,connectionRadius:xt,isValidConnection:St,onError:Ct,style:wt,id:Tt,nodeDragThreshold:Et,connectionDragThreshold:Dt,viewport:Ot,onViewportChange:kt,width:At,height:jt,colorMode:Mt=`light`,debug:Nt,onScroll:Pt,ariaLabelConfig:Ft,zIndexMode:It=`basic`,...Lt},Rt){let zt=Tt||`1`,Bt=EH(Mt),Vt=(0,y.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Pt?.(e)},[Pt]);return(0,Z.jsx)(`div`,{"data-testid":`rf__wrapper`,...Lt,onScroll:Vt,style:{...wt,...nG},ref:Rt,className:pN([`react-flow`,i,Bt]),id:Tt,role:`application`,children:(0,Z.jsxs)(tG,{nodes:e,edges:t,width:At,height:jt,fitView:ct,fitViewOptions:lt,minZoom:Oe,maxZoom:ke,nodeOrigin:Ce,nodeExtent:Me,zIndexMode:It,children:[(0,Z.jsx)(wH,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:be,autoPanOnNodeFocus:P,nodesConnectable:xe,nodesFocusable:Se,edgesFocusable:we,edgesReconnectable:Te,elementsSelectable:Ee,elevateNodesOnSelect:mt,elevateEdgesOnSelect:ht,minZoom:Oe,maxZoom:ke,nodeExtent:Me,onNodesChange:it,onEdgesChange:at,snapToGrid:ve,snapGrid:M,connectionMode:se,translateExtent:Ae,connectOnClick:ut,defaultEdgeOptions:pt,fitView:ct,fitViewOptions:lt,onNodesDelete:D,onEdgesDelete:ee,onDelete:O,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onSelectionDrag:te,onSelectionDragStart:A,onSelectionDragStop:ne,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:I,nodeOrigin:Ce,rfId:zt,autoPanOnConnect:_t,autoPanOnNodeDrag:vt,autoPanSpeed:bt,onError:Ct,connectionRadius:xt,isValidConnection:St,selectNodesOnDrag:ye,nodeDragThreshold:Et,connectionDragThreshold:Dt,onBeforeDelete:oe,debug:Nt,ariaLabelConfig:Ft,zIndexMode:It}),(0,Z.jsx)(XW,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,nodeTypes:a,edgeTypes:o,connectionLineType:ce,connectionLineStyle:j,connectionLineComponent:le,connectionLineContainerStyle:ue,selectionKeyCode:fe,selectionOnDrag:pe,selectionMode:me,deleteKeyCode:de,multiSelectionKeyCode:ge,panActivationKeyCode:he,zoomActivationKeyCode:_e,onlyRenderVisibleElements:N,defaultViewport:De,translateExtent:Ae,minZoom:Oe,maxZoom:ke,preventScrolling:je,zoomOnScroll:Pe,zoomOnPinch:Fe,zoomOnDoubleClick:ze,panOnScroll:Ie,panOnScrollSpeed:Le,panOnScrollMode:Re,panOnDrag:Be,autoPanOnSelection:yt,onPaneClick:Ve,onPaneMouseEnter:He,onPaneMouseMove:Ue,onPaneMouseLeave:We,onPaneScroll:Ge,onPaneContextMenu:Ke,paneClickDistance:qe,nodeClickDistance:Je,onSelectionContextMenu:re,onSelectionStart:ie,onSelectionEnd:ae,onReconnect:Xe,onReconnectStart:Ze,onReconnectEnd:Qe,onEdgeContextMenu:$e,onEdgeDoubleClick:F,onEdgeMouseEnter:et,onEdgeMouseMove:tt,onEdgeMouseLeave:nt,reconnectRadius:rt,defaultMarkerColor:Ne,noDragClassName:ot,noWheelClassName:st,noPanClassName:I,rfId:zt,disableKeyboardA11y:gt,nodeExtent:Me,viewport:Ot,onViewportChange:kt,nodesDraggable:be}),(0,Z.jsx)(vH,{onSelectionChange:k}),Ye,(0,Z.jsx)(fH,{proOptions:ft,position:dt}),(0,Z.jsx)(lH,{rfId:zt,disableKeyboardA11y:gt})]})})}var iG=WH(rG);XR.error014();function aG({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,Z.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:pN([`react-flow__background-pattern`,n,r])})}function oG({radius:e,className:t}){return(0,Z.jsx)(`circle`,{cx:e,cy:e,r:e,className:pN([`react-flow__background-pattern`,`dots`,t])})}var sG;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(sG||={});var cG={[sG.Dots]:1,[sG.Lines]:1,[sG.Cross]:6},lG=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function uG({id:e,variant:t=sG.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,y.useRef)(null),{transform:f,patternId:p}=$V(lG,YV),m=r||cG[t],h=t===sG.Dots,g=t===sG.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],b=m*f[2],x=Array.isArray(a)?a:[a,a],S=g?[b,b]:v,C=[x[0]*f[2]+S[0]/2,x[1]*f[2]+S[1]/2],w=`${p}${e||``}`;return(0,Z.jsxs)(`svg`,{className:pN([`react-flow__background`,l]),style:{...c,...rU,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,Z.jsx)(`pattern`,{id:w,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${C[0]},-${C[1]})`,children:h?(0,Z.jsx)(oG,{radius:b/2,className:u}):(0,Z.jsx)(aG,{dimensions:S,lineWidth:i,variant:t,className:u})}),(0,Z.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}uG.displayName=`Background`,(0,y.memo)(uG);function dG(){return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,Z.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function fG(){return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,Z.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function pG(){return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,Z.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function mG(){return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,Z.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function hG(){return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,Z.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function gG({children:e,className:t,...n}){return(0,Z.jsx)(`button`,{type:`button`,className:pN([`react-flow__controls-button`,t]),...n,children:e})}var _G=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function vG({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=eH(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=$V(_G,YV),{zoomIn:y,zoomOut:b,fitView:x}=QH();return(0,Z.jsxs)(uH,{className:pN([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(gG,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,Z.jsx)(dG,{})}),(0,Z.jsx)(gG,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,Z.jsx)(fG,{})})]}),n&&(0,Z.jsx)(gG,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,Z.jsx)(pG,{})}),r&&(0,Z.jsx)(gG,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,Z.jsx)(hG,{}):(0,Z.jsx)(mG,{})}),u]})}vG.displayName=`Controls`,(0,y.memo)(vG);function yG({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,Z.jsx)(`rect`,{className:pN([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var bG=(0,y.memo)(yG),xG=e=>e.nodes.map(e=>e.id),SG=e=>e instanceof Function?e:()=>e;function CG({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=bG,onClick:o}){let s=$V(xG,YV),c=SG(t),l=SG(e),u=SG(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,Z.jsx)(Z.Fragment,{children:s.map(e=>(0,Z.jsx)(TG,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function wG({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=$V(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=Gz(r);return{node:r,x:i,y:a,width:o,height:s}},YV);return!l||l.hidden||!Kz(l)?null:(0,Z.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var TG=(0,y.memo)(wG),EG=(0,y.memo)(CG),DG=200,OG=150,kG=e=>!e.hidden,AG=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?Az(pz(e.nodeLookup,{filter:kG}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},jG=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,MG=(e,t)=>jG(e.viewBB,t.viewBB)&&jG(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,NG=`react-flow__minimap-desc`;function PG({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:b=1,offsetScale:x=5}){let S=eH(),C=(0,y.useRef)(null),{boundingRect:w,panZoom:T,viewBB:E,rfId:D,translateExtent:ee,flowWidth:O,flowHeight:k,ariaLabelConfig:A}=$V(AG,MG),te=e?.width??DG,ne=e?.height??OG,re=w.width/te,ie=w.height/ne,ae=Math.max(re,ie),oe=ae*te,se=ae*ne,ce=x*ae,j=w.x-(oe-w.width)/2-ce,le=w.y-(se-w.height)/2-ce,ue=oe+ce*2,de=se+ce*2,fe=`${NG}-${D}`,pe=(0,y.useRef)(0),me=(0,y.useRef)();pe.current=ae,(0,y.useEffect)(()=>{let e=S.getState().panZoom;if(C.current&&e)return me.current=uV({domNode:C.current,panZoom:e,getTransform:()=>S.getState().transform,getViewScale:()=>pe.current}),()=>{me.current?.destroy()}},[T]),(0,y.useEffect)(()=>{me.current?.update({translateExtent:ee,width:O,height:k,inversePan:v,pannable:h,zoomStep:b,zoomable:g})},[h,g,v,b,ee,O,k]);let he=p?e=>{let[t,n]=me.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,ge=(0,y.useCallback)((e,t)=>{let n=S.getState().nodeLookup.get(t).internals.userNode;m?.(e,n)},[m]),_e=m?ge:void 0,ve=_??A[`minimap.ariaLabel`];return(0,Z.jsx)(uH,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*ae:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:pN([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,Z.jsxs)(`svg`,{width:te,height:ne,viewBox:`${j} ${le} ${ue} ${de}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":fe,ref:C,onClick:he,children:[ve&&(0,Z.jsx)(`title`,{id:fe,children:ve}),(0,Z.jsx)(EG,{onClick:_e,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,Z.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${j-ce},${le-ce}h${ue+ce*2}v${de+ce*2}h${-ue-ce*2}z
|
|
741
|
+
M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}PG.displayName=`MiniMap`,(0,y.memo)(PG);var FG=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,IG={[TV.Line]:`right`,[TV.Handle]:`bottom-right`};function LG({nodeId:e,position:t,variant:n=TV.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=_U(),b=typeof e==`string`?e:v,x=eH(),S=(0,y.useRef)(null),C=n===TV.Handle,w=$V((0,y.useCallback)(FG(C&&p),[C,p]),YV),T=(0,y.useRef)(null),E=t??IG[n];(0,y.useEffect)(()=>{if(S.current&&b)return T.current||=IV({domNode:S.current,nodeId:b,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=x.getState(),o=[],s={x:e.x,y:e.y},c=r.get(b);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=UB([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...qz({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:b,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:b,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:b,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,h,g,_,m]);let D=E.split(`-`);return(0,Z.jsx)(`div`,{className:pN([`react-flow__resize-control`,`nodrag`,...D,n,r]),ref:S,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}(0,y.memo)(LG);function RG(e){switch(e.type){case`page`:return Q_;case`agent`:return i_;case`generate`:return e.asset===`image`?K_:e.asset===`video`?ey:e.asset===`dashboard`?J_:A_;case`widget`:return Wg;case`film`:return f_;case`review`:return E_;case`result`:return P_}return ny}var zG={page:`bg-cobalt-tint text-cobalt`,agent:`bg-ember-tint text-ember-strong`,generate:`bg-amber-tint text-ink-2`,widget:`bg-ember-veil text-ember-strong`,film:`bg-amber-tint text-ink-2`,review:`bg-moss-tint text-moss`,result:`bg-paper-2 text-ink-2`};function BG(e){return Q(`type.${e.type}`)}var VG=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`];function HG(e){return VG.includes(e)?Q(`tool.${e}`):e}function UG(e){switch(e.type){case`page`:return e.fields.map(e=>e.label).join(` · `);case`agent`:{let t=e.tools.map(HG),n=e.mcp?.length?[`MCP: ${e.mcp.join(`, `)}`]:[];return[...t,...n].join(` · `)||e.instructions.slice(0,90)}case`generate`:{let t=[e.asset];return e.options?.aspectRatio&&t.push(e.options.aspectRatio),e.options?.duration&&t.push(`${e.options.duration}s`),e.options?.resolution&&t.push(e.options.resolution),e.options?.template&&t.push(e.options.template),t.join(` · `)}case`widget`:return[e.entry,Object.keys(e.data).join(`, `)].filter(Boolean).join(` · `);case`film`:return[e.format,e.seconds?`${e.seconds}s`:null,e.skills.join(`, `)].filter(Boolean).join(` · `);case`review`:return[e.edit?Q(`editor.reviewEditable`):null,e.regenerate?Q(`editor.reviewRedo`):null].filter(Boolean).join(` · `);case`result`:return e.deliverables.map(e=>`${e.label??e.from} (${e.formats.join(`, `)})`).join(` · `)}return``}var WG=280,GG=92;function KG({data:e}){let{step:t,selected:n,issue:r,active:i,pulse:a,cost:o,passed:s}=e,c=RG(t);return(0,Z.jsxs)(`div`,{className:$(`relative w-[280px] cursor-pointer rounded-xl bg-card px-4 py-3 text-left shadow-soft ring-1 transition`,n?`shadow-elevated ring-2 ring-ember`:i?`ring-2 ring-moss`:a?`ring-2 ring-ember/60`:`ring-border-soft hover:shadow-elevated`),children:[i?(0,Z.jsx)(`span`,{className:`-top-1 -right-1 absolute size-3 animate-breathe rounded-full bg-moss`}):a?(0,Z.jsx)(`span`,{className:`-top-1 -right-1 absolute size-3 animate-breathe rounded-full bg-ember`}):null,(0,Z.jsx)(TU,{type:`target`,position:oz.Top}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:$(`inline-flex size-6 items-center justify-center rounded-md`,zG[t.type]),children:(0,Z.jsx)(c,{className:`size-3.5`})}),(0,Z.jsx)(`span`,{className:`font-medium text-[0.6875rem] text-ink-3 uppercase tracking-[0.07em]`,children:BG(t)}),r?(0,Z.jsx)(u_,{className:`ml-auto size-4 text-rose`}):s&&!i?(0,Z.jsx)(c_,{className:`ml-auto size-4 text-moss`}):o===null?null:(0,Z.jsxs)(`span`,{className:`ml-auto text-[0.6875rem] text-ink-3 tabular-nums`,children:[`≈`,` `,o<10?o.toLocaleString(void 0,{maximumFractionDigits:1}):Math.round(o),` `,`cr`]})]}),(0,Z.jsx)(`div`,{className:`mt-1.5 truncate font-display font-semibold text-[0.9375rem] text-ink`,children:t.title}),(0,Z.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:UG(t)||`\xA0`}),(0,Z.jsx)(TU,{type:`source`,position:oz.Bottom})]})}function qG({data:e}){return(0,Z.jsxs)(`div`,{className:$(`flex w-[280px] cursor-pointer items-center gap-3 rounded-full bg-paper-2 py-1.5 pr-5 pl-2 transition`,e.selected?`ring-2 ring-ember`:`hover:bg-paper-3`),children:[(0,Z.jsx)(MS,{kind:e.avatar,size:40,interactive:!1}),(0,Z.jsx)(`span`,{className:`truncate font-display font-semibold text-[0.9375rem]`,children:e.title}),(0,Z.jsx)(TU,{type:`source`,position:oz.Bottom})]})}function JG(e){let{data:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s}=e,c={label:e.label,labelStyle:e.labelStyle,labelBgStyle:e.labelBgStyle,labelBgPadding:e.labelBgPadding,labelBgBorderRadius:e.labelBgBorderRadius,style:e.style,markerEnd:e.markerEnd};if(!t?.points.length){let[e,t,l]=lB({sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s});return(0,Z.jsx)(aW,{path:e,labelX:t,labelY:l,...c})}let l=[{x:n,y:r},...t.points,{x:i,y:a}],u=l.map((e,t)=>{let n=l[t-1];if(!n)return`M ${e.x} ${e.y}`;let r=(n.y+e.y)/2;return`C ${n.x} ${r} ${e.x} ${r} ${e.x} ${e.y}`}).join(` `);return(0,Z.jsx)(aW,{path:u,labelX:t.labelX,labelY:t.labelY,...c})}var YG={step:KG,start:qG},XG={branch:JG},ZG=34,QG={};function $G(e){let t=Array.isArray(e.when.value)?e.when.value.join(` / `):String(e.when.value??``);switch(e.when.op){case`equals`:return`${e.when.field} = ${t}`;case`notEquals`:return`${e.when.field} ≠ ${t}`;case`in`:return`${e.when.field} ∈ ${t}`;case`notEmpty`:return Q(`editor.whenFilled`,{field:e.when.field});case`empty`:return Q(`editor.whenEmpty`,{field:e.when.field})}}function eK(e,t,n,r,i,a,o){let s=new fN.graphlib.Graph;s.setGraph({rankdir:`TB`,nodesep:48,ranksep:46,marginx:20,marginy:20}),s.setDefaultEdgeLabel(()=>({})),s.setNode(`__start`,{width:WG,height:52});for(let t of e.steps)s.setNode(t.id,{width:WG,height:GG});let c=[],l={markerEnd:{type:az.ArrowClosed,width:14,height:14,color:`var(--ink-4)`}};e.steps[0]&&(s.setEdge(`__start`,e.steps[0].id),c.push({id:`e-start`,source:`__start`,target:e.steps[0].id,...l})),e.steps.forEach((t,n)=>{let r=e.steps[n+1],i=new Map;for(let n of t.next??[])n.goto!==`end`&&e.steps.some(e=>e.id===n.goto)&&i.set(n.goto,[...i.get(n.goto)??[],$G(n)]);for(let[e,n]of i){let r=n.join(` · `),i=r.length>ZG?`${r.slice(0,33)}…`:r;s.setEdge(t.id,e,{width:i.length*6.2+16,height:22,labelpos:`c`}),c.push({id:`b-${t.id}-${e}`,type:`branch`,source:t.id,target:e,label:i,labelStyle:{fontSize:11,fill:`var(--ink-2)`},labelBgStyle:{fill:`var(--paper-2)`},labelBgPadding:[6,3],labelBgBorderRadius:8,style:{strokeDasharray:`5 4`},...l})}r&&t.type!==`result`&&(s.hasEdge(t.id,r.id)||s.setEdge(t.id,r.id),c.push({id:`n-${t.id}`,source:t.id,target:r.id,...t.next?.length?{label:Q(`editor.otherwise`),labelStyle:{fontSize:11,fill:`var(--ink-3)`},labelBgStyle:{fill:`var(--background)`}}:{},...l}))}),fN.layout(s);for(let e of c){if(e.type!==`branch`)continue;let t=s.edge(e.source,e.target),n=(t.points??[]).slice(1,-1);n.length&&t.x!==void 0&&t.y!==void 0&&(e.data={points:n,labelX:t.x,labelY:t.y})}return{nodes:[{id:`__start`,type:`start`,position:{x:s.node(`__start`).x-WG/2,y:s.node(`__start`).y-26},data:{title:e.title,avatar:e.avatar,selected:t===`__wizard`},draggable:!1},...e.steps.map((e,c)=>{let l=s.node(e.id);return{id:e.id,type:`step`,position:{x:l.x-WG/2,y:l.y-GG/2},data:{step:e,selected:t===e.id,issue:n.has(e.id),index:c,active:r===e.id,pulse:i.includes(e.id),cost:a[e.id]?.credits??null,passed:o.has(e.id)},draggable:!1}})],edges:c}}function tK(){let e=QH(),t=`inline-flex size-8 items-center justify-center rounded-full text-ink-3 hover:bg-accent hover:text-ink`;return(0,Z.jsxs)(`div`,{className:`absolute bottom-4 left-4 z-10 flex items-center gap-0.5 rounded-full bg-card p-1 shadow-soft ring-1 ring-border-soft`,children:[(0,Z.jsx)(`button`,{type:`button`,className:t,onClick:()=>e.zoomOut(),"aria-label":`Zoom out`,children:(0,Z.jsx)(mv,{className:`size-4`})}),(0,Z.jsx)(`button`,{type:`button`,className:t,onClick:()=>e.fitView({padding:.2,duration:300}),"aria-label":`Fit`,children:(0,Z.jsx)(Mv,{className:`size-4`})}),(0,Z.jsx)(`button`,{type:`button`,className:t,onClick:()=>e.zoomIn(),"aria-label":`Zoom in`,children:(0,Z.jsx)(wv,{className:`size-4`})})]})}var nK=.8,rK=new Set;function iK({def:e,selected:t,onSelect:n,issueSteps:r,activeStep:i,pulse:a,costs:o=QG,passed:s=rK,minFitZoom:c=nK,fitKey:l}){let{nodes:u,edges:d}=(0,y.useMemo)(()=>eK(e,t,r,i,a??[],o,s),[e,t,r,i,a,o,s]),f=QH(),p=(0,y.useRef)(null),m=e.steps.map(e=>e.id).join(`|`);return(0,y.useEffect)(()=>{let e=requestAnimationFrame(()=>{let e=p.current;if(!e||!u.length)return;let t=u.map(e=>e.position.x),n=u.map(e=>e.position.y),r={x:Math.min(...t),y:Math.min(...n),width:Math.max(...t)+WG-Math.min(...t),height:Math.max(...n)+GG-Math.min(...n)},i=Math.min(e.clientWidth/(r.width*1.2),e.clientHeight/(r.height*1.15),1),a=Math.max(i,c),o=(e.clientWidth-r.width*a)/2-r.x*a,s=i>=c?(e.clientHeight-r.height*a)/2-r.y*a:24-r.y*a;f.setViewport({x:o,y:s,zoom:a},{duration:400})});return()=>cancelAnimationFrame(e)},[m,l,f]),(0,Z.jsx)(`div`,{ref:p,className:`h-full w-full`,children:(0,Z.jsx)(iG,{nodes:u,edges:d,nodeTypes:YG,edgeTypes:XG,onNodeClick:(e,t)=>n(t.id===`__start`?`__wizard`:t.id),onPaneClick:()=>n(null),nodesConnectable:!1,nodesDraggable:!1,elementsSelectable:!1,panOnScroll:!0,zoomOnScroll:!1,zoomOnPinch:!0,minZoom:.3,maxZoom:1.4,proOptions:{hideAttribution:!0},children:(0,Z.jsx)(tK,{})})})}function aK(e){return(0,Z.jsx)(eG,{children:(0,Z.jsx)(iK,{...e})})}var oK=`engenty/flow`,sK=new Set([`text`,`textarea`,`number`,`select`,`multiselect`,`date`,`email`,`url`,`toggle`,`color`,`location`]),cK=420,lK=600,uK=320,dK=new Set;function fK(e){if(e.structuredContent)return e.structuredContent;let t=e.content?.find(e=>e.type===`text`);try{return t&&`text`in t?JSON.parse(t.text):null}catch{return t&&`text`in t?t.text:null}}function pK(e){let t=fK(e);if(e.isError){let e=t&&typeof t==`object`&&`error`in t?String(t.error):String(t);throw Object.assign(Error(e),{body:t})}return t}function mK(e){e&&(e.theme&&document.documentElement.classList.toggle(`dark`,e.theme===`dark`),e.locale&&vb(e.locale.toLowerCase().startsWith(`de`)?`de`:`en`))}function hK(){let e=(0,y.useMemo)(()=>new kg({name:`engenty-wizards-flow`,version:`1.0.0`},{},{autoResize:!0}),[]),[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(`asking`);(0,y.useEffect)(()=>{e.ontoolresult=e=>{let t=e._meta?.[oK];t&&(n(t),i(t.run??null))},e.onhostcontextchanged=e=>{o(t=>({...t,...e})),mK(e)},e.connect().then(()=>{let t=e.getHostContext();o(t),mK(t)}).catch(e=>console.error(`[flow widget]`,e))},[e]);let d=(0,y.useCallback)(async(t,n)=>pK(await e.callServerTool({name:t,arguments:n})),[e]),f=(0,y.useCallback)(t=>{let n=t.outputs.map(e=>e.title).join(`, `),r=[`engenty wizards run ${t.runId}: ${t.status}${t.step?` at "${t.step.title}"`:``}.`,n?`Made so far: ${n}.`:``,t.status===`done`?`The person finished it in the widget; get_run has the outputs and download links.`:`The person answers this run in the widget; get_run has the details.`].filter(Boolean).join(` `);e.updateModelContext({content:[{type:`text`,text:r}]}).catch(()=>void 0)},[e]),p=(0,y.useRef)(``),m=(0,y.useCallback)(t=>{let n=t?`${t.status}:${t.step?.id??``}`:``;if(!t||n===p.current)return;p.current=n;let r=[`engenty wizards run ${t.id}: ${t.status}${t.step?` at "${t.step.title}"`:``}.`,t.status===`done`?`The person finished it in the widget; get_run has the outputs and download links.`:`The person answers this run in the widget; get_run has the details.`].join(` `);e.updateModelContext({content:[{type:`text`,text:r}]}).catch(()=>void 0)},[e]),h=(0,y.useRef)(null),g=(0,y.useRef)(``),_=(0,y.useCallback)(e=>{m(e);let t=e?`${e.status}:${e.step?.id??``}`:``;t!==g.current&&(g.current=t,h.current?.scrollTo({top:0}))},[m]),v=r?.runId,b=t?.runtime;(0,y.useEffect)(()=>{if(!v||!b){u(`no`);return}FS(b),u(`asking`);let e=!0;return fetch(IS(`/api/runs/${v}`),{credentials:`include`}).then(t=>e&&u(t.ok?`yes`:`no`)).catch(()=>e&&u(`no`)),()=>{e=!1}},[v,b]);let x=(0,y.useCallback)(async t=>{let r=await e.callServerTool({name:`run_wizard`,arguments:{wizardId:t}});pK(r);let a=r._meta?.[oK];a&&(n(a),i(a.run??null))},[e]),S=r?.status===`running`;(0,y.useEffect)(()=>{if(!v||!S||l!==`no`)return;let e=!0;return(async()=>{for(;e;)try{let t=await d(`get_run`,{runId:v,waitSeconds:20});if(!e)return;if(i(t),t.status!==`running`){f(t);return}}catch{await new Promise(e=>setTimeout(e,3e3))}})(),()=>{e=!1}},[v,S,l,d,f]);let C=(0,y.useMemo)(()=>new Set(r?.passed??[]),[r]),w=a?.displayMode===`fullscreen`,T=a?.availableDisplayModes?.includes(`fullscreen`),E=t=>{e.openLink({url:t}).catch(()=>window.open(t,`_blank`,`noopener`))};if(!t||r&&l===`asking`)return(0,Z.jsxs)(`div`,{className:`flex items-center justify-center gap-2 text-ink-3 text-sm`,style:{height:160},children:[(0,Z.jsx)(Hb,{className:`size-4`}),Q(`flowApp.loading`)]});if(r&&l===`yes`)return(0,Z.jsx)(`div`,{ref:h,className:`overflow-y-auto overscroll-contain bg-background text-ink`,style:{maxHeight:lK},children:(0,Z.jsx)(Dk,{runId:r.runId,compact:!0,stickyProgress:!0,onView:_})});if(!r)return(0,Z.jsx)(gK,{view:t,onStart:()=>x(t.wizard.id)});let D=r&&r.status!==`done`?r.step?.id??null:null;return(0,Z.jsxs)(`div`,{className:$(`flex bg-background text-ink`,w?`h-screen flex-row`:`flex-col`),children:[(0,Z.jsx)(`div`,{className:$(`relative min-w-0`,w?`flex-1`:``),style:w?void 0:{height:uK},children:(0,Z.jsx)(aK,{def:t.definition,selected:s,onSelect:c,issueSteps:dK,activeStep:D,passed:C,minFitZoom:.45,fitKey:String(w)})}),(0,Z.jsxs)(`aside`,{className:$(`flex flex-col gap-3 border-border-soft bg-card p-4`,w?`w-[380px] overflow-y-auto border-l`:`border-t`),children:[(0,Z.jsxs)(`header`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate font-display font-semibold text-[0.9375rem]`,children:t.wizard.title}),(0,Z.jsx)(Wb,{children:t.wizard.shows===`published`?Q(`flowApp.published`):Q(`flowApp.draft`)}),t.wizard.issues?(0,Z.jsx)(`span`,{className:`text-[0.75rem] text-rose`,children:Q(`flowApp.issues`,{n:t.wizard.issues})}):null,(0,Z.jsx)(`span`,{className:`ml-auto flex items-center gap-1`,children:T?(0,Z.jsxs)(jb,{size:`sm`,variant:`ghost`,onClick:()=>e.requestDisplayMode({mode:w?`inline`:`fullscreen`}).then(({mode:e})=>o(t=>({...t,displayMode:e}))).catch(()=>void 0),children:[w?(0,Z.jsx)(fv,{className:`size-4`}):(0,Z.jsx)(cv,{className:`size-4`}),Q(w?`flowApp.inline`:`flowApp.fullscreen`)]}):null})]}),(0,Z.jsx)(_K,{report:r,selected:s,call:d,onReport:e=>{i(e),f(e)},open:E})]})]})}function gK({view:e,onStart:t}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1),c=e.wizard.description??e.definition.description;return(0,Z.jsxs)(`div`,{className:`flex flex-col overflow-y-auto overscroll-contain bg-background text-ink`,style:{maxHeight:lK},children:[(0,Z.jsxs)(`div`,{className:`mx-auto flex max-w-lg flex-col items-center px-6 pt-6 pb-6 text-center`,children:[(0,Z.jsx)(MS,{kind:e.wizard.avatar??e.definition.avatar,size:120,fluffy:!0}),(0,Z.jsx)(`h1`,{className:`mt-2 text-balance font-display font-semibold text-[1.625rem] leading-[1.1] tracking-tight`,children:e.wizard.title}),c?(0,Z.jsx)(`p`,{className:`mt-3 text-[0.9375rem] text-ink-2 leading-relaxed`,children:c}):null,e.wizard.published?(0,Z.jsxs)(jb,{size:`lg`,className:`mt-8 min-w-48`,busy:n,onClick:async()=>{r(!0),a(null);try{await t()}catch(e){a(e.message),r(!1)}},children:[Q(`run.start`),` `,(0,Z.jsx)(Xg,{className:`size-4`})]}):(0,Z.jsx)(`p`,{className:`mt-8 rounded-xl bg-paper-2 px-5 py-4 text-[0.875rem] text-ink-2`,children:Q(`flowApp.notPublished`)}),i?(0,Z.jsx)(`p`,{className:`mt-4 text-[0.875rem] text-rose`,children:i}):null,(0,Z.jsxs)(jb,{size:`sm`,variant:`ghost`,className:`mt-4`,onClick:()=>s(!o),children:[(0,Z.jsx)(iy,{className:`size-4`}),Q(`flowApp.flow`)]})]}),o?(0,Z.jsx)(`div`,{className:`relative border-border-soft border-t`,style:{height:cK},children:(0,Z.jsx)(aK,{def:e.definition,selected:null,onSelect:()=>void 0,issueSteps:dK,activeStep:null,minFitZoom:.45})}):null]})}function _K({report:e,selected:t,call:n,onReport:r,open:i}){let[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null),l=async(t,i)=>{o(!0),c(null);try{r(await n(t,{runId:e.runId,...i}))}catch(e){c(e.message)}finally{o(!1)}},u=e.waitingFor,d=t?e.outputs.filter(e=>e.stepId===t):[],f=e.events.at(-1),p=e.browserUrl,m=p?()=>i(p):void 0,h=null;return e.status===`running`&&!(u&&`ask`in u)?h=(0,Z.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.8125rem] text-ink-2`,children:[(0,Z.jsx)(Hb,{className:`size-4`}),f&&yb(f)||Q(`run.working`)]}):u&&`page`in u?h=(0,Z.jsx)(yK,{fields:u.fields,busy:a,onSubmit:e=>l(`answer_page`,{stepId:u.page,values:e,waitSeconds:3}),onBrowser:m},`${e.runId}-${u.page}`):u&&`review`in u?h=(0,Z.jsx)(xK,{outputs:e.outputs.filter(e=>u.show.includes(e.stepId)),targets:u.show,busy:a,onAccept:()=>l(`review_step`,{stepId:u.review,action:{type:`accept`}}),onRegenerate:(e,t)=>l(`review_step`,{stepId:u.review,action:{type:`regenerate`,target:e,note:t}}),open:i}):u&&`ask`in u?h=u.kind===`confirm`?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`font-medium text-[0.8125rem]`,children:Q(`flowApp.ask`)}),(0,Z.jsxs)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:[u.reason,` — `,u.service,`: `,u.action]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(jb,{size:`sm`,busy:a,onClick:()=>l(`answer_ask`,{askId:u.ask,answer:`allow`}),children:Q(`flowApp.allow`)}),(0,Z.jsx)(jb,{size:`sm`,variant:`ghost`,disabled:a,onClick:()=>l(`answer_ask`,{askId:u.ask,answer:`skip`}),children:Q(`flowApp.skip`)})]})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:Q(`flowApp.signIn`,{site:u.site})}),m?(0,Z.jsxs)(jb,{size:`sm`,onClick:m,children:[(0,Z.jsx)(w_,{className:`size-4`}),Q(`flowApp.runPage`)]}):null]}):e.status===`failed`?h=(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:e.error||Q(`run.failed`)}),(0,Z.jsx)(jb,{size:`sm`,busy:a,onClick:()=>l(`control_run`,{action:`retry`}),children:Q(`run.retry`)})]}):e.status===`cancelled`?h=(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:Q(`run.cancelled`)}):e.status===`done`&&(h=(0,Z.jsx)(SK,{outputs:e.outputs,open:i})),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-[0.75rem] text-ink-3`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-ink-2`,children:e.status===`done`?Q(`flowApp.done`):e.step?.title}),(0,Z.jsxs)(`span`,{children:[`· `,Q(`flowApp.credits`,{n:e.credits})]}),(0,Z.jsxs)(`span`,{className:`ml-auto flex gap-1`,children:[e.status===`waiting_input`&&e.passed.length?(0,Z.jsxs)(jb,{size:`sm`,variant:`ghost`,disabled:a,onClick:()=>l(`control_run`,{action:`back`}),children:[(0,Z.jsx)(Xv,{className:`size-4`}),Q(`run.back`)]}):null,m?(0,Z.jsxs)(jb,{size:`sm`,variant:`ghost`,onClick:m,children:[(0,Z.jsx)(w_,{className:`size-4`}),Q(`flowApp.runPage`)]}):null]})]}),h,s?(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:Q(`flowApp.failed`,{error:s})}):null,d.length&&e.status!==`done`?(0,Z.jsx)(SK,{outputs:d,open:i}):null]})}function vK(e){return e.value??e.default??(e.kind===`multiselect`?[]:e.kind!==`toggle`&&``)}function yK({fields:e,busy:t,onSubmit:n,onBrowser:r}){let i=e.filter(e=>sK.has(e.kind)),a=e.filter(e=>!sK.has(e.kind)),[o,s]=(0,y.useState)(()=>Object.fromEntries(i.map(e=>[e.id,vK(e)]))),c=(e,t)=>s(n=>({...n,[e]:t})),l=i.some(e=>{let t=o[e.id];return e.required&&(t===``||t===void 0||Array.isArray(t)&&!t.length)});return a.some(e=>e.required)?(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:Q(`flowApp.inBrowser`,{fields:a.map(e=>e.label).join(`, `)})}),r?(0,Z.jsxs)(jb,{size:`sm`,onClick:r,children:[(0,Z.jsx)(w_,{className:`size-4`}),Q(`flowApp.runPage`)]}):null]}):(0,Z.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault();let t={};for(let e of i){let n=o[e.id];n!==``&&n!==void 0&&(t[e.id]=e.kind===`number`?Number(n):e.kind===`location`?{label:String(n)}:n)}n(t)},children:[i.map(e=>(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(Vb,{required:e.required,hint:e.help,children:e.label}),(0,Z.jsx)(`div`,{className:`mt-1.5`,children:(0,Z.jsx)(bK,{field:e,value:o[e.id],onChange:t=>c(e.id,t)})})]},e.id)),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(jb,{type:`submit`,busy:t,disabled:l,children:Q(`run.next`)}),a.length?(0,Z.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:Q(`flowApp.inBrowser`,{fields:a.map(e=>e.label).join(`, `)})}):null]})]})}function bK({field:e,value:t,onChange:n}){let r=typeof t==`string`||typeof t==`number`?String(t):``;switch(e.kind){case`textarea`:return(0,Z.jsx)(Lb,{value:r,rows:4,placeholder:e.placeholder,onChange:e=>n(e.target.value)});case`select`:return(0,Z.jsx)(Rb,{value:r,onChange:n,placeholder:``,options:(e.options??[]).map(e=>({value:e,label:e}))});case`multiselect`:return(0,Z.jsx)(zb,{multi:!0,value:Array.isArray(t)?t:[],onChange:n,options:e.options??[]});case`toggle`:return(0,Z.jsx)(Bb,{checked:t===!0,onChange:n});case`location`:return(0,Z.jsx)(Fb,{value:t&&typeof t==`object`&&`label`in t?String(t.label??``):r,placeholder:e.placeholder,onChange:e=>n(e.target.value)});default:return(0,Z.jsx)(Fb,{type:e.kind===`number`?`number`:e.kind===`date`?`date`:e.kind===`email`?`email`:e.kind===`url`?`url`:e.kind===`color`?`color`:`text`,value:r,placeholder:e.placeholder,onChange:e=>n(e.target.value)})}}function xK({outputs:e,targets:t,busy:n,onAccept:r,onRegenerate:i,open:a}){let[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(t[0]??``);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(SK,{outputs:e,open:a}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[t.length>1?(0,Z.jsx)(Rb,{value:c,onChange:l,options:e.map(e=>({value:e.stepId,label:e.title}))}):null,(0,Z.jsx)(Lb,{rows:2,value:o,placeholder:Q(`run.regenerateNote`),onChange:e=>s(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(jb,{busy:n,onClick:r,children:Q(`run.accept`)}),(0,Z.jsx)(jb,{variant:`ghost`,disabled:n||!o.trim()||!c,onClick:()=>i(c,o.trim()),children:Q(`run.regenerateGo`)})]})]})]})}function SK({outputs:e,open:t}){return(0,Z.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map(e=>(0,Z.jsxs)(`section`,{className:`rounded-xl bg-paper-2 p-3`,children:[(0,Z.jsx)(`div`,{className:`mb-1.5 font-medium text-[0.8125rem] text-ink-2`,children:e.title}),e.text?(0,Z.jsx)(AE,{text:e.text,className:`text-[0.8125rem]`}):null,e.assets.filter(e=>e.mime.startsWith(`image/`)).map(e=>(0,Z.jsx)(`img`,{src:e.url,alt:e.name,className:`mt-2 max-h-64 rounded-lg`},e.url)),Object.keys(e.downloads).length?(0,Z.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:Object.entries(e.downloads).map(([e,n])=>(0,Z.jsxs)(jb,{size:`sm`,variant:`secondary`,onClick:()=>t(n),children:[(0,Z.jsx)(b_,{className:`size-4`}),e.toUpperCase()]},e))}):null]},e.stepId))})}(0,b.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(y.StrictMode,{children:(0,Z.jsx)(hK,{})}));</script>
|
|
742
742
|
<style rel="stylesheet" crossorigin>@import "https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap";@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}.react-flow{--xy-edge-stroke-default:#b1b1b7;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#555;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#ffffff80;--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:#f0f0f099;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#e2e2e2;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:transparent;--xy-background-pattern-dots-color-default:#91919a;--xy-background-pattern-lines-color-default:#eee;--xy-background-pattern-cross-color-default:#e2e2e2;background-color:var(--xy-background-color,var(--xy-background-color-default));--xy-node-border-default:1px solid #bbb;--xy-node-border-selected-default:1px solid #555;--xy-handle-background-color-default:#333;--xy-selection-background-color-default:#9696b41a;--xy-selection-border-default:1px dotted #9b9b9bcc;--xy-resize-background-color-default:#3367d9;direction:ltr}.react-flow.dark{--xy-edge-stroke-default:#3e3e3e;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#727272;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#96969640;--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:#3c3c3c99;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#2b2b2b;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:#141414;--xy-background-pattern-dots-color-default:#555;--xy-background-pattern-lines-color-default:#333;--xy-background-pattern-cross-color-default:#333;--xy-node-color-default:#f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props,var(--xy-background-color,var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width,var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke,var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width,var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{pointer-events:none;position:absolute;overflow:visible}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected,var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}svg.react-flow__connectionline{z-index:1001;position:absolute;overflow:visible}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.react-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.react-flow__handle{pointer-events:none;background-color:var(--xy-handle-background-color,var(--xy-handle-background-color-default));min-width:5px;min-height:5px;position:absolute}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;bottom:0;left:50%;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{z-index:5;margin:15px;position:absolute}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px)translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px)translateY(-50%)}.react-flow__attribution{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));margin:0;padding:2px 3px;font-size:10px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.react-flow__edgelabel-renderer{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__viewport-portal{-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__minimap{background:var(--xy-minimap-background-color-props,var(--xy-minimap-background-color,var(--xy-minimap-background-color-default)))}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var(--xy-minimap-mask-background-color-props,var(--xy-minimap-mask-background-color,var(--xy-minimap-mask-background-color-default)));stroke:var(--xy-minimap-mask-stroke-color-props,var(--xy-minimap-mask-stroke-color,var(--xy-minimap-mask-stroke-color-default)));stroke-width:var(--xy-minimap-mask-stroke-width-props,var(--xy-minimap-mask-stroke-width,var(--xy-minimap-mask-stroke-width-default)))}.react-flow__minimap-node{fill:var(--xy-minimap-node-background-color-props,var(--xy-minimap-node-background-color,var(--xy-minimap-node-background-color-default)));stroke:var(--xy-minimap-node-stroke-color-props,var(--xy-minimap-node-stroke-color,var(--xy-minimap-node-stroke-color-default)));stroke-width:var(--xy-minimap-node-stroke-width-props,var(--xy-minimap-node-stroke-width,var(--xy-minimap-node-stroke-width-default)))}.react-flow__background-pattern.dots{fill:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-dots-color-default)))}.react-flow__background-pattern.lines{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-lines-color-default)))}.react-flow__background-pattern.cross{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-cross-color-default)))}.react-flow__controls{flex-direction:column;display:flex}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{justify-content:center;align-items:center;width:26px;height:26px;padding:4px;display:flex}.react-flow__controls-button svg{fill:currentColor;width:100%;max-width:12px;max-height:12px}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{border:var(--xy-node-border,var(--xy-node-border-default));color:var(--xy-node-color,var(--xy-node-color-default))}.react-flow__node-input.selected,.react-flow__node-input:focus,.react-flow__node-input:focus-visible,.react-flow__node-default.selected,.react-flow__node-default:focus,.react-flow__node-default:focus-visible,.react-flow__node-output.selected,.react-flow__node-output:focus,.react-flow__node-output:focus-visible,.react-flow__node-group.selected,.react-flow__node-group:focus,.react-flow__node-group:focus-visible{border:var(--xy-node-border-selected,var(--xy-node-border-selected-default));outline:none}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color,var(--xy-selection-background-color-default));border:var(--xy-selection-border,var(--xy-selection-border-default))}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;width:5px;height:5px;translate:-50% -50%}.react-flow__resize-control.handle.left{top:50%;left:0}.react-flow__resize-control.handle.right{top:50%;left:100%}.react-flow__resize-control.handle.top{top:0;left:50%}.react-flow__resize-control.handle.bottom{top:100%;left:50%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;height:100%;top:0;transform:translate(-50%)}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{width:100%;height:1px;left:0;transform:translateY(-50%)}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}@layer theme{:root,:host{--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--f-ui);--default-mono-font-family:var(--f-mono);--color-card:var(--card)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html:not([data-desktop]) :is(button,select,summary,[role=button],[role=switch],label:has(input[type=file]),input[type=color]):not(:disabled){cursor:pointer}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-x-6{inset-inline:calc(var(--spacing) * 6)}.inset-y-0{inset-block:0}.-top-0\.5{top:calc(var(--spacing) * -.5)}.-top-1{top:calc(var(--spacing) * -1)}.-top-1\.5{top:calc(var(--spacing) * -1.5)}.-top-2\.5{top:calc(var(--spacing) * -2.5)}.-top-3{top:calc(var(--spacing) * -3)}.-top-4{top:calc(var(--spacing) * -4)}.-top-14{top:calc(var(--spacing) * -14)}.-top-28{top:calc(var(--spacing) * -28)}.top-0{top:0}.top-0\.5{top:calc(var(--spacing) * .5)}.top-1{top:var(--spacing)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-3{top:calc(var(--spacing) * 3)}.top-6{top:calc(var(--spacing) * 6)}.top-11{top:calc(var(--spacing) * 11)}.top-12{top:calc(var(--spacing) * 12)}.top-full{top:100%}.-right-0\.5{right:calc(var(--spacing) * -.5)}.-right-1{right:calc(var(--spacing) * -1)}.-right-1\.5{right:calc(var(--spacing) * -1.5)}.-right-10{right:calc(var(--spacing) * -10)}.right-0{right:0}.right-1{right:var(--spacing)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.right-9{right:calc(var(--spacing) * 9)}.right-10{right:calc(var(--spacing) * 10)}.-bottom-1{bottom:calc(var(--spacing) * -1)}.-bottom-5{bottom:calc(var(--spacing) * -5)}.bottom-0\.5{bottom:calc(var(--spacing) * .5)}.bottom-2{bottom:calc(var(--spacing) * 2)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-10{bottom:calc(var(--spacing) * 10)}.bottom-12{bottom:calc(var(--spacing) * 12)}.bottom-\[22\%\]{bottom:22%}.-left-1\.5{left:calc(var(--spacing) * -1.5)}.left-0{left:0}.left-0\.5{left:calc(var(--spacing) * .5)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-3{left:calc(var(--spacing) * 3)}.left-4{left:calc(var(--spacing) * 4)}.left-\[9px\]{left:9px}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.order-first{order:-9999}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-5{grid-column:span 5/span 5}.col-span-full{grid-column:1/-1}.col-start-6{grid-column-start:6}.row-start-1{grid-row-start:1}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-3{margin:calc(var(--spacing) * 3)}.m-auto{margin:auto}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.-mx-5{margin-inline:calc(var(--spacing) * -5)}.mx-1\.5{margin-inline:calc(var(--spacing) * 1.5)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-5{margin-inline:calc(var(--spacing) * 5)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.my-1\.5{margin-block:calc(var(--spacing) * 1.5)}.-mt-1\.5{margin-top:calc(var(--spacing) * -1.5)}.-mt-2{margin-top:calc(var(--spacing) * -2)}.-mt-3{margin-top:calc(var(--spacing) * -3)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-3\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-9{margin-top:calc(var(--spacing) * 9)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mt-16{margin-top:calc(var(--spacing) * 16)}.mt-\[7px\]{margin-top:7px}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.-mr-1\.5{margin-right:calc(var(--spacing) * -1.5)}.-mr-2{margin-right:calc(var(--spacing) * -2)}.mr-0\.5{margin-right:calc(var(--spacing) * .5)}.mr-1{margin-right:var(--spacing)}.mr-\[0\.09em\]{margin-right:.09em}.mr-auto{margin-right:auto}.-mb-1\.5{margin-bottom:calc(var(--spacing) * -1.5)}.-mb-9{margin-bottom:calc(var(--spacing) * -9)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.-ml-1\.5{margin-left:calc(var(--spacing) * -1.5)}.-ml-3{margin-left:calc(var(--spacing) * -3)}.ml-1{margin-left:var(--spacing)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-8{margin-left:calc(var(--spacing) * 8)}.ml-\[0\.06em\]{margin-left:.06em}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.aspect-\[5\/2\]{aspect-ratio:5/2}.aspect-square{aspect-ratio:1}.size-1\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-11{width:calc(var(--spacing) * 11);height:calc(var(--spacing) * 11)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.size-20{width:calc(var(--spacing) * 20);height:calc(var(--spacing) * 20)}.size-28{width:calc(var(--spacing) * 28);height:calc(var(--spacing) * 28)}.size-48{width:calc(var(--spacing) * 48);height:calc(var(--spacing) * 48)}.size-80{width:calc(var(--spacing) * 80);height:calc(var(--spacing) * 80)}.size-\[3px\]{width:3px;height:3px}.size-\[22px\]{width:22px;height:22px}.size-\[54px\]{width:54px;height:54px}.size-\[72px\]{width:72px;height:72px}.size-full{width:100%;height:100%}.h-\(--sheet\){height:var(--sheet)}.h-0{height:0}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-28{height:calc(var(--spacing) * 28)}.h-40{height:calc(var(--spacing) * 40)}.h-\[3px\]{height:3px}.h-\[28rem\]{height:28rem}.h-\[46vh\]{height:46vh}.h-\[70dvh\]{height:70dvh}.h-dvh{height:100dvh}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-\[38vh\]{max-height:38vh}.max-h-\[46vh\]{max-height:46vh}.max-h-\[60dvh\]{max-height:60dvh}.max-h-\[68dvh\]{max-height:68dvh}.max-h-\[70dvh\]{max-height:70dvh}.max-h-\[70vh\]{max-height:70vh}.max-h-\[76vh\]{max-height:76vh}.max-h-\[200px\]{max-height:200px}.max-h-\[520px\]{max-height:520px}.max-h-\[calc\(100dvh-32px\)\]{max-height:calc(100dvh - 32px)}.max-h-\[calc\(100dvh-48px\)\]{max-height:calc(100dvh - 48px)}.min-h-0{min-height:0}.min-h-8{min-height:calc(var(--spacing) * 8)}.min-h-11{min-height:calc(var(--spacing) * 11)}.min-h-28{min-height:calc(var(--spacing) * 28)}.min-h-40{min-height:calc(var(--spacing) * 40)}.min-h-48{min-height:calc(var(--spacing) * 48)}.min-h-80{min-height:calc(var(--spacing) * 80)}.min-h-\[6\.5rem\]{min-height:6.5rem}.min-h-\[7rem\]{min-height:7rem}.min-h-\[40px\]{min-height:40px}.min-h-\[50vh\]{min-height:50vh}.min-h-\[60dvh\]{min-height:60dvh}.min-h-\[124px\]{min-height:124px}.min-h-dvh{min-height:100dvh}.min-h-full{min-height:100%}.w-0{width:0}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-24{width:calc(var(--spacing) * 24)}.w-28{width:calc(var(--spacing) * 28)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-44{width:calc(var(--spacing) * 44)}.w-56{width:calc(var(--spacing) * 56)}.w-72{width:calc(var(--spacing) * 72)}.w-\[280px\]{width:280px}.w-\[380px\]{width:380px}.w-\[calc\(100\%\+0\.5rem\)\]{width:calc(100% + .5rem)}.w-\[calc\(100\%-0\.75rem\)\]{width:calc(100% - .75rem)}.w-\[calc\(100\%-32px\)\]{width:calc(100% - 32px)}.w-\[calc\(100\%-48px\)\]{width:calc(100% - 48px)}.w-\[min\(68\%\,320px\)\]{width:min(68%,320px)}.w-\[var\(--ai-disc\)\]{width:var(--ai-disc)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[60\%\]{max-width:60%}.max-w-\[88rem\]{max-width:88rem}.max-w-\[160px\]{max-width:160px}.max-w-\[620px\]{max-width:620px}.max-w-\[640px\]{max-width:640px}.max-w-\[680px\]{max-width:680px}.max-w-\[1240px\]{max-width:1240px}.max-w-\[calc\(100vw-32px\)\]{max-width:calc(100vw - 32px)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-36{min-width:calc(var(--spacing) * 36)}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-60{min-width:calc(var(--spacing) * 60)}.min-w-\[7\.5rem\]{min-width:7.5rem}.min-w-\[9rem\]{min-width:9rem}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-56{flex-basis:calc(var(--spacing) * 56)}.basis-\[12rem\]{flex-basis:12rem}.basis-full{flex-basis:100%}.border-collapse{border-collapse:collapse}.origin-top{transform-origin:top}.origin-top-left{transform-origin:0 0}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[2px\]{--tw-translate-x:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[22px\]{--tw-translate-x:22px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-scale-x-100{--tw-scale-x:calc(100% * -1);scale:var(--tw-scale-x) var(--tw-scale-y)}.-rotate-90{rotate:-90deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-crosshair{cursor:crosshair}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-row-resize{cursor:row-resize}.cursor-zoom-in{cursor:zoom-in}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.scroll-mt-24{scroll-margin-top:calc(var(--spacing) * 24)}.\[scrollbar-width\:none\]{scrollbar-width:none}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-\[1fr_auto_1fr\]{grid-template-columns:1fr auto 1fr}.grid-cols-\[22px_minmax\(0\,1fr\)\]{grid-template-columns:22px minmax(0,1fr)}.grid-cols-\[auto_minmax\(0\,1fr\)\]{grid-template-columns:auto minmax(0,1fr)}.grid-cols-\[minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:minmax(0,1fr) auto auto}.grid-cols-\[repeat\(auto-fill\,minmax\(184px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(184px,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-7{gap:calc(var(--spacing) * 7)}.gap-8{gap:calc(var(--spacing) * 8)}.gap-9{gap:calc(var(--spacing) * 9)}.gap-10{gap:calc(var(--spacing) * 10)}.gap-x-1{column-gap:var(--spacing)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-2\.5{column-gap:calc(var(--spacing) * 2.5)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-5{column-gap:calc(var(--spacing) * 5)}.gap-x-7{column-gap:calc(var(--spacing) * 7)}.gap-y-0\.5{row-gap:calc(var(--spacing) * .5)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.gap-y-5{row-gap:calc(var(--spacing) * 5)}.gap-y-6{row-gap:calc(var(--spacing) * 6)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border-soft>:not(:last-child)){border-color:var(--border-soft)}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:calc(var(--radius) * 2)}.rounded-3xl{border-radius:calc(var(--radius) * 3)}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.rounded-t-3xl{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.rounded-b-xl{border-bottom-right-radius:calc(var(--radius) * 1.5);border-bottom-left-radius:calc(var(--radius) * 1.5)}.rounded-br-md{border-bottom-right-radius:calc(var(--radius) * .75)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\[\#1d1a17\]\/25{border-color:oklab(22.0098% .00284923 .00685373/.25)}.border-border{border-color:var(--border)}.border-border-soft{border-color:var(--border-soft)}.border-ember{border-color:var(--ember)}.border-ink-4{border-color:var(--ink-4)}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.border-white{border-color:var(--color-white)}.border-white\/40{border-color:#fff6}@supports (color:color-mix(in lab, red, red)){.border-white\/40{border-color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.border-white\/90{border-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.border-white\/90{border-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.bg-\(--coin-bg\,var\(--color-card\)\){background-color:var(--coin-bg,var(--color-card))}.bg-\[\#0f1424\]{background-color:#0f1424}.bg-\[\#e5484d\]{background-color:#e5484d}.bg-\[oklch\(20\%_0\.01_60\/0\.22\)\]{background-color:oklch(20% .01 60/.22)}.bg-accent{background-color:var(--accent)}.bg-amber{background-color:var(--amber)}.bg-amber-tint{background-color:var(--amber-tint)}.bg-background,.bg-background\/85{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){.bg-background\/85{background-color:color-mix(in oklab, var(--background) 85%, transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab, red, red)){.bg-black\/10{background-color:color-mix(in oklab, var(--color-black) 10%, transparent)}}.bg-border-soft{background-color:var(--border-soft)}.bg-card,.bg-card\/90{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\/90{background-color:color-mix(in oklab, var(--card) 90%, transparent)}}.bg-card\/95{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\/95{background-color:color-mix(in oklab, var(--card) 95%, transparent)}}.bg-cobalt{background-color:var(--cobalt)}.bg-cobalt-tint{background-color:var(--cobalt-tint)}.bg-ember{background-color:var(--ember)}.bg-ember-tint,.bg-ember-tint\/50{background-color:var(--ember-tint)}@supports (color:color-mix(in lab, red, red)){.bg-ember-tint\/50{background-color:color-mix(in oklab, var(--ember-tint) 50%, transparent)}}.bg-ember-veil{background-color:var(--ember-veil)}.bg-foreground{background-color:var(--foreground)}.bg-ink{background-color:var(--ink)}.bg-ink-4,.bg-ink-4\/40{background-color:var(--ink-4)}@supports (color:color-mix(in lab, red, red)){.bg-ink-4\/40{background-color:color-mix(in oklab, var(--ink-4) 40%, transparent)}}.bg-moss{background-color:var(--moss)}.bg-moss-tint{background-color:var(--moss-tint)}.bg-muted{background-color:var(--muted)}.bg-paper{background-color:var(--paper)}.bg-paper-2{background-color:var(--paper-2)}.bg-paper-3{background-color:var(--paper-3)}.bg-primary{background-color:var(--primary)}.bg-rose{background-color:var(--rose)}.bg-rose-tint{background-color:var(--rose-tint)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.bg-white\/10{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.bg-white\/12{background-color:#ffffff1f}@supports (color:color-mix(in lab, red, red)){.bg-white\/12{background-color:color-mix(in oklab, var(--color-white) 12%, transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.bg-white\/20{background-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.bg-white\/\[0\.07\]{background-color:#ffffff12}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.07\]{background-color:color-mix(in oklab, var(--color-white) 7.0%, transparent)}}.bg-linear-to-br{--tw-gradient-position:to bottom right}@supports (background-image:linear-gradient(in lab, red, red)){.bg-linear-to-br{--tw-gradient-position:to bottom right in oklab}}.bg-linear-to-br{background-image:linear-gradient(var(--tw-gradient-stops))}.from-ember-tint{--tw-gradient-from:var(--ember-tint);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-card{--tw-gradient-via:var(--card);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-card{--tw-gradient-to:var(--card);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-amber{fill:var(--amber)}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:0}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-8{padding:calc(var(--spacing) * 8)}.p-10{padding:calc(var(--spacing) * 10)}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-7{padding-block:calc(var(--spacing) * 7)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-14{padding-block:calc(var(--spacing) * 14)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-24{padding-block:calc(var(--spacing) * 24)}.py-\[3px\]{padding-block:3px}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-10{padding-top:calc(var(--spacing) * 10)}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-5{padding-right:calc(var(--spacing) * 5)}.pr-9{padding-right:calc(var(--spacing) * 9)}.pr-20{padding-right:calc(var(--spacing) * 20)}.pr-32{padding-right:calc(var(--spacing) * 32)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:var(--spacing)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-2\.5{padding-bottom:calc(var(--spacing) * 2.5)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-10{padding-bottom:calc(var(--spacing) * 10)}.pb-12{padding-bottom:calc(var(--spacing) * 12)}.pb-20{padding-bottom:calc(var(--spacing) * 20)}.pl-1{padding-left:var(--spacing)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-5\.5{padding-left:calc(var(--spacing) * 5.5)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-\[-2px\]{vertical-align:-2px}.align-top{vertical-align:top}.font-display{font-family:var(--f-display)}.font-mono{font-family:var(--f-mono)}.font-sans{font-family:var(--f-ui)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.75rem\]{font-size:.75rem}.text-\[0\.875rem\]{font-size:.875rem}.text-\[0\.6875rem\]{font-size:.6875rem}.text-\[0\.8125rem\]{font-size:.8125rem}.text-\[0\.9375rem\]{font-size:.9375rem}.text-\[0\.78125rem\]{font-size:.78125rem}.text-\[1\.25rem\]{font-size:1.25rem}.text-\[1\.75rem\]{font-size:1.75rem}.text-\[1\.375rem\]{font-size:1.375rem}.text-\[1\.0625rem\]{font-size:1.0625rem}.text-\[1\.625rem\]{font-size:1.625rem}.text-\[1\.875rem\]{font-size:1.875rem}.text-\[1rem\]{font-size:1rem}.text-\[2\.125rem\]{font-size:2.125rem}.text-\[2rem\]{font-size:2rem}.text-\[clamp\(28px\,3vw\,40px\)\]{font-size:clamp(28px,3vw,40px)}.leading-\[1\.1\]{--tw-leading:1.1;line-height:1.1}.leading-\[1\.5\]{--tw-leading:1.5;line-height:1.5}.leading-\[1\.06\]{--tw-leading:1.06;line-height:1.06}.leading-\[1\.08\]{--tw-leading:1.08;line-height:1.08}.leading-\[1\.15\]{--tw-leading:1.15;line-height:1.15}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[-0\.03em\]{--tw-tracking:-.03em;letter-spacing:-.03em}.tracking-\[0\.06em\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-\[0\.07em\]{--tw-tracking:.07em;letter-spacing:.07em}.tracking-\[0\.08em\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-\[0\.12em\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\[0\.14em\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-\[0\.16em\]{--tw-tracking:.16em;letter-spacing:.16em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#1d1a17\]\/40{color:oklab(22.0098% .00284923 .00685373/.4)}.text-\[oklch\(32\%_0\.15_262\)\]{color:oklch(32% .15 262)}.text-amber{color:var(--amber)}.text-background{color:var(--background)}.text-black{color:var(--color-black)}.text-cobalt{color:var(--cobalt)}.text-ember{color:var(--ember)}.text-ember-strong{color:var(--ember-strong)}.text-foreground{color:var(--foreground)}.text-ink{color:var(--ink)}.text-ink-2{color:var(--ink-2)}.text-ink-3{color:var(--ink-3)}.text-ink-4{color:var(--ink-4)}.text-moss{color:var(--moss)}.text-muted-foreground{color:var(--muted-foreground)}.text-paper{color:var(--paper)}.text-primary-foreground{color:var(--primary-foreground)}.text-rose{color:var(--rose)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab, red, red)){.text-white\/40{color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.text-white\/55{color:#ffffff8c}@supports (color:color-mix(in lab, red, red)){.text-white\/55{color:color-mix(in oklab, var(--color-white) 55%, transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab, red, red)){.text-white\/60{color:color-mix(in oklab, var(--color-white) 60%, transparent)}}.text-white\/65{color:#ffffffa6}@supports (color:color-mix(in lab, red, red)){.text-white\/65{color:color-mix(in oklab, var(--color-white) 65%, transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab, red, red)){.text-white\/70{color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.text-white\/75{color:#ffffffbf}@supports (color:color-mix(in lab, red, red)){.text-white\/75{color:color-mix(in oklab, var(--color-white) 75%, transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab, red, red)){.text-white\/80{color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.text-white\/85{color:#ffffffd9}@supports (color:color-mix(in lab, red, red)){.text-white\/85{color:color-mix(in oklab, var(--color-white) 85%, transparent)}}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.accent-\[var\(--ember\)\]{accent-color:var(--ember)}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-100{opacity:1}.opacity-\[0\.14\]{opacity:.14}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_0_1px_var\(--border-soft\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--border-soft));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_0_100vmax_rgb\(0_0_0\/0\.35\)\]{--tw-shadow:0 0 0 100vmax var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_1px_0_oklch\(0\%_0_0\/0\.08\)\]{--tw-shadow:0 1px 0 var(--tw-shadow-color,oklch(0% 0 0/.08));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_1px_3px_rgba\(0\,0\,0\,0\.25\)\]{--tw-shadow:0 1px 3px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_2px_8px_oklch\(0\%_0_0\/0\.22\)\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,oklch(0% 0 0/.22));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_6px_24px_oklch\(88\%_0\.17_150\/0\.35\)\]{--tw-shadow:0 6px 24px var(--tw-shadow-color,oklch(88% .17 150/.35));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[inset_0_1px_0_oklch\(0\%_0_0\/0\.02\)\]{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,oklch(0% 0 0/.02));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-elevated{--tw-shadow:var(--shadow-ember-elevated);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-overlay{--tw-shadow:var(--shadow-ember-overlay);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-soft{--tw-shadow:var(--shadow-ember-soft);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-amber\/30{--tw-ring-color:var(--amber)}@supports (color:color-mix(in lab, red, red)){.ring-amber\/30{--tw-ring-color:color-mix(in oklab, var(--amber) 30%, transparent)}}.ring-border{--tw-ring-color:var(--border)}.ring-border-soft{--tw-ring-color:var(--border-soft)}.ring-card{--tw-ring-color:var(--card)}.ring-ember{--tw-ring-color:var(--ember)}.ring-ember-strong\/40{--tw-ring-color:var(--ember-strong)}@supports (color:color-mix(in lab, red, red)){.ring-ember-strong\/40{--tw-ring-color:color-mix(in oklab, var(--ember-strong) 40%, transparent)}}.ring-ember-veil{--tw-ring-color:var(--ember-veil)}.ring-ember\/30{--tw-ring-color:var(--ember)}@supports (color:color-mix(in lab, red, red)){.ring-ember\/30{--tw-ring-color:color-mix(in oklab, var(--ember) 30%, transparent)}}.ring-ember\/60{--tw-ring-color:var(--ember)}@supports (color:color-mix(in lab, red, red)){.ring-ember\/60{--tw-ring-color:color-mix(in oklab, var(--ember) 60%, transparent)}}.ring-ink-4{--tw-ring-color:var(--ink-4)}.ring-input{--tw-ring-color:var(--input)}.ring-moss{--tw-ring-color:var(--moss)}.ring-rose,.ring-rose\/30{--tw-ring-color:var(--rose)}@supports (color:color-mix(in lab, red, red)){.ring-rose\/30{--tw-ring-color:color-mix(in oklab, var(--rose) 30%, transparent)}}.ring-white\/12{--tw-ring-color:#ffffff1f}@supports (color:color-mix(in lab, red, red)){.ring-white\/12{--tw-ring-color:color-mix(in oklab, var(--color-white) 12%, transparent)}}.ring-white\/15{--tw-ring-color:#ffffff26}@supports (color:color-mix(in lab, red, red)){.ring-white\/15{--tw-ring-color:color-mix(in oklab, var(--color-white) 15%, transparent)}}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\[1px\]{--tw-backdrop-blur:blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\,filter\,color\,transform\]{transition-property:background,filter,color,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,color\,box-shadow\,filter\]{transition-property:background-color,color,box-shadow,filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,color\,box-shadow\]{transition-property:background-color,color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[height\]{transition-property:height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[left\,translate\]{transition-property:left,translate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[opacity\,scale\,left\]{transition-property:opacity,scale,left;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\,margin\,opacity\]{transition-property:width,margin,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-700{--tw-duration:.7s;transition-duration:.7s}.ease-\[cubic-bezier\(0\.3\,0\.7\,0\.2\,1\)\]{--tw-ease:cubic-bezier(.3,.7,.2,1);transition-timing-function:cubic-bezier(.3,.7,.2,1)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.ring-inset{--tw-ring-inset:inset}.group-open\:rotate-90:is(:where(.group):is([open],:popover-open,:open) *){rotate:90deg}@media (hover:hover){.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:bg-ember\/70:is(:where(.group):hover *){background-color:var(--ember)}@supports (color:color-mix(in lab, red, red)){.group-hover\:bg-ember\/70:is(:where(.group):hover *){background-color:color-mix(in oklab, var(--ember) 70%, transparent)}}.group-hover\:text-white\/80:is(:where(.group):hover *){color:#fffc}@supports (color:color-mix(in lab, red, red)){.group-hover\:text-white\/80:is(:where(.group):hover *){color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.group-hover\:opacity-0:is(:where(.group):hover *){opacity:0}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-focus-visible\:bg-ember:is(:where(.group):focus-visible *){background-color:var(--ember)}.group-focus-visible\:opacity-0:is(:where(.group):focus-visible *){opacity:0}.group-focus-visible\:opacity-100:is(:where(.group):focus-visible *){opacity:1}.group-active\:h-16:is(:where(.group):active *){height:calc(var(--spacing) * 16)}.group-active\:w-14:is(:where(.group):active *){width:calc(var(--spacing) * 14)}.group-active\:bg-ember:is(:where(.group):active *){background-color:var(--ember)}@media (hover:hover){.group-enabled\:group-hover\:translate-x-0\.5:is(:where(.group):enabled *):is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}}.placeholder\:truncate::placeholder{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.placeholder\:text-ink-4::placeholder{color:var(--ink-4)}.placeholder\:text-transparent::placeholder{color:#0000}.backdrop\:bg-\[oklch\(20\%_0\.01_60\/0\.28\)\]::backdrop{background-color:oklch(20% .01 60/.28)}.backdrop\:backdrop-blur-\[2px\]::backdrop{--tw-backdrop-blur:blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:-inset-x-1:before{content:var(--tw-content);inset-inline:calc(var(--spacing) * -1)}.before\:inset-x-0:before{content:var(--tw-content);inset-inline:0}.before\:-inset-y-2\.5:before{content:var(--tw-content);inset-block:calc(var(--spacing) * -2.5)}.before\:-top-4:before{content:var(--tw-content);top:calc(var(--spacing) * -4)}.before\:h-4:before{content:var(--tw-content);height:calc(var(--spacing) * 4)}.before\:content-\[\'\'\]:before{--tw-content:"";content:var(--tw-content)}.first\:mt-0:first-child{margin-top:0}.first\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.first\:border-l-0:first-child{border-left-style:var(--tw-border-style);border-left-width:0}.first\:pt-0:first-child{padding-top:0}.first\:pl-0:first-child{padding-left:0}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.last\:pb-0:last-child{padding-bottom:0}.focus-within\:w-full:focus-within{width:100%}.focus-within\:border-focus:focus-within{border-color:var(--focus-line)}.focus-within\:opacity-100:focus-within{opacity:1}.focus-within\:ring-2:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\:ring-4:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\:ring-focus:focus-within{--tw-ring-color:var(--focus-line)}.focus-within\:ring-focus-glow:focus-within{--tw-ring-color:var(--focus-glow)}@media (hover:hover){.hover\:w-\[var\(--ai-long\)\]:hover{width:var(--ai-long)}.hover\:border-ember:hover{border-color:var(--ember)}.hover\:border-ink-4:hover{border-color:var(--ink-4)}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-card:hover,.hover\:bg-card\/60:hover{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-card\/60:hover{background-color:color-mix(in oklab, var(--card) 60%, transparent)}}.hover\:bg-paper-2:hover{background-color:var(--paper-2)}.hover\:bg-paper-3:hover{background-color:var(--paper-3)}.hover\:bg-rose-tint:hover{background-color:var(--rose-tint)}.hover\:bg-transparent:hover{background-color:#0000}.hover\:bg-white\/15:hover{background-color:#ffffff26}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/15:hover{background-color:color-mix(in oklab, var(--color-white) 15%, transparent)}}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.hover\:bg-white\/90:hover{background-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/90:hover{background-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.hover\:text-ink:hover{color:var(--ink)}.hover\:text-ink-2:hover{color:var(--ink-2)}.hover\:text-ink-3:hover{color:var(--ink-3)}.hover\:text-rose:hover{color:var(--rose)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-elevated:hover{--tw-shadow:var(--shadow-ember-elevated);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\:ring-2:hover{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\:ring-border:hover{--tw-ring-color:var(--border)}.hover\:ring-border-soft:hover{--tw-ring-color:var(--border-soft)}.hover\:ring-ember:hover{--tw-ring-color:var(--ember)}.hover\:ring-ink-4:hover{--tw-ring-color:var(--ink-4)}.hover\:brightness-105:hover{--tw-brightness:brightness(105%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\:brightness-\[1\.06\]:hover{--tw-brightness:brightness(1.06);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\:border-ember:focus{border-color:var(--ember)}.focus\:border-focus:focus{border-color:var(--focus-line)}.focus\:bg-card:focus{background-color:var(--card)}.focus\:bg-paper:focus{background-color:var(--paper)}.focus\:text-ink:focus{color:var(--ink)}.focus\:opacity-100:focus{opacity:1}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-4:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-border:focus{--tw-ring-color:var(--border)}.focus\:ring-focus-glow:focus{--tw-ring-color:var(--focus-glow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus-visible\:w-\[var\(--ai-long\)\]:focus-visible{width:var(--ai-long)}.focus-visible\:opacity-100:focus-visible{opacity:1}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-focus:focus-visible{--tw-ring-color:var(--focus-line)}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.active\:scale-\[0\.98\]:active{scale:.98}.active\:brightness-95:active{--tw-brightness:brightness(95%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:line-through:disabled{text-decoration-line:line-through}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}@media (hover:hover){.disabled\:hover\:bg-transparent:disabled:hover{background-color:#0000}}.has-\[input\:not\(\:placeholder-shown\)\]\:w-full:has(:is(input:not(:placeholder-shown))){width:100%}.aria-pressed\:bg-foreground[aria-pressed=true]{background-color:var(--foreground)}.aria-pressed\:text-background[aria-pressed=true]{color:var(--background)}.aria-pressed\:ring-2[aria-pressed=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.aria-pressed\:ring-current[aria-pressed=true]{--tw-ring-color:currentcolor}.data-\[open\=true\]\:w-\[var\(--ai-long\)\][data-open=true]{width:var(--ai-long)}.data-\[over\]\:border-focus[data-over]{border-color:var(--focus-line)}.data-\[over\]\:bg-paper-2[data-over]{background-color:var(--paper-2)}.data-\[over\]\:text-ink[data-over]{color:var(--ink)}@media (prefers-reduced-motion:reduce){.motion-reduce\:transition-none{transition-property:none}}@media not all and (width>=420px){.max-\[420px\]\:hidden{display:none}}@media not all and (width>=64rem){.max-lg\:pointer-events-none{pointer-events:none}.max-lg\:left-1\/2{left:50%}.max-lg\:hidden{display:none}.max-lg\:h-0{height:0}.max-lg\:h-\[148px\]{height:148px}.max-lg\:-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.max-lg\:scale-\[0\.4\]{scale:.4}.max-lg\:scale-\[0\.6\]{scale:.6}.max-lg\:text-center{text-align:center}.max-lg\:opacity-0{opacity:0}.max-lg\:opacity-100{opacity:1}@media (prefers-reduced-motion:no-preference){.max-lg\:motion-safe\:transition-\[height\]{transition-property:height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.max-lg\:motion-safe\:duration-200{--tw-duration:.2s;transition-duration:.2s}}}@media not all and (width>=48rem){.max-md\:scroll-mt-36{scroll-margin-top:calc(var(--spacing) * 36)}.max-md\:py-2{padding-block:calc(var(--spacing) * 2)}}@media not all and (width>=40rem){.max-sm\:sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.max-sm\:col-span-3{grid-column:span 3/span 3}.max-sm\:m-0{margin:0}.max-sm\:-mx-3{margin-inline:calc(var(--spacing) * -3)}.max-sm\:ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.max-sm\:hidden{display:none}.max-sm\:size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.max-sm\:h-dvh{height:100dvh}.max-sm\:max-h-none{max-height:none}.max-sm\:w-auto{width:auto}.max-sm\:w-full{width:100%}.max-sm\:max-w-none{max-width:none}.max-sm\:basis-full{flex-basis:100%}.max-sm\:\[scrollbar-width\:none\]{scrollbar-width:none}.max-sm\:overflow-x-auto{overflow-x:auto}.max-sm\:overflow-y-auto{overflow-y:auto}.max-sm\:rounded-none{border-radius:0}.max-sm\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.max-sm\:border-border-soft{border-color:var(--border-soft)}.max-sm\:px-3{padding-inline:calc(var(--spacing) * 3)}.max-sm\:pr-10{padding-right:calc(var(--spacing) * 10)}.max-sm\:pb-4{padding-bottom:calc(var(--spacing) * 4)}.max-sm\:font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}}@media (width>=40rem){.sm\:-top-3\.5{top:calc(var(--spacing) * -3.5)}.sm\:-right-3\.5{right:calc(var(--spacing) * -3.5)}.sm\:order-none{order:0}.sm\:col-span-1{grid-column:span 1/span 1}.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-start-auto{grid-column-start:auto}.sm\:row-start-auto{grid-row-start:auto}.sm\:-mx-7{margin-inline:calc(var(--spacing) * -7)}.sm\:mt-6{margin-top:calc(var(--spacing) * 6)}.sm\:mr-1{margin-right:var(--spacing)}.sm\:block{display:block}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:inline-flex{display:inline-flex}.sm\:size-20{width:calc(var(--spacing) * 20);height:calc(var(--spacing) * 20)}.sm\:h-11{height:calc(var(--spacing) * 11)}.sm\:min-h-0{min-height:0}.sm\:min-h-\[136px\]{min-height:136px}.sm\:w-32{width:calc(var(--spacing) * 32)}.sm\:w-56{width:calc(var(--spacing) * 56)}.sm\:w-auto{width:auto}.sm\:max-w-2xl{max-width:var(--container-2xl)}.sm\:max-w-4xl{max-width:var(--container-4xl)}.sm\:max-w-md{max-width:var(--container-md)}.sm\:flex-1{flex:1}.sm\:basis-0{flex-basis:0}.sm\:\[grid-template-columns\:var\(--cols\)\]{grid-template-columns:var(--cols)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:grid-cols-\[1fr_2fr_auto\]{grid-template-columns:1fr 2fr auto}.sm\:grid-cols-\[7\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:7.5rem minmax(0,1fr)}.sm\:grid-cols-\[9rem_minmax\(0\,1fr\)\]{grid-template-columns:9rem minmax(0,1fr)}.sm\:grid-cols-\[230px_minmax\(0\,1fr\)\]{grid-template-columns:230px minmax(0,1fr)}.sm\:grid-cols-\[minmax\(0\,1fr\)_12rem_auto\]{grid-template-columns:minmax(0,1fr) 12rem auto}.sm\:grid-cols-\[minmax\(0\,2fr\)_minmax\(0\,3fr\)_auto_auto\]{grid-template-columns:minmax(0,2fr) minmax(0,3fr) auto auto}.sm\:grid-rows-\[minmax\(0\,1fr\)\]{grid-template-rows:minmax(0,1fr)}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:justify-center{justify-content:center}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:gap-4{gap:calc(var(--spacing) * 4)}.sm\:gap-8{gap:calc(var(--spacing) * 8)}.sm\:overflow-y-auto{overflow-y:auto}.sm\:rounded-t-2xl{border-top-left-radius:calc(var(--radius) * 2);border-top-right-radius:calc(var(--radius) * 2)}.sm\:bg-transparent{background-color:#0000}.sm\:p-0{padding:0}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:p-7{padding:calc(var(--spacing) * 7)}.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:px-7{padding-inline:calc(var(--spacing) * 7)}.sm\:px-10{padding-inline:calc(var(--spacing) * 10)}.sm\:py-16{padding-block:calc(var(--spacing) * 16)}.sm\:pt-6{padding-top:calc(var(--spacing) * 6)}.sm\:pt-8{padding-top:calc(var(--spacing) * 8)}.sm\:pt-16{padding-top:calc(var(--spacing) * 16)}.sm\:pr-36{padding-right:calc(var(--spacing) * 36)}.sm\:pr-40{padding-right:calc(var(--spacing) * 40)}.sm\:pb-6{padding-bottom:calc(var(--spacing) * 6)}.sm\:pb-8{padding-bottom:calc(var(--spacing) * 8)}.sm\:pb-16{padding-bottom:calc(var(--spacing) * 16)}.sm\:text-\[1\.75rem\]{font-size:1.75rem}.sm\:text-\[2\.125rem\]{font-size:2.125rem}.sm\:text-\[2\.375rem\]{font-size:2.375rem}.sm\:text-\[2rem\]{font-size:2rem}.sm\:placeholder\:text-ink-4::placeholder{color:var(--ink-4)}}@media (width>=48rem){.md\:sticky{position:sticky}.md\:top-20{top:calc(var(--spacing) * 20)}.md\:hidden{display:none}.md\:inline-flex{display:inline-flex}.md\:grid-cols-\[13\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:13.5rem minmax(0,1fr)}.md\:gap-8{gap:calc(var(--spacing) * 8)}.md\:self-start{align-self:flex-start}}@media (width>=64rem){.lg\:pointer-events-none{pointer-events:none}.lg\:top-\[calc\(6vh\+5\.25rem\)\]{top:calc(6vh + 5.25rem)}.lg\:left-0{left:0}.lg\:left-\[calc\(50\%-508px\)\]{left:calc(50% - 508px)}.lg\:left-\[calc\(50\%-560px\)\]{left:calc(50% - 560px)}.lg\:ml-0{margin-left:0}.lg\:ml-\[calc\(50\%-16rem\)\]{margin-left:calc(50% - 16rem)}.lg\:block{display:block}.lg\:hidden{display:none}.lg\:inline{display:inline}.lg\:h-0{height:0}.lg\:h-\[calc\(100vh-27rem\)\]{height:calc(100vh - 27rem)}.lg\:h-auto{height:auto}.lg\:max-h-\[calc\(100vh-15rem\)\]{max-height:calc(100vh - 15rem)}.lg\:max-h-\[calc\(100vh-27rem\)\]{max-height:calc(100vh - 27rem)}.lg\:min-h-\[6\.5rem\]{min-height:6.5rem}.lg\:min-h-\[360px\]{min-height:360px}.lg\:w-\(--pane\){width:var(--pane)}.lg\:w-\[32rem\]{width:32rem}.lg\:origin-center{transform-origin:50%}.lg\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.lg\:scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x) var(--tw-scale-y)}.lg\:scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-\[1fr_280px\]{grid-template-columns:1fr 280px}.lg\:grid-cols-\[15rem_minmax\(0\,1fr\)\]{grid-template-columns:15rem minmax(0,1fr)}.lg\:grid-cols-\[minmax\(280px\,360px\)_minmax\(0\,1fr\)\]{grid-template-columns:minmax(280px,360px) minmax(0,1fr)}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}.lg\:gap-10{gap:calc(var(--spacing) * 10)}.lg\:gap-14{gap:calc(var(--spacing) * 14)}.lg\:rounded-tr-none{border-top-right-radius:0}.lg\:pt-3{padding-top:calc(var(--spacing) * 3)}.lg\:pt-\[6vh\]{padding-top:6vh}.lg\:text-left{text-align:left}.lg\:opacity-0{opacity:0}.lg\:opacity-100{opacity:1}.lg\:transition-\[margin\]{transition-property:margin;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.lg\:duration-700{--tw-duration:.7s;transition-duration:.7s}}.dark\:block:is(.dark *){display:block}.dark\:hidden:is(.dark *){display:none}@media (pointer:coarse){.coarse\:-my-3{margin-block:calc(var(--spacing) * -3)}.coarse\:size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.coarse\:size-11{width:calc(var(--spacing) * 11);height:calc(var(--spacing) * 11)}.coarse\:h-11{height:calc(var(--spacing) * 11)}.coarse\:min-h-11{min-height:calc(var(--spacing) * 11)}.coarse\:min-w-11{min-width:calc(var(--spacing) * 11)}.coarse\:px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.coarse\:px-4{padding-inline:calc(var(--spacing) * 4)}.coarse\:py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.coarse\:opacity-100{opacity:1}}@media not all and (width>=40rem){.max-sm\:\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}}.\[\&\:\:-webkit-search-cancel-button\]\:hidden::-webkit-search-cancel-button{display:none}.\[\&\>svg\]\:size-full>svg{width:100%;height:100%}}:root,.dark .tone-flip{--raw-primary:#e0531b;--raw-secondary:#f1f3f5;--raw-background:#faf8f5;--raw-sidebar:var(--paper);--contrast:1;--hue-success:150;--hue-danger:25;--hue-warning:70;--hue-info:264;--paper:oklch(from var(--raw-background) calc(.99 - (.02 * var(--contrast))) c h);--paper-2:oklch(from var(--raw-background) calc(.96 - (.03 * var(--contrast))) calc(c * 1.2) h);--paper-3:oklch(from var(--raw-background) calc(.94 - (.04 * var(--contrast))) calc(c * 1.5) h);--canvas:var(--paper);--canvas-dim:var(--paper-2);--canvas-darken:var(--paper-3);--ink:oklch(from var(--raw-background) calc(.22 + (.05 / var(--contrast))) calc(c * 1.2) h);--ink-2:oklch(from var(--raw-background) calc(.4 + (.05 / var(--contrast))) c h);--ink-3:oklch(from var(--raw-background) calc(.55 + (.05 / var(--contrast))) calc(c * .8) h);--ink-4:oklch(from var(--raw-background) calc(.7 + (.05 / var(--contrast))) calc(c * .6) h);--ember:oklch(from var(--raw-primary) l c h);--ember-strong:oklch(from var(--raw-primary) calc(l - (.08 * var(--contrast))) c h);--ember-tint:oklch(from var(--raw-primary) calc(.96 + .02 * (1 - var(--contrast))) calc(c * .2) h);--ember-veil:oklch(from var(--raw-primary) l c h / .1);--cobalt:var(--info);--cobalt-tint:var(--info-tint);--moss:var(--success);--moss-tint:var(--success-tint);--amber:var(--warning);--amber-tint:var(--warning-tint);--rose:var(--danger);--rose-tint:var(--danger-tint);--danger:oklch(from var(--raw-background) calc(.64 - (.05 * var(--contrast))) .2 var(--hue-danger));--danger-tint:oklch(from var(--raw-background) calc(.98 - (.01 * var(--contrast))) .03 var(--hue-danger));--success:oklch(from var(--raw-background) calc(.48 - (.04 * var(--contrast))) .13 var(--hue-success));--success-tint:oklch(from var(--raw-background) calc(.98 - (.01 * var(--contrast))) .025 var(--hue-success));--warning:oklch(from var(--raw-background) calc(.78 - (.04 * var(--contrast))) .16 var(--hue-warning));--warning-tint:oklch(from var(--raw-background) calc(.98 - (.01 * var(--contrast))) .04 var(--hue-warning));--info:oklch(from var(--raw-background) calc(.5 - (.05 * var(--contrast))) .18 var(--hue-info));--info-tint:oklch(from var(--raw-background) calc(.98 - (.01 * var(--contrast))) .025 var(--hue-info));--link:var(--info);--secondary-accent:oklch(from var(--raw-secondary) l c h);--secondary-accent-strong:oklch(from var(--raw-secondary) calc(l - (.08 * var(--contrast))) c h);--f-display:"Space Grotesk", ui-sans-serif, system-ui, sans-serif;--f-ui:"Geist", ui-sans-serif, system-ui, sans-serif;--f-mono:"Geist Mono", ui-monospace, monospace;--t-display-l:56px;--t-display:40px;--t-h1:28px;--t-h2:20px;--t-h3:16px;--t-body:14px;--t-ui:13px;--t-small:12px;--t-micro:11px;--s-1:4px;--s-2:8px;--s-3:12px;--s-4:16px;--s-5:20px;--s-6:24px;--s-8:32px;--s-10:40px;--s-12:48px;--s-16:64px;--r-1:2px;--r-2:4px;--r-3:6px;--r-4:12px;--r-5:16px;--r-pill:999px;--shadow-ember-elevated:0 1px 2px oklch(from var(--raw-background) .4 c h / .04), 0 6px 18px oklch(from var(--raw-background) .2 c h / .06);--shadow-ember-overlay:0 2px 4px oklch(from var(--raw-background) .2 c h / .08), 0 10px 28px oklch(from var(--raw-background) .15 c h / .16);--shadow-ember-soft:0 1px 2px oklch(from var(--raw-background) .4 c h / .03), 0 3px 10px oklch(from var(--raw-background) .3 c h / .05);--e-1:0 1px 0 oklch(from var(--raw-background) .7 c h / .08);--e-2:var(--shadow-ember-elevated);--e-3:0 1px 2px oklch(from var(--raw-background) .4 c h / .04), 0 6px 18px oklch(from var(--raw-background) .4 c h / .06), 0 18px 36px oklch(from var(--raw-background) .4 c h / .07);--shadow-shell-secondary-edge:0 2px 24px -8px oklch(from var(--raw-background) .35 c h / .14);--shadow-shell-copilot-edge:0 2px 24px -8px oklch(from var(--raw-background) .35 c h / .14);--row-compact:28px;--row-default:32px;--row-comfy:40px;--shell-row:44px;--shell-footer:48px;--input-inset:oklch(from var(--raw-background) calc(calc(.99 - (.02 * var(--contrast))) - (.12 * var(--contrast))) calc(c * 3) h / .65)}.dark,.tone-flip{--raw-sidebar:oklch(from var(--raw-background) calc(.09 + (.03 * var(--contrast))) calc(c * 1.2) h);--paper:oklch(from var(--raw-background) calc(.12 + (.03 * var(--contrast))) c h);--paper-2:oklch(from var(--raw-background) calc(.15 + (.02 * var(--contrast))) calc(c * 1.2) h);--paper-3:oklch(from var(--raw-background) calc(.18 + (.01 * var(--contrast))) calc(c * 1.5) h);--ink:oklch(from var(--raw-background) calc(.92 - (.05 / var(--contrast))) calc(c * 1.2) h);--ink-2:oklch(from var(--raw-background) calc(.85 - (.05 / var(--contrast))) c h);--ink-3:oklch(from var(--raw-background) calc(.72 - (.05 / var(--contrast))) calc(c * .8) h);--ink-4:oklch(from var(--raw-background) calc(.58 - (.05 / var(--contrast))) calc(c * .6) h);--input-inset:oklch(from var(--raw-background) calc(calc(.12 + (.03 * var(--contrast))) + (.21 * var(--contrast))) calc(c * 2.8) h / .65);--ember-strong:oklch(from var(--raw-primary) calc(l + (.08 * var(--contrast))) c h);--ember-tint:oklch(from var(--raw-primary) calc(.18 + .02 * var(--contrast)) calc(c * .35) h);--secondary-accent-strong:oklch(from var(--raw-secondary) calc(l + (.08 * var(--contrast))) c h);--danger:oklch(from var(--raw-background) calc(.62 + (.05 * var(--contrast))) .2 var(--hue-danger));--danger-tint:oklch(from var(--raw-background) calc(.18 + (.02 * var(--contrast))) .05 var(--hue-danger));--success:oklch(from var(--raw-background) calc(.65 + (.05 * var(--contrast))) .13 var(--hue-success));--success-tint:oklch(from var(--raw-background) calc(.18 + (.02 * var(--contrast))) .04 var(--hue-success));--warning:oklch(from var(--raw-background) calc(.78 + (.04 * var(--contrast))) .16 var(--hue-warning));--warning-tint:oklch(from var(--raw-background) calc(.18 + (.02 * var(--contrast))) .05 var(--hue-warning));--info:oklch(from var(--raw-background) calc(.72 + (.05 * var(--contrast))) .18 var(--hue-info));--info-tint:oklch(from var(--raw-background) calc(.18 + (.02 * var(--contrast))) .04 var(--hue-info));--shadow-ember-elevated:0 1px 2px oklch(0% 0 0/.22), 0 6px 18px oklch(0% 0 0/.28);--shadow-ember-overlay:0 2px 4px oklch(0% 0 0/.3), 0 10px 28px oklch(0% 0 0/.44);--shadow-ember-soft:0 1px 2px oklch(0% 0 0/.18), 0 3px 10px oklch(0% 0 0/.22);--e-2:var(--shadow-ember-elevated);--e-3:0 1px 2px oklch(0% 0 0/.22), 0 6px 18px oklch(0% 0 0/.28), 0 24px 48px oklch(0% 0 0/.32);--shadow-shell-secondary-edge:0 2px 28px -10px oklch(0% 0 0/.5);--shadow-shell-copilot-edge:0 2px 28px -10px oklch(0% 0 0/.5)}.tone-flip{--canvas:var(--paper);--canvas-dim:var(--paper-2);--canvas-darken:var(--paper-3);--cobalt:var(--info);--cobalt-tint:var(--info-tint);--moss:var(--success);--moss-tint:var(--success-tint);--amber:var(--warning);--amber-tint:var(--warning-tint);--rose:var(--danger);--rose-tint:var(--danger-tint);--link:var(--info);color:var(--foreground)}@media (prefers-contrast:more){:root{--contrast:1.4}}.theme-high-contrast{--contrast:1.4}.theme-deuteranopia,.theme-protanopia{--hue-success:195;--hue-danger:15;--hue-warning:50}.theme-tritanopia{--hue-success:165;--hue-warning:10;--hue-info:140}:root,.dark .tone-flip{--background:var(--canvas);--foreground:var(--ink);--card:oklch(100% 0 0);--card-foreground:var(--ink);--popover:oklch(from var(--card) l c h / .72);--popover-foreground:var(--ink);--primary:var(--ember-strong);--primary-foreground:oklch(99% 0 0);--secondary:var(--paper-2);--secondary-foreground:var(--ink);--muted:var(--paper-3)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--muted:color-mix(in oklch, var(--paper-3) 32%, var(--card))}}:root,.dark .tone-flip{--muted-foreground:var(--ink-3);--accent:var(--ink)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--accent:color-mix(in oklch, var(--ink) calc(7.5% * var(--contrast)), var(--paper))}}:root,.dark .tone-flip{--accent-foreground:var(--ink);--destructive:var(--danger);--destructive-foreground:oklch(99% 0 0);--border:var(--ink)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--border:color-mix(in oklch, var(--ink) calc(12% * var(--contrast)), var(--paper))}}:root,.dark .tone-flip{--border-soft:var(--border)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--border-soft:color-mix(in oklch, var(--border) 50%, transparent)}}:root,.dark .tone-flip{--input:var(--ink)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--input:color-mix(in oklch, var(--ink) calc(10% * var(--contrast)), var(--paper))}}:root,.dark .tone-flip{--ring:var(--ember)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--ring:color-mix(in oklch, var(--ember) 45%, transparent)}}:root,.dark .tone-flip{--link:var(--info);--chart-1:var(--moss);--chart-2:var(--cobalt);--chart-3:var(--ember);--chart-4:var(--amber);--chart-5:var(--rose);--sidebar:oklch(from var(--raw-sidebar) l c h);--sidebar-foreground:oklch(from var(--sidebar) clamp(.15, (.62 - l) * 100, .98) calc(c * .06) h);--sidebar-primary:var(--ember);--sidebar-primary-foreground:oklch(from var(--ember) calc(1 - l) calc(c * .1) h);--sidebar-accent:oklch(from var(--sidebar) calc(l + .05 * (1 - 2 * l)) c h);--sidebar-accent-foreground:oklch(from var(--sidebar) clamp(.15, (.62 - l) * 100, .98) calc(c * .06) h);--sidebar-border:var(--sidebar)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--sidebar-border:color-mix(in oklch, var(--sidebar) 82%, var(--sidebar-foreground))}}:root,.dark .tone-flip{--sidebar-ring:var(--sidebar-primary)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--sidebar-ring:color-mix(in oklch, var(--sidebar-primary) 65%, transparent)}}:root,.dark .tone-flip{--font-sans:var(--f-ui);--font-heading:var(--f-display);--font-mono:var(--f-mono);--radius:.5rem;--radius-button:.5rem;--shadow-2xs:var(--e-1);--shadow-xs:0 1px 2px oklch(40% var(--seed-neutral-c) var(--seed-neutral-h) / .06);--shadow-sm:var(--e-2);--shadow-md:0 4px 12px oklch(40% var(--seed-neutral-c) var(--seed-neutral-h) / .08);--shadow-lg:var(--e-3);--shadow-xl:0 20px 40px oklch(35% var(--seed-neutral-c) var(--seed-neutral-h) / .12);--shadow-2xl:0 24px 48px oklch(30% var(--seed-neutral-c) var(--seed-neutral-h) / .16)}.dark,.tone-flip{--background:var(--canvas);--foreground:var(--ink);--card:var(--paper-2);--card-foreground:var(--ink);--popover:oklch(from var(--card) l c h / .78);--popover-foreground:var(--ink);--primary:var(--ember-strong);--primary-foreground:oklch(from var(--raw-background) .16 .02 h);--secondary:var(--paper-2);--secondary-foreground:var(--ink-2);--muted:var(--paper-3)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--muted:color-mix(in oklch, var(--paper-3) 45%, var(--card))}}.dark,.tone-flip{--muted-foreground:var(--ink-3);--accent:var(--ink)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--accent:color-mix(in oklch, var(--ink) calc(10% * var(--contrast)), var(--paper))}}.dark,.tone-flip{--accent-foreground:var(--ink);--destructive:var(--danger);--destructive-foreground:oklch(99% 0 0);--border:var(--ink)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--border:color-mix(in oklch, var(--ink) calc(12% * var(--contrast)), var(--paper))}}.dark,.tone-flip{--border-soft:var(--border)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--border-soft:color-mix(in oklch, var(--border) 50%, transparent)}}.dark,.tone-flip{--input:var(--ink)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--input:color-mix(in oklch, var(--ink) calc(10% * var(--contrast)), var(--paper))}}.dark,.tone-flip{--ring:var(--ember)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--ring:color-mix(in oklch, var(--ember) 55%, transparent)}}.dark,.tone-flip{--link:var(--info);--chart-1:var(--moss);--chart-2:var(--cobalt);--chart-3:var(--ember);--chart-4:var(--amber);--chart-5:var(--rose);--sidebar:oklch(from var(--raw-sidebar) l c h);--sidebar-foreground:oklch(from var(--sidebar) clamp(.15, (.62 - l) * 100, .98) calc(c * .06) h);--sidebar-primary:var(--ember);--sidebar-primary-foreground:oklch(from var(--ember) calc(1 - l) calc(c * .1) h);--sidebar-accent:oklch(from var(--sidebar) calc(l + .05 * (1 - 2 * l)) c h);--sidebar-accent-foreground:oklch(from var(--sidebar) clamp(.15, (.62 - l) * 100, .98) calc(c * .06) h);--sidebar-border:var(--sidebar)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--sidebar-border:color-mix(in oklch, var(--sidebar) 82%, var(--sidebar-foreground))}}.dark,.tone-flip{--sidebar-ring:var(--sidebar-primary)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--sidebar-ring:color-mix(in oklch, var(--sidebar-primary) 55%, transparent)}}.dark,.tone-flip{--shadow-2xs:0 1px 0 oklch(0% 0 0/.2);--shadow-xs:0 1px 2px oklch(0% 0 0/.25);--shadow-sm:var(--e-2);--shadow-md:0 4px 14px oklch(0% 0 0/.32);--shadow-lg:var(--e-3);--shadow-xl:0 20px 40px oklch(0% 0 0/.42);--shadow-2xl:0 24px 56px oklch(0% 0 0/.48)}.dark{--stage:oklch(34% .14 264);--raw-background:var(--stage);--raw-sidebar:oklch(from var(--stage) calc(l - .04) c h);--paper:oklch(from var(--stage) l c h);--card:oklch(from var(--stage) calc(l + .06) calc(c * .95) h);--paper-2:oklch(from var(--stage) calc(l + .1) calc(c * .92) h);--paper-3:oklch(from var(--stage) calc(l + .14) calc(c * .88) h);--ink:oklch(from var(--stage) .97 .015 h);--ink-2:oklch(from var(--stage) .9 .03 h);--ink-3:oklch(from var(--stage) .8 .05 h);--ink-4:oklch(from var(--stage) .68 .06 h);--accent:var(--ink)}@supports (color:color-mix(in lab, red, red)){.dark{--accent:color-mix(in oklch, var(--ink) 10%, var(--card))}}.dark{--border:var(--ink)}@supports (color:color-mix(in lab, red, red)){.dark{--border:color-mix(in oklch, var(--ink) 18%, var(--card))}}.dark{--input:var(--ink)}@supports (color:color-mix(in lab, red, red)){.dark{--input:color-mix(in oklch, var(--ink) 24%, var(--card))}}.dark{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}html{-webkit-text-size-adjust:100%;font-size:16px}@media ((width>768px)) and ((width<1280px)){html[data-studio]{font-size:14px}}body{background:var(--background);color:var(--foreground);font-family:var(--f-ui);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#root{min-height:100dvh}@media (pointer:coarse){input:not([type=checkbox],[type=radio],[type=range],[type=color]),textarea,select{font-size:16px}}button,a,[role=switch]{-webkit-tap-highlight-color:transparent;touch-action:manipulation}.safe-top{padding-top:env(safe-area-inset-top)}.safe-x{padding-left:max(1.25rem, env(safe-area-inset-left));padding-right:max(1.25rem, env(safe-area-inset-right))}.safe-bottom{padding-bottom:max(.75rem, env(safe-area-inset-bottom))}@media (width<=767px){.action-bar{bottom:var(--kb,0px);z-index:10;padding:.75rem 1.25rem max(.75rem, env(safe-area-inset-bottom));background:var(--background);margin-inline:-1.25rem;position:sticky}@supports (color:color-mix(in lab, red, red)){.action-bar{background:color-mix(in oklch, var(--background) 88%, transparent)}}.action-bar{-webkit-backdrop-filter:blur(10px);border-top:1px solid var(--border-soft)}.keyboard-open .action-bar{padding-bottom:.75rem}}:root.in-app{--f-ui:-apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, system-ui, sans-serif;--f-mono:ui-monospace, "SF Mono", Menlo, monospace}::selection{color:var(--ink);background:var(--ember-veil)}:root{--focus-line:var(--ink)}@supports (color:color-mix(in lab, red, red)){:root{--focus-line:color-mix(in oklch, var(--ink) 26%, transparent)}}:root{--focus-glow:transparent}:focus-visible{outline:1.5px solid var(--focus-line);outline-offset:2px}:is(input,textarea,select):focus-visible{outline:none}.theme-high-contrast{--focus-line:var(--ember);--focus-glow:var(--ember-veil)}@media (prefers-contrast:more){:root{--focus-line:var(--ember);--focus-glow:var(--ember-veil)}}.theme-high-contrast :focus-visible{outline-width:2px}@media (prefers-contrast:more){:focus-visible{outline-width:2px}}.prose-zen{color:var(--ink);overflow-wrap:anywhere;line-height:1.6}.prose-zen>*+*{margin-top:.75em}.prose-zen h1,.prose-zen h2,.prose-zen h3{font-family:var(--f-display);margin-top:1.25em;font-weight:600;line-height:1.25}.prose-zen h1{font-size:1.5rem}.prose-zen h2{font-size:1.2rem}.prose-zen h3{font-size:1.05rem}.prose-zen ul,.prose-zen ol{padding-left:1.25em}.prose-zen ul{list-style:outside}.prose-zen ol{list-style:decimal}.prose-zen a{color:var(--ember-strong);text-underline-offset:2px;text-decoration:underline}.prose-zen table{border-collapse:collapse;width:100%;font-size:.9em}@media (width<=639px){.prose-zen table{-webkit-overflow-scrolling:touch;display:block;overflow-x:auto}}.prose-zen pre{overflow-x:auto}.prose-zen img{max-width:100%;height:auto}.prose-zen th,.prose-zen td{border-bottom:1px solid var(--border-soft);text-align:left;padding:.4em .6em}.prose-zen code{font-family:var(--f-mono);background:var(--paper-2);border-radius:4px;padding:.1em .3em;font-size:.9em}.prose-zen blockquote{border-left:3px solid var(--border);color:var(--ink-2);padding-left:.9em}.swatch::-webkit-color-swatch-wrapper{padding:0}.swatch::-webkit-color-swatch{border-radius:calc(var(--radius) * .5);border:0}.swatch::-moz-color-swatch{border-radius:calc(var(--radius) * .5);border:0}.react-flow__attribution{display:none}.react-flow__edge-path{stroke:var(--ink-4);stroke-width:1.5px}.react-flow__handle{opacity:0}@keyframes rise{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}.animate-rise{animation:.45s cubic-bezier(.2,.7,.2,1) backwards rise}@keyframes dock{0%{opacity:0;transform:translateY(calc(100% + 16px))}to{opacity:1;transform:none}}.animate-dock{animation:.32s cubic-bezier(.2,.7,.2,1) both dock}@keyframes settle{0%{opacity:0;transform:translate(28px)}}.animate-settle{animation:.6s cubic-bezier(.2,.7,.2,1) .3s both settle}@keyframes step-deeper{0%{opacity:0;transform:translate(1.5rem)}}@keyframes step-back{0%{opacity:0;transform:translate(-1.5rem)}}.animate-step-deeper{animation:.2s ease-out backwards step-deeper}.animate-step-back{animation:.2s ease-out backwards step-back}@keyframes breathe{0%,to{opacity:.5}50%{opacity:1}}.animate-breathe{animation:2.4s ease-in-out infinite breathe}@keyframes pulse-dot{0%,to{opacity:1;transform:scale(1)}50%{opacity:.55;transform:scale(.72)}}.animate-pulse-dot{animation:1.2s ease-in-out infinite pulse-dot}dialog.media-sheet{color:#fff;background:#000;width:100%;max-width:none;height:100dvh;max-height:none;margin:0;padding:0}dialog.media-sheet::backdrop{background:oklch(20% .01 60/.5)}@media (width>=640px) and (height>=560px){dialog.media-sheet{border-radius:calc(var(--radius) * 2);width:min(720px,100% - 48px);height:min(640px,100dvh - 48px);margin:auto;overflow:hidden}}@media (prefers-reduced-motion:reduce){.animate-rise,.animate-dock,.animate-settle,.animate-step-deeper,.animate-step-back,.animate-breathe,.animate-pulse-dot{animation:none}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
|
|
743
743
|
/*$vite$:1*/</style>
|
|
744
744
|
</head>
|