bi-components-library 1.1.21 → 1.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,39 +1,57 @@
1
- (function(le,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react/jsx-runtime"),require("react"),require("antd"),require("@ant-design/icons"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","antd","@ant-design/icons","react-dom"],w):(le=typeof globalThis<"u"?globalThis:le||self,w(le.SealSeekBIComponents={},le.React,le.React,le.antd,le.AntdIcons,le.ReactDOM))})(this,function(le,w,c,oe,Te,Xe){"use strict";const ft=({variant:t="primary",loading:f=!1,children:i,...d})=>{const v=D=>{switch(D){case"primary":return"primary";case"ghost":return"default";case"dashed":return"dashed";case"link":return"link";case"text":return"text";default:return"primary"}};return w.jsx(oe.Button,{...d,type:v(t),loading:f,ghost:t==="ghost",children:i})};ft.__docgenInfo={displayName:"Button",description:"基础按钮,用于触发操作",props:{variant:{name:"variant",required:!1,description:"视觉风格",type:{name:"ButtonVariant",raw:'"primary" | "ghost" | "dashed" | "link" | "text"'},defaultValue:{value:'"primary"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: MouseEvent) => void"}}}};const mt=({title:t,children:f,bordered:i=!0,hoverable:d=!1,size:v="default",...D})=>w.jsx(oe.Card,{...D,title:t,bordered:i,hoverable:d,size:v,children:f});mt.__docgenInfo={displayName:"Card",description:"卡片容器,用于分组内容",props:{title:{name:"title",required:!1,description:"标题",type:{name:"ReactNode",raw:"React.ReactNode"}},children:{name:"children",required:!1,description:"内容区域",type:{name:"ReactNode",raw:"React.ReactNode"}},bordered:{name:"bordered",required:!1,description:"是否显示边框",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},hoverable:{name:"hoverable",required:!1,description:"是否可悬停",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},size:{name:"size",required:!1,description:"卡片大小",type:{name:"CardSize",raw:'"default" | "small"'},defaultValue:{value:'"default"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},actions:{name:"actions",required:!1,description:"卡片操作组",type:{name:"ReactNode[]",raw:"React.ReactNode[]"}}}};const yt=({showDefaultFooter:t=!0,...f})=>{const i=f.footer!==void 0?f.footer:t?(d,{OkBtn:v,CancelBtn:D})=>w.jsxs(w.Fragment,{children:[w.jsx(v,{}),w.jsx(D,{})]}):null;return w.jsx(oe.Modal,{...f,footer:i})};yt.__docgenInfo={displayName:"AppModal",description:"应用级模态框组件,基于 Ant Design Modal 封装",props:{showDefaultFooter:{name:"showDefaultFooter",required:!1,description:"是否显示默认的确定和取消按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},title:{name:"title",required:!1,description:"模态框标题",type:{name:"ReactNode",raw:"React.ReactNode"}},open:{name:"open",required:!1,description:"是否显示模态框",type:{name:"boolean",raw:"boolean"}},onCancel:{name:"onCancel",required:!1,description:"取消按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},onOk:{name:"onOk",required:!1,description:"确定按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},children:{name:"children",required:!1,description:"模态框内容",type:{name:"ReactNode",raw:"React.ReactNode"}},width:{name:"width",required:!1,description:"模态框宽度",type:{name:"string | number",raw:"string | number"}},centered:{name:"centered",required:!1,description:"是否居中显示",type:{name:"boolean",raw:"boolean"}},maskClosable:{name:"maskClosable",required:!1,description:"点击蒙层是否允许关闭",type:{name:"boolean",raw:"boolean"}}}};const ht=({scrollX:t,showPagination:f=!0,defaultPageSize:i=10,...d})=>w.jsx(oe.Table,{...d,scroll:{x:t||"max-content",y:"50vh"},pagination:f?{hideOnSinglePage:!0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:i,...d.pagination}:!1});ht.__docgenInfo={displayName:"PageTable",description:"页面级表格组件,高度铺满容器,自动滚动",props:{scrollX:{name:"scrollX",required:!1,description:"水平滚动宽度",type:{name:"number",raw:"number"}},showPagination:{name:"showPagination",required:!1,description:"是否显示分页器",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},columns:{name:"columns",required:!1,description:"表格列配置",type:{name:"ColumnType[]",raw:"ColumnType<any>[]"}},dataSource:{name:"dataSource",required:!1,description:"数据源",type:{name:"any[]",raw:"any[]"}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},rowKey:{name:"rowKey",required:!1,description:"行数据的 Key",type:{name:"string | function",raw:"string | ((record: any) => string)"}}}};const Xt=Te.createFromIconfontCN({scriptUrl:["//at.alicdn.com/t/c/font_5037819_a72xy7yjoj.js"]}),gt=({name:t,size:f,color:i,style:d,...v})=>{const D={fontSize:f,color:i,...d};return w.jsx(Xt,{...v,type:t,style:D})};gt.__docgenInfo={displayName:"XcIcon",description:"自定义图标组件,基于 iconfont",props:{name:{name:"name",required:!0,description:"图标名称",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"图标大小",type:{name:"number | string",raw:"number | string"}},color:{name:"color",required:!1,description:"图标颜色",type:{name:"string",raw:"string"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const bt=({loading:t,description:f="暂无数据",className:i,emptyChildren:d,loadingText:v,emptyImage:D})=>t?w.jsxs(oe.Flex,{className:`pt-10 w-full ${i||""}`,align:"center",justify:"center",vertical:!0,children:[w.jsx(oe.Spin,{size:"large"}),v&&w.jsx("div",{className:"mt-4 text-gray-500",children:v})]}):w.jsx(oe.Flex,{className:`pt-10 w-full ${i||""}`,align:"center",justify:"center",children:w.jsx(oe.Empty,{image:D,description:f,imageStyle:{height:180},children:d})});bt.__docgenInfo={displayName:"EmptyAndSpin",description:"空状态和加载状态组合组件",props:{loading:{name:"loading",required:!0,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},description:{name:"description",required:!1,description:"空状态描述",type:{name:"ReactNode",raw:"React.ReactNode"},defaultValue:{value:'"暂无数据"'}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},emptyChildren:{name:"emptyChildren",required:!1,description:"空状态额外内容",type:{name:"ReactNode",raw:"React.ReactNode"}},loadingText:{name:"loadingText",required:!1,description:"加载中提示文字",type:{name:"string",raw:"string"}},emptyImage:{name:"emptyImage",required:!1,description:"空状态图片",type:{name:"string",raw:"string"}}}};const xt=({onClick:t,showText:f=!1,className:i,size:d="small",type:v="default"})=>w.jsx(oe.Button,{size:d,type:v,icon:w.jsx(Te.LeftOutlined,{}),className:`cursor-pointer ${i||""}`,onClick:t,children:f&&"返回"});xt.__docgenInfo={displayName:"BackButton",description:"返回按钮组件",props:{onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"() => void"}},showText:{name:"showText",required:!1,description:"是否显示文字",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'},defaultValue:{value:'"small"'}},type:{name:"type",required:!1,description:"按钮类型",type:{name:"ButtonType",raw:'"primary" | "default" | "dashed" | "link" | "text"'},defaultValue:{value:'"default"'}}}};const vt=({removePadding:t=!0,className:f,...i})=>{const d=t?`px-0 h-auto ${f||""}`:f;return w.jsx(oe.Button,{type:"link",...i,className:d,children:i.children})};vt.__docgenInfo={displayName:"LinkButton",description:"链接样式按钮组件,适用于表格操作列",props:{removePadding:{name:"removePadding",required:!1,description:"是否去除默认内边距",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLButtonElement>) => void"}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}}}};const{Option:Jt}=oe.Select,wt=({columns:t,request:f,searchFields:i=[],showSearch:d=!0,showRefresh:v=!0,defaultPageSize:D=10,pageSizeOptions:P=["10","20","50","100"],autoLoad:B=!0,externalParams:M={},...L})=>{const[q,j]=c.useState([]),[S,N]=c.useState(!1),[e,n]=c.useState({current:1,pageSize:D,total:0}),[s,u]=c.useState({}),[E,H]=c.useState({}),[F]=oe.Form.useForm(),T=c.useRef(e);T.current=e;const ne=c.useRef(M);ne.current=M;const K=c.useRef(!1),R=c.useMemo(()=>t.map(y=>{const{sortable:b,render:x,...I}=y;return{...I,sorter:b?!0:void 0,render:x||(A=>A)}}),[t]),G=c.useCallback(async(y={})=>{if(f){N(!0);try{const b={page:T.current.current,pageSize:T.current.pageSize,sortField:E.field,sortOrder:E.order,searchParams:{...s,...ne.current},...y},x=await f(b);x.success&&(j(x.data),n(I=>({...I,total:x.total,current:b.page||I.current})))}catch(b){console.error("加载数据失败:",b)}finally{N(!1)}}},[f,E,s]),l=c.useCallback(y=>{u(y),n(b=>({...b,current:1}))},[]),_=c.useCallback(()=>{F.resetFields(),u({}),n(y=>({...y,current:1}))},[F]),U=c.useCallback(()=>{G()},[G]),V=c.useCallback((y,b,x)=>{const I={current:y.current||1,pageSize:y.pageSize||D,total:y.total||0},A={field:x?.field,order:x?.order};n(I),H(A)},[D]);return c.useEffect(()=>{const y=Object.keys(M).length>0;(B&&!K.current||y)&&(G(),K.current=!0)},[B,M,G]),w.jsxs("div",{children:[d&&i.length>0&&w.jsx(oe.Card,{size:"small",style:{marginBottom:16},children:w.jsxs(oe.Form,{form:F,layout:"inline",onFinish:l,initialValues:i.reduce((y,b)=>(b.defaultValue!==void 0&&(y[b.key]=b.defaultValue),y),{}),children:[i.map(y=>w.jsx(oe.Form.Item,{name:y.key,label:y.label,children:y.type==="input"?w.jsx(oe.Input,{placeholder:y.placeholder||`请输入${y.label}`,style:{width:200}}):w.jsx(oe.Select,{placeholder:y.placeholder||`请选择${y.label}`,style:{width:200},allowClear:!0,children:y.options?.map(b=>w.jsx(Jt,{value:b.value,children:b.label},b.value))})},y.key)),w.jsx(oe.Form.Item,{children:w.jsxs(oe.Space,{children:[w.jsx(oe.Button,{type:"primary",htmlType:"submit",icon:w.jsx(Te.SearchOutlined,{}),children:"查询"}),w.jsx(oe.Button,{onClick:_,children:"重置"}),v&&w.jsx(oe.Button,{icon:w.jsx(Te.ReloadOutlined,{}),onClick:U,children:"刷新"})]})})]})}),w.jsx(oe.Table,{...L,columns:R,dataSource:q,loading:S,pagination:{...e,showSizeChanger:!0,showQuickJumper:!0,showTotal:(y,b)=>`第 ${b[0]}-${b[1]} 条/共 ${y} 条`,pageSizeOptions:P},onChange:V,scroll:{x:"max-content",y:"50vh"}})]})};wt.__docgenInfo={displayName:"AdvancedTable",description:"高阶表格组件,支持异步请求、搜索、排序等功能",props:{columns:{name:"columns",required:!0,description:"列配置",type:{name:"AdvancedColumnType[]",raw:"AdvancedColumnType<any>[]"}},request:{name:"request",required:!1,description:"异步请求函数",type:{name:"function",raw:"(params: RequestParams) => Promise<RequestResponse>"}},searchFields:{name:"searchFields",required:!1,description:"搜索字段配置",type:{name:"SearchFieldConfig[]",raw:"SearchFieldConfig[]"},defaultValue:{value:"[]"}},showSearch:{name:"showSearch",required:!1,description:"是否显示搜索区域",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},showRefresh:{name:"showRefresh",required:!1,description:"是否显示刷新按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},pageSizeOptions:{name:"pageSizeOptions",required:!1,description:"页面大小选项",type:{name:"string[]",raw:"string[]"},defaultValue:{value:'["10", "20", "50", "100"]'}},autoLoad:{name:"autoLoad",required:!1,description:"是否自动加载",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},externalParams:{name:"externalParams",required:!1,description:"外部请求参数",type:{name:"Record<string, any>",raw:"Record<string, any>"},defaultValue:{value:"{}"}}}};function Je(t,f,i){if(!t.current)return;const d=S=>{S.classList.contains("rte-richtext-host-expanded")&&(S.style.setProperty("display","flex","important"),S.style.setProperty("flex-direction","column","important"),S.style.setProperty("flex","1 1 auto","important"),S.style.setProperty("min-height","0","important"),S.style.setProperty("width","100%","important"),S.style.setProperty("align-self","stretch","important"))},v=new Set,D={};for(const S of f)S.exclusionGroup&&S.exclusionGroup!=="separator"&&(v.add(S.exclusionGroup),D[S.exclusionGroup]||(D[S.exclusionGroup]=[]),D[S.exclusionGroup].push({type:S.type,key:S.key,exclusionGroup:S.exclusionGroup}));const P={};for(const S of v){P[S]=!1;for(const N of D[S])if(N.type==="upload"&&N.key){if(i[N.key]!==null&&i[N.key]!==void 0){P[S]=!0;break}const e=f.find(n=>n.type==="upload"&&n.key===N.key);if(e&&typeof e.maxCount=="number")for(let n=0;n<e.maxCount;n++){const s=`${N.key}-${n}`;if(i[s]!==null&&i[s]!==void 0){P[S]=!0;break}}if(P[S])break}else if((N.type==="variable"||N.type==="multi-variable")&&N.key){const e=N.type==="multi-variable"?t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${N.key}"]`):[t.current.querySelector(`[data-type="variable"][data-key="${N.key}"]`)].filter(Boolean);for(const n of e)if(!n.classList.contains("show-placeholder")&&n.innerText.replace(/[\u200B\n]/g,"").trim().length>0){P[S]=!0;break}if(P[S])break}}const B=f.some(S=>S.exclusionGroup==="separator"),L=Object.keys(P).filter(S=>P[S]).length>0;let q=null;if(L&&B){for(const S of f)if(S.exclusionGroup&&S.exclusionGroup!=="separator"&&P[S.exclusionGroup]){q=S.exclusionGroup;break}}for(const S of v){const N=t.current.querySelectorAll(`[data-group="${S}"]`);B&&L&&q?S===q?N.forEach(e=>{if(!e.closest('[data-rte-force-hidden="1"]')){if(e.classList.contains("rte-richtext-host-expanded")){d(e);return}e.classList.contains("required-upload-group")?e.style.setProperty("display","inline-flex","important"):(e.classList.contains("exclusion-wrapper"),e.style.setProperty("display","inline-block","important"))}}):N.forEach(e=>{e.closest('[data-rte-force-hidden="1"]')||(e.style.display="none",e.style.setProperty("display","none","important"))}):N.forEach(e=>{if(!e.closest('[data-rte-force-hidden="1"]')){if(e.classList.contains("rte-richtext-host-expanded")){d(e);return}e.classList.contains("required-upload-group")?e.style.setProperty("display","inline-flex","important"):(e.classList.contains("exclusion-wrapper"),e.style.setProperty("display","inline-block","important"))}})}t.current.querySelectorAll('[data-group="separator"]').forEach(S=>{S.style.display=L?"none":"inline"})}function Qe(t,f,i,d){if(!t.current){d(!1);return}const v=e=>{const n=e.getAttribute("data-node-type")||"";if(n!=="report-module"&&n!=="markdown-module")return(e.textContent||"").replace(/[\u200B]/g,"").trim();const s=(e.textContent||"").replace(/[\u200B]/g,"").trim(),u=Array.from(e.querySelectorAll(":scope > div"));if(u.length===0)return s;let E=-1;for(let T=0;T<u.length;T++)if((u[T].textContent||"").replace(/[\u200B]/g,"").trim().length>0){E=T;break}return u.filter((T,ne)=>ne!==E).map(T=>(T.textContent||"").replace(/[\u200B]/g,"").trim()).join(`
2
- `).trim()||s},D=e=>e?!!e.closest('[data-rte-force-hidden="1"]'):!1,P=[];for(let e=0;e<f.length;e++){const n=f[e];if((n.type==="variable"||n.type==="report-url"||n.type==="markdown"||n.type==="upload"||n.type==="multi-variable"||n.type==="select"||n.type==="textarea"||n.type==="richtext"||n.type==="report-module"||n.type==="markdown-module"||n.type==="datepicker"||n.type==="number-input")&&n.required&&n.key){P.push({exclusionGroup:n.exclusionGroup||"",key:n.key,type:n.type==="multi-variable"||n.type==="report-url"||n.type==="markdown"?"variable":n.type==="report-module"||n.type==="markdown-module"?"richtext":n.type,isMultiVariable:n.type==="multi-variable",minCount:n.type==="multi-variable"||n.type==="upload"&&typeof n.minCount=="number"?n.minCount:void 0,moduleIndex:n.type==="report-module"||n.type==="markdown-module"?n.moduleIndex:void 0,__index:e});continue}if(n.type==="text"&&n.className?.includes("rte-text-required"))if(n.exclusionGroup)for(let s=e+1;s<f.length;s++){const u=f[s];if(u.exclusionGroup===n.exclusionGroup&&(u.type==="variable"||u.type==="markdown"||u.type==="upload"||u.type==="select"||u.type==="textarea"||u.type==="richtext"||u.type==="datepicker"||u.type==="number-input")&&u.key){P.push({exclusionGroup:n.exclusionGroup,key:u.key,type:u.type==="markdown"?"variable":u.type,__index:s});break}}else for(let s=e+1;s<f.length;s++){const u=f[s];if((u.type==="variable"||u.type==="markdown"||u.type==="upload"||u.type==="select"||u.type==="textarea"||u.type==="richtext"||u.type==="datepicker"||u.type==="number-input")&&u.key){P.push({exclusionGroup:u.exclusionGroup||"",key:u.key,type:u.type==="markdown"?"variable":u.type,__index:s});break}}}const B=f.some(e=>e.exclusionGroup==="separator"),M=[];if(B&&P.length>1){const e=[];f.forEach((n,s)=>{n.exclusionGroup==="separator"&&e.push(s)});for(const n of e){const u=P.filter(F=>typeof F.__index=="number"&&F.__index<n).sort((F,T)=>(T.__index??0)-(F.__index??0))[0],H=P.filter(F=>typeof F.__index=="number"&&F.__index>n).sort((F,T)=>(F.__index??0)-(T.__index??0))[0];u&&H&&M.push([u,H])}}if(P.length===0){if(f.length===0){if(!t.current){d(!1);return}const e=t.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";d(e.length>0);return}d(!0);return}const L=P.filter(e=>{if(!t.current)return!1;if(e.exclusionGroup){const n=t.current.querySelectorAll(`[data-group="${e.exclusionGroup}"]`);if(n.length>0){const s=n[0];return D(s)?!0:s.style.display!=="none"}}if(e.type==="upload"&&e.key){const n=t.current.querySelector(`[data-type="upload"][data-key="${e.key}"]`)||t.current.querySelector(`[data-type="upload"][data-batch-key="${e.key}"]`);if(n){const s=n.closest("[data-group]")||n.parentElement;return D(s)?!0:s?s.style.display!=="none":!0}}else if(e.type==="variable"&&e.key)if(e.isMultiVariable){const n=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${e.key}"]`);if(n.length>0){const s=n[0],u=s.closest("[data-group]")||s.parentElement;return D(u)?!0:u?u.style.display!=="none":!0}}else{const n=t.current.querySelector(`[data-type="variable"][data-key="${e.key}"]`);if(n){const s=n.closest("[data-group]")||n.parentElement;return D(s)?!0:s?s.style.display!=="none":!0}}else if(e.type==="select"&&e.key){const n=t.current.querySelector(`[data-type="select"][data-key="${e.key}"]`);if(n){const s=n.closest("[data-group]")||n.parentElement;return D(s)?!0:s?s.style.display!=="none":!0}}else if(e.type==="textarea"&&e.key){const n=t.current.querySelector(`[data-type="textarea"][data-key="${e.key}"]`);if(n){const s=n.closest("[data-group]")||n.parentElement;return D(s)?!0:s?s.style.display!=="none":!0}}else if(e.type==="richtext"&&e.key){const n=typeof e.moduleIndex=="number"?`[data-type="richtext"][data-node-type="report-module"][data-key="${e.key}"][data-module-index="${e.moduleIndex}"], [data-type="richtext"][data-node-type="markdown-module"][data-key="${e.key}"][data-module-index="${e.moduleIndex}"]`:`[data-type="richtext"][data-key="${e.key}"]`,s=t.current.querySelector(n);if(s){const u=s.closest("[data-group]")||s.parentElement;return D(u)?!0:u?u.style.display!=="none":!0}}else if(e.type==="datepicker"&&e.key){const n=t.current.querySelector(`[data-type="datepicker"][data-key="${e.key}"]`);if(n){const s=n.closest("[data-group]")||n.parentElement;return D(s)?!0:s?s.style.display!=="none":!0}}else if(e.type==="number-input"&&e.key){const n=t.current.querySelector(`[data-type="number-input"][data-key="${e.key}"]`);if(n){const s=n.closest("[data-group]")||n.parentElement;return D(s)?!0:s?s.style.display!=="none":!0}}return!1});if(L.length===0){d(!0);return}const q=new Set;M.forEach(e=>{e.forEach(n=>{n.key&&q.add(n.key)})});const j=L.filter(e=>!e.key||!q.has(e.key));let S=(M.length===0,!0);for(const e of M){const n=e.filter(u=>{if(!t.current)return!1;if(u.exclusionGroup){const E=t.current.querySelectorAll(`[data-group="${u.exclusionGroup}"]`);if(E.length>0){const H=E[0];return D(H)?!0:H.style.display!=="none"}}return!0});if(n.length===0)continue;let s=!1;for(const u of n)if(u.type==="upload"&&u.key){if(u.minCount&&u.minCount>0){let E=0;const H=t.current.querySelectorAll(`[data-type="upload"][data-batch-key="${u.key}"]`);if(H.length===0)continue;for(let F=0;F<H.length;F++){const ne=H[F].dataset.key;ne&&i[ne]!=null&&(E+=1)}if(E>=u.minCount){s=!0;break}}else if(i[u.key]!==null&&i[u.key]!==void 0){s=!0;break}}else if(u.type==="variable"&&u.key)if(u.isMultiVariable){const E=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${u.key}"]`);let H=0;for(const T of Array.from(E)){if(T.classList.contains("show-placeholder"))continue;T.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&(H+=1)}const F=u.minCount&&u.minCount>0?u.minCount:1;if(H>=F){s=!0;break}}else{const E=t.current.querySelector(`[data-type="variable"][data-key="${u.key}"]`);if(E){if(E.classList.contains("show-placeholder"))continue;if(E.innerText.replace(/[\u200B\n]/g,"").trim().length>0){s=!0;break}}}else if(u.type==="select"&&u.key){const E=t.current.querySelector(`[data-type="select"][data-key="${u.key}"]`);if(E&&(E.getAttribute("data-value")||"").trim().length>0){s=!0;break}}else if(u.type==="textarea"&&u.key){const E=t.current.querySelector(`[data-type="textarea"][data-key="${u.key}"]`);if(E&&(E.value||"").trim().length>0){s=!0;break}}else if(u.type==="richtext"&&u.key){const E=typeof u.moduleIndex=="number"?`[data-type="richtext"][data-node-type="report-module"][data-key="${u.key}"][data-module-index="${u.moduleIndex}"], [data-type="richtext"][data-node-type="markdown-module"][data-key="${u.key}"][data-module-index="${u.moduleIndex}"]`:`[data-type="richtext"][data-key="${u.key}"]`,H=t.current.querySelector(E);if(H&&v(H).length>0){s=!0;break}}else if(u.type==="datepicker"&&u.key){const E=t.current.querySelector(`[data-type="datepicker"][data-key="${u.key}"]`);if(E&&(E.getAttribute("data-value")||"").trim().length>0){s=!0;break}}else if(u.type==="number-input"&&u.key){const E=t.current.querySelector(`[data-type="number-input"][data-key="${u.key}"]`);if(E&&(E.value||"").trim().length>0){s=!0;break}}if(!s){S=!1;break}}let N=!0;for(const e of j)if(e.type==="upload"&&e.key){if(e.minCount&&e.minCount>0){let n=0;const s=t.current.querySelectorAll(`[data-type="upload"][data-batch-key="${e.key}"]`);if(s.length===0){N=!1;break}for(let u=0;u<s.length;u++){const H=s[u].dataset.key;H&&i[H]!=null&&(n+=1)}if(n<e.minCount){N=!1;break}}else if(i[e.key]===null||i[e.key]===void 0){N=!1;break}}else if(e.type==="variable"&&e.key)if(e.isMultiVariable){const n=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${e.key}"]`);let s=0;for(const E of Array.from(n)){if(E.classList.contains("show-placeholder"))continue;E.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&(s+=1)}const u=e.minCount&&e.minCount>0?e.minCount:1;if(s<u){N=!1;break}}else{const n=t.current.querySelector(`[data-type="variable"][data-key="${e.key}"]`);if(!n){N=!1;break}if(n.classList.contains("show-placeholder")){N=!1;break}if(n.innerText.replace(/[\u200B\n]/g,"").trim().length===0){N=!1;break}}else if(e.type==="select"&&e.key){const n=t.current.querySelector(`[data-type="select"][data-key="${e.key}"]`);if(!n||(n.getAttribute("data-value")||"").trim().length===0){N=!1;break}}else if(e.type==="textarea"&&e.key){const n=t.current.querySelector(`[data-type="textarea"][data-key="${e.key}"]`);if(!n||(n.value||"").trim().length===0){N=!1;break}}else if(e.type==="richtext"&&e.key){const n=typeof e.moduleIndex=="number"?`[data-type="richtext"][data-node-type="report-module"][data-key="${e.key}"][data-module-index="${e.moduleIndex}"], [data-type="richtext"][data-node-type="markdown-module"][data-key="${e.key}"][data-module-index="${e.moduleIndex}"]`:`[data-type="richtext"][data-key="${e.key}"]`,s=t.current.querySelector(n);if(!s||v(s).length===0){N=!1;break}}else if(e.type==="datepicker"&&e.key){const n=t.current.querySelector(`[data-type="datepicker"][data-key="${e.key}"]`);if(!n||(n.getAttribute("data-value")||"").trim().length===0){N=!1;break}}else if(e.type==="number-input"&&e.key){const n=t.current.querySelector(`[data-type="number-input"][data-key="${e.key}"]`);if(!n||(n.value||"").trim().length===0){N=!1;break}}d(S&&N)}function Ze(t,f){if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(d=>{const v=d.innerText;v.replace(/\u200B/g,"").trim().length===0?(v!=="​"&&(d.innerText="​"),d.classList.add("show-placeholder")):d.classList.remove("show-placeholder")})}const Qt=({host:t,onChange:f})=>{const i=t.dataset.key,d=t.dataset.placeholder,v=t.dataset.options?decodeURIComponent(t.dataset.options):"[]",D=t.dataset.required==="true",P=t.dataset.value||"",B=c.useMemo(()=>{try{return JSON.parse(v)}catch{return[]}},[v]),[M,L]=c.useState(P||void 0),[q,j]=c.useState(64),S=c.useRef(null),N=s=>{L(s),t.setAttribute("data-value",s),f(i,s)};c.useEffect(()=>{L(P||void 0)},[P]);const e=c.useCallback(()=>{if(M!=null&&M!==""){const s=B.find(u=>String(u.value)===String(M));return s?typeof s.label=="string"?s.label:String(s.label??M):String(M)}return d||"请选择"},[M,B,d]),n=c.useCallback(()=>{const s=S.current;if(!s)return;const u=s.querySelector(".ant-select-selection-item"),E=s.querySelector(".ant-select-selection-placeholder"),H=u||E,F=(H?.textContent||"").trim()||e(),T=s.querySelector(".ant-select-selector"),ne=H||T||s,K=window.getComputedStyle(ne),R=H?K.fontSize:"16px",G=K.fontFamily||"sans-serif",l=K.fontWeight||"400",U=`${K.fontStyle||"normal"} ${l} ${R} ${G}`,y=document.createElement("canvas").getContext("2d"),b=y?Math.ceil((y.font=U,y.measureText(F).width||0)):0;let x=0;if(T){const ee=window.getComputedStyle(T);x=(Number.parseFloat(ee.paddingLeft)||0)+(Number.parseFloat(ee.paddingRight)||0)}const I=s.querySelector(".ant-select-arrow"),A=I?Math.ceil(I.getBoundingClientRect().width):12,X=s.querySelector(".ant-select-clear");let J=0;if(X){const ee=window.getComputedStyle(X);ee.display!=="none"&&ee.visibility!=="hidden"&&(J=Math.ceil(X.getBoundingClientRect().width))}const Z=Math.max(36,b+x+A+J+6);j(ee=>ee===Z?ee:Z)},[e]);return c.useLayoutEffect(()=>{const s=window.requestAnimationFrame(()=>{n()}),u=window.setTimeout(()=>{n()},60);return()=>{window.cancelAnimationFrame(s),window.clearTimeout(u)}},[n]),c.useEffect(()=>{if(!("fonts"in document))return;let s=!1;const u=document.fonts;if(u?.ready)return u.ready.then(()=>{s||n()}),()=>{s=!0}},[n]),Xe.createPortal(w.jsx("div",{className:"rte-select-wrapper",contentEditable:!1,ref:S,style:{display:"inline-block",width:q},children:w.jsx(oe.Select,{value:M,onChange:N,placeholder:d||"请选择",style:{width:"100%"},options:B,allowClear:!D,size:"small",dropdownClassName:"rte-select-dropdown",getPopupContainer:()=>document.body,dropdownMatchSelectWidth:!1,suffixIcon:w.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang",style:{fontSize:"10px",color:"#7C3AED"}})})}),t)},Zt=t=>{const[f,i]=c.useState([]);return c.useEffect(()=>{const d=t.current;if(!d)return;const v=()=>{const P=d.querySelectorAll(".rte-select-host"),B=[];P.forEach(M=>{const L=M.getAttribute("data-key");L&&B.push(w.jsx(Qt,{host:M,onChange:()=>{if(t.current){const q=new Event("input",{bubbles:!0});t.current.dispatchEvent(q)}}},`select-${L}`))}),i(B)};v();const D=new MutationObserver(P=>{let B=!1;for(const M of P)if(M.type==="childList"){let L=!1;if(M.addedNodes.forEach(q=>{if(q.nodeType===Node.ELEMENT_NODE){const j=q;(j.classList?.contains("rte-select-host")||j.querySelector?.(".rte-select-host"))&&(L=!0)}}),M.removedNodes.forEach(q=>{if(q.nodeType===Node.ELEMENT_NODE){const j=q;(j.classList?.contains("rte-select-host")||j.querySelector?.(".rte-select-host"))&&(L=!0)}}),L){B=!0;break}}B&&v()});return D.observe(d,{childList:!0,subtree:!0}),()=>D.disconnect()},[t]),f},ve=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");function Rt(t,f,i,d,v,D={},P,B){if(!t.current)return;const M=/[;;,,。.!!??::、]/,L=e=>{const n=(e??"").trim();return n.length===1&&M.test(n)},q=e=>{const n=e??"",s=n.match(new RegExp(`^\\s*(${M.source})`));if(!s)return null;const u=s[1],E=n.replace(new RegExp(`^\\s*${M.source}`),"");return{punct:u,rest:E}},j=e=>`<span data-type="text" class="rte-inline-punct" contenteditable="false">${e}</span>`,S=[];let N=0;for(;N<f.length;){const e=f[N],n=N+1<f.length?f[N+1]:null;let s=!1;if(e.type==="text"&&(e.text?.includes("icon-bitian")||e.className==="rte-text-required")&&n){const K=n.type==="upload"&&n.exclusionGroup==="fileInput"&&e.exclusionGroup==="fileInput"&&e.exclusionGroup===n.exclusionGroup,R=n.type==="variable"&&n.exclusionGroup==="textInput"&&e.exclusionGroup==="textInput"&&e.exclusionGroup===n.exclusionGroup;if(K){const G=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"",l=`<span ${G} class="exclusion-wrapper required-upload-group">`,_="</span>";let U="";e.className?U=`<span class="${e.className}">${e.text??""}</span>`:U=e.text??"";const V=n,y=i[V.key]!==null&&i[V.key]!==void 0,b=y?i[V.key]:null,x=y?i[V.key]?.name:V.text,I=y?"":"hidden",A=V.tooltip&&!y?"":"hidden",X=y?"has-file":"",J=y&&x?` data-file-name="${x.replace(/"/g,"&quot;")}"`:"";let Z="";y&&b?b.type?.startsWith("image/")?Z=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(b)}" alt="preview" />`:Z="<i class='iconfont icon-exlwenjian'></i>":Z="<i class='iconfont icon-shangchuan1'></i>";const ee=(V.text||"").trim(),ie=y&&ee.length>=12?`<span ${G} contenteditable="false" class="exclusion-wrapper upload-hint">${ee}</span>`:"",ue=`<span contenteditable="false" data-type="upload" data-key="${V.key}" class="upload-chip"><span class="upload-inner-wrapper ${X}"><span class="upload-icon">${Z}</span><span class="upload-label"${J}>${x||V.text}</span>${V.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${A}" data-upload-key="${V.key}" data-tooltip="${V.tooltip}"></i>`:""}<span class="file-remove-btn ${I}" title="移除文件">×</span></span></span>`;S.push(l+U+ue+_+ie),N+=2;continue}if(R){const l=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,_="</span>";let U="";e.className?U=`<span class="${e.className}">${e.text??""}</span>`:U=e.text??"";const V=n,b=(V.key?v[V.key]:void 0)||V.text||"",x=!b,I=x?"​":b,A=x?"show-placeholder":"",X=V.exclusionGroup?` data-group="${V.exclusionGroup}"`:"",J=V.tooltip?` data-tooltip="${V.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${V.key||""}"`:"",Z=V.tooltip&&x?"":"hidden",ee=`<span contenteditable="true" data-type="variable" data-key="${V.key}" data-placeholder="${V.placeholder||""}"${X}${J} class="variable-chip ${A}">${I}${V.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${Z}" data-variable-key="${V.key}" data-tooltip="${V.tooltip.replace(/"/g,"&quot;")}" ></i>`:""}</span>`;S.push(l+U+ee+_),N+=2;continue}}const E=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"",H=e.exclusionGroup?`<span ${E} class="exclusion-wrapper">`:"",F=e.exclusionGroup?"</span>":"";let T="";if(e.type==="tag"){const R=d||P==="hideTagClose"?"":'<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>',G=d?' data-locked="true"':"",l=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-tag-key="${e.key||""}"`:"";T=`<span contenteditable="false" class="tag-node group"${G}${l}><span class="tag-label">${e.text}</span>${R}</span>`}else if(e.type==="text"){const K=d?' data-locked="true" contenteditable="false"':' contenteditable="false"',G=(e.text??"").replace(/\n/g,"<br/>");e.className?T=`<span data-type="text" class="${e.className}"${K}>${G}</span>`:T=d?`<span data-type="text"${K}>${G}</span>`:`<span data-type="text" contenteditable="false">${G}</span>`}else if(e.type==="variable"&&e.key){const R=v[e.key]||e.text||"",G=!R,l=G?"​":R,_=G?"show-placeholder":"",U=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",V=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",y=e.tooltip&&G?"":"hidden",b=`<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder||""}"${U}${V} class="variable-chip ${_}">${l}${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${y}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" ></i>`:""}</span>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${b}</span>`:T=b}else if(e.type==="report-url"&&e.key){const K=`${e.key}__url`,G=Object.prototype.hasOwnProperty.call(v,K)?v[K]:void 0,l=v[e.key],_=G??l??e.text??"",U=!_,V=U?"​":_,y=U?"show-placeholder":"",b=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",x=e.tooltip?` data-tooltip="${ve(e.tooltip)}" data-variable-key="${e.key||""}"`:"",I=e.tooltip&&U?"":"hidden",A=`<span contenteditable="true" data-type="variable" data-key="${e.key}" data-node-type="report-url" data-placeholder="${ve(e.placeholder||"")}"${b}${x} class="variable-chip rte-report-url ${y}">${V}${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${I}" data-variable-key="${e.key}" data-tooltip="${ve(e.tooltip)}" ></i>`:""}</span>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${A}</span>`:T=A}else if(e.type==="markdown"&&e.key){const K=e.sourceTextKey||`${e.key}__sourceText`,G=Object.prototype.hasOwnProperty.call(v,K)?v[K]:void 0,l=v[e.key],_=G??l??e.text??"",U=!_,V=U?"​":_,y=U?"show-placeholder":"",b=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",x=e.sourceTextKey?` data-source-text-key="${ve(e.sourceTextKey)}"`:"",I=e.tooltip?` data-tooltip="${ve(e.tooltip)}" data-variable-key="${e.key||""}"`:"",A=e.tooltip&&U?"":"hidden",X=`<span contenteditable="true" data-type="variable" data-key="${e.key}" data-node-type="markdown" data-placeholder="${ve(e.placeholder||"")}"${b}${x}${I} class="variable-chip rte-markdown-input ${y}">${V}${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${A}" data-variable-key="${e.key}" data-tooltip="${ve(e.tooltip)}" ></i>`:""}</span>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${X}</span>`:T=X}else if(e.type==="upload"&&e.key){const K=!!n&&n.type==="text"&&!n.className&&!n.exclusionGroup&&L(n.text),R=K?(n.text??"").trim():"",G=R?j(R):"";if(K&&(s=!0),typeof e.maxCount=="number"&&typeof e.minCount=="number"&&e.maxCount>1){const _=e.tooltip?` data-tooltip="${ve(e.tooltip)}"`:"",U=e.minCount||1,V=e.maxCount||3;let y=0;for(let I=0;I<V;I++){const A=`${e.key}-${I}`;i[A]!=null&&(y+=1)}const b=Math.min(V,Math.max(U,y+(y<V?1:0)));let x="";for(let I=0;I<b;I++){const A=`${e.key}-${I}`,X=i[A]!==null&&i[A]!==void 0,J=X?i[A]:null,Z=X?i[A]?.name:e.text,ee=X?"":"hidden",se=e.tooltip&&!X?"":"hidden",ie=X?"has-file":"",ue=X&&Z?` data-file-name="${Z.replace(/"/g,"&quot;")}"`:"";let he="";X&&J?J.type?.startsWith("image/")?he=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(J)}" alt="preview" />`:he="<i class='iconfont icon-exlwenjian'></i>":he="<i class='iconfont icon-shangchuan1'></i>";const re=` data-batch-key="${e.key}"`,me=` data-batch-index="${I}"`,ge=`<span contenteditable="false" data-type="upload" data-key="${A}"${re}${me}${_} class="upload-chip upload-chip-batch"><span class="upload-inner-wrapper ${ie}"><span class="upload-icon">${he}</span><span class="upload-label"${ue}>${Z||e.text}</span>${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${se}" data-upload-key="${A}" data-tooltip="${ve(e.tooltip)}" ></i>`:""}<span class="file-remove-btn ${ee}" title="移除文件">×</span></span></span>`;x+=ge}e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group rte-required-upload-batch"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span><span class="rte-upload-batch-chips">${x}${G}</span></span>`:T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper rte-upload-batch-chips">${x}${G}</span>`}else{const _=e.tooltip?` data-tooltip="${ve(e.tooltip)}"`:"",U=i[e.key]!==null&&i[e.key]!==void 0,V=U?i[e.key]:null,y=U?i[e.key]?.name:e.text,b=U?"":"hidden",x=e.tooltip&&!U?"":"hidden",I=U?"has-file":"",A=U&&y?` data-file-name="${y.replace(/"/g,"&quot;")}"`:"";let X="";U&&V?V.type?.startsWith("image/")?X=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(V)}" alt="preview" />`:X="<i class='iconfont icon-exlwenjian'></i>":X="<i class='iconfont icon-shangchuan1'></i>";const J=(e.text||"").trim(),ee=U&&e.showHint===!0&&J.length>=12?`<span ${E} contenteditable="false" class="exclusion-wrapper upload-hint">${J}</span>`:"",se=`<span contenteditable="false" data-type="upload" data-key="${e.key}"${_} class="upload-chip"><span class="upload-inner-wrapper ${I}"><span class="upload-icon">${X}</span><span class="upload-label"${A}>${y||e.text}</span>${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${x}" data-upload-key="${e.key}" data-tooltip="${ve(e.tooltip)}" ></i>`:""}<span class="file-remove-btn ${b}" title="移除文件">×</span></span></span>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${se}${G}</span>${ee}`:T=se+G+ee}}else if(e.type==="select"&&e.key){const K=v[e.key]||e.defaultValue||"",R=encodeURIComponent(JSON.stringify(e.options||[])),G=e.placeholder?` data-placeholder="${e.placeholder}"`:"",l=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",_=e.required?' data-required="true"':"",U=`<div data-type="select" data-key="${e.key}" data-value="${K}" data-options="${R}"${G}${l}${_} class="rte-select-host"></div>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${U}</span>`:T=U}else if(e.type==="textarea"&&e.key){const K=v[e.key]||"",R=typeof e.maxHeight=="number"?e.maxHeight:252,G=e.placeholder?` placeholder="${e.placeholder}"`:"",l=`<textarea data-type="textarea" data-key="${e.key}" class="rte-textarea" style="max-height:${R}px;"${G}>${K}</textarea>`,_=`<div class="rte-textarea-wrapper" data-key="${e.key}">${l}</div>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${_}</span>`:T=_}else if(e.type==="richtext"&&e.key){const K=v[e.key]||e.text||"",R=typeof e.minHeight=="number"?e.minHeight:40,G=typeof e.maxHeight=="number"?e.maxHeight:160,l=Math.max(G,R),_=e.placeholder?` data-placeholder="${e.placeholder}"`:"",U=e.expandable!==!1,V=K,y=`<div contenteditable="true" data-type="richtext" data-key="${e.key}" class="rte-richtext"${_} style="min-height:${R}px;max-height:${l}px;overflow:auto;">${V}</div>`,b=U?`<button type="button" class="rte-richtext-toggle" data-key="${e.key}" data-expanded="false"><i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span></button>`:"",x=`<div class="rte-richtext-wrapper${U?" rte-richtext-toggleable":""}" data-key="${e.key}">${y}${b}</div>`,I=`<div class="rte-richtext-container" data-key="${e.key}">${x}</div>`;e.required?T=`<div ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper rte-richtext-required">${I}</div>`:T=I}else if(e.type==="report-module"&&e.key){const K=typeof e.moduleIndex=="number"?e.moduleIndex:0,R=`${e.key}__module_${K}`,l=Object.prototype.hasOwnProperty.call(v,R)?v[R]:e.text||"",_=typeof e.minHeight=="number"?e.minHeight:80,U=typeof e.maxHeight=="number"?e.maxHeight:240,V=Math.max(U,_),y=e.placeholder?` data-placeholder="${ve(e.placeholder)}"`:"",b=l,x=`<div contenteditable="true" data-type="richtext" data-key="${e.key}" data-node-type="report-module" data-module-index="${K}" class="rte-richtext rte-report-module"${y} style="min-height:${_}px;max-height:${V}px;overflow:auto;">${b}</div>`,I=`<div class="rte-richtext-wrapper rte-report-module-wrapper" data-key="${e.key}">${x}</div>`,A=`<div class="rte-richtext-container rte-report-module-container" data-key="${e.key}">${I}</div>`;e.required?T=`<div ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper rte-richtext-required">${A}</div>`:T=A}else if(e.type==="markdown-module"&&e.key){const K=typeof e.moduleIndex=="number"?e.moduleIndex:0,R=`${e.key}__module_${K}`,l=Object.prototype.hasOwnProperty.call(v,R)?v[R]:e.text||"",_=typeof e.minHeight=="number"?e.minHeight:80,U=typeof e.maxHeight=="number"?e.maxHeight:240,V=Math.max(U,_),y=e.placeholder?` data-placeholder="${ve(e.placeholder)}"`:"",b=l,x=`<div contenteditable="true" data-type="richtext" data-key="${e.key}" data-node-type="markdown-module" data-module-index="${K}" class="rte-richtext rte-markdown-module"${y} style="min-height:${_}px;max-height:${V}px;overflow:auto;">${b}</div>`,I=`<div class="rte-richtext-wrapper rte-markdown-module-wrapper" data-key="${e.key}">${x}</div>`,A=`<div class="rte-richtext-container rte-markdown-module-container" data-key="${e.key}">${I}</div>`;e.required?T=`<div ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper rte-richtext-required">${A}</div>`:T=A}else if(e.type==="datepicker"&&e.key){const K=v[e.key]||"",R=e.placeholder?` data-placeholder="${e.placeholder}"`:"",G=e.limitRange?` data-limit-range="${e.limitRange}"`:"",l=e.disableFuture?' data-disable-future="true"':"",_=`<div data-type="datepicker" data-key="${e.key}" data-value="${K}" class="rte-datepicker-host"${R}${G}${l}></div>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${_}</span>`:T=_}else if(e.type==="number-input"&&e.key){const K=v[e.key]||(typeof e.defaultNumber=="number"?String(e.defaultNumber):""),R=typeof e.min=="number"?` min="${e.min}"`:"",G=typeof e.max=="number"?` max="${e.max}"`:"",l=e.placeholder?` placeholder="${e.placeholder}"`:"",_=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",U=' step="1"',V=K||e.placeholder||"";let y=0;for(let I=0;I<V.length;I++){const A=V.charCodeAt(I);A>19968||A>=65280&&A<=65519?y+=16:y+=8}const b=Math.max(44,Math.min(600,y+28)),x=`<input type="number" data-type="number-input" data-key="${e.key}" class="rte-number-input" value="${K}" style="width: ${b}px;"${R}${G}${U}${l}${_} />`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${x}</span>`:T=x}else if(e.type==="multi-variable"&&e.key){const K=e.maxCount||9,R=D[e.key]||1,G=Math.min(R,K);if(e.required){const l=`<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`,_=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"";let U="";for(let V=0;V<G;V++){const y=`${e.key}_${V}`,b=v[y]||"",x=!b,I=x?"​":b,A=x?"show-placeholder":"",X=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",J=e.tooltip&&x?"":"hidden",Z=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",ee=`<span contenteditable="true" data-type="variable" data-key="${y}" data-multi-key="${e.key}" data-index="${V}" data-placeholder="${e.placeholder||""}"${Z}${X} class="variable-chip ${A}">${I}${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${J}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" ></i>`:""}</span>`;V===0?U+=`<span ${_} class="exclusion-wrapper required-upload-group required-multi-first">${l}${ee}</span>`:U+=ee}T=U}else{let l="";for(let _=0;_<G;_++){const U=`${e.key}_${_}`,V=v[U]||"",y=!V,b=y?"​":V,x=y?"show-placeholder":"",I=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",A=e.tooltip&&y?"":"hidden",X=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",J=`<span contenteditable="true" data-type="variable" data-key="${U}" data-multi-key="${e.key}" data-index="${_}" data-placeholder="${e.placeholder||""}"${X}${I} class="variable-chip ${x}">${b}${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${A}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" ></i>`:""}</span>`;l+=J}T=l}}const ne=H+T+F;if(e.type==="text"&&!e.className&&!e.exclusionGroup){if(L(e.text)&&S.length>0){const R=S[S.length-1],G=(e.text??"").trim();S[S.length-1]=`<span class="rte-inline-group">${R}${j(G)}</span>`,N++;continue}const K=q(e.text);if(K&&S.length>0){const R=S[S.length-1];S[S.length-1]=`<span class="rte-inline-group">${R}${j(K.punct)}</span>`;const G=K.rest;if(G){const l=G.replace(/\n/g,"<br/>");S.push(`<span data-type="text" contenteditable="false">${l}</span>`)}N++;continue}}S.push(ne),N+=s?2:1}t.current&&(t.current.innerHTML=S.join(""),setTimeout(()=>{if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(n=>{const s=n.innerText.replace(/\n/g,"");s.replace(/\u200B/g,"")?n.classList.remove("show-placeholder"):(s!=="​"&&(n.innerText="​"),n.classList.add("show-placeholder"))})},0))}function en(t,f,i,d,v={},D,P,B,M){const L=c.useCallback(()=>{if(!t.current)return;if(f.length===0){t.current.innerHTML="";return}let q={};const S=t.current.__tempVariableValues;if(S?(q=S,setTimeout(()=>{if(t.current){const N=t.current;N.__tempVariableValues===S&&delete N.__tempVariableValues}},100)):(t.current.querySelectorAll('[data-type="variable"]').forEach(H=>{const F=H.dataset.key;if(F){const T=H.innerText.replace(/[\u200B\n]/g,"").trim();T&&(H.getAttribute("data-node-type")==="report-url"?q[`${F}__url`]=T:q[F]=T)}}),t.current.querySelectorAll('[data-type="select"]').forEach(H=>{const F=H.dataset.key;if(F){const T=(H.getAttribute("data-value")||"").trim();T&&(q[F]=T)}}),t.current.querySelectorAll('[data-type="textarea"]').forEach(H=>{const F=H.dataset.key;if(F){const T=H.value.replace(/[\u200B]/g,"").trim();T&&(q[F]=T)}}),t.current.querySelectorAll('[data-type="richtext"]').forEach(H=>{const F=H.dataset.key;if(F){const T=H.getAttribute("data-node-type")||"",ne=T==="report-module"?(H.innerHTML||"").replace(/[\u200B]/g,"").trim():(H.textContent||"").replace(/[\u200B]/g,"").trim();if(T==="report-module"){const K=Number.parseInt(H.getAttribute("data-module-index")||"0",10);q[`${F}__module_${Number.isFinite(K)?K:0}`]=ne}else ne&&(q[F]=ne)}}),t.current.querySelectorAll('[data-type="datepicker"]').forEach(H=>{const F=H.dataset.key;if(F){const T=(H.getAttribute("data-value")||"").trim();T&&(q[F]=T)}}),t.current.querySelectorAll('[data-type="number-input"]').forEach(H=>{const F=H.dataset.key;if(F){const T=(H.value||"").trim();T&&(q[F]=T)}})),Rt(t,f,i,d,q,v,B),D?.current){const{key:N,offset:e}=D.current;setTimeout(()=>{if(!t.current)return;const n=t.current.querySelector(`[data-type="variable"][data-key="${N}"]`);if(n){try{const s=document.createRange(),u=document.createTreeWalker(n,NodeFilter.SHOW_TEXT,null);let E=0,H=null,F=0;for(;u.nextNode();){const T=u.currentNode,ne=T.textContent?.length||0;if(E+ne>=e){H=T,F=e-E;break}E+=ne}if(H){s.setStart(H,Math.min(F,H.textContent?.length||0)),s.collapse(!0);const T=window.getSelection();T&&(T.removeAllRanges(),T.addRange(s),n.focus())}else{s.selectNodeContents(n),s.collapse(!1);const T=window.getSelection();T&&(T.removeAllRanges(),T.addRange(s),n.focus())}}catch{const s=document.createRange();s.selectNodeContents(n),s.collapse(!1);const u=window.getSelection();u&&(u.removeAllRanges(),u.addRange(s),n.focus())}D.current=null}},0)}},[f,i,d,t,v,D,P,B,M]);c.useEffect(()=>{L()},[L])}function tn(t,f,i,d){c.useEffect(()=>{const v=t.current;if(!v)return;const D=M=>M.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(M.name||""),P=M=>{const L=M.target?.closest(".upload-info-icon");if(L&&L.classList.contains("upload-info-icon")){const j=L.dataset.uploadKey;if(j){const S=L.closest('[data-type="upload"]');d(S?{key:j,anchorEl:S,type:"upload"}:{key:j,anchorEl:L,type:"upload"})}return}const q=M.target?.closest('[data-type="upload"]');if(q){const j=q.dataset.key;if(j){const S=i[j];S&&D(S)&&d({key:j,anchorEl:q,type:"upload-preview"})}}},B=M=>{const L=M.target?.closest(".upload-info-icon"),q=M.relatedTarget;if(L&&L.classList.contains("upload-info-icon")){const S=L.closest('[data-type="upload"]');if(q&&S&&S.contains(q))return;if(!q||!v.contains(q))d(null);else{const N=q.closest('[data-type="upload"]');(!N||N!==S)&&d(null)}return}const j=M.target?.closest('[data-type="upload"]');if(j){const S=q;if(S&&j.contains(S))return;d(null)}};return v.addEventListener("mouseover",P,!0),v.addEventListener("mouseout",B,!0),()=>{v.removeEventListener("mouseover",P,!0),v.removeEventListener("mouseout",B,!0)}},[f,i,t,d])}function nn(t,f,i,d){c.useEffect(()=>{if(!t.current)return;const v=M=>{if(d==="hideTagClose")return;const L=M.currentTarget,q=L.dataset.tooltip,j=L.dataset.tagKey||"";q&&i({key:j,anchorEl:L,type:"tag"})},D=()=>{i(null)};let P;const B=()=>{if(!t.current)return;t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(L=>{L.addEventListener("mouseenter",v),L.addEventListener("mouseleave",D)})};return P=requestAnimationFrame(()=>{P=requestAnimationFrame(B)}),()=>{cancelAnimationFrame(P),t.current&&t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(L=>{L.removeEventListener("mouseenter",v),L.removeEventListener("mouseleave",D)})}},[f,t,i,d])}function rn(t,f,i){c.useEffect(()=>{const d=t.current;if(!d)return;const v=P=>{const B=P.target?.closest(".variable-info-icon");if(B&&B.classList.contains("variable-info-icon")){const L=B.dataset.variableKey;L&&i({key:L,anchorEl:B,type:"variable"});return}const M=P.target?.closest('[data-type="variable"][data-node-type="report-url"][data-tooltip]');if(M){const L=M.dataset.key;L&&i({key:L,anchorEl:M,type:"variable"})}},D=P=>{const B=P.target,M=P.relatedTarget,L=B?.closest?.(".variable-info-icon"),q=B?.closest?.('[data-type="variable"][data-node-type="report-url"][data-tooltip]');if(L||q){if(!M||!d.contains(M)){i(null);return}const j=!!M.closest?.(".variable-info-icon"),S=!!M.closest?.('[data-type="variable"][data-node-type="report-url"][data-tooltip]');!j&&!S&&i(null)}};return d.addEventListener("mouseover",v,!0),d.addEventListener("mouseout",D,!0),()=>{d.removeEventListener("mouseover",v,!0),d.removeEventListener("mouseout",D,!0)}},[f,t,i])}function an(t,f,i,d){c.useEffect(()=>{if(!t.current)return;const v=L=>L.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(L.name||""),D=L=>{const q=L.currentTarget,j=q.dataset.fileName,S=q.closest('[data-type="upload"]'),N=S?.dataset.key||"",e=N?i[N]:null;if(e&&v(e)){d({key:N,anchorEl:S||q,type:"upload-preview"});return}j&&d({key:N,anchorEl:S||q,type:"upload-label"})},P=()=>{d(null)};let B;const M=()=>{if(!t.current)return;t.current.querySelectorAll(".upload-label[data-file-name]").forEach(q=>{q.addEventListener("mouseenter",D),q.addEventListener("mouseleave",P)})};return B=requestAnimationFrame(()=>{B=requestAnimationFrame(M)}),()=>{cancelAnimationFrame(B),t.current&&t.current.querySelectorAll(".upload-label[data-file-name]").forEach(q=>{q.removeEventListener("mouseenter",D),q.removeEventListener("mouseleave",P)})}},[f,i,t,d])}function on(t,f,i,d){c.useEffect(()=>{const v=setTimeout(()=>{Je(t,f,i),Qe(t,f,i,d)},0);return()=>clearTimeout(v)},[i,f,t,d])}function sn(t,f){const i=c.useRef(0),d=c.useRef(0);c.useEffect(()=>{if(!t.current)return;let v=!1,D=0;const P=E=>E instanceof HTMLElement?!!(E.closest(".rte-datepicker-wrapper")||E.closest(".rte-datepicker-host")||E.closest(".ant-picker")||E.closest(".ant-picker-dropdown")):!1,B=E=>E instanceof HTMLElement?!!(E.closest(".rte-select-wrapper")||E.closest(".rte-select-host")||E.closest(".ant-select")||E.closest(".ant-select-dropdown")):!1,M=E=>{v=!0,P(E.target)&&(i.current=Date.now(),console.log("[SelectionCtrl] mousedown on datepicker target")),B(E.target)&&(d.current=Date.now(),console.log("[SelectionCtrl] mousedown on select target"))},L=()=>{v=!1,D=Date.now()};let q=!1,j=0;const S=()=>{q=!0},N=()=>{q=!1,j=Date.now()},e=()=>{j=Date.now()},n=E=>{P(E.target)&&(i.current=Date.now(),console.log("[SelectionCtrl] focusin datepicker target")),B(E.target)&&(d.current=Date.now(),console.log("[SelectionCtrl] focusin select target"))},s=()=>{if(Date.now()-i.current<800||Date.now()-d.current<800){console.log("[SelectionCtrl] skip selectionchange due to recent picker/select interaction");return}const E=document.activeElement;if(E&&(E.closest(".rte-datepicker-wrapper")||E.closest(".rte-datepicker-host")||E.closest(".ant-picker-dropdown")||E.tagName==="INPUT"&&E.closest(".ant-picker")||E.closest(".rte-select-wrapper")||E.closest(".rte-select-host")||E.closest(".ant-select")||E.closest(".ant-select-dropdown"))){console.log("[SelectionCtrl] activeElement is picker/select; skip");return}if(!t.current)return;const H=window.getSelection();if(!H||H.rangeCount===0||f.current||v||q||Date.now()-j<500)return;const F=H.getRangeAt(0);if(!F.collapsed)return t.current.contains(F.commonAncestorContainer),void 0;const T=H.anchorNode;if(!T||!t.current.contains(T))return;let ne=!1,K=!1;if(T.nodeType===Node.ELEMENT_NODE){const G=T;(G.closest('[data-type="datepicker"]')||G.closest(".rte-datepicker-wrapper")||G.closest(".rte-datepicker-host"))&&(ne=!0),(G.closest('[data-type="select"]')||G.closest(".rte-select-wrapper")||G.closest(".rte-select-host"))&&(K=!0)}else if(T.parentElement){const G=T.parentElement;(G.closest('[data-type="datepicker"]')||G.closest(".rte-datepicker-wrapper")||G.closest(".rte-datepicker-host"))&&(ne=!0),(G.closest('[data-type="select"]')||G.closest(".rte-select-wrapper")||G.closest(".rte-select-host"))&&(K=!0)}if(ne||K)return;let R=null;if(T.nodeType===Node.ELEMENT_NODE?R=T.closest('[data-type="variable"]'):T.nodeType===Node.TEXT_NODE&&T.parentElement&&(R=T.parentElement.closest('[data-type="variable"]')),!R){if(Date.now()-D>500)return;const G=t.current.querySelectorAll('[data-type="variable"]');if(G.length>0){let l=null;for(const _ of Array.from(G))if(_.style.display!=="none"){l=_;break}if(!l&&G.length>0&&(l=G[0]),l){const _=document.createRange();_.selectNodeContents(l),_.collapse(!1),H.removeAllRanges(),H.addRange(_),l.focus()}else H.removeAllRanges()}else H.removeAllRanges()}},u=t.current;return u&&(u.addEventListener("compositionstart",S),u.addEventListener("compositionend",N),u.addEventListener("input",e)),document.addEventListener("mousedown",M),document.addEventListener("mouseup",L),document.addEventListener("focusin",n),document.addEventListener("selectionchange",s),()=>{const E=t.current;E&&(E.removeEventListener("compositionstart",S),E.removeEventListener("compositionend",N),E.removeEventListener("input",e)),document.removeEventListener("mousedown",M),document.removeEventListener("mouseup",L),document.removeEventListener("focusin",n),document.removeEventListener("selectionchange",s)}},[t,f])}function ln(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fe={exports:{}},cn=Fe.exports,kt;function $t(){return kt||(kt=1,function(t,f){(function(i,d){t.exports=d()})(cn,function(){var i=1e3,d=6e4,v=36e5,D="millisecond",P="second",B="minute",M="hour",L="day",q="week",j="month",S="quarter",N="year",e="date",n="Invalid Date",s=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,u=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(y){var b=["th","st","nd","rd"],x=y%100;return"["+y+(b[(x-20)%10]||b[x]||b[0])+"]"}},H=function(y,b,x){var I=String(y);return!I||I.length>=b?y:""+Array(b+1-I.length).join(x)+y},F={s:H,z:function(y){var b=-y.utcOffset(),x=Math.abs(b),I=Math.floor(x/60),A=x%60;return(b<=0?"+":"-")+H(I,2,"0")+":"+H(A,2,"0")},m:function y(b,x){if(b.date()<x.date())return-y(x,b);var I=12*(x.year()-b.year())+(x.month()-b.month()),A=b.clone().add(I,j),X=x-A<0,J=b.clone().add(I+(X?-1:1),j);return+(-(I+(x-A)/(X?A-J:J-A))||0)},a:function(y){return y<0?Math.ceil(y)||0:Math.floor(y)},p:function(y){return{M:j,y:N,w:q,d:L,D:e,h:M,m:B,s:P,ms:D,Q:S}[y]||String(y||"").toLowerCase().replace(/s$/,"")},u:function(y){return y===void 0}},T="en",ne={};ne[T]=E;var K="$isDayjsObject",R=function(y){return y instanceof U||!(!y||!y[K])},G=function y(b,x,I){var A;if(!b)return T;if(typeof b=="string"){var X=b.toLowerCase();ne[X]&&(A=X),x&&(ne[X]=x,A=X);var J=b.split("-");if(!A&&J.length>1)return y(J[0])}else{var Z=b.name;ne[Z]=b,A=Z}return!I&&A&&(T=A),A||!I&&T},l=function(y,b){if(R(y))return y.clone();var x=typeof b=="object"?b:{};return x.date=y,x.args=arguments,new U(x)},_=F;_.l=G,_.i=R,_.w=function(y,b){return l(y,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var U=function(){function y(x){this.$L=G(x.locale,null,!0),this.parse(x),this.$x=this.$x||x.x||{},this[K]=!0}var b=y.prototype;return b.parse=function(x){this.$d=function(I){var A=I.date,X=I.utc;if(A===null)return new Date(NaN);if(_.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var J=A.match(s);if(J){var Z=J[2]-1||0,ee=(J[7]||"0").substring(0,3);return X?new Date(Date.UTC(J[1],Z,J[3]||1,J[4]||0,J[5]||0,J[6]||0,ee)):new Date(J[1],Z,J[3]||1,J[4]||0,J[5]||0,J[6]||0,ee)}}return new Date(A)}(x),this.init()},b.init=function(){var x=this.$d;this.$y=x.getFullYear(),this.$M=x.getMonth(),this.$D=x.getDate(),this.$W=x.getDay(),this.$H=x.getHours(),this.$m=x.getMinutes(),this.$s=x.getSeconds(),this.$ms=x.getMilliseconds()},b.$utils=function(){return _},b.isValid=function(){return this.$d.toString()!==n},b.isSame=function(x,I){var A=l(x);return this.startOf(I)<=A&&A<=this.endOf(I)},b.isAfter=function(x,I){return l(x)<this.startOf(I)},b.isBefore=function(x,I){return this.endOf(I)<l(x)},b.$g=function(x,I,A){return _.u(x)?this[I]:this.set(A,x)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(x,I){var A=this,X=!!_.u(I)||I,J=_.p(x),Z=function(ge,be){var ke=_.w(A.$u?Date.UTC(A.$y,be,ge):new Date(A.$y,be,ge),A);return X?ke:ke.endOf(L)},ee=function(ge,be){return _.w(A.toDate()[ge].apply(A.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(be)),A)},se=this.$W,ie=this.$M,ue=this.$D,he="set"+(this.$u?"UTC":"");switch(J){case N:return X?Z(1,0):Z(31,11);case j:return X?Z(1,ie):Z(0,ie+1);case q:var re=this.$locale().weekStart||0,me=(se<re?se+7:se)-re;return Z(X?ue-me:ue+(6-me),ie);case L:case e:return ee(he+"Hours",0);case M:return ee(he+"Minutes",1);case B:return ee(he+"Seconds",2);case P:return ee(he+"Milliseconds",3);default:return this.clone()}},b.endOf=function(x){return this.startOf(x,!1)},b.$set=function(x,I){var A,X=_.p(x),J="set"+(this.$u?"UTC":""),Z=(A={},A[L]=J+"Date",A[e]=J+"Date",A[j]=J+"Month",A[N]=J+"FullYear",A[M]=J+"Hours",A[B]=J+"Minutes",A[P]=J+"Seconds",A[D]=J+"Milliseconds",A)[X],ee=X===L?this.$D+(I-this.$W):I;if(X===j||X===N){var se=this.clone().set(e,1);se.$d[Z](ee),se.init(),this.$d=se.set(e,Math.min(this.$D,se.daysInMonth())).$d}else Z&&this.$d[Z](ee);return this.init(),this},b.set=function(x,I){return this.clone().$set(x,I)},b.get=function(x){return this[_.p(x)]()},b.add=function(x,I){var A,X=this;x=Number(x);var J=_.p(I),Z=function(ie){var ue=l(X);return _.w(ue.date(ue.date()+Math.round(ie*x)),X)};if(J===j)return this.set(j,this.$M+x);if(J===N)return this.set(N,this.$y+x);if(J===L)return Z(1);if(J===q)return Z(7);var ee=(A={},A[B]=d,A[M]=v,A[P]=i,A)[J]||1,se=this.$d.getTime()+x*ee;return _.w(se,this)},b.subtract=function(x,I){return this.add(-1*x,I)},b.format=function(x){var I=this,A=this.$locale();if(!this.isValid())return A.invalidDate||n;var X=x||"YYYY-MM-DDTHH:mm:ssZ",J=_.z(this),Z=this.$H,ee=this.$m,se=this.$M,ie=A.weekdays,ue=A.months,he=A.meridiem,re=function(be,ke,qe,Ie){return be&&(be[ke]||be(I,X))||qe[ke].slice(0,Ie)},me=function(be){return _.s(Z%12||12,be,"0")},ge=he||function(be,ke,qe){var Ie=be<12?"AM":"PM";return qe?Ie.toLowerCase():Ie};return X.replace(u,function(be,ke){return ke||function(qe){switch(qe){case"YY":return String(I.$y).slice(-2);case"YYYY":return _.s(I.$y,4,"0");case"M":return se+1;case"MM":return _.s(se+1,2,"0");case"MMM":return re(A.monthsShort,se,ue,3);case"MMMM":return re(ue,se);case"D":return I.$D;case"DD":return _.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return re(A.weekdaysMin,I.$W,ie,2);case"ddd":return re(A.weekdaysShort,I.$W,ie,3);case"dddd":return ie[I.$W];case"H":return String(Z);case"HH":return _.s(Z,2,"0");case"h":return me(1);case"hh":return me(2);case"a":return ge(Z,ee,!0);case"A":return ge(Z,ee,!1);case"m":return String(ee);case"mm":return _.s(ee,2,"0");case"s":return String(I.$s);case"ss":return _.s(I.$s,2,"0");case"SSS":return _.s(I.$ms,3,"0");case"Z":return J}return null}(be)||J.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(x,I,A){var X,J=this,Z=_.p(I),ee=l(x),se=(ee.utcOffset()-this.utcOffset())*d,ie=this-ee,ue=function(){return _.m(J,ee)};switch(Z){case N:X=ue()/12;break;case j:X=ue();break;case S:X=ue()/3;break;case q:X=(ie-se)/6048e5;break;case L:X=(ie-se)/864e5;break;case M:X=ie/v;break;case B:X=ie/d;break;case P:X=ie/i;break;default:X=ie}return A?X:_.a(X)},b.daysInMonth=function(){return this.endOf(j).$D},b.$locale=function(){return ne[this.$L]},b.locale=function(x,I){if(!x)return this.$L;var A=this.clone(),X=G(x,I,!0);return X&&(A.$L=X),A},b.clone=function(){return _.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},y}(),V=U.prototype;return l.prototype=V,[["$ms",D],["$s",P],["$m",B],["$H",M],["$W",L],["$M",j],["$y",N],["$D",e]].forEach(function(y){V[y[1]]=function(b){return this.$g(b,y[0],y[1])}}),l.extend=function(y,b){return y.$i||(y(b,U,l),y.$i=!0),l},l.locale=G,l.isDayjs=R,l.unix=function(y){return l(1e3*y)},l.en=ne[T],l.Ls=ne,l.p={},l})}(Fe)),Fe.exports}var un=$t();const Ge=ln(un);var ze={exports:{}},dn=ze.exports,Et;function pn(){return Et||(Et=1,function(t,f){(function(i,d){t.exports=d($t())})(dn,function(i){function d(P){return P&&typeof P=="object"&&"default"in P?P:{default:P}}var v=d(i),D={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(P,B){return B==="W"?P+"周":P+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(P,B){var M=100*P+B;return M<600?"凌晨":M<900?"早上":M<1100?"上午":M<1300?"中午":M<1800?"下午":"晚上"}};return v.default.locale(D,null,!0),D})}(ze)),ze.exports}pn();function Pe(t){"@babel/helpers - typeof";return Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},Pe(t)}function fn(t,f){if(Pe(t)!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var d=i.call(t,f);if(Pe(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(t)}function mn(t){var f=fn(t,"string");return Pe(f)=="symbol"?f:f+""}function yn(t,f,i){return(f=mn(f))in t?Object.defineProperty(t,f,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[f]=i,t}function Ct(t,f){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(t);f&&(d=d.filter(function(v){return Object.getOwnPropertyDescriptor(t,v).enumerable})),i.push.apply(i,d)}return i}function St(t){for(var f=1;f<arguments.length;f++){var i=arguments[f]!=null?arguments[f]:{};f%2?Ct(Object(i),!0).forEach(function(d){yn(t,d,i[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ct(Object(i)).forEach(function(d){Object.defineProperty(t,d,Object.getOwnPropertyDescriptor(i,d))})}return t}var hn={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},gn=St(St({},hn),{},{locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",week:"周",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪",yearFormat:"YYYY年",cellDateFormat:"D",monthBeforeYear:!1});const bn={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},Tt={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},gn),timePickerLocale:Object.assign({},bn)};Tt.lang.ok="确定",Ge.locale("zh-cn");const{RangePicker:xn}=oe.DatePicker,vn=({host:t,onChange:f})=>{const i=t.dataset.key,d=t.dataset.value,v=t.dataset.placeholder,D=t.dataset.limitRange?parseInt(t.dataset.limitRange,10):void 0,P=t.dataset.disableFuture==="true",[B,M]=c.useState(()=>{if(!d)return null;const n=d.split(",");return n.length===2&&n[0]&&n[1]?[Ge(n[0]),Ge(n[1])]:null}),[L,q]=c.useState(null),j=n=>n?P&&n.isAfter(Ge(),"day")?!0:!D||!L||!L[0]?!1:Math.abs(n.diff(L[0],"days"))>D:!1,S=n=>{console.log("[DatePicker] onCalendarChange",n?.map(s=>s?.format("YYYY-MM-DD")||null)),q(n)},N=n=>{if(console.log("[DatePicker] onChange",n?.map(s=>s?.format("YYYY-MM-DD")||null)),M(n),q(null),n&&n[0]&&n[1]){const s=`${n[0].format("YYYY-MM-DD")},${n[1].format("YYYY-MM-DD")}`;t.setAttribute("data-value",s),f(i,s)}else t.setAttribute("data-value",""),f(i,"")},e=n=>{console.log("[DatePicker] onOpenChange",n),q(n?B:null)};return Xe.createPortal(w.jsx("div",{className:"rte-datepicker-wrapper",contentEditable:!1,style:{display:"inline-block",verticalAlign:"middle",width:"260px",marginLeft:"4px",marginRight:"4px",fontSize:"16px",height:"30px",lineHeight:"30px"},children:w.jsx(xn,{value:B,disabledDate:j,onCalendarChange:S,onChange:N,onOpenChange:e,placeholder:[v||"开始日期",v||"结束日期"],style:{width:"100%"},size:"small",allowClear:!0,locale:Tt,getPopupContainer:()=>document.body,popupClassName:"rte-datepicker-dropdown"})}),t)},wn=t=>{const[f,i]=c.useState([]);return c.useEffect(()=>{const d=t.current;if(!d)return;const v=()=>{const P=d.querySelectorAll(".rte-datepicker-host"),B=[];P.forEach(M=>{const L=M.getAttribute("data-key");L&&B.push(w.jsx(vn,{host:M,onChange:()=>{if(t.current){const q=new Event("input",{bubbles:!0});t.current.dispatchEvent(q)}}},`datepicker-${L}`))}),i(B)};v();const D=new MutationObserver(P=>{let B=!1;for(const M of P)if(M.type==="childList"){let L=!1;if(M.addedNodes.forEach(q=>{if(q.nodeType===Node.ELEMENT_NODE){const j=q;(j.classList?.contains("rte-datepicker-host")||j.querySelector?.(".rte-datepicker-host"))&&(L=!0)}}),M.removedNodes.forEach(q=>{if(q.nodeType===Node.ELEMENT_NODE){const j=q;(j.classList?.contains("rte-datepicker-host")||j.querySelector?.(".rte-datepicker-host"))&&(L=!0)}}),L){B=!0;break}}B&&v()});return D.observe(d,{childList:!0,subtree:!0}),()=>D.disconnect()},[t]),f},He=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),At=t=>`\`\`\`
3
- ${(t||"").replace(/\r\n/g,`
1
+ (function(ve,G){typeof exports=="object"&&typeof module<"u"?G(exports,require("react/jsx-runtime"),require("react"),require("antd"),require("@ant-design/icons"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","antd","@ant-design/icons","react-dom"],G):(ve=typeof globalThis<"u"?globalThis:ve||self,G(ve.SealSeekBIComponents={},ve.React,ve.React,ve.antd,ve.AntdIcons,ve.ReactDOM))})(this,function(ve,G,R,xe,kt,Mr){"use strict";const mi=({variant:e="primary",loading:t=!1,children:n,...r})=>{const a=i=>{switch(i){case"primary":return"primary";case"ghost":return"default";case"dashed":return"dashed";case"link":return"link";case"text":return"text";default:return"primary"}};return G.jsx(xe.Button,{...r,type:a(e),loading:t,ghost:e==="ghost",children:n})};mi.__docgenInfo={displayName:"Button",description:"基础按钮,用于触发操作",props:{variant:{name:"variant",required:!1,description:"视觉风格",type:{name:"ButtonVariant",raw:'"primary" | "ghost" | "dashed" | "link" | "text"'},defaultValue:{value:'"primary"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: MouseEvent) => void"}}}};const gi=({title:e,children:t,bordered:n=!0,hoverable:r=!1,size:a="default",...i})=>G.jsx(xe.Card,{...i,title:e,bordered:n,hoverable:r,size:a,children:t});gi.__docgenInfo={displayName:"Card",description:"卡片容器,用于分组内容",props:{title:{name:"title",required:!1,description:"标题",type:{name:"ReactNode",raw:"React.ReactNode"}},children:{name:"children",required:!1,description:"内容区域",type:{name:"ReactNode",raw:"React.ReactNode"}},bordered:{name:"bordered",required:!1,description:"是否显示边框",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},hoverable:{name:"hoverable",required:!1,description:"是否可悬停",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},size:{name:"size",required:!1,description:"卡片大小",type:{name:"CardSize",raw:'"default" | "small"'},defaultValue:{value:'"default"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},actions:{name:"actions",required:!1,description:"卡片操作组",type:{name:"ReactNode[]",raw:"React.ReactNode[]"}}}};const Ei=({showDefaultFooter:e=!0,...t})=>{const n=t.footer!==void 0?t.footer:e?(r,{OkBtn:a,CancelBtn:i})=>G.jsxs(G.Fragment,{children:[G.jsx(a,{}),G.jsx(i,{})]}):null;return G.jsx(xe.Modal,{...t,footer:n})};Ei.__docgenInfo={displayName:"AppModal",description:"应用级模态框组件,基于 Ant Design Modal 封装",props:{showDefaultFooter:{name:"showDefaultFooter",required:!1,description:"是否显示默认的确定和取消按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},title:{name:"title",required:!1,description:"模态框标题",type:{name:"ReactNode",raw:"React.ReactNode"}},open:{name:"open",required:!1,description:"是否显示模态框",type:{name:"boolean",raw:"boolean"}},onCancel:{name:"onCancel",required:!1,description:"取消按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},onOk:{name:"onOk",required:!1,description:"确定按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},children:{name:"children",required:!1,description:"模态框内容",type:{name:"ReactNode",raw:"React.ReactNode"}},width:{name:"width",required:!1,description:"模态框宽度",type:{name:"string | number",raw:"string | number"}},centered:{name:"centered",required:!1,description:"是否居中显示",type:{name:"boolean",raw:"boolean"}},maskClosable:{name:"maskClosable",required:!1,description:"点击蒙层是否允许关闭",type:{name:"boolean",raw:"boolean"}}}};const bi=({scrollX:e,showPagination:t=!0,defaultPageSize:n=10,...r})=>G.jsx(xe.Table,{...r,scroll:{x:e||"max-content",y:"50vh"},pagination:t?{hideOnSinglePage:!0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:n,...r.pagination}:!1});bi.__docgenInfo={displayName:"PageTable",description:"页面级表格组件,高度铺满容器,自动滚动",props:{scrollX:{name:"scrollX",required:!1,description:"水平滚动宽度",type:{name:"number",raw:"number"}},showPagination:{name:"showPagination",required:!1,description:"是否显示分页器",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},columns:{name:"columns",required:!1,description:"表格列配置",type:{name:"ColumnType[]",raw:"ColumnType<any>[]"}},dataSource:{name:"dataSource",required:!1,description:"数据源",type:{name:"any[]",raw:"any[]"}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},rowKey:{name:"rowKey",required:!1,description:"行数据的 Key",type:{name:"string | function",raw:"string | ((record: any) => string)"}}}};const ul=kt.createFromIconfontCN({scriptUrl:["//at.alicdn.com/t/c/font_5037819_a72xy7yjoj.js"]}),Ti=({name:e,size:t,color:n,style:r,...a})=>{const i={fontSize:t,color:n,...r};return G.jsx(ul,{...a,type:e,style:i})};Ti.__docgenInfo={displayName:"XcIcon",description:"自定义图标组件,基于 iconfont",props:{name:{name:"name",required:!0,description:"图标名称",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"图标大小",type:{name:"number | string",raw:"number | string"}},color:{name:"color",required:!1,description:"图标颜色",type:{name:"string",raw:"string"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const yi=({loading:e,description:t="暂无数据",className:n,emptyChildren:r,loadingText:a,emptyImage:i})=>e?G.jsxs(xe.Flex,{className:`pt-10 w-full ${n||""}`,align:"center",justify:"center",vertical:!0,children:[G.jsx(xe.Spin,{size:"large"}),a&&G.jsx("div",{className:"mt-4 text-gray-500",children:a})]}):G.jsx(xe.Flex,{className:`pt-10 w-full ${n||""}`,align:"center",justify:"center",children:G.jsx(xe.Empty,{image:i,description:t,imageStyle:{height:180},children:r})});yi.__docgenInfo={displayName:"EmptyAndSpin",description:"空状态和加载状态组合组件",props:{loading:{name:"loading",required:!0,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},description:{name:"description",required:!1,description:"空状态描述",type:{name:"ReactNode",raw:"React.ReactNode"},defaultValue:{value:'"暂无数据"'}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},emptyChildren:{name:"emptyChildren",required:!1,description:"空状态额外内容",type:{name:"ReactNode",raw:"React.ReactNode"}},loadingText:{name:"loadingText",required:!1,description:"加载中提示文字",type:{name:"string",raw:"string"}},emptyImage:{name:"emptyImage",required:!1,description:"空状态图片",type:{name:"string",raw:"string"}}}};const xi=({onClick:e,showText:t=!1,className:n,size:r="small",type:a="default"})=>G.jsx(xe.Button,{size:r,type:a,icon:G.jsx(kt.LeftOutlined,{}),className:`cursor-pointer ${n||""}`,onClick:e,children:t&&"返回"});xi.__docgenInfo={displayName:"BackButton",description:"返回按钮组件",props:{onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"() => void"}},showText:{name:"showText",required:!1,description:"是否显示文字",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'},defaultValue:{value:'"small"'}},type:{name:"type",required:!1,description:"按钮类型",type:{name:"ButtonType",raw:'"primary" | "default" | "dashed" | "link" | "text"'},defaultValue:{value:'"default"'}}}};const Ai=({removePadding:e=!0,className:t,...n})=>{const r=e?`px-0 h-auto ${t||""}`:t;return G.jsx(xe.Button,{type:"link",...n,className:r,children:n.children})};Ai.__docgenInfo={displayName:"LinkButton",description:"链接样式按钮组件,适用于表格操作列",props:{removePadding:{name:"removePadding",required:!1,description:"是否去除默认内边距",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLButtonElement>) => void"}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}}}};const{Option:ll}=xe.Select,Ci=({columns:e,request:t,searchFields:n=[],showSearch:r=!0,showRefresh:a=!0,defaultPageSize:i=10,pageSizeOptions:s=["10","20","50","100"],autoLoad:u=!0,externalParams:o={},...d})=>{const[f,h]=R.useState([]),[g,p]=R.useState(!1),[c,E]=R.useState({current:1,pageSize:i,total:0}),[b,m]=R.useState({}),[x,A]=R.useState({}),[w]=xe.Form.useForm(),N=R.useRef(c);N.current=c;const F=R.useRef(o);F.current=o;const z=R.useRef(!1),O=R.useMemo(()=>e.map(I=>{const{sortable:T,render:$,...W}=I;return{...W,sorter:T?!0:void 0,render:$||(q=>q)}}),[e]),L=R.useCallback(async(I={})=>{if(t){p(!0);try{const T={page:N.current.current,pageSize:N.current.pageSize,sortField:x.field,sortOrder:x.order,searchParams:{...b,...F.current},...I},$=await t(T);$.success&&(h($.data),E(W=>({...W,total:$.total,current:T.page||W.current})))}catch(T){console.error("加载数据失败:",T)}finally{p(!1)}}},[t,x,b]),H=R.useCallback(I=>{m(I),E(T=>({...T,current:1}))},[]),y=R.useCallback(()=>{w.resetFields(),m({}),E(I=>({...I,current:1}))},[w]),D=R.useCallback(()=>{L()},[L]),U=R.useCallback((I,T,$)=>{const W={current:I.current||1,pageSize:I.pageSize||i,total:I.total||0},q={field:$?.field,order:$?.order};E(W),A(q)},[i]);return R.useEffect(()=>{const I=Object.keys(o).length>0;(u&&!z.current||I)&&(L(),z.current=!0)},[u,o,L]),G.jsxs("div",{children:[r&&n.length>0&&G.jsx(xe.Card,{size:"small",style:{marginBottom:16},children:G.jsxs(xe.Form,{form:w,layout:"inline",onFinish:H,initialValues:n.reduce((I,T)=>(T.defaultValue!==void 0&&(I[T.key]=T.defaultValue),I),{}),children:[n.map(I=>G.jsx(xe.Form.Item,{name:I.key,label:I.label,children:I.type==="input"?G.jsx(xe.Input,{placeholder:I.placeholder||`请输入${I.label}`,style:{width:200}}):G.jsx(xe.Select,{placeholder:I.placeholder||`请选择${I.label}`,style:{width:200},allowClear:!0,children:I.options?.map(T=>G.jsx(ll,{value:T.value,children:T.label},T.value))})},I.key)),G.jsx(xe.Form.Item,{children:G.jsxs(xe.Space,{children:[G.jsx(xe.Button,{type:"primary",htmlType:"submit",icon:G.jsx(kt.SearchOutlined,{}),children:"查询"}),G.jsx(xe.Button,{onClick:y,children:"重置"}),a&&G.jsx(xe.Button,{icon:G.jsx(kt.ReloadOutlined,{}),onClick:D,children:"刷新"})]})})]})}),G.jsx(xe.Table,{...d,columns:O,dataSource:f,loading:g,pagination:{...c,showSizeChanger:!0,showQuickJumper:!0,showTotal:(I,T)=>`第 ${T[0]}-${T[1]} 条/共 ${I} 条`,pageSizeOptions:s},onChange:U,scroll:{x:"max-content",y:"50vh"}})]})};Ci.__docgenInfo={displayName:"AdvancedTable",description:"高阶表格组件,支持异步请求、搜索、排序等功能",props:{columns:{name:"columns",required:!0,description:"列配置",type:{name:"AdvancedColumnType[]",raw:"AdvancedColumnType<any>[]"}},request:{name:"request",required:!1,description:"异步请求函数",type:{name:"function",raw:"(params: RequestParams) => Promise<RequestResponse>"}},searchFields:{name:"searchFields",required:!1,description:"搜索字段配置",type:{name:"SearchFieldConfig[]",raw:"SearchFieldConfig[]"},defaultValue:{value:"[]"}},showSearch:{name:"showSearch",required:!1,description:"是否显示搜索区域",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},showRefresh:{name:"showRefresh",required:!1,description:"是否显示刷新按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},pageSizeOptions:{name:"pageSizeOptions",required:!1,description:"页面大小选项",type:{name:"string[]",raw:"string[]"},defaultValue:{value:'["10", "20", "50", "100"]'}},autoLoad:{name:"autoLoad",required:!1,description:"是否自动加载",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},externalParams:{name:"externalParams",required:!1,description:"外部请求参数",type:{name:"Record<string, any>",raw:"Record<string, any>"},defaultValue:{value:"{}"}}}};function Si(e){return e!==null&&typeof e=="object"&&"constructor"in e&&e.constructor===Object}function Rr(e={},t={}){const n=["__proto__","constructor","prototype"];Object.keys(t).filter(r=>n.indexOf(r)<0).forEach(r=>{typeof e[r]>"u"?e[r]=t[r]:Si(t[r])&&Si(e[r])&&Object.keys(t[r]).length>0&&Rr(e[r],t[r])})}const _i={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Ft(){const e=typeof document<"u"?document:{};return Rr(e,_i),e}const cl={document:_i,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)}};function Ze(){const e=typeof window<"u"?window:{};return Rr(e,cl),e}function dl(e=""){return e.trim().split(" ").filter(t=>!!t.trim())}function fl(e){const t=e;Object.keys(t).forEach(n=>{try{t[n]=null}catch{}try{delete t[n]}catch{}})}function Ii(e,t=0){return setTimeout(e,t)}function Qn(){return Date.now()}function pl(e){const t=Ze();let n;return t.getComputedStyle&&(n=t.getComputedStyle(e,null)),!n&&e.currentStyle&&(n=e.currentStyle),n||(n=e.style),n}function hl(e,t="x"){const n=Ze();let r,a,i;const s=pl(e);return n.WebKitCSSMatrix?(a=s.transform||s.webkitTransform,a.split(",").length>6&&(a=a.split(", ").map(u=>u.replace(",",".")).join(", ")),i=new n.WebKitCSSMatrix(a==="none"?"":a)):(i=s.MozTransform||s.OTransform||s.MsTransform||s.msTransform||s.transform||s.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),r=i.toString().split(",")),t==="x"&&(n.WebKitCSSMatrix?a=i.m41:r.length===16?a=parseFloat(r[12]):a=parseFloat(r[4])),t==="y"&&(n.WebKitCSSMatrix?a=i.m42:r.length===16?a=parseFloat(r[13]):a=parseFloat(r[5])),a||0}function Jn(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"}function ml(e){return typeof window<"u"&&typeof window.HTMLElement<"u"?e instanceof HTMLElement:e&&(e.nodeType===1||e.nodeType===11)}function st(...e){const t=Object(e[0]),n=["__proto__","constructor","prototype"];for(let r=1;r<e.length;r+=1){const a=e[r];if(a!=null&&!ml(a)){const i=Object.keys(Object(a)).filter(s=>n.indexOf(s)<0);for(let s=0,u=i.length;s<u;s+=1){const o=i[s],d=Object.getOwnPropertyDescriptor(a,o);d!==void 0&&d.enumerable&&(Jn(t[o])&&Jn(a[o])?a[o].__swiper__?t[o]=a[o]:st(t[o],a[o]):!Jn(t[o])&&Jn(a[o])?(t[o]={},a[o].__swiper__?t[o]=a[o]:st(t[o],a[o])):t[o]=a[o])}}}return t}function Xt(e,t,n){e.style.setProperty(t,n)}function Ni({swiper:e,targetPosition:t,side:n}){const r=Ze(),a=-e.translate;let i=null,s;const u=e.params.speed;e.wrapperEl.style.scrollSnapType="none",r.cancelAnimationFrame(e.cssModeFrameID);const o=t>a?"next":"prev",d=(h,g)=>o==="next"&&h>=g||o==="prev"&&h<=g,f=()=>{s=new Date().getTime(),i===null&&(i=s);const h=Math.max(Math.min((s-i)/u,1),0),g=.5-Math.cos(h*Math.PI)/2;let p=a+g*(t-a);if(d(p,t)&&(p=t),e.wrapperEl.scrollTo({[n]:p}),d(p,t)){e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.scrollSnapType="",setTimeout(()=>{e.wrapperEl.style.overflow="",e.wrapperEl.scrollTo({[n]:p})}),r.cancelAnimationFrame(e.cssModeFrameID);return}e.cssModeFrameID=r.requestAnimationFrame(f)};f()}function mt(e,t=""){const n=Ze(),r=[...e.children];return n.HTMLSlotElement&&e instanceof HTMLSlotElement&&r.push(...e.assignedElements()),t?r.filter(a=>a.matches(t)):r}function gl(e,t){const n=[t];for(;n.length>0;){const r=n.shift();if(e===r)return!0;n.push(...r.children,...r.shadowRoot?r.shadowRoot.children:[],...r.assignedElements?r.assignedElements():[])}}function El(e,t){const n=Ze();let r=t.contains(e);return!r&&n.HTMLSlotElement&&t instanceof HTMLSlotElement&&(r=[...t.assignedElements()].includes(e),r||(r=gl(e,t))),r}function Zn(e){try{console.warn(e);return}catch{}}function er(e,t=[]){const n=document.createElement(e);return n.classList.add(...Array.isArray(t)?t:dl(t)),n}function bl(e,t){const n=[];for(;e.previousElementSibling;){const r=e.previousElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}function Tl(e,t){const n=[];for(;e.nextElementSibling;){const r=e.nextElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}function vt(e,t){return Ze().getComputedStyle(e,null).getPropertyValue(t)}function tr(e){let t=e,n;if(t){for(n=0;(t=t.previousSibling)!==null;)t.nodeType===1&&(n+=1);return n}}function ki(e,t){const n=[];let r=e.parentElement;for(;r;)t?r.matches(t)&&n.push(r):n.push(r),r=r.parentElement;return n}function Br(e,t,n){const r=Ze();return e[t==="width"?"offsetWidth":"offsetHeight"]+parseFloat(r.getComputedStyle(e,null).getPropertyValue(t==="width"?"margin-right":"margin-top"))+parseFloat(r.getComputedStyle(e,null).getPropertyValue(t==="width"?"margin-left":"margin-bottom"))}function Ye(e){return(Array.isArray(e)?e:[e]).filter(t=>!!t)}function gn(e,t=""){typeof trustedTypes<"u"?e.innerHTML=trustedTypes.createPolicy("html",{createHTML:n=>n}).createHTML(t):e.innerHTML=t}let Fr;function yl(){const e=Ze(),t=Ft();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}function vi(){return Fr||(Fr=yl()),Fr}let Hr;function xl({userAgent:e}={}){const t=vi(),n=Ze(),r=n.navigator.platform,a=e||n.navigator.userAgent,i={ios:!1,android:!1},s=n.screen.width,u=n.screen.height,o=a.match(/(Android);?[\s\/]+([\d.]+)?/);let d=a.match(/(iPad)(?!\1).*OS\s([\d_]+)/);const f=a.match(/(iPod)(.*OS\s([\d_]+))?/),h=!d&&a.match(/(iPhone\sOS|iOS)\s([\d_]+)/),g=r==="Win32";let p=r==="MacIntel";const c=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!d&&p&&t.touch&&c.indexOf(`${s}x${u}`)>=0&&(d=a.match(/(Version)\/([\d.]+)/),d||(d=[0,1,"13_0_0"]),p=!1),o&&!g&&(i.os="android",i.android=!0),(d||h||f)&&(i.os="ios",i.ios=!0),i}function wi(e={}){return Hr||(Hr=xl(e)),Hr}let Ur;function Al(){const e=Ze(),t=wi();let n=!1;function r(){const u=e.navigator.userAgent.toLowerCase();return u.indexOf("safari")>=0&&u.indexOf("chrome")<0&&u.indexOf("android")<0}if(r()){const u=String(e.navigator.userAgent);if(u.includes("Version/")){const[o,d]=u.split("Version/")[1].split(" ")[0].split(".").map(f=>Number(f));n=o<16||o===16&&d<2}}const a=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent),i=r(),s=i||a&&t.ios;return{isSafari:n||i,needPerspectiveFix:n,need3dFix:s,isWebView:a}}function Li(){return Ur||(Ur=Al()),Ur}function Cl({swiper:e,on:t,emit:n}){const r=Ze();let a=null,i=null;const s=()=>{!e||e.destroyed||!e.initialized||(n("beforeResize"),n("resize"))},u=()=>{!e||e.destroyed||!e.initialized||(a=new ResizeObserver(f=>{i=r.requestAnimationFrame(()=>{const{width:h,height:g}=e;let p=h,c=g;f.forEach(({contentBoxSize:E,contentRect:b,target:m})=>{m&&m!==e.el||(p=b?b.width:(E[0]||E).inlineSize,c=b?b.height:(E[0]||E).blockSize)}),(p!==h||c!==g)&&s()})}),a.observe(e.el))},o=()=>{i&&r.cancelAnimationFrame(i),a&&a.unobserve&&e.el&&(a.unobserve(e.el),a=null)},d=()=>{!e||e.destroyed||!e.initialized||n("orientationchange")};t("init",()=>{if(e.params.resizeObserver&&typeof r.ResizeObserver<"u"){u();return}r.addEventListener("resize",s),r.addEventListener("orientationchange",d)}),t("destroy",()=>{o(),r.removeEventListener("resize",s),r.removeEventListener("orientationchange",d)})}function Sl({swiper:e,extendParams:t,on:n,emit:r}){const a=[],i=Ze(),s=(d,f={})=>{const h=i.MutationObserver||i.WebkitMutationObserver,g=new h(p=>{if(e.__preventObserver__)return;if(p.length===1){r("observerUpdate",p[0]);return}const c=function(){r("observerUpdate",p[0])};i.requestAnimationFrame?i.requestAnimationFrame(c):i.setTimeout(c,0)});g.observe(d,{attributes:typeof f.attributes>"u"?!0:f.attributes,childList:e.isElement||(typeof f.childList>"u"?!0:f).childList,characterData:typeof f.characterData>"u"?!0:f.characterData}),a.push(g)},u=()=>{if(e.params.observer){if(e.params.observeParents){const d=ki(e.hostEl);for(let f=0;f<d.length;f+=1)s(d[f])}s(e.hostEl,{childList:e.params.observeSlideChildren}),s(e.wrapperEl,{attributes:!1})}},o=()=>{a.forEach(d=>{d.disconnect()}),a.splice(0,a.length)};t({observer:!1,observeParents:!1,observeSlideChildren:!1}),n("init",u),n("destroy",o)}var _l={on(e,t,n){const r=this;if(!r.eventsListeners||r.destroyed||typeof t!="function")return r;const a=n?"unshift":"push";return e.split(" ").forEach(i=>{r.eventsListeners[i]||(r.eventsListeners[i]=[]),r.eventsListeners[i][a](t)}),r},once(e,t,n){const r=this;if(!r.eventsListeners||r.destroyed||typeof t!="function")return r;function a(...i){r.off(e,a),a.__emitterProxy&&delete a.__emitterProxy,t.apply(r,i)}return a.__emitterProxy=t,r.on(e,a,n)},onAny(e,t){const n=this;if(!n.eventsListeners||n.destroyed||typeof e!="function")return n;const r=t?"unshift":"push";return n.eventsAnyListeners.indexOf(e)<0&&n.eventsAnyListeners[r](e),n},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsAnyListeners)return t;const n=t.eventsAnyListeners.indexOf(e);return n>=0&&t.eventsAnyListeners.splice(n,1),t},off(e,t){const n=this;return!n.eventsListeners||n.destroyed||!n.eventsListeners||e.split(" ").forEach(r=>{typeof t>"u"?n.eventsListeners[r]=[]:n.eventsListeners[r]&&n.eventsListeners[r].forEach((a,i)=>{(a===t||a.__emitterProxy&&a.__emitterProxy===t)&&n.eventsListeners[r].splice(i,1)})}),n},emit(...e){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsListeners)return t;let n,r,a;return typeof e[0]=="string"||Array.isArray(e[0])?(n=e[0],r=e.slice(1,e.length),a=t):(n=e[0].events,r=e[0].data,a=e[0].context||t),r.unshift(a),(Array.isArray(n)?n:n.split(" ")).forEach(s=>{t.eventsAnyListeners&&t.eventsAnyListeners.length&&t.eventsAnyListeners.forEach(u=>{u.apply(a,[s,...r])}),t.eventsListeners&&t.eventsListeners[s]&&t.eventsListeners[s].forEach(u=>{u.apply(a,r)})}),t}};function Il(){const e=this;let t,n;const r=e.el;typeof e.params.width<"u"&&e.params.width!==null?t=e.params.width:t=r.clientWidth,typeof e.params.height<"u"&&e.params.height!==null?n=e.params.height:n=r.clientHeight,!(t===0&&e.isHorizontal()||n===0&&e.isVertical())&&(t=t-parseInt(vt(r,"padding-left")||0,10)-parseInt(vt(r,"padding-right")||0,10),n=n-parseInt(vt(r,"padding-top")||0,10)-parseInt(vt(r,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(n)&&(n=0),Object.assign(e,{width:t,height:n,size:e.isHorizontal()?t:n}))}function Nl(){const e=this;function t(H,y){return parseFloat(H.getPropertyValue(e.getDirectionLabel(y))||0)}const n=e.params,{wrapperEl:r,slidesEl:a,rtlTranslate:i,wrongRTL:s}=e,u=e.virtual&&n.virtual.enabled,o=u?e.virtual.slides.length:e.slides.length,d=mt(a,`.${e.params.slideClass}, swiper-slide`),f=u?e.virtual.slides.length:d.length;let h=[];const g=[],p=[];let c=n.slidesOffsetBefore;typeof c=="function"&&(c=n.slidesOffsetBefore.call(e));let E=n.slidesOffsetAfter;typeof E=="function"&&(E=n.slidesOffsetAfter.call(e));const b=e.snapGrid.length,m=e.slidesGrid.length,x=e.size-c-E;let A=n.spaceBetween,w=-c,N=0,F=0;if(typeof x>"u")return;typeof A=="string"&&A.indexOf("%")>=0?A=parseFloat(A.replace("%",""))/100*x:typeof A=="string"&&(A=parseFloat(A)),e.virtualSize=-A-c-E,d.forEach(H=>{i?H.style.marginLeft="":H.style.marginRight="",H.style.marginBottom="",H.style.marginTop=""}),n.centeredSlides&&n.cssMode&&(Xt(r,"--swiper-centered-offset-before",""),Xt(r,"--swiper-centered-offset-after","")),n.cssMode&&(Xt(r,"--swiper-slides-offset-before",`${c}px`),Xt(r,"--swiper-slides-offset-after",`${E}px`));const z=n.grid&&n.grid.rows>1&&e.grid;z?e.grid.initSlides(d):e.grid&&e.grid.unsetSlides();let O;const L=n.slidesPerView==="auto"&&n.breakpoints&&Object.keys(n.breakpoints).filter(H=>typeof n.breakpoints[H].slidesPerView<"u").length>0;for(let H=0;H<f;H+=1){O=0;const y=d[H];if(!(y&&(z&&e.grid.updateSlide(H,y,d),vt(y,"display")==="none"))){if(u&&n.slidesPerView==="auto")n.virtual.slidesPerViewAutoSlideSize&&(O=n.virtual.slidesPerViewAutoSlideSize),O&&y&&(n.roundLengths&&(O=Math.floor(O)),y.style[e.getDirectionLabel("width")]=`${O}px`);else if(n.slidesPerView==="auto"){L&&(y.style[e.getDirectionLabel("width")]="");const D=getComputedStyle(y),U=y.style.transform,I=y.style.webkitTransform;if(U&&(y.style.transform="none"),I&&(y.style.webkitTransform="none"),n.roundLengths)O=e.isHorizontal()?Br(y,"width"):Br(y,"height");else{const T=t(D,"width"),$=t(D,"padding-left"),W=t(D,"padding-right"),q=t(D,"margin-left"),ne=t(D,"margin-right"),S=D.getPropertyValue("box-sizing");if(S&&S==="border-box")O=T+q+ne;else{const{clientWidth:pe,offsetWidth:ce}=y;O=T+$+W+q+ne+(ce-pe)}}U&&(y.style.transform=U),I&&(y.style.webkitTransform=I),n.roundLengths&&(O=Math.floor(O))}else O=(x-(n.slidesPerView-1)*A)/n.slidesPerView,n.roundLengths&&(O=Math.floor(O)),y&&(y.style[e.getDirectionLabel("width")]=`${O}px`);y&&(y.swiperSlideSize=O),p.push(O),n.centeredSlides?(w=w+O/2+N/2+A,N===0&&H!==0&&(w=w-x/2-A),H===0&&(w=w-x/2-A),Math.abs(w)<1/1e3&&(w=0),n.roundLengths&&(w=Math.floor(w)),F%n.slidesPerGroup===0&&h.push(w),g.push(w)):(n.roundLengths&&(w=Math.floor(w)),(F-Math.min(e.params.slidesPerGroupSkip,F))%e.params.slidesPerGroup===0&&h.push(w),g.push(w),w=w+O+A),e.virtualSize+=O+A,N=O,F+=1}}if(e.virtualSize=Math.max(e.virtualSize,x)+E,i&&s&&(n.effect==="slide"||n.effect==="coverflow")&&(r.style.width=`${e.virtualSize+A}px`),n.setWrapperSize&&(r.style[e.getDirectionLabel("width")]=`${e.virtualSize+A}px`),z&&e.grid.updateWrapperSize(O,h),!n.centeredSlides){const H=n.slidesPerView!=="auto"&&n.slidesPerView%1!==0,y=n.snapToSlideEdge&&!n.loop&&(n.slidesPerView==="auto"||H);let D=h.length;if(y){let I;if(n.slidesPerView==="auto"){I=1;let T=0;for(let $=p.length-1;$>=0&&(T+=p[$]+($<p.length-1?A:0),T<=x);$-=1)I=p.length-$}else I=Math.floor(n.slidesPerView);D=Math.max(f-I,0)}const U=[];for(let I=0;I<h.length;I+=1){let T=h[I];n.roundLengths&&(T=Math.floor(T)),y?I<=D&&U.push(T):h[I]<=e.virtualSize-x&&U.push(T)}h=U,Math.floor(e.virtualSize-x)-Math.floor(h[h.length-1])>1&&(y||h.push(e.virtualSize-x))}if(u&&n.loop){const H=p[0]+A;if(n.slidesPerGroup>1){const y=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/n.slidesPerGroup),D=H*n.slidesPerGroup;for(let U=0;U<y;U+=1)h.push(h[h.length-1]+D)}for(let y=0;y<e.virtual.slidesBefore+e.virtual.slidesAfter;y+=1)n.slidesPerGroup===1&&h.push(h[h.length-1]+H),g.push(g[g.length-1]+H),e.virtualSize+=H}if(h.length===0&&(h=[0]),A!==0){const H=e.isHorizontal()&&i?"marginLeft":e.getDirectionLabel("marginRight");d.filter((y,D)=>!n.cssMode||n.loop?!0:D!==d.length-1).forEach(y=>{y.style[H]=`${A}px`})}if(n.centeredSlides&&n.centeredSlidesBounds){let H=0;p.forEach(D=>{H+=D+(A||0)}),H-=A;const y=H>x?H-x:0;h=h.map(D=>D<=0?-c:D>y?y+E:D)}if(n.centerInsufficientSlides){let H=0;p.forEach(D=>{H+=D+(A||0)}),H-=A;const y=(c||0)+(E||0);if(H+y<x){const D=(x-H-y)/2;h.forEach((U,I)=>{h[I]=U-D}),g.forEach((U,I)=>{g[I]=U+D})}}if(Object.assign(e,{slides:d,snapGrid:h,slidesGrid:g,slidesSizesGrid:p}),n.centeredSlides&&n.cssMode&&!n.centeredSlidesBounds){Xt(r,"--swiper-centered-offset-before",`${-h[0]}px`),Xt(r,"--swiper-centered-offset-after",`${e.size/2-p[p.length-1]/2}px`);const H=-e.snapGrid[0],y=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map(D=>D+H),e.slidesGrid=e.slidesGrid.map(D=>D+y)}if(f!==o&&e.emit("slidesLengthChange"),h.length!==b&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),g.length!==m&&e.emit("slidesGridLengthChange"),n.watchSlidesProgress&&e.updateSlidesOffset(),e.emit("slidesUpdated"),!u&&!n.cssMode&&(n.effect==="slide"||n.effect==="fade")){const H=`${n.containerModifierClass}backface-hidden`,y=e.el.classList.contains(H);f<=n.maxBackfaceHiddenSlides?y||e.el.classList.add(H):y&&e.el.classList.remove(H)}}function kl(e){const t=this,n=[],r=t.virtual&&t.params.virtual.enabled;let a=0,i;typeof e=="number"?t.setTransition(e):e===!0&&t.setTransition(t.params.speed);const s=u=>r?t.slides[t.getSlideIndexByData(u)]:t.slides[u];if(t.params.slidesPerView!=="auto"&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach(u=>{n.push(u)});else for(i=0;i<Math.ceil(t.params.slidesPerView);i+=1){const u=t.activeIndex+i;if(u>t.slides.length&&!r)break;n.push(s(u))}else n.push(s(t.activeIndex));for(i=0;i<n.length;i+=1)if(typeof n[i]<"u"){const u=n[i].offsetHeight;a=u>a?u:a}(a||a===0)&&(t.wrapperEl.style.height=`${a}px`)}function vl(){const e=this,t=e.slides,n=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let r=0;r<t.length;r+=1)t[r].swiperSlideOffset=(e.isHorizontal()?t[r].offsetLeft:t[r].offsetTop)-n-e.cssOverflowAdjustment()}const Oi=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};function wl(e=this&&this.translate||0){const t=this,n=t.params,{slides:r,rtlTranslate:a,snapGrid:i}=t;if(r.length===0)return;typeof r[0].swiperSlideOffset>"u"&&t.updateSlidesOffset();let s=-e;a&&(s=e),t.visibleSlidesIndexes=[],t.visibleSlides=[];let u=n.spaceBetween;typeof u=="string"&&u.indexOf("%")>=0?u=parseFloat(u.replace("%",""))/100*t.size:typeof u=="string"&&(u=parseFloat(u));for(let o=0;o<r.length;o+=1){const d=r[o];let f=d.swiperSlideOffset;n.cssMode&&n.centeredSlides&&(f-=r[0].swiperSlideOffset);const h=(s+(n.centeredSlides?t.minTranslate():0)-f)/(d.swiperSlideSize+u),g=(s-i[0]+(n.centeredSlides?t.minTranslate():0)-f)/(d.swiperSlideSize+u),p=-(s-f),c=p+t.slidesSizesGrid[o],E=p>=0&&p<=t.size-t.slidesSizesGrid[o],b=p>=0&&p<t.size-1||c>1&&c<=t.size||p<=0&&c>=t.size;b&&(t.visibleSlides.push(d),t.visibleSlidesIndexes.push(o)),Oi(d,b,n.slideVisibleClass),Oi(d,E,n.slideFullyVisibleClass),d.progress=a?-h:h,d.originalProgress=a?-g:g}}function Ll(e){const t=this;if(typeof e>"u"){const f=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*f||0}const n=t.params,r=t.maxTranslate()-t.minTranslate();let{progress:a,isBeginning:i,isEnd:s,progressLoop:u}=t;const o=i,d=s;if(r===0)a=0,i=!0,s=!0;else{a=(e-t.minTranslate())/r;const f=Math.abs(e-t.minTranslate())<1,h=Math.abs(e-t.maxTranslate())<1;i=f||a<=0,s=h||a>=1,f&&(a=0),h&&(a=1)}if(n.loop){const f=t.getSlideIndexByData(0),h=t.getSlideIndexByData(t.slides.length-1),g=t.slidesGrid[f],p=t.slidesGrid[h],c=t.slidesGrid[t.slidesGrid.length-1],E=Math.abs(e);E>=g?u=(E-g)/c:u=(E+c-p)/c,u>1&&(u-=1)}Object.assign(t,{progress:a,progressLoop:u,isBeginning:i,isEnd:s}),(n.watchSlidesProgress||n.centeredSlides&&n.autoHeight)&&t.updateSlidesProgress(e),i&&!o&&t.emit("reachBeginning toEdge"),s&&!d&&t.emit("reachEnd toEdge"),(o&&!i||d&&!s)&&t.emit("fromEdge"),t.emit("progress",a)}const $r=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};function Ol(){const e=this,{slides:t,params:n,slidesEl:r,activeIndex:a}=e,i=e.virtual&&n.virtual.enabled,s=e.grid&&n.grid&&n.grid.rows>1,u=h=>mt(r,`.${n.slideClass}${h}, swiper-slide${h}`)[0];let o,d,f;if(i)if(n.loop){let h=a-e.virtual.slidesBefore;h<0&&(h=e.virtual.slides.length+h),h>=e.virtual.slides.length&&(h-=e.virtual.slides.length),o=u(`[data-swiper-slide-index="${h}"]`)}else o=u(`[data-swiper-slide-index="${a}"]`);else s?(o=t.find(h=>h.column===a),f=t.find(h=>h.column===a+1),d=t.find(h=>h.column===a-1)):o=t[a];o&&(s||(f=Tl(o,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!f&&(f=t[0]),d=bl(o,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!d===0&&(d=t[t.length-1]))),t.forEach(h=>{$r(h,h===o,n.slideActiveClass),$r(h,h===f,n.slideNextClass),$r(h,h===d,n.slidePrevClass)}),e.emitSlidesClasses()}const nr=(e,t)=>{if(!e||e.destroyed||!e.params)return;const n=()=>e.isElement?"swiper-slide":`.${e.params.slideClass}`,r=t.closest(n());if(r){let a=r.querySelector(`.${e.params.lazyPreloaderClass}`);!a&&e.isElement&&(r.shadowRoot?a=r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{r.shadowRoot&&(a=r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`),a&&!a.lazyPreloaderManaged&&a.remove())})),a&&!a.lazyPreloaderManaged&&a.remove()}},qr=(e,t)=>{if(!e.slides[t])return;const n=e.slides[t].querySelector('[loading="lazy"]');n&&n.removeAttribute("loading")},zr=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const n=e.slides.length;if(!n||!t||t<0)return;t=Math.min(t,n);const r=e.params.slidesPerView==="auto"?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),a=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const s=a,u=[s-t];u.push(...Array.from({length:t}).map((o,d)=>s+r+d)),e.slides.forEach((o,d)=>{u.includes(o.column)&&qr(e,d)});return}const i=a+r-1;if(e.params.rewind||e.params.loop)for(let s=a-t;s<=i+t;s+=1){const u=(s%n+n)%n;(u<a||u>i)&&qr(e,u)}else for(let s=Math.max(a-t,0);s<=Math.min(i+t,n-1);s+=1)s!==a&&(s>i||s<a)&&qr(e,s)};function Dl(e){const{slidesGrid:t,params:n}=e,r=e.rtlTranslate?e.translate:-e.translate;let a;for(let i=0;i<t.length;i+=1)typeof t[i+1]<"u"?r>=t[i]&&r<t[i+1]-(t[i+1]-t[i])/2?a=i:r>=t[i]&&r<t[i+1]&&(a=i+1):r>=t[i]&&(a=i);return n.normalizeSlideIndex&&(a<0||typeof a>"u")&&(a=0),a}function Pl(e){const t=this,n=t.rtlTranslate?t.translate:-t.translate,{snapGrid:r,params:a,activeIndex:i,realIndex:s,snapIndex:u}=t;let o=e,d;const f=p=>{let c=p-t.virtual.slidesBefore;return c<0&&(c=t.virtual.slides.length+c),c>=t.virtual.slides.length&&(c-=t.virtual.slides.length),c};if(typeof o>"u"&&(o=Dl(t)),r.indexOf(n)>=0)d=r.indexOf(n);else{const p=Math.min(a.slidesPerGroupSkip,o);d=p+Math.floor((o-p)/a.slidesPerGroup)}if(d>=r.length&&(d=r.length-1),o===i&&!t.params.loop){d!==u&&(t.snapIndex=d,t.emit("snapIndexChange"));return}if(o===i&&t.params.loop&&t.virtual&&t.params.virtual.enabled){t.realIndex=f(o);return}const h=t.grid&&a.grid&&a.grid.rows>1;let g;if(t.virtual&&a.virtual.enabled)a.loop?g=f(o):g=o;else if(h){const p=t.slides.find(E=>E.column===o);let c=parseInt(p.getAttribute("data-swiper-slide-index"),10);Number.isNaN(c)&&(c=Math.max(t.slides.indexOf(p),0)),g=Math.floor(c/a.grid.rows)}else if(t.slides[o]){const p=t.slides[o].getAttribute("data-swiper-slide-index");p?g=parseInt(p,10):g=o}else g=o;Object.assign(t,{previousSnapIndex:u,snapIndex:d,previousRealIndex:s,realIndex:g,previousIndex:i,activeIndex:o}),t.initialized&&zr(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(s!==g&&t.emit("realIndexChange"),t.emit("slideChange"))}function Ml(e,t){const n=this,r=n.params;let a=e.closest(`.${r.slideClass}, swiper-slide`);!a&&n.isElement&&t&&t.length>1&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach(u=>{!a&&u.matches&&u.matches(`.${r.slideClass}, swiper-slide`)&&(a=u)});let i=!1,s;if(a){for(let u=0;u<n.slides.length;u+=1)if(n.slides[u]===a){i=!0,s=u;break}}if(a&&i)n.clickedSlide=a,n.virtual&&n.params.virtual.enabled?n.clickedIndex=parseInt(a.getAttribute("data-swiper-slide-index"),10):n.clickedIndex=s;else{n.clickedSlide=void 0,n.clickedIndex=void 0;return}r.slideToClickedSlide&&n.clickedIndex!==void 0&&n.clickedIndex!==n.activeIndex&&n.slideToClickedSlide()}var Rl={updateSize:Il,updateSlides:Nl,updateAutoHeight:kl,updateSlidesOffset:vl,updateSlidesProgress:wl,updateProgress:Ll,updateSlidesClasses:Ol,updateActiveIndex:Pl,updateClickedSlide:Ml};function Bl(e=this.isHorizontal()?"x":"y"){const t=this,{params:n,rtlTranslate:r,translate:a,wrapperEl:i}=t;if(n.virtualTranslate)return r?-a:a;if(n.cssMode)return a;let s=hl(i,e);return s+=t.cssOverflowAdjustment(),r&&(s=-s),s||0}function Fl(e,t){const n=this,{rtlTranslate:r,params:a,wrapperEl:i,progress:s}=n;let u=0,o=0;const d=0;n.isHorizontal()?u=r?-e:e:o=e,a.roundLengths&&(u=Math.floor(u),o=Math.floor(o)),n.previousTranslate=n.translate,n.translate=n.isHorizontal()?u:o,a.cssMode?i[n.isHorizontal()?"scrollLeft":"scrollTop"]=n.isHorizontal()?-u:-o:a.virtualTranslate||(n.isHorizontal()?u-=n.cssOverflowAdjustment():o-=n.cssOverflowAdjustment(),i.style.transform=`translate3d(${u}px, ${o}px, ${d}px)`);let f;const h=n.maxTranslate()-n.minTranslate();h===0?f=0:f=(e-n.minTranslate())/h,f!==s&&n.updateProgress(e),n.emit("setTranslate",n.translate,t)}function Hl(){return-this.snapGrid[0]}function Ul(){return-this.snapGrid[this.snapGrid.length-1]}function $l(e=0,t=this.params.speed,n=!0,r=!0,a){const i=this,{params:s,wrapperEl:u}=i;if(i.animating&&s.preventInteractionOnTransition)return!1;const o=i.minTranslate(),d=i.maxTranslate();let f;if(r&&e>o?f=o:r&&e<d?f=d:f=e,i.updateProgress(f),s.cssMode){const h=i.isHorizontal();if(t===0)u[h?"scrollLeft":"scrollTop"]=-f;else{if(!i.support.smoothScroll)return Ni({swiper:i,targetPosition:-f,side:h?"left":"top"}),!0;u.scrollTo({[h?"left":"top"]:-f,behavior:"smooth"})}return!0}return t===0?(i.setTransition(0),i.setTranslate(f),n&&(i.emit("beforeTransitionStart",t,a),i.emit("transitionEnd"))):(i.setTransition(t),i.setTranslate(f),n&&(i.emit("beforeTransitionStart",t,a),i.emit("transitionStart")),i.animating||(i.animating=!0,i.onTranslateToWrapperTransitionEnd||(i.onTranslateToWrapperTransitionEnd=function(g){!i||i.destroyed||g.target===this&&(i.wrapperEl.removeEventListener("transitionend",i.onTranslateToWrapperTransitionEnd),i.onTranslateToWrapperTransitionEnd=null,delete i.onTranslateToWrapperTransitionEnd,i.animating=!1,n&&i.emit("transitionEnd"))}),i.wrapperEl.addEventListener("transitionend",i.onTranslateToWrapperTransitionEnd))),!0}var ql={getTranslate:Bl,setTranslate:Fl,minTranslate:Hl,maxTranslate:Ul,translateTo:$l};function zl(e,t){const n=this;n.params.cssMode||(n.wrapperEl.style.transitionDuration=`${e}ms`,n.wrapperEl.style.transitionDelay=e===0?"0ms":""),n.emit("setTransition",e,t)}function Di({swiper:e,runCallbacks:t,direction:n,step:r}){const{activeIndex:a,previousIndex:i}=e;let s=n;s||(a>i?s="next":a<i?s="prev":s="reset"),e.emit(`transition${r}`),t&&s==="reset"?e.emit(`slideResetTransition${r}`):t&&a!==i&&(e.emit(`slideChangeTransition${r}`),s==="next"?e.emit(`slideNextTransition${r}`):e.emit(`slidePrevTransition${r}`))}function Vl(e=!0,t){const n=this,{params:r}=n;r.cssMode||(r.autoHeight&&n.updateAutoHeight(),Di({swiper:n,runCallbacks:e,direction:t,step:"Start"}))}function Yl(e=!0,t){const n=this,{params:r}=n;n.animating=!1,!r.cssMode&&(n.setTransition(0),Di({swiper:n,runCallbacks:e,direction:t,step:"End"}))}var Gl={setTransition:zl,transitionStart:Vl,transitionEnd:Yl};function Wl(e=0,t,n=!0,r,a){typeof e=="string"&&(e=parseInt(e,10));const i=this;let s=e;s<0&&(s=0);const{params:u,snapGrid:o,slidesGrid:d,previousIndex:f,activeIndex:h,rtlTranslate:g,wrapperEl:p,enabled:c}=i;if(!c&&!r&&!a||i.destroyed||i.animating&&u.preventInteractionOnTransition)return!1;typeof t>"u"&&(t=i.params.speed);const E=Math.min(i.params.slidesPerGroupSkip,s);let b=E+Math.floor((s-E)/i.params.slidesPerGroup);b>=o.length&&(b=o.length-1);const m=-o[b];if(u.normalizeSlideIndex)for(let z=0;z<d.length;z+=1){const O=-Math.floor(m*100),L=Math.floor(d[z]*100),H=Math.floor(d[z+1]*100);typeof d[z+1]<"u"?O>=L&&O<H-(H-L)/2?s=z:O>=L&&O<H&&(s=z+1):O>=L&&(s=z)}if(i.initialized&&s!==h&&(!i.allowSlideNext&&(g?m>i.translate&&m>i.minTranslate():m<i.translate&&m<i.minTranslate())||!i.allowSlidePrev&&m>i.translate&&m>i.maxTranslate()&&(h||0)!==s))return!1;s!==(f||0)&&n&&i.emit("beforeSlideChangeStart"),i.updateProgress(m);let x;s>h?x="next":s<h?x="prev":x="reset";const A=i.virtual&&i.params.virtual.enabled;if(!(A&&a)&&(g&&-m===i.translate||!g&&m===i.translate))return i.updateActiveIndex(s),u.autoHeight&&i.updateAutoHeight(),i.updateSlidesClasses(),u.effect!=="slide"&&i.setTranslate(m),x!=="reset"&&(i.transitionStart(n,x),i.transitionEnd(n,x)),!1;if(u.cssMode){const z=i.isHorizontal(),O=g?m:-m;if(t===0)A&&(i.wrapperEl.style.scrollSnapType="none",i._immediateVirtual=!0),A&&!i._cssModeVirtualInitialSet&&i.params.initialSlide>0?(i._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{p[z?"scrollLeft":"scrollTop"]=O})):p[z?"scrollLeft":"scrollTop"]=O,A&&requestAnimationFrame(()=>{i.wrapperEl.style.scrollSnapType="",i._immediateVirtual=!1});else{if(!i.support.smoothScroll)return Ni({swiper:i,targetPosition:O,side:z?"left":"top"}),!0;p.scrollTo({[z?"left":"top"]:O,behavior:"smooth"})}return!0}const F=Li().isSafari;return A&&!a&&F&&i.isElement&&i.virtual.update(!1,!1,s),i.setTransition(t),i.setTranslate(m),i.updateActiveIndex(s),i.updateSlidesClasses(),i.emit("beforeTransitionStart",t,r),i.transitionStart(n,x),t===0?i.transitionEnd(n,x):i.animating||(i.animating=!0,i.onSlideToWrapperTransitionEnd||(i.onSlideToWrapperTransitionEnd=function(O){!i||i.destroyed||O.target===this&&(i.wrapperEl.removeEventListener("transitionend",i.onSlideToWrapperTransitionEnd),i.onSlideToWrapperTransitionEnd=null,delete i.onSlideToWrapperTransitionEnd,i.transitionEnd(n,x))}),i.wrapperEl.addEventListener("transitionend",i.onSlideToWrapperTransitionEnd)),!0}function jl(e=0,t,n=!0,r){typeof e=="string"&&(e=parseInt(e,10));const a=this;if(a.destroyed)return;typeof t>"u"&&(t=a.params.speed);const i=a.grid&&a.params.grid&&a.params.grid.rows>1;let s=e;if(a.params.loop)if(a.virtual&&a.params.virtual.enabled)s=s+a.virtual.slidesBefore;else{let u;if(i){const E=s*a.params.grid.rows;u=a.slides.find(b=>b.getAttribute("data-swiper-slide-index")*1===E).column}else u=a.getSlideIndexByData(s);const o=i?Math.ceil(a.slides.length/a.params.grid.rows):a.slides.length,{centeredSlides:d,slidesOffsetBefore:f,slidesOffsetAfter:h}=a.params,g=d||!!f||!!h;let p=a.params.slidesPerView;p==="auto"?p=a.slidesPerViewDynamic():(p=Math.ceil(parseFloat(a.params.slidesPerView,10)),g&&p%2===0&&(p=p+1));let c=o-u<p;if(g&&(c=c||u<Math.ceil(p/2)),r&&g&&a.params.slidesPerView!=="auto"&&!i&&(c=!1),c){const E=g?u<a.activeIndex?"prev":"next":u-a.activeIndex-1<a.params.slidesPerView?"next":"prev";a.loopFix({direction:E,slideTo:!0,activeSlideIndex:E==="next"?u+1:u-o+1,slideRealIndex:E==="next"?a.realIndex:void 0})}if(i){const E=s*a.params.grid.rows;s=a.slides.find(b=>b.getAttribute("data-swiper-slide-index")*1===E).column}else s=a.getSlideIndexByData(s)}return requestAnimationFrame(()=>{a.slideTo(s,t,n,r)}),a}function Xl(e,t=!0,n){const r=this,{enabled:a,params:i,animating:s}=r;if(!a||r.destroyed)return r;typeof e>"u"&&(e=r.params.speed);let u=i.slidesPerGroup;i.slidesPerView==="auto"&&i.slidesPerGroup===1&&i.slidesPerGroupAuto&&(u=Math.max(r.slidesPerViewDynamic("current",!0),1));const o=r.activeIndex<i.slidesPerGroupSkip?1:u,d=r.virtual&&i.virtual.enabled;if(i.loop){if(s&&!d&&i.loopPreventsSliding)return!1;if(r.loopFix({direction:"next"}),r._clientLeft=r.wrapperEl.clientLeft,r.activeIndex===r.slides.length-1&&i.cssMode)return requestAnimationFrame(()=>{r.slideTo(r.activeIndex+o,e,t,n)}),!0}return i.rewind&&r.isEnd?r.slideTo(0,e,t,n):r.slideTo(r.activeIndex+o,e,t,n)}function Kl(e,t=!0,n){const r=this,{params:a,snapGrid:i,slidesGrid:s,rtlTranslate:u,enabled:o,animating:d}=r;if(!o||r.destroyed)return r;typeof e>"u"&&(e=r.params.speed);const f=r.virtual&&a.virtual.enabled;if(a.loop){if(d&&!f&&a.loopPreventsSliding)return!1;r.loopFix({direction:"prev"}),r._clientLeft=r.wrapperEl.clientLeft}const h=u?r.translate:-r.translate;function g(x){return x<0?-Math.floor(Math.abs(x)):Math.floor(x)}const p=g(h),c=i.map(x=>g(x)),E=a.freeMode&&a.freeMode.enabled;let b=i[c.indexOf(p)-1];if(typeof b>"u"&&(a.cssMode||E)){let x;i.forEach((A,w)=>{p>=A&&(x=w)}),typeof x<"u"&&(b=E?i[x]:i[x>0?x-1:x])}let m=0;if(typeof b<"u"&&(m=s.indexOf(b),m<0&&(m=r.activeIndex-1),a.slidesPerView==="auto"&&a.slidesPerGroup===1&&a.slidesPerGroupAuto&&(m=m-r.slidesPerViewDynamic("previous",!0)+1,m=Math.max(m,0))),a.rewind&&r.isBeginning){const x=r.params.virtual&&r.params.virtual.enabled&&r.virtual?r.virtual.slides.length-1:r.slides.length-1;return r.slideTo(x,e,t,n)}else if(a.loop&&r.activeIndex===0&&a.cssMode)return requestAnimationFrame(()=>{r.slideTo(m,e,t,n)}),!0;return r.slideTo(m,e,t,n)}function Ql(e,t=!0,n){const r=this;if(!r.destroyed)return typeof e>"u"&&(e=r.params.speed),r.slideTo(r.activeIndex,e,t,n)}function Jl(e,t=!0,n,r=.5){const a=this;if(a.destroyed)return;typeof e>"u"&&(e=a.params.speed);let i=a.activeIndex;const s=Math.min(a.params.slidesPerGroupSkip,i),u=s+Math.floor((i-s)/a.params.slidesPerGroup),o=a.rtlTranslate?a.translate:-a.translate;if(o>=a.snapGrid[u]){const d=a.snapGrid[u],f=a.snapGrid[u+1];o-d>(f-d)*r&&(i+=a.params.slidesPerGroup)}else{const d=a.snapGrid[u-1],f=a.snapGrid[u];o-d<=(f-d)*r&&(i-=a.params.slidesPerGroup)}return i=Math.max(i,0),i=Math.min(i,a.slidesGrid.length-1),a.slideTo(i,e,t,n)}function Zl(){const e=this;if(e.destroyed)return;const{params:t,slidesEl:n}=e,r=t.slidesPerView==="auto"?e.slidesPerViewDynamic():t.slidesPerView;let a=e.getSlideIndexWhenGrid(e.clickedIndex),i;const s=e.isElement?"swiper-slide":`.${t.slideClass}`,u=e.grid&&e.params.grid&&e.params.grid.rows>1;if(t.loop){if(e.animating)return;i=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?e.slideToLoop(i):a>(u?(e.slides.length-r)/2-(e.params.grid.rows-1):e.slides.length-r)?(e.loopFix(),a=e.getSlideIndex(mt(n,`${s}[data-swiper-slide-index="${i}"]`)[0]),Ii(()=>{e.slideTo(a)})):e.slideTo(a)}else e.slideTo(a)}var ec={slideTo:Wl,slideToLoop:jl,slideNext:Xl,slidePrev:Kl,slideReset:Ql,slideToClosest:Jl,slideToClickedSlide:Zl};function tc(e,t){const n=this,{params:r,slidesEl:a}=n;if(!r.loop||n.virtual&&n.params.virtual.enabled)return;const i=()=>{mt(a,`.${r.slideClass}, swiper-slide`).forEach((c,E)=>{c.setAttribute("data-swiper-slide-index",E)})},s=()=>{const p=mt(a,`.${r.slideBlankClass}`);p.forEach(c=>{c.remove()}),p.length>0&&(n.recalcSlides(),n.updateSlides())},u=n.grid&&r.grid&&r.grid.rows>1;r.loopAddBlankSlides&&(r.slidesPerGroup>1||u)&&s();const o=r.slidesPerGroup*(u?r.grid.rows:1),d=n.slides.length%o!==0,f=u&&n.slides.length%r.grid.rows!==0,h=p=>{for(let c=0;c<p;c+=1){const E=n.isElement?er("swiper-slide",[r.slideBlankClass]):er("div",[r.slideClass,r.slideBlankClass]);n.slidesEl.append(E)}};if(d){if(r.loopAddBlankSlides){const p=o-n.slides.length%o;h(p),n.recalcSlides(),n.updateSlides()}else Zn("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else if(f){if(r.loopAddBlankSlides){const p=r.grid.rows-n.slides.length%r.grid.rows;h(p),n.recalcSlides(),n.updateSlides()}else Zn("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else i();const g=r.centeredSlides||!!r.slidesOffsetBefore||!!r.slidesOffsetAfter;n.loopFix({slideRealIndex:e,direction:g?void 0:"next",initial:t})}function nc({slideRealIndex:e,slideTo:t=!0,direction:n,setTranslate:r,activeSlideIndex:a,initial:i,byController:s,byMousewheel:u}={}){const o=this;if(!o.params.loop)return;o.emit("beforeLoopFix");const{slides:d,allowSlidePrev:f,allowSlideNext:h,slidesEl:g,params:p}=o,{centeredSlides:c,slidesOffsetBefore:E,slidesOffsetAfter:b,initialSlide:m}=p,x=c||!!E||!!b;if(o.allowSlidePrev=!0,o.allowSlideNext=!0,o.virtual&&p.virtual.enabled){t&&(!x&&o.snapIndex===0?o.slideTo(o.virtual.slides.length,0,!1,!0):x&&o.snapIndex<p.slidesPerView?o.slideTo(o.virtual.slides.length+o.snapIndex,0,!1,!0):o.snapIndex===o.snapGrid.length-1&&o.slideTo(o.virtual.slidesBefore,0,!1,!0)),o.allowSlidePrev=f,o.allowSlideNext=h,o.emit("loopFix");return}let A=p.slidesPerView;A==="auto"?A=o.slidesPerViewDynamic():(A=Math.ceil(parseFloat(p.slidesPerView,10)),x&&A%2===0&&(A=A+1));const w=p.slidesPerGroupAuto?A:p.slidesPerGroup;let N=x?Math.max(w,Math.ceil(A/2)):w;N%w!==0&&(N+=w-N%w),N+=p.loopAdditionalSlides,o.loopedSlides=N;const F=o.grid&&p.grid&&p.grid.rows>1;d.length<A+N||o.params.effect==="cards"&&d.length<A+N*2?Zn("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):F&&p.grid.fill==="row"&&Zn("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const z=[],O=[],L=F?Math.ceil(d.length/p.grid.rows):d.length,H=i&&L-m<A&&!x;let y=H?m:o.activeIndex;typeof a>"u"?a=o.getSlideIndex(d.find(q=>q.classList.contains(p.slideActiveClass))):y=a;const D=n==="next"||!n,U=n==="prev"||!n;let I=0,T=0;const W=(F?d[a].column:a)+(x&&typeof r>"u"?-A/2+.5:0);if(W<N){I=Math.max(N-W,w);for(let q=0;q<N-W;q+=1){const ne=q-Math.floor(q/L)*L;if(F){const S=L-ne-1;for(let pe=d.length-1;pe>=0;pe-=1)d[pe].column===S&&z.push(pe)}else z.push(L-ne-1)}}else if(W+A>L-N){T=Math.max(W-(L-N*2),w),H&&(T=Math.max(T,A-L+m+1));for(let q=0;q<T;q+=1){const ne=q-Math.floor(q/L)*L;F?d.forEach((S,pe)=>{S.column===ne&&O.push(pe)}):O.push(ne)}}if(o.__preventObserver__=!0,requestAnimationFrame(()=>{o.__preventObserver__=!1}),o.params.effect==="cards"&&d.length<A+N*2&&(O.includes(a)&&O.splice(O.indexOf(a),1),z.includes(a)&&z.splice(z.indexOf(a),1)),U&&z.forEach(q=>{d[q].swiperLoopMoveDOM=!0,g.prepend(d[q]),d[q].swiperLoopMoveDOM=!1}),D&&O.forEach(q=>{d[q].swiperLoopMoveDOM=!0,g.append(d[q]),d[q].swiperLoopMoveDOM=!1}),o.recalcSlides(),p.slidesPerView==="auto"?o.updateSlides():F&&(z.length>0&&U||O.length>0&&D)&&o.slides.forEach((q,ne)=>{o.grid.updateSlide(ne,q,o.slides)}),p.watchSlidesProgress&&o.updateSlidesOffset(),t){if(z.length>0&&U){if(typeof e>"u"){const q=o.slidesGrid[y],S=o.slidesGrid[y+I]-q;u?o.setTranslate(o.translate-S):(o.slideTo(y+Math.ceil(I),0,!1,!0),r&&(o.touchEventsData.startTranslate=o.touchEventsData.startTranslate-S,o.touchEventsData.currentTranslate=o.touchEventsData.currentTranslate-S))}else if(r){const q=F?z.length/p.grid.rows:z.length;o.slideTo(o.activeIndex+q,0,!1,!0),o.touchEventsData.currentTranslate=o.translate}}else if(O.length>0&&D)if(typeof e>"u"){const q=o.slidesGrid[y],S=o.slidesGrid[y-T]-q;u?o.setTranslate(o.translate-S):(o.slideTo(y-T,0,!1,!0),r&&(o.touchEventsData.startTranslate=o.touchEventsData.startTranslate-S,o.touchEventsData.currentTranslate=o.touchEventsData.currentTranslate-S))}else{const q=F?O.length/p.grid.rows:O.length;o.slideTo(o.activeIndex-q,0,!1,!0)}}if(o.allowSlidePrev=f,o.allowSlideNext=h,o.controller&&o.controller.control&&!s){const q={slideRealIndex:e,direction:n,setTranslate:r,activeSlideIndex:a,byController:!0};Array.isArray(o.controller.control)?o.controller.control.forEach(ne=>{!ne.destroyed&&ne.params.loop&&ne.loopFix({...q,slideTo:ne.params.slidesPerView===p.slidesPerView?t:!1})}):o.controller.control instanceof o.constructor&&o.controller.control.params.loop&&o.controller.control.loopFix({...q,slideTo:o.controller.control.params.slidesPerView===p.slidesPerView?t:!1})}o.emit("loopFix")}function rc(){const e=this,{params:t,slidesEl:n}=e;if(!t.loop||!n||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const r=[];e.slides.forEach(a=>{const i=typeof a.swiperSlideIndex>"u"?a.getAttribute("data-swiper-slide-index")*1:a.swiperSlideIndex;r[i]=a}),e.slides.forEach(a=>{a.removeAttribute("data-swiper-slide-index")}),r.forEach(a=>{n.append(a)}),e.recalcSlides(),e.slideTo(e.realIndex,0)}var ac={loopCreate:tc,loopFix:nc,loopDestroy:rc};function ic(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const n=t.params.touchEventsTarget==="container"?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),n.style.cursor="move",n.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1})}function sc(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e[e.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1}))}var oc={setGrabCursor:ic,unsetGrabCursor:sc};function uc(e,t=this){function n(r){if(!r||r===Ft()||r===Ze())return null;r.assignedSlot&&(r=r.assignedSlot);const a=r.closest(e);return!a&&!r.getRootNode?null:a||n(r.getRootNode().host)}return n(t)}function Pi(e,t,n){const r=Ze(),{params:a}=e,i=a.edgeSwipeDetection,s=a.edgeSwipeThreshold;return i&&(n<=s||n>=r.innerWidth-s)?i==="prevent"?(t.preventDefault(),!0):!1:!0}function lc(e){const t=this,n=Ft();let r=e;r.originalEvent&&(r=r.originalEvent);const a=t.touchEventsData;if(r.type==="pointerdown"){if(a.pointerId!==null&&a.pointerId!==r.pointerId)return;a.pointerId=r.pointerId}else r.type==="touchstart"&&r.targetTouches.length===1&&(a.touchId=r.targetTouches[0].identifier);if(r.type==="touchstart"){Pi(t,r,r.targetTouches[0].pageX);return}const{params:i,touches:s,enabled:u}=t;if(!u||!i.simulateTouch&&r.pointerType==="mouse"||t.animating&&i.preventInteractionOnTransition)return;!t.animating&&i.cssMode&&i.loop&&t.loopFix();let o=r.target;if(i.touchEventsTarget==="wrapper"&&!El(o,t.wrapperEl)||"which"in r&&r.which===3||"button"in r&&r.button>0||a.isTouched&&a.isMoved)return;const d=!!i.noSwipingClass&&i.noSwipingClass!=="",f=r.composedPath?r.composedPath():r.path;d&&r.target&&r.target.shadowRoot&&f&&(o=f[0]);const h=i.noSwipingSelector?i.noSwipingSelector:`.${i.noSwipingClass}`,g=!!(r.target&&r.target.shadowRoot);if(i.noSwiping&&(g?uc(h,o):o.closest(h))){t.allowClick=!0;return}if(i.swipeHandler&&!o.closest(i.swipeHandler))return;s.currentX=r.pageX,s.currentY=r.pageY;const p=s.currentX,c=s.currentY;if(!Pi(t,r,p))return;Object.assign(a,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),s.startX=p,s.startY=c,a.touchStartTime=Qn(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,i.threshold>0&&(a.allowThresholdMove=!1);let E=!0;o.matches(a.focusableElements)&&(E=!1,o.nodeName==="SELECT"&&(a.isTouched=!1)),n.activeElement&&n.activeElement.matches(a.focusableElements)&&n.activeElement!==o&&(r.pointerType==="mouse"||r.pointerType!=="mouse"&&!o.matches(a.focusableElements))&&n.activeElement.blur();const b=E&&t.allowTouchMove&&i.touchStartPreventDefault;(i.touchStartForcePreventDefault||b)&&!o.isContentEditable&&r.preventDefault(),i.freeMode&&i.freeMode.enabled&&t.freeMode&&t.animating&&!i.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",r)}function cc(e){const t=Ft(),n=this,r=n.touchEventsData,{params:a,touches:i,rtlTranslate:s,enabled:u}=n;if(!u||!a.simulateTouch&&e.pointerType==="mouse")return;let o=e;if(o.originalEvent&&(o=o.originalEvent),o.type==="pointermove"&&(r.touchId!==null||o.pointerId!==r.pointerId))return;let d;if(o.type==="touchmove"){if(d=[...o.changedTouches].find(N=>N.identifier===r.touchId),!d||d.identifier!==r.touchId)return}else d=o;if(!r.isTouched){r.startMoving&&r.isScrolling&&n.emit("touchMoveOpposite",o);return}const f=d.pageX,h=d.pageY;if(o.preventedByNestedSwiper){i.startX=f,i.startY=h;return}if(!n.allowTouchMove){o.target.matches(r.focusableElements)||(n.allowClick=!1),r.isTouched&&(Object.assign(i,{startX:f,startY:h,currentX:f,currentY:h}),r.touchStartTime=Qn());return}if(a.touchReleaseOnEdges&&!a.loop)if(n.isVertical()){if(h<i.startY&&n.translate<=n.maxTranslate()||h>i.startY&&n.translate>=n.minTranslate()){r.isTouched=!1,r.isMoved=!1;return}}else{if(s&&(f>i.startX&&-n.translate<=n.maxTranslate()||f<i.startX&&-n.translate>=n.minTranslate()))return;if(!s&&(f<i.startX&&n.translate<=n.maxTranslate()||f>i.startX&&n.translate>=n.minTranslate()))return}if(t.activeElement&&t.activeElement.matches(r.focusableElements)&&t.activeElement!==o.target&&o.pointerType!=="mouse"&&t.activeElement.blur(),t.activeElement&&o.target===t.activeElement&&o.target.matches(r.focusableElements)){r.isMoved=!0,n.allowClick=!1;return}r.allowTouchCallbacks&&n.emit("touchMove",o),i.previousX=i.currentX,i.previousY=i.currentY,i.currentX=f,i.currentY=h;const g=i.currentX-i.startX,p=i.currentY-i.startY;if(n.params.threshold&&Math.sqrt(g**2+p**2)<n.params.threshold)return;if(typeof r.isScrolling>"u"){let N;n.isHorizontal()&&i.currentY===i.startY||n.isVertical()&&i.currentX===i.startX?r.isScrolling=!1:g*g+p*p>=25&&(N=Math.atan2(Math.abs(p),Math.abs(g))*180/Math.PI,r.isScrolling=n.isHorizontal()?N>a.touchAngle:90-N>a.touchAngle)}if(r.isScrolling&&n.emit("touchMoveOpposite",o),typeof r.startMoving>"u"&&(i.currentX!==i.startX||i.currentY!==i.startY)&&(r.startMoving=!0),r.isScrolling||o.type==="touchmove"&&r.preventTouchMoveFromPointerMove){r.isTouched=!1;return}if(!r.startMoving)return;n.allowClick=!1,!a.cssMode&&o.cancelable&&o.preventDefault(),a.touchMoveStopPropagation&&!a.nested&&o.stopPropagation();let c=n.isHorizontal()?g:p,E=n.isHorizontal()?i.currentX-i.previousX:i.currentY-i.previousY;a.oneWayMovement&&(c=Math.abs(c)*(s?1:-1),E=Math.abs(E)*(s?1:-1)),i.diff=c,c*=a.touchRatio,s&&(c=-c,E=-E);const b=n.touchesDirection;n.swipeDirection=c>0?"prev":"next",n.touchesDirection=E>0?"prev":"next";const m=n.params.loop&&!a.cssMode,x=n.touchesDirection==="next"&&n.allowSlideNext||n.touchesDirection==="prev"&&n.allowSlidePrev;if(!r.isMoved){if(m&&x&&n.loopFix({direction:n.swipeDirection}),r.startTranslate=n.getTranslate(),n.setTransition(0),n.animating){const N=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});n.wrapperEl.dispatchEvent(N)}r.allowMomentumBounce=!1,a.grabCursor&&(n.allowSlideNext===!0||n.allowSlidePrev===!0)&&n.setGrabCursor(!0),n.emit("sliderFirstMove",o)}if(new Date().getTime(),a._loopSwapReset!==!1&&r.isMoved&&r.allowThresholdMove&&b!==n.touchesDirection&&m&&x&&Math.abs(c)>=1){Object.assign(i,{startX:f,startY:h,currentX:f,currentY:h,startTranslate:r.currentTranslate}),r.loopSwapReset=!0,r.startTranslate=r.currentTranslate;return}n.emit("sliderMove",o),r.isMoved=!0,r.currentTranslate=c+r.startTranslate;let A=!0,w=a.resistanceRatio;if(a.touchReleaseOnEdges&&(w=0),c>0?(m&&x&&r.allowThresholdMove&&r.currentTranslate>(a.centeredSlides?n.minTranslate()-n.slidesSizesGrid[n.activeIndex+1]-(a.slidesPerView!=="auto"&&n.slides.length-a.slidesPerView>=2?n.slidesSizesGrid[n.activeIndex+1]+n.params.spaceBetween:0)-n.params.spaceBetween:n.minTranslate())&&n.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),r.currentTranslate>n.minTranslate()&&(A=!1,a.resistance&&(r.currentTranslate=n.minTranslate()-1+(-n.minTranslate()+r.startTranslate+c)**w))):c<0&&(m&&x&&r.allowThresholdMove&&r.currentTranslate<(a.centeredSlides?n.maxTranslate()+n.slidesSizesGrid[n.slidesSizesGrid.length-1]+n.params.spaceBetween+(a.slidesPerView!=="auto"&&n.slides.length-a.slidesPerView>=2?n.slidesSizesGrid[n.slidesSizesGrid.length-1]+n.params.spaceBetween:0):n.maxTranslate())&&n.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:n.slides.length-(a.slidesPerView==="auto"?n.slidesPerViewDynamic():Math.ceil(parseFloat(a.slidesPerView,10)))}),r.currentTranslate<n.maxTranslate()&&(A=!1,a.resistance&&(r.currentTranslate=n.maxTranslate()+1-(n.maxTranslate()-r.startTranslate-c)**w))),A&&(o.preventedByNestedSwiper=!0),!n.allowSlideNext&&n.swipeDirection==="next"&&r.currentTranslate<r.startTranslate&&(r.currentTranslate=r.startTranslate),!n.allowSlidePrev&&n.swipeDirection==="prev"&&r.currentTranslate>r.startTranslate&&(r.currentTranslate=r.startTranslate),!n.allowSlidePrev&&!n.allowSlideNext&&(r.currentTranslate=r.startTranslate),a.threshold>0)if(Math.abs(c)>a.threshold||r.allowThresholdMove){if(!r.allowThresholdMove){r.allowThresholdMove=!0,i.startX=i.currentX,i.startY=i.currentY,r.currentTranslate=r.startTranslate,i.diff=n.isHorizontal()?i.currentX-i.startX:i.currentY-i.startY;return}}else{r.currentTranslate=r.startTranslate;return}!a.followFinger||a.cssMode||((a.freeMode&&a.freeMode.enabled&&n.freeMode||a.watchSlidesProgress)&&(n.updateActiveIndex(),n.updateSlidesClasses()),a.freeMode&&a.freeMode.enabled&&n.freeMode&&n.freeMode.onTouchMove(),n.updateProgress(r.currentTranslate),n.setTranslate(r.currentTranslate))}function dc(e){const t=this,n=t.touchEventsData;let r=e;r.originalEvent&&(r=r.originalEvent);let a;if(r.type==="touchend"||r.type==="touchcancel"){if(a=[...r.changedTouches].find(N=>N.identifier===n.touchId),!a||a.identifier!==n.touchId)return}else{if(n.touchId!==null||r.pointerId!==n.pointerId)return;a=r}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(r.type)&&!(["pointercancel","contextmenu"].includes(r.type)&&(t.browser.isSafari||t.browser.isWebView)))return;n.pointerId=null,n.touchId=null;const{params:s,touches:u,rtlTranslate:o,slidesGrid:d,enabled:f}=t;if(!f||!s.simulateTouch&&r.pointerType==="mouse")return;if(n.allowTouchCallbacks&&t.emit("touchEnd",r),n.allowTouchCallbacks=!1,!n.isTouched){n.isMoved&&s.grabCursor&&t.setGrabCursor(!1),n.isMoved=!1,n.startMoving=!1;return}s.grabCursor&&n.isMoved&&n.isTouched&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!1);const h=Qn(),g=h-n.touchStartTime;if(t.allowClick){const N=r.path||r.composedPath&&r.composedPath();t.updateClickedSlide(N&&N[0]||r.target,N),t.emit("tap click",r),g<300&&h-n.lastClickTime<300&&t.emit("doubleTap doubleClick",r)}if(n.lastClickTime=Qn(),Ii(()=>{t.destroyed||(t.allowClick=!0)}),!n.isTouched||!n.isMoved||!t.swipeDirection||u.diff===0&&!n.loopSwapReset||n.currentTranslate===n.startTranslate&&!n.loopSwapReset){n.isTouched=!1,n.isMoved=!1,n.startMoving=!1;return}n.isTouched=!1,n.isMoved=!1,n.startMoving=!1;let p;if(s.followFinger?p=o?t.translate:-t.translate:p=-n.currentTranslate,s.cssMode)return;if(s.freeMode&&s.freeMode.enabled){t.freeMode.onTouchEnd({currentPos:p});return}const c=p>=-t.maxTranslate()&&!t.params.loop;let E=0,b=t.slidesSizesGrid[0];for(let N=0;N<d.length;N+=N<s.slidesPerGroupSkip?1:s.slidesPerGroup){const F=N<s.slidesPerGroupSkip-1?1:s.slidesPerGroup;typeof d[N+F]<"u"?(c||p>=d[N]&&p<d[N+F])&&(E=N,b=d[N+F]-d[N]):(c||p>=d[N])&&(E=N,b=d[d.length-1]-d[d.length-2])}let m=null,x=null;s.rewind&&(t.isBeginning?x=s.virtual&&s.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(m=0));const A=(p-d[E])/b,w=E<s.slidesPerGroupSkip-1?1:s.slidesPerGroup;if(g>s.longSwipesMs){if(!s.longSwipes){t.slideTo(t.activeIndex);return}t.swipeDirection==="next"&&(A>=s.longSwipesRatio?t.slideTo(s.rewind&&t.isEnd?m:E+w):t.slideTo(E)),t.swipeDirection==="prev"&&(A>1-s.longSwipesRatio?t.slideTo(E+w):x!==null&&A<0&&Math.abs(A)>s.longSwipesRatio?t.slideTo(x):t.slideTo(E))}else{if(!s.shortSwipes){t.slideTo(t.activeIndex);return}t.navigation&&(r.target===t.navigation.nextEl||r.target===t.navigation.prevEl)?r.target===t.navigation.nextEl?t.slideTo(E+w):t.slideTo(E):(t.swipeDirection==="next"&&t.slideTo(m!==null?m:E+w),t.swipeDirection==="prev"&&t.slideTo(x!==null?x:E))}}function Mi(){const e=this,{params:t,el:n}=e;if(n&&n.offsetWidth===0)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:r,allowSlidePrev:a,snapGrid:i}=e,s=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const u=s&&t.loop;(t.slidesPerView==="auto"||t.slidesPerView>1)&&e.isEnd&&!e.isBeginning&&!e.params.centeredSlides&&!u?e.slideTo(e.slides.length-1,0,!1,!0):e.params.loop&&!s?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout(()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()},500)),e.allowSlidePrev=a,e.allowSlideNext=r,e.params.watchOverflow&&i!==e.snapGrid&&e.checkOverflow()}function fc(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function pc(){const e=this,{wrapperEl:t,rtlTranslate:n,enabled:r}=e;if(!r)return;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,e.translate===0&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();let a;const i=e.maxTranslate()-e.minTranslate();i===0?a=0:a=(e.translate-e.minTranslate())/i,a!==e.progress&&e.updateProgress(n?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function hc(e){const t=this;nr(t,e.target),!(t.params.cssMode||t.params.slidesPerView!=="auto"&&!t.params.autoHeight)&&t.update()}function mc(){const e=this;e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}const Ri=(e,t)=>{const n=Ft(),{params:r,el:a,wrapperEl:i,device:s}=e,u=!!r.nested,o=t==="on"?"addEventListener":"removeEventListener",d=t;!a||typeof a=="string"||(n[o]("touchstart",e.onDocumentTouchStart,{passive:!1,capture:u}),a[o]("touchstart",e.onTouchStart,{passive:!1}),a[o]("pointerdown",e.onTouchStart,{passive:!1}),n[o]("touchmove",e.onTouchMove,{passive:!1,capture:u}),n[o]("pointermove",e.onTouchMove,{passive:!1,capture:u}),n[o]("touchend",e.onTouchEnd,{passive:!0}),n[o]("pointerup",e.onTouchEnd,{passive:!0}),n[o]("pointercancel",e.onTouchEnd,{passive:!0}),n[o]("touchcancel",e.onTouchEnd,{passive:!0}),n[o]("pointerout",e.onTouchEnd,{passive:!0}),n[o]("pointerleave",e.onTouchEnd,{passive:!0}),n[o]("contextmenu",e.onTouchEnd,{passive:!0}),(r.preventClicks||r.preventClicksPropagation)&&a[o]("click",e.onClick,!0),r.cssMode&&i[o]("scroll",e.onScroll),r.updateOnWindowResize?e[d](s.ios||s.android?"resize orientationchange observerUpdate":"resize observerUpdate",Mi,!0):e[d]("observerUpdate",Mi,!0),a[o]("load",e.onLoad,{capture:!0}))};function gc(){const e=this,{params:t}=e;e.onTouchStart=lc.bind(e),e.onTouchMove=cc.bind(e),e.onTouchEnd=dc.bind(e),e.onDocumentTouchStart=mc.bind(e),t.cssMode&&(e.onScroll=pc.bind(e)),e.onClick=fc.bind(e),e.onLoad=hc.bind(e),Ri(e,"on")}function Ec(){Ri(this,"off")}var bc={attachEvents:gc,detachEvents:Ec};const Bi=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;function Tc(){const e=this,{realIndex:t,initialized:n,params:r,el:a}=e,i=r.breakpoints;if(!i||i&&Object.keys(i).length===0)return;const s=Ft(),u=r.breakpointsBase==="window"||!r.breakpointsBase?r.breakpointsBase:"container",o=["window","container"].includes(r.breakpointsBase)||!r.breakpointsBase?e.el:s.querySelector(r.breakpointsBase),d=e.getBreakpoint(i,u,o);if(!d||e.currentBreakpoint===d)return;const h=(d in i?i[d]:void 0)||e.originalParams,g=Bi(e,r),p=Bi(e,h),c=e.params.grabCursor,E=h.grabCursor,b=r.enabled;g&&!p?(a.classList.remove(`${r.containerModifierClass}grid`,`${r.containerModifierClass}grid-column`),e.emitContainerClasses()):!g&&p&&(a.classList.add(`${r.containerModifierClass}grid`),(h.grid.fill&&h.grid.fill==="column"||!h.grid.fill&&r.grid.fill==="column")&&a.classList.add(`${r.containerModifierClass}grid-column`),e.emitContainerClasses()),c&&!E?e.unsetGrabCursor():!c&&E&&e.setGrabCursor(),["navigation","pagination","scrollbar"].forEach(F=>{if(typeof h[F]>"u")return;const z=r[F]&&r[F].enabled,O=h[F]&&h[F].enabled;z&&!O&&e[F].disable(),!z&&O&&e[F].enable()});const m=h.direction&&h.direction!==r.direction,x=r.loop&&(h.slidesPerView!==r.slidesPerView||m),A=r.loop;m&&n&&e.changeDirection(),st(e.params,h);const w=e.params.enabled,N=e.params.loop;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),b&&!w?e.disable():!b&&w&&e.enable(),e.currentBreakpoint=d,e.emit("_beforeBreakpoint",h),n&&(x?(e.loopDestroy(),e.loopCreate(t),e.updateSlides()):!A&&N?(e.loopCreate(t),e.updateSlides()):A&&!N&&e.loopDestroy()),e.emit("breakpoint",h)}function yc(e,t="window",n){if(!e||t==="container"&&!n)return;let r=!1;const a=Ze(),i=t==="window"?a.innerHeight:n.clientHeight,s=Object.keys(e).map(u=>{if(typeof u=="string"&&u.indexOf("@")===0){const o=parseFloat(u.substr(1));return{value:i*o,point:u}}return{value:u,point:u}});s.sort((u,o)=>parseInt(u.value,10)-parseInt(o.value,10));for(let u=0;u<s.length;u+=1){const{point:o,value:d}=s[u];t==="window"?a.matchMedia(`(min-width: ${d}px)`).matches&&(r=o):d<=n.clientWidth&&(r=o)}return r||"max"}var xc={setBreakpoint:Tc,getBreakpoint:yc};function Ac(e,t){const n=[];return e.forEach(r=>{typeof r=="object"?Object.keys(r).forEach(a=>{r[a]&&n.push(t+a)}):typeof r=="string"&&n.push(t+r)}),n}function Cc(){const e=this,{classNames:t,params:n,rtl:r,el:a,device:i}=e,s=Ac(["initialized",n.direction,{"free-mode":e.params.freeMode&&n.freeMode.enabled},{autoheight:n.autoHeight},{rtl:r},{grid:n.grid&&n.grid.rows>1},{"grid-column":n.grid&&n.grid.rows>1&&n.grid.fill==="column"},{android:i.android},{ios:i.ios},{"css-mode":n.cssMode},{centered:n.cssMode&&n.centeredSlides},{"watch-progress":n.watchSlidesProgress}],n.containerModifierClass);t.push(...s),a.classList.add(...t),e.emitContainerClasses()}function Sc(){const e=this,{el:t,classNames:n}=e;!t||typeof t=="string"||(t.classList.remove(...n),e.emitContainerClasses())}var _c={addClasses:Cc,removeClasses:Sc};function Ic(){const e=this,{isLocked:t,params:n}=e,{slidesOffsetBefore:r}=n;if(r){const a=e.slides.length-1,i=e.slidesGrid[a]+e.slidesSizesGrid[a]+r*2;e.isLocked=e.size>i}else e.isLocked=e.snapGrid.length===1;n.allowSlideNext===!0&&(e.allowSlideNext=!e.isLocked),n.allowSlidePrev===!0&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}var Nc={checkOverflow:Ic},Vr={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,snapToSlideEdge:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function kc(e,t){return function(r={}){const a=Object.keys(r)[0],i=r[a];if(typeof i!="object"||i===null){st(t,r);return}if(e[a]===!0&&(e[a]={enabled:!0}),a==="navigation"&&e[a]&&e[a].enabled&&!e[a].prevEl&&!e[a].nextEl&&(e[a].auto=!0),["pagination","scrollbar"].indexOf(a)>=0&&e[a]&&e[a].enabled&&!e[a].el&&(e[a].auto=!0),!(a in e&&"enabled"in i)){st(t,r);return}typeof e[a]=="object"&&!("enabled"in e[a])&&(e[a].enabled=!0),e[a]||(e[a]={enabled:!1}),st(t,r)}}const Yr={eventsEmitter:_l,update:Rl,translate:ql,transition:Gl,slide:ec,loop:ac,grabCursor:oc,events:bc,breakpoints:xc,checkOverflow:Nc,classes:_c},Gr={};let Wr=class Nt{constructor(...t){let n,r;t.length===1&&t[0].constructor&&Object.prototype.toString.call(t[0]).slice(8,-1)==="Object"?r=t[0]:[n,r]=t,r||(r={}),r=st({},r),n&&!r.el&&(r.el=n);const a=Ft();if(r.el&&typeof r.el=="string"&&a.querySelectorAll(r.el).length>1){const o=[];return a.querySelectorAll(r.el).forEach(d=>{const f=st({},r,{el:d});o.push(new Nt(f))}),o}const i=this;i.__swiper__=!0,i.support=vi(),i.device=wi({userAgent:r.userAgent}),i.browser=Li(),i.eventsListeners={},i.eventsAnyListeners=[],i.modules=[...i.__modules__],r.modules&&Array.isArray(r.modules)&&i.modules.push(...r.modules);const s={};i.modules.forEach(o=>{o({params:r,swiper:i,extendParams:kc(r,s),on:i.on.bind(i),once:i.once.bind(i),off:i.off.bind(i),emit:i.emit.bind(i)})});const u=st({},Vr,s);return i.params=st({},u,Gr,r),i.originalParams=st({},i.params),i.passedParams=st({},r),i.params&&i.params.on&&Object.keys(i.params.on).forEach(o=>{i.on(o,i.params.on[o])}),i.params&&i.params.onAny&&i.onAny(i.params.onAny),Object.assign(i,{enabled:i.params.enabled,el:n,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return i.params.direction==="horizontal"},isVertical(){return i.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:i.params.allowSlideNext,allowSlidePrev:i.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:i.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:i.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),i.emit("_swiper"),i.params.init&&i.init(),i}getDirectionLabel(t){return this.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}getSlideIndex(t){const{slidesEl:n,params:r}=this,a=mt(n,`.${r.slideClass}, swiper-slide`),i=tr(a[0]);return tr(t)-i}getSlideIndexByData(t){return this.getSlideIndex(this.slides.find(n=>n.getAttribute("data-swiper-slide-index")*1===t))}getSlideIndexWhenGrid(t){return this.grid&&this.params.grid&&this.params.grid.rows>1&&(this.params.grid.fill==="column"?t=Math.floor(t/this.params.grid.rows):this.params.grid.fill==="row"&&(t=t%Math.ceil(this.slides.length/this.params.grid.rows))),t}recalcSlides(){const t=this,{slidesEl:n,params:r}=t;t.slides=mt(n,`.${r.slideClass}, swiper-slide`)}enable(){const t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))}disable(){const t=this;t.enabled&&(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))}setProgress(t,n){const r=this;t=Math.min(Math.max(t,0),1);const a=r.minTranslate(),s=(r.maxTranslate()-a)*t+a;r.translateTo(s,typeof n>"u"?0:n),r.updateActiveIndex(),r.updateSlidesClasses()}emitContainerClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const n=t.el.className.split(" ").filter(r=>r.indexOf("swiper")===0||r.indexOf(t.params.containerModifierClass)===0);t.emit("_containerClasses",n.join(" "))}getSlideClasses(t){const n=this;return n.destroyed?"":t.className.split(" ").filter(r=>r.indexOf("swiper-slide")===0||r.indexOf(n.params.slideClass)===0).join(" ")}emitSlidesClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const n=[];t.slides.forEach(r=>{const a=t.getSlideClasses(r);n.push({slideEl:r,classNames:a}),t.emit("_slideClass",r,a)}),t.emit("_slideClasses",n)}slidesPerViewDynamic(t="current",n=!1){const r=this,{params:a,slides:i,slidesGrid:s,slidesSizesGrid:u,size:o,activeIndex:d}=r;let f=1;if(typeof a.slidesPerView=="number")return a.slidesPerView;if(a.centeredSlides){let h=i[d]?Math.ceil(i[d].swiperSlideSize):0,g;for(let p=d+1;p<i.length;p+=1)i[p]&&!g&&(h+=Math.ceil(i[p].swiperSlideSize),f+=1,h>o&&(g=!0));for(let p=d-1;p>=0;p-=1)i[p]&&!g&&(h+=i[p].swiperSlideSize,f+=1,h>o&&(g=!0))}else if(t==="current")for(let h=d+1;h<i.length;h+=1)(n?s[h]+u[h]-s[d]<o:s[h]-s[d]<o)&&(f+=1);else for(let h=d-1;h>=0;h-=1)s[d]-s[h]<o&&(f+=1);return f}update(){const t=this;if(!t||t.destroyed)return;const{snapGrid:n,params:r}=t;r.breakpoints&&t.setBreakpoint(),[...t.el.querySelectorAll('[loading="lazy"]')].forEach(s=>{s.complete&&nr(t,s)}),t.updateSize(),t.updateSlides(),t.updateProgress(),t.updateSlidesClasses();function a(){const s=t.rtlTranslate?t.translate*-1:t.translate,u=Math.min(Math.max(s,t.maxTranslate()),t.minTranslate());t.setTranslate(u),t.updateActiveIndex(),t.updateSlidesClasses()}let i;if(r.freeMode&&r.freeMode.enabled&&!r.cssMode)a(),r.autoHeight&&t.updateAutoHeight();else{if((r.slidesPerView==="auto"||r.slidesPerView>1)&&t.isEnd&&!r.centeredSlides){const s=t.virtual&&r.virtual.enabled?t.virtual.slides:t.slides;i=t.slideTo(s.length-1,0,!1,!0)}else i=t.slideTo(t.activeIndex,0,!1,!0);i||a()}r.watchOverflow&&n!==t.snapGrid&&t.checkOverflow(),t.emit("update")}changeDirection(t,n=!0){const r=this,a=r.params.direction;return t||(t=a==="horizontal"?"vertical":"horizontal"),t===a||t!=="horizontal"&&t!=="vertical"||(r.el.classList.remove(`${r.params.containerModifierClass}${a}`),r.el.classList.add(`${r.params.containerModifierClass}${t}`),r.emitContainerClasses(),r.params.direction=t,r.slides.forEach(i=>{t==="vertical"?i.style.width="":i.style.height=""}),r.emit("changeDirection"),n&&r.update()),r}changeLanguageDirection(t){const n=this;n.rtl&&t==="rtl"||!n.rtl&&t==="ltr"||(n.rtl=t==="rtl",n.rtlTranslate=n.params.direction==="horizontal"&&n.rtl,n.rtl?(n.el.classList.add(`${n.params.containerModifierClass}rtl`),n.el.dir="rtl"):(n.el.classList.remove(`${n.params.containerModifierClass}rtl`),n.el.dir="ltr"),n.update())}mount(t){const n=this;if(n.mounted)return!0;let r=t||n.params.el;if(typeof r=="string"&&(r=document.querySelector(r)),!r)return!1;r.swiper=n,r.parentNode&&r.parentNode.host&&r.parentNode.host.nodeName===n.params.swiperElementNodeName.toUpperCase()&&(n.isElement=!0);const a=()=>`.${(n.params.wrapperClass||"").trim().split(" ").join(".")}`;let s=r&&r.shadowRoot&&r.shadowRoot.querySelector?r.shadowRoot.querySelector(a()):mt(r,a())[0];return!s&&n.params.createElements&&(s=er("div",n.params.wrapperClass),r.append(s),mt(r,`.${n.params.slideClass}`).forEach(u=>{s.append(u)})),Object.assign(n,{el:r,wrapperEl:s,slidesEl:n.isElement&&!r.parentNode.host.slideSlots?r.parentNode.host:s,hostEl:n.isElement?r.parentNode.host:r,mounted:!0,rtl:r.dir.toLowerCase()==="rtl"||vt(r,"direction")==="rtl",rtlTranslate:n.params.direction==="horizontal"&&(r.dir.toLowerCase()==="rtl"||vt(r,"direction")==="rtl"),wrongRTL:vt(s,"display")==="-webkit-box"}),!0}init(t){const n=this;if(n.initialized||n.mount(t)===!1)return n;n.emit("beforeInit"),n.params.breakpoints&&n.setBreakpoint(),n.addClasses(),n.updateSize(),n.updateSlides(),n.params.watchOverflow&&n.checkOverflow(),n.params.grabCursor&&n.enabled&&n.setGrabCursor(),n.params.loop&&n.virtual&&n.params.virtual.enabled?n.slideTo(n.params.initialSlide+n.virtual.slidesBefore,0,n.params.runCallbacksOnInit,!1,!0):n.slideTo(n.params.initialSlide,0,n.params.runCallbacksOnInit,!1,!0),n.params.loop&&n.loopCreate(void 0,!0),n.attachEvents();const a=[...n.el.querySelectorAll('[loading="lazy"]')];return n.isElement&&a.push(...n.hostEl.querySelectorAll('[loading="lazy"]')),a.forEach(i=>{i.complete?nr(n,i):i.addEventListener("load",s=>{nr(n,s.target)})}),zr(n),n.initialized=!0,zr(n),n.emit("init"),n.emit("afterInit"),n}destroy(t=!0,n=!0){const r=this,{params:a,el:i,wrapperEl:s,slides:u}=r;return typeof r.params>"u"||r.destroyed||(r.emit("beforeDestroy"),r.initialized=!1,r.detachEvents(),a.loop&&r.loopDestroy(),n&&(r.removeClasses(),i&&typeof i!="string"&&i.removeAttribute("style"),s&&s.removeAttribute("style"),u&&u.length&&u.forEach(o=>{o.classList.remove(a.slideVisibleClass,a.slideFullyVisibleClass,a.slideActiveClass,a.slideNextClass,a.slidePrevClass),o.removeAttribute("style"),o.removeAttribute("data-swiper-slide-index")})),r.emit("destroy"),Object.keys(r.eventsListeners).forEach(o=>{r.off(o)}),t!==!1&&(r.el&&typeof r.el!="string"&&(r.el.swiper=null),fl(r)),r.destroyed=!0),null}static extendDefaults(t){st(Gr,t)}static get extendedDefaults(){return Gr}static get defaults(){return Vr}static installModule(t){Nt.prototype.__modules__||(Nt.prototype.__modules__=[]);const n=Nt.prototype.__modules__;typeof t=="function"&&n.indexOf(t)<0&&n.push(t)}static use(t){return Array.isArray(t)?(t.forEach(n=>Nt.installModule(n)),Nt):(Nt.installModule(t),Nt)}};Object.keys(Yr).forEach(e=>{Object.keys(Yr[e]).forEach(t=>{Wr.prototype[t]=Yr[e][t]})}),Wr.use([Cl,Sl]);const Fi=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_snapToSlideEdge","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function Ht(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"&&!e.__swiper__}function Kt(e,t){const n=["__proto__","constructor","prototype"];Object.keys(t).filter(r=>n.indexOf(r)<0).forEach(r=>{typeof e[r]>"u"?e[r]=t[r]:Ht(t[r])&&Ht(e[r])&&Object.keys(t[r]).length>0?t[r].__swiper__?e[r]=t[r]:Kt(e[r],t[r]):e[r]=t[r]})}function Hi(e={}){return e.navigation&&typeof e.navigation.nextEl>"u"&&typeof e.navigation.prevEl>"u"}function Ui(e={}){return e.pagination&&typeof e.pagination.el>"u"}function $i(e={}){return e.scrollbar&&typeof e.scrollbar.el>"u"}function qi(e=""){const t=e.split(" ").map(r=>r.trim()).filter(r=>!!r),n=[];return t.forEach(r=>{n.indexOf(r)<0&&n.push(r)}),n.join(" ")}function vc(e=""){return e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function wc({swiper:e,slides:t,passedParams:n,changedParams:r,nextEl:a,prevEl:i,scrollbarEl:s,paginationEl:u}){const o=r.filter(O=>O!=="children"&&O!=="direction"&&O!=="wrapperClass"),{params:d,pagination:f,navigation:h,scrollbar:g,virtual:p,thumbs:c}=e;let E,b,m,x,A,w,N,F;r.includes("thumbs")&&n.thumbs&&n.thumbs.swiper&&!n.thumbs.swiper.destroyed&&d.thumbs&&(!d.thumbs.swiper||d.thumbs.swiper.destroyed)&&(E=!0),r.includes("controller")&&n.controller&&n.controller.control&&d.controller&&!d.controller.control&&(b=!0),r.includes("pagination")&&n.pagination&&(n.pagination.el||u)&&(d.pagination||d.pagination===!1)&&f&&!f.el&&(m=!0),r.includes("scrollbar")&&n.scrollbar&&(n.scrollbar.el||s)&&(d.scrollbar||d.scrollbar===!1)&&g&&!g.el&&(x=!0),r.includes("navigation")&&n.navigation&&(n.navigation.prevEl||i)&&(n.navigation.nextEl||a)&&(d.navigation||d.navigation===!1)&&h&&!h.prevEl&&!h.nextEl&&(A=!0);const z=O=>{e[O]&&(e[O].destroy(),O==="navigation"?(e.isElement&&(e[O].prevEl.remove(),e[O].nextEl.remove()),d[O].prevEl=void 0,d[O].nextEl=void 0,e[O].prevEl=void 0,e[O].nextEl=void 0):(e.isElement&&e[O].el.remove(),d[O].el=void 0,e[O].el=void 0))};r.includes("loop")&&e.isElement&&(d.loop&&!n.loop?w=!0:!d.loop&&n.loop?N=!0:F=!0),o.forEach(O=>{if(Ht(d[O])&&Ht(n[O]))Object.assign(d[O],n[O]),(O==="navigation"||O==="pagination"||O==="scrollbar")&&"enabled"in n[O]&&!n[O].enabled&&z(O);else{const L=n[O];(L===!0||L===!1)&&(O==="navigation"||O==="pagination"||O==="scrollbar")?L===!1&&z(O):d[O]=n[O]}}),o.includes("controller")&&!b&&e.controller&&e.controller.control&&d.controller&&d.controller.control&&(e.controller.control=d.controller.control),r.includes("children")&&t&&p&&d.virtual.enabled?(p.slides=t,p.update(!0)):r.includes("virtual")&&p&&d.virtual.enabled&&(t&&(p.slides=t),p.update(!0)),r.includes("children")&&t&&d.loop&&(F=!0),E&&c.init()&&c.update(!0),b&&(e.controller.control=d.controller.control),m&&(e.isElement&&(!u||typeof u=="string")&&(u=document.createElement("div"),u.classList.add("swiper-pagination"),u.part.add("pagination"),e.el.appendChild(u)),u&&(d.pagination.el=u),f.init(),f.render(),f.update()),x&&(e.isElement&&(!s||typeof s=="string")&&(s=document.createElement("div"),s.classList.add("swiper-scrollbar"),s.part.add("scrollbar"),e.el.appendChild(s)),s&&(d.scrollbar.el=s),g.init(),g.updateSize(),g.setTranslate()),A&&(e.isElement&&((!a||typeof a=="string")&&(a=document.createElement("div"),a.classList.add("swiper-button-next"),gn(a,e.navigation.arrowSvg),a.part.add("button-next"),e.el.appendChild(a)),(!i||typeof i=="string")&&(i=document.createElement("div"),i.classList.add("swiper-button-prev"),gn(i,e.navigation.arrowSvg),i.part.add("button-prev"),e.el.appendChild(i))),a&&(d.navigation.nextEl=a),i&&(d.navigation.prevEl=i),h.init(),h.update()),r.includes("allowSlideNext")&&(e.allowSlideNext=n.allowSlideNext),r.includes("allowSlidePrev")&&(e.allowSlidePrev=n.allowSlidePrev),r.includes("direction")&&e.changeDirection(n.direction,!1),(w||F)&&e.loopDestroy(),(N||F)&&e.loopCreate(),e.update()}function Lc(e={},t=!0){const n={on:{}},r={},a={};Kt(n,Vr),n._emitClasses=!0,n.init=!1;const i={},s=Fi.map(o=>o.replace(/_/,"")),u=Object.assign({},e);return Object.keys(u).forEach(o=>{typeof e[o]>"u"||(s.indexOf(o)>=0?Ht(e[o])?(n[o]={},a[o]={},Kt(n[o],e[o]),Kt(a[o],e[o])):(n[o]=e[o],a[o]=e[o]):o.search(/on[A-Z]/)===0&&typeof e[o]=="function"?t?r[`${o[2].toLowerCase()}${o.substr(3)}`]=e[o]:n.on[`${o[2].toLowerCase()}${o.substr(3)}`]=e[o]:i[o]=e[o])}),["navigation","pagination","scrollbar"].forEach(o=>{n[o]===!0&&(n[o]={}),n[o]===!1&&delete n[o]}),{params:n,passedParams:a,rest:i,events:r}}function Oc({el:e,nextEl:t,prevEl:n,paginationEl:r,scrollbarEl:a,swiper:i},s){Hi(s)&&t&&n&&(i.params.navigation.nextEl=t,i.originalParams.navigation.nextEl=t,i.params.navigation.prevEl=n,i.originalParams.navigation.prevEl=n),Ui(s)&&r&&(i.params.pagination.el=r,i.originalParams.pagination.el=r),$i(s)&&a&&(i.params.scrollbar.el=a,i.originalParams.scrollbar.el=a),i.init(e)}function Dc(e,t,n,r,a){const i=[];if(!t)return i;const s=o=>{i.indexOf(o)<0&&i.push(o)};if(n&&r){const o=r.map(a),d=n.map(a);o.join("")!==d.join("")&&s("children"),r.length!==n.length&&s("children")}return Fi.filter(o=>o[0]==="_").map(o=>o.replace(/_/,"")).forEach(o=>{if(o in e&&o in t)if(Ht(e[o])&&Ht(t[o])){const d=Object.keys(e[o]),f=Object.keys(t[o]);d.length!==f.length?s(o):(d.forEach(h=>{e[o][h]!==t[o][h]&&s(o)}),f.forEach(h=>{e[o][h]!==t[o][h]&&s(o)}))}else e[o]!==t[o]&&s(o)}),i}const Pc=e=>{!e||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.emit("_virtualUpdated"),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())};function rr(){return rr=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},rr.apply(this,arguments)}function zi(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function Vi(e){const t=[];return R.Children.toArray(e).forEach(n=>{zi(n)?t.push(n):n.props&&n.props.children&&Vi(n.props.children).forEach(r=>t.push(r))}),t}function Mc(e){const t=[],n={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return R.Children.toArray(e).forEach(r=>{if(zi(r))t.push(r);else if(r.props&&r.props.slot&&n[r.props.slot])n[r.props.slot].push(r);else if(r.props&&r.props.children){const a=Vi(r.props.children);a.length>0?a.forEach(i=>t.push(i)):n["container-end"].push(r)}else n["container-end"].push(r)}),{slides:t,slots:n}}function Rc(e,t,n){if(!n)return null;const r=f=>{let h=f;return f<0?h=t.length+f:h>=t.length&&(h=h-t.length),h},a=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${n.offset}px`}:{top:`${n.offset}px`},{from:i,to:s}=n,u=e.params.loop?-t.length:0,o=e.params.loop?t.length*2:t.length,d=[];for(let f=u;f<o;f+=1)f>=i&&f<=s&&d.push(t[r(f)]);return d.map((f,h)=>R.cloneElement(f,{swiper:e,style:a,key:f.props.virtualIndex||f.key||`slide-${h}`}))}function En(e,t){return typeof window>"u"?R.useEffect(e,t):R.useLayoutEffect(e,t)}const Yi=R.createContext(null),Bc=R.createContext(null),Gi=R.forwardRef(({className:e,tag:t="div",wrapperTag:n="div",children:r,onSwiper:a,...i}={},s)=>{let u=!1;const[o,d]=R.useState("swiper"),[f,h]=R.useState(null),[g,p]=R.useState(!1),c=R.useRef(!1),E=R.useRef(null),b=R.useRef(null),m=R.useRef(null),x=R.useRef(null),A=R.useRef(null),w=R.useRef(null),N=R.useRef(null),F=R.useRef(null),{params:z,passedParams:O,rest:L,events:H}=Lc(i),{slides:y,slots:D}=Mc(r),U=()=>{p(!g)};Object.assign(z.on,{_containerClasses(q,ne){d(ne)}});const I=()=>{Object.assign(z.on,H),u=!0;const q={...z};if(delete q.wrapperClass,b.current=new Wr(q),b.current.virtual&&b.current.params.virtual.enabled){b.current.virtual.slides=y;const ne={cache:!1,slides:y,renderExternal:h,renderExternalUpdate:!1};Kt(b.current.params.virtual,ne),Kt(b.current.originalParams.virtual,ne)}};E.current||I(),b.current&&b.current.on("_beforeBreakpoint",U);const T=()=>{u||!H||!b.current||Object.keys(H).forEach(q=>{b.current.on(q,H[q])})},$=()=>{!H||!b.current||Object.keys(H).forEach(q=>{b.current.off(q,H[q])})};R.useEffect(()=>()=>{b.current&&b.current.off("_beforeBreakpoint",U)}),R.useEffect(()=>{!c.current&&b.current&&(b.current.emitSlidesClasses(),c.current=!0)}),En(()=>{if(s&&(s.current=E.current),!!E.current)return b.current.destroyed&&I(),Oc({el:E.current,nextEl:A.current,prevEl:w.current,paginationEl:N.current,scrollbarEl:F.current,swiper:b.current},z),a&&!b.current.destroyed&&a(b.current),()=>{b.current&&!b.current.destroyed&&b.current.destroy(!0,!1)}},[]),En(()=>{T();const q=Dc(O,m.current,y,x.current,ne=>ne.key);return m.current=O,x.current=y,q.length&&b.current&&!b.current.destroyed&&wc({swiper:b.current,slides:y,passedParams:O,changedParams:q,nextEl:A.current,prevEl:w.current,scrollbarEl:F.current,paginationEl:N.current}),()=>{$()}}),En(()=>{Pc(b.current)},[f]);function W(){return z.virtual?Rc(b.current,y,f):y.map((q,ne)=>R.cloneElement(q,{swiper:b.current,swiperSlideIndex:ne}))}return R.createElement(t,rr({ref:E,className:qi(`${o}${e?` ${e}`:""}`)},L),R.createElement(Bc.Provider,{value:b.current},D["container-start"],R.createElement(n,{className:vc(z.wrapperClass)},D["wrapper-start"],W(),D["wrapper-end"]),Hi(z)&&R.createElement(R.Fragment,null,R.createElement("div",{ref:w,className:"swiper-button-prev"}),R.createElement("div",{ref:A,className:"swiper-button-next"})),$i(z)&&R.createElement("div",{ref:F,className:"swiper-scrollbar"}),Ui(z)&&R.createElement("div",{ref:N,className:"swiper-pagination"}),D["container-end"]))});Gi.displayName="Swiper";const Wi=R.forwardRef(({tag:e="div",children:t,className:n="",swiper:r,zoom:a,lazy:i,virtualIndex:s,swiperSlideIndex:u,...o}={},d)=>{const f=R.useRef(null),[h,g]=R.useState("swiper-slide"),[p,c]=R.useState(!1);function E(A,w,N){w===f.current&&g(N)}En(()=>{if(typeof u<"u"&&(f.current.swiperSlideIndex=u),d&&(d.current=f.current),!(!f.current||!r)){if(r.destroyed){h!=="swiper-slide"&&g("swiper-slide");return}return r.on("_slideClass",E),()=>{r&&r.off("_slideClass",E)}}}),En(()=>{r&&f.current&&!r.destroyed&&g(r.getSlideClasses(f.current))},[r]);const b={isActive:h.indexOf("swiper-slide-active")>=0,isVisible:h.indexOf("swiper-slide-visible")>=0,isPrev:h.indexOf("swiper-slide-prev")>=0,isNext:h.indexOf("swiper-slide-next")>=0},m=()=>typeof t=="function"?t(b):t,x=()=>{c(!0)};return R.createElement(e,rr({ref:f,className:qi(`${h}${n?` ${n}`:""}`),"data-swiper-slide-index":s,onLoad:x},o),a&&R.createElement(Yi.Provider,{value:b},R.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof a=="number"?a:void 0},m(),i&&!p&&R.createElement("div",{className:"swiper-lazy-preloader",ref:A=>{A&&(A.lazyPreloaderManaged=!0)}}))),!a&&R.createElement(Yi.Provider,{value:b},m(),i&&!p&&R.createElement("div",{className:"swiper-lazy-preloader",ref:A=>{A&&(A.lazyPreloaderManaged=!0)}})))});Wi.displayName="SwiperSlide";function ji(e,t,n,r){return e.params.createElements&&Object.keys(r).forEach(a=>{if(!n[a]&&n.auto===!0){let i=mt(e.el,`.${r[a]}`)[0];i||(i=er("div",r[a]),i.className=r[a],e.el.append(i)),n[a]=i,t[a]=i}}),n}const Xi='<svg class="swiper-navigation-icon" width="11" height="20" viewBox="0 0 11 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.38296 20.0762C0.111788 19.805 0.111788 19.3654 0.38296 19.0942L9.19758 10.2796L0.38296 1.46497C0.111788 1.19379 0.111788 0.754138 0.38296 0.482966C0.654131 0.211794 1.09379 0.211794 1.36496 0.482966L10.4341 9.55214C10.8359 9.9539 10.8359 10.6053 10.4341 11.007L1.36496 20.0762C1.09379 20.3474 0.654131 20.3474 0.38296 20.0762Z" fill="currentColor"/></svg>';function Fc({swiper:e,extendParams:t,on:n,emit:r}){t({navigation:{nextEl:null,prevEl:null,addIcons:!0,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),e.navigation={nextEl:null,prevEl:null,arrowSvg:Xi};function a(p){let c;return p&&typeof p=="string"&&e.isElement&&(c=e.el.querySelector(p)||e.hostEl.querySelector(p),c)?c:(p&&(typeof p=="string"&&(c=[...document.querySelectorAll(p)]),e.params.uniqueNavElements&&typeof p=="string"&&c&&c.length>1&&e.el.querySelectorAll(p).length===1?c=e.el.querySelector(p):c&&c.length===1&&(c=c[0])),p&&!c?p:c)}function i(p,c){const E=e.params.navigation;p=Ye(p),p.forEach(b=>{b&&(b.classList[c?"add":"remove"](...E.disabledClass.split(" ")),b.tagName==="BUTTON"&&(b.disabled=c),e.params.watchOverflow&&e.enabled&&b.classList[e.isLocked?"add":"remove"](E.lockClass))})}function s(){const{nextEl:p,prevEl:c}=e.navigation;if(e.params.loop){i(c,!1),i(p,!1);return}i(c,e.isBeginning&&!e.params.rewind),i(p,e.isEnd&&!e.params.rewind)}function u(p){p.preventDefault(),!(e.isBeginning&&!e.params.loop&&!e.params.rewind)&&(e.slidePrev(),r("navigationPrev"))}function o(p){p.preventDefault(),!(e.isEnd&&!e.params.loop&&!e.params.rewind)&&(e.slideNext(),r("navigationNext"))}function d(){const p=e.params.navigation;if(e.params.navigation=ji(e,e.originalParams.navigation,e.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!(p.nextEl||p.prevEl))return;let c=a(p.nextEl),E=a(p.prevEl);Object.assign(e.navigation,{nextEl:c,prevEl:E}),c=Ye(c),E=Ye(E);const b=(m,x)=>{if(m){if(p.addIcons&&m.matches(".swiper-button-next,.swiper-button-prev")&&!m.querySelector("svg")){const A=document.createElement("div");gn(A,Xi),m.appendChild(A.querySelector("svg")),A.remove()}m.addEventListener("click",x==="next"?o:u)}!e.enabled&&m&&m.classList.add(...p.lockClass.split(" "))};c.forEach(m=>b(m,"next")),E.forEach(m=>b(m,"prev"))}function f(){let{nextEl:p,prevEl:c}=e.navigation;p=Ye(p),c=Ye(c);const E=(b,m)=>{b.removeEventListener("click",m==="next"?o:u),b.classList.remove(...e.params.navigation.disabledClass.split(" "))};p.forEach(b=>E(b,"next")),c.forEach(b=>E(b,"prev"))}n("init",()=>{e.params.navigation.enabled===!1?g():(d(),s())}),n("toEdge fromEdge lock unlock",()=>{s()}),n("destroy",()=>{f()}),n("enable disable",()=>{let{nextEl:p,prevEl:c}=e.navigation;if(p=Ye(p),c=Ye(c),e.enabled){s();return}[...p,...c].filter(E=>!!E).forEach(E=>E.classList.add(e.params.navigation.lockClass))}),n("click",(p,c)=>{let{nextEl:E,prevEl:b}=e.navigation;E=Ye(E),b=Ye(b);const m=c.target;let x=b.includes(m)||E.includes(m);if(e.isElement&&!x){const A=c.path||c.composedPath&&c.composedPath();A&&(x=A.find(w=>E.includes(w)||b.includes(w)))}if(e.params.navigation.hideOnClick&&!x){if(e.pagination&&e.params.pagination&&e.params.pagination.clickable&&(e.pagination.el===m||e.pagination.el.contains(m)))return;let A;E.length?A=E[0].classList.contains(e.params.navigation.hiddenClass):b.length&&(A=b[0].classList.contains(e.params.navigation.hiddenClass)),r(A===!0?"navigationShow":"navigationHide"),[...E,...b].filter(w=>!!w).forEach(w=>w.classList.toggle(e.params.navigation.hiddenClass))}});const h=()=>{e.el.classList.remove(...e.params.navigation.navigationDisabledClass.split(" ")),d(),s()},g=()=>{e.el.classList.add(...e.params.navigation.navigationDisabledClass.split(" ")),f()};Object.assign(e.navigation,{enable:h,disable:g,update:s,init:d,destroy:f})}function bn(e=""){return`.${e.trim().replace(/([\.:!+\/()[\]#>~*^$|=,'"@{}\\])/g,"\\$1").replace(/ /g,".")}`}function Hc({swiper:e,extendParams:t,on:n,emit:r}){const a="swiper-pagination";t({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:m=>m,formatFractionTotal:m=>m,bulletClass:`${a}-bullet`,bulletActiveClass:`${a}-bullet-active`,modifierClass:`${a}-`,currentClass:`${a}-current`,totalClass:`${a}-total`,hiddenClass:`${a}-hidden`,progressbarFillClass:`${a}-progressbar-fill`,progressbarOppositeClass:`${a}-progressbar-opposite`,clickableClass:`${a}-clickable`,lockClass:`${a}-lock`,horizontalClass:`${a}-horizontal`,verticalClass:`${a}-vertical`,paginationDisabledClass:`${a}-disabled`}}),e.pagination={el:null,bullets:[]};let i,s=0;function u(){return!e.params.pagination.el||!e.pagination.el||Array.isArray(e.pagination.el)&&e.pagination.el.length===0}function o(m,x){const{bulletActiveClass:A}=e.params.pagination;m&&(m=m[`${x==="prev"?"previous":"next"}ElementSibling`],m&&(m.classList.add(`${A}-${x}`),m=m[`${x==="prev"?"previous":"next"}ElementSibling`],m&&m.classList.add(`${A}-${x}-${x}`)))}function d(m,x,A){if(m=m%A,x=x%A,x===m+1)return"next";if(x===m-1)return"previous"}function f(m){const x=m.target.closest(bn(e.params.pagination.bulletClass));if(!x)return;m.preventDefault();const A=tr(x)*e.params.slidesPerGroup;if(e.params.loop){if(e.realIndex===A)return;const w=d(e.realIndex,A,e.slides.length);w==="next"?e.slideNext():w==="previous"?e.slidePrev():e.slideToLoop(A)}else e.slideTo(A)}function h(){const m=e.rtl,x=e.params.pagination;if(u())return;let A=e.pagination.el;A=Ye(A);let w,N;const F=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.slides.length,z=e.params.loop?Math.ceil(F/e.params.slidesPerGroup):e.snapGrid.length;if(e.params.loop?(N=e.previousRealIndex||0,w=e.params.slidesPerGroup>1?Math.floor(e.realIndex/e.params.slidesPerGroup):e.realIndex):typeof e.snapIndex<"u"?(w=e.snapIndex,N=e.previousSnapIndex):(N=e.previousIndex||0,w=e.activeIndex||0),x.type==="bullets"&&e.pagination.bullets&&e.pagination.bullets.length>0){const O=e.pagination.bullets;let L,H,y;if(x.dynamicBullets&&(i=Br(O[0],e.isHorizontal()?"width":"height"),A.forEach(D=>{D.style[e.isHorizontal()?"width":"height"]=`${i*(x.dynamicMainBullets+4)}px`}),x.dynamicMainBullets>1&&N!==void 0&&(s+=w-(N||0),s>x.dynamicMainBullets-1?s=x.dynamicMainBullets-1:s<0&&(s=0)),L=Math.max(w-s,0),H=L+(Math.min(O.length,x.dynamicMainBullets)-1),y=(H+L)/2),O.forEach(D=>{const U=[...["","-next","-next-next","-prev","-prev-prev","-main"].map(I=>`${x.bulletActiveClass}${I}`)].map(I=>typeof I=="string"&&I.includes(" ")?I.split(" "):I).flat();D.classList.remove(...U)}),A.length>1)O.forEach(D=>{const U=tr(D);U===w?D.classList.add(...x.bulletActiveClass.split(" ")):e.isElement&&D.setAttribute("part","bullet"),x.dynamicBullets&&(U>=L&&U<=H&&D.classList.add(...`${x.bulletActiveClass}-main`.split(" ")),U===L&&o(D,"prev"),U===H&&o(D,"next"))});else{const D=O[w];if(D&&D.classList.add(...x.bulletActiveClass.split(" ")),e.isElement&&O.forEach((U,I)=>{U.setAttribute("part",I===w?"bullet-active":"bullet")}),x.dynamicBullets){const U=O[L],I=O[H];for(let T=L;T<=H;T+=1)O[T]&&O[T].classList.add(...`${x.bulletActiveClass}-main`.split(" "));o(U,"prev"),o(I,"next")}}if(x.dynamicBullets){const D=Math.min(O.length,x.dynamicMainBullets+4),U=(i*D-i)/2-y*i,I=m?"right":"left";O.forEach(T=>{T.style[e.isHorizontal()?I:"top"]=`${U}px`})}}A.forEach((O,L)=>{if(x.type==="fraction"&&(O.querySelectorAll(bn(x.currentClass)).forEach(H=>{H.textContent=x.formatFractionCurrent(w+1)}),O.querySelectorAll(bn(x.totalClass)).forEach(H=>{H.textContent=x.formatFractionTotal(z)})),x.type==="progressbar"){let H;x.progressbarOpposite?H=e.isHorizontal()?"vertical":"horizontal":H=e.isHorizontal()?"horizontal":"vertical";const y=(w+1)/z;let D=1,U=1;H==="horizontal"?D=y:U=y,O.querySelectorAll(bn(x.progressbarFillClass)).forEach(I=>{I.style.transform=`translate3d(0,0,0) scaleX(${D}) scaleY(${U})`,I.style.transitionDuration=`${e.params.speed}ms`})}x.type==="custom"&&x.renderCustom?(gn(O,x.renderCustom(e,w+1,z)),L===0&&r("paginationRender",O)):(L===0&&r("paginationRender",O),r("paginationUpdate",O)),e.params.watchOverflow&&e.enabled&&O.classList[e.isLocked?"add":"remove"](x.lockClass)})}function g(){const m=e.params.pagination;if(u())return;const x=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.grid&&e.params.grid.rows>1?e.slides.length/Math.ceil(e.params.grid.rows):e.slides.length;let A=e.pagination.el;A=Ye(A);let w="";if(m.type==="bullets"){let N=e.params.loop?Math.ceil(x/e.params.slidesPerGroup):e.snapGrid.length;e.params.freeMode&&e.params.freeMode.enabled&&N>x&&(N=x);for(let F=0;F<N;F+=1)m.renderBullet?w+=m.renderBullet.call(e,F,m.bulletClass):w+=`<${m.bulletElement} ${e.isElement?'part="bullet"':""} class="${m.bulletClass}"></${m.bulletElement}>`}m.type==="fraction"&&(m.renderFraction?w=m.renderFraction.call(e,m.currentClass,m.totalClass):w=`<span class="${m.currentClass}"></span> / <span class="${m.totalClass}"></span>`),m.type==="progressbar"&&(m.renderProgressbar?w=m.renderProgressbar.call(e,m.progressbarFillClass):w=`<span class="${m.progressbarFillClass}"></span>`),e.pagination.bullets=[],A.forEach(N=>{m.type!=="custom"&&gn(N,w||""),m.type==="bullets"&&e.pagination.bullets.push(...N.querySelectorAll(bn(m.bulletClass)))}),m.type!=="custom"&&r("paginationRender",A[0])}function p(){e.params.pagination=ji(e,e.originalParams.pagination,e.params.pagination,{el:"swiper-pagination"});const m=e.params.pagination;if(!m.el)return;let x;typeof m.el=="string"&&e.isElement&&(x=e.el.querySelector(m.el)),!x&&typeof m.el=="string"&&(x=[...document.querySelectorAll(m.el)]),x||(x=m.el),!(!x||x.length===0)&&(e.params.uniqueNavElements&&typeof m.el=="string"&&Array.isArray(x)&&x.length>1&&(x=[...e.el.querySelectorAll(m.el)],x.length>1&&(x=x.find(A=>ki(A,".swiper")[0]===e.el))),Array.isArray(x)&&x.length===1&&(x=x[0]),Object.assign(e.pagination,{el:x}),x=Ye(x),x.forEach(A=>{m.type==="bullets"&&m.clickable&&A.classList.add(...(m.clickableClass||"").split(" ")),A.classList.add(m.modifierClass+m.type),A.classList.add(e.isHorizontal()?m.horizontalClass:m.verticalClass),m.type==="bullets"&&m.dynamicBullets&&(A.classList.add(`${m.modifierClass}${m.type}-dynamic`),s=0,m.dynamicMainBullets<1&&(m.dynamicMainBullets=1)),m.type==="progressbar"&&m.progressbarOpposite&&A.classList.add(m.progressbarOppositeClass),m.clickable&&A.addEventListener("click",f),e.enabled||A.classList.add(m.lockClass)}))}function c(){const m=e.params.pagination;if(u())return;let x=e.pagination.el;x&&(x=Ye(x),x.forEach(A=>{A.classList.remove(m.hiddenClass),A.classList.remove(m.modifierClass+m.type),A.classList.remove(e.isHorizontal()?m.horizontalClass:m.verticalClass),m.clickable&&(A.classList.remove(...(m.clickableClass||"").split(" ")),A.removeEventListener("click",f))})),e.pagination.bullets&&e.pagination.bullets.forEach(A=>A.classList.remove(...m.bulletActiveClass.split(" ")))}n("changeDirection",()=>{if(!e.pagination||!e.pagination.el)return;const m=e.params.pagination;let{el:x}=e.pagination;x=Ye(x),x.forEach(A=>{A.classList.remove(m.horizontalClass,m.verticalClass),A.classList.add(e.isHorizontal()?m.horizontalClass:m.verticalClass)})}),n("init",()=>{e.params.pagination.enabled===!1?b():(p(),g(),h())}),n("activeIndexChange",()=>{typeof e.snapIndex>"u"&&h()}),n("snapIndexChange",()=>{h()}),n("snapGridLengthChange",()=>{g(),h()}),n("destroy",()=>{c()}),n("enable disable",()=>{let{el:m}=e.pagination;m&&(m=Ye(m),m.forEach(x=>x.classList[e.enabled?"remove":"add"](e.params.pagination.lockClass)))}),n("lock unlock",()=>{h()}),n("click",(m,x)=>{const A=x.target,w=Ye(e.pagination.el);if(e.params.pagination.el&&e.params.pagination.hideOnClick&&w&&w.length>0&&!A.classList.contains(e.params.pagination.bulletClass)){if(e.navigation&&(e.navigation.nextEl&&A===e.navigation.nextEl||e.navigation.prevEl&&A===e.navigation.prevEl))return;const N=w[0].classList.contains(e.params.pagination.hiddenClass);r(N===!0?"paginationShow":"paginationHide"),w.forEach(F=>F.classList.toggle(e.params.pagination.hiddenClass))}});const E=()=>{e.el.classList.remove(e.params.pagination.paginationDisabledClass);let{el:m}=e.pagination;m&&(m=Ye(m),m.forEach(x=>x.classList.remove(e.params.pagination.paginationDisabledClass))),p(),g(),h()},b=()=>{e.el.classList.add(e.params.pagination.paginationDisabledClass);let{el:m}=e.pagination;m&&(m=Ye(m),m.forEach(x=>x.classList.add(e.params.pagination.paginationDisabledClass))),c()};Object.assign(e.pagination,{enable:E,disable:b,render:g,update:h,init:p,destroy:c})}function QE(){}function JE(){}function Ki(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const s=n.slice(a,r).trim();(s||!i)&&t.push(s),a=r+1,r=n.indexOf(",",a)}return t}function Qi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Uc=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$c=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qc={};function Ji(e,t){return(qc.jsx?$c:Uc).test(e)}const zc=/[ \t\n\f\r]/g;function Vc(e){return typeof e=="object"?e.type==="text"?Zi(e.value):!1:Zi(e)}function Zi(e){return e.replace(zc,"")===""}class Tn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Tn.prototype.normal={},Tn.prototype.property={},Tn.prototype.space=void 0;function es(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Tn(n,r,t)}function yn(e){return e.toLowerCase()}class et{constructor(t,n){this.attribute=n,this.property=t}}et.prototype.attribute="",et.prototype.booleanish=!1,et.prototype.boolean=!1,et.prototype.commaOrSpaceSeparated=!1,et.prototype.commaSeparated=!1,et.prototype.defined=!1,et.prototype.mustUseProperty=!1,et.prototype.number=!1,et.prototype.overloadedBoolean=!1,et.prototype.property="",et.prototype.spaceSeparated=!1,et.prototype.space=void 0;let Yc=0;const Te=Ut(),qe=Ut(),jr=Ut(),le=Ut(),De=Ut(),Qt=Ut(),ot=Ut();function Ut(){return 2**++Yc}const Xr=Object.freeze(Object.defineProperty({__proto__:null,boolean:Te,booleanish:qe,commaOrSpaceSeparated:ot,commaSeparated:Qt,number:le,overloadedBoolean:jr,spaceSeparated:De},Symbol.toStringTag,{value:"Module"})),Kr=Object.keys(Xr);class Qr extends et{constructor(t,n,r,a){let i=-1;if(super(t,n),ts(this,"space",a),typeof r=="number")for(;++i<Kr.length;){const s=Kr[i];ts(this,Kr[i],(r&Xr[s])===Xr[s])}}}Qr.prototype.defined=!0;function ts(e,t,n){n&&(e[t]=n)}function Jt(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const i=new Qr(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[yn(r)]=r,n[yn(i.attribute)]=r}return new Tn(t,n,e.space)}const ns=Jt({properties:{ariaActiveDescendant:null,ariaAtomic:qe,ariaAutoComplete:null,ariaBusy:qe,ariaChecked:qe,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:De,ariaCurrent:null,ariaDescribedBy:De,ariaDetails:null,ariaDisabled:qe,ariaDropEffect:De,ariaErrorMessage:null,ariaExpanded:qe,ariaFlowTo:De,ariaGrabbed:qe,ariaHasPopup:null,ariaHidden:qe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:De,ariaLevel:le,ariaLive:null,ariaModal:qe,ariaMultiLine:qe,ariaMultiSelectable:qe,ariaOrientation:null,ariaOwns:De,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:qe,ariaReadOnly:qe,ariaRelevant:null,ariaRequired:qe,ariaRoleDescription:De,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:qe,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function rs(e,t){return t in e?e[t]:t}function as(e,t){return rs(e,t.toLowerCase())}const Gc=Jt({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Qt,acceptCharset:De,accessKey:De,action:null,allow:null,allowFullScreen:Te,allowPaymentRequest:Te,allowUserMedia:Te,alt:null,as:null,async:Te,autoCapitalize:null,autoComplete:De,autoFocus:Te,autoPlay:Te,blocking:De,capture:null,charSet:null,checked:Te,cite:null,className:De,cols:le,colSpan:null,content:null,contentEditable:qe,controls:Te,controlsList:De,coords:le|Qt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Te,defer:Te,dir:null,dirName:null,disabled:Te,download:jr,draggable:qe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Te,formTarget:null,headers:De,height:le,hidden:jr,high:le,href:null,hrefLang:null,htmlFor:De,httpEquiv:De,id:null,imageSizes:null,imageSrcSet:null,inert:Te,inputMode:null,integrity:null,is:null,isMap:Te,itemId:null,itemProp:De,itemRef:De,itemScope:Te,itemType:De,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Te,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:Te,muted:Te,name:null,nonce:null,noModule:Te,noValidate:Te,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Te,optimum:le,pattern:null,ping:De,placeholder:null,playsInline:Te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Te,referrerPolicy:null,rel:De,required:Te,reversed:Te,rows:le,rowSpan:le,sandbox:De,scope:null,scoped:Te,seamless:Te,selected:Te,shadowRootClonable:Te,shadowRootDelegatesFocus:Te,shadowRootMode:null,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:qe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:Te,useMap:null,value:qe,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:De,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Te,declare:Te,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:Te,noHref:Te,noShade:Te,noWrap:Te,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:qe,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Te,disableRemotePlayback:Te,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:as}),Wc=Jt({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ot,accentHeight:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:De,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:Te,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Qt,g2:Qt,glyphName:Qt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:ot,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:le,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:De,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ot,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ot,rev:ot,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ot,requiredFeatures:ot,requiredFonts:ot,requiredFormats:ot,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:ot,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ot,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ot,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:rs}),is=Jt({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ss=Jt({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:as}),os=Jt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),jc={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Xc=/[A-Z]/g,us=/-[a-z]/g,Kc=/^data[-\w.:]+$/i;function ar(e,t){const n=yn(t);let r=t,a=et;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Kc.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(us,Jc);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!us.test(i)){let s=i.replace(Xc,Qc);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}a=Qr}return new a(r,t)}function Qc(e){return"-"+e.toLowerCase()}function Jc(e){return e.charAt(1).toUpperCase()}const xn=es([ns,Gc,is,ss,os],"html"),wt=es([ns,Wc,is,ss,os],"svg");function ls(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function cs(e){return e.join(" ").trim()}function Jr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zt={},Zr,ds;function Zc(){if(ds)return Zr;ds=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,o=`
2
+ `,d="/",f="*",h="",g="comment",p="declaration";function c(b,m){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];m=m||{};var x=1,A=1;function w(I){var T=I.match(t);T&&(x+=T.length);var $=I.lastIndexOf(o);A=~$?I.length-$:A+I.length}function N(){var I={line:x,column:A};return function(T){return T.position=new F(I),L(),T}}function F(I){this.start=I,this.end={line:x,column:A},this.source=m.source}F.prototype.content=b;function z(I){var T=new Error(m.source+":"+x+":"+A+": "+I);if(T.reason=I,T.filename=m.source,T.line=x,T.column=A,T.source=b,!m.silent)throw T}function O(I){var T=I.exec(b);if(T){var $=T[0];return w($),b=b.slice($.length),T}}function L(){O(n)}function H(I){var T;for(I=I||[];T=y();)T!==!1&&I.push(T);return I}function y(){var I=N();if(!(d!=b.charAt(0)||f!=b.charAt(1))){for(var T=2;h!=b.charAt(T)&&(f!=b.charAt(T)||d!=b.charAt(T+1));)++T;if(T+=2,h===b.charAt(T-1))return z("End of comment missing");var $=b.slice(2,T-2);return A+=2,w($),b=b.slice(T),A+=2,I({type:g,comment:$})}}function D(){var I=N(),T=O(r);if(T){if(y(),!O(a))return z("property missing ':'");var $=O(i),W=I({type:p,property:E(T[0].replace(e,h)),value:$?E($[0].replace(e,h)):h});return O(s),W}}function U(){var I=[];H(I);for(var T;T=D();)T!==!1&&(I.push(T),H(I));return I}return L(),U()}function E(b){return b?b.replace(u,h):h}return Zr=c,Zr}var fs;function ed(){if(fs)return Zt;fs=1;var e=Zt&&Zt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.default=n;const t=e(Zc());function n(r,a){let i=null;if(!r||typeof r!="string")return i;const s=(0,t.default)(r),u=typeof a=="function";return s.forEach(o=>{if(o.type!=="declaration")return;const{property:d,value:f}=o;u?a(d,f,o):f&&(i=i||{},i[d]=f)}),i}return Zt}var An={},ps;function td(){if(ps)return An;ps=1,Object.defineProperty(An,"__esModule",{value:!0}),An.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,i=function(d){return!d||n.test(d)||e.test(d)},s=function(d,f){return f.toUpperCase()},u=function(d,f){return"".concat(f,"-")},o=function(d,f){return f===void 0&&(f={}),i(d)?d:(d=d.toLowerCase(),f.reactCompat?d=d.replace(a,u):d=d.replace(r,u),d.replace(t,s))};return An.camelCase=o,An}var Cn,hs;function nd(){if(hs)return Cn;hs=1;var e=Cn&&Cn.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(ed()),n=td();function r(a,i){var s={};return!a||typeof a!="string"||(0,t.default)(a,function(u,o){u&&o&&(s[(0,n.camelCase)(u,i)]=o)}),s}return r.default=r,Cn=r,Cn}var rd=nd();const ad=Jr(rd),ir=ms("end"),gt=ms("start");function ms(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function gs(e){const t=gt(e),n=ir(e);if(t&&n)return{start:t,end:n}}function Sn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Es(e.position):"start"in e||"end"in e?Es(e):"line"in e||"column"in e?ea(e):""}function ea(e){return bs(e&&e.line)+":"+bs(e&&e.column)}function Es(e){return ea(e&&e.start)+"-"+ea(e&&e.end)}function bs(e){return e&&typeof e=="number"?e:1}class Xe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?a=t:!i.cause&&t&&(s=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const o=r.indexOf(":");o===-1?i.ruleId=r:(i.source=r.slice(0,o),i.ruleId=r.slice(o+1))}if(!i.place&&i.ancestors&&i.ancestors){const o=i.ancestors[i.ancestors.length-1];o&&(i.place=o.position)}const u=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=u?u.line:void 0,this.name=Sn(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Xe.prototype.file="",Xe.prototype.name="",Xe.prototype.reason="",Xe.prototype.message="",Xe.prototype.stack="",Xe.prototype.column=void 0,Xe.prototype.line=void 0,Xe.prototype.ancestors=void 0,Xe.prototype.cause=void 0,Xe.prototype.fatal=void 0,Xe.prototype.place=void 0,Xe.prototype.ruleId=void 0,Xe.prototype.source=void 0;const ta={}.hasOwnProperty,id=new Map,sd=/[A-Z]/g,od=new Set(["table","tbody","thead","tfoot","tr"]),ud=new Set(["td","th"]),Ts="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ld(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Ed(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=gd(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?wt:xn,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=ys(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function ys(e,t,n){if(t.type==="element")return cd(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return dd(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return pd(e,t,n);if(t.type==="mdxjsEsm")return fd(e,t);if(t.type==="root")return hd(e,t,n);if(t.type==="text")return md(e,t)}function cd(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=wt,e.schema=a),e.ancestors.push(t);const i=As(e,t.tagName,!1),s=bd(e,t);let u=ra(e,t);return od.has(t.tagName)&&(u=u.filter(function(o){return typeof o=="string"?!Vc(o):!0})),xs(e,s,i,t),na(s,u),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function dd(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}_n(e,t.position)}function fd(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_n(e,t.position)}function pd(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=wt,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:As(e,t.name,!0),s=Td(e,t),u=ra(e,t);return xs(e,s,i,t),na(s,u),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function hd(e,t,n){const r={};return na(r,ra(e,t)),e.create(t,e.Fragment,r,n)}function md(e,t){return t.value}function xs(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function na(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function gd(e,t,n){return r;function r(a,i,s,u){const d=Array.isArray(s.children)?n:t;return u?d(i,s,u):d(i,s)}}function Ed(e,t){return n;function n(r,a,i,s){const u=Array.isArray(i.children),o=gt(r);return t(a,i,s,u,{columnNumber:o?o.column-1:void 0,fileName:e,lineNumber:o?o.line:void 0},void 0)}}function bd(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&ta.call(t.properties,a)){const i=yd(e,a,t.properties[a]);if(i){const[s,u]=i;e.tableCellAlignToStyle&&s==="align"&&typeof u=="string"&&ud.has(t.tagName)?r=u:n[s]=u}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Td(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const u=s.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else _n(e,t.position);else{const a=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,i=e.evaluater.evaluateExpression(u.expression)}else _n(e,t.position);else i=r.value===null?!0:r.value;n[a]=i}return n}function ra(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:id;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const o=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(o){const d=a.get(o)||0;s=o+"-"+d,a.set(o,d+1)}}const u=ys(e,i,s);u!==void 0&&n.push(u)}return n}function yd(e,t,n){const r=ar(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Qi(n):cs(n)),r.property==="style"){let a=typeof n=="object"?n:xd(e,String(n));return e.stylePropertyNameCase==="css"&&(a=Ad(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?jc[r.property]||r.property:r.attribute,n]}}function xd(e,t){try{return ad(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Xe("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Ts+"#cannot-parse-style-attribute",a}}function As(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,s;for(;++i<a.length;){const u=Ji(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};s=s?{type:"MemberExpression",object:s,property:u,computed:!!(i&&u.type==="Literal"),optional:!1}:u}r=s}else r=Ji(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return ta.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);_n(e)}function _n(e,t){const n=new Xe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Ts+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Ad(e){const t={};let n;for(n in e)ta.call(e,n)&&(t[Cd(n)]=e[n]);return t}function Cd(e){let t=e.replace(sd,Sd);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Sd(e){return"-"+e.toLowerCase()}const aa={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},_d={};function Id(e,t){const n=_d,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Cs(e,r,a)}function Cs(e,t,n){if(Nd(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ss(e.children,t,n)}return Array.isArray(e)?Ss(e,t,n):""}function Ss(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=Cs(e[a],t,n);return r.join("")}function Nd(e){return!!(e&&typeof e=="object")}const _s=document.createElement("i");function In(e){const t="&"+e+";";_s.innerHTML=t;const n=_s.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Et(e,t,n,r){const a=e.length;let i=0,s;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function ct(e,t){return e.length>0?(Et(e,e.length,0,t),e):t}const Is={}.hasOwnProperty;function kd(e){const t={};let n=-1;for(;++n<e.length;)vd(t,e[n]);return t}function vd(e,t){let n;for(n in t){const a=(Is.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){Is.call(a,s)||(a[s]=[]);const u=i[s];wd(a[s],Array.isArray(u)?u:u?[u]:[])}}}function wd(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Et(e,0,0,r)}function Ns(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function en(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bt=Lt(/[A-Za-z]/),ut=Lt(/[\dA-Za-z]/),Ld=Lt(/[#-'*+\--9=?A-Z^-~]/);function ia(e){return e!==null&&(e<32||e===127)}const sa=Lt(/\d/),Od=Lt(/[\dA-Fa-f]/),Dd=Lt(/[!-/:-@[-`{-~]/);function he(e){return e!==null&&e<-2}function Ue(e){return e!==null&&(e<0||e===32)}function Ie(e){return e===-2||e===-1||e===32}const Nn=Lt(new RegExp("\\p{P}|\\p{S}","u")),kn=Lt(/\s/);function Lt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function tn(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&ut(e.charCodeAt(n+1))&&ut(e.charCodeAt(n+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const u=e.charCodeAt(n+1);i<56320&&u>56319&&u<57344?(s=String.fromCharCode(i,u),a=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+a+1,s=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function Ne(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(o){return Ie(o)?(e.enter(n),u(o)):t(o)}function u(o){return Ie(o)&&i++<a?(e.consume(o),u):(e.exit(n),t(o))}}const Pd={tokenize:Md};function Md(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Ne(e,t,"linePrefix")}function a(u){return e.enter("paragraph"),i(u)}function i(u){const o=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=o),n=o,s(u)}function s(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return he(u)?(e.consume(u),e.exit("chunkText"),i):(e.consume(u),s)}}const Rd={tokenize:Bd},ks={tokenize:Fd};function Bd(e){const t=this,n=[];let r=0,a,i,s;return u;function u(A){if(r<n.length){const w=n[r];return t.containerState=w[1],e.attempt(w[0].continuation,o,d)(A)}return d(A)}function o(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&x();const w=t.events.length;let N=w,F;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){F=t.events[N][1].end;break}m(r);let z=w;for(;z<t.events.length;)t.events[z][1].end={...F},z++;return Et(t.events,N+1,0,t.events.slice(w)),t.events.length=z,d(A)}return u(A)}function d(A){if(r===n.length){if(!a)return g(A);if(a.currentConstruct&&a.currentConstruct.concrete)return c(A);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ks,f,h)(A)}function f(A){return a&&x(),m(r),g(A)}function h(A){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,c(A)}function g(A){return t.containerState={},e.attempt(ks,p,c)(A)}function p(A){return r++,n.push([t.currentConstruct,t.containerState]),g(A)}function c(A){if(A===null){a&&x(),m(0),e.consume(A);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),E(A)}function E(A){if(A===null){b(e.exit("chunkFlow"),!0),m(0),e.consume(A);return}return he(A)?(e.consume(A),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(A),E)}function b(A,w){const N=t.sliceStream(A);if(w&&N.push(null),A.previous=i,i&&(i.next=A),i=A,a.defineSkip(A.start),a.write(N),t.parser.lazy[A.start.line]){let F=a.events.length;for(;F--;)if(a.events[F][1].start.offset<s&&(!a.events[F][1].end||a.events[F][1].end.offset>s))return;const z=t.events.length;let O=z,L,H;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(L){H=t.events[O][1].end;break}L=!0}for(m(r),F=z;F<t.events.length;)t.events[F][1].end={...H},F++;Et(t.events,O+1,0,t.events.slice(z)),t.events.length=F}}function m(A){let w=n.length;for(;w-- >A;){const N=n[w];t.containerState=N[1],N[0].exit.call(t,e)}n.length=A}function x(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function Fd(e,t,n){return Ne(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function vs(e){if(e===null||Ue(e)||kn(e))return 1;if(Nn(e))return 2}function oa(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const ua={name:"attention",resolveAll:Hd,tokenize:Ud};function Hd(e,t){let n=-1,r,a,i,s,u,o,d,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;o=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},g={...e[n][1].start};ws(h,-o),ws(g,o),s={type:o>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},u={type:o>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},i={type:o>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:o>1?"strong":"emphasis",start:{...s.start},end:{...u.end}},e[r][1].end={...s.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=ct(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=ct(d,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),d=ct(d,oa(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=ct(d,[["exit",i,t],["enter",u,t],["exit",u,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,d=ct(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Et(e,r-1,n-r+3,d),n=r+d.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Ud(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=vs(r);let i;return s;function s(o){return i=o,e.enter("attentionSequence"),u(o)}function u(o){if(o===i)return e.consume(o),u;const d=e.exit("attentionSequence"),f=vs(o),h=!f||f===2&&a||n.includes(o),g=!a||a===2&&f||n.includes(r);return d._open=!!(i===42?h:h&&(a||!g)),d._close=!!(i===42?g:g&&(f||!h)),t(o)}}function ws(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const $d={name:"autolink",tokenize:qd};function qd(e,t,n){let r=0;return a;function a(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return bt(p)?(e.consume(p),s):p===64?n(p):d(p)}function s(p){return p===43||p===45||p===46||ut(p)?(r=1,u(p)):d(p)}function u(p){return p===58?(e.consume(p),r=0,o):(p===43||p===45||p===46||ut(p))&&r++<32?(e.consume(p),u):(r=0,d(p))}function o(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||ia(p)?n(p):(e.consume(p),o)}function d(p){return p===64?(e.consume(p),f):Ld(p)?(e.consume(p),d):n(p)}function f(p){return ut(p)?h(p):n(p)}function h(p){return p===46?(e.consume(p),r=0,f):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):g(p)}function g(p){if((p===45||ut(p))&&r++<63){const c=p===45?g:h;return e.consume(p),c}return n(p)}}const sr={partial:!0,tokenize:zd};function zd(e,t,n){return r;function r(i){return Ie(i)?Ne(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||he(i)?t(i):n(i)}}const Ls={continuation:{tokenize:Yd},exit:Gd,name:"blockQuote",tokenize:Vd};function Vd(e,t,n){const r=this;return a;function a(s){if(s===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return Ie(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Yd(e,t,n){const r=this;return a;function a(s){return Ie(s)?Ne(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(Ls,t,n)(s)}}function Gd(e){e.exit("blockQuote")}const Os={name:"characterEscape",tokenize:Wd};function Wd(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return Dd(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Ds={name:"characterReference",tokenize:jd};function jd(e,t,n){const r=this;let a=0,i,s;return u;function u(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),o}function o(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),i=31,s=ut,f(h))}function d(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=Od,f):(e.enter("characterReferenceValue"),i=7,s=sa,f(h))}function f(h){if(h===59&&a){const g=e.exit("characterReferenceValue");return s===ut&&!In(r.sliceSerialize(g))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&a++<i?(e.consume(h),f):n(h)}}const Ps={partial:!0,tokenize:Kd},Ms={concrete:!0,name:"codeFenced",tokenize:Xd};function Xd(e,t,n){const r=this,a={partial:!0,tokenize:N};let i=0,s=0,u;return o;function o(F){return d(F)}function d(F){const z=r.events[r.events.length-1];return i=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,u=F,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(F)}function f(F){return F===u?(s++,e.consume(F),f):s<3?n(F):(e.exit("codeFencedFenceSequence"),Ie(F)?Ne(e,h,"whitespace")(F):h(F))}function h(F){return F===null||he(F)?(e.exit("codeFencedFence"),r.interrupt?t(F):e.check(Ps,E,w)(F)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(F))}function g(F){return F===null||he(F)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(F)):Ie(F)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ne(e,p,"whitespace")(F)):F===96&&F===u?n(F):(e.consume(F),g)}function p(F){return F===null||he(F)?h(F):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),c(F))}function c(F){return F===null||he(F)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(F)):F===96&&F===u?n(F):(e.consume(F),c)}function E(F){return e.attempt(a,w,b)(F)}function b(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),m}function m(F){return i>0&&Ie(F)?Ne(e,x,"linePrefix",i+1)(F):x(F)}function x(F){return F===null||he(F)?e.check(Ps,E,w)(F):(e.enter("codeFlowValue"),A(F))}function A(F){return F===null||he(F)?(e.exit("codeFlowValue"),x(F)):(e.consume(F),A)}function w(F){return e.exit("codeFenced"),t(F)}function N(F,z,O){let L=0;return H;function H(T){return F.enter("lineEnding"),F.consume(T),F.exit("lineEnding"),y}function y(T){return F.enter("codeFencedFence"),Ie(T)?Ne(F,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):D(T)}function D(T){return T===u?(F.enter("codeFencedFenceSequence"),U(T)):O(T)}function U(T){return T===u?(L++,F.consume(T),U):L>=s?(F.exit("codeFencedFenceSequence"),Ie(T)?Ne(F,I,"whitespace")(T):I(T)):O(T)}function I(T){return T===null||he(T)?(F.exit("codeFencedFence"),z(T)):O(T)}}}function Kd(e,t,n){const r=this;return a;function a(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const la={name:"codeIndented",tokenize:Jd},Qd={partial:!0,tokenize:Zd};function Jd(e,t,n){const r=this;return a;function a(d){return e.enter("codeIndented"),Ne(e,i,"linePrefix",5)(d)}function i(d){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?o(d):he(d)?e.attempt(Qd,s,o)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||he(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),u)}function o(d){return e.exit("codeIndented"),t(d)}}function Zd(e,t,n){const r=this;return a;function a(s){return r.parser.lazy[r.now().line]?n(s):he(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):Ne(e,i,"linePrefix",5)(s)}function i(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(s):he(s)?a(s):n(s)}}const ef={name:"codeText",previous:nf,resolve:tf,tokenize:rf};function tf(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function nf(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function rf(e,t,n){let r=0,a,i;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),u(h)}function u(h){return h===96?(e.consume(h),r++,u):(e.exit("codeTextSequence"),o(h))}function o(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),o):h===96?(i=e.enter("codeTextSequence"),a=0,f(h)):he(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),o):(e.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||he(h)?(e.exit("codeTextData"),o(h)):(e.consume(h),d)}function f(h){return h===96?(e.consume(h),a++,f):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",d(h))}}class af{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&vn(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),vn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),vn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);vn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);vn(this.left,n.reverse())}}}function vn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Rs(e){const t={};let n=-1,r,a,i,s,u,o,d;const f=new af(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(o=r[1]._tokenizer.events,i=0,i<o.length&&o[i][1].type==="lineEndingBlank"&&(i+=2),i<o.length&&o[i][1].type==="content"))for(;++i<o.length&&o[i][1].type!=="content";)o[i][1].type==="chunkText"&&(o[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,sf(f,n)),n=t[n],d=!0);else if(r[1]._container){for(i=n,a=void 0;i--;)if(s=f.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(a&&(f.get(a)[1].type="lineEndingBlank"),s[1].type="lineEnding",a=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;a&&(r[1].end={...f.get(a)[1].start},u=f.slice(a,n),u.unshift(r),f.splice(a,n-a+1,u))}}return Et(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!d}function sf(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const u=s.events,o=[],d={};let f,h,g=-1,p=n,c=0,E=0;const b=[E];for(;p;){for(;e.get(++a)[1]!==p;);i.push(a),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),h&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++g<u.length;)u[g][0]==="exit"&&u[g-1][0]==="enter"&&u[g][1].type===u[g-1][1].type&&u[g][1].start.line!==u[g][1].end.line&&(E=g+1,b.push(E),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):b.pop(),g=b.length;g--;){const m=u.slice(b[g],b[g+1]),x=i.pop();o.push([x,x+m.length-1]),e.splice(x,2,m)}for(o.reverse(),g=-1;++g<o.length;)d[c+o[g][0]]=c+o[g][1],c+=o[g][1]-o[g][0]-1;return d}const of={resolve:lf,tokenize:cf},uf={partial:!0,tokenize:df};function lf(e){return Rs(e),e}function cf(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(u)}function a(u){return u===null?i(u):he(u)?e.check(uf,s,i)(u):(e.consume(u),a)}function i(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function s(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function df(e,t,n){const r=this;return a;function a(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ne(e,i,"linePrefix")}function i(s){if(s===null||he(s))return n(s);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Bs(e,t,n,r,a,i,s,u,o){const d=o||Number.POSITIVE_INFINITY;let f=0;return h;function h(m){return m===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(m),e.exit(i),g):m===null||m===32||m===41||ia(m)?n(m):(e.enter(r),e.enter(s),e.enter(u),e.enter("chunkString",{contentType:"string"}),E(m))}function g(m){return m===62?(e.enter(i),e.consume(m),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===62?(e.exit("chunkString"),e.exit(u),g(m)):m===null||m===60||he(m)?n(m):(e.consume(m),m===92?c:p)}function c(m){return m===60||m===62||m===92?(e.consume(m),p):p(m)}function E(m){return!f&&(m===null||m===41||Ue(m))?(e.exit("chunkString"),e.exit(u),e.exit(s),e.exit(r),t(m)):f<d&&m===40?(e.consume(m),f++,E):m===41?(e.consume(m),f--,E):m===null||m===32||m===40||ia(m)?n(m):(e.consume(m),m===92?b:E)}function b(m){return m===40||m===41||m===92?(e.consume(m),E):E(m)}}function Fs(e,t,n,r,a,i){const s=this;let u=0,o;return d;function d(p){return e.enter(r),e.enter(a),e.consume(p),e.exit(a),e.enter(i),f}function f(p){return u>999||p===null||p===91||p===93&&!o||p===94&&!u&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(i),e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):he(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||he(p)||u++>999?(e.exit("chunkString"),f(p)):(e.consume(p),o||(o=!Ie(p)),p===92?g:h)}function g(p){return p===91||p===92||p===93?(e.consume(p),u++,h):h(p)}}function Hs(e,t,n,r,a,i){let s;return u;function u(g){return g===34||g===39||g===40?(e.enter(r),e.enter(a),e.consume(g),e.exit(a),s=g===40?41:g,o):n(g)}function o(g){return g===s?(e.enter(a),e.consume(g),e.exit(a),e.exit(r),t):(e.enter(i),d(g))}function d(g){return g===s?(e.exit(i),o(s)):g===null?n(g):he(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Ne(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===s||g===null||he(g)?(e.exit("chunkString"),d(g)):(e.consume(g),g===92?h:f)}function h(g){return g===s||g===92?(e.consume(g),f):f(g)}}function xt(e,t){let n;return r;function r(a){return he(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Ie(a)?Ne(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const ff={name:"definition",tokenize:hf},pf={partial:!0,tokenize:mf};function hf(e,t,n){const r=this;let a;return i;function i(p){return e.enter("definition"),s(p)}function s(p){return Fs.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function u(p){return a=en(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),o):n(p)}function o(p){return Ue(p)?xt(e,d)(p):d(p)}function d(p){return Bs(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(pf,h,h)(p)}function h(p){return Ie(p)?Ne(e,g,"whitespace")(p):g(p)}function g(p){return p===null||he(p)?(e.exit("definition"),r.parser.defined.push(a),t(p)):n(p)}}function mf(e,t,n){return r;function r(u){return Ue(u)?xt(e,a)(u):n(u)}function a(u){return Hs(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function i(u){return Ie(u)?Ne(e,s,"whitespace")(u):s(u)}function s(u){return u===null||he(u)?t(u):n(u)}}const gf={name:"hardBreakEscape",tokenize:Ef};function Ef(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return he(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const bf={name:"headingAtx",resolve:Tf,tokenize:yf};function Tf(e,t){let n=e.length-2,r=3,a,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Et(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function yf(e,t,n){let r=0;return a;function a(f){return e.enter("atxHeading"),i(f)}function i(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||Ue(f)?(e.exit("atxHeadingSequence"),u(f)):n(f)}function u(f){return f===35?(e.enter("atxHeadingSequence"),o(f)):f===null||he(f)?(e.exit("atxHeading"),t(f)):Ie(f)?Ne(e,u,"whitespace")(f):(e.enter("atxHeadingText"),d(f))}function o(f){return f===35?(e.consume(f),o):(e.exit("atxHeadingSequence"),u(f))}function d(f){return f===null||f===35||Ue(f)?(e.exit("atxHeadingText"),u(f)):(e.consume(f),d)}}const xf=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Us=["pre","script","style","textarea"],Af={concrete:!0,name:"htmlFlow",resolveTo:_f,tokenize:If},Cf={partial:!0,tokenize:kf},Sf={partial:!0,tokenize:Nf};function _f(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function If(e,t,n){const r=this;let a,i,s,u,o;return d;function d(k){return f(k)}function f(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),h}function h(k){return k===33?(e.consume(k),g):k===47?(e.consume(k),i=!0,E):k===63?(e.consume(k),a=3,r.interrupt?t:S):bt(k)?(e.consume(k),s=String.fromCharCode(k),b):n(k)}function g(k){return k===45?(e.consume(k),a=2,p):k===91?(e.consume(k),a=5,u=0,c):bt(k)?(e.consume(k),a=4,r.interrupt?t:S):n(k)}function p(k){return k===45?(e.consume(k),r.interrupt?t:S):n(k)}function c(k){const ye="CDATA[";return k===ye.charCodeAt(u++)?(e.consume(k),u===ye.length?r.interrupt?t:D:c):n(k)}function E(k){return bt(k)?(e.consume(k),s=String.fromCharCode(k),b):n(k)}function b(k){if(k===null||k===47||k===62||Ue(k)){const ye=k===47,Se=s.toLowerCase();return!ye&&!i&&Us.includes(Se)?(a=1,r.interrupt?t(k):D(k)):xf.includes(s.toLowerCase())?(a=6,ye?(e.consume(k),m):r.interrupt?t(k):D(k)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(k):i?x(k):A(k))}return k===45||ut(k)?(e.consume(k),s+=String.fromCharCode(k),b):n(k)}function m(k){return k===62?(e.consume(k),r.interrupt?t:D):n(k)}function x(k){return Ie(k)?(e.consume(k),x):H(k)}function A(k){return k===47?(e.consume(k),H):k===58||k===95||bt(k)?(e.consume(k),w):Ie(k)?(e.consume(k),A):H(k)}function w(k){return k===45||k===46||k===58||k===95||ut(k)?(e.consume(k),w):N(k)}function N(k){return k===61?(e.consume(k),F):Ie(k)?(e.consume(k),N):A(k)}function F(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),o=k,z):Ie(k)?(e.consume(k),F):O(k)}function z(k){return k===o?(e.consume(k),o=null,L):k===null||he(k)?n(k):(e.consume(k),z)}function O(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||Ue(k)?N(k):(e.consume(k),O)}function L(k){return k===47||k===62||Ie(k)?A(k):n(k)}function H(k){return k===62?(e.consume(k),y):n(k)}function y(k){return k===null||he(k)?D(k):Ie(k)?(e.consume(k),y):n(k)}function D(k){return k===45&&a===2?(e.consume(k),$):k===60&&a===1?(e.consume(k),W):k===62&&a===4?(e.consume(k),pe):k===63&&a===3?(e.consume(k),S):k===93&&a===5?(e.consume(k),ne):he(k)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(Cf,ce,U)(k)):k===null||he(k)?(e.exit("htmlFlowData"),U(k)):(e.consume(k),D)}function U(k){return e.check(Sf,I,ce)(k)}function I(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),T}function T(k){return k===null||he(k)?U(k):(e.enter("htmlFlowData"),D(k))}function $(k){return k===45?(e.consume(k),S):D(k)}function W(k){return k===47?(e.consume(k),s="",q):D(k)}function q(k){if(k===62){const ye=s.toLowerCase();return Us.includes(ye)?(e.consume(k),pe):D(k)}return bt(k)&&s.length<8?(e.consume(k),s+=String.fromCharCode(k),q):D(k)}function ne(k){return k===93?(e.consume(k),S):D(k)}function S(k){return k===62?(e.consume(k),pe):k===45&&a===2?(e.consume(k),S):D(k)}function pe(k){return k===null||he(k)?(e.exit("htmlFlowData"),ce(k)):(e.consume(k),pe)}function ce(k){return e.exit("htmlFlow"),t(k)}}function Nf(e,t,n){const r=this;return a;function a(s){return he(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function kf(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(sr,t,n)}}const vf={name:"htmlText",tokenize:wf};function wf(e,t,n){const r=this;let a,i,s;return u;function u(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),o}function o(S){return S===33?(e.consume(S),d):S===47?(e.consume(S),N):S===63?(e.consume(S),A):bt(S)?(e.consume(S),O):n(S)}function d(S){return S===45?(e.consume(S),f):S===91?(e.consume(S),i=0,c):bt(S)?(e.consume(S),x):n(S)}function f(S){return S===45?(e.consume(S),p):n(S)}function h(S){return S===null?n(S):S===45?(e.consume(S),g):he(S)?(s=h,W(S)):(e.consume(S),h)}function g(S){return S===45?(e.consume(S),p):h(S)}function p(S){return S===62?$(S):S===45?g(S):h(S)}function c(S){const pe="CDATA[";return S===pe.charCodeAt(i++)?(e.consume(S),i===pe.length?E:c):n(S)}function E(S){return S===null?n(S):S===93?(e.consume(S),b):he(S)?(s=E,W(S)):(e.consume(S),E)}function b(S){return S===93?(e.consume(S),m):E(S)}function m(S){return S===62?$(S):S===93?(e.consume(S),m):E(S)}function x(S){return S===null||S===62?$(S):he(S)?(s=x,W(S)):(e.consume(S),x)}function A(S){return S===null?n(S):S===63?(e.consume(S),w):he(S)?(s=A,W(S)):(e.consume(S),A)}function w(S){return S===62?$(S):A(S)}function N(S){return bt(S)?(e.consume(S),F):n(S)}function F(S){return S===45||ut(S)?(e.consume(S),F):z(S)}function z(S){return he(S)?(s=z,W(S)):Ie(S)?(e.consume(S),z):$(S)}function O(S){return S===45||ut(S)?(e.consume(S),O):S===47||S===62||Ue(S)?L(S):n(S)}function L(S){return S===47?(e.consume(S),$):S===58||S===95||bt(S)?(e.consume(S),H):he(S)?(s=L,W(S)):Ie(S)?(e.consume(S),L):$(S)}function H(S){return S===45||S===46||S===58||S===95||ut(S)?(e.consume(S),H):y(S)}function y(S){return S===61?(e.consume(S),D):he(S)?(s=y,W(S)):Ie(S)?(e.consume(S),y):L(S)}function D(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),a=S,U):he(S)?(s=D,W(S)):Ie(S)?(e.consume(S),D):(e.consume(S),I)}function U(S){return S===a?(e.consume(S),a=void 0,T):S===null?n(S):he(S)?(s=U,W(S)):(e.consume(S),U)}function I(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||Ue(S)?L(S):(e.consume(S),I)}function T(S){return S===47||S===62||Ue(S)?L(S):n(S)}function $(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function W(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),q}function q(S){return Ie(S)?Ne(e,ne,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):ne(S)}function ne(S){return e.enter("htmlTextData"),s(S)}}const ca={name:"labelEnd",resolveAll:Pf,resolveTo:Mf,tokenize:Rf},Lf={tokenize:Bf},Of={tokenize:Ff},Df={tokenize:Hf};function Pf(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&Et(e,0,e.length,n),e}function Mf(e,t){let n=e.length,r=0,a,i,s,u;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(s=n);const o={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return u=[["enter",o,t],["enter",d,t]],u=ct(u,e.slice(i+1,i+r+3)),u=ct(u,[["enter",f,t]]),u=ct(u,oa(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),u=ct(u,[["exit",f,t],e[s-2],e[s-1],["exit",d,t]]),u=ct(u,e.slice(s+1)),u=ct(u,[["exit",o,t]]),Et(e,i,e.length,u),e}function Rf(e,t,n){const r=this;let a=r.events.length,i,s;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return u;function u(g){return i?i._inactive?h(g):(s=r.parser.defined.includes(en(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),o):n(g)}function o(g){return g===40?e.attempt(Lf,f,s?f:h)(g):g===91?e.attempt(Of,f,s?d:h)(g):s?f(g):h(g)}function d(g){return e.attempt(Df,f,h)(g)}function f(g){return t(g)}function h(g){return i._balanced=!0,n(g)}}function Bf(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),a}function a(h){return Ue(h)?xt(e,i)(h):i(h)}function i(h){return h===41?f(h):Bs(e,s,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return Ue(h)?xt(e,o)(h):f(h)}function u(h){return n(h)}function o(h){return h===34||h===39||h===40?Hs(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):f(h)}function d(h){return Ue(h)?xt(e,f)(h):f(h)}function f(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function Ff(e,t,n){const r=this;return a;function a(u){return Fs.call(r,e,i,s,"reference","referenceMarker","referenceString")(u)}function i(u){return r.parser.defined.includes(en(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function s(u){return n(u)}}function Hf(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const Uf={name:"labelStartImage",resolveAll:ca.resolveAll,tokenize:$f};function $f(e,t,n){const r=this;return a;function a(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),i}function i(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),s):n(u)}function s(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const qf={name:"labelStartLink",resolveAll:ca.resolveAll,tokenize:zf};function zf(e,t,n){const r=this;return a;function a(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const da={name:"lineEnding",tokenize:Vf};function Vf(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ne(e,t,"linePrefix")}}const or={name:"thematicBreak",tokenize:Yf};function Yf(e,t,n){let r=0,a;return i;function i(d){return e.enter("thematicBreak"),s(d)}function s(d){return a=d,u(d)}function u(d){return d===a?(e.enter("thematicBreakSequence"),o(d)):r>=3&&(d===null||he(d))?(e.exit("thematicBreak"),t(d)):n(d)}function o(d){return d===a?(e.consume(d),r++,o):(e.exit("thematicBreakSequence"),Ie(d)?Ne(e,u,"whitespace")(d):u(d))}}const tt={continuation:{tokenize:Xf},exit:Qf,name:"list",tokenize:jf},Gf={partial:!0,tokenize:Jf},Wf={partial:!0,tokenize:Kf};function jf(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,s=0;return u;function u(p){const c=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(c==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:sa(p)){if(r.containerState.type||(r.containerState.type=c,e.enter(c,{_container:!0})),c==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(or,n,d)(p):d(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),o(p)}return n(p)}function o(p){return sa(p)&&++s<10?(e.consume(p),o):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),d(p)):n(p)}function d(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(sr,r.interrupt?n:f,e.attempt(Gf,g,h))}function f(p){return r.containerState.initialBlankLine=!0,i++,g(p)}function h(p){return Ie(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),g):n(p)}function g(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Xf(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(sr,a,i);function a(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ne(e,t,"listItemIndent",r.containerState.size+1)(u)}function i(u){return r.containerState.furtherBlankLines||!Ie(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Wf,t,s)(u))}function s(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ne(e,e.attempt(tt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function Kf(e,t,n){const r=this;return Ne(e,a,"listItemIndent",r.containerState.size+1);function a(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function Qf(e){e.exit(this.containerState.type)}function Jf(e,t,n){const r=this;return Ne(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const s=r.events[r.events.length-1];return!Ie(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const $s={name:"setextUnderline",resolveTo:Zf,tokenize:ep};function Zf(e,t){let n=e.length,r,a,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function ep(e,t,n){const r=this;let a;return i;function i(d){let f=r.events.length,h;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){h=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),a=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===a?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),Ie(d)?Ne(e,o,"lineSuffix")(d):o(d))}function o(d){return d===null||he(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const tp={tokenize:np};function np(e){const t=this,n=e.attempt(sr,r,e.attempt(this.parser.constructs.flowInitial,a,Ne(e,e.attempt(this.parser.constructs.flow,a,e.attempt(of,a)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const rp={resolveAll:zs()},ap=qs("string"),ip=qs("text");function qs(e){return{resolveAll:zs(e==="text"?sp:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,s,u);return s;function s(f){return d(f)?i(f):u(f)}function u(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),o}function o(f){return d(f)?(n.exit("data"),i(f)):(n.consume(f),o)}function d(f){if(f===null)return!0;const h=a[f];let g=-1;if(h)for(;++g<h.length;){const p=h[g];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function zs(e){return t;function t(n,r){let a=-1,i;for(;++a<=n.length;)i===void 0?n[a]&&n[a][1].type==="data"&&(i=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==i+2&&(n[i][1].end=n[a-1][1].end,n.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(n,r):n}}function sp(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let i=a.length,s=-1,u=0,o;for(;i--;){const d=a[i];if(typeof d=="string"){for(s=d.length;d.charCodeAt(s-1)===32;)u++,s--;if(s)break;s=-1}else if(d===-2)o=!0,u++;else if(d!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const d={type:n===e.length||o||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const op=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:ff},disable:{null:[]},document:{42:tt,43:tt,45:tt,48:tt,49:tt,50:tt,51:tt,52:tt,53:tt,54:tt,55:tt,56:tt,57:tt,62:Ls},flow:{35:bf,42:or,45:[$s,or],60:Af,61:$s,95:or,96:Ms,126:Ms},flowInitial:{[-2]:la,[-1]:la,32:la},insideSpan:{null:[ua,rp]},string:{38:Ds,92:Os},text:{[-5]:da,[-4]:da,[-3]:da,33:Uf,38:Ds,42:ua,60:[$d,vf],91:qf,92:[gf,Os],93:ca,95:ua,96:ef}},Symbol.toStringTag,{value:"Module"}));function up(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},i=[];let s=[],u=[];const o={attempt:z(N),check:z(F),consume:x,enter:A,exit:w,interrupt:z(F,{interrupt:!0})},d={code:null,containerState:{},defineSkip:E,events:[],now:c,parser:e,previous:null,sliceSerialize:g,sliceStream:p,write:h};let f=t.tokenize.call(d,o);return t.resolveAll&&i.push(t),d;function h(y){return s=ct(s,y),b(),s[s.length-1]!==null?[]:(O(t,0),d.events=oa(i,d.events,d),d.events)}function g(y,D){return cp(p(y),D)}function p(y){return lp(s,y)}function c(){const{_bufferIndex:y,_index:D,line:U,column:I,offset:T}=r;return{_bufferIndex:y,_index:D,line:U,column:I,offset:T}}function E(y){a[y.line]=y.column,H()}function b(){let y;for(;r._index<s.length;){const D=s[r._index];if(typeof D=="string")for(y=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===y&&r._bufferIndex<D.length;)m(D.charCodeAt(r._bufferIndex));else m(D)}}function m(y){f=f(y)}function x(y){he(y)?(r.line++,r.column=1,r.offset+=y===-3?2:1,H()):y!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=y}function A(y,D){const U=D||{};return U.type=y,U.start=c(),d.events.push(["enter",U,d]),u.push(U),U}function w(y){const D=u.pop();return D.end=c(),d.events.push(["exit",D,d]),D}function N(y,D){O(y,D.from)}function F(y,D){D.restore()}function z(y,D){return U;function U(I,T,$){let W,q,ne,S;return Array.isArray(I)?ce(I):"tokenize"in I?ce([I]):pe(I);function pe(_e){return ge;function ge(ke){const Pe=ke!==null&&_e[ke],Le=ke!==null&&_e.null,ze=[...Array.isArray(Pe)?Pe:Pe?[Pe]:[],...Array.isArray(Le)?Le:Le?[Le]:[]];return ce(ze)(ke)}}function ce(_e){return W=_e,q=0,_e.length===0?$:k(_e[q])}function k(_e){return ge;function ge(ke){return S=L(),ne=_e,_e.partial||(d.currentConstruct=_e),_e.name&&d.parser.constructs.disable.null.includes(_e.name)?Se():_e.tokenize.call(D?Object.assign(Object.create(d),D):d,o,ye,Se)(ke)}}function ye(_e){return y(ne,S),T}function Se(_e){return S.restore(),++q<W.length?k(W[q]):$}}}function O(y,D){y.resolveAll&&!i.includes(y)&&i.push(y),y.resolve&&Et(d.events,D,d.events.length-D,y.resolve(d.events.slice(D),d)),y.resolveTo&&(d.events=y.resolveTo(d.events,d))}function L(){const y=c(),D=d.previous,U=d.currentConstruct,I=d.events.length,T=Array.from(u);return{from:I,restore:$};function $(){r=y,d.previous=D,d.currentConstruct=U,d.events.length=I,u=T,H()}}function H(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function lp(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let s;if(n===a)s=[e[n].slice(r,i)];else{if(s=e.slice(n,a),r>-1){const u=s[0];typeof u=="string"?s[0]=u.slice(r):s.shift()}i>0&&s.push(e[a].slice(0,i))}return s}function cp(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
3
+ `;break}case-3:{s=`\r
4
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,r.push(s)}return r.join("")}function dp(e){const r={constructs:kd([op,...(e||{}).extensions||[]]),content:a(Pd),defined:[],document:a(Rd),flow:a(tp),lazy:{},string:a(ap),text:a(ip)};return r;function a(i){return s;function s(u){return up(r,i,u)}}}function fp(e){for(;!Rs(e););return e}const Vs=/[\0\t\n\r]/g;function pp(){let e=1,t="",n=!0,r;return a;function a(i,s,u){const o=[];let d,f,h,g,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),h=0,t="",n&&(i.charCodeAt(0)===65279&&h++,n=void 0);h<i.length;){if(Vs.lastIndex=h,d=Vs.exec(i),g=d&&d.index!==void 0?d.index:i.length,p=i.charCodeAt(g),!d){t=i.slice(h);break}if(p===10&&h===g&&r)o.push(-3),r=void 0;else switch(r&&(o.push(-5),r=void 0),h<g&&(o.push(i.slice(h,g)),e+=g-h),p){case 0:{o.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,o.push(-2);e++<f;)o.push(-1);break}case 10:{o.push(-4),e=1;break}default:r=!0,e=1}h=g+1}return u&&(r&&o.push(-5),t&&o.push(t),o.push(null)),o}}const hp=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function mp(e){return e.replace(hp,gp)}function gp(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return Ns(n.slice(i?2:1),i?16:10)}return In(n)||e}const Ys={}.hasOwnProperty;function Ep(e,t,n){return typeof t!="string"&&(n=t,t=void 0),bp(n)(fp(dp(n).document().write(pp()(e,t,!0))))}function bp(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(jn),autolinkProtocol:L,autolinkEmail:L,atxHeading:i(fn),blockQuote:i(Le),characterEscape:L,characterReference:L,codeFenced:i(ze),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(ze,s),codeText:i(rt,s),codeTextData:L,data:L,codeFlowValue:L,definition:i(Ct),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(Bt),hardBreakEscape:i(vr),hardBreakTrailing:i(vr),htmlFlow:i(Gt,s),htmlFlowData:L,htmlText:i(Gt,s),htmlTextData:L,image:i(wr),label:s,link:i(jn),listItem:i(ii),listItemValue:g,listOrdered:i(Lr,h),listUnordered:i(Lr),paragraph:i(si),reference:k,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(fn),strong:i(oi),thematicBreak:i(pn)},exit:{atxHeading:o(),atxHeadingSequence:N,autolink:o(),autolinkEmail:Pe,autolinkProtocol:ke,blockQuote:o(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:Se,characterReferenceMarkerNumeric:Se,characterReferenceValue:_e,characterReference:ge,codeFenced:o(b),codeFencedFence:E,codeFencedFenceInfo:p,codeFencedFenceMeta:c,codeFlowValue:H,codeIndented:o(m),codeText:o(T),codeTextData:H,data:H,definition:o(),definitionDestinationString:w,definitionLabelString:x,definitionTitleString:A,emphasis:o(),hardBreakEscape:o(D),hardBreakTrailing:o(D),htmlFlow:o(U),htmlFlowData:H,htmlText:o(I),htmlTextData:H,image:o(W),label:ne,labelText:q,lineEnding:y,link:o($),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:ye,resourceDestinationString:S,resourceTitleString:pe,resource:ce,setextHeading:o(O),setextHeadingLineSequence:z,setextHeadingText:F,strong:o(),thematicBreak:o()}};Gs(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(te){let de={type:"root",children:[]};const me={stack:[de],tokenStack:[],config:t,enter:u,exit:d,buffer:s,resume:f,data:n},be=[];let we=-1;for(;++we<te.length;)if(te[we][1].type==="listOrdered"||te[we][1].type==="listUnordered")if(te[we][0]==="enter")be.push(we);else{const at=be.pop();we=a(te,at,we)}for(we=-1;++we<te.length;){const at=t[te[we][0]];Ys.call(at,te[we][1].type)&&at[te[we][1].type].call(Object.assign({sliceSerialize:te[we][2].sliceSerialize},me),te[we][1])}if(me.tokenStack.length>0){const at=me.tokenStack[me.tokenStack.length-1];(at[1]||Ws).call(me,void 0,at[0])}for(de.position={start:Ot(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:Ot(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we<t.transforms.length;)de=t.transforms[we](de)||de;return de}function a(te,de,me){let be=de-1,we=-1,at=!1,ht,Ve,it,St;for(;++be<=me;){const Qe=te[be];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?we++:we--,St=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(ht&&!St&&!we&&!it&&(it=be),St=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:St=void 0}if(!we&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||we===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(ht){let _t=be;for(Ve=void 0;_t--;){const lt=te[_t];if(lt[1].type==="lineEnding"||lt[1].type==="lineEndingBlank"){if(lt[0]==="exit")continue;Ve&&(te[Ve][1].type="lineEndingBlank",at=!0),lt[1].type="lineEnding",Ve=_t}else if(!(lt[1].type==="linePrefix"||lt[1].type==="blockQuotePrefix"||lt[1].type==="blockQuotePrefixWhitespace"||lt[1].type==="blockQuoteMarker"||lt[1].type==="listItemIndent"))break}it&&(!Ve||it<Ve)&&(ht._spread=!0),ht.end=Object.assign({},Ve?te[Ve][1].start:Qe[1].end),te.splice(Ve||be,0,["exit",ht,Qe[2]]),be++,me++}if(Qe[1].type==="listItemPrefix"){const _t={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};ht=_t,te.splice(be,0,["enter",_t,Qe[2]]),be++,me++,it=void 0,St=!0}}}return te[de][1]._spread=at,me}function i(te,de){return me;function me(be){u.call(this,te(be),be),de&&de.call(this,be)}}function s(){this.stack.push({type:"fragment",children:[]})}function u(te,de,me){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([de,me||void 0]),te.position={start:Ot(de.start),end:void 0}}function o(te){return de;function de(me){te&&te.call(this,me),d.call(this,me)}}function d(te,de){const me=this.stack.pop(),be=this.tokenStack.pop();if(be)be[0].type!==te.type&&(de?de.call(this,te,be[0]):(be[1]||Ws).call(this,te,be[0]));else throw new Error("Cannot close `"+te.type+"` ("+Sn({start:te.start,end:te.end})+"): it’s not open");me.position.end=Ot(te.end)}function f(){return Id(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function g(te){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function p(){const te=this.resume(),de=this.stack[this.stack.length-1];de.lang=te}function c(){const te=this.resume(),de=this.stack[this.stack.length-1];de.meta=te}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te.replace(/(\r?\n|\r)$/g,"")}function x(te){const de=this.resume(),me=this.stack[this.stack.length-1];me.label=de,me.identifier=en(this.sliceSerialize(te)).toLowerCase()}function A(){const te=this.resume(),de=this.stack[this.stack.length-1];de.title=te}function w(){const te=this.resume(),de=this.stack[this.stack.length-1];de.url=te}function N(te){const de=this.stack[this.stack.length-1];if(!de.depth){const me=this.sliceSerialize(te).length;de.depth=me}}function F(){this.data.setextHeadingSlurpLineEnding=!0}function z(te){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function L(te){const me=this.stack[this.stack.length-1].children;let be=me[me.length-1];(!be||be.type!=="text")&&(be=Xn(),be.position={start:Ot(te.start),end:void 0},me.push(be)),this.stack.push(be)}function H(te){const de=this.stack.pop();de.value+=this.sliceSerialize(te),de.position.end=Ot(te.end)}function y(te){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const me=de.children[de.children.length-1];me.position.end=Ot(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(L.call(this,te),H.call(this,te))}function D(){this.data.atHardBreak=!0}function U(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function I(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function T(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function $(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=de,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function W(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=de,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function q(te){const de=this.sliceSerialize(te),me=this.stack[this.stack.length-2];me.label=mp(de),me.identifier=en(de).toLowerCase()}function ne(){const te=this.stack[this.stack.length-1],de=this.resume(),me=this.stack[this.stack.length-1];if(this.data.inReference=!0,me.type==="link"){const be=te.children;me.children=be}else me.alt=de}function S(){const te=this.resume(),de=this.stack[this.stack.length-1];de.url=te}function pe(){const te=this.resume(),de=this.stack[this.stack.length-1];de.title=te}function ce(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function ye(te){const de=this.resume(),me=this.stack[this.stack.length-1];me.label=de,me.identifier=en(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function Se(te){this.data.characterReferenceType=te.type}function _e(te){const de=this.sliceSerialize(te),me=this.data.characterReferenceType;let be;me?(be=Ns(de,me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):be=In(de);const we=this.stack[this.stack.length-1];we.value+=be}function ge(te){const de=this.stack.pop();de.position.end=Ot(te.end)}function ke(te){H.call(this,te);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(te)}function Pe(te){H.call(this,te);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(te)}function Le(){return{type:"blockquote",children:[]}}function ze(){return{type:"code",lang:null,meta:null,value:""}}function rt(){return{type:"inlineCode",value:""}}function Ct(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Bt(){return{type:"emphasis",children:[]}}function fn(){return{type:"heading",depth:0,children:[]}}function vr(){return{type:"break"}}function Gt(){return{type:"html",value:""}}function wr(){return{type:"image",title:null,url:"",alt:null}}function jn(){return{type:"link",title:null,url:"",children:[]}}function Lr(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function ii(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function si(){return{type:"paragraph",children:[]}}function oi(){return{type:"strong",children:[]}}function Xn(){return{type:"text",value:""}}function pn(){return{type:"thematicBreak"}}}function Ot(e){return{line:e.line,column:e.column,offset:e.offset}}function Gs(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Gs(e,r):Tp(e,r)}}function Tp(e,t){let n;for(n in t)if(Ys.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Ws(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Sn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Sn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Sn({start:t.start,end:t.end})+") is still open")}function yp(e){const t=this;t.parser=n;function n(r){return Ep(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function xp(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Ap(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
5
+ `}]}function Cp(e,t){const n=t.value?t.value+`
6
+ `:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function Sp(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _p(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ip(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=tn(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let s,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=i+1,u+=1,e.footnoteCounts.set(r,u);const o={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,o);const d={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(t,d),e.applyData(t,d)}function Np(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kp(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function js(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const s=a[a.length-1];return s&&s.type==="text"?s.value+=r:a.push({type:"text",value:r}),a}function vp(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return js(e,t);const a={src:tn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)}function wp(e,t){const n={src:tn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Lp(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Op(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return js(e,t);const a={href:tn(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Dp(e,t){const n={href:tn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Pp(e,t,n){const r=e.all(t),a=n?Mp(n):Xs(t),i={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let h;f&&f.type==="element"&&f.tagName==="p"?h=f:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const f=r[u];(a||u!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
7
+ `}),f.type==="element"&&f.tagName==="p"&&!a?s.push(...f.children):s.push(f)}const o=r[r.length-1];o&&(a||o.type!=="element"||o.tagName!=="p")&&s.push({type:"text",value:`
8
+ `});const d={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,d),e.applyData(t,d)}function Mp(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Xs(n[r])}return t}function Xs(e){const t=e.spread;return t??e.children.length>1}function Rp(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const s=r[a];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function Bp(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fp(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Hp(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Up(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),a.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=gt(t.children[1]),o=ir(t.children[t.children.length-1]);u&&o&&(s.position={start:u,end:o}),a.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)}function $p(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,u=s?s.length:t.children.length;let o=-1;const d=[];for(;++o<u;){const h=t.children[o],g={},p=s?s[o]:void 0;p&&(g.align=p);let c={type:"element",tagName:i,properties:g,children:[]};h&&(c.children=e.all(h),e.patch(h,c),c=e.applyData(h,c)),d.push(c)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,f),e.applyData(t,f)}function qp(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ks=9,Qs=32;function zp(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const i=[];for(;r;)i.push(Js(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return i.push(Js(t.slice(a),a>0,!1)),i.join("")}function Js(e,t,n){let r=0,a=e.length;if(t){let i=e.codePointAt(r);for(;i===Ks||i===Qs;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(a-1);for(;i===Ks||i===Qs;)a--,i=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function Vp(e,t){const n={type:"text",value:zp(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Yp(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Gp={blockquote:xp,break:Ap,code:Cp,delete:Sp,emphasis:_p,footnoteReference:Ip,heading:Np,html:kp,imageReference:vp,image:wp,inlineCode:Lp,linkReference:Op,link:Dp,listItem:Pp,list:Rp,paragraph:Bp,root:Fp,strong:Hp,table:Up,tableCell:qp,tableRow:$p,text:Vp,thematicBreak:Yp,toml:ur,yaml:ur,definition:ur,footnoteDefinition:ur};function ur(){}const Zs=-1,lr=0,wn=1,cr=2,fa=3,pa=4,ha=5,ma=6,eo=7,to=8,no=typeof self=="object"?self:globalThis,Wp=(e,t)=>{const n=(a,i)=>(e.set(i,a),a),r=a=>{if(e.has(a))return e.get(a);const[i,s]=t[a];switch(i){case lr:case Zs:return n(s,a);case wn:{const u=n([],a);for(const o of s)u.push(r(o));return u}case cr:{const u=n({},a);for(const[o,d]of s)u[r(o)]=r(d);return u}case fa:return n(new Date(s),a);case pa:{const{source:u,flags:o}=s;return n(new RegExp(u,o),a)}case ha:{const u=n(new Map,a);for(const[o,d]of s)u.set(r(o),r(d));return u}case ma:{const u=n(new Set,a);for(const o of s)u.add(r(o));return u}case eo:{const{name:u,message:o}=s;return n(new no[u](o),a)}case to:return n(BigInt(s),a);case"BigInt":return n(Object(BigInt(s)),a);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new no[i](s),a)};return r},ro=e=>Wp(new Map,e)(0),nn="",{toString:jp}={},{keys:Xp}=Object,Ln=e=>{const t=typeof e;if(t!=="object"||!e)return[lr,t];const n=jp.call(e).slice(8,-1);switch(n){case"Array":return[wn,nn];case"Object":return[cr,nn];case"Date":return[fa,nn];case"RegExp":return[pa,nn];case"Map":return[ha,nn];case"Set":return[ma,nn];case"DataView":return[wn,n]}return n.includes("Array")?[wn,n]:n.includes("Error")?[eo,n]:[cr,n]},dr=([e,t])=>e===lr&&(t==="function"||t==="symbol"),Kp=(e,t,n,r)=>{const a=(s,u)=>{const o=r.push(s)-1;return n.set(u,o),o},i=s=>{if(n.has(s))return n.get(s);let[u,o]=Ln(s);switch(u){case lr:{let f=s;switch(o){case"bigint":u=to,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+o);f=null;break;case"undefined":return a([Zs],s)}return a([u,f],s)}case wn:{if(o){let g=s;return o==="DataView"?g=new Uint8Array(s.buffer):o==="ArrayBuffer"&&(g=new Uint8Array(s)),a([o,[...g]],s)}const f=[],h=a([u,f],s);for(const g of s)f.push(i(g));return h}case cr:{if(o)switch(o){case"BigInt":return a([o,s.toString()],s);case"Boolean":case"Number":case"String":return a([o,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const f=[],h=a([u,f],s);for(const g of Xp(s))(e||!dr(Ln(s[g])))&&f.push([i(g),i(s[g])]);return h}case fa:return a([u,s.toISOString()],s);case pa:{const{source:f,flags:h}=s;return a([u,{source:f,flags:h}],s)}case ha:{const f=[],h=a([u,f],s);for(const[g,p]of s)(e||!(dr(Ln(g))||dr(Ln(p))))&&f.push([i(g),i(p)]);return h}case ma:{const f=[],h=a([u,f],s);for(const g of s)(e||!dr(Ln(g)))&&f.push(i(g));return h}}const{message:d}=s;return a([u,{name:o,message:d}],s)};return i},ao=(e,{json:t,lossy:n}={})=>{const r=[];return Kp(!(t||n),!!t,new Map,r)(e),r},$t=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ro(ao(e,t)):structuredClone(e):(e,t)=>ro(ao(e,t));function Qp(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Jp(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Zp(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Qp,r=e.options.footnoteBackLabel||Jp,a=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let o=-1;for(;++o<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[o]);if(!d)continue;const f=e.all(d),h=String(d.identifier).toUpperCase(),g=tn(h.toLowerCase());let p=0;const c=[],E=e.footnoteCounts.get(h);for(;E!==void 0&&++p<=E;){c.length>0&&c.push({type:"text",value:" "});let x=typeof n=="string"?n:n(o,p);typeof x=="string"&&(x={type:"text",value:x}),c.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(o,p),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const b=f[f.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const x=b.children[b.children.length-1];x&&x.type==="text"?x.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...c)}else f.push(...c);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(f,!0)};e.patch(d,m),u.push(m)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...$t(s),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
9
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
10
+ `}]}}const io=function(e){if(e==null)return rh;if(typeof e=="function")return fr(e);if(typeof e=="object")return Array.isArray(e)?eh(e):th(e);if(typeof e=="string")return nh(e);throw new Error("Expected function, string, or object as test")};function eh(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=io(e[n]);return fr(r);function r(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function th(e){const t=e;return fr(n);function n(r){const a=r;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function nh(e){return fr(t);function t(n){return n&&n.type===e}}function fr(e){return t;function t(n,r,a){return!!(ah(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function rh(){return!0}function ah(e){return e!==null&&typeof e=="object"&&"type"in e}function ub(e){return e}const so=[],ih=!0,oo=!1,sh="skip";function uo(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const i=io(a),s=r?-1:1;u(e,void 0,[])();function u(o,d,f){const h=o&&typeof o=="object"?o:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(o.type+(p?"<"+p+">":""))+")"})}return g;function g(){let p=so,c,E,b;if((!t||i(o,d,f[f.length-1]||void 0))&&(p=oh(n(o,f)),p[0]===oo))return p;if("children"in o&&o.children){const m=o;if(m.children&&p[0]!==sh)for(E=(r?m.children.length:-1)+s,b=f.concat(m);E>-1&&E<m.children.length;){const x=m.children[E];if(c=u(x,E,b)(),c[0]===oo)return c;E=typeof c[1]=="number"?c[1]:E+s}}return p}}}function oh(e){return Array.isArray(e)?e:typeof e=="number"?[ih,e]:e==null?so:[e]}function pr(e,t,n,r){let a,i,s;typeof t=="function"&&typeof n!="function"?(i=void 0,s=t,a=n):(i=t,s=n,a=r),uo(e,i,u,a);function u(o,d){const f=d[d.length-1],h=f?f.children.indexOf(o):void 0;return s(o,h,f)}}const ga={}.hasOwnProperty,uh={};function lh(e,t){const n=t||uh,r=new Map,a=new Map,i=new Map,s={...Gp,...n.handlers},u={all:d,applyData:dh,definitionById:r,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:s,one:o,options:n,patch:ch,wrap:ph};return pr(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const h=f.type==="definition"?r:a,g=String(f.identifier).toUpperCase();h.has(g)||h.set(g,f)}}),u;function o(f,h){const g=f.type,p=u.handlers[g];if(ga.call(u.handlers,g)&&p)return p(u,f,h);if(u.options.passThrough&&u.options.passThrough.includes(g)){if("children"in f){const{children:E,...b}=f,m=$t(b);return m.children=u.all(f),m}return $t(f)}return(u.options.unknownHandler||fh)(u,f,h)}function d(f){const h=[];if("children"in f){const g=f.children;let p=-1;for(;++p<g.length;){const c=u.one(g[p],f);if(c){if(p&&g[p-1].type==="break"&&(!Array.isArray(c)&&c.type==="text"&&(c.value=lo(c.value)),!Array.isArray(c)&&c.type==="element")){const E=c.children[0];E&&E.type==="text"&&(E.value=lo(E.value))}Array.isArray(c)?h.push(...c):h.push(c)}}}return h}}function ch(e,t){e.position&&(t.position=gs(e))}function dh(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&i&&Object.assign(n.properties,$t(i)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function fh(e,t){const n=t.data||{},r="value"in t&&!(ga.call(n,"hProperties")||ga.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ph(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
11
+ `});++r<e.length;)r&&n.push({type:"text",value:`
12
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
13
+ `}),n}function lo(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function co(e,t){const n=lh(e,t),r=n.one(e,void 0),a=Zp(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&i.children.push({type:"text",value:`
14
+ `},a),i}function hh(e,t){return e&&"run"in e?async function(n,r){const a=co(n,{file:r,...t});await e.run(a,r)}:function(n,r){return co(n,{file:r,...e||t})}}function fo(e){if(e)throw e}var Ea,po;function mh(){if(po)return Ea;po=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},i=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var f=e.call(d,"constructor"),h=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!f&&!h)return!1;var g;for(g in d);return typeof g>"u"||e.call(d,g)},s=function(d,f){n&&f.name==="__proto__"?n(d,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):d[f.name]=f.newValue},u=function(d,f){if(f==="__proto__")if(e.call(d,f)){if(r)return r(d,f).value}else return;return d[f]};return Ea=function o(){var d,f,h,g,p,c,E=arguments[0],b=1,m=arguments.length,x=!1;for(typeof E=="boolean"&&(x=E,E=arguments[1]||{},b=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});b<m;++b)if(d=arguments[b],d!=null)for(f in d)h=u(E,f),g=u(d,f),E!==g&&(x&&g&&(i(g)||(p=a(g)))?(p?(p=!1,c=h&&a(h)?h:[]):c=h&&i(h)?h:{},s(E,{name:f,newValue:o(x,c,g)})):typeof g<"u"&&s(E,{name:f,newValue:g}));return E},Ea}var gh=mh();const ba=Jr(gh);function Ta(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Eh(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);u(null,...a);function u(o,...d){const f=e[++i];let h=-1;if(o){s(o);return}for(;++h<a.length;)(d[h]===null||d[h]===void 0)&&(d[h]=a[h]);a=d,f?bh(f,u)(...d):s(null,...d)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function bh(e,t){let n;return r;function r(...s){const u=e.length>s.length;let o;u&&s.push(a);try{o=e.apply(this,s)}catch(d){const f=d;if(u&&n)throw f;return a(f)}u||(o&&o.then&&typeof o.then=="function"?o.then(i,a):o instanceof Error?a(o):i(o))}function a(s,...u){n||(n=!0,t(s,...u))}function i(s){a(null,s)}}const Tt={basename:Th,dirname:yh,extname:xh,join:Ah,sep:"/"};function Th(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');On(e);let n=0,r=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else r<0&&(i=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,u=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else s<0&&(i=!0,s=a+1),u>-1&&(e.codePointAt(a)===t.codePointAt(u--)?u<0&&(r=a):(u=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function yh(e){if(On(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function xh(e){On(e);let t=e.length,n=-1,r=0,a=-1,i=0,s;for(;t--;){const u=e.codePointAt(t);if(u===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),u===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function Ah(...e){let t=-1,n;for(;++t<e.length;)On(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Ch(n)}function Ch(e){On(e);const t=e.codePointAt(0)===47;let n=Sh(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Sh(e,t){let n="",r=0,a=-1,i=0,s=-1,u,o;for(;++s<=e.length;){if(s<e.length)u=e.codePointAt(s);else{if(u===47)break;u=47}if(u===47){if(!(a===s-1||i===1))if(a!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(o=n.lastIndexOf("/"),o!==n.length-1){o<0?(n="",r=0):(n=n.slice(0,o),r=n.length-1-n.lastIndexOf("/")),a=s,i=0;continue}}else if(n.length>0){n="",r=0,a=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,s):n=e.slice(a+1,s),r=s-a-1;a=s,i=0}else u===46&&i>-1?i++:i=-1}return n}function On(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _h={cwd:Ih};function Ih(){return"/"}function ya(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Nh(e){if(typeof e=="string")e=new URL(e);else if(!ya(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return kh(e)}function kh(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const xa=["history","path","basename","stem","extname","dirname"];class ho{constructor(t){let n;t?ya(t)?n={path:t}:typeof t=="string"||vh(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":_h.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<xa.length;){const i=xa[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let a;for(a in n)xa.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Tt.basename(this.path):void 0}set basename(t){Ca(t,"basename"),Aa(t,"basename"),this.path=Tt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Tt.dirname(this.path):void 0}set dirname(t){mo(this.basename,"dirname"),this.path=Tt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Tt.extname(this.path):void 0}set extname(t){if(Aa(t,"extname"),mo(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Tt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ya(t)&&(t=Nh(t)),Ca(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Tt.basename(this.path,this.extname):void 0}set stem(t){Ca(t,"stem"),Aa(t,"stem"),this.path=Tt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new Xe(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Aa(e,t){if(e&&e.includes(Tt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Tt.sep+"`")}function Ca(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function mo(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function vh(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wh=function(e){const r=this.constructor.prototype,a=r[e],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},Lh={}.hasOwnProperty;class Sa extends wh{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Eh()}copy(){const t=new Sa;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ba(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Na("data",this.frozen),this.namespace[t]=n,this):Lh.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Na("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=hr(t),r=this.parser||this.Parser;return _a("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),_a("process",this.parser||this.Parser),Ia("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,s){const u=hr(t),o=r.parse(u);r.run(o,u,function(f,h,g){if(f||!h||!g)return d(f);const p=h,c=r.stringify(p,g);Ph(c)?g.value=c:g.result=c,d(f,g)});function d(f,h){f||!h?s(f):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),_a("processSync",this.parser||this.Parser),Ia("processSync",this.compiler||this.Compiler),this.process(t,a),Eo("processSync","process",n),r;function a(i,s){n=!0,fo(i),r=s}}run(t,n,r){go(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,u){const o=hr(n);a.run(t,o,d);function d(f,h,g){const p=h||t;f?u(f):s?s(p):r(void 0,p,g)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),Eo("runSync","run",r),a;function i(s,u){fo(s),a=u,r=!0}}stringify(t,n){this.freeze();const r=hr(n),a=this.compiler||this.Compiler;return Ia("stringify",a),go(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Na("use",this.frozen),t!=null)if(typeof t=="function")o(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(d){if(typeof d=="function")o(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[f,...h]=d;o(f,h)}else s(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function s(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(d.plugins),d.settings&&(a.settings=ba(!0,a.settings,d.settings))}function u(d){let f=-1;if(d!=null)if(Array.isArray(d))for(;++f<d.length;){const h=d[f];i(h)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function o(d,f){let h=-1,g=-1;for(;++h<r.length;)if(r[h][0]===d){g=h;break}if(g===-1)r.push([d,...f]);else if(f.length>0){let[p,...c]=f;const E=r[g][1];Ta(E)&&Ta(p)&&(p=ba(!0,E,p)),r[g]=[d,p,...c]}}}}const Oh=new Sa().freeze();function _a(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ia(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Na(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function go(e){if(!Ta(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Eo(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function hr(e){return Dh(e)?e:new ho(e)}function Dh(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ph(e){return typeof e=="string"||Mh(e)}function Mh(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Rh="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",bo=[],To={allowDangerousHtml:!0},Bh=/^(https?|ircs?|mailto|xmpp)$/i,Fh=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function yo(e){const t=Hh(e),n=Uh(e);return $h(t.runSync(t.parse(n),n),e)}function Hh(e){const t=e.rehypePlugins||bo,n=e.remarkPlugins||bo,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...To}:To;return Oh().use(yp).use(n).use(hh,r).use(t)}function Uh(e){const t=e.children||"",n=new ho;return typeof t=="string"&&(n.value=t),n}function $h(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,i=t.disallowedElements,s=t.skipHtml,u=t.unwrapDisallowed,o=t.urlTransform||qh;for(const f of Fh)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+Rh+f.id,void 0);return pr(e,d),ld(e,{Fragment:G.Fragment,components:a,ignoreInvalidStyle:!0,jsx:G.jsx,jsxs:G.jsxs,passKeys:!0,passNode:!0});function d(f,h,g){if(f.type==="raw"&&g&&typeof h=="number")return s?g.children.splice(h,1):g.children[h]={type:"text",value:f.value},h;if(f.type==="element"){let p;for(p in aa)if(Object.hasOwn(aa,p)&&Object.hasOwn(f.properties,p)){const c=f.properties[p],E=aa[p];(E===null||E.includes(f.tagName))&&(f.properties[p]=o(String(c||""),p,f))}}if(f.type==="element"){let p=n?!n.includes(f.tagName):i?i.includes(f.tagName):!1;if(!p&&r&&typeof h=="number"&&(p=!r(f,h,g)),p&&g&&typeof h=="number")return u&&f.children?g.children.splice(h,1,...f.children):g.children.splice(h,1),h}}}function qh(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||Bh.test(e.slice(0,t))?e:""}const xo=/[#.]/g;function zh(e,t){const n=e||"",r={};let a=0,i,s;for(;a<n.length;){xo.lastIndex=a;const u=xo.exec(n),o=n.slice(a,u?u.index:n.length);o&&(i?i==="#"?r.id=o:Array.isArray(r.className)?r.className.push(o):r.className=[o]:s=o,a+=o.length),u&&(i=u[0],a++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function Ao(e,t,n){const r=n?Wh(n):void 0;function a(i,s,...u){let o;if(i==null){o={type:"root",children:[]};const d=s;u.unshift(d)}else{o=zh(i,t);const d=o.tagName.toLowerCase(),f=r?r.get(d):void 0;if(o.tagName=f||d,Vh(s))u.unshift(s);else for(const[h,g]of Object.entries(s))Yh(e,o.properties,h,g)}for(const d of u)ka(o.children,d);return o.type==="element"&&o.tagName==="template"&&(o.content={type:"root",children:o.children},o.children=[]),o}return a}function Vh(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const a=t[r];if(a&&typeof a=="object"){if(!Array.isArray(a))return!0;const i=a;for(const s of i)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Yh(e,t,n,r){const a=ar(e,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?a.spaceSeparated?i=ls(r):a.commaSeparated?i=Ki(r):a.commaOrSpaceSeparated?i=ls(Ki(r).join(" ")):i=Co(a,a.property,r):Array.isArray(r)?i=[...r]:i=a.property==="style"?Gh(r):String(r);if(Array.isArray(i)){const s=[];for(const u of i)s.push(Co(a,a.property,u));i=s}a.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[a.property]=i}}function ka(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)ka(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?ka(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Co(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||yn(n)===yn(t)))return!0}return n}function Gh(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Wh(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const jh=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Xh=Ao(xn,"div"),Kh=Ao(wt,"g",jh);function Qh(e){const t=String(e),n=[];return{toOffset:a,toPoint:r};function r(i){if(typeof i=="number"&&i>-1&&i<=t.length){let s=0;for(;;){let u=n[s];if(u===void 0){const o=So(t,n[s-1]);u=o===-1?t.length+1:o+1,n[s]=u}if(u>i)return{line:s+1,column:i-(s>0?n[s-1]:0)+1,offset:i};s++}}}function a(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length<i.line;){const u=n[n.length-1],o=So(t,u),d=o===-1?t.length+1:o+1;if(u===d)break;n.push(d)}const s=(i.line>1?n[i.line-2]:0)+i.column-1;if(s<n[i.line-1])return s}}}function So(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
15
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const qt={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},_o={}.hasOwnProperty,Jh=Object.prototype;function Zh(e,t){const n=t||{};return va({file:n.file||void 0,location:!1,schema:n.space==="svg"?wt:xn,verbose:n.verbose||!1},e)}function va(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},mr(e,r,n),n}case"#document":case"#document-fragment":{const r=t,a="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Io(e,t.childNodes),data:{quirksMode:a}},e.file&&e.location){const i=String(e.file),s=Qh(i),u=s.toPoint(0),o=s.toPoint(i.length);n.position={start:u,end:o}}return n}case"#documentType":{const r=t;return n={type:"doctype"},mr(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},mr(e,r,n),n}default:return n=e0(e,t),n}}function Io(e,t){let n=-1;const r=[];for(;++n<t.length;){const a=va(e,t[n]);r.push(a)}return r}function e0(e,t){const n=e.schema;e.schema=t.namespaceURI===qt.svg?wt:xn;let r=-1;const a={};for(;++r<t.attrs.length;){const u=t.attrs[r],o=(u.prefix?u.prefix+":":"")+u.name;_o.call(Jh,o)||(a[o]=u.value)}const s=(e.schema.space==="svg"?Kh:Xh)(t.tagName,a,Io(e,t.childNodes));if(mr(e,t,s),s.tagName==="template"){const u=t,o=u.sourceCodeLocation,d=o&&o.startTag&&rn(o.startTag),f=o&&o.endTag&&rn(o.endTag),h=va(e,u.content);d&&f&&e.file&&(h.position={start:d.end,end:f.start}),s.content=h}return e.schema=n,s}function mr(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=t0(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function t0(e,t,n){const r=rn(n);if(t.type==="element"){const a=t.children[t.children.length-1];if(r&&!n.endTag&&a&&a.position&&a.position.end&&(r.end=Object.assign({},a.position.end)),e.verbose){const i={};let s;if(n.attrs)for(s in n.attrs)_o.call(n.attrs,s)&&(i[ar(e.schema,s).property]=rn(n.attrs[s]));n.startTag;const u=rn(n.startTag),o=n.endTag?rn(n.endTag):void 0,d={opening:u};o&&(d.closing=o),d.properties=i,t.data={position:d}}}return r}function rn(e){const t=No({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=No({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function No(e){return e.line&&e.column?e:void 0}const ko={}.hasOwnProperty;function vo(e,t){const n=t||{};function r(a,...i){let s=r.invalid;const u=r.handlers;if(a&&ko.call(a,e)){const o=String(a[e]);s=ko.call(u,o)?u[o]:r.unknown}if(s)return s.call(this,a,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const n0={},r0={}.hasOwnProperty,wo=vo("type",{handlers:{root:i0,element:c0,text:u0,comment:l0,doctype:o0}});function a0(e,t){const r=(t||n0).space;return wo(e,r==="svg"?wt:xn)}function i0(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=wa(e.children,n,t),an(e,n),n}function s0(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=wa(e.children,n,t),an(e,n),n}function o0(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return an(e,t),t}function u0(e){const t={nodeName:"#text",value:e.value,parentNode:null};return an(e,t),t}function l0(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return an(e,t),t}function c0(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=wt);const a=[];let i;if(e.properties){for(i in e.properties)if(i!=="children"&&r0.call(e.properties,i)){const o=d0(r,i,e.properties[i]);o&&a.push(o)}}const s=r.space,u={nodeName:e.tagName,tagName:e.tagName,attrs:a,namespaceURI:qt[s],childNodes:[],parentNode:null};return u.childNodes=wa(e.children,u,r),an(e,u),e.tagName==="template"&&e.content&&(u.content=s0(e.content,r)),u}function d0(e,t,n){const r=ar(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Qi(n):cs(n));const a={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const i=a.name.indexOf(":");i<0?a.prefix="":(a.name=a.name.slice(i+1),a.prefix=r.attribute.slice(0,i)),a.namespace=qt[r.space]}return a}function wa(e,t,n){let r=-1;const a=[];if(e)for(;++r<e.length;){const i=wo(e[r],n);i.parentNode=t,a.push(i)}return a}function an(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const f0=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],p0=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Be="�";var C;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(C||(C={}));const nt={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Lo(e){return e>=55296&&e<=57343}function h0(e){return e>=56320&&e<=57343}function m0(e,t){return(e-55296)*1024+9216+t}function Oo(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Do(e){return e>=64976&&e<=65007||p0.has(e)}var Z;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Z||(Z={}));const g0=65536;class E0{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=g0,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:a,offset:i}=this,s=a+n,u=i+n;return{code:t,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:u,endOffset:u}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(h0(n))return this.pos++,this._addGap(),m0(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,C.EOF;return this._err(Z.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,C.EOF;const r=this.html.charCodeAt(n);return r===C.CARRIAGE_RETURN?C.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,C.EOF;let t=this.html.charCodeAt(this.pos);return t===C.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,C.LINE_FEED):t===C.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Lo(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===C.LINE_FEED||t===C.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Oo(t)?this._err(Z.controlCharacterInInputStream):Do(t)&&this._err(Z.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Ae;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(Ae||(Ae={}));function Po(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const b0=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),T0=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function y0(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=T0.get(e))!==null&&t!==void 0?t:e}var Ge;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ge||(Ge={}));const x0=32;var Dt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Dt||(Dt={}));function La(e){return e>=Ge.ZERO&&e<=Ge.NINE}function A0(e){return e>=Ge.UPPER_A&&e<=Ge.UPPER_F||e>=Ge.LOWER_A&&e<=Ge.LOWER_F}function C0(e){return e>=Ge.UPPER_A&&e<=Ge.UPPER_Z||e>=Ge.LOWER_A&&e<=Ge.LOWER_Z||La(e)}function S0(e){return e===Ge.EQUALS||C0(e)}var We;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(We||(We={}));var At;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(At||(At={}));class _0{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=We.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=At.Strict}startEntity(t){this.decodeMode=t,this.state=We.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case We.EntityStart:return t.charCodeAt(n)===Ge.NUM?(this.state=We.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=We.NamedEntity,this.stateNamedEntity(t,n));case We.NumericStart:return this.stateNumericStart(t,n);case We.NumericDecimal:return this.stateNumericDecimal(t,n);case We.NumericHex:return this.stateNumericHex(t,n);case We.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|x0)===Ge.LOWER_X?(this.state=We.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=We.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,a){if(n!==r){const i=r-n;this.result=this.result*Math.pow(a,i)+Number.parseInt(t.substr(n,i),a),this.consumed+=i}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const a=t.charCodeAt(n);if(La(a)||A0(a))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(a,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const a=t.charCodeAt(n);if(La(a))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(a,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Ge.SEMI)this.consumed+=1;else if(this.decodeMode===At.Strict)return 0;return this.emitCodePoint(y0(this.result),this.consumed),this.errors&&(t!==Ge.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let a=r[this.treeIndex],i=(a&Dt.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=I0(r,a,this.treeIndex+Math.max(1,i),s),this.treeIndex<0)return this.result===0||this.decodeMode===At.Attribute&&(i===0||S0(s))?0:this.emitNotTerminatedNamedEntity();if(a=r[this.treeIndex],i=(a&Dt.VALUE_LENGTH)>>14,i!==0){if(s===Ge.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==At.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,a=(r[n]&Dt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,a,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:a}=this;return this.emitCodePoint(n===1?a[t]&~Dt.VALUE_LENGTH:a[t+1],r),n===3&&this.emitCodePoint(a[t+2],r),r}end(){var t;switch(this.state){case We.NamedEntity:return this.result!==0&&(this.decodeMode!==At.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case We.NumericDecimal:return this.emitNumericEntity(0,2);case We.NumericHex:return this.emitNumericEntity(0,3);case We.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case We.EntityStart:return 0}}}function I0(e,t,n,r){const a=(t&Dt.BRANCH_LENGTH)>>7,i=t&Dt.JUMP_TABLE;if(a===0)return i!==0&&r===i?n:-1;if(i){const o=r-i;return o<0||o>=a?-1:e[n+o]-1}let s=n,u=s+a-1;for(;s<=u;){const o=s+u>>>1,d=e[o];if(d<r)s=o+1;else if(d>r)u=o-1;else return e[o+a]}return-1}var ie;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(ie||(ie={}));var zt;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(zt||(zt={}));var dt;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(dt||(dt={}));var Y;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(Y||(Y={}));var l;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(l||(l={}));const N0=new Map([[Y.A,l.A],[Y.ADDRESS,l.ADDRESS],[Y.ANNOTATION_XML,l.ANNOTATION_XML],[Y.APPLET,l.APPLET],[Y.AREA,l.AREA],[Y.ARTICLE,l.ARTICLE],[Y.ASIDE,l.ASIDE],[Y.B,l.B],[Y.BASE,l.BASE],[Y.BASEFONT,l.BASEFONT],[Y.BGSOUND,l.BGSOUND],[Y.BIG,l.BIG],[Y.BLOCKQUOTE,l.BLOCKQUOTE],[Y.BODY,l.BODY],[Y.BR,l.BR],[Y.BUTTON,l.BUTTON],[Y.CAPTION,l.CAPTION],[Y.CENTER,l.CENTER],[Y.CODE,l.CODE],[Y.COL,l.COL],[Y.COLGROUP,l.COLGROUP],[Y.DD,l.DD],[Y.DESC,l.DESC],[Y.DETAILS,l.DETAILS],[Y.DIALOG,l.DIALOG],[Y.DIR,l.DIR],[Y.DIV,l.DIV],[Y.DL,l.DL],[Y.DT,l.DT],[Y.EM,l.EM],[Y.EMBED,l.EMBED],[Y.FIELDSET,l.FIELDSET],[Y.FIGCAPTION,l.FIGCAPTION],[Y.FIGURE,l.FIGURE],[Y.FONT,l.FONT],[Y.FOOTER,l.FOOTER],[Y.FOREIGN_OBJECT,l.FOREIGN_OBJECT],[Y.FORM,l.FORM],[Y.FRAME,l.FRAME],[Y.FRAMESET,l.FRAMESET],[Y.H1,l.H1],[Y.H2,l.H2],[Y.H3,l.H3],[Y.H4,l.H4],[Y.H5,l.H5],[Y.H6,l.H6],[Y.HEAD,l.HEAD],[Y.HEADER,l.HEADER],[Y.HGROUP,l.HGROUP],[Y.HR,l.HR],[Y.HTML,l.HTML],[Y.I,l.I],[Y.IMG,l.IMG],[Y.IMAGE,l.IMAGE],[Y.INPUT,l.INPUT],[Y.IFRAME,l.IFRAME],[Y.KEYGEN,l.KEYGEN],[Y.LABEL,l.LABEL],[Y.LI,l.LI],[Y.LINK,l.LINK],[Y.LISTING,l.LISTING],[Y.MAIN,l.MAIN],[Y.MALIGNMARK,l.MALIGNMARK],[Y.MARQUEE,l.MARQUEE],[Y.MATH,l.MATH],[Y.MENU,l.MENU],[Y.META,l.META],[Y.MGLYPH,l.MGLYPH],[Y.MI,l.MI],[Y.MO,l.MO],[Y.MN,l.MN],[Y.MS,l.MS],[Y.MTEXT,l.MTEXT],[Y.NAV,l.NAV],[Y.NOBR,l.NOBR],[Y.NOFRAMES,l.NOFRAMES],[Y.NOEMBED,l.NOEMBED],[Y.NOSCRIPT,l.NOSCRIPT],[Y.OBJECT,l.OBJECT],[Y.OL,l.OL],[Y.OPTGROUP,l.OPTGROUP],[Y.OPTION,l.OPTION],[Y.P,l.P],[Y.PARAM,l.PARAM],[Y.PLAINTEXT,l.PLAINTEXT],[Y.PRE,l.PRE],[Y.RB,l.RB],[Y.RP,l.RP],[Y.RT,l.RT],[Y.RTC,l.RTC],[Y.RUBY,l.RUBY],[Y.S,l.S],[Y.SCRIPT,l.SCRIPT],[Y.SEARCH,l.SEARCH],[Y.SECTION,l.SECTION],[Y.SELECT,l.SELECT],[Y.SOURCE,l.SOURCE],[Y.SMALL,l.SMALL],[Y.SPAN,l.SPAN],[Y.STRIKE,l.STRIKE],[Y.STRONG,l.STRONG],[Y.STYLE,l.STYLE],[Y.SUB,l.SUB],[Y.SUMMARY,l.SUMMARY],[Y.SUP,l.SUP],[Y.TABLE,l.TABLE],[Y.TBODY,l.TBODY],[Y.TEMPLATE,l.TEMPLATE],[Y.TEXTAREA,l.TEXTAREA],[Y.TFOOT,l.TFOOT],[Y.TD,l.TD],[Y.TH,l.TH],[Y.THEAD,l.THEAD],[Y.TITLE,l.TITLE],[Y.TR,l.TR],[Y.TRACK,l.TRACK],[Y.TT,l.TT],[Y.U,l.U],[Y.UL,l.UL],[Y.SVG,l.SVG],[Y.VAR,l.VAR],[Y.WBR,l.WBR],[Y.XMP,l.XMP]]);function sn(e){var t;return(t=N0.get(e))!==null&&t!==void 0?t:l.UNKNOWN}const oe=l,k0={[ie.HTML]:new Set([oe.ADDRESS,oe.APPLET,oe.AREA,oe.ARTICLE,oe.ASIDE,oe.BASE,oe.BASEFONT,oe.BGSOUND,oe.BLOCKQUOTE,oe.BODY,oe.BR,oe.BUTTON,oe.CAPTION,oe.CENTER,oe.COL,oe.COLGROUP,oe.DD,oe.DETAILS,oe.DIR,oe.DIV,oe.DL,oe.DT,oe.EMBED,oe.FIELDSET,oe.FIGCAPTION,oe.FIGURE,oe.FOOTER,oe.FORM,oe.FRAME,oe.FRAMESET,oe.H1,oe.H2,oe.H3,oe.H4,oe.H5,oe.H6,oe.HEAD,oe.HEADER,oe.HGROUP,oe.HR,oe.HTML,oe.IFRAME,oe.IMG,oe.INPUT,oe.LI,oe.LINK,oe.LISTING,oe.MAIN,oe.MARQUEE,oe.MENU,oe.META,oe.NAV,oe.NOEMBED,oe.NOFRAMES,oe.NOSCRIPT,oe.OBJECT,oe.OL,oe.P,oe.PARAM,oe.PLAINTEXT,oe.PRE,oe.SCRIPT,oe.SECTION,oe.SELECT,oe.SOURCE,oe.STYLE,oe.SUMMARY,oe.TABLE,oe.TBODY,oe.TD,oe.TEMPLATE,oe.TEXTAREA,oe.TFOOT,oe.TH,oe.THEAD,oe.TITLE,oe.TR,oe.TRACK,oe.UL,oe.WBR,oe.XMP]),[ie.MATHML]:new Set([oe.MI,oe.MO,oe.MN,oe.MS,oe.MTEXT,oe.ANNOTATION_XML]),[ie.SVG]:new Set([oe.TITLE,oe.FOREIGN_OBJECT,oe.DESC]),[ie.XLINK]:new Set,[ie.XML]:new Set,[ie.XMLNS]:new Set},Oa=new Set([oe.H1,oe.H2,oe.H3,oe.H4,oe.H5,oe.H6]);Y.STYLE,Y.SCRIPT,Y.XMP,Y.IFRAME,Y.NOEMBED,Y.NOFRAMES,Y.PLAINTEXT;var _;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(_||(_={}));const $e={DATA:_.DATA,RCDATA:_.RCDATA,RAWTEXT:_.RAWTEXT,SCRIPT_DATA:_.SCRIPT_DATA,PLAINTEXT:_.PLAINTEXT,CDATA_SECTION:_.CDATA_SECTION};function v0(e){return e>=C.DIGIT_0&&e<=C.DIGIT_9}function Dn(e){return e>=C.LATIN_CAPITAL_A&&e<=C.LATIN_CAPITAL_Z}function w0(e){return e>=C.LATIN_SMALL_A&&e<=C.LATIN_SMALL_Z}function Pt(e){return w0(e)||Dn(e)}function Mo(e){return Pt(e)||v0(e)}function gr(e){return e+32}function Ro(e){return e===C.SPACE||e===C.LINE_FEED||e===C.TABULATION||e===C.FORM_FEED}function Bo(e){return Ro(e)||e===C.SOLIDUS||e===C.GREATER_THAN_SIGN}function L0(e){return e===C.NULL?Z.nullCharacterReference:e>1114111?Z.characterReferenceOutsideUnicodeRange:Lo(e)?Z.surrogateCharacterReference:Do(e)?Z.noncharacterCharacterReference:Oo(e)||e===C.CARRIAGE_RETURN?Z.controlCharacterReference:null}class O0{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=_.DATA,this.returnState=_.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new E0(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new _0(b0,(r,a)=>{this.preprocessor.pos=this.entityStartPos+a-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Z.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(Z.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const a=L0(r);a&&this._err(a,1)}}:void 0)}_err(t,n=0){var r,a;(a=(r=this.handler).onParseError)===null||a===void 0||a.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Ae.START_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Ae.END_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Ae.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Ae.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(Po(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const a=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);a[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Z.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=sn(t.tagName),t.type===Ae.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(Z.endTagWithAttributes),t.selfClosing&&this._err(Z.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Ae.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Ae.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Ae.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Ae.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=Ro(t)?Ae.WHITESPACE_CHARACTER:t===C.NULL?Ae.NULL_CHARACTER:Ae.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Ae.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=_.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?At.Attribute:At.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===_.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===_.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===_.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case _.DATA:{this._stateData(t);break}case _.RCDATA:{this._stateRcdata(t);break}case _.RAWTEXT:{this._stateRawtext(t);break}case _.SCRIPT_DATA:{this._stateScriptData(t);break}case _.PLAINTEXT:{this._statePlaintext(t);break}case _.TAG_OPEN:{this._stateTagOpen(t);break}case _.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case _.TAG_NAME:{this._stateTagName(t);break}case _.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case _.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case _.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case _.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case _.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case _.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case _.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case _.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case _.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case _.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case _.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case _.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case _.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case _.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case _.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case _.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case _.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case _.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case _.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case _.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case _.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case _.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case _.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case _.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case _.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case _.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case _.BOGUS_COMMENT:{this._stateBogusComment(t);break}case _.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case _.COMMENT_START:{this._stateCommentStart(t);break}case _.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case _.COMMENT:{this._stateComment(t);break}case _.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case _.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case _.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case _.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case _.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case _.COMMENT_END:{this._stateCommentEnd(t);break}case _.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case _.DOCTYPE:{this._stateDoctype(t);break}case _.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case _.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case _.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case _.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case _.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case _.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case _.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case _.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case _.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case _.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case _.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case _.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case _.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case _.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case _.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case _.CDATA_SECTION:{this._stateCdataSection(t);break}case _.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case _.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case _.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case _.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case C.LESS_THAN_SIGN:{this.state=_.TAG_OPEN;break}case C.AMPERSAND:{this._startCharacterReference();break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this._emitCodePoint(t);break}case C.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case C.AMPERSAND:{this._startCharacterReference();break}case C.LESS_THAN_SIGN:{this.state=_.RCDATA_LESS_THAN_SIGN;break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this._emitChars(Be);break}case C.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case C.LESS_THAN_SIGN:{this.state=_.RAWTEXT_LESS_THAN_SIGN;break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this._emitChars(Be);break}case C.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_LESS_THAN_SIGN;break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this._emitChars(Be);break}case C.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case C.NULL:{this._err(Z.unexpectedNullCharacter),this._emitChars(Be);break}case C.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Pt(t))this._createStartTagToken(),this.state=_.TAG_NAME,this._stateTagName(t);else switch(t){case C.EXCLAMATION_MARK:{this.state=_.MARKUP_DECLARATION_OPEN;break}case C.SOLIDUS:{this.state=_.END_TAG_OPEN;break}case C.QUESTION_MARK:{this._err(Z.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=_.BOGUS_COMMENT,this._stateBogusComment(t);break}case C.EOF:{this._err(Z.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Z.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=_.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Pt(t))this._createEndTagToken(),this.state=_.TAG_NAME,this._stateTagName(t);else switch(t){case C.GREATER_THAN_SIGN:{this._err(Z.missingEndTagName),this.state=_.DATA;break}case C.EOF:{this._err(Z.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Z.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=_.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this.state=_.BEFORE_ATTRIBUTE_NAME;break}case C.SOLIDUS:{this.state=_.SELF_CLOSING_START_TAG;break}case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentTagToken();break}case C.NULL:{this._err(Z.unexpectedNullCharacter),n.tagName+=Be;break}case C.EOF:{this._err(Z.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Dn(t)?gr(t):t)}}_stateRcdataLessThanSign(t){t===C.SOLIDUS?this.state=_.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=_.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Pt(t)?(this.state=_.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=_.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=_.BEFORE_ATTRIBUTE_NAME,!1;case C.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=_.SELF_CLOSING_START_TAG,!1;case C.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=_.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===C.SOLIDUS?this.state=_.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=_.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Pt(t)?(this.state=_.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=_.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case C.SOLIDUS:{this.state=_.SCRIPT_DATA_END_TAG_OPEN;break}case C.EXCLAMATION_MARK:{this.state=_.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=_.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Pt(t)?(this.state=_.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===C.HYPHEN_MINUS?(this.state=_.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===C.HYPHEN_MINUS?(this.state=_.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case C.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this._emitChars(Be);break}case C.EOF:{this._err(Z.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case C.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_ESCAPED,this._emitChars(Be);break}case C.EOF:{this._err(Z.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case C.HYPHEN_MINUS:{this._emitChars("-");break}case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case C.GREATER_THAN_SIGN:{this.state=_.SCRIPT_DATA,this._emitChars(">");break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_ESCAPED,this._emitChars(Be);break}case C.EOF:{this._err(Z.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===C.SOLIDUS?this.state=_.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Pt(t)?(this._emitChars("<"),this.state=_.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Pt(t)?(this.state=_.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(nt.SCRIPT,!1)&&Bo(this.preprocessor.peek(nt.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<nt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case C.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this._emitChars(Be);break}case C.EOF:{this._err(Z.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case C.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Be);break}case C.EOF:{this._err(Z.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case C.HYPHEN_MINUS:{this._emitChars("-");break}case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case C.GREATER_THAN_SIGN:{this.state=_.SCRIPT_DATA,this._emitChars(">");break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Be);break}case C.EOF:{this._err(Z.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===C.SOLIDUS?(this.state=_.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(nt.SCRIPT,!1)&&Bo(this.preprocessor.peek(nt.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<nt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=_.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.SOLIDUS:case C.GREATER_THAN_SIGN:case C.EOF:{this.state=_.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case C.EQUALS_SIGN:{this._err(Z.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=_.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=_.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:case C.SOLIDUS:case C.GREATER_THAN_SIGN:case C.EOF:{this._leaveAttrName(),this.state=_.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case C.EQUALS_SIGN:{this._leaveAttrName(),this.state=_.BEFORE_ATTRIBUTE_VALUE;break}case C.QUOTATION_MARK:case C.APOSTROPHE:case C.LESS_THAN_SIGN:{this._err(Z.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this.currentAttr.name+=Be;break}default:this.currentAttr.name+=String.fromCodePoint(Dn(t)?gr(t):t)}}_stateAfterAttributeName(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.SOLIDUS:{this.state=_.SELF_CLOSING_START_TAG;break}case C.EQUALS_SIGN:{this.state=_.BEFORE_ATTRIBUTE_VALUE;break}case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentTagToken();break}case C.EOF:{this._err(Z.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=_.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.QUOTATION_MARK:{this.state=_.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case C.APOSTROPHE:{this.state=_.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case C.GREATER_THAN_SIGN:{this._err(Z.missingAttributeValue),this.state=_.DATA,this.emitCurrentTagToken();break}default:this.state=_.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case C.QUOTATION_MARK:{this.state=_.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case C.AMPERSAND:{this._startCharacterReference();break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this.currentAttr.value+=Be;break}case C.EOF:{this._err(Z.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case C.APOSTROPHE:{this.state=_.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case C.AMPERSAND:{this._startCharacterReference();break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this.currentAttr.value+=Be;break}case C.EOF:{this._err(Z.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this._leaveAttrValue(),this.state=_.BEFORE_ATTRIBUTE_NAME;break}case C.AMPERSAND:{this._startCharacterReference();break}case C.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=_.DATA,this.emitCurrentTagToken();break}case C.NULL:{this._err(Z.unexpectedNullCharacter),this.currentAttr.value+=Be;break}case C.QUOTATION_MARK:case C.APOSTROPHE:case C.LESS_THAN_SIGN:case C.EQUALS_SIGN:case C.GRAVE_ACCENT:{this._err(Z.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case C.EOF:{this._err(Z.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this._leaveAttrValue(),this.state=_.BEFORE_ATTRIBUTE_NAME;break}case C.SOLIDUS:{this._leaveAttrValue(),this.state=_.SELF_CLOSING_START_TAG;break}case C.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=_.DATA,this.emitCurrentTagToken();break}case C.EOF:{this._err(Z.eofInTag),this._emitEOFToken();break}default:this._err(Z.missingWhitespaceBetweenAttributes),this.state=_.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case C.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=_.DATA,this.emitCurrentTagToken();break}case C.EOF:{this._err(Z.eofInTag),this._emitEOFToken();break}default:this._err(Z.unexpectedSolidusInTag),this.state=_.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentComment(n);break}case C.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case C.NULL:{this._err(Z.unexpectedNullCharacter),n.data+=Be;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(nt.DASH_DASH,!0)?(this._createCommentToken(nt.DASH_DASH.length+1),this.state=_.COMMENT_START):this._consumeSequenceIfMatch(nt.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(nt.DOCTYPE.length+1),this.state=_.DOCTYPE):this._consumeSequenceIfMatch(nt.CDATA_START,!0)?this.inForeignNode?this.state=_.CDATA_SECTION:(this._err(Z.cdataInHtmlContent),this._createCommentToken(nt.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=_.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Z.incorrectlyOpenedComment),this._createCommentToken(2),this.state=_.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case C.HYPHEN_MINUS:{this.state=_.COMMENT_START_DASH;break}case C.GREATER_THAN_SIGN:{this._err(Z.abruptClosingOfEmptyComment),this.state=_.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=_.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case C.HYPHEN_MINUS:{this.state=_.COMMENT_END;break}case C.GREATER_THAN_SIGN:{this._err(Z.abruptClosingOfEmptyComment),this.state=_.DATA,this.emitCurrentComment(n);break}case C.EOF:{this._err(Z.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=_.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case C.HYPHEN_MINUS:{this.state=_.COMMENT_END_DASH;break}case C.LESS_THAN_SIGN:{n.data+="<",this.state=_.COMMENT_LESS_THAN_SIGN;break}case C.NULL:{this._err(Z.unexpectedNullCharacter),n.data+=Be;break}case C.EOF:{this._err(Z.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case C.EXCLAMATION_MARK:{n.data+="!",this.state=_.COMMENT_LESS_THAN_SIGN_BANG;break}case C.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=_.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===C.HYPHEN_MINUS?this.state=_.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=_.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===C.HYPHEN_MINUS?this.state=_.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=_.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==C.GREATER_THAN_SIGN&&t!==C.EOF&&this._err(Z.nestedComment),this.state=_.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case C.HYPHEN_MINUS:{this.state=_.COMMENT_END;break}case C.EOF:{this._err(Z.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=_.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentComment(n);break}case C.EXCLAMATION_MARK:{this.state=_.COMMENT_END_BANG;break}case C.HYPHEN_MINUS:{n.data+="-";break}case C.EOF:{this._err(Z.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=_.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case C.HYPHEN_MINUS:{n.data+="--!",this.state=_.COMMENT_END_DASH;break}case C.GREATER_THAN_SIGN:{this._err(Z.incorrectlyClosedComment),this.state=_.DATA,this.emitCurrentComment(n);break}case C.EOF:{this._err(Z.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=_.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this.state=_.BEFORE_DOCTYPE_NAME;break}case C.GREATER_THAN_SIGN:{this.state=_.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case C.EOF:{this._err(Z.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Z.missingWhitespaceBeforeDoctypeName),this.state=_.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Dn(t))this._createDoctypeToken(String.fromCharCode(gr(t))),this.state=_.DOCTYPE_NAME;else switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.NULL:{this._err(Z.unexpectedNullCharacter),this._createDoctypeToken(Be),this.state=_.DOCTYPE_NAME;break}case C.GREATER_THAN_SIGN:{this._err(Z.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.EOF:{this._err(Z.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=_.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this.state=_.AFTER_DOCTYPE_NAME;break}case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.NULL:{this._err(Z.unexpectedNullCharacter),n.name+=Be;break}case C.EOF:{this._err(Z.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Dn(t)?gr(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.EOF:{this._err(Z.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(nt.PUBLIC,!1)?this.state=_.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(nt.SYSTEM,!1)?this.state=_.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Z.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this.state=_.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case C.QUOTATION_MARK:{this._err(Z.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case C.APOSTROPHE:{this._err(Z.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case C.GREATER_THAN_SIGN:{this._err(Z.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.EOF:{this._err(Z.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Z.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.QUOTATION_MARK:{n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case C.APOSTROPHE:{n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case C.GREATER_THAN_SIGN:{this._err(Z.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.EOF:{this._err(Z.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Z.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case C.QUOTATION_MARK:{this.state=_.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case C.NULL:{this._err(Z.unexpectedNullCharacter),n.publicId+=Be;break}case C.GREATER_THAN_SIGN:{this._err(Z.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.EOF:{this._err(Z.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case C.APOSTROPHE:{this.state=_.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case C.NULL:{this._err(Z.unexpectedNullCharacter),n.publicId+=Be;break}case C.GREATER_THAN_SIGN:{this._err(Z.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.EOF:{this._err(Z.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this.state=_.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.QUOTATION_MARK:{this._err(Z.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case C.APOSTROPHE:{this._err(Z.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case C.EOF:{this._err(Z.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Z.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.QUOTATION_MARK:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case C.APOSTROPHE:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case C.EOF:{this._err(Z.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Z.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this.state=_.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case C.QUOTATION_MARK:{this._err(Z.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case C.APOSTROPHE:{this._err(Z.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case C.GREATER_THAN_SIGN:{this._err(Z.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.EOF:{this._err(Z.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Z.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.QUOTATION_MARK:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case C.APOSTROPHE:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case C.GREATER_THAN_SIGN:{this._err(Z.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.EOF:{this._err(Z.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Z.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case C.QUOTATION_MARK:{this.state=_.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case C.NULL:{this._err(Z.unexpectedNullCharacter),n.systemId+=Be;break}case C.GREATER_THAN_SIGN:{this._err(Z.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.EOF:{this._err(Z.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case C.APOSTROPHE:{this.state=_.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case C.NULL:{this._err(Z.unexpectedNullCharacter),n.systemId+=Be;break}case C.GREATER_THAN_SIGN:{this._err(Z.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.EOF:{this._err(Z.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.EOF:{this._err(Z.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Z.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case C.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.NULL:{this._err(Z.unexpectedNullCharacter);break}case C.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case C.RIGHT_SQUARE_BRACKET:{this.state=_.CDATA_SECTION_BRACKET;break}case C.EOF:{this._err(Z.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===C.RIGHT_SQUARE_BRACKET?this.state=_.CDATA_SECTION_END:(this._emitChars("]"),this.state=_.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case C.GREATER_THAN_SIGN:{this.state=_.DATA;break}case C.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=_.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(C.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Mo(this.preprocessor.peek(1))?_.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Mo(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===C.SEMICOLON&&this._err(Z.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Fo=new Set([l.DD,l.DT,l.LI,l.OPTGROUP,l.OPTION,l.P,l.RB,l.RP,l.RT,l.RTC]),Ho=new Set([...Fo,l.CAPTION,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]),Er=new Set([l.APPLET,l.CAPTION,l.HTML,l.MARQUEE,l.OBJECT,l.TABLE,l.TD,l.TEMPLATE,l.TH]),D0=new Set([...Er,l.OL,l.UL]),P0=new Set([...Er,l.BUTTON]),Uo=new Set([l.ANNOTATION_XML,l.MI,l.MN,l.MO,l.MS,l.MTEXT]),$o=new Set([l.DESC,l.FOREIGN_OBJECT,l.TITLE]),M0=new Set([l.TR,l.TEMPLATE,l.HTML]),R0=new Set([l.TBODY,l.TFOOT,l.THEAD,l.TEMPLATE,l.HTML]),B0=new Set([l.TABLE,l.TEMPLATE,l.HTML]),F0=new Set([l.TD,l.TH]);class H0{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=l.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===l.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ie.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const a=this._indexOf(t)+1;this.items.splice(a,0,n),this.tagIDs.splice(a,0,r),this.stackTop++,a===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,a===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==ie.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Oa,ie.HTML)}popUntilTableCellPopped(){this.popUntilPopped(F0,ie.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(B0,ie.HTML)}clearBackToTableBodyContext(){this.clearBackTo(R0,ie.HTML)}clearBackToTableRowContext(){this.clearBackTo(M0,ie.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===l.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===l.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const a=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ie.HTML:{if(a===t)return!0;if(n.has(a))return!1;break}case ie.SVG:{if($o.has(a))return!1;break}case ie.MATHML:{if(Uo.has(a))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Er)}hasInListItemScope(t){return this.hasInDynamicScope(t,D0)}hasInButtonScope(t){return this.hasInDynamicScope(t,P0)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ie.HTML:{if(Oa.has(n))return!0;if(Er.has(n))return!1;break}case ie.SVG:{if($o.has(n))return!1;break}case ie.MATHML:{if(Uo.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ie.HTML)switch(this.tagIDs[n]){case t:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ie.HTML)switch(this.tagIDs[t]){case l.TBODY:case l.THEAD:case l.TFOOT:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ie.HTML)switch(this.tagIDs[n]){case t:return!0;case l.OPTION:case l.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Fo.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Ho.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Ho.has(this.currentTagId);)this.pop()}}const Da=3;var yt;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(yt||(yt={}));const qo={type:yt.Marker};class U0{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],a=n.length,i=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let u=0;u<this.entries.length;u++){const o=this.entries[u];if(o.type===yt.Marker)break;const{element:d}=o;if(this.treeAdapter.getTagName(d)===i&&this.treeAdapter.getNamespaceURI(d)===s){const f=this.treeAdapter.getAttrList(d);f.length===a&&r.push({idx:u,attrs:f})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Da)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Da)return;const a=new Map(n.map(s=>[s.name,s.value]));let i=0;for(let s=0;s<r.length;s++){const u=r[s];u.attrs.every(o=>a.get(o.name)===o.value)&&(i+=1,i>=Da&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(qo)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:yt.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:yt.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(qo);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===yt.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===yt.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===yt.Element&&n.element===t)}}const Mt={createDocument(){return{nodeName:"#document",mode:dt.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const a=e.childNodes.find(i=>i.nodeName==="#documentType");if(a)a.name=t,a.publicId=n,a.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Mt.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Mt.isTextNode(n)){n.value+=t;return}}Mt.appendChild(e,Mt.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Mt.isTextNode(r)?r.value+=t:Mt.insertBefore(e,Mt.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},zo="html",$0="about:legacy-compat",q0="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Vo=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],z0=[...Vo,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],V0=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Yo=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Y0=[...Yo,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Go(e,t){return t.some(n=>e.startsWith(n))}function G0(e){return e.name===zo&&e.publicId===null&&(e.systemId===null||e.systemId===$0)}function W0(e){if(e.name!==zo)return dt.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===q0)return dt.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),V0.has(n))return dt.QUIRKS;let r=t===null?z0:Vo;if(Go(n,r))return dt.QUIRKS;if(r=t===null?Yo:Y0,Go(n,r))return dt.LIMITED_QUIRKS}return dt.NO_QUIRKS}const Wo={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},j0="definitionurl",X0="definitionURL",K0=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),Q0=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ie.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ie.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ie.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ie.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ie.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ie.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ie.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ie.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ie.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ie.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ie.XMLNS}]]),J0=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),Z0=new Set([l.B,l.BIG,l.BLOCKQUOTE,l.BODY,l.BR,l.CENTER,l.CODE,l.DD,l.DIV,l.DL,l.DT,l.EM,l.EMBED,l.H1,l.H2,l.H3,l.H4,l.H5,l.H6,l.HEAD,l.HR,l.I,l.IMG,l.LI,l.LISTING,l.MENU,l.META,l.NOBR,l.OL,l.P,l.PRE,l.RUBY,l.S,l.SMALL,l.SPAN,l.STRONG,l.STRIKE,l.SUB,l.SUP,l.TABLE,l.TT,l.U,l.UL,l.VAR]);function em(e){const t=e.tagID;return t===l.FONT&&e.attrs.some(({name:r})=>r===zt.COLOR||r===zt.SIZE||r===zt.FACE)||Z0.has(t)}function jo(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===j0){e.attrs[t].name=X0;break}}function Xo(e){for(let t=0;t<e.attrs.length;t++){const n=K0.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Pa(e){for(let t=0;t<e.attrs.length;t++){const n=Q0.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function tm(e){const t=J0.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=sn(e.tagName))}function nm(e,t){return t===ie.MATHML&&(e===l.MI||e===l.MO||e===l.MN||e===l.MS||e===l.MTEXT)}function rm(e,t,n){if(t===ie.MATHML&&e===l.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===zt.ENCODING){const a=n[r].value.toLowerCase();return a===Wo.TEXT_HTML||a===Wo.APPLICATION_XML}}return t===ie.SVG&&(e===l.FOREIGN_OBJECT||e===l.DESC||e===l.TITLE)}function am(e,t,n,r){return(!r||r===ie.HTML)&&rm(e,t,n)||(!r||r===ie.MATHML)&&nm(e,t)}const im="hidden",sm=8,om=3;var v;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(v||(v={}));const um={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Ko=new Set([l.TABLE,l.TBODY,l.TFOOT,l.THEAD,l.TR]),Qo={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Mt,onParseError:null};class Jo{constructor(t,n,r=null,a=null){this.fragmentContext=r,this.scriptHandler=a,this.currentToken=null,this.stopped=!1,this.insertionMode=v.INITIAL,this.originalInsertionMode=v.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Qo,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new O0(this.options,this),this.activeFormattingElements=new U0(this.treeAdapter),this.fragmentContextID=r?sn(this.treeAdapter.getTagName(r)):l.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new H0(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...Qo,...n};t??(t=r.treeAdapter.createElement(Y.TEMPLATE,ie.HTML,[]));const a=r.treeAdapter.createElement("documentmock",ie.HTML,[]),i=new this(r,a,t);return i.fragmentContextID===l.TEMPLATE&&i.tmplInsertionModeStack.unshift(v.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var a;if(!this.onParseError)return;const i=(a=t.location)!==null&&a!==void 0?a:um,s={code:n,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:r?i.startLine:i.endLine,endCol:r?i.startCol:i.endCol,endOffset:r?i.startOffset:i.endOffset};this.onParseError(s)}onItemPush(t,n,r){var a,i;(i=(a=this.treeAdapter).onItemPush)===null||i===void 0||i.call(a,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,a;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(a=(r=this.treeAdapter).onItemPop)===null||a===void 0||a.call(r,t,this.openElements.current),n){let i,s;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,s=this.fragmentContextID):{current:i,currentTagId:s}=this.openElements,this._setContextModes(i,s)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ie.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ie.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=v.TEXT}switchToPlaintextParsing(){this.insertionMode=v.TEXT,this.originalInsertionMode=v.IN_BODY,this.tokenizer.state=$e.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Y.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ie.HTML))switch(this.fragmentContextID){case l.TITLE:case l.TEXTAREA:{this.tokenizer.state=$e.RCDATA;break}case l.STYLE:case l.XMP:case l.IFRAME:case l.NOEMBED:case l.NOFRAMES:case l.NOSCRIPT:{this.tokenizer.state=$e.RAWTEXT;break}case l.SCRIPT:{this.tokenizer.state=$e.SCRIPT_DATA;break}case l.PLAINTEXT:{this.tokenizer.state=$e.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",a=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,a),t.location){const s=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));s&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,ie.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ie.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Y.HTML,ie.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,l.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const a=this.treeAdapter.getChildNodes(n),i=r?a.lastIndexOf(r):a.length,s=a[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:o,endCol:d,endOffset:f}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:o,endCol:d,endOffset:f})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,a=this.treeAdapter.getTagName(t),i=n.type===Ae.END_TAG&&a===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,i)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===l.SVG&&this.treeAdapter.getTagName(n)===Y.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ie.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===l.MGLYPH||t.tagID===l.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ie.HTML)}_processToken(t){switch(t.type){case Ae.CHARACTER:{this.onCharacter(t);break}case Ae.NULL_CHARACTER:{this.onNullCharacter(t);break}case Ae.COMMENT:{this.onComment(t);break}case Ae.DOCTYPE:{this.onDoctype(t);break}case Ae.START_TAG:{this._processStartTag(t);break}case Ae.END_TAG:{this.onEndTag(t);break}case Ae.EOF:{this.onEof(t);break}case Ae.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const a=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return am(t,a,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(a=>a.type===yt.Marker||this.openElements.contains(a.element)),r=n===-1?t-1:n-1;for(let a=r;a>=0;a--){const i=this.activeFormattingElements.entries[a];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=v.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(l.P),this.openElements.popUntilTagNamePopped(l.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case l.TR:{this.insertionMode=v.IN_ROW;return}case l.TBODY:case l.THEAD:case l.TFOOT:{this.insertionMode=v.IN_TABLE_BODY;return}case l.CAPTION:{this.insertionMode=v.IN_CAPTION;return}case l.COLGROUP:{this.insertionMode=v.IN_COLUMN_GROUP;return}case l.TABLE:{this.insertionMode=v.IN_TABLE;return}case l.BODY:{this.insertionMode=v.IN_BODY;return}case l.FRAMESET:{this.insertionMode=v.IN_FRAMESET;return}case l.SELECT:{this._resetInsertionModeForSelect(t);return}case l.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case l.HTML:{this.insertionMode=this.headElement?v.AFTER_HEAD:v.BEFORE_HEAD;return}case l.TD:case l.TH:{if(t>0){this.insertionMode=v.IN_CELL;return}break}case l.HEAD:{if(t>0){this.insertionMode=v.IN_HEAD;return}break}}this.insertionMode=v.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===l.TEMPLATE)break;if(r===l.TABLE){this.insertionMode=v.IN_SELECT_IN_TABLE;return}}this.insertionMode=v.IN_SELECT}_isElementCausesFosterParenting(t){return Ko.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case l.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ie.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case l.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return k0[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Fg(this,t);return}switch(this.insertionMode){case v.INITIAL:{Pn(this,t);break}case v.BEFORE_HTML:{Mn(this,t);break}case v.BEFORE_HEAD:{Rn(this,t);break}case v.IN_HEAD:{Bn(this,t);break}case v.IN_HEAD_NO_SCRIPT:{Fn(this,t);break}case v.AFTER_HEAD:{Hn(this,t);break}case v.IN_BODY:case v.IN_CAPTION:case v.IN_CELL:case v.IN_TEMPLATE:{eu(this,t);break}case v.TEXT:case v.IN_SELECT:case v.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case v.IN_TABLE:case v.IN_TABLE_BODY:case v.IN_ROW:{Fa(this,t);break}case v.IN_TABLE_TEXT:{uu(this,t);break}case v.IN_COLUMN_GROUP:{yr(this,t);break}case v.AFTER_BODY:{Cr(this,t);break}case v.AFTER_AFTER_BODY:{Sr(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Bg(this,t);return}switch(this.insertionMode){case v.INITIAL:{Pn(this,t);break}case v.BEFORE_HTML:{Mn(this,t);break}case v.BEFORE_HEAD:{Rn(this,t);break}case v.IN_HEAD:{Bn(this,t);break}case v.IN_HEAD_NO_SCRIPT:{Fn(this,t);break}case v.AFTER_HEAD:{Hn(this,t);break}case v.TEXT:{this._insertCharacters(t);break}case v.IN_TABLE:case v.IN_TABLE_BODY:case v.IN_ROW:{Fa(this,t);break}case v.IN_COLUMN_GROUP:{yr(this,t);break}case v.AFTER_BODY:{Cr(this,t);break}case v.AFTER_AFTER_BODY:{Sr(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Ra(this,t);return}switch(this.insertionMode){case v.INITIAL:case v.BEFORE_HTML:case v.BEFORE_HEAD:case v.IN_HEAD:case v.IN_HEAD_NO_SCRIPT:case v.AFTER_HEAD:case v.IN_BODY:case v.IN_TABLE:case v.IN_CAPTION:case v.IN_COLUMN_GROUP:case v.IN_TABLE_BODY:case v.IN_ROW:case v.IN_CELL:case v.IN_SELECT:case v.IN_SELECT_IN_TABLE:case v.IN_TEMPLATE:case v.IN_FRAMESET:case v.AFTER_FRAMESET:{Ra(this,t);break}case v.IN_TABLE_TEXT:{qn(this,t);break}case v.AFTER_BODY:{mm(this,t);break}case v.AFTER_AFTER_BODY:case v.AFTER_AFTER_FRAMESET:{gm(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case v.INITIAL:{Em(this,t);break}case v.BEFORE_HEAD:case v.IN_HEAD:case v.IN_HEAD_NO_SCRIPT:case v.AFTER_HEAD:{this._err(t,Z.misplacedDoctype);break}case v.IN_TABLE_TEXT:{qn(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,Z.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Hg(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case v.INITIAL:{Pn(this,t);break}case v.BEFORE_HTML:{bm(this,t);break}case v.BEFORE_HEAD:{ym(this,t);break}case v.IN_HEAD:{pt(this,t);break}case v.IN_HEAD_NO_SCRIPT:{Cm(this,t);break}case v.AFTER_HEAD:{_m(this,t);break}case v.IN_BODY:{Ke(this,t);break}case v.IN_TABLE:{on(this,t);break}case v.IN_TABLE_TEXT:{qn(this,t);break}case v.IN_CAPTION:{xg(this,t);break}case v.IN_COLUMN_GROUP:{Ha(this,t);break}case v.IN_TABLE_BODY:{xr(this,t);break}case v.IN_ROW:{Ar(this,t);break}case v.IN_CELL:{Sg(this,t);break}case v.IN_SELECT:{du(this,t);break}case v.IN_SELECT_IN_TABLE:{Ig(this,t);break}case v.IN_TEMPLATE:{kg(this,t);break}case v.AFTER_BODY:{wg(this,t);break}case v.IN_FRAMESET:{Lg(this,t);break}case v.AFTER_FRAMESET:{Dg(this,t);break}case v.AFTER_AFTER_BODY:{Mg(this,t);break}case v.AFTER_AFTER_FRAMESET:{Rg(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Ug(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case v.INITIAL:{Pn(this,t);break}case v.BEFORE_HTML:{Tm(this,t);break}case v.BEFORE_HEAD:{xm(this,t);break}case v.IN_HEAD:{Am(this,t);break}case v.IN_HEAD_NO_SCRIPT:{Sm(this,t);break}case v.AFTER_HEAD:{Im(this,t);break}case v.IN_BODY:{Tr(this,t);break}case v.TEXT:{dg(this,t);break}case v.IN_TABLE:{Un(this,t);break}case v.IN_TABLE_TEXT:{qn(this,t);break}case v.IN_CAPTION:{Ag(this,t);break}case v.IN_COLUMN_GROUP:{Cg(this,t);break}case v.IN_TABLE_BODY:{Ua(this,t);break}case v.IN_ROW:{cu(this,t);break}case v.IN_CELL:{_g(this,t);break}case v.IN_SELECT:{fu(this,t);break}case v.IN_SELECT_IN_TABLE:{Ng(this,t);break}case v.IN_TEMPLATE:{vg(this,t);break}case v.AFTER_BODY:{hu(this,t);break}case v.IN_FRAMESET:{Og(this,t);break}case v.AFTER_FRAMESET:{Pg(this,t);break}case v.AFTER_AFTER_BODY:{Sr(this,t);break}}}onEof(t){switch(this.insertionMode){case v.INITIAL:{Pn(this,t);break}case v.BEFORE_HTML:{Mn(this,t);break}case v.BEFORE_HEAD:{Rn(this,t);break}case v.IN_HEAD:{Bn(this,t);break}case v.IN_HEAD_NO_SCRIPT:{Fn(this,t);break}case v.AFTER_HEAD:{Hn(this,t);break}case v.IN_BODY:case v.IN_TABLE:case v.IN_CAPTION:case v.IN_COLUMN_GROUP:case v.IN_TABLE_BODY:case v.IN_ROW:case v.IN_CELL:case v.IN_SELECT:case v.IN_SELECT_IN_TABLE:{su(this,t);break}case v.TEXT:{fg(this,t);break}case v.IN_TABLE_TEXT:{qn(this,t);break}case v.IN_TEMPLATE:{pu(this,t);break}case v.AFTER_BODY:case v.IN_FRAMESET:case v.AFTER_FRAMESET:case v.AFTER_AFTER_BODY:case v.AFTER_AFTER_FRAMESET:{Ba(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===C.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case v.IN_HEAD:case v.IN_HEAD_NO_SCRIPT:case v.AFTER_HEAD:case v.TEXT:case v.IN_COLUMN_GROUP:case v.IN_SELECT:case v.IN_SELECT_IN_TABLE:case v.IN_FRAMESET:case v.AFTER_FRAMESET:{this._insertCharacters(t);break}case v.IN_BODY:case v.IN_CAPTION:case v.IN_CELL:case v.IN_TEMPLATE:case v.AFTER_BODY:case v.AFTER_AFTER_BODY:case v.AFTER_AFTER_FRAMESET:{Zo(this,t);break}case v.IN_TABLE:case v.IN_TABLE_BODY:case v.IN_ROW:{Fa(this,t);break}case v.IN_TABLE_TEXT:{ou(this,t);break}}}}function lm(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):iu(e,t),n}function cm(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const a=e.openElements.items[r];if(a===t.element)break;e._isSpecialElement(a,e.openElements.tagIDs[r])&&(n=a)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function dm(e,t,n){let r=t,a=e.openElements.getCommonAncestor(t);for(let i=0,s=a;s!==n;i++,s=a){a=e.openElements.getCommonAncestor(s);const u=e.activeFormattingElements.getElementEntry(s),o=u&&i>=om;!u||o?(o&&e.activeFormattingElements.removeEntry(u),e.openElements.remove(s)):(s=fm(e,u),r===t&&(e.activeFormattingElements.bookmark=u),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function fm(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function pm(e,t,n){const r=e.treeAdapter.getTagName(t),a=sn(r);if(e._isElementCausesFosterParenting(a))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);a===l.TEMPLATE&&i===ie.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function hm(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:a}=n,i=e.treeAdapter.createElement(a.tagName,r,a.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,a),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,a.tagID)}function Ma(e,t){for(let n=0;n<sm;n++){const r=lm(e,t);if(!r)break;const a=cm(e,r);if(!a)break;e.activeFormattingElements.bookmark=r;const i=dm(e,a,r.element),s=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(i),s&&pm(e,s,i),hm(e,a,r)}}function Ra(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function mm(e,t){e._appendCommentNode(t,e.openElements.items[0])}function gm(e,t){e._appendCommentNode(t,e.document)}function Ba(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],a=e.treeAdapter.getNodeSourceCodeLocation(r);if(a&&!a.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const i=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(i);s&&!s.endTag&&e._setEndLocation(i,t)}}}}function Em(e,t){e._setDocumentType(t);const n=t.forceQuirks?dt.QUIRKS:W0(t);G0(t)||e._err(t,Z.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=v.BEFORE_HTML}function Pn(e,t){e._err(t,Z.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,dt.QUIRKS),e.insertionMode=v.BEFORE_HTML,e._processToken(t)}function bm(e,t){t.tagID===l.HTML?(e._insertElement(t,ie.HTML),e.insertionMode=v.BEFORE_HEAD):Mn(e,t)}function Tm(e,t){const n=t.tagID;(n===l.HTML||n===l.HEAD||n===l.BODY||n===l.BR)&&Mn(e,t)}function Mn(e,t){e._insertFakeRootElement(),e.insertionMode=v.BEFORE_HEAD,e._processToken(t)}function ym(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.HEAD:{e._insertElement(t,ie.HTML),e.headElement=e.openElements.current,e.insertionMode=v.IN_HEAD;break}default:Rn(e,t)}}function xm(e,t){const n=t.tagID;n===l.HEAD||n===l.BODY||n===l.HTML||n===l.BR?Rn(e,t):e._err(t,Z.endTagWithoutMatchingOpenElement)}function Rn(e,t){e._insertFakeElement(Y.HEAD,l.HEAD),e.headElement=e.openElements.current,e.insertionMode=v.IN_HEAD,e._processToken(t)}function pt(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:{e._appendElement(t,ie.HTML),t.ackSelfClosing=!0;break}case l.TITLE:{e._switchToTextParsing(t,$e.RCDATA);break}case l.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,$e.RAWTEXT):(e._insertElement(t,ie.HTML),e.insertionMode=v.IN_HEAD_NO_SCRIPT);break}case l.NOFRAMES:case l.STYLE:{e._switchToTextParsing(t,$e.RAWTEXT);break}case l.SCRIPT:{e._switchToTextParsing(t,$e.SCRIPT_DATA);break}case l.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=v.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(v.IN_TEMPLATE);break}case l.HEAD:{e._err(t,Z.misplacedStartTagForHeadElement);break}default:Bn(e,t)}}function Am(e,t){switch(t.tagID){case l.HEAD:{e.openElements.pop(),e.insertionMode=v.AFTER_HEAD;break}case l.BODY:case l.BR:case l.HTML:{Bn(e,t);break}case l.TEMPLATE:{Vt(e,t);break}default:e._err(t,Z.endTagWithoutMatchingOpenElement)}}function Vt(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==l.TEMPLATE&&e._err(t,Z.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,Z.endTagWithoutMatchingOpenElement)}function Bn(e,t){e.openElements.pop(),e.insertionMode=v.AFTER_HEAD,e._processToken(t)}function Cm(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.BASEFONT:case l.BGSOUND:case l.HEAD:case l.LINK:case l.META:case l.NOFRAMES:case l.STYLE:{pt(e,t);break}case l.NOSCRIPT:{e._err(t,Z.nestedNoscriptInHead);break}default:Fn(e,t)}}function Sm(e,t){switch(t.tagID){case l.NOSCRIPT:{e.openElements.pop(),e.insertionMode=v.IN_HEAD;break}case l.BR:{Fn(e,t);break}default:e._err(t,Z.endTagWithoutMatchingOpenElement)}}function Fn(e,t){const n=t.type===Ae.EOF?Z.openElementsLeftAfterEof:Z.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=v.IN_HEAD,e._processToken(t)}function _m(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.BODY:{e._insertElement(t,ie.HTML),e.framesetOk=!1,e.insertionMode=v.IN_BODY;break}case l.FRAMESET:{e._insertElement(t,ie.HTML),e.insertionMode=v.IN_FRAMESET;break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{e._err(t,Z.abandonedHeadElementChild),e.openElements.push(e.headElement,l.HEAD),pt(e,t),e.openElements.remove(e.headElement);break}case l.HEAD:{e._err(t,Z.misplacedStartTagForHeadElement);break}default:Hn(e,t)}}function Im(e,t){switch(t.tagID){case l.BODY:case l.HTML:case l.BR:{Hn(e,t);break}case l.TEMPLATE:{Vt(e,t);break}default:e._err(t,Z.endTagWithoutMatchingOpenElement)}}function Hn(e,t){e._insertFakeElement(Y.BODY,l.BODY),e.insertionMode=v.IN_BODY,br(e,t)}function br(e,t){switch(t.type){case Ae.CHARACTER:{eu(e,t);break}case Ae.WHITESPACE_CHARACTER:{Zo(e,t);break}case Ae.COMMENT:{Ra(e,t);break}case Ae.START_TAG:{Ke(e,t);break}case Ae.END_TAG:{Tr(e,t);break}case Ae.EOF:{su(e,t);break}}}function Zo(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function eu(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Nm(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function km(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function vm(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ie.HTML),e.insertionMode=v.IN_FRAMESET)}function wm(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,ie.HTML)}function Lm(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Oa.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ie.HTML)}function Om(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,ie.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Dm(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,ie.HTML),n||(e.formElement=e.openElements.current))}function Pm(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const a=e.openElements.tagIDs[r];if(n===l.LI&&a===l.LI||(n===l.DD||n===l.DT)&&(a===l.DD||a===l.DT)){e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.popUntilTagNamePopped(a);break}if(a!==l.ADDRESS&&a!==l.DIV&&a!==l.P&&e._isSpecialElement(e.openElements.items[r],a))break}e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,ie.HTML)}function Mm(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,ie.HTML),e.tokenizer.state=$e.PLAINTEXT}function Rm(e,t){e.openElements.hasInScope(l.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML),e.framesetOk=!1}function Bm(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Y.A);n&&(Ma(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Fm(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Hm(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(l.NOBR)&&(Ma(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ie.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Um(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function $m(e,t){e.treeAdapter.getDocumentMode(e.document)!==dt.QUIRKS&&e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,ie.HTML),e.framesetOk=!1,e.insertionMode=v.IN_TABLE}function tu(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ie.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function nu(e){const t=Po(e,zt.TYPE);return t!=null&&t.toLowerCase()===im}function qm(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ie.HTML),nu(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function zm(e,t){e._appendElement(t,ie.HTML),t.ackSelfClosing=!0}function Vm(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._appendElement(t,ie.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ym(e,t){t.tagName=Y.IMG,t.tagID=l.IMG,tu(e,t)}function Gm(e,t){e._insertElement(t,ie.HTML),e.skipNextNewLine=!0,e.tokenizer.state=$e.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=v.TEXT}function Wm(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,$e.RAWTEXT)}function jm(e,t){e.framesetOk=!1,e._switchToTextParsing(t,$e.RAWTEXT)}function ru(e,t){e._switchToTextParsing(t,$e.RAWTEXT)}function Xm(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===v.IN_TABLE||e.insertionMode===v.IN_CAPTION||e.insertionMode===v.IN_TABLE_BODY||e.insertionMode===v.IN_ROW||e.insertionMode===v.IN_CELL?v.IN_SELECT_IN_TABLE:v.IN_SELECT}function Km(e,t){e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML)}function Qm(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ie.HTML)}function Jm(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(l.RTC),e._insertElement(t,ie.HTML)}function Zm(e,t){e._reconstructActiveFormattingElements(),jo(t),Pa(t),t.selfClosing?e._appendElement(t,ie.MATHML):e._insertElement(t,ie.MATHML),t.ackSelfClosing=!0}function eg(e,t){e._reconstructActiveFormattingElements(),Xo(t),Pa(t),t.selfClosing?e._appendElement(t,ie.SVG):e._insertElement(t,ie.SVG),t.ackSelfClosing=!0}function au(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML)}function Ke(e,t){switch(t.tagID){case l.I:case l.S:case l.B:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.SMALL:case l.STRIKE:case l.STRONG:{Fm(e,t);break}case l.A:{Bm(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{Lm(e,t);break}case l.P:case l.DL:case l.OL:case l.UL:case l.DIV:case l.DIR:case l.NAV:case l.MAIN:case l.MENU:case l.ASIDE:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.DETAILS:case l.ADDRESS:case l.ARTICLE:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{wm(e,t);break}case l.LI:case l.DD:case l.DT:{Pm(e,t);break}case l.BR:case l.IMG:case l.WBR:case l.AREA:case l.EMBED:case l.KEYGEN:{tu(e,t);break}case l.HR:{Vm(e,t);break}case l.RB:case l.RTC:{Qm(e,t);break}case l.RT:case l.RP:{Jm(e,t);break}case l.PRE:case l.LISTING:{Om(e,t);break}case l.XMP:{Wm(e,t);break}case l.SVG:{eg(e,t);break}case l.HTML:{Nm(e,t);break}case l.BASE:case l.LINK:case l.META:case l.STYLE:case l.TITLE:case l.SCRIPT:case l.BGSOUND:case l.BASEFONT:case l.TEMPLATE:{pt(e,t);break}case l.BODY:{km(e,t);break}case l.FORM:{Dm(e,t);break}case l.NOBR:{Hm(e,t);break}case l.MATH:{Zm(e,t);break}case l.TABLE:{$m(e,t);break}case l.INPUT:{qm(e,t);break}case l.PARAM:case l.TRACK:case l.SOURCE:{zm(e,t);break}case l.IMAGE:{Ym(e,t);break}case l.BUTTON:{Rm(e,t);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{Um(e,t);break}case l.IFRAME:{jm(e,t);break}case l.SELECT:{Xm(e,t);break}case l.OPTION:case l.OPTGROUP:{Km(e,t);break}case l.NOEMBED:case l.NOFRAMES:{ru(e,t);break}case l.FRAMESET:{vm(e,t);break}case l.TEXTAREA:{Gm(e,t);break}case l.NOSCRIPT:{e.options.scriptingEnabled?ru(e,t):au(e,t);break}case l.PLAINTEXT:{Mm(e,t);break}case l.COL:case l.TH:case l.TD:case l.TR:case l.HEAD:case l.FRAME:case l.TBODY:case l.TFOOT:case l.THEAD:case l.CAPTION:case l.COLGROUP:break;default:au(e,t)}}function tg(e,t){if(e.openElements.hasInScope(l.BODY)&&(e.insertionMode=v.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function ng(e,t){e.openElements.hasInScope(l.BODY)&&(e.insertionMode=v.AFTER_BODY,hu(e,t))}function rg(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function ag(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(l.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(l.FORM):n&&e.openElements.remove(n))}function ig(e){e.openElements.hasInButtonScope(l.P)||e._insertFakeElement(Y.P,l.P),e._closePElement()}function sg(e){e.openElements.hasInListItemScope(l.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(l.LI),e.openElements.popUntilTagNamePopped(l.LI))}function og(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function ug(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function lg(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function cg(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Y.BR,l.BR),e.openElements.pop(),e.framesetOk=!1}function iu(e,t){const n=t.tagName,r=t.tagID;for(let a=e.openElements.stackTop;a>0;a--){const i=e.openElements.items[a],s=e.openElements.tagIDs[a];if(r===s&&(r!==l.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=a&&e.openElements.shortenToLength(a);break}if(e._isSpecialElement(i,s))break}}function Tr(e,t){switch(t.tagID){case l.A:case l.B:case l.I:case l.S:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.NOBR:case l.SMALL:case l.STRIKE:case l.STRONG:{Ma(e,t);break}case l.P:{ig(e);break}case l.DL:case l.UL:case l.OL:case l.DIR:case l.DIV:case l.NAV:case l.PRE:case l.MAIN:case l.MENU:case l.ASIDE:case l.BUTTON:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.ADDRESS:case l.ARTICLE:case l.DETAILS:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.LISTING:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{rg(e,t);break}case l.LI:{sg(e);break}case l.DD:case l.DT:{og(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{ug(e);break}case l.BR:{cg(e);break}case l.BODY:{tg(e,t);break}case l.HTML:{ng(e,t);break}case l.FORM:{ag(e);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{lg(e,t);break}case l.TEMPLATE:{Vt(e,t);break}default:iu(e,t)}}function su(e,t){e.tmplInsertionModeStack.length>0?pu(e,t):Ba(e,t)}function dg(e,t){var n;t.tagID===l.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function fg(e,t){e._err(t,Z.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Fa(e,t){if(e.openElements.currentTagId!==void 0&&Ko.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=v.IN_TABLE_TEXT,t.type){case Ae.CHARACTER:{uu(e,t);break}case Ae.WHITESPACE_CHARACTER:{ou(e,t);break}}else $n(e,t)}function pg(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ie.HTML),e.insertionMode=v.IN_CAPTION}function hg(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ie.HTML),e.insertionMode=v.IN_COLUMN_GROUP}function mg(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.COLGROUP,l.COLGROUP),e.insertionMode=v.IN_COLUMN_GROUP,Ha(e,t)}function gg(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ie.HTML),e.insertionMode=v.IN_TABLE_BODY}function Eg(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.TBODY,l.TBODY),e.insertionMode=v.IN_TABLE_BODY,xr(e,t)}function bg(e,t){e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Tg(e,t){nu(t)?e._appendElement(t,ie.HTML):$n(e,t),t.ackSelfClosing=!0}function yg(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ie.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function on(e,t){switch(t.tagID){case l.TD:case l.TH:case l.TR:{Eg(e,t);break}case l.STYLE:case l.SCRIPT:case l.TEMPLATE:{pt(e,t);break}case l.COL:{mg(e,t);break}case l.FORM:{yg(e,t);break}case l.TABLE:{bg(e,t);break}case l.TBODY:case l.TFOOT:case l.THEAD:{gg(e,t);break}case l.INPUT:{Tg(e,t);break}case l.CAPTION:{pg(e,t);break}case l.COLGROUP:{hg(e,t);break}default:$n(e,t)}}function Un(e,t){switch(t.tagID){case l.TABLE:{e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode());break}case l.TEMPLATE:{Vt(e,t);break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:$n(e,t)}}function $n(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,br(e,t),e.fosterParentingEnabled=n}function ou(e,t){e.pendingCharacterTokens.push(t)}function uu(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function qn(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)$n(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const lu=new Set([l.CAPTION,l.COL,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]);function xg(e,t){const n=t.tagID;lu.has(n)?e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=v.IN_TABLE,on(e,t)):Ke(e,t)}function Ag(e,t){const n=t.tagID;switch(n){case l.CAPTION:case l.TABLE:{e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=v.IN_TABLE,n===l.TABLE&&Un(e,t));break}case l.BODY:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:Tr(e,t)}}function Ha(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.COL:{e._appendElement(t,ie.HTML),t.ackSelfClosing=!0;break}case l.TEMPLATE:{pt(e,t);break}default:yr(e,t)}}function Cg(e,t){switch(t.tagID){case l.COLGROUP:{e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=v.IN_TABLE);break}case l.TEMPLATE:{Vt(e,t);break}case l.COL:break;default:yr(e,t)}}function yr(e,t){e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=v.IN_TABLE,e._processToken(t))}function xr(e,t){switch(t.tagID){case l.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,ie.HTML),e.insertionMode=v.IN_ROW;break}case l.TH:case l.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(Y.TR,l.TR),e.insertionMode=v.IN_ROW,Ar(e,t);break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=v.IN_TABLE,on(e,t));break}default:on(e,t)}}function Ua(e,t){const n=t.tagID;switch(t.tagID){case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=v.IN_TABLE);break}case l.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=v.IN_TABLE,Un(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:case l.TR:break;default:Un(e,t)}}function Ar(e,t){switch(t.tagID){case l.TH:case l.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,ie.HTML),e.insertionMode=v.IN_CELL,e.activeFormattingElements.insertMarker();break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=v.IN_TABLE_BODY,xr(e,t));break}default:on(e,t)}}function cu(e,t){switch(t.tagID){case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=v.IN_TABLE_BODY);break}case l.TABLE:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=v.IN_TABLE_BODY,Ua(e,t));break}case l.TBODY:case l.TFOOT:case l.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(l.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=v.IN_TABLE_BODY,Ua(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:break;default:Un(e,t)}}function Sg(e,t){const n=t.tagID;lu.has(n)?(e.openElements.hasInTableScope(l.TD)||e.openElements.hasInTableScope(l.TH))&&(e._closeTableCell(),Ar(e,t)):Ke(e,t)}function _g(e,t){const n=t.tagID;switch(n){case l.TD:case l.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=v.IN_ROW);break}case l.TABLE:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),cu(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:break;default:Tr(e,t)}}function du(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._insertElement(t,ie.HTML);break}case l.OPTGROUP:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._insertElement(t,ie.HTML);break}case l.HR:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._appendElement(t,ie.HTML),t.ackSelfClosing=!0;break}case l.INPUT:case l.KEYGEN:case l.TEXTAREA:case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),t.tagID!==l.SELECT&&e._processStartTag(t));break}case l.SCRIPT:case l.TEMPLATE:{pt(e,t);break}}}function fu(e,t){switch(t.tagID){case l.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===l.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===l.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop();break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop();break}case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode());break}case l.TEMPLATE:{Vt(e,t);break}}}function Ig(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e._processStartTag(t)):du(e,t)}function Ng(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e.onEndTag(t)):fu(e,t)}function kg(e,t){switch(t.tagID){case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{pt(e,t);break}case l.CAPTION:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.tmplInsertionModeStack[0]=v.IN_TABLE,e.insertionMode=v.IN_TABLE,on(e,t);break}case l.COL:{e.tmplInsertionModeStack[0]=v.IN_COLUMN_GROUP,e.insertionMode=v.IN_COLUMN_GROUP,Ha(e,t);break}case l.TR:{e.tmplInsertionModeStack[0]=v.IN_TABLE_BODY,e.insertionMode=v.IN_TABLE_BODY,xr(e,t);break}case l.TD:case l.TH:{e.tmplInsertionModeStack[0]=v.IN_ROW,e.insertionMode=v.IN_ROW,Ar(e,t);break}default:e.tmplInsertionModeStack[0]=v.IN_BODY,e.insertionMode=v.IN_BODY,Ke(e,t)}}function vg(e,t){t.tagID===l.TEMPLATE&&Vt(e,t)}function pu(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ba(e,t)}function wg(e,t){t.tagID===l.HTML?Ke(e,t):Cr(e,t)}function hu(e,t){var n;if(t.tagID===l.HTML){if(e.fragmentContext||(e.insertionMode=v.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===l.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Cr(e,t)}function Cr(e,t){e.insertionMode=v.IN_BODY,br(e,t)}function Lg(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.FRAMESET:{e._insertElement(t,ie.HTML);break}case l.FRAME:{e._appendElement(t,ie.HTML),t.ackSelfClosing=!0;break}case l.NOFRAMES:{pt(e,t);break}}}function Og(e,t){t.tagID===l.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==l.FRAMESET&&(e.insertionMode=v.AFTER_FRAMESET))}function Dg(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.NOFRAMES:{pt(e,t);break}}}function Pg(e,t){t.tagID===l.HTML&&(e.insertionMode=v.AFTER_AFTER_FRAMESET)}function Mg(e,t){t.tagID===l.HTML?Ke(e,t):Sr(e,t)}function Sr(e,t){e.insertionMode=v.IN_BODY,br(e,t)}function Rg(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.NOFRAMES:{pt(e,t);break}}}function Bg(e,t){t.chars=Be,e._insertCharacters(t)}function Fg(e,t){e._insertCharacters(t),e.framesetOk=!1}function mu(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ie.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Hg(e,t){if(em(t))mu(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ie.MATHML?jo(t):r===ie.SVG&&(tm(t),Xo(t)),Pa(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Ug(e,t){if(t.tagID===l.P||t.tagID===l.BR){mu(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===ie.HTML){e._endTagOutsideForeignContent(t);break}const a=e.treeAdapter.getTagName(r);if(a.toLowerCase()===t.tagName){t.tagName=a,e.openElements.shortenToLength(n);break}}}Y.AREA,Y.BASE,Y.BASEFONT,Y.BGSOUND,Y.BR,Y.COL,Y.EMBED,Y.FRAME,Y.HR,Y.IMG,Y.INPUT,Y.KEYGEN,Y.LINK,Y.META,Y.PARAM,Y.SOURCE,Y.TRACK,Y.WBR;const $g=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,qg=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),gu={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Eu(e,t){const n=Jg(e),r=vo("type",{handlers:{root:zg,element:Vg,text:Yg,comment:Tu,doctype:Gg,raw:jg},unknown:Xg}),a={parser:n?new Jo(gu):Jo.getFragmentParser(void 0,gu),handle(u){r(u,a)},stitches:!1,options:t||{}};r(e,a),un(a,gt());const i=n?a.parser.document:a.parser.getFragment(),s=Zh(i,{file:a.options.file});return a.stitches&&pr(s,"comment",function(u,o,d){const f=u;if(f.value.stitch&&d&&o!==void 0){const h=d.children;return h[o]=f.value.stitch,o}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function bu(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function zg(e,t){bu(e.children,t)}function Vg(e,t){Kg(e,t),bu(e.children,t),Qg(e,t)}function Yg(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Ae.CHARACTER,chars:e.value,location:zn(e)};un(t,gt(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Gg(e,t){const n={type:Ae.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:zn(e)};un(t,gt(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Wg(e,t){t.stitches=!0;const n=Zg(e);if("children"in e&&"children"in n){const r=Eu({type:"root",children:e.children},t.options);n.children=r.children}Tu({type:"comment",value:{stitch:n}},t)}function Tu(e,t){const n=e.value,r={type:Ae.COMMENT,data:n,location:zn(e)};un(t,gt(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function jg(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,yu(t,gt(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace($g,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function Xg(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Wg(n,t);else{let r="";throw qg.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function un(e,t){yu(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=$e.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function yu(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function Kg(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===$e.PLAINTEXT)return;un(t,gt(e));const r=t.parser.openElements.current;let a="namespaceURI"in r?r.namespaceURI:qt.html;a===qt.html&&n==="svg"&&(a=qt.svg);const i=a0({...e,children:[]},{space:a===qt.svg?"svg":"html"}),s={type:Ae.START_TAG,tagName:n,tagID:sn(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:zn(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Qg(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&f0.includes(n)||t.parser.tokenizer.state===$e.PLAINTEXT)return;un(t,ir(e));const r={type:Ae.END_TAG,tagName:n,tagID:sn(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:zn(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===$e.RCDATA||t.parser.tokenizer.state===$e.RAWTEXT||t.parser.tokenizer.state===$e.SCRIPT_DATA)&&(t.parser.tokenizer.state=$e.DATA)}function Jg(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function zn(e){const t=gt(e)||{line:void 0,column:void 0,offset:void 0},n=ir(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Zg(e){return"children"in e?$t({...e,children:[]}):$t(e)}function xu(e){return function(t,n){return Eu(t,{...e,file:n})}}const Yt=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],ln={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Yt,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Yt],h2:[["className","sr-only"]],img:[...Yt,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Yt,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Yt],table:[...Yt],ul:[...Yt,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Rt={}.hasOwnProperty;function e1(e,t){let n={type:"root",children:[]};const r={schema:t?{...ln,...t}:ln,stack:[]},a=Au(r,e);return a&&(Array.isArray(a)?a.length===1?n=a[0]:n.children=a:n=a),n}function Au(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return t1(e,n);case"doctype":return n1(e,n);case"element":return r1(e,n);case"root":return a1(e,n);case"text":return i1(e,n)}}}function t1(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),i={type:"comment",value:r<0?n:n.slice(0,r)};return Vn(i,t),i}}function n1(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Vn(n,t),n}}function r1(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=Cu(e,t.children),a=s1(e,t.properties);e.stack.pop();let i=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(i=!0,e.schema.ancestors&&Rt.call(e.schema.ancestors,n))){const u=e.schema.ancestors[n];let o=-1;for(i=!1;++o<u.length;)e.stack.includes(u[o])&&(i=!0)}if(!i)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const s={type:"element",tagName:n,properties:a,children:r};return Vn(s,t),s}function a1(e,t){const r={type:"root",children:Cu(e,t.children)};return Vn(r,t),r}function i1(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Vn(r,t),r}function Cu(e,t){const n=[];if(Array.isArray(t)){const r=t;let a=-1;for(;++a<r.length;){const i=Au(e,r[a]);i&&(Array.isArray(i)?n.push(...i):n.push(i))}}return n}function s1(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,a=e.schema.required,i=r&&Rt.call(r,n)?r[n]:void 0,s=r&&Rt.call(r,"*")?r["*"]:void 0,u=t&&typeof t=="object"?t:{},o={};let d;for(d in u)if(Rt.call(u,d)){const f=u[d];let h=Su(e,Iu(i,d),d,f);h==null&&(h=Su(e,Iu(s,d),d,f)),h!=null&&(o[d]=h)}if(a&&Rt.call(a,n)){const f=a[n];for(d in f)Rt.call(f,d)&&!Rt.call(o,d)&&(o[d]=f[d])}return o}function Su(e,t,n,r){return t?Array.isArray(r)?o1(e,t,n,r):_u(e,t,n,r):void 0}function o1(e,t,n,r){let a=-1;const i=[];for(;++a<r.length;){const s=_u(e,t,n,r[a]);(typeof s=="number"||typeof s=="string")&&i.push(s)}return i}function _u(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&u1(e,n,r)){if(typeof t=="object"&&t.length>1){let a=!1,i=0;for(;++i<t.length;){const s=t[i];if(s&&typeof s=="object"&&"flags"in s){if(s.test(String(r))){a=!0;break}}else if(s===r){a=!0;break}}if(!a)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function u1(e,t,n){const r=e.schema.protocols&&Rt.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const a=String(n),i=a.indexOf(":"),s=a.indexOf("?"),u=a.indexOf("#"),o=a.indexOf("/");if(i<0||o>-1&&i>o||s>-1&&i>s||u>-1&&i>u)return!0;let d=-1;for(;++d<r.length;){const f=r[d];if(i===f.length&&a.slice(0,f.length)===f)return!0}return!1}function Vn(e,t){const n=gs(t);t.data&&(e.data=$t(t.data)),n&&(e.position=n)}function Iu(e,t){let n,r=-1;if(e)for(;++r<e.length;){const a=e[r],i=typeof a=="string"?a:a[0];if(i===t)return a;i==="data*"&&(n=a)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function Nu(e){return function(t){return e1(t,e)}}function ku(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}const l1=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],vu={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function wu(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function c1(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function d1(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function Lu(e){return d1(e)||wu(e)}const f1=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function $a(e,t){const n=t||{},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,a=[];let i=0,s=-1,u="",o,d;n.position&&("start"in n.position||"indent"in n.position?(d=n.position.indent,o=n.position.start):o=n.position);let f=(o?o.line:0)||1,h=(o?o.column:0)||1,g=c(),p;for(i--;++i<=e.length;)if(p===10&&(h=(d?d[s]:0)||1),p=e.charCodeAt(i),p===38){const m=e.charCodeAt(i+1);if(m===9||m===10||m===12||m===32||m===38||m===60||Number.isNaN(m)||r&&m===r){u+=String.fromCharCode(p),h++;continue}const x=i+1;let A=x,w=x,N;if(m===35){w=++A;const U=e.charCodeAt(w);U===88||U===120?(N="hexadecimal",w=++A):N="decimal"}else N="named";let F="",z="",O="";const L=N==="named"?Lu:N==="decimal"?wu:c1;for(w--;++w<=e.length;){const U=e.charCodeAt(w);if(!L(U))break;O+=String.fromCharCode(U),N==="named"&&l1.includes(O)&&(F=O,z=In(O))}let H=e.charCodeAt(w)===59;if(H){w++;const U=N==="named"?In(O):!1;U&&(F=O,z=U)}let y=1+w-x,D="";if(!(!H&&n.nonTerminated===!1))if(!O)N!=="named"&&E(4,y);else if(N==="named"){if(H&&!z)E(5,1);else if(F!==O&&(w=A+F.length,y=1+w-A,H=!1),!H){const U=F?1:3;if(n.attribute){const I=e.charCodeAt(w);I===61?(E(U,y),z=""):Lu(I)?z="":E(U,y)}else E(U,y)}D=z}else{H||E(2,y);let U=Number.parseInt(O,N==="hexadecimal"?16:10);if(p1(U))E(7,y),D="�";else if(U in vu)E(6,y),D=vu[U];else{let I="";h1(U)&&E(6,y),U>65535&&(U-=65536,I+=String.fromCharCode(U>>>10|55296),U=56320|U&1023),D=I+String.fromCharCode(U)}}if(D){b(),g=c(),i=w-1,h+=w-x+1,a.push(D);const U=c();U.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,D,{start:g,end:U},e.slice(x-1,w)),g=U}else O=e.slice(x-1,w),u+=O,h+=O.length,i=w-1}else p===10&&(f++,s++,h=0),Number.isNaN(p)?b():(u+=String.fromCharCode(p),h++);return a.join("");function c(){return{line:f,column:h,offset:i+((o?o.offset:0)||0)}}function E(m,x){let A;n.warning&&(A=c(),A.column+=x,A.offset+=x,n.warning.call(n.warningContext||void 0,f1[m],A,m))}function b(){u&&(a.push(u),n.text&&n.text.call(n.textContext||void 0,u,{start:g,end:c()}),u="")}}function p1(e){return e>=55296&&e<=57343||e>1114111}function h1(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}const m1=/["&'<>`]/g,g1=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,E1=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,b1=/[|\\{}()[\]^$+*?.]/g,Ou=new WeakMap;function T1(e,t){if(e=e.replace(t.subset?y1(t.subset):m1,r),t.subset||t.escapeOnly)return e;return e.replace(g1,n).replace(E1,r);function n(a,i,s){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,s.charCodeAt(i+2),t)}function r(a,i,s){return t.format(a.charCodeAt(0),s.charCodeAt(i+1),t)}}function y1(e){let t=Ou.get(e);return t||(t=x1(e),Ou.set(e,t)),t}function x1(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(b1,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}function A1(e){return"&#x"+e.toString(16).toUpperCase()+";"}function C1(e,t){return T1(e,Object.assign({format:A1},t))}const S1={}.hasOwnProperty,_1={},Du=/^[^\t\n\r "#'.<=>`}]+$/,I1=/^[^\t\n\r "'<=>`}]+$/;function N1(){return{canContainEols:["textDirective"],enter:{directiveContainer:v1,directiveContainerAttributes:Va,directiveContainerLabel:O1,directiveLeaf:w1,directiveLeafAttributes:Va,directiveText:L1,directiveTextAttributes:Va},exit:{directiveContainer:Ka,directiveContainerAttributeClassValue:Ga,directiveContainerAttributeIdValue:Ya,directiveContainerAttributeName:ja,directiveContainerAttributeValue:Wa,directiveContainerAttributes:Xa,directiveContainerLabel:D1,directiveContainerName:za,directiveLeaf:Ka,directiveLeafAttributeClassValue:Ga,directiveLeafAttributeIdValue:Ya,directiveLeafAttributeName:ja,directiveLeafAttributeValue:Wa,directiveLeafAttributes:Xa,directiveLeafName:za,directiveText:Ka,directiveTextAttributeClassValue:Ga,directiveTextAttributeIdValue:Ya,directiveTextAttributeName:ja,directiveTextAttributeValue:Wa,directiveTextAttributes:Xa,directiveTextName:za}}}function k1(e){const t=_1;if(t.quote!=='"'&&t.quote!=="'"&&t.quote!==null&&t.quote!==void 0)throw new Error("Invalid quote `"+t.quote+"`, expected `'` or `\"`");return n.peek=P1,{handlers:{containerDirective:n,leafDirective:n,textDirective:n},unsafe:[{character:"\r",inConstruct:["leafDirectiveLabel","containerDirectiveLabel"]},{character:`
16
+ `,inConstruct:["leafDirectiveLabel","containerDirectiveLabel"]},{before:"[^:]",character:":",after:"[A-Za-z]",inConstruct:["phrasing"]},{atBreak:!0,character:":",after:":"}]};function n(i,s,u,o){const d=u.createTracker(o),f=M1(i),h=u.enter(i.type);let g=d.move(f+(i.name||"")),p;if(i.type==="containerDirective"){const c=(i.children||[])[0];p=Pu(c)?c:void 0}else p=i;if(p&&p.children&&p.children.length>0){const c=u.enter("label"),E=`${i.type}Label`,b=u.enter(E);g+=d.move("["),g+=d.move(u.containerPhrasing(p,{...d.current(),before:g,after:"]"})),g+=d.move("]"),b(),c()}if(g+=d.move(r(i,u)),i.type==="containerDirective"){const c=(i.children||[])[0];let E=i;Pu(c)&&(E=Object.assign({},i,{children:i.children.slice(1)})),E&&E.children&&E.children.length>0&&(g+=d.move(`
17
+ `),g+=d.move(u.containerFlow(E,d.current()))),g+=d.move(`
18
+ `+f)}return h(),g}function r(i,s){const u=i.attributes||{},o=[];let d,f,h,g;for(g in u)if(S1.call(u,g)&&u[g]!==void 0&&u[g]!==null){const p=String(u[g]);if(g==="id")h=t.preferShortcut!==!1&&Du.test(p)?"#"+p:a("id",p,i,s);else if(g==="class"){const c=p.split(/[\t\n\r ]+/g),E=[],b=[];let m=-1;for(;++m<c.length;)(t.preferShortcut!==!1&&Du.test(c[m])?b:E).push(c[m]);d=E.length>0?a("class",E.join(" "),i,s):"",f=b.length>0?"."+b.join("."):""}else o.push(a(g,p,i,s))}return d&&o.unshift(d),f&&o.unshift(f),h&&o.unshift(h),o.length>0?"{"+o.join(" ")+"}":""}function a(i,s,u,o){if(t.collapseEmptyAttributes!==!1&&!s)return i;if(t.preferUnquoted&&I1.test(s))return i+"="+s;const d=t.quote||o.options.quote||'"',f=d==='"'?"'":'"',h=t.quoteSmart&&ku(s,d)>ku(s,f)?f:d,g=u.type==="textDirective"?[h]:[h,`
19
+ `,"\r"];return i+"="+h+C1(s,{subset:g})+h}}function v1(e){qa.call(this,"containerDirective",e)}function w1(e){qa.call(this,"leafDirective",e)}function L1(e){qa.call(this,"textDirective",e)}function qa(e,t){this.enter({type:e,name:"",attributes:{},children:[]},t)}function za(e){const t=this.stack[this.stack.length-1];t.type==="containerDirective"||t.type==="leafDirective"||t.type,t.name=this.sliceSerialize(e)}function O1(e){this.enter({type:"paragraph",data:{directiveLabel:!0},children:[]},e)}function D1(e){this.exit(e)}function Va(){this.data.directiveAttributes=[],this.buffer()}function Ya(e){this.data.directiveAttributes.push(["id",$a(this.sliceSerialize(e),{attribute:!0})])}function Ga(e){this.data.directiveAttributes.push(["class",$a(this.sliceSerialize(e),{attribute:!0})])}function Wa(e){const t=this.data.directiveAttributes;t[t.length-1][1]=$a(this.sliceSerialize(e),{attribute:!0})}function ja(e){this.data.directiveAttributes.push([this.sliceSerialize(e),""])}function Xa(){const e=this.data.directiveAttributes,t={};let n=-1;for(;++n<e.length;){const a=e[n];a[0]==="class"&&t.class?t.class+=" "+a[1]:t[a[0]]=a[1]}this.data.directiveAttributes=void 0,this.resume();const r=this.stack[this.stack.length-1];r.type==="containerDirective"||r.type==="leafDirective"||r.type,r.attributes=t}function Ka(e){this.exit(e)}function P1(){return":"}function Pu(e){return!!(e&&e.type==="paragraph"&&e.data&&e.data.directiveLabel)}function M1(e){let t=0;return e.type==="containerDirective"?(uo(e,function(n,r){if(n.type==="containerDirective"){let a=r.length,i=0;for(;a--;)r[a].type==="containerDirective"&&i++;i>t&&(t=i)}}),t+=3):e.type==="leafDirective"?t=2:t=1,":".repeat(t)}function Qa(e,t,n,r,a,i,s,u,o,d,f,h,g,p,c){let E,b;return m;function m(T){return e.enter(r),e.enter(a),e.consume(T),e.exit(a),x}function x(T){return T===35?(E=s,A(T)):T===46?(E=u,A(T)):c&&Ie(T)?Ne(e,x,"whitespace")(T):!c&&Ue(T)?xt(e,x)(T):T===null||he(T)||kn(T)||Nn(T)&&T!==45&&T!==95?I(T):(e.enter(i),e.enter(o),e.consume(T),F)}function A(T){const $=E+"Marker";return e.enter(i),e.enter(E),e.enter($),e.consume(T),e.exit($),w}function w(T){if(T===null||T===34||T===35||T===39||T===46||T===60||T===61||T===62||T===96||T===125||Ue(T))return n(T);const $=E+"Value";return e.enter($),e.consume(T),N}function N(T){if(T===null||T===34||T===39||T===60||T===61||T===62||T===96)return n(T);if(T===35||T===46||T===125||Ue(T)){const $=E+"Value";return e.exit($),e.exit(E),e.exit(i),x(T)}return e.consume(T),N}function F(T){return T===null||he(T)||kn(T)||Nn(T)&&T!==45&&T!==46&&T!==58&&T!==95?(e.exit(o),c&&Ie(T)?Ne(e,z,"whitespace")(T):!c&&Ue(T)?xt(e,z)(T):z(T)):(e.consume(T),F)}function z(T){return T===61?(e.enter(d),e.consume(T),e.exit(d),O):(e.exit(i),x(T))}function O(T){return T===null||T===60||T===61||T===62||T===96||T===125||c&&he(T)?n(T):T===34||T===39?(e.enter(f),e.enter(g),e.consume(T),e.exit(g),b=T,H):c&&Ie(T)?Ne(e,O,"whitespace")(T):!c&&Ue(T)?xt(e,O)(T):(e.enter(h),e.enter(p),e.consume(T),b=void 0,L)}function L(T){return T===null||T===34||T===39||T===60||T===61||T===62||T===96?n(T):T===125||Ue(T)?(e.exit(p),e.exit(h),e.exit(i),x(T)):(e.consume(T),L)}function H(T){return T===b?(e.enter(g),e.consume(T),e.exit(g),e.exit(f),e.exit(i),U):(e.enter(h),y(T))}function y(T){return T===b?(e.exit(h),H(T)):T===null?n(T):he(T)?c?n(T):xt(e,y)(T):(e.enter(p),e.consume(T),D)}function D(T){return T===b||T===null||he(T)?(e.exit(p),y(T)):(e.consume(T),D)}function U(T){return T===125||Ue(T)?x(T):I(T)}function I(T){return T===125?(e.enter(a),e.consume(T),e.exit(a),e.exit(r),t):n(T)}}function Ja(e,t,n,r,a,i,s){let u=0,o=0,d;return f;function f(b){return e.enter(r),e.enter(a),e.consume(b),e.exit(a),h}function h(b){return b===93?(e.enter(a),e.consume(b),e.exit(a),e.exit(r),t):(e.enter(i),g(b))}function g(b){if(b===93&&!o)return E(b);const m=e.enter("chunkText",{_contentTypeTextTrailing:!0,contentType:"text",previous:d});return d&&(d.next=m),d=m,p(b)}function p(b){return b===null||u>999||b===91&&++o>32?n(b):b===93&&!o--?(e.exit("chunkText"),E(b)):he(b)?s?n(b):(e.consume(b),e.exit("chunkText"),g):(e.consume(b),b===92?c:p)}function c(b){return b===91||b===92||b===93?(e.consume(b),u++,p):p(b)}function E(b){return e.exit(i),e.enter(a),e.consume(b),e.exit(a),e.exit(r),t}}function Za(e,t,n,r){const a=this;return i;function i(u){return u===null||he(u)||Nn(u)||kn(u)?n(u):(e.enter(r),e.consume(u),s)}function s(u){return u===null||he(u)||kn(u)||Nn(u)&&u!==45&&u!==95?(e.exit(r),a.previous===45||a.previous===95?n(u):t(u)):(e.consume(u),s)}}const R1={tokenize:H1,concrete:!0},B1={tokenize:U1,partial:!0},F1={tokenize:$1,partial:!0},_r={tokenize:q1,partial:!0};function H1(e,t,n){const r=this,a=r.events[r.events.length-1],i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0;let s=0,u;return o;function o(L){return e.enter("directiveContainer"),e.enter("directiveContainerFence"),e.enter("directiveContainerSequence"),d(L)}function d(L){return L===58?(e.consume(L),s++,d):s<3?n(L):(e.exit("directiveContainerSequence"),Za.call(r,e,f,n,"directiveContainerName")(L))}function f(L){return L===91?e.attempt(B1,h,h)(L):h(L)}function h(L){return L===123?e.attempt(F1,g,g)(L):g(L)}function g(L){return Ne(e,p,"whitespace")(L)}function p(L){return e.exit("directiveContainerFence"),L===null?z(L):he(L)?r.interrupt?t(L):e.attempt(_r,c,z)(L):n(L)}function c(L){return L===null?z(L):he(L)?e.check(_r,A,z)(L):(e.enter("directiveContainerContent"),E(L))}function E(L){return e.attempt({tokenize:O,partial:!0},F,i?Ne(e,b,"linePrefix",i+1):b)(L)}function b(L){return L===null?F(L):he(L)?e.check(_r,x,F)(L):x(L)}function m(L){if(L===null){const H=e.exit("chunkDocument");return r.parser.lazy[H.start.line]=!1,F(L)}return he(L)?e.check(_r,w,N)(L):(e.consume(L),m)}function x(L){const H=e.enter("chunkDocument",{contentType:"document",previous:u});return u&&(u.next=H),u=H,m(L)}function A(L){return e.enter("directiveContainerContent"),E(L)}function w(L){e.consume(L);const H=e.exit("chunkDocument");return r.parser.lazy[H.start.line]=!1,E}function N(L){const H=e.exit("chunkDocument");return r.parser.lazy[H.start.line]=!1,F(L)}function F(L){return e.exit("directiveContainerContent"),z(L)}function z(L){return e.exit("directiveContainer"),t(L)}function O(L,H,y){let D=0;return Ne(L,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function U($){return L.enter("directiveContainerFence"),L.enter("directiveContainerSequence"),I($)}function I($){return $===58?(L.consume($),D++,I):D<s?y($):(L.exit("directiveContainerSequence"),Ne(L,T,"whitespace")($))}function T($){return $===null||he($)?(L.exit("directiveContainerFence"),H($)):y($)}}}function U1(e,t,n){return Ja(e,t,n,"directiveContainerLabel","directiveContainerLabelMarker","directiveContainerLabelString",!0)}function $1(e,t,n){return Qa(e,t,n,"directiveContainerAttributes","directiveContainerAttributesMarker","directiveContainerAttribute","directiveContainerAttributeId","directiveContainerAttributeClass","directiveContainerAttributeName","directiveContainerAttributeInitializerMarker","directiveContainerAttributeValueLiteral","directiveContainerAttributeValue","directiveContainerAttributeValueMarker","directiveContainerAttributeValueData",!0)}function q1(e,t,n){const r=this;return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const z1={tokenize:G1},V1={tokenize:W1,partial:!0},Y1={tokenize:j1,partial:!0};function G1(e,t,n){const r=this;return a;function a(f){return e.enter("directiveLeaf"),e.enter("directiveLeafSequence"),e.consume(f),i}function i(f){return f===58?(e.consume(f),e.exit("directiveLeafSequence"),Za.call(r,e,s,n,"directiveLeafName")):n(f)}function s(f){return f===91?e.attempt(V1,u,u)(f):u(f)}function u(f){return f===123?e.attempt(Y1,o,o)(f):o(f)}function o(f){return Ne(e,d,"whitespace")(f)}function d(f){return f===null||he(f)?(e.exit("directiveLeaf"),t(f)):n(f)}}function W1(e,t,n){return Ja(e,t,n,"directiveLeafLabel","directiveLeafLabelMarker","directiveLeafLabelString",!0)}function j1(e,t,n){return Qa(e,t,n,"directiveLeafAttributes","directiveLeafAttributesMarker","directiveLeafAttribute","directiveLeafAttributeId","directiveLeafAttributeClass","directiveLeafAttributeName","directiveLeafAttributeInitializerMarker","directiveLeafAttributeValueLiteral","directiveLeafAttributeValue","directiveLeafAttributeValueMarker","directiveLeafAttributeValueData",!0)}const X1={tokenize:Z1,previous:J1},K1={tokenize:eE,partial:!0},Q1={tokenize:tE,partial:!0};function J1(e){return e!==58||this.events[this.events.length-1][1].type==="characterEscape"}function Z1(e,t,n){const r=this;return a;function a(o){return e.enter("directiveText"),e.enter("directiveTextMarker"),e.consume(o),e.exit("directiveTextMarker"),Za.call(r,e,i,n,"directiveTextName")}function i(o){return o===58?n(o):o===91?e.attempt(K1,s,s)(o):s(o)}function s(o){return o===123?e.attempt(Q1,u,u)(o):u(o)}function u(o){return e.exit("directiveText"),t(o)}}function eE(e,t,n){return Ja(e,t,n,"directiveTextLabel","directiveTextLabelMarker","directiveTextLabelString")}function tE(e,t,n){return Qa(e,t,n,"directiveTextAttributes","directiveTextAttributesMarker","directiveTextAttribute","directiveTextAttributeId","directiveTextAttributeClass","directiveTextAttributeName","directiveTextAttributeInitializerMarker","directiveTextAttributeValueLiteral","directiveTextAttributeValue","directiveTextAttributeValueMarker","directiveTextAttributeValueData")}function nE(){return{text:{58:X1},flow:{58:[R1,z1]}}}function Mu(){const t=this.data(),n=t.micromarkExtensions||(t.micromarkExtensions=[]),r=t.fromMarkdownExtensions||(t.fromMarkdownExtensions=[]),a=t.toMarkdownExtensions||(t.toMarkdownExtensions=[]);n.push(nE()),r.push(N1()),a.push(k1())}function ei(e,t,n){if(!e.current)return;const r=g=>{g.classList.contains("rte-richtext-host-expanded")&&(g.style.setProperty("display","flex","important"),g.style.setProperty("flex-direction","column","important"),g.style.setProperty("flex","1 1 auto","important"),g.style.setProperty("min-height","0","important"),g.style.setProperty("width","100%","important"),g.style.setProperty("align-self","stretch","important"))},a=new Set,i={};for(const g of t)g.exclusionGroup&&g.exclusionGroup!=="separator"&&(a.add(g.exclusionGroup),i[g.exclusionGroup]||(i[g.exclusionGroup]=[]),i[g.exclusionGroup].push({type:g.type,key:g.key,exclusionGroup:g.exclusionGroup}));const s={};for(const g of a){s[g]=!1;for(const p of i[g])if(p.type==="upload"&&p.key){if(n[p.key]!==null&&n[p.key]!==void 0){s[g]=!0;break}const c=t.find(E=>E.type==="upload"&&E.key===p.key);if(c&&typeof c.maxCount=="number")for(let E=0;E<c.maxCount;E++){const b=`${p.key}-${E}`;if(n[b]!==null&&n[b]!==void 0){s[g]=!0;break}}if(s[g])break}else if((p.type==="variable"||p.type==="multi-variable")&&p.key){const c=p.type==="multi-variable"?e.current.querySelectorAll(`[data-type="variable"][data-multi-key="${p.key}"]`):[e.current.querySelector(`[data-type="variable"][data-key="${p.key}"]`)].filter(Boolean);for(const E of c)if(!E.classList.contains("show-placeholder")&&E.innerText.replace(/[\u200B\n]/g,"").trim().length>0){s[g]=!0;break}if(s[g])break}}const u=t.some(g=>g.exclusionGroup==="separator"),d=Object.keys(s).filter(g=>s[g]).length>0;let f=null;if(d&&u){for(const g of t)if(g.exclusionGroup&&g.exclusionGroup!=="separator"&&s[g.exclusionGroup]){f=g.exclusionGroup;break}}for(const g of a){const p=e.current.querySelectorAll(`[data-group="${g}"]`);u&&d&&f?g===f?p.forEach(c=>{if(!c.closest('[data-rte-force-hidden="1"]')){if(c.classList.contains("rte-richtext-host-expanded")){r(c);return}c.classList.contains("required-upload-group")?c.style.setProperty("display","inline-flex","important"):(c.classList.contains("exclusion-wrapper"),c.style.setProperty("display","inline-block","important"))}}):p.forEach(c=>{c.closest('[data-rte-force-hidden="1"]')||(c.style.display="none",c.style.setProperty("display","none","important"))}):p.forEach(c=>{if(!c.closest('[data-rte-force-hidden="1"]')){if(c.classList.contains("rte-richtext-host-expanded")){r(c);return}c.classList.contains("required-upload-group")?c.style.setProperty("display","inline-flex","important"):(c.classList.contains("exclusion-wrapper"),c.style.setProperty("display","inline-block","important"))}})}e.current.querySelectorAll('[data-group="separator"]').forEach(g=>{g.style.display=d?"none":"inline"})}function ti(e,t,n,r){if(!e.current){r(!1);return}const a=c=>{const E=c.getAttribute("data-node-type")||"";if(E!=="report-module"&&E!=="markdown-module")return(c.textContent||"").replace(/[\u200B]/g,"").trim();const b=(c.textContent||"").replace(/[\u200B]/g,"").trim(),m=Array.from(c.querySelectorAll(":scope > div"));if(m.length===0)return b;let x=-1;for(let N=0;N<m.length;N++)if((m[N].textContent||"").replace(/[\u200B]/g,"").trim().length>0){x=N;break}return m.filter((N,F)=>F!==x).map(N=>(N.textContent||"").replace(/[\u200B]/g,"").trim()).join(`
20
+ `).trim()||b},i=c=>c?!!c.closest('[data-rte-force-hidden="1"]'):!1,s=[];for(let c=0;c<t.length;c++){const E=t[c];if((E.type==="variable"||E.type==="report-url"||E.type==="markdown"||E.type==="upload"||E.type==="multi-variable"||E.type==="select"||E.type==="textarea"||E.type==="richtext"||E.type==="report-module"||E.type==="markdown-module"||E.type==="datepicker"||E.type==="number-input")&&E.required&&E.key){s.push({exclusionGroup:E.exclusionGroup||"",key:E.key,type:E.type==="multi-variable"||E.type==="report-url"||E.type==="markdown"?"variable":E.type==="report-module"||E.type==="markdown-module"?"richtext":E.type,isMultiVariable:E.type==="multi-variable",minCount:E.type==="multi-variable"||E.type==="upload"&&typeof E.minCount=="number"?E.minCount:void 0,moduleIndex:E.type==="report-module"||E.type==="markdown-module"?E.moduleIndex:void 0,__index:c});continue}if(E.type==="text"&&E.className?.includes("rte-text-required"))if(E.exclusionGroup)for(let b=c+1;b<t.length;b++){const m=t[b];if(m.exclusionGroup===E.exclusionGroup&&(m.type==="variable"||m.type==="markdown"||m.type==="upload"||m.type==="select"||m.type==="textarea"||m.type==="richtext"||m.type==="datepicker"||m.type==="number-input")&&m.key){s.push({exclusionGroup:E.exclusionGroup,key:m.key,type:m.type==="markdown"?"variable":m.type,__index:b});break}}else for(let b=c+1;b<t.length;b++){const m=t[b];if((m.type==="variable"||m.type==="markdown"||m.type==="upload"||m.type==="select"||m.type==="textarea"||m.type==="richtext"||m.type==="datepicker"||m.type==="number-input")&&m.key){s.push({exclusionGroup:m.exclusionGroup||"",key:m.key,type:m.type==="markdown"?"variable":m.type,__index:b});break}}}const u=t.some(c=>c.exclusionGroup==="separator"),o=[];if(u&&s.length>1){const c=[];t.forEach((E,b)=>{E.exclusionGroup==="separator"&&c.push(b)});for(const E of c){const m=s.filter(w=>typeof w.__index=="number"&&w.__index<E).sort((w,N)=>(N.__index??0)-(w.__index??0))[0],A=s.filter(w=>typeof w.__index=="number"&&w.__index>E).sort((w,N)=>(w.__index??0)-(N.__index??0))[0];m&&A&&o.push([m,A])}}if(s.length===0){if(t.length===0){if(!e.current){r(!1);return}const c=e.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";r(c.length>0);return}r(!0);return}const d=s.filter(c=>{if(!e.current)return!1;if(c.exclusionGroup){const E=e.current.querySelectorAll(`[data-group="${c.exclusionGroup}"]`);if(E.length>0){const b=E[0];return i(b)?!0:b.style.display!=="none"}}if(c.type==="upload"&&c.key){const E=e.current.querySelector(`[data-type="upload"][data-key="${c.key}"]`)||e.current.querySelector(`[data-type="upload"][data-batch-key="${c.key}"]`);if(E){const b=E.closest("[data-group]")||E.parentElement;return i(b)?!0:b?b.style.display!=="none":!0}}else if(c.type==="variable"&&c.key)if(c.isMultiVariable){const E=e.current.querySelectorAll(`[data-type="variable"][data-multi-key="${c.key}"]`);if(E.length>0){const b=E[0],m=b.closest("[data-group]")||b.parentElement;return i(m)?!0:m?m.style.display!=="none":!0}}else{const E=e.current.querySelector(`[data-type="variable"][data-key="${c.key}"]`);if(E){const b=E.closest("[data-group]")||E.parentElement;return i(b)?!0:b?b.style.display!=="none":!0}}else if(c.type==="select"&&c.key){const E=e.current.querySelector(`[data-type="select"][data-key="${c.key}"]`);if(E){const b=E.closest("[data-group]")||E.parentElement;return i(b)?!0:b?b.style.display!=="none":!0}}else if(c.type==="textarea"&&c.key){const E=e.current.querySelector(`[data-type="textarea"][data-key="${c.key}"]`);if(E){const b=E.closest("[data-group]")||E.parentElement;return i(b)?!0:b?b.style.display!=="none":!0}}else if(c.type==="richtext"&&c.key){const E=typeof c.moduleIndex=="number"?`[data-type="richtext"][data-node-type="report-module"][data-key="${c.key}"][data-module-index="${c.moduleIndex}"], [data-type="richtext"][data-node-type="markdown-module"][data-key="${c.key}"][data-module-index="${c.moduleIndex}"]`:`[data-type="richtext"][data-key="${c.key}"]`,b=e.current.querySelector(E);if(b){const m=b.closest("[data-group]")||b.parentElement;return i(m)?!0:m?m.style.display!=="none":!0}}else if(c.type==="datepicker"&&c.key){const E=e.current.querySelector(`[data-type="datepicker"][data-key="${c.key}"]`);if(E){const b=E.closest("[data-group]")||E.parentElement;return i(b)?!0:b?b.style.display!=="none":!0}}else if(c.type==="number-input"&&c.key){const E=e.current.querySelector(`[data-type="number-input"][data-key="${c.key}"]`);if(E){const b=E.closest("[data-group]")||E.parentElement;return i(b)?!0:b?b.style.display!=="none":!0}}return!1});if(d.length===0){r(!0);return}const f=new Set;o.forEach(c=>{c.forEach(E=>{E.key&&f.add(E.key)})});const h=d.filter(c=>!c.key||!f.has(c.key));let g=(o.length===0,!0);for(const c of o){const E=c.filter(m=>{if(!e.current)return!1;if(m.exclusionGroup){const x=e.current.querySelectorAll(`[data-group="${m.exclusionGroup}"]`);if(x.length>0){const A=x[0];return i(A)?!0:A.style.display!=="none"}}return!0});if(E.length===0)continue;let b=!1;for(const m of E)if(m.type==="upload"&&m.key){if(m.minCount&&m.minCount>0){let x=0;const A=e.current.querySelectorAll(`[data-type="upload"][data-batch-key="${m.key}"]`);if(A.length===0)continue;for(let w=0;w<A.length;w++){const F=A[w].dataset.key;F&&n[F]!=null&&(x+=1)}if(x>=m.minCount){b=!0;break}}else if(n[m.key]!==null&&n[m.key]!==void 0){b=!0;break}}else if(m.type==="variable"&&m.key)if(m.isMultiVariable){const x=e.current.querySelectorAll(`[data-type="variable"][data-multi-key="${m.key}"]`);let A=0;for(const N of Array.from(x)){if(N.classList.contains("show-placeholder"))continue;N.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&(A+=1)}const w=m.minCount&&m.minCount>0?m.minCount:1;if(A>=w){b=!0;break}}else{const x=e.current.querySelector(`[data-type="variable"][data-key="${m.key}"]`);if(x){if(x.classList.contains("show-placeholder"))continue;if(x.innerText.replace(/[\u200B\n]/g,"").trim().length>0){b=!0;break}}}else if(m.type==="select"&&m.key){const x=e.current.querySelector(`[data-type="select"][data-key="${m.key}"]`);if(x&&(x.getAttribute("data-value")||"").trim().length>0){b=!0;break}}else if(m.type==="textarea"&&m.key){const x=e.current.querySelector(`[data-type="textarea"][data-key="${m.key}"]`);if(x&&(x.value||"").trim().length>0){b=!0;break}}else if(m.type==="richtext"&&m.key){const x=typeof m.moduleIndex=="number"?`[data-type="richtext"][data-node-type="report-module"][data-key="${m.key}"][data-module-index="${m.moduleIndex}"], [data-type="richtext"][data-node-type="markdown-module"][data-key="${m.key}"][data-module-index="${m.moduleIndex}"]`:`[data-type="richtext"][data-key="${m.key}"]`,A=e.current.querySelector(x);if(A&&a(A).length>0){b=!0;break}}else if(m.type==="datepicker"&&m.key){const x=e.current.querySelector(`[data-type="datepicker"][data-key="${m.key}"]`);if(x&&(x.getAttribute("data-value")||"").trim().length>0){b=!0;break}}else if(m.type==="number-input"&&m.key){const x=e.current.querySelector(`[data-type="number-input"][data-key="${m.key}"]`);if(x&&(x.value||"").trim().length>0){b=!0;break}}if(!b){g=!1;break}}let p=!0;for(const c of h)if(c.type==="upload"&&c.key){if(c.minCount&&c.minCount>0){let E=0;const b=e.current.querySelectorAll(`[data-type="upload"][data-batch-key="${c.key}"]`);if(b.length===0){p=!1;break}for(let m=0;m<b.length;m++){const A=b[m].dataset.key;A&&n[A]!=null&&(E+=1)}if(E<c.minCount){p=!1;break}}else if(n[c.key]===null||n[c.key]===void 0){p=!1;break}}else if(c.type==="variable"&&c.key)if(c.isMultiVariable){const E=e.current.querySelectorAll(`[data-type="variable"][data-multi-key="${c.key}"]`);let b=0;for(const x of Array.from(E)){if(x.classList.contains("show-placeholder"))continue;x.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&(b+=1)}const m=c.minCount&&c.minCount>0?c.minCount:1;if(b<m){p=!1;break}}else{const E=e.current.querySelector(`[data-type="variable"][data-key="${c.key}"]`);if(!E){p=!1;break}if(E.classList.contains("show-placeholder")){p=!1;break}if(E.innerText.replace(/[\u200B\n]/g,"").trim().length===0){p=!1;break}}else if(c.type==="select"&&c.key){const E=e.current.querySelector(`[data-type="select"][data-key="${c.key}"]`);if(!E||(E.getAttribute("data-value")||"").trim().length===0){p=!1;break}}else if(c.type==="textarea"&&c.key){const E=e.current.querySelector(`[data-type="textarea"][data-key="${c.key}"]`);if(!E||(E.value||"").trim().length===0){p=!1;break}}else if(c.type==="richtext"&&c.key){const E=typeof c.moduleIndex=="number"?`[data-type="richtext"][data-node-type="report-module"][data-key="${c.key}"][data-module-index="${c.moduleIndex}"], [data-type="richtext"][data-node-type="markdown-module"][data-key="${c.key}"][data-module-index="${c.moduleIndex}"]`:`[data-type="richtext"][data-key="${c.key}"]`,b=e.current.querySelector(E);if(!b||a(b).length===0){p=!1;break}}else if(c.type==="datepicker"&&c.key){const E=e.current.querySelector(`[data-type="datepicker"][data-key="${c.key}"]`);if(!E||(E.getAttribute("data-value")||"").trim().length===0){p=!1;break}}else if(c.type==="number-input"&&c.key){const E=e.current.querySelector(`[data-type="number-input"][data-key="${c.key}"]`);if(!E||(E.value||"").trim().length===0){p=!1;break}}r(g&&p)}function ni(e,t){if(!e.current)return;e.current.querySelectorAll('[data-type="variable"]').forEach(r=>{const a=r.innerText;a.replace(/\u200B/g,"").trim().length===0?(a!=="​"&&(r.innerText="​"),r.classList.add("show-placeholder")):r.classList.remove("show-placeholder")})}const rE=({host:e,onChange:t})=>{const n=e.dataset.key,r=e.dataset.placeholder,a=e.dataset.options?decodeURIComponent(e.dataset.options):"[]",i=e.dataset.required==="true",s=e.dataset.value||"",u=R.useMemo(()=>{try{return JSON.parse(a)}catch{return[]}},[a]),[o,d]=R.useState(s||void 0),[f,h]=R.useState(64),g=R.useRef(null),p=b=>{d(b),e.setAttribute("data-value",b),t(n,b)};R.useEffect(()=>{d(s||void 0)},[s]);const c=R.useCallback(()=>{if(o!=null&&o!==""){const b=u.find(m=>String(m.value)===String(o));return b?typeof b.label=="string"?b.label:String(b.label??o):String(o)}return r||"请选择"},[o,u,r]),E=R.useCallback(()=>{const b=g.current;if(!b)return;const m=b.querySelector(".ant-select-selection-item"),x=b.querySelector(".ant-select-selection-placeholder"),A=m||x,w=(A?.textContent||"").trim()||c(),N=b.querySelector(".ant-select-selector"),F=A||N||b,z=window.getComputedStyle(F),O=A?z.fontSize:"16px",L=z.fontFamily||"sans-serif",H=z.fontWeight||"400",D=`${z.fontStyle||"normal"} ${H} ${O} ${L}`,I=document.createElement("canvas").getContext("2d"),T=I?Math.ceil((I.font=D,I.measureText(w).width||0)):0;let $=0;if(N){const ce=window.getComputedStyle(N);$=(Number.parseFloat(ce.paddingLeft)||0)+(Number.parseFloat(ce.paddingRight)||0)}const W=b.querySelector(".ant-select-arrow"),q=W?Math.ceil(W.getBoundingClientRect().width):12,ne=b.querySelector(".ant-select-clear");let S=0;if(ne){const ce=window.getComputedStyle(ne);ce.display!=="none"&&ce.visibility!=="hidden"&&(S=Math.ceil(ne.getBoundingClientRect().width))}const pe=Math.max(36,T+$+q+S+6);h(ce=>ce===pe?ce:pe)},[c]);return R.useLayoutEffect(()=>{const b=window.requestAnimationFrame(()=>{E()}),m=window.setTimeout(()=>{E()},60);return()=>{window.cancelAnimationFrame(b),window.clearTimeout(m)}},[E]),R.useEffect(()=>{if(!("fonts"in document))return;let b=!1;const m=document.fonts;if(m?.ready)return m.ready.then(()=>{b||E()}),()=>{b=!0}},[E]),Mr.createPortal(G.jsx("div",{className:"rte-select-wrapper",contentEditable:!1,ref:g,style:{display:"inline-block",width:f},children:G.jsx(xe.Select,{value:o,onChange:p,placeholder:r||"请选择",style:{width:"100%"},options:u,allowClear:!i,size:"small",dropdownClassName:"rte-select-dropdown",getPopupContainer:()=>document.body,dropdownMatchSelectWidth:!1,suffixIcon:G.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang",style:{fontSize:"10px",color:"#7C3AED"}})})}),e)},aE=e=>{const[t,n]=R.useState([]);return R.useEffect(()=>{const r=e.current;if(!r)return;const a=()=>{const s=r.querySelectorAll(".rte-select-host"),u=[];s.forEach(o=>{const d=o.getAttribute("data-key");d&&u.push(G.jsx(rE,{host:o,onChange:()=>{if(e.current){const f=new Event("input",{bubbles:!0});e.current.dispatchEvent(f)}}},`select-${d}`))}),n(u)};a();const i=new MutationObserver(s=>{let u=!1;for(const o of s)if(o.type==="childList"){let d=!1;if(o.addedNodes.forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE){const h=f;(h.classList?.contains("rte-select-host")||h.querySelector?.(".rte-select-host"))&&(d=!0)}}),o.removedNodes.forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE){const h=f;(h.classList?.contains("rte-select-host")||h.querySelector?.(".rte-select-host"))&&(d=!0)}}),d){u=!0;break}}u&&a()});return i.observe(r,{childList:!0,subtree:!0}),()=>i.disconnect()},[e]),t},cn=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),je=e=>{if(!e)return"";const t=typeof e=="string"?e:JSON.stringify(e);return cn(t)};function iE(e,t,n,r,a,i={},s,u){if(!e.current)return;const o=/[;;,,。.!!??::、]/,d=c=>{const E=(c??"").trim();return E.length===1&&o.test(E)},f=c=>{const E=c??"",b=E.match(new RegExp(`^\\s*(${o.source})`));if(!b)return null;const m=b[1],x=E.replace(new RegExp(`^\\s*${o.source}`),"");return{punct:m,rest:x}},h=c=>`<span data-type="text" class="rte-inline-punct" contenteditable="false">${c}</span>`,g=[];let p=0;for(;p<t.length;){const c=t[p],E=p+1<t.length?t[p+1]:null;let b=!1;if(c.type==="text"&&(c.text?.includes("icon-bitian")||c.className==="rte-text-required")&&E){const z=E.type==="upload"&&E.exclusionGroup==="fileInput"&&c.exclusionGroup==="fileInput"&&c.exclusionGroup===E.exclusionGroup,O=E.type==="variable"&&E.exclusionGroup==="textInput"&&c.exclusionGroup==="textInput"&&c.exclusionGroup===E.exclusionGroup;if(z){const L=c.exclusionGroup?`data-group="${c.exclusionGroup}"`:"",H=`<span ${L} class="exclusion-wrapper required-upload-group">`,y="</span>";let D="";c.className?D=`<span class="${c.className}">${c.text??""}</span>`:D=c.text??"";const U=E,I=n[U.key]!==null&&n[U.key]!==void 0,T=I?n[U.key]:null,$=I?n[U.key]?.name:U.text,W=I?"":"hidden",q=U.tooltip&&!I?"":"hidden",ne=I?"has-file":"",S=I&&$?` data-file-name="${$.replace(/"/g,"&quot;")}"`:"";let pe="";I&&T?T.type?.startsWith("image/")?pe=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(T)}" alt="preview" />`:pe="<i class='iconfont icon-exlwenjian'></i>":pe="<i class='iconfont icon-shangchuan1'></i>";const ce=(U.text||"").trim(),ye=I&&ce.length>=12?`<span ${L} contenteditable="false" class="exclusion-wrapper upload-hint">${ce}</span>`:"",Se=`<span contenteditable="false" data-type="upload" data-key="${U.key}" class="upload-chip"><span class="upload-inner-wrapper ${ne}"><span class="upload-icon">${pe}</span><span class="upload-label"${S}>${$||U.text}</span>${U.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${q}" data-upload-key="${U.key}" data-tooltip="${je(U.tooltip)}"></i>`:""}<span class="file-remove-btn ${W}" title="移除文件">×</span></span></span>`;g.push(H+D+Se+y+ye),p+=2;continue}if(O){const H=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,y="</span>";let D="";c.className?D=`<span class="${c.className}">${c.text??""}</span>`:D=c.text??"";const U=E,T=(U.key?a[U.key]:void 0)||U.text||"",$=!T,W=$?"​":T,q=$?"show-placeholder":"",ne=U.exclusionGroup?` data-group="${U.exclusionGroup}"`:"",S=U.tooltip?` data-tooltip="${je(U.tooltip)}" data-variable-key="${U.key||""}"`:"",pe=U.tooltip&&$?"":"hidden",ce=`<span contenteditable="true" data-type="variable" data-key="${U.key}" data-placeholder="${U.placeholder||""}"${ne}${S} class="variable-chip ${q}">${W}${U.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${pe}" data-variable-key="${U.key}" data-tooltip="${je(U.tooltip)}" ></i>`:""}</span>`;g.push(H+D+ce+y),p+=2;continue}}const x=c.exclusionGroup?`data-group="${c.exclusionGroup}"`:"",A=c.exclusionGroup?`<span ${x} class="exclusion-wrapper">`:"",w=c.exclusionGroup?"</span>":"";let N="";if(c.type==="tag"){const O=r||s==="hideTagClose"?"":'<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>',L=r?' data-locked="true"':"",H=c.tooltip?` data-tooltip="${je(c.tooltip)}" data-tag-key="${c.key||""}"`:"";N=`<span contenteditable="false" class="tag-node group"${L}${H}><span class="tag-label">${c.text}</span>${O}</span>`}else if(c.type==="text"){const z=r?' data-locked="true" contenteditable="false"':' contenteditable="false"',L=(c.text??"").replace(/\n/g,"<br/>");c.className?N=`<span data-type="text" class="${c.className}"${z}>${L}</span>`:N=r?`<span data-type="text"${z}>${L}</span>`:`<span data-type="text" contenteditable="false">${L}</span>`}else if(c.type==="variable"&&c.key){const O=a[c.key]||c.text||"",L=!O,H=L?"​":O,y=L?"show-placeholder":"",D=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",U=c.tooltip?` data-tooltip="${je(c.tooltip)}" data-variable-key="${c.key||""}"`:"",I=c.tooltip&&L?"":"hidden",T=`<span contenteditable="true" data-type="variable" data-key="${c.key}" data-placeholder="${c.placeholder||""}"${D}${U} class="variable-chip ${y}">${H}${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${I}" data-variable-key="${c.key}" data-tooltip="${je(c.tooltip)}" ></i>`:""}</span>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${T}</span>`:N=T}else if(c.type==="report-url"&&c.key){const z=`${c.key}__url`,L=Object.prototype.hasOwnProperty.call(a,z)?a[z]:void 0,H=a[c.key],y=L??H??c.text??"",D=!y,U=D?"​":y,I=D?"show-placeholder":"",T=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",$=c.tooltip?` data-tooltip="${je(c.tooltip)}" data-variable-key="${c.key||""}"`:"",W=c.tooltip&&D?"":"hidden",q=`<span contenteditable="true" data-type="variable" data-key="${c.key}" data-node-type="report-url" data-placeholder="${cn(c.placeholder||"")}"${T}${$} class="variable-chip rte-report-url ${I}">${U}${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${W}" data-variable-key="${c.key}" data-tooltip="${je(c.tooltip)}" ></i>`:""}</span>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${q}</span>`:N=q}else if(c.type==="markdown"&&c.key){const z=c.sourceTextKey||`${c.key}__sourceText`,L=Object.prototype.hasOwnProperty.call(a,z)?a[z]:void 0,H=a[c.key],y=L??H??c.text??"",D=!y,U=D?"​":y,I=D?"show-placeholder":"",T=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",$=c.sourceTextKey?` data-source-text-key="${cn(c.sourceTextKey)}"`:"",W=c.tooltip?` data-tooltip="${je(c.tooltip)}" data-variable-key="${c.key||""}"`:"",q=c.tooltip&&D?"":"hidden",ne=`<span contenteditable="true" data-type="variable" data-key="${c.key}" data-node-type="markdown" data-placeholder="${cn(c.placeholder||"")}"${T}${$}${W} class="variable-chip rte-markdown-input ${I}">${U}${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${q}" data-variable-key="${c.key}" data-tooltip="${je(c.tooltip)}" ></i>`:""}</span>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${ne}</span>`:N=ne}else if(c.type==="upload"&&c.key){const z=!!E&&E.type==="text"&&!E.className&&!E.exclusionGroup&&d(E.text),O=z?(E.text??"").trim():"",L=O?h(O):"";if(z&&(b=!0),typeof c.maxCount=="number"&&typeof c.minCount=="number"&&c.maxCount>1){const y=c.tooltip?` data-tooltip="${je(c.tooltip)}"`:"",D=c.minCount||1,U=c.maxCount||3;let I=0;for(let W=0;W<U;W++){const q=`${c.key}-${W}`;n[q]!=null&&(I+=1)}const T=Math.min(U,Math.max(D,I+(I<U?1:0)));let $="";for(let W=0;W<T;W++){const q=`${c.key}-${W}`,ne=n[q]!==null&&n[q]!==void 0,S=ne?n[q]:null,pe=ne?n[q]?.name:c.text,ce=ne?"":"hidden",k=c.tooltip&&!ne?"":"hidden",ye=ne?"has-file":"",Se=ne&&pe?` data-file-name="${pe.replace(/"/g,"&quot;")}"`:"";let _e="";ne&&S?S.type?.startsWith("image/")?_e=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(S)}" alt="preview" />`:_e="<i class='iconfont icon-exlwenjian'></i>":_e="<i class='iconfont icon-shangchuan1'></i>";const ge=` data-batch-key="${c.key}"`,ke=` data-batch-index="${W}"`,Pe=`<span contenteditable="false" data-type="upload" data-key="${q}"${ge}${ke}${y} class="upload-chip upload-chip-batch"><span class="upload-inner-wrapper ${ye}"><span class="upload-icon">${_e}</span><span class="upload-label"${Se}>${pe||c.text}</span>${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${k}" data-upload-key="${q}" data-tooltip="${je(c.tooltip)}" ></i>`:""}<span class="file-remove-btn ${ce}" title="移除文件">×</span></span></span>`;$+=Pe}c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group rte-required-upload-batch"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span><span class="rte-upload-batch-chips">${$}${L}</span></span>`:N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper rte-upload-batch-chips">${$}${L}</span>`}else{const y=c.tooltip?` data-tooltip="${je(c.tooltip)}"`:"",D=n[c.key]!==null&&n[c.key]!==void 0,U=D?n[c.key]:null,I=D?n[c.key]?.name:c.text,T=D?"":"hidden",$=c.tooltip&&!D?"":"hidden",W=D?"has-file":"",q=D&&I?` data-file-name="${I.replace(/"/g,"&quot;")}"`:"";let ne="";D&&U?U.type?.startsWith("image/")?ne=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(U)}" alt="preview" />`:ne="<i class='iconfont icon-exlwenjian'></i>":ne="<i class='iconfont icon-shangchuan1'></i>";const S=(c.text||"").trim(),ce=D&&c.showHint===!0&&S.length>=12?`<span ${x} contenteditable="false" class="exclusion-wrapper upload-hint">${S}</span>`:"",k=`<span contenteditable="false" data-type="upload" data-key="${c.key}"${y} class="upload-chip"><span class="upload-inner-wrapper ${W}"><span class="upload-icon">${ne}</span><span class="upload-label"${q}>${I||c.text}</span>${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${$}" data-upload-key="${c.key}" data-tooltip="${je(c.tooltip)}" ></i>`:""}<span class="file-remove-btn ${T}" title="移除文件">×</span></span></span>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${k}${L}</span>${ce}`:N=k+L+ce}}else if(c.type==="select"&&c.key){const z=a[c.key]||c.defaultValue||"",O=encodeURIComponent(JSON.stringify(c.options||[])),L=c.placeholder?` data-placeholder="${c.placeholder}"`:"",H=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",y=c.required?' data-required="true"':"",D=`<div data-type="select" data-key="${c.key}" data-value="${z}" data-options="${O}"${L}${H}${y} class="rte-select-host"></div>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${D}</span>`:N=D}else if(c.type==="textarea"&&c.key){const z=a[c.key]||"",O=typeof c.maxHeight=="number"?c.maxHeight:252,L=c.placeholder?` placeholder="${c.placeholder}"`:"",H=`<textarea data-type="textarea" data-key="${c.key}" class="rte-textarea" style="max-height:${O}px;"${L}>${z}</textarea>`,y=`<div class="rte-textarea-wrapper" data-key="${c.key}">${H}</div>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${y}</span>`:N=y}else if(c.type==="richtext"&&c.key){const z=a[c.key]||c.text||"",O=typeof c.minHeight=="number"?c.minHeight:40,L=typeof c.maxHeight=="number"?c.maxHeight:160,H=Math.max(L,O),y=c.placeholder?` data-placeholder="${c.placeholder}"`:"",D=c.expandable!==!1,U=z,I=`<div contenteditable="true" data-type="richtext" data-key="${c.key}" class="rte-richtext"${y} style="min-height:${O}px;max-height:${H}px;overflow:auto;">${U}</div>`,T=D?`<button type="button" class="rte-richtext-toggle" data-key="${c.key}" data-expanded="false"><i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span></button>`:"",$=`<div class="rte-richtext-wrapper${D?" rte-richtext-toggleable":""}" data-key="${c.key}">${I}${T}</div>`,W=`<div class="rte-richtext-container" data-key="${c.key}">${$}</div>`;c.required?N=`<div ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper rte-richtext-required">${W}</div>`:N=W}else if(c.type==="report-module"&&c.key){const z=typeof c.moduleIndex=="number"?c.moduleIndex:0,O=`${c.key}__module_${z}`,H=Object.prototype.hasOwnProperty.call(a,O)?a[O]:c.text||"",y=typeof c.minHeight=="number"?c.minHeight:80,D=typeof c.maxHeight=="number"?c.maxHeight:240,U=Math.max(D,y),I=c.placeholder?` data-placeholder="${cn(c.placeholder)}"`:"",T=H,$=`<div contenteditable="true" data-type="richtext" data-key="${c.key}" data-node-type="report-module" data-module-index="${z}" class="rte-richtext rte-report-module"${I} style="min-height:${y}px;max-height:${U}px;overflow:auto;">${T}</div>`,W=`<div class="rte-richtext-wrapper rte-report-module-wrapper" data-key="${c.key}">${$}</div>`,q=`<div class="rte-richtext-container rte-report-module-container" data-key="${c.key}">${W}</div>`;c.required?N=`<div ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper rte-richtext-required">${q}</div>`:N=q}else if(c.type==="markdown-module"&&c.key){const z=typeof c.moduleIndex=="number"?c.moduleIndex:0,O=`${c.key}__module_${z}`,H=Object.prototype.hasOwnProperty.call(a,O)?a[O]:c.text||"",y=typeof c.minHeight=="number"?c.minHeight:80,D=typeof c.maxHeight=="number"?c.maxHeight:240,U=Math.max(D,y),I=c.placeholder?` data-placeholder="${cn(c.placeholder)}"`:"",T=H,$=`<div contenteditable="true" data-type="richtext" data-key="${c.key}" data-node-type="markdown-module" data-module-index="${z}" class="rte-richtext rte-markdown-module"${I} style="min-height:${y}px;max-height:${U}px;overflow:auto;">${T}</div>`,W=`<div class="rte-richtext-wrapper rte-markdown-module-wrapper" data-key="${c.key}">${$}</div>`,q=`<div class="rte-richtext-container rte-markdown-module-container" data-key="${c.key}">${W}</div>`;c.required?N=`<div ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper rte-richtext-required">${q}</div>`:N=q}else if(c.type==="datepicker"&&c.key){const z=a[c.key]||"",O=c.placeholder?` data-placeholder="${c.placeholder}"`:"",L=c.limitRange?` data-limit-range="${c.limitRange}"`:"",H=c.disableFuture?' data-disable-future="true"':"",y=`<div data-type="datepicker" data-key="${c.key}" data-value="${z}" class="rte-datepicker-host"${O}${L}${H}></div>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${y}</span>`:N=y}else if(c.type==="number-input"&&c.key){const z=a[c.key]||(typeof c.defaultNumber=="number"?String(c.defaultNumber):""),O=typeof c.min=="number"?` min="${c.min}"`:"",L=typeof c.max=="number"?` max="${c.max}"`:"",H=c.placeholder?` placeholder="${c.placeholder}"`:"",y=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",D=' step="1"',U=z||c.placeholder||"";let I=0;for(let W=0;W<U.length;W++){const q=U.charCodeAt(W);q>19968||q>=65280&&q<=65519?I+=16:I+=8}const T=Math.max(44,Math.min(600,I+28)),$=`<input type="number" data-type="number-input" data-key="${c.key}" class="rte-number-input" value="${z}" style="width: ${T}px;"${O}${L}${D}${H}${y} />`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${$}</span>`:N=$}else if(c.type==="multi-variable"&&c.key){const z=c.maxCount||9,O=i[c.key]||1,L=Math.min(O,z);if(c.required){const H=`<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`,y=c.exclusionGroup?`data-group="${c.exclusionGroup}"`:"";let D="";for(let U=0;U<L;U++){const I=`${c.key}_${U}`,T=a[I]||"",$=!T,W=$?"​":T,q=$?"show-placeholder":"",ne=c.tooltip?` data-tooltip="${je(c.tooltip)}" data-variable-key="${c.key||""}"`:"",S=c.tooltip&&$?"":"hidden",pe=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",ce=`<span contenteditable="true" data-type="variable" data-key="${I}" data-multi-key="${c.key}" data-index="${U}" data-placeholder="${c.placeholder||""}"${pe}${ne} class="variable-chip ${q}">${W}${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${S}" data-variable-key="${c.key}" data-tooltip="${je(c.tooltip)}" ></i>`:""}</span>`;U===0?D+=`<span ${y} class="exclusion-wrapper required-upload-group required-multi-first">${H}${ce}</span>`:D+=ce}N=D}else{let H="";for(let y=0;y<L;y++){const D=`${c.key}_${y}`,U=a[D]||"",I=!U,T=I?"​":U,$=I?"show-placeholder":"",W=c.tooltip?` data-tooltip="${je(c.tooltip)}" data-variable-key="${c.key||""}"`:"",q=c.tooltip&&I?"":"hidden",ne=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",S=`<span contenteditable="true" data-type="variable" data-key="${D}" data-multi-key="${c.key}" data-index="${y}" data-placeholder="${c.placeholder||""}"${ne}${W} class="variable-chip ${$}">${T}${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${q}" data-variable-key="${c.key}" data-tooltip="${je(c.tooltip)}" ></i>`:""}</span>`;H+=S}N=H}}const F=A+N+w;if(c.type==="text"&&!c.className&&!c.exclusionGroup){if(d(c.text)&&g.length>0){const O=g[g.length-1],L=(c.text??"").trim();g[g.length-1]=`<span class="rte-inline-group">${O}${h(L)}</span>`,p++;continue}const z=f(c.text);if(z&&g.length>0){const O=g[g.length-1];g[g.length-1]=`<span class="rte-inline-group">${O}${h(z.punct)}</span>`;const L=z.rest;if(L){const H=L.replace(/\n/g,"<br/>");g.push(`<span data-type="text" contenteditable="false">${H}</span>`)}p++;continue}}g.push(F),p+=b?2:1}e.current&&(e.current.innerHTML=g.join(""),setTimeout(()=>{if(!e.current)return;e.current.querySelectorAll('[data-type="variable"]').forEach(E=>{const b=E.innerText.replace(/\n/g,"");b.replace(/\u200B/g,"")?E.classList.remove("show-placeholder"):(b!=="​"&&(E.innerText="​"),E.classList.add("show-placeholder"))})},0))}function sE(e,t,n,r,a={},i,s,u,o){const d=R.useCallback(()=>{if(!e.current)return;if(t.length===0){e.current.innerHTML="";return}let f={};const g=e.current.__tempVariableValues;if(g?(f=g,setTimeout(()=>{if(e.current){const p=e.current;p.__tempVariableValues===g&&delete p.__tempVariableValues}},100)):(e.current.querySelectorAll('[data-type="variable"]').forEach(A=>{const w=A.dataset.key;if(w){const N=A.innerText.replace(/[\u200B\n]/g,"").trim();N&&(A.getAttribute("data-node-type")==="report-url"?f[`${w}__url`]=N:f[w]=N)}}),e.current.querySelectorAll('[data-type="select"]').forEach(A=>{const w=A.dataset.key;if(w){const N=(A.getAttribute("data-value")||"").trim();N&&(f[w]=N)}}),e.current.querySelectorAll('[data-type="textarea"]').forEach(A=>{const w=A.dataset.key;if(w){const N=A.value.replace(/[\u200B]/g,"").trim();N&&(f[w]=N)}}),e.current.querySelectorAll('[data-type="richtext"]').forEach(A=>{const w=A.dataset.key;if(w){const N=A.getAttribute("data-node-type")||"",F=N==="report-module"?(A.innerHTML||"").replace(/[\u200B]/g,"").trim():(A.textContent||"").replace(/[\u200B]/g,"").trim();if(N==="report-module"){const z=Number.parseInt(A.getAttribute("data-module-index")||"0",10);f[`${w}__module_${Number.isFinite(z)?z:0}`]=F}else F&&(f[w]=F)}}),e.current.querySelectorAll('[data-type="datepicker"]').forEach(A=>{const w=A.dataset.key;if(w){const N=(A.getAttribute("data-value")||"").trim();N&&(f[w]=N)}}),e.current.querySelectorAll('[data-type="number-input"]').forEach(A=>{const w=A.dataset.key;if(w){const N=(A.value||"").trim();N&&(f[w]=N)}})),iE(e,t,n,r,f,a,u),i?.current){const{key:p,offset:c}=i.current;setTimeout(()=>{if(!e.current)return;const E=e.current.querySelector(`[data-type="variable"][data-key="${p}"]`);if(E){try{const b=document.createRange(),m=document.createTreeWalker(E,NodeFilter.SHOW_TEXT,null);let x=0,A=null,w=0;for(;m.nextNode();){const N=m.currentNode,F=N.textContent?.length||0;if(x+F>=c){A=N,w=c-x;break}x+=F}if(A){b.setStart(A,Math.min(w,A.textContent?.length||0)),b.collapse(!0);const N=window.getSelection();N&&(N.removeAllRanges(),N.addRange(b),E.focus())}else{b.selectNodeContents(E),b.collapse(!1);const N=window.getSelection();N&&(N.removeAllRanges(),N.addRange(b),E.focus())}}catch{const b=document.createRange();b.selectNodeContents(E),b.collapse(!1);const m=window.getSelection();m&&(m.removeAllRanges(),m.addRange(b),E.focus())}i.current=null}},0)}},[t,n,r,e,a,i,s,u,o]);R.useEffect(()=>{d()},[d])}function oE(e,t,n,r,a){R.useEffect(()=>{const i=e.current;if(!i)return;const s=d=>d.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(d.name||""),u=d=>{const f=d.target?.closest(".upload-info-icon");if(f&&f.classList.contains("upload-info-icon")){const g=f.dataset.uploadKey;if(g){const p=f.closest('[data-type="upload"]');r(p?{key:g,anchorEl:p,type:"upload"}:{key:g,anchorEl:f,type:"upload"})}return}const h=d.target?.closest('[data-type="upload"]');if(h){const g=h.dataset.key;if(g){const p=n[g];p&&s(p)&&r({key:g,anchorEl:h,type:"upload-preview"})}}},o=d=>{if(a)return;const f=d.target?.closest(".upload-info-icon"),h=d.relatedTarget;if(h?.closest?.(".rte-tooltip-overlay"))return;if(f&&f.classList.contains("upload-info-icon")){const p=f.closest('[data-type="upload"]');if(h&&p&&p.contains(h))return;if(!h||!i.contains(h))r(null);else{const c=h.closest('[data-type="upload"]');(!c||c!==p)&&r(null)}return}const g=d.target?.closest('[data-type="upload"]');if(g){const p=h;if(p?.closest?.(".rte-tooltip-overlay")||p&&g.contains(p))return;r(null)}};return i.addEventListener("mouseover",u,!0),i.addEventListener("mouseout",o,!0),()=>{i.removeEventListener("mouseover",u,!0),i.removeEventListener("mouseout",o,!0)}},[t,n,e,r,a])}function uE(e,t,n,r,a){R.useEffect(()=>{const i=e.current;if(!i)return;const s=f=>{if(r==="hideTagClose")return;const h=f.currentTarget,g=h.dataset.tooltip,p=h.dataset.tagKey||"";g&&n({key:p,anchorEl:h,type:"tag"})},u=f=>{a||f.relatedTarget?.closest?.(".rte-tooltip-overlay")||n(null)};let o;const d=()=>{i.querySelectorAll(".tag-node[data-tooltip]").forEach(h=>{h.addEventListener("mouseenter",s),h.addEventListener("mouseleave",u)})};return o=requestAnimationFrame(()=>{o=requestAnimationFrame(d)}),()=>{cancelAnimationFrame(o),i.querySelectorAll(".tag-node[data-tooltip]").forEach(h=>{h.removeEventListener("mouseenter",s),h.removeEventListener("mouseleave",u)})}},[t,e,n,r,a])}function lE(e,t,n,r){R.useEffect(()=>{const a=e.current;if(!a)return;const i=u=>{const o=u.target?.closest(".variable-info-icon");if(o&&o.classList.contains("variable-info-icon")){const f=o.dataset.variableKey;f&&n({key:f,anchorEl:o,type:"variable"});return}const d=u.target?.closest('[data-type="variable"][data-node-type="report-url"][data-tooltip]');if(d){const f=d.dataset.key;f&&n({key:f,anchorEl:d,type:"variable"})}},s=u=>{if(r)return;const o=u.target,d=u.relatedTarget;if(d?.closest?.(".rte-tooltip-overlay"))return;const f=o?.closest?.(".variable-info-icon"),h=o?.closest?.('[data-type="variable"][data-node-type="report-url"][data-tooltip]');if(f||h){if(!d||!a.contains(d)){n(null);return}const g=!!d.closest?.(".variable-info-icon"),p=!!d.closest?.('[data-type="variable"][data-node-type="report-url"][data-tooltip]');!g&&!p&&n(null)}};return a.addEventListener("mouseover",i,!0),a.addEventListener("mouseout",s,!0),()=>{a.removeEventListener("mouseover",i,!0),a.removeEventListener("mouseout",s,!0)}},[t,e,n,r])}function cE(e,t,n,r,a){R.useEffect(()=>{const i=e.current;if(!i)return;const s=h=>h.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(h.name||""),u=h=>{const g=h.currentTarget,p=g.dataset.fileName,c=g.closest('[data-type="upload"]'),E=c?.dataset.key||"",b=E?n[E]:null;if(b&&s(b)){r({key:E,anchorEl:c||g,type:"upload-preview"});return}p&&r({key:E,anchorEl:c||g,type:"upload-label"})},o=h=>{a||h.relatedTarget?.closest?.(".rte-tooltip-overlay")||r(null)};let d;const f=()=>{i.querySelectorAll(".upload-label[data-file-name]").forEach(g=>{g.addEventListener("mouseenter",u),g.addEventListener("mouseleave",o)})};return d=requestAnimationFrame(()=>{d=requestAnimationFrame(f)}),()=>{cancelAnimationFrame(d),i.querySelectorAll(".upload-label[data-file-name]").forEach(g=>{g.removeEventListener("mouseenter",u),g.removeEventListener("mouseleave",o)})}},[t,n,e,r,a])}function dE(e,t,n,r){R.useEffect(()=>{const a=setTimeout(()=>{ei(e,t,n),ti(e,t,n,r)},0);return()=>clearTimeout(a)},[n,t,e,r])}function fE(e,t){const n=R.useRef(0),r=R.useRef(0);R.useEffect(()=>{if(!e.current)return;let a=!1,i=0;const s=x=>x instanceof HTMLElement?!!(x.closest(".rte-datepicker-wrapper")||x.closest(".rte-datepicker-host")||x.closest(".ant-picker")||x.closest(".ant-picker-dropdown")):!1,u=x=>x instanceof HTMLElement?!!(x.closest(".rte-select-wrapper")||x.closest(".rte-select-host")||x.closest(".ant-select")||x.closest(".ant-select-dropdown")):!1,o=x=>{a=!0,s(x.target)&&(n.current=Date.now(),console.log("[SelectionCtrl] mousedown on datepicker target")),u(x.target)&&(r.current=Date.now(),console.log("[SelectionCtrl] mousedown on select target"))},d=()=>{a=!1,i=Date.now()};let f=!1,h=0;const g=()=>{f=!0},p=()=>{f=!1,h=Date.now()},c=()=>{h=Date.now()},E=x=>{s(x.target)&&(n.current=Date.now(),console.log("[SelectionCtrl] focusin datepicker target")),u(x.target)&&(r.current=Date.now(),console.log("[SelectionCtrl] focusin select target"))},b=()=>{if(Date.now()-n.current<800||Date.now()-r.current<800){console.log("[SelectionCtrl] skip selectionchange due to recent picker/select interaction");return}const x=document.activeElement;if(x&&(x.closest(".rte-datepicker-wrapper")||x.closest(".rte-datepicker-host")||x.closest(".ant-picker-dropdown")||x.tagName==="INPUT"&&x.closest(".ant-picker")||x.closest(".rte-select-wrapper")||x.closest(".rte-select-host")||x.closest(".ant-select")||x.closest(".ant-select-dropdown"))){console.log("[SelectionCtrl] activeElement is picker/select; skip");return}if(!e.current)return;const A=window.getSelection();if(!A||A.rangeCount===0||t.current||a||f||Date.now()-h<500)return;const w=A.getRangeAt(0);if(!w.collapsed)return e.current.contains(w.commonAncestorContainer),void 0;const N=A.anchorNode;if(!N||!e.current.contains(N))return;let F=!1,z=!1;if(N.nodeType===Node.ELEMENT_NODE){const L=N;(L.closest('[data-type="datepicker"]')||L.closest(".rte-datepicker-wrapper")||L.closest(".rte-datepicker-host"))&&(F=!0),(L.closest('[data-type="select"]')||L.closest(".rte-select-wrapper")||L.closest(".rte-select-host"))&&(z=!0)}else if(N.parentElement){const L=N.parentElement;(L.closest('[data-type="datepicker"]')||L.closest(".rte-datepicker-wrapper")||L.closest(".rte-datepicker-host"))&&(F=!0),(L.closest('[data-type="select"]')||L.closest(".rte-select-wrapper")||L.closest(".rte-select-host"))&&(z=!0)}if(F||z)return;let O=null;if(N.nodeType===Node.ELEMENT_NODE?O=N.closest('[data-type="variable"]'):N.nodeType===Node.TEXT_NODE&&N.parentElement&&(O=N.parentElement.closest('[data-type="variable"]')),!O){if(Date.now()-i>500)return;const L=e.current.querySelectorAll('[data-type="variable"]');if(L.length>0){let H=null;for(const y of Array.from(L))if(y.style.display!=="none"){H=y;break}if(!H&&L.length>0&&(H=L[0]),H){const y=document.createRange();y.selectNodeContents(H),y.collapse(!1),A.removeAllRanges(),A.addRange(y),H.focus()}else A.removeAllRanges()}else A.removeAllRanges()}},m=e.current;return m&&(m.addEventListener("compositionstart",g),m.addEventListener("compositionend",p),m.addEventListener("input",c)),document.addEventListener("mousedown",o),document.addEventListener("mouseup",d),document.addEventListener("focusin",E),document.addEventListener("selectionchange",b),()=>{m&&(m.removeEventListener("compositionstart",g),m.removeEventListener("compositionend",p),m.removeEventListener("input",c)),document.removeEventListener("mousedown",o),document.removeEventListener("mouseup",d),document.removeEventListener("focusin",E),document.removeEventListener("selectionchange",b)}},[e,t])}var Ir={exports:{}},pE=Ir.exports,Ru;function Bu(){return Ru||(Ru=1,function(e,t){(function(n,r){e.exports=r()})(pE,function(){var n=1e3,r=6e4,a=36e5,i="millisecond",s="second",u="minute",o="hour",d="day",f="week",h="month",g="quarter",p="year",c="date",E="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(I){var T=["th","st","nd","rd"],$=I%100;return"["+I+(T[($-20)%10]||T[$]||T[0])+"]"}},A=function(I,T,$){var W=String(I);return!W||W.length>=T?I:""+Array(T+1-W.length).join($)+I},w={s:A,z:function(I){var T=-I.utcOffset(),$=Math.abs(T),W=Math.floor($/60),q=$%60;return(T<=0?"+":"-")+A(W,2,"0")+":"+A(q,2,"0")},m:function I(T,$){if(T.date()<$.date())return-I($,T);var W=12*($.year()-T.year())+($.month()-T.month()),q=T.clone().add(W,h),ne=$-q<0,S=T.clone().add(W+(ne?-1:1),h);return+(-(W+($-q)/(ne?q-S:S-q))||0)},a:function(I){return I<0?Math.ceil(I)||0:Math.floor(I)},p:function(I){return{M:h,y:p,w:f,d,D:c,h:o,m:u,s,ms:i,Q:g}[I]||String(I||"").toLowerCase().replace(/s$/,"")},u:function(I){return I===void 0}},N="en",F={};F[N]=x;var z="$isDayjsObject",O=function(I){return I instanceof D||!(!I||!I[z])},L=function I(T,$,W){var q;if(!T)return N;if(typeof T=="string"){var ne=T.toLowerCase();F[ne]&&(q=ne),$&&(F[ne]=$,q=ne);var S=T.split("-");if(!q&&S.length>1)return I(S[0])}else{var pe=T.name;F[pe]=T,q=pe}return!W&&q&&(N=q),q||!W&&N},H=function(I,T){if(O(I))return I.clone();var $=typeof T=="object"?T:{};return $.date=I,$.args=arguments,new D($)},y=w;y.l=L,y.i=O,y.w=function(I,T){return H(I,{locale:T.$L,utc:T.$u,x:T.$x,$offset:T.$offset})};var D=function(){function I($){this.$L=L($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[z]=!0}var T=I.prototype;return T.parse=function($){this.$d=function(W){var q=W.date,ne=W.utc;if(q===null)return new Date(NaN);if(y.u(q))return new Date;if(q instanceof Date)return new Date(q);if(typeof q=="string"&&!/Z$/i.test(q)){var S=q.match(b);if(S){var pe=S[2]-1||0,ce=(S[7]||"0").substring(0,3);return ne?new Date(Date.UTC(S[1],pe,S[3]||1,S[4]||0,S[5]||0,S[6]||0,ce)):new Date(S[1],pe,S[3]||1,S[4]||0,S[5]||0,S[6]||0,ce)}}return new Date(q)}($),this.init()},T.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},T.$utils=function(){return y},T.isValid=function(){return this.$d.toString()!==E},T.isSame=function($,W){var q=H($);return this.startOf(W)<=q&&q<=this.endOf(W)},T.isAfter=function($,W){return H($)<this.startOf(W)},T.isBefore=function($,W){return this.endOf(W)<H($)},T.$g=function($,W,q){return y.u($)?this[W]:this.set(q,$)},T.unix=function(){return Math.floor(this.valueOf()/1e3)},T.valueOf=function(){return this.$d.getTime()},T.startOf=function($,W){var q=this,ne=!!y.u(W)||W,S=y.p($),pe=function(Pe,Le){var ze=y.w(q.$u?Date.UTC(q.$y,Le,Pe):new Date(q.$y,Le,Pe),q);return ne?ze:ze.endOf(d)},ce=function(Pe,Le){return y.w(q.toDate()[Pe].apply(q.toDate("s"),(ne?[0,0,0,0]:[23,59,59,999]).slice(Le)),q)},k=this.$W,ye=this.$M,Se=this.$D,_e="set"+(this.$u?"UTC":"");switch(S){case p:return ne?pe(1,0):pe(31,11);case h:return ne?pe(1,ye):pe(0,ye+1);case f:var ge=this.$locale().weekStart||0,ke=(k<ge?k+7:k)-ge;return pe(ne?Se-ke:Se+(6-ke),ye);case d:case c:return ce(_e+"Hours",0);case o:return ce(_e+"Minutes",1);case u:return ce(_e+"Seconds",2);case s:return ce(_e+"Milliseconds",3);default:return this.clone()}},T.endOf=function($){return this.startOf($,!1)},T.$set=function($,W){var q,ne=y.p($),S="set"+(this.$u?"UTC":""),pe=(q={},q[d]=S+"Date",q[c]=S+"Date",q[h]=S+"Month",q[p]=S+"FullYear",q[o]=S+"Hours",q[u]=S+"Minutes",q[s]=S+"Seconds",q[i]=S+"Milliseconds",q)[ne],ce=ne===d?this.$D+(W-this.$W):W;if(ne===h||ne===p){var k=this.clone().set(c,1);k.$d[pe](ce),k.init(),this.$d=k.set(c,Math.min(this.$D,k.daysInMonth())).$d}else pe&&this.$d[pe](ce);return this.init(),this},T.set=function($,W){return this.clone().$set($,W)},T.get=function($){return this[y.p($)]()},T.add=function($,W){var q,ne=this;$=Number($);var S=y.p(W),pe=function(ye){var Se=H(ne);return y.w(Se.date(Se.date()+Math.round(ye*$)),ne)};if(S===h)return this.set(h,this.$M+$);if(S===p)return this.set(p,this.$y+$);if(S===d)return pe(1);if(S===f)return pe(7);var ce=(q={},q[u]=r,q[o]=a,q[s]=n,q)[S]||1,k=this.$d.getTime()+$*ce;return y.w(k,this)},T.subtract=function($,W){return this.add(-1*$,W)},T.format=function($){var W=this,q=this.$locale();if(!this.isValid())return q.invalidDate||E;var ne=$||"YYYY-MM-DDTHH:mm:ssZ",S=y.z(this),pe=this.$H,ce=this.$m,k=this.$M,ye=q.weekdays,Se=q.months,_e=q.meridiem,ge=function(Le,ze,rt,Ct){return Le&&(Le[ze]||Le(W,ne))||rt[ze].slice(0,Ct)},ke=function(Le){return y.s(pe%12||12,Le,"0")},Pe=_e||function(Le,ze,rt){var Ct=Le<12?"AM":"PM";return rt?Ct.toLowerCase():Ct};return ne.replace(m,function(Le,ze){return ze||function(rt){switch(rt){case"YY":return String(W.$y).slice(-2);case"YYYY":return y.s(W.$y,4,"0");case"M":return k+1;case"MM":return y.s(k+1,2,"0");case"MMM":return ge(q.monthsShort,k,Se,3);case"MMMM":return ge(Se,k);case"D":return W.$D;case"DD":return y.s(W.$D,2,"0");case"d":return String(W.$W);case"dd":return ge(q.weekdaysMin,W.$W,ye,2);case"ddd":return ge(q.weekdaysShort,W.$W,ye,3);case"dddd":return ye[W.$W];case"H":return String(pe);case"HH":return y.s(pe,2,"0");case"h":return ke(1);case"hh":return ke(2);case"a":return Pe(pe,ce,!0);case"A":return Pe(pe,ce,!1);case"m":return String(ce);case"mm":return y.s(ce,2,"0");case"s":return String(W.$s);case"ss":return y.s(W.$s,2,"0");case"SSS":return y.s(W.$ms,3,"0");case"Z":return S}return null}(Le)||S.replace(":","")})},T.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},T.diff=function($,W,q){var ne,S=this,pe=y.p(W),ce=H($),k=(ce.utcOffset()-this.utcOffset())*r,ye=this-ce,Se=function(){return y.m(S,ce)};switch(pe){case p:ne=Se()/12;break;case h:ne=Se();break;case g:ne=Se()/3;break;case f:ne=(ye-k)/6048e5;break;case d:ne=(ye-k)/864e5;break;case o:ne=ye/a;break;case u:ne=ye/r;break;case s:ne=ye/n;break;default:ne=ye}return q?ne:y.a(ne)},T.daysInMonth=function(){return this.endOf(h).$D},T.$locale=function(){return F[this.$L]},T.locale=function($,W){if(!$)return this.$L;var q=this.clone(),ne=L($,W,!0);return ne&&(q.$L=ne),q},T.clone=function(){return y.w(this.$d,this)},T.toDate=function(){return new Date(this.valueOf())},T.toJSON=function(){return this.isValid()?this.toISOString():null},T.toISOString=function(){return this.$d.toISOString()},T.toString=function(){return this.$d.toUTCString()},I}(),U=D.prototype;return H.prototype=U,[["$ms",i],["$s",s],["$m",u],["$H",o],["$W",d],["$M",h],["$y",p],["$D",c]].forEach(function(I){U[I[1]]=function(T){return this.$g(T,I[0],I[1])}}),H.extend=function(I,T){return I.$i||(I(T,D,H),I.$i=!0),H},H.locale=L,H.isDayjs=O,H.unix=function(I){return H(1e3*I)},H.en=F[N],H.Ls=F,H.p={},H})}(Ir)),Ir.exports}var hE=Bu();const Nr=Jr(hE);var kr={exports:{}},mE=kr.exports,Fu;function gE(){return Fu||(Fu=1,function(e,t){(function(n,r){e.exports=r(Bu())})(mE,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var a=r(n),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s,u){return u==="W"?s+"周":s+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(s,u){var o=100*s+u;return o<600?"凌晨":o<900?"早上":o<1100?"上午":o<1300?"中午":o<1800?"下午":"晚上"}};return a.default.locale(i,null,!0),i})}(kr)),kr.exports}gE();function Yn(e){"@babel/helpers - typeof";return Yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(e)}function EE(e,t){if(Yn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bE(e){var t=EE(e,"string");return Yn(t)=="symbol"?t:t+""}function TE(e,t,n){return(t=bE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Uu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hu(Object(n),!0).forEach(function(r){TE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var yE={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},xE=Uu(Uu({},yE),{},{locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",week:"周",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪",yearFormat:"YYYY年",cellDateFormat:"D",monthBeforeYear:!1});const AE={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},$u={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},xE),timePickerLocale:Object.assign({},AE)};$u.lang.ok="确定",Nr.locale("zh-cn");const{RangePicker:CE}=xe.DatePicker,SE=({host:e,onChange:t})=>{const n=e.dataset.key,r=e.dataset.value,a=e.dataset.placeholder,i=e.dataset.limitRange?parseInt(e.dataset.limitRange,10):void 0,s=e.dataset.disableFuture==="true",[u,o]=R.useState(()=>{if(!r)return null;const E=r.split(",");return E.length===2&&E[0]&&E[1]?[Nr(E[0]),Nr(E[1])]:null}),[d,f]=R.useState(null),h=E=>E?s&&E.isAfter(Nr(),"day")?!0:!i||!d||!d[0]?!1:Math.abs(E.diff(d[0],"days"))>i:!1,g=E=>{console.log("[DatePicker] onCalendarChange",E?.map(b=>b?.format("YYYY-MM-DD")||null)),f(E)},p=E=>{if(console.log("[DatePicker] onChange",E?.map(b=>b?.format("YYYY-MM-DD")||null)),o(E),f(null),E&&E[0]&&E[1]){const b=`${E[0].format("YYYY-MM-DD")},${E[1].format("YYYY-MM-DD")}`;e.setAttribute("data-value",b),t(n,b)}else e.setAttribute("data-value",""),t(n,"")},c=E=>{console.log("[DatePicker] onOpenChange",E),f(E?u:null)};return Mr.createPortal(G.jsx("div",{className:"rte-datepicker-wrapper",contentEditable:!1,style:{display:"inline-block",verticalAlign:"middle",width:"260px",marginLeft:"4px",marginRight:"4px",fontSize:"16px",height:"30px",lineHeight:"30px"},children:G.jsx(CE,{value:u,disabledDate:h,onCalendarChange:g,onChange:p,onOpenChange:c,placeholder:[a||"开始日期",a||"结束日期"],style:{width:"100%"},size:"small",allowClear:!0,locale:$u,getPopupContainer:()=>document.body,popupClassName:"rte-datepicker-dropdown"})}),e)},_E=e=>{const[t,n]=R.useState([]);return R.useEffect(()=>{const r=e.current;if(!r)return;const a=()=>{const s=r.querySelectorAll(".rte-datepicker-host"),u=[];s.forEach(o=>{const d=o.getAttribute("data-key");d&&u.push(G.jsx(SE,{host:o,onChange:()=>{if(e.current){const f=new Event("input",{bubbles:!0});e.current.dispatchEvent(f)}}},`datepicker-${d}`))}),n(u)};a();const i=new MutationObserver(s=>{let u=!1;for(const o of s)if(o.type==="childList"){let d=!1;if(o.addedNodes.forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE){const h=f;(h.classList?.contains("rte-datepicker-host")||h.querySelector?.(".rte-datepicker-host"))&&(d=!0)}}),o.removedNodes.forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE){const h=f;(h.classList?.contains("rte-datepicker-host")||h.querySelector?.(".rte-datepicker-host"))&&(d=!0)}}),d){u=!0;break}}u&&a()});return i.observe(r,{childList:!0,subtree:!0}),()=>i.disconnect()},[e]),t},Gn=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),qu=e=>`\`\`\`
21
+ ${(e||"").replace(/\r\n/g,`
4
22
  `)}
5
- \`\`\``,qt=t=>{const f=(t||"").replace(/\r\n/g,`
6
- `).trim(),i=f.match(/^```[a-zA-Z0-9_-]*\n([\s\S]*?)\n```$/);return i?`<pre><code>${He(i[1]||"")}</code></pre>`:`<div style="white-space:pre-wrap;">${He(f)}</div>`},Nt=({config:t,onSend:f,isProcessing:i=!1,disabled:d=!1,width:v,lockStructure:D=!1,agentOptions:P=[],onAgentSelect:B,onAgentExit:M,loading:L=!1,placeholder:q,border:j,background:S="transparent",hideButtons:N,maxHeight:e,minHeight:n,collapsed:s=!1,reportAnalyze:u,markdownAnalyze:E,onCollapsedChange:H,collapseTransitionMs:F=260})=>{const[T,ne]=oe.message.useMessage(),K=c.useRef(null),R=c.useRef(null),G=c.useRef(null),l=c.useRef(null),_=c.useRef(null),U=c.useRef("");if(!U.current){const r=Math.random().toString(36).slice(2,8);U.current=`rte_${r}`}const[V,y]=c.useState({}),[b,x]=c.useState(null),[I,A]=c.useState(null),[X,J]=c.useState(null),[Z,ee]=c.useState(null),se=c.useRef(!1),ie=c.useRef(null),[ue,he]=c.useState(!1),re=c.useRef(null),[me,ge]=c.useState(!0),be=c.useRef(0),[ke,qe]=c.useState(58),[Ie,Ln]=c.useState(58),[In,tt]=c.useState(!1),[je,Ve]=c.useState({}),nt=c.useRef(()=>{}),[$e,Ee]=c.useState({}),We=c.useRef(()=>{}),Vt=c.useRef({}),rt=c.useRef($e);c.useEffect(()=>{rt.current=$e},[$e]);const[Ce,Ae]=c.useState(()=>{const r={};return t.forEach(a=>{a.type==="multi-variable"&&a.key&&(r[a.key]=1)}),r}),at=c.useRef({}),Ot=c.useRef({}),Ft=c.useRef({});c.useEffect(()=>{Ot.current=V},[V]),c.useEffect(()=>{Ft.current=Ce},[Ce]);const ot=c.useCallback(r=>r.find(o=>o.type==="tag")?.text||null,[]),Gt=c.useRef(t),Ne=c.useRef(null);c.useEffect(()=>{const r=ot(Gt.current),a=ot(t);if(r&&r!==a&&l.current){const o={};l.current.querySelectorAll('[data-type="variable"]').forEach(p=>{const O=p.dataset.key;if(O){const C=p.innerText.replace(/[\u200B\n]/g,"").trim();C&&(o[O]=C)}}),l.current.querySelectorAll('[data-type="select"]').forEach(p=>{const O=p.dataset.key;if(O){const C=(p.getAttribute("data-value")||"").trim();C&&(o[O]=C)}}),l.current.querySelectorAll('[data-type="textarea"]').forEach(p=>{const O=p.dataset.key;if(O){const C=p.value.replace(/[\u200B]/g,"").trim();C&&(o[O]=C)}}),at.current[r]={variableValues:o,files:{...Ot.current},multiVariableCounts:{...Ft.current}}}if(a&&at.current[a]){const o=at.current[a];Ne.current=o,y(o.files),Ae(o.multiVariableCounts)}else if(a){Ne.current=null;const o={};t.forEach(m=>{m.type==="multi-variable"&&m.key&&(o[m.key]=1)}),Ae(o),y({})}else Ne.current=null,Ae({}),y({});Gt.current=t},[t,ot]),c.useLayoutEffect(()=>{Ne.current&&l.current&&(l.current.__tempVariableValues=Ne.current.variableValues,setTimeout(()=>{Ne.current&&(Ne.current=null)},0))});const xe=c.useMemo(()=>{if(t.length===0)return t;const r=[];for(const a of t){if(a.type==="markdown"&&a.key==="tableData"||r.push(a),a.type==="report-url"&&a.key){const o=je[a.key],m=o?.status??"idle",h=o?.modules??[];m==="loading"&&r.push({type:"text",className:"rte-report-parsing",text:`解析中...
7
- `}),m==="error"&&o?.error&&r.push({type:"text",className:"rte-report-error",text:`解析失败:${He(o.error)}
8
- `}),h.length>0&&(h.forEach((k,p)=>{r.push({type:"report-module",key:a.key,moduleIndex:p,placeholder:"可编辑,内容不能为空",required:!0,minHeight:80,maxHeight:260,text:k.content})}),r.push({type:"text",text:`
9
- `}))}if(a.type==="markdown"&&a.key){const o=$e[a.key],m=o?.status??"idle",h=o?.modules??[];a.key==="tableData"?m==="loading"?(r.push({type:"text",className:"rte-markdown-parsing",text:"解析中..."}),r.push({type:"text",text:`
10
- `})):m==="success"&&h.length>0?h.forEach((p,O)=>{r.push({type:"markdown-module",key:a.key,moduleIndex:O,placeholder:"可编辑,内容不能为空",required:!0,minHeight:80,maxHeight:260,text:p.content})}):(r.push(a),m==="error"&&o?.error&&r.push({type:"text",className:"rte-markdown-error",text:`解析失败:${He(o.error)}
11
- `}),r.push({type:"text",text:`
12
- `})):(m==="loading"?r.push({type:"text",className:"rte-markdown-parsing",text:`解析中...
13
- `}):m==="error"&&o?.error&&r.push({type:"text",className:"rte-markdown-error",text:`解析失败:${He(o.error)}
14
- `}),h.length>0&&m!=="loading"&&h.forEach((p,O)=>{r.push({type:"markdown-module",key:a.key,moduleIndex:O,placeholder:"可编辑,内容不能为空",required:!0,minHeight:80,maxHeight:260,text:p.content})}),m!=="loading"&&r.push({type:"text",text:`
15
- `}))}}return r},[t,$e,je]),zt=c.useCallback(r=>{const a=r.trim();if(!a)return{url:""};let o=null;try{o=new URL(a)}catch{try{o=new URL(`https://${a}`)}catch{return{url:a}}}const m=o.pathname.split("/").filter(Boolean),h=m.findIndex(C=>C==="report"),k=h>=0?m[h+1]:void 0,p=m[0]&&m[0].length<=5?m[0]:void 0,O=o.searchParams.get("agentId")||void 0;return{url:a,reportId:k,agentId:O,lang:p}},[]),Oe=c.useCallback(()=>{const r={};if(!l.current)return r;const a=l.current;return a.querySelectorAll('[data-type="variable"]').forEach(o=>{const m=o.dataset.key;if(!m)return;const h=o.innerText.replace(/[\u200B\n]/g,"").trim();h&&(r[m]=h)}),a.querySelectorAll('[data-type="select"]').forEach(o=>{const m=o.dataset.key;if(!m)return;const h=(o.getAttribute("data-value")||"").trim();h&&(r[m]=h)}),a.querySelectorAll('[data-type="textarea"]').forEach(o=>{const m=o.dataset.key;if(!m)return;const h=o.value.replace(/[\u200B]/g,"").trim();h&&(r[m]=h)}),a.querySelectorAll('[data-type="richtext"]').forEach(o=>{const m=o.dataset.key;if(!m)return;const h=o.getAttribute("data-node-type")||"";if(h==="report-module"||h==="markdown-module"){const p=Number.parseInt(o.getAttribute("data-module-index")||"0",10),O=(o.innerHTML||"").replace(/[\u200B]/g,"").trim();r[`${m}__module_${Number.isFinite(p)?p:0}`]=O;return}const k=(o.textContent||"").replace(/[\u200B]/g,"").trim();k&&(r[m]=k)}),a.querySelectorAll('[data-type="datepicker"]').forEach(o=>{const m=o.dataset.key;if(!m)return;const h=(o.getAttribute("data-value")||"").trim();h&&(r[m]=h)}),a.querySelectorAll('[data-type="number-input"]').forEach(o=>{const m=o.dataset.key;if(!m)return;const h=(o.value||"").trim();h&&(r[m]=h)}),r},[]),jt=c.useCallback(r=>(r?.modules||[]).map((a,o)=>{const m=(a?.title||`模块${o+1}`).trim()||`模块${o+1}`,h=(a?.content||"").trim();return{title:m,content:h.length>0?h:`请补充:${m}`}}),[]),st=c.useCallback(r=>(r?.modules||[]).map((a,o)=>{const m=(a?.title||`模块${o+1}`).trim()||`模块${o+1}`,h=(a?.markdown||"").trim(),k=(a?.content||"").trim()||(h?qt(h):"");return{title:m,content:k.length>0?k:`请补充:${m}`,markdown:h}}),[]),Wt=c.useCallback((r,a)=>{const o=(a||"").trim();if(!r)return;if(!o){Ve(p=>({...p,[r]:{status:"idle",modules:[],lastParsedUrl:void 0,error:void 0}}));return}const m=je[r];if(m?.lastParsedUrl&&m.lastParsedUrl===o&&m.status==="loading")return;Ve(p=>({...p,[r]:{...p[r],status:"loading",error:void 0,lastParsedUrl:o}}));const h=zt(o);(u||(async p=>({modules:[{title:"第1张:人群+场景直击图",content:`视觉要求:养宠人在客厅场景中,宠物(猫/狗)自然趴在旁;画面聚焦“人+宠+整洁氛围”。
16
- (reportId=${p.reportId||"unknown"}, agentId=${p.agentId||"1"})`},{title:"第2张:痛点放大对比图",content:"左侧:杂乱堆放、难清理;右侧:分区收纳、拿取方便。文案≤15字,绑定人群+场景+需求。"}]})))(h).then(p=>{const O=jt(p);if(l.current){const C=Oe();O.forEach(($,z)=>{C[`${r}__module_${z}`]=$.content}),l.current.__tempVariableValues=C}Ve(C=>({...C,[r]:{status:"success",error:void 0,lastParsedUrl:o,modules:O}}))}).catch(p=>{const O=p instanceof Error?p.message:String(p);Ve(C=>({...C,[r]:{...C[r]||{modules:[]},status:"error",error:O||"解析失败",lastParsedUrl:o,modules:[]}}))})},[Oe,jt,zt,u,je]),Yt=c.useCallback((r,a)=>{const o=(a||"").trim();if(!r)return;if(!o){Ee(C=>({...C,[r]:{status:"idle",modules:[],lastParsedText:void 0,error:void 0}}));return}const m=$e[r];if(m?.lastParsedText&&m.lastParsedText===o&&m.status==="success")return;if(!E){const C=At(o),$=st({modules:[{title:"内容",content:qt(C),markdown:C}]});if(l.current){const z=Oe();$.forEach((g,Y)=>{z[`${r}__module_${Y}`]=g.content}),l.current.__tempVariableValues=z}Ee(z=>({...z,[r]:{status:"success",error:void 0,lastParsedText:o,modules:$}}));return}const h=rt.current[r]?.status==="loading";h||Ee(C=>({...C,[r]:{...C[r],status:"loading",error:void 0,lastParsedText:o}}));const k=500,p=Date.now();setTimeout(()=>{E({text:o}).then($=>{const z=st($),g=Date.now()-p,Y=Math.max(0,k-g);setTimeout(()=>{if(l.current){const Q=Oe();z.forEach((W,te)=>{Q[`${r}__module_${te}`]=W.content}),l.current.__tempVariableValues=Q}Ee(Q=>({...Q,[r]:{status:"success",error:void 0,lastParsedText:o,modules:z}}))},Y)}).catch($=>{const z=$ instanceof Error?$.message:String($);Ee(g=>({...g,[r]:{...g[r]||{modules:[]},status:"error",error:z,lastParsedText:o}}))})},h?0:50)},[Oe,E,$e,st]);c.useEffect(()=>{nt.current=Wt},[Wt]),c.useEffect(()=>{We.current=Yt},[Yt]),c.useLayoutEffect(()=>{if(!l.current)return;const r=new Map,a=window.setTimeout(()=>{if(!l.current)return;r.forEach((h,k)=>k.removeEventListener("blur",h,!1)),r.clear();const o=l.current.querySelectorAll('[data-type="variable"][data-node-type="report-url"], [data-type="variable"][data-node-type="markdown"]'),m=h=>{h.stopPropagation(),h.stopImmediatePropagation();const k=h.target?.closest('[data-type="variable"][data-node-type="report-url"], [data-type="variable"][data-node-type="markdown"]');if(!k||!l.current||!l.current.contains(k))return;const p=k.dataset.key;if(!p)return;const O=k.innerText.replace(/[\u200B\n]/g,"").trim(),C=k.getAttribute("data-node-type")||"";C==="report-url"?nt.current(p,O):C==="markdown"&&We.current(p,O)};o.forEach(h=>{h.addEventListener("blur",m,!1),r.set(h,m)})},0);return()=>{window.clearTimeout(a),r.forEach((o,m)=>m.removeEventListener("blur",o,!1)),r.clear()}},[xe]),c.useLayoutEffect(()=>{if(!l.current)return;const r=new Map,a=new Map,o=C=>{const $=C.value||C.placeholder||"",z=window.getComputedStyle(C),g=Number.parseFloat(z.paddingLeft)||0,Y=Number.parseFloat(z.paddingRight)||0,Q=document.createElement("span");Q.style.cssText=`
23
+ \`\`\``,zu=e=>{const t=(e||"").replace(/\r\n/g,`
24
+ `).trim(),n=t.match(/^```[a-zA-Z0-9_-]*\n([\s\S]*?)\n```$/);return n?`<pre><code>${Gn(n[1]||"")}</code></pre>`:`<div style="white-space:pre-wrap;">${Gn(t)}</div>`},Vu={...ln,attributes:{...ln.attributes||{},span:[...(ln.attributes||{}).span||[],"style"],font:[...(ln.attributes||{}).font||[],"color"]}},Yu=()=>e=>{pr(e,t=>{const n=t;if(!n||n.type!=="textDirective"&&n.type!=="leafDirective"&&n.type!=="containerDirective"||n.name!=="color")return;const r=n.attributes||{},a=r.hex??r.color??r.value,i=typeof a=="string"?a.trim():"",s=/^#([0-9a-fA-F]{6})$/.test(i)?i:"#7C3AED",u=r.bold,d=`${u===!0||u==="true"||u===1||u==="1"?"font-weight:700;":""}color:${s};`;n.data=n.data||{},n.data.hName="span",n.data.hProperties={style:d}})},IE=e=>{const t=(e??"").trim();if(!t)return null;if(!(t.startsWith("{")&&t.endsWith("}")))return{kind:"text",text:t};try{const n=JSON.parse(t);if(!n||typeof n!="object")return{kind:"text",text:t};const r=n;return r.type==="steps"&&typeof r.title=="string"&&Array.isArray(r.images)&&Array.isArray(r.stepDescriptions)?{kind:"steps",data:n}:{kind:"text",text:t}}catch{return{kind:"text",text:t}}},Gu=({config:e,onSend:t,isProcessing:n=!1,disabled:r=!1,width:a,lockStructure:i=!1,agentOptions:s=[],onAgentSelect:u,onAgentExit:o,loading:d=!1,placeholder:f,border:h,background:g="transparent",hideButtons:p,maxHeight:c,minHeight:E,collapsed:b=!1,reportAnalyze:m,markdownAnalyze:x,onCollapsedChange:A,collapseTransitionMs:w=260,debugTooltipSticky:N=!1})=>{const[F,z]=xe.message.useMessage(),O=R.useRef(null),L=R.useRef(null),H=R.useRef(null),y=R.useRef(null),D=R.useRef(null),U=R.useRef("");if(!U.current){const P=Math.random().toString(36).slice(2,8);U.current=`rte_${P}`}const[I,T]=R.useState({}),[$,W]=R.useState(null),[q,ne]=R.useState(null),[S,pe]=R.useState(null),[ce,k]=R.useState(null),[ye,Se]=R.useState(0),_e=R.useRef(null),[ge,ke]=R.useState(!1),[Pe,Le]=R.useState(null),ze=R.useRef(!1),rt=R.useRef(null),[Ct,Bt]=R.useState(!1),fn=R.useRef(null),[vr,Gt]=R.useState(!0),wr=R.useRef(0),[jn,Lr]=R.useState(58),[ii,si]=R.useState(58),[oi,Xn]=R.useState(!1),[pn,te]=R.useState({}),de=R.useRef(()=>{}),[me,be]=R.useState({}),we=R.useRef(()=>{}),at=R.useRef({}),ht=R.useRef(me);R.useEffect(()=>{ht.current=me},[me]),R.useEffect(()=>{Se(0),ke(!1)},[ce?.key,ce?.type]),R.useLayoutEffect(()=>{if(ce?.type!=="upload"&&ce?.type!=="tag"&&ce?.type!=="variable"){Le(null);return}const P=requestAnimationFrame(()=>{const M=document.querySelector(".rte-steps-tooltip"),B=document.querySelector(".rte-steps-tooltip-title"),Q=document.querySelector(".rte-steps-tooltip-step-badge");if(!M||!B||!Q)return;const j=window.getComputedStyle(M),X=Number.parseFloat(j.paddingLeft)||0,V=Number.parseFloat(j.paddingRight)||0,re=Math.ceil(B.getBoundingClientRect().width||0),ee=Math.ceil(Q.getBoundingClientRect().width||0),se=re+16+ee+Math.ceil(X+V),K=Math.max(240,Math.floor(window.innerWidth-32));Le(Math.min(se,K))});return()=>cancelAnimationFrame(P)},[ce?.key,ce?.type,ye]),R.useEffect(()=>{if(!N)return;const P=M=>{M.key==="Escape"&&k(null)};return window.addEventListener("keydown",P,!0),()=>window.removeEventListener("keydown",P,!0)},[N]);const[Ve,it]=R.useState(()=>{const P={};return e.forEach(M=>{M.type==="multi-variable"&&M.key&&(P[M.key]=1)}),P}),St=R.useRef({}),Qe=R.useRef({}),_t=R.useRef({});R.useEffect(()=>{Qe.current=I},[I]),R.useEffect(()=>{_t.current=Ve},[Ve]);const lt=R.useCallback(P=>P.find(B=>B.type==="tag")?.text||null,[]),tl=R.useRef(e),Wt=R.useRef(null);R.useEffect(()=>{const P=lt(tl.current),M=lt(e);if(P&&P!==M&&y.current){const B={};y.current.querySelectorAll('[data-type="variable"]').forEach(V=>{const re=V.dataset.key;if(re){const ee=V.innerText.replace(/[\u200B\n]/g,"").trim();ee&&(B[re]=ee)}}),y.current.querySelectorAll('[data-type="select"]').forEach(V=>{const re=V.dataset.key;if(re){const ee=(V.getAttribute("data-value")||"").trim();ee&&(B[re]=ee)}}),y.current.querySelectorAll('[data-type="textarea"]').forEach(V=>{const re=V.dataset.key;if(re){const ee=V.value.replace(/[\u200B]/g,"").trim();ee&&(B[re]=ee)}}),St.current[P]={variableValues:B,files:{...Qe.current},multiVariableCounts:{..._t.current}}}if(M&&St.current[M]){const B=St.current[M];Wt.current=B,T(B.files),it(B.multiVariableCounts)}else if(M){Wt.current=null;const B={};e.forEach(Q=>{Q.type==="multi-variable"&&Q.key&&(B[Q.key]=1)}),it(B),T({})}else Wt.current=null,it({}),T({});tl.current=e},[e,lt]),R.useLayoutEffect(()=>{Wt.current&&y.current&&(y.current.__tempVariableValues=Wt.current.variableValues,setTimeout(()=>{Wt.current&&(Wt.current=null)},0))});const Je=R.useMemo(()=>{if(e.length===0)return e;const P=[];for(const M of e){if(M.type==="markdown"&&M.key==="tableData"||P.push(M),M.type==="report-url"&&M.key){const B=pn[M.key],Q=B?.status??"idle",j=B?.modules??[];Q==="loading"&&P.push({type:"text",className:"rte-report-parsing",text:`解析中...
25
+ `}),Q==="error"&&B?.error&&P.push({type:"text",className:"rte-report-error",text:`解析失败:${Gn(B.error)}
26
+ `}),j.length>0&&(j.forEach((X,V)=>{P.push({type:"report-module",key:M.key,moduleIndex:V,placeholder:"可编辑,内容不能为空",required:!0,minHeight:80,maxHeight:260,text:X.content})}),P.push({type:"text",text:`
27
+ `}))}if(M.type==="markdown"&&M.key){const B=me[M.key],Q=B?.status??"idle",j=B?.modules??[];M.key==="tableData"?Q==="loading"?(P.push({type:"text",className:"rte-markdown-parsing",text:"解析中..."}),P.push({type:"text",text:`
28
+ `})):Q==="success"&&j.length>0?j.forEach((V,re)=>{P.push({type:"markdown-module",key:M.key,moduleIndex:re,placeholder:"可编辑,内容不能为空",required:!0,minHeight:80,maxHeight:260,text:V.content})}):(P.push(M),Q==="error"&&B?.error&&P.push({type:"text",className:"rte-markdown-error",text:`解析失败:${Gn(B.error)}
29
+ `}),P.push({type:"text",text:`
30
+ `})):(Q==="loading"?P.push({type:"text",className:"rte-markdown-parsing",text:`解析中...
31
+ `}):Q==="error"&&B?.error&&P.push({type:"text",className:"rte-markdown-error",text:`解析失败:${Gn(B.error)}
32
+ `}),j.length>0&&Q!=="loading"&&j.forEach((V,re)=>{P.push({type:"markdown-module",key:M.key,moduleIndex:re,placeholder:"可编辑,内容不能为空",required:!0,minHeight:80,maxHeight:260,text:V.content})}),Q!=="loading"&&P.push({type:"text",text:`
33
+ `}))}}return P},[e,me,pn]),nl=R.useCallback(P=>{const M=P.trim();if(!M)return{url:""};let B=null;try{B=new URL(M)}catch{try{B=new URL(`https://${M}`)}catch{return{url:M}}}const Q=B.pathname.split("/").filter(Boolean),j=Q.findIndex(ee=>ee==="report"),X=j>=0?Q[j+1]:void 0,V=Q[0]&&Q[0].length<=5?Q[0]:void 0,re=B.searchParams.get("agentId")||void 0;return{url:M,reportId:X,agentId:re,lang:V}},[]),Kn=R.useCallback(()=>{const P={};if(!y.current)return P;const M=y.current;return M.querySelectorAll('[data-type="variable"]').forEach(B=>{const Q=B.dataset.key;if(!Q)return;const j=B.innerText.replace(/[\u200B\n]/g,"").trim();j&&(P[Q]=j)}),M.querySelectorAll('[data-type="select"]').forEach(B=>{const Q=B.dataset.key;if(!Q)return;const j=(B.getAttribute("data-value")||"").trim();j&&(P[Q]=j)}),M.querySelectorAll('[data-type="textarea"]').forEach(B=>{const Q=B.dataset.key;if(!Q)return;const j=B.value.replace(/[\u200B]/g,"").trim();j&&(P[Q]=j)}),M.querySelectorAll('[data-type="richtext"]').forEach(B=>{const Q=B.dataset.key;if(!Q)return;const j=B.getAttribute("data-node-type")||"";if(j==="report-module"||j==="markdown-module"){const V=Number.parseInt(B.getAttribute("data-module-index")||"0",10),re=(B.innerHTML||"").replace(/[\u200B]/g,"").trim();P[`${Q}__module_${Number.isFinite(V)?V:0}`]=re;return}const X=(B.textContent||"").replace(/[\u200B]/g,"").trim();X&&(P[Q]=X)}),M.querySelectorAll('[data-type="datepicker"]').forEach(B=>{const Q=B.dataset.key;if(!Q)return;const j=(B.getAttribute("data-value")||"").trim();j&&(P[Q]=j)}),M.querySelectorAll('[data-type="number-input"]').forEach(B=>{const Q=B.dataset.key;if(!Q)return;const j=(B.value||"").trim();j&&(P[Q]=j)}),P},[]),rl=R.useCallback(P=>(P?.modules||[]).map((M,B)=>{const Q=(M?.title||`模块${B+1}`).trim()||`模块${B+1}`,j=(M?.content||"").trim();return{title:Q,content:j.length>0?j:`请补充:${Q}`}}),[]),ui=R.useCallback(P=>(P?.modules||[]).map((M,B)=>{const Q=(M?.title||`模块${B+1}`).trim()||`模块${B+1}`,j=(M?.markdown||"").trim(),X=(M?.content||"").trim()||(j?zu(j):"");return{title:Q,content:X.length>0?X:`请补充:${Q}`,markdown:j}}),[]),al=R.useCallback((P,M)=>{const B=(M||"").trim();if(!P)return;if(!B){te(V=>({...V,[P]:{status:"idle",modules:[],lastParsedUrl:void 0,error:void 0}}));return}const Q=pn[P];if(Q?.lastParsedUrl&&Q.lastParsedUrl===B&&Q.status==="loading")return;te(V=>({...V,[P]:{...V[P],status:"loading",error:void 0,lastParsedUrl:B}}));const j=nl(B);(m||(async V=>({modules:[{title:"第1张:人群+场景直击图",content:`视觉要求:养宠人在客厅场景中,宠物(猫/狗)自然趴在旁;画面聚焦“人+宠+整洁氛围”。
34
+ (reportId=${V.reportId||"unknown"}, agentId=${V.agentId||"1"})`},{title:"第2张:痛点放大对比图",content:"左侧:杂乱堆放、难清理;右侧:分区收纳、拿取方便。文案≤15字,绑定人群+场景+需求。"}]})))(j).then(V=>{const re=rl(V);if(y.current){const ee=Kn();re.forEach((J,se)=>{ee[`${P}__module_${se}`]=J.content}),y.current.__tempVariableValues=ee}te(ee=>({...ee,[P]:{status:"success",error:void 0,lastParsedUrl:B,modules:re}}))}).catch(V=>{const re=V instanceof Error?V.message:String(V);te(ee=>({...ee,[P]:{...ee[P]||{modules:[]},status:"error",error:re||"解析失败",lastParsedUrl:B,modules:[]}}))})},[Kn,rl,nl,m,pn]),il=R.useCallback((P,M)=>{const B=(M||"").trim();if(!P)return;if(!B){be(ee=>({...ee,[P]:{status:"idle",modules:[],lastParsedText:void 0,error:void 0}}));return}const Q=me[P];if(Q?.lastParsedText&&Q.lastParsedText===B&&Q.status==="success")return;if(!x){const ee=qu(B),J=ui({modules:[{title:"内容",content:zu(ee),markdown:ee}]});if(y.current){const se=Kn();J.forEach((K,ae)=>{se[`${P}__module_${ae}`]=K.content}),y.current.__tempVariableValues=se}be(se=>({...se,[P]:{status:"success",error:void 0,lastParsedText:B,modules:J}}));return}const j=ht.current[P]?.status==="loading";j||be(ee=>({...ee,[P]:{...ee[P],status:"loading",error:void 0,lastParsedText:B}}));const X=500,V=Date.now();setTimeout(()=>{x({text:B}).then(J=>{const se=ui(J),K=Date.now()-V,ae=Math.max(0,X-K);setTimeout(()=>{if(y.current){const fe=Kn();se.forEach((ue,Ee)=>{fe[`${P}__module_${Ee}`]=ue.content}),y.current.__tempVariableValues=fe}be(fe=>({...fe,[P]:{status:"success",error:void 0,lastParsedText:B,modules:se}}))},ae)}).catch(J=>{const se=J instanceof Error?J.message:String(J);be(K=>({...K,[P]:{...K[P]||{modules:[]},status:"error",error:se,lastParsedText:B}}))})},j?0:50)},[Kn,x,me,ui]);R.useEffect(()=>{de.current=al},[al]),R.useEffect(()=>{we.current=il},[il]),R.useLayoutEffect(()=>{if(!y.current)return;const P=new Map,M=window.setTimeout(()=>{if(!y.current)return;P.forEach((j,X)=>X.removeEventListener("blur",j,!1)),P.clear();const B=y.current.querySelectorAll('[data-type="variable"][data-node-type="report-url"], [data-type="variable"][data-node-type="markdown"]'),Q=j=>{j.stopPropagation(),j.stopImmediatePropagation();const X=j.target?.closest('[data-type="variable"][data-node-type="report-url"], [data-type="variable"][data-node-type="markdown"]');if(!X||!y.current||!y.current.contains(X))return;const V=X.dataset.key;if(!V)return;const re=X.innerText.replace(/[\u200B\n]/g,"").trim(),ee=X.getAttribute("data-node-type")||"";ee==="report-url"?de.current(V,re):ee==="markdown"&&we.current(V,re)};B.forEach(j=>{j.addEventListener("blur",Q,!1),P.set(j,Q)})},0);return()=>{window.clearTimeout(M),P.forEach((B,Q)=>Q.removeEventListener("blur",B,!1)),P.clear()}},[Je]),R.useLayoutEffect(()=>{if(!y.current)return;const P=new Map,M=new Map,B=ee=>{const J=ee.value||ee.placeholder||"",se=window.getComputedStyle(ee),K=Number.parseFloat(se.paddingLeft)||0,ae=Number.parseFloat(se.paddingRight)||0,fe=document.createElement("span");fe.style.cssText=`
17
35
  position: absolute;
18
36
  visibility: hidden;
19
37
  white-space: nowrap;
20
- font-size: ${z.fontSize||"16px"};
21
- font-family: ${z.fontFamily||"inherit"};
22
- font-weight: ${z.fontWeight||"inherit"};
23
- letter-spacing: ${z.letterSpacing||"normal"};
24
- padding-left: ${g}px;
25
- padding-right: ${Y}px;
26
- `,Q.textContent=$||"0",document.body.appendChild(Q);const W=Math.max(44,Math.min(600,Q.offsetWidth+8));return document.body.removeChild(Q),W},m=C=>{const $=C.target;if(!$)return;let z=$.value;if(z=z.replace(/[^\d]/g,""),z!==""&&z!=="0"){const g=parseInt(z,10);if(Number.isNaN(g))$.value="";else{const Y=$.getAttribute("min"),Q=$.getAttribute("max"),W=Y!==null?parseInt(Y,10):0,te=Q!==null?parseInt(Q,10):1/0,ae=Math.min(Math.max(g,W),te);$.value=String(ae)}}else if(z==="0"){const g=$.getAttribute("min");0<(g!==null?parseInt(g,10):0)?$.value="":$.value="0"}$.style.width=`${o($)}px`},h=C=>{const $=C.key;($==="-"||$==="."||$===","||$==="e"||$==="E"||$==="+"||$==="="||$===" ")&&C.preventDefault()},k=()=>{if(!l.current)return;l.current.querySelectorAll('[data-type="number-input"]').forEach($=>{const z=$.style.width,g=`${o($)}px`;z!==g&&($.style.width=g),r.has($)||($.addEventListener("input",m,!1),$.addEventListener("keydown",h,!1),r.set($,m),a.set($,h))})},p=window.setTimeout(()=>{k()},0),O=new MutationObserver(C=>{let $=!1;C.forEach(z=>{z.type==="childList"&&z.addedNodes.forEach(g=>{if(g.nodeType===Node.ELEMENT_NODE){const Y=g;Y.matches&&(Y.matches('[data-type="number-input"]')||Y.querySelector('[data-type="number-input"]'))&&($=!0)}})}),$&&setTimeout(k,10)});return l.current&&O.observe(l.current,{childList:!0,subtree:!0}),()=>{window.clearTimeout(p),O.disconnect(),r.forEach((C,$)=>{$.removeEventListener("input",C,!1)}),r.clear(),a.forEach((C,$)=>{$.removeEventListener("keydown",C,!1)}),a.clear()}},[xe]),en(l,xe,V,D,Ce,re,void 0,N),tn(l,xe,V,ee),nn(l,xe,ee,N),an(l,xe,V,ee),rn(l,xe,ee),on(l,xe,V,he),sn(l,se);const lt=Zt(l);c.useEffect(()=>{if(!l.current)return;l.current.querySelectorAll(".rte-richtext-toggle").forEach(a=>{const o=a.getAttribute("data-expanded")==="true";a.innerHTML=o?'<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>':'<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>'})},[xe,l]);const it=wn(l),ct=c.useCallback(()=>{const r=G.current;if(!r)return;const a=Math.max(0,Math.ceil(r.scrollHeight||0));!Number.isFinite(a)||a<=0||Ln(o=>o===a?o:a)},[]);c.useLayoutEffect(()=>{if(!s)return;const r=R.current,a=l.current;if(!(!r||!a))try{const o=window.getComputedStyle(a),m=Number.parseFloat(o.paddingTop)||0,h=Number.parseFloat(o.lineHeight)||34,k=Math.max(0,Math.ceil(m+h)),p=a.getBoundingClientRect(),O=document.createRange();O.selectNodeContents(a);const C=Array.from(O.getClientRects());let $=k>0?k:58;if(C.length>0){const z=Math.min(...C.map(Q=>Q.top)),g=2;let Y=0;for(const Q of C)Math.abs(Q.top-z)<=g&&(Y=Math.max(Y,Q.bottom));if(Y>0){const Q=Math.max(0,Math.ceil(Y-p.top));$=k>0?Math.max(Q,k):Q}}else $=k>0?k:58;if(!Number.isFinite($)||$<=0)return;qe(z=>z===$?z:$)}catch{}},[s,xe,V,Ce,lt.length,it.length]);const Ye=c.useRef({ts:0,contentScrollTop:0,bodyScrollTop:0,editorScrollTop:0});c.useEffect(()=>{if(s)return;const r=R.current,a=G.current,o=l.current;if(!r)return;const m=()=>{Ye.current={ts:Date.now(),contentScrollTop:r.scrollTop||0,bodyScrollTop:a?.scrollTop||0,editorScrollTop:o?.scrollTop||0}};m();const h=()=>{m(),console.log(`[RTE collapse debug][${U.current}] (expanded) content scroll`,Ye.current)},k=()=>{m(),console.log(`[RTE collapse debug][${U.current}] (expanded) body scroll`,Ye.current)};return r.addEventListener("scroll",h,{passive:!0}),a?.addEventListener("scroll",k,{passive:!0}),()=>{r.removeEventListener("scroll",h),a?.removeEventListener("scroll",k)}},[s]),c.useEffect(()=>{if(typeof window>"u")return;const r=U.current,a=window;return a.__rteDebug=a.__rteDebug||{},a.__rteDebug[r]={contentEl:R.current,contentBodyEl:G.current,editorEl:l.current},()=>{a.__rteDebug&&a.__rteDebug[r]&&delete a.__rteDebug[r]}},[]),c.useLayoutEffect(()=>{if(!s)return;const r=R.current,a=G.current,o=l.current;if(!r)return;const m=()=>({content:{scrollTop:r.scrollTop,scrollLeft:r.scrollLeft,scrollHeight:r.scrollHeight,clientHeight:r.clientHeight},body:a?{scrollTop:a.scrollTop,scrollLeft:a.scrollLeft,scrollHeight:a.scrollHeight,clientHeight:a.clientHeight}:void 0,editor:o?{scrollTop:o.scrollTop,scrollLeft:o.scrollLeft,scrollHeight:o.scrollHeight,clientHeight:o.clientHeight}:void 0,style:(()=>{try{const W=window.getComputedStyle(r),te=a?window.getComputedStyle(a):void 0;return{contentOverflow:`${W.overflow}/${W.overflowY}`,bodyOverflow:te?`${te.overflow}/${te.overflowY}`:void 0,bodyMaxHeight:te?.maxHeight,bodyHeight:te?.height}}catch{return}})()}),h=()=>{r.scrollTop=0,r.scrollLeft=0,a&&(a.scrollTop=0,a.scrollLeft=0),o&&(o.scrollTop=0,o.scrollLeft=0)},p=(typeof F=="number"&&Number.isFinite(F)&&F>=0?F:260)+220;console.log(`[RTE collapse debug][${U.current}] pre-collapse lastScrollStateRef`,Ye.current),console.log(`[RTE collapse debug][${U.current}] lock start (before reset)`,m()),h(),console.log(`[RTE collapse debug][${U.current}] lock start (after reset)`,m()),window.requestAnimationFrame(()=>{console.log(`[RTE collapse debug][${U.current}] lock start (after rAF)`,m())});const O=W=>{W.preventDefault(),W.stopPropagation(),h(),console.log(`[RTE collapse debug][${U.current}] prevented scroll event`,{type:W.type},m())},C=()=>console.log(`[RTE collapse debug][${U.current}] content scroll event`,m()),$=()=>console.log(`[RTE collapse debug][${U.current}] body scroll event`,m());r.addEventListener("wheel",O,{passive:!1}),r.addEventListener("touchmove",O,{passive:!1}),r.addEventListener("scroll",C,{passive:!0}),a&&(a.addEventListener("wheel",O,{passive:!1}),a.addEventListener("touchmove",O,{passive:!1}),a.addEventListener("scroll",$,{passive:!0}));const z=performance.now();let g=0;const Y=W=>{h(),W-z<p&&(g=window.requestAnimationFrame(Y))};g=window.requestAnimationFrame(Y);const Q=window.setTimeout(()=>{h(),console.log(`[RTE collapse debug][${U.current}] lock end (after timeout)`,m())},p);return()=>{r.removeEventListener("wheel",O),r.removeEventListener("touchmove",O),r.removeEventListener("scroll",C),a&&(a.removeEventListener("wheel",O),a.removeEventListener("touchmove",O),a.removeEventListener("scroll",$)),window.cancelAnimationFrame(g),window.clearTimeout(Q),console.log(`[RTE collapse debug][${U.current}] lock cleanup`,m())}},[s,F]),c.useEffect(()=>{if(s)return;let r=0;return r=window.requestAnimationFrame(()=>{ct()}),()=>window.cancelAnimationFrame(r)},[s,xe,V,Ce,lt.length,it.length,ct]),c.useEffect(()=>{const r=typeof F=="number"&&Number.isFinite(F)&&F>=0?F:260;if(r<=0){tt(!1);return}tt(!0);const a=window.setTimeout(()=>tt(!1),r);return()=>window.clearTimeout(a)},[s,F]),c.useEffect(()=>{if(t.length>0){ge(!1);return}const r=()=>{if(!l.current){ge(!0);return}const o=l.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"",m=l.current.querySelectorAll('[data-type="variable"]'),h=l.current.querySelectorAll('[data-type="upload"]');let k=!1;m.forEach(O=>{(O.textContent?.replace(/[\u200B\n]/g,"").trim()||"")&&(k=!0)}),h.forEach(O=>{O.querySelector(".upload-inner-wrapper.has-file")&&(k=!0)});const p=!o&&!k;ge(p),t.length===0&&he(!p)};r();const a=new MutationObserver(r);return l.current&&a.observe(l.current,{childList:!0,subtree:!0,characterData:!0}),()=>{a.disconnect()}},[t]);const Mn=r=>{if(d){r.preventDefault();return}r.preventDefault();const a=r.clipboardData.getData("text/plain"),o=window.getSelection();if(o&&o.rangeCount>0){const p=o.anchorNode;if(p){let O=null;if(p.nodeType===Node.ELEMENT_NODE?O=p.closest('[data-type="variable"]'):p.nodeType===Node.TEXT_NODE&&p.parentElement&&(O=p.parentElement.closest('[data-type="variable"]')),O){const C=O.dataset.multiKey;if(C){const $=/[、,,\s\n\r\t]+/,z=a.split($).map(g=>g.trim()).filter(g=>g.length>0);if(z.length>1){const g=parseInt(O.dataset.index||"0",10),Y=t.find(ye=>ye.type==="multi-variable"&&ye.key===C)?.maxCount||9,Q=Ce[C]||1,W=Math.min(g+z.length,Y);W>Q&&Ae(pe=>({...pe,[C]:W}));const te=[];for(let pe=0;pe<Q;pe++){const ye=`${C}_${pe}`,Se=l.current.querySelector(`[data-type="variable"][data-key="${ye}"][data-multi-key="${C}"]`);if(Se){const Me=Se.innerText.replace(/[\u200B\n]/g,"").trim();te.push(Me)}}te.splice(g,1,...z.slice(0,Y-g));const ae=te.slice(0,Y);ae.length>0&&ae[ae.length-1]!==""&&ae.length<Y&&ae.push("");const ce=Math.max(ae.length,1),de={};ae.forEach((pe,ye)=>{pe&&(de[`${C}_${ye}`]=pe)}),l.current.querySelectorAll('[data-type="variable"]').forEach(pe=>{const ye=pe.dataset.key,Se=pe.dataset.multiKey;if(ye&&Se!==C){const Me=pe.innerText.replace(/[\u200B\n]/g,"").trim();Me&&(de[ye]=Me)}}),l.current.__tempVariableValues=de,Ae(pe=>({...pe,[C]:ce}));return}}}}}let m=!1,h="";const k=window.getSelection();if(k&&k.rangeCount>0){const p=k.anchorNode;if(p){let O=null;if(p.nodeType===Node.ELEMENT_NODE?O=p.closest('[data-type="variable"]'):p.nodeType===Node.TEXT_NODE&&p.parentElement&&(O=p.parentElement.closest('[data-type="variable"]')),O){const C=O.getAttribute("data-node-type")||"",$=O.dataset.key;if(C==="markdown"&&$&&/20\d{2}-\d{2}-\d{2}/.test(a))m=!0,h=$,Vt.current[$]=a,Ee(z=>({...z,[$]:{...z[$],status:"loading",error:void 0}}));else if(C==="report-url"&&$){document.execCommand("insertText",!1,a),ut(),setTimeout(()=>{const z=O.innerText.replace(/[\u200B\n]/g,"").trim();nt.current($,z)},0);return}}}}if(m&&h){setTimeout(()=>{We.current(h,a)},0);return}document.execCommand("insertText",!1,a),ut(),setTimeout(()=>{/20\d{2}-\d{2}-\d{2}/.test(a)&&rt.current.tableData?.status==="success"&&(Ee(O=>({...O,tableData:{status:"loading",modules:[],lastParsedText:a,error:void 0}})),setTimeout(()=>{Vt.current.tableData=a,We.current("tableData",a)},0))},0)},Dn=r=>{if(!r.target.files){r.target&&(r.target.value=""),x(null),A(null),J(null);return}const a=10*1024*1024,o=h=>h.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(h.name||""),m=h=>o(h)&&h.size>a;if(I&&r.target.files&&r.target.files.length>0){const h=I,k=t.find($=>$.type==="upload"&&$.key===h),p=Array.from(r.target.files),O=p.filter($=>!m($)),C=p.length-O.length;if(C>0&&T.error(`已自动过滤 ${C} 张超过 10MB 的图片,仅允许上传 10MB 以内图片`),k&&typeof k.maxCount=="number"&&typeof k.minCount=="number"){const $=k.maxCount,z=typeof X=="number"?X:0;y(g=>{const Y={...g};let Q=Math.min(Math.max(z,0),$-1);for(const W of O){for(;Q<$&&Y[`${h}-${Q}`]!=null;)Q+=1;if(Q>=$)break;Y[`${h}-${Q}`]=W,Q+=1}return Y})}}else if(b&&r.target.files[0]){const h=r.target.files[0],k=b;m(h)?T.error("图片大小不能超过 10MB(仅允许上传 10MB 以内图片)"):y(p=>({...p,[k]:h}))}r.target&&(r.target.value=""),x(null),A(null),J(null)},Ut=r=>{y(a=>{const o={...a};return delete o[r],o})},Pn=r=>{const a=r.target;if(a.closest(".rte-datepicker-wrapper")||a.closest(".rte-datepicker-host")||a.closest(".rte-select-wrapper")||a.closest(".rte-select-host")||a.closest(".ant-select-dropdown"))return;if(a.closest(".tag-close-btn")){if(r.preventDefault(),r.stopPropagation(),D)return;ee(null),M?M():l.current&&(l.current.innerHTML="",l.current.focus());return}if(D){const h=a.closest(".tag-node"),k=a.closest('[data-type="text"]');if(h||k){r.preventDefault(),r.stopPropagation();const p=window.getSelection();p&&p.removeAllRanges();return}}a.closest('[data-type="variable"]')||(ie.current={x:r.clientX,y:r.clientY},se.current=!1,a.closest(".file-remove-btn")&&(r.preventDefault(),r.stopPropagation()))},Hn=r=>{if(!r.target.closest('[data-type="variable"]')&&ie.current){const m=Math.abs(r.clientX-ie.current.x),h=Math.abs(r.clientY-ie.current.y);(m>3||h>3)&&(se.current=!0)}},Bn=r=>{if(r.target.closest('[data-type="variable"]')){ie.current=null,se.current=!1;return}ie.current=null,se.current=!1},Vn=r=>{if(d)return;s&&H?.(!1);const a=r.target;if(a.closest('[data-type="datepicker"]'))return;if(a.closest(".tag-close-btn")){r.preventDefault(),r.stopPropagation();return}if(t.length===0)return;const h=(g,Y)=>{if(!l.current)return;Array.from(l.current.children).forEach(W=>{if(W!==g)if(Y)W.dataset.prevDisplay===void 0&&(W.dataset.prevDisplay=W.style.display||""),W.dataset.rteForceHidden="1",W.style.setProperty("display","none","important");else{if(W.dataset.prevDisplay!==void 0){const te=W.dataset.prevDisplay;te?W.style.display=te:W.style.removeProperty("display"),delete W.dataset.prevDisplay}else W.style.removeProperty("display");delete W.dataset.rteForceHidden}})},k=a.closest(".rte-textarea-toggle");if(k){r.preventDefault(),r.stopPropagation();const g=k.closest(".rte-textarea-wrapper"),Y=g?.querySelector('[data-type="textarea"]'),W=!(k.getAttribute("data-expanded")==="true");k.setAttribute("data-expanded",String(W)),k.textContent=W?"收起":"展开",g&&g.classList.toggle("rte-textarea-expanded",W);const te=g?.closest(".rte-textarea-required");if(te?te.classList.toggle("rte-textarea-overlay",W):g&&g.classList.toggle("rte-textarea-overlay",W),Y)if(W)Y.classList.add("rte-textarea-expanded"),Y.style.maxHeight="none",Y.style.height="100%";else{Y.classList.remove("rte-textarea-expanded");const ae=Y.dataset.maxHeight||"252";Y.style.maxHeight=`${ae}px`,Y.style.height="auto"}l.current&&(W?l.current.classList.add("rte-overlay-active"):l.current.classList.remove("rte-overlay-active"));return}const p=a.closest(".rte-richtext-toggle");if(p){r.preventDefault(),r.stopPropagation();const g=p.closest(".rte-richtext-wrapper"),Y=g?.querySelector('[data-type="richtext"]'),W=!(p.getAttribute("data-expanded")==="true");((de,fe)=>{de.setAttribute("data-expanded",String(fe)),de.innerHTML=fe?'<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>':'<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>'})(p,W);const ae=g?.closest(".rte-richtext-required");ae?ae.classList.toggle("rte-richtext-expanded",W):g&&g.classList.toggle("rte-richtext-expanded",W);const ce=g?.closest(".exclusion-wrapper")||g?.parentElement;if(Y&&(W?(Y.style.height="100%",Y.style.overflow="auto"):(Y.style.height="",Y.style.overflow="")),ce&&(ce.classList.toggle("rte-richtext-host-expanded",W),h(ce,W)),l.current){if(l.current.classList.toggle("rte-richtext-fullscreen-active",W),K.current?.classList.toggle("rte-richtext-container-expanded",W),K.current)if(W){const de=Math.ceil(K.current.getBoundingClientRect().height||0);de>0&&K.current.style.setProperty("--rte-richtext-fullscreen-height",`${de}px`)}else K.current.style.removeProperty("--rte-richtext-fullscreen-height");if(W)be.current=l.current.scrollTop||0,setTimeout(()=>{l.current&&(l.current.scrollTop=0,l.current.scrollLeft=0)},0);else{const de=be.current||0;setTimeout(()=>{l.current&&(l.current.scrollTop=de)},0)}}return}if(a.closest('[data-type="text"]')){r.preventDefault(),r.stopPropagation();const g=window.getSelection();g&&g.removeAllRanges();return}if(D&&a.closest(".tag-node")){r.preventDefault(),r.stopPropagation();const Y=window.getSelection();Y&&Y.removeAllRanges();return}if(a.closest('[data-type="variable"]')){if(se.current)return;setTimeout(()=>{const g=window.getSelection();g&&!g.isCollapsed||Ze(l)},10);return}const $=a.closest(".file-remove-btn");if($){r.preventDefault(),r.stopPropagation();const g=$.closest('[data-type="upload"]'),Y=g?.dataset.key,Q=g?.dataset.batchKey;if(Y)if(Q){const W=t.find(te=>te.type==="upload"&&te.key===Q);if(W&&typeof W.maxCount=="number"&&typeof W.minCount=="number"){const te=W.maxCount;y(ae=>{const ce={...ae},de=[];for(let fe=0;fe<te;fe++){const pe=`${Q}-${fe}`,ye=ce[pe];ye!=null&&pe!==Y&&de.push(ye)}for(let fe=0;fe<te;fe++)delete ce[`${Q}-${fe}`];return de.forEach((fe,pe)=>{ce[`${Q}-${pe}`]=fe}),ce})}else Ut(Y)}else Ut(Y);return}const z=a.closest('[data-type="upload"]');if(z){const g=z.dataset.key,Y=z.dataset.batchKey,Q=z.dataset.batchIndex;if(g){const W=Y||g,te=t.find(ae=>ae.type==="upload"&&ae.key===W);if(_.current&&(te?.accept?_.current.accept=te.accept:te?.acceptType==="image"?_.current.accept="image/*":te?.acceptType==="file"?_.current.accept=".csv,.xlsx,.xls,.txt,.pdf,.doc,.docx,.json":_.current.accept=""),Y){const ae=t.find(ce=>ce.type==="upload"&&ce.key===Y);if(ae&&typeof ae.maxCount=="number"&&typeof ae.minCount=="number"){const ce=ae.maxCount,de=V[g]!=null,fe=Q!=null?Number.parseInt(Q,10):NaN;if(de){_.current&&(_.current.multiple=!1),A(null),J(null),x(g),_.current?.click();return}let pe=0;for(let ye=0;ye<ce;ye++)V[`${Y}-${ye}`]!=null&&(pe+=1);pe<ce&&_.current?(_.current.multiple=!0,A(Y),J(Number.isFinite(fe)?fe:null),x(null),_.current.click()):(_.current&&(_.current.multiple=!1),A(null),J(null),x(g),_.current?.click())}else _.current&&(_.current.multiple=!1),A(null),J(null),x(g),_.current?.click()}else _.current&&(_.current.multiple=!1),A(null),J(null),x(g),_.current?.click()}return}},On=r=>{const o=r.target.closest('[data-type="variable"]');if(o){const m=window.getSelection();if(m){const h=document.createRange(),k=o.textContent||"";if(k.replace(/\u200B/g,"")){let O=0,C=k.length;k.startsWith("​")&&(O=1),k.endsWith("​")&&k.length>1&&(C=k.length-1);const $=o.firstChild;$&&$.nodeType===Node.TEXT_NODE?(h.setStart($,O),h.setEnd($,C)):h.selectNodeContents(o)}else h.selectNodeContents(o),h.collapse(!0);m.removeAllRanges(),m.addRange(h)}}},ut=()=>{if(t.length===0){if(l.current){const o=!(l.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"");ge(o),he(!o)}return}if(Ze(l),l.current&&l.current.querySelectorAll('[data-type="variable"][data-node-type="report-url"]').forEach(o=>{const m=o.dataset.key;if(!m)return;o.innerText.replace(/[\u200B\n]/g,"").trim()||Ve(k=>{const p=k[m];return!p||p.status==="idle"&&(!p.modules||p.modules.length===0)?k:{...k,[m]:{status:"idle",modules:[],lastParsedUrl:void 0,error:void 0}}})}),l.current&&l.current.querySelectorAll('[data-type="variable"][data-node-type="markdown"]').forEach(o=>{const m=o.dataset.key;if(!m)return;o.innerText.replace(/[\u200B\n]/g,"").trim()||Ee(k=>{const p=k[m];return!p||p.status==="idle"&&(!p.modules||p.modules.length===0)?k:{...k,[m]:{status:"idle",modules:[],lastParsedText:void 0,error:void 0}}})}),l.current&&l.current.querySelectorAll('[data-type="richtext"][data-node-type="markdown-module"]').forEach(o=>{const m=o.dataset.key;if(!m)return;o.innerText.replace(/[\u200B\n]/g,"").trim()||Ee(k=>{const p=k[m];return!p||p.status==="idle"?k:{...k,[m]:{status:"idle",modules:[],lastParsedText:void 0,error:void 0}}})}),l.current&&l.current.querySelectorAll('[data-type="variable"]').forEach(o=>{const m=o.querySelector(".variable-info-icon");if(m){let h=!1;const k=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,{acceptNode:p=>m.contains(p)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;k.nextNode();)if(k.currentNode.textContent?.replace(/[\u200B\n]/g,"").trim()){h=!0;break}h?m.classList.add("hidden"):m.classList.remove("hidden")}}),s||window.requestAnimationFrame(()=>{ct()}),Je(l,xe,V),Qe(l,xe,V,he),!l.current)return;t.filter(a=>a.type==="multi-variable"&&a.key).forEach(a=>{if(!a.key)return;const o=a.maxCount||9,m=Ce[a.key]||1,h=[];for(let $=0;$<m;$++){const z=`${a.key}_${$}`,g=l.current.querySelector(`[data-type="variable"][data-key="${z}"][data-multi-key="${a.key}"]`);if(g){const Y=g.innerText.replace(/[\u200B\n]/g,"").trim();h.push(Y)}}const p=(h[h.length-1]||"")==="";let O=!1,C=-1;for(let $=0;$<h.length-1;$++)if(h[$]===""){O=!0,C=$;break}if(O&&C>=0){const $=window.getSelection();if($&&$.rangeCount>0){const W=$.getRangeAt(0),te=W.startContainer,ae=te.nodeType===Node.ELEMENT_NODE?te.closest('[data-type="variable"][data-multi-key]'):te.parentElement?.closest('[data-type="variable"][data-multi-key]');if(ae){const ce=ae.dataset.key;if(ce){const de=document.createRange();de.setStartBefore(ae),de.setEnd(W.startContainer,W.startOffset);const fe=de.toString().length;re.current={key:ce,offset:fe}}}}const z=[...h];for(let W=C;W<z.length-1;W++)z[W]=z[W+1];z.pop();const g={};z.forEach((W,te)=>{W&&(g[`${a.key}_${te}`]=W)});const Y=Math.max(p?z.length:z.length+1,1);l.current.querySelectorAll('[data-type="variable"]').forEach(W=>{const te=W.dataset.key,ae=W.dataset.multiKey;if(te&&ae!==a.key){const ce=W.innerText.replace(/[\u200B\n]/g,"").trim();ce&&(g[te]=ce)}}),l.current.__tempVariableValues=g,Ae(W=>({...W,[a.key]:Y}));return}if(!p){const $=m-1,z=`${a.key}_${$}`,g=l.current.querySelector(`[data-type="variable"][data-key="${z}"][data-multi-key="${a.key}"]`);if(g&&g.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&m<o){const Q=window.getSelection();if(Q&&Q.rangeCount>0){const W=Q.getRangeAt(0),te=W.startContainer,ae=te.nodeType===Node.ELEMENT_NODE?te.closest('[data-type="variable"][data-multi-key]'):te.parentElement?.closest('[data-type="variable"][data-multi-key]');if(ae){const ce=ae.dataset.key;if(ce){const de=document.createRange();de.setStartBefore(ae),de.setEnd(W.startContainer,W.startOffset);const fe=de.toString().length;re.current={key:ce,offset:fe}}}}Ae(W=>({...W,[a.key]:m+1}))}}})};c.useLayoutEffect(()=>{const r=l.current;if(!r)return;const a=new Map,o=k=>{const p=k.target,O=k.relatedTarget;!p||!l.current||!l.current.contains(p)||O&&l.current.contains(O)||setTimeout(()=>{if(l.current){if(t.length===0){const C=l.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";he(C.length>0);return}Ze(l),Je(l,xe,V),Qe(l,xe,V,he)}},0)};r.addEventListener("blur",o,!0);const m=()=>{if(!l.current)return;a.forEach((O,C)=>{C.removeEventListener("blur",O,!1)}),a.clear();const k=l.current.querySelectorAll('[data-type="variable"][data-multi-key]'),p=O=>{O.stopPropagation(),O.stopImmediatePropagation();const C=O.target;if(!C||!l.current||!l.current.contains(C))return;const $=C.closest('[data-type="variable"][data-multi-key]');if(!$||!l.current.contains($))return;let z=!1;if(a.forEach((de,fe)=>{(fe===$||fe.contains(C))&&(z=!0)}),!z)return;const g=$.dataset.multiKey,Y=$.dataset.key,Q=$.dataset.index;if(!g||!Y||Q===void 0)return;const W=O.relatedTarget;if(!(!W||!l.current.contains(W)))return;const ae=$.innerText.replace(/[\u200B\n]/g,"").trim(),ce=/[、,,\s]+/;if(ce.test(ae)){const pe=ae.split(ce).map(ye=>ye.trim()).filter(ye=>ye.length>0).slice(0,9);if(pe.length>1){const ye=t.find(Se=>Se.type==="multi-variable"&&Se.key===g);if(ye){const Se=Ce[g]||1,Me=parseInt(Q,10),Kt=ye.maxCount||9,dt=[];for(let we=0;we<Se;we++){const De=`${g}_${we}`,Ue=l.current.querySelector(`[data-type="variable"][data-key="${De}"][data-multi-key="${g}"]`);if(Ue){const Ke=Ue.innerText.replace(/[\u200B\n]/g,"").trim();dt.push(Ke)}}dt.splice(Me,1,...pe);const _e=dt.slice(0,Kt);_e.length>0&&_e[_e.length-1]!==""&&_e.length<Kt&&_e.push("");const Un=Math.max(_e.length,1),pt={};_e.forEach((we,De)=>{we&&(pt[`${g}_${De}`]=we)}),l.current.querySelectorAll('[data-type="variable"]').forEach(we=>{const De=we.dataset.key,Ue=we.dataset.multiKey;if(De&&Ue!==g){const Ke=we.innerText.replace(/[\u200B\n]/g,"").trim();Ke&&(pt[De]=Ke)}}),l.current.__tempVariableValues=pt,Ae(we=>({...we,[g]:Un}))}}}};k.forEach(O=>{O.addEventListener("blur",p,!1),a.set(O,p)})},h=setTimeout(()=>{m()},0);return()=>{clearTimeout(h),r.removeEventListener("blur",o,!0),a.forEach((k,p)=>{p.removeEventListener("blur",k,!1)}),a.clear()}},[t,xe,Ce,V]);const Fn=r=>{if(d){r.preventDefault();return}if(r.key==="Enter"){const o=r.target,m=!!o?.closest?.('[data-type="richtext"]'),h=o?.tagName==="TEXTAREA"||!!o?.closest?.('[data-type="textarea"]');if(!m&&!h){r.preventDefault();return}}const a=window.getSelection();if(a&&a.rangeCount>0){const o=a.anchorNode;let m=null;if(o&&(o.nodeType===Node.ELEMENT_NODE?m=o.closest('[data-type="text"]'):o.nodeType===Node.TEXT_NODE&&o.parentElement&&(m=o.parentElement.closest('[data-type="text"]'))),m){if(r.preventDefault(),r.stopPropagation(),l.current){const h=l.current.querySelector('[data-type="variable"], [data-type="upload"]');h&&h.focus()}return}}if(D&&a&&a.rangeCount>0){const o=a.anchorNode;let m=null;if(o&&(o.nodeType===Node.ELEMENT_NODE?m=o.closest(".tag-node"):o.nodeType===Node.TEXT_NODE&&o.parentElement&&(m=o.parentElement.closest(".tag-node"))),m){if(r.preventDefault(),r.stopPropagation(),l.current){const h=l.current.querySelector('[data-type="variable"], [data-type="upload"]');h&&h.focus()}return}}if(r.key==="Escape"&&l.current){if(D){r.preventDefault();return}l.current.innerHTML="",l.current.focus()}if(r.key==="Backspace"){const o=window.getSelection();if(o&&o.rangeCount>0){const m=o.getRangeAt(0),h=o.anchorNode;if(D){let p=null,O=null;if(h&&(h.nodeType===Node.ELEMENT_NODE?(p=h.closest(".tag-node"),O=h.closest('[data-type="text"]')):h.nodeType===Node.TEXT_NODE&&h.parentElement&&(p=h.parentElement.closest(".tag-node"),O=h.parentElement.closest('[data-type="text"]'))),(p||O)&&m.collapsed&&m.startOffset===0){r.preventDefault();return}}let k=null;if(h&&(h.nodeType===Node.ELEMENT_NODE?k=h.closest('[data-type="variable"]'):h.nodeType===Node.TEXT_NODE&&h.parentElement&&(k=h.parentElement.closest('[data-type="variable"]'))),k){if(!m.collapsed)return;const p=k.innerText;if(p==="​"||p===""){r.preventDefault();return}if(m.startOffset===0){r.preventDefault();return}if(p.startsWith("​")&&m.startOffset===1){r.preventDefault();return}}}}},Gn=()=>{if(i||d||L||!ue||!l.current)return;if(t.length===0){const k=l.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";if(!k)return;if(f(k,k),l.current){l.current.textContent="";const p=new Event("input",{bubbles:!0});l.current.dispatchEvent(p)}return}const r=l.current;let a="";const o={},m=k=>{if(!(k.nodeType===Node.ELEMENT_NODE&&k.style.display==="none")){if(k.nodeType===Node.TEXT_NODE)a+=(k.textContent||"").replace(/\u200B/g,"");else if(k.nodeType===Node.ELEMENT_NODE){const p=k,O=p.dataset.type,C=p.dataset.key;if(O==="variable"&&C){let $="";const z=document.createTreeWalker(p,NodeFilter.SHOW_TEXT,{acceptNode:Y=>{const Q=p.querySelector(".variable-info-icon");return Q&&Q.contains(Y)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;z.nextNode();)$+=z.currentNode.textContent||"";const g=$.replace(/[\u200B\n]/g,"").trim();if(g){const Y=p.dataset.multiKey;if(Y){(!o[Y]||!Array.isArray(o[Y]))&&(o[Y]=[]);const Q=o[Y];Q.push(g),Q.length>1&&(a+=" "),a+=g}else o[C]=g,a+=g;if(p.dataset.nodeType==="report-url")if(o.url===void 0)o.url=g;else{const Q=o.url;Array.isArray(Q)?Q.push(g):o.url=[String(Q),g]}if(p.dataset.nodeType==="markdown"){const Q=p.dataset.sourceTextKey||`${C}__sourceText`;if(o[Q]===void 0)o[Q]=g;else{const te=o[Q];Array.isArray(te)?te.push(g):o[Q]=[String(te),g]}const W=`${C}__markdown`;o[W]===void 0&&(o[W]=[At(g)])}}}else if(O==="select"&&C){const $=(p.getAttribute("data-value")||"").trim();$&&(o[C]=$,a+=$)}else if(O==="textarea"&&C){const z=(p.value||"").replace(/\u200B/g,"").trim();z&&(o[C]=z,a+=z)}else if(O==="richtext"&&C){const $=p,z=$.dataset.nodeType,g=($.textContent||"").replace(/\u200B/g,"").trim();if(g)if(z==="report-module"||z==="markdown-module"){(!o[C]||!Array.isArray(o[C]))&&(o[C]=[]);const Y=o[C];Y.push(g),Y.length>1&&(a+=" "),a+=g}else o[C]=g,a+=g}else if(O==="datepicker"&&C){const z=(p.getAttribute("data-value")||"").trim();if(z)if(z.includes(",")){const g=z.split(",");g.length===2?(o[C]=g,a+=`[${g[0]}, ${g[1]}]`):(o[C]=z,a+=z)}else o[C]=z,a+=z}else if(O==="number-input"&&C){const z=(p.value||"").trim();z&&(o[C]=z,a+=z)}else if(O==="upload"&&C){const $=p.dataset.batchKey;if($){const z=t.find(g=>g.type==="upload"&&g.key===$);if(z&&typeof z.maxCount=="number"&&typeof z.minCount=="number"){const g=[];for(let Y=0;Y<z.maxCount;Y++){const Q=`${$}-${Y}`,W=V[Q];W&&g.push(W)}o[$]||(o[$]=g.length>0?g:null,g.length>0&&(a+=` [附带${g.length}个文件: ${g.map(Y=>Y.name).join(", ")}] `))}else o[C]=V[C]??null,V[C]&&(a+=` [附带文件: ${V[C]?.name}] `)}else o[C]=V[C]??null,V[C]&&(a+=` [附带文件: ${V[C]?.name}] `)}else{if(p.classList.contains("tag-close-btn")||p.classList.contains("file-remove-btn"))return;p.getAttribute("contenteditable")==="false"&&!O&&p.classList.contains("tag-node")?a+=p.innerText:p.childNodes.forEach(m)}}}};if(r.childNodes.forEach(m),a=a.trim(),!a)return;Object.keys($e).forEach(k=>{const p=$e[k];if(!p||!p.modules||p.modules.length===0)return;const O=p.modules.map(C=>(C?.markdown||"").trim()).filter(C=>C.length>0);O.length!==0&&(o[`${k}__markdown`]=O)});const h=new FormData;h.append("fullPrompt",a),Object.keys(o).forEach(k=>{const p=o[k];if(p!=null)if(p instanceof File)h.append(k,p);else if(Array.isArray(p)){const O=t.some(g=>g.type==="multi-variable"&&g.key===k),C=t.some(g=>g.type==="report-url"&&g.key===k),$=k.endsWith("__markdown");O||C||$||k==="url"?p.forEach(g=>{g!=null&&g!==""&&h.append(k,String(g))}):p.forEach((g,Y)=>{g!=null&&(g instanceof File?h.append(`${k}[${Y}]`,g):typeof g=="string"?h.append(`${k}[${Y}]`,g):h.append(`${k}[${Y}]`,String(g)))})}else typeof p=="string"?h.append(k,p):h.append(k,String(p))}),f(h,a)},zn={...v?{width:typeof v=="number"?`${v}px`:v}:{},...j?{border:j}:{},...S?{background:S}:{},...e?{maxHeight:typeof e=="number"?`${e}px`:e}:{},...n?{minHeight:typeof n=="number"?`${n}px`:n}:{},...e?{"--rte-richtext-fullscreen-height":typeof e=="number"?`${e}px`:e}:{}},jn=typeof F=="number"&&Number.isFinite(F)&&F>=0?F:260,Wn={overflow:"hidden"},Yn={maxHeight:s?`${ke}px`:`${Math.max(Ie,ke)}px`,overflow:s||In?"hidden":"auto",transition:`max-height ${jn}ms cubic-bezier(0.4, 0, 0.2, 1)`,willChange:"max-height"};return w.jsxs("div",{className:"rich-text-editor",style:zn,"data-disabled":d,ref:K,children:[ne,w.jsx("div",{className:"rich-text-editor-content",ref:R,style:Wn,children:w.jsxs("div",{ref:G,className:"rich-text-editor-content-body",style:Yn,children:[w.jsx("div",{ref:l,className:`rte-editor ${t.length===0?"rte-editor-default":""} ${me&&q?"rte-editor-empty":""}`,contentEditable:t.length===0,suppressContentEditableWarning:!0,"data-placeholder":q,onMouseDown:Pn,onMouseMove:Hn,onMouseUp:Bn,onClick:Vn,onDoubleClick:On,onInput:ut,onKeyDown:Fn,onPaste:Mn}),w.jsx("input",{type:"file",ref:_,className:"rte-file-input",accept:".csv,.xlsx,.xls,.txt,.pdf,image/*",onChange:Dn})]})}),w.jsxs("div",{className:"rich-text-editor-footer",children:[w.jsx("div",{className:"rich-text-editor-footer-left",children:w.jsxs("div",{className:"rich-text-editor-brand",children:[w.jsxs("div",{className:"rte-brand-badge",children:[w.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""}),w.jsx("span",{className:"rte-brand-text",children:"SealSeek 1.0"})]}),N!=="hideAgent"&&w.jsx(oe.Dropdown,{placement:"topLeft",menu:{items:P.filter(r=>r.isShowNew!==1).map(r=>({key:r.key,label:w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[r.icon&&w.jsx("i",{className:r.icon}),w.jsx("span",{children:r.label})]}),onClick:()=>{B?.(r)}}))},trigger:["click"],disabled:d||i,overlayClassName:"rte-agent-dropdown",children:w.jsxs("div",{className:"rte-agent-badge",style:{cursor:P.length>0?"pointer":"default"},children:[w.jsx("i",{className:"iconfont icon-zhinengti",style:{fontSize:"16px"}}),w.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})]})}),w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(()=>{const r=t.find(o=>o.type==="tag");if(!r||!r.text)return null;const a=P.find(o=>o.label===r.text);return!a||a.points===void 0||a.points===null?null:w.jsxs("div",{className:"rte-points-badge",style:{position:"relative"},children:[w.jsx("i",{className:"iconfont icon-jifen",style:{marginRight:"4px",fontSize:"16px"}}),w.jsxs("span",{style:{fontSize:"16px",lineHeight:"22px"},children:["-",String(a.points)]}),a.labelValue===2&&w.jsx("div",{className:"rte-limited-free-badge",children:w.jsx("span",{className:"rte-limited-free-text",children:"限时免费"})})]})})(),w.jsx("button",{type:"button",onClick:Gn,disabled:i||d||L||!ue,className:"rich-text-editor-send-button",children:i||L?w.jsx("span",{className:"rte-send-spinner"}):w.jsx("i",{className:"iconfont icon-fasong"})})]})]}),Z?.anchorEl&&(()=>{if(!document.body.contains(Z.anchorEl))return null;let r="",a={background:"var(--neutral-800, #262626)"};if(Z.type==="upload"){const m=Z.anchorEl.dataset.tooltip;m?r=m:r=t.find(k=>k.type==="upload"&&k.key===Z.key)?.tooltip||""}else if(Z.type==="tag")r=Z.anchorEl.dataset.tooltip||"";else if(Z.type==="upload-label")r=Z.anchorEl.querySelector(".upload-label[data-file-name]")?.dataset.fileName||Z.anchorEl.dataset.fileName||"";else if(Z.type==="variable")r=Z.anchorEl.dataset.tooltip||"";else if(Z.type==="upload-preview"){const m=V[Z.key],h=!!m&&(m.type?.startsWith("image/")||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(m.name||""));if(m&&h){const k=URL.createObjectURL(m);r=w.jsx("div",{className:"rte-upload-preview",children:w.jsx("img",{className:"rte-upload-preview-img",src:k,alt:m.name})}),a={background:"#fff",padding:0,borderRadius:4,boxShadow:"0 2px 12px 0 rgba(153, 153, 153, 0.25)"},setTimeout(()=>URL.revokeObjectURL(k),1e3)}else r=""}if(!r)return null;const o=Z.type==="upload-preview"?"#0A0A0A":"#fff";return Xe.createPortal(w.jsx(oe.Tooltip,{arrow:!1,title:Z.type==="upload-preview"?r:w.jsx("div",{style:{maxWidth:"200px",fontSize:"12px",color:o},children:r}),open:!0,placement:Z.type==="upload-preview"?"topLeft":"top",getPopupContainer:()=>document.body,overlayInnerStyle:a,children:w.jsx("div",{style:{position:"fixed",left:`${Z.anchorEl.getBoundingClientRect().left}px`,top:`${Z.anchorEl.getBoundingClientRect().top-(Z.type==="upload-label"?4:0)}px`,width:`${Z.anchorEl.offsetWidth}px`,height:`${Z.anchorEl.offsetHeight}px`,pointerEvents:"none"}})}),document.body)})(),it,lt]})};Nt.__docgenInfo={displayName:"RichTextEditor",description:"结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",props:{config:{name:"config",required:!0,description:"结构化输入配置节点数组",type:{name:"InputNode[]",raw:"InputNode[]"}},onSend:{name:"onSend",required:!0,description:"点击发送按钮时的回调,返回数据与拼接后的 Prompt",type:{name:"function",raw:"(data: Record<string, any>, fullPrompt: string) => void"}},isProcessing:{name:"isProcessing",required:!1,description:"是否处于处理状态(禁用输入与发送)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}}}};const _t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==",kn=[{label:"5页",value:5},{label:"10页",value:10},{label:"15页",value:15},{label:"30页",value:30}],$n=({autoLoading:t,batchSize:f,loadingProgress:i,loadIcon:d,onBatchSizeChange:v,onLoadNextPage:D,onStartAutoLoad:P,onStopLoad:B})=>t&&i?w.jsxs("div",{className:"auto_load_progress",children:[d||w.jsx("img",{src:_t,alt:"自动加载",width:14,height:14}),w.jsxs("span",{children:["正在加载第",i.currentPage,"/",i.totalPages,"页"]}),w.jsx(oe.Progress,{percent:i.percentage,type:"line",size:[160,8]}),w.jsx("span",{onClick:B,className:"auto_load_stop_btn",children:"停止加载"})]}):w.jsxs("div",{className:"auto_load_container",children:[w.jsx("div",{onClick:D,className:"auto_load_next_btn",style:{backgroundColor:t?"#f5f5f5":"#2563eb"},children:"加载下一页"}),w.jsxs("div",{className:"right_control_wrap",style:{backgroundColor:t?"#f5f5f5":"#2563eb"},children:[w.jsxs("div",{className:"auto_load_btn",onClick:t?void 0:P,children:[d||w.jsx("img",{src:_t,alt:"自动加载",width:14,height:14}),w.jsx("span",{children:"自动加载"})]}),w.jsx(oe.Select,{value:f,onChange:v,options:kn,disabled:t,size:"small",className:"auto_load_select",popupMatchSelectWidth:84})]})]}),En=({current:t,loadIcon:f,pageSize:i,total:d,cachedPages:v,loadedCount:D,autoLoading:P=!1,loadingProgress:B,onChange:M,onLoadNextPage:L,onStartAutoLoad:q,onStopLoading:j})=>{const[S,N]=c.useState(5),e=Math.ceil(d/i),n=c.useMemo(()=>v.length>=e,[v,e]),s=()=>Array.from({length:e},(H,F)=>F+1).filter(H=>!v.includes(H)).slice(0,S),u=(E,H,F)=>{const T=v.includes(E);return H==="prev"||H==="next"||H==="jump-prev"||H==="jump-next"?w.jsx("div",{className:"pageBox",children:F}):w.jsxs("div",{className:"pageBox",style:{backgroundColor:t===E?"#2563EB":"#f5f5f5",color:t===E?"#fff":T?"#171717":"#a3a3a3"},children:[E,!T&&w.jsx("span",{className:"unload_spot"})]})};return w.jsxs("div",{className:"pagination_footer",children:[w.jsxs("div",{className:"pagination_leftWrap",children:[w.jsxs("span",{className:"pagination_total",children:[w.jsx(Te.InfoCircleOutlined,{style:{color:"#2563EB",marginRight:"4px"}}),"已加载: ",D,"/",d,"条数据"]}),!n&&w.jsx($n,{loadIcon:f||void 0,autoLoading:P,batchSize:S,loadingProgress:B,disabled:!L||!q,onBatchSizeChange:N,onLoadNextPage:()=>L?.(),onStartAutoLoad:()=>{const E=s();q?.(E)},onStopLoad:()=>j?.()})]}),w.jsx(oe.Pagination,{current:t,pageSize:i,total:d,onChange:E=>M(E),showSizeChanger:!1,showQuickJumper:!1,showTotal:()=>"",itemRender:u})]})},Lt=t=>{const{loading:f,autoLoading:i,loadingProgress:d,columns:v=[],dataSource:D=[],total:P,current:B,pageSize:M,cachedPages:L,onChangePage:q,onLoadNextPage:j,onStartAutoLoad:S,onStopLoading:N,...e}=t,n=c.useRef(null),s=c.useCallback(u=>{q(u),L.includes(u)&&n.current?.scrollTo({key:`${(u-1)*M+1}`})},[L,q,M]);return w.jsxs("div",{className:"flex flex-col",children:[w.jsx(oe.Table,{ref:n,...e,columns:v,dataSource:D,pagination:!1,virtual:!0}),w.jsx(En,{loading:f,autoLoading:i,loadingProgress:d,current:B,pageSize:M,total:P,loadedCount:D.length,cachedPages:L,onChange:s,onLoadNextPage:j,onStartAutoLoad:S,onStopLoading:N})]})};Lt.__docgenInfo={displayName:"VirtualTable",description:"虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",props:{loading:{description:"加载状态",name:"loading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},total:{description:"总数据条数",name:"total",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"0"}},current:{description:"当前页码",name:"current",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"1"}},pageSize:{description:"每页数据条数",name:"pageSize",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"10"}},cachedPages:{description:"已缓存的页码数组",name:"cachedPages",required:!0,type:{name:"number[]",raw:"number[]"},defaultValue:{value:"[]"}},dataSource:{description:"数据源",name:"dataSource",required:!0,type:{name:"Array<T>",raw:"Array<T>"},defaultValue:{value:"[]"}},onChangePage:{description:"页码变更回调函数",name:"onChangePage",required:!0,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},autoLoading:{description:"是否正在自动加载",name:"autoLoading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},loadingProgress:{description:"加载进度信息",name:"loadingProgress",required:!0,type:{name:"object",raw:"{percentage: 0, currentPage: 1, totalPages: 5}"},defaultValue:{value:"-"}},onLoadNextPage:{description:"加载下一页回调函数",name:"onLoadNextPage",required:!1,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},onStartAutoLoad:{description:"开始自动加载回调函数",name:"onStartAutoLoad",required:!1,type:{name:"function",raw:"function(loadNextPages: number[]): void"},defaultValue:{value:"-"}},onStopLoading:{description:"停止加载回调函数",name:"onStopLoading",required:!1,type:{name:"function",raw:"function(): void"},defaultValue:{value:"-"}},columns:{description:"表格列配置",name:"columns",required:!0,type:{name:"Array<object>",raw:"Array<object>"},defaultValue:{value:"[]"}}}};const It=({texts:t=[],placeholder:f="请输入内容",animationSpeed:i=100,autoPlay:d=!0,value:v,onChange:D,...P})=>{const[B,M]=c.useState(""),[L,q]=c.useState(0),[j,S]=c.useState(!1),[N,e]=c.useState(!1),[n,s]=c.useState(!1),u=c.useRef(void 0),E=c.useRef(void 0),H=c.useRef(t),F=c.useRef(L),T=c.useRef(N),ne=c.useRef(B);c.useEffect(()=>{H.current=t,F.current=L,T.current=N,ne.current=B});const K=c.useCallback((y,b)=>{let x=0;s(!0);const I=()=>{x<y.length?(M(y.slice(0,x+1)),x++,E.current=window.setTimeout(I,i)):(s(!1),b?.())};I()},[i]),R=c.useCallback(y=>{let b=ne.current.length;const x=()=>{b>0?(M(ne.current.slice(0,b-1)),b--,E.current=window.setTimeout(x,i/2)):y?.()};x()},[i]),G=c.useCallback(()=>{if(H.current.length===0||T.current)return;S(!0);const y=H.current[F.current];ne.current?R(()=>{K(y,()=>{u.current=window.setTimeout(()=>{q(b=>(b+1)%H.current.length),S(!1)},2e3)})}):K(y,()=>{u.current=window.setTimeout(()=>{q(b=>(b+1)%H.current.length),S(!1)},2e3)})},[R,K]);c.useEffect(()=>(d&&t.length>0&&!N&&G(),()=>{u.current&&window.clearTimeout(u.current),E.current&&window.clearTimeout(E.current)}),[L,N,d,t.length,G]),c.useEffect(()=>{!j&&d&&t.length>0&&!N&&G()},[L,j,d,t.length,N,G]);const l=y=>{e(!0),u.current&&window.clearTimeout(u.current),E.current&&window.clearTimeout(E.current),S(!1),s(!1),P.onFocus?.(y)},_=y=>{e(!1),!v&&t.length>0&&(M(""),q(0)),P.onBlur?.(y)},U=y=>{D?.(y.target.value),P.onChange?.(y)},V=()=>N||v?f:B||f;return w.jsxs("div",{style:{position:"relative"},children:[w.jsx(oe.Input,{...P,value:v,onChange:U,onFocus:l,onBlur:_,placeholder:V(),style:{...P.style,position:"relative",zIndex:1}}),!N&&!v&&B&&w.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",paddingLeft:11,paddingRight:11,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit"},children:[w.jsx("span",{children:B}),n&&w.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),w.jsx("style",{children:`
38
+ font-size: ${se.fontSize||"16px"};
39
+ font-family: ${se.fontFamily||"inherit"};
40
+ font-weight: ${se.fontWeight||"inherit"};
41
+ letter-spacing: ${se.letterSpacing||"normal"};
42
+ padding-left: ${K}px;
43
+ padding-right: ${ae}px;
44
+ `,fe.textContent=J||"0",document.body.appendChild(fe);const ue=Math.max(44,Math.min(600,fe.offsetWidth+8));return document.body.removeChild(fe),ue},Q=ee=>{const J=ee.target;if(!J)return;let se=J.value;if(se=se.replace(/[^\d]/g,""),se!==""&&se!=="0"){const K=parseInt(se,10);if(Number.isNaN(K))J.value="";else{const ae=J.getAttribute("min"),fe=J.getAttribute("max"),ue=ae!==null?parseInt(ae,10):0,Ee=fe!==null?parseInt(fe,10):1/0,Ce=Math.min(Math.max(K,ue),Ee);J.value=String(Ce)}}else if(se==="0"){const K=J.getAttribute("min");0<(K!==null?parseInt(K,10):0)?J.value="":J.value="0"}J.style.width=`${B(J)}px`},j=ee=>{const J=ee.key;(J==="-"||J==="."||J===","||J==="e"||J==="E"||J==="+"||J==="="||J===" ")&&ee.preventDefault()},X=()=>{if(!y.current)return;y.current.querySelectorAll('[data-type="number-input"]').forEach(J=>{const se=J.style.width,K=`${B(J)}px`;se!==K&&(J.style.width=K),P.has(J)||(J.addEventListener("input",Q,!1),J.addEventListener("keydown",j,!1),P.set(J,Q),M.set(J,j))})},V=window.setTimeout(()=>{X()},0),re=new MutationObserver(ee=>{let J=!1;ee.forEach(se=>{se.type==="childList"&&se.addedNodes.forEach(K=>{if(K.nodeType===Node.ELEMENT_NODE){const ae=K;ae.matches&&(ae.matches('[data-type="number-input"]')||ae.querySelector('[data-type="number-input"]'))&&(J=!0)}})}),J&&setTimeout(X,10)});return y.current&&re.observe(y.current,{childList:!0,subtree:!0}),()=>{window.clearTimeout(V),re.disconnect(),P.forEach((ee,J)=>{J.removeEventListener("input",ee,!1)}),P.clear(),M.forEach((ee,J)=>{J.removeEventListener("keydown",ee,!1)}),M.clear()}},[Je]),sE(y,Je,I,i,Ve,fn,void 0,p),oE(y,Je,I,k,N),uE(y,Je,k,p,N),cE(y,Je,I,k,N),lE(y,Je,k,N),dE(y,Je,I,Bt),fE(y,ze);const li=aE(y);R.useEffect(()=>{if(!y.current)return;y.current.querySelectorAll(".rte-richtext-toggle").forEach(M=>{const B=M.getAttribute("data-expanded")==="true";M.innerHTML=B?'<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>':'<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>'})},[Je,y]);const ci=_E(y),di=R.useCallback(()=>{const P=H.current;if(!P)return;const M=Math.max(0,Math.ceil(P.scrollHeight||0));!Number.isFinite(M)||M<=0||si(B=>B===M?B:M)},[]);R.useLayoutEffect(()=>{if(!b)return;const P=L.current,M=y.current;if(!(!P||!M))try{const B=window.getComputedStyle(M),Q=Number.parseFloat(B.paddingTop)||0,j=Number.parseFloat(B.lineHeight)||34,X=Math.max(0,Math.ceil(Q+j)),V=M.getBoundingClientRect(),re=document.createRange();re.selectNodeContents(M);const ee=Array.from(re.getClientRects());let J=X>0?X:58;if(ee.length>0){const se=Math.min(...ee.map(fe=>fe.top)),K=2;let ae=0;for(const fe of ee)Math.abs(fe.top-se)<=K&&(ae=Math.max(ae,fe.bottom));if(ae>0){const fe=Math.max(0,Math.ceil(ae-V.top));J=X>0?Math.max(fe,X):fe}}else J=X>0?X:58;if(!Number.isFinite(J)||J<=0)return;Lr(se=>se===J?se:J)}catch{}},[b,Je,I,Ve,li.length,ci.length]);const Or=R.useRef({ts:0,contentScrollTop:0,bodyScrollTop:0,editorScrollTop:0});R.useEffect(()=>{if(b)return;const P=L.current,M=H.current,B=y.current;if(!P)return;const Q=()=>{Or.current={ts:Date.now(),contentScrollTop:P.scrollTop||0,bodyScrollTop:M?.scrollTop||0,editorScrollTop:B?.scrollTop||0}};Q();const j=()=>{Q(),console.log(`[RTE collapse debug][${U.current}] (expanded) content scroll`,Or.current)},X=()=>{Q(),console.log(`[RTE collapse debug][${U.current}] (expanded) body scroll`,Or.current)};return P.addEventListener("scroll",j,{passive:!0}),M?.addEventListener("scroll",X,{passive:!0}),()=>{P.removeEventListener("scroll",j),M?.removeEventListener("scroll",X)}},[b]),R.useEffect(()=>{if(typeof window>"u")return;const P=U.current,M=window;return M.__rteDebug=M.__rteDebug||{},M.__rteDebug[P]={contentEl:L.current,contentBodyEl:H.current,editorEl:y.current},()=>{M.__rteDebug&&M.__rteDebug[P]&&delete M.__rteDebug[P]}},[]),R.useLayoutEffect(()=>{if(!b)return;const P=L.current,M=H.current,B=y.current;if(!P)return;const Q=()=>({content:{scrollTop:P.scrollTop,scrollLeft:P.scrollLeft,scrollHeight:P.scrollHeight,clientHeight:P.clientHeight},body:M?{scrollTop:M.scrollTop,scrollLeft:M.scrollLeft,scrollHeight:M.scrollHeight,clientHeight:M.clientHeight}:void 0,editor:B?{scrollTop:B.scrollTop,scrollLeft:B.scrollLeft,scrollHeight:B.scrollHeight,clientHeight:B.clientHeight}:void 0,style:(()=>{try{const ue=window.getComputedStyle(P),Ee=M?window.getComputedStyle(M):void 0;return{contentOverflow:`${ue.overflow}/${ue.overflowY}`,bodyOverflow:Ee?`${Ee.overflow}/${Ee.overflowY}`:void 0,bodyMaxHeight:Ee?.maxHeight,bodyHeight:Ee?.height}}catch{return}})()}),j=()=>{P.scrollTop=0,P.scrollLeft=0,M&&(M.scrollTop=0,M.scrollLeft=0),B&&(B.scrollTop=0,B.scrollLeft=0)},V=(typeof w=="number"&&Number.isFinite(w)&&w>=0?w:260)+220;console.log(`[RTE collapse debug][${U.current}] pre-collapse lastScrollStateRef`,Or.current),console.log(`[RTE collapse debug][${U.current}] lock start (before reset)`,Q()),j(),console.log(`[RTE collapse debug][${U.current}] lock start (after reset)`,Q()),window.requestAnimationFrame(()=>{console.log(`[RTE collapse debug][${U.current}] lock start (after rAF)`,Q())});const re=ue=>{ue.preventDefault(),ue.stopPropagation(),j(),console.log(`[RTE collapse debug][${U.current}] prevented scroll event`,{type:ue.type},Q())},ee=()=>console.log(`[RTE collapse debug][${U.current}] content scroll event`,Q()),J=()=>console.log(`[RTE collapse debug][${U.current}] body scroll event`,Q());P.addEventListener("wheel",re,{passive:!1}),P.addEventListener("touchmove",re,{passive:!1}),P.addEventListener("scroll",ee,{passive:!0}),M&&(M.addEventListener("wheel",re,{passive:!1}),M.addEventListener("touchmove",re,{passive:!1}),M.addEventListener("scroll",J,{passive:!0}));const se=performance.now();let K=0;const ae=ue=>{j(),ue-se<V&&(K=window.requestAnimationFrame(ae))};K=window.requestAnimationFrame(ae);const fe=window.setTimeout(()=>{j(),console.log(`[RTE collapse debug][${U.current}] lock end (after timeout)`,Q())},V);return()=>{P.removeEventListener("wheel",re),P.removeEventListener("touchmove",re),P.removeEventListener("scroll",ee),M&&(M.removeEventListener("wheel",re),M.removeEventListener("touchmove",re),M.removeEventListener("scroll",J)),window.cancelAnimationFrame(K),window.clearTimeout(fe),console.log(`[RTE collapse debug][${U.current}] lock cleanup`,Q())}},[b,w]),R.useEffect(()=>{if(b)return;let P=0;return P=window.requestAnimationFrame(()=>{di()}),()=>window.cancelAnimationFrame(P)},[b,Je,I,Ve,li.length,ci.length,di]),R.useEffect(()=>{const P=typeof w=="number"&&Number.isFinite(w)&&w>=0?w:260;if(P<=0){Xn(!1);return}Xn(!0);const M=window.setTimeout(()=>Xn(!1),P);return()=>window.clearTimeout(M)},[b,w]),R.useEffect(()=>{if(e.length>0){Gt(!1);return}const P=()=>{if(!y.current){Gt(!0);return}const B=y.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"",Q=y.current.querySelectorAll('[data-type="variable"]'),j=y.current.querySelectorAll('[data-type="upload"]');let X=!1;Q.forEach(re=>{(re.textContent?.replace(/[\u200B\n]/g,"").trim()||"")&&(X=!0)}),j.forEach(re=>{re.querySelector(".upload-inner-wrapper.has-file")&&(X=!0)});const V=!B&&!X;Gt(V),e.length===0&&Bt(!V)};P();const M=new MutationObserver(P);return y.current&&M.observe(y.current,{childList:!0,subtree:!0,characterData:!0}),()=>{M.disconnect()}},[e]);const BE=P=>{if(r){P.preventDefault();return}P.preventDefault();const M=P.clipboardData.getData("text/plain"),B=window.getSelection();if(B&&B.rangeCount>0){const V=B.anchorNode;if(V){let re=null;if(V.nodeType===Node.ELEMENT_NODE?re=V.closest('[data-type="variable"]'):V.nodeType===Node.TEXT_NODE&&V.parentElement&&(re=V.parentElement.closest('[data-type="variable"]')),re){const ee=re.dataset.multiKey;if(ee){const J=/[、,,\s\n\r\t]+/,se=M.split(J).map(K=>K.trim()).filter(K=>K.length>0);if(se.length>1){const K=parseInt(re.dataset.index||"0",10),ae=e.find(He=>He.type==="multi-variable"&&He.key===ee)?.maxCount||9,fe=Ve[ee]||1,ue=Math.min(K+se.length,ae);ue>fe&&it(Re=>({...Re,[ee]:ue}));const Ee=[];for(let Re=0;Re<fe;Re++){const He=`${ee}_${Re}`,It=y.current.querySelector(`[data-type="variable"][data-key="${He}"][data-multi-key="${ee}"]`);if(It){const hn=It.innerText.replace(/[\u200B\n]/g,"").trim();Ee.push(hn)}}Ee.splice(K,1,...se.slice(0,ae-K));const Ce=Ee.slice(0,ae);Ce.length>0&&Ce[Ce.length-1]!==""&&Ce.length<ae&&Ce.push("");const Oe=Math.max(Ce.length,1),Me={};Ce.forEach((Re,He)=>{Re&&(Me[`${ee}_${He}`]=Re)}),y.current.querySelectorAll('[data-type="variable"]').forEach(Re=>{const He=Re.dataset.key,It=Re.dataset.multiKey;if(He&&It!==ee){const hn=Re.innerText.replace(/[\u200B\n]/g,"").trim();hn&&(Me[He]=hn)}}),y.current.__tempVariableValues=Me,it(Re=>({...Re,[ee]:Oe}));return}}}}}let Q=!1,j="";const X=window.getSelection();if(X&&X.rangeCount>0){const V=X.anchorNode;if(V){let re=null;if(V.nodeType===Node.ELEMENT_NODE?re=V.closest('[data-type="variable"]'):V.nodeType===Node.TEXT_NODE&&V.parentElement&&(re=V.parentElement.closest('[data-type="variable"]')),re){const ee=re.getAttribute("data-node-type")||"",J=re.dataset.key;if(ee==="markdown"&&J&&/20\d{2}-\d{2}-\d{2}/.test(M))Q=!0,j=J,at.current[J]=M,be(se=>({...se,[J]:{...se[J],status:"loading",error:void 0}}));else if(ee==="report-url"&&J){document.execCommand("insertText",!1,M),fi(),setTimeout(()=>{const se=re.innerText.replace(/[\u200B\n]/g,"").trim();de.current(J,se)},0);return}}}}if(Q&&j){setTimeout(()=>{we.current(j,M)},0);return}document.execCommand("insertText",!1,M),fi(),setTimeout(()=>{/20\d{2}-\d{2}-\d{2}/.test(M)&&ht.current.tableData?.status==="success"&&(be(re=>({...re,tableData:{status:"loading",modules:[],lastParsedText:M,error:void 0}})),setTimeout(()=>{at.current.tableData=M,we.current("tableData",M)},0))},0)},FE=P=>{if(!P.target.files){P.target&&(P.target.value=""),W(null),ne(null),pe(null);return}const M=10*1024*1024,B=j=>j.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(j.name||""),Q=j=>B(j)&&j.size>M;if(q&&P.target.files&&P.target.files.length>0){const j=q,X=e.find(J=>J.type==="upload"&&J.key===j),V=Array.from(P.target.files),re=V.filter(J=>!Q(J)),ee=V.length-re.length;if(ee>0&&F.error(`已自动过滤 ${ee} 张超过 10MB 的图片,仅允许上传 10MB 以内图片`),X&&typeof X.maxCount=="number"&&typeof X.minCount=="number"){const J=X.maxCount,se=typeof S=="number"?S:0;T(K=>{const ae={...K};let fe=Math.min(Math.max(se,0),J-1);for(const ue of re){for(;fe<J&&ae[`${j}-${fe}`]!=null;)fe+=1;if(fe>=J)break;ae[`${j}-${fe}`]=ue,fe+=1}return ae})}}else if($&&P.target.files[0]){const j=P.target.files[0],X=$;Q(j)?F.error("图片大小不能超过 10MB(仅允许上传 10MB 以内图片)"):T(V=>({...V,[X]:j}))}P.target&&(P.target.value=""),W(null),ne(null),pe(null)},sl=P=>{T(M=>{const B={...M};return delete B[P],B})},HE=P=>{const M=P.target;if(M.closest(".rte-datepicker-wrapper")||M.closest(".rte-datepicker-host")||M.closest(".rte-select-wrapper")||M.closest(".rte-select-host")||M.closest(".ant-select-dropdown"))return;if(M.closest(".tag-close-btn")){if(P.preventDefault(),P.stopPropagation(),i)return;k(null),o?o():y.current&&(y.current.innerHTML="",y.current.focus());return}if(i){const j=M.closest(".tag-node"),X=M.closest('[data-type="text"]');if(j||X){P.preventDefault(),P.stopPropagation();const V=window.getSelection();V&&V.removeAllRanges();return}}M.closest('[data-type="variable"]')||(rt.current={x:P.clientX,y:P.clientY},ze.current=!1,M.closest(".file-remove-btn")&&(P.preventDefault(),P.stopPropagation()))},UE=P=>{if(!P.target.closest('[data-type="variable"]')&&rt.current){const Q=Math.abs(P.clientX-rt.current.x),j=Math.abs(P.clientY-rt.current.y);(Q>3||j>3)&&(ze.current=!0)}},$E=P=>{if(P.target.closest('[data-type="variable"]')){rt.current=null,ze.current=!1;return}rt.current=null,ze.current=!1},qE=P=>{if(r)return;b&&A?.(!1);const M=P.target;if(M.closest('[data-type="datepicker"]'))return;if(M.closest(".tag-close-btn")){P.preventDefault(),P.stopPropagation();return}if(e.length===0)return;const j=(K,ae)=>{if(!y.current)return;Array.from(y.current.children).forEach(ue=>{if(ue!==K)if(ae)ue.dataset.prevDisplay===void 0&&(ue.dataset.prevDisplay=ue.style.display||""),ue.dataset.rteForceHidden="1",ue.style.setProperty("display","none","important");else{if(ue.dataset.prevDisplay!==void 0){const Ee=ue.dataset.prevDisplay;Ee?ue.style.display=Ee:ue.style.removeProperty("display"),delete ue.dataset.prevDisplay}else ue.style.removeProperty("display");delete ue.dataset.rteForceHidden}})},X=M.closest(".rte-textarea-toggle");if(X){P.preventDefault(),P.stopPropagation();const K=X.closest(".rte-textarea-wrapper"),ae=K?.querySelector('[data-type="textarea"]'),ue=!(X.getAttribute("data-expanded")==="true");X.setAttribute("data-expanded",String(ue)),X.textContent=ue?"收起":"展开",K&&K.classList.toggle("rte-textarea-expanded",ue);const Ee=K?.closest(".rte-textarea-required");if(Ee?Ee.classList.toggle("rte-textarea-overlay",ue):K&&K.classList.toggle("rte-textarea-overlay",ue),ae)if(ue)ae.classList.add("rte-textarea-expanded"),ae.style.maxHeight="none",ae.style.height="100%";else{ae.classList.remove("rte-textarea-expanded");const Ce=ae.dataset.maxHeight||"252";ae.style.maxHeight=`${Ce}px`,ae.style.height="auto"}y.current&&(ue?y.current.classList.add("rte-overlay-active"):y.current.classList.remove("rte-overlay-active"));return}const V=M.closest(".rte-richtext-toggle");if(V){P.preventDefault(),P.stopPropagation();const K=V.closest(".rte-richtext-wrapper"),ae=K?.querySelector('[data-type="richtext"]'),ue=!(V.getAttribute("data-expanded")==="true");((Me,Fe)=>{Me.setAttribute("data-expanded",String(Fe)),Me.innerHTML=Fe?'<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>':'<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>'})(V,ue);const Ce=K?.closest(".rte-richtext-required");Ce?Ce.classList.toggle("rte-richtext-expanded",ue):K&&K.classList.toggle("rte-richtext-expanded",ue);const Oe=K?.closest(".exclusion-wrapper")||K?.parentElement;if(ae&&(ue?(ae.style.height="100%",ae.style.overflow="auto"):(ae.style.height="",ae.style.overflow="")),Oe&&(Oe.classList.toggle("rte-richtext-host-expanded",ue),j(Oe,ue)),y.current){if(y.current.classList.toggle("rte-richtext-fullscreen-active",ue),O.current?.classList.toggle("rte-richtext-container-expanded",ue),O.current)if(ue){const Me=Math.ceil(O.current.getBoundingClientRect().height||0);Me>0&&O.current.style.setProperty("--rte-richtext-fullscreen-height",`${Me}px`)}else O.current.style.removeProperty("--rte-richtext-fullscreen-height");if(ue)wr.current=y.current.scrollTop||0,setTimeout(()=>{y.current&&(y.current.scrollTop=0,y.current.scrollLeft=0)},0);else{const Me=wr.current||0;setTimeout(()=>{y.current&&(y.current.scrollTop=Me)},0)}}return}if(M.closest('[data-type="text"]')){P.preventDefault(),P.stopPropagation();const K=window.getSelection();K&&K.removeAllRanges();return}if(i&&M.closest(".tag-node")){P.preventDefault(),P.stopPropagation();const ae=window.getSelection();ae&&ae.removeAllRanges();return}if(M.closest('[data-type="variable"]')){if(ze.current)return;setTimeout(()=>{const K=window.getSelection();K&&!K.isCollapsed||ni(y)},10);return}const J=M.closest(".file-remove-btn");if(J){P.preventDefault(),P.stopPropagation();const K=J.closest('[data-type="upload"]'),ae=K?.dataset.key,fe=K?.dataset.batchKey;if(ae)if(fe){const ue=e.find(Ee=>Ee.type==="upload"&&Ee.key===fe);if(ue&&typeof ue.maxCount=="number"&&typeof ue.minCount=="number"){const Ee=ue.maxCount;T(Ce=>{const Oe={...Ce},Me=[];for(let Fe=0;Fe<Ee;Fe++){const Re=`${fe}-${Fe}`,He=Oe[Re];He!=null&&Re!==ae&&Me.push(He)}for(let Fe=0;Fe<Ee;Fe++)delete Oe[`${fe}-${Fe}`];return Me.forEach((Fe,Re)=>{Oe[`${fe}-${Re}`]=Fe}),Oe})}else sl(ae)}else sl(ae);return}const se=M.closest('[data-type="upload"]');if(se){const K=se.dataset.key,ae=se.dataset.batchKey,fe=se.dataset.batchIndex;if(K){const ue=ae||K,Ee=e.find(Ce=>Ce.type==="upload"&&Ce.key===ue);if(D.current&&(Ee?.accept?D.current.accept=Ee.accept:Ee?.acceptType==="image"?D.current.accept="image/*":Ee?.acceptType==="file"?D.current.accept=".csv,.xlsx,.xls,.txt,.pdf,.doc,.docx,.json":D.current.accept=""),ae){const Ce=e.find(Oe=>Oe.type==="upload"&&Oe.key===ae);if(Ce&&typeof Ce.maxCount=="number"&&typeof Ce.minCount=="number"){const Oe=Ce.maxCount,Me=I[K]!=null,Fe=fe!=null?Number.parseInt(fe,10):NaN;if(Me){D.current&&(D.current.multiple=!1),ne(null),pe(null),W(K),D.current?.click();return}let Re=0;for(let He=0;He<Oe;He++)I[`${ae}-${He}`]!=null&&(Re+=1);Re<Oe&&D.current?(D.current.multiple=!0,ne(ae),pe(Number.isFinite(Fe)?Fe:null),W(null),D.current.click()):(D.current&&(D.current.multiple=!1),ne(null),pe(null),W(K),D.current?.click())}else D.current&&(D.current.multiple=!1),ne(null),pe(null),W(K),D.current?.click()}else D.current&&(D.current.multiple=!1),ne(null),pe(null),W(K),D.current?.click()}return}},zE=P=>{const B=P.target.closest('[data-type="variable"]');if(B){const Q=window.getSelection();if(Q){const j=document.createRange(),X=B.textContent||"";if(X.replace(/\u200B/g,"")){let re=0,ee=X.length;X.startsWith("​")&&(re=1),X.endsWith("​")&&X.length>1&&(ee=X.length-1);const J=B.firstChild;J&&J.nodeType===Node.TEXT_NODE?(j.setStart(J,re),j.setEnd(J,ee)):j.selectNodeContents(B)}else j.selectNodeContents(B),j.collapse(!0);Q.removeAllRanges(),Q.addRange(j)}}},fi=()=>{if(e.length===0){if(y.current){const B=!(y.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"");Gt(B),Bt(!B)}return}if(ni(y),y.current&&y.current.querySelectorAll('[data-type="variable"][data-node-type="report-url"]').forEach(B=>{const Q=B.dataset.key;if(!Q)return;B.innerText.replace(/[\u200B\n]/g,"").trim()||te(X=>{const V=X[Q];return!V||V.status==="idle"&&(!V.modules||V.modules.length===0)?X:{...X,[Q]:{status:"idle",modules:[],lastParsedUrl:void 0,error:void 0}}})}),y.current&&y.current.querySelectorAll('[data-type="variable"][data-node-type="markdown"]').forEach(B=>{const Q=B.dataset.key;if(!Q)return;B.innerText.replace(/[\u200B\n]/g,"").trim()||be(X=>{const V=X[Q];return!V||V.status==="idle"&&(!V.modules||V.modules.length===0)?X:{...X,[Q]:{status:"idle",modules:[],lastParsedText:void 0,error:void 0}}})}),y.current&&y.current.querySelectorAll('[data-type="richtext"][data-node-type="markdown-module"]').forEach(B=>{const Q=B.dataset.key;if(!Q)return;B.innerText.replace(/[\u200B\n]/g,"").trim()||be(X=>{const V=X[Q];return!V||V.status==="idle"?X:{...X,[Q]:{status:"idle",modules:[],lastParsedText:void 0,error:void 0}}})}),y.current&&y.current.querySelectorAll('[data-type="variable"]').forEach(B=>{const Q=B.querySelector(".variable-info-icon");if(Q){let j=!1;const X=document.createTreeWalker(B,NodeFilter.SHOW_TEXT,{acceptNode:V=>Q.contains(V)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;X.nextNode();)if(X.currentNode.textContent?.replace(/[\u200B\n]/g,"").trim()){j=!0;break}j?Q.classList.add("hidden"):Q.classList.remove("hidden")}}),b||window.requestAnimationFrame(()=>{di()}),ei(y,Je,I),ti(y,Je,I,Bt),!y.current)return;e.filter(M=>M.type==="multi-variable"&&M.key).forEach(M=>{if(!M.key)return;const B=M.maxCount||9,Q=Ve[M.key]||1,j=[];for(let J=0;J<Q;J++){const se=`${M.key}_${J}`,K=y.current.querySelector(`[data-type="variable"][data-key="${se}"][data-multi-key="${M.key}"]`);if(K){const ae=K.innerText.replace(/[\u200B\n]/g,"").trim();j.push(ae)}}const V=(j[j.length-1]||"")==="";let re=!1,ee=-1;for(let J=0;J<j.length-1;J++)if(j[J]===""){re=!0,ee=J;break}if(re&&ee>=0){const J=window.getSelection();if(J&&J.rangeCount>0){const ue=J.getRangeAt(0),Ee=ue.startContainer,Ce=Ee.nodeType===Node.ELEMENT_NODE?Ee.closest('[data-type="variable"][data-multi-key]'):Ee.parentElement?.closest('[data-type="variable"][data-multi-key]');if(Ce){const Oe=Ce.dataset.key;if(Oe){const Me=document.createRange();Me.setStartBefore(Ce),Me.setEnd(ue.startContainer,ue.startOffset);const Fe=Me.toString().length;fn.current={key:Oe,offset:Fe}}}}const se=[...j];for(let ue=ee;ue<se.length-1;ue++)se[ue]=se[ue+1];se.pop();const K={};se.forEach((ue,Ee)=>{ue&&(K[`${M.key}_${Ee}`]=ue)});const ae=Math.max(V?se.length:se.length+1,1);y.current.querySelectorAll('[data-type="variable"]').forEach(ue=>{const Ee=ue.dataset.key,Ce=ue.dataset.multiKey;if(Ee&&Ce!==M.key){const Oe=ue.innerText.replace(/[\u200B\n]/g,"").trim();Oe&&(K[Ee]=Oe)}}),y.current.__tempVariableValues=K,it(ue=>({...ue,[M.key]:ae}));return}if(!V){const J=Q-1,se=`${M.key}_${J}`,K=y.current.querySelector(`[data-type="variable"][data-key="${se}"][data-multi-key="${M.key}"]`);if(K&&K.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&Q<B){const fe=window.getSelection();if(fe&&fe.rangeCount>0){const ue=fe.getRangeAt(0),Ee=ue.startContainer,Ce=Ee.nodeType===Node.ELEMENT_NODE?Ee.closest('[data-type="variable"][data-multi-key]'):Ee.parentElement?.closest('[data-type="variable"][data-multi-key]');if(Ce){const Oe=Ce.dataset.key;if(Oe){const Me=document.createRange();Me.setStartBefore(Ce),Me.setEnd(ue.startContainer,ue.startOffset);const Fe=Me.toString().length;fn.current={key:Oe,offset:Fe}}}}it(ue=>({...ue,[M.key]:Q+1}))}}})};R.useLayoutEffect(()=>{const P=y.current;if(!P)return;const M=new Map,B=X=>{const V=X.target,re=X.relatedTarget;!V||!y.current||!y.current.contains(V)||re&&y.current.contains(re)||setTimeout(()=>{if(y.current){if(e.length===0){const ee=y.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";Bt(ee.length>0);return}ni(y),ei(y,Je,I),ti(y,Je,I,Bt)}},0)};P.addEventListener("blur",B,!0);const Q=()=>{if(!y.current)return;M.forEach((re,ee)=>{ee.removeEventListener("blur",re,!1)}),M.clear();const X=y.current.querySelectorAll('[data-type="variable"][data-multi-key]'),V=re=>{re.stopPropagation(),re.stopImmediatePropagation();const ee=re.target;if(!ee||!y.current||!y.current.contains(ee))return;const J=ee.closest('[data-type="variable"][data-multi-key]');if(!J||!y.current.contains(J))return;let se=!1;if(M.forEach((Me,Fe)=>{(Fe===J||Fe.contains(ee))&&(se=!0)}),!se)return;const K=J.dataset.multiKey,ae=J.dataset.key,fe=J.dataset.index;if(!K||!ae||fe===void 0)return;const ue=re.relatedTarget;if(!(!ue||!y.current.contains(ue)))return;const Ce=J.innerText.replace(/[\u200B\n]/g,"").trim(),Oe=/[、,,\s]+/;if(Oe.test(Ce)){const Re=Ce.split(Oe).map(He=>He.trim()).filter(He=>He.length>0).slice(0,9);if(Re.length>1){const He=e.find(It=>It.type==="multi-variable"&&It.key===K);if(He){const It=Ve[K]||1,hn=parseInt(fe,10),ol=He.maxCount||9,pi=[];for(let ft=0;ft<It;ft++){const mn=`${K}_${ft}`,Dr=y.current.querySelector(`[data-type="variable"][data-key="${mn}"][data-multi-key="${K}"]`);if(Dr){const Pr=Dr.innerText.replace(/[\u200B\n]/g,"").trim();pi.push(Pr)}}pi.splice(hn,1,...Re);const jt=pi.slice(0,ol);jt.length>0&&jt[jt.length-1]!==""&&jt.length<ol&&jt.push("");const KE=Math.max(jt.length,1),hi={};jt.forEach((ft,mn)=>{ft&&(hi[`${K}_${mn}`]=ft)}),y.current.querySelectorAll('[data-type="variable"]').forEach(ft=>{const mn=ft.dataset.key,Dr=ft.dataset.multiKey;if(mn&&Dr!==K){const Pr=ft.innerText.replace(/[\u200B\n]/g,"").trim();Pr&&(hi[mn]=Pr)}}),y.current.__tempVariableValues=hi,it(ft=>({...ft,[K]:KE}))}}}};X.forEach(re=>{re.addEventListener("blur",V,!1),M.set(re,V)})},j=setTimeout(()=>{Q()},0);return()=>{clearTimeout(j),P.removeEventListener("blur",B,!0),M.forEach((X,V)=>{V.removeEventListener("blur",X,!1)}),M.clear()}},[e,Je,Ve,I]);const VE=P=>{if(r){P.preventDefault();return}if(P.key==="Enter"){const B=P.target,Q=!!B?.closest?.('[data-type="richtext"]'),j=B?.tagName==="TEXTAREA"||!!B?.closest?.('[data-type="textarea"]');if(!Q&&!j){P.preventDefault();return}}const M=window.getSelection();if(M&&M.rangeCount>0){const B=M.anchorNode;let Q=null;if(B&&(B.nodeType===Node.ELEMENT_NODE?Q=B.closest('[data-type="text"]'):B.nodeType===Node.TEXT_NODE&&B.parentElement&&(Q=B.parentElement.closest('[data-type="text"]'))),Q){if(P.preventDefault(),P.stopPropagation(),y.current){const j=y.current.querySelector('[data-type="variable"], [data-type="upload"]');j&&j.focus()}return}}if(i&&M&&M.rangeCount>0){const B=M.anchorNode;let Q=null;if(B&&(B.nodeType===Node.ELEMENT_NODE?Q=B.closest(".tag-node"):B.nodeType===Node.TEXT_NODE&&B.parentElement&&(Q=B.parentElement.closest(".tag-node"))),Q){if(P.preventDefault(),P.stopPropagation(),y.current){const j=y.current.querySelector('[data-type="variable"], [data-type="upload"]');j&&j.focus()}return}}if(P.key==="Escape"&&y.current){if(i){P.preventDefault();return}y.current.innerHTML="",y.current.focus()}if(P.key==="Backspace"){const B=window.getSelection();if(B&&B.rangeCount>0){const Q=B.getRangeAt(0),j=B.anchorNode;if(i){let V=null,re=null;if(j&&(j.nodeType===Node.ELEMENT_NODE?(V=j.closest(".tag-node"),re=j.closest('[data-type="text"]')):j.nodeType===Node.TEXT_NODE&&j.parentElement&&(V=j.parentElement.closest(".tag-node"),re=j.parentElement.closest('[data-type="text"]'))),(V||re)&&Q.collapsed&&Q.startOffset===0){P.preventDefault();return}}let X=null;if(j&&(j.nodeType===Node.ELEMENT_NODE?X=j.closest('[data-type="variable"]'):j.nodeType===Node.TEXT_NODE&&j.parentElement&&(X=j.parentElement.closest('[data-type="variable"]'))),X){if(!Q.collapsed)return;const V=X.innerText;if(V==="​"||V===""){P.preventDefault();return}if(Q.startOffset===0){P.preventDefault();return}if(V.startsWith("​")&&Q.startOffset===1){P.preventDefault();return}}}}},YE=()=>{if(n||r||d||!Ct||!y.current)return;if(e.length===0){const X=y.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";if(!X)return;if(t(X,X),y.current){y.current.textContent="";const V=new Event("input",{bubbles:!0});y.current.dispatchEvent(V)}return}const P=y.current;let M="";const B={},Q=X=>{if(!(X.nodeType===Node.ELEMENT_NODE&&X.style.display==="none")){if(X.nodeType===Node.TEXT_NODE)M+=(X.textContent||"").replace(/\u200B/g,"");else if(X.nodeType===Node.ELEMENT_NODE){const V=X,re=V.dataset.type,ee=V.dataset.key;if(re==="variable"&&ee){let J="";const se=document.createTreeWalker(V,NodeFilter.SHOW_TEXT,{acceptNode:ae=>{const fe=V.querySelector(".variable-info-icon");return fe&&fe.contains(ae)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;se.nextNode();)J+=se.currentNode.textContent||"";const K=J.replace(/[\u200B\n]/g,"").trim();if(K){const ae=V.dataset.multiKey;if(ae){(!B[ae]||!Array.isArray(B[ae]))&&(B[ae]=[]);const fe=B[ae];fe.push(K),fe.length>1&&(M+=" "),M+=K}else B[ee]=K,M+=K;if(V.dataset.nodeType==="report-url")if(B.url===void 0)B.url=K;else{const fe=B.url;Array.isArray(fe)?fe.push(K):B.url=[String(fe),K]}if(V.dataset.nodeType==="markdown"){const fe=V.dataset.sourceTextKey||`${ee}__sourceText`;if(B[fe]===void 0)B[fe]=K;else{const Ee=B[fe];Array.isArray(Ee)?Ee.push(K):B[fe]=[String(Ee),K]}const ue=`${ee}__markdown`;B[ue]===void 0&&(B[ue]=[qu(K)])}}}else if(re==="select"&&ee){const J=(V.getAttribute("data-value")||"").trim();J&&(B[ee]=J,M+=J)}else if(re==="textarea"&&ee){const se=(V.value||"").replace(/\u200B/g,"").trim();se&&(B[ee]=se,M+=se)}else if(re==="richtext"&&ee){const J=V,se=J.dataset.nodeType,K=(J.textContent||"").replace(/\u200B/g,"").trim();if(K)if(se==="report-module"||se==="markdown-module"){(!B[ee]||!Array.isArray(B[ee]))&&(B[ee]=[]);const ae=B[ee];ae.push(K),ae.length>1&&(M+=" "),M+=K}else B[ee]=K,M+=K}else if(re==="datepicker"&&ee){const se=(V.getAttribute("data-value")||"").trim();if(se)if(se.includes(",")){const K=se.split(",");K.length===2?(B[ee]=K,M+=`[${K[0]}, ${K[1]}]`):(B[ee]=se,M+=se)}else B[ee]=se,M+=se}else if(re==="number-input"&&ee){const se=(V.value||"").trim();se&&(B[ee]=se,M+=se)}else if(re==="upload"&&ee){const J=V.dataset.batchKey;if(J){const se=e.find(K=>K.type==="upload"&&K.key===J);if(se&&typeof se.maxCount=="number"&&typeof se.minCount=="number"){const K=[];for(let ae=0;ae<se.maxCount;ae++){const fe=`${J}-${ae}`,ue=I[fe];ue&&K.push(ue)}B[J]||(B[J]=K.length>0?K:null,K.length>0&&(M+=` [附带${K.length}个文件: ${K.map(ae=>ae.name).join(", ")}] `))}else B[ee]=I[ee]??null,I[ee]&&(M+=` [附带文件: ${I[ee]?.name}] `)}else B[ee]=I[ee]??null,I[ee]&&(M+=` [附带文件: ${I[ee]?.name}] `)}else{if(V.classList.contains("tag-close-btn")||V.classList.contains("file-remove-btn"))return;V.getAttribute("contenteditable")==="false"&&!re&&V.classList.contains("tag-node")?M+=V.innerText:V.childNodes.forEach(Q)}}}};if(P.childNodes.forEach(Q),M=M.trim(),!M)return;Object.keys(me).forEach(X=>{const V=me[X];if(!V||!V.modules||V.modules.length===0)return;const re=V.modules.map(ee=>(ee?.markdown||"").trim()).filter(ee=>ee.length>0);re.length!==0&&(B[`${X}__markdown`]=re)});const j=new FormData;j.append("fullPrompt",M),Object.keys(B).forEach(X=>{const V=B[X];if(V!=null)if(V instanceof File)j.append(X,V);else if(Array.isArray(V)){const re=e.some(K=>K.type==="multi-variable"&&K.key===X),ee=e.some(K=>K.type==="report-url"&&K.key===X),J=X.endsWith("__markdown");re||ee||J||X==="url"?V.forEach(K=>{K!=null&&K!==""&&j.append(X,String(K))}):V.forEach((K,ae)=>{K!=null&&(K instanceof File?j.append(`${X}[${ae}]`,K):typeof K=="string"?j.append(`${X}[${ae}]`,K):j.append(`${X}[${ae}]`,String(K)))})}else typeof V=="string"?j.append(X,V):j.append(X,String(V))}),t(j,M)},GE={...a?{width:typeof a=="number"?`${a}px`:a}:{},...h?{border:h}:{},...g?{background:g}:{},...c?{maxHeight:typeof c=="number"?`${c}px`:c}:{},...E?{minHeight:typeof E=="number"?`${E}px`:E}:{},...c?{"--rte-richtext-fullscreen-height":typeof c=="number"?`${c}px`:c}:{}},WE=typeof w=="number"&&Number.isFinite(w)&&w>=0?w:260,jE={overflow:"hidden"},XE={maxHeight:b?`${jn}px`:`${Math.max(ii,jn)}px`,overflow:b||oi?"hidden":"auto",transition:`max-height ${WE}ms cubic-bezier(0.4, 0, 0.2, 1)`,willChange:"max-height"};return G.jsxs("div",{className:"rich-text-editor",style:GE,"data-disabled":r,ref:O,children:[z,G.jsx("div",{className:"rich-text-editor-content",ref:L,style:jE,children:G.jsxs("div",{ref:H,className:"rich-text-editor-content-body",style:XE,children:[G.jsx("div",{ref:y,className:`rte-editor ${e.length===0?"rte-editor-default":""} ${vr&&f?"rte-editor-empty":""}`,contentEditable:e.length===0,suppressContentEditableWarning:!0,"data-placeholder":f,onMouseDown:HE,onMouseMove:UE,onMouseUp:$E,onClick:qE,onDoubleClick:zE,onInput:fi,onKeyDown:VE,onPaste:BE}),G.jsx("input",{type:"file",ref:D,className:"rte-file-input",accept:".csv,.xlsx,.xls,.txt,.pdf,image/*",onChange:FE})]})}),G.jsxs("div",{className:"rich-text-editor-footer",children:[G.jsx("div",{className:"rich-text-editor-footer-left",children:G.jsxs("div",{className:"rich-text-editor-brand",children:[G.jsxs("div",{className:"rte-brand-badge",children:[G.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""}),G.jsx("span",{className:"rte-brand-text",children:"SealSeek 1.0"})]}),p!=="hideAgent"&&G.jsx(xe.Dropdown,{placement:"topLeft",menu:{items:s.filter(P=>P.isShowNew!==1).map(P=>({key:P.key,label:G.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[P.icon&&G.jsx("i",{className:P.icon}),G.jsx("span",{children:P.label})]}),onClick:()=>{u?.(P)}}))},trigger:["click"],disabled:r||n,overlayClassName:"rte-agent-dropdown",children:G.jsxs("div",{className:"rte-agent-badge",style:{cursor:s.length>0?"pointer":"default"},children:[G.jsx("i",{className:"iconfont icon-zhinengti",style:{fontSize:"16px"}}),G.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})]})}),G.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(()=>{const P=e.find(B=>B.type==="tag");if(!P||!P.text)return null;const M=s.find(B=>B.label===P.text);return!M||M.points===void 0||M.points===null?null:G.jsxs("div",{className:"rte-points-badge",style:{position:"relative"},children:[G.jsx("i",{className:"iconfont icon-jifen",style:{marginRight:"4px",fontSize:"16px"}}),G.jsxs("span",{style:{fontSize:"16px",lineHeight:"22px"},children:["-",String(M.points)]}),M.labelValue===2&&G.jsx("div",{className:"rte-limited-free-badge",children:G.jsx("span",{className:"rte-limited-free-text",children:"限时免费"})})]})})(),G.jsx("button",{type:"button",onClick:YE,disabled:n||r||d||!Ct,className:"rich-text-editor-send-button",children:n||d?G.jsx("span",{className:"rte-send-spinner"}):G.jsx("i",{className:"iconfont icon-fasong"})})]})]}),ce?.anchorEl&&(()=>{if(!document.body.contains(ce.anchorEl))return null;let P="",M={background:"#fff",padding:12,borderRadius:8,border:"0.5px solid #E5E5E5",boxShadow:"0 4px 20px 0 rgba(129, 124, 143, 0.2)"},B=!1;const Q=X=>{const V=IE(X);if(!V)return null;if(V.kind==="text")return{node:V.text,steps:!1};const re=V.data,ee=Math.max(0,re.images?.length||0);if(ee<=0)return{node:re.title,steps:!1};const J=Math.min(Math.max(ye,0),ee-1),se=Array.isArray(re.stepDescriptions)&&re.stepDescriptions[J]||"";return{node:G.jsxs("div",{className:"rte-steps-tooltip",style:Pe?{width:`${Pe}px`}:void 0,onMouseLeave:()=>{N||k(null)},onClick:ae=>{ae.preventDefault(),ae.stopPropagation()},children:[G.jsxs("div",{className:"rte-steps-tooltip-header",children:[G.jsx("div",{className:"rte-steps-tooltip-title",children:re.title}),G.jsxs("div",{className:"rte-steps-tooltip-step-badge",children:["步骤 ",J+1,"/",ee]})]}),re.description?G.jsx("div",{className:"rte-steps-tooltip-desc",children:G.jsx(yo,{remarkPlugins:[Mu,Yu],rehypePlugins:[xu,[Nu,Vu]],components:{p:({children:ae})=>G.jsx("p",{style:{margin:0},children:ae})},children:re.description})}):null,G.jsx("div",{className:"rte-steps-tooltip-media",children:G.jsx(xe.Image.PreviewGroup,{preview:{visible:ge,current:J,onVisibleChange:ae=>ke(ae),onChange:ae=>{const fe=Math.min(Math.max(ae,0),ee-1);Se(fe),_e.current?.slideTo(fe)}},children:G.jsx(Gi,{className:"rte-steps-tooltip-swiper",modules:[Fc,Hc],navigation:!0,pagination:{clickable:!0},initialSlide:J,onSwiper:ae=>{_e.current=ae},onSlideChange:ae=>Se(ae.activeIndex),children:re.images.map((ae,fe)=>G.jsx(Wi,{children:G.jsx(xe.Image,{className:"rte-steps-tooltip-img",src:ae,alt:`step-${fe+1}`,width:"100%",height:114,style:{width:"100%",height:114,display:"block",borderRadius:"4px !important"},imgStyle:{width:"100%",height:"100%",objectFit:"cover",display:"block"},preview:{mask:null},onClick:()=>{Se(fe),_e.current?.slideTo(fe),ke(!0)}})},`${ae}-${fe}`))},`${ce.key}-${ce.type}`)})}),G.jsx("div",{className:"rte-steps-tooltip-footer",children:G.jsx("div",{className:"rte-steps-tooltip-step-text",children:G.jsx(yo,{remarkPlugins:[Mu,Yu],rehypePlugins:[xu,[Nu,Vu]],components:{p:({children:ae})=>G.jsx("p",{style:{margin:0},children:ae})},children:se})})})]}),steps:!0}};if(ce.type==="upload"){const X=ce.anchorEl.dataset.tooltip,V=Q(X);if(V)P=V.node,B=V.steps;else{const re=e.find(J=>J.type==="upload"&&J.key===ce.key),ee=Q(typeof re?.tooltip=="string"?re?.tooltip:re?.tooltip?JSON.stringify(re.tooltip):"");P=ee?.node||"",B=ee?.steps||!1}}else if(ce.type==="tag"){const X=ce.anchorEl.dataset.tooltip,V=Q(X);P=V?.node||"",B=V?.steps||!1}else if(ce.type==="upload-label")P=ce.anchorEl.querySelector(".upload-label[data-file-name]")?.dataset.fileName||ce.anchorEl.dataset.fileName||"";else if(ce.type==="variable"){const X=ce.anchorEl.dataset.tooltip,V=Q(X);P=V?.node||"",B=V?.steps||!1}else if(ce.type==="upload-preview"){const X=I[ce.key],V=!!X&&(X.type?.startsWith("image/")||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(X.name||""));if(X&&V){const re=URL.createObjectURL(X);P=G.jsx("div",{className:"rte-upload-preview",children:G.jsx("img",{className:"rte-upload-preview-img",src:re,alt:X.name})}),M={background:"#fff",padding:0,borderRadius:4,boxShadow:"0 2px 12px 0 rgba(153, 153, 153, 0.25)"},setTimeout(()=>URL.revokeObjectURL(re),1e3)}else P=""}return P?(B&&(M={background:"#fff",padding:0,borderRadius:12,boxShadow:"0 4px 20px 0 rgba(129, 124, 143, 0.2)",border:"0.5px solid #E5E5E5"}),Mr.createPortal(G.jsx(xe.Tooltip,{arrow:!1,title:ce.type==="upload-preview"||B?P:G.jsx("div",{style:{maxWidth:"200px",fontSize:"12px",color:"#0A0A0A"},onMouseLeave:()=>{N||k(null)},onClick:X=>{X.preventDefault(),X.stopPropagation()},children:P}),open:!0,placement:ce.type==="upload-preview"?"topLeft":"top",getPopupContainer:()=>document.body,overlayInnerStyle:M,overlayClassName:"rte-tooltip-overlay",children:G.jsx("div",{style:{position:"fixed",left:`${ce.anchorEl.getBoundingClientRect().left}px`,top:`${ce.anchorEl.getBoundingClientRect().top-(ce.type==="upload-label"?4:0)}px`,width:`${ce.anchorEl.offsetWidth}px`,height:`${ce.anchorEl.offsetHeight}px`,pointerEvents:"none"}})}),document.body)):null})(),ci,li]})};Gu.__docgenInfo={displayName:"RichTextEditor",description:"结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",props:{config:{name:"config",required:!0,description:"结构化输入配置节点数组",type:{name:"InputNode[]",raw:"InputNode[]"}},onSend:{name:"onSend",required:!0,description:"点击发送按钮时的回调,返回数据与拼接后的 Prompt",type:{name:"function",raw:"(data: Record<string, any>, fullPrompt: string) => void"}},isProcessing:{name:"isProcessing",required:!1,description:"是否处于处理状态(禁用输入与发送)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}}}};const Wu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==",NE=[{label:"5页",value:5},{label:"10页",value:10},{label:"15页",value:15},{label:"30页",value:30}],kE=({autoLoading:e,batchSize:t,loadingProgress:n,loadIcon:r,onBatchSizeChange:a,onLoadNextPage:i,onStartAutoLoad:s,onStopLoad:u})=>e&&n?G.jsxs("div",{className:"auto_load_progress",children:[r||G.jsx("img",{src:Wu,alt:"自动加载",width:14,height:14}),G.jsxs("span",{children:["正在加载第",n.currentPage,"/",n.totalPages,"页"]}),G.jsx(xe.Progress,{percent:n.percentage,type:"line",size:[160,8]}),G.jsx("span",{onClick:u,className:"auto_load_stop_btn",children:"停止加载"})]}):G.jsxs("div",{className:"auto_load_container",children:[G.jsx("div",{onClick:i,className:"auto_load_next_btn",style:{backgroundColor:e?"#f5f5f5":"#2563eb"},children:"加载下一页"}),G.jsxs("div",{className:"right_control_wrap",style:{backgroundColor:e?"#f5f5f5":"#2563eb"},children:[G.jsxs("div",{className:"auto_load_btn",onClick:e?void 0:s,children:[r||G.jsx("img",{src:Wu,alt:"自动加载",width:14,height:14}),G.jsx("span",{children:"自动加载"})]}),G.jsx(xe.Select,{value:t,onChange:a,options:NE,disabled:e,size:"small",className:"auto_load_select",popupMatchSelectWidth:84})]})]}),vE=({current:e,loadIcon:t,pageSize:n,total:r,cachedPages:a,loadedCount:i,autoLoading:s=!1,loadingProgress:u,onChange:o,onLoadNextPage:d,onStartAutoLoad:f,onStopLoading:h})=>{const[g,p]=R.useState(5),c=Math.ceil(r/n),E=R.useMemo(()=>a.length>=c,[a,c]),b=()=>Array.from({length:c},(A,w)=>w+1).filter(A=>!a.includes(A)).slice(0,g),m=(x,A,w)=>{const N=a.includes(x);return A==="prev"||A==="next"||A==="jump-prev"||A==="jump-next"?G.jsx("div",{className:"pageBox",children:w}):G.jsxs("div",{className:"pageBox",style:{backgroundColor:e===x?"#2563EB":"#f5f5f5",color:e===x?"#fff":N?"#171717":"#a3a3a3"},children:[x,!N&&G.jsx("span",{className:"unload_spot"})]})};return G.jsxs("div",{className:"pagination_footer",children:[G.jsxs("div",{className:"pagination_leftWrap",children:[G.jsxs("span",{className:"pagination_total",children:[G.jsx(kt.InfoCircleOutlined,{style:{color:"#2563EB",marginRight:"4px"}}),"已加载: ",i,"/",r,"条数据"]}),!E&&G.jsx(kE,{loadIcon:t||void 0,autoLoading:s,batchSize:g,loadingProgress:u,disabled:!d||!f,onBatchSizeChange:p,onLoadNextPage:()=>d?.(),onStartAutoLoad:()=>{const x=b();f?.(x)},onStopLoad:()=>h?.()})]}),G.jsx(xe.Pagination,{current:e,pageSize:n,total:r,onChange:x=>o(x),showSizeChanger:!1,showQuickJumper:!1,showTotal:()=>"",itemRender:m})]})},ju=e=>{const{loading:t,autoLoading:n,loadingProgress:r,columns:a=[],dataSource:i=[],total:s,current:u,pageSize:o,cachedPages:d,onChangePage:f,onLoadNextPage:h,onStartAutoLoad:g,onStopLoading:p,...c}=e,E=R.useRef(null),b=R.useCallback(m=>{f(m),d.includes(m)&&E.current?.scrollTo({key:`${(m-1)*o+1}`})},[d,f,o]);return G.jsxs("div",{className:"flex flex-col",children:[G.jsx(xe.Table,{ref:E,...c,columns:a,dataSource:i,pagination:!1,virtual:!0}),G.jsx(vE,{loading:t,autoLoading:n,loadingProgress:r,current:u,pageSize:o,total:s,loadedCount:i.length,cachedPages:d,onChange:b,onLoadNextPage:h,onStartAutoLoad:g,onStopLoading:p})]})};ju.__docgenInfo={displayName:"VirtualTable",description:"虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",props:{loading:{description:"加载状态",name:"loading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},total:{description:"总数据条数",name:"total",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"0"}},current:{description:"当前页码",name:"current",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"1"}},pageSize:{description:"每页数据条数",name:"pageSize",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"10"}},cachedPages:{description:"已缓存的页码数组",name:"cachedPages",required:!0,type:{name:"number[]",raw:"number[]"},defaultValue:{value:"[]"}},dataSource:{description:"数据源",name:"dataSource",required:!0,type:{name:"Array<T>",raw:"Array<T>"},defaultValue:{value:"[]"}},onChangePage:{description:"页码变更回调函数",name:"onChangePage",required:!0,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},autoLoading:{description:"是否正在自动加载",name:"autoLoading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},loadingProgress:{description:"加载进度信息",name:"loadingProgress",required:!0,type:{name:"object",raw:"{percentage: 0, currentPage: 1, totalPages: 5}"},defaultValue:{value:"-"}},onLoadNextPage:{description:"加载下一页回调函数",name:"onLoadNextPage",required:!1,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},onStartAutoLoad:{description:"开始自动加载回调函数",name:"onStartAutoLoad",required:!1,type:{name:"function",raw:"function(loadNextPages: number[]): void"},defaultValue:{value:"-"}},onStopLoading:{description:"停止加载回调函数",name:"onStopLoading",required:!1,type:{name:"function",raw:"function(): void"},defaultValue:{value:"-"}},columns:{description:"表格列配置",name:"columns",required:!0,type:{name:"Array<object>",raw:"Array<object>"},defaultValue:{value:"[]"}}}};const Xu=({texts:e=[],placeholder:t="请输入内容",animationSpeed:n=100,autoPlay:r=!0,value:a,onChange:i,...s})=>{const[u,o]=R.useState(""),[d,f]=R.useState(0),[h,g]=R.useState(!1),[p,c]=R.useState(!1),[E,b]=R.useState(!1),m=R.useRef(void 0),x=R.useRef(void 0),A=R.useRef(e),w=R.useRef(d),N=R.useRef(p),F=R.useRef(u);R.useEffect(()=>{A.current=e,w.current=d,N.current=p,F.current=u});const z=R.useCallback((I,T)=>{let $=0;b(!0);const W=()=>{$<I.length?(o(I.slice(0,$+1)),$++,x.current=window.setTimeout(W,n)):(b(!1),T?.())};W()},[n]),O=R.useCallback(I=>{let T=F.current.length;const $=()=>{T>0?(o(F.current.slice(0,T-1)),T--,x.current=window.setTimeout($,n/2)):I?.()};$()},[n]),L=R.useCallback(()=>{if(A.current.length===0||N.current)return;g(!0);const I=A.current[w.current];F.current?O(()=>{z(I,()=>{m.current=window.setTimeout(()=>{f(T=>(T+1)%A.current.length),g(!1)},2e3)})}):z(I,()=>{m.current=window.setTimeout(()=>{f(T=>(T+1)%A.current.length),g(!1)},2e3)})},[O,z]);R.useEffect(()=>(r&&e.length>0&&!p&&L(),()=>{m.current&&window.clearTimeout(m.current),x.current&&window.clearTimeout(x.current)}),[d,p,r,e.length,L]),R.useEffect(()=>{!h&&r&&e.length>0&&!p&&L()},[d,h,r,e.length,p,L]);const H=I=>{c(!0),m.current&&window.clearTimeout(m.current),x.current&&window.clearTimeout(x.current),g(!1),b(!1),s.onFocus?.(I)},y=I=>{c(!1),!a&&e.length>0&&(o(""),f(0)),s.onBlur?.(I)},D=I=>{i?.(I.target.value),s.onChange?.(I)},U=()=>p||a?t:u||t;return G.jsxs("div",{style:{position:"relative"},children:[G.jsx(xe.Input,{...s,value:a,onChange:D,onFocus:H,onBlur:y,placeholder:U(),style:{...s.style,position:"relative",zIndex:1}}),!p&&!a&&u&&G.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",paddingLeft:11,paddingRight:11,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit"},children:[G.jsx("span",{children:u}),E&&G.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),G.jsx("style",{children:`
27
45
  @keyframes blink {
28
46
  0%, 50% { opacity: 1; }
29
47
  51%, 100% { opacity: 0; }
30
48
  }
31
- `})]})};It.__docgenInfo={displayName:"DynamicInput",description:"动态文案输入框组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}}}};const Mt=({texts:t=[],placeholder:f="请输入内容",animationSpeed:i=100,autoPlay:d=!0,value:v="",onChange:D,onSubmit:P,maxLength:B=500,showCount:M=!0,submitText:L="发送",disabled:q=!1,rows:j=4,style:S,...N})=>{const[e,n]=c.useState(""),[s,u]=c.useState(0),[E,H]=c.useState(!1),[F,T]=c.useState(!1),[ne,K]=c.useState(!1),[R,G]=c.useState(v||""),l=c.useRef(void 0),_=c.useRef(void 0),U=c.useRef(t),V=c.useRef(s),y=c.useRef(F),b=c.useRef(e),x=c.useRef(null);c.useEffect(()=>{U.current=t,V.current=s,y.current=F,b.current=e});const I=c.useCallback((re,me)=>{let ge=0;K(!0);const be=()=>{ge<re.length?(n(re.slice(0,ge+1)),ge++,_.current=window.setTimeout(be,i)):(K(!1),me?.())};be()},[i]),A=c.useCallback(re=>{let me=b.current.length;const ge=()=>{me>0?(n(b.current.slice(0,me-1)),me--,_.current=window.setTimeout(ge,i/2)):re?.()};ge()},[i]),X=c.useCallback(()=>{if(U.current.length===0||y.current)return;H(!0);const re=U.current[V.current];b.current?A(()=>{I(re,()=>{l.current=window.setTimeout(()=>{u(me=>(me+1)%U.current.length),H(!1)},2e3)})}):I(re,()=>{l.current=window.setTimeout(()=>{u(me=>(me+1)%U.current.length),H(!1)},2e3)})},[A,I]);c.useEffect(()=>(d&&t.length>0&&!F&&X(),()=>{l.current&&window.clearTimeout(l.current),_.current&&window.clearTimeout(_.current)}),[s,F,d,t.length,X]),c.useEffect(()=>{!E&&d&&t.length>0&&!F&&X()},[s,E,d,t.length,F,X]);const J=re=>{T(!0),l.current&&window.clearTimeout(l.current),_.current&&window.clearTimeout(_.current),H(!1),K(!1),N.onFocus?.(re)},Z=re=>{T(!1),!v&&t.length>0&&(n(""),u(0)),N.onBlur?.(re)},ee=re=>{const me=re.target.value;B&&me.length>B||(D?D(me):G(me),N.onChange?.(re))},se=()=>{const re=D?v:R;re.trim()&&!q&&(P?.(re),D||G(""))},ie=re=>{(re.ctrlKey||re.metaKey)&&re.key==="Enter"&&(re.preventDefault(),se()),N.onKeyDown?.(re)},ue=D?v:R,he=q||!ue.trim()||(B?ue.length>B:!1);return w.jsxs("div",{style:{position:"relative",...S},children:[w.jsxs("div",{style:{position:"relative"},children:[w.jsx("textarea",{ref:x,value:D?v:R,onChange:ee,onFocus:re=>{re.target.style.borderColor="#1890ff",re.target.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.2)",J(re)},onBlur:re=>{re.target.style.borderColor="#d9d9d9",re.target.style.boxShadow="none",Z(re)},onKeyDown:ie,placeholder:F||ue?f:"",maxLength:B,rows:j,disabled:q,style:{width:"100%",minHeight:`${j*24+16}px`,padding:"8px 60px 8px 12px",border:"1px solid #d9d9d9",borderRadius:"6px",fontSize:"14px",lineHeight:"1.5",fontFamily:"inherit",resize:"vertical",outline:"none",transition:"border-color 0.3s, box-shadow 0.3s",backgroundColor:"#fff",...N.style},...N}),!F&&!ue&&e&&w.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"flex-start",paddingTop:8,paddingLeft:12,paddingRight:12,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit",lineHeight:"1.5"},children:[w.jsx("span",{children:e}),ne&&w.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),w.jsx("div",{style:{position:"absolute",bottom:8,right:8,zIndex:3},children:w.jsx(oe.Button,{type:"primary",size:"small",icon:w.jsx(Te.SendOutlined,{}),onClick:se,disabled:he,style:{borderRadius:6,minWidth:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:L})})]}),M&&w.jsxs("div",{style:{marginTop:4,textAlign:"right",fontSize:"12px",color:"#999"},children:[ue.length,"/",B]}),w.jsx("style",{children:`
49
+ `})]})};Xu.__docgenInfo={displayName:"DynamicInput",description:"动态文案输入框组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}}}};const Ku=({texts:e=[],placeholder:t="请输入内容",animationSpeed:n=100,autoPlay:r=!0,value:a="",onChange:i,onSubmit:s,maxLength:u=500,showCount:o=!0,submitText:d="发送",disabled:f=!1,rows:h=4,style:g,...p})=>{const[c,E]=R.useState(""),[b,m]=R.useState(0),[x,A]=R.useState(!1),[w,N]=R.useState(!1),[F,z]=R.useState(!1),[O,L]=R.useState(a||""),H=R.useRef(void 0),y=R.useRef(void 0),D=R.useRef(e),U=R.useRef(b),I=R.useRef(w),T=R.useRef(c),$=R.useRef(null);R.useEffect(()=>{D.current=e,U.current=b,I.current=w,T.current=c});const W=R.useCallback((ge,ke)=>{let Pe=0;z(!0);const Le=()=>{Pe<ge.length?(E(ge.slice(0,Pe+1)),Pe++,y.current=window.setTimeout(Le,n)):(z(!1),ke?.())};Le()},[n]),q=R.useCallback(ge=>{let ke=T.current.length;const Pe=()=>{ke>0?(E(T.current.slice(0,ke-1)),ke--,y.current=window.setTimeout(Pe,n/2)):ge?.()};Pe()},[n]),ne=R.useCallback(()=>{if(D.current.length===0||I.current)return;A(!0);const ge=D.current[U.current];T.current?q(()=>{W(ge,()=>{H.current=window.setTimeout(()=>{m(ke=>(ke+1)%D.current.length),A(!1)},2e3)})}):W(ge,()=>{H.current=window.setTimeout(()=>{m(ke=>(ke+1)%D.current.length),A(!1)},2e3)})},[q,W]);R.useEffect(()=>(r&&e.length>0&&!w&&ne(),()=>{H.current&&window.clearTimeout(H.current),y.current&&window.clearTimeout(y.current)}),[b,w,r,e.length,ne]),R.useEffect(()=>{!x&&r&&e.length>0&&!w&&ne()},[b,x,r,e.length,w,ne]);const S=ge=>{N(!0),H.current&&window.clearTimeout(H.current),y.current&&window.clearTimeout(y.current),A(!1),z(!1),p.onFocus?.(ge)},pe=ge=>{N(!1),!a&&e.length>0&&(E(""),m(0)),p.onBlur?.(ge)},ce=ge=>{const ke=ge.target.value;u&&ke.length>u||(i?i(ke):L(ke),p.onChange?.(ge))},k=()=>{const ge=i?a:O;ge.trim()&&!f&&(s?.(ge),i||L(""))},ye=ge=>{(ge.ctrlKey||ge.metaKey)&&ge.key==="Enter"&&(ge.preventDefault(),k()),p.onKeyDown?.(ge)},Se=i?a:O,_e=f||!Se.trim()||(u?Se.length>u:!1);return G.jsxs("div",{style:{position:"relative",...g},children:[G.jsxs("div",{style:{position:"relative"},children:[G.jsx("textarea",{ref:$,value:i?a:O,onChange:ce,onFocus:ge=>{ge.target.style.borderColor="#1890ff",ge.target.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.2)",S(ge)},onBlur:ge=>{ge.target.style.borderColor="#d9d9d9",ge.target.style.boxShadow="none",pe(ge)},onKeyDown:ye,placeholder:w||Se?t:"",maxLength:u,rows:h,disabled:f,style:{width:"100%",minHeight:`${h*24+16}px`,padding:"8px 60px 8px 12px",border:"1px solid #d9d9d9",borderRadius:"6px",fontSize:"14px",lineHeight:"1.5",fontFamily:"inherit",resize:"vertical",outline:"none",transition:"border-color 0.3s, box-shadow 0.3s",backgroundColor:"#fff",...p.style},...p}),!w&&!Se&&c&&G.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"flex-start",paddingTop:8,paddingLeft:12,paddingRight:12,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit",lineHeight:"1.5"},children:[G.jsx("span",{children:c}),F&&G.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),G.jsx("div",{style:{position:"absolute",bottom:8,right:8,zIndex:3},children:G.jsx(xe.Button,{type:"primary",size:"small",icon:G.jsx(kt.SendOutlined,{}),onClick:k,disabled:_e,style:{borderRadius:6,minWidth:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:d})})]}),o&&G.jsxs("div",{style:{marginTop:4,textAlign:"right",fontSize:"12px",color:"#999"},children:[Se.length,"/",u]}),G.jsx("style",{children:`
32
50
  @keyframes blink {
33
51
  0%, 50% { opacity: 1; }
34
52
  51%, 100% { opacity: 0; }
35
53
  }
36
- `})]})};Mt.__docgenInfo={displayName:"DynamicTextArea",description:"动态文案文本域组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}},onSubmit:{name:"onSubmit",required:!1,description:"提交回调",type:{name:"function",raw:"(value: string) => void"}},maxLength:{name:"maxLength",required:!1,description:"最大输入字数",type:{name:"number",raw:"number"},defaultValue:{value:"500"}},showCount:{name:"showCount",required:!1,description:"是否显示字数统计",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},submitText:{name:"submitText",required:!1,description:"提交按钮文本",type:{name:"string",raw:"string"},defaultValue:{value:'"发送"'}},disabled:{name:"disabled",required:!1,description:"是否禁用提交按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},rows:{name:"rows",required:!1,description:"文本域行数",type:{name:"number",raw:"number"},defaultValue:{value:"4"}}}};const Re=({src:t,poster:f,width:i=300,height:d,videoWidth:v,videoHeight:D,showPlayButton:P=!0,autoPlayOnHover:B=!0,onClick:M,onVideoLoaded:L,onVideoPlay:q,onVideoPause:j,onVideoEnded:S,className:N,style:e,...n})=>{const s=c.useRef(null),[u,E]=c.useState(!1),[H,F]=c.useState(!1),[T,ne]=c.useState(!1),K=c.useCallback(()=>{s.current&&(s.current.play(),E(!0),q?.())},[q]),R=c.useCallback(()=>{s.current&&(s.current.pause(),E(!1),j?.())},[j]),G=c.useCallback(I=>{I.stopPropagation(),u?R():K()},[u,K,R]),l=c.useCallback(()=>{F(!0),B&&!u&&K()},[B,u,K]),_=c.useCallback(()=>{F(!1),B&&u&&R()},[B,u,R]),U=c.useCallback(()=>{ne(!0),L?.()},[L]),V=c.useCallback(()=>{E(!0),q?.()},[q]),y=c.useCallback(()=>{E(!1),j?.()},[j]),b=c.useCallback(()=>{E(!1),S?.()},[S]),x=c.useCallback(I=>{M?.(I)},[M]);return w.jsx(oe.Card,{...n,className:`video-card ${N||""}`,style:{width:i,height:d,padding:0,overflow:"hidden",cursor:M?"pointer":"default",border:"none",borderRadius:0,...e},bordered:!1,onMouseEnter:l,onMouseLeave:_,onClick:x,children:w.jsxs("div",{className:"video-card-container",children:[w.jsx("video",{ref:s,src:t,poster:f,preload:"metadata",onLoadedData:U,onPlay:V,onPause:y,onEnded:b,muted:!0,loop:!0}),P&&w.jsx("div",{className:`video-play-button ${H?"hovered":""}`,onClick:G,children:u?w.jsx(Te.PauseCircleOutlined,{className:"play-icon"}):w.jsx(Te.PlayCircleOutlined,{className:"play-icon"})}),!T&&w.jsx("div",{className:"video-loading-mask",children:w.jsx("div",{className:"loading-spinner"})})]})})};Re.__docgenInfo={displayName:"VideoCard",description:"视频卡片组件,支持鼠标悬浮播放控制",props:{src:{name:"src",required:!0,description:"视频源地址",type:{name:"string",raw:"string"}},poster:{name:"poster",required:!1,description:"视频海报图片",type:{name:"string",raw:"string"}},width:{name:"width",required:!1,description:"卡片宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:"300"}},height:{name:"height",required:!1,description:"卡片高度",type:{name:"number | string",raw:"number | string"}},videoWidth:{name:"videoWidth",required:!1,description:"视频宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},videoHeight:{name:"videoHeight",required:!1,description:"视频高度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},showPlayButton:{name:"showPlayButton",required:!1,description:"是否显示播放按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},autoPlayOnHover:{name:"autoPlayOnHover",required:!1,description:"是否自动播放(鼠标悬浮时)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLDivElement>) => void"}},onVideoLoaded:{name:"onVideoLoaded",required:!1,description:"视频加载完成事件",type:{name:"function",raw:"() => void"}},onVideoPlay:{name:"onVideoPlay",required:!1,description:"视频播放事件",type:{name:"function",raw:"() => void"}},onVideoPause:{name:"onVideoPause",required:!1,description:"视频暂停事件",type:{name:"function",raw:"() => void"}},onVideoEnded:{name:"onVideoEnded",required:!1,description:"视频结束事件",type:{name:"function",raw:"() => void"}},className:{name:"className",required:!1,description:"自定义样式类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const Cn=t=>[".mp4",".webm",".ogg",".mov",".avi",".wmv",".flv",".mkv"].some(i=>t.toLowerCase().includes(i)),Sn=t=>t.type?t.type:Cn(t.url)?"video":"image",Dt=({items:t,columns:f,gap:i=0,responsive:d=!0,breakpoints:v={xs:1,sm:2,md:3,lg:4,xl:5,xxl:6},className:D,style:P,onClick:B})=>{const M=c.useRef(null),[L,q]=c.useState(f||v.md||3),j=c.useRef(new Map),S=c.useCallback(()=>{if(!d||f)return f||v.md||3;const s=window.innerWidth;return s<576?v.xs||1:s<768?v.sm||2:s<992?v.md||3:s<1200?v.lg||4:s<1600?v.xl||5:v.xxl||6},[d,f,v]),N=c.useCallback(()=>{if(!M.current)return;const s=L,u=M.current,H=(u.offsetWidth-i*(s-1))/s,F=new Array(s).fill(0);t.forEach((ne,K)=>{const R=ne.id||K,G=j.current.get(R);if(!G)return;const l=Math.min(...F),_=F.indexOf(l),U=_*(H+i),V=F[_];G.style.position="absolute",G.style.left=`${U}px`,G.style.top=`${V}px`,G.style.width=`${H}px`,F[_]+=G.offsetHeight+i});const T=Math.max(...F);u.style.height=`${T}px`},[t,L,i]);c.useEffect(()=>{const s=()=>{const u=S();u!==L&&q(u)};if(d)return window.addEventListener("resize",s),s(),()=>window.removeEventListener("resize",s)},[d,S,L]),c.useEffect(()=>{const s=setTimeout(()=>{N()},100);return()=>clearTimeout(s)},[t,L,N]);const e=c.useCallback(()=>{N()},[N]),n=c.useCallback(s=>{B&&B(s),s.onClick?.(s)},[B]);return w.jsx("div",{ref:M,className:`waterfall-container ${D||""}`,style:{position:"relative",width:"100%",...P},children:t.map((s,u)=>{const E=s.id||u,H=Sn(s);return w.jsx("div",{ref:F=>{F?j.current.set(E,F):j.current.delete(E)},className:"waterfall-item",children:H==="video"?w.jsx("div",{style:{width:"100%",position:"relative",paddingBottom:"56.25%",cursor:B||s.onClick?"pointer":"default"},children:w.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:w.jsx(Re,{src:s.url,poster:s.poster,width:"100%",height:"100%",onClick:()=>n(s),onVideoLoaded:e,autoPlayOnHover:!0,showPlayButton:!1})})}):w.jsx("div",{className:"waterfall-image-wrapper",onClick:()=>n(s),style:{cursor:B||s.onClick?"pointer":"default"},children:w.jsx("img",{src:s.url,alt:`瀑布流图片 ${u+1}`,className:"waterfall-image",onLoad:e,onError:e,style:{display:"block",width:"100%",height:"auto"}})})},E)})})};Dt.__docgenInfo={displayName:"Waterfall",description:"瀑布流布局组件,支持图片和视频混合展示",props:{items:{name:"items",required:!0,description:"媒体资源数组",type:{name:"WaterfallItem[]",raw:"WaterfallItem[]"}},columns:{name:"columns",required:!1,description:"列数(默认会根据屏幕宽度自动响应)",type:{name:"number",raw:"number"}},gap:{name:"gap",required:!1,description:"间隔大小",type:{name:"number",raw:"number"},defaultValue:{value:"0"}},responsive:{name:"responsive",required:!1,description:"是否启用响应式布局",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},breakpoints:{name:"breakpoints",required:!1,description:"响应式断点配置",type:{name:"object",raw:"{ xs?: number; sm?: number; md?: number; lg?: number; xl?: number; xxl?: number; }"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}},onClick:{name:"onClick",required:!1,description:"点击回调",type:{name:"function",raw:"(item: any) => void"}}}};const Be=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),Le={日期:"date",展现量:"impressions",点击量:"clicks","花费(元)":"cost",点击率:"clickRate","平均点击花费(元)":"avgClickCost","千次展现花费(元)":"cpm","总成交金额(元)":"totalTransactionAmount",总成交笔数:"totalTransactionCount",点击转化率:"clickConversionRate","直接成交金额(元)":"directTransactionAmount","间接成交金额(元)":"indirectTransactionAmount",直接成交笔数:"directTransactionCount",间接成交笔数:"indirectTransactionCount",投入产出比:"roi",含预售投产比:"roiWithPresale","总成交成本(元)":"totalTransactionCost","总预售成交金额(元)":"totalPresaleAmount",总预售成交笔数:"totalPresaleCount","直接预售成交金额(元)":"directPresaleAmount",直接预售成交笔数:"directPresaleCount","间接预售成交金额(元)":"indirectPresaleAmount",间接预售成交笔数:"indirectPresaleCount",拍下订单笔数:"orderCount","拍下订单金额(元)":"orderAmount",总购物车数:"totalCartCount",直接购物车数:"directCartCount",间接购物车数:"indirectCartCount",加购率:"addToCartRate","加购成本(元)":"addToCartCost",收藏宝贝数:"productCollectionCount",收藏店铺数:"shopCollectionCount",总收藏数:"totalCollectionCount",直接收藏宝贝数:"directProductCollectionCount",间接收藏宝贝数:"indirectProductCollectionCount",宝贝收藏率:"productCollectionRate","宝贝收藏成本(元)":"productCollectionCost","店铺收藏成本(元)":"shopCollectionCost",总收藏加购数:"totalCollectionAndCartCount","总收藏加购成本(元)":"totalCollectionAndCartCost",宝贝收藏加购数:"productCollectionAndCartCount","宝贝收藏加购成本(元)":"productCollectionAndCartCost",引导访问量:"guidedVisitCount",引导访问人数:"guidedVisitorCount",引导访问潜客数:"guidedPotentialCustomerCount",引导访问潜客占比:"guidedPotentialCustomerRate",引导访问率:"guidedVisitRate",深度访问量:"deepVisitCount",平均访问页面数:"avgPageViews",成交人数:"transactionCustomerCount",成交新客数:"newCustomerCount",成交新客占比:"newCustomerRate",人均成交笔数:"avgTransactionPerCustomer",人均成交金额:"avgAmountPerCustomer",优惠券领取量:"couponClaimCount",购物金充值笔数:"shoppingCreditRechargeCount","购物金充值金额(元)":"shoppingCreditRechargeAmount",旺旺咨询量:"wangwangConsultationCount",自然流量转化金额:"organicTrafficAmount",自然流量曝光量:"organicTrafficImpressions"},et=["日期","展现量","点击量","花费(元)","点击率","平均点击花费(元)","总成交金额(元)","总成交笔数","点击转化率","总购物车数","收藏宝贝数","收藏店铺数","总收藏数","宝贝收藏成本(元)","千次展现花费(元)","总预售成交金额(元)","总预售成交笔数","直接预售成交金额(元)","直接预售成交笔数","间接预售成交金额(元)","间接预售成交笔数","拍下订单笔数","拍下订单金额(元)","直接成交金额(元)","间接成交金额(元)","直接成交笔数","间接成交笔数","投入产出比","含预售投产比","总成交成本(元)","引导访问潜客数","成交人数","人均成交笔数","人均成交金额","直接购物车数","间接购物车数","加购率","店铺收藏成本(元)","总收藏加购数","总收藏加购成本(元)","宝贝收藏加购数","宝贝收藏加购成本(元)","宝贝收藏率","加购成本(元)","直接收藏宝贝数","间接收藏宝贝数","优惠券领取量","购物金充值笔数","购物金充值金额(元)","旺旺咨询量","引导访问量","引导访问人数","引导访问潜客占比","引导访问率","深度访问量","平均访问页面数","成交新客数","成交新客占比","自然流量转化金额","自然流量曝光量"],Tn=t=>{if(!t||t.trim()==="")return"";const f=t.trim();if(f.toLowerCase()==="nan")return"NaN";const i=f.match(/^(.+?)([+-]\d)/);return i?i[1].trim():f},An=t=>t.replace(/[\u00a0\u3000]/g," ").replace(/[–—]/g,"-").replace(/%(\d)/g,"% $1").replace(/NaN(\d)/gi,"NaN $1").replace(/(\.\d+)(\d,\d{3})/g,"$1 $2").replace(/(\.\d+)(\d+\.)/g,"$1 $2").replace(/(\.\d{2})(\d+[+-]\d+\.?\d*%)/g,"$1 $2").replace(/(,\d{3})(\d+[+-]\d+\.?\d*%)/g,"$1 $2").split(/\s+/).map(i=>i.trim()).filter(i=>i!==""),Pt=t=>{const f=(t||"").replace(/[\u00a0\u3000]/g," "),i=/20\d{2}-\d{2}-\d{2}/g,d=f.match(i)||[];if(d.length===0)return{markdown:"",jsonData:[]};const v=f.split(i).filter(N=>N.trim()!=="");let D=0;v.length>0&&v[0].includes("展现量")&&(D=1);const P=et.length-1,B=[];d.forEach((N,e)=>{const n=e+D;if(n>=v.length)return;const s=v[n];let u=s.split(/[\r\n]+/).map(H=>H.trim()).filter(H=>H!=="");u.length<P&&(u=An(s));const E={};E[Le.日期]=N,et.slice(1).forEach((H,F)=>{const T=u[F]||"",ne=Tn(T),K=Le[H];K&&(E[K]=ne)}),B.push(E)});const M=et.filter(N=>{const e=Le[N];return B.some(n=>n[e])}),L=`| ${M.join(" | ")} |`,q=`| ${M.map(()=>"---").join(" | ")} |`,j=B.map(N=>`| ${M.map(n=>{const s=Le[n];return N[s]||"-"}).join(" | ")} |`);return{markdown:[L,q,...j].join(`
37
- `),jsonData:B}},Ht=t=>{if(!t)return"";const f=t.trim().split(`
38
- `);if(f.length<2)return Be(t);const i=f[1],v=/^\|[\s-|]+\|$/.test(i.trim());if(!i||!v)return Be(t);const P=f[0].split("|").map(j=>j.trim()).filter(j=>j!==""),B=f.slice(2).map(j=>j.split("|").map(S=>S.trim()).filter((S,N,e)=>N>0&&N<e.length)),M="border:1px solid #d9d9d9;padding:8px 12px;background-color:#fafafa;font-weight:600;text-align:left;white-space:nowrap;",L="border:1px solid #d9d9d9;padding:6px 12px;text-align:left;white-space:nowrap;";let q='<div style="overflow-x:auto;max-width:100%;">';return q+='<table style="border-collapse:collapse;width:100%;font-size:12px;margin:8px 0;">',q+="<thead><tr>",P.forEach(j=>{q+=`<th style="${M}">${Be(j)}</th>`}),q+="</tr></thead>",q+="<tbody>",B.forEach(j=>{q+="<tr>",P.forEach((S,N)=>{const e=j[N]||"-";q+=`<td style="${L}">${Be(e)}</td>`}),q+="</tr>"}),q+="</tbody></table></div>",q},Bt=t=>{const f=[],i=t.querySelector("thead tr");if(!i)return f;const d=[];return i.querySelectorAll("th").forEach(D=>{d.push(D.textContent?.trim()||"")}),t.querySelectorAll("tbody tr").forEach(D=>{const P={};D.querySelectorAll("td").forEach((M,L)=>{const q=d[L],j=Le[q];if(j){const S=M.textContent?.trim()||"";P[j]=S==="-"?"":S}}),Object.keys(P).length>0&&f.push(P)}),f},qn=t=>async f=>{const i=Pt(f.text);return t&&t(i.jsonData),{modules:[{title:"推广分析表格",content:Ht(i.markdown),markdown:i.markdown}]}},Nn=(t,f,i)=>{const d=parseFloat(String(t.get("grossProfitMargin")||"0"))||0,v=parseFloat(String(t.get("refundRate")||"0"))||0;let D=[];if(f){const P=Bt(f);P.length>0&&(D=P)}return D.length===0&&i&&i.length>0&&(D=i),{grossProfitMargin:d,refundRate:v,tableData:D}},_n={algorithm:oe.theme.defaultAlgorithm,token:{colorPrimary:"#3b82f6",colorSuccess:"#10b981",colorWarning:"#f59e0b",colorError:"#ef4444",colorInfo:"#3b82f6",colorBgBase:"#ffffff",colorBgContainer:"#ffffff",colorBgElevated:"#ffffff",colorBgLayout:"#f8fafc",colorTextBase:"#1e293b",colorText:"#1e293b",colorTextSecondary:"#64748b",colorTextTertiary:"#94a3b8",colorTextQuaternary:"#cbd5e1",colorBorder:"#e2e8f0",colorBorderSecondary:"#f1f5f9",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",boxShadowSecondary:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",borderRadius:8,borderRadiusLG:12,borderRadiusSM:6,fontFamily:"Inter, system-ui, Arial, sans-serif",fontSize:14,fontSizeLG:16,fontSizeSM:12,padding:16,paddingLG:24,paddingSM:12,paddingXS:8,controlHeight:32,controlHeightLG:40,controlHeightSM:24},components:{Button:{borderRadius:8,controlHeight:32,fontWeight:500},Card:{borderRadiusLG:12,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Input:{borderRadius:8,controlHeight:32},Table:{borderRadiusLG:8,headerBg:"#f8fafc",headerColor:"#374151"}}};le.AdvancedTable=wt,le.AppModal=yt,le.BackButton=xt,le.Button=ft,le.Card=mt,le.DynamicInput=It,le.DynamicTextArea=Mt,le.EmptyAndSpin=bt,le.HEADER_TO_FIELD=Le,le.LinkButton=vt,le.PageTable=ht,le.RichTextEditor=Nt,le.VideoCard=Re,le.VirtualTable=Lt,le.Waterfall=Dt,le.XcIcon=gt,le.buildPromotionSendPayload=Nn,le.createMarkdownAnalyze=qn,le.escapeHtml=Be,le.extractTableDataFromHtml=Bt,le.lightTheme=_n,le.parsePromotionTableMarkdown=Pt,le.renderMarkdownToHtml=Ht,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})});
54
+ `})]})};Ku.__docgenInfo={displayName:"DynamicTextArea",description:"动态文案文本域组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}},onSubmit:{name:"onSubmit",required:!1,description:"提交回调",type:{name:"function",raw:"(value: string) => void"}},maxLength:{name:"maxLength",required:!1,description:"最大输入字数",type:{name:"number",raw:"number"},defaultValue:{value:"500"}},showCount:{name:"showCount",required:!1,description:"是否显示字数统计",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},submitText:{name:"submitText",required:!1,description:"提交按钮文本",type:{name:"string",raw:"string"},defaultValue:{value:'"发送"'}},disabled:{name:"disabled",required:!1,description:"是否禁用提交按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},rows:{name:"rows",required:!1,description:"文本域行数",type:{name:"number",raw:"number"},defaultValue:{value:"4"}}}};const ri=({src:e,poster:t,width:n=300,height:r,videoWidth:a,videoHeight:i,showPlayButton:s=!0,autoPlayOnHover:u=!0,onClick:o,onVideoLoaded:d,onVideoPlay:f,onVideoPause:h,onVideoEnded:g,className:p,style:c,...E})=>{const b=R.useRef(null),[m,x]=R.useState(!1),[A,w]=R.useState(!1),[N,F]=R.useState(!1),z=R.useCallback(()=>{b.current&&(b.current.play(),x(!0),f?.())},[f]),O=R.useCallback(()=>{b.current&&(b.current.pause(),x(!1),h?.())},[h]),L=R.useCallback(W=>{W.stopPropagation(),m?O():z()},[m,z,O]),H=R.useCallback(()=>{w(!0),u&&!m&&z()},[u,m,z]),y=R.useCallback(()=>{w(!1),u&&m&&O()},[u,m,O]),D=R.useCallback(()=>{F(!0),d?.()},[d]),U=R.useCallback(()=>{x(!0),f?.()},[f]),I=R.useCallback(()=>{x(!1),h?.()},[h]),T=R.useCallback(()=>{x(!1),g?.()},[g]),$=R.useCallback(W=>{o?.(W)},[o]);return G.jsx(xe.Card,{...E,className:`video-card ${p||""}`,style:{width:n,height:r,padding:0,overflow:"hidden",cursor:o?"pointer":"default",border:"none",borderRadius:0,...c},bordered:!1,onMouseEnter:H,onMouseLeave:y,onClick:$,children:G.jsxs("div",{className:"video-card-container",children:[G.jsx("video",{ref:b,src:e,poster:t,preload:"metadata",onLoadedData:D,onPlay:U,onPause:I,onEnded:T,muted:!0,loop:!0}),s&&G.jsx("div",{className:`video-play-button ${A?"hovered":""}`,onClick:L,children:m?G.jsx(kt.PauseCircleOutlined,{className:"play-icon"}):G.jsx(kt.PlayCircleOutlined,{className:"play-icon"})}),!N&&G.jsx("div",{className:"video-loading-mask",children:G.jsx("div",{className:"loading-spinner"})})]})})};ri.__docgenInfo={displayName:"VideoCard",description:"视频卡片组件,支持鼠标悬浮播放控制",props:{src:{name:"src",required:!0,description:"视频源地址",type:{name:"string",raw:"string"}},poster:{name:"poster",required:!1,description:"视频海报图片",type:{name:"string",raw:"string"}},width:{name:"width",required:!1,description:"卡片宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:"300"}},height:{name:"height",required:!1,description:"卡片高度",type:{name:"number | string",raw:"number | string"}},videoWidth:{name:"videoWidth",required:!1,description:"视频宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},videoHeight:{name:"videoHeight",required:!1,description:"视频高度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},showPlayButton:{name:"showPlayButton",required:!1,description:"是否显示播放按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},autoPlayOnHover:{name:"autoPlayOnHover",required:!1,description:"是否自动播放(鼠标悬浮时)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLDivElement>) => void"}},onVideoLoaded:{name:"onVideoLoaded",required:!1,description:"视频加载完成事件",type:{name:"function",raw:"() => void"}},onVideoPlay:{name:"onVideoPlay",required:!1,description:"视频播放事件",type:{name:"function",raw:"() => void"}},onVideoPause:{name:"onVideoPause",required:!1,description:"视频暂停事件",type:{name:"function",raw:"() => void"}},onVideoEnded:{name:"onVideoEnded",required:!1,description:"视频结束事件",type:{name:"function",raw:"() => void"}},className:{name:"className",required:!1,description:"自定义样式类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const wE=e=>[".mp4",".webm",".ogg",".mov",".avi",".wmv",".flv",".mkv"].some(n=>e.toLowerCase().includes(n)),LE=e=>e.type?e.type:wE(e.url)?"video":"image",Qu=({items:e,columns:t,gap:n=0,responsive:r=!0,breakpoints:a={xs:1,sm:2,md:3,lg:4,xl:5,xxl:6},className:i,style:s,onClick:u})=>{const o=R.useRef(null),[d,f]=R.useState(t||a.md||3),h=R.useRef(new Map),g=R.useCallback(()=>{if(!r||t)return t||a.md||3;const b=window.innerWidth;return b<576?a.xs||1:b<768?a.sm||2:b<992?a.md||3:b<1200?a.lg||4:b<1600?a.xl||5:a.xxl||6},[r,t,a]),p=R.useCallback(()=>{if(!o.current)return;const b=d,m=o.current,A=(m.offsetWidth-n*(b-1))/b,w=new Array(b).fill(0);e.forEach((F,z)=>{const O=F.id||z,L=h.current.get(O);if(!L)return;const H=Math.min(...w),y=w.indexOf(H),D=y*(A+n),U=w[y];L.style.position="absolute",L.style.left=`${D}px`,L.style.top=`${U}px`,L.style.width=`${A}px`,w[y]+=L.offsetHeight+n});const N=Math.max(...w);m.style.height=`${N}px`},[e,d,n]);R.useEffect(()=>{const b=()=>{const m=g();m!==d&&f(m)};if(r)return window.addEventListener("resize",b),b(),()=>window.removeEventListener("resize",b)},[r,g,d]),R.useEffect(()=>{const b=setTimeout(()=>{p()},100);return()=>clearTimeout(b)},[e,d,p]);const c=R.useCallback(()=>{p()},[p]),E=R.useCallback(b=>{u&&u(b),b.onClick?.(b)},[u]);return G.jsx("div",{ref:o,className:`waterfall-container ${i||""}`,style:{position:"relative",width:"100%",...s},children:e.map((b,m)=>{const x=b.id||m,A=LE(b);return G.jsx("div",{ref:w=>{w?h.current.set(x,w):h.current.delete(x)},className:"waterfall-item",children:A==="video"?G.jsx("div",{style:{width:"100%",position:"relative",paddingBottom:"56.25%",cursor:u||b.onClick?"pointer":"default"},children:G.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:G.jsx(ri,{src:b.url,poster:b.poster,width:"100%",height:"100%",onClick:()=>E(b),onVideoLoaded:c,autoPlayOnHover:!0,showPlayButton:!1})})}):G.jsx("div",{className:"waterfall-image-wrapper",onClick:()=>E(b),style:{cursor:u||b.onClick?"pointer":"default"},children:G.jsx("img",{src:b.url,alt:`瀑布流图片 ${m+1}`,className:"waterfall-image",onLoad:c,onError:c,style:{display:"block",width:"100%",height:"auto"}})})},x)})})};Qu.__docgenInfo={displayName:"Waterfall",description:"瀑布流布局组件,支持图片和视频混合展示",props:{items:{name:"items",required:!0,description:"媒体资源数组",type:{name:"WaterfallItem[]",raw:"WaterfallItem[]"}},columns:{name:"columns",required:!1,description:"列数(默认会根据屏幕宽度自动响应)",type:{name:"number",raw:"number"}},gap:{name:"gap",required:!1,description:"间隔大小",type:{name:"number",raw:"number"},defaultValue:{value:"0"}},responsive:{name:"responsive",required:!1,description:"是否启用响应式布局",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},breakpoints:{name:"breakpoints",required:!1,description:"响应式断点配置",type:{name:"object",raw:"{ xs?: number; sm?: number; md?: number; lg?: number; xl?: number; xxl?: number; }"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}},onClick:{name:"onClick",required:!1,description:"点击回调",type:{name:"function",raw:"(item: any) => void"}}}};const Wn=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),dn={日期:"date",展现量:"impressions",点击量:"clicks","花费(元)":"cost",点击率:"clickRate","平均点击花费(元)":"avgClickCost","千次展现花费(元)":"cpm","总成交金额(元)":"totalTransactionAmount",总成交笔数:"totalTransactionCount",点击转化率:"clickConversionRate","直接成交金额(元)":"directTransactionAmount","间接成交金额(元)":"indirectTransactionAmount",直接成交笔数:"directTransactionCount",间接成交笔数:"indirectTransactionCount",投入产出比:"roi",含预售投产比:"roiWithPresale","总成交成本(元)":"totalTransactionCost","总预售成交金额(元)":"totalPresaleAmount",总预售成交笔数:"totalPresaleCount","直接预售成交金额(元)":"directPresaleAmount",直接预售成交笔数:"directPresaleCount","间接预售成交金额(元)":"indirectPresaleAmount",间接预售成交笔数:"indirectPresaleCount",拍下订单笔数:"orderCount","拍下订单金额(元)":"orderAmount",总购物车数:"totalCartCount",直接购物车数:"directCartCount",间接购物车数:"indirectCartCount",加购率:"addToCartRate","加购成本(元)":"addToCartCost",收藏宝贝数:"productCollectionCount",收藏店铺数:"shopCollectionCount",总收藏数:"totalCollectionCount",直接收藏宝贝数:"directProductCollectionCount",间接收藏宝贝数:"indirectProductCollectionCount",宝贝收藏率:"productCollectionRate","宝贝收藏成本(元)":"productCollectionCost","店铺收藏成本(元)":"shopCollectionCost",总收藏加购数:"totalCollectionAndCartCount","总收藏加购成本(元)":"totalCollectionAndCartCost",宝贝收藏加购数:"productCollectionAndCartCount","宝贝收藏加购成本(元)":"productCollectionAndCartCost",引导访问量:"guidedVisitCount",引导访问人数:"guidedVisitorCount",引导访问潜客数:"guidedPotentialCustomerCount",引导访问潜客占比:"guidedPotentialCustomerRate",引导访问率:"guidedVisitRate",深度访问量:"deepVisitCount",平均访问页面数:"avgPageViews",成交人数:"transactionCustomerCount",成交新客数:"newCustomerCount",成交新客占比:"newCustomerRate",人均成交笔数:"avgTransactionPerCustomer",人均成交金额:"avgAmountPerCustomer",优惠券领取量:"couponClaimCount",购物金充值笔数:"shoppingCreditRechargeCount","购物金充值金额(元)":"shoppingCreditRechargeAmount",旺旺咨询量:"wangwangConsultationCount",自然流量转化金额:"organicTrafficAmount",自然流量曝光量:"organicTrafficImpressions"},ai=["日期","展现量","点击量","花费(元)","点击率","平均点击花费(元)","总成交金额(元)","总成交笔数","点击转化率","总购物车数","收藏宝贝数","收藏店铺数","总收藏数","宝贝收藏成本(元)","千次展现花费(元)","总预售成交金额(元)","总预售成交笔数","直接预售成交金额(元)","直接预售成交笔数","间接预售成交金额(元)","间接预售成交笔数","拍下订单笔数","拍下订单金额(元)","直接成交金额(元)","间接成交金额(元)","直接成交笔数","间接成交笔数","投入产出比","含预售投产比","总成交成本(元)","引导访问潜客数","成交人数","人均成交笔数","人均成交金额","直接购物车数","间接购物车数","加购率","店铺收藏成本(元)","总收藏加购数","总收藏加购成本(元)","宝贝收藏加购数","宝贝收藏加购成本(元)","宝贝收藏率","加购成本(元)","直接收藏宝贝数","间接收藏宝贝数","优惠券领取量","购物金充值笔数","购物金充值金额(元)","旺旺咨询量","引导访问量","引导访问人数","引导访问潜客占比","引导访问率","深度访问量","平均访问页面数","成交新客数","成交新客占比","自然流量转化金额","自然流量曝光量"],OE=e=>{if(!e||e.trim()==="")return"";const t=e.trim();if(t.toLowerCase()==="nan")return"NaN";const n=t.match(/^(.+?)([+-]\d)/);return n?n[1].trim():t},DE=e=>e.replace(/[\u00a0\u3000]/g," ").replace(/[–—]/g,"-").replace(/%(\d)/g,"% $1").replace(/NaN(\d)/gi,"NaN $1").replace(/(\.\d+)(\d,\d{3})/g,"$1 $2").replace(/(\.\d+)(\d+\.)/g,"$1 $2").replace(/(\.\d{2})(\d+[+-]\d+\.?\d*%)/g,"$1 $2").replace(/(,\d{3})(\d+[+-]\d+\.?\d*%)/g,"$1 $2").split(/\s+/).map(n=>n.trim()).filter(n=>n!==""),Ju=e=>{const t=(e||"").replace(/[\u00a0\u3000]/g," "),n=/20\d{2}-\d{2}-\d{2}/g,r=t.match(n)||[];if(r.length===0)return{markdown:"",jsonData:[]};const a=t.split(n).filter(p=>p.trim()!=="");let i=0;a.length>0&&a[0].includes("展现量")&&(i=1);const s=ai.length-1,u=[];r.forEach((p,c)=>{const E=c+i;if(E>=a.length)return;const b=a[E];let m=b.split(/[\r\n]+/).map(A=>A.trim()).filter(A=>A!=="");m.length<s&&(m=DE(b));const x={};x[dn.日期]=p,ai.slice(1).forEach((A,w)=>{const N=m[w]||"",F=OE(N),z=dn[A];z&&(x[z]=F)}),u.push(x)});const o=ai.filter(p=>{const c=dn[p];return u.some(E=>E[c])}),d=`| ${o.join(" | ")} |`,f=`| ${o.map(()=>"---").join(" | ")} |`,h=u.map(p=>`| ${o.map(E=>{const b=dn[E];return p[b]||"-"}).join(" | ")} |`);return{markdown:[d,f,...h].join(`
55
+ `),jsonData:u}},Zu=e=>{if(!e)return"";const t=e.trim().split(`
56
+ `);if(t.length<2)return Wn(e);const n=t[1],a=/^\|[\s-|]+\|$/.test(n.trim());if(!n||!a)return Wn(e);const s=t[0].split("|").map(h=>h.trim()).filter(h=>h!==""),u=t.slice(2).map(h=>h.split("|").map(g=>g.trim()).filter((g,p,c)=>p>0&&p<c.length)),o="border:1px solid #d9d9d9;padding:8px 12px;background-color:#fafafa;font-weight:600;text-align:left;white-space:nowrap;",d="border:1px solid #d9d9d9;padding:6px 12px;text-align:left;white-space:nowrap;";let f='<div style="overflow-x:auto;max-width:100%;">';return f+='<table style="border-collapse:collapse;width:100%;font-size:12px;margin:8px 0;">',f+="<thead><tr>",s.forEach(h=>{f+=`<th style="${o}">${Wn(h)}</th>`}),f+="</tr></thead>",f+="<tbody>",u.forEach(h=>{f+="<tr>",s.forEach((g,p)=>{const c=h[p]||"-";f+=`<td style="${d}">${Wn(c)}</td>`}),f+="</tr>"}),f+="</tbody></table></div>",f},el=e=>{const t=[],n=e.querySelector("thead tr");if(!n)return t;const r=[];return n.querySelectorAll("th").forEach(i=>{r.push(i.textContent?.trim()||"")}),e.querySelectorAll("tbody tr").forEach(i=>{const s={};i.querySelectorAll("td").forEach((o,d)=>{const f=r[d],h=dn[f];if(h){const g=o.textContent?.trim()||"";s[h]=g==="-"?"":g}}),Object.keys(s).length>0&&t.push(s)}),t},PE=e=>async t=>{const n=Ju(t.text);return e&&e(n.jsonData),{modules:[{title:"推广分析表格",content:Zu(n.markdown),markdown:n.markdown}]}},ME=(e,t,n)=>{const r=parseFloat(String(e.get("grossProfitMargin")||"0"))||0,a=parseFloat(String(e.get("refundRate")||"0"))||0;let i=[];if(t){const s=el(t);s.length>0&&(i=s)}return i.length===0&&n&&n.length>0&&(i=n),{grossProfitMargin:r,refundRate:a,tableData:i}},RE={algorithm:xe.theme.defaultAlgorithm,token:{colorPrimary:"#3b82f6",colorSuccess:"#10b981",colorWarning:"#f59e0b",colorError:"#ef4444",colorInfo:"#3b82f6",colorBgBase:"#ffffff",colorBgContainer:"#ffffff",colorBgElevated:"#ffffff",colorBgLayout:"#f8fafc",colorTextBase:"#1e293b",colorText:"#1e293b",colorTextSecondary:"#64748b",colorTextTertiary:"#94a3b8",colorTextQuaternary:"#cbd5e1",colorBorder:"#e2e8f0",colorBorderSecondary:"#f1f5f9",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",boxShadowSecondary:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",borderRadius:8,borderRadiusLG:12,borderRadiusSM:6,fontFamily:"Inter, system-ui, Arial, sans-serif",fontSize:14,fontSizeLG:16,fontSizeSM:12,padding:16,paddingLG:24,paddingSM:12,paddingXS:8,controlHeight:32,controlHeightLG:40,controlHeightSM:24},components:{Button:{borderRadius:8,controlHeight:32,fontWeight:500},Card:{borderRadiusLG:12,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Input:{borderRadius:8,controlHeight:32},Table:{borderRadiusLG:8,headerBg:"#f8fafc",headerColor:"#374151"}}};ve.AdvancedTable=Ci,ve.AppModal=Ei,ve.BackButton=xi,ve.Button=mi,ve.Card=gi,ve.DynamicInput=Xu,ve.DynamicTextArea=Ku,ve.EmptyAndSpin=yi,ve.HEADER_TO_FIELD=dn,ve.LinkButton=Ai,ve.PageTable=bi,ve.RichTextEditor=Gu,ve.VideoCard=ri,ve.VirtualTable=ju,ve.Waterfall=Qu,ve.XcIcon=Ti,ve.buildPromotionSendPayload=ME,ve.createMarkdownAnalyze=PE,ve.escapeHtml=Wn,ve.extractTableDataFromHtml=el,ve.lightTheme=RE,ve.parsePromotionTableMarkdown=Ju,ve.renderMarkdownToHtml=Zu,Object.defineProperty(ve,Symbol.toStringTag,{value:"Module"})});
39
57
  //# sourceMappingURL=index.umd.js.map