@langgraph-js/ui 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var iq=Object.defineProperty;var yT=e=>{throw TypeError(e)};var aq=(e,t,n)=>t in e?iq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var sq=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var De=(e,t,n)=>aq(e,typeof t!="symbol"?t+"":t,n),bT=(e,t,n)=>t.has(e)||yT("Cannot "+n);var it=(e,t,n)=>(bT(e,t,"read from private field"),n?n.call(e):t.get(e)),ya=(e,t,n)=>t.has(e)?yT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),wo=(e,t,n,r)=>(bT(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var
|
|
1
|
+
var iq=Object.defineProperty;var yT=e=>{throw TypeError(e)};var aq=(e,t,n)=>t in e?iq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var sq=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var De=(e,t,n)=>aq(e,typeof t!="symbol"?t+"":t,n),bT=(e,t,n)=>t.has(e)||yT("Cannot "+n);var it=(e,t,n)=>(bT(e,t,"read from private field"),n?n.call(e):t.get(e)),ya=(e,t,n)=>t.has(e)?yT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),wo=(e,t,n,r)=>(bT(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var a0e=sq((rr,ir)=>{(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var fd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ty={exports:{}},bu={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -51,7 +51,7 @@ Error generating stack: `+p.message+`
|
|
|
51
51
|
]))`;continue}else if(r[f]==="$"){i+=`($|(?=[\r
|
|
52
52
|
]))`;continue}}if(n.s&&r[f]==="."){i+=o?`${r[f]}\r
|
|
53
53
|
`:`[${r[f]}\r
|
|
54
|
-
]`;continue}i+=r[f],r[f]==="\\"?a=!0:o&&r[f]==="]"?o=!1:!o&&r[f]==="["&&(o=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function i3(e,t){var r,i,a,o,l,c;if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&((r=e.keyType)==null?void 0:r._def.typeName)===ke.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((f,d)=>({...f,[d]:gt(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",d]})??{}}),{}),additionalProperties:t.rejectedAdditionalProperties};const n={type:"object",additionalProperties:gt(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return n;if(((i=e.keyType)==null?void 0:i._def.typeName)===ke.ZodString&&((a=e.keyType._def.checks)!=null&&a.length)){const{type:f,...d}=r3(e.keyType._def,t);return{...n,propertyNames:d}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===ke.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};if(((l=e.keyType)==null?void 0:l._def.typeName)===ke.ZodBranded&&e.keyType._def.type._def.typeName===ke.ZodString&&((c=e.keyType._def.type._def.checks)!=null&&c.length)){const{type:f,...d}=t3(e.keyType._def,t);return{...n,propertyNames:d}}}return n}function vF(e,t){if(t.mapStrategy==="record")return i3(e,t);const n=gt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},r=gt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function _F(e){const t=e.values,r=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),i=Array.from(new Set(r.map(a=>typeof a)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function xF(){return{not:{}}}function wF(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const qh={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function SF(e,t){if(t.target==="openApi3")return HT(e,t);const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in qh&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,a)=>{const o=qh[a._def.typeName];return o&&!i.includes(o)?[...i,o]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,a)=>{const o=typeof a._def.value;switch(o){case"string":case"number":case"boolean":return[...i,o];case"bigint":return[...i,"integer"];case"object":if(a._def.value===null)return[...i,"null"];case"symbol":case"undefined":case"function":default:return i}},[]);if(r.length===n.length){const i=r.filter((a,o,l)=>l.indexOf(a)===o);return{type:i.length>1?i:i[0],enum:n.reduce((a,o)=>a.includes(o._def.value)?a:[...a,o._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(a=>!r.includes(a))],[])};return HT(e,t)}const HT=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,i)=>gt(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function EF(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:qh[e.innerType._def.typeName],nullable:!0}:{type:[qh[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){const r=gt(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:!0}:r&&{...r,nullable:!0}}const n=gt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function kF(e,t){const n={type:"number"};if(!e.checks)return n;for(const r of e.checks)switch(r.kind){case"int":n.type="integer",e3(n,"type",r.message,t);break;case"min":t.target==="jsonSchema7"?r.inclusive?xt(n,"minimum",r.value,r.message,t):xt(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),xt(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?xt(n,"maximum",r.value,r.message,t):xt(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),xt(n,"maximum",r.value,r.message,t));break;case"multipleOf":xt(n,"multipleOf",r.value,r.message,t);break}return n}function AF(e,t){const n=t.target==="openAi",r={type:"object",properties:{}},i=[],a=e.shape();for(const l in a){let c=a[l];if(c===void 0||c._def===void 0)continue;let f=CF(c);f&&n&&(c instanceof Ni&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),f=!1);const d=gt(c._def,{...t,currentPath:[...t.currentPath,"properties",l],propertyPath:[...t.currentPath,"properties",l]});d!==void 0&&(r.properties[l]=d,f||i.push(l))}i.length&&(r.required=i);const o=TF(e,t);return o!==void 0&&(r.additionalProperties=o),r}function TF(e,t){if(e.catchall._def.typeName!=="ZodNever")return gt(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function CF(e){try{return e.isOptional()}catch{return!0}}const OF=(e,t)=>{var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return gt(e.innerType._def,t);const n=gt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:{}},n]}:{}},NF=(e,t)=>{if(t.pipeStrategy==="input")return gt(e.in._def,t);if(t.pipeStrategy==="output")return gt(e.out._def,t);const n=gt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=gt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function RF(e,t){return gt(e.type._def,t)}function jF(e,t){const r={type:"array",uniqueItems:!0,items:gt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&xt(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&xt(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}function MF(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>gt(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:gt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>gt(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function $F(){return{not:{}}}function DF(){return{}}const IF=(e,t)=>gt(e.innerType._def,t),PF=(e,t,n)=>{switch(t){case ke.ZodString:return r3(e,n);case ke.ZodNumber:return kF(e,n);case ke.ZodObject:return AF(e,n);case ke.ZodBigInt:return oF(e,n);case ke.ZodBoolean:return lF();case ke.ZodDate:return n3(e,n);case ke.ZodUndefined:return $F();case ke.ZodNull:return wF(n);case ke.ZodArray:return sF(e,n);case ke.ZodUnion:case ke.ZodDiscriminatedUnion:return SF(e,n);case ke.ZodIntersection:return mF(e,n);case ke.ZodTuple:return MF(e,n);case ke.ZodRecord:return i3(e,n);case ke.ZodLiteral:return gF(e,n);case ke.ZodEnum:return hF(e);case ke.ZodNativeEnum:return _F(e);case ke.ZodNullable:return EF(e,n);case ke.ZodOptional:return OF(e,n);case ke.ZodMap:return vF(e,n);case ke.ZodSet:return jF(e,n);case ke.ZodLazy:return()=>e.getter()._def;case ke.ZodPromise:return RF(e,n);case ke.ZodNaN:case ke.ZodNever:return xF();case ke.ZodEffects:return dF(e,n);case ke.ZodAny:return aF();case ke.ZodUnknown:return DF();case ke.ZodDefault:return fF(e,n);case ke.ZodBranded:return t3(e,n);case ke.ZodReadonly:return IF(e,n);case ke.ZodCatch:return uF(e,n);case ke.ZodPipeline:return NF(e,n);case ke.ZodFunction:case ke.ZodVoid:case ke.ZodSymbol:return;default:return(r=>{})()}};function gt(e,t,n=!1){var l;const r=t.seen.get(e);if(t.override){const c=(l=t.override)==null?void 0:l.call(t,e,t,r,n);if(c!==tF)return c}if(r&&!n){const c=LF(r,t);if(c!==void 0)return c}const i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);const a=PF(e,e.typeName,t),o=typeof a=="function"?gt(a(),t):a;if(o&&qF(e,t,o),t.postProcess){const c=t.postProcess(o,e,t);return i.jsonSchema=o,c}return i.jsonSchema=o,o}const LF=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:zF(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):t.$refStrategy==="seen"?{}:void 0}},zF=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")},qF=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),FF=(e,t)=>{const n=iF(t),r=void 0,i=t==null?void 0:t.name,a=gt(e._def,n,!1)??{},o=i===void 0?r?{...a,[n.definitionPath]:r}:a:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,i].join("/"),[n.definitionPath]:{...r,[i]:a}};return n.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in o||"oneOf"in o||"allOf"in o||"type"in o&&Array.isArray(o.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),o},a3=e=>{const t=e.execute||(async(n,r)=>{var i;try{const a=await((i=e.handler)==null?void 0:i.call(e,n,r));return typeof a=="string"?[{type:"text",text:a}]:[{type:"text",text:JSON.stringify(a)}]}catch(a){return[{type:"text",text:`Error: ${a}`}]}});return{...e,execute:t}},BF=e=>({render:e.render,onlyRender:e.onlyRender,name:e.name,description:e.description||"",parameters:eF(Jq(e.parameters||[])),returnDirect:e.returnDirect,callbackMessage:e.callbackMessage,allowAgent:e.allowAgent,allowGraph:e.allowGraph,async execute(t,n){var r;try{const i=await((r=e.handler)==null?void 0:r.call(e,t,n));return typeof i=="string"?[{type:"text",text:i}]:[{type:"text",text:JSON.stringify(i)}]}catch(i){return[{type:"text",text:`Error: ${i}`}]}}}),UF=e=>({name:e.name,description:e.description,parameters:e.isPureParams?e.parameters:FF(_h(e.parameters))}),GT=BF;class s3{constructor(){this.tools=new Map,this.waitingMap=new Map}bindTool(t){if(this.tools.has(t.name))throw new Error(`Tool with name ${t.name} already exists`);this.tools.set(t.name,t)}bindTools(t){t.forEach(n=>this.bindTool(n))}getAllTools(){return Array.from(this.tools.values())}getTool(t){return this.tools.get(t)}removeTool(t){return this.tools.delete(t)}clearTools(){this.tools.clear()}reset(){this.clearTools(),this.clearWaiting()}clearWaiting(){this.waitingMap.clear()}async callTool(t,n,r){var a;const i=this.getTool(t);if(!i)throw new Error(`Tool with name ${t} not found`);return await((a=i.execute)==null?void 0:a.call(i,n,r))}async toJSON(t,n=!0){return Array.from(this.tools.values()).filter(r=>n?!r.onlyRender:!0).filter(r=>!r.allowGraph||r.allowGraph.includes(t)).map(r=>UF(r))}doneWaiting(t,n){return this.waitingMap.has(t)?(this.waitingMap.get(t)(n),this.waitingMap.delete(t),!0):(console.warn(`Waiting for tool ${t} not found`),!1)}waitForDone(t){return this.waitingMap.has(t)?this.waitingMap.get(t):new Promise((r,i)=>{this.waitingMap.set(t,r)})}static waitForUIDone(t,n){return n.client.tools.waitForDone(n.message.id)}}class Ly{static isTool(t){return t.type==="tool"}static isToolAssistant(t){var n,r;return t.type==="ai"&&(((n=t.tool_calls)==null?void 0:n.length)||((r=t.tool_call_chunks)==null?void 0:r.length))}}class VF{constructor(t="task_store"){this.streamingMessage=[],this.graphMessages=[],this.subAgentsKey=t}getStreamingMessages(){return[...this.streamingMessage]}setStreamingMessages(t){this.streamingMessage=t}clearStreamingMessages(){this.streamingMessage=[]}getGraphMessages(){return[...this.graphMessages]}setGraphMessages(t){this.graphMessages=t}updateStreamingMessage(t){const n=this.streamingMessage[this.streamingMessage.length-1];if(!(n!=null&&n.id)||t.id!==n.id){this.streamingMessage.push(t);return}this.streamingMessage[this.streamingMessage.length-1]=t}combineGraphMessagesWithStreamingMessages(){const t=new Map(this.streamingMessage.map(n=>[n.id,n]));return[...this.graphMessages.map(n=>{if(t.has(n.id)){const r=t.get(n.id);return t.delete(n.id),r}return n}),...t.values()]}mergeSubGraphMessagesToStreamingMessages(t){const n=new Map(t.filter(r=>r.id).map(r=>[r.id,r]));this.streamingMessage.forEach(r=>{if(n.has(r.id)){const i=n.get(r.id);Object.assign(r,i),n.delete(r.id)}}),n.forEach(r=>{r.type==="tool"&&r.tool_call_id&&this.streamingMessage.push(r)})}cloneMessage(t){return JSON.parse(JSON.stringify(t))}attachInfoForMessage(t){var i,a,o;let n=null;const r=[...t];for(const l of r){const c=((i=l.response_metadata)==null?void 0:i.create_time)||"";if(l.unique_id=l.tool_call_id||l.id,l.spend_time=new Date(c).getTime()-new Date(((a=n==null?void 0:n.response_metadata)==null?void 0:a.create_time)||c).getTime(),!l.usage_metadata&&((o=l.response_metadata)!=null&&o.usage)){const f=l.response_metadata.usage;l.usage_metadata={...f,input_tokens:f.prompt_tokens,output_tokens:f.completion_tokens,total_tokens:f.total_tokens}}n=l}return r}composeToolMessages(t){var a,o;const n=[],r=new Map,i=new Map;for(const l of t)if(!(Ly.isToolAssistant(l)&&((a=l.tool_calls||l.tool_call_chunks)==null||a.forEach(c=>{r.set(c.id,c),i.set(c.id,l)}),!l.content))){if(Ly.isTool(l)&&!l.tool_input){const c=r.get(l.tool_call_id),f=i.get(l.tool_call_id);c&&(l.tool_input=typeof c.args!="string"?JSON.stringify(c.args):c.args,l.additional_kwargs?(l.additional_kwargs.done=!0,l.done=!0):(l.done=!0,l.additional_kwargs={done:!0})),f&&(l.usage_metadata=f.usage_metadata,l.node_name=f.name,l.name||(l.name=(o=f.tool_calls.find(d=>d.id===l.tool_call_id))==null?void 0:o.name))}n.push(l)}return n}convertSubAgentMessages(t,n){const r=n[this.subAgentsKey];if(!r)return t;const i=JSON.parse(JSON.stringify(r));t.filter(l=>{var c;return(c=l.node_name)==null?void 0:c.startsWith("subagent_")}).forEach(l=>{const c=l.node_name.replace("subagent_",""),f=i[c];f?f.messages.some(h=>h.id===l.id)||f.messages.push(l):i[c]={messages:[l]}});const a=new Set;Object.values(i).forEach(l=>{l.messages.forEach(c=>{a.add(c.id)})});const o=[];for(const l of t){if(l.type==="tool"&&l.tool_call_id){const c=i[l.tool_call_id];c&&(l.sub_agent_messages=this.processMessages(c.messages))}l.id&&a.has(l.id)||o.push(l)}return o}renderMessages(t,n){var l;const r=new Map,i=new Set,a=[],o=this.combineGraphMessagesWithStreamingMessages();for(let c=o.length-1;c>=0;c--){const f=this.cloneMessage(o[c]);if(!f.id){a.unshift(f);continue}if(f.type==="ai"&&(f.name||(f.name=n().name)),Ly.isToolAssistant(f)){const d=f;r.set(f.id,d);const m=((l=d.tool_calls)!=null&&l.length?d.tool_calls:d.tool_call_chunks).filter(g=>!i.has(g.id)).map((g,v)=>{var w,b,_,S;return{type:"tool",additional_kwargs:{},tool_input:(S=(_=(b=(w=d.additional_kwargs)==null?void 0:w.tool_calls)==null?void 0:b[v])==null?void 0:_.function)==null?void 0:S.arguments,id:g.id,name:g.name,response_metadata:{},tool_call_id:g.id,content:""}});for(const g of m)r.has(g.id)||(a.unshift(g),r.set(g.id,g));a.unshift(d)}else f.type==="tool"&&f.tool_call_id&&i.add(f.tool_call_id),r.set(f.id,f),a.unshift(f)}return this.processMessages(a,t)}processMessages(t,n){const r=this.composeToolMessages(t),i=this.attachInfoForMessage(r);return n?this.convertSubAgentMessages(i,n):i}}class HF extends xq{constructor(t){super(),this.currentAssistant=null,this.currentThread=null,this.tools=new s3,this.availableAssistants=[],this.graphState={},this.stopController=null,this.subAgentsKey="task_store",this.graphPosition="",this.extraParams={},this.client=t.client,this.messageProcessor=new VF(this.subAgentsKey)}get assistants(){return this.client.assistants}get threads(){return this.client.threads}get runs(){return this.client.runs}listAssistants(){return this.assistants.search({metadata:null,offset:0,limit:100})}async initAssistant(t){try{const n=await this.listAssistants();if(this.availableAssistants=n,n.length>0)if(t){if(this.currentAssistant=n.find(r=>r.graph_id===t)||null,!this.currentAssistant)throw new Error("Agent not found: "+t)}else this.currentAssistant=n[0];else throw new Error("No assistants found")}catch(n){throw console.error("Failed to initialize LangGraphClient:",n),n}}async createThread({threadId:t}={}){try{return this.currentThread=await this.threads.create({threadId:t}),this.currentThread}catch(n){throw console.error("Failed to create new thread:",n),n}}graphVisualize(){var t;return this.assistants.getGraph((t=this.currentAssistant)==null?void 0:t.assistant_id,{xray:!0})}async listThreads(){return this.threads.search({sortOrder:"desc"})}async deleteThread(t){return this.threads.delete(t)}async resetThread(t,n){var i;await this.initAssistant(t),this.currentThread=await this.threads.get(n),this.graphState=this.currentThread.values;const r=((i=this.graphState)==null?void 0:i.messages)||[];return this.messageProcessor.setGraphMessages(r),this.emit("value",{event:"messages/partial",data:{messages:this.messageProcessor.getGraphMessages()}}),this.currentThread}async resetStream(){const t=await this.runs.list(this.currentThread.thread_id),n=t==null?void 0:t.find(r=>r.status==="running"||r.status==="pending");n&&await this.sendMessage([],{joinRunId:n.run_id})}cloneMessage(t){return this.messageProcessor.cloneMessage(t)}get renderMessage(){return this.messageProcessor.renderMessages(this.graphState,()=>this.getGraphNodeNow())}get tokenCounter(){return this.messageProcessor.getGraphMessages().reduce((t,n)=>{var r,i,a,o,l;if(n.usage_metadata)t.total_tokens+=((r=n.usage_metadata)==null?void 0:r.total_tokens)||0,t.input_tokens+=((i=n.usage_metadata)==null?void 0:i.input_tokens)||0,t.output_tokens+=((a=n.usage_metadata)==null?void 0:a.output_tokens)||0;else if((o=n.response_metadata)!=null&&o.usage){const c=(l=n.response_metadata)==null?void 0:l.usage;t.total_tokens+=c.total_tokens||0,t.input_tokens+=c.prompt_tokens||0,t.output_tokens+=c.completion_tokens||0}return t},{total_tokens:0,input_tokens:0,output_tokens:0})}isFELocking(t){var i;const n=t[t.length-1];if(!n)return!1;const r=this.tools.getTool(n==null?void 0:n.name);return r&&r.render&&(n==null?void 0:n.type)==="tool"&&!((i=n==null?void 0:n.additional_kwargs)!=null&&i.done)}cancelRun(){var t,n;(t=this.currentThread)!=null&&t.thread_id&&((n=this.currentRun)!=null&&n.run_id)&&this.runs.cancel(this.currentThread.thread_id,this.currentRun.run_id)}async sendMessage(t,{joinRunId:n,extraParams:r,_debug:i,command:a}={}){var h;if(!this.currentAssistant)throw new Error("Thread or Assistant not initialized");this.currentThread||(await this.createThread(),this.emit("thread",{event:"thread/create",data:{thread:this.currentThread}}));const o=Array.isArray(t)?t:[{type:"human",content:t}],c=await(async()=>i!=null&&i.streamResponse?i.streamResponse:n?this.runs.joinStream(this.currentThread.thread_id,n):this.runs.stream(this.currentThread.thread_id,this.currentAssistant.assistant_id,{input:{...this.graphState,...this.extraParams,...r||{},messages:o,fe_tools:await this.tools.toJSON(this.currentAssistant.graph_id)},streamMode:["messages","values"],streamSubgraphs:!0,command:a}))(),f=[];this.emit("start",{event:"start"});for await(const m of c)if(f.push(m),m.event==="metadata")this.currentRun=m.data;else if(m.event==="error")this.emit("error",m);else if(m.event==="messages/partial"){for(const g of m.data)this.messageProcessor.updateStreamingMessage(g);this.emit("message",m);continue}else if(m.event==="values"){const g=m.data;if(g.messages){const v=!!(a!=null&&a.resume),w=g.messages.length>=this.messageProcessor.getGraphMessages().length;(!v||v&&w)&&(this.messageProcessor.setGraphMessages(g.messages),this.emit("value",m)),this.graphState=m.data}continue}else m.event.startsWith("values|")&&((h=m.data)!=null&&h.messages&&this.messageProcessor.mergeSubGraphMessagesToStreamingMessages(m.data.messages),this.graphPosition=m.event.split("|")[1]);const d=await this.runFETool();return d&&f.push(...d),this.emit("done",{event:"done"}),this.messageProcessor.clearStreamingMessages(),f}getGraphPosition(){return this.graphPosition.split("|").map(t=>{const[n,r]=t.split(":");return{id:r,name:n}})}getGraphNodeNow(){const t=this.getGraphPosition();return t[t.length-1]}runFETool(){var r;const t=this.messageProcessor.getStreamingMessages(),n=t[t.length-1];if(n&&n.type==="ai"&&(r=n.tool_calls)!=null&&r.length){const i=n.tool_calls.map(a=>{if(this.tools.getTool(a.name)){const o={...a,tool_call_id:a.id,tool_input:JSON.stringify(a.args),additional_kwargs:{}};return this.callFETool(o,a.args)}});return this.currentThread.status="interrupted",Promise.all(i)}}async callFETool(t,n){const r=this,i=await this.tools.callTool(t.name,n,{client:r,message:t});if(i)return this.resume(i)}resume(t){return this.sendMessage([],{command:{resume:t}})}doneFEToolWaiting(t,n){var i;!this.tools.doneWaiting(t,n)&&((i=this.currentThread)==null?void 0:i.status)==="interrupted"&&this.resume(n)}getCurrentThread(){return this.currentThread}getCurrentAssistant(){return this.currentAssistant}async reset(){var t;await this.initAssistant((t=this.currentAssistant)==null?void 0:t.graph_id),this.currentThread=null,this.graphState={},this.messageProcessor.setGraphMessages([]),this.messageProcessor.clearStreamingMessages(),this.currentRun=void 0,this.tools.clearWaiting(),this.emit("value",{event:"messages/partial",data:{messages:[]}})}}let Tr=[],ba=0;const dd=4;let In=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},lc:0,listen(r){return n.lc=t.push(r),()=>{for(let a=ba+dd;a<Tr.length;)Tr[a]===r?Tr.splice(a,dd):a+=dd;let i=t.indexOf(r);~i&&(t.splice(i,1),--n.lc)}},notify(r,i){let a=!Tr.length;for(let o of t)Tr.push(o,n.value,r,i);if(a){for(ba=0;ba<Tr.length;ba+=dd)Tr[ba](Tr[ba+1],Tr[ba+2],Tr[ba+3]);Tr.length=0}},off(){},set(r){let i=n.value;i!==r&&(n.value=r,n.notify(i))},subscribe(r){let i=n.listen(r);return r(n.value),i},value:e};return n};function GF(e,t,n){let r=new Set(t).add(void 0);return e.listen((i,a,o)=>{r.has(o)&&n(i,a,o)})}function YF(e,t,n){var r,i,a;n===void 0&&(n={});var o=(r=n.isImmediate)!=null&&r,l=(i=n.callback)!=null&&i,c=n.maxWait,f=Date.now(),d=[];function h(){if(c!==void 0){var g=Date.now()-f;if(g+t>=c)return c-g}return t}var m=function(){var g=[].slice.call(arguments),v=this;return new Promise(function(w,b){var _=o&&a===void 0;if(a!==void 0&&clearTimeout(a),a=setTimeout(function(){if(a=void 0,f=Date.now(),!o){var x=e.apply(v,g);l&&l(x),d.forEach(function(A){return(0,A.resolve)(x)}),d=[]}},h()),_){var S=e.apply(v,g);return l&&l(S),w(S)}d.push({resolve:w,reject:b})})};return m.cancel=function(g){a!==void 0&&clearTimeout(a),d.forEach(function(v){return(0,v.reject)(g)}),d=[]},m}const ZF="modulepreload",KF=function(e){return"/"+e},YT={},XF=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(f){return Promise.all(f.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=o(n.map(f=>{if(f=KF(f),f in YT)return;YT[f]=!0;const d=f.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":ZF,d||(m.as="script"),m.crossOrigin="",m.href=f,c&&m.setAttribute("nonce",c),document.head.appendChild(m),d)return new Promise((g,v)=>{m.addEventListener("load",g),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})},WF=async()=>{const{Client:e}=await XF(async()=>{const{Client:t}=await Promise.resolve().then(()=>eB);return{Client:t}},void 0);return new e},QF=e=>e.toLocaleTimeString("en-US"),JF=e=>e.toLocaleString("en"),Fh=e=>typeof e=="string"?e:Array.isArray(e)?e.map(t=>typeof t=="string"?t:t.type==="text"?t.text:t.type==="image_url"?"[图片]":JSON.stringify(t)).join(""):JSON.stringify(e),e7=e=>{var n,r,i;const t=(i=(r=(n=e==null?void 0:e.values)==null?void 0:n.messages)==null?void 0:r[0])==null?void 0:i.content;return t&&Array.isArray(t)?t.map(a=>{if(a.type==="text")return a.text}):typeof t=="string"?t:""},t7=(e,t,n={})=>{const r=In(null),i=In([]),a=In(""),o=In(!1),l=In([]),c=In(null),f=In(n.showHistory??!1),d=In(e),h=In(null),m=In("__start__"),g=In([]),v=async()=>{const P=r.get();P&&(P.tools.clearTools(),P.tools.bindTools(g.get()))},w=In(n.showGraph??!1),b=In(null),_=async()=>{var P;w.get()&&b.set(await((P=r.get())==null?void 0:P.graphVisualize())||null)},S=YF(P=>{const q=P.renderMessage,D=q[q.length-1];m.set((D==null?void 0:D.node_name)||(D==null?void 0:D.name)||"__start__"),i.set(q)},10);async function x(){var q;const P=new HF({...t,client:t.client??await WF()});return await P.initAssistant(d.get()),d.set(P.getCurrentAssistant().graph_id),c.set(null),P.on("start",()=>{o.set(!0)}),P.on("thread",()=>{var D;h.set(((D=P.getCurrentThread())==null?void 0:D.thread_id)||null),m.set("__start__"),L()}),P.on("done",()=>{o.set(!1),S(P)}),P.on("error",D=>{o.set(!1),c.set(D.data)}),P.on("message",()=>{var D;h.set(((D=P.getCurrentThread())==null?void 0:D.thread_id)||null),S(P)}),P.on("value",()=>{var D;h.set(((D=P.getCurrentThread())==null?void 0:D.thread_id)||null),S(P)}),(q=n.onInit)==null||q.call(n,P),P.graphState={},r.set(P),w.get()&&_(),v(),P}const A=async(P,q)=>{var D;!a.get().trim()&&!(P!=null&&P.length)||o.get()||!r.get()||(o.set(!0),c.set(null),await((D=r.get())==null?void 0:D.sendMessage(P||a.get(),q)),a.set(""),o.set(!1))},k=()=>{var P;(P=r.get())==null||P.cancelRun()},T=P=>{const q=l.get();l.set(q.includes(P)?q.filter(D=>D!==P):[...q,P])},O=()=>{f.set(!f.get()),f.get()&&L()},$=In([]),L=async()=>{var P;if(!(!r.get()||!f.get()))try{const q=await((P=r.get())==null?void 0:P.listThreads());$.set(q||[])}catch(q){console.error("Failed to fetch threads:",q)}};return{data:{client:r,renderMessages:i,userInput:a,loading:o,inChatError:c,currentAgent:d,collapsedTools:l,showHistory:f,historyList:$,currentChatId:h,showGraph:w,graphVisualize:b,currentNodeName:m,tools:g},mutations:{refreshTools:v,setTools(P){g.set(P),v()},isFELocking(){var P;return(P=r.get())==null?void 0:P.isFELocking(i.get())},initClient:x,sendMessage:A,stopGeneration:k,toggleToolCollapse:T,toggleHistoryVisible:O,refreshHistoryList:L,addToHistory:P=>{const q=$.get();$.set([P,...q])},setUserInput(P){a.set(P)},setCurrentAgent(P){return d.set(P),x().then(()=>{f.get()&&L()})},toggleGraphVisible(){w.set(!w.get()),w.get()&&_()},refreshGraph:_,createNewChat(){var P;(P=r.get())==null||P.reset(),c.set(null),o.set(!1)},async toHistoryChat(P){var D,H,B;c.set(null),o.set(!1);const q=await((H=r.get())==null?void 0:H.resetThread((D=P.metadata)==null?void 0:D.graph_id,P.thread_id));return q&&((B=r.get())==null||B.resetStream()),q},async deleteHistoryChat(P){var q;await((q=r.get())==null?void 0:q.deleteThread(P.thread_id)),await L()},getToolUIRender:P=>{var H;const D=(H=r.get().tools.getAllTools().find(B=>B.name===P))==null?void 0:H.render;return D?B=>D(new x7(B,r.get())):null}}}};class So extends Error{constructor(t,n){super("".concat(t," at position ").concat(n)),this.position=n}}const o3=32,n7=10,l3=9,u3=13,r7=160,i7=8192,a7=8202,s7=8239,o7=8287,l7=12288;function u7(e){return/^[0-9A-Fa-f]$/.test(e)}function rs(e){return e>="0"&&e<="9"}function c7(e){return e>=" "}function hd(e){return`,:[]/{}()
|
|
54
|
+
]`;continue}i+=r[f],r[f]==="\\"?a=!0:o&&r[f]==="]"?o=!1:!o&&r[f]==="["&&(o=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function i3(e,t){var r,i,a,o,l,c;if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&((r=e.keyType)==null?void 0:r._def.typeName)===ke.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((f,d)=>({...f,[d]:gt(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",d]})??{}}),{}),additionalProperties:t.rejectedAdditionalProperties};const n={type:"object",additionalProperties:gt(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return n;if(((i=e.keyType)==null?void 0:i._def.typeName)===ke.ZodString&&((a=e.keyType._def.checks)!=null&&a.length)){const{type:f,...d}=r3(e.keyType._def,t);return{...n,propertyNames:d}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===ke.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};if(((l=e.keyType)==null?void 0:l._def.typeName)===ke.ZodBranded&&e.keyType._def.type._def.typeName===ke.ZodString&&((c=e.keyType._def.type._def.checks)!=null&&c.length)){const{type:f,...d}=t3(e.keyType._def,t);return{...n,propertyNames:d}}}return n}function vF(e,t){if(t.mapStrategy==="record")return i3(e,t);const n=gt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},r=gt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function _F(e){const t=e.values,r=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),i=Array.from(new Set(r.map(a=>typeof a)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function xF(){return{not:{}}}function wF(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const qh={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function SF(e,t){if(t.target==="openApi3")return HT(e,t);const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in qh&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,a)=>{const o=qh[a._def.typeName];return o&&!i.includes(o)?[...i,o]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,a)=>{const o=typeof a._def.value;switch(o){case"string":case"number":case"boolean":return[...i,o];case"bigint":return[...i,"integer"];case"object":if(a._def.value===null)return[...i,"null"];case"symbol":case"undefined":case"function":default:return i}},[]);if(r.length===n.length){const i=r.filter((a,o,l)=>l.indexOf(a)===o);return{type:i.length>1?i:i[0],enum:n.reduce((a,o)=>a.includes(o._def.value)?a:[...a,o._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(a=>!r.includes(a))],[])};return HT(e,t)}const HT=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,i)=>gt(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function EF(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:qh[e.innerType._def.typeName],nullable:!0}:{type:[qh[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){const r=gt(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:!0}:r&&{...r,nullable:!0}}const n=gt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function kF(e,t){const n={type:"number"};if(!e.checks)return n;for(const r of e.checks)switch(r.kind){case"int":n.type="integer",e3(n,"type",r.message,t);break;case"min":t.target==="jsonSchema7"?r.inclusive?xt(n,"minimum",r.value,r.message,t):xt(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),xt(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?xt(n,"maximum",r.value,r.message,t):xt(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),xt(n,"maximum",r.value,r.message,t));break;case"multipleOf":xt(n,"multipleOf",r.value,r.message,t);break}return n}function AF(e,t){const n=t.target==="openAi",r={type:"object",properties:{}},i=[],a=e.shape();for(const l in a){let c=a[l];if(c===void 0||c._def===void 0)continue;let f=CF(c);f&&n&&(c instanceof Ni&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),f=!1);const d=gt(c._def,{...t,currentPath:[...t.currentPath,"properties",l],propertyPath:[...t.currentPath,"properties",l]});d!==void 0&&(r.properties[l]=d,f||i.push(l))}i.length&&(r.required=i);const o=TF(e,t);return o!==void 0&&(r.additionalProperties=o),r}function TF(e,t){if(e.catchall._def.typeName!=="ZodNever")return gt(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function CF(e){try{return e.isOptional()}catch{return!0}}const OF=(e,t)=>{var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return gt(e.innerType._def,t);const n=gt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:{}},n]}:{}},NF=(e,t)=>{if(t.pipeStrategy==="input")return gt(e.in._def,t);if(t.pipeStrategy==="output")return gt(e.out._def,t);const n=gt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=gt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function RF(e,t){return gt(e.type._def,t)}function jF(e,t){const r={type:"array",uniqueItems:!0,items:gt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&xt(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&xt(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}function MF(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>gt(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:gt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>gt(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function $F(){return{not:{}}}function DF(){return{}}const IF=(e,t)=>gt(e.innerType._def,t),PF=(e,t,n)=>{switch(t){case ke.ZodString:return r3(e,n);case ke.ZodNumber:return kF(e,n);case ke.ZodObject:return AF(e,n);case ke.ZodBigInt:return oF(e,n);case ke.ZodBoolean:return lF();case ke.ZodDate:return n3(e,n);case ke.ZodUndefined:return $F();case ke.ZodNull:return wF(n);case ke.ZodArray:return sF(e,n);case ke.ZodUnion:case ke.ZodDiscriminatedUnion:return SF(e,n);case ke.ZodIntersection:return mF(e,n);case ke.ZodTuple:return MF(e,n);case ke.ZodRecord:return i3(e,n);case ke.ZodLiteral:return gF(e,n);case ke.ZodEnum:return hF(e);case ke.ZodNativeEnum:return _F(e);case ke.ZodNullable:return EF(e,n);case ke.ZodOptional:return OF(e,n);case ke.ZodMap:return vF(e,n);case ke.ZodSet:return jF(e,n);case ke.ZodLazy:return()=>e.getter()._def;case ke.ZodPromise:return RF(e,n);case ke.ZodNaN:case ke.ZodNever:return xF();case ke.ZodEffects:return dF(e,n);case ke.ZodAny:return aF();case ke.ZodUnknown:return DF();case ke.ZodDefault:return fF(e,n);case ke.ZodBranded:return t3(e,n);case ke.ZodReadonly:return IF(e,n);case ke.ZodCatch:return uF(e,n);case ke.ZodPipeline:return NF(e,n);case ke.ZodFunction:case ke.ZodVoid:case ke.ZodSymbol:return;default:return(r=>{})()}};function gt(e,t,n=!1){var l;const r=t.seen.get(e);if(t.override){const c=(l=t.override)==null?void 0:l.call(t,e,t,r,n);if(c!==tF)return c}if(r&&!n){const c=LF(r,t);if(c!==void 0)return c}const i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);const a=PF(e,e.typeName,t),o=typeof a=="function"?gt(a(),t):a;if(o&&qF(e,t,o),t.postProcess){const c=t.postProcess(o,e,t);return i.jsonSchema=o,c}return i.jsonSchema=o,o}const LF=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:zF(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):t.$refStrategy==="seen"?{}:void 0}},zF=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")},qF=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),FF=(e,t)=>{const n=iF(t),r=void 0,i=t==null?void 0:t.name,a=gt(e._def,n,!1)??{},o=i===void 0?r?{...a,[n.definitionPath]:r}:a:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,i].join("/"),[n.definitionPath]:{...r,[i]:a}};return n.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in o||"oneOf"in o||"allOf"in o||"type"in o&&Array.isArray(o.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),o},a3=e=>{const t=e.execute||(async(n,r)=>{var i;try{const a=await((i=e.handler)==null?void 0:i.call(e,n,r));return typeof a=="string"?[{type:"text",text:a}]:[{type:"text",text:JSON.stringify(a)}]}catch(a){return[{type:"text",text:`Error: ${a}`}]}});return{...e,execute:t}},BF=e=>({render:e.render,onlyRender:e.onlyRender,name:e.name,description:e.description||"",parameters:eF(Jq(e.parameters||[])),returnDirect:e.returnDirect,callbackMessage:e.callbackMessage,allowAgent:e.allowAgent,allowGraph:e.allowGraph,async execute(t,n){var r;try{const i=await((r=e.handler)==null?void 0:r.call(e,t,n));return typeof i=="string"?[{type:"text",text:i}]:[{type:"text",text:JSON.stringify(i)}]}catch(i){return[{type:"text",text:`Error: ${i}`}]}}}),UF=e=>({name:e.name,description:e.description,parameters:e.isPureParams?e.parameters:FF(_h(e.parameters))}),GT=BF;class s3{constructor(){this.tools=new Map,this.waitingMap=new Map}bindTool(t){if(this.tools.has(t.name))throw new Error(`Tool with name ${t.name} already exists`);this.tools.set(t.name,t)}bindTools(t){t.forEach(n=>this.bindTool(n))}getAllTools(){return Array.from(this.tools.values())}getTool(t){return this.tools.get(t)}removeTool(t){return this.tools.delete(t)}clearTools(){this.tools.clear()}reset(){this.clearTools(),this.clearWaiting()}clearWaiting(){this.waitingMap.clear()}async callTool(t,n,r){var a;const i=this.getTool(t);if(!i)throw new Error(`Tool with name ${t} not found`);return await((a=i.execute)==null?void 0:a.call(i,n,r))}async toJSON(t,n=!0){return Array.from(this.tools.values()).filter(r=>n?!r.onlyRender:!0).filter(r=>!r.allowGraph||r.allowGraph.includes(t)).map(r=>UF(r))}doneWaiting(t,n){return this.waitingMap.has(t)?(this.waitingMap.get(t)(n),this.waitingMap.delete(t),!0):(console.warn(`Waiting for tool ${t} not found`),!1)}waitForDone(t){return this.waitingMap.has(t)?this.waitingMap.get(t):new Promise((r,i)=>{this.waitingMap.set(t,r)})}static waitForUIDone(t,n){return n.client.tools.waitForDone(n.message.id)}}class Ly{static isTool(t){return t.type==="tool"}static isToolAssistant(t){var n,r;return t.type==="ai"&&(((n=t.tool_calls)==null?void 0:n.length)||((r=t.tool_call_chunks)==null?void 0:r.length))}}class VF{constructor(t="task_store"){this.streamingMessage=[],this.graphMessages=[],this.subAgentsKey=t}getStreamingMessages(){return[...this.streamingMessage]}setStreamingMessages(t){this.streamingMessage=t}clearStreamingMessages(){this.streamingMessage=[]}getGraphMessages(){return[...this.graphMessages]}setGraphMessages(t){this.graphMessages=t}updateStreamingMessage(t){const n=this.streamingMessage[this.streamingMessage.length-1];if(!(n!=null&&n.id)||t.id!==n.id){this.streamingMessage.push(t);return}this.streamingMessage[this.streamingMessage.length-1]=t}combineGraphMessagesWithStreamingMessages(){const t=new Map(this.streamingMessage.map(n=>[n.id,n]));return[...this.graphMessages.map(n=>{if(t.has(n.id)){const r=t.get(n.id);return t.delete(n.id),r}return n}),...t.values()]}mergeSubGraphMessagesToStreamingMessages(t){const n=new Map(t.filter(r=>r.id).map(r=>[r.id,r]));this.streamingMessage.forEach(r=>{if(n.has(r.id)){const i=n.get(r.id);Object.assign(r,i),n.delete(r.id)}}),n.forEach(r=>{r.type==="tool"&&r.tool_call_id&&this.streamingMessage.push(r)})}cloneMessage(t){return JSON.parse(JSON.stringify(t))}attachInfoForMessage(t){var i,a,o;let n=null;const r=[...t];for(const l of r){const c=((i=l.response_metadata)==null?void 0:i.create_time)||"";if(l.unique_id=l.tool_call_id||l.id,l.spend_time=new Date(c).getTime()-new Date(((a=n==null?void 0:n.response_metadata)==null?void 0:a.create_time)||c).getTime(),!l.usage_metadata&&((o=l.response_metadata)!=null&&o.usage)){const f=l.response_metadata.usage;l.usage_metadata={...f,input_tokens:f.prompt_tokens,output_tokens:f.completion_tokens,total_tokens:f.total_tokens}}n=l}return r}composeToolMessages(t){var a,o;const n=[],r=new Map,i=new Map;for(const l of t)if(!(Ly.isToolAssistant(l)&&((a=l.tool_calls||l.tool_call_chunks)==null||a.forEach(c=>{r.set(c.id,c),i.set(c.id,l)}),!l.content))){if(Ly.isTool(l)&&!l.tool_input){const c=r.get(l.tool_call_id),f=i.get(l.tool_call_id);c&&(l.tool_input=typeof c.args!="string"?JSON.stringify(c.args):c.args,l.additional_kwargs?(l.additional_kwargs.done=!0,l.done=!0):(l.done=!0,l.additional_kwargs={done:!0})),f&&(l.usage_metadata=f.usage_metadata,l.node_name=f.name,l.name||(l.name=(o=f.tool_calls.find(d=>d.id===l.tool_call_id))==null?void 0:o.name))}n.push(l)}return n}convertSubAgentMessages(t,n){const r=n[this.subAgentsKey];if(!r)return t;const i=JSON.parse(JSON.stringify(r));t.filter(l=>{var c;return(c=l.node_name)==null?void 0:c.startsWith("subagent_")}).forEach(l=>{const c=l.node_name.replace("subagent_",""),f=i[c];f?f.messages.some(h=>h.id===l.id)||f.messages.push(l):i[c]={messages:[l]}});const a=new Set;Object.values(i).forEach(l=>{l.messages.forEach(c=>{a.add(c.id)})});const o=[];for(const l of t){if(l.type==="tool"&&l.tool_call_id){const c=i[l.tool_call_id];c&&(l.sub_agent_messages=this.processMessages(c.messages))}l.id&&a.has(l.id)||o.push(l)}return o}renderMessages(t,n){var l;const r=new Map,i=new Set,a=[],o=this.combineGraphMessagesWithStreamingMessages();for(let c=o.length-1;c>=0;c--){const f=this.cloneMessage(o[c]);if(!f.id){a.unshift(f);continue}if(f.type==="ai"&&(f.name||(f.name=n().name)),Ly.isToolAssistant(f)){const d=f;r.set(f.id,d);const m=((l=d.tool_calls)!=null&&l.length?d.tool_calls:d.tool_call_chunks).filter(g=>!i.has(g.id)).map((g,v)=>{var w,b,_,S;return{type:"tool",additional_kwargs:{},tool_input:(S=(_=(b=(w=d.additional_kwargs)==null?void 0:w.tool_calls)==null?void 0:b[v])==null?void 0:_.function)==null?void 0:S.arguments,id:g.id,name:g.name,response_metadata:{},tool_call_id:g.id,content:""}});for(const g of m)r.has(g.id)||(a.unshift(g),r.set(g.id,g));a.unshift(d)}else f.type==="tool"&&f.tool_call_id&&i.add(f.tool_call_id),r.set(f.id,f),a.unshift(f)}return this.processMessages(a,t)}processMessages(t,n){const r=this.composeToolMessages(t),i=this.attachInfoForMessage(r);return n?this.convertSubAgentMessages(i,n):i}}class HF extends xq{constructor(t){super(),this.currentAssistant=null,this.currentThread=null,this.tools=new s3,this.availableAssistants=[],this.graphState={},this.stopController=null,this.subAgentsKey="task_store",this.graphPosition="",this.extraParams={},this.client=t.client,this.messageProcessor=new VF(this.subAgentsKey)}get assistants(){return this.client.assistants}get threads(){return this.client.threads}get runs(){return this.client.runs}listAssistants(){return this.assistants.search({metadata:null,offset:0,limit:100})}async initAssistant(t){try{const n=await this.listAssistants();if(this.availableAssistants=n,n.length>0)if(t){if(this.currentAssistant=n.find(r=>r.graph_id===t)||null,!this.currentAssistant)throw new Error("Agent not found: "+t)}else this.currentAssistant=n[0];else throw new Error("No assistants found")}catch(n){throw console.error("Failed to initialize LangGraphClient:",n),n}}async createThread({threadId:t}={}){try{return this.currentThread=await this.threads.create({threadId:t}),this.currentThread}catch(n){throw console.error("Failed to create new thread:",n),n}}graphVisualize(){var t;return this.assistants.getGraph((t=this.currentAssistant)==null?void 0:t.assistant_id,{xray:!0})}async listThreads(){return this.threads.search({sortOrder:"desc"})}async deleteThread(t){return this.threads.delete(t)}async resetThread(t,n){var i;await this.initAssistant(t),this.currentThread=await this.threads.get(n),this.graphState=this.currentThread.values;const r=((i=this.graphState)==null?void 0:i.messages)||[];return this.messageProcessor.setGraphMessages(r),this.emit("value",{event:"messages/partial",data:{messages:this.messageProcessor.getGraphMessages()}}),this.currentThread}async resetStream(){const t=await this.runs.list(this.currentThread.thread_id),n=t==null?void 0:t.find(r=>r.status==="running"||r.status==="pending");n&&await this.sendMessage([],{joinRunId:n.run_id})}cloneMessage(t){return this.messageProcessor.cloneMessage(t)}get renderMessage(){return this.messageProcessor.renderMessages(this.graphState,()=>this.getGraphNodeNow())}get tokenCounter(){return this.messageProcessor.getGraphMessages().reduce((t,n)=>{var r,i,a,o,l;if(n.usage_metadata)t.total_tokens+=((r=n.usage_metadata)==null?void 0:r.total_tokens)||0,t.input_tokens+=((i=n.usage_metadata)==null?void 0:i.input_tokens)||0,t.output_tokens+=((a=n.usage_metadata)==null?void 0:a.output_tokens)||0;else if((o=n.response_metadata)!=null&&o.usage){const c=(l=n.response_metadata)==null?void 0:l.usage;t.total_tokens+=c.total_tokens||0,t.input_tokens+=c.prompt_tokens||0,t.output_tokens+=c.completion_tokens||0}return t},{total_tokens:0,input_tokens:0,output_tokens:0})}isFELocking(t){var i;const n=t[t.length-1];if(!n)return!1;const r=this.tools.getTool(n==null?void 0:n.name);return r&&r.render&&(n==null?void 0:n.type)==="tool"&&!((i=n==null?void 0:n.additional_kwargs)!=null&&i.done)}cancelRun(){var t,n;(t=this.currentThread)!=null&&t.thread_id&&((n=this.currentRun)!=null&&n.run_id)&&this.runs.cancel(this.currentThread.thread_id,this.currentRun.run_id)}async sendMessage(t,{joinRunId:n,extraParams:r,_debug:i,command:a}={}){var h;if(!this.currentAssistant)throw new Error("Thread or Assistant not initialized");this.currentThread||(await this.createThread(),this.emit("thread",{event:"thread/create",data:{thread:this.currentThread}}));const o=Array.isArray(t)?t:[{type:"human",content:t}],c=await(async()=>i!=null&&i.streamResponse?i.streamResponse:n?this.runs.joinStream(this.currentThread.thread_id,n):this.runs.stream(this.currentThread.thread_id,this.currentAssistant.assistant_id,{input:{...this.graphState,...this.extraParams,...r||{},messages:o,fe_tools:await this.tools.toJSON(this.currentAssistant.graph_id)},streamMode:["messages","values"],streamSubgraphs:!0,command:a}))(),f=[];this.emit("start",{event:"start"});for await(const m of c)if(f.push(m),m.event==="metadata")this.currentRun=m.data;else if(m.event==="error")this.emit("error",m);else if(m.event==="messages/partial"){for(const g of m.data)this.messageProcessor.updateStreamingMessage(g);this.emit("message",m);continue}else if(m.event==="values"){const g=m.data;if(g.messages){const v=!!(a!=null&&a.resume),w=g.messages.length>=this.messageProcessor.getGraphMessages().length;(!v||v&&w)&&(this.messageProcessor.setGraphMessages(g.messages),this.emit("value",m)),this.graphState=m.data}continue}else m.event.startsWith("values|")&&((h=m.data)!=null&&h.messages&&this.messageProcessor.mergeSubGraphMessagesToStreamingMessages(m.data.messages),this.graphPosition=m.event.split("|")[1]);const d=await this.runFETool();return d&&f.push(...d),this.emit("done",{event:"done"}),this.messageProcessor.clearStreamingMessages(),f}getGraphPosition(){return this.graphPosition.split("|").map(t=>{const[n,r]=t.split(":");return{id:r,name:n}})}getGraphNodeNow(){const t=this.getGraphPosition();return t[t.length-1]}runFETool(){var r;const t=this.messageProcessor.getStreamingMessages(),n=t[t.length-1];if(n&&n.type==="ai"&&(r=n.tool_calls)!=null&&r.length){const i=n.tool_calls.map(a=>{if(this.tools.getTool(a.name)){const o={...a,tool_call_id:a.id,tool_input:JSON.stringify(a.args),additional_kwargs:{}};return this.callFETool(o,a.args)}});return this.currentThread.status="interrupted",Promise.all(i)}}async callFETool(t,n){const r=this,i=await this.tools.callTool(t.name,n,{client:r,message:t});if(i)return this.resume(i)}resume(t){return this.sendMessage([],{command:{resume:t}})}doneFEToolWaiting(t,n){var i;!this.tools.doneWaiting(t,n)&&((i=this.currentThread)==null?void 0:i.status)==="interrupted"&&this.resume(n)}getCurrentThread(){return this.currentThread}getCurrentAssistant(){return this.currentAssistant}async reset(){var t;await this.initAssistant((t=this.currentAssistant)==null?void 0:t.graph_id),this.currentThread=null,this.graphState={},this.messageProcessor.setGraphMessages([]),this.messageProcessor.clearStreamingMessages(),this.currentRun=void 0,this.tools.clearWaiting(),this.emit("value",{event:"messages/partial",data:{messages:[]}})}}let Tr=[],ba=0;const dd=4;let In=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},lc:0,listen(r){return n.lc=t.push(r),()=>{for(let a=ba+dd;a<Tr.length;)Tr[a]===r?Tr.splice(a,dd):a+=dd;let i=t.indexOf(r);~i&&(t.splice(i,1),--n.lc)}},notify(r,i){let a=!Tr.length;for(let o of t)Tr.push(o,n.value,r,i);if(a){for(ba=0;ba<Tr.length;ba+=dd)Tr[ba](Tr[ba+1],Tr[ba+2],Tr[ba+3]);Tr.length=0}},off(){},set(r){let i=n.value;i!==r&&(n.value=r,n.notify(i))},subscribe(r){let i=n.listen(r);return r(n.value),i},value:e};return n};function GF(e,t,n){let r=new Set(t).add(void 0);return e.listen((i,a,o)=>{r.has(o)&&n(i,a,o)})}function YF(e,t,n){var r,i,a;n===void 0&&(n={});var o=(r=n.isImmediate)!=null&&r,l=(i=n.callback)!=null&&i,c=n.maxWait,f=Date.now(),d=[];function h(){if(c!==void 0){var g=Date.now()-f;if(g+t>=c)return c-g}return t}var m=function(){var g=[].slice.call(arguments),v=this;return new Promise(function(w,b){var _=o&&a===void 0;if(a!==void 0&&clearTimeout(a),a=setTimeout(function(){if(a=void 0,f=Date.now(),!o){var x=e.apply(v,g);l&&l(x),d.forEach(function(A){return(0,A.resolve)(x)}),d=[]}},h()),_){var S=e.apply(v,g);return l&&l(S),w(S)}d.push({resolve:w,reject:b})})};return m.cancel=function(g){a!==void 0&&clearTimeout(a),d.forEach(function(v){return(0,v.reject)(g)}),d=[]},m}const ZF="modulepreload",KF=function(e){return"/"+e},YT={},XF=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(f){return Promise.all(f.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=o(n.map(f=>{if(f=KF(f),f in YT)return;YT[f]=!0;const d=f.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":ZF,d||(m.as="script"),m.crossOrigin="",m.href=f,c&&m.setAttribute("nonce",c),document.head.appendChild(m),d)return new Promise((g,v)=>{m.addEventListener("load",g),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})},WF=async e=>{const{Client:t}=await XF(async()=>{const{Client:n}=await Promise.resolve().then(()=>eB);return{Client:n}},void 0);return new t(e)},QF=e=>e.toLocaleTimeString("en-US"),JF=e=>e.toLocaleString("en"),Fh=e=>typeof e=="string"?e:Array.isArray(e)?e.map(t=>typeof t=="string"?t:t.type==="text"?t.text:t.type==="image_url"?"[图片]":JSON.stringify(t)).join(""):JSON.stringify(e),e7=e=>{var n,r,i;const t=(i=(r=(n=e==null?void 0:e.values)==null?void 0:n.messages)==null?void 0:r[0])==null?void 0:i.content;return t&&Array.isArray(t)?t.map(a=>{if(a.type==="text")return a.text}):typeof t=="string"?t:""},t7=(e,t,n={})=>{const r=In(null),i=In([]),a=In(""),o=In(!1),l=In([]),c=In(null),f=In(n.showHistory??!1),d=In(e),h=In(null),m=In("__start__"),g=In([]),v=async()=>{const P=r.get();P&&(P.tools.clearTools(),P.tools.bindTools(g.get()))},w=In(n.showGraph??!1),b=In(null),_=async()=>{var P;w.get()&&b.set(await((P=r.get())==null?void 0:P.graphVisualize())||null)},S=YF(P=>{const q=P.renderMessage,D=q[q.length-1];m.set((D==null?void 0:D.node_name)||(D==null?void 0:D.name)||"__start__"),i.set(q)},10);async function x(){var q;const P=new HF({...t,client:t.client??await WF(t)});return await P.initAssistant(d.get()),d.set(P.getCurrentAssistant().graph_id),c.set(null),P.on("start",()=>{o.set(!0)}),P.on("thread",()=>{var D;h.set(((D=P.getCurrentThread())==null?void 0:D.thread_id)||null),m.set("__start__"),L()}),P.on("done",()=>{o.set(!1),S(P)}),P.on("error",D=>{o.set(!1),c.set(D.data)}),P.on("message",()=>{var D;h.set(((D=P.getCurrentThread())==null?void 0:D.thread_id)||null),S(P)}),P.on("value",()=>{var D;h.set(((D=P.getCurrentThread())==null?void 0:D.thread_id)||null),S(P)}),(q=n.onInit)==null||q.call(n,P),P.graphState={},r.set(P),w.get()&&_(),v(),P}const A=async(P,q)=>{var D;!a.get().trim()&&!(P!=null&&P.length)||o.get()||!r.get()||(o.set(!0),c.set(null),await((D=r.get())==null?void 0:D.sendMessage(P||a.get(),q)),a.set(""),o.set(!1))},k=()=>{var P;(P=r.get())==null||P.cancelRun()},T=P=>{const q=l.get();l.set(q.includes(P)?q.filter(D=>D!==P):[...q,P])},O=()=>{f.set(!f.get()),f.get()&&L()},$=In([]),L=async()=>{var P;if(!(!r.get()||!f.get()))try{const q=await((P=r.get())==null?void 0:P.listThreads());$.set(q||[])}catch(q){console.error("Failed to fetch threads:",q)}};return{data:{client:r,renderMessages:i,userInput:a,loading:o,inChatError:c,currentAgent:d,collapsedTools:l,showHistory:f,historyList:$,currentChatId:h,showGraph:w,graphVisualize:b,currentNodeName:m,tools:g},mutations:{refreshTools:v,setTools(P){g.set(P),v()},isFELocking(){var P;return(P=r.get())==null?void 0:P.isFELocking(i.get())},initClient:x,sendMessage:A,stopGeneration:k,toggleToolCollapse:T,toggleHistoryVisible:O,refreshHistoryList:L,addToHistory:P=>{const q=$.get();$.set([P,...q])},setUserInput(P){a.set(P)},setCurrentAgent(P){return d.set(P),x().then(()=>{f.get()&&L()})},toggleGraphVisible(){w.set(!w.get()),w.get()&&_()},refreshGraph:_,createNewChat(){var P;(P=r.get())==null||P.reset(),c.set(null),o.set(!1)},async toHistoryChat(P){var D,H,B;c.set(null),o.set(!1);const q=await((H=r.get())==null?void 0:H.resetThread((D=P.metadata)==null?void 0:D.graph_id,P.thread_id));return q&&((B=r.get())==null||B.resetStream()),q},async deleteHistoryChat(P){var q;await((q=r.get())==null?void 0:q.deleteThread(P.thread_id)),await L()},getToolUIRender:P=>{var H;const D=(H=r.get().tools.getAllTools().find(B=>B.name===P))==null?void 0:H.render;return D?B=>D(new x7(B,r.get())):null}}}};class So extends Error{constructor(t,n){super("".concat(t," at position ").concat(n)),this.position=n}}const o3=32,n7=10,l3=9,u3=13,r7=160,i7=8192,a7=8202,s7=8239,o7=8287,l7=12288;function u7(e){return/^[0-9A-Fa-f]$/.test(e)}function rs(e){return e>="0"&&e<="9"}function c7(e){return e>=" "}function hd(e){return`,:[]/{}()
|
|
55
55
|
+`.includes(e)}function ZT(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"||e==="$"}function KT(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"||e==="$"||e>="0"&&e<="9"}const XT=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,WT=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function QT(e){return`,[]/{}
|
|
56
56
|
+`.includes(e)}function JT(e){return xh(e)||f7.test(e)}const f7=/^[[{\w-]$/;function d7(e){return e===`
|
|
57
57
|
`||e==="\r"||e===" "||e==="\b"||e==="\f"}function cs(e,t){const n=e.charCodeAt(t);return n===o3||n===n7||n===l3||n===u3}function h7(e,t){const n=e.charCodeAt(t);return n===o3||n===l3||n===u3}function p7(e,t){const n=e.charCodeAt(t);return n===r7||n>=i7&&n<=a7||n===s7||n===o7||n===l7}function xh(e){return c3(e)||aw(e)}function c3(e){return e==='"'||e==="“"||e==="”"}function eC(e){return e==='"'}function aw(e){return e==="'"||e==="‘"||e==="’"||e==="`"||e==="´"}function tC(e){return e==="'"}function _u(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=e.lastIndexOf(t);return r!==-1?e.substring(0,r)+(n?"":e.substring(r+1)):e}function Cr(e,t){let n=e.length;if(!cs(e,n-1))return e+t;for(;cs(e,n-1);)n--;return e.substring(0,n)+t+e.substring(n)}function m7(e,t,n){return e.substring(0,t)+e.substring(t+n)}function g7(e){return/[,\n][ \t\r]*$/.test(e)}const y7={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},b7={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
@@ -101,10 +101,10 @@ Error generating stack: `+p.message+`
|
|
|
101
101
|
* **记忆生命周期管理:** 对记忆条目进行**全生命周期管理**,包括创建、更新、检索和删除。
|
|
102
102
|
* **分段与标签支持:** 支持**分段或打标签的记忆条目**,方便分类和高效检索。
|
|
103
103
|
* **存储选项灵活:** 提供**临时和永久两种存储选项**,以适应不同类型信息的存储需求。
|
|
104
|
-
`,parameters:[{name:"path",type:"string",description:"记忆路径(创建时需要)"},{name:"tags",type:"string[]",description:"记忆标签(创建或更新时需要)"},{name:"content",type:"string",description:"记忆内容(创建或更新时需要)"},{name:"action",type:"string",enum:["create","update","delete"],description:"操作类型:create(创建)、update(更新)、delete(删除)"},{name:"id",type:"string",description:"记忆ID(更新或删除时需要,创建时会自动生成)",required:!1},{name:"referencePath",type:"string",description:"引用文档的 URL",required:!1}],handler:async t=>{const{content:n,action:r,id:i,tags:a,path:o,referencePath:l}=t;if((r==="delete"||r==="update")&&!i)throw new Error("删除或更新记忆时必须提供记忆ID");if((r==="create"||r==="update")&&!n)throw new Error("创建或更新记忆时必须提供内容");try{if(r==="delete")return await e.delete(Number(i)),`已删除记忆 ${i}`;const c={text:n,content:AZ(n),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),namespace:kZ(),tags:a,path:o,type:"document",referencePath:l};return r==="create"?`已创建记忆 ${await e.insert(c)}`:(await e.update(Number(i),c),`已更新记忆 ${i}`)}catch(c){throw new Error(`记忆操作失败: ${c}`)}}}),searchMemory:GT({name:"search_memory",description:"搜索长期记忆中的相关信息,帮助维护对话上下文",parameters:[{name:"query",type:"string",description:"请使用中文关键词进行搜索"},{name:"tags",type:"string[]",description:"记忆标签",required:!1},{name:"path",type:"string",description:"记忆路径,memory://user_id/path/to/memory_name",required:!1},{name:"limit",type:"number",description:"返回结果的最大数量(默认10)",required:!1}],handler:async t=>{const{query:n,limit:r=10,tags:i,path:a}=t;if(!n||typeof n=="string"&&n.trim().length===0)throw new Error("搜索查询不能为空");try{const o=await e.query(n.toString(),{limit:r});return{query:n.toString(),results:o,total:o.length,limit:Number(r)}}catch(o){throw new Error(`搜索记忆失败: ${o}`)}}})}),yw=(e,t)=>t.some(n=>e instanceof n);let aO,sO;function CZ(){return aO||(aO=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function OZ(){return sO||(sO=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const bw=new WeakMap,c0=new WeakMap,Sp=new WeakMap;function NZ(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",a),e.removeEventListener("error",o)},a=()=>{n(ms(e.result)),i()},o=()=>{r(e.error),i()};e.addEventListener("success",a),e.addEventListener("error",o)});return Sp.set(t,e),t}function RZ(e){if(bw.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",o),e.removeEventListener("abort",o)},a=()=>{n(),i()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",a),e.addEventListener("error",o),e.addEventListener("abort",o)});bw.set(e,t)}let vw={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return bw.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ms(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function b5(e){vw=e(vw)}function jZ(e){return OZ().includes(e)?function(...t){return e.apply(_w(this),t),ms(this.request)}:function(...t){return ms(e.apply(_w(this),t))}}function MZ(e){return typeof e=="function"?jZ(e):(e instanceof IDBTransaction&&RZ(e),yw(e,CZ())?new Proxy(e,vw):e)}function ms(e){if(e instanceof IDBRequest)return NZ(e);if(c0.has(e))return c0.get(e);const t=MZ(e);return t!==e&&(c0.set(e,t),Sp.set(t,e)),t}const _w=e=>Sp.get(e);function $Z(e,t,{blocked:n,upgrade:r,blocking:i,terminated:a}={}){const o=indexedDB.open(e,t),l=ms(o);return r&&o.addEventListener("upgradeneeded",c=>{r(ms(o.result),c.oldVersion,c.newVersion,ms(o.transaction),c)}),n&&o.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),l.then(c=>{a&&c.addEventListener("close",()=>a()),i&&c.addEventListener("versionchange",f=>i(f.oldVersion,f.newVersion,f))}).catch(()=>{}),l}const DZ=["get","getKey","getAll","getAllKeys","count"],IZ=["put","add","delete","clear"],f0=new Map;function oO(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(f0.get(t))return f0.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=IZ.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||DZ.includes(n)))return;const a=async function(o,...l){const c=this.transaction(o,i?"readwrite":"readonly");let f=c.store;return r&&(f=f.index(l.shift())),(await Promise.all([f[n](...l),i&&c.done]))[0]};return f0.set(t,a),a}b5(e=>({...e,get:(t,n,r)=>oO(t,n)||e.get(t,n,r),has:(t,n)=>!!oO(t,n)||e.has(t,n)}));const PZ=["continue","continuePrimaryKey","advance"],lO={},xw=new WeakMap,v5=new WeakMap,LZ={get(e,t){if(!PZ.includes(t))return e[t];let n=lO[t];return n||(n=lO[t]=function(...r){xw.set(this,v5.get(this)[t](...r))}),n}};async function*zZ(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,LZ);for(v5.set(n,t),Sp.set(n,_w(t));t;)yield n,t=await(xw.get(n)||t.continue()),xw.delete(n)}function uO(e,t){return t===Symbol.asyncIterator&&yw(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&yw(e,[IDBIndex,IDBObjectStore])}b5(e=>({...e,get(t,n,r){return uO(t,n)?zZ:e.get(t,n,r)},has(t,n){return uO(t,n)||e.has(t,n)}}));class qZ{constructor(t){De(this,"isInitialized",!1);De(this,"config");this.config=t}}const FZ="ENTRIES",_5="KEYS",x5="VALUES",gn="";class d0{constructor(t,n){const r=t._tree,i=Array.from(r.keys());this.set=t,this._type=n,this._path=i.length>0?[{node:r,keys:i}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=Ao(this._path);if(Ao(n)===gn)return{done:!1,value:this.result()};const r=t.get(Ao(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=Ao(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>Ao(t)).filter(t=>t!==gn).join("")}value(){return Ao(this._path).node.get(gn)}result(){switch(this._type){case x5:return this.value();case _5:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const Ao=e=>e[e.length-1],BZ=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const i=t.length+1,a=i+n,o=new Uint8Array(a*i).fill(n+1);for(let l=0;l<i;++l)o[l]=l;for(let l=1;l<a;++l)o[l*i]=l;return w5(e,t,n,r,o,1,i,""),r},w5=(e,t,n,r,i,a,o,l)=>{const c=a*o;e:for(const f of e.keys())if(f===gn){const d=i[c-1];d<=n&&r.set(l,[e.get(f),d])}else{let d=a;for(let h=0;h<f.length;++h,++d){const m=f[h],g=o*d,v=g-o;let w=i[g];const b=Math.max(0,d-n-1),_=Math.min(o-1,d+n);for(let S=b;S<_;++S){const x=m!==t[S],A=i[v+S]+ +x,k=i[v+S+1]+1,T=i[g+S]+1,O=i[g+S+1]=Math.min(A,k,T);O<w&&(w=O)}if(w>n)continue e}w5(e.get(f),t,n,r,i,d,o,l+f)}};class Na{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Gh(this._tree,t.slice(this._prefix.length));if(n===void 0){const[i,a]=bS(r);for(const o of i.keys())if(o!==gn&&o.startsWith(a)){const l=new Map;return l.set(o.slice(a.length),i.get(o)),new Na(l,t)}}return new Na(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,UZ(this._tree,t)}entries(){return new d0(this,FZ)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return BZ(this._tree,t,n)}get(t){const n=ww(this._tree,t);return n!==void 0?n.get(gn):void 0}has(t){const n=ww(this._tree,t);return n!==void 0&&n.has(gn)}keys(){return new d0(this,_5)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,h0(this._tree,t).set(gn,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=h0(this._tree,t);return r.set(gn,n(r.get(gn))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=h0(this._tree,t);let i=r.get(gn);return i===void 0&&r.set(gn,i=n()),i}values(){return new d0(this,x5)}[Symbol.iterator](){return this.entries()}static from(t){const n=new Na;for(const[r,i]of t)n.set(r,i);return n}static fromObject(t){return Na.from(Object.entries(t))}}const Gh=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==gn&&t.startsWith(r))return n.push([e,r]),Gh(e.get(r),t.slice(r.length),n);return n.push([e,t]),Gh(void 0,"",n)},ww=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==gn&&t.startsWith(n))return ww(e.get(n),t.slice(n.length))},h0=(e,t)=>{const n=t.length;e:for(let r=0;e&&r<n;){for(const a of e.keys())if(a!==gn&&t[r]===a[0]){const o=Math.min(n-r,a.length);let l=1;for(;l<o&&t[r+l]===a[l];)++l;const c=e.get(a);if(l===a.length)e=c;else{const f=new Map;f.set(a.slice(l),c),e.set(t.slice(r,r+l),f),e.delete(a),e=f}r+=l;continue e}const i=new Map;return e.set(t.slice(r),i),i}return e},UZ=(e,t)=>{const[n,r]=Gh(e,t);if(n!==void 0){if(n.delete(gn),n.size===0)S5(r);else if(n.size===1){const[i,a]=n.entries().next().value;E5(r,i,a)}}},S5=e=>{if(e.length===0)return;const[t,n]=bS(e);if(t.delete(n),t.size===0)S5(e.slice(0,-1));else if(t.size===1){const[r,i]=t.entries().next().value;r!==gn&&E5(e.slice(0,-1),r,i)}},E5=(e,t,n)=>{if(e.length===0)return;const[r,i]=bS(e);r.set(i+t,n),r.delete(i)},bS=e=>e[e.length-1],vS="or",k5="and",VZ="and_not";class gs{constructor(t){if((t==null?void 0:t.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const n=t.autoVacuum==null||t.autoVacuum===!0?g0:t.autoVacuum;this._options={...m0,...t,autoVacuum:n,searchOptions:{...cO,...t.searchOptions||{}},autoSuggestOptions:{...KZ,...t.autoSuggestOptions||{}}},this._index=new Na,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Ew,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:i,fields:a,idField:o}=this._options,l=n(t,o);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);if(this._idToShortId.has(l))throw new Error(`MiniSearch: duplicate ID ${l}`);const c=this.addDocumentId(l);this.saveStoredFields(c,t);for(const f of a){const d=n(t,f);if(d==null)continue;const h=r(d.toString(),f),m=this._fieldIds[f],g=new Set(h).size;this.addFieldLength(c,m,this._documentCount-1,g);for(const v of h){const w=i(v,f);if(Array.isArray(w))for(const b of w)this.addTerm(m,c,b);else w&&this.addTerm(m,c,w)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,i={chunk:[],promise:Promise.resolve()},{chunk:a,promise:o}=t.reduce(({chunk:l,promise:c},f,d)=>(l.push(f),(d+1)%r===0?{chunk:[],promise:c.then(()=>new Promise(h=>setTimeout(h,0))).then(()=>this.addAll(l))}:{chunk:l,promise:c}),i);return o.then(()=>this.addAll(a))}remove(t){const{tokenize:n,processTerm:r,extractField:i,fields:a,idField:o}=this._options,l=i(t,o);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);const c=this._idToShortId.get(l);if(c==null)throw new Error(`MiniSearch: cannot remove document with ID ${l}: it is not in the index`);for(const f of a){const d=i(t,f);if(d==null)continue;const h=n(d.toString(),f),m=this._fieldIds[f],g=new Set(h).size;this.removeFieldLength(c,m,this._documentCount,g);for(const v of h){const w=r(v,f);if(Array.isArray(w))for(const b of w)this.removeTerm(m,c,b);else w&&this.removeTerm(m,c,w)}}this._storedFields.delete(c),this._documentIds.delete(c),this._idToShortId.delete(l),this._fieldLength.delete(c),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Na,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,i)=>{this.removeFieldLength(n,i,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:i},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,i=r(t,n);this.discard(i),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Ew,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const i=t.batchSize||Sw.batchSize,a=t.batchWait||Sw.batchWait;let o=1;for(const[l,c]of this._index){for(const[f,d]of c)for(const[h]of d)this._documentIds.has(h)||(d.size<=1?c.delete(f):d.delete(h));this._index.get(l).size===0&&this._index.delete(l),o%i===0&&await new Promise(f=>setTimeout(f,a)),o+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||g0.minDirtCount,r=r||g0.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,i={...r,...n},a=this.executeQuery(t,n),o=[];for(const[l,{score:c,terms:f,match:d}]of a){const h=f.length||1,m={id:this._documentIds.get(l),score:c*h,terms:Object.keys(d),queryTerms:f,match:d};Object.assign(m,this._storedFields.get(l)),(i.filter==null||i.filter(m))&&o.push(m)}return t===gs.wildcard&&i.boostDocument==null||o.sort(dO),o}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:a,terms:o}of this.search(t,n)){const l=o.join(" "),c=r.get(l);c!=null?(c.score+=a,c.count+=1):r.set(l,{score:a,terms:o,count:1})}const i=[];for(const[a,{score:o,terms:l,count:c}]of r)i.push({suggestion:a,terms:l,score:o/c});return i.sort(dO),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),n)}static getDefault(t){if(m0.hasOwnProperty(t))return p0(m0,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:i,fieldLength:a,storedFields:o,serializationVersion:l}=t,c=this.instantiateMiniSearch(t,n);c._documentIds=xd(i),c._fieldLength=xd(a),c._storedFields=xd(o);for(const[f,d]of c._documentIds)c._idToShortId.set(d,f);for(const[f,d]of r){const h=new Map;for(const m of Object.keys(d)){let g=d[m];l===1&&(g=g.ds),h.set(parseInt(m,10),xd(g))}c._index.set(f,h)}return c}static async loadJSAsync(t,n){const{index:r,documentIds:i,fieldLength:a,storedFields:o,serializationVersion:l}=t,c=this.instantiateMiniSearch(t,n);c._documentIds=await wd(i),c._fieldLength=await wd(a),c._storedFields=await wd(o);for(const[d,h]of c._documentIds)c._idToShortId.set(h,d);let f=0;for(const[d,h]of r){const m=new Map;for(const g of Object.keys(h)){let v=h[g];l===1&&(v=v.ds),m.set(parseInt(g,10),await wd(v))}++f%1e3===0&&await A5(0),c._index.set(d,m)}return c}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:i,fieldIds:a,averageFieldLength:o,dirtCount:l,serializationVersion:c}=t;if(c!==1&&c!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const f=new gs(n);return f._documentCount=r,f._nextId=i,f._idToShortId=new Map,f._fieldIds=a,f._avgFieldLength=o,f._dirtCount=l||0,f._index=new Na,f}executeQuery(t,n={}){if(t===gs.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const m={...n,...t,queries:void 0},g=t.queries.map(v=>this.executeQuery(v,m));return this.combineResults(g,m.combineWith)}const{tokenize:r,processTerm:i,searchOptions:a}=this._options,o={tokenize:r,processTerm:i,...a,...n},{tokenize:l,processTerm:c}=o,h=l(t).flatMap(m=>c(m)).filter(m=>!!m).map(ZZ(o)).map(m=>this.executeQuerySpec(m,o));return this.combineResults(h,o.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},i=(r.fields||this._options.fields).reduce((w,b)=>({...w,[b]:p0(r.boost,b)||1}),{}),{boostDocument:a,weights:o,maxFuzzy:l,bm25:c}=r,{fuzzy:f,prefix:d}={...cO.weights,...o},h=this._index.get(t.term),m=this.termResults(t.term,t.term,1,t.termBoost,h,i,a,c);let g,v;if(t.prefix&&(g=this._index.atPrefix(t.term)),t.fuzzy){const w=t.fuzzy===!0?.2:t.fuzzy,b=w<1?Math.min(l,Math.round(t.term.length*w)):w;b&&(v=this._index.fuzzyGet(t.term,b))}if(g)for(const[w,b]of g){const _=w.length-t.term.length;if(!_)continue;v==null||v.delete(w);const S=d*w.length/(w.length+.3*_);this.termResults(t.term,w,S,t.termBoost,b,i,a,c,m)}if(v)for(const w of v.keys()){const[b,_]=v.get(w);if(!_)continue;const S=f*w.length/(w.length+_);this.termResults(t.term,w,S,t.termBoost,b,i,a,c,m)}return m}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[i,a]of this._documentIds){const o=r.boostDocument?r.boostDocument(a,"",this._storedFields.get(i)):1;n.set(i,{score:o,terms:[],match:{}})}return n}combineResults(t,n=vS){if(t.length===0)return new Map;const r=n.toLowerCase(),i=HZ[r];if(!i)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(i)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const i={};for(const[a,o]of r)i[a]=Object.fromEntries(o);t.push([n,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,i,a,o,l,c,f=new Map){if(a==null)return f;for(const d of Object.keys(o)){const h=o[d],m=this._fieldIds[d],g=a.get(m);if(g==null)continue;let v=g.size;const w=this._avgFieldLength[m];for(const b of g.keys()){if(!this._documentIds.has(b)){this.removeTerm(m,b,n),v-=1;continue}const _=l?l(this._documentIds.get(b),n,this._storedFields.get(b)):1;if(!_)continue;const S=g.get(b),x=this._fieldLength.get(b)[m],A=YZ(S,v,this._documentCount,x,w,c),k=r*i*h*_*A,T=f.get(b);if(T){T.score+=k,XZ(T.terms,t);const O=p0(T.match,n);O?O.push(d):T.match[n]=[d]}else f.set(b,{score:k,terms:[t],match:{[n]:[d]}})}}return f}addTerm(t,n,r){const i=this._index.fetch(r,hO);let a=i.get(t);if(a==null)a=new Map,a.set(n,1),i.set(t,a);else{const o=a.get(n);a.set(n,(o||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const i=this._index.fetch(r,hO),a=i.get(t);a==null||a.get(n)==null?this.warnDocumentChanged(n,t,r):a.get(n)<=1?a.size<=1?i.delete(t):a.delete(n):a.set(n,a.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const i of Object.keys(this._fieldIds))if(this._fieldIds[i]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;n<t.length;n++)this._fieldIds[t[n]]=n}addFieldLength(t,n,r,i){let a=this._fieldLength.get(t);a==null&&this._fieldLength.set(t,a=[]),a[n]=i;const l=(this._avgFieldLength[n]||0)*r+i;this._avgFieldLength[n]=l/(r+1)}removeFieldLength(t,n,r,i){if(r===1){this._avgFieldLength[n]=0;return}const a=this._avgFieldLength[n]*r-i;this._avgFieldLength[n]=a/(r-1)}saveStoredFields(t,n){const{storeFields:r,extractField:i}=this._options;if(r==null||r.length===0)return;let a=this._storedFields.get(t);a==null&&this._storedFields.set(t,a={});for(const o of r){const l=i(n,o);l!==void 0&&(a[o]=l)}}}gs.wildcard=Symbol("*");const p0=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,HZ={[vS]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:i,terms:a,match:o}=t.get(n);r.score=r.score+i,r.match=Object.assign(r.match,o),fO(r.terms,a)}}return e},[k5]:(e,t)=>{const n=new Map;for(const r of t.keys()){const i=e.get(r);if(i==null)continue;const{score:a,terms:o,match:l}=t.get(r);fO(i.terms,o),n.set(r,{score:i.score+a,terms:i.terms,match:Object.assign(i.match,l)})}return n},[VZ]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},GZ={k:1.2,b:.7,d:.5},YZ=(e,t,n,r,i,a)=>{const{k:o,b:l,d:c}=a;return Math.log(1+(n-t+.5)/(t+.5))*(c+e*(o+1)/(e+o*(1-l+l*r/i)))},ZZ=e=>(t,n,r)=>{const i=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,a=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,o=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:i,prefix:a,termBoost:o}},m0={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(WZ),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])=="function"&&console[e](t)},autoVacuum:!0},cO={combineWith:vS,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:GZ},KZ={combineWith:k5,prefix:(e,t,n)=>t===n.length-1},Sw={batchSize:1e3,batchWait:10},Ew={minDirtFactor:.1,minDirtCount:20},g0={...Sw,...Ew},XZ=(e,t)=>{e.includes(t)||e.push(t)},fO=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},dO=({score:e},{score:t})=>t-e,hO=()=>new Map,xd=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},wd=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await A5(0);return t},A5=e=>new Promise(t=>setTimeout(t,e)),WZ=/[\n\r\p{Z}\p{P}]+/u,pO={dbName:"minisearch_memory_db",dbVersion:1,storeName:"memory",miniSearchOptions:{fields:["text","path","tags","referencePath"],storeFields:["text","path","tags","referencePath"],tokenize:T5}};function T5(e){const t=e.replace(/ /g,""),n=new Intl.Segmenter("zh-CN",{granularity:"word"});return Array.from(n.segment(t)).map(i=>i.segment)}class QZ extends qZ{constructor(n){const r={...pO,...n,miniSearchOptions:{...pO.miniSearchOptions,...(n==null?void 0:n.miniSearchOptions)||{}}};super(r);De(this,"miniSearch");De(this,"config");De(this,"db");this.config=r}async initialize(){if(this.isInitialized)return;const{storeName:n}=this.config;this.db=await $Z(this.config.dbName,this.config.dbVersion,{upgrade(i){i.objectStoreNames.contains(n)||i.createObjectStore(n,{keyPath:"id",autoIncrement:!0}),i.objectStoreNames.contains("minisearch_index")||i.createObjectStore("minisearch_index")}});const r={fields:this.config.miniSearchOptions.fields||["text"],storeFields:this.config.miniSearchOptions.storeFields||["text"],tokenize:this.config.miniSearchOptions.tokenize||T5};this.miniSearch=new gs(r);try{const i=await this.loadMiniSearchIndex();if(i)console.log(i),this.miniSearch=await gs.loadJSAsync(i,r),console.log("MiniSearch index loaded from IndexedDB.");else{console.log("No saved index found, building from documents...");const a=await this.getAll();a.length>0?(this.miniSearch.addAll(a),await this.saveMiniSearchIndex(this.miniSearch.toJSON()),console.log(`MiniSearch index built from ${a.length} documents and saved.`)):console.log("No documents found, index is empty.")}this.isInitialized=!0}catch(i){throw console.error("Failed to initialize FullTextSearchService:",i),i}}async insert(n){const r=this.db.transaction(this.config.storeName,"readwrite"),i=r.objectStore(this.config.storeName),a={...n},o=await i.add(a);return a.id=Number(o),await r.done,this.miniSearch.add(a),await this.saveMiniSearchIndex(this.miniSearch.toJSON()),a.id}async update(n,r){const a=this.db.transaction(this.config.storeName,"readwrite").objectStore(this.config.storeName),o={...r,id:n};await a.put(o);const l=await a.get(n);l&&this.miniSearch.remove(l),this.miniSearch.add(o),await this.saveMiniSearchIndex(this.miniSearch.toJSON())}async delete(n){const i=this.db.transaction(this.config.storeName,"readwrite").objectStore(this.config.storeName),a=await i.get(n);a&&this.miniSearch.remove(a),await i.delete(n),await this.saveMiniSearchIndex(this.miniSearch.toJSON())}async query(n,r){return this.miniSearch.search(n,r).slice(0,(r==null?void 0:r.limit)??5).map(a=>{const{id:o,text:l,...c}=a;return{id:o,text:l,tags:c.tags,path:c.path,type:c.type,score:Math.round(a.score),referencePath:c.referencePath}})}async get(n){return this.db.transaction(this.config.storeName,"readonly").objectStore(this.config.storeName).get(n)}async getAll(){return this.db.transaction(this.config.storeName,"readonly").objectStore(this.config.storeName).getAll()}async loadMiniSearchIndex(){return this.db.transaction("minisearch_index","readonly").objectStore("minisearch_index").get("indexData")}async saveMiniSearchIndex(n){const r=this.db.transaction("minisearch_index","readwrite");await r.objectStore("minisearch_index").put(n,"indexData"),await r.done}}const JZ=localStorage.getItem("withCredentials")==="true"?(e,t)=>(t.credentials="include",fetch(e,t)):fetch,eK=()=>({showHistory:localStorage.getItem("showHistory")==="true"||!1,showGraph:localStorage.getItem("showGraph")==="true"||!1}),mO=e=>{Object.entries(e).forEach(([t,n])=>{localStorage.setItem(t,n.toString())})},_S=new QZ({dbName:"memory_fulltext_db",dbVersion:1,storeName:"memory"});_S.initialize();console.log(_S);TZ(_S);const tK=t7(localStorage.getItem("agent_name")||"",{apiUrl:localStorage.getItem("apiUrl")||"http://localhost:8123",defaultHeaders:JSON.parse(localStorage.getItem("code")||"{}"),callerOptions:{fetch:JZ}},{...eK()});let y0=(e,t)=>n=>{e.current!==n&&(e.current=n,t())};function nK(e,{keys:t,deps:n=[e,t]}={}){let r=te.useRef();r.current=e.get();let i=te.useCallback(o=>(y0(r,o)(e.value),(t==null?void 0:t.length)>0?GF(e,t,y0(r,o)):e.listen(y0(r,o))),n),a=()=>r.current;return te.useSyncExternalStore(i,a,a)}const C5=te.createContext(void 0),Ts=()=>{const e=te.useContext(C5);if(!e)throw new Error("useChat must be used within a ChatProvider");return e},rK=({children:e})=>{const t=tB(tK,nK);return te.useEffect(()=>{t.initClient().then(n=>{t.showHistory&&t.refreshHistoryList(),console.log(n)}).catch(n=>{console.error(n);const r=prompt("Failed to initialize chat client: "+t.currentAgent+`
|
|
105
|
-
请输入 agent 名称`);localStorage.setItem("agent_name",r),location.reload()})},[]),N.jsx(C5.Provider,{value:t,children:e})};function O5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=O5(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function N5(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=O5(e))&&(r&&(r+=" "),r+=t);return r}var iK=Object.create,Ep=Object.defineProperty,aK=Object.defineProperties,sK=Object.getOwnPropertyDescriptor,oK=Object.getOwnPropertyDescriptors,R5=Object.getOwnPropertyNames,Yh=Object.getOwnPropertySymbols,lK=Object.getPrototypeOf,xS=Object.prototype.hasOwnProperty,j5=Object.prototype.propertyIsEnumerable,gO=(e,t,n)=>t in e?Ep(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xr=(e,t)=>{for(var n in t||(t={}))xS.call(t,n)&&gO(e,n,t[n]);if(Yh)for(var n of Yh(t))j5.call(t,n)&&gO(e,n,t[n]);return e},kp=(e,t)=>aK(e,oK(t)),M5=(e,t)=>{var n={};for(var r in e)xS.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Yh)for(var r of Yh(e))t.indexOf(r)<0&&j5.call(e,r)&&(n[r]=e[r]);return n},uK=(e,t)=>function(){return t||(0,e[R5(e)[0]])((t={exports:{}}).exports,t),t.exports},cK=(e,t)=>{for(var n in t)Ep(e,n,{get:t[n],enumerable:!0})},fK=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of R5(t))!xS.call(e,i)&&i!==n&&Ep(e,i,{get:()=>t[i],enumerable:!(r=sK(t,i))||r.enumerable});return e},dK=(e,t,n)=>(n=e!=null?iK(lK(e)):{},fK(!e||!e.__esModule?Ep(n,"default",{value:e,enumerable:!0}):n,e)),hK=uK({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,a={},o={util:{encode:function v(w){return w instanceof l?new l(w.type,v(w.content),w.alias):Array.isArray(w)?w.map(v):w.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(v){return Object.prototype.toString.call(v).slice(8,-1)},objId:function(v){return v.__id||Object.defineProperty(v,"__id",{value:++i}),v.__id},clone:function v(w,b){b=b||{};var _,S;switch(o.util.type(w)){case"Object":if(S=o.util.objId(w),b[S])return b[S];_={},b[S]=_;for(var x in w)w.hasOwnProperty(x)&&(_[x]=v(w[x],b));return _;case"Array":return S=o.util.objId(w),b[S]?b[S]:(_=[],b[S]=_,w.forEach(function(A,k){_[k]=v(A,b)}),_);default:return w}},getLanguage:function(v){for(;v;){var w=r.exec(v.className);if(w)return w[1].toLowerCase();v=v.parentElement}return"none"},setLanguage:function(v,w){v.className=v.className.replace(RegExp(r,"gi"),""),v.classList.add("language-"+w)},isActive:function(v,w,b){for(var _="no-"+w;v;){var S=v.classList;if(S.contains(w))return!0;if(S.contains(_))return!1;v=v.parentElement}return!!b}},languages:{plain:a,plaintext:a,text:a,txt:a,extend:function(v,w){var b=o.util.clone(o.languages[v]);for(var _ in w)b[_]=w[_];return b},insertBefore:function(v,w,b,_){_=_||o.languages;var S=_[v],x={};for(var A in S)if(S.hasOwnProperty(A)){if(A==w)for(var k in b)b.hasOwnProperty(k)&&(x[k]=b[k]);b.hasOwnProperty(A)||(x[A]=S[A])}var T=_[v];return _[v]=x,o.languages.DFS(o.languages,function(O,$){$===T&&O!=v&&(this[O]=x)}),x},DFS:function v(w,b,_,S){S=S||{};var x=o.util.objId;for(var A in w)if(w.hasOwnProperty(A)){b.call(w,A,w[A],_||A);var k=w[A],T=o.util.type(k);T==="Object"&&!S[x(k)]?(S[x(k)]=!0,v(k,b,null,S)):T==="Array"&&!S[x(k)]&&(S[x(k)]=!0,v(k,b,A,S))}}},plugins:{},highlight:function(v,w,b){var _={code:v,grammar:w,language:b};if(o.hooks.run("before-tokenize",_),!_.grammar)throw new Error('The language "'+_.language+'" has no grammar.');return _.tokens=o.tokenize(_.code,_.grammar),o.hooks.run("after-tokenize",_),l.stringify(o.util.encode(_.tokens),_.language)},tokenize:function(v,w){var b=w.rest;if(b){for(var _ in b)w[_]=b[_];delete w.rest}var S=new d;return h(S,S.head,v),f(v,S,w,S.head,0),g(S)},hooks:{all:{},add:function(v,w){var b=o.hooks.all;b[v]=b[v]||[],b[v].push(w)},run:function(v,w){var b=o.hooks.all[v];if(!(!b||!b.length))for(var _=0,S;S=b[_++];)S(w)}},Token:l};function l(v,w,b,_){this.type=v,this.content=w,this.alias=b,this.length=(_||"").length|0}l.stringify=function v(w,b){if(typeof w=="string")return w;if(Array.isArray(w)){var _="";return w.forEach(function(T){_+=v(T,b)}),_}var S={type:w.type,content:v(w.content,b),tag:"span",classes:["token",w.type],attributes:{},language:b},x=w.alias;x&&(Array.isArray(x)?Array.prototype.push.apply(S.classes,x):S.classes.push(x)),o.hooks.run("wrap",S);var A="";for(var k in S.attributes)A+=" "+k+'="'+(S.attributes[k]||"").replace(/"/g,""")+'"';return"<"+S.tag+' class="'+S.classes.join(" ")+'"'+A+">"+S.content+"</"+S.tag+">"};function c(v,w,b,_){v.lastIndex=w;var S=v.exec(b);if(S&&_&&S[1]){var x=S[1].length;S.index+=x,S[0]=S[0].slice(x)}return S}function f(v,w,b,_,S,x){for(var A in b)if(!(!b.hasOwnProperty(A)||!b[A])){var k=b[A];k=Array.isArray(k)?k:[k];for(var T=0;T<k.length;++T){if(x&&x.cause==A+","+T)return;var O=k[T],$=O.inside,L=!!O.lookbehind,M=!!O.greedy,z=O.alias;if(M&&!O.pattern.global){var P=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,P+"g")}for(var q=O.pattern||O,D=_.next,H=S;D!==w.tail&&!(x&&H>=x.reach);H+=D.value.length,D=D.next){var B=D.value;if(w.length>v.length)return;if(!(B instanceof l)){var G=1,K;if(M){if(K=c(q,H,v,L),!K||K.index>=v.length)break;var X=K.index,Q=K.index+K[0].length,R=H;for(R+=D.value.length;X>=R;)D=D.next,R+=D.value.length;if(R-=D.value.length,H=R,D.value instanceof l)continue;for(var V=D;V!==w.tail&&(R<Q||typeof V.value=="string");V=V.next)G++,R+=V.value.length;G--,B=v.slice(H,R),K.index-=H}else if(K=c(q,0,B,L),!K)continue;var X=K.index,j=K[0],I=B.slice(0,X),U=B.slice(X+j.length),Y=H+B.length;x&&Y>x.reach&&(x.reach=Y);var ne=D.prev;I&&(ne=h(w,ne,I),H+=I.length),m(w,ne,G);var ae=new l(A,$?o.tokenize(j,$):j,z,j);if(D=h(w,ne,ae),U&&h(w,D,U),G>1){var re={cause:A+","+T,reach:Y};f(v,w,b,D.prev,H,re),x&&re.reach>x.reach&&(x.reach=re.reach)}}}}}}function d(){var v={value:null,prev:null,next:null},w={value:null,prev:v,next:null};v.next=w,this.head=v,this.tail=w,this.length=0}function h(v,w,b){var _=w.next,S={value:b,prev:w,next:_};return w.next=S,_.prev=S,v.length++,S}function m(v,w,b){for(var _=w.next,S=0;S<b&&_!==v.tail;S++)_=_.next;w.next=_,_.prev=w,v.length-=S}function g(v){for(var w=[],b=v.head.next;b!==v.tail;)w.push(b.value),b=b.next;return w}return o}();t.exports=n,n.default=n}}),be=dK(hK());be.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},be.languages.markup.tag.inside["attr-value"].inside.entity=be.languages.markup.entity,be.languages.markup.doctype.inside["internal-subset"].inside=be.languages.markup,be.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(be.languages.markup.tag,"addInlined",{value:function(e,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:be.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:be.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},be.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(be.languages.markup.tag,"addAttribute",{value:function(e,t){be.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:be.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),be.languages.html=be.languages.markup,be.languages.mathml=be.languages.markup,be.languages.svg=be.languages.markup,be.languages.xml=be.languages.extend("markup",{}),be.languages.ssml=be.languages.xml,be.languages.atom=be.languages.xml,be.languages.rss=be.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(be),be.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},be.languages.javascript=be.languages.extend("clike",{"class-name":[be.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),be.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,be.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:be.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:be.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:be.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:be.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:be.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),be.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:be.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),be.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),be.languages.markup&&(be.languages.markup.tag.addInlined("script","javascript"),be.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),be.languages.js=be.languages.javascript,be.languages.actionscript=be.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),be.languages.actionscript["class-name"].alias="function",delete be.languages.actionscript.parameter,delete be.languages.actionscript["literal-property"],be.languages.markup&&be.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:be.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(be),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(i){var a=function(h){h.inside||(h.inside={}),h.inside.rest=r},o="doc-comment";if(l=e.languages[i]){var l,c=l[o];if((c=c||(l=e.languages.insertBefore(i,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[o])instanceof RegExp&&(c=l[o]={pattern:c}),Array.isArray(c))for(var f=0,d=c.length;f<d;f++)c[f]instanceof RegExp&&(c[f]={pattern:c[f]}),a(c[f]);else a(c)}})}}),t.addSupport(["java","javascript","php"],t)}(be),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(be),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(be),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(l,c){c=(c||"").replace(/m/g,"")+"m";var f=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return l});return RegExp(f,c)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(be),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(f){return f=f.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+f+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,o=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(f){["url","bold","italic","strike","code-snippet"].forEach(function(d){f!==d&&(e.languages.markdown[f].inside.content.inside[d]=e.languages.markdown[d])})}),e.hooks.add("after-tokenize",function(f){f.language!=="markdown"&&f.language!=="md"||function d(h){if(h&&typeof h!="string")for(var m=0,g=h.length;m<g;m++){var v,w=h[m];w.type!=="code"?d(w.content):(v=w.content[1],w=w.content[3],v&&w&&v.type==="code-language"&&w.type==="code-block"&&typeof v.content=="string"&&(v=v.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),v="language-"+(v=(/[a-z][\w-]*/i.exec(v)||[""])[0].toLowerCase()),w.alias?typeof w.alias=="string"?w.alias=[w.alias,v]:w.alias.push(v):w.alias=[v]))}}(f.tokens)}),e.hooks.add("wrap",function(f){if(f.type==="code-block"){for(var d="",h=0,m=f.classes.length;h<m;h++){var g=f.classes[h],g=/language-(.+)/.exec(g);if(g){d=g[1];break}}var v,w=e.languages[d];w?f.content=e.highlight(function(b){return b=b.replace(o,""),b=b.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(_,S){var x;return(S=S.toLowerCase())[0]==="#"?(x=S[1]==="x"?parseInt(S.slice(2),16):Number(S.slice(1)),c(x)):l[S]||_})}(f.content),w,d):d&&d!=="none"&&e.plugins.autoloader&&(v="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),f.attributes.id=v,e.plugins.autoloader.loadLanguages(d,function(){var b=document.getElementById(v);b&&(b.innerHTML=e.highlight(b.textContent,e.languages[d],d))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),l={amp:"&",lt:"<",gt:">",quot:'"'},c=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(be),be.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:be.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},be.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(v){return typeof v!="string"&&v.type!=="comment"&&v.type!=="scalar"}),n=0;n<t.length;){var r=t[n++];if(r.type==="keyword"&&r.content==="mutation"){var i=[];if(h(["definition-mutation","punctuation"])&&d(1).content==="("){n+=2;var a=m(/^\($/,/^\)$/);if(a===-1)continue;for(;n<a;n++){var o=d(0);o.type==="variable"&&(g(o,"variable-input"),i.push(o.content))}n=a+1}if(h(["punctuation","property-query"])&&d(0).content==="{"&&(n++,g(d(0),"property-mutation"),0<i.length)){var l=m(/^\{$/,/^\}$/);if(l!==-1)for(var c=n;c<l;c++){var f=t[c];f.type==="variable"&&0<=i.indexOf(f.content)&&g(f,"variable-input")}}}}function d(v){return t[n+v]}function h(v,w){w=w||0;for(var b=0;b<v.length;b++){var _=d(b+w);if(!_||_.type!==v[b])return}return 1}function m(v,w){for(var b=1,_=n;_<t.length;_++){var S=t[_],x=S.content;if(S.type==="punctuation"&&typeof x=="string"){if(v.test(x))b++;else if(w.test(x)&&--b===0)return _}}return-1}function g(v,w){var b=v.alias;b?Array.isArray(b)||(v.alias=b=[b]):v.alias=b=[],b.push(w)}}),be.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,i=r.inside["interpolation-punctuation"],a=r.pattern.source;function o(h,m){if(e.languages[h])return{pattern:RegExp("((?:"+m+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:h}}}}function l(h,m,g){return h={code:h,grammar:m,language:g},e.hooks.run("before-tokenize",h),h.tokens=e.tokenize(h.code,h.grammar),e.hooks.run("after-tokenize",h),h.tokens}function c(h,m,g){var b=e.tokenize(h,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),v=0,w={},b=l(b.map(function(S){if(typeof S=="string")return S;for(var x,A,S=S.content;h.indexOf((A=v++,x="___"+g.toUpperCase()+"_"+A+"___"))!==-1;);return w[x]=S,x}).join(""),m,g),_=Object.keys(w);return v=0,function S(x){for(var A=0;A<x.length;A++){if(v>=_.length)return;var k,T,O,$,L,M,z,P=x[A];typeof P=="string"||typeof P.content=="string"?(k=_[v],(z=(M=typeof P=="string"?P:P.content).indexOf(k))!==-1&&(++v,T=M.substring(0,z),L=w[k],O=void 0,($={})["interpolation-punctuation"]=i,($=e.tokenize(L,$)).length===3&&((O=[1,1]).push.apply(O,l($[1],e.languages.javascript,"javascript")),$.splice.apply($,O)),O=new e.Token("interpolation",$,r.alias,L),$=M.substring(z+k.length),L=[],T&&L.push(T),L.push(O),$&&(S(M=[$]),L.push.apply(L,M)),typeof P=="string"?(x.splice.apply(x,[A,1].concat(L)),A+=L.length-1):P.content=L)):(z=P.content,Array.isArray(z)?S(z):S([z]))}}(b),new e.Token(g,b,"language-"+g,h)}e.languages.javascript["template-string"]=[o("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),o("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),o("svg",/\bsvg/.source),o("markdown",/\b(?:markdown|md)/.source),o("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),o("sql",/\bsql/.source),t].filter(Boolean);var f={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function d(h){return typeof h=="string"?h:Array.isArray(h)?h.map(d).join(""):d(h.content)}e.hooks.add("after-tokenize",function(h){h.language in f&&function m(g){for(var v=0,w=g.length;v<w;v++){var b,_,S,x=g[v];typeof x!="string"&&(b=x.content,Array.isArray(b)?x.type==="template-string"?(x=b[1],b.length===3&&typeof x!="string"&&x.type==="embedded-code"&&(_=d(x),x=x.alias,x=Array.isArray(x)?x[0]:x,S=e.languages[x])&&(b[1]=c(_,S,x))):m(b):typeof b!="string"&&m([b]))}}(h.tokens)})}(be),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(be),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(be),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(be),be.languages.n4js=be.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),be.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),be.languages.n4jsd=be.languages.n4js,function(e){function t(o,l){return RegExp(o.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),l)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var a=n[r],i=e.languages.javascript[a],a=(i=e.util.type(i)==="RegExp"?e.languages.javascript[a]={pattern:i}:i).inside||{};(i.inside=a)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(be),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function a(c,f){return c=c.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(c,f)}i=a(i).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=a(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:a(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:a(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function o(c){for(var f=[],d=0;d<c.length;d++){var h=c[d],m=!1;typeof h!="string"&&(h.type==="tag"&&h.content[0]&&h.content[0].type==="tag"?h.content[0].content[0].content==="</"?0<f.length&&f[f.length-1].tagName===l(h.content[0].content[1])&&f.pop():h.content[h.content.length-1].content!=="/>"&&f.push({tagName:l(h.content[0].content[1]),openedBraces:0}):0<f.length&&h.type==="punctuation"&&h.content==="{"?f[f.length-1].openedBraces++:0<f.length&&0<f[f.length-1].openedBraces&&h.type==="punctuation"&&h.content==="}"?f[f.length-1].openedBraces--:m=!0),(m||typeof h=="string")&&0<f.length&&f[f.length-1].openedBraces===0&&(m=l(h),d<c.length-1&&(typeof c[d+1]=="string"||c[d+1].type==="plain-text")&&(m+=l(c[d+1]),c.splice(d+1,1)),0<d&&(typeof c[d-1]=="string"||c[d-1].type==="plain-text")&&(m=l(c[d-1])+m,c.splice(d-1,1),d--),c[d]=new e.Token("plain-text",m,null,m)),h.content&&typeof h.content!="string"&&o(h.content)}}var l=function(c){return c?typeof c=="string"?c:typeof c.content=="string"?c.content:c.content.map(l).join(""):""};e.hooks.add("after-tokenize",function(c){c.language!=="jsx"&&c.language!=="tsx"||o(c.tokens)})}(be),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(be),be.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},be.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=be.languages.swift}),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(be),be.languages.c=be.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),be.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),be.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},be.languages.c.string],char:be.languages.c.char,comment:be.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:be.languages.c}}}}),be.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete be.languages.c.boolean,be.languages.objectivec=be.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete be.languages.objectivec["class-name"],be.languages.objc=be.languages.objectivec,be.languages.reason=be.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),be.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete be.languages.reason.function,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(be),be.languages.go=be.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),be.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete be.languages.go["class-name"],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(be),be.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},be.languages.python["string-interpolation"].inside.interpolation.inside.rest=be.languages.python,be.languages.py=be.languages.python,be.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},be.languages.webmanifest=be.languages.json;var $5={};cK($5,{dracula:()=>mK,duotoneDark:()=>yK,duotoneLight:()=>vK,github:()=>xK,gruvboxMaterialDark:()=>XK,gruvboxMaterialLight:()=>QK,jettwaveDark:()=>BK,jettwaveLight:()=>VK,nightOwl:()=>SK,nightOwlLight:()=>kK,oceanicNext:()=>TK,okaidia:()=>OK,oneDark:()=>GK,oneLight:()=>ZK,palenight:()=>RK,shadesOfPurple:()=>MK,synthwave84:()=>DK,ultramin:()=>PK,vsDark:()=>D5,vsLight:()=>qK});var pK={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},mK=pK,gK={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},yK=gK,bK={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},vK=bK,_K={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},xK=_K,wK={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},SK=wK,EK={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},kK=EK,Xn={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},AK={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:Xn.keyword}},{types:["attr-value"],style:{color:Xn.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:Xn.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:Xn.primitive}},{types:["boolean"],style:{color:Xn.boolean}},{types:["tag"],style:{color:Xn.tag}},{types:["string"],style:{color:Xn.string}},{types:["punctuation"],style:{color:Xn.string}},{types:["selector","char","builtin","inserted"],style:{color:Xn.char}},{types:["function"],style:{color:Xn.function}},{types:["operator","entity","url","variable"],style:{color:Xn.variable}},{types:["keyword"],style:{color:Xn.keyword}},{types:["atrule","class-name"],style:{color:Xn.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},TK=AK,CK={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},OK=CK,NK={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},RK=NK,jK={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},MK=jK,$K={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},DK=$K,IK={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},PK=IK,LK={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},D5=LK,zK={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},qK=zK,FK={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},BK=FK,UK={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},VK=UK,HK={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},GK=HK,YK={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},ZK=YK,KK={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},XK=KK,WK={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},QK=WK,JK=e=>te.useCallback(t=>{var n=t,{className:r,style:i,line:a}=n,o=M5(n,["className","style","line"]);const l=kp(Xr({},o),{className:N5("token-line",r)});return typeof e=="object"&&"plain"in e&&(l.style=e.plain),typeof i=="object"&&(l.style=Xr(Xr({},l.style||{}),i)),l},[e]),eX=e=>{const t=te.useCallback(({types:n,empty:r})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return e[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(i=>e[i]))}},[e]);return te.useCallback(n=>{var r=n,{token:i,className:a,style:o}=r,l=M5(r,["token","className","style"]);const c=kp(Xr({},l),{className:N5("token",...i.types,a),children:i.content,style:t(i)});return o!=null&&(c.style=Xr(Xr({},c.style||{}),o)),c},[t])},tX=/\r\n|\r|\n/,yO=e=>{e.length===0?e.push({types:["plain"],content:`
|
|
104
|
+
`,parameters:[{name:"path",type:"string",description:"记忆路径(创建时需要)"},{name:"tags",type:"string[]",description:"记忆标签(创建或更新时需要)"},{name:"content",type:"string",description:"记忆内容(创建或更新时需要)"},{name:"action",type:"string",enum:["create","update","delete"],description:"操作类型:create(创建)、update(更新)、delete(删除)"},{name:"id",type:"string",description:"记忆ID(更新或删除时需要,创建时会自动生成)",required:!1},{name:"referencePath",type:"string",description:"引用文档的 URL",required:!1}],handler:async t=>{const{content:n,action:r,id:i,tags:a,path:o,referencePath:l}=t;if((r==="delete"||r==="update")&&!i)throw new Error("删除或更新记忆时必须提供记忆ID");if((r==="create"||r==="update")&&!n)throw new Error("创建或更新记忆时必须提供内容");try{if(r==="delete")return await e.delete(Number(i)),`已删除记忆 ${i}`;const c={text:n,content:AZ(n),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),namespace:kZ(),tags:a,path:o,type:"document",referencePath:l};return r==="create"?`已创建记忆 ${await e.insert(c)}`:(await e.update(Number(i),c),`已更新记忆 ${i}`)}catch(c){throw new Error(`记忆操作失败: ${c}`)}}}),searchMemory:GT({name:"search_memory",description:"搜索长期记忆中的相关信息,帮助维护对话上下文",parameters:[{name:"query",type:"string",description:"请使用中文关键词进行搜索"},{name:"tags",type:"string[]",description:"记忆标签",required:!1},{name:"path",type:"string",description:"记忆路径,memory://user_id/path/to/memory_name",required:!1},{name:"limit",type:"number",description:"返回结果的最大数量(默认10)",required:!1}],handler:async t=>{const{query:n,limit:r=10,tags:i,path:a}=t;if(!n||typeof n=="string"&&n.trim().length===0)throw new Error("搜索查询不能为空");try{const o=await e.query(n.toString(),{limit:r});return{query:n.toString(),results:o,total:o.length,limit:Number(r)}}catch(o){throw new Error(`搜索记忆失败: ${o}`)}}})}),yw=(e,t)=>t.some(n=>e instanceof n);let aO,sO;function CZ(){return aO||(aO=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function OZ(){return sO||(sO=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const bw=new WeakMap,c0=new WeakMap,Sp=new WeakMap;function NZ(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",a),e.removeEventListener("error",o)},a=()=>{n(ms(e.result)),i()},o=()=>{r(e.error),i()};e.addEventListener("success",a),e.addEventListener("error",o)});return Sp.set(t,e),t}function RZ(e){if(bw.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",o),e.removeEventListener("abort",o)},a=()=>{n(),i()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",a),e.addEventListener("error",o),e.addEventListener("abort",o)});bw.set(e,t)}let vw={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return bw.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ms(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function b5(e){vw=e(vw)}function jZ(e){return OZ().includes(e)?function(...t){return e.apply(_w(this),t),ms(this.request)}:function(...t){return ms(e.apply(_w(this),t))}}function MZ(e){return typeof e=="function"?jZ(e):(e instanceof IDBTransaction&&RZ(e),yw(e,CZ())?new Proxy(e,vw):e)}function ms(e){if(e instanceof IDBRequest)return NZ(e);if(c0.has(e))return c0.get(e);const t=MZ(e);return t!==e&&(c0.set(e,t),Sp.set(t,e)),t}const _w=e=>Sp.get(e);function $Z(e,t,{blocked:n,upgrade:r,blocking:i,terminated:a}={}){const o=indexedDB.open(e,t),l=ms(o);return r&&o.addEventListener("upgradeneeded",c=>{r(ms(o.result),c.oldVersion,c.newVersion,ms(o.transaction),c)}),n&&o.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),l.then(c=>{a&&c.addEventListener("close",()=>a()),i&&c.addEventListener("versionchange",f=>i(f.oldVersion,f.newVersion,f))}).catch(()=>{}),l}const DZ=["get","getKey","getAll","getAllKeys","count"],IZ=["put","add","delete","clear"],f0=new Map;function oO(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(f0.get(t))return f0.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=IZ.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||DZ.includes(n)))return;const a=async function(o,...l){const c=this.transaction(o,i?"readwrite":"readonly");let f=c.store;return r&&(f=f.index(l.shift())),(await Promise.all([f[n](...l),i&&c.done]))[0]};return f0.set(t,a),a}b5(e=>({...e,get:(t,n,r)=>oO(t,n)||e.get(t,n,r),has:(t,n)=>!!oO(t,n)||e.has(t,n)}));const PZ=["continue","continuePrimaryKey","advance"],lO={},xw=new WeakMap,v5=new WeakMap,LZ={get(e,t){if(!PZ.includes(t))return e[t];let n=lO[t];return n||(n=lO[t]=function(...r){xw.set(this,v5.get(this)[t](...r))}),n}};async function*zZ(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,LZ);for(v5.set(n,t),Sp.set(n,_w(t));t;)yield n,t=await(xw.get(n)||t.continue()),xw.delete(n)}function uO(e,t){return t===Symbol.asyncIterator&&yw(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&yw(e,[IDBIndex,IDBObjectStore])}b5(e=>({...e,get(t,n,r){return uO(t,n)?zZ:e.get(t,n,r)},has(t,n){return uO(t,n)||e.has(t,n)}}));class qZ{constructor(t){De(this,"isInitialized",!1);De(this,"config");this.config=t}}const FZ="ENTRIES",_5="KEYS",x5="VALUES",gn="";class d0{constructor(t,n){const r=t._tree,i=Array.from(r.keys());this.set=t,this._type=n,this._path=i.length>0?[{node:r,keys:i}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=Ao(this._path);if(Ao(n)===gn)return{done:!1,value:this.result()};const r=t.get(Ao(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=Ao(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>Ao(t)).filter(t=>t!==gn).join("")}value(){return Ao(this._path).node.get(gn)}result(){switch(this._type){case x5:return this.value();case _5:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const Ao=e=>e[e.length-1],BZ=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const i=t.length+1,a=i+n,o=new Uint8Array(a*i).fill(n+1);for(let l=0;l<i;++l)o[l]=l;for(let l=1;l<a;++l)o[l*i]=l;return w5(e,t,n,r,o,1,i,""),r},w5=(e,t,n,r,i,a,o,l)=>{const c=a*o;e:for(const f of e.keys())if(f===gn){const d=i[c-1];d<=n&&r.set(l,[e.get(f),d])}else{let d=a;for(let h=0;h<f.length;++h,++d){const m=f[h],g=o*d,v=g-o;let w=i[g];const b=Math.max(0,d-n-1),_=Math.min(o-1,d+n);for(let S=b;S<_;++S){const x=m!==t[S],A=i[v+S]+ +x,k=i[v+S+1]+1,T=i[g+S]+1,O=i[g+S+1]=Math.min(A,k,T);O<w&&(w=O)}if(w>n)continue e}w5(e.get(f),t,n,r,i,d,o,l+f)}};class Na{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Gh(this._tree,t.slice(this._prefix.length));if(n===void 0){const[i,a]=bS(r);for(const o of i.keys())if(o!==gn&&o.startsWith(a)){const l=new Map;return l.set(o.slice(a.length),i.get(o)),new Na(l,t)}}return new Na(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,UZ(this._tree,t)}entries(){return new d0(this,FZ)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return BZ(this._tree,t,n)}get(t){const n=ww(this._tree,t);return n!==void 0?n.get(gn):void 0}has(t){const n=ww(this._tree,t);return n!==void 0&&n.has(gn)}keys(){return new d0(this,_5)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,h0(this._tree,t).set(gn,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=h0(this._tree,t);return r.set(gn,n(r.get(gn))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=h0(this._tree,t);let i=r.get(gn);return i===void 0&&r.set(gn,i=n()),i}values(){return new d0(this,x5)}[Symbol.iterator](){return this.entries()}static from(t){const n=new Na;for(const[r,i]of t)n.set(r,i);return n}static fromObject(t){return Na.from(Object.entries(t))}}const Gh=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==gn&&t.startsWith(r))return n.push([e,r]),Gh(e.get(r),t.slice(r.length),n);return n.push([e,t]),Gh(void 0,"",n)},ww=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==gn&&t.startsWith(n))return ww(e.get(n),t.slice(n.length))},h0=(e,t)=>{const n=t.length;e:for(let r=0;e&&r<n;){for(const a of e.keys())if(a!==gn&&t[r]===a[0]){const o=Math.min(n-r,a.length);let l=1;for(;l<o&&t[r+l]===a[l];)++l;const c=e.get(a);if(l===a.length)e=c;else{const f=new Map;f.set(a.slice(l),c),e.set(t.slice(r,r+l),f),e.delete(a),e=f}r+=l;continue e}const i=new Map;return e.set(t.slice(r),i),i}return e},UZ=(e,t)=>{const[n,r]=Gh(e,t);if(n!==void 0){if(n.delete(gn),n.size===0)S5(r);else if(n.size===1){const[i,a]=n.entries().next().value;E5(r,i,a)}}},S5=e=>{if(e.length===0)return;const[t,n]=bS(e);if(t.delete(n),t.size===0)S5(e.slice(0,-1));else if(t.size===1){const[r,i]=t.entries().next().value;r!==gn&&E5(e.slice(0,-1),r,i)}},E5=(e,t,n)=>{if(e.length===0)return;const[r,i]=bS(e);r.set(i+t,n),r.delete(i)},bS=e=>e[e.length-1],vS="or",k5="and",VZ="and_not";class gs{constructor(t){if((t==null?void 0:t.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const n=t.autoVacuum==null||t.autoVacuum===!0?g0:t.autoVacuum;this._options={...m0,...t,autoVacuum:n,searchOptions:{...cO,...t.searchOptions||{}},autoSuggestOptions:{...KZ,...t.autoSuggestOptions||{}}},this._index=new Na,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Ew,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:i,fields:a,idField:o}=this._options,l=n(t,o);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);if(this._idToShortId.has(l))throw new Error(`MiniSearch: duplicate ID ${l}`);const c=this.addDocumentId(l);this.saveStoredFields(c,t);for(const f of a){const d=n(t,f);if(d==null)continue;const h=r(d.toString(),f),m=this._fieldIds[f],g=new Set(h).size;this.addFieldLength(c,m,this._documentCount-1,g);for(const v of h){const w=i(v,f);if(Array.isArray(w))for(const b of w)this.addTerm(m,c,b);else w&&this.addTerm(m,c,w)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,i={chunk:[],promise:Promise.resolve()},{chunk:a,promise:o}=t.reduce(({chunk:l,promise:c},f,d)=>(l.push(f),(d+1)%r===0?{chunk:[],promise:c.then(()=>new Promise(h=>setTimeout(h,0))).then(()=>this.addAll(l))}:{chunk:l,promise:c}),i);return o.then(()=>this.addAll(a))}remove(t){const{tokenize:n,processTerm:r,extractField:i,fields:a,idField:o}=this._options,l=i(t,o);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);const c=this._idToShortId.get(l);if(c==null)throw new Error(`MiniSearch: cannot remove document with ID ${l}: it is not in the index`);for(const f of a){const d=i(t,f);if(d==null)continue;const h=n(d.toString(),f),m=this._fieldIds[f],g=new Set(h).size;this.removeFieldLength(c,m,this._documentCount,g);for(const v of h){const w=r(v,f);if(Array.isArray(w))for(const b of w)this.removeTerm(m,c,b);else w&&this.removeTerm(m,c,w)}}this._storedFields.delete(c),this._documentIds.delete(c),this._idToShortId.delete(l),this._fieldLength.delete(c),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Na,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,i)=>{this.removeFieldLength(n,i,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:i},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,i=r(t,n);this.discard(i),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Ew,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const i=t.batchSize||Sw.batchSize,a=t.batchWait||Sw.batchWait;let o=1;for(const[l,c]of this._index){for(const[f,d]of c)for(const[h]of d)this._documentIds.has(h)||(d.size<=1?c.delete(f):d.delete(h));this._index.get(l).size===0&&this._index.delete(l),o%i===0&&await new Promise(f=>setTimeout(f,a)),o+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||g0.minDirtCount,r=r||g0.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,i={...r,...n},a=this.executeQuery(t,n),o=[];for(const[l,{score:c,terms:f,match:d}]of a){const h=f.length||1,m={id:this._documentIds.get(l),score:c*h,terms:Object.keys(d),queryTerms:f,match:d};Object.assign(m,this._storedFields.get(l)),(i.filter==null||i.filter(m))&&o.push(m)}return t===gs.wildcard&&i.boostDocument==null||o.sort(dO),o}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:a,terms:o}of this.search(t,n)){const l=o.join(" "),c=r.get(l);c!=null?(c.score+=a,c.count+=1):r.set(l,{score:a,terms:o,count:1})}const i=[];for(const[a,{score:o,terms:l,count:c}]of r)i.push({suggestion:a,terms:l,score:o/c});return i.sort(dO),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),n)}static getDefault(t){if(m0.hasOwnProperty(t))return p0(m0,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:i,fieldLength:a,storedFields:o,serializationVersion:l}=t,c=this.instantiateMiniSearch(t,n);c._documentIds=xd(i),c._fieldLength=xd(a),c._storedFields=xd(o);for(const[f,d]of c._documentIds)c._idToShortId.set(d,f);for(const[f,d]of r){const h=new Map;for(const m of Object.keys(d)){let g=d[m];l===1&&(g=g.ds),h.set(parseInt(m,10),xd(g))}c._index.set(f,h)}return c}static async loadJSAsync(t,n){const{index:r,documentIds:i,fieldLength:a,storedFields:o,serializationVersion:l}=t,c=this.instantiateMiniSearch(t,n);c._documentIds=await wd(i),c._fieldLength=await wd(a),c._storedFields=await wd(o);for(const[d,h]of c._documentIds)c._idToShortId.set(h,d);let f=0;for(const[d,h]of r){const m=new Map;for(const g of Object.keys(h)){let v=h[g];l===1&&(v=v.ds),m.set(parseInt(g,10),await wd(v))}++f%1e3===0&&await A5(0),c._index.set(d,m)}return c}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:i,fieldIds:a,averageFieldLength:o,dirtCount:l,serializationVersion:c}=t;if(c!==1&&c!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const f=new gs(n);return f._documentCount=r,f._nextId=i,f._idToShortId=new Map,f._fieldIds=a,f._avgFieldLength=o,f._dirtCount=l||0,f._index=new Na,f}executeQuery(t,n={}){if(t===gs.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const m={...n,...t,queries:void 0},g=t.queries.map(v=>this.executeQuery(v,m));return this.combineResults(g,m.combineWith)}const{tokenize:r,processTerm:i,searchOptions:a}=this._options,o={tokenize:r,processTerm:i,...a,...n},{tokenize:l,processTerm:c}=o,h=l(t).flatMap(m=>c(m)).filter(m=>!!m).map(ZZ(o)).map(m=>this.executeQuerySpec(m,o));return this.combineResults(h,o.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},i=(r.fields||this._options.fields).reduce((w,b)=>({...w,[b]:p0(r.boost,b)||1}),{}),{boostDocument:a,weights:o,maxFuzzy:l,bm25:c}=r,{fuzzy:f,prefix:d}={...cO.weights,...o},h=this._index.get(t.term),m=this.termResults(t.term,t.term,1,t.termBoost,h,i,a,c);let g,v;if(t.prefix&&(g=this._index.atPrefix(t.term)),t.fuzzy){const w=t.fuzzy===!0?.2:t.fuzzy,b=w<1?Math.min(l,Math.round(t.term.length*w)):w;b&&(v=this._index.fuzzyGet(t.term,b))}if(g)for(const[w,b]of g){const _=w.length-t.term.length;if(!_)continue;v==null||v.delete(w);const S=d*w.length/(w.length+.3*_);this.termResults(t.term,w,S,t.termBoost,b,i,a,c,m)}if(v)for(const w of v.keys()){const[b,_]=v.get(w);if(!_)continue;const S=f*w.length/(w.length+_);this.termResults(t.term,w,S,t.termBoost,b,i,a,c,m)}return m}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[i,a]of this._documentIds){const o=r.boostDocument?r.boostDocument(a,"",this._storedFields.get(i)):1;n.set(i,{score:o,terms:[],match:{}})}return n}combineResults(t,n=vS){if(t.length===0)return new Map;const r=n.toLowerCase(),i=HZ[r];if(!i)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(i)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const i={};for(const[a,o]of r)i[a]=Object.fromEntries(o);t.push([n,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,i,a,o,l,c,f=new Map){if(a==null)return f;for(const d of Object.keys(o)){const h=o[d],m=this._fieldIds[d],g=a.get(m);if(g==null)continue;let v=g.size;const w=this._avgFieldLength[m];for(const b of g.keys()){if(!this._documentIds.has(b)){this.removeTerm(m,b,n),v-=1;continue}const _=l?l(this._documentIds.get(b),n,this._storedFields.get(b)):1;if(!_)continue;const S=g.get(b),x=this._fieldLength.get(b)[m],A=YZ(S,v,this._documentCount,x,w,c),k=r*i*h*_*A,T=f.get(b);if(T){T.score+=k,XZ(T.terms,t);const O=p0(T.match,n);O?O.push(d):T.match[n]=[d]}else f.set(b,{score:k,terms:[t],match:{[n]:[d]}})}}return f}addTerm(t,n,r){const i=this._index.fetch(r,hO);let a=i.get(t);if(a==null)a=new Map,a.set(n,1),i.set(t,a);else{const o=a.get(n);a.set(n,(o||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const i=this._index.fetch(r,hO),a=i.get(t);a==null||a.get(n)==null?this.warnDocumentChanged(n,t,r):a.get(n)<=1?a.size<=1?i.delete(t):a.delete(n):a.set(n,a.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const i of Object.keys(this._fieldIds))if(this._fieldIds[i]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;n<t.length;n++)this._fieldIds[t[n]]=n}addFieldLength(t,n,r,i){let a=this._fieldLength.get(t);a==null&&this._fieldLength.set(t,a=[]),a[n]=i;const l=(this._avgFieldLength[n]||0)*r+i;this._avgFieldLength[n]=l/(r+1)}removeFieldLength(t,n,r,i){if(r===1){this._avgFieldLength[n]=0;return}const a=this._avgFieldLength[n]*r-i;this._avgFieldLength[n]=a/(r-1)}saveStoredFields(t,n){const{storeFields:r,extractField:i}=this._options;if(r==null||r.length===0)return;let a=this._storedFields.get(t);a==null&&this._storedFields.set(t,a={});for(const o of r){const l=i(n,o);l!==void 0&&(a[o]=l)}}}gs.wildcard=Symbol("*");const p0=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,HZ={[vS]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:i,terms:a,match:o}=t.get(n);r.score=r.score+i,r.match=Object.assign(r.match,o),fO(r.terms,a)}}return e},[k5]:(e,t)=>{const n=new Map;for(const r of t.keys()){const i=e.get(r);if(i==null)continue;const{score:a,terms:o,match:l}=t.get(r);fO(i.terms,o),n.set(r,{score:i.score+a,terms:i.terms,match:Object.assign(i.match,l)})}return n},[VZ]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},GZ={k:1.2,b:.7,d:.5},YZ=(e,t,n,r,i,a)=>{const{k:o,b:l,d:c}=a;return Math.log(1+(n-t+.5)/(t+.5))*(c+e*(o+1)/(e+o*(1-l+l*r/i)))},ZZ=e=>(t,n,r)=>{const i=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,a=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,o=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:i,prefix:a,termBoost:o}},m0={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(WZ),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])=="function"&&console[e](t)},autoVacuum:!0},cO={combineWith:vS,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:GZ},KZ={combineWith:k5,prefix:(e,t,n)=>t===n.length-1},Sw={batchSize:1e3,batchWait:10},Ew={minDirtFactor:.1,minDirtCount:20},g0={...Sw,...Ew},XZ=(e,t)=>{e.includes(t)||e.push(t)},fO=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},dO=({score:e},{score:t})=>t-e,hO=()=>new Map,xd=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},wd=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await A5(0);return t},A5=e=>new Promise(t=>setTimeout(t,e)),WZ=/[\n\r\p{Z}\p{P}]+/u,pO={dbName:"minisearch_memory_db",dbVersion:1,storeName:"memory",miniSearchOptions:{fields:["text","path","tags","referencePath"],storeFields:["text","path","tags","referencePath"],tokenize:T5}};function T5(e){const t=e.replace(/ /g,""),n=new Intl.Segmenter("zh-CN",{granularity:"word"});return Array.from(n.segment(t)).map(i=>i.segment)}class QZ extends qZ{constructor(n){const r={...pO,...n,miniSearchOptions:{...pO.miniSearchOptions,...(n==null?void 0:n.miniSearchOptions)||{}}};super(r);De(this,"miniSearch");De(this,"config");De(this,"db");this.config=r}async initialize(){if(this.isInitialized)return;const{storeName:n}=this.config;this.db=await $Z(this.config.dbName,this.config.dbVersion,{upgrade(i){i.objectStoreNames.contains(n)||i.createObjectStore(n,{keyPath:"id",autoIncrement:!0}),i.objectStoreNames.contains("minisearch_index")||i.createObjectStore("minisearch_index")}});const r={fields:this.config.miniSearchOptions.fields||["text"],storeFields:this.config.miniSearchOptions.storeFields||["text"],tokenize:this.config.miniSearchOptions.tokenize||T5};this.miniSearch=new gs(r);try{const i=await this.loadMiniSearchIndex();if(i)console.log(i),this.miniSearch=await gs.loadJSAsync(i,r),console.log("MiniSearch index loaded from IndexedDB.");else{console.log("No saved index found, building from documents...");const a=await this.getAll();a.length>0?(this.miniSearch.addAll(a),await this.saveMiniSearchIndex(this.miniSearch.toJSON()),console.log(`MiniSearch index built from ${a.length} documents and saved.`)):console.log("No documents found, index is empty.")}this.isInitialized=!0}catch(i){throw console.error("Failed to initialize FullTextSearchService:",i),i}}async insert(n){const r=this.db.transaction(this.config.storeName,"readwrite"),i=r.objectStore(this.config.storeName),a={...n},o=await i.add(a);return a.id=Number(o),await r.done,this.miniSearch.add(a),await this.saveMiniSearchIndex(this.miniSearch.toJSON()),a.id}async update(n,r){const a=this.db.transaction(this.config.storeName,"readwrite").objectStore(this.config.storeName),o={...r,id:n};await a.put(o);const l=await a.get(n);l&&this.miniSearch.remove(l),this.miniSearch.add(o),await this.saveMiniSearchIndex(this.miniSearch.toJSON())}async delete(n){const i=this.db.transaction(this.config.storeName,"readwrite").objectStore(this.config.storeName),a=await i.get(n);a&&this.miniSearch.remove(a),await i.delete(n),await this.saveMiniSearchIndex(this.miniSearch.toJSON())}async query(n,r){return this.miniSearch.search(n,r).slice(0,(r==null?void 0:r.limit)??5).map(a=>{const{id:o,text:l,...c}=a;return{id:o,text:l,tags:c.tags,path:c.path,type:c.type,score:Math.round(a.score),referencePath:c.referencePath}})}async get(n){return this.db.transaction(this.config.storeName,"readonly").objectStore(this.config.storeName).get(n)}async getAll(){return this.db.transaction(this.config.storeName,"readonly").objectStore(this.config.storeName).getAll()}async loadMiniSearchIndex(){return this.db.transaction("minisearch_index","readonly").objectStore("minisearch_index").get("indexData")}async saveMiniSearchIndex(n){const r=this.db.transaction("minisearch_index","readwrite");await r.objectStore("minisearch_index").put(n,"indexData"),await r.done}}const JZ=localStorage.getItem("withCredentials")==="true"?(e,t)=>(t.credentials="include",fetch(e,t)):fetch,eK=()=>({showHistory:localStorage.getItem("showHistory")==="true"||!1,showGraph:localStorage.getItem("showGraph")==="true"||!1}),mO=e=>{Object.entries(e).forEach(([t,n])=>{localStorage.setItem(t,n.toString())})},_S=new QZ({dbName:"memory_fulltext_db",dbVersion:1,storeName:"memory"});_S.initialize();console.log(_S);TZ(_S);const tK=JSON.parse(localStorage.getItem("code")||"{}"),nK=t7(localStorage.getItem("agent_name")||"",{apiUrl:localStorage.getItem("apiUrl")||"http://localhost:8123",defaultHeaders:tK,callerOptions:{fetch:JZ}},{...eK()});let y0=(e,t)=>n=>{e.current!==n&&(e.current=n,t())};function rK(e,{keys:t,deps:n=[e,t]}={}){let r=te.useRef();r.current=e.get();let i=te.useCallback(o=>(y0(r,o)(e.value),(t==null?void 0:t.length)>0?GF(e,t,y0(r,o)):e.listen(y0(r,o))),n),a=()=>r.current;return te.useSyncExternalStore(i,a,a)}const C5=te.createContext(void 0),Ts=()=>{const e=te.useContext(C5);if(!e)throw new Error("useChat must be used within a ChatProvider");return e},iK=({children:e})=>{const t=tB(nK,rK);return te.useEffect(()=>{t.initClient().then(n=>{t.showHistory&&t.refreshHistoryList(),console.log(n)}).catch(n=>{console.error(n);const r=prompt("Failed to initialize chat client: "+t.currentAgent+`
|
|
105
|
+
请输入 agent 名称`);localStorage.setItem("agent_name",r),location.reload()})},[]),N.jsx(C5.Provider,{value:t,children:e})};function O5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=O5(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function N5(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=O5(e))&&(r&&(r+=" "),r+=t);return r}var aK=Object.create,Ep=Object.defineProperty,sK=Object.defineProperties,oK=Object.getOwnPropertyDescriptor,lK=Object.getOwnPropertyDescriptors,R5=Object.getOwnPropertyNames,Yh=Object.getOwnPropertySymbols,uK=Object.getPrototypeOf,xS=Object.prototype.hasOwnProperty,j5=Object.prototype.propertyIsEnumerable,gO=(e,t,n)=>t in e?Ep(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xr=(e,t)=>{for(var n in t||(t={}))xS.call(t,n)&&gO(e,n,t[n]);if(Yh)for(var n of Yh(t))j5.call(t,n)&&gO(e,n,t[n]);return e},kp=(e,t)=>sK(e,lK(t)),M5=(e,t)=>{var n={};for(var r in e)xS.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Yh)for(var r of Yh(e))t.indexOf(r)<0&&j5.call(e,r)&&(n[r]=e[r]);return n},cK=(e,t)=>function(){return t||(0,e[R5(e)[0]])((t={exports:{}}).exports,t),t.exports},fK=(e,t)=>{for(var n in t)Ep(e,n,{get:t[n],enumerable:!0})},dK=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of R5(t))!xS.call(e,i)&&i!==n&&Ep(e,i,{get:()=>t[i],enumerable:!(r=oK(t,i))||r.enumerable});return e},hK=(e,t,n)=>(n=e!=null?aK(uK(e)):{},dK(!e||!e.__esModule?Ep(n,"default",{value:e,enumerable:!0}):n,e)),pK=cK({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,a={},o={util:{encode:function v(w){return w instanceof l?new l(w.type,v(w.content),w.alias):Array.isArray(w)?w.map(v):w.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(v){return Object.prototype.toString.call(v).slice(8,-1)},objId:function(v){return v.__id||Object.defineProperty(v,"__id",{value:++i}),v.__id},clone:function v(w,b){b=b||{};var _,S;switch(o.util.type(w)){case"Object":if(S=o.util.objId(w),b[S])return b[S];_={},b[S]=_;for(var x in w)w.hasOwnProperty(x)&&(_[x]=v(w[x],b));return _;case"Array":return S=o.util.objId(w),b[S]?b[S]:(_=[],b[S]=_,w.forEach(function(A,k){_[k]=v(A,b)}),_);default:return w}},getLanguage:function(v){for(;v;){var w=r.exec(v.className);if(w)return w[1].toLowerCase();v=v.parentElement}return"none"},setLanguage:function(v,w){v.className=v.className.replace(RegExp(r,"gi"),""),v.classList.add("language-"+w)},isActive:function(v,w,b){for(var _="no-"+w;v;){var S=v.classList;if(S.contains(w))return!0;if(S.contains(_))return!1;v=v.parentElement}return!!b}},languages:{plain:a,plaintext:a,text:a,txt:a,extend:function(v,w){var b=o.util.clone(o.languages[v]);for(var _ in w)b[_]=w[_];return b},insertBefore:function(v,w,b,_){_=_||o.languages;var S=_[v],x={};for(var A in S)if(S.hasOwnProperty(A)){if(A==w)for(var k in b)b.hasOwnProperty(k)&&(x[k]=b[k]);b.hasOwnProperty(A)||(x[A]=S[A])}var T=_[v];return _[v]=x,o.languages.DFS(o.languages,function(O,$){$===T&&O!=v&&(this[O]=x)}),x},DFS:function v(w,b,_,S){S=S||{};var x=o.util.objId;for(var A in w)if(w.hasOwnProperty(A)){b.call(w,A,w[A],_||A);var k=w[A],T=o.util.type(k);T==="Object"&&!S[x(k)]?(S[x(k)]=!0,v(k,b,null,S)):T==="Array"&&!S[x(k)]&&(S[x(k)]=!0,v(k,b,A,S))}}},plugins:{},highlight:function(v,w,b){var _={code:v,grammar:w,language:b};if(o.hooks.run("before-tokenize",_),!_.grammar)throw new Error('The language "'+_.language+'" has no grammar.');return _.tokens=o.tokenize(_.code,_.grammar),o.hooks.run("after-tokenize",_),l.stringify(o.util.encode(_.tokens),_.language)},tokenize:function(v,w){var b=w.rest;if(b){for(var _ in b)w[_]=b[_];delete w.rest}var S=new d;return h(S,S.head,v),f(v,S,w,S.head,0),g(S)},hooks:{all:{},add:function(v,w){var b=o.hooks.all;b[v]=b[v]||[],b[v].push(w)},run:function(v,w){var b=o.hooks.all[v];if(!(!b||!b.length))for(var _=0,S;S=b[_++];)S(w)}},Token:l};function l(v,w,b,_){this.type=v,this.content=w,this.alias=b,this.length=(_||"").length|0}l.stringify=function v(w,b){if(typeof w=="string")return w;if(Array.isArray(w)){var _="";return w.forEach(function(T){_+=v(T,b)}),_}var S={type:w.type,content:v(w.content,b),tag:"span",classes:["token",w.type],attributes:{},language:b},x=w.alias;x&&(Array.isArray(x)?Array.prototype.push.apply(S.classes,x):S.classes.push(x)),o.hooks.run("wrap",S);var A="";for(var k in S.attributes)A+=" "+k+'="'+(S.attributes[k]||"").replace(/"/g,""")+'"';return"<"+S.tag+' class="'+S.classes.join(" ")+'"'+A+">"+S.content+"</"+S.tag+">"};function c(v,w,b,_){v.lastIndex=w;var S=v.exec(b);if(S&&_&&S[1]){var x=S[1].length;S.index+=x,S[0]=S[0].slice(x)}return S}function f(v,w,b,_,S,x){for(var A in b)if(!(!b.hasOwnProperty(A)||!b[A])){var k=b[A];k=Array.isArray(k)?k:[k];for(var T=0;T<k.length;++T){if(x&&x.cause==A+","+T)return;var O=k[T],$=O.inside,L=!!O.lookbehind,M=!!O.greedy,z=O.alias;if(M&&!O.pattern.global){var P=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,P+"g")}for(var q=O.pattern||O,D=_.next,H=S;D!==w.tail&&!(x&&H>=x.reach);H+=D.value.length,D=D.next){var B=D.value;if(w.length>v.length)return;if(!(B instanceof l)){var G=1,K;if(M){if(K=c(q,H,v,L),!K||K.index>=v.length)break;var X=K.index,Q=K.index+K[0].length,R=H;for(R+=D.value.length;X>=R;)D=D.next,R+=D.value.length;if(R-=D.value.length,H=R,D.value instanceof l)continue;for(var V=D;V!==w.tail&&(R<Q||typeof V.value=="string");V=V.next)G++,R+=V.value.length;G--,B=v.slice(H,R),K.index-=H}else if(K=c(q,0,B,L),!K)continue;var X=K.index,j=K[0],I=B.slice(0,X),U=B.slice(X+j.length),Y=H+B.length;x&&Y>x.reach&&(x.reach=Y);var ne=D.prev;I&&(ne=h(w,ne,I),H+=I.length),m(w,ne,G);var ae=new l(A,$?o.tokenize(j,$):j,z,j);if(D=h(w,ne,ae),U&&h(w,D,U),G>1){var re={cause:A+","+T,reach:Y};f(v,w,b,D.prev,H,re),x&&re.reach>x.reach&&(x.reach=re.reach)}}}}}}function d(){var v={value:null,prev:null,next:null},w={value:null,prev:v,next:null};v.next=w,this.head=v,this.tail=w,this.length=0}function h(v,w,b){var _=w.next,S={value:b,prev:w,next:_};return w.next=S,_.prev=S,v.length++,S}function m(v,w,b){for(var _=w.next,S=0;S<b&&_!==v.tail;S++)_=_.next;w.next=_,_.prev=w,v.length-=S}function g(v){for(var w=[],b=v.head.next;b!==v.tail;)w.push(b.value),b=b.next;return w}return o}();t.exports=n,n.default=n}}),be=hK(pK());be.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},be.languages.markup.tag.inside["attr-value"].inside.entity=be.languages.markup.entity,be.languages.markup.doctype.inside["internal-subset"].inside=be.languages.markup,be.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(be.languages.markup.tag,"addInlined",{value:function(e,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:be.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:be.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},be.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(be.languages.markup.tag,"addAttribute",{value:function(e,t){be.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:be.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),be.languages.html=be.languages.markup,be.languages.mathml=be.languages.markup,be.languages.svg=be.languages.markup,be.languages.xml=be.languages.extend("markup",{}),be.languages.ssml=be.languages.xml,be.languages.atom=be.languages.xml,be.languages.rss=be.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(be),be.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},be.languages.javascript=be.languages.extend("clike",{"class-name":[be.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),be.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,be.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:be.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:be.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:be.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:be.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:be.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),be.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:be.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),be.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),be.languages.markup&&(be.languages.markup.tag.addInlined("script","javascript"),be.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),be.languages.js=be.languages.javascript,be.languages.actionscript=be.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),be.languages.actionscript["class-name"].alias="function",delete be.languages.actionscript.parameter,delete be.languages.actionscript["literal-property"],be.languages.markup&&be.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:be.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(be),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(i){var a=function(h){h.inside||(h.inside={}),h.inside.rest=r},o="doc-comment";if(l=e.languages[i]){var l,c=l[o];if((c=c||(l=e.languages.insertBefore(i,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[o])instanceof RegExp&&(c=l[o]={pattern:c}),Array.isArray(c))for(var f=0,d=c.length;f<d;f++)c[f]instanceof RegExp&&(c[f]={pattern:c[f]}),a(c[f]);else a(c)}})}}),t.addSupport(["java","javascript","php"],t)}(be),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(be),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(be),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(l,c){c=(c||"").replace(/m/g,"")+"m";var f=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return l});return RegExp(f,c)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(be),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(f){return f=f.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+f+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,o=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(f){["url","bold","italic","strike","code-snippet"].forEach(function(d){f!==d&&(e.languages.markdown[f].inside.content.inside[d]=e.languages.markdown[d])})}),e.hooks.add("after-tokenize",function(f){f.language!=="markdown"&&f.language!=="md"||function d(h){if(h&&typeof h!="string")for(var m=0,g=h.length;m<g;m++){var v,w=h[m];w.type!=="code"?d(w.content):(v=w.content[1],w=w.content[3],v&&w&&v.type==="code-language"&&w.type==="code-block"&&typeof v.content=="string"&&(v=v.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),v="language-"+(v=(/[a-z][\w-]*/i.exec(v)||[""])[0].toLowerCase()),w.alias?typeof w.alias=="string"?w.alias=[w.alias,v]:w.alias.push(v):w.alias=[v]))}}(f.tokens)}),e.hooks.add("wrap",function(f){if(f.type==="code-block"){for(var d="",h=0,m=f.classes.length;h<m;h++){var g=f.classes[h],g=/language-(.+)/.exec(g);if(g){d=g[1];break}}var v,w=e.languages[d];w?f.content=e.highlight(function(b){return b=b.replace(o,""),b=b.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(_,S){var x;return(S=S.toLowerCase())[0]==="#"?(x=S[1]==="x"?parseInt(S.slice(2),16):Number(S.slice(1)),c(x)):l[S]||_})}(f.content),w,d):d&&d!=="none"&&e.plugins.autoloader&&(v="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),f.attributes.id=v,e.plugins.autoloader.loadLanguages(d,function(){var b=document.getElementById(v);b&&(b.innerHTML=e.highlight(b.textContent,e.languages[d],d))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),l={amp:"&",lt:"<",gt:">",quot:'"'},c=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(be),be.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:be.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},be.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(v){return typeof v!="string"&&v.type!=="comment"&&v.type!=="scalar"}),n=0;n<t.length;){var r=t[n++];if(r.type==="keyword"&&r.content==="mutation"){var i=[];if(h(["definition-mutation","punctuation"])&&d(1).content==="("){n+=2;var a=m(/^\($/,/^\)$/);if(a===-1)continue;for(;n<a;n++){var o=d(0);o.type==="variable"&&(g(o,"variable-input"),i.push(o.content))}n=a+1}if(h(["punctuation","property-query"])&&d(0).content==="{"&&(n++,g(d(0),"property-mutation"),0<i.length)){var l=m(/^\{$/,/^\}$/);if(l!==-1)for(var c=n;c<l;c++){var f=t[c];f.type==="variable"&&0<=i.indexOf(f.content)&&g(f,"variable-input")}}}}function d(v){return t[n+v]}function h(v,w){w=w||0;for(var b=0;b<v.length;b++){var _=d(b+w);if(!_||_.type!==v[b])return}return 1}function m(v,w){for(var b=1,_=n;_<t.length;_++){var S=t[_],x=S.content;if(S.type==="punctuation"&&typeof x=="string"){if(v.test(x))b++;else if(w.test(x)&&--b===0)return _}}return-1}function g(v,w){var b=v.alias;b?Array.isArray(b)||(v.alias=b=[b]):v.alias=b=[],b.push(w)}}),be.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,i=r.inside["interpolation-punctuation"],a=r.pattern.source;function o(h,m){if(e.languages[h])return{pattern:RegExp("((?:"+m+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:h}}}}function l(h,m,g){return h={code:h,grammar:m,language:g},e.hooks.run("before-tokenize",h),h.tokens=e.tokenize(h.code,h.grammar),e.hooks.run("after-tokenize",h),h.tokens}function c(h,m,g){var b=e.tokenize(h,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),v=0,w={},b=l(b.map(function(S){if(typeof S=="string")return S;for(var x,A,S=S.content;h.indexOf((A=v++,x="___"+g.toUpperCase()+"_"+A+"___"))!==-1;);return w[x]=S,x}).join(""),m,g),_=Object.keys(w);return v=0,function S(x){for(var A=0;A<x.length;A++){if(v>=_.length)return;var k,T,O,$,L,M,z,P=x[A];typeof P=="string"||typeof P.content=="string"?(k=_[v],(z=(M=typeof P=="string"?P:P.content).indexOf(k))!==-1&&(++v,T=M.substring(0,z),L=w[k],O=void 0,($={})["interpolation-punctuation"]=i,($=e.tokenize(L,$)).length===3&&((O=[1,1]).push.apply(O,l($[1],e.languages.javascript,"javascript")),$.splice.apply($,O)),O=new e.Token("interpolation",$,r.alias,L),$=M.substring(z+k.length),L=[],T&&L.push(T),L.push(O),$&&(S(M=[$]),L.push.apply(L,M)),typeof P=="string"?(x.splice.apply(x,[A,1].concat(L)),A+=L.length-1):P.content=L)):(z=P.content,Array.isArray(z)?S(z):S([z]))}}(b),new e.Token(g,b,"language-"+g,h)}e.languages.javascript["template-string"]=[o("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),o("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),o("svg",/\bsvg/.source),o("markdown",/\b(?:markdown|md)/.source),o("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),o("sql",/\bsql/.source),t].filter(Boolean);var f={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function d(h){return typeof h=="string"?h:Array.isArray(h)?h.map(d).join(""):d(h.content)}e.hooks.add("after-tokenize",function(h){h.language in f&&function m(g){for(var v=0,w=g.length;v<w;v++){var b,_,S,x=g[v];typeof x!="string"&&(b=x.content,Array.isArray(b)?x.type==="template-string"?(x=b[1],b.length===3&&typeof x!="string"&&x.type==="embedded-code"&&(_=d(x),x=x.alias,x=Array.isArray(x)?x[0]:x,S=e.languages[x])&&(b[1]=c(_,S,x))):m(b):typeof b!="string"&&m([b]))}}(h.tokens)})}(be),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(be),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(be),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(be),be.languages.n4js=be.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),be.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),be.languages.n4jsd=be.languages.n4js,function(e){function t(o,l){return RegExp(o.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),l)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var a=n[r],i=e.languages.javascript[a],a=(i=e.util.type(i)==="RegExp"?e.languages.javascript[a]={pattern:i}:i).inside||{};(i.inside=a)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(be),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function a(c,f){return c=c.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(c,f)}i=a(i).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=a(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:a(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:a(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function o(c){for(var f=[],d=0;d<c.length;d++){var h=c[d],m=!1;typeof h!="string"&&(h.type==="tag"&&h.content[0]&&h.content[0].type==="tag"?h.content[0].content[0].content==="</"?0<f.length&&f[f.length-1].tagName===l(h.content[0].content[1])&&f.pop():h.content[h.content.length-1].content!=="/>"&&f.push({tagName:l(h.content[0].content[1]),openedBraces:0}):0<f.length&&h.type==="punctuation"&&h.content==="{"?f[f.length-1].openedBraces++:0<f.length&&0<f[f.length-1].openedBraces&&h.type==="punctuation"&&h.content==="}"?f[f.length-1].openedBraces--:m=!0),(m||typeof h=="string")&&0<f.length&&f[f.length-1].openedBraces===0&&(m=l(h),d<c.length-1&&(typeof c[d+1]=="string"||c[d+1].type==="plain-text")&&(m+=l(c[d+1]),c.splice(d+1,1)),0<d&&(typeof c[d-1]=="string"||c[d-1].type==="plain-text")&&(m=l(c[d-1])+m,c.splice(d-1,1),d--),c[d]=new e.Token("plain-text",m,null,m)),h.content&&typeof h.content!="string"&&o(h.content)}}var l=function(c){return c?typeof c=="string"?c:typeof c.content=="string"?c.content:c.content.map(l).join(""):""};e.hooks.add("after-tokenize",function(c){c.language!=="jsx"&&c.language!=="tsx"||o(c.tokens)})}(be),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(be),be.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},be.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=be.languages.swift}),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(be),be.languages.c=be.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),be.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),be.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},be.languages.c.string],char:be.languages.c.char,comment:be.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:be.languages.c}}}}),be.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete be.languages.c.boolean,be.languages.objectivec=be.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete be.languages.objectivec["class-name"],be.languages.objc=be.languages.objectivec,be.languages.reason=be.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),be.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete be.languages.reason.function,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(be),be.languages.go=be.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),be.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete be.languages.go["class-name"],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(be),be.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},be.languages.python["string-interpolation"].inside.interpolation.inside.rest=be.languages.python,be.languages.py=be.languages.python,be.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},be.languages.webmanifest=be.languages.json;var $5={};fK($5,{dracula:()=>gK,duotoneDark:()=>bK,duotoneLight:()=>_K,github:()=>wK,gruvboxMaterialDark:()=>WK,gruvboxMaterialLight:()=>JK,jettwaveDark:()=>UK,jettwaveLight:()=>HK,nightOwl:()=>EK,nightOwlLight:()=>AK,oceanicNext:()=>CK,okaidia:()=>NK,oneDark:()=>YK,oneLight:()=>KK,palenight:()=>jK,shadesOfPurple:()=>$K,synthwave84:()=>IK,ultramin:()=>LK,vsDark:()=>D5,vsLight:()=>FK});var mK={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},gK=mK,yK={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},bK=yK,vK={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},_K=vK,xK={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},wK=xK,SK={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},EK=SK,kK={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},AK=kK,Xn={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},TK={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:Xn.keyword}},{types:["attr-value"],style:{color:Xn.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:Xn.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:Xn.primitive}},{types:["boolean"],style:{color:Xn.boolean}},{types:["tag"],style:{color:Xn.tag}},{types:["string"],style:{color:Xn.string}},{types:["punctuation"],style:{color:Xn.string}},{types:["selector","char","builtin","inserted"],style:{color:Xn.char}},{types:["function"],style:{color:Xn.function}},{types:["operator","entity","url","variable"],style:{color:Xn.variable}},{types:["keyword"],style:{color:Xn.keyword}},{types:["atrule","class-name"],style:{color:Xn.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},CK=TK,OK={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},NK=OK,RK={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},jK=RK,MK={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},$K=MK,DK={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},IK=DK,PK={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},LK=PK,zK={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},D5=zK,qK={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},FK=qK,BK={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},UK=BK,VK={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},HK=VK,GK={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},YK=GK,ZK={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},KK=ZK,XK={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},WK=XK,QK={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},JK=QK,eX=e=>te.useCallback(t=>{var n=t,{className:r,style:i,line:a}=n,o=M5(n,["className","style","line"]);const l=kp(Xr({},o),{className:N5("token-line",r)});return typeof e=="object"&&"plain"in e&&(l.style=e.plain),typeof i=="object"&&(l.style=Xr(Xr({},l.style||{}),i)),l},[e]),tX=e=>{const t=te.useCallback(({types:n,empty:r})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return e[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(i=>e[i]))}},[e]);return te.useCallback(n=>{var r=n,{token:i,className:a,style:o}=r,l=M5(r,["token","className","style"]);const c=kp(Xr({},l),{className:N5("token",...i.types,a),children:i.content,style:t(i)});return o!=null&&(c.style=Xr(Xr({},c.style||{}),o)),c},[t])},nX=/\r\n|\r|\n/,yO=e=>{e.length===0?e.push({types:["plain"],content:`
|
|
106
106
|
`,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
|
|
107
|
-
`,e[0].empty=!0)},bO=(e,t)=>{const n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},
|
|
107
|
+
`,e[0].empty=!0)},bO=(e,t)=>{const n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},rX=e=>{const t=[[]],n=[e],r=[0],i=[e.length];let a=0,o=0,l=[];const c=[l];for(;o>-1;){for(;(a=r[o]++)<i[o];){let f,d=t[o];const m=n[o][a];if(typeof m=="string"?(d=o>0?d:["plain"],f=m):(d=bO(d,m.type),m.alias&&(d=bO(d,m.alias)),f=m.content),typeof f!="string"){o++,t.push(d),n.push(f),r.push(0),i.push(f.length);continue}const g=f.split(nX),v=g.length;l.push({types:d,content:g[0]});for(let w=1;w<v;w++)yO(l),c.push(l=[]),l.push({types:d,content:g[w]})}o--,t.pop(),n.pop(),r.pop(),i.pop()}return yO(l),c},vO=rX,iX=({prism:e,code:t,grammar:n,language:r})=>te.useMemo(()=>{if(n==null)return vO([t]);const i={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run("before-tokenize",i),i.tokens=e.tokenize(t,n),e.hooks.run("after-tokenize",i),vO(i.tokens)},[t,n,r,e]),aX=(e,t)=>{const{plain:n}=e,r=e.styles.reduce((i,a)=>{const{languages:o,style:l}=a;return o&&!o.includes(t)||a.types.forEach(c=>{const f=Xr(Xr({},i[c]),l);i[c]=f}),i},{});return r.root=n,r.plain=kp(Xr({},n),{backgroundColor:void 0}),r},sX=aX,oX=({children:e,language:t,code:n,theme:r,prism:i})=>{const a=t.toLowerCase(),o=sX(r,a),l=eX(o),c=tX(o),f=i.languages[a],d=iX({prism:i,language:a,code:n,grammar:f});return e({tokens:d,className:`prism-code language-${a}`,style:o!=null?o.root:{},getLineProps:l,getTokenProps:c})},lX=e=>te.createElement(oX,kp(Xr({},e),{prism:e.prism||be,theme:e.theme||D5,code:e.code,language:e.language}));/*! Bundled license information:
|
|
108
108
|
|
|
109
109
|
prismjs/prism.js:
|
|
110
110
|
(**
|
|
@@ -115,97 +115,97 @@ prismjs/prism.js:
|
|
|
115
115
|
* @namespace
|
|
116
116
|
* @public
|
|
117
117
|
*)
|
|
118
|
-
*/const _O=["border-red-400","border-blue-400","border-green-500","border-yellow-400","border-purple-400","border-pink-400","border-indigo-400"],
|
|
118
|
+
*/const _O=["border-red-400","border-blue-400","border-green-500","border-yellow-400","border-purple-400","border-pink-400","border-indigo-400"],uX=e=>{let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);const n=Math.abs(t%_O.length);return _O[n]},cX=({message:e,client:t,getMessageContent:n,formatTokens:r,isCollapsed:i,onToggleCollapse:a})=>{const{getToolUIRender:o}=Ts(),l=o(e.name),c=uX(e.name);return N.jsxs("div",{className:"flex flex-col w-full",children:[l?l(e):N.jsxs("div",{className:`flex flex-col w-full bg-white rounded-lg shadow-sm border-2 ${c} overflow-hidden`,children:[N.jsx("div",{className:"flex items-center justify-between p-3 cursor-pointer hover:bg-gray-100 transition-colors",onClick:a,children:N.jsxs("div",{className:"text-sm font-medium text-gray-700",onClick:()=>console.log(e),children:[e.node_name," | ",e.name]})}),!i&&N.jsxs("div",{className:"flex flex-col gap-4 p-4 border-t border-gray-100",children:[N.jsx(xO,{content:e.tool_input||""}),N.jsx(xO,{content:n(e.content)}),N.jsx(Qw,{response_metadata:e.response_metadata,usage_metadata:e.usage_metadata||{},spend_time:e.spend_time,id:e.id,tool_call_id:e.tool_call_id})]})]}),e.sub_agent_messages&&N.jsx("div",{className:"flex flex-col pl-4 py-2 border-l border-gray-300",children:N.jsx(I5,{renderMessages:e.sub_agent_messages,collapsedTools:[],toggleToolCollapse:f=>{},client:t})})]})},xO=({content:e})=>{const t=()=>{try{return JSON.parse(e),!0}catch{return!1}},n=e.startsWith("{")&&e.endsWith("}")&&t(),r=e.includes("#")||e.includes("```")||e.includes("*"),[i,a]=te.useState(n),[o,l]=te.useState(!1),c=()=>{navigator.clipboard.writeText(e)};return N.jsxs("div",{className:"flex flex-col",children:[N.jsxs("div",{className:"flex gap-2 mb-2",children:[N.jsx("button",{onClick:c,className:"px-2 py-1 text-xs font-medium text-gray-600 bg-green-100 rounded hover:bg-green-200 transition-colors",children:"copy"}),n&&N.jsx("button",{onClick:()=>a(!i),className:"px-2 py-1 text-xs font-medium text-gray-600 bg-orange-100 rounded hover:bg-orange-200 transition-colors",children:"json"}),r&&N.jsx("button",{onClick:()=>l(!o),className:"px-2 py-1 text-xs font-medium text-gray-600 bg-blue-100 rounded hover:bg-blue-200 transition-colors",children:"markdown"})]}),N.jsx("div",{className:"flex flex-col max-h-[300px] overflow-auto border border-gray-200 rounded p-2 w-full text-xs font-mono whitespace-pre-wrap",children:i&&n?N.jsx(lX,{code:JSON.stringify(JSON.parse(e),null,2),language:"json",theme:$5.oneLight,children:({className:f,style:d,tokens:h,getLineProps:m,getTokenProps:g})=>N.jsx("pre",{style:d,children:h.map((v,w)=>N.jsx("div",{...m({line:v}),children:v.map((b,_)=>N.jsx("span",{...g({token:b})},_))},w))})}):o&&r?N.jsx("div",{className:"markdown-body",children:N.jsx(Y3,{remarkPlugins:[y5],children:e})}):N.jsx("pre",{className:"whitespace-pre-wrap",children:e})})]})},fX=e=>N.jsx("andypf-json-viewer",{indent:"4",expanded:"4",theme:"default-light","show-data-types":"false","show-toolbar":"false","expand-icon-type":"circle","show-copy":"true","show-size":"true",data:JSON.stringify(e.data)}),I5=({renderMessages:e,collapsedTools:t,toggleToolCollapse:n,client:r})=>{const[i,a]=te.useState(new Map),o=te.useRef(new Map),l=te.useCallback((m,g)=>{a(v=>{const w=new Map(v),b=w.get(m)||{showDetail:!1,showContextMenu:!1,contextMenuPosition:{x:0,y:0}};return w.set(m,{...b,...g}),w})},[]),c=te.useCallback((m,g)=>{m.preventDefault(),l(g,{contextMenuPosition:{x:m.clientX,y:m.clientY},showContextMenu:!0})},[l]),f=te.useCallback(m=>{l(m,{showContextMenu:!1})},[l]),d=te.useCallback((m,g)=>{navigator.clipboard.writeText(Fh(g)),f(m)},[f]),h=te.useCallback(m=>{a(g=>{const v=new Map(g),w=v.get(m);return w?v.set(m,{...w,showDetail:!w.showDetail,showContextMenu:!1}):v.set(m,{showDetail:!0,showContextMenu:!1,contextMenuPosition:{x:0,y:0}}),v})},[]);return te.useEffect(()=>{const m=g=>{i.forEach((v,w)=>{if(v.showContextMenu){const b=o.current.get(w);b&&!b.contains(g.target)&&f(w)}})};return Array.from(i.values()).some(g=>g.showContextMenu)&&document.addEventListener("click",m),()=>{document.removeEventListener("click",m)}},[i,f]),N.jsx("div",{className:"flex flex-col gap-4 w-full",children:e.map((m,g)=>{const v=m.unique_id||`message-${g}`,w=i.get(v)||{showDetail:!1,showContextMenu:!1,contextMenuPosition:{x:0,y:0}};return N.jsxs("div",{ref:b=>{b&&o.current.set(v,b)},onContextMenu:b=>c(b,v),children:[m.type==="human"?N.jsx(yq,{content:m.content}):m.type==="tool"?N.jsx(cX,{message:m,client:r,getMessageContent:Fh,formatTokens:JF,isCollapsed:t.includes(m.id),onToggleCollapse:()=>n(m.id)}):N.jsx(EZ,{message:m}),w.showDetail&&N.jsx(fX,{data:m}),w.showContextMenu&&N.jsxs("div",{className:"fixed bg-white border border-gray-200 rounded shadow-lg z-50 py-1 min-w-[150px]",style:{left:w.contextMenuPosition.x,top:w.contextMenuPosition.y},onClick:b=>b.stopPropagation(),children:[N.jsx("button",{className:"w-full bg-white px-3 py-2 text-left hover:bg-gray-50 text-sm",onClick:()=>d(v,m.content),children:"复制消息内容"}),N.jsx("button",{className:"w-full bg-white px-3 py-2 text-left hover:bg-gray-50 text-sm",onClick:()=>h(v),children:w.showDetail?"隐藏详情":"显示详情"})]})]},v)})})};/**
|
|
119
119
|
* @license lucide-react v0.544.0 - ISC
|
|
120
120
|
*
|
|
121
121
|
* This source code is licensed under the ISC license.
|
|
122
122
|
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
-
*/const
|
|
123
|
+
*/const dX=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hX=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),wO=e=>{const t=hX(e);return t.charAt(0).toUpperCase()+t.slice(1)},P5=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),pX=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
124
124
|
* @license lucide-react v0.544.0 - ISC
|
|
125
125
|
*
|
|
126
126
|
* This source code is licensed under the ISC license.
|
|
127
127
|
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
-
*/var
|
|
128
|
+
*/var mX={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
129
129
|
* @license lucide-react v0.544.0 - ISC
|
|
130
130
|
*
|
|
131
131
|
* This source code is licensed under the ISC license.
|
|
132
132
|
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/const
|
|
133
|
+
*/const gX=te.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},c)=>te.createElement("svg",{ref:c,...mX,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:P5("lucide",i),...!a&&!pX(l)&&{"aria-hidden":"true"},...l},[...o.map(([f,d])=>te.createElement(f,d)),...Array.isArray(a)?a:[a]]));/**
|
|
134
134
|
* @license lucide-react v0.544.0 - ISC
|
|
135
135
|
*
|
|
136
136
|
* This source code is licensed under the ISC license.
|
|
137
137
|
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
-
*/const Fn=(e,t)=>{const n=te.forwardRef(({className:r,...i},a)=>te.createElement(
|
|
138
|
+
*/const Fn=(e,t)=>{const n=te.forwardRef(({className:r,...i},a)=>te.createElement(gX,{ref:a,iconNode:t,className:P5(`lucide-${dX(wO(e))}`,`lucide-${e}`,r),...i}));return n.displayName=wO(e),n};/**
|
|
139
139
|
* @license lucide-react v0.544.0 - ISC
|
|
140
140
|
*
|
|
141
141
|
* This source code is licensed under the ISC license.
|
|
142
142
|
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
-
*/const
|
|
143
|
+
*/const yX=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],L5=Fn("chevron-down",yX);/**
|
|
144
144
|
* @license lucide-react v0.544.0 - ISC
|
|
145
145
|
*
|
|
146
146
|
* This source code is licensed under the ISC license.
|
|
147
147
|
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
-
*/const
|
|
148
|
+
*/const bX=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],vX=Fn("eye-off",bX);/**
|
|
149
149
|
* @license lucide-react v0.544.0 - ISC
|
|
150
150
|
*
|
|
151
151
|
* This source code is licensed under the ISC license.
|
|
152
152
|
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
-
*/const
|
|
153
|
+
*/const _X=[["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"}]],xX=Fn("eye",_X);/**
|
|
154
154
|
* @license lucide-react v0.544.0 - ISC
|
|
155
155
|
*
|
|
156
156
|
* This source code is licensed under the ISC license.
|
|
157
157
|
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
-
*/const
|
|
158
|
+
*/const wX=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],SX=Fn("file-json",wX);/**
|
|
159
159
|
* @license lucide-react v0.544.0 - ISC
|
|
160
160
|
*
|
|
161
161
|
* This source code is licensed under the ISC license.
|
|
162
162
|
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
-
*/const
|
|
163
|
+
*/const EX=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],kX=Fn("file-text",EX);/**
|
|
164
164
|
* @license lucide-react v0.544.0 - ISC
|
|
165
165
|
*
|
|
166
166
|
* This source code is licensed under the ISC license.
|
|
167
167
|
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
-
*/const
|
|
168
|
+
*/const AX=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],TX=Fn("file",AX);/**
|
|
169
169
|
* @license lucide-react v0.544.0 - ISC
|
|
170
170
|
*
|
|
171
171
|
* This source code is licensed under the ISC license.
|
|
172
172
|
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
-
*/const
|
|
173
|
+
*/const CX=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],OX=Fn("history",CX);/**
|
|
174
174
|
* @license lucide-react v0.544.0 - ISC
|
|
175
175
|
*
|
|
176
176
|
* This source code is licensed under the ISC license.
|
|
177
177
|
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
-
*/const
|
|
178
|
+
*/const NX=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],RX=Fn("log-out",NX);/**
|
|
179
179
|
* @license lucide-react v0.544.0 - ISC
|
|
180
180
|
*
|
|
181
181
|
* This source code is licensed under the ISC license.
|
|
182
182
|
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
-
*/const
|
|
183
|
+
*/const jX=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],MX=Fn("network",jX);/**
|
|
184
184
|
* @license lucide-react v0.544.0 - ISC
|
|
185
185
|
*
|
|
186
186
|
* This source code is licensed under the ISC license.
|
|
187
187
|
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
-
*/const
|
|
188
|
+
*/const $X=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],DX=Fn("plus",$X);/**
|
|
189
189
|
* @license lucide-react v0.544.0 - ISC
|
|
190
190
|
*
|
|
191
191
|
* This source code is licensed under the ISC license.
|
|
192
192
|
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
-
*/const
|
|
193
|
+
*/const IX=[["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"}]],PX=Fn("refresh-cw",IX);/**
|
|
194
194
|
* @license lucide-react v0.544.0 - ISC
|
|
195
195
|
*
|
|
196
196
|
* This source code is licensed under the ISC license.
|
|
197
197
|
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
-
*/const
|
|
198
|
+
*/const LX=[["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"}]],zX=Fn("rotate-ccw",LX);/**
|
|
199
199
|
* @license lucide-react v0.544.0 - ISC
|
|
200
200
|
*
|
|
201
201
|
* This source code is licensed under the ISC license.
|
|
202
202
|
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
-
*/const
|
|
203
|
+
*/const qX=[["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"}]],FX=Fn("trash-2",qX);/**
|
|
204
204
|
* @license lucide-react v0.544.0 - ISC
|
|
205
205
|
*
|
|
206
206
|
* This source code is licensed under the ISC license.
|
|
207
207
|
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
-
*/const FX=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],z5=Fn("x",FX),BX=({onClose:e,formatTime:t})=>{const{historyList:n,currentChatId:r,refreshHistoryList:i,createNewChat:a,deleteHistoryChat:o,toHistoryChat:l}=Ts();return N.jsxs("div",{className:" bg-white rounded-lg shadow-md h-full flex flex-col border-r",children:[N.jsxs("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center h-16",children:[N.jsxs("div",{className:"flex items-center gap-3",children:[N.jsx("h3",{className:"m-0 text-lg text-gray-800",children:"历史记录"}),N.jsx("button",{className:"p-1.5 text-base rounded bg-blue-100 hover:bg-blue-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:i,title:"刷新列表",children:N.jsx(IX,{className:"w-4 h-4 text-blue-600 group-hover:text-blue-700 group-hover:rotate-180 transition-all duration-300"})})]}),N.jsx("button",{className:"p-1.5 text-base rounded bg-red-100 hover:bg-red-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:e,title:"关闭",children:N.jsx(z5,{className:"w-4 h-4 text-red-600 group-hover:text-red-700"})})]}),N.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[N.jsx("div",{className:"flex flex-col gap-3 cursor-pointer",onClick:()=>{a()},children:N.jsx("div",{className:"flex justify-between items-center p-3 rounded-lg bg-gray-50 hover:bg-gray-100 transition-colors duration-200",children:N.jsx("div",{className:"text-sm text-gray-800 truncate",children:"New Chat"})})}),n.length===0?N.jsx("div",{className:"text-center text-gray-500 py-8",children:"暂无历史记录"}):N.jsx("div",{className:"flex flex-col gap-3 mt-3",children:n.sort((c,f)=>new Date(f.created_at).getTime()-new Date(c.created_at).getTime()).map(c=>N.jsxs("div",{className:`flex justify-between items-center p-3 rounded-lg transition-colors duration-200 ${c.thread_id===r?"bg-blue-50 border border-blue-200":"bg-gray-50 hover:bg-gray-100"}`,children:[N.jsxs("div",{className:"flex-1 min-w-0 mr-2",children:[N.jsx("div",{className:"text-sm text-gray-800 mb-1 truncate max-w-[180px]",children:e7(c)}),N.jsxs("div",{className:"flex gap-3 text-xs text-gray-500",children:[N.jsx("span",{className:"truncate max-w-[100px]",children:t(new Date(c.created_at))}),N.jsx("span",{className:"truncate max-w-[60px]",children:c.status})]})]}),N.jsxs("div",{className:"flex gap-2 shrink-0",children:[N.jsx("button",{className:"p-1.5 text-base rounded bg-green-100 hover:bg-green-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:()=>{l(c)},title:"恢复对话",children:N.jsx(LX,{className:"w-4 h-4 text-green-600 group-hover:text-green-700 group-hover:-rotate-180 transition-all duration-300"})}),N.jsx("button",{className:"p-1.5 text-base rounded bg-red-100 hover:bg-red-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:async()=>{await o(c)},title:"删除对话",children:N.jsx(qX,{className:"w-4 h-4 text-red-600 group-hover:text-red-700"})})]})]},c.thread_id))})]})]})},q5=te.createContext(void 0),UX=({children:e})=>{const[t,n]=te.useState(()=>{const i=localStorage.getItem("extraParams");try{return i?JSON.parse(i):{}}catch(a){return console.error("Failed to parse extraParams from localStorage",a),{}}});te.useEffect(()=>{localStorage.setItem("extraParams",JSON.stringify(t))},[t]);const r=i=>{n(i)};return N.jsx(q5.Provider,{value:{extraParams:t,setExtraParams:r},children:e})},F5=()=>{const e=te.useContext(q5);if(e===void 0)throw new Error("useExtraParams must be used within an ExtraParamsProvider");return e};class VX{constructor(t={}){De(this,"apiUrl");this.apiUrl=t.apiUrl||""}createFormData(t,n){const r=new FormData;if(typeof t=="string"){const i=new Blob([t],{type:"text/plain"});r.append("file",i,n||"file.txt")}else r.append("file",t,n||(t instanceof File?t.name:"file"));return r}async upload(t,n={}){const i={method:"POST",body:this.createFormData(t,n.filename)};n.signal&&(i.signal=n.signal);try{const a=await fetch(`${this.apiUrl}${this.getUploadEndpoint()}`,i);if(!a.ok)throw new Error(`Upload failed with status: ${a.status}`);const o=await a.json();return this.processResponse(o)}catch(a){throw new Error(`File upload failed: ${a instanceof Error?a.message:String(a)}`)}}}class HX extends VX{constructor(t={}){super({apiUrl:t.apiUrl||"https://tmpfiles.org/api/v1"})}getUploadEndpoint(){return"/upload"}processResponse(t){var n;return(n=t.data)!=null&&n.url&&(t.data.url=t.data.url.replace("//tmpfiles.org/","//tmpfiles.org/dl/")),t}}const GX=({onFileUploaded:e})=>{const[t,n]=te.useState([]),r=new HX,i=3,a=te.useCallback(async l=>{var d;const f=Array.from(l.target.files||[]).filter(h=>h.type.startsWith("image/"));if(t.length+f.length>i){alert(`最多只能上传${i}张图片`),l.target.value="";return}n(h=>[...h,...f]);for(const h of f)try{const m=await r.upload(h);(d=m.data)!=null&&d.url&&e(m.data.url)}catch(m){console.error("Upload failed:",m)}l.target.value=""},[e,t.length]),o=te.useCallback(l=>{n(c=>c.filter((f,d)=>d!==l))},[]);return N.jsxs("div",{className:"flex gap-2 rounded-lg flex-1",children:[t.length<i&&N.jsxs("label",{className:`inline-flex items-center justify-center w-20 h-20 text-gray-500 bg-gray-100 rounded-lg cursor-pointer transition-all duration-200 hover:bg-gray-200 ${t.length===0?"w-8 h-8":""}`,children:[N.jsxs("svg",{viewBox:"0 0 24 24",width:t.length===0?"20":"32",height:t.length===0?"20":"32",fill:"currentColor",children:[N.jsx("path",{d:"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"}),N.jsx("path",{d:"M20 4h-3.17l-1.24-1.35A1.99 1.99 0 0 0 14.12 2H9.88c-.56 0-1.1.24-1.48.65L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 13c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"})]}),N.jsx("input",{type:"file",accept:"image/*",multiple:!0,onChange:a,className:"hidden"})]}),N.jsx("div",{className:"flex flex-wrap gap-2",children:t.map((l,c)=>N.jsxs("div",{className:"relative w-20 h-20 rounded-lg overflow-hidden",children:[N.jsx("img",{src:URL.createObjectURL(l),alt:l.name,className:"w-full h-full object-cover border border-gray-200"}),N.jsx("button",{className:"absolute top-0.5 right-0.5 w-5 h-5 bg-black/50 text-white rounded-full flex items-center justify-center text-base leading-none hover:bg-black/70 transition-colors",onClick:()=>o(c),children:"×"})]},c))})]})},SO="json-editor-presets",EO="json-editor-active-tab",YX=({isOpen:e,initialJson:t,onClose:n,onSave:r})=>{const[i,a]=te.useState([]),[o,l]=te.useState(0),[c,f]=te.useState(""),[d,h]=te.useState(null),[m,g]=te.useState(null),[v,w]=te.useState("");if(te.useEffect(()=>{if(e){let k=[];try{const O=localStorage.getItem(SO);k=O?JSON.parse(O):[]}catch(O){console.error("Failed to parse presets from localStorage",O),k=[]}k.length===0&&(k=[{name:"Default",data:t}]),a(k);let T=0;try{const O=localStorage.getItem(EO);if(O){const $=parseInt(O,10);$>=0&&$<k.length&&(T=$)}}catch(O){console.error("Failed to parse active tab from localStorage",O)}l(T),h(null)}},[e,t]),te.useEffect(()=>{e&&i.length>0&&i[o]&&(f(JSON.stringify(i[o].data,null,2)),h(null))},[o,i,e]),te.useEffect(()=>{e&&localStorage.setItem(EO,o.toString())},[o,e]),!e)return null;const b=k=>{a(k),localStorage.setItem(SO,JSON.stringify(k))},_=()=>{const k={name:`Preset ${i.length+1}`,data:{}},T=[...i,k];b(T),l(T.length-1)},S=k=>{let T=i.filter((O,$)=>$!==k);T.length===0&&(T=[{name:"Default",data:t}]),b(T),o>=k&&o>0?l(o-1):o>=T.length&&l(T.length-1)},x=()=>{try{const k=JSON.parse(c),T=i.map((O,$)=>$===o?{...O,data:k}:O);b(T),r(k),n()}catch(k){h("JSON 格式无效,请检查后重试。"),console.error("Invalid JSON format:",k)}},A=k=>{if(v.trim()!==""){const T=i.map((O,$)=>$===k?{...O,name:v.trim()}:O);b(T),g(null)}};return N.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:N.jsxs("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl mx-4 flex flex-col",style:{height:"80vh"},children:[N.jsx("div",{className:"p-6 border-b border-gray-200",children:N.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"编辑 Extra Parameters"})}),N.jsxs("div",{className:"flex-grow p-6 overflow-y-auto",children:[N.jsxs("div",{className:"flex items-center border-b border-gray-200 mb-4",children:[i.map((k,T)=>N.jsxs("div",{className:`flex items-center px-4 py-2 border-b-2 cursor-pointer text-sm font-medium ${o===T?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,onDoubleClick:()=>{g(T),w(k.name)},onClick:()=>l(T),children:[m===T?N.jsx("input",{type:"text",value:v,onChange:O=>w(O.target.value),onBlur:()=>A(T),onKeyDown:O=>O.key==="Enter"&&A(T),className:"text-sm p-0 border-none focus:ring-0 bg-transparent",autoFocus:!0}):N.jsx("span",{children:k.name}),N.jsx("button",{onClick:O=>{O.stopPropagation(),S(T)},className:"ml-2 text-gray-400 hover:text-gray-600 w-4 h-4 flex items-center justify-center",children:"×"})]},T)),N.jsx("button",{onClick:_,className:"ml-2 px-3 py-1 text-sm text-gray-500 hover:text-gray-700",children:"+"})]}),N.jsx("textarea",{value:c,onChange:k=>{f(k.target.value),h(null)},className:"w-full h-full p-3 border border-gray-300 rounded-lg font-mono text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"}),d&&N.jsx("p",{className:"mt-2 text-sm text-red-600",children:d})]}),N.jsxs("div",{className:"flex justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 rounded-b-lg",children:[N.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"取消"}),N.jsx("button",{onClick:x,className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"保存并使用"})]})]})})};function en(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=en(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var ZX={value:()=>{}};function Ap(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Eh(n)}function Eh(e){this._=e}function KX(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Eh.prototype=Ap.prototype={constructor:Eh,on:function(e,t){var n=this._,r=KX(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=XX(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=kO(n[i],e.name,t);else if(t==null)for(i in n)n[i]=kO(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 Eh(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new 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 new Error("unknown type: "+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function XX(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function kO(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=ZX,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var kw="http://www.w3.org/1999/xhtml";const AO={svg:"http://www.w3.org/2000/svg",xhtml:kw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Tp(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),AO.hasOwnProperty(t)?{space:AO[t],local:e}:e}function WX(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===kw&&t.documentElement.namespaceURI===kw?t.createElement(e):t.createElementNS(n,e)}}function QX(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function B5(e){var t=Tp(e);return(t.local?QX:WX)(t)}function JX(){}function wS(e){return e==null?JX:function(){return this.querySelector(e)}}function eW(e){typeof e!="function"&&(e=wS(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=new Array(o),c,f,d=0;d<o;++d)(c=a[d])&&(f=e.call(c,c.__data__,d,a))&&("__data__"in c&&(f.__data__=c.__data__),l[d]=f);return new or(r,this._parents)}function tW(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function nW(){return[]}function U5(e){return e==null?nW:function(){return this.querySelectorAll(e)}}function rW(e){return function(){return tW(e.apply(this,arguments))}}function iW(e){typeof e=="function"?e=rW(e):e=U5(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],l=o.length,c,f=0;f<l;++f)(c=o[f])&&(r.push(e.call(c,c.__data__,f,o)),i.push(c));return new or(r,i)}function V5(e){return function(){return this.matches(e)}}function H5(e){return function(t){return t.matches(e)}}var aW=Array.prototype.find;function sW(e){return function(){return aW.call(this.children,e)}}function oW(){return this.firstElementChild}function lW(e){return this.select(e==null?oW:sW(typeof e=="function"?e:H5(e)))}var uW=Array.prototype.filter;function cW(){return Array.from(this.children)}function fW(e){return function(){return uW.call(this.children,e)}}function dW(e){return this.selectAll(e==null?cW:fW(typeof e=="function"?e:H5(e)))}function hW(e){typeof e!="function"&&(e=V5(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=[],c,f=0;f<o;++f)(c=a[f])&&e.call(c,c.__data__,f,a)&&l.push(c);return new or(r,this._parents)}function G5(e){return new Array(e.length)}function pW(){return new or(this._enter||this._groups.map(G5),this._parents)}function Zh(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Zh.prototype={constructor:Zh,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 mW(e){return function(){return e}}function gW(e,t,n,r,i,a){for(var o=0,l,c=t.length,f=a.length;o<f;++o)(l=t[o])?(l.__data__=a[o],r[o]=l):n[o]=new Zh(e,a[o]);for(;o<c;++o)(l=t[o])&&(i[o]=l)}function yW(e,t,n,r,i,a,o){var l,c,f=new Map,d=t.length,h=a.length,m=new Array(d),g;for(l=0;l<d;++l)(c=t[l])&&(m[l]=g=o.call(c,c.__data__,l,t)+"",f.has(g)?i[l]=c:f.set(g,c));for(l=0;l<h;++l)g=o.call(e,a[l],l,a)+"",(c=f.get(g))?(r[l]=c,c.__data__=a[l],f.delete(g)):n[l]=new Zh(e,a[l]);for(l=0;l<d;++l)(c=t[l])&&f.get(m[l])===c&&(i[l]=c)}function bW(e){return e.__data__}function vW(e,t){if(!arguments.length)return Array.from(this,bW);var n=t?yW:gW,r=this._parents,i=this._groups;typeof e!="function"&&(e=mW(e));for(var a=i.length,o=new Array(a),l=new Array(a),c=new Array(a),f=0;f<a;++f){var d=r[f],h=i[f],m=h.length,g=_W(e.call(d,d&&d.__data__,f,r)),v=g.length,w=l[f]=new Array(v),b=o[f]=new Array(v),_=c[f]=new Array(m);n(d,h,w,b,_,g,t);for(var S=0,x=0,A,k;S<v;++S)if(A=w[S]){for(S>=x&&(x=S+1);!(k=b[x])&&++x<v;);A._next=k||null}}return o=new or(o,r),o._enter=l,o._exit=c,o}function _W(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xW(){return new or(this._exit||this._groups.map(G5),this._parents)}function wW(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function SW(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),l=new Array(i),c=0;c<o;++c)for(var f=n[c],d=r[c],h=f.length,m=l[c]=new Array(h),g,v=0;v<h;++v)(g=f[v]||d[v])&&(m[v]=g);for(;c<i;++c)l[c]=n[c];return new or(l,this._parents)}function EW(){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 kW(e){e||(e=AW);function t(h,m){return h&&m?e(h.__data__,m.__data__):!h-!m}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],l=o.length,c=i[a]=new Array(l),f,d=0;d<l;++d)(f=o[d])&&(c[d]=f);c.sort(t)}return new or(i,this._parents).order()}function AW(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function TW(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function CW(){return Array.from(this)}function OW(){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 NW(){let e=0;for(const t of this)++e;return e}function RW(){return!this.node()}function jW(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,l;a<o;++a)(l=i[a])&&e.call(l,l.__data__,a,i);return this}function MW(e){return function(){this.removeAttribute(e)}}function $W(e){return function(){this.removeAttributeNS(e.space,e.local)}}function DW(e,t){return function(){this.setAttribute(e,t)}}function IW(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function PW(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function LW(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 zW(e,t){var n=Tp(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?$W:MW:typeof t=="function"?n.local?LW:PW:n.local?IW:DW)(n,t))}function Y5(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function qW(e){return function(){this.style.removeProperty(e)}}function FW(e,t,n){return function(){this.style.setProperty(e,t,n)}}function BW(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function UW(e,t,n){return arguments.length>1?this.each((t==null?qW:typeof t=="function"?BW:FW)(e,t,n??"")):Go(this.node(),e)}function Go(e,t){return e.style.getPropertyValue(t)||Y5(e).getComputedStyle(e,null).getPropertyValue(t)}function VW(e){return function(){delete this[e]}}function HW(e,t){return function(){this[e]=t}}function GW(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function YW(e,t){return arguments.length>1?this.each((t==null?VW:typeof t=="function"?GW:HW)(e,t)):this.node()[e]}function Z5(e){return e.trim().split(/^|\s+/)}function SS(e){return e.classList||new K5(e)}function K5(e){this._node=e,this._names=Z5(e.getAttribute("class")||"")}K5.prototype={add:function(e){var t=this._names.indexOf(e);t<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 X5(e,t){for(var n=SS(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function W5(e,t){for(var n=SS(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function ZW(e){return function(){X5(this,e)}}function KW(e){return function(){W5(this,e)}}function XW(e,t){return function(){(t.apply(this,arguments)?X5:W5)(this,e)}}function WW(e,t){var n=Z5(e+"");if(arguments.length<2){for(var r=SS(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?XW:t?ZW:KW)(n,t))}function QW(){this.textContent=""}function JW(e){return function(){this.textContent=e}}function eQ(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function tQ(e){return arguments.length?this.each(e==null?QW:(typeof e=="function"?eQ:JW)(e)):this.node().textContent}function nQ(){this.innerHTML=""}function rQ(e){return function(){this.innerHTML=e}}function iQ(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function aQ(e){return arguments.length?this.each(e==null?nQ:(typeof e=="function"?iQ:rQ)(e)):this.node().innerHTML}function sQ(){this.nextSibling&&this.parentNode.appendChild(this)}function oQ(){return this.each(sQ)}function lQ(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function uQ(){return this.each(lQ)}function cQ(e){var t=typeof e=="function"?e:B5(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function fQ(){return null}function dQ(e,t){var n=typeof e=="function"?e:B5(e),r=t==null?fQ:typeof t=="function"?t:wS(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function hQ(){var e=this.parentNode;e&&e.removeChild(this)}function pQ(){return this.each(hQ)}function mQ(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function gQ(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function yQ(e){return this.select(e?gQ:mQ)}function bQ(e){return arguments.length?this.property("__data__",e):this.node().__data__}function vQ(e){return function(t){e.call(this,t,this.__data__)}}function _Q(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function xQ(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 wQ(e,t,n){return function(){var r=this.__on,i,a=vQ(t);if(r){for(var o=0,l=r.length;o<l;++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 SQ(e,t,n){var r=_Q(e+""),i,a=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,f=l.length,d;c<f;++c)for(i=0,d=l[c];i<a;++i)if((o=r[i]).type===d.type&&o.name===d.name)return d.value}return}for(l=t?wQ:xQ,i=0;i<a;++i)this.each(l(r[i],t,n));return this}function Q5(e,t,n){var r=Y5(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 EQ(e,t){return function(){return Q5(this,e,t)}}function kQ(e,t){return function(){return Q5(this,e,t.apply(this,arguments))}}function AQ(e,t){return this.each((typeof t=="function"?kQ:EQ)(e,t))}function*TQ(){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 J5=[null];function or(e,t){this._groups=e,this._parents=t}function Tc(){return new or([[document.documentElement]],J5)}function CQ(){return this}or.prototype=Tc.prototype={constructor:or,select:eW,selectAll:iW,selectChild:lW,selectChildren:dW,filter:hW,data:vW,enter:pW,exit:xW,join:wW,merge:SW,selection:CQ,order:EW,sort:kW,call:TW,nodes:CW,node:OW,size:NW,empty:RW,each:jW,attr:zW,style:UW,property:YW,classed:WW,text:tQ,html:aQ,raise:oQ,lower:uQ,append:cQ,insert:dQ,remove:pQ,clone:yQ,datum:bQ,on:SQ,dispatch:AQ,[Symbol.iterator]:TQ};function er(e){return typeof e=="string"?new or([[document.querySelector(e)]],[document.documentElement]):new or([[e]],J5)}function OQ(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Nr(e,t){if(e=OQ(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]}const NQ={passive:!1},ac={capture:!0,passive:!1};function b0(e){e.stopImmediatePropagation()}function Po(e){e.preventDefault(),e.stopImmediatePropagation()}function e9(e){var t=e.document.documentElement,n=er(e).on("dragstart.drag",Po,ac);"onselectstart"in t?n.on("selectstart.drag",Po,ac):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function t9(e,t){var n=e.document.documentElement,r=er(e).on("dragstart.drag",null);t&&(r.on("click.drag",Po,ac),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Sd=e=>()=>e;function Aw(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:l,dx:c,dy:f,dispatch:d}){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:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:d}})}Aw.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function RQ(e){return!e.ctrlKey&&!e.button}function jQ(){return this.parentNode}function MQ(e,t){return t??{x:e.x,y:e.y}}function $Q(){return navigator.maxTouchPoints||"ontouchstart"in this}function n9(){var e=RQ,t=jQ,n=MQ,r=$Q,i={},a=Ap("start","drag","end"),o=0,l,c,f,d,h=0;function m(A){A.on("mousedown.drag",g).filter(r).on("touchstart.drag",b).on("touchmove.drag",_,NQ).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(A,k){if(!(d||!e.call(this,A,k))){var T=x(this,t.call(this,A,k),A,k,"mouse");T&&(er(A.view).on("mousemove.drag",v,ac).on("mouseup.drag",w,ac),e9(A.view),b0(A),f=!1,l=A.clientX,c=A.clientY,T("start",A))}}function v(A){if(Po(A),!f){var k=A.clientX-l,T=A.clientY-c;f=k*k+T*T>h}i.mouse("drag",A)}function w(A){er(A.view).on("mousemove.drag mouseup.drag",null),t9(A.view,f),Po(A),i.mouse("end",A)}function b(A,k){if(e.call(this,A,k)){var T=A.changedTouches,O=t.call(this,A,k),$=T.length,L,M;for(L=0;L<$;++L)(M=x(this,O,A,k,T[L].identifier,T[L]))&&(b0(A),M("start",A,T[L]))}}function _(A){var k=A.changedTouches,T=k.length,O,$;for(O=0;O<T;++O)($=i[k[O].identifier])&&(Po(A),$("drag",A,k[O]))}function S(A){var k=A.changedTouches,T=k.length,O,$;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),O=0;O<T;++O)($=i[k[O].identifier])&&(b0(A),$("end",A,k[O]))}function x(A,k,T,O,$,L){var M=a.copy(),z=Nr(L||T,k),P,q,D;if((D=n.call(A,new Aw("beforestart",{sourceEvent:T,target:m,identifier:$,active:o,x:z[0],y:z[1],dx:0,dy:0,dispatch:M}),O))!=null)return P=D.x-z[0]||0,q=D.y-z[1]||0,function H(B,G,K){var Q=z,R;switch(B){case"start":i[$]=H,R=o++;break;case"end":delete i[$],--o;case"drag":z=Nr(K||G,k),R=o;break}M.call(B,A,new Aw(B,{sourceEvent:G,subject:D,target:m,identifier:$,active:R,x:z[0]+P,y:z[1]+q,dx:z[0]-Q[0],dy:z[1]-Q[1],dispatch:M}),O)}}return m.filter=function(A){return arguments.length?(e=typeof A=="function"?A:Sd(!!A),m):e},m.container=function(A){return arguments.length?(t=typeof A=="function"?A:Sd(A),m):t},m.subject=function(A){return arguments.length?(n=typeof A=="function"?A:Sd(A),m):n},m.touchable=function(A){return arguments.length?(r=typeof A=="function"?A:Sd(!!A),m):r},m.on=function(){var A=a.on.apply(a,arguments);return A===a?m:A},m.clickDistance=function(A){return arguments.length?(h=(A=+A)*A,m):Math.sqrt(h)},m}function ES(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function r9(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Cc(){}var sc=.7,Kh=1/sc,Lo="\\s*([+-]?\\d+)\\s*",oc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Wr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",DQ=/^#([0-9a-f]{3,8})$/,IQ=new RegExp(`^rgb\\(${Lo},${Lo},${Lo}\\)$`),PQ=new RegExp(`^rgb\\(${Wr},${Wr},${Wr}\\)$`),LQ=new RegExp(`^rgba\\(${Lo},${Lo},${Lo},${oc}\\)$`),zQ=new RegExp(`^rgba\\(${Wr},${Wr},${Wr},${oc}\\)$`),qQ=new RegExp(`^hsl\\(${oc},${Wr},${Wr}\\)$`),FQ=new RegExp(`^hsla\\(${oc},${Wr},${Wr},${oc}\\)$`),TO={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};ES(Cc,lc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:CO,formatHex:CO,formatHex8:BQ,formatHsl:UQ,formatRgb:OO,toString:OO});function CO(){return this.rgb().formatHex()}function BQ(){return this.rgb().formatHex8()}function UQ(){return i9(this).formatHsl()}function OO(){return this.rgb().formatRgb()}function lc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=DQ.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?NO(t):n===3?new Ln(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ed(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ed(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=IQ.exec(e))?new Ln(t[1],t[2],t[3],1):(t=PQ.exec(e))?new Ln(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=LQ.exec(e))?Ed(t[1],t[2],t[3],t[4]):(t=zQ.exec(e))?Ed(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qQ.exec(e))?MO(t[1],t[2]/100,t[3]/100,1):(t=FQ.exec(e))?MO(t[1],t[2]/100,t[3]/100,t[4]):TO.hasOwnProperty(e)?NO(TO[e]):e==="transparent"?new Ln(NaN,NaN,NaN,0):null}function NO(e){return new Ln(e>>16&255,e>>8&255,e&255,1)}function Ed(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ln(e,t,n,r)}function VQ(e){return e instanceof Cc||(e=lc(e)),e?(e=e.rgb(),new Ln(e.r,e.g,e.b,e.opacity)):new Ln}function Tw(e,t,n,r){return arguments.length===1?VQ(e):new Ln(e,t,n,r??1)}function Ln(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ES(Ln,Tw,r9(Cc,{brighter(e){return e=e==null?Kh:Math.pow(Kh,e),new Ln(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?sc:Math.pow(sc,e),new Ln(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ln(ys(this.r),ys(this.g),ys(this.b),Xh(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:RO,formatHex:RO,formatHex8:HQ,formatRgb:jO,toString:jO}));function RO(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}`}function HQ(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}${ps((isNaN(this.opacity)?1:this.opacity)*255)}`}function jO(){const e=Xh(this.opacity);return`${e===1?"rgb(":"rgba("}${ys(this.r)}, ${ys(this.g)}, ${ys(this.b)}${e===1?")":`, ${e})`}`}function Xh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ys(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ps(e){return e=ys(e),(e<16?"0":"")+e.toString(16)}function MO(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Rr(e,t,n,r)}function i9(e){if(e instanceof Rr)return new Rr(e.h,e.s,e.l,e.opacity);if(e instanceof Cc||(e=lc(e)),!e)return new Rr;if(e instanceof Rr)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,l=a-i,c=(a+i)/2;return l?(t===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?a+i:2-a-i,o*=60):l=c>0&&c<1?0:o,new Rr(o,l,c,e.opacity)}function GQ(e,t,n,r){return arguments.length===1?i9(e):new Rr(e,t,n,r??1)}function Rr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ES(Rr,GQ,r9(Cc,{brighter(e){return e=e==null?Kh:Math.pow(Kh,e),new Rr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?sc:Math.pow(sc,e),new Rr(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 Ln(v0(e>=240?e-240:e+120,i,r),v0(e,i,r),v0(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Rr($O(this.h),kd(this.s),kd(this.l),Xh(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(){const e=Xh(this.opacity);return`${e===1?"hsl(":"hsla("}${$O(this.h)}, ${kd(this.s)*100}%, ${kd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function $O(e){return e=(e||0)%360,e<0?e+360:e}function kd(e){return Math.max(0,Math.min(1,e||0))}function v0(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const a9=e=>()=>e;function YQ(e,t){return function(n){return e+n*t}}function ZQ(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function KQ(e){return(e=+e)==1?s9:function(t,n){return n-t?ZQ(t,n,e):a9(isNaN(t)?n:t)}}function s9(e,t){var n=t-e;return n?YQ(e,n):a9(isNaN(e)?t:e)}const DO=function e(t){var n=KQ(t);function r(i,a){var o=n((i=Tw(i)).r,(a=Tw(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),f=s9(i.opacity,a.opacity);return function(d){return i.r=o(d),i.g=l(d),i.b=c(d),i.opacity=f(d),i+""}}return r.gamma=e,r}(1);function Ta(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Cw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_0=new RegExp(Cw.source,"g");function XQ(e){return function(){return e}}function WQ(e){return function(t){return e(t)+""}}function QQ(e,t){var n=Cw.lastIndex=_0.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=Cw.exec(e))&&(i=_0.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:Ta(r,i)})),n=_0.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?WQ(c[0].x):XQ(t):(t=c.length,function(f){for(var d=0,h;d<t;++d)l[(h=c[d]).i]=h.x(f);return l.join("")})}var IO=180/Math.PI,Ow={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function o9(e,t,n,r,i,a){var o,l,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*IO,skewX:Math.atan(c)*IO,scaleX:o,scaleY:l}}var Ad;function JQ(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ow:o9(t.a,t.b,t.c,t.d,t.e,t.f)}function eJ(e){return e==null||(Ad||(Ad=document.createElementNS("http://www.w3.org/2000/svg","g")),Ad.setAttribute("transform",e),!(e=Ad.transform.baseVal.consolidate()))?Ow:(e=e.matrix,o9(e.a,e.b,e.c,e.d,e.e,e.f))}function l9(e,t,n,r){function i(f){return f.length?f.pop()+" ":""}function a(f,d,h,m,g,v){if(f!==h||d!==m){var w=g.push("translate(",null,t,null,n);v.push({i:w-4,x:Ta(f,h)},{i:w-2,x:Ta(d,m)})}else(h||m)&&g.push("translate("+h+t+m+n)}function o(f,d,h,m){f!==d?(f-d>180?d+=360:d-f>180&&(f+=360),m.push({i:h.push(i(h)+"rotate(",null,r)-2,x:Ta(f,d)})):d&&h.push(i(h)+"rotate("+d+r)}function l(f,d,h,m){f!==d?m.push({i:h.push(i(h)+"skewX(",null,r)-2,x:Ta(f,d)}):d&&h.push(i(h)+"skewX("+d+r)}function c(f,d,h,m,g,v){if(f!==h||d!==m){var w=g.push(i(g)+"scale(",null,",",null,")");v.push({i:w-4,x:Ta(f,h)},{i:w-2,x:Ta(d,m)})}else(h!==1||m!==1)&&g.push(i(g)+"scale("+h+","+m+")")}return function(f,d){var h=[],m=[];return f=e(f),d=e(d),a(f.translateX,f.translateY,d.translateX,d.translateY,h,m),o(f.rotate,d.rotate,h,m),l(f.skewX,d.skewX,h,m),c(f.scaleX,f.scaleY,d.scaleX,d.scaleY,h,m),f=d=null,function(g){for(var v=-1,w=m.length,b;++v<w;)h[(b=m[v]).i]=b.x(g);return h.join("")}}}var tJ=l9(JQ,"px, ","px)","deg)"),nJ=l9(eJ,", ",")",")"),rJ=1e-12;function PO(e){return((e=Math.exp(e))+1/e)/2}function iJ(e){return((e=Math.exp(e))-1/e)/2}function aJ(e){return((e=Math.exp(2*e))-1)/(e+1)}const sJ=function e(t,n,r){function i(a,o){var l=a[0],c=a[1],f=a[2],d=o[0],h=o[1],m=o[2],g=d-l,v=h-c,w=g*g+v*v,b,_;if(w<rJ)_=Math.log(m/f)/t,b=function(O){return[l+O*g,c+O*v,f*Math.exp(t*O*_)]};else{var S=Math.sqrt(w),x=(m*m-f*f+r*w)/(2*f*n*S),A=(m*m-f*f-r*w)/(2*m*n*S),k=Math.log(Math.sqrt(x*x+1)-x),T=Math.log(Math.sqrt(A*A+1)-A);_=(T-k)/t,b=function(O){var $=O*_,L=PO(k),M=f/(n*S)*(L*aJ(t*$+k)-iJ(k));return[l+M*g,c+M*v,f*L/PO(t*$+k)]}}return b.duration=_*1e3*t/Math.SQRT2,b}return i.rho=function(a){var o=Math.max(.001,+a),l=o*o,c=l*l;return e(o,l,c)},i}(Math.SQRT2,2,4);var Yo=0,Lu=0,Tu=0,u9=1e3,Wh,zu,Qh=0,xs=0,Cp=0,uc=typeof performance=="object"&&performance.now?performance:Date,c9=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function kS(){return xs||(c9(oJ),xs=uc.now()+Cp)}function oJ(){xs=0}function Jh(){this._call=this._time=this._next=null}Jh.prototype=f9.prototype={constructor:Jh,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?kS():+n)+(t==null?0:+t),!this._next&&zu!==this&&(zu?zu._next=this:Wh=this,zu=this),this._call=e,this._time=n,Nw()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nw())}};function f9(e,t,n){var r=new Jh;return r.restart(e,t,n),r}function lJ(){kS(),++Yo;for(var e=Wh,t;e;)(t=xs-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Yo}function LO(){xs=(Qh=uc.now())+Cp,Yo=Lu=0;try{lJ()}finally{Yo=0,cJ(),xs=0}}function uJ(){var e=uc.now(),t=e-Qh;t>u9&&(Cp-=t,Qh=e)}function cJ(){for(var e,t=Wh,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:Wh=n);zu=e,Nw(r)}function Nw(e){if(!Yo){Lu&&(Lu=clearTimeout(Lu));var t=e-xs;t>24?(e<1/0&&(Lu=setTimeout(LO,e-uc.now()-Cp)),Tu&&(Tu=clearInterval(Tu))):(Tu||(Qh=uc.now(),Tu=setInterval(uJ,u9)),Yo=1,c9(LO))}}function zO(e,t,n){var r=new Jh;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var fJ=Ap("start","end","cancel","interrupt"),dJ=[],d9=0,qO=1,Rw=2,kh=3,FO=4,jw=5,Ah=6;function Op(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;hJ(e,n,{name:t,index:r,group:i,on:fJ,tween:dJ,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:d9})}function AS(e,t){var n=Pr(e,t);if(n.state>d9)throw new Error("too late; already scheduled");return n}function ti(e,t){var n=Pr(e,t);if(n.state>kh)throw new Error("too late; already running");return n}function Pr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function hJ(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=f9(a,0,n.time);function a(f){n.state=qO,n.timer.restart(o,n.delay,n.time),n.delay<=f&&o(f-n.delay)}function o(f){var d,h,m,g;if(n.state!==qO)return c();for(d in r)if(g=r[d],g.name===n.name){if(g.state===kh)return zO(o);g.state===FO?(g.state=Ah,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[d]):+d<t&&(g.state=Ah,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[d])}if(zO(function(){n.state===kh&&(n.state=FO,n.timer.restart(l,n.delay,n.time),l(f))}),n.state=Rw,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Rw){for(n.state=kh,i=new Array(m=n.tween.length),d=0,h=-1;d<m;++d)(g=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=g);i.length=h+1}}function l(f){for(var d=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=jw,1),h=-1,m=i.length;++h<m;)i[h].call(e,d);n.state===jw&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Ah,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Th(e,t){var n=e.__transition,r,i,a=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>Rw&&r.state<jw,r.state=Ah,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function pJ(e){return this.each(function(){Th(this,e)})}function mJ(e,t){var n,r;return function(){var i=ti(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,l=r.length;o<l;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function gJ(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=ti(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var l={name:t,value:n},c=0,f=i.length;c<f;++c)if(i[c].name===t){i[c]=l;break}c===f&&i.push(l)}a.tween=i}}function yJ(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Pr(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?mJ:gJ)(n,e,t))}function TS(e,t,n){var r=e._id;return e.each(function(){var i=ti(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Pr(i,r).value[t]}}function h9(e,t){var n;return(typeof t=="number"?Ta:t instanceof lc?DO:(n=lc(t))?(t=n,DO):QQ)(e,t)}function bJ(e){return function(){this.removeAttribute(e)}}function vJ(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _J(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 xJ(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 wJ(e,t,n){var r,i,a;return function(){var o,l=n(this),c;return l==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=l+"",o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l)))}}function SJ(e,t,n){var r,i,a;return function(){var o,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=l+"",o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l)))}}function EJ(e,t){var n=Tp(e),r=n==="transform"?nJ:h9;return this.attrTween(e,typeof t=="function"?(n.local?SJ:wJ)(n,r,TS(this,"attr."+e,t)):t==null?(n.local?vJ:bJ)(n):(n.local?xJ:_J)(n,r,t))}function kJ(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function AJ(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function TJ(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&AJ(e,a)),n}return i._value=t,i}function CJ(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&kJ(e,a)),n}return i._value=t,i}function OJ(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 new Error;var r=Tp(e);return this.tween(n,(r.local?TJ:CJ)(r,t))}function NJ(e,t){return function(){AS(this,e).delay=+t.apply(this,arguments)}}function RJ(e,t){return t=+t,function(){AS(this,e).delay=t}}function jJ(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?NJ:RJ)(t,e)):Pr(this.node(),t).delay}function MJ(e,t){return function(){ti(this,e).duration=+t.apply(this,arguments)}}function $J(e,t){return t=+t,function(){ti(this,e).duration=t}}function DJ(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?MJ:$J)(t,e)):Pr(this.node(),t).duration}function IJ(e,t){if(typeof t!="function")throw new Error;return function(){ti(this,e).ease=t}}function PJ(e){var t=this._id;return arguments.length?this.each(IJ(t,e)):Pr(this.node(),t).ease}function LJ(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ti(this,e).ease=n}}function zJ(e){if(typeof e!="function")throw new Error;return this.each(LJ(this._id,e))}function qJ(e){typeof e!="function"&&(e=V5(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=[],c,f=0;f<o;++f)(c=a[f])&&e.call(c,c.__data__,f,a)&&l.push(c);return new $i(r,this._parents,this._name,this._id)}function FJ(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=new Array(r),l=0;l<a;++l)for(var c=t[l],f=n[l],d=c.length,h=o[l]=new Array(d),m,g=0;g<d;++g)(m=c[g]||f[g])&&(h[g]=m);for(;l<r;++l)o[l]=t[l];return new $i(o,this._parents,this._name,this._id)}function BJ(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function UJ(e,t,n){var r,i,a=BJ(t)?AS:ti;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function VJ(e,t){var n=this._id;return arguments.length<2?Pr(this.node(),n).on.on(e):this.each(UJ(n,e,t))}function HJ(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function GJ(){return this.on("end.remove",HJ(this._id))}function YJ(e){var t=this._name,n=this._id;typeof e!="function"&&(e=wS(e));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var l=r[o],c=l.length,f=a[o]=new Array(c),d,h,m=0;m<c;++m)(d=l[m])&&(h=e.call(d,d.__data__,m,l))&&("__data__"in d&&(h.__data__=d.__data__),f[m]=h,Op(f[m],t,n,m,f,Pr(d,n)));return new $i(a,this._parents,t,n)}function ZJ(e){var t=this._name,n=this._id;typeof e!="function"&&(e=U5(e));for(var r=this._groups,i=r.length,a=[],o=[],l=0;l<i;++l)for(var c=r[l],f=c.length,d,h=0;h<f;++h)if(d=c[h]){for(var m=e.call(d,d.__data__,h,c),g,v=Pr(d,n),w=0,b=m.length;w<b;++w)(g=m[w])&&Op(g,t,n,w,m,v);a.push(m),o.push(d)}return new $i(a,o,t,n)}var KJ=Tc.prototype.constructor;function XJ(){return new KJ(this._groups,this._parents)}function WJ(e,t){var n,r,i;return function(){var a=Go(this,e),o=(this.style.removeProperty(e),Go(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function p9(e){return function(){this.style.removeProperty(e)}}function QJ(e,t,n){var r,i=n+"",a;return function(){var o=Go(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function JJ(e,t,n){var r,i,a;return function(){var o=Go(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),Go(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l))}}function eee(e,t){var n,r,i,a="style."+t,o="end."+a,l;return function(){var c=ti(this,e),f=c.on,d=c.value[a]==null?l||(l=p9(t)):void 0;(f!==n||i!==d)&&(r=(n=f).copy()).on(o,i=d),c.on=r}}function tee(e,t,n){var r=(e+="")=="transform"?tJ:h9;return t==null?this.styleTween(e,WJ(e,r)).on("end.style."+e,p9(e)):typeof t=="function"?this.styleTween(e,JJ(e,r,TS(this,"style."+e,t))).each(eee(this._id,e)):this.styleTween(e,QJ(e,r,t),n).on("end.style."+e,null)}function nee(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function ree(e,t,n){var r,i;function a(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&nee(e,o,n)),r}return a._value=t,a}function iee(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 new Error;return this.tween(r,ree(e,t,n??""))}function aee(e){return function(){this.textContent=e}}function see(e){return function(){var t=e(this);this.textContent=t??""}}function oee(e){return this.tween("text",typeof e=="function"?see(TS(this,"text",e)):aee(e==null?"":e+""))}function lee(e){return function(t){this.textContent=e.call(this,t)}}function uee(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&lee(i)),t}return r._value=e,r}function cee(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 new Error;return this.tween(t,uee(e))}function fee(){for(var e=this._name,t=this._id,n=m9(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,c,f=0;f<l;++f)if(c=o[f]){var d=Pr(c,t);Op(c,e,n,f,o,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new $i(r,this._parents,e,n)}function dee(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var l={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var f=ti(this,r),d=f.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),f.on=t}),i===0&&a()})}var hee=0;function $i(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function m9(){return++hee}var Si=Tc.prototype;$i.prototype={constructor:$i,select:YJ,selectAll:ZJ,selectChild:Si.selectChild,selectChildren:Si.selectChildren,filter:qJ,merge:FJ,selection:XJ,transition:fee,call:Si.call,nodes:Si.nodes,node:Si.node,size:Si.size,empty:Si.empty,each:Si.each,on:VJ,attr:EJ,attrTween:OJ,style:tee,styleTween:iee,text:oee,textTween:cee,remove:GJ,tween:yJ,delay:jJ,duration:DJ,ease:PJ,easeVarying:zJ,end:dee,[Symbol.iterator]:Si[Symbol.iterator]};function pee(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var mee={time:null,delay:0,duration:250,ease:pee};function gee(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function yee(e){var t,n;e instanceof $i?(t=e._id,e=e._name):(t=m9(),(n=mee).time=kS(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,c,f=0;f<l;++f)(c=o[f])&&Op(c,e,t,f,o,n||gee(c,t));return new $i(r,this._parents,e,t)}Tc.prototype.interrupt=pJ;Tc.prototype.transition=yee;const Td=e=>()=>e;function bee(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 Ci(e,t,n){this.k=e,this.x=t,this.y=n}Ci.prototype={constructor:Ci,scale:function(e){return e===1?this:new Ci(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ci(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 Np=new Ci(1,0,0);g9.prototype=Ci.prototype;function g9(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Np;return e.__zoom}function x0(e){e.stopImmediatePropagation()}function Cu(e){e.preventDefault(),e.stopImmediatePropagation()}function vee(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function _ee(){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 BO(){return this.__zoom||Np}function xee(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function wee(){return navigator.maxTouchPoints||"ontouchstart"in this}function See(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 y9(){var e=vee,t=_ee,n=See,r=xee,i=wee,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=sJ,f=Ap("start","zoom","end"),d,h,m,g=500,v=150,w=0,b=10;function _(D){D.property("__zoom",BO).on("wheel.zoom",$,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",M).filter(i).on("touchstart.zoom",z).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(D,H,B,G){var K=D.selection?D.selection():D;K.property("__zoom",BO),D!==K?k(D,H,B,G):K.interrupt().each(function(){T(this,arguments).event(G).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},_.scaleBy=function(D,H,B,G){_.scaleTo(D,function(){var K=this.__zoom.k,Q=typeof H=="function"?H.apply(this,arguments):H;return K*Q},B,G)},_.scaleTo=function(D,H,B,G){_.transform(D,function(){var K=t.apply(this,arguments),Q=this.__zoom,R=B==null?A(K):typeof B=="function"?B.apply(this,arguments):B,V=Q.invert(R),X=typeof H=="function"?H.apply(this,arguments):H;return n(x(S(Q,X),R,V),K,o)},B,G)},_.translateBy=function(D,H,B,G){_.transform(D,function(){return n(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof B=="function"?B.apply(this,arguments):B),t.apply(this,arguments),o)},null,G)},_.translateTo=function(D,H,B,G,K){_.transform(D,function(){var Q=t.apply(this,arguments),R=this.__zoom,V=G==null?A(Q):typeof G=="function"?G.apply(this,arguments):G;return n(Np.translate(V[0],V[1]).scale(R.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof B=="function"?-B.apply(this,arguments):-B),Q,o)},G,K)};function S(D,H){return H=Math.max(a[0],Math.min(a[1],H)),H===D.k?D:new Ci(H,D.x,D.y)}function x(D,H,B){var G=H[0]-B[0]*D.k,K=H[1]-B[1]*D.k;return G===D.x&&K===D.y?D:new Ci(D.k,G,K)}function A(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function k(D,H,B,G){D.on("start.zoom",function(){T(this,arguments).event(G).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(G).end()}).tween("zoom",function(){var K=this,Q=arguments,R=T(K,Q).event(G),V=t.apply(K,Q),X=B==null?A(V):typeof B=="function"?B.apply(K,Q):B,j=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),I=K.__zoom,U=typeof H=="function"?H.apply(K,Q):H,Y=c(I.invert(X).concat(j/I.k),U.invert(X).concat(j/U.k));return function(ne){if(ne===1)ne=U;else{var ae=Y(ne),re=j/ae[2];ne=new Ci(re,X[0]-ae[0]*re,X[1]-ae[1]*re)}R.zoom(null,ne)}})}function T(D,H,B){return!B&&D.__zooming||new O(D,H)}function O(D,H){this.that=D,this.args=H,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,H),this.taps=0}O.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,H){return this.mouse&&D!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var H=er(this.that).datum();f.call(D,this.that,new bee(D,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:f}),H)}};function $(D,...H){if(!e.apply(this,arguments))return;var B=T(this,H).event(D),G=this.__zoom,K=Math.max(a[0],Math.min(a[1],G.k*Math.pow(2,r.apply(this,arguments)))),Q=Nr(D);if(B.wheel)(B.mouse[0][0]!==Q[0]||B.mouse[0][1]!==Q[1])&&(B.mouse[1]=G.invert(B.mouse[0]=Q)),clearTimeout(B.wheel);else{if(G.k===K)return;B.mouse=[Q,G.invert(Q)],Th(this),B.start()}Cu(D),B.wheel=setTimeout(R,v),B.zoom("mouse",n(x(S(G,K),B.mouse[0],B.mouse[1]),B.extent,o));function R(){B.wheel=null,B.end()}}function L(D,...H){if(m||!e.apply(this,arguments))return;var B=D.currentTarget,G=T(this,H,!0).event(D),K=er(D.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",j,!0),Q=Nr(D,B),R=D.clientX,V=D.clientY;e9(D.view),x0(D),G.mouse=[Q,this.__zoom.invert(Q)],Th(this),G.start();function X(I){if(Cu(I),!G.moved){var U=I.clientX-R,Y=I.clientY-V;G.moved=U*U+Y*Y>w}G.event(I).zoom("mouse",n(x(G.that.__zoom,G.mouse[0]=Nr(I,B),G.mouse[1]),G.extent,o))}function j(I){K.on("mousemove.zoom mouseup.zoom",null),t9(I.view,G.moved),Cu(I),G.event(I).end()}}function M(D,...H){if(e.apply(this,arguments)){var B=this.__zoom,G=Nr(D.changedTouches?D.changedTouches[0]:D,this),K=B.invert(G),Q=B.k*(D.shiftKey?.5:2),R=n(x(S(B,Q),G,K),t.apply(this,H),o);Cu(D),l>0?er(this).transition().duration(l).call(k,R,G,D):er(this).call(_.transform,R,G,D)}}function z(D,...H){if(e.apply(this,arguments)){var B=D.touches,G=B.length,K=T(this,H,D.changedTouches.length===G).event(D),Q,R,V,X;for(x0(D),R=0;R<G;++R)V=B[R],X=Nr(V,this),X=[X,this.__zoom.invert(X),V.identifier],K.touch0?!K.touch1&&K.touch0[2]!==X[2]&&(K.touch1=X,K.taps=0):(K.touch0=X,Q=!0,K.taps=1+!!d);d&&(d=clearTimeout(d)),Q&&(K.taps<2&&(h=X[0],d=setTimeout(function(){d=null},g)),Th(this),K.start())}}function P(D,...H){if(this.__zooming){var B=T(this,H).event(D),G=D.changedTouches,K=G.length,Q,R,V,X;for(Cu(D),Q=0;Q<K;++Q)R=G[Q],V=Nr(R,this),B.touch0&&B.touch0[2]===R.identifier?B.touch0[0]=V:B.touch1&&B.touch1[2]===R.identifier&&(B.touch1[0]=V);if(R=B.that.__zoom,B.touch1){var j=B.touch0[0],I=B.touch0[1],U=B.touch1[0],Y=B.touch1[1],ne=(ne=U[0]-j[0])*ne+(ne=U[1]-j[1])*ne,ae=(ae=Y[0]-I[0])*ae+(ae=Y[1]-I[1])*ae;R=S(R,Math.sqrt(ne/ae)),V=[(j[0]+U[0])/2,(j[1]+U[1])/2],X=[(I[0]+Y[0])/2,(I[1]+Y[1])/2]}else if(B.touch0)V=B.touch0[0],X=B.touch0[1];else return;B.zoom("touch",n(x(R,V,X),B.extent,o))}}function q(D,...H){if(this.__zooming){var B=T(this,H).event(D),G=D.changedTouches,K=G.length,Q,R;for(x0(D),m&&clearTimeout(m),m=setTimeout(function(){m=null},g),Q=0;Q<K;++Q)R=G[Q],B.touch0&&B.touch0[2]===R.identifier?delete B.touch0:B.touch1&&B.touch1[2]===R.identifier&&delete B.touch1;if(B.touch1&&!B.touch0&&(B.touch0=B.touch1,delete B.touch1),B.touch0)B.touch0[1]=this.__zoom.invert(B.touch0[0]);else if(B.end(),B.taps===2&&(R=Nr(R,this),Math.hypot(h[0]-R[0],h[1]-R[1])<b)){var V=er(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return _.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:Td(+D),_):r},_.filter=function(D){return arguments.length?(e=typeof D=="function"?D:Td(!!D),_):e},_.touchable=function(D){return arguments.length?(i=typeof D=="function"?D:Td(!!D),_):i},_.extent=function(D){return arguments.length?(t=typeof D=="function"?D:Td([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),_):t},_.scaleExtent=function(D){return arguments.length?(a[0]=+D[0],a[1]=+D[1],_):[a[0],a[1]]},_.translateExtent=function(D){return arguments.length?(o[0][0]=+D[0][0],o[1][0]=+D[1][0],o[0][1]=+D[0][1],o[1][1]=+D[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(D){return arguments.length?(n=D,_):n},_.duration=function(D){return arguments.length?(l=+D,_):l},_.interpolate=function(D){return arguments.length?(c=D,_):c},_.on=function(){var D=f.on.apply(f,arguments);return D===f?_:D},_.clickDistance=function(D){return arguments.length?(w=(D=+D)*D,_):Math.sqrt(w)},_.tapDistance=function(D){return arguments.length?(b=+D,_):b},_}const Jr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.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 React Flow 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."},cc=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],b9=["Enter"," ","Escape"];var Zo;(function(e){e.Strict="strict",e.Loose="loose"})(Zo||(Zo={}));var bs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(bs||(bs={}));var fc;(function(e){e.Partial="partial",e.Full="full"})(fc||(fc={}));const v9={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Ca;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ca||(Ca={}));var ep;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ep||(ep={}));var Pe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Pe||(Pe={}));const UO={[Pe.Left]:Pe.Right,[Pe.Right]:Pe.Left,[Pe.Top]:Pe.Bottom,[Pe.Bottom]:Pe.Top};function _9(e){return e===null?null:e?"valid":"invalid"}const x9=e=>"id"in e&&"source"in e&&"target"in e,Eee=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),CS=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Oc=(e,t=[0,0])=>{const{width:n,height:r}=zi(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},kee=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const a=typeof i=="string";let o=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(o=a?t.nodeLookup.get(i):CS(i)?i:t.nodeLookup.get(i.id));const l=o?tp(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Rp(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return jp(n)},Nc=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const i=tp(r);n=Rp(n,i)}}),jp(n)},w9=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l={...Rc(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(const f of e.values()){const{measured:d,selectable:h=!0,hidden:m=!1}=f;if(o&&!h||m)continue;const g=d.width??f.width??f.initialWidth??null,v=d.height??f.height??f.initialHeight??null,w=dc(l,Xo(f)),b=(g??0)*(v??0),_=a&&w>0;(!f.internals.handleBounds||_||w>=b||f.dragging)&&c.push(f)}return c},Aee=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Tee(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function Cee({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);const l=Tee(e,o),c=Nc(l),f=OS(c,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??a,(o==null?void 0:o.padding)??.1);return await r.setViewport(f,{duration:o==null?void 0:o.duration}),Promise.resolve(!0)}function S9({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:f}=l?l.internals.positionAbsolute:{x:0,y:0},d=o.origin??r;let h=i;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",Jr.error005());else{const g=l.measured.width,v=l.measured.height;g&&v&&(h=[[c,f],[c+g,f+v]])}else l&&Wo(o.extent)&&(h=[[o.extent[0][0]+c,o.extent[0][1]+f],[o.extent[1][0]+c,o.extent[1][1]+f]]);const m=Wo(h)?ws(t,h,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",Jr.error015())),{position:{x:m.x-c+(o.measured.width??0)*d[0],y:m.y-f+(o.measured.height??0)*d[1]},positionAbsolute:m}}async function Oee({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const a=new Set(e.map(m=>m.id)),o=[];for(const m of n){if(m.deletable===!1)continue;const g=a.has(m.id),v=!g&&m.parentId&&o.find(w=>w.id===m.parentId);(g||v)&&o.push(m)}const l=new Set(t.map(m=>m.id)),c=r.filter(m=>m.deletable!==!1),d=Aee(o,c);for(const m of c)l.has(m.id)&&!d.find(v=>v.id===m.id)&&d.push(m);if(!i)return{edges:d,nodes:o};const h=await i({nodes:o,edges:d});return typeof h=="boolean"?h?{edges:d,nodes:o}:{edges:[],nodes:[]}:h}const Ko=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ws=(e={x:0,y:0},t,n)=>({x:Ko(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ko(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function E9(e,t,n){const{width:r,height:i}=zi(n),{x:a,y:o}=n.internals.positionAbsolute;return ws(e,[[a,o],[a+r,o+i]],t)}const VO=(e,t,n)=>e<t?Ko(Math.abs(e-t),1,t)/t:e>n?-Ko(Math.abs(e-n),1,t)/t:0,k9=(e,t,n=15,r=40)=>{const i=VO(e.x,r,t.width-r)*n,a=VO(e.y,r,t.height-r)*n;return[i,a]},Rp=(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)}),Mw=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),jp=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Xo=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=CS(e)?e.internals.positionAbsolute:Oc(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},tp=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=CS(e)?e.internals.positionAbsolute:Oc(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},A9=(e,t)=>jp(Rp(Mw(e),Mw(t))),dc=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},HO=e=>jr(e.width)&&jr(e.height)&&jr(e.x)&&jr(e.y),jr=e=>!isNaN(e)&&isFinite(e),Nee=(e,t)=>{},Mp=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Rc=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?Mp(l,o):l},np=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function To(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Ree(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=To(e,n),i=To(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=To(e.top??e.y??0,n),i=To(e.bottom??e.y??0,n),a=To(e.left??e.x??0,t),o=To(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 jee(e,t,n,r,i,a){const{x:o,y:l}=np(e,[t,n,r]),{x:c,y:f}=np({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=i-c,h=a-f;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(h)}}const OS=(e,t,n,r,i,a)=>{const o=Ree(a,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,f=Math.min(l,c),d=Ko(f,r,i),h=e.x+e.width/2,m=e.y+e.height/2,g=t/2-h*d,v=n/2-m*d,w=jee(e,g,v,d,t,n),b={left:Math.min(w.left-o.left,0),top:Math.min(w.top-o.top,0),right:Math.min(w.right-o.right,0),bottom:Math.min(w.bottom-o.bottom,0)};return{x:g-b.left+b.right,y:v-b.top+b.bottom,zoom:d}},rp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Wo(e){return e!==void 0&&e!=="parent"}function zi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function T9(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function C9(e,t={width:0,height:0},n,r,i){const a={...e},o=r.get(n);if(o){const l=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return a}function GO(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Mee(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function Gu(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=Ri(e),l=Rc({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:c,y:f}=n?Mp(l,t):l;return{xSnapped:c,ySnapped:f,...l}}const NS=e=>({width:e.offsetWidth,height:e.offsetHeight}),O9=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},$ee=["INPUT","SELECT","TEXTAREA"];function N9(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:$ee.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const R9=e=>"clientX"in e,Ri=(e,t)=>{var a,o;const n=R9(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},YO=(e,t,n,r,i)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...NS(o)}})};function j9({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:l}){const c=e*.125+i*.375+o*.375+n*.125,f=t*.125+a*.375+l*.375+r*.125,d=Math.abs(c-e),h=Math.abs(f-t);return[c,f,d,h]}function Cd(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ZO({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Pe.Left:return[t-Cd(t-r,a),n];case Pe.Right:return[t+Cd(r-t,a),n];case Pe.Top:return[t,n-Cd(n-i,a)];case Pe.Bottom:return[t,n+Cd(i-n,a)]}}function M9({sourceX:e,sourceY:t,sourcePosition:n=Pe.Bottom,targetX:r,targetY:i,targetPosition:a=Pe.Top,curvature:o=.25}){const[l,c]=ZO({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[f,d]=ZO({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[h,m,g,v]=j9({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:f,targetControlY:d});return[`M${e},${t} C${l},${c} ${f},${d} ${r},${i}`,h,m,g,v]}function $9({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2,l=r<t?r+o:r-o;return[a,l,i,o]}function Dee({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1}){if(!i)return r;const a=n||t.selected||e.selected,o=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(a?o:0)}function Iee({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const a=Rp(tp(e),tp(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const o={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return dc(o,jp(a))>0}const Pee=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Lee=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),zee=(e,t)=>{if(!e.source||!e.target)return t;let n;return x9(e)?n={...e}:n={...e,id:Pee(e)},Lee(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function D9({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=$9({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const KO={[Pe.Left]:{x:-1,y:0},[Pe.Right]:{x:1,y:0},[Pe.Top]:{x:0,y:-1},[Pe.Bottom]:{x:0,y:1}},qee=({source:e,sourcePosition:t=Pe.Bottom,target:n})=>t===Pe.Left||t===Pe.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},XO=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Fee({source:e,sourcePosition:t=Pe.Bottom,target:n,targetPosition:r=Pe.Top,center:i,offset:a}){const o=KO[t],l=KO[r],c={x:e.x+o.x*a,y:e.y+o.y*a},f={x:n.x+l.x*a,y:n.y+l.y*a},d=qee({source:c,sourcePosition:t,target:f}),h=d.x!==0?"x":"y",m=d[h];let g=[],v,w;const b={x:0,y:0},_={x:0,y:0},[S,x,A,k]=$9({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[h]*l[h]===-1){v=i.x??S,w=i.y??x;const O=[{x:v,y:c.y},{x:v,y:f.y}],$=[{x:c.x,y:w},{x:f.x,y:w}];o[h]===m?g=h==="x"?O:$:g=h==="x"?$:O}else{const O=[{x:c.x,y:f.y}],$=[{x:f.x,y:c.y}];if(h==="x"?g=o.x===m?$:O:g=o.y===m?O:$,t===r){const q=Math.abs(e[h]-n[h]);if(q<=a){const D=Math.min(a-1,a-q);o[h]===m?b[h]=(c[h]>e[h]?-1:1)*D:_[h]=(f[h]>n[h]?-1:1)*D}}if(t!==r){const q=h==="x"?"y":"x",D=o[h]===l[q],H=c[q]>f[q],B=c[q]<f[q];(o[h]===1&&(!D&&H||D&&B)||o[h]!==1&&(!D&&B||D&&H))&&(g=h==="x"?O:$)}const L={x:c.x+b.x,y:c.y+b.y},M={x:f.x+_.x,y:f.y+_.y},z=Math.max(Math.abs(L.x-g[0].x),Math.abs(M.x-g[0].x)),P=Math.max(Math.abs(L.y-g[0].y),Math.abs(M.y-g[0].y));z>=P?(v=(L.x+M.x)/2,w=g[0].y):(v=g[0].x,w=(L.y+M.y)/2)}return[[e,{x:c.x+b.x,y:c.y+b.y},...g,{x:f.x+_.x,y:f.y+_.y},n],v,w,A,k]}function Bee(e,t,n,r){const i=Math.min(XO(e,t)/2,XO(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){const f=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${a+i*f},${o}Q ${a},${o} ${a},${o+i*d}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${a},${o+i*c}Q ${a},${o} ${a+i*l},${o}`}function $w({sourceX:e,sourceY:t,sourcePosition:n=Pe.Bottom,targetX:r,targetY:i,targetPosition:a=Pe.Top,borderRadius:o=5,centerX:l,centerY:c,offset:f=20}){const[d,h,m,g,v]=Fee({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:l,y:c},offset:f});return[d.reduce((b,_,S)=>{let x="";return S>0&&S<d.length-1?x=Bee(d[S-1],_,d[S+1],o):x=`${S===0?"M":"L"}${_.x} ${_.y}`,b+=x,b},""),h,m,g,v]}function WO(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Uee(e){var h;const{sourceNode:t,targetNode:n}=e;if(!WO(t)||!WO(n))return null;const r=t.internals.handleBounds||QO(t.handles),i=n.internals.handleBounds||QO(n.handles),a=JO((r==null?void 0:r.source)??[],e.sourceHandle),o=JO(e.connectionMode===Zo.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!a||!o)return(h=e.onError)==null||h.call(e,"008",Jr.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(a==null?void 0:a.position)||Pe.Bottom,c=(o==null?void 0:o.position)||Pe.Top,f=hc(t,a,l),d=hc(n,o,c);return{sourceX:f.x,sourceY:f.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}}function QO(e){if(!e)return null;const t=[],n=[];for(const 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 hc(e,t,n=Pe.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:l}=t??zi(e);if(r)return{x:i+o/2,y:a+l/2};switch((t==null?void 0:t.position)??n){case Pe.Top:return{x:i+o/2,y:a};case Pe.Right:return{x:i+o,y:a+l/2};case Pe.Bottom:return{x:i+o/2,y:a+l};case Pe.Left:return{x:i,y:a+l/2}}}function JO(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Dw(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Vee(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const a=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){const f=Dw(c,t);a.has(f)||(o.push({id:f,color:c.color||n,...c}),a.add(f))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const RS={nodeOrigin:[0,0],nodeExtent:cc,elevateNodesOnSelect:!0,defaults:{}},Hee={...RS,checkEquality:!0};function jS(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Gee(e,t,n){const r=jS(RS,n);for(const i of e.values())if(i.parentId)MS(i,e,t,r);else{const a=Oc(i,r.nodeOrigin),o=Wo(i.extent)?i.extent:r.nodeExtent,l=ws(a,o,zi(i));i.internals.positionAbsolute=l}}function Iw(e,t,n,r){var c,f;const i=jS(Hee,r);let a=e.length>0;const o=new Map(t),l=i!=null&&i.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const d of e){let h=o.get(d.id);if(i.checkEquality&&d===(h==null?void 0:h.internals.userNode))t.set(d.id,h);else{const m=Oc(d,i.nodeOrigin),g=Wo(d.extent)?d.extent:i.nodeExtent,v=ws(m,g,zi(d));h={...i.defaults,...d,measured:{width:(c=d.measured)==null?void 0:c.width,height:(f=d.measured)==null?void 0:f.height},internals:{positionAbsolute:v,handleBounds:d.measured?h==null?void 0:h.internals.handleBounds:void 0,z:I9(d,l),userNode:d}},t.set(d.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(a=!1),d.parentId&&MS(h,t,n,r)}return a}function Yee(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function MS(e,t,n,r){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o}=jS(RS,r),l=e.parentId,c=t.get(l);if(!c){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}Yee(e,n);const f=i?1e3:0,{x:d,y:h,z:m}=Zee(e,c,a,o,f),{positionAbsolute:g}=e.internals,v=d!==g.x||h!==g.y;(v||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:d,y:h}:g,z:m}})}function I9(e,t){return(jr(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Zee(e,t,n,r,i){const{x:a,y:o}=t.internals.positionAbsolute,l=zi(e),c=Oc(e,n),f=Wo(e.extent)?ws(c,e.extent,l):c;let d=ws({x:a+f.x,y:o+f.y},r,l);e.extent==="parent"&&(d=E9(d,l,t));const h=I9(e,i),m=t.internals.z??0;return{x:d.x,y:d.y,z:m>h?m:h}}function $S(e,t,n,r=[0,0]){var o;const i=[],a=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const f=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??Xo(c),d=A9(f,l.rect);a.set(l.parentId,{expandedRect:d,parent:c})}return a.size>0&&a.forEach(({expandedRect:l,parent:c},f)=>{var x;const d=c.internals.positionAbsolute,h=zi(c),m=c.origin??r,g=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,v=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,w=Math.max(h.width,Math.round(l.width)),b=Math.max(h.height,Math.round(l.height)),_=(w-h.width)*m[0],S=(b-h.height)*m[1];(g>0||v>0||_||S)&&(i.push({id:f,type:"position",position:{x:c.position.x-g+_,y:c.position.y-v+S}}),(x=n.get(f))==null||x.forEach(A=>{e.some(k=>k.id===A.id)||i.push({id:A.id,type:"position",position:{x:A.position.x+g,y:A.position.y+v}})})),(h.width<l.width||h.height<l.height||g||v)&&i.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:w+(g?m[0]*g-_:0),height:b+(v?m[1]*v-S:0)}})}),i}function Kee(e,t,n,r,i,a){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!o)return{changes:[],updatedInternals:l};const c=[],f=window.getComputedStyle(o),{m22:d}=new window.DOMMatrixReadOnly(f.transform),h=[];for(const m of e.values()){const g=t.get(m.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),l=!0;continue}const v=NS(m.nodeElement),w=g.measured.width!==v.width||g.measured.height!==v.height;if(!!(v.width&&v.height&&(w||!g.internals.handleBounds||m.force))){const _=m.nodeElement.getBoundingClientRect(),S=Wo(g.extent)?g.extent:a;let{positionAbsolute:x}=g.internals;g.parentId&&g.extent==="parent"?x=E9(x,v,t.get(g.parentId)):S&&(x=ws(x,S,v));const A={...g,measured:v,internals:{...g.internals,positionAbsolute:x,handleBounds:{source:YO("source",m.nodeElement,_,d,g.id),target:YO("target",m.nodeElement,_,d,g.id)}}};t.set(g.id,A),g.parentId&&MS(A,t,n,{nodeOrigin:i}),l=!0,w&&(c.push({id:g.id,type:"dimensions",dimensions:v}),g.expandParent&&g.parentId&&h.push({id:g.id,parentId:g.parentId,rect:Xo(A,i)}))}}if(h.length>0){const m=$S(h,t,n,i);c.push(...m)}return{changes:c,updatedInternals:l}}async function Xee({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function eN(e,t,n,r,i,a){let o=i;const l=r.get(o)||new Map;r.set(o,l.set(n,t)),o=`${i}-${e}`;const c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;const f=r.get(o)||new Map;r.set(o,f.set(n,t))}}function P9(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:a,sourceHandle:o=null,targetHandle:l=null}=r,c={edgeId:r.id,source:i,target:a,sourceHandle:o,targetHandle:l},f=`${i}-${o}--${a}-${l}`,d=`${a}-${l}--${i}-${o}`;eN("source",c,d,e,i,o),eN("target",c,f,e,a,l),t.set(r.id,r)}}function L9(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:L9(n,t):!1}function tN(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Wee(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!L9(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(a);l&&i.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function w0({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,c;const i=[];for(const[f,d]of t){const h=(o=n.get(f))==null?void 0:o.internals.userNode;h&&i.push({...h,position:d.position,dragging:r})}if(!e)return[i[0],i];const a=(l=n.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((c=t.get(e))==null?void 0:c.position)||a.position,dragging:r}:i[0],i]}function Qee({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,l=new Map,c=!1,f={x:0,y:0},d=null,h=!1,m=null,g=!1;function v({noDragClassName:b,handleSelector:_,domNode:S,isSelectable:x,nodeId:A,nodeClickDistance:k=0}){m=er(S);function T({x:M,y:z},P){const{nodeLookup:q,nodeExtent:D,snapGrid:H,snapToGrid:B,nodeOrigin:G,onNodeDrag:K,onSelectionDrag:Q,onError:R,updateNodePositions:V}=t();a={x:M,y:z};let X=!1,j={x:0,y:0,x2:0,y2:0};if(l.size>1&&D){const I=Nc(l);j=Mw(I)}for(const[I,U]of l){if(!q.has(I))continue;let Y={x:M-U.distance.x,y:z-U.distance.y};B&&(Y=Mp(Y,H));let ne=[[D[0][0],D[0][1]],[D[1][0],D[1][1]]];if(l.size>1&&D&&!U.extent){const{positionAbsolute:le}=U.internals,W=le.x-j.x+D[0][0],J=le.x+U.measured.width-j.x2+D[1][0],se=le.y-j.y+D[0][1],fe=le.y+U.measured.height-j.y2+D[1][1];ne=[[W,se],[J,fe]]}const{position:ae,positionAbsolute:re}=S9({nodeId:I,nextPosition:Y,nodeLookup:q,nodeExtent:ne,nodeOrigin:G,onError:R});X=X||U.position.x!==ae.x||U.position.y!==ae.y,U.position=ae,U.internals.positionAbsolute=re}if(X&&(V(l,!0),P&&(r||K||!A&&Q))){const[I,U]=w0({nodeId:A,dragItems:l,nodeLookup:q});r==null||r(P,l,I,U),K==null||K(P,I,U),A||Q==null||Q(P,U)}}async function O(){if(!d)return;const{transform:M,panBy:z,autoPanSpeed:P,autoPanOnNodeDrag:q}=t();if(!q){c=!1,cancelAnimationFrame(o);return}const[D,H]=k9(f,d,P);(D!==0||H!==0)&&(a.x=(a.x??0)-D/M[2],a.y=(a.y??0)-H/M[2],await z({x:D,y:H})&&T(a,null)),o=requestAnimationFrame(O)}function $(M){var X;const{nodeLookup:z,multiSelectionActive:P,nodesDraggable:q,transform:D,snapGrid:H,snapToGrid:B,selectNodesOnDrag:G,onNodeDragStart:K,onSelectionDragStart:Q,unselectNodesAndEdges:R}=t();h=!0,(!G||!x)&&!P&&A&&((X=z.get(A))!=null&&X.selected||R()),x&&G&&A&&(e==null||e(A));const V=Gu(M.sourceEvent,{transform:D,snapGrid:H,snapToGrid:B,containerBounds:d});if(a=V,l=Wee(z,q,V,A),l.size>0&&(n||K||!A&&Q)){const[j,I]=w0({nodeId:A,dragItems:l,nodeLookup:z});n==null||n(M.sourceEvent,l,j,I),K==null||K(M.sourceEvent,j,I),A||Q==null||Q(M.sourceEvent,I)}}const L=n9().clickDistance(k).on("start",M=>{const{domNode:z,nodeDragThreshold:P,transform:q,snapGrid:D,snapToGrid:H}=t();d=(z==null?void 0:z.getBoundingClientRect())||null,g=!1,P===0&&$(M),a=Gu(M.sourceEvent,{transform:q,snapGrid:D,snapToGrid:H,containerBounds:d}),f=Ri(M.sourceEvent,d)}).on("drag",M=>{const{autoPanOnNodeDrag:z,transform:P,snapGrid:q,snapToGrid:D,nodeDragThreshold:H,nodeLookup:B}=t(),G=Gu(M.sourceEvent,{transform:P,snapGrid:q,snapToGrid:D,containerBounds:d});if((M.sourceEvent.type==="touchmove"&&M.sourceEvent.touches.length>1||A&&!B.has(A))&&(g=!0),!g){if(!c&&z&&h&&(c=!0,O()),!h){const K=G.xSnapped-(a.x??0),Q=G.ySnapped-(a.y??0);Math.sqrt(K*K+Q*Q)>H&&$(M)}(a.x!==G.xSnapped||a.y!==G.ySnapped)&&l&&h&&(f=Ri(M.sourceEvent,d),T(G,M.sourceEvent))}}).on("end",M=>{if(!(!h||g)&&(c=!1,h=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:z,updateNodePositions:P,onNodeDragStop:q,onSelectionDragStop:D}=t();if(P(l,!1),i||q||!A&&D){const[H,B]=w0({nodeId:A,dragItems:l,nodeLookup:z,dragging:!1});i==null||i(M.sourceEvent,l,H,B),q==null||q(M.sourceEvent,H,B),A||D==null||D(M.sourceEvent,B)}}}).filter(M=>{const z=M.target;return!M.button&&(!b||!tN(z,`.${b}`,S))&&(!_||tN(z,_,S))});m.call(L)}function w(){m==null||m.on(".drag",null)}return{update:v,destroy:w}}function Jee(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())dc(i,Xo(a))>0&&r.push(a);return r}const ete=250;function tte(e,t,n,r){var l,c;let i=[],a=1/0;const o=Jee(e,n,t+ete);for(const f of o){const d=[...((l=f.internals.handleBounds)==null?void 0:l.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const h of d){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;const{x:m,y:g}=hc(f,h,h.position,!0),v=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(g-e.y,2));v>t||(v<a?(i=[{...h,x:m,y:g}],a=v):v===a&&i.push({...h,x:m,y:g}))}}if(!i.length)return null;if(i.length>1){const f=r.type==="source"?"target":"source";return i.find(d=>d.type===f)??i[0]}return i[0]}function z9(e,t,n,r,i,a=!1){var f,d,h;const o=r.get(e);if(!o)return null;const l=i==="strict"?(f=o.internals.handleBounds)==null?void 0:f[t]:[...((d=o.internals.handleBounds)==null?void 0:d.source)??[],...((h=o.internals.handleBounds)==null?void 0:h.target)??[]],c=(n?l==null?void 0:l.find(m=>m.id===n):l==null?void 0:l[0])??null;return c&&a?{...c,...hc(o,c,c.position,!0)}:c}function q9(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function nte(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const F9=()=>!0;function rte(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:c,lib:f,autoPanOnConnect:d,flowId:h,panBy:m,cancelConnection:g,onConnectStart:v,onConnect:w,onConnectEnd:b,isValidConnection:_=F9,onReconnectEnd:S,updateConnection:x,getTransform:A,getFromHandle:k,autoPanSpeed:T}){const O=O9(e.target);let $=0,L;const{x:M,y:z}=Ri(e),P=O==null?void 0:O.elementFromPoint(M,z),q=q9(a,P),D=l==null?void 0:l.getBoundingClientRect();if(!D||!q)return;const H=z9(i,q,r,c,t);if(!H)return;let B=Ri(e,D),G=!1,K=null,Q=!1,R=null;function V(){if(!d||!D)return;const[re,le]=k9(B,D,T);m({x:re,y:le}),$=requestAnimationFrame(V)}const X={...H,nodeId:i,type:q,position:H.position},j=c.get(i),U={inProgress:!0,isValid:null,from:hc(j,X,Pe.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:j,to:B,toHandle:null,toPosition:UO[X.position],toNode:null};x(U);let Y=U;v==null||v(e,{nodeId:i,handleId:r,handleType:q});function ne(re){if(!k()||!X){ae(re);return}const le=A();B=Ri(re,D),L=tte(Rc(B,le,!1,[1,1]),n,c,X),G||(V(),G=!0);const W=B9(re,{handle:L,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:_,doc:O,lib:f,flowId:h,nodeLookup:c});R=W.handleDomNode,K=W.connection,Q=nte(!!L,W.isValid);const J={...Y,isValid:Q,to:W.toHandle&&Q?np({x:W.toHandle.x,y:W.toHandle.y},le):B,toHandle:W.toHandle,toPosition:Q&&W.toHandle?W.toHandle.position:UO[X.position],toNode:W.toHandle?c.get(W.toHandle.nodeId):null};Q&&L&&Y.toHandle&&J.toHandle&&Y.toHandle.type===J.toHandle.type&&Y.toHandle.nodeId===J.toHandle.nodeId&&Y.toHandle.id===J.toHandle.id&&Y.to.x===J.to.x&&Y.to.y===J.to.y||(x(J),Y=J)}function ae(re){(L||R)&&K&&Q&&(w==null||w(K));const{inProgress:le,...W}=Y,J={...W,toPosition:Y.toHandle?Y.toPosition:null};b==null||b(re,J),a&&(S==null||S(re,J)),g(),cancelAnimationFrame($),G=!1,Q=!1,K=null,R=null,O.removeEventListener("mousemove",ne),O.removeEventListener("mouseup",ae),O.removeEventListener("touchmove",ne),O.removeEventListener("touchend",ae)}O.addEventListener("mousemove",ne),O.addEventListener("mouseup",ae),O.addEventListener("touchmove",ne),O.addEventListener("touchend",ae)}function B9(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:c,isValidConnection:f=F9,nodeLookup:d}){const h=a==="target",m=t?o.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:g,y:v}=Ri(e),w=o.elementFromPoint(g,v),b=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:m,_={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const S=q9(void 0,b),x=b.getAttribute("data-nodeid"),A=b.getAttribute("data-handleid"),k=b.classList.contains("connectable"),T=b.classList.contains("connectableend");if(!x||!S)return _;const O={source:h?x:r,sourceHandle:h?A:i,target:h?r:x,targetHandle:h?i:A};_.connection=O;const L=k&&T&&(n===Zo.Strict?h&&S==="source"||!h&&S==="target":x!==r||A!==i);_.isValid=L&&f(O),_.toHandle=z9(x,S,A,d,n,!0)}return _}const Pw={onPointerDown:rte,isValid:B9};function ite({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=er(e);function a({translateExtent:l,width:c,height:f,zoomStep:d=10,pannable:h=!0,zoomable:m=!0,inversePan:g=!1}){const v=x=>{const A=n();if(x.sourceEvent.type!=="wheel"||!t)return;const k=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,T=A[2]*Math.pow(2,k);t.scaleTo(T)};let w=[0,0];const b=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(w=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},_=x=>{const A=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],T=[k[0]-w[0],k[1]-w[1]];w=k;const O=r()*Math.max(A[2],Math.log(A[2]))*(g?-1:1),$={x:A[0]-T[0]*O,y:A[1]-T[1]*O},L=[[0,0],[c,f]];t.setViewportConstrained({x:$.x,y:$.y,zoom:A[2]},L,l)},S=y9().on("start",b).on("zoom",h?_:null).on("zoom.wheel",m?v:null);i.call(S,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:Nr}}const ate=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,$p=e=>({x:e.x,y:e.y,zoom:e.k}),S0=({x:e,y:t,zoom:n})=>Np.translate(e,t).scale(n),$o=(e,t)=>e.target.closest(`.${t}`),U9=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),E0=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},V9=e=>{const t=e.ctrlKey&&rp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function ste({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:f}){return d=>{if($o(d,t))return!1;d.preventDefault(),d.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(d.ctrlKey&&o){const b=Nr(d),_=V9(d),S=h*Math.pow(2,_);r.scaleTo(n,S,b,d);return}const m=d.deltaMode===1?20:1;let g=i===bs.Vertical?0:d.deltaX*m,v=i===bs.Horizontal?0:d.deltaY*m;!rp()&&d.shiftKey&&i!==bs.Vertical&&(g=d.deltaY*m,v=0),r.translateBy(n,-(g/h)*a,-(v/h)*a,{internal:!0});const w=$p(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(d,w)),e.isPanScrolling&&(c==null||c(d,w),e.panScrollTimeout=setTimeout(()=>{f==null||f(d,w),e.isPanScrolling=!1},150))}}function ote({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=$o(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function lte({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=$p(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function ute({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&U9(t,e.mouseButton??0)),(o=a.sourceEvent)!=null&&o.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!((l=a.sourceEvent)!=null&&l.internal)&&(i==null||i(a.sourceEvent,$p(a.transform)))}}function cte({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,a&&U9(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&ate(e.prevViewport,o.transform))){const c=$p(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,c)},n?150:0)}}}function fte({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:f}){return d=>{var v;const h=e||t,m=n&&d.ctrlKey;if(d.button===1&&d.type==="mousedown"&&($o(d,`${f}-flow__node`)||$o(d,`${f}-flow__edge`)))return!0;if(!r&&!h&&!i&&!a&&!n||o||$o(d,l)&&d.type==="wheel"||$o(d,c)&&(d.type!=="wheel"||i&&d.type==="wheel"&&!e)||!n&&d.ctrlKey&&d.type==="wheel")return!1;if(!n&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!h&&!i&&!m&&d.type==="wheel"||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const g=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||d.type==="wheel")&&g}}function dte({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:a,onPanZoom:o,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:f}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),m=y9().clickDistance(!jr(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),g=er(e).call(m);x({x:a.x,y:a.y,zoom:Ko(a.zoom,t,n)},[[0,0],[h.width,h.height]],i);const v=g.on("wheel.zoom"),w=g.on("dblclick.zoom");m.wheelDelta(V9);function b(P,q){return g?new Promise(D=>{m==null||m.transform(E0(g,q==null?void 0:q.duration,()=>D(!0)),P)}):Promise.resolve(!1)}function _({noWheelClassName:P,noPanClassName:q,onPaneContextMenu:D,userSelectionActive:H,panOnScroll:B,panOnDrag:G,panOnScrollMode:K,panOnScrollSpeed:Q,preventScrolling:R,zoomOnPinch:V,zoomOnScroll:X,zoomOnDoubleClick:j,zoomActivationKeyPressed:I,lib:U,onTransformChange:Y}){H&&!d.isZoomingOrPanning&&S();const ae=B&&!I&&!H?ste({zoomPanValues:d,noWheelClassName:P,d3Selection:g,d3Zoom:m,panOnScrollMode:K,panOnScrollSpeed:Q,zoomOnPinch:V,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:c}):ote({noWheelClassName:P,preventScrolling:R,d3ZoomHandler:v});if(g.on("wheel.zoom",ae,{passive:!1}),!H){const le=lte({zoomPanValues:d,onDraggingChange:f,onPanZoomStart:l});m.on("start",le);const W=ute({zoomPanValues:d,panOnDrag:G,onPaneContextMenu:!!D,onPanZoom:o,onTransformChange:Y});m.on("zoom",W);const J=cte({zoomPanValues:d,panOnDrag:G,panOnScroll:B,onPaneContextMenu:D,onPanZoomEnd:c,onDraggingChange:f});m.on("end",J)}const re=fte({zoomActivationKeyPressed:I,panOnDrag:G,zoomOnScroll:X,panOnScroll:B,zoomOnDoubleClick:j,zoomOnPinch:V,userSelectionActive:H,noPanClassName:q,noWheelClassName:P,lib:U});m.filter(re),j?g.on("dblclick.zoom",w):g.on("dblclick.zoom",null)}function S(){m.on("zoom",null)}async function x(P,q,D){const H=S0(P),B=m==null?void 0:m.constrain()(H,q,D);return B&&await b(B),new Promise(G=>G(B))}async function A(P,q){const D=S0(P);return await b(D,q),new Promise(H=>H(D))}function k(P){if(g){const q=S0(P),D=g.property("__zoom");(D.k!==P.zoom||D.x!==P.x||D.y!==P.y)&&(m==null||m.transform(g,q,null,{sync:!0}))}}function T(){const P=g?g9(g.node()):{x:0,y:0,k:1};return{x:P.x,y:P.y,zoom:P.k}}function O(P,q){return g?new Promise(D=>{m==null||m.scaleTo(E0(g,q==null?void 0:q.duration,()=>D(!0)),P)}):Promise.resolve(!1)}function $(P,q){return g?new Promise(D=>{m==null||m.scaleBy(E0(g,q==null?void 0:q.duration,()=>D(!0)),P)}):Promise.resolve(!1)}function L(P){m==null||m.scaleExtent(P)}function M(P){m==null||m.translateExtent(P)}function z(P){const q=!jr(P)||P<0?0:P;m==null||m.clickDistance(q)}return{update:_,destroy:S,setViewport:A,setViewportConstrained:x,getViewport:T,scaleTo:O,scaleBy:$,setScaleExtent:L,setTranslateExtent:M,syncViewport:k,setClickDistance:z}}var Yu;(function(e){e.Line="line",e.Handle="handle"})(Yu||(Yu={}));function hte({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){const o=e-t,l=n-r,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&i&&(c[0]=c[0]*-1),l&&a&&(c[1]=c[1]*-1),c}function pte(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function _a(e,t){return Math.max(0,t-e)}function xa(e,t){return Math.max(0,e-t)}function Od(e,t,n){return Math.max(0,t-e,e-n)}function nN(e,t){return e?!t:t}function mte(e,t,n,r,i,a,o,l){let{affectsX:c,affectsY:f}=t;const{isHorizontal:d,isVertical:h}=t,m=d&&h,{xSnapped:g,ySnapped:v}=n,{minWidth:w,maxWidth:b,minHeight:_,maxHeight:S}=r,{x,y:A,width:k,height:T,aspectRatio:O}=e;let $=Math.floor(d?g-e.pointerX:0),L=Math.floor(h?v-e.pointerY:0);const M=k+(c?-$:$),z=T+(f?-L:L),P=-a[0]*k,q=-a[1]*T;let D=Od(M,w,b),H=Od(z,_,S);if(o){let K=0,Q=0;c&&$<0?K=_a(x+$+P,o[0][0]):!c&&$>0&&(K=xa(x+M+P,o[1][0])),f&&L<0?Q=_a(A+L+q,o[0][1]):!f&&L>0&&(Q=xa(A+z+q,o[1][1])),D=Math.max(D,K),H=Math.max(H,Q)}if(l){let K=0,Q=0;c&&$>0?K=xa(x+$,l[0][0]):!c&&$<0&&(K=_a(x+M,l[1][0])),f&&L>0?Q=xa(A+L,l[0][1]):!f&&L<0&&(Q=_a(A+z,l[1][1])),D=Math.max(D,K),H=Math.max(H,Q)}if(i){if(d){const K=Od(M/O,_,S)*O;if(D=Math.max(D,K),o){let Q=0;!c&&!f||c&&!f&&m?Q=xa(A+q+M/O,o[1][1])*O:Q=_a(A+q+(c?$:-$)/O,o[0][1])*O,D=Math.max(D,Q)}if(l){let Q=0;!c&&!f||c&&!f&&m?Q=_a(A+M/O,l[1][1])*O:Q=xa(A+(c?$:-$)/O,l[0][1])*O,D=Math.max(D,Q)}}if(h){const K=Od(z*O,w,b)/O;if(H=Math.max(H,K),o){let Q=0;!c&&!f||f&&!c&&m?Q=xa(x+z*O+P,o[1][0])/O:Q=_a(x+(f?L:-L)*O+P,o[0][0])/O,H=Math.max(H,Q)}if(l){let Q=0;!c&&!f||f&&!c&&m?Q=_a(x+z*O,l[1][0])/O:Q=xa(x+(f?L:-L)*O,l[0][0])/O,H=Math.max(H,Q)}}}L=L+(L<0?H:-H),$=$+($<0?D:-D),i&&(m?M>z*O?L=(nN(c,f)?-$:$)/O:$=(nN(c,f)?-L:L)*O:d?(L=$/O,f=c):($=L*O,c=f));const B=c?x+$:x,G=f?A+L:A;return{width:k+(c?-$:$),height:T+(f?-L:L),x:a[0]*$*(c?-1:1)+B,y:a[1]*L*(f?-1:1)+G}}const H9={width:0,height:0,x:0,y:0},gte={...H9,pointerX:0,pointerY:0,aspectRatio:1};function yte(e){return[[0,0],[e.measured.width,e.measured.height]]}function bte(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,l=n[0]*a,c=n[1]*o;return[[r-l,i-c],[r+a-l,i+o-c]]}function vte({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=er(e);function o({controlPosition:c,boundaries:f,keepAspectRatio:d,resizeDirection:h,onResizeStart:m,onResize:g,onResizeEnd:v,shouldResize:w}){let b={...H9},_={...gte};const S=pte(c);let x,A=null,k=[],T,O,$;const L=n9().on("start",M=>{const{nodeLookup:z,transform:P,snapGrid:q,snapToGrid:D,nodeOrigin:H,paneDomNode:B}=n();if(x=z.get(t),!x)return;A=(B==null?void 0:B.getBoundingClientRect())??null;const{xSnapped:G,ySnapped:K}=Gu(M.sourceEvent,{transform:P,snapGrid:q,snapToGrid:D,containerBounds:A});b={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},_={...b,pointerX:G,pointerY:K,aspectRatio:b.width/b.height},T=void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(T=z.get(x.parentId),O=T&&x.extent==="parent"?yte(T):void 0),k=[],$=void 0;for(const[Q,R]of z)if(R.parentId===t&&(k.push({id:Q,position:{...R.position},extent:R.extent}),R.extent==="parent"||R.expandParent)){const V=bte(R,x,R.origin??H);$?$=[[Math.min(V[0][0],$[0][0]),Math.min(V[0][1],$[0][1])],[Math.max(V[1][0],$[1][0]),Math.max(V[1][1],$[1][1])]]:$=V}m==null||m(M,{...b})}).on("drag",M=>{const{transform:z,snapGrid:P,snapToGrid:q,nodeOrigin:D}=n(),H=Gu(M.sourceEvent,{transform:z,snapGrid:P,snapToGrid:q,containerBounds:A}),B=[];if(!x)return;const{x:G,y:K,width:Q,height:R}=b,V={},X=x.origin??D,{width:j,height:I,x:U,y:Y}=mte(_,S,H,f,d,X,O,$),ne=j!==Q,ae=I!==R,re=U!==G&&ne,le=Y!==K&&ae;if(!re&&!le&&!ne&&!ae)return;if((re||le||X[0]===1||X[1]===1)&&(V.x=re?U:b.x,V.y=le?Y:b.y,b.x=V.x,b.y=V.y,k.length>0)){const fe=U-G,me=Y-K;for(const xe of k)xe.position={x:xe.position.x-fe+X[0]*(j-Q),y:xe.position.y-me+X[1]*(I-R)},B.push(xe)}if((ne||ae)&&(V.width=ne&&(!h||h==="horizontal")?j:b.width,V.height=ae&&(!h||h==="vertical")?I:b.height,b.width=V.width,b.height=V.height),T&&x.expandParent){const fe=X[0]*(V.width??0);V.x&&V.x<fe&&(b.x=fe,_.x=_.x-(V.x-fe));const me=X[1]*(V.height??0);V.y&&V.y<me&&(b.y=me,_.y=_.y-(V.y-me))}const W=hte({width:b.width,prevWidth:Q,height:b.height,prevHeight:R,affectsX:S.affectsX,affectsY:S.affectsY}),J={...b,direction:W};(w==null?void 0:w(M,J))!==!1&&(g==null||g(M,J),r(V,B))}).on("end",M=>{v==null||v(M,{...b}),i==null||i({...b})});a.call(L)}function l(){a.on(".drag",null)}return{update:o,destroy:l}}var k0={exports:{}},A0={},T0={exports:{}},C0={};/**
|
|
208
|
+
*/const BX=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],z5=Fn("x",BX),UX=({onClose:e,formatTime:t})=>{const{historyList:n,currentChatId:r,refreshHistoryList:i,createNewChat:a,deleteHistoryChat:o,toHistoryChat:l}=Ts();return N.jsxs("div",{className:" bg-white rounded-lg shadow-md h-full flex flex-col border-r",children:[N.jsxs("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center h-16",children:[N.jsxs("div",{className:"flex items-center gap-3",children:[N.jsx("h3",{className:"m-0 text-lg text-gray-800",children:"历史记录"}),N.jsx("button",{className:"p-1.5 text-base rounded bg-blue-100 hover:bg-blue-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:i,title:"刷新列表",children:N.jsx(PX,{className:"w-4 h-4 text-blue-600 group-hover:text-blue-700 group-hover:rotate-180 transition-all duration-300"})})]}),N.jsx("button",{className:"p-1.5 text-base rounded bg-red-100 hover:bg-red-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:e,title:"关闭",children:N.jsx(z5,{className:"w-4 h-4 text-red-600 group-hover:text-red-700"})})]}),N.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[N.jsx("div",{className:"flex flex-col gap-3 cursor-pointer",onClick:()=>{a()},children:N.jsx("div",{className:"flex justify-between items-center p-3 rounded-lg bg-gray-50 hover:bg-gray-100 transition-colors duration-200",children:N.jsx("div",{className:"text-sm text-gray-800 truncate",children:"New Chat"})})}),n.length===0?N.jsx("div",{className:"text-center text-gray-500 py-8",children:"暂无历史记录"}):N.jsx("div",{className:"flex flex-col gap-3 mt-3",children:n.sort((c,f)=>new Date(f.created_at).getTime()-new Date(c.created_at).getTime()).map(c=>N.jsxs("div",{className:`flex justify-between items-center p-3 rounded-lg transition-colors duration-200 ${c.thread_id===r?"bg-blue-50 border border-blue-200":"bg-gray-50 hover:bg-gray-100"}`,children:[N.jsxs("div",{className:"flex-1 min-w-0 mr-2",children:[N.jsx("div",{className:"text-sm text-gray-800 mb-1 truncate max-w-[180px]",children:e7(c)}),N.jsxs("div",{className:"flex gap-3 text-xs text-gray-500",children:[N.jsx("span",{className:"truncate max-w-[100px]",children:t(new Date(c.created_at))}),N.jsx("span",{className:"truncate max-w-[60px]",children:c.status})]})]}),N.jsxs("div",{className:"flex gap-2 shrink-0",children:[N.jsx("button",{className:"p-1.5 text-base rounded bg-green-100 hover:bg-green-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:()=>{l(c)},title:"恢复对话",children:N.jsx(zX,{className:"w-4 h-4 text-green-600 group-hover:text-green-700 group-hover:-rotate-180 transition-all duration-300"})}),N.jsx("button",{className:"p-1.5 text-base rounded bg-red-100 hover:bg-red-200 transition-all duration-200 flex items-center justify-center hover:scale-110 group",onClick:async()=>{await o(c)},title:"删除对话",children:N.jsx(FX,{className:"w-4 h-4 text-red-600 group-hover:text-red-700"})})]})]},c.thread_id))})]})]})},q5=te.createContext(void 0),VX=({children:e})=>{const[t,n]=te.useState(()=>{const i=localStorage.getItem("extraParams");try{return i?JSON.parse(i):{}}catch(a){return console.error("Failed to parse extraParams from localStorage",a),{}}});te.useEffect(()=>{localStorage.setItem("extraParams",JSON.stringify(t))},[t]);const r=i=>{n(i)};return N.jsx(q5.Provider,{value:{extraParams:t,setExtraParams:r},children:e})},F5=()=>{const e=te.useContext(q5);if(e===void 0)throw new Error("useExtraParams must be used within an ExtraParamsProvider");return e};class HX{constructor(t={}){De(this,"apiUrl");this.apiUrl=t.apiUrl||""}createFormData(t,n){const r=new FormData;if(typeof t=="string"){const i=new Blob([t],{type:"text/plain"});r.append("file",i,n||"file.txt")}else r.append("file",t,n||(t instanceof File?t.name:"file"));return r}async upload(t,n={}){const i={method:"POST",body:this.createFormData(t,n.filename)};n.signal&&(i.signal=n.signal);try{const a=await fetch(`${this.apiUrl}${this.getUploadEndpoint()}`,i);if(!a.ok)throw new Error(`Upload failed with status: ${a.status}`);const o=await a.json();return this.processResponse(o)}catch(a){throw new Error(`File upload failed: ${a instanceof Error?a.message:String(a)}`)}}}class GX extends HX{constructor(t={}){super({apiUrl:t.apiUrl||"https://tmpfiles.org/api/v1"})}getUploadEndpoint(){return"/upload"}processResponse(t){var n;return(n=t.data)!=null&&n.url&&(t.data.url=t.data.url.replace("//tmpfiles.org/","//tmpfiles.org/dl/")),t}}const YX=({onFileUploaded:e})=>{const[t,n]=te.useState([]),r=new GX,i=3,a=te.useCallback(async l=>{var d;const f=Array.from(l.target.files||[]).filter(h=>h.type.startsWith("image/"));if(t.length+f.length>i){alert(`最多只能上传${i}张图片`),l.target.value="";return}n(h=>[...h,...f]);for(const h of f)try{const m=await r.upload(h);(d=m.data)!=null&&d.url&&e(m.data.url)}catch(m){console.error("Upload failed:",m)}l.target.value=""},[e,t.length]),o=te.useCallback(l=>{n(c=>c.filter((f,d)=>d!==l))},[]);return N.jsxs("div",{className:"flex gap-2 rounded-lg flex-1",children:[t.length<i&&N.jsxs("label",{className:`inline-flex items-center justify-center w-20 h-20 text-gray-500 bg-gray-100 rounded-lg cursor-pointer transition-all duration-200 hover:bg-gray-200 ${t.length===0?"w-8 h-8":""}`,children:[N.jsxs("svg",{viewBox:"0 0 24 24",width:t.length===0?"20":"32",height:t.length===0?"20":"32",fill:"currentColor",children:[N.jsx("path",{d:"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"}),N.jsx("path",{d:"M20 4h-3.17l-1.24-1.35A1.99 1.99 0 0 0 14.12 2H9.88c-.56 0-1.1.24-1.48.65L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 13c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"})]}),N.jsx("input",{type:"file",accept:"image/*",multiple:!0,onChange:a,className:"hidden"})]}),N.jsx("div",{className:"flex flex-wrap gap-2",children:t.map((l,c)=>N.jsxs("div",{className:"relative w-20 h-20 rounded-lg overflow-hidden",children:[N.jsx("img",{src:URL.createObjectURL(l),alt:l.name,className:"w-full h-full object-cover border border-gray-200"}),N.jsx("button",{className:"absolute top-0.5 right-0.5 w-5 h-5 bg-black/50 text-white rounded-full flex items-center justify-center text-base leading-none hover:bg-black/70 transition-colors",onClick:()=>o(c),children:"×"})]},c))})]})},SO="json-editor-presets",EO="json-editor-active-tab",ZX=({isOpen:e,initialJson:t,onClose:n,onSave:r})=>{const[i,a]=te.useState([]),[o,l]=te.useState(0),[c,f]=te.useState(""),[d,h]=te.useState(null),[m,g]=te.useState(null),[v,w]=te.useState("");if(te.useEffect(()=>{if(e){let k=[];try{const O=localStorage.getItem(SO);k=O?JSON.parse(O):[]}catch(O){console.error("Failed to parse presets from localStorage",O),k=[]}k.length===0&&(k=[{name:"Default",data:t}]),a(k);let T=0;try{const O=localStorage.getItem(EO);if(O){const $=parseInt(O,10);$>=0&&$<k.length&&(T=$)}}catch(O){console.error("Failed to parse active tab from localStorage",O)}l(T),h(null)}},[e,t]),te.useEffect(()=>{e&&i.length>0&&i[o]&&(f(JSON.stringify(i[o].data,null,2)),h(null))},[o,i,e]),te.useEffect(()=>{e&&localStorage.setItem(EO,o.toString())},[o,e]),!e)return null;const b=k=>{a(k),localStorage.setItem(SO,JSON.stringify(k))},_=()=>{const k={name:`Preset ${i.length+1}`,data:{}},T=[...i,k];b(T),l(T.length-1)},S=k=>{let T=i.filter((O,$)=>$!==k);T.length===0&&(T=[{name:"Default",data:t}]),b(T),o>=k&&o>0?l(o-1):o>=T.length&&l(T.length-1)},x=()=>{try{const k=JSON.parse(c),T=i.map((O,$)=>$===o?{...O,data:k}:O);b(T),r(k),n()}catch(k){h("JSON 格式无效,请检查后重试。"),console.error("Invalid JSON format:",k)}},A=k=>{if(v.trim()!==""){const T=i.map((O,$)=>$===k?{...O,name:v.trim()}:O);b(T),g(null)}};return N.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:N.jsxs("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl mx-4 flex flex-col",style:{height:"80vh"},children:[N.jsx("div",{className:"p-6 border-b border-gray-200",children:N.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"编辑 Extra Parameters"})}),N.jsxs("div",{className:"flex-grow p-6 overflow-y-auto",children:[N.jsxs("div",{className:"flex items-center border-b border-gray-200 mb-4",children:[i.map((k,T)=>N.jsxs("div",{className:`flex items-center px-4 py-2 border-b-2 cursor-pointer text-sm font-medium ${o===T?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,onDoubleClick:()=>{g(T),w(k.name)},onClick:()=>l(T),children:[m===T?N.jsx("input",{type:"text",value:v,onChange:O=>w(O.target.value),onBlur:()=>A(T),onKeyDown:O=>O.key==="Enter"&&A(T),className:"text-sm p-0 border-none focus:ring-0 bg-transparent",autoFocus:!0}):N.jsx("span",{children:k.name}),N.jsx("button",{onClick:O=>{O.stopPropagation(),S(T)},className:"ml-2 text-gray-400 hover:text-gray-600 w-4 h-4 flex items-center justify-center",children:"×"})]},T)),N.jsx("button",{onClick:_,className:"ml-2 px-3 py-1 text-sm text-gray-500 hover:text-gray-700",children:"+"})]}),N.jsx("textarea",{value:c,onChange:k=>{f(k.target.value),h(null)},className:"w-full h-full p-3 border border-gray-300 rounded-lg font-mono text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"}),d&&N.jsx("p",{className:"mt-2 text-sm text-red-600",children:d})]}),N.jsxs("div",{className:"flex justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50 rounded-b-lg",children:[N.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"取消"}),N.jsx("button",{onClick:x,className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"保存并使用"})]})]})})};function en(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=en(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var KX={value:()=>{}};function Ap(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Eh(n)}function Eh(e){this._=e}function XX(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Eh.prototype=Ap.prototype={constructor:Eh,on:function(e,t){var n=this._,r=XX(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=WX(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=kO(n[i],e.name,t);else if(t==null)for(i in n)n[i]=kO(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 Eh(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new 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 new Error("unknown type: "+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function WX(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function kO(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=KX,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var kw="http://www.w3.org/1999/xhtml";const AO={svg:"http://www.w3.org/2000/svg",xhtml:kw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Tp(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),AO.hasOwnProperty(t)?{space:AO[t],local:e}:e}function QX(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===kw&&t.documentElement.namespaceURI===kw?t.createElement(e):t.createElementNS(n,e)}}function JX(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function B5(e){var t=Tp(e);return(t.local?JX:QX)(t)}function eW(){}function wS(e){return e==null?eW:function(){return this.querySelector(e)}}function tW(e){typeof e!="function"&&(e=wS(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=new Array(o),c,f,d=0;d<o;++d)(c=a[d])&&(f=e.call(c,c.__data__,d,a))&&("__data__"in c&&(f.__data__=c.__data__),l[d]=f);return new or(r,this._parents)}function nW(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function rW(){return[]}function U5(e){return e==null?rW:function(){return this.querySelectorAll(e)}}function iW(e){return function(){return nW(e.apply(this,arguments))}}function aW(e){typeof e=="function"?e=iW(e):e=U5(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],l=o.length,c,f=0;f<l;++f)(c=o[f])&&(r.push(e.call(c,c.__data__,f,o)),i.push(c));return new or(r,i)}function V5(e){return function(){return this.matches(e)}}function H5(e){return function(t){return t.matches(e)}}var sW=Array.prototype.find;function oW(e){return function(){return sW.call(this.children,e)}}function lW(){return this.firstElementChild}function uW(e){return this.select(e==null?lW:oW(typeof e=="function"?e:H5(e)))}var cW=Array.prototype.filter;function fW(){return Array.from(this.children)}function dW(e){return function(){return cW.call(this.children,e)}}function hW(e){return this.selectAll(e==null?fW:dW(typeof e=="function"?e:H5(e)))}function pW(e){typeof e!="function"&&(e=V5(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=[],c,f=0;f<o;++f)(c=a[f])&&e.call(c,c.__data__,f,a)&&l.push(c);return new or(r,this._parents)}function G5(e){return new Array(e.length)}function mW(){return new or(this._enter||this._groups.map(G5),this._parents)}function Zh(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Zh.prototype={constructor:Zh,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 gW(e){return function(){return e}}function yW(e,t,n,r,i,a){for(var o=0,l,c=t.length,f=a.length;o<f;++o)(l=t[o])?(l.__data__=a[o],r[o]=l):n[o]=new Zh(e,a[o]);for(;o<c;++o)(l=t[o])&&(i[o]=l)}function bW(e,t,n,r,i,a,o){var l,c,f=new Map,d=t.length,h=a.length,m=new Array(d),g;for(l=0;l<d;++l)(c=t[l])&&(m[l]=g=o.call(c,c.__data__,l,t)+"",f.has(g)?i[l]=c:f.set(g,c));for(l=0;l<h;++l)g=o.call(e,a[l],l,a)+"",(c=f.get(g))?(r[l]=c,c.__data__=a[l],f.delete(g)):n[l]=new Zh(e,a[l]);for(l=0;l<d;++l)(c=t[l])&&f.get(m[l])===c&&(i[l]=c)}function vW(e){return e.__data__}function _W(e,t){if(!arguments.length)return Array.from(this,vW);var n=t?bW:yW,r=this._parents,i=this._groups;typeof e!="function"&&(e=gW(e));for(var a=i.length,o=new Array(a),l=new Array(a),c=new Array(a),f=0;f<a;++f){var d=r[f],h=i[f],m=h.length,g=xW(e.call(d,d&&d.__data__,f,r)),v=g.length,w=l[f]=new Array(v),b=o[f]=new Array(v),_=c[f]=new Array(m);n(d,h,w,b,_,g,t);for(var S=0,x=0,A,k;S<v;++S)if(A=w[S]){for(S>=x&&(x=S+1);!(k=b[x])&&++x<v;);A._next=k||null}}return o=new or(o,r),o._enter=l,o._exit=c,o}function xW(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function wW(){return new or(this._exit||this._groups.map(G5),this._parents)}function SW(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function EW(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),l=new Array(i),c=0;c<o;++c)for(var f=n[c],d=r[c],h=f.length,m=l[c]=new Array(h),g,v=0;v<h;++v)(g=f[v]||d[v])&&(m[v]=g);for(;c<i;++c)l[c]=n[c];return new or(l,this._parents)}function kW(){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 AW(e){e||(e=TW);function t(h,m){return h&&m?e(h.__data__,m.__data__):!h-!m}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],l=o.length,c=i[a]=new Array(l),f,d=0;d<l;++d)(f=o[d])&&(c[d]=f);c.sort(t)}return new or(i,this._parents).order()}function TW(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function CW(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function OW(){return Array.from(this)}function NW(){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 RW(){let e=0;for(const t of this)++e;return e}function jW(){return!this.node()}function MW(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,l;a<o;++a)(l=i[a])&&e.call(l,l.__data__,a,i);return this}function $W(e){return function(){this.removeAttribute(e)}}function DW(e){return function(){this.removeAttributeNS(e.space,e.local)}}function IW(e,t){return function(){this.setAttribute(e,t)}}function PW(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function LW(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function zW(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 qW(e,t){var n=Tp(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?DW:$W:typeof t=="function"?n.local?zW:LW:n.local?PW:IW)(n,t))}function Y5(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function FW(e){return function(){this.style.removeProperty(e)}}function BW(e,t,n){return function(){this.style.setProperty(e,t,n)}}function UW(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function VW(e,t,n){return arguments.length>1?this.each((t==null?FW:typeof t=="function"?UW:BW)(e,t,n??"")):Go(this.node(),e)}function Go(e,t){return e.style.getPropertyValue(t)||Y5(e).getComputedStyle(e,null).getPropertyValue(t)}function HW(e){return function(){delete this[e]}}function GW(e,t){return function(){this[e]=t}}function YW(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ZW(e,t){return arguments.length>1?this.each((t==null?HW:typeof t=="function"?YW:GW)(e,t)):this.node()[e]}function Z5(e){return e.trim().split(/^|\s+/)}function SS(e){return e.classList||new K5(e)}function K5(e){this._node=e,this._names=Z5(e.getAttribute("class")||"")}K5.prototype={add:function(e){var t=this._names.indexOf(e);t<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 X5(e,t){for(var n=SS(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function W5(e,t){for(var n=SS(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function KW(e){return function(){X5(this,e)}}function XW(e){return function(){W5(this,e)}}function WW(e,t){return function(){(t.apply(this,arguments)?X5:W5)(this,e)}}function QW(e,t){var n=Z5(e+"");if(arguments.length<2){for(var r=SS(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?WW:t?KW:XW)(n,t))}function JW(){this.textContent=""}function eQ(e){return function(){this.textContent=e}}function tQ(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function nQ(e){return arguments.length?this.each(e==null?JW:(typeof e=="function"?tQ:eQ)(e)):this.node().textContent}function rQ(){this.innerHTML=""}function iQ(e){return function(){this.innerHTML=e}}function aQ(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function sQ(e){return arguments.length?this.each(e==null?rQ:(typeof e=="function"?aQ:iQ)(e)):this.node().innerHTML}function oQ(){this.nextSibling&&this.parentNode.appendChild(this)}function lQ(){return this.each(oQ)}function uQ(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function cQ(){return this.each(uQ)}function fQ(e){var t=typeof e=="function"?e:B5(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function dQ(){return null}function hQ(e,t){var n=typeof e=="function"?e:B5(e),r=t==null?dQ:typeof t=="function"?t:wS(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function pQ(){var e=this.parentNode;e&&e.removeChild(this)}function mQ(){return this.each(pQ)}function gQ(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function yQ(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function bQ(e){return this.select(e?yQ:gQ)}function vQ(e){return arguments.length?this.property("__data__",e):this.node().__data__}function _Q(e){return function(t){e.call(this,t,this.__data__)}}function xQ(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function wQ(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 SQ(e,t,n){return function(){var r=this.__on,i,a=_Q(t);if(r){for(var o=0,l=r.length;o<l;++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 EQ(e,t,n){var r=xQ(e+""),i,a=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,f=l.length,d;c<f;++c)for(i=0,d=l[c];i<a;++i)if((o=r[i]).type===d.type&&o.name===d.name)return d.value}return}for(l=t?SQ:wQ,i=0;i<a;++i)this.each(l(r[i],t,n));return this}function Q5(e,t,n){var r=Y5(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 kQ(e,t){return function(){return Q5(this,e,t)}}function AQ(e,t){return function(){return Q5(this,e,t.apply(this,arguments))}}function TQ(e,t){return this.each((typeof t=="function"?AQ:kQ)(e,t))}function*CQ(){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 J5=[null];function or(e,t){this._groups=e,this._parents=t}function Tc(){return new or([[document.documentElement]],J5)}function OQ(){return this}or.prototype=Tc.prototype={constructor:or,select:tW,selectAll:aW,selectChild:uW,selectChildren:hW,filter:pW,data:_W,enter:mW,exit:wW,join:SW,merge:EW,selection:OQ,order:kW,sort:AW,call:CW,nodes:OW,node:NW,size:RW,empty:jW,each:MW,attr:qW,style:VW,property:ZW,classed:QW,text:nQ,html:sQ,raise:lQ,lower:cQ,append:fQ,insert:hQ,remove:mQ,clone:bQ,datum:vQ,on:EQ,dispatch:TQ,[Symbol.iterator]:CQ};function er(e){return typeof e=="string"?new or([[document.querySelector(e)]],[document.documentElement]):new or([[e]],J5)}function NQ(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Nr(e,t){if(e=NQ(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]}const RQ={passive:!1},ac={capture:!0,passive:!1};function b0(e){e.stopImmediatePropagation()}function Po(e){e.preventDefault(),e.stopImmediatePropagation()}function e9(e){var t=e.document.documentElement,n=er(e).on("dragstart.drag",Po,ac);"onselectstart"in t?n.on("selectstart.drag",Po,ac):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function t9(e,t){var n=e.document.documentElement,r=er(e).on("dragstart.drag",null);t&&(r.on("click.drag",Po,ac),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Sd=e=>()=>e;function Aw(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:l,dx:c,dy:f,dispatch:d}){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:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:d}})}Aw.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function jQ(e){return!e.ctrlKey&&!e.button}function MQ(){return this.parentNode}function $Q(e,t){return t??{x:e.x,y:e.y}}function DQ(){return navigator.maxTouchPoints||"ontouchstart"in this}function n9(){var e=jQ,t=MQ,n=$Q,r=DQ,i={},a=Ap("start","drag","end"),o=0,l,c,f,d,h=0;function m(A){A.on("mousedown.drag",g).filter(r).on("touchstart.drag",b).on("touchmove.drag",_,RQ).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(A,k){if(!(d||!e.call(this,A,k))){var T=x(this,t.call(this,A,k),A,k,"mouse");T&&(er(A.view).on("mousemove.drag",v,ac).on("mouseup.drag",w,ac),e9(A.view),b0(A),f=!1,l=A.clientX,c=A.clientY,T("start",A))}}function v(A){if(Po(A),!f){var k=A.clientX-l,T=A.clientY-c;f=k*k+T*T>h}i.mouse("drag",A)}function w(A){er(A.view).on("mousemove.drag mouseup.drag",null),t9(A.view,f),Po(A),i.mouse("end",A)}function b(A,k){if(e.call(this,A,k)){var T=A.changedTouches,O=t.call(this,A,k),$=T.length,L,M;for(L=0;L<$;++L)(M=x(this,O,A,k,T[L].identifier,T[L]))&&(b0(A),M("start",A,T[L]))}}function _(A){var k=A.changedTouches,T=k.length,O,$;for(O=0;O<T;++O)($=i[k[O].identifier])&&(Po(A),$("drag",A,k[O]))}function S(A){var k=A.changedTouches,T=k.length,O,$;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),O=0;O<T;++O)($=i[k[O].identifier])&&(b0(A),$("end",A,k[O]))}function x(A,k,T,O,$,L){var M=a.copy(),z=Nr(L||T,k),P,q,D;if((D=n.call(A,new Aw("beforestart",{sourceEvent:T,target:m,identifier:$,active:o,x:z[0],y:z[1],dx:0,dy:0,dispatch:M}),O))!=null)return P=D.x-z[0]||0,q=D.y-z[1]||0,function H(B,G,K){var Q=z,R;switch(B){case"start":i[$]=H,R=o++;break;case"end":delete i[$],--o;case"drag":z=Nr(K||G,k),R=o;break}M.call(B,A,new Aw(B,{sourceEvent:G,subject:D,target:m,identifier:$,active:R,x:z[0]+P,y:z[1]+q,dx:z[0]-Q[0],dy:z[1]-Q[1],dispatch:M}),O)}}return m.filter=function(A){return arguments.length?(e=typeof A=="function"?A:Sd(!!A),m):e},m.container=function(A){return arguments.length?(t=typeof A=="function"?A:Sd(A),m):t},m.subject=function(A){return arguments.length?(n=typeof A=="function"?A:Sd(A),m):n},m.touchable=function(A){return arguments.length?(r=typeof A=="function"?A:Sd(!!A),m):r},m.on=function(){var A=a.on.apply(a,arguments);return A===a?m:A},m.clickDistance=function(A){return arguments.length?(h=(A=+A)*A,m):Math.sqrt(h)},m}function ES(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function r9(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Cc(){}var sc=.7,Kh=1/sc,Lo="\\s*([+-]?\\d+)\\s*",oc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Wr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",IQ=/^#([0-9a-f]{3,8})$/,PQ=new RegExp(`^rgb\\(${Lo},${Lo},${Lo}\\)$`),LQ=new RegExp(`^rgb\\(${Wr},${Wr},${Wr}\\)$`),zQ=new RegExp(`^rgba\\(${Lo},${Lo},${Lo},${oc}\\)$`),qQ=new RegExp(`^rgba\\(${Wr},${Wr},${Wr},${oc}\\)$`),FQ=new RegExp(`^hsl\\(${oc},${Wr},${Wr}\\)$`),BQ=new RegExp(`^hsla\\(${oc},${Wr},${Wr},${oc}\\)$`),TO={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};ES(Cc,lc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:CO,formatHex:CO,formatHex8:UQ,formatHsl:VQ,formatRgb:OO,toString:OO});function CO(){return this.rgb().formatHex()}function UQ(){return this.rgb().formatHex8()}function VQ(){return i9(this).formatHsl()}function OO(){return this.rgb().formatRgb()}function lc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=IQ.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?NO(t):n===3?new Ln(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ed(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ed(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=PQ.exec(e))?new Ln(t[1],t[2],t[3],1):(t=LQ.exec(e))?new Ln(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=zQ.exec(e))?Ed(t[1],t[2],t[3],t[4]):(t=qQ.exec(e))?Ed(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=FQ.exec(e))?MO(t[1],t[2]/100,t[3]/100,1):(t=BQ.exec(e))?MO(t[1],t[2]/100,t[3]/100,t[4]):TO.hasOwnProperty(e)?NO(TO[e]):e==="transparent"?new Ln(NaN,NaN,NaN,0):null}function NO(e){return new Ln(e>>16&255,e>>8&255,e&255,1)}function Ed(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ln(e,t,n,r)}function HQ(e){return e instanceof Cc||(e=lc(e)),e?(e=e.rgb(),new Ln(e.r,e.g,e.b,e.opacity)):new Ln}function Tw(e,t,n,r){return arguments.length===1?HQ(e):new Ln(e,t,n,r??1)}function Ln(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ES(Ln,Tw,r9(Cc,{brighter(e){return e=e==null?Kh:Math.pow(Kh,e),new Ln(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?sc:Math.pow(sc,e),new Ln(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ln(ys(this.r),ys(this.g),ys(this.b),Xh(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:RO,formatHex:RO,formatHex8:GQ,formatRgb:jO,toString:jO}));function RO(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}`}function GQ(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}${ps((isNaN(this.opacity)?1:this.opacity)*255)}`}function jO(){const e=Xh(this.opacity);return`${e===1?"rgb(":"rgba("}${ys(this.r)}, ${ys(this.g)}, ${ys(this.b)}${e===1?")":`, ${e})`}`}function Xh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ys(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ps(e){return e=ys(e),(e<16?"0":"")+e.toString(16)}function MO(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Rr(e,t,n,r)}function i9(e){if(e instanceof Rr)return new Rr(e.h,e.s,e.l,e.opacity);if(e instanceof Cc||(e=lc(e)),!e)return new Rr;if(e instanceof Rr)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,l=a-i,c=(a+i)/2;return l?(t===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?a+i:2-a-i,o*=60):l=c>0&&c<1?0:o,new Rr(o,l,c,e.opacity)}function YQ(e,t,n,r){return arguments.length===1?i9(e):new Rr(e,t,n,r??1)}function Rr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ES(Rr,YQ,r9(Cc,{brighter(e){return e=e==null?Kh:Math.pow(Kh,e),new Rr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?sc:Math.pow(sc,e),new Rr(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 Ln(v0(e>=240?e-240:e+120,i,r),v0(e,i,r),v0(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Rr($O(this.h),kd(this.s),kd(this.l),Xh(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(){const e=Xh(this.opacity);return`${e===1?"hsl(":"hsla("}${$O(this.h)}, ${kd(this.s)*100}%, ${kd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function $O(e){return e=(e||0)%360,e<0?e+360:e}function kd(e){return Math.max(0,Math.min(1,e||0))}function v0(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const a9=e=>()=>e;function ZQ(e,t){return function(n){return e+n*t}}function KQ(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function XQ(e){return(e=+e)==1?s9:function(t,n){return n-t?KQ(t,n,e):a9(isNaN(t)?n:t)}}function s9(e,t){var n=t-e;return n?ZQ(e,n):a9(isNaN(e)?t:e)}const DO=function e(t){var n=XQ(t);function r(i,a){var o=n((i=Tw(i)).r,(a=Tw(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),f=s9(i.opacity,a.opacity);return function(d){return i.r=o(d),i.g=l(d),i.b=c(d),i.opacity=f(d),i+""}}return r.gamma=e,r}(1);function Ta(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Cw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_0=new RegExp(Cw.source,"g");function WQ(e){return function(){return e}}function QQ(e){return function(t){return e(t)+""}}function JQ(e,t){var n=Cw.lastIndex=_0.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=Cw.exec(e))&&(i=_0.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:Ta(r,i)})),n=_0.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?QQ(c[0].x):WQ(t):(t=c.length,function(f){for(var d=0,h;d<t;++d)l[(h=c[d]).i]=h.x(f);return l.join("")})}var IO=180/Math.PI,Ow={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function o9(e,t,n,r,i,a){var o,l,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*IO,skewX:Math.atan(c)*IO,scaleX:o,scaleY:l}}var Ad;function eJ(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ow:o9(t.a,t.b,t.c,t.d,t.e,t.f)}function tJ(e){return e==null||(Ad||(Ad=document.createElementNS("http://www.w3.org/2000/svg","g")),Ad.setAttribute("transform",e),!(e=Ad.transform.baseVal.consolidate()))?Ow:(e=e.matrix,o9(e.a,e.b,e.c,e.d,e.e,e.f))}function l9(e,t,n,r){function i(f){return f.length?f.pop()+" ":""}function a(f,d,h,m,g,v){if(f!==h||d!==m){var w=g.push("translate(",null,t,null,n);v.push({i:w-4,x:Ta(f,h)},{i:w-2,x:Ta(d,m)})}else(h||m)&&g.push("translate("+h+t+m+n)}function o(f,d,h,m){f!==d?(f-d>180?d+=360:d-f>180&&(f+=360),m.push({i:h.push(i(h)+"rotate(",null,r)-2,x:Ta(f,d)})):d&&h.push(i(h)+"rotate("+d+r)}function l(f,d,h,m){f!==d?m.push({i:h.push(i(h)+"skewX(",null,r)-2,x:Ta(f,d)}):d&&h.push(i(h)+"skewX("+d+r)}function c(f,d,h,m,g,v){if(f!==h||d!==m){var w=g.push(i(g)+"scale(",null,",",null,")");v.push({i:w-4,x:Ta(f,h)},{i:w-2,x:Ta(d,m)})}else(h!==1||m!==1)&&g.push(i(g)+"scale("+h+","+m+")")}return function(f,d){var h=[],m=[];return f=e(f),d=e(d),a(f.translateX,f.translateY,d.translateX,d.translateY,h,m),o(f.rotate,d.rotate,h,m),l(f.skewX,d.skewX,h,m),c(f.scaleX,f.scaleY,d.scaleX,d.scaleY,h,m),f=d=null,function(g){for(var v=-1,w=m.length,b;++v<w;)h[(b=m[v]).i]=b.x(g);return h.join("")}}}var nJ=l9(eJ,"px, ","px)","deg)"),rJ=l9(tJ,", ",")",")"),iJ=1e-12;function PO(e){return((e=Math.exp(e))+1/e)/2}function aJ(e){return((e=Math.exp(e))-1/e)/2}function sJ(e){return((e=Math.exp(2*e))-1)/(e+1)}const oJ=function e(t,n,r){function i(a,o){var l=a[0],c=a[1],f=a[2],d=o[0],h=o[1],m=o[2],g=d-l,v=h-c,w=g*g+v*v,b,_;if(w<iJ)_=Math.log(m/f)/t,b=function(O){return[l+O*g,c+O*v,f*Math.exp(t*O*_)]};else{var S=Math.sqrt(w),x=(m*m-f*f+r*w)/(2*f*n*S),A=(m*m-f*f-r*w)/(2*m*n*S),k=Math.log(Math.sqrt(x*x+1)-x),T=Math.log(Math.sqrt(A*A+1)-A);_=(T-k)/t,b=function(O){var $=O*_,L=PO(k),M=f/(n*S)*(L*sJ(t*$+k)-aJ(k));return[l+M*g,c+M*v,f*L/PO(t*$+k)]}}return b.duration=_*1e3*t/Math.SQRT2,b}return i.rho=function(a){var o=Math.max(.001,+a),l=o*o,c=l*l;return e(o,l,c)},i}(Math.SQRT2,2,4);var Yo=0,Lu=0,Tu=0,u9=1e3,Wh,zu,Qh=0,xs=0,Cp=0,uc=typeof performance=="object"&&performance.now?performance:Date,c9=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function kS(){return xs||(c9(lJ),xs=uc.now()+Cp)}function lJ(){xs=0}function Jh(){this._call=this._time=this._next=null}Jh.prototype=f9.prototype={constructor:Jh,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?kS():+n)+(t==null?0:+t),!this._next&&zu!==this&&(zu?zu._next=this:Wh=this,zu=this),this._call=e,this._time=n,Nw()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nw())}};function f9(e,t,n){var r=new Jh;return r.restart(e,t,n),r}function uJ(){kS(),++Yo;for(var e=Wh,t;e;)(t=xs-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Yo}function LO(){xs=(Qh=uc.now())+Cp,Yo=Lu=0;try{uJ()}finally{Yo=0,fJ(),xs=0}}function cJ(){var e=uc.now(),t=e-Qh;t>u9&&(Cp-=t,Qh=e)}function fJ(){for(var e,t=Wh,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:Wh=n);zu=e,Nw(r)}function Nw(e){if(!Yo){Lu&&(Lu=clearTimeout(Lu));var t=e-xs;t>24?(e<1/0&&(Lu=setTimeout(LO,e-uc.now()-Cp)),Tu&&(Tu=clearInterval(Tu))):(Tu||(Qh=uc.now(),Tu=setInterval(cJ,u9)),Yo=1,c9(LO))}}function zO(e,t,n){var r=new Jh;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var dJ=Ap("start","end","cancel","interrupt"),hJ=[],d9=0,qO=1,Rw=2,kh=3,FO=4,jw=5,Ah=6;function Op(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;pJ(e,n,{name:t,index:r,group:i,on:dJ,tween:hJ,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:d9})}function AS(e,t){var n=Pr(e,t);if(n.state>d9)throw new Error("too late; already scheduled");return n}function ti(e,t){var n=Pr(e,t);if(n.state>kh)throw new Error("too late; already running");return n}function Pr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function pJ(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=f9(a,0,n.time);function a(f){n.state=qO,n.timer.restart(o,n.delay,n.time),n.delay<=f&&o(f-n.delay)}function o(f){var d,h,m,g;if(n.state!==qO)return c();for(d in r)if(g=r[d],g.name===n.name){if(g.state===kh)return zO(o);g.state===FO?(g.state=Ah,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[d]):+d<t&&(g.state=Ah,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[d])}if(zO(function(){n.state===kh&&(n.state=FO,n.timer.restart(l,n.delay,n.time),l(f))}),n.state=Rw,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Rw){for(n.state=kh,i=new Array(m=n.tween.length),d=0,h=-1;d<m;++d)(g=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=g);i.length=h+1}}function l(f){for(var d=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=jw,1),h=-1,m=i.length;++h<m;)i[h].call(e,d);n.state===jw&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Ah,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Th(e,t){var n=e.__transition,r,i,a=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>Rw&&r.state<jw,r.state=Ah,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function mJ(e){return this.each(function(){Th(this,e)})}function gJ(e,t){var n,r;return function(){var i=ti(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,l=r.length;o<l;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function yJ(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=ti(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var l={name:t,value:n},c=0,f=i.length;c<f;++c)if(i[c].name===t){i[c]=l;break}c===f&&i.push(l)}a.tween=i}}function bJ(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Pr(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?gJ:yJ)(n,e,t))}function TS(e,t,n){var r=e._id;return e.each(function(){var i=ti(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Pr(i,r).value[t]}}function h9(e,t){var n;return(typeof t=="number"?Ta:t instanceof lc?DO:(n=lc(t))?(t=n,DO):JQ)(e,t)}function vJ(e){return function(){this.removeAttribute(e)}}function _J(e){return function(){this.removeAttributeNS(e.space,e.local)}}function xJ(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 wJ(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 SJ(e,t,n){var r,i,a;return function(){var o,l=n(this),c;return l==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=l+"",o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l)))}}function EJ(e,t,n){var r,i,a;return function(){var o,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=l+"",o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l)))}}function kJ(e,t){var n=Tp(e),r=n==="transform"?rJ:h9;return this.attrTween(e,typeof t=="function"?(n.local?EJ:SJ)(n,r,TS(this,"attr."+e,t)):t==null?(n.local?_J:vJ)(n):(n.local?wJ:xJ)(n,r,t))}function AJ(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function TJ(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function CJ(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&TJ(e,a)),n}return i._value=t,i}function OJ(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&AJ(e,a)),n}return i._value=t,i}function NJ(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 new Error;var r=Tp(e);return this.tween(n,(r.local?CJ:OJ)(r,t))}function RJ(e,t){return function(){AS(this,e).delay=+t.apply(this,arguments)}}function jJ(e,t){return t=+t,function(){AS(this,e).delay=t}}function MJ(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?RJ:jJ)(t,e)):Pr(this.node(),t).delay}function $J(e,t){return function(){ti(this,e).duration=+t.apply(this,arguments)}}function DJ(e,t){return t=+t,function(){ti(this,e).duration=t}}function IJ(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$J:DJ)(t,e)):Pr(this.node(),t).duration}function PJ(e,t){if(typeof t!="function")throw new Error;return function(){ti(this,e).ease=t}}function LJ(e){var t=this._id;return arguments.length?this.each(PJ(t,e)):Pr(this.node(),t).ease}function zJ(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ti(this,e).ease=n}}function qJ(e){if(typeof e!="function")throw new Error;return this.each(zJ(this._id,e))}function FJ(e){typeof e!="function"&&(e=V5(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=[],c,f=0;f<o;++f)(c=a[f])&&e.call(c,c.__data__,f,a)&&l.push(c);return new $i(r,this._parents,this._name,this._id)}function BJ(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=new Array(r),l=0;l<a;++l)for(var c=t[l],f=n[l],d=c.length,h=o[l]=new Array(d),m,g=0;g<d;++g)(m=c[g]||f[g])&&(h[g]=m);for(;l<r;++l)o[l]=t[l];return new $i(o,this._parents,this._name,this._id)}function UJ(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function VJ(e,t,n){var r,i,a=UJ(t)?AS:ti;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function HJ(e,t){var n=this._id;return arguments.length<2?Pr(this.node(),n).on.on(e):this.each(VJ(n,e,t))}function GJ(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function YJ(){return this.on("end.remove",GJ(this._id))}function ZJ(e){var t=this._name,n=this._id;typeof e!="function"&&(e=wS(e));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var l=r[o],c=l.length,f=a[o]=new Array(c),d,h,m=0;m<c;++m)(d=l[m])&&(h=e.call(d,d.__data__,m,l))&&("__data__"in d&&(h.__data__=d.__data__),f[m]=h,Op(f[m],t,n,m,f,Pr(d,n)));return new $i(a,this._parents,t,n)}function KJ(e){var t=this._name,n=this._id;typeof e!="function"&&(e=U5(e));for(var r=this._groups,i=r.length,a=[],o=[],l=0;l<i;++l)for(var c=r[l],f=c.length,d,h=0;h<f;++h)if(d=c[h]){for(var m=e.call(d,d.__data__,h,c),g,v=Pr(d,n),w=0,b=m.length;w<b;++w)(g=m[w])&&Op(g,t,n,w,m,v);a.push(m),o.push(d)}return new $i(a,o,t,n)}var XJ=Tc.prototype.constructor;function WJ(){return new XJ(this._groups,this._parents)}function QJ(e,t){var n,r,i;return function(){var a=Go(this,e),o=(this.style.removeProperty(e),Go(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function p9(e){return function(){this.style.removeProperty(e)}}function JJ(e,t,n){var r,i=n+"",a;return function(){var o=Go(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function eee(e,t,n){var r,i,a;return function(){var o=Go(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),Go(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l))}}function tee(e,t){var n,r,i,a="style."+t,o="end."+a,l;return function(){var c=ti(this,e),f=c.on,d=c.value[a]==null?l||(l=p9(t)):void 0;(f!==n||i!==d)&&(r=(n=f).copy()).on(o,i=d),c.on=r}}function nee(e,t,n){var r=(e+="")=="transform"?nJ:h9;return t==null?this.styleTween(e,QJ(e,r)).on("end.style."+e,p9(e)):typeof t=="function"?this.styleTween(e,eee(e,r,TS(this,"style."+e,t))).each(tee(this._id,e)):this.styleTween(e,JJ(e,r,t),n).on("end.style."+e,null)}function ree(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function iee(e,t,n){var r,i;function a(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&ree(e,o,n)),r}return a._value=t,a}function aee(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 new Error;return this.tween(r,iee(e,t,n??""))}function see(e){return function(){this.textContent=e}}function oee(e){return function(){var t=e(this);this.textContent=t??""}}function lee(e){return this.tween("text",typeof e=="function"?oee(TS(this,"text",e)):see(e==null?"":e+""))}function uee(e){return function(t){this.textContent=e.call(this,t)}}function cee(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&uee(i)),t}return r._value=e,r}function fee(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 new Error;return this.tween(t,cee(e))}function dee(){for(var e=this._name,t=this._id,n=m9(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,c,f=0;f<l;++f)if(c=o[f]){var d=Pr(c,t);Op(c,e,n,f,o,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new $i(r,this._parents,e,n)}function hee(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var l={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var f=ti(this,r),d=f.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),f.on=t}),i===0&&a()})}var pee=0;function $i(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function m9(){return++pee}var Si=Tc.prototype;$i.prototype={constructor:$i,select:ZJ,selectAll:KJ,selectChild:Si.selectChild,selectChildren:Si.selectChildren,filter:FJ,merge:BJ,selection:WJ,transition:dee,call:Si.call,nodes:Si.nodes,node:Si.node,size:Si.size,empty:Si.empty,each:Si.each,on:HJ,attr:kJ,attrTween:NJ,style:nee,styleTween:aee,text:lee,textTween:fee,remove:YJ,tween:bJ,delay:MJ,duration:IJ,ease:LJ,easeVarying:qJ,end:hee,[Symbol.iterator]:Si[Symbol.iterator]};function mee(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var gee={time:null,delay:0,duration:250,ease:mee};function yee(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function bee(e){var t,n;e instanceof $i?(t=e._id,e=e._name):(t=m9(),(n=gee).time=kS(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,c,f=0;f<l;++f)(c=o[f])&&Op(c,e,t,f,o,n||yee(c,t));return new $i(r,this._parents,e,t)}Tc.prototype.interrupt=mJ;Tc.prototype.transition=bee;const Td=e=>()=>e;function vee(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 Ci(e,t,n){this.k=e,this.x=t,this.y=n}Ci.prototype={constructor:Ci,scale:function(e){return e===1?this:new Ci(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ci(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 Np=new Ci(1,0,0);g9.prototype=Ci.prototype;function g9(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Np;return e.__zoom}function x0(e){e.stopImmediatePropagation()}function Cu(e){e.preventDefault(),e.stopImmediatePropagation()}function _ee(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function xee(){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 BO(){return this.__zoom||Np}function wee(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function See(){return navigator.maxTouchPoints||"ontouchstart"in this}function Eee(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 y9(){var e=_ee,t=xee,n=Eee,r=wee,i=See,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=oJ,f=Ap("start","zoom","end"),d,h,m,g=500,v=150,w=0,b=10;function _(D){D.property("__zoom",BO).on("wheel.zoom",$,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",M).filter(i).on("touchstart.zoom",z).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(D,H,B,G){var K=D.selection?D.selection():D;K.property("__zoom",BO),D!==K?k(D,H,B,G):K.interrupt().each(function(){T(this,arguments).event(G).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},_.scaleBy=function(D,H,B,G){_.scaleTo(D,function(){var K=this.__zoom.k,Q=typeof H=="function"?H.apply(this,arguments):H;return K*Q},B,G)},_.scaleTo=function(D,H,B,G){_.transform(D,function(){var K=t.apply(this,arguments),Q=this.__zoom,R=B==null?A(K):typeof B=="function"?B.apply(this,arguments):B,V=Q.invert(R),X=typeof H=="function"?H.apply(this,arguments):H;return n(x(S(Q,X),R,V),K,o)},B,G)},_.translateBy=function(D,H,B,G){_.transform(D,function(){return n(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof B=="function"?B.apply(this,arguments):B),t.apply(this,arguments),o)},null,G)},_.translateTo=function(D,H,B,G,K){_.transform(D,function(){var Q=t.apply(this,arguments),R=this.__zoom,V=G==null?A(Q):typeof G=="function"?G.apply(this,arguments):G;return n(Np.translate(V[0],V[1]).scale(R.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof B=="function"?-B.apply(this,arguments):-B),Q,o)},G,K)};function S(D,H){return H=Math.max(a[0],Math.min(a[1],H)),H===D.k?D:new Ci(H,D.x,D.y)}function x(D,H,B){var G=H[0]-B[0]*D.k,K=H[1]-B[1]*D.k;return G===D.x&&K===D.y?D:new Ci(D.k,G,K)}function A(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function k(D,H,B,G){D.on("start.zoom",function(){T(this,arguments).event(G).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(G).end()}).tween("zoom",function(){var K=this,Q=arguments,R=T(K,Q).event(G),V=t.apply(K,Q),X=B==null?A(V):typeof B=="function"?B.apply(K,Q):B,j=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),I=K.__zoom,U=typeof H=="function"?H.apply(K,Q):H,Y=c(I.invert(X).concat(j/I.k),U.invert(X).concat(j/U.k));return function(ne){if(ne===1)ne=U;else{var ae=Y(ne),re=j/ae[2];ne=new Ci(re,X[0]-ae[0]*re,X[1]-ae[1]*re)}R.zoom(null,ne)}})}function T(D,H,B){return!B&&D.__zooming||new O(D,H)}function O(D,H){this.that=D,this.args=H,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,H),this.taps=0}O.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,H){return this.mouse&&D!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var H=er(this.that).datum();f.call(D,this.that,new vee(D,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:f}),H)}};function $(D,...H){if(!e.apply(this,arguments))return;var B=T(this,H).event(D),G=this.__zoom,K=Math.max(a[0],Math.min(a[1],G.k*Math.pow(2,r.apply(this,arguments)))),Q=Nr(D);if(B.wheel)(B.mouse[0][0]!==Q[0]||B.mouse[0][1]!==Q[1])&&(B.mouse[1]=G.invert(B.mouse[0]=Q)),clearTimeout(B.wheel);else{if(G.k===K)return;B.mouse=[Q,G.invert(Q)],Th(this),B.start()}Cu(D),B.wheel=setTimeout(R,v),B.zoom("mouse",n(x(S(G,K),B.mouse[0],B.mouse[1]),B.extent,o));function R(){B.wheel=null,B.end()}}function L(D,...H){if(m||!e.apply(this,arguments))return;var B=D.currentTarget,G=T(this,H,!0).event(D),K=er(D.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",j,!0),Q=Nr(D,B),R=D.clientX,V=D.clientY;e9(D.view),x0(D),G.mouse=[Q,this.__zoom.invert(Q)],Th(this),G.start();function X(I){if(Cu(I),!G.moved){var U=I.clientX-R,Y=I.clientY-V;G.moved=U*U+Y*Y>w}G.event(I).zoom("mouse",n(x(G.that.__zoom,G.mouse[0]=Nr(I,B),G.mouse[1]),G.extent,o))}function j(I){K.on("mousemove.zoom mouseup.zoom",null),t9(I.view,G.moved),Cu(I),G.event(I).end()}}function M(D,...H){if(e.apply(this,arguments)){var B=this.__zoom,G=Nr(D.changedTouches?D.changedTouches[0]:D,this),K=B.invert(G),Q=B.k*(D.shiftKey?.5:2),R=n(x(S(B,Q),G,K),t.apply(this,H),o);Cu(D),l>0?er(this).transition().duration(l).call(k,R,G,D):er(this).call(_.transform,R,G,D)}}function z(D,...H){if(e.apply(this,arguments)){var B=D.touches,G=B.length,K=T(this,H,D.changedTouches.length===G).event(D),Q,R,V,X;for(x0(D),R=0;R<G;++R)V=B[R],X=Nr(V,this),X=[X,this.__zoom.invert(X),V.identifier],K.touch0?!K.touch1&&K.touch0[2]!==X[2]&&(K.touch1=X,K.taps=0):(K.touch0=X,Q=!0,K.taps=1+!!d);d&&(d=clearTimeout(d)),Q&&(K.taps<2&&(h=X[0],d=setTimeout(function(){d=null},g)),Th(this),K.start())}}function P(D,...H){if(this.__zooming){var B=T(this,H).event(D),G=D.changedTouches,K=G.length,Q,R,V,X;for(Cu(D),Q=0;Q<K;++Q)R=G[Q],V=Nr(R,this),B.touch0&&B.touch0[2]===R.identifier?B.touch0[0]=V:B.touch1&&B.touch1[2]===R.identifier&&(B.touch1[0]=V);if(R=B.that.__zoom,B.touch1){var j=B.touch0[0],I=B.touch0[1],U=B.touch1[0],Y=B.touch1[1],ne=(ne=U[0]-j[0])*ne+(ne=U[1]-j[1])*ne,ae=(ae=Y[0]-I[0])*ae+(ae=Y[1]-I[1])*ae;R=S(R,Math.sqrt(ne/ae)),V=[(j[0]+U[0])/2,(j[1]+U[1])/2],X=[(I[0]+Y[0])/2,(I[1]+Y[1])/2]}else if(B.touch0)V=B.touch0[0],X=B.touch0[1];else return;B.zoom("touch",n(x(R,V,X),B.extent,o))}}function q(D,...H){if(this.__zooming){var B=T(this,H).event(D),G=D.changedTouches,K=G.length,Q,R;for(x0(D),m&&clearTimeout(m),m=setTimeout(function(){m=null},g),Q=0;Q<K;++Q)R=G[Q],B.touch0&&B.touch0[2]===R.identifier?delete B.touch0:B.touch1&&B.touch1[2]===R.identifier&&delete B.touch1;if(B.touch1&&!B.touch0&&(B.touch0=B.touch1,delete B.touch1),B.touch0)B.touch0[1]=this.__zoom.invert(B.touch0[0]);else if(B.end(),B.taps===2&&(R=Nr(R,this),Math.hypot(h[0]-R[0],h[1]-R[1])<b)){var V=er(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return _.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:Td(+D),_):r},_.filter=function(D){return arguments.length?(e=typeof D=="function"?D:Td(!!D),_):e},_.touchable=function(D){return arguments.length?(i=typeof D=="function"?D:Td(!!D),_):i},_.extent=function(D){return arguments.length?(t=typeof D=="function"?D:Td([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),_):t},_.scaleExtent=function(D){return arguments.length?(a[0]=+D[0],a[1]=+D[1],_):[a[0],a[1]]},_.translateExtent=function(D){return arguments.length?(o[0][0]=+D[0][0],o[1][0]=+D[1][0],o[0][1]=+D[0][1],o[1][1]=+D[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(D){return arguments.length?(n=D,_):n},_.duration=function(D){return arguments.length?(l=+D,_):l},_.interpolate=function(D){return arguments.length?(c=D,_):c},_.on=function(){var D=f.on.apply(f,arguments);return D===f?_:D},_.clickDistance=function(D){return arguments.length?(w=(D=+D)*D,_):Math.sqrt(w)},_.tapDistance=function(D){return arguments.length?(b=+D,_):b},_}const Jr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.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 React Flow 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."},cc=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],b9=["Enter"," ","Escape"];var Zo;(function(e){e.Strict="strict",e.Loose="loose"})(Zo||(Zo={}));var bs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(bs||(bs={}));var fc;(function(e){e.Partial="partial",e.Full="full"})(fc||(fc={}));const v9={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Ca;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ca||(Ca={}));var ep;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ep||(ep={}));var Pe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Pe||(Pe={}));const UO={[Pe.Left]:Pe.Right,[Pe.Right]:Pe.Left,[Pe.Top]:Pe.Bottom,[Pe.Bottom]:Pe.Top};function _9(e){return e===null?null:e?"valid":"invalid"}const x9=e=>"id"in e&&"source"in e&&"target"in e,kee=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),CS=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Oc=(e,t=[0,0])=>{const{width:n,height:r}=zi(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},Aee=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const a=typeof i=="string";let o=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(o=a?t.nodeLookup.get(i):CS(i)?i:t.nodeLookup.get(i.id));const l=o?tp(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Rp(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return jp(n)},Nc=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const i=tp(r);n=Rp(n,i)}}),jp(n)},w9=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l={...Rc(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(const f of e.values()){const{measured:d,selectable:h=!0,hidden:m=!1}=f;if(o&&!h||m)continue;const g=d.width??f.width??f.initialWidth??null,v=d.height??f.height??f.initialHeight??null,w=dc(l,Xo(f)),b=(g??0)*(v??0),_=a&&w>0;(!f.internals.handleBounds||_||w>=b||f.dragging)&&c.push(f)}return c},Tee=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Cee(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function Oee({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);const l=Cee(e,o),c=Nc(l),f=OS(c,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??a,(o==null?void 0:o.padding)??.1);return await r.setViewport(f,{duration:o==null?void 0:o.duration}),Promise.resolve(!0)}function S9({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:f}=l?l.internals.positionAbsolute:{x:0,y:0},d=o.origin??r;let h=i;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",Jr.error005());else{const g=l.measured.width,v=l.measured.height;g&&v&&(h=[[c,f],[c+g,f+v]])}else l&&Wo(o.extent)&&(h=[[o.extent[0][0]+c,o.extent[0][1]+f],[o.extent[1][0]+c,o.extent[1][1]+f]]);const m=Wo(h)?ws(t,h,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",Jr.error015())),{position:{x:m.x-c+(o.measured.width??0)*d[0],y:m.y-f+(o.measured.height??0)*d[1]},positionAbsolute:m}}async function Nee({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const a=new Set(e.map(m=>m.id)),o=[];for(const m of n){if(m.deletable===!1)continue;const g=a.has(m.id),v=!g&&m.parentId&&o.find(w=>w.id===m.parentId);(g||v)&&o.push(m)}const l=new Set(t.map(m=>m.id)),c=r.filter(m=>m.deletable!==!1),d=Tee(o,c);for(const m of c)l.has(m.id)&&!d.find(v=>v.id===m.id)&&d.push(m);if(!i)return{edges:d,nodes:o};const h=await i({nodes:o,edges:d});return typeof h=="boolean"?h?{edges:d,nodes:o}:{edges:[],nodes:[]}:h}const Ko=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ws=(e={x:0,y:0},t,n)=>({x:Ko(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ko(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function E9(e,t,n){const{width:r,height:i}=zi(n),{x:a,y:o}=n.internals.positionAbsolute;return ws(e,[[a,o],[a+r,o+i]],t)}const VO=(e,t,n)=>e<t?Ko(Math.abs(e-t),1,t)/t:e>n?-Ko(Math.abs(e-n),1,t)/t:0,k9=(e,t,n=15,r=40)=>{const i=VO(e.x,r,t.width-r)*n,a=VO(e.y,r,t.height-r)*n;return[i,a]},Rp=(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)}),Mw=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),jp=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Xo=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=CS(e)?e.internals.positionAbsolute:Oc(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},tp=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=CS(e)?e.internals.positionAbsolute:Oc(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},A9=(e,t)=>jp(Rp(Mw(e),Mw(t))),dc=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},HO=e=>jr(e.width)&&jr(e.height)&&jr(e.x)&&jr(e.y),jr=e=>!isNaN(e)&&isFinite(e),Ree=(e,t)=>{},Mp=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Rc=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?Mp(l,o):l},np=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function To(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function jee(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=To(e,n),i=To(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=To(e.top??e.y??0,n),i=To(e.bottom??e.y??0,n),a=To(e.left??e.x??0,t),o=To(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 Mee(e,t,n,r,i,a){const{x:o,y:l}=np(e,[t,n,r]),{x:c,y:f}=np({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=i-c,h=a-f;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(h)}}const OS=(e,t,n,r,i,a)=>{const o=jee(a,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,f=Math.min(l,c),d=Ko(f,r,i),h=e.x+e.width/2,m=e.y+e.height/2,g=t/2-h*d,v=n/2-m*d,w=Mee(e,g,v,d,t,n),b={left:Math.min(w.left-o.left,0),top:Math.min(w.top-o.top,0),right:Math.min(w.right-o.right,0),bottom:Math.min(w.bottom-o.bottom,0)};return{x:g-b.left+b.right,y:v-b.top+b.bottom,zoom:d}},rp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Wo(e){return e!==void 0&&e!=="parent"}function zi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function T9(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function C9(e,t={width:0,height:0},n,r,i){const a={...e},o=r.get(n);if(o){const l=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return a}function GO(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function $ee(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function Gu(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=Ri(e),l=Rc({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:c,y:f}=n?Mp(l,t):l;return{xSnapped:c,ySnapped:f,...l}}const NS=e=>({width:e.offsetWidth,height:e.offsetHeight}),O9=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Dee=["INPUT","SELECT","TEXTAREA"];function N9(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Dee.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const R9=e=>"clientX"in e,Ri=(e,t)=>{var a,o;const n=R9(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},YO=(e,t,n,r,i)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...NS(o)}})};function j9({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:l}){const c=e*.125+i*.375+o*.375+n*.125,f=t*.125+a*.375+l*.375+r*.125,d=Math.abs(c-e),h=Math.abs(f-t);return[c,f,d,h]}function Cd(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ZO({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Pe.Left:return[t-Cd(t-r,a),n];case Pe.Right:return[t+Cd(r-t,a),n];case Pe.Top:return[t,n-Cd(n-i,a)];case Pe.Bottom:return[t,n+Cd(i-n,a)]}}function M9({sourceX:e,sourceY:t,sourcePosition:n=Pe.Bottom,targetX:r,targetY:i,targetPosition:a=Pe.Top,curvature:o=.25}){const[l,c]=ZO({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[f,d]=ZO({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[h,m,g,v]=j9({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:f,targetControlY:d});return[`M${e},${t} C${l},${c} ${f},${d} ${r},${i}`,h,m,g,v]}function $9({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2,l=r<t?r+o:r-o;return[a,l,i,o]}function Iee({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1}){if(!i)return r;const a=n||t.selected||e.selected,o=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(a?o:0)}function Pee({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const a=Rp(tp(e),tp(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const o={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return dc(o,jp(a))>0}const Lee=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,zee=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),qee=(e,t)=>{if(!e.source||!e.target)return t;let n;return x9(e)?n={...e}:n={...e,id:Lee(e)},zee(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function D9({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=$9({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const KO={[Pe.Left]:{x:-1,y:0},[Pe.Right]:{x:1,y:0},[Pe.Top]:{x:0,y:-1},[Pe.Bottom]:{x:0,y:1}},Fee=({source:e,sourcePosition:t=Pe.Bottom,target:n})=>t===Pe.Left||t===Pe.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},XO=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Bee({source:e,sourcePosition:t=Pe.Bottom,target:n,targetPosition:r=Pe.Top,center:i,offset:a}){const o=KO[t],l=KO[r],c={x:e.x+o.x*a,y:e.y+o.y*a},f={x:n.x+l.x*a,y:n.y+l.y*a},d=Fee({source:c,sourcePosition:t,target:f}),h=d.x!==0?"x":"y",m=d[h];let g=[],v,w;const b={x:0,y:0},_={x:0,y:0},[S,x,A,k]=$9({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[h]*l[h]===-1){v=i.x??S,w=i.y??x;const O=[{x:v,y:c.y},{x:v,y:f.y}],$=[{x:c.x,y:w},{x:f.x,y:w}];o[h]===m?g=h==="x"?O:$:g=h==="x"?$:O}else{const O=[{x:c.x,y:f.y}],$=[{x:f.x,y:c.y}];if(h==="x"?g=o.x===m?$:O:g=o.y===m?O:$,t===r){const q=Math.abs(e[h]-n[h]);if(q<=a){const D=Math.min(a-1,a-q);o[h]===m?b[h]=(c[h]>e[h]?-1:1)*D:_[h]=(f[h]>n[h]?-1:1)*D}}if(t!==r){const q=h==="x"?"y":"x",D=o[h]===l[q],H=c[q]>f[q],B=c[q]<f[q];(o[h]===1&&(!D&&H||D&&B)||o[h]!==1&&(!D&&B||D&&H))&&(g=h==="x"?O:$)}const L={x:c.x+b.x,y:c.y+b.y},M={x:f.x+_.x,y:f.y+_.y},z=Math.max(Math.abs(L.x-g[0].x),Math.abs(M.x-g[0].x)),P=Math.max(Math.abs(L.y-g[0].y),Math.abs(M.y-g[0].y));z>=P?(v=(L.x+M.x)/2,w=g[0].y):(v=g[0].x,w=(L.y+M.y)/2)}return[[e,{x:c.x+b.x,y:c.y+b.y},...g,{x:f.x+_.x,y:f.y+_.y},n],v,w,A,k]}function Uee(e,t,n,r){const i=Math.min(XO(e,t)/2,XO(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){const f=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${a+i*f},${o}Q ${a},${o} ${a},${o+i*d}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${a},${o+i*c}Q ${a},${o} ${a+i*l},${o}`}function $w({sourceX:e,sourceY:t,sourcePosition:n=Pe.Bottom,targetX:r,targetY:i,targetPosition:a=Pe.Top,borderRadius:o=5,centerX:l,centerY:c,offset:f=20}){const[d,h,m,g,v]=Bee({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:l,y:c},offset:f});return[d.reduce((b,_,S)=>{let x="";return S>0&&S<d.length-1?x=Uee(d[S-1],_,d[S+1],o):x=`${S===0?"M":"L"}${_.x} ${_.y}`,b+=x,b},""),h,m,g,v]}function WO(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Vee(e){var h;const{sourceNode:t,targetNode:n}=e;if(!WO(t)||!WO(n))return null;const r=t.internals.handleBounds||QO(t.handles),i=n.internals.handleBounds||QO(n.handles),a=JO((r==null?void 0:r.source)??[],e.sourceHandle),o=JO(e.connectionMode===Zo.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!a||!o)return(h=e.onError)==null||h.call(e,"008",Jr.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(a==null?void 0:a.position)||Pe.Bottom,c=(o==null?void 0:o.position)||Pe.Top,f=hc(t,a,l),d=hc(n,o,c);return{sourceX:f.x,sourceY:f.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}}function QO(e){if(!e)return null;const t=[],n=[];for(const 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 hc(e,t,n=Pe.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:l}=t??zi(e);if(r)return{x:i+o/2,y:a+l/2};switch((t==null?void 0:t.position)??n){case Pe.Top:return{x:i+o/2,y:a};case Pe.Right:return{x:i+o,y:a+l/2};case Pe.Bottom:return{x:i+o/2,y:a+l};case Pe.Left:return{x:i,y:a+l/2}}}function JO(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Dw(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Hee(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const a=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){const f=Dw(c,t);a.has(f)||(o.push({id:f,color:c.color||n,...c}),a.add(f))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const RS={nodeOrigin:[0,0],nodeExtent:cc,elevateNodesOnSelect:!0,defaults:{}},Gee={...RS,checkEquality:!0};function jS(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Yee(e,t,n){const r=jS(RS,n);for(const i of e.values())if(i.parentId)MS(i,e,t,r);else{const a=Oc(i,r.nodeOrigin),o=Wo(i.extent)?i.extent:r.nodeExtent,l=ws(a,o,zi(i));i.internals.positionAbsolute=l}}function Iw(e,t,n,r){var c,f;const i=jS(Gee,r);let a=e.length>0;const o=new Map(t),l=i!=null&&i.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const d of e){let h=o.get(d.id);if(i.checkEquality&&d===(h==null?void 0:h.internals.userNode))t.set(d.id,h);else{const m=Oc(d,i.nodeOrigin),g=Wo(d.extent)?d.extent:i.nodeExtent,v=ws(m,g,zi(d));h={...i.defaults,...d,measured:{width:(c=d.measured)==null?void 0:c.width,height:(f=d.measured)==null?void 0:f.height},internals:{positionAbsolute:v,handleBounds:d.measured?h==null?void 0:h.internals.handleBounds:void 0,z:I9(d,l),userNode:d}},t.set(d.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(a=!1),d.parentId&&MS(h,t,n,r)}return a}function Zee(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function MS(e,t,n,r){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o}=jS(RS,r),l=e.parentId,c=t.get(l);if(!c){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}Zee(e,n);const f=i?1e3:0,{x:d,y:h,z:m}=Kee(e,c,a,o,f),{positionAbsolute:g}=e.internals,v=d!==g.x||h!==g.y;(v||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:d,y:h}:g,z:m}})}function I9(e,t){return(jr(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Kee(e,t,n,r,i){const{x:a,y:o}=t.internals.positionAbsolute,l=zi(e),c=Oc(e,n),f=Wo(e.extent)?ws(c,e.extent,l):c;let d=ws({x:a+f.x,y:o+f.y},r,l);e.extent==="parent"&&(d=E9(d,l,t));const h=I9(e,i),m=t.internals.z??0;return{x:d.x,y:d.y,z:m>h?m:h}}function $S(e,t,n,r=[0,0]){var o;const i=[],a=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const f=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??Xo(c),d=A9(f,l.rect);a.set(l.parentId,{expandedRect:d,parent:c})}return a.size>0&&a.forEach(({expandedRect:l,parent:c},f)=>{var x;const d=c.internals.positionAbsolute,h=zi(c),m=c.origin??r,g=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,v=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,w=Math.max(h.width,Math.round(l.width)),b=Math.max(h.height,Math.round(l.height)),_=(w-h.width)*m[0],S=(b-h.height)*m[1];(g>0||v>0||_||S)&&(i.push({id:f,type:"position",position:{x:c.position.x-g+_,y:c.position.y-v+S}}),(x=n.get(f))==null||x.forEach(A=>{e.some(k=>k.id===A.id)||i.push({id:A.id,type:"position",position:{x:A.position.x+g,y:A.position.y+v}})})),(h.width<l.width||h.height<l.height||g||v)&&i.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:w+(g?m[0]*g-_:0),height:b+(v?m[1]*v-S:0)}})}),i}function Xee(e,t,n,r,i,a){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!o)return{changes:[],updatedInternals:l};const c=[],f=window.getComputedStyle(o),{m22:d}=new window.DOMMatrixReadOnly(f.transform),h=[];for(const m of e.values()){const g=t.get(m.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),l=!0;continue}const v=NS(m.nodeElement),w=g.measured.width!==v.width||g.measured.height!==v.height;if(!!(v.width&&v.height&&(w||!g.internals.handleBounds||m.force))){const _=m.nodeElement.getBoundingClientRect(),S=Wo(g.extent)?g.extent:a;let{positionAbsolute:x}=g.internals;g.parentId&&g.extent==="parent"?x=E9(x,v,t.get(g.parentId)):S&&(x=ws(x,S,v));const A={...g,measured:v,internals:{...g.internals,positionAbsolute:x,handleBounds:{source:YO("source",m.nodeElement,_,d,g.id),target:YO("target",m.nodeElement,_,d,g.id)}}};t.set(g.id,A),g.parentId&&MS(A,t,n,{nodeOrigin:i}),l=!0,w&&(c.push({id:g.id,type:"dimensions",dimensions:v}),g.expandParent&&g.parentId&&h.push({id:g.id,parentId:g.parentId,rect:Xo(A,i)}))}}if(h.length>0){const m=$S(h,t,n,i);c.push(...m)}return{changes:c,updatedInternals:l}}async function Wee({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function eN(e,t,n,r,i,a){let o=i;const l=r.get(o)||new Map;r.set(o,l.set(n,t)),o=`${i}-${e}`;const c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;const f=r.get(o)||new Map;r.set(o,f.set(n,t))}}function P9(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:a,sourceHandle:o=null,targetHandle:l=null}=r,c={edgeId:r.id,source:i,target:a,sourceHandle:o,targetHandle:l},f=`${i}-${o}--${a}-${l}`,d=`${a}-${l}--${i}-${o}`;eN("source",c,d,e,i,o),eN("target",c,f,e,a,l),t.set(r.id,r)}}function L9(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:L9(n,t):!1}function tN(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Qee(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!L9(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(a);l&&i.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function w0({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,c;const i=[];for(const[f,d]of t){const h=(o=n.get(f))==null?void 0:o.internals.userNode;h&&i.push({...h,position:d.position,dragging:r})}if(!e)return[i[0],i];const a=(l=n.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((c=t.get(e))==null?void 0:c.position)||a.position,dragging:r}:i[0],i]}function Jee({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,l=new Map,c=!1,f={x:0,y:0},d=null,h=!1,m=null,g=!1;function v({noDragClassName:b,handleSelector:_,domNode:S,isSelectable:x,nodeId:A,nodeClickDistance:k=0}){m=er(S);function T({x:M,y:z},P){const{nodeLookup:q,nodeExtent:D,snapGrid:H,snapToGrid:B,nodeOrigin:G,onNodeDrag:K,onSelectionDrag:Q,onError:R,updateNodePositions:V}=t();a={x:M,y:z};let X=!1,j={x:0,y:0,x2:0,y2:0};if(l.size>1&&D){const I=Nc(l);j=Mw(I)}for(const[I,U]of l){if(!q.has(I))continue;let Y={x:M-U.distance.x,y:z-U.distance.y};B&&(Y=Mp(Y,H));let ne=[[D[0][0],D[0][1]],[D[1][0],D[1][1]]];if(l.size>1&&D&&!U.extent){const{positionAbsolute:le}=U.internals,W=le.x-j.x+D[0][0],J=le.x+U.measured.width-j.x2+D[1][0],se=le.y-j.y+D[0][1],fe=le.y+U.measured.height-j.y2+D[1][1];ne=[[W,se],[J,fe]]}const{position:ae,positionAbsolute:re}=S9({nodeId:I,nextPosition:Y,nodeLookup:q,nodeExtent:ne,nodeOrigin:G,onError:R});X=X||U.position.x!==ae.x||U.position.y!==ae.y,U.position=ae,U.internals.positionAbsolute=re}if(X&&(V(l,!0),P&&(r||K||!A&&Q))){const[I,U]=w0({nodeId:A,dragItems:l,nodeLookup:q});r==null||r(P,l,I,U),K==null||K(P,I,U),A||Q==null||Q(P,U)}}async function O(){if(!d)return;const{transform:M,panBy:z,autoPanSpeed:P,autoPanOnNodeDrag:q}=t();if(!q){c=!1,cancelAnimationFrame(o);return}const[D,H]=k9(f,d,P);(D!==0||H!==0)&&(a.x=(a.x??0)-D/M[2],a.y=(a.y??0)-H/M[2],await z({x:D,y:H})&&T(a,null)),o=requestAnimationFrame(O)}function $(M){var X;const{nodeLookup:z,multiSelectionActive:P,nodesDraggable:q,transform:D,snapGrid:H,snapToGrid:B,selectNodesOnDrag:G,onNodeDragStart:K,onSelectionDragStart:Q,unselectNodesAndEdges:R}=t();h=!0,(!G||!x)&&!P&&A&&((X=z.get(A))!=null&&X.selected||R()),x&&G&&A&&(e==null||e(A));const V=Gu(M.sourceEvent,{transform:D,snapGrid:H,snapToGrid:B,containerBounds:d});if(a=V,l=Qee(z,q,V,A),l.size>0&&(n||K||!A&&Q)){const[j,I]=w0({nodeId:A,dragItems:l,nodeLookup:z});n==null||n(M.sourceEvent,l,j,I),K==null||K(M.sourceEvent,j,I),A||Q==null||Q(M.sourceEvent,I)}}const L=n9().clickDistance(k).on("start",M=>{const{domNode:z,nodeDragThreshold:P,transform:q,snapGrid:D,snapToGrid:H}=t();d=(z==null?void 0:z.getBoundingClientRect())||null,g=!1,P===0&&$(M),a=Gu(M.sourceEvent,{transform:q,snapGrid:D,snapToGrid:H,containerBounds:d}),f=Ri(M.sourceEvent,d)}).on("drag",M=>{const{autoPanOnNodeDrag:z,transform:P,snapGrid:q,snapToGrid:D,nodeDragThreshold:H,nodeLookup:B}=t(),G=Gu(M.sourceEvent,{transform:P,snapGrid:q,snapToGrid:D,containerBounds:d});if((M.sourceEvent.type==="touchmove"&&M.sourceEvent.touches.length>1||A&&!B.has(A))&&(g=!0),!g){if(!c&&z&&h&&(c=!0,O()),!h){const K=G.xSnapped-(a.x??0),Q=G.ySnapped-(a.y??0);Math.sqrt(K*K+Q*Q)>H&&$(M)}(a.x!==G.xSnapped||a.y!==G.ySnapped)&&l&&h&&(f=Ri(M.sourceEvent,d),T(G,M.sourceEvent))}}).on("end",M=>{if(!(!h||g)&&(c=!1,h=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:z,updateNodePositions:P,onNodeDragStop:q,onSelectionDragStop:D}=t();if(P(l,!1),i||q||!A&&D){const[H,B]=w0({nodeId:A,dragItems:l,nodeLookup:z,dragging:!1});i==null||i(M.sourceEvent,l,H,B),q==null||q(M.sourceEvent,H,B),A||D==null||D(M.sourceEvent,B)}}}).filter(M=>{const z=M.target;return!M.button&&(!b||!tN(z,`.${b}`,S))&&(!_||tN(z,_,S))});m.call(L)}function w(){m==null||m.on(".drag",null)}return{update:v,destroy:w}}function ete(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())dc(i,Xo(a))>0&&r.push(a);return r}const tte=250;function nte(e,t,n,r){var l,c;let i=[],a=1/0;const o=ete(e,n,t+tte);for(const f of o){const d=[...((l=f.internals.handleBounds)==null?void 0:l.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const h of d){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;const{x:m,y:g}=hc(f,h,h.position,!0),v=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(g-e.y,2));v>t||(v<a?(i=[{...h,x:m,y:g}],a=v):v===a&&i.push({...h,x:m,y:g}))}}if(!i.length)return null;if(i.length>1){const f=r.type==="source"?"target":"source";return i.find(d=>d.type===f)??i[0]}return i[0]}function z9(e,t,n,r,i,a=!1){var f,d,h;const o=r.get(e);if(!o)return null;const l=i==="strict"?(f=o.internals.handleBounds)==null?void 0:f[t]:[...((d=o.internals.handleBounds)==null?void 0:d.source)??[],...((h=o.internals.handleBounds)==null?void 0:h.target)??[]],c=(n?l==null?void 0:l.find(m=>m.id===n):l==null?void 0:l[0])??null;return c&&a?{...c,...hc(o,c,c.position,!0)}:c}function q9(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function rte(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const F9=()=>!0;function ite(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:c,lib:f,autoPanOnConnect:d,flowId:h,panBy:m,cancelConnection:g,onConnectStart:v,onConnect:w,onConnectEnd:b,isValidConnection:_=F9,onReconnectEnd:S,updateConnection:x,getTransform:A,getFromHandle:k,autoPanSpeed:T}){const O=O9(e.target);let $=0,L;const{x:M,y:z}=Ri(e),P=O==null?void 0:O.elementFromPoint(M,z),q=q9(a,P),D=l==null?void 0:l.getBoundingClientRect();if(!D||!q)return;const H=z9(i,q,r,c,t);if(!H)return;let B=Ri(e,D),G=!1,K=null,Q=!1,R=null;function V(){if(!d||!D)return;const[re,le]=k9(B,D,T);m({x:re,y:le}),$=requestAnimationFrame(V)}const X={...H,nodeId:i,type:q,position:H.position},j=c.get(i),U={inProgress:!0,isValid:null,from:hc(j,X,Pe.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:j,to:B,toHandle:null,toPosition:UO[X.position],toNode:null};x(U);let Y=U;v==null||v(e,{nodeId:i,handleId:r,handleType:q});function ne(re){if(!k()||!X){ae(re);return}const le=A();B=Ri(re,D),L=nte(Rc(B,le,!1,[1,1]),n,c,X),G||(V(),G=!0);const W=B9(re,{handle:L,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:_,doc:O,lib:f,flowId:h,nodeLookup:c});R=W.handleDomNode,K=W.connection,Q=rte(!!L,W.isValid);const J={...Y,isValid:Q,to:W.toHandle&&Q?np({x:W.toHandle.x,y:W.toHandle.y},le):B,toHandle:W.toHandle,toPosition:Q&&W.toHandle?W.toHandle.position:UO[X.position],toNode:W.toHandle?c.get(W.toHandle.nodeId):null};Q&&L&&Y.toHandle&&J.toHandle&&Y.toHandle.type===J.toHandle.type&&Y.toHandle.nodeId===J.toHandle.nodeId&&Y.toHandle.id===J.toHandle.id&&Y.to.x===J.to.x&&Y.to.y===J.to.y||(x(J),Y=J)}function ae(re){(L||R)&&K&&Q&&(w==null||w(K));const{inProgress:le,...W}=Y,J={...W,toPosition:Y.toHandle?Y.toPosition:null};b==null||b(re,J),a&&(S==null||S(re,J)),g(),cancelAnimationFrame($),G=!1,Q=!1,K=null,R=null,O.removeEventListener("mousemove",ne),O.removeEventListener("mouseup",ae),O.removeEventListener("touchmove",ne),O.removeEventListener("touchend",ae)}O.addEventListener("mousemove",ne),O.addEventListener("mouseup",ae),O.addEventListener("touchmove",ne),O.addEventListener("touchend",ae)}function B9(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:c,isValidConnection:f=F9,nodeLookup:d}){const h=a==="target",m=t?o.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:g,y:v}=Ri(e),w=o.elementFromPoint(g,v),b=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:m,_={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const S=q9(void 0,b),x=b.getAttribute("data-nodeid"),A=b.getAttribute("data-handleid"),k=b.classList.contains("connectable"),T=b.classList.contains("connectableend");if(!x||!S)return _;const O={source:h?x:r,sourceHandle:h?A:i,target:h?r:x,targetHandle:h?i:A};_.connection=O;const L=k&&T&&(n===Zo.Strict?h&&S==="source"||!h&&S==="target":x!==r||A!==i);_.isValid=L&&f(O),_.toHandle=z9(x,S,A,d,n,!0)}return _}const Pw={onPointerDown:ite,isValid:B9};function ate({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=er(e);function a({translateExtent:l,width:c,height:f,zoomStep:d=10,pannable:h=!0,zoomable:m=!0,inversePan:g=!1}){const v=x=>{const A=n();if(x.sourceEvent.type!=="wheel"||!t)return;const k=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,T=A[2]*Math.pow(2,k);t.scaleTo(T)};let w=[0,0];const b=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(w=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},_=x=>{const A=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],T=[k[0]-w[0],k[1]-w[1]];w=k;const O=r()*Math.max(A[2],Math.log(A[2]))*(g?-1:1),$={x:A[0]-T[0]*O,y:A[1]-T[1]*O},L=[[0,0],[c,f]];t.setViewportConstrained({x:$.x,y:$.y,zoom:A[2]},L,l)},S=y9().on("start",b).on("zoom",h?_:null).on("zoom.wheel",m?v:null);i.call(S,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:Nr}}const ste=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,$p=e=>({x:e.x,y:e.y,zoom:e.k}),S0=({x:e,y:t,zoom:n})=>Np.translate(e,t).scale(n),$o=(e,t)=>e.target.closest(`.${t}`),U9=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),E0=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},V9=e=>{const t=e.ctrlKey&&rp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function ote({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:f}){return d=>{if($o(d,t))return!1;d.preventDefault(),d.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(d.ctrlKey&&o){const b=Nr(d),_=V9(d),S=h*Math.pow(2,_);r.scaleTo(n,S,b,d);return}const m=d.deltaMode===1?20:1;let g=i===bs.Vertical?0:d.deltaX*m,v=i===bs.Horizontal?0:d.deltaY*m;!rp()&&d.shiftKey&&i!==bs.Vertical&&(g=d.deltaY*m,v=0),r.translateBy(n,-(g/h)*a,-(v/h)*a,{internal:!0});const w=$p(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(d,w)),e.isPanScrolling&&(c==null||c(d,w),e.panScrollTimeout=setTimeout(()=>{f==null||f(d,w),e.isPanScrolling=!1},150))}}function lte({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=$o(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function ute({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=$p(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function cte({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&U9(t,e.mouseButton??0)),(o=a.sourceEvent)!=null&&o.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!((l=a.sourceEvent)!=null&&l.internal)&&(i==null||i(a.sourceEvent,$p(a.transform)))}}function fte({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,a&&U9(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&ste(e.prevViewport,o.transform))){const c=$p(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,c)},n?150:0)}}}function dte({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:f}){return d=>{var v;const h=e||t,m=n&&d.ctrlKey;if(d.button===1&&d.type==="mousedown"&&($o(d,`${f}-flow__node`)||$o(d,`${f}-flow__edge`)))return!0;if(!r&&!h&&!i&&!a&&!n||o||$o(d,l)&&d.type==="wheel"||$o(d,c)&&(d.type!=="wheel"||i&&d.type==="wheel"&&!e)||!n&&d.ctrlKey&&d.type==="wheel")return!1;if(!n&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!h&&!i&&!m&&d.type==="wheel"||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const g=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||d.type==="wheel")&&g}}function hte({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:a,onPanZoom:o,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:f}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),m=y9().clickDistance(!jr(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),g=er(e).call(m);x({x:a.x,y:a.y,zoom:Ko(a.zoom,t,n)},[[0,0],[h.width,h.height]],i);const v=g.on("wheel.zoom"),w=g.on("dblclick.zoom");m.wheelDelta(V9);function b(P,q){return g?new Promise(D=>{m==null||m.transform(E0(g,q==null?void 0:q.duration,()=>D(!0)),P)}):Promise.resolve(!1)}function _({noWheelClassName:P,noPanClassName:q,onPaneContextMenu:D,userSelectionActive:H,panOnScroll:B,panOnDrag:G,panOnScrollMode:K,panOnScrollSpeed:Q,preventScrolling:R,zoomOnPinch:V,zoomOnScroll:X,zoomOnDoubleClick:j,zoomActivationKeyPressed:I,lib:U,onTransformChange:Y}){H&&!d.isZoomingOrPanning&&S();const ae=B&&!I&&!H?ote({zoomPanValues:d,noWheelClassName:P,d3Selection:g,d3Zoom:m,panOnScrollMode:K,panOnScrollSpeed:Q,zoomOnPinch:V,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:c}):lte({noWheelClassName:P,preventScrolling:R,d3ZoomHandler:v});if(g.on("wheel.zoom",ae,{passive:!1}),!H){const le=ute({zoomPanValues:d,onDraggingChange:f,onPanZoomStart:l});m.on("start",le);const W=cte({zoomPanValues:d,panOnDrag:G,onPaneContextMenu:!!D,onPanZoom:o,onTransformChange:Y});m.on("zoom",W);const J=fte({zoomPanValues:d,panOnDrag:G,panOnScroll:B,onPaneContextMenu:D,onPanZoomEnd:c,onDraggingChange:f});m.on("end",J)}const re=dte({zoomActivationKeyPressed:I,panOnDrag:G,zoomOnScroll:X,panOnScroll:B,zoomOnDoubleClick:j,zoomOnPinch:V,userSelectionActive:H,noPanClassName:q,noWheelClassName:P,lib:U});m.filter(re),j?g.on("dblclick.zoom",w):g.on("dblclick.zoom",null)}function S(){m.on("zoom",null)}async function x(P,q,D){const H=S0(P),B=m==null?void 0:m.constrain()(H,q,D);return B&&await b(B),new Promise(G=>G(B))}async function A(P,q){const D=S0(P);return await b(D,q),new Promise(H=>H(D))}function k(P){if(g){const q=S0(P),D=g.property("__zoom");(D.k!==P.zoom||D.x!==P.x||D.y!==P.y)&&(m==null||m.transform(g,q,null,{sync:!0}))}}function T(){const P=g?g9(g.node()):{x:0,y:0,k:1};return{x:P.x,y:P.y,zoom:P.k}}function O(P,q){return g?new Promise(D=>{m==null||m.scaleTo(E0(g,q==null?void 0:q.duration,()=>D(!0)),P)}):Promise.resolve(!1)}function $(P,q){return g?new Promise(D=>{m==null||m.scaleBy(E0(g,q==null?void 0:q.duration,()=>D(!0)),P)}):Promise.resolve(!1)}function L(P){m==null||m.scaleExtent(P)}function M(P){m==null||m.translateExtent(P)}function z(P){const q=!jr(P)||P<0?0:P;m==null||m.clickDistance(q)}return{update:_,destroy:S,setViewport:A,setViewportConstrained:x,getViewport:T,scaleTo:O,scaleBy:$,setScaleExtent:L,setTranslateExtent:M,syncViewport:k,setClickDistance:z}}var Yu;(function(e){e.Line="line",e.Handle="handle"})(Yu||(Yu={}));function pte({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){const o=e-t,l=n-r,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&i&&(c[0]=c[0]*-1),l&&a&&(c[1]=c[1]*-1),c}function mte(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function _a(e,t){return Math.max(0,t-e)}function xa(e,t){return Math.max(0,e-t)}function Od(e,t,n){return Math.max(0,t-e,e-n)}function nN(e,t){return e?!t:t}function gte(e,t,n,r,i,a,o,l){let{affectsX:c,affectsY:f}=t;const{isHorizontal:d,isVertical:h}=t,m=d&&h,{xSnapped:g,ySnapped:v}=n,{minWidth:w,maxWidth:b,minHeight:_,maxHeight:S}=r,{x,y:A,width:k,height:T,aspectRatio:O}=e;let $=Math.floor(d?g-e.pointerX:0),L=Math.floor(h?v-e.pointerY:0);const M=k+(c?-$:$),z=T+(f?-L:L),P=-a[0]*k,q=-a[1]*T;let D=Od(M,w,b),H=Od(z,_,S);if(o){let K=0,Q=0;c&&$<0?K=_a(x+$+P,o[0][0]):!c&&$>0&&(K=xa(x+M+P,o[1][0])),f&&L<0?Q=_a(A+L+q,o[0][1]):!f&&L>0&&(Q=xa(A+z+q,o[1][1])),D=Math.max(D,K),H=Math.max(H,Q)}if(l){let K=0,Q=0;c&&$>0?K=xa(x+$,l[0][0]):!c&&$<0&&(K=_a(x+M,l[1][0])),f&&L>0?Q=xa(A+L,l[0][1]):!f&&L<0&&(Q=_a(A+z,l[1][1])),D=Math.max(D,K),H=Math.max(H,Q)}if(i){if(d){const K=Od(M/O,_,S)*O;if(D=Math.max(D,K),o){let Q=0;!c&&!f||c&&!f&&m?Q=xa(A+q+M/O,o[1][1])*O:Q=_a(A+q+(c?$:-$)/O,o[0][1])*O,D=Math.max(D,Q)}if(l){let Q=0;!c&&!f||c&&!f&&m?Q=_a(A+M/O,l[1][1])*O:Q=xa(A+(c?$:-$)/O,l[0][1])*O,D=Math.max(D,Q)}}if(h){const K=Od(z*O,w,b)/O;if(H=Math.max(H,K),o){let Q=0;!c&&!f||f&&!c&&m?Q=xa(x+z*O+P,o[1][0])/O:Q=_a(x+(f?L:-L)*O+P,o[0][0])/O,H=Math.max(H,Q)}if(l){let Q=0;!c&&!f||f&&!c&&m?Q=_a(x+z*O,l[1][0])/O:Q=xa(x+(f?L:-L)*O,l[0][0])/O,H=Math.max(H,Q)}}}L=L+(L<0?H:-H),$=$+($<0?D:-D),i&&(m?M>z*O?L=(nN(c,f)?-$:$)/O:$=(nN(c,f)?-L:L)*O:d?(L=$/O,f=c):($=L*O,c=f));const B=c?x+$:x,G=f?A+L:A;return{width:k+(c?-$:$),height:T+(f?-L:L),x:a[0]*$*(c?-1:1)+B,y:a[1]*L*(f?-1:1)+G}}const H9={width:0,height:0,x:0,y:0},yte={...H9,pointerX:0,pointerY:0,aspectRatio:1};function bte(e){return[[0,0],[e.measured.width,e.measured.height]]}function vte(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,l=n[0]*a,c=n[1]*o;return[[r-l,i-c],[r+a-l,i+o-c]]}function _te({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=er(e);function o({controlPosition:c,boundaries:f,keepAspectRatio:d,resizeDirection:h,onResizeStart:m,onResize:g,onResizeEnd:v,shouldResize:w}){let b={...H9},_={...yte};const S=mte(c);let x,A=null,k=[],T,O,$;const L=n9().on("start",M=>{const{nodeLookup:z,transform:P,snapGrid:q,snapToGrid:D,nodeOrigin:H,paneDomNode:B}=n();if(x=z.get(t),!x)return;A=(B==null?void 0:B.getBoundingClientRect())??null;const{xSnapped:G,ySnapped:K}=Gu(M.sourceEvent,{transform:P,snapGrid:q,snapToGrid:D,containerBounds:A});b={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},_={...b,pointerX:G,pointerY:K,aspectRatio:b.width/b.height},T=void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(T=z.get(x.parentId),O=T&&x.extent==="parent"?bte(T):void 0),k=[],$=void 0;for(const[Q,R]of z)if(R.parentId===t&&(k.push({id:Q,position:{...R.position},extent:R.extent}),R.extent==="parent"||R.expandParent)){const V=vte(R,x,R.origin??H);$?$=[[Math.min(V[0][0],$[0][0]),Math.min(V[0][1],$[0][1])],[Math.max(V[1][0],$[1][0]),Math.max(V[1][1],$[1][1])]]:$=V}m==null||m(M,{...b})}).on("drag",M=>{const{transform:z,snapGrid:P,snapToGrid:q,nodeOrigin:D}=n(),H=Gu(M.sourceEvent,{transform:z,snapGrid:P,snapToGrid:q,containerBounds:A}),B=[];if(!x)return;const{x:G,y:K,width:Q,height:R}=b,V={},X=x.origin??D,{width:j,height:I,x:U,y:Y}=gte(_,S,H,f,d,X,O,$),ne=j!==Q,ae=I!==R,re=U!==G&&ne,le=Y!==K&&ae;if(!re&&!le&&!ne&&!ae)return;if((re||le||X[0]===1||X[1]===1)&&(V.x=re?U:b.x,V.y=le?Y:b.y,b.x=V.x,b.y=V.y,k.length>0)){const fe=U-G,me=Y-K;for(const xe of k)xe.position={x:xe.position.x-fe+X[0]*(j-Q),y:xe.position.y-me+X[1]*(I-R)},B.push(xe)}if((ne||ae)&&(V.width=ne&&(!h||h==="horizontal")?j:b.width,V.height=ae&&(!h||h==="vertical")?I:b.height,b.width=V.width,b.height=V.height),T&&x.expandParent){const fe=X[0]*(V.width??0);V.x&&V.x<fe&&(b.x=fe,_.x=_.x-(V.x-fe));const me=X[1]*(V.height??0);V.y&&V.y<me&&(b.y=me,_.y=_.y-(V.y-me))}const W=pte({width:b.width,prevWidth:Q,height:b.height,prevHeight:R,affectsX:S.affectsX,affectsY:S.affectsY}),J={...b,direction:W};(w==null?void 0:w(M,J))!==!1&&(g==null||g(M,J),r(V,B))}).on("end",M=>{v==null||v(M,{...b}),i==null||i({...b})});a.call(L)}function l(){a.on(".drag",null)}return{update:o,destroy:l}}var k0={exports:{}},A0={},T0={exports:{}},C0={};/**
|
|
209
209
|
* @license React
|
|
210
210
|
* use-sync-external-store-shim.production.js
|
|
211
211
|
*
|
|
@@ -213,7 +213,7 @@ prismjs/prism.js:
|
|
|
213
213
|
*
|
|
214
214
|
* This source code is licensed under the MIT license found in the
|
|
215
215
|
* LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/var rN;function
|
|
216
|
+
*/var rN;function xte(){if(rN)return C0;rN=1;var e=Sc();function t(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(h,m){var g=m(),v=r({inst:{value:g,getSnapshot:m}}),w=v[0].inst,b=v[1];return a(function(){w.value=g,w.getSnapshot=m,c(w)&&b({inst:w})},[h,g,m]),i(function(){return c(w)&&b({inst:w}),h(function(){c(w)&&b({inst:w})})},[h]),o(g),g}function c(h){var m=h.getSnapshot;h=h.value;try{var g=m();return!n(h,g)}catch{return!0}}function f(h,m){return m()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:l;return C0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,C0}var iN;function wte(){return iN||(iN=1,T0.exports=xte()),T0.exports}/**
|
|
217
217
|
* @license React
|
|
218
218
|
* use-sync-external-store-shim/with-selector.production.js
|
|
219
219
|
*
|
|
@@ -221,20 +221,20 @@ prismjs/prism.js:
|
|
|
221
221
|
*
|
|
222
222
|
* This source code is licensed under the MIT license found in the
|
|
223
223
|
* LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/var aN;function
|
|
224
|
+
*/var aN;function Ste(){if(aN)return A0;aN=1;var e=Sc(),t=wte();function n(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,c=e.useDebugValue;return A0.useSyncExternalStoreWithSelector=function(f,d,h,m,g){var v=a(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=l(function(){function _(T){if(!S){if(S=!0,x=T,T=m(T),g!==void 0&&w.hasValue){var O=w.value;if(g(O,T))return A=O}return A=T}if(O=A,r(x,T))return O;var $=m(T);return g!==void 0&&g(O,$)?(x=T,O):(x=T,A=$)}var S=!1,x,A,k=h===void 0?null:h;return[function(){return _(d())},k===null?void 0:function(){return _(k())}]},[d,h,m,g]);var b=i(f,v[0],v[1]);return o(function(){w.hasValue=!0,w.value=b},[b]),c(b),b},A0}var sN;function Ete(){return sN||(sN=1,k0.exports=Ste()),k0.exports}var kte=Ete();const Ate=zn(kte),Tte={},oN=e=>{let t;const n=new Set,r=(d,h)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const g=t;t=h??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(v=>v(t,g))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(Tte?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,i,c);return c},Cte=e=>e?oN(e):oN,{useDebugValue:Ote}=KI,{useSyncExternalStoreWithSelector:Nte}=Ate,Rte=e=>e;function G9(e,t=Rte,n){const r=Nte(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Ote(r),r}const lN=(e,t)=>{const n=Cte(e),r=(i,a=t)=>G9(n,i,a);return Object.assign(r,n),r},jte=(e,t)=>e?lN(e,t):lN;function Ut(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}ZI();const Dp=te.createContext(null),Mte=Dp.Provider,Y9=Jr.error001();function ut(e,t){const n=te.useContext(Dp);if(n===null)throw new Error(Y9);return G9(n,e,t)}function Lt(){const e=te.useContext(Dp);if(e===null)throw new Error(Y9);return te.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const uN={display:"none"},$te={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Z9="react-flow__node-desc",K9="react-flow__edge-desc",Dte="react-flow__aria-live",Ite=e=>e.ariaLiveMessage;function Pte({rfId:e}){const t=ut(Ite);return N.jsx("div",{id:`${Dte}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:$te,children:t})}function Lte({rfId:e,disableKeyboardA11y:t}){return N.jsxs(N.Fragment,{children:[N.jsxs("div",{id:`${Z9}-${e}`,style:uN,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),N.jsx("div",{id:`${K9}-${e}`,style:uN,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&N.jsx(Pte,{rfId:e})]})}const zte=e=>e.userSelectionActive?"none":"all",jc=te.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const o=ut(zte),l=`${e}`.split("-");return N.jsx("div",{className:en(["react-flow__panel",n,...l]),style:{...r,pointerEvents:o},ref:a,...i,children:t})});jc.displayName="Panel";function qte({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:N.jsx(jc,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:N.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Fte=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Nd=e=>e.id;function Bte(e,t){return Ut(e.selectedNodes.map(Nd),t.selectedNodes.map(Nd))&&Ut(e.selectedEdges.map(Nd),t.selectedEdges.map(Nd))}function Ute({onSelectionChange:e}){const t=Lt(),{selectedNodes:n,selectedEdges:r}=ut(Fte,Bte);return te.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[n,r,e]),null}const Vte=e=>!!e.onSelectionChangeHandlers;function Hte({onSelectionChange:e}){const t=ut(Vte);return e||t?N.jsx(Ute,{onSelectionChange:e}):null}const X9=[0,0],Gte={x:0,y:0,zoom:1},Yte=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","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","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],cN=[...Yte,"rfId"],Zte=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,setPaneClickDistance:e.setPaneClickDistance}),fN={translateExtent:cc,nodeOrigin:X9,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function Kte(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c,setPaneClickDistance:f}=ut(Zte,Ut),d=Lt();te.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=fN,l()}),[]);const h=te.useRef(fN);return te.useEffect(()=>{for(const m of cN){const g=e[m],v=h.current[m];g!==v&&(typeof e[m]>"u"||(m==="nodes"?t(g):m==="edges"?n(g):m==="minZoom"?r(g):m==="maxZoom"?i(g):m==="translateExtent"?a(g):m==="nodeExtent"?o(g):m==="paneClickDistance"?f(g):m==="fitView"?d.setState({fitViewQueued:g}):m==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[m]:g})))}h.current=e},cN.map(m=>e[m])),null}function dN(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Xte(e){var r;const[t,n]=te.useState(e==="system"?null:e);return te.useEffect(()=>{if(e!=="system"){n(e);return}const i=dN(),a=()=>n(i!=null&&i.matches?"dark":"light");return a(),i==null||i.addEventListener("change",a),()=>{i==null||i.removeEventListener("change",a)}},[e]),t!==null?t:(r=dN())!=null&&r.matches?"dark":"light"}const hN=typeof document<"u"?document:null;function pc(e=null,t={target:hN,actInsideInputWithModifier:!0}){const[n,r]=te.useState(!1),i=te.useRef(!1),a=te.useRef(new Set([])),[o,l]=te.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace("+",`
|
|
225
225
|
`).replace(`
|
|
226
226
|
|
|
227
227
|
`,`
|
|
228
228
|
+`).split(`
|
|
229
|
-
`)),d=f.reduce((h,m)=>h.concat(...m),[]);return[f,d]}return[[],[]]},[e]);return te.useEffect(()=>{const c=(t==null?void 0:t.target)??hN,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=g=>{var b,_;if(i.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!i.current||i.current&&!f)&&N9(g))return!1;const w=mN(g.code,l);if(a.current.add(g[w]),pN(o,a.current,!1)){const S=((_=(b=g.composedPath)==null?void 0:b.call(g))==null?void 0:_[0])||g.target,x=(S==null?void 0:S.nodeName)==="BUTTON"||(S==null?void 0:S.nodeName)==="A";t.preventDefault!==!1&&(i.current||!x)&&g.preventDefault(),r(!0)}},h=g=>{const v=mN(g.code,l);pN(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(g[v]),g.key==="Meta"&&a.current.clear(),i.current=!1},m=()=>{a.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",h),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",h),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,r]),n}function pN(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function mN(e,t){return t.includes(e)?"code":"key"}const Xte=()=>{const e=Lt();return te.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{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},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>{const{width:i,height:a,maxZoom:o,panZoom:l}=e.getState(),c=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:o,f=i/2-t*c,d=a/2-n*c;return l?(await l.setViewport({x:f,y:d,zoom:c},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:a,maxZoom:o,panZoom:l}=e.getState(),c=OS(t,r,i,a,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),f={x:t.x-l,y:t.y-c},d=n.snapGrid??i,h=n.snapToGrid??a;return Rc(f,r,h,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),o=np(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function W9(e,t){const n=[],r=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const o=r.get(a.id);o?o.push(a):r.set(a.id,[a])}for(const a of t){const o=r.get(a.id);if(!o){n.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...a};for(const c of o)Wte(c,l);n.push(l)}return i.length&&i.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function Wte(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,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);break}}}function Q9(e,t){return W9(e,t)}function J9(e,t){return W9(e,t)}function ls(e,t){return{id:e,type:"select",selected:t}}function Do(e,t=new Set,n=!1){const r=[];for(const[i,a]of e){const o=t.has(i);!(a.selected===void 0&&!o)&&a.selected!==o&&(n&&(a.selected=o),r.push(ls(a.id,o)))}return r}function gN({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const l=t.get(o.id),c=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function yN(e){return{id:e.id,type:"remove"}}const bN=e=>Eee(e),Qte=e=>x9(e);function eP(e){return te.forwardRef(e)}const Jte=typeof window<"u"?te.useLayoutEffect:te.useEffect;function vN(e){const[t,n]=te.useState(BigInt(0)),[r]=te.useState(()=>ene(()=>n(i=>i+BigInt(1))));return Jte(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function ene(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const tP=te.createContext(null);function tne({children:e}){const t=Lt(),n=te.useCallback(l=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:d,onNodesChange:h,nodeLookup:m,fitViewQueued:g}=t.getState();let v=c;for(const b of l)v=typeof b=="function"?b(v):b;const w=gN({items:v,lookup:m});d&&f(v),w.length>0?h==null||h(w):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:_,setNodes:S}=t.getState();b&&S(_)})},[]),r=vN(n),i=te.useCallback(l=>{const{edges:c=[],setEdges:f,hasDefaultEdges:d,onEdgesChange:h,edgeLookup:m}=t.getState();let g=c;for(const v of l)g=typeof v=="function"?v(g):v;d?f(g):h&&h(gN({items:g,lookup:m}))},[]),a=vN(i),o=te.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return N.jsx(tP.Provider,{value:o,children:e})}function nne(){const e=te.useContext(tP);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const rne=e=>!!e.panZoom;function Ip(){const e=Xte(),t=Lt(),n=nne(),r=ut(rne),i=te.useMemo(()=>{const a=h=>t.getState().nodeLookup.get(h),o=h=>{n.nodeQueue.push(h)},l=h=>{n.edgeQueue.push(h)},c=h=>{var _,S;const{nodeLookup:m,nodeOrigin:g}=t.getState(),v=bN(h)?h:m.get(h.id),w=v.parentId?C9(v.position,v.measured,v.parentId,m,g):v.position,b={...v,position:w,width:((_=v.measured)==null?void 0:_.width)??v.width,height:((S=v.measured)==null?void 0:S.height)??v.height};return Xo(b)},f=(h,m,g={replace:!1})=>{o(v=>v.map(w=>{if(w.id===h){const b=typeof m=="function"?m(w):m;return g.replace&&bN(b)?b:{...w,...b}}return w}))},d=(h,m,g={replace:!1})=>{l(v=>v.map(w=>{if(w.id===h){const b=typeof m=="function"?m(w):m;return g.replace&&Qte(b)?b:{...w,...b}}return w}))};return{getNodes:()=>t.getState().nodes.map(h=>({...h})),getNode:h=>{var m;return(m=a(h))==null?void 0:m.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:h=[]}=t.getState();return h.map(m=>({...m}))},getEdge:h=>t.getState().edgeLookup.get(h),setNodes:o,setEdges:l,addNodes:h=>{const m=Array.isArray(h)?h:[h];n.nodeQueue.push(g=>[...g,...m])},addEdges:h=>{const m=Array.isArray(h)?h:[h];n.edgeQueue.push(g=>[...g,...m])},toObject:()=>{const{nodes:h=[],edges:m=[],transform:g}=t.getState(),[v,w,b]=g;return{nodes:h.map(_=>({..._})),edges:m.map(_=>({..._})),viewport:{x:v,y:w,zoom:b}}},deleteElements:async({nodes:h=[],edges:m=[]})=>{const{nodes:g,edges:v,onNodesDelete:w,onEdgesDelete:b,triggerNodeChanges:_,triggerEdgeChanges:S,onDelete:x,onBeforeDelete:A}=t.getState(),{nodes:k,edges:T}=await Oee({nodesToRemove:h,edgesToRemove:m,nodes:g,edges:v,onBeforeDelete:A}),O=T.length>0,$=k.length>0;if(O){const L=T.map(yN);b==null||b(T),S(L)}if($){const L=k.map(yN);w==null||w(k),_(L)}return($||O)&&(x==null||x({nodes:k,edges:T})),{deletedNodes:k,deletedEdges:T}},getIntersectingNodes:(h,m=!0,g)=>{const v=HO(h),w=v?h:c(h),b=g!==void 0;return w?(g||t.getState().nodes).filter(_=>{const S=t.getState().nodeLookup.get(_.id);if(S&&!v&&(_.id===h.id||!S.internals.positionAbsolute))return!1;const x=Xo(b?_:S),A=dc(x,w);return m&&A>0||A>=w.width*w.height}):[]},isNodeIntersecting:(h,m,g=!0)=>{const w=HO(h)?h:c(h);if(!w)return!1;const b=dc(w,m);return g&&b>0||b>=w.width*w.height},updateNode:f,updateNodeData:(h,m,g={replace:!1})=>{f(h,v=>{const w=typeof m=="function"?m(v):m;return g.replace?{...v,data:w}:{...v,data:{...v.data,...w}}},g)},updateEdge:d,updateEdgeData:(h,m,g={replace:!1})=>{d(h,v=>{const w=typeof m=="function"?m(v):m;return g.replace?{...v,data:w}:{...v,data:{...v.data,...w}}},g)},getNodesBounds:h=>{const{nodeLookup:m,nodeOrigin:g}=t.getState();return kee(h,{nodeLookup:m,nodeOrigin:g})},getHandleConnections:({type:h,id:m,nodeId:g})=>{var v;return Array.from(((v=t.getState().connectionLookup.get(`${g}-${h}${m?`-${m}`:""}`))==null?void 0:v.values())??[])},getNodeConnections:({type:h,handleId:m,nodeId:g})=>{var v;return Array.from(((v=t.getState().connectionLookup.get(`${g}${h?m?`-${h}-${m}`:`-${h}`:""}`))==null?void 0:v.values())??[])},fitView:async h=>{const m=t.getState().fitViewResolver??Mee();return t.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:m}),n.nodeQueue.push(g=>[...g]),m.promise}}},[]);return te.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const _N=e=>e.selected,ine=typeof window<"u"?window:void 0;function ane({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Lt(),{deleteElements:r}=Ip(),i=pc(e,{actInsideInputWithModifier:!1}),a=pc(t,{target:ine});te.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(_N),edges:o.filter(_N)}),n.setState({nodesSelectionActive:!1})}},[i]),te.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function sne(e){const t=Lt();te.useEffect(()=>{const n=()=>{var i,a;if(!e.current)return!1;const r=NS(e.current);(r.height===0||r.width===0)&&((a=(i=t.getState()).onError)==null||a.call(i,"004",Jr.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Pp={position:"absolute",width:"100%",height:"100%",top:0,left:0},one=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function lne({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=bs.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:f,minZoom:d,maxZoom:h,zoomActivationKeyCode:m,preventScrolling:g=!0,children:v,noWheelClassName:w,noPanClassName:b,onViewportChange:_,isControlledViewport:S,paneClickDistance:x}){const A=Lt(),k=te.useRef(null),{userSelectionActive:T,lib:O}=ut(one,Ut),$=pc(m),L=te.useRef();sne(k);const M=te.useCallback(z=>{_==null||_({x:z[0],y:z[1],zoom:z[2]}),S||A.setState({transform:z})},[_,S]);return te.useEffect(()=>{if(k.current){L.current=dte({domNode:k.current,minZoom:d,maxZoom:h,translateExtent:f,viewport:c,paneClickDistance:x,onDraggingChange:D=>A.setState({paneDragging:D}),onPanZoomStart:(D,H)=>{const{onViewportChangeStart:B,onMoveStart:G}=A.getState();G==null||G(D,H),B==null||B(H)},onPanZoom:(D,H)=>{const{onViewportChange:B,onMove:G}=A.getState();G==null||G(D,H),B==null||B(H)},onPanZoomEnd:(D,H)=>{const{onViewportChangeEnd:B,onMoveEnd:G}=A.getState();G==null||G(D,H),B==null||B(H)}});const{x:z,y:P,zoom:q}=L.current.getViewport();return A.setState({panZoom:L.current,transform:[z,P,q],domNode:k.current.closest(".react-flow")}),()=>{var D;(D=L.current)==null||D.destroy()}}},[]),te.useEffect(()=>{var z;(z=L.current)==null||z.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:$,preventScrolling:g,noPanClassName:b,userSelectionActive:T,noWheelClassName:w,lib:O,onTransformChange:M})},[e,t,n,r,i,a,o,l,$,g,b,T,w,O,M]),N.jsx("div",{className:"react-flow__renderer",ref:k,style:Pp,children:v})}const une=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function cne(){const{userSelectionActive:e,userSelectionRect:t}=ut(une,Ut);return e&&t?N.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}const O0=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},fne=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function dne({isSelecting:e,selectionKeyPressed:t,selectionMode:n=fc.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:a,onSelectionEnd:o,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:f,onPaneMouseEnter:d,onPaneMouseMove:h,onPaneMouseLeave:m,children:g}){const v=Lt(),{userSelectionActive:w,elementsSelectable:b,dragging:_,connectionInProgress:S}=ut(fne,Ut),x=b&&(e||w),A=te.useRef(null),k=te.useRef(),T=te.useRef(new Set),O=te.useRef(new Set),$=te.useRef(!1),L=te.useRef(!1),M=G=>{if($.current||S){$.current=!1;return}l==null||l(G),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},z=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}c==null||c(G)},P=f?G=>f(G):void 0,q=G=>{var X,j;const{resetSelectedElements:K,domNode:Q}=v.getState();if(k.current=Q==null?void 0:Q.getBoundingClientRect(),!b||!e||G.button!==0||G.target!==A.current||!k.current)return;(j=(X=G.target)==null?void 0:X.setPointerCapture)==null||j.call(X,G.pointerId),L.current=!0,$.current=!1;const{x:R,y:V}=Ri(G.nativeEvent,k.current);K(),v.setState({userSelectionRect:{width:0,height:0,startX:R,startY:V,x:R,y:V}}),a==null||a(G)},D=G=>{const{userSelectionRect:K,transform:Q,nodeLookup:R,edgeLookup:V,connectionLookup:X,triggerNodeChanges:j,triggerEdgeChanges:I,defaultEdgeOptions:U}=v.getState();if(!k.current||!K)return;$.current=!0;const{x:Y,y:ne}=Ri(G.nativeEvent,k.current),{startX:ae,startY:re}=K,le={startX:ae,startY:re,x:Y<ae?Y:ae,y:ne<re?ne:re,width:Math.abs(Y-ae),height:Math.abs(ne-re)},W=T.current,J=O.current;T.current=new Set(w9(R,le,Q,n===fc.Partial,!0).map(fe=>fe.id)),O.current=new Set;const se=(U==null?void 0:U.selectable)??!0;for(const fe of T.current){const me=X.get(fe);if(me)for(const{edgeId:xe}of me.values()){const we=V.get(xe);we&&(we.selectable??se)&&O.current.add(xe)}}if(!GO(W,T.current)){const fe=Do(R,T.current,!0);j(fe)}if(!GO(J,O.current)){const fe=Do(V,O.current);I(fe)}v.setState({userSelectionRect:le,userSelectionActive:!0,nodesSelectionActive:!1})},H=G=>{var Q,R;if(G.button!==0||!L.current)return;(R=(Q=G.target)==null?void 0:Q.releasePointerCapture)==null||R.call(Q,G.pointerId);const{userSelectionRect:K}=v.getState();!w&&K&&G.target===A.current&&(M==null||M(G)),v.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:T.current.size>0}),o==null||o(G),(t||i)&&($.current=!1),L.current=!1},B=r===!0||Array.isArray(r)&&r.includes(0);return N.jsxs("div",{className:en(["react-flow__pane",{draggable:B,dragging:_,selection:e}]),onClick:x?void 0:O0(M,A),onContextMenu:O0(z,A),onWheel:O0(P,A),onPointerEnter:x?void 0:d,onPointerDown:x?q:h,onPointerMove:x?D:h,onPointerUp:x?H:void 0,onPointerLeave:m,ref:A,style:Pp,children:[g,N.jsx(cne,{})]})}function Lw({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),f=l.get(e);if(!f){c==null||c("012",Jr.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&o)&&(a({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):i([e])}function nP({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=Lt(),[c,f]=te.useState(!1),d=te.useRef();return te.useEffect(()=>{d.current=Qee({getStoreItems:()=>l.getState(),onNodeMouseDown:h=>{Lw({id:h,store:l,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),te.useEffect(()=>{var h,m;if(t)(h=d.current)==null||h.destroy();else if(e.current)return(m=d.current)==null||m.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{var g;(g=d.current)==null||g.destroy()}},[n,r,t,a,e,i]),c}const hne=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function rP(){const e=Lt();return te.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:f,nodeOrigin:d}=e.getState(),h=new Map,m=hne(o),g=i?a[0]:5,v=i?a[1]:5,w=n.direction.x*g*n.factor,b=n.direction.y*v*n.factor;for(const[,_]of f){if(!m(_))continue;let S={x:_.internals.positionAbsolute.x+w,y:_.internals.positionAbsolute.y+b};i&&(S=Mp(S,a));const{position:x,positionAbsolute:A}=S9({nodeId:_.id,nextPosition:S,nodeLookup:f,nodeExtent:r,nodeOrigin:d,onError:l});_.position=x,_.internals.positionAbsolute=A,h.set(_.id,_)}c(h)},[])}const DS=te.createContext(null),pne=DS.Provider;DS.Consumer;const iP=()=>te.useContext(DS),mne=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),gne=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:c,isValid:f}=o,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:a===Zo.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:d&&f}};function yne({type:e="source",position:t=Pe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:l,children:c,className:f,onMouseDown:d,onTouchStart:h,...m},g){var H,B;const v=o||null,w=e==="target",b=Lt(),_=iP(),{connectOnClick:S,noPanClassName:x,rfId:A}=ut(mne,Ut),{connectingFrom:k,connectingTo:T,clickConnecting:O,isPossibleEndHandle:$,connectionInProcess:L,clickConnectionInProcess:M,valid:z}=ut(gne(_,v,e),Ut);_||(B=(H=b.getState()).onError)==null||B.call(H,"010",Jr.error010());const P=G=>{const{defaultEdgeOptions:K,onConnect:Q,hasDefaultEdges:R}=b.getState(),V={...K,...G};if(R){const{edges:X,setEdges:j}=b.getState();j(zee(V,X))}Q==null||Q(V),l==null||l(V)},q=G=>{if(!_)return;const K=R9(G.nativeEvent);if(i&&(K&&G.button===0||!K)){const Q=b.getState();Pw.onPointerDown(G.nativeEvent,{autoPanOnConnect:Q.autoPanOnConnect,connectionMode:Q.connectionMode,connectionRadius:Q.connectionRadius,domNode:Q.domNode,nodeLookup:Q.nodeLookup,lib:Q.lib,isTarget:w,handleId:v,nodeId:_,flowId:Q.rfId,panBy:Q.panBy,cancelConnection:Q.cancelConnection,onConnectStart:Q.onConnectStart,onConnectEnd:Q.onConnectEnd,updateConnection:Q.updateConnection,onConnect:P,isValidConnection:n||Q.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:Q.autoPanSpeed})}K?d==null||d(G):h==null||h(G)},D=G=>{const{onClickConnectStart:K,onClickConnectEnd:Q,connectionClickStartHandle:R,connectionMode:V,isValidConnection:X,lib:j,rfId:I,nodeLookup:U,connection:Y}=b.getState();if(!_||!R&&!i)return;if(!R){K==null||K(G.nativeEvent,{nodeId:_,handleId:v,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:_,type:e,id:v}});return}const ne=O9(G.target),ae=n||X,{connection:re,isValid:le}=Pw.isValid(G.nativeEvent,{handle:{nodeId:_,id:v,type:e},connectionMode:V,fromNodeId:R.nodeId,fromHandleId:R.id||null,fromType:R.type,isValidConnection:ae,flowId:I,doc:ne,lib:j,nodeLookup:U});le&&re&&P(re);const W=structuredClone(Y);delete W.inProgress,W.toPosition=W.toHandle?W.toHandle.position:null,Q==null||Q(G,W),b.setState({connectionClickStartHandle:null})};return N.jsx("div",{"data-handleid":v,"data-nodeid":_,"data-handlepos":t,"data-id":`${A}-${_}-${v}-${e}`,className:en(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,f,{source:!w,target:w,connectable:r,connectablestart:i,connectableend:a,clickconnecting:O,connectingfrom:k,connectingto:T,valid:z,connectionindicator:r&&(!L||$)&&(L||M?a:i)}]),onMouseDown:q,onTouchStart:q,onClick:S?D:void 0,ref:g,...m,children:c})}const ip=te.memo(eP(yne));function bne({data:e,isConnectable:t,sourcePosition:n=Pe.Bottom}){return N.jsxs(N.Fragment,{children:[e==null?void 0:e.label,N.jsx(ip,{type:"source",position:n,isConnectable:t})]})}function vne({data:e,isConnectable:t,targetPosition:n=Pe.Top,sourcePosition:r=Pe.Bottom}){return N.jsxs(N.Fragment,{children:[N.jsx(ip,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,N.jsx(ip,{type:"source",position:r,isConnectable:t})]})}function _ne(){return null}function xne({data:e,isConnectable:t,targetPosition:n=Pe.Top}){return N.jsxs(N.Fragment,{children:[N.jsx(ip,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ap={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},xN={input:bne,default:vne,output:xne,group:_ne};function wne(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const Sne=e=>{const{width:t,height:n,x:r,y:i}=Nc(e.nodeLookup,{filter:a=>!!a.selected});return{width:jr(t)?t:null,height:jr(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 Ene({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Lt(),{width:i,height:a,transformString:o,userSelectionActive:l}=ut(Sne,Ut),c=rP(),f=te.useRef(null);if(te.useEffect(()=>{var m;n||(m=f.current)==null||m.focus({preventScroll:!0})},[n]),nP({nodeRef:f}),l||!i||!a)return null;const d=e?m=>{const g=r.getState().nodes.filter(v=>v.selected);e(m,g)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(ap,m.key)&&(m.preventDefault(),c({direction:ap[m.key],factor:m.shiftKey?4:1}))};return N.jsx("div",{className:en(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:N.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:a}})})}const wN=typeof window<"u"?window:void 0,kne=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function aP({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:f,selectionOnDrag:d,selectionMode:h,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:v,panActivationKeyCode:w,zoomActivationKeyCode:b,elementsSelectable:_,zoomOnScroll:S,zoomOnPinch:x,panOnScroll:A,panOnScrollSpeed:k,panOnScrollMode:T,zoomOnDoubleClick:O,panOnDrag:$,defaultViewport:L,translateExtent:M,minZoom:z,maxZoom:P,preventScrolling:q,onSelectionContextMenu:D,noWheelClassName:H,noPanClassName:B,disableKeyboardA11y:G,onViewportChange:K,isControlledViewport:Q}){const{nodesSelectionActive:R,userSelectionActive:V}=ut(kne),X=pc(f,{target:wN}),j=pc(w,{target:wN}),I=j||$,U=j||A,Y=d&&I!==!0,ne=X||V||Y;return ane({deleteKeyCode:c,multiSelectionKeyCode:v}),N.jsx(lne,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:S,zoomOnPinch:x,panOnScroll:U,panOnScrollSpeed:k,panOnScrollMode:T,zoomOnDoubleClick:O,panOnDrag:!X&&I,defaultViewport:L,translateExtent:M,minZoom:z,maxZoom:P,zoomActivationKeyCode:b,preventScrolling:q,noWheelClassName:H,noPanClassName:B,onViewportChange:K,isControlledViewport:Q,paneClickDistance:l,children:N.jsxs(dne,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:I,isSelecting:!!ne,selectionMode:h,selectionKeyPressed:X,selectionOnDrag:Y,children:[e,R&&N.jsx(Ene,{onSelectionContextMenu:D,noPanClassName:B,disableKeyboardA11y:G})]})})}aP.displayName="FlowRenderer";const Ane=te.memo(aP),Tne=e=>t=>e?w9(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function Cne(e){return ut(te.useCallback(Tne(e),[e]),Ut)}const One=e=>e.updateNodeInternals;function Nne(){const e=ut(One),[t]=te.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const a=i.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:i.target,force:!0})}),e(r)}));return te.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Rne({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=Lt(),a=te.useRef(null),o=te.useRef(null),l=te.useRef(e.sourcePosition),c=te.useRef(e.targetPosition),f=te.useRef(t),d=n&&!!e.internals.handleBounds;return te.useEffect(()=>{a.current&&!e.hidden&&(!d||o.current!==a.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(a.current),o.current=a.current)},[d,e.hidden]),te.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),te.useEffect(()=>{if(a.current){const h=f.current!==t,m=l.current!==e.sourcePosition,g=c.current!==e.targetPosition;(h||m||g)&&(f.current=t,l.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 jne({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:f,nodesFocusable:d,resizeObserver:h,noDragClassName:m,noPanClassName:g,disableKeyboardA11y:v,rfId:w,nodeTypes:b,nodeClickDistance:_,onError:S}){const{node:x,internals:A,isParent:k}=ut(ne=>{const ae=ne.nodeLookup.get(e),re=ne.parentLookup.has(e);return{node:ae,internals:ae.internals,isParent:re}},Ut);let T=x.type||"default",O=(b==null?void 0:b[T])||xN[T];O===void 0&&(S==null||S("003",Jr.error003(T)),T="default",O=xN.default);const $=!!(x.draggable||l&&typeof x.draggable>"u"),L=!!(x.selectable||c&&typeof x.selectable>"u"),M=!!(x.connectable||f&&typeof x.connectable>"u"),z=!!(x.focusable||d&&typeof x.focusable>"u"),P=Lt(),q=T9(x),D=Rne({node:x,nodeType:T,hasDimensions:q,resizeObserver:h}),H=nP({nodeRef:D,disabled:x.hidden||!$,noDragClassName:m,handleSelector:x.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:_}),B=rP();if(x.hidden)return null;const G=zi(x),K=wne(x),Q=L||$||t||n||r||i,R=n?ne=>n(ne,{...A.userNode}):void 0,V=r?ne=>r(ne,{...A.userNode}):void 0,X=i?ne=>i(ne,{...A.userNode}):void 0,j=a?ne=>a(ne,{...A.userNode}):void 0,I=o?ne=>o(ne,{...A.userNode}):void 0,U=ne=>{const{selectNodesOnDrag:ae,nodeDragThreshold:re}=P.getState();L&&(!ae||!$||re>0)&&Lw({id:e,store:P,nodeRef:D}),t&&t(ne,{...A.userNode})},Y=ne=>{if(!(N9(ne.nativeEvent)||v))if(b9.includes(ne.key)&&L){const ae=ne.key==="Escape";Lw({id:e,store:P,unselect:ae,nodeRef:D})}else $&&x.selected&&Object.prototype.hasOwnProperty.call(ap,ne.key)&&(ne.preventDefault(),P.setState({ariaLiveMessage:`Moved selected node ${ne.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~A.positionAbsolute.x}, y: ${~~A.positionAbsolute.y}`}),B({direction:ap[ne.key],factor:ne.shiftKey?4:1}))};return N.jsx("div",{className:en(["react-flow__node",`react-flow__node-${T}`,{[g]:$},x.className,{selected:x.selected,selectable:L,parent:k,draggable:$,dragging:H}]),ref:D,style:{zIndex:A.z,transform:`translate(${A.positionAbsolute.x}px,${A.positionAbsolute.y}px)`,pointerEvents:Q?"all":"none",visibility:q?"visible":"hidden",...x.style,...K},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,onMouseMove:V,onMouseLeave:X,onContextMenu:j,onClick:U,onDoubleClick:I,onKeyDown:z?Y:void 0,tabIndex:z?0:void 0,role:z?"button":void 0,"aria-describedby":v?void 0:`${Z9}-${w}`,"aria-label":x.ariaLabel,children:N.jsx(pne,{value:e,children:N.jsx(O,{id:e,data:x.data,type:T,positionAbsoluteX:A.positionAbsolute.x,positionAbsoluteY:A.positionAbsolute.y,selected:x.selected??!1,selectable:L,draggable:$,deletable:x.deletable??!0,isConnectable:M,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:H,dragHandle:x.dragHandle,zIndex:A.z,parentId:x.parentId,...G})})})}const Mne=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function sP(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=ut(Mne,Ut),o=Cne(e.onlyRenderVisibleElements),l=Nne();return N.jsx("div",{className:"react-flow__nodes",style:Pp,children:o.map(c=>N.jsx(jne,{id:c,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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},c))})}sP.displayName="NodeRenderer";const $ne=te.memo(sP);function Dne(e){return ut(te.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const a=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);a&&o&&Iee({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Ut)}const Ine=({color:e="none",strokeWidth:t=1})=>N.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),Pne=({color:e="none",strokeWidth:t=1})=>N.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),SN={[ep.Arrow]:Ine,[ep.ArrowClosed]:Pne};function Lne(e){const t=Lt();return te.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(SN,e)?SN[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",Jr.error009(e)),null)},[e])}const zne=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=Lne(t);return c?N.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:N.jsx(c,{color:n,strokeWidth:o})}):null},oP=({defaultColor:e,rfId:t})=>{const n=ut(a=>a.edges),r=ut(a=>a.defaultEdgeOptions),i=te.useMemo(()=>Vee(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?N.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:N.jsx("defs",{children:i.map(a=>N.jsx(zne,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};oP.displayName="MarkerDefinitions";var qne=te.memo(oP);function lP({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:f,...d}){const[h,m]=te.useState({x:1,y:0,width:0,height:0}),g=en(["react-flow__edge-textwrapper",f]),v=te.useRef(null);return te.useEffect(()=>{if(v.current){const w=v.current.getBBox();m({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?N.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...d,children:[i&&N.jsx("rect",{width:h.width+2*o[0],x:-o[0],y:-o[1],height:h.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),N.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:v,style:r,children:n}),c]}):null}lP.displayName="EdgeText";const Fne=te.memo(lP);function Lp({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:f=20,...d}){return N.jsxs(N.Fragment,{children:[N.jsx("path",{...d,d:e,fill:"none",className:en(["react-flow__edge-path",d.className])}),f&&N.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}),r&&jr(t)&&jr(n)?N.jsx(Fne,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function EN({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Pe.Left||e===Pe.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function uP({sourceX:e,sourceY:t,sourcePosition:n=Pe.Bottom,targetX:r,targetY:i,targetPosition:a=Pe.Top}){const[o,l]=EN({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,f]=EN({pos:a,x1:r,y1:i,x2:e,y2:t}),[d,h,m,g]=j9({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:f});return[`M${e},${t} C${o},${l} ${c},${f} ${r},${i}`,d,h,m,g]}function cP(e){return te.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:b,interactionWidth:_})=>{const[S,x,A]=uP({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),k=e.isInternal?void 0:t;return N.jsx(Lp,{id:k,path:S,labelX:x,labelY:A,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:b,interactionWidth:_})})}const Bne=cP({isInternal:!1}),fP=cP({isInternal:!0});Bne.displayName="SimpleBezierEdge";fP.displayName="SimpleBezierEdgeInternal";function dP(e){return te.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:m,sourcePosition:g=Pe.Bottom,targetPosition:v=Pe.Top,markerEnd:w,markerStart:b,pathOptions:_,interactionWidth:S})=>{const[x,A,k]=$w({sourceX:n,sourceY:r,sourcePosition:g,targetX:i,targetY:a,targetPosition:v,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset}),T=e.isInternal?void 0:t;return N.jsx(Lp,{id:T,path:x,labelX:A,labelY:k,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:m,markerEnd:w,markerStart:b,interactionWidth:S})})}const hP=dP({isInternal:!1}),pP=dP({isInternal:!0});hP.displayName="SmoothStepEdge";pP.displayName="SmoothStepEdgeInternal";function mP(e){return te.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return N.jsx(hP,{...n,id:r,pathOptions:te.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const Une=mP({isInternal:!1}),gP=mP({isInternal:!0});Une.displayName="StepEdge";gP.displayName="StepEdgeInternal";function yP(e){return te.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:m,markerEnd:g,markerStart:v,interactionWidth:w})=>{const[b,_,S]=D9({sourceX:n,sourceY:r,targetX:i,targetY:a}),x=e.isInternal?void 0:t;return N.jsx(Lp,{id:x,path:b,labelX:_,labelY:S,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:m,markerEnd:g,markerStart:v,interactionWidth:w})})}const Vne=yP({isInternal:!1}),bP=yP({isInternal:!0});Vne.displayName="StraightEdge";bP.displayName="StraightEdgeInternal";function vP(e){return te.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Pe.Bottom,targetPosition:l=Pe.Top,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:b,pathOptions:_,interactionWidth:S})=>{const[x,A,k]=M9({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l,curvature:_==null?void 0:_.curvature}),T=e.isInternal?void 0:t;return N.jsx(Lp,{id:T,path:x,labelX:A,labelY:k,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:b,interactionWidth:S})})}const Hne=vP({isInternal:!1}),_P=vP({isInternal:!0});Hne.displayName="BezierEdge";_P.displayName="BezierEdgeInternal";const kN={default:_P,straight:bP,step:gP,smoothstep:pP,simplebezier:fP},AN={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Gne=(e,t,n)=>n===Pe.Left?e-t:n===Pe.Right?e+t:e,Yne=(e,t,n)=>n===Pe.Top?e-t:n===Pe.Bottom?e+t:e,TN="react-flow__edgeupdater";function CN({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:l}){return N.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:en([TN,`${TN}-${l}`]),cx:Gne(t,r,e),cy:Yne(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Zne({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,setReconnecting:m,setUpdateHover:g}){const v=Lt(),w=(A,k)=>{if(A.button!==0)return;const{autoPanOnConnect:T,domNode:O,isValidConnection:$,connectionMode:L,connectionRadius:M,lib:z,onConnectStart:P,onConnectEnd:q,cancelConnection:D,nodeLookup:H,rfId:B,panBy:G,updateConnection:K}=v.getState(),Q=k.type==="target";m(!0),d==null||d(A,n,k.type);const R=(X,j)=>{m(!1),h==null||h(X,n,k.type,j)},V=X=>f==null?void 0:f(n,X);Pw.onPointerDown(A.nativeEvent,{autoPanOnConnect:T,connectionMode:L,connectionRadius:M,domNode:O,handleId:k.id,nodeId:k.nodeId,nodeLookup:H,isTarget:Q,edgeUpdaterType:k.type,lib:z,flowId:B,cancelConnection:D,panBy:G,isValidConnection:$,onConnect:V,onConnectStart:P,onConnectEnd:q,onReconnectEnd:R,updateConnection:K,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle})},b=A=>w(A,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),_=A=>w(A,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),S=()=>g(!0),x=()=>g(!1);return N.jsxs(N.Fragment,{children:[(e===!0||e==="source")&&N.jsx(CN,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:b,onMouseEnter:S,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&N.jsx(CN,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:S,onMouseOut:x,type:"target"})]})}function Kne({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,reconnectRadius:d,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,rfId:v,edgeTypes:w,noPanClassName:b,onError:_,disableKeyboardA11y:S}){let x=ut(J=>J.edgeLookup.get(e));const A=ut(J=>J.defaultEdgeOptions);x=A?{...A,...x}:x;let k=x.type||"default",T=(w==null?void 0:w[k])||kN[k];T===void 0&&(_==null||_("011",Jr.error011(k)),k="default",T=kN.default);const O=!!(x.focusable||t&&typeof x.focusable>"u"),$=typeof h<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),L=!!(x.selectable||r&&typeof x.selectable>"u"),M=te.useRef(null),[z,P]=te.useState(!1),[q,D]=te.useState(!1),H=Lt(),{zIndex:B,sourceX:G,sourceY:K,targetX:Q,targetY:R,sourcePosition:V,targetPosition:X}=ut(te.useCallback(J=>{const se=J.nodeLookup.get(x.source),fe=J.nodeLookup.get(x.target);if(!se||!fe)return{zIndex:x.zIndex,...AN};const me=Uee({id:e,sourceNode:se,targetNode:fe,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:J.connectionMode,onError:_});return{zIndex:Dee({selected:x.selected,zIndex:x.zIndex,sourceNode:se,targetNode:fe,elevateOnSelect:J.elevateEdgesOnSelect}),...me||AN}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),Ut),j=te.useMemo(()=>x.markerStart?`url('#${Dw(x.markerStart,v)}')`:void 0,[x.markerStart,v]),I=te.useMemo(()=>x.markerEnd?`url('#${Dw(x.markerEnd,v)}')`:void 0,[x.markerEnd,v]);if(x.hidden||G===null||K===null||Q===null||R===null)return null;const U=J=>{var xe;const{addSelectedEdges:se,unselectNodesAndEdges:fe,multiSelectionActive:me}=H.getState();L&&(H.setState({nodesSelectionActive:!1}),x.selected&&me?(fe({nodes:[],edges:[x]}),(xe=M.current)==null||xe.blur()):se([e])),i&&i(J,x)},Y=a?J=>{a(J,{...x})}:void 0,ne=o?J=>{o(J,{...x})}:void 0,ae=l?J=>{l(J,{...x})}:void 0,re=c?J=>{c(J,{...x})}:void 0,le=f?J=>{f(J,{...x})}:void 0,W=J=>{var se;if(!S&&b9.includes(J.key)&&L){const{unselectNodesAndEdges:fe,addSelectedEdges:me}=H.getState();J.key==="Escape"?((se=M.current)==null||se.blur(),fe({edges:[x]})):me([e])}};return N.jsx("svg",{style:{zIndex:B},children:N.jsxs("g",{className:en(["react-flow__edge",`react-flow__edge-${k}`,x.className,b,{selected:x.selected,animated:x.animated,inactive:!L&&!i,updating:z,selectable:L}]),onClick:U,onDoubleClick:Y,onContextMenu:ne,onMouseEnter:ae,onMouseMove:re,onMouseLeave:le,onKeyDown:O?W:void 0,tabIndex:O?0:void 0,role:O?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":O?`${K9}-${v}`:void 0,ref:M,children:[!q&&N.jsx(T,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:L,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:G,sourceY:K,targetX:Q,targetY:R,sourcePosition:V,targetPosition:X,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:j,markerEnd:I,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),$&&N.jsx(Zne,{edge:x,isReconnectable:$,reconnectRadius:d,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,sourceX:G,sourceY:K,targetX:Q,targetY:R,sourcePosition:V,targetPosition:X,setUpdateHover:P,setReconnecting:D})]})})}const Xne=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function xP({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:f,onEdgeClick:d,reconnectRadius:h,onEdgeDoubleClick:m,onReconnectStart:g,onReconnectEnd:v,disableKeyboardA11y:w}){const{edgesFocusable:b,edgesReconnectable:_,elementsSelectable:S,onError:x}=ut(Xne,Ut),A=Dne(t);return N.jsxs("div",{className:"react-flow__edges",children:[N.jsx(qne,{defaultColor:e,rfId:n}),A.map(k=>N.jsx(Kne,{id:k,edgesFocusable:b,edgesReconnectable:_,elementsSelectable:S,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,onClick:d,reconnectRadius:h,onDoubleClick:m,onReconnectStart:g,onReconnectEnd:v,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:w},k))]})}xP.displayName="EdgeRenderer";const Wne=te.memo(xP),Qne=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Jne({children:e}){const t=ut(Qne);return N.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function ere(e){const t=Ip(),n=te.useRef(!1);te.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const tre=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function nre(e){const t=ut(tre),n=Lt();return te.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function rre(e){return e.connection.inProgress?{...e.connection,to:Rc(e.connection.to,e.transform)}:{...e.connection}}function ire(e){return rre}function are(e){const t=ire();return ut(t,Ut)}const sre=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function ore({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:o,isValid:l,inProgress:c}=ut(sre,Ut);return!(a&&i&&c)?null:N.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:N.jsx("g",{className:en(["react-flow__connection",_9(l)]),children:N.jsx(wP,{style:t,type:n,CustomComponent:r,isValid:l})})})}const wP=({style:e,type:t=Ca.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:o,fromHandle:l,fromPosition:c,to:f,toNode:d,toHandle:h,toPosition:m}=are();if(!i)return;if(n)return N.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:a.x,fromY:a.y,toX:f.x,toY:f.y,fromPosition:c,toPosition:m,connectionStatus:_9(r),toNode:d,toHandle:h});let g="";const v={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:f.x,targetY:f.y,targetPosition:m};switch(t){case Ca.Bezier:[g]=M9(v);break;case Ca.SimpleBezier:[g]=uP(v);break;case Ca.Step:[g]=$w({...v,borderRadius:0});break;case Ca.SmoothStep:[g]=$w(v);break;default:[g]=D9(v)}return N.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};wP.displayName="ConnectionLine";const lre={};function ON(e=lre){te.useRef(e),Lt(),te.useEffect(()=>{},[e])}function ure(){Lt(),te.useRef(!1),te.useEffect(()=>{},[])}function SP({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:d,onSelectionContextMenu:h,onSelectionStart:m,onSelectionEnd:g,connectionLineType:v,connectionLineStyle:w,connectionLineComponent:b,connectionLineContainerStyle:_,selectionKeyCode:S,selectionOnDrag:x,selectionMode:A,multiSelectionKeyCode:k,panActivationKeyCode:T,zoomActivationKeyCode:O,deleteKeyCode:$,onlyRenderVisibleElements:L,elementsSelectable:M,defaultViewport:z,translateExtent:P,minZoom:q,maxZoom:D,preventScrolling:H,defaultMarkerColor:B,zoomOnScroll:G,zoomOnPinch:K,panOnScroll:Q,panOnScrollSpeed:R,panOnScrollMode:V,zoomOnDoubleClick:X,panOnDrag:j,onPaneClick:I,onPaneMouseEnter:U,onPaneMouseMove:Y,onPaneMouseLeave:ne,onPaneScroll:ae,onPaneContextMenu:re,paneClickDistance:le,nodeClickDistance:W,onEdgeContextMenu:J,onEdgeMouseEnter:se,onEdgeMouseMove:fe,onEdgeMouseLeave:me,reconnectRadius:xe,onReconnect:we,onReconnectStart:Ve,onReconnectEnd:qe,noDragClassName:We,noWheelClassName:He,noPanClassName:$e,disableKeyboardA11y:Be,nodeExtent:Ot,rfId:kt,viewport:pe,onViewportChange:_e}){return ON(e),ON(t),ure(),ere(n),nre(pe),N.jsx(Ane,{onPaneClick:I,onPaneMouseEnter:U,onPaneMouseMove:Y,onPaneMouseLeave:ne,onPaneContextMenu:re,onPaneScroll:ae,paneClickDistance:le,deleteKeyCode:$,selectionKeyCode:S,selectionOnDrag:x,selectionMode:A,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:k,panActivationKeyCode:T,zoomActivationKeyCode:O,elementsSelectable:M,zoomOnScroll:G,zoomOnPinch:K,zoomOnDoubleClick:X,panOnScroll:Q,panOnScrollSpeed:R,panOnScrollMode:V,panOnDrag:j,defaultViewport:z,translateExtent:P,minZoom:q,maxZoom:D,onSelectionContextMenu:h,preventScrolling:H,noDragClassName:We,noWheelClassName:He,noPanClassName:$e,disableKeyboardA11y:Be,onViewportChange:_e,isControlledViewport:!!pe,children:N.jsxs(Jne,{children:[N.jsx(Wne,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:we,onReconnectStart:Ve,onReconnectEnd:qe,onlyRenderVisibleElements:L,onEdgeContextMenu:J,onEdgeMouseEnter:se,onEdgeMouseMove:fe,onEdgeMouseLeave:me,reconnectRadius:xe,defaultMarkerColor:B,noPanClassName:$e,disableKeyboardA11y:Be,rfId:kt}),N.jsx(ore,{style:w,type:v,component:b,containerStyle:_}),N.jsx("div",{className:"react-flow__edgelabel-renderer"}),N.jsx($ne,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:d,nodeClickDistance:W,onlyRenderVisibleElements:L,noPanClassName:$e,noDragClassName:We,disableKeyboardA11y:Be,nodeExtent:Ot,rfId:kt}),N.jsx("div",{className:"react-flow__viewport-portal"})]})})}SP.displayName="GraphView";const cre=te.memo(SP),NN=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:f=2,nodeOrigin:d,nodeExtent:h}={})=>{const m=new Map,g=new Map,v=new Map,w=new Map,b=r??t??[],_=n??e??[],S=d??[0,0],x=h??cc;P9(v,w,b);const A=Iw(_,m,g,{nodeOrigin:S,nodeExtent:x,elevateNodesOnSelect:!1});let k=[0,0,1];if(o&&i&&a){const T=Nc(m,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:O,y:$,zoom:L}=OS(T,i,a,c,f,(l==null?void 0:l.padding)??.1);k=[O,$,L]}return{rfId:"1",width:0,height:0,transform:k,nodes:_,nodesInitialized:A,nodeLookup:m,parentLookup:g,edges:b,edgeLookup:w,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:cc,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Zo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:S,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...v9},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:Nee,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},fre=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:d,nodeExtent:h})=>Rte((m,g)=>{async function v(){const{nodeLookup:w,panZoom:b,fitViewOptions:_,fitViewResolver:S,width:x,height:A,minZoom:k,maxZoom:T}=g();b&&(await Cee({nodes:w,width:x,height:A,panZoom:b,minZoom:k,maxZoom:T},_),S==null||S.resolve(!0),m({fitViewResolver:null}))}return{...NN({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:d,nodeExtent:h,defaultNodes:n,defaultEdges:r}),setNodes:w=>{const{nodeLookup:b,parentLookup:_,nodeOrigin:S,elevateNodesOnSelect:x,fitViewQueued:A}=g(),k=Iw(w,b,_,{nodeOrigin:S,nodeExtent:h,elevateNodesOnSelect:x,checkEquality:!0});A&&k?(v(),m({nodes:w,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:w,nodesInitialized:k})},setEdges:w=>{const{connectionLookup:b,edgeLookup:_}=g();P9(b,_,w),m({edges:w})},setDefaultNodesAndEdges:(w,b)=>{if(w){const{setNodes:_}=g();_(w),m({hasDefaultNodes:!0})}if(b){const{setEdges:_}=g();_(b),m({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:b,nodeLookup:_,parentLookup:S,domNode:x,nodeOrigin:A,nodeExtent:k,debug:T,fitViewQueued:O}=g(),{changes:$,updatedInternals:L}=Kee(w,_,S,x,A,k);L&&(Gee(_,S,{nodeOrigin:A,nodeExtent:k}),O?(v(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),($==null?void 0:$.length)>0&&(T&&console.log("React Flow: trigger node changes",$),b==null||b($)))},updateNodePositions:(w,b=!1)=>{const _=[],S=[],{nodeLookup:x,triggerNodeChanges:A}=g();for(const[k,T]of w){const O=x.get(k),$=!!(O!=null&&O.expandParent&&(O!=null&&O.parentId)&&(T!=null&&T.position)),L={id:k,type:"position",position:$?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:b};$&&O.parentId&&_.push({id:k,parentId:O.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),S.push(L)}if(_.length>0){const{parentLookup:k,nodeOrigin:T}=g(),O=$S(_,x,k,T);S.push(...O)}A(S)},triggerNodeChanges:w=>{const{onNodesChange:b,setNodes:_,nodes:S,hasDefaultNodes:x,debug:A}=g();if(w!=null&&w.length){if(x){const k=Q9(w,S);_(k)}A&&console.log("React Flow: trigger node changes",w),b==null||b(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:b,setEdges:_,edges:S,hasDefaultEdges:x,debug:A}=g();if(w!=null&&w.length){if(x){const k=J9(w,S);_(k)}A&&console.log("React Flow: trigger edge changes",w),b==null||b(w)}},addSelectedNodes:w=>{const{multiSelectionActive:b,edgeLookup:_,nodeLookup:S,triggerNodeChanges:x,triggerEdgeChanges:A}=g();if(b){const k=w.map(T=>ls(T,!0));x(k);return}x(Do(S,new Set([...w]),!0)),A(Do(_))},addSelectedEdges:w=>{const{multiSelectionActive:b,edgeLookup:_,nodeLookup:S,triggerNodeChanges:x,triggerEdgeChanges:A}=g();if(b){const k=w.map(T=>ls(T,!0));A(k);return}A(Do(_,new Set([...w]))),x(Do(S,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:b}={})=>{const{edges:_,nodes:S,nodeLookup:x,triggerNodeChanges:A,triggerEdgeChanges:k}=g(),T=w||S,O=b||_,$=T.map(M=>{const z=x.get(M.id);return z&&(z.selected=!1),ls(M.id,!1)}),L=O.map(M=>ls(M.id,!1));A($),k(L)},setMinZoom:w=>{const{panZoom:b,maxZoom:_}=g();b==null||b.setScaleExtent([w,_]),m({minZoom:w})},setMaxZoom:w=>{const{panZoom:b,minZoom:_}=g();b==null||b.setScaleExtent([_,w]),m({maxZoom:w})},setTranslateExtent:w=>{var b;(b=g().panZoom)==null||b.setTranslateExtent(w),m({translateExtent:w})},setPaneClickDistance:w=>{var b;(b=g().panZoom)==null||b.setClickDistance(w)},resetSelectedElements:()=>{const{edges:w,nodes:b,triggerNodeChanges:_,triggerEdgeChanges:S,elementsSelectable:x}=g();if(!x)return;const A=b.reduce((T,O)=>O.selected?[...T,ls(O.id,!1)]:T,[]),k=w.reduce((T,O)=>O.selected?[...T,ls(O.id,!1)]:T,[]);_(A),S(k)},setNodeExtent:w=>{const{nodes:b,nodeLookup:_,parentLookup:S,nodeOrigin:x,elevateNodesOnSelect:A,nodeExtent:k}=g();w[0][0]===k[0][0]&&w[0][1]===k[0][1]&&w[1][0]===k[1][0]&&w[1][1]===k[1][1]||(Iw(b,_,S,{nodeOrigin:x,nodeExtent:w,elevateNodesOnSelect:A,checkEquality:!1}),m({nodeExtent:w}))},panBy:w=>{const{transform:b,width:_,height:S,panZoom:x,translateExtent:A}=g();return Xee({delta:w,panZoom:x,transform:b,translateExtent:A,width:_,height:S})},cancelConnection:()=>{m({connection:{...v9}})},updateConnection:w=>{m({connection:w})},reset:()=>m({...NN()})}},Object.is);function EP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:f,nodeOrigin:d,nodeExtent:h,children:m}){const[g]=te.useState(()=>fre({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:f,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:h}));return N.jsx(jte,{value:g,children:N.jsx(tne,{children:m})})}function dre({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:h,nodeExtent:m}){return te.useContext(Dp)?N.jsx(N.Fragment,{children:e}):N.jsx(EP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:f,initialMaxZoom:d,nodeOrigin:h,nodeExtent:m,children:e})}const hre={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function pre({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:f,onMove:d,onMoveStart:h,onMoveEnd:m,onConnect:g,onConnectStart:v,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:_,onNodeMouseEnter:S,onNodeMouseMove:x,onNodeMouseLeave:A,onNodeContextMenu:k,onNodeDoubleClick:T,onNodeDragStart:O,onNodeDrag:$,onNodeDragStop:L,onNodesDelete:M,onEdgesDelete:z,onDelete:P,onSelectionChange:q,onSelectionDragStart:D,onSelectionDrag:H,onSelectionDragStop:B,onSelectionContextMenu:G,onSelectionStart:K,onSelectionEnd:Q,onBeforeDelete:R,connectionMode:V,connectionLineType:X=Ca.Bezier,connectionLineStyle:j,connectionLineComponent:I,connectionLineContainerStyle:U,deleteKeyCode:Y="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:ae=!1,selectionMode:re=fc.Full,panActivationKeyCode:le="Space",multiSelectionKeyCode:W=rp()?"Meta":"Control",zoomActivationKeyCode:J=rp()?"Meta":"Control",snapToGrid:se,snapGrid:fe,onlyRenderVisibleElements:me=!1,selectNodesOnDrag:xe,nodesDraggable:we,nodesConnectable:Ve,nodesFocusable:qe,nodeOrigin:We=X9,edgesFocusable:He,edgesReconnectable:$e,elementsSelectable:Be=!0,defaultViewport:Ot=Hte,minZoom:kt=.5,maxZoom:pe=2,translateExtent:_e=cc,preventScrolling:Te=!0,nodeExtent:je,defaultMarkerColor:rt="#b1b1b7",zoomOnScroll:cn=!0,zoomOnPinch:Cn=!0,panOnScroll:$t=!1,panOnScrollSpeed:Gt=.5,panOnScrollMode:wn=bs.Free,zoomOnDoubleClick:Yt=!0,panOnDrag:On=!0,onPaneClick:Bn,onPaneMouseEnter:Hc,onPaneMouseMove:Gc,onPaneMouseLeave:gl,onPaneScroll:za,onPaneContextMenu:bm,paneClickDistance:yl=0,nodeClickDistance:Yc=0,children:bl,onReconnect:vl,onReconnectStart:Zc,onReconnectEnd:vm,onEdgeContextMenu:zr,onEdgeDoubleClick:sn,onEdgeMouseEnter:yn,onEdgeMouseMove:Ui,onEdgeMouseLeave:_l,reconnectRadius:_m=10,onNodesChange:xm,onEdgesChange:Kc,noDragClassName:qa="nodrag",noWheelClassName:xl="nowheel",noPanClassName:si="nopan",fitView:oi,fitViewOptions:Vi,connectOnClick:Hi,attributionPosition:Zt,proOptions:Xc,defaultEdgeOptions:Wc,elevateNodesOnSelect:li,elevateEdgesOnSelect:Gi,disableKeyboardA11y:Qc=!1,autoPanOnConnect:Jc,autoPanOnNodeDrag:ef,autoPanSpeed:wm,connectionRadius:Ps,isValidConnection:Ls,onError:xr,style:wl,id:Sl,nodeDragThreshold:Yi,viewport:El,onViewportChange:kl,width:Sm,height:tf,colorMode:Nn="light",debug:nf,onScroll:zs,...qs},rf){const Zi=Sl||"1",Em=Kte(Nn),Rn=te.useCallback(Fs=>{Fs.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),zs==null||zs(Fs)},[zs]);return N.jsx("div",{"data-testid":"rf__wrapper",...qs,onScroll:Rn,style:{...wl,...hre},ref:rf,className:en(["react-flow",i,Em]),id:Sl,children:N.jsxs(dre,{nodes:e,edges:t,width:Sm,height:tf,fitView:oi,fitViewOptions:Vi,minZoom:kt,maxZoom:pe,nodeOrigin:We,nodeExtent:je,children:[N.jsx(cre,{onInit:f,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:S,onNodeMouseMove:x,onNodeMouseLeave:A,onNodeContextMenu:k,onNodeDoubleClick:T,nodeTypes:a,edgeTypes:o,connectionLineType:X,connectionLineStyle:j,connectionLineComponent:I,connectionLineContainerStyle:U,selectionKeyCode:ne,selectionOnDrag:ae,selectionMode:re,deleteKeyCode:Y,multiSelectionKeyCode:W,panActivationKeyCode:le,zoomActivationKeyCode:J,onlyRenderVisibleElements:me,defaultViewport:Ot,translateExtent:_e,minZoom:kt,maxZoom:pe,preventScrolling:Te,zoomOnScroll:cn,zoomOnPinch:Cn,zoomOnDoubleClick:Yt,panOnScroll:$t,panOnScrollSpeed:Gt,panOnScrollMode:wn,panOnDrag:On,onPaneClick:Bn,onPaneMouseEnter:Hc,onPaneMouseMove:Gc,onPaneMouseLeave:gl,onPaneScroll:za,onPaneContextMenu:bm,paneClickDistance:yl,nodeClickDistance:Yc,onSelectionContextMenu:G,onSelectionStart:K,onSelectionEnd:Q,onReconnect:vl,onReconnectStart:Zc,onReconnectEnd:vm,onEdgeContextMenu:zr,onEdgeDoubleClick:sn,onEdgeMouseEnter:yn,onEdgeMouseMove:Ui,onEdgeMouseLeave:_l,reconnectRadius:_m,defaultMarkerColor:rt,noDragClassName:qa,noWheelClassName:xl,noPanClassName:si,rfId:Zi,disableKeyboardA11y:Qc,nodeExtent:je,viewport:El,onViewportChange:kl}),N.jsx(Zte,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:v,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:_,nodesDraggable:we,nodesConnectable:Ve,nodesFocusable:qe,edgesFocusable:He,edgesReconnectable:$e,elementsSelectable:Be,elevateNodesOnSelect:li,elevateEdgesOnSelect:Gi,minZoom:kt,maxZoom:pe,nodeExtent:je,onNodesChange:xm,onEdgesChange:Kc,snapToGrid:se,snapGrid:fe,connectionMode:V,translateExtent:_e,connectOnClick:Hi,defaultEdgeOptions:Wc,fitView:oi,fitViewOptions:Vi,onNodesDelete:M,onEdgesDelete:z,onDelete:P,onNodeDragStart:O,onNodeDrag:$,onNodeDragStop:L,onSelectionDrag:H,onSelectionDragStart:D,onSelectionDragStop:B,onMove:d,onMoveStart:h,onMoveEnd:m,noPanClassName:si,nodeOrigin:We,rfId:Zi,autoPanOnConnect:Jc,autoPanOnNodeDrag:ef,autoPanSpeed:wm,onError:xr,connectionRadius:Ps,isValidConnection:Ls,selectNodesOnDrag:xe,nodeDragThreshold:Yi,onBeforeDelete:R,paneClickDistance:yl,debug:nf}),N.jsx(Vte,{onSelectionChange:q}),bl,N.jsx(zte,{proOptions:Xc,position:Zt}),N.jsx(Pte,{rfId:Zi,disableKeyboardA11y:Qc})]})})}var mre=eP(pre);function gre(e){const[t,n]=te.useState(e),r=te.useCallback(i=>n(a=>Q9(i,a)),[]);return[t,n,r]}function yre(e){const[t,n]=te.useState(e),r=te.useCallback(i=>n(a=>J9(i,a)),[]);return[t,n,r]}function bre({dimensions:e,lineWidth:t,variant:n,className:r}){return N.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:en(["react-flow__background-pattern",n,r])})}function vre({radius:e,className:t}){return N.jsx("circle",{cx:e,cy:e,r:e,className:en(["react-flow__background-pattern","dots",t])})}var ja;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ja||(ja={}));const _re={[ja.Dots]:1,[ja.Lines]:1,[ja.Cross]:6},xre=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function kP({id:e,variant:t=ja.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:l,style:c,className:f,patternClassName:d}){const h=te.useRef(null),{transform:m,patternId:g}=ut(xre,Ut),v=r||_re[t],w=t===ja.Dots,b=t===ja.Cross,_=Array.isArray(n)?n:[n,n],S=[_[0]*m[2]||1,_[1]*m[2]||1],x=v*m[2],A=Array.isArray(a)?a:[a,a],k=b?[x,x]:S,T=[A[0]*m[2]||1+k[0]/2,A[1]*m[2]||1+k[1]/2],O=`${g}${e||""}`;return N.jsxs("svg",{className:en(["react-flow__background",f]),style:{...c,...Pp,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:h,"data-testid":"rf__background",children:[N.jsx("pattern",{id:O,x:m[0]%S[0],y:m[1]%S[1],width:S[0],height:S[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:w?N.jsx(vre,{radius:x/2,className:d}):N.jsx(bre,{dimensions:k,lineWidth:i,variant:t,className:d})}),N.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${O})`})]})}kP.displayName="Background";const wre=te.memo(kP);function Sre(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:N.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Ere(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:N.jsx("path",{d:"M0 0h32v4.2H0z"})})}function kre(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:N.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 Are(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.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 Tre(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.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 Rd({children:e,className:t,...n}){return N.jsx("button",{type:"button",className:en(["react-flow__controls-button",t]),...n,children:e})}const Cre=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function AP({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:f,children:d,position:h="bottom-left",orientation:m="vertical","aria-label":g="React Flow controls"}){const v=Lt(),{isInteractive:w,minZoomReached:b,maxZoomReached:_}=ut(Cre,Ut),{zoomIn:S,zoomOut:x,fitView:A}=Ip(),k=()=>{S(),a==null||a()},T=()=>{x(),o==null||o()},O=()=>{A(i),l==null||l()},$=()=>{v.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c==null||c(!w)},L=m==="horizontal"?"horizontal":"vertical";return N.jsxs(jc,{className:en(["react-flow__controls",L,f]),position:h,style:e,"data-testid":"rf__controls","aria-label":g,children:[t&&N.jsxs(N.Fragment,{children:[N.jsx(Rd,{onClick:k,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:_,children:N.jsx(Sre,{})}),N.jsx(Rd,{onClick:T,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b,children:N.jsx(Ere,{})})]}),n&&N.jsx(Rd,{className:"react-flow__controls-fitview",onClick:O,title:"fit view","aria-label":"fit view",children:N.jsx(kre,{})}),r&&N.jsx(Rd,{className:"react-flow__controls-interactive",onClick:$,title:"toggle interactivity","aria-label":"toggle interactivity",children:w?N.jsx(Tre,{}):N.jsx(Are,{})}),d]})}AP.displayName="Controls";const Ore=te.memo(AP);function Nre({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:l,strokeWidth:c,className:f,borderRadius:d,shapeRendering:h,selected:m,onClick:g}){const{background:v,backgroundColor:w}=a||{},b=o||v||w;return N.jsx("rect",{className:en(["react-flow__minimap-node",{selected:m},f]),x:t,y:n,rx:d,ry:d,width:r,height:i,style:{fill:b,stroke:l,strokeWidth:c},shapeRendering:h,onClick:g?_=>g(_,e):void 0})}const Rre=te.memo(Nre),jre=e=>e.nodes.map(t=>t.id),N0=e=>e instanceof Function?e:()=>e;function Mre({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=Rre,onClick:o}){const l=ut(jre,Ut),c=N0(t),f=N0(e),d=N0(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return N.jsx(N.Fragment,{children:l.map(m=>N.jsx(Dre,{id:m,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:h},m))})}function $re({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:f,x:d,y:h,width:m,height:g}=ut(v=>{const{internals:w}=v.nodeLookup.get(e),b=w.userNode,{x:_,y:S}=w.positionAbsolute,{width:x,height:A}=zi(b);return{node:b,x:_,y:S,width:x,height:A}},Ut);return!f||f.hidden||!T9(f)?null:N.jsx(l,{x:d,y:h,width:m,height:g,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:i,strokeColor:n(f),strokeWidth:a,shapeRendering:o,onClick:c,id:f.id})}const Dre=te.memo($re);var Ire=te.memo(Mre);const Pre=200,Lre=150,zre=e=>!e.hidden,qre=e=>{const 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]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?A9(Nc(e.nodeLookup,{filter:zre}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},Fre="react-flow__minimap-desc";function TP({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:f,maskStrokeColor:d,maskStrokeWidth:h,position:m="bottom-right",onClick:g,onNodeClick:v,pannable:w=!1,zoomable:b=!1,ariaLabel:_="React Flow mini map",inversePan:S,zoomStep:x=10,offsetScale:A=5}){const k=Lt(),T=te.useRef(null),{boundingRect:O,viewBB:$,rfId:L,panZoom:M,translateExtent:z,flowWidth:P,flowHeight:q}=ut(qre,Ut),D=(e==null?void 0:e.width)??Pre,H=(e==null?void 0:e.height)??Lre,B=O.width/D,G=O.height/H,K=Math.max(B,G),Q=K*D,R=K*H,V=A*K,X=O.x-(Q-O.width)/2-V,j=O.y-(R-O.height)/2-V,I=Q+V*2,U=R+V*2,Y=`${Fre}-${L}`,ne=te.useRef(0),ae=te.useRef();ne.current=K,te.useEffect(()=>{if(T.current&&M)return ae.current=ite({domNode:T.current,panZoom:M,getTransform:()=>k.getState().transform,getViewScale:()=>ne.current}),()=>{var W;(W=ae.current)==null||W.destroy()}},[M]),te.useEffect(()=>{var W;(W=ae.current)==null||W.update({translateExtent:z,width:P,height:q,inversePan:S,pannable:w,zoomStep:x,zoomable:b})},[w,b,S,x,z,P,q]);const re=g?W=>{var fe;const[J,se]=((fe=ae.current)==null?void 0:fe.pointer(W))||[0,0];g(W,{x:J,y:se})}:void 0,le=v?te.useCallback((W,J)=>{const se=k.getState().nodeLookup.get(J).internals.userNode;v(W,se)},[]):void 0;return N.jsx(jc,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*K: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:en(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:N.jsxs("svg",{width:D,height:H,viewBox:`${X} ${j} ${I} ${U}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Y,ref:T,onClick:re,children:[_&&N.jsx("title",{id:Y,children:_}),N.jsx(Ire,{onClick:le,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),N.jsx("path",{className:"react-flow__minimap-mask",d:`M${X-V},${j-V}h${I+V*2}v${U+V*2}h${-I-V*2}z
|
|
230
|
-
M${$.x},${$.y}h${$.width}v${$.height}h${-$.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}TP.displayName="MiniMap";te.memo(TP);function Bre({nodeId:e,position:t,variant:n=Yu.Handle,className:r,style:i={},children:a,color:o,minWidth:l=10,minHeight:c=10,maxWidth:f=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:m,shouldResize:g,onResizeStart:v,onResize:w,onResizeEnd:b}){const _=iP(),S=typeof e=="string"?e:_,x=Lt(),A=te.useRef(null),k=n===Yu.Line?"right":"bottom-right",T=t??k,O=te.useRef(null);te.useEffect(()=>{if(!(!A.current||!S))return O.current||(O.current=vte({domNode:A.current,nodeId:S,getStoreItems:()=>{const{nodeLookup:z,transform:P,snapGrid:q,snapToGrid:D,nodeOrigin:H,domNode:B}=x.getState();return{nodeLookup:z,transform:P,snapGrid:q,snapToGrid:D,nodeOrigin:H,paneDomNode:B}},onChange:(z,P)=>{const{triggerNodeChanges:q,nodeLookup:D,parentLookup:H,nodeOrigin:B}=x.getState(),G=[],K={x:z.x,y:z.y},Q=D.get(S);if(Q&&Q.expandParent&&Q.parentId){const R=Q.origin??B,V=z.width??Q.measured.width??0,X=z.height??Q.measured.height??0,j={id:Q.id,parentId:Q.parentId,rect:{width:V,height:X,...C9({x:z.x??Q.position.x,y:z.y??Q.position.y},{width:V,height:X},Q.parentId,D,R)}},I=$S([j],D,H,B);G.push(...I),K.x=z.x?Math.max(R[0]*V,z.x):void 0,K.y=z.y?Math.max(R[1]*X,z.y):void 0}if(K.x!==void 0&&K.y!==void 0){const R={id:S,type:"position",position:{...K}};G.push(R)}if(z.width!==void 0&&z.height!==void 0){const V={id:S,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};G.push(V)}for(const R of P){const V={...R,type:"position"};G.push(V)}q(G)},onEnd:({width:z,height:P})=>{const q={id:S,type:"dimensions",resizing:!1,dimensions:{width:z,height:P}};x.getState().triggerNodeChanges([q])}})),O.current.update({controlPosition:T,boundaries:{minWidth:l,minHeight:c,maxWidth:f,maxHeight:d},keepAspectRatio:h,resizeDirection:m,onResizeStart:v,onResize:w,onResizeEnd:b,shouldResize:g}),()=>{var z;(z=O.current)==null||z.destroy()}},[T,l,c,f,d,h,v,w,b,g]);const $=T.split("-"),L=n===Yu.Line?"borderColor":"backgroundColor",M=o?{...i,[L]:o}:i;return N.jsx("div",{className:en(["react-flow__resize-control","nodrag",...$,n,r]),ref:A,style:M,children:a})}te.memo(Bre);var R0,RN;function IS(){if(RN)return R0;RN=1;var e="\0",t="\0",n="";class r{constructor(d){De(this,"_isDirected",!0);De(this,"_isMultigraph",!1);De(this,"_isCompound",!1);De(this,"_label");De(this,"_defaultNodeLabelFn",()=>{});De(this,"_defaultEdgeLabelFn",()=>{});De(this,"_nodes",{});De(this,"_in",{});De(this,"_preds",{});De(this,"_out",{});De(this,"_sucs",{});De(this,"_edgeObjs",{});De(this,"_edgeLabels",{});De(this,"_nodeCount",0);De(this,"_edgeCount",0);De(this,"_parent");De(this,"_children");d&&(this._isDirected=Object.hasOwn(d,"directed")?d.directed:!0,this._isMultigraph=Object.hasOwn(d,"multigraph")?d.multigraph:!1,this._isCompound=Object.hasOwn(d,"compound")?d.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(d){return this._label=d,this}graph(){return this._label}setDefaultNodeLabel(d){return this._defaultNodeLabelFn=d,typeof d!="function"&&(this._defaultNodeLabelFn=()=>d),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var d=this;return this.nodes().filter(h=>Object.keys(d._in[h]).length===0)}sinks(){var d=this;return this.nodes().filter(h=>Object.keys(d._out[h]).length===0)}setNodes(d,h){var m=arguments,g=this;return d.forEach(function(v){m.length>1?g.setNode(v,h):g.setNode(v)}),this}setNode(d,h){return Object.hasOwn(this._nodes,d)?(arguments.length>1&&(this._nodes[d]=h),this):(this._nodes[d]=arguments.length>1?h:this._defaultNodeLabelFn(d),this._isCompound&&(this._parent[d]=t,this._children[d]={},this._children[t][d]=!0),this._in[d]={},this._preds[d]={},this._out[d]={},this._sucs[d]={},++this._nodeCount,this)}node(d){return this._nodes[d]}hasNode(d){return Object.hasOwn(this._nodes,d)}removeNode(d){var h=this;if(Object.hasOwn(this._nodes,d)){var m=g=>h.removeEdge(h._edgeObjs[g]);delete this._nodes[d],this._isCompound&&(this._removeFromParentsChildList(d),delete this._parent[d],this.children(d).forEach(function(g){h.setParent(g)}),delete this._children[d]),Object.keys(this._in[d]).forEach(m),delete this._in[d],delete this._preds[d],Object.keys(this._out[d]).forEach(m),delete this._out[d],delete this._sucs[d],--this._nodeCount}return this}setParent(d,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(h===void 0)h=t;else{h+="";for(var m=h;m!==void 0;m=this.parent(m))if(m===d)throw new Error("Setting "+h+" as parent of "+d+" would create a cycle");this.setNode(h)}return this.setNode(d),this._removeFromParentsChildList(d),this._parent[d]=h,this._children[h][d]=!0,this}_removeFromParentsChildList(d){delete this._children[this._parent[d]][d]}parent(d){if(this._isCompound){var h=this._parent[d];if(h!==t)return h}}children(d=t){if(this._isCompound){var h=this._children[d];if(h)return Object.keys(h)}else{if(d===t)return this.nodes();if(this.hasNode(d))return[]}}predecessors(d){var h=this._preds[d];if(h)return Object.keys(h)}successors(d){var h=this._sucs[d];if(h)return Object.keys(h)}neighbors(d){var h=this.predecessors(d);if(h){const g=new Set(h);for(var m of this.successors(d))g.add(m);return Array.from(g.values())}}isLeaf(d){var h;return this.isDirected()?h=this.successors(d):h=this.neighbors(d),h.length===0}filterNodes(d){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var m=this;Object.entries(this._nodes).forEach(function([w,b]){d(w)&&h.setNode(w,b)}),Object.values(this._edgeObjs).forEach(function(w){h.hasNode(w.v)&&h.hasNode(w.w)&&h.setEdge(w,m.edge(w))});var g={};function v(w){var b=m.parent(w);return b===void 0||h.hasNode(b)?(g[w]=b,b):b in g?g[b]:v(b)}return this._isCompound&&h.nodes().forEach(w=>h.setParent(w,v(w))),h}setDefaultEdgeLabel(d){return this._defaultEdgeLabelFn=d,typeof d!="function"&&(this._defaultEdgeLabelFn=()=>d),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(d,h){var m=this,g=arguments;return d.reduce(function(v,w){return g.length>1?m.setEdge(v,w,h):m.setEdge(v,w),w}),this}setEdge(){var d,h,m,g,v=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(d=w.v,h=w.w,m=w.name,arguments.length===2&&(g=arguments[1],v=!0)):(d=w,h=arguments[1],m=arguments[3],arguments.length>2&&(g=arguments[2],v=!0)),d=""+d,h=""+h,m!==void 0&&(m=""+m);var b=o(this._isDirected,d,h,m);if(Object.hasOwn(this._edgeLabels,b))return v&&(this._edgeLabels[b]=g),this;if(m!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(d),this.setNode(h),this._edgeLabels[b]=v?g:this._defaultEdgeLabelFn(d,h,m);var _=l(this._isDirected,d,h,m);return d=_.v,h=_.w,Object.freeze(_),this._edgeObjs[b]=_,i(this._preds[h],d),i(this._sucs[d],h),this._in[h][b]=_,this._out[d][b]=_,this._edgeCount++,this}edge(d,h,m){var g=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,d,h,m);return this._edgeLabels[g]}edgeAsObj(){const d=this.edge(...arguments);return typeof d!="object"?{label:d}:d}hasEdge(d,h,m){var g=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,d,h,m);return Object.hasOwn(this._edgeLabels,g)}removeEdge(d,h,m){var g=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,d,h,m),v=this._edgeObjs[g];return v&&(d=v.v,h=v.w,delete this._edgeLabels[g],delete this._edgeObjs[g],a(this._preds[h],d),a(this._sucs[d],h),delete this._in[h][g],delete this._out[d][g],this._edgeCount--),this}inEdges(d,h){var m=this._in[d];if(m){var g=Object.values(m);return h?g.filter(v=>v.v===h):g}}outEdges(d,h){var m=this._out[d];if(m){var g=Object.values(m);return h?g.filter(v=>v.w===h):g}}nodeEdges(d,h){var m=this.inEdges(d,h);if(m)return m.concat(this.outEdges(d,h))}}function i(f,d){f[d]?f[d]++:f[d]=1}function a(f,d){--f[d]||delete f[d]}function o(f,d,h,m){var g=""+d,v=""+h;if(!f&&g>v){var w=g;g=v,v=w}return g+n+v+n+(m===void 0?e:m)}function l(f,d,h,m){var g=""+d,v=""+h;if(!f&&g>v){var w=g;g=v,v=w}var b={v:g,w:v};return m&&(b.name=m),b}function c(f,d){return o(f,d.v,d.w,d.name)}return R0=r,R0}var j0,jN;function Ure(){return jN||(jN=1,j0="2.2.4"),j0}var M0,MN;function Vre(){return MN||(MN=1,M0={Graph:IS(),version:Ure()}),M0}var $0,$N;function Hre(){if($N)return $0;$N=1;var e=IS();$0={write:t,read:i};function t(a){var o={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:n(a),edges:r(a)};return a.graph()!==void 0&&(o.value=structuredClone(a.graph())),o}function n(a){return a.nodes().map(function(o){var l=a.node(o),c=a.parent(o),f={v:o};return l!==void 0&&(f.value=l),c!==void 0&&(f.parent=c),f})}function r(a){return a.edges().map(function(o){var l=a.edge(o),c={v:o.v,w:o.w};return o.name!==void 0&&(c.name=o.name),l!==void 0&&(c.value=l),c})}function i(a){var o=new e(a.options).setGraph(a.value);return a.nodes.forEach(function(l){o.setNode(l.v,l.value),l.parent&&o.setParent(l.v,l.parent)}),a.edges.forEach(function(l){o.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),o}return $0}var D0,DN;function Gre(){if(DN)return D0;DN=1,D0=e;function e(t){var n={},r=[],i;function a(o){Object.hasOwn(n,o)||(n[o]=!0,i.push(o),t.successors(o).forEach(a),t.predecessors(o).forEach(a))}return t.nodes().forEach(function(o){i=[],a(o),i.length&&r.push(i)}),r}return D0}var I0,IN;function CP(){if(IN)return I0;IN=1;class e{constructor(){De(this,"_arr",[]);De(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,r){var i=this._keyIndices;if(n=String(n),!Object.hasOwn(i,n)){var a=this._arr,o=a.length;return i[n]=o,a.push({key:n,priority:r}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,r){var i=this._keyIndices[n];if(r>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[i].priority+" New: "+r);this._arr[i].priority=r,this._decrease(i)}_heapify(n){var r=this._arr,i=2*n,a=i+1,o=n;i<r.length&&(o=r[i].priority<r[o].priority?i:o,a<r.length&&(o=r[a].priority<r[o].priority?a:o),o!==n&&(this._swap(n,o),this._heapify(o)))}_decrease(n){for(var r=this._arr,i=r[n].priority,a;n!==0&&(a=n>>1,!(r[a].priority<i));)this._swap(n,a),n=a}_swap(n,r){var i=this._arr,a=this._keyIndices,o=i[n],l=i[r];i[n]=l,i[r]=o,a[l.key]=n,a[o.key]=r}}return I0=e,I0}var P0,PN;function OP(){if(PN)return P0;PN=1;var e=CP();P0=n;var t=()=>1;function n(i,a,o,l){return r(i,String(a),o||t,l||function(c){return i.outEdges(c)})}function r(i,a,o,l){var c={},f=new e,d,h,m=function(g){var v=g.v!==d?g.v:g.w,w=c[v],b=o(g),_=h.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+g+" Weight: "+b);_<w.distance&&(w.distance=_,w.predecessor=d,f.decrease(v,_))};for(i.nodes().forEach(function(g){var v=g===a?0:Number.POSITIVE_INFINITY;c[g]={distance:v},f.add(g,v)});f.size()>0&&(d=f.removeMin(),h=c[d],h.distance!==Number.POSITIVE_INFINITY);)l(d).forEach(m);return c}return P0}var L0,LN;function Yre(){if(LN)return L0;LN=1;var e=OP();L0=t;function t(n,r,i){return n.nodes().reduce(function(a,o){return a[o]=e(n,o,r,i),a},{})}return L0}var z0,zN;function NP(){if(zN)return z0;zN=1,z0=e;function e(t){var n=0,r=[],i={},a=[];function o(l){var c=i[l]={onStack:!0,lowlink:n,index:n++};if(r.push(l),t.successors(l).forEach(function(h){Object.hasOwn(i,h)?i[h].onStack&&(c.lowlink=Math.min(c.lowlink,i[h].index)):(o(h),c.lowlink=Math.min(c.lowlink,i[h].lowlink))}),c.lowlink===c.index){var f=[],d;do d=r.pop(),i[d].onStack=!1,f.push(d);while(l!==d);a.push(f)}}return t.nodes().forEach(function(l){Object.hasOwn(i,l)||o(l)}),a}return z0}var q0,qN;function Zre(){if(qN)return q0;qN=1;var e=NP();q0=t;function t(n){return e(n).filter(function(r){return r.length>1||r.length===1&&n.hasEdge(r[0],r[0])})}return q0}var F0,FN;function Kre(){if(FN)return F0;FN=1,F0=t;var e=()=>1;function t(r,i,a){return n(r,i||e,a||function(o){return r.outEdges(o)})}function n(r,i,a){var o={},l=r.nodes();return l.forEach(function(c){o[c]={},o[c][c]={distance:0},l.forEach(function(f){c!==f&&(o[c][f]={distance:Number.POSITIVE_INFINITY})}),a(c).forEach(function(f){var d=f.v===c?f.w:f.v,h=i(f);o[c][d]={distance:h,predecessor:c}})}),l.forEach(function(c){var f=o[c];l.forEach(function(d){var h=o[d];l.forEach(function(m){var g=h[c],v=f[m],w=h[m],b=g.distance+v.distance;b<w.distance&&(w.distance=b,w.predecessor=v.predecessor)})})}),o}return F0}var B0,BN;function RP(){if(BN)return B0;BN=1;function e(n){var r={},i={},a=[];function o(l){if(Object.hasOwn(i,l))throw new t;Object.hasOwn(r,l)||(i[l]=!0,r[l]=!0,n.predecessors(l).forEach(o),delete i[l],a.push(l))}if(n.sinks().forEach(o),Object.keys(r).length!==n.nodeCount())throw new t;return a}class t extends Error{constructor(){super(...arguments)}}return B0=e,e.CycleException=t,B0}var U0,UN;function Xre(){if(UN)return U0;UN=1;var e=RP();U0=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return U0}var V0,VN;function jP(){if(VN)return V0;VN=1,V0=e;function e(i,a,o){Array.isArray(a)||(a=[a]);var l=i.isDirected()?h=>i.successors(h):h=>i.neighbors(h),c=o==="post"?t:n,f=[],d={};return a.forEach(h=>{if(!i.hasNode(h))throw new Error("Graph does not have node: "+h);c(h,l,d,f)}),f}function t(i,a,o,l){for(var c=[[i,!1]];c.length>0;){var f=c.pop();f[1]?l.push(f[0]):Object.hasOwn(o,f[0])||(o[f[0]]=!0,c.push([f[0],!0]),r(a(f[0]),d=>c.push([d,!1])))}}function n(i,a,o,l){for(var c=[i];c.length>0;){var f=c.pop();Object.hasOwn(o,f)||(o[f]=!0,l.push(f),r(a(f),d=>c.push(d)))}}function r(i,a){for(var o=i.length;o--;)a(i[o],o,i);return i}return V0}var H0,HN;function Wre(){if(HN)return H0;HN=1;var e=jP();H0=t;function t(n,r){return e(n,r,"post")}return H0}var G0,GN;function Qre(){if(GN)return G0;GN=1;var e=jP();G0=t;function t(n,r){return e(n,r,"pre")}return G0}var Y0,YN;function Jre(){if(YN)return Y0;YN=1;var e=IS(),t=CP();Y0=n;function n(r,i){var a=new e,o={},l=new t,c;function f(h){var m=h.v===c?h.w:h.v,g=l.priority(m);if(g!==void 0){var v=i(h);v<g&&(o[m]=c,l.decrease(m,v))}}if(r.nodeCount()===0)return a;r.nodes().forEach(function(h){l.add(h,Number.POSITIVE_INFINITY),a.setNode(h)}),l.decrease(r.nodes()[0],0);for(var d=!1;l.size()>0;){if(c=l.removeMin(),Object.hasOwn(o,c))a.setEdge(c,o[c]);else{if(d)throw new Error("Input graph is not connected: "+r);d=!0}r.nodeEdges(c).forEach(f)}return a}return Y0}var Z0,ZN;function eie(){return ZN||(ZN=1,Z0={components:Gre(),dijkstra:OP(),dijkstraAll:Yre(),findCycles:Zre(),floydWarshall:Kre(),isAcyclic:Xre(),postorder:Wre(),preorder:Qre(),prim:Jre(),tarjan:NP(),topsort:RP()}),Z0}var K0,KN;function Ir(){if(KN)return K0;KN=1;var e=Vre();return K0={Graph:e.Graph,json:Hre(),alg:eie(),version:e.version},K0}var X0,XN;function tie(){if(XN)return X0;XN=1;class e{constructor(){let i={};i._next=i._prev=i,this._sentinel=i}dequeue(){let i=this._sentinel,a=i._prev;if(a!==i)return t(a),a}enqueue(i){let a=this._sentinel;i._prev&&i._next&&t(i),i._next=a._next,a._next._prev=i,a._next=i,i._prev=a}toString(){let i=[],a=this._sentinel,o=a._prev;for(;o!==a;)i.push(JSON.stringify(o,n)),o=o._prev;return"["+i.join(", ")+"]"}}function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,i){if(r!=="_next"&&r!=="_prev")return i}return X0=e,X0}var W0,WN;function nie(){if(WN)return W0;WN=1;let e=Ir().Graph,t=tie();W0=r;let n=()=>1;function r(f,d){if(f.nodeCount()<=1)return[];let h=o(f,d||n);return i(h.graph,h.buckets,h.zeroIdx).flatMap(g=>f.outEdges(g.v,g.w))}function i(f,d,h){let m=[],g=d[d.length-1],v=d[0],w;for(;f.nodeCount();){for(;w=v.dequeue();)a(f,d,h,w);for(;w=g.dequeue();)a(f,d,h,w);if(f.nodeCount()){for(let b=d.length-2;b>0;--b)if(w=d[b].dequeue(),w){m=m.concat(a(f,d,h,w,!0));break}}}return m}function a(f,d,h,m,g){let v=g?[]:void 0;return f.inEdges(m.v).forEach(w=>{let b=f.edge(w),_=f.node(w.v);g&&v.push({v:w.v,w:w.w}),_.out-=b,l(d,h,_)}),f.outEdges(m.v).forEach(w=>{let b=f.edge(w),_=w.w,S=f.node(_);S.in-=b,l(d,h,S)}),f.removeNode(m.v),v}function o(f,d){let h=new e,m=0,g=0;f.nodes().forEach(b=>{h.setNode(b,{v:b,in:0,out:0})}),f.edges().forEach(b=>{let _=h.edge(b.v,b.w)||0,S=d(b),x=_+S;h.setEdge(b.v,b.w,x),g=Math.max(g,h.node(b.v).out+=S),m=Math.max(m,h.node(b.w).in+=S)});let v=c(g+m+3).map(()=>new t),w=m+1;return h.nodes().forEach(b=>{l(v,w,h.node(b))}),{graph:h,buckets:v,zeroIdx:w}}function l(f,d,h){h.out?h.in?f[h.out-h.in+d].enqueue(h):f[f.length-1].enqueue(h):f[0].enqueue(h)}function c(f){const d=[];for(let h=0;h<f;h++)d.push(h);return d}return W0}var Q0,QN;function Jt(){if(QN)return Q0;QN=1;let e=Ir().Graph;Q0={addBorderNode:d,addDummyNode:t,applyWithChunking:g,asNonCompoundGraph:r,buildLayerMatrix:l,intersectRect:o,mapValues:T,maxRank:v,normalizeRanks:c,notime:_,partition:w,pick:k,predecessorWeights:a,range:A,removeEmptyRanks:f,simplify:n,successorWeights:i,time:b,uniqueId:x,zipObject:O};function t($,L,M,z){let P;do P=x(z);while($.hasNode(P));return M.dummy=L,$.setNode(P,M),P}function n($){let L=new e().setGraph($.graph());return $.nodes().forEach(M=>L.setNode(M,$.node(M))),$.edges().forEach(M=>{let z=L.edge(M.v,M.w)||{weight:0,minlen:1},P=$.edge(M);L.setEdge(M.v,M.w,{weight:z.weight+P.weight,minlen:Math.max(z.minlen,P.minlen)})}),L}function r($){let L=new e({multigraph:$.isMultigraph()}).setGraph($.graph());return $.nodes().forEach(M=>{$.children(M).length||L.setNode(M,$.node(M))}),$.edges().forEach(M=>{L.setEdge(M,$.edge(M))}),L}function i($){let L=$.nodes().map(M=>{let z={};return $.outEdges(M).forEach(P=>{z[P.w]=(z[P.w]||0)+$.edge(P).weight}),z});return O($.nodes(),L)}function a($){let L=$.nodes().map(M=>{let z={};return $.inEdges(M).forEach(P=>{z[P.v]=(z[P.v]||0)+$.edge(P).weight}),z});return O($.nodes(),L)}function o($,L){let M=$.x,z=$.y,P=L.x-M,q=L.y-z,D=$.width/2,H=$.height/2;if(!P&&!q)throw new Error("Not possible to find intersection inside of the rectangle");let B,G;return Math.abs(q)*D>Math.abs(P)*H?(q<0&&(H=-H),B=H*P/q,G=H):(P<0&&(D=-D),B=D,G=D*q/P),{x:M+B,y:z+G}}function l($){let L=A(v($)+1).map(()=>[]);return $.nodes().forEach(M=>{let z=$.node(M),P=z.rank;P!==void 0&&(L[P][z.order]=M)}),L}function c($){let L=$.nodes().map(z=>{let P=$.node(z).rank;return P===void 0?Number.MAX_VALUE:P}),M=g(Math.min,L);$.nodes().forEach(z=>{let P=$.node(z);Object.hasOwn(P,"rank")&&(P.rank-=M)})}function f($){let L=$.nodes().map(D=>$.node(D).rank),M=g(Math.min,L),z=[];$.nodes().forEach(D=>{let H=$.node(D).rank-M;z[H]||(z[H]=[]),z[H].push(D)});let P=0,q=$.graph().nodeRankFactor;Array.from(z).forEach((D,H)=>{D===void 0&&H%q!==0?--P:D!==void 0&&P&&D.forEach(B=>$.node(B).rank+=P)})}function d($,L,M,z){let P={width:0,height:0};return arguments.length>=4&&(P.rank=M,P.order=z),t($,"border",P,L)}function h($,L=m){const M=[];for(let z=0;z<$.length;z+=L){const P=$.slice(z,z+L);M.push(P)}return M}const m=65535;function g($,L){if(L.length>m){const M=h(L);return $.apply(null,M.map(z=>$.apply(null,z)))}else return $.apply(null,L)}function v($){const M=$.nodes().map(z=>{let P=$.node(z).rank;return P===void 0?Number.MIN_VALUE:P});return g(Math.max,M)}function w($,L){let M={lhs:[],rhs:[]};return $.forEach(z=>{L(z)?M.lhs.push(z):M.rhs.push(z)}),M}function b($,L){let M=Date.now();try{return L()}finally{console.log($+" time: "+(Date.now()-M)+"ms")}}function _($,L){return L()}let S=0;function x($){var L=++S;return toString($)+L}function A($,L,M=1){L==null&&(L=$,$=0);let z=q=>q<L;M<0&&(z=q=>L<q);const P=[];for(let q=$;z(q);q+=M)P.push(q);return P}function k($,L){const M={};for(const z of L)$[z]!==void 0&&(M[z]=$[z]);return M}function T($,L){let M=L;return typeof L=="string"&&(M=z=>z[L]),Object.entries($).reduce((z,[P,q])=>(z[P]=M(q,P),z),{})}function O($,L){return $.reduce((M,z,P)=>(M[z]=L[P],M),{})}return Q0}var J0,JN;function rie(){if(JN)return J0;JN=1;let e=nie(),t=Jt().uniqueId;J0={run:n,undo:i};function n(a){(a.graph().acyclicer==="greedy"?e(a,l(a)):r(a)).forEach(c=>{let f=a.edge(c);a.removeEdge(c),f.forwardName=c.name,f.reversed=!0,a.setEdge(c.w,c.v,f,t("rev"))});function l(c){return f=>c.edge(f).weight}}function r(a){let o=[],l={},c={};function f(d){Object.hasOwn(c,d)||(c[d]=!0,l[d]=!0,a.outEdges(d).forEach(h=>{Object.hasOwn(l,h.w)?o.push(h):f(h.w)}),delete l[d])}return a.nodes().forEach(f),o}function i(a){a.edges().forEach(o=>{let l=a.edge(o);if(l.reversed){a.removeEdge(o);let c=l.forwardName;delete l.reversed,delete l.forwardName,a.setEdge(o.w,o.v,l,c)}})}return J0}var eb,eR;function iie(){if(eR)return eb;eR=1;let e=Jt();eb={run:t,undo:r};function t(i){i.graph().dummyChains=[],i.edges().forEach(a=>n(i,a))}function n(i,a){let o=a.v,l=i.node(o).rank,c=a.w,f=i.node(c).rank,d=a.name,h=i.edge(a),m=h.labelRank;if(f===l+1)return;i.removeEdge(a);let g,v,w;for(w=0,++l;l<f;++w,++l)h.points=[],v={width:0,height:0,edgeLabel:h,edgeObj:a,rank:l},g=e.addDummyNode(i,"edge",v,"_d"),l===m&&(v.width=h.width,v.height=h.height,v.dummy="edge-label",v.labelpos=h.labelpos),i.setEdge(o,g,{weight:h.weight},d),w===0&&i.graph().dummyChains.push(g),o=g;i.setEdge(o,c,{weight:h.weight},d)}function r(i){i.graph().dummyChains.forEach(a=>{let o=i.node(a),l=o.edgeLabel,c;for(i.setEdge(o.edgeObj,l);o.dummy;)c=i.successors(a)[0],i.removeNode(a),l.points.push({x:o.x,y:o.y}),o.dummy==="edge-label"&&(l.x=o.x,l.y=o.y,l.width=o.width,l.height=o.height),a=c,o=i.node(a)})}return eb}var tb,tR;function sp(){if(tR)return tb;tR=1;const{applyWithChunking:e}=Jt();tb={longestPath:t,slack:n};function t(r){var i={};function a(o){var l=r.node(o);if(Object.hasOwn(i,o))return l.rank;i[o]=!0;let c=r.outEdges(o).map(d=>d==null?Number.POSITIVE_INFINITY:a(d.w)-r.edge(d).minlen);var f=e(Math.min,c);return f===Number.POSITIVE_INFINITY&&(f=0),l.rank=f}r.sources().forEach(a)}function n(r,i){return r.node(i.w).rank-r.node(i.v).rank-r.edge(i).minlen}return tb}var nb,nR;function MP(){if(nR)return nb;nR=1;var e=Ir().Graph,t=sp().slack;nb=n;function n(o){var l=new e({directed:!1}),c=o.nodes()[0],f=o.nodeCount();l.setNode(c,{});for(var d,h;r(l,o)<f;)d=i(l,o),h=l.hasNode(d.v)?t(o,d):-t(o,d),a(l,o,h);return l}function r(o,l){function c(f){l.nodeEdges(f).forEach(d=>{var h=d.v,m=f===h?d.w:h;!o.hasNode(m)&&!t(l,d)&&(o.setNode(m,{}),o.setEdge(f,m,{}),c(m))})}return o.nodes().forEach(c),o.nodeCount()}function i(o,l){return l.edges().reduce((f,d)=>{let h=Number.POSITIVE_INFINITY;return o.hasNode(d.v)!==o.hasNode(d.w)&&(h=t(l,d)),h<f[0]?[h,d]:f},[Number.POSITIVE_INFINITY,null])[1]}function a(o,l,c){o.nodes().forEach(f=>l.node(f).rank+=c)}return nb}var rb,rR;function aie(){if(rR)return rb;rR=1;var e=MP(),t=sp().slack,n=sp().longestPath,r=Ir().alg.preorder,i=Ir().alg.postorder,a=Jt().simplify;rb=o,o.initLowLimValues=d,o.initCutValues=l,o.calcCutValue=f,o.leaveEdge=m,o.enterEdge=g,o.exchangeEdges=v;function o(S){S=a(S),n(S);var x=e(S);d(x),l(x,S);for(var A,k;A=m(x);)k=g(x,S,A),v(x,S,A,k)}function l(S,x){var A=i(S,S.nodes());A=A.slice(0,A.length-1),A.forEach(k=>c(S,x,k))}function c(S,x,A){var k=S.node(A),T=k.parent;S.edge(A,T).cutvalue=f(S,x,A)}function f(S,x,A){var k=S.node(A),T=k.parent,O=!0,$=x.edge(A,T),L=0;return $||(O=!1,$=x.edge(T,A)),L=$.weight,x.nodeEdges(A).forEach(M=>{var z=M.v===A,P=z?M.w:M.v;if(P!==T){var q=z===O,D=x.edge(M).weight;if(L+=q?D:-D,b(S,A,P)){var H=S.edge(A,P).cutvalue;L+=q?-H:H}}}),L}function d(S,x){arguments.length<2&&(x=S.nodes()[0]),h(S,{},1,x)}function h(S,x,A,k,T){var O=A,$=S.node(k);return x[k]=!0,S.neighbors(k).forEach(L=>{Object.hasOwn(x,L)||(A=h(S,x,A,L,k))}),$.low=O,$.lim=A++,T?$.parent=T:delete $.parent,A}function m(S){return S.edges().find(x=>S.edge(x).cutvalue<0)}function g(S,x,A){var k=A.v,T=A.w;x.hasEdge(k,T)||(k=A.w,T=A.v);var O=S.node(k),$=S.node(T),L=O,M=!1;O.lim>$.lim&&(L=$,M=!0);var z=x.edges().filter(P=>M===_(S,S.node(P.v),L)&&M!==_(S,S.node(P.w),L));return z.reduce((P,q)=>t(x,q)<t(x,P)?q:P)}function v(S,x,A,k){var T=A.v,O=A.w;S.removeEdge(T,O),S.setEdge(k.v,k.w,{}),d(S),l(S,x),w(S,x)}function w(S,x){var A=S.nodes().find(T=>!x.node(T).parent),k=r(S,A);k=k.slice(1),k.forEach(T=>{var O=S.node(T).parent,$=x.edge(T,O),L=!1;$||($=x.edge(O,T),L=!0),x.node(T).rank=x.node(O).rank+(L?$.minlen:-$.minlen)})}function b(S,x,A){return S.hasEdge(x,A)}function _(S,x,A){return A.low<=x.lim&&x.lim<=A.lim}return rb}var ib,iR;function sie(){if(iR)return ib;iR=1;var e=sp(),t=e.longestPath,n=MP(),r=aie();ib=i;function i(c){switch(c.graph().ranker){case"network-simplex":l(c);break;case"tight-tree":o(c);break;case"longest-path":a(c);break;default:l(c)}}var a=t;function o(c){t(c),n(c)}function l(c){r(c)}return ib}var ab,aR;function oie(){if(aR)return ab;aR=1,ab=e;function e(r){let i=n(r);r.graph().dummyChains.forEach(a=>{let o=r.node(a),l=o.edgeObj,c=t(r,i,l.v,l.w),f=c.path,d=c.lca,h=0,m=f[h],g=!0;for(;a!==l.w;){if(o=r.node(a),g){for(;(m=f[h])!==d&&r.node(m).maxRank<o.rank;)h++;m===d&&(g=!1)}if(!g){for(;h<f.length-1&&r.node(m=f[h+1]).minRank<=o.rank;)h++;m=f[h]}r.setParent(a,m),a=r.successors(a)[0]}})}function t(r,i,a,o){let l=[],c=[],f=Math.min(i[a].low,i[o].low),d=Math.max(i[a].lim,i[o].lim),h,m;h=a;do h=r.parent(h),l.push(h);while(h&&(i[h].low>f||d>i[h].lim));for(m=h,h=o;(h=r.parent(h))!==m;)c.push(h);return{path:l.concat(c.reverse()),lca:m}}function n(r){let i={},a=0;function o(l){let c=a;r.children(l).forEach(o),i[l]={low:c,lim:a++}}return r.children().forEach(o),i}return ab}var sb,sR;function lie(){if(sR)return sb;sR=1;let e=Jt();sb={run:t,cleanup:a};function t(o){let l=e.addDummyNode(o,"root",{},"_root"),c=r(o),f=Object.values(c),d=e.applyWithChunking(Math.max,f)-1,h=2*d+1;o.graph().nestingRoot=l,o.edges().forEach(g=>o.edge(g).minlen*=h);let m=i(o)+1;o.children().forEach(g=>n(o,l,h,m,d,c,g)),o.graph().nodeRankFactor=h}function n(o,l,c,f,d,h,m){let g=o.children(m);if(!g.length){m!==l&&o.setEdge(l,m,{weight:0,minlen:c});return}let v=e.addBorderNode(o,"_bt"),w=e.addBorderNode(o,"_bb"),b=o.node(m);o.setParent(v,m),b.borderTop=v,o.setParent(w,m),b.borderBottom=w,g.forEach(_=>{n(o,l,c,f,d,h,_);let S=o.node(_),x=S.borderTop?S.borderTop:_,A=S.borderBottom?S.borderBottom:_,k=S.borderTop?f:2*f,T=x!==A?1:d-h[m]+1;o.setEdge(v,x,{weight:k,minlen:T,nestingEdge:!0}),o.setEdge(A,w,{weight:k,minlen:T,nestingEdge:!0})}),o.parent(m)||o.setEdge(l,v,{weight:0,minlen:d+h[m]})}function r(o){var l={};function c(f,d){var h=o.children(f);h&&h.length&&h.forEach(m=>c(m,d+1)),l[f]=d}return o.children().forEach(f=>c(f,1)),l}function i(o){return o.edges().reduce((l,c)=>l+o.edge(c).weight,0)}function a(o){var l=o.graph();o.removeNode(l.nestingRoot),delete l.nestingRoot,o.edges().forEach(c=>{var f=o.edge(c);f.nestingEdge&&o.removeEdge(c)})}return sb}var ob,oR;function uie(){if(oR)return ob;oR=1;let e=Jt();ob=t;function t(r){function i(a){let o=r.children(a),l=r.node(a);if(o.length&&o.forEach(i),Object.hasOwn(l,"minRank")){l.borderLeft=[],l.borderRight=[];for(let c=l.minRank,f=l.maxRank+1;c<f;++c)n(r,"borderLeft","_bl",a,l,c),n(r,"borderRight","_br",a,l,c)}}r.children().forEach(i)}function n(r,i,a,o,l,c){let f={width:0,height:0,rank:c,borderType:i},d=l[i][c-1],h=e.addDummyNode(r,"border",f,a);l[i][c]=h,r.setParent(h,o),d&&r.setEdge(d,h,{weight:1})}return ob}var lb,lR;function cie(){if(lR)return lb;lR=1,lb={adjust:e,undo:t};function e(c){let f=c.graph().rankdir.toLowerCase();(f==="lr"||f==="rl")&&n(c)}function t(c){let f=c.graph().rankdir.toLowerCase();(f==="bt"||f==="rl")&&i(c),(f==="lr"||f==="rl")&&(o(c),n(c))}function n(c){c.nodes().forEach(f=>r(c.node(f))),c.edges().forEach(f=>r(c.edge(f)))}function r(c){let f=c.width;c.width=c.height,c.height=f}function i(c){c.nodes().forEach(f=>a(c.node(f))),c.edges().forEach(f=>{let d=c.edge(f);d.points.forEach(a),Object.hasOwn(d,"y")&&a(d)})}function a(c){c.y=-c.y}function o(c){c.nodes().forEach(f=>l(c.node(f))),c.edges().forEach(f=>{let d=c.edge(f);d.points.forEach(l),Object.hasOwn(d,"x")&&l(d)})}function l(c){let f=c.x;c.x=c.y,c.y=f}return lb}var ub,uR;function fie(){if(uR)return ub;uR=1;let e=Jt();ub=t;function t(n){let r={},i=n.nodes().filter(d=>!n.children(d).length),a=i.map(d=>n.node(d).rank),o=e.applyWithChunking(Math.max,a),l=e.range(o+1).map(()=>[]);function c(d){if(r[d])return;r[d]=!0;let h=n.node(d);l[h.rank].push(d),n.successors(d).forEach(c)}return i.sort((d,h)=>n.node(d).rank-n.node(h).rank).forEach(c),l}return ub}var cb,cR;function die(){if(cR)return cb;cR=1;let e=Jt().zipObject;cb=t;function t(r,i){let a=0;for(let o=1;o<i.length;++o)a+=n(r,i[o-1],i[o]);return a}function n(r,i,a){let o=e(a,a.map((m,g)=>g)),l=i.flatMap(m=>r.outEdges(m).map(g=>({pos:o[g.w],weight:r.edge(g).weight})).sort((g,v)=>g.pos-v.pos)),c=1;for(;c<a.length;)c<<=1;let f=2*c-1;c-=1;let d=new Array(f).fill(0),h=0;return l.forEach(m=>{let g=m.pos+c;d[g]+=m.weight;let v=0;for(;g>0;)g%2&&(v+=d[g+1]),g=g-1>>1,d[g]+=m.weight;h+=m.weight*v}),h}return cb}var fb,fR;function hie(){if(fR)return fb;fR=1,fb=e;function e(t,n=[]){return n.map(r=>{let i=t.inEdges(r);if(i.length){let a=i.reduce((o,l)=>{let c=t.edge(l),f=t.node(l.v);return{sum:o.sum+c.weight*f.order,weight:o.weight+c.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}return fb}var db,dR;function pie(){if(dR)return db;dR=1;let e=Jt();db=t;function t(i,a){let o={};i.forEach((c,f)=>{let d=o[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:f};c.barycenter!==void 0&&(d.barycenter=c.barycenter,d.weight=c.weight)}),a.edges().forEach(c=>{let f=o[c.v],d=o[c.w];f!==void 0&&d!==void 0&&(d.indegree++,f.out.push(o[c.w]))});let l=Object.values(o).filter(c=>!c.indegree);return n(l)}function n(i){let a=[];function o(c){return f=>{f.merged||(f.barycenter===void 0||c.barycenter===void 0||f.barycenter>=c.barycenter)&&r(c,f)}}function l(c){return f=>{f.in.push(c),--f.indegree===0&&i.push(f)}}for(;i.length;){let c=i.pop();a.push(c),c.in.reverse().forEach(o(c)),c.out.forEach(l(c))}return a.filter(c=>!c.merged).map(c=>e.pick(c,["vs","i","barycenter","weight"]))}function r(i,a){let o=0,l=0;i.weight&&(o+=i.barycenter*i.weight,l+=i.weight),a.weight&&(o+=a.barycenter*a.weight,l+=a.weight),i.vs=a.vs.concat(i.vs),i.barycenter=o/l,i.weight=l,i.i=Math.min(a.i,i.i),a.merged=!0}return db}var hb,hR;function mie(){if(hR)return hb;hR=1;let e=Jt();hb=t;function t(i,a){let o=e.partition(i,v=>Object.hasOwn(v,"barycenter")),l=o.lhs,c=o.rhs.sort((v,w)=>w.i-v.i),f=[],d=0,h=0,m=0;l.sort(r(!!a)),m=n(f,c,m),l.forEach(v=>{m+=v.vs.length,f.push(v.vs),d+=v.barycenter*v.weight,h+=v.weight,m=n(f,c,m)});let g={vs:f.flat(!0)};return h&&(g.barycenter=d/h,g.weight=h),g}function n(i,a,o){let l;for(;a.length&&(l=a[a.length-1]).i<=o;)a.pop(),i.push(l.vs),o++;return o}function r(i){return(a,o)=>a.barycenter<o.barycenter?-1:a.barycenter>o.barycenter?1:i?o.i-a.i:a.i-o.i}return hb}var pb,pR;function gie(){if(pR)return pb;pR=1;let e=hie(),t=pie(),n=mie();pb=r;function r(o,l,c,f){let d=o.children(l),h=o.node(l),m=h?h.borderLeft:void 0,g=h?h.borderRight:void 0,v={};m&&(d=d.filter(S=>S!==m&&S!==g));let w=e(o,d);w.forEach(S=>{if(o.children(S.v).length){let x=r(o,S.v,c,f);v[S.v]=x,Object.hasOwn(x,"barycenter")&&a(S,x)}});let b=t(w,c);i(b,v);let _=n(b,f);if(m&&(_.vs=[m,_.vs,g].flat(!0),o.predecessors(m).length)){let S=o.node(o.predecessors(m)[0]),x=o.node(o.predecessors(g)[0]);Object.hasOwn(_,"barycenter")||(_.barycenter=0,_.weight=0),_.barycenter=(_.barycenter*_.weight+S.order+x.order)/(_.weight+2),_.weight+=2}return _}function i(o,l){o.forEach(c=>{c.vs=c.vs.flatMap(f=>l[f]?l[f].vs:f)})}function a(o,l){o.barycenter!==void 0?(o.barycenter=(o.barycenter*o.weight+l.barycenter*l.weight)/(o.weight+l.weight),o.weight+=l.weight):(o.barycenter=l.barycenter,o.weight=l.weight)}return pb}var mb,mR;function yie(){if(mR)return mb;mR=1;let e=Ir().Graph,t=Jt();mb=n;function n(i,a,o){let l=r(i),c=new e({compound:!0}).setGraph({root:l}).setDefaultNodeLabel(f=>i.node(f));return i.nodes().forEach(f=>{let d=i.node(f),h=i.parent(f);(d.rank===a||d.minRank<=a&&a<=d.maxRank)&&(c.setNode(f),c.setParent(f,h||l),i[o](f).forEach(m=>{let g=m.v===f?m.w:m.v,v=c.edge(g,f),w=v!==void 0?v.weight:0;c.setEdge(g,f,{weight:i.edge(m).weight+w})}),Object.hasOwn(d,"minRank")&&c.setNode(f,{borderLeft:d.borderLeft[a],borderRight:d.borderRight[a]}))}),c}function r(i){for(var a;i.hasNode(a=t.uniqueId("_root")););return a}return mb}var gb,gR;function bie(){if(gR)return gb;gR=1,gb=e;function e(t,n,r){let i={},a;r.forEach(o=>{let l=t.parent(o),c,f;for(;l;){if(c=t.parent(l),c?(f=i[c],i[c]=l):(f=a,a=l),f&&f!==l){n.setEdge(f,l);return}l=c}})}return gb}var yb,yR;function vie(){if(yR)return yb;yR=1;let e=fie(),t=die(),n=gie(),r=yie(),i=bie(),a=Ir().Graph,o=Jt();yb=l;function l(h,m){if(m&&typeof m.customOrder=="function"){m.customOrder(h,l);return}let g=o.maxRank(h),v=c(h,o.range(1,g+1),"inEdges"),w=c(h,o.range(g-1,-1,-1),"outEdges"),b=e(h);if(d(h,b),m&&m.disableOptimalOrderHeuristic)return;let _=Number.POSITIVE_INFINITY,S;for(let x=0,A=0;A<4;++x,++A){f(x%2?v:w,x%4>=2),b=o.buildLayerMatrix(h);let k=t(h,b);k<_&&(A=0,S=Object.assign({},b),_=k)}d(h,S)}function c(h,m,g){return m.map(function(v){return r(h,v,g)})}function f(h,m){let g=new a;h.forEach(function(v){let w=v.graph().root,b=n(v,w,g,m);b.vs.forEach((_,S)=>v.node(_).order=S),i(v,g,b.vs)})}function d(h,m){Object.values(m).forEach(g=>g.forEach((v,w)=>h.node(v).order=w))}return yb}var bb,bR;function _ie(){if(bR)return bb;bR=1;let e=Ir().Graph,t=Jt();bb={positionX:g,findType1Conflicts:n,findType2Conflicts:r,addConflict:a,hasConflict:o,verticalAlignment:l,horizontalCompaction:c,alignCoordinates:h,findSmallestWidthAlignment:d,balance:m};function n(b,_){let S={};function x(A,k){let T=0,O=0,$=A.length,L=k[k.length-1];return k.forEach((M,z)=>{let P=i(b,M),q=P?b.node(P).order:$;(P||M===L)&&(k.slice(O,z+1).forEach(D=>{b.predecessors(D).forEach(H=>{let B=b.node(H),G=B.order;(G<T||q<G)&&!(B.dummy&&b.node(D).dummy)&&a(S,H,D)})}),O=z+1,T=q)}),k}return _.length&&_.reduce(x),S}function r(b,_){let S={};function x(k,T,O,$,L){let M;t.range(T,O).forEach(z=>{M=k[z],b.node(M).dummy&&b.predecessors(M).forEach(P=>{let q=b.node(P);q.dummy&&(q.order<$||q.order>L)&&a(S,P,M)})})}function A(k,T){let O=-1,$,L=0;return T.forEach((M,z)=>{if(b.node(M).dummy==="border"){let P=b.predecessors(M);P.length&&($=b.node(P[0]).order,x(T,L,z,O,$),L=z,O=$)}x(T,L,T.length,$,k.length)}),T}return _.length&&_.reduce(A),S}function i(b,_){if(b.node(_).dummy)return b.predecessors(_).find(S=>b.node(S).dummy)}function a(b,_,S){if(_>S){let A=_;_=S,S=A}let x=b[_];x||(b[_]=x={}),x[S]=!0}function o(b,_,S){if(_>S){let x=_;_=S,S=x}return!!b[_]&&Object.hasOwn(b[_],S)}function l(b,_,S,x){let A={},k={},T={};return _.forEach(O=>{O.forEach(($,L)=>{A[$]=$,k[$]=$,T[$]=L})}),_.forEach(O=>{let $=-1;O.forEach(L=>{let M=x(L);if(M.length){M=M.sort((P,q)=>T[P]-T[q]);let z=(M.length-1)/2;for(let P=Math.floor(z),q=Math.ceil(z);P<=q;++P){let D=M[P];k[L]===L&&$<T[D]&&!o(S,L,D)&&(k[D]=L,k[L]=A[L]=A[D],$=T[D])}}})}),{root:A,align:k}}function c(b,_,S,x,A){let k={},T=f(b,_,S,A),O=A?"borderLeft":"borderRight";function $(z,P){let q=T.nodes(),D=q.pop(),H={};for(;D;)H[D]?z(D):(H[D]=!0,q.push(D),q=q.concat(P(D))),D=q.pop()}function L(z){k[z]=T.inEdges(z).reduce((P,q)=>Math.max(P,k[q.v]+T.edge(q)),0)}function M(z){let P=T.outEdges(z).reduce((D,H)=>Math.min(D,k[H.w]-T.edge(H)),Number.POSITIVE_INFINITY),q=b.node(z);P!==Number.POSITIVE_INFINITY&&q.borderType!==O&&(k[z]=Math.max(k[z],P))}return $(L,T.predecessors.bind(T)),$(M,T.successors.bind(T)),Object.keys(x).forEach(z=>k[z]=k[S[z]]),k}function f(b,_,S,x){let A=new e,k=b.graph(),T=v(k.nodesep,k.edgesep,x);return _.forEach(O=>{let $;O.forEach(L=>{let M=S[L];if(A.setNode(M),$){var z=S[$],P=A.edge(z,M);A.setEdge(z,M,Math.max(T(b,L,$),P||0))}$=L})}),A}function d(b,_){return Object.values(_).reduce((S,x)=>{let A=Number.NEGATIVE_INFINITY,k=Number.POSITIVE_INFINITY;Object.entries(x).forEach(([O,$])=>{let L=w(b,O)/2;A=Math.max($+L,A),k=Math.min($-L,k)});const T=A-k;return T<S[0]&&(S=[T,x]),S},[Number.POSITIVE_INFINITY,null])[1]}function h(b,_){let S=Object.values(_),x=t.applyWithChunking(Math.min,S),A=t.applyWithChunking(Math.max,S);["u","d"].forEach(k=>{["l","r"].forEach(T=>{let O=k+T,$=b[O];if($===_)return;let L=Object.values($),M=x-t.applyWithChunking(Math.min,L);T!=="l"&&(M=A-t.applyWithChunking(Math.max,L)),M&&(b[O]=t.mapValues($,z=>z+M))})})}function m(b,_){return t.mapValues(b.ul,(S,x)=>{if(_)return b[_.toLowerCase()][x];{let A=Object.values(b).map(k=>k[x]).sort((k,T)=>k-T);return(A[1]+A[2])/2}})}function g(b){let _=t.buildLayerMatrix(b),S=Object.assign(n(b,_),r(b,_)),x={},A;["u","d"].forEach(T=>{A=T==="u"?_:Object.values(_).reverse(),["l","r"].forEach(O=>{O==="r"&&(A=A.map(z=>Object.values(z).reverse()));let $=(T==="u"?b.predecessors:b.successors).bind(b),L=l(b,A,S,$),M=c(b,A,L.root,L.align,O==="r");O==="r"&&(M=t.mapValues(M,z=>-z)),x[T+O]=M})});let k=d(b,x);return h(x,k),m(x,b.graph().align)}function v(b,_,S){return(x,A,k)=>{let T=x.node(A),O=x.node(k),$=0,L;if($+=T.width/2,Object.hasOwn(T,"labelpos"))switch(T.labelpos.toLowerCase()){case"l":L=-T.width/2;break;case"r":L=T.width/2;break}if(L&&($+=S?L:-L),L=0,$+=(T.dummy?_:b)/2,$+=(O.dummy?_:b)/2,$+=O.width/2,Object.hasOwn(O,"labelpos"))switch(O.labelpos.toLowerCase()){case"l":L=O.width/2;break;case"r":L=-O.width/2;break}return L&&($+=S?L:-L),L=0,$}}function w(b,_){return b.node(_).width}return bb}var vb,vR;function xie(){if(vR)return vb;vR=1;let e=Jt(),t=_ie().positionX;vb=n;function n(i){i=e.asNonCompoundGraph(i),r(i),Object.entries(t(i)).forEach(([a,o])=>i.node(a).x=o)}function r(i){let a=e.buildLayerMatrix(i),o=i.graph().ranksep,l=0;a.forEach(c=>{const f=c.reduce((d,h)=>{const m=i.node(h).height;return d>m?d:m},0);c.forEach(d=>i.node(d).y=l+f/2),l+=f+o})}return vb}var _b,_R;function wie(){if(_R)return _b;_R=1;let e=rie(),t=iie(),n=sie(),r=Jt().normalizeRanks,i=oie(),a=Jt().removeEmptyRanks,o=lie(),l=uie(),c=cie(),f=vie(),d=xie(),h=Jt(),m=Ir().Graph;_b=g;function g(j,I){let U=I&&I.debugTiming?h.time:h.notime;U("layout",()=>{let Y=U(" buildLayoutGraph",()=>$(j));U(" runLayout",()=>v(Y,U,I)),U(" updateInputGraph",()=>w(j,Y))})}function v(j,I,U){I(" makeSpaceForEdgeLabels",()=>L(j)),I(" removeSelfEdges",()=>K(j)),I(" acyclic",()=>e.run(j)),I(" nestingGraph.run",()=>o.run(j)),I(" rank",()=>n(h.asNonCompoundGraph(j))),I(" injectEdgeLabelProxies",()=>M(j)),I(" removeEmptyRanks",()=>a(j)),I(" nestingGraph.cleanup",()=>o.cleanup(j)),I(" normalizeRanks",()=>r(j)),I(" assignRankMinMax",()=>z(j)),I(" removeEdgeLabelProxies",()=>P(j)),I(" normalize.run",()=>t.run(j)),I(" parentDummyChains",()=>i(j)),I(" addBorderSegments",()=>l(j)),I(" order",()=>f(j,U)),I(" insertSelfEdges",()=>Q(j)),I(" adjustCoordinateSystem",()=>c.adjust(j)),I(" position",()=>d(j)),I(" positionSelfEdges",()=>R(j)),I(" removeBorderNodes",()=>G(j)),I(" normalize.undo",()=>t.undo(j)),I(" fixupEdgeLabelCoords",()=>H(j)),I(" undoCoordinateSystem",()=>c.undo(j)),I(" translateGraph",()=>q(j)),I(" assignNodeIntersects",()=>D(j)),I(" reversePoints",()=>B(j)),I(" acyclic.undo",()=>e.undo(j))}function w(j,I){j.nodes().forEach(U=>{let Y=j.node(U),ne=I.node(U);Y&&(Y.x=ne.x,Y.y=ne.y,Y.rank=ne.rank,I.children(U).length&&(Y.width=ne.width,Y.height=ne.height))}),j.edges().forEach(U=>{let Y=j.edge(U),ne=I.edge(U);Y.points=ne.points,Object.hasOwn(ne,"x")&&(Y.x=ne.x,Y.y=ne.y)}),j.graph().width=I.graph().width,j.graph().height=I.graph().height}let b=["nodesep","edgesep","ranksep","marginx","marginy"],_={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},S=["acyclicer","ranker","rankdir","align"],x=["width","height"],A={width:0,height:0},k=["minlen","weight","width","height","labeloffset"],T={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},O=["labelpos"];function $(j){let I=new m({multigraph:!0,compound:!0}),U=X(j.graph());return I.setGraph(Object.assign({},_,V(U,b),h.pick(U,S))),j.nodes().forEach(Y=>{let ne=X(j.node(Y));const ae=V(ne,x);Object.keys(A).forEach(re=>{ae[re]===void 0&&(ae[re]=A[re])}),I.setNode(Y,ae),I.setParent(Y,j.parent(Y))}),j.edges().forEach(Y=>{let ne=X(j.edge(Y));I.setEdge(Y,Object.assign({},T,V(ne,k),h.pick(ne,O)))}),I}function L(j){let I=j.graph();I.ranksep/=2,j.edges().forEach(U=>{let Y=j.edge(U);Y.minlen*=2,Y.labelpos.toLowerCase()!=="c"&&(I.rankdir==="TB"||I.rankdir==="BT"?Y.width+=Y.labeloffset:Y.height+=Y.labeloffset)})}function M(j){j.edges().forEach(I=>{let U=j.edge(I);if(U.width&&U.height){let Y=j.node(I.v),ae={rank:(j.node(I.w).rank-Y.rank)/2+Y.rank,e:I};h.addDummyNode(j,"edge-proxy",ae,"_ep")}})}function z(j){let I=0;j.nodes().forEach(U=>{let Y=j.node(U);Y.borderTop&&(Y.minRank=j.node(Y.borderTop).rank,Y.maxRank=j.node(Y.borderBottom).rank,I=Math.max(I,Y.maxRank))}),j.graph().maxRank=I}function P(j){j.nodes().forEach(I=>{let U=j.node(I);U.dummy==="edge-proxy"&&(j.edge(U.e).labelRank=U.rank,j.removeNode(I))})}function q(j){let I=Number.POSITIVE_INFINITY,U=0,Y=Number.POSITIVE_INFINITY,ne=0,ae=j.graph(),re=ae.marginx||0,le=ae.marginy||0;function W(J){let se=J.x,fe=J.y,me=J.width,xe=J.height;I=Math.min(I,se-me/2),U=Math.max(U,se+me/2),Y=Math.min(Y,fe-xe/2),ne=Math.max(ne,fe+xe/2)}j.nodes().forEach(J=>W(j.node(J))),j.edges().forEach(J=>{let se=j.edge(J);Object.hasOwn(se,"x")&&W(se)}),I-=re,Y-=le,j.nodes().forEach(J=>{let se=j.node(J);se.x-=I,se.y-=Y}),j.edges().forEach(J=>{let se=j.edge(J);se.points.forEach(fe=>{fe.x-=I,fe.y-=Y}),Object.hasOwn(se,"x")&&(se.x-=I),Object.hasOwn(se,"y")&&(se.y-=Y)}),ae.width=U-I+re,ae.height=ne-Y+le}function D(j){j.edges().forEach(I=>{let U=j.edge(I),Y=j.node(I.v),ne=j.node(I.w),ae,re;U.points?(ae=U.points[0],re=U.points[U.points.length-1]):(U.points=[],ae=ne,re=Y),U.points.unshift(h.intersectRect(Y,ae)),U.points.push(h.intersectRect(ne,re))})}function H(j){j.edges().forEach(I=>{let U=j.edge(I);if(Object.hasOwn(U,"x"))switch((U.labelpos==="l"||U.labelpos==="r")&&(U.width-=U.labeloffset),U.labelpos){case"l":U.x-=U.width/2+U.labeloffset;break;case"r":U.x+=U.width/2+U.labeloffset;break}})}function B(j){j.edges().forEach(I=>{let U=j.edge(I);U.reversed&&U.points.reverse()})}function G(j){j.nodes().forEach(I=>{if(j.children(I).length){let U=j.node(I),Y=j.node(U.borderTop),ne=j.node(U.borderBottom),ae=j.node(U.borderLeft[U.borderLeft.length-1]),re=j.node(U.borderRight[U.borderRight.length-1]);U.width=Math.abs(re.x-ae.x),U.height=Math.abs(ne.y-Y.y),U.x=ae.x+U.width/2,U.y=Y.y+U.height/2}}),j.nodes().forEach(I=>{j.node(I).dummy==="border"&&j.removeNode(I)})}function K(j){j.edges().forEach(I=>{if(I.v===I.w){var U=j.node(I.v);U.selfEdges||(U.selfEdges=[]),U.selfEdges.push({e:I,label:j.edge(I)}),j.removeEdge(I)}})}function Q(j){var I=h.buildLayerMatrix(j);I.forEach(U=>{var Y=0;U.forEach((ne,ae)=>{var re=j.node(ne);re.order=ae+Y,(re.selfEdges||[]).forEach(le=>{h.addDummyNode(j,"selfedge",{width:le.label.width,height:le.label.height,rank:re.rank,order:ae+ ++Y,e:le.e,label:le.label},"_se")}),delete re.selfEdges})})}function R(j){j.nodes().forEach(I=>{var U=j.node(I);if(U.dummy==="selfedge"){var Y=j.node(U.e.v),ne=Y.x+Y.width/2,ae=Y.y,re=U.x-ne,le=Y.height/2;j.setEdge(U.e,U.label),j.removeNode(I),U.label.points=[{x:ne+2*re/3,y:ae-le},{x:ne+5*re/6,y:ae-le},{x:ne+re,y:ae},{x:ne+5*re/6,y:ae+le},{x:ne+2*re/3,y:ae+le}],U.label.x=U.x,U.label.y=U.y}})}function V(j,I){return h.mapValues(h.pick(j,I),Number)}function X(j){var I={};return j&&Object.entries(j).forEach(([U,Y])=>{typeof U=="string"&&(U=U.toLowerCase()),I[U]=Y}),I}return _b}var xb,xR;function Sie(){if(xR)return xb;xR=1;let e=Jt(),t=Ir().Graph;xb={debugOrdering:n};function n(r){let i=e.buildLayerMatrix(r),a=new t({compound:!0,multigraph:!0}).setGraph({});return r.nodes().forEach(o=>{a.setNode(o,{label:o}),a.setParent(o,"layer"+r.node(o).rank)}),r.edges().forEach(o=>a.setEdge(o.v,o.w,{},o.name)),i.forEach((o,l)=>{let c="layer"+l;a.setNode(c,{rank:"same"}),o.reduce((f,d)=>(a.setEdge(f,d,{style:"invis"}),d))}),a}return xb}var wb,wR;function Eie(){return wR||(wR=1,wb="1.1.4"),wb}var Sb,SR;function kie(){return SR||(SR=1,Sb={graphlib:Ir(),layout:wie(),debug:Sie(),util:{time:Jt().time,notime:Jt().notime},version:Eie()}),Sb}var Aie=kie();const ER=zn(Aie);function Tie(e){const t=new Map,n=[],r=a=>{const o=a.id.split(":"),l=o.slice(0,-1).join(":");if(o.length!==1){if(!t.has(l)){const c={id:l,type:"group",data:{label:l.split(":").pop(),name:l.split(":").pop()},position:{x:0,y:0},style:{},parentId:void 0},f=r(c);f&&(c.parentId=f.id),t.set(l,c)}return t.get(l)}};return e.forEach(a=>{const o={...a,id:a.id.toString(),position:{x:0,y:0},data:{label:a.id.split(":").pop(),name:a.id.split(":").pop()}},l=r(o);l&&(o.parentId=l.id.toString()),n.push(o)}),[...Array.from(t.values()),...n]}const Cie={group:({data:e})=>N.jsx("div",{className:"absolute bottom-full left-0",children:N.jsx("span",{children:e.name})})},Oie=(e,t)=>{const n=e.map(r=>{const i=t.find(c=>c.id===r.source.toString()),a=t.find(c=>c.id===r.target.toString()),o=i==null?void 0:i.id,l=a==null?void 0:a.id;return{id:`${o}=${l}`,source:o,target:l,animated:r.conditional,label:r.data,style:{stroke:r.conditional?"#2563eb":"#64748b"}}});if(!n.find(r=>r.target==="__end__")){const r=[...t].reverse().find(i=>i.id.endsWith(":__end__"));r&&n.push({id:`${r.id}=__end__`,source:r.id,target:"__end__",type:"smoothstep"})}return n},Nie=()=>{const{fitView:e}=Ip(),{graphVisualize:t,currentNodeName:n}=Ts(),r=t||{nodes:[],edges:[]},i=Tie(r.nodes.map(g=>({...g,type:"default"}))),a=Oie(r.edges,i),[o,l,c]=gre(i),[f,d,h]=yre(a),m=te.useCallback(g=>{const v=kR(o,f,{direction:g});l([...v.nodes]),d([...v.edges]),e()},[o,f]);return te.useEffect(()=>{if(r.nodes.length>0){const g=kR(i,a,{direction:"TB"});l([...g.nodes]),d([...g.edges]),e()}},[r]),te.useEffect(()=>{const g=o.findIndex(v=>v.id.endsWith(n));if(g!==-1){const v=[...o].map(w=>({...w,selected:!1}));v[g]={...v[g],selected:!0},l(v),e()}},[n]),N.jsx("div",{className:"h-full relative overflow-hidden border-l",children:N.jsxs(mre,{nodes:o,edges:f,onNodesChange:c,onEdgesChange:h,fitView:!0,className:"w-full h-full",nodeTypes:Cie,children:[N.jsx(wre,{}),N.jsx(Ore,{}),N.jsxs(jc,{position:"top-right",className:"flex gap-2",children:[N.jsx("button",{onClick:()=>m("TB"),className:"px-3 py-1.5 bg-white border border-gray-200 rounded-lg text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:"垂直布局"}),N.jsx("button",{onClick:()=>m("LR"),className:"px-3 py-1.5 bg-white border border-gray-200 rounded-lg text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:"水平布局"})]})]})})},kR=(e,t,n)=>{const r=new ER.graphlib.Graph({compound:!0,multigraph:!0}).setDefaultEdgeLabel(()=>({}));r.setGraph({rankdir:n.direction,nodesep:40,ranksep:40,edgesep:20}),e.forEach(l=>{l.type!=="group"&&r.setNode(l.id,{...l,width:128,height:20})}),t.forEach(l=>r.setEdge(l.source,l.target)),ER.layout(r);const i=e.map(l=>{const c=r.node(l.id);if(!c)return{...l};let f=0,d=0;return f=c.x+((c==null?void 0:c.width)??0),d=c.y+((c==null?void 0:c.height)??0),{...l,position:{x:f,y:d},_p:c,width:c.width,height:c.height}}),a=new Map,o=15;return[...i].reverse().forEach(l=>{if(l.type==="group"){const c=a.get(l.id)||[],f=Math.min(...c.map(g=>g.position.x)),d=Math.min(...c.map(g=>g.position.y)),h=Math.max(...c.map(g=>g.position.x+(g.width??0))),m=Math.max(...c.map(g=>g.position.y+(g.height??0)));l.position.x=f-o,l.position.y=d-o,l.width=h-f+o*2,l.height=m-d+o*2,c.forEach(g=>{g.position.x=g.position.x-l.position.x,g.position.y=g.position.y-l.position.y})}l.parentId&&a.set(l.parentId,[...a.get(l.parentId)??[],l])}),{nodes:i,edges:t}};function Rie(){return N.jsx(EP,{children:N.jsx(Nie,{})})}const jie=()=>N.jsx(Rie,{});/**
|
|
229
|
+
`)),d=f.reduce((h,m)=>h.concat(...m),[]);return[f,d]}return[[],[]]},[e]);return te.useEffect(()=>{const c=(t==null?void 0:t.target)??hN,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=g=>{var b,_;if(i.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!i.current||i.current&&!f)&&N9(g))return!1;const w=mN(g.code,l);if(a.current.add(g[w]),pN(o,a.current,!1)){const S=((_=(b=g.composedPath)==null?void 0:b.call(g))==null?void 0:_[0])||g.target,x=(S==null?void 0:S.nodeName)==="BUTTON"||(S==null?void 0:S.nodeName)==="A";t.preventDefault!==!1&&(i.current||!x)&&g.preventDefault(),r(!0)}},h=g=>{const v=mN(g.code,l);pN(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(g[v]),g.key==="Meta"&&a.current.clear(),i.current=!1},m=()=>{a.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",h),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",h),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,r]),n}function pN(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function mN(e,t){return t.includes(e)?"code":"key"}const Wte=()=>{const e=Lt();return te.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{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},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>{const{width:i,height:a,maxZoom:o,panZoom:l}=e.getState(),c=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:o,f=i/2-t*c,d=a/2-n*c;return l?(await l.setViewport({x:f,y:d,zoom:c},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:a,maxZoom:o,panZoom:l}=e.getState(),c=OS(t,r,i,a,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),f={x:t.x-l,y:t.y-c},d=n.snapGrid??i,h=n.snapToGrid??a;return Rc(f,r,h,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),o=np(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function W9(e,t){const n=[],r=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const o=r.get(a.id);o?o.push(a):r.set(a.id,[a])}for(const a of t){const o=r.get(a.id);if(!o){n.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...a};for(const c of o)Qte(c,l);n.push(l)}return i.length&&i.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function Qte(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,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);break}}}function Q9(e,t){return W9(e,t)}function J9(e,t){return W9(e,t)}function ls(e,t){return{id:e,type:"select",selected:t}}function Do(e,t=new Set,n=!1){const r=[];for(const[i,a]of e){const o=t.has(i);!(a.selected===void 0&&!o)&&a.selected!==o&&(n&&(a.selected=o),r.push(ls(a.id,o)))}return r}function gN({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const l=t.get(o.id),c=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function yN(e){return{id:e.id,type:"remove"}}const bN=e=>kee(e),Jte=e=>x9(e);function eP(e){return te.forwardRef(e)}const ene=typeof window<"u"?te.useLayoutEffect:te.useEffect;function vN(e){const[t,n]=te.useState(BigInt(0)),[r]=te.useState(()=>tne(()=>n(i=>i+BigInt(1))));return ene(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function tne(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const tP=te.createContext(null);function nne({children:e}){const t=Lt(),n=te.useCallback(l=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:d,onNodesChange:h,nodeLookup:m,fitViewQueued:g}=t.getState();let v=c;for(const b of l)v=typeof b=="function"?b(v):b;const w=gN({items:v,lookup:m});d&&f(v),w.length>0?h==null||h(w):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:_,setNodes:S}=t.getState();b&&S(_)})},[]),r=vN(n),i=te.useCallback(l=>{const{edges:c=[],setEdges:f,hasDefaultEdges:d,onEdgesChange:h,edgeLookup:m}=t.getState();let g=c;for(const v of l)g=typeof v=="function"?v(g):v;d?f(g):h&&h(gN({items:g,lookup:m}))},[]),a=vN(i),o=te.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return N.jsx(tP.Provider,{value:o,children:e})}function rne(){const e=te.useContext(tP);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const ine=e=>!!e.panZoom;function Ip(){const e=Wte(),t=Lt(),n=rne(),r=ut(ine),i=te.useMemo(()=>{const a=h=>t.getState().nodeLookup.get(h),o=h=>{n.nodeQueue.push(h)},l=h=>{n.edgeQueue.push(h)},c=h=>{var _,S;const{nodeLookup:m,nodeOrigin:g}=t.getState(),v=bN(h)?h:m.get(h.id),w=v.parentId?C9(v.position,v.measured,v.parentId,m,g):v.position,b={...v,position:w,width:((_=v.measured)==null?void 0:_.width)??v.width,height:((S=v.measured)==null?void 0:S.height)??v.height};return Xo(b)},f=(h,m,g={replace:!1})=>{o(v=>v.map(w=>{if(w.id===h){const b=typeof m=="function"?m(w):m;return g.replace&&bN(b)?b:{...w,...b}}return w}))},d=(h,m,g={replace:!1})=>{l(v=>v.map(w=>{if(w.id===h){const b=typeof m=="function"?m(w):m;return g.replace&&Jte(b)?b:{...w,...b}}return w}))};return{getNodes:()=>t.getState().nodes.map(h=>({...h})),getNode:h=>{var m;return(m=a(h))==null?void 0:m.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:h=[]}=t.getState();return h.map(m=>({...m}))},getEdge:h=>t.getState().edgeLookup.get(h),setNodes:o,setEdges:l,addNodes:h=>{const m=Array.isArray(h)?h:[h];n.nodeQueue.push(g=>[...g,...m])},addEdges:h=>{const m=Array.isArray(h)?h:[h];n.edgeQueue.push(g=>[...g,...m])},toObject:()=>{const{nodes:h=[],edges:m=[],transform:g}=t.getState(),[v,w,b]=g;return{nodes:h.map(_=>({..._})),edges:m.map(_=>({..._})),viewport:{x:v,y:w,zoom:b}}},deleteElements:async({nodes:h=[],edges:m=[]})=>{const{nodes:g,edges:v,onNodesDelete:w,onEdgesDelete:b,triggerNodeChanges:_,triggerEdgeChanges:S,onDelete:x,onBeforeDelete:A}=t.getState(),{nodes:k,edges:T}=await Nee({nodesToRemove:h,edgesToRemove:m,nodes:g,edges:v,onBeforeDelete:A}),O=T.length>0,$=k.length>0;if(O){const L=T.map(yN);b==null||b(T),S(L)}if($){const L=k.map(yN);w==null||w(k),_(L)}return($||O)&&(x==null||x({nodes:k,edges:T})),{deletedNodes:k,deletedEdges:T}},getIntersectingNodes:(h,m=!0,g)=>{const v=HO(h),w=v?h:c(h),b=g!==void 0;return w?(g||t.getState().nodes).filter(_=>{const S=t.getState().nodeLookup.get(_.id);if(S&&!v&&(_.id===h.id||!S.internals.positionAbsolute))return!1;const x=Xo(b?_:S),A=dc(x,w);return m&&A>0||A>=w.width*w.height}):[]},isNodeIntersecting:(h,m,g=!0)=>{const w=HO(h)?h:c(h);if(!w)return!1;const b=dc(w,m);return g&&b>0||b>=w.width*w.height},updateNode:f,updateNodeData:(h,m,g={replace:!1})=>{f(h,v=>{const w=typeof m=="function"?m(v):m;return g.replace?{...v,data:w}:{...v,data:{...v.data,...w}}},g)},updateEdge:d,updateEdgeData:(h,m,g={replace:!1})=>{d(h,v=>{const w=typeof m=="function"?m(v):m;return g.replace?{...v,data:w}:{...v,data:{...v.data,...w}}},g)},getNodesBounds:h=>{const{nodeLookup:m,nodeOrigin:g}=t.getState();return Aee(h,{nodeLookup:m,nodeOrigin:g})},getHandleConnections:({type:h,id:m,nodeId:g})=>{var v;return Array.from(((v=t.getState().connectionLookup.get(`${g}-${h}${m?`-${m}`:""}`))==null?void 0:v.values())??[])},getNodeConnections:({type:h,handleId:m,nodeId:g})=>{var v;return Array.from(((v=t.getState().connectionLookup.get(`${g}${h?m?`-${h}-${m}`:`-${h}`:""}`))==null?void 0:v.values())??[])},fitView:async h=>{const m=t.getState().fitViewResolver??$ee();return t.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:m}),n.nodeQueue.push(g=>[...g]),m.promise}}},[]);return te.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const _N=e=>e.selected,ane=typeof window<"u"?window:void 0;function sne({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Lt(),{deleteElements:r}=Ip(),i=pc(e,{actInsideInputWithModifier:!1}),a=pc(t,{target:ane});te.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(_N),edges:o.filter(_N)}),n.setState({nodesSelectionActive:!1})}},[i]),te.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function one(e){const t=Lt();te.useEffect(()=>{const n=()=>{var i,a;if(!e.current)return!1;const r=NS(e.current);(r.height===0||r.width===0)&&((a=(i=t.getState()).onError)==null||a.call(i,"004",Jr.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Pp={position:"absolute",width:"100%",height:"100%",top:0,left:0},lne=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function une({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=bs.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:f,minZoom:d,maxZoom:h,zoomActivationKeyCode:m,preventScrolling:g=!0,children:v,noWheelClassName:w,noPanClassName:b,onViewportChange:_,isControlledViewport:S,paneClickDistance:x}){const A=Lt(),k=te.useRef(null),{userSelectionActive:T,lib:O}=ut(lne,Ut),$=pc(m),L=te.useRef();one(k);const M=te.useCallback(z=>{_==null||_({x:z[0],y:z[1],zoom:z[2]}),S||A.setState({transform:z})},[_,S]);return te.useEffect(()=>{if(k.current){L.current=hte({domNode:k.current,minZoom:d,maxZoom:h,translateExtent:f,viewport:c,paneClickDistance:x,onDraggingChange:D=>A.setState({paneDragging:D}),onPanZoomStart:(D,H)=>{const{onViewportChangeStart:B,onMoveStart:G}=A.getState();G==null||G(D,H),B==null||B(H)},onPanZoom:(D,H)=>{const{onViewportChange:B,onMove:G}=A.getState();G==null||G(D,H),B==null||B(H)},onPanZoomEnd:(D,H)=>{const{onViewportChangeEnd:B,onMoveEnd:G}=A.getState();G==null||G(D,H),B==null||B(H)}});const{x:z,y:P,zoom:q}=L.current.getViewport();return A.setState({panZoom:L.current,transform:[z,P,q],domNode:k.current.closest(".react-flow")}),()=>{var D;(D=L.current)==null||D.destroy()}}},[]),te.useEffect(()=>{var z;(z=L.current)==null||z.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:$,preventScrolling:g,noPanClassName:b,userSelectionActive:T,noWheelClassName:w,lib:O,onTransformChange:M})},[e,t,n,r,i,a,o,l,$,g,b,T,w,O,M]),N.jsx("div",{className:"react-flow__renderer",ref:k,style:Pp,children:v})}const cne=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function fne(){const{userSelectionActive:e,userSelectionRect:t}=ut(cne,Ut);return e&&t?N.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}const O0=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},dne=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function hne({isSelecting:e,selectionKeyPressed:t,selectionMode:n=fc.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:a,onSelectionEnd:o,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:f,onPaneMouseEnter:d,onPaneMouseMove:h,onPaneMouseLeave:m,children:g}){const v=Lt(),{userSelectionActive:w,elementsSelectable:b,dragging:_,connectionInProgress:S}=ut(dne,Ut),x=b&&(e||w),A=te.useRef(null),k=te.useRef(),T=te.useRef(new Set),O=te.useRef(new Set),$=te.useRef(!1),L=te.useRef(!1),M=G=>{if($.current||S){$.current=!1;return}l==null||l(G),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},z=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}c==null||c(G)},P=f?G=>f(G):void 0,q=G=>{var X,j;const{resetSelectedElements:K,domNode:Q}=v.getState();if(k.current=Q==null?void 0:Q.getBoundingClientRect(),!b||!e||G.button!==0||G.target!==A.current||!k.current)return;(j=(X=G.target)==null?void 0:X.setPointerCapture)==null||j.call(X,G.pointerId),L.current=!0,$.current=!1;const{x:R,y:V}=Ri(G.nativeEvent,k.current);K(),v.setState({userSelectionRect:{width:0,height:0,startX:R,startY:V,x:R,y:V}}),a==null||a(G)},D=G=>{const{userSelectionRect:K,transform:Q,nodeLookup:R,edgeLookup:V,connectionLookup:X,triggerNodeChanges:j,triggerEdgeChanges:I,defaultEdgeOptions:U}=v.getState();if(!k.current||!K)return;$.current=!0;const{x:Y,y:ne}=Ri(G.nativeEvent,k.current),{startX:ae,startY:re}=K,le={startX:ae,startY:re,x:Y<ae?Y:ae,y:ne<re?ne:re,width:Math.abs(Y-ae),height:Math.abs(ne-re)},W=T.current,J=O.current;T.current=new Set(w9(R,le,Q,n===fc.Partial,!0).map(fe=>fe.id)),O.current=new Set;const se=(U==null?void 0:U.selectable)??!0;for(const fe of T.current){const me=X.get(fe);if(me)for(const{edgeId:xe}of me.values()){const we=V.get(xe);we&&(we.selectable??se)&&O.current.add(xe)}}if(!GO(W,T.current)){const fe=Do(R,T.current,!0);j(fe)}if(!GO(J,O.current)){const fe=Do(V,O.current);I(fe)}v.setState({userSelectionRect:le,userSelectionActive:!0,nodesSelectionActive:!1})},H=G=>{var Q,R;if(G.button!==0||!L.current)return;(R=(Q=G.target)==null?void 0:Q.releasePointerCapture)==null||R.call(Q,G.pointerId);const{userSelectionRect:K}=v.getState();!w&&K&&G.target===A.current&&(M==null||M(G)),v.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:T.current.size>0}),o==null||o(G),(t||i)&&($.current=!1),L.current=!1},B=r===!0||Array.isArray(r)&&r.includes(0);return N.jsxs("div",{className:en(["react-flow__pane",{draggable:B,dragging:_,selection:e}]),onClick:x?void 0:O0(M,A),onContextMenu:O0(z,A),onWheel:O0(P,A),onPointerEnter:x?void 0:d,onPointerDown:x?q:h,onPointerMove:x?D:h,onPointerUp:x?H:void 0,onPointerLeave:m,ref:A,style:Pp,children:[g,N.jsx(fne,{})]})}function Lw({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),f=l.get(e);if(!f){c==null||c("012",Jr.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&o)&&(a({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):i([e])}function nP({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=Lt(),[c,f]=te.useState(!1),d=te.useRef();return te.useEffect(()=>{d.current=Jee({getStoreItems:()=>l.getState(),onNodeMouseDown:h=>{Lw({id:h,store:l,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),te.useEffect(()=>{var h,m;if(t)(h=d.current)==null||h.destroy();else if(e.current)return(m=d.current)==null||m.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{var g;(g=d.current)==null||g.destroy()}},[n,r,t,a,e,i]),c}const pne=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function rP(){const e=Lt();return te.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:f,nodeOrigin:d}=e.getState(),h=new Map,m=pne(o),g=i?a[0]:5,v=i?a[1]:5,w=n.direction.x*g*n.factor,b=n.direction.y*v*n.factor;for(const[,_]of f){if(!m(_))continue;let S={x:_.internals.positionAbsolute.x+w,y:_.internals.positionAbsolute.y+b};i&&(S=Mp(S,a));const{position:x,positionAbsolute:A}=S9({nodeId:_.id,nextPosition:S,nodeLookup:f,nodeExtent:r,nodeOrigin:d,onError:l});_.position=x,_.internals.positionAbsolute=A,h.set(_.id,_)}c(h)},[])}const DS=te.createContext(null),mne=DS.Provider;DS.Consumer;const iP=()=>te.useContext(DS),gne=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),yne=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:c,isValid:f}=o,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:a===Zo.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:d&&f}};function bne({type:e="source",position:t=Pe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:l,children:c,className:f,onMouseDown:d,onTouchStart:h,...m},g){var H,B;const v=o||null,w=e==="target",b=Lt(),_=iP(),{connectOnClick:S,noPanClassName:x,rfId:A}=ut(gne,Ut),{connectingFrom:k,connectingTo:T,clickConnecting:O,isPossibleEndHandle:$,connectionInProcess:L,clickConnectionInProcess:M,valid:z}=ut(yne(_,v,e),Ut);_||(B=(H=b.getState()).onError)==null||B.call(H,"010",Jr.error010());const P=G=>{const{defaultEdgeOptions:K,onConnect:Q,hasDefaultEdges:R}=b.getState(),V={...K,...G};if(R){const{edges:X,setEdges:j}=b.getState();j(qee(V,X))}Q==null||Q(V),l==null||l(V)},q=G=>{if(!_)return;const K=R9(G.nativeEvent);if(i&&(K&&G.button===0||!K)){const Q=b.getState();Pw.onPointerDown(G.nativeEvent,{autoPanOnConnect:Q.autoPanOnConnect,connectionMode:Q.connectionMode,connectionRadius:Q.connectionRadius,domNode:Q.domNode,nodeLookup:Q.nodeLookup,lib:Q.lib,isTarget:w,handleId:v,nodeId:_,flowId:Q.rfId,panBy:Q.panBy,cancelConnection:Q.cancelConnection,onConnectStart:Q.onConnectStart,onConnectEnd:Q.onConnectEnd,updateConnection:Q.updateConnection,onConnect:P,isValidConnection:n||Q.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:Q.autoPanSpeed})}K?d==null||d(G):h==null||h(G)},D=G=>{const{onClickConnectStart:K,onClickConnectEnd:Q,connectionClickStartHandle:R,connectionMode:V,isValidConnection:X,lib:j,rfId:I,nodeLookup:U,connection:Y}=b.getState();if(!_||!R&&!i)return;if(!R){K==null||K(G.nativeEvent,{nodeId:_,handleId:v,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:_,type:e,id:v}});return}const ne=O9(G.target),ae=n||X,{connection:re,isValid:le}=Pw.isValid(G.nativeEvent,{handle:{nodeId:_,id:v,type:e},connectionMode:V,fromNodeId:R.nodeId,fromHandleId:R.id||null,fromType:R.type,isValidConnection:ae,flowId:I,doc:ne,lib:j,nodeLookup:U});le&&re&&P(re);const W=structuredClone(Y);delete W.inProgress,W.toPosition=W.toHandle?W.toHandle.position:null,Q==null||Q(G,W),b.setState({connectionClickStartHandle:null})};return N.jsx("div",{"data-handleid":v,"data-nodeid":_,"data-handlepos":t,"data-id":`${A}-${_}-${v}-${e}`,className:en(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,f,{source:!w,target:w,connectable:r,connectablestart:i,connectableend:a,clickconnecting:O,connectingfrom:k,connectingto:T,valid:z,connectionindicator:r&&(!L||$)&&(L||M?a:i)}]),onMouseDown:q,onTouchStart:q,onClick:S?D:void 0,ref:g,...m,children:c})}const ip=te.memo(eP(bne));function vne({data:e,isConnectable:t,sourcePosition:n=Pe.Bottom}){return N.jsxs(N.Fragment,{children:[e==null?void 0:e.label,N.jsx(ip,{type:"source",position:n,isConnectable:t})]})}function _ne({data:e,isConnectable:t,targetPosition:n=Pe.Top,sourcePosition:r=Pe.Bottom}){return N.jsxs(N.Fragment,{children:[N.jsx(ip,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,N.jsx(ip,{type:"source",position:r,isConnectable:t})]})}function xne(){return null}function wne({data:e,isConnectable:t,targetPosition:n=Pe.Top}){return N.jsxs(N.Fragment,{children:[N.jsx(ip,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ap={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},xN={input:vne,default:_ne,output:wne,group:xne};function Sne(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const Ene=e=>{const{width:t,height:n,x:r,y:i}=Nc(e.nodeLookup,{filter:a=>!!a.selected});return{width:jr(t)?t:null,height:jr(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 kne({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Lt(),{width:i,height:a,transformString:o,userSelectionActive:l}=ut(Ene,Ut),c=rP(),f=te.useRef(null);if(te.useEffect(()=>{var m;n||(m=f.current)==null||m.focus({preventScroll:!0})},[n]),nP({nodeRef:f}),l||!i||!a)return null;const d=e?m=>{const g=r.getState().nodes.filter(v=>v.selected);e(m,g)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(ap,m.key)&&(m.preventDefault(),c({direction:ap[m.key],factor:m.shiftKey?4:1}))};return N.jsx("div",{className:en(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:N.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:a}})})}const wN=typeof window<"u"?window:void 0,Ane=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function aP({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:f,selectionOnDrag:d,selectionMode:h,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:v,panActivationKeyCode:w,zoomActivationKeyCode:b,elementsSelectable:_,zoomOnScroll:S,zoomOnPinch:x,panOnScroll:A,panOnScrollSpeed:k,panOnScrollMode:T,zoomOnDoubleClick:O,panOnDrag:$,defaultViewport:L,translateExtent:M,minZoom:z,maxZoom:P,preventScrolling:q,onSelectionContextMenu:D,noWheelClassName:H,noPanClassName:B,disableKeyboardA11y:G,onViewportChange:K,isControlledViewport:Q}){const{nodesSelectionActive:R,userSelectionActive:V}=ut(Ane),X=pc(f,{target:wN}),j=pc(w,{target:wN}),I=j||$,U=j||A,Y=d&&I!==!0,ne=X||V||Y;return sne({deleteKeyCode:c,multiSelectionKeyCode:v}),N.jsx(une,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:S,zoomOnPinch:x,panOnScroll:U,panOnScrollSpeed:k,panOnScrollMode:T,zoomOnDoubleClick:O,panOnDrag:!X&&I,defaultViewport:L,translateExtent:M,minZoom:z,maxZoom:P,zoomActivationKeyCode:b,preventScrolling:q,noWheelClassName:H,noPanClassName:B,onViewportChange:K,isControlledViewport:Q,paneClickDistance:l,children:N.jsxs(hne,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:I,isSelecting:!!ne,selectionMode:h,selectionKeyPressed:X,selectionOnDrag:Y,children:[e,R&&N.jsx(kne,{onSelectionContextMenu:D,noPanClassName:B,disableKeyboardA11y:G})]})})}aP.displayName="FlowRenderer";const Tne=te.memo(aP),Cne=e=>t=>e?w9(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function One(e){return ut(te.useCallback(Cne(e),[e]),Ut)}const Nne=e=>e.updateNodeInternals;function Rne(){const e=ut(Nne),[t]=te.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const a=i.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:i.target,force:!0})}),e(r)}));return te.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function jne({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=Lt(),a=te.useRef(null),o=te.useRef(null),l=te.useRef(e.sourcePosition),c=te.useRef(e.targetPosition),f=te.useRef(t),d=n&&!!e.internals.handleBounds;return te.useEffect(()=>{a.current&&!e.hidden&&(!d||o.current!==a.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(a.current),o.current=a.current)},[d,e.hidden]),te.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),te.useEffect(()=>{if(a.current){const h=f.current!==t,m=l.current!==e.sourcePosition,g=c.current!==e.targetPosition;(h||m||g)&&(f.current=t,l.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 Mne({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:f,nodesFocusable:d,resizeObserver:h,noDragClassName:m,noPanClassName:g,disableKeyboardA11y:v,rfId:w,nodeTypes:b,nodeClickDistance:_,onError:S}){const{node:x,internals:A,isParent:k}=ut(ne=>{const ae=ne.nodeLookup.get(e),re=ne.parentLookup.has(e);return{node:ae,internals:ae.internals,isParent:re}},Ut);let T=x.type||"default",O=(b==null?void 0:b[T])||xN[T];O===void 0&&(S==null||S("003",Jr.error003(T)),T="default",O=xN.default);const $=!!(x.draggable||l&&typeof x.draggable>"u"),L=!!(x.selectable||c&&typeof x.selectable>"u"),M=!!(x.connectable||f&&typeof x.connectable>"u"),z=!!(x.focusable||d&&typeof x.focusable>"u"),P=Lt(),q=T9(x),D=jne({node:x,nodeType:T,hasDimensions:q,resizeObserver:h}),H=nP({nodeRef:D,disabled:x.hidden||!$,noDragClassName:m,handleSelector:x.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:_}),B=rP();if(x.hidden)return null;const G=zi(x),K=Sne(x),Q=L||$||t||n||r||i,R=n?ne=>n(ne,{...A.userNode}):void 0,V=r?ne=>r(ne,{...A.userNode}):void 0,X=i?ne=>i(ne,{...A.userNode}):void 0,j=a?ne=>a(ne,{...A.userNode}):void 0,I=o?ne=>o(ne,{...A.userNode}):void 0,U=ne=>{const{selectNodesOnDrag:ae,nodeDragThreshold:re}=P.getState();L&&(!ae||!$||re>0)&&Lw({id:e,store:P,nodeRef:D}),t&&t(ne,{...A.userNode})},Y=ne=>{if(!(N9(ne.nativeEvent)||v))if(b9.includes(ne.key)&&L){const ae=ne.key==="Escape";Lw({id:e,store:P,unselect:ae,nodeRef:D})}else $&&x.selected&&Object.prototype.hasOwnProperty.call(ap,ne.key)&&(ne.preventDefault(),P.setState({ariaLiveMessage:`Moved selected node ${ne.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~A.positionAbsolute.x}, y: ${~~A.positionAbsolute.y}`}),B({direction:ap[ne.key],factor:ne.shiftKey?4:1}))};return N.jsx("div",{className:en(["react-flow__node",`react-flow__node-${T}`,{[g]:$},x.className,{selected:x.selected,selectable:L,parent:k,draggable:$,dragging:H}]),ref:D,style:{zIndex:A.z,transform:`translate(${A.positionAbsolute.x}px,${A.positionAbsolute.y}px)`,pointerEvents:Q?"all":"none",visibility:q?"visible":"hidden",...x.style,...K},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,onMouseMove:V,onMouseLeave:X,onContextMenu:j,onClick:U,onDoubleClick:I,onKeyDown:z?Y:void 0,tabIndex:z?0:void 0,role:z?"button":void 0,"aria-describedby":v?void 0:`${Z9}-${w}`,"aria-label":x.ariaLabel,children:N.jsx(mne,{value:e,children:N.jsx(O,{id:e,data:x.data,type:T,positionAbsoluteX:A.positionAbsolute.x,positionAbsoluteY:A.positionAbsolute.y,selected:x.selected??!1,selectable:L,draggable:$,deletable:x.deletable??!0,isConnectable:M,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:H,dragHandle:x.dragHandle,zIndex:A.z,parentId:x.parentId,...G})})})}const $ne=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function sP(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=ut($ne,Ut),o=One(e.onlyRenderVisibleElements),l=Rne();return N.jsx("div",{className:"react-flow__nodes",style:Pp,children:o.map(c=>N.jsx(Mne,{id:c,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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},c))})}sP.displayName="NodeRenderer";const Dne=te.memo(sP);function Ine(e){return ut(te.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const a=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);a&&o&&Pee({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Ut)}const Pne=({color:e="none",strokeWidth:t=1})=>N.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),Lne=({color:e="none",strokeWidth:t=1})=>N.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),SN={[ep.Arrow]:Pne,[ep.ArrowClosed]:Lne};function zne(e){const t=Lt();return te.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(SN,e)?SN[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",Jr.error009(e)),null)},[e])}const qne=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=zne(t);return c?N.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:N.jsx(c,{color:n,strokeWidth:o})}):null},oP=({defaultColor:e,rfId:t})=>{const n=ut(a=>a.edges),r=ut(a=>a.defaultEdgeOptions),i=te.useMemo(()=>Hee(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?N.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:N.jsx("defs",{children:i.map(a=>N.jsx(qne,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};oP.displayName="MarkerDefinitions";var Fne=te.memo(oP);function lP({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:f,...d}){const[h,m]=te.useState({x:1,y:0,width:0,height:0}),g=en(["react-flow__edge-textwrapper",f]),v=te.useRef(null);return te.useEffect(()=>{if(v.current){const w=v.current.getBBox();m({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?N.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...d,children:[i&&N.jsx("rect",{width:h.width+2*o[0],x:-o[0],y:-o[1],height:h.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),N.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:v,style:r,children:n}),c]}):null}lP.displayName="EdgeText";const Bne=te.memo(lP);function Lp({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:f=20,...d}){return N.jsxs(N.Fragment,{children:[N.jsx("path",{...d,d:e,fill:"none",className:en(["react-flow__edge-path",d.className])}),f&&N.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}),r&&jr(t)&&jr(n)?N.jsx(Bne,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function EN({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Pe.Left||e===Pe.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function uP({sourceX:e,sourceY:t,sourcePosition:n=Pe.Bottom,targetX:r,targetY:i,targetPosition:a=Pe.Top}){const[o,l]=EN({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,f]=EN({pos:a,x1:r,y1:i,x2:e,y2:t}),[d,h,m,g]=j9({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:f});return[`M${e},${t} C${o},${l} ${c},${f} ${r},${i}`,d,h,m,g]}function cP(e){return te.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:b,interactionWidth:_})=>{const[S,x,A]=uP({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),k=e.isInternal?void 0:t;return N.jsx(Lp,{id:k,path:S,labelX:x,labelY:A,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:b,interactionWidth:_})})}const Une=cP({isInternal:!1}),fP=cP({isInternal:!0});Une.displayName="SimpleBezierEdge";fP.displayName="SimpleBezierEdgeInternal";function dP(e){return te.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:m,sourcePosition:g=Pe.Bottom,targetPosition:v=Pe.Top,markerEnd:w,markerStart:b,pathOptions:_,interactionWidth:S})=>{const[x,A,k]=$w({sourceX:n,sourceY:r,sourcePosition:g,targetX:i,targetY:a,targetPosition:v,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset}),T=e.isInternal?void 0:t;return N.jsx(Lp,{id:T,path:x,labelX:A,labelY:k,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:m,markerEnd:w,markerStart:b,interactionWidth:S})})}const hP=dP({isInternal:!1}),pP=dP({isInternal:!0});hP.displayName="SmoothStepEdge";pP.displayName="SmoothStepEdgeInternal";function mP(e){return te.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return N.jsx(hP,{...n,id:r,pathOptions:te.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const Vne=mP({isInternal:!1}),gP=mP({isInternal:!0});Vne.displayName="StepEdge";gP.displayName="StepEdgeInternal";function yP(e){return te.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:m,markerEnd:g,markerStart:v,interactionWidth:w})=>{const[b,_,S]=D9({sourceX:n,sourceY:r,targetX:i,targetY:a}),x=e.isInternal?void 0:t;return N.jsx(Lp,{id:x,path:b,labelX:_,labelY:S,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:m,markerEnd:g,markerStart:v,interactionWidth:w})})}const Hne=yP({isInternal:!1}),bP=yP({isInternal:!0});Hne.displayName="StraightEdge";bP.displayName="StraightEdgeInternal";function vP(e){return te.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Pe.Bottom,targetPosition:l=Pe.Top,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:b,pathOptions:_,interactionWidth:S})=>{const[x,A,k]=M9({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l,curvature:_==null?void 0:_.curvature}),T=e.isInternal?void 0:t;return N.jsx(Lp,{id:T,path:x,labelX:A,labelY:k,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:b,interactionWidth:S})})}const Gne=vP({isInternal:!1}),_P=vP({isInternal:!0});Gne.displayName="BezierEdge";_P.displayName="BezierEdgeInternal";const kN={default:_P,straight:bP,step:gP,smoothstep:pP,simplebezier:fP},AN={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Yne=(e,t,n)=>n===Pe.Left?e-t:n===Pe.Right?e+t:e,Zne=(e,t,n)=>n===Pe.Top?e-t:n===Pe.Bottom?e+t:e,TN="react-flow__edgeupdater";function CN({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:l}){return N.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:en([TN,`${TN}-${l}`]),cx:Yne(t,r,e),cy:Zne(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Kne({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,setReconnecting:m,setUpdateHover:g}){const v=Lt(),w=(A,k)=>{if(A.button!==0)return;const{autoPanOnConnect:T,domNode:O,isValidConnection:$,connectionMode:L,connectionRadius:M,lib:z,onConnectStart:P,onConnectEnd:q,cancelConnection:D,nodeLookup:H,rfId:B,panBy:G,updateConnection:K}=v.getState(),Q=k.type==="target";m(!0),d==null||d(A,n,k.type);const R=(X,j)=>{m(!1),h==null||h(X,n,k.type,j)},V=X=>f==null?void 0:f(n,X);Pw.onPointerDown(A.nativeEvent,{autoPanOnConnect:T,connectionMode:L,connectionRadius:M,domNode:O,handleId:k.id,nodeId:k.nodeId,nodeLookup:H,isTarget:Q,edgeUpdaterType:k.type,lib:z,flowId:B,cancelConnection:D,panBy:G,isValidConnection:$,onConnect:V,onConnectStart:P,onConnectEnd:q,onReconnectEnd:R,updateConnection:K,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle})},b=A=>w(A,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),_=A=>w(A,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),S=()=>g(!0),x=()=>g(!1);return N.jsxs(N.Fragment,{children:[(e===!0||e==="source")&&N.jsx(CN,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:b,onMouseEnter:S,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&N.jsx(CN,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:S,onMouseOut:x,type:"target"})]})}function Xne({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,reconnectRadius:d,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,rfId:v,edgeTypes:w,noPanClassName:b,onError:_,disableKeyboardA11y:S}){let x=ut(J=>J.edgeLookup.get(e));const A=ut(J=>J.defaultEdgeOptions);x=A?{...A,...x}:x;let k=x.type||"default",T=(w==null?void 0:w[k])||kN[k];T===void 0&&(_==null||_("011",Jr.error011(k)),k="default",T=kN.default);const O=!!(x.focusable||t&&typeof x.focusable>"u"),$=typeof h<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),L=!!(x.selectable||r&&typeof x.selectable>"u"),M=te.useRef(null),[z,P]=te.useState(!1),[q,D]=te.useState(!1),H=Lt(),{zIndex:B,sourceX:G,sourceY:K,targetX:Q,targetY:R,sourcePosition:V,targetPosition:X}=ut(te.useCallback(J=>{const se=J.nodeLookup.get(x.source),fe=J.nodeLookup.get(x.target);if(!se||!fe)return{zIndex:x.zIndex,...AN};const me=Vee({id:e,sourceNode:se,targetNode:fe,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:J.connectionMode,onError:_});return{zIndex:Iee({selected:x.selected,zIndex:x.zIndex,sourceNode:se,targetNode:fe,elevateOnSelect:J.elevateEdgesOnSelect}),...me||AN}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),Ut),j=te.useMemo(()=>x.markerStart?`url('#${Dw(x.markerStart,v)}')`:void 0,[x.markerStart,v]),I=te.useMemo(()=>x.markerEnd?`url('#${Dw(x.markerEnd,v)}')`:void 0,[x.markerEnd,v]);if(x.hidden||G===null||K===null||Q===null||R===null)return null;const U=J=>{var xe;const{addSelectedEdges:se,unselectNodesAndEdges:fe,multiSelectionActive:me}=H.getState();L&&(H.setState({nodesSelectionActive:!1}),x.selected&&me?(fe({nodes:[],edges:[x]}),(xe=M.current)==null||xe.blur()):se([e])),i&&i(J,x)},Y=a?J=>{a(J,{...x})}:void 0,ne=o?J=>{o(J,{...x})}:void 0,ae=l?J=>{l(J,{...x})}:void 0,re=c?J=>{c(J,{...x})}:void 0,le=f?J=>{f(J,{...x})}:void 0,W=J=>{var se;if(!S&&b9.includes(J.key)&&L){const{unselectNodesAndEdges:fe,addSelectedEdges:me}=H.getState();J.key==="Escape"?((se=M.current)==null||se.blur(),fe({edges:[x]})):me([e])}};return N.jsx("svg",{style:{zIndex:B},children:N.jsxs("g",{className:en(["react-flow__edge",`react-flow__edge-${k}`,x.className,b,{selected:x.selected,animated:x.animated,inactive:!L&&!i,updating:z,selectable:L}]),onClick:U,onDoubleClick:Y,onContextMenu:ne,onMouseEnter:ae,onMouseMove:re,onMouseLeave:le,onKeyDown:O?W:void 0,tabIndex:O?0:void 0,role:O?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":O?`${K9}-${v}`:void 0,ref:M,children:[!q&&N.jsx(T,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:L,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:G,sourceY:K,targetX:Q,targetY:R,sourcePosition:V,targetPosition:X,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:j,markerEnd:I,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),$&&N.jsx(Kne,{edge:x,isReconnectable:$,reconnectRadius:d,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,sourceX:G,sourceY:K,targetX:Q,targetY:R,sourcePosition:V,targetPosition:X,setUpdateHover:P,setReconnecting:D})]})})}const Wne=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function xP({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:f,onEdgeClick:d,reconnectRadius:h,onEdgeDoubleClick:m,onReconnectStart:g,onReconnectEnd:v,disableKeyboardA11y:w}){const{edgesFocusable:b,edgesReconnectable:_,elementsSelectable:S,onError:x}=ut(Wne,Ut),A=Ine(t);return N.jsxs("div",{className:"react-flow__edges",children:[N.jsx(Fne,{defaultColor:e,rfId:n}),A.map(k=>N.jsx(Xne,{id:k,edgesFocusable:b,edgesReconnectable:_,elementsSelectable:S,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,onClick:d,reconnectRadius:h,onDoubleClick:m,onReconnectStart:g,onReconnectEnd:v,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:w},k))]})}xP.displayName="EdgeRenderer";const Qne=te.memo(xP),Jne=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function ere({children:e}){const t=ut(Jne);return N.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function tre(e){const t=Ip(),n=te.useRef(!1);te.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const nre=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function rre(e){const t=ut(nre),n=Lt();return te.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function ire(e){return e.connection.inProgress?{...e.connection,to:Rc(e.connection.to,e.transform)}:{...e.connection}}function are(e){return ire}function sre(e){const t=are();return ut(t,Ut)}const ore=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function lre({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:o,isValid:l,inProgress:c}=ut(ore,Ut);return!(a&&i&&c)?null:N.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:N.jsx("g",{className:en(["react-flow__connection",_9(l)]),children:N.jsx(wP,{style:t,type:n,CustomComponent:r,isValid:l})})})}const wP=({style:e,type:t=Ca.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:o,fromHandle:l,fromPosition:c,to:f,toNode:d,toHandle:h,toPosition:m}=sre();if(!i)return;if(n)return N.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:a.x,fromY:a.y,toX:f.x,toY:f.y,fromPosition:c,toPosition:m,connectionStatus:_9(r),toNode:d,toHandle:h});let g="";const v={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:f.x,targetY:f.y,targetPosition:m};switch(t){case Ca.Bezier:[g]=M9(v);break;case Ca.SimpleBezier:[g]=uP(v);break;case Ca.Step:[g]=$w({...v,borderRadius:0});break;case Ca.SmoothStep:[g]=$w(v);break;default:[g]=D9(v)}return N.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};wP.displayName="ConnectionLine";const ure={};function ON(e=ure){te.useRef(e),Lt(),te.useEffect(()=>{},[e])}function cre(){Lt(),te.useRef(!1),te.useEffect(()=>{},[])}function SP({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:d,onSelectionContextMenu:h,onSelectionStart:m,onSelectionEnd:g,connectionLineType:v,connectionLineStyle:w,connectionLineComponent:b,connectionLineContainerStyle:_,selectionKeyCode:S,selectionOnDrag:x,selectionMode:A,multiSelectionKeyCode:k,panActivationKeyCode:T,zoomActivationKeyCode:O,deleteKeyCode:$,onlyRenderVisibleElements:L,elementsSelectable:M,defaultViewport:z,translateExtent:P,minZoom:q,maxZoom:D,preventScrolling:H,defaultMarkerColor:B,zoomOnScroll:G,zoomOnPinch:K,panOnScroll:Q,panOnScrollSpeed:R,panOnScrollMode:V,zoomOnDoubleClick:X,panOnDrag:j,onPaneClick:I,onPaneMouseEnter:U,onPaneMouseMove:Y,onPaneMouseLeave:ne,onPaneScroll:ae,onPaneContextMenu:re,paneClickDistance:le,nodeClickDistance:W,onEdgeContextMenu:J,onEdgeMouseEnter:se,onEdgeMouseMove:fe,onEdgeMouseLeave:me,reconnectRadius:xe,onReconnect:we,onReconnectStart:Ve,onReconnectEnd:qe,noDragClassName:We,noWheelClassName:He,noPanClassName:$e,disableKeyboardA11y:Be,nodeExtent:Ot,rfId:kt,viewport:pe,onViewportChange:_e}){return ON(e),ON(t),cre(),tre(n),rre(pe),N.jsx(Tne,{onPaneClick:I,onPaneMouseEnter:U,onPaneMouseMove:Y,onPaneMouseLeave:ne,onPaneContextMenu:re,onPaneScroll:ae,paneClickDistance:le,deleteKeyCode:$,selectionKeyCode:S,selectionOnDrag:x,selectionMode:A,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:k,panActivationKeyCode:T,zoomActivationKeyCode:O,elementsSelectable:M,zoomOnScroll:G,zoomOnPinch:K,zoomOnDoubleClick:X,panOnScroll:Q,panOnScrollSpeed:R,panOnScrollMode:V,panOnDrag:j,defaultViewport:z,translateExtent:P,minZoom:q,maxZoom:D,onSelectionContextMenu:h,preventScrolling:H,noDragClassName:We,noWheelClassName:He,noPanClassName:$e,disableKeyboardA11y:Be,onViewportChange:_e,isControlledViewport:!!pe,children:N.jsxs(ere,{children:[N.jsx(Qne,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:we,onReconnectStart:Ve,onReconnectEnd:qe,onlyRenderVisibleElements:L,onEdgeContextMenu:J,onEdgeMouseEnter:se,onEdgeMouseMove:fe,onEdgeMouseLeave:me,reconnectRadius:xe,defaultMarkerColor:B,noPanClassName:$e,disableKeyboardA11y:Be,rfId:kt}),N.jsx(lre,{style:w,type:v,component:b,containerStyle:_}),N.jsx("div",{className:"react-flow__edgelabel-renderer"}),N.jsx(Dne,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:d,nodeClickDistance:W,onlyRenderVisibleElements:L,noPanClassName:$e,noDragClassName:We,disableKeyboardA11y:Be,nodeExtent:Ot,rfId:kt}),N.jsx("div",{className:"react-flow__viewport-portal"})]})})}SP.displayName="GraphView";const fre=te.memo(SP),NN=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:f=2,nodeOrigin:d,nodeExtent:h}={})=>{const m=new Map,g=new Map,v=new Map,w=new Map,b=r??t??[],_=n??e??[],S=d??[0,0],x=h??cc;P9(v,w,b);const A=Iw(_,m,g,{nodeOrigin:S,nodeExtent:x,elevateNodesOnSelect:!1});let k=[0,0,1];if(o&&i&&a){const T=Nc(m,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:O,y:$,zoom:L}=OS(T,i,a,c,f,(l==null?void 0:l.padding)??.1);k=[O,$,L]}return{rfId:"1",width:0,height:0,transform:k,nodes:_,nodesInitialized:A,nodeLookup:m,parentLookup:g,edges:b,edgeLookup:w,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:cc,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Zo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:S,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...v9},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:Ree,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},dre=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:d,nodeExtent:h})=>jte((m,g)=>{async function v(){const{nodeLookup:w,panZoom:b,fitViewOptions:_,fitViewResolver:S,width:x,height:A,minZoom:k,maxZoom:T}=g();b&&(await Oee({nodes:w,width:x,height:A,panZoom:b,minZoom:k,maxZoom:T},_),S==null||S.resolve(!0),m({fitViewResolver:null}))}return{...NN({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:d,nodeExtent:h,defaultNodes:n,defaultEdges:r}),setNodes:w=>{const{nodeLookup:b,parentLookup:_,nodeOrigin:S,elevateNodesOnSelect:x,fitViewQueued:A}=g(),k=Iw(w,b,_,{nodeOrigin:S,nodeExtent:h,elevateNodesOnSelect:x,checkEquality:!0});A&&k?(v(),m({nodes:w,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:w,nodesInitialized:k})},setEdges:w=>{const{connectionLookup:b,edgeLookup:_}=g();P9(b,_,w),m({edges:w})},setDefaultNodesAndEdges:(w,b)=>{if(w){const{setNodes:_}=g();_(w),m({hasDefaultNodes:!0})}if(b){const{setEdges:_}=g();_(b),m({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:b,nodeLookup:_,parentLookup:S,domNode:x,nodeOrigin:A,nodeExtent:k,debug:T,fitViewQueued:O}=g(),{changes:$,updatedInternals:L}=Xee(w,_,S,x,A,k);L&&(Yee(_,S,{nodeOrigin:A,nodeExtent:k}),O?(v(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),($==null?void 0:$.length)>0&&(T&&console.log("React Flow: trigger node changes",$),b==null||b($)))},updateNodePositions:(w,b=!1)=>{const _=[],S=[],{nodeLookup:x,triggerNodeChanges:A}=g();for(const[k,T]of w){const O=x.get(k),$=!!(O!=null&&O.expandParent&&(O!=null&&O.parentId)&&(T!=null&&T.position)),L={id:k,type:"position",position:$?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:b};$&&O.parentId&&_.push({id:k,parentId:O.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),S.push(L)}if(_.length>0){const{parentLookup:k,nodeOrigin:T}=g(),O=$S(_,x,k,T);S.push(...O)}A(S)},triggerNodeChanges:w=>{const{onNodesChange:b,setNodes:_,nodes:S,hasDefaultNodes:x,debug:A}=g();if(w!=null&&w.length){if(x){const k=Q9(w,S);_(k)}A&&console.log("React Flow: trigger node changes",w),b==null||b(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:b,setEdges:_,edges:S,hasDefaultEdges:x,debug:A}=g();if(w!=null&&w.length){if(x){const k=J9(w,S);_(k)}A&&console.log("React Flow: trigger edge changes",w),b==null||b(w)}},addSelectedNodes:w=>{const{multiSelectionActive:b,edgeLookup:_,nodeLookup:S,triggerNodeChanges:x,triggerEdgeChanges:A}=g();if(b){const k=w.map(T=>ls(T,!0));x(k);return}x(Do(S,new Set([...w]),!0)),A(Do(_))},addSelectedEdges:w=>{const{multiSelectionActive:b,edgeLookup:_,nodeLookup:S,triggerNodeChanges:x,triggerEdgeChanges:A}=g();if(b){const k=w.map(T=>ls(T,!0));A(k);return}A(Do(_,new Set([...w]))),x(Do(S,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:b}={})=>{const{edges:_,nodes:S,nodeLookup:x,triggerNodeChanges:A,triggerEdgeChanges:k}=g(),T=w||S,O=b||_,$=T.map(M=>{const z=x.get(M.id);return z&&(z.selected=!1),ls(M.id,!1)}),L=O.map(M=>ls(M.id,!1));A($),k(L)},setMinZoom:w=>{const{panZoom:b,maxZoom:_}=g();b==null||b.setScaleExtent([w,_]),m({minZoom:w})},setMaxZoom:w=>{const{panZoom:b,minZoom:_}=g();b==null||b.setScaleExtent([_,w]),m({maxZoom:w})},setTranslateExtent:w=>{var b;(b=g().panZoom)==null||b.setTranslateExtent(w),m({translateExtent:w})},setPaneClickDistance:w=>{var b;(b=g().panZoom)==null||b.setClickDistance(w)},resetSelectedElements:()=>{const{edges:w,nodes:b,triggerNodeChanges:_,triggerEdgeChanges:S,elementsSelectable:x}=g();if(!x)return;const A=b.reduce((T,O)=>O.selected?[...T,ls(O.id,!1)]:T,[]),k=w.reduce((T,O)=>O.selected?[...T,ls(O.id,!1)]:T,[]);_(A),S(k)},setNodeExtent:w=>{const{nodes:b,nodeLookup:_,parentLookup:S,nodeOrigin:x,elevateNodesOnSelect:A,nodeExtent:k}=g();w[0][0]===k[0][0]&&w[0][1]===k[0][1]&&w[1][0]===k[1][0]&&w[1][1]===k[1][1]||(Iw(b,_,S,{nodeOrigin:x,nodeExtent:w,elevateNodesOnSelect:A,checkEquality:!1}),m({nodeExtent:w}))},panBy:w=>{const{transform:b,width:_,height:S,panZoom:x,translateExtent:A}=g();return Wee({delta:w,panZoom:x,transform:b,translateExtent:A,width:_,height:S})},cancelConnection:()=>{m({connection:{...v9}})},updateConnection:w=>{m({connection:w})},reset:()=>m({...NN()})}},Object.is);function EP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:f,nodeOrigin:d,nodeExtent:h,children:m}){const[g]=te.useState(()=>dre({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:f,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:h}));return N.jsx(Mte,{value:g,children:N.jsx(nne,{children:m})})}function hre({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:h,nodeExtent:m}){return te.useContext(Dp)?N.jsx(N.Fragment,{children:e}):N.jsx(EP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:f,initialMaxZoom:d,nodeOrigin:h,nodeExtent:m,children:e})}const pre={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function mre({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:f,onMove:d,onMoveStart:h,onMoveEnd:m,onConnect:g,onConnectStart:v,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:_,onNodeMouseEnter:S,onNodeMouseMove:x,onNodeMouseLeave:A,onNodeContextMenu:k,onNodeDoubleClick:T,onNodeDragStart:O,onNodeDrag:$,onNodeDragStop:L,onNodesDelete:M,onEdgesDelete:z,onDelete:P,onSelectionChange:q,onSelectionDragStart:D,onSelectionDrag:H,onSelectionDragStop:B,onSelectionContextMenu:G,onSelectionStart:K,onSelectionEnd:Q,onBeforeDelete:R,connectionMode:V,connectionLineType:X=Ca.Bezier,connectionLineStyle:j,connectionLineComponent:I,connectionLineContainerStyle:U,deleteKeyCode:Y="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:ae=!1,selectionMode:re=fc.Full,panActivationKeyCode:le="Space",multiSelectionKeyCode:W=rp()?"Meta":"Control",zoomActivationKeyCode:J=rp()?"Meta":"Control",snapToGrid:se,snapGrid:fe,onlyRenderVisibleElements:me=!1,selectNodesOnDrag:xe,nodesDraggable:we,nodesConnectable:Ve,nodesFocusable:qe,nodeOrigin:We=X9,edgesFocusable:He,edgesReconnectable:$e,elementsSelectable:Be=!0,defaultViewport:Ot=Gte,minZoom:kt=.5,maxZoom:pe=2,translateExtent:_e=cc,preventScrolling:Te=!0,nodeExtent:je,defaultMarkerColor:rt="#b1b1b7",zoomOnScroll:cn=!0,zoomOnPinch:Cn=!0,panOnScroll:$t=!1,panOnScrollSpeed:Gt=.5,panOnScrollMode:wn=bs.Free,zoomOnDoubleClick:Yt=!0,panOnDrag:On=!0,onPaneClick:Bn,onPaneMouseEnter:Hc,onPaneMouseMove:Gc,onPaneMouseLeave:gl,onPaneScroll:za,onPaneContextMenu:bm,paneClickDistance:yl=0,nodeClickDistance:Yc=0,children:bl,onReconnect:vl,onReconnectStart:Zc,onReconnectEnd:vm,onEdgeContextMenu:zr,onEdgeDoubleClick:sn,onEdgeMouseEnter:yn,onEdgeMouseMove:Ui,onEdgeMouseLeave:_l,reconnectRadius:_m=10,onNodesChange:xm,onEdgesChange:Kc,noDragClassName:qa="nodrag",noWheelClassName:xl="nowheel",noPanClassName:si="nopan",fitView:oi,fitViewOptions:Vi,connectOnClick:Hi,attributionPosition:Zt,proOptions:Xc,defaultEdgeOptions:Wc,elevateNodesOnSelect:li,elevateEdgesOnSelect:Gi,disableKeyboardA11y:Qc=!1,autoPanOnConnect:Jc,autoPanOnNodeDrag:ef,autoPanSpeed:wm,connectionRadius:Ps,isValidConnection:Ls,onError:xr,style:wl,id:Sl,nodeDragThreshold:Yi,viewport:El,onViewportChange:kl,width:Sm,height:tf,colorMode:Nn="light",debug:nf,onScroll:zs,...qs},rf){const Zi=Sl||"1",Em=Xte(Nn),Rn=te.useCallback(Fs=>{Fs.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),zs==null||zs(Fs)},[zs]);return N.jsx("div",{"data-testid":"rf__wrapper",...qs,onScroll:Rn,style:{...wl,...pre},ref:rf,className:en(["react-flow",i,Em]),id:Sl,children:N.jsxs(hre,{nodes:e,edges:t,width:Sm,height:tf,fitView:oi,fitViewOptions:Vi,minZoom:kt,maxZoom:pe,nodeOrigin:We,nodeExtent:je,children:[N.jsx(fre,{onInit:f,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:S,onNodeMouseMove:x,onNodeMouseLeave:A,onNodeContextMenu:k,onNodeDoubleClick:T,nodeTypes:a,edgeTypes:o,connectionLineType:X,connectionLineStyle:j,connectionLineComponent:I,connectionLineContainerStyle:U,selectionKeyCode:ne,selectionOnDrag:ae,selectionMode:re,deleteKeyCode:Y,multiSelectionKeyCode:W,panActivationKeyCode:le,zoomActivationKeyCode:J,onlyRenderVisibleElements:me,defaultViewport:Ot,translateExtent:_e,minZoom:kt,maxZoom:pe,preventScrolling:Te,zoomOnScroll:cn,zoomOnPinch:Cn,zoomOnDoubleClick:Yt,panOnScroll:$t,panOnScrollSpeed:Gt,panOnScrollMode:wn,panOnDrag:On,onPaneClick:Bn,onPaneMouseEnter:Hc,onPaneMouseMove:Gc,onPaneMouseLeave:gl,onPaneScroll:za,onPaneContextMenu:bm,paneClickDistance:yl,nodeClickDistance:Yc,onSelectionContextMenu:G,onSelectionStart:K,onSelectionEnd:Q,onReconnect:vl,onReconnectStart:Zc,onReconnectEnd:vm,onEdgeContextMenu:zr,onEdgeDoubleClick:sn,onEdgeMouseEnter:yn,onEdgeMouseMove:Ui,onEdgeMouseLeave:_l,reconnectRadius:_m,defaultMarkerColor:rt,noDragClassName:qa,noWheelClassName:xl,noPanClassName:si,rfId:Zi,disableKeyboardA11y:Qc,nodeExtent:je,viewport:El,onViewportChange:kl}),N.jsx(Kte,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:v,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:_,nodesDraggable:we,nodesConnectable:Ve,nodesFocusable:qe,edgesFocusable:He,edgesReconnectable:$e,elementsSelectable:Be,elevateNodesOnSelect:li,elevateEdgesOnSelect:Gi,minZoom:kt,maxZoom:pe,nodeExtent:je,onNodesChange:xm,onEdgesChange:Kc,snapToGrid:se,snapGrid:fe,connectionMode:V,translateExtent:_e,connectOnClick:Hi,defaultEdgeOptions:Wc,fitView:oi,fitViewOptions:Vi,onNodesDelete:M,onEdgesDelete:z,onDelete:P,onNodeDragStart:O,onNodeDrag:$,onNodeDragStop:L,onSelectionDrag:H,onSelectionDragStart:D,onSelectionDragStop:B,onMove:d,onMoveStart:h,onMoveEnd:m,noPanClassName:si,nodeOrigin:We,rfId:Zi,autoPanOnConnect:Jc,autoPanOnNodeDrag:ef,autoPanSpeed:wm,onError:xr,connectionRadius:Ps,isValidConnection:Ls,selectNodesOnDrag:xe,nodeDragThreshold:Yi,onBeforeDelete:R,paneClickDistance:yl,debug:nf}),N.jsx(Hte,{onSelectionChange:q}),bl,N.jsx(qte,{proOptions:Xc,position:Zt}),N.jsx(Lte,{rfId:Zi,disableKeyboardA11y:Qc})]})})}var gre=eP(mre);function yre(e){const[t,n]=te.useState(e),r=te.useCallback(i=>n(a=>Q9(i,a)),[]);return[t,n,r]}function bre(e){const[t,n]=te.useState(e),r=te.useCallback(i=>n(a=>J9(i,a)),[]);return[t,n,r]}function vre({dimensions:e,lineWidth:t,variant:n,className:r}){return N.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:en(["react-flow__background-pattern",n,r])})}function _re({radius:e,className:t}){return N.jsx("circle",{cx:e,cy:e,r:e,className:en(["react-flow__background-pattern","dots",t])})}var ja;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ja||(ja={}));const xre={[ja.Dots]:1,[ja.Lines]:1,[ja.Cross]:6},wre=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function kP({id:e,variant:t=ja.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:l,style:c,className:f,patternClassName:d}){const h=te.useRef(null),{transform:m,patternId:g}=ut(wre,Ut),v=r||xre[t],w=t===ja.Dots,b=t===ja.Cross,_=Array.isArray(n)?n:[n,n],S=[_[0]*m[2]||1,_[1]*m[2]||1],x=v*m[2],A=Array.isArray(a)?a:[a,a],k=b?[x,x]:S,T=[A[0]*m[2]||1+k[0]/2,A[1]*m[2]||1+k[1]/2],O=`${g}${e||""}`;return N.jsxs("svg",{className:en(["react-flow__background",f]),style:{...c,...Pp,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:h,"data-testid":"rf__background",children:[N.jsx("pattern",{id:O,x:m[0]%S[0],y:m[1]%S[1],width:S[0],height:S[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:w?N.jsx(_re,{radius:x/2,className:d}):N.jsx(vre,{dimensions:k,lineWidth:i,variant:t,className:d})}),N.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${O})`})]})}kP.displayName="Background";const Sre=te.memo(kP);function Ere(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:N.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function kre(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:N.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Are(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:N.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 Tre(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.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 Cre(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.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 Rd({children:e,className:t,...n}){return N.jsx("button",{type:"button",className:en(["react-flow__controls-button",t]),...n,children:e})}const Ore=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function AP({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:f,children:d,position:h="bottom-left",orientation:m="vertical","aria-label":g="React Flow controls"}){const v=Lt(),{isInteractive:w,minZoomReached:b,maxZoomReached:_}=ut(Ore,Ut),{zoomIn:S,zoomOut:x,fitView:A}=Ip(),k=()=>{S(),a==null||a()},T=()=>{x(),o==null||o()},O=()=>{A(i),l==null||l()},$=()=>{v.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c==null||c(!w)},L=m==="horizontal"?"horizontal":"vertical";return N.jsxs(jc,{className:en(["react-flow__controls",L,f]),position:h,style:e,"data-testid":"rf__controls","aria-label":g,children:[t&&N.jsxs(N.Fragment,{children:[N.jsx(Rd,{onClick:k,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:_,children:N.jsx(Ere,{})}),N.jsx(Rd,{onClick:T,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b,children:N.jsx(kre,{})})]}),n&&N.jsx(Rd,{className:"react-flow__controls-fitview",onClick:O,title:"fit view","aria-label":"fit view",children:N.jsx(Are,{})}),r&&N.jsx(Rd,{className:"react-flow__controls-interactive",onClick:$,title:"toggle interactivity","aria-label":"toggle interactivity",children:w?N.jsx(Cre,{}):N.jsx(Tre,{})}),d]})}AP.displayName="Controls";const Nre=te.memo(AP);function Rre({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:l,strokeWidth:c,className:f,borderRadius:d,shapeRendering:h,selected:m,onClick:g}){const{background:v,backgroundColor:w}=a||{},b=o||v||w;return N.jsx("rect",{className:en(["react-flow__minimap-node",{selected:m},f]),x:t,y:n,rx:d,ry:d,width:r,height:i,style:{fill:b,stroke:l,strokeWidth:c},shapeRendering:h,onClick:g?_=>g(_,e):void 0})}const jre=te.memo(Rre),Mre=e=>e.nodes.map(t=>t.id),N0=e=>e instanceof Function?e:()=>e;function $re({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=jre,onClick:o}){const l=ut(Mre,Ut),c=N0(t),f=N0(e),d=N0(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return N.jsx(N.Fragment,{children:l.map(m=>N.jsx(Ire,{id:m,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:h},m))})}function Dre({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:f,x:d,y:h,width:m,height:g}=ut(v=>{const{internals:w}=v.nodeLookup.get(e),b=w.userNode,{x:_,y:S}=w.positionAbsolute,{width:x,height:A}=zi(b);return{node:b,x:_,y:S,width:x,height:A}},Ut);return!f||f.hidden||!T9(f)?null:N.jsx(l,{x:d,y:h,width:m,height:g,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:i,strokeColor:n(f),strokeWidth:a,shapeRendering:o,onClick:c,id:f.id})}const Ire=te.memo(Dre);var Pre=te.memo($re);const Lre=200,zre=150,qre=e=>!e.hidden,Fre=e=>{const 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]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?A9(Nc(e.nodeLookup,{filter:qre}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},Bre="react-flow__minimap-desc";function TP({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:f,maskStrokeColor:d,maskStrokeWidth:h,position:m="bottom-right",onClick:g,onNodeClick:v,pannable:w=!1,zoomable:b=!1,ariaLabel:_="React Flow mini map",inversePan:S,zoomStep:x=10,offsetScale:A=5}){const k=Lt(),T=te.useRef(null),{boundingRect:O,viewBB:$,rfId:L,panZoom:M,translateExtent:z,flowWidth:P,flowHeight:q}=ut(Fre,Ut),D=(e==null?void 0:e.width)??Lre,H=(e==null?void 0:e.height)??zre,B=O.width/D,G=O.height/H,K=Math.max(B,G),Q=K*D,R=K*H,V=A*K,X=O.x-(Q-O.width)/2-V,j=O.y-(R-O.height)/2-V,I=Q+V*2,U=R+V*2,Y=`${Bre}-${L}`,ne=te.useRef(0),ae=te.useRef();ne.current=K,te.useEffect(()=>{if(T.current&&M)return ae.current=ate({domNode:T.current,panZoom:M,getTransform:()=>k.getState().transform,getViewScale:()=>ne.current}),()=>{var W;(W=ae.current)==null||W.destroy()}},[M]),te.useEffect(()=>{var W;(W=ae.current)==null||W.update({translateExtent:z,width:P,height:q,inversePan:S,pannable:w,zoomStep:x,zoomable:b})},[w,b,S,x,z,P,q]);const re=g?W=>{var fe;const[J,se]=((fe=ae.current)==null?void 0:fe.pointer(W))||[0,0];g(W,{x:J,y:se})}:void 0,le=v?te.useCallback((W,J)=>{const se=k.getState().nodeLookup.get(J).internals.userNode;v(W,se)},[]):void 0;return N.jsx(jc,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*K: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:en(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:N.jsxs("svg",{width:D,height:H,viewBox:`${X} ${j} ${I} ${U}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Y,ref:T,onClick:re,children:[_&&N.jsx("title",{id:Y,children:_}),N.jsx(Pre,{onClick:le,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),N.jsx("path",{className:"react-flow__minimap-mask",d:`M${X-V},${j-V}h${I+V*2}v${U+V*2}h${-I-V*2}z
|
|
230
|
+
M${$.x},${$.y}h${$.width}v${$.height}h${-$.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}TP.displayName="MiniMap";te.memo(TP);function Ure({nodeId:e,position:t,variant:n=Yu.Handle,className:r,style:i={},children:a,color:o,minWidth:l=10,minHeight:c=10,maxWidth:f=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:m,shouldResize:g,onResizeStart:v,onResize:w,onResizeEnd:b}){const _=iP(),S=typeof e=="string"?e:_,x=Lt(),A=te.useRef(null),k=n===Yu.Line?"right":"bottom-right",T=t??k,O=te.useRef(null);te.useEffect(()=>{if(!(!A.current||!S))return O.current||(O.current=_te({domNode:A.current,nodeId:S,getStoreItems:()=>{const{nodeLookup:z,transform:P,snapGrid:q,snapToGrid:D,nodeOrigin:H,domNode:B}=x.getState();return{nodeLookup:z,transform:P,snapGrid:q,snapToGrid:D,nodeOrigin:H,paneDomNode:B}},onChange:(z,P)=>{const{triggerNodeChanges:q,nodeLookup:D,parentLookup:H,nodeOrigin:B}=x.getState(),G=[],K={x:z.x,y:z.y},Q=D.get(S);if(Q&&Q.expandParent&&Q.parentId){const R=Q.origin??B,V=z.width??Q.measured.width??0,X=z.height??Q.measured.height??0,j={id:Q.id,parentId:Q.parentId,rect:{width:V,height:X,...C9({x:z.x??Q.position.x,y:z.y??Q.position.y},{width:V,height:X},Q.parentId,D,R)}},I=$S([j],D,H,B);G.push(...I),K.x=z.x?Math.max(R[0]*V,z.x):void 0,K.y=z.y?Math.max(R[1]*X,z.y):void 0}if(K.x!==void 0&&K.y!==void 0){const R={id:S,type:"position",position:{...K}};G.push(R)}if(z.width!==void 0&&z.height!==void 0){const V={id:S,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};G.push(V)}for(const R of P){const V={...R,type:"position"};G.push(V)}q(G)},onEnd:({width:z,height:P})=>{const q={id:S,type:"dimensions",resizing:!1,dimensions:{width:z,height:P}};x.getState().triggerNodeChanges([q])}})),O.current.update({controlPosition:T,boundaries:{minWidth:l,minHeight:c,maxWidth:f,maxHeight:d},keepAspectRatio:h,resizeDirection:m,onResizeStart:v,onResize:w,onResizeEnd:b,shouldResize:g}),()=>{var z;(z=O.current)==null||z.destroy()}},[T,l,c,f,d,h,v,w,b,g]);const $=T.split("-"),L=n===Yu.Line?"borderColor":"backgroundColor",M=o?{...i,[L]:o}:i;return N.jsx("div",{className:en(["react-flow__resize-control","nodrag",...$,n,r]),ref:A,style:M,children:a})}te.memo(Ure);var R0,RN;function IS(){if(RN)return R0;RN=1;var e="\0",t="\0",n="";class r{constructor(d){De(this,"_isDirected",!0);De(this,"_isMultigraph",!1);De(this,"_isCompound",!1);De(this,"_label");De(this,"_defaultNodeLabelFn",()=>{});De(this,"_defaultEdgeLabelFn",()=>{});De(this,"_nodes",{});De(this,"_in",{});De(this,"_preds",{});De(this,"_out",{});De(this,"_sucs",{});De(this,"_edgeObjs",{});De(this,"_edgeLabels",{});De(this,"_nodeCount",0);De(this,"_edgeCount",0);De(this,"_parent");De(this,"_children");d&&(this._isDirected=Object.hasOwn(d,"directed")?d.directed:!0,this._isMultigraph=Object.hasOwn(d,"multigraph")?d.multigraph:!1,this._isCompound=Object.hasOwn(d,"compound")?d.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(d){return this._label=d,this}graph(){return this._label}setDefaultNodeLabel(d){return this._defaultNodeLabelFn=d,typeof d!="function"&&(this._defaultNodeLabelFn=()=>d),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var d=this;return this.nodes().filter(h=>Object.keys(d._in[h]).length===0)}sinks(){var d=this;return this.nodes().filter(h=>Object.keys(d._out[h]).length===0)}setNodes(d,h){var m=arguments,g=this;return d.forEach(function(v){m.length>1?g.setNode(v,h):g.setNode(v)}),this}setNode(d,h){return Object.hasOwn(this._nodes,d)?(arguments.length>1&&(this._nodes[d]=h),this):(this._nodes[d]=arguments.length>1?h:this._defaultNodeLabelFn(d),this._isCompound&&(this._parent[d]=t,this._children[d]={},this._children[t][d]=!0),this._in[d]={},this._preds[d]={},this._out[d]={},this._sucs[d]={},++this._nodeCount,this)}node(d){return this._nodes[d]}hasNode(d){return Object.hasOwn(this._nodes,d)}removeNode(d){var h=this;if(Object.hasOwn(this._nodes,d)){var m=g=>h.removeEdge(h._edgeObjs[g]);delete this._nodes[d],this._isCompound&&(this._removeFromParentsChildList(d),delete this._parent[d],this.children(d).forEach(function(g){h.setParent(g)}),delete this._children[d]),Object.keys(this._in[d]).forEach(m),delete this._in[d],delete this._preds[d],Object.keys(this._out[d]).forEach(m),delete this._out[d],delete this._sucs[d],--this._nodeCount}return this}setParent(d,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(h===void 0)h=t;else{h+="";for(var m=h;m!==void 0;m=this.parent(m))if(m===d)throw new Error("Setting "+h+" as parent of "+d+" would create a cycle");this.setNode(h)}return this.setNode(d),this._removeFromParentsChildList(d),this._parent[d]=h,this._children[h][d]=!0,this}_removeFromParentsChildList(d){delete this._children[this._parent[d]][d]}parent(d){if(this._isCompound){var h=this._parent[d];if(h!==t)return h}}children(d=t){if(this._isCompound){var h=this._children[d];if(h)return Object.keys(h)}else{if(d===t)return this.nodes();if(this.hasNode(d))return[]}}predecessors(d){var h=this._preds[d];if(h)return Object.keys(h)}successors(d){var h=this._sucs[d];if(h)return Object.keys(h)}neighbors(d){var h=this.predecessors(d);if(h){const g=new Set(h);for(var m of this.successors(d))g.add(m);return Array.from(g.values())}}isLeaf(d){var h;return this.isDirected()?h=this.successors(d):h=this.neighbors(d),h.length===0}filterNodes(d){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var m=this;Object.entries(this._nodes).forEach(function([w,b]){d(w)&&h.setNode(w,b)}),Object.values(this._edgeObjs).forEach(function(w){h.hasNode(w.v)&&h.hasNode(w.w)&&h.setEdge(w,m.edge(w))});var g={};function v(w){var b=m.parent(w);return b===void 0||h.hasNode(b)?(g[w]=b,b):b in g?g[b]:v(b)}return this._isCompound&&h.nodes().forEach(w=>h.setParent(w,v(w))),h}setDefaultEdgeLabel(d){return this._defaultEdgeLabelFn=d,typeof d!="function"&&(this._defaultEdgeLabelFn=()=>d),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(d,h){var m=this,g=arguments;return d.reduce(function(v,w){return g.length>1?m.setEdge(v,w,h):m.setEdge(v,w),w}),this}setEdge(){var d,h,m,g,v=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(d=w.v,h=w.w,m=w.name,arguments.length===2&&(g=arguments[1],v=!0)):(d=w,h=arguments[1],m=arguments[3],arguments.length>2&&(g=arguments[2],v=!0)),d=""+d,h=""+h,m!==void 0&&(m=""+m);var b=o(this._isDirected,d,h,m);if(Object.hasOwn(this._edgeLabels,b))return v&&(this._edgeLabels[b]=g),this;if(m!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(d),this.setNode(h),this._edgeLabels[b]=v?g:this._defaultEdgeLabelFn(d,h,m);var _=l(this._isDirected,d,h,m);return d=_.v,h=_.w,Object.freeze(_),this._edgeObjs[b]=_,i(this._preds[h],d),i(this._sucs[d],h),this._in[h][b]=_,this._out[d][b]=_,this._edgeCount++,this}edge(d,h,m){var g=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,d,h,m);return this._edgeLabels[g]}edgeAsObj(){const d=this.edge(...arguments);return typeof d!="object"?{label:d}:d}hasEdge(d,h,m){var g=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,d,h,m);return Object.hasOwn(this._edgeLabels,g)}removeEdge(d,h,m){var g=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,d,h,m),v=this._edgeObjs[g];return v&&(d=v.v,h=v.w,delete this._edgeLabels[g],delete this._edgeObjs[g],a(this._preds[h],d),a(this._sucs[d],h),delete this._in[h][g],delete this._out[d][g],this._edgeCount--),this}inEdges(d,h){var m=this._in[d];if(m){var g=Object.values(m);return h?g.filter(v=>v.v===h):g}}outEdges(d,h){var m=this._out[d];if(m){var g=Object.values(m);return h?g.filter(v=>v.w===h):g}}nodeEdges(d,h){var m=this.inEdges(d,h);if(m)return m.concat(this.outEdges(d,h))}}function i(f,d){f[d]?f[d]++:f[d]=1}function a(f,d){--f[d]||delete f[d]}function o(f,d,h,m){var g=""+d,v=""+h;if(!f&&g>v){var w=g;g=v,v=w}return g+n+v+n+(m===void 0?e:m)}function l(f,d,h,m){var g=""+d,v=""+h;if(!f&&g>v){var w=g;g=v,v=w}var b={v:g,w:v};return m&&(b.name=m),b}function c(f,d){return o(f,d.v,d.w,d.name)}return R0=r,R0}var j0,jN;function Vre(){return jN||(jN=1,j0="2.2.4"),j0}var M0,MN;function Hre(){return MN||(MN=1,M0={Graph:IS(),version:Vre()}),M0}var $0,$N;function Gre(){if($N)return $0;$N=1;var e=IS();$0={write:t,read:i};function t(a){var o={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:n(a),edges:r(a)};return a.graph()!==void 0&&(o.value=structuredClone(a.graph())),o}function n(a){return a.nodes().map(function(o){var l=a.node(o),c=a.parent(o),f={v:o};return l!==void 0&&(f.value=l),c!==void 0&&(f.parent=c),f})}function r(a){return a.edges().map(function(o){var l=a.edge(o),c={v:o.v,w:o.w};return o.name!==void 0&&(c.name=o.name),l!==void 0&&(c.value=l),c})}function i(a){var o=new e(a.options).setGraph(a.value);return a.nodes.forEach(function(l){o.setNode(l.v,l.value),l.parent&&o.setParent(l.v,l.parent)}),a.edges.forEach(function(l){o.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),o}return $0}var D0,DN;function Yre(){if(DN)return D0;DN=1,D0=e;function e(t){var n={},r=[],i;function a(o){Object.hasOwn(n,o)||(n[o]=!0,i.push(o),t.successors(o).forEach(a),t.predecessors(o).forEach(a))}return t.nodes().forEach(function(o){i=[],a(o),i.length&&r.push(i)}),r}return D0}var I0,IN;function CP(){if(IN)return I0;IN=1;class e{constructor(){De(this,"_arr",[]);De(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,r){var i=this._keyIndices;if(n=String(n),!Object.hasOwn(i,n)){var a=this._arr,o=a.length;return i[n]=o,a.push({key:n,priority:r}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,r){var i=this._keyIndices[n];if(r>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[i].priority+" New: "+r);this._arr[i].priority=r,this._decrease(i)}_heapify(n){var r=this._arr,i=2*n,a=i+1,o=n;i<r.length&&(o=r[i].priority<r[o].priority?i:o,a<r.length&&(o=r[a].priority<r[o].priority?a:o),o!==n&&(this._swap(n,o),this._heapify(o)))}_decrease(n){for(var r=this._arr,i=r[n].priority,a;n!==0&&(a=n>>1,!(r[a].priority<i));)this._swap(n,a),n=a}_swap(n,r){var i=this._arr,a=this._keyIndices,o=i[n],l=i[r];i[n]=l,i[r]=o,a[l.key]=n,a[o.key]=r}}return I0=e,I0}var P0,PN;function OP(){if(PN)return P0;PN=1;var e=CP();P0=n;var t=()=>1;function n(i,a,o,l){return r(i,String(a),o||t,l||function(c){return i.outEdges(c)})}function r(i,a,o,l){var c={},f=new e,d,h,m=function(g){var v=g.v!==d?g.v:g.w,w=c[v],b=o(g),_=h.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+g+" Weight: "+b);_<w.distance&&(w.distance=_,w.predecessor=d,f.decrease(v,_))};for(i.nodes().forEach(function(g){var v=g===a?0:Number.POSITIVE_INFINITY;c[g]={distance:v},f.add(g,v)});f.size()>0&&(d=f.removeMin(),h=c[d],h.distance!==Number.POSITIVE_INFINITY);)l(d).forEach(m);return c}return P0}var L0,LN;function Zre(){if(LN)return L0;LN=1;var e=OP();L0=t;function t(n,r,i){return n.nodes().reduce(function(a,o){return a[o]=e(n,o,r,i),a},{})}return L0}var z0,zN;function NP(){if(zN)return z0;zN=1,z0=e;function e(t){var n=0,r=[],i={},a=[];function o(l){var c=i[l]={onStack:!0,lowlink:n,index:n++};if(r.push(l),t.successors(l).forEach(function(h){Object.hasOwn(i,h)?i[h].onStack&&(c.lowlink=Math.min(c.lowlink,i[h].index)):(o(h),c.lowlink=Math.min(c.lowlink,i[h].lowlink))}),c.lowlink===c.index){var f=[],d;do d=r.pop(),i[d].onStack=!1,f.push(d);while(l!==d);a.push(f)}}return t.nodes().forEach(function(l){Object.hasOwn(i,l)||o(l)}),a}return z0}var q0,qN;function Kre(){if(qN)return q0;qN=1;var e=NP();q0=t;function t(n){return e(n).filter(function(r){return r.length>1||r.length===1&&n.hasEdge(r[0],r[0])})}return q0}var F0,FN;function Xre(){if(FN)return F0;FN=1,F0=t;var e=()=>1;function t(r,i,a){return n(r,i||e,a||function(o){return r.outEdges(o)})}function n(r,i,a){var o={},l=r.nodes();return l.forEach(function(c){o[c]={},o[c][c]={distance:0},l.forEach(function(f){c!==f&&(o[c][f]={distance:Number.POSITIVE_INFINITY})}),a(c).forEach(function(f){var d=f.v===c?f.w:f.v,h=i(f);o[c][d]={distance:h,predecessor:c}})}),l.forEach(function(c){var f=o[c];l.forEach(function(d){var h=o[d];l.forEach(function(m){var g=h[c],v=f[m],w=h[m],b=g.distance+v.distance;b<w.distance&&(w.distance=b,w.predecessor=v.predecessor)})})}),o}return F0}var B0,BN;function RP(){if(BN)return B0;BN=1;function e(n){var r={},i={},a=[];function o(l){if(Object.hasOwn(i,l))throw new t;Object.hasOwn(r,l)||(i[l]=!0,r[l]=!0,n.predecessors(l).forEach(o),delete i[l],a.push(l))}if(n.sinks().forEach(o),Object.keys(r).length!==n.nodeCount())throw new t;return a}class t extends Error{constructor(){super(...arguments)}}return B0=e,e.CycleException=t,B0}var U0,UN;function Wre(){if(UN)return U0;UN=1;var e=RP();U0=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return U0}var V0,VN;function jP(){if(VN)return V0;VN=1,V0=e;function e(i,a,o){Array.isArray(a)||(a=[a]);var l=i.isDirected()?h=>i.successors(h):h=>i.neighbors(h),c=o==="post"?t:n,f=[],d={};return a.forEach(h=>{if(!i.hasNode(h))throw new Error("Graph does not have node: "+h);c(h,l,d,f)}),f}function t(i,a,o,l){for(var c=[[i,!1]];c.length>0;){var f=c.pop();f[1]?l.push(f[0]):Object.hasOwn(o,f[0])||(o[f[0]]=!0,c.push([f[0],!0]),r(a(f[0]),d=>c.push([d,!1])))}}function n(i,a,o,l){for(var c=[i];c.length>0;){var f=c.pop();Object.hasOwn(o,f)||(o[f]=!0,l.push(f),r(a(f),d=>c.push(d)))}}function r(i,a){for(var o=i.length;o--;)a(i[o],o,i);return i}return V0}var H0,HN;function Qre(){if(HN)return H0;HN=1;var e=jP();H0=t;function t(n,r){return e(n,r,"post")}return H0}var G0,GN;function Jre(){if(GN)return G0;GN=1;var e=jP();G0=t;function t(n,r){return e(n,r,"pre")}return G0}var Y0,YN;function eie(){if(YN)return Y0;YN=1;var e=IS(),t=CP();Y0=n;function n(r,i){var a=new e,o={},l=new t,c;function f(h){var m=h.v===c?h.w:h.v,g=l.priority(m);if(g!==void 0){var v=i(h);v<g&&(o[m]=c,l.decrease(m,v))}}if(r.nodeCount()===0)return a;r.nodes().forEach(function(h){l.add(h,Number.POSITIVE_INFINITY),a.setNode(h)}),l.decrease(r.nodes()[0],0);for(var d=!1;l.size()>0;){if(c=l.removeMin(),Object.hasOwn(o,c))a.setEdge(c,o[c]);else{if(d)throw new Error("Input graph is not connected: "+r);d=!0}r.nodeEdges(c).forEach(f)}return a}return Y0}var Z0,ZN;function tie(){return ZN||(ZN=1,Z0={components:Yre(),dijkstra:OP(),dijkstraAll:Zre(),findCycles:Kre(),floydWarshall:Xre(),isAcyclic:Wre(),postorder:Qre(),preorder:Jre(),prim:eie(),tarjan:NP(),topsort:RP()}),Z0}var K0,KN;function Ir(){if(KN)return K0;KN=1;var e=Hre();return K0={Graph:e.Graph,json:Gre(),alg:tie(),version:e.version},K0}var X0,XN;function nie(){if(XN)return X0;XN=1;class e{constructor(){let i={};i._next=i._prev=i,this._sentinel=i}dequeue(){let i=this._sentinel,a=i._prev;if(a!==i)return t(a),a}enqueue(i){let a=this._sentinel;i._prev&&i._next&&t(i),i._next=a._next,a._next._prev=i,a._next=i,i._prev=a}toString(){let i=[],a=this._sentinel,o=a._prev;for(;o!==a;)i.push(JSON.stringify(o,n)),o=o._prev;return"["+i.join(", ")+"]"}}function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,i){if(r!=="_next"&&r!=="_prev")return i}return X0=e,X0}var W0,WN;function rie(){if(WN)return W0;WN=1;let e=Ir().Graph,t=nie();W0=r;let n=()=>1;function r(f,d){if(f.nodeCount()<=1)return[];let h=o(f,d||n);return i(h.graph,h.buckets,h.zeroIdx).flatMap(g=>f.outEdges(g.v,g.w))}function i(f,d,h){let m=[],g=d[d.length-1],v=d[0],w;for(;f.nodeCount();){for(;w=v.dequeue();)a(f,d,h,w);for(;w=g.dequeue();)a(f,d,h,w);if(f.nodeCount()){for(let b=d.length-2;b>0;--b)if(w=d[b].dequeue(),w){m=m.concat(a(f,d,h,w,!0));break}}}return m}function a(f,d,h,m,g){let v=g?[]:void 0;return f.inEdges(m.v).forEach(w=>{let b=f.edge(w),_=f.node(w.v);g&&v.push({v:w.v,w:w.w}),_.out-=b,l(d,h,_)}),f.outEdges(m.v).forEach(w=>{let b=f.edge(w),_=w.w,S=f.node(_);S.in-=b,l(d,h,S)}),f.removeNode(m.v),v}function o(f,d){let h=new e,m=0,g=0;f.nodes().forEach(b=>{h.setNode(b,{v:b,in:0,out:0})}),f.edges().forEach(b=>{let _=h.edge(b.v,b.w)||0,S=d(b),x=_+S;h.setEdge(b.v,b.w,x),g=Math.max(g,h.node(b.v).out+=S),m=Math.max(m,h.node(b.w).in+=S)});let v=c(g+m+3).map(()=>new t),w=m+1;return h.nodes().forEach(b=>{l(v,w,h.node(b))}),{graph:h,buckets:v,zeroIdx:w}}function l(f,d,h){h.out?h.in?f[h.out-h.in+d].enqueue(h):f[f.length-1].enqueue(h):f[0].enqueue(h)}function c(f){const d=[];for(let h=0;h<f;h++)d.push(h);return d}return W0}var Q0,QN;function Jt(){if(QN)return Q0;QN=1;let e=Ir().Graph;Q0={addBorderNode:d,addDummyNode:t,applyWithChunking:g,asNonCompoundGraph:r,buildLayerMatrix:l,intersectRect:o,mapValues:T,maxRank:v,normalizeRanks:c,notime:_,partition:w,pick:k,predecessorWeights:a,range:A,removeEmptyRanks:f,simplify:n,successorWeights:i,time:b,uniqueId:x,zipObject:O};function t($,L,M,z){let P;do P=x(z);while($.hasNode(P));return M.dummy=L,$.setNode(P,M),P}function n($){let L=new e().setGraph($.graph());return $.nodes().forEach(M=>L.setNode(M,$.node(M))),$.edges().forEach(M=>{let z=L.edge(M.v,M.w)||{weight:0,minlen:1},P=$.edge(M);L.setEdge(M.v,M.w,{weight:z.weight+P.weight,minlen:Math.max(z.minlen,P.minlen)})}),L}function r($){let L=new e({multigraph:$.isMultigraph()}).setGraph($.graph());return $.nodes().forEach(M=>{$.children(M).length||L.setNode(M,$.node(M))}),$.edges().forEach(M=>{L.setEdge(M,$.edge(M))}),L}function i($){let L=$.nodes().map(M=>{let z={};return $.outEdges(M).forEach(P=>{z[P.w]=(z[P.w]||0)+$.edge(P).weight}),z});return O($.nodes(),L)}function a($){let L=$.nodes().map(M=>{let z={};return $.inEdges(M).forEach(P=>{z[P.v]=(z[P.v]||0)+$.edge(P).weight}),z});return O($.nodes(),L)}function o($,L){let M=$.x,z=$.y,P=L.x-M,q=L.y-z,D=$.width/2,H=$.height/2;if(!P&&!q)throw new Error("Not possible to find intersection inside of the rectangle");let B,G;return Math.abs(q)*D>Math.abs(P)*H?(q<0&&(H=-H),B=H*P/q,G=H):(P<0&&(D=-D),B=D,G=D*q/P),{x:M+B,y:z+G}}function l($){let L=A(v($)+1).map(()=>[]);return $.nodes().forEach(M=>{let z=$.node(M),P=z.rank;P!==void 0&&(L[P][z.order]=M)}),L}function c($){let L=$.nodes().map(z=>{let P=$.node(z).rank;return P===void 0?Number.MAX_VALUE:P}),M=g(Math.min,L);$.nodes().forEach(z=>{let P=$.node(z);Object.hasOwn(P,"rank")&&(P.rank-=M)})}function f($){let L=$.nodes().map(D=>$.node(D).rank),M=g(Math.min,L),z=[];$.nodes().forEach(D=>{let H=$.node(D).rank-M;z[H]||(z[H]=[]),z[H].push(D)});let P=0,q=$.graph().nodeRankFactor;Array.from(z).forEach((D,H)=>{D===void 0&&H%q!==0?--P:D!==void 0&&P&&D.forEach(B=>$.node(B).rank+=P)})}function d($,L,M,z){let P={width:0,height:0};return arguments.length>=4&&(P.rank=M,P.order=z),t($,"border",P,L)}function h($,L=m){const M=[];for(let z=0;z<$.length;z+=L){const P=$.slice(z,z+L);M.push(P)}return M}const m=65535;function g($,L){if(L.length>m){const M=h(L);return $.apply(null,M.map(z=>$.apply(null,z)))}else return $.apply(null,L)}function v($){const M=$.nodes().map(z=>{let P=$.node(z).rank;return P===void 0?Number.MIN_VALUE:P});return g(Math.max,M)}function w($,L){let M={lhs:[],rhs:[]};return $.forEach(z=>{L(z)?M.lhs.push(z):M.rhs.push(z)}),M}function b($,L){let M=Date.now();try{return L()}finally{console.log($+" time: "+(Date.now()-M)+"ms")}}function _($,L){return L()}let S=0;function x($){var L=++S;return toString($)+L}function A($,L,M=1){L==null&&(L=$,$=0);let z=q=>q<L;M<0&&(z=q=>L<q);const P=[];for(let q=$;z(q);q+=M)P.push(q);return P}function k($,L){const M={};for(const z of L)$[z]!==void 0&&(M[z]=$[z]);return M}function T($,L){let M=L;return typeof L=="string"&&(M=z=>z[L]),Object.entries($).reduce((z,[P,q])=>(z[P]=M(q,P),z),{})}function O($,L){return $.reduce((M,z,P)=>(M[z]=L[P],M),{})}return Q0}var J0,JN;function iie(){if(JN)return J0;JN=1;let e=rie(),t=Jt().uniqueId;J0={run:n,undo:i};function n(a){(a.graph().acyclicer==="greedy"?e(a,l(a)):r(a)).forEach(c=>{let f=a.edge(c);a.removeEdge(c),f.forwardName=c.name,f.reversed=!0,a.setEdge(c.w,c.v,f,t("rev"))});function l(c){return f=>c.edge(f).weight}}function r(a){let o=[],l={},c={};function f(d){Object.hasOwn(c,d)||(c[d]=!0,l[d]=!0,a.outEdges(d).forEach(h=>{Object.hasOwn(l,h.w)?o.push(h):f(h.w)}),delete l[d])}return a.nodes().forEach(f),o}function i(a){a.edges().forEach(o=>{let l=a.edge(o);if(l.reversed){a.removeEdge(o);let c=l.forwardName;delete l.reversed,delete l.forwardName,a.setEdge(o.w,o.v,l,c)}})}return J0}var eb,eR;function aie(){if(eR)return eb;eR=1;let e=Jt();eb={run:t,undo:r};function t(i){i.graph().dummyChains=[],i.edges().forEach(a=>n(i,a))}function n(i,a){let o=a.v,l=i.node(o).rank,c=a.w,f=i.node(c).rank,d=a.name,h=i.edge(a),m=h.labelRank;if(f===l+1)return;i.removeEdge(a);let g,v,w;for(w=0,++l;l<f;++w,++l)h.points=[],v={width:0,height:0,edgeLabel:h,edgeObj:a,rank:l},g=e.addDummyNode(i,"edge",v,"_d"),l===m&&(v.width=h.width,v.height=h.height,v.dummy="edge-label",v.labelpos=h.labelpos),i.setEdge(o,g,{weight:h.weight},d),w===0&&i.graph().dummyChains.push(g),o=g;i.setEdge(o,c,{weight:h.weight},d)}function r(i){i.graph().dummyChains.forEach(a=>{let o=i.node(a),l=o.edgeLabel,c;for(i.setEdge(o.edgeObj,l);o.dummy;)c=i.successors(a)[0],i.removeNode(a),l.points.push({x:o.x,y:o.y}),o.dummy==="edge-label"&&(l.x=o.x,l.y=o.y,l.width=o.width,l.height=o.height),a=c,o=i.node(a)})}return eb}var tb,tR;function sp(){if(tR)return tb;tR=1;const{applyWithChunking:e}=Jt();tb={longestPath:t,slack:n};function t(r){var i={};function a(o){var l=r.node(o);if(Object.hasOwn(i,o))return l.rank;i[o]=!0;let c=r.outEdges(o).map(d=>d==null?Number.POSITIVE_INFINITY:a(d.w)-r.edge(d).minlen);var f=e(Math.min,c);return f===Number.POSITIVE_INFINITY&&(f=0),l.rank=f}r.sources().forEach(a)}function n(r,i){return r.node(i.w).rank-r.node(i.v).rank-r.edge(i).minlen}return tb}var nb,nR;function MP(){if(nR)return nb;nR=1;var e=Ir().Graph,t=sp().slack;nb=n;function n(o){var l=new e({directed:!1}),c=o.nodes()[0],f=o.nodeCount();l.setNode(c,{});for(var d,h;r(l,o)<f;)d=i(l,o),h=l.hasNode(d.v)?t(o,d):-t(o,d),a(l,o,h);return l}function r(o,l){function c(f){l.nodeEdges(f).forEach(d=>{var h=d.v,m=f===h?d.w:h;!o.hasNode(m)&&!t(l,d)&&(o.setNode(m,{}),o.setEdge(f,m,{}),c(m))})}return o.nodes().forEach(c),o.nodeCount()}function i(o,l){return l.edges().reduce((f,d)=>{let h=Number.POSITIVE_INFINITY;return o.hasNode(d.v)!==o.hasNode(d.w)&&(h=t(l,d)),h<f[0]?[h,d]:f},[Number.POSITIVE_INFINITY,null])[1]}function a(o,l,c){o.nodes().forEach(f=>l.node(f).rank+=c)}return nb}var rb,rR;function sie(){if(rR)return rb;rR=1;var e=MP(),t=sp().slack,n=sp().longestPath,r=Ir().alg.preorder,i=Ir().alg.postorder,a=Jt().simplify;rb=o,o.initLowLimValues=d,o.initCutValues=l,o.calcCutValue=f,o.leaveEdge=m,o.enterEdge=g,o.exchangeEdges=v;function o(S){S=a(S),n(S);var x=e(S);d(x),l(x,S);for(var A,k;A=m(x);)k=g(x,S,A),v(x,S,A,k)}function l(S,x){var A=i(S,S.nodes());A=A.slice(0,A.length-1),A.forEach(k=>c(S,x,k))}function c(S,x,A){var k=S.node(A),T=k.parent;S.edge(A,T).cutvalue=f(S,x,A)}function f(S,x,A){var k=S.node(A),T=k.parent,O=!0,$=x.edge(A,T),L=0;return $||(O=!1,$=x.edge(T,A)),L=$.weight,x.nodeEdges(A).forEach(M=>{var z=M.v===A,P=z?M.w:M.v;if(P!==T){var q=z===O,D=x.edge(M).weight;if(L+=q?D:-D,b(S,A,P)){var H=S.edge(A,P).cutvalue;L+=q?-H:H}}}),L}function d(S,x){arguments.length<2&&(x=S.nodes()[0]),h(S,{},1,x)}function h(S,x,A,k,T){var O=A,$=S.node(k);return x[k]=!0,S.neighbors(k).forEach(L=>{Object.hasOwn(x,L)||(A=h(S,x,A,L,k))}),$.low=O,$.lim=A++,T?$.parent=T:delete $.parent,A}function m(S){return S.edges().find(x=>S.edge(x).cutvalue<0)}function g(S,x,A){var k=A.v,T=A.w;x.hasEdge(k,T)||(k=A.w,T=A.v);var O=S.node(k),$=S.node(T),L=O,M=!1;O.lim>$.lim&&(L=$,M=!0);var z=x.edges().filter(P=>M===_(S,S.node(P.v),L)&&M!==_(S,S.node(P.w),L));return z.reduce((P,q)=>t(x,q)<t(x,P)?q:P)}function v(S,x,A,k){var T=A.v,O=A.w;S.removeEdge(T,O),S.setEdge(k.v,k.w,{}),d(S),l(S,x),w(S,x)}function w(S,x){var A=S.nodes().find(T=>!x.node(T).parent),k=r(S,A);k=k.slice(1),k.forEach(T=>{var O=S.node(T).parent,$=x.edge(T,O),L=!1;$||($=x.edge(O,T),L=!0),x.node(T).rank=x.node(O).rank+(L?$.minlen:-$.minlen)})}function b(S,x,A){return S.hasEdge(x,A)}function _(S,x,A){return A.low<=x.lim&&x.lim<=A.lim}return rb}var ib,iR;function oie(){if(iR)return ib;iR=1;var e=sp(),t=e.longestPath,n=MP(),r=sie();ib=i;function i(c){switch(c.graph().ranker){case"network-simplex":l(c);break;case"tight-tree":o(c);break;case"longest-path":a(c);break;default:l(c)}}var a=t;function o(c){t(c),n(c)}function l(c){r(c)}return ib}var ab,aR;function lie(){if(aR)return ab;aR=1,ab=e;function e(r){let i=n(r);r.graph().dummyChains.forEach(a=>{let o=r.node(a),l=o.edgeObj,c=t(r,i,l.v,l.w),f=c.path,d=c.lca,h=0,m=f[h],g=!0;for(;a!==l.w;){if(o=r.node(a),g){for(;(m=f[h])!==d&&r.node(m).maxRank<o.rank;)h++;m===d&&(g=!1)}if(!g){for(;h<f.length-1&&r.node(m=f[h+1]).minRank<=o.rank;)h++;m=f[h]}r.setParent(a,m),a=r.successors(a)[0]}})}function t(r,i,a,o){let l=[],c=[],f=Math.min(i[a].low,i[o].low),d=Math.max(i[a].lim,i[o].lim),h,m;h=a;do h=r.parent(h),l.push(h);while(h&&(i[h].low>f||d>i[h].lim));for(m=h,h=o;(h=r.parent(h))!==m;)c.push(h);return{path:l.concat(c.reverse()),lca:m}}function n(r){let i={},a=0;function o(l){let c=a;r.children(l).forEach(o),i[l]={low:c,lim:a++}}return r.children().forEach(o),i}return ab}var sb,sR;function uie(){if(sR)return sb;sR=1;let e=Jt();sb={run:t,cleanup:a};function t(o){let l=e.addDummyNode(o,"root",{},"_root"),c=r(o),f=Object.values(c),d=e.applyWithChunking(Math.max,f)-1,h=2*d+1;o.graph().nestingRoot=l,o.edges().forEach(g=>o.edge(g).minlen*=h);let m=i(o)+1;o.children().forEach(g=>n(o,l,h,m,d,c,g)),o.graph().nodeRankFactor=h}function n(o,l,c,f,d,h,m){let g=o.children(m);if(!g.length){m!==l&&o.setEdge(l,m,{weight:0,minlen:c});return}let v=e.addBorderNode(o,"_bt"),w=e.addBorderNode(o,"_bb"),b=o.node(m);o.setParent(v,m),b.borderTop=v,o.setParent(w,m),b.borderBottom=w,g.forEach(_=>{n(o,l,c,f,d,h,_);let S=o.node(_),x=S.borderTop?S.borderTop:_,A=S.borderBottom?S.borderBottom:_,k=S.borderTop?f:2*f,T=x!==A?1:d-h[m]+1;o.setEdge(v,x,{weight:k,minlen:T,nestingEdge:!0}),o.setEdge(A,w,{weight:k,minlen:T,nestingEdge:!0})}),o.parent(m)||o.setEdge(l,v,{weight:0,minlen:d+h[m]})}function r(o){var l={};function c(f,d){var h=o.children(f);h&&h.length&&h.forEach(m=>c(m,d+1)),l[f]=d}return o.children().forEach(f=>c(f,1)),l}function i(o){return o.edges().reduce((l,c)=>l+o.edge(c).weight,0)}function a(o){var l=o.graph();o.removeNode(l.nestingRoot),delete l.nestingRoot,o.edges().forEach(c=>{var f=o.edge(c);f.nestingEdge&&o.removeEdge(c)})}return sb}var ob,oR;function cie(){if(oR)return ob;oR=1;let e=Jt();ob=t;function t(r){function i(a){let o=r.children(a),l=r.node(a);if(o.length&&o.forEach(i),Object.hasOwn(l,"minRank")){l.borderLeft=[],l.borderRight=[];for(let c=l.minRank,f=l.maxRank+1;c<f;++c)n(r,"borderLeft","_bl",a,l,c),n(r,"borderRight","_br",a,l,c)}}r.children().forEach(i)}function n(r,i,a,o,l,c){let f={width:0,height:0,rank:c,borderType:i},d=l[i][c-1],h=e.addDummyNode(r,"border",f,a);l[i][c]=h,r.setParent(h,o),d&&r.setEdge(d,h,{weight:1})}return ob}var lb,lR;function fie(){if(lR)return lb;lR=1,lb={adjust:e,undo:t};function e(c){let f=c.graph().rankdir.toLowerCase();(f==="lr"||f==="rl")&&n(c)}function t(c){let f=c.graph().rankdir.toLowerCase();(f==="bt"||f==="rl")&&i(c),(f==="lr"||f==="rl")&&(o(c),n(c))}function n(c){c.nodes().forEach(f=>r(c.node(f))),c.edges().forEach(f=>r(c.edge(f)))}function r(c){let f=c.width;c.width=c.height,c.height=f}function i(c){c.nodes().forEach(f=>a(c.node(f))),c.edges().forEach(f=>{let d=c.edge(f);d.points.forEach(a),Object.hasOwn(d,"y")&&a(d)})}function a(c){c.y=-c.y}function o(c){c.nodes().forEach(f=>l(c.node(f))),c.edges().forEach(f=>{let d=c.edge(f);d.points.forEach(l),Object.hasOwn(d,"x")&&l(d)})}function l(c){let f=c.x;c.x=c.y,c.y=f}return lb}var ub,uR;function die(){if(uR)return ub;uR=1;let e=Jt();ub=t;function t(n){let r={},i=n.nodes().filter(d=>!n.children(d).length),a=i.map(d=>n.node(d).rank),o=e.applyWithChunking(Math.max,a),l=e.range(o+1).map(()=>[]);function c(d){if(r[d])return;r[d]=!0;let h=n.node(d);l[h.rank].push(d),n.successors(d).forEach(c)}return i.sort((d,h)=>n.node(d).rank-n.node(h).rank).forEach(c),l}return ub}var cb,cR;function hie(){if(cR)return cb;cR=1;let e=Jt().zipObject;cb=t;function t(r,i){let a=0;for(let o=1;o<i.length;++o)a+=n(r,i[o-1],i[o]);return a}function n(r,i,a){let o=e(a,a.map((m,g)=>g)),l=i.flatMap(m=>r.outEdges(m).map(g=>({pos:o[g.w],weight:r.edge(g).weight})).sort((g,v)=>g.pos-v.pos)),c=1;for(;c<a.length;)c<<=1;let f=2*c-1;c-=1;let d=new Array(f).fill(0),h=0;return l.forEach(m=>{let g=m.pos+c;d[g]+=m.weight;let v=0;for(;g>0;)g%2&&(v+=d[g+1]),g=g-1>>1,d[g]+=m.weight;h+=m.weight*v}),h}return cb}var fb,fR;function pie(){if(fR)return fb;fR=1,fb=e;function e(t,n=[]){return n.map(r=>{let i=t.inEdges(r);if(i.length){let a=i.reduce((o,l)=>{let c=t.edge(l),f=t.node(l.v);return{sum:o.sum+c.weight*f.order,weight:o.weight+c.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}return fb}var db,dR;function mie(){if(dR)return db;dR=1;let e=Jt();db=t;function t(i,a){let o={};i.forEach((c,f)=>{let d=o[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:f};c.barycenter!==void 0&&(d.barycenter=c.barycenter,d.weight=c.weight)}),a.edges().forEach(c=>{let f=o[c.v],d=o[c.w];f!==void 0&&d!==void 0&&(d.indegree++,f.out.push(o[c.w]))});let l=Object.values(o).filter(c=>!c.indegree);return n(l)}function n(i){let a=[];function o(c){return f=>{f.merged||(f.barycenter===void 0||c.barycenter===void 0||f.barycenter>=c.barycenter)&&r(c,f)}}function l(c){return f=>{f.in.push(c),--f.indegree===0&&i.push(f)}}for(;i.length;){let c=i.pop();a.push(c),c.in.reverse().forEach(o(c)),c.out.forEach(l(c))}return a.filter(c=>!c.merged).map(c=>e.pick(c,["vs","i","barycenter","weight"]))}function r(i,a){let o=0,l=0;i.weight&&(o+=i.barycenter*i.weight,l+=i.weight),a.weight&&(o+=a.barycenter*a.weight,l+=a.weight),i.vs=a.vs.concat(i.vs),i.barycenter=o/l,i.weight=l,i.i=Math.min(a.i,i.i),a.merged=!0}return db}var hb,hR;function gie(){if(hR)return hb;hR=1;let e=Jt();hb=t;function t(i,a){let o=e.partition(i,v=>Object.hasOwn(v,"barycenter")),l=o.lhs,c=o.rhs.sort((v,w)=>w.i-v.i),f=[],d=0,h=0,m=0;l.sort(r(!!a)),m=n(f,c,m),l.forEach(v=>{m+=v.vs.length,f.push(v.vs),d+=v.barycenter*v.weight,h+=v.weight,m=n(f,c,m)});let g={vs:f.flat(!0)};return h&&(g.barycenter=d/h,g.weight=h),g}function n(i,a,o){let l;for(;a.length&&(l=a[a.length-1]).i<=o;)a.pop(),i.push(l.vs),o++;return o}function r(i){return(a,o)=>a.barycenter<o.barycenter?-1:a.barycenter>o.barycenter?1:i?o.i-a.i:a.i-o.i}return hb}var pb,pR;function yie(){if(pR)return pb;pR=1;let e=pie(),t=mie(),n=gie();pb=r;function r(o,l,c,f){let d=o.children(l),h=o.node(l),m=h?h.borderLeft:void 0,g=h?h.borderRight:void 0,v={};m&&(d=d.filter(S=>S!==m&&S!==g));let w=e(o,d);w.forEach(S=>{if(o.children(S.v).length){let x=r(o,S.v,c,f);v[S.v]=x,Object.hasOwn(x,"barycenter")&&a(S,x)}});let b=t(w,c);i(b,v);let _=n(b,f);if(m&&(_.vs=[m,_.vs,g].flat(!0),o.predecessors(m).length)){let S=o.node(o.predecessors(m)[0]),x=o.node(o.predecessors(g)[0]);Object.hasOwn(_,"barycenter")||(_.barycenter=0,_.weight=0),_.barycenter=(_.barycenter*_.weight+S.order+x.order)/(_.weight+2),_.weight+=2}return _}function i(o,l){o.forEach(c=>{c.vs=c.vs.flatMap(f=>l[f]?l[f].vs:f)})}function a(o,l){o.barycenter!==void 0?(o.barycenter=(o.barycenter*o.weight+l.barycenter*l.weight)/(o.weight+l.weight),o.weight+=l.weight):(o.barycenter=l.barycenter,o.weight=l.weight)}return pb}var mb,mR;function bie(){if(mR)return mb;mR=1;let e=Ir().Graph,t=Jt();mb=n;function n(i,a,o){let l=r(i),c=new e({compound:!0}).setGraph({root:l}).setDefaultNodeLabel(f=>i.node(f));return i.nodes().forEach(f=>{let d=i.node(f),h=i.parent(f);(d.rank===a||d.minRank<=a&&a<=d.maxRank)&&(c.setNode(f),c.setParent(f,h||l),i[o](f).forEach(m=>{let g=m.v===f?m.w:m.v,v=c.edge(g,f),w=v!==void 0?v.weight:0;c.setEdge(g,f,{weight:i.edge(m).weight+w})}),Object.hasOwn(d,"minRank")&&c.setNode(f,{borderLeft:d.borderLeft[a],borderRight:d.borderRight[a]}))}),c}function r(i){for(var a;i.hasNode(a=t.uniqueId("_root")););return a}return mb}var gb,gR;function vie(){if(gR)return gb;gR=1,gb=e;function e(t,n,r){let i={},a;r.forEach(o=>{let l=t.parent(o),c,f;for(;l;){if(c=t.parent(l),c?(f=i[c],i[c]=l):(f=a,a=l),f&&f!==l){n.setEdge(f,l);return}l=c}})}return gb}var yb,yR;function _ie(){if(yR)return yb;yR=1;let e=die(),t=hie(),n=yie(),r=bie(),i=vie(),a=Ir().Graph,o=Jt();yb=l;function l(h,m){if(m&&typeof m.customOrder=="function"){m.customOrder(h,l);return}let g=o.maxRank(h),v=c(h,o.range(1,g+1),"inEdges"),w=c(h,o.range(g-1,-1,-1),"outEdges"),b=e(h);if(d(h,b),m&&m.disableOptimalOrderHeuristic)return;let _=Number.POSITIVE_INFINITY,S;for(let x=0,A=0;A<4;++x,++A){f(x%2?v:w,x%4>=2),b=o.buildLayerMatrix(h);let k=t(h,b);k<_&&(A=0,S=Object.assign({},b),_=k)}d(h,S)}function c(h,m,g){return m.map(function(v){return r(h,v,g)})}function f(h,m){let g=new a;h.forEach(function(v){let w=v.graph().root,b=n(v,w,g,m);b.vs.forEach((_,S)=>v.node(_).order=S),i(v,g,b.vs)})}function d(h,m){Object.values(m).forEach(g=>g.forEach((v,w)=>h.node(v).order=w))}return yb}var bb,bR;function xie(){if(bR)return bb;bR=1;let e=Ir().Graph,t=Jt();bb={positionX:g,findType1Conflicts:n,findType2Conflicts:r,addConflict:a,hasConflict:o,verticalAlignment:l,horizontalCompaction:c,alignCoordinates:h,findSmallestWidthAlignment:d,balance:m};function n(b,_){let S={};function x(A,k){let T=0,O=0,$=A.length,L=k[k.length-1];return k.forEach((M,z)=>{let P=i(b,M),q=P?b.node(P).order:$;(P||M===L)&&(k.slice(O,z+1).forEach(D=>{b.predecessors(D).forEach(H=>{let B=b.node(H),G=B.order;(G<T||q<G)&&!(B.dummy&&b.node(D).dummy)&&a(S,H,D)})}),O=z+1,T=q)}),k}return _.length&&_.reduce(x),S}function r(b,_){let S={};function x(k,T,O,$,L){let M;t.range(T,O).forEach(z=>{M=k[z],b.node(M).dummy&&b.predecessors(M).forEach(P=>{let q=b.node(P);q.dummy&&(q.order<$||q.order>L)&&a(S,P,M)})})}function A(k,T){let O=-1,$,L=0;return T.forEach((M,z)=>{if(b.node(M).dummy==="border"){let P=b.predecessors(M);P.length&&($=b.node(P[0]).order,x(T,L,z,O,$),L=z,O=$)}x(T,L,T.length,$,k.length)}),T}return _.length&&_.reduce(A),S}function i(b,_){if(b.node(_).dummy)return b.predecessors(_).find(S=>b.node(S).dummy)}function a(b,_,S){if(_>S){let A=_;_=S,S=A}let x=b[_];x||(b[_]=x={}),x[S]=!0}function o(b,_,S){if(_>S){let x=_;_=S,S=x}return!!b[_]&&Object.hasOwn(b[_],S)}function l(b,_,S,x){let A={},k={},T={};return _.forEach(O=>{O.forEach(($,L)=>{A[$]=$,k[$]=$,T[$]=L})}),_.forEach(O=>{let $=-1;O.forEach(L=>{let M=x(L);if(M.length){M=M.sort((P,q)=>T[P]-T[q]);let z=(M.length-1)/2;for(let P=Math.floor(z),q=Math.ceil(z);P<=q;++P){let D=M[P];k[L]===L&&$<T[D]&&!o(S,L,D)&&(k[D]=L,k[L]=A[L]=A[D],$=T[D])}}})}),{root:A,align:k}}function c(b,_,S,x,A){let k={},T=f(b,_,S,A),O=A?"borderLeft":"borderRight";function $(z,P){let q=T.nodes(),D=q.pop(),H={};for(;D;)H[D]?z(D):(H[D]=!0,q.push(D),q=q.concat(P(D))),D=q.pop()}function L(z){k[z]=T.inEdges(z).reduce((P,q)=>Math.max(P,k[q.v]+T.edge(q)),0)}function M(z){let P=T.outEdges(z).reduce((D,H)=>Math.min(D,k[H.w]-T.edge(H)),Number.POSITIVE_INFINITY),q=b.node(z);P!==Number.POSITIVE_INFINITY&&q.borderType!==O&&(k[z]=Math.max(k[z],P))}return $(L,T.predecessors.bind(T)),$(M,T.successors.bind(T)),Object.keys(x).forEach(z=>k[z]=k[S[z]]),k}function f(b,_,S,x){let A=new e,k=b.graph(),T=v(k.nodesep,k.edgesep,x);return _.forEach(O=>{let $;O.forEach(L=>{let M=S[L];if(A.setNode(M),$){var z=S[$],P=A.edge(z,M);A.setEdge(z,M,Math.max(T(b,L,$),P||0))}$=L})}),A}function d(b,_){return Object.values(_).reduce((S,x)=>{let A=Number.NEGATIVE_INFINITY,k=Number.POSITIVE_INFINITY;Object.entries(x).forEach(([O,$])=>{let L=w(b,O)/2;A=Math.max($+L,A),k=Math.min($-L,k)});const T=A-k;return T<S[0]&&(S=[T,x]),S},[Number.POSITIVE_INFINITY,null])[1]}function h(b,_){let S=Object.values(_),x=t.applyWithChunking(Math.min,S),A=t.applyWithChunking(Math.max,S);["u","d"].forEach(k=>{["l","r"].forEach(T=>{let O=k+T,$=b[O];if($===_)return;let L=Object.values($),M=x-t.applyWithChunking(Math.min,L);T!=="l"&&(M=A-t.applyWithChunking(Math.max,L)),M&&(b[O]=t.mapValues($,z=>z+M))})})}function m(b,_){return t.mapValues(b.ul,(S,x)=>{if(_)return b[_.toLowerCase()][x];{let A=Object.values(b).map(k=>k[x]).sort((k,T)=>k-T);return(A[1]+A[2])/2}})}function g(b){let _=t.buildLayerMatrix(b),S=Object.assign(n(b,_),r(b,_)),x={},A;["u","d"].forEach(T=>{A=T==="u"?_:Object.values(_).reverse(),["l","r"].forEach(O=>{O==="r"&&(A=A.map(z=>Object.values(z).reverse()));let $=(T==="u"?b.predecessors:b.successors).bind(b),L=l(b,A,S,$),M=c(b,A,L.root,L.align,O==="r");O==="r"&&(M=t.mapValues(M,z=>-z)),x[T+O]=M})});let k=d(b,x);return h(x,k),m(x,b.graph().align)}function v(b,_,S){return(x,A,k)=>{let T=x.node(A),O=x.node(k),$=0,L;if($+=T.width/2,Object.hasOwn(T,"labelpos"))switch(T.labelpos.toLowerCase()){case"l":L=-T.width/2;break;case"r":L=T.width/2;break}if(L&&($+=S?L:-L),L=0,$+=(T.dummy?_:b)/2,$+=(O.dummy?_:b)/2,$+=O.width/2,Object.hasOwn(O,"labelpos"))switch(O.labelpos.toLowerCase()){case"l":L=O.width/2;break;case"r":L=-O.width/2;break}return L&&($+=S?L:-L),L=0,$}}function w(b,_){return b.node(_).width}return bb}var vb,vR;function wie(){if(vR)return vb;vR=1;let e=Jt(),t=xie().positionX;vb=n;function n(i){i=e.asNonCompoundGraph(i),r(i),Object.entries(t(i)).forEach(([a,o])=>i.node(a).x=o)}function r(i){let a=e.buildLayerMatrix(i),o=i.graph().ranksep,l=0;a.forEach(c=>{const f=c.reduce((d,h)=>{const m=i.node(h).height;return d>m?d:m},0);c.forEach(d=>i.node(d).y=l+f/2),l+=f+o})}return vb}var _b,_R;function Sie(){if(_R)return _b;_R=1;let e=iie(),t=aie(),n=oie(),r=Jt().normalizeRanks,i=lie(),a=Jt().removeEmptyRanks,o=uie(),l=cie(),c=fie(),f=_ie(),d=wie(),h=Jt(),m=Ir().Graph;_b=g;function g(j,I){let U=I&&I.debugTiming?h.time:h.notime;U("layout",()=>{let Y=U(" buildLayoutGraph",()=>$(j));U(" runLayout",()=>v(Y,U,I)),U(" updateInputGraph",()=>w(j,Y))})}function v(j,I,U){I(" makeSpaceForEdgeLabels",()=>L(j)),I(" removeSelfEdges",()=>K(j)),I(" acyclic",()=>e.run(j)),I(" nestingGraph.run",()=>o.run(j)),I(" rank",()=>n(h.asNonCompoundGraph(j))),I(" injectEdgeLabelProxies",()=>M(j)),I(" removeEmptyRanks",()=>a(j)),I(" nestingGraph.cleanup",()=>o.cleanup(j)),I(" normalizeRanks",()=>r(j)),I(" assignRankMinMax",()=>z(j)),I(" removeEdgeLabelProxies",()=>P(j)),I(" normalize.run",()=>t.run(j)),I(" parentDummyChains",()=>i(j)),I(" addBorderSegments",()=>l(j)),I(" order",()=>f(j,U)),I(" insertSelfEdges",()=>Q(j)),I(" adjustCoordinateSystem",()=>c.adjust(j)),I(" position",()=>d(j)),I(" positionSelfEdges",()=>R(j)),I(" removeBorderNodes",()=>G(j)),I(" normalize.undo",()=>t.undo(j)),I(" fixupEdgeLabelCoords",()=>H(j)),I(" undoCoordinateSystem",()=>c.undo(j)),I(" translateGraph",()=>q(j)),I(" assignNodeIntersects",()=>D(j)),I(" reversePoints",()=>B(j)),I(" acyclic.undo",()=>e.undo(j))}function w(j,I){j.nodes().forEach(U=>{let Y=j.node(U),ne=I.node(U);Y&&(Y.x=ne.x,Y.y=ne.y,Y.rank=ne.rank,I.children(U).length&&(Y.width=ne.width,Y.height=ne.height))}),j.edges().forEach(U=>{let Y=j.edge(U),ne=I.edge(U);Y.points=ne.points,Object.hasOwn(ne,"x")&&(Y.x=ne.x,Y.y=ne.y)}),j.graph().width=I.graph().width,j.graph().height=I.graph().height}let b=["nodesep","edgesep","ranksep","marginx","marginy"],_={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},S=["acyclicer","ranker","rankdir","align"],x=["width","height"],A={width:0,height:0},k=["minlen","weight","width","height","labeloffset"],T={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},O=["labelpos"];function $(j){let I=new m({multigraph:!0,compound:!0}),U=X(j.graph());return I.setGraph(Object.assign({},_,V(U,b),h.pick(U,S))),j.nodes().forEach(Y=>{let ne=X(j.node(Y));const ae=V(ne,x);Object.keys(A).forEach(re=>{ae[re]===void 0&&(ae[re]=A[re])}),I.setNode(Y,ae),I.setParent(Y,j.parent(Y))}),j.edges().forEach(Y=>{let ne=X(j.edge(Y));I.setEdge(Y,Object.assign({},T,V(ne,k),h.pick(ne,O)))}),I}function L(j){let I=j.graph();I.ranksep/=2,j.edges().forEach(U=>{let Y=j.edge(U);Y.minlen*=2,Y.labelpos.toLowerCase()!=="c"&&(I.rankdir==="TB"||I.rankdir==="BT"?Y.width+=Y.labeloffset:Y.height+=Y.labeloffset)})}function M(j){j.edges().forEach(I=>{let U=j.edge(I);if(U.width&&U.height){let Y=j.node(I.v),ae={rank:(j.node(I.w).rank-Y.rank)/2+Y.rank,e:I};h.addDummyNode(j,"edge-proxy",ae,"_ep")}})}function z(j){let I=0;j.nodes().forEach(U=>{let Y=j.node(U);Y.borderTop&&(Y.minRank=j.node(Y.borderTop).rank,Y.maxRank=j.node(Y.borderBottom).rank,I=Math.max(I,Y.maxRank))}),j.graph().maxRank=I}function P(j){j.nodes().forEach(I=>{let U=j.node(I);U.dummy==="edge-proxy"&&(j.edge(U.e).labelRank=U.rank,j.removeNode(I))})}function q(j){let I=Number.POSITIVE_INFINITY,U=0,Y=Number.POSITIVE_INFINITY,ne=0,ae=j.graph(),re=ae.marginx||0,le=ae.marginy||0;function W(J){let se=J.x,fe=J.y,me=J.width,xe=J.height;I=Math.min(I,se-me/2),U=Math.max(U,se+me/2),Y=Math.min(Y,fe-xe/2),ne=Math.max(ne,fe+xe/2)}j.nodes().forEach(J=>W(j.node(J))),j.edges().forEach(J=>{let se=j.edge(J);Object.hasOwn(se,"x")&&W(se)}),I-=re,Y-=le,j.nodes().forEach(J=>{let se=j.node(J);se.x-=I,se.y-=Y}),j.edges().forEach(J=>{let se=j.edge(J);se.points.forEach(fe=>{fe.x-=I,fe.y-=Y}),Object.hasOwn(se,"x")&&(se.x-=I),Object.hasOwn(se,"y")&&(se.y-=Y)}),ae.width=U-I+re,ae.height=ne-Y+le}function D(j){j.edges().forEach(I=>{let U=j.edge(I),Y=j.node(I.v),ne=j.node(I.w),ae,re;U.points?(ae=U.points[0],re=U.points[U.points.length-1]):(U.points=[],ae=ne,re=Y),U.points.unshift(h.intersectRect(Y,ae)),U.points.push(h.intersectRect(ne,re))})}function H(j){j.edges().forEach(I=>{let U=j.edge(I);if(Object.hasOwn(U,"x"))switch((U.labelpos==="l"||U.labelpos==="r")&&(U.width-=U.labeloffset),U.labelpos){case"l":U.x-=U.width/2+U.labeloffset;break;case"r":U.x+=U.width/2+U.labeloffset;break}})}function B(j){j.edges().forEach(I=>{let U=j.edge(I);U.reversed&&U.points.reverse()})}function G(j){j.nodes().forEach(I=>{if(j.children(I).length){let U=j.node(I),Y=j.node(U.borderTop),ne=j.node(U.borderBottom),ae=j.node(U.borderLeft[U.borderLeft.length-1]),re=j.node(U.borderRight[U.borderRight.length-1]);U.width=Math.abs(re.x-ae.x),U.height=Math.abs(ne.y-Y.y),U.x=ae.x+U.width/2,U.y=Y.y+U.height/2}}),j.nodes().forEach(I=>{j.node(I).dummy==="border"&&j.removeNode(I)})}function K(j){j.edges().forEach(I=>{if(I.v===I.w){var U=j.node(I.v);U.selfEdges||(U.selfEdges=[]),U.selfEdges.push({e:I,label:j.edge(I)}),j.removeEdge(I)}})}function Q(j){var I=h.buildLayerMatrix(j);I.forEach(U=>{var Y=0;U.forEach((ne,ae)=>{var re=j.node(ne);re.order=ae+Y,(re.selfEdges||[]).forEach(le=>{h.addDummyNode(j,"selfedge",{width:le.label.width,height:le.label.height,rank:re.rank,order:ae+ ++Y,e:le.e,label:le.label},"_se")}),delete re.selfEdges})})}function R(j){j.nodes().forEach(I=>{var U=j.node(I);if(U.dummy==="selfedge"){var Y=j.node(U.e.v),ne=Y.x+Y.width/2,ae=Y.y,re=U.x-ne,le=Y.height/2;j.setEdge(U.e,U.label),j.removeNode(I),U.label.points=[{x:ne+2*re/3,y:ae-le},{x:ne+5*re/6,y:ae-le},{x:ne+re,y:ae},{x:ne+5*re/6,y:ae+le},{x:ne+2*re/3,y:ae+le}],U.label.x=U.x,U.label.y=U.y}})}function V(j,I){return h.mapValues(h.pick(j,I),Number)}function X(j){var I={};return j&&Object.entries(j).forEach(([U,Y])=>{typeof U=="string"&&(U=U.toLowerCase()),I[U]=Y}),I}return _b}var xb,xR;function Eie(){if(xR)return xb;xR=1;let e=Jt(),t=Ir().Graph;xb={debugOrdering:n};function n(r){let i=e.buildLayerMatrix(r),a=new t({compound:!0,multigraph:!0}).setGraph({});return r.nodes().forEach(o=>{a.setNode(o,{label:o}),a.setParent(o,"layer"+r.node(o).rank)}),r.edges().forEach(o=>a.setEdge(o.v,o.w,{},o.name)),i.forEach((o,l)=>{let c="layer"+l;a.setNode(c,{rank:"same"}),o.reduce((f,d)=>(a.setEdge(f,d,{style:"invis"}),d))}),a}return xb}var wb,wR;function kie(){return wR||(wR=1,wb="1.1.4"),wb}var Sb,SR;function Aie(){return SR||(SR=1,Sb={graphlib:Ir(),layout:Sie(),debug:Eie(),util:{time:Jt().time,notime:Jt().notime},version:kie()}),Sb}var Tie=Aie();const ER=zn(Tie);function Cie(e){const t=new Map,n=[],r=a=>{const o=a.id.split(":"),l=o.slice(0,-1).join(":");if(o.length!==1){if(!t.has(l)){const c={id:l,type:"group",data:{label:l.split(":").pop(),name:l.split(":").pop()},position:{x:0,y:0},style:{},parentId:void 0},f=r(c);f&&(c.parentId=f.id),t.set(l,c)}return t.get(l)}};return e.forEach(a=>{const o={...a,id:a.id.toString(),position:{x:0,y:0},data:{label:a.id.split(":").pop(),name:a.id.split(":").pop()}},l=r(o);l&&(o.parentId=l.id.toString()),n.push(o)}),[...Array.from(t.values()),...n]}const Oie={group:({data:e})=>N.jsx("div",{className:"absolute bottom-full left-0",children:N.jsx("span",{children:e.name})})},Nie=(e,t)=>{const n=e.map(r=>{const i=t.find(c=>c.id===r.source.toString()),a=t.find(c=>c.id===r.target.toString()),o=i==null?void 0:i.id,l=a==null?void 0:a.id;return{id:`${o}=${l}`,source:o,target:l,animated:r.conditional,label:r.data,style:{stroke:r.conditional?"#2563eb":"#64748b"}}});if(!n.find(r=>r.target==="__end__")){const r=[...t].reverse().find(i=>i.id.endsWith(":__end__"));r&&n.push({id:`${r.id}=__end__`,source:r.id,target:"__end__",type:"smoothstep"})}return n},Rie=()=>{const{fitView:e}=Ip(),{graphVisualize:t,currentNodeName:n}=Ts(),r=t||{nodes:[],edges:[]},i=Cie(r.nodes.map(g=>({...g,type:"default"}))),a=Nie(r.edges,i),[o,l,c]=yre(i),[f,d,h]=bre(a),m=te.useCallback(g=>{const v=kR(o,f,{direction:g});l([...v.nodes]),d([...v.edges]),e()},[o,f]);return te.useEffect(()=>{if(r.nodes.length>0){const g=kR(i,a,{direction:"TB"});l([...g.nodes]),d([...g.edges]),e()}},[r]),te.useEffect(()=>{const g=o.findIndex(v=>v.id.endsWith(n));if(g!==-1){const v=[...o].map(w=>({...w,selected:!1}));v[g]={...v[g],selected:!0},l(v),e()}},[n]),N.jsx("div",{className:"h-full relative overflow-hidden border-l",children:N.jsxs(gre,{nodes:o,edges:f,onNodesChange:c,onEdgesChange:h,fitView:!0,className:"w-full h-full",nodeTypes:Oie,children:[N.jsx(Sre,{}),N.jsx(Nre,{}),N.jsxs(jc,{position:"top-right",className:"flex gap-2",children:[N.jsx("button",{onClick:()=>m("TB"),className:"px-3 py-1.5 bg-white border border-gray-200 rounded-lg text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:"垂直布局"}),N.jsx("button",{onClick:()=>m("LR"),className:"px-3 py-1.5 bg-white border border-gray-200 rounded-lg text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:"水平布局"})]})]})})},kR=(e,t,n)=>{const r=new ER.graphlib.Graph({compound:!0,multigraph:!0}).setDefaultEdgeLabel(()=>({}));r.setGraph({rankdir:n.direction,nodesep:40,ranksep:40,edgesep:20}),e.forEach(l=>{l.type!=="group"&&r.setNode(l.id,{...l,width:128,height:20})}),t.forEach(l=>r.setEdge(l.source,l.target)),ER.layout(r);const i=e.map(l=>{const c=r.node(l.id);if(!c)return{...l};let f=0,d=0;return f=c.x+((c==null?void 0:c.width)??0),d=c.y+((c==null?void 0:c.height)??0),{...l,position:{x:f,y:d},_p:c,width:c.width,height:c.height}}),a=new Map,o=15;return[...i].reverse().forEach(l=>{if(l.type==="group"){const c=a.get(l.id)||[],f=Math.min(...c.map(g=>g.position.x)),d=Math.min(...c.map(g=>g.position.y)),h=Math.max(...c.map(g=>g.position.x+(g.width??0))),m=Math.max(...c.map(g=>g.position.y+(g.height??0)));l.position.x=f-o,l.position.y=d-o,l.width=h-f+o*2,l.height=m-d+o*2,c.forEach(g=>{g.position.x=g.position.x-l.position.x,g.position.y=g.position.y-l.position.y})}l.parentId&&a.set(l.parentId,[...a.get(l.parentId)??[],l])}),{nodes:i,edges:t}};function jie(){return N.jsx(EP,{children:N.jsx(Rie,{})})}const Mie=()=>N.jsx(jie,{});/**
|
|
231
231
|
* @license
|
|
232
232
|
* Copyright 2019 Google LLC
|
|
233
233
|
* SPDX-License-Identifier: Apache-2.0
|
|
234
|
-
*/const $P=Symbol("Comlink.proxy"),Mie=Symbol("Comlink.endpoint"),$ie=Symbol("Comlink.releaseProxy"),Eb=Symbol("Comlink.finalizer"),Ch=Symbol("Comlink.thrown"),DP=e=>typeof e=="object"&&e!==null||typeof e=="function",Die={canHandle:e=>DP(e)&&e[$P],serialize(e){const{port1:t,port2:n}=new MessageChannel;return PP(e,t),[n,[n]]},deserialize(e){return e.start(),zP(e)}},Iie={canHandle:e=>DP(e)&&Ch in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},IP=new Map([["proxy",Die],["throw",Iie]]);function Pie(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function PP(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(i){if(!i||!i.data)return;if(!Pie(n,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:a,type:o,path:l}=Object.assign({path:[]},i.data),c=(i.data.argumentList||[]).map(fs);let f;try{const d=l.slice(0,-1).reduce((m,g)=>m[g],e),h=l.reduce((m,g)=>m[g],e);switch(o){case"GET":f=h;break;case"SET":d[l.slice(-1)[0]]=fs(i.data.value),f=!0;break;case"APPLY":f=h.apply(d,c);break;case"CONSTRUCT":{const m=new h(...c);f=Uie(m)}break;case"ENDPOINT":{const{port1:m,port2:g}=new MessageChannel;PP(e,g),f=Bie(m,[m])}break;case"RELEASE":f=void 0;break;default:return}}catch(d){f={value:d,[Ch]:0}}Promise.resolve(f).catch(d=>({value:d,[Ch]:0})).then(d=>{const[h,m]=up(d);t.postMessage(Object.assign(Object.assign({},h),{id:a}),m),o==="RELEASE"&&(t.removeEventListener("message",r),LP(t),Eb in e&&typeof e[Eb]=="function"&&e[Eb]())}).catch(d=>{const[h,m]=up({value:new TypeError("Unserializable return value"),[Ch]:0});t.postMessage(Object.assign(Object.assign({},h),{id:a}),m)})}),t.start&&t.start()}function Lie(e){return e.constructor.name==="MessagePort"}function LP(e){Lie(e)&&e.close()}function zP(e,t){const n=new Map;return e.addEventListener("message",function(i){const{data:a}=i;if(!a||!a.id)return;const o=n.get(a.id);if(o)try{o(a)}finally{n.delete(a.id)}}),zw(e,n,[],t)}function jd(e){if(e)throw new Error("Proxy has been released and is not useable")}function qP(e){return Mo(e,new Map,{type:"RELEASE"}).then(()=>{LP(e)})}const op=new WeakMap,lp="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(op.get(e)||0)-1;op.set(e,t),t===0&&qP(e)});function zie(e,t){const n=(op.get(t)||0)+1;op.set(t,n),lp&&lp.register(e,t,e)}function qie(e){lp&&lp.unregister(e)}function zw(e,t,n=[],r=function(){}){let i=!1;const a=new Proxy(r,{get(o,l){if(jd(i),l===$ie)return()=>{qie(a),qP(e),t.clear(),i=!0};if(l==="then"){if(n.length===0)return{then:()=>a};const c=Mo(e,t,{type:"GET",path:n.map(f=>f.toString())}).then(fs);return c.then.bind(c)}return zw(e,t,[...n,l])},set(o,l,c){jd(i);const[f,d]=up(c);return Mo(e,t,{type:"SET",path:[...n,l].map(h=>h.toString()),value:f},d).then(fs)},apply(o,l,c){jd(i);const f=n[n.length-1];if(f===Mie)return Mo(e,t,{type:"ENDPOINT"}).then(fs);if(f==="bind")return zw(e,t,n.slice(0,-1));const[d,h]=AR(c);return Mo(e,t,{type:"APPLY",path:n.map(m=>m.toString()),argumentList:d},h).then(fs)},construct(o,l){jd(i);const[c,f]=AR(l);return Mo(e,t,{type:"CONSTRUCT",path:n.map(d=>d.toString()),argumentList:c},f).then(fs)}});return zie(a,e),a}function Fie(e){return Array.prototype.concat.apply([],e)}function AR(e){const t=e.map(up);return[t.map(n=>n[0]),Fie(t.map(n=>n[1]))]}const FP=new WeakMap;function Bie(e,t){return FP.set(e,t),e}function Uie(e){return Object.assign(e,{[$P]:!0})}function Vie(e,t=globalThis,n="*"){return{postMessage:(r,i)=>e.postMessage(r,n,i),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function up(e){for(const[t,n]of IP)if(n.canHandle(e)){const[r,i]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},i]}return[{type:"RAW",value:e},FP.get(e)||[]]}function fs(e){switch(e.type){case"HANDLER":return IP.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Mo(e,t,n,r){return new Promise(i=>{const a=Hie();t.set(a,i),e.start&&e.start(),e.postMessage(Object.assign({id:a},n),r)})}function Hie(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const BP=te.createContext({artifacts:[],currentArtifact:null,setCurrentArtifactById:()=>{},getArtifactVersions:()=>[],showArtifact:!1,setShowArtifact:()=>{}}),zp=()=>te.useContext(BP),Gie=({children:e})=>{const[t,n]=te.useState([]),[r,i]=te.useState(!1),{renderMessages:a}=Ts(),[o,l]=te.useState(null),c=d=>t.filter(h=>h.filename===d).sort((h,m)=>h.version-m.version);te.useEffect(()=>{if(!a)return;const d=a.filter(g=>g.type==="tool").filter(g=>g.name==="create_artifacts"),h=new Map,m=d.map(g=>{const v=JSON.parse(g.tool_input),w=v.filename,_=(h.get(w)||0)+1;return h.set(w,_),{id:g.id,code:v.code,filename:w,version:_,filetype:v.filetype}});n(m)},[a]);const f=d=>{i(!0),l(t.find(h=>h.id===d)||null)};return N.jsx(BP.Provider,{value:{artifacts:t,currentArtifact:o,setCurrentArtifactById:f,getArtifactVersions:c,showArtifact:r,setShowArtifact:i},children:e})},Yie=()=>{const{currentArtifact:e}=zp();return e?N.jsx("div",{className:"h-full w-full overflow-auto",children:N.jsx("pre",{children:e.code})}):N.jsx("div",{className:"h-full w-full flex items-center justify-center text-gray-500",children:"请选择一个文件"})},Zie=()=>{const e=te.useRef(null),[t,n]=te.useState(!1),{currentArtifact:r,getArtifactVersions:i,setCurrentArtifactById:a,artifacts:o}=zp(),[l,c]=te.useState(0),[f,d]=te.useState("preview"),[h,m]=te.useState(!1),g=async S=>{const x=zP(Vie(S.contentWindow));return await Promise.race(Array(100).fill(0).map((A,k)=>new Promise(T=>{setTimeout(async()=>{await x.init()&&T(k)},100*k)}))),x},v=async()=>{if(console.log(l),!!e.current){n(!0);try{await(await g(e.current)).run(r==null?void 0:r.code,r==null?void 0:r.filename,r==null?void 0:r.filetype)}catch(S){console.error("Failed to run code:",S)}finally{n(!1)}}},w=()=>{c(S=>S+1)};if(te.useEffect(()=>{e.current&&v()},[l]),!r)return N.jsx("div",{className:"h-full w-full flex items-center justify-center text-gray-500",children:"请选择一个文件"});const b=i(r.filename),_=Array.from(new Set(o.map(S=>S.filename)));return N.jsxs("div",{className:"h-full w-full flex flex-col",children:[N.jsxs("div",{className:"flex items-center justify-between p-2 border-b",children:[N.jsxs("div",{className:"flex items-center space-x-4",children:[N.jsxs("div",{className:"flex space-x-2",children:[N.jsx("button",{className:`px-3 py-1 rounded ${f==="preview"?"bg-blue-500 text-white":"bg-gray-100 text-gray-700"}`,onClick:()=>{d("preview"),w()},children:"预览"}),N.jsx("button",{className:`px-3 py-1 rounded ${f==="source"?"bg-blue-500 text-white":"bg-gray-100 text-gray-700"}`,onClick:()=>d("source"),children:"源代码"})]}),N.jsxs("div",{className:"relative",children:[N.jsxs("button",{className:"flex items-center space-x-2 px-3 py-1 bg-gray-100 rounded hover:bg-gray-200",onClick:()=>m(!h),children:[N.jsx("span",{children:r.filename}),N.jsx(L5,{className:"w-4 h-4"})]}),h&&N.jsx("div",{className:"absolute top-full left-0 mt-1 w-48 bg-white border rounded-md shadow-lg z-10",children:_.map(S=>{const x=i(S),A=x[x.length-1];return N.jsx("button",{className:"w-full text-left px-3 py-2 hover:bg-gray-100",onClick:()=>{a(A.id),m(!1)},children:S},S)})})]}),N.jsxs("div",{className:"flex items-center space-x-2",children:[N.jsx("span",{className:"text-sm text-gray-500",children:"版本:"}),N.jsx("div",{className:"flex space-x-1",children:b.map(S=>N.jsxs("button",{className:`px-2 py-1 text-sm rounded ${S.id===r.id?"bg-blue-500 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,onClick:()=>a(S.id),children:["v",S.version]},S.id))})]})]}),f==="preview"&&N.jsxs("div",{className:"flex space-x-2",children:[N.jsx("button",{disabled:t,className:"px-3 py-1 bg-gray-100 rounded hover:bg-gray-200 disabled:opacity-50",children:t?"Running...":"Run"}),N.jsx("button",{onClick:w,disabled:t,className:"px-3 py-1 bg-gray-100 rounded hover:bg-gray-200 disabled:opacity-50",children:"Refresh"})]})]}),N.jsx("div",{className:"flex-1 overflow-auto",children:f==="preview"?N.jsx("iframe",{ref:e,src:"https://langgraph-artifacts.netlify.app/index.html",className:"w-full h-full border border-gray-300"},l):N.jsx(Yie,{})})]})};function lt(e){return typeof e!="object"||e===null||typeof e.lastModified=="number"&&typeof File<"u"&&e instanceof File||typeof e.getMonth=="function"&&typeof Date<"u"&&e instanceof Date?!1:!Array.isArray(e)}function Kie(e){return e.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),lt(e.additionalItems)}function TR(e){if(e==="")return;if(e===null)return null;if(/\.$/.test(e)||/\.0$/.test(e)||/\.\d*0$/.test(e))return e;const t=Number(e);return typeof t=="number"&&!Number.isNaN(t)?t:e}const Mc="__additional_property",qw="additionalProperties",ll="allOf",Mr="anyOf",Di="const",Xie="default",qp="dependencies",Wie="enum",Jn="__errors",Ra="$id",Qie="if",Ma="items",Jie="_$junk_option_schema_id$_",Oh="$name",tr="oneOf",Bt="properties",eae="required",cp="submitButtonOptions",rn="$ref",PS="__rjsf_additionalProperties",UP="__rjsf_rootSchema",tae="ui:field",LS="ui:widget",Zu="ui:options",nae="ui:globalOptions";function ot(e={},t={}){return Object.keys(e).filter(n=>n.indexOf("ui:")===0).reduce((n,r)=>{const i=e[r];return r===LS&<(i)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),n):r===Zu&<(i)?{...n,...i}:{...n,[r.substring(3)]:i}},{...t})}function rae(e,t={},n){if(!e.additionalProperties)return!1;const{expandable:r=!0}=ot(t);return r===!1?r:e.maxProperties!==void 0&&n?Object.keys(n).length<e.maxProperties:!0}var VP=typeof global=="object"&&global&&global.Object===Object&&global,iae=typeof self=="object"&&self&&self.Object===Object&&self,ni=VP||iae||Function("return this")(),br=ni.Symbol,HP=Object.prototype,aae=HP.hasOwnProperty,sae=HP.toString,Ou=br?br.toStringTag:void 0;function oae(e){var t=aae.call(e,Ou),n=e[Ou];try{e[Ou]=void 0;var r=!0}catch{}var i=sae.call(e);return r&&(t?e[Ou]=n:delete e[Ou]),i}var lae=Object.prototype,uae=lae.toString;function cae(e){return uae.call(e)}var fae="[object Null]",dae="[object Undefined]",CR=br?br.toStringTag:void 0;function qi(e){return e==null?e===void 0?dae:fae:CR&&CR in Object(e)?oae(e):cae(e)}function GP(e,t){return function(n){return e(t(n))}}var Fp=GP(Object.getPrototypeOf,Object);function vr(e){return e!=null&&typeof e=="object"}var hae="[object Object]",pae=Function.prototype,mae=Object.prototype,YP=pae.toString,gae=mae.hasOwnProperty,yae=YP.call(Object);function Ss(e){if(!vr(e)||qi(e)!=hae)return!1;var t=Fp(e);if(t===null)return!0;var n=gae.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&YP.call(n)==yae}function fp(e){const t={[Jn]:[],addError(n){this[Jn].push(n)}};if(Array.isArray(e))return e.reduce((n,r,i)=>({...n,[i]:fp(r)}),t);if(Ss(e)){const n=e;return Object.keys(n).reduce((r,i)=>({...r,[i]:fp(n[i])}),t)}return t}function bae(){this.__data__=[],this.size=0}function $c(e,t){return e===t||e!==e&&t!==t}function Bp(e,t){for(var n=e.length;n--;)if($c(e[n][0],t))return n;return-1}var vae=Array.prototype,_ae=vae.splice;function xae(e){var t=this.__data__,n=Bp(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():_ae.call(t,n,1),--this.size,!0}function wae(e){var t=this.__data__,n=Bp(t,e);return n<0?void 0:t[n][1]}function Sae(e){return Bp(this.__data__,e)>-1}function Eae(e,t){var n=this.__data__,r=Bp(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Fi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Fi.prototype.clear=bae;Fi.prototype.delete=xae;Fi.prototype.get=wae;Fi.prototype.has=Sae;Fi.prototype.set=Eae;function kae(){this.__data__=new Fi,this.size=0}function Aae(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Tae(e){return this.__data__.get(e)}function Cae(e){return this.__data__.has(e)}function Mt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Oae="[object AsyncFunction]",Nae="[object Function]",Rae="[object GeneratorFunction]",jae="[object Proxy]";function Up(e){if(!Mt(e))return!1;var t=qi(e);return t==Nae||t==Rae||t==Oae||t==jae}var kb=ni["__core-js_shared__"],OR=function(){var e=/[^.]+$/.exec(kb&&kb.keys&&kb.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Mae(e){return!!OR&&OR in e}var $ae=Function.prototype,Dae=$ae.toString;function Cs(e){if(e!=null){try{return Dae.call(e)}catch{}try{return e+""}catch{}}return""}var Iae=/[\\^$.*+?()[\]{}|]/g,Pae=/^\[object .+?Constructor\]$/,Lae=Function.prototype,zae=Object.prototype,qae=Lae.toString,Fae=zae.hasOwnProperty,Bae=RegExp("^"+qae.call(Fae).replace(Iae,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Uae(e){if(!Mt(e)||Mae(e))return!1;var t=Up(e)?Bae:Pae;return t.test(Cs(e))}function Vae(e,t){return e==null?void 0:e[t]}function Os(e,t){var n=Vae(e,t);return Uae(n)?n:void 0}var mc=Os(ni,"Map"),gc=Os(Object,"create");function Hae(){this.__data__=gc?gc(null):{},this.size=0}function Gae(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Yae="__lodash_hash_undefined__",Zae=Object.prototype,Kae=Zae.hasOwnProperty;function Xae(e){var t=this.__data__;if(gc){var n=t[e];return n===Yae?void 0:n}return Kae.call(t,e)?t[e]:void 0}var Wae=Object.prototype,Qae=Wae.hasOwnProperty;function Jae(e){var t=this.__data__;return gc?t[e]!==void 0:Qae.call(t,e)}var ese="__lodash_hash_undefined__";function tse(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gc&&t===void 0?ese:t,this}function Es(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Es.prototype.clear=Hae;Es.prototype.delete=Gae;Es.prototype.get=Xae;Es.prototype.has=Jae;Es.prototype.set=tse;function nse(){this.size=0,this.__data__={hash:new Es,map:new(mc||Fi),string:new Es}}function rse(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Vp(e,t){var n=e.__data__;return rse(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ise(e){var t=Vp(this,e).delete(e);return this.size-=t?1:0,t}function ase(e){return Vp(this,e).get(e)}function sse(e){return Vp(this,e).has(e)}function ose(e,t){var n=Vp(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Bi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bi.prototype.clear=nse;Bi.prototype.delete=ise;Bi.prototype.get=ase;Bi.prototype.has=sse;Bi.prototype.set=ose;var lse=200;function use(e,t){var n=this.__data__;if(n instanceof Fi){var r=n.__data__;if(!mc||r.length<lse-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Bi(r)}return n.set(e,t),this.size=n.size,this}function Dr(e){var t=this.__data__=new Fi(e);this.size=t.size}Dr.prototype.clear=kae;Dr.prototype.delete=Aae;Dr.prototype.get=Tae;Dr.prototype.has=Cae;Dr.prototype.set=use;var cse="__lodash_hash_undefined__";function fse(e){return this.__data__.set(e,cse),this}function dse(e){return this.__data__.has(e)}function Qo(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Bi;++t<n;)this.add(e[t])}Qo.prototype.add=Qo.prototype.push=fse;Qo.prototype.has=dse;function hse(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function zS(e,t){return e.has(t)}var pse=1,mse=2;function ZP(e,t,n,r,i,a){var o=n&pse,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var f=a.get(e),d=a.get(t);if(f&&d)return f==t&&d==e;var h=-1,m=!0,g=n&mse?new Qo:void 0;for(a.set(e,t),a.set(t,e);++h<l;){var v=e[h],w=t[h];if(r)var b=o?r(w,v,h,t,e,a):r(v,w,h,e,t,a);if(b!==void 0){if(b)continue;m=!1;break}if(g){if(!hse(t,function(_,S){if(!zS(g,S)&&(v===_||i(v,_,n,r,a)))return g.push(S)})){m=!1;break}}else if(!(v===w||i(v,w,n,r,a))){m=!1;break}}return a.delete(e),a.delete(t),m}var dp=ni.Uint8Array;function gse(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function qS(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var yse=1,bse=2,vse="[object Boolean]",_se="[object Date]",xse="[object Error]",wse="[object Map]",Sse="[object Number]",Ese="[object RegExp]",kse="[object Set]",Ase="[object String]",Tse="[object Symbol]",Cse="[object ArrayBuffer]",Ose="[object DataView]",NR=br?br.prototype:void 0,Ab=NR?NR.valueOf:void 0;function Nse(e,t,n,r,i,a,o){switch(n){case Ose:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Cse:return!(e.byteLength!=t.byteLength||!a(new dp(e),new dp(t)));case vse:case _se:case Sse:return $c(+e,+t);case xse:return e.name==t.name&&e.message==t.message;case Ese:case Ase:return e==t+"";case wse:var l=gse;case kse:var c=r&yse;if(l||(l=qS),e.size!=t.size&&!c)return!1;var f=o.get(e);if(f)return f==t;r|=bse,o.set(e,t);var d=ZP(l(e),l(t),r,i,a,o);return o.delete(e),d;case Tse:if(Ab)return Ab.call(e)==Ab.call(t)}return!1}function FS(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var an=Array.isArray;function KP(e,t,n){var r=t(e);return an(e)?r:FS(r,n(e))}function Rse(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function XP(){return[]}var jse=Object.prototype,Mse=jse.propertyIsEnumerable,RR=Object.getOwnPropertySymbols,BS=RR?function(e){return e==null?[]:(e=Object(e),Rse(RR(e),function(t){return Mse.call(e,t)}))}:XP;function WP(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var $se="[object Arguments]";function jR(e){return vr(e)&&qi(e)==$se}var QP=Object.prototype,Dse=QP.hasOwnProperty,Ise=QP.propertyIsEnumerable,Jo=jR(function(){return arguments}())?jR:function(e){return vr(e)&&Dse.call(e,"callee")&&!Ise.call(e,"callee")};function Pse(){return!1}var JP=typeof rr=="object"&&rr&&!rr.nodeType&&rr,MR=JP&&typeof ir=="object"&&ir&&!ir.nodeType&&ir,Lse=MR&&MR.exports===JP,$R=Lse?ni.Buffer:void 0,zse=$R?$R.isBuffer:void 0,ks=zse||Pse,qse=9007199254740991,Fse=/^(?:0|[1-9]\d*)$/;function Hp(e,t){var n=typeof e;return t=t??qse,!!t&&(n=="number"||n!="symbol"&&Fse.test(e))&&e>-1&&e%1==0&&e<t}var Bse=9007199254740991;function US(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Bse}var Use="[object Arguments]",Vse="[object Array]",Hse="[object Boolean]",Gse="[object Date]",Yse="[object Error]",Zse="[object Function]",Kse="[object Map]",Xse="[object Number]",Wse="[object Object]",Qse="[object RegExp]",Jse="[object Set]",eoe="[object String]",toe="[object WeakMap]",noe="[object ArrayBuffer]",roe="[object DataView]",ioe="[object Float32Array]",aoe="[object Float64Array]",soe="[object Int8Array]",ooe="[object Int16Array]",loe="[object Int32Array]",uoe="[object Uint8Array]",coe="[object Uint8ClampedArray]",foe="[object Uint16Array]",doe="[object Uint32Array]",Dt={};Dt[ioe]=Dt[aoe]=Dt[soe]=Dt[ooe]=Dt[loe]=Dt[uoe]=Dt[coe]=Dt[foe]=Dt[doe]=!0;Dt[Use]=Dt[Vse]=Dt[noe]=Dt[Hse]=Dt[roe]=Dt[Gse]=Dt[Yse]=Dt[Zse]=Dt[Kse]=Dt[Xse]=Dt[Wse]=Dt[Qse]=Dt[Jse]=Dt[eoe]=Dt[toe]=!1;function hoe(e){return vr(e)&&US(e.length)&&!!Dt[qi(e)]}function VS(e){return function(t){return e(t)}}var e6=typeof rr=="object"&&rr&&!rr.nodeType&&rr,Ku=e6&&typeof ir=="object"&&ir&&!ir.nodeType&&ir,poe=Ku&&Ku.exports===e6,Tb=poe&&VP.process,el=function(){try{var e=Ku&&Ku.require&&Ku.require("util").types;return e||Tb&&Tb.binding&&Tb.binding("util")}catch{}}(),DR=el&&el.isTypedArray,Dc=DR?VS(DR):hoe,moe=Object.prototype,goe=moe.hasOwnProperty;function t6(e,t){var n=an(e),r=!n&&Jo(e),i=!n&&!r&&ks(e),a=!n&&!r&&!i&&Dc(e),o=n||r||i||a,l=o?WP(e.length,String):[],c=l.length;for(var f in e)(t||goe.call(e,f))&&!(o&&(f=="length"||i&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Hp(f,c)))&&l.push(f);return l}var yoe=Object.prototype;function Gp(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||yoe;return e===n}var boe=GP(Object.keys,Object),voe=Object.prototype,_oe=voe.hasOwnProperty;function n6(e){if(!Gp(e))return boe(e);var t=[];for(var n in Object(e))_oe.call(e,n)&&n!="constructor"&&t.push(n);return t}function ul(e){return e!=null&&US(e.length)&&!Up(e)}function Yr(e){return ul(e)?t6(e):n6(e)}function Fw(e){return KP(e,Yr,BS)}var xoe=1,woe=Object.prototype,Soe=woe.hasOwnProperty;function Eoe(e,t,n,r,i,a){var o=n&xoe,l=Fw(e),c=l.length,f=Fw(t),d=f.length;if(c!=d&&!o)return!1;for(var h=c;h--;){var m=l[h];if(!(o?m in t:Soe.call(t,m)))return!1}var g=a.get(e),v=a.get(t);if(g&&v)return g==t&&v==e;var w=!0;a.set(e,t),a.set(t,e);for(var b=o;++h<c;){m=l[h];var _=e[m],S=t[m];if(r)var x=o?r(S,_,m,t,e,a):r(_,S,m,e,t,a);if(!(x===void 0?_===S||i(_,S,n,r,a):x)){w=!1;break}b||(b=m=="constructor")}if(w&&!b){var A=e.constructor,k=t.constructor;A!=k&&"constructor"in e&&"constructor"in t&&!(typeof A=="function"&&A instanceof A&&typeof k=="function"&&k instanceof k)&&(w=!1)}return a.delete(e),a.delete(t),w}var Bw=Os(ni,"DataView"),Uw=Os(ni,"Promise"),zo=Os(ni,"Set"),Vw=Os(ni,"WeakMap"),IR="[object Map]",koe="[object Object]",PR="[object Promise]",LR="[object Set]",zR="[object WeakMap]",qR="[object DataView]",Aoe=Cs(Bw),Toe=Cs(mc),Coe=Cs(Uw),Ooe=Cs(zo),Noe=Cs(Vw),yr=qi;(Bw&&yr(new Bw(new ArrayBuffer(1)))!=qR||mc&&yr(new mc)!=IR||Uw&&yr(Uw.resolve())!=PR||zo&&yr(new zo)!=LR||Vw&&yr(new Vw)!=zR)&&(yr=function(e){var t=qi(e),n=t==koe?e.constructor:void 0,r=n?Cs(n):"";if(r)switch(r){case Aoe:return qR;case Toe:return IR;case Coe:return PR;case Ooe:return LR;case Noe:return zR}return t});var Roe=1,FR="[object Arguments]",BR="[object Array]",Md="[object Object]",joe=Object.prototype,UR=joe.hasOwnProperty;function Moe(e,t,n,r,i,a){var o=an(e),l=an(t),c=o?BR:yr(e),f=l?BR:yr(t);c=c==FR?Md:c,f=f==FR?Md:f;var d=c==Md,h=f==Md,m=c==f;if(m&&ks(e)){if(!ks(t))return!1;o=!0,d=!1}if(m&&!d)return a||(a=new Dr),o||Dc(e)?ZP(e,t,n,r,i,a):Nse(e,t,c,n,r,i,a);if(!(n&Roe)){var g=d&&UR.call(e,"__wrapped__"),v=h&&UR.call(t,"__wrapped__");if(g||v){var w=g?e.value():e,b=v?t.value():t;return a||(a=new Dr),i(w,b,n,r,a)}}return m?(a||(a=new Dr),Eoe(e,t,n,r,i,a)):!1}function Yp(e,t,n,r,i){return e===t?!0:e==null||t==null||!vr(e)&&!vr(t)?e!==e&&t!==t:Moe(e,t,n,r,Yp,i)}function $oe(e,t,n){n=typeof n=="function"?n:void 0;var r=n?n(e,t):void 0;return r===void 0?Yp(e,t,void 0,n):!!r}function It(e,t){return $oe(e,t,(n,r)=>{if(typeof n=="function"&&typeof r=="function")return!0})}var Doe="[object Symbol]";function Ic(e){return typeof e=="symbol"||vr(e)&&qi(e)==Doe}var Ioe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Poe=/^\w*$/;function HS(e,t){if(an(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ic(e)?!0:Poe.test(e)||!Ioe.test(e)||t!=null&&e in Object(t)}var Loe="Expected a function";function GS(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Loe);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(GS.Cache||Bi),n}GS.Cache=Bi;var zoe=500;function qoe(e){var t=GS(e,function(r){return n.size===zoe&&n.clear(),r}),n=t.cache;return t}var Foe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Boe=/\\(\\)?/g,r6=qoe(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Foe,function(n,r,i,a){t.push(i?a.replace(Boe,"$1"):r||n)}),t});function Zp(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var VR=br?br.prototype:void 0,HR=VR?VR.toString:void 0;function i6(e){if(typeof e=="string")return e;if(an(e))return Zp(e,i6)+"";if(Ic(e))return HR?HR.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function YS(e){return e==null?"":i6(e)}function cl(e,t){return an(e)?e:HS(e,t)?[e]:r6(YS(e))}function Ns(e){if(typeof e=="string"||Ic(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Kp(e,t){t=cl(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Ns(t[n++])];return n&&n==r?e:void 0}function Ne(e,t,n){var r=e==null?void 0:Kp(e,t);return r===void 0?n:r}var Uoe="[object Map]",Voe="[object Set]",Hoe=Object.prototype,Goe=Hoe.hasOwnProperty;function tl(e){if(e==null)return!0;if(ul(e)&&(an(e)||typeof e=="string"||typeof e.splice=="function"||ks(e)||Dc(e)||Jo(e)))return!e.length;var t=yr(e);if(t==Uoe||t==Voe)return!e.size;if(Gp(e))return!n6(e).length;for(var n in e)if(Goe.call(e,n))return!1;return!0}var Nu={},GR;function Yoe(){if(GR)return Nu;GR=1;var e=/~/,t=/~[01]/g;function n(f){switch(f){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+f)}function r(f){return e.test(f)?f.replace(t,n):f}function i(f,d,h){for(var m,g,v=1,w=d.length;v<w;){if(d[v]==="constructor"||d[v]==="prototype"||d[v]==="__proto__")return f;if(m=r(d[v++]),g=w>v,typeof f[m]>"u"&&(Array.isArray(f)&&m==="-"&&(m=f.length),g&&(d[v]!==""&&d[v]<1/0||d[v]==="-"?f[m]=[]:f[m]={})),!g)break;f=f[m]}var b=f[m];return h===void 0?delete f[m]:f[m]=h,b}function a(f){if(typeof f=="string"){if(f=f.split("/"),f[0]==="")return f;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(f)){for(const d of f)if(typeof d!="string"&&typeof d!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return f}throw new Error("Invalid JSON pointer.")}function o(f,d){if(typeof f!="object")throw new Error("Invalid input object.");d=a(d);var h=d.length;if(h===1)return f;for(var m=1;m<h;){if(f=f[r(d[m++])],h===m)return f;if(typeof f!="object"||f===null)return}}function l(f,d,h){if(typeof f!="object")throw new Error("Invalid input object.");if(d=a(d),d.length===0)throw new Error("Invalid JSON pointer for set.");return i(f,d,h)}function c(f){var d=a(f);return{get:function(h){return o(h,d)},set:function(h,m){return l(h,d,m)}}}return Nu.get=o,Nu.set=l,Nu.compile=c,Nu}var Zoe=Yoe();const Koe=zn(Zoe);function ZS(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var hp=function(){try{var e=Os(Object,"defineProperty");return e({},"",{}),e}catch{}}();function KS(e,t,n){t=="__proto__"&&hp?hp(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Xoe=Object.prototype,Woe=Xoe.hasOwnProperty;function XS(e,t,n){var r=e[t];(!(Woe.call(e,t)&&$c(r,n))||n===void 0&&!(t in e))&&KS(e,t,n)}function fl(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var l=t[a],c=void 0;c===void 0&&(c=e[l]),i?KS(n,l,c):XS(n,l,c)}return n}function Qoe(e,t){return e&&fl(t,Yr(t),e)}function Joe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var ele=Object.prototype,tle=ele.hasOwnProperty;function nle(e){if(!Mt(e))return Joe(e);var t=Gp(e),n=[];for(var r in e)r=="constructor"&&(t||!tle.call(e,r))||n.push(r);return n}function Pc(e){return ul(e)?t6(e,!0):nle(e)}function rle(e,t){return e&&fl(t,Pc(t),e)}var a6=typeof rr=="object"&&rr&&!rr.nodeType&&rr,YR=a6&&typeof ir=="object"&&ir&&!ir.nodeType&&ir,ile=YR&&YR.exports===a6,ZR=ile?ni.Buffer:void 0,KR=ZR?ZR.allocUnsafe:void 0;function s6(e,t){if(t)return e.slice();var n=e.length,r=KR?KR(n):new e.constructor(n);return e.copy(r),r}function WS(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function ale(e,t){return fl(e,BS(e),t)}var sle=Object.getOwnPropertySymbols,o6=sle?function(e){for(var t=[];e;)FS(t,BS(e)),e=Fp(e);return t}:XP;function ole(e,t){return fl(e,o6(e),t)}function QS(e){return KP(e,Pc,o6)}var lle=Object.prototype,ule=lle.hasOwnProperty;function cle(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&ule.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function JS(e){var t=new e.constructor(e.byteLength);return new dp(t).set(new dp(e)),t}function fle(e,t){var n=t?JS(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var dle=/\w*$/;function hle(e){var t=new e.constructor(e.source,dle.exec(e));return t.lastIndex=e.lastIndex,t}var XR=br?br.prototype:void 0,WR=XR?XR.valueOf:void 0;function ple(e){return WR?Object(WR.call(e)):{}}function l6(e,t){var n=t?JS(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var mle="[object Boolean]",gle="[object Date]",yle="[object Map]",ble="[object Number]",vle="[object RegExp]",_le="[object Set]",xle="[object String]",wle="[object Symbol]",Sle="[object ArrayBuffer]",Ele="[object DataView]",kle="[object Float32Array]",Ale="[object Float64Array]",Tle="[object Int8Array]",Cle="[object Int16Array]",Ole="[object Int32Array]",Nle="[object Uint8Array]",Rle="[object Uint8ClampedArray]",jle="[object Uint16Array]",Mle="[object Uint32Array]";function $le(e,t,n){var r=e.constructor;switch(t){case Sle:return JS(e);case mle:case gle:return new r(+e);case Ele:return fle(e,n);case kle:case Ale:case Tle:case Cle:case Ole:case Nle:case Rle:case jle:case Mle:return l6(e,n);case yle:return new r;case ble:case xle:return new r(e);case vle:return hle(e);case _le:return new r;case wle:return ple(e)}}var QR=Object.create,u6=function(){function e(){}return function(t){if(!Mt(t))return{};if(QR)return QR(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function c6(e){return typeof e.constructor=="function"&&!Gp(e)?u6(Fp(e)):{}}var Dle="[object Map]";function Ile(e){return vr(e)&&yr(e)==Dle}var JR=el&&el.isMap,Ple=JR?VS(JR):Ile,Lle="[object Set]";function zle(e){return vr(e)&&yr(e)==Lle}var ej=el&&el.isSet,qle=ej?VS(ej):zle,Fle=1,Ble=2,Ule=4,f6="[object Arguments]",Vle="[object Array]",Hle="[object Boolean]",Gle="[object Date]",Yle="[object Error]",d6="[object Function]",Zle="[object GeneratorFunction]",Kle="[object Map]",Xle="[object Number]",h6="[object Object]",Wle="[object RegExp]",Qle="[object Set]",Jle="[object String]",eue="[object Symbol]",tue="[object WeakMap]",nue="[object ArrayBuffer]",rue="[object DataView]",iue="[object Float32Array]",aue="[object Float64Array]",sue="[object Int8Array]",oue="[object Int16Array]",lue="[object Int32Array]",uue="[object Uint8Array]",cue="[object Uint8ClampedArray]",fue="[object Uint16Array]",due="[object Uint32Array]",Rt={};Rt[f6]=Rt[Vle]=Rt[nue]=Rt[rue]=Rt[Hle]=Rt[Gle]=Rt[iue]=Rt[aue]=Rt[sue]=Rt[oue]=Rt[lue]=Rt[Kle]=Rt[Xle]=Rt[h6]=Rt[Wle]=Rt[Qle]=Rt[Jle]=Rt[eue]=Rt[uue]=Rt[cue]=Rt[fue]=Rt[due]=!0;Rt[Yle]=Rt[d6]=Rt[tue]=!1;function Xu(e,t,n,r,i,a){var o,l=t&Fle,c=t&Ble,f=t&Ule;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!Mt(e))return e;var d=an(e);if(d){if(o=cle(e),!l)return WS(e,o)}else{var h=yr(e),m=h==d6||h==Zle;if(ks(e))return s6(e,l);if(h==h6||h==f6||m&&!i){if(o=c||m?{}:c6(e),!l)return c?ole(e,rle(o,e)):ale(e,Qoe(o,e))}else{if(!Rt[h])return i?e:{};o=$le(e,h,l)}}a||(a=new Dr);var g=a.get(e);if(g)return g;a.set(e,o),qle(e)?e.forEach(function(b){o.add(Xu(b,t,n,b,e,a))}):Ple(e)&&e.forEach(function(b,_){o.set(_,Xu(b,t,n,_,e,a))});var v=f?c?QS:Fw:c?Pc:Yr,w=d?void 0:v(e);return ZS(w||e,function(b,_){w&&(_=b,b=e[_]),XS(o,_,Xu(b,t,n,_,e,a))}),o}function hue(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function pue(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function mue(e,t){return t.length<2?e:Kp(e,pue(t,0,-1))}function p6(e,t){return t=cl(t,e),e=mue(e,t),e==null||delete e[Ns(hue(t))]}function gue(e){return Ss(e)?void 0:e}var tj=br?br.isConcatSpreadable:void 0;function yue(e){return an(e)||Jo(e)||!!(tj&&e&&e[tj])}function Lc(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=yue),i||(i=[]);++a<o;){var l=e[a];t>0&&n(l)?t>1?Lc(l,t-1,n,r,i):FS(i,l):r||(i[i.length]=l)}return i}function bue(e){var t=e==null?0:e.length;return t?Lc(e,1):[]}function vue(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var nj=Math.max;function m6(e,t,n){return t=nj(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=nj(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=r[i];return l[t]=n(o),vue(e,this,l)}}function _ue(e){return function(){return e}}function Xp(e){return e}var xue=hp?function(e,t){return hp(e,"toString",{configurable:!0,enumerable:!1,value:_ue(t),writable:!0})}:Xp,wue=800,Sue=16,Eue=Date.now;function kue(e){var t=0,n=0;return function(){var r=Eue(),i=Sue-(r-n);if(n=r,i>0){if(++t>=wue)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var g6=kue(xue);function y6(e){return g6(m6(e,void 0,bue),e+"")}var Aue=1,Tue=2,Cue=4,pp=y6(function(e,t){var n={};if(e==null)return n;var r=!1;t=Zp(t,function(a){return a=cl(a,e),r||(r=a.length>1),a}),fl(e,QS(e),n),r&&(n=Xu(n,Aue|Tue|Cue,gue));for(var i=t.length;i--;)p6(n,t[i]);return n});function eE(e,t){const n=t[e];return[pp(t,[e]),n]}function b6(e,t={},n=[]){const r=e||"";let i;if(r.startsWith("#"))i=decodeURIComponent(r.substring(1));else throw new Error(`Could not find a definition for ${e}.`);const a=Koe.get(t,i);if(a===void 0)throw new Error(`Could not find a definition for ${e}.`);const o=a[rn];if(o){if(n.includes(o)){if(n.length===1)throw new Error(`Definition for ${e} is a circular reference`);const[d,...h]=n,m=[...h,r,d].join(" -> ");throw new Error(`Definition for ${d} contains a circular reference through ${m}`)}const[l,c]=eE(rn,a),f=b6(c,t,[...n,r]);return Object.keys(l).length>0?{...l,...f}:f}return a}function v6(e,t={}){return b6(e,t,[])}var Oue=Object.prototype,Nue=Oue.hasOwnProperty;function Rue(e,t){return e!=null&&Nue.call(e,t)}function _6(e,t,n){t=cl(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=Ns(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&US(i)&&Hp(o,i)&&(an(e)||Jo(e)))}function An(e,t){return e!=null&&_6(e,t,Rue)}var jue="[object Number]";function x6(e){return typeof e=="number"||vr(e)&&qi(e)==jue}var Mue="[object String]";function Wp(e){return typeof e=="string"||!an(e)&&vr(e)&&qi(e)==Mue}function $ue(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Due(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),l=o.length;l--;){var c=o[++i];if(n(a[c],c,a)===!1)break}return t}}var w6=Due();function S6(e,t){return e&&w6(e,t,Yr)}function Iue(e,t){return function(n,r){if(n==null)return n;if(!ul(n))return e(n,r);for(var i=n.length,a=-1,o=Object(n);++a<i&&r(o[a],a,o)!==!1;);return n}}var E6=Iue(S6),Pue=1,Lue=2;function zue(e,t,n,r){var i=n.length,a=i;if(e==null)return!a;for(e=Object(e);i--;){var o=n[i];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<a;){o=n[i];var l=o[0],c=e[l],f=o[1];if(o[2]){if(c===void 0&&!(l in e))return!1}else{var d=new Dr,h;if(!(h===void 0?Yp(f,c,Pue|Lue,r,d):h))return!1}}return!0}function k6(e){return e===e&&!Mt(e)}function que(e){for(var t=Yr(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,k6(i)]}return t}function A6(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function Fue(e){var t=que(e);return t.length==1&&t[0][2]?A6(t[0][0],t[0][1]):function(n){return n===e||zue(n,e,t)}}function Bue(e,t){return e!=null&&t in Object(e)}function T6(e,t){return e!=null&&_6(e,t,Bue)}var Uue=1,Vue=2;function Hue(e,t){return HS(e)&&k6(t)?A6(Ns(e),t):function(n){var r=Ne(n,e);return r===void 0&&r===t?T6(n,e):Yp(t,r,Uue|Vue)}}function Gue(e){return function(t){return t==null?void 0:t[e]}}function Yue(e){return function(t){return Kp(t,e)}}function Zue(e){return HS(e)?Gue(Ns(e)):Yue(e)}function tE(e){return typeof e=="function"?e:e==null?Xp:typeof e=="object"?an(e)?Hue(e[0],e[1]):Fue(e):Zue(e)}function Kue(e,t,n,r,i){return i(e,function(a,o,l){n=r?(r=!1,a):t(n,a,o,l)}),n}function Xue(e,t,n){var r=an(e)?$ue:Kue,i=arguments.length<3;return r(e,tE(t),n,i,E6)}function C6(e){return typeof e=="function"?e:Xp}var Wue=/\s/;function Que(e){for(var t=e.length;t--&&Wue.test(e.charAt(t)););return t}var Jue=/^\s+/;function ece(e){return e&&e.slice(0,Que(e)+1).replace(Jue,"")}var rj=NaN,tce=/^[-+]0x[0-9a-f]+$/i,nce=/^0b[01]+$/i,rce=/^0o[0-7]+$/i,ice=parseInt;function ace(e){if(typeof e=="number")return e;if(Ic(e))return rj;if(Mt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Mt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=ece(e);var n=nce.test(e);return n||rce.test(e)?ice(e.slice(2),n?2:8):tce.test(e)?rj:+e}var ij=1/0,sce=17976931348623157e292;function oce(e){if(!e)return e===0?e:0;if(e=ace(e),e===ij||e===-ij){var t=e<0?-1:1;return t*sce}return e===e?e:0}function lce(e){var t=oce(e),n=t%1;return t===t?n?t-n:t:0}var uce=9007199254740991,Cb=4294967295,cce=Math.min;function O6(e,t){if(e=lce(e),e<1||e>uce)return[];var n=Cb,r=cce(e,Cb);t=C6(t),e-=Cb;for(var i=WP(r,t);++n<e;)t(n);return i}function N6(e,t,n){var r;if(e&&n){const i=Ne(e,n);if(i===void 0)return;for(let a=0;a<t.length;a++){const o=t[a],l=Ne(o,[Bt,n],{});if(!(l.type==="object"||l.type==="array")&&(l.const===i||!((r=l.enum)===null||r===void 0)&&r.includes(i)))return a}}}function R6(e,t,n,r,i){if(t===void 0)return 0;const a=N6(t,n,i);if(x6(a))return a;for(let o=0;o<n.length;o++){const l=n[o];if(i&&An(l,[Bt,i])){const c=Ne(t,i),f=Ne(l,[Bt,i],{});if(e.isValid(f,c,r))return o}else if(l[Bt]){const c={anyOf:Object.keys(l[Bt]).map(d=>({required:[d]}))};let f;if(l.anyOf){const{...d}=l;d.allOf?d.allOf=d.allOf.slice():d.allOf=[],d.allOf.push(c),f=d}else f=Object.assign({},l,c);if(delete f.required,e.isValid(f,t,r))return o}else if(e.isValid(l,t,r))return o}return 0}function nE(e,t,n,r,i){return R6(e,t,n,r,i)}function rE(e,t,n,r){if(!Mt(e))return e;t=cl(t,e);for(var i=-1,a=t.length,o=a-1,l=e;l!=null&&++i<a;){var c=Ns(t[i]),f=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(i!=o){var d=l[c];f=r?r(d,c,l):void 0,f===void 0&&(f=Mt(d)?d:Hp(t[i+1])?[]:{})}XS(l,c,f),l=l[c]}return e}function mn(e,t,n){return e==null?e:rE(e,t,n)}function fce(e,t,n){var r=an(e),i=r||ks(e)||Dc(e);if(t=tE(t),n==null){var a=e&&e.constructor;i?n=r?new a:[]:Mt(e)?n=Up(a)?u6(Fp(e)):{}:n={}}return(i?ZS:S6)(e,function(o,l,c){return t(n,o,l,c)}),n}function Hw(e,t,n){(n!==void 0&&!$c(e[t],n)||n===void 0&&!(t in e))&&KS(e,t,n)}function mp(e){return vr(e)&&ul(e)}function Gw(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function dce(e){return fl(e,Pc(e))}function hce(e,t,n,r,i,a,o){var l=Gw(e,n),c=Gw(t,n),f=o.get(c);if(f){Hw(e,n,f);return}var d=a?a(l,c,n+"",e,t,o):void 0,h=d===void 0;if(h){var m=an(c),g=!m&&ks(c),v=!m&&!g&&Dc(c);d=c,m||g||v?an(l)?d=l:mp(l)?d=WS(l):g?(h=!1,d=s6(c,!0)):v?(h=!1,d=l6(c,!0)):d=[]:Ss(c)||Jo(c)?(d=l,Jo(l)?d=dce(l):(!Mt(l)||Up(l))&&(d=c6(c))):h=!1}h&&(o.set(c,d),i(d,c,r,a,o),o.delete(c)),Hw(e,n,d)}function j6(e,t,n,r,i){e!==t&&w6(t,function(a,o){if(i||(i=new Dr),Mt(a))hce(e,t,o,n,j6,r,i);else{var l=r?r(Gw(e,o),a,o+"",e,t,i):void 0;l===void 0&&(l=a),Hw(e,o,l)}},Pc)}function iE(e,t){return g6(m6(e,t,Xp),e+"")}function pce(e,t,n){if(!Mt(n))return!1;var r=typeof t;return(r=="number"?ul(n)&&Hp(t,n.length):r=="string"&&t in n)?$c(n[t],e):!1}function mce(e){return iE(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&pce(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var l=n[r];l&&e(t,l,r,a)}return t})}var gce=mce(function(e,t,n){j6(e,t,n)}),yce=1/0;function bce(e){var t=e==null?0:e.length;return t?Lc(e,yce):[]}function vce(e,t,n,r){for(var i=e.length,a=n+-1;++a<i;)if(t(e[a],a,e))return a;return-1}function _ce(e){return e!==e}function xce(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function wce(e,t,n){return t===t?xce(e,t,n):vce(e,_ce,n)}function M6(e,t){var n=e==null?0:e.length;return!!n&&wce(e,t,0)>-1}function Sce(){}var Ece=1/0,kce=zo&&1/qS(new zo([,-0]))[1]==Ece?function(e){return new zo(e)}:Sce,Ace=200;function $6(e,t,n){var r=-1,i=M6,a=e.length,o=!0,l=[],c=l;if(a>=Ace){var f=kce(e);if(f)return qS(f);o=!1,i=zS,c=new Qo}else c=l;e:for(;++r<a;){var d=e[r],h=d;if(d=d!==0?d:0,o&&h===h){for(var m=c.length;m--;)if(c[m]===h)continue e;l.push(d)}else i(c,h,n)||(c!==l&&c.push(h),l.push(d))}return l}function Tce(e){return e&&e.length?$6(e):[]}var Ob,aj;function Cce(){if(aj)return Ob;aj=1;function e(){this.__data__=[],this.size=0}return Ob=e,Ob}var Nb,sj;function dl(){if(sj)return Nb;sj=1;function e(t,n){return t===n||t!==t&&n!==n}return Nb=e,Nb}var Rb,oj;function Qp(){if(oj)return Rb;oj=1;var e=dl();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return Rb=t,Rb}var jb,lj;function Oce(){if(lj)return jb;lj=1;var e=Qp(),t=Array.prototype,n=t.splice;function r(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var l=a.length-1;return o==l?a.pop():n.call(a,o,1),--this.size,!0}return jb=r,jb}var Mb,uj;function Nce(){if(uj)return Mb;uj=1;var e=Qp();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return Mb=t,Mb}var $b,cj;function Rce(){if(cj)return $b;cj=1;var e=Qp();function t(n){return e(this.__data__,n)>-1}return $b=t,$b}var Db,fj;function jce(){if(fj)return Db;fj=1;var e=Qp();function t(n,r){var i=this.__data__,a=e(i,n);return a<0?(++this.size,i.push([n,r])):i[a][1]=r,this}return Db=t,Db}var Ib,dj;function Jp(){if(dj)return Ib;dj=1;var e=Cce(),t=Oce(),n=Nce(),r=Rce(),i=jce();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var f=o[l];this.set(f[0],f[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,Ib=a,Ib}var Pb,hj;function Mce(){if(hj)return Pb;hj=1;var e=Jp();function t(){this.__data__=new e,this.size=0}return Pb=t,Pb}var Lb,pj;function $ce(){if(pj)return Lb;pj=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Lb=e,Lb}var zb,mj;function Dce(){if(mj)return zb;mj=1;function e(t){return this.__data__.get(t)}return zb=e,zb}var qb,gj;function Ice(){if(gj)return qb;gj=1;function e(t){return this.__data__.has(t)}return qb=e,qb}var Fb,yj;function D6(){if(yj)return Fb;yj=1;var e=typeof fd=="object"&&fd&&fd.Object===Object&&fd;return Fb=e,Fb}var Bb,bj;function ri(){if(bj)return Bb;bj=1;var e=D6(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Bb=n,Bb}var Ub,vj;function hl(){if(vj)return Ub;vj=1;var e=ri(),t=e.Symbol;return Ub=t,Ub}var Vb,_j;function Pce(){if(_j)return Vb;_j=1;var e=hl(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function a(o){var l=n.call(o,i),c=o[i];try{o[i]=void 0;var f=!0}catch{}var d=r.call(o);return f&&(l?o[i]=c:delete o[i]),d}return Vb=a,Vb}var Hb,xj;function Lce(){if(xj)return Hb;xj=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Hb=n,Hb}var Gb,wj;function Rs(){if(wj)return Gb;wj=1;var e=hl(),t=Pce(),n=Lce(),r="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(l){return l==null?l===void 0?i:r:a&&a in Object(l)?t(l):n(l)}return Gb=o,Gb}var Yb,Sj;function ii(){if(Sj)return Yb;Sj=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Yb=e,Yb}var Zb,Ej;function aE(){if(Ej)return Zb;Ej=1;var e=Rs(),t=ii(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(l){if(!t(l))return!1;var c=e(l);return c==r||c==i||c==n||c==a}return Zb=o,Zb}var Kb,kj;function zce(){if(kj)return Kb;kj=1;var e=ri(),t=e["__core-js_shared__"];return Kb=t,Kb}var Xb,Aj;function qce(){if(Aj)return Xb;Aj=1;var e=zce(),t=function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function n(r){return!!t&&t in r}return Xb=n,Xb}var Wb,Tj;function I6(){if(Tj)return Wb;Tj=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Wb=n,Wb}var Qb,Cj;function Fce(){if(Cj)return Qb;Cj=1;var e=aE(),t=qce(),n=ii(),r=I6(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,c=o.toString,f=l.hasOwnProperty,d=RegExp("^"+c.call(f).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(m){if(!n(m)||t(m))return!1;var g=e(m)?d:a;return g.test(r(m))}return Qb=h,Qb}var Jb,Oj;function Bce(){if(Oj)return Jb;Oj=1;function e(t,n){return t==null?void 0:t[n]}return Jb=e,Jb}var ev,Nj;function js(){if(Nj)return ev;Nj=1;var e=Fce(),t=Bce();function n(r,i){var a=t(r,i);return e(a)?a:void 0}return ev=n,ev}var tv,Rj;function sE(){if(Rj)return tv;Rj=1;var e=js(),t=ri(),n=e(t,"Map");return tv=n,tv}var nv,jj;function em(){if(jj)return nv;jj=1;var e=js(),t=e(Object,"create");return nv=t,nv}var rv,Mj;function Uce(){if(Mj)return rv;Mj=1;var e=em();function t(){this.__data__=e?e(null):{},this.size=0}return rv=t,rv}var iv,$j;function Vce(){if($j)return iv;$j=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return iv=e,iv}var av,Dj;function Hce(){if(Dj)return av;Dj=1;var e=em(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(a){var o=this.__data__;if(e){var l=o[a];return l===t?void 0:l}return r.call(o,a)?o[a]:void 0}return av=i,av}var sv,Ij;function Gce(){if(Ij)return sv;Ij=1;var e=em(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var a=this.__data__;return e?a[i]!==void 0:n.call(a,i)}return sv=r,sv}var ov,Pj;function Yce(){if(Pj)return ov;Pj=1;var e=em(),t="__lodash_hash_undefined__";function n(r,i){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=e&&i===void 0?t:i,this}return ov=n,ov}var lv,Lj;function Zce(){if(Lj)return lv;Lj=1;var e=Uce(),t=Vce(),n=Hce(),r=Gce(),i=Yce();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var f=o[l];this.set(f[0],f[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,lv=a,lv}var uv,zj;function Kce(){if(zj)return uv;zj=1;var e=Zce(),t=Jp(),n=sE();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return uv=r,uv}var cv,qj;function Xce(){if(qj)return cv;qj=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return cv=e,cv}var fv,Fj;function tm(){if(Fj)return fv;Fj=1;var e=Xce();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return fv=t,fv}var dv,Bj;function Wce(){if(Bj)return dv;Bj=1;var e=tm();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return dv=t,dv}var hv,Uj;function Qce(){if(Uj)return hv;Uj=1;var e=tm();function t(n){return e(this,n).get(n)}return hv=t,hv}var pv,Vj;function Jce(){if(Vj)return pv;Vj=1;var e=tm();function t(n){return e(this,n).has(n)}return pv=t,pv}var mv,Hj;function efe(){if(Hj)return mv;Hj=1;var e=tm();function t(n,r){var i=e(this,n),a=i.size;return i.set(n,r),this.size+=i.size==a?0:1,this}return mv=t,mv}var gv,Gj;function oE(){if(Gj)return gv;Gj=1;var e=Kce(),t=Wce(),n=Qce(),r=Jce(),i=efe();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var f=o[l];this.set(f[0],f[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,gv=a,gv}var yv,Yj;function tfe(){if(Yj)return yv;Yj=1;var e=Jp(),t=sE(),n=oE(),r=200;function i(a,o){var l=this.__data__;if(l instanceof e){var c=l.__data__;if(!t||c.length<r-1)return c.push([a,o]),this.size=++l.size,this;l=this.__data__=new n(c)}return l.set(a,o),this.size=l.size,this}return yv=i,yv}var bv,Zj;function nm(){if(Zj)return bv;Zj=1;var e=Jp(),t=Mce(),n=$ce(),r=Dce(),i=Ice(),a=tfe();function o(l){var c=this.__data__=new e(l);this.size=c.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=i,o.prototype.set=a,bv=o,bv}var vv,Kj;function P6(){if(Kj)return vv;Kj=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i&&n(t[r],r,t)!==!1;);return t}return vv=e,vv}var _v,Xj;function L6(){if(Xj)return _v;Xj=1;var e=js(),t=function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}}();return _v=t,_v}var xv,Wj;function lE(){if(Wj)return xv;Wj=1;var e=L6();function t(n,r,i){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return xv=t,xv}var wv,Qj;function z6(){if(Qj)return wv;Qj=1;var e=lE(),t=dl(),n=Object.prototype,r=n.hasOwnProperty;function i(a,o,l){var c=a[o];(!(r.call(a,o)&&t(c,l))||l===void 0&&!(o in a))&&e(a,o,l)}return wv=i,wv}var Sv,Jj;function zc(){if(Jj)return Sv;Jj=1;var e=z6(),t=lE();function n(r,i,a,o){var l=!a;a||(a={});for(var c=-1,f=i.length;++c<f;){var d=i[c],h=o?o(a[d],r[d],d,a,r):void 0;h===void 0&&(h=r[d]),l?t(a,d,h):e(a,d,h)}return a}return Sv=n,Sv}var Ev,eM;function nfe(){if(eM)return Ev;eM=1;function e(t,n){for(var r=-1,i=Array(t);++r<t;)i[r]=n(r);return i}return Ev=e,Ev}var kv,tM;function ai(){if(tM)return kv;tM=1;function e(t){return t!=null&&typeof t=="object"}return kv=e,kv}var Av,nM;function rfe(){if(nM)return Av;nM=1;var e=Rs(),t=ai(),n="[object Arguments]";function r(i){return t(i)&&e(i)==n}return Av=r,Av}var Tv,rM;function rm(){if(rM)return Tv;rM=1;var e=rfe(),t=ai(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,a=e(function(){return arguments}())?e:function(o){return t(o)&&r.call(o,"callee")&&!i.call(o,"callee")};return Tv=a,Tv}var Cv,iM;function lr(){if(iM)return Cv;iM=1;var e=Array.isArray;return Cv=e,Cv}var qu={exports:{}},Ov,aM;function ife(){if(aM)return Ov;aM=1;function e(){return!1}return Ov=e,Ov}qu.exports;var sM;function im(){return sM||(sM=1,function(e,t){var n=ri(),r=ife(),i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===i,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,f=c||r;e.exports=f}(qu,qu.exports)),qu.exports}var Nv,oM;function uE(){if(oM)return Nv;oM=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,i){var a=typeof r;return i=i??e,!!i&&(a=="number"||a!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<i}return Nv=n,Nv}var Rv,lM;function cE(){if(lM)return Rv;lM=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Rv=t,Rv}var jv,uM;function afe(){if(uM)return jv;uM=1;var e=Rs(),t=cE(),n=ai(),r="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",l="[object Error]",c="[object Function]",f="[object Map]",d="[object Number]",h="[object Object]",m="[object RegExp]",g="[object Set]",v="[object String]",w="[object WeakMap]",b="[object ArrayBuffer]",_="[object DataView]",S="[object Float32Array]",x="[object Float64Array]",A="[object Int8Array]",k="[object Int16Array]",T="[object Int32Array]",O="[object Uint8Array]",$="[object Uint8ClampedArray]",L="[object Uint16Array]",M="[object Uint32Array]",z={};z[S]=z[x]=z[A]=z[k]=z[T]=z[O]=z[$]=z[L]=z[M]=!0,z[r]=z[i]=z[b]=z[a]=z[_]=z[o]=z[l]=z[c]=z[f]=z[d]=z[h]=z[m]=z[g]=z[v]=z[w]=!1;function P(q){return n(q)&&t(q.length)&&!!z[e(q)]}return jv=P,jv}var Mv,cM;function Ms(){if(cM)return Mv;cM=1;function e(t){return function(n){return t(n)}}return Mv=e,Mv}var Fu={exports:{}};Fu.exports;var fM;function fE(){return fM||(fM=1,function(e,t){var n=D6(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===r,o=a&&n.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l}(Fu,Fu.exports)),Fu.exports}var $v,dM;function dE(){if(dM)return $v;dM=1;var e=afe(),t=Ms(),n=fE(),r=n&&n.isTypedArray,i=r?t(r):e;return $v=i,$v}var Dv,hM;function q6(){if(hM)return Dv;hM=1;var e=nfe(),t=rm(),n=lr(),r=im(),i=uE(),a=dE(),o=Object.prototype,l=o.hasOwnProperty;function c(f,d){var h=n(f),m=!h&&t(f),g=!h&&!m&&r(f),v=!h&&!m&&!g&&a(f),w=h||m||g||v,b=w?e(f.length,String):[],_=b.length;for(var S in f)(d||l.call(f,S))&&!(w&&(S=="length"||g&&(S=="offset"||S=="parent")||v&&(S=="buffer"||S=="byteLength"||S=="byteOffset")||i(S,_)))&&b.push(S);return b}return Dv=c,Dv}var Iv,pM;function hE(){if(pM)return Iv;pM=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return Iv=t,Iv}var Pv,mM;function F6(){if(mM)return Pv;mM=1;function e(t,n){return function(r){return t(n(r))}}return Pv=e,Pv}var Lv,gM;function sfe(){if(gM)return Lv;gM=1;var e=F6(),t=e(Object.keys,Object);return Lv=t,Lv}var zv,yM;function ofe(){if(yM)return zv;yM=1;var e=hE(),t=sfe(),n=Object.prototype,r=n.hasOwnProperty;function i(a){if(!e(a))return t(a);var o=[];for(var l in Object(a))r.call(a,l)&&l!="constructor"&&o.push(l);return o}return zv=i,zv}var qv,bM;function pl(){if(bM)return qv;bM=1;var e=aE(),t=cE();function n(r){return r!=null&&t(r.length)&&!e(r)}return qv=n,qv}var Fv,vM;function qc(){if(vM)return Fv;vM=1;var e=q6(),t=ofe(),n=pl();function r(i){return n(i)?e(i):t(i)}return Fv=r,Fv}var Bv,_M;function lfe(){if(_M)return Bv;_M=1;var e=zc(),t=qc();function n(r,i){return r&&e(i,t(i),r)}return Bv=n,Bv}var Uv,xM;function ufe(){if(xM)return Uv;xM=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return Uv=e,Uv}var Vv,wM;function cfe(){if(wM)return Vv;wM=1;var e=ii(),t=hE(),n=ufe(),r=Object.prototype,i=r.hasOwnProperty;function a(o){if(!e(o))return n(o);var l=t(o),c=[];for(var f in o)f=="constructor"&&(l||!i.call(o,f))||c.push(f);return c}return Vv=a,Vv}var Hv,SM;function ml(){if(SM)return Hv;SM=1;var e=q6(),t=cfe(),n=pl();function r(i){return n(i)?e(i,!0):t(i)}return Hv=r,Hv}var Gv,EM;function ffe(){if(EM)return Gv;EM=1;var e=zc(),t=ml();function n(r,i){return r&&e(i,t(i),r)}return Gv=n,Gv}var Bu={exports:{}};Bu.exports;var kM;function B6(){return kM||(kM=1,function(e,t){var n=ri(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===r,o=a?n.Buffer:void 0,l=o?o.allocUnsafe:void 0;function c(f,d){if(d)return f.slice();var h=f.length,m=l?l(h):new f.constructor(h);return f.copy(m),m}e.exports=c}(Bu,Bu.exports)),Bu.exports}var Yv,AM;function pE(){if(AM)return Yv;AM=1;function e(t,n){var r=-1,i=t.length;for(n||(n=Array(i));++r<i;)n[r]=t[r];return n}return Yv=e,Yv}var Zv,TM;function dfe(){if(TM)return Zv;TM=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,a=0,o=[];++r<i;){var l=t[r];n(l,r,t)&&(o[a++]=l)}return o}return Zv=e,Zv}var Kv,CM;function U6(){if(CM)return Kv;CM=1;function e(){return[]}return Kv=e,Kv}var Xv,OM;function mE(){if(OM)return Xv;OM=1;var e=dfe(),t=U6(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(o){return o==null?[]:(o=Object(o),e(i(o),function(l){return r.call(o,l)}))}:t;return Xv=a,Xv}var Wv,NM;function hfe(){if(NM)return Wv;NM=1;var e=zc(),t=mE();function n(r,i){return e(r,t(r),i)}return Wv=n,Wv}var Qv,RM;function gE(){if(RM)return Qv;RM=1;function e(t,n){for(var r=-1,i=n.length,a=t.length;++r<i;)t[a+r]=n[r];return t}return Qv=e,Qv}var Jv,jM;function yE(){if(jM)return Jv;jM=1;var e=F6(),t=e(Object.getPrototypeOf,Object);return Jv=t,Jv}var e1,MM;function V6(){if(MM)return e1;MM=1;var e=gE(),t=yE(),n=mE(),r=U6(),i=Object.getOwnPropertySymbols,a=i?function(o){for(var l=[];o;)e(l,n(o)),o=t(o);return l}:r;return e1=a,e1}var t1,$M;function pfe(){if($M)return t1;$M=1;var e=zc(),t=V6();function n(r,i){return e(r,t(r),i)}return t1=n,t1}var n1,DM;function H6(){if(DM)return n1;DM=1;var e=gE(),t=lr();function n(r,i,a){var o=i(r);return t(r)?o:e(o,a(r))}return n1=n,n1}var r1,IM;function G6(){if(IM)return r1;IM=1;var e=H6(),t=mE(),n=qc();function r(i){return e(i,n,t)}return r1=r,r1}var i1,PM;function mfe(){if(PM)return i1;PM=1;var e=H6(),t=V6(),n=ml();function r(i){return e(i,n,t)}return i1=r,i1}var a1,LM;function gfe(){if(LM)return a1;LM=1;var e=js(),t=ri(),n=e(t,"DataView");return a1=n,a1}var s1,zM;function yfe(){if(zM)return s1;zM=1;var e=js(),t=ri(),n=e(t,"Promise");return s1=n,s1}var o1,qM;function Y6(){if(qM)return o1;qM=1;var e=js(),t=ri(),n=e(t,"Set");return o1=n,o1}var l1,FM;function bfe(){if(FM)return l1;FM=1;var e=js(),t=ri(),n=e(t,"WeakMap");return l1=n,l1}var u1,BM;function am(){if(BM)return u1;BM=1;var e=gfe(),t=sE(),n=yfe(),r=Y6(),i=bfe(),a=Rs(),o=I6(),l="[object Map]",c="[object Object]",f="[object Promise]",d="[object Set]",h="[object WeakMap]",m="[object DataView]",g=o(e),v=o(t),w=o(n),b=o(r),_=o(i),S=a;return(e&&S(new e(new ArrayBuffer(1)))!=m||t&&S(new t)!=l||n&&S(n.resolve())!=f||r&&S(new r)!=d||i&&S(new i)!=h)&&(S=function(x){var A=a(x),k=A==c?x.constructor:void 0,T=k?o(k):"";if(T)switch(T){case g:return m;case v:return l;case w:return f;case b:return d;case _:return h}return A}),u1=S,u1}var c1,UM;function vfe(){if(UM)return c1;UM=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r){var i=r.length,a=new r.constructor(i);return i&&typeof r[0]=="string"&&t.call(r,"index")&&(a.index=r.index,a.input=r.input),a}return c1=n,c1}var f1,VM;function Z6(){if(VM)return f1;VM=1;var e=ri(),t=e.Uint8Array;return f1=t,f1}var d1,HM;function bE(){if(HM)return d1;HM=1;var e=Z6();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return d1=t,d1}var h1,GM;function _fe(){if(GM)return h1;GM=1;var e=bE();function t(n,r){var i=r?e(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.byteLength)}return h1=t,h1}var p1,YM;function xfe(){if(YM)return p1;YM=1;var e=/\w*$/;function t(n){var r=new n.constructor(n.source,e.exec(n));return r.lastIndex=n.lastIndex,r}return p1=t,p1}var m1,ZM;function wfe(){if(ZM)return m1;ZM=1;var e=hl(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function r(i){return n?Object(n.call(i)):{}}return m1=r,m1}var g1,KM;function K6(){if(KM)return g1;KM=1;var e=bE();function t(n,r){var i=r?e(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.length)}return g1=t,g1}var y1,XM;function Sfe(){if(XM)return y1;XM=1;var e=bE(),t=_fe(),n=xfe(),r=wfe(),i=K6(),a="[object Boolean]",o="[object Date]",l="[object Map]",c="[object Number]",f="[object RegExp]",d="[object Set]",h="[object String]",m="[object Symbol]",g="[object ArrayBuffer]",v="[object DataView]",w="[object Float32Array]",b="[object Float64Array]",_="[object Int8Array]",S="[object Int16Array]",x="[object Int32Array]",A="[object Uint8Array]",k="[object Uint8ClampedArray]",T="[object Uint16Array]",O="[object Uint32Array]";function $(L,M,z){var P=L.constructor;switch(M){case g:return e(L);case a:case o:return new P(+L);case v:return t(L,z);case w:case b:case _:case S:case x:case A:case k:case T:case O:return i(L,z);case l:return new P;case c:case h:return new P(L);case f:return n(L);case d:return new P;case m:return r(L)}}return y1=$,y1}var b1,WM;function Efe(){if(WM)return b1;WM=1;var e=ii(),t=Object.create,n=function(){function r(){}return function(i){if(!e(i))return{};if(t)return t(i);r.prototype=i;var a=new r;return r.prototype=void 0,a}}();return b1=n,b1}var v1,QM;function X6(){if(QM)return v1;QM=1;var e=Efe(),t=yE(),n=hE();function r(i){return typeof i.constructor=="function"&&!n(i)?e(t(i)):{}}return v1=r,v1}var _1,JM;function kfe(){if(JM)return _1;JM=1;var e=am(),t=ai(),n="[object Map]";function r(i){return t(i)&&e(i)==n}return _1=r,_1}var x1,e$;function Afe(){if(e$)return x1;e$=1;var e=kfe(),t=Ms(),n=fE(),r=n&&n.isMap,i=r?t(r):e;return x1=i,x1}var w1,t$;function Tfe(){if(t$)return w1;t$=1;var e=am(),t=ai(),n="[object Set]";function r(i){return t(i)&&e(i)==n}return w1=r,w1}var S1,n$;function Cfe(){if(n$)return S1;n$=1;var e=Tfe(),t=Ms(),n=fE(),r=n&&n.isSet,i=r?t(r):e;return S1=i,S1}var E1,r$;function Ofe(){if(r$)return E1;r$=1;var e=nm(),t=P6(),n=z6(),r=lfe(),i=ffe(),a=B6(),o=pE(),l=hfe(),c=pfe(),f=G6(),d=mfe(),h=am(),m=vfe(),g=Sfe(),v=X6(),w=lr(),b=im(),_=Afe(),S=ii(),x=Cfe(),A=qc(),k=ml(),T=1,O=2,$=4,L="[object Arguments]",M="[object Array]",z="[object Boolean]",P="[object Date]",q="[object Error]",D="[object Function]",H="[object GeneratorFunction]",B="[object Map]",G="[object Number]",K="[object Object]",Q="[object RegExp]",R="[object Set]",V="[object String]",X="[object Symbol]",j="[object WeakMap]",I="[object ArrayBuffer]",U="[object DataView]",Y="[object Float32Array]",ne="[object Float64Array]",ae="[object Int8Array]",re="[object Int16Array]",le="[object Int32Array]",W="[object Uint8Array]",J="[object Uint8ClampedArray]",se="[object Uint16Array]",fe="[object Uint32Array]",me={};me[L]=me[M]=me[I]=me[U]=me[z]=me[P]=me[Y]=me[ne]=me[ae]=me[re]=me[le]=me[B]=me[G]=me[K]=me[Q]=me[R]=me[V]=me[X]=me[W]=me[J]=me[se]=me[fe]=!0,me[q]=me[D]=me[j]=!1;function xe(we,Ve,qe,We,He,$e){var Be,Ot=Ve&T,kt=Ve&O,pe=Ve&$;if(qe&&(Be=He?qe(we,We,He,$e):qe(we)),Be!==void 0)return Be;if(!S(we))return we;var _e=w(we);if(_e){if(Be=m(we),!Ot)return o(we,Be)}else{var Te=h(we),je=Te==D||Te==H;if(b(we))return a(we,Ot);if(Te==K||Te==L||je&&!He){if(Be=kt||je?{}:v(we),!Ot)return kt?c(we,i(Be,we)):l(we,r(Be,we))}else{if(!me[Te])return He?we:{};Be=g(we,Te,Ot)}}$e||($e=new e);var rt=$e.get(we);if(rt)return rt;$e.set(we,Be),x(we)?we.forEach(function($t){Be.add(xe($t,Ve,qe,$t,we,$e))}):_(we)&&we.forEach(function($t,Gt){Be.set(Gt,xe($t,Ve,qe,Gt,we,$e))});var cn=pe?kt?d:f:kt?k:A,Cn=_e?void 0:cn(we);return t(Cn||we,function($t,Gt){Cn&&(Gt=$t,$t=we[Gt]),n(Be,Gt,xe($t,Ve,qe,Gt,we,$e))}),Be}return E1=xe,E1}var k1,i$;function Nfe(){if(i$)return k1;i$=1;var e=Ofe(),t=1,n=4;function r(i){return e(i,t|n)}return k1=r,k1}var A1,a$;function Rfe(){if(a$)return A1;a$=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return A1=t,A1}var T1,s$;function jfe(){if(s$)return T1;s$=1;function e(t){return this.__data__.has(t)}return T1=e,T1}var C1,o$;function sm(){if(o$)return C1;o$=1;var e=oE(),t=Rfe(),n=jfe();function r(i){var a=-1,o=i==null?0:i.length;for(this.__data__=new e;++a<o;)this.add(i[a])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,C1=r,C1}var O1,l$;function Mfe(){if(l$)return O1;l$=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(t[r],r,t))return!0;return!1}return O1=e,O1}var N1,u$;function om(){if(u$)return N1;u$=1;function e(t,n){return t.has(n)}return N1=e,N1}var R1,c$;function W6(){if(c$)return R1;c$=1;var e=sm(),t=Mfe(),n=om(),r=1,i=2;function a(o,l,c,f,d,h){var m=c&r,g=o.length,v=l.length;if(g!=v&&!(m&&v>g))return!1;var w=h.get(o),b=h.get(l);if(w&&b)return w==l&&b==o;var _=-1,S=!0,x=c&i?new e:void 0;for(h.set(o,l),h.set(l,o);++_<g;){var A=o[_],k=l[_];if(f)var T=m?f(k,A,_,l,o,h):f(A,k,_,o,l,h);if(T!==void 0){if(T)continue;S=!1;break}if(x){if(!t(l,function(O,$){if(!n(x,$)&&(A===O||d(A,O,c,f,h)))return x.push($)})){S=!1;break}}else if(!(A===k||d(A,k,c,f,h))){S=!1;break}}return h.delete(o),h.delete(l),S}return R1=a,R1}var j1,f$;function $fe(){if(f$)return j1;f$=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i,a){r[++n]=[a,i]}),r}return j1=e,j1}var M1,d$;function vE(){if(d$)return M1;d$=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i){r[++n]=i}),r}return M1=e,M1}var $1,h$;function Dfe(){if(h$)return $1;h$=1;var e=hl(),t=Z6(),n=dl(),r=W6(),i=$fe(),a=vE(),o=1,l=2,c="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Map]",m="[object Number]",g="[object RegExp]",v="[object Set]",w="[object String]",b="[object Symbol]",_="[object ArrayBuffer]",S="[object DataView]",x=e?e.prototype:void 0,A=x?x.valueOf:void 0;function k(T,O,$,L,M,z,P){switch($){case S:if(T.byteLength!=O.byteLength||T.byteOffset!=O.byteOffset)return!1;T=T.buffer,O=O.buffer;case _:return!(T.byteLength!=O.byteLength||!z(new t(T),new t(O)));case c:case f:case m:return n(+T,+O);case d:return T.name==O.name&&T.message==O.message;case g:case w:return T==O+"";case h:var q=i;case v:var D=L&o;if(q||(q=a),T.size!=O.size&&!D)return!1;var H=P.get(T);if(H)return H==O;L|=l,P.set(T,O);var B=r(q(T),q(O),L,M,z,P);return P.delete(T),B;case b:if(A)return A.call(T)==A.call(O)}return!1}return $1=k,$1}var D1,p$;function Ife(){if(p$)return D1;p$=1;var e=G6(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(a,o,l,c,f,d){var h=l&t,m=e(a),g=m.length,v=e(o),w=v.length;if(g!=w&&!h)return!1;for(var b=g;b--;){var _=m[b];if(!(h?_ in o:r.call(o,_)))return!1}var S=d.get(a),x=d.get(o);if(S&&x)return S==o&&x==a;var A=!0;d.set(a,o),d.set(o,a);for(var k=h;++b<g;){_=m[b];var T=a[_],O=o[_];if(c)var $=h?c(O,T,_,o,a,d):c(T,O,_,a,o,d);if(!($===void 0?T===O||f(T,O,l,c,d):$)){A=!1;break}k||(k=_=="constructor")}if(A&&!k){var L=a.constructor,M=o.constructor;L!=M&&"constructor"in a&&"constructor"in o&&!(typeof L=="function"&&L instanceof L&&typeof M=="function"&&M instanceof M)&&(A=!1)}return d.delete(a),d.delete(o),A}return D1=i,D1}var I1,m$;function Pfe(){if(m$)return I1;m$=1;var e=nm(),t=W6(),n=Dfe(),r=Ife(),i=am(),a=lr(),o=im(),l=dE(),c=1,f="[object Arguments]",d="[object Array]",h="[object Object]",m=Object.prototype,g=m.hasOwnProperty;function v(w,b,_,S,x,A){var k=a(w),T=a(b),O=k?d:i(w),$=T?d:i(b);O=O==f?h:O,$=$==f?h:$;var L=O==h,M=$==h,z=O==$;if(z&&o(w)){if(!o(b))return!1;k=!0,L=!1}if(z&&!L)return A||(A=new e),k||l(w)?t(w,b,_,S,x,A):n(w,b,O,_,S,x,A);if(!(_&c)){var P=L&&g.call(w,"__wrapped__"),q=M&&g.call(b,"__wrapped__");if(P||q){var D=P?w.value():w,H=q?b.value():b;return A||(A=new e),x(D,H,_,S,A)}}return z?(A||(A=new e),r(w,b,_,S,x,A)):!1}return I1=v,I1}var P1,g$;function _E(){if(g$)return P1;g$=1;var e=Pfe(),t=ai();function n(r,i,a,o,l){return r===i?!0:r==null||i==null||!t(r)&&!t(i)?r!==r&&i!==i:e(r,i,a,o,n,l)}return P1=n,P1}var L1,y$;function Q6(){if(y$)return L1;y$=1;var e=_E();function t(n,r){return e(n,r)}return L1=t,L1}var z1,b$;function Lfe(){if(b$)return z1;b$=1;var e=hl(),t=rm(),n=lr(),r=e?e.isConcatSpreadable:void 0;function i(a){return n(a)||t(a)||!!(r&&a&&a[r])}return z1=i,z1}var q1,v$;function xE(){if(v$)return q1;v$=1;var e=gE(),t=Lfe();function n(r,i,a,o,l){var c=-1,f=r.length;for(a||(a=t),l||(l=[]);++c<f;){var d=r[c];i>0&&a(d)?i>1?n(d,i-1,a,o,l):e(l,d):o||(l[l.length]=d)}return l}return q1=n,q1}var F1,_$;function $s(){if(_$)return F1;_$=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,a=Array(i);++r<i;)a[r]=n(t[r],r,t);return a}return F1=e,F1}var B1,x$;function lm(){if(x$)return B1;x$=1;var e=Rs(),t=ai(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return B1=r,B1}var U1,w$;function wE(){if(w$)return U1;w$=1;var e=lr(),t=lm(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){if(e(a))return!1;var l=typeof a;return l=="number"||l=="symbol"||l=="boolean"||a==null||t(a)?!0:r.test(a)||!n.test(a)||o!=null&&a in Object(o)}return U1=i,U1}var V1,S$;function zfe(){if(S$)return V1;S$=1;var e=oE(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,l=i?i.apply(this,o):o[0],c=a.cache;if(c.has(l))return c.get(l);var f=r.apply(this,o);return a.cache=c.set(l,f)||c,f};return a.cache=new(n.Cache||e),a}return n.Cache=e,V1=n,V1}var H1,E$;function qfe(){if(E$)return H1;E$=1;var e=zfe(),t=500;function n(r){var i=e(r,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return H1=n,H1}var G1,k$;function Ffe(){if(k$)return G1;k$=1;var e=qfe(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,l,c,f){a.push(c?f.replace(n,"$1"):l||o)}),a});return G1=r,G1}var Y1,A$;function Bfe(){if(A$)return Y1;A$=1;var e=hl(),t=$s(),n=lr(),r=lm(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(l){if(typeof l=="string")return l;if(n(l))return t(l,o)+"";if(r(l))return a?a.call(l):"";var c=l+"";return c=="0"&&1/l==-1/0?"-0":c}return Y1=o,Y1}var Z1,T$;function Ufe(){if(T$)return Z1;T$=1;var e=Bfe();function t(n){return n==null?"":e(n)}return Z1=t,Z1}var K1,C$;function J6(){if(C$)return K1;C$=1;var e=lr(),t=wE(),n=Ffe(),r=Ufe();function i(a,o){return e(a)?a:t(a,o)?[a]:n(r(a))}return K1=i,K1}var X1,O$;function um(){if(O$)return X1;O$=1;var e=lm();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return X1=t,X1}var W1,N$;function SE(){if(N$)return W1;N$=1;var e=J6(),t=um();function n(r,i){i=e(i,r);for(var a=0,o=i.length;r!=null&&a<o;)r=r[t(i[a++])];return a&&a==o?r:void 0}return W1=n,W1}var Q1,R$;function Vfe(){if(R$)return Q1;R$=1;var e=nm(),t=_E(),n=1,r=2;function i(a,o,l,c){var f=l.length,d=f,h=!c;if(a==null)return!d;for(a=Object(a);f--;){var m=l[f];if(h&&m[2]?m[1]!==a[m[0]]:!(m[0]in a))return!1}for(;++f<d;){m=l[f];var g=m[0],v=a[g],w=m[1];if(h&&m[2]){if(v===void 0&&!(g in a))return!1}else{var b=new e;if(c)var _=c(v,w,g,a,o,b);if(!(_===void 0?t(w,v,n|r,c,b):_))return!1}}return!0}return Q1=i,Q1}var J1,j$;function eL(){if(j$)return J1;j$=1;var e=ii();function t(n){return n===n&&!e(n)}return J1=t,J1}var e_,M$;function Hfe(){if(M$)return e_;M$=1;var e=eL(),t=qc();function n(r){for(var i=t(r),a=i.length;a--;){var o=i[a],l=r[o];i[a]=[o,l,e(l)]}return i}return e_=n,e_}var t_,$$;function tL(){if($$)return t_;$$=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return t_=e,t_}var n_,D$;function Gfe(){if(D$)return n_;D$=1;var e=Vfe(),t=Hfe(),n=tL();function r(i){var a=t(i);return a.length==1&&a[0][2]?n(a[0][0],a[0][1]):function(o){return o===i||e(o,i,a)}}return n_=r,n_}var r_,I$;function Yfe(){if(I$)return r_;I$=1;var e=SE();function t(n,r,i){var a=n==null?void 0:e(n,r);return a===void 0?i:a}return r_=t,r_}var i_,P$;function Zfe(){if(P$)return i_;P$=1;function e(t,n){return t!=null&&n in Object(t)}return i_=e,i_}var a_,L$;function Kfe(){if(L$)return a_;L$=1;var e=J6(),t=rm(),n=lr(),r=uE(),i=cE(),a=um();function o(l,c,f){c=e(c,l);for(var d=-1,h=c.length,m=!1;++d<h;){var g=a(c[d]);if(!(m=l!=null&&f(l,g)))break;l=l[g]}return m||++d!=h?m:(h=l==null?0:l.length,!!h&&i(h)&&r(g,h)&&(n(l)||t(l)))}return a_=o,a_}var s_,z$;function Xfe(){if(z$)return s_;z$=1;var e=Zfe(),t=Kfe();function n(r,i){return r!=null&&t(r,i,e)}return s_=n,s_}var o_,q$;function Wfe(){if(q$)return o_;q$=1;var e=_E(),t=Yfe(),n=Xfe(),r=wE(),i=eL(),a=tL(),o=um(),l=1,c=2;function f(d,h){return r(d)&&i(h)?a(o(d),h):function(m){var g=t(m,d);return g===void 0&&g===h?n(m,d):e(h,g,l|c)}}return o_=f,o_}var l_,F$;function Fc(){if(F$)return l_;F$=1;function e(t){return t}return l_=e,l_}var u_,B$;function Qfe(){if(B$)return u_;B$=1;function e(t){return function(n){return n==null?void 0:n[t]}}return u_=e,u_}var c_,U$;function Jfe(){if(U$)return c_;U$=1;var e=SE();function t(n){return function(r){return e(r,n)}}return c_=t,c_}var f_,V$;function ede(){if(V$)return f_;V$=1;var e=Qfe(),t=Jfe(),n=wE(),r=um();function i(a){return n(a)?e(r(a)):t(a)}return f_=i,f_}var d_,H$;function tde(){if(H$)return d_;H$=1;var e=Gfe(),t=Wfe(),n=Fc(),r=lr(),i=ede();function a(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):i(o)}return d_=a,d_}var h_,G$;function nde(){if(G$)return h_;G$=1;function e(t){return function(n,r,i){for(var a=-1,o=Object(n),l=i(n),c=l.length;c--;){var f=l[t?c:++a];if(r(o[f],f,o)===!1)break}return n}}return h_=e,h_}var p_,Y$;function nL(){if(Y$)return p_;Y$=1;var e=nde(),t=e();return p_=t,p_}var m_,Z$;function rde(){if(Z$)return m_;Z$=1;var e=nL(),t=qc();function n(r,i){return r&&e(r,i,t)}return m_=n,m_}var g_,K$;function ide(){if(K$)return g_;K$=1;var e=pl();function t(n,r){return function(i,a){if(i==null)return i;if(!e(i))return n(i,a);for(var o=i.length,l=r?o:-1,c=Object(i);(r?l--:++l<o)&&a(c[l],l,c)!==!1;);return i}}return g_=t,g_}var y_,X$;function rL(){if(X$)return y_;X$=1;var e=rde(),t=ide(),n=t(e);return y_=n,y_}var b_,W$;function ade(){if(W$)return b_;W$=1;var e=rL(),t=pl();function n(r,i){var a=-1,o=t(r)?Array(r.length):[];return e(r,function(l,c,f){o[++a]=i(l,c,f)}),o}return b_=n,b_}var v_,Q$;function sde(){if(Q$)return v_;Q$=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return v_=e,v_}var __,J$;function ode(){if(J$)return __;J$=1;var e=lm();function t(n,r){if(n!==r){var i=n!==void 0,a=n===null,o=n===n,l=e(n),c=r!==void 0,f=r===null,d=r===r,h=e(r);if(!f&&!h&&!l&&n>r||l&&c&&d&&!f&&!h||a&&c&&d||!i&&d||!o)return 1;if(!a&&!l&&!h&&n<r||h&&i&&o&&!a&&!l||f&&i&&o||!c&&o||!d)return-1}return 0}return __=t,__}var x_,e4;function lde(){if(e4)return x_;e4=1;var e=ode();function t(n,r,i){for(var a=-1,o=n.criteria,l=r.criteria,c=o.length,f=i.length;++a<c;){var d=e(o[a],l[a]);if(d){if(a>=f)return d;var h=i[a];return d*(h=="desc"?-1:1)}}return n.index-r.index}return x_=t,x_}var w_,t4;function ude(){if(t4)return w_;t4=1;var e=$s(),t=SE(),n=tde(),r=ade(),i=sde(),a=Ms(),o=lde(),l=Fc(),c=lr();function f(d,h,m){h.length?h=e(h,function(w){return c(w)?function(b){return t(b,w.length===1?w[0]:w)}:w}):h=[l];var g=-1;h=e(h,a(n));var v=r(d,function(w,b,_){var S=e(h,function(x){return x(w)});return{criteria:S,index:++g,value:w}});return i(v,function(w,b){return o(w,b,m)})}return w_=f,w_}var S_,n4;function iL(){if(n4)return S_;n4=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return S_=e,S_}var E_,r4;function cde(){if(r4)return E_;r4=1;var e=iL(),t=Math.max;function n(r,i,a){return i=t(i===void 0?r.length-1:i,0),function(){for(var o=arguments,l=-1,c=t(o.length-i,0),f=Array(c);++l<c;)f[l]=o[i+l];l=-1;for(var d=Array(i+1);++l<i;)d[l]=o[l];return d[i]=a(f),e(r,this,d)}}return E_=n,E_}var k_,i4;function fde(){if(i4)return k_;i4=1;function e(t){return function(){return t}}return k_=e,k_}var A_,a4;function dde(){if(a4)return A_;a4=1;var e=fde(),t=L6(),n=Fc(),r=t?function(i,a){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:n;return A_=r,A_}var T_,s4;function hde(){if(s4)return T_;s4=1;var e=800,t=16,n=Date.now;function r(i){var a=0,o=0;return function(){var l=n(),c=t-(l-o);if(o=l,c>0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return T_=r,T_}var C_,o4;function pde(){if(o4)return C_;o4=1;var e=dde(),t=hde(),n=t(e);return C_=n,C_}var O_,l4;function Ds(){if(l4)return O_;l4=1;var e=Fc(),t=cde(),n=pde();function r(i,a){return n(t(i,a,e),i+"")}return O_=r,O_}var N_,u4;function EE(){if(u4)return N_;u4=1;var e=dl(),t=pl(),n=uE(),r=ii();function i(a,o,l){if(!r(l))return!1;var c=typeof o;return(c=="number"?t(l)&&n(o,l.length):c=="string"&&o in l)?e(l[o],a):!1}return N_=i,N_}var R_,c4;function aL(){if(c4)return R_;c4=1;var e=xE(),t=ude(),n=Ds(),r=EE(),i=n(function(a,o){if(a==null)return[];var l=o.length;return l>1&&r(a,o[0],o[1])?o=[]:l>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return R_=i,R_}var j_,f4;function mde(){if(f4)return j_;f4=1;function e(t,n,r,i){for(var a=t.length,o=r+(i?1:-1);i?o--:++o<a;)if(n(t[o],o,t))return o;return-1}return j_=e,j_}var M_,d4;function gde(){if(d4)return M_;d4=1;function e(t){return t!==t}return M_=e,M_}var $_,h4;function yde(){if(h4)return $_;h4=1;function e(t,n,r){for(var i=r-1,a=t.length;++i<a;)if(t[i]===n)return i;return-1}return $_=e,$_}var D_,p4;function sL(){if(p4)return D_;p4=1;var e=mde(),t=gde(),n=yde();function r(i,a,o){return a===a?n(i,a,o):e(i,t,o)}return D_=r,D_}var I_,m4;function kE(){if(m4)return I_;m4=1;var e=sL();function t(n,r){var i=n==null?0:n.length;return!!i&&e(n,r,0)>-1}return I_=t,I_}var P_,g4;function AE(){if(g4)return P_;g4=1;function e(t,n,r){for(var i=-1,a=t==null?0:t.length;++i<a;)if(r(n,t[i]))return!0;return!1}return P_=e,P_}var L_,y4;function bde(){if(y4)return L_;y4=1;function e(){}return L_=e,L_}var z_,b4;function vde(){if(b4)return z_;b4=1;var e=Y6(),t=bde(),n=vE(),r=1/0,i=e&&1/n(new e([,-0]))[1]==r?function(a){return new e(a)}:t;return z_=i,z_}var q_,v4;function oL(){if(v4)return q_;v4=1;var e=sm(),t=kE(),n=AE(),r=om(),i=vde(),a=vE(),o=200;function l(c,f,d){var h=-1,m=t,g=c.length,v=!0,w=[],b=w;if(d)v=!1,m=n;else if(g>=o){var _=f?null:i(c);if(_)return a(_);v=!1,m=r,b=new e}else b=f?[]:w;e:for(;++h<g;){var S=c[h],x=f?f(S):S;if(S=d||S!==0?S:0,v&&x===x){for(var A=b.length;A--;)if(b[A]===x)continue e;f&&b.push(x),w.push(S)}else m(b,x,d)||(b!==w&&b.push(x),w.push(S))}return w}return q_=l,q_}var F_,_4;function TE(){if(_4)return F_;_4=1;var e=oL();function t(n){return n&&n.length?e(n):[]}return F_=t,F_}var B_,x4;function CE(){if(x4)return B_;x4=1;var e=oL();function t(n,r){return r=typeof r=="function"?r:void 0,n&&n.length?e(n,void 0,r):[]}return B_=t,B_}var U_,w4;function _de(){if(w4)return U_;w4=1;var e=Ds(),t=dl(),n=EE(),r=ml(),i=Object.prototype,a=i.hasOwnProperty,o=e(function(l,c){l=Object(l);var f=-1,d=c.length,h=d>2?c[2]:void 0;for(h&&n(c[0],c[1],h)&&(d=1);++f<d;)for(var m=c[f],g=r(m),v=-1,w=g.length;++v<w;){var b=g[v],_=l[b];(_===void 0||t(_,i[b])&&!a.call(l,b))&&(l[b]=m[b])}return l});return U_=o,U_}var V_,S4;function lL(){if(S4)return V_;S4=1;var e=sm(),t=kE(),n=AE(),r=$s(),i=Ms(),a=om(),o=Math.min;function l(c,f,d){for(var h=d?n:t,m=c[0].length,g=c.length,v=g,w=Array(g),b=1/0,_=[];v--;){var S=c[v];v&&f&&(S=r(S,i(f))),b=o(S.length,b),w[v]=!d&&(f||m>=120&&S.length>=120)?new e(v&&S):void 0}S=c[0];var x=-1,A=w[0];e:for(;++x<m&&_.length<b;){var k=S[x],T=f?f(k):k;if(k=d||k!==0?k:0,!(A?a(A,T):h(_,T,d))){for(v=g;--v;){var O=w[v];if(!(O?a(O,T):h(c[v],T,d)))continue e}A&&A.push(T),_.push(k)}}return _}return V_=l,V_}var H_,E4;function OE(){if(E4)return H_;E4=1;var e=pl(),t=ai();function n(r){return t(r)&&e(r)}return H_=n,H_}var G_,k4;function uL(){if(k4)return G_;k4=1;var e=OE();function t(n){return e(n)?n:[]}return G_=t,G_}var Y_,A4;function xde(){if(A4)return Y_;A4=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return Y_=e,Y_}var Z_,T4;function cL(){if(T4)return Z_;T4=1;var e=$s(),t=lL(),n=Ds(),r=uL(),i=xde(),a=n(function(o){var l=i(o),c=e(o,r);return l=typeof l=="function"?l:void 0,l&&c.pop(),c.length&&c[0]===o[0]?t(c,void 0,l):[]});return Z_=a,Z_}var K_,C4;function cm(){if(C4)return K_;C4=1;var e=Rs(),t=yE(),n=ai(),r="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,l=a.hasOwnProperty,c=o.call(Object);function f(d){if(!n(d)||e(d)!=r)return!1;var h=t(d);if(h===null)return!0;var m=l.call(h,"constructor")&&h.constructor;return typeof m=="function"&&m instanceof m&&o.call(m)==c}return K_=f,K_}var X_,O4;function wde(){if(O4)return X_;O4=1;var e=Rs(),t=ai(),n="[object Boolean]";function r(i){return i===!0||i===!1||t(i)&&e(i)==n}return X_=r,X_}var W_,N4;function NE(){if(N4)return W_;N4=1;var e=Q6(),t=aL(),n=TE(),r=CE(),i=_de(),a=cL(),o=cm(),l=wde(),c=q=>Array.isArray(q)?q:[q],f=q=>q===void 0,d=q=>o(q)||Array.isArray(q)?Object.keys(q):[],h=(q,D)=>q.hasOwnProperty(D),m=q=>t(n(q)),g=q=>f(q)||Array.isArray(q)&&q.length===0,v=(q,D,H,B)=>D&&h(D,H)&&q&&h(q,H)&&B(q[H],D[H]),w=(q,D)=>f(q)&&D===0||f(D)&&q===0||e(q,D),b=(q,D)=>f(q)&&D===!1||f(D)&&q===!1||e(q,D),_=q=>f(q)||e(q,{})||q===!0,S=q=>f(q)||e(q,{}),x=q=>f(q)||o(q)||q===!0||q===!1;function A(q,D){return g(q)&&g(D)?!0:e(m(q),m(D))}function k(q,D){return q=c(q),D=c(D),e(m(q),m(D))}function T(q,D,H,B){var G=n(d(q).concat(d(D)));return S(q)&&S(D)?!0:S(q)&&d(D).length||S(D)&&d(q).length?!1:G.every(function(K){var Q=q[K],R=D[K];return Array.isArray(Q)&&Array.isArray(R)?e(m(q),m(D)):Array.isArray(Q)&&!Array.isArray(R)||Array.isArray(R)&&!Array.isArray(Q)?!1:v(q,D,K,B)})}function O(q,D,H,B){return o(q)&&o(D)?B(q,D):Array.isArray(q)&&Array.isArray(D)?T(q,D,H,B):e(q,D)}function $(q,D,H,B){var G=r(q,B),K=r(D,B),Q=a(G,K,B);return Q.length===Math.max(G.length,K.length)}var L={title:e,uniqueItems:b,minLength:w,minItems:w,minProperties:w,required:A,enum:A,type:k,items:O,anyOf:$,allOf:$,oneOf:$,properties:T,patternProperties:T,dependencies:T},M=["properties","patternProperties","dependencies","uniqueItems","minLength","minItems","minProperties","required"],z=["additionalProperties","additionalItems","contains","propertyNames","not"];function P(q,D,H){if(H=i(H,{ignore:[]}),_(q)&&_(D))return!0;if(!x(q)||!x(D))throw new Error("Either of the values are not a JSON schema.");if(q===D)return!0;if(l(q)&&l(D))return q===D;if(q===void 0&&D===!1||D===void 0&&q===!1||f(q)&&!f(D)||!f(q)&&f(D))return!1;var B=n(Object.keys(q).concat(Object.keys(D)));if(H.ignore.length&&(B=B.filter(K=>H.ignore.indexOf(K)===-1)),!B.length)return!0;function G(K,Q){return P(K,Q,H)}return B.every(function(K){var Q=q[K],R=D[K];if(z.indexOf(K)!==-1)return P(Q,R,H);var V=L[K];if(V||(V=e),e(Q,R))return!0;if(M.indexOf(K)===-1&&(!h(q,K)&&h(D,K)||h(q,K)&&!h(D,K)))return Q===R;var X=V(Q,R,K,G);if(!l(X))throw new Error("Comparer must return true or false");return X})}return W_=P,W_}var Q_,R4;function RE(){if(R4)return Q_;R4=1;function e(t){return Object.prototype.toString.call(t)==="[object Array]"}return Q_=Array.isArray||e,Q_}var J_,j4;function Sde(){if(j4)return J_;j4=1;function e(t){return(typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]")&&t.valueOf()===t.valueOf()}return J_=e,J_}var ex,M4;function Ede(){if(M4)return ex;M4=1;var e=Sde();function t(n){return e(n)&&n%1===0}return ex=t,ex}var tx,$4;function fL(){if($4)return tx;$4=1;var e=RE(),t=Ede();function n(r){var i;if(!e(r)||(i=r.length,!i))return!1;for(var a=0;a<i;a++)if(!t(r[a]))return!1;return!0}return tx=n,tx}var nx,D4;function dL(){if(D4)return nx;D4=1;function e(t){return typeof t=="function"}return nx=e,nx}var rx,I4;function kde(){if(I4)return rx;I4=1;var e=RE(),t=fL(),n=dL(),r=Math.pow(2,31)-1;function i(l,c){var f=1,d;if(l===0)return c;if(c===0)return l;for(;l%2===0&&c%2===0;)l=l/2,c=c/2,f=f*2;for(;l%2===0;)l=l/2;for(;c;){for(;c%2===0;)c=c/2;l>c&&(d=c,c=l,l=d),c=c-l}return f*l}function a(l,c){var f=0,d;if(l===0)return c;if(c===0)return l;for(;(l&1)===0&&(c&1)===0;)l>>>=1,c>>>=1,f++;for(;(l&1)===0;)l>>>=1;for(;c;){for(;(c&1)===0;)c>>>=1;l>c&&(d=c,c=l,l=d),c=c-l}return l<<f}function o(){var l=arguments.length,c,f,d,h,m,g,v;for(c=new Array(l),v=0;v<l;v++)c[v]=arguments[v];if(t(c)){if(l===2)return m=c[0],g=c[1],m<0&&(m=-m),g<0&&(g=-g),m<=r&&g<=r?a(m,g):i(m,g);d=c}else if(e(c[0]))if(l>1){if(d=c[0],f=c[1],!n(f))throw new TypeError("gcd()::invalid input argument. Accessor must be a function. Value: `"+f+"`.")}else d=c[0];else throw new TypeError("gcd()::invalid input argument. Must provide an array of integers. Value: `"+c[0]+"`.");if(h=d.length,h<2)return null;if(f){for(m=new Array(h),v=0;v<h;v++)m[v]=f(d[v],v);d=m}if(l<3&&!t(d))throw new TypeError("gcd()::invalid input argument. Accessed array values must be integers. Value: `"+d+"`.");for(v=0;v<h;v++)m=d[v],m<0&&(d[v]=-m);for(m=d[0],v=1;v<h;v++)g=d[v],g<=r&&m<=r?m=a(m,g):m=i(m,g);return m}return rx=o,rx}var ix,P4;function Ade(){if(P4)return ix;P4=1;var e=kde(),t=RE(),n=fL(),r=dL();function i(){var a=arguments.length,o,l,c,f,d,h,m;for(o=new Array(a),m=0;m<a;m++)o[m]=arguments[m];if(n(o)){if(a===2)return d=o[0],h=o[1],d<0&&(d=-d),h<0&&(h=-h),d===0||h===0?0:d/e(d,h)*h;c=o}else if(t(o[0]))if(a>1){if(c=o[0],l=o[1],!r(l))throw new TypeError("lcm()::invalid input argument. Accessor must be a function. Value: `"+l+"`.")}else c=o[0];else throw new TypeError("lcm()::invalid input argument. Must provide an array of integers. Value: `"+o[0]+"`.");if(f=c.length,f<2)return null;if(l){for(d=new Array(f),m=0;m<f;m++)d[m]=l(c[m],m);c=d}if(a<3&&!n(c))throw new TypeError("lcm()::invalid input argument. Accessed array values must be integers. Value: `"+c+"`.");for(m=0;m<f;m++)d=c[m],d<0&&(c[m]=-d);for(d=c[0],m=1;m<f;m++){if(h=c[m],d===0||h===0)return 0;d=d/e(d,h)*h}return d}return ix=i,ix}var ax,L4;function hL(){if(L4)return ax;L4=1;var e=lE(),t=dl();function n(r,i,a){(a!==void 0&&!t(r[i],a)||a===void 0&&!(i in r))&&e(r,i,a)}return ax=n,ax}var sx,z4;function pL(){if(z4)return sx;z4=1;function e(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}return sx=e,sx}var ox,q4;function Tde(){if(q4)return ox;q4=1;var e=zc(),t=ml();function n(r){return e(r,t(r))}return ox=n,ox}var lx,F4;function Cde(){if(F4)return lx;F4=1;var e=hL(),t=B6(),n=K6(),r=pE(),i=X6(),a=rm(),o=lr(),l=OE(),c=im(),f=aE(),d=ii(),h=cm(),m=dE(),g=pL(),v=Tde();function w(b,_,S,x,A,k,T){var O=g(b,S),$=g(_,S),L=T.get($);if(L){e(b,S,L);return}var M=k?k(O,$,S+"",b,_,T):void 0,z=M===void 0;if(z){var P=o($),q=!P&&c($),D=!P&&!q&&m($);M=$,P||q||D?o(O)?M=O:l(O)?M=r(O):q?(z=!1,M=t($,!0)):D?(z=!1,M=n($,!0)):M=[]:h($)||a($)?(M=O,a(O)?M=v(O):(!d(O)||f(O))&&(M=i($))):z=!1}z&&(T.set($,M),A(M,$,x,k,T),T.delete($)),e(b,S,M)}return lx=w,lx}var ux,B4;function mL(){if(B4)return ux;B4=1;var e=nm(),t=hL(),n=nL(),r=Cde(),i=ii(),a=ml(),o=pL();function l(c,f,d,h,m){c!==f&&n(f,function(g,v){if(m||(m=new e),i(g))r(c,f,v,d,l,h,m);else{var w=h?h(o(c,v),g,v+"",c,f,m):void 0;w===void 0&&(w=g),t(c,v,w)}},a)}return ux=l,ux}var cx,U4;function Ode(){if(U4)return cx;U4=1;var e=mL(),t=ii();function n(r,i,a,o,l,c){return t(r)&&t(i)&&(c.set(i,r),e(r,i,void 0,n,c),c.delete(i)),r}return cx=n,cx}var fx,V4;function Nde(){if(V4)return fx;V4=1;var e=Ds(),t=EE();function n(r){return e(function(i,a){var o=-1,l=a.length,c=l>1?a[l-1]:void 0,f=l>2?a[2]:void 0;for(c=r.length>3&&typeof c=="function"?(l--,c):void 0,f&&t(a[0],a[1],f)&&(c=l<3?void 0:c,l=1),i=Object(i);++o<l;){var d=a[o];d&&r(i,d,o,c)}return i})}return fx=n,fx}var dx,H4;function Rde(){if(H4)return dx;H4=1;var e=mL(),t=Nde(),n=t(function(r,i,a,o){e(r,i,a,o)});return dx=n,dx}var hx,G4;function jde(){if(G4)return hx;G4=1;var e=iL(),t=Ds(),n=Ode(),r=Rde(),i=t(function(a){return a.push(void 0,n),e(r,void 0,a)});return hx=i,hx}var px,Y4;function gL(){if(Y4)return px;Y4=1;var e=xE();function t(n){var r=n==null?0:n.length;return r?e(n,1):[]}return px=t,px}var mx,Z4;function yL(){if(Z4)return mx;Z4=1;var e=xE(),t=1/0;function n(r){var i=r==null?0:r.length;return i?e(r,t):[]}return mx=n,mx}var gx,K4;function Mde(){if(K4)return gx;K4=1;var e=$s(),t=lL(),n=Ds(),r=uL(),i=n(function(a){var o=e(a,r);return o.length&&o[0]===a[0]?t(o):[]});return gx=i,gx}var yx,X4;function $de(){if(X4)return yx;X4=1;function e(t,n,r,i){for(var a=r-1,o=t.length;++a<o;)if(i(t[a],n))return a;return-1}return yx=e,yx}var bx,W4;function Dde(){if(W4)return bx;W4=1;var e=$s(),t=sL(),n=$de(),r=Ms(),i=pE(),a=Array.prototype,o=a.splice;function l(c,f,d,h){var m=h?n:t,g=-1,v=f.length,w=c;for(c===f&&(f=i(f)),d&&(w=e(c,r(d)));++g<v;)for(var b=0,_=f[g],S=d?d(_):_;(b=m(w,S,b,h))>-1;)w!==c&&o.call(w,b,1),o.call(c,b,1);return c}return bx=l,bx}var vx,Q4;function Ide(){if(Q4)return vx;Q4=1;var e=Dde();function t(n,r){return n&&n.length&&r&&r.length?e(n,r):n}return vx=t,vx}var _x,J4;function Pde(){if(J4)return _x;J4=1;var e=Fc();function t(n){return typeof n=="function"?n:e}return _x=t,_x}var xx,eD;function bL(){if(eD)return xx;eD=1;var e=P6(),t=rL(),n=Pde(),r=lr();function i(a,o){var l=r(a)?e:t;return l(a,n(o))}return xx=i,xx}var wx,tD;function Lde(){if(tD)return wx;tD=1;var e=sm(),t=kE(),n=AE(),r=$s(),i=Ms(),a=om(),o=200;function l(c,f,d,h){var m=-1,g=t,v=!0,w=c.length,b=[],_=f.length;if(!w)return b;d&&(f=r(f,i(d))),h?(g=n,v=!1):f.length>=o&&(g=a,v=!1,f=new e(f));e:for(;++m<w;){var S=c[m],x=d==null?S:d(S);if(S=h||S!==0?S:0,v&&x===x){for(var A=_;A--;)if(f[A]===x)continue e;b.push(S)}else g(f,x,h)||b.push(S)}return b}return wx=l,wx}var Sx,nD;function zde(){if(nD)return Sx;nD=1;var e=Lde(),t=Ds(),n=OE(),r=t(function(i,a){return n(i)?e(i,a):[]});return Sx=r,Sx}var Ex,rD;function vL(){if(rD)return Ex;rD=1;const e=gL(),t=yL(),n=cm(),r=TE(),i=CE(),a=zde();function o(w){for(const b in w)f(w,b)&&g(w[b])&&delete w[b];return w}const l=w=>r(t(w.map(d))),c=(w,b)=>w.map(_=>_&&_[b]),f=(w,b)=>Object.prototype.hasOwnProperty.call(w,b),d=w=>n(w)||Array.isArray(w)?Object.keys(w):[],h=w=>w!==void 0,m=w=>n(w)||w===!0||w===!1,g=w=>!d(w).length&&w!==!1&&w!==!0;return Ex={allUniqueKeys:l,deleteUndefinedProps:o,getValues:c,has:f,isEmptySchema:g,isSchema:m,keys:d,notUndefined:h,uniqWith:i,withoutArr:(w,...b)=>a.apply(null,[w].concat(e(b)))},Ex}var kx,iD;function qde(){if(iD)return kx;iD=1;const e=NE(),t=bL(),{allUniqueKeys:n,deleteUndefinedProps:r,getValues:i,keys:a,notUndefined:o,uniqWith:l,withoutArr:c}=vL();function f(h){t(h,function(m,g){m===!1&&delete h[g]})}function d(h,m){return n(h).reduce(function(v,w){const b=i(h,w),_=l(b.filter(o),e);return v[w]=m(_,w),v},{})}return kx={keywords:["properties","patternProperties","additionalProperties"],resolver(h,m,g,v){v.ignoreAdditionalProperties||(h.forEach(function(b){const _=h.filter(k=>k!==b),S=a(b.properties),A=a(b.patternProperties).map(k=>new RegExp(k));_.forEach(function(k){const T=a(k.properties),O=T.filter(L=>A.some(M=>M.test(L)));c(T,S,O).forEach(function(L){k.properties[L]=g.properties([k.properties[L],b.additionalProperties],L)})})}),h.forEach(function(b){const _=h.filter(x=>x!==b),S=a(b.patternProperties);b.additionalProperties===!1&&_.forEach(function(x){const A=a(x.patternProperties);c(A,S).forEach(T=>delete x.patternProperties[T])})}));const w={additionalProperties:g.additionalProperties(h.map(b=>b.additionalProperties)),patternProperties:d(h.map(b=>b.patternProperties),g.patternProperties),properties:d(h.map(b=>b.properties),g.properties)};return w.additionalProperties===!1&&f(w.properties),r(w)}},kx}var Ax,aD;function Fde(){if(aD)return Ax;aD=1;const e=NE(),t=bL(),{allUniqueKeys:n,deleteUndefinedProps:r,has:i,isSchema:a,notUndefined:o,uniqWith:l}=vL();function c(m){t(m,function(g,v){g===!1&&m.splice(v,1)})}function f(m,g){return m.map(function(v){if(v)if(Array.isArray(v.items)){const w=v.items[g];if(a(w))return w;if(i(v,"additionalItems"))return v.additionalItems}else return v.items})}function d(m){return m.map(function(g){if(g)return Array.isArray(g.items)?g.additionalItems:g.items})}function h(m,g,v){return n(v).reduce(function(b,_){const S=f(m,_),x=l(S.filter(o),e);return b[_]=g(x,_),b},[])}return Ax={keywords:["items","additionalItems"],resolver(m,g,v){const w=m.map(x=>x.items),b=w.filter(o),_={};b.every(a)?_.items=v.items(w):_.items=h(m,v.items,w);let S;return b.every(Array.isArray)?S=m.map(x=>x.additionalItems):b.some(Array.isArray)&&(S=d(m)),S&&(_.additionalItems=v.additionalItems(S)),_.additionalItems===!1&&Array.isArray(_.items)&&c(_.items),r(_)}},Ax}var Tx,sD;function Bde(){if(sD)return Tx;sD=1;const e=Nfe(),t=NE(),n=Ade(),r=jde(),i=gL(),a=yL(),o=Mde(),l=cL(),c=Q6(),f=cm(),d=Ide(),h=aL(),m=TE(),g=CE(),v=qde(),w=Fde(),b=(re,le)=>re.indexOf(le)!==-1,_=re=>f(re)||re===!0||re===!1,S=re=>re===!1,x=re=>re===!0,A=(re,le,W)=>W(re),k=re=>h(m(a(re))),T=re=>re!==void 0,O=re=>m(a(re.map(K))),$=re=>re[0],L=re=>k(re),M=re=>Math.max.apply(Math,re),z=re=>Math.min.apply(Math,re),P=re=>re.some(x),q=re=>g(i(re),c);function D(re){return function(le,W){return t({[re]:le},{[re]:W})}}function H(re){let{allOf:le=[],...W}=re;return W=f(re)?W:re,[W,...le.map(H)]}function B(re,le){return re.map(W=>W&&W[le])}function G(re,le){return re.map(function(W,J){try{return le(W,J)}catch{return}}).filter(T)}function K(re){return f(re)||Array.isArray(re)?Object.keys(re):[]}function Q(re,le){if(le=le||[],!re.length)return le;const W=re.slice(0).shift(),J=re.slice(1);return le.length?Q(J,i(le.map(se=>W.map(fe=>[fe].concat(se))))):Q(J,W.map(se=>se))}function R(re,le){let W;try{W=re.map(function(J){return JSON.stringify(J,null,2)}).join(`
|
|
234
|
+
*/const $P=Symbol("Comlink.proxy"),$ie=Symbol("Comlink.endpoint"),Die=Symbol("Comlink.releaseProxy"),Eb=Symbol("Comlink.finalizer"),Ch=Symbol("Comlink.thrown"),DP=e=>typeof e=="object"&&e!==null||typeof e=="function",Iie={canHandle:e=>DP(e)&&e[$P],serialize(e){const{port1:t,port2:n}=new MessageChannel;return PP(e,t),[n,[n]]},deserialize(e){return e.start(),zP(e)}},Pie={canHandle:e=>DP(e)&&Ch in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},IP=new Map([["proxy",Iie],["throw",Pie]]);function Lie(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function PP(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(i){if(!i||!i.data)return;if(!Lie(n,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:a,type:o,path:l}=Object.assign({path:[]},i.data),c=(i.data.argumentList||[]).map(fs);let f;try{const d=l.slice(0,-1).reduce((m,g)=>m[g],e),h=l.reduce((m,g)=>m[g],e);switch(o){case"GET":f=h;break;case"SET":d[l.slice(-1)[0]]=fs(i.data.value),f=!0;break;case"APPLY":f=h.apply(d,c);break;case"CONSTRUCT":{const m=new h(...c);f=Vie(m)}break;case"ENDPOINT":{const{port1:m,port2:g}=new MessageChannel;PP(e,g),f=Uie(m,[m])}break;case"RELEASE":f=void 0;break;default:return}}catch(d){f={value:d,[Ch]:0}}Promise.resolve(f).catch(d=>({value:d,[Ch]:0})).then(d=>{const[h,m]=up(d);t.postMessage(Object.assign(Object.assign({},h),{id:a}),m),o==="RELEASE"&&(t.removeEventListener("message",r),LP(t),Eb in e&&typeof e[Eb]=="function"&&e[Eb]())}).catch(d=>{const[h,m]=up({value:new TypeError("Unserializable return value"),[Ch]:0});t.postMessage(Object.assign(Object.assign({},h),{id:a}),m)})}),t.start&&t.start()}function zie(e){return e.constructor.name==="MessagePort"}function LP(e){zie(e)&&e.close()}function zP(e,t){const n=new Map;return e.addEventListener("message",function(i){const{data:a}=i;if(!a||!a.id)return;const o=n.get(a.id);if(o)try{o(a)}finally{n.delete(a.id)}}),zw(e,n,[],t)}function jd(e){if(e)throw new Error("Proxy has been released and is not useable")}function qP(e){return Mo(e,new Map,{type:"RELEASE"}).then(()=>{LP(e)})}const op=new WeakMap,lp="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(op.get(e)||0)-1;op.set(e,t),t===0&&qP(e)});function qie(e,t){const n=(op.get(t)||0)+1;op.set(t,n),lp&&lp.register(e,t,e)}function Fie(e){lp&&lp.unregister(e)}function zw(e,t,n=[],r=function(){}){let i=!1;const a=new Proxy(r,{get(o,l){if(jd(i),l===Die)return()=>{Fie(a),qP(e),t.clear(),i=!0};if(l==="then"){if(n.length===0)return{then:()=>a};const c=Mo(e,t,{type:"GET",path:n.map(f=>f.toString())}).then(fs);return c.then.bind(c)}return zw(e,t,[...n,l])},set(o,l,c){jd(i);const[f,d]=up(c);return Mo(e,t,{type:"SET",path:[...n,l].map(h=>h.toString()),value:f},d).then(fs)},apply(o,l,c){jd(i);const f=n[n.length-1];if(f===$ie)return Mo(e,t,{type:"ENDPOINT"}).then(fs);if(f==="bind")return zw(e,t,n.slice(0,-1));const[d,h]=AR(c);return Mo(e,t,{type:"APPLY",path:n.map(m=>m.toString()),argumentList:d},h).then(fs)},construct(o,l){jd(i);const[c,f]=AR(l);return Mo(e,t,{type:"CONSTRUCT",path:n.map(d=>d.toString()),argumentList:c},f).then(fs)}});return qie(a,e),a}function Bie(e){return Array.prototype.concat.apply([],e)}function AR(e){const t=e.map(up);return[t.map(n=>n[0]),Bie(t.map(n=>n[1]))]}const FP=new WeakMap;function Uie(e,t){return FP.set(e,t),e}function Vie(e){return Object.assign(e,{[$P]:!0})}function Hie(e,t=globalThis,n="*"){return{postMessage:(r,i)=>e.postMessage(r,n,i),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function up(e){for(const[t,n]of IP)if(n.canHandle(e)){const[r,i]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},i]}return[{type:"RAW",value:e},FP.get(e)||[]]}function fs(e){switch(e.type){case"HANDLER":return IP.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Mo(e,t,n,r){return new Promise(i=>{const a=Gie();t.set(a,i),e.start&&e.start(),e.postMessage(Object.assign({id:a},n),r)})}function Gie(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const BP=te.createContext({artifacts:[],currentArtifact:null,setCurrentArtifactById:()=>{},getArtifactVersions:()=>[],showArtifact:!1,setShowArtifact:()=>{}}),zp=()=>te.useContext(BP),Yie=({children:e})=>{const[t,n]=te.useState([]),[r,i]=te.useState(!1),{renderMessages:a}=Ts(),[o,l]=te.useState(null),c=d=>t.filter(h=>h.filename===d).sort((h,m)=>h.version-m.version);te.useEffect(()=>{if(!a)return;const d=a.filter(g=>g.type==="tool").filter(g=>g.name==="create_artifacts"),h=new Map,m=d.map(g=>{const v=JSON.parse(g.tool_input),w=v.filename,_=(h.get(w)||0)+1;return h.set(w,_),{id:g.id,code:v.code,filename:w,version:_,filetype:v.filetype}});n(m)},[a]);const f=d=>{i(!0),l(t.find(h=>h.id===d)||null)};return N.jsx(BP.Provider,{value:{artifacts:t,currentArtifact:o,setCurrentArtifactById:f,getArtifactVersions:c,showArtifact:r,setShowArtifact:i},children:e})},Zie=()=>{const{currentArtifact:e}=zp();return e?N.jsx("div",{className:"h-full w-full overflow-auto",children:N.jsx("pre",{children:e.code})}):N.jsx("div",{className:"h-full w-full flex items-center justify-center text-gray-500",children:"请选择一个文件"})},Kie=()=>{const e=te.useRef(null),[t,n]=te.useState(!1),{currentArtifact:r,getArtifactVersions:i,setCurrentArtifactById:a,artifacts:o}=zp(),[l,c]=te.useState(0),[f,d]=te.useState("preview"),[h,m]=te.useState(!1),g=async S=>{const x=zP(Hie(S.contentWindow));return await Promise.race(Array(100).fill(0).map((A,k)=>new Promise(T=>{setTimeout(async()=>{await x.init()&&T(k)},100*k)}))),x},v=async()=>{if(console.log(l),!!e.current){n(!0);try{await(await g(e.current)).run(r==null?void 0:r.code,r==null?void 0:r.filename,r==null?void 0:r.filetype)}catch(S){console.error("Failed to run code:",S)}finally{n(!1)}}},w=()=>{c(S=>S+1)};if(te.useEffect(()=>{e.current&&v()},[l]),!r)return N.jsx("div",{className:"h-full w-full flex items-center justify-center text-gray-500",children:"请选择一个文件"});const b=i(r.filename),_=Array.from(new Set(o.map(S=>S.filename)));return N.jsxs("div",{className:"h-full w-full flex flex-col",children:[N.jsxs("div",{className:"flex items-center justify-between p-2 border-b",children:[N.jsxs("div",{className:"flex items-center space-x-4",children:[N.jsxs("div",{className:"flex space-x-2",children:[N.jsx("button",{className:`px-3 py-1 rounded ${f==="preview"?"bg-blue-500 text-white":"bg-gray-100 text-gray-700"}`,onClick:()=>{d("preview"),w()},children:"预览"}),N.jsx("button",{className:`px-3 py-1 rounded ${f==="source"?"bg-blue-500 text-white":"bg-gray-100 text-gray-700"}`,onClick:()=>d("source"),children:"源代码"})]}),N.jsxs("div",{className:"relative",children:[N.jsxs("button",{className:"flex items-center space-x-2 px-3 py-1 bg-gray-100 rounded hover:bg-gray-200",onClick:()=>m(!h),children:[N.jsx("span",{children:r.filename}),N.jsx(L5,{className:"w-4 h-4"})]}),h&&N.jsx("div",{className:"absolute top-full left-0 mt-1 w-48 bg-white border rounded-md shadow-lg z-10",children:_.map(S=>{const x=i(S),A=x[x.length-1];return N.jsx("button",{className:"w-full text-left px-3 py-2 hover:bg-gray-100",onClick:()=>{a(A.id),m(!1)},children:S},S)})})]}),N.jsxs("div",{className:"flex items-center space-x-2",children:[N.jsx("span",{className:"text-sm text-gray-500",children:"版本:"}),N.jsx("div",{className:"flex space-x-1",children:b.map(S=>N.jsxs("button",{className:`px-2 py-1 text-sm rounded ${S.id===r.id?"bg-blue-500 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,onClick:()=>a(S.id),children:["v",S.version]},S.id))})]})]}),f==="preview"&&N.jsxs("div",{className:"flex space-x-2",children:[N.jsx("button",{disabled:t,className:"px-3 py-1 bg-gray-100 rounded hover:bg-gray-200 disabled:opacity-50",children:t?"Running...":"Run"}),N.jsx("button",{onClick:w,disabled:t,className:"px-3 py-1 bg-gray-100 rounded hover:bg-gray-200 disabled:opacity-50",children:"Refresh"})]})]}),N.jsx("div",{className:"flex-1 overflow-auto",children:f==="preview"?N.jsx("iframe",{ref:e,src:"https://langgraph-artifacts.netlify.app/index.html",className:"w-full h-full border border-gray-300"},l):N.jsx(Zie,{})})]})};function lt(e){return typeof e!="object"||e===null||typeof e.lastModified=="number"&&typeof File<"u"&&e instanceof File||typeof e.getMonth=="function"&&typeof Date<"u"&&e instanceof Date?!1:!Array.isArray(e)}function Xie(e){return e.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),lt(e.additionalItems)}function TR(e){if(e==="")return;if(e===null)return null;if(/\.$/.test(e)||/\.0$/.test(e)||/\.\d*0$/.test(e))return e;const t=Number(e);return typeof t=="number"&&!Number.isNaN(t)?t:e}const Mc="__additional_property",qw="additionalProperties",ll="allOf",Mr="anyOf",Di="const",Wie="default",qp="dependencies",Qie="enum",Jn="__errors",Ra="$id",Jie="if",Ma="items",eae="_$junk_option_schema_id$_",Oh="$name",tr="oneOf",Bt="properties",tae="required",cp="submitButtonOptions",rn="$ref",PS="__rjsf_additionalProperties",UP="__rjsf_rootSchema",nae="ui:field",LS="ui:widget",Zu="ui:options",rae="ui:globalOptions";function ot(e={},t={}){return Object.keys(e).filter(n=>n.indexOf("ui:")===0).reduce((n,r)=>{const i=e[r];return r===LS&<(i)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),n):r===Zu&<(i)?{...n,...i}:{...n,[r.substring(3)]:i}},{...t})}function iae(e,t={},n){if(!e.additionalProperties)return!1;const{expandable:r=!0}=ot(t);return r===!1?r:e.maxProperties!==void 0&&n?Object.keys(n).length<e.maxProperties:!0}var VP=typeof global=="object"&&global&&global.Object===Object&&global,aae=typeof self=="object"&&self&&self.Object===Object&&self,ni=VP||aae||Function("return this")(),br=ni.Symbol,HP=Object.prototype,sae=HP.hasOwnProperty,oae=HP.toString,Ou=br?br.toStringTag:void 0;function lae(e){var t=sae.call(e,Ou),n=e[Ou];try{e[Ou]=void 0;var r=!0}catch{}var i=oae.call(e);return r&&(t?e[Ou]=n:delete e[Ou]),i}var uae=Object.prototype,cae=uae.toString;function fae(e){return cae.call(e)}var dae="[object Null]",hae="[object Undefined]",CR=br?br.toStringTag:void 0;function qi(e){return e==null?e===void 0?hae:dae:CR&&CR in Object(e)?lae(e):fae(e)}function GP(e,t){return function(n){return e(t(n))}}var Fp=GP(Object.getPrototypeOf,Object);function vr(e){return e!=null&&typeof e=="object"}var pae="[object Object]",mae=Function.prototype,gae=Object.prototype,YP=mae.toString,yae=gae.hasOwnProperty,bae=YP.call(Object);function Ss(e){if(!vr(e)||qi(e)!=pae)return!1;var t=Fp(e);if(t===null)return!0;var n=yae.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&YP.call(n)==bae}function fp(e){const t={[Jn]:[],addError(n){this[Jn].push(n)}};if(Array.isArray(e))return e.reduce((n,r,i)=>({...n,[i]:fp(r)}),t);if(Ss(e)){const n=e;return Object.keys(n).reduce((r,i)=>({...r,[i]:fp(n[i])}),t)}return t}function vae(){this.__data__=[],this.size=0}function $c(e,t){return e===t||e!==e&&t!==t}function Bp(e,t){for(var n=e.length;n--;)if($c(e[n][0],t))return n;return-1}var _ae=Array.prototype,xae=_ae.splice;function wae(e){var t=this.__data__,n=Bp(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():xae.call(t,n,1),--this.size,!0}function Sae(e){var t=this.__data__,n=Bp(t,e);return n<0?void 0:t[n][1]}function Eae(e){return Bp(this.__data__,e)>-1}function kae(e,t){var n=this.__data__,r=Bp(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Fi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Fi.prototype.clear=vae;Fi.prototype.delete=wae;Fi.prototype.get=Sae;Fi.prototype.has=Eae;Fi.prototype.set=kae;function Aae(){this.__data__=new Fi,this.size=0}function Tae(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Cae(e){return this.__data__.get(e)}function Oae(e){return this.__data__.has(e)}function Mt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Nae="[object AsyncFunction]",Rae="[object Function]",jae="[object GeneratorFunction]",Mae="[object Proxy]";function Up(e){if(!Mt(e))return!1;var t=qi(e);return t==Rae||t==jae||t==Nae||t==Mae}var kb=ni["__core-js_shared__"],OR=function(){var e=/[^.]+$/.exec(kb&&kb.keys&&kb.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function $ae(e){return!!OR&&OR in e}var Dae=Function.prototype,Iae=Dae.toString;function Cs(e){if(e!=null){try{return Iae.call(e)}catch{}try{return e+""}catch{}}return""}var Pae=/[\\^$.*+?()[\]{}|]/g,Lae=/^\[object .+?Constructor\]$/,zae=Function.prototype,qae=Object.prototype,Fae=zae.toString,Bae=qae.hasOwnProperty,Uae=RegExp("^"+Fae.call(Bae).replace(Pae,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Vae(e){if(!Mt(e)||$ae(e))return!1;var t=Up(e)?Uae:Lae;return t.test(Cs(e))}function Hae(e,t){return e==null?void 0:e[t]}function Os(e,t){var n=Hae(e,t);return Vae(n)?n:void 0}var mc=Os(ni,"Map"),gc=Os(Object,"create");function Gae(){this.__data__=gc?gc(null):{},this.size=0}function Yae(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Zae="__lodash_hash_undefined__",Kae=Object.prototype,Xae=Kae.hasOwnProperty;function Wae(e){var t=this.__data__;if(gc){var n=t[e];return n===Zae?void 0:n}return Xae.call(t,e)?t[e]:void 0}var Qae=Object.prototype,Jae=Qae.hasOwnProperty;function ese(e){var t=this.__data__;return gc?t[e]!==void 0:Jae.call(t,e)}var tse="__lodash_hash_undefined__";function nse(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gc&&t===void 0?tse:t,this}function Es(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Es.prototype.clear=Gae;Es.prototype.delete=Yae;Es.prototype.get=Wae;Es.prototype.has=ese;Es.prototype.set=nse;function rse(){this.size=0,this.__data__={hash:new Es,map:new(mc||Fi),string:new Es}}function ise(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Vp(e,t){var n=e.__data__;return ise(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ase(e){var t=Vp(this,e).delete(e);return this.size-=t?1:0,t}function sse(e){return Vp(this,e).get(e)}function ose(e){return Vp(this,e).has(e)}function lse(e,t){var n=Vp(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Bi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bi.prototype.clear=rse;Bi.prototype.delete=ase;Bi.prototype.get=sse;Bi.prototype.has=ose;Bi.prototype.set=lse;var use=200;function cse(e,t){var n=this.__data__;if(n instanceof Fi){var r=n.__data__;if(!mc||r.length<use-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Bi(r)}return n.set(e,t),this.size=n.size,this}function Dr(e){var t=this.__data__=new Fi(e);this.size=t.size}Dr.prototype.clear=Aae;Dr.prototype.delete=Tae;Dr.prototype.get=Cae;Dr.prototype.has=Oae;Dr.prototype.set=cse;var fse="__lodash_hash_undefined__";function dse(e){return this.__data__.set(e,fse),this}function hse(e){return this.__data__.has(e)}function Qo(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Bi;++t<n;)this.add(e[t])}Qo.prototype.add=Qo.prototype.push=dse;Qo.prototype.has=hse;function pse(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function zS(e,t){return e.has(t)}var mse=1,gse=2;function ZP(e,t,n,r,i,a){var o=n&mse,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var f=a.get(e),d=a.get(t);if(f&&d)return f==t&&d==e;var h=-1,m=!0,g=n&gse?new Qo:void 0;for(a.set(e,t),a.set(t,e);++h<l;){var v=e[h],w=t[h];if(r)var b=o?r(w,v,h,t,e,a):r(v,w,h,e,t,a);if(b!==void 0){if(b)continue;m=!1;break}if(g){if(!pse(t,function(_,S){if(!zS(g,S)&&(v===_||i(v,_,n,r,a)))return g.push(S)})){m=!1;break}}else if(!(v===w||i(v,w,n,r,a))){m=!1;break}}return a.delete(e),a.delete(t),m}var dp=ni.Uint8Array;function yse(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function qS(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var bse=1,vse=2,_se="[object Boolean]",xse="[object Date]",wse="[object Error]",Sse="[object Map]",Ese="[object Number]",kse="[object RegExp]",Ase="[object Set]",Tse="[object String]",Cse="[object Symbol]",Ose="[object ArrayBuffer]",Nse="[object DataView]",NR=br?br.prototype:void 0,Ab=NR?NR.valueOf:void 0;function Rse(e,t,n,r,i,a,o){switch(n){case Nse:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Ose:return!(e.byteLength!=t.byteLength||!a(new dp(e),new dp(t)));case _se:case xse:case Ese:return $c(+e,+t);case wse:return e.name==t.name&&e.message==t.message;case kse:case Tse:return e==t+"";case Sse:var l=yse;case Ase:var c=r&bse;if(l||(l=qS),e.size!=t.size&&!c)return!1;var f=o.get(e);if(f)return f==t;r|=vse,o.set(e,t);var d=ZP(l(e),l(t),r,i,a,o);return o.delete(e),d;case Cse:if(Ab)return Ab.call(e)==Ab.call(t)}return!1}function FS(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var an=Array.isArray;function KP(e,t,n){var r=t(e);return an(e)?r:FS(r,n(e))}function jse(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function XP(){return[]}var Mse=Object.prototype,$se=Mse.propertyIsEnumerable,RR=Object.getOwnPropertySymbols,BS=RR?function(e){return e==null?[]:(e=Object(e),jse(RR(e),function(t){return $se.call(e,t)}))}:XP;function WP(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Dse="[object Arguments]";function jR(e){return vr(e)&&qi(e)==Dse}var QP=Object.prototype,Ise=QP.hasOwnProperty,Pse=QP.propertyIsEnumerable,Jo=jR(function(){return arguments}())?jR:function(e){return vr(e)&&Ise.call(e,"callee")&&!Pse.call(e,"callee")};function Lse(){return!1}var JP=typeof rr=="object"&&rr&&!rr.nodeType&&rr,MR=JP&&typeof ir=="object"&&ir&&!ir.nodeType&&ir,zse=MR&&MR.exports===JP,$R=zse?ni.Buffer:void 0,qse=$R?$R.isBuffer:void 0,ks=qse||Lse,Fse=9007199254740991,Bse=/^(?:0|[1-9]\d*)$/;function Hp(e,t){var n=typeof e;return t=t??Fse,!!t&&(n=="number"||n!="symbol"&&Bse.test(e))&&e>-1&&e%1==0&&e<t}var Use=9007199254740991;function US(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Use}var Vse="[object Arguments]",Hse="[object Array]",Gse="[object Boolean]",Yse="[object Date]",Zse="[object Error]",Kse="[object Function]",Xse="[object Map]",Wse="[object Number]",Qse="[object Object]",Jse="[object RegExp]",eoe="[object Set]",toe="[object String]",noe="[object WeakMap]",roe="[object ArrayBuffer]",ioe="[object DataView]",aoe="[object Float32Array]",soe="[object Float64Array]",ooe="[object Int8Array]",loe="[object Int16Array]",uoe="[object Int32Array]",coe="[object Uint8Array]",foe="[object Uint8ClampedArray]",doe="[object Uint16Array]",hoe="[object Uint32Array]",Dt={};Dt[aoe]=Dt[soe]=Dt[ooe]=Dt[loe]=Dt[uoe]=Dt[coe]=Dt[foe]=Dt[doe]=Dt[hoe]=!0;Dt[Vse]=Dt[Hse]=Dt[roe]=Dt[Gse]=Dt[ioe]=Dt[Yse]=Dt[Zse]=Dt[Kse]=Dt[Xse]=Dt[Wse]=Dt[Qse]=Dt[Jse]=Dt[eoe]=Dt[toe]=Dt[noe]=!1;function poe(e){return vr(e)&&US(e.length)&&!!Dt[qi(e)]}function VS(e){return function(t){return e(t)}}var e6=typeof rr=="object"&&rr&&!rr.nodeType&&rr,Ku=e6&&typeof ir=="object"&&ir&&!ir.nodeType&&ir,moe=Ku&&Ku.exports===e6,Tb=moe&&VP.process,el=function(){try{var e=Ku&&Ku.require&&Ku.require("util").types;return e||Tb&&Tb.binding&&Tb.binding("util")}catch{}}(),DR=el&&el.isTypedArray,Dc=DR?VS(DR):poe,goe=Object.prototype,yoe=goe.hasOwnProperty;function t6(e,t){var n=an(e),r=!n&&Jo(e),i=!n&&!r&&ks(e),a=!n&&!r&&!i&&Dc(e),o=n||r||i||a,l=o?WP(e.length,String):[],c=l.length;for(var f in e)(t||yoe.call(e,f))&&!(o&&(f=="length"||i&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Hp(f,c)))&&l.push(f);return l}var boe=Object.prototype;function Gp(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||boe;return e===n}var voe=GP(Object.keys,Object),_oe=Object.prototype,xoe=_oe.hasOwnProperty;function n6(e){if(!Gp(e))return voe(e);var t=[];for(var n in Object(e))xoe.call(e,n)&&n!="constructor"&&t.push(n);return t}function ul(e){return e!=null&&US(e.length)&&!Up(e)}function Yr(e){return ul(e)?t6(e):n6(e)}function Fw(e){return KP(e,Yr,BS)}var woe=1,Soe=Object.prototype,Eoe=Soe.hasOwnProperty;function koe(e,t,n,r,i,a){var o=n&woe,l=Fw(e),c=l.length,f=Fw(t),d=f.length;if(c!=d&&!o)return!1;for(var h=c;h--;){var m=l[h];if(!(o?m in t:Eoe.call(t,m)))return!1}var g=a.get(e),v=a.get(t);if(g&&v)return g==t&&v==e;var w=!0;a.set(e,t),a.set(t,e);for(var b=o;++h<c;){m=l[h];var _=e[m],S=t[m];if(r)var x=o?r(S,_,m,t,e,a):r(_,S,m,e,t,a);if(!(x===void 0?_===S||i(_,S,n,r,a):x)){w=!1;break}b||(b=m=="constructor")}if(w&&!b){var A=e.constructor,k=t.constructor;A!=k&&"constructor"in e&&"constructor"in t&&!(typeof A=="function"&&A instanceof A&&typeof k=="function"&&k instanceof k)&&(w=!1)}return a.delete(e),a.delete(t),w}var Bw=Os(ni,"DataView"),Uw=Os(ni,"Promise"),zo=Os(ni,"Set"),Vw=Os(ni,"WeakMap"),IR="[object Map]",Aoe="[object Object]",PR="[object Promise]",LR="[object Set]",zR="[object WeakMap]",qR="[object DataView]",Toe=Cs(Bw),Coe=Cs(mc),Ooe=Cs(Uw),Noe=Cs(zo),Roe=Cs(Vw),yr=qi;(Bw&&yr(new Bw(new ArrayBuffer(1)))!=qR||mc&&yr(new mc)!=IR||Uw&&yr(Uw.resolve())!=PR||zo&&yr(new zo)!=LR||Vw&&yr(new Vw)!=zR)&&(yr=function(e){var t=qi(e),n=t==Aoe?e.constructor:void 0,r=n?Cs(n):"";if(r)switch(r){case Toe:return qR;case Coe:return IR;case Ooe:return PR;case Noe:return LR;case Roe:return zR}return t});var joe=1,FR="[object Arguments]",BR="[object Array]",Md="[object Object]",Moe=Object.prototype,UR=Moe.hasOwnProperty;function $oe(e,t,n,r,i,a){var o=an(e),l=an(t),c=o?BR:yr(e),f=l?BR:yr(t);c=c==FR?Md:c,f=f==FR?Md:f;var d=c==Md,h=f==Md,m=c==f;if(m&&ks(e)){if(!ks(t))return!1;o=!0,d=!1}if(m&&!d)return a||(a=new Dr),o||Dc(e)?ZP(e,t,n,r,i,a):Rse(e,t,c,n,r,i,a);if(!(n&joe)){var g=d&&UR.call(e,"__wrapped__"),v=h&&UR.call(t,"__wrapped__");if(g||v){var w=g?e.value():e,b=v?t.value():t;return a||(a=new Dr),i(w,b,n,r,a)}}return m?(a||(a=new Dr),koe(e,t,n,r,i,a)):!1}function Yp(e,t,n,r,i){return e===t?!0:e==null||t==null||!vr(e)&&!vr(t)?e!==e&&t!==t:$oe(e,t,n,r,Yp,i)}function Doe(e,t,n){n=typeof n=="function"?n:void 0;var r=n?n(e,t):void 0;return r===void 0?Yp(e,t,void 0,n):!!r}function It(e,t){return Doe(e,t,(n,r)=>{if(typeof n=="function"&&typeof r=="function")return!0})}var Ioe="[object Symbol]";function Ic(e){return typeof e=="symbol"||vr(e)&&qi(e)==Ioe}var Poe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Loe=/^\w*$/;function HS(e,t){if(an(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ic(e)?!0:Loe.test(e)||!Poe.test(e)||t!=null&&e in Object(t)}var zoe="Expected a function";function GS(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(zoe);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(GS.Cache||Bi),n}GS.Cache=Bi;var qoe=500;function Foe(e){var t=GS(e,function(r){return n.size===qoe&&n.clear(),r}),n=t.cache;return t}var Boe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Uoe=/\\(\\)?/g,r6=Foe(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Boe,function(n,r,i,a){t.push(i?a.replace(Uoe,"$1"):r||n)}),t});function Zp(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var VR=br?br.prototype:void 0,HR=VR?VR.toString:void 0;function i6(e){if(typeof e=="string")return e;if(an(e))return Zp(e,i6)+"";if(Ic(e))return HR?HR.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function YS(e){return e==null?"":i6(e)}function cl(e,t){return an(e)?e:HS(e,t)?[e]:r6(YS(e))}function Ns(e){if(typeof e=="string"||Ic(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Kp(e,t){t=cl(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Ns(t[n++])];return n&&n==r?e:void 0}function Ne(e,t,n){var r=e==null?void 0:Kp(e,t);return r===void 0?n:r}var Voe="[object Map]",Hoe="[object Set]",Goe=Object.prototype,Yoe=Goe.hasOwnProperty;function tl(e){if(e==null)return!0;if(ul(e)&&(an(e)||typeof e=="string"||typeof e.splice=="function"||ks(e)||Dc(e)||Jo(e)))return!e.length;var t=yr(e);if(t==Voe||t==Hoe)return!e.size;if(Gp(e))return!n6(e).length;for(var n in e)if(Yoe.call(e,n))return!1;return!0}var Nu={},GR;function Zoe(){if(GR)return Nu;GR=1;var e=/~/,t=/~[01]/g;function n(f){switch(f){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+f)}function r(f){return e.test(f)?f.replace(t,n):f}function i(f,d,h){for(var m,g,v=1,w=d.length;v<w;){if(d[v]==="constructor"||d[v]==="prototype"||d[v]==="__proto__")return f;if(m=r(d[v++]),g=w>v,typeof f[m]>"u"&&(Array.isArray(f)&&m==="-"&&(m=f.length),g&&(d[v]!==""&&d[v]<1/0||d[v]==="-"?f[m]=[]:f[m]={})),!g)break;f=f[m]}var b=f[m];return h===void 0?delete f[m]:f[m]=h,b}function a(f){if(typeof f=="string"){if(f=f.split("/"),f[0]==="")return f;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(f)){for(const d of f)if(typeof d!="string"&&typeof d!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return f}throw new Error("Invalid JSON pointer.")}function o(f,d){if(typeof f!="object")throw new Error("Invalid input object.");d=a(d);var h=d.length;if(h===1)return f;for(var m=1;m<h;){if(f=f[r(d[m++])],h===m)return f;if(typeof f!="object"||f===null)return}}function l(f,d,h){if(typeof f!="object")throw new Error("Invalid input object.");if(d=a(d),d.length===0)throw new Error("Invalid JSON pointer for set.");return i(f,d,h)}function c(f){var d=a(f);return{get:function(h){return o(h,d)},set:function(h,m){return l(h,d,m)}}}return Nu.get=o,Nu.set=l,Nu.compile=c,Nu}var Koe=Zoe();const Xoe=zn(Koe);function ZS(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var hp=function(){try{var e=Os(Object,"defineProperty");return e({},"",{}),e}catch{}}();function KS(e,t,n){t=="__proto__"&&hp?hp(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Woe=Object.prototype,Qoe=Woe.hasOwnProperty;function XS(e,t,n){var r=e[t];(!(Qoe.call(e,t)&&$c(r,n))||n===void 0&&!(t in e))&&KS(e,t,n)}function fl(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var l=t[a],c=void 0;c===void 0&&(c=e[l]),i?KS(n,l,c):XS(n,l,c)}return n}function Joe(e,t){return e&&fl(t,Yr(t),e)}function ele(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var tle=Object.prototype,nle=tle.hasOwnProperty;function rle(e){if(!Mt(e))return ele(e);var t=Gp(e),n=[];for(var r in e)r=="constructor"&&(t||!nle.call(e,r))||n.push(r);return n}function Pc(e){return ul(e)?t6(e,!0):rle(e)}function ile(e,t){return e&&fl(t,Pc(t),e)}var a6=typeof rr=="object"&&rr&&!rr.nodeType&&rr,YR=a6&&typeof ir=="object"&&ir&&!ir.nodeType&&ir,ale=YR&&YR.exports===a6,ZR=ale?ni.Buffer:void 0,KR=ZR?ZR.allocUnsafe:void 0;function s6(e,t){if(t)return e.slice();var n=e.length,r=KR?KR(n):new e.constructor(n);return e.copy(r),r}function WS(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function sle(e,t){return fl(e,BS(e),t)}var ole=Object.getOwnPropertySymbols,o6=ole?function(e){for(var t=[];e;)FS(t,BS(e)),e=Fp(e);return t}:XP;function lle(e,t){return fl(e,o6(e),t)}function QS(e){return KP(e,Pc,o6)}var ule=Object.prototype,cle=ule.hasOwnProperty;function fle(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&cle.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function JS(e){var t=new e.constructor(e.byteLength);return new dp(t).set(new dp(e)),t}function dle(e,t){var n=t?JS(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var hle=/\w*$/;function ple(e){var t=new e.constructor(e.source,hle.exec(e));return t.lastIndex=e.lastIndex,t}var XR=br?br.prototype:void 0,WR=XR?XR.valueOf:void 0;function mle(e){return WR?Object(WR.call(e)):{}}function l6(e,t){var n=t?JS(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var gle="[object Boolean]",yle="[object Date]",ble="[object Map]",vle="[object Number]",_le="[object RegExp]",xle="[object Set]",wle="[object String]",Sle="[object Symbol]",Ele="[object ArrayBuffer]",kle="[object DataView]",Ale="[object Float32Array]",Tle="[object Float64Array]",Cle="[object Int8Array]",Ole="[object Int16Array]",Nle="[object Int32Array]",Rle="[object Uint8Array]",jle="[object Uint8ClampedArray]",Mle="[object Uint16Array]",$le="[object Uint32Array]";function Dle(e,t,n){var r=e.constructor;switch(t){case Ele:return JS(e);case gle:case yle:return new r(+e);case kle:return dle(e,n);case Ale:case Tle:case Cle:case Ole:case Nle:case Rle:case jle:case Mle:case $le:return l6(e,n);case ble:return new r;case vle:case wle:return new r(e);case _le:return ple(e);case xle:return new r;case Sle:return mle(e)}}var QR=Object.create,u6=function(){function e(){}return function(t){if(!Mt(t))return{};if(QR)return QR(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function c6(e){return typeof e.constructor=="function"&&!Gp(e)?u6(Fp(e)):{}}var Ile="[object Map]";function Ple(e){return vr(e)&&yr(e)==Ile}var JR=el&&el.isMap,Lle=JR?VS(JR):Ple,zle="[object Set]";function qle(e){return vr(e)&&yr(e)==zle}var ej=el&&el.isSet,Fle=ej?VS(ej):qle,Ble=1,Ule=2,Vle=4,f6="[object Arguments]",Hle="[object Array]",Gle="[object Boolean]",Yle="[object Date]",Zle="[object Error]",d6="[object Function]",Kle="[object GeneratorFunction]",Xle="[object Map]",Wle="[object Number]",h6="[object Object]",Qle="[object RegExp]",Jle="[object Set]",eue="[object String]",tue="[object Symbol]",nue="[object WeakMap]",rue="[object ArrayBuffer]",iue="[object DataView]",aue="[object Float32Array]",sue="[object Float64Array]",oue="[object Int8Array]",lue="[object Int16Array]",uue="[object Int32Array]",cue="[object Uint8Array]",fue="[object Uint8ClampedArray]",due="[object Uint16Array]",hue="[object Uint32Array]",Rt={};Rt[f6]=Rt[Hle]=Rt[rue]=Rt[iue]=Rt[Gle]=Rt[Yle]=Rt[aue]=Rt[sue]=Rt[oue]=Rt[lue]=Rt[uue]=Rt[Xle]=Rt[Wle]=Rt[h6]=Rt[Qle]=Rt[Jle]=Rt[eue]=Rt[tue]=Rt[cue]=Rt[fue]=Rt[due]=Rt[hue]=!0;Rt[Zle]=Rt[d6]=Rt[nue]=!1;function Xu(e,t,n,r,i,a){var o,l=t&Ble,c=t&Ule,f=t&Vle;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!Mt(e))return e;var d=an(e);if(d){if(o=fle(e),!l)return WS(e,o)}else{var h=yr(e),m=h==d6||h==Kle;if(ks(e))return s6(e,l);if(h==h6||h==f6||m&&!i){if(o=c||m?{}:c6(e),!l)return c?lle(e,ile(o,e)):sle(e,Joe(o,e))}else{if(!Rt[h])return i?e:{};o=Dle(e,h,l)}}a||(a=new Dr);var g=a.get(e);if(g)return g;a.set(e,o),Fle(e)?e.forEach(function(b){o.add(Xu(b,t,n,b,e,a))}):Lle(e)&&e.forEach(function(b,_){o.set(_,Xu(b,t,n,_,e,a))});var v=f?c?QS:Fw:c?Pc:Yr,w=d?void 0:v(e);return ZS(w||e,function(b,_){w&&(_=b,b=e[_]),XS(o,_,Xu(b,t,n,_,e,a))}),o}function pue(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function mue(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function gue(e,t){return t.length<2?e:Kp(e,mue(t,0,-1))}function p6(e,t){return t=cl(t,e),e=gue(e,t),e==null||delete e[Ns(pue(t))]}function yue(e){return Ss(e)?void 0:e}var tj=br?br.isConcatSpreadable:void 0;function bue(e){return an(e)||Jo(e)||!!(tj&&e&&e[tj])}function Lc(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=bue),i||(i=[]);++a<o;){var l=e[a];t>0&&n(l)?t>1?Lc(l,t-1,n,r,i):FS(i,l):r||(i[i.length]=l)}return i}function vue(e){var t=e==null?0:e.length;return t?Lc(e,1):[]}function _ue(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var nj=Math.max;function m6(e,t,n){return t=nj(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=nj(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=r[i];return l[t]=n(o),_ue(e,this,l)}}function xue(e){return function(){return e}}function Xp(e){return e}var wue=hp?function(e,t){return hp(e,"toString",{configurable:!0,enumerable:!1,value:xue(t),writable:!0})}:Xp,Sue=800,Eue=16,kue=Date.now;function Aue(e){var t=0,n=0;return function(){var r=kue(),i=Eue-(r-n);if(n=r,i>0){if(++t>=Sue)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var g6=Aue(wue);function y6(e){return g6(m6(e,void 0,vue),e+"")}var Tue=1,Cue=2,Oue=4,pp=y6(function(e,t){var n={};if(e==null)return n;var r=!1;t=Zp(t,function(a){return a=cl(a,e),r||(r=a.length>1),a}),fl(e,QS(e),n),r&&(n=Xu(n,Tue|Cue|Oue,yue));for(var i=t.length;i--;)p6(n,t[i]);return n});function eE(e,t){const n=t[e];return[pp(t,[e]),n]}function b6(e,t={},n=[]){const r=e||"";let i;if(r.startsWith("#"))i=decodeURIComponent(r.substring(1));else throw new Error(`Could not find a definition for ${e}.`);const a=Xoe.get(t,i);if(a===void 0)throw new Error(`Could not find a definition for ${e}.`);const o=a[rn];if(o){if(n.includes(o)){if(n.length===1)throw new Error(`Definition for ${e} is a circular reference`);const[d,...h]=n,m=[...h,r,d].join(" -> ");throw new Error(`Definition for ${d} contains a circular reference through ${m}`)}const[l,c]=eE(rn,a),f=b6(c,t,[...n,r]);return Object.keys(l).length>0?{...l,...f}:f}return a}function v6(e,t={}){return b6(e,t,[])}var Nue=Object.prototype,Rue=Nue.hasOwnProperty;function jue(e,t){return e!=null&&Rue.call(e,t)}function _6(e,t,n){t=cl(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=Ns(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&US(i)&&Hp(o,i)&&(an(e)||Jo(e)))}function An(e,t){return e!=null&&_6(e,t,jue)}var Mue="[object Number]";function x6(e){return typeof e=="number"||vr(e)&&qi(e)==Mue}var $ue="[object String]";function Wp(e){return typeof e=="string"||!an(e)&&vr(e)&&qi(e)==$ue}function Due(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Iue(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),l=o.length;l--;){var c=o[++i];if(n(a[c],c,a)===!1)break}return t}}var w6=Iue();function S6(e,t){return e&&w6(e,t,Yr)}function Pue(e,t){return function(n,r){if(n==null)return n;if(!ul(n))return e(n,r);for(var i=n.length,a=-1,o=Object(n);++a<i&&r(o[a],a,o)!==!1;);return n}}var E6=Pue(S6),Lue=1,zue=2;function que(e,t,n,r){var i=n.length,a=i;if(e==null)return!a;for(e=Object(e);i--;){var o=n[i];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<a;){o=n[i];var l=o[0],c=e[l],f=o[1];if(o[2]){if(c===void 0&&!(l in e))return!1}else{var d=new Dr,h;if(!(h===void 0?Yp(f,c,Lue|zue,r,d):h))return!1}}return!0}function k6(e){return e===e&&!Mt(e)}function Fue(e){for(var t=Yr(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,k6(i)]}return t}function A6(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function Bue(e){var t=Fue(e);return t.length==1&&t[0][2]?A6(t[0][0],t[0][1]):function(n){return n===e||que(n,e,t)}}function Uue(e,t){return e!=null&&t in Object(e)}function T6(e,t){return e!=null&&_6(e,t,Uue)}var Vue=1,Hue=2;function Gue(e,t){return HS(e)&&k6(t)?A6(Ns(e),t):function(n){var r=Ne(n,e);return r===void 0&&r===t?T6(n,e):Yp(t,r,Vue|Hue)}}function Yue(e){return function(t){return t==null?void 0:t[e]}}function Zue(e){return function(t){return Kp(t,e)}}function Kue(e){return HS(e)?Yue(Ns(e)):Zue(e)}function tE(e){return typeof e=="function"?e:e==null?Xp:typeof e=="object"?an(e)?Gue(e[0],e[1]):Bue(e):Kue(e)}function Xue(e,t,n,r,i){return i(e,function(a,o,l){n=r?(r=!1,a):t(n,a,o,l)}),n}function Wue(e,t,n){var r=an(e)?Due:Xue,i=arguments.length<3;return r(e,tE(t),n,i,E6)}function C6(e){return typeof e=="function"?e:Xp}var Que=/\s/;function Jue(e){for(var t=e.length;t--&&Que.test(e.charAt(t)););return t}var ece=/^\s+/;function tce(e){return e&&e.slice(0,Jue(e)+1).replace(ece,"")}var rj=NaN,nce=/^[-+]0x[0-9a-f]+$/i,rce=/^0b[01]+$/i,ice=/^0o[0-7]+$/i,ace=parseInt;function sce(e){if(typeof e=="number")return e;if(Ic(e))return rj;if(Mt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Mt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=tce(e);var n=rce.test(e);return n||ice.test(e)?ace(e.slice(2),n?2:8):nce.test(e)?rj:+e}var ij=1/0,oce=17976931348623157e292;function lce(e){if(!e)return e===0?e:0;if(e=sce(e),e===ij||e===-ij){var t=e<0?-1:1;return t*oce}return e===e?e:0}function uce(e){var t=lce(e),n=t%1;return t===t?n?t-n:t:0}var cce=9007199254740991,Cb=4294967295,fce=Math.min;function O6(e,t){if(e=uce(e),e<1||e>cce)return[];var n=Cb,r=fce(e,Cb);t=C6(t),e-=Cb;for(var i=WP(r,t);++n<e;)t(n);return i}function N6(e,t,n){var r;if(e&&n){const i=Ne(e,n);if(i===void 0)return;for(let a=0;a<t.length;a++){const o=t[a],l=Ne(o,[Bt,n],{});if(!(l.type==="object"||l.type==="array")&&(l.const===i||!((r=l.enum)===null||r===void 0)&&r.includes(i)))return a}}}function R6(e,t,n,r,i){if(t===void 0)return 0;const a=N6(t,n,i);if(x6(a))return a;for(let o=0;o<n.length;o++){const l=n[o];if(i&&An(l,[Bt,i])){const c=Ne(t,i),f=Ne(l,[Bt,i],{});if(e.isValid(f,c,r))return o}else if(l[Bt]){const c={anyOf:Object.keys(l[Bt]).map(d=>({required:[d]}))};let f;if(l.anyOf){const{...d}=l;d.allOf?d.allOf=d.allOf.slice():d.allOf=[],d.allOf.push(c),f=d}else f=Object.assign({},l,c);if(delete f.required,e.isValid(f,t,r))return o}else if(e.isValid(l,t,r))return o}return 0}function nE(e,t,n,r,i){return R6(e,t,n,r,i)}function rE(e,t,n,r){if(!Mt(e))return e;t=cl(t,e);for(var i=-1,a=t.length,o=a-1,l=e;l!=null&&++i<a;){var c=Ns(t[i]),f=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(i!=o){var d=l[c];f=r?r(d,c,l):void 0,f===void 0&&(f=Mt(d)?d:Hp(t[i+1])?[]:{})}XS(l,c,f),l=l[c]}return e}function mn(e,t,n){return e==null?e:rE(e,t,n)}function dce(e,t,n){var r=an(e),i=r||ks(e)||Dc(e);if(t=tE(t),n==null){var a=e&&e.constructor;i?n=r?new a:[]:Mt(e)?n=Up(a)?u6(Fp(e)):{}:n={}}return(i?ZS:S6)(e,function(o,l,c){return t(n,o,l,c)}),n}function Hw(e,t,n){(n!==void 0&&!$c(e[t],n)||n===void 0&&!(t in e))&&KS(e,t,n)}function mp(e){return vr(e)&&ul(e)}function Gw(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function hce(e){return fl(e,Pc(e))}function pce(e,t,n,r,i,a,o){var l=Gw(e,n),c=Gw(t,n),f=o.get(c);if(f){Hw(e,n,f);return}var d=a?a(l,c,n+"",e,t,o):void 0,h=d===void 0;if(h){var m=an(c),g=!m&&ks(c),v=!m&&!g&&Dc(c);d=c,m||g||v?an(l)?d=l:mp(l)?d=WS(l):g?(h=!1,d=s6(c,!0)):v?(h=!1,d=l6(c,!0)):d=[]:Ss(c)||Jo(c)?(d=l,Jo(l)?d=hce(l):(!Mt(l)||Up(l))&&(d=c6(c))):h=!1}h&&(o.set(c,d),i(d,c,r,a,o),o.delete(c)),Hw(e,n,d)}function j6(e,t,n,r,i){e!==t&&w6(t,function(a,o){if(i||(i=new Dr),Mt(a))pce(e,t,o,n,j6,r,i);else{var l=r?r(Gw(e,o),a,o+"",e,t,i):void 0;l===void 0&&(l=a),Hw(e,o,l)}},Pc)}function iE(e,t){return g6(m6(e,t,Xp),e+"")}function mce(e,t,n){if(!Mt(n))return!1;var r=typeof t;return(r=="number"?ul(n)&&Hp(t,n.length):r=="string"&&t in n)?$c(n[t],e):!1}function gce(e){return iE(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&mce(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var l=n[r];l&&e(t,l,r,a)}return t})}var yce=gce(function(e,t,n){j6(e,t,n)}),bce=1/0;function vce(e){var t=e==null?0:e.length;return t?Lc(e,bce):[]}function _ce(e,t,n,r){for(var i=e.length,a=n+-1;++a<i;)if(t(e[a],a,e))return a;return-1}function xce(e){return e!==e}function wce(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function Sce(e,t,n){return t===t?wce(e,t,n):_ce(e,xce,n)}function M6(e,t){var n=e==null?0:e.length;return!!n&&Sce(e,t,0)>-1}function Ece(){}var kce=1/0,Ace=zo&&1/qS(new zo([,-0]))[1]==kce?function(e){return new zo(e)}:Ece,Tce=200;function $6(e,t,n){var r=-1,i=M6,a=e.length,o=!0,l=[],c=l;if(a>=Tce){var f=Ace(e);if(f)return qS(f);o=!1,i=zS,c=new Qo}else c=l;e:for(;++r<a;){var d=e[r],h=d;if(d=d!==0?d:0,o&&h===h){for(var m=c.length;m--;)if(c[m]===h)continue e;l.push(d)}else i(c,h,n)||(c!==l&&c.push(h),l.push(d))}return l}function Cce(e){return e&&e.length?$6(e):[]}var Ob,aj;function Oce(){if(aj)return Ob;aj=1;function e(){this.__data__=[],this.size=0}return Ob=e,Ob}var Nb,sj;function dl(){if(sj)return Nb;sj=1;function e(t,n){return t===n||t!==t&&n!==n}return Nb=e,Nb}var Rb,oj;function Qp(){if(oj)return Rb;oj=1;var e=dl();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return Rb=t,Rb}var jb,lj;function Nce(){if(lj)return jb;lj=1;var e=Qp(),t=Array.prototype,n=t.splice;function r(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var l=a.length-1;return o==l?a.pop():n.call(a,o,1),--this.size,!0}return jb=r,jb}var Mb,uj;function Rce(){if(uj)return Mb;uj=1;var e=Qp();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return Mb=t,Mb}var $b,cj;function jce(){if(cj)return $b;cj=1;var e=Qp();function t(n){return e(this.__data__,n)>-1}return $b=t,$b}var Db,fj;function Mce(){if(fj)return Db;fj=1;var e=Qp();function t(n,r){var i=this.__data__,a=e(i,n);return a<0?(++this.size,i.push([n,r])):i[a][1]=r,this}return Db=t,Db}var Ib,dj;function Jp(){if(dj)return Ib;dj=1;var e=Oce(),t=Nce(),n=Rce(),r=jce(),i=Mce();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var f=o[l];this.set(f[0],f[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,Ib=a,Ib}var Pb,hj;function $ce(){if(hj)return Pb;hj=1;var e=Jp();function t(){this.__data__=new e,this.size=0}return Pb=t,Pb}var Lb,pj;function Dce(){if(pj)return Lb;pj=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Lb=e,Lb}var zb,mj;function Ice(){if(mj)return zb;mj=1;function e(t){return this.__data__.get(t)}return zb=e,zb}var qb,gj;function Pce(){if(gj)return qb;gj=1;function e(t){return this.__data__.has(t)}return qb=e,qb}var Fb,yj;function D6(){if(yj)return Fb;yj=1;var e=typeof fd=="object"&&fd&&fd.Object===Object&&fd;return Fb=e,Fb}var Bb,bj;function ri(){if(bj)return Bb;bj=1;var e=D6(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Bb=n,Bb}var Ub,vj;function hl(){if(vj)return Ub;vj=1;var e=ri(),t=e.Symbol;return Ub=t,Ub}var Vb,_j;function Lce(){if(_j)return Vb;_j=1;var e=hl(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function a(o){var l=n.call(o,i),c=o[i];try{o[i]=void 0;var f=!0}catch{}var d=r.call(o);return f&&(l?o[i]=c:delete o[i]),d}return Vb=a,Vb}var Hb,xj;function zce(){if(xj)return Hb;xj=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Hb=n,Hb}var Gb,wj;function Rs(){if(wj)return Gb;wj=1;var e=hl(),t=Lce(),n=zce(),r="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(l){return l==null?l===void 0?i:r:a&&a in Object(l)?t(l):n(l)}return Gb=o,Gb}var Yb,Sj;function ii(){if(Sj)return Yb;Sj=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Yb=e,Yb}var Zb,Ej;function aE(){if(Ej)return Zb;Ej=1;var e=Rs(),t=ii(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(l){if(!t(l))return!1;var c=e(l);return c==r||c==i||c==n||c==a}return Zb=o,Zb}var Kb,kj;function qce(){if(kj)return Kb;kj=1;var e=ri(),t=e["__core-js_shared__"];return Kb=t,Kb}var Xb,Aj;function Fce(){if(Aj)return Xb;Aj=1;var e=qce(),t=function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function n(r){return!!t&&t in r}return Xb=n,Xb}var Wb,Tj;function I6(){if(Tj)return Wb;Tj=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Wb=n,Wb}var Qb,Cj;function Bce(){if(Cj)return Qb;Cj=1;var e=aE(),t=Fce(),n=ii(),r=I6(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,c=o.toString,f=l.hasOwnProperty,d=RegExp("^"+c.call(f).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(m){if(!n(m)||t(m))return!1;var g=e(m)?d:a;return g.test(r(m))}return Qb=h,Qb}var Jb,Oj;function Uce(){if(Oj)return Jb;Oj=1;function e(t,n){return t==null?void 0:t[n]}return Jb=e,Jb}var ev,Nj;function js(){if(Nj)return ev;Nj=1;var e=Bce(),t=Uce();function n(r,i){var a=t(r,i);return e(a)?a:void 0}return ev=n,ev}var tv,Rj;function sE(){if(Rj)return tv;Rj=1;var e=js(),t=ri(),n=e(t,"Map");return tv=n,tv}var nv,jj;function em(){if(jj)return nv;jj=1;var e=js(),t=e(Object,"create");return nv=t,nv}var rv,Mj;function Vce(){if(Mj)return rv;Mj=1;var e=em();function t(){this.__data__=e?e(null):{},this.size=0}return rv=t,rv}var iv,$j;function Hce(){if($j)return iv;$j=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return iv=e,iv}var av,Dj;function Gce(){if(Dj)return av;Dj=1;var e=em(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(a){var o=this.__data__;if(e){var l=o[a];return l===t?void 0:l}return r.call(o,a)?o[a]:void 0}return av=i,av}var sv,Ij;function Yce(){if(Ij)return sv;Ij=1;var e=em(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var a=this.__data__;return e?a[i]!==void 0:n.call(a,i)}return sv=r,sv}var ov,Pj;function Zce(){if(Pj)return ov;Pj=1;var e=em(),t="__lodash_hash_undefined__";function n(r,i){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=e&&i===void 0?t:i,this}return ov=n,ov}var lv,Lj;function Kce(){if(Lj)return lv;Lj=1;var e=Vce(),t=Hce(),n=Gce(),r=Yce(),i=Zce();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var f=o[l];this.set(f[0],f[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,lv=a,lv}var uv,zj;function Xce(){if(zj)return uv;zj=1;var e=Kce(),t=Jp(),n=sE();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return uv=r,uv}var cv,qj;function Wce(){if(qj)return cv;qj=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return cv=e,cv}var fv,Fj;function tm(){if(Fj)return fv;Fj=1;var e=Wce();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return fv=t,fv}var dv,Bj;function Qce(){if(Bj)return dv;Bj=1;var e=tm();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return dv=t,dv}var hv,Uj;function Jce(){if(Uj)return hv;Uj=1;var e=tm();function t(n){return e(this,n).get(n)}return hv=t,hv}var pv,Vj;function efe(){if(Vj)return pv;Vj=1;var e=tm();function t(n){return e(this,n).has(n)}return pv=t,pv}var mv,Hj;function tfe(){if(Hj)return mv;Hj=1;var e=tm();function t(n,r){var i=e(this,n),a=i.size;return i.set(n,r),this.size+=i.size==a?0:1,this}return mv=t,mv}var gv,Gj;function oE(){if(Gj)return gv;Gj=1;var e=Xce(),t=Qce(),n=Jce(),r=efe(),i=tfe();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var f=o[l];this.set(f[0],f[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,gv=a,gv}var yv,Yj;function nfe(){if(Yj)return yv;Yj=1;var e=Jp(),t=sE(),n=oE(),r=200;function i(a,o){var l=this.__data__;if(l instanceof e){var c=l.__data__;if(!t||c.length<r-1)return c.push([a,o]),this.size=++l.size,this;l=this.__data__=new n(c)}return l.set(a,o),this.size=l.size,this}return yv=i,yv}var bv,Zj;function nm(){if(Zj)return bv;Zj=1;var e=Jp(),t=$ce(),n=Dce(),r=Ice(),i=Pce(),a=nfe();function o(l){var c=this.__data__=new e(l);this.size=c.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=i,o.prototype.set=a,bv=o,bv}var vv,Kj;function P6(){if(Kj)return vv;Kj=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i&&n(t[r],r,t)!==!1;);return t}return vv=e,vv}var _v,Xj;function L6(){if(Xj)return _v;Xj=1;var e=js(),t=function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}}();return _v=t,_v}var xv,Wj;function lE(){if(Wj)return xv;Wj=1;var e=L6();function t(n,r,i){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return xv=t,xv}var wv,Qj;function z6(){if(Qj)return wv;Qj=1;var e=lE(),t=dl(),n=Object.prototype,r=n.hasOwnProperty;function i(a,o,l){var c=a[o];(!(r.call(a,o)&&t(c,l))||l===void 0&&!(o in a))&&e(a,o,l)}return wv=i,wv}var Sv,Jj;function zc(){if(Jj)return Sv;Jj=1;var e=z6(),t=lE();function n(r,i,a,o){var l=!a;a||(a={});for(var c=-1,f=i.length;++c<f;){var d=i[c],h=o?o(a[d],r[d],d,a,r):void 0;h===void 0&&(h=r[d]),l?t(a,d,h):e(a,d,h)}return a}return Sv=n,Sv}var Ev,eM;function rfe(){if(eM)return Ev;eM=1;function e(t,n){for(var r=-1,i=Array(t);++r<t;)i[r]=n(r);return i}return Ev=e,Ev}var kv,tM;function ai(){if(tM)return kv;tM=1;function e(t){return t!=null&&typeof t=="object"}return kv=e,kv}var Av,nM;function ife(){if(nM)return Av;nM=1;var e=Rs(),t=ai(),n="[object Arguments]";function r(i){return t(i)&&e(i)==n}return Av=r,Av}var Tv,rM;function rm(){if(rM)return Tv;rM=1;var e=ife(),t=ai(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,a=e(function(){return arguments}())?e:function(o){return t(o)&&r.call(o,"callee")&&!i.call(o,"callee")};return Tv=a,Tv}var Cv,iM;function lr(){if(iM)return Cv;iM=1;var e=Array.isArray;return Cv=e,Cv}var qu={exports:{}},Ov,aM;function afe(){if(aM)return Ov;aM=1;function e(){return!1}return Ov=e,Ov}qu.exports;var sM;function im(){return sM||(sM=1,function(e,t){var n=ri(),r=afe(),i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===i,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,f=c||r;e.exports=f}(qu,qu.exports)),qu.exports}var Nv,oM;function uE(){if(oM)return Nv;oM=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,i){var a=typeof r;return i=i??e,!!i&&(a=="number"||a!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<i}return Nv=n,Nv}var Rv,lM;function cE(){if(lM)return Rv;lM=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Rv=t,Rv}var jv,uM;function sfe(){if(uM)return jv;uM=1;var e=Rs(),t=cE(),n=ai(),r="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",l="[object Error]",c="[object Function]",f="[object Map]",d="[object Number]",h="[object Object]",m="[object RegExp]",g="[object Set]",v="[object String]",w="[object WeakMap]",b="[object ArrayBuffer]",_="[object DataView]",S="[object Float32Array]",x="[object Float64Array]",A="[object Int8Array]",k="[object Int16Array]",T="[object Int32Array]",O="[object Uint8Array]",$="[object Uint8ClampedArray]",L="[object Uint16Array]",M="[object Uint32Array]",z={};z[S]=z[x]=z[A]=z[k]=z[T]=z[O]=z[$]=z[L]=z[M]=!0,z[r]=z[i]=z[b]=z[a]=z[_]=z[o]=z[l]=z[c]=z[f]=z[d]=z[h]=z[m]=z[g]=z[v]=z[w]=!1;function P(q){return n(q)&&t(q.length)&&!!z[e(q)]}return jv=P,jv}var Mv,cM;function Ms(){if(cM)return Mv;cM=1;function e(t){return function(n){return t(n)}}return Mv=e,Mv}var Fu={exports:{}};Fu.exports;var fM;function fE(){return fM||(fM=1,function(e,t){var n=D6(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===r,o=a&&n.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l}(Fu,Fu.exports)),Fu.exports}var $v,dM;function dE(){if(dM)return $v;dM=1;var e=sfe(),t=Ms(),n=fE(),r=n&&n.isTypedArray,i=r?t(r):e;return $v=i,$v}var Dv,hM;function q6(){if(hM)return Dv;hM=1;var e=rfe(),t=rm(),n=lr(),r=im(),i=uE(),a=dE(),o=Object.prototype,l=o.hasOwnProperty;function c(f,d){var h=n(f),m=!h&&t(f),g=!h&&!m&&r(f),v=!h&&!m&&!g&&a(f),w=h||m||g||v,b=w?e(f.length,String):[],_=b.length;for(var S in f)(d||l.call(f,S))&&!(w&&(S=="length"||g&&(S=="offset"||S=="parent")||v&&(S=="buffer"||S=="byteLength"||S=="byteOffset")||i(S,_)))&&b.push(S);return b}return Dv=c,Dv}var Iv,pM;function hE(){if(pM)return Iv;pM=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return Iv=t,Iv}var Pv,mM;function F6(){if(mM)return Pv;mM=1;function e(t,n){return function(r){return t(n(r))}}return Pv=e,Pv}var Lv,gM;function ofe(){if(gM)return Lv;gM=1;var e=F6(),t=e(Object.keys,Object);return Lv=t,Lv}var zv,yM;function lfe(){if(yM)return zv;yM=1;var e=hE(),t=ofe(),n=Object.prototype,r=n.hasOwnProperty;function i(a){if(!e(a))return t(a);var o=[];for(var l in Object(a))r.call(a,l)&&l!="constructor"&&o.push(l);return o}return zv=i,zv}var qv,bM;function pl(){if(bM)return qv;bM=1;var e=aE(),t=cE();function n(r){return r!=null&&t(r.length)&&!e(r)}return qv=n,qv}var Fv,vM;function qc(){if(vM)return Fv;vM=1;var e=q6(),t=lfe(),n=pl();function r(i){return n(i)?e(i):t(i)}return Fv=r,Fv}var Bv,_M;function ufe(){if(_M)return Bv;_M=1;var e=zc(),t=qc();function n(r,i){return r&&e(i,t(i),r)}return Bv=n,Bv}var Uv,xM;function cfe(){if(xM)return Uv;xM=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return Uv=e,Uv}var Vv,wM;function ffe(){if(wM)return Vv;wM=1;var e=ii(),t=hE(),n=cfe(),r=Object.prototype,i=r.hasOwnProperty;function a(o){if(!e(o))return n(o);var l=t(o),c=[];for(var f in o)f=="constructor"&&(l||!i.call(o,f))||c.push(f);return c}return Vv=a,Vv}var Hv,SM;function ml(){if(SM)return Hv;SM=1;var e=q6(),t=ffe(),n=pl();function r(i){return n(i)?e(i,!0):t(i)}return Hv=r,Hv}var Gv,EM;function dfe(){if(EM)return Gv;EM=1;var e=zc(),t=ml();function n(r,i){return r&&e(i,t(i),r)}return Gv=n,Gv}var Bu={exports:{}};Bu.exports;var kM;function B6(){return kM||(kM=1,function(e,t){var n=ri(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===r,o=a?n.Buffer:void 0,l=o?o.allocUnsafe:void 0;function c(f,d){if(d)return f.slice();var h=f.length,m=l?l(h):new f.constructor(h);return f.copy(m),m}e.exports=c}(Bu,Bu.exports)),Bu.exports}var Yv,AM;function pE(){if(AM)return Yv;AM=1;function e(t,n){var r=-1,i=t.length;for(n||(n=Array(i));++r<i;)n[r]=t[r];return n}return Yv=e,Yv}var Zv,TM;function hfe(){if(TM)return Zv;TM=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,a=0,o=[];++r<i;){var l=t[r];n(l,r,t)&&(o[a++]=l)}return o}return Zv=e,Zv}var Kv,CM;function U6(){if(CM)return Kv;CM=1;function e(){return[]}return Kv=e,Kv}var Xv,OM;function mE(){if(OM)return Xv;OM=1;var e=hfe(),t=U6(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(o){return o==null?[]:(o=Object(o),e(i(o),function(l){return r.call(o,l)}))}:t;return Xv=a,Xv}var Wv,NM;function pfe(){if(NM)return Wv;NM=1;var e=zc(),t=mE();function n(r,i){return e(r,t(r),i)}return Wv=n,Wv}var Qv,RM;function gE(){if(RM)return Qv;RM=1;function e(t,n){for(var r=-1,i=n.length,a=t.length;++r<i;)t[a+r]=n[r];return t}return Qv=e,Qv}var Jv,jM;function yE(){if(jM)return Jv;jM=1;var e=F6(),t=e(Object.getPrototypeOf,Object);return Jv=t,Jv}var e1,MM;function V6(){if(MM)return e1;MM=1;var e=gE(),t=yE(),n=mE(),r=U6(),i=Object.getOwnPropertySymbols,a=i?function(o){for(var l=[];o;)e(l,n(o)),o=t(o);return l}:r;return e1=a,e1}var t1,$M;function mfe(){if($M)return t1;$M=1;var e=zc(),t=V6();function n(r,i){return e(r,t(r),i)}return t1=n,t1}var n1,DM;function H6(){if(DM)return n1;DM=1;var e=gE(),t=lr();function n(r,i,a){var o=i(r);return t(r)?o:e(o,a(r))}return n1=n,n1}var r1,IM;function G6(){if(IM)return r1;IM=1;var e=H6(),t=mE(),n=qc();function r(i){return e(i,n,t)}return r1=r,r1}var i1,PM;function gfe(){if(PM)return i1;PM=1;var e=H6(),t=V6(),n=ml();function r(i){return e(i,n,t)}return i1=r,i1}var a1,LM;function yfe(){if(LM)return a1;LM=1;var e=js(),t=ri(),n=e(t,"DataView");return a1=n,a1}var s1,zM;function bfe(){if(zM)return s1;zM=1;var e=js(),t=ri(),n=e(t,"Promise");return s1=n,s1}var o1,qM;function Y6(){if(qM)return o1;qM=1;var e=js(),t=ri(),n=e(t,"Set");return o1=n,o1}var l1,FM;function vfe(){if(FM)return l1;FM=1;var e=js(),t=ri(),n=e(t,"WeakMap");return l1=n,l1}var u1,BM;function am(){if(BM)return u1;BM=1;var e=yfe(),t=sE(),n=bfe(),r=Y6(),i=vfe(),a=Rs(),o=I6(),l="[object Map]",c="[object Object]",f="[object Promise]",d="[object Set]",h="[object WeakMap]",m="[object DataView]",g=o(e),v=o(t),w=o(n),b=o(r),_=o(i),S=a;return(e&&S(new e(new ArrayBuffer(1)))!=m||t&&S(new t)!=l||n&&S(n.resolve())!=f||r&&S(new r)!=d||i&&S(new i)!=h)&&(S=function(x){var A=a(x),k=A==c?x.constructor:void 0,T=k?o(k):"";if(T)switch(T){case g:return m;case v:return l;case w:return f;case b:return d;case _:return h}return A}),u1=S,u1}var c1,UM;function _fe(){if(UM)return c1;UM=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r){var i=r.length,a=new r.constructor(i);return i&&typeof r[0]=="string"&&t.call(r,"index")&&(a.index=r.index,a.input=r.input),a}return c1=n,c1}var f1,VM;function Z6(){if(VM)return f1;VM=1;var e=ri(),t=e.Uint8Array;return f1=t,f1}var d1,HM;function bE(){if(HM)return d1;HM=1;var e=Z6();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return d1=t,d1}var h1,GM;function xfe(){if(GM)return h1;GM=1;var e=bE();function t(n,r){var i=r?e(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.byteLength)}return h1=t,h1}var p1,YM;function wfe(){if(YM)return p1;YM=1;var e=/\w*$/;function t(n){var r=new n.constructor(n.source,e.exec(n));return r.lastIndex=n.lastIndex,r}return p1=t,p1}var m1,ZM;function Sfe(){if(ZM)return m1;ZM=1;var e=hl(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function r(i){return n?Object(n.call(i)):{}}return m1=r,m1}var g1,KM;function K6(){if(KM)return g1;KM=1;var e=bE();function t(n,r){var i=r?e(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.length)}return g1=t,g1}var y1,XM;function Efe(){if(XM)return y1;XM=1;var e=bE(),t=xfe(),n=wfe(),r=Sfe(),i=K6(),a="[object Boolean]",o="[object Date]",l="[object Map]",c="[object Number]",f="[object RegExp]",d="[object Set]",h="[object String]",m="[object Symbol]",g="[object ArrayBuffer]",v="[object DataView]",w="[object Float32Array]",b="[object Float64Array]",_="[object Int8Array]",S="[object Int16Array]",x="[object Int32Array]",A="[object Uint8Array]",k="[object Uint8ClampedArray]",T="[object Uint16Array]",O="[object Uint32Array]";function $(L,M,z){var P=L.constructor;switch(M){case g:return e(L);case a:case o:return new P(+L);case v:return t(L,z);case w:case b:case _:case S:case x:case A:case k:case T:case O:return i(L,z);case l:return new P;case c:case h:return new P(L);case f:return n(L);case d:return new P;case m:return r(L)}}return y1=$,y1}var b1,WM;function kfe(){if(WM)return b1;WM=1;var e=ii(),t=Object.create,n=function(){function r(){}return function(i){if(!e(i))return{};if(t)return t(i);r.prototype=i;var a=new r;return r.prototype=void 0,a}}();return b1=n,b1}var v1,QM;function X6(){if(QM)return v1;QM=1;var e=kfe(),t=yE(),n=hE();function r(i){return typeof i.constructor=="function"&&!n(i)?e(t(i)):{}}return v1=r,v1}var _1,JM;function Afe(){if(JM)return _1;JM=1;var e=am(),t=ai(),n="[object Map]";function r(i){return t(i)&&e(i)==n}return _1=r,_1}var x1,e$;function Tfe(){if(e$)return x1;e$=1;var e=Afe(),t=Ms(),n=fE(),r=n&&n.isMap,i=r?t(r):e;return x1=i,x1}var w1,t$;function Cfe(){if(t$)return w1;t$=1;var e=am(),t=ai(),n="[object Set]";function r(i){return t(i)&&e(i)==n}return w1=r,w1}var S1,n$;function Ofe(){if(n$)return S1;n$=1;var e=Cfe(),t=Ms(),n=fE(),r=n&&n.isSet,i=r?t(r):e;return S1=i,S1}var E1,r$;function Nfe(){if(r$)return E1;r$=1;var e=nm(),t=P6(),n=z6(),r=ufe(),i=dfe(),a=B6(),o=pE(),l=pfe(),c=mfe(),f=G6(),d=gfe(),h=am(),m=_fe(),g=Efe(),v=X6(),w=lr(),b=im(),_=Tfe(),S=ii(),x=Ofe(),A=qc(),k=ml(),T=1,O=2,$=4,L="[object Arguments]",M="[object Array]",z="[object Boolean]",P="[object Date]",q="[object Error]",D="[object Function]",H="[object GeneratorFunction]",B="[object Map]",G="[object Number]",K="[object Object]",Q="[object RegExp]",R="[object Set]",V="[object String]",X="[object Symbol]",j="[object WeakMap]",I="[object ArrayBuffer]",U="[object DataView]",Y="[object Float32Array]",ne="[object Float64Array]",ae="[object Int8Array]",re="[object Int16Array]",le="[object Int32Array]",W="[object Uint8Array]",J="[object Uint8ClampedArray]",se="[object Uint16Array]",fe="[object Uint32Array]",me={};me[L]=me[M]=me[I]=me[U]=me[z]=me[P]=me[Y]=me[ne]=me[ae]=me[re]=me[le]=me[B]=me[G]=me[K]=me[Q]=me[R]=me[V]=me[X]=me[W]=me[J]=me[se]=me[fe]=!0,me[q]=me[D]=me[j]=!1;function xe(we,Ve,qe,We,He,$e){var Be,Ot=Ve&T,kt=Ve&O,pe=Ve&$;if(qe&&(Be=He?qe(we,We,He,$e):qe(we)),Be!==void 0)return Be;if(!S(we))return we;var _e=w(we);if(_e){if(Be=m(we),!Ot)return o(we,Be)}else{var Te=h(we),je=Te==D||Te==H;if(b(we))return a(we,Ot);if(Te==K||Te==L||je&&!He){if(Be=kt||je?{}:v(we),!Ot)return kt?c(we,i(Be,we)):l(we,r(Be,we))}else{if(!me[Te])return He?we:{};Be=g(we,Te,Ot)}}$e||($e=new e);var rt=$e.get(we);if(rt)return rt;$e.set(we,Be),x(we)?we.forEach(function($t){Be.add(xe($t,Ve,qe,$t,we,$e))}):_(we)&&we.forEach(function($t,Gt){Be.set(Gt,xe($t,Ve,qe,Gt,we,$e))});var cn=pe?kt?d:f:kt?k:A,Cn=_e?void 0:cn(we);return t(Cn||we,function($t,Gt){Cn&&(Gt=$t,$t=we[Gt]),n(Be,Gt,xe($t,Ve,qe,Gt,we,$e))}),Be}return E1=xe,E1}var k1,i$;function Rfe(){if(i$)return k1;i$=1;var e=Nfe(),t=1,n=4;function r(i){return e(i,t|n)}return k1=r,k1}var A1,a$;function jfe(){if(a$)return A1;a$=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return A1=t,A1}var T1,s$;function Mfe(){if(s$)return T1;s$=1;function e(t){return this.__data__.has(t)}return T1=e,T1}var C1,o$;function sm(){if(o$)return C1;o$=1;var e=oE(),t=jfe(),n=Mfe();function r(i){var a=-1,o=i==null?0:i.length;for(this.__data__=new e;++a<o;)this.add(i[a])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,C1=r,C1}var O1,l$;function $fe(){if(l$)return O1;l$=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(t[r],r,t))return!0;return!1}return O1=e,O1}var N1,u$;function om(){if(u$)return N1;u$=1;function e(t,n){return t.has(n)}return N1=e,N1}var R1,c$;function W6(){if(c$)return R1;c$=1;var e=sm(),t=$fe(),n=om(),r=1,i=2;function a(o,l,c,f,d,h){var m=c&r,g=o.length,v=l.length;if(g!=v&&!(m&&v>g))return!1;var w=h.get(o),b=h.get(l);if(w&&b)return w==l&&b==o;var _=-1,S=!0,x=c&i?new e:void 0;for(h.set(o,l),h.set(l,o);++_<g;){var A=o[_],k=l[_];if(f)var T=m?f(k,A,_,l,o,h):f(A,k,_,o,l,h);if(T!==void 0){if(T)continue;S=!1;break}if(x){if(!t(l,function(O,$){if(!n(x,$)&&(A===O||d(A,O,c,f,h)))return x.push($)})){S=!1;break}}else if(!(A===k||d(A,k,c,f,h))){S=!1;break}}return h.delete(o),h.delete(l),S}return R1=a,R1}var j1,f$;function Dfe(){if(f$)return j1;f$=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i,a){r[++n]=[a,i]}),r}return j1=e,j1}var M1,d$;function vE(){if(d$)return M1;d$=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i){r[++n]=i}),r}return M1=e,M1}var $1,h$;function Ife(){if(h$)return $1;h$=1;var e=hl(),t=Z6(),n=dl(),r=W6(),i=Dfe(),a=vE(),o=1,l=2,c="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Map]",m="[object Number]",g="[object RegExp]",v="[object Set]",w="[object String]",b="[object Symbol]",_="[object ArrayBuffer]",S="[object DataView]",x=e?e.prototype:void 0,A=x?x.valueOf:void 0;function k(T,O,$,L,M,z,P){switch($){case S:if(T.byteLength!=O.byteLength||T.byteOffset!=O.byteOffset)return!1;T=T.buffer,O=O.buffer;case _:return!(T.byteLength!=O.byteLength||!z(new t(T),new t(O)));case c:case f:case m:return n(+T,+O);case d:return T.name==O.name&&T.message==O.message;case g:case w:return T==O+"";case h:var q=i;case v:var D=L&o;if(q||(q=a),T.size!=O.size&&!D)return!1;var H=P.get(T);if(H)return H==O;L|=l,P.set(T,O);var B=r(q(T),q(O),L,M,z,P);return P.delete(T),B;case b:if(A)return A.call(T)==A.call(O)}return!1}return $1=k,$1}var D1,p$;function Pfe(){if(p$)return D1;p$=1;var e=G6(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(a,o,l,c,f,d){var h=l&t,m=e(a),g=m.length,v=e(o),w=v.length;if(g!=w&&!h)return!1;for(var b=g;b--;){var _=m[b];if(!(h?_ in o:r.call(o,_)))return!1}var S=d.get(a),x=d.get(o);if(S&&x)return S==o&&x==a;var A=!0;d.set(a,o),d.set(o,a);for(var k=h;++b<g;){_=m[b];var T=a[_],O=o[_];if(c)var $=h?c(O,T,_,o,a,d):c(T,O,_,a,o,d);if(!($===void 0?T===O||f(T,O,l,c,d):$)){A=!1;break}k||(k=_=="constructor")}if(A&&!k){var L=a.constructor,M=o.constructor;L!=M&&"constructor"in a&&"constructor"in o&&!(typeof L=="function"&&L instanceof L&&typeof M=="function"&&M instanceof M)&&(A=!1)}return d.delete(a),d.delete(o),A}return D1=i,D1}var I1,m$;function Lfe(){if(m$)return I1;m$=1;var e=nm(),t=W6(),n=Ife(),r=Pfe(),i=am(),a=lr(),o=im(),l=dE(),c=1,f="[object Arguments]",d="[object Array]",h="[object Object]",m=Object.prototype,g=m.hasOwnProperty;function v(w,b,_,S,x,A){var k=a(w),T=a(b),O=k?d:i(w),$=T?d:i(b);O=O==f?h:O,$=$==f?h:$;var L=O==h,M=$==h,z=O==$;if(z&&o(w)){if(!o(b))return!1;k=!0,L=!1}if(z&&!L)return A||(A=new e),k||l(w)?t(w,b,_,S,x,A):n(w,b,O,_,S,x,A);if(!(_&c)){var P=L&&g.call(w,"__wrapped__"),q=M&&g.call(b,"__wrapped__");if(P||q){var D=P?w.value():w,H=q?b.value():b;return A||(A=new e),x(D,H,_,S,A)}}return z?(A||(A=new e),r(w,b,_,S,x,A)):!1}return I1=v,I1}var P1,g$;function _E(){if(g$)return P1;g$=1;var e=Lfe(),t=ai();function n(r,i,a,o,l){return r===i?!0:r==null||i==null||!t(r)&&!t(i)?r!==r&&i!==i:e(r,i,a,o,n,l)}return P1=n,P1}var L1,y$;function Q6(){if(y$)return L1;y$=1;var e=_E();function t(n,r){return e(n,r)}return L1=t,L1}var z1,b$;function zfe(){if(b$)return z1;b$=1;var e=hl(),t=rm(),n=lr(),r=e?e.isConcatSpreadable:void 0;function i(a){return n(a)||t(a)||!!(r&&a&&a[r])}return z1=i,z1}var q1,v$;function xE(){if(v$)return q1;v$=1;var e=gE(),t=zfe();function n(r,i,a,o,l){var c=-1,f=r.length;for(a||(a=t),l||(l=[]);++c<f;){var d=r[c];i>0&&a(d)?i>1?n(d,i-1,a,o,l):e(l,d):o||(l[l.length]=d)}return l}return q1=n,q1}var F1,_$;function $s(){if(_$)return F1;_$=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,a=Array(i);++r<i;)a[r]=n(t[r],r,t);return a}return F1=e,F1}var B1,x$;function lm(){if(x$)return B1;x$=1;var e=Rs(),t=ai(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return B1=r,B1}var U1,w$;function wE(){if(w$)return U1;w$=1;var e=lr(),t=lm(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){if(e(a))return!1;var l=typeof a;return l=="number"||l=="symbol"||l=="boolean"||a==null||t(a)?!0:r.test(a)||!n.test(a)||o!=null&&a in Object(o)}return U1=i,U1}var V1,S$;function qfe(){if(S$)return V1;S$=1;var e=oE(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,l=i?i.apply(this,o):o[0],c=a.cache;if(c.has(l))return c.get(l);var f=r.apply(this,o);return a.cache=c.set(l,f)||c,f};return a.cache=new(n.Cache||e),a}return n.Cache=e,V1=n,V1}var H1,E$;function Ffe(){if(E$)return H1;E$=1;var e=qfe(),t=500;function n(r){var i=e(r,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return H1=n,H1}var G1,k$;function Bfe(){if(k$)return G1;k$=1;var e=Ffe(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,l,c,f){a.push(c?f.replace(n,"$1"):l||o)}),a});return G1=r,G1}var Y1,A$;function Ufe(){if(A$)return Y1;A$=1;var e=hl(),t=$s(),n=lr(),r=lm(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(l){if(typeof l=="string")return l;if(n(l))return t(l,o)+"";if(r(l))return a?a.call(l):"";var c=l+"";return c=="0"&&1/l==-1/0?"-0":c}return Y1=o,Y1}var Z1,T$;function Vfe(){if(T$)return Z1;T$=1;var e=Ufe();function t(n){return n==null?"":e(n)}return Z1=t,Z1}var K1,C$;function J6(){if(C$)return K1;C$=1;var e=lr(),t=wE(),n=Bfe(),r=Vfe();function i(a,o){return e(a)?a:t(a,o)?[a]:n(r(a))}return K1=i,K1}var X1,O$;function um(){if(O$)return X1;O$=1;var e=lm();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return X1=t,X1}var W1,N$;function SE(){if(N$)return W1;N$=1;var e=J6(),t=um();function n(r,i){i=e(i,r);for(var a=0,o=i.length;r!=null&&a<o;)r=r[t(i[a++])];return a&&a==o?r:void 0}return W1=n,W1}var Q1,R$;function Hfe(){if(R$)return Q1;R$=1;var e=nm(),t=_E(),n=1,r=2;function i(a,o,l,c){var f=l.length,d=f,h=!c;if(a==null)return!d;for(a=Object(a);f--;){var m=l[f];if(h&&m[2]?m[1]!==a[m[0]]:!(m[0]in a))return!1}for(;++f<d;){m=l[f];var g=m[0],v=a[g],w=m[1];if(h&&m[2]){if(v===void 0&&!(g in a))return!1}else{var b=new e;if(c)var _=c(v,w,g,a,o,b);if(!(_===void 0?t(w,v,n|r,c,b):_))return!1}}return!0}return Q1=i,Q1}var J1,j$;function eL(){if(j$)return J1;j$=1;var e=ii();function t(n){return n===n&&!e(n)}return J1=t,J1}var e_,M$;function Gfe(){if(M$)return e_;M$=1;var e=eL(),t=qc();function n(r){for(var i=t(r),a=i.length;a--;){var o=i[a],l=r[o];i[a]=[o,l,e(l)]}return i}return e_=n,e_}var t_,$$;function tL(){if($$)return t_;$$=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return t_=e,t_}var n_,D$;function Yfe(){if(D$)return n_;D$=1;var e=Hfe(),t=Gfe(),n=tL();function r(i){var a=t(i);return a.length==1&&a[0][2]?n(a[0][0],a[0][1]):function(o){return o===i||e(o,i,a)}}return n_=r,n_}var r_,I$;function Zfe(){if(I$)return r_;I$=1;var e=SE();function t(n,r,i){var a=n==null?void 0:e(n,r);return a===void 0?i:a}return r_=t,r_}var i_,P$;function Kfe(){if(P$)return i_;P$=1;function e(t,n){return t!=null&&n in Object(t)}return i_=e,i_}var a_,L$;function Xfe(){if(L$)return a_;L$=1;var e=J6(),t=rm(),n=lr(),r=uE(),i=cE(),a=um();function o(l,c,f){c=e(c,l);for(var d=-1,h=c.length,m=!1;++d<h;){var g=a(c[d]);if(!(m=l!=null&&f(l,g)))break;l=l[g]}return m||++d!=h?m:(h=l==null?0:l.length,!!h&&i(h)&&r(g,h)&&(n(l)||t(l)))}return a_=o,a_}var s_,z$;function Wfe(){if(z$)return s_;z$=1;var e=Kfe(),t=Xfe();function n(r,i){return r!=null&&t(r,i,e)}return s_=n,s_}var o_,q$;function Qfe(){if(q$)return o_;q$=1;var e=_E(),t=Zfe(),n=Wfe(),r=wE(),i=eL(),a=tL(),o=um(),l=1,c=2;function f(d,h){return r(d)&&i(h)?a(o(d),h):function(m){var g=t(m,d);return g===void 0&&g===h?n(m,d):e(h,g,l|c)}}return o_=f,o_}var l_,F$;function Fc(){if(F$)return l_;F$=1;function e(t){return t}return l_=e,l_}var u_,B$;function Jfe(){if(B$)return u_;B$=1;function e(t){return function(n){return n==null?void 0:n[t]}}return u_=e,u_}var c_,U$;function ede(){if(U$)return c_;U$=1;var e=SE();function t(n){return function(r){return e(r,n)}}return c_=t,c_}var f_,V$;function tde(){if(V$)return f_;V$=1;var e=Jfe(),t=ede(),n=wE(),r=um();function i(a){return n(a)?e(r(a)):t(a)}return f_=i,f_}var d_,H$;function nde(){if(H$)return d_;H$=1;var e=Yfe(),t=Qfe(),n=Fc(),r=lr(),i=tde();function a(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):i(o)}return d_=a,d_}var h_,G$;function rde(){if(G$)return h_;G$=1;function e(t){return function(n,r,i){for(var a=-1,o=Object(n),l=i(n),c=l.length;c--;){var f=l[t?c:++a];if(r(o[f],f,o)===!1)break}return n}}return h_=e,h_}var p_,Y$;function nL(){if(Y$)return p_;Y$=1;var e=rde(),t=e();return p_=t,p_}var m_,Z$;function ide(){if(Z$)return m_;Z$=1;var e=nL(),t=qc();function n(r,i){return r&&e(r,i,t)}return m_=n,m_}var g_,K$;function ade(){if(K$)return g_;K$=1;var e=pl();function t(n,r){return function(i,a){if(i==null)return i;if(!e(i))return n(i,a);for(var o=i.length,l=r?o:-1,c=Object(i);(r?l--:++l<o)&&a(c[l],l,c)!==!1;);return i}}return g_=t,g_}var y_,X$;function rL(){if(X$)return y_;X$=1;var e=ide(),t=ade(),n=t(e);return y_=n,y_}var b_,W$;function sde(){if(W$)return b_;W$=1;var e=rL(),t=pl();function n(r,i){var a=-1,o=t(r)?Array(r.length):[];return e(r,function(l,c,f){o[++a]=i(l,c,f)}),o}return b_=n,b_}var v_,Q$;function ode(){if(Q$)return v_;Q$=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return v_=e,v_}var __,J$;function lde(){if(J$)return __;J$=1;var e=lm();function t(n,r){if(n!==r){var i=n!==void 0,a=n===null,o=n===n,l=e(n),c=r!==void 0,f=r===null,d=r===r,h=e(r);if(!f&&!h&&!l&&n>r||l&&c&&d&&!f&&!h||a&&c&&d||!i&&d||!o)return 1;if(!a&&!l&&!h&&n<r||h&&i&&o&&!a&&!l||f&&i&&o||!c&&o||!d)return-1}return 0}return __=t,__}var x_,e4;function ude(){if(e4)return x_;e4=1;var e=lde();function t(n,r,i){for(var a=-1,o=n.criteria,l=r.criteria,c=o.length,f=i.length;++a<c;){var d=e(o[a],l[a]);if(d){if(a>=f)return d;var h=i[a];return d*(h=="desc"?-1:1)}}return n.index-r.index}return x_=t,x_}var w_,t4;function cde(){if(t4)return w_;t4=1;var e=$s(),t=SE(),n=nde(),r=sde(),i=ode(),a=Ms(),o=ude(),l=Fc(),c=lr();function f(d,h,m){h.length?h=e(h,function(w){return c(w)?function(b){return t(b,w.length===1?w[0]:w)}:w}):h=[l];var g=-1;h=e(h,a(n));var v=r(d,function(w,b,_){var S=e(h,function(x){return x(w)});return{criteria:S,index:++g,value:w}});return i(v,function(w,b){return o(w,b,m)})}return w_=f,w_}var S_,n4;function iL(){if(n4)return S_;n4=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return S_=e,S_}var E_,r4;function fde(){if(r4)return E_;r4=1;var e=iL(),t=Math.max;function n(r,i,a){return i=t(i===void 0?r.length-1:i,0),function(){for(var o=arguments,l=-1,c=t(o.length-i,0),f=Array(c);++l<c;)f[l]=o[i+l];l=-1;for(var d=Array(i+1);++l<i;)d[l]=o[l];return d[i]=a(f),e(r,this,d)}}return E_=n,E_}var k_,i4;function dde(){if(i4)return k_;i4=1;function e(t){return function(){return t}}return k_=e,k_}var A_,a4;function hde(){if(a4)return A_;a4=1;var e=dde(),t=L6(),n=Fc(),r=t?function(i,a){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:n;return A_=r,A_}var T_,s4;function pde(){if(s4)return T_;s4=1;var e=800,t=16,n=Date.now;function r(i){var a=0,o=0;return function(){var l=n(),c=t-(l-o);if(o=l,c>0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return T_=r,T_}var C_,o4;function mde(){if(o4)return C_;o4=1;var e=hde(),t=pde(),n=t(e);return C_=n,C_}var O_,l4;function Ds(){if(l4)return O_;l4=1;var e=Fc(),t=fde(),n=mde();function r(i,a){return n(t(i,a,e),i+"")}return O_=r,O_}var N_,u4;function EE(){if(u4)return N_;u4=1;var e=dl(),t=pl(),n=uE(),r=ii();function i(a,o,l){if(!r(l))return!1;var c=typeof o;return(c=="number"?t(l)&&n(o,l.length):c=="string"&&o in l)?e(l[o],a):!1}return N_=i,N_}var R_,c4;function aL(){if(c4)return R_;c4=1;var e=xE(),t=cde(),n=Ds(),r=EE(),i=n(function(a,o){if(a==null)return[];var l=o.length;return l>1&&r(a,o[0],o[1])?o=[]:l>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return R_=i,R_}var j_,f4;function gde(){if(f4)return j_;f4=1;function e(t,n,r,i){for(var a=t.length,o=r+(i?1:-1);i?o--:++o<a;)if(n(t[o],o,t))return o;return-1}return j_=e,j_}var M_,d4;function yde(){if(d4)return M_;d4=1;function e(t){return t!==t}return M_=e,M_}var $_,h4;function bde(){if(h4)return $_;h4=1;function e(t,n,r){for(var i=r-1,a=t.length;++i<a;)if(t[i]===n)return i;return-1}return $_=e,$_}var D_,p4;function sL(){if(p4)return D_;p4=1;var e=gde(),t=yde(),n=bde();function r(i,a,o){return a===a?n(i,a,o):e(i,t,o)}return D_=r,D_}var I_,m4;function kE(){if(m4)return I_;m4=1;var e=sL();function t(n,r){var i=n==null?0:n.length;return!!i&&e(n,r,0)>-1}return I_=t,I_}var P_,g4;function AE(){if(g4)return P_;g4=1;function e(t,n,r){for(var i=-1,a=t==null?0:t.length;++i<a;)if(r(n,t[i]))return!0;return!1}return P_=e,P_}var L_,y4;function vde(){if(y4)return L_;y4=1;function e(){}return L_=e,L_}var z_,b4;function _de(){if(b4)return z_;b4=1;var e=Y6(),t=vde(),n=vE(),r=1/0,i=e&&1/n(new e([,-0]))[1]==r?function(a){return new e(a)}:t;return z_=i,z_}var q_,v4;function oL(){if(v4)return q_;v4=1;var e=sm(),t=kE(),n=AE(),r=om(),i=_de(),a=vE(),o=200;function l(c,f,d){var h=-1,m=t,g=c.length,v=!0,w=[],b=w;if(d)v=!1,m=n;else if(g>=o){var _=f?null:i(c);if(_)return a(_);v=!1,m=r,b=new e}else b=f?[]:w;e:for(;++h<g;){var S=c[h],x=f?f(S):S;if(S=d||S!==0?S:0,v&&x===x){for(var A=b.length;A--;)if(b[A]===x)continue e;f&&b.push(x),w.push(S)}else m(b,x,d)||(b!==w&&b.push(x),w.push(S))}return w}return q_=l,q_}var F_,_4;function TE(){if(_4)return F_;_4=1;var e=oL();function t(n){return n&&n.length?e(n):[]}return F_=t,F_}var B_,x4;function CE(){if(x4)return B_;x4=1;var e=oL();function t(n,r){return r=typeof r=="function"?r:void 0,n&&n.length?e(n,void 0,r):[]}return B_=t,B_}var U_,w4;function xde(){if(w4)return U_;w4=1;var e=Ds(),t=dl(),n=EE(),r=ml(),i=Object.prototype,a=i.hasOwnProperty,o=e(function(l,c){l=Object(l);var f=-1,d=c.length,h=d>2?c[2]:void 0;for(h&&n(c[0],c[1],h)&&(d=1);++f<d;)for(var m=c[f],g=r(m),v=-1,w=g.length;++v<w;){var b=g[v],_=l[b];(_===void 0||t(_,i[b])&&!a.call(l,b))&&(l[b]=m[b])}return l});return U_=o,U_}var V_,S4;function lL(){if(S4)return V_;S4=1;var e=sm(),t=kE(),n=AE(),r=$s(),i=Ms(),a=om(),o=Math.min;function l(c,f,d){for(var h=d?n:t,m=c[0].length,g=c.length,v=g,w=Array(g),b=1/0,_=[];v--;){var S=c[v];v&&f&&(S=r(S,i(f))),b=o(S.length,b),w[v]=!d&&(f||m>=120&&S.length>=120)?new e(v&&S):void 0}S=c[0];var x=-1,A=w[0];e:for(;++x<m&&_.length<b;){var k=S[x],T=f?f(k):k;if(k=d||k!==0?k:0,!(A?a(A,T):h(_,T,d))){for(v=g;--v;){var O=w[v];if(!(O?a(O,T):h(c[v],T,d)))continue e}A&&A.push(T),_.push(k)}}return _}return V_=l,V_}var H_,E4;function OE(){if(E4)return H_;E4=1;var e=pl(),t=ai();function n(r){return t(r)&&e(r)}return H_=n,H_}var G_,k4;function uL(){if(k4)return G_;k4=1;var e=OE();function t(n){return e(n)?n:[]}return G_=t,G_}var Y_,A4;function wde(){if(A4)return Y_;A4=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return Y_=e,Y_}var Z_,T4;function cL(){if(T4)return Z_;T4=1;var e=$s(),t=lL(),n=Ds(),r=uL(),i=wde(),a=n(function(o){var l=i(o),c=e(o,r);return l=typeof l=="function"?l:void 0,l&&c.pop(),c.length&&c[0]===o[0]?t(c,void 0,l):[]});return Z_=a,Z_}var K_,C4;function cm(){if(C4)return K_;C4=1;var e=Rs(),t=yE(),n=ai(),r="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,l=a.hasOwnProperty,c=o.call(Object);function f(d){if(!n(d)||e(d)!=r)return!1;var h=t(d);if(h===null)return!0;var m=l.call(h,"constructor")&&h.constructor;return typeof m=="function"&&m instanceof m&&o.call(m)==c}return K_=f,K_}var X_,O4;function Sde(){if(O4)return X_;O4=1;var e=Rs(),t=ai(),n="[object Boolean]";function r(i){return i===!0||i===!1||t(i)&&e(i)==n}return X_=r,X_}var W_,N4;function NE(){if(N4)return W_;N4=1;var e=Q6(),t=aL(),n=TE(),r=CE(),i=xde(),a=cL(),o=cm(),l=Sde(),c=q=>Array.isArray(q)?q:[q],f=q=>q===void 0,d=q=>o(q)||Array.isArray(q)?Object.keys(q):[],h=(q,D)=>q.hasOwnProperty(D),m=q=>t(n(q)),g=q=>f(q)||Array.isArray(q)&&q.length===0,v=(q,D,H,B)=>D&&h(D,H)&&q&&h(q,H)&&B(q[H],D[H]),w=(q,D)=>f(q)&&D===0||f(D)&&q===0||e(q,D),b=(q,D)=>f(q)&&D===!1||f(D)&&q===!1||e(q,D),_=q=>f(q)||e(q,{})||q===!0,S=q=>f(q)||e(q,{}),x=q=>f(q)||o(q)||q===!0||q===!1;function A(q,D){return g(q)&&g(D)?!0:e(m(q),m(D))}function k(q,D){return q=c(q),D=c(D),e(m(q),m(D))}function T(q,D,H,B){var G=n(d(q).concat(d(D)));return S(q)&&S(D)?!0:S(q)&&d(D).length||S(D)&&d(q).length?!1:G.every(function(K){var Q=q[K],R=D[K];return Array.isArray(Q)&&Array.isArray(R)?e(m(q),m(D)):Array.isArray(Q)&&!Array.isArray(R)||Array.isArray(R)&&!Array.isArray(Q)?!1:v(q,D,K,B)})}function O(q,D,H,B){return o(q)&&o(D)?B(q,D):Array.isArray(q)&&Array.isArray(D)?T(q,D,H,B):e(q,D)}function $(q,D,H,B){var G=r(q,B),K=r(D,B),Q=a(G,K,B);return Q.length===Math.max(G.length,K.length)}var L={title:e,uniqueItems:b,minLength:w,minItems:w,minProperties:w,required:A,enum:A,type:k,items:O,anyOf:$,allOf:$,oneOf:$,properties:T,patternProperties:T,dependencies:T},M=["properties","patternProperties","dependencies","uniqueItems","minLength","minItems","minProperties","required"],z=["additionalProperties","additionalItems","contains","propertyNames","not"];function P(q,D,H){if(H=i(H,{ignore:[]}),_(q)&&_(D))return!0;if(!x(q)||!x(D))throw new Error("Either of the values are not a JSON schema.");if(q===D)return!0;if(l(q)&&l(D))return q===D;if(q===void 0&&D===!1||D===void 0&&q===!1||f(q)&&!f(D)||!f(q)&&f(D))return!1;var B=n(Object.keys(q).concat(Object.keys(D)));if(H.ignore.length&&(B=B.filter(K=>H.ignore.indexOf(K)===-1)),!B.length)return!0;function G(K,Q){return P(K,Q,H)}return B.every(function(K){var Q=q[K],R=D[K];if(z.indexOf(K)!==-1)return P(Q,R,H);var V=L[K];if(V||(V=e),e(Q,R))return!0;if(M.indexOf(K)===-1&&(!h(q,K)&&h(D,K)||h(q,K)&&!h(D,K)))return Q===R;var X=V(Q,R,K,G);if(!l(X))throw new Error("Comparer must return true or false");return X})}return W_=P,W_}var Q_,R4;function RE(){if(R4)return Q_;R4=1;function e(t){return Object.prototype.toString.call(t)==="[object Array]"}return Q_=Array.isArray||e,Q_}var J_,j4;function Ede(){if(j4)return J_;j4=1;function e(t){return(typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]")&&t.valueOf()===t.valueOf()}return J_=e,J_}var ex,M4;function kde(){if(M4)return ex;M4=1;var e=Ede();function t(n){return e(n)&&n%1===0}return ex=t,ex}var tx,$4;function fL(){if($4)return tx;$4=1;var e=RE(),t=kde();function n(r){var i;if(!e(r)||(i=r.length,!i))return!1;for(var a=0;a<i;a++)if(!t(r[a]))return!1;return!0}return tx=n,tx}var nx,D4;function dL(){if(D4)return nx;D4=1;function e(t){return typeof t=="function"}return nx=e,nx}var rx,I4;function Ade(){if(I4)return rx;I4=1;var e=RE(),t=fL(),n=dL(),r=Math.pow(2,31)-1;function i(l,c){var f=1,d;if(l===0)return c;if(c===0)return l;for(;l%2===0&&c%2===0;)l=l/2,c=c/2,f=f*2;for(;l%2===0;)l=l/2;for(;c;){for(;c%2===0;)c=c/2;l>c&&(d=c,c=l,l=d),c=c-l}return f*l}function a(l,c){var f=0,d;if(l===0)return c;if(c===0)return l;for(;(l&1)===0&&(c&1)===0;)l>>>=1,c>>>=1,f++;for(;(l&1)===0;)l>>>=1;for(;c;){for(;(c&1)===0;)c>>>=1;l>c&&(d=c,c=l,l=d),c=c-l}return l<<f}function o(){var l=arguments.length,c,f,d,h,m,g,v;for(c=new Array(l),v=0;v<l;v++)c[v]=arguments[v];if(t(c)){if(l===2)return m=c[0],g=c[1],m<0&&(m=-m),g<0&&(g=-g),m<=r&&g<=r?a(m,g):i(m,g);d=c}else if(e(c[0]))if(l>1){if(d=c[0],f=c[1],!n(f))throw new TypeError("gcd()::invalid input argument. Accessor must be a function. Value: `"+f+"`.")}else d=c[0];else throw new TypeError("gcd()::invalid input argument. Must provide an array of integers. Value: `"+c[0]+"`.");if(h=d.length,h<2)return null;if(f){for(m=new Array(h),v=0;v<h;v++)m[v]=f(d[v],v);d=m}if(l<3&&!t(d))throw new TypeError("gcd()::invalid input argument. Accessed array values must be integers. Value: `"+d+"`.");for(v=0;v<h;v++)m=d[v],m<0&&(d[v]=-m);for(m=d[0],v=1;v<h;v++)g=d[v],g<=r&&m<=r?m=a(m,g):m=i(m,g);return m}return rx=o,rx}var ix,P4;function Tde(){if(P4)return ix;P4=1;var e=Ade(),t=RE(),n=fL(),r=dL();function i(){var a=arguments.length,o,l,c,f,d,h,m;for(o=new Array(a),m=0;m<a;m++)o[m]=arguments[m];if(n(o)){if(a===2)return d=o[0],h=o[1],d<0&&(d=-d),h<0&&(h=-h),d===0||h===0?0:d/e(d,h)*h;c=o}else if(t(o[0]))if(a>1){if(c=o[0],l=o[1],!r(l))throw new TypeError("lcm()::invalid input argument. Accessor must be a function. Value: `"+l+"`.")}else c=o[0];else throw new TypeError("lcm()::invalid input argument. Must provide an array of integers. Value: `"+o[0]+"`.");if(f=c.length,f<2)return null;if(l){for(d=new Array(f),m=0;m<f;m++)d[m]=l(c[m],m);c=d}if(a<3&&!n(c))throw new TypeError("lcm()::invalid input argument. Accessed array values must be integers. Value: `"+c+"`.");for(m=0;m<f;m++)d=c[m],d<0&&(c[m]=-d);for(d=c[0],m=1;m<f;m++){if(h=c[m],d===0||h===0)return 0;d=d/e(d,h)*h}return d}return ix=i,ix}var ax,L4;function hL(){if(L4)return ax;L4=1;var e=lE(),t=dl();function n(r,i,a){(a!==void 0&&!t(r[i],a)||a===void 0&&!(i in r))&&e(r,i,a)}return ax=n,ax}var sx,z4;function pL(){if(z4)return sx;z4=1;function e(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}return sx=e,sx}var ox,q4;function Cde(){if(q4)return ox;q4=1;var e=zc(),t=ml();function n(r){return e(r,t(r))}return ox=n,ox}var lx,F4;function Ode(){if(F4)return lx;F4=1;var e=hL(),t=B6(),n=K6(),r=pE(),i=X6(),a=rm(),o=lr(),l=OE(),c=im(),f=aE(),d=ii(),h=cm(),m=dE(),g=pL(),v=Cde();function w(b,_,S,x,A,k,T){var O=g(b,S),$=g(_,S),L=T.get($);if(L){e(b,S,L);return}var M=k?k(O,$,S+"",b,_,T):void 0,z=M===void 0;if(z){var P=o($),q=!P&&c($),D=!P&&!q&&m($);M=$,P||q||D?o(O)?M=O:l(O)?M=r(O):q?(z=!1,M=t($,!0)):D?(z=!1,M=n($,!0)):M=[]:h($)||a($)?(M=O,a(O)?M=v(O):(!d(O)||f(O))&&(M=i($))):z=!1}z&&(T.set($,M),A(M,$,x,k,T),T.delete($)),e(b,S,M)}return lx=w,lx}var ux,B4;function mL(){if(B4)return ux;B4=1;var e=nm(),t=hL(),n=nL(),r=Ode(),i=ii(),a=ml(),o=pL();function l(c,f,d,h,m){c!==f&&n(f,function(g,v){if(m||(m=new e),i(g))r(c,f,v,d,l,h,m);else{var w=h?h(o(c,v),g,v+"",c,f,m):void 0;w===void 0&&(w=g),t(c,v,w)}},a)}return ux=l,ux}var cx,U4;function Nde(){if(U4)return cx;U4=1;var e=mL(),t=ii();function n(r,i,a,o,l,c){return t(r)&&t(i)&&(c.set(i,r),e(r,i,void 0,n,c),c.delete(i)),r}return cx=n,cx}var fx,V4;function Rde(){if(V4)return fx;V4=1;var e=Ds(),t=EE();function n(r){return e(function(i,a){var o=-1,l=a.length,c=l>1?a[l-1]:void 0,f=l>2?a[2]:void 0;for(c=r.length>3&&typeof c=="function"?(l--,c):void 0,f&&t(a[0],a[1],f)&&(c=l<3?void 0:c,l=1),i=Object(i);++o<l;){var d=a[o];d&&r(i,d,o,c)}return i})}return fx=n,fx}var dx,H4;function jde(){if(H4)return dx;H4=1;var e=mL(),t=Rde(),n=t(function(r,i,a,o){e(r,i,a,o)});return dx=n,dx}var hx,G4;function Mde(){if(G4)return hx;G4=1;var e=iL(),t=Ds(),n=Nde(),r=jde(),i=t(function(a){return a.push(void 0,n),e(r,void 0,a)});return hx=i,hx}var px,Y4;function gL(){if(Y4)return px;Y4=1;var e=xE();function t(n){var r=n==null?0:n.length;return r?e(n,1):[]}return px=t,px}var mx,Z4;function yL(){if(Z4)return mx;Z4=1;var e=xE(),t=1/0;function n(r){var i=r==null?0:r.length;return i?e(r,t):[]}return mx=n,mx}var gx,K4;function $de(){if(K4)return gx;K4=1;var e=$s(),t=lL(),n=Ds(),r=uL(),i=n(function(a){var o=e(a,r);return o.length&&o[0]===a[0]?t(o):[]});return gx=i,gx}var yx,X4;function Dde(){if(X4)return yx;X4=1;function e(t,n,r,i){for(var a=r-1,o=t.length;++a<o;)if(i(t[a],n))return a;return-1}return yx=e,yx}var bx,W4;function Ide(){if(W4)return bx;W4=1;var e=$s(),t=sL(),n=Dde(),r=Ms(),i=pE(),a=Array.prototype,o=a.splice;function l(c,f,d,h){var m=h?n:t,g=-1,v=f.length,w=c;for(c===f&&(f=i(f)),d&&(w=e(c,r(d)));++g<v;)for(var b=0,_=f[g],S=d?d(_):_;(b=m(w,S,b,h))>-1;)w!==c&&o.call(w,b,1),o.call(c,b,1);return c}return bx=l,bx}var vx,Q4;function Pde(){if(Q4)return vx;Q4=1;var e=Ide();function t(n,r){return n&&n.length&&r&&r.length?e(n,r):n}return vx=t,vx}var _x,J4;function Lde(){if(J4)return _x;J4=1;var e=Fc();function t(n){return typeof n=="function"?n:e}return _x=t,_x}var xx,eD;function bL(){if(eD)return xx;eD=1;var e=P6(),t=rL(),n=Lde(),r=lr();function i(a,o){var l=r(a)?e:t;return l(a,n(o))}return xx=i,xx}var wx,tD;function zde(){if(tD)return wx;tD=1;var e=sm(),t=kE(),n=AE(),r=$s(),i=Ms(),a=om(),o=200;function l(c,f,d,h){var m=-1,g=t,v=!0,w=c.length,b=[],_=f.length;if(!w)return b;d&&(f=r(f,i(d))),h?(g=n,v=!1):f.length>=o&&(g=a,v=!1,f=new e(f));e:for(;++m<w;){var S=c[m],x=d==null?S:d(S);if(S=h||S!==0?S:0,v&&x===x){for(var A=_;A--;)if(f[A]===x)continue e;b.push(S)}else g(f,x,h)||b.push(S)}return b}return wx=l,wx}var Sx,nD;function qde(){if(nD)return Sx;nD=1;var e=zde(),t=Ds(),n=OE(),r=t(function(i,a){return n(i)?e(i,a):[]});return Sx=r,Sx}var Ex,rD;function vL(){if(rD)return Ex;rD=1;const e=gL(),t=yL(),n=cm(),r=TE(),i=CE(),a=qde();function o(w){for(const b in w)f(w,b)&&g(w[b])&&delete w[b];return w}const l=w=>r(t(w.map(d))),c=(w,b)=>w.map(_=>_&&_[b]),f=(w,b)=>Object.prototype.hasOwnProperty.call(w,b),d=w=>n(w)||Array.isArray(w)?Object.keys(w):[],h=w=>w!==void 0,m=w=>n(w)||w===!0||w===!1,g=w=>!d(w).length&&w!==!1&&w!==!0;return Ex={allUniqueKeys:l,deleteUndefinedProps:o,getValues:c,has:f,isEmptySchema:g,isSchema:m,keys:d,notUndefined:h,uniqWith:i,withoutArr:(w,...b)=>a.apply(null,[w].concat(e(b)))},Ex}var kx,iD;function Fde(){if(iD)return kx;iD=1;const e=NE(),t=bL(),{allUniqueKeys:n,deleteUndefinedProps:r,getValues:i,keys:a,notUndefined:o,uniqWith:l,withoutArr:c}=vL();function f(h){t(h,function(m,g){m===!1&&delete h[g]})}function d(h,m){return n(h).reduce(function(v,w){const b=i(h,w),_=l(b.filter(o),e);return v[w]=m(_,w),v},{})}return kx={keywords:["properties","patternProperties","additionalProperties"],resolver(h,m,g,v){v.ignoreAdditionalProperties||(h.forEach(function(b){const _=h.filter(k=>k!==b),S=a(b.properties),A=a(b.patternProperties).map(k=>new RegExp(k));_.forEach(function(k){const T=a(k.properties),O=T.filter(L=>A.some(M=>M.test(L)));c(T,S,O).forEach(function(L){k.properties[L]=g.properties([k.properties[L],b.additionalProperties],L)})})}),h.forEach(function(b){const _=h.filter(x=>x!==b),S=a(b.patternProperties);b.additionalProperties===!1&&_.forEach(function(x){const A=a(x.patternProperties);c(A,S).forEach(T=>delete x.patternProperties[T])})}));const w={additionalProperties:g.additionalProperties(h.map(b=>b.additionalProperties)),patternProperties:d(h.map(b=>b.patternProperties),g.patternProperties),properties:d(h.map(b=>b.properties),g.properties)};return w.additionalProperties===!1&&f(w.properties),r(w)}},kx}var Ax,aD;function Bde(){if(aD)return Ax;aD=1;const e=NE(),t=bL(),{allUniqueKeys:n,deleteUndefinedProps:r,has:i,isSchema:a,notUndefined:o,uniqWith:l}=vL();function c(m){t(m,function(g,v){g===!1&&m.splice(v,1)})}function f(m,g){return m.map(function(v){if(v)if(Array.isArray(v.items)){const w=v.items[g];if(a(w))return w;if(i(v,"additionalItems"))return v.additionalItems}else return v.items})}function d(m){return m.map(function(g){if(g)return Array.isArray(g.items)?g.additionalItems:g.items})}function h(m,g,v){return n(v).reduce(function(b,_){const S=f(m,_),x=l(S.filter(o),e);return b[_]=g(x,_),b},[])}return Ax={keywords:["items","additionalItems"],resolver(m,g,v){const w=m.map(x=>x.items),b=w.filter(o),_={};b.every(a)?_.items=v.items(w):_.items=h(m,v.items,w);let S;return b.every(Array.isArray)?S=m.map(x=>x.additionalItems):b.some(Array.isArray)&&(S=d(m)),S&&(_.additionalItems=v.additionalItems(S)),_.additionalItems===!1&&Array.isArray(_.items)&&c(_.items),r(_)}},Ax}var Tx,sD;function Ude(){if(sD)return Tx;sD=1;const e=Rfe(),t=NE(),n=Tde(),r=Mde(),i=gL(),a=yL(),o=$de(),l=cL(),c=Q6(),f=cm(),d=Pde(),h=aL(),m=TE(),g=CE(),v=Fde(),w=Bde(),b=(re,le)=>re.indexOf(le)!==-1,_=re=>f(re)||re===!0||re===!1,S=re=>re===!1,x=re=>re===!0,A=(re,le,W)=>W(re),k=re=>h(m(a(re))),T=re=>re!==void 0,O=re=>m(a(re.map(K))),$=re=>re[0],L=re=>k(re),M=re=>Math.max.apply(Math,re),z=re=>Math.min.apply(Math,re),P=re=>re.some(x),q=re=>g(i(re),c);function D(re){return function(le,W){return t({[re]:le},{[re]:W})}}function H(re){let{allOf:le=[],...W}=re;return W=f(re)?W:re,[W,...le.map(H)]}function B(re,le){return re.map(W=>W&&W[le])}function G(re,le){return re.map(function(W,J){try{return le(W,J)}catch{return}}).filter(T)}function K(re){return f(re)||Array.isArray(re)?Object.keys(re):[]}function Q(re,le){if(le=le||[],!re.length)return le;const W=re.slice(0).shift(),J=re.slice(1);return le.length?Q(J,i(le.map(se=>W.map(fe=>[fe].concat(se))))):Q(J,W.map(se=>se))}function R(re,le){let W;try{W=re.map(function(J){return JSON.stringify(J,null,2)}).join(`
|
|
235
235
|
`)}catch{W=re.join(", ")}throw new Error('Could not resolve values for path:"'+le.join(".")+`". They are probably incompatible. Values:
|
|
236
|
-
`+W)}function V(re,le,W,J,se,fe){if(re.length){const me=se.complexResolvers[le];if(!me||!me.resolver)throw new Error("No resolver found for "+le);const xe=W.map(We=>re.reduce((He,$e)=>(We[$e]!==void 0&&(He[$e]=We[$e]),He),{})),we=g(xe,t),Ve=me.keywords.reduce((We,He)=>({...We,[He]:($e,Be=[])=>J($e,null,fe.concat(He,Be))}),{}),qe=me.resolver(we,fe.concat(le),Ve,se);return f(qe)||R(we,fe.concat(le)),qe}}function X(re){return{required:re}}const j=["properties","patternProperties","definitions","dependencies"],I=["anyOf","oneOf"],U=["additionalProperties","additionalItems","contains","propertyNames","not","items"],Y={type(re){if(re.some(Array.isArray)){const le=re.map(function(J){return Array.isArray(J)?J:[J]}),W=o.apply(null,le);if(W.length===1)return W[0];if(W.length>1)return m(W)}},dependencies(re,le,W){return O(re).reduce(function(se,fe){const me=B(re,fe);let xe=g(me.filter(T),c);const we=xe.filter(Array.isArray);if(we.length){if(we.length===xe.length)se[fe]=k(xe);else{const Ve=xe.filter(_),qe=we.map(X);se[fe]=W(Ve.concat(qe),fe)}return se}return xe=g(xe,t),se[fe]=W(xe,fe),se},{})},oneOf(re,le,W){const J=Q(e(re)),se=G(J,W),fe=g(se,t);if(fe.length)return fe},not(re){return{anyOf:re}},pattern(re){return re.map(le=>"(?="+le+")").join("")},multipleOf(re){let le=re.slice(0),W=1;for(;le.some(J=>!Number.isInteger(J));)le=le.map(J=>J*10),W=W*10;return n(le)/W},enum(re){const le=l.apply(null,re.concat(c));if(le.length)return h(le)}};Y.$id=$,Y.$ref=$,Y.$schema=$,Y.additionalItems=A,Y.additionalProperties=A,Y.anyOf=Y.oneOf,Y.contains=A,Y.default=$,Y.definitions=Y.dependencies,Y.description=$,Y.examples=q,Y.exclusiveMaximum=z,Y.exclusiveMinimum=M,Y.items=w,Y.maximum=z,Y.maxItems=z,Y.maxLength=z,Y.maxProperties=z,Y.minimum=M,Y.minItems=M,Y.minLength=M,Y.minProperties=M,Y.properties=v,Y.propertyNames=A,Y.required=L,Y.title=$,Y.uniqueItems=P;const ne={properties:v,items:w};function ae(re,le,W){le=r(le,{ignoreAdditionalProperties:!1,resolvers:Y,complexResolvers:ne,deep:!0});const J=Object.entries(le.complexResolvers);function se(xe,we,Ve){xe=e(xe.filter(T)),Ve=Ve||[];const qe=f(we)?we:{};if(!xe.length)return;if(xe.some(S))return!1;if(xe.every(x))return!0;xe=xe.filter(f);const We=O(xe);if(le.deep&&b(We,"allOf"))return ae({allOf:xe},le);const He=J.map(([$e,Be])=>We.filter(Ot=>Be.keywords.includes(Ot)));return He.forEach($e=>d(We,$e)),We.forEach(function($e){const Be=B(xe,$e),Ot=g(Be.filter(T),D($e));if(Ot.length===1&&b(I,$e))qe[$e]=Ot[0].map(kt=>se([kt],kt));else if(Ot.length===1&&!b(j,$e)&&!b(U,$e))qe[$e]=Ot[0];else{const kt=le.resolvers[$e]||le.resolvers.defaultResolver;if(!kt)throw new Error("No resolver found for key "+$e+". You can provide a resolver for this keyword in the options, or provide a default resolver.");const pe=(_e,Te=[])=>se(_e,null,Ve.concat($e,Te));qe[$e]=kt(Ot,Ve.concat($e),pe,le),qe[$e]===void 0?R(Ot,Ve.concat($e)):qe[$e]===void 0&&delete qe[$e]}}),J.reduce(($e,[Be,Ot],kt)=>({...$e,...V(He[kt],Be,xe,se,le,Ve)}),qe)}const fe=a(H(re));return se(fe)}return ae.options={resolvers:Y},Tx=ae,Tx}var Ude
|
|
237
|
-
`,m);const{allOf:g,...v}=d;return v}}return qw in d&&d.additionalProperties!==!1?Zde(e,d,n,r,o):d}):[{}]}function Kde(e,t,n,r,i){let a;const{oneOf:o,anyOf:l,...c}=t;if(Array.isArray(o)?a=o:Array.isArray(l)&&(a=l),a){const f=i===void 0&&r?{}:i,d=nl(t);a=a.map(m=>bc(m,n,[]));const h=nE(e,f,a,n,d);if(r)return a.map(m=>Pi(c,m));t=Pi(c,a[h])}return[t]}function wL(e,t,n,r,i,a,o){const{dependencies:l,...c}=t;return Kde(e,c,n,r,a).flatMap(d=>SL(e,l,d,n,r,i,a,o))}function SL(e,t,n,r,i,a,o,l){let c=[n];for(const f in t){if(!i&&Ne(o,[f])===void 0||n.properties&&!(f in n.properties))continue;const[d,h]=eE(f,t);return Array.isArray(h)?c[0]=Xde(n,h):lt(h)&&(c=Wde(e,n,r,f,h,i,a,o,l)),c.flatMap(m=>SL(e,d,m,r,i,a,o,l))}return c}function Xde(e,t){if(!t)return e;const n=Array.isArray(e.required)?Array.from(new Set([...e.required,...t])):t;return{...e,required:n}}function Wde(e,t,n,r,i,a,o,l,c){return Zr(e,i,n,l,a,o,c).flatMap(d=>{const{oneOf:h,...m}=d;if(t=Pi(t,m),h===void 0)return t;const g=h.map(w=>typeof w=="boolean"||!(rn in w)?[w]:xL(e,w,n,a,o,l));return _L(g).flatMap(w=>Qde(e,t,n,r,w,a,o,l,c))})}function Qde(e,t,n,r,i,a,o,l,c){const f=i.filter(d=>{if(typeof d=="boolean"||!d||!d.properties)return!1;const{[r]:h}=d.properties;if(h){const m={type:"object",properties:{[r]:h}};return e.isValid(m,l,n)||a}return!1});return!a&&f.length!==1?(console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[t]):f.flatMap(d=>{const h=d,[m]=eE(r,h.properties),g={...h,properties:m};return Zr(e,g,n,l,a,o,c).map(w=>Pi(t,w))})}const Jde={type:"object",$id:Jie,properties:{__not_really_there__:{type:"number"}}};function Yw(e,t,n,r,i){let a=0;return n&&(Mt(n.properties)?a+=Xue(n.properties,(o,l,c)=>{const f=Ne(r,c);if(typeof l=="boolean")return o;if(An(l,rn)){const d=nr(e,l,t,f,i);return o+Yw(e,t,d,f||{},i)}if((An(l,tr)||An(l,Mr))&&f){const d=An(l,tr)?tr:Mr,h=nl(l);return o+vc(e,t,f,Ne(l,d),-1,h,i)}if(l.type==="object")return Mt(f)&&(o+=1),o+Yw(e,t,l,f,i);if(l.type===yc(f)){let d=o+1;return l.default?d+=f===l.default?1:-1:l.const&&(d+=f===l.const?1:-1),d}return o},0):Wp(n.type)&&n.type===yc(r)&&(a+=1)),a}function vc(e,t,n,r,i=-1,a,o){const l=r.map(m=>bc(m,t,[])),c=N6(n,r,a);if(x6(c))return c;const f=l.reduce((m,g,v)=>(nE(e,n,[Jde,g],t,a)===1&&m.push(v),m),[]);if(f.length===1)return f[0];f.length||O6(l.length,m=>f.push(m));const d=new Set,{bestIndex:h}=f.reduce((m,g)=>{const{bestScore:v}=m,w=l[g],b=Yw(e,t,w,n,o);return d.add(b),b>v?{bestIndex:g,bestScore:b}:m},{bestIndex:i,bestScore:0});return d.size===1&&i>=0?i:h}function Zw(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every(t=>lt(t))}function Wu(e){return e==null}function _c(e,t,n=!1,r=!1,i=!1){if(Array.isArray(t)){const a=Array.isArray(e)?e:[],o=i?a:t,l=i?t:a,c=o.map((f,d)=>l[d]!==void 0?_c(a[d],t[d],n,r,i):f);return(n||i)&&c.length<l.length&&c.push(...l.slice(c.length)),c}if(lt(t)){const a=Object.assign({},e);return Object.keys(t).reduce((o,l)=>{const c=Ne(t,l),f=lt(e)&&l in e,d=l in t;return o[l]=_c(e?Ne(e,l):{},c,n,r,i&&(f||!d)),o},a)}return r&&(!Wu(e)&&Wu(t)||typeof t=="number"&&isNaN(t))||i&&!Wu(t)?e:t}function Oi(e,t,n=!1){return Object.keys(t).reduce((r,i)=>{const a=e?e[i]:{},o=t[i];if(e&&i in e&<(o))r[i]=Oi(a,o,n);else if(n&&Array.isArray(a)&&Array.isArray(o)){let l=o;n==="preventDuplicates"&&(l=o.reduce((c,f)=>(a.includes(f)||c.push(f),c),[])),r[i]=a.concat(l)}else r[i]=o;return r},Object.assign({},e))}function EL(e){return Array.isArray(e.enum)&&e.enum.length===1||Di in e}function jE(e,t,n={},r){const i=nr(e,t,n,void 0,r),a=i.oneOf||i.anyOf;return Array.isArray(i.enum)?!0:Array.isArray(a)?a.every(o=>typeof o!="boolean"&&EL(o)):!1}function ME(e,t,n,r){return!t.uniqueItems||!t.items||typeof t.items=="boolean"?!1:jE(e,t.items,n,r)}function kL(e){const t=e[Di],n=Ii(e);return lt(t)&&Wp(t==null?void 0:t.$data)&&n!=="object"&&n!=="array"}function ehe(e){if(Wie in e&&Array.isArray(e.enum)&&e.enum.length===1)return e.enum[0];if(Di in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function xc(e,t){const n=e;if(e.enum){let a;if(t){const{enumNames:o}=ot(t);a=o}return!a&&n.enumNames&&(a=n.enumNames),e.enum.map((o,l)=>({label:(a==null?void 0:a[l])||String(o),value:o}))}let r,i;return e.anyOf?(r=e.anyOf,i=t==null?void 0:t.anyOf):e.oneOf&&(r=e.oneOf,i=t==null?void 0:t.oneOf),r&&r.map((a,o)=>{const{title:l}=ot(i==null?void 0:i[o]),c=a,f=ehe(c),d=l||c.title||String(f);return{schema:c,label:d,value:f}})}const the=["string","number","integer","boolean","null"];var rl;(function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"})(rl||(rl={}));function Cx(e,t=rl.Ignore,n=-1){if(n>=0){if(Array.isArray(e.items)&&n<e.items.length){const r=e.items[n];if(typeof r!="boolean")return r}}else if(e.items&&!Array.isArray(e.items)&&typeof e.items!="boolean")return e.items;return t!==rl.Ignore&<(e.additionalItems)?e.additionalItems:{}}function oD(e,t,n,r,i,a=[],o={},l=!1){const{emptyObjectFields:c="populateAllDefaults"}=o;if(r||l)e[t]=n;else if(c!=="skipDefaults"){const f=i===void 0?a.includes(t):i;lt(n)?c==="skipEmptyDefaults"?tl(n)||(e[t]=n):(!tl(n)||a.includes(t))&&(f||c!=="populateRequiredDefaults")&&(e[t]=n):n!==void 0&&(c==="populateAllDefaults"||c==="skipEmptyDefaults"||f&&a.includes(t))&&(e[t]=n)}}function $a(e,t,n={}){const{parentDefaults:r,rawFormData:i,rootSchema:a={},includeUndefinedValues:o=!1,_recurseList:l=[],experimental_defaultFormStateBehavior:c=void 0,experimental_customMergeAllOf:f=void 0,required:d,shouldMergeDefaultsIntoFormData:h=!1}=n;let m=lt(i)?i:{};const g=lt(t)?t:{};let v=r,w=null,b=c,_=l;if(g[Di]!==void 0&&(c==null?void 0:c.constAsDefaults)!=="never"&&!kL(g))v=g[Di];else if(lt(v)&<(g.default))v=Oi(v,g.default);else if(Xie in g&&!g[Mr]&&!g[tr])v=g.default;else if(rn in g){const A=g[rn];l.includes(A)||(_=l.concat(A),w=v6(A,a)),w&&!v&&(v=g.default),h&&w&&!lt(i)&&(m=i)}else if(qp in g){const A={...lD(e,g,n,v),...m};w=wL(e,g,a,!1,[],A,f)[0]}else if(Zw(g))v=g.items.map((A,k)=>$a(e,A,{rootSchema:a,includeUndefinedValues:o,_recurseList:l,experimental_defaultFormStateBehavior:c,experimental_customMergeAllOf:f,parentDefaults:Array.isArray(r)?r[k]:void 0,rawFormData:m,required:d,shouldMergeDefaultsIntoFormData:h}));else if(tr in g){const{oneOf:A,...k}=g;if(A.length===0)return;const T=nl(g),{type:O="null"}=k;!Array.isArray(O)&&the.includes(O)&&(b==null?void 0:b.constAsDefaults)==="skipOneOf"&&(b={...b,constAsDefaults:"never"}),w=A[vc(e,a,i??g.default,A,0,T,f)],w=Pi(k,w)}else if(Mr in g){const{anyOf:A,...k}=g;if(A.length===0)return;const T=nl(g);w=A[vc(e,a,i??g.default,A,0,T,f)],w=Pi(k,w)}if(w)return $a(e,w,{rootSchema:a,includeUndefinedValues:o,_recurseList:_,experimental_defaultFormStateBehavior:b,experimental_customMergeAllOf:f,parentDefaults:v,rawFormData:i??m,required:d,shouldMergeDefaultsIntoFormData:h});v===void 0&&(v=g.default);const S=lD(e,g,n,v);let x=S??v;if(h){const{arrayMinItems:A={}}=c||{},{mergeExtraDefaults:k}=A,T=nhe(e,g,a,i,c,f);(!lt(i)||ll in g)&&(x=_c(x,T,k,!0))}return x}function nhe(e,t,n,r,i,a){const o=!EL(t)&&jE(e,t,n,a);let l=r;if(o){const f=xc(t);l=(f==null?void 0:f.some(h=>It(h.value,r)))?r:void 0}return t[Di]&&(i==null?void 0:i.constAsDefaults)==="always"&&(l=t.const),l}function rhe(e,t,{rawFormData:n,rootSchema:r={},includeUndefinedValues:i=!1,_recurseList:a=[],experimental_defaultFormStateBehavior:o=void 0,experimental_customMergeAllOf:l=void 0,required:c,shouldMergeDefaultsIntoFormData:f}={},d){{const h=lt(n)?n:{},m=t,g=(o==null?void 0:o.allOf)==="populateDefaults"&&ll in m?nr(e,m,r,h,l):m,v=g[Di],w=Object.keys(g.properties||{}).reduce((b,_)=>{var S;const x=Ne(g,[Bt,_]),A=lt(v)&&v[_]!==void 0,k=(lt(x)&&Di in x||A)&&(o==null?void 0:o.constAsDefaults)!=="never"&&!kL(x),T=$a(e,x,{rootSchema:r,_recurseList:a,experimental_defaultFormStateBehavior:o,experimental_customMergeAllOf:l,includeUndefinedValues:i===!0,parentDefaults:Ne(d,[_]),rawFormData:Ne(h,[_]),required:(S=g.required)===null||S===void 0?void 0:S.includes(_),shouldMergeDefaultsIntoFormData:f});return oD(b,_,T,i,c,g.required,o,k),b},{});if(g.additionalProperties){const b=lt(g.additionalProperties)?g.additionalProperties:{},_=new Set;lt(d)&&Object.keys(d).filter(x=>!g.properties||!g.properties[x]).forEach(x=>_.add(x));const S=[];Object.keys(h).filter(x=>!g.properties||!g.properties[x]).forEach(x=>{_.add(x),S.push(x)}),_.forEach(x=>{var A;const k=$a(e,b,{rootSchema:r,_recurseList:a,experimental_defaultFormStateBehavior:o,experimental_customMergeAllOf:l,includeUndefinedValues:i===!0,parentDefaults:Ne(d,[x]),rawFormData:Ne(h,[x]),required:(A=g.required)===null||A===void 0?void 0:A.includes(x),shouldMergeDefaultsIntoFormData:f});oD(w,x,k,i,c,S)})}return w}}function ihe(e,t,{rawFormData:n,rootSchema:r={},_recurseList:i=[],experimental_defaultFormStateBehavior:a=void 0,experimental_customMergeAllOf:o=void 0,required:l,shouldMergeDefaultsIntoFormData:c}={},f){var d,h;const m=t,g=(d=a==null?void 0:a.arrayMinItems)!==null&&d!==void 0?d:{},{populate:v,mergeExtraDefaults:w}=g,b=v==="never",_=v==="requiredOnly",S=v==="all"||!b&&!_,x=(h=g==null?void 0:g.computeSkipPopulate)!==null&&h!==void 0?h:()=>!1,k=(a==null?void 0:a.emptyObjectFields)==="skipEmptyDefaults"?void 0:[];if(Array.isArray(f)&&(f=f.map((P,q)=>{const D=Cx(m,rl.Fallback,q);return $a(e,D,{rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,parentDefaults:P,required:l,shouldMergeDefaultsIntoFormData:c})})),Array.isArray(n)){const P=Cx(m);if(b)f=n;else{const q=n.map((H,B)=>$a(e,P,{rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,rawFormData:H,parentDefaults:Ne(f,[B]),required:l,shouldMergeDefaultsIntoFormData:c}));f=_c(f,q,(_&&l||S)&&w)}}if((lt(m)&&Di in m&&(a==null?void 0:a.constAsDefaults)!=="never")===!1){if(b)return f??k;if(_&&!l)return f||void 0}const O=Array.isArray(f)?f.length:0;if(!m.minItems||ME(e,m,r,o)||x(e,m,r)||m.minItems<=O)return f||k;const $=f||[],L=Cx(m,rl.Invert),M=L.default,z=new Array(m.minItems-O).fill($a(e,L,{parentDefaults:M,rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,required:l,shouldMergeDefaultsIntoFormData:c}));return $.concat(z)}function lD(e,t,n={},r){switch(Ii(t)){case"object":return rhe(e,t,n,r);case"array":return ihe(e,t,n,r)}}function AL(e,t,n,r,i=!1,a,o){if(!lt(t))throw new Error("Invalid schema: "+t);const l=nr(e,t,r,n,o),c=$a(e,l,{rootSchema:r,includeUndefinedValues:i,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,rawFormData:n,shouldMergeDefaultsIntoFormData:!0});if(lt(n)||Array.isArray(n)){const{mergeDefaultsIntoFormData:f}=a||{};return _c(c,n,!0,f==="useDefaultIfFormDataUndefined",!0)}return c}function TL(e={}){return"widget"in ot(e)&&ot(e).widget!=="hidden"}function CL(e,t,n={},r,i){if(n[LS]==="files")return!0;if(t.items){const a=nr(e,t.items,r,void 0,i);return a.type==="string"&&a.format==="data-url"}return!1}function ahe(e,t,n={},r,i,a){const o=ot(n,i),{label:l=!0}=o;let c=!!l;const f=Ii(t);return f==="array"&&(c=ME(e,t,r,a)||CL(e,t,n,r,a)||TL(n)),f==="object"&&(c=!1),f==="boolean"&&!n[LS]&&(c=!1),n[tae]&&(c=!1),c}function she(e,t,n){if(!n)return t;const{errors:r,errorSchema:i}=t;let a=e.toErrorList(n),o=n;return tl(i)||(o=Oi(i,n,!0),a=[...r].concat(a)),{errorSchema:o,errors:a}}const Co=Symbol("no Value");function Kw(e,t,n,r,i={},a){let o;if(An(n,Bt)){const l={};if(An(r,Bt)){const d=Ne(r,Bt,{});Object.keys(d).forEach(h=>{An(i,h)&&(l[h]=void 0)})}const c=Object.keys(Ne(n,Bt,{})),f={};c.forEach(d=>{const h=Ne(i,d);let m=Ne(r,[Bt,d],{}),g=Ne(n,[Bt,d],{});An(m,rn)&&(m=nr(e,m,t,h,a)),An(g,rn)&&(g=nr(e,g,t,h,a));const v=Ne(m,"type"),w=Ne(g,"type");if(!v||v===w)if(An(l,d)&&delete l[d],w==="object"||w==="array"&&Array.isArray(h)){const b=Kw(e,t,g,m,h,a);(b!==void 0||w==="array")&&(f[d]=b)}else{const b=Ne(g,"default",Co),_=Ne(m,"default",Co);b!==Co&&b!==h&&(_===h?l[d]=b:Ne(g,"readOnly")===!0&&(l[d]=void 0));const S=Ne(g,"const",Co),x=Ne(m,"const",Co);S!==Co&&S!==h&&(l[d]=x===h?S:void 0)}}),o={...typeof i=="string"||Array.isArray(i)?void 0:i,...l,...f}}else if(Ne(r,"type")==="array"&&Ne(n,"type")==="array"&&Array.isArray(i)){let l=Ne(r,"items"),c=Ne(n,"items");if(typeof l=="object"&&typeof c=="object"&&!Array.isArray(l)&&!Array.isArray(c)){An(l,rn)&&(l=nr(e,l,t,i,a)),An(c,rn)&&(c=nr(e,c,t,i,a));const f=Ne(l,"type"),d=Ne(c,"type");if(!f||f===d){const h=Ne(n,"maxItems",-1);d==="object"?o=i.reduce((m,g)=>{const v=Kw(e,t,c,l,g,a);return v!==void 0&&(h<0||m.length<h)&&m.push(v),m},[]):o=h>0&&i.length>h?i.slice(0,h):i}}else typeof l=="boolean"&&typeof c=="boolean"&&l===c&&(o=i)}return o}function Nh(e,t,n,r,i,a,o,l=[],c){if(rn in t||qp in t||ll in t){const h=nr(e,t,a,o,c);if(l.findIndex(g=>It(g,h))===-1)return Nh(e,h,n,r,i,a,o,l.concat(h),c)}if(Ma in t&&!Ne(t,[Ma,rn]))return Nh(e,Ne(t,Ma),n,r,i,a,o,l,c);const d={$id:i||n};if(Ii(t)==="object"&&Bt in t)for(const h in t.properties){const m=Ne(t,[Bt,h]),g=d[Ra]+r+h;d[h]=Nh(e,lt(m)?m:{},n,r,g,a,Ne(o,[h]),l,c)}return d}function ohe(e,t,n,r,i,a="root",o="_",l){return Nh(e,t,a,o,n,r,i,void 0,l)}function us(e,t,n,r,i,a=[],o){if(rn in t||qp in t||ll in t){const c=nr(e,t,r,i,o);if(a.findIndex(d=>It(d,c))===-1)return us(e,c,n,r,i,a.concat(c),o)}let l={[Oh]:n.replace(/^\./,"")};if(tr in t||Mr in t){const c=tr in t?t.oneOf:t.anyOf,f=nl(t),d=vc(e,r,i,c,0,f,o),h=c[d];l={...l,...us(e,h,n,r,i,a,o)}}if(qw in t&&t[qw]!==!1&&mn(l,PS,!0),Ma in t&&Array.isArray(i)){const{items:c,additionalItems:f}=t;Array.isArray(c)?i.forEach((d,h)=>{c[h]?l[h]=us(e,c[h],`${n}.${h}`,r,d,a,o):f?l[h]=us(e,f,`${n}.${h}`,r,d,a,o):console.warn(`Unable to generate path schema for "${n}.${h}". No schema defined for it`)}):i.forEach((d,h)=>{l[h]=us(e,c,`${n}.${h}`,r,d,a,o)})}else if(Bt in t)for(const c in t.properties){const f=Ne(t,[Bt,c]);l[c]=us(e,f,`${n}.${c}`,r,Ne(i,[c]),a,o)}return l}function lhe(e,t,n="",r,i,a){return us(e,t,n,r,i,void 0,a)}class uhe{constructor(t,n,r,i){this.rootSchema=n,this.validator=t,this.experimental_defaultFormStateBehavior=r,this.experimental_customMergeAllOf=i}getValidator(){return this.validator}doesSchemaUtilsDiffer(t,n,r={},i){return!t||!n?!1:this.validator!==t||!It(this.rootSchema,n)||!It(this.experimental_defaultFormStateBehavior,r)||this.experimental_customMergeAllOf!==i}getDefaultFormState(t,n,r=!1){return AL(this.validator,t,n,this.rootSchema,r,this.experimental_defaultFormStateBehavior,this.experimental_customMergeAllOf)}getDisplayLabel(t,n,r){return ahe(this.validator,t,n,this.rootSchema,r,this.experimental_customMergeAllOf)}getClosestMatchingOption(t,n,r,i){return vc(this.validator,this.rootSchema,t,n,r,i,this.experimental_customMergeAllOf)}getFirstMatchingOption(t,n,r){return nE(this.validator,t,n,this.rootSchema,r)}getMatchingOption(t,n,r){return R6(this.validator,t,n,this.rootSchema,r)}isFilesArray(t,n){return CL(this.validator,t,n,this.rootSchema,this.experimental_customMergeAllOf)}isMultiSelect(t){return ME(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}isSelect(t){return jE(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}mergeValidationData(t,n){return she(this.validator,t,n)}retrieveSchema(t,n){return nr(this.validator,t,this.rootSchema,n,this.experimental_customMergeAllOf)}sanitizeDataForNewSchema(t,n,r){return Kw(this.validator,this.rootSchema,t,n,r,this.experimental_customMergeAllOf)}toIdSchema(t,n,r,i="root",a="_"){return ohe(this.validator,t,n,this.rootSchema,r,i,a,this.experimental_customMergeAllOf)}toPathSchema(t,n,r){return lhe(this.validator,t,n,this.rootSchema,r,this.experimental_customMergeAllOf)}}function che(e,t,n={},r){return new uhe(e,t,n,r)}function fhe(e){var t;if(e.indexOf("data:")===-1)throw new Error("File is invalid: URI must be a dataURI");const r=e.slice(5).split(";base64,");if(r.length!==2)throw new Error("File is invalid: dataURI must be base64");const[i,a]=r,[o,...l]=i.split(";"),c=o||"",f=decodeURI(((t=l.map(d=>d.split("=")).find(([d])=>d==="name"))===null||t===void 0?void 0:t[1])||"unknown");try{const d=atob(a),h=new Array(d.length);for(let g=0;g<d.length;g++)h[g]=d.charCodeAt(g);return{blob:new window.Blob([new Uint8Array(h)],{type:c}),name:f}}catch(d){throw new Error("File is invalid: "+d.message)}}function ka(e,t){let n=String(e);for(;n.length<t;)n="0"+n;return n}function OL(e,t){if(e<=0&&t<=0)e=new Date().getFullYear()+e,t=new Date().getFullYear()+t;else if(e<0||t<0)throw new Error(`Both start (${e}) and stop (${t}) must both be <= 0 or > 0, got one of each`);if(e>t)return OL(t,e).reverse();const n=[];for(let r=e;r<=t;r++)n.push({value:r,label:ka(r,2)});return n}function dhe(e,t){let n=e;if(Array.isArray(t)){const r=n.split(/(%\d)/);t.forEach((i,a)=>{const o=r.findIndex(l=>l===`%${a+1}`);o>=0&&(r[o]=i)}),n=r.join("")}return n}function hhe(e,t){return dhe(e,t)}function Qr(e,t=[],n){if(Array.isArray(e))return e.map(a=>Qr(a,t)).filter(a=>a!==n);const r=e===""||e===null?-1:Number(e),i=t[r];return i?i.value:n}function phe(e,t,n=[]){const r=Qr(e,n);return Array.isArray(t)?t.filter(i=>!It(i,r)):It(r,t)?void 0:t}function $E(e,t){return Array.isArray(t)?t.some(n=>It(n,e)):It(t,e)}function mhe(e,t=[],n=!1){const r=t.map((i,a)=>$E(i.value,e)?String(a):void 0).filter(i=>typeof i<"u");return n?r:r[0]}function ghe(e,t,n=[]){const r=Qr(e,n);if(!Wu(r)){const i=n.findIndex(l=>r===l.value),a=n.map(({value:l})=>l);return t.slice(0,i).concat(r,t.slice(i)).sort((l,c)=>+(a.indexOf(l)>a.indexOf(c)))}return t}var yhe=1,bhe=4;function NL(e){return Xu(e,yhe|bhe)}function vhe(e,t,n,r){return r=typeof r=="function"?r:void 0,e==null?e:rE(e,t,n,r)}class _he{constructor(t){this.errorSchema={},this.resetAllErrors(t)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(t){let r=Array.isArray(t)&&t.length>0||typeof t=="string"?Ne(this.errorSchema,t):this.errorSchema;return!r&&t&&(r={},vhe(this.errorSchema,t,r,Object)),r}resetAllErrors(t){return this.errorSchema=t?NL(t):{},this}addErrors(t,n){const r=this.getOrCreateErrorBlock(n);let i=Ne(r,Jn);return Array.isArray(i)||(i=[],r[Jn]=i),Array.isArray(t)?mn(r,Jn,[...new Set([...i,...t])]):mn(r,Jn,[...new Set([...i,t])]),this}setErrors(t,n){const r=this.getOrCreateErrorBlock(n),i=Array.isArray(t)?[...new Set([...t])]:[t];return mn(r,Jn,i),this}clearErrors(t){const n=this.getOrCreateErrorBlock(t);return mn(n,Jn,[]),this}}function xhe(e,t,n=[1900,new Date().getFullYear()+2],r="YMD"){const{day:i,month:a,year:o,hour:l,minute:c,second:f}=e,d={type:"day",range:[1,31],value:i},h={type:"month",range:[1,12],value:a},m={type:"year",range:n,value:o},g=[];switch(r){case"MDY":g.push(h,d,m);break;case"DMY":g.push(d,h,m);break;case"YMD":default:g.push(m,h,d)}return t&&g.push({type:"hour",range:[0,23],value:l},{type:"minute",range:[0,59],value:c},{type:"second",range:[0,59],value:f}),g}function whe(e){const t={};return e.multipleOf&&(t.step=e.multipleOf),(e.minimum||e.minimum===0)&&(t.min=e.minimum),(e.maximum||e.maximum===0)&&(t.max=e.maximum),t}function She(e,t,n={},r=!0){const i={type:t||"text",...whe(e)};return n.inputType?i.type=n.inputType:t||(e.type==="number"?(i.type="number",r&&i.step===void 0&&(i.step="any")):e.type==="integer"&&(i.type="number",i.step===void 0&&(i.step=1))),n.autocomplete&&(i.autoComplete=n.autocomplete),n.accept&&(i.accept=n.accept),i}const uD={props:{disabled:!1},submitText:"Submit",norender:!1};function Ehe(e={}){const t=ot(e);if(t&&t[cp]){const n=t[cp];return{...uD,...n}}return uD}function yt(e,t,n={}){const{templates:r}=t;return e==="ButtonTemplates"?r[e]:n[e]||r[e]}var Ox={exports:{}},mt={};/**
|
|
236
|
+
`+W)}function V(re,le,W,J,se,fe){if(re.length){const me=se.complexResolvers[le];if(!me||!me.resolver)throw new Error("No resolver found for "+le);const xe=W.map(We=>re.reduce((He,$e)=>(We[$e]!==void 0&&(He[$e]=We[$e]),He),{})),we=g(xe,t),Ve=me.keywords.reduce((We,He)=>({...We,[He]:($e,Be=[])=>J($e,null,fe.concat(He,Be))}),{}),qe=me.resolver(we,fe.concat(le),Ve,se);return f(qe)||R(we,fe.concat(le)),qe}}function X(re){return{required:re}}const j=["properties","patternProperties","definitions","dependencies"],I=["anyOf","oneOf"],U=["additionalProperties","additionalItems","contains","propertyNames","not","items"],Y={type(re){if(re.some(Array.isArray)){const le=re.map(function(J){return Array.isArray(J)?J:[J]}),W=o.apply(null,le);if(W.length===1)return W[0];if(W.length>1)return m(W)}},dependencies(re,le,W){return O(re).reduce(function(se,fe){const me=B(re,fe);let xe=g(me.filter(T),c);const we=xe.filter(Array.isArray);if(we.length){if(we.length===xe.length)se[fe]=k(xe);else{const Ve=xe.filter(_),qe=we.map(X);se[fe]=W(Ve.concat(qe),fe)}return se}return xe=g(xe,t),se[fe]=W(xe,fe),se},{})},oneOf(re,le,W){const J=Q(e(re)),se=G(J,W),fe=g(se,t);if(fe.length)return fe},not(re){return{anyOf:re}},pattern(re){return re.map(le=>"(?="+le+")").join("")},multipleOf(re){let le=re.slice(0),W=1;for(;le.some(J=>!Number.isInteger(J));)le=le.map(J=>J*10),W=W*10;return n(le)/W},enum(re){const le=l.apply(null,re.concat(c));if(le.length)return h(le)}};Y.$id=$,Y.$ref=$,Y.$schema=$,Y.additionalItems=A,Y.additionalProperties=A,Y.anyOf=Y.oneOf,Y.contains=A,Y.default=$,Y.definitions=Y.dependencies,Y.description=$,Y.examples=q,Y.exclusiveMaximum=z,Y.exclusiveMinimum=M,Y.items=w,Y.maximum=z,Y.maxItems=z,Y.maxLength=z,Y.maxProperties=z,Y.minimum=M,Y.minItems=M,Y.minLength=M,Y.minProperties=M,Y.properties=v,Y.propertyNames=A,Y.required=L,Y.title=$,Y.uniqueItems=P;const ne={properties:v,items:w};function ae(re,le,W){le=r(le,{ignoreAdditionalProperties:!1,resolvers:Y,complexResolvers:ne,deep:!0});const J=Object.entries(le.complexResolvers);function se(xe,we,Ve){xe=e(xe.filter(T)),Ve=Ve||[];const qe=f(we)?we:{};if(!xe.length)return;if(xe.some(S))return!1;if(xe.every(x))return!0;xe=xe.filter(f);const We=O(xe);if(le.deep&&b(We,"allOf"))return ae({allOf:xe},le);const He=J.map(([$e,Be])=>We.filter(Ot=>Be.keywords.includes(Ot)));return He.forEach($e=>d(We,$e)),We.forEach(function($e){const Be=B(xe,$e),Ot=g(Be.filter(T),D($e));if(Ot.length===1&&b(I,$e))qe[$e]=Ot[0].map(kt=>se([kt],kt));else if(Ot.length===1&&!b(j,$e)&&!b(U,$e))qe[$e]=Ot[0];else{const kt=le.resolvers[$e]||le.resolvers.defaultResolver;if(!kt)throw new Error("No resolver found for key "+$e+". You can provide a resolver for this keyword in the options, or provide a default resolver.");const pe=(_e,Te=[])=>se(_e,null,Ve.concat($e,Te));qe[$e]=kt(Ot,Ve.concat($e),pe,le),qe[$e]===void 0?R(Ot,Ve.concat($e)):qe[$e]===void 0&&delete qe[$e]}}),J.reduce(($e,[Be,Ot],kt)=>({...$e,...V(He[kt],Be,xe,se,le,Ve)}),qe)}const fe=a(H(re));return se(fe)}return ae.options={resolvers:Y},Tx=ae,Tx}var Vde=Ude();const Hde=zn(Vde);function nl(e){let t;const n=Ne(e,"discriminator.propertyName",void 0);return Wp(n)?t=n:n!==void 0&&console.warn(`Expecting discriminator to be a string, got "${typeof n}" instead`),t}function yc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":e==null?"null":typeof e=="boolean"?"boolean":isNaN(e)?typeof e=="object"?"object":"string":"number"}var Gde=iE(function(e){return $6(Lc(e,1,mp,!0))});function Ii(e){let{type:t}=e;return!t&&e.const?yc(e.const):!t&&e.enum?"string":!t&&(e.properties||e.additionalProperties)?"object":(Array.isArray(t)&&(t.length===2&&t.includes("null")?t=t.find(n=>n!=="null"):t=t[0]),t)}function Pi(e,t){const n=Object.assign({},e);return Object.keys(t).reduce((r,i)=>{const a=e?e[i]:{},o=t[i];return e&&i in e&<(o)?r[i]=Pi(a,o):e&&t&&(Ii(e)==="object"||Ii(t)==="object")&&i===tae&&Array.isArray(a)&&Array.isArray(o)?r[i]=Gde(a,o):r[i]=o,r},n)}function nr(e,t,n={},r,i){return Zr(e,t,n,r,void 0,void 0,i)[0]}function Yde(e,t,n,r,i,a,o){const{if:l,then:c,else:f,...d}=t,h=e.isValid(l,a||{},n);let m=[d],g=[];if(r)c&&typeof c!="boolean"&&(g=g.concat(Zr(e,c,n,a,r,i,o))),f&&typeof f!="boolean"&&(g=g.concat(Zr(e,f,n,a,r,i,o)));else{const v=h?c:f;v&&typeof v!="boolean"&&(g=g.concat(Zr(e,v,n,a,r,i,o)))}return g.length&&(m=g.map(v=>Pi(d,v))),m.flatMap(v=>Zr(e,v,n,a,r,i,o))}function _L(e){return e.reduce((n,r)=>r.length>1?r.flatMap(i=>O6(n.length,a=>[...n[a]].concat(i))):(n.forEach(i=>i.push(r[0])),n),[[]])}function Zde(e,t,n,r,i,a,o){const l=xL(e,t,n,r,i,a);if(l.length>1||l[0]!==t)return l;if(qp in t)return wL(e,t,n,r,i,a).flatMap(f=>Zr(e,f,n,a,r,i,o));if(ll in t&&Array.isArray(t.allOf)){const c=t.allOf.map(d=>Zr(e,d,n,a,r,i,o));return _L(c).map(d=>({...t,allOf:d}))}return[t]}function xL(e,t,n,r,i,a,o){const l=bc(t,n,i);return l!==t?Zr(e,l,n,a,r,i,o):[t]}function bc(e,t,n){if(!lt(e))return e;let r=e;if(rn in r){const{$ref:i,...a}=r;if(n.includes(i))return r;n.push(i),r={...v6(i,t),...a}}if(Bt in r){const i=[],a=dce(r[Bt],(o,l,c)=>{const f=[...n];o[c]=bc(l,t,f),i.push(f)},{});yce(n,Cce(vce(i))),r={...r,[Bt]:a}}return Ma in r&&!Array.isArray(r.items)&&typeof r.items!="boolean"&&(r={...r,items:bc(r.items,t,n)}),It(e,r)?e:r}function Kde(e,t,n,r,i){const a={...t,properties:{...t.properties}},o=r&<(r)?r:{};return Object.keys(o).forEach(l=>{if(l in a.properties)return;let c={};typeof a.additionalProperties!="boolean"?rn in a.additionalProperties?c=nr(e,{$ref:Ne(a.additionalProperties,[rn])},n,o,i):"type"in a.additionalProperties?c={...a.additionalProperties}:Mr in a.additionalProperties||tr in a.additionalProperties?c={type:"object",...a.additionalProperties}:c={type:yc(Ne(o,[l]))}:c={type:yc(Ne(o,[l]))},a.properties[l]=c,mn(a.properties,[l,Mc],!0)}),a}function Zr(e,t,n,r,i=!1,a=[],o){return lt(t)?Zde(e,t,n,i,a,r,o).flatMap(c=>{var f;let d=c;if(Jie in d)return Yde(e,d,n,i,a,r,o);if(ll in d){if(i){const{allOf:m,...g}=d;return[...m,g]}try{const m=[],g=[];(f=d.allOf)===null||f===void 0||f.forEach(v=>{typeof v=="object"&&v.contains?m.push(v):g.push(v)}),m.length&&(d={...d,allOf:g}),d=o?o(d):Hde(d,{deep:!1}),m.length&&(d.allOf=m)}catch(m){console.warn(`could not merge subschemas in allOf:
|
|
237
|
+
`,m);const{allOf:g,...v}=d;return v}}return qw in d&&d.additionalProperties!==!1?Kde(e,d,n,r,o):d}):[{}]}function Xde(e,t,n,r,i){let a;const{oneOf:o,anyOf:l,...c}=t;if(Array.isArray(o)?a=o:Array.isArray(l)&&(a=l),a){const f=i===void 0&&r?{}:i,d=nl(t);a=a.map(m=>bc(m,n,[]));const h=nE(e,f,a,n,d);if(r)return a.map(m=>Pi(c,m));t=Pi(c,a[h])}return[t]}function wL(e,t,n,r,i,a,o){const{dependencies:l,...c}=t;return Xde(e,c,n,r,a).flatMap(d=>SL(e,l,d,n,r,i,a,o))}function SL(e,t,n,r,i,a,o,l){let c=[n];for(const f in t){if(!i&&Ne(o,[f])===void 0||n.properties&&!(f in n.properties))continue;const[d,h]=eE(f,t);return Array.isArray(h)?c[0]=Wde(n,h):lt(h)&&(c=Qde(e,n,r,f,h,i,a,o,l)),c.flatMap(m=>SL(e,d,m,r,i,a,o,l))}return c}function Wde(e,t){if(!t)return e;const n=Array.isArray(e.required)?Array.from(new Set([...e.required,...t])):t;return{...e,required:n}}function Qde(e,t,n,r,i,a,o,l,c){return Zr(e,i,n,l,a,o,c).flatMap(d=>{const{oneOf:h,...m}=d;if(t=Pi(t,m),h===void 0)return t;const g=h.map(w=>typeof w=="boolean"||!(rn in w)?[w]:xL(e,w,n,a,o,l));return _L(g).flatMap(w=>Jde(e,t,n,r,w,a,o,l,c))})}function Jde(e,t,n,r,i,a,o,l,c){const f=i.filter(d=>{if(typeof d=="boolean"||!d||!d.properties)return!1;const{[r]:h}=d.properties;if(h){const m={type:"object",properties:{[r]:h}};return e.isValid(m,l,n)||a}return!1});return!a&&f.length!==1?(console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[t]):f.flatMap(d=>{const h=d,[m]=eE(r,h.properties),g={...h,properties:m};return Zr(e,g,n,l,a,o,c).map(w=>Pi(t,w))})}const ehe={type:"object",$id:eae,properties:{__not_really_there__:{type:"number"}}};function Yw(e,t,n,r,i){let a=0;return n&&(Mt(n.properties)?a+=Wue(n.properties,(o,l,c)=>{const f=Ne(r,c);if(typeof l=="boolean")return o;if(An(l,rn)){const d=nr(e,l,t,f,i);return o+Yw(e,t,d,f||{},i)}if((An(l,tr)||An(l,Mr))&&f){const d=An(l,tr)?tr:Mr,h=nl(l);return o+vc(e,t,f,Ne(l,d),-1,h,i)}if(l.type==="object")return Mt(f)&&(o+=1),o+Yw(e,t,l,f,i);if(l.type===yc(f)){let d=o+1;return l.default?d+=f===l.default?1:-1:l.const&&(d+=f===l.const?1:-1),d}return o},0):Wp(n.type)&&n.type===yc(r)&&(a+=1)),a}function vc(e,t,n,r,i=-1,a,o){const l=r.map(m=>bc(m,t,[])),c=N6(n,r,a);if(x6(c))return c;const f=l.reduce((m,g,v)=>(nE(e,n,[ehe,g],t,a)===1&&m.push(v),m),[]);if(f.length===1)return f[0];f.length||O6(l.length,m=>f.push(m));const d=new Set,{bestIndex:h}=f.reduce((m,g)=>{const{bestScore:v}=m,w=l[g],b=Yw(e,t,w,n,o);return d.add(b),b>v?{bestIndex:g,bestScore:b}:m},{bestIndex:i,bestScore:0});return d.size===1&&i>=0?i:h}function Zw(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every(t=>lt(t))}function Wu(e){return e==null}function _c(e,t,n=!1,r=!1,i=!1){if(Array.isArray(t)){const a=Array.isArray(e)?e:[],o=i?a:t,l=i?t:a,c=o.map((f,d)=>l[d]!==void 0?_c(a[d],t[d],n,r,i):f);return(n||i)&&c.length<l.length&&c.push(...l.slice(c.length)),c}if(lt(t)){const a=Object.assign({},e);return Object.keys(t).reduce((o,l)=>{const c=Ne(t,l),f=lt(e)&&l in e,d=l in t;return o[l]=_c(e?Ne(e,l):{},c,n,r,i&&(f||!d)),o},a)}return r&&(!Wu(e)&&Wu(t)||typeof t=="number"&&isNaN(t))||i&&!Wu(t)?e:t}function Oi(e,t,n=!1){return Object.keys(t).reduce((r,i)=>{const a=e?e[i]:{},o=t[i];if(e&&i in e&<(o))r[i]=Oi(a,o,n);else if(n&&Array.isArray(a)&&Array.isArray(o)){let l=o;n==="preventDuplicates"&&(l=o.reduce((c,f)=>(a.includes(f)||c.push(f),c),[])),r[i]=a.concat(l)}else r[i]=o;return r},Object.assign({},e))}function EL(e){return Array.isArray(e.enum)&&e.enum.length===1||Di in e}function jE(e,t,n={},r){const i=nr(e,t,n,void 0,r),a=i.oneOf||i.anyOf;return Array.isArray(i.enum)?!0:Array.isArray(a)?a.every(o=>typeof o!="boolean"&&EL(o)):!1}function ME(e,t,n,r){return!t.uniqueItems||!t.items||typeof t.items=="boolean"?!1:jE(e,t.items,n,r)}function kL(e){const t=e[Di],n=Ii(e);return lt(t)&&Wp(t==null?void 0:t.$data)&&n!=="object"&&n!=="array"}function the(e){if(Qie in e&&Array.isArray(e.enum)&&e.enum.length===1)return e.enum[0];if(Di in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function xc(e,t){const n=e;if(e.enum){let a;if(t){const{enumNames:o}=ot(t);a=o}return!a&&n.enumNames&&(a=n.enumNames),e.enum.map((o,l)=>({label:(a==null?void 0:a[l])||String(o),value:o}))}let r,i;return e.anyOf?(r=e.anyOf,i=t==null?void 0:t.anyOf):e.oneOf&&(r=e.oneOf,i=t==null?void 0:t.oneOf),r&&r.map((a,o)=>{const{title:l}=ot(i==null?void 0:i[o]),c=a,f=the(c),d=l||c.title||String(f);return{schema:c,label:d,value:f}})}const nhe=["string","number","integer","boolean","null"];var rl;(function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"})(rl||(rl={}));function Cx(e,t=rl.Ignore,n=-1){if(n>=0){if(Array.isArray(e.items)&&n<e.items.length){const r=e.items[n];if(typeof r!="boolean")return r}}else if(e.items&&!Array.isArray(e.items)&&typeof e.items!="boolean")return e.items;return t!==rl.Ignore&<(e.additionalItems)?e.additionalItems:{}}function oD(e,t,n,r,i,a=[],o={},l=!1){const{emptyObjectFields:c="populateAllDefaults"}=o;if(r||l)e[t]=n;else if(c!=="skipDefaults"){const f=i===void 0?a.includes(t):i;lt(n)?c==="skipEmptyDefaults"?tl(n)||(e[t]=n):(!tl(n)||a.includes(t))&&(f||c!=="populateRequiredDefaults")&&(e[t]=n):n!==void 0&&(c==="populateAllDefaults"||c==="skipEmptyDefaults"||f&&a.includes(t))&&(e[t]=n)}}function $a(e,t,n={}){const{parentDefaults:r,rawFormData:i,rootSchema:a={},includeUndefinedValues:o=!1,_recurseList:l=[],experimental_defaultFormStateBehavior:c=void 0,experimental_customMergeAllOf:f=void 0,required:d,shouldMergeDefaultsIntoFormData:h=!1}=n;let m=lt(i)?i:{};const g=lt(t)?t:{};let v=r,w=null,b=c,_=l;if(g[Di]!==void 0&&(c==null?void 0:c.constAsDefaults)!=="never"&&!kL(g))v=g[Di];else if(lt(v)&<(g.default))v=Oi(v,g.default);else if(Wie in g&&!g[Mr]&&!g[tr])v=g.default;else if(rn in g){const A=g[rn];l.includes(A)||(_=l.concat(A),w=v6(A,a)),w&&!v&&(v=g.default),h&&w&&!lt(i)&&(m=i)}else if(qp in g){const A={...lD(e,g,n,v),...m};w=wL(e,g,a,!1,[],A,f)[0]}else if(Zw(g))v=g.items.map((A,k)=>$a(e,A,{rootSchema:a,includeUndefinedValues:o,_recurseList:l,experimental_defaultFormStateBehavior:c,experimental_customMergeAllOf:f,parentDefaults:Array.isArray(r)?r[k]:void 0,rawFormData:m,required:d,shouldMergeDefaultsIntoFormData:h}));else if(tr in g){const{oneOf:A,...k}=g;if(A.length===0)return;const T=nl(g),{type:O="null"}=k;!Array.isArray(O)&&nhe.includes(O)&&(b==null?void 0:b.constAsDefaults)==="skipOneOf"&&(b={...b,constAsDefaults:"never"}),w=A[vc(e,a,i??g.default,A,0,T,f)],w=Pi(k,w)}else if(Mr in g){const{anyOf:A,...k}=g;if(A.length===0)return;const T=nl(g);w=A[vc(e,a,i??g.default,A,0,T,f)],w=Pi(k,w)}if(w)return $a(e,w,{rootSchema:a,includeUndefinedValues:o,_recurseList:_,experimental_defaultFormStateBehavior:b,experimental_customMergeAllOf:f,parentDefaults:v,rawFormData:i??m,required:d,shouldMergeDefaultsIntoFormData:h});v===void 0&&(v=g.default);const S=lD(e,g,n,v);let x=S??v;if(h){const{arrayMinItems:A={}}=c||{},{mergeExtraDefaults:k}=A,T=rhe(e,g,a,i,c,f);(!lt(i)||ll in g)&&(x=_c(x,T,k,!0))}return x}function rhe(e,t,n,r,i,a){const o=!EL(t)&&jE(e,t,n,a);let l=r;if(o){const f=xc(t);l=(f==null?void 0:f.some(h=>It(h.value,r)))?r:void 0}return t[Di]&&(i==null?void 0:i.constAsDefaults)==="always"&&(l=t.const),l}function ihe(e,t,{rawFormData:n,rootSchema:r={},includeUndefinedValues:i=!1,_recurseList:a=[],experimental_defaultFormStateBehavior:o=void 0,experimental_customMergeAllOf:l=void 0,required:c,shouldMergeDefaultsIntoFormData:f}={},d){{const h=lt(n)?n:{},m=t,g=(o==null?void 0:o.allOf)==="populateDefaults"&&ll in m?nr(e,m,r,h,l):m,v=g[Di],w=Object.keys(g.properties||{}).reduce((b,_)=>{var S;const x=Ne(g,[Bt,_]),A=lt(v)&&v[_]!==void 0,k=(lt(x)&&Di in x||A)&&(o==null?void 0:o.constAsDefaults)!=="never"&&!kL(x),T=$a(e,x,{rootSchema:r,_recurseList:a,experimental_defaultFormStateBehavior:o,experimental_customMergeAllOf:l,includeUndefinedValues:i===!0,parentDefaults:Ne(d,[_]),rawFormData:Ne(h,[_]),required:(S=g.required)===null||S===void 0?void 0:S.includes(_),shouldMergeDefaultsIntoFormData:f});return oD(b,_,T,i,c,g.required,o,k),b},{});if(g.additionalProperties){const b=lt(g.additionalProperties)?g.additionalProperties:{},_=new Set;lt(d)&&Object.keys(d).filter(x=>!g.properties||!g.properties[x]).forEach(x=>_.add(x));const S=[];Object.keys(h).filter(x=>!g.properties||!g.properties[x]).forEach(x=>{_.add(x),S.push(x)}),_.forEach(x=>{var A;const k=$a(e,b,{rootSchema:r,_recurseList:a,experimental_defaultFormStateBehavior:o,experimental_customMergeAllOf:l,includeUndefinedValues:i===!0,parentDefaults:Ne(d,[x]),rawFormData:Ne(h,[x]),required:(A=g.required)===null||A===void 0?void 0:A.includes(x),shouldMergeDefaultsIntoFormData:f});oD(w,x,k,i,c,S)})}return w}}function ahe(e,t,{rawFormData:n,rootSchema:r={},_recurseList:i=[],experimental_defaultFormStateBehavior:a=void 0,experimental_customMergeAllOf:o=void 0,required:l,shouldMergeDefaultsIntoFormData:c}={},f){var d,h;const m=t,g=(d=a==null?void 0:a.arrayMinItems)!==null&&d!==void 0?d:{},{populate:v,mergeExtraDefaults:w}=g,b=v==="never",_=v==="requiredOnly",S=v==="all"||!b&&!_,x=(h=g==null?void 0:g.computeSkipPopulate)!==null&&h!==void 0?h:()=>!1,k=(a==null?void 0:a.emptyObjectFields)==="skipEmptyDefaults"?void 0:[];if(Array.isArray(f)&&(f=f.map((P,q)=>{const D=Cx(m,rl.Fallback,q);return $a(e,D,{rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,parentDefaults:P,required:l,shouldMergeDefaultsIntoFormData:c})})),Array.isArray(n)){const P=Cx(m);if(b)f=n;else{const q=n.map((H,B)=>$a(e,P,{rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,rawFormData:H,parentDefaults:Ne(f,[B]),required:l,shouldMergeDefaultsIntoFormData:c}));f=_c(f,q,(_&&l||S)&&w)}}if((lt(m)&&Di in m&&(a==null?void 0:a.constAsDefaults)!=="never")===!1){if(b)return f??k;if(_&&!l)return f||void 0}const O=Array.isArray(f)?f.length:0;if(!m.minItems||ME(e,m,r,o)||x(e,m,r)||m.minItems<=O)return f||k;const $=f||[],L=Cx(m,rl.Invert),M=L.default,z=new Array(m.minItems-O).fill($a(e,L,{parentDefaults:M,rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,required:l,shouldMergeDefaultsIntoFormData:c}));return $.concat(z)}function lD(e,t,n={},r){switch(Ii(t)){case"object":return ihe(e,t,n,r);case"array":return ahe(e,t,n,r)}}function AL(e,t,n,r,i=!1,a,o){if(!lt(t))throw new Error("Invalid schema: "+t);const l=nr(e,t,r,n,o),c=$a(e,l,{rootSchema:r,includeUndefinedValues:i,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,rawFormData:n,shouldMergeDefaultsIntoFormData:!0});if(lt(n)||Array.isArray(n)){const{mergeDefaultsIntoFormData:f}=a||{};return _c(c,n,!0,f==="useDefaultIfFormDataUndefined",!0)}return c}function TL(e={}){return"widget"in ot(e)&&ot(e).widget!=="hidden"}function CL(e,t,n={},r,i){if(n[LS]==="files")return!0;if(t.items){const a=nr(e,t.items,r,void 0,i);return a.type==="string"&&a.format==="data-url"}return!1}function she(e,t,n={},r,i,a){const o=ot(n,i),{label:l=!0}=o;let c=!!l;const f=Ii(t);return f==="array"&&(c=ME(e,t,r,a)||CL(e,t,n,r,a)||TL(n)),f==="object"&&(c=!1),f==="boolean"&&!n[LS]&&(c=!1),n[nae]&&(c=!1),c}function ohe(e,t,n){if(!n)return t;const{errors:r,errorSchema:i}=t;let a=e.toErrorList(n),o=n;return tl(i)||(o=Oi(i,n,!0),a=[...r].concat(a)),{errorSchema:o,errors:a}}const Co=Symbol("no Value");function Kw(e,t,n,r,i={},a){let o;if(An(n,Bt)){const l={};if(An(r,Bt)){const d=Ne(r,Bt,{});Object.keys(d).forEach(h=>{An(i,h)&&(l[h]=void 0)})}const c=Object.keys(Ne(n,Bt,{})),f={};c.forEach(d=>{const h=Ne(i,d);let m=Ne(r,[Bt,d],{}),g=Ne(n,[Bt,d],{});An(m,rn)&&(m=nr(e,m,t,h,a)),An(g,rn)&&(g=nr(e,g,t,h,a));const v=Ne(m,"type"),w=Ne(g,"type");if(!v||v===w)if(An(l,d)&&delete l[d],w==="object"||w==="array"&&Array.isArray(h)){const b=Kw(e,t,g,m,h,a);(b!==void 0||w==="array")&&(f[d]=b)}else{const b=Ne(g,"default",Co),_=Ne(m,"default",Co);b!==Co&&b!==h&&(_===h?l[d]=b:Ne(g,"readOnly")===!0&&(l[d]=void 0));const S=Ne(g,"const",Co),x=Ne(m,"const",Co);S!==Co&&S!==h&&(l[d]=x===h?S:void 0)}}),o={...typeof i=="string"||Array.isArray(i)?void 0:i,...l,...f}}else if(Ne(r,"type")==="array"&&Ne(n,"type")==="array"&&Array.isArray(i)){let l=Ne(r,"items"),c=Ne(n,"items");if(typeof l=="object"&&typeof c=="object"&&!Array.isArray(l)&&!Array.isArray(c)){An(l,rn)&&(l=nr(e,l,t,i,a)),An(c,rn)&&(c=nr(e,c,t,i,a));const f=Ne(l,"type"),d=Ne(c,"type");if(!f||f===d){const h=Ne(n,"maxItems",-1);d==="object"?o=i.reduce((m,g)=>{const v=Kw(e,t,c,l,g,a);return v!==void 0&&(h<0||m.length<h)&&m.push(v),m},[]):o=h>0&&i.length>h?i.slice(0,h):i}}else typeof l=="boolean"&&typeof c=="boolean"&&l===c&&(o=i)}return o}function Nh(e,t,n,r,i,a,o,l=[],c){if(rn in t||qp in t||ll in t){const h=nr(e,t,a,o,c);if(l.findIndex(g=>It(g,h))===-1)return Nh(e,h,n,r,i,a,o,l.concat(h),c)}if(Ma in t&&!Ne(t,[Ma,rn]))return Nh(e,Ne(t,Ma),n,r,i,a,o,l,c);const d={$id:i||n};if(Ii(t)==="object"&&Bt in t)for(const h in t.properties){const m=Ne(t,[Bt,h]),g=d[Ra]+r+h;d[h]=Nh(e,lt(m)?m:{},n,r,g,a,Ne(o,[h]),l,c)}return d}function lhe(e,t,n,r,i,a="root",o="_",l){return Nh(e,t,a,o,n,r,i,void 0,l)}function us(e,t,n,r,i,a=[],o){if(rn in t||qp in t||ll in t){const c=nr(e,t,r,i,o);if(a.findIndex(d=>It(d,c))===-1)return us(e,c,n,r,i,a.concat(c),o)}let l={[Oh]:n.replace(/^\./,"")};if(tr in t||Mr in t){const c=tr in t?t.oneOf:t.anyOf,f=nl(t),d=vc(e,r,i,c,0,f,o),h=c[d];l={...l,...us(e,h,n,r,i,a,o)}}if(qw in t&&t[qw]!==!1&&mn(l,PS,!0),Ma in t&&Array.isArray(i)){const{items:c,additionalItems:f}=t;Array.isArray(c)?i.forEach((d,h)=>{c[h]?l[h]=us(e,c[h],`${n}.${h}`,r,d,a,o):f?l[h]=us(e,f,`${n}.${h}`,r,d,a,o):console.warn(`Unable to generate path schema for "${n}.${h}". No schema defined for it`)}):i.forEach((d,h)=>{l[h]=us(e,c,`${n}.${h}`,r,d,a,o)})}else if(Bt in t)for(const c in t.properties){const f=Ne(t,[Bt,c]);l[c]=us(e,f,`${n}.${c}`,r,Ne(i,[c]),a,o)}return l}function uhe(e,t,n="",r,i,a){return us(e,t,n,r,i,void 0,a)}class che{constructor(t,n,r,i){this.rootSchema=n,this.validator=t,this.experimental_defaultFormStateBehavior=r,this.experimental_customMergeAllOf=i}getValidator(){return this.validator}doesSchemaUtilsDiffer(t,n,r={},i){return!t||!n?!1:this.validator!==t||!It(this.rootSchema,n)||!It(this.experimental_defaultFormStateBehavior,r)||this.experimental_customMergeAllOf!==i}getDefaultFormState(t,n,r=!1){return AL(this.validator,t,n,this.rootSchema,r,this.experimental_defaultFormStateBehavior,this.experimental_customMergeAllOf)}getDisplayLabel(t,n,r){return she(this.validator,t,n,this.rootSchema,r,this.experimental_customMergeAllOf)}getClosestMatchingOption(t,n,r,i){return vc(this.validator,this.rootSchema,t,n,r,i,this.experimental_customMergeAllOf)}getFirstMatchingOption(t,n,r){return nE(this.validator,t,n,this.rootSchema,r)}getMatchingOption(t,n,r){return R6(this.validator,t,n,this.rootSchema,r)}isFilesArray(t,n){return CL(this.validator,t,n,this.rootSchema,this.experimental_customMergeAllOf)}isMultiSelect(t){return ME(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}isSelect(t){return jE(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}mergeValidationData(t,n){return ohe(this.validator,t,n)}retrieveSchema(t,n){return nr(this.validator,t,this.rootSchema,n,this.experimental_customMergeAllOf)}sanitizeDataForNewSchema(t,n,r){return Kw(this.validator,this.rootSchema,t,n,r,this.experimental_customMergeAllOf)}toIdSchema(t,n,r,i="root",a="_"){return lhe(this.validator,t,n,this.rootSchema,r,i,a,this.experimental_customMergeAllOf)}toPathSchema(t,n,r){return uhe(this.validator,t,n,this.rootSchema,r,this.experimental_customMergeAllOf)}}function fhe(e,t,n={},r){return new che(e,t,n,r)}function dhe(e){var t;if(e.indexOf("data:")===-1)throw new Error("File is invalid: URI must be a dataURI");const r=e.slice(5).split(";base64,");if(r.length!==2)throw new Error("File is invalid: dataURI must be base64");const[i,a]=r,[o,...l]=i.split(";"),c=o||"",f=decodeURI(((t=l.map(d=>d.split("=")).find(([d])=>d==="name"))===null||t===void 0?void 0:t[1])||"unknown");try{const d=atob(a),h=new Array(d.length);for(let g=0;g<d.length;g++)h[g]=d.charCodeAt(g);return{blob:new window.Blob([new Uint8Array(h)],{type:c}),name:f}}catch(d){throw new Error("File is invalid: "+d.message)}}function ka(e,t){let n=String(e);for(;n.length<t;)n="0"+n;return n}function OL(e,t){if(e<=0&&t<=0)e=new Date().getFullYear()+e,t=new Date().getFullYear()+t;else if(e<0||t<0)throw new Error(`Both start (${e}) and stop (${t}) must both be <= 0 or > 0, got one of each`);if(e>t)return OL(t,e).reverse();const n=[];for(let r=e;r<=t;r++)n.push({value:r,label:ka(r,2)});return n}function hhe(e,t){let n=e;if(Array.isArray(t)){const r=n.split(/(%\d)/);t.forEach((i,a)=>{const o=r.findIndex(l=>l===`%${a+1}`);o>=0&&(r[o]=i)}),n=r.join("")}return n}function phe(e,t){return hhe(e,t)}function Qr(e,t=[],n){if(Array.isArray(e))return e.map(a=>Qr(a,t)).filter(a=>a!==n);const r=e===""||e===null?-1:Number(e),i=t[r];return i?i.value:n}function mhe(e,t,n=[]){const r=Qr(e,n);return Array.isArray(t)?t.filter(i=>!It(i,r)):It(r,t)?void 0:t}function $E(e,t){return Array.isArray(t)?t.some(n=>It(n,e)):It(t,e)}function ghe(e,t=[],n=!1){const r=t.map((i,a)=>$E(i.value,e)?String(a):void 0).filter(i=>typeof i<"u");return n?r:r[0]}function yhe(e,t,n=[]){const r=Qr(e,n);if(!Wu(r)){const i=n.findIndex(l=>r===l.value),a=n.map(({value:l})=>l);return t.slice(0,i).concat(r,t.slice(i)).sort((l,c)=>+(a.indexOf(l)>a.indexOf(c)))}return t}var bhe=1,vhe=4;function NL(e){return Xu(e,bhe|vhe)}function _he(e,t,n,r){return r=typeof r=="function"?r:void 0,e==null?e:rE(e,t,n,r)}class xhe{constructor(t){this.errorSchema={},this.resetAllErrors(t)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(t){let r=Array.isArray(t)&&t.length>0||typeof t=="string"?Ne(this.errorSchema,t):this.errorSchema;return!r&&t&&(r={},_he(this.errorSchema,t,r,Object)),r}resetAllErrors(t){return this.errorSchema=t?NL(t):{},this}addErrors(t,n){const r=this.getOrCreateErrorBlock(n);let i=Ne(r,Jn);return Array.isArray(i)||(i=[],r[Jn]=i),Array.isArray(t)?mn(r,Jn,[...new Set([...i,...t])]):mn(r,Jn,[...new Set([...i,t])]),this}setErrors(t,n){const r=this.getOrCreateErrorBlock(n),i=Array.isArray(t)?[...new Set([...t])]:[t];return mn(r,Jn,i),this}clearErrors(t){const n=this.getOrCreateErrorBlock(t);return mn(n,Jn,[]),this}}function whe(e,t,n=[1900,new Date().getFullYear()+2],r="YMD"){const{day:i,month:a,year:o,hour:l,minute:c,second:f}=e,d={type:"day",range:[1,31],value:i},h={type:"month",range:[1,12],value:a},m={type:"year",range:n,value:o},g=[];switch(r){case"MDY":g.push(h,d,m);break;case"DMY":g.push(d,h,m);break;case"YMD":default:g.push(m,h,d)}return t&&g.push({type:"hour",range:[0,23],value:l},{type:"minute",range:[0,59],value:c},{type:"second",range:[0,59],value:f}),g}function She(e){const t={};return e.multipleOf&&(t.step=e.multipleOf),(e.minimum||e.minimum===0)&&(t.min=e.minimum),(e.maximum||e.maximum===0)&&(t.max=e.maximum),t}function Ehe(e,t,n={},r=!0){const i={type:t||"text",...She(e)};return n.inputType?i.type=n.inputType:t||(e.type==="number"?(i.type="number",r&&i.step===void 0&&(i.step="any")):e.type==="integer"&&(i.type="number",i.step===void 0&&(i.step=1))),n.autocomplete&&(i.autoComplete=n.autocomplete),n.accept&&(i.accept=n.accept),i}const uD={props:{disabled:!1},submitText:"Submit",norender:!1};function khe(e={}){const t=ot(e);if(t&&t[cp]){const n=t[cp];return{...uD,...n}}return uD}function yt(e,t,n={}){const{templates:r}=t;return e==="ButtonTemplates"?r[e]:n[e]||r[e]}var Ox={exports:{}},mt={};/**
|
|
238
238
|
* @license React
|
|
239
239
|
* react-is.production.min.js
|
|
240
240
|
*
|
|
@@ -242,27 +242,27 @@ prismjs/prism.js:
|
|
|
242
242
|
*
|
|
243
243
|
* This source code is licensed under the MIT license found in the
|
|
244
244
|
* LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/var cD;function khe(){if(cD)return mt;cD=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),v;v=Symbol.for("react.module.reference");function w(b){if(typeof b=="object"&&b!==null){var _=b.$$typeof;switch(_){case e:switch(b=b.type,b){case n:case i:case r:case f:case d:return b;default:switch(b=b&&b.$$typeof,b){case l:case o:case c:case m:case h:case a:return b;default:return _}}case t:return _}}}return mt.ContextConsumer=o,mt.ContextProvider=a,mt.Element=e,mt.ForwardRef=c,mt.Fragment=n,mt.Lazy=m,mt.Memo=h,mt.Portal=t,mt.Profiler=i,mt.StrictMode=r,mt.Suspense=f,mt.SuspenseList=d,mt.isAsyncMode=function(){return!1},mt.isConcurrentMode=function(){return!1},mt.isContextConsumer=function(b){return w(b)===o},mt.isContextProvider=function(b){return w(b)===a},mt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},mt.isForwardRef=function(b){return w(b)===c},mt.isFragment=function(b){return w(b)===n},mt.isLazy=function(b){return w(b)===m},mt.isMemo=function(b){return w(b)===h},mt.isPortal=function(b){return w(b)===t},mt.isProfiler=function(b){return w(b)===i},mt.isStrictMode=function(b){return w(b)===r},mt.isSuspense=function(b){return w(b)===f},mt.isSuspenseList=function(b){return w(b)===d},mt.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===f||b===d||b===g||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===h||b.$$typeof===a||b.$$typeof===o||b.$$typeof===c||b.$$typeof===v||b.getModuleId!==void 0)},mt.typeOf=w,mt}var fD;function Ahe(){return fD||(fD=1,Ox.exports=khe()),Ox.exports}var The=Ahe();const dD=zn(The),Nx={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",time:"TimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function Che(e){let t=Ne(e,"MergedWidget");if(!t){const n=e.defaultProps&&e.defaultProps.options||{};t=({options:r,...i})=>N.jsx(e,{options:{...n,...r},...i}),mn(e,"MergedWidget",t)}return t}function ji(e,t,n={}){const r=Ii(e);if(typeof t=="function"||t&&dD.isForwardRef(te.createElement(t))||dD.isMemo(t))return Che(t);if(typeof t!="string")throw new Error(`Unsupported widget definition: ${typeof t}`);if(t in n){const i=n[t];return ji(e,i,n)}if(typeof r=="string"){if(!(r in Nx))throw new Error(`No widget for type '${r}'`);if(t in Nx[r]){const i=n[Nx[r][t]];return ji(e,i,n)}}throw new Error(`No widget '${t}' for type '${r}'`)}function Ohe(e){let t=0;for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return t.toString(16)}function Nhe(e){const t=new Set;return JSON.stringify(e,(n,r)=>(t.add(n),r)),Ohe(JSON.stringify(e,Array.from(t).sort()))}function Rhe(e,t,n={}){try{return ji(e,t,n),!0}catch(r){const i=r;if(i.message&&(i.message.startsWith("No widget")||i.message.startsWith("Unsupported widget")))return!1;throw r}}function Bc(e,t){return`${Wp(e)?e:e[Ra]}__${t}`}function Uc(e){return Bc(e,"description")}function RL(e){return Bc(e,"error")}function Xw(e){return Bc(e,"examples")}function jL(e){return Bc(e,"help")}function ML(e){return Bc(e,"title")}function Is(e,t=!1){const n=t?` ${Xw(e)}`:"";return`${RL(e)} ${Uc(e)} ${jL(e)}${n}`}function $L(e,t){return`${e}-${t}`}function jhe(e,t,n){return t?n:e}function Mhe(e){return e?new Date(e).toJSON():void 0}function $he(e,t){if(!Array.isArray(t))return e;const n=d=>d.reduce((h,m)=>(h[m]=!0,h),{}),r=d=>d.length>1?`properties '${d.join("', '")}'`:`property '${d[0]}'`,i=n(e),a=t.filter(d=>d==="*"||i[d]),o=n(a),l=e.filter(d=>!o[d]),c=a.indexOf("*");if(c===-1){if(l.length)throw new Error(`uiSchema order list does not contain ${r(l)}`);return a}if(c!==a.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const f=[...a];return f.splice(c,1,...l),f}function Rx(e,t=!0){if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};const n=new Date(e);if(Number.isNaN(n.getTime()))throw new Error("Unable to parse date "+e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:t?n.getUTCHours():0,minute:t?n.getUTCMinutes():0,second:t?n.getUTCSeconds():0}}function Rh(e){if(e.const||e.enum&&e.enum.length===1&&e.enum[0]===!0)return!0;if(e.anyOf&&e.anyOf.length===1)return Rh(e.anyOf[0]);if(e.oneOf&&e.oneOf.length===1)return Rh(e.oneOf[0]);if(e.allOf){const t=n=>Rh(n);return e.allOf.some(t)}return!1}function Dhe(e,t,n){const{props:r,state:i}=e;return!It(r,t)||!It(i,n)}function hD(e,t=!0){const{year:n,month:r,day:i,hour:a=0,minute:o=0,second:l=0}=e,c=Date.UTC(n,r-1,i,a,o,l),f=new Date(c).toJSON();return t?f:f.slice(0,10)}function wc(e,t=[]){if(!e)return[];let n=[];return Jn in e&&(n=n.concat(e[Jn].map(r=>{const i=`.${t.join(".")}`;return{property:i,message:r,stack:`${i} ${r}`}}))),Object.keys(e).reduce((r,i)=>{if(i!==Jn){const a=e[i];Ss(a)&&(r=r.concat(wc(a,[...t,i])))}return r},n)}function DL(e){return an(e)?Zp(e,Ns):Ic(e)?[e]:WS(r6(YS(e)))}function Ihe(e){const t=new _he;return e.length&&e.forEach(n=>{const{property:r,message:i}=n,a=r==="."?[]:DL(r);a.length>0&&a[0]===""&&a.splice(0,1),i&&t.addErrors(i,a)}),t.ErrorSchema}function DE(e){return Object.keys(e).reduce((t,n)=>{if(n==="addError")return t;{const r=e[n];return Ss(r)?{...t,[n]:DE(r)}:{...t,[n]:r}}},{})}function Phe(e){if(!e)return"";const t=new Date(e),n=ka(t.getFullYear(),4),r=ka(t.getMonth()+1,2),i=ka(t.getDate(),2),a=ka(t.getHours(),2),o=ka(t.getMinutes(),2),l=ka(t.getSeconds(),2),c=ka(t.getMilliseconds(),3);return`${n}-${r}-${i}T${a}:${o}:${l}.${c}`}function jh(e,t){if(!t)return e;const{errors:n,errorSchema:r}=e;let i=wc(t),a=t;return tl(r)||(a=Oi(r,t,!0),i=[...n].concat(i)),{errorSchema:a,errors:i}}function Lhe(e){for(const t in e){const n=e,r=n[t];t===rn&&typeof r=="string"&&r.startsWith("#")?n[t]=UP+r:n[t]=IE(r)}return e}function zhe(e){for(let t=0;t<e.length;t++)e[t]=IE(e[t]);return e}function IE(e){return Array.isArray(e)?zhe([...e]):Mt(e)?Lhe({...e}):e}function IL(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],l=Kp(e,o);n(l,o)&&rE(a,cl(o,e),l)}return a}function qhe(e,t){if(e==null)return{};var n=Zp(QS(e),function(r){return[r]});return t=tE(t),IL(e,n,function(r,i){return t(r,i[0])})}var Fhe=200;function Bhe(e,t,n,r){var i=-1,a=M6,o=!0,l=e.length,c=[],f=t.length;if(!l)return c;t.length>=Fhe&&(a=zS,o=!1,t=new Qo(t));e:for(;++i<l;){var d=e[i],h=d;if(d=d!==0?d:0,o&&h===h){for(var m=f;m--;)if(t[m]===h)continue e;c.push(d)}else a(t,h,r)||c.push(d)}return c}var Uhe=iE(function(e,t){return mp(e)?Bhe(e,Lc(t,1,mp,!0)):[]});function Vhe(e,t){const n=Ss(e),r=Ss(t);if(e===t||!n&&!r)return[];if(n&&!r)return Yr(e);if(!n&&r)return Yr(t);{const i=Yr(qhe(e,(o,l)=>!It(o,Ne(t,l)))),a=Uhe(Yr(t),Yr(e));return[...i,...a]}}var Tt;(function(e){e.ArrayItemTitle="Item",e.MissingItems="Missing items definition",e.YesLabel="Yes",e.NoLabel="No",e.CloseLabel="Close",e.ErrorsLabel="Errors",e.NewStringDefault="New Value",e.AddButton="Add",e.AddItemButton="Add Item",e.CopyButton="Copy",e.MoveDownButton="Move down",e.MoveUpButton="Move up",e.RemoveButton="Remove",e.NowLabel="Now",e.ClearLabel="Clear",e.AriaDateLabel="Select a date",e.PreviewLabel="Preview",e.DecrementAriaLabel="Decrease value by 1",e.IncrementAriaLabel="Increase value by 1",e.UnknownFieldType="Unknown field type %1",e.OptionPrefix="Option %1",e.TitleOptionPrefix="%1 option %2",e.KeyLabel="%1 Key",e.InvalidObjectField='Invalid "%1" object field configuration: _%2_.',e.UnsupportedField="Unsupported field schema.",e.UnsupportedFieldWithId="Unsupported field schema for field `%1`.",e.UnsupportedFieldWithReason="Unsupported field schema: _%1_.",e.UnsupportedFieldWithIdAndReason="Unsupported field schema for field `%1`: _%2_.",e.FilesInfo="**%1** (%2, %3 bytes)"})(Tt||(Tt={}));function Hhe(e,t){var n=an(e)?ZS:E6;return n(e,C6(t))}function Ghe(e,t){return IL(e,t,function(n,r){return T6(e,r)})}var pD=y6(function(e,t){return e==null?{}:Ghe(e,t)}),Yhe=0;function Zhe(e){var t=++Yhe;return YS(e)+t}function Ww(){return Zhe("rjsf-array-item-")}function mD(e){return Array.isArray(e)?e.map(t=>({key:Ww(),item:t})):[]}function Ru(e){return Array.isArray(e)?e.map(t=>t.item):[]}class Khe extends te.Component{constructor(n){super(n);De(this,"_getNewFormDataRow",()=>{const{schema:n,registry:r}=this.props,{schemaUtils:i}=r;let a=n.items;return Zw(n)&&Kie(n)&&(a=n.additionalItems),i.getDefaultFormState(a)});De(this,"onAddClick",n=>{this._handleAddClick(n)});De(this,"onAddIndexClick",n=>r=>{this._handleAddClick(r,n)});De(this,"onCopyIndexClick",n=>r=>{r&&r.preventDefault();const{onChange:i,errorSchema:a}=this.props,{keyedFormData:o}=this.state;let l;if(a){l={};for(const d in a){const h=parseInt(d);h<=n?mn(l,[h],a[d]):h>n&&mn(l,[h+1],a[d])}}const c={key:Ww(),item:NL(o[n].item)},f=[...o];n!==void 0?f.splice(n+1,0,c):f.push(c),this.setState({keyedFormData:f,updatedKeyedFormData:!0},()=>i(Ru(f),l))});De(this,"onDropIndexClick",n=>r=>{r&&r.preventDefault();const{onChange:i,errorSchema:a}=this.props,{keyedFormData:o}=this.state;let l;if(a){l={};for(const f in a){const d=parseInt(f);d<n?mn(l,[d],a[f]):d>n&&mn(l,[d-1],a[f])}}const c=o.filter((f,d)=>d!==n);this.setState({keyedFormData:c,updatedKeyedFormData:!0},()=>i(Ru(c),l))});De(this,"onReorderClick",(n,r)=>i=>{i&&(i.preventDefault(),i.currentTarget.blur());const{onChange:a,errorSchema:o}=this.props;let l;if(o){l={};for(const h in o){const m=parseInt(h);m==n?mn(l,[r],o[n]):m==r?mn(l,[n],o[r]):mn(l,[h],o[m])}}const{keyedFormData:c}=this.state;function f(){const h=c.slice();return h.splice(n,1),h.splice(r,0,c[n]),h}const d=f();this.setState({keyedFormData:d},()=>a(Ru(d),l))});De(this,"onChangeForIndex",n=>(r,i,a)=>{const{formData:o,onChange:l,errorSchema:c}=this.props,d=(Array.isArray(o)?o:[]).map((h,m)=>n===m?typeof r>"u"?null:r:h);l(d,c&&c&&{...c,[n]:i},a)});De(this,"onSelectChange",n=>{const{onChange:r,idSchema:i}=this.props;r(n,void 0,i&&i.$id)});const{formData:r=[]}=n,i=mD(r);this.state={keyedFormData:i,updatedKeyedFormData:!1}}static getDerivedStateFromProps(n,r){if(r.updatedKeyedFormData)return{updatedKeyedFormData:!1};const i=Array.isArray(n.formData)?n.formData:[],a=r.keyedFormData||[];return{keyedFormData:i.length===a.length?a.map((l,c)=>({key:l.key,item:i[c]})):mD(i)}}get itemTitle(){const{schema:n,registry:r}=this.props,{translateString:i}=r;return Ne(n,[Ma,"title"],Ne(n,[Ma,"description"],i(Tt.ArrayItemTitle)))}isItemRequired(n){return Array.isArray(n.type)?!n.type.includes("null"):n.type!=="null"}canAddItem(n){const{schema:r,uiSchema:i,registry:a}=this.props;let{addable:o}=ot(i,a.globalUiOptions);return o!==!1&&(r.maxItems!==void 0?o=n.length<r.maxItems:o=!0),o}_handleAddClick(n,r){n&&n.preventDefault();const{onChange:i,errorSchema:a}=this.props,{keyedFormData:o}=this.state;let l;if(a){l={};for(const d in a){const h=parseInt(d);r===void 0||h<r?mn(l,[h],a[d]):h>=r&&mn(l,[h+1],a[d])}}const c={key:Ww(),item:this._getNewFormDataRow()},f=[...o];r!==void 0?f.splice(r,0,c):f.push(c),this.setState({keyedFormData:f,updatedKeyedFormData:!0},()=>i(Ru(f),l))}render(){const{schema:n,uiSchema:r,idSchema:i,registry:a}=this.props,{schemaUtils:o,translateString:l}=a;if(!(Ma in n)){const c=ot(r),f=yt("UnsupportedFieldTemplate",a,c);return N.jsx(f,{schema:n,idSchema:i,reason:l(Tt.MissingItems),registry:a})}return o.isMultiSelect(n)?this.renderMultiSelect():TL(r)?this.renderCustomWidget():Zw(n)?this.renderFixedArray():o.isFilesArray(n,r)?this.renderFiles():this.renderNormalArray()}renderNormalArray(){const{schema:n,uiSchema:r={},errorSchema:i,idSchema:a,name:o,title:l,disabled:c=!1,readonly:f=!1,autofocus:d=!1,required:h=!1,registry:m,onBlur:g,onFocus:v,idPrefix:w,idSeparator:b="_",rawErrors:_}=this.props,{keyedFormData:S}=this.state,x=n.title||l||o,{schemaUtils:A,formContext:k}=m,T=ot(r),O=Mt(n.items)?n.items:{},$=A.retrieveSchema(O),L=Ru(this.state.keyedFormData),M=this.canAddItem(L),z={canAdd:M,items:S.map((q,D)=>{const{key:H,item:B}=q,G=B,K=A.retrieveSchema(O,G),Q=i?i[D]:void 0,R=a.$id+b+D,V=A.toIdSchema(K,R,G,w,b);return this.renderArrayFieldItem({key:H,index:D,name:o&&`${o}-${D}`,title:x?`${x}-${D+1}`:void 0,canAdd:M,canMoveUp:D>0,canMoveDown:D<L.length-1,itemSchema:K,itemIdSchema:V,itemErrorSchema:Q,itemData:G,itemUiSchema:r.items,autofocus:d&&D===0,onBlur:g,onFocus:v,rawErrors:_,totalItems:S.length})}),className:`field field-array field-array-of-${$.type}`,disabled:c,idSchema:a,uiSchema:r,onAddClick:this.onAddClick,readonly:f,required:h,schema:n,title:x,formContext:k,formData:L,rawErrors:_,registry:m},P=yt("ArrayFieldTemplate",m,T);return N.jsx(P,{...z})}renderCustomWidget(){const{schema:n,idSchema:r,uiSchema:i,disabled:a=!1,readonly:o=!1,autofocus:l=!1,required:c=!1,hideError:f,placeholder:d,onBlur:h,onFocus:m,formData:g=[],registry:v,rawErrors:w,name:b}=this.props,{widgets:_,formContext:S,globalUiOptions:x,schemaUtils:A}=v,{widget:k,title:T,...O}=ot(i,x),$=ji(n,k,_),L=T??n.title??b,M=A.getDisplayLabel(n,i,x);return N.jsx($,{id:r.$id,name:b,multiple:!0,onChange:this.onSelectChange,onBlur:h,onFocus:m,options:O,schema:n,uiSchema:i,registry:v,value:g,disabled:a,readonly:o,hideError:f,required:c,label:L,hideLabel:!M,placeholder:d,formContext:S,autofocus:l,rawErrors:w})}renderMultiSelect(){const{schema:n,idSchema:r,uiSchema:i,formData:a=[],disabled:o=!1,readonly:l=!1,autofocus:c=!1,required:f=!1,placeholder:d,onBlur:h,onFocus:m,registry:g,rawErrors:v,name:w}=this.props,{widgets:b,schemaUtils:_,formContext:S,globalUiOptions:x}=g,A=_.retrieveSchema(n.items,a),k=xc(A,i),{widget:T="select",title:O,...$}=ot(i,x),L=ji(n,T,b),M=O??n.title??w,z=_.getDisplayLabel(n,i,x);return N.jsx(L,{id:r.$id,name:w,multiple:!0,onChange:this.onSelectChange,onBlur:h,onFocus:m,options:{...$,enumOptions:k},schema:n,uiSchema:i,registry:g,value:a,disabled:o,readonly:l,required:f,label:M,hideLabel:!z,placeholder:d,formContext:S,autofocus:c,rawErrors:v})}renderFiles(){const{schema:n,uiSchema:r,idSchema:i,name:a,disabled:o=!1,readonly:l=!1,autofocus:c=!1,required:f=!1,onBlur:d,onFocus:h,registry:m,formData:g=[],rawErrors:v}=this.props,{widgets:w,formContext:b,globalUiOptions:_,schemaUtils:S}=m,{widget:x="files",title:A,...k}=ot(r,_),T=ji(n,x,w),O=A??n.title??a,$=S.getDisplayLabel(n,r,_);return N.jsx(T,{options:k,id:i.$id,name:a,multiple:!0,onChange:this.onSelectChange,onBlur:d,onFocus:h,schema:n,uiSchema:r,value:g,disabled:o,readonly:l,required:f,registry:m,formContext:b,autofocus:c,rawErrors:v,label:O,hideLabel:!$})}renderFixedArray(){const{schema:n,uiSchema:r={},formData:i=[],errorSchema:a,idPrefix:o,idSeparator:l="_",idSchema:c,name:f,title:d,disabled:h=!1,readonly:m=!1,autofocus:g=!1,required:v=!1,registry:w,onBlur:b,onFocus:_,rawErrors:S}=this.props,{keyedFormData:x}=this.state;let{formData:A=[]}=this.props;const k=n.title||d||f,T=ot(r),{schemaUtils:O,formContext:$}=w,M=(Mt(n.items)?n.items:[]).map((H,B)=>O.retrieveSchema(H,i[B])),z=Mt(n.additionalItems)?O.retrieveSchema(n.additionalItems,i):null;(!A||A.length<M.length)&&(A=A||[],A=A.concat(new Array(M.length-A.length)));const P=this.canAddItem(A)&&!!z,q={canAdd:P,className:"field field-array field-array-fixed-items",disabled:h,idSchema:c,formData:i,items:x.map((H,B)=>{const{key:G,item:K}=H,Q=K,R=B>=M.length,V=(R&&Mt(n.additionalItems)?O.retrieveSchema(n.additionalItems,Q):M[B])||{},X=c.$id+l+B,j=O.toIdSchema(V,X,Q,o,l),I=R?r.additionalItems||{}:Array.isArray(r.items)?r.items[B]:r.items||{},U=a?a[B]:void 0;return this.renderArrayFieldItem({key:G,index:B,name:f&&`${f}-${B}`,title:k?`${k}-${B+1}`:void 0,canAdd:P,canRemove:R,canMoveUp:B>=M.length+1,canMoveDown:R&&B<A.length-1,itemSchema:V,itemData:Q,itemUiSchema:I,itemIdSchema:j,itemErrorSchema:U,autofocus:g&&B===0,onBlur:b,onFocus:_,rawErrors:S,totalItems:x.length})}),onAddClick:this.onAddClick,readonly:m,required:v,registry:w,schema:n,uiSchema:r,title:k,formContext:$,errorSchema:a,rawErrors:S},D=yt("ArrayFieldTemplate",w,T);return N.jsx(D,{...q})}renderArrayFieldItem(n){const{key:r,index:i,name:a,canAdd:o,canRemove:l=!0,canMoveUp:c,canMoveDown:f,itemSchema:d,itemData:h,itemUiSchema:m,itemIdSchema:g,itemErrorSchema:v,autofocus:w,onBlur:b,onFocus:_,rawErrors:S,totalItems:x,title:A}=n,{disabled:k,hideError:T,idPrefix:O,idSeparator:$,readonly:L,uiSchema:M,registry:z,formContext:P}=this.props,{fields:{ArraySchemaField:q,SchemaField:D},globalUiOptions:H}=z,B=q||D,{orderable:G=!0,removable:K=!0,copyable:Q=!1}=ot(M,H),R={moveUp:G&&c,moveDown:G&&f,copy:Q&&o,remove:K&&l,toolbar:!1};return R.toolbar=Object.keys(R).some(V=>R[V]),{children:N.jsx(B,{name:a,title:A,index:i,schema:d,uiSchema:m,formData:h,formContext:P,errorSchema:v,idPrefix:O,idSeparator:$,idSchema:g,required:this.isItemRequired(d),onChange:this.onChangeForIndex(i),onBlur:b,onFocus:_,registry:z,disabled:k,readonly:L,hideError:T,autofocus:w,rawErrors:S}),className:"array-item",disabled:k,canAdd:o,hasCopy:R.copy,hasToolbar:R.toolbar,hasMoveUp:R.moveUp,hasMoveDown:R.moveDown,hasRemove:R.remove,index:i,totalItems:x,key:r,onAddIndexClick:this.onAddIndexClick,onCopyIndexClick:this.onCopyIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:L,registry:z,schema:d,uiSchema:m}}}function Xhe(e){const{schema:t,name:n,uiSchema:r,idSchema:i,formData:a,registry:o,required:l,disabled:c,readonly:f,hideError:d,autofocus:h,title:m,onChange:g,onFocus:v,onBlur:w,rawErrors:b}=e,{title:_}=t,{widgets:S,formContext:x,translateString:A,globalUiOptions:k}=o,{widget:T="checkbox",title:O,label:$=!0,...L}=ot(r,k),M=ji(t,T,S),z=A(Tt.YesLabel),P=A(Tt.NoLabel);let q;const D=O??_??m??n;if(Array.isArray(t.oneOf))q=xc({oneOf:t.oneOf.map(H=>{if(Mt(H))return{...H,title:H.title||(H.const===!0?z:P)}}).filter(H=>H)},r);else{const H=t,B=t.enum??[!0,!1];!H.enumNames&&B.length===2&&B.every(G=>typeof G=="boolean")?q=[{value:B[0],label:B[0]?z:P},{value:B[1],label:B[1]?z:P}]:q=xc({enum:B,enumNames:H.enumNames},r)}return N.jsx(M,{options:{...L,enumOptions:q},schema:t,uiSchema:r,id:i.$id,name:n,onChange:g,onFocus:v,onBlur:w,label:D,hideLabel:!$,value:a,required:l,disabled:c,readonly:f,hideError:d,registry:o,formContext:x,autofocus:h,rawErrors:b})}class gD extends te.Component{constructor(n){super(n);De(this,"onOptionChange",n=>{const{selectedOption:r,retrievedOptions:i}=this.state,{formData:a,onChange:o,registry:l}=this.props,{schemaUtils:c}=l,f=n!==void 0?parseInt(n,10):-1;if(f===r)return;const d=f>=0?i[f]:void 0,h=r>=0?i[r]:void 0;let m=c.sanitizeDataForNewSchema(d,h,a);d&&(m=c.getDefaultFormState(d,m,"excludeObjectChildren")),this.setState({selectedOption:f},()=>{o(m,void 0,this.getFieldId())})});const{formData:r,options:i,registry:{schemaUtils:a}}=this.props,o=i.map(l=>a.retrieveSchema(l,r));this.state={retrievedOptions:o,selectedOption:this.getMatchingOption(0,r,o)}}componentDidUpdate(n,r){const{formData:i,options:a,idSchema:o}=this.props,{selectedOption:l}=this.state;let c=this.state;if(!It(n.options,a)){const{registry:{schemaUtils:f}}=this.props,d=a.map(h=>f.retrieveSchema(h,i));c={selectedOption:l,retrievedOptions:d}}if(!It(i,n.formData)&&o.$id===n.idSchema.$id){const{retrievedOptions:f}=c,d=this.getMatchingOption(l,i,f);r&&d!==l&&(c={selectedOption:d,retrievedOptions:f})}c!==this.state&&this.setState(c)}getMatchingOption(n,r,i){const{schema:a,registry:{schemaUtils:o}}=this.props,l=nl(a);return o.getClosestMatchingOption(r,i,n,l)}getFieldId(){const{idSchema:n,schema:r}=this.props;return`${n.$id}${r.oneOf?"__oneof_select":"__anyof_select"}`}render(){const{name:n,disabled:r=!1,errorSchema:i={},formContext:a,onBlur:o,onFocus:l,readonly:c,registry:f,schema:d,uiSchema:h}=this.props,{widgets:m,fields:g,translateString:v,globalUiOptions:w,schemaUtils:b}=f,{SchemaField:_}=g,{selectedOption:S,retrievedOptions:x}=this.state,{widget:A="select",placeholder:k,autofocus:T,autocomplete:O,title:$=d.title,...L}=ot(h,w),M=ji({type:"number"},A,m),z=Ne(i,Jn,[]),P=pp(i,[Jn]),q=b.getDisplayLabel(d,h,w),D=S>=0&&x[S]||null;let H;if(D){const{required:V}=d;H=V?Pi({required:V},D):D}let B=[];tr in d&&h&&tr in h?Array.isArray(h[tr])?B=h[tr]:console.warn(`uiSchema.oneOf is not an array for "${$||n}"`):Mr in d&&h&&Mr in h&&(Array.isArray(h[Mr])?B=h[Mr]:console.warn(`uiSchema.anyOf is not an array for "${$||n}"`));let G=h;S>=0&&B.length>S&&(G=B[S]);const K=$?Tt.TitleOptionPrefix:Tt.OptionPrefix,Q=$?[$]:[],R=x.map((V,X)=>{const{title:j=V.title}=ot(B[X]);return{label:j||v(K,Q.concat(String(X+1))),value:X}});return N.jsxs("div",{className:"panel panel-default panel-body",children:[N.jsx("div",{className:"form-group",children:N.jsx(M,{id:this.getFieldId(),name:`${n}${d.oneOf?"__oneof_select":"__anyof_select"}`,schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:o,onFocus:l,disabled:r||tl(R),multiple:!1,rawErrors:z,errorSchema:P,value:S>=0?S:void 0,options:{enumOptions:R,...L},registry:f,formContext:a,placeholder:k,autocomplete:O,autofocus:T,label:$??n,hideLabel:!q,readonly:c})}),H&&H.type!=="null"&&N.jsx(_,{...this.props,schema:H,uiSchema:G})]})}}const Whe=/\.([0-9]*0)*$/,Qhe=/[0.]0*$/;function Jhe(e){const{registry:t,onChange:n,formData:r,value:i}=e,[a,o]=te.useState(i),{StringField:l}=t.fields;let c=r;const f=te.useCallback((d,h,m)=>{o(d),`${d}`.charAt(0)==="."&&(d=`0${d}`);const g=typeof d=="string"&&d.match(Whe)?TR(d.replace(Qhe,"")):TR(d);n(g,h,m)},[n]);if(typeof a=="string"&&typeof c=="number"){const d=new RegExp(`^(${String(c).replace(".","\\.")})?\\.?0*$`);a.match(d)&&(c=a)}return N.jsx(l,{...e,formData:c,onChange:f})}function ds(){return ds=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ds.apply(this,arguments)}const epe=["children","options"],yD=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{class:"className",for:"htmlFor"}),bD={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},tpe=["style","script","pre"],npe=["src","href","data","formAction","srcDoc","action"],rpe=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,ipe=/mailto:/i,ape=/\n{2,}$/,vD=/^(\s*>[\s\S]*?)(?=\n\n|$)/,spe=/^ *> ?/gm,ope=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,lpe=/^ {2,}\n/,upe=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,_D=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,xD=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,cpe=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,fpe=/^(?:\n *)*\n/,dpe=/\r\n?/g,hpe=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,ppe=/^\[\^([^\]]+)]/,mpe=/\f/g,gpe=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,ype=/^\s*?\[(x|\s)\]/,wD=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,SD=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,ED=/^([^\n]+)\n *(=|-){3,} *\n/,jx=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,bpe=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,kD=/^<!--[\s\S]*?(?:-->)/,vpe=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,Mx=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,_pe=/^\{.*\}$/,xpe=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,wpe=/^<([^ >]+@[^ >]+)>/,Spe=/^<([^ >]+:\/[^ >]+)>/,Epe=/-([a-z])?/gi,AD=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,kpe=/^[^\n]+(?: \n|\n{2,})/,Ape=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,Tpe=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,Cpe=/^\[([^\]]*)\] ?\[([^\]]*)\]/,Ope=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,Npe=/\t/g,Rpe=/(^ *\||\| *$)/g,jpe=/^ *:-+: *$/,Mpe=/^ *:-+ *$/,$pe=/^ *-+: *$/,fm=e=>`(?=[\\s\\S]+?\\1${e?"\\1":""})`,dm="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",Dpe=RegExp(`^([*_])\\1${fm(1)}${dm}\\1\\1(?!\\1)`),Ipe=RegExp(`^([*_])${fm(0)}${dm}\\1(?!\\1)`),Ppe=RegExp(`^(==)${fm(0)}${dm}\\1`),Lpe=RegExp(`^(~~)${fm(0)}${dm}\\1`),zpe=/^(:[a-zA-Z0-9-_]+:)/,qpe=/^\\([^0-9A-Za-z\s])/,Fpe=/\\([^0-9A-Za-z\s])/g,Bpe=/^[\s\S](?:(?! \n|[0-9]\.|http)[^=*_~\-\n:<`\\\[!])*/,Upe=/^\n+/,Vpe=/^([ \t]*)/,Hpe=/(?:^|\n)( *)$/,PE="(?:\\d+\\.)",LE="(?:[*+-])";function PL(e){return"( *)("+(e===1?PE:LE)+") +"}const LL=PL(1),zL=PL(2);function qL(e){return RegExp("^"+(e===1?LL:zL))}const Gpe=qL(1),Ype=qL(2);function FL(e){return RegExp("^"+(e===1?LL:zL)+"[^\\n]*(?:\\n(?!\\1"+(e===1?PE:LE)+" )[^\\n]*)*(\\n|$)","gm")}const Zpe=FL(1),Kpe=FL(2);function BL(e){const t=e===1?PE:LE;return RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const UL=BL(1),VL=BL(2);function TD(e,t){const n=t===1,r=n?UL:VL,i=n?Zpe:Kpe,a=n?Gpe:Ype;return{t:o=>a.test(o),o:il(function(o,l){const c=Hpe.exec(l.prevCapture);return c&&(l.list||!l.inline&&!l.simple)?r.exec(o=c[1]+o):null}),i:1,u(o,l,c){const f=n?+o[2]:void 0,d=o[0].replace(ape,`
|
|
245
|
+
*/var cD;function Ahe(){if(cD)return mt;cD=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),v;v=Symbol.for("react.module.reference");function w(b){if(typeof b=="object"&&b!==null){var _=b.$$typeof;switch(_){case e:switch(b=b.type,b){case n:case i:case r:case f:case d:return b;default:switch(b=b&&b.$$typeof,b){case l:case o:case c:case m:case h:case a:return b;default:return _}}case t:return _}}}return mt.ContextConsumer=o,mt.ContextProvider=a,mt.Element=e,mt.ForwardRef=c,mt.Fragment=n,mt.Lazy=m,mt.Memo=h,mt.Portal=t,mt.Profiler=i,mt.StrictMode=r,mt.Suspense=f,mt.SuspenseList=d,mt.isAsyncMode=function(){return!1},mt.isConcurrentMode=function(){return!1},mt.isContextConsumer=function(b){return w(b)===o},mt.isContextProvider=function(b){return w(b)===a},mt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},mt.isForwardRef=function(b){return w(b)===c},mt.isFragment=function(b){return w(b)===n},mt.isLazy=function(b){return w(b)===m},mt.isMemo=function(b){return w(b)===h},mt.isPortal=function(b){return w(b)===t},mt.isProfiler=function(b){return w(b)===i},mt.isStrictMode=function(b){return w(b)===r},mt.isSuspense=function(b){return w(b)===f},mt.isSuspenseList=function(b){return w(b)===d},mt.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===f||b===d||b===g||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===h||b.$$typeof===a||b.$$typeof===o||b.$$typeof===c||b.$$typeof===v||b.getModuleId!==void 0)},mt.typeOf=w,mt}var fD;function The(){return fD||(fD=1,Ox.exports=Ahe()),Ox.exports}var Che=The();const dD=zn(Che),Nx={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",time:"TimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function Ohe(e){let t=Ne(e,"MergedWidget");if(!t){const n=e.defaultProps&&e.defaultProps.options||{};t=({options:r,...i})=>N.jsx(e,{options:{...n,...r},...i}),mn(e,"MergedWidget",t)}return t}function ji(e,t,n={}){const r=Ii(e);if(typeof t=="function"||t&&dD.isForwardRef(te.createElement(t))||dD.isMemo(t))return Ohe(t);if(typeof t!="string")throw new Error(`Unsupported widget definition: ${typeof t}`);if(t in n){const i=n[t];return ji(e,i,n)}if(typeof r=="string"){if(!(r in Nx))throw new Error(`No widget for type '${r}'`);if(t in Nx[r]){const i=n[Nx[r][t]];return ji(e,i,n)}}throw new Error(`No widget '${t}' for type '${r}'`)}function Nhe(e){let t=0;for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return t.toString(16)}function Rhe(e){const t=new Set;return JSON.stringify(e,(n,r)=>(t.add(n),r)),Nhe(JSON.stringify(e,Array.from(t).sort()))}function jhe(e,t,n={}){try{return ji(e,t,n),!0}catch(r){const i=r;if(i.message&&(i.message.startsWith("No widget")||i.message.startsWith("Unsupported widget")))return!1;throw r}}function Bc(e,t){return`${Wp(e)?e:e[Ra]}__${t}`}function Uc(e){return Bc(e,"description")}function RL(e){return Bc(e,"error")}function Xw(e){return Bc(e,"examples")}function jL(e){return Bc(e,"help")}function ML(e){return Bc(e,"title")}function Is(e,t=!1){const n=t?` ${Xw(e)}`:"";return`${RL(e)} ${Uc(e)} ${jL(e)}${n}`}function $L(e,t){return`${e}-${t}`}function Mhe(e,t,n){return t?n:e}function $he(e){return e?new Date(e).toJSON():void 0}function Dhe(e,t){if(!Array.isArray(t))return e;const n=d=>d.reduce((h,m)=>(h[m]=!0,h),{}),r=d=>d.length>1?`properties '${d.join("', '")}'`:`property '${d[0]}'`,i=n(e),a=t.filter(d=>d==="*"||i[d]),o=n(a),l=e.filter(d=>!o[d]),c=a.indexOf("*");if(c===-1){if(l.length)throw new Error(`uiSchema order list does not contain ${r(l)}`);return a}if(c!==a.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const f=[...a];return f.splice(c,1,...l),f}function Rx(e,t=!0){if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};const n=new Date(e);if(Number.isNaN(n.getTime()))throw new Error("Unable to parse date "+e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:t?n.getUTCHours():0,minute:t?n.getUTCMinutes():0,second:t?n.getUTCSeconds():0}}function Rh(e){if(e.const||e.enum&&e.enum.length===1&&e.enum[0]===!0)return!0;if(e.anyOf&&e.anyOf.length===1)return Rh(e.anyOf[0]);if(e.oneOf&&e.oneOf.length===1)return Rh(e.oneOf[0]);if(e.allOf){const t=n=>Rh(n);return e.allOf.some(t)}return!1}function Ihe(e,t,n){const{props:r,state:i}=e;return!It(r,t)||!It(i,n)}function hD(e,t=!0){const{year:n,month:r,day:i,hour:a=0,minute:o=0,second:l=0}=e,c=Date.UTC(n,r-1,i,a,o,l),f=new Date(c).toJSON();return t?f:f.slice(0,10)}function wc(e,t=[]){if(!e)return[];let n=[];return Jn in e&&(n=n.concat(e[Jn].map(r=>{const i=`.${t.join(".")}`;return{property:i,message:r,stack:`${i} ${r}`}}))),Object.keys(e).reduce((r,i)=>{if(i!==Jn){const a=e[i];Ss(a)&&(r=r.concat(wc(a,[...t,i])))}return r},n)}function DL(e){return an(e)?Zp(e,Ns):Ic(e)?[e]:WS(r6(YS(e)))}function Phe(e){const t=new xhe;return e.length&&e.forEach(n=>{const{property:r,message:i}=n,a=r==="."?[]:DL(r);a.length>0&&a[0]===""&&a.splice(0,1),i&&t.addErrors(i,a)}),t.ErrorSchema}function DE(e){return Object.keys(e).reduce((t,n)=>{if(n==="addError")return t;{const r=e[n];return Ss(r)?{...t,[n]:DE(r)}:{...t,[n]:r}}},{})}function Lhe(e){if(!e)return"";const t=new Date(e),n=ka(t.getFullYear(),4),r=ka(t.getMonth()+1,2),i=ka(t.getDate(),2),a=ka(t.getHours(),2),o=ka(t.getMinutes(),2),l=ka(t.getSeconds(),2),c=ka(t.getMilliseconds(),3);return`${n}-${r}-${i}T${a}:${o}:${l}.${c}`}function jh(e,t){if(!t)return e;const{errors:n,errorSchema:r}=e;let i=wc(t),a=t;return tl(r)||(a=Oi(r,t,!0),i=[...n].concat(i)),{errorSchema:a,errors:i}}function zhe(e){for(const t in e){const n=e,r=n[t];t===rn&&typeof r=="string"&&r.startsWith("#")?n[t]=UP+r:n[t]=IE(r)}return e}function qhe(e){for(let t=0;t<e.length;t++)e[t]=IE(e[t]);return e}function IE(e){return Array.isArray(e)?qhe([...e]):Mt(e)?zhe({...e}):e}function IL(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],l=Kp(e,o);n(l,o)&&rE(a,cl(o,e),l)}return a}function Fhe(e,t){if(e==null)return{};var n=Zp(QS(e),function(r){return[r]});return t=tE(t),IL(e,n,function(r,i){return t(r,i[0])})}var Bhe=200;function Uhe(e,t,n,r){var i=-1,a=M6,o=!0,l=e.length,c=[],f=t.length;if(!l)return c;t.length>=Bhe&&(a=zS,o=!1,t=new Qo(t));e:for(;++i<l;){var d=e[i],h=d;if(d=d!==0?d:0,o&&h===h){for(var m=f;m--;)if(t[m]===h)continue e;c.push(d)}else a(t,h,r)||c.push(d)}return c}var Vhe=iE(function(e,t){return mp(e)?Uhe(e,Lc(t,1,mp,!0)):[]});function Hhe(e,t){const n=Ss(e),r=Ss(t);if(e===t||!n&&!r)return[];if(n&&!r)return Yr(e);if(!n&&r)return Yr(t);{const i=Yr(Fhe(e,(o,l)=>!It(o,Ne(t,l)))),a=Vhe(Yr(t),Yr(e));return[...i,...a]}}var Tt;(function(e){e.ArrayItemTitle="Item",e.MissingItems="Missing items definition",e.YesLabel="Yes",e.NoLabel="No",e.CloseLabel="Close",e.ErrorsLabel="Errors",e.NewStringDefault="New Value",e.AddButton="Add",e.AddItemButton="Add Item",e.CopyButton="Copy",e.MoveDownButton="Move down",e.MoveUpButton="Move up",e.RemoveButton="Remove",e.NowLabel="Now",e.ClearLabel="Clear",e.AriaDateLabel="Select a date",e.PreviewLabel="Preview",e.DecrementAriaLabel="Decrease value by 1",e.IncrementAriaLabel="Increase value by 1",e.UnknownFieldType="Unknown field type %1",e.OptionPrefix="Option %1",e.TitleOptionPrefix="%1 option %2",e.KeyLabel="%1 Key",e.InvalidObjectField='Invalid "%1" object field configuration: _%2_.',e.UnsupportedField="Unsupported field schema.",e.UnsupportedFieldWithId="Unsupported field schema for field `%1`.",e.UnsupportedFieldWithReason="Unsupported field schema: _%1_.",e.UnsupportedFieldWithIdAndReason="Unsupported field schema for field `%1`: _%2_.",e.FilesInfo="**%1** (%2, %3 bytes)"})(Tt||(Tt={}));function Ghe(e,t){var n=an(e)?ZS:E6;return n(e,C6(t))}function Yhe(e,t){return IL(e,t,function(n,r){return T6(e,r)})}var pD=y6(function(e,t){return e==null?{}:Yhe(e,t)}),Zhe=0;function Khe(e){var t=++Zhe;return YS(e)+t}function Ww(){return Khe("rjsf-array-item-")}function mD(e){return Array.isArray(e)?e.map(t=>({key:Ww(),item:t})):[]}function Ru(e){return Array.isArray(e)?e.map(t=>t.item):[]}class Xhe extends te.Component{constructor(n){super(n);De(this,"_getNewFormDataRow",()=>{const{schema:n,registry:r}=this.props,{schemaUtils:i}=r;let a=n.items;return Zw(n)&&Xie(n)&&(a=n.additionalItems),i.getDefaultFormState(a)});De(this,"onAddClick",n=>{this._handleAddClick(n)});De(this,"onAddIndexClick",n=>r=>{this._handleAddClick(r,n)});De(this,"onCopyIndexClick",n=>r=>{r&&r.preventDefault();const{onChange:i,errorSchema:a}=this.props,{keyedFormData:o}=this.state;let l;if(a){l={};for(const d in a){const h=parseInt(d);h<=n?mn(l,[h],a[d]):h>n&&mn(l,[h+1],a[d])}}const c={key:Ww(),item:NL(o[n].item)},f=[...o];n!==void 0?f.splice(n+1,0,c):f.push(c),this.setState({keyedFormData:f,updatedKeyedFormData:!0},()=>i(Ru(f),l))});De(this,"onDropIndexClick",n=>r=>{r&&r.preventDefault();const{onChange:i,errorSchema:a}=this.props,{keyedFormData:o}=this.state;let l;if(a){l={};for(const f in a){const d=parseInt(f);d<n?mn(l,[d],a[f]):d>n&&mn(l,[d-1],a[f])}}const c=o.filter((f,d)=>d!==n);this.setState({keyedFormData:c,updatedKeyedFormData:!0},()=>i(Ru(c),l))});De(this,"onReorderClick",(n,r)=>i=>{i&&(i.preventDefault(),i.currentTarget.blur());const{onChange:a,errorSchema:o}=this.props;let l;if(o){l={};for(const h in o){const m=parseInt(h);m==n?mn(l,[r],o[n]):m==r?mn(l,[n],o[r]):mn(l,[h],o[m])}}const{keyedFormData:c}=this.state;function f(){const h=c.slice();return h.splice(n,1),h.splice(r,0,c[n]),h}const d=f();this.setState({keyedFormData:d},()=>a(Ru(d),l))});De(this,"onChangeForIndex",n=>(r,i,a)=>{const{formData:o,onChange:l,errorSchema:c}=this.props,d=(Array.isArray(o)?o:[]).map((h,m)=>n===m?typeof r>"u"?null:r:h);l(d,c&&c&&{...c,[n]:i},a)});De(this,"onSelectChange",n=>{const{onChange:r,idSchema:i}=this.props;r(n,void 0,i&&i.$id)});const{formData:r=[]}=n,i=mD(r);this.state={keyedFormData:i,updatedKeyedFormData:!1}}static getDerivedStateFromProps(n,r){if(r.updatedKeyedFormData)return{updatedKeyedFormData:!1};const i=Array.isArray(n.formData)?n.formData:[],a=r.keyedFormData||[];return{keyedFormData:i.length===a.length?a.map((l,c)=>({key:l.key,item:i[c]})):mD(i)}}get itemTitle(){const{schema:n,registry:r}=this.props,{translateString:i}=r;return Ne(n,[Ma,"title"],Ne(n,[Ma,"description"],i(Tt.ArrayItemTitle)))}isItemRequired(n){return Array.isArray(n.type)?!n.type.includes("null"):n.type!=="null"}canAddItem(n){const{schema:r,uiSchema:i,registry:a}=this.props;let{addable:o}=ot(i,a.globalUiOptions);return o!==!1&&(r.maxItems!==void 0?o=n.length<r.maxItems:o=!0),o}_handleAddClick(n,r){n&&n.preventDefault();const{onChange:i,errorSchema:a}=this.props,{keyedFormData:o}=this.state;let l;if(a){l={};for(const d in a){const h=parseInt(d);r===void 0||h<r?mn(l,[h],a[d]):h>=r&&mn(l,[h+1],a[d])}}const c={key:Ww(),item:this._getNewFormDataRow()},f=[...o];r!==void 0?f.splice(r,0,c):f.push(c),this.setState({keyedFormData:f,updatedKeyedFormData:!0},()=>i(Ru(f),l))}render(){const{schema:n,uiSchema:r,idSchema:i,registry:a}=this.props,{schemaUtils:o,translateString:l}=a;if(!(Ma in n)){const c=ot(r),f=yt("UnsupportedFieldTemplate",a,c);return N.jsx(f,{schema:n,idSchema:i,reason:l(Tt.MissingItems),registry:a})}return o.isMultiSelect(n)?this.renderMultiSelect():TL(r)?this.renderCustomWidget():Zw(n)?this.renderFixedArray():o.isFilesArray(n,r)?this.renderFiles():this.renderNormalArray()}renderNormalArray(){const{schema:n,uiSchema:r={},errorSchema:i,idSchema:a,name:o,title:l,disabled:c=!1,readonly:f=!1,autofocus:d=!1,required:h=!1,registry:m,onBlur:g,onFocus:v,idPrefix:w,idSeparator:b="_",rawErrors:_}=this.props,{keyedFormData:S}=this.state,x=n.title||l||o,{schemaUtils:A,formContext:k}=m,T=ot(r),O=Mt(n.items)?n.items:{},$=A.retrieveSchema(O),L=Ru(this.state.keyedFormData),M=this.canAddItem(L),z={canAdd:M,items:S.map((q,D)=>{const{key:H,item:B}=q,G=B,K=A.retrieveSchema(O,G),Q=i?i[D]:void 0,R=a.$id+b+D,V=A.toIdSchema(K,R,G,w,b);return this.renderArrayFieldItem({key:H,index:D,name:o&&`${o}-${D}`,title:x?`${x}-${D+1}`:void 0,canAdd:M,canMoveUp:D>0,canMoveDown:D<L.length-1,itemSchema:K,itemIdSchema:V,itemErrorSchema:Q,itemData:G,itemUiSchema:r.items,autofocus:d&&D===0,onBlur:g,onFocus:v,rawErrors:_,totalItems:S.length})}),className:`field field-array field-array-of-${$.type}`,disabled:c,idSchema:a,uiSchema:r,onAddClick:this.onAddClick,readonly:f,required:h,schema:n,title:x,formContext:k,formData:L,rawErrors:_,registry:m},P=yt("ArrayFieldTemplate",m,T);return N.jsx(P,{...z})}renderCustomWidget(){const{schema:n,idSchema:r,uiSchema:i,disabled:a=!1,readonly:o=!1,autofocus:l=!1,required:c=!1,hideError:f,placeholder:d,onBlur:h,onFocus:m,formData:g=[],registry:v,rawErrors:w,name:b}=this.props,{widgets:_,formContext:S,globalUiOptions:x,schemaUtils:A}=v,{widget:k,title:T,...O}=ot(i,x),$=ji(n,k,_),L=T??n.title??b,M=A.getDisplayLabel(n,i,x);return N.jsx($,{id:r.$id,name:b,multiple:!0,onChange:this.onSelectChange,onBlur:h,onFocus:m,options:O,schema:n,uiSchema:i,registry:v,value:g,disabled:a,readonly:o,hideError:f,required:c,label:L,hideLabel:!M,placeholder:d,formContext:S,autofocus:l,rawErrors:w})}renderMultiSelect(){const{schema:n,idSchema:r,uiSchema:i,formData:a=[],disabled:o=!1,readonly:l=!1,autofocus:c=!1,required:f=!1,placeholder:d,onBlur:h,onFocus:m,registry:g,rawErrors:v,name:w}=this.props,{widgets:b,schemaUtils:_,formContext:S,globalUiOptions:x}=g,A=_.retrieveSchema(n.items,a),k=xc(A,i),{widget:T="select",title:O,...$}=ot(i,x),L=ji(n,T,b),M=O??n.title??w,z=_.getDisplayLabel(n,i,x);return N.jsx(L,{id:r.$id,name:w,multiple:!0,onChange:this.onSelectChange,onBlur:h,onFocus:m,options:{...$,enumOptions:k},schema:n,uiSchema:i,registry:g,value:a,disabled:o,readonly:l,required:f,label:M,hideLabel:!z,placeholder:d,formContext:S,autofocus:c,rawErrors:v})}renderFiles(){const{schema:n,uiSchema:r,idSchema:i,name:a,disabled:o=!1,readonly:l=!1,autofocus:c=!1,required:f=!1,onBlur:d,onFocus:h,registry:m,formData:g=[],rawErrors:v}=this.props,{widgets:w,formContext:b,globalUiOptions:_,schemaUtils:S}=m,{widget:x="files",title:A,...k}=ot(r,_),T=ji(n,x,w),O=A??n.title??a,$=S.getDisplayLabel(n,r,_);return N.jsx(T,{options:k,id:i.$id,name:a,multiple:!0,onChange:this.onSelectChange,onBlur:d,onFocus:h,schema:n,uiSchema:r,value:g,disabled:o,readonly:l,required:f,registry:m,formContext:b,autofocus:c,rawErrors:v,label:O,hideLabel:!$})}renderFixedArray(){const{schema:n,uiSchema:r={},formData:i=[],errorSchema:a,idPrefix:o,idSeparator:l="_",idSchema:c,name:f,title:d,disabled:h=!1,readonly:m=!1,autofocus:g=!1,required:v=!1,registry:w,onBlur:b,onFocus:_,rawErrors:S}=this.props,{keyedFormData:x}=this.state;let{formData:A=[]}=this.props;const k=n.title||d||f,T=ot(r),{schemaUtils:O,formContext:$}=w,M=(Mt(n.items)?n.items:[]).map((H,B)=>O.retrieveSchema(H,i[B])),z=Mt(n.additionalItems)?O.retrieveSchema(n.additionalItems,i):null;(!A||A.length<M.length)&&(A=A||[],A=A.concat(new Array(M.length-A.length)));const P=this.canAddItem(A)&&!!z,q={canAdd:P,className:"field field-array field-array-fixed-items",disabled:h,idSchema:c,formData:i,items:x.map((H,B)=>{const{key:G,item:K}=H,Q=K,R=B>=M.length,V=(R&&Mt(n.additionalItems)?O.retrieveSchema(n.additionalItems,Q):M[B])||{},X=c.$id+l+B,j=O.toIdSchema(V,X,Q,o,l),I=R?r.additionalItems||{}:Array.isArray(r.items)?r.items[B]:r.items||{},U=a?a[B]:void 0;return this.renderArrayFieldItem({key:G,index:B,name:f&&`${f}-${B}`,title:k?`${k}-${B+1}`:void 0,canAdd:P,canRemove:R,canMoveUp:B>=M.length+1,canMoveDown:R&&B<A.length-1,itemSchema:V,itemData:Q,itemUiSchema:I,itemIdSchema:j,itemErrorSchema:U,autofocus:g&&B===0,onBlur:b,onFocus:_,rawErrors:S,totalItems:x.length})}),onAddClick:this.onAddClick,readonly:m,required:v,registry:w,schema:n,uiSchema:r,title:k,formContext:$,errorSchema:a,rawErrors:S},D=yt("ArrayFieldTemplate",w,T);return N.jsx(D,{...q})}renderArrayFieldItem(n){const{key:r,index:i,name:a,canAdd:o,canRemove:l=!0,canMoveUp:c,canMoveDown:f,itemSchema:d,itemData:h,itemUiSchema:m,itemIdSchema:g,itemErrorSchema:v,autofocus:w,onBlur:b,onFocus:_,rawErrors:S,totalItems:x,title:A}=n,{disabled:k,hideError:T,idPrefix:O,idSeparator:$,readonly:L,uiSchema:M,registry:z,formContext:P}=this.props,{fields:{ArraySchemaField:q,SchemaField:D},globalUiOptions:H}=z,B=q||D,{orderable:G=!0,removable:K=!0,copyable:Q=!1}=ot(M,H),R={moveUp:G&&c,moveDown:G&&f,copy:Q&&o,remove:K&&l,toolbar:!1};return R.toolbar=Object.keys(R).some(V=>R[V]),{children:N.jsx(B,{name:a,title:A,index:i,schema:d,uiSchema:m,formData:h,formContext:P,errorSchema:v,idPrefix:O,idSeparator:$,idSchema:g,required:this.isItemRequired(d),onChange:this.onChangeForIndex(i),onBlur:b,onFocus:_,registry:z,disabled:k,readonly:L,hideError:T,autofocus:w,rawErrors:S}),className:"array-item",disabled:k,canAdd:o,hasCopy:R.copy,hasToolbar:R.toolbar,hasMoveUp:R.moveUp,hasMoveDown:R.moveDown,hasRemove:R.remove,index:i,totalItems:x,key:r,onAddIndexClick:this.onAddIndexClick,onCopyIndexClick:this.onCopyIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:L,registry:z,schema:d,uiSchema:m}}}function Whe(e){const{schema:t,name:n,uiSchema:r,idSchema:i,formData:a,registry:o,required:l,disabled:c,readonly:f,hideError:d,autofocus:h,title:m,onChange:g,onFocus:v,onBlur:w,rawErrors:b}=e,{title:_}=t,{widgets:S,formContext:x,translateString:A,globalUiOptions:k}=o,{widget:T="checkbox",title:O,label:$=!0,...L}=ot(r,k),M=ji(t,T,S),z=A(Tt.YesLabel),P=A(Tt.NoLabel);let q;const D=O??_??m??n;if(Array.isArray(t.oneOf))q=xc({oneOf:t.oneOf.map(H=>{if(Mt(H))return{...H,title:H.title||(H.const===!0?z:P)}}).filter(H=>H)},r);else{const H=t,B=t.enum??[!0,!1];!H.enumNames&&B.length===2&&B.every(G=>typeof G=="boolean")?q=[{value:B[0],label:B[0]?z:P},{value:B[1],label:B[1]?z:P}]:q=xc({enum:B,enumNames:H.enumNames},r)}return N.jsx(M,{options:{...L,enumOptions:q},schema:t,uiSchema:r,id:i.$id,name:n,onChange:g,onFocus:v,onBlur:w,label:D,hideLabel:!$,value:a,required:l,disabled:c,readonly:f,hideError:d,registry:o,formContext:x,autofocus:h,rawErrors:b})}class gD extends te.Component{constructor(n){super(n);De(this,"onOptionChange",n=>{const{selectedOption:r,retrievedOptions:i}=this.state,{formData:a,onChange:o,registry:l}=this.props,{schemaUtils:c}=l,f=n!==void 0?parseInt(n,10):-1;if(f===r)return;const d=f>=0?i[f]:void 0,h=r>=0?i[r]:void 0;let m=c.sanitizeDataForNewSchema(d,h,a);d&&(m=c.getDefaultFormState(d,m,"excludeObjectChildren")),this.setState({selectedOption:f},()=>{o(m,void 0,this.getFieldId())})});const{formData:r,options:i,registry:{schemaUtils:a}}=this.props,o=i.map(l=>a.retrieveSchema(l,r));this.state={retrievedOptions:o,selectedOption:this.getMatchingOption(0,r,o)}}componentDidUpdate(n,r){const{formData:i,options:a,idSchema:o}=this.props,{selectedOption:l}=this.state;let c=this.state;if(!It(n.options,a)){const{registry:{schemaUtils:f}}=this.props,d=a.map(h=>f.retrieveSchema(h,i));c={selectedOption:l,retrievedOptions:d}}if(!It(i,n.formData)&&o.$id===n.idSchema.$id){const{retrievedOptions:f}=c,d=this.getMatchingOption(l,i,f);r&&d!==l&&(c={selectedOption:d,retrievedOptions:f})}c!==this.state&&this.setState(c)}getMatchingOption(n,r,i){const{schema:a,registry:{schemaUtils:o}}=this.props,l=nl(a);return o.getClosestMatchingOption(r,i,n,l)}getFieldId(){const{idSchema:n,schema:r}=this.props;return`${n.$id}${r.oneOf?"__oneof_select":"__anyof_select"}`}render(){const{name:n,disabled:r=!1,errorSchema:i={},formContext:a,onBlur:o,onFocus:l,readonly:c,registry:f,schema:d,uiSchema:h}=this.props,{widgets:m,fields:g,translateString:v,globalUiOptions:w,schemaUtils:b}=f,{SchemaField:_}=g,{selectedOption:S,retrievedOptions:x}=this.state,{widget:A="select",placeholder:k,autofocus:T,autocomplete:O,title:$=d.title,...L}=ot(h,w),M=ji({type:"number"},A,m),z=Ne(i,Jn,[]),P=pp(i,[Jn]),q=b.getDisplayLabel(d,h,w),D=S>=0&&x[S]||null;let H;if(D){const{required:V}=d;H=V?Pi({required:V},D):D}let B=[];tr in d&&h&&tr in h?Array.isArray(h[tr])?B=h[tr]:console.warn(`uiSchema.oneOf is not an array for "${$||n}"`):Mr in d&&h&&Mr in h&&(Array.isArray(h[Mr])?B=h[Mr]:console.warn(`uiSchema.anyOf is not an array for "${$||n}"`));let G=h;S>=0&&B.length>S&&(G=B[S]);const K=$?Tt.TitleOptionPrefix:Tt.OptionPrefix,Q=$?[$]:[],R=x.map((V,X)=>{const{title:j=V.title}=ot(B[X]);return{label:j||v(K,Q.concat(String(X+1))),value:X}});return N.jsxs("div",{className:"panel panel-default panel-body",children:[N.jsx("div",{className:"form-group",children:N.jsx(M,{id:this.getFieldId(),name:`${n}${d.oneOf?"__oneof_select":"__anyof_select"}`,schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:o,onFocus:l,disabled:r||tl(R),multiple:!1,rawErrors:z,errorSchema:P,value:S>=0?S:void 0,options:{enumOptions:R,...L},registry:f,formContext:a,placeholder:k,autocomplete:O,autofocus:T,label:$??n,hideLabel:!q,readonly:c})}),H&&H.type!=="null"&&N.jsx(_,{...this.props,schema:H,uiSchema:G})]})}}const Qhe=/\.([0-9]*0)*$/,Jhe=/[0.]0*$/;function epe(e){const{registry:t,onChange:n,formData:r,value:i}=e,[a,o]=te.useState(i),{StringField:l}=t.fields;let c=r;const f=te.useCallback((d,h,m)=>{o(d),`${d}`.charAt(0)==="."&&(d=`0${d}`);const g=typeof d=="string"&&d.match(Qhe)?TR(d.replace(Jhe,"")):TR(d);n(g,h,m)},[n]);if(typeof a=="string"&&typeof c=="number"){const d=new RegExp(`^(${String(c).replace(".","\\.")})?\\.?0*$`);a.match(d)&&(c=a)}return N.jsx(l,{...e,formData:c,onChange:f})}function ds(){return ds=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ds.apply(this,arguments)}const tpe=["children","options"],yD=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{class:"className",for:"htmlFor"}),bD={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},npe=["style","script","pre"],rpe=["src","href","data","formAction","srcDoc","action"],ipe=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,ape=/mailto:/i,spe=/\n{2,}$/,vD=/^(\s*>[\s\S]*?)(?=\n\n|$)/,ope=/^ *> ?/gm,lpe=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,upe=/^ {2,}\n/,cpe=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,_D=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,xD=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,fpe=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,dpe=/^(?:\n *)*\n/,hpe=/\r\n?/g,ppe=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,mpe=/^\[\^([^\]]+)]/,gpe=/\f/g,ype=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,bpe=/^\s*?\[(x|\s)\]/,wD=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,SD=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,ED=/^([^\n]+)\n *(=|-){3,} *\n/,jx=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,vpe=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,kD=/^<!--[\s\S]*?(?:-->)/,_pe=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,Mx=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,xpe=/^\{.*\}$/,wpe=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,Spe=/^<([^ >]+@[^ >]+)>/,Epe=/^<([^ >]+:\/[^ >]+)>/,kpe=/-([a-z])?/gi,AD=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,Ape=/^[^\n]+(?: \n|\n{2,})/,Tpe=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,Cpe=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,Ope=/^\[([^\]]*)\] ?\[([^\]]*)\]/,Npe=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,Rpe=/\t/g,jpe=/(^ *\||\| *$)/g,Mpe=/^ *:-+: *$/,$pe=/^ *:-+ *$/,Dpe=/^ *-+: *$/,fm=e=>`(?=[\\s\\S]+?\\1${e?"\\1":""})`,dm="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",Ipe=RegExp(`^([*_])\\1${fm(1)}${dm}\\1\\1(?!\\1)`),Ppe=RegExp(`^([*_])${fm(0)}${dm}\\1(?!\\1)`),Lpe=RegExp(`^(==)${fm(0)}${dm}\\1`),zpe=RegExp(`^(~~)${fm(0)}${dm}\\1`),qpe=/^(:[a-zA-Z0-9-_]+:)/,Fpe=/^\\([^0-9A-Za-z\s])/,Bpe=/\\([^0-9A-Za-z\s])/g,Upe=/^[\s\S](?:(?! \n|[0-9]\.|http)[^=*_~\-\n:<`\\\[!])*/,Vpe=/^\n+/,Hpe=/^([ \t]*)/,Gpe=/(?:^|\n)( *)$/,PE="(?:\\d+\\.)",LE="(?:[*+-])";function PL(e){return"( *)("+(e===1?PE:LE)+") +"}const LL=PL(1),zL=PL(2);function qL(e){return RegExp("^"+(e===1?LL:zL))}const Ype=qL(1),Zpe=qL(2);function FL(e){return RegExp("^"+(e===1?LL:zL)+"[^\\n]*(?:\\n(?!\\1"+(e===1?PE:LE)+" )[^\\n]*)*(\\n|$)","gm")}const Kpe=FL(1),Xpe=FL(2);function BL(e){const t=e===1?PE:LE;return RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const UL=BL(1),VL=BL(2);function TD(e,t){const n=t===1,r=n?UL:VL,i=n?Kpe:Xpe,a=n?Ype:Zpe;return{t:o=>a.test(o),o:il(function(o,l){const c=Gpe.exec(l.prevCapture);return c&&(l.list||!l.inline&&!l.simple)?r.exec(o=c[1]+o):null}),i:1,u(o,l,c){const f=n?+o[2]:void 0,d=o[0].replace(spe,`
|
|
246
246
|
`).match(i);let h=!1;return{items:d.map(function(m,g){const v=a.exec(m)[0].length,w=RegExp("^ {1,"+v+"}","gm"),b=m.replace(w,"").replace(a,""),_=g===d.length-1,S=b.indexOf(`
|
|
247
247
|
|
|
248
248
|
`)!==-1||_&&h;h=S;const x=c.inline,A=c.list;let k;c.list=!0,S?(c.inline=!1,k=Qu(b)+`
|
|
249
249
|
|
|
250
|
-
`):(c.inline=!0,k=Qu(b));const T=l(k,c);return c.inline=x,c.list=A,T}),ordered:n,start:f}},l:(o,l,c)=>e(o.ordered?"ol":"ul",{key:c.key,start:o.type==="20"?o.start:void 0},o.items.map(function(f,d){return e("li",{key:d},l(f,c))}))}}const
|
|
251
|
-
`).map(function(f){return CD(f,l,c,!0)})}(e[3],t,n):[],a=CD(e[1],t,n,!!i.length);return n.inline=!1,i.length?{align:r,cells:i,header:a,type:"25"}:{children:a,type:"21"}}function OD(e,t){return e.align[t]==null?{}:{textAlign:e.align[t]}}function il(e){return e.inline=1,e}function wa(e){return il(function(t,n){return n.inline?e.exec(t):null})}function Sa(e){return il(function(t,n){return n.inline||n.simple?e.exec(t):null})}function Ei(e){return function(t,n){return n.inline||n.simple?null:e.exec(t)}}function $d(e){return il(function(t){return e.exec(t)})}const
|
|
250
|
+
`):(c.inline=!0,k=Qu(b));const T=l(k,c);return c.inline=x,c.list=A,T}),ordered:n,start:f}},l:(o,l,c)=>e(o.ordered?"ol":"ul",{key:c.key,start:o.type==="20"?o.start:void 0},o.items.map(function(f,d){return e("li",{key:d},l(f,c))}))}}const Wpe=RegExp(`^\\[((?:\\[[^\\[\\]]*(?:\\[[^\\[\\]]*\\][^\\[\\]]*)*\\]|[^\\[\\]])*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*\\)`),Qpe=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/;function Qu(e){let t=e.length;for(;t>0&&e[t-1]<=" ";)t--;return e.slice(0,t)}function Mh(e,t){return e.startsWith(t)}function Jpe(e,t,n){if(Array.isArray(n)){for(let r=0;r<n.length;r++)if(Mh(e,n[r]))return!0;return!1}return n(e,t)}function ju(e){return e.replace(/[ÀÁÂÃÄÅàáâãä忯]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function eme(e){return Dpe.test(e)?"right":Mpe.test(e)?"center":$pe.test(e)?"left":null}function CD(e,t,n,r){const i=n.inTable;n.inTable=!0;let a=[[]],o="";function l(){if(!o)return;const c=a[a.length-1];c.push.apply(c,t(o,n)),o=""}return e.trim().split(/(`[^`]*`|\\\||\|)/).filter(Boolean).forEach((c,f,d)=>{c.trim()==="|"&&(l(),r)?f!==0&&f!==d.length-1&&a.push([]):o+=c}),l(),n.inTable=i,a}function tme(e,t,n){n.inline=!0;const r=e[2]?e[2].replace(jpe,"").split("|").map(eme):[],i=e[3]?function(o,l,c){return o.trim().split(`
|
|
251
|
+
`).map(function(f){return CD(f,l,c,!0)})}(e[3],t,n):[],a=CD(e[1],t,n,!!i.length);return n.inline=!1,i.length?{align:r,cells:i,header:a,type:"25"}:{children:a,type:"21"}}function OD(e,t){return e.align[t]==null?{}:{textAlign:e.align[t]}}function il(e){return e.inline=1,e}function wa(e){return il(function(t,n){return n.inline?e.exec(t):null})}function Sa(e){return il(function(t,n){return n.inline||n.simple?e.exec(t):null})}function Ei(e){return function(t,n){return n.inline||n.simple?null:e.exec(t)}}function $d(e){return il(function(t){return e.exec(t)})}const nme=/(javascript|vbscript|data(?!:image)):/i;function rme(e){try{const t=decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"");if(nme.test(t))return null}catch{return null}return e}function Hr(e){return e&&e.replace(Bpe,"$1")}function $h(e,t,n){const r=n.inline||!1,i=n.simple||!1;n.inline=!0,n.simple=!0;const a=e(t,n);return n.inline=r,n.simple=i,a}function ime(e,t,n){const r=n.inline||!1,i=n.simple||!1;n.inline=!1,n.simple=!0;const a=e(t,n);return n.inline=r,n.simple=i,a}function ame(e,t,n){const r=n.inline||!1;n.inline=!1;const i=e(t,n);return n.inline=r,i}const $x=(e,t,n)=>({children:$h(t,e[2],n)});function Dx(){return{}}function Ix(){return null}function sme(...e){return e.filter(Boolean).join(" ")}function Px(e,t,n){let r=e;const i=t.split(".");for(;i.length&&(r=r[i[0]],r!==void 0);)i.shift();return r||n}function ome(e="",t={}){t.overrides=t.overrides||{},t.namedCodesToUnicode=t.namedCodesToUnicode?ds({},bD,t.namedCodesToUnicode):bD;const n=t.slugify||ju,r=t.sanitizer||rme,i=t.createElement||te.createElement,a=[vD,_D,xD,t.enforceAtxHeadings?SD:wD,ED,AD,UL,VL],o=[...a,Ape,jx,kD,Mx];function l(_,S,...x){const A=Px(t.overrides,_+".props",{});return i(function(k,T){const O=Px(T,k);return O?typeof O=="function"||typeof O=="object"&&"render"in O?O:Px(T,k+".component",k):k}(_,t.overrides),ds({},S,A,{className:sme(S==null?void 0:S.className,A.className)||void 0}),...x)}function c(_){_=_.replace(ype,"");let S=!1;t.forceInline?S=!0:t.forceBlock||(S=Npe.test(_)===!1);const x=v(g(S?_:Qu(_).replace(Vpe,"")+`
|
|
252
252
|
|
|
253
|
-
`,{inline:S}));for(;typeof x[x.length-1]=="string"&&!x[x.length-1].trim();)x.pop();if(t.wrapper===null)return x;const A=t.wrapper||(S?"span":"div");let k;if(x.length>1||t.forceWrapper)k=x;else{if(x.length===1)return k=x[0],typeof k=="string"?l("span",{key:"outer"},k):k;k=null}return i(A,{key:"outer"},k)}function f(_,S){if(!S||!S.trim())return null;const x=S.match(
|
|
253
|
+
`,{inline:S}));for(;typeof x[x.length-1]=="string"&&!x[x.length-1].trim();)x.pop();if(t.wrapper===null)return x;const A=t.wrapper||(S?"span":"div");let k;if(x.length>1||t.forceWrapper)k=x;else{if(x.length===1)return k=x[0],typeof k=="string"?l("span",{key:"outer"},k):k;k=null}return i(A,{key:"outer"},k)}function f(_,S){if(!S||!S.trim())return null;const x=S.match(ipe);return x?x.reduce(function(A,k){const T=k.indexOf("=");if(T!==-1){const O=function(z){return z.indexOf("-")!==-1&&z.match(_pe)===null&&(z=z.replace(kpe,function(P,q){return q.toUpperCase()})),z}(k.slice(0,T)).trim(),$=function(z){const P=z[0];return(P==='"'||P==="'")&&z.length>=2&&z[z.length-1]===P?z.slice(1,-1):z}(k.slice(T+1).trim()),L=yD[O]||O;if(L==="ref")return A;const M=A[L]=function(z,P,q,D){return P==="style"?function(H){const B=[];let G="",K=!1,Q=!1,R="";if(!H)return B;for(let X=0;X<H.length;X++){const j=H[X];if(j!=='"'&&j!=="'"||K||(Q?j===R&&(Q=!1,R=""):(Q=!0,R=j)),j==="("&&G.endsWith("url")?K=!0:j===")"&&K&&(K=!1),j!==";"||Q||K)G+=j;else{const I=G.trim();if(I){const U=I.indexOf(":");if(U>0){const Y=I.slice(0,U).trim(),ne=I.slice(U+1).trim();B.push([Y,ne])}}G=""}}const V=G.trim();if(V){const X=V.indexOf(":");if(X>0){const j=V.slice(0,X).trim(),I=V.slice(X+1).trim();B.push([j,I])}}return B}(q).reduce(function(H,[B,G]){return H[B.replace(/(-[a-z])/g,K=>K[1].toUpperCase())]=D(G,z,B),H},{}):rpe.indexOf(P)!==-1?D(Hr(q),z,P):(q.match(xpe)&&(q=Hr(q.slice(1,q.length-1))),q==="true"||q!=="false"&&q)}(_,O,$,r);typeof M=="string"&&(jx.test(M)||Mx.test(M))&&(A[L]=c(M.trim()))}else k!=="style"&&(A[yD[k]||k]=!0);return A},{}):null}const d=[],h={},m={0:{t:[">"],o:Ei(vD),i:1,u(_,S,x){const[,A,k]=_[0].replace(ope,"").match(lpe);return{alert:A,children:S(k,x)}},l(_,S,x){const A={key:x.key};return _.alert&&(A.className="markdown-alert-"+n(_.alert.toLowerCase(),ju),_.children.unshift({attrs:{},children:[{type:"27",text:_.alert}],noInnerParse:!0,type:"11",tag:"header"})),l("blockquote",A,S(_.children,x))}},1:{o:$d(upe),i:1,u:Dx,l:(_,S,x)=>l("br",{key:x.key})},2:{t:_=>{const S=_[0];return S==="-"||S==="*"||S==="_"},o:Ei(cpe),i:1,u:Dx,l:(_,S,x)=>l("hr",{key:x.key})},3:{t:[" "],o:Ei(xD),i:0,u:_=>({lang:void 0,text:Hr(Qu(_[0].replace(/^ {4}/gm,"")))}),l:(_,S,x)=>l("pre",{key:x.key},l("code",ds({},_.attrs,{className:_.lang?"lang-"+_.lang:""}),_.text))},4:{t:["```","~~~"],o:Ei(_D),i:0,u:_=>({attrs:f("code",_[3]||""),lang:_[2]||void 0,text:_[4],type:"3"})},5:{t:["`"],o:Sa(fpe),i:3,u:_=>({text:Hr(_[2])}),l:(_,S,x)=>l("code",{key:x.key},_.text)},6:{t:["[^"],o:Ei(ppe),i:0,u:_=>(d.push({footnote:_[2],identifier:_[1]}),{}),l:Ix},7:{t:["[^"],o:wa(mpe),i:1,u:_=>({target:"#"+n(_[1],ju),text:_[1]}),l:(_,S,x)=>l("a",{key:x.key,href:r(_.target,"a","href")},l("sup",{key:x.key},_.text))},8:{t:["[ ]","[x]"],o:wa(bpe),i:1,u:_=>({completed:_[1].toLowerCase()==="x"}),l:(_,S,x)=>l("input",{checked:_.completed,key:x.key,readOnly:!0,type:"checkbox"})},9:{t:["#"],o:Ei(t.enforceAtxHeadings?SD:wD),i:1,u:(_,S,x)=>({children:$h(S,_[2],x),id:n(_[2],ju),level:_[1].length}),l:(_,S,x)=>l("h"+_.level,{id:_.id,key:x.key},S(_.children,x))},10:{o:Ei(ED),i:0,u:(_,S,x)=>({children:$h(S,_[1],x),level:_[2]==="="?1:2,type:"9"})},11:{t:["<"],o:$d(jx),i:1,u(_,S,x){const[,A]=_[3].match(Hpe),k=RegExp("^"+A,"gm"),T=_[3].replace(k,""),O=($=T,o.some(q=>q.test($))?ame:$h);var $;const L=_[1].toLowerCase(),M=npe.indexOf(L)!==-1,z=(M?L:_[1]).trim(),P={attrs:f(z,_[2]),noInnerParse:M,tag:z};if(x.inAnchor=x.inAnchor||L==="a",M)P.text=_[3];else{const q=x.inHTML;x.inHTML=!0,P.children=O(S,T,x),x.inHTML=q}return x.inAnchor=!1,P},l:(_,S,x)=>l(_.tag,ds({key:x.key},_.attrs),_.text||(_.children?S(_.children,x):""))},13:{t:["<"],o:$d(Mx),i:1,u(_){const S=_[1].trim();return{attrs:f(S,_[2]||""),tag:S}},l:(_,S,x)=>l(_.tag,ds({},_.attrs,{key:x.key}))},12:{t:["<!--"],o:$d(kD),i:1,u:()=>({}),l:Ix},14:{t:["!["],o:Sa(Qpe),i:1,u:_=>({alt:Hr(_[1]),target:Hr(_[2]),title:Hr(_[3])}),l:(_,S,x)=>l("img",{key:x.key,alt:_.alt||void 0,title:_.title||void 0,src:r(_.target,"img","src")})},15:{t:["["],o:wa(Wpe),i:3,u:(_,S,x)=>({children:ime(S,_[1],x),target:Hr(_[2]),title:Hr(_[3])}),l:(_,S,x)=>l("a",{key:x.key,href:r(_.target,"a","href"),title:_.title},S(_.children,x))},16:{t:["<"],o:wa(Epe),i:0,u:_=>({children:[{text:_[1],type:"27"}],target:_[1],type:"15"})},17:{t:(_,S)=>!S.inAnchor&&!t.disableAutoLink&&(Mh(_,"http://")||Mh(_,"https://")),o:wa(wpe),i:0,u:_=>({children:[{text:_[1],type:"27"}],target:_[1],title:void 0,type:"15"})},18:{t:["<"],o:wa(Spe),i:0,u(_){let S=_[1],x=_[1];return ape.test(x)||(x="mailto:"+x),{children:[{text:S.replace("mailto:",""),type:"27"}],target:x,type:"15"}}},20:TD(l,1),33:TD(l,2),19:{o:Ei(dpe),i:3,u:Dx,l:()=>`
|
|
254
254
|
`},21:{o:il(function(_,S){if(S.inline||S.simple||S.inHTML&&_.indexOf(`
|
|
255
255
|
|
|
256
256
|
`)===-1&&S.prevCapture.indexOf(`
|
|
257
257
|
|
|
258
258
|
`)===-1)return null;let x="";_.split(`
|
|
259
259
|
`).every(k=>(k+=`
|
|
260
|
-
`,!a.some(T=>T.test(k))&&(x+=k,!!k.trim())));const A=Qu(x);return A===""?null:[x,,A]}),i:3,u:$x,l:(_,S,x)=>l("p",{key:x.key},S(_.children,x))},22:{t:["["],o:wa(
|
|
261
|
-
`).replace(mpe,"").replace(Npe," ")}(A),k)}}(m),v=(w=function(_,S){return function(x,A,k){const T=_[x.type].l;return S?S(()=>T(x,A,k),x,A,k):T(x,A,k)}}(m,t.renderRule),function _(S,x={}){if(Array.isArray(S)){const A=x.key,k=[];let T=!1;for(let O=0;O<S.length;O++){x.key=O;const $=_(S[O],x),L=typeof $=="string";L&&T?k[k.length-1]+=$:$!==null&&k.push($),T=L}return x.key=A,k}return w(S,_,x)});var w;const b=c(e);return d.length?l("div",null,b,l("footer",{key:"footer"},d.map(function(_){return l("div",{id:n(_.identifier,ju),key:_.identifier},_.identifier,v(g(_.footnote,{inline:!0})))}))):b}const hm=e=>{let{children:t="",options:n}=e,r=function(i,a){if(i==null)return{};var o,l,c={},f=Object.keys(i);for(l=0;l<f.length;l++)a.indexOf(o=f[l])>=0||(c[o]=i[o]);return c}(e,epe);return te.cloneElement(sme(t,n),r)};function ome(e,t){return e==null?!0:p6(e,t)}class lme extends te.Component{constructor(){super(...arguments);De(this,"state",{wasPropertyKeyModified:!1,additionalProperties:{}});De(this,"onPropertyChange",(n,r=!1)=>(i,a,o)=>{const{formData:l,onChange:c,errorSchema:f}=this.props;i===void 0&&r&&(i="");const d={...l,[n]:i};c(d,f&&f&&{...f,[n]:a},o)});De(this,"onDropPropertyClick",n=>r=>{r.preventDefault();const{onChange:i,formData:a}=this.props,o={...a};ome(o,n),i(o)});De(this,"getAvailableKey",(n,r)=>{const{uiSchema:i,registry:a}=this.props,{duplicateKeySuffixSeparator:o="-"}=ot(i,a.globalUiOptions);let l=0,c=n;for(;An(r,c);)c=`${n}${o}${++l}`;return c});De(this,"onKeyChange",n=>(r,i)=>{if(n===r)return;const{formData:a,onChange:o,errorSchema:l}=this.props;r=this.getAvailableKey(r,a);const c={...a},f={[n]:r},d=Object.keys(c).map(m=>({[f[m]||m]:c[m]})),h=Object.assign({},...d);this.setState({wasPropertyKeyModified:!0}),o(h,l&&l&&{...l,[r]:i})});De(this,"handleAddClick",n=>()=>{if(!n.additionalProperties)return;const{formData:r,onChange:i,registry:a}=this.props,o={...r};let l,c,f;if(Mt(n.additionalProperties)){l=n.additionalProperties.type,c=n.additionalProperties.const,f=n.additionalProperties.default;let m=n.additionalProperties;if(rn in m){const{schemaUtils:g}=a;m=g.retrieveSchema({$ref:m[rn]},r),l=m.type,c=m.const,f=m.default}!l&&(Mr in m||tr in m)&&(l="object")}const d=this.getAvailableKey("newKey",o),h=c??f??this.getDefaultValue(l);mn(o,d,h),i(o)})}isRequired(n){const{schema:r}=this.props;return Array.isArray(r.required)&&r.required.indexOf(n)!==-1}getDefaultValue(n){const{registry:{translateString:r}}=this.props;switch(n){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};case"string":default:return r(Tt.NewStringDefault)}}render(){const{schema:n,uiSchema:r={},formData:i,errorSchema:a,idSchema:o,name:l,required:c=!1,disabled:f,readonly:d,hideError:h,idPrefix:m,idSeparator:g,onBlur:v,onFocus:w,registry:b,title:_}=this.props,{fields:S,formContext:x,schemaUtils:A,translateString:k,globalUiOptions:T}=b,{SchemaField:O}=S,$=A.retrieveSchema(n,i),L=ot(r,T),{properties:M={}}=$,z=L.title??$.title??_??l,P=L.description??$.description;let q;try{const B=Object.keys(M);q=$he(B,L.order)}catch(B){return N.jsxs("div",{children:[N.jsx("p",{className:"config-error",style:{color:"red"},children:N.jsx(hm,{options:{disableParsingRawHTML:!0},children:k(Tt.InvalidObjectField,[l||"root",B.message])})}),N.jsx("pre",{children:JSON.stringify($)})]})}const D=yt("ObjectFieldTemplate",b,L),H={title:L.label===!1?"":z,description:L.label===!1?void 0:P,properties:q.map(B=>{const G=An($,[Bt,B,Mc]),K=G?r.additionalProperties:r[B],Q=ot(K).widget==="hidden",R=Ne(o,[B],{});return{content:N.jsx(O,{name:B,required:this.isRequired(B),schema:Ne($,[Bt,B],{}),uiSchema:K,errorSchema:Ne(a,B),idSchema:R,idPrefix:m,idSeparator:g,formData:Ne(i,B),formContext:x,wasPropertyKeyModified:this.state.wasPropertyKeyModified,onKeyChange:this.onKeyChange(B),onChange:this.onPropertyChange(B,G),onBlur:v,onFocus:w,registry:b,disabled:f,readonly:d,hideError:h,onDropPropertyClick:this.onDropPropertyClick},B),name:B,readonly:d,disabled:f,required:c,hidden:Q}}),readonly:d,disabled:f,required:c,idSchema:o,uiSchema:r,errorSchema:a,schema:$,formData:i,formContext:x,registry:b};return N.jsx(D,{...H,onAddClick:this.handleAddClick})}}const ume={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function cme(e,t,n,r){const i=t.field,{fields:a,translateString:o}=r;if(typeof i=="function")return i;if(typeof i=="string"&&i in a)return a[i];const l=Ii(e),c=Array.isArray(l)?l[0]:l||"",f=e.$id;let d=ume[c];return f&&f in a&&(d=f),!d&&(e.anyOf||e.oneOf)?()=>null:d in a?a[d]:()=>{const h=yt("UnsupportedFieldTemplate",r,t);return N.jsx(h,{schema:e,idSchema:n,reason:o(Tt.UnknownFieldType,[String(e.type)]),registry:r})}}function fme(e){const{schema:t,idSchema:n,uiSchema:r,formData:i,errorSchema:a,idPrefix:o,idSeparator:l,name:c,onChange:f,onKeyChange:d,onDropPropertyClick:h,required:m,registry:g,wasPropertyKeyModified:v=!1}=e,{formContext:w,schemaUtils:b,globalUiOptions:_}=g,S=ot(r,_),x=yt("FieldTemplate",g,S),A=yt("DescriptionFieldTemplate",g,S),k=yt("FieldHelpTemplate",g,S),T=yt("FieldErrorTemplate",g,S),O=b.retrieveSchema(t,i),$=n[Ra],L=Oi(b.toIdSchema(O,$,i,o,l),n),M=te.useCallback((me,xe,we)=>f(me,xe,we||$),[$,f]),z=cme(O,S,L,g),P=!!(S.disabled??e.disabled),q=!!(S.readonly??(e.readonly||e.schema.readOnly||O.readOnly)),D=S.hideError,H=D===void 0?e.hideError:!!D,B=!!(S.autofocus??e.autofocus);if(Object.keys(O).length===0)return null;const G=b.getDisplayLabel(O,r,_),{__errors:K,...Q}=a||{},R=pp(r,["ui:classNames","classNames","ui:style"]);Zu in R&&(R[Zu]=pp(R[Zu],["classNames","style"]));const V=N.jsx(z,{...e,onChange:M,idSchema:L,schema:O,uiSchema:R,disabled:P,readonly:q,hideError:H,autofocus:B,errorSchema:Q,formContext:w,rawErrors:K}),X=L[Ra];let j;v?j=c:j=Mc in O?c:S.title||e.schema.title||O.title||e.title||c;const I=S.description||e.schema.description||O.description||"",U=S.enableMarkdownInDescription?N.jsx(hm,{options:{disableParsingRawHTML:!0},children:I}):I,Y=S.help,ne=S.widget==="hidden",ae=["form-group","field",`field-${Ii(O)}`];!H&&K&&K.length>0&&ae.push("field-error has-error has-danger"),r!=null&&r.classNames&&ae.push(r.classNames),S.classNames&&ae.push(S.classNames);const re=N.jsx(k,{help:Y,idSchema:L,schema:O,uiSchema:r,hasErrors:!H&&K&&K.length>0,registry:g}),le=H||(O.anyOf||O.oneOf)&&!b.isSelect(O)?void 0:N.jsx(T,{errors:K,errorSchema:a,idSchema:L,schema:O,uiSchema:r,registry:g}),W={description:N.jsx(A,{id:Uc(X),description:U,schema:O,uiSchema:r,registry:g}),rawDescription:I,help:re,rawHelp:typeof Y=="string"?Y:void 0,errors:le,rawErrors:H?void 0:K,id:X,label:j,hidden:ne,onChange:f,onKeyChange:d,onDropPropertyClick:h,required:m,disabled:P,readonly:q,hideError:H,displayLabel:G,classNames:ae.join(" ").trim(),style:S.style,formContext:w,formData:i,schema:O,uiSchema:r,registry:g},J=g.fields.AnyOfField,se=g.fields.OneOfField,fe=(r==null?void 0:r["ui:field"])&&(r==null?void 0:r["ui:fieldReplacesAnyOrOneOf"])===!0;return N.jsx(x,{...W,children:N.jsxs(N.Fragment,{children:[V,O.anyOf&&!fe&&!b.isSelect(O)&&N.jsx(J,{name:c,disabled:P,readonly:q,hideError:H,errorSchema:a,formData:i,formContext:w,idPrefix:o,idSchema:L,idSeparator:l,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:O.anyOf.map(me=>b.retrieveSchema(Mt(me)?me:{},i)),registry:g,required:m,schema:O,uiSchema:r}),O.oneOf&&!fe&&!b.isSelect(O)&&N.jsx(se,{name:c,disabled:P,readonly:q,hideError:H,errorSchema:a,formData:i,formContext:w,idPrefix:o,idSchema:L,idSeparator:l,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:O.oneOf.map(me=>b.retrieveSchema(Mt(me)?me:{},i)),registry:g,required:m,schema:O,uiSchema:r})]})})}class dme extends te.Component{shouldComponentUpdate(t){return!It(this.props,t)}render(){return N.jsx(fme,{...this.props})}}function hme(e){const{schema:t,name:n,uiSchema:r,idSchema:i,formData:a,required:o,disabled:l=!1,readonly:c=!1,autofocus:f=!1,onChange:d,onBlur:h,onFocus:m,registry:g,rawErrors:v,hideError:w}=e,{title:b,format:_}=t,{widgets:S,formContext:x,schemaUtils:A,globalUiOptions:k}=g,T=A.isSelect(t)?xc(t,r):void 0;let O=T?"select":"text";_&&Rhe(t,_,S)&&(O=_);const{widget:$=O,placeholder:L="",title:M,...z}=ot(r),P=A.getDisplayLabel(t,r,k),q=M??b??n,D=ji(t,$,S);return N.jsx(D,{options:{...z,enumOptions:T},schema:t,uiSchema:r,id:i.$id,name:n,label:q,hideLabel:!P,hideError:w,value:a,onChange:d,onBlur:h,onFocus:m,required:o,disabled:l,readonly:c,formContext:x,autofocus:f,registry:g,placeholder:L,rawErrors:v})}function pme(e){const{formData:t,onChange:n}=e;return te.useEffect(()=>{t===void 0&&n(null)},[t,n]),null}function mme(){return{AnyOfField:gD,ArrayField:Khe,BooleanField:Xhe,NumberField:Jhe,ObjectField:lme,OneOfField:gD,SchemaField:dme,StringField:hme,NullField:pme}}function gme(e){const{idSchema:t,description:n,registry:r,schema:i,uiSchema:a}=e,o=ot(a,r.globalUiOptions),{label:l=!0}=o;if(!n||!l)return null;const c=yt("DescriptionFieldTemplate",r,o);return N.jsx(c,{id:Uc(t),description:n,schema:i,uiSchema:a,registry:r})}function yme(e){const{children:t,className:n,disabled:r,hasToolbar:i,hasMoveDown:a,hasMoveUp:o,hasRemove:l,hasCopy:c,index:f,onCopyIndexClick:d,onDropIndexClick:h,onReorderClick:m,readonly:g,registry:v,uiSchema:w}=e,{CopyButton:b,MoveDownButton:_,MoveUpButton:S,RemoveButton:x}=v.templates.ButtonTemplates,A={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return N.jsxs("div",{className:n,children:[N.jsx("div",{className:i?"col-xs-9":"col-xs-12",children:t}),i&&N.jsx("div",{className:"col-xs-3 array-item-toolbox",children:N.jsxs("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"},children:[(o||a)&&N.jsx(S,{style:A,disabled:r||g||!o,onClick:m(f,f-1),uiSchema:w,registry:v}),(o||a)&&N.jsx(_,{style:A,disabled:r||g||!a,onClick:m(f,f+1),uiSchema:w,registry:v}),c&&N.jsx(b,{style:A,disabled:r||g,onClick:d(f),uiSchema:w,registry:v}),l&&N.jsx(x,{style:A,disabled:r||g,onClick:h(f),uiSchema:w,registry:v})]})})]})}function bme(e){const{canAdd:t,className:n,disabled:r,idSchema:i,uiSchema:a,items:o,onAddClick:l,readonly:c,registry:f,required:d,schema:h,title:m}=e,g=ot(a),v=yt("ArrayFieldDescriptionTemplate",f,g),w=yt("ArrayFieldItemTemplate",f,g),b=yt("ArrayFieldTitleTemplate",f,g),{ButtonTemplates:{AddButton:_}}=f.templates;return N.jsxs("fieldset",{className:n,id:i.$id,children:[N.jsx(b,{idSchema:i,title:g.title||m,required:d,schema:h,uiSchema:a,registry:f}),N.jsx(v,{idSchema:i,description:g.description||h.description,schema:h,uiSchema:a,registry:f}),N.jsx("div",{className:"row array-item-list",children:o&&o.map(({key:S,...x})=>N.jsx(w,{...x},S))}),t&&N.jsx(_,{className:"array-item-add",onClick:l,disabled:r||c,uiSchema:a,registry:f})]})}function vme(e){const{idSchema:t,title:n,schema:r,uiSchema:i,required:a,registry:o}=e,l=ot(i,o.globalUiOptions),{label:c=!0}=l;if(!n||!c)return null;const f=yt("TitleFieldTemplate",o,l);return N.jsx(f,{id:ML(t),title:n,required:a,schema:r,uiSchema:i,registry:o})}function _me(e){const{id:t,name:n,value:r,readonly:i,disabled:a,autofocus:o,onBlur:l,onFocus:c,onChange:f,onChangeOverride:d,options:h,schema:m,uiSchema:g,formContext:v,registry:w,rawErrors:b,type:_,hideLabel:S,hideError:x,...A}=e;if(!t)throw console.log("No id for",e),new Error(`no id for props ${JSON.stringify(e)}`);const k={...A,...She(m,_,h)};let T;k.type==="number"||k.type==="integer"?T=r||r===0?r:"":T=r??"";const O=te.useCallback(({target:{value:M}})=>f(M===""?h.emptyValue:M),[f,h]),$=te.useCallback(({target:M})=>l(t,M&&M.value),[l,t]),L=te.useCallback(({target:M})=>c(t,M&&M.value),[c,t]);return N.jsxs(N.Fragment,{children:[N.jsx("input",{id:t,name:t,className:"form-control",readOnly:i,disabled:a,autoFocus:o,value:T,...k,list:m.examples?Xw(t):void 0,onChange:d||O,onBlur:$,onFocus:L,"aria-describedby":Is(t,!!m.examples)}),Array.isArray(m.examples)&&N.jsx("datalist",{id:Xw(t),children:m.examples.concat(m.default&&!m.examples.includes(m.default)?[m.default]:[]).map(M=>N.jsx("option",{value:M},M))},`datalist_${t}`)]})}function xme({uiSchema:e}){const{submitText:t,norender:n,props:r={}}=Ehe(e);return n?null:N.jsx("div",{children:N.jsx("button",{type:"submit",...r,className:`btn btn-info ${r.className||""}`,children:t})})}function Vc(e){const{iconType:t="default",icon:n,className:r,uiSchema:i,registry:a,...o}=e;return N.jsx("button",{type:"button",className:`btn btn-${t} ${r}`,...o,children:N.jsx("i",{className:`glyphicon glyphicon-${n}`})})}function wme(e){const{registry:{translateString:t}}=e;return N.jsx(Vc,{title:t(Tt.CopyButton),className:"array-item-copy",...e,icon:"copy"})}function Sme(e){const{registry:{translateString:t}}=e;return N.jsx(Vc,{title:t(Tt.MoveDownButton),className:"array-item-move-down",...e,icon:"arrow-down"})}function Eme(e){const{registry:{translateString:t}}=e;return N.jsx(Vc,{title:t(Tt.MoveUpButton),className:"array-item-move-up",...e,icon:"arrow-up"})}function kme(e){const{registry:{translateString:t}}=e;return N.jsx(Vc,{title:t(Tt.RemoveButton),className:"array-item-remove",...e,iconType:"danger",icon:"remove"})}function Ame({className:e,onClick:t,disabled:n,registry:r}){const{translateString:i}=r;return N.jsx("div",{className:"row",children:N.jsx("p",{className:`col-xs-3 col-xs-offset-9 text-right ${e}`,children:N.jsx(Vc,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:i(Tt.AddButton),onClick:t,disabled:n,registry:r})})})}function Tme(){return{SubmitButton:xme,AddButton:Ame,CopyButton:wme,MoveDownButton:Sme,MoveUpButton:Eme,RemoveButton:kme}}function Cme(e){const{id:t,description:n}=e;return n?typeof n=="string"?N.jsx("p",{id:t,className:"field-description",children:n}):N.jsx("div",{id:t,className:"field-description",children:n}):null}function Ome({errors:e,registry:t}){const{translateString:n}=t;return N.jsxs("div",{className:"panel panel-danger errors",children:[N.jsx("div",{className:"panel-heading",children:N.jsx("h3",{className:"panel-title",children:n(Tt.ErrorsLabel)})}),N.jsx("ul",{className:"list-group",children:e.map((r,i)=>N.jsx("li",{className:"list-group-item text-danger",children:r.stack},i))})]})}const Nme="*";function HL(e){const{label:t,required:n,id:r}=e;return t?N.jsxs("label",{className:"control-label",htmlFor:r,children:[t,n&&N.jsx("span",{className:"required",children:Nme})]}):null}function Rme(e){const{id:t,label:n,children:r,errors:i,help:a,description:o,hidden:l,required:c,displayLabel:f,registry:d,uiSchema:h}=e,m=ot(h),g=yt("WrapIfAdditionalTemplate",d,m);return l?N.jsx("div",{className:"hidden",children:r}):N.jsxs(g,{...e,children:[f&&N.jsx(HL,{label:n,required:c,id:t}),f&&o?o:null,r,i,a]})}function jme(e){const{errors:t=[],idSchema:n}=e;if(t.length===0)return null;const r=RL(n);return N.jsx("div",{children:N.jsx("ul",{id:r,className:"error-detail bs-callout bs-callout-info",children:t.filter(i=>!!i).map((i,a)=>N.jsx("li",{className:"text-danger",children:i},a))})})}function Mme(e){const{idSchema:t,help:n}=e;if(!n)return null;const r=jL(t);return typeof n=="string"?N.jsx("p",{id:r,className:"help-block",children:n}):N.jsx("div",{id:r,className:"help-block",children:n})}function $me(e){const{description:t,disabled:n,formData:r,idSchema:i,onAddClick:a,properties:o,readonly:l,registry:c,required:f,schema:d,title:h,uiSchema:m}=e,g=ot(m),v=yt("TitleFieldTemplate",c,g),w=yt("DescriptionFieldTemplate",c,g),{ButtonTemplates:{AddButton:b}}=c.templates;return N.jsxs("fieldset",{id:i.$id,children:[h&&N.jsx(v,{id:ML(i),title:h,required:f,schema:d,uiSchema:m,registry:c}),t&&N.jsx(w,{id:Uc(i),description:t,schema:d,uiSchema:m,registry:c}),o.map(_=>_.content),rae(d,m,r)&&N.jsx(b,{className:"object-property-expand",onClick:a(d),disabled:n||l,uiSchema:m,registry:c})]})}const Dme="*";function Ime(e){const{id:t,title:n,required:r}=e;return N.jsxs("legend",{id:t,children:[n,r&&N.jsx("span",{className:"required",children:Dme})]})}function Pme(e){const{schema:t,idSchema:n,reason:r,registry:i}=e,{translateString:a}=i;let o=Tt.UnsupportedField;const l=[];return n&&n.$id&&(o=Tt.UnsupportedFieldWithId,l.push(n.$id)),r&&(o=o===Tt.UnsupportedField?Tt.UnsupportedFieldWithReason:Tt.UnsupportedFieldWithIdAndReason,l.push(r)),N.jsxs("div",{className:"unsupported-field",children:[N.jsx("p",{children:N.jsx(hm,{options:{disableParsingRawHTML:!0},children:a(o,l)})}),t&&N.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function Lme(e){const{id:t,classNames:n,style:r,disabled:i,label:a,onKeyChange:o,onDropPropertyClick:l,readonly:c,required:f,schema:d,children:h,uiSchema:m,registry:g}=e,{templates:v,translateString:w}=g,{RemoveButton:b}=v.ButtonTemplates,_=w(Tt.KeyLabel,[a]);return Mc in d?N.jsx("div",{className:n,style:r,children:N.jsxs("div",{className:"row",children:[N.jsx("div",{className:"col-xs-5 form-additional",children:N.jsxs("div",{className:"form-group",children:[N.jsx(HL,{label:_,required:f,id:`${t}-key`}),N.jsx("input",{className:"form-control",type:"text",id:`${t}-key`,onBlur:({target:x})=>o(x&&x.value),defaultValue:a})]})}),N.jsx("div",{className:"form-additional form-group col-xs-5",children:h}),N.jsx("div",{className:"col-xs-2",children:N.jsx(b,{className:"array-item-remove btn-block",style:{border:"0"},disabled:i||c,onClick:l(a),uiSchema:m,registry:g})})]})}):N.jsx("div",{className:n,style:r,children:h})}function zme(){return{ArrayFieldDescriptionTemplate:gme,ArrayFieldItemTemplate:yme,ArrayFieldTemplate:bme,ArrayFieldTitleTemplate:vme,ButtonTemplates:Tme(),BaseInputTemplate:_me,DescriptionFieldTemplate:Cme,ErrorListTemplate:Ome,FieldTemplate:Rme,FieldErrorTemplate:jme,FieldHelpTemplate:Mme,ObjectFieldTemplate:$me,TitleFieldTemplate:Ime,UnsupportedFieldTemplate:Pme,WrapIfAdditionalTemplate:Lme}}function qme(e){return Object.values(e).every(t=>t!==-1)}function Fme({type:e,range:t,value:n,select:r,rootId:i,name:a,disabled:o,readonly:l,autofocus:c,registry:f,onBlur:d,onFocus:h}){const m=i+"_"+e,{SelectWidget:g}=f.widgets;return N.jsx(g,{schema:{type:"integer"},id:m,name:a,className:"form-control",options:{enumOptions:OL(t[0],t[1])},placeholder:e,value:n,disabled:o,readonly:l,autofocus:c,onChange:v=>r(e,v),onBlur:d,onFocus:h,registry:f,label:"","aria-describedby":Is(i)})}function Bme({time:e=!1,disabled:t=!1,readonly:n=!1,autofocus:r=!1,options:i,id:a,name:o,registry:l,onBlur:c,onFocus:f,onChange:d,value:h}){const{translateString:m}=l,[g,v]=te.useState(h),[w,b]=te.useReducer((A,k)=>({...A,...k}),Rx(h,e));te.useEffect(()=>{const A=hD(w,e);qme(w)&&A!==h?d(A):g!==h&&(v(h),b(Rx(h,e)))},[e,h,d,w,g]);const _=te.useCallback((A,k)=>{b({[A]:k})},[]),S=te.useCallback(A=>{if(A.preventDefault(),t||n)return;const k=Rx(new Date().toJSON(),e);d(hD(k,e))},[t,n,e]),x=te.useCallback(A=>{A.preventDefault(),!(t||n)&&d(void 0)},[t,n,d]);return N.jsxs("ul",{className:"list-inline",children:[xhe(w,e,i.yearsRange,i.format).map((A,k)=>N.jsx("li",{className:"list-inline-item",children:N.jsx(Fme,{rootId:a,name:o,select:_,...A,disabled:t,readonly:n,registry:l,onBlur:c,onFocus:f,autofocus:r&&k===0})},k)),(i.hideNowButton!=="undefined"?!i.hideNowButton:!0)&&N.jsx("li",{className:"list-inline-item",children:N.jsx("a",{href:"#",className:"btn btn-info btn-now",onClick:S,children:m(Tt.NowLabel)})}),(i.hideClearButton!=="undefined"?!i.hideClearButton:!0)&&N.jsx("li",{className:"list-inline-item",children:N.jsx("a",{href:"#",className:"btn btn-warning btn-clear",onClick:x,children:m(Tt.ClearLabel)})})]})}function Ume({time:e=!0,...t}){const{AltDateWidget:n}=t.registry.widgets;return N.jsx(n,{time:e,...t})}function Vme({schema:e,uiSchema:t,options:n,id:r,value:i,disabled:a,readonly:o,label:l,hideLabel:c,autofocus:f=!1,onBlur:d,onFocus:h,onChange:m,registry:g}){const v=yt("DescriptionFieldTemplate",g,n),w=Rh(e),b=te.useCallback(A=>m(A.target.checked),[m]),_=te.useCallback(A=>d(r,A.target.checked),[d,r]),S=te.useCallback(A=>h(r,A.target.checked),[h,r]),x=n.description??e.description;return N.jsxs("div",{className:`checkbox ${a||o?"disabled":""}`,children:[!c&&!!x&&N.jsx(v,{id:Uc(r),description:x,schema:e,uiSchema:t,registry:g}),N.jsxs("label",{children:[N.jsx("input",{type:"checkbox",id:r,name:r,checked:typeof i>"u"?!1:i,required:w,disabled:a||o,autoFocus:f,onChange:b,onBlur:_,onFocus:S,"aria-describedby":Is(r)}),jhe(N.jsx("span",{children:l}),c)]})]})}function Hme({id:e,disabled:t,options:{inline:n=!1,enumOptions:r,enumDisabled:i,emptyValue:a},value:o,autofocus:l=!1,readonly:c,onChange:f,onBlur:d,onFocus:h}){const m=Array.isArray(o)?o:[o],g=te.useCallback(({target:w})=>d(e,Qr(w&&w.value,r,a)),[d,e]),v=te.useCallback(({target:w})=>h(e,Qr(w&&w.value,r,a)),[h,e]);return N.jsx("div",{className:"checkboxes",id:e,children:Array.isArray(r)&&r.map((w,b)=>{const _=$E(w.value,m),S=Array.isArray(i)&&i.indexOf(w.value)!==-1,x=t||S||c?"disabled":"",A=T=>{T.target.checked?f(ghe(b,m,r)):f(phe(b,m,r))},k=N.jsxs("span",{children:[N.jsx("input",{type:"checkbox",id:$L(e,b),name:e,checked:_,value:String(b),disabled:t||S||c,autoFocus:l&&b===0,onChange:A,onBlur:g,onFocus:v,"aria-describedby":Is(e)}),N.jsx("span",{children:w.label})]});return n?N.jsx("label",{className:`checkbox-inline ${x}`,children:k},b):N.jsx("div",{className:`checkbox ${x}`,children:N.jsx("label",{children:k})},b)})})}function Gme(e){const{disabled:t,readonly:n,options:r,registry:i}=e,a=yt("BaseInputTemplate",i,r);return N.jsx(a,{type:"color",...e,disabled:t||n})}function Yme(e){const{onChange:t,options:n,registry:r}=e,i=yt("BaseInputTemplate",r,n),a=te.useCallback(o=>t(o||void 0),[t]);return N.jsx(i,{type:"date",...e,onChange:a})}function Zme(e){const{onChange:t,value:n,options:r,registry:i}=e,a=yt("BaseInputTemplate",i,r);return N.jsx(a,{type:"datetime-local",...e,value:Phe(n),onChange:o=>t(Mhe(o))})}function Kme(e){const{options:t,registry:n}=e,r=yt("BaseInputTemplate",n,t);return N.jsx(r,{type:"email",...e})}function Xme(e,t){return e===null?null:e.replace(";base64",`;name=${encodeURIComponent(t)};base64`)}function Wme(e){const{name:t,size:n,type:r}=e;return new Promise((i,a)=>{const o=new window.FileReader;o.onerror=a,o.onload=l=>{var c;typeof((c=l.target)==null?void 0:c.result)=="string"?i({dataURL:Xme(l.target.result,t),name:t,size:n,type:r}):i({dataURL:null,name:t,size:n,type:r})},o.readAsDataURL(e)})}function Qme(e){return Promise.all(Array.from(e).map(Wme))}function Jme({fileInfo:e,registry:t}){const{translateString:n}=t,{dataURL:r,type:i,name:a}=e;return r?["image/jpeg","image/png"].includes(i)?N.jsx("img",{src:r,style:{maxWidth:"100%"},className:"file-preview"}):N.jsxs(N.Fragment,{children:[" ",N.jsx("a",{download:`preview-${a}`,href:r,className:"file-download",children:n(Tt.PreviewLabel)})]}):null}function ege({filesInfo:e,registry:t,preview:n,onRemove:r,options:i}){if(e.length===0)return null;const{translateString:a}=t,{RemoveButton:o}=yt("ButtonTemplates",t,i);return N.jsx("ul",{className:"file-info",children:e.map((l,c)=>{const{name:f,size:d,type:h}=l,m=()=>r(c);return N.jsxs("li",{children:[N.jsx(hm,{children:a(Tt.FilesInfo,[f,h,String(d)])}),n&&N.jsx(Jme,{fileInfo:l,registry:t}),N.jsx(o,{onClick:m,registry:t})]},c)})})}function tge(e){return e.reduce((t,n)=>{if(!n)return t;try{const{blob:r,name:i}=fhe(n);return[...t,{dataURL:n,name:i,size:r.size,type:r.type}]}catch{return t}},[])}function nge(e){const{disabled:t,readonly:n,required:r,multiple:i,onChange:a,value:o,options:l,registry:c}=e,f=yt("BaseInputTemplate",c,l),d=te.useCallback(g=>{g.target.files&&Qme(g.target.files).then(v=>{const w=v.map(b=>b.dataURL);a(i?o.concat(w):w[0])})},[i,o,a]),h=te.useMemo(()=>tge(Array.isArray(o)?o:[o]),[o]),m=te.useCallback(g=>{if(i){const v=o.filter((w,b)=>b!==g);a(v)}else a(void 0)},[i,o,a]);return N.jsxs("div",{children:[N.jsx(f,{...e,disabled:t||n,type:"file",required:o?!1:r,onChangeOverride:d,value:"",accept:l.accept?String(l.accept):void 0}),N.jsx(ege,{filesInfo:h,onRemove:m,registry:c,preview:l.filePreview,options:l})]})}function rge({id:e,value:t}){return N.jsx("input",{type:"hidden",id:e,name:e,value:typeof t>"u"?"":t})}function ige(e){const{options:t,registry:n}=e,r=yt("BaseInputTemplate",n,t);return N.jsx(r,{type:"password",...e})}function age({options:e,value:t,required:n,disabled:r,readonly:i,autofocus:a=!1,onBlur:o,onFocus:l,onChange:c,id:f}){const{enumOptions:d,enumDisabled:h,inline:m,emptyValue:g}=e,v=te.useCallback(({target:b})=>o(f,Qr(b&&b.value,d,g)),[o,f]),w=te.useCallback(({target:b})=>l(f,Qr(b&&b.value,d,g)),[l,f]);return N.jsx("div",{className:"field-radio-group",id:f,children:Array.isArray(d)&&d.map((b,_)=>{const S=$E(b.value,t),x=Array.isArray(h)&&h.indexOf(b.value)!==-1,A=r||x||i?"disabled":"",k=()=>c(b.value),T=N.jsxs("span",{children:[N.jsx("input",{type:"radio",id:$L(f,_),checked:S,name:f,required:n,value:String(_),disabled:r||x||i,autoFocus:a&&_===0,onChange:k,onBlur:v,onFocus:w,"aria-describedby":Is(f)}),N.jsx("span",{children:b.label})]});return m?N.jsx("label",{className:`radio-inline ${A}`,children:T},_):N.jsx("div",{className:`radio ${A}`,children:N.jsx("label",{children:T})},_)})})}function sge(e){const{value:t,registry:{templates:{BaseInputTemplate:n}}}=e;return N.jsxs("div",{className:"field-range-wrapper",children:[N.jsx(n,{type:"range",...e}),N.jsx("span",{className:"range-view",children:t})]})}function Lx(e,t){return t?Array.from(e.target.options).slice().filter(n=>n.selected).map(n=>n.value):e.target.value}function oge({schema:e,id:t,options:n,value:r,required:i,disabled:a,readonly:o,multiple:l=!1,autofocus:c=!1,onChange:f,onBlur:d,onFocus:h,placeholder:m}){const{enumOptions:g,enumDisabled:v,emptyValue:w}=n,b=l?[]:"",_=te.useCallback(T=>{const O=Lx(T,l);return h(t,Qr(O,g,w))},[h,t,e,l,g,w]),S=te.useCallback(T=>{const O=Lx(T,l);return d(t,Qr(O,g,w))},[d,t,e,l,g,w]),x=te.useCallback(T=>{const O=Lx(T,l);return f(Qr(O,g,w))},[f,e,l,g,w]),A=mhe(r,g,l),k=!l&&e.default===void 0;return N.jsxs("select",{id:t,name:t,multiple:l,className:"form-control",value:typeof A>"u"?b:A,required:i,disabled:a||o,autoFocus:c,onBlur:S,onFocus:_,onChange:x,"aria-describedby":Is(t),children:[k&&N.jsx("option",{value:"",children:m}),Array.isArray(g)&&g.map(({value:T,label:O},$)=>{const L=v&&v.indexOf(T)!==-1;return N.jsx("option",{value:String($),disabled:L,children:O},$)})]})}function GL({id:e,options:t={},placeholder:n,value:r,required:i,disabled:a,readonly:o,autofocus:l=!1,onChange:c,onBlur:f,onFocus:d}){const h=te.useCallback(({target:{value:v}})=>c(v===""?t.emptyValue:v),[c,t.emptyValue]),m=te.useCallback(({target:v})=>f(e,v&&v.value),[f,e]),g=te.useCallback(({target:v})=>d(e,v&&v.value),[e,d]);return N.jsx("textarea",{id:e,name:e,className:"form-control",value:r||"",placeholder:n,required:i,disabled:a,readOnly:o,autoFocus:l,rows:t.rows,onBlur:m,onFocus:g,onChange:h,"aria-describedby":Is(e)})}GL.defaultProps={autofocus:!1,options:{}};function lge(e){const{options:t,registry:n}=e,r=yt("BaseInputTemplate",n,t);return N.jsx(r,{...e})}function uge(e){const{onChange:t,options:n,registry:r}=e,i=yt("BaseInputTemplate",r,n),a=te.useCallback(o=>t(o?`${o}:00`:void 0),[t]);return N.jsx(i,{type:"time",...e,onChange:a})}function cge(e){const{options:t,registry:n}=e,r=yt("BaseInputTemplate",n,t);return N.jsx(r,{type:"url",...e})}function fge(e){const{options:t,registry:n}=e,r=yt("BaseInputTemplate",n,t);return N.jsx(r,{type:"number",...e})}function dge(){return{AltDateWidget:Bme,AltDateTimeWidget:Ume,CheckboxWidget:Vme,CheckboxesWidget:Hme,ColorWidget:Gme,DateWidget:Yme,DateTimeWidget:Zme,EmailWidget:Kme,FileWidget:nge,HiddenWidget:rge,PasswordWidget:ige,RadioWidget:age,RangeWidget:sge,SelectWidget:oge,TextWidget:lge,TextareaWidget:GL,TimeWidget:uge,UpDownWidget:fge,URLWidget:cge}}function hge(){return{fields:mme(),templates:zme(),widgets:dge(),rootSchema:{},formContext:{},translateString:hhe}}class pge extends te.Component{constructor(n){super(n);De(this,"formElement");De(this,"getUsedFormData",(n,r)=>{if(r.length===0&&typeof n!="object")return n;const i=pD(n,r);return Array.isArray(n)?Object.keys(i).map(a=>i[a]):i});De(this,"getFieldNames",(n,r)=>{const i=(a,o=[],l=[[]])=>(Object.keys(a).forEach(c=>{if(typeof a[c]=="object"){const f=l.map(d=>[...d,c]);a[c][PS]&&a[c][Oh]!==""?o.push(a[c][Oh]):i(a[c],o,f)}else c===Oh&&a[c]!==""&&l.forEach(f=>{const d=Ne(r,f);(typeof d!="object"||tl(d)||Array.isArray(d)&&d.every(h=>typeof h!="object"))&&o.push(f)})}),o);return i(n)});De(this,"omitExtraData",n=>{const{schema:r,schemaUtils:i}=this.state,a=i.retrieveSchema(r,n),o=i.toPathSchema(a,"",n),l=this.getFieldNames(o,n);return this.getUsedFormData(n,l)});De(this,"onChange",(n,r,i)=>{const{extraErrors:a,omitExtraData:o,liveOmit:l,noValidate:c,liveValidate:f,onChange:d}=this.props,{schemaUtils:h,schema:m}=this.state;let g=this.state.retrievedSchema;if(lt(n)||Array.isArray(n)){const _=this.getStateFromProps(this.props,n);n=_.formData,g=_.retrievedSchema}const v=!c&&f;let w={formData:n,schema:m},b=n;if(o===!0&&l===!0&&(b=this.omitExtraData(n),w={formData:b}),v){const _=this.validate(b,m,h,g);let S=_.errors,x=_.errorSchema;const A=S,k=x;if(a){const T=jh(_,a);x=T.errorSchema,S=T.errors}if(r){const T=this.filterErrorsBasedOnSchema(r,g,b);x=Oi(x,T,"preventDuplicates")}w={formData:b,errors:S,errorSchema:x,schemaValidationErrors:A,schemaValidationErrorSchema:k}}else if(!c&&r){const _=a?Oi(r,a,"preventDuplicates"):r;w={formData:b,errorSchema:_,errors:wc(_)}}this.setState(w,()=>d&&d({...this.state,...w},i))});De(this,"reset",()=>{const{onChange:n}=this.props,a={formData:this.getStateFromProps(this.props,void 0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{}};this.setState(a,()=>n&&n({...this.state,...a}))});De(this,"onBlur",(n,r)=>{const{onBlur:i}=this.props;i&&i(n,r)});De(this,"onFocus",(n,r)=>{const{onFocus:i}=this.props;i&&i(n,r)});De(this,"onSubmit",n=>{if(n.preventDefault(),n.target!==n.currentTarget)return;n.persist();const{omitExtraData:r,extraErrors:i,noValidate:a,onSubmit:o}=this.props;let{formData:l}=this.state;if(r===!0&&(l=this.omitExtraData(l)),a||this.validateFormWithFormData(l)){const c=i||{},f=i?wc(i):[];this.setState({formData:l,errors:f,errorSchema:c,schemaValidationErrors:[],schemaValidationErrorSchema:{}},()=>{o&&o({...this.state,formData:l,status:"submitted"},n)})}});De(this,"submit",()=>{if(this.formElement.current){const n=new CustomEvent("submit",{cancelable:!0});n.preventDefault(),this.formElement.current.dispatchEvent(n),this.formElement.current.requestSubmit()}});De(this,"validateFormWithFormData",n=>{const{extraErrors:r,extraErrorsBlockSubmit:i,focusOnFirstError:a,onError:o}=this.props,{errors:l}=this.state,c=this.validate(n);let f=c.errors,d=c.errorSchema;const h=f,m=d,g=f.length>0||r&&i;if(g){if(r){const v=jh(c,r);d=v.errorSchema,f=v.errors}a&&(typeof a=="function"?a(f[0]):this.focusOnError(f[0])),this.setState({errors:f,errorSchema:d,schemaValidationErrors:h,schemaValidationErrorSchema:m},()=>{o?o(f):console.error("Form validation failed",f)})}else l.length>0&&this.setState({errors:[],errorSchema:{},schemaValidationErrors:[],schemaValidationErrorSchema:{}});return!g});if(!n.validator)throw new Error("A validator is required for Form functionality to work");this.state=this.getStateFromProps(n,n.formData),this.props.onChange&&!It(this.state.formData,this.props.formData)&&this.props.onChange(this.state),this.formElement=te.createRef()}getSnapshotBeforeUpdate(n,r){if(!It(this.props,n)){const i=Vhe(this.props.formData,n.formData),a=!It(n.schema,this.props.schema),o=i.length>0||!It(n.formData,this.props.formData),l=this.getStateFromProps(this.props,this.props.formData,a||o?void 0:this.state.retrievedSchema,a,i),c=!It(l,r);return{nextState:l,shouldUpdate:c}}return{shouldUpdate:!1}}componentDidUpdate(n,r,i){if(i.shouldUpdate){const{nextState:a}=i;!It(a.formData,this.props.formData)&&!It(a.formData,r.formData)&&this.props.onChange&&this.props.onChange(a),this.setState(a)}}getStateFromProps(n,r,i,a=!1,o=[]){var M;const l=this.state||{},c="schema"in n?n.schema:this.props.schema,f=("uiSchema"in n?n.uiSchema:this.props.uiSchema)||{},d=typeof r<"u",h="liveValidate"in n?n.liveValidate:this.props.liveValidate,m=d&&!n.noValidate&&h,g=c,v="experimental_defaultFormStateBehavior"in n?n.experimental_defaultFormStateBehavior:this.props.experimental_defaultFormStateBehavior,w="experimental_customMergeAllOf"in n?n.experimental_customMergeAllOf:this.props.experimental_customMergeAllOf;let b=l.schemaUtils;(!b||b.doesSchemaUtilsDiffer(n.validator,g,v,w))&&(b=che(n.validator,g,v,w));const _=b.getDefaultFormState(c,r),S=this.updateRetrievedSchema(i??b.retrieveSchema(c,_)),x=()=>n.noValidate||a?{errors:[],errorSchema:{}}:n.liveValidate?{errors:l.errors||[],errorSchema:l.errorSchema||{}}:{errors:l.schemaValidationErrors||[],errorSchema:l.schemaValidationErrorSchema||{}};let A,k,T=l.schemaValidationErrors,O=l.schemaValidationErrorSchema;if(m){const z=this.validate(_,c,b,S);A=z.errors,i===void 0?k=z.errorSchema:k=Oi((M=this.state)==null?void 0:M.errorSchema,z.errorSchema,"preventDuplicates"),T=A,O=k}else{const z=x();if(A=z.errors,k=z.errorSchema,o.length>0){const P=o.reduce((q,D)=>(q[D]=void 0,q),{});k=O=Oi(z.errorSchema,P,"preventDuplicates")}}if(n.extraErrors){const z=jh({errorSchema:k,errors:A},n.extraErrors);k=z.errorSchema,A=z.errors}const $=b.toIdSchema(S,f["ui:rootFieldId"],_,n.idPrefix,n.idSeparator);return{schemaUtils:b,schema:c,uiSchema:f,idSchema:$,formData:_,edit:d,errors:A,errorSchema:k,schemaValidationErrors:T,schemaValidationErrorSchema:O,retrievedSchema:S}}shouldComponentUpdate(n,r){return Dhe(this,n,r)}getPreviousCustomValidateErrors(){const{customValidate:n,uiSchema:r}=this.props,i=this.state.formData;let a={};if(typeof n=="function"){const o=n(i,fp(i),r);a=DE(o)}return a}validate(n,r=this.props.schema,i,a){const o=i||this.state.schemaUtils,{customValidate:l,transformErrors:c,uiSchema:f}=this.props,d=a??o.retrieveSchema(r,n);return o.getValidator().validateFormData(n,d,l,c,f)}renderErrors(n){const{errors:r,errorSchema:i,schema:a,uiSchema:o}=this.state,{formContext:l}=this.props,c=ot(o),f=yt("ErrorListTemplate",n,c);return r&&r.length?N.jsx(f,{errors:r,errorSchema:i||{},schema:a,uiSchema:o,formContext:l,registry:n}):null}filterErrorsBasedOnSchema(n,r,i){const{retrievedSchema:a,schemaUtils:o}=this.state,l=r??a,c=o.toPathSchema(l,"",i),f=this.getFieldNames(c,i),d=pD(n,f);(r==null?void 0:r.type)!=="object"&&(r==null?void 0:r.type)!=="array"&&(d.__errors=n.__errors);const h=this.getPreviousCustomValidateErrors(),m=(v=[],w)=>v.length===0?v:v.filter(b=>!w.includes(b)),g=(v,w={})=>(Hhe(v,(b,_)=>{const S=w[_];Wu(b)||Array.isArray(b)&&b.length===0?delete v[_]:lt(b)&<(S)&&Array.isArray(S==null?void 0:S.__errors)?v[_]=m(b.__errors,S.__errors):typeof b=="object"&&!Array.isArray(b.__errors)&&g(b,w[_])}),v);return g(d,h)}updateRetrievedSchema(n){var i;return It(n,(i=this.state)==null?void 0:i.retrievedSchema)?this.state.retrievedSchema:n}getRegistry(){var d;const{translateString:n,uiSchema:r={}}=this.props,{schemaUtils:i}=this.state,{fields:a,templates:o,widgets:l,formContext:c,translateString:f}=hge();return{fields:{...a,...this.props.fields},templates:{...o,...this.props.templates,ButtonTemplates:{...o.ButtonTemplates,...(d=this.props.templates)==null?void 0:d.ButtonTemplates}},widgets:{...l,...this.props.widgets},rootSchema:this.props.schema,formContext:this.props.formContext||c,schemaUtils:i,translateString:n||f,globalUiOptions:r[nae]}}focusOnError(n){const{idPrefix:r="root",idSeparator:i="_"}=this.props,{property:a}=n,o=DL(a);o[0]===""?o[0]=r:o.unshift(r);const l=o.join(i);let c=this.formElement.current.elements[l];c||(c=this.formElement.current.querySelector(`input[id^="${l}"`)),c&&c.length&&(c=c[0]),c&&c.focus()}validateForm(){const{omitExtraData:n}=this.props;let{formData:r}=this.state;return n===!0&&(r=this.omitExtraData(r)),this.validateFormWithFormData(r)}render(){const{children:n,id:r,idPrefix:i,idSeparator:a,className:o="",tagName:l,name:c,method:f,target:d,action:h,autoComplete:m,enctype:g,acceptcharset:v,acceptCharset:w,noHtml5Validate:b=!1,disabled:_,readonly:S,formContext:x,showErrorList:A="top",_internalFormWrapper:k}=this.props,{schema:T,uiSchema:O,formData:$,errorSchema:L,idSchema:M}=this.state,z=this.getRegistry(),{SchemaField:P}=z.fields,{SubmitButton:q}=z.templates.ButtonTemplates,D=k?l:void 0,H=k||l||"form";let{[cp]:B={}}=ot(O);_&&(B={...B,props:{...B.props,disabled:!0}});const G={[Zu]:{[cp]:B}};return N.jsxs(H,{className:o||"rjsf",id:r,name:c,method:f,target:d,action:h,autoComplete:m,encType:g,acceptCharset:w||v,noValidate:b,onSubmit:this.onSubmit,as:D,ref:this.formElement,children:[A==="top"&&this.renderErrors(z),N.jsx(P,{name:"",schema:T,uiSchema:O,errorSchema:L,idSchema:M,idPrefix:i,idSeparator:a,formContext:x,formData:$,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:z,disabled:_,readonly:S}),n||N.jsx(q,{uiSchema:G,registry:z}),A==="bottom"&&this.renderErrors(z)]})}}class mge extends KI.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.hasError?N.jsx("h1",{children:"出错了!请稍后重试。"}):this.props.children}}var Dd={exports:{}},zx={},ki={},as={},qx={},Fx={},Bx={},ND;function gp(){return ND||(ND=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(S){if(super(),!e.IDENTIFIER.test(S))throw new Error("CodeGen: name must be a valid identifier");this.str=S}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(S){super(),this._items=typeof S=="string"?[S]:S}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const S=this._items[0];return S===""||S==='""'}get str(){var S;return(S=this._str)!==null&&S!==void 0?S:this._str=this._items.reduce((x,A)=>`${x}${A}`,"")}get names(){var S;return(S=this._names)!==null&&S!==void 0?S:this._names=this._items.reduce((x,A)=>(A instanceof n&&(x[A.str]=(x[A.str]||0)+1),x),{})}}e._Code=r,e.nil=new r("");function i(_,...S){const x=[_[0]];let A=0;for(;A<S.length;)l(x,S[A]),x.push(_[++A]);return new r(x)}e._=i;const a=new r("+");function o(_,...S){const x=[g(_[0])];let A=0;for(;A<S.length;)x.push(a),l(x,S[A]),x.push(a,g(_[++A]));return c(x),new r(x)}e.str=o;function l(_,S){S instanceof r?_.push(...S._items):S instanceof n?_.push(S):_.push(h(S))}e.addCodeArg=l;function c(_){let S=1;for(;S<_.length-1;){if(_[S]===a){const x=f(_[S-1],_[S+1]);if(x!==void 0){_.splice(S-1,3,x);continue}_[S++]="+"}S++}}function f(_,S){if(S==='""')return _;if(_==='""')return S;if(typeof _=="string")return S instanceof n||_[_.length-1]!=='"'?void 0:typeof S!="string"?`${_.slice(0,-1)}${S}"`:S[0]==='"'?_.slice(0,-1)+S.slice(1):void 0;if(typeof S=="string"&&S[0]==='"'&&!(_ instanceof n))return`"${_}${S.slice(1)}`}function d(_,S){return S.emptyStr()?_:_.emptyStr()?S:o`${_}${S}`}e.strConcat=d;function h(_){return typeof _=="number"||typeof _=="boolean"||_===null?_:g(Array.isArray(_)?_.join(","):_)}function m(_){return new r(g(_))}e.stringify=m;function g(_){return JSON.stringify(_).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function v(_){return typeof _=="string"&&e.IDENTIFIER.test(_)?new r(`.${_}`):i`[${_}]`}e.getProperty=v;function w(_){if(typeof _=="string"&&e.IDENTIFIER.test(_))return new r(`${_}`);throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`)}e.getEsmExportName=w;function b(_){return new r(_.toString())}e.regexpCode=b}(Bx)),Bx}var Ux={},RD;function jD(){return RD||(RD=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=gp();class n extends Error{constructor(f){super(`CodeGen: "code" for ${f} not defined`),this.value=f.value}}var r;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class i{constructor({prefixes:f,parent:d}={}){this._names={},this._prefixes=f,this._parent=d}toName(f){return f instanceof t.Name?f:this.name(f)}name(f){return new t.Name(this._newName(f))}_newName(f){const d=this._names[f]||this._nameGroup(f);return`${f}${d.index++}`}_nameGroup(f){var d,h;if(!((h=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||h===void 0)&&h.has(f)||this._prefixes&&!this._prefixes.has(f))throw new Error(`CodeGen: prefix "${f}" is not allowed in this scope`);return this._names[f]={prefix:f,index:0}}}e.Scope=i;class a extends t.Name{constructor(f,d){super(d),this.prefix=f}setValue(f,{property:d,itemIndex:h}){this.value=f,this.scopePath=(0,t._)`.${new t.Name(d)}[${h}]`}}e.ValueScopeName=a;const o=(0,t._)`\n`;class l extends i{constructor(f){super(f),this._values={},this._scope=f.scope,this.opts={...f,_n:f.lines?o:t.nil}}get(){return this._scope}name(f){return new a(f,this._newName(f))}value(f,d){var h;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const m=this.toName(f),{prefix:g}=m,v=(h=d.key)!==null&&h!==void 0?h:d.ref;let w=this._values[g];if(w){const S=w.get(v);if(S)return S}else w=this._values[g]=new Map;w.set(v,m);const b=this._scope[g]||(this._scope[g]=[]),_=b.length;return b[_]=d.ref,m.setValue(d,{property:g,itemIndex:_}),m}getValue(f,d){const h=this._values[f];if(h)return h.get(d)}scopeRefs(f,d=this._values){return this._reduceValues(d,h=>{if(h.scopePath===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return(0,t._)`${f}${h.scopePath}`})}scopeCode(f=this._values,d,h){return this._reduceValues(f,m=>{if(m.value===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return m.value.code},d,h)}_reduceValues(f,d,h={},m){let g=t.nil;for(const v in f){const w=f[v];if(!w)continue;const b=h[v]=h[v]||new Map;w.forEach(_=>{if(b.has(_))return;b.set(_,r.Started);let S=d(_);if(S){const x=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${x} ${_} = ${S};${this.opts._n}`}else if(S=m==null?void 0:m(_))g=(0,t._)`${g}${S}${this.opts._n}`;else throw new n(_);b.set(_,r.Completed)})}return g}}e.ValueScope=l}(Ux)),Ux}var MD;function Xe(){return MD||(MD=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=gp(),n=jD();var r=gp();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var i=jD();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class a{optimizeNodes(){return this}optimizeNames(I,U){return this}}class o extends a{constructor(I,U,Y){super(),this.varKind=I,this.name=U,this.rhs=Y}render({es5:I,_n:U}){const Y=I?n.varKinds.var:this.varKind,ne=this.rhs===void 0?"":` = ${this.rhs}`;return`${Y} ${this.name}${ne};`+U}optimizeNames(I,U){if(I[this.name.str])return this.rhs&&(this.rhs=D(this.rhs,I,U)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class l extends a{constructor(I,U,Y){super(),this.lhs=I,this.rhs=U,this.sideEffects=Y}render({_n:I}){return`${this.lhs} = ${this.rhs};`+I}optimizeNames(I,U){if(!(this.lhs instanceof t.Name&&!I[this.lhs.str]&&!this.sideEffects))return this.rhs=D(this.rhs,I,U),this}get names(){const I=this.lhs instanceof t.Name?{}:{...this.lhs.names};return q(I,this.rhs)}}class c extends l{constructor(I,U,Y,ne){super(I,Y,ne),this.op=U}render({_n:I}){return`${this.lhs} ${this.op}= ${this.rhs};`+I}}class f extends a{constructor(I){super(),this.label=I,this.names={}}render({_n:I}){return`${this.label}:`+I}}class d extends a{constructor(I){super(),this.label=I,this.names={}}render({_n:I}){return`break${this.label?` ${this.label}`:""};`+I}}class h extends a{constructor(I){super(),this.error=I}render({_n:I}){return`throw ${this.error};`+I}get names(){return this.error.names}}class m extends a{constructor(I){super(),this.code=I}render({_n:I}){return`${this.code};`+I}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(I,U){return this.code=D(this.code,I,U),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class g extends a{constructor(I=[]){super(),this.nodes=I}render(I){return this.nodes.reduce((U,Y)=>U+Y.render(I),"")}optimizeNodes(){const{nodes:I}=this;let U=I.length;for(;U--;){const Y=I[U].optimizeNodes();Array.isArray(Y)?I.splice(U,1,...Y):Y?I[U]=Y:I.splice(U,1)}return I.length>0?this:void 0}optimizeNames(I,U){const{nodes:Y}=this;let ne=Y.length;for(;ne--;){const ae=Y[ne];ae.optimizeNames(I,U)||(H(I,ae.names),Y.splice(ne,1))}return Y.length>0?this:void 0}get names(){return this.nodes.reduce((I,U)=>P(I,U.names),{})}}class v extends g{render(I){return"{"+I._n+super.render(I)+"}"+I._n}}class w extends g{}class b extends v{}b.kind="else";class _ extends v{constructor(I,U){super(U),this.condition=I}render(I){let U=`if(${this.condition})`+super.render(I);return this.else&&(U+="else "+this.else.render(I)),U}optimizeNodes(){super.optimizeNodes();const I=this.condition;if(I===!0)return this.nodes;let U=this.else;if(U){const Y=U.optimizeNodes();U=this.else=Array.isArray(Y)?new b(Y):Y}if(U)return I===!1?U instanceof _?U:U.nodes:this.nodes.length?this:new _(B(I),U instanceof _?[U]:U.nodes);if(!(I===!1||!this.nodes.length))return this}optimizeNames(I,U){var Y;if(this.else=(Y=this.else)===null||Y===void 0?void 0:Y.optimizeNames(I,U),!!(super.optimizeNames(I,U)||this.else))return this.condition=D(this.condition,I,U),this}get names(){const I=super.names;return q(I,this.condition),this.else&&P(I,this.else.names),I}}_.kind="if";class S extends v{}S.kind="for";class x extends S{constructor(I){super(),this.iteration=I}render(I){return`for(${this.iteration})`+super.render(I)}optimizeNames(I,U){if(super.optimizeNames(I,U))return this.iteration=D(this.iteration,I,U),this}get names(){return P(super.names,this.iteration.names)}}class A extends S{constructor(I,U,Y,ne){super(),this.varKind=I,this.name=U,this.from=Y,this.to=ne}render(I){const U=I.es5?n.varKinds.var:this.varKind,{name:Y,from:ne,to:ae}=this;return`for(${U} ${Y}=${ne}; ${Y}<${ae}; ${Y}++)`+super.render(I)}get names(){const I=q(super.names,this.from);return q(I,this.to)}}class k extends S{constructor(I,U,Y,ne){super(),this.loop=I,this.varKind=U,this.name=Y,this.iterable=ne}render(I){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(I)}optimizeNames(I,U){if(super.optimizeNames(I,U))return this.iterable=D(this.iterable,I,U),this}get names(){return P(super.names,this.iterable.names)}}class T extends v{constructor(I,U,Y){super(),this.name=I,this.args=U,this.async=Y}render(I){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(I)}}T.kind="func";class O extends g{render(I){return"return "+super.render(I)}}O.kind="return";class $ extends v{render(I){let U="try"+super.render(I);return this.catch&&(U+=this.catch.render(I)),this.finally&&(U+=this.finally.render(I)),U}optimizeNodes(){var I,U;return super.optimizeNodes(),(I=this.catch)===null||I===void 0||I.optimizeNodes(),(U=this.finally)===null||U===void 0||U.optimizeNodes(),this}optimizeNames(I,U){var Y,ne;return super.optimizeNames(I,U),(Y=this.catch)===null||Y===void 0||Y.optimizeNames(I,U),(ne=this.finally)===null||ne===void 0||ne.optimizeNames(I,U),this}get names(){const I=super.names;return this.catch&&P(I,this.catch.names),this.finally&&P(I,this.finally.names),I}}class L extends v{constructor(I){super(),this.error=I}render(I){return`catch(${this.error})`+super.render(I)}}L.kind="catch";class M extends v{render(I){return"finally"+super.render(I)}}M.kind="finally";class z{constructor(I,U={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...U,_n:U.lines?`
|
|
262
|
-
`:""},this._extScope=I,this._scope=new n.Scope({parent:I}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(I){return this._scope.name(I)}scopeName(I){return this._extScope.name(I)}scopeValue(I,U){const Y=this._extScope.value(I,U);return(this._values[Y.prefix]||(this._values[Y.prefix]=new Set)).add(Y),Y}getScopeValue(I,U){return this._extScope.getValue(I,U)}scopeRefs(I){return this._extScope.scopeRefs(I,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(I,U,Y,ne){const ae=this._scope.toName(U);return Y!==void 0&&ne&&(this._constants[ae.str]=Y),this._leafNode(new o(I,ae,Y)),ae}const(I,U,Y){return this._def(n.varKinds.const,I,U,Y)}let(I,U,Y){return this._def(n.varKinds.let,I,U,Y)}var(I,U,Y){return this._def(n.varKinds.var,I,U,Y)}assign(I,U,Y){return this._leafNode(new l(I,U,Y))}add(I,U){return this._leafNode(new c(I,e.operators.ADD,U))}code(I){return typeof I=="function"?I():I!==t.nil&&this._leafNode(new m(I)),this}object(...I){const U=["{"];for(const[Y,ne]of I)U.length>1&&U.push(","),U.push(Y),(Y!==ne||this.opts.es5)&&(U.push(":"),(0,t.addCodeArg)(U,ne));return U.push("}"),new t._Code(U)}if(I,U,Y){if(this._blockNode(new _(I)),U&&Y)this.code(U).else().code(Y).endIf();else if(U)this.code(U).endIf();else if(Y)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(I){return this._elseNode(new _(I))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(I,U){return this._blockNode(I),U&&this.code(U).endFor(),this}for(I,U){return this._for(new x(I),U)}forRange(I,U,Y,ne,ae=this.opts.es5?n.varKinds.var:n.varKinds.let){const re=this._scope.toName(I);return this._for(new A(ae,re,U,Y),()=>ne(re))}forOf(I,U,Y,ne=n.varKinds.const){const ae=this._scope.toName(I);if(this.opts.es5){const re=U instanceof t.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,t._)`${re}.length`,le=>{this.var(ae,(0,t._)`${re}[${le}]`),Y(ae)})}return this._for(new k("of",ne,ae,U),()=>Y(ae))}forIn(I,U,Y,ne=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(I,(0,t._)`Object.keys(${U})`,Y);const ae=this._scope.toName(I);return this._for(new k("in",ne,ae,U),()=>Y(ae))}endFor(){return this._endBlockNode(S)}label(I){return this._leafNode(new f(I))}break(I){return this._leafNode(new d(I))}return(I){const U=new O;if(this._blockNode(U),this.code(I),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(O)}try(I,U,Y){if(!U&&!Y)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new $;if(this._blockNode(ne),this.code(I),U){const ae=this.name("e");this._currNode=ne.catch=new L(ae),U(ae)}return Y&&(this._currNode=ne.finally=new M,this.code(Y)),this._endBlockNode(L,M)}throw(I){return this._leafNode(new h(I))}block(I,U){return this._blockStarts.push(this._nodes.length),I&&this.code(I).endBlock(U),this}endBlock(I){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const Y=this._nodes.length-U;if(Y<0||I!==void 0&&Y!==I)throw new Error(`CodeGen: wrong number of nodes: ${Y} vs ${I} expected`);return this._nodes.length=U,this}func(I,U=t.nil,Y,ne){return this._blockNode(new T(I,U,Y)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(T)}optimize(I=1){for(;I-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(I){return this._currNode.nodes.push(I),this}_blockNode(I){this._currNode.nodes.push(I),this._nodes.push(I)}_endBlockNode(I,U){const Y=this._currNode;if(Y instanceof I||U&&Y instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${I.kind}/${U.kind}`:I.kind}"`)}_elseNode(I){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=I,this}get _root(){return this._nodes[0]}get _currNode(){const I=this._nodes;return I[I.length-1]}set _currNode(I){const U=this._nodes;U[U.length-1]=I}}e.CodeGen=z;function P(j,I){for(const U in I)j[U]=(j[U]||0)+(I[U]||0);return j}function q(j,I){return I instanceof t._CodeOrName?P(j,I.names):j}function D(j,I,U){if(j instanceof t.Name)return Y(j);if(!ne(j))return j;return new t._Code(j._items.reduce((ae,re)=>(re instanceof t.Name&&(re=Y(re)),re instanceof t._Code?ae.push(...re._items):ae.push(re),ae),[]));function Y(ae){const re=U[ae.str];return re===void 0||I[ae.str]!==1?ae:(delete I[ae.str],re)}function ne(ae){return ae instanceof t._Code&&ae._items.some(re=>re instanceof t.Name&&I[re.str]===1&&U[re.str]!==void 0)}}function H(j,I){for(const U in I)j[U]=(j[U]||0)-(I[U]||0)}function B(j){return typeof j=="boolean"||typeof j=="number"||j===null?!j:(0,t._)`!${X(j)}`}e.not=B;const G=V(e.operators.AND);function K(...j){return j.reduce(G)}e.and=K;const Q=V(e.operators.OR);function R(...j){return j.reduce(Q)}e.or=R;function V(j){return(I,U)=>I===t.nil?U:U===t.nil?I:(0,t._)`${X(I)} ${j} ${X(U)}`}function X(j){return j instanceof t.Name?j:(0,t._)`(${j})`}}(Fx)),Fx}var Ke={},$D;function ht(){if($D)return Ke;$D=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.checkStrictMode=Ke.getErrorPath=Ke.Type=Ke.useFunc=Ke.setEvaluated=Ke.evaluatedPropsToName=Ke.mergeEvaluated=Ke.eachItem=Ke.unescapeJsonPointer=Ke.escapeJsonPointer=Ke.escapeFragment=Ke.unescapeFragment=Ke.schemaRefOrVal=Ke.schemaHasRulesButRef=Ke.schemaHasRules=Ke.checkUnknownRules=Ke.alwaysValidSchema=Ke.toHash=void 0;const e=Xe(),t=gp();function n(k){const T={};for(const O of k)T[O]=!0;return T}Ke.toHash=n;function r(k,T){return typeof T=="boolean"?T:Object.keys(T).length===0?!0:(i(k,T),!a(T,k.self.RULES.all))}Ke.alwaysValidSchema=r;function i(k,T=k.schema){const{opts:O,self:$}=k;if(!O.strictSchema||typeof T=="boolean")return;const L=$.RULES.keywords;for(const M in T)L[M]||A(k,`unknown keyword: "${M}"`)}Ke.checkUnknownRules=i;function a(k,T){if(typeof k=="boolean")return!k;for(const O in k)if(T[O])return!0;return!1}Ke.schemaHasRules=a;function o(k,T){if(typeof k=="boolean")return!k;for(const O in k)if(O!=="$ref"&&T.all[O])return!0;return!1}Ke.schemaHasRulesButRef=o;function l({topSchemaRef:k,schemaPath:T},O,$,L){if(!L){if(typeof O=="number"||typeof O=="boolean")return O;if(typeof O=="string")return(0,e._)`${O}`}return(0,e._)`${k}${T}${(0,e.getProperty)($)}`}Ke.schemaRefOrVal=l;function c(k){return h(decodeURIComponent(k))}Ke.unescapeFragment=c;function f(k){return encodeURIComponent(d(k))}Ke.escapeFragment=f;function d(k){return typeof k=="number"?`${k}`:k.replace(/~/g,"~0").replace(/\//g,"~1")}Ke.escapeJsonPointer=d;function h(k){return k.replace(/~1/g,"/").replace(/~0/g,"~")}Ke.unescapeJsonPointer=h;function m(k,T){if(Array.isArray(k))for(const O of k)T(O);else T(k)}Ke.eachItem=m;function g({mergeNames:k,mergeToName:T,mergeValues:O,resultToName:$}){return(L,M,z,P)=>{const q=z===void 0?M:z instanceof e.Name?(M instanceof e.Name?k(L,M,z):T(L,M,z),z):M instanceof e.Name?(T(L,z,M),M):O(M,z);return P===e.Name&&!(q instanceof e.Name)?$(L,q):q}}Ke.mergeEvaluated={props:g({mergeNames:(k,T,O)=>k.if((0,e._)`${O} !== true && ${T} !== undefined`,()=>{k.if((0,e._)`${T} === true`,()=>k.assign(O,!0),()=>k.assign(O,(0,e._)`${O} || {}`).code((0,e._)`Object.assign(${O}, ${T})`))}),mergeToName:(k,T,O)=>k.if((0,e._)`${O} !== true`,()=>{T===!0?k.assign(O,!0):(k.assign(O,(0,e._)`${O} || {}`),w(k,O,T))}),mergeValues:(k,T)=>k===!0?!0:{...k,...T},resultToName:v}),items:g({mergeNames:(k,T,O)=>k.if((0,e._)`${O} !== true && ${T} !== undefined`,()=>k.assign(O,(0,e._)`${T} === true ? true : ${O} > ${T} ? ${O} : ${T}`)),mergeToName:(k,T,O)=>k.if((0,e._)`${O} !== true`,()=>k.assign(O,T===!0?!0:(0,e._)`${O} > ${T} ? ${O} : ${T}`)),mergeValues:(k,T)=>k===!0?!0:Math.max(k,T),resultToName:(k,T)=>k.var("items",T)})};function v(k,T){if(T===!0)return k.var("props",!0);const O=k.var("props",(0,e._)`{}`);return T!==void 0&&w(k,O,T),O}Ke.evaluatedPropsToName=v;function w(k,T,O){Object.keys(O).forEach($=>k.assign((0,e._)`${T}${(0,e.getProperty)($)}`,!0))}Ke.setEvaluated=w;const b={};function _(k,T){return k.scopeValue("func",{ref:T,code:b[T.code]||(b[T.code]=new t._Code(T.code))})}Ke.useFunc=_;var S;(function(k){k[k.Num=0]="Num",k[k.Str=1]="Str"})(S||(Ke.Type=S={}));function x(k,T,O){if(k instanceof e.Name){const $=T===S.Num;return O?$?(0,e._)`"[" + ${k} + "]"`:(0,e._)`"['" + ${k} + "']"`:$?(0,e._)`"/" + ${k}`:(0,e._)`"/" + ${k}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return O?(0,e.getProperty)(k).toString():"/"+d(k)}Ke.getErrorPath=x;function A(k,T,O=k.opts.strictSchema){if(O){if(T=`strict mode: ${T}`,O===!0)throw new Error(T);k.self.logger.warn(T)}}return Ke.checkStrictMode=A,Ke}var Id={},DD;function La(){if(DD)return Id;DD=1,Object.defineProperty(Id,"__esModule",{value:!0});const e=Xe(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Id.default=t,Id}var ID;function pm(){return ID||(ID=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Xe(),n=ht(),r=La();e.keywordError={message:({keyword:b})=>(0,t.str)`must pass "${b}" keyword validation`},e.keyword$DataError={message:({keyword:b,schemaType:_})=>_?(0,t.str)`"${b}" keyword must be ${_} ($data)`:(0,t.str)`"${b}" keyword is invalid ($data)`};function i(b,_=e.keywordError,S,x){const{it:A}=b,{gen:k,compositeRule:T,allErrors:O}=A,$=h(b,_,S);x??(T||O)?c(k,$):f(A,(0,t._)`[${$}]`)}e.reportError=i;function a(b,_=e.keywordError,S){const{it:x}=b,{gen:A,compositeRule:k,allErrors:T}=x,O=h(b,_,S);c(A,O),k||T||f(x,r.default.vErrors)}e.reportExtraError=a;function o(b,_){b.assign(r.default.errors,_),b.if((0,t._)`${r.default.vErrors} !== null`,()=>b.if(_,()=>b.assign((0,t._)`${r.default.vErrors}.length`,_),()=>b.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function l({gen:b,keyword:_,schemaValue:S,data:x,errsCount:A,it:k}){if(A===void 0)throw new Error("ajv implementation error");const T=b.name("err");b.forRange("i",A,r.default.errors,O=>{b.const(T,(0,t._)`${r.default.vErrors}[${O}]`),b.if((0,t._)`${T}.instancePath === undefined`,()=>b.assign((0,t._)`${T}.instancePath`,(0,t.strConcat)(r.default.instancePath,k.errorPath))),b.assign((0,t._)`${T}.schemaPath`,(0,t.str)`${k.errSchemaPath}/${_}`),k.opts.verbose&&(b.assign((0,t._)`${T}.schema`,S),b.assign((0,t._)`${T}.data`,x))})}e.extendErrors=l;function c(b,_){const S=b.const("err",_);b.if((0,t._)`${r.default.vErrors} === null`,()=>b.assign(r.default.vErrors,(0,t._)`[${S}]`),(0,t._)`${r.default.vErrors}.push(${S})`),b.code((0,t._)`${r.default.errors}++`)}function f(b,_){const{gen:S,validateName:x,schemaEnv:A}=b;A.$async?S.throw((0,t._)`new ${b.ValidationError}(${_})`):(S.assign((0,t._)`${x}.errors`,_),S.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function h(b,_,S){const{createErrors:x}=b.it;return x===!1?(0,t._)`{}`:m(b,_,S)}function m(b,_,S={}){const{gen:x,it:A}=b,k=[g(A,S),v(b,S)];return w(b,_,k),x.object(...k)}function g({errorPath:b},{instancePath:_}){const S=_?(0,t.str)`${b}${(0,n.getErrorPath)(_,n.Type.Str)}`:b;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,S)]}function v({keyword:b,it:{errSchemaPath:_}},{schemaPath:S,parentSchema:x}){let A=x?_:(0,t.str)`${_}/${b}`;return S&&(A=(0,t.str)`${A}${(0,n.getErrorPath)(S,n.Type.Str)}`),[d.schemaPath,A]}function w(b,{params:_,message:S},x){const{keyword:A,data:k,schemaValue:T,it:O}=b,{opts:$,propertyName:L,topSchemaRef:M,schemaPath:z}=O;x.push([d.keyword,A],[d.params,typeof _=="function"?_(b):_||(0,t._)`{}`]),$.messages&&x.push([d.message,typeof S=="function"?S(b):S]),$.verbose&&x.push([d.schema,T],[d.parentSchema,(0,t._)`${M}${z}`],[r.default.data,k]),L&&x.push([d.propertyName,L])}}(qx)),qx}var PD;function gge(){if(PD)return as;PD=1,Object.defineProperty(as,"__esModule",{value:!0}),as.boolOrEmptySchema=as.topBoolOrEmptySchema=void 0;const e=pm(),t=Xe(),n=La(),r={message:"boolean schema is false"};function i(l){const{gen:c,schema:f,validateName:d}=l;f===!1?o(l,!1):typeof f=="object"&&f.$async===!0?c.return(n.default.data):(c.assign((0,t._)`${d}.errors`,null),c.return(!0))}as.topBoolOrEmptySchema=i;function a(l,c){const{gen:f,schema:d}=l;d===!1?(f.var(c,!1),o(l)):f.var(c,!0)}as.boolOrEmptySchema=a;function o(l,c){const{gen:f,data:d}=l,h={gen:f,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:l};(0,e.reportError)(h,r,void 0,c)}return as}var pn={},ss={},LD;function YL(){if(LD)return ss;LD=1,Object.defineProperty(ss,"__esModule",{value:!0}),ss.getRules=ss.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function n(i){return typeof i=="string"&&t.has(i)}ss.isJSONType=n;function r(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return ss.getRules=r,ss}var Ai={},zD;function ZL(){if(zD)return Ai;zD=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.shouldUseRule=Ai.shouldUseGroup=Ai.schemaHasRulesForType=void 0;function e({schema:r,self:i},a){const o=i.RULES.types[a];return o&&o!==!0&&t(r,o)}Ai.schemaHasRulesForType=e;function t(r,i){return i.rules.some(a=>n(r,a))}Ai.shouldUseGroup=t;function n(r,i){var a;return r[i.keyword]!==void 0||((a=i.definition.implements)===null||a===void 0?void 0:a.some(o=>r[o]!==void 0))}return Ai.shouldUseRule=n,Ai}var qD;function yp(){if(qD)return pn;qD=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.reportTypeError=pn.checkDataTypes=pn.checkDataType=pn.coerceAndCheckDataType=pn.getJSONTypes=pn.getSchemaTypes=pn.DataType=void 0;const e=YL(),t=ZL(),n=pm(),r=Xe(),i=ht();var a;(function(S){S[S.Correct=0]="Correct",S[S.Wrong=1]="Wrong"})(a||(pn.DataType=a={}));function o(S){const x=l(S.type);if(x.includes("null")){if(S.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!x.length&&S.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');S.nullable===!0&&x.push("null")}return x}pn.getSchemaTypes=o;function l(S){const x=Array.isArray(S)?S:S?[S]:[];if(x.every(e.isJSONType))return x;throw new Error("type must be JSONType or JSONType[]: "+x.join(","))}pn.getJSONTypes=l;function c(S,x){const{gen:A,data:k,opts:T}=S,O=d(x,T.coerceTypes),$=x.length>0&&!(O.length===0&&x.length===1&&(0,t.schemaHasRulesForType)(S,x[0]));if($){const L=v(x,k,T.strictNumbers,a.Wrong);A.if(L,()=>{O.length?h(S,x,O):b(S)})}return $}pn.coerceAndCheckDataType=c;const f=new Set(["string","number","integer","boolean","null"]);function d(S,x){return x?S.filter(A=>f.has(A)||x==="array"&&A==="array"):[]}function h(S,x,A){const{gen:k,data:T,opts:O}=S,$=k.let("dataType",(0,r._)`typeof ${T}`),L=k.let("coerced",(0,r._)`undefined`);O.coerceTypes==="array"&&k.if((0,r._)`${$} == 'object' && Array.isArray(${T}) && ${T}.length == 1`,()=>k.assign(T,(0,r._)`${T}[0]`).assign($,(0,r._)`typeof ${T}`).if(v(x,T,O.strictNumbers),()=>k.assign(L,T))),k.if((0,r._)`${L} !== undefined`);for(const z of A)(f.has(z)||z==="array"&&O.coerceTypes==="array")&&M(z);k.else(),b(S),k.endIf(),k.if((0,r._)`${L} !== undefined`,()=>{k.assign(T,L),m(S,L)});function M(z){switch(z){case"string":k.elseIf((0,r._)`${$} == "number" || ${$} == "boolean"`).assign(L,(0,r._)`"" + ${T}`).elseIf((0,r._)`${T} === null`).assign(L,(0,r._)`""`);return;case"number":k.elseIf((0,r._)`${$} == "boolean" || ${T} === null
|
|
260
|
+
`,!a.some(T=>T.test(k))&&(x+=k,!!k.trim())));const A=Qu(x);return A===""?null:[x,,A]}),i:3,u:$x,l:(_,S,x)=>l("p",{key:x.key},S(_.children,x))},22:{t:["["],o:wa(Tpe),i:0,u:_=>(h[_[1]]={target:_[2],title:_[4]},{}),l:Ix},23:{t:["!["],o:Sa(Cpe),i:0,u:_=>({alt:_[1]?Hr(_[1]):void 0,ref:_[2]}),l:(_,S,x)=>h[_.ref]?l("img",{key:x.key,alt:_.alt,src:r(h[_.ref].target,"img","src"),title:h[_.ref].title}):null},24:{t:_=>_[0]==="["&&_.indexOf("](")===-1,o:wa(Ope),i:0,u:(_,S,x)=>({children:S(_[1],x),fallbackChildren:_[0],ref:_[2]}),l:(_,S,x)=>h[_.ref]?l("a",{key:x.key,href:r(h[_.ref].target,"a","href"),title:h[_.ref].title},S(_.children,x)):l("span",{key:x.key},_.fallbackChildren)},25:{t:["|"],o:Ei(AD),i:1,u:tme,l(_,S,x){const A=_;return l("table",{key:x.key},l("thead",null,l("tr",null,A.header.map(function(k,T){return l("th",{key:T,style:OD(A,T)},S(k,x))}))),l("tbody",null,A.cells.map(function(k,T){return l("tr",{key:T},k.map(function(O,$){return l("td",{key:$,style:OD(A,$)},S(O,x))}))})))}},27:{o:il(function(_,S){let x;return Mh(_,":")&&(x=qpe.exec(_)),x||Upe.exec(_)}),i:4,u(_){const S=_[0];return{text:S.indexOf("&")===-1?S:S.replace(vpe,(x,A)=>t.namedCodesToUnicode[A]||x)}},l:_=>_.text},28:{t:["**","__"],o:Sa(Ipe),i:2,u:(_,S,x)=>({children:S(_[2],x)}),l:(_,S,x)=>l("strong",{key:x.key},S(_.children,x))},29:{t:_=>{const S=_[0];return(S==="*"||S==="_")&&_[1]!==S},o:Sa(Ppe),i:3,u:(_,S,x)=>({children:S(_[2],x)}),l:(_,S,x)=>l("em",{key:x.key},S(_.children,x))},30:{t:["\\"],o:Sa(Fpe),i:1,u:_=>({text:_[1],type:"27"})},31:{t:["=="],o:Sa(Lpe),i:3,u:$x,l:(_,S,x)=>l("mark",{key:x.key},S(_.children,x))},32:{t:["~~"],o:Sa(zpe),i:3,u:$x,l:(_,S,x)=>l("del",{key:x.key},S(_.children,x))}};t.disableParsingRawHTML===!0&&(delete m[11],delete m[13]);const g=function(_){var S=Object.keys(_);function x(A,k){var T=[];if(k.prevCapture=k.prevCapture||"",A.trim())for(;A;)for(var O=0;O<S.length;){var $=S[O],L=_[$];if(!L.t||Jpe(A,k,L.t)){var M=L.o(A,k);if(M&&M[0]){A=A.substring(M[0].length);var z=L.u(M,x,k);k.prevCapture+=M[0],z.type||(z.type=$),T.push(z);break}O++}else O++}return k.prevCapture="",T}return S.sort(function(A,k){return _[A].i-_[k].i||(A<k?-1:1)}),function(A,k){return x(function(T){return T.replace(hpe,`
|
|
261
|
+
`).replace(gpe,"").replace(Rpe," ")}(A),k)}}(m),v=(w=function(_,S){return function(x,A,k){const T=_[x.type].l;return S?S(()=>T(x,A,k),x,A,k):T(x,A,k)}}(m,t.renderRule),function _(S,x={}){if(Array.isArray(S)){const A=x.key,k=[];let T=!1;for(let O=0;O<S.length;O++){x.key=O;const $=_(S[O],x),L=typeof $=="string";L&&T?k[k.length-1]+=$:$!==null&&k.push($),T=L}return x.key=A,k}return w(S,_,x)});var w;const b=c(e);return d.length?l("div",null,b,l("footer",{key:"footer"},d.map(function(_){return l("div",{id:n(_.identifier,ju),key:_.identifier},_.identifier,v(g(_.footnote,{inline:!0})))}))):b}const hm=e=>{let{children:t="",options:n}=e,r=function(i,a){if(i==null)return{};var o,l,c={},f=Object.keys(i);for(l=0;l<f.length;l++)a.indexOf(o=f[l])>=0||(c[o]=i[o]);return c}(e,tpe);return te.cloneElement(ome(t,n),r)};function lme(e,t){return e==null?!0:p6(e,t)}class ume extends te.Component{constructor(){super(...arguments);De(this,"state",{wasPropertyKeyModified:!1,additionalProperties:{}});De(this,"onPropertyChange",(n,r=!1)=>(i,a,o)=>{const{formData:l,onChange:c,errorSchema:f}=this.props;i===void 0&&r&&(i="");const d={...l,[n]:i};c(d,f&&f&&{...f,[n]:a},o)});De(this,"onDropPropertyClick",n=>r=>{r.preventDefault();const{onChange:i,formData:a}=this.props,o={...a};lme(o,n),i(o)});De(this,"getAvailableKey",(n,r)=>{const{uiSchema:i,registry:a}=this.props,{duplicateKeySuffixSeparator:o="-"}=ot(i,a.globalUiOptions);let l=0,c=n;for(;An(r,c);)c=`${n}${o}${++l}`;return c});De(this,"onKeyChange",n=>(r,i)=>{if(n===r)return;const{formData:a,onChange:o,errorSchema:l}=this.props;r=this.getAvailableKey(r,a);const c={...a},f={[n]:r},d=Object.keys(c).map(m=>({[f[m]||m]:c[m]})),h=Object.assign({},...d);this.setState({wasPropertyKeyModified:!0}),o(h,l&&l&&{...l,[r]:i})});De(this,"handleAddClick",n=>()=>{if(!n.additionalProperties)return;const{formData:r,onChange:i,registry:a}=this.props,o={...r};let l,c,f;if(Mt(n.additionalProperties)){l=n.additionalProperties.type,c=n.additionalProperties.const,f=n.additionalProperties.default;let m=n.additionalProperties;if(rn in m){const{schemaUtils:g}=a;m=g.retrieveSchema({$ref:m[rn]},r),l=m.type,c=m.const,f=m.default}!l&&(Mr in m||tr in m)&&(l="object")}const d=this.getAvailableKey("newKey",o),h=c??f??this.getDefaultValue(l);mn(o,d,h),i(o)})}isRequired(n){const{schema:r}=this.props;return Array.isArray(r.required)&&r.required.indexOf(n)!==-1}getDefaultValue(n){const{registry:{translateString:r}}=this.props;switch(n){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};case"string":default:return r(Tt.NewStringDefault)}}render(){const{schema:n,uiSchema:r={},formData:i,errorSchema:a,idSchema:o,name:l,required:c=!1,disabled:f,readonly:d,hideError:h,idPrefix:m,idSeparator:g,onBlur:v,onFocus:w,registry:b,title:_}=this.props,{fields:S,formContext:x,schemaUtils:A,translateString:k,globalUiOptions:T}=b,{SchemaField:O}=S,$=A.retrieveSchema(n,i),L=ot(r,T),{properties:M={}}=$,z=L.title??$.title??_??l,P=L.description??$.description;let q;try{const B=Object.keys(M);q=Dhe(B,L.order)}catch(B){return N.jsxs("div",{children:[N.jsx("p",{className:"config-error",style:{color:"red"},children:N.jsx(hm,{options:{disableParsingRawHTML:!0},children:k(Tt.InvalidObjectField,[l||"root",B.message])})}),N.jsx("pre",{children:JSON.stringify($)})]})}const D=yt("ObjectFieldTemplate",b,L),H={title:L.label===!1?"":z,description:L.label===!1?void 0:P,properties:q.map(B=>{const G=An($,[Bt,B,Mc]),K=G?r.additionalProperties:r[B],Q=ot(K).widget==="hidden",R=Ne(o,[B],{});return{content:N.jsx(O,{name:B,required:this.isRequired(B),schema:Ne($,[Bt,B],{}),uiSchema:K,errorSchema:Ne(a,B),idSchema:R,idPrefix:m,idSeparator:g,formData:Ne(i,B),formContext:x,wasPropertyKeyModified:this.state.wasPropertyKeyModified,onKeyChange:this.onKeyChange(B),onChange:this.onPropertyChange(B,G),onBlur:v,onFocus:w,registry:b,disabled:f,readonly:d,hideError:h,onDropPropertyClick:this.onDropPropertyClick},B),name:B,readonly:d,disabled:f,required:c,hidden:Q}}),readonly:d,disabled:f,required:c,idSchema:o,uiSchema:r,errorSchema:a,schema:$,formData:i,formContext:x,registry:b};return N.jsx(D,{...H,onAddClick:this.handleAddClick})}}const cme={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function fme(e,t,n,r){const i=t.field,{fields:a,translateString:o}=r;if(typeof i=="function")return i;if(typeof i=="string"&&i in a)return a[i];const l=Ii(e),c=Array.isArray(l)?l[0]:l||"",f=e.$id;let d=cme[c];return f&&f in a&&(d=f),!d&&(e.anyOf||e.oneOf)?()=>null:d in a?a[d]:()=>{const h=yt("UnsupportedFieldTemplate",r,t);return N.jsx(h,{schema:e,idSchema:n,reason:o(Tt.UnknownFieldType,[String(e.type)]),registry:r})}}function dme(e){const{schema:t,idSchema:n,uiSchema:r,formData:i,errorSchema:a,idPrefix:o,idSeparator:l,name:c,onChange:f,onKeyChange:d,onDropPropertyClick:h,required:m,registry:g,wasPropertyKeyModified:v=!1}=e,{formContext:w,schemaUtils:b,globalUiOptions:_}=g,S=ot(r,_),x=yt("FieldTemplate",g,S),A=yt("DescriptionFieldTemplate",g,S),k=yt("FieldHelpTemplate",g,S),T=yt("FieldErrorTemplate",g,S),O=b.retrieveSchema(t,i),$=n[Ra],L=Oi(b.toIdSchema(O,$,i,o,l),n),M=te.useCallback((me,xe,we)=>f(me,xe,we||$),[$,f]),z=fme(O,S,L,g),P=!!(S.disabled??e.disabled),q=!!(S.readonly??(e.readonly||e.schema.readOnly||O.readOnly)),D=S.hideError,H=D===void 0?e.hideError:!!D,B=!!(S.autofocus??e.autofocus);if(Object.keys(O).length===0)return null;const G=b.getDisplayLabel(O,r,_),{__errors:K,...Q}=a||{},R=pp(r,["ui:classNames","classNames","ui:style"]);Zu in R&&(R[Zu]=pp(R[Zu],["classNames","style"]));const V=N.jsx(z,{...e,onChange:M,idSchema:L,schema:O,uiSchema:R,disabled:P,readonly:q,hideError:H,autofocus:B,errorSchema:Q,formContext:w,rawErrors:K}),X=L[Ra];let j;v?j=c:j=Mc in O?c:S.title||e.schema.title||O.title||e.title||c;const I=S.description||e.schema.description||O.description||"",U=S.enableMarkdownInDescription?N.jsx(hm,{options:{disableParsingRawHTML:!0},children:I}):I,Y=S.help,ne=S.widget==="hidden",ae=["form-group","field",`field-${Ii(O)}`];!H&&K&&K.length>0&&ae.push("field-error has-error has-danger"),r!=null&&r.classNames&&ae.push(r.classNames),S.classNames&&ae.push(S.classNames);const re=N.jsx(k,{help:Y,idSchema:L,schema:O,uiSchema:r,hasErrors:!H&&K&&K.length>0,registry:g}),le=H||(O.anyOf||O.oneOf)&&!b.isSelect(O)?void 0:N.jsx(T,{errors:K,errorSchema:a,idSchema:L,schema:O,uiSchema:r,registry:g}),W={description:N.jsx(A,{id:Uc(X),description:U,schema:O,uiSchema:r,registry:g}),rawDescription:I,help:re,rawHelp:typeof Y=="string"?Y:void 0,errors:le,rawErrors:H?void 0:K,id:X,label:j,hidden:ne,onChange:f,onKeyChange:d,onDropPropertyClick:h,required:m,disabled:P,readonly:q,hideError:H,displayLabel:G,classNames:ae.join(" ").trim(),style:S.style,formContext:w,formData:i,schema:O,uiSchema:r,registry:g},J=g.fields.AnyOfField,se=g.fields.OneOfField,fe=(r==null?void 0:r["ui:field"])&&(r==null?void 0:r["ui:fieldReplacesAnyOrOneOf"])===!0;return N.jsx(x,{...W,children:N.jsxs(N.Fragment,{children:[V,O.anyOf&&!fe&&!b.isSelect(O)&&N.jsx(J,{name:c,disabled:P,readonly:q,hideError:H,errorSchema:a,formData:i,formContext:w,idPrefix:o,idSchema:L,idSeparator:l,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:O.anyOf.map(me=>b.retrieveSchema(Mt(me)?me:{},i)),registry:g,required:m,schema:O,uiSchema:r}),O.oneOf&&!fe&&!b.isSelect(O)&&N.jsx(se,{name:c,disabled:P,readonly:q,hideError:H,errorSchema:a,formData:i,formContext:w,idPrefix:o,idSchema:L,idSeparator:l,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:O.oneOf.map(me=>b.retrieveSchema(Mt(me)?me:{},i)),registry:g,required:m,schema:O,uiSchema:r})]})})}class hme extends te.Component{shouldComponentUpdate(t){return!It(this.props,t)}render(){return N.jsx(dme,{...this.props})}}function pme(e){const{schema:t,name:n,uiSchema:r,idSchema:i,formData:a,required:o,disabled:l=!1,readonly:c=!1,autofocus:f=!1,onChange:d,onBlur:h,onFocus:m,registry:g,rawErrors:v,hideError:w}=e,{title:b,format:_}=t,{widgets:S,formContext:x,schemaUtils:A,globalUiOptions:k}=g,T=A.isSelect(t)?xc(t,r):void 0;let O=T?"select":"text";_&&jhe(t,_,S)&&(O=_);const{widget:$=O,placeholder:L="",title:M,...z}=ot(r),P=A.getDisplayLabel(t,r,k),q=M??b??n,D=ji(t,$,S);return N.jsx(D,{options:{...z,enumOptions:T},schema:t,uiSchema:r,id:i.$id,name:n,label:q,hideLabel:!P,hideError:w,value:a,onChange:d,onBlur:h,onFocus:m,required:o,disabled:l,readonly:c,formContext:x,autofocus:f,registry:g,placeholder:L,rawErrors:v})}function mme(e){const{formData:t,onChange:n}=e;return te.useEffect(()=>{t===void 0&&n(null)},[t,n]),null}function gme(){return{AnyOfField:gD,ArrayField:Xhe,BooleanField:Whe,NumberField:epe,ObjectField:ume,OneOfField:gD,SchemaField:hme,StringField:pme,NullField:mme}}function yme(e){const{idSchema:t,description:n,registry:r,schema:i,uiSchema:a}=e,o=ot(a,r.globalUiOptions),{label:l=!0}=o;if(!n||!l)return null;const c=yt("DescriptionFieldTemplate",r,o);return N.jsx(c,{id:Uc(t),description:n,schema:i,uiSchema:a,registry:r})}function bme(e){const{children:t,className:n,disabled:r,hasToolbar:i,hasMoveDown:a,hasMoveUp:o,hasRemove:l,hasCopy:c,index:f,onCopyIndexClick:d,onDropIndexClick:h,onReorderClick:m,readonly:g,registry:v,uiSchema:w}=e,{CopyButton:b,MoveDownButton:_,MoveUpButton:S,RemoveButton:x}=v.templates.ButtonTemplates,A={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return N.jsxs("div",{className:n,children:[N.jsx("div",{className:i?"col-xs-9":"col-xs-12",children:t}),i&&N.jsx("div",{className:"col-xs-3 array-item-toolbox",children:N.jsxs("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"},children:[(o||a)&&N.jsx(S,{style:A,disabled:r||g||!o,onClick:m(f,f-1),uiSchema:w,registry:v}),(o||a)&&N.jsx(_,{style:A,disabled:r||g||!a,onClick:m(f,f+1),uiSchema:w,registry:v}),c&&N.jsx(b,{style:A,disabled:r||g,onClick:d(f),uiSchema:w,registry:v}),l&&N.jsx(x,{style:A,disabled:r||g,onClick:h(f),uiSchema:w,registry:v})]})})]})}function vme(e){const{canAdd:t,className:n,disabled:r,idSchema:i,uiSchema:a,items:o,onAddClick:l,readonly:c,registry:f,required:d,schema:h,title:m}=e,g=ot(a),v=yt("ArrayFieldDescriptionTemplate",f,g),w=yt("ArrayFieldItemTemplate",f,g),b=yt("ArrayFieldTitleTemplate",f,g),{ButtonTemplates:{AddButton:_}}=f.templates;return N.jsxs("fieldset",{className:n,id:i.$id,children:[N.jsx(b,{idSchema:i,title:g.title||m,required:d,schema:h,uiSchema:a,registry:f}),N.jsx(v,{idSchema:i,description:g.description||h.description,schema:h,uiSchema:a,registry:f}),N.jsx("div",{className:"row array-item-list",children:o&&o.map(({key:S,...x})=>N.jsx(w,{...x},S))}),t&&N.jsx(_,{className:"array-item-add",onClick:l,disabled:r||c,uiSchema:a,registry:f})]})}function _me(e){const{idSchema:t,title:n,schema:r,uiSchema:i,required:a,registry:o}=e,l=ot(i,o.globalUiOptions),{label:c=!0}=l;if(!n||!c)return null;const f=yt("TitleFieldTemplate",o,l);return N.jsx(f,{id:ML(t),title:n,required:a,schema:r,uiSchema:i,registry:o})}function xme(e){const{id:t,name:n,value:r,readonly:i,disabled:a,autofocus:o,onBlur:l,onFocus:c,onChange:f,onChangeOverride:d,options:h,schema:m,uiSchema:g,formContext:v,registry:w,rawErrors:b,type:_,hideLabel:S,hideError:x,...A}=e;if(!t)throw console.log("No id for",e),new Error(`no id for props ${JSON.stringify(e)}`);const k={...A,...Ehe(m,_,h)};let T;k.type==="number"||k.type==="integer"?T=r||r===0?r:"":T=r??"";const O=te.useCallback(({target:{value:M}})=>f(M===""?h.emptyValue:M),[f,h]),$=te.useCallback(({target:M})=>l(t,M&&M.value),[l,t]),L=te.useCallback(({target:M})=>c(t,M&&M.value),[c,t]);return N.jsxs(N.Fragment,{children:[N.jsx("input",{id:t,name:t,className:"form-control",readOnly:i,disabled:a,autoFocus:o,value:T,...k,list:m.examples?Xw(t):void 0,onChange:d||O,onBlur:$,onFocus:L,"aria-describedby":Is(t,!!m.examples)}),Array.isArray(m.examples)&&N.jsx("datalist",{id:Xw(t),children:m.examples.concat(m.default&&!m.examples.includes(m.default)?[m.default]:[]).map(M=>N.jsx("option",{value:M},M))},`datalist_${t}`)]})}function wme({uiSchema:e}){const{submitText:t,norender:n,props:r={}}=khe(e);return n?null:N.jsx("div",{children:N.jsx("button",{type:"submit",...r,className:`btn btn-info ${r.className||""}`,children:t})})}function Vc(e){const{iconType:t="default",icon:n,className:r,uiSchema:i,registry:a,...o}=e;return N.jsx("button",{type:"button",className:`btn btn-${t} ${r}`,...o,children:N.jsx("i",{className:`glyphicon glyphicon-${n}`})})}function Sme(e){const{registry:{translateString:t}}=e;return N.jsx(Vc,{title:t(Tt.CopyButton),className:"array-item-copy",...e,icon:"copy"})}function Eme(e){const{registry:{translateString:t}}=e;return N.jsx(Vc,{title:t(Tt.MoveDownButton),className:"array-item-move-down",...e,icon:"arrow-down"})}function kme(e){const{registry:{translateString:t}}=e;return N.jsx(Vc,{title:t(Tt.MoveUpButton),className:"array-item-move-up",...e,icon:"arrow-up"})}function Ame(e){const{registry:{translateString:t}}=e;return N.jsx(Vc,{title:t(Tt.RemoveButton),className:"array-item-remove",...e,iconType:"danger",icon:"remove"})}function Tme({className:e,onClick:t,disabled:n,registry:r}){const{translateString:i}=r;return N.jsx("div",{className:"row",children:N.jsx("p",{className:`col-xs-3 col-xs-offset-9 text-right ${e}`,children:N.jsx(Vc,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:i(Tt.AddButton),onClick:t,disabled:n,registry:r})})})}function Cme(){return{SubmitButton:wme,AddButton:Tme,CopyButton:Sme,MoveDownButton:Eme,MoveUpButton:kme,RemoveButton:Ame}}function Ome(e){const{id:t,description:n}=e;return n?typeof n=="string"?N.jsx("p",{id:t,className:"field-description",children:n}):N.jsx("div",{id:t,className:"field-description",children:n}):null}function Nme({errors:e,registry:t}){const{translateString:n}=t;return N.jsxs("div",{className:"panel panel-danger errors",children:[N.jsx("div",{className:"panel-heading",children:N.jsx("h3",{className:"panel-title",children:n(Tt.ErrorsLabel)})}),N.jsx("ul",{className:"list-group",children:e.map((r,i)=>N.jsx("li",{className:"list-group-item text-danger",children:r.stack},i))})]})}const Rme="*";function HL(e){const{label:t,required:n,id:r}=e;return t?N.jsxs("label",{className:"control-label",htmlFor:r,children:[t,n&&N.jsx("span",{className:"required",children:Rme})]}):null}function jme(e){const{id:t,label:n,children:r,errors:i,help:a,description:o,hidden:l,required:c,displayLabel:f,registry:d,uiSchema:h}=e,m=ot(h),g=yt("WrapIfAdditionalTemplate",d,m);return l?N.jsx("div",{className:"hidden",children:r}):N.jsxs(g,{...e,children:[f&&N.jsx(HL,{label:n,required:c,id:t}),f&&o?o:null,r,i,a]})}function Mme(e){const{errors:t=[],idSchema:n}=e;if(t.length===0)return null;const r=RL(n);return N.jsx("div",{children:N.jsx("ul",{id:r,className:"error-detail bs-callout bs-callout-info",children:t.filter(i=>!!i).map((i,a)=>N.jsx("li",{className:"text-danger",children:i},a))})})}function $me(e){const{idSchema:t,help:n}=e;if(!n)return null;const r=jL(t);return typeof n=="string"?N.jsx("p",{id:r,className:"help-block",children:n}):N.jsx("div",{id:r,className:"help-block",children:n})}function Dme(e){const{description:t,disabled:n,formData:r,idSchema:i,onAddClick:a,properties:o,readonly:l,registry:c,required:f,schema:d,title:h,uiSchema:m}=e,g=ot(m),v=yt("TitleFieldTemplate",c,g),w=yt("DescriptionFieldTemplate",c,g),{ButtonTemplates:{AddButton:b}}=c.templates;return N.jsxs("fieldset",{id:i.$id,children:[h&&N.jsx(v,{id:ML(i),title:h,required:f,schema:d,uiSchema:m,registry:c}),t&&N.jsx(w,{id:Uc(i),description:t,schema:d,uiSchema:m,registry:c}),o.map(_=>_.content),iae(d,m,r)&&N.jsx(b,{className:"object-property-expand",onClick:a(d),disabled:n||l,uiSchema:m,registry:c})]})}const Ime="*";function Pme(e){const{id:t,title:n,required:r}=e;return N.jsxs("legend",{id:t,children:[n,r&&N.jsx("span",{className:"required",children:Ime})]})}function Lme(e){const{schema:t,idSchema:n,reason:r,registry:i}=e,{translateString:a}=i;let o=Tt.UnsupportedField;const l=[];return n&&n.$id&&(o=Tt.UnsupportedFieldWithId,l.push(n.$id)),r&&(o=o===Tt.UnsupportedField?Tt.UnsupportedFieldWithReason:Tt.UnsupportedFieldWithIdAndReason,l.push(r)),N.jsxs("div",{className:"unsupported-field",children:[N.jsx("p",{children:N.jsx(hm,{options:{disableParsingRawHTML:!0},children:a(o,l)})}),t&&N.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function zme(e){const{id:t,classNames:n,style:r,disabled:i,label:a,onKeyChange:o,onDropPropertyClick:l,readonly:c,required:f,schema:d,children:h,uiSchema:m,registry:g}=e,{templates:v,translateString:w}=g,{RemoveButton:b}=v.ButtonTemplates,_=w(Tt.KeyLabel,[a]);return Mc in d?N.jsx("div",{className:n,style:r,children:N.jsxs("div",{className:"row",children:[N.jsx("div",{className:"col-xs-5 form-additional",children:N.jsxs("div",{className:"form-group",children:[N.jsx(HL,{label:_,required:f,id:`${t}-key`}),N.jsx("input",{className:"form-control",type:"text",id:`${t}-key`,onBlur:({target:x})=>o(x&&x.value),defaultValue:a})]})}),N.jsx("div",{className:"form-additional form-group col-xs-5",children:h}),N.jsx("div",{className:"col-xs-2",children:N.jsx(b,{className:"array-item-remove btn-block",style:{border:"0"},disabled:i||c,onClick:l(a),uiSchema:m,registry:g})})]})}):N.jsx("div",{className:n,style:r,children:h})}function qme(){return{ArrayFieldDescriptionTemplate:yme,ArrayFieldItemTemplate:bme,ArrayFieldTemplate:vme,ArrayFieldTitleTemplate:_me,ButtonTemplates:Cme(),BaseInputTemplate:xme,DescriptionFieldTemplate:Ome,ErrorListTemplate:Nme,FieldTemplate:jme,FieldErrorTemplate:Mme,FieldHelpTemplate:$me,ObjectFieldTemplate:Dme,TitleFieldTemplate:Pme,UnsupportedFieldTemplate:Lme,WrapIfAdditionalTemplate:zme}}function Fme(e){return Object.values(e).every(t=>t!==-1)}function Bme({type:e,range:t,value:n,select:r,rootId:i,name:a,disabled:o,readonly:l,autofocus:c,registry:f,onBlur:d,onFocus:h}){const m=i+"_"+e,{SelectWidget:g}=f.widgets;return N.jsx(g,{schema:{type:"integer"},id:m,name:a,className:"form-control",options:{enumOptions:OL(t[0],t[1])},placeholder:e,value:n,disabled:o,readonly:l,autofocus:c,onChange:v=>r(e,v),onBlur:d,onFocus:h,registry:f,label:"","aria-describedby":Is(i)})}function Ume({time:e=!1,disabled:t=!1,readonly:n=!1,autofocus:r=!1,options:i,id:a,name:o,registry:l,onBlur:c,onFocus:f,onChange:d,value:h}){const{translateString:m}=l,[g,v]=te.useState(h),[w,b]=te.useReducer((A,k)=>({...A,...k}),Rx(h,e));te.useEffect(()=>{const A=hD(w,e);Fme(w)&&A!==h?d(A):g!==h&&(v(h),b(Rx(h,e)))},[e,h,d,w,g]);const _=te.useCallback((A,k)=>{b({[A]:k})},[]),S=te.useCallback(A=>{if(A.preventDefault(),t||n)return;const k=Rx(new Date().toJSON(),e);d(hD(k,e))},[t,n,e]),x=te.useCallback(A=>{A.preventDefault(),!(t||n)&&d(void 0)},[t,n,d]);return N.jsxs("ul",{className:"list-inline",children:[whe(w,e,i.yearsRange,i.format).map((A,k)=>N.jsx("li",{className:"list-inline-item",children:N.jsx(Bme,{rootId:a,name:o,select:_,...A,disabled:t,readonly:n,registry:l,onBlur:c,onFocus:f,autofocus:r&&k===0})},k)),(i.hideNowButton!=="undefined"?!i.hideNowButton:!0)&&N.jsx("li",{className:"list-inline-item",children:N.jsx("a",{href:"#",className:"btn btn-info btn-now",onClick:S,children:m(Tt.NowLabel)})}),(i.hideClearButton!=="undefined"?!i.hideClearButton:!0)&&N.jsx("li",{className:"list-inline-item",children:N.jsx("a",{href:"#",className:"btn btn-warning btn-clear",onClick:x,children:m(Tt.ClearLabel)})})]})}function Vme({time:e=!0,...t}){const{AltDateWidget:n}=t.registry.widgets;return N.jsx(n,{time:e,...t})}function Hme({schema:e,uiSchema:t,options:n,id:r,value:i,disabled:a,readonly:o,label:l,hideLabel:c,autofocus:f=!1,onBlur:d,onFocus:h,onChange:m,registry:g}){const v=yt("DescriptionFieldTemplate",g,n),w=Rh(e),b=te.useCallback(A=>m(A.target.checked),[m]),_=te.useCallback(A=>d(r,A.target.checked),[d,r]),S=te.useCallback(A=>h(r,A.target.checked),[h,r]),x=n.description??e.description;return N.jsxs("div",{className:`checkbox ${a||o?"disabled":""}`,children:[!c&&!!x&&N.jsx(v,{id:Uc(r),description:x,schema:e,uiSchema:t,registry:g}),N.jsxs("label",{children:[N.jsx("input",{type:"checkbox",id:r,name:r,checked:typeof i>"u"?!1:i,required:w,disabled:a||o,autoFocus:f,onChange:b,onBlur:_,onFocus:S,"aria-describedby":Is(r)}),Mhe(N.jsx("span",{children:l}),c)]})]})}function Gme({id:e,disabled:t,options:{inline:n=!1,enumOptions:r,enumDisabled:i,emptyValue:a},value:o,autofocus:l=!1,readonly:c,onChange:f,onBlur:d,onFocus:h}){const m=Array.isArray(o)?o:[o],g=te.useCallback(({target:w})=>d(e,Qr(w&&w.value,r,a)),[d,e]),v=te.useCallback(({target:w})=>h(e,Qr(w&&w.value,r,a)),[h,e]);return N.jsx("div",{className:"checkboxes",id:e,children:Array.isArray(r)&&r.map((w,b)=>{const _=$E(w.value,m),S=Array.isArray(i)&&i.indexOf(w.value)!==-1,x=t||S||c?"disabled":"",A=T=>{T.target.checked?f(yhe(b,m,r)):f(mhe(b,m,r))},k=N.jsxs("span",{children:[N.jsx("input",{type:"checkbox",id:$L(e,b),name:e,checked:_,value:String(b),disabled:t||S||c,autoFocus:l&&b===0,onChange:A,onBlur:g,onFocus:v,"aria-describedby":Is(e)}),N.jsx("span",{children:w.label})]});return n?N.jsx("label",{className:`checkbox-inline ${x}`,children:k},b):N.jsx("div",{className:`checkbox ${x}`,children:N.jsx("label",{children:k})},b)})})}function Yme(e){const{disabled:t,readonly:n,options:r,registry:i}=e,a=yt("BaseInputTemplate",i,r);return N.jsx(a,{type:"color",...e,disabled:t||n})}function Zme(e){const{onChange:t,options:n,registry:r}=e,i=yt("BaseInputTemplate",r,n),a=te.useCallback(o=>t(o||void 0),[t]);return N.jsx(i,{type:"date",...e,onChange:a})}function Kme(e){const{onChange:t,value:n,options:r,registry:i}=e,a=yt("BaseInputTemplate",i,r);return N.jsx(a,{type:"datetime-local",...e,value:Lhe(n),onChange:o=>t($he(o))})}function Xme(e){const{options:t,registry:n}=e,r=yt("BaseInputTemplate",n,t);return N.jsx(r,{type:"email",...e})}function Wme(e,t){return e===null?null:e.replace(";base64",`;name=${encodeURIComponent(t)};base64`)}function Qme(e){const{name:t,size:n,type:r}=e;return new Promise((i,a)=>{const o=new window.FileReader;o.onerror=a,o.onload=l=>{var c;typeof((c=l.target)==null?void 0:c.result)=="string"?i({dataURL:Wme(l.target.result,t),name:t,size:n,type:r}):i({dataURL:null,name:t,size:n,type:r})},o.readAsDataURL(e)})}function Jme(e){return Promise.all(Array.from(e).map(Qme))}function ege({fileInfo:e,registry:t}){const{translateString:n}=t,{dataURL:r,type:i,name:a}=e;return r?["image/jpeg","image/png"].includes(i)?N.jsx("img",{src:r,style:{maxWidth:"100%"},className:"file-preview"}):N.jsxs(N.Fragment,{children:[" ",N.jsx("a",{download:`preview-${a}`,href:r,className:"file-download",children:n(Tt.PreviewLabel)})]}):null}function tge({filesInfo:e,registry:t,preview:n,onRemove:r,options:i}){if(e.length===0)return null;const{translateString:a}=t,{RemoveButton:o}=yt("ButtonTemplates",t,i);return N.jsx("ul",{className:"file-info",children:e.map((l,c)=>{const{name:f,size:d,type:h}=l,m=()=>r(c);return N.jsxs("li",{children:[N.jsx(hm,{children:a(Tt.FilesInfo,[f,h,String(d)])}),n&&N.jsx(ege,{fileInfo:l,registry:t}),N.jsx(o,{onClick:m,registry:t})]},c)})})}function nge(e){return e.reduce((t,n)=>{if(!n)return t;try{const{blob:r,name:i}=dhe(n);return[...t,{dataURL:n,name:i,size:r.size,type:r.type}]}catch{return t}},[])}function rge(e){const{disabled:t,readonly:n,required:r,multiple:i,onChange:a,value:o,options:l,registry:c}=e,f=yt("BaseInputTemplate",c,l),d=te.useCallback(g=>{g.target.files&&Jme(g.target.files).then(v=>{const w=v.map(b=>b.dataURL);a(i?o.concat(w):w[0])})},[i,o,a]),h=te.useMemo(()=>nge(Array.isArray(o)?o:[o]),[o]),m=te.useCallback(g=>{if(i){const v=o.filter((w,b)=>b!==g);a(v)}else a(void 0)},[i,o,a]);return N.jsxs("div",{children:[N.jsx(f,{...e,disabled:t||n,type:"file",required:o?!1:r,onChangeOverride:d,value:"",accept:l.accept?String(l.accept):void 0}),N.jsx(tge,{filesInfo:h,onRemove:m,registry:c,preview:l.filePreview,options:l})]})}function ige({id:e,value:t}){return N.jsx("input",{type:"hidden",id:e,name:e,value:typeof t>"u"?"":t})}function age(e){const{options:t,registry:n}=e,r=yt("BaseInputTemplate",n,t);return N.jsx(r,{type:"password",...e})}function sge({options:e,value:t,required:n,disabled:r,readonly:i,autofocus:a=!1,onBlur:o,onFocus:l,onChange:c,id:f}){const{enumOptions:d,enumDisabled:h,inline:m,emptyValue:g}=e,v=te.useCallback(({target:b})=>o(f,Qr(b&&b.value,d,g)),[o,f]),w=te.useCallback(({target:b})=>l(f,Qr(b&&b.value,d,g)),[l,f]);return N.jsx("div",{className:"field-radio-group",id:f,children:Array.isArray(d)&&d.map((b,_)=>{const S=$E(b.value,t),x=Array.isArray(h)&&h.indexOf(b.value)!==-1,A=r||x||i?"disabled":"",k=()=>c(b.value),T=N.jsxs("span",{children:[N.jsx("input",{type:"radio",id:$L(f,_),checked:S,name:f,required:n,value:String(_),disabled:r||x||i,autoFocus:a&&_===0,onChange:k,onBlur:v,onFocus:w,"aria-describedby":Is(f)}),N.jsx("span",{children:b.label})]});return m?N.jsx("label",{className:`radio-inline ${A}`,children:T},_):N.jsx("div",{className:`radio ${A}`,children:N.jsx("label",{children:T})},_)})})}function oge(e){const{value:t,registry:{templates:{BaseInputTemplate:n}}}=e;return N.jsxs("div",{className:"field-range-wrapper",children:[N.jsx(n,{type:"range",...e}),N.jsx("span",{className:"range-view",children:t})]})}function Lx(e,t){return t?Array.from(e.target.options).slice().filter(n=>n.selected).map(n=>n.value):e.target.value}function lge({schema:e,id:t,options:n,value:r,required:i,disabled:a,readonly:o,multiple:l=!1,autofocus:c=!1,onChange:f,onBlur:d,onFocus:h,placeholder:m}){const{enumOptions:g,enumDisabled:v,emptyValue:w}=n,b=l?[]:"",_=te.useCallback(T=>{const O=Lx(T,l);return h(t,Qr(O,g,w))},[h,t,e,l,g,w]),S=te.useCallback(T=>{const O=Lx(T,l);return d(t,Qr(O,g,w))},[d,t,e,l,g,w]),x=te.useCallback(T=>{const O=Lx(T,l);return f(Qr(O,g,w))},[f,e,l,g,w]),A=ghe(r,g,l),k=!l&&e.default===void 0;return N.jsxs("select",{id:t,name:t,multiple:l,className:"form-control",value:typeof A>"u"?b:A,required:i,disabled:a||o,autoFocus:c,onBlur:S,onFocus:_,onChange:x,"aria-describedby":Is(t),children:[k&&N.jsx("option",{value:"",children:m}),Array.isArray(g)&&g.map(({value:T,label:O},$)=>{const L=v&&v.indexOf(T)!==-1;return N.jsx("option",{value:String($),disabled:L,children:O},$)})]})}function GL({id:e,options:t={},placeholder:n,value:r,required:i,disabled:a,readonly:o,autofocus:l=!1,onChange:c,onBlur:f,onFocus:d}){const h=te.useCallback(({target:{value:v}})=>c(v===""?t.emptyValue:v),[c,t.emptyValue]),m=te.useCallback(({target:v})=>f(e,v&&v.value),[f,e]),g=te.useCallback(({target:v})=>d(e,v&&v.value),[e,d]);return N.jsx("textarea",{id:e,name:e,className:"form-control",value:r||"",placeholder:n,required:i,disabled:a,readOnly:o,autoFocus:l,rows:t.rows,onBlur:m,onFocus:g,onChange:h,"aria-describedby":Is(e)})}GL.defaultProps={autofocus:!1,options:{}};function uge(e){const{options:t,registry:n}=e,r=yt("BaseInputTemplate",n,t);return N.jsx(r,{...e})}function cge(e){const{onChange:t,options:n,registry:r}=e,i=yt("BaseInputTemplate",r,n),a=te.useCallback(o=>t(o?`${o}:00`:void 0),[t]);return N.jsx(i,{type:"time",...e,onChange:a})}function fge(e){const{options:t,registry:n}=e,r=yt("BaseInputTemplate",n,t);return N.jsx(r,{type:"url",...e})}function dge(e){const{options:t,registry:n}=e,r=yt("BaseInputTemplate",n,t);return N.jsx(r,{type:"number",...e})}function hge(){return{AltDateWidget:Ume,AltDateTimeWidget:Vme,CheckboxWidget:Hme,CheckboxesWidget:Gme,ColorWidget:Yme,DateWidget:Zme,DateTimeWidget:Kme,EmailWidget:Xme,FileWidget:rge,HiddenWidget:ige,PasswordWidget:age,RadioWidget:sge,RangeWidget:oge,SelectWidget:lge,TextWidget:uge,TextareaWidget:GL,TimeWidget:cge,UpDownWidget:dge,URLWidget:fge}}function pge(){return{fields:gme(),templates:qme(),widgets:hge(),rootSchema:{},formContext:{},translateString:phe}}class mge extends te.Component{constructor(n){super(n);De(this,"formElement");De(this,"getUsedFormData",(n,r)=>{if(r.length===0&&typeof n!="object")return n;const i=pD(n,r);return Array.isArray(n)?Object.keys(i).map(a=>i[a]):i});De(this,"getFieldNames",(n,r)=>{const i=(a,o=[],l=[[]])=>(Object.keys(a).forEach(c=>{if(typeof a[c]=="object"){const f=l.map(d=>[...d,c]);a[c][PS]&&a[c][Oh]!==""?o.push(a[c][Oh]):i(a[c],o,f)}else c===Oh&&a[c]!==""&&l.forEach(f=>{const d=Ne(r,f);(typeof d!="object"||tl(d)||Array.isArray(d)&&d.every(h=>typeof h!="object"))&&o.push(f)})}),o);return i(n)});De(this,"omitExtraData",n=>{const{schema:r,schemaUtils:i}=this.state,a=i.retrieveSchema(r,n),o=i.toPathSchema(a,"",n),l=this.getFieldNames(o,n);return this.getUsedFormData(n,l)});De(this,"onChange",(n,r,i)=>{const{extraErrors:a,omitExtraData:o,liveOmit:l,noValidate:c,liveValidate:f,onChange:d}=this.props,{schemaUtils:h,schema:m}=this.state;let g=this.state.retrievedSchema;if(lt(n)||Array.isArray(n)){const _=this.getStateFromProps(this.props,n);n=_.formData,g=_.retrievedSchema}const v=!c&&f;let w={formData:n,schema:m},b=n;if(o===!0&&l===!0&&(b=this.omitExtraData(n),w={formData:b}),v){const _=this.validate(b,m,h,g);let S=_.errors,x=_.errorSchema;const A=S,k=x;if(a){const T=jh(_,a);x=T.errorSchema,S=T.errors}if(r){const T=this.filterErrorsBasedOnSchema(r,g,b);x=Oi(x,T,"preventDuplicates")}w={formData:b,errors:S,errorSchema:x,schemaValidationErrors:A,schemaValidationErrorSchema:k}}else if(!c&&r){const _=a?Oi(r,a,"preventDuplicates"):r;w={formData:b,errorSchema:_,errors:wc(_)}}this.setState(w,()=>d&&d({...this.state,...w},i))});De(this,"reset",()=>{const{onChange:n}=this.props,a={formData:this.getStateFromProps(this.props,void 0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{}};this.setState(a,()=>n&&n({...this.state,...a}))});De(this,"onBlur",(n,r)=>{const{onBlur:i}=this.props;i&&i(n,r)});De(this,"onFocus",(n,r)=>{const{onFocus:i}=this.props;i&&i(n,r)});De(this,"onSubmit",n=>{if(n.preventDefault(),n.target!==n.currentTarget)return;n.persist();const{omitExtraData:r,extraErrors:i,noValidate:a,onSubmit:o}=this.props;let{formData:l}=this.state;if(r===!0&&(l=this.omitExtraData(l)),a||this.validateFormWithFormData(l)){const c=i||{},f=i?wc(i):[];this.setState({formData:l,errors:f,errorSchema:c,schemaValidationErrors:[],schemaValidationErrorSchema:{}},()=>{o&&o({...this.state,formData:l,status:"submitted"},n)})}});De(this,"submit",()=>{if(this.formElement.current){const n=new CustomEvent("submit",{cancelable:!0});n.preventDefault(),this.formElement.current.dispatchEvent(n),this.formElement.current.requestSubmit()}});De(this,"validateFormWithFormData",n=>{const{extraErrors:r,extraErrorsBlockSubmit:i,focusOnFirstError:a,onError:o}=this.props,{errors:l}=this.state,c=this.validate(n);let f=c.errors,d=c.errorSchema;const h=f,m=d,g=f.length>0||r&&i;if(g){if(r){const v=jh(c,r);d=v.errorSchema,f=v.errors}a&&(typeof a=="function"?a(f[0]):this.focusOnError(f[0])),this.setState({errors:f,errorSchema:d,schemaValidationErrors:h,schemaValidationErrorSchema:m},()=>{o?o(f):console.error("Form validation failed",f)})}else l.length>0&&this.setState({errors:[],errorSchema:{},schemaValidationErrors:[],schemaValidationErrorSchema:{}});return!g});if(!n.validator)throw new Error("A validator is required for Form functionality to work");this.state=this.getStateFromProps(n,n.formData),this.props.onChange&&!It(this.state.formData,this.props.formData)&&this.props.onChange(this.state),this.formElement=te.createRef()}getSnapshotBeforeUpdate(n,r){if(!It(this.props,n)){const i=Hhe(this.props.formData,n.formData),a=!It(n.schema,this.props.schema),o=i.length>0||!It(n.formData,this.props.formData),l=this.getStateFromProps(this.props,this.props.formData,a||o?void 0:this.state.retrievedSchema,a,i),c=!It(l,r);return{nextState:l,shouldUpdate:c}}return{shouldUpdate:!1}}componentDidUpdate(n,r,i){if(i.shouldUpdate){const{nextState:a}=i;!It(a.formData,this.props.formData)&&!It(a.formData,r.formData)&&this.props.onChange&&this.props.onChange(a),this.setState(a)}}getStateFromProps(n,r,i,a=!1,o=[]){var M;const l=this.state||{},c="schema"in n?n.schema:this.props.schema,f=("uiSchema"in n?n.uiSchema:this.props.uiSchema)||{},d=typeof r<"u",h="liveValidate"in n?n.liveValidate:this.props.liveValidate,m=d&&!n.noValidate&&h,g=c,v="experimental_defaultFormStateBehavior"in n?n.experimental_defaultFormStateBehavior:this.props.experimental_defaultFormStateBehavior,w="experimental_customMergeAllOf"in n?n.experimental_customMergeAllOf:this.props.experimental_customMergeAllOf;let b=l.schemaUtils;(!b||b.doesSchemaUtilsDiffer(n.validator,g,v,w))&&(b=fhe(n.validator,g,v,w));const _=b.getDefaultFormState(c,r),S=this.updateRetrievedSchema(i??b.retrieveSchema(c,_)),x=()=>n.noValidate||a?{errors:[],errorSchema:{}}:n.liveValidate?{errors:l.errors||[],errorSchema:l.errorSchema||{}}:{errors:l.schemaValidationErrors||[],errorSchema:l.schemaValidationErrorSchema||{}};let A,k,T=l.schemaValidationErrors,O=l.schemaValidationErrorSchema;if(m){const z=this.validate(_,c,b,S);A=z.errors,i===void 0?k=z.errorSchema:k=Oi((M=this.state)==null?void 0:M.errorSchema,z.errorSchema,"preventDuplicates"),T=A,O=k}else{const z=x();if(A=z.errors,k=z.errorSchema,o.length>0){const P=o.reduce((q,D)=>(q[D]=void 0,q),{});k=O=Oi(z.errorSchema,P,"preventDuplicates")}}if(n.extraErrors){const z=jh({errorSchema:k,errors:A},n.extraErrors);k=z.errorSchema,A=z.errors}const $=b.toIdSchema(S,f["ui:rootFieldId"],_,n.idPrefix,n.idSeparator);return{schemaUtils:b,schema:c,uiSchema:f,idSchema:$,formData:_,edit:d,errors:A,errorSchema:k,schemaValidationErrors:T,schemaValidationErrorSchema:O,retrievedSchema:S}}shouldComponentUpdate(n,r){return Ihe(this,n,r)}getPreviousCustomValidateErrors(){const{customValidate:n,uiSchema:r}=this.props,i=this.state.formData;let a={};if(typeof n=="function"){const o=n(i,fp(i),r);a=DE(o)}return a}validate(n,r=this.props.schema,i,a){const o=i||this.state.schemaUtils,{customValidate:l,transformErrors:c,uiSchema:f}=this.props,d=a??o.retrieveSchema(r,n);return o.getValidator().validateFormData(n,d,l,c,f)}renderErrors(n){const{errors:r,errorSchema:i,schema:a,uiSchema:o}=this.state,{formContext:l}=this.props,c=ot(o),f=yt("ErrorListTemplate",n,c);return r&&r.length?N.jsx(f,{errors:r,errorSchema:i||{},schema:a,uiSchema:o,formContext:l,registry:n}):null}filterErrorsBasedOnSchema(n,r,i){const{retrievedSchema:a,schemaUtils:o}=this.state,l=r??a,c=o.toPathSchema(l,"",i),f=this.getFieldNames(c,i),d=pD(n,f);(r==null?void 0:r.type)!=="object"&&(r==null?void 0:r.type)!=="array"&&(d.__errors=n.__errors);const h=this.getPreviousCustomValidateErrors(),m=(v=[],w)=>v.length===0?v:v.filter(b=>!w.includes(b)),g=(v,w={})=>(Ghe(v,(b,_)=>{const S=w[_];Wu(b)||Array.isArray(b)&&b.length===0?delete v[_]:lt(b)&<(S)&&Array.isArray(S==null?void 0:S.__errors)?v[_]=m(b.__errors,S.__errors):typeof b=="object"&&!Array.isArray(b.__errors)&&g(b,w[_])}),v);return g(d,h)}updateRetrievedSchema(n){var i;return It(n,(i=this.state)==null?void 0:i.retrievedSchema)?this.state.retrievedSchema:n}getRegistry(){var d;const{translateString:n,uiSchema:r={}}=this.props,{schemaUtils:i}=this.state,{fields:a,templates:o,widgets:l,formContext:c,translateString:f}=pge();return{fields:{...a,...this.props.fields},templates:{...o,...this.props.templates,ButtonTemplates:{...o.ButtonTemplates,...(d=this.props.templates)==null?void 0:d.ButtonTemplates}},widgets:{...l,...this.props.widgets},rootSchema:this.props.schema,formContext:this.props.formContext||c,schemaUtils:i,translateString:n||f,globalUiOptions:r[rae]}}focusOnError(n){const{idPrefix:r="root",idSeparator:i="_"}=this.props,{property:a}=n,o=DL(a);o[0]===""?o[0]=r:o.unshift(r);const l=o.join(i);let c=this.formElement.current.elements[l];c||(c=this.formElement.current.querySelector(`input[id^="${l}"`)),c&&c.length&&(c=c[0]),c&&c.focus()}validateForm(){const{omitExtraData:n}=this.props;let{formData:r}=this.state;return n===!0&&(r=this.omitExtraData(r)),this.validateFormWithFormData(r)}render(){const{children:n,id:r,idPrefix:i,idSeparator:a,className:o="",tagName:l,name:c,method:f,target:d,action:h,autoComplete:m,enctype:g,acceptcharset:v,acceptCharset:w,noHtml5Validate:b=!1,disabled:_,readonly:S,formContext:x,showErrorList:A="top",_internalFormWrapper:k}=this.props,{schema:T,uiSchema:O,formData:$,errorSchema:L,idSchema:M}=this.state,z=this.getRegistry(),{SchemaField:P}=z.fields,{SubmitButton:q}=z.templates.ButtonTemplates,D=k?l:void 0,H=k||l||"form";let{[cp]:B={}}=ot(O);_&&(B={...B,props:{...B.props,disabled:!0}});const G={[Zu]:{[cp]:B}};return N.jsxs(H,{className:o||"rjsf",id:r,name:c,method:f,target:d,action:h,autoComplete:m,encType:g,acceptCharset:w||v,noValidate:b,onSubmit:this.onSubmit,as:D,ref:this.formElement,children:[A==="top"&&this.renderErrors(z),N.jsx(P,{name:"",schema:T,uiSchema:O,errorSchema:L,idSchema:M,idPrefix:i,idSeparator:a,formContext:x,formData:$,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:z,disabled:_,readonly:S}),n||N.jsx(q,{uiSchema:G,registry:z}),A==="bottom"&&this.renderErrors(z)]})}}class gge extends KI.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.hasError?N.jsx("h1",{children:"出错了!请稍后重试。"}):this.props.children}}var Dd={exports:{}},zx={},ki={},as={},qx={},Fx={},Bx={},ND;function gp(){return ND||(ND=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(S){if(super(),!e.IDENTIFIER.test(S))throw new Error("CodeGen: name must be a valid identifier");this.str=S}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(S){super(),this._items=typeof S=="string"?[S]:S}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const S=this._items[0];return S===""||S==='""'}get str(){var S;return(S=this._str)!==null&&S!==void 0?S:this._str=this._items.reduce((x,A)=>`${x}${A}`,"")}get names(){var S;return(S=this._names)!==null&&S!==void 0?S:this._names=this._items.reduce((x,A)=>(A instanceof n&&(x[A.str]=(x[A.str]||0)+1),x),{})}}e._Code=r,e.nil=new r("");function i(_,...S){const x=[_[0]];let A=0;for(;A<S.length;)l(x,S[A]),x.push(_[++A]);return new r(x)}e._=i;const a=new r("+");function o(_,...S){const x=[g(_[0])];let A=0;for(;A<S.length;)x.push(a),l(x,S[A]),x.push(a,g(_[++A]));return c(x),new r(x)}e.str=o;function l(_,S){S instanceof r?_.push(...S._items):S instanceof n?_.push(S):_.push(h(S))}e.addCodeArg=l;function c(_){let S=1;for(;S<_.length-1;){if(_[S]===a){const x=f(_[S-1],_[S+1]);if(x!==void 0){_.splice(S-1,3,x);continue}_[S++]="+"}S++}}function f(_,S){if(S==='""')return _;if(_==='""')return S;if(typeof _=="string")return S instanceof n||_[_.length-1]!=='"'?void 0:typeof S!="string"?`${_.slice(0,-1)}${S}"`:S[0]==='"'?_.slice(0,-1)+S.slice(1):void 0;if(typeof S=="string"&&S[0]==='"'&&!(_ instanceof n))return`"${_}${S.slice(1)}`}function d(_,S){return S.emptyStr()?_:_.emptyStr()?S:o`${_}${S}`}e.strConcat=d;function h(_){return typeof _=="number"||typeof _=="boolean"||_===null?_:g(Array.isArray(_)?_.join(","):_)}function m(_){return new r(g(_))}e.stringify=m;function g(_){return JSON.stringify(_).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function v(_){return typeof _=="string"&&e.IDENTIFIER.test(_)?new r(`.${_}`):i`[${_}]`}e.getProperty=v;function w(_){if(typeof _=="string"&&e.IDENTIFIER.test(_))return new r(`${_}`);throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`)}e.getEsmExportName=w;function b(_){return new r(_.toString())}e.regexpCode=b}(Bx)),Bx}var Ux={},RD;function jD(){return RD||(RD=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=gp();class n extends Error{constructor(f){super(`CodeGen: "code" for ${f} not defined`),this.value=f.value}}var r;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class i{constructor({prefixes:f,parent:d}={}){this._names={},this._prefixes=f,this._parent=d}toName(f){return f instanceof t.Name?f:this.name(f)}name(f){return new t.Name(this._newName(f))}_newName(f){const d=this._names[f]||this._nameGroup(f);return`${f}${d.index++}`}_nameGroup(f){var d,h;if(!((h=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||h===void 0)&&h.has(f)||this._prefixes&&!this._prefixes.has(f))throw new Error(`CodeGen: prefix "${f}" is not allowed in this scope`);return this._names[f]={prefix:f,index:0}}}e.Scope=i;class a extends t.Name{constructor(f,d){super(d),this.prefix=f}setValue(f,{property:d,itemIndex:h}){this.value=f,this.scopePath=(0,t._)`.${new t.Name(d)}[${h}]`}}e.ValueScopeName=a;const o=(0,t._)`\n`;class l extends i{constructor(f){super(f),this._values={},this._scope=f.scope,this.opts={...f,_n:f.lines?o:t.nil}}get(){return this._scope}name(f){return new a(f,this._newName(f))}value(f,d){var h;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const m=this.toName(f),{prefix:g}=m,v=(h=d.key)!==null&&h!==void 0?h:d.ref;let w=this._values[g];if(w){const S=w.get(v);if(S)return S}else w=this._values[g]=new Map;w.set(v,m);const b=this._scope[g]||(this._scope[g]=[]),_=b.length;return b[_]=d.ref,m.setValue(d,{property:g,itemIndex:_}),m}getValue(f,d){const h=this._values[f];if(h)return h.get(d)}scopeRefs(f,d=this._values){return this._reduceValues(d,h=>{if(h.scopePath===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return(0,t._)`${f}${h.scopePath}`})}scopeCode(f=this._values,d,h){return this._reduceValues(f,m=>{if(m.value===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return m.value.code},d,h)}_reduceValues(f,d,h={},m){let g=t.nil;for(const v in f){const w=f[v];if(!w)continue;const b=h[v]=h[v]||new Map;w.forEach(_=>{if(b.has(_))return;b.set(_,r.Started);let S=d(_);if(S){const x=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${x} ${_} = ${S};${this.opts._n}`}else if(S=m==null?void 0:m(_))g=(0,t._)`${g}${S}${this.opts._n}`;else throw new n(_);b.set(_,r.Completed)})}return g}}e.ValueScope=l}(Ux)),Ux}var MD;function Xe(){return MD||(MD=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=gp(),n=jD();var r=gp();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var i=jD();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class a{optimizeNodes(){return this}optimizeNames(I,U){return this}}class o extends a{constructor(I,U,Y){super(),this.varKind=I,this.name=U,this.rhs=Y}render({es5:I,_n:U}){const Y=I?n.varKinds.var:this.varKind,ne=this.rhs===void 0?"":` = ${this.rhs}`;return`${Y} ${this.name}${ne};`+U}optimizeNames(I,U){if(I[this.name.str])return this.rhs&&(this.rhs=D(this.rhs,I,U)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class l extends a{constructor(I,U,Y){super(),this.lhs=I,this.rhs=U,this.sideEffects=Y}render({_n:I}){return`${this.lhs} = ${this.rhs};`+I}optimizeNames(I,U){if(!(this.lhs instanceof t.Name&&!I[this.lhs.str]&&!this.sideEffects))return this.rhs=D(this.rhs,I,U),this}get names(){const I=this.lhs instanceof t.Name?{}:{...this.lhs.names};return q(I,this.rhs)}}class c extends l{constructor(I,U,Y,ne){super(I,Y,ne),this.op=U}render({_n:I}){return`${this.lhs} ${this.op}= ${this.rhs};`+I}}class f extends a{constructor(I){super(),this.label=I,this.names={}}render({_n:I}){return`${this.label}:`+I}}class d extends a{constructor(I){super(),this.label=I,this.names={}}render({_n:I}){return`break${this.label?` ${this.label}`:""};`+I}}class h extends a{constructor(I){super(),this.error=I}render({_n:I}){return`throw ${this.error};`+I}get names(){return this.error.names}}class m extends a{constructor(I){super(),this.code=I}render({_n:I}){return`${this.code};`+I}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(I,U){return this.code=D(this.code,I,U),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class g extends a{constructor(I=[]){super(),this.nodes=I}render(I){return this.nodes.reduce((U,Y)=>U+Y.render(I),"")}optimizeNodes(){const{nodes:I}=this;let U=I.length;for(;U--;){const Y=I[U].optimizeNodes();Array.isArray(Y)?I.splice(U,1,...Y):Y?I[U]=Y:I.splice(U,1)}return I.length>0?this:void 0}optimizeNames(I,U){const{nodes:Y}=this;let ne=Y.length;for(;ne--;){const ae=Y[ne];ae.optimizeNames(I,U)||(H(I,ae.names),Y.splice(ne,1))}return Y.length>0?this:void 0}get names(){return this.nodes.reduce((I,U)=>P(I,U.names),{})}}class v extends g{render(I){return"{"+I._n+super.render(I)+"}"+I._n}}class w extends g{}class b extends v{}b.kind="else";class _ extends v{constructor(I,U){super(U),this.condition=I}render(I){let U=`if(${this.condition})`+super.render(I);return this.else&&(U+="else "+this.else.render(I)),U}optimizeNodes(){super.optimizeNodes();const I=this.condition;if(I===!0)return this.nodes;let U=this.else;if(U){const Y=U.optimizeNodes();U=this.else=Array.isArray(Y)?new b(Y):Y}if(U)return I===!1?U instanceof _?U:U.nodes:this.nodes.length?this:new _(B(I),U instanceof _?[U]:U.nodes);if(!(I===!1||!this.nodes.length))return this}optimizeNames(I,U){var Y;if(this.else=(Y=this.else)===null||Y===void 0?void 0:Y.optimizeNames(I,U),!!(super.optimizeNames(I,U)||this.else))return this.condition=D(this.condition,I,U),this}get names(){const I=super.names;return q(I,this.condition),this.else&&P(I,this.else.names),I}}_.kind="if";class S extends v{}S.kind="for";class x extends S{constructor(I){super(),this.iteration=I}render(I){return`for(${this.iteration})`+super.render(I)}optimizeNames(I,U){if(super.optimizeNames(I,U))return this.iteration=D(this.iteration,I,U),this}get names(){return P(super.names,this.iteration.names)}}class A extends S{constructor(I,U,Y,ne){super(),this.varKind=I,this.name=U,this.from=Y,this.to=ne}render(I){const U=I.es5?n.varKinds.var:this.varKind,{name:Y,from:ne,to:ae}=this;return`for(${U} ${Y}=${ne}; ${Y}<${ae}; ${Y}++)`+super.render(I)}get names(){const I=q(super.names,this.from);return q(I,this.to)}}class k extends S{constructor(I,U,Y,ne){super(),this.loop=I,this.varKind=U,this.name=Y,this.iterable=ne}render(I){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(I)}optimizeNames(I,U){if(super.optimizeNames(I,U))return this.iterable=D(this.iterable,I,U),this}get names(){return P(super.names,this.iterable.names)}}class T extends v{constructor(I,U,Y){super(),this.name=I,this.args=U,this.async=Y}render(I){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(I)}}T.kind="func";class O extends g{render(I){return"return "+super.render(I)}}O.kind="return";class $ extends v{render(I){let U="try"+super.render(I);return this.catch&&(U+=this.catch.render(I)),this.finally&&(U+=this.finally.render(I)),U}optimizeNodes(){var I,U;return super.optimizeNodes(),(I=this.catch)===null||I===void 0||I.optimizeNodes(),(U=this.finally)===null||U===void 0||U.optimizeNodes(),this}optimizeNames(I,U){var Y,ne;return super.optimizeNames(I,U),(Y=this.catch)===null||Y===void 0||Y.optimizeNames(I,U),(ne=this.finally)===null||ne===void 0||ne.optimizeNames(I,U),this}get names(){const I=super.names;return this.catch&&P(I,this.catch.names),this.finally&&P(I,this.finally.names),I}}class L extends v{constructor(I){super(),this.error=I}render(I){return`catch(${this.error})`+super.render(I)}}L.kind="catch";class M extends v{render(I){return"finally"+super.render(I)}}M.kind="finally";class z{constructor(I,U={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...U,_n:U.lines?`
|
|
262
|
+
`:""},this._extScope=I,this._scope=new n.Scope({parent:I}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(I){return this._scope.name(I)}scopeName(I){return this._extScope.name(I)}scopeValue(I,U){const Y=this._extScope.value(I,U);return(this._values[Y.prefix]||(this._values[Y.prefix]=new Set)).add(Y),Y}getScopeValue(I,U){return this._extScope.getValue(I,U)}scopeRefs(I){return this._extScope.scopeRefs(I,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(I,U,Y,ne){const ae=this._scope.toName(U);return Y!==void 0&&ne&&(this._constants[ae.str]=Y),this._leafNode(new o(I,ae,Y)),ae}const(I,U,Y){return this._def(n.varKinds.const,I,U,Y)}let(I,U,Y){return this._def(n.varKinds.let,I,U,Y)}var(I,U,Y){return this._def(n.varKinds.var,I,U,Y)}assign(I,U,Y){return this._leafNode(new l(I,U,Y))}add(I,U){return this._leafNode(new c(I,e.operators.ADD,U))}code(I){return typeof I=="function"?I():I!==t.nil&&this._leafNode(new m(I)),this}object(...I){const U=["{"];for(const[Y,ne]of I)U.length>1&&U.push(","),U.push(Y),(Y!==ne||this.opts.es5)&&(U.push(":"),(0,t.addCodeArg)(U,ne));return U.push("}"),new t._Code(U)}if(I,U,Y){if(this._blockNode(new _(I)),U&&Y)this.code(U).else().code(Y).endIf();else if(U)this.code(U).endIf();else if(Y)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(I){return this._elseNode(new _(I))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(I,U){return this._blockNode(I),U&&this.code(U).endFor(),this}for(I,U){return this._for(new x(I),U)}forRange(I,U,Y,ne,ae=this.opts.es5?n.varKinds.var:n.varKinds.let){const re=this._scope.toName(I);return this._for(new A(ae,re,U,Y),()=>ne(re))}forOf(I,U,Y,ne=n.varKinds.const){const ae=this._scope.toName(I);if(this.opts.es5){const re=U instanceof t.Name?U:this.var("_arr",U);return this.forRange("_i",0,(0,t._)`${re}.length`,le=>{this.var(ae,(0,t._)`${re}[${le}]`),Y(ae)})}return this._for(new k("of",ne,ae,U),()=>Y(ae))}forIn(I,U,Y,ne=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(I,(0,t._)`Object.keys(${U})`,Y);const ae=this._scope.toName(I);return this._for(new k("in",ne,ae,U),()=>Y(ae))}endFor(){return this._endBlockNode(S)}label(I){return this._leafNode(new f(I))}break(I){return this._leafNode(new d(I))}return(I){const U=new O;if(this._blockNode(U),this.code(I),U.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(O)}try(I,U,Y){if(!U&&!Y)throw new Error('CodeGen: "try" without "catch" and "finally"');const ne=new $;if(this._blockNode(ne),this.code(I),U){const ae=this.name("e");this._currNode=ne.catch=new L(ae),U(ae)}return Y&&(this._currNode=ne.finally=new M,this.code(Y)),this._endBlockNode(L,M)}throw(I){return this._leafNode(new h(I))}block(I,U){return this._blockStarts.push(this._nodes.length),I&&this.code(I).endBlock(U),this}endBlock(I){const U=this._blockStarts.pop();if(U===void 0)throw new Error("CodeGen: not in self-balancing block");const Y=this._nodes.length-U;if(Y<0||I!==void 0&&Y!==I)throw new Error(`CodeGen: wrong number of nodes: ${Y} vs ${I} expected`);return this._nodes.length=U,this}func(I,U=t.nil,Y,ne){return this._blockNode(new T(I,U,Y)),ne&&this.code(ne).endFunc(),this}endFunc(){return this._endBlockNode(T)}optimize(I=1){for(;I-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(I){return this._currNode.nodes.push(I),this}_blockNode(I){this._currNode.nodes.push(I),this._nodes.push(I)}_endBlockNode(I,U){const Y=this._currNode;if(Y instanceof I||U&&Y instanceof U)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${U?`${I.kind}/${U.kind}`:I.kind}"`)}_elseNode(I){const U=this._currNode;if(!(U instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=U.else=I,this}get _root(){return this._nodes[0]}get _currNode(){const I=this._nodes;return I[I.length-1]}set _currNode(I){const U=this._nodes;U[U.length-1]=I}}e.CodeGen=z;function P(j,I){for(const U in I)j[U]=(j[U]||0)+(I[U]||0);return j}function q(j,I){return I instanceof t._CodeOrName?P(j,I.names):j}function D(j,I,U){if(j instanceof t.Name)return Y(j);if(!ne(j))return j;return new t._Code(j._items.reduce((ae,re)=>(re instanceof t.Name&&(re=Y(re)),re instanceof t._Code?ae.push(...re._items):ae.push(re),ae),[]));function Y(ae){const re=U[ae.str];return re===void 0||I[ae.str]!==1?ae:(delete I[ae.str],re)}function ne(ae){return ae instanceof t._Code&&ae._items.some(re=>re instanceof t.Name&&I[re.str]===1&&U[re.str]!==void 0)}}function H(j,I){for(const U in I)j[U]=(j[U]||0)-(I[U]||0)}function B(j){return typeof j=="boolean"||typeof j=="number"||j===null?!j:(0,t._)`!${X(j)}`}e.not=B;const G=V(e.operators.AND);function K(...j){return j.reduce(G)}e.and=K;const Q=V(e.operators.OR);function R(...j){return j.reduce(Q)}e.or=R;function V(j){return(I,U)=>I===t.nil?U:U===t.nil?I:(0,t._)`${X(I)} ${j} ${X(U)}`}function X(j){return j instanceof t.Name?j:(0,t._)`(${j})`}}(Fx)),Fx}var Ke={},$D;function ht(){if($D)return Ke;$D=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.checkStrictMode=Ke.getErrorPath=Ke.Type=Ke.useFunc=Ke.setEvaluated=Ke.evaluatedPropsToName=Ke.mergeEvaluated=Ke.eachItem=Ke.unescapeJsonPointer=Ke.escapeJsonPointer=Ke.escapeFragment=Ke.unescapeFragment=Ke.schemaRefOrVal=Ke.schemaHasRulesButRef=Ke.schemaHasRules=Ke.checkUnknownRules=Ke.alwaysValidSchema=Ke.toHash=void 0;const e=Xe(),t=gp();function n(k){const T={};for(const O of k)T[O]=!0;return T}Ke.toHash=n;function r(k,T){return typeof T=="boolean"?T:Object.keys(T).length===0?!0:(i(k,T),!a(T,k.self.RULES.all))}Ke.alwaysValidSchema=r;function i(k,T=k.schema){const{opts:O,self:$}=k;if(!O.strictSchema||typeof T=="boolean")return;const L=$.RULES.keywords;for(const M in T)L[M]||A(k,`unknown keyword: "${M}"`)}Ke.checkUnknownRules=i;function a(k,T){if(typeof k=="boolean")return!k;for(const O in k)if(T[O])return!0;return!1}Ke.schemaHasRules=a;function o(k,T){if(typeof k=="boolean")return!k;for(const O in k)if(O!=="$ref"&&T.all[O])return!0;return!1}Ke.schemaHasRulesButRef=o;function l({topSchemaRef:k,schemaPath:T},O,$,L){if(!L){if(typeof O=="number"||typeof O=="boolean")return O;if(typeof O=="string")return(0,e._)`${O}`}return(0,e._)`${k}${T}${(0,e.getProperty)($)}`}Ke.schemaRefOrVal=l;function c(k){return h(decodeURIComponent(k))}Ke.unescapeFragment=c;function f(k){return encodeURIComponent(d(k))}Ke.escapeFragment=f;function d(k){return typeof k=="number"?`${k}`:k.replace(/~/g,"~0").replace(/\//g,"~1")}Ke.escapeJsonPointer=d;function h(k){return k.replace(/~1/g,"/").replace(/~0/g,"~")}Ke.unescapeJsonPointer=h;function m(k,T){if(Array.isArray(k))for(const O of k)T(O);else T(k)}Ke.eachItem=m;function g({mergeNames:k,mergeToName:T,mergeValues:O,resultToName:$}){return(L,M,z,P)=>{const q=z===void 0?M:z instanceof e.Name?(M instanceof e.Name?k(L,M,z):T(L,M,z),z):M instanceof e.Name?(T(L,z,M),M):O(M,z);return P===e.Name&&!(q instanceof e.Name)?$(L,q):q}}Ke.mergeEvaluated={props:g({mergeNames:(k,T,O)=>k.if((0,e._)`${O} !== true && ${T} !== undefined`,()=>{k.if((0,e._)`${T} === true`,()=>k.assign(O,!0),()=>k.assign(O,(0,e._)`${O} || {}`).code((0,e._)`Object.assign(${O}, ${T})`))}),mergeToName:(k,T,O)=>k.if((0,e._)`${O} !== true`,()=>{T===!0?k.assign(O,!0):(k.assign(O,(0,e._)`${O} || {}`),w(k,O,T))}),mergeValues:(k,T)=>k===!0?!0:{...k,...T},resultToName:v}),items:g({mergeNames:(k,T,O)=>k.if((0,e._)`${O} !== true && ${T} !== undefined`,()=>k.assign(O,(0,e._)`${T} === true ? true : ${O} > ${T} ? ${O} : ${T}`)),mergeToName:(k,T,O)=>k.if((0,e._)`${O} !== true`,()=>k.assign(O,T===!0?!0:(0,e._)`${O} > ${T} ? ${O} : ${T}`)),mergeValues:(k,T)=>k===!0?!0:Math.max(k,T),resultToName:(k,T)=>k.var("items",T)})};function v(k,T){if(T===!0)return k.var("props",!0);const O=k.var("props",(0,e._)`{}`);return T!==void 0&&w(k,O,T),O}Ke.evaluatedPropsToName=v;function w(k,T,O){Object.keys(O).forEach($=>k.assign((0,e._)`${T}${(0,e.getProperty)($)}`,!0))}Ke.setEvaluated=w;const b={};function _(k,T){return k.scopeValue("func",{ref:T,code:b[T.code]||(b[T.code]=new t._Code(T.code))})}Ke.useFunc=_;var S;(function(k){k[k.Num=0]="Num",k[k.Str=1]="Str"})(S||(Ke.Type=S={}));function x(k,T,O){if(k instanceof e.Name){const $=T===S.Num;return O?$?(0,e._)`"[" + ${k} + "]"`:(0,e._)`"['" + ${k} + "']"`:$?(0,e._)`"/" + ${k}`:(0,e._)`"/" + ${k}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return O?(0,e.getProperty)(k).toString():"/"+d(k)}Ke.getErrorPath=x;function A(k,T,O=k.opts.strictSchema){if(O){if(T=`strict mode: ${T}`,O===!0)throw new Error(T);k.self.logger.warn(T)}}return Ke.checkStrictMode=A,Ke}var Id={},DD;function La(){if(DD)return Id;DD=1,Object.defineProperty(Id,"__esModule",{value:!0});const e=Xe(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Id.default=t,Id}var ID;function pm(){return ID||(ID=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Xe(),n=ht(),r=La();e.keywordError={message:({keyword:b})=>(0,t.str)`must pass "${b}" keyword validation`},e.keyword$DataError={message:({keyword:b,schemaType:_})=>_?(0,t.str)`"${b}" keyword must be ${_} ($data)`:(0,t.str)`"${b}" keyword is invalid ($data)`};function i(b,_=e.keywordError,S,x){const{it:A}=b,{gen:k,compositeRule:T,allErrors:O}=A,$=h(b,_,S);x??(T||O)?c(k,$):f(A,(0,t._)`[${$}]`)}e.reportError=i;function a(b,_=e.keywordError,S){const{it:x}=b,{gen:A,compositeRule:k,allErrors:T}=x,O=h(b,_,S);c(A,O),k||T||f(x,r.default.vErrors)}e.reportExtraError=a;function o(b,_){b.assign(r.default.errors,_),b.if((0,t._)`${r.default.vErrors} !== null`,()=>b.if(_,()=>b.assign((0,t._)`${r.default.vErrors}.length`,_),()=>b.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function l({gen:b,keyword:_,schemaValue:S,data:x,errsCount:A,it:k}){if(A===void 0)throw new Error("ajv implementation error");const T=b.name("err");b.forRange("i",A,r.default.errors,O=>{b.const(T,(0,t._)`${r.default.vErrors}[${O}]`),b.if((0,t._)`${T}.instancePath === undefined`,()=>b.assign((0,t._)`${T}.instancePath`,(0,t.strConcat)(r.default.instancePath,k.errorPath))),b.assign((0,t._)`${T}.schemaPath`,(0,t.str)`${k.errSchemaPath}/${_}`),k.opts.verbose&&(b.assign((0,t._)`${T}.schema`,S),b.assign((0,t._)`${T}.data`,x))})}e.extendErrors=l;function c(b,_){const S=b.const("err",_);b.if((0,t._)`${r.default.vErrors} === null`,()=>b.assign(r.default.vErrors,(0,t._)`[${S}]`),(0,t._)`${r.default.vErrors}.push(${S})`),b.code((0,t._)`${r.default.errors}++`)}function f(b,_){const{gen:S,validateName:x,schemaEnv:A}=b;A.$async?S.throw((0,t._)`new ${b.ValidationError}(${_})`):(S.assign((0,t._)`${x}.errors`,_),S.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function h(b,_,S){const{createErrors:x}=b.it;return x===!1?(0,t._)`{}`:m(b,_,S)}function m(b,_,S={}){const{gen:x,it:A}=b,k=[g(A,S),v(b,S)];return w(b,_,k),x.object(...k)}function g({errorPath:b},{instancePath:_}){const S=_?(0,t.str)`${b}${(0,n.getErrorPath)(_,n.Type.Str)}`:b;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,S)]}function v({keyword:b,it:{errSchemaPath:_}},{schemaPath:S,parentSchema:x}){let A=x?_:(0,t.str)`${_}/${b}`;return S&&(A=(0,t.str)`${A}${(0,n.getErrorPath)(S,n.Type.Str)}`),[d.schemaPath,A]}function w(b,{params:_,message:S},x){const{keyword:A,data:k,schemaValue:T,it:O}=b,{opts:$,propertyName:L,topSchemaRef:M,schemaPath:z}=O;x.push([d.keyword,A],[d.params,typeof _=="function"?_(b):_||(0,t._)`{}`]),$.messages&&x.push([d.message,typeof S=="function"?S(b):S]),$.verbose&&x.push([d.schema,T],[d.parentSchema,(0,t._)`${M}${z}`],[r.default.data,k]),L&&x.push([d.propertyName,L])}}(qx)),qx}var PD;function yge(){if(PD)return as;PD=1,Object.defineProperty(as,"__esModule",{value:!0}),as.boolOrEmptySchema=as.topBoolOrEmptySchema=void 0;const e=pm(),t=Xe(),n=La(),r={message:"boolean schema is false"};function i(l){const{gen:c,schema:f,validateName:d}=l;f===!1?o(l,!1):typeof f=="object"&&f.$async===!0?c.return(n.default.data):(c.assign((0,t._)`${d}.errors`,null),c.return(!0))}as.topBoolOrEmptySchema=i;function a(l,c){const{gen:f,schema:d}=l;d===!1?(f.var(c,!1),o(l)):f.var(c,!0)}as.boolOrEmptySchema=a;function o(l,c){const{gen:f,data:d}=l,h={gen:f,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:l};(0,e.reportError)(h,r,void 0,c)}return as}var pn={},ss={},LD;function YL(){if(LD)return ss;LD=1,Object.defineProperty(ss,"__esModule",{value:!0}),ss.getRules=ss.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function n(i){return typeof i=="string"&&t.has(i)}ss.isJSONType=n;function r(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return ss.getRules=r,ss}var Ai={},zD;function ZL(){if(zD)return Ai;zD=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.shouldUseRule=Ai.shouldUseGroup=Ai.schemaHasRulesForType=void 0;function e({schema:r,self:i},a){const o=i.RULES.types[a];return o&&o!==!0&&t(r,o)}Ai.schemaHasRulesForType=e;function t(r,i){return i.rules.some(a=>n(r,a))}Ai.shouldUseGroup=t;function n(r,i){var a;return r[i.keyword]!==void 0||((a=i.definition.implements)===null||a===void 0?void 0:a.some(o=>r[o]!==void 0))}return Ai.shouldUseRule=n,Ai}var qD;function yp(){if(qD)return pn;qD=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.reportTypeError=pn.checkDataTypes=pn.checkDataType=pn.coerceAndCheckDataType=pn.getJSONTypes=pn.getSchemaTypes=pn.DataType=void 0;const e=YL(),t=ZL(),n=pm(),r=Xe(),i=ht();var a;(function(S){S[S.Correct=0]="Correct",S[S.Wrong=1]="Wrong"})(a||(pn.DataType=a={}));function o(S){const x=l(S.type);if(x.includes("null")){if(S.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!x.length&&S.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');S.nullable===!0&&x.push("null")}return x}pn.getSchemaTypes=o;function l(S){const x=Array.isArray(S)?S:S?[S]:[];if(x.every(e.isJSONType))return x;throw new Error("type must be JSONType or JSONType[]: "+x.join(","))}pn.getJSONTypes=l;function c(S,x){const{gen:A,data:k,opts:T}=S,O=d(x,T.coerceTypes),$=x.length>0&&!(O.length===0&&x.length===1&&(0,t.schemaHasRulesForType)(S,x[0]));if($){const L=v(x,k,T.strictNumbers,a.Wrong);A.if(L,()=>{O.length?h(S,x,O):b(S)})}return $}pn.coerceAndCheckDataType=c;const f=new Set(["string","number","integer","boolean","null"]);function d(S,x){return x?S.filter(A=>f.has(A)||x==="array"&&A==="array"):[]}function h(S,x,A){const{gen:k,data:T,opts:O}=S,$=k.let("dataType",(0,r._)`typeof ${T}`),L=k.let("coerced",(0,r._)`undefined`);O.coerceTypes==="array"&&k.if((0,r._)`${$} == 'object' && Array.isArray(${T}) && ${T}.length == 1`,()=>k.assign(T,(0,r._)`${T}[0]`).assign($,(0,r._)`typeof ${T}`).if(v(x,T,O.strictNumbers),()=>k.assign(L,T))),k.if((0,r._)`${L} !== undefined`);for(const z of A)(f.has(z)||z==="array"&&O.coerceTypes==="array")&&M(z);k.else(),b(S),k.endIf(),k.if((0,r._)`${L} !== undefined`,()=>{k.assign(T,L),m(S,L)});function M(z){switch(z){case"string":k.elseIf((0,r._)`${$} == "number" || ${$} == "boolean"`).assign(L,(0,r._)`"" + ${T}`).elseIf((0,r._)`${T} === null`).assign(L,(0,r._)`""`);return;case"number":k.elseIf((0,r._)`${$} == "boolean" || ${T} === null
|
|
263
263
|
|| (${$} == "string" && ${T} && ${T} == +${T})`).assign(L,(0,r._)`+${T}`);return;case"integer":k.elseIf((0,r._)`${$} === "boolean" || ${T} === null
|
|
264
264
|
|| (${$} === "string" && ${T} && ${T} == +${T} && !(${T} % 1))`).assign(L,(0,r._)`+${T}`);return;case"boolean":k.elseIf((0,r._)`${T} === "false" || ${T} === 0 || ${T} === null`).assign(L,!1).elseIf((0,r._)`${T} === "true" || ${T} === 1`).assign(L,!0);return;case"null":k.elseIf((0,r._)`${T} === "" || ${T} === 0 || ${T} === false`),k.assign(L,null);return;case"array":k.elseIf((0,r._)`${$} === "string" || ${$} === "number"
|
|
265
|
-
|| ${$} === "boolean" || ${T} === null`).assign(L,(0,r._)`[${T}]`)}}}function m({gen:S,parentData:x,parentDataProperty:A},k){S.if((0,r._)`${x} !== undefined`,()=>S.assign((0,r._)`${x}[${A}]`,k))}function g(S,x,A,k=a.Correct){const T=k===a.Correct?r.operators.EQ:r.operators.NEQ;let O;switch(S){case"null":return(0,r._)`${x} ${T} null`;case"array":O=(0,r._)`Array.isArray(${x})`;break;case"object":O=(0,r._)`${x} && typeof ${x} == "object" && !Array.isArray(${x})`;break;case"integer":O=$((0,r._)`!(${x} % 1) && !isNaN(${x})`);break;case"number":O=$();break;default:return(0,r._)`typeof ${x} ${T} ${S}`}return k===a.Correct?O:(0,r.not)(O);function $(L=r.nil){return(0,r.and)((0,r._)`typeof ${x} == "number"`,L,A?(0,r._)`isFinite(${x})`:r.nil)}}pn.checkDataType=g;function v(S,x,A,k){if(S.length===1)return g(S[0],x,A,k);let T;const O=(0,i.toHash)(S);if(O.array&&O.object){const $=(0,r._)`typeof ${x} != "object"`;T=O.null?$:(0,r._)`!${x} || ${$}`,delete O.null,delete O.array,delete O.object}else T=r.nil;O.number&&delete O.integer;for(const $ in O)T=(0,r.and)(T,g($,x,A,k));return T}pn.checkDataTypes=v;const w={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:x})=>typeof S=="string"?(0,r._)`{type: ${S}}`:(0,r._)`{type: ${x}}`};function b(S){const x=_(S);(0,n.reportError)(x,w)}pn.reportTypeError=b;function _(S){const{gen:x,data:A,schema:k}=S,T=(0,i.schemaRefOrVal)(S,k,"type");return{gen:x,keyword:"type",data:A,schema:k.type,schemaCode:T,schemaValue:T,parentSchema:k,params:{},it:S}}return pn}var Mu={},FD;function yge(){if(FD)return Mu;FD=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.assignDefaults=void 0;const e=Xe(),t=ht();function n(i,a){const{properties:o,items:l}=i.schema;if(a==="object"&&o)for(const c in o)r(i,c,o[c].default);else a==="array"&&Array.isArray(l)&&l.forEach((c,f)=>r(i,f,c.default))}Mu.assignDefaults=n;function r(i,a,o){const{gen:l,compositeRule:c,data:f,opts:d}=i;if(o===void 0)return;const h=(0,e._)`${f}${(0,e.getProperty)(a)}`;if(c){(0,t.checkStrictMode)(i,`default is ignored for: ${h}`);return}let m=(0,e._)`${h} === undefined`;d.useDefaults==="empty"&&(m=(0,e._)`${m} || ${h} === null || ${h} === ""`),l.if(m,(0,e._)`${h} = ${(0,e.stringify)(o)}`)}return Mu}var Or={},_t={},BD;function Lr(){if(BD)return _t;BD=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.validateUnion=_t.validateArray=_t.usePattern=_t.callValidateCode=_t.schemaProperties=_t.allSchemaProperties=_t.noPropertyInData=_t.propertyInData=_t.isOwnProperty=_t.hasPropFunc=_t.reportMissingProp=_t.checkMissingProp=_t.checkReportMissingProp=void 0;const e=Xe(),t=ht(),n=La(),r=ht();function i(S,x){const{gen:A,data:k,it:T}=S;A.if(d(A,k,x,T.opts.ownProperties),()=>{S.setParams({missingProperty:(0,e._)`${x}`},!0),S.error()})}_t.checkReportMissingProp=i;function a({gen:S,data:x,it:{opts:A}},k,T){return(0,e.or)(...k.map(O=>(0,e.and)(d(S,x,O,A.ownProperties),(0,e._)`${T} = ${O}`)))}_t.checkMissingProp=a;function o(S,x){S.setParams({missingProperty:x},!0),S.error()}_t.reportMissingProp=o;function l(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}_t.hasPropFunc=l;function c(S,x,A){return(0,e._)`${l(S)}.call(${x}, ${A})`}_t.isOwnProperty=c;function f(S,x,A,k){const T=(0,e._)`${x}${(0,e.getProperty)(A)} !== undefined`;return k?(0,e._)`${T} && ${c(S,x,A)}`:T}_t.propertyInData=f;function d(S,x,A,k){const T=(0,e._)`${x}${(0,e.getProperty)(A)} === undefined`;return k?(0,e.or)(T,(0,e.not)(c(S,x,A))):T}_t.noPropertyInData=d;function h(S){return S?Object.keys(S).filter(x=>x!=="__proto__"):[]}_t.allSchemaProperties=h;function m(S,x){return h(x).filter(A=>!(0,t.alwaysValidSchema)(S,x[A]))}_t.schemaProperties=m;function g({schemaCode:S,data:x,it:{gen:A,topSchemaRef:k,schemaPath:T,errorPath:O},it:$},L,M,z){const P=z?(0,e._)`${S}, ${x}, ${k}${T}`:x,q=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,O)],[n.default.parentData,$.parentData],[n.default.parentDataProperty,$.parentDataProperty],[n.default.rootData,n.default.rootData]];$.opts.dynamicRef&&q.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const D=(0,e._)`${P}, ${A.object(...q)}`;return M!==e.nil?(0,e._)`${L}.call(${M}, ${D})`:(0,e._)`${L}(${D})`}_t.callValidateCode=g;const v=(0,e._)`new RegExp`;function w({gen:S,it:{opts:x}},A){const k=x.unicodeRegExp?"u":"",{regExp:T}=x.code,O=T(A,k);return S.scopeValue("pattern",{key:O.toString(),ref:O,code:(0,e._)`${T.code==="new RegExp"?v:(0,r.useFunc)(S,T)}(${A}, ${k})`})}_t.usePattern=w;function b(S){const{gen:x,data:A,keyword:k,it:T}=S,O=x.name("valid");if(T.allErrors){const L=x.let("valid",!0);return $(()=>x.assign(L,!1)),L}return x.var(O,!0),$(()=>x.break()),O;function $(L){const M=x.const("len",(0,e._)`${A}.length`);x.forRange("i",0,M,z=>{S.subschema({keyword:k,dataProp:z,dataPropType:t.Type.Num},O),x.if((0,e.not)(O),L)})}}_t.validateArray=b;function _(S){const{gen:x,schema:A,keyword:k,it:T}=S;if(!Array.isArray(A))throw new Error("ajv implementation error");if(A.some(M=>(0,t.alwaysValidSchema)(T,M))&&!T.opts.unevaluated)return;const $=x.let("valid",!1),L=x.name("_valid");x.block(()=>A.forEach((M,z)=>{const P=S.subschema({keyword:k,schemaProp:z,compositeRule:!0},L);x.assign($,(0,e._)`${$} || ${L}`),S.mergeValidEvaluated(P,L)||x.if((0,e.not)($))})),S.result($,()=>S.reset(),()=>S.error(!0))}return _t.validateUnion=_,_t}var UD;function bge(){if(UD)return Or;UD=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.validateKeywordUsage=Or.validSchemaType=Or.funcKeywordCode=Or.macroKeywordCode=void 0;const e=Xe(),t=La(),n=Lr(),r=pm();function i(m,g){const{gen:v,keyword:w,schema:b,parentSchema:_,it:S}=m,x=g.macro.call(S.self,b,_,S),A=f(v,w,x);S.opts.validateSchema!==!1&&S.self.validateSchema(x,!0);const k=v.name("valid");m.subschema({schema:x,schemaPath:e.nil,errSchemaPath:`${S.errSchemaPath}/${w}`,topSchemaRef:A,compositeRule:!0},k),m.pass(k,()=>m.error(!0))}Or.macroKeywordCode=i;function a(m,g){var v;const{gen:w,keyword:b,schema:_,parentSchema:S,$data:x,it:A}=m;c(A,g);const k=!x&&g.compile?g.compile.call(A.self,_,S,A):g.validate,T=f(w,b,k),O=w.let("valid");m.block$data(O,$),m.ok((v=g.valid)!==null&&v!==void 0?v:O);function $(){if(g.errors===!1)z(),g.modifying&&o(m),P(()=>m.error());else{const q=g.async?L():M();g.modifying&&o(m),P(()=>l(m,q))}}function L(){const q=w.let("ruleErrs",null);return w.try(()=>z((0,e._)`await `),D=>w.assign(O,!1).if((0,e._)`${D} instanceof ${A.ValidationError}`,()=>w.assign(q,(0,e._)`${D}.errors`),()=>w.throw(D))),q}function M(){const q=(0,e._)`${T}.errors`;return w.assign(q,null),z(e.nil),q}function z(q=g.async?(0,e._)`await `:e.nil){const D=A.opts.passContext?t.default.this:t.default.self,H=!("compile"in g&&!x||g.schema===!1);w.assign(O,(0,e._)`${q}${(0,n.callValidateCode)(m,T,D,H)}`,g.modifying)}function P(q){var D;w.if((0,e.not)((D=g.valid)!==null&&D!==void 0?D:O),q)}}Or.funcKeywordCode=a;function o(m){const{gen:g,data:v,it:w}=m;g.if(w.parentData,()=>g.assign(v,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function l(m,g){const{gen:v}=m;v.if((0,e._)`Array.isArray(${g})`,()=>{v.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${g} : ${t.default.vErrors}.concat(${g})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(m)},()=>m.error())}function c({schemaEnv:m},g){if(g.async&&!m.$async)throw new Error("async keyword in sync schema")}function f(m,g,v){if(v===void 0)throw new Error(`keyword "${g}" failed to compile`);return m.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,e.stringify)(v)})}function d(m,g,v=!1){return!g.length||g.some(w=>w==="array"?Array.isArray(m):w==="object"?m&&typeof m=="object"&&!Array.isArray(m):typeof m==w||v&&typeof m>"u")}Or.validSchemaType=d;function h({schema:m,opts:g,self:v,errSchemaPath:w},b,_){if(Array.isArray(b.keyword)?!b.keyword.includes(_):b.keyword!==_)throw new Error("ajv implementation error");const S=b.dependencies;if(S!=null&&S.some(x=>!Object.prototype.hasOwnProperty.call(m,x)))throw new Error(`parent schema must have dependencies of ${_}: ${S.join(",")}`);if(b.validateSchema&&!b.validateSchema(m[_])){const A=`keyword "${_}" value is invalid at path "${w}": `+v.errorsText(b.validateSchema.errors);if(g.validateSchema==="log")v.logger.error(A);else throw new Error(A)}}return Or.validateKeywordUsage=h,Or}var Ti={},VD;function vge(){if(VD)return Ti;VD=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.extendSubschemaMode=Ti.extendSubschemaData=Ti.getSubschema=void 0;const e=Xe(),t=ht();function n(a,{keyword:o,schemaProp:l,schema:c,schemaPath:f,errSchemaPath:d,topSchemaRef:h}){if(o!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const m=a.schema[o];return l===void 0?{schema:m,schemaPath:(0,e._)`${a.schemaPath}${(0,e.getProperty)(o)}`,errSchemaPath:`${a.errSchemaPath}/${o}`}:{schema:m[l],schemaPath:(0,e._)`${a.schemaPath}${(0,e.getProperty)(o)}${(0,e.getProperty)(l)}`,errSchemaPath:`${a.errSchemaPath}/${o}/${(0,t.escapeFragment)(l)}`}}if(c!==void 0){if(f===void 0||d===void 0||h===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:f,topSchemaRef:h,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}Ti.getSubschema=n;function r(a,o,{dataProp:l,dataPropType:c,data:f,dataTypes:d,propertyName:h}){if(f!==void 0&&l!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:m}=o;if(l!==void 0){const{errorPath:v,dataPathArr:w,opts:b}=o,_=m.let("data",(0,e._)`${o.data}${(0,e.getProperty)(l)}`,!0);g(_),a.errorPath=(0,e.str)`${v}${(0,t.getErrorPath)(l,c,b.jsPropertySyntax)}`,a.parentDataProperty=(0,e._)`${l}`,a.dataPathArr=[...w,a.parentDataProperty]}if(f!==void 0){const v=f instanceof e.Name?f:m.let("data",f,!0);g(v),h!==void 0&&(a.propertyName=h)}d&&(a.dataTypes=d);function g(v){a.data=v,a.dataLevel=o.dataLevel+1,a.dataTypes=[],o.definedProperties=new Set,a.parentData=o.data,a.dataNames=[...o.dataNames,v]}}Ti.extendSubschemaData=r;function i(a,{jtdDiscriminator:o,jtdMetadata:l,compositeRule:c,createErrors:f,allErrors:d}){c!==void 0&&(a.compositeRule=c),f!==void 0&&(a.createErrors=f),d!==void 0&&(a.allErrors=d),a.jtdDiscriminator=o,a.jtdMetadata=l}return Ti.extendSubschemaMode=i,Ti}var kn={},Vx,HD;function KL(){return HD||(HD=1,Vx=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}),Vx}var Hx={exports:{}},GD;function _ge(){if(GD)return Hx.exports;GD=1;var e=Hx.exports=function(r,i,a){typeof i=="function"&&(a=i,i={}),a=i.cb||a;var o=typeof a=="function"?a:a.pre||function(){},l=a.post||function(){};t(i,o,l,r,"",r)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(r,i,a,o,l,c,f,d,h,m){if(o&&typeof o=="object"&&!Array.isArray(o)){i(o,l,c,f,d,h,m);for(var g in o){var v=o[g];if(Array.isArray(v)){if(g in e.arrayKeywords)for(var w=0;w<v.length;w++)t(r,i,a,v[w],l+"/"+g+"/"+w,c,l,g,o,w)}else if(g in e.propsKeywords){if(v&&typeof v=="object")for(var b in v)t(r,i,a,v[b],l+"/"+g+"/"+n(b),c,l,g,o,b)}else(g in e.keywords||r.allKeys&&!(g in e.skipKeywords))&&t(r,i,a,v,l+"/"+g,c,l,g,o)}a(o,l,c,f,d,h,m)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return Hx.exports}var YD;function mm(){if(YD)return kn;YD=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.getSchemaRefs=kn.resolveUrl=kn.normalizeId=kn._getFullPath=kn.getFullPath=kn.inlineRef=void 0;const e=ht(),t=KL(),n=_ge(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(w,b=!0){return typeof w=="boolean"?!0:b===!0?!o(w):b?l(w)<=b:!1}kn.inlineRef=i;const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(w){for(const b in w){if(a.has(b))return!0;const _=w[b];if(Array.isArray(_)&&_.some(o)||typeof _=="object"&&o(_))return!0}return!1}function l(w){let b=0;for(const _ in w){if(_==="$ref")return 1/0;if(b++,!r.has(_)&&(typeof w[_]=="object"&&(0,e.eachItem)(w[_],S=>b+=l(S)),b===1/0))return 1/0}return b}function c(w,b="",_){_!==!1&&(b=h(b));const S=w.parse(b);return f(w,S)}kn.getFullPath=c;function f(w,b){return w.serialize(b).split("#")[0]+"#"}kn._getFullPath=f;const d=/#\/?$/;function h(w){return w?w.replace(d,""):""}kn.normalizeId=h;function m(w,b,_){return _=h(_),w.resolve(b,_)}kn.resolveUrl=m;const g=/^[a-z_][-a-z0-9._]*$/i;function v(w,b){if(typeof w=="boolean")return{};const{schemaId:_,uriResolver:S}=this.opts,x=h(w[_]||b),A={"":x},k=c(S,x,!1),T={},O=new Set;return n(w,{allKeys:!0},(M,z,P,q)=>{if(q===void 0)return;const D=k+z;let H=A[q];typeof M[_]=="string"&&(H=B.call(this,M[_])),G.call(this,M.$anchor),G.call(this,M.$dynamicAnchor),A[z]=H;function B(K){const Q=this.opts.uriResolver.resolve;if(K=h(H?Q(H,K):K),O.has(K))throw L(K);O.add(K);let R=this.refs[K];return typeof R=="string"&&(R=this.refs[R]),typeof R=="object"?$(M,R.schema,K):K!==h(D)&&(K[0]==="#"?($(M,T[K],K),T[K]=M):this.refs[K]=D),K}function G(K){if(typeof K=="string"){if(!g.test(K))throw new Error(`invalid anchor "${K}"`);B.call(this,`#${K}`)}}}),T;function $(M,z,P){if(z!==void 0&&!t(M,z))throw L(P)}function L(M){return new Error(`reference "${M}" resolves to more than one schema`)}}return kn.getSchemaRefs=v,kn}var ZD;function gm(){if(ZD)return ki;ZD=1,Object.defineProperty(ki,"__esModule",{value:!0}),ki.getData=ki.KeywordCxt=ki.validateFunctionCode=void 0;const e=gge(),t=yp(),n=ZL(),r=yp(),i=yge(),a=bge(),o=vge(),l=Xe(),c=La(),f=mm(),d=ht(),h=pm();function m(W){if(k(W)&&(O(W),A(W))){b(W);return}g(W,()=>(0,e.topBoolOrEmptySchema)(W))}ki.validateFunctionCode=m;function g({gen:W,validateName:J,schema:se,schemaEnv:fe,opts:me},xe){me.code.es5?W.func(J,(0,l._)`${c.default.data}, ${c.default.valCxt}`,fe.$async,()=>{W.code((0,l._)`"use strict"; ${S(se,me)}`),w(W,me),W.code(xe)}):W.func(J,(0,l._)`${c.default.data}, ${v(me)}`,fe.$async,()=>W.code(S(se,me)).code(xe))}function v(W){return(0,l._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${W.dynamicRef?(0,l._)`, ${c.default.dynamicAnchors}={}`:l.nil}}={}`}function w(W,J){W.if(c.default.valCxt,()=>{W.var(c.default.instancePath,(0,l._)`${c.default.valCxt}.${c.default.instancePath}`),W.var(c.default.parentData,(0,l._)`${c.default.valCxt}.${c.default.parentData}`),W.var(c.default.parentDataProperty,(0,l._)`${c.default.valCxt}.${c.default.parentDataProperty}`),W.var(c.default.rootData,(0,l._)`${c.default.valCxt}.${c.default.rootData}`),J.dynamicRef&&W.var(c.default.dynamicAnchors,(0,l._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{W.var(c.default.instancePath,(0,l._)`""`),W.var(c.default.parentData,(0,l._)`undefined`),W.var(c.default.parentDataProperty,(0,l._)`undefined`),W.var(c.default.rootData,c.default.data),J.dynamicRef&&W.var(c.default.dynamicAnchors,(0,l._)`{}`)})}function b(W){const{schema:J,opts:se,gen:fe}=W;g(W,()=>{se.$comment&&J.$comment&&q(W),M(W),fe.let(c.default.vErrors,null),fe.let(c.default.errors,0),se.unevaluated&&_(W),$(W),D(W)})}function _(W){const{gen:J,validateName:se}=W;W.evaluated=J.const("evaluated",(0,l._)`${se}.evaluated`),J.if((0,l._)`${W.evaluated}.dynamicProps`,()=>J.assign((0,l._)`${W.evaluated}.props`,(0,l._)`undefined`)),J.if((0,l._)`${W.evaluated}.dynamicItems`,()=>J.assign((0,l._)`${W.evaluated}.items`,(0,l._)`undefined`))}function S(W,J){const se=typeof W=="object"&&W[J.schemaId];return se&&(J.code.source||J.code.process)?(0,l._)`/*# sourceURL=${se} */`:l.nil}function x(W,J){if(k(W)&&(O(W),A(W))){T(W,J);return}(0,e.boolOrEmptySchema)(W,J)}function A({schema:W,self:J}){if(typeof W=="boolean")return!W;for(const se in W)if(J.RULES.all[se])return!0;return!1}function k(W){return typeof W.schema!="boolean"}function T(W,J){const{schema:se,gen:fe,opts:me}=W;me.$comment&&se.$comment&&q(W),z(W),P(W);const xe=fe.const("_errs",c.default.errors);$(W,xe),fe.var(J,(0,l._)`${xe} === ${c.default.errors}`)}function O(W){(0,d.checkUnknownRules)(W),L(W)}function $(W,J){if(W.opts.jtd)return B(W,[],!1,J);const se=(0,t.getSchemaTypes)(W.schema),fe=(0,t.coerceAndCheckDataType)(W,se);B(W,se,!fe,J)}function L(W){const{schema:J,errSchemaPath:se,opts:fe,self:me}=W;J.$ref&&fe.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(J,me.RULES)&&me.logger.warn(`$ref: keywords ignored in schema at path "${se}"`)}function M(W){const{schema:J,opts:se}=W;J.default!==void 0&&se.useDefaults&&se.strictSchema&&(0,d.checkStrictMode)(W,"default is ignored in the schema root")}function z(W){const J=W.schema[W.opts.schemaId];J&&(W.baseId=(0,f.resolveUrl)(W.opts.uriResolver,W.baseId,J))}function P(W){if(W.schema.$async&&!W.schemaEnv.$async)throw new Error("async schema in sync schema")}function q({gen:W,schemaEnv:J,schema:se,errSchemaPath:fe,opts:me}){const xe=se.$comment;if(me.$comment===!0)W.code((0,l._)`${c.default.self}.logger.log(${xe})`);else if(typeof me.$comment=="function"){const we=(0,l.str)`${fe}/$comment`,Ve=W.scopeValue("root",{ref:J.root});W.code((0,l._)`${c.default.self}.opts.$comment(${xe}, ${we}, ${Ve}.schema)`)}}function D(W){const{gen:J,schemaEnv:se,validateName:fe,ValidationError:me,opts:xe}=W;se.$async?J.if((0,l._)`${c.default.errors} === 0`,()=>J.return(c.default.data),()=>J.throw((0,l._)`new ${me}(${c.default.vErrors})`)):(J.assign((0,l._)`${fe}.errors`,c.default.vErrors),xe.unevaluated&&H(W),J.return((0,l._)`${c.default.errors} === 0`))}function H({gen:W,evaluated:J,props:se,items:fe}){se instanceof l.Name&&W.assign((0,l._)`${J}.props`,se),fe instanceof l.Name&&W.assign((0,l._)`${J}.items`,fe)}function B(W,J,se,fe){const{gen:me,schema:xe,data:we,allErrors:Ve,opts:qe,self:We}=W,{RULES:He}=We;if(xe.$ref&&(qe.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(xe,He))){me.block(()=>ne(W,"$ref",He.all.$ref.definition));return}qe.jtd||K(W,J),me.block(()=>{for(const Be of He.rules)$e(Be);$e(He.post)});function $e(Be){(0,n.shouldUseGroup)(xe,Be)&&(Be.type?(me.if((0,r.checkDataType)(Be.type,we,qe.strictNumbers)),G(W,Be),J.length===1&&J[0]===Be.type&&se&&(me.else(),(0,r.reportTypeError)(W)),me.endIf()):G(W,Be),Ve||me.if((0,l._)`${c.default.errors} === ${fe||0}`))}}function G(W,J){const{gen:se,schema:fe,opts:{useDefaults:me}}=W;me&&(0,i.assignDefaults)(W,J.type),se.block(()=>{for(const xe of J.rules)(0,n.shouldUseRule)(fe,xe)&&ne(W,xe.keyword,xe.definition,J.type)})}function K(W,J){W.schemaEnv.meta||!W.opts.strictTypes||(Q(W,J),W.opts.allowUnionTypes||R(W,J),V(W,W.dataTypes))}function Q(W,J){if(J.length){if(!W.dataTypes.length){W.dataTypes=J;return}J.forEach(se=>{j(W.dataTypes,se)||U(W,`type "${se}" not allowed by context "${W.dataTypes.join(",")}"`)}),I(W,J)}}function R(W,J){J.length>1&&!(J.length===2&&J.includes("null"))&&U(W,"use allowUnionTypes to allow union type keyword")}function V(W,J){const se=W.self.RULES.all;for(const fe in se){const me=se[fe];if(typeof me=="object"&&(0,n.shouldUseRule)(W.schema,me)){const{type:xe}=me.definition;xe.length&&!xe.some(we=>X(J,we))&&U(W,`missing type "${xe.join(",")}" for keyword "${fe}"`)}}}function X(W,J){return W.includes(J)||J==="number"&&W.includes("integer")}function j(W,J){return W.includes(J)||J==="integer"&&W.includes("number")}function I(W,J){const se=[];for(const fe of W.dataTypes)j(J,fe)?se.push(fe):J.includes("integer")&&fe==="number"&&se.push("integer");W.dataTypes=se}function U(W,J){const se=W.schemaEnv.baseId+W.errSchemaPath;J+=` at "${se}" (strictTypes)`,(0,d.checkStrictMode)(W,J,W.opts.strictTypes)}class Y{constructor(J,se,fe){if((0,a.validateKeywordUsage)(J,se,fe),this.gen=J.gen,this.allErrors=J.allErrors,this.keyword=fe,this.data=J.data,this.schema=J.schema[fe],this.$data=se.$data&&J.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(J,this.schema,fe,this.$data),this.schemaType=se.schemaType,this.parentSchema=J.schema,this.params={},this.it=J,this.def=se,this.$data)this.schemaCode=J.gen.const("vSchema",le(this.$data,J));else if(this.schemaCode=this.schemaValue,!(0,a.validSchemaType)(this.schema,se.schemaType,se.allowUndefined))throw new Error(`${fe} value must be ${JSON.stringify(se.schemaType)}`);("code"in se?se.trackErrors:se.errors!==!1)&&(this.errsCount=J.gen.const("_errs",c.default.errors))}result(J,se,fe){this.failResult((0,l.not)(J),se,fe)}failResult(J,se,fe){this.gen.if(J),fe?fe():this.error(),se?(this.gen.else(),se(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(J,se){this.failResult((0,l.not)(J),void 0,se)}fail(J){if(J===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(J),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(J){if(!this.$data)return this.fail(J);const{schemaCode:se}=this;this.fail((0,l._)`${se} !== undefined && (${(0,l.or)(this.invalid$data(),J)})`)}error(J,se,fe){if(se){this.setParams(se),this._error(J,fe),this.setParams({});return}this._error(J,fe)}_error(J,se){(J?h.reportExtraError:h.reportError)(this,this.def.error,se)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(J){this.allErrors||this.gen.if(J)}setParams(J,se){se?Object.assign(this.params,J):this.params=J}block$data(J,se,fe=l.nil){this.gen.block(()=>{this.check$data(J,fe),se()})}check$data(J=l.nil,se=l.nil){if(!this.$data)return;const{gen:fe,schemaCode:me,schemaType:xe,def:we}=this;fe.if((0,l.or)((0,l._)`${me} === undefined`,se)),J!==l.nil&&fe.assign(J,!0),(xe.length||we.validateSchema)&&(fe.elseIf(this.invalid$data()),this.$dataError(),J!==l.nil&&fe.assign(J,!1)),fe.else()}invalid$data(){const{gen:J,schemaCode:se,schemaType:fe,def:me,it:xe}=this;return(0,l.or)(we(),Ve());function we(){if(fe.length){if(!(se instanceof l.Name))throw new Error("ajv implementation error");const qe=Array.isArray(fe)?fe:[fe];return(0,l._)`${(0,r.checkDataTypes)(qe,se,xe.opts.strictNumbers,r.DataType.Wrong)}`}return l.nil}function Ve(){if(me.validateSchema){const qe=J.scopeValue("validate$data",{ref:me.validateSchema});return(0,l._)`!${qe}(${se})`}return l.nil}}subschema(J,se){const fe=(0,o.getSubschema)(this.it,J);(0,o.extendSubschemaData)(fe,this.it,J),(0,o.extendSubschemaMode)(fe,J);const me={...this.it,...fe,items:void 0,props:void 0};return x(me,se),me}mergeEvaluated(J,se){const{it:fe,gen:me}=this;fe.opts.unevaluated&&(fe.props!==!0&&J.props!==void 0&&(fe.props=d.mergeEvaluated.props(me,J.props,fe.props,se)),fe.items!==!0&&J.items!==void 0&&(fe.items=d.mergeEvaluated.items(me,J.items,fe.items,se)))}mergeValidEvaluated(J,se){const{it:fe,gen:me}=this;if(fe.opts.unevaluated&&(fe.props!==!0||fe.items!==!0))return me.if(se,()=>this.mergeEvaluated(J,l.Name)),!0}}ki.KeywordCxt=Y;function ne(W,J,se,fe){const me=new Y(W,se,J);"code"in se?se.code(me,fe):me.$data&&se.validate?(0,a.funcKeywordCode)(me,se):"macro"in se?(0,a.macroKeywordCode)(me,se):(se.compile||se.validate)&&(0,a.funcKeywordCode)(me,se)}const ae=/^\/(?:[^~]|~0|~1)*$/,re=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function le(W,{dataLevel:J,dataNames:se,dataPathArr:fe}){let me,xe;if(W==="")return c.default.rootData;if(W[0]==="/"){if(!ae.test(W))throw new Error(`Invalid JSON-pointer: ${W}`);me=W,xe=c.default.rootData}else{const We=re.exec(W);if(!We)throw new Error(`Invalid JSON-pointer: ${W}`);const He=+We[1];if(me=We[2],me==="#"){if(He>=J)throw new Error(qe("property/index",He));return fe[J-He]}if(He>J)throw new Error(qe("data",He));if(xe=se[J-He],!me)return xe}let we=xe;const Ve=me.split("/");for(const We of Ve)We&&(xe=(0,l._)`${xe}${(0,l.getProperty)((0,d.unescapeJsonPointer)(We))}`,we=(0,l._)`${we} && ${xe}`);return we;function qe(We,He){return`Cannot access ${We} ${He} levels up, current level is ${J}`}}return ki.getData=le,ki}var Pd={},KD;function zE(){if(KD)return Pd;KD=1,Object.defineProperty(Pd,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Pd.default=e,Pd}var Ld={},XD;function ym(){if(XD)return Ld;XD=1,Object.defineProperty(Ld,"__esModule",{value:!0});const e=mm();class t extends Error{constructor(r,i,a,o){super(o||`can't resolve reference ${a} from id ${i}`),this.missingRef=(0,e.resolveUrl)(r,i,a),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(r,this.missingRef))}}return Ld.default=t,Ld}var Wn={},WD;function qE(){if(WD)return Wn;WD=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.resolveSchema=Wn.getCompilingSchema=Wn.resolveRef=Wn.compileSchema=Wn.SchemaEnv=void 0;const e=Xe(),t=zE(),n=La(),r=mm(),i=ht(),a=gm();class o{constructor(_){var S;this.refs={},this.dynamicAnchors={};let x;typeof _.schema=="object"&&(x=_.schema),this.schema=_.schema,this.schemaId=_.schemaId,this.root=_.root||this,this.baseId=(S=_.baseId)!==null&&S!==void 0?S:(0,r.normalizeId)(x==null?void 0:x[_.schemaId||"$id"]),this.schemaPath=_.schemaPath,this.localRefs=_.localRefs,this.meta=_.meta,this.$async=x==null?void 0:x.$async,this.refs={}}}Wn.SchemaEnv=o;function l(b){const _=d.call(this,b);if(_)return _;const S=(0,r.getFullPath)(this.opts.uriResolver,b.root.baseId),{es5:x,lines:A}=this.opts.code,{ownProperties:k}=this.opts,T=new e.CodeGen(this.scope,{es5:x,lines:A,ownProperties:k});let O;b.$async&&(O=T.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const $=T.scopeName("validate");b.validateName=$;const L={gen:T,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:T.scopeValue("schema",this.opts.code.source===!0?{ref:b.schema,code:(0,e.stringify)(b.schema)}:{ref:b.schema}),validateName:$,ValidationError:O,schema:b.schema,schemaEnv:b,rootId:S,baseId:b.baseId||S,schemaPath:e.nil,errSchemaPath:b.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let M;try{this._compilations.add(b),(0,a.validateFunctionCode)(L),T.optimize(this.opts.code.optimize);const z=T.toString();M=`${T.scopeRefs(n.default.scope)}return ${z}`,this.opts.code.process&&(M=this.opts.code.process(M,b));const q=new Function(`${n.default.self}`,`${n.default.scope}`,M)(this,this.scope.get());if(this.scope.value($,{ref:q}),q.errors=null,q.schema=b.schema,q.schemaEnv=b,b.$async&&(q.$async=!0),this.opts.code.source===!0&&(q.source={validateName:$,validateCode:z,scopeValues:T._values}),this.opts.unevaluated){const{props:D,items:H}=L;q.evaluated={props:D instanceof e.Name?void 0:D,items:H instanceof e.Name?void 0:H,dynamicProps:D instanceof e.Name,dynamicItems:H instanceof e.Name},q.source&&(q.source.evaluated=(0,e.stringify)(q.evaluated))}return b.validate=q,b}catch(z){throw delete b.validate,delete b.validateName,M&&this.logger.error("Error compiling schema, function code:",M),z}finally{this._compilations.delete(b)}}Wn.compileSchema=l;function c(b,_,S){var x;S=(0,r.resolveUrl)(this.opts.uriResolver,_,S);const A=b.refs[S];if(A)return A;let k=m.call(this,b,S);if(k===void 0){const T=(x=b.localRefs)===null||x===void 0?void 0:x[S],{schemaId:O}=this.opts;T&&(k=new o({schema:T,schemaId:O,root:b,baseId:_}))}if(k!==void 0)return b.refs[S]=f.call(this,k)}Wn.resolveRef=c;function f(b){return(0,r.inlineRef)(b.schema,this.opts.inlineRefs)?b.schema:b.validate?b:l.call(this,b)}function d(b){for(const _ of this._compilations)if(h(_,b))return _}Wn.getCompilingSchema=d;function h(b,_){return b.schema===_.schema&&b.root===_.root&&b.baseId===_.baseId}function m(b,_){let S;for(;typeof(S=this.refs[_])=="string";)_=S;return S||this.schemas[_]||g.call(this,b,_)}function g(b,_){const S=this.opts.uriResolver.parse(_),x=(0,r._getFullPath)(this.opts.uriResolver,S);let A=(0,r.getFullPath)(this.opts.uriResolver,b.baseId,void 0);if(Object.keys(b.schema).length>0&&x===A)return w.call(this,S,b);const k=(0,r.normalizeId)(x),T=this.refs[k]||this.schemas[k];if(typeof T=="string"){const O=g.call(this,b,T);return typeof(O==null?void 0:O.schema)!="object"?void 0:w.call(this,S,O)}if(typeof(T==null?void 0:T.schema)=="object"){if(T.validate||l.call(this,T),k===(0,r.normalizeId)(_)){const{schema:O}=T,{schemaId:$}=this.opts,L=O[$];return L&&(A=(0,r.resolveUrl)(this.opts.uriResolver,A,L)),new o({schema:O,schemaId:$,root:b,baseId:A})}return w.call(this,S,T)}}Wn.resolveSchema=g;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(b,{baseId:_,schema:S,root:x}){var A;if(((A=b.fragment)===null||A===void 0?void 0:A[0])!=="/")return;for(const O of b.fragment.slice(1).split("/")){if(typeof S=="boolean")return;const $=S[(0,i.unescapeFragment)(O)];if($===void 0)return;S=$;const L=typeof S=="object"&&S[this.opts.schemaId];!v.has(O)&&L&&(_=(0,r.resolveUrl)(this.opts.uriResolver,_,L))}let k;if(typeof S!="boolean"&&S.$ref&&!(0,i.schemaHasRulesButRef)(S,this.RULES)){const O=(0,r.resolveUrl)(this.opts.uriResolver,_,S.$ref);k=g.call(this,x,O)}const{schemaId:T}=this.opts;if(k=k||new o({schema:S,schemaId:T,root:x,baseId:_}),k.schema!==k.root.schema)return k}return Wn}const xge="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",wge="Meta-schema for $data reference (JSON AnySchema extension proposal)",Sge="object",Ege=["$data"],kge={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Age=!1,Tge={$id:xge,description:wge,type:Sge,required:Ege,properties:kge,additionalProperties:Age};var zd={},$u={exports:{}},Gx,QD;function XL(){if(QD)return Gx;QD=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(m){let g="",v=0,w=0;for(w=0;w<m.length;w++)if(v=m[w].charCodeAt(0),v!==48){if(!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=m[w];break}for(w+=1;w<m.length;w++){if(v=m[w].charCodeAt(0),!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=m[w]}return g}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(m){return m.length=0,!0}function a(m,g,v){if(m.length){const w=n(m);if(w!=="")g.push(w);else return v.error=!0,!1;m.length=0}return!0}function o(m){let g=0;const v={error:!1,address:"",zone:""},w=[],b=[];let _=!1,S=!1,x=a;for(let A=0;A<m.length;A++){const k=m[A];if(!(k==="["||k==="]"))if(k===":"){if(_===!0&&(S=!0),!x(b,w,v))break;if(++g>7){v.error=!0;break}A>0&&m[A-1]===":"&&(_=!0),w.push(":");continue}else if(k==="%"){if(!x(b,w,v))break;x=i}else{b.push(k);continue}}return b.length&&(x===i?v.zone=b.join(""):S?w.push(b.join("")):w.push(n(b))),v.address=w.join(""),v}function l(m){if(c(m,":")<2)return{host:m,isIPV6:!1};const g=o(m);if(g.error)return{host:m,isIPV6:!1};{let v=g.address,w=g.address;return g.zone&&(v+="%"+g.zone,w+="%25"+g.zone),{host:v,isIPV6:!0,escapedHost:w}}}function c(m,g){let v=0;for(let w=0;w<m.length;w++)m[w]===g&&v++;return v}function f(m){let g=m;const v=[];let w=-1,b=0;for(;b=g.length;){if(b===1){if(g===".")break;if(g==="/"){v.push("/");break}else{v.push(g);break}}else if(b===2){if(g[0]==="."){if(g[1]===".")break;if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&(g[1]==="."||g[1]==="/")){v.push("/");break}}else if(b===3&&g==="/.."){v.length!==0&&v.pop(),v.push("/");break}if(g[0]==="."){if(g[1]==="."){if(g[2]==="/"){g=g.slice(3);continue}}else if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&g[1]==="."){if(g[2]==="/"){g=g.slice(2);continue}else if(g[2]==="."&&g[3]==="/"){g=g.slice(3),v.length!==0&&v.pop();continue}}if((w=g.indexOf("/",1))===-1){v.push(g);break}else v.push(g.slice(0,w)),g=g.slice(w)}return v.join("")}function d(m,g){const v=g!==!0?escape:unescape;return m.scheme!==void 0&&(m.scheme=v(m.scheme)),m.userinfo!==void 0&&(m.userinfo=v(m.userinfo)),m.host!==void 0&&(m.host=v(m.host)),m.path!==void 0&&(m.path=v(m.path)),m.query!==void 0&&(m.query=v(m.query)),m.fragment!==void 0&&(m.fragment=v(m.fragment)),m}function h(m){const g=[];if(m.userinfo!==void 0&&(g.push(m.userinfo),g.push("@")),m.host!==void 0){let v=unescape(m.host);if(!t(v)){const w=l(v);w.isIPV6===!0?v=`[${w.escapedHost}]`:v=m.host}g.push(v)}return(typeof m.port=="number"||typeof m.port=="string")&&(g.push(":"),g.push(String(m.port))),g.length?g.join(""):void 0}return Gx={nonSimpleDomain:r,recomposeAuthority:h,normalizeComponentEncoding:d,removeDotSegments:f,isIPv4:t,isUUID:e,normalizeIPv6:l,stringArrayToHexStripped:n},Gx}var Yx,JD;function Cge(){if(JD)return Yx;JD=1;const{isUUID:e}=XL(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function r(k){return n.indexOf(k)!==-1}function i(k){return k.secure===!0?!0:k.secure===!1?!1:k.scheme?k.scheme.length===3&&(k.scheme[0]==="w"||k.scheme[0]==="W")&&(k.scheme[1]==="s"||k.scheme[1]==="S")&&(k.scheme[2]==="s"||k.scheme[2]==="S"):!1}function a(k){return k.host||(k.error=k.error||"HTTP URIs must have a host."),k}function o(k){const T=String(k.scheme).toLowerCase()==="https";return(k.port===(T?443:80)||k.port==="")&&(k.port=void 0),k.path||(k.path="/"),k}function l(k){return k.secure=i(k),k.resourceName=(k.path||"/")+(k.query?"?"+k.query:""),k.path=void 0,k.query=void 0,k}function c(k){if((k.port===(i(k)?443:80)||k.port==="")&&(k.port=void 0),typeof k.secure=="boolean"&&(k.scheme=k.secure?"wss":"ws",k.secure=void 0),k.resourceName){const[T,O]=k.resourceName.split("?");k.path=T&&T!=="/"?T:void 0,k.query=O,k.resourceName=void 0}return k.fragment=void 0,k}function f(k,T){if(!k.path)return k.error="URN can not be parsed",k;const O=k.path.match(t);if(O){const $=T.scheme||k.scheme||"urn";k.nid=O[1].toLowerCase(),k.nss=O[2];const L=`${$}:${T.nid||k.nid}`,M=A(L);k.path=void 0,M&&(k=M.parse(k,T))}else k.error=k.error||"URN can not be parsed.";return k}function d(k,T){if(k.nid===void 0)throw new Error("URN without nid cannot be serialized");const O=T.scheme||k.scheme||"urn",$=k.nid.toLowerCase(),L=`${O}:${T.nid||$}`,M=A(L);M&&(k=M.serialize(k,T));const z=k,P=k.nss;return z.path=`${$||T.nid}:${P}`,T.skipEscape=!0,z}function h(k,T){const O=k;return O.uuid=O.nss,O.nss=void 0,!T.tolerant&&(!O.uuid||!e(O.uuid))&&(O.error=O.error||"UUID is not valid."),O}function m(k){const T=k;return T.nss=(k.uuid||"").toLowerCase(),T}const g={scheme:"http",domainHost:!0,parse:a,serialize:o},v={scheme:"https",domainHost:g.domainHost,parse:a,serialize:o},w={scheme:"ws",domainHost:!0,parse:l,serialize:c},b={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},x={http:g,https:v,ws:w,wss:b,urn:{scheme:"urn",parse:f,serialize:d,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:h,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(x,null);function A(k){return k&&(x[k]||x[k.toLowerCase()])||void 0}return Yx={wsIsSecure:i,SCHEMES:x,isValidSchemeName:r,getSchemeHandler:A},Yx}var eI;function Oge(){if(eI)return $u.exports;eI=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:n,normalizeComponentEncoding:r,isIPv4:i,nonSimpleDomain:a}=XL(),{SCHEMES:o,getSchemeHandler:l}=Cge();function c(b,_){return typeof b=="string"?b=m(v(b,_),_):typeof b=="object"&&(b=v(m(b,_),_)),b}function f(b,_,S){const x=S?Object.assign({scheme:"null"},S):{scheme:"null"},A=d(v(b,x),v(_,x),x,!0);return x.skipEscape=!0,m(A,x)}function d(b,_,S,x){const A={};return x||(b=v(m(b,S),S),_=v(m(_,S),S)),S=S||{},!S.tolerant&&_.scheme?(A.scheme=_.scheme,A.userinfo=_.userinfo,A.host=_.host,A.port=_.port,A.path=t(_.path||""),A.query=_.query):(_.userinfo!==void 0||_.host!==void 0||_.port!==void 0?(A.userinfo=_.userinfo,A.host=_.host,A.port=_.port,A.path=t(_.path||""),A.query=_.query):(_.path?(_.path[0]==="/"?A.path=t(_.path):((b.userinfo!==void 0||b.host!==void 0||b.port!==void 0)&&!b.path?A.path="/"+_.path:b.path?A.path=b.path.slice(0,b.path.lastIndexOf("/")+1)+_.path:A.path=_.path,A.path=t(A.path)),A.query=_.query):(A.path=b.path,_.query!==void 0?A.query=_.query:A.query=b.query),A.userinfo=b.userinfo,A.host=b.host,A.port=b.port),A.scheme=b.scheme),A.fragment=_.fragment,A}function h(b,_,S){return typeof b=="string"?(b=unescape(b),b=m(r(v(b,S),!0),{...S,skipEscape:!0})):typeof b=="object"&&(b=m(r(b,!0),{...S,skipEscape:!0})),typeof _=="string"?(_=unescape(_),_=m(r(v(_,S),!0),{...S,skipEscape:!0})):typeof _=="object"&&(_=m(r(_,!0),{...S,skipEscape:!0})),b.toLowerCase()===_.toLowerCase()}function m(b,_){const S={host:b.host,scheme:b.scheme,userinfo:b.userinfo,port:b.port,path:b.path,query:b.query,nid:b.nid,nss:b.nss,uuid:b.uuid,fragment:b.fragment,reference:b.reference,resourceName:b.resourceName,secure:b.secure,error:""},x=Object.assign({},_),A=[],k=l(x.scheme||S.scheme);k&&k.serialize&&k.serialize(S,x),S.path!==void 0&&(x.skipEscape?S.path=unescape(S.path):(S.path=escape(S.path),S.scheme!==void 0&&(S.path=S.path.split("%3A").join(":")))),x.reference!=="suffix"&&S.scheme&&A.push(S.scheme,":");const T=n(S);if(T!==void 0&&(x.reference!=="suffix"&&A.push("//"),A.push(T),S.path&&S.path[0]!=="/"&&A.push("/")),S.path!==void 0){let O=S.path;!x.absolutePath&&(!k||!k.absolutePath)&&(O=t(O)),T===void 0&&O[0]==="/"&&O[1]==="/"&&(O="/%2F"+O.slice(2)),A.push(O)}return S.query!==void 0&&A.push("?",S.query),S.fragment!==void 0&&A.push("#",S.fragment),A.join("")}const g=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function v(b,_){const S=Object.assign({},_),x={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let A=!1;S.reference==="suffix"&&(S.scheme?b=S.scheme+":"+b:b="//"+b);const k=b.match(g);if(k){if(x.scheme=k[1],x.userinfo=k[3],x.host=k[4],x.port=parseInt(k[5],10),x.path=k[6]||"",x.query=k[7],x.fragment=k[8],isNaN(x.port)&&(x.port=k[5]),x.host)if(i(x.host)===!1){const $=e(x.host);x.host=$.host.toLowerCase(),A=$.isIPV6}else A=!0;x.scheme===void 0&&x.userinfo===void 0&&x.host===void 0&&x.port===void 0&&x.query===void 0&&!x.path?x.reference="same-document":x.scheme===void 0?x.reference="relative":x.fragment===void 0?x.reference="absolute":x.reference="uri",S.reference&&S.reference!=="suffix"&&S.reference!==x.reference&&(x.error=x.error||"URI is not a "+S.reference+" reference.");const T=l(S.scheme||x.scheme);if(!S.unicodeSupport&&(!T||!T.unicodeSupport)&&x.host&&(S.domainHost||T&&T.domainHost)&&A===!1&&a(x.host))try{x.host=URL.domainToASCII(x.host.toLowerCase())}catch(O){x.error=x.error||"Host's domain name can not be converted to ASCII: "+O}(!T||T&&!T.skipNormalize)&&(b.indexOf("%")!==-1&&(x.scheme!==void 0&&(x.scheme=unescape(x.scheme)),x.host!==void 0&&(x.host=unescape(x.host))),x.path&&(x.path=escape(unescape(x.path))),x.fragment&&(x.fragment=encodeURI(decodeURIComponent(x.fragment)))),T&&T.parse&&T.parse(x,S)}else x.error=x.error||"URI can not be parsed.";return x}const w={SCHEMES:o,normalize:c,resolve:f,resolveComponent:d,equal:h,serialize:m,parse:v};return $u.exports=w,$u.exports.default=w,$u.exports.fastUri=w,$u.exports}var tI;function Nge(){if(tI)return zd;tI=1,Object.defineProperty(zd,"__esModule",{value:!0});const e=Oge();return e.code='require("ajv/dist/runtime/uri").default',zd.default=e,zd}var nI;function Rge(){return nI||(nI=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=gm();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=Xe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=zE(),i=ym(),a=YL(),o=qE(),l=Xe(),c=mm(),f=yp(),d=ht(),h=Tge,m=Nge(),g=(R,V)=>new RegExp(R,V);g.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},S=200;function x(R){var V,X,j,I,U,Y,ne,ae,re,le,W,J,se,fe,me,xe,we,Ve,qe,We,He,$e,Be,Ot,kt;const pe=R.strict,_e=(V=R.code)===null||V===void 0?void 0:V.optimize,Te=_e===!0||_e===void 0?1:_e||0,je=(j=(X=R.code)===null||X===void 0?void 0:X.regExp)!==null&&j!==void 0?j:g,rt=(I=R.uriResolver)!==null&&I!==void 0?I:m.default;return{strictSchema:(Y=(U=R.strictSchema)!==null&&U!==void 0?U:pe)!==null&&Y!==void 0?Y:!0,strictNumbers:(ae=(ne=R.strictNumbers)!==null&&ne!==void 0?ne:pe)!==null&&ae!==void 0?ae:!0,strictTypes:(le=(re=R.strictTypes)!==null&&re!==void 0?re:pe)!==null&&le!==void 0?le:"log",strictTuples:(J=(W=R.strictTuples)!==null&&W!==void 0?W:pe)!==null&&J!==void 0?J:"log",strictRequired:(fe=(se=R.strictRequired)!==null&&se!==void 0?se:pe)!==null&&fe!==void 0?fe:!1,code:R.code?{...R.code,optimize:Te,regExp:je}:{optimize:Te,regExp:je},loopRequired:(me=R.loopRequired)!==null&&me!==void 0?me:S,loopEnum:(xe=R.loopEnum)!==null&&xe!==void 0?xe:S,meta:(we=R.meta)!==null&&we!==void 0?we:!0,messages:(Ve=R.messages)!==null&&Ve!==void 0?Ve:!0,inlineRefs:(qe=R.inlineRefs)!==null&&qe!==void 0?qe:!0,schemaId:(We=R.schemaId)!==null&&We!==void 0?We:"$id",addUsedSchema:(He=R.addUsedSchema)!==null&&He!==void 0?He:!0,validateSchema:($e=R.validateSchema)!==null&&$e!==void 0?$e:!0,validateFormats:(Be=R.validateFormats)!==null&&Be!==void 0?Be:!0,unicodeRegExp:(Ot=R.unicodeRegExp)!==null&&Ot!==void 0?Ot:!0,int32range:(kt=R.int32range)!==null&&kt!==void 0?kt:!0,uriResolver:rt}}class A{constructor(V={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,V=this.opts={...V,...x(V)};const{es5:X,lines:j}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:w,es5:X,lines:j}),this.logger=P(V.logger);const I=V.validateFormats;V.validateFormats=!1,this.RULES=(0,a.getRules)(),k.call(this,b,V,"NOT SUPPORTED"),k.call(this,_,V,"DEPRECATED","warn"),this._metaOpts=M.call(this),V.formats&&$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),V.keywords&&L.call(this,V.keywords),typeof V.meta=="object"&&this.addMetaSchema(V.meta),O.call(this),V.validateFormats=I}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:V,meta:X,schemaId:j}=this.opts;let I=h;j==="id"&&(I={...h},I.id=I.$id,delete I.$id),X&&V&&this.addMetaSchema(I,I[j],!1)}defaultMeta(){const{meta:V,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof V=="object"?V[X]||V:void 0}validate(V,X){let j;if(typeof V=="string"){if(j=this.getSchema(V),!j)throw new Error(`no schema with key or ref "${V}"`)}else j=this.compile(V);const I=j(X);return"$async"in j||(this.errors=j.errors),I}compile(V,X){const j=this._addSchema(V,X);return j.validate||this._compileSchemaEnv(j)}compileAsync(V,X){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:j}=this.opts;return I.call(this,V,X);async function I(le,W){await U.call(this,le.$schema);const J=this._addSchema(le,W);return J.validate||Y.call(this,J)}async function U(le){le&&!this.getSchema(le)&&await I.call(this,{$ref:le},!0)}async function Y(le){try{return this._compileSchemaEnv(le)}catch(W){if(!(W instanceof i.default))throw W;return ne.call(this,W),await ae.call(this,W.missingSchema),Y.call(this,le)}}function ne({missingSchema:le,missingRef:W}){if(this.refs[le])throw new Error(`AnySchema ${le} is loaded but ${W} cannot be resolved`)}async function ae(le){const W=await re.call(this,le);this.refs[le]||await U.call(this,W.$schema),this.refs[le]||this.addSchema(W,le,X)}async function re(le){const W=this._loading[le];if(W)return W;try{return await(this._loading[le]=j(le))}finally{delete this._loading[le]}}}addSchema(V,X,j,I=this.opts.validateSchema){if(Array.isArray(V)){for(const Y of V)this.addSchema(Y,void 0,j,I);return this}let U;if(typeof V=="object"){const{schemaId:Y}=this.opts;if(U=V[Y],U!==void 0&&typeof U!="string")throw new Error(`schema ${Y} must be string`)}return X=(0,c.normalizeId)(X||U),this._checkUnique(X),this.schemas[X]=this._addSchema(V,j,X,I,!0),this}addMetaSchema(V,X,j=this.opts.validateSchema){return this.addSchema(V,X,!0,j),this}validateSchema(V,X){if(typeof V=="boolean")return!0;let j;if(j=V.$schema,j!==void 0&&typeof j!="string")throw new Error("$schema must be a string");if(j=j||this.opts.defaultMeta||this.defaultMeta(),!j)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const I=this.validate(j,V);if(!I&&X){const U="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(U);else throw new Error(U)}return I}getSchema(V){let X;for(;typeof(X=T.call(this,V))=="string";)V=X;if(X===void 0){const{schemaId:j}=this.opts,I=new o.SchemaEnv({schema:{},schemaId:j});if(X=o.resolveSchema.call(this,I,V),!X)return;this.refs[V]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema(V){if(V instanceof RegExp)return this._removeAllSchemas(this.schemas,V),this._removeAllSchemas(this.refs,V),this;switch(typeof V){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const X=T.call(this,V);return typeof X=="object"&&this._cache.delete(X.schema),delete this.schemas[V],delete this.refs[V],this}case"object":{const X=V;this._cache.delete(X);let j=V[this.opts.schemaId];return j&&(j=(0,c.normalizeId)(j),delete this.schemas[j],delete this.refs[j]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(V){for(const X of V)this.addKeyword(X);return this}addKeyword(V,X){let j;if(typeof V=="string")j=V,typeof X=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=j);else if(typeof V=="object"&&X===void 0){if(X=V,j=X.keyword,Array.isArray(j)&&!j.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(D.call(this,j,X),!X)return(0,d.eachItem)(j,U=>H.call(this,U)),this;G.call(this,X);const I={...X,type:(0,f.getJSONTypes)(X.type),schemaType:(0,f.getJSONTypes)(X.schemaType)};return(0,d.eachItem)(j,I.type.length===0?U=>H.call(this,U,I):U=>I.type.forEach(Y=>H.call(this,U,I,Y))),this}getKeyword(V){const X=this.RULES.all[V];return typeof X=="object"?X.definition:!!X}removeKeyword(V){const{RULES:X}=this;delete X.keywords[V],delete X.all[V];for(const j of X.rules){const I=j.rules.findIndex(U=>U.keyword===V);I>=0&&j.rules.splice(I,1)}return this}addFormat(V,X){return typeof X=="string"&&(X=new RegExp(X)),this.formats[V]=X,this}errorsText(V=this.errors,{separator:X=", ",dataVar:j="data"}={}){return!V||V.length===0?"No errors":V.map(I=>`${j}${I.instancePath} ${I.message}`).reduce((I,U)=>I+X+U)}$dataMetaSchema(V,X){const j=this.RULES.all;V=JSON.parse(JSON.stringify(V));for(const I of X){const U=I.split("/").slice(1);let Y=V;for(const ne of U)Y=Y[ne];for(const ne in j){const ae=j[ne];if(typeof ae!="object")continue;const{$data:re}=ae.definition,le=Y[ne];re&&le&&(Y[ne]=Q(le))}}return V}_removeAllSchemas(V,X){for(const j in V){const I=V[j];(!X||X.test(j))&&(typeof I=="string"?delete V[j]:I&&!I.meta&&(this._cache.delete(I.schema),delete V[j]))}}_addSchema(V,X,j,I=this.opts.validateSchema,U=this.opts.addUsedSchema){let Y;const{schemaId:ne}=this.opts;if(typeof V=="object")Y=V[ne];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof V!="boolean")throw new Error("schema must be object or boolean")}let ae=this._cache.get(V);if(ae!==void 0)return ae;j=(0,c.normalizeId)(Y||j);const re=c.getSchemaRefs.call(this,V,j);return ae=new o.SchemaEnv({schema:V,schemaId:ne,meta:X,baseId:j,localRefs:re}),this._cache.set(ae.schema,ae),U&&!j.startsWith("#")&&(j&&this._checkUnique(j),this.refs[j]=ae),I&&this.validateSchema(V,!0),ae}_checkUnique(V){if(this.schemas[V]||this.refs[V])throw new Error(`schema with key or id "${V}" already exists`)}_compileSchemaEnv(V){if(V.meta?this._compileMetaSchema(V):o.compileSchema.call(this,V),!V.validate)throw new Error("ajv implementation error");return V.validate}_compileMetaSchema(V){const X=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,V)}finally{this.opts=X}}}A.ValidationError=r.default,A.MissingRefError=i.default,e.default=A;function k(R,V,X,j="error"){for(const I in R){const U=I;U in V&&this.logger[j](`${X}: option ${I}. ${R[U]}`)}}function T(R){return R=(0,c.normalizeId)(R),this.schemas[R]||this.refs[R]}function O(){const R=this.opts.schemas;if(R)if(Array.isArray(R))this.addSchema(R);else for(const V in R)this.addSchema(R[V],V)}function $(){for(const R in this.opts.formats){const V=this.opts.formats[R];V&&this.addFormat(R,V)}}function L(R){if(Array.isArray(R)){this.addVocabulary(R);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const V in R){const X=R[V];X.keyword||(X.keyword=V),this.addKeyword(X)}}function M(){const R={...this.opts};for(const V of v)delete R[V];return R}const z={log(){},warn(){},error(){}};function P(R){if(R===!1)return z;if(R===void 0)return console;if(R.log&&R.warn&&R.error)return R;throw new Error("logger must implement log, warn and error methods")}const q=/^[a-z_$][a-z0-9_$:-]*$/i;function D(R,V){const{RULES:X}=this;if((0,d.eachItem)(R,j=>{if(X.keywords[j])throw new Error(`Keyword ${j} is already defined`);if(!q.test(j))throw new Error(`Keyword ${j} has invalid name`)}),!!V&&V.$data&&!("code"in V||"validate"in V))throw new Error('$data keyword must have "code" or "validate" function')}function H(R,V,X){var j;const I=V==null?void 0:V.post;if(X&&I)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:U}=this;let Y=I?U.post:U.rules.find(({type:ae})=>ae===X);if(Y||(Y={type:X,rules:[]},U.rules.push(Y)),U.keywords[R]=!0,!V)return;const ne={keyword:R,definition:{...V,type:(0,f.getJSONTypes)(V.type),schemaType:(0,f.getJSONTypes)(V.schemaType)}};V.before?B.call(this,Y,ne,V.before):Y.rules.push(ne),U.all[R]=ne,(j=V.implements)===null||j===void 0||j.forEach(ae=>this.addKeyword(ae))}function B(R,V,X){const j=R.rules.findIndex(I=>I.keyword===X);j>=0?R.rules.splice(j,0,V):(R.rules.push(V),this.logger.warn(`rule ${X} is not defined`))}function G(R){let{metaSchema:V}=R;V!==void 0&&(R.$data&&this.opts.$data&&(V=Q(V)),R.validateSchema=this.compile(V,!0))}const K={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Q(R){return{anyOf:[R,K]}}}(zx)),zx}var qd={},Fd={},Bd={},rI;function jge(){if(rI)return Bd;rI=1,Object.defineProperty(Bd,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Bd.default=e,Bd}var Ea={},iI;function Mge(){if(iI)return Ea;iI=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.callRef=Ea.getValidate=void 0;const e=ym(),t=Lr(),n=Xe(),r=La(),i=qE(),a=ht(),o={keyword:"$ref",schemaType:"string",code(f){const{gen:d,schema:h,it:m}=f,{baseId:g,schemaEnv:v,validateName:w,opts:b,self:_}=m,{root:S}=v;if((h==="#"||h==="#/")&&g===S.baseId)return A();const x=i.resolveRef.call(_,S,g,h);if(x===void 0)throw new e.default(m.opts.uriResolver,g,h);if(x instanceof i.SchemaEnv)return k(x);return T(x);function A(){if(v===S)return c(f,w,v,v.$async);const O=d.scopeValue("root",{ref:S});return c(f,(0,n._)`${O}.validate`,S,S.$async)}function k(O){const $=l(f,O);c(f,$,O,O.$async)}function T(O){const $=d.scopeValue("schema",b.code.source===!0?{ref:O,code:(0,n.stringify)(O)}:{ref:O}),L=d.name("valid"),M=f.subschema({schema:O,dataTypes:[],schemaPath:n.nil,topSchemaRef:$,errSchemaPath:h},L);f.mergeEvaluated(M),f.ok(L)}}};function l(f,d){const{gen:h}=f;return d.validate?h.scopeValue("validate",{ref:d.validate}):(0,n._)`${h.scopeValue("wrapper",{ref:d})}.validate`}Ea.getValidate=l;function c(f,d,h,m){const{gen:g,it:v}=f,{allErrors:w,schemaEnv:b,opts:_}=v,S=_.passContext?r.default.this:n.nil;m?x():A();function x(){if(!b.$async)throw new Error("async schema referenced by sync schema");const O=g.let("valid");g.try(()=>{g.code((0,n._)`await ${(0,t.callValidateCode)(f,d,S)}`),T(d),w||g.assign(O,!0)},$=>{g.if((0,n._)`!(${$} instanceof ${v.ValidationError})`,()=>g.throw($)),k($),w||g.assign(O,!1)}),f.ok(O)}function A(){f.result((0,t.callValidateCode)(f,d,S),()=>T(d),()=>k(d))}function k(O){const $=(0,n._)`${O}.errors`;g.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${$} : ${r.default.vErrors}.concat(${$})`),g.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function T(O){var $;if(!v.opts.unevaluated)return;const L=($=h==null?void 0:h.validate)===null||$===void 0?void 0:$.evaluated;if(v.props!==!0)if(L&&!L.dynamicProps)L.props!==void 0&&(v.props=a.mergeEvaluated.props(g,L.props,v.props));else{const M=g.var("props",(0,n._)`${O}.evaluated.props`);v.props=a.mergeEvaluated.props(g,M,v.props,n.Name)}if(v.items!==!0)if(L&&!L.dynamicItems)L.items!==void 0&&(v.items=a.mergeEvaluated.items(g,L.items,v.items));else{const M=g.var("items",(0,n._)`${O}.evaluated.items`);v.items=a.mergeEvaluated.items(g,M,v.items,n.Name)}}}return Ea.callRef=c,Ea.default=o,Ea}var aI;function $ge(){if(aI)return Fd;aI=1,Object.defineProperty(Fd,"__esModule",{value:!0});const e=jge(),t=Mge(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Fd.default=n,Fd}var Ud={},Vd={},sI;function Dge(){if(sI)return Vd;sI=1,Object.defineProperty(Vd,"__esModule",{value:!0});const e=Xe(),t=e.operators,n={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},r={message:({keyword:a,schemaCode:o})=>(0,e.str)`must be ${n[a].okStr} ${o}`,params:({keyword:a,schemaCode:o})=>(0,e._)`{comparison: ${n[a].okStr}, limit: ${o}}`},i={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:r,code(a){const{keyword:o,data:l,schemaCode:c}=a;a.fail$data((0,e._)`${l} ${n[o].fail} ${c} || isNaN(${l})`)}};return Vd.default=i,Vd}var Hd={},oI;function Ige(){if(oI)return Hd;oI=1,Object.defineProperty(Hd,"__esModule",{value:!0});const e=Xe(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,e._)`{multipleOf: ${r}}`},code(r){const{gen:i,data:a,schemaCode:o,it:l}=r,c=l.opts.multipleOfPrecision,f=i.let("res"),d=c?(0,e._)`Math.abs(Math.round(${f}) - ${f}) > 1e-${c}`:(0,e._)`${f} !== parseInt(${f})`;r.fail$data((0,e._)`(${o} === 0 || (${f} = ${a}/${o}, ${d}))`)}};return Hd.default=n,Hd}var Gd={},Yd={},lI;function Pge(){if(lI)return Yd;lI=1,Object.defineProperty(Yd,"__esModule",{value:!0});function e(t){const n=t.length;let r=0,i=0,a;for(;i<n;)r++,a=t.charCodeAt(i++),a>=55296&&a<=56319&&i<n&&(a=t.charCodeAt(i),(a&64512)===56320&&i++);return r}return Yd.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Yd}var uI;function Lge(){if(uI)return Gd;uI=1,Object.defineProperty(Gd,"__esModule",{value:!0});const e=Xe(),t=ht(),n=Pge(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:a,schemaCode:o}){const l=a==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${l} than ${o} characters`},params:({schemaCode:a})=>(0,e._)`{limit: ${a}}`},code(a){const{keyword:o,data:l,schemaCode:c,it:f}=a,d=o==="maxLength"?e.operators.GT:e.operators.LT,h=f.opts.unicode===!1?(0,e._)`${l}.length`:(0,e._)`${(0,t.useFunc)(a.gen,n.default)}(${l})`;a.fail$data((0,e._)`${h} ${d} ${c}`)}};return Gd.default=i,Gd}var Zd={},cI;function zge(){if(cI)return Zd;cI=1,Object.defineProperty(Zd,"__esModule",{value:!0});const e=Lr(),t=Xe(),r={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,t.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,t._)`{pattern: ${i}}`},code(i){const{data:a,$data:o,schema:l,schemaCode:c,it:f}=i,d=f.opts.unicodeRegExp?"u":"",h=o?(0,t._)`(new RegExp(${c}, ${d}))`:(0,e.usePattern)(i,l);i.fail$data((0,t._)`!${h}.test(${a})`)}};return Zd.default=r,Zd}var Kd={},fI;function qge(){if(fI)return Kd;fI=1,Object.defineProperty(Kd,"__esModule",{value:!0});const e=Xe(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:i}){const a=r==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${i} properties`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:i,data:a,schemaCode:o}=r,l=i==="maxProperties"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`Object.keys(${a}).length ${l} ${o}`)}};return Kd.default=n,Kd}var Xd={},dI;function Fge(){if(dI)return Xd;dI=1,Object.defineProperty(Xd,"__esModule",{value:!0});const e=Lr(),t=Xe(),n=ht(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:a}})=>(0,t.str)`must have required property '${a}'`,params:({params:{missingProperty:a}})=>(0,t._)`{missingProperty: ${a}}`},code(a){const{gen:o,schema:l,schemaCode:c,data:f,$data:d,it:h}=a,{opts:m}=h;if(!d&&l.length===0)return;const g=l.length>=m.loopRequired;if(h.allErrors?v():w(),m.strictRequired){const S=a.parentSchema.properties,{definedProperties:x}=a.it;for(const A of l)if((S==null?void 0:S[A])===void 0&&!x.has(A)){const k=h.schemaEnv.baseId+h.errSchemaPath,T=`required property "${A}" is not defined at "${k}" (strictRequired)`;(0,n.checkStrictMode)(h,T,h.opts.strictRequired)}}function v(){if(g||d)a.block$data(t.nil,b);else for(const S of l)(0,e.checkReportMissingProp)(a,S)}function w(){const S=o.let("missing");if(g||d){const x=o.let("valid",!0);a.block$data(x,()=>_(S,x)),a.ok(x)}else o.if((0,e.checkMissingProp)(a,l,S)),(0,e.reportMissingProp)(a,S),o.else()}function b(){o.forOf("prop",c,S=>{a.setParams({missingProperty:S}),o.if((0,e.noPropertyInData)(o,f,S,m.ownProperties),()=>a.error())})}function _(S,x){a.setParams({missingProperty:S}),o.forOf(S,c,()=>{o.assign(x,(0,e.propertyInData)(o,f,S,m.ownProperties)),o.if((0,t.not)(x),()=>{a.error(),o.break()})},t.nil)}}};return Xd.default=i,Xd}var Wd={},hI;function Bge(){if(hI)return Wd;hI=1,Object.defineProperty(Wd,"__esModule",{value:!0});const e=Xe(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:i}){const a=r==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${i} items`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:i,data:a,schemaCode:o}=r,l=i==="maxItems"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`${a}.length ${l} ${o}`)}};return Wd.default=n,Wd}var Qd={},Jd={},pI;function FE(){if(pI)return Jd;pI=1,Object.defineProperty(Jd,"__esModule",{value:!0});const e=KL();return e.code='require("ajv/dist/runtime/equal").default',Jd.default=e,Jd}var mI;function Uge(){if(mI)return Qd;mI=1,Object.defineProperty(Qd,"__esModule",{value:!0});const e=yp(),t=Xe(),n=ht(),r=FE(),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:o,j:l}})=>(0,t.str)`must NOT have duplicate items (items ## ${l} and ${o} are identical)`,params:({params:{i:o,j:l}})=>(0,t._)`{i: ${o}, j: ${l}}`},code(o){const{gen:l,data:c,$data:f,schema:d,parentSchema:h,schemaCode:m,it:g}=o;if(!f&&!d)return;const v=l.let("valid"),w=h.items?(0,e.getSchemaTypes)(h.items):[];o.block$data(v,b,(0,t._)`${m} === false`),o.ok(v);function b(){const A=l.let("i",(0,t._)`${c}.length`),k=l.let("j");o.setParams({i:A,j:k}),l.assign(v,!0),l.if((0,t._)`${A} > 1`,()=>(_()?S:x)(A,k))}function _(){return w.length>0&&!w.some(A=>A==="object"||A==="array")}function S(A,k){const T=l.name("item"),O=(0,e.checkDataTypes)(w,T,g.opts.strictNumbers,e.DataType.Wrong),$=l.const("indices",(0,t._)`{}`);l.for((0,t._)`;${A}--;`,()=>{l.let(T,(0,t._)`${c}[${A}]`),l.if(O,(0,t._)`continue`),w.length>1&&l.if((0,t._)`typeof ${T} == "string"`,(0,t._)`${T} += "_"`),l.if((0,t._)`typeof ${$}[${T}] == "number"`,()=>{l.assign(k,(0,t._)`${$}[${T}]`),o.error(),l.assign(v,!1).break()}).code((0,t._)`${$}[${T}] = ${A}`)})}function x(A,k){const T=(0,n.useFunc)(l,r.default),O=l.name("outer");l.label(O).for((0,t._)`;${A}--;`,()=>l.for((0,t._)`${k} = ${A}; ${k}--;`,()=>l.if((0,t._)`${T}(${c}[${A}], ${c}[${k}])`,()=>{o.error(),l.assign(v,!1).break(O)})))}}};return Qd.default=a,Qd}var eh={},gI;function Vge(){if(gI)return eh;gI=1,Object.defineProperty(eh,"__esModule",{value:!0});const e=Xe(),t=ht(),n=FE(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:a})=>(0,e._)`{allowedValue: ${a}}`},code(a){const{gen:o,data:l,$data:c,schemaCode:f,schema:d}=a;c||d&&typeof d=="object"?a.fail$data((0,e._)`!${(0,t.useFunc)(o,n.default)}(${l}, ${f})`):a.fail((0,e._)`${d} !== ${l}`)}};return eh.default=i,eh}var th={},yI;function Hge(){if(yI)return th;yI=1,Object.defineProperty(th,"__esModule",{value:!0});const e=Xe(),t=ht(),n=FE(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:a})=>(0,e._)`{allowedValues: ${a}}`},code(a){const{gen:o,data:l,$data:c,schema:f,schemaCode:d,it:h}=a;if(!c&&f.length===0)throw new Error("enum must have non-empty array");const m=f.length>=h.opts.loopEnum;let g;const v=()=>g??(g=(0,t.useFunc)(o,n.default));let w;if(m||c)w=o.let("valid"),a.block$data(w,b);else{if(!Array.isArray(f))throw new Error("ajv implementation error");const S=o.const("vSchema",d);w=(0,e.or)(...f.map((x,A)=>_(S,A)))}a.pass(w);function b(){o.assign(w,!1),o.forOf("v",d,S=>o.if((0,e._)`${v()}(${l}, ${S})`,()=>o.assign(w,!0).break()))}function _(S,x){const A=f[x];return typeof A=="object"&&A!==null?(0,e._)`${v()}(${l}, ${S}[${x}])`:(0,e._)`${l} === ${A}`}}};return th.default=i,th}var bI;function Gge(){if(bI)return Ud;bI=1,Object.defineProperty(Ud,"__esModule",{value:!0});const e=Dge(),t=Ige(),n=Lge(),r=zge(),i=qge(),a=Fge(),o=Bge(),l=Uge(),c=Vge(),f=Hge(),d=[e.default,t.default,n.default,r.default,i.default,a.default,o.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,f.default];return Ud.default=d,Ud}var nh={},Oo={},vI;function WL(){if(vI)return Oo;vI=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.validateAdditionalItems=void 0;const e=Xe(),t=ht(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,e.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,e._)`{limit: ${a}}`},code(a){const{parentSchema:o,it:l}=a,{items:c}=o;if(!Array.isArray(c)){(0,t.checkStrictMode)(l,'"additionalItems" is ignored when "items" is not an array of schemas');return}i(a,c)}};function i(a,o){const{gen:l,schema:c,data:f,keyword:d,it:h}=a;h.items=!0;const m=l.const("len",(0,e._)`${f}.length`);if(c===!1)a.setParams({len:o.length}),a.pass((0,e._)`${m} <= ${o.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(h,c)){const v=l.var("valid",(0,e._)`${m} <= ${o.length}`);l.if((0,e.not)(v),()=>g(v)),a.ok(v)}function g(v){l.forRange("i",o.length,m,w=>{a.subschema({keyword:d,dataProp:w,dataPropType:t.Type.Num},v),h.allErrors||l.if((0,e.not)(v),()=>l.break())})}}return Oo.validateAdditionalItems=i,Oo.default=r,Oo}var rh={},No={},_I;function QL(){if(_I)return No;_I=1,Object.defineProperty(No,"__esModule",{value:!0}),No.validateTuple=void 0;const e=Xe(),t=ht(),n=Lr(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(a){const{schema:o,it:l}=a;if(Array.isArray(o))return i(a,"additionalItems",o);l.items=!0,!(0,t.alwaysValidSchema)(l,o)&&a.ok((0,n.validateArray)(a))}};function i(a,o,l=a.schema){const{gen:c,parentSchema:f,data:d,keyword:h,it:m}=a;w(f),m.opts.unevaluated&&l.length&&m.items!==!0&&(m.items=t.mergeEvaluated.items(c,l.length,m.items));const g=c.name("valid"),v=c.const("len",(0,e._)`${d}.length`);l.forEach((b,_)=>{(0,t.alwaysValidSchema)(m,b)||(c.if((0,e._)`${v} > ${_}`,()=>a.subschema({keyword:h,schemaProp:_,dataProp:_},g)),a.ok(g))});function w(b){const{opts:_,errSchemaPath:S}=m,x=l.length,A=x===b.minItems&&(x===b.maxItems||b[o]===!1);if(_.strictTuples&&!A){const k=`"${h}" is ${x}-tuple, but minItems or maxItems/${o} are not specified or different at path "${S}"`;(0,t.checkStrictMode)(m,k,_.strictTuples)}}}return No.validateTuple=i,No.default=r,No}var xI;function Yge(){if(xI)return rh;xI=1,Object.defineProperty(rh,"__esModule",{value:!0});const e=QL(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,e.validateTuple)(n,"items")};return rh.default=t,rh}var ih={},wI;function Zge(){if(wI)return ih;wI=1,Object.defineProperty(ih,"__esModule",{value:!0});const e=Xe(),t=ht(),n=Lr(),r=WL(),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{schema:l,parentSchema:c,it:f}=o,{prefixItems:d}=c;f.items=!0,!(0,t.alwaysValidSchema)(f,l)&&(d?(0,r.validateAdditionalItems)(o,d):o.ok((0,n.validateArray)(o)))}};return ih.default=a,ih}var ah={},SI;function Kge(){if(SI)return ah;SI=1,Object.defineProperty(ah,"__esModule",{value:!0});const e=Xe(),t=ht(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:a}})=>a===void 0?(0,e.str)`must contain at least ${i} valid item(s)`:(0,e.str)`must contain at least ${i} and no more than ${a} valid item(s)`,params:({params:{min:i,max:a}})=>a===void 0?(0,e._)`{minContains: ${i}}`:(0,e._)`{minContains: ${i}, maxContains: ${a}}`},code(i){const{gen:a,schema:o,parentSchema:l,data:c,it:f}=i;let d,h;const{minContains:m,maxContains:g}=l;f.opts.next?(d=m===void 0?1:m,h=g):d=1;const v=a.const("len",(0,e._)`${c}.length`);if(i.setParams({min:d,max:h}),h===void 0&&d===0){(0,t.checkStrictMode)(f,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(h!==void 0&&d>h){(0,t.checkStrictMode)(f,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,t.alwaysValidSchema)(f,o)){let x=(0,e._)`${v} >= ${d}`;h!==void 0&&(x=(0,e._)`${x} && ${v} <= ${h}`),i.pass(x);return}f.items=!0;const w=a.name("valid");h===void 0&&d===1?_(w,()=>a.if(w,()=>a.break())):d===0?(a.let(w,!0),h!==void 0&&a.if((0,e._)`${c}.length > 0`,b)):(a.let(w,!1),b()),i.result(w,()=>i.reset());function b(){const x=a.name("_valid"),A=a.let("count",0);_(x,()=>a.if(x,()=>S(A)))}function _(x,A){a.forRange("i",0,v,k=>{i.subschema({keyword:"contains",dataProp:k,dataPropType:t.Type.Num,compositeRule:!0},x),A()})}function S(x){a.code((0,e._)`${x}++`),h===void 0?a.if((0,e._)`${x} >= ${d}`,()=>a.assign(w,!0).break()):(a.if((0,e._)`${x} > ${h}`,()=>a.assign(w,!1).break()),d===1?a.assign(w,!0):a.if((0,e._)`${x} >= ${d}`,()=>a.assign(w,!0)))}}};return ah.default=r,ah}var Zx={},EI;function Xge(){return EI||(EI=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Xe(),n=ht(),r=Lr();e.error={message:({params:{property:c,depsCount:f,deps:d}})=>{const h=f===1?"property":"properties";return(0,t.str)`must have ${h} ${d} when property ${c} is present`},params:({params:{property:c,depsCount:f,deps:d,missingProperty:h}})=>(0,t._)`{property: ${c},
|
|
265
|
+
|| ${$} === "boolean" || ${T} === null`).assign(L,(0,r._)`[${T}]`)}}}function m({gen:S,parentData:x,parentDataProperty:A},k){S.if((0,r._)`${x} !== undefined`,()=>S.assign((0,r._)`${x}[${A}]`,k))}function g(S,x,A,k=a.Correct){const T=k===a.Correct?r.operators.EQ:r.operators.NEQ;let O;switch(S){case"null":return(0,r._)`${x} ${T} null`;case"array":O=(0,r._)`Array.isArray(${x})`;break;case"object":O=(0,r._)`${x} && typeof ${x} == "object" && !Array.isArray(${x})`;break;case"integer":O=$((0,r._)`!(${x} % 1) && !isNaN(${x})`);break;case"number":O=$();break;default:return(0,r._)`typeof ${x} ${T} ${S}`}return k===a.Correct?O:(0,r.not)(O);function $(L=r.nil){return(0,r.and)((0,r._)`typeof ${x} == "number"`,L,A?(0,r._)`isFinite(${x})`:r.nil)}}pn.checkDataType=g;function v(S,x,A,k){if(S.length===1)return g(S[0],x,A,k);let T;const O=(0,i.toHash)(S);if(O.array&&O.object){const $=(0,r._)`typeof ${x} != "object"`;T=O.null?$:(0,r._)`!${x} || ${$}`,delete O.null,delete O.array,delete O.object}else T=r.nil;O.number&&delete O.integer;for(const $ in O)T=(0,r.and)(T,g($,x,A,k));return T}pn.checkDataTypes=v;const w={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:x})=>typeof S=="string"?(0,r._)`{type: ${S}}`:(0,r._)`{type: ${x}}`};function b(S){const x=_(S);(0,n.reportError)(x,w)}pn.reportTypeError=b;function _(S){const{gen:x,data:A,schema:k}=S,T=(0,i.schemaRefOrVal)(S,k,"type");return{gen:x,keyword:"type",data:A,schema:k.type,schemaCode:T,schemaValue:T,parentSchema:k,params:{},it:S}}return pn}var Mu={},FD;function bge(){if(FD)return Mu;FD=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.assignDefaults=void 0;const e=Xe(),t=ht();function n(i,a){const{properties:o,items:l}=i.schema;if(a==="object"&&o)for(const c in o)r(i,c,o[c].default);else a==="array"&&Array.isArray(l)&&l.forEach((c,f)=>r(i,f,c.default))}Mu.assignDefaults=n;function r(i,a,o){const{gen:l,compositeRule:c,data:f,opts:d}=i;if(o===void 0)return;const h=(0,e._)`${f}${(0,e.getProperty)(a)}`;if(c){(0,t.checkStrictMode)(i,`default is ignored for: ${h}`);return}let m=(0,e._)`${h} === undefined`;d.useDefaults==="empty"&&(m=(0,e._)`${m} || ${h} === null || ${h} === ""`),l.if(m,(0,e._)`${h} = ${(0,e.stringify)(o)}`)}return Mu}var Or={},_t={},BD;function Lr(){if(BD)return _t;BD=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.validateUnion=_t.validateArray=_t.usePattern=_t.callValidateCode=_t.schemaProperties=_t.allSchemaProperties=_t.noPropertyInData=_t.propertyInData=_t.isOwnProperty=_t.hasPropFunc=_t.reportMissingProp=_t.checkMissingProp=_t.checkReportMissingProp=void 0;const e=Xe(),t=ht(),n=La(),r=ht();function i(S,x){const{gen:A,data:k,it:T}=S;A.if(d(A,k,x,T.opts.ownProperties),()=>{S.setParams({missingProperty:(0,e._)`${x}`},!0),S.error()})}_t.checkReportMissingProp=i;function a({gen:S,data:x,it:{opts:A}},k,T){return(0,e.or)(...k.map(O=>(0,e.and)(d(S,x,O,A.ownProperties),(0,e._)`${T} = ${O}`)))}_t.checkMissingProp=a;function o(S,x){S.setParams({missingProperty:x},!0),S.error()}_t.reportMissingProp=o;function l(S){return S.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}_t.hasPropFunc=l;function c(S,x,A){return(0,e._)`${l(S)}.call(${x}, ${A})`}_t.isOwnProperty=c;function f(S,x,A,k){const T=(0,e._)`${x}${(0,e.getProperty)(A)} !== undefined`;return k?(0,e._)`${T} && ${c(S,x,A)}`:T}_t.propertyInData=f;function d(S,x,A,k){const T=(0,e._)`${x}${(0,e.getProperty)(A)} === undefined`;return k?(0,e.or)(T,(0,e.not)(c(S,x,A))):T}_t.noPropertyInData=d;function h(S){return S?Object.keys(S).filter(x=>x!=="__proto__"):[]}_t.allSchemaProperties=h;function m(S,x){return h(x).filter(A=>!(0,t.alwaysValidSchema)(S,x[A]))}_t.schemaProperties=m;function g({schemaCode:S,data:x,it:{gen:A,topSchemaRef:k,schemaPath:T,errorPath:O},it:$},L,M,z){const P=z?(0,e._)`${S}, ${x}, ${k}${T}`:x,q=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,O)],[n.default.parentData,$.parentData],[n.default.parentDataProperty,$.parentDataProperty],[n.default.rootData,n.default.rootData]];$.opts.dynamicRef&&q.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const D=(0,e._)`${P}, ${A.object(...q)}`;return M!==e.nil?(0,e._)`${L}.call(${M}, ${D})`:(0,e._)`${L}(${D})`}_t.callValidateCode=g;const v=(0,e._)`new RegExp`;function w({gen:S,it:{opts:x}},A){const k=x.unicodeRegExp?"u":"",{regExp:T}=x.code,O=T(A,k);return S.scopeValue("pattern",{key:O.toString(),ref:O,code:(0,e._)`${T.code==="new RegExp"?v:(0,r.useFunc)(S,T)}(${A}, ${k})`})}_t.usePattern=w;function b(S){const{gen:x,data:A,keyword:k,it:T}=S,O=x.name("valid");if(T.allErrors){const L=x.let("valid",!0);return $(()=>x.assign(L,!1)),L}return x.var(O,!0),$(()=>x.break()),O;function $(L){const M=x.const("len",(0,e._)`${A}.length`);x.forRange("i",0,M,z=>{S.subschema({keyword:k,dataProp:z,dataPropType:t.Type.Num},O),x.if((0,e.not)(O),L)})}}_t.validateArray=b;function _(S){const{gen:x,schema:A,keyword:k,it:T}=S;if(!Array.isArray(A))throw new Error("ajv implementation error");if(A.some(M=>(0,t.alwaysValidSchema)(T,M))&&!T.opts.unevaluated)return;const $=x.let("valid",!1),L=x.name("_valid");x.block(()=>A.forEach((M,z)=>{const P=S.subschema({keyword:k,schemaProp:z,compositeRule:!0},L);x.assign($,(0,e._)`${$} || ${L}`),S.mergeValidEvaluated(P,L)||x.if((0,e.not)($))})),S.result($,()=>S.reset(),()=>S.error(!0))}return _t.validateUnion=_,_t}var UD;function vge(){if(UD)return Or;UD=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.validateKeywordUsage=Or.validSchemaType=Or.funcKeywordCode=Or.macroKeywordCode=void 0;const e=Xe(),t=La(),n=Lr(),r=pm();function i(m,g){const{gen:v,keyword:w,schema:b,parentSchema:_,it:S}=m,x=g.macro.call(S.self,b,_,S),A=f(v,w,x);S.opts.validateSchema!==!1&&S.self.validateSchema(x,!0);const k=v.name("valid");m.subschema({schema:x,schemaPath:e.nil,errSchemaPath:`${S.errSchemaPath}/${w}`,topSchemaRef:A,compositeRule:!0},k),m.pass(k,()=>m.error(!0))}Or.macroKeywordCode=i;function a(m,g){var v;const{gen:w,keyword:b,schema:_,parentSchema:S,$data:x,it:A}=m;c(A,g);const k=!x&&g.compile?g.compile.call(A.self,_,S,A):g.validate,T=f(w,b,k),O=w.let("valid");m.block$data(O,$),m.ok((v=g.valid)!==null&&v!==void 0?v:O);function $(){if(g.errors===!1)z(),g.modifying&&o(m),P(()=>m.error());else{const q=g.async?L():M();g.modifying&&o(m),P(()=>l(m,q))}}function L(){const q=w.let("ruleErrs",null);return w.try(()=>z((0,e._)`await `),D=>w.assign(O,!1).if((0,e._)`${D} instanceof ${A.ValidationError}`,()=>w.assign(q,(0,e._)`${D}.errors`),()=>w.throw(D))),q}function M(){const q=(0,e._)`${T}.errors`;return w.assign(q,null),z(e.nil),q}function z(q=g.async?(0,e._)`await `:e.nil){const D=A.opts.passContext?t.default.this:t.default.self,H=!("compile"in g&&!x||g.schema===!1);w.assign(O,(0,e._)`${q}${(0,n.callValidateCode)(m,T,D,H)}`,g.modifying)}function P(q){var D;w.if((0,e.not)((D=g.valid)!==null&&D!==void 0?D:O),q)}}Or.funcKeywordCode=a;function o(m){const{gen:g,data:v,it:w}=m;g.if(w.parentData,()=>g.assign(v,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function l(m,g){const{gen:v}=m;v.if((0,e._)`Array.isArray(${g})`,()=>{v.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${g} : ${t.default.vErrors}.concat(${g})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(m)},()=>m.error())}function c({schemaEnv:m},g){if(g.async&&!m.$async)throw new Error("async keyword in sync schema")}function f(m,g,v){if(v===void 0)throw new Error(`keyword "${g}" failed to compile`);return m.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,e.stringify)(v)})}function d(m,g,v=!1){return!g.length||g.some(w=>w==="array"?Array.isArray(m):w==="object"?m&&typeof m=="object"&&!Array.isArray(m):typeof m==w||v&&typeof m>"u")}Or.validSchemaType=d;function h({schema:m,opts:g,self:v,errSchemaPath:w},b,_){if(Array.isArray(b.keyword)?!b.keyword.includes(_):b.keyword!==_)throw new Error("ajv implementation error");const S=b.dependencies;if(S!=null&&S.some(x=>!Object.prototype.hasOwnProperty.call(m,x)))throw new Error(`parent schema must have dependencies of ${_}: ${S.join(",")}`);if(b.validateSchema&&!b.validateSchema(m[_])){const A=`keyword "${_}" value is invalid at path "${w}": `+v.errorsText(b.validateSchema.errors);if(g.validateSchema==="log")v.logger.error(A);else throw new Error(A)}}return Or.validateKeywordUsage=h,Or}var Ti={},VD;function _ge(){if(VD)return Ti;VD=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.extendSubschemaMode=Ti.extendSubschemaData=Ti.getSubschema=void 0;const e=Xe(),t=ht();function n(a,{keyword:o,schemaProp:l,schema:c,schemaPath:f,errSchemaPath:d,topSchemaRef:h}){if(o!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const m=a.schema[o];return l===void 0?{schema:m,schemaPath:(0,e._)`${a.schemaPath}${(0,e.getProperty)(o)}`,errSchemaPath:`${a.errSchemaPath}/${o}`}:{schema:m[l],schemaPath:(0,e._)`${a.schemaPath}${(0,e.getProperty)(o)}${(0,e.getProperty)(l)}`,errSchemaPath:`${a.errSchemaPath}/${o}/${(0,t.escapeFragment)(l)}`}}if(c!==void 0){if(f===void 0||d===void 0||h===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:f,topSchemaRef:h,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}Ti.getSubschema=n;function r(a,o,{dataProp:l,dataPropType:c,data:f,dataTypes:d,propertyName:h}){if(f!==void 0&&l!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:m}=o;if(l!==void 0){const{errorPath:v,dataPathArr:w,opts:b}=o,_=m.let("data",(0,e._)`${o.data}${(0,e.getProperty)(l)}`,!0);g(_),a.errorPath=(0,e.str)`${v}${(0,t.getErrorPath)(l,c,b.jsPropertySyntax)}`,a.parentDataProperty=(0,e._)`${l}`,a.dataPathArr=[...w,a.parentDataProperty]}if(f!==void 0){const v=f instanceof e.Name?f:m.let("data",f,!0);g(v),h!==void 0&&(a.propertyName=h)}d&&(a.dataTypes=d);function g(v){a.data=v,a.dataLevel=o.dataLevel+1,a.dataTypes=[],o.definedProperties=new Set,a.parentData=o.data,a.dataNames=[...o.dataNames,v]}}Ti.extendSubschemaData=r;function i(a,{jtdDiscriminator:o,jtdMetadata:l,compositeRule:c,createErrors:f,allErrors:d}){c!==void 0&&(a.compositeRule=c),f!==void 0&&(a.createErrors=f),d!==void 0&&(a.allErrors=d),a.jtdDiscriminator=o,a.jtdMetadata=l}return Ti.extendSubschemaMode=i,Ti}var kn={},Vx,HD;function KL(){return HD||(HD=1,Vx=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}),Vx}var Hx={exports:{}},GD;function xge(){if(GD)return Hx.exports;GD=1;var e=Hx.exports=function(r,i,a){typeof i=="function"&&(a=i,i={}),a=i.cb||a;var o=typeof a=="function"?a:a.pre||function(){},l=a.post||function(){};t(i,o,l,r,"",r)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(r,i,a,o,l,c,f,d,h,m){if(o&&typeof o=="object"&&!Array.isArray(o)){i(o,l,c,f,d,h,m);for(var g in o){var v=o[g];if(Array.isArray(v)){if(g in e.arrayKeywords)for(var w=0;w<v.length;w++)t(r,i,a,v[w],l+"/"+g+"/"+w,c,l,g,o,w)}else if(g in e.propsKeywords){if(v&&typeof v=="object")for(var b in v)t(r,i,a,v[b],l+"/"+g+"/"+n(b),c,l,g,o,b)}else(g in e.keywords||r.allKeys&&!(g in e.skipKeywords))&&t(r,i,a,v,l+"/"+g,c,l,g,o)}a(o,l,c,f,d,h,m)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return Hx.exports}var YD;function mm(){if(YD)return kn;YD=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.getSchemaRefs=kn.resolveUrl=kn.normalizeId=kn._getFullPath=kn.getFullPath=kn.inlineRef=void 0;const e=ht(),t=KL(),n=xge(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(w,b=!0){return typeof w=="boolean"?!0:b===!0?!o(w):b?l(w)<=b:!1}kn.inlineRef=i;const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(w){for(const b in w){if(a.has(b))return!0;const _=w[b];if(Array.isArray(_)&&_.some(o)||typeof _=="object"&&o(_))return!0}return!1}function l(w){let b=0;for(const _ in w){if(_==="$ref")return 1/0;if(b++,!r.has(_)&&(typeof w[_]=="object"&&(0,e.eachItem)(w[_],S=>b+=l(S)),b===1/0))return 1/0}return b}function c(w,b="",_){_!==!1&&(b=h(b));const S=w.parse(b);return f(w,S)}kn.getFullPath=c;function f(w,b){return w.serialize(b).split("#")[0]+"#"}kn._getFullPath=f;const d=/#\/?$/;function h(w){return w?w.replace(d,""):""}kn.normalizeId=h;function m(w,b,_){return _=h(_),w.resolve(b,_)}kn.resolveUrl=m;const g=/^[a-z_][-a-z0-9._]*$/i;function v(w,b){if(typeof w=="boolean")return{};const{schemaId:_,uriResolver:S}=this.opts,x=h(w[_]||b),A={"":x},k=c(S,x,!1),T={},O=new Set;return n(w,{allKeys:!0},(M,z,P,q)=>{if(q===void 0)return;const D=k+z;let H=A[q];typeof M[_]=="string"&&(H=B.call(this,M[_])),G.call(this,M.$anchor),G.call(this,M.$dynamicAnchor),A[z]=H;function B(K){const Q=this.opts.uriResolver.resolve;if(K=h(H?Q(H,K):K),O.has(K))throw L(K);O.add(K);let R=this.refs[K];return typeof R=="string"&&(R=this.refs[R]),typeof R=="object"?$(M,R.schema,K):K!==h(D)&&(K[0]==="#"?($(M,T[K],K),T[K]=M):this.refs[K]=D),K}function G(K){if(typeof K=="string"){if(!g.test(K))throw new Error(`invalid anchor "${K}"`);B.call(this,`#${K}`)}}}),T;function $(M,z,P){if(z!==void 0&&!t(M,z))throw L(P)}function L(M){return new Error(`reference "${M}" resolves to more than one schema`)}}return kn.getSchemaRefs=v,kn}var ZD;function gm(){if(ZD)return ki;ZD=1,Object.defineProperty(ki,"__esModule",{value:!0}),ki.getData=ki.KeywordCxt=ki.validateFunctionCode=void 0;const e=yge(),t=yp(),n=ZL(),r=yp(),i=bge(),a=vge(),o=_ge(),l=Xe(),c=La(),f=mm(),d=ht(),h=pm();function m(W){if(k(W)&&(O(W),A(W))){b(W);return}g(W,()=>(0,e.topBoolOrEmptySchema)(W))}ki.validateFunctionCode=m;function g({gen:W,validateName:J,schema:se,schemaEnv:fe,opts:me},xe){me.code.es5?W.func(J,(0,l._)`${c.default.data}, ${c.default.valCxt}`,fe.$async,()=>{W.code((0,l._)`"use strict"; ${S(se,me)}`),w(W,me),W.code(xe)}):W.func(J,(0,l._)`${c.default.data}, ${v(me)}`,fe.$async,()=>W.code(S(se,me)).code(xe))}function v(W){return(0,l._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${W.dynamicRef?(0,l._)`, ${c.default.dynamicAnchors}={}`:l.nil}}={}`}function w(W,J){W.if(c.default.valCxt,()=>{W.var(c.default.instancePath,(0,l._)`${c.default.valCxt}.${c.default.instancePath}`),W.var(c.default.parentData,(0,l._)`${c.default.valCxt}.${c.default.parentData}`),W.var(c.default.parentDataProperty,(0,l._)`${c.default.valCxt}.${c.default.parentDataProperty}`),W.var(c.default.rootData,(0,l._)`${c.default.valCxt}.${c.default.rootData}`),J.dynamicRef&&W.var(c.default.dynamicAnchors,(0,l._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{W.var(c.default.instancePath,(0,l._)`""`),W.var(c.default.parentData,(0,l._)`undefined`),W.var(c.default.parentDataProperty,(0,l._)`undefined`),W.var(c.default.rootData,c.default.data),J.dynamicRef&&W.var(c.default.dynamicAnchors,(0,l._)`{}`)})}function b(W){const{schema:J,opts:se,gen:fe}=W;g(W,()=>{se.$comment&&J.$comment&&q(W),M(W),fe.let(c.default.vErrors,null),fe.let(c.default.errors,0),se.unevaluated&&_(W),$(W),D(W)})}function _(W){const{gen:J,validateName:se}=W;W.evaluated=J.const("evaluated",(0,l._)`${se}.evaluated`),J.if((0,l._)`${W.evaluated}.dynamicProps`,()=>J.assign((0,l._)`${W.evaluated}.props`,(0,l._)`undefined`)),J.if((0,l._)`${W.evaluated}.dynamicItems`,()=>J.assign((0,l._)`${W.evaluated}.items`,(0,l._)`undefined`))}function S(W,J){const se=typeof W=="object"&&W[J.schemaId];return se&&(J.code.source||J.code.process)?(0,l._)`/*# sourceURL=${se} */`:l.nil}function x(W,J){if(k(W)&&(O(W),A(W))){T(W,J);return}(0,e.boolOrEmptySchema)(W,J)}function A({schema:W,self:J}){if(typeof W=="boolean")return!W;for(const se in W)if(J.RULES.all[se])return!0;return!1}function k(W){return typeof W.schema!="boolean"}function T(W,J){const{schema:se,gen:fe,opts:me}=W;me.$comment&&se.$comment&&q(W),z(W),P(W);const xe=fe.const("_errs",c.default.errors);$(W,xe),fe.var(J,(0,l._)`${xe} === ${c.default.errors}`)}function O(W){(0,d.checkUnknownRules)(W),L(W)}function $(W,J){if(W.opts.jtd)return B(W,[],!1,J);const se=(0,t.getSchemaTypes)(W.schema),fe=(0,t.coerceAndCheckDataType)(W,se);B(W,se,!fe,J)}function L(W){const{schema:J,errSchemaPath:se,opts:fe,self:me}=W;J.$ref&&fe.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(J,me.RULES)&&me.logger.warn(`$ref: keywords ignored in schema at path "${se}"`)}function M(W){const{schema:J,opts:se}=W;J.default!==void 0&&se.useDefaults&&se.strictSchema&&(0,d.checkStrictMode)(W,"default is ignored in the schema root")}function z(W){const J=W.schema[W.opts.schemaId];J&&(W.baseId=(0,f.resolveUrl)(W.opts.uriResolver,W.baseId,J))}function P(W){if(W.schema.$async&&!W.schemaEnv.$async)throw new Error("async schema in sync schema")}function q({gen:W,schemaEnv:J,schema:se,errSchemaPath:fe,opts:me}){const xe=se.$comment;if(me.$comment===!0)W.code((0,l._)`${c.default.self}.logger.log(${xe})`);else if(typeof me.$comment=="function"){const we=(0,l.str)`${fe}/$comment`,Ve=W.scopeValue("root",{ref:J.root});W.code((0,l._)`${c.default.self}.opts.$comment(${xe}, ${we}, ${Ve}.schema)`)}}function D(W){const{gen:J,schemaEnv:se,validateName:fe,ValidationError:me,opts:xe}=W;se.$async?J.if((0,l._)`${c.default.errors} === 0`,()=>J.return(c.default.data),()=>J.throw((0,l._)`new ${me}(${c.default.vErrors})`)):(J.assign((0,l._)`${fe}.errors`,c.default.vErrors),xe.unevaluated&&H(W),J.return((0,l._)`${c.default.errors} === 0`))}function H({gen:W,evaluated:J,props:se,items:fe}){se instanceof l.Name&&W.assign((0,l._)`${J}.props`,se),fe instanceof l.Name&&W.assign((0,l._)`${J}.items`,fe)}function B(W,J,se,fe){const{gen:me,schema:xe,data:we,allErrors:Ve,opts:qe,self:We}=W,{RULES:He}=We;if(xe.$ref&&(qe.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(xe,He))){me.block(()=>ne(W,"$ref",He.all.$ref.definition));return}qe.jtd||K(W,J),me.block(()=>{for(const Be of He.rules)$e(Be);$e(He.post)});function $e(Be){(0,n.shouldUseGroup)(xe,Be)&&(Be.type?(me.if((0,r.checkDataType)(Be.type,we,qe.strictNumbers)),G(W,Be),J.length===1&&J[0]===Be.type&&se&&(me.else(),(0,r.reportTypeError)(W)),me.endIf()):G(W,Be),Ve||me.if((0,l._)`${c.default.errors} === ${fe||0}`))}}function G(W,J){const{gen:se,schema:fe,opts:{useDefaults:me}}=W;me&&(0,i.assignDefaults)(W,J.type),se.block(()=>{for(const xe of J.rules)(0,n.shouldUseRule)(fe,xe)&&ne(W,xe.keyword,xe.definition,J.type)})}function K(W,J){W.schemaEnv.meta||!W.opts.strictTypes||(Q(W,J),W.opts.allowUnionTypes||R(W,J),V(W,W.dataTypes))}function Q(W,J){if(J.length){if(!W.dataTypes.length){W.dataTypes=J;return}J.forEach(se=>{j(W.dataTypes,se)||U(W,`type "${se}" not allowed by context "${W.dataTypes.join(",")}"`)}),I(W,J)}}function R(W,J){J.length>1&&!(J.length===2&&J.includes("null"))&&U(W,"use allowUnionTypes to allow union type keyword")}function V(W,J){const se=W.self.RULES.all;for(const fe in se){const me=se[fe];if(typeof me=="object"&&(0,n.shouldUseRule)(W.schema,me)){const{type:xe}=me.definition;xe.length&&!xe.some(we=>X(J,we))&&U(W,`missing type "${xe.join(",")}" for keyword "${fe}"`)}}}function X(W,J){return W.includes(J)||J==="number"&&W.includes("integer")}function j(W,J){return W.includes(J)||J==="integer"&&W.includes("number")}function I(W,J){const se=[];for(const fe of W.dataTypes)j(J,fe)?se.push(fe):J.includes("integer")&&fe==="number"&&se.push("integer");W.dataTypes=se}function U(W,J){const se=W.schemaEnv.baseId+W.errSchemaPath;J+=` at "${se}" (strictTypes)`,(0,d.checkStrictMode)(W,J,W.opts.strictTypes)}class Y{constructor(J,se,fe){if((0,a.validateKeywordUsage)(J,se,fe),this.gen=J.gen,this.allErrors=J.allErrors,this.keyword=fe,this.data=J.data,this.schema=J.schema[fe],this.$data=se.$data&&J.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(J,this.schema,fe,this.$data),this.schemaType=se.schemaType,this.parentSchema=J.schema,this.params={},this.it=J,this.def=se,this.$data)this.schemaCode=J.gen.const("vSchema",le(this.$data,J));else if(this.schemaCode=this.schemaValue,!(0,a.validSchemaType)(this.schema,se.schemaType,se.allowUndefined))throw new Error(`${fe} value must be ${JSON.stringify(se.schemaType)}`);("code"in se?se.trackErrors:se.errors!==!1)&&(this.errsCount=J.gen.const("_errs",c.default.errors))}result(J,se,fe){this.failResult((0,l.not)(J),se,fe)}failResult(J,se,fe){this.gen.if(J),fe?fe():this.error(),se?(this.gen.else(),se(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(J,se){this.failResult((0,l.not)(J),void 0,se)}fail(J){if(J===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(J),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(J){if(!this.$data)return this.fail(J);const{schemaCode:se}=this;this.fail((0,l._)`${se} !== undefined && (${(0,l.or)(this.invalid$data(),J)})`)}error(J,se,fe){if(se){this.setParams(se),this._error(J,fe),this.setParams({});return}this._error(J,fe)}_error(J,se){(J?h.reportExtraError:h.reportError)(this,this.def.error,se)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(J){this.allErrors||this.gen.if(J)}setParams(J,se){se?Object.assign(this.params,J):this.params=J}block$data(J,se,fe=l.nil){this.gen.block(()=>{this.check$data(J,fe),se()})}check$data(J=l.nil,se=l.nil){if(!this.$data)return;const{gen:fe,schemaCode:me,schemaType:xe,def:we}=this;fe.if((0,l.or)((0,l._)`${me} === undefined`,se)),J!==l.nil&&fe.assign(J,!0),(xe.length||we.validateSchema)&&(fe.elseIf(this.invalid$data()),this.$dataError(),J!==l.nil&&fe.assign(J,!1)),fe.else()}invalid$data(){const{gen:J,schemaCode:se,schemaType:fe,def:me,it:xe}=this;return(0,l.or)(we(),Ve());function we(){if(fe.length){if(!(se instanceof l.Name))throw new Error("ajv implementation error");const qe=Array.isArray(fe)?fe:[fe];return(0,l._)`${(0,r.checkDataTypes)(qe,se,xe.opts.strictNumbers,r.DataType.Wrong)}`}return l.nil}function Ve(){if(me.validateSchema){const qe=J.scopeValue("validate$data",{ref:me.validateSchema});return(0,l._)`!${qe}(${se})`}return l.nil}}subschema(J,se){const fe=(0,o.getSubschema)(this.it,J);(0,o.extendSubschemaData)(fe,this.it,J),(0,o.extendSubschemaMode)(fe,J);const me={...this.it,...fe,items:void 0,props:void 0};return x(me,se),me}mergeEvaluated(J,se){const{it:fe,gen:me}=this;fe.opts.unevaluated&&(fe.props!==!0&&J.props!==void 0&&(fe.props=d.mergeEvaluated.props(me,J.props,fe.props,se)),fe.items!==!0&&J.items!==void 0&&(fe.items=d.mergeEvaluated.items(me,J.items,fe.items,se)))}mergeValidEvaluated(J,se){const{it:fe,gen:me}=this;if(fe.opts.unevaluated&&(fe.props!==!0||fe.items!==!0))return me.if(se,()=>this.mergeEvaluated(J,l.Name)),!0}}ki.KeywordCxt=Y;function ne(W,J,se,fe){const me=new Y(W,se,J);"code"in se?se.code(me,fe):me.$data&&se.validate?(0,a.funcKeywordCode)(me,se):"macro"in se?(0,a.macroKeywordCode)(me,se):(se.compile||se.validate)&&(0,a.funcKeywordCode)(me,se)}const ae=/^\/(?:[^~]|~0|~1)*$/,re=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function le(W,{dataLevel:J,dataNames:se,dataPathArr:fe}){let me,xe;if(W==="")return c.default.rootData;if(W[0]==="/"){if(!ae.test(W))throw new Error(`Invalid JSON-pointer: ${W}`);me=W,xe=c.default.rootData}else{const We=re.exec(W);if(!We)throw new Error(`Invalid JSON-pointer: ${W}`);const He=+We[1];if(me=We[2],me==="#"){if(He>=J)throw new Error(qe("property/index",He));return fe[J-He]}if(He>J)throw new Error(qe("data",He));if(xe=se[J-He],!me)return xe}let we=xe;const Ve=me.split("/");for(const We of Ve)We&&(xe=(0,l._)`${xe}${(0,l.getProperty)((0,d.unescapeJsonPointer)(We))}`,we=(0,l._)`${we} && ${xe}`);return we;function qe(We,He){return`Cannot access ${We} ${He} levels up, current level is ${J}`}}return ki.getData=le,ki}var Pd={},KD;function zE(){if(KD)return Pd;KD=1,Object.defineProperty(Pd,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Pd.default=e,Pd}var Ld={},XD;function ym(){if(XD)return Ld;XD=1,Object.defineProperty(Ld,"__esModule",{value:!0});const e=mm();class t extends Error{constructor(r,i,a,o){super(o||`can't resolve reference ${a} from id ${i}`),this.missingRef=(0,e.resolveUrl)(r,i,a),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(r,this.missingRef))}}return Ld.default=t,Ld}var Wn={},WD;function qE(){if(WD)return Wn;WD=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.resolveSchema=Wn.getCompilingSchema=Wn.resolveRef=Wn.compileSchema=Wn.SchemaEnv=void 0;const e=Xe(),t=zE(),n=La(),r=mm(),i=ht(),a=gm();class o{constructor(_){var S;this.refs={},this.dynamicAnchors={};let x;typeof _.schema=="object"&&(x=_.schema),this.schema=_.schema,this.schemaId=_.schemaId,this.root=_.root||this,this.baseId=(S=_.baseId)!==null&&S!==void 0?S:(0,r.normalizeId)(x==null?void 0:x[_.schemaId||"$id"]),this.schemaPath=_.schemaPath,this.localRefs=_.localRefs,this.meta=_.meta,this.$async=x==null?void 0:x.$async,this.refs={}}}Wn.SchemaEnv=o;function l(b){const _=d.call(this,b);if(_)return _;const S=(0,r.getFullPath)(this.opts.uriResolver,b.root.baseId),{es5:x,lines:A}=this.opts.code,{ownProperties:k}=this.opts,T=new e.CodeGen(this.scope,{es5:x,lines:A,ownProperties:k});let O;b.$async&&(O=T.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const $=T.scopeName("validate");b.validateName=$;const L={gen:T,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:T.scopeValue("schema",this.opts.code.source===!0?{ref:b.schema,code:(0,e.stringify)(b.schema)}:{ref:b.schema}),validateName:$,ValidationError:O,schema:b.schema,schemaEnv:b,rootId:S,baseId:b.baseId||S,schemaPath:e.nil,errSchemaPath:b.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let M;try{this._compilations.add(b),(0,a.validateFunctionCode)(L),T.optimize(this.opts.code.optimize);const z=T.toString();M=`${T.scopeRefs(n.default.scope)}return ${z}`,this.opts.code.process&&(M=this.opts.code.process(M,b));const q=new Function(`${n.default.self}`,`${n.default.scope}`,M)(this,this.scope.get());if(this.scope.value($,{ref:q}),q.errors=null,q.schema=b.schema,q.schemaEnv=b,b.$async&&(q.$async=!0),this.opts.code.source===!0&&(q.source={validateName:$,validateCode:z,scopeValues:T._values}),this.opts.unevaluated){const{props:D,items:H}=L;q.evaluated={props:D instanceof e.Name?void 0:D,items:H instanceof e.Name?void 0:H,dynamicProps:D instanceof e.Name,dynamicItems:H instanceof e.Name},q.source&&(q.source.evaluated=(0,e.stringify)(q.evaluated))}return b.validate=q,b}catch(z){throw delete b.validate,delete b.validateName,M&&this.logger.error("Error compiling schema, function code:",M),z}finally{this._compilations.delete(b)}}Wn.compileSchema=l;function c(b,_,S){var x;S=(0,r.resolveUrl)(this.opts.uriResolver,_,S);const A=b.refs[S];if(A)return A;let k=m.call(this,b,S);if(k===void 0){const T=(x=b.localRefs)===null||x===void 0?void 0:x[S],{schemaId:O}=this.opts;T&&(k=new o({schema:T,schemaId:O,root:b,baseId:_}))}if(k!==void 0)return b.refs[S]=f.call(this,k)}Wn.resolveRef=c;function f(b){return(0,r.inlineRef)(b.schema,this.opts.inlineRefs)?b.schema:b.validate?b:l.call(this,b)}function d(b){for(const _ of this._compilations)if(h(_,b))return _}Wn.getCompilingSchema=d;function h(b,_){return b.schema===_.schema&&b.root===_.root&&b.baseId===_.baseId}function m(b,_){let S;for(;typeof(S=this.refs[_])=="string";)_=S;return S||this.schemas[_]||g.call(this,b,_)}function g(b,_){const S=this.opts.uriResolver.parse(_),x=(0,r._getFullPath)(this.opts.uriResolver,S);let A=(0,r.getFullPath)(this.opts.uriResolver,b.baseId,void 0);if(Object.keys(b.schema).length>0&&x===A)return w.call(this,S,b);const k=(0,r.normalizeId)(x),T=this.refs[k]||this.schemas[k];if(typeof T=="string"){const O=g.call(this,b,T);return typeof(O==null?void 0:O.schema)!="object"?void 0:w.call(this,S,O)}if(typeof(T==null?void 0:T.schema)=="object"){if(T.validate||l.call(this,T),k===(0,r.normalizeId)(_)){const{schema:O}=T,{schemaId:$}=this.opts,L=O[$];return L&&(A=(0,r.resolveUrl)(this.opts.uriResolver,A,L)),new o({schema:O,schemaId:$,root:b,baseId:A})}return w.call(this,S,T)}}Wn.resolveSchema=g;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(b,{baseId:_,schema:S,root:x}){var A;if(((A=b.fragment)===null||A===void 0?void 0:A[0])!=="/")return;for(const O of b.fragment.slice(1).split("/")){if(typeof S=="boolean")return;const $=S[(0,i.unescapeFragment)(O)];if($===void 0)return;S=$;const L=typeof S=="object"&&S[this.opts.schemaId];!v.has(O)&&L&&(_=(0,r.resolveUrl)(this.opts.uriResolver,_,L))}let k;if(typeof S!="boolean"&&S.$ref&&!(0,i.schemaHasRulesButRef)(S,this.RULES)){const O=(0,r.resolveUrl)(this.opts.uriResolver,_,S.$ref);k=g.call(this,x,O)}const{schemaId:T}=this.opts;if(k=k||new o({schema:S,schemaId:T,root:x,baseId:_}),k.schema!==k.root.schema)return k}return Wn}const wge="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Sge="Meta-schema for $data reference (JSON AnySchema extension proposal)",Ege="object",kge=["$data"],Age={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Tge=!1,Cge={$id:wge,description:Sge,type:Ege,required:kge,properties:Age,additionalProperties:Tge};var zd={},$u={exports:{}},Gx,QD;function XL(){if(QD)return Gx;QD=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(m){let g="",v=0,w=0;for(w=0;w<m.length;w++)if(v=m[w].charCodeAt(0),v!==48){if(!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=m[w];break}for(w+=1;w<m.length;w++){if(v=m[w].charCodeAt(0),!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=m[w]}return g}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(m){return m.length=0,!0}function a(m,g,v){if(m.length){const w=n(m);if(w!=="")g.push(w);else return v.error=!0,!1;m.length=0}return!0}function o(m){let g=0;const v={error:!1,address:"",zone:""},w=[],b=[];let _=!1,S=!1,x=a;for(let A=0;A<m.length;A++){const k=m[A];if(!(k==="["||k==="]"))if(k===":"){if(_===!0&&(S=!0),!x(b,w,v))break;if(++g>7){v.error=!0;break}A>0&&m[A-1]===":"&&(_=!0),w.push(":");continue}else if(k==="%"){if(!x(b,w,v))break;x=i}else{b.push(k);continue}}return b.length&&(x===i?v.zone=b.join(""):S?w.push(b.join("")):w.push(n(b))),v.address=w.join(""),v}function l(m){if(c(m,":")<2)return{host:m,isIPV6:!1};const g=o(m);if(g.error)return{host:m,isIPV6:!1};{let v=g.address,w=g.address;return g.zone&&(v+="%"+g.zone,w+="%25"+g.zone),{host:v,isIPV6:!0,escapedHost:w}}}function c(m,g){let v=0;for(let w=0;w<m.length;w++)m[w]===g&&v++;return v}function f(m){let g=m;const v=[];let w=-1,b=0;for(;b=g.length;){if(b===1){if(g===".")break;if(g==="/"){v.push("/");break}else{v.push(g);break}}else if(b===2){if(g[0]==="."){if(g[1]===".")break;if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&(g[1]==="."||g[1]==="/")){v.push("/");break}}else if(b===3&&g==="/.."){v.length!==0&&v.pop(),v.push("/");break}if(g[0]==="."){if(g[1]==="."){if(g[2]==="/"){g=g.slice(3);continue}}else if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&g[1]==="."){if(g[2]==="/"){g=g.slice(2);continue}else if(g[2]==="."&&g[3]==="/"){g=g.slice(3),v.length!==0&&v.pop();continue}}if((w=g.indexOf("/",1))===-1){v.push(g);break}else v.push(g.slice(0,w)),g=g.slice(w)}return v.join("")}function d(m,g){const v=g!==!0?escape:unescape;return m.scheme!==void 0&&(m.scheme=v(m.scheme)),m.userinfo!==void 0&&(m.userinfo=v(m.userinfo)),m.host!==void 0&&(m.host=v(m.host)),m.path!==void 0&&(m.path=v(m.path)),m.query!==void 0&&(m.query=v(m.query)),m.fragment!==void 0&&(m.fragment=v(m.fragment)),m}function h(m){const g=[];if(m.userinfo!==void 0&&(g.push(m.userinfo),g.push("@")),m.host!==void 0){let v=unescape(m.host);if(!t(v)){const w=l(v);w.isIPV6===!0?v=`[${w.escapedHost}]`:v=m.host}g.push(v)}return(typeof m.port=="number"||typeof m.port=="string")&&(g.push(":"),g.push(String(m.port))),g.length?g.join(""):void 0}return Gx={nonSimpleDomain:r,recomposeAuthority:h,normalizeComponentEncoding:d,removeDotSegments:f,isIPv4:t,isUUID:e,normalizeIPv6:l,stringArrayToHexStripped:n},Gx}var Yx,JD;function Oge(){if(JD)return Yx;JD=1;const{isUUID:e}=XL(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function r(k){return n.indexOf(k)!==-1}function i(k){return k.secure===!0?!0:k.secure===!1?!1:k.scheme?k.scheme.length===3&&(k.scheme[0]==="w"||k.scheme[0]==="W")&&(k.scheme[1]==="s"||k.scheme[1]==="S")&&(k.scheme[2]==="s"||k.scheme[2]==="S"):!1}function a(k){return k.host||(k.error=k.error||"HTTP URIs must have a host."),k}function o(k){const T=String(k.scheme).toLowerCase()==="https";return(k.port===(T?443:80)||k.port==="")&&(k.port=void 0),k.path||(k.path="/"),k}function l(k){return k.secure=i(k),k.resourceName=(k.path||"/")+(k.query?"?"+k.query:""),k.path=void 0,k.query=void 0,k}function c(k){if((k.port===(i(k)?443:80)||k.port==="")&&(k.port=void 0),typeof k.secure=="boolean"&&(k.scheme=k.secure?"wss":"ws",k.secure=void 0),k.resourceName){const[T,O]=k.resourceName.split("?");k.path=T&&T!=="/"?T:void 0,k.query=O,k.resourceName=void 0}return k.fragment=void 0,k}function f(k,T){if(!k.path)return k.error="URN can not be parsed",k;const O=k.path.match(t);if(O){const $=T.scheme||k.scheme||"urn";k.nid=O[1].toLowerCase(),k.nss=O[2];const L=`${$}:${T.nid||k.nid}`,M=A(L);k.path=void 0,M&&(k=M.parse(k,T))}else k.error=k.error||"URN can not be parsed.";return k}function d(k,T){if(k.nid===void 0)throw new Error("URN without nid cannot be serialized");const O=T.scheme||k.scheme||"urn",$=k.nid.toLowerCase(),L=`${O}:${T.nid||$}`,M=A(L);M&&(k=M.serialize(k,T));const z=k,P=k.nss;return z.path=`${$||T.nid}:${P}`,T.skipEscape=!0,z}function h(k,T){const O=k;return O.uuid=O.nss,O.nss=void 0,!T.tolerant&&(!O.uuid||!e(O.uuid))&&(O.error=O.error||"UUID is not valid."),O}function m(k){const T=k;return T.nss=(k.uuid||"").toLowerCase(),T}const g={scheme:"http",domainHost:!0,parse:a,serialize:o},v={scheme:"https",domainHost:g.domainHost,parse:a,serialize:o},w={scheme:"ws",domainHost:!0,parse:l,serialize:c},b={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},x={http:g,https:v,ws:w,wss:b,urn:{scheme:"urn",parse:f,serialize:d,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:h,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(x,null);function A(k){return k&&(x[k]||x[k.toLowerCase()])||void 0}return Yx={wsIsSecure:i,SCHEMES:x,isValidSchemeName:r,getSchemeHandler:A},Yx}var eI;function Nge(){if(eI)return $u.exports;eI=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:n,normalizeComponentEncoding:r,isIPv4:i,nonSimpleDomain:a}=XL(),{SCHEMES:o,getSchemeHandler:l}=Oge();function c(b,_){return typeof b=="string"?b=m(v(b,_),_):typeof b=="object"&&(b=v(m(b,_),_)),b}function f(b,_,S){const x=S?Object.assign({scheme:"null"},S):{scheme:"null"},A=d(v(b,x),v(_,x),x,!0);return x.skipEscape=!0,m(A,x)}function d(b,_,S,x){const A={};return x||(b=v(m(b,S),S),_=v(m(_,S),S)),S=S||{},!S.tolerant&&_.scheme?(A.scheme=_.scheme,A.userinfo=_.userinfo,A.host=_.host,A.port=_.port,A.path=t(_.path||""),A.query=_.query):(_.userinfo!==void 0||_.host!==void 0||_.port!==void 0?(A.userinfo=_.userinfo,A.host=_.host,A.port=_.port,A.path=t(_.path||""),A.query=_.query):(_.path?(_.path[0]==="/"?A.path=t(_.path):((b.userinfo!==void 0||b.host!==void 0||b.port!==void 0)&&!b.path?A.path="/"+_.path:b.path?A.path=b.path.slice(0,b.path.lastIndexOf("/")+1)+_.path:A.path=_.path,A.path=t(A.path)),A.query=_.query):(A.path=b.path,_.query!==void 0?A.query=_.query:A.query=b.query),A.userinfo=b.userinfo,A.host=b.host,A.port=b.port),A.scheme=b.scheme),A.fragment=_.fragment,A}function h(b,_,S){return typeof b=="string"?(b=unescape(b),b=m(r(v(b,S),!0),{...S,skipEscape:!0})):typeof b=="object"&&(b=m(r(b,!0),{...S,skipEscape:!0})),typeof _=="string"?(_=unescape(_),_=m(r(v(_,S),!0),{...S,skipEscape:!0})):typeof _=="object"&&(_=m(r(_,!0),{...S,skipEscape:!0})),b.toLowerCase()===_.toLowerCase()}function m(b,_){const S={host:b.host,scheme:b.scheme,userinfo:b.userinfo,port:b.port,path:b.path,query:b.query,nid:b.nid,nss:b.nss,uuid:b.uuid,fragment:b.fragment,reference:b.reference,resourceName:b.resourceName,secure:b.secure,error:""},x=Object.assign({},_),A=[],k=l(x.scheme||S.scheme);k&&k.serialize&&k.serialize(S,x),S.path!==void 0&&(x.skipEscape?S.path=unescape(S.path):(S.path=escape(S.path),S.scheme!==void 0&&(S.path=S.path.split("%3A").join(":")))),x.reference!=="suffix"&&S.scheme&&A.push(S.scheme,":");const T=n(S);if(T!==void 0&&(x.reference!=="suffix"&&A.push("//"),A.push(T),S.path&&S.path[0]!=="/"&&A.push("/")),S.path!==void 0){let O=S.path;!x.absolutePath&&(!k||!k.absolutePath)&&(O=t(O)),T===void 0&&O[0]==="/"&&O[1]==="/"&&(O="/%2F"+O.slice(2)),A.push(O)}return S.query!==void 0&&A.push("?",S.query),S.fragment!==void 0&&A.push("#",S.fragment),A.join("")}const g=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function v(b,_){const S=Object.assign({},_),x={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let A=!1;S.reference==="suffix"&&(S.scheme?b=S.scheme+":"+b:b="//"+b);const k=b.match(g);if(k){if(x.scheme=k[1],x.userinfo=k[3],x.host=k[4],x.port=parseInt(k[5],10),x.path=k[6]||"",x.query=k[7],x.fragment=k[8],isNaN(x.port)&&(x.port=k[5]),x.host)if(i(x.host)===!1){const $=e(x.host);x.host=$.host.toLowerCase(),A=$.isIPV6}else A=!0;x.scheme===void 0&&x.userinfo===void 0&&x.host===void 0&&x.port===void 0&&x.query===void 0&&!x.path?x.reference="same-document":x.scheme===void 0?x.reference="relative":x.fragment===void 0?x.reference="absolute":x.reference="uri",S.reference&&S.reference!=="suffix"&&S.reference!==x.reference&&(x.error=x.error||"URI is not a "+S.reference+" reference.");const T=l(S.scheme||x.scheme);if(!S.unicodeSupport&&(!T||!T.unicodeSupport)&&x.host&&(S.domainHost||T&&T.domainHost)&&A===!1&&a(x.host))try{x.host=URL.domainToASCII(x.host.toLowerCase())}catch(O){x.error=x.error||"Host's domain name can not be converted to ASCII: "+O}(!T||T&&!T.skipNormalize)&&(b.indexOf("%")!==-1&&(x.scheme!==void 0&&(x.scheme=unescape(x.scheme)),x.host!==void 0&&(x.host=unescape(x.host))),x.path&&(x.path=escape(unescape(x.path))),x.fragment&&(x.fragment=encodeURI(decodeURIComponent(x.fragment)))),T&&T.parse&&T.parse(x,S)}else x.error=x.error||"URI can not be parsed.";return x}const w={SCHEMES:o,normalize:c,resolve:f,resolveComponent:d,equal:h,serialize:m,parse:v};return $u.exports=w,$u.exports.default=w,$u.exports.fastUri=w,$u.exports}var tI;function Rge(){if(tI)return zd;tI=1,Object.defineProperty(zd,"__esModule",{value:!0});const e=Nge();return e.code='require("ajv/dist/runtime/uri").default',zd.default=e,zd}var nI;function jge(){return nI||(nI=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=gm();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=Xe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=zE(),i=ym(),a=YL(),o=qE(),l=Xe(),c=mm(),f=yp(),d=ht(),h=Cge,m=Rge(),g=(R,V)=>new RegExp(R,V);g.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},S=200;function x(R){var V,X,j,I,U,Y,ne,ae,re,le,W,J,se,fe,me,xe,we,Ve,qe,We,He,$e,Be,Ot,kt;const pe=R.strict,_e=(V=R.code)===null||V===void 0?void 0:V.optimize,Te=_e===!0||_e===void 0?1:_e||0,je=(j=(X=R.code)===null||X===void 0?void 0:X.regExp)!==null&&j!==void 0?j:g,rt=(I=R.uriResolver)!==null&&I!==void 0?I:m.default;return{strictSchema:(Y=(U=R.strictSchema)!==null&&U!==void 0?U:pe)!==null&&Y!==void 0?Y:!0,strictNumbers:(ae=(ne=R.strictNumbers)!==null&&ne!==void 0?ne:pe)!==null&&ae!==void 0?ae:!0,strictTypes:(le=(re=R.strictTypes)!==null&&re!==void 0?re:pe)!==null&&le!==void 0?le:"log",strictTuples:(J=(W=R.strictTuples)!==null&&W!==void 0?W:pe)!==null&&J!==void 0?J:"log",strictRequired:(fe=(se=R.strictRequired)!==null&&se!==void 0?se:pe)!==null&&fe!==void 0?fe:!1,code:R.code?{...R.code,optimize:Te,regExp:je}:{optimize:Te,regExp:je},loopRequired:(me=R.loopRequired)!==null&&me!==void 0?me:S,loopEnum:(xe=R.loopEnum)!==null&&xe!==void 0?xe:S,meta:(we=R.meta)!==null&&we!==void 0?we:!0,messages:(Ve=R.messages)!==null&&Ve!==void 0?Ve:!0,inlineRefs:(qe=R.inlineRefs)!==null&&qe!==void 0?qe:!0,schemaId:(We=R.schemaId)!==null&&We!==void 0?We:"$id",addUsedSchema:(He=R.addUsedSchema)!==null&&He!==void 0?He:!0,validateSchema:($e=R.validateSchema)!==null&&$e!==void 0?$e:!0,validateFormats:(Be=R.validateFormats)!==null&&Be!==void 0?Be:!0,unicodeRegExp:(Ot=R.unicodeRegExp)!==null&&Ot!==void 0?Ot:!0,int32range:(kt=R.int32range)!==null&&kt!==void 0?kt:!0,uriResolver:rt}}class A{constructor(V={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,V=this.opts={...V,...x(V)};const{es5:X,lines:j}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:w,es5:X,lines:j}),this.logger=P(V.logger);const I=V.validateFormats;V.validateFormats=!1,this.RULES=(0,a.getRules)(),k.call(this,b,V,"NOT SUPPORTED"),k.call(this,_,V,"DEPRECATED","warn"),this._metaOpts=M.call(this),V.formats&&$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),V.keywords&&L.call(this,V.keywords),typeof V.meta=="object"&&this.addMetaSchema(V.meta),O.call(this),V.validateFormats=I}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:V,meta:X,schemaId:j}=this.opts;let I=h;j==="id"&&(I={...h},I.id=I.$id,delete I.$id),X&&V&&this.addMetaSchema(I,I[j],!1)}defaultMeta(){const{meta:V,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof V=="object"?V[X]||V:void 0}validate(V,X){let j;if(typeof V=="string"){if(j=this.getSchema(V),!j)throw new Error(`no schema with key or ref "${V}"`)}else j=this.compile(V);const I=j(X);return"$async"in j||(this.errors=j.errors),I}compile(V,X){const j=this._addSchema(V,X);return j.validate||this._compileSchemaEnv(j)}compileAsync(V,X){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:j}=this.opts;return I.call(this,V,X);async function I(le,W){await U.call(this,le.$schema);const J=this._addSchema(le,W);return J.validate||Y.call(this,J)}async function U(le){le&&!this.getSchema(le)&&await I.call(this,{$ref:le},!0)}async function Y(le){try{return this._compileSchemaEnv(le)}catch(W){if(!(W instanceof i.default))throw W;return ne.call(this,W),await ae.call(this,W.missingSchema),Y.call(this,le)}}function ne({missingSchema:le,missingRef:W}){if(this.refs[le])throw new Error(`AnySchema ${le} is loaded but ${W} cannot be resolved`)}async function ae(le){const W=await re.call(this,le);this.refs[le]||await U.call(this,W.$schema),this.refs[le]||this.addSchema(W,le,X)}async function re(le){const W=this._loading[le];if(W)return W;try{return await(this._loading[le]=j(le))}finally{delete this._loading[le]}}}addSchema(V,X,j,I=this.opts.validateSchema){if(Array.isArray(V)){for(const Y of V)this.addSchema(Y,void 0,j,I);return this}let U;if(typeof V=="object"){const{schemaId:Y}=this.opts;if(U=V[Y],U!==void 0&&typeof U!="string")throw new Error(`schema ${Y} must be string`)}return X=(0,c.normalizeId)(X||U),this._checkUnique(X),this.schemas[X]=this._addSchema(V,j,X,I,!0),this}addMetaSchema(V,X,j=this.opts.validateSchema){return this.addSchema(V,X,!0,j),this}validateSchema(V,X){if(typeof V=="boolean")return!0;let j;if(j=V.$schema,j!==void 0&&typeof j!="string")throw new Error("$schema must be a string");if(j=j||this.opts.defaultMeta||this.defaultMeta(),!j)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const I=this.validate(j,V);if(!I&&X){const U="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(U);else throw new Error(U)}return I}getSchema(V){let X;for(;typeof(X=T.call(this,V))=="string";)V=X;if(X===void 0){const{schemaId:j}=this.opts,I=new o.SchemaEnv({schema:{},schemaId:j});if(X=o.resolveSchema.call(this,I,V),!X)return;this.refs[V]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema(V){if(V instanceof RegExp)return this._removeAllSchemas(this.schemas,V),this._removeAllSchemas(this.refs,V),this;switch(typeof V){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const X=T.call(this,V);return typeof X=="object"&&this._cache.delete(X.schema),delete this.schemas[V],delete this.refs[V],this}case"object":{const X=V;this._cache.delete(X);let j=V[this.opts.schemaId];return j&&(j=(0,c.normalizeId)(j),delete this.schemas[j],delete this.refs[j]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(V){for(const X of V)this.addKeyword(X);return this}addKeyword(V,X){let j;if(typeof V=="string")j=V,typeof X=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=j);else if(typeof V=="object"&&X===void 0){if(X=V,j=X.keyword,Array.isArray(j)&&!j.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(D.call(this,j,X),!X)return(0,d.eachItem)(j,U=>H.call(this,U)),this;G.call(this,X);const I={...X,type:(0,f.getJSONTypes)(X.type),schemaType:(0,f.getJSONTypes)(X.schemaType)};return(0,d.eachItem)(j,I.type.length===0?U=>H.call(this,U,I):U=>I.type.forEach(Y=>H.call(this,U,I,Y))),this}getKeyword(V){const X=this.RULES.all[V];return typeof X=="object"?X.definition:!!X}removeKeyword(V){const{RULES:X}=this;delete X.keywords[V],delete X.all[V];for(const j of X.rules){const I=j.rules.findIndex(U=>U.keyword===V);I>=0&&j.rules.splice(I,1)}return this}addFormat(V,X){return typeof X=="string"&&(X=new RegExp(X)),this.formats[V]=X,this}errorsText(V=this.errors,{separator:X=", ",dataVar:j="data"}={}){return!V||V.length===0?"No errors":V.map(I=>`${j}${I.instancePath} ${I.message}`).reduce((I,U)=>I+X+U)}$dataMetaSchema(V,X){const j=this.RULES.all;V=JSON.parse(JSON.stringify(V));for(const I of X){const U=I.split("/").slice(1);let Y=V;for(const ne of U)Y=Y[ne];for(const ne in j){const ae=j[ne];if(typeof ae!="object")continue;const{$data:re}=ae.definition,le=Y[ne];re&&le&&(Y[ne]=Q(le))}}return V}_removeAllSchemas(V,X){for(const j in V){const I=V[j];(!X||X.test(j))&&(typeof I=="string"?delete V[j]:I&&!I.meta&&(this._cache.delete(I.schema),delete V[j]))}}_addSchema(V,X,j,I=this.opts.validateSchema,U=this.opts.addUsedSchema){let Y;const{schemaId:ne}=this.opts;if(typeof V=="object")Y=V[ne];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof V!="boolean")throw new Error("schema must be object or boolean")}let ae=this._cache.get(V);if(ae!==void 0)return ae;j=(0,c.normalizeId)(Y||j);const re=c.getSchemaRefs.call(this,V,j);return ae=new o.SchemaEnv({schema:V,schemaId:ne,meta:X,baseId:j,localRefs:re}),this._cache.set(ae.schema,ae),U&&!j.startsWith("#")&&(j&&this._checkUnique(j),this.refs[j]=ae),I&&this.validateSchema(V,!0),ae}_checkUnique(V){if(this.schemas[V]||this.refs[V])throw new Error(`schema with key or id "${V}" already exists`)}_compileSchemaEnv(V){if(V.meta?this._compileMetaSchema(V):o.compileSchema.call(this,V),!V.validate)throw new Error("ajv implementation error");return V.validate}_compileMetaSchema(V){const X=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,V)}finally{this.opts=X}}}A.ValidationError=r.default,A.MissingRefError=i.default,e.default=A;function k(R,V,X,j="error"){for(const I in R){const U=I;U in V&&this.logger[j](`${X}: option ${I}. ${R[U]}`)}}function T(R){return R=(0,c.normalizeId)(R),this.schemas[R]||this.refs[R]}function O(){const R=this.opts.schemas;if(R)if(Array.isArray(R))this.addSchema(R);else for(const V in R)this.addSchema(R[V],V)}function $(){for(const R in this.opts.formats){const V=this.opts.formats[R];V&&this.addFormat(R,V)}}function L(R){if(Array.isArray(R)){this.addVocabulary(R);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const V in R){const X=R[V];X.keyword||(X.keyword=V),this.addKeyword(X)}}function M(){const R={...this.opts};for(const V of v)delete R[V];return R}const z={log(){},warn(){},error(){}};function P(R){if(R===!1)return z;if(R===void 0)return console;if(R.log&&R.warn&&R.error)return R;throw new Error("logger must implement log, warn and error methods")}const q=/^[a-z_$][a-z0-9_$:-]*$/i;function D(R,V){const{RULES:X}=this;if((0,d.eachItem)(R,j=>{if(X.keywords[j])throw new Error(`Keyword ${j} is already defined`);if(!q.test(j))throw new Error(`Keyword ${j} has invalid name`)}),!!V&&V.$data&&!("code"in V||"validate"in V))throw new Error('$data keyword must have "code" or "validate" function')}function H(R,V,X){var j;const I=V==null?void 0:V.post;if(X&&I)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:U}=this;let Y=I?U.post:U.rules.find(({type:ae})=>ae===X);if(Y||(Y={type:X,rules:[]},U.rules.push(Y)),U.keywords[R]=!0,!V)return;const ne={keyword:R,definition:{...V,type:(0,f.getJSONTypes)(V.type),schemaType:(0,f.getJSONTypes)(V.schemaType)}};V.before?B.call(this,Y,ne,V.before):Y.rules.push(ne),U.all[R]=ne,(j=V.implements)===null||j===void 0||j.forEach(ae=>this.addKeyword(ae))}function B(R,V,X){const j=R.rules.findIndex(I=>I.keyword===X);j>=0?R.rules.splice(j,0,V):(R.rules.push(V),this.logger.warn(`rule ${X} is not defined`))}function G(R){let{metaSchema:V}=R;V!==void 0&&(R.$data&&this.opts.$data&&(V=Q(V)),R.validateSchema=this.compile(V,!0))}const K={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Q(R){return{anyOf:[R,K]}}}(zx)),zx}var qd={},Fd={},Bd={},rI;function Mge(){if(rI)return Bd;rI=1,Object.defineProperty(Bd,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Bd.default=e,Bd}var Ea={},iI;function $ge(){if(iI)return Ea;iI=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.callRef=Ea.getValidate=void 0;const e=ym(),t=Lr(),n=Xe(),r=La(),i=qE(),a=ht(),o={keyword:"$ref",schemaType:"string",code(f){const{gen:d,schema:h,it:m}=f,{baseId:g,schemaEnv:v,validateName:w,opts:b,self:_}=m,{root:S}=v;if((h==="#"||h==="#/")&&g===S.baseId)return A();const x=i.resolveRef.call(_,S,g,h);if(x===void 0)throw new e.default(m.opts.uriResolver,g,h);if(x instanceof i.SchemaEnv)return k(x);return T(x);function A(){if(v===S)return c(f,w,v,v.$async);const O=d.scopeValue("root",{ref:S});return c(f,(0,n._)`${O}.validate`,S,S.$async)}function k(O){const $=l(f,O);c(f,$,O,O.$async)}function T(O){const $=d.scopeValue("schema",b.code.source===!0?{ref:O,code:(0,n.stringify)(O)}:{ref:O}),L=d.name("valid"),M=f.subschema({schema:O,dataTypes:[],schemaPath:n.nil,topSchemaRef:$,errSchemaPath:h},L);f.mergeEvaluated(M),f.ok(L)}}};function l(f,d){const{gen:h}=f;return d.validate?h.scopeValue("validate",{ref:d.validate}):(0,n._)`${h.scopeValue("wrapper",{ref:d})}.validate`}Ea.getValidate=l;function c(f,d,h,m){const{gen:g,it:v}=f,{allErrors:w,schemaEnv:b,opts:_}=v,S=_.passContext?r.default.this:n.nil;m?x():A();function x(){if(!b.$async)throw new Error("async schema referenced by sync schema");const O=g.let("valid");g.try(()=>{g.code((0,n._)`await ${(0,t.callValidateCode)(f,d,S)}`),T(d),w||g.assign(O,!0)},$=>{g.if((0,n._)`!(${$} instanceof ${v.ValidationError})`,()=>g.throw($)),k($),w||g.assign(O,!1)}),f.ok(O)}function A(){f.result((0,t.callValidateCode)(f,d,S),()=>T(d),()=>k(d))}function k(O){const $=(0,n._)`${O}.errors`;g.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${$} : ${r.default.vErrors}.concat(${$})`),g.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function T(O){var $;if(!v.opts.unevaluated)return;const L=($=h==null?void 0:h.validate)===null||$===void 0?void 0:$.evaluated;if(v.props!==!0)if(L&&!L.dynamicProps)L.props!==void 0&&(v.props=a.mergeEvaluated.props(g,L.props,v.props));else{const M=g.var("props",(0,n._)`${O}.evaluated.props`);v.props=a.mergeEvaluated.props(g,M,v.props,n.Name)}if(v.items!==!0)if(L&&!L.dynamicItems)L.items!==void 0&&(v.items=a.mergeEvaluated.items(g,L.items,v.items));else{const M=g.var("items",(0,n._)`${O}.evaluated.items`);v.items=a.mergeEvaluated.items(g,M,v.items,n.Name)}}}return Ea.callRef=c,Ea.default=o,Ea}var aI;function Dge(){if(aI)return Fd;aI=1,Object.defineProperty(Fd,"__esModule",{value:!0});const e=Mge(),t=$ge(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Fd.default=n,Fd}var Ud={},Vd={},sI;function Ige(){if(sI)return Vd;sI=1,Object.defineProperty(Vd,"__esModule",{value:!0});const e=Xe(),t=e.operators,n={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},r={message:({keyword:a,schemaCode:o})=>(0,e.str)`must be ${n[a].okStr} ${o}`,params:({keyword:a,schemaCode:o})=>(0,e._)`{comparison: ${n[a].okStr}, limit: ${o}}`},i={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:r,code(a){const{keyword:o,data:l,schemaCode:c}=a;a.fail$data((0,e._)`${l} ${n[o].fail} ${c} || isNaN(${l})`)}};return Vd.default=i,Vd}var Hd={},oI;function Pge(){if(oI)return Hd;oI=1,Object.defineProperty(Hd,"__esModule",{value:!0});const e=Xe(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,e._)`{multipleOf: ${r}}`},code(r){const{gen:i,data:a,schemaCode:o,it:l}=r,c=l.opts.multipleOfPrecision,f=i.let("res"),d=c?(0,e._)`Math.abs(Math.round(${f}) - ${f}) > 1e-${c}`:(0,e._)`${f} !== parseInt(${f})`;r.fail$data((0,e._)`(${o} === 0 || (${f} = ${a}/${o}, ${d}))`)}};return Hd.default=n,Hd}var Gd={},Yd={},lI;function Lge(){if(lI)return Yd;lI=1,Object.defineProperty(Yd,"__esModule",{value:!0});function e(t){const n=t.length;let r=0,i=0,a;for(;i<n;)r++,a=t.charCodeAt(i++),a>=55296&&a<=56319&&i<n&&(a=t.charCodeAt(i),(a&64512)===56320&&i++);return r}return Yd.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Yd}var uI;function zge(){if(uI)return Gd;uI=1,Object.defineProperty(Gd,"__esModule",{value:!0});const e=Xe(),t=ht(),n=Lge(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:a,schemaCode:o}){const l=a==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${l} than ${o} characters`},params:({schemaCode:a})=>(0,e._)`{limit: ${a}}`},code(a){const{keyword:o,data:l,schemaCode:c,it:f}=a,d=o==="maxLength"?e.operators.GT:e.operators.LT,h=f.opts.unicode===!1?(0,e._)`${l}.length`:(0,e._)`${(0,t.useFunc)(a.gen,n.default)}(${l})`;a.fail$data((0,e._)`${h} ${d} ${c}`)}};return Gd.default=i,Gd}var Zd={},cI;function qge(){if(cI)return Zd;cI=1,Object.defineProperty(Zd,"__esModule",{value:!0});const e=Lr(),t=Xe(),r={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,t.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,t._)`{pattern: ${i}}`},code(i){const{data:a,$data:o,schema:l,schemaCode:c,it:f}=i,d=f.opts.unicodeRegExp?"u":"",h=o?(0,t._)`(new RegExp(${c}, ${d}))`:(0,e.usePattern)(i,l);i.fail$data((0,t._)`!${h}.test(${a})`)}};return Zd.default=r,Zd}var Kd={},fI;function Fge(){if(fI)return Kd;fI=1,Object.defineProperty(Kd,"__esModule",{value:!0});const e=Xe(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:i}){const a=r==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${i} properties`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:i,data:a,schemaCode:o}=r,l=i==="maxProperties"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`Object.keys(${a}).length ${l} ${o}`)}};return Kd.default=n,Kd}var Xd={},dI;function Bge(){if(dI)return Xd;dI=1,Object.defineProperty(Xd,"__esModule",{value:!0});const e=Lr(),t=Xe(),n=ht(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:a}})=>(0,t.str)`must have required property '${a}'`,params:({params:{missingProperty:a}})=>(0,t._)`{missingProperty: ${a}}`},code(a){const{gen:o,schema:l,schemaCode:c,data:f,$data:d,it:h}=a,{opts:m}=h;if(!d&&l.length===0)return;const g=l.length>=m.loopRequired;if(h.allErrors?v():w(),m.strictRequired){const S=a.parentSchema.properties,{definedProperties:x}=a.it;for(const A of l)if((S==null?void 0:S[A])===void 0&&!x.has(A)){const k=h.schemaEnv.baseId+h.errSchemaPath,T=`required property "${A}" is not defined at "${k}" (strictRequired)`;(0,n.checkStrictMode)(h,T,h.opts.strictRequired)}}function v(){if(g||d)a.block$data(t.nil,b);else for(const S of l)(0,e.checkReportMissingProp)(a,S)}function w(){const S=o.let("missing");if(g||d){const x=o.let("valid",!0);a.block$data(x,()=>_(S,x)),a.ok(x)}else o.if((0,e.checkMissingProp)(a,l,S)),(0,e.reportMissingProp)(a,S),o.else()}function b(){o.forOf("prop",c,S=>{a.setParams({missingProperty:S}),o.if((0,e.noPropertyInData)(o,f,S,m.ownProperties),()=>a.error())})}function _(S,x){a.setParams({missingProperty:S}),o.forOf(S,c,()=>{o.assign(x,(0,e.propertyInData)(o,f,S,m.ownProperties)),o.if((0,t.not)(x),()=>{a.error(),o.break()})},t.nil)}}};return Xd.default=i,Xd}var Wd={},hI;function Uge(){if(hI)return Wd;hI=1,Object.defineProperty(Wd,"__esModule",{value:!0});const e=Xe(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:i}){const a=r==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${i} items`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:i,data:a,schemaCode:o}=r,l=i==="maxItems"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`${a}.length ${l} ${o}`)}};return Wd.default=n,Wd}var Qd={},Jd={},pI;function FE(){if(pI)return Jd;pI=1,Object.defineProperty(Jd,"__esModule",{value:!0});const e=KL();return e.code='require("ajv/dist/runtime/equal").default',Jd.default=e,Jd}var mI;function Vge(){if(mI)return Qd;mI=1,Object.defineProperty(Qd,"__esModule",{value:!0});const e=yp(),t=Xe(),n=ht(),r=FE(),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:o,j:l}})=>(0,t.str)`must NOT have duplicate items (items ## ${l} and ${o} are identical)`,params:({params:{i:o,j:l}})=>(0,t._)`{i: ${o}, j: ${l}}`},code(o){const{gen:l,data:c,$data:f,schema:d,parentSchema:h,schemaCode:m,it:g}=o;if(!f&&!d)return;const v=l.let("valid"),w=h.items?(0,e.getSchemaTypes)(h.items):[];o.block$data(v,b,(0,t._)`${m} === false`),o.ok(v);function b(){const A=l.let("i",(0,t._)`${c}.length`),k=l.let("j");o.setParams({i:A,j:k}),l.assign(v,!0),l.if((0,t._)`${A} > 1`,()=>(_()?S:x)(A,k))}function _(){return w.length>0&&!w.some(A=>A==="object"||A==="array")}function S(A,k){const T=l.name("item"),O=(0,e.checkDataTypes)(w,T,g.opts.strictNumbers,e.DataType.Wrong),$=l.const("indices",(0,t._)`{}`);l.for((0,t._)`;${A}--;`,()=>{l.let(T,(0,t._)`${c}[${A}]`),l.if(O,(0,t._)`continue`),w.length>1&&l.if((0,t._)`typeof ${T} == "string"`,(0,t._)`${T} += "_"`),l.if((0,t._)`typeof ${$}[${T}] == "number"`,()=>{l.assign(k,(0,t._)`${$}[${T}]`),o.error(),l.assign(v,!1).break()}).code((0,t._)`${$}[${T}] = ${A}`)})}function x(A,k){const T=(0,n.useFunc)(l,r.default),O=l.name("outer");l.label(O).for((0,t._)`;${A}--;`,()=>l.for((0,t._)`${k} = ${A}; ${k}--;`,()=>l.if((0,t._)`${T}(${c}[${A}], ${c}[${k}])`,()=>{o.error(),l.assign(v,!1).break(O)})))}}};return Qd.default=a,Qd}var eh={},gI;function Hge(){if(gI)return eh;gI=1,Object.defineProperty(eh,"__esModule",{value:!0});const e=Xe(),t=ht(),n=FE(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:a})=>(0,e._)`{allowedValue: ${a}}`},code(a){const{gen:o,data:l,$data:c,schemaCode:f,schema:d}=a;c||d&&typeof d=="object"?a.fail$data((0,e._)`!${(0,t.useFunc)(o,n.default)}(${l}, ${f})`):a.fail((0,e._)`${d} !== ${l}`)}};return eh.default=i,eh}var th={},yI;function Gge(){if(yI)return th;yI=1,Object.defineProperty(th,"__esModule",{value:!0});const e=Xe(),t=ht(),n=FE(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:a})=>(0,e._)`{allowedValues: ${a}}`},code(a){const{gen:o,data:l,$data:c,schema:f,schemaCode:d,it:h}=a;if(!c&&f.length===0)throw new Error("enum must have non-empty array");const m=f.length>=h.opts.loopEnum;let g;const v=()=>g??(g=(0,t.useFunc)(o,n.default));let w;if(m||c)w=o.let("valid"),a.block$data(w,b);else{if(!Array.isArray(f))throw new Error("ajv implementation error");const S=o.const("vSchema",d);w=(0,e.or)(...f.map((x,A)=>_(S,A)))}a.pass(w);function b(){o.assign(w,!1),o.forOf("v",d,S=>o.if((0,e._)`${v()}(${l}, ${S})`,()=>o.assign(w,!0).break()))}function _(S,x){const A=f[x];return typeof A=="object"&&A!==null?(0,e._)`${v()}(${l}, ${S}[${x}])`:(0,e._)`${l} === ${A}`}}};return th.default=i,th}var bI;function Yge(){if(bI)return Ud;bI=1,Object.defineProperty(Ud,"__esModule",{value:!0});const e=Ige(),t=Pge(),n=zge(),r=qge(),i=Fge(),a=Bge(),o=Uge(),l=Vge(),c=Hge(),f=Gge(),d=[e.default,t.default,n.default,r.default,i.default,a.default,o.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,f.default];return Ud.default=d,Ud}var nh={},Oo={},vI;function WL(){if(vI)return Oo;vI=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.validateAdditionalItems=void 0;const e=Xe(),t=ht(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,e.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,e._)`{limit: ${a}}`},code(a){const{parentSchema:o,it:l}=a,{items:c}=o;if(!Array.isArray(c)){(0,t.checkStrictMode)(l,'"additionalItems" is ignored when "items" is not an array of schemas');return}i(a,c)}};function i(a,o){const{gen:l,schema:c,data:f,keyword:d,it:h}=a;h.items=!0;const m=l.const("len",(0,e._)`${f}.length`);if(c===!1)a.setParams({len:o.length}),a.pass((0,e._)`${m} <= ${o.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(h,c)){const v=l.var("valid",(0,e._)`${m} <= ${o.length}`);l.if((0,e.not)(v),()=>g(v)),a.ok(v)}function g(v){l.forRange("i",o.length,m,w=>{a.subschema({keyword:d,dataProp:w,dataPropType:t.Type.Num},v),h.allErrors||l.if((0,e.not)(v),()=>l.break())})}}return Oo.validateAdditionalItems=i,Oo.default=r,Oo}var rh={},No={},_I;function QL(){if(_I)return No;_I=1,Object.defineProperty(No,"__esModule",{value:!0}),No.validateTuple=void 0;const e=Xe(),t=ht(),n=Lr(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(a){const{schema:o,it:l}=a;if(Array.isArray(o))return i(a,"additionalItems",o);l.items=!0,!(0,t.alwaysValidSchema)(l,o)&&a.ok((0,n.validateArray)(a))}};function i(a,o,l=a.schema){const{gen:c,parentSchema:f,data:d,keyword:h,it:m}=a;w(f),m.opts.unevaluated&&l.length&&m.items!==!0&&(m.items=t.mergeEvaluated.items(c,l.length,m.items));const g=c.name("valid"),v=c.const("len",(0,e._)`${d}.length`);l.forEach((b,_)=>{(0,t.alwaysValidSchema)(m,b)||(c.if((0,e._)`${v} > ${_}`,()=>a.subschema({keyword:h,schemaProp:_,dataProp:_},g)),a.ok(g))});function w(b){const{opts:_,errSchemaPath:S}=m,x=l.length,A=x===b.minItems&&(x===b.maxItems||b[o]===!1);if(_.strictTuples&&!A){const k=`"${h}" is ${x}-tuple, but minItems or maxItems/${o} are not specified or different at path "${S}"`;(0,t.checkStrictMode)(m,k,_.strictTuples)}}}return No.validateTuple=i,No.default=r,No}var xI;function Zge(){if(xI)return rh;xI=1,Object.defineProperty(rh,"__esModule",{value:!0});const e=QL(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,e.validateTuple)(n,"items")};return rh.default=t,rh}var ih={},wI;function Kge(){if(wI)return ih;wI=1,Object.defineProperty(ih,"__esModule",{value:!0});const e=Xe(),t=ht(),n=Lr(),r=WL(),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{schema:l,parentSchema:c,it:f}=o,{prefixItems:d}=c;f.items=!0,!(0,t.alwaysValidSchema)(f,l)&&(d?(0,r.validateAdditionalItems)(o,d):o.ok((0,n.validateArray)(o)))}};return ih.default=a,ih}var ah={},SI;function Xge(){if(SI)return ah;SI=1,Object.defineProperty(ah,"__esModule",{value:!0});const e=Xe(),t=ht(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:a}})=>a===void 0?(0,e.str)`must contain at least ${i} valid item(s)`:(0,e.str)`must contain at least ${i} and no more than ${a} valid item(s)`,params:({params:{min:i,max:a}})=>a===void 0?(0,e._)`{minContains: ${i}}`:(0,e._)`{minContains: ${i}, maxContains: ${a}}`},code(i){const{gen:a,schema:o,parentSchema:l,data:c,it:f}=i;let d,h;const{minContains:m,maxContains:g}=l;f.opts.next?(d=m===void 0?1:m,h=g):d=1;const v=a.const("len",(0,e._)`${c}.length`);if(i.setParams({min:d,max:h}),h===void 0&&d===0){(0,t.checkStrictMode)(f,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(h!==void 0&&d>h){(0,t.checkStrictMode)(f,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,t.alwaysValidSchema)(f,o)){let x=(0,e._)`${v} >= ${d}`;h!==void 0&&(x=(0,e._)`${x} && ${v} <= ${h}`),i.pass(x);return}f.items=!0;const w=a.name("valid");h===void 0&&d===1?_(w,()=>a.if(w,()=>a.break())):d===0?(a.let(w,!0),h!==void 0&&a.if((0,e._)`${c}.length > 0`,b)):(a.let(w,!1),b()),i.result(w,()=>i.reset());function b(){const x=a.name("_valid"),A=a.let("count",0);_(x,()=>a.if(x,()=>S(A)))}function _(x,A){a.forRange("i",0,v,k=>{i.subschema({keyword:"contains",dataProp:k,dataPropType:t.Type.Num,compositeRule:!0},x),A()})}function S(x){a.code((0,e._)`${x}++`),h===void 0?a.if((0,e._)`${x} >= ${d}`,()=>a.assign(w,!0).break()):(a.if((0,e._)`${x} > ${h}`,()=>a.assign(w,!1).break()),d===1?a.assign(w,!0):a.if((0,e._)`${x} >= ${d}`,()=>a.assign(w,!0)))}}};return ah.default=r,ah}var Zx={},EI;function Wge(){return EI||(EI=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Xe(),n=ht(),r=Lr();e.error={message:({params:{property:c,depsCount:f,deps:d}})=>{const h=f===1?"property":"properties";return(0,t.str)`must have ${h} ${d} when property ${c} is present`},params:({params:{property:c,depsCount:f,deps:d,missingProperty:h}})=>(0,t._)`{property: ${c},
|
|
266
266
|
missingProperty: ${h},
|
|
267
267
|
depsCount: ${f},
|
|
268
|
-
deps: ${d}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[f,d]=a(c);o(c,f),l(c,d)}};function a({schema:c}){const f={},d={};for(const h in c){if(h==="__proto__")continue;const m=Array.isArray(c[h])?f:d;m[h]=c[h]}return[f,d]}function o(c,f=c.schema){const{gen:d,data:h,it:m}=c;if(Object.keys(f).length===0)return;const g=d.let("missing");for(const v in f){const w=f[v];if(w.length===0)continue;const b=(0,r.propertyInData)(d,h,v,m.opts.ownProperties);c.setParams({property:v,depsCount:w.length,deps:w.join(", ")}),m.allErrors?d.if(b,()=>{for(const _ of w)(0,r.checkReportMissingProp)(c,_)}):(d.if((0,t._)`${b} && (${(0,r.checkMissingProp)(c,w,g)})`),(0,r.reportMissingProp)(c,g),d.else())}}e.validatePropertyDeps=o;function l(c,f=c.schema){const{gen:d,data:h,keyword:m,it:g}=c,v=d.name("valid");for(const w in f)(0,n.alwaysValidSchema)(g,f[w])||(d.if((0,r.propertyInData)(d,h,w,g.opts.ownProperties),()=>{const b=c.subschema({keyword:m,schemaProp:w},v);c.mergeValidEvaluated(b,v)},()=>d.var(v,!0)),c.ok(v))}e.validateSchemaDeps=l,e.default=i}(Zx)),Zx}var sh={},kI;function Wge(){if(kI)return sh;kI=1,Object.defineProperty(sh,"__esModule",{value:!0});const e=Xe(),t=ht(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:i})=>(0,e._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:a,schema:o,data:l,it:c}=i;if((0,t.alwaysValidSchema)(c,o))return;const f=a.name("valid");a.forIn("key",l,d=>{i.setParams({propertyName:d}),i.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},f),a.if((0,e.not)(f),()=>{i.error(!0),c.allErrors||a.break()})}),i.ok(f)}};return sh.default=r,sh}var oh={},AI;function JL(){if(AI)return oh;AI=1,Object.defineProperty(oh,"__esModule",{value:!0});const e=Lr(),t=Xe(),n=La(),r=ht(),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:o})=>(0,t._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:l,schema:c,parentSchema:f,data:d,errsCount:h,it:m}=o;if(!h)throw new Error("ajv implementation error");const{allErrors:g,opts:v}=m;if(m.props=!0,v.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(m,c))return;const w=(0,e.allSchemaProperties)(f.properties),b=(0,e.allSchemaProperties)(f.patternProperties);_(),o.ok((0,t._)`${h} === ${n.default.errors}`);function _(){l.forIn("key",d,T=>{!w.length&&!b.length?A(T):l.if(S(T),()=>A(T))})}function S(T){let O;if(w.length>8){const $=(0,r.schemaRefOrVal)(m,f.properties,"properties");O=(0,e.isOwnProperty)(l,$,T)}else w.length?O=(0,t.or)(...w.map($=>(0,t._)`${T} === ${$}`)):O=t.nil;return b.length&&(O=(0,t.or)(O,...b.map($=>(0,t._)`${(0,e.usePattern)(o,$)}.test(${T})`))),(0,t.not)(O)}function x(T){l.code((0,t._)`delete ${d}[${T}]`)}function A(T){if(v.removeAdditional==="all"||v.removeAdditional&&c===!1){x(T);return}if(c===!1){o.setParams({additionalProperty:T}),o.error(),g||l.break();return}if(typeof c=="object"&&!(0,r.alwaysValidSchema)(m,c)){const O=l.name("valid");v.removeAdditional==="failing"?(k(T,O,!1),l.if((0,t.not)(O),()=>{o.reset(),x(T)})):(k(T,O),g||l.if((0,t.not)(O),()=>l.break()))}}function k(T,O,$){const L={keyword:"additionalProperties",dataProp:T,dataPropType:r.Type.Str};$===!1&&Object.assign(L,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(L,O)}}};return oh.default=a,oh}var lh={},TI;function Qge(){if(TI)return lh;TI=1,Object.defineProperty(lh,"__esModule",{value:!0});const e=gm(),t=Lr(),n=ht(),r=JL(),i={keyword:"properties",type:"object",schemaType:"object",code(a){const{gen:o,schema:l,parentSchema:c,data:f,it:d}=a;d.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&r.default.code(new e.KeywordCxt(d,r.default,"additionalProperties"));const h=(0,t.allSchemaProperties)(l);for(const b of h)d.definedProperties.add(b);d.opts.unevaluated&&h.length&&d.props!==!0&&(d.props=n.mergeEvaluated.props(o,(0,n.toHash)(h),d.props));const m=h.filter(b=>!(0,n.alwaysValidSchema)(d,l[b]));if(m.length===0)return;const g=o.name("valid");for(const b of m)v(b)?w(b):(o.if((0,t.propertyInData)(o,f,b,d.opts.ownProperties)),w(b),d.allErrors||o.else().var(g,!0),o.endIf()),a.it.definedProperties.add(b),a.ok(g);function v(b){return d.opts.useDefaults&&!d.compositeRule&&l[b].default!==void 0}function w(b){a.subschema({keyword:"properties",schemaProp:b,dataProp:b},g)}}};return lh.default=i,lh}var uh={},CI;function Jge(){if(CI)return uh;CI=1,Object.defineProperty(uh,"__esModule",{value:!0});const e=Lr(),t=Xe(),n=ht(),r=ht(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(a){const{gen:o,schema:l,data:c,parentSchema:f,it:d}=a,{opts:h}=d,m=(0,e.allSchemaProperties)(l),g=m.filter(A=>(0,n.alwaysValidSchema)(d,l[A]));if(m.length===0||g.length===m.length&&(!d.opts.unevaluated||d.props===!0))return;const v=h.strictSchema&&!h.allowMatchingProperties&&f.properties,w=o.name("valid");d.props!==!0&&!(d.props instanceof t.Name)&&(d.props=(0,r.evaluatedPropsToName)(o,d.props));const{props:b}=d;_();function _(){for(const A of m)v&&S(A),d.allErrors?x(A):(o.var(w,!0),x(A),o.if(w))}function S(A){for(const k in v)new RegExp(A).test(k)&&(0,n.checkStrictMode)(d,`property ${k} matches pattern ${A} (use allowMatchingProperties)`)}function x(A){o.forIn("key",c,k=>{o.if((0,t._)`${(0,e.usePattern)(a,A)}.test(${k})`,()=>{const T=g.includes(A);T||a.subschema({keyword:"patternProperties",schemaProp:A,dataProp:k,dataPropType:r.Type.Str},w),d.opts.unevaluated&&b!==!0?o.assign((0,t._)`${b}[${k}]`,!0):!T&&!d.allErrors&&o.if((0,t.not)(w),()=>o.break())})})}}};return uh.default=i,uh}var ch={},OI;function eye(){if(OI)return ch;OI=1,Object.defineProperty(ch,"__esModule",{value:!0});const e=ht(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:i,it:a}=n;if((0,e.alwaysValidSchema)(a,i)){n.fail();return}const o=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),n.failResult(o,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return ch.default=t,ch}var fh={},NI;function tye(){if(NI)return fh;NI=1,Object.defineProperty(fh,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Lr().validateUnion,error:{message:"must match a schema in anyOf"}};return fh.default=t,fh}var dh={},RI;function nye(){if(RI)return dh;RI=1,Object.defineProperty(dh,"__esModule",{value:!0});const e=Xe(),t=ht(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:a,schema:o,parentSchema:l,it:c}=i;if(!Array.isArray(o))throw new Error("ajv implementation error");if(c.opts.discriminator&&l.discriminator)return;const f=o,d=a.let("valid",!1),h=a.let("passing",null),m=a.name("_valid");i.setParams({passing:h}),a.block(g),i.result(d,()=>i.reset(),()=>i.error(!0));function g(){f.forEach((v,w)=>{let b;(0,t.alwaysValidSchema)(c,v)?a.var(m,!0):b=i.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},m),w>0&&a.if((0,e._)`${m} && ${d}`).assign(d,!1).assign(h,(0,e._)`[${h}, ${w}]`).else(),a.if(m,()=>{a.assign(d,!0),a.assign(h,w),b&&i.mergeEvaluated(b,e.Name)})})}}};return dh.default=r,dh}var hh={},jI;function rye(){if(jI)return hh;jI=1,Object.defineProperty(hh,"__esModule",{value:!0});const e=ht(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:i,it:a}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");const o=r.name("valid");i.forEach((l,c)=>{if((0,e.alwaysValidSchema)(a,l))return;const f=n.subschema({keyword:"allOf",schemaProp:c},o);n.ok(o),n.mergeEvaluated(f)})}};return hh.default=t,hh}var ph={},MI;function iye(){if(MI)return ph;MI=1,Object.defineProperty(ph,"__esModule",{value:!0});const e=Xe(),t=ht(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:a})=>(0,e.str)`must match "${a.ifClause}" schema`,params:({params:a})=>(0,e._)`{failingKeyword: ${a.ifClause}}`},code(a){const{gen:o,parentSchema:l,it:c}=a;l.then===void 0&&l.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const f=i(c,"then"),d=i(c,"else");if(!f&&!d)return;const h=o.let("valid",!0),m=o.name("_valid");if(g(),a.reset(),f&&d){const w=o.let("ifClause");a.setParams({ifClause:w}),o.if(m,v("then",w),v("else",w))}else f?o.if(m,v("then")):o.if((0,e.not)(m),v("else"));a.pass(h,()=>a.error(!0));function g(){const w=a.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},m);a.mergeEvaluated(w)}function v(w,b){return()=>{const _=a.subschema({keyword:w},m);o.assign(h,m),a.mergeValidEvaluated(_,h),b?o.assign(b,(0,e._)`${w}`):a.setParams({ifClause:w})}}}};function i(a,o){const l=a.schema[o];return l!==void 0&&!(0,t.alwaysValidSchema)(a,l)}return ph.default=r,ph}var mh={},$I;function aye(){if($I)return mh;$I=1,Object.defineProperty(mh,"__esModule",{value:!0});const e=ht(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:i}){r.if===void 0&&(0,e.checkStrictMode)(i,`"${n}" without "if" is ignored`)}};return mh.default=t,mh}var DI;function sye(){if(DI)return nh;DI=1,Object.defineProperty(nh,"__esModule",{value:!0});const e=WL(),t=Yge(),n=QL(),r=Zge(),i=Kge(),a=Xge(),o=Wge(),l=JL(),c=Qge(),f=Jge(),d=eye(),h=tye(),m=nye(),g=rye(),v=iye(),w=aye();function b(_=!1){const S=[d.default,h.default,m.default,g.default,v.default,w.default,o.default,l.default,a.default,c.default,f.default];return _?S.push(t.default,r.default):S.push(e.default,n.default),S.push(i.default),S}return nh.default=b,nh}var gh={},yh={},II;function oye(){if(II)return yh;II=1,Object.defineProperty(yh,"__esModule",{value:!0});const e=Xe(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,i){const{gen:a,data:o,$data:l,schema:c,schemaCode:f,it:d}=r,{opts:h,errSchemaPath:m,schemaEnv:g,self:v}=d;if(!h.validateFormats)return;l?w():b();function w(){const _=a.scopeValue("formats",{ref:v.formats,code:h.code.formats}),S=a.const("fDef",(0,e._)`${_}[${f}]`),x=a.let("fType"),A=a.let("format");a.if((0,e._)`typeof ${S} == "object" && !(${S} instanceof RegExp)`,()=>a.assign(x,(0,e._)`${S}.type || "string"`).assign(A,(0,e._)`${S}.validate`),()=>a.assign(x,(0,e._)`"string"`).assign(A,S)),r.fail$data((0,e.or)(k(),T()));function k(){return h.strictSchema===!1?e.nil:(0,e._)`${f} && !${A}`}function T(){const O=g.$async?(0,e._)`(${S}.async ? await ${A}(${o}) : ${A}(${o}))`:(0,e._)`${A}(${o})`,$=(0,e._)`(typeof ${A} == "function" ? ${O} : ${A}.test(${o}))`;return(0,e._)`${A} && ${A} !== true && ${x} === ${i} && !${$}`}}function b(){const _=v.formats[c];if(!_){k();return}if(_===!0)return;const[S,x,A]=T(_);S===i&&r.pass(O());function k(){if(h.strictSchema===!1){v.logger.warn($());return}throw new Error($());function $(){return`unknown format "${c}" ignored in schema at path "${m}"`}}function T($){const L=$ instanceof RegExp?(0,e.regexpCode)($):h.code.formats?(0,e._)`${h.code.formats}${(0,e.getProperty)(c)}`:void 0,M=a.scopeValue("formats",{key:c,ref:$,code:L});return typeof $=="object"&&!($ instanceof RegExp)?[$.type||"string",$.validate,(0,e._)`${M}.validate`]:["string",$,M]}function O(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!g.$async)throw new Error("async format in sync schema");return(0,e._)`await ${A}(${o})`}return typeof x=="function"?(0,e._)`${A}(${o})`:(0,e._)`${A}.test(${o})`}}}};return yh.default=n,yh}var PI;function lye(){if(PI)return gh;PI=1,Object.defineProperty(gh,"__esModule",{value:!0});const t=[oye().default];return gh.default=t,gh}var os={},LI;function uye(){return LI||(LI=1,Object.defineProperty(os,"__esModule",{value:!0}),os.contentVocabulary=os.metadataVocabulary=void 0,os.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],os.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),os}var zI;function cye(){if(zI)return qd;zI=1,Object.defineProperty(qd,"__esModule",{value:!0});const e=$ge(),t=Gge(),n=sye(),r=lye(),i=uye(),a=[e.default,t.default,(0,n.default)(),r.default,i.metadataVocabulary,i.contentVocabulary];return qd.default=a,qd}var bh={},Du={},qI;function fye(){if(qI)return Du;qI=1,Object.defineProperty(Du,"__esModule",{value:!0}),Du.DiscrError=void 0;var e;return function(t){t.Tag="tag",t.Mapping="mapping"}(e||(Du.DiscrError=e={})),Du}var FI;function dye(){if(FI)return bh;FI=1,Object.defineProperty(bh,"__esModule",{value:!0});const e=Xe(),t=fye(),n=qE(),r=ym(),i=ht(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:l,tagName:c}})=>l===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:l,tag:c,tagName:f}})=>(0,e._)`{error: ${l}, tag: ${f}, tagValue: ${c}}`},code(l){const{gen:c,data:f,schema:d,parentSchema:h,it:m}=l,{oneOf:g}=h;if(!m.opts.discriminator)throw new Error("discriminator: requires discriminator option");const v=d.propertyName;if(typeof v!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!g)throw new Error("discriminator: requires oneOf keyword");const w=c.let("valid",!1),b=c.const("tag",(0,e._)`${f}${(0,e.getProperty)(v)}`);c.if((0,e._)`typeof ${b} == "string"`,()=>_(),()=>l.error(!1,{discrError:t.DiscrError.Tag,tag:b,tagName:v})),l.ok(w);function _(){const A=x();c.if(!1);for(const k in A)c.elseIf((0,e._)`${b} === ${k}`),c.assign(w,S(A[k]));c.else(),l.error(!1,{discrError:t.DiscrError.Mapping,tag:b,tagName:v}),c.endIf()}function S(A){const k=c.name("valid"),T=l.subschema({keyword:"oneOf",schemaProp:A},k);return l.mergeEvaluated(T,e.Name),k}function x(){var A;const k={},T=$(h);let O=!0;for(let z=0;z<g.length;z++){let P=g[z];if(P!=null&&P.$ref&&!(0,i.schemaHasRulesButRef)(P,m.self.RULES)){const D=P.$ref;if(P=n.resolveRef.call(m.self,m.schemaEnv.root,m.baseId,D),P instanceof n.SchemaEnv&&(P=P.schema),P===void 0)throw new r.default(m.opts.uriResolver,m.baseId,D)}const q=(A=P==null?void 0:P.properties)===null||A===void 0?void 0:A[v];if(typeof q!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${v}"`);O=O&&(T||$(P)),L(q,z)}if(!O)throw new Error(`discriminator: "${v}" must be required`);return k;function $({required:z}){return Array.isArray(z)&&z.includes(v)}function L(z,P){if(z.const)M(z.const,P);else if(z.enum)for(const q of z.enum)M(q,P);else throw new Error(`discriminator: "properties/${v}" must have "const" or "enum"`)}function M(z,P){if(typeof z!="string"||z in k)throw new Error(`discriminator: "${v}" values must be unique strings`);k[z]=P}}}};return bh.default=o,bh}const hye="http://json-schema.org/draft-07/schema#",pye="http://json-schema.org/draft-07/schema#",mye="Core schema meta-schema",gye={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},yye=["object","boolean"],bye={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},vye={$schema:hye,$id:pye,title:mye,definitions:gye,type:yye,properties:bye,default:!0};var BI;function e8(){return BI||(BI=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=Rge(),r=cye(),i=dye(),a=vye,o=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(a,o):a;this.addMetaSchema(v,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var f=gm();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return f.KeywordCxt}});var d=Xe();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var h=zE();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var m=ym();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})}(Dd,Dd.exports)),Dd.exports}var _ye=e8();const xye=zn(_ye);var vh={exports:{}},Kx={},UI;function wye(){return UI||(UI=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(L,M){return{validate:L,compare:M}}e.fullFormats={date:t(a,o),time:t(c,f),"date-time":t(h,m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:w,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:$,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:_,int32:{type:"number",validate:A},int64:{type:"number",validate:k},float:{type:"number",validate:T},double:{type:"number",validate:T},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(L){return L%4===0&&(L%100!==0||L%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(L){const M=r.exec(L);if(!M)return!1;const z=+M[1],P=+M[2],q=+M[3];return P>=1&&P<=12&&q>=1&&q<=(P===2&&n(z)?29:i[P])}function o(L,M){if(L&&M)return L>M?1:L<M?-1:0}const l=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function c(L,M){const z=l.exec(L);if(!z)return!1;const P=+z[1],q=+z[2],D=+z[3],H=z[5];return(P<=23&&q<=59&&D<=59||P===23&&q===59&&D===60)&&(!M||H!=="")}function f(L,M){if(!(L&&M))return;const z=l.exec(L),P=l.exec(M);if(z&&P)return L=z[1]+z[2]+z[3]+(z[4]||""),M=P[1]+P[2]+P[3]+(P[4]||""),L>M?1:L<M?-1:0}const d=/t|\s/i;function h(L){const M=L.split(d);return M.length===2&&a(M[0])&&c(M[1],!0)}function m(L,M){if(!(L&&M))return;const[z,P]=L.split(d),[q,D]=M.split(d),H=o(z,q);if(H!==void 0)return H||f(P,D)}const g=/\/|:/,v=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function w(L){return g.test(L)&&v.test(L)}const b=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function _(L){return b.lastIndex=0,b.test(L)}const S=-2147483648,x=2**31-1;function A(L){return Number.isInteger(L)&&L<=x&&L>=S}function k(L){return Number.isInteger(L)}function T(){return!0}const O=/[^\\]\\Z/;function $(L){if(O.test(L))return!1;try{return new RegExp(L),!0}catch{return!1}}}(Kx)),Kx}var Xx={},VI;function Sye(){return VI||(VI=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=e8(),n=Xe(),r=n.operators,i={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},a={message:({keyword:l,schemaCode:c})=>n.str`should be ${i[l].okStr} ${c}`,params:({keyword:l,schemaCode:c})=>n._`{comparison: ${i[l].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:a,code(l){const{gen:c,data:f,schemaCode:d,keyword:h,it:m}=l,{opts:g,self:v}=m;if(!g.validateFormats)return;const w=new t.KeywordCxt(m,v.RULES.all.format.definition,"format");w.$data?b():_();function b(){const x=c.scopeValue("formats",{ref:v.formats,code:g.code.formats}),A=c.const("fmt",n._`${x}[${w.schemaCode}]`);l.fail$data(n.or(n._`typeof ${A} != "object"`,n._`${A} instanceof RegExp`,n._`typeof ${A}.compare != "function"`,S(A)))}function _(){const x=w.schema,A=v.formats[x];if(!A||A===!0)return;if(typeof A!="object"||A instanceof RegExp||typeof A.compare!="function")throw new Error(`"${h}": format "${x}" does not define "compare" function`);const k=c.scopeValue("formats",{key:x,ref:A,code:g.code.formats?n._`${g.code.formats}${n.getProperty(x)}`:void 0});l.fail$data(S(k))}function S(x){return n._`${x}.compare(${f}, ${d}) ${i[h].fail} 0`}},dependencies:["format"]};const o=l=>(l.addKeyword(e.formatLimitDefinition),l);e.default=o}(Xx)),Xx}var HI;function Eye(){return HI||(HI=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=wye(),r=Sye(),i=Xe(),a=new i.Name("fullFormats"),o=new i.Name("fastFormats"),l=(f,d={keywords:!0})=>{if(Array.isArray(d))return c(f,d,n.fullFormats,a),f;const[h,m]=d.mode==="fast"?[n.fastFormats,o]:[n.fullFormats,a],g=d.formats||n.formatNames;return c(f,g,h,m),d.keywords&&r.default(f),f};l.get=(f,d="full")=>{const m=(d==="fast"?n.fastFormats:n.fullFormats)[f];if(!m)throw new Error(`Unknown format "${f}"`);return m};function c(f,d,h,m){var g,v;(g=(v=f.opts.code).formats)!==null&&g!==void 0||(v.formats=i._`require("ajv-formats/dist/formats").${m}`);for(const w of d)f.addFormat(w,h[w])}e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l}(vh,vh.exports)),vh.exports}var kye=Eye();const GI=zn(kye),Aye={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},Tye=/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,Cye=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function Oye(e,t,n={},r,i=xye){const a=new i({...Aye,...n});return r?GI(a,r):r!==!1&&GI(a),a.addFormat("data-url",Cye),a.addFormat("color",Tye),a.addKeyword(Mc),a.addKeyword(PS),Array.isArray(e)&&a.addMetaSchema(e),Mt(t)&&Object.keys(t).forEach(o=>{a.addFormat(o,t[o])}),a}function Nye(e=[],t){return e.map(n=>{var r;const{instancePath:i,keyword:a,params:o,schemaPath:l,parentSchema:c,...f}=n;let{message:d=""}=f,h=i.replace(/\//g,"."),m=`${h} ${d}`.trim();const g=[...((r=o.deps)===null||r===void 0?void 0:r.split(", "))||[],o.missingProperty,o.property].filter(v=>v);if(g.length>0)g.forEach(v=>{const w=h?`${h}.${v}`:v;let b=ot(Ne(t,`${w.replace(/^\./,"")}`)).title;if(b===void 0){const _=l.replace(/\/properties\//g,"/").split("/").slice(1,-1).concat([v]);b=ot(Ne(t,_)).title}if(b)d=d.replace(`'${v}'`,`'${b}'`);else{const _=Ne(c,[Bt,v,"title"]);_&&(d=d.replace(`'${v}'`,`'${_}'`))}}),m=d;else{const v=ot(Ne(t,`${h.replace(/^\./,"")}`)).title;if(v)m=`'${v}' ${d}`.trim();else{const w=c==null?void 0:c.title;w&&(m=`'${w}' ${d}`.trim())}}return"missingProperty"in o&&(h=h?`${h}.${o.missingProperty}`:o.missingProperty),{name:a,property:h,message:d,params:o,stack:m,schemaPath:l}})}function Rye(e,t,n,r,i,a,o){const{validationError:l}=t;let c=Nye(t.errors,o);l&&(c=[...c,{stack:l.message}]),typeof a=="function"&&(c=a(c,o));let f=Ihe(c);if(l&&(f={...f,$schema:{__errors:[l.message]}}),typeof i!="function")return{errors:c,errorSchema:f};const d=AL(e,r,n,r,!0),h=i(d,fp(d),o),m=DE(h);return jh({errors:c,errorSchema:f},m)}class jye{constructor(t,n){const{additionalMetaSchemas:r,customFormats:i,ajvOptionsOverrides:a,ajvFormatOptions:o,AjvClass:l}=t;this.ajv=Oye(r,i,a,o,l),this.localizer=n}reset(){this.ajv.removeSchema()}toErrorList(t,n=[]){return wc(t,n)}rawValidation(t,n){var r,i;let a,o;t[Ra]&&(o=this.ajv.getSchema(t[Ra]));try{o===void 0&&(o=this.ajv.compile(t)),o(n)}catch(c){a=c}let l;return o&&(typeof this.localizer=="function"&&(((r=o.errors)!==null&&r!==void 0?r:[]).forEach(c=>{var f;["missingProperty","property"].forEach(d=>{var h;!((h=c.params)===null||h===void 0)&&h[d]&&(c.params[d]=`'${c.params[d]}'`)}),!((f=c.params)===null||f===void 0)&&f.deps&&(c.params.deps=c.params.deps.split(", ").map(d=>`'${d}'`).join(", "))}),this.localizer(o.errors),((i=o.errors)!==null&&i!==void 0?i:[]).forEach(c=>{var f;["missingProperty","property"].forEach(d=>{var h;!((h=c.params)===null||h===void 0)&&h[d]&&(c.params[d]=c.params[d].slice(1,-1))}),!((f=c.params)===null||f===void 0)&&f.deps&&(c.params.deps=c.params.deps.split(", ").map(d=>d.slice(1,-1)).join(", "))})),l=o.errors||void 0,o.errors=null),{errors:l,validationError:a}}validateFormData(t,n,r,i,a){const o=this.rawValidation(n,t);return Rye(this,o,t,n,r,i,a)}handleSchemaUpdate(t){var n,r;const i=(n=t[Ra])!==null&&n!==void 0?n:UP;this.ajv.getSchema(i)===void 0?this.ajv.addSchema(t,i):It(t,(r=this.ajv.getSchema(i))===null||r===void 0?void 0:r.schema)||(this.ajv.removeSchema(i),this.ajv.addSchema(t,i))}isValid(t,n,r){var i;try{this.handleSchemaUpdate(r);const a=IE(t),o=(i=a[Ra])!==null&&i!==void 0?i:Nhe(a);let l;return l=this.ajv.getSchema(o),l===void 0&&(l=this.ajv.addSchema(a,o).getSchema(o)||this.ajv.compile(a)),l(n)}catch(a){return console.warn("Error encountered compiling schema:",a),!1}}}function Mye(e={},t){return new jye(e,t)}const $ye=Mye(),Dye=e=>{var i,a,o,l;const t=(i=e.options)==null?void 0:i.minLength,n=(a=e.options)==null?void 0:a.maxLength,r=((o=e.value)==null?void 0:o.length)||0;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("input",{type:"text",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors",value:e.value||"",onChange:c=>e.onChange(c.target.value),placeholder:e.placeholder,disabled:e.disabled,maxLength:n?e.options.maxLength:void 0}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description}),(t||n)&&N.jsx("div",{className:"flex justify-end mt-1",children:N.jsx("span",{className:`text-xs ${r>(((l=e.options)==null?void 0:l.maxLength)||0)?"text-red-500":"text-gray-400"}`,children:t&&n?`${r}/${e.options.maxLength} (最少${e.options.minLength})`:n?`${r}/${e.options.maxLength}`:`最少${e.options.minLength}字符`})})]})},Iye=e=>{const[t,n]=te.useState(!1);return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsxs("div",{className:"relative",children:[N.jsx("input",{type:t?"text":"password",className:"w-full px-3 py-2 pr-10 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors",value:e.value||"",onChange:r=>e.onChange(r.target.value),placeholder:e.placeholder,disabled:e.disabled}),N.jsx("button",{type:"button",className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",onClick:()=>n(!t),children:t?N.jsx(bX,{size:16}):N.jsx(_X,{size:16})})]}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},Pye=e=>{var i,a,o,l,c;const t=(i=e.options)==null?void 0:i.minLength,n=(a=e.options)==null?void 0:a.maxLength,r=((o=e.value)==null?void 0:o.length)||0;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("textarea",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors resize-vertical",value:e.value||"",onChange:f=>e.onChange(f.target.value),placeholder:e.placeholder,disabled:e.disabled,rows:((l=e.options)==null?void 0:l.rows)||4,maxLength:n?e.options.maxLength:void 0}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description}),(t||n)&&N.jsx("div",{className:"flex justify-end mt-1",children:N.jsx("span",{className:`text-xs ${r>(((c=e.options)==null?void 0:c.maxLength)||0)?"text-red-500":"text-gray-400"}`,children:t&&n?`${r}/${e.options.maxLength} (最少${e.options.minLength})`:n?`${r}/${e.options.maxLength}`:`最少${e.options.minLength}字符`})})]})},Lye=e=>{var t,n;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsxs("div",{className:"relative",children:[N.jsxs("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors appearance-none",value:e.value||"",onChange:r=>e.onChange(r.target.value),disabled:e.disabled,children:[e.placeholder&&N.jsx("option",{value:"",disabled:!0,children:e.placeholder}),(n=(t=e.options)==null?void 0:t.enumOptions)==null?void 0:n.map((r,i)=>N.jsx("option",{value:r.value,children:r.label},i))]}),N.jsx(L5,{size:16,className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 pointer-events-none"})]}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},zye=e=>{var t,n;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("div",{className:"space-y-2",children:(n=(t=e.options)==null?void 0:t.enumOptions)==null?void 0:n.map((r,i)=>{var a;return N.jsxs("label",{className:"flex items-center",children:[N.jsx("input",{type:"checkbox",className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 focus:ring-2",checked:((a=e.value)==null?void 0:a.includes(r.value))||!1,onChange:o=>{const l=e.value||[];o.target.checked?e.onChange([...l,r.value]):e.onChange(l.filter(c=>c!==r.value))},disabled:e.disabled}),N.jsx("span",{className:"ml-2 text-sm text-gray-700",children:r.label})]},i)})}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},qye=e=>{var t,n;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("div",{className:"space-y-2",children:(n=(t=e.options)==null?void 0:t.enumOptions)==null?void 0:n.map((r,i)=>N.jsxs("label",{className:"flex items-center",children:[N.jsx("input",{type:"radio",name:e.id,className:"w-4 h-4 text-blue-600 border-gray-300 focus:ring-blue-500 focus:ring-2",value:r.value,checked:e.value===r.value,onChange:a=>e.onChange(a.target.value),disabled:e.disabled}),N.jsx("span",{className:"ml-2 text-sm text-gray-700",children:r.label})]},i))}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},Fye=e=>{var t,n,r;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("input",{type:"number",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors",value:e.value||"",onChange:i=>e.onChange(Number(i.target.value)),placeholder:e.placeholder,disabled:e.disabled,min:(t=e.options)==null?void 0:t.min,max:(n=e.options)==null?void 0:n.max,step:(r=e.options)==null?void 0:r.step}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},Bye=e=>{var t,n,r,i,a,o;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsxs("div",{className:"px-2",children:[N.jsx("input",{type:"range",className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer slider",value:e.value||((t=e.options)==null?void 0:t.min)||0,onChange:l=>e.onChange(Number(l.target.value)),disabled:e.disabled,min:((n=e.options)==null?void 0:n.min)||0,max:((r=e.options)==null?void 0:r.max)||100,step:((i=e.options)==null?void 0:i.step)||1}),N.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mt-1",children:[N.jsx("span",{children:((a=e.options)==null?void 0:a.min)||0}),N.jsx("span",{className:"font-medium text-blue-600",children:e.value}),N.jsx("span",{children:((o=e.options)==null?void 0:o.max)||100})]})]}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},Uye=e=>N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("input",{type:"date",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors",value:e.value||"",onChange:t=>e.onChange(t.target.value),disabled:e.disabled}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]}),Vye=e=>N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("input",{type:"datetime-local",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors",value:e.value||"",onChange:t=>e.onChange(t.target.value),disabled:e.disabled}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]}),Hye=e=>N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"flex items-center",children:[N.jsx("input",{type:"checkbox",className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 focus:ring-2 mr-2",checked:e.value||!1,onChange:t=>e.onChange(t.target.checked),disabled:e.disabled}),N.jsxs("span",{className:"text-sm text-gray-700",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})]}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:e.description})]}),Gye=e=>{const t=n=>{const r=n.target.files;e.multiple?e.onChange(r):e.onChange((r==null?void 0:r[0])||null)};return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("input",{type:"file",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors file:mr-3 file:py-1 file:px-3 file:border-0 file:bg-blue-50 file:text-blue-700 file:rounded file:font-medium",onChange:t,disabled:e.disabled,multiple:e.multiple,accept:e.accept}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},Yye=e=>N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsxs("div",{className:"space-y-2",children:[e.items.map((t,n)=>N.jsxs("div",{className:"flex items-start gap-2 p-3 border border-gray-200 rounded-lg",children:[N.jsx("div",{className:"flex-1",children:t.children}),N.jsx("button",{type:"button",className:"p-1 text-red-500 hover:text-red-700 hover:bg-red-50 rounded",onClick:()=>e.onDropIndexClick(n)(),children:N.jsx(z5,{size:16})})]},n)),N.jsxs("button",{type:"button",className:"flex items-center gap-1 px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg transition-colors",onClick:()=>e.onAddClick(),children:[N.jsx($X,{size:14}),"添加项目"]})]}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]}),Zye=e=>N.jsx("div",{className:`${e.className} mb-4`,children:e.children}),Kye=e=>N.jsxs("div",{className:"mb-4",children:[e.title&&N.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:e.title}),N.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 pl-4 border-l-2 border-gray-200",children:e.properties.map(t=>N.jsx("div",{children:t.content},t.name))}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]}),YI=e=>N.jsx("button",{type:"submit",className:"px-4 py-2 rounded-lg bg-blue-500 hover:bg-blue-600 disabled:bg-gray-300 text-white font-medium focus:outline-none focus:ring-2 focus:ring-blue-400 transition-colors disabled:cursor-not-allowed",disabled:e.disabled,children:e.submitText||"提交"}),Xye=a3({name:"show_form",description:"显示动态表单,等待用户填写",parameters:{schema:Wq()},onlyRender:!1,handler:s3.waitForUIDone,render(e){const t=e.getInputRepaired(),n=e.getJSONOutputSafe(),r=t.schema,i=c=>{console.log("Form submitted:",c),e.response(c)},a={text:Dye,password:Iye,textarea:Pye,select:Lye,checkboxes:zye,radio:qye,number:Fye,range:Bye,date:Uye,datetime:Vye,file:Gye,boolean:Hye},o={array:Yye},l={FieldTemplate:Zye,ObjectFieldTemplate:Kye,ButtonTemplates:{SubmitButton:YI}};return N.jsxs("div",{className:"p-4 bg-white rounded-lg border border-gray-200",children:[N.jsxs("div",{className:"flex items-center gap-1.5 text-gray-700 mb-3 font-bold",children:[N.jsx(EX,{className:"w-4 h-4 text-blue-500"}),N.jsx("span",{children:"AI 表单"})]}),N.jsx(mge,{children:N.jsx(pge,{readonly:e.state==="done",schema:r,formData:n,onSubmit:c=>i(c.formData),validator:$ye,onError:c=>{console.error("表单校验错误:",c),alert("表单填写有误,请检查后再提交。")},widgets:a,fields:o,templates:l,className:"custom-form",children:N.jsx("div",{className:"flex gap-2 mt-4",children:N.jsx(YI,{})})})})]})}}),Wye=a3({name:"create_artifacts",description:"创建并保存代码文件到 artifacts 目录",parameters:{},onlyRender:!0,render(e){const t=e.getInputRepaired(),{setCurrentArtifactById:n,currentArtifact:r}=zp(),i=()=>{n(e.message.id)};return N.jsxs("div",{className:"p-4 space-y-4",children:[N.jsxs("div",{className:"text-sm text-gray-500",children:["创建文件: ",t.filename,".",t.filetype]}),N.jsx("div",{className:"border rounded-lg p-2 hover:bg-gray-50",children:N.jsxs("div",{className:"flex items-center justify-between select-none cursor-pointer",onClick:i,children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx(AX,{className:"w-4 h-4"}),N.jsx("span",{className:"font-xs",children:t.filename})]}),N.jsxs("span",{className:"text-gray-400",children:[t.filetype," ",(r==null?void 0:r.id)===e.message.id?"▼":"▶"]})]})})]})}}),Qye=()=>{const{renderMessages:e,loading:t,inChatError:n,client:r,collapsedTools:i,toggleToolCollapse:a,isFELocking:o}=Ts(),l=te.useRef(null),c=te.useRef(null),f=()=>{if(!c.current)return!1;const h=c.current,m=h.scrollTop+h.clientHeight;return h.scrollHeight-m<=50},d=()=>{var h;(h=l.current)==null||h.scrollIntoView({behavior:"instant"})};return te.useEffect(()=>{e.length>0&&c.current&&(t||d(),t&&f()&&d())},[e]),N.jsxs("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-4",ref:c,children:[N.jsx(I5,{renderMessages:e,collapsedTools:i,toggleToolCollapse:a,client:r}),t&&!o()&&N.jsxs("div",{className:"flex items-center justify-center py-4 text-gray-500",children:[N.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-blue-500 border-t-transparent mr-2"}),"正在思考中..."]}),n&&N.jsx("div",{className:"p-4 text-sm text-red-600 bg-red-50 rounded-lg border border-red-200",children:JSON.stringify(n)}),N.jsx("div",{ref:l})]})},Jye=()=>{const{userInput:e,setUserInput:t,loading:n,sendMessage:r,stopGeneration:i,currentAgent:a,setCurrentAgent:o,client:l,currentChatId:c}=Ts(),{extraParams:f}=F5(),[d,h]=te.useState([]),m=b=>{h(_=>[..._,{type:"image_url",image_url:{url:b}}])},g=b=>{localStorage.setItem("agent_name",b),o(b)},v=()=>{const b=[{type:"human",content:[{type:"text",text:e},...d]}];r(b,{extraParams:f}),h([])},w=b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),v())};return N.jsxs("div",{className:"border-t border-gray-200 p-4",children:[N.jsxs("div",{className:"flex items-center justify-between mb-4",children:[N.jsx(GX,{onFileUploaded:m}),N.jsx("select",{value:a,onChange:b=>g(b.target.value),className:"px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:l==null?void 0:l.availableAssistants.map(b=>N.jsx("option",{value:b.graph_id,children:b.name},b.graph_id))})]}),N.jsxs("div",{className:"flex gap-2",children:[N.jsx("textarea",{className:"flex-1 p-3 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",rows:2,value:e,onChange:b=>t(b.target.value),onKeyDown:w,placeholder:"输入消息...",disabled:n}),N.jsx("button",{className:`px-4 py-2 text-sm font-medium text-white rounded-lg focus:outline-none focus:ring-2 focus:ring-offset-2 ${n?"bg-red-500 hover:bg-red-600 focus:ring-red-500":"bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed"}`,onClick:()=>n?i():v(),disabled:!n&&!e.trim()&&d.length===0,children:n?"中断":"发送"})]}),N.jsxs("div",{className:"flex border-b border-gray-200 mt-4 gap-2 justify-between",children:[N.jsx(Qw,{usage_metadata:(l==null?void 0:l.tokenCounter)||{}}),N.jsxs("span",{className:"text-sm text-gray-500",children:["会话 ID: ",c]})]})]})},e0e=()=>{const[e,t]=te.useState(!1),{showHistory:n,toggleHistoryVisible:r,showGraph:i,toggleGraphVisible:a,renderMessages:o,setTools:l,client:c}=Ts(),{extraParams:f,setExtraParams:d}=F5(),{showArtifact:h,setShowArtifact:m}=zp();return te.useEffect(()=>{l([Xye,Wye])},[]),N.jsxs("div",{className:"langgraph-chat-container flex h-full w-full overflow-hidden",children:[n&&N.jsx(BX,{onClose:()=>r(),formatTime:QF}),N.jsxs("div",{className:"flex-1 flex flex-col overflow-auto",children:[N.jsxs("div",{className:"flex items-center gap-2 p-4 border-b border-gray-200 justify-end h-16",children:[N.jsxs("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{r(),mO({showHistory:!n})},children:[N.jsx(CX,{className:"w-4 h-4"}),"历史记录"]}),N.jsx("div",{className:"flex-1"}),N.jsxs("button",{onClick:()=>t(!0),className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",children:[N.jsx(wX,{className:"w-4 h-4"}),"编辑参数"]}),N.jsx("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{console.log(o)},children:"打印日志数据"}),N.jsx("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{console.log(c==null?void 0:c.graphState)},children:"打印 State"}),N.jsxs("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{a(),mO({showGraph:!i})},children:[N.jsx(jX,{className:"w-4 h-4"}),"节点图"]}),N.jsxs("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{localStorage.setItem("code",""),location.reload()},children:[N.jsx(NX,{className:"w-4 h-4"}),"退出登陆"]})]}),N.jsx(Qye,{}),N.jsx(Jye,{}),N.jsx(YX,{isOpen:e,initialJson:f,onClose:()=>t(!1),onSave:d})]}),(i||h)&&N.jsxs("div",{className:"overflow-hidden flex-1",children:[i&&N.jsx(jie,{}),h&&N.jsx(Zie,{})]})]})},t0e=()=>N.jsx(rK,{children:N.jsx(UX,{children:N.jsx(Gie,{children:N.jsx(e0e,{})})})}),n0e=()=>{const[e,t]=te.useState([{key:"authorization",value:""}]),[n,r]=te.useState(localStorage.getItem("withCredentials")==="true"),[i,a]=te.useState(localStorage.getItem("apiUrl")||""),o=()=>{t([...e,{key:"",value:""}])},l=d=>{t(e.filter((h,m)=>m!==d))},c=(d,h,m)=>{const g=[...e];g[d][h]=m,t(g)},f=()=>{const d=Object.fromEntries(e.map(h=>[h.key,h.value]));localStorage.setItem("code",JSON.stringify(d)),localStorage.setItem("withCredentials",JSON.stringify(n)),localStorage.setItem("apiUrl",i),location.reload()};return N.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 to-gray-100 flex items-center justify-center p-4",children:N.jsx("div",{className:"w-full max-w-4xl bg-white rounded-2xl shadow-xl overflow-hidden",children:N.jsxs("div",{className:"grid md:grid-cols-2",children:[N.jsx("div",{className:"hidden md:block bg-gradient-to-br from-blue-600 to-blue-800 p-12 text-white",children:N.jsxs("div",{className:"h-full flex flex-col justify-between",children:[N.jsxs("div",{children:[N.jsx("h1",{className:"text-4xl font-bold mb-6",children:"LangGraph UI"}),N.jsx("p",{className:"text-blue-100 text-lg leading-relaxed",children:"专业的 LangGraph 可视化界面,让您的 AI 应用开发更加高效和直观。"})]}),N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center",children:N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})})}),N.jsx("span",{children:"直观的可视化界面"})]}),N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center",children:N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),N.jsx("span",{children:"高效的开发体验"})]}),N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center",children:N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),N.jsx("span",{children:"安全可靠的配置"})]})]})]})}),N.jsxs("div",{className:"p-8 md:p-12",children:[N.jsxs("div",{className:"md:hidden mb-8",children:[N.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"LangGraph UI"}),N.jsx("p",{className:"text-gray-600 mt-2",children:"专业的 LangGraph 可视化界面"})]}),N.jsxs("form",{onSubmit:d=>{d.preventDefault(),f()},className:"space-y-6",children:[N.jsxs("div",{children:[N.jsx("label",{htmlFor:"api-url",className:"block text-sm font-medium text-gray-700 mb-2",children:"API URL"}),N.jsx("input",{type:"text",id:"api-url",value:i,onChange:d=>a(d.target.value),placeholder:"例如: http://localhost:8123",className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"})]}),N.jsxs("div",{children:[N.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"请求头配置"}),e.map((d,h)=>N.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[N.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[N.jsx("div",{children:N.jsx("input",{type:"text",id:`header-key-${h}`,value:d.key,onChange:m=>c(h,"key",m.target.value),placeholder:"例如: authorization",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"})}),N.jsx("div",{children:N.jsx("input",{type:"text",id:`header-value-${h}`,value:d.value,onChange:m=>c(h,"value",m.target.value),placeholder:"例如: Bearer token;无则填 1",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"})})]}),h>0&&N.jsxs("button",{type:"button",onClick:()=>l(h),className:"text-red-600 hover:text-red-700 text-sm font-medium flex items-center space-x-1 transition-colors",children:[N.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),N.jsx("span",{children:"删除此请求头"})]})]},h))]}),N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("input",{type:"checkbox",id:"with-credentials",checked:n,onChange:d=>r(d.target.checked),className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),N.jsx("label",{htmlFor:"with-credentials",className:"text-sm text-gray-700",children:"启用 withCredentials(跨域请求时发送 Cookie)"})]}),N.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 pt-4",children:[N.jsxs("button",{type:"button",onClick:o,className:"flex-1 px-6 py-3 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors font-medium flex items-center justify-center space-x-2",children:[N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),N.jsx("span",{children:"添加请求头"})]}),N.jsxs("button",{type:"submit",className:"flex-1 px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium flex items-center justify-center space-x-2",children:[N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),N.jsx("span",{children:"保存配置"})]})]})]})]})]})})})};function r0e(){const[e,t]=te.useState(localStorage.getItem("code"));return N.jsx(N.Fragment,{children:e?N.jsx(t0e,{}):N.jsx(n0e,{})})}gq.createRoot(document.getElementById("root")).render(N.jsx(r0e,{}))});export default i0e();
|
|
268
|
+
deps: ${d}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[f,d]=a(c);o(c,f),l(c,d)}};function a({schema:c}){const f={},d={};for(const h in c){if(h==="__proto__")continue;const m=Array.isArray(c[h])?f:d;m[h]=c[h]}return[f,d]}function o(c,f=c.schema){const{gen:d,data:h,it:m}=c;if(Object.keys(f).length===0)return;const g=d.let("missing");for(const v in f){const w=f[v];if(w.length===0)continue;const b=(0,r.propertyInData)(d,h,v,m.opts.ownProperties);c.setParams({property:v,depsCount:w.length,deps:w.join(", ")}),m.allErrors?d.if(b,()=>{for(const _ of w)(0,r.checkReportMissingProp)(c,_)}):(d.if((0,t._)`${b} && (${(0,r.checkMissingProp)(c,w,g)})`),(0,r.reportMissingProp)(c,g),d.else())}}e.validatePropertyDeps=o;function l(c,f=c.schema){const{gen:d,data:h,keyword:m,it:g}=c,v=d.name("valid");for(const w in f)(0,n.alwaysValidSchema)(g,f[w])||(d.if((0,r.propertyInData)(d,h,w,g.opts.ownProperties),()=>{const b=c.subschema({keyword:m,schemaProp:w},v);c.mergeValidEvaluated(b,v)},()=>d.var(v,!0)),c.ok(v))}e.validateSchemaDeps=l,e.default=i}(Zx)),Zx}var sh={},kI;function Qge(){if(kI)return sh;kI=1,Object.defineProperty(sh,"__esModule",{value:!0});const e=Xe(),t=ht(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:i})=>(0,e._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:a,schema:o,data:l,it:c}=i;if((0,t.alwaysValidSchema)(c,o))return;const f=a.name("valid");a.forIn("key",l,d=>{i.setParams({propertyName:d}),i.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},f),a.if((0,e.not)(f),()=>{i.error(!0),c.allErrors||a.break()})}),i.ok(f)}};return sh.default=r,sh}var oh={},AI;function JL(){if(AI)return oh;AI=1,Object.defineProperty(oh,"__esModule",{value:!0});const e=Lr(),t=Xe(),n=La(),r=ht(),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:o})=>(0,t._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:l,schema:c,parentSchema:f,data:d,errsCount:h,it:m}=o;if(!h)throw new Error("ajv implementation error");const{allErrors:g,opts:v}=m;if(m.props=!0,v.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(m,c))return;const w=(0,e.allSchemaProperties)(f.properties),b=(0,e.allSchemaProperties)(f.patternProperties);_(),o.ok((0,t._)`${h} === ${n.default.errors}`);function _(){l.forIn("key",d,T=>{!w.length&&!b.length?A(T):l.if(S(T),()=>A(T))})}function S(T){let O;if(w.length>8){const $=(0,r.schemaRefOrVal)(m,f.properties,"properties");O=(0,e.isOwnProperty)(l,$,T)}else w.length?O=(0,t.or)(...w.map($=>(0,t._)`${T} === ${$}`)):O=t.nil;return b.length&&(O=(0,t.or)(O,...b.map($=>(0,t._)`${(0,e.usePattern)(o,$)}.test(${T})`))),(0,t.not)(O)}function x(T){l.code((0,t._)`delete ${d}[${T}]`)}function A(T){if(v.removeAdditional==="all"||v.removeAdditional&&c===!1){x(T);return}if(c===!1){o.setParams({additionalProperty:T}),o.error(),g||l.break();return}if(typeof c=="object"&&!(0,r.alwaysValidSchema)(m,c)){const O=l.name("valid");v.removeAdditional==="failing"?(k(T,O,!1),l.if((0,t.not)(O),()=>{o.reset(),x(T)})):(k(T,O),g||l.if((0,t.not)(O),()=>l.break()))}}function k(T,O,$){const L={keyword:"additionalProperties",dataProp:T,dataPropType:r.Type.Str};$===!1&&Object.assign(L,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(L,O)}}};return oh.default=a,oh}var lh={},TI;function Jge(){if(TI)return lh;TI=1,Object.defineProperty(lh,"__esModule",{value:!0});const e=gm(),t=Lr(),n=ht(),r=JL(),i={keyword:"properties",type:"object",schemaType:"object",code(a){const{gen:o,schema:l,parentSchema:c,data:f,it:d}=a;d.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&r.default.code(new e.KeywordCxt(d,r.default,"additionalProperties"));const h=(0,t.allSchemaProperties)(l);for(const b of h)d.definedProperties.add(b);d.opts.unevaluated&&h.length&&d.props!==!0&&(d.props=n.mergeEvaluated.props(o,(0,n.toHash)(h),d.props));const m=h.filter(b=>!(0,n.alwaysValidSchema)(d,l[b]));if(m.length===0)return;const g=o.name("valid");for(const b of m)v(b)?w(b):(o.if((0,t.propertyInData)(o,f,b,d.opts.ownProperties)),w(b),d.allErrors||o.else().var(g,!0),o.endIf()),a.it.definedProperties.add(b),a.ok(g);function v(b){return d.opts.useDefaults&&!d.compositeRule&&l[b].default!==void 0}function w(b){a.subschema({keyword:"properties",schemaProp:b,dataProp:b},g)}}};return lh.default=i,lh}var uh={},CI;function eye(){if(CI)return uh;CI=1,Object.defineProperty(uh,"__esModule",{value:!0});const e=Lr(),t=Xe(),n=ht(),r=ht(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(a){const{gen:o,schema:l,data:c,parentSchema:f,it:d}=a,{opts:h}=d,m=(0,e.allSchemaProperties)(l),g=m.filter(A=>(0,n.alwaysValidSchema)(d,l[A]));if(m.length===0||g.length===m.length&&(!d.opts.unevaluated||d.props===!0))return;const v=h.strictSchema&&!h.allowMatchingProperties&&f.properties,w=o.name("valid");d.props!==!0&&!(d.props instanceof t.Name)&&(d.props=(0,r.evaluatedPropsToName)(o,d.props));const{props:b}=d;_();function _(){for(const A of m)v&&S(A),d.allErrors?x(A):(o.var(w,!0),x(A),o.if(w))}function S(A){for(const k in v)new RegExp(A).test(k)&&(0,n.checkStrictMode)(d,`property ${k} matches pattern ${A} (use allowMatchingProperties)`)}function x(A){o.forIn("key",c,k=>{o.if((0,t._)`${(0,e.usePattern)(a,A)}.test(${k})`,()=>{const T=g.includes(A);T||a.subschema({keyword:"patternProperties",schemaProp:A,dataProp:k,dataPropType:r.Type.Str},w),d.opts.unevaluated&&b!==!0?o.assign((0,t._)`${b}[${k}]`,!0):!T&&!d.allErrors&&o.if((0,t.not)(w),()=>o.break())})})}}};return uh.default=i,uh}var ch={},OI;function tye(){if(OI)return ch;OI=1,Object.defineProperty(ch,"__esModule",{value:!0});const e=ht(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:i,it:a}=n;if((0,e.alwaysValidSchema)(a,i)){n.fail();return}const o=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),n.failResult(o,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return ch.default=t,ch}var fh={},NI;function nye(){if(NI)return fh;NI=1,Object.defineProperty(fh,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Lr().validateUnion,error:{message:"must match a schema in anyOf"}};return fh.default=t,fh}var dh={},RI;function rye(){if(RI)return dh;RI=1,Object.defineProperty(dh,"__esModule",{value:!0});const e=Xe(),t=ht(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:a,schema:o,parentSchema:l,it:c}=i;if(!Array.isArray(o))throw new Error("ajv implementation error");if(c.opts.discriminator&&l.discriminator)return;const f=o,d=a.let("valid",!1),h=a.let("passing",null),m=a.name("_valid");i.setParams({passing:h}),a.block(g),i.result(d,()=>i.reset(),()=>i.error(!0));function g(){f.forEach((v,w)=>{let b;(0,t.alwaysValidSchema)(c,v)?a.var(m,!0):b=i.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},m),w>0&&a.if((0,e._)`${m} && ${d}`).assign(d,!1).assign(h,(0,e._)`[${h}, ${w}]`).else(),a.if(m,()=>{a.assign(d,!0),a.assign(h,w),b&&i.mergeEvaluated(b,e.Name)})})}}};return dh.default=r,dh}var hh={},jI;function iye(){if(jI)return hh;jI=1,Object.defineProperty(hh,"__esModule",{value:!0});const e=ht(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:i,it:a}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");const o=r.name("valid");i.forEach((l,c)=>{if((0,e.alwaysValidSchema)(a,l))return;const f=n.subschema({keyword:"allOf",schemaProp:c},o);n.ok(o),n.mergeEvaluated(f)})}};return hh.default=t,hh}var ph={},MI;function aye(){if(MI)return ph;MI=1,Object.defineProperty(ph,"__esModule",{value:!0});const e=Xe(),t=ht(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:a})=>(0,e.str)`must match "${a.ifClause}" schema`,params:({params:a})=>(0,e._)`{failingKeyword: ${a.ifClause}}`},code(a){const{gen:o,parentSchema:l,it:c}=a;l.then===void 0&&l.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const f=i(c,"then"),d=i(c,"else");if(!f&&!d)return;const h=o.let("valid",!0),m=o.name("_valid");if(g(),a.reset(),f&&d){const w=o.let("ifClause");a.setParams({ifClause:w}),o.if(m,v("then",w),v("else",w))}else f?o.if(m,v("then")):o.if((0,e.not)(m),v("else"));a.pass(h,()=>a.error(!0));function g(){const w=a.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},m);a.mergeEvaluated(w)}function v(w,b){return()=>{const _=a.subschema({keyword:w},m);o.assign(h,m),a.mergeValidEvaluated(_,h),b?o.assign(b,(0,e._)`${w}`):a.setParams({ifClause:w})}}}};function i(a,o){const l=a.schema[o];return l!==void 0&&!(0,t.alwaysValidSchema)(a,l)}return ph.default=r,ph}var mh={},$I;function sye(){if($I)return mh;$I=1,Object.defineProperty(mh,"__esModule",{value:!0});const e=ht(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:i}){r.if===void 0&&(0,e.checkStrictMode)(i,`"${n}" without "if" is ignored`)}};return mh.default=t,mh}var DI;function oye(){if(DI)return nh;DI=1,Object.defineProperty(nh,"__esModule",{value:!0});const e=WL(),t=Zge(),n=QL(),r=Kge(),i=Xge(),a=Wge(),o=Qge(),l=JL(),c=Jge(),f=eye(),d=tye(),h=nye(),m=rye(),g=iye(),v=aye(),w=sye();function b(_=!1){const S=[d.default,h.default,m.default,g.default,v.default,w.default,o.default,l.default,a.default,c.default,f.default];return _?S.push(t.default,r.default):S.push(e.default,n.default),S.push(i.default),S}return nh.default=b,nh}var gh={},yh={},II;function lye(){if(II)return yh;II=1,Object.defineProperty(yh,"__esModule",{value:!0});const e=Xe(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,i){const{gen:a,data:o,$data:l,schema:c,schemaCode:f,it:d}=r,{opts:h,errSchemaPath:m,schemaEnv:g,self:v}=d;if(!h.validateFormats)return;l?w():b();function w(){const _=a.scopeValue("formats",{ref:v.formats,code:h.code.formats}),S=a.const("fDef",(0,e._)`${_}[${f}]`),x=a.let("fType"),A=a.let("format");a.if((0,e._)`typeof ${S} == "object" && !(${S} instanceof RegExp)`,()=>a.assign(x,(0,e._)`${S}.type || "string"`).assign(A,(0,e._)`${S}.validate`),()=>a.assign(x,(0,e._)`"string"`).assign(A,S)),r.fail$data((0,e.or)(k(),T()));function k(){return h.strictSchema===!1?e.nil:(0,e._)`${f} && !${A}`}function T(){const O=g.$async?(0,e._)`(${S}.async ? await ${A}(${o}) : ${A}(${o}))`:(0,e._)`${A}(${o})`,$=(0,e._)`(typeof ${A} == "function" ? ${O} : ${A}.test(${o}))`;return(0,e._)`${A} && ${A} !== true && ${x} === ${i} && !${$}`}}function b(){const _=v.formats[c];if(!_){k();return}if(_===!0)return;const[S,x,A]=T(_);S===i&&r.pass(O());function k(){if(h.strictSchema===!1){v.logger.warn($());return}throw new Error($());function $(){return`unknown format "${c}" ignored in schema at path "${m}"`}}function T($){const L=$ instanceof RegExp?(0,e.regexpCode)($):h.code.formats?(0,e._)`${h.code.formats}${(0,e.getProperty)(c)}`:void 0,M=a.scopeValue("formats",{key:c,ref:$,code:L});return typeof $=="object"&&!($ instanceof RegExp)?[$.type||"string",$.validate,(0,e._)`${M}.validate`]:["string",$,M]}function O(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!g.$async)throw new Error("async format in sync schema");return(0,e._)`await ${A}(${o})`}return typeof x=="function"?(0,e._)`${A}(${o})`:(0,e._)`${A}.test(${o})`}}}};return yh.default=n,yh}var PI;function uye(){if(PI)return gh;PI=1,Object.defineProperty(gh,"__esModule",{value:!0});const t=[lye().default];return gh.default=t,gh}var os={},LI;function cye(){return LI||(LI=1,Object.defineProperty(os,"__esModule",{value:!0}),os.contentVocabulary=os.metadataVocabulary=void 0,os.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],os.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),os}var zI;function fye(){if(zI)return qd;zI=1,Object.defineProperty(qd,"__esModule",{value:!0});const e=Dge(),t=Yge(),n=oye(),r=uye(),i=cye(),a=[e.default,t.default,(0,n.default)(),r.default,i.metadataVocabulary,i.contentVocabulary];return qd.default=a,qd}var bh={},Du={},qI;function dye(){if(qI)return Du;qI=1,Object.defineProperty(Du,"__esModule",{value:!0}),Du.DiscrError=void 0;var e;return function(t){t.Tag="tag",t.Mapping="mapping"}(e||(Du.DiscrError=e={})),Du}var FI;function hye(){if(FI)return bh;FI=1,Object.defineProperty(bh,"__esModule",{value:!0});const e=Xe(),t=dye(),n=qE(),r=ym(),i=ht(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:l,tagName:c}})=>l===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:l,tag:c,tagName:f}})=>(0,e._)`{error: ${l}, tag: ${f}, tagValue: ${c}}`},code(l){const{gen:c,data:f,schema:d,parentSchema:h,it:m}=l,{oneOf:g}=h;if(!m.opts.discriminator)throw new Error("discriminator: requires discriminator option");const v=d.propertyName;if(typeof v!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!g)throw new Error("discriminator: requires oneOf keyword");const w=c.let("valid",!1),b=c.const("tag",(0,e._)`${f}${(0,e.getProperty)(v)}`);c.if((0,e._)`typeof ${b} == "string"`,()=>_(),()=>l.error(!1,{discrError:t.DiscrError.Tag,tag:b,tagName:v})),l.ok(w);function _(){const A=x();c.if(!1);for(const k in A)c.elseIf((0,e._)`${b} === ${k}`),c.assign(w,S(A[k]));c.else(),l.error(!1,{discrError:t.DiscrError.Mapping,tag:b,tagName:v}),c.endIf()}function S(A){const k=c.name("valid"),T=l.subschema({keyword:"oneOf",schemaProp:A},k);return l.mergeEvaluated(T,e.Name),k}function x(){var A;const k={},T=$(h);let O=!0;for(let z=0;z<g.length;z++){let P=g[z];if(P!=null&&P.$ref&&!(0,i.schemaHasRulesButRef)(P,m.self.RULES)){const D=P.$ref;if(P=n.resolveRef.call(m.self,m.schemaEnv.root,m.baseId,D),P instanceof n.SchemaEnv&&(P=P.schema),P===void 0)throw new r.default(m.opts.uriResolver,m.baseId,D)}const q=(A=P==null?void 0:P.properties)===null||A===void 0?void 0:A[v];if(typeof q!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${v}"`);O=O&&(T||$(P)),L(q,z)}if(!O)throw new Error(`discriminator: "${v}" must be required`);return k;function $({required:z}){return Array.isArray(z)&&z.includes(v)}function L(z,P){if(z.const)M(z.const,P);else if(z.enum)for(const q of z.enum)M(q,P);else throw new Error(`discriminator: "properties/${v}" must have "const" or "enum"`)}function M(z,P){if(typeof z!="string"||z in k)throw new Error(`discriminator: "${v}" values must be unique strings`);k[z]=P}}}};return bh.default=o,bh}const pye="http://json-schema.org/draft-07/schema#",mye="http://json-schema.org/draft-07/schema#",gye="Core schema meta-schema",yye={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},bye=["object","boolean"],vye={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},_ye={$schema:pye,$id:mye,title:gye,definitions:yye,type:bye,properties:vye,default:!0};var BI;function e8(){return BI||(BI=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=jge(),r=fye(),i=hye(),a=_ye,o=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(a,o):a;this.addMetaSchema(v,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var f=gm();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return f.KeywordCxt}});var d=Xe();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var h=zE();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var m=ym();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})}(Dd,Dd.exports)),Dd.exports}var xye=e8();const wye=zn(xye);var vh={exports:{}},Kx={},UI;function Sye(){return UI||(UI=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(L,M){return{validate:L,compare:M}}e.fullFormats={date:t(a,o),time:t(c,f),"date-time":t(h,m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:w,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:$,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:_,int32:{type:"number",validate:A},int64:{type:"number",validate:k},float:{type:"number",validate:T},double:{type:"number",validate:T},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(L){return L%4===0&&(L%100!==0||L%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(L){const M=r.exec(L);if(!M)return!1;const z=+M[1],P=+M[2],q=+M[3];return P>=1&&P<=12&&q>=1&&q<=(P===2&&n(z)?29:i[P])}function o(L,M){if(L&&M)return L>M?1:L<M?-1:0}const l=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function c(L,M){const z=l.exec(L);if(!z)return!1;const P=+z[1],q=+z[2],D=+z[3],H=z[5];return(P<=23&&q<=59&&D<=59||P===23&&q===59&&D===60)&&(!M||H!=="")}function f(L,M){if(!(L&&M))return;const z=l.exec(L),P=l.exec(M);if(z&&P)return L=z[1]+z[2]+z[3]+(z[4]||""),M=P[1]+P[2]+P[3]+(P[4]||""),L>M?1:L<M?-1:0}const d=/t|\s/i;function h(L){const M=L.split(d);return M.length===2&&a(M[0])&&c(M[1],!0)}function m(L,M){if(!(L&&M))return;const[z,P]=L.split(d),[q,D]=M.split(d),H=o(z,q);if(H!==void 0)return H||f(P,D)}const g=/\/|:/,v=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function w(L){return g.test(L)&&v.test(L)}const b=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function _(L){return b.lastIndex=0,b.test(L)}const S=-2147483648,x=2**31-1;function A(L){return Number.isInteger(L)&&L<=x&&L>=S}function k(L){return Number.isInteger(L)}function T(){return!0}const O=/[^\\]\\Z/;function $(L){if(O.test(L))return!1;try{return new RegExp(L),!0}catch{return!1}}}(Kx)),Kx}var Xx={},VI;function Eye(){return VI||(VI=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=e8(),n=Xe(),r=n.operators,i={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},a={message:({keyword:l,schemaCode:c})=>n.str`should be ${i[l].okStr} ${c}`,params:({keyword:l,schemaCode:c})=>n._`{comparison: ${i[l].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:a,code(l){const{gen:c,data:f,schemaCode:d,keyword:h,it:m}=l,{opts:g,self:v}=m;if(!g.validateFormats)return;const w=new t.KeywordCxt(m,v.RULES.all.format.definition,"format");w.$data?b():_();function b(){const x=c.scopeValue("formats",{ref:v.formats,code:g.code.formats}),A=c.const("fmt",n._`${x}[${w.schemaCode}]`);l.fail$data(n.or(n._`typeof ${A} != "object"`,n._`${A} instanceof RegExp`,n._`typeof ${A}.compare != "function"`,S(A)))}function _(){const x=w.schema,A=v.formats[x];if(!A||A===!0)return;if(typeof A!="object"||A instanceof RegExp||typeof A.compare!="function")throw new Error(`"${h}": format "${x}" does not define "compare" function`);const k=c.scopeValue("formats",{key:x,ref:A,code:g.code.formats?n._`${g.code.formats}${n.getProperty(x)}`:void 0});l.fail$data(S(k))}function S(x){return n._`${x}.compare(${f}, ${d}) ${i[h].fail} 0`}},dependencies:["format"]};const o=l=>(l.addKeyword(e.formatLimitDefinition),l);e.default=o}(Xx)),Xx}var HI;function kye(){return HI||(HI=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=Sye(),r=Eye(),i=Xe(),a=new i.Name("fullFormats"),o=new i.Name("fastFormats"),l=(f,d={keywords:!0})=>{if(Array.isArray(d))return c(f,d,n.fullFormats,a),f;const[h,m]=d.mode==="fast"?[n.fastFormats,o]:[n.fullFormats,a],g=d.formats||n.formatNames;return c(f,g,h,m),d.keywords&&r.default(f),f};l.get=(f,d="full")=>{const m=(d==="fast"?n.fastFormats:n.fullFormats)[f];if(!m)throw new Error(`Unknown format "${f}"`);return m};function c(f,d,h,m){var g,v;(g=(v=f.opts.code).formats)!==null&&g!==void 0||(v.formats=i._`require("ajv-formats/dist/formats").${m}`);for(const w of d)f.addFormat(w,h[w])}e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l}(vh,vh.exports)),vh.exports}var Aye=kye();const GI=zn(Aye),Tye={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},Cye=/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,Oye=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function Nye(e,t,n={},r,i=wye){const a=new i({...Tye,...n});return r?GI(a,r):r!==!1&&GI(a),a.addFormat("data-url",Oye),a.addFormat("color",Cye),a.addKeyword(Mc),a.addKeyword(PS),Array.isArray(e)&&a.addMetaSchema(e),Mt(t)&&Object.keys(t).forEach(o=>{a.addFormat(o,t[o])}),a}function Rye(e=[],t){return e.map(n=>{var r;const{instancePath:i,keyword:a,params:o,schemaPath:l,parentSchema:c,...f}=n;let{message:d=""}=f,h=i.replace(/\//g,"."),m=`${h} ${d}`.trim();const g=[...((r=o.deps)===null||r===void 0?void 0:r.split(", "))||[],o.missingProperty,o.property].filter(v=>v);if(g.length>0)g.forEach(v=>{const w=h?`${h}.${v}`:v;let b=ot(Ne(t,`${w.replace(/^\./,"")}`)).title;if(b===void 0){const _=l.replace(/\/properties\//g,"/").split("/").slice(1,-1).concat([v]);b=ot(Ne(t,_)).title}if(b)d=d.replace(`'${v}'`,`'${b}'`);else{const _=Ne(c,[Bt,v,"title"]);_&&(d=d.replace(`'${v}'`,`'${_}'`))}}),m=d;else{const v=ot(Ne(t,`${h.replace(/^\./,"")}`)).title;if(v)m=`'${v}' ${d}`.trim();else{const w=c==null?void 0:c.title;w&&(m=`'${w}' ${d}`.trim())}}return"missingProperty"in o&&(h=h?`${h}.${o.missingProperty}`:o.missingProperty),{name:a,property:h,message:d,params:o,stack:m,schemaPath:l}})}function jye(e,t,n,r,i,a,o){const{validationError:l}=t;let c=Rye(t.errors,o);l&&(c=[...c,{stack:l.message}]),typeof a=="function"&&(c=a(c,o));let f=Phe(c);if(l&&(f={...f,$schema:{__errors:[l.message]}}),typeof i!="function")return{errors:c,errorSchema:f};const d=AL(e,r,n,r,!0),h=i(d,fp(d),o),m=DE(h);return jh({errors:c,errorSchema:f},m)}class Mye{constructor(t,n){const{additionalMetaSchemas:r,customFormats:i,ajvOptionsOverrides:a,ajvFormatOptions:o,AjvClass:l}=t;this.ajv=Nye(r,i,a,o,l),this.localizer=n}reset(){this.ajv.removeSchema()}toErrorList(t,n=[]){return wc(t,n)}rawValidation(t,n){var r,i;let a,o;t[Ra]&&(o=this.ajv.getSchema(t[Ra]));try{o===void 0&&(o=this.ajv.compile(t)),o(n)}catch(c){a=c}let l;return o&&(typeof this.localizer=="function"&&(((r=o.errors)!==null&&r!==void 0?r:[]).forEach(c=>{var f;["missingProperty","property"].forEach(d=>{var h;!((h=c.params)===null||h===void 0)&&h[d]&&(c.params[d]=`'${c.params[d]}'`)}),!((f=c.params)===null||f===void 0)&&f.deps&&(c.params.deps=c.params.deps.split(", ").map(d=>`'${d}'`).join(", "))}),this.localizer(o.errors),((i=o.errors)!==null&&i!==void 0?i:[]).forEach(c=>{var f;["missingProperty","property"].forEach(d=>{var h;!((h=c.params)===null||h===void 0)&&h[d]&&(c.params[d]=c.params[d].slice(1,-1))}),!((f=c.params)===null||f===void 0)&&f.deps&&(c.params.deps=c.params.deps.split(", ").map(d=>d.slice(1,-1)).join(", "))})),l=o.errors||void 0,o.errors=null),{errors:l,validationError:a}}validateFormData(t,n,r,i,a){const o=this.rawValidation(n,t);return jye(this,o,t,n,r,i,a)}handleSchemaUpdate(t){var n,r;const i=(n=t[Ra])!==null&&n!==void 0?n:UP;this.ajv.getSchema(i)===void 0?this.ajv.addSchema(t,i):It(t,(r=this.ajv.getSchema(i))===null||r===void 0?void 0:r.schema)||(this.ajv.removeSchema(i),this.ajv.addSchema(t,i))}isValid(t,n,r){var i;try{this.handleSchemaUpdate(r);const a=IE(t),o=(i=a[Ra])!==null&&i!==void 0?i:Rhe(a);let l;return l=this.ajv.getSchema(o),l===void 0&&(l=this.ajv.addSchema(a,o).getSchema(o)||this.ajv.compile(a)),l(n)}catch(a){return console.warn("Error encountered compiling schema:",a),!1}}}function $ye(e={},t){return new Mye(e,t)}const Dye=$ye(),Iye=e=>{var i,a,o,l;const t=(i=e.options)==null?void 0:i.minLength,n=(a=e.options)==null?void 0:a.maxLength,r=((o=e.value)==null?void 0:o.length)||0;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("input",{type:"text",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors",value:e.value||"",onChange:c=>e.onChange(c.target.value),placeholder:e.placeholder,disabled:e.disabled,maxLength:n?e.options.maxLength:void 0}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description}),(t||n)&&N.jsx("div",{className:"flex justify-end mt-1",children:N.jsx("span",{className:`text-xs ${r>(((l=e.options)==null?void 0:l.maxLength)||0)?"text-red-500":"text-gray-400"}`,children:t&&n?`${r}/${e.options.maxLength} (最少${e.options.minLength})`:n?`${r}/${e.options.maxLength}`:`最少${e.options.minLength}字符`})})]})},Pye=e=>{const[t,n]=te.useState(!1);return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsxs("div",{className:"relative",children:[N.jsx("input",{type:t?"text":"password",className:"w-full px-3 py-2 pr-10 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors",value:e.value||"",onChange:r=>e.onChange(r.target.value),placeholder:e.placeholder,disabled:e.disabled}),N.jsx("button",{type:"button",className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",onClick:()=>n(!t),children:t?N.jsx(vX,{size:16}):N.jsx(xX,{size:16})})]}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},Lye=e=>{var i,a,o,l,c;const t=(i=e.options)==null?void 0:i.minLength,n=(a=e.options)==null?void 0:a.maxLength,r=((o=e.value)==null?void 0:o.length)||0;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("textarea",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors resize-vertical",value:e.value||"",onChange:f=>e.onChange(f.target.value),placeholder:e.placeholder,disabled:e.disabled,rows:((l=e.options)==null?void 0:l.rows)||4,maxLength:n?e.options.maxLength:void 0}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description}),(t||n)&&N.jsx("div",{className:"flex justify-end mt-1",children:N.jsx("span",{className:`text-xs ${r>(((c=e.options)==null?void 0:c.maxLength)||0)?"text-red-500":"text-gray-400"}`,children:t&&n?`${r}/${e.options.maxLength} (最少${e.options.minLength})`:n?`${r}/${e.options.maxLength}`:`最少${e.options.minLength}字符`})})]})},zye=e=>{var t,n;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsxs("div",{className:"relative",children:[N.jsxs("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors appearance-none",value:e.value||"",onChange:r=>e.onChange(r.target.value),disabled:e.disabled,children:[e.placeholder&&N.jsx("option",{value:"",disabled:!0,children:e.placeholder}),(n=(t=e.options)==null?void 0:t.enumOptions)==null?void 0:n.map((r,i)=>N.jsx("option",{value:r.value,children:r.label},i))]}),N.jsx(L5,{size:16,className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 pointer-events-none"})]}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},qye=e=>{var t,n;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("div",{className:"space-y-2",children:(n=(t=e.options)==null?void 0:t.enumOptions)==null?void 0:n.map((r,i)=>{var a;return N.jsxs("label",{className:"flex items-center",children:[N.jsx("input",{type:"checkbox",className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 focus:ring-2",checked:((a=e.value)==null?void 0:a.includes(r.value))||!1,onChange:o=>{const l=e.value||[];o.target.checked?e.onChange([...l,r.value]):e.onChange(l.filter(c=>c!==r.value))},disabled:e.disabled}),N.jsx("span",{className:"ml-2 text-sm text-gray-700",children:r.label})]},i)})}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},Fye=e=>{var t,n;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("div",{className:"space-y-2",children:(n=(t=e.options)==null?void 0:t.enumOptions)==null?void 0:n.map((r,i)=>N.jsxs("label",{className:"flex items-center",children:[N.jsx("input",{type:"radio",name:e.id,className:"w-4 h-4 text-blue-600 border-gray-300 focus:ring-blue-500 focus:ring-2",value:r.value,checked:e.value===r.value,onChange:a=>e.onChange(a.target.value),disabled:e.disabled}),N.jsx("span",{className:"ml-2 text-sm text-gray-700",children:r.label})]},i))}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},Bye=e=>{var t,n,r;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("input",{type:"number",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors",value:e.value||"",onChange:i=>e.onChange(Number(i.target.value)),placeholder:e.placeholder,disabled:e.disabled,min:(t=e.options)==null?void 0:t.min,max:(n=e.options)==null?void 0:n.max,step:(r=e.options)==null?void 0:r.step}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},Uye=e=>{var t,n,r,i,a,o;return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsxs("div",{className:"px-2",children:[N.jsx("input",{type:"range",className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer slider",value:e.value||((t=e.options)==null?void 0:t.min)||0,onChange:l=>e.onChange(Number(l.target.value)),disabled:e.disabled,min:((n=e.options)==null?void 0:n.min)||0,max:((r=e.options)==null?void 0:r.max)||100,step:((i=e.options)==null?void 0:i.step)||1}),N.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mt-1",children:[N.jsx("span",{children:((a=e.options)==null?void 0:a.min)||0}),N.jsx("span",{className:"font-medium text-blue-600",children:e.value}),N.jsx("span",{children:((o=e.options)==null?void 0:o.max)||100})]})]}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},Vye=e=>N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("input",{type:"date",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors",value:e.value||"",onChange:t=>e.onChange(t.target.value),disabled:e.disabled}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]}),Hye=e=>N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("input",{type:"datetime-local",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors",value:e.value||"",onChange:t=>e.onChange(t.target.value),disabled:e.disabled}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]}),Gye=e=>N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"flex items-center",children:[N.jsx("input",{type:"checkbox",className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 focus:ring-2 mr-2",checked:e.value||!1,onChange:t=>e.onChange(t.target.checked),disabled:e.disabled}),N.jsxs("span",{className:"text-sm text-gray-700",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})]}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:e.description})]}),Yye=e=>{const t=n=>{const r=n.target.files;e.multiple?e.onChange(r):e.onChange((r==null?void 0:r[0])||null)};return N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsx("input",{type:"file",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors file:mr-3 file:py-1 file:px-3 file:border-0 file:bg-blue-50 file:text-blue-700 file:rounded file:font-medium",onChange:t,disabled:e.disabled,multiple:e.multiple,accept:e.accept}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},Zye=e=>N.jsxs("div",{className:"mb-4",children:[e.label&&N.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:[e.label,e.required&&N.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),N.jsxs("div",{className:"space-y-2",children:[e.items.map((t,n)=>N.jsxs("div",{className:"flex items-start gap-2 p-3 border border-gray-200 rounded-lg",children:[N.jsx("div",{className:"flex-1",children:t.children}),N.jsx("button",{type:"button",className:"p-1 text-red-500 hover:text-red-700 hover:bg-red-50 rounded",onClick:()=>e.onDropIndexClick(n)(),children:N.jsx(z5,{size:16})})]},n)),N.jsxs("button",{type:"button",className:"flex items-center gap-1 px-3 py-1 text-sm bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg transition-colors",onClick:()=>e.onAddClick(),children:[N.jsx(DX,{size:14}),"添加项目"]})]}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]}),Kye=e=>N.jsx("div",{className:`${e.className} mb-4`,children:e.children}),Xye=e=>N.jsxs("div",{className:"mb-4",children:[e.title&&N.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:e.title}),N.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 pl-4 border-l-2 border-gray-200",children:e.properties.map(t=>N.jsx("div",{children:t.content},t.name))}),e.description&&N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]}),YI=e=>N.jsx("button",{type:"submit",className:"px-4 py-2 rounded-lg bg-blue-500 hover:bg-blue-600 disabled:bg-gray-300 text-white font-medium focus:outline-none focus:ring-2 focus:ring-blue-400 transition-colors disabled:cursor-not-allowed",disabled:e.disabled,children:e.submitText||"提交"}),Wye=a3({name:"show_form",description:"显示动态表单,等待用户填写",parameters:{schema:Wq()},onlyRender:!1,handler:s3.waitForUIDone,render(e){const t=e.getInputRepaired(),n=e.getJSONOutputSafe(),r=t.schema,i=c=>{console.log("Form submitted:",c),e.response(c)},a={text:Iye,password:Pye,textarea:Lye,select:zye,checkboxes:qye,radio:Fye,number:Bye,range:Uye,date:Vye,datetime:Hye,file:Yye,boolean:Gye},o={array:Zye},l={FieldTemplate:Kye,ObjectFieldTemplate:Xye,ButtonTemplates:{SubmitButton:YI}};return N.jsxs("div",{className:"p-4 bg-white rounded-lg border border-gray-200",children:[N.jsxs("div",{className:"flex items-center gap-1.5 text-gray-700 mb-3 font-bold",children:[N.jsx(kX,{className:"w-4 h-4 text-blue-500"}),N.jsx("span",{children:"AI 表单"})]}),N.jsx(gge,{children:N.jsx(mge,{readonly:e.state==="done",schema:r,formData:n,onSubmit:c=>i(c.formData),validator:Dye,onError:c=>{console.error("表单校验错误:",c),alert("表单填写有误,请检查后再提交。")},widgets:a,fields:o,templates:l,className:"custom-form",children:N.jsx("div",{className:"flex gap-2 mt-4",children:N.jsx(YI,{})})})})]})}}),Qye=a3({name:"create_artifacts",description:"创建并保存代码文件到 artifacts 目录",parameters:{},onlyRender:!0,render(e){const t=e.getInputRepaired(),{setCurrentArtifactById:n,currentArtifact:r}=zp(),i=()=>{n(e.message.id)};return N.jsxs("div",{className:"p-4 space-y-4",children:[N.jsxs("div",{className:"text-sm text-gray-500",children:["创建文件: ",t.filename,".",t.filetype]}),N.jsx("div",{className:"border rounded-lg p-2 hover:bg-gray-50",children:N.jsxs("div",{className:"flex items-center justify-between select-none cursor-pointer",onClick:i,children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx(TX,{className:"w-4 h-4"}),N.jsx("span",{className:"font-xs",children:t.filename})]}),N.jsxs("span",{className:"text-gray-400",children:[t.filetype," ",(r==null?void 0:r.id)===e.message.id?"▼":"▶"]})]})})]})}}),Jye=()=>{const{renderMessages:e,loading:t,inChatError:n,client:r,collapsedTools:i,toggleToolCollapse:a,isFELocking:o}=Ts(),l=te.useRef(null),c=te.useRef(null),f=()=>{if(!c.current)return!1;const h=c.current,m=h.scrollTop+h.clientHeight;return h.scrollHeight-m<=50},d=()=>{var h;(h=l.current)==null||h.scrollIntoView({behavior:"instant"})};return te.useEffect(()=>{e.length>0&&c.current&&(t||d(),t&&f()&&d())},[e]),N.jsxs("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-4",ref:c,children:[N.jsx(I5,{renderMessages:e,collapsedTools:i,toggleToolCollapse:a,client:r}),t&&!o()&&N.jsxs("div",{className:"flex items-center justify-center py-4 text-gray-500",children:[N.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-blue-500 border-t-transparent mr-2"}),"正在思考中..."]}),n&&N.jsx("div",{className:"p-4 text-sm text-red-600 bg-red-50 rounded-lg border border-red-200",children:JSON.stringify(n)}),N.jsx("div",{ref:l})]})},e0e=()=>{const{userInput:e,setUserInput:t,loading:n,sendMessage:r,stopGeneration:i,currentAgent:a,setCurrentAgent:o,client:l,currentChatId:c}=Ts(),{extraParams:f}=F5(),[d,h]=te.useState([]),m=b=>{h(_=>[..._,{type:"image_url",image_url:{url:b}}])},g=b=>{localStorage.setItem("agent_name",b),o(b)},v=()=>{const b=[{type:"human",content:[{type:"text",text:e},...d]}];r(b,{extraParams:f}),h([])},w=b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),v())};return N.jsxs("div",{className:"border-t border-gray-200 p-4",children:[N.jsxs("div",{className:"flex items-center justify-between mb-4",children:[N.jsx(YX,{onFileUploaded:m}),N.jsx("select",{value:a,onChange:b=>g(b.target.value),className:"px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:l==null?void 0:l.availableAssistants.map(b=>N.jsx("option",{value:b.graph_id,children:b.name},b.graph_id))})]}),N.jsxs("div",{className:"flex gap-2",children:[N.jsx("textarea",{className:"flex-1 p-3 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",rows:2,value:e,onChange:b=>t(b.target.value),onKeyDown:w,placeholder:"输入消息...",disabled:n}),N.jsx("button",{className:`px-4 py-2 text-sm font-medium text-white rounded-lg focus:outline-none focus:ring-2 focus:ring-offset-2 ${n?"bg-red-500 hover:bg-red-600 focus:ring-red-500":"bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed"}`,onClick:()=>n?i():v(),disabled:!n&&!e.trim()&&d.length===0,children:n?"中断":"发送"})]}),N.jsxs("div",{className:"flex border-b border-gray-200 mt-4 gap-2 justify-between",children:[N.jsx(Qw,{usage_metadata:(l==null?void 0:l.tokenCounter)||{}}),N.jsxs("span",{className:"text-sm text-gray-500",children:["会话 ID: ",c]})]})]})},t0e=()=>{const[e,t]=te.useState(!1),{showHistory:n,toggleHistoryVisible:r,showGraph:i,toggleGraphVisible:a,renderMessages:o,setTools:l,client:c}=Ts(),{extraParams:f,setExtraParams:d}=F5(),{showArtifact:h,setShowArtifact:m}=zp();return te.useEffect(()=>{l([Wye,Qye])},[]),N.jsxs("div",{className:"langgraph-chat-container flex h-full w-full overflow-hidden",children:[n&&N.jsx(UX,{onClose:()=>r(),formatTime:QF}),N.jsxs("div",{className:"flex-1 flex flex-col overflow-auto",children:[N.jsxs("div",{className:"flex items-center gap-2 p-4 border-b border-gray-200 justify-end h-16",children:[N.jsxs("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{r(),mO({showHistory:!n})},children:[N.jsx(OX,{className:"w-4 h-4"}),"历史记录"]}),N.jsx("div",{className:"flex-1"}),N.jsxs("button",{onClick:()=>t(!0),className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",children:[N.jsx(SX,{className:"w-4 h-4"}),"编辑参数"]}),N.jsx("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{console.log(o)},children:"打印日志数据"}),N.jsx("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{console.log(c==null?void 0:c.graphState)},children:"打印 State"}),N.jsxs("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{a(),mO({showGraph:!i})},children:[N.jsx(MX,{className:"w-4 h-4"}),"节点图"]}),N.jsxs("button",{className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 flex items-center gap-1.5",onClick:()=>{localStorage.setItem("code",""),location.reload()},children:[N.jsx(RX,{className:"w-4 h-4"}),"退出登陆"]})]}),N.jsx(Jye,{}),N.jsx(e0e,{}),N.jsx(ZX,{isOpen:e,initialJson:f,onClose:()=>t(!1),onSave:d})]}),(i||h)&&N.jsxs("div",{className:"overflow-hidden flex-1",children:[i&&N.jsx(Mie,{}),h&&N.jsx(Kie,{})]})]})},n0e=()=>N.jsx(iK,{children:N.jsx(VX,{children:N.jsx(Yie,{children:N.jsx(t0e,{})})})}),r0e=()=>{const[e,t]=te.useState([{key:"authorization",value:""}]),[n,r]=te.useState(localStorage.getItem("withCredentials")==="true"),[i,a]=te.useState(localStorage.getItem("apiUrl")||""),o=()=>{t([...e,{key:"",value:""}])},l=d=>{t(e.filter((h,m)=>m!==d))},c=(d,h,m)=>{const g=[...e];g[d][h]=m,t(g)},f=()=>{const d=Object.fromEntries(e.map(h=>[h.key,h.value]));localStorage.setItem("code",JSON.stringify(d)),localStorage.setItem("withCredentials",JSON.stringify(n)),localStorage.setItem("apiUrl",i),location.reload()};return N.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 to-gray-100 flex items-center justify-center p-4",children:N.jsx("div",{className:"w-full max-w-4xl bg-white rounded-2xl shadow-xl overflow-hidden",children:N.jsxs("div",{className:"grid md:grid-cols-2",children:[N.jsx("div",{className:"hidden md:block bg-gradient-to-br from-blue-600 to-blue-800 p-12 text-white",children:N.jsxs("div",{className:"h-full flex flex-col justify-between",children:[N.jsxs("div",{children:[N.jsx("h1",{className:"text-4xl font-bold mb-6",children:"LangGraph UI"}),N.jsx("p",{className:"text-blue-100 text-lg leading-relaxed",children:"专业的 LangGraph 可视化界面,让您的 AI 应用开发更加高效和直观。"})]}),N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center",children:N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})})}),N.jsx("span",{children:"直观的可视化界面"})]}),N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center",children:N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),N.jsx("span",{children:"高效的开发体验"})]}),N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center",children:N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),N.jsx("span",{children:"安全可靠的配置"})]})]})]})}),N.jsxs("div",{className:"p-8 md:p-12",children:[N.jsxs("div",{className:"md:hidden mb-8",children:[N.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"LangGraph UI"}),N.jsx("p",{className:"text-gray-600 mt-2",children:"专业的 LangGraph 可视化界面"})]}),N.jsxs("form",{onSubmit:d=>{d.preventDefault(),f()},className:"space-y-6",children:[N.jsxs("div",{children:[N.jsx("label",{htmlFor:"api-url",className:"block text-sm font-medium text-gray-700 mb-2",children:"API URL"}),N.jsx("input",{type:"text",id:"api-url",value:i,onChange:d=>a(d.target.value),placeholder:"例如: http://localhost:8123",className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"})]}),N.jsxs("div",{children:[N.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"请求头配置"}),e.map((d,h)=>N.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[N.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[N.jsx("div",{children:N.jsx("input",{type:"text",id:`header-key-${h}`,value:d.key,onChange:m=>c(h,"key",m.target.value),placeholder:"例如: authorization",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"})}),N.jsx("div",{children:N.jsx("input",{type:"text",id:`header-value-${h}`,value:d.value,onChange:m=>c(h,"value",m.target.value),placeholder:"例如: Bearer token;无则填 1",required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"})})]}),h>0&&N.jsxs("button",{type:"button",onClick:()=>l(h),className:"text-red-600 hover:text-red-700 text-sm font-medium flex items-center space-x-1 transition-colors",children:[N.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),N.jsx("span",{children:"删除此请求头"})]})]},h))]}),N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("input",{type:"checkbox",id:"with-credentials",checked:n,onChange:d=>r(d.target.checked),className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),N.jsx("label",{htmlFor:"with-credentials",className:"text-sm text-gray-700",children:"启用 withCredentials(跨域请求时发送 Cookie)"})]}),N.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 pt-4",children:[N.jsxs("button",{type:"button",onClick:o,className:"flex-1 px-6 py-3 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors font-medium flex items-center justify-center space-x-2",children:[N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),N.jsx("span",{children:"添加请求头"})]}),N.jsxs("button",{type:"submit",className:"flex-1 px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium flex items-center justify-center space-x-2",children:[N.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),N.jsx("span",{children:"保存配置"})]})]})]})]})]})})})};function i0e(){const[e,t]=te.useState(localStorage.getItem("code"));return N.jsx(N.Fragment,{children:e?N.jsx(n0e,{}):N.jsx(r0e,{})})}gq.createRoot(document.getElementById("root")).render(N.jsx(i0e,{}))});export default a0e();
|