wherdr 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/30nuHmZs.js +1 -0
- package/.output/public/_nuxt/30nuHmZs.js.br +0 -0
- package/.output/public/_nuxt/30nuHmZs.js.gz +0 -0
- package/.output/public/_nuxt/AgentView.CfD2RWZY.css.br +0 -0
- package/.output/public/_nuxt/AgentView.CfD2RWZY.css.gz +0 -0
- package/.output/public/_nuxt/{DOsw6KCR.js → B8pUlE1v.js} +41 -41
- package/.output/public/_nuxt/B8pUlE1v.js.br +0 -0
- package/.output/public/_nuxt/B8pUlE1v.js.gz +0 -0
- package/.output/public/_nuxt/Bd17z0YL.js.br +0 -0
- package/.output/public/_nuxt/Bd17z0YL.js.gz +0 -0
- package/.output/public/_nuxt/Bo4dpAxE.js +31 -0
- package/.output/public/_nuxt/Bo4dpAxE.js.br +0 -0
- package/.output/public/_nuxt/Bo4dpAxE.js.gz +0 -0
- package/.output/public/_nuxt/Bpoxvzh6.js.br +0 -0
- package/.output/public/_nuxt/Bpoxvzh6.js.gz +0 -0
- package/.output/public/_nuxt/C25ROUa9.js.br +0 -0
- package/.output/public/_nuxt/C25ROUa9.js.gz +0 -0
- package/.output/public/_nuxt/{DYKfeNM-.js → CBJ483HL.js} +1 -1
- package/.output/public/_nuxt/CDWjMk9C.js.br +0 -0
- package/.output/public/_nuxt/CDWjMk9C.js.gz +0 -0
- package/.output/public/_nuxt/CJF9DrFj.js +25 -0
- package/.output/public/_nuxt/CJF9DrFj.js.br +0 -0
- package/.output/public/_nuxt/CJF9DrFj.js.gz +0 -0
- package/.output/public/_nuxt/CXJnLmWv.js.br +0 -0
- package/.output/public/_nuxt/CXJnLmWv.js.gz +0 -0
- package/.output/public/_nuxt/{TS7GZUPU.js → DNAl4698.js} +5 -5
- package/.output/public/_nuxt/DNAl4698.js.br +0 -0
- package/.output/public/_nuxt/DNAl4698.js.gz +0 -0
- package/.output/public/_nuxt/{ScQ9FtVj.js → DOnGrCAZ.js} +1 -1
- package/.output/public/_nuxt/DR832Br-.js +3 -0
- package/.output/public/_nuxt/DR832Br-.js.br +0 -0
- package/.output/public/_nuxt/DR832Br-.js.gz +0 -0
- package/.output/public/_nuxt/DZGKxROq.js.br +0 -0
- package/.output/public/_nuxt/DZGKxROq.js.gz +0 -0
- package/.output/public/_nuxt/DclfLrr5.js +105 -0
- package/.output/public/_nuxt/DclfLrr5.js.br +0 -0
- package/.output/public/_nuxt/DclfLrr5.js.gz +0 -0
- package/.output/public/_nuxt/JL_QI6J1.js +1 -0
- package/.output/public/_nuxt/JL_QI6J1.js.br +0 -0
- package/.output/public/_nuxt/JL_QI6J1.js.gz +0 -0
- package/.output/public/_nuxt/{DeLLm2j1.js → XlRX1U8d.js} +15 -15
- package/.output/public/_nuxt/XlRX1U8d.js.br +0 -0
- package/.output/public/_nuxt/XlRX1U8d.js.gz +0 -0
- package/.output/public/_nuxt/Y-4S7Nuf.js +1 -0
- package/.output/public/_nuxt/Y-4S7Nuf.js.br +0 -0
- package/.output/public/_nuxt/Y-4S7Nuf.js.gz +0 -0
- package/.output/public/_nuxt/{board.DK5EU4sL.css → board.B8JX7Yhy.css} +1 -1
- package/.output/public/_nuxt/board.B8JX7Yhy.css.br +0 -0
- package/.output/public/_nuxt/board.B8JX7Yhy.css.gz +0 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/1d193254-809f-48d8-bf27-3640edb58f54.json +1 -0
- package/.output/public/_nuxt/entry.6CUQ3EoD.css +2 -0
- package/.output/public/_nuxt/entry.6CUQ3EoD.css.br +0 -0
- package/.output/public/_nuxt/entry.6CUQ3EoD.css.gz +0 -0
- package/.output/public/_nuxt/error-404.Bb87HomL.css.br +0 -0
- package/.output/public/_nuxt/error-404.Bb87HomL.css.gz +0 -0
- package/.output/public/_nuxt/error-500.Bwd7zAaE.css.br +0 -0
- package/.output/public/_nuxt/error-500.Bwd7zAaE.css.gz +0 -0
- package/.output/public/_nuxt/lBx2yXX9.js +62 -0
- package/.output/public/_nuxt/lBx2yXX9.js.br +0 -0
- package/.output/public/_nuxt/lBx2yXX9.js.gz +0 -0
- package/.output/public/_nuxt/pdf.min.t82Z80JU.mjs.br +0 -0
- package/.output/public/_nuxt/pdf.min.t82Z80JU.mjs.gz +0 -0
- package/.output/public/_nuxt/pdf.worker.min.wgc6bjNh.mjs.br +0 -0
- package/.output/public/_nuxt/pdf.worker.min.wgc6bjNh.mjs.gz +0 -0
- package/.output/public/_nuxt/settings.Cdb21nNw.css.br +0 -0
- package/.output/public/_nuxt/settings.Cdb21nNw.css.gz +0 -0
- package/.output/public/_nuxt/{BX8KVYfd.js → xSo3mAHb.js} +1 -1
- package/.output/public/_nuxt/xSo3mAHb.js.br +0 -0
- package/.output/public/_nuxt/xSo3mAHb.js.gz +0 -0
- package/.output/public/sw.js +1 -1
- package/.output/server/chunks/_/branding.mjs +1 -1
- package/.output/server/chunks/_/package.mjs +1 -1
- package/.output/server/chunks/_/selfupdate.mjs +1 -1
- package/.output/server/chunks/_/updates.mjs +1 -1
- package/.output/server/chunks/_/worktrees.mjs +1 -1
- package/.output/server/chunks/_/ws.mjs +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +864 -242
- package/.output/server/chunks/raw/prerelease.mjs +1 -1
- package/.output/server/chunks/routes/api/_..._.mjs +1 -0
- package/.output/server/chunks/routes/api/agents.post.mjs +1 -0
- package/.output/server/chunks/routes/api/ask-tab.post.mjs +1 -0
- package/.output/server/chunks/routes/api/attach.post.mjs +1 -0
- package/.output/server/chunks/routes/api/auth/disable.post.mjs +1 -0
- package/.output/server/chunks/routes/api/auth/lock-all.post.mjs +1 -0
- package/.output/server/chunks/routes/api/auth/lock.post.mjs +1 -0
- package/.output/server/chunks/routes/api/auth/login/options.post.mjs +1 -0
- package/.output/server/chunks/routes/api/auth/login/verify.post.mjs +1 -0
- package/.output/server/chunks/routes/api/auth/max-session.post.mjs +1 -0
- package/.output/server/chunks/routes/api/auth/register/options.post.mjs +1 -0
- package/.output/server/chunks/routes/api/auth/register/verify.post.mjs +1 -0
- package/.output/server/chunks/routes/api/auth/status.get.mjs +1 -0
- package/.output/server/chunks/routes/api/changes.get.mjs +1 -0
- package/.output/server/chunks/routes/api/chat/image.get.mjs +1 -0
- package/.output/server/chunks/routes/api/chat.get.mjs +1 -0
- package/.output/server/chunks/routes/api/choose.post.mjs +1 -0
- package/.output/server/chunks/routes/api/claude-setup.post.mjs +1 -0
- package/.output/server/chunks/routes/api/claude-statusline.post.mjs +1 -0
- package/.output/server/chunks/routes/api/clear-queued-input.post.mjs +1 -0
- package/.output/server/chunks/routes/api/close/status.get.mjs +1 -0
- package/.output/server/chunks/routes/api/close.post.mjs +1 -0
- package/.output/server/chunks/routes/api/codex-update.post.mjs +1 -0
- package/.output/server/chunks/routes/api/commands.get.mjs +1 -0
- package/.output/server/chunks/routes/api/config.get.mjs +1 -0
- package/.output/server/chunks/routes/api/dirs.get.mjs +1 -0
- package/.output/server/chunks/routes/api/dismiss-stopped.post.mjs +1 -0
- package/.output/server/chunks/routes/api/dismiss.post.mjs +1 -0
- package/.output/server/chunks/routes/api/effort.post.mjs +1 -0
- package/.output/server/chunks/routes/api/efforts.get.mjs +1 -0
- package/.output/server/chunks/routes/api/file.post.mjs +1 -0
- package/.output/server/chunks/routes/api/files/download.get.mjs +1 -0
- package/.output/server/chunks/routes/api/files/download.head.mjs +1 -0
- package/.output/server/chunks/routes/api/files/read.get.mjs +1 -0
- package/.output/server/chunks/routes/api/files.get.mjs +1 -0
- package/.output/server/chunks/routes/api/health.get.mjs +1 -0
- package/.output/server/chunks/routes/api/input.post.mjs +1 -0
- package/.output/server/chunks/routes/api/interrupt.post.mjs +1 -0
- package/.output/server/chunks/routes/api/isgit.get.mjs +1 -0
- package/.output/server/chunks/routes/api/machine/awake.get.mjs +1 -0
- package/.output/server/chunks/routes/api/machine/awake.post.mjs +1 -0
- package/.output/server/chunks/routes/api/machine/order.get.mjs +1 -0
- package/.output/server/chunks/routes/api/machine/order.post.mjs +1 -0
- package/.output/server/chunks/routes/api/machine/reconnect.post.mjs +1 -0
- package/.output/server/chunks/routes/api/machine/rename.post.mjs +1 -0
- package/.output/server/chunks/routes/api/machine/status.post.mjs +1 -0
- package/.output/server/chunks/routes/api/menu-left.post.mjs +1 -0
- package/.output/server/chunks/routes/api/menu.post.mjs +1 -0
- package/.output/server/chunks/routes/api/model.post.mjs +1 -0
- package/.output/server/chunks/routes/api/models.get.mjs +1 -0
- package/.output/server/chunks/routes/api/nav.post.mjs +1 -0
- package/.output/server/chunks/routes/api/onboarding.get.mjs +1 -0
- package/.output/server/chunks/routes/api/onboarding.post.mjs +1 -0
- package/.output/server/chunks/routes/api/phone.get.mjs +1 -0
- package/.output/server/chunks/routes/api/phone.post.mjs +1 -0
- package/.output/server/chunks/routes/api/plugins/actions.get.mjs +1 -0
- package/.output/server/chunks/routes/api/plugins/invoke.post.mjs +1 -0
- package/.output/server/chunks/routes/api/plugins/projects.get.mjs +1 -0
- package/.output/server/chunks/routes/api/plugins/projects.post.mjs +1 -0
- package/.output/server/chunks/routes/api/prompt.post.mjs +1 -0
- package/.output/server/chunks/routes/api/push/quiet.post.mjs +1 -0
- package/.output/server/chunks/routes/api/push/subscribe.post.mjs +1 -0
- package/.output/server/chunks/routes/api/push/test.post.mjs +1 -0
- package/.output/server/chunks/routes/api/push/unsubscribe.post.mjs +1 -0
- package/.output/server/chunks/routes/api/quotas.get.mjs +1 -0
- package/.output/server/chunks/routes/api/rename.post.mjs +1 -0
- package/.output/server/chunks/routes/api/requeue.post.mjs +1 -0
- package/.output/server/chunks/routes/api/restart.get.mjs +1 -0
- package/.output/server/chunks/routes/api/restart.post.mjs +1 -0
- package/.output/server/chunks/routes/api/reveal.post.mjs +1 -0
- package/.output/server/chunks/routes/api/screen-key.post.mjs +1 -0
- package/.output/server/chunks/routes/api/screen.get.mjs +1 -0
- package/.output/server/chunks/routes/api/search.get.mjs +1 -0
- package/.output/server/chunks/routes/api/seen.post.mjs +1 -0
- package/.output/server/chunks/routes/api/sessions.get.mjs +1 -0
- package/.output/server/chunks/routes/api/sessions.post.mjs +1 -0
- package/.output/server/chunks/routes/api/settings-tab.post.mjs +1 -0
- package/.output/server/chunks/routes/api/settings.get.mjs +1 -0
- package/.output/server/chunks/routes/api/settings.post.mjs +1 -0
- package/.output/server/chunks/routes/api/space.post.mjs +1 -0
- package/.output/server/chunks/routes/api/state.get.mjs +1 -0
- package/.output/server/chunks/routes/api/tasks/action.post.mjs +1 -0
- package/.output/server/chunks/routes/api/tasks/add.post.mjs +1 -0
- package/.output/server/chunks/routes/api/tasks/after.post.mjs +1 -0
- package/.output/server/chunks/routes/api/tasks/approve.post.mjs +1 -0
- package/.output/server/chunks/routes/api/tasks/archive-done.post.mjs +40 -0
- package/.output/server/chunks/routes/api/tasks/archived.get.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/autopilot.get.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/autopilot.post.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/board-settings.get.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/board-settings.post.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/coordinator.get.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/coordinator.post.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/describe.post.mjs +40 -0
- package/.output/server/chunks/routes/api/tasks/details.get.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/limit.post.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/links.get.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/models.get.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/pick.post.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/project.get.mjs +41 -0
- package/.output/server/chunks/routes/api/tasks/project.post.mjs +40 -0
- package/.output/server/chunks/routes/api/tasks/question.post.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/scheduled.get.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/settings.get.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/start.get.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks/tell.post.mjs +2 -1
- package/.output/server/chunks/routes/api/tasks.get.mjs +1 -0
- package/.output/server/chunks/routes/api/unqueue.post.mjs +2 -1
- package/.output/server/chunks/routes/api/update/status.get.mjs +1 -0
- package/.output/server/chunks/routes/api/update.get.mjs +1 -0
- package/.output/server/chunks/routes/api/update.post.mjs +1 -0
- package/.output/server/chunks/routes/api/upload.post.mjs +1 -0
- package/.output/server/chunks/routes/api/worktrees/remove.post.mjs +1 -0
- package/.output/server/chunks/routes/api/worktrees.get.mjs +1 -0
- package/.output/server/chunks/routes/favicon.ico.get.mjs +1 -0
- package/.output/server/chunks/routes/icons/_name_.get.mjs +2 -1
- package/.output/server/chunks/routes/renderer.mjs +3 -2
- package/.output/server/chunks/routes/uploads/_...name_.get.mjs +2 -1
- package/.output/server/chunks/routes/ws/_..._.mjs +2 -1
- package/.output/server/chunks/routes/ws/events.mjs +2 -1
- package/.output/server/chunks/routes/ws/term.mjs +2 -1
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/index.mjs +2 -1
- package/.output/server/package.json +1 -1
- package/docs/README.md +2 -0
- package/docs/RELEASING.md +58 -46
- package/docs/board.md +7 -0
- package/docs/development.md +1 -1
- package/docs/release-notes-2.1.0.md +21 -0
- package/package.json +1 -1
- package/.output/public/_nuxt/072bjdot.js +0 -2
- package/.output/public/_nuxt/8FAMamJX.js +0 -1
- package/.output/public/_nuxt/C2aT0CgA.js +0 -62
- package/.output/public/_nuxt/CanLPS0U.js +0 -105
- package/.output/public/_nuxt/DGXKTg7D.js +0 -31
- package/.output/public/_nuxt/DTiR5P9E.js +0 -25
- package/.output/public/_nuxt/DZ7VvF3e.js +0 -1
- package/.output/public/_nuxt/DumNBIyF.js +0 -1
- package/.output/public/_nuxt/builds/meta/b6ed1ddd-d6d6-4137-beab-2548b20dd998.json +0 -1
- package/.output/public/_nuxt/entry.BhiYrGAW.css +0 -2
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import{A as e,Et as t,Ft as n,Hn as r,M as i,Mn as a,Ot as o,P as s,St as c,U as l,V as u,fr as d,ht as f,nn as p,sn as ee,vt as te}from"./C25ROUa9.js";import{B as m,N as h,U as ne,V as g,Y as _,pn as v,q as re,z as ie}from"./DeLLm2j1.js";import{An as ae,C as y,Cn as b,Dn as oe,Jt as se,On as ce,Sn as le,Tn as ue,Tt as de,ei as fe,i as pe,kn as me,qt as he,t as ge,ti as x,xn as _e,xt as S}from"./CanLPS0U.js";var ve=[`needs`,`ready`,`working`,`todo`,`done`],ye={tell:!1,approve:!1,delegate:!1,stop:!1,retry:!1,finish:!1,archive:!1,restore:!1},be=/^[A-Za-z0-9][\w.-]{0,79}\/\d{1,7}$/;function xe(e){return typeof e==`string`&&be.test(e)}var Se=(e,t)=>{let n=e.split(`/`)[1]||``;return t?`${t}-${n}`:`#${n}`};function Ce(e){let t=/\/pull\/(\d{1,7})(?:[/?#]|$)/.exec(e);return t?`#${t[1]}`:``}var we=[`critical`,`major`,`minor`,`trivial`],Te=[`starting`,`setup`,`working`,`checking`,`pushing`,`reviewing`,`merging`,`queued`,`attempts`],Ee=[`start`,`setup`,`attempts`];function C(e,t){if(e.archived)return{...ye,restore:!0};let n=e.group!==`todo`&&e.group!==`done`,r=e.stage===`stopped`&&e.state===`blocked`,i=e.stage===`failed`,a=i&&!!t&&!t.failureAuth&&(t.failureStage===`send`||!!t.failureStage&&!Ee.includes(t.failureStage));return{tell:n&&!!e.app&&!(i&&t&&Ee.includes(t.failureStage)),approve:!e.chat&&(e.stage===`approval`||e.stage===`plan`&&e.state===`blocked`),delegate:e.group===`todo`||i&&!!t&&Ee.includes(t.failureStage),stop:e.group===`working`||e.group===`needs`&&e.state===`blocked`&&!!e.app&&!r&&e.kind!==`auth`||e.stage===`working`&&e.state===`error`,retry:r||e.stage===`nosummary`||a,finish:w(e)!==null,archive:e.group!==`working`&&!Te.includes(e.stage),restore:!1}}function De(e){return!e.archived&&!!e.app&&e.stage===`working`&&e.state===`working`&&e.msg===`Finishing`}function w(e){return e.archived?null:e.chat?e.stage===`asks`&&e.state===`blocked`?`conversation`:null:e.stage===`stopped`&&e.state===`blocked`?`limit`:e.stage===`nosummary`?`nosummary`:De(e)?`stuck`:null}function Oe(e){return[...e].sort((e,t)=>ve.indexOf(e.group)-ve.indexOf(t.group)||(e.group===`done`?T(e,t):e.repo.localeCompare(t.repo)||t.n-e.n))}var T=(e,t)=>(t.created??0)-(e.created??0),ke=7e3,Ae=8e3,E=/^[A-Za-z0-9][\w.-]{0,79}$/;function je(e){if(e==null||e===``)return``;if(typeof e!=`string`)return null;let t=e.trim();return t?E.test(t)||/^(\/|~\/)/.test(t)&&t.length<=500&&!/[\u0000-\u001f]/.test(t)?t:null:``}function Me(e,t){return!e||!t?[]:e.only.find(e=>e.models.includes(t))?.levels??e.efforts}var Ne=/^(?:[A-Za-z0-9][\w.-]{0,39}:)?(?:[A-Za-z0-9][\w.-]{0,79}\/\d{1,7}|[A-Za-z][A-Za-z0-9]{1,4}-\d{1,7})$/;function Pe(e){if(!Array.isArray(e)||!e.length||e.length>20)return null;let t=[];for(let n of e){if(typeof n!=`string`||!Ne.test(n.trim()))return null;t.includes(n.trim())||t.push(n.trim())}return t}function D(e){return((e.split(`@`).pop()||``).split(`.`)[0]||``).replace(/[^A-Za-z0-9_.-]/g,`-`)}function O(e,t,n){let r=t?Se(e,t):e;return n?`${D(n)}:${r}`:r}function k(e){return e&&e.max>0&&e.busy>=e.max?e.waiting+1:null}function Fe(e){return e.pane?`live`:e.error?`failed`:e.state===`starting`?`starting`:`idle`}function Ie(e,t,n=``){return e.kind===`project`?e.repo:e.kind===`main`?``:/^(.+) coordinator$/i.exec(n.trim())?.[1]?.trim()||t}function Le(e){let t={needs:0,ready:0,working:0,todo:0,done:0};for(let n of e)t[n.group]++;return t}var Re=`herdr notification show --body="$HERDR_PROJECTS_TITLE" --sound request -- "$HERDR_PROJECTS_ID · $HERDR_PROJECTS_EVENT"`,ze=e=>`${e} set board.notify '${Re}'`;function Be(e,t){return!e.archived&&!!e.app&&!!t?.failureCanFix&&!t?.failureAuth&&!t?.failureStale&&!(t?.failureSent&&e.stage===`working`)&&e.stage!==`merging`}function Ve(e,t){return!e.archived&&!e.chat&&!e.research&&e.stage===`approval`&&(e.review?.pass===!1||t?.failureRemoteKind===`checks`)}function He(e,t){return!e.archived&&!e.chat&&!e.research&&e.stage===`approval`&&(t?.review??e.review)?.pass===!1}var Ue=e=>{let t=we.indexOf(e);return t<0?1:t};function We(e,t=3){let n=(e||[]).filter(e=>!e.preexisting&&e.title).map((e,t)=>({f:e,i:t})).sort((e,t)=>Ue(e.f.severity)-Ue(t.f.severity)||e.i-t.i).map(e=>e.f);return{list:n.slice(0,t),more:Math.max(0,n.length-t)}}function Ge(e,t){return!!(e&&!e.archived&&e.stage===`pick`&&typeof t==`string`&&/^[A-E]$/.test(t)&&e.attempts?.some(e=>e.letter===t&&e.standing===`passed`))}var Ke=l({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(a){let s=a,l=h(),d=_(),te=e(()=>s.tabStopId||d),v=e(()=>l.currentTabStopId.value===te.value),{getItems:ae,CollectionItem:y}=ne();c(()=>{s.focusable&&l.onFocusableItemAdd()}),t(()=>{s.focusable&&l.onFocusableItemRemove()}),p(()=>s.focusable,(e,t)=>{e!==t&&(e?l.onFocusableItemAdd():l.onFocusableItemRemove())});function b(e){if(e.key===`Tab`&&e.shiftKey){l.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=m(e,l.orientation.value,l.dir.value);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!s.allowShiftKey&&e.shiftKey)return;e.preventDefault();let n=[...ae().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=l.loop.value?g(n,r+1):n.slice(r+1)}f(()=>ie(n))}}return(e,t)=>(o(),i(r(y),null,{default:ee(()=>[u(r(re),{tabindex:v.value?0:-1,"data-orientation":r(l).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?r(l).onItemFocus(te.value):t.preventDefault()},onFocus:t[1]||=e=>r(l).onItemFocus(te.value),onKeydown:b},{default:ee(()=>[n(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),qe=[`innerHTML`],Je=Object.assign(l({__name:`ChatMarkdown`,props:{html:{},typing:{},speed:{default:void 0},cipher:{type:Boolean,default:void 0}},emits:[`done`],setup(e,{emit:t}){let n=e,r=t,i=a(null),l=null,u=0,f=e=>e.classList?.contains(`code-head`),ee=e=>/^T[DH]$/.test(e.tagName||``),m=[],h=``,ne=0;function g(){for(let e of m)e.box.remove();m=[],h=``}function _(e,t,n,r){let i=`${t}:${n}`;if(i!==h){g(),h=i;for(let r of le(e,t,n)){let e=r.node;if(!e.parentNode)continue;let t=document.createElement(`span`);t.className=`tw-trail`,t.setAttribute(`aria-hidden`,`true`);let n=[],i=ce(r.text);Array.from(r.text).forEach((e,r)=>{if(/\s/.test(e))return t.append(e);let a=document.createElement(`span`);a.textContent=e,a.setAttribute(`data-g`,i[r]),n.push(a),t.append(a)}),e.parentNode.insertBefore(t,e.nextSibling),m.push({box:t,cells:n})}m.at(-1)?.cells.at(-1)?.classList.add(`tw-front`),ne=r}else if(r-ne>=60){ne=r;for(let e of m){let t=ce(e.cells.map(e=>e.textContent||``).join(``));e.cells.forEach((e,n)=>e.setAttribute(`data-g`,t[n]))}}}function v(){cancelAnimationFrame(u),u=0,g(),l&&b(l),l=null}function re(e){if(v(),!i.value)return;l=ue(i.value,{atomic:f,keep:ee});let t=l,a=n.speed??de.value,o=me(t.total,a),s=n.cipher??y.value,c=()=>{if(l!==t)return;let n=Date.now()-e,i=s?ae(t.total,n,a):null,d=i?.written??oe(t.stops,n,o),f=i?.decrypted??d;_e(t,f,s,d),s&&_(t,f,d,performance.now()),i?.done||!s&&n>=o?(v(),r(`done`)):u=requestAnimationFrame(c)};c()}function ie(){l&&(v(),r(`done`))}return c(()=>{n.typing!==null&&re(n.typing)}),p(()=>n.typing,e=>{e===null?v():re(e)}),p(()=>n.html,()=>{l&&(cancelAnimationFrame(u),g(),l=null,r(`done`))},{flush:`pre`}),te(()=>{cancelAnimationFrame(u),g(),l=null}),(t,n)=>(o(),s(`div`,{ref_key:`el`,ref:i,class:d([`md-body`,{typing:e.typing!==null}]),onClickCapture:ie,innerHTML:e.html},null,42,qe))}}),{__name:`ChatMarkdown`});function Ye(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var A=Ye();function Xe(e){A=e}var Ze={exec:()=>null};function j(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(M.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var M={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:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,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`)},Qe=/^(?:[ \t]*(?:\n|$))+/,N=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,$e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,P=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,et=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,tt=/(?:[*+-]|\d{1,9}[.)])/,nt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,rt=j(nt).replace(/bull/g,tt).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(),it=j(nt).replace(/bull/g,tt).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(),at=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ot=/^[^\n]+/,st=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ct=j(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,st).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),F=j(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,tt).getRegex(),I=`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`,lt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ut=j(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,lt).replace(`tag`,I).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dt=j(at).replace(`hr`,P).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`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,I).getRegex(),ft={blockquote:j(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,dt).getRegex(),code:N,def:ct,fences:$e,heading:et,hr:P,html:ut,lheading:rt,list:F,newline:Qe,paragraph:dt,table:Ze,text:ot},pt=j(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,P).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`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,I).getRegex(),mt={...ft,lheading:it,table:pt,paragraph:j(at).replace(`hr`,P).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,pt).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,I).getRegex()},ht={...ft,html:j(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,lt).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ze,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:j(at).replace(`hr`,P).replace(`heading`,` *#{1,6} *[^
|
|
2
|
-
]`).replace(`lheading`,rt).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},gt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_t=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,L=/^( {2,}|\\)\n(?!\s*$)/,vt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,yt=/[\p{P}\p{S}]/u,R=/[\s\p{P}\p{S}]/u,bt=/[^\s\p{P}\p{S}]/u,xt=j(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,R).getRegex(),St=/(?!~)[\p{P}\p{S}]/u,Ct=/(?!~)[\s\p{P}\p{S}]/u,wt=/(?:[^\s\p{P}\p{S}]|~)/u,Tt=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Et=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Dt=j(Et,`u`).replace(/punct/g,yt).getRegex(),Ot=j(Et,`u`).replace(/punct/g,St).getRegex(),kt=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,At=j(kt,`gu`).replace(/notPunctSpace/g,bt).replace(/punctSpace/g,R).replace(/punct/g,yt).getRegex(),z=j(kt,`gu`).replace(/notPunctSpace/g,wt).replace(/punctSpace/g,Ct).replace(/punct/g,St).getRegex(),jt=j(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,bt).replace(/punctSpace/g,R).replace(/punct/g,yt).getRegex(),Mt=j(/\\(punct)/,`gu`).replace(/punct/g,yt).getRegex(),Nt=j(/^<(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(),Pt=j(lt).replace(`(?:-->|$)`,`-->`).getRegex(),Ft=j(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Pt).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),It=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Lt=j(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,It).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Rt=j(/^!?\[(label)\]\[(ref)\]/).replace(`label`,It).replace(`ref`,st).getRegex(),zt=j(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,st).getRegex(),Bt={_backpedal:Ze,anyPunctuation:Mt,autolink:Nt,blockSkip:Tt,br:L,code:_t,del:Ze,emStrongLDelim:Dt,emStrongRDelimAst:At,emStrongRDelimUnd:jt,escape:gt,link:Lt,nolink:zt,punctuation:xt,reflink:Rt,reflinkSearch:j(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Rt).replace(`nolink`,zt).getRegex(),tag:Ft,text:vt,url:Ze},Vt={...Bt,link:j(/^!?\[(label)\]\((.*?)\)/).replace(`label`,It).getRegex(),reflink:j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,It).getRegex()},Ht={...Bt,emStrongRDelimAst:z,emStrongLDelim:Ot,url:j(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,`i`).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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ut={...Ht,br:j(L).replace(`{2,}`,`*`).getRegex(),text:j(Ht.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Wt={normal:ft,gfm:mt,pedantic:ht},Gt={normal:Bt,gfm:Ht,breaks:Ut,pedantic:Vt},Kt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},qt=e=>Kt[e];function B(e,t){if(t){if(M.escapeTest.test(e))return e.replace(M.escapeReplace,qt)}else if(M.escapeTestNoEncode.test(e))return e.replace(M.escapeReplaceNoEncode,qt);return e}function Jt(e){try{e=encodeURI(e).replace(M.percentDecode,`%`)}catch{return null}return e}function Yt(e,t){let n=e.replace(M.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(M.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(M.slashPipe,`|`);return n}function Xt(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Zt(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Qt(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 $t(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
3
|
-
`).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(`
|
|
4
|
-
`)}var en=class{options;rules;lexer;constructor(e){this.options=e||A}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:Xt(e,`
|
|
5
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=$t(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=Xt(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:Xt(t[0],`
|
|
6
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Xt(t[0],`
|
|
7
|
-
`).split(`
|
|
8
|
-
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
9
|
-
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
11
|
-
${s}`:s,r=r?`${r}
|
|
12
|
-
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
13
|
-
`+e.join(`
|
|
14
|
-
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
15
|
-
`+e.join(`
|
|
16
|
-
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
17
|
-
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
18
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(`
|
|
19
|
-
`,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+`
|
|
20
|
-
`,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(`
|
|
21
|
-
`,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+=`
|
|
22
|
-
`+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+=`
|
|
23
|
-
`+l}!u&&!l.trim()&&(u=!0),r+=f+`
|
|
24
|
-
`,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;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.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<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Yt(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
25
|
-
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Yt(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)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)===`
|
|
26
|
-
`?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=Xt(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Zt(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)),Qt(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 Qt(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{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||A,this.options.tokenizer=this.options.tokenizer||new en,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:M,block:Wt.normal,inline:Gt.normal};this.options.pedantic?(t.block=Wt.pedantic,t.inline=Gt.pedantic):this.options.gfm&&(t.block=Wt.gfm,t.inline=this.options.breaks?Gt.breaks:Gt.gfm),this.tokenizer.rules=t}static get rules(){return{block:Wt,inline:Gt}}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(M.carriageReturn,`
|
|
27
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(M.tabCharGlobal,` `).replace(M.spaceLine,``));e;){let r;if(this.options.extensions?.block?.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.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
28
|
-
`: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+=`
|
|
29
|
-
`+r.raw,n.text+=`
|
|
30
|
-
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(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+=`
|
|
31
|
-
`+r.raw,n.text+=`
|
|
32
|
-
`+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});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(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+=`
|
|
33
|
-
`+r.raw,a.text+=`
|
|
34
|
-
`+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);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=`
|
|
35
|
-
`+r.raw,n.text+=`
|
|
36
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}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);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a=``;for(;e;){i||(a=``),i=!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)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(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,a)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=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&&(o=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(a=r.raw.slice(-1)),i=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},tn=class{options;parser;constructor(e){this.options=e||A}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(M.notSpaceStart)?.[0],i=e.replace(M.endingNewline,``)+`
|
|
37
|
-
`;return r?`<pre><code class="language-`+B(r)+`">`+(n?i:B(i,!0))+`</code></pre>
|
|
38
|
-
`:`<pre><code>`+(n?i:B(i,!0))+`</code></pre>
|
|
39
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
40
|
-
${this.parser.parse(e)}</blockquote>
|
|
41
|
-
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
42
|
-
`}hr(e){return`<hr>
|
|
43
|
-
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
44
|
-
`+r+`</`+i+`>
|
|
45
|
-
`}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),`<li>${t}</li>
|
|
46
|
-
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
47
|
-
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
48
|
-
<thead>
|
|
49
|
-
`+t+`</thead>
|
|
50
|
-
`+r+`</table>
|
|
51
|
-
`}tablerow({text:e}){return`<tr>
|
|
52
|
-
${e}</tr>
|
|
53
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
54
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${B(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Jt(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+B(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Jt(e);if(i===null)return B(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${B(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:B(e.text)}},nn=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{options;renderer;textRenderer;constructor(e){this.options=e||A,this.options.renderer=this.options.renderer||new tn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new nn}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<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
|
|
55
|
-
`+this.renderer.text(i);n+=t?this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o,escaped:!0}]}):o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},rn=class{options;block;constructor(e){this.options=e||A}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?V.lex:V.lexInline}provideParser(){return this.block?H.parse:H.parseInline}},an=new class{defaults=Ye();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=H;Renderer=tn;TextRenderer=nn;Lexer=V;Tokenizer=en;Hooks=rn;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new tn(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 en(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 rn;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]=rn.passThroughHooks.has(n)?e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:(...e)=>{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(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`));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?V.lex:V.lexInline,s=i.hooks?i.hooks.provideParser():e?H.parse:H.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(e=>o(e,i)).then(e=>i.hooks?i.hooks.processAllTokens(e):e).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>s(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
56
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+B(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function U(e,t){return an.parse(e,t)}U.options=U.setOptions=function(e){return an.setOptions(e),U.defaults=an.defaults,Xe(U.defaults),U},U.getDefaults=Ye,U.defaults=A,U.use=function(...e){return an.use(...e),U.defaults=an.defaults,Xe(U.defaults),U},U.walkTokens=function(e,t){return an.walkTokens(e,t)},U.parseInline=an.parseInline,U.Parser=H,U.parser=H.parse,U.Renderer=tn,U.TextRenderer=nn,U.Lexer=V,U.lexer=V.lex,U.Tokenizer=en,U.Hooks=rn,U.parse=U,U.options,U.setOptions,U.use,U.walkTokens,U.parseInline,H.parse,V.lex;function on(e,t){this.v=e,this.k=t}function sn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cn(e){if(Array.isArray(e))return e}function ln(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function un(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
57
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dn(e,t){return cn(e)||ln(e,t)||fn(e,t)||un()}function fn(e,t){if(e){if(typeof e==`string`)return sn(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sn(e,t):void 0}}function pn(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof on;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}pn.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},pn.prototype.next=function(e){return this._invoke(`next`,e)},pn.prototype.throw=function(e){return this._invoke(`throw`,e)},pn.prototype.return=function(e){return this._invoke(`return`,e)};var mn=Object.entries,hn=Object.setPrototypeOf,gn=Object.isFrozen,_n=Object.getPrototypeOf,vn=Object.getOwnPropertyDescriptor,W=Object.freeze,G=Object.seal,yn=Object.create,bn=typeof Reflect<`u`&&Reflect,xn=bn.apply,Sn=bn.construct;W||=function(e){return e},G||=function(e){return e},xn||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Sn||=function(e){return new e(...[...arguments].slice(1))};var Cn=J(Array.prototype.forEach);Array.prototype.indexOf;var wn=J(Array.prototype.lastIndexOf),Tn=J(Array.prototype.pop),En=J(Array.prototype.push);Array.prototype.slice;var Dn=J(Array.prototype.splice),On=Array.isArray,kn=J(String.prototype.toLowerCase),An=J(String.prototype.toString),jn=J(String.prototype.match),Mn=J(String.prototype.replace),Nn=J(String.prototype.indexOf),Pn=J(String.prototype.trim),Fn=J(Number.prototype.toString),In=J(Boolean.prototype.toString),Ln=typeof BigInt>`u`?null:J(BigInt.prototype.toString),Rn=typeof Symbol>`u`?null:J(Symbol.prototype.toString),K=J(Object.prototype.hasOwnProperty),zn=J(Object.prototype.toString),q=J(RegExp.prototype.test),Bn=Vn(TypeError);function J(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return xn(e,t,n)}}function Vn(e){return function(){return Sn(e,[...arguments])}}function Y(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:kn;if(hn&&hn(e,null),!On(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(gn(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Hn(e){for(let t=0;t<e.length;t++)K(e,t)||(e[t]=null);return e}function X(e){let t=yn(null);for(let r of mn(e)){var n=dn(r,2);let i=n[0],a=n[1];K(e,i)&&(t[i]=On(a)?Hn(a):a&&typeof a==`object`&&a.constructor===Object?X(a):a)}return t}function Un(e){switch(typeof e){case`string`:return e;case`number`:return Fn(e);case`boolean`:return In(e);case`bigint`:return Ln?Ln(e):`0`;case`symbol`:return Rn?Rn(e):`Symbol()`;case`undefined`:return zn(e);case`function`:case`object`:{if(e===null)return zn(e);let t=e,n=Z(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:zn(e)}return zn(e)}default:return zn(e)}}function Z(e,t){for(;e!==null;){let n=vn(e,t);if(n){if(n.get)return J(n.get);if(typeof n.value==`function`)return J(n.value)}e=_n(e)}function n(){return null}return n}function Wn(e){try{return q(e,``),!0}catch{return!1}}var Gn=W(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Kn=W(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),qn=W([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Jn=W([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Yn=W(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Xn=W([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Zn=W([`#text`]),Qn=W(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),$n=W(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),er=W(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),tr=W([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),nr=G(/{{[\w\W]*|^[\w\W]*}}/g),rr=G(/<%[\w\W]*|^[\w\W]*%>/g),ir=G(/\${[\w\W]*/g),ar=G(/^data-[\-\w.\u00B7-\uFFFF]+$/),or=G(/^aria-[\-\w]+$/),sr=G(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cr=G(/^(?:\w+script|data):/i),lr=G(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ur=G(/^html$/i),dr=G(/^[a-z][.\w]*(-[.\w]+)+$/i),fr=G(/<[/\w!]/g),pr=G(/<[/\w]/g),mr=G(/<\/no(script|embed|frames)/i),hr=G(/\/>/i),Q={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},gr=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],_r=W(Y({},gr)),vr=function(){let e={};return Cn(gr,t=>{e[t]=G(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),W(e)}(),yr=function(){return typeof window>`u`?null:window},br=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}},xr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Sr=function(e,t,n,r){return K(e,t)&&On(e[t])?Y(r.base?X(r.base):{},e[t],r.transform):n},Cr=function(e,t,n){let r=K(e,t)?e[t]:void 0;return r&&typeof r==`object`?X(r):n()};function wr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yr(),t=e=>wr(e);if(t.version=`3.4.16`,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;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Z(d,`cloneNode`),p=Z(d,`remove`),ee=Z(d,`removeAttributeNode`),te=Z(d,`nextSibling`),m=Z(d,`childNodes`),h=Z(d,`parentNode`),ne=Z(d,`shadowRoot`),g=Z(d,`attributes`),_=o&&o.prototype?Z(o.prototype,`nodeType`):null,v=o&&o.prototype?Z(o.prototype,`nodeName`):null,re=o&&o.prototype?Z(o.prototype,`ownerDocument`):null,ie=function(e){return _?_(e):e.nodeType},ae=function(e){return v?v(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let y,b=``,oe,se=!1,ce=0,le=function(){if(ce>0)throw Bn(`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 y.createHTML(e)}finally{ce--}},de=function(e){le(),ce++;try{return y.createScriptURL(e)}finally{ce--}},fe=function(){return se||=(oe=br(u,i),!0),oe},pe=n,me=pe.implementation,he=pe.createNodeIterator,ge=pe.createDocumentFragment,x=pe.getElementsByTagName,_e=r.importNode,S=xr();t.isSupported=typeof mn==`function`&&typeof h==`function`&&me&&me.createHTMLDocument!==void 0;let ve=nr,ye=rr,be=ir,xe=ar,Se=or,Ce=cr,we=lr,Te=dr,Ee=sr,C=null,De=Y({},[...Gn,...Kn,...qn,...Yn,...Zn]),w=null,Oe=Y({},[...Qn,...$n,...er,...tr]),T=Object.seal(yn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ke=null,Ae=null,E=Object.seal(yn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),je=!0,Me=!0,Ne=!1,Pe=!0,D=!1,O=!0,k=!1,Fe=!1,Ie=null,Le=null,Re=!1,ze=!1,Be=!1,Ve=!1,He=!0,Ue=!1,We=`user-content-`,Ge=!0,Ke=!1,qe={},Je=null,Ye=Y({},`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(`.`)),A=null,Xe=Y({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ze=null,j=Y({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),M=`http://www.w3.org/1998/Math/MathML`,Qe=`http://www.w3.org/2000/svg`,N=`http://www.w3.org/1999/xhtml`,$e=N,P=!1,et=null,tt=Y({},[M,Qe,N],An),nt=W([`mi`,`mo`,`mn`,`ms`,`mtext`]),rt=Y({},nt),it=W([`annotation-xml`]),at=Y({},it),ot=Y({},[`title`,`style`,`font`,`a`,`script`]),st=null,ct=[`application/xhtml+xml`,`text/html`],F=null,I=null,lt=n.createElement(`form`),ut=function(e){return e instanceof RegExp||e instanceof Function},dt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(I&&I===e)return;(!e||typeof e!=`object`)&&(e={}),e=X(e),st=ct.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,F=st===`application/xhtml+xml`?An:kn,C=Sr(e,`ALLOWED_TAGS`,De,{transform:F}),w=Sr(e,`ALLOWED_ATTR`,Oe,{transform:F}),et=Sr(e,`ALLOWED_NAMESPACES`,tt,{transform:An}),Ze=Sr(e,`ADD_URI_SAFE_ATTR`,j,{transform:F,base:j}),A=Sr(e,`ADD_DATA_URI_TAGS`,Xe,{transform:F,base:Xe}),Je=Sr(e,`FORBID_CONTENTS`,Ye,{transform:F}),ke=Sr(e,`FORBID_TAGS`,X({}),{transform:F}),Ae=Sr(e,`FORBID_ATTR`,X({}),{transform:F}),qe=K(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?X(e.USE_PROFILES):e.USE_PROFILES:!1,je=e.ALLOW_ARIA_ATTR!==!1,Me=e.ALLOW_DATA_ATTR!==!1,Ne=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,D=e.SAFE_FOR_TEMPLATES||!1,O=e.SAFE_FOR_XML!==!1,k=e.WHOLE_DOCUMENT||!1,ze=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,Ve=e.RETURN_TRUSTED_TYPE||!1,Re=e.FORCE_BODY||!1,He=e.SANITIZE_DOM!==!1,Ue=e.SANITIZE_NAMED_PROPS||!1,Ge=e.KEEP_CONTENT!==!1,Ke=e.IN_PLACE||!1,Ee=Wn(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:sr,$e=typeof e.NAMESPACE==`string`?e.NAMESPACE:N,rt=Cr(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>Y({},nt)),at=Cr(e,`HTML_INTEGRATION_POINTS`,()=>Y({},it));let t=Cr(e,`CUSTOM_ELEMENT_HANDLING`,()=>yn(null));if(T=yn(null),K(t,`tagNameCheck`)&&ut(t.tagNameCheck)&&(T.tagNameCheck=t.tagNameCheck),K(t,`attributeNameCheck`)&&ut(t.attributeNameCheck)&&(T.attributeNameCheck=t.attributeNameCheck),K(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(T.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),G(T),D&&(Me=!1),Be&&(ze=!0),qe&&(C=Y({},Zn),w=yn(null),qe.html===!0&&(Y(C,Gn),Y(w,Qn)),qe.svg===!0&&(Y(C,Kn),Y(w,$n),Y(w,tr)),qe.svgFilters===!0&&(Y(C,qn),Y(w,$n),Y(w,tr)),qe.mathMl===!0&&(Y(C,Yn),Y(w,er),Y(w,tr))),E.tagCheck=null,E.attributeCheck=null,K(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?E.tagCheck=e.ADD_TAGS:On(e.ADD_TAGS)&&(C===De&&(C=X(C)),Y(C,e.ADD_TAGS,F))),K(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?E.attributeCheck=e.ADD_ATTR:On(e.ADD_ATTR)&&(w===Oe&&(w=X(w)),Y(w,e.ADD_ATTR,F))),K(e,`ADD_FORBID_CONTENTS`)&&On(e.ADD_FORBID_CONTENTS)&&(Je===Ye&&(Je=X(Je)),Y(Je,e.ADD_FORBID_CONTENTS,F)),Ge&&(C[`#text`]=!0),k&&Y(C,[`html`,`head`,`body`]),C.table&&(Y(C,[`tbody`]),delete ke.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Bn(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Bn(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=y;y=e.TRUSTED_TYPES_POLICY;try{b=ue(``)}catch(e){throw y=t,e}}else e.TRUSTED_TYPES_POLICY===null?(y=void 0,b=``):(y===void 0&&(y=fe()),y&&typeof b==`string`&&(b=ue(``)));W&&W(e),I=e},ft=Y({},[...Kn,...qn,...Jn]),pt=Y({},[...Yn,...Xn]),mt=function(e,t,n){return t.namespaceURI===N?e===`svg`:t.namespaceURI===M?e===`svg`&&(n===`annotation-xml`||rt[n]):!!ft[e]},ht=function(e,t,n){return t.namespaceURI===N?e===`math`:t.namespaceURI===Qe?e===`math`&&at[n]:!!pt[e]},gt=function(e,t,n){return t.namespaceURI===Qe&&!at[n]||t.namespaceURI===M&&!rt[n]?!1:!pt[e]&&(ot[e]||!ft[e])},_t=function(e){let t=h(e);(!t||!t.tagName)&&(t={namespaceURI:$e,tagName:`template`});let n=kn(e.tagName),r=kn(t.tagName);return et[e.namespaceURI]?e.namespaceURI===Qe?mt(n,t,r):e.namespaceURI===M?ht(n,t,r):e.namespaceURI===N?gt(n,t,r):!!(st===`application/xhtml+xml`&&et[e.namespaceURI]):!1},L=function(e){En(t.removed,{element:e});try{h(e).removeChild(e)}catch{if(p(e),!h(e))throw Bn(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},vt=function(e,t,n){try{ee(e,t)}catch{try{e.removeAttribute(n)}catch{}}},yt=function(e){xt(e);let t=m(e);if(t){let e=[];Cn(t,t=>{En(e,t)}),Cn(e,e=>{try{p(e)}catch{}})}let n=g(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&vt(e,r,i)}},R=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}En(t.removed,{attribute:r||null,from:n});try{r?ee(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(ze||Be)try{L(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},bt=function(e){let t=g(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||w[F(i)]||vt(e,r,i)}},xt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();ie(e)===Q.element&&bt(e);let n=m(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},St=function(e,t){return O?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Ct=function(e){if(!O)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=ie(e);if(n===Q.processingInstruction||n===Q.comment&&q(pr,e.data)){try{p(e)}catch{}continue}if(n===Q.element){let t=e,n=F(ae(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&St(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=m(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},wt=function(e){let t=null,r=null;if(Re)e=`<remove></remove>`+e;else{let t=jn(e,/^[\r\n\t ]+/);r=t&&t[0]}st===`application/xhtml+xml`&&$e===N&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=y?ue(e):e;if($e===N)try{t=new l().parseFromString(i,st)}catch{}if(!t||!t.documentElement){t=me.createDocument($e,`template`,null);try{t.documentElement.innerHTML=P?b:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),$e===N?x.call(t,k?`html`:`body`)[0]:k?t.documentElement:a},Tt=function(e){let t=re?re(e):e.ownerDocument;return he.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Et=function(e){return e=Mn(e,ve,` `),e=Mn(e,ye,` `),e=Mn(e,be,` `),e},Dt=function(e){e.normalize();let t=re?re(e):e.ownerDocument,n=he.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Et(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&Cn(i,e=>{kt(e.content)&&Dt(e.content)})},Ot=function(e){let t=v?v(e):null;return typeof t!=`string`||F(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==g(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!==_(e)||e.childNodes!==m(e)},kt=function(e){if(!_||typeof e!=`object`||!e)return!1;try{return _(e)===Q.documentFragment}catch{return!1}},At=function(e){if(!_||typeof e!=`object`||!e)return!1;try{return typeof _(e)==`number`}catch{return!1}};function z(e,n,r){e.length!==0&&Cn(e,e=>{e.call(t,n,r,I)})}let jt=function(e,t){return!!(O&&e.hasChildNodes()&&!At(e.firstElementChild)&&q(fr,e.textContent)&&q(fr,e.innerHTML)||O&&e.namespaceURI===N&&_r[t]&&(At(e.firstElementChild)||typeof e.textContent==`string`&&q(vr[t],e.textContent))||e.nodeType===Q.processingInstruction||O&&e.nodeType===Q.comment&&q(pr,e.data))},Mt=function(e,t){return e instanceof RegExp?q(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Nt=function(e,t,n){if(!ke[t]&&zt(t)&&Mt(T.tagNameCheck,t))return!1;if(Ge&&!Je[t]){let t=h(e),r=m(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,te(e))}}}return L(e),!0},Pt=function(e,t,n,r){return e.length===0?t:t===n||t===r?X(t):t},Ft=function(e,t){return e===t||h(e)!==null?!1:(Ke&&xt(e),!0)},It=function(e,n){if(z(S.beforeSanitizeElements,e,null),Ft(e,n))return!0;if(Ot(e))return L(e),!0;let r=F(ae(e));if(C=Pt(S.uponSanitizeElement,C,De,Ie),z(S.uponSanitizeElement,e,{tagName:r,allowedTags:C}),Ft(e,n))return!0;if(jt(e,r))return L(e),!0;if(ke[r]||!(E.tagCheck instanceof Function&&E.tagCheck(r))&&!C[r]){let t=Nt(e,r,n);return t===!1&&(z(S.afterSanitizeElements,e,null),Ft(e,n))?!0:t}if(ie(e)===Q.element&&!_t(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&q(mr,e.innerHTML))return L(e),!0;if(D&&e.nodeType===Q.text){let n=Et(e.textContent);e.textContent!==n&&(En(t.removed,{element:e.cloneNode()}),e.textContent=n)}return z(S.afterSanitizeElements,e,null),Ft(e,n)},Lt=function(e,t,r){if(Ae[t]||St(t,e)||He&&(t===`id`||t===`name`)&&(r in n||r in lt))return!1;let i=w[t]||E.attributeCheck instanceof Function&&E.attributeCheck(t,e);return Me&&q(xe,t)||je&&q(Se,t)?!0:i?Ze[t]||q(Ee,Mn(r,we,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Nn(r,`data:`)===0&&A[e]||Ne&&!q(Ce,Mn(r,we,``))?!0:!r:zt(e)&&Mt(T.tagNameCheck,e)&&Mt(T.attributeNameCheck,t,e)||t===`is`&&T.allowCustomizedBuiltInElements&&Mt(T.tagNameCheck,r)},Rt=Y({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),zt=function(e){return!Rt[kn(e)]&&q(Te,e)},Bt=function(e,t,n,r){if(y&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ue(r);case`TrustedScriptURL`:return de(r)}return r},Vt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Ot(e)||(L(e),!1)}catch{return R(t,e),!1}},Ht=function(e,n){if(z(S.beforeSanitizeAttributes,e,null),Ft(e,n))return;let r=e.attributes;if(!r||Ot(e))return;w=Pt(S.uponSanitizeAttribute,w,Oe,Le);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:w,forceKeepAttr:void 0},a=r.length,o=F(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=F(s),d=l,f=s===`value`?d:Pn(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,z(S.uponSanitizeAttribute,e,i),f=i.attrValue,Ue&&(u===`id`||u===`name`)&&Nn(f,We)!==0&&(R(s,e,n),f=We+f,p=!0),O&&q(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){R(s,e,n);continue}if(u===`attributename`&&jn(f,`href`)){R(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){R(s,e,n);continue}if(!Pe&&q(hr,f)){R(s,e,n);continue}if(D&&(f=Et(f)),!Lt(o,u,f)){R(s,e,n);continue}f=Bt(o,u,c,f),f!==d&&Vt(e,s,c,f)&&p&&Tn(t.removed)}}z(S.afterSanitizeAttributes,e,null),Ft(e,n)},Ut=function(e){let t=null,n=Tt(e);for(z(S.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(z(S.uponSanitizeShadowNode,t,null),It(t,e),Ht(t,e),kt(t.content)&&Ut(t.content),ie(t)===Q.element){let e=ne(t);kt(e)&&(Wt(e),Ut(e))}z(S.afterSanitizeShadowDOM,e,null)},Wt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Ut(e.shadow);continue}let n=e.node,r=ie(n)===Q.element,i=m(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`&&F(e)===`template`){let e=n.content;kt(e)&&t.push({node:e,shadow:null})}}if(r){let e=ne(n);kt(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(P=!e,P&&(e=`<!-->`),typeof e!=`string`&&!At(e)&&(e=Un(e),typeof e!=`string`))throw Bn(`dirty is not a string, aborting`);if(!t.isSupported)return e;Fe?(C=Ie,w=Le):dt(n),(S.uponSanitizeElement.length>0||S.uponSanitizeAttribute.length>0)&&(C=X(C)),S.uponSanitizeAttribute.length>0&&(w=X(w)),t.removed=[];let c=Ke&&typeof e!=`string`&&At(e);if(c){Ct(e);let t=ae(e);if(typeof t==`string`){let n=F(t);if(!C[n]||ke[n])throw yt(e),Bn(`root node is forbidden and cannot be sanitized in-place`)}if(Ot(e))throw yt(e),Bn(`root node is clobbered and cannot be sanitized in-place`);try{Wt(e)}catch(t){throw yt(e),t}}else if(At(e))i=wt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Q.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Wt(i);else{if(!ze&&!D&&!k&&e.indexOf(`<`)===-1)return y&&Ve?ue(e):e;if(i=wt(e),!i)return ze?null:Ve?b:``}i&&Re&&L(i.firstChild);let l=c?e:i;try{let e=Tt(l);for(;o=e.nextNode();)It(o,l),Ht(o,l),kt(o.content)&&Ut(o.content)}catch(n){throw c&&(yt(e),Cn(t.removed,e=>{e.element&&xt(e.element)})),n}if(c){let n=!1;if(Cn(t.removed,t=>{t.element&&(t.element===e&&(n=!0),xt(t.element))}),n)throw Bn(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return D&&Dt(e),e}if(ze){if(D&&Dt(i),Be)for(s=ge.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(w.shadowroot||w.shadowrootmode)&&(s=_e.call(r,s,!0)),s}let u=k?i.outerHTML:i.innerHTML;return k&&C[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&q(ur,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
58
|
-
`+u),D&&(u=Et(u)),y&&Ve?ue(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(e),Fe=!0,Ie=C,Le=w},t.clearConfig=function(){I=null,Fe=!1,Ie=null,Le=null,y=oe,b=``},t.isValidAttribute=function(e,t,n){I||dt({});let r=F(e),i=F(t);return Lt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&K(S,e)&&En(S[e],t)},t.removeHook=function(e,t){if(K(S,e)){if(t!==void 0){let n=wn(S[e],t);return n===-1?void 0:Dn(S[e],n,1)[0]}return Tn(S[e])}},t.removeHooks=function(e){K(S,e)&&(S[e]=[])},t.removeAllHooks=function(){S=xr()},t}var Tr=wr(),Er=new Set(`ts.tsx.js.jsx.mjs.cjs.vue.svelte.json.jsonl.md.mdx.txt.html.htm.css.scss.less.py.rb.rs.go.java.kt.swift.c.h.cpp.hpp.cs.php.sh.bash.zsh.fish.yml.yaml.toml.ini.conf.cfg.lock.xml.svg.csv.tsv.sql.pdf.png.jpg.jpeg.gif.webp.mp4.m4v.mov.webm.zip.gz.tgz.docx.xlsx.pptx.ipynb.dockerfile.patch.diff`.split(`.`)),Dr=new Set([`Dockerfile`,`Makefile`,`LICENSE`,`Gemfile`,`Procfile`,`Justfile`,`.env`,`.gitignore`]),Or=/[\0\n\r\t`"<>|*?$;&{}[\]()\\]|:\/\//,kr=/:\d+(?::\d+)?$/,Ar=/^[\w@+~.,=%#-]+$/,jr=e=>e.replace(kr,``);function Mr(e){let t=String(e||``).trim();if(t.length<2||t.length>1024||Or.test(t))return null;let n=jr(t);if(n.length<2||n.startsWith(`-`))return null;let r=n.startsWith(`/`)||n.startsWith(`~/`);if(/\s/.test(n)&&!r||/\s{2,}|^\S+\s+-/.test(n))return null;let i=n.replace(/^~\//,``).replace(/^\/+/,``).split(`/`),a=i.filter((e,t)=>e!==``||t!==i.length-1);if(!a.length||a.some(e=>e===``||!Ar.test(e.replace(/ /g,`_`))))return null;if(r)return n.startsWith(`/`)&&a.length===1&&!/\.\w+$/.test(a[0])?null:n;if(n.startsWith(`./`)||n.startsWith(`../`))return n;let o=a[a.length-1],s=/\.([A-Za-z0-9]{1,10})$/.exec(o)?.[1]?.toLowerCase(),c=Dr.has(o)||!!(s&&Er.has(s));return a.length===1?c&&!/^\d/.test(o)?n:null:(c||n.endsWith(`/`)||a.length>=3)&&a.every(e=>/[A-Za-z_]/.test(e))?n:null}var Nr=new Set(`git.gh.npm.npx.pnpm.yarn.bun.node.deno.python.python3.pip.uv.cargo.go.make.docker.kubectl.cd.ls.cat.grep.rg.find.sed.awk.curl.wget.ssh.scp.rsync.tar.chmod.chown.mkdir.rm.mv.cp.echo.export.sudo.brew.apt.apk.systemctl.journalctl.flock.tmux.herdr.claude.codex.omp.vitest.jest.tsc.eslint.prettier.nuxt.vite.swift.xcodebuild.open.kill.ps.top.du.df.free.uptime.touch.head.tail.jq.env.source.bash.sh.zsh`.split(`.`)),Pr=`ctrl|control|cmd|command|alt|option|opt|shift|meta|super|fn`,Fr=RegExp(`^(?:${Pr})(?:[+-](?:${Pr}|esc|escape|enter|return|tab|space|backspace|delete|del|home|end|pgup|pgdn|up|down|left|right|f\\d{1,2}|.))+$|^[⌘⌃⌥⇧]+\\S{0,2}$|^[↵⏎⇥⌫⎋↑↓←→]$`,`i`),Ir=/^(?:Esc|Escape|Enter|Return|Tab|Space|Backspace|Delete|Home|End|PgUp|PgDn|F\d{1,2}|ESC|ENTER|TAB)$/,Lr=`ms|µs|ns|s|sec|min|h|d|%|x|×|k|m|kb|ko|mb|mo|gb|go|tb|b|px|em|rem|lines|tests|files`,Rr=RegExp(`^[~≈<>+−-]?\\d[\\d_.,]*\\s?(?:${Lr})?(?:\\s\\d[\\d.,]*\\s?(?:${Lr}))*$`,`i`);function zr(e){let t=String(e||``).trim();if(!t||t.length>400)return null;if(/^(?:exit|code|status)\s+0$|^(?:ok|pass(?:ed)?|✓)$/i.test(t))return`ok`;if(/^(?:exit|code|status)\s+[1-9]\d*$|^(?:fail(?:ed)?|error|✗)$/i.test(t)||/^(?:E[A-Z]{3,}|SIG[A-Z]+)$/.test(t))return`err`;if(Fr.test(t)||Ir.test(t))return`key`;if(/^t-\d{3,}$|^[A-Z][A-Z0-9]+-\d+$|^(?=[0-9a-f]*[a-f])(?=[0-9a-f]*\d)[0-9a-f]{7,40}$/.test(t))return`id`;if(Rr.test(t))return`num`;if(Mr(t))return`path`;if(/^[$!❯]\s|^\/[a-z][\w-]*(?:\s|$)/.test(t))return`cmd`;let n=t.split(/\s+/)[0];return Nr.has(n)&&/\s/.test(t)||/\s--?[a-z]/.test(t)&&/^[a-z][\w.-]*\s/.test(t)?`cmd`:null}var Br={c:{comment:String.raw`\/\/[^\n]*|\/\*[\s\S]*?\*\/`,keywords:`if.else.for.while.do.return.break.continue.switch.case.default.function.const.let.var.class.extends.implements.interface.type.enum.import.export.from.as.new.this.super.try.catch.finally.throw.throws.async.await.yield.typeof.instanceof.in.of.void.static.public.private.protected.readonly.abstract.true.false.null.undefined.nil.fn.pub.struct.impl.trait.mod.use.mut.match.loop.where.self.Self.func.package.go.defer.chan.map.range.select.int.long.char.bool.boolean.float.double.string.auto.union.namespace.using.template.override.final.val.when.guard.some.any.unknown.never.declare.keyof.satisfies`.split(`.`)},hash:{comment:String.raw`#[^\n]*`,keywords:`if.elif.else.for.while.in.not.and.or.is.return.def.class.import.from.as.with.try.except.finally.raise.pass.break.continue.lambda.yield.async.await.global.nonlocal.del.assert.True.False.None.then.fi.do.done.case.esac.function.local.export.readonly.source.echo.exit.set.unset.shift.until.begin.end.module.require.unless.nil.self.true.false.null.yes.no.on.off`.split(`.`)},sql:{comment:String.raw`--[^\n]*|\/\*[\s\S]*?\*\/`,keywords:`select.from.where.and.or.not.in.is.null.as.join.left.right.inner.outer.on.group.by.order.having.limit.offset.insert.into.values.update.set.delete.create.table.index.view.drop.alter.add.primary.key.foreign.references.unique.default.distinct.union.all.case.when.then.else.end.begin.commit.rollback.with.returning.integer.text.varchar.boolean.true.false.local.function.return.if.for.while.do.nil.repeat.until`.split(`.`),caseless:!0},markup:{comment:String.raw`<!--[\s\S]*?-->`,keywords:[],tags:!0}},Vr={};for(let e of`js.javascript.mjs.cjs.jsx.ts.typescript.tsx.json.jsonc.json5.java.c.h.cpp.c++.cc.hpp.cs.csharp.go.golang.rust.rs.swift.kotlin.kt.scala.dart.php.css.scss.less.groovy.zig`.split(`.`))Vr[e]=`c`;for(let e of`sh.bash.zsh.fish.shell.console.shellsession.py.python.python3.rb.ruby.yaml.yml.toml.ini.conf.dockerfile.docker.makefile.make.perl.pl.r.nix.elixir.ex.exs.nim.powershell.ps1.cmake.gitignore.env.dotenv`.split(`.`))Vr[e]=`hash`;for(let e of[`sql`,`mysql`,`postgres`,`postgresql`,`sqlite`,`plsql`,`lua`,`haskell`,`hs`,`elm`])Vr[e]=`sql`;for(let e of[`html`,`xml`,`svg`,`vue`,`svelte`,`xhtml`,`plist`])Vr[e]=`markup`;var Hr=String.raw`"(?:[^"\\\n]|\\.)*"|'(?:[^'\\\n]|\\.)*'|\`(?:[^\`\\]|\\[\s\S])*\``,Ur=String.raw`\b(?:0x[\da-fA-F_]+|\d[\d_]*(?:\.\d+)?(?:[eE][+-]?\d+)?)\b`,Wr=String.raw`[A-Za-z_$][\w$]*`,Gr=String.raw`<\/?[A-Za-z][\w:-]*|\/?>`,Kr=new Map;function qr(e){let t=Vr[e.toLowerCase()];if(!t)return null;let n=Kr.get(t);if(!n){let e=Br[t],r=[`(${e.comment})`,`(${Hr})`,`(${Ur})`,`(${e.tags?Gr:Wr})`];n={re:new RegExp(r.join(`|`),`g`),words:new Set(e.caseless?e.keywords.map(e=>e.toLowerCase()):e.keywords),caseless:!!e.caseless},Kr.set(t,n)}return n}var Jr=e=>e.replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e]),Yr=(e,t)=>`<span class="hl-${e}">${Jr(t)}</span>`;function Xr(e,t){let n=e.length>65536?null:qr(t);if(!n)return Jr(e);let r=``,i=0;n.re.lastIndex=0;for(let t=n.re.exec(e);t;t=n.re.exec(e)){if(!t[0]){n.re.lastIndex++;continue}r+=Jr(e.slice(i,t.index)),i=t.index+t[0].length,t[1]?r+=Yr(`c`,t[0]):t[2]?r+=Yr(`s`,t[0]):t[3]?r+=Yr(`n`,t[0]):t[0].startsWith(`<`)||t[0].endsWith(`>`)?r+=Yr(`t`,t[0]):n.words.has(n.caseless?t[0].toLowerCase():t[0])?r+=Yr(`k`,t[0]):r+=Jr(t[0])}return r+Jr(e.slice(i))}var Zr={bash:!0,sh:!0,zsh:!0,shell:!0,console:!0,shellsession:!0},Qr=/^\s*(?:!(?=\s*[^\s=])\s*|\$\s+|❯\s+)/;function $r(e){let t=e.some(e=>Qr.test(e)),n=[],r=!1;for(let i of e){if(!t||r)n.push(i);else if(Qr.test(i))n.push(i.replace(Qr,``));else continue;r=t&&/\\\s*$/.test(i)}let i=n.join(`
|
|
59
|
-
`).replace(/^\s*\n|\s+$/g,``);return i.trim()?i:null}function ei(e,t){let n=String(t||``).trim().split(/\s/)[0].toLowerCase(),r=String(e||``).split(`
|
|
60
|
-
`);if(Zr[n])return $r(r);if(n)return null;let i=$r(r);if(!i)return null;if(r.some(e=>Qr.test(e)))return i;let a=i.replace(/\\\s*\n/g,` `).split(`
|
|
61
|
-
`).map(e=>e.trim()).filter(e=>e&&!e.startsWith(`#`));return a.length&&a.every(e=>zr(e)===`cmd`&&!e.startsWith(`/`))?i:null}function ti(e){let t=String(e||``).trim();if(!t||t.includes(`
|
|
62
|
-
`))return null;let n=t.match(/^([!$❯])(\s*)(.+)$/);if(n){let e=n[3].trim();return n[2]||n[1]===`!`&&zr(e)===`cmd`&&!e.startsWith(`/`)?e:null}return zr(t)===`cmd`&&!t.startsWith(`/`)?t:null}var ni={claude:!0,codex:!0,omp:!0},ri=e=>!!ni[e||``];function ii(e,t){let n=t.trim();return n&&ri(e)?`! ${n}`:null}var ai=!1,oi=he(5e3,4e6),si=se(),ci=new Set;function li(e){ci.add(e)}var ui={FORBID_TAGS:[`style`,`form`,`textarea`,`select`,`option`,`optgroup`,`fieldset`,`legend`,`label`,`datalist`,`output`,`dialog`],FORBID_ATTR:[`style`]},di=!1,fi=!1,pi=e=>!/^[a-z][a-z\d+.-]*:/i.test(e)&&!e.startsWith(`//`)&&!e.startsWith(`#`),$=e=>e.replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e]);function mi(e,t={}){let n=t.doc?`\0doc\0${e}`:t.plain?`\0plain\0${e}`:e,r=oi.get(n);if(r!==void 0)return r;ai||(ai=!0,U.use({renderer:{code({text:e,lang:t}){let n=$((t||``).split(/\s/)[0]||``);if(fi)return`<div class="code-block"><div class="code-head"><span>${n||`code`}</span><span class="code-tools"><button type="button" class="code-copy">${$(fe(`Copy`))}</button></span></div><pre><code${n?` class="language-${n}"`:``}>${Xr(e,n)}</code></pre></div>`;let r=ei(e,t),i=r===null?``:`<button type="button" class="code-run">${$(x(`Run`,`Lancer`))}</button>`;return`<div class="code-block"${r===null?``:` data-cmd="${$(r)}"`}><div class="code-head"><span>${n||`code`}</span><span class="code-tools">${i}<button type="button" class="code-copy">${$(fe(`Copy`))}</button></span></div><pre><code${n?` class="language-${n}"`:``}>${$(e)}</code></pre></div>`},codespan({text:e}){let t=$(e);if(fi){let n=zr(e);return`<code${n?` data-k="${n}"`:``}>${t}</code>`}if(Mr(e))return`<code class="md-path" data-k="path" role="button" tabindex="0">${t}</code>`;let n=ti(e);if(n!==null)return`<code class="md-cmd" data-k="cmd" data-cmd="${$(n)}" role="button" tabindex="0">${t}</code>`;let r=zr(e);return`<code${r?` data-k="${r}"`:``}>${t}</code>`}}}),Tr.addHook(`uponSanitizeElement`,(e,t)=>{if(!di||t.tagName!==`input`)return;let n=e;n.getAttribute(`type`)===`checkbox`&&n.hasAttribute(`disabled`)||n.parentNode?.removeChild(n)}),Tr.addHook(`afterSanitizeAttributes`,e=>{if(fi&&e.tagName===`IMG`){let t=e.getAttribute(`src`);t&&pi(t)&&(e.setAttribute(`data-src`,t),e.removeAttribute(`src`))}e.tagName===`A`&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`))}));let i;di=!!(t.plain||t.doc),fi=!!t.doc;try{let t=U.parse(e,{breaks:!fi,gfm:!0,async:!1});i=di?Tr.sanitize(t,ui):Tr.sanitize(t)}catch{i=`<p>${$(e)}</p>`}finally{di=!1,fi=!1}for(let e of si(n)){let t=oi.delete(e);if(t!==void 0&&t!==i)for(let e of ci)e(t)}return oi.set(n,i,n.length+i.length),i}var hi=a(null),gi=a(!1);async function _i(){gi.value=!0;try{hi.value=await pe(`/api/worktrees`)}catch(e){S(e.message,!0)}finally{gi.value=!1}}var vi=e=>e.branch||e.path.split(`/`).pop()||e.path;async function yi(e){let t=vi(e),n=e.agents?x(` ${e.agents>1?`Its ${e.agents} agents will be stopped`:`Its agent will be stopped`}.`,` ${e.agents>1?`Ses ${e.agents} agents seront arrêtés`:`Son agent sera arrêté`}.`):e.panes?x(` Its terminals will be closed.`,` Ses terminaux seront fermés.`):``,r=e.branch?x(` Branch ${e.branch} is kept.`,` La branche ${e.branch} est gardée.`):``;if(!await v(x(`Delete worktree ${t} (${e.path})?${n}${r}`,`Supprimer le worktree ${t} (${e.path}) ?${n}${r}`),fe(`Delete`)))return!1;let i=!1;for(;;)try{return await pe(`/api/worktrees/remove`,{machine:e.machine,path:e.path,force:i}),S(x(`Worktree ${t} deleted`,`Worktree ${t} supprimé`)),hi.value&&=hi.value.filter(t=>t.machine!==e.machine||t.path!==e.path),!0}catch(e){if(!i&&e instanceof ge&&e.code===`dirty`){if(!await v(x(`${t} has uncommitted changes. Delete them with the worktree?`,`${t} contient des modifications non commitées. Les supprimer avec le worktree ?`),fe(`Force delete`)))return!1;i=!0;continue}return S(e.message,!0),!1}}export{We as A,Ie as C,xe as D,Le as E,Be as F,He as I,Se as L,k as M,C as N,T as O,Ve as P,Fe as S,w as T,O as _,mi as a,Pe as b,ii as c,Ke as d,ze as f,Ae as g,ke as h,hi as i,Oe as j,Ce as k,jr as l,ve as m,yi as n,li as o,ye as p,vi as r,ri as s,_i as t,Je as u,D as v,Me as w,je as x,Ge as y};
|