archsight 0.4.3 → 0.5.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.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +4 -0
  3. data/docs/configuration.md +5 -0
  4. data/docs/diagram.md +5 -0
  5. data/docs/index.md.erb +1 -0
  6. data/docs/pdf-export.md +118 -0
  7. data/lib/archsight/analysis/typst_renderer.rb +25 -78
  8. data/lib/archsight/cli.rb +37 -0
  9. data/lib/archsight/diagram/graph/attributes.rb +3 -1
  10. data/lib/archsight/diagram/graph/node.rb +18 -1
  11. data/lib/archsight/diagram/layout/expander.rb +75 -3
  12. data/lib/archsight/diagram/layout/rank_arranger.rb +3 -1
  13. data/lib/archsight/markdown.rb +17 -1
  14. data/lib/archsight/pdf/cache.rb +41 -0
  15. data/lib/archsight/pdf/compiler.rb +69 -0
  16. data/lib/archsight/pdf/dependency_graph.rb +127 -0
  17. data/lib/archsight/pdf/document.rb +227 -0
  18. data/lib/archsight/pdf/embeds.rb +134 -0
  19. data/lib/archsight/pdf/images.rb +94 -0
  20. data/lib/archsight/pdf/markdown.rb +217 -0
  21. data/lib/archsight/pdf/remote_image.rb +122 -0
  22. data/lib/archsight/pdf/resource_sheet.rb +129 -0
  23. data/lib/archsight/pdf/sample_document.rb +67 -0
  24. data/lib/archsight/pdf/tables.rb +72 -0
  25. data/lib/archsight/pdf/theme.rb +125 -0
  26. data/lib/archsight/pdf/typst/archsight.typ +152 -0
  27. data/lib/archsight/pdf/typst.rb +45 -0
  28. data/lib/archsight/pdf.rb +30 -0
  29. data/lib/archsight/resources/config.rb +147 -0
  30. data/lib/archsight/version.rb +1 -1
  31. data/lib/archsight/web/api/openapi/spec.yaml +230 -0
  32. data/lib/archsight/web/api/pdf_helpers.rb +46 -0
  33. data/lib/archsight/web/api/routes.rb +30 -0
  34. data/lib/archsight/web/public/vue/DocPage-D3QtnrmO.js +1 -0
  35. data/lib/archsight/web/public/vue/EditorPage-lZyG6dVt.js +35 -0
  36. data/lib/archsight/web/public/vue/ErrorPage-BhdYGZJk.js +2 -0
  37. data/lib/archsight/web/public/vue/GraphView-CoqAjFdR.js +1 -0
  38. data/lib/archsight/web/public/vue/HomePage-B7SaXVeb.js +2 -0
  39. data/lib/archsight/web/public/vue/{InstanceRouter-CJSkGdBG.css → InstanceRouter-BCKbW-Wp.css} +1 -1
  40. data/lib/archsight/web/public/vue/InstanceRouter-DJJn9fhP.js +1 -0
  41. data/lib/archsight/web/public/vue/KindList-UqMajqbf.js +1 -0
  42. data/lib/archsight/web/public/vue/PageView-CirIXjW6.js +1 -0
  43. data/lib/archsight/web/public/vue/QueryError-BIJH6gQC.js +1 -0
  44. data/lib/archsight/web/public/vue/ResourceList-761vG1Jw.js +2 -0
  45. data/lib/archsight/web/public/vue/SearchResults-BPHa6yhK.js +1 -0
  46. data/lib/archsight/web/public/vue/WikiPage-Bi7dzY2h.js +3 -0
  47. data/lib/archsight/web/public/vue/{WikiPage-TpmM1VAF.css → WikiPage-CuUi4C8v.css} +1 -1
  48. data/lib/archsight/web/public/vue/{index-DMhBow5t.js → index-BF4zUlWZ.js} +2 -2
  49. data/lib/archsight/web/public/vue/index-BO59Fbpf.css +1 -0
  50. data/lib/archsight/web/public/vue.html +2 -2
  51. metadata +35 -17
  52. data/lib/archsight/web/public/vue/DocPage-L0GzDFiV.js +0 -1
  53. data/lib/archsight/web/public/vue/EditorPage-B3iNbh1u.js +0 -35
  54. data/lib/archsight/web/public/vue/ErrorPage-Lro5vwhy.js +0 -2
  55. data/lib/archsight/web/public/vue/GraphView-BRKwxa--.js +0 -1
  56. data/lib/archsight/web/public/vue/HomePage-DKgI1DXr.js +0 -2
  57. data/lib/archsight/web/public/vue/InstanceRouter-CX6qxVTm.js +0 -1
  58. data/lib/archsight/web/public/vue/KindList-C556gf23.js +0 -1
  59. data/lib/archsight/web/public/vue/PageView-DAqHjL1x.js +0 -1
  60. data/lib/archsight/web/public/vue/QueryError-DvspMrsh.js +0 -1
  61. data/lib/archsight/web/public/vue/ResourceList-BZOYa68X.js +0 -2
  62. data/lib/archsight/web/public/vue/SearchResults-DaaOPG3t.js +0 -1
  63. data/lib/archsight/web/public/vue/WikiPage-Bfx92Iig.js +0 -3
  64. data/lib/archsight/web/public/vue/index-B_YGrWD8.css +0 -1
