const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dashboard-Bw4z9UMz.js","assets/rolldown-runtime-WkwZ5CU-.js","assets/react-QV7DAAIx.js","assets/semi-65W_4I1v.js","assets/semi-BUXPdXzR.css","assets/dashboard-Dk6QMmtm.css","assets/chat-Cq-XdIX7.js","assets/retest-EzTZPjnQ.js","assets/project-form-XZEBxv0P.js","assets/model-channel-mQ6lfvSO.js","assets/project-options-CMQbwv_U.js","assets/chat-B4gtUsym.css","assets/deep-assessments-Ear0CRFf.js","assets/graph-parents-i1hc3RVG.js","assets/graph-parents-BbkuhUnk.css","assets/deep-assessments-BVUI7zDD.css","assets/hitl-BqElf4Dy.js","assets/hitl-BqmzzDjt.css","assets/tool-guard-QZ-UJFtd.js","assets/tool-guard-DKIWLN1V.css","assets/projects-SuTBYp6J.js","assets/AssetEditorModal-BRlVM7dg.js","assets/assetTarget-D2PEjBAg.js","assets/projects-CCzxY6zz.css","assets/asset-overview-D3G_k7fn.js","assets/AssetBits-DtqSAj0f.js","assets/asset-overview-DEMYiRVr.css","assets/asset-library-ChAmA5Ch.js","assets/asset-library-a5Vth3JU.css","assets/info-collect-C0qW9x7x.js","assets/info-collect-BrIcieOX.css","assets/vulnerabilities-D_rM4qkt.js","assets/vulnerabilities-BPt2JmiL.css","assets/tasks-ChAtqbZl.js","assets/tasks-BtBBHKoW.css","assets/workflows-g37AHSUA.js","assets/workflows-EsKm07MV.css","assets/webshell-BCjmG7pY.js","assets/webshell-BdcYpY5u.css","assets/c2-listeners-mznWKf39.js","assets/c2-shared-CtmcbePz.js","assets/c2-shared-B-Nz9eUh.css","assets/c2-shared-DNQvNHHd.js","assets/c2-listeners-KjhK45yg.css","assets/c2-sessions-Dzb2ExJE.js","assets/c2-sessions-DLf_n8Eq.css","assets/c2-tasks-bTc_K3I3.js","assets/c2-tasks-B5H34xZF.css","assets/c2-payloads-BKak-gMx.js","assets/c2-payloads-CnRJmaJm.css","assets/c2-events-BBXPOkip.js","assets/c2-events-BVd4qqKy.css","assets/c2-profiles-D57VOkSl.js","assets/c2-profiles-BpNJlhDC.css","assets/chat-files-C_do2wG4.js","assets/chat-files-wKL7Vwmw.css","assets/plugin-hub-DXxb5SNn.js","assets/plugin-hub-Yl4AUy33.css","assets/mcp-monitor-CYkF90E6.js","assets/mcp-monitor-8VvqmnVY.css","assets/mcp-management-J5-UGLel.js","assets/mcp-management-CEr7J00D.css","assets/knowledge-retrieval-logs-B2smCvdG.js","assets/knowledge-management-BxQoJW22.js","assets/skills-monitor-rnLJQpb-.js","assets/skills-management-CCkb0p77.js","assets/agents-management-d131UeV3.js","assets/roles-management-5zmgJVPT.js","assets/roles-management-CAkb5FLz.css","assets/platform-rbac-BENNKoJc.js","assets/settings-DPQLaCt9.js","assets/settings-Cjg19I8_.css","assets/api-docs-D-52AArB.js","assets/api-docs-B_T3BEfL.css"])))=>i.map(i=>d[i]); import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{$t as t,A as n,At as r,B as i,Ct as a,E as o,F as s,G as c,Gt as l,H as u,Ht as d,I as f,J as p,Jt as m,K as h,Kt as g,L as _,M as ee,N as te,Nt as ne,O as v,Qt as y,R as b,Rt as x,St as re,T as ie,Tt as S,Ut as ae,V as oe,W as se,Wt as ce,Xt as le,Y as ue,Yt as de,Zt as fe,an as pe,at as me,b as he,bt as ge,dt as _e,et as ve,ht as ye,i as C,kt as be,n as xe,nt as Se,o as Ce,ot as we,p as Te,r as Ee,rn as De,st as Oe,t as w,u as ke,ut as T,vt as Ae,w as E,wt as je,z as Me,zt as Ne}from"./semi-65W_4I1v.js";import{S as Pe,b as Fe,d as Ie,f as Le,g as D,h as Re,l as ze,m as Be,p as Ve,t as He,v as Ue}from"./react-QV7DAAIx.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var O=e(Pe(),1),We=Fe(),Ge=`cyberstrike-auth`;function Ke(){try{let e=localStorage.getItem(Ge);if(!e)return null;let t=JSON.parse(e);if(!t?.token||!t?.expiresAt)return null;let n=new Date(t.expiresAt);return!Number.isFinite(n.getTime())||n.getTime()<=Date.now()?null:{token:t.token,expiresAt:n.toISOString(),user:t.user||null,roles:Array.isArray(t.roles)?t.roles:[],permissions:Array.isArray(t.permissions)?t.permissions:[],scope:t.scope||``}}catch(e){return console.warn(`读取会话失败:`,e),null}}function qe(e){e?localStorage.setItem(Ge,JSON.stringify(e)):localStorage.removeItem(Ge)}var Je=null,Ye=null;function Xe(e){Je=e||null}function Ze(){return Je}function Qe(e,t){let n=Ye;Ye=e||null;try{return t()}finally{Ye=n}}var k=class extends Error{constructor(e,{status:t=0,payload:n=null,path:r=``}={}){super(e),this.name=`ApiError`,this.status=t,this.payload=n,this.path=r}};function $e(e,t){let n=e.startsWith(`http`)?e:`/api${e.startsWith(`/`)?e:`/${e}`}`;if(!t)return n;let r=new URLSearchParams;for(let[e,n]of Object.entries(t))n!=null&&n!==``&&(Array.isArray(n)?n.forEach(t=>r.append(e,t)):r.append(e,String(n)));let i=r.toString();return i?`${n}${n.includes(`?`)?`&`:`?`}${i}`:n}async function et(e){let t=e.headers.get(`content-type`)||``;try{if(t.includes(`application/json`)){let t=await e.json();return{message:t.error||t.message||`请求失败(HTTP ${e.status})`,payload:t}}let n=await e.text();return{message:n?.slice(0,300)||`请求失败(HTTP ${e.status})`,payload:n}}catch{return{message:`请求失败(HTTP ${e.status})`,payload:null}}}async function A(e,t={}){let{method:n=`GET`,body:r,query:i,headers:a={},signal:o,raw:s=!1,timeout:c=6e4}=t,l=o===void 0?n.toUpperCase()===`GET`?Ye:void 0:o,u={Accept:`application/json`,...a},d=r;r!=null&&!(r instanceof FormData)&&typeof r!=`string`&&!(r instanceof Blob)&&(u[`Content-Type`]=`application/json`,d=JSON.stringify(r)),Je&&!u.Authorization&&(u.Authorization=`Bearer ${Je}`);let f=new AbortController,p=c?setTimeout(()=>f.abort(),c):null,m=()=>f.abort();l&&(l.aborted?f.abort():l.addEventListener(`abort`,m,{once:!0}));let h;try{h=await fetch($e(e,i),{method:n,headers:u,body:d,signal:f.signal})}catch(t){throw t.name===`AbortError`?new k(`请求已取消`,{path:e}):new k(`网络连接失败,请检查服务状态`,{path:e})}finally{p&&clearTimeout(p),l&&l.removeEventListener(`abort`,m)}if(h.status===401&&window.dispatchEvent(new CustomEvent(`csai:unauthorized`)),!h.ok){let{message:t,payload:n}=await et(h);throw new k(t,{status:h.status,payload:n,path:e})}return s?h:h.status===204?null:(h.headers.get(`content-type`)||``).includes(`application/json`)?h.json():h.text()}var j={get:(e,t,n={})=>A(e,{...n,query:t}),post:(e,t,n={})=>A(e,{...n,method:`POST`,body:t}),put:(e,t,n={})=>A(e,{...n,method:`PUT`,body:t}),patch:(e,t,n={})=>A(e,{...n,method:`PATCH`,body:t}),del:(e,t={})=>A(e,{...t,method:`DELETE`}),raw:(e,t={})=>A(e,{...t,raw:!0})};async function tt(e,{query:t,filename:n,method:r=`GET`,body:i}={}){let a=await A(e,{method:r,body:i,query:t,raw:!0,timeout:12e4}),o=await a.blob(),s=a.headers.get(`content-disposition`)||``,c=s.match(/filename\*=UTF-8''([^;]+)/i),l=s.match(/filename="?([^";]+)"?/i),u=n||(c?decodeURIComponent(c[1]):l?.[1])||`download.bin`,d=URL.createObjectURL(o),f=document.createElement(`a`);return f.href=d,f.download=u,document.body.appendChild(f),f.click(),f.remove(),setTimeout(()=>URL.revokeObjectURL(d),1e3),u}function nt(e,t,{onEvent:n,onError:r,onClose:i,signal:a}={}){let o=new AbortController;a&&(a.aborted?o.abort():a.addEventListener(`abort`,()=>o.abort(),{once:!0}));let s={"Content-Type":`application/json`,Accept:`text/event-stream`};return Je&&(s.Authorization=`Bearer ${Je}`),(async()=>{try{let r=await fetch($e(e),{method:`POST`,headers:s,body:JSON.stringify(t||{}),signal:o.signal});if(r.status===401&&window.dispatchEvent(new CustomEvent(`csai:unauthorized`)),!r.ok){let{message:t}=await et(r);throw new k(t,{status:r.status,path:e})}if(!r.body)throw new k(`服务端未返回流式响应`,{path:e});let a=r.body.getReader(),c=new TextDecoder,l=``,u=!1;for(;!u;){let{done:e,value:t}=await a.read();if(e)break;l+=c.decode(t,{stream:!0});let r;for(;(r=l.indexOf(` `))>=0;){let e=l.slice(0,r).replace(/\r$/,``);if(l=l.slice(r+1),!e.startsWith(`data:`))continue;let t=e.slice(5).trim();if(!t)continue;if(t===`[DONE]`){u=!0;break}let i;try{i=JSON.parse(t)}catch{continue}n?.(i)}}i?.()}catch(e){if(e.name===`AbortError`){i?.();return}r?.(e)}})(),()=>o.abort()}function rt(e,t=`操作失败`){return e?typeof e==`string`?e:e.message||t:t}var M=e(He(),1),it=(0,O.createContext)(null);function at(e,t){return e?{token:t||e.token,expiresAt:e.expires_at||e.expiresAt||``,appVersion:typeof e.app_version==`string`?e.app_version.trim():``,user:e.user||null,roles:Array.isArray(e.roles)?e.roles:[],permissions:Array.isArray(e.permissions)?e.permissions:[],scope:e.scope||``}:null}function ot({children:e}){let t=(0,O.useRef)(Ke()).current,[n,r]=(0,O.useState)(t),[i,a]=(0,O.useState)(!!t);(0,O.useEffect)(()=>{if(Xe(t?.token||null),!t?.token){a(!1);return}let e=!1;return j.get(`/auth/validate`).then(n=>{if(e)return;let i=at(n,t.token);r(i),qe(i)}).catch(()=>{e||(r(null),qe(null),Xe(null))}).finally(()=>{e||a(!1)}),()=>{e=!0}},[]);let o=(0,O.useCallback)(()=>{r(null),Xe(null),qe(null)},[]);(0,O.useEffect)(()=>{let e=()=>o();return window.addEventListener(`csai:unauthorized`,e),()=>window.removeEventListener(`csai:unauthorized`,e)},[o]);let s=(0,O.useCallback)(async(e,t)=>{let n=await j.post(`/auth/login`,{username:String(e||``).trim(),password:t}),i=at(n,n?.token);return Xe(i?.token||null),qe(i),r(i),i},[]),c=(0,O.useCallback)(async()=>{try{await j.post(`/auth/logout`,{})}catch{}o()},[o]),l=(0,O.useMemo)(()=>new Set(n?.permissions||[]),[n]),u=(0,O.useCallback)(e=>!e||String(e).split(/\s+/).some(e=>l.has(e)),[l]),d=(0,O.useCallback)(e=>{let t=Array.isArray(e)?e:String(e||``).split(/\s+/).filter(Boolean);return!t.length||t.some(e=>l.has(e))},[l]),f=(0,O.useCallback)(async()=>{if(!n?.token)return null;let e=at(await j.get(`/auth/validate`),n.token);return r(e),qe(e),e},[n?.token]),p=(0,O.useMemo)(()=>({session:n,user:n?.user||null,roles:n?.roles||[],permissions:l,hasPermission:u,hasAnyPermission:d,checking:i,authenticated:!!n?.token,login:s,logout:c,refresh:f}),[n,l,u,d,i,s,c,f]);return(0,M.jsx)(it.Provider,{value:p,children:e})}function st(){let e=(0,O.useContext)(it);if(!e)throw Error(`useAuth 必须在 AuthProvider 内使用`);return e}var ct=[{id:`zh-CN`,label:`简体中文`},{id:`en-US`,label:`English`},{id:`ru-RU`,label:`Русский`},{id:`ar-SA`,label:`العربية`}],lt=`csai_lang`,ut=`zh-CN`,dt=`/static/i18n`,ft=new Map;function pt(){try{let e=localStorage.getItem(lt);if(e&&ct.some(t=>t.id===e))return e}catch{}let e=String(navigator.language||``).toLowerCase();return e.startsWith(`zh`)?`zh-CN`:e.startsWith(`ru`)?`ru-RU`:e.startsWith(`ar`)?`ar-SA`:e.startsWith(`en`)?`en-US`:ut}function mt(e){return ft.has(e)||ft.set(e,fetch(`${dt}/${e}.json`,{cache:`no-cache`}).then(e=>e.ok?e.json():{}).catch(()=>({}))),ft.get(e)}function ht(e,t){if(!e)return;let n=e;for(let e of String(t).split(`.`)){if(typeof n!=`object`||!n)return;n=n[e]}return typeof n==`string`?n:void 0}function N(e,t){return t?e.replace(/\{\{\s*(\w+)\s*\}\}/g,(e,n)=>t[n]===void 0?e:String(t[n])):e}var gt=(0,O.createContext)({lang:ut,t:e=>e,ready:!1,setLanguage:()=>{}});function _t({children:e}){let[t,n]=(0,O.useState)(pt),[r,i]=(0,O.useState)({}),[a,o]=(0,O.useState)(!1);(0,O.useEffect)(()=>{let e=!1;Promise.all([mt(t),mt(ut),mt(`en-US`)]).then(([t,n,r])=>{e||(i({current:t,fallback:n,english:r}),o(!0))}),document.documentElement.lang=t,document.documentElement.dir=t===`ar-SA`?`rtl`:`ltr`;try{localStorage.setItem(lt,t)}catch{}return()=>{e=!0}},[t]);let s=(0,O.useCallback)((e,t,n)=>{if(!e)return n??``;let i=ht(r.current,e)??ht(r.fallback,e)??ht(r.english,e);return i===void 0?n??e:N(i,t)},[r]),c=(0,O.useCallback)(e=>{e&&e!==t&&(o(!1),n(e),window.dispatchEvent(new CustomEvent(`csai:languagechange`,{detail:{lang:e}})))},[t]),l=(0,O.useMemo)(()=>({lang:t,t:s,ready:a,setLanguage:c}),[t,s,a,c]);return(0,M.jsx)(gt.Provider,{value:l,children:e})}function vt(){return(0,O.useContext)(gt)}function P(){return(0,O.useContext)(gt).t}var yt=`cyberstrike-theme`,bt=[`system`,`light`,`dark`];function xt(){try{let e=localStorage.getItem(yt);return bt.includes(e)?e:`system`}catch{return`system`}}function St(){return typeof window<`u`&&window.matchMedia?window.matchMedia(`(prefers-color-scheme: dark)`).matches:!1}function Ct(e){return e===`dark`||e===`light`?e:St()?`dark`:`light`}function wt(e){let t=Ct(e),n=document.documentElement;return n.setAttribute(`data-theme`,t),n.setAttribute(`data-theme-preference`,e),n.style.colorScheme=t,document.body?.setAttribute(`theme-mode`,t===`dark`?`dark`:`light`),t}var Tt=(0,O.createContext)({preference:`system`,theme:`light`,setPreference:()=>{},toggle:()=>{}});function Et({children:e}){let[t,n]=(0,O.useState)(xt),[r,i]=(0,O.useState)(()=>Ct(xt()));(0,O.useLayoutEffect)(()=>{i(wt(t));try{localStorage.setItem(yt,t)}catch{}if(t!==`system`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>i(wt(t));return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[t]),(0,O.useEffect)(()=>{document.body?.setAttribute(`theme-mode`,r===`dark`?`dark`:`light`)},[r]);let a=(0,O.useCallback)(e=>{bt.includes(e)&&n(e)},[]),o=(0,O.useCallback)(()=>{n(e=>Ct(e)===`dark`?`light`:`dark`)},[]),s=(0,O.useMemo)(()=>({preference:t,theme:r,setPreference:a,toggle:o}),[t,r,a,o]);return(0,M.jsx)(Tt.Provider,{value:s,children:e})}function Dt(){return(0,O.useContext)(Tt)}var Ot=[{id:`dashboard`,i18n:`nav.dashboard`,fallback:`仪表盘`,icon:S},{id:`chat`,i18n:`nav.chat`,fallback:`对话`,icon:Ne},{id:`deep-assessments`,i18n:`nav.deepAssessments`,fallback:`深度测评`,icon:t},{id:`security`,i18n:`nav.security`,fallback:`安全防护`,icon:me,anyPermission:[`hitl:read`,`config:read`],children:[{id:`hitl`,i18n:`nav.hitl`,fallback:`人机协同`,permission:`hitl:read`},{id:`tool-guard`,i18n:`nav.toolGuard`,fallback:`调用拦截`,permission:`config:read`}]},{id:`projects`,i18n:`nav.projects`,fallback:`项目管理`,icon:m},{id:`assets`,i18n:`nav.assets`,fallback:`资产管理`,icon:r,anyPermission:[`asset:read`,`fofa:execute`],children:[{id:`asset-overview`,i18n:`nav.assetOverview`,fallback:`资产概览`},{id:`asset-library`,i18n:`nav.assetLibrary`,fallback:`资产库`},{id:`info-collect`,i18n:`nav.infoCollect`,fallback:`信息收集`}]},{id:`vulnerabilities`,i18n:`nav.vulnerabilities`,fallback:`漏洞管理`,icon:me},{id:`tasks`,i18n:`nav.tasks`,fallback:`任务管理`,icon:g},{id:`workflows`,i18n:`nav.workflows`,fallback:`工作流`,icon:de},{id:`webshell`,i18n:`nav.webshell`,fallback:`WebShell管理`,icon:ve},{id:`c2`,i18n:`nav.c2`,fallback:`C2`,icon:fe,children:[{id:`c2-listeners`,i18n:`nav.c2Listeners`,fallback:`监听器`},{id:`c2-sessions`,i18n:`nav.c2Sessions`,fallback:`会话`},{id:`c2-tasks`,i18n:`nav.c2Tasks`,fallback:`任务`},{id:`c2-payloads`,i18n:`nav.c2Payloads`,fallback:`载荷`},{id:`c2-events`,i18n:`nav.c2Events`,fallback:`事件`},{id:`c2-profiles`,i18n:`nav.c2Profiles`,fallback:`流量伪装`}]},{id:`chat-files`,i18n:`nav.chatFiles`,fallback:`文件管理`,icon:be},{id:`plugin-hub`,i18n:`nav.pluginHub`,fallback:`能力平台`,icon:De,permission:`plugins:read`},{id:`mcp`,i18n:`nav.mcp`,fallback:`MCP`,icon:Oe,children:[{id:`mcp-monitor`,i18n:`nav.mcpMonitor`,fallback:`MCP状态监控`},{id:`mcp-management`,i18n:`nav.mcpManagement`,fallback:`MCP管理`}]},{id:`knowledge`,i18n:`nav.knowledge`,fallback:`知识`,icon:le,children:[{id:`knowledge-retrieval-logs`,i18n:`nav.knowledgeRetrievalLogs`,fallback:`检索历史`},{id:`knowledge-management`,i18n:`nav.knowledgeManagement`,fallback:`知识管理`}]},{id:`skills`,i18n:`nav.skills`,fallback:`技能`,icon:_e,children:[{id:`skills-monitor`,i18n:`nav.skillsMonitor`,fallback:`技能状态`},{id:`skills-management`,i18n:`nav.skillsManagement`,fallback:`技能管理`}]},{id:`agents`,i18n:`nav.agents`,fallback:`智能体`,icon:p,children:[{id:`agents-management`,i18n:`nav.agentsManagement`,fallback:`智能体管理`}]},{id:`roles`,i18n:`nav.roles`,fallback:`角色`,icon:ue,children:[{id:`roles-management`,i18n:`nav.rolesManagement`,fallback:`角色管理`}]},{id:`platform-rbac`,i18n:`nav.platformRbac`,fallback:`平台权限`,icon:ge},{id:`settings`,i18n:`nav.settings`,fallback:`系统设置`,icon:we},{id:`api-docs`,i18n:`apiDocs.title`,fallback:`API 文档`,icon:t}],kt=[{id:`workspace`,i18n:`nav.groupWorkspace`,fallback:`工作台`,pages:[`dashboard`,`chat`,`deep-assessments`,`security`]},{id:`operations`,i18n:`nav.groupOperations`,fallback:`安全作业`,pages:[`projects`,`assets`,`vulnerabilities`,`tasks`,`workflows`,`webshell`,`c2`,`chat-files`]},{id:`capabilities`,i18n:`nav.groupCapabilities`,fallback:`能力中心`,pages:[`plugin-hub`,`mcp`,`knowledge`,`skills`,`agents`,`roles`]},{id:`platform`,i18n:`nav.groupPlatform`,fallback:`平台管理`,pages:[`platform-rbac`,`settings`,`api-docs`]}],At=Ot.flatMap(e=>e.children?e.children.map(t=>({...t,parent:e.id})):[e]);function jt(e){return At.find(t=>t.id===e)||Ot.find(t=>t.id===e)||null}function Mt(e){"@babel/helpers - typeof";return Mt=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Mt(e)}function Nt(e,t){if(Mt(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Mt(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pt(e){var t=Nt(e,`string`);return Mt(t)==`symbol`?t:t+``}function F(e,t,n){return(t=Pt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ft;function It(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lt=It();function Rt(e){Lt=e}var zt={exec:()=>null};function I(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(L.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Bt=(()=>{try{return!0}catch{return!1}})(),L={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},Vt=/^(?:[ \t]*(?:\n|$))+/,Ht=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ut=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,R=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,z=/(?:[*+-]|\d{1,9}[.)])/,Gt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Kt=I(Gt).replace(/bull/g,z).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),qt=I(Gt).replace(/bull/g,z).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Jt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Yt=/^[^\n]+/,Xt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Zt=I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Xt).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Qt=I(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,z).getRegex(),$t=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,en=/|$))/,tn=I(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,en).replace(`tag`,$t).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),nn=I(Jt).replace(`hr`,R).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,$t).getRegex(),rn={blockquote:I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,nn).getRegex(),code:Ht,def:Zt,fences:Ut,heading:Wt,hr:R,html:tn,lheading:Kt,list:Qt,newline:Vt,paragraph:nn,table:zt,text:Yt},an=I(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,R).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,$t).getRegex(),on={...rn,lheading:qt,table:an,paragraph:I(Jt).replace(`hr`,R).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,an).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,$t).getRegex()},sn={...rn,html:I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,en).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:zt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:I(Jt).replace(`hr`,R).replace(`heading`,` *#{1,6} *[^ ]`).replace(`lheading`,Kt).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},cn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ln=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,un=/^( {2,}|\\)\n(?!\s*$)/,dn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Bt?"(?`+)[^`]+\k(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),bn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,xn=I(bn,`u`).replace(/punct/g,fn).getRegex(),Sn=I(bn,`u`).replace(/punct/g,gn).getRegex(),Cn=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,wn=I(Cn,`gu`).replace(/notPunctSpace/g,mn).replace(/punctSpace/g,pn).replace(/punct/g,fn).getRegex(),Tn=I(Cn,`gu`).replace(/notPunctSpace/g,vn).replace(/punctSpace/g,_n).replace(/punct/g,gn).getRegex(),En=I(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,mn).replace(/punctSpace/g,pn).replace(/punct/g,fn).getRegex(),Dn=I(/\\(punct)/,`gu`).replace(/punct/g,fn).getRegex(),On=I(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),kn=I(en).replace(`(?:-->|$)`,`-->`).getRegex(),An=I(`^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^`).replace(`comment`,kn).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Mn=I(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,jn).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nn=I(/^!?\[(label)\]\[(ref)\]/).replace(`label`,jn).replace(`ref`,Xt).getRegex(),Pn=I(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Xt).getRegex(),Fn=I(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Nn).replace(`nolink`,Pn).getRegex(),In=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ln={_backpedal:zt,anyPunctuation:Dn,autolink:On,blockSkip:yn,br:un,code:ln,del:zt,emStrongLDelim:xn,emStrongRDelimAst:wn,emStrongRDelimUnd:En,escape:cn,link:Mn,nolink:Pn,punctuation:hn,reflink:Nn,reflinkSearch:Fn,tag:An,text:dn,url:zt},Rn={...Ln,link:I(/^!?\[(label)\]\((.*?)\)/).replace(`label`,jn).getRegex(),reflink:I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,jn).getRegex()},zn={...Ln,emStrongRDelimAst:Tn,emStrongLDelim:Sn,url:I(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,In).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:I(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":`>`,'"':`"`,"'":`'`},Wn=e=>Un[e];function B(e,t){if(t){if(L.escapeTest.test(e))return e.replace(L.escapeReplace,Wn)}else if(L.escapeTestNoEncode.test(e))return e.replace(L.escapeReplaceNoEncode,Wn);return e}function Gn(e){try{e=encodeURI(e).replace(L.percentDecode,`%`)}catch{return null}return e}function Kn(e,t){let n=e.replace(L.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(L.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length0?-2:-1}function Yn(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Xn(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(` `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(` `)}var Zn=class{constructor(e){F(this,`options`,void 0),F(this,`rules`,void 0),F(this,`lexer`,void 0),this.options=e||Lt}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:qn(e,` `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Xn(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=qn(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:qn(t[0],` `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=qn(t[0],` `).split(` `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(` `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+` `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(` `,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=` `+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=` `+l}!u&&!l.trim()&&(u=!0),r+=f+` `,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(this.rules.other.listReplaceTask,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e=0;ee.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(i.loose)for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===` `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=qn(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Jn(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Yn(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Yn(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},V=class e{constructor(e){F(this,`tokens`,void 0),F(this,`options`,void 0),F(this,`state`,void 0),F(this,`tokenizer`,void 0),F(this,`inlineQueue`,void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Lt,this.options.tokenizer=this.options.tokenizer||new Zn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:L,block:Vn.normal,inline:Hn.normal};this.options.pedantic?(t.block=Vn.pedantic,t.inline=Hn.pedantic):this.options.gfm&&(t.block=Vn.gfm,t.inline=this.options.breaks?Hn.breaks:Hn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Vn,inline:Hn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(L.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let e=0;e(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=` `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+r.raw,n.text+=` `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if((r=this.tokenizer.fences(e))||(r=this.tokenizer.heading(e))||(r=this.tokenizer.hr(e))||(r=this.tokenizer.blockquote(e))||(r=this.tokenizer.list(e))||(r=this.tokenizer.html(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+r.raw,n.text+=` `+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if((r=this.tokenizer.table(e))||(r=this.tokenizer.lheading(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(` `)?``:` `)+r.raw,a.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+r.raw,n.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if((r=this.tokenizer.escape(e))||(r=this.tokenizer.tag(e))||(r=this.tokenizer.link(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if((r=this.tokenizer.emStrong(e,n,o))||(r=this.tokenizer.codespan(e))||(r=this.tokenizer.br(e))||(r=this.tokenizer.del(e))||(r=this.tokenizer.autolink(e))||!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},Qn=class{constructor(e){F(this,`options`,void 0),F(this,`parser`,void 0),this.options=e||Lt}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(L.notSpaceStart)?.[0],i=e.replace(L.endingNewline,``)+` `;return r?`
`+(n?i:B(i,!0))+`
`:`
`+(n?i:B(i,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} `}hr(e){return`
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t `+r+` `}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+B(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `,escaped:!0}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • `}checkbox({checked:e}){return``}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    `}table(e){let t=``,n=``;for(let t=0;t${r}`),` `+t+` `+r+`
    `}tablerow({text:e}){return` ${e} `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${B(e,!0)}`}br(e){return`
    `}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Gn(e);if(i===null)return r;e=i;let a=`
    `+r+``,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Gn(e);if(i===null)return B(n);e=i;let a=`${n}`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:B(e.text)}},$n=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},H=class e{constructor(e){F(this,`options`,void 0),F(this,`renderer`,void 0),F(this,`textRenderer`,void 0),this.options=e||Lt,this.options.renderer=this.options.renderer||new Qn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $n}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Qn(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Zn(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new er;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=er.passThroughHooks.has(n)?e=>{if(this.defaults.async&&er.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return V.lex(e,t??this.defaults)}parser(e,t){return H.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?V.lex:V.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?H.parse:H.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?V.lex:V.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?H.parse:H.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=` Please report this to https://github.com/markedjs/marked.`,e){let e=`

    An error occurred:

    `+B(n.message+``,!0)+`
    `;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function U(e,t){return tr.parse(e,t)}U.options=U.setOptions=function(e){return tr.setOptions(e),U.defaults=tr.defaults,Rt(U.defaults),U},U.getDefaults=It,U.defaults=Lt,U.use=function(...e){return tr.use(...e),U.defaults=tr.defaults,Rt(U.defaults),U},U.walkTokens=function(e,t){return tr.walkTokens(e,t)},U.parseInline=tr.parseInline,U.Parser=H,U.parser=H.parse,U.Renderer=Qn,U.TextRenderer=$n,U.Lexer=V,U.lexer=V.lex,U.Tokenizer=Zn,U.Hooks=er,U.parse=U,U.options,U.setOptions,U.use,U.walkTokens,U.parseInline,H.parse,V.lex;function nr(e,t){this.v=e,this.k=t}function rr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n`u`?null:Y(BigInt.prototype.toString),zr=typeof Symbol>`u`?null:Y(Symbol.prototype.toString),K=Y(Object.prototype.hasOwnProperty),Br=Y(Object.prototype.toString),Vr=RegExp.prototype.test,q=function(e,t){return e instanceof RegExp&&(e.lastIndex=0),vr(Vr,e,[t])},J=Hr(TypeError);function Y(e){return function(t){var n=[...arguments].slice(1);return vr(e,t,n)}}function Hr(e){return function(){return yr(e,[...arguments])}}function X(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ar;if(fr&&fr(e,null),!Er(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(pr(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Ur(e){for(let t=0;t/g),ci=G(/\${[\w\W]*/g),li=G(/{{|}}|\${|<%|%>|<%|%>/),ui=G(/^data-[\-\w.\u00B7-\uFFFF]+$/),di=G(/^aria-[\-\w]+$/),fi=G(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pi=G(/^(?:\w+script|data):/i),mi=G(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hi=G(/^html$/i),gi=G(/^[a-z][.\w]*(-[.\w]+)+$/i),_i=G(/<[/\w!]/g),vi=G(/<[/\w]/g),yi=G(/<\/no(script|embed|frames)/i),bi=G(/\/>/i),xi=G(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),Si=G(/^[\r\n\t ]+/),Q={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},Ci=W(X({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),wi=function(){return typeof window>`u`?null:window},Ti=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Ei=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Di=function(e,t,n,r){return K(e,t)&&Er(e[t])?X(r.base?Gr(r.base):{},e[t],r.transform):n},Oi=function(e,t,n){let r=K(e,t)?e[t]:void 0;return r&&typeof r==`object`?Wr(r):n};function ki(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wi(),t=e=>ki(e);if(t.version=`3.4.18`,t.removed=[],!e||!e.document||e.document.nodeType!==Q.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript,a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter,l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Z(d,`cloneNode`),p=Z(d,`remove`),m=Z(d,`removeAttributeNode`),h=Z(d,`nextSibling`),g=Z(d,`childNodes`),_=Z(d,`parentNode`),ee=Z(d,`shadowRoot`),te=Z(d,`attributes`),ne=o&&o.prototype?Z(o.prototype,`nodeType`):null,v=o&&o.prototype?Z(o.prototype,`nodeName`):null,y=o&&o.prototype?Z(o.prototype,`ownerDocument`):null,b=function(e){return ne?ne(e):e.nodeType},x=function(e){return v?v(e):e.nodeName},re=qr(d,`namespaceURI`),ie=function(e){return re?re(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let S,ae=``,oe,se=!1,ce=0,le=function(){if(ce>0)throw J(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ue=function(e){le(),ce++;try{return S.createHTML(e)}finally{ce--}},de=function(e){return S&&Ge?ue(e):e},fe=function(e){le(),ce++;try{return S.createScriptURL(e)}finally{ce--}},pe=function(){return se||(oe=Ti(u,i),se=!0),oe},me=n,he=me.implementation,ge=me.createNodeIterator,_e=me.createDocumentFragment,ve=me.getElementsByTagName,ye=r.importNode,C=Ei();t.isSupported=typeof ur==`function`&&typeof _==`function`&&he&&he.createHTMLDocument!==void 0;let be=oi,xe=si,Se=ci,Ce=ui,we=di,Te=pi,Ee=mi,De=gi,Oe=fi,w=null,ke=X({},[...Yr,...Xr,...Zr,...$r,...ti]),T=null,Ae=X({},[...ni,...ri,...ii,...ai]),E=null,je=null,Me=null,Ne=Object.seal(gr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Pe=!0,Fe=!0,Ie=!1,Le=!0,D=!1,Re=!0,ze=!1,Be=!1,Ve=null,He=null,Ue=!1,O=!1,We=!1,Ge=!1,Ke=!0,qe=!1,Je=`user-content-`,Ye=!0,Xe=!1,Ze=null,Qe=!1,k=null,$e=X({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),et=null,A=X({},[`audio`,`video`,`img`,`source`,`image`,`track`]),j=null,tt=X({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),nt=`http://www.w3.org/1998/Math/MathML`,rt=`http://www.w3.org/2000/svg`,M=`http://www.w3.org/1999/xhtml`,it=M,at=!1,ot=null,st=X({},[nt,rt,M],jr),ct=W(X({},[`mi`,`mo`,`mn`,`ms`,`mtext`])),lt=null,ut=W(X({},[`annotation-xml`])),dt=null,ft=W(gr(null)),pt=X({},[`title`,`style`,`font`,`a`,`script`]),mt=null,ht=[`application/xhtml+xml`,`text/html`],N=null,gt=null,_t=n.createElement(`form`),vt=function(e){return e instanceof RegExp||e instanceof Function},P=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e&&typeof e==`object`||(e={}),e=Wr(e),mt=ht.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,N=mt===`application/xhtml+xml`?jr:Ar,w=Di(e,`ALLOWED_TAGS`,ke,{transform:N}),T=Di(e,`ALLOWED_ATTR`,Ae,{transform:N}),ot=Di(e,`ALLOWED_NAMESPACES`,st,{transform:jr}),j=Di(e,`ADD_URI_SAFE_ATTR`,tt,{transform:N,base:tt}),et=Di(e,`ADD_DATA_URI_TAGS`,A,{transform:N,base:A}),k=Di(e,`FORBID_CONTENTS`,$e,{transform:N}),je=Di(e,`FORBID_TAGS`,gr(null),{transform:N}),Me=Di(e,`FORBID_ATTR`,gr(null),{transform:N}),Qe=K(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Wr(e.USE_PROFILES):e.USE_PROFILES:!1,Pe=e.ALLOW_ARIA_ATTR!==!1,Fe=e.ALLOW_DATA_ATTR!==!1,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Le=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,D=e.SAFE_FOR_TEMPLATES||!1,Re=e.SAFE_FOR_XML!==!1,ze=e.WHOLE_DOCUMENT||!1,O=e.RETURN_DOM||!1,We=e.RETURN_DOM_FRAGMENT||!1,Ge=e.RETURN_TRUSTED_TYPE||!1,Ue=e.FORCE_BODY||!1,Ke=e.SANITIZE_DOM!==!1,qe=e.SANITIZE_NAMED_PROPS||!1,Ye=e.KEEP_CONTENT!==!1,Xe=e.IN_PLACE||!1,Oe=Jr(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:fi,it=typeof e.NAMESPACE==`string`?e.NAMESPACE:M,lt=Oi(e,`MATHML_TEXT_INTEGRATION_POINTS`,ct),dt=Oi(e,`HTML_INTEGRATION_POINTS`,ut);let t=Oi(e,`CUSTOM_ELEMENT_HANDLING`,ft);if(E=gr(null),K(t,`tagNameCheck`)&&vt(t.tagNameCheck)&&(E.tagNameCheck=t.tagNameCheck),K(t,`attributeNameCheck`)&&vt(t.attributeNameCheck)&&(E.attributeNameCheck=t.attributeNameCheck),K(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(E.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),G(E),D&&(Fe=!1),We&&(O=!0),Qe&&((K(e,`ALLOWED_TAGS`)||K(e,`ALLOWED_ATTR`))&&typeof console<`u`&&typeof console.warn==`function`&&console.warn(`DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together.`),w=X({},ti),T=gr(null),Qe.html===!0&&(X(w,Yr),X(T,ni)),Qe.svg===!0&&(X(w,Xr),X(T,ri),X(T,ai)),Qe.svgFilters===!0&&(X(w,Zr),X(T,ri),X(T,ai)),Qe.mathMl===!0&&(X(w,$r),X(T,ii),X(T,ai))),Ne.tagCheck=null,Ne.attributeCheck=null,K(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Ne.tagCheck=e.ADD_TAGS:Er(e.ADD_TAGS)&&(w===ke&&(w=Gr(w)),X(w,e.ADD_TAGS,N))),K(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Ne.attributeCheck=e.ADD_ATTR:Er(e.ADD_ATTR)&&(T===Ae&&(T=Gr(T)),X(T,e.ADD_ATTR,N))),K(e,`ADD_FORBID_CONTENTS`)&&Er(e.ADD_FORBID_CONTENTS)&&(k===$e&&(k=Gr(k)),X(k,e.ADD_FORBID_CONTENTS,N)),Ye&&(w[`#text`]=!0),ze&&X(w,[`html`,`head`,`body`]),w.table&&(w.tbody=!0,delete je.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw J(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw J(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=S;S=e.TRUSTED_TYPES_POLICY;try{ae=ue(``)}catch(e){throw S=t,e}}else e.TRUSTED_TYPES_POLICY===null?(S=void 0,ae=``):(S===void 0&&(S=pe()),S&&typeof ae==`string`&&(ae=ue(``)));gt=W(e)},yt=X({},[...Xr,...Zr,...Qr]),bt=X({},[...$r,...ei]),xt=function(e,t,n){return t===M?e===`svg`:t===nt?e===`svg`&&(n===`annotation-xml`||lt[n]):!!yt[e]},St=function(e,t,n){return t===M?e===`math`:t===rt?e===`math`&&dt[n]:!!bt[e]},Ct=function(e,t,n){return t===rt&&!dt[n]||t===nt&&!lt[n]?!1:!bt[e]&&(pt[e]||!yt[e])},wt=function(e){let t=ie(e),n=Ar(x(e)),r=_(e),i=it,a=`template`;return r&&b(r)===Q.element&&(i=ie(r),a=Ar(x(r))),ot[t]?t===rt?xt(n,i,a):t===nt?St(n,i,a):t===M?Ct(n,i,a):mt===`application/xhtml+xml`:!1},Tt=function(e){Cr(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw J(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Et=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Dt=function(e){jt(e);let t=g(e);t&&br(wr(t),e=>{try{p(e)}catch{}}),b(e)===Q.element&&kt(e,!1)},Ot=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}if(Cr(t.removed,{attribute:r||null,from:n}),r)Et(n,r,e);else try{n.removeAttribute(e)}catch{}if(e===`is`){if(O||We)try{Tt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},kt=function(e,t){let n=te(e);if(n)for(let r=n.length-1;r>=0;--r){let i=n[r],a=i&&i.name;typeof a==`string`&&!(t&&T[N(a)])&&Et(e,i,a)}},At=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&b(e)===Q.element){let t=ee(e);R(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},jt=function(e){At(e,e=>{b(e)===Q.element&&kt(e,!0)})},Mt=function(e){let t=[];return At(e,e=>{t.push(e)},!0),t},Nt=function(e,t){let n=Dr();br(Mt(e),e=>{b(e)===Q.element&&Or(n,e)}),br(t,e=>{b(e)===Q.element&&!kr(n,e)&&kt(e,!0)})},Pt=function(e,n){let r=!1;return br(t.removed,t=>{t.element&&(r=r||t.element===e,jt(t.element))}),Nt(e,n),r},F=function(e,t){let n=Ze,r=null,i=()=>(r||(r=Dr(),br(t,e=>{Or(r,e)})),r);for(let t=0;;t++){let r=Mt(e),a=[e],o=!1;if(br(r,e=>{b(e)===Q.documentFragment?Cr(a,e):!o&&!kr(n,e)&&(o=kr(i(),e))}),!o)return;if(t>=8)throw J(`the tree kept changing during in-place sanitization; refusing to return it`);br(a,(t,n)=>{Ft(t,n>0,e,i())})}},Ft=function(e,t,n,r){let i=I(e),a;for(;a=i.nextNode();)kr(r,a)&&!kr(Ze,a)&&(t&&z(C.uponSanitizeShadowNode,a,null),an(a,n))},It=function(e){Ze&&Or(Ze,e)},Lt=function(e,t){return Re?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Rt=function(e){Re&&At(e,e=>{let t=b(e);if(t===Q.processingInstruction||t===Q.comment&&q(vi,e.data)){try{p(e)}catch{}return!1}if(t===Q.element){let t=e,n=N(x(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Lt(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},zt=function(e){let t=null,r=null;if(Ue)e=``+e;else{let t=Mr(e,Si);r=t&&t[0]}mt===`application/xhtml+xml`&&it===M&&(e=``+e+``);let i=S?ue(e):e;if(it===M)try{t=new l().parseFromString(i,mt)}catch{}if(!t||!t.documentElement){t=he.createDocument(it,`template`,null);try{t.documentElement.innerHTML=at?ae:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),it===M?ve.call(t,ze?`html`:`body`)[0]:ze?t.documentElement:a},I=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=y?y(e):e.ownerDocument;return ge.call(n||e,e,(t?0:c.SHOW_ELEMENT)|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Bt=function(e){return e=Nr(e,be,` `),e=Nr(e,xe,` `),e=Nr(e,Se,` `),e},L=function(e){Vt(e);let t=e.querySelectorAll?.call(e,`template`);t&&br(t,e=>{R(e.content)&&L(e.content)})},Vt=function(e){e.normalize();let t=I(e,!0),n=t.nextNode();for(;n;)n.data=Bt(n.data),n=t.nextNode()},Ht=function(e){let t=v?v(e):null;return typeof t!=`string`||N(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==te(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==ne(e)||e.childNodes!==g(e)},Ut=function(e){if(!ne||typeof e!=`object`||!e)return null;try{let t=ne(e);return typeof t==`number`?t:null}catch{return null}},R=function(e){return Ut(e)===Q.documentFragment},Wt=function(e){return Ut(e)!==null};function z(e,n,r){e.length!==0&&br(e,e=>{e.call(t,n,r,gt)})}let Gt=function(e,t,n){return!!(Re&&n===Q.element&&e.hasChildNodes()&&!Wt(e.firstElementChild)&&q(_i,e.textContent)&&q(_i,e.innerHTML)||Re&&Ci[t]&&n===Q.element&&ie(e)===M&&(Wt(e.firstElementChild)||typeof e.textContent==`string`&&q(_i,e.textContent))||n===Q.processingInstruction||Re&&n===Q.comment&&q(vi,e.data))},Kt=function(e,t){return e instanceof RegExp?q(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},qt=function(e,t,n){if(!je[t]&&$t(t)&&Kt(E.tagNameCheck,t))return!1;if(Ye&&!k[t]&&!k[Ar(t)]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Tt(e),!0},Jt=function(e,t,n,r){return e.length===0?t:t===n||t===r?Gr(t):t},Yt=function(e,t){return e===t||_(e)!==null?!1:(Xe&&jt(e),!0)},Xt=function(e,n){if(It(e),z(C.beforeSanitizeElements,e,null),Yt(e,n))return!0;if(Ht(e))return Tt(e),!0;let r=N(x(e)),i=b(e);if(w=Jt(C.uponSanitizeElement,w,ke,Ve),z(C.uponSanitizeElement,e,{tagName:r,allowedTags:w}),Yt(e,n))return!0;if(Gt(e,r,i))return Tt(e),!0;if(je[r]||!(Ne.tagCheck instanceof Function&&Ne.tagCheck(r))&&!w[r]){let t=qt(e,r,n);return t===!1&&(z(C.afterSanitizeElements,e,null),Yt(e,n))?!0:t}if(i===Q.element&&!wt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&q(yi,e.innerHTML))return Tt(e),!0;if(D&&i===Q.text){let n=e.textContent,r=Bt(n);n!==r&&(Cr(t.removed,{element:e.cloneNode()}),e.textContent=r)}return z(C.afterSanitizeElements,e,null),Yt(e,n)},Zt=function(e,t,r){if(Me[t]||Lt(t,e)||Ke&&(t===`id`||t===`name`)&&(r in n||r in _t))return!1;let i=T[t]||Ne.attributeCheck instanceof Function&&Ne.attributeCheck(t,e);if(Fe&&q(Ce,t)||Pe&&q(we,t))return!0;if(!i)return $t(e)&&Kt(E.tagNameCheck,e)&&Kt(E.attributeNameCheck,t,e)||t===`is`&&E.allowCustomizedBuiltInElements&&Kt(E.tagNameCheck,r);if(j[t])return!0;let a=Nr(r,Ee,``);return q(Oe,a)||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Pr(r,`data:`)===0&&et[e]||Ie&&!q(Te,a)?!0:!r},Qt=X({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),$t=function(e){return!Qt[Ar(e)]&&q(De,e)},en=function(e,t,n,r){if(S&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ue(r);case`TrustedScriptURL`:return fe(r)}return r},tn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Ht(e)||(Tt(e),!1)}catch{return Ot(t,e),!1}},nn=function(e,t){return Re&&q(xi,t)?!0:Ar(e)===`attributename`&&Pr(t,`href`)!==-1},rn=function(e,n){if(z(C.beforeSanitizeAttributes,e,null),Yt(e,n))return;let r=e.attributes;if(!r||Ht(e))return;T=Jt(C.uponSanitizeAttribute,T,Ae,He);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:T,forceKeepAttr:void 0},a=r.length,o=N(x(e));for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=N(s),d=l,f=s===`value`?d:Fr(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,z(C.uponSanitizeAttribute,e,i),f=i.attrValue,qe&&(u===`id`||u===`name`)&&Pr(f,Je)!==0&&(Ot(s,e,n),f=Je+f,p=!0),nn(s,f)?Ot(s,e,n):i.forceKeepAttr||(i.keepAttr?!Le&&q(bi,f)?Ot(s,e,n):(D&&(f=Bt(f)),Zt(o,u,f)?(f=en(o,u,c,f),f!==d&&tn(e,s,c,f)&&p&&Sr(t.removed)):Ot(s,e,n)):Ot(s,e,n))}z(C.afterSanitizeAttributes,e,null),Yt(e,n)},an=function(e,t){Xt(e,t),rn(e,t),R(e.content)&&on(e.content)},on=function(e){let t=null,n=I(e);for(z(C.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(z(C.uponSanitizeShadowNode,t,null),an(t,e),b(t)===Q.element){let e=ee(t);R(e)&&(sn(e),on(e))}D&&Vt(e),z(C.afterSanitizeShadowDOM,e,null)},sn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){on(e.shadow);continue}let n=e.node,r=b(n)===Q.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=v?v(n):null;if(typeof e==`string`&&N(e)===`template`){let e=n.content;R(e)&&t.push({node:e,shadow:null})}}if(r){let e=ee(n);R(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(at=!e,at&&(e=``),typeof e!=`string`&&!Wt(e)&&(e=Kr(e),typeof e!=`string`))throw J(`dirty is not a string, aborting`);if(!t.isSupported)return e;Be?(w=Ve,T=He):P(n),t.removed=[];let c=Xe&&typeof e!=`string`&&Wt(e),l=[],u=Ze;if(c){Rt(e);let t=x(e);if(typeof t==`string`){let n=N(t);if(!w[n]||je[n])throw Dt(e),J(`root node is forbidden and cannot be sanitized in-place`)}if(Ht(e))throw Dt(e),J(`root node is clobbered and cannot be sanitized in-place`);l=Mt(e),Ze=Dr()}else if(Wt(e))i=zt(``),a=i.ownerDocument.importNode(e,!0),a.nodeType===Q.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),sn(i);else{if(!O&&!D&&!ze&&e.indexOf(`<`)===-1)return de(e);if(i=zt(e),!i)return O?null:Ge?ae:``}i&&Ue&&Tt(i.firstChild);let d=c?e:i;try{c&&sn(e);let t=I(d);for(;o=t.nextNode();)an(o,d);c&&F(e,l)}catch(t){throw c&&(Dt(e),Pt(e,l)),t}finally{Ze=u}if(c){if(Pt(e,l))throw J(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return D&&L(e),e}if(O){if(D&&L(i),We)for(s=_e.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(T.shadowroot||T.shadowrootmode)&&(s=ye.call(r,s,!0)),s}let f=()=>ze?i.outerHTML:i.innerHTML,p=f();return D&&q(li,p)&&(Vt(i),p=f()),ze&&w[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&q(hi,i.ownerDocument.doctype.name)&&(p=` `+p),de(p)},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};P(e),Be=!0,Ve=w,He=T},t.clearConfig=function(){gt=null,Be=!1,Ve=null,He=null,S=oe,ae=``},t.isValidAttribute=function(e,t,n){gt||P({});let r=N(e),i=N(t);return typeof n==`string`&&(nn(t,n)||!Le&&q(bi,n))?!1:Zt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&K(C,e)&&Cr(C[e],t)},t.removeHook=function(e,t){if(K(C,e)){if(t!==void 0){let n=xr(C[e],t);return n===-1?void 0:Tr(C[e],n,1)[0]}return Sr(C[e])}},t.removeHooks=function(e){K(C,e)&&(C[e]=[])},t.removeAllHooks=function(){C=Ei()},t}var Ai=ki(),ji=[`critical`,`high`,`medium`,`low`,`info`],Mi={critical:`red`,high:`orange`,medium:`amber`,low:`blue`,info:`grey`},Ni={critical:`严重`,high:`高危`,medium:`中危`,low:`低危`,info:`信息`},Pi={running:`blue`,pending:`amber`,queued:`amber`,paused:`grey`,success:`green`,succeeded:`green`,completed:`green`,done:`green`,failed:`red`,error:`red`,cancelled:`grey`,canceled:`grey`,stopped:`grey`,active:`green`,inactive:`grey`,online:`green`,offline:`grey`,open:`red`,closed:`green`,archived:`grey`};function Fi(e,t=`zh-CN`){if(!e)return`—`;let n=e instanceof Date?e:new Date(e);return Number.isFinite(n.getTime())?n.toLocaleString(t,{hour12:!1}):`—`}function Ii(e,t=`zh-CN`){if(!e)return`—`;let n=e instanceof Date?e:new Date(e);return Number.isFinite(n.getTime())?n.toLocaleDateString(t):`—`}function Li(e,t){if(!e)return`—`;let n=new Date(e);if(!Number.isFinite(n.getTime()))return`—`;let r=Date.now()-n.getTime();return r<6e4?t?.(`common.justNow`,null,`刚刚`)||`刚刚`:r<36e5?t?.(`common.minutesAgo`,{n:Math.floor(r/6e4)},`${Math.floor(r/6e4)} 分钟前`):r<864e5?t?.(`common.hoursAgo`,{n:Math.floor(r/36e5)},`${Math.floor(r/36e5)} 小时前`):r<2592e6?t?.(`common.daysAgo`,{n:Math.floor(r/864e5)},`${Math.floor(r/864e5)} 天前`):Ii(e)}function Ri(e){let t=Number(e);if(!Number.isFinite(t)||t<0)return`—`;if(t<1024)return`${t} B`;let n=[`KB`,`MB`,`GB`,`TB`],r=t/1024,i=0;for(;r>=1024&&i=100?0:1)} ${n[i]}`}function zi(e,t=`zh-CN`){let n=Number(e);return Number.isFinite(n)?n.toLocaleString(t):`—`}function Bi(e,t=1){let n=Number(e);return Number.isFinite(n)?`${(n*(n<=1?100:1)).toFixed(t)}%`:`—`}function Vi(e){return Mi[String(e||``).toLowerCase()]||`grey`}function Hi(e){return Pi[String(e||``).toLowerCase()]||`grey`}function Ui(e,t=120){let n=String(e??``);return n.length>t?`${n.slice(0,t)}…`:n}var{Title:Wi,Text:Gi,Paragraph:Ki}=c;function qi(e){Ce.success({content:e,duration:2})}function Ji(e){Ce.warning({content:e,duration:3})}function Yi(e,t=`操作失败`){Ce.error({content:rt(e,t),duration:4})}function Xi({title:e,description:t,extra:n,children:r}){return(0,M.jsxs)(`header`,{className:`cs-page-header`,children:[(0,M.jsxs)(`div`,{className:`cs-page-header-main`,children:[(0,M.jsx)(Wi,{heading:3,className:`cs-page-title`,children:e}),t&&(0,M.jsx)(Gi,{type:`tertiary`,className:`cs-page-desc`,children:t}),r]}),n&&(0,M.jsx)(f,{className:`cs-page-header-extra`,wrap:!0,children:n})]})}function Zi({title:e,description:t,extra:n,children:r,className:i=``,bodyClassName:a=``}){return(0,M.jsxs)(s,{className:`cs-section-card ${i}`,title:e?(0,M.jsx)(`span`,{className:`cs-section-title`,children:e}):void 0,headerExtraContent:n,bordered:!1,children:[t&&(0,M.jsx)(Ki,{type:`tertiary`,className:`cs-section-desc`,children:t}),(0,M.jsx)(`div`,{className:a,children:r})]})}function Qi({metrics:e,columns:t=4}){return(0,M.jsx)(`div`,{className:`cs-stat-grid`,style:{"--cs-stat-columns":t},children:e.map(e=>(0,M.jsx)($i,{...e},e.id||e.label))})}function $i({label:e,value:t,valueTitle:n,detail:r,tone:i,severity:a,icon:o,onClick:c,pressed:l,loading:u=!1}){let d=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`span`,{className:`cs-stat-head`,children:[(0,M.jsx)(Gi,{type:`tertiary`,className:`cs-stat-label`,children:e}),o&&(0,M.jsx)(`span`,{className:`cs-stat-icon ${i?`tone-${i}`:``}`,"aria-hidden":`true`,children:o})]}),(0,M.jsx)(_,{loading:u,placeholder:(0,M.jsx)(_.Title,{style:{width:`60%`,height:36,margin:`8px 0`}}),children:(0,M.jsx)(`span`,{className:`cs-stat-value ${i?`tone-${i}`:``}`,title:n,children:t??`—`})}),r&&(0,M.jsx)(`span`,{className:`cs-stat-detail`,children:r})]});return c?(0,M.jsx)(b,{className:`cs-stat-card is-clickable`,theme:`borderless`,onClick:c,"aria-label":String(e),"aria-pressed":l,"data-severity":a,children:d}):(0,M.jsx)(s,{className:`cs-stat-card`,"data-severity":a,bordered:!1,children:d})}function ea({columns:e,dataSource:t,rowKey:n=`id`,loading:r,pagination:i,emptyText:a,onRefresh:s,toolbar:c,size:l=`default`,className:u=``,...d}){let f=P(),p=i!==!1&&{pageSize:10,showSizeChanger:!0,pageSizeOpts:[10,20,50,100],showTotal:!0,...i||{}};return(0,M.jsxs)(`div`,{className:`cs-table-wrap ${u}`,children:[(c||s)&&(0,M.jsxs)(`div`,{className:`cs-table-toolbar`,children:[(0,M.jsx)(`div`,{className:`cs-table-toolbar-main`,children:c}),s&&(0,M.jsx)(b,{icon:(0,M.jsx)(T,{}),theme:`borderless`,onClick:s,loading:r,children:f(`common.refresh`,null,`刷新`)})]}),(0,M.jsx)(`div`,{className:`cs-table-scroll`,children:(0,M.jsx)(ke,{columns:e,dataSource:t||[],rowKey:n,loading:r,pagination:p,size:l,empty:(0,M.jsx)(o,{image:(0,M.jsx)(je,{size:`extra-large`}),title:a||f(`common.noData`,null,`暂无数据`),description:null,className:`cs-table-empty`}),...d})})]})}function ta({error:e,onRetry:t}){let n=P();return e?(0,M.jsx)(i,{type:`danger`,bordered:!0,closeIcon:null,className:`cs-error-banner`,description:(0,M.jsxs)(f,{wrap:!0,children:[(0,M.jsx)(`span`,{children:rt(e,n(`common.loadFailed`,null,`加载失败`))}),t&&(0,M.jsx)(b,{size:`small`,onClick:t,children:n(`common.refresh`,null,`刷新`)})]})}):null}function na({severity:e,size:t=`small`}){let n=String(e||``).toLowerCase();return(0,M.jsx)(te,{size:t,color:Vi(n),shape:`circle`,className:`cs-severity-tag`,"data-severity":ji.includes(n)?n:void 0,children:Ni[n]||e||`—`})}function ra({status:e,label:t,size:n=`small`}){let r=String(e||``).toLowerCase();return(0,M.jsx)(te,{size:n,color:Hi(r),shape:`square`,children:t||e||`—`})}function ia({text:e,label:t,size:n=`default`,theme:r=`borderless`}){let i=P();return(0,M.jsx)(b,{size:n,theme:r,icon:(0,M.jsx)(x,{}),"aria-label":t||i(`common.copy`,null,`复制`),onClick:async()=>{try{await navigator.clipboard.writeText(String(e??``)),qi(i(`common.copied`,null,`已复制`))}catch(e){Yi(e,i(`common.copyFailed`,null,`复制失败`))}},children:t})}function aa({content:e,className:t=``}){let n=(0,O.useMemo)(()=>{let t=U.parse(String(e??``),{breaks:!0,gfm:!0});return Ai.sanitize(t,{ADD_ATTR:[`target`,`rel`]})},[e]);return(0,M.jsx)(`div`,{className:`cs-markdown ${t}`,dangerouslySetInnerHTML:{__html:n}})}function oa({value:e,collapsed:t=!1,title:n}){let[r,i]=(0,O.useState)(!t),a=P(),o=(0,O.useMemo)(()=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}},[e]);return(0,M.jsxs)(`div`,{className:`cs-json-viewer`,children:[(0,M.jsxs)(`div`,{className:`cs-json-viewer-head`,children:[(0,M.jsx)(Gi,{strong:!0,children:n||`JSON`}),(0,M.jsxs)(f,{spacing:4,children:[(0,M.jsx)(ia,{text:o}),(0,M.jsx)(b,{theme:`borderless`,size:`small`,icon:r?(0,M.jsx)(d,{}):(0,M.jsx)(l,{}),"aria-expanded":r,"aria-label":a(r?`common.collapse`:`common.expand`,null,r?`收起`:`展开`),onClick:()=>i(e=>!e)})]})]}),(0,M.jsx)(ee,{isOpen:r,children:(0,M.jsx)(`pre`,{className:`cs-json-viewer-body`,children:o})})]})}function sa({items:e,columns:t=2}){return(0,M.jsx)(v,{className:`cs-description-list`,layout:`horizontal`,align:`plain`,column:t,data:e.filter(Boolean).map(e=>({key:e.label,value:e.value??`—`}))})}function ca({title:e,content:t,okText:n,danger:r=!0,onOk:i}){ie.confirm({title:e,content:t,okText:n||`确定`,cancelText:`取消`,okButtonProps:r?{type:`danger`}:void 0,onOk:i})}var la=`a[href], button, input, select, textarea, iframe, [tabindex], [contenteditable="true"]`;function ua({title:e,visible:t,onCancel:n,width:r=560,footer:i,children:a,className:o,closeOnEsc:s=!0,mask:c=!0,maskClosable:l=!0,onOk:u,formId:d,okText:f,cancelText:p,okButtonProps:m,cancelButtonProps:h,confirmLoading:g,..._}){let ee=P(),te=(0,O.useRef)(null),[ne,v]=(0,O.useState)(!1),y=g??ne,x=(0,O.useCallback)(e=>{let t=e?.closest(`[role="dialog"]`);if(!t)return;te.current=t;let n=document.activeElement;return c&&(t.setAttribute(`aria-modal`,`true`),queueMicrotask(()=>{te.current===t&&!t.contains(document.activeElement)&&t.focus({preventScroll:!0})})),()=>{if(te.current=null,!c)return;t.removeAttribute(`aria-modal`);let e=document.activeElement;n?.isConnected&&(t.contains(e)||e===document.body)&&n.focus({preventScroll:!0})}},[c]);(0,O.useEffect)(()=>{if(!t)return;let e=e=>{let t=te.current,r=document.activeElement;if(e.defaultPrevented||!t?.contains(r)||(e.key===`Escape`&&s&&n&&(e.preventDefault(),n(e)),e.key!==`Tab`||!c))return;let i=[...t.querySelectorAll(la)].filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&e.getClientRects().length),a=i[0],o=i.at(-1);(!a||(e.shiftKey?r===a||r===t:r===o))&&(e.preventDefault(),(e.shiftKey?o:a)?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,c,n,t]);let re=e=>{if(y)return;let t=u?.(e);if(g===void 0&&typeof t?.then==`function`){v(!0);let e=()=>v(!1);Promise.resolve(t).then(e,e)}},ie=i===void 0&&(u||d)?(0,M.jsxs)(M.Fragment,{children:[n&&(0,M.jsx)(b,{type:`tertiary`,onClick:n,...h,children:p||ee(`common.cancel`,null,`取消`)}),(0,M.jsx)(b,{theme:`solid`,type:`primary`,...m,loading:y,disabled:y||m?.disabled,onClick:d?void 0:re,form:d,htmlType:d?`submit`:`button`,children:f||ee(`common.ok`,null,`确定`)})]}):i;return(0,M.jsxs)(Te,{title:e,visible:t,onCancel:n,width:r,footer:ie,mask:c,maskClosable:l&&!y,closeOnEsc:!1,className:`cs-drawer ${o||``}`,"aria-label":typeof e==`string`?e:void 0,..._,children:[(0,M.jsx)(`span`,{hidden:!0,ref:x}),a]})}function da(e,t=[],{initial:n=null,skip:r=!1}={}){let[i,a]=(0,O.useState)(n),[o,s]=(0,O.useState)(!r),[c,l]=(0,O.useState)(null),u=(0,O.useRef)(0),d=(0,O.useRef)(null),f=(0,O.useRef)(!1),p=(0,O.useCallback)(async(t={})=>{if(r||t.silent&&!t.force&&f.current)return null;d.current?.abort();let n=new AbortController;d.current=n,f.current=!0;let i=++u.current;t.silent||s(!0),l(null);try{let t=await Qe(n.signal,()=>e({signal:n.signal}));return!n.signal.aborted&&i===u.current&&a(t),t}catch(e){return n.signal.aborted||i===u.current&&l(e),null}finally{d.current===n&&(d.current=null,f.current=!1),!n.signal.aborted&&i===u.current&&s(!1)}},t);return(0,O.useEffect)(()=>{if(r)d.current?.abort(),d.current=null,f.current=!1,s(!1);else return p(),()=>{u.current+=1,d.current?.abort(),d.current=null,f.current=!1}},[p,r]),{data:i,setData:a,loading:o,error:c,reload:p}}function fa(e,t=300){let[n,r]=(0,O.useState)(e);return(0,O.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function pa(e,t){let n=(0,O.useRef)(e);(0,O.useEffect)(()=>{n.current=e},[e]),(0,O.useEffect)(()=>{if(!t)return;let e=setInterval(()=>n.current(),t);return()=>clearInterval(e)},[t])}function ma(e,t){let[n,r]=(0,O.useState)(()=>{try{let n=localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}});return(0,O.useEffect)(()=>{try{localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),[n,r]}var{Text:ha}=c,ga={position:`right`,contentClassName:`cs-nav-flyout`};function _a(){let[e,t]=(0,O.useState)(()=>window.matchMedia(`(max-width: 900px)`).matches);return(0,O.useEffect)(()=>{let e=window.matchMedia(`(max-width: 900px)`),n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function va(e,t,n,r){return e.filter(e=>(!e.anyPermission||r(e.anyPermission))&&(!e.permission||n(e.permission))).map(e=>{let r=e.children?e.children.filter(e=>!e.permission||n(e.permission)):null;return r&&r.length===0?null:{itemKey:e.id,text:t(e.i18n,null,e.fallback),icon:e.icon?(0,M.jsx)(e.icon,{"aria-hidden":`true`}):void 0,items:r?r.map(e=>({itemKey:e.id,text:t(e.i18n,null,e.fallback)})):void 0}}).filter(Boolean)}function ya(){let{preference:e,setPreference:t}=Dt(),n=P(),r=[{key:`system`,label:n(`theme.system`,null,`跟随系统`)},{key:`light`,label:n(`theme.light`,null,`浅色`)},{key:`dark`,label:n(`theme.dark`,null,`暗色`)}],i=r.find(t=>t.key===e)||r[0];return(0,M.jsx)(E,{trigger:`click`,position:`bottomRight`,menu:r.map(n=>({node:`item`,name:n.label,active:n.key===e,onClick:()=>t(n.key)})),children:(0,M.jsx)(b,{theme:`borderless`,type:`tertiary`,icon:e===`dark`?(0,M.jsx)(ye,{}):(0,M.jsx)(Se,{}),"aria-label":i.label})})}function ba(){let{lang:e,setLanguage:t}=vt();return(0,M.jsx)(E,{trigger:`click`,position:`bottomRight`,menu:ct.map(n=>({node:`item`,name:n.label,active:n.id===e,onClick:()=>t(n.id)})),children:(0,M.jsx)(b,{theme:`borderless`,type:`tertiary`,icon:(0,M.jsx)(re,{}),"aria-label":e})})}function xa({navigate:e}){let t=P(),[n,r]=(0,O.useState)([]),[i,a]=(0,O.useState)(0),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(!1),u=(0,O.useRef)(null),d=(0,O.useRef)(!1),f=async({force:e=!1}={})=>{if(!e&&d.current)return;u.current?.abort();let t=new AbortController;u.current=t,d.current=!0;try{let e=await j.get(`/notifications/summary`,{limit:80,lang:document.documentElement.lang||`zh-CN`},{signal:t.signal});if(t.signal.aborted)return;let n=Array.isArray(e?.items)?e.items:[];r(n),a(e?.unreadCount??n.filter(e=>!e.read).length)}catch{}finally{u.current===t&&(u.current=null,d.current=!1)}};(0,O.useEffect)(()=>(f({force:!0}),()=>{u.current?.abort(),u.current=null,d.current=!1}),[]),pa(()=>f(),6e4);let p=async()=>{let e=n.filter(e=>!e.read).map(e=>e.id).filter(Boolean);if(e.length&&!c){l(!0);try{await j.post(`/notifications/read`,{eventIds:e}),await f({force:!0})}catch(e){Yi(e)}finally{l(!1)}}},m=t=>{s(!1),t.type===`vulnerability_created`&&t.vulnerabilityId?e(`/vulnerabilities?id=${encodeURIComponent(t.vulnerabilityId)}`):(t.type===`task_completed`||t.type===`long_running_tasks`)&&t.conversationId?e(`/chat?conversation=${encodeURIComponent(t.conversationId)}`):t.type===`task_failed`?e(`/mcp-monitor`):t.type===`hitl_pending`?e(`/hitl`):t.type===`c2_session_online`&&e(`/c2-sessions`)},g=(0,M.jsxs)(`div`,{className:`cs-notification-panel`,children:[(0,M.jsxs)(`div`,{className:`cs-notification-head`,children:[(0,M.jsx)(ha,{strong:!0,children:t(`notifications.title`,null,`通知`)}),(0,M.jsx)(b,{size:`small`,theme:`borderless`,onClick:p,loading:c,children:t(`notifications.markAllRead`,null,`全部标记已读`)})]}),(0,M.jsxs)(`div`,{className:`cs-notification-list`,children:[n.length===0&&(0,M.jsx)(ha,{type:`tertiary`,children:t(`notifications.empty`,null,`暂无新通知`)}),n.map(e=>(0,M.jsxs)(`button`,{type:`button`,className:`cs-notification-item`,onClick:()=>m(e),children:[(0,M.jsx)(`span`,{className:`cs-notification-dot level-${e.level||`p2`}`}),(0,M.jsxs)(`span`,{className:`cs-notification-body`,children:[(0,M.jsx)(`span`,{className:`cs-notification-title`,children:e.title||e.message||e.type}),(0,M.jsxs)(`span`,{className:`cs-notification-meta`,children:[e.ts?Fi(e.ts):``,e.count>1?` · ×${e.count}`:``]})]})]},e.id||`${e.type}-${e.ts}`))]})]});return(0,M.jsx)(h,{content:g,trigger:`click`,position:`bottomRight`,visible:o,onVisibleChange:s,children:(0,M.jsx)(oe,{count:i||null,overflowCount:99,type:`danger`,children:(0,M.jsx)(b,{theme:`borderless`,type:`tertiary`,icon:(0,M.jsx)(y,{}),"aria-label":t(`notifications.title`,null,`通知`)})})})}function Sa({navigate:e}){let{user:t,logout:n,refresh:r}=st(),i=P(),[o,s]=(0,O.useState)(!1),c=(0,O.useId)(),[l,d]=(0,O.useState)(null),[f,p]=(0,O.useState)(!1);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(E,{trigger:`click`,position:`bottomRight`,menu:[{node:`title`,name:t?.display_name||t?.username||`admin`},{node:`item`,name:i(`auth.changePassword`,null,`修改密码`),icon:(0,M.jsx)(a,{}),onClick:()=>s(!0)},{node:`item`,name:i(`auth.refreshSession`,null,`刷新会话权限`),onClick:()=>r().then(()=>qi(i(`auth.sessionRefreshed`,null,`会话已刷新`))).catch(e=>Yi(e))},{node:`divider`},{node:`item`,name:i(`auth.logout`,null,`退出登录`),icon:(0,M.jsx)(ne,{}),onClick:async()=>{await n(),e(`/dashboard`)}}],children:(0,M.jsxs)(b,{theme:`borderless`,type:`tertiary`,className:`cs-user-trigger`,"aria-label":i(`auth.userMenu`,null,`用户菜单`),children:[(0,M.jsx)(u,{size:`extra-small`,color:`blue`,children:(t?.display_name||t?.username||`A`).slice(0,1).toUpperCase()}),(0,M.jsx)(`span`,{className:`cs-user-name`,children:t?.display_name||t?.username||`admin`})]})}),(0,M.jsx)(ua,{title:i(`auth.changePassword`,null,`修改密码`),visible:o,onCancel:()=>s(!1),formId:c,okText:i(`common.save`,null,`保存`),confirmLoading:f,width:420,children:(0,M.jsxs)(C,{id:c,onSubmit:async e=>{p(!0);try{await j.post(`/auth/change-password`,{oldPassword:e.oldPassword,newPassword:e.newPassword}),qi(i(`auth.passwordChanged`,null,`密码已更新`)),s(!1),l?.reset()}catch(e){Yi(e,i(`auth.changeFailed`,null,`修改密码失败`))}finally{p(!1)}},getFormApi:d,children:[(0,M.jsx)(C.Input,{field:`oldPassword`,label:i(`auth.currentPassword`,null,`当前密码`),type:`password`,rules:[{required:!0,message:i(`auth.required`,null,`必填`)}]}),(0,M.jsx)(C.Input,{field:`newPassword`,label:i(`auth.newPassword`,null,`新密码`),type:`password`,rules:[{required:!0,min:8,message:i(`auth.passwordMin`,null,`至少 8 位`)}]}),(0,M.jsx)(C.Input,{field:`confirmPassword`,label:i(`auth.confirmPassword`,null,`确认新密码`),type:`password`,rules:[{required:!0,message:i(`auth.required`,null,`必填`)},{validator:(e,t)=>t===l?.getValue(`newPassword`),message:i(`auth.passwordMismatch`,null,`两次输入不一致`)}]})]})})]})}function Ca(){let{session:e,hasPermission:t,hasAnyPermission:n}=st(),r=(0,O.useId)(),i=P(),a=Re(),o=D(),s=_a(),[c,l]=(0,O.useState)(()=>localStorage.getItem(`csai-nav-collapsed`)===`1`),[u,d]=(0,O.useState)(!1),[p,m]=(0,O.useState)([]),h=a.pathname.replace(/^\//,``).split(`/`)[0]||`dashboard`,g=jt(h),_=(0,O.useMemo)(()=>[h],[h]),ee=(0,O.useMemo)(()=>va(Ot,i,t,n),[i,t,n]);(0,O.useEffect)(()=>{d(!1),g?.parent&&m(e=>e.includes(g.parent)?e:[...e,g.parent])},[a.pathname,g?.parent]),(0,O.useEffect)(()=>{document.title=`${g?i(g.i18n,null,g.fallback):`工作台`} · CyberStrikeAI`},[g,i]);let te=({itemKey:e})=>{let t=a.search,n=[`chat`,`vulnerabilities`,`settings`,`deep-assessments`].includes(e)&&h===e?t:``;o(`/${e}${n}`)},ne=()=>{l(e=>(localStorage.setItem(`csai-nav-collapsed`,e?`0`:`1`),!e))},v=c&&!s,y=!v&&e?.appVersion,x=(0,M.jsxs)(`div`,{className:`cs-sidebar-inner ${v?`is-compact`:``}`,children:[(0,M.jsxs)(b,{className:`cs-brand`,theme:`borderless`,type:`tertiary`,onClick:()=>o(`/dashboard`),"aria-label":`CyberStrikeAI`,"aria-describedby":y?r:void 0,children:[(0,M.jsx)(`img`,{src:`/static/logo.png`,alt:``,className:`cs-brand-logo`}),!v&&(0,M.jsxs)(`span`,{className:`cs-brand-copy`,children:[(0,M.jsxs)(`span`,{className:`cs-brand-name`,children:[`CyberStrike`,(0,M.jsx)(`span`,{children:`AI`})]}),y&&(0,M.jsx)(`span`,{id:r,className:`cs-brand-version`,dir:`ltr`,title:`${i(`header.version`,null,`当前版本`)} ${y}`,children:y})]})]}),(0,M.jsx)(`div`,{className:`cs-nav-scroll`,children:kt.map(e=>{let t=ee.filter(t=>e.pages.includes(t.itemKey));return t.length?(0,M.jsxs)(`section`,{className:`cs-nav-section`,"aria-label":i(e.i18n,null,e.fallback),children:[!v&&(0,M.jsx)(`div`,{className:`cs-nav-section-label`,children:i(e.i18n,null,e.fallback)}),(0,M.jsx)(he,{className:`cs-nav`,style:{width:`100%`},items:t,selectedKeys:_,onSelect:te,isCollapsed:v,subDropdownProps:ga,openKeys:p,onOpenChange:({openKeys:e})=>m(e)})]},e.id):null})}),!s&&(0,M.jsx)(`div`,{className:`cs-nav-footer`,children:(0,M.jsx)(b,{theme:`borderless`,type:`tertiary`,block:!0,icon:v?(0,M.jsx)(ae,{}):(0,M.jsx)(ce,{}),"aria-label":i(v?`nav.expand`:`nav.collapse`,null,v?`展开菜单`:`收起菜单`),onClick:ne,children:!v&&i(`nav.collapse`,null,`收起菜单`)})})]}),re=g?i(g.i18n,null,g.fallback):`CyberStrikeAI`,ie=g?.parent?jt(g.parent):null,S=ie?i(ie.i18n,null,ie.fallback):``;return(0,M.jsxs)(`div`,{className:`cs-shell ${c&&!s?`is-collapsed`:``}`,children:[!s&&(0,M.jsx)(`aside`,{className:`cs-sider`,children:x}),s&&(0,M.jsx)(Te,{visible:u,onCancel:()=>d(!1),placement:`left`,width:264,title:i(`nav.navigation`,null,`导航`),bodyStyle:{padding:0},className:`cs-mobile-nav`,children:x}),(0,M.jsxs)(`div`,{className:`cs-main`,children:[(0,M.jsxs)(`header`,{className:`cs-header`,children:[(0,M.jsxs)(`div`,{className:`cs-header-left`,children:[s&&(0,M.jsx)(b,{theme:`borderless`,icon:(0,M.jsx)(Ae,{}),onClick:()=>d(!0),"aria-label":i(`common.expandPanel`,null,`展开面板`)}),(0,M.jsxs)(Me,{className:`cs-header-crumb`,compact:!1,children:[(0,M.jsx)(Me.Item,{onClick:()=>o(`/dashboard`),children:i(`nav.groupWorkspace`,null,`工作台`)}),S&&(0,M.jsx)(Me.Item,{children:S}),(0,M.jsx)(Me.Item,{children:re})]})]}),(0,M.jsxs)(f,{className:`cs-header-actions`,spacing:4,children:[(0,M.jsx)(xa,{navigate:o}),(0,M.jsx)(ba,{}),(0,M.jsx)(ya,{}),(0,M.jsx)(Sa,{navigate:o})]})]}),(0,M.jsx)(`main`,{className:`cs-content ${h===`chat`?`cs-content-workspace`:``}`,id:`main-content`,children:(0,M.jsx)(Le,{context:{navigate:o,pageId:h,mobile:s}})})]})]})}var{Title:wa,Text:Ta,Paragraph:Ea}=c;function Da(){let{login:e}=st(),n=P(),[r,a]=(0,O.useState)(!1),[o,c]=(0,O.useState)(``);async function l(t){a(!0),c(``);try{await e(t.username,t.password)}catch(e){c(rt(e,n(`login.loginFailed`,null,`登录失败`)))}finally{a(!1)}}return(0,M.jsxs)(`main`,{className:`cs-login-page`,children:[(0,M.jsxs)(`section`,{className:`cs-login-story`,children:[(0,M.jsxs)(`div`,{className:`cs-login-brand`,children:[(0,M.jsx)(`img`,{src:`/static/logo.png`,alt:``,className:`cs-login-logo`}),(0,M.jsxs)(`span`,{className:`cs-brand-name`,children:[`CyberStrike`,(0,M.jsx)(`span`,{children:`AI`})]})]}),(0,M.jsxs)(`div`,{className:`cs-login-intro`,children:[(0,M.jsx)(`span`,{className:`cs-login-emblem`,"aria-hidden":`true`,children:(0,M.jsx)(me,{size:`extra-large`})}),(0,M.jsx)(wa,{heading:1,className:`cs-login-headline`,children:n(`login.headline`,null,`让每一次探索,都有据可循。`)}),(0,M.jsx)(Ea,{type:`tertiary`,children:n(`login.intro`,null,`从目标梳理到证据归档,在一个工作台中完成你的安全研究。`)}),(0,M.jsxs)(`div`,{className:`cs-login-features`,children:[(0,M.jsxs)(`div`,{className:`cs-login-feature`,children:[(0,M.jsx)(m,{size:`large`}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`strong`,{children:n(`login.projectTitle`,null,`围绕项目协作`)}),n(`login.projectHint`,null,`跨会话共享目标、上下文与研究进展`)]})]}),(0,M.jsxs)(`div`,{className:`cs-login-feature`,children:[(0,M.jsx)(de,{size:`large`}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`strong`,{children:n(`login.assessmentTitle`,null,`让探索持续推进`)}),n(`login.assessmentHint`,null,`规划、执行与人工复核,始终保持可控`)]})]}),(0,M.jsxs)(`div`,{className:`cs-login-feature`,children:[(0,M.jsx)(t,{size:`large`}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`strong`,{children:n(`login.evidenceTitle`,null,`以证据支撑结论`)}),n(`login.evidenceHint`,null,`保留发现、来源与验收记录`)]})]})]})]}),(0,M.jsx)(Ta,{type:`tertiary`,size:`small`,children:n(`login.platformTagline`,null,`AI 驱动的安全研究工作台`)})]}),(0,M.jsx)(`section`,{className:`cs-login-form-panel`,children:(0,M.jsxs)(s,{className:`cs-login-card`,bordered:!1,children:[(0,M.jsx)(wa,{heading:2,className:`cs-login-form-heading`,children:n(`login.welcome`,null,`欢迎回来`)}),(0,M.jsx)(Ta,{type:`tertiary`,children:n(`login.welcomeHint`,null,`登录你的安全工作台,继续探索。`)}),(0,M.jsxs)(C,{onSubmit:l,className:`cs-login-form`,children:[o&&(0,M.jsx)(i,{type:`danger`,description:o,closeIcon:null,className:`cs-error-banner`}),(0,M.jsx)(C.Input,{field:`username`,label:n(`login.username`,null,`用户名`),prefix:(0,M.jsx)(ue,{}),placeholder:n(`login.usernamePlaceholder`,null,`请输入用户名`),size:`large`,autoComplete:`username`,rules:[{required:!0,message:n(`login.usernameRequired`,null,`请输入用户名`)}]}),(0,M.jsx)(C.Input,{field:`password`,label:n(`login.password`,null,`密码`),prefix:(0,M.jsx)(ge,{}),type:`password`,size:`large`,autoComplete:`current-password`,placeholder:n(`login.passwordPlaceholder`,null,`请输入密码`),rules:[{required:!0,message:n(`login.passwordRequired`,null,`请输入密码`)}]}),(0,M.jsx)(b,{htmlType:`submit`,theme:`solid`,type:`primary`,size:`large`,block:!0,loading:r,children:n(`login.submit`,null,`登录`)})]}),(0,M.jsx)(Ta,{type:`tertiary`,className:`cs-login-note`,children:n(`login.authorizedOnly`,null,`仅在明确授权的范围内开展安全测试`)})]})})]})}var Oa=`modulepreload`,ka=function(e){return`/static/app/`+e},Aa={},ja=function(e){return e.pathname.endsWith(`.css`)},Ma=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=ka(t,n);let r=s(t),i=ja(r);return Ma(Aa,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Oa,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Na={dashboard:(0,O.lazy)(()=>$(()=>import(`./dashboard-Bw4z9UMz.js`),__vite__mapDeps([0,1,2,3,4,5]))),chat:(0,O.lazy)(()=>$(()=>import(`./chat-Cq-XdIX7.js`),__vite__mapDeps([6,1,2,3,4,7,8,9,10,11]))),"deep-assessments":(0,O.lazy)(()=>$(()=>import(`./deep-assessments-Ear0CRFf.js`),__vite__mapDeps([12,1,2,3,4,9,8,13,14,15]))),hitl:(0,O.lazy)(()=>$(()=>import(`./hitl-BqElf4Dy.js`),__vite__mapDeps([16,1,2,3,4,17]))),"tool-guard":(0,O.lazy)(()=>$(()=>import(`./tool-guard-QZ-UJFtd.js`),__vite__mapDeps([18,1,2,3,4,19]))),projects:(0,O.lazy)(()=>$(()=>import(`./projects-SuTBYp6J.js`),__vite__mapDeps([20,1,2,3,4,8,13,14,21,10,22,23]))),"asset-overview":(0,O.lazy)(()=>$(()=>import(`./asset-overview-D3G_k7fn.js`),__vite__mapDeps([24,1,2,3,4,25,22,26]))),"asset-library":(0,O.lazy)(()=>$(()=>import(`./asset-library-ChAmA5Ch.js`),__vite__mapDeps([27,1,2,3,4,10,22,25,21,28]))),"info-collect":(0,O.lazy)(()=>$(()=>import(`./info-collect-C0qW9x7x.js`),__vite__mapDeps([29,1,2,3,4,10,25,22,30]))),vulnerabilities:(0,O.lazy)(()=>$(()=>import(`./vulnerabilities-D_rM4qkt.js`),__vite__mapDeps([31,1,2,3,4,7,10,32]))),tasks:(0,O.lazy)(()=>$(()=>import(`./tasks-ChAtqbZl.js`),__vite__mapDeps([33,1,2,3,4,10,34]))),workflows:(0,O.lazy)(()=>$(()=>import(`./workflows-g37AHSUA.js`),__vite__mapDeps([35,1,2,3,4,36]))),webshell:(0,O.lazy)(()=>$(()=>import(`./webshell-BCjmG7pY.js`),__vite__mapDeps([37,1,2,3,4,10,38]))),"c2-listeners":(0,O.lazy)(()=>$(()=>import(`./c2-listeners-mznWKf39.js`),__vite__mapDeps([39,1,2,3,4,40,41,42,10,43]))),"c2-sessions":(0,O.lazy)(()=>$(()=>import(`./c2-sessions-Dzb2ExJE.js`),__vite__mapDeps([44,1,2,3,4,40,41,42,45]))),"c2-tasks":(0,O.lazy)(()=>$(()=>import(`./c2-tasks-bTc_K3I3.js`),__vite__mapDeps([46,1,2,3,4,40,41,42,47]))),"c2-payloads":(0,O.lazy)(()=>$(()=>import(`./c2-payloads-BKak-gMx.js`),__vite__mapDeps([48,1,2,3,4,40,41,42,49]))),"c2-events":(0,O.lazy)(()=>$(()=>import(`./c2-events-BBXPOkip.js`),__vite__mapDeps([50,1,2,3,4,40,41,42,51]))),"c2-profiles":(0,O.lazy)(()=>$(()=>import(`./c2-profiles-D57VOkSl.js`),__vite__mapDeps([52,1,2,3,4,40,41,53]))),"chat-files":(0,O.lazy)(()=>$(()=>import(`./chat-files-C_do2wG4.js`),__vite__mapDeps([54,1,2,3,4,55]))),"plugin-hub":(0,O.lazy)(()=>$(()=>import(`./plugin-hub-DXxb5SNn.js`),__vite__mapDeps([56,1,2,3,4,57]))),"mcp-monitor":(0,O.lazy)(()=>$(()=>import(`./mcp-monitor-CYkF90E6.js`),__vite__mapDeps([58,1,2,3,4,59]))),"mcp-management":(0,O.lazy)(()=>$(()=>import(`./mcp-management-J5-UGLel.js`),__vite__mapDeps([60,1,2,3,4,61]))),"knowledge-retrieval-logs":(0,O.lazy)(()=>$(()=>import(`./knowledge-retrieval-logs-B2smCvdG.js`),__vite__mapDeps([62,1,2,3,4]))),"knowledge-management":(0,O.lazy)(()=>$(()=>import(`./knowledge-management-BxQoJW22.js`),__vite__mapDeps([63,1,2,3,4]))),"skills-monitor":(0,O.lazy)(()=>$(()=>import(`./skills-monitor-rnLJQpb-.js`),__vite__mapDeps([64,1,3,2,4]))),"skills-management":(0,O.lazy)(()=>$(()=>import(`./skills-management-CCkb0p77.js`),__vite__mapDeps([65,1,2,3,4]))),"agents-management":(0,O.lazy)(()=>$(()=>import(`./agents-management-d131UeV3.js`),__vite__mapDeps([66,1,2,3,4]))),"roles-management":(0,O.lazy)(()=>$(()=>import(`./roles-management-5zmgJVPT.js`),__vite__mapDeps([67,1,2,3,4,68]))),"platform-rbac":(0,O.lazy)(()=>$(()=>import(`./platform-rbac-BENNKoJc.js`),__vite__mapDeps([69,1,2,3,4]))),settings:(0,O.lazy)(()=>$(()=>import(`./settings-DPQLaCt9.js`),__vite__mapDeps([70,1,2,3,4,9,71]))),"api-docs":(0,O.lazy)(()=>$(()=>import(`./api-docs-D-52AArB.js`),__vite__mapDeps([72,1,2,3,4,73])))},{Title:Pa,Text:Fa}=c;function Ia(){return(0,M.jsx)(`div`,{className:`cs-page-loading`,children:(0,M.jsx)(se,{size:`large`})})}function La({code:e,title:t,description:n}){return(0,M.jsxs)(`div`,{className:`cs-page-loading`,style:{flexDirection:`column`,gap:8},children:[(0,M.jsx)(Pa,{heading:2,style:{margin:0},children:e}),(0,M.jsx)(Fa,{strong:!0,children:t}),n&&(0,M.jsx)(Fa,{type:`tertiary`,children:n})]})}function Ra(){let{pageId:e}=Ue(),{hasPermission:t,hasAnyPermission:n}=st(),r=P(),i=jt(e),a=e?Na[e]:null,o=(0,O.useMemo)(()=>{if(!i)return!0;if(i.anyPermission)return n(i.anyPermission);if(i.permission)return t(i.permission);let e=i.parent?jt(i.parent):null;return!e?.anyPermission||n(e.anyPermission)},[i,t,n]);return i?a?o?(0,M.jsx)(O.Suspense,{fallback:(0,M.jsx)(Ia,{}),children:(0,M.jsx)(a,{})}):(0,M.jsx)(La,{code:`403`,title:r(`common.forbidden`,null,`当前账号没有访问该页面的权限`)}):(0,M.jsx)(La,{code:`404`,title:i.fallback,description:r(`common.pagePending`,null,`页面尚未注册`)}):(0,M.jsx)(La,{code:`404`,title:r(`common.pageNotFound`,null,`页面不存在`)})}function za(){let{authenticated:e,checking:t}=st();return t?(0,M.jsx)(Ia,{}):e?(0,M.jsx)(Be,{children:(0,M.jsxs)(Ve,{element:(0,M.jsx)(Ca,{}),children:[(0,M.jsx)(Ve,{path:`/`,element:(0,M.jsx)(Ie,{to:`/dashboard`,replace:!0})}),(0,M.jsx)(Ve,{path:`/system-update`,element:(0,M.jsx)(Ie,{to:`/settings?section=update`,replace:!0})}),(0,M.jsx)(Ve,{path:`/:pageId`,element:(0,M.jsx)(Ra,{})}),(0,M.jsx)(Ve,{path:`*`,element:(0,M.jsx)(Ie,{to:`/dashboard`,replace:!0})})]})}):(0,M.jsx)(Da,{})}var Ba={"zh-CN":pe,"en-US":Ee,"ru-RU":xe,"ar-SA":w};function Va(){let{lang:e}=vt();return(0,M.jsx)(n,{locale:Ba[e]||pe,direction:e===`ar-SA`?`rtl`:`ltr`,children:(0,M.jsx)(ot,{children:(0,M.jsx)(ze,{children:(0,M.jsx)(za,{})})})})}(0,We.createRoot)(document.getElementById(`root`)).render((0,M.jsx)(O.StrictMode,{children:(0,M.jsx)(Et,{children:(0,M.jsx)(_t,{children:(0,M.jsx)(Va,{})})})}));export{Ui as A,nt as B,Ni as C,zi as D,Fi as E,st as F,j as I,tt as L,ct as M,vt as N,Bi as O,P,rt as R,Ji as S,Ri as T,A as V,Qi as _,da as a,Yi as b,ua as c,sa as d,aa as f,$i as g,na as h,ma as i,Dt as j,Li as k,ta as l,Zi as m,fa as n,ia as o,Xi as p,pa as r,ea as s,$ as t,oa as u,ra as v,ji as w,qi as x,ca as y,Ze as z};