@@ -1,35 +0,0 @@
1
- import{i as e,t}from"./rolldown-runtime-COiEfhsA.js";import{$ as n,A as r,B as i,C as a,D as o,E as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,N as h,O as g,P as _,Q as v,S as y,U as b,W as x,X as S,a as C,at as w,et as ee,f as te,j as ne,l as re,nt as ie,p as ae,q as T,rt as E,tt as D,u as oe,z as O}from"./index-DMhBow5t.js";import{t as se}from"./useHighlight-BH32C7yt.js";var ce=`archsight.diagramPreview.layout`,le=[`bottom`,`right`,`full`,`hidden`],ue=`(min-width: 1400px)`;function de(){try{let e=localStorage.getItem(ce);return le.includes(e)?e:null}catch{return null}}var fe=D(de()),pe=D(typeof matchMedia==`function`&&matchMedia(ue).matches);typeof matchMedia==`function`&&matchMedia(ue).addEventListener(`change`,e=>{pe.value=e.matches});var me=h(()=>fe.value||(pe.value?`right`:`bottom`));function he(e){if(le.includes(e)){fe.value=e;try{localStorage.setItem(ce,e)}catch{}}}function ge(){return{layout:me,setLayout:he}}var _e={class:`preview-head`},ve={class:`preview-tools`},ye={key:0,class:`preview-state`},be={class:`preview-layout`,role:`group`,"aria-label":`Preview layout`},xe=[`aria-pressed`,`title`,`aria-label`,`onClick`],Se={key:0,class:`preview-error`,role:`alert`},Ce=[`innerHTML`],we={key:2,class:`preview-empty`},Te=300,Ee=C({__name:`DiagramPreview`,props:{source:String},setup(e){let t=e,{layout:n,setLayout:r}=ge(),i=h(()=>n.value===`hidden`),a=[{value:`bottom`,icon:`iconoir-table-rows`,label:`Below the editor`},{value:`right`,icon:`iconoir-view-columns-2`,label:`Right of the editor`},{value:`full`,icon:`iconoir-expand`,label:`Preview only`},{value:`hidden`,icon:`iconoir-eye-closed`,label:`Hide preview`}],o=D(``),s=D(null),c=D(!1),l=null,u=null;function p(){clearTimeout(l),l=null,u?.abort(),u=null}async function g(e){u=new AbortController;let t=u;c.value=!0;try{let n=await y(e,{signal:t.signal});if(t!==u)return;n.html&&(o.value=n.html),s.value=n.error}catch(e){if(e.name===`AbortError`||t!==u)return;s.value=e.message}finally{t===u&&(c.value=!1)}}v([()=>t.source,i],([e,t],[,n])=>{p(),t?c.value=!1:!e||!e.trim()?(o.value=``,s.value=null,c.value=!1):(c.value=!0,l=setTimeout(()=>g(e),n?0:Te))},{immediate:!0}),x(p);function b(e){e.target.closest(`a`)&&e.preventDefault()}return(e,t)=>(T(),m(`div`,{class:E([`diagram-preview`,`layout-${ie(n)}`])},[_(`div`,_e,[_(`span`,null,[t[0]||=_(`i`,{class:`iconoir-eye`},null,-1),t[1]||=O(` Preview`,-1),i.value?(T(),m(ne,{key:0},[O(` hidden`)],64)):d(``,!0)]),_(`span`,ve,[c.value&&!i.value?(T(),m(`span`,ye,`Rendering…`)):d(``,!0),_(`span`,be,[(T(!0),m(ne,null,f(a.filter(e=>!i.value||e.value!==`hidden`),e=>(T(),m(`button`,{key:e.value,type:`button`,class:E({active:ie(n)===e.value}),"aria-pressed":ie(n)===e.value,title:e.label,"aria-label":e.label,onClick:t=>ie(r)(e.value)},[_(`i`,{class:E(e.icon)},null,2)],10,xe))),128))])])]),i.value?d(``,!0):(T(),m(ne,{key:0},[s.value?(T(),m(`div`,Se,[t[2]||=_(`i`,{class:`iconoir-warning-triangle`},null,-1),O(` `+w(s.value),1)])):d(``,!0),o.value?(T(),m(`div`,{key:1,class:E([`preview-body`,{stale:!!s.value}]),title:`Links are disabled in the preview`,onClick:b,innerHTML:o.value},null,10,Ce)):!s.value&&!c.value?(T(),m(`p`,we,`Nothing to preview yet.`)):d(``,!0)],64))],2))}},[[`__scopeId`,`data-v-11568657`]]),De={class:`label-row`},Oe=[`for`,`title`],ke={key:0,class:`required`},Ae=[`id`,`aria-invalid`],je=[`value`],Me=[`id`,`aria-invalid`,`placeholder`],Ne={key:0,class:`future-hint`},Pe={class:`code-source`},Fe=[`id`,`aria-invalid`,`placeholder`],Ie={class:`future-hint`},Le=[`id`,`step`,`aria-invalid`],Re=[`id`,`aria-invalid`],ze=[`id`,`aria-invalid`],Be=[`id`,`aria-invalid`],Ve={key:7,class:`field-description`},He={key:8,class:`field-error`},Ue=C({__name:`EditorField`,props:{field:Object,modelValue:[String,Number,null],error:[Array,null]},emits:[`update:modelValue`,`openMarkdown`],setup(e,{emit:t}){let n=e,r=t,i=h({get:()=>n.modelValue??``,set:e=>r(`update:modelValue`,e)}),a=h(()=>[`textarea`,`markdown`,`code`].includes(n.field.input_type)),s=h(()=>n.field.key===`page/content`),l=h(()=>n.field.code_language===`asd`),{layout:u}=ge(),p={asd:`Archsight Diagram`},v=h(()=>{let e=n.field.code_language||``;return p[e]||e.charAt(0).toUpperCase()+e.slice(1)}),y=h(()=>n.error&&n.error.length>0);return(t,n)=>(T(),m(`div`,{class:E([`field-group`,{"field-full-width":a.value}])},[_(`div`,De,[_(`label`,{for:e.field.key,title:e.field.description},[O(w(e.field.title)+` `,1),e.field.required?(T(),m(`span`,ke,`*`)):d(``,!0)],8,Oe),e.field.input_type===`markdown`?(T(),m(`button`,{key:0,type:`button`,class:`btn-edit-markdown`,title:`Open rich text editor`,onClick:n[0]||=n=>t.$emit(`openMarkdown`,e.field.key)},[...n[8]||=[_(`i`,{class:`iconoir-edit-pencil`},null,-1),O(` Edit `,-1)]])):d(``,!0)]),e.field.input_type===`select`?ee((T(),m(`select`,{key:0,id:e.field.key,"onUpdate:modelValue":n[1]||=e=>i.value=e,"aria-invalid":y.value?`true`:void 0},[n[9]||=_(`option`,{value:``},`Select...`,-1),(T(!0),m(ne,null,f(e.field.options,e=>(T(),m(`option`,{key:e,value:e},w(e),9,je))),128))],8,Ae)),[[o,i.value]]):e.field.input_type===`textarea`||e.field.input_type===`markdown`?(T(),m(`div`,{key:1,class:E([`markdown-field`,{"page-body":s.value}])},[ee(_(`textarea`,{id:e.field.key,"onUpdate:modelValue":n[2]||=e=>i.value=e,"aria-invalid":y.value?`true`:void 0,placeholder:e.field.input_type===`markdown`?`Enter markdown content...`:`One entry per line...`},null,8,Me),[[g,i.value]]),e.field.input_type===`markdown`?(T(),m(`small`,Ne,[...n[10]||=[_(`i`,{class:`iconoir-info-circle`},null,-1),O(` Markdown, `,-1),_(`code`,null,`[[links]]`,-1),O(` and `,-1),_(`code`,null,"```asd",-1),O(` diagrams. Use Edit for the rich text editor `,-1)]])):d(``,!0)],2)):e.field.input_type===`code`?(T(),m(`div`,{key:2,class:E([`code-field`,l.value&&[`with-preview`,`layout-${ie(u)}`]])},[_(`div`,Pe,[ee(_(`textarea`,{id:e.field.key,"onUpdate:modelValue":n[3]||=e=>i.value=e,"aria-invalid":y.value?`true`:void 0,placeholder:`Enter ${e.field.code_language||``} code...`,spellcheck:`false`},null,8,Fe),[[g,i.value]]),_(`small`,Ie,[n[11]||=_(`i`,{class:`iconoir-code`},null,-1),O(` `+w(v.value)+` code `,1)])]),l.value?(T(),c(Ee,{key:0,class:`field-diagram-preview`,source:String(i.value)},null,8,[`source`])):d(``,!0)],2)):e.field.input_type===`number`?ee((T(),m(`input`,{key:3,id:e.field.key,type:`number`,"onUpdate:modelValue":n[4]||=e=>i.value=e,step:e.field.step,"aria-invalid":y.value?`true`:void 0},null,8,Le)),[[g,i.value]]):e.field.input_type===`url`?ee((T(),m(`input`,{key:4,id:e.field.key,type:`url`,"onUpdate:modelValue":n[5]||=e=>i.value=e,placeholder:`https://...`,"aria-invalid":y.value?`true`:void 0},null,8,Re)),[[g,i.value]]):e.field.input_type===`list`?ee((T(),m(`input`,{key:5,id:e.field.key,type:`text`,"onUpdate:modelValue":n[6]||=e=>i.value=e,placeholder:`Comma-separated values`,"aria-invalid":y.value?`true`:void 0},null,8,ze)),[[g,i.value]]):ee((T(),m(`input`,{key:6,id:e.field.key,type:`text`,"onUpdate:modelValue":n[7]||=e=>i.value=e,"aria-invalid":y.value?`true`:void 0},null,8,Be)),[[g,i.value]]),e.field.description&&![`textarea`,`markdown`,`code`].includes(e.field.input_type)?(T(),m(`small`,Ve,w(e.field.description),1)):d(``,!0),y.value?(T(),m(`div`,He,w(e.error.join(`, `)),1)):d(``,!0)],2))}},[[`__scopeId`,`data-v-fe1221de`]]),We={class:`relations-editor`},Ge={key:0,class:`no-relations`},Ke={id:`relations-list`},qe={class:`relation-text`},Je=[`onClick`],Ye={class:`add-relation-row`},Xe=[`value`],Ze=[`value`],Qe=C({__name:`EditorRelations`,props:{relations:Array,relationOptions:Array,instancesByKind:Object},emits:[`update:relations`],setup(e,{emit:t}){let n=e,r=t,i=D(``),a=D(``),s=h(()=>[...n.relations].sort((e,t)=>(e.verb+e.kind+e.name).localeCompare(t.verb+t.kind+t.name))),c=h(()=>i.value?n.relationOptions.find(e=>e.combo===i.value)?.target_kind:null),l=h(()=>c.value&&n.instancesByKind[c.value]||[]);v(i,()=>{a.value=``});function u(){if(!i.value||!a.value)return;let e=n.relationOptions.find(e=>e.combo===i.value);if(!e||n.relations.some(t=>t.verb===e.verb&&t.kind===e.target_kind&&t.name===a.value))return;let t=[...n.relations,{verb:e.verb,kind:e.target_kind,name:a.value}];r(`update:relations`,t),i.value=``,a.value=``}function d(e){let t=n.relations.filter((t,n)=>n!==e);r(`update:relations`,t)}return(t,n)=>(T(),m(`div`,We,[!e.relationOptions||e.relationOptions.length===0?(T(),m(`p`,Ge,` This resource type has no defined relations. `)):(T(),m(ne,{key:1},[_(`div`,Ke,[(T(!0),m(ne,null,f(s.value,(e,t)=>(T(),m(`div`,{key:`${e.verb}:${e.kind}:${e.name}`,class:`relation-item`},[_(`span`,qe,[_(`strong`,null,w(e.verb),1),O(` → `+w(e.kind)+`: `,1),_(`em`,null,w(e.name),1)]),_(`button`,{class:`btn-remove`,type:`button`,title:`Remove`,onClick:e=>d(t)},[...n[2]||=[_(`i`,{class:`iconoir-xmark`},null,-1)]],8,Je)]))),128))]),_(`div`,Ye,[ee(_(`select`,{"onUpdate:modelValue":n[0]||=e=>i.value=e},[n[3]||=_(`option`,{value:``},`Select relation...`,-1),(T(!0),m(ne,null,f(e.relationOptions,e=>(T(),m(`option`,{key:e.combo,value:e.combo},w(e.verb)+` → `+w(e.target_kind),9,Xe))),128))],512),[[o,i.value]]),ee(_(`select`,{"onUpdate:modelValue":n[1]||=e=>a.value=e},[n[4]||=_(`option`,{value:``},`Select instance...`,-1),(T(!0),m(ne,null,f(l.value,e=>(T(),m(`option`,{key:e,value:e},w(e),9,Ze))),128))],512),[[o,a.value]]),_(`button`,{class:`secondary btn-add`,type:`button`,onClick:u},[...n[5]||=[_(`i`,{class:`iconoir-plus`},null,-1),O(` Add `,-1)]])])],64))]))}},[[`__scopeId`,`data-v-a987a6fe`]]),$e={class:`yaml-output-container`},et={key:0,class:`conflict-error`},tt={class:`yaml-success`},nt={id:`yaml-content`},rt={key:0,class:`yaml-file-info`},it={key:1,class:`yaml-instructions`},at={class:`yaml-actions`},ot=[`disabled`],st=C({__name:`EditorYamlOutput`,props:{yaml:String,format:{type:String,default:`yaml`},kind:String,name:String,contentHash:String,pathRef:String,inlineEditEnabled:Boolean},emits:[`editAgain`],setup(e,{emit:t}){let n=e,r=D(null),i=D(`idle`),o=D(`idle`),s=D(null),c=h(()=>n.format===`markdown`),u=h(()=>c.value?`Markdown`:`YAML`),f=h(()=>c.value?`.md`:`.yaml`);l(()=>{r.value&&se(r.value)}),v(()=>n.yaml,async()=>{await b(),r.value&&se(r.value)});async function p(){try{await navigator.clipboard.writeText(n.yaml),i.value=`copied`,setTimeout(()=>{i.value=`idle`},2e3)}catch{let e=document.createElement(`textarea`);e.value=n.yaml,e.style.position=`fixed`,e.style.opacity=`0`,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e),i.value=`copied`,setTimeout(()=>{i.value=`idle`},2e3)}}async function g(){o.value=`saving`,s.value=null;try{let e=await a(n.kind,n.name,n.yaml,n.contentHash);e.success?(o.value=`saved`,setTimeout(()=>{o.value=`idle`},2e3)):e.conflict?(s.value=e.error,o.value=`idle`):(alert(`Save failed: `+e.error),o.value=`idle`)}catch(e){alert(`Save failed: `+e.message),o.value=`idle`}}return(t,n)=>(T(),m(`div`,$e,[s.value?(T(),m(`div`,et,[n[1]||=_(`i`,{class:`iconoir-warning-triangle`},null,-1),_(`span`,null,w(s.value),1)])):d(``,!0),_(`p`,tt,[n[2]||=_(`i`,{class:`iconoir-check-circle`},null,-1),O(` Generated `+w(u.value),1)]),_(`div`,{ref_key:`codeEl`,ref:r},[_(`pre`,nt,[_(`code`,{class:E(`language-${e.format}`)},w(e.yaml),3)])],512),_(`footer`,null,[e.pathRef?(T(),m(`p`,rt,[n[3]||=_(`i`,{class:`iconoir-folder`},null,-1),_(`span`,null,`Source: `+w(e.pathRef),1)])):(T(),m(`p`,it,[n[10]||=_(`i`,{class:`iconoir-info-circle`},null,-1),_(`span`,null,[O(` Copy this `+w(u.value)+` and save it to a `,1),_(`code`,null,w(f.value),1),n[6]||=O(` file in your resources directory`,-1),c.value?(T(),m(ne,{key:0},[n[4]||=O(` (named `,-1),_(`code`,null,w(e.name)+`.md`,1),n[5]||=O(`)`,-1)],64)):d(``,!0),n[7]||=O(`, `,-1),n[8]||=_(`br`,null,null,-1),n[9]||=O(`then reload the application. `,-1)])])),_(`div`,at,[e.pathRef&&e.inlineEditEnabled?(T(),m(`button`,{key:0,type:`button`,onClick:g,disabled:o.value===`saving`,class:E({saved:o.value===`saved`})},[_(`i`,{class:E(o.value===`saving`?`iconoir-refresh`:o.value===`saved`?`iconoir-check`:`iconoir-check-circle`)},null,2),O(` `+w(o.value===`saving`?`Saving...`:o.value===`saved`?`Saved!`:`Save to File`),1)],10,ot)):d(``,!0),_(`button`,{type:`button`,onClick:p,class:E({copied:i.value===`copied`})},[_(`i`,{class:E(i.value===`copied`?`iconoir-check`:`iconoir-copy`)},null,2),O(` `+w(i.value===`copied`?`Copied!`:`Copy to Clipboard`),1)],2),_(`button`,{class:`secondary`,type:`button`,onClick:n[0]||=e=>t.$emit(`editAgain`)},[...n[11]||=[_(`i`,{class:`iconoir-edit-pencil`},null,-1),O(` Edit Again `,-1)]])])])]))}},[[`__scopeId`,`data-v-b5ea938f`]]);function k(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ct(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var lt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,ut=lt&&`documentMode`in document?document.documentMode:null,dt=lt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ft=lt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),pt=!(!lt||!(`InputEvent`in window)||ut)&&`getTargetRanges`in new window.InputEvent(`input`),mt=lt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ht=lt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,gt=lt&&/Android/.test(navigator.userAgent),_t=lt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),vt=lt&&gt&&_t,yt=lt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&dt&&!_t,bt=0,xt=1,St=2,Ct=1,wt=2,Tt=3,Et=4,Dt=5,Ot=6,kt=mt||ht||yt?`\xA0`:`​`,At=`
2
-
3
- `,jt=ft?`\xA0`:kt,Mt=`֑-߿יִ-﷽ﹰ-ﻼ`,Nt=`A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿`,Pt=RegExp(`^[^`+Nt+`]*[`+Mt+`]`),Ft=RegExp(`^[^`+Mt+`]*[`+Nt+`]`),It={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Lt={directionless:1,unmergeable:2},Rt={center:2,end:6,justify:4,left:1,right:3,start:5},zt={[wt]:`center`,[Ot]:`end`,[Et]:`justify`,[Ct]:`left`,[Tt]:`right`,[Dt]:`start`},Bt={normal:0,segmented:2,token:1},Vt={[bt]:`normal`,[St]:`segmented`,[xt]:`token`},Ht=`$config`;function Ut(e,t,n,r,i,a){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(V(o)&&Ut(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}var Wt=!1,Gt=0;function Kt(e){Gt=e.timeStamp}function qt(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&Yo(e,n)!==void 0}function Jt(e,t,n){let r=Is(Os(n)),i=null,a=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,a=r.focusOffset);let o=e.nodeValue;o!==null&&ss(t,o,i,a,!1)}function Yt(e,t,n){if(F(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return Ro(t)&&n.isAttached()}function Xt(e,t,n,r){for(let i=e;i&&!Zs(i);i=Ss(i)){let e=Yo(i,t);if(e!==void 0){let t=G(e,n);if(t)return H(t)||!Y(i)?void 0:[i,t]}else if(i===r)return[r,$o(n)]}}function Zt(e,t,n){Wt=!0;let r=performance.now()-Gt>100;try{ro(e,()=>{let i=I()||function(e){return e.getEditorState().read(()=>{let e=I();return e===null?null:e.clone()})}(e),a=new Map,o=e.getRootElement(),s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n=0;n<t.length;n++){let d=t[n],f=d.type,p=d.target,m=Xt(p,e,s,o);if(!m)continue;let[h,g]=m;if(f===`characterData`)r&&P(g)&&Ro(p)&&Yt(i,p,g)&&Jt(p,g,e);else if(f===`childList`){l=!0;let t=d.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=Jo(r),a=r.parentNode;if(a!=null&&r!==c&&i===null&&!qt(r,a,e)){if(ft){let e=(Y(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}let n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(qt(r,p,e)||c===r)&&(p.appendChild(r),t++)}r!==t&&a.set(h,g)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){let n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||qt(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(l&&es(i),ft&&bs(e)&&i.insertRawText(u))})}finally{Wt=!1}}function Qt(e){let t=e._observer;t!==null&&Zt(e,t.takeRecords(),t)}function $t(e){(function(e){Gt===0&&Os(e).addEventListener(`textInput`,Kt,!0)})(e),e._observer=new MutationObserver((t,n)=>{Zt(e,t,n)})}var en=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||un).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function tn(e,t){return new en(e,t)}function nn(e,t,n=`latest`){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function rn(e,t,n){let r;if(z(),typeof n==`function`){let i=e.getLatest(),a=nn(i,t);if(r=n(a),t.isEqual(a,r))return i}else r=n;let i=e.getWritable();return sn(i).updateFromKnown(t,r),i}function an(e){let t=new Map,n=new Set;for(let r=typeof e==`function`?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){let{ownNodeConfig:e}=$s(r);if(e&&e.stateConfigs)for(let r of e.stateConfigs){let e;`stateConfig`in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}var on=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return ln(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=ln(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function sn(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new on(t,cn(t));return t.__state=n,n}function cn(e){return e.__state?e.__state.sharedNodeState:Eo(Ws(),e.getType()).sharedNodeState}function ln(e){if(e)for(let t in e)return e}function un(e){return e}function dn(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function fn(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function pn(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function mn(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;if(e&&t&&e.size!==t.size)return!1;let n=new Set;return!(e&&dn(n,e,t)||t&&dn(n,t,e)||e&&fn(n,e,t)||t&&fn(n,t,e))}(c,l))}function hn(e,t){let n=e.mergeWithSibling(t),r=B()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function gn(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&P(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(mn(t,r)){r=hn(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&P(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(mn(r,n)){r=hn(r,n);break}break}n.remove()}}else r.remove()}function _n(e){return vn(e.anchor),vn(e.focus),e}function vn(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),P(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!V(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,A=``,kn=null,An=null,jn=!1,Mn=!1;function Nn(e,t){let n=Tn.get(e);if(t!==null){let n=Zn(e);n.parentNode===t&&t.removeChild(n)}if(En.has(e)||bn._keyToDOMMap.delete(e),V(n)){let e=Gn(n,Tn);Pn(e,0,e.length-1,null)}n!==void 0&&_s(On,xn,Sn,n,`destroyed`)}function Pn(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&Nn(t,r)}}function Fn(e,t){e.setProperty(`text-align`,t)}var In=`40px`;function Ln(e,t){let n=yn.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}if(t===0)return void e.style.setProperty(`padding-inline-start`,``);let r=getComputedStyle(bn._rootElement||e).getPropertyValue(`--lexical-indent-base-value`)||In;e.style.setProperty(`padding-inline-start`,`calc(${t} * ${r})`)}function Rn(e,t){let n=e.style;t===0?Fn(n,``):t===1?Fn(n,`left`):t===2?Fn(n,`center`):t===3?Fn(n,`right`):t===4?Fn(n,`justify`):t===5?Fn(n,`start`):t===6&&Fn(n,`end`)}function zn(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(U(e))return null;let n=e.getParentOrThrow();return U(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Bn(e,t){let n=En.get(e);n===void 0&&k(60);let r=n.createDOM(yn,bn);if(function(e,t,n){let r=n._keyToDOMMap;(function(e,t,n){let r=`__lexicalKey_${t._key}`;e[r]=n})(t,n,e),r.set(e,t)}(e,r,bn),P(n)?r.setAttribute(`data-lexical-text`,`true`):H(n)&&r.setAttribute(`data-lexical-decorator`,`true`),V(n)){let e=n.__indent,t=n.__size;if(zn(r,n),e!==0&&Ln(r,e),t!==0){let e=t-1;Vn(Gn(n,En),n,0,e,n.getDOMSlot(r))}let i=n.__format;i!==0&&Rn(r,i),n.isInline()||Un(null,n,r)}else{let t=n.getTextContent();if(H(n)){let t=n.decorate(bn,yn);t!==null&&qn(e,t),r.contentEditable=`false`}A+=t}return t!==null&&t.insertChild(r),_s(On,xn,Sn,n,`created`),r}function Vn(e,t,n,r,i){let a=A;A=``;let o=n;for(;o<=r;++o){Bn(e[o],i);let t=En.get(e[o]);t!==null&&P(t)?kn===null&&(kn=t.getFormat(),An=t.getStyle()):V(t)&&o<r&&!t.isInline()&&(A+=At)}i.element.__lexicalTextContent=A,A=a+A}function Hn(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return M(e)?`line-break`:H(e)&&e.isInline()?`decorator`:null}return`empty`}return null}function Un(e,t,n){let r=Hn(e,Tn),i=Hn(t,En);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function Wn(e,t,n){var r;kn=null,An=null,function(e,t,n){let r=A,i=e.__size,a=t.__size;A=``;let o=n.element;if(i===1&&a===1){let n=e.__first,r=t.__first;if(n===r)Kn(n,o);else{let e=Zn(n),t=Bn(r,null);try{o.replaceChild(t,e)}catch(i){if(typeof i==`object`&&i){let a=`${i.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${n}}.`;throw Error(a)}throw i}Nn(n,null)}let i=En.get(r);P(i)&&kn===null&&(kn=i.getFormat(),An=i.getStyle())}else{let r=Gn(e,Tn),s=Gn(t,En);if(r.length!==i&&k(227),s.length!==a&&k(228),i===0)a!==0&&Vn(s,0,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&n.element.__lexicalLineBreak==null;Pn(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f];if(e===r)u=Jn(Kn(r,a.element)),d++,f++;else{if(l===void 0&&(l=Yn(n,f)),c===void 0)c=Yn(t,d);else if(!c.has(e)){d++;continue}if(!l.has(e)){u=Jn(Zn(e)),Nn(e,a.element),d++,c.delete(e);continue}if(c.has(r)){let e=xs(bn,r);e!==u&&a.withBefore(u).insertChild(e),u=Jn(Kn(r,a.element)),d++,f++}else Bn(r,a.withBefore(u)),f++}let i=En.get(r);i!==null&&P(i)?kn===null&&(kn=i.getFormat(),An=i.getStyle()):V(i)&&f<=s&&!i.isInline()&&(A+=At)}let p=d>o,m=f>s;if(p&&!m){let e=n[s+1],t=e===void 0?null:bn.getElementByKey(e);Vn(n,0,f,s,a.withBefore(t))}else m&&!p&&Pn(t,d,o,a.element)})(0,r,s,i,a,n)}o.__lexicalTextContent=A,A=r+A}(e,t,t.getDOMSlot(n)),r=t,kn==null||kn===r.__textFormat||Mn||r.setTextFormat(kn),function(e){An==null||An===e.__textStyle||Mn||e.setTextStyle(An)}(t)}function Gn(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t.get(r);e===void 0&&k(101),n.push(r),r=e.__next}return n}function Kn(e,t){let n=Tn.get(e),r=En.get(e);n!==void 0&&r!==void 0||k(61);let i=jn||wn.has(e)||Cn.has(e),a=xs(bn,e);if(n===r&&!i){let e;if(V(n)){let t=a.__lexicalTextContent;typeof t==`string`?e=t:(e=n.getTextContent(),a.__lexicalTextContent=e)}else e=n.getTextContent();return A+=e,a}if(n!==r&&i&&_s(On,xn,Sn,r,`updated`),r.updateDOM(n,a,yn)){let n=Bn(e,null);return t===null&&k(62),t.replaceChild(n,a),Nn(e,null),n}if(V(n)){V(r)||k(334,e);let t=r.__indent;(jn||t!==n.__indent)&&Ln(a,t);let o=r.__format;if((jn||o!==n.__format)&&Rn(a,o),i)Wn(n,r,a),U(r)||r.isInline()||Un(n,r,a);else{let e=a.__lexicalTextContent,t;typeof e==`string`?t=e:(t=n.getTextContent(),a.__lexicalTextContent=t),A+=t}if((jn||r.__dir!==n.__dir)&&(zn(a,r),U(r)&&!jn))for(let e of r.getChildren())V(e)&&zn(xs(bn,e.getKey()),e)}else{let t=r.getTextContent();if(H(r)){let t=r.decorate(bn,yn);t!==null&&qn(e,t)}A+=t}if(!Mn&&U(r)&&r.__cachedText!==A){let e=r.getWritable();e.__cachedText=A,r=e}return a}function qn(e,t){let n=bn._pendingDecorators,r=bn._decorators;if(n===null){if(r[e]===t)return;n=Zo(bn)}n[e]=t}function Jn(e){let t=e.nextSibling;return t!==null&&t===bn._blockCursorElement&&(t=t.nextSibling),t}function Yn(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function Xn(e,t,n,r,i,a){A=``,jn=r===2,bn=n,yn=n._config,xn=n._nodes,Sn=bn._listeners.mutation,Cn=i,wn=a,Tn=e._nodeMap,En=t._nodeMap,Mn=t._readOnly,Dn=new Map(n._keyToDOMMap);let o=new Map;return On=o,Kn(`root`,null),bn=void 0,xn=void 0,Cn=void 0,wn=void 0,Tn=void 0,En=void 0,yn=void 0,Dn=void 0,On=void 0,o}function Zn(e){let t=Dn.get(e);return t===void 0&&k(75,e),t}function j(e){return{type:e}}var Qn=j(`SELECTION_CHANGE_COMMAND`),$n=j(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),er=j(`CLICK_COMMAND`),tr=j(`BEFORE_INPUT_COMMAND`),nr=j(`INPUT_COMMAND`),rr=j(`COMPOSITION_START_COMMAND`),ir=j(`COMPOSITION_END_COMMAND`),ar=j(`DELETE_CHARACTER_COMMAND`),or=j(`INSERT_LINE_BREAK_COMMAND`),sr=j(`INSERT_PARAGRAPH_COMMAND`),cr=j(`CONTROLLED_TEXT_INSERTION_COMMAND`),lr=j(`PASTE_COMMAND`),ur=j(`REMOVE_TEXT_COMMAND`),dr=j(`DELETE_WORD_COMMAND`),fr=j(`DELETE_LINE_COMMAND`),pr=j(`FORMAT_TEXT_COMMAND`),mr=j(`UNDO_COMMAND`),hr=j(`REDO_COMMAND`),gr=j(`KEYDOWN_COMMAND`),_r=j(`KEY_ARROW_RIGHT_COMMAND`),vr=j(`MOVE_TO_END`),yr=j(`KEY_ARROW_LEFT_COMMAND`),br=j(`MOVE_TO_START`),xr=j(`KEY_ARROW_UP_COMMAND`),Sr=j(`KEY_ARROW_DOWN_COMMAND`),Cr=j(`KEY_ENTER_COMMAND`),wr=j(`KEY_SPACE_COMMAND`),Tr=j(`KEY_BACKSPACE_COMMAND`),Er=j(`KEY_ESCAPE_COMMAND`),Dr=j(`KEY_DELETE_COMMAND`),Or=j(`KEY_TAB_COMMAND`),kr=j(`INSERT_TAB_COMMAND`),Ar=j(`INDENT_CONTENT_COMMAND`),jr=j(`OUTDENT_CONTENT_COMMAND`),Mr=j(`DROP_COMMAND`),Nr=j(`FORMAT_ELEMENT_COMMAND`),Pr=j(`DRAGSTART_COMMAND`),Fr=j(`DRAGOVER_COMMAND`),Ir=j(`DRAGEND_COMMAND`),Lr=j(`COPY_COMMAND`),Rr=j(`CUT_COMMAND`),zr=j(`SELECT_ALL_COMMAND`),Br=j(`CLEAR_EDITOR_COMMAND`),Vr=j(`CLEAR_HISTORY_COMMAND`),Hr=j(`CAN_REDO_COMMAND`),Ur=j(`CAN_UNDO_COMMAND`),Wr=j(`FOCUS_COMMAND`),Gr=j(`BLUR_COMMAND`),Kr=j(`KEY_MODIFIER_COMMAND`),qr=Object.freeze({}),Jr=[[`keydown`,function(e,t){Yr=e.timeStamp,Xr=e.key,!t.isComposing()&&J(t,gr,e)}],[`pointerdown`,function(e,t){let n=e.target,r=e.pointerType;zs(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&ro(t,()=>{ko(n)||(ni=!0)})}],[`compositionstart`,function(e,t){J(t,rr,e)}],[`compositionend`,function(e,t){ft?ii=!0:ht||!mt&&!yt?J(t,ir,e):(ai=!0,oi=e.data)}],[`input`,function(e,t){e.stopPropagation(),ro(t,()=>{t.dispatchCommand(nr,e)},{event:e}),Qr=null}],[`click`,function(e,t){ro(t,()=>{let n=I(),r=Is(Os(t)),i=Ea();if(r){if(F(n)){let t=n.anchor,a=t.getNode();if(t.type===`element`&&t.offset===0&&n.isCollapsed()&&!U(a)&&K().getChildrenSize()===1&&a.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&a!==n.focus.getNode()){let e=tc(a,e=>V(e)&&!e.isInline());V(e)&&e.select(0)}}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=r.anchorNode;(Y(n)||Ro(n))&&es(Ta(i,r,t,e))}}J(t,er,e)})}],[`cut`,qr],[`copy`,qr],[`dragstart`,qr],[`dragover`,qr],[`dragend`,qr],[`paste`,qr],[`focus`,qr],[`blur`,qr],[`drop`,qr]];pt&&Jr.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||ft&&bs(t)||n!==`insertCompositionText`&&J(t,tr,e)}(e,t)]);var Yr=0,Xr=null,Zr=0,Qr=null,$r=new WeakMap,ei=new WeakMap,ti=!1,ni=!1,ri=!1,ii=!1,ai=!1,oi=``,si=null,ci=[0,``,0,`root`,0];function li(e,t,n,r,i){let a=e.anchor,o=e.focus,s=a.getNode(),c=B(),l=Is(Os(c)),u=l===null?null:l.anchorNode,d=a.key,f=c.getElementByKey(d),p=n.length;return d!==o.key||!P(s)||(!i&&(!pt||Zr<r+50)||s.isDirty()&&p<2||ns(n))&&a.offset!==o.offset&&!s.isComposing()||Lo(s)||s.isDirty()&&p>1||(i||!pt)&&f!==null&&!s.isComposing()&&u!==Bo(f)||l!==null&&t!==null&&(!t.collapsed||t.startContainer!==l.anchorNode||t.startOffset!==l.anchorOffset)||!s.isComposing()&&(s.getFormat()!==e.format||s.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=Io(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(P(t)||V(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,s)}function ui(e,t){return Ro(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function di(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=e;ti&&(ti=!1,ui(r,i)&&ui(a,o)&&!si)||ro(t,()=>{if(!n)return void es(null);if(!jo(t,r,a))return;let s=I();if(si&&F(s)&&s.isCollapsed()){let e=s.anchor,t=si.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(s=si.clone(),es(s))}if(si=null,F(s)){let n=s.anchor,r=n.getNode();if(s.isCollapsed()){e.type===`Range`&&e.anchorNode===e.focusNode&&(s.dirty=!0);let i=Os(t).event,a=i?i.timeStamp:performance.now(),[o,c,l,u,d]=ci,f=K(),p=!1===t.isComposing()&&f.getTextContent()===``;if(a<d+200&&n.offset===l&&n.key===u)fi(s,o,c);else if(n.type===`text`)P(r)||k(141),pi(s,r);else if(n.type===`element`&&!p){V(r)||k(259);let e=n.getNode();e.isEmpty()?function(e,t){fi(e,t.getTextFormat(),t.getTextStyle())}(s,e):fi(s,0,``)}}else{let e=n.key,t=s.focus.key,r=s.getNodes(),a=r.length,c=s.isBackward(),l=c?o:i,u=c?i:o,d=c?t:e,f=c?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(P(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}s.format=m?p:0}}J(t,Qn,void 0)})}function fi(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function pi(e,t){fi(e,t.getFormat(),t.getStyle())}function mi(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function hi(e){let t=e.inputType,n=mi(e),r=B(),i=I();if(t===`deleteContentBackward`){if(i===null){let e=Ea();if(!F(e))return!0;es(e.clone())}if(F(i)){let t=i.anchor.key===i.focus.key;if(a=e.timeStamp,Xr===`MediaLast`&&a<Yr+30&&r.isComposing()&&t){if(Ko(null),Yr=0,setTimeout(()=>{ro(r,()=>{Ko(null)})},30),F(i)){let e=i.anchor.getNode();e.markDirty(),P(e)||k(142),pi(i,e)}}else{Ko(null),e.preventDefault();let n=i.anchor.getNode(),a=n.getTextContent(),o=n.canInsertTextAfter(),s=i.anchor.offset===0&&i.focus.offset===a.length,c=vt&&t&&!s&&o;if(c&&i.isCollapsed()&&(c=!H(ys(i.anchor,!0))),!c){J(r,ar,!0);let e=I();vt&&F(e)&&e.isCollapsed()&&(si=e,setTimeout(()=>si=null))}}return!0}}var a;if(!F(i))return!0;let o=e.data;Qr!==null&&os(!1,r,Qr),i.dirty&&Qr===null||!i.isCollapsed()||U(i.anchor.getNode())||n===null||i.applyDOMRange(n),Qr=null;let s=i.anchor,c=i.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
4
- `)e.preventDefault(),J(r,or,!1);else if(o===At)e.preventDefault(),J(r,sr,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),i.insertRawText(t)}else o!=null&&li(i,n,o,e.timeStamp,!0)?(e.preventDefault(),J(r,cr,o)):Qr=o;return Zr=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:J(r,cr,e);break;case`insertFromComposition`:Ko(null),J(r,cr,e);break;case`insertLineBreak`:Ko(null),J(r,or,!1);break;case`insertParagraph`:Ko(null),ri&&!ht?(ri=!1,J(r,or,!1)):J(r,sr,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:J(r,lr,e);break;case`deleteByComposition`:(function(e,t){return e!==t||V(e)||V(t)||!Io(e)||!Io(t)})(l,u)&&J(r,ur,e);break;case`deleteByDrag`:case`deleteByCut`:J(r,ur,e);break;case`deleteContent`:J(r,ar,!1);break;case`deleteWordBackward`:J(r,dr,!0);break;case`deleteWordForward`:J(r,dr,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:J(r,fr,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:J(r,fr,!1);break;case`formatStrikeThrough`:J(r,pr,`strikethrough`);break;case`formatBold`:J(r,pr,`bold`);break;case`formatItalic`:J(r,pr,`italic`);break;case`formatUnderline`:J(r,pr,`underline`);break;case`historyUndo`:J(r,mr,void 0);break;case`historyRedo`:J(r,hr,void 0)}return!0}function gi(e){if(Y(e.target)&&ko(e.target))return!0;let t=B(),n=I(),r=e.data,i=mi(e);if(r!=null&&F(n)&&li(n,i,r,e.timeStamp,!1)){ii&&=(yi(t,r),!1);let i=n.anchor.getNode(),a=Is(Os(t));if(a===null)return!0;let o=n.isBackward(),s=o?n.anchor.offset:n.focus.offset,c=o?n.focus.offset:n.anchor.offset;pt&&!n.isCollapsed()&&P(i)&&a.anchorNode!==null&&i.getTextContent().slice(0,s)+r+i.getTextContent().slice(s+c)===as(a.anchorNode)||J(t,cr,r);let l=r.length;ft&&l>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(n.anchor.offset-=l),vt&&t.isComposing()&&(Yr=0,Ko(null))}else os(!1,t,r===null?void 0:r),ii&&=(yi(t,r||void 0),!1);return function(){z(),Qt(B())}(),!0}function _i(e){let t=B(),n=I();if(F(n)&&!t.isComposing()){let r=n.anchor,i=n.anchor.getNode();Ko(r.key),ws(Pi),(e.timeStamp<Yr+30||r.type===`element`||!n.isCollapsed()||i.getFormat()!==n.format||P(i)&&i.getStyle()!==n.style)&&J(t,cr,jt)}return!0}function vi(e){return yi(B(),e.data),ws(Fi),!0}function yi(e,t){let n=e._compositionKey;if(Ko(null),n!==null&&t!=null){if(t===``){let t=G(n),r=Bo(e.getElementByKey(n));if(r!==null&&r.nodeValue!==null&&P(t)){let n=Is(Os(e)),i=null,a=null;n!==null&&n.anchorNode===r&&(i=n.anchorOffset,a=n.focusOffset),ss(t,r.nodeValue,i,a,!0)}return}if(t[t.length-1]===`
5
- `){let t=I();if(F(t)||da(t)){if(F(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}J(e,Cr,null);return}}}os(!0,e,t)}function bi(e){let t=B();if(e.key==null)return!0;if(ai){if(ps(e))return ro(t,()=>{yi(t,oi)}),ai=!1,oi=``,!0;ai=!1,oi=``}if(function(e){return q(e,`ArrowRight`,{shiftKey:`any`})}(e))J(t,_r,e);else if(function(e){return q(e,`ArrowRight`,ds)}(e))J(t,vr,e);else if(function(e){return q(e,`ArrowLeft`,{shiftKey:`any`})}(e))J(t,yr,e);else if(function(e){return q(e,`ArrowLeft`,ds)}(e))J(t,br,e);else if(function(e){return q(e,`ArrowUp`,{altKey:`any`,shiftKey:`any`})}(e))J(t,xr,e);else if(function(e){return q(e,`ArrowDown`,{altKey:`any`,shiftKey:`any`})}(e))J(t,Sr,e);else if(function(e){return q(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:!0})}(e))ri=!0,J(t,Cr,e);else if(function(e){return e.key===` `}(e))J(t,wr,e);else if(function(e){return dt&&q(e,`o`,{ctrlKey:!0})}(e))e.preventDefault(),ri=!0,J(t,or,!0);else if(function(e){return q(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`})}(e))ri=!1,J(t,Cr,e);else if(function(e){return q(e,`Backspace`,{shiftKey:`any`})||dt&&q(e,`h`,{ctrlKey:!0})}(e))ps(e)?J(t,Tr,e):(e.preventDefault(),J(t,ar,!0));else if(function(e){return e.key===`Escape`}(e))J(t,Er,e);else if(function(e){return q(e,`Delete`,{})||dt&&q(e,`d`,{ctrlKey:!0})}(e))(function(e){return e.key===`Delete`})(e)?J(t,Dr,e):(e.preventDefault(),J(t,ar,!1));else if(function(e){return q(e,`Backspace`,fs)}(e))e.preventDefault(),J(t,dr,!0);else if(function(e){return q(e,`Delete`,fs)}(e))e.preventDefault(),J(t,dr,!1);else if(function(e){return dt&&q(e,`Backspace`,{metaKey:!0})}(e))e.preventDefault(),J(t,fr,!0);else if(function(e){return dt&&(q(e,`Delete`,{metaKey:!0})||q(e,`k`,{ctrlKey:!0}))}(e))e.preventDefault(),J(t,fr,!1);else if(function(e){return q(e,`b`,ds)}(e))e.preventDefault(),J(t,pr,`bold`);else if(function(e){return q(e,`u`,ds)}(e))e.preventDefault(),J(t,pr,`underline`);else if(function(e){return q(e,`i`,ds)}(e))e.preventDefault(),J(t,pr,`italic`);else if(function(e){return q(e,`Tab`,{shiftKey:`any`})}(e))J(t,Or,e);else if(function(e){return q(e,`z`,ds)}(e))e.preventDefault(),J(t,mr,void 0);else if(function(e){return dt?q(e,`z`,{metaKey:!0,shiftKey:!0}):q(e,`y`,{ctrlKey:!0})||q(e,`z`,{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),J(t,hr,void 0);else{let n=t._editorState._selection;n===null||F(n)?ms(e)&&(e.preventDefault(),J(t,zr,e)):function(e){return q(e,`c`,ds)}(e)?(e.preventDefault(),J(t,Lr,e)):function(e){return q(e,`x`,ds)}(e)?(e.preventDefault(),J(t,Rr,e)):ms(e)&&(e.preventDefault(),J(t,zr,e))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(Kr,e),!0}function xi(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var Si=new Map;function Ci(e){let t=Ls(e.target);if(t===null)return;let n=No(t.anchorNode);if(n===null)return;ni&&(ni=!1,ro(n,()=>{let r=Ea(),i=t.anchorNode;(Y(i)||Ro(i))&&es(Ta(r,t,n,e))}));let r=rs(n),i=r[r.length-1],a=i._key,o=Si.get(a),s=o||i;s!==n&&di(t,s,!1),di(t,n,!0),n===i?o&&Si.delete(a):Si.set(a,n)}function wi(e){e._lexicalHandled=!0}function Ti(e){return!0===e._lexicalHandled}function Ei(e){let t=$r.get(e);if(t===void 0)return;let n=ei.get(t);if(n===void 0)return;let r=n-1;r>=0||k(164),$r.delete(e),ei.set(t,r),r===0&&t.removeEventListener(`selectionchange`,Ci);let i=Po(e);Mo(i)?(function(e){if(e._parentEditor!==null){let t=rs(e),n=t[t.length-1]._key;Si.get(n)===e&&Si.delete(n)}else Si.delete(e._key)}(i),e.__lexicalEditor=null):i&&k(198);let a=xi(e);for(let e=0;e<a.length;e++)a[e]();e.__lexicalEventHandles=[]}function Di(e,t,n){z();let r=e.__key,i=e.getParent();if(i===null)return;let a=function(e){let t=I();if(!F(t)||!V(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return Es(i,e)&&n.set(e.__key,0,`element`),Es(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(F(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(ka(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(ka(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else da(a)&&t&&e.isSelected()&&e.selectPrevious();if(F(a)&&t&&!o){let t=e.getIndexWithinParent();Wo(e),Da(a,i,t,-1)}else Wo(e);n||As(i)||i.canBeEmpty()||!i.isEmpty()||Di(i,t),t&&a&&U(i)&&i.isEmpty()&&i.selectEnd()}function Oi(e){return e}var ki=Symbol.for(`ephemeral`);function Ai(e){return e[ki]||!1}var ji=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=$s(this);return e===void 0&&k(64,this.name),e}static clone(e){k(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Uo(this,e)}getType(){return this.__type}isInline(){k(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=G(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){let t=e||I();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(P(this))return n;if(F(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(H(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:G(e)}getParentOrThrow(){let e=this.getParent();return e===null&&k(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(As(t))return V(e)||e===this&&H(e)||k(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&k(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:G(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:G(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=V(this)?this:this.getParent(),n=V(e)?e:e.getParent(),r=t&&n?Nc(t,n):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=Nc(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?Ac(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&k(279),!1)))}isParentOf(e){let t=Nc(this,e);return t!==null&&t.type===`ancestor`}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;i!==null;){let a=i.__key;if(r.has(a)||(r.add(a),n.push(i)),i===e)break;let o=V(i)?t?i.getFirstChild():i.getLastChild():null;if(o!==null){i=o;continue}let s=t?i.getNextSibling():i.getPreviousSibling();if(s!==null){i=s;continue}let c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let l=null,u=c;do{if(u===null&&k(68),l=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;l!==null||r.has(u.__key)||n.push(u)}while(l===null);i=l}return t||n.reverse(),n}isDirty(){let e=B()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Ai(this))return this;let e=G(this.__key);return e===null&&k(113),e}getWritable(){if(Ai(this))return this;z();let e=Wa(),t=B(),n=e._nodeMap,r=this.__key,i=this.getLatest(),a=t._cloneNotNeeded,o=I();if(o!==null&&o.setCachedNodes(null),a.has(r))return Go(i),i;let s=Js(i);return a.add(r),Go(s),n.set(r,s),s}getTextContent(){return``}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){k(70)}updateDOM(e,t,n){k(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){k(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of cn(n).flatKeys)e in t&&(i!==void 0&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&sn(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){Di(this,!0,e)}replace(e,t){z();let n=I();n!==null&&(n=n.clone()),Ms(this,e);let r=this.getLatest(),i=this.__key,a=e.__key,o=e.getWritable(),s=this.getParentOrThrow().getWritable(),c=s.__size;Wo(o);let l=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,f=r.__next,p=r.__parent;if(Di(r,!1,!0),l===null?s.__first=a:l.getWritable().__next=a,o.__prev=d,u===null?s.__last=a:u.getWritable().__prev=a,o.__next=f,o.__parent=p,s.__size=c,t&&(V(this)&&V(o)||k(139),this.getChildren().forEach(e=>{o.append(e)})),F(n)){es(n);let e=n.anchor,t=n.focus;e.key===i&&ca(e,o),t.key===i&&ca(t,o)}return qo()===i&&Ko(a),o}insertAfter(e,t=!0){z(),Ms(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.getParent(),a=I(),o=!1,s=!1;if(i!==null){let t=e.getIndexWithinParent();if(Wo(r),F(a)){let e=i.__key,n=a.anchor,r=a.focus;o=n.type===`element`&&n.key===e&&n.offset===t+1,s=r.type===`element`&&r.key===e&&r.offset===t+1}}let c=this.getNextSibling(),l=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(c===null?l.__last=u:c.getWritable().__prev=u,l.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&F(a)){let e=this.getIndexWithinParent();Da(a,l,e+1);let t=l.__key;o&&a.anchor.set(t,e+2,`element`),s&&a.focus.set(t,e+2,`element`)}return e}insertBefore(e,t=!0){z(),Ms(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.__key;Wo(r);let a=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),s=n.__prev,c=this.getIndexWithinParent();a===null?o.__first=i:a.getWritable().__next=i,o.__size++,n.__prev=i,r.__prev=s,r.__next=n.__key,r.__parent=n.__parent;let l=I();return t&&F(l)&&Da(l,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return W()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){z();let n=this.getPreviousSibling(),r=this.getParentOrThrow();if(n===null)return r.select(0,0);if(V(n))return n.select();if(!P(n)){let e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){z();let n=this.getNextSibling(),r=this.getParentOrThrow();if(n===null)return r.select();if(V(n))return n.select(0,0);if(!P(n)){let e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}},Mi=`history-push`,Ni=`history-merge`,Pi=`composition-start`,Fi=`composition-end`,Ii=class e extends ji{static getType(){return`linebreak`}static clone(t){return new e(t.__key)}constructor(e){super(e)}getTextContent(){return`
6
- `}createDOM(){return document.createElement(`br`)}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>function(e){let t=e.parentElement;if(t!==null&&Hs(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&zi(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&zi(n))return!0}}return!1}(e)||function(e){let t=e.parentElement;if(t!==null&&Hs(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&zi(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&zi(r))return!0}return!1}(e)?null:{conversion:Li,priority:0}}}static importJSON(e){return Ri().updateFromJSON(e)}};function Li(e){return{node:Ri()}}function Ri(){return js(new Ii)}function M(e){return e instanceof Ii}function zi(e){return Ro(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function Bi(e,t){return 16&t?`code`:t&128?`mark`:32&t?`sub`:64&t?`sup`:null}function Vi(e,t){return 1&t?`strong`:2&t?`em`:`span`}function Hi(e,t,n,r,i){let a=r.classList,o=gs(i,`base`);o!==void 0&&a.add(...o),o=gs(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in It){let r=It[e];if(o=gs(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}}function Ui(e,t,n){let r=t.firstChild,i=n.isComposing(),a=e+(i?kt:``);if(r==null)t.textContent=a;else{let e=r.nodeValue;if(e!==a){if(i||ft){let[t,n,i]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(e,a);n!==0&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=a}}}function Wi(e,t,n,r,i,a){Ui(i,e,t);let o=a.theme.text;o!==void 0&&Hi(0,0,r,e,o)}function Gi(e,t){let n=document.createElement(t);return n.appendChild(e),n}var Ki=class e extends ji{__text;__format;__style;__mode;__detail;static getType(){return`text`}static clone(t){return new e(t.__text,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return Vt[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===qo()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=It[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type===`text`&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Vo(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=Bi(0,n),i=Vi(0,n),a=r===null?i:r,o=document.createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=document.createElement(i),o.appendChild(s)),Wi(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&(o.style.cssText=c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=Bi(0,i),s=Bi(0,a),c=Vi(0,i),l=Vi(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??k(48);let i=document.createElement(l);return Wi(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??k(49)),Ui(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&Hi(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:Zi,priority:0}),b:()=>({conversion:Ji,priority:0}),code:()=>({conversion:ea,priority:0}),em:()=>({conversion:ea,priority:0}),i:()=>({conversion:ea,priority:0}),mark:()=>({conversion:ea,priority:0}),s:()=>({conversion:ea,priority:0}),span:()=>({conversion:qi,priority:0}),strong:()=>({conversion:ea,priority:0}),sub:()=>({conversion:ea,priority:0}),sup:()=>({conversion:ea,priority:0}),u:()=>({conversion:ea,priority:0})}}static importJSON(e){return N().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return Y(t)||k(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=Gi(t,`b`)),this.hasFormat(`italic`)&&(t=Gi(t,`i`)),this.hasFormat(`strikethrough`)&&(t=Gi(t,`s`)),this.hasFormat(`underline`)&&(t=Gi(t,`u`)),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?It[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?Lt[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=Vo(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=Bt[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){z();let n=e,r=t,i=I(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!F(i))return Sa(o,n,o,r,`text`,`text`);{let e=qo();e!==i.anchor.key&&e!==i.focus.key||Ko(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=I();if(r&&F(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){z();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=qo(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=I();if(F(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=N(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=pn(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=N(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=pn(t,n);let a=n.__key;i===r&&Ko(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&Go(t),n!==null&&Go(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),F(v)&&Da(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||k(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;qo()===r&&Ko(n);let o=I();if(F(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&Aa(i,t,n,e,a),s!==null&&s.key===r&&Aa(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function qi(e){return{forChild:ta(e.style),node:null}}function Ji(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:ta(t.style,n?void 0:`bold`),node:null}}var Yi=new WeakMap;function Xi(e){if(!Y(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function Zi(e){let t=e;e.parentElement===null&&k(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=Yi.get(n))===void 0&&!Xi(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)Yi.set(r[e],i);return i}(t)!==null){let e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){let r=e[n];r===`
7
- `||r===`\r
8
- `?t.push(Ri()):r===` `?t.push(ra()):r!==``&&t.push(N(r))}return{node:t}}if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=Qi(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=Qi(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:N(n)}}function Qi(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,Y(n)){let e=n.style.display;if(e===``&&!Vs(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(Ro(n))return n;if(n.nodeName===`BR`)return null}}var $i={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function ea(e){let t=$i[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:ta(e.style,t),node:null}}function N(e=``){return js(new Ki(e))}function P(e){return e instanceof Ki}function ta(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign;return e=>(P(e)&&(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}var na=class e extends Ki{static getType(){return`tab`}static clone(t){return new e(t.__key)}constructor(e){super(` `,e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=gs(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}static importJSON(e){return ra().updateFromJSON(e)}setTextContent(e){return e!==` `&&e!==``&&ct(126),super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||k(286),this}setDetail(e){return e!==2&&k(127),this}setMode(e){return e!==`normal`&&k(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function ra(){return js(new na)}function ia(e){return e instanceof na}var aa=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:kc(Uc(Pc(this,`next`)),Uc(Pc(e,`next`)))<0}getNode(){let e=G(this.key);return e===null&&k(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,Ha()||(qo()===a&&Ko(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}};function oa(e,t,n){return new aa(e,t,n)}function sa(e,t){let n=t.__key,r=e.offset,i=`element`;if(P(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!V(t)){let e=t.getNextSibling();if(P(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function ca(e,t){if(V(t)){let n=t.getLastDescendant();V(n)||P(n)?sa(e,n):sa(e,t)}else sa(e,t)}var la=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!da(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes(),n=t.length,r=t[n-1],i;if(P(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=G(e);t!==null&&n.push(t)}return Ha()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes();if((I()||Ea())===this&&e[0]){let t=gc(e[0],`next`);Ic(Dc(t,t))}for(let t of e)t.remove()}};function F(e){return e instanceof ua}var ua=class e{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!F(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=new Set;for(let n of e)if(fc(n)){let{origin:e}=n;t.length===0?i.add(e):(a.add(e),t.push(e))}else{let{origin:e}=n;V(e)&&a.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),dc(e.focus)&&V(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=bc(e.focus.origin,`previous`);fc(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=Sc(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!V(e)||a.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=Uc(e.anchor),r=Uc(e.anchor.getFlipped()),i=e=>uc(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(Kc(Rc(this),`next`));return Ha()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`)}getTextContent(){let e=this.getNodes();if(e.length===0)return``;let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,a=r.isBefore(i),[o,s]=pa(this),c=``,l=!0;for(let u=0;u<e.length;u++){let d=e[u];if(V(d)&&!d.isInline())l||(c+=`
9
- `),l=!d.isEmpty();else if(l=!1,P(d)){let e=d.getTextContent();d===t?d===n?r.type===`element`&&i.type===`element`&&i.offset!==r.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=a?e.slice(o):e.slice(s):d===n&&(e=a?e.slice(0,s):e.slice(0,o)),c+=e}else!H(d)&&!M(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let t=B(),n=t.getEditorState()._selection,r=ba(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),_n(this)}clone(){let t=this.anchor,n=this.focus;return new e(oa(t.key,t.offset,t.type),oa(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Vo(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=It[e];return(this.format&t)!==0}insertRawText(e){let t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){let r=t[e];r===`
10
- `||r===`\r
11
- `?n.push(Ri()):r===` `?n.push(ra()):n.push(N(r))}this.insertNodes(n)}insertText(e){let t=this.anchor,n=this.focus,r=this.format,i=this.style,a=t,o=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,o=t),a.type===`element`&&function(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=N();if(o.setFormat(n),o.setStyle(r),vo(a))a.splice(0,0,[o]);else{let e=U(i)?W().append(o):o;a===null?i.append(e):a.insertBefore(e)}e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}(a,o,r,i),o.type===`element`&&Fc(o,Uc(Pc(o,`next`)));let s=a.offset,c=o.offset,l=this.getNodes(),u=l.length,d=l[0];P(d)||k(26);let f=d.getTextContent().length,p=d.getParentOrThrow(),m=l[u-1];if(u===1&&o.type===`element`&&(c=f,o.set(a.key,c,`text`)),this.isCollapsed()&&s===f&&(Lo(d)||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let t=d.getNextSibling();if(P(t)&&t.canInsertTextBefore()&&!Lo(t)||(t=N(),t.setFormat(r),t.setStyle(i),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,e!==``)return void this.insertText(e)}else if(this.isCollapsed()&&s===0&&(Lo(d)||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let t=d.getPreviousSibling();if(P(t)&&!Lo(t)||(t=N(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,e!==``)return void this.insertText(e)}else if(d.isSegmented()&&s!==f){let e=N(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&e!==``){let t=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||V(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(``),ya(this.anchor,this.focus),void this.insertText(e)}if(u===1){if(Io(d)){let t=N(e);t.select(),d.replace(t);return}let t=d.getFormat(),n=d.getStyle();if(s!==c||t===r&&n===i){if(ia(d)){let t=N(e);t.setFormat(r),t.setStyle(i),t.select(),d.replace(t);return}}else{if(d.getTextContent()!==``){let t=N(e);if(t.setFormat(r),t.setStyle(i),t.select(),s===0)d.insertBefore(t,!1);else{let[e]=d.splitText(s);e.insertAfter(t,!1)}t.isComposing()&&this.anchor.type===`text`&&(this.anchor.offset-=e.length);return}d.setFormat(r),d.setStyle(i)}let a=c-s;d=d.spliceText(s,a,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=t,this.style=n,d.isComposing()&&(this.anchor.offset-=e.length))}else{let t=new Set([...d.getParentKeys(),...m.getParentKeys()]),n=V(d)?d:d.getParentOrThrow(),r=V(m)?m:m.getParentOrThrow(),i=m;if(!n.is(r)&&r.isInline())do i=r,r=r.getParentOrThrow();while(r.isInline());if(o.type===`text`&&(c!==0||m.getTextContent()===``)||o.type===`element`&&m.getIndexWithinParent()<c){if(P(m)&&!Io(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){let e=N(m.getTextContent());m.replace(e),m=e}U(o.getNode())||o.type!==`text`||(m=m.spliceText(0,c,``)),t.add(m.__key)}else{let e=m.getParentOrThrow();e.canBeEmpty()||e.getChildrenSize()!==1?m.remove():e.remove()}}else t.add(m.__key);let a=r.getChildren(),p=new Set(l),h=n.is(r),g=n.isInline()&&d.getNextSibling()===null?n:d;for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.is(d)||V(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(i)?h||g.insertAfter(t,!1):t.remove())}if(!h){let e=r,n=null;for(;e!==null;){let r=e.getChildren(),i=r.length;(i===0||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(Io(d)){if(s===f)d.select();else{let t=N(e);t.select(),d.replace(t)}}else d=d.spliceText(s,f-s,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=e.length));for(let e=1;e<u;e++){let n=l[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=I()===this;Lc(this,Hc(Rc(this))),e&&I()!==this&&es(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void Ko(null);let n=this.getNodes(),r=[];for(let e of n)P(e)&&r.push(e);let i=t=>{n.forEach(n=>{if(V(n)){let r=n.getFormatFlags(e,t);n.setTextFormat(r)}})},a=r.length;if(a===0)return this.toggleFormat(e),Ko(null),void i(t);let o=this.anchor,s=this.focus,c=this.isBackward(),l=c?s:o,u=c?o:s,d=0,f=r[0],p=l.type===`element`?0:l.offset;if(l.type===`text`&&p===f.getTextContentSize()&&(d=1,f=r[1],p=0),f==null)return;let m=f.getFormatFlags(e,t);i(m);let h=a-1,g=r[h],_=u.type===`text`?u.offset:g.getTextContentSize();if(f.is(g)){if(p===_)return;if(Lo(f)||p===0&&_===f.getTextContentSize())f.setFormat(m);else{let e=f.splitText(p,_),t=p===0?e[0]:e[1];t.setFormat(m),l.type===`text`&&l.set(t.__key,0,`text`),u.type===`text`&&u.set(t.__key,_-p,`text`)}this.format=m;return}p===0||Lo(f)||([,f]=f.splitText(p),p=0),f.setFormat(m);let v=g.getFormatFlags(e,m);_>0&&(_===g.getTextContentSize()||Lo(g)||([g]=g.splitText(_)),g.setFormat(v));for(let t=d+1;t<h;t++){let n=r[t],i=n.getFormatFlags(e,v);n.setFormat(i)}l.type===`text`&&l.set(f.__key,p,`text`),u.type===`text`&&u.set(g.__key,_,`text`),this.format=m|v}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key===`root`){this.insertParagraph();let t=I();return F(t)||k(134),t.insertNodes(e)}let t=(this.isBackward()?this.focus:this.anchor).getNode(),n=tc(t,Us),r=e[e.length-1];if(V(n)&&`__language`in n){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let t=Fa(this);n.splice(t,0,e),r.selectEnd()}return}if(!e.some(e=>(V(e)||H(e))&&!e.isInline())){V(n)||k(211,t.constructor.name,t.getType());let i=Fa(this);n.splice(i,0,e),r.selectEnd();return}let i=function(e){let t=W(),n=null;for(let r=0;r<e.length;r++){let i=e[r],a=M(i);if(a||H(i)&&i.isInline()||V(i)&&i.isInline()||P(i)||i.isParentRequired()){if(n===null&&(n=i.createParentElementNode(),t.append(n),a))continue;n!==null&&n.append(i)}else t.append(i),n=null}return t}(e),a=i.getLastDescendant(),o=i.getChildren(),s=!V(n)||!n.isEmpty()?this.insertParagraph():null,c=o[o.length-1],l=o[0];var u;V(u=l)&&Us(u)&&!u.isEmpty()&&V(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(V(n)||k(211,t.constructor.name,t.getType()),n.append(...l.getChildren()),l=o[1]),l&&(n===null&&k(212,t.constructor.name,t.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||k(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(n,l));let d=tc(a,Us);s&&V(d)&&(s.canMergeWhenEmpty()||Us(c))&&(d.append(...s.getChildren()),s.remove()),V(n)&&n.isEmpty()&&n.remove(),a.selectEnd();let f=V(n)?n.getLastChild():null;M(f)&&d!==n&&f.remove()}insertParagraph(){if(this.anchor.key===`root`){let e=W();return K().splice(this.anchor.offset,0,[e]),e.select(),e}let e=Fa(this),t=tc(this.anchor.getNode(),Us);V(t)||k(213);let n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(e){let t=Ri();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],r=e[t-1],[i,a]=pa(this),o=this.isBackward(),[s,c]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[l,u]=o?[a,i]:[i,a];if(t===0)return[];if(t===1){if(P(n)&&!this.isCollapsed()){let e=n.splitText(l,u),t=l===0?e[0]:e[1];return t?(s.set(t.getKey(),0,`text`),c.set(t.getKey(),t.getTextContentSize(),`text`),[t]):[]}return[n]}if(P(n)&&(l===n.getTextContentSize()?e.shift():l!==0&&([,n]=n.splitText(l),e[0]=n,s.set(n.getKey(),0,`text`))),P(r)){let t=r.getTextContent().length;u===0?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),`text`))}return e}modify(e,t,n){if(La(this,e,t,n))return;let r=e===`move`,i=B(),a=Is(Os(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();if(s===null||o===null||!V(c)||c.isInline()||c.canBeEmpty()||Fs(o,i,s),this.dirty){let e=xs(i,this.anchor.key),t=xs(i,this.focus.key);this.anchor.type===`text`&&(e=Bo(e)),this.focus.type===`text`&&(t=Bo(t)),e&&t&&ja(a,e,this.anchor.offset,t,this.focus.offset)}if(function(e,t,n,r){e.modify(t,n,r)}(a,e,t?`backward`:`forward`,n),a.rangeCount>0){let e=a.getRangeAt(0),n=this.anchor.getNode(),i=U(n)?n:ks(n);if(this.applyDOMRange(e),this.dirty=!0,!r){let n=this.getNodes(),r=[],o=!1;for(let e=0;e<n.length;e++){let t=n[e];Es(t,i)?r.push(t):o=!0}if(o&&r.length>0){if(t){let e=r[0];V(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{let e=r[r.length-1];V(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}}a.anchorNode===e.startContainer&&a.anchorOffset===e.startOffset||function(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}(this)}}n===`lineboundary`&&La(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&V(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(V(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=Tc(Pc(t,e?`previous`:`next`));if(r.getTextSlices().every(e=>e===null||e.distance===0)){let e={type:`initial`};for(let t of r.iterNodeCarets(`shadowRoot`))if(fc(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(V(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=Uc(t);Lc(this,Dc(e,e)),r.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(dc(t)){if(V(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(H(t.origin)){if(!t.origin.isIsolated()){if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&V(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=wa();e.add(t.origin.getKey()),es(e)}else t.origin.remove()}return}break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return Lc(this,Dc(!t.origin.isEmpty()&&n.isEmpty()?zc(gc(n,t.direction)):r.anchor,t)),this.removeText()}}let i=this.focus;if(this.modify(`extend`,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&ma(this,t.getNode()))return}else{let r=i.type===`text`?i.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=i.offset,a=r.getTextContentSize();if(r.is(n)||e&&t!==a||!e&&t!==0)return void ga(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void ga(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,a=r.offset,o=e<a,s=o?e:a,c=o?a:e,l=c-1;s!==l&&(function(e){return!(ns(e)||ha(e))})(i.getTextContent().slice(s,c))&&(t?r.set(r.key,l,r.type):n.set(n.key,l,n.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0){let e=this.anchor.getNode();e.isEmpty()&&U(e.getParent())&&e.getPreviousSibling()===null&&ma(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify(`extend`,e,`lineboundary`),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify(`extend`,e,`word`)}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function da(e){return e instanceof la}function fa(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function pa(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,r]=t;return n.type===`element`&&r.type===`element`&&n.key===r.key&&n.offset===r.offset?[0,0]:[fa(n),fa(r)]}function ma(e,t){for(let n=t;n;n=n.getParent()){if(V(n)){if(n.collapseAtStart(e))return!0;if(As(n))break}if(n.getPreviousSibling())break}return!1}var ha=(()=>{try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1})();function ga(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function _a(e,t,n,r){let i,a=t;if(Y(e)){let o=!1,s=e.childNodes,c=s.length,l=r._blockCursorElement;a===c&&(o=!0,a=c-1);let u=s[a],d=!1;if(u===l)u=s[a+1],d=!0;else if(l!==null){let n=l.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,l)&&a--}if(i=ts(u),P(i))a=vc(i,o?`next`:`previous`);else{let s=ts(e);if(s===null)return null;if(V(s)){let c=r.getElementByKey(s.getKey());c===null&&k(214);let l=s.getDOMSlot(c);[s,a]=l.resolveChildIndex(s,c,e,t),V(s)||k(215),o&&a>=s.getChildrenSize()&&(a=Math.max(0,s.getChildrenSize()-1));let u=s.getChildAtIndex(a);if(V(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=o?u.getLastDescendant():u.getFirstDescendant();e===null?s=u:(u=e,s=V(u)?u:u.getParentOrThrow()),a=0}P(u)?(i=u,s=null,a=vc(u,o?`next`:`previous`)):u!==s&&o&&!d&&(V(s)||k(216),a=Math.min(s.getChildrenSize(),a+1))}else{let n=s.getIndexWithinParent();a=t===0&&H(s)&&ts(e)===s?n:n+1,s=s.getParentOrThrow()}if(V(s))return oa(s.__key,a,`element`)}}else i=ts(e);return P(i)?oa(i.__key,vc(i,a,`clamp`),`text`):null}function va(e,t,n){let r=e.offset,i=e.getNode();if(r===0){let r=i.getPreviousSibling(),a=i.getParent();if(t){if((n||!t)&&r===null&&V(a)&&a.isInline()){let t=a.getPreviousSibling();P(t)&&e.set(t.__key,t.getTextContent().length,`text`)}}else V(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),`element`):P(r)&&e.set(r.__key,r.getTextContent().length,`text`)}else if(r===i.getTextContent().length){let r=i.getNextSibling(),a=i.getParent();if(t&&V(r)&&r.isInline())e.set(r.__key,0,`element`);else if((n||t)&&r===null&&V(a)&&a.isInline()&&!a.canInsertTextAfter()){let t=a.getNextSibling();P(t)&&e.set(t.__key,0,`text`)}}}function ya(e,t,n){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);va(e,n,r),va(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function ba(e,t,n,r,i,a){if(e===null||n===null||!jo(i,e,n))return null;let o=_a(e,t,F(a)?a.anchor:null,i);if(o===null)return null;let s=_a(n,r,F(a)?a.focus:null,i);if(s===null)return null;if(o.type===`element`&&s.type===`element`){let t=ts(e),r=ts(n);if(H(t)&&H(r))return null}return ya(o,s),[o,s]}function xa(e){return V(e)&&!e.isInline()}function Sa(e,t,n,r,i,a){let o=Wa(),s=new ua(oa(e,t,i),oa(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Ca(){return new ua(oa(`root`,0,`element`),oa(`root`,0,`element`),0,``)}function wa(){return new la(new Set)}function Ta(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=!Wt&&(s||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),l,u,d,f;if(F(e)&&!c)return e.clone();if(t===null)return null;if(l=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,(s||o===void 0)&&F(e)&&!jo(n,l,u))return e.clone();let p=ba(l,d,u,f,n,e);if(p===null)return null;let[m,h]=p,g=0,_=``;if(F(e)){let t=e.anchor;if(m.key===t.key)g=e.format,_=e.style;else{let e=m.getNode();P(e)?(g=e.getFormat(),_=e.getStyle()):V(e)&&(g=e.getTextFormat(),_=e.getTextStyle())}}return new ua(m,h,g,_)}function I(){return Wa()._selection}function Ea(){return B()._editorState._selection}function Da(e,t,n,r=1){let i=e.anchor,a=e.focus,o=i.getNode(),s=a.getNode();if(!t.is(o)&&!t.is(s))return;let c=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(c,n,`element`),a.set(c,n,`element`),Oa(e)}}else{let o=e.isBackward(),s=o?a:i,l=s.getNode(),u=o?i:a,d=u.getNode();if(t.is(l)){let e=s.offset;(n<=e&&r>0||n<e&&r<0)&&s.set(c,Math.max(0,e+r),`element`)}if(t.is(d)){let e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(c,Math.max(0,e+r),`element`)}}Oa(e)}function Oa(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,a=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!V(a))return;let e=a.getChildrenSize(),i=n>=e,o=i?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(P(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,`text`),r.set(o.__key,e,`text`)}}else{if(V(a)){let e=a.getChildrenSize(),r=n>=e,i=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(P(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,`text`)}}if(V(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(P(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,`text`)}}}}function ka(e,t,n,r,i){let a=null,o=0,s=null;r===null?i!==null&&(a=i.__key,P(i)?s=`text`:V(i)&&(s=`element`)):(a=r.__key,P(r)?(o=r.getTextContentSize(),s=`text`):V(r)&&(o=r.getChildrenSize(),s=`element`)),a!==null&&s!==null?e.set(a,o,s):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,`element`))}function Aa(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function ja(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function Ma(e,t,n){let r=xs(e,t.getKey());if(V(t)){let e=t.getDOMSlot(r);return[e.element,n+e.getFirstChildOffset()]}return[r,n]}function Na(e,t,n,r,i,a,o){let s=r.anchorNode,c=r.focusNode,l=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has(`collaboration`)&&d!==a||d!==null&&Ao(d))return;if(!F(t))return void(e!==null&&jo(n,s,c)&&r.removeAllRanges());let f=t.anchor,p=t.focus,m=f.getNode(),h=p.getNode(),[g,_]=Ma(n,m,f.offset),[v,y]=Ma(n,h,p.offset),b=t.format,x=t.style,S=t.isCollapsed(),C=g,w=v,ee=!1;var te,ne,re,ie,ae;if(f.type===`text`?(C=Bo(g),ee=m.getFormat()!==b||m.getStyle()!==x):F(e)&&e.anchor.type===`text`&&(ee=!0),p.type===`text`&&(w=Bo(v)),C!==null&&w!==null&&(S&&(e===null||ee||F(e)&&(e.format!==b||e.style!==x))&&(te=b,ne=x,re=_,ie=f.key,ae=performance.now(),ci=[te,ne,re,ie,ae]),l!==_||u!==y||s!==C||c!==w||r.type===`Range`&&S||(d!==null&&a.contains(d)||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0}),f.type===`element`))){if(ja(r,C,_,w,y),!ft||!t.isCollapsed()||a===null||i.has(`skip-selection-focus`)||document.activeElement!==null&&a.contains(document.activeElement)||a.focus({preventScroll:!0}),!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===document.activeElement){let e=F(t)&&t.anchor.type===`element`?C.childNodes[_]||null:r.rangeCount>0?r.getRangeAt(0):null;if(e!==null){let t;if(e instanceof Text){let n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();(function(e,t,n){let r=Cs(n),i=Ds(r);if(r===null||i===null)return;let{top:a,bottom:o}=t,s=0,c=0,l=n;for(;l!==null;){let t=l===r.body;if(t)s=0,c=Os(e).innerHeight;else{let e=l.getBoundingClientRect();s=e.top,c=e.bottom}let n=0;if(a<s?n=-(s-a):o>c&&(n=o-c),n!==0){if(t)i.scrollBy(0,n);else{let e=l.scrollTop;l.scrollTop+=n;let t=l.scrollTop-e;a-=t,o-=t}}if(t)break;l=Ss(l)}})(n,t,a)}}ti=!0}}function Pa(e){let t=I()||Ea();t===null&&(t=K().selectEnd()),t.insertNodes(e)}function Fa(e){let t=e;e.isCollapsed()||t.removeText();let n=I();F(n)&&(t=n),F(t)||k(161);let r=t.anchor,i=r.getNode(),a=r.offset;for(;!Us(i);){let e=i;if([i,a]=Ia(i,a),e.is(i))break}return a}function Ia(e,t){let n=e.getParent();if(!n){let e=W();return K().append(e),e.select(),[K(),0]}if(P(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let i=t===0?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!V(e)||t===0)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new ua(oa(e.__key,t,`element`),oa(e.__key,t,`element`),0,``),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function La(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=Pc(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`;if(!Wc(c)){for(let e of c){l=!1;let{origin:t}=e;if(!H(t)||t.isIsolated()||(c=e,!o||!t.isInline()))break}if(l)for(let e of Tc(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(fc(e))e.origin.isInline()||(c=e);else{if(V(e.origin))continue;H(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&H(c.origin)&&c.origin.isKeyboardSelectable()){let e=wa();return e.add(c.origin.getKey()),es(e),!0}return c=Uc(c),s&&Fc(e.anchor,c),Fc(e.focus,c),l||!o}var L=null,R=null,Ra=!1,za=!1,Ba=0,Va={characterData:!0,childList:!0,subtree:!0};function Ha(){return Ra||L!==null&&L._readOnly}function z(){Ra&&k(13)}function Ua(){Ba>99&&k(14)}function Wa(){return L===null&&k(195,Ga()),L}function B(){return R===null&&k(196,Ga()),R}function Ga(){let e=0,t=new Set,n=So.version;if(typeof window<`u`)for(let r of document.querySelectorAll(`[contenteditable]`)){let i=Po(r);if(Mo(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function Ka(){return R}function qa(e,t,n){let r=t.__type,i=Eo(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function Ja(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function Ya(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function Xa(e){return Za(e,B()._nodes)}function Za(e,t){let n=e.type,r=t.get(n);r===void 0&&k(17,n);let i=r.klass;e.type!==i.getType()&&k(18,i.name);let a=i.importJSON(e),o=e.children;if(V(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Za(o[e],t);a.append(n)}return a}function Qa(e,t,n){let r=L,i=Ra,a=R;L=t,Ra=!0,R=e;try{return n()}finally{L=r,Ra=i,R=a}}function $a(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return;let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=L,u=Ra,d=R,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){R=e,L=n,Ra=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=Xn(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),za)throw t;yo(e,null,r,n),$t(e),e._dirtyType=2,za=!0,$a(e,a),za=!1;return}finally{p.observe(r,Va),e._updating=f,L=l,Ra=u,R=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags,y=e._deferred;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=Zo(e)),delete r[a])}(e,n);let b=i?null:Is(Os(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){R=e,L=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&Fs(t,e,r),Na(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(F(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(document.activeElement)){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())Ps(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);if(t!==null&&Ps(t)){let n=t.getPreviousSibling();(n===null||Ps(n))&&(s=!0,c=e.getElementByKey(t.__key))}}if(s){let n=e.getElementByKey(a.__key);r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=document.createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=Jc(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&Fs(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,Va),R=d,L=l}}m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a),F(s)||s===null||o!==null&&o.is(s)||e.dispatchCommand(Qn,void 0);let x=e._pendingDecorators;x!==null&&(e._decorators=x,e._pendingDecorators=null,eo(`decorator`,e,!0,x)),function(e,t,n){let r=Qo(t),i=Qo(n);r!==i&&eo(`textcontent`,e,!0,i)}(e,t||a,n),eo(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v}),function(e,t){if(e._deferred=[],t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,y),function(e){let t=e._updates;if(t.length!==0){let n=t.shift();if(n){let[t,r]=n;no(e,t,r)}}}(e)}function eo(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=i}}function to(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&k(191),a._flushSync=!0),o&&e._deferred.push(o),Ya(e,i.tag)),a==null?no(e,n,i):n()}}return r}function no(e,t,n){let r=e._updateTags,i,a=!1,o=!1;n!==void 0&&(i=n.onUpdate,Ya(e,n.tag),a=n.skipTransforms||!1,o=n.discrete||!1),i&&e._deferred.push(i);let s=e._editorState,c=e._pendingEditorState,l=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=uo(c||s),l=!0),c._flushSync=o;let u=L,d=Ra,f=R,p=e._updating;L=c,Ra=!1,e._updating=!0,R=e;let m=e._headless||e.getRootElement()===null;wo(null);try{l&&(m?s._selection!==null&&(c._selection=s._selection.clone()):c._selection=function(e,t){let n=e.getEditorState()._selection,r=Is(Os(e));return F(n)||n==null?Ta(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),a=to(e,a),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(F(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),e._dirtyType!==0&&(a?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);P(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&gn(t)}}(c,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=qo(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);P(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&gn(r),r!==void 0&&Ja(r,a)&&qa(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){Ba++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&Ja(c,a)&&qa(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,Ba++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),to(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(V(t)&&Ut(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of o)a.delete(e);for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(i.has(e)||n.delete(e),a.delete(e))}}(s,c,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(c._flushSync=!0);let i=c._selection;if(F(i)){let e=c._nodeMap,t=i.anchor.key,n=i.focus.key;e.get(t)!==void 0&&e.get(n)!==void 0||k(19)}else da(i)&&i._nodes.size===0&&(c._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),$a(e);return}finally{L=u,Ra=d,R=f,e._updating=p,Ba=0}e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(c,e)?c._flushSync?(c._flushSync=!1,$a(e)):l&&Oo(()=>{$a(e)}):(c._flushSync=!1,l&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function ro(e,t,n){R===e&&n===void 0?t():no(e,t,n)}var io=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&k(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&k(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&k(224),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{let t=e===`decorator`&&(yt||ht||mt);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName===`IMG`?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName===`IMG`))return;this.removeManagedLineBreak()}let n=this.element,r=this.before,i=document.createElement(`br`);if(n.insertBefore(i,r),e){let e=document.createElement(`img`);e.setAttribute(`data-lexical-linebreak`,`true`),e.style.cssText=`display: inline !important; border: 0px !important; margin: 0px !important;`,e.alt=``,n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}let i=ao(t,n);i.push(r);let a=ao(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function ao(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&k(225),n.reverse()}var oo=class extends ji{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return zt[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=B()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;t!==null;){if(P(t)&&e.push(t),V(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;V(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;V(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return V(e)&&e.getLastDescendant()||e||null}let r=t[e];return V(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:G(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&k(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:G(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&k(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=``,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),V(i)&&r!==n-1&&!i.isInline()&&(e+=At)}return e}getTextContentSize(){let e=0,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),V(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=Rt[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=It[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Vo(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){z();let n=I(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(P(e)||V(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(P(e)||V(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return F(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):Sa(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e===``?0:Rt[e],this}setStyle(e){return this.getWritable().__style=e||``,this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){Ai(this)&&k(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||k(226,String(e),String(t),String(r));let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}if(t>0){let e=l===null?this.getFirstChild():l.getNextSibling();for(let n=0;n<t;n++){e===null&&k(100);let t=e.getNextSibling(),n=e.__key;Wo(e.getWritable()),s.push(n),e=t}}let d=l;for(let e of n){d!==null&&e.is(d)&&(l=d=d.getPreviousSibling());let t=e.getWritable();t.__parent===a&&u--,Wo(t);let n=e.__key;if(d===null)i.__first=n,t.__prev=null;else{let e=d.getWritable();e.__next=n,t.__prev=e.__key}e.__key===a&&k(76),t.__parent=a,o.push(n),d=e}if(e+t===r)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){let e=c.getWritable();if(d!==null){let t=d.getWritable();e.__prev=d.__key,t.__next=c.__key}else e.__prev=null}if(i.__size=u,s.length){let e=I();if(F(e)){let t=new Set(s),n=new Set(o),{anchor:r,focus:i}=e;so(r,t,n)&&ka(r,r.getNode(),this,l,c),so(i,t,n)&&ka(i,i.getNode(),this,l,c),u!==0||this.canBeEmpty()||As(this)||this.remove()}}return i}getDOMSlot(e){return new io(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(Y(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t===0&&n===``||As(this)||this.getChildren().some(P)||(t!==0&&(e.textFormat=t),n!==``&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||``)}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=this.getDOMSlot(e),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());i!==null&&(r==null?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}};function V(e){return e instanceof oo}function so(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var co=class extends ji{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function H(e){return e instanceof co}var lo=class e extends oo{__cachedText;static getType(){return`root`}static clone(){return new e}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){k(51)}getTextContent(){let e=this.__cachedText;return!Ha()&&B()._dirtyType!==0||e===null?super.getTextContent():e}remove(){k(52)}replace(e){k(53)}insertBefore(e){k(54)}insertAfter(e){k(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)V(e)||H(e)||k(282);return super.splice(e,t,n)}static importJSON(e){return K().updateFromJSON(e)}collapseAtStart(){return!0}};function U(e){return e instanceof lo}function uo(e){return new mo(new Map(e._nodeMap))}function fo(){return new mo(new Map([[`root`,new lo]]))}function po(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&k(130,n.name),V(e)){let r=t.children;Array.isArray(r)||k(59,n.name);let i=e.getChildren();for(let e=0;e<i.length;e++){let t=po(i[e]);r.push(t)}}return t}var mo=class e{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Qa(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Qa(null,this,()=>({root:po(K())}))}},ho=class extends oo{static getType(){return`artificial`}createDOM(e){return document.createElement(`div`)}},go=class e extends oo{static getType(){return`paragraph`}static clone(t){return new e(t.__key)}createDOM(e){let t=document.createElement(`p`),n=gs(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:_o,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Y(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return W().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let t=this.getChildren().find(P);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=W();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(e.length===0||P(e[0])&&e[0].getTextContent().trim()===``){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function _o(e){let t=W();if(e.style&&(t.setFormat(e.style.textAlign),Xs(e,t)),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in Rt&&t.setFormat(n)}return{node:t}}function W(){return js(new go)}function vo(e){return e instanceof go}function yo(e,t,n,r){let i=e._keyToDOMMap;i.clear(),e._editorState=fo(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let a=e._observer;a!==null&&(a.disconnect(),e._observer=null),t!==null&&(t.textContent=``),n!==null&&(n.textContent=``,i.set(`root`,n))}function bo(e){let t=new Set,n=new Set,r=e;for(;r;){let{ownNodeConfig:e}=$s(r),i=r.transform;if(!n.has(i)){n.add(i);let e=r.transform();e&&t.add(e)}if(e){let n=e.$transform;n&&t.add(n),r=e.extends}else{let e=Object.getPrototypeOf(r);r=e.prototype instanceof ji&&e!==ji?e:void 0}}return t}function xo(e){let t=e||{},n=Ka(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=fo(),s=t.namespace||(i===null?is():i._config.namespace),c=t.editorState,l=[lo,Ki,Ii,na,go,ho,...t.nodes||[]],{onError:u,html:d}=t,f=t.editable===void 0||t.editable,p;if(e===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let e=0;e<l.length;e++){let t=l[e],n=null,r=null;if(typeof t!=`function`){let e=t;t=e.replace,n=e.with,r=e.withKlass||null}$s(t);let i=t.getType(),a=bo(t);p.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:an(l[e]),transforms:a})}}let m=new So(o,i,p,{disableEvents:a,namespace:s,theme:r},u||console.error,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(p,d?d.import:void 0),f,e);return c!==void 0&&(m._pendingEditorState=c,m._dirtyType=2),function(e){e.registerCommand(tr,hi,0),e.registerCommand(nr,gi,0),e.registerCommand(rr,_i,0),e.registerCommand(ir,vi,0),e.registerCommand(gr,bi,0)}(m),m}var So=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,n,r,i,a,o,s){this._createEditorArgs=s,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=is(),this._onError=i,this._htmlConversions=a,this._editable=o,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){let t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){let t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){let t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){let t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){let t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){n===void 0&&k(35);let r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);let i=r.get(e);i===void 0&&k(36,String(e));let a=i[n];return a.add(t),()=>{a.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&k(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=qs(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=qs(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=G(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:Ni}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return J(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=gs(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,yo(this,t,e,r),t!==null&&(this._config.disableEvents||Ei(t),n!=null&&t.classList.remove(...n)),e!==null){let t=Ds(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,$t(this),this._updateTags.add(Ni),$a(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;$r.set(e,n);let r=ei.get(n)??0;r<1&&n.addEventListener(`selectionchange`,Ci),ei.set(n,r+1),e.__lexicalEditor=t;let i=xi(e);for(let n=0;n<Jr.length;n++){let[r,a]=Jr[n],o=typeof a==`function`?e=>{Ti(e)||(wi(e),(t.isEditable()||r===`click`)&&a(e,t))}:e=>{if(Ti(e))return;wi(e);let n=t.isEditable();switch(r){case`cut`:return n&&J(t,Rr,e);case`copy`:return J(t,Lr,e);case`paste`:return n&&J(t,lr,e);case`dragstart`:return n&&J(t,Pr,e);case`dragover`:return n&&J(t,Fr,e);case`dragend`:return n&&J(t,Ir,e);case`focus`:return n&&J(t,Wr,e);case`blur`:return n&&J(t,Gr,e);case`drop`:return n&&J(t,Mr,e)}};e.addEventListener(r,o),i.push(()=>{e.removeEventListener(r,o)})}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Ni),$a(this);eo(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&k(38);let n=e;n._readOnly&&(n=uo(e),n._selection=e._selection?e._selection.clone():null),Qt(this);let r=this._pendingEditorState,i=this._updateTags,a=t===void 0?null:t.tag;r===null||r.isEmpty()||(a!=null&&i.add(a),$a(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,a!=null&&i.add(a),this._updating||$a(this)}parseEditorState(e,t){return function(e,t,n){let r=fo(),i=L,a=Ra,o=R,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,L=r,Ra=!1,R=t,wo(null);try{let i=t._nodes;Za(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,L=i,Ra=a,R=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(e){return $a(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):no(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),ro(this,()=>{let r=I(),i=K();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||es(r.clone()),ws(`focus`),Ts(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Is(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,eo(`editable`,this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}};So.version=`0.41.0+prod.esm`;var Co=null;function wo(e){Co=e}var To=1;function Eo(e,t){let n=Do(e,t);return n===void 0&&k(30,t),n}function Do(e,t){return e._nodes.get(t)}var Oo=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function ko(e){return H(Xo(e))}function Ao(e){let t=document.activeElement;if(!Y(t))return!1;let n=t.nodeName;return H(Xo(e))&&(n===`INPUT`||n===`TEXTAREA`||t.contentEditable===`true`&&Po(t)==null)}function jo(e,t,n){let r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!Ao(t)&&No(t)===e}catch{return!1}}function Mo(e){return e instanceof So}function No(e){let t=e;for(;t!=null;){let e=Po(t);if(Mo(e))return e;t=Ss(t)}return null}function Po(e){return e?e.__lexicalEditor:null}function Fo(e){return Pt.test(e)?`rtl`:Ft.test(e)?`ltr`:null}function Io(e){return ia(e)||e.isToken()}function Lo(e){return Io(e)||e.isSegmented()}function Ro(e){return zs(e)&&e.nodeType===3}function zo(e){return zs(e)&&e.nodeType===9}function Bo(e){let t=e;for(;t!=null;){if(Ro(t))return t;t=t.firstChild}return null}function Vo(e,t,n){let r=It[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~It.superscript:t===`superscript`?i&=~It.subscript:t===`lowercase`?(i&=~It.uppercase,i&=~It.capitalize):t===`uppercase`?(i&=~It.lowercase,i&=~It.capitalize):t===`capitalize`&&(i&=~It.lowercase,i&=~It.uppercase),i}function Ho(e){return P(e)||M(e)||H(e)}function Uo(e,t){let n=function(){let e=Co;return Co=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);z(),Ua();let r=B(),i=Wa(),a=``+To++;i._nodeMap.set(a,e),V(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.add(a),r._dirtyType=1,e.__key=a}function Wo(e){let t=e.getParent();if(t!==null){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),o=a===null?null:a.__key,s=i===null?null:i.__key,c=i===null?null:i.getWritable(),l=a===null?null:a.getWritable();i===null&&(r.__first=o),a===null&&(r.__last=s),c!==null&&(c.__next=o),l!==null&&(l.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function Go(e){Ua(),Ai(e)&&k(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent,r=Wa(),i=B(),a=r._nodeMap,o=i._dirtyElements;n!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent}}(n,a,o);let s=t.__key;i._dirtyType=1,V(e)?o.set(s,!0):i._dirtyLeaves.add(s)}function Ko(e){z();let t=B(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=G(n);e!==null&&e.getWritable()}if(e!==null){let t=G(e);t!==null&&t.getWritable()}}}function qo(){return Ha()?null:B()._compositionKey}function G(e,t){let n=(t||Wa())._nodeMap.get(e);return n===void 0?null:n}function Jo(e,t){let n=Yo(e,B());return n===void 0?null:G(n,t)}function Yo(e,t){return e[`__lexicalKey_${t._key}`]}function Xo(e,t){let n=e;for(;n!=null;){let e=Jo(n,t);if(e!==null)return e;n=Ss(n)}return null}function Zo(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Qo(e){return e.read(()=>K().getTextContent())}function K(){return $o(Wa())}function $o(e){return e._nodeMap.get(`root`)}function es(e){z();let t=Wa();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function ts(e){let t=B(),n=function(e,t){let n=e;for(;n!=null;){let e=Yo(n,t);if(e!==void 0)return e;n=Ss(n)}return null}(e,t);return n===null?e===t.getRootElement()?G(`root`):null:G(n)}function ns(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function rs(e){let t=[],n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function is(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function as(e){return Ro(e)?e.nodeValue:null}function os(e,t,n){let r=Is(Os(t));if(r===null)return;let i=r.anchorNode,{anchorOffset:a,focusOffset:o}=r;if(i!==null){let t=as(i),r=Xo(i);if(t!==null&&P(r)){if((t===kt||t===jt)&&n){let e=n.length;t=n,a=e,o=e}t!==null&&ss(r,t,a,o,e)}}}function ss(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=t;if((o||i)&&(t.endsWith(kt)&&(s=t.slice(0,-kt.length)),i)){let e=jt,t;for(;(t=s.indexOf(e))!==-1;)s=s.slice(0,t)+s.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let c=a.getTextContent();if(i||s!==c){if(s===``){if(Ko(null),mt||ht||yt)a.remove();else{let e=B();setTimeout(()=>{e.update(()=>{a.isAttached()&&a.remove()})},20)}return}let t=a.getParent(),i=Ea(),c=a.getTextContentSize(),l=qo(),u=a.getKey();if(a.isToken()||l!==null&&u===l&&!o||F(i)&&(t!==null&&!t.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===e.__key&&i.anchor.offset===0&&!a.canInsertTextBefore()&&!o||i.focus.key===e.__key&&i.focus.offset===c&&!a.canInsertTextAfter()&&!o))return void a.markDirty();let d=I();if(!F(d)||n===null||r===null)return void cs(a,s,d);if(d.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=N(a.getTextContent());a.replace(e),a=e}cs(a,s,d)}}}function cs(e,t,n){if(e.setTextContent(t),F(n)){let t=e.getKey();for(let r of[`anchor`,`focus`]){let i=n[r];i.type===`text`&&i.key===t&&(i.offset=vc(e,i.offset,`clamp`))}}}function ls(e,t,n){let r=t[n]||!1;return r===`any`||r===e[n]}function us(e,t){return ls(e,t,`altKey`)&&ls(e,t,`ctrlKey`)&&ls(e,t,`shiftKey`)&&ls(e,t,`metaKey`)}function q(e,t,n){if(!us(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;let r=`Key`+t.toUpperCase();return e.code===r}var ds={ctrlKey:!dt,metaKey:dt},fs={altKey:dt,ctrlKey:!dt};function ps(e){return e.key===`Backspace`}function ms(e){return q(e,`a`,ds)}function hs(e){let t=K();if(F(e)){let t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),_n(e),e}{let e=t.select(0,t.getChildrenSize());return es(_n(e)),e}}function gs(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=Jc(i);return n[t]=e,e}return i}function _s(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&k(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function vs(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function ys(e,t){let n=e.offset;if(e.type===`element`)return vs(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?vs(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function bs(e){let t=Os(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function J(e,t,n){return function(e,t,n){let r=rs(e);for(let i=4;i>=0;i--)for(let a=0;a<r.length;a++){let o=r[a],s=o._commands.get(t);if(s!==void 0){let t=s[i];if(t!==void 0){let r=Array.from(t),i=r.length,a=!1;if(ro(o,()=>{for(let t=0;t<i;t++)if(r[t](n,e))return void(a=!0)}),a)return a}}}return!1}(e,t,n)}function xs(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&k(75,t),n}function Ss(e){let t=e.assignedSlot||e.parentElement;return Bs(t)?t.host:t}function Cs(e){return zo(e)?e:Y(e)?e.ownerDocument:null}function ws(e){z(),B()._updateTags.add(e)}function Ts(e){z(),B()._deferred.push(e)}function Es(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Ds(e){let t=Cs(e);return t?t.defaultView:null}function Os(e){let t=e._window;return t===null&&k(78),t}function ks(e){let t=e.getParentOrThrow();for(;t!==null;){if(As(t))return t;t=t.getParentOrThrow()}return t}function As(e){return U(e)||V(e)&&e.isShadowRoot()}function js(e){let t=B(),n=e.getType(),r=Do(t,n);r===void 0&&k(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||k(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||k(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&k(203,e.constructor.name,n,r.name,r.getType()),t}return e}function Ms(e,t){!U(e.getParent())||V(t)||H(t)||k(99)}function Ns(e){let t=G(e);return t===null&&k(63,e),t}function Ps(e){return(H(e)||V(e)&&!e.canBeEmpty())&&!e.isInline()}function Fs(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function Is(e){return lt?(e||window).getSelection():null}function Ls(e){let t=Ds(e);return t?t.getSelection():null}function Rs(e){return Y(e)&&e.tagName===`A`}function Y(e){return zs(e)&&e.nodeType===1}function zs(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Bs(e){return zs(e)&&e.nodeType===11}function Vs(e){let t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,`i`);return e.nodeName.match(t)!==null}function Hs(e){let t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,`i`);return e.nodeName.match(t)!==null}function Us(e){if(H(e)&&!e.isInline())return!0;if(!V(e)||As(e))return!1;let t=e.getFirstChild(),n=t===null||M(t)||P(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Ws(){return B()}var Gs=new WeakMap,Ks=new Map;function qs(e){if(!e._readOnly&&e.isEmpty())return Ks;e._readOnly||k(192);let t=Gs.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),Gs.set(e,t)),t}function Js(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function Ys(e){return(t=Js(e))[ki]=!0,t;var t}function Xs(e,t){let n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function Zs(e){return!0===e.__lexicalUnmanaged}function Qs(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==ji[t]}function $s(e){let t=Ht in e.prototype?e.prototype[Ht]():void 0,n=function(e){if(!(e===ji||e.prototype instanceof ji)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{So.version&&(n=JSON.parse(So.version))}catch{}k(290,e.name,t,n)}return e===co||e===oo||e===ji}(e),r=!n&&Qs(e,`getType`)?e.getType():void 0,i,a=r;if(t){if(r)i=t[r];else for(let[e,n]of Object.entries(t))a=e,i=n}if(!n&&a&&(Qs(e,`getType`)||(e.getType=()=>a),Qs(e,`clone`)||(e.clone=t=>(wo(t),new e)),Qs(e,`importJSON`)||(e.importJSON=i&&i.$importJSON||(t=>new e().updateFromJSON(t))),!Qs(e,`importDOM`)&&i)){let{importDOM:t}=i;t&&(e.importDOM=()=>t)}return{ownNodeConfig:i,ownNodeType:a}}function ec(e){let t=Ws();return z(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var tc=(e,t)=>{let n=e;for(;n!=null&&!U(n);){if(t(n))return n;n=n.getParent()}return null},nc={next:`previous`,previous:`next`},rc=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Oc({hasNext:dc,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return gc(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return gc(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&k(263,Array.from(o).join(` `))}else i.insert(e);i=gc(e,this.direction)}for(let e of o.values())e.remove();return this}},ic=class e extends rc{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:bc(e,this.direction)}getParentCaret(e=`root`){return gc(sc(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=oc(this.direction);return gc(this.getNodeAtCaret(),e)||bc(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},ac={root:U,shadowRoot:As};function oc(e){return nc[e]}function sc(e,t=`root`){return ac[t](e)?null:e}var cc=class e extends rc{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:gc(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return V(this.origin)?bc(this.origin,this.direction):null}getParentCaret(e=`root`){return gc(sc(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=oc(this.direction);return gc(this.getNodeAtCaret(),e)||bc(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof lc)&&this.direction===t.direction&&this.origin.is(t.origin)}},lc=class e extends rc{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:_c(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return gc(sc(this.getParentAtCaret(),e),this.direction)}getFlipped(){return _c(this.origin,oc(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof cc||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return gc(this.origin,this.direction)}};function uc(e){return e instanceof lc}function dc(e){return e instanceof cc}function fc(e){return e instanceof ic}var pc={next:class extends lc{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends lc{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},mc={next:class extends cc{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends cc{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},hc={next:class extends ic{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends ic{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function gc(e,t){return e?new mc[t](e):null}function _c(e,t,n){return e?new pc[t](e,vc(e,n)):null}function vc(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&ct(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function yc(e,t){return new wc(e,t)}function bc(e,t){return V(e)?new hc[t](e):null}function xc(e){return e&&e.getChildCaret()||e}function Sc(e){return e&&xc(e.getAdjacentCaret())}var Cc=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return uc(t)?function(e,t){let{direction:n,origin:r}=e;return yc(e,vc(r,t===`focus`?oc(n):n)-e.offset)}(t,e):null},t=e(`anchor`),n=e(`focus`);if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[yc(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=uc(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=uc(n),i=t=>t.isSameNodeCaret(n)?null:Sc(t)||t.getParentCaret(e);return Oc({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},wc=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return _c(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function Tc(e){return Dc(e,gc(K(),e.direction))}function Ec(e){return Dc(e,e)}function Dc(e,t){return e.direction!==t.direction&&k(265),new Cc(e,t,e.direction)}function Oc(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function kc(e,t){let n=Nc(e.origin,t.origin);switch(n===null&&k(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:{let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return Ac(n)}}function Ac(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function jc(e,t){return t.is(e)}function Mc(e){return V(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Nc(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=Mc(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=Mc(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(jc(e,r)||k(276),{commonAncestor:r,type:`ancestor`}):i===null?(jc(t,r)||k(277),{commonAncestor:r,type:`descendant`}):((V(a)||jc(e,a))&&(V(i)||jc(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||k(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function Pc(e,t){let{type:n,key:r,offset:i}=e,a=Ns(e.key);return n===`text`?(P(a)||k(266,a.getType(),r),_c(a,t,i)):(V(a)||k(267,a.getType(),r),qc(a,e.offset,t))}function Fc(e,t){let{origin:n,direction:r}=t,i=r===`next`;uc(t)?e.set(n.getKey(),t.offset,`text`):dc(t)?P(n)?e.set(n.getKey(),vc(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(fc(t)&&V(n)||k(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function Ic(e){let t=I(),n=F(t)?t:Ca();return Lc(n,e),es(n),n}function Lc(e,t){Fc(e.anchor,t.anchor),Fc(e.focus,t.focus)}function Rc(e){let{anchor:t,focus:n}=e,r=Pc(t,`next`),i=Pc(n,`next`),a=kc(r,i)<=0?`next`:`previous`;return Dc(Gc(r,a),Gc(i,a))}function zc(e){let{direction:t,origin:n}=e,r=gc(n,oc(t)).getNodeAtCaret();return r?gc(r,t):bc(n.getParentOrThrow(),t)}function Bc(e,t=`root`){let n=[e];for(let r=fc(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(zc(r));return n}function Vc(e){return!!e&&e.origin.isAttached()}function Hc(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=Kc(e,r),o=Bc(a.anchor,n),s=Bc(a.focus.getFlipped(),n),c=new Set,l=[];for(let e of a.iterNodeCarets(n))if(fc(e))c.add(e.origin.getKey());else if(dc(e)){let{origin:t}=e;V(t)&&!c.has(t.getKey())||l.push(t)}for(let e of l)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=zc(gc(t,r)),c=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||c===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(c===`segmented`){let e=t.origin,n=N(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=_c(n,r,t.offset)}n.is(o[0].origin)&&(o[0]=t),n.is(s[0].origin)&&(s[0]=t.getFlipped())}}let u,d;for(let e of o)if(Vc(e)){u=Uc(e);break}for(let e of s)if(Vc(e)){d=Uc(e);break}let f=function(e,t,n){if(!e||!t)return null;let r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;let a=r.getParents().reverse();a.push(r);let o=i.getParents().reverse();o.push(i);let s=Math.min(a.length,o.length),c=0;for(;c<s&&a[c]===o[c];c++);let l=(e,t)=>{let n;for(let r=c;r<e.length;r++){let i=e[r];if(As(i))return;!n&&t(i)&&(n=i)}return n},u=l(a,Us),d=u&&l(o,e=>n.has(e.getKey())&&Us(e));return u&&d?[u,d]:null}(u,d,c);if(f){let[e,t]=f;bc(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}let p=[u,d,...o,...s].find(Vc);if(p)return Ec(Gc(Uc(p),e.direction));k(269,JSON.stringify(o.map(e=>e.origin.__key)))}function Uc(e){let t=function(e){let t=e;for(;fc(t);){let e=Sc(t);if(!fc(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(P(t.origin))return uc(t)?t:_c(t.origin,n,n);let r=t.getAdjacentCaret();return dc(r)&&P(r.origin)?_c(r.origin,n,oc(n)):t}function Wc(e){return uc(e)&&e.offset!==vc(e.origin,e.direction)}function Gc(e,t){return e.direction===t?e:e.getFlipped()}function Kc(e,t){return e.direction===t?e:Dc(Gc(e.focus,t),Gc(e.anchor,t))}function qc(e,t,n){let r=bc(e,`next`);for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(e===null)break;r=e}return Gc(r,n)}function Jc(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function Yc(e,...t){let n=Jc(...t);n.length>0&&e.classList.add(...n)}function Xc(e,...t){let n=Jc(...t);n.length>0&&e.classList.remove(...n)}function Zc(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}var Qc=new Map;function $c(e){let t={};if(!e)return t;let n=e.split(`;`);for(let e of n)if(e!==``){let[n,r]=e.split(/:([^]+)/);n&&r&&(t[n.trim()]=r.trim())}return t}function el(e){let t=Qc.get(e);return t===void 0&&(t=$c(e),Qc.set(e,t)),t}function tl(e){let t=Ws().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function nl(e){return tl(U(e)?e:e.getParentOrThrow())}function rl(e){let t=nl(e);return t!==null&&t.direction===`rtl`}function il(e,t,n=`self`){let r=e.getStartEndPoints();if(t.isSelected(e)&&!Lo(t)&&r!==null){let[i,a]=r,o=e.isBackward(),s=i.getNode(),c=a.getNode(),l=t.is(s),u=t.is(c);if(l||u){let[r,i]=pa(e),a=s.is(c),l=t.is(o?c:s),u=t.is(o?s:c),d,f=0;a?(f=r>i?i:r,d=r>i?r:i):l?(f=o?i:r,d=void 0):u&&(f=0,d=o?r:i);let p=t.__text.slice(f,d);p!==t.__text&&(n===`clone`&&(t=Ys(t)),t.__text=p)}}return t}function al(e){let t=e.getStyle(),n=$c(t);Qc.set(t,n)}function ol(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function sl(e,t,n=ol){if(e===null)return;let r=e.getStartEndPoints(),i=new Map,a=null;if(r){let[e,t]=r;a=Ca(),a.anchor.set(e.key,e.offset,e.type),a.focus.set(t.key,t.offset,t.type);let n=tc(e.getNode(),Us),o=tc(t.getNode(),Us);V(n)&&i.set(n.getKey(),n),V(o)&&i.set(o.getKey(),o)}for(let t of e.getNodes())if(V(t)&&Us(t))i.set(t.getKey(),t);else if(r===null){let e=tc(t,Us);V(e)&&i.set(e.getKey(),e)}for(let[e,r]of i){let i=t();n(r,i),r.replace(i,!0),a&&(e===a.anchor.key&&a.anchor.set(i.getKey(),a.anchor.offset,a.anchor.type),e===a.focus.key&&a.focus.set(i.getKey(),a.focus.offset,a.focus.type))}a&&e.is(I())&&es(a)}function cl(e){let t=ll(e);return t!==null&&t.writingMode===`vertical-rl`}function ll(e){let t=e.anchor.getNode();return V(t)?tl(t):nl(t)}function ul(e,t){let n=cl(e)?!t:t;fl(e)&&(n=!n);let r=Pc(e.focus,n?`previous`:`next`);if(Wc(r))return!1;for(let e of Tc(r)){if(fc(e))return!e.origin.isInline();if(!V(e.origin)){if(H(e.origin))return!0;break}}return!1}function dl(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function fl(e){let t=ll(e);return t!==null&&t.direction===`rtl`}function pl(e,t,n){let r=fl(e),i;i=cl(e)||r?!n:n,dl(e,t,i,`character`)}function ml(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var hl=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,gl=hl&&`documentMode`in document?document.documentMode:null;hl&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),hl&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),hl&&`InputEvent`in window&&!gl&&`getTargetRanges`in new window.InputEvent(`input`),hl&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),hl&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,hl&&/Android/.test(navigator.userAgent),hl&&/^(?=.*Chrome).*/i.test(navigator.userAgent),hl&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);function _l(e){return e?e.getAdjacentCaret():null}function vl(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function yl(e){let t=tc(e,e=>V(e)&&!e.isInline());return V(t)||ml(4,e.__key),t}function bl(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function xl(e){let t=I();if(!F(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let i=r[t],a=i.getKey();if(n.has(a))continue;let o=tc(i,e=>V(e)&&!e.isInline());if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}function Sl(e,t){let n=zo(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!Tl.has(t.nodeName)){let n=El(t,e,i,!1);n!==null&&(r=r.concat(n))}return function(e){for(let t of e)t.getNextSibling()instanceof ho&&t.insertAfter(Ri());for(let t of e){let e=t.getChildren();for(let n of e)t.insertBefore(n);t.remove()}}(i),r}function Cl(e,t){if(typeof document>`u`||typeof window>`u`&&global.window===void 0)throw Error(`To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.`);let n=document.createElement(`div`),r=K().getChildren();for(let i=0;i<r.length;i++)wl(e,r[i],n,t);return n.innerHTML}function wl(e,t,n,r=null){let i=r===null||t.isSelected(r),a=V(t)&&t.excludeFromCopy(`html`),o=t;r!==null&&P(t)&&(o=il(r,t,`clone`));let s=V(o)?o.getChildren():[],c=Do(e,o.getType()),l;l=c&&c.exportDOM!==void 0?c.exportDOM(e,o):o.exportDOM(e);let{element:u,after:d}=l;if(!u)return!1;let f=document.createDocumentFragment();for(let n=0;n<s.length;n++){let a=s[n],o=wl(e,a,f,r);!i&&V(t)&&o&&t.extractWithChild(a,r,`html`)&&(i=!0)}if(i&&!a){if((Y(u)||Bs(u))&&u.append(f),n.append(u),d){let e=d.call(o,u);e&&(Bs(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(f);return i}var Tl=new Set([`STYLE`,`SCRIPT`]);function El(e,t,n,r,i=new Map,a){let o=[];if(Tl.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!As(s))&&(s!=null&&xa(s)||r);for(let e=0;e<d.length;e++)f.push(...El(d[e],t,n,p,new Map(i),s));return u!=null&&(f=u(f)),Hs(e)&&(f=Dl(e,f,p?()=>{let e=new ho;return n.push(e),e}:W)),s==null?f.length>0?o=o.concat(f):Hs(e)&&function(e){return e.nextSibling==null||e.previousSibling==null?!1:Vs(e.nextSibling)&&Vs(e.previousSibling)}(e)&&(o=o.concat(Ri())):V(s)&&s.append(...f),o}function Dl(e,t,n){let r=e.style.textAlign,i=[],a=[];for(let e=0;e<t.length;e++){let o=t[e];if(xa(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(a.push(o),e===t.length-1||e<t.length-1&&xa(t[e+1])){let e=n();e.setFormat(r),e.append(...a),i.push(e),a=[]}}return i}function Ol(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function kl(e,t=I()){return t??Ol(166),F(t)&&t.isCollapsed()||t.getNodes().length===0?``:Cl(e,t)}function Al(e,t=I()){return t??Ol(166),F(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(Pl(e,t))}function jl(e,t,n){let r=e.getData(`application/x-lexical-editor`);if(r)try{let e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return Ml(n,Fl(e.nodes),t)}catch(e){console.error(e)}let i=e.getData(`text/html`),a=e.getData(`text/plain`);if(i&&a!==i)try{return Ml(n,Sl(n,new DOMParser().parseFromString(function(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy(`lexical`,{createHTML:e=>e}).createHTML(e):e}(i),`text/html`)),t)}catch(e){console.error(e)}let o=a||e.getData(`text/uri-list`);if(o!=null){if(F(t)){let e=o.split(/(\r?\n|\t)/);e[e.length-1]===``&&e.pop();for(let t=0;t<e.length;t++){let n=I();if(F(n)){let r=e[t];r===`
12
- `||r===`\r
13
- `?n.insertParagraph():r===` `?n.insertNodes([ra()]):n.insertText(r)}}}else t.insertRawText(o)}}function Ml(e,t,n){e.dispatchCommand($n,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(F(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=Pc(t,`previous`);if(r){if(uc(r))n=r.origin;else{let e=Dc(r,bc(K(),`next`).getFlipped());for(let t of e){if(P(t.origin)){n=t.origin;break}if(V(t.origin)&&!t.origin.isInline())break}}}if(n&&P(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function Nl(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=V(n)&&n.excludeFromCopy(`html`),o=n;t!==null&&P(o)&&(o=il(t,o,`clone`));let s=V(o)?o.getChildren():[],c=function(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Ol(58,n.name),V(e)){let e=t.children;Array.isArray(e)||Ol(59,n.name)}return t}(o);P(o)&&o.getTextContentSize()===0&&(i=!1);for(let r=0;r<s.length;r++){let a=s[r],o=Nl(e,t,a,c.children);!i&&V(n)&&o&&n.extractWithChild(a,t,`clone`)&&(i=!0)}if(i&&!a)r.push(c);else if(Array.isArray(c.children))for(let e=0;e<c.children.length;e++){let t=c.children[e];r.push(t)}return i}function Pl(e,t){let n=[],r=K().getChildren();for(let i=0;i<r.length;i++)Nl(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}function Fl(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=Xa(r);P(i)&&al(i),t.push(i)}return t}var Il=null;async function Ll(e,t,n){if(Il!==null)return!1;if(t!==null)return new Promise((r,i)=>{e.update(()=>{r(Rl(e,t,n))})});let r=e.getRootElement(),i=e._window||window,a=i.document,o=Is(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.cssText=`position: fixed; top: -1000px;`,s.append(a.createTextNode(`#`)),r.append(s);let c=new Range;return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise((t,r)=>{let o=e.registerCommand(Lr,r=>(bl(r,ClipboardEvent)&&(o(),Il!==null&&(i.clearTimeout(Il),Il=null),t(Rl(e,r,n))),!0),4);Il=i.setTimeout(()=>{o(),Il=null,t(!1)},50),a.execCommand(`copy`),s.remove()})}function Rl(e,t,n){if(n===void 0){let t=Is(e._window),r=I();if(!r||r.isCollapsed()||!t)return!1;let i=t.anchorNode,a=t.focusNode;if(i!==null&&a!==null&&!jo(e,i,a))return!1;n=Bl(r)}t.preventDefault();let r=t.clipboardData;return r!==null&&(Vl(r,n),!0)}var zl=[[`text/html`,kl],[`application/x-lexical-editor`,Al]];function Bl(e=I()){let t={"text/plain":e?e.getTextContent():``};if(e){let n=Ws();for(let[r,i]of zl){let a=i(n,e);a!==null&&(t[r]=a)}}return t}function Vl(e,t){for(let[n]of zl)t[n]===void 0&&e.setData(n,``);for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}var Hl=Symbol.for(`preact-signals`);function Ul(){if(Kl>1)return void Kl--;let e,t=!1;for(;Wl!==void 0;){let n=Wl;for(Wl=void 0,ql++;n!==void 0;){let r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Zl(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(ql=0,Kl--,t)throw e}var X,Wl;function Gl(e){let t=X;X=void 0;try{return e()}finally{X=t}}var Kl=0,ql=0,Jl=0;function Yl(e){if(X===void 0)return;let t=e.n;return t===void 0||t.t!==X?(t={i:0,S:e,p:X.s,n:void 0,t:X,e:void 0,x:void 0,r:t},X.s!==void 0&&(X.s.n=t),X.s=t,e.n=t,32&X.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=X.s,t.n=void 0,X.s.n=t,X.s=t),t):void 0}function Xl(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Zl(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Ql(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function $l(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function eu(e,t){Xl.call(this,void 0),this.x=e,this.s=void 0,this.g=Jl-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function tu(e){let t=e.u;if(e.u=void 0,typeof t==`function`){Kl++;let n=X;X=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,nu(e),t}finally{X=n,Ul()}}}function nu(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,tu(e)}function ru(e){if(X!==this)throw Error(`Out-of-order effect`);$l(this),X=e,this.f&=-2,8&this.f&&nu(this),Ul()}function iu(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function au(e,t){let n=new iu(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}Xl.prototype.brand=Hl,Xl.prototype.h=function(){return!0},Xl.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?Gl(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},Xl.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&Gl(()=>{var e;(e=this.Z)==null||e.call(this)}))}},Xl.prototype.subscribe=function(e){return au(()=>{let t=this.value,n=X;X=void 0;try{e(t)}finally{X=n}},{name:`sub`})},Xl.prototype.valueOf=function(){return this.value},Xl.prototype.toString=function(){return this.value+``},Xl.prototype.toJSON=function(){return this.value},Xl.prototype.peek=function(){let e=X;X=void 0;try{return this.value}finally{X=e}},Object.defineProperty(Xl.prototype,"value",{get(){let e=Yl(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(ql>100)throw Error(`Cycle detected`);this.v=e,this.i++,Jl++,Kl++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Ul()}}}}),eu.prototype=new Xl,eu.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Jl))return!0;if(this.g=Jl,this.f|=1,this.i>0&&!Zl(this))return this.f&=-2,!0;let e=X;try{Ql(this),X=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return X=e,$l(this),this.f&=-2,!0},eu.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Xl.prototype.S.call(this,e)},eu.prototype.U=function(e){if(this.t!==void 0&&(Xl.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},eu.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(eu.prototype,"value",{get(){if(1&this.f)throw Error(`Cycle detected`);let e=Yl(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),iu.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.u=e)}finally{e()}},iu.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,tu(this),Ql(this),Kl++;let e=X;return X=this,ru.bind(this,e)},iu.prototype.N=function(){2&this.f||(this.f|=2,this.o=Wl,Wl=this)},iu.prototype.d=function(){this.f|=8,1&this.f||nu(this)},iu.prototype.dispose=function(){this.d()},tn(`format`,{parse:e=>typeof e==`number`?e:0});var ou=class e extends co{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return cu().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:su,priority:0})}}exportDOM(){return{element:document.createElement(`hr`)}}createDOM(e){let t=document.createElement(`hr`);return Yc(t,e.theme.hr),t}getTextContent(){return`
14
- `}isInline(){return!1}updateDOM(){return!1}};function su(){return{node:cu()}}function cu(){return ec(ou)}function lu(e,t){if(document.caretRangeFromPoint!==void 0){let n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!==`undefined`){let n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}var uu=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,du=uu&&`documentMode`in document?document.documentMode:null,fu=uu&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),pu=!(!uu||!(`InputEvent`in window)||du)&&`getTargetRanges`in new window.InputEvent(`input`),mu=uu&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),hu=uu&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,gu=uu&&/^(?=.*Chrome).*/i.test(navigator.userAgent),_u=uu&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&fu&&!gu,vu=j(`DRAG_DROP_PASTE_FILE`),yu=class e extends oo{static getType(){return`quote`}static clone(t){return new e(t.__key)}createDOM(e){let t=document.createElement(`blockquote`);return Yc(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:Tu,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Y(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return bu().updateFromJSON(e)}insertNewAfter(e,t){let n=W(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){let e=W();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function bu(){return js(new yu)}function xu(e){return e instanceof yu}var Su=class e extends oo{__tag;static getType(){return`heading`}static clone(t){return new e(t.__tag,t.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){let t=this.getWritable();return this.__tag=e,t}createDOM(e){let t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];Yc(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:wu,priority:0}),h2:e=>({conversion:wu,priority:0}),h3:e=>({conversion:wu,priority:0}),h4:e=>({conversion:wu,priority:0}),h5:e=>({conversion:wu,priority:0}),h6:e=>({conversion:wu,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&Cu(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Cu(e)?{conversion:e=>({node:Eu(`h1`)}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Y(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return Eu(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?W():Eu(this.getTag()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),n===0&&!this.isEmpty()&&e){let e=W();e.select(),this.replace(e,!0)}return i}collapseAtStart(){let e=this.isEmpty()?W():Eu(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function Cu(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function wu(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=Eu(t),e.style!==null&&(Xs(e,n),n.setFormat(e.style.textAlign))),{node:n}}function Tu(e){let t=bu();return e.style!==null&&(t.setFormat(e.style.textAlign),Xs(e,t)),{node:t}}function Eu(e=`h1`){return js(new Su(e))}function Du(e){return e instanceof Su}function Ou(e){let t=null;if(bl(e,DragEvent)?t=e.dataTransfer:bl(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function ku(e){return H(Xo(e))}function Au(e){for(let t of[`lowercase`,`uppercase`,`capitalize`])e.hasFormat(t)&&e.toggleFormat(t)}function ju(e){return Zc(e.registerCommand(er,e=>{let t=I();return!!da(t)&&(t.clear(),!0)},0),e.registerCommand(ar,e=>{let t=I();return F(t)?(t.deleteCharacter(e),!0):!!da(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(dr,e=>{let t=I();return!!F(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(fr,e=>{let t=I();return!!F(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(cr,t=>{let n=I();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)jl(r,n,e);else if(F(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(ur,()=>{let e=I();return!!F(e)&&(e.removeText(),!0)},0),e.registerCommand(pr,e=>{let t=I();return!!F(t)&&(t.formatText(e),!0)},0),e.registerCommand(Nr,e=>{let t=I();if(!F(t)&&!da(t))return!1;let n=t.getNodes();for(let t of n){let n=tc(t,e=>V(e)&&!e.isInline());n!==null&&n.setFormat(e)}return!0},0),e.registerCommand(or,e=>{let t=I();return!!F(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(sr,()=>{let e=I();return!!F(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(kr,()=>{let e=ra(),t=I();return F(t)&&(e.setFormat(t.format),e.setStyle(t.style)),Pa([e]),!0},0),e.registerCommand(Ar,()=>xl(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(jr,()=>xl(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(xr,e=>{let t=I();if(da(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}else if(F(t)){let n=ys(t.focus,!0);if(!e.shiftKey&&H(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1},0),e.registerCommand(Sr,e=>{let t=I();if(da(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}else if(F(t)){if(function(e){let t=e.focus;return t.key===`root`&&t.offset===K().getChildrenSize()}(t))return e.preventDefault(),!0;let n=ys(t.focus,!1);if(!e.shiftKey&&H(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1},0),e.registerCommand(yr,e=>{let t=I();if(da(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),rl(n[0])?n[0].selectNext(0,0):n[0].selectPrevious(),!0}if(!F(t))return!1;if(ul(t,!0)){let n=e.shiftKey;return e.preventDefault(),pl(t,n,!0),!0}return!1},0),e.registerCommand(_r,e=>{let t=I();if(da(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),rl(n[0])?n[0].selectPrevious():n[0].selectNext(0,0),!0}if(!F(t))return!1;let n=e.shiftKey;return!!ul(t,!1)&&(e.preventDefault(),pl(t,n,!1),!0)},0),e.registerCommand(Tr,t=>{if(ku(t.target))return!1;let n=I();if(F(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(U(n))return!1;let r=yl(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(jr,void 0);if(hu&&navigator.language===`ko-KR`)return!1}else if(!da(n))return!1;return t.preventDefault(),e.dispatchCommand(ar,!0)},0),e.registerCommand(Dr,t=>{if(ku(t.target))return!1;let n=I();return!(!F(n)&&!da(n))&&(t.preventDefault(),e.dispatchCommand(ar,!1))},0),e.registerCommand(Cr,t=>{let n=I();if(!F(n))return!1;if(Au(n),t!==null){if((hu||mu||_u)&&pu)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(or,!1)}return e.dispatchCommand(sr,void 0)},0),e.registerCommand(Er,()=>!!F(I())&&(e.blur(),!0),0),e.registerCommand(Mr,t=>{let[,n]=Ou(t);if(n.length>0){let r=lu(t.clientX,t.clientY);if(r!==null){let{offset:t,node:i}=r,a=Xo(i);if(a!==null){let e=Ca();if(P(a))e.anchor.set(a.getKey(),t,`text`),e.focus.set(a.getKey(),t,`text`);else{let t=a.getParentOrThrow().getKey(),n=a.getIndexWithinParent()+1;e.anchor.set(t,n,`element`),e.focus.set(t,n,`element`)}es(_n(e))}e.dispatchCommand(vu,n)}return t.preventDefault(),!0}return!!F(I())},0),e.registerCommand(Pr,e=>{let[t]=Ou(e),n=I();return!(t&&!F(n))},0),e.registerCommand(Fr,e=>{let[t]=Ou(e),n=I();if(t&&!F(n))return!1;let r=lu(e.clientX,e.clientY);return r!==null&&H(Xo(r.node))&&e.preventDefault(),!0},0),e.registerCommand(zr,()=>(hs(),!0),0),e.registerCommand(Lr,t=>(Ll(e,bl(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(Rr,t=>(async function(e,t){await Ll(t,bl(e,ClipboardEvent)?e:null),t.update(()=>{let e=I();F(e)?e.removeText():da(e)&&e.getNodes().forEach(e=>e.remove())})}(t,e),!0),0),e.registerCommand(lr,t=>{let[,n,r]=Ou(t);return n.length>0&&!r?(e.dispatchCommand(vu,n),!0):zs(t.target)&&Ao(t.target)?!1:I()!==null&&(function(e,t){e.preventDefault(),t.update(()=>{let n=I(),r=bl(e,InputEvent)||bl(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&jl(r,n,t)},{tag:`paste`})}(t,e),!0)},0),e.registerCommand(wr,e=>{let t=I();return F(t)&&Au(t),!1},0),e.registerCommand(Or,e=>{let t=I();return F(t)&&Au(t),!1},0))}function Mu(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(F(a)&&F(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||U(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&P(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!P(l)||!P(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}function Nu(e,t){let n=Date.now(),r=0,i=Date.now(),a=0,o=null;return(s,c,l,u,d,f)=>{let p=Date.now();if(f.has(`composition-start`)&&(i=n,a=r,o=s),f.has(`historic`))return r=0,n=p,2;f.has(`composition-end`)&&o&&(n=i,r=a,s=o);let m=Mu(s,c,u,d,e.isComposing()),h=(()=>{let i=l===null||l.editor===e,a=f.has(Mi);if(!a&&i&&f.has(`history-merge`))return 0;if(m===1)return 2;if(s===null)return 1;let o=c._selection;if(!(u.size>0||d.size>0))return o===null?2:0;let h=typeof t==`number`?t:t.peek();return!1===a&&m!==0&&m===r&&p<n+h&&i||u.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(F(a)&&F(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!P(r)||!P(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(u)[0],s,c)?0:1})();return n=p,r=m,h}}function Pu(e){e.undoStack=[],e.redoStack=[],e.current=null}function Fu(e,t,n){let r=Nu(e,n);return Zc(e.registerCommand(mr,()=>(function(e,t){let n=t.redoStack,r=t.undoStack;if(r.length!==0){let i=t.current,a=r.pop();i!==null&&(n.push(i),e.dispatchCommand(Hr,!0)),r.length===0&&e.dispatchCommand(Ur,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:`historic`})}}(e,t),!0),0),e.registerCommand(hr,()=>(function(e,t){let n=t.redoStack,r=t.undoStack;if(n.length!==0){let i=t.current;i!==null&&(r.push(i),e.dispatchCommand(Ur,!0));let a=n.pop();n.length===0&&e.dispatchCommand(Hr,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:`historic`})}}(e,t),!0),0),e.registerCommand(Br,()=>(Pu(t),!1),0),e.registerCommand(Vr,()=>(Pu(t),e.dispatchCommand(Hr,!1),e.dispatchCommand(Ur,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:i,dirtyLeaves:a,dirtyElements:o,tags:s})=>{let c=t.current,l=t.redoStack,u=t.undoStack,d=c===null?null:c.editorState;if(c!==null&&n===d)return;let f=r(i,n,c,a,o,s);if(f===1)l.length!==0&&(t.redoStack=[],e.dispatchCommand(Hr,!1)),c!==null&&(u.push({...c}),e.dispatchCommand(Ur,!0));else if(f===2)return;t.current={editor:e,editorState:n}}))}function Iu(){return{current:null,redoStack:[],undoStack:[]}}function Lu(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Ru(e){let t=1,n=e.getParent();for(;n!=null;){if(Z(n)){let e=n.getParent();if(Q(e)){t++,n=e.getParent();continue}Lu(40)}return t}return t}function zu(e){let t=e.getParent();Q(t)||Lu(40);let n=t;for(;n!==null;)n=n.getParent(),Q(n)&&(t=n);return t}function Bu(e){let t=[],n=e.getChildren().filter(Z);for(let e=0;e<n.length;e++){let r=n[e],i=r.getFirstChild();Q(i)?t=t.concat(Bu(i)):t.push(r)}return t}function Vu(e){return Z(e)&&Q(e.getFirstChild())}function Hu(e){return nd().append(e)}function Uu(e,t){return Z(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function Wu(e){let t=I();if(t!==null){let n=t.getNodes();if(F(t)){let r=t.getStartEndPoints();r===null&&Lu(143);let[i]=r,a=i.getNode(),o=a.getParent();if(As(a)){let e=a.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=W();a.append(e),n=e.select().getNodes()}}else if(Uu(a,n)){let t=cd(e);if(As(o)){a.replace(t);let e=nd();V(a)&&(e.setFormat(a.getFormatType()),e.setIndent(a.getIndent())),t.append(e)}else if(Z(a)){let e=a.getParentOrThrow();Gu(t,e.getChildren()),e.replace(t)}return}}let r=new Set;for(let t=0;t<n.length;t++){let i=n[t];if(V(i)&&i.isEmpty()&&!Z(i)&&!r.has(i.getKey())){Ku(i,e);continue}let a=Ho(i)?i.getParent():Z(i)&&i.isEmpty()?i:null;for(;a!=null;){let t=a.getKey();if(Q(a)){if(!r.has(t)){let n=cd(e);Gu(n,a.getChildren()),a.replace(n),r.add(t)}break}{let n=a.getParent();if(As(n)&&!r.has(t)){r.add(t),Ku(a,e);break}a=n}}}}}function Gu(e,t){e.splice(e.getChildrenSize(),0,t)}function Ku(e,t){if(Q(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),i=nd(),a;if(Gu(i,e.getChildren()),Q(n)&&t===n.getListType())n.append(i),Q(r)&&t===r.getListType()&&(Gu(n,r.getChildren()),r.remove()),a=n;else if(Q(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),a=r;else{let n=cd(t);n.append(i),e.replace(n),a=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let o=I();return F(o)&&(a.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,`element`),a.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,`element`)),e.remove(),a}function qu(e,t){let n=e.getLastChild(),r=t.getFirstChild();n&&r&&Vu(n)&&Vu(r)&&(qu(n.getFirstChild(),r.getFirstChild()),r.remove());let i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function Ju(){let e=I();if(F(e)){let t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(Uu(r,n))t.add(zu(r));else for(let e=0;e<n.length;e++){let r=n[e];if(Ho(r)){let e=vl(r,$u);e!=null&&t.add(zu(e))}}for(let n of t){let t=n,r=Bu(n);for(let n of r){let r=W().setTextStyle(e.style).setTextFormat(e.format);Gu(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&Fc(e.anchor,Uc(bc(r,`next`))),n.__key===e.focus.key&&Fc(e.focus,Uc(bc(r,`next`))),n.remove()}n.remove()}}}function Yu(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())Z(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),Q(r.getFirstChild())||n++)}function Xu(e){let t=new Set;if(Vu(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(Vu(r)&&Vu(i)){let n=i.getFirstChild();if(Q(n)){n.append(e);let i=r.getFirstChild();Q(i)&&(Gu(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(Vu(r)){let t=r.getFirstChild();if(Q(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(Vu(i)){let t=i.getFirstChild();Q(t)&&t.append(e)}else if(Q(n)){let t=nd().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),a=cd(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function Zu(e){if(Vu(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(Q(n?n.getParent():void 0)&&Z(n)&&Q(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=t.getListType(),i=nd(),a=cd(r);i.append(a),e.getPreviousSiblings().forEach(e=>a.append(e));let o=nd(),s=cd(r);o.append(s),Gu(s,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(e)}}}function Qu(e=!1){let t=I();if(!F(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),r=null;if(Z(n)&&n.getChildrenSize()===0)r=n;else if(P(n)){let e=n.getParent();Z(e)&&e.getChildren().every(e=>P(e)&&e.getTextContent().trim()===``)&&(r=e)}if(r===null)return!1;let i=zu(r),a=r.getParent();Q(a)||Lu(40);let o=a.getParent(),s;if(As(o))s=W(),i.insertAfter(s);else{if(!Z(o))return!1;s=nd(),o.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();let c=r.getNextSiblings();if(c.length>0){let t=e?function(e,t){return e.getStart()+t.getIndexWithinParent()}(a,r):1,n=cd(a.getListType(),t);if(Z(s)){let e=nd();e.append(n),s.insertAfter(e)}else s.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!Z(e)&&!Q(e))break;t=e}t.remove()}(r),!0}var $u=class extends oo{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{if(e.__checked==null)return;let t=e.getParent();Q(t)&&t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0)},extends:oo,importDOM:Oi({li:()=>({conversion:ed,priority:0})})})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=document.createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t,n){let r=t.getParent();!Q(r)||r.getListType()!==`check`||Q(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),n&&t.__checked===n.__checked||e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this,e),t.value=this.__value,function(e,t,n){let r=[],i=[],a=t.list,o=a?a.listitem:void 0,s;if(a&&a.nested&&(s=a.nested.listitem),o!==void 0&&r.push(...Jc(o)),a){let e=n.getParent(),t=Q(e)&&e.getListType()===`check`,o=n.getChecked();t&&!o||i.push(a.listitemUnchecked),t&&o||i.push(a.listitemChecked),t&&r.push(o?a.listitemChecked:a.listitemUnchecked)}if(s!==void 0){let e=Jc(s);n.getChildren().some(e=>Q(e))?r.push(...e):i.push(...e)}i.length>0&&Xc(e,...i),r.length>0&&Yc(e,...r)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&(i===``?t.removeAttribute(`style`):t.style.cssText=i),function(e,t,n){let r=el(t.__textStyle);for(let t in r)e.style.setProperty(`--listitem-marker-${t}`,r[t]);if(n)for(let t in el(n.__textStyle))t in r||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(V(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(Z(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!Q(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=cd(n.getListType()),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&(V(e)||Lu(139),this.getChildren().forEach(t=>{e.append(t)})),this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(Q(n)||Lu(39),Z(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){let i=cd(n.getListType());r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&Vu(t)&&Vu(n)&&(qu(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){let n=nd().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){let t=W();this.getChildren().forEach(e=>t.append(e));let n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=Z(r);if(n.getChildrenSize()===1){if(i)n.remove(),r.select();else{n.insertBefore(t),n.remove();let r=e.anchor,i=e.focus,a=t.getKey();r.type===`element`&&r.getNode().is(this)&&r.set(a,r.offset,`element`),i.type===`element`&&i.getNode().is(this)&&i.set(a,i.offset,`element`)}}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return Q(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;Z(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&Lu(117),(e=Math.floor(e))>=0||Lu(199);let t=this.getIndent();for(;t!==e;)t<e?(Xu(this),t++):(Zu(this),t--);return this}canInsertAfter(e){return Z(e)}canReplaceWith(e){return Z(e)}canMergeWith(e){return Z(e)||vo(e)}extractWithChild(e,t){if(!F(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return cd(`bullet`)}canMergeWhenEmpty(){return!0}};function ed(e){if(e.classList.contains(`task-list-item`)){for(let t of e.children)if(t.tagName===`INPUT`)return td(t)}if(e.classList.contains(`joplin-checkbox`)){for(let t of e.children)if(t.classList.contains(`checkbox-wrapper`)&&t.children.length>0&&t.children[0].tagName===`INPUT`)return td(t.children[0])}let t=e.getAttribute(`aria-checked`);return{node:nd(t===`true`||t!==`false`&&void 0)}}function td(e){return e.getAttribute(`type`)===`checkbox`?{node:nd(e.hasAttribute(`checked`))}:{node:null}}function nd(e){return js(new $u(void 0,e))}function Z(e){return e instanceof $u}var rd=class extends oo{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.getNextSibling();Q(t)&&e.getListType()===t.getListType()&&qu(e,t)})(e),Yu(e)},extends:oo,importDOM:Oi({ol:()=>({conversion:od,priority:0}),ul:()=>({conversion:od,priority:0})})})}constructor(e=`number`,t=1,n){super(n);let r=sd[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=document.createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,id(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(id(t,n.theme,this),e.__start!==this.__start&&t.setAttribute(`start`,String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return Y(t)&&(this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`)),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){let t=n[e];Z(t)||(r===n&&(r=[...n]),r[e]=nd().append(!V(t)||Q(t)||t.isInline()?t:N(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return Z(e)}};function id(e,t,n){let r=[],i=[],a=t.list;if(a!==void 0){let e=a[`${n.__tag}Depth`]||[],t=Ru(n)-1,o=t%e.length,s=e[o],c=a[n.__tag],l,u=a.nested,d=a.checklist;if(u!==void 0&&u.list&&(l=u.list),c!==void 0&&r.push(c),d!==void 0&&n.__listType===`check`&&r.push(d),s!==void 0){r.push(...Jc(s));for(let t=0;t<e.length;t++)t!==o&&i.push(n.__tag+t)}if(l!==void 0){let e=Jc(l);t>1?r.push(...e):i.push(...e)}}i.length>0&&Xc(e,...i),r.length>0&&Yc(e,...r)}function ad(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(Z(r)){t.push(r);let e=r.getChildren();e.length>1&&e.forEach(e=>{Q(e)&&t.push(Hu(e))})}else t.push(Hu(r))}return t}function od(e){let t=e.nodeName.toLowerCase(),n=null;return t===`ol`?n=cd(`number`,e.start):t===`ul`&&(n=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let t of e.childNodes)if(Y(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?cd(`check`):cd(`bullet`)),{after:ad,node:n}}var sd={ol:`number`,ul:`bullet`};function cd(e=`number`,t=1){return js(new rd(e,t))}function Q(e){return e instanceof rd}var ld=j(`UPDATE_LIST_START_COMMAND`),ud=j(`INSERT_UNORDERED_LIST_COMMAND`),dd=j(`INSERT_ORDERED_LIST_COMMAND`),fd=j(`REMOVE_LIST_COMMAND`);function pd(e,t){return Zc(e.registerCommand(dd,()=>(Wu(`number`),!0),1),e.registerCommand(ld,e=>{let{listNodeKey:t,newStart:n}=e,r=G(t);return!!Q(r)&&(r.getListType()===`number`&&(r.setStart(n),Yu(r)),!0)},1),e.registerCommand(ud,()=>(Wu(`bullet`),!0),1),e.registerCommand(fd,()=>(Ju(),!0),1),e.registerCommand(sr,()=>Qu(!!(t&&t.restoreNumbering)),1),e.registerNodeTransform($u,e=>{let t=e.getFirstChild();if(t){if(P(t)){let n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{let t=I();F(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(Ki,e=>{let t=e.getParent();if(Z(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}var md=e(t(((e,t)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){n||={};var r,a;switch(i.util.type(t)){case`Object`:if(a=i.util.objId(t),n[a])return n[a];for(var o in r={},n[a]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case`Array`:return a=i.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return`none`},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,`gi`),``),e.classList.add(`language-`+n)},currentScript:function(){if(typeof document>`u`)return null;if(document.currentScript&&document.currentScript.tagName===`SCRIPT`)return document.currentScript;try{throw Error()}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName(`script`);for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=i.languages;var a=r[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=r[e];return r[e]=o,i.languages.DFS(i.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,r,a){a||={};var o=i.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var c=t[s],l=i.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:`code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code`};i.hooks.run(`before-highlightall`,r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run(`before-all-elements-highlight`,r);for(var a=0,o;o=r.elements[a++];)i.highlightElement(o,t===!0,r.callback)},highlightElement:function(t,n,r){var a=i.util.getLanguage(t),o=i.languages[a];i.util.setLanguage(t,a);var s=t.parentElement;s&&s.nodeName.toLowerCase()===`pre`&&i.util.setLanguage(s,a);var c={element:t,language:a,grammar:o,code:t.textContent};function l(e){c.highlightedCode=e,i.hooks.run(`before-insert`,c),c.element.innerHTML=c.highlightedCode,i.hooks.run(`after-highlight`,c),i.hooks.run(`complete`,c),r&&r.call(c.element)}if(i.hooks.run(`before-sanity-check`,c),s=c.element.parentElement,s&&s.nodeName.toLowerCase()===`pre`&&!s.hasAttribute(`tabindex`)&&s.setAttribute(`tabindex`,`0`),!c.code)i.hooks.run(`complete`,c),r&&r.call(c.element);else if(i.hooks.run(`before-highlight`,c),!c.grammar)l(i.util.encode(c.code));else if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){l(e.data)},u.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else l(i.highlight(c.code,c.grammar,c.language))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run(`after-tokenize`,r),a.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new c;return l(i,i.head,e),s(e,i,t,i.head,0),d(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(n&&n.length)for(var r=0,a;a=n[r++];)a(t)}},Token:a};e.Prism=i;function a(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}a.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var r=``;return t.forEach(function(t){r+=e(t,n)}),r}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),i.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`&quot;`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function s(e,t,n,r,c,d){for(var f in n)if(n.hasOwnProperty(f)&&n[f]){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=r.next,C=c;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof a)){var ee=1,te;if(v){if(te=o(x,C,e,_),!te||te.index>=e.length)break;var ne=te.index,re=te.index+te[0].length,ie=C;for(ie+=S.value.length;ne>=ie;)S=S.next,ie+=S.value.length;if(ie-=S.value.length,C=ie,S.value instanceof a)continue;for(var ae=S;ae!==t.tail&&(ie<re||typeof ae.value==`string`);ae=ae.next)ee++,ie+=ae.value.length;ee--,w=e.slice(C,ie),te.index-=C}else if(te=o(x,0,w,_),!te)continue;var ne=te.index,T=te[0],E=w.slice(0,ne),D=w.slice(ne+T.length),oe=C+w.length;d&&oe>d.reach&&(d.reach=oe);var O=S.prev;E&&(O=l(t,O,E),C+=E.length),u(t,O,ee);var se=new a(f,g?i.tokenize(T,g):T,y,T);if(S=l(t,O,se),D&&l(t,S,D),ee>1){var ce={cause:f+`,`+m,reach:oe};s(e,t,n,S.prev,C,ce),d&&ce.reach>d.reach&&(d.reach=ce.reach)}}}}}}function c(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function d(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}if(!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener(`message`,function(t){var n=JSON.parse(t.data),r=n.language,a=n.code,o=n.immediateClose;e.postMessage(i.highlight(a,i.languages[r],r)),o&&e.close()},!1)),i;var f=i.util.currentScript();f&&(i.filename=f.src,f.hasAttribute(`data-manual`)&&(i.manual=!0));function p(){i.manual||i.highlightAll()}if(!i.manual){var m=document.readyState;m===`loading`||m===`interactive`&&f&&f.defer?document.addEventListener(`DOMContentLoaded`,p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return i}(typeof window<`u`?window:typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope?self:{});t!==void 0&&t.exports&&(t.exports=n),typeof global<`u`&&(global.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside[`attr-value`].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside[`internal-subset`].inside=n.languages.markup,n.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var a={};a[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:i},n.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(e,t){n.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend(`markup`,{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend(`clike`,{"class-name":[n.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),n.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),n.languages.markup&&(n.languages.markup.tag.addInlined(`script`,`javascript`),n.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),n.languages.js=n.languages.javascript,(function(){if(n===void 0||typeof document>`u`)return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=`Loading…`,t=function(e,t){return`✖ Error `+e+` while fetching file: `+t},r=`✖ Error: File does not exist or is empty`,i={js:`javascript`,py:`python`,rb:`ruby`,ps1:`powershell`,psm1:`powershell`,sh:`bash`,bat:`batch`,h:`c`,tex:`latex`},a=`data-src-status`,o=`loading`,s=`loaded`,c=`failed`,l=`pre[data-src]:not([`+a+`="`+s+`"]):not([`+a+`="`+o+`"])`;function u(e,n,i){var a=new XMLHttpRequest;a.open(`GET`,e,!0),a.onreadystatechange=function(){a.readyState==4&&(a.status<400&&a.responseText?n(a.responseText):a.status>=400?i(t(a.status,a.statusText)):i(r))},a.send(null)}function d(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||``);if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}n.hooks.add(`before-highlightall`,function(e){e.selector+=`, `+l}),n.hooks.add(`before-sanity-check`,function(t){var r=t.element;if(r.matches(l)){t.code=``,r.setAttribute(a,o);var f=r.appendChild(document.createElement(`CODE`));f.textContent=e;var p=r.getAttribute(`data-src`),m=t.language;if(m===`none`){var h=(/\.(\w+)$/.exec(p)||[,`none`])[1];m=i[h]||h}n.util.setLanguage(f,m),n.util.setLanguage(r,m);var g=n.plugins.autoloader;g&&g.loadLanguages(m),u(p,function(e){r.setAttribute(a,s);var t=d(r.getAttribute(`data-range`));if(t){var i=e.split(/\r\n?|\n/g),o=t[0],c=t[1]==null?i.length:t[1];o<0&&(o+=i.length),o=Math.max(0,Math.min(o-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(o,c).join(`
15
- `),r.hasAttribute(`data-start`)||r.setAttribute(`data-start`,String(o+1))}f.textContent=e,n.highlightElement(f)},function(e){r.setAttribute(a,c),f.textContent=e})}}),n.plugins.fileHighlight={highlight:function(e){for(var t=(e||document).querySelectorAll(l),r=0,i;i=t[r++];)n.highlightElement(i)}};var f=!1;n.fileHighlight=function(){f||=(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()}))(),1);Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend(`clike`,{"class-name":[Prism.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),Prism.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined(`script`,`javascript`),Prism.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside[`attr-value`].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside[`internal-subset`].inside=Prism.languages.markup,Prism.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r[`language-`+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore(`markup`,`cdata`,i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend(`markup`,{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,(function(e){function t(e){return e=e.replace(/<inner>/g,function(){return`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var n="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",r=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return n}),i=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`;e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+r+i+`(?:`+r+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+r+i+`)(?:`+r+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(n),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+r+`)`+i+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+r+`$`),inside:{"table-header":{pattern:RegExp(n),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:t(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:t(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){if(e.language!==`markdown`&&e.language!==`md`)return;function t(e){if(e&&typeof e!=`string`)for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.type!==`code`)t(i.content);else{var a=i.content[1],o=i.content[3];if(a&&o&&a.type===`code-language`&&o.type===`code-block`&&typeof a.content==`string`){var s=a.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`);s=(/[a-z][\w-]*/i.exec(s)||[``])[0].toLowerCase();var c=`language-`+s;o.alias?typeof o.alias==`string`?o.alias=[o.alias,c]:o.alias.push(c):o.alias=[c]}}}}t(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],o=/language-(.+)/.exec(a);if(o){n=o[1];break}}var s=e.languages[n];if(s)t.content=e.highlight(c(t.content),s,n);else if(n&&n!==`none`&&e.plugins.autoloader){var l=`md-`+new Date().valueOf()+`-`+Math.floor(Math.random()*0x2386f26fc10000);t.attributes.id=l,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(l);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}});var a=RegExp(e.languages.markup.tag.pattern.source,`gi`),o={amp:`&`,lt:`<`,gt:`>`,quot:`"`},s=String.fromCodePoint||String.fromCharCode;function c(e){var t=e.replace(a,``);return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){return t=t.toLowerCase(),t[0]===`#`?s(t[1]===`x`?parseInt(t.slice(2),16):Number(t.slice(1))):o[t]||e}),t}e.languages.md=e.languages.markdown})(Prism),Prism.languages.c=Prism.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(Prism),Prism.languages.objectivec=Prism.languages.extend(`c`,{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec[`class-name`],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python[`string-interpolation`].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,(function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(Prism),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(`(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:`punctuation`},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(`(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:`punctuation`},string:/[\s\S]+/}}],directive:{pattern:RegExp(`#(?:(?:elseif|if)\\b(?:[ ]*(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)`),alias:`property`,inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:`constant`},"other-directive":{pattern:/#\w+\b/,alias:`property`},attribute:{pattern:/@\w+/,alias:`atrule`},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:`function`},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:`important`},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:`constant`},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:`keyword`},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift[`string-literal`].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift}),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism),(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism),(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])})(Prism);function hd(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var gd=`javascript`;function _d(e,t){for(let n of e.childNodes){if(Y(n)&&n.tagName===t)return!0;_d(n,t)}return!1}var vd=`data-language`,yd=`data-highlight-language`,bd=`data-theme`,xd=class e extends oo{__language;__theme;__isSyntaxHighlightSupported;static getType(){return`code`}static clone(t){return new e(t.__language,t.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let t=document.createElement(`code`);Yc(t,e.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(vd,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(yd,n));let r=this.getTheme();r&&t.setAttribute(bd,r);let i=this.getStyle();return i&&t.setAttribute(`style`,i),t}updateDOM(e,t,n){let r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(vd,r):i&&t.removeAttribute(vd);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&r?r!==i&&t.setAttribute(yd,r):t.removeAttribute(yd):a&&r&&t.setAttribute(yd,r);let o=this.__theme,s=e.__theme;o?o!==s&&t.setAttribute(bd,o):s&&t.removeAttribute(bd);let c=this.__style,l=e.__style;return c?c!==l&&t.setAttribute(`style`,c):l&&t.removeAttribute(`style`),!1}exportDOM(e){let t=document.createElement(`pre`);Yc(t,e._config.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(vd,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(yd,n));let r=this.getTheme();r&&t.setAttribute(bd,r);let i=this.getStyle();return i&&t.setAttribute(`style`,i),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||_d(e,`BR`))?{conversion:wd,priority:1}:null,div:()=>({conversion:Td,priority:1}),pre:()=>({conversion:wd,priority:0}),table:e=>kd(e)?{conversion:Ed,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&kd(n)?{conversion:Dd,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&kd(t)?{conversion:Dd,priority:3}:null}}}static importJSON(e){return Sd().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){let n=this.getChildren(),r=n.length;if(r>=2&&n[r-1].getTextContent()===`
16
- `&&n[r-2].getTextContent()===`
17
- `&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===r){n[r-1].remove(),n[r-2].remove();let e=W();return this.insertAfter(e,t),e}let{anchor:i,focus:a}=e,o=(i.isBefore(a)?i:a).getNode();if(P(o)){let e=Pd(o),t=[];for(;;)if(ia(e))t.push(ra()),e=e.getNextSibling();else{if(!$(e))break;{let n=0,r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&r[n]===` `;)n++;if(n!==0&&t.push(Md(` `.repeat(n))),n!==i)break;e=e.getNextSibling()}}let n=o.splitText(i.offset)[0],r=i.offset===0?0:1,a=n.getIndexWithinParent()+r,s=o.getParentOrThrow(),c=[Ri(),...t];s.splice(a,0,c);let l=t[t.length-1];l?l.select():i.offset===0?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(Cd(o)){let{offset:t}=e.anchor;o.splice(t,0,[Ri()]),o.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){let e=W();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function Sd(e,t){return ec(xd).setLanguage(e).setTheme(t)}function Cd(e){return e instanceof xd}function wd(e){return{node:Sd(e.getAttribute(vd))}}function Td(e){let t=e,n=Od(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(Od(t))return!0;t=t.parentElement}return!1}(t)?{node:n?Sd():null}:{node:null}}function Ed(){return{node:Sd()}}function Dd(){return{node:null}}function Od(e){return e.style.fontFamily.match(`monospace`)!==null}function kd(e){return e.classList.contains(`js-file-line-container`)}var Ad=class e extends Ki{__highlightType;constructor(e=``,t,n){super(e,n),this.__highlightType=t}static getType(){return`code-highlight`}static clone(t){return new e(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e);return Yc(t,jd(e.theme,this.__highlightType)),t}updateDOM(e,t,n){let r=super.updateDOM(e,t,n),i=jd(n.theme,e.__highlightType),a=jd(n.theme,this.__highlightType);return i!==a&&(i&&Xc(t,i),a&&Yc(t,a)),r}static importJSON(e){return Md().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return Sd()}};function jd(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function Md(e=``,t){return js(new Ad(e,t))}function $(e){return e instanceof Ad}function Nd(e,t){let n=e;for(let r=gc(e,t);r&&($(r.origin)||ia(r.origin));r=_l(r))n=r.origin;return n}function Pd(e){return Nd(e,`previous`)}function Fd(e){return Nd(e,`next`)}function Id(e){let t=Pd(e),n=Fd(e),r=t;for(;r!==null;){if($(r)){let e=Fo(r.getTextContent());if(e!==null)return e}if(r===n)break;r=r.getNextSibling()}let i=t.getParent();if(V(i)){let e=i.getDirection();if(e===`ltr`||e===`rtl`)return e}return null}function Ld(e,t){let n=null,r=null,i=e,a=t,o=e.getTextContent();for(;;){if(a===0){if(i=i.getPreviousSibling(),i===null)break;if($(i)||ia(i)||M(i)||hd(167),M(i)){n={node:i,offset:1};break}a=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else a--;let e=o[a];$(i)&&e!==` `&&(r={node:i,offset:a})}if(r!==null)return r;let s=null;if(t<e.getTextContentSize())$(e)&&(s=e.getTextContent()[t]);else{let t=e.getNextSibling();$(t)&&(s=t.getTextContent()[0])}if(s!==null&&s!==` `)return n;{let r=function(e,t){let n=e,r=t,i=e.getTextContent(),a=e.getTextContentSize();for(;;){if(!$(n)||r===a){if(n=n.getNextSibling(),n===null||M(n))return null;$(n)&&(r=0,i=n.getTextContent(),a=n.getTextContentSize())}if($(n)){if(i[r]!==` `)return{node:n,offset:r};r++}}}(e,t);return r===null?n:r}}function Rd(e){let t=Fd(e);return M(t)&&hd(168),t}(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":`-`,"deleted-arrow":`<`,"inserted-sign":`+`,"inserted-arrow":`>`,unchanged:` `,diff:`!`};Object.keys(t).forEach(function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),n===`diff`&&i.push(`bold`),e.languages.diff[n]={pattern:RegExp(`^(?:[`+r+`].*(?:\r
18
- ?|
19
- |(?![\\s\\S])))+`,`m`),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(Prism);var zd=globalThis.Prism||window.Prism;function Bd(e){return typeof e==`string`?e:Array.isArray(e)?e.map(Bd).join(``):Bd(e.content)}function Vd(e,t){let n=/^diff-([\w-]+)/i.exec(t),r=e.getTextContent(),i=zd.tokenize(r,zd.languages[n?`diff`:t]);return n&&(i=function(e,t){let n=t,r=zd.languages[n],i={tokens:e},a=zd.languages.diff.PREFIXES;for(let e of i.tokens){if(typeof e==`string`||!(e.type in a)||!Array.isArray(e.content))continue;let t=e.type,n=0,i=()=>(n++,new zd.Token(`prefix`,a[t],t.replace(/^(\w+).*/,`$1`))),o=e.content.filter(e=>typeof e==`string`||e.type!==`prefix`),s=e.content.length-o.length,c=zd.tokenize(Bd(o),r);c.unshift(i());let l=/\r\n|\n/g,u=e=>{let t=[];l.lastIndex=0;let r,a=0;for(;n<s&&(r=l.exec(e));){let n=r.index+r[0].length;t.push(e.slice(a,n)),a=n,t.push(i())}if(t.length!==0)return a<e.length&&t.push(e.slice(a)),t},d=e=>{for(let t=0;t<e.length&&n<s;t++){let n=e[t];if(typeof n==`string`){let r=u(n);r&&(e.splice(t,1,...r),t+=r.length-1)}else if(typeof n.content==`string`){let e=u(n.content);e&&(n.content=e)}else Array.isArray(n.content)?d(n.content):d([n.content])}};d(c),n<s&&c.push(i()),e.content=c}return i.tokens}(i,n[1])),Hd(i)}function Hd(e,t){let n=[];for(let r of e)if(typeof r==`string`){let e=r.split(/(\n|\t)/),i=e.length;for(let r=0;r<i;r++){let i=e[r];i===`
20
- `||i===`\r
21
- `?n.push(Ri()):i===` `?n.push(ra()):i.length>0&&n.push(Md(i,t))}}else{let{content:e,alias:t}=r;typeof e==`string`?n.push(...Hd([e],r.type===`prefix`&&typeof t==`string`?t:r.type)):Array.isArray(e)&&n.push(...Hd(e,r.type===`unchanged`?void 0:r.type))}return n}var Ud={$tokenize(e,t){return Vd(e,t||this.defaultLanguage)},defaultLanguage:gd,tokenize(e,t){return zd.tokenize(e,zd.languages[t||``]||zd.languages[this.defaultLanguage])}};function Wd(e,t,n){let r=e.getParent();Cd(r)?qd(r,t,n):$(e)&&e.replace(N(e.__text))}function Gd(e,t){let n=t.getElementByKey(e.getKey());if(n===null)return;let r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let a=`1`,o=1;for(let e=0;e<i;e++)M(r[e])&&(a+=`
22
- `+ ++o);n.setAttribute(`data-gutter`,a)}var Kd=new Set;function qd(e,t,n){let r=e.getKey(),i=t.getKey()+`/`+r;if(e.getLanguage()===void 0&&e.setLanguage(n.defaultLanguage),!function(e){let t=function(e){let t=/^diff-([\w-]+)/i.exec(e);return t?t[1]:null}(e)||e;try{return!!t&&zd.languages.hasOwnProperty(t)}catch{return!1}}(e.getLanguage()||n.defaultLanguage))return e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!1),void async function(){}();e.getIsSyntaxHighlightSupported()||e.setIsSyntaxHighlightSupported(!0),Kd.has(i)||(Kd.add(i),t.update(()=>{(function(e,t){let n=G(e);if(!Cd(n)||!n.isAttached())return;let r=I();if(!F(r))return void t();let i=r.anchor,a=i.offset,o=i.type===`element`&&M(n.getChildAtIndex(i.offset-1)),s=0;if(o||(s=a+i.getNode().getPreviousSiblings().reduce((e,t)=>e+t.getTextContentSize(),0)),t()){if(o)return void i.getNode().select(a,a);n.getChildren().some(e=>{let t=P(e);if(t||M(e)){let n=e.getTextContentSize();if(t&&n>=s)return e.select(s,s),!0;s-=n}return!1})}})(r,()=>{let t=G(r);if(!Cd(t)||!t.isAttached())return!1;let i=t.getLanguage()||n.defaultLanguage,a=n.$tokenize(t,i),{from:o,to:s,nodesForReplacement:c}=function(e,t){let n=0;for(;n<e.length&&Jd(e[n],t[n]);)n++;let r=e.length,i=t.length,a=Math.min(r,i)-n,o=0;for(;o<a;)if(o++,!Jd(e[r-o],t[i-o])){o--;break}let s=n,c=r-o;return{from:s,nodesForReplacement:t.slice(n,i-o),to:c}}(t.getChildren(),a);return!(o===s&&!c.length)&&(e.splice(o,s-o,c),!0)})},{onUpdate:()=>{Kd.delete(i)},skipTransforms:!0}))}function Jd(e,t){return $(e)&&$(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||ia(e)&&ia(t)||M(e)&&M(t)}function Yd(e){if(!F(e))return!1;let t=e.anchor.getNode(),n=Cd(t)?t:t.getParent(),r=e.focus.getNode(),i=Cd(r)?r:r.getParent();return Cd(n)&&n.is(i)}function Xd(e){let t=e.getNodes(),n=[];if(t.length===1&&Cd(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){let i=t[e];$(i)||ia(i)||M(i)||hd(169),M(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){let t=e.isBackward()?e.anchor:e.focus,i=oa(r[0].getKey(),0,`text`);t.is(i)||n.push(r)}return n}function Zd(e){let t=I();if(!F(t)||!Yd(t))return!1;let n=Xd(t),r=n.length;if(r===0&&t.isCollapsed())return e===Ar&&t.insertNodes([ra()]),!0;if(r===0&&e===Ar&&t.getTextContent()===`
23
- `){let e=ra(),n=Ri(),r=t.isBackward()?`previous`:`next`;return t.insertNodes([e,n]),Ic(Kc(Dc(_c(e,`next`,0),Uc(gc(n,`next`))),r)),!0}for(let i=0;i<r;i++){let r=n[i];if(r.length>0){let n=r[0];if(i===0&&(n=Pd(n)),e===Ar){let e=ra();if(n.insertBefore(e),i===0){let r=t.isBackward()?`focus`:`anchor`,i=oa(n.getKey(),0,`text`);t[r].is(i)&&t[r].set(e.getKey(),0,`text`)}}else ia(n)&&n.remove()}}return!0}function Qd(e,t){let n=I();if(!F(n))return!1;let{anchor:r,focus:i}=n,a=r.offset,o=i.offset,s=r.getNode(),c=i.getNode(),l=e===xr;if(!Yd(n)||!$(s)&&!ia(s)||!$(c)&&!ia(c))return!1;if(!t.altKey){if(n.isCollapsed()){let e=s.getParentOrThrow();if(l&&a===0&&s.getPreviousSibling()===null){if(e.getPreviousSibling()===null)return e.selectPrevious(),t.preventDefault(),!0}else if(!l&&a===s.getTextContentSize()&&s.getNextSibling()===null&&e.getNextSibling()===null)return e.selectNext(),t.preventDefault(),!0}return!1}let u,d;if(s.isBefore(c)?(u=Pd(s),d=Fd(c)):(u=Pd(c),d=Fd(s)),u==null||d==null)return!1;let f=u.getNodesBetween(d);for(let e=0;e<f.length;e++){let t=f[e];if(!$(t)&&!ia(t)&&!M(t))return!1}t.preventDefault(),t.stopPropagation();let p=l?u.getPreviousSibling():d.getNextSibling();if(!M(p))return!0;let m=l?p.getPreviousSibling():p.getNextSibling();if(m==null)return!0;let h=($(m)||ia(m)||M(m)?l?Pd(m):Fd(m):null)??m;return p.remove(),f.forEach(e=>e.remove()),e===xr?(f.forEach(e=>h.insertBefore(e)),h.insertBefore(p)):(h.insertAfter(p),h=p,f.forEach(e=>{h.insertAfter(e),h=e})),n.setTextNodeRange(s,a,c,o),!0}function $d(e,t){let n=I();if(!F(n))return!1;let{anchor:r,focus:i}=n,a=r.getNode(),o=i.getNode(),s=e===br;if(!Yd(n)||!$(a)&&!ia(a)||!$(o)&&!ia(o))return!1;let c=o;if(Id(c)===`rtl`?!s:s){let e=Ld(c,i.offset);if(e!==null){let{node:t,offset:r}=e;M(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else c.getParentOrThrow().selectStart()}else Rd(c).select();return t.preventDefault(),t.stopPropagation(),!0}function ef(e,t){if(!e.hasNodes([xd,Ad]))throw Error(`CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor`);t??=Ud;let n=[];return!0!==e._headless&&n.push(e.registerMutationListener(xd,t=>{e.getEditorState().read(()=>{for(let[n,r]of t)if(r!==`destroyed`){let t=G(n);t!==null&&Gd(t,e)}})},{skipInitialization:!1})),n.push(e.registerNodeTransform(xd,n=>qd(n,e,t)),e.registerNodeTransform(Ki,n=>Wd(n,e,t)),e.registerNodeTransform(Ad,n=>Wd(n,e,t)),e.registerCommand(Or,t=>{let n=function(e){let t=I();if(!F(t)||!Yd(t))return null;let n=e?jr:Ar,r=e?jr:kr,i=t.anchor,a=t.focus;if(i.is(a))return r;let o=Xd(t);if(o.length!==1)return n;let s=o[0],c,l;s.length===0&&hd(285),t.isBackward()?(c=a,l=i):(c=i,l=a);let u=Pd(s[0]),d=Fd(s[0]),f=oa(u.getKey(),0,`text`),p=oa(d.getKey(),d.getTextContentSize(),`text`);return c.isBefore(f)||p.isBefore(l)?n:f.isBefore(c)||l.isBefore(p)?r:n}(t.shiftKey);return n!==null&&(t.preventDefault(),e.dispatchCommand(n,void 0),!0)},1),e.registerCommand(kr,()=>!!Yd(I())&&(Pa([ra()]),!0),1),e.registerCommand(Ar,e=>Zd(Ar),1),e.registerCommand(jr,e=>Zd(jr),1),e.registerCommand(xr,e=>{let t=I();if(!F(t)||!Yd(t))return!1;let n=K().getFirstDescendant(),{anchor:r}=t,i=r.getNode();return(!n||!i||n.getKey()!==i.getKey())&&Qd(xr,e)},1),e.registerCommand(Sr,e=>{let t=I();if(!F(t)||!Yd(t))return!1;let n=K().getLastDescendant(),{anchor:r}=t,i=r.getNode();return(!n||!i||n.getKey()!==i.getKey())&&Qd(Sr,e)},1),e.registerCommand(br,e=>$d(br,e),1),e.registerCommand(vr,e=>$d(vr,e),1)),Zc(...n)}var tf=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),nf=class e extends oo{__url;__target;__rel;__title;static getType(){return`link`}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}createDOM(e){let t=document.createElement(`a`);return this.updateLinkDOM(null,t,e),Yc(t,e.theme.link),t}updateLinkDOM(e,t,n){if(Rs(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let n of[`target`,`rel`,`title`]){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:rf,priority:1})}}static importJSON(e){return af().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=df(e);try{let t=new URL(df(e));if(!tf.has(t.protocol))return`about:blank`}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=af(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!F(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith(`mailto:`)}isWebSiteURI(){return this.__url.startsWith(`https://`)||this.__url.startsWith(`http://`)}};function rf(e){let t=null;if(Rs(e)){let n=e.textContent;(n!==null&&n!==``||e.children.length>0)&&(t=af(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:t}}function af(e=``,t){return js(new nf(e,t))}function of(e){return e instanceof nf}var sf=class e extends nf{__isUnlinked;constructor(e=``,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return`autolink`}static clone(t){return new e(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement(`span`):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return cf().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){let n=cf(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}};function cf(e=``,t){return js(new sf(e,t))}function lf(e){return e instanceof sf}var uf=/^\+?[0-9\s()-]{5,}$/;function df(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:uf.test(e)?`tel:${e}`:`https://${e}`}function ff(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function pf(e){let t=ff(e,e=>e.type);return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var mf=/[ \t\n\r\f]/,hf=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,gf=/^\s{0,3}$/;function _f(e){if(!vo(e))return!1;let t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&P(t)&&gf.test(t.getTextContent())}function vf(e,t,n,r){for(let i of t){if(!i.export)continue;let t=i.export(e,e=>yf(e,n,r));if(t!=null)return t}return V(e)?yf(e,n,r):H(e)?e.getTextContent():null}function yf(e,t,n,r,i){let a=[],o=e.getChildren();r||=[],i||=[];t:for(let e of o){for(let o of n){if(!o.export)continue;let s=o.export(e,e=>yf(e,t,n,r,[...i,...r]),(e,n)=>bf(e,n,t,r,i));if(s!=null){a.push(s);continue t}}M(e)?a.push(`
24
- `):P(e)?a.push(bf(e,e.getTextContent(),t,r,i)):V(e)?a.push(yf(e,t,n,r,i)):H(e)&&a.push(e.getTextContent())}return a.join(``)}function bf(e,t,n,r,i){let a=e.getFormat()===0?t:function(e){return e.replace(/^\s+|\s+$/g,e=>[...e].map(e=>`&#`+e.codePointAt(0)+`;`).join(``))}(t);e.hasFormat(`code`)||(a=a.replace(/([*_`~\\])/g,`\\$1`));let o=``,s=``,c=``,l=xf(e,!0),u=xf(e,!1),d=new Set;for(let t of n){let n=t.format[0],i=t.tag;Sf(e,n)&&!d.has(n)&&(d.add(n),Sf(l,n)&&r.find(e=>e.tag===i)||(r.push({format:n,tag:i}),o+=i))}for(let t=0;t<r.length;t++){let n=Sf(e,r[t].format),a=Sf(u,r[t].format);if(n&&a)continue;let o=[...r];for(;o.length>t;){let e=o.pop();i&&e&&i.find(t=>t.tag===e.tag)||(e&&typeof e.tag==`string`&&(n?a||(c+=e.tag):s+=e.tag),r.pop())}break}return a=o+a+c,s+a}function xf(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();return P(n)?n:null}function Sf(e,t){return P(e)&&e.hasFormat(t)}function Cf(e,t){let n=e.getTextContent(),r=t.fullMatchRegExpByTag["`"],i=t.transformersByTag["`"],a=[],o=null;if(r&&i){let e=new RegExp(r.source,`g`),t=Array.from(n.matchAll(e));for(let e of t){let t=e.index,n=t+e[0].length;o||={content:e[2],endIndex:n,startIndex:t,tag:"`"},a.push({end:n,start:t})}}let s=function(e,t,n=[]){let r=[],i=new Set(Object.keys(t.transformersByTag).filter(e=>e[0]!=="`").map(e=>e[0])),a=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},o=e=>n.some(t=>e>=t.start&&e<t.end),s=0;for(;s<e.length;){let t=e[s];if(!i.has(t)||a(s)||o(s)){s++;continue}let n=1;for(;s+n<e.length&&e[s+n]===t;)n++;let c=wf(t,e,s,n,!0),l=wf(t,e,s,n,!1);(c||l)&&r.push({active:!0,canClose:l,canOpen:c,char:t,index:s,length:n,originalLength:n}),s+=n}return r}(n,t,a),c=s.length>0?function(e,t,n){let r={},i=0,a=null;for(;i<t.length;){let o=t[i];if(!o.active||!o.canClose||o.length===0){i++;continue}let s=`${o.char}${o.canOpen}`,c=r[s]??-1,l=!1;for(let r=i-1;r>c;r--){let s=t[r];if(!s.active||!s.canOpen||s.length===0||s.char!==o.char||(s.canClose||o.canOpen)&&(s.originalLength+o.originalLength)%3==0&&s.originalLength%3!=0&&o.originalLength%3!=0)continue;let c=Math.min(s.length,o.length),u=Object.keys(n.transformersByTag).filter(e=>e[0]===s.char&&e.length<=c).sort((e,t)=>t.length-e.length)[0];if(!u)continue;l=!0;let d=u.length,f={content:e.slice(s.index+s.length,o.index),endIndex:o.index+d,startIndex:s.index+(s.length-d),tag:u};(!a||f.startIndex<a.startIndex||f.startIndex===a.startIndex&&f.endIndex>a.endIndex)&&(a=f);for(let e=r+1;e<i;e++)t[e].active=!1;s.length-=d,o.length-=d,s.active=s.length>0,o.length>0?o.index+=d:(o.active=!1,i++);break}l||(r[s]=i-1,o.canOpen||(o.active=!1),i++)}return a}(n,s,t):null,l=null,u=null;if(o&&c?c.startIndex<=o.startIndex&&c.endIndex>=o.endIndex?(l=c,u=t.transformersByTag[c.tag]):(l=o,u=i):o?(l=o,u=i):c&&(l=c,u=t.transformersByTag[c.tag]),!l||!u)return null;let d=[n.slice(l.startIndex,l.endIndex),l.tag,l.content];return d.index=l.startIndex,d.input=n,{endIndex:l.endIndex,match:d,startIndex:l.startIndex,transformer:u}}function wf(e,t,n,r,i){if(!Tf(t,n,r,i))return!1;if(e===`*`)return!0;if(e===`_`){if(!Tf(t,n,r,!i))return!0;let e=i?t[n-1]:t[n+r];return e!==void 0&&hf.test(e)}return!0}function Tf(e,t,n,r){let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o!==void 0&&!mf.test(o)&&(!hf.test(o)||s===void 0||mf.test(s)||hf.test(s))}function Ef(e){return P(e)&&!e.hasFormat(`code`)}function Df(e,t,n){let r=Cf(e,t),i=function(e,t){let n=e,r,i,a,o;for(let e of t){if(!e.replace||!e.importRegExp)continue;let t=n.getTextContent().match(e.importRegExp);if(!t)continue;let s=t.index||0,c=e.getEndIndex?e.getEndIndex(n,t):s+t[0].length;!1!==c&&(r===void 0||i===void 0||s<r&&(c>i||c<=r))&&(r=s,i=c,a=e,o=t)}return r===void 0||i===void 0||a===void 0||o===void 0?null:{endIndex:i,match:o,startIndex:r,transformer:a}}(e,n);if(r&&i&&(r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){let i=function(e,t,n,r,i){let a=e.getTextContent(),o,s,c;if(i[0]===a?o=e:t===0?[o,s]=e.splitText(n):[c,o,s]=e.splitText(t,n),o.setTextContent(i[2]),r)for(let e of r.format)o.hasFormat(e)||o.toggleFormat(e);return{nodeAfter:s,nodeBefore:c,transformedNode:o}}(e,r.startIndex,r.endIndex,r.transformer,r.match);Ef(i.nodeAfter)&&Df(i.nodeAfter,t,n),Ef(i.nodeBefore)&&Df(i.nodeBefore,t,n),Ef(i.transformedNode)&&Df(i.transformedNode,t,n)}else if(i){let r=function(e,t,n,r,i){let a,o,s;return t===0?[a,o]=e.splitText(n):[s,a,o]=e.splitText(t,n),r.replace?{nodeAfter:o,nodeBefore:s,transformedNode:r.replace(a,i)||void 0}:null}(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!r)return;Ef(r.nodeAfter)&&Df(r.nodeAfter,t,n),Ef(r.nodeBefore)&&Df(r.nodeBefore,t,n),Ef(r.transformedNode)&&Df(r.transformedNode,t,n)}let a=e.getTextContent().replace(/\\([*_`~\\])/g,`$1`).replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(t));e.setTextContent(a)}function Of(e,t=!1){let n=pf(e),r=function(e){let t={},n={},r=[];for(let i of e){let{tag:e}=i;t[e]=i;let a=e.replace(/(\*|\^|\+)/g,`\\$1`);r.push(a),n[e]=e.length===1?RegExp(e==="`"?"(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)":`(?<![\\\\${a}])(${a})((\\\\${a})?.*?[^${a}\\s](\\\\${a})?)((?<!\\\\)|(?<=\\\\\\\\))(${a})(?![\\\\${a}])`):RegExp(`(?<!\\\\)(${a})((\\\\${a})?.*?[^\\s](\\\\${a})?)((?<!\\\\)|(?<=\\\\\\\\))(${a})(?!\\\\)`)}return{fullMatchRegExpByTag:n,openTagsRegExp:RegExp(`(?<![\\\\])(${r.join(`|`)})`,`g`),transformersByTag:t}}(n.textFormat);return(e,i)=>{let a=e.split(`
25
- `),o=a.length,s=i||K();s.clear();for(let e=0;e<o;e++){let i=a[e],[o,c]=kf(a,e,n.multilineElement,s);o?e=c:Af(i,s,n.element,r,n.textMatch,t)}let c=s.getChildren();for(let e of c)!t&&_f(e)&&s.getChildrenSize()>1&&e.remove();I()!==null&&s.selectStart()}}function kf(e,t,n,r){for(let i of n){let{handleImportAfterStartMatch:n,regExpEnd:a,regExpStart:o,replace:s}=i,c=e[t].match(o);if(!c)continue;if(n){let a=n({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:i});if(a===null)continue;if(a)return a}let l=typeof a==`object`&&`regExp`in a?a.regExp:a,u=a&&typeof a==`object`&&`optional`in a?a.optional:!a,d=t,f=e.length;for(;d<f;){let n=l?e[d].match(l):null;if(!n&&(!u||u&&d<f-1)||n&&t===d&&n.index===c.index){d++;continue}let i=[];if(n&&t===d)i.push(e[t].slice(c[0].length,-n[0].length));else for(let r=t;r<=d;r++)if(r===t){let t=e[r].slice(c[0].length);i.push(t)}else if(r===d&&n){let t=e[r].slice(0,-n[0].length);i.push(t)}else i.push(e[r]);if(!1!==s(r,null,c,n,i,!0))return[!0,d];break}}return[!1,t]}function Af(e,t,n,r,i,a){let o=N(e),s=W();s.append(o),t.append(s);for(let{regExp:t,replace:r}of n){let n=e.match(t);if(n&&(o.setTextContent(e.slice(n[0].length)),!1!==r(s,[o],n,!0)))break}if(Df(o,r,i),s.isAttached()&&e.length>0){let e=s.getPreviousSibling();if(!a&&(vo(e)||xu(e)||Q(e))){let t=e;if(Q(e)){let n=e.getLastDescendant();t=n==null?null:tc(n,Z)}t!=null&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[Ri(),...s.getChildren()]),s.remove())}}}var jf=/^(\s*)(\d{1,})\.\s/,Mf=/^(\s*)[-*+]\s/,Nf=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,Pf=/^(#{1,6})\s/,Ff=/^>\s/,If=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,Lf=/^[ \t]*`{3,}$/,Rf=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,zf=/^(?:\|)(.+)(?:\|)\s?$/,Bf=/^(\| ?:?-*:? ?)+\|\s?$/,Vf=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Hf=/^<\/[a-z_][\w-]*\s*>/i,Uf=e=>RegExp(`(?:${e.source})$`,e.flags),Wf=tn(`mdListMarker`,{parse:e=>typeof e==`string`&&/^[-*+]$/.test(e)?e:`-`}),Gf=tn(`mdCodeFence`,{parse:e=>typeof e==`string`&&/^`{3,}$/.test(e)?e:"```"}),Kf=e=>(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)},qf=e=>(t,n,r,i)=>{let a=t.getPreviousSibling(),o=t.getNextSibling(),s=nd(e===`check`?r[3]===`x`:void 0),c=r[0].trim()[0],l=e!==`bullet`&&e!==`check`||c!==Wf.parse(c)?void 0:c;if(Q(o)&&o.getListType()===e){l&&rn(o,Wf,l);let e=o.getFirstChild();e===null?o.append(s):e.insertBefore(s),t.remove()}else if(Q(a)&&a.getListType()===e)l&&rn(a,Wf,l),a.append(s),t.remove();else{let n=cd(e,e===`number`?Number(r[2]):void 0);l&&rn(n,Wf,l),n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0);let u=function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);u&&s.setIndent(u)},Jf=(e,t,n)=>{let r=[],i=e.getChildren(),a=0;for(let o of i)if(Z(o)){if(o.getChildrenSize()===1){let e=o.getFirstChild();if(Q(e)){r.push(Jf(e,t,n+1));continue}}let i=` `.repeat(4*n),s=e.getListType(),c=nn(e,Wf),l=s===`number`?`${e.getStart()+a}. `:s===`check`?`${c} [${o.getChecked()?`x`:` `}] `:c+` `;r.push(i+l+t(o)),a++}return r.join(`
26
- `)},Yf={dependencies:[Su],export:(e,t)=>{if(!Du(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:Pf,replace:Kf(e=>Eu(`h`+e[1].length)),type:`element`},Xf={dependencies:[yu],export:(e,t)=>{if(!xu(e))return null;let n=t(e).split(`
27
- `),r=[];for(let e of n)r.push(`> `+e);return r.join(`
28
- `)},regExp:Ff,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(xu(n))return n.splice(n.getChildrenSize(),0,[Ri(),...t]),void e.remove()}let i=bu();i.append(...t),e.replace(i),r||i.select(0,0)},type:`element`},Zf={dependencies:[xd],export:e=>{if(!Cd(e))return null;let t=e.getTextContent(),n=nn(e,Gf);if(t.indexOf(n)>-1){let e=t.match(/`{3,}/g);if(e){let t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}return n+(e.getLanguage()||``)+(t?`
29
- `+t:``)+`
30
- `+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{let i=r[1],a=i.trim().length,o=e[n],s=r.index+i.length,c=o.slice(s),l=RegExp(`\`{${a},}$`);if(l.test(c)){let e=c.match(l),i=c.slice(0,c.lastIndexOf(e[0])),a=[...r];return a[2]=``,Zf.replace(t,null,a,e,[i],!0),[!0,n]}let u=RegExp(`^[ \\t]*\`{${a},}$`);for(let i=n+1;i<e.length;i++){let a=e[i];if(u.test(a)){let s=a.match(u),c=e.slice(n+1,i),l=o.slice(r[0].length);return l.length>0&&c.unshift(l),Zf.replace(t,null,r,s,c,!0),[!0,i]}}let d=e.slice(n+1),f=o.slice(r[0].length);return f.length>0&&d.unshift(f),Zf.replace(t,null,r,null,d,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:Lf},regExpStart:If,replace:(e,t,n,r,i,a)=>{let o,s,c=n[1]?n[1].trim():"```",l=n[2]||void 0;if(!t&&i){if(i.length===1)r?(o=Sd(l),s=i[0]):(o=Sd(l),s=i[0].startsWith(` `)?i[0].slice(1):i[0]);else{for(o=Sd(l),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(` `)&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();s=i.join(`
31
- `)}rn(o,Gf,c);let t=N(s);o.append(t),e.append(o)}else t&&Kf(e=>Sd(e?e[2]:void 0))(e,t,n,a)},type:`multiline-element`},Qf={dependencies:[rd,$u],export:(e,t)=>Q(e)?Jf(e,t,0):null,regExp:Mf,replace:qf(`bullet`),type:`element`},$f={dependencies:[rd,$u],export:(e,t)=>Q(e)?Jf(e,t,0):null,regExp:jf,replace:qf(`number`),type:`element`},ep={format:[`code`],tag:"`",type:`text-format`},tp={format:[`highlight`],tag:`==`,type:`text-format`},np={format:[`bold`,`italic`],tag:`***`,type:`text-format`},rp={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},ip={format:[`bold`],tag:`**`,type:`text-format`},ap={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},op={format:[`strikethrough`],tag:`~~`,type:`text-format`},sp={format:[`italic`],tag:`*`,type:`text-format`},cp={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`},lp={dependencies:[nf],export:(e,t,n)=>{if(!of(e)||lf(e))return null;let r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{if(tc(e,of))return;let[,n,r,i]=t,a=af(r,{title:i}),o=n.split(`[`).length-1,s=n.split(`]`).length-1,c=n,l=``;if(o<s)return;if(o>s){let e=n.split(`[`);l=`[`+e[0],c=e.slice(1).join(`[`)}let u=N(c);return u.setFormat(e.getFormat()),a.append(u),e.replace(a),l&&a.insertBefore(N(l)),u},trigger:`)`,type:`text-match`},up=[Yf,Xf,Qf,$f],dp=[Zf],fp=[ep,np,rp,ip,ap,tp,sp,cp,op],pp=[lp],mp=[...up,...dp,...fp,...pp];function hp(e,t=mp,n,r=!1,i=!1){let a=r?e:function(e,t=!1){let n=e.split(`
32
- `),r=!1,i=[];for(let e=0;e<n.length;e++){let a=n[e].trimEnd(),o=i[i.length-1];Rf.test(a)?i.push(a):If.test(a)||Lf.test(a)?(r=!r,i.push(a)):r||a===``||o===``||!o||Pf.test(o)||Pf.test(a)||Ff.test(a)||jf.test(a)||Mf.test(a)||Nf.test(a)||zf.test(a)||Bf.test(a)||!t||Vf.test(a)||Hf.test(a)||Uf(Hf).test(o)||Uf(Vf).test(o)||Lf.test(o)?i.push(a):i[i.length-1]=o+` `+a.trimStart()}return i.join(`
33
- `)}(e,i);return Of(t,r)(a,n)}function gp(e=mp,t,n=!1){return function(e,t=!1){let n=pf(e),r=[...n.multilineElement,...n.element],i=!t,a=n.textFormat.filter(e=>e.format.length===1).sort((e,t)=>Number(e.format.includes(`code`))-Number(t.format.includes(`code`)));return e=>{let t=[],o=(e||K()).getChildren();for(let e=0;e<o.length;e++){let s=o[e],c=vf(s,r,a,n.textMatch);c!=null&&t.push(i&&e>0&&!_f(s)&&!_f(o[e-1])?`
34
- ${c}`:c)}return t.join(`
35
- `)}}(e,n)(t)}var _p=`group|layer|stack|boundary`,vp=`component|application|api|database|queue|actor|file`,yp=`dataflow|hop|branch|theme|legend`,bp=`label|tint|link|resource|extend|shape|gap|no-gap|no-extend|ranks|columns|style|relation|color`,xp=e=>RegExp(`(?<![\\w./-])(?:${e})(?![\\w./-])`);md.default.languages.asd={comment:/#.*/,string:{pattern:/"(?:[^"\\]|\\[\s\S])*"/,greedy:!0},keyword:xp(`${_p}|${vp}|${yp}`),property:xp(bp),operator:/<->|->|--/,punctuation:/[{};]/};var Sp={class:`markdown-editor-panel`},Cp={class:`lexical-toolbar`},wp=[`value`],Tp=[`value`],Ep={class:`lexical-editor-container`},Dp=C({__name:`MarkdownEditor`,props:{modelValue:String,visible:Boolean},emits:[`update:modelValue`,`close`],setup(e,{emit:t}){let n=e,r=t,i=D(null),a=null,o=D(null),s=D(null),{layout:l}=ge(),u=[`javascript`,`typescript`,`ruby`,`python`,`html`,`css`,`json`,`yaml`,`bash`,`sql`,`go`,`rust`,`java`,`mermaid`,`asd`,`markdown`,`text`],h={asd:`Archsight Diagram`};function g(e){return h[e]||e.charAt(0).toUpperCase()+e.slice(1)}function y(){!a&&i.value&&(a=xo({namespace:`ArchsightMarkdownEditor`,nodes:[Su,yu,rd,$u,xd,Ad,nf],onError:e=>console.error(`Lexical Error:`,e),theme:{paragraph:`lexical-paragraph`,heading:{h1:`lexical-h1`,h2:`lexical-h2`,h3:`lexical-h3`},list:{ul:`lexical-ul`,ol:`lexical-ol`,listitem:`lexical-li`},quote:`lexical-quote`,code:`lexical-code`,codeHighlight:{atrule:`tokenAttr`,attr:`tokenAttr`,boolean:`tokenProperty`,builtin:`tokenSelector`,cdata:`tokenComment`,char:`tokenSelector`,class:`tokenFunction`,"class-name":`tokenFunction`,comment:`tokenComment`,constant:`tokenProperty`,deleted:`tokenProperty`,doctype:`tokenComment`,entity:`tokenOperator`,function:`tokenFunction`,important:`tokenVariable`,inserted:`tokenSelector`,keyword:`tokenAttr`,namespace:`tokenVariable`,number:`tokenProperty`,operator:`tokenOperator`,prolog:`tokenComment`,property:`tokenProperty`,punctuation:`tokenPunctuation`,regex:`tokenVariable`,selector:`tokenSelector`,string:`tokenSelector`,symbol:`tokenProperty`,tag:`tokenProperty`,url:`tokenOperator`,variable:`tokenVariable`},link:`lexical-link`,text:{bold:`lexical-bold`,italic:`lexical-italic`,underline:`lexical-underline`,strikethrough:`lexical-strikethrough`,code:`lexical-text-code`}}}),a.setRootElement(i.value),ju(a),pd(a),ef(a),Fu(a,Iu(),300),a.registerUpdateListener(()=>{a.getEditorState().read(()=>{let e=I();if(F(e)){let t=e.getNodes();for(let e of t){let t=e.getParent(),n=Cd(t)?t:Cd(e)?e:null;if(n){o.value=n.getLanguage()||``,s.value=o.value===`asd`?n.getTextContent():null;return}}}o.value=null,l.value!==`full`&&(s.value=null)})}))}v(()=>n.visible,e=>{e&&(s.value=null,setTimeout(()=>{a&&=(a.setRootElement(null),null),y(),a&&a.update(()=>{K().clear(),hp(n.modelValue||``,mp)})},0))});function b(){a&&a.update(()=>{let e=gp(mp);r(`update:modelValue`,e),r(`close`)})}function x(e){a&&a.dispatchCommand(pr,e)}function S(e){a&&(e===`bullet`?a.dispatchCommand(ud,void 0):e===`number`?a.dispatchCommand(dd,void 0):a.update(()=>{let t=I();F(t)&&([`h1`,`h2`,`h3`].includes(e)?sl(t,()=>Eu(e)):e===`quote`?sl(t,()=>bu()):e===`paragraph`&&sl(t,()=>W()))}))}function C(){a&&a.update(()=>{let e=I();if(F(e)){let t=Sd(``);e.insertNodes([t]),t.select()}})}function ee(e){a&&a.update(()=>{let t=I();if(F(t))for(let n of t.getNodes()){let t=n.getParent();if(Cd(t)){t.setLanguage(e);return}if(Cd(n)){n.setLanguage(e);return}}})}function te(){let e=prompt(`Enter URL:`,`https://`);e!==null&&a&&a.update(()=>{let t=I();if(F(t)){if(e===``)t.getNodes().forEach(e=>{let t=e.getParent();of(t)&&(t.getChildren().forEach(e=>t.insertBefore(e)),t.remove())});else{let n=t.getTextContent()||e,r=af(e);r.append(N(n)),t.insertNodes([r])}}})}function re(e){e.key===`Escape`&&r(`close`)}return p(()=>{a&&=(a.setRootElement(null),null)}),(t,n)=>e.visible?(T(),m(`div`,{key:0,id:`markdown-editor-overlay`,onKeydown:re},[_(`div`,{class:`markdown-editor-backdrop`,onClick:n[0]||=e=>t.$emit(`close`)}),_(`div`,Sp,[_(`div`,Cp,[_(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[1]||=e=>x(`bold`),title:`Bold (Ctrl+B)`},[...n[15]||=[_(`i`,{class:`iconoir-bold`},null,-1)]]),_(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[2]||=e=>x(`italic`),title:`Italic (Ctrl+I)`},[...n[16]||=[_(`i`,{class:`iconoir-italic`},null,-1)]]),_(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[3]||=e=>x(`strikethrough`),title:`Strikethrough`},[...n[17]||=[_(`i`,{class:`iconoir-strikethrough`},null,-1)]]),_(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[4]||=e=>x(`code`),title:`Inline Code`},[...n[18]||=[_(`i`,{class:`iconoir-code`},null,-1)]]),n[25]||=_(`div`,{class:`toolbar-divider`},null,-1),_(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[5]||=e=>S(`h1`),title:`Heading 1`},`H1`),_(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[6]||=e=>S(`h2`),title:`Heading 2`},`H2`),_(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[7]||=e=>S(`h3`),title:`Heading 3`},`H3`),n[26]||=_(`div`,{class:`toolbar-divider`},null,-1),_(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[8]||=e=>S(`bullet`),title:`Bullet List`},[...n[19]||=[_(`i`,{class:`iconoir-list`},null,-1)]]),_(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[9]||=e=>S(`number`),title:`Numbered List`},[...n[20]||=[_(`i`,{class:`iconoir-numbered-list-left`},null,-1)]]),_(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[10]||=e=>S(`quote`),title:`Quote`},[...n[21]||=[_(`i`,{class:`iconoir-quote`},null,-1)]]),n[27]||=_(`div`,{class:`toolbar-divider`},null,-1),_(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[11]||=e=>te(),title:`Insert Link`},[...n[22]||=[_(`i`,{class:`iconoir-link`},null,-1)]]),n[28]||=_(`div`,{class:`toolbar-divider`},null,-1),_(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[12]||=e=>C(),title:`Code Block`},[...n[23]||=[_(`i`,{class:`iconoir-code-brackets`},null,-1)]]),o.value===null?d(``,!0):(T(),m(`select`,{key:0,class:`toolbar-select`,value:o.value,onChange:n[13]||=e=>ee(e.target.value),title:`Code Language`},[n[24]||=_(`option`,{value:``},`Language...`,-1),(T(),m(ne,null,f(u,e=>_(`option`,{key:e,value:e},w(g(e)),9,Tp)),64))],40,wp)),n[29]||=_(`div`,{class:`toolbar-spacer`},null,-1),_(`button`,{class:`secondary toolbar-action`,type:`button`,onClick:n[14]||=e=>t.$emit(`close`)},`Cancel`),_(`button`,{class:`toolbar-action`,type:`button`,onClick:b},`Save`)]),_(`div`,{class:E([`editor-split`,`layout-${ie(l)}`])},[_(`div`,Ep,[_(`div`,{ref_key:`editorRoot`,ref:i,id:`lexical-editor-root`,contenteditable:`true`},null,512)]),s.value===null?d(``,!0):(T(),c(Ee,{key:0,class:`editor-diagram-preview`,source:s.value},null,8,[`source`]))],2)])],32)):d(``,!0)}},[[`__scopeId`,`data-v-e8d0cc10`]]),Op={key:0},kp={key:1},Ap={key:2,class:`yaml-output`},jp={key:0,class:`field-group`},Mp=[`value`],Np={key:1,class:`field-group`},Pp=[`aria-invalid`],Fp={key:0,class:`field-error`},Ip={class:`annotations-grid`},Lp={key:0},Rp={class:`form-actions`},zp={type:`submit`},Bp=C({__name:`EditorPage`,props:{kind:String,instance:String},setup(e){let t=e,a=s(),o=u(`kinds`),p=D(!0),v=D(null),y=D(null),b=D(``),x=D({}),C=D([]),se=D({}),ce=D(null),le=D(`yaml`),ue=D(null),de=D(null),fe=D(null),pe=D(!1),me=h(()=>!!t.instance),he=h(()=>me.value?`Edit ${t.kind}`:`New ${t.kind}`),ge=h(()=>me.value?`/kinds/${t.kind}/instances/${t.instance}`:`/kinds/${t.kind}`),_e=h(()=>!o.value||!v.value?null:{icon:v.value.icon,layer:v.value.layer});l(async()=>{try{let e=me.value?await te(t.kind,t.instance):await ae(t.kind);v.value=e,me.value&&(b.value=e.name||``,x.value=e.annotations||{},C.value=e.relations||[],de.value=e.content_hash,ue.value=e.path_ref)}catch(e){y.value=e.message}finally{p.value=!1}});async function ve(){se.value={};let e={name:b.value,annotations:x.value,relations:C.value.map(e=>({verb:e.verb,kind:e.kind,names:[e.name]})),content_hash:de.value},n;try{n=me.value?await re(t.kind,t.instance,e):await oe(t.kind,e)}catch(e){alert(`Generate failed: ${e.message}`);return}n.errors?se.value=n.errors:(ce.value=n.yaml,le.value=n.format||`yaml`,n.path_ref&&(ue.value=n.path_ref),n.content_hash&&(de.value=n.content_hash))}function ye(){ce.value=null}function be(e){fe.value=e,pe.value=!0}function xe(e){fe.value&&(x.value[fe.value]=e)}function Se(){pe.value=!1,fe.value=null}return(t,o)=>{let s=S(`router-link`);return p.value?(T(),m(`article`,Op,[...o[3]||=[_(`p`,null,`Loading...`,-1)]])):y.value?(T(),m(`article`,kp,[o[4]||=_(`header`,null,[_(`h2`,null,`Error`)],-1),_(`p`,null,w(y.value),1)])):ce.value?(T(),m(`article`,Ap,[_(`header`,null,[_(`h3`,null,[_e.value?(T(),m(`i`,{key:0,class:E(`iconoir-${_e.value.icon} icon-${_e.value.layer}`)},null,2)):d(``,!0),O(` `+w(he.value),1)]),i(s,{class:`btn-back`,to:ge.value},{default:n(()=>[...o[5]||=[_(`i`,{class:`iconoir-arrow-left`},null,-1),O(` Back `,-1)]]),_:1},8,[`to`])]),i(st,{yaml:ce.value,format:le.value,kind:e.kind,name:b.value,"content-hash":de.value,"path-ref":ue.value,"inline-edit-enabled":v.value.inline_edit_enabled,onEditAgain:ye},null,8,[`yaml`,`format`,`kind`,`name`,`content-hash`,`path-ref`,`inline-edit-enabled`])])):v.value?(T(),m(ne,{key:3},[_(`form`,{class:`editor-form`,onSubmit:r(ve,[`prevent`])},[_(`article`,null,[_(`header`,null,[_(`h3`,null,[_e.value?(T(),m(`i`,{key:0,class:E(`iconoir-${_e.value.icon} icon-${_e.value.layer}`)},null,2)):d(``,!0),O(` `+w(he.value),1)]),i(s,{class:`btn-back`,to:ge.value},{default:n(()=>[...o[6]||=[_(`i`,{class:`iconoir-arrow-left`},null,-1),O(` Back `,-1)]]),_:1},8,[`to`])]),me.value?(T(),m(`div`,jp,[_(`input`,{id:`name`,type:`text`,value:b.value,disabled:``},null,8,Mp)])):(T(),m(`div`,Np,[o[7]||=_(`label`,{for:`name`},[O(` Name `),_(`span`,{class:`required`},`*`)],-1),ee(_(`input`,{id:`name`,type:`text`,"onUpdate:modelValue":o[0]||=e=>b.value=e,required:``,placeholder:`Enter resource name (no spaces)`,pattern:`\\S+`,"aria-invalid":se.value.name?`true`:void 0},null,8,Pp),[[g,b.value]]),se.value.name?(T(),m(`div`,Fp,w(se.value.name.join(`, `)),1)):d(``,!0)]))]),_(`article`,null,[o[8]||=_(`header`,null,[_(`h3`,null,`Annotations`)],-1),_(`div`,Ip,[(T(!0),m(ne,null,f(v.value.fields,e=>(T(),c(Ue,{key:e.key,field:e,"model-value":x.value[e.key],error:se.value[e.key],"onUpdate:modelValue":t=>x.value[e.key]=t,onOpenMarkdown:be},null,8,[`field`,`model-value`,`error`,`onUpdate:modelValue`]))),128))])]),v.value.relation_options.length?(T(),m(`article`,Lp,[o[9]||=_(`header`,null,[_(`h3`,null,`Relations`)],-1),i(Qe,{relations:C.value,"relation-options":v.value.relation_options,"instances-by-kind":v.value.instances_by_kind,"onUpdate:relations":o[1]||=e=>C.value=e},null,8,[`relations`,`relation-options`,`instances-by-kind`])])):d(``,!0),_(`div`,Rp,[_(`button`,zp,[o[10]||=_(`i`,{class:`iconoir-code`},null,-1),O(` Generate `+w(v.value.format===`markdown`?`MD`:`YAML`),1)]),_(`button`,{type:`button`,class:`secondary`,onClick:o[2]||=e=>ie(a).push(ge.value)},` Cancel `)])],32),i(Dp,{visible:pe.value,"model-value":fe.value&&x.value[fe.value]||``,"onUpdate:modelValue":xe,onClose:Se},null,8,[`visible`,`model-value`])],64)):d(``,!0)}}},[[`__scopeId`,`data-v-822cad5e`]]);export{Bp as default};