@protobase/ui 0.19.8 → 0.19.10

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 (85) hide show
  1. package/dist/app/app.js +4 -4
  2. package/dist/app/create/create-offered.js +9 -0
  3. package/dist/app/create/create-page.js +4 -4
  4. package/dist/app/create/create-record-form.js +26 -62
  5. package/dist/app/create/create-route.js +29 -0
  6. package/dist/app/create/form.d.ts +30 -0
  7. package/dist/app/create/form.js +72 -0
  8. package/dist/app/custom-section.js +1 -1
  9. package/dist/app/displays/map-display.js +1 -1
  10. package/dist/app/displays/record-card.js +18 -4
  11. package/dist/app/displays/record-link.js +1 -1
  12. package/dist/app/displays/use-map-records.js +2 -2
  13. package/dist/app/embedded-list/embedded-columns.js +2 -2
  14. package/dist/app/embedded-list/embedded-list.js +5 -5
  15. package/dist/app/embedded-list/use-embedded-rows.js +2 -2
  16. package/dist/app/field-editor.js +21 -5
  17. package/dist/app/gallery/gallery-section.js +1 -1
  18. package/dist/app/gallery/photo-details.js +2 -2
  19. package/dist/app/list-page.js +18 -17
  20. package/dist/app/pages/blocks/card-row.js +2 -2
  21. package/dist/app/pages/blocks/field.js +2 -2
  22. package/dist/app/pages/blocks/link.js +1 -1
  23. package/dist/app/pages/blocks/modal-form.js +6 -6
  24. package/dist/app/pages/blocks/progress.js +1 -1
  25. package/dist/app/pages/blocks/record-card.js +2 -2
  26. package/dist/app/pages/blocks/record-row.js +1 -1
  27. package/dist/app/pages/blocks/show.js +2 -2
  28. package/dist/app/pages/blocks/stat.js +3 -3
  29. package/dist/app/pages/blocks/table.js +1 -1
  30. package/dist/app/pages/field-value.js +5 -2
  31. package/dist/app/pages/record-actions.js +2 -2
  32. package/dist/app/pages/use-run-action.js +2 -2
  33. package/dist/app/record-page.js +15 -11
  34. package/dist/app/record-row/record-row-body.js +2 -2
  35. package/dist/app/record-row/saved-record-row.js +1 -1
  36. package/dist/app/related-section.js +1 -1
  37. package/dist/app/searches/saved-search-rows.js +1 -1
  38. package/dist/app/searches/saved-search-section.js +2 -2
  39. package/dist/app/searches/saved-searches.js +2 -2
  40. package/dist/app/searches/search-controls.js +1 -1
  41. package/dist/app/searches/search-name-dialog.js +1 -1
  42. package/dist/app/searches/update-search-dialog.js +2 -2
  43. package/dist/app/searches/use-filter-chips.js +1 -1
  44. package/dist/app/searches/use-save-search.js +2 -2
  45. package/dist/app/searches/use-saved-searches.js +1 -1
  46. package/dist/app/searches/use-search-row.js +1 -1
  47. package/dist/app/sensitive-field.js +1 -1
  48. package/dist/app/use-app-address.js +1 -1
  49. package/dist/app/value-badge.js +1 -1
  50. package/dist/auth/sign-in-prompt.js +1 -1
  51. package/dist/data-grid/cells.js +1 -1
  52. package/dist/index.d.ts +9 -1
  53. package/dist/index.js +10 -2
  54. package/dist/live/columns-from-model.js +3 -0
  55. package/dist/live/grid-loader.js +1 -1
  56. package/dist/live/use-filter-config.js +1 -1
  57. package/dist/markdown/markdown-content.js +18 -0
  58. package/dist/markdown/markdown-editor.js +46 -0
  59. package/dist/markdown/markdown-excerpt.js +36 -0
  60. package/dist/markdown/markdown-hint.js +5 -0
  61. package/dist/markdown/markdown-html.js +59 -0
  62. package/dist/markdown/markdown.js +15 -0
  63. package/dist/package.js +1 -1
  64. package/dist/primitives/choices.d.ts +22 -0
  65. package/dist/primitives/choices.js +33 -0
  66. package/dist/primitives/dialog.d.ts +15 -0
  67. package/dist/primitives/menu-select.d.ts +14 -0
  68. package/dist/primitives/segmented.d.ts +23 -0
  69. package/dist/primitives/textarea.d.ts +9 -0
  70. package/dist/record-view/field.d.ts +27 -0
  71. package/dist/record-view/section.d.ts +10 -0
  72. package/dist/shell/assets/app-GKl91FLS.js +69 -0
  73. package/dist/shell/assets/{index-cMmFPuUQ.js → index-BB2BN-6s.js} +1 -1
  74. package/dist/shell/assets/index-DxV5Rp_F.css +2 -0
  75. package/dist/shell/assets/{maplibre-9XYrB9k6.js → maplibre-DHotMteL.js} +2 -2
  76. package/dist/shell/assets/markdown-content-C4zE1qZp.js +67 -0
  77. package/dist/shell/assets/{record-map-OBtKCiUB.js → record-map-BBbVY6vn.js} +1 -1
  78. package/dist/shell/assets/{records-map-C4oMPL5C.js → records-map-ur6HR-I5.js} +1 -1
  79. package/dist/shell/assets/shared-protobase-ui-D7kkYiTL.js +1 -0
  80. package/dist/shell/index.html +4 -4
  81. package/dist/shell/protobase.shell.json +1 -1
  82. package/package.json +6 -4
  83. package/dist/shell/assets/app-D8i5r_6U.js +0 -68
  84. package/dist/shell/assets/index-Cuulz26c.css +0 -2
  85. package/dist/shell/assets/shared-protobase-ui-CN1HmyDa.js +0 -1
@@ -0,0 +1,67 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{lt as n}from"./app-GKl91FLS.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";var i=e(t(),1);function a(e,t){this.v=e,this.k=t}function o(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e){if(Array.isArray(e))return e}function c(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function l(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u(e,t){return s(e)||c(e,t)||d(e,t)||l()}function d(e,t){if(e){if(typeof e==`string`)return o(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function f(e){var t,n;function r(t,n){try{var o=e[t](n),s=o.value,c=s instanceof a;Promise.resolve(c?s.v:s).then(function(n){if(c){var a=t===`return`&&s.k?t:`next`;if(!s.k||n.done)return r(a,n);n=e[a](n).value}i(!!o.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}f.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},f.prototype.next=function(e){return this._invoke(`next`,e)},f.prototype.throw=function(e){return this._invoke(`throw`,e)},f.prototype.return=function(e){return this._invoke(`return`,e)};var p=Object.entries,m=Object.setPrototypeOf,h=Object.isFrozen,ee=Object.getPrototypeOf,te=Object.getOwnPropertyDescriptor,g=Object.freeze,_=Object.seal,ne=Object.create,re=typeof Reflect<`u`&&Reflect,ie=re.apply,ae=re.construct;g||=function(e){return e},_||=function(e){return e},ie||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ae||=function(e){return new e(...[...arguments].slice(1))};var v=w(Array.prototype.forEach);Array.prototype.indexOf;var oe=w(Array.prototype.lastIndexOf),se=w(Array.prototype.pop),ce=w(Array.prototype.push),le=w(Array.prototype.slice),ue=w(Array.prototype.splice),de=Array.isArray,fe=we(Set),pe=w(Set.prototype.add),me=w(Set.prototype.has),he=w(String.prototype.toLowerCase),ge=w(String.prototype.toString),_e=w(String.prototype.match),ve=w(String.prototype.replace),ye=w(String.prototype.indexOf),be=w(String.prototype.trim),xe=w(Number.prototype.toString),Se=w(Boolean.prototype.toString),Ce=typeof BigInt>`u`?null:w(BigInt.prototype.toString),y=typeof Symbol>`u`?null:w(Symbol.prototype.toString),b=w(Object.prototype.hasOwnProperty),x=w(Object.prototype.toString),S=w(RegExp.prototype.test),C=we(TypeError);function w(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ie(e,t,n)}}function we(e){return function(){return ae(e,[...arguments])}}function T(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:he;if(m&&m(e,null),!de(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(h(t)||(t[r]=e),i=e)}e[i]=!0}return e}function E(e){for(let t=0;t<e.length;t++)b(e,t)||(e[t]=null);return e}function D(e){let t=ne(null);for(let r of p(e)){var n=u(r,2);let i=n[0],a=n[1];b(e,i)&&(t[i]=de(a)?E(a):a&&typeof a==`object`&&a.constructor===Object?D(a):a)}return t}function Te(e){switch(typeof e){case`string`:return e;case`number`:return xe(e);case`boolean`:return Se(e);case`bigint`:return Ce?Ce(e):`0`;case`symbol`:return y?y(e):`Symbol()`;case`undefined`:return x(e);case`function`:case`object`:{if(e===null)return x(e);let t=e,n=O(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:x(e)}return x(e)}default:return x(e)}}function O(e,t){for(;e!==null;){let n=te(e,t);if(n){if(n.get)return w(n.get);if(typeof n.value==`function`)return w(n.value)}e=ee(e)}function n(){return null}return n}function Ee(e,t){for(;e!==null;){let n=te(e,t);if(n)return n.get?w(n.get):null;e=ee(e)}return null}function De(e){try{return S(e,``),!0}catch{return!1}}var Oe=g(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),ke=g(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ae=g([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),je=g([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Me=g(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Ne=g([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Pe=g([`#text`]),Fe=g(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Ie=g(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Le=g(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Re=g([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),ze=_(/{{[\w\W]*|^[\w\W]*}}/g),Be=_(/<%[\w\W]*|^[\w\W]*%>/g),Ve=_(/\${[\w\W]*/g),He=_(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ue=_(/^aria-[\-\w]+$/),We=_(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ge=_(/^(?:\w+script|data):/i),Ke=_(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qe=_(/^html$/i),Je=_(/^[a-z][.\w]*(-[.\w]+)+$/i),Ye=_(/<[/\w!]/g),Xe=_(/<[/\w]/g),Ze=_(/<\/no(script|embed|frames)/i),Qe=_(/\/>/i),k={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},$e=g(T({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),et=function(){return typeof window>`u`?null:window},tt=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},nt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},rt=function(e,t,n,r){return b(e,t)&&de(e[t])?T(r.base?D(r.base):{},e[t],r.transform):n},it=function(e,t,n){let r=b(e,t)?e[t]:void 0;return r&&typeof r==`object`?D(r):n()};function at(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:et(),t=e=>at(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==k.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=O(d,`cloneNode`),m=O(d,`remove`),h=O(d,`removeAttributeNode`),ee=O(d,`nextSibling`),te=O(d,`childNodes`),re=O(d,`parentNode`),ie=O(d,`shadowRoot`),ae=O(d,`attributes`),xe=o&&o.prototype?O(o.prototype,`nodeType`):null,Se=o&&o.prototype?O(o.prototype,`nodeName`):null,Ce=o&&o.prototype?O(o.prototype,`ownerDocument`):null,y=function(e){return xe?xe(e):e.nodeType},x=function(e){return Se?Se(e):e.nodeName},w=Ee(d,`namespaceURI`),we=function(e){return w?w(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let E,ot=``,st,ct=!1,lt=0,A=function(){if(lt>0)throw C(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},j=function(e){A(),lt++;try{return E.createHTML(e)}finally{lt--}},M=function(e){A(),lt++;try{return E.createScriptURL(e)}finally{lt--}},ut=function(){return ct||=(st=tt(u,i),!0),st},N=n,dt=N.implementation,ft=N.createNodeIterator,pt=N.createDocumentFragment,mt=N.getElementsByTagName,ht=r.importNode,P=nt();t.isSupported=typeof p==`function`&&typeof re==`function`&&dt&&dt.createHTMLDocument!==void 0;let gt=ze,_t=Be,vt=Ve,yt=He,bt=Ue,xt=Ge,St=Ke,Ct=Je,wt=We,F=null,Tt=T({},[...Oe,...ke,...Ae,...Me,...Pe]),I=null,Et=T({},[...Fe,...Ie,...Le,...Re]),L=Object.seal(ne(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Dt=null,Ot=null,R=Object.seal(ne(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),kt=!0,At=!0,jt=!1,Mt=!0,z=!1,B=!0,V=!1,Nt=!1,Pt=null,Ft=null,It=!1,Lt=!1,Rt=!1,zt=!1,Bt=!0,Vt=!1,Ht=`user-content-`,Ut=!0,Wt=!1,Gt=null,Kt={},qt=null,Jt=T({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Yt=null,Xt=T({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Zt=null,Qt=T({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),$t=`http://www.w3.org/1998/Math/MathML`,en=`http://www.w3.org/2000/svg`,H=`http://www.w3.org/1999/xhtml`,tn=H,nn=!1,rn=null,an=T({},[$t,en,H],ge),on=g([`mi`,`mo`,`mn`,`ms`,`mtext`]),sn=T({},on),cn=g([`annotation-xml`]),ln=T({},cn),un=T({},[`title`,`style`,`font`,`a`,`script`]),dn=null,fn=[`application/xhtml+xml`,`text/html`],U=null,pn=null,mn=n.createElement(`form`),hn=function(e){return e instanceof RegExp||e instanceof Function},gn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pn&&pn===e)return;(!e||typeof e!=`object`)&&(e={}),e=D(e),dn=fn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,U=dn===`application/xhtml+xml`?ge:he,F=rt(e,`ALLOWED_TAGS`,Tt,{transform:U}),I=rt(e,`ALLOWED_ATTR`,Et,{transform:U}),rn=rt(e,`ALLOWED_NAMESPACES`,an,{transform:ge}),Zt=rt(e,`ADD_URI_SAFE_ATTR`,Qt,{transform:U,base:Qt}),Yt=rt(e,`ADD_DATA_URI_TAGS`,Xt,{transform:U,base:Xt}),qt=rt(e,`FORBID_CONTENTS`,Jt,{transform:U}),Dt=rt(e,`FORBID_TAGS`,D({}),{transform:U}),Ot=rt(e,`FORBID_ATTR`,D({}),{transform:U}),Kt=b(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?D(e.USE_PROFILES):e.USE_PROFILES:!1,kt=e.ALLOW_ARIA_ATTR!==!1,At=e.ALLOW_DATA_ATTR!==!1,jt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Mt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,z=e.SAFE_FOR_TEMPLATES||!1,B=e.SAFE_FOR_XML!==!1,V=e.WHOLE_DOCUMENT||!1,Lt=e.RETURN_DOM||!1,Rt=e.RETURN_DOM_FRAGMENT||!1,zt=e.RETURN_TRUSTED_TYPE||!1,It=e.FORCE_BODY||!1,Bt=e.SANITIZE_DOM!==!1,Vt=e.SANITIZE_NAMED_PROPS||!1,Ut=e.KEEP_CONTENT!==!1,Wt=e.IN_PLACE||!1,wt=De(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:We,tn=typeof e.NAMESPACE==`string`?e.NAMESPACE:H,sn=it(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>T({},on)),ln=it(e,`HTML_INTEGRATION_POINTS`,()=>T({},cn));let t=it(e,`CUSTOM_ELEMENT_HANDLING`,()=>ne(null));if(L=ne(null),b(t,`tagNameCheck`)&&hn(t.tagNameCheck)&&(L.tagNameCheck=t.tagNameCheck),b(t,`attributeNameCheck`)&&hn(t.attributeNameCheck)&&(L.attributeNameCheck=t.attributeNameCheck),b(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(L.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),_(L),z&&(At=!1),Rt&&(Lt=!0),Kt&&(F=T({},Pe),I=ne(null),Kt.html===!0&&(T(F,Oe),T(I,Fe)),Kt.svg===!0&&(T(F,ke),T(I,Ie),T(I,Re)),Kt.svgFilters===!0&&(T(F,Ae),T(I,Ie),T(I,Re)),Kt.mathMl===!0&&(T(F,Me),T(I,Le),T(I,Re))),R.tagCheck=null,R.attributeCheck=null,b(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?R.tagCheck=e.ADD_TAGS:de(e.ADD_TAGS)&&(F===Tt&&(F=D(F)),T(F,e.ADD_TAGS,U))),b(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?R.attributeCheck=e.ADD_ATTR:de(e.ADD_ATTR)&&(I===Et&&(I=D(I)),T(I,e.ADD_ATTR,U))),b(e,`ADD_FORBID_CONTENTS`)&&de(e.ADD_FORBID_CONTENTS)&&(qt===Jt&&(qt=D(qt)),T(qt,e.ADD_FORBID_CONTENTS,U)),Ut&&(F[`#text`]=!0),V&&T(F,[`html`,`head`,`body`]),F.table&&(T(F,[`tbody`]),delete Dt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw C(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw C(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=E;E=e.TRUSTED_TYPES_POLICY;try{ot=j(``)}catch(e){throw E=t,e}}else e.TRUSTED_TYPES_POLICY===null?(E=void 0,ot=``):(E===void 0&&(E=ut()),E&&typeof ot==`string`&&(ot=j(``)));g&&g(e),pn=e},_n=T({},[...ke,...Ae,...je]),vn=T({},[...Me,...Ne]),yn=function(e,t,n){return t.namespaceURI===H?e===`svg`:t.namespaceURI===$t?e===`svg`&&(n===`annotation-xml`||sn[n]):!!_n[e]},W=function(e,t,n){return t.namespaceURI===H?e===`math`:t.namespaceURI===en?e===`math`&&ln[n]:!!vn[e]},bn=function(e,t,n){return t.namespaceURI===en&&!ln[n]||t.namespaceURI===$t&&!sn[n]?!1:!vn[e]&&(un[e]||!_n[e])},xn=function(e){let t=we(e),n=he(x(e)),r=re(e),i,a;return r&&y(r)===k.element?(i={namespaceURI:we(r)},a=he(x(r))):(i={namespaceURI:tn},a=`template`),rn[t]?t===en?yn(n,i,a):t===$t?W(n,i,a):t===H?bn(n,i,a):!!(dn===`application/xhtml+xml`&&rn[t]):!1},G=function(e){ce(t.removed,{element:e});try{re(e).removeChild(e)}catch{if(m(e),!re(e))throw C(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},K=function(e,t,n){try{h(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Sn=function(e){Tn(e);let t=te(e);t&&v(le(t),e=>{try{m(e)}catch{}});let n=y(e)===k.element?ae(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&K(e,r,i)}},q=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}ce(t.removed,{attribute:r||null,from:n});try{r?h(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Lt||Rt)try{G(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Cn=function(e){let t=ae(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||I[U(i)]||K(e,r,i)}},wn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&y(e)===k.element){let t=ie(e);Q(t)&&r.push(t)}let i=te(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Tn=function(e){wn(e,e=>{y(e)===k.element&&Cn(e)})},En=function(e){let t=[];return wn(e,e=>{t.push(e)},!0),t},Dn=function(e,t){let n=fe();v(En(e),e=>{y(e)===k.element&&pe(n,e)}),v(t,e=>{y(e)===k.element&&!me(n,e)&&Cn(e)})},On=function(e,n){let r=!1;return v(t.removed,t=>{t.element&&(r||=t.element===e,Tn(t.element))}),Dn(e,n),r},J=function(e,t){let n=Gt,r=null,i=()=>(r||(r=fe(),v(t,e=>{pe(r,e)})),r);for(let t=0;;t++){let r=En(e),a=[e],o=!1;if(v(r,e=>{y(e)===k.documentFragment?ce(a,e):!o&&!me(n,e)&&(o=me(i(),e))}),!o)return;if(t>=8)throw C(`the tree kept changing during in-place sanitization; refusing to return it`);v(a,(t,n)=>{kn(t,n>0,e,i())})}},kn=function(e,t,n,r){let i=Nn(e),a;for(;a=i.nextNode();)me(r,a)&&!me(Gt,a)&&(t&&$(P.uponSanitizeShadowNode,a,null),Hn(a,n),Yn(a,n),Q(a.content)&&Xn(a.content))},An=function(e){Gt&&pe(Gt,e)},Y=function(e,t){return B?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},jn=function(e){B&&wn(e,e=>{let t=y(e);if(t===k.processingInstruction||t===k.comment&&S(Xe,e.data)){try{m(e)}catch{}return!1}if(t===k.element){let t=e,n=U(x(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Y(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Mn=function(e){let t=null,r=null;if(It)e=`<remove></remove>`+e;else{let t=_e(e,/^[\r\n\t ]+/);r=t&&t[0]}dn===`application/xhtml+xml`&&tn===H&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=E?j(e):e;if(tn===H)try{t=new l().parseFromString(i,dn)}catch{}if(!t||!t.documentElement){t=dt.createDocument(tn,`template`,null);try{t.documentElement.innerHTML=nn?ot:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),tn===H?mt.call(t,V?`html`:`body`)[0]:V?t.documentElement:a},Nn=function(e){let t=Ce?Ce(e):e.ownerDocument;return ft.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},X=function(e){return e=ve(e,gt,` `),e=ve(e,_t,` `),e=ve(e,vt,` `),e},Z=function(e){Pn(e);let t=e.querySelectorAll?.call(e,`template`);t&&v(t,e=>{Q(e.content)&&Z(e.content)})},Pn=function(e){e.normalize();let t=Ce?Ce(e):e.ownerDocument,n=ft.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=X(r.data),r=n.nextNode()},Fn=function(e){let t=Se?Se(e):null;return typeof t!=`string`||U(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==ae(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==xe(e)||e.childNodes!==te(e)},Q=function(e){if(!xe||typeof e!=`object`||!e)return!1;try{return xe(e)===k.documentFragment}catch{return!1}},In=function(e){if(!xe||typeof e!=`object`||!e)return!1;try{return typeof xe(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&v(e,e=>{e.call(t,n,r,pn)})}let Ln=function(e,t){return!!(B&&e.hasChildNodes()&&!In(e.firstElementChild)&&S(Ye,e.textContent)&&S(Ye,e.innerHTML)||B&&$e[t]&&y(e)===k.element&&we(e)===H&&(In(e.firstElementChild)||typeof e.textContent==`string`&&S(Ye,e.textContent))||e.nodeType===k.processingInstruction||B&&e.nodeType===k.comment&&S(Xe,e.data))},Rn=function(e,t){return e instanceof RegExp?S(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},zn=function(e,t,n){if(!Dt[t]&&Gn(t)&&Rn(L.tagNameCheck,t))return!1;if(Ut&&!qt[t]&&!qt[he(t)]){let t=re(e),r=te(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,ee(e))}}}return G(e),!0},Bn=function(e,t,n,r){return e.length===0?t:t===n||t===r?D(t):t},Vn=function(e,t){return e===t||re(e)!==null?!1:(Wt&&Tn(e),!0)},Hn=function(e,n){if(An(e),$(P.beforeSanitizeElements,e,null),Vn(e,n))return!0;if(Fn(e))return G(e),!0;let r=U(x(e));if(F=Bn(P.uponSanitizeElement,F,Tt,Pt),$(P.uponSanitizeElement,e,{tagName:r,allowedTags:F}),Vn(e,n))return!0;if(Ln(e,r))return G(e),!0;if(Dt[r]||!(R.tagCheck instanceof Function&&R.tagCheck(r))&&!F[r]){let t=zn(e,r,n);return t===!1&&($(P.afterSanitizeElements,e,null),Vn(e,n))?!0:t}if(y(e)===k.element&&!xn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&S(Ze,e.innerHTML))return G(e),!0;if(z&&e.nodeType===k.text){let n=X(e.textContent);e.textContent!==n&&(ce(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(P.afterSanitizeElements,e,null),Vn(e,n)},Un=function(e,t,r){if(Ot[t]||Y(t,e)||Bt&&(t===`id`||t===`name`)&&(r in n||r in mn))return!1;let i=I[t]||R.attributeCheck instanceof Function&&R.attributeCheck(t,e);return At&&S(yt,t)||kt&&S(bt,t)?!0:i?Zt[t]||S(wt,ve(r,St,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ye(r,`data:`)===0&&Yt[e]||jt&&!S(xt,ve(r,St,``))?!0:!r:Gn(e)&&Rn(L.tagNameCheck,e)&&Rn(L.attributeNameCheck,t,e)||t===`is`&&L.allowCustomizedBuiltInElements&&Rn(L.tagNameCheck,r)},Wn=T({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Gn=function(e){return!Wn[he(e)]&&S(Ct,e)},Kn=function(e,t,n,r){if(E&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return j(r);case`TrustedScriptURL`:return M(r)}return r},qn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Fn(e)||(G(e),!1)}catch{return q(t,e),!1}},Jn=function(e,t){return B&&S(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:he(e)===`attributename`&&_e(t,`href`)!==null},Yn=function(e,n){if($(P.beforeSanitizeAttributes,e,null),Vn(e,n))return;let r=e.attributes;if(!r||Fn(e))return;I=Bn(P.uponSanitizeAttribute,I,Et,Ft);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:I,forceKeepAttr:void 0},a=r.length,o=U(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=U(s),d=l,f=s===`value`?d:be(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$(P.uponSanitizeAttribute,e,i),f=i.attrValue,Vt&&(u===`id`||u===`name`)&&ye(f,Ht)!==0&&(q(s,e,n),f=Ht+f,p=!0),Jn(s,f)){q(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){q(s,e,n);continue}if(!Mt&&S(Qe,f)){q(s,e,n);continue}if(z&&(f=X(f)),!Un(o,u,f)){q(s,e,n);continue}f=Kn(o,u,c,f),f!==d&&qn(e,s,c,f)&&p&&se(t.removed)}}$(P.afterSanitizeAttributes,e,null),Vn(e,n)},Xn=function(e){let t=null,n=Nn(e);for($(P.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(P.uponSanitizeShadowNode,t,null),Hn(t,e),Yn(t,e),Q(t.content)&&Xn(t.content),y(t)===k.element){let e=ie(t);Q(e)&&(Zn(e),Xn(e))}z&&Pn(e),$(P.afterSanitizeShadowDOM,e,null)},Zn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Xn(e.shadow);continue}let n=e.node,r=y(n)===k.element,i=te(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=Se?Se(n):null;if(typeof e==`string`&&U(e)===`template`){let e=n.content;Q(e)&&t.push({node:e,shadow:null})}}if(r){let e=ie(n);Q(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(nn=!e,nn&&(e=`<!-->`),typeof e!=`string`&&!In(e)&&(e=Te(e),typeof e!=`string`))throw C(`dirty is not a string, aborting`);if(!t.isSupported)return e;Nt?(F=Pt,I=Ft):gn(n),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(F=D(F)),P.uponSanitizeAttribute.length>0&&(I=D(I)),t.removed=[];let c=Wt&&typeof e!=`string`&&In(e),l=[],u=Gt;if(c){jn(e);let t=x(e);if(typeof t==`string`){let n=U(t);if(!F[n]||Dt[n])throw Sn(e),C(`root node is forbidden and cannot be sanitized in-place`)}if(Fn(e))throw Sn(e),C(`root node is clobbered and cannot be sanitized in-place`);l=En(e),Gt=fe()}else if(In(e))i=Mn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===k.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Zn(i);else{if(!Lt&&!z&&!V&&e.indexOf(`<`)===-1)return E&&zt?j(e):e;if(i=Mn(e),!i)return Lt?null:zt?ot:``}i&&It&&G(i.firstChild);let d=c?e:i;try{c&&Zn(e);let t=Nn(d);for(;o=t.nextNode();)Hn(o,d),Yn(o,d),Q(o.content)&&Xn(o.content);c&&J(e,l)}catch(t){throw c&&(Sn(e),On(e,l)),t}finally{Gt=u}if(c){if(On(e,l))throw C(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return z&&Z(e),e}if(Lt){if(z&&Z(i),Rt)for(s=pt.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(I.shadowroot||I.shadowrootmode)&&(s=ht.call(r,s,!0)),s}let f=V?i.outerHTML:i.innerHTML;return V&&F[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&S(qe,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
+ `+f),z&&(f=X(f)),E&&zt?j(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gn(e),Nt=!0,Pt=F,Ft=I},t.clearConfig=function(){pn=null,Nt=!1,Pt=null,Ft=null,E=st,ot=``},t.isValidAttribute=function(e,t,n){pn||gn({});let r=U(e),i=U(t);return typeof n==`string`&&(Jn(t,n)||!Mt&&S(Qe,n))?!1:Un(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&b(P,e)&&ce(P[e],t)},t.removeHook=function(e,t){if(b(P,e)){if(t!==void 0){let n=oe(P[e],t);return n===-1?void 0:ue(P[e],n,1)[0]}return se(P[e])}},t.removeHooks=function(e){b(P,e)&&(P[e]=[])},t.removeAllHooks=function(){P=nt()},t}var ot=at();function st(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ct=st();function lt(e){ct=e}var A={exec:()=>null};function j(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function M(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(N.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var ut=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),N={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:j(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:j(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:j(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:j(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:j(e=>RegExp(`^ {0,${e}}(?:</?(?:${wt})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:j(e=>RegExp(`^ {0,${e}}>`))},dt=/^(?:[ \t]*(?:\n|$))+/,ft=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,pt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,mt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ht=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,P=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,gt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_t=M(gt).replace(/bull/g,P).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),vt=M(gt).replace(/bull/g,P).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),yt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,bt=/^[^\n]+/,xt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,St=M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,xt).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ct=M(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,P).getRegex(),wt=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,F=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Tt=M(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,F).replace(`tag`,wt).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),I=e=>M(yt).replace(`hr`,mt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,wt).getRegex(),Et=I(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),L=I(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Dt={blockquote:M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,L).getRegex(),code:ft,def:St,fences:pt,heading:ht,hr:mt,html:Tt,lheading:_t,list:Ct,newline:dt,paragraph:Et,table:A,text:bt},Ot=M(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,mt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,wt).getRegex(),R={...Dt,lheading:vt,table:Ot,paragraph:M(yt).replace(`hr`,mt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Ot).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,wt).getRegex()},kt={...Dt,html:M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,F).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:A,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:M(yt).replace(`hr`,mt).replace(`heading`,` *#{1,6} *[^
4
+ ]`).replace(`lheading`,_t).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},At=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,jt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Mt=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,z=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,B=/[\p{P}\p{S}]/u,V=/[\s\p{P}\p{S}]/u,Nt=/[^\s\p{P}\p{S}]/u,Pt=M(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,V).getRegex(),Ft=/[\p{Pi}\p{Ps}"']/u,It=/(?!~)[\p{P}\p{S}]/u,Lt=/(?!~)[\s\p{P}\p{S}]/u,Rt=/(?:[^\s\p{P}\p{S}]|~)/u,zt=M(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,ut?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Bt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Vt=M(Bt,`u`).replace(/punct/g,B).getRegex(),Ht=M(Bt,`u`).replace(/punct/g,It).getRegex(),Ut=M(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Ft).replace(/punct/g,B).getRegex(),Wt=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Gt=M(Wt,`gu`).replace(/notPunctSpace/g,Nt).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Kt=M(Wt,`gu`).replace(/notPunctSpace/g,Rt).replace(/punctSpace/g,Lt).replace(/punct/g,It).getRegex(),qt=M(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Nt).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Jt=M(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Nt).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Yt=M(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Nt).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Xt=M(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,B).getRegex(),Zt=M(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Nt).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Qt=M(/\\(punct)/,`gu`).replace(/punct/g,B).getRegex(),$t=M(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,B).getRegex(),en=M(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),H=M(F).replace(`(?:-->|$)`,`-->`).getRegex(),tn=M(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,H).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),nn=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,rn=M(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,nn).getRegex(),an=M(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,rn).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),on=M(/^!?\[(label)\]\[(ref)\]/).replace(`label`,rn).replace(`ref`,xt).getRegex(),sn=M(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,xt).getRegex(),cn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,ln=M(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,nn).getRegex(),un=M(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,M(/^!?\[(label)\]\[(ref)\]/).replace(`label`,ln).replace(`ref`,cn).getRegex()).replace(`nolink`,M(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,cn).getRegex()).getRegex(),dn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,fn=M(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),U={_backpedal:A,anyPunctuation:Qt,anyPunctuationOutsideCode:$t,autolink:en,blockSkip:zt,br:Mt,code:jt,del:A,delLDelim:A,delRDelim:A,emStrongLDelim:Vt,emStrongRDelimAst:Gt,emStrongRDelimUnd:Jt,escape:At,link:an,nolink:sn,punctuation:Pt,reflink:on,reflinkSearch:un,tag:tn,text:z,url:A},pn={...U,emStrongLDelim:Ut,emStrongRDelimAst:qt,emStrongRDelimUnd:Yt,link:M(/^!?\[(label)\]\((.*?)\)/).replace(`label`,rn).getRegex(),reflink:M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,rn).getRegex()},mn={...U,emStrongRDelimAst:Kt,emStrongLDelim:Ht,delLDelim:Xt,delRDelim:Zt,url:M(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,fn).replace(`protocol`,dn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:M(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,dn).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},hn={...mn,br:M(Mt).replace(`{2,}`,`*`).getRegex(),text:M(mn.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},gn={normal:Dt,gfm:R,pedantic:kt},_n={normal:U,gfm:mn,breaks:hn,pedantic:pn},vn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},yn=e=>vn[e];function W(e,t){if(t){if(N.escapeTest.test(e))return e.replace(N.escapeReplace,yn)}else if(N.escapeTestNoEncode.test(e))return e.replace(N.escapeReplaceNoEncode,yn);return e}function bn(e){return N.numericCharacterReference.test(e)?e.replace(N.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&amp;`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&amp;`:String.fromCodePoint(r)}):e}function xn(e){try{e=encodeURI(e).replace(N.percentDecode,`%`)}catch{return null}return e}function G(e,t){let n=e.replace(N.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(N.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(N.slashPipe,`|`);return n}function K(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Sn(e){let t=e.split(`
5
+ `),n=t.length-1;for(;n>=0&&N.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
6
+ `)}function q(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function Cn(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function wn(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Tn(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function En(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
7
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
8
+ `)}function Dn(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var On=class{options;rules;lexer;constructor(e){this.options=e||ct}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Sn(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=En(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=K(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:K(t[0],`
9
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:K(t[0],`
10
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=K(t[0],`
11
+ `).split(`
12
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
13
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
14
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
15
+ ${s}`:s,r=r?`${r}
16
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
17
+ `),o=t.raw+`
18
+ `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
19
+ `).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
20
+ ${d.join(`
21
+ `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
22
+ `+e.join(`
23
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
24
+ `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
25
+ `,1)[0],d=t[1].length,f=this.options.pedantic?wn(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>wn(e,d)),p=e.split(`
26
+ `,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h);for(;e;){let c=e.split(`
27
+ `,1)[0],l;if(p=c,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),l=p):l=p.replace(this.rules.other.leadingSpaceTab,e=>wn(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(l.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
28
+ `+l.slice(h);else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||n.test(f))break;a+=`
29
+ `+p}m=!p.trim(),e=e.substring(c.length+1),f=l.slice(h)}}let ee=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(ee)&&(c=!0)),o.items.push({type:`list_item`,raw:ee,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Sn(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Cn(t[2],`()`)!==-1)return;let e=q(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:K(t[0],`
30
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=G(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
31
+ `):[],a={type:`table`,raw:K(t[0],`
32
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(G(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:K(t[0],`
33
+ `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
34
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Dn(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=K(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Cn(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),Tn(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Dn(e,n[1],r,this.rules))return;let i=t[q((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Tn(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:bn(t[0]),escaped:e}}}},J=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ct,this.options.tokenizer=this.options.tokenizer||new On,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:N,block:gn.normal,inline:_n.normal};this.options.pedantic?(t.block=gn.pedantic,t.inline=_n.pedantic):this.options.gfm&&(t.block=gn.gfm,t.inline=this.options.breaks?_n.breaks:_n.gfm),this.tokenizer.rules=t}static get rules(){return{block:gn,inline:_n}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(N.carriageReturn,`
35
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(N.tabCharGlobal,` `).replace(N.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
36
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
37
+ `)?``:`
38
+ `)+i.raw,n.text+=`
39
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
40
+ `)?``:`
41
+ `)+i.raw,n.text+=`
42
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
43
+ `)?``:`
44
+ `)+i.raw,r.text+=`
45
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
46
+ `)?``:`
47
+ `)+i.raw,n.text+=`
48
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,q(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,q(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},kn=class{options;parser;constructor(e){this.options=e||ct}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(N.notSpaceStart)?.[0],i=e?e.replace(N.endingNewline,``)+`
49
+ `:``;return r?`<pre><code class="language-`+W(r)+`">`+(n?i:W(i,!0))+`</code></pre>
50
+ `:`<pre><code>`+(n?i:W(i,!0))+`</code></pre>
51
+ `}blockquote({tokens:e}){return`<blockquote>
52
+ ${this.parser.parse(e)}</blockquote>
53
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
54
+ `}hr(e){return`<hr>
55
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
56
+ `+r+`</`+i+`>
57
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
58
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
59
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
60
+ <thead>
61
+ `+t+`</thead>
62
+ `+r+`</table>
63
+ `}tablerow({text:e}){return`<tr>
64
+ ${e}</tr>
65
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
66
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${W(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?W(n,!0):this.parser.parseInline(r),o=xn(e);if(o===null)return a;e=W(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+W(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=xn(e);if(i===null)return W(n);e=i;let a=`<img src="${W(e)}" alt="${W(n)}"`;return t&&(a+=` title="${W(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:W(e.text)}},An=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Y=class e{options;renderer;textRenderer;constructor(e){this.options=e||ct,this.options.renderer=this.options.renderer||new kn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new An}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},jn=class{options;block;constructor(e){this.options=e||ct}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?J.lex:J.lexInline}provideParser(e=this.block){return e?Y.parse:Y.parseInline}};function Mn(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var Nn=class{defaults=st();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Y;Renderer=kn;TextRenderer=An;Lexer=J;Tokenizer=On;Hooks=jn;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(Mn(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)Mn(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)Mn(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;Mn(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);Mn(n,this.walkTokens(i,t))}):e.tokens&&Mn(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new kn(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new On(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new jn;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=jn.passThroughHooks.has(n)?e=>{if(this.defaults.async&&jn.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&Mn(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return J.lex(e,t??this.defaults)}parser(e,t){return Y.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?J.lex:J.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Y.parse:Y.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?J.lex:J.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Y.parse:Y.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
67
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+W(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},X=new Nn;function Z(e,t){return X.parse(e,t)}Z.options=Z.setOptions=function(e){return X.setOptions(e),Z.defaults=X.defaults,lt(Z.defaults),Z},Z.getDefaults=st,Z.defaults=ct;function Pn(...e){return X.use(...e),Z.defaults=X.defaults,lt(Z.defaults),Z}Z.use=Pn,Z.walkTokens=function(e,t){return X.walkTokens(e,t)},Z.parseInline=X.parseInline,Z.Parser=Y,Z.parser=Y.parse,Z.Renderer=kn,Z.TextRenderer=An,Z.Lexer=J,Z.lexer=J.lex,Z.Tokenizer=On,Z.Hooks=jn,Z.parse=Z,Z.options,Z.setOptions,Z.walkTokens,Z.parseInline,Y.parse,J.lex;var Fn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Q=e=>e.replace(/[&<>"']/g,e=>Fn[e]),In=/^([a-z][a-z0-9+.-]*):/i,$=new Set([`http`,`https`,`mailto`,`tel`]),Ln=new Set([`http`,`https`]),Rn=/[\u0000-\u0020\u007f]/g,zn=(e,t)=>{let n=In.exec(e.replace(Rn,``))?.[1]?.toLowerCase();if(n!==void 0&&!t.has(n))return null;try{return encodeURI(e).replace(/%25/g,`%`)}catch(e){if(e instanceof URIError)return null;throw e}},Bn=e=>e?` title="${Q(e)}"`:``,Vn=({inLink:e=!1})=>new Nn({gfm:!0,breaks:!0,renderer:{html:({text:e,block:t})=>t?`<p>${Q(e)}</p>`:Q(e),link({href:t,title:n,tokens:r}){let i=this.parser.parseInline(r),a=e?null:zn(t,$);return a===null?i:`<a href="${Q(a)}"${Bn(n)} target="_blank" rel="noopener noreferrer nofollow">${i}</a>`},image({href:t,title:n,text:r}){let i=e?null:zn(t,Ln);return i===null?Q(r):`<img src="${Q(i)}" alt="${Q(r)}"${Bn(n)} loading="lazy">`}}}),Hn={inLink:Vn({inLink:!0}),page:Vn({})},Un=(e,t={})=>(t.inLink?Hn.inLink:Hn.page).parse(e,{async:!1}),Wn=e(r(),1),Gn=n(`break-words [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,`[&_p]:my-2 [&_ul]:my-2 [&_ol]:my-2 [&_pre]:my-2 [&_blockquote]:my-2 [&_table]:my-2 [&_hr]:my-3`,`[&_h1]:mt-4 [&_h1]:mb-2 [&_h1]:text-lg [&_h1]:font-semibold [&_h2]:mt-4 [&_h2]:mb-2 [&_h2]:text-base [&_h2]:font-semibold`,`[&_h3]:mt-3 [&_h3]:mb-1 [&_h3]:font-semibold [&_h4]:mt-3 [&_h4]:mb-1 [&_h4]:font-semibold [&_h5]:font-semibold [&_h6]:font-semibold`,`[&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_li:has(>input)]:list-none [&_li>input]:mr-1.5 [&_li>input]:-ml-5 [&_li>input]:align-middle`,`[&_a]:text-primary-text [&_a]:underline [&_a]:underline-offset-2 hover:[&_a]:text-primary-hover`,`[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.9em]`,`[&_pre]:whitespace-pre-wrap [&_pre]:rounded-md [&_pre]:bg-muted [&_pre]:p-3 [&_pre_code]:bg-transparent [&_pre_code]:p-0`,`[&_blockquote]:border-l-2 [&_blockquote]:border-border-strong [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground`,`[&_table]:w-full [&_table]:border-collapse [&_th]:border [&_th]:border-border [&_th]:bg-surface [&_th]:px-2 [&_th]:py-1 [&_th]:text-left [&_th]:font-semibold`,`[&_td]:border [&_td]:border-border [&_td]:px-2 [&_td]:py-1 [&_td]:[overflow-wrap:anywhere]`,`[&_hr]:border-border [&_img]:inline [&_img]:max-w-full [&_img]:rounded [&_del]:text-muted-foreground`),Kn=n(`[&_*]:my-0 [&_h1]:font-semibold [&_h2]:font-semibold [&_h3]:font-semibold [&_ul]:list-inside [&_ol]:list-inside [&_pre]:whitespace-pre-wrap [&_code]:font-mono [&_code]:text-[0.9em]`),qn=({source:e,inLink:t=!1,className:r})=>{let a=(0,i.useMemo)(()=>ot.sanitize(Un(e,{inLink:t}),{ADD_ATTR:[`target`]}),[e,t]);return(0,Wn.jsx)(`div`,{className:n(t?Kn:Gn,r),dangerouslySetInnerHTML:{__html:a}})};export{qn as MarkdownContent};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{a as t,c as n,n as r,o as i,s as a,t as o}from"./maplibre-9XYrB9k6.js";import{t as s}from"./jsx-runtime-NZYk81nU.js";var c=e(s(),1),l=({style:e,layers:s,position:l,zoom:u})=>(0,c.jsxs)(a,{mapLib:o,mapStyle:e,initialViewState:{...l,zoom:u},cooperativeGestures:!0,style:{width:`100%`,height:`100%`},children:[(0,c.jsx)(t,{showCompass:!1}),(0,c.jsx)(r,{layers:s}),(0,c.jsx)(i,{latitude:l.latitude,longitude:l.longitude,anchor:`bottom`,children:(0,c.jsx)(n,{"aria-hidden":!0,className:`size-8 fill-primary text-primary-foreground drop-shadow`,strokeWidth:1.5})})]});export{l as RecordMap};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{a as t,c as n,n as r,o as i,s as a,t as o}from"./maplibre-DHotMteL.js";import{t as s}from"./jsx-runtime-NZYk81nU.js";var c=e(s(),1),l=({style:e,layers:s,position:l,zoom:u})=>(0,c.jsxs)(a,{mapLib:o,mapStyle:e,initialViewState:{...l,zoom:u},cooperativeGestures:!0,style:{width:`100%`,height:`100%`},children:[(0,c.jsx)(t,{showCompass:!1}),(0,c.jsx)(r,{layers:s}),(0,c.jsx)(i,{latitude:l.latitude,longitude:l.longitude,anchor:`bottom`,children:(0,c.jsx)(n,{"aria-hidden":!0,className:`size-8 fill-primary text-primary-foreground drop-shadow`,strokeWidth:1.5})})]});export{l as RecordMap};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{d as n,rt as r}from"./app-D8i5r_6U.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./maplibre-9XYrB9k6.js";import{t as f}from"./jsx-runtime-NZYk81nU.js";var p=e(t(),1),m=512,h=85.051129,g=16,_=Array.from({length:23},(e,t)=>t),v=e=>e.type===`LineString`?e.coordinates:e.type===`MultiPolygon`?e.coordinates.flat(2):e.coordinates.flat(),y=e=>{let t=Math.max(-85.051129,Math.min(h,e))*Math.PI/180;return .5-Math.log(Math.tan(Math.PI/4+t/2))/(2*Math.PI)},b=e=>{let t=v(e),n=t.map(([e])=>e),r=t.map(([,e])=>y(e)),i=(Math.max(...n)-Math.min(...n))/360*m,a=(Math.max(...r)-Math.min(...r))*m;return Math.max(i,a)},x=(e,t)=>{let n=e.flatMap(e=>{if(!e.area)return[];let n=e.area.type===`LineString`||e.area.type===`MultiLineString`?`line`:`polygon`;return[{type:`Feature`,geometry:e.area,properties:{key:e.key,kind:n,span:b(e.area),chosen:t?.includes(e.key)??!1}}]});return{type:`FeatureCollection`,features:[...n.filter(e=>!e.properties.chosen),...n.filter(e=>e.properties.chosen)]}},S=e=>[`interpolate`,[`linear`],[`zoom`],..._.flatMap(t=>[t,[`*`,e,[`min`,1,[`max`,0,[`/`,[`-`,[`*`,[`get`,`span`],2**t],g],32]]]]])],C=e(f(),1),w=`position-area-fills`,T=[`==`,[`get`,`kind`],`polygon`],E=[`==`,[`get`,`kind`],`line`],D=(e,t)=>[`case`,[`get`,`chosen`],e,t],O=({points:e,selected:t,colors:n})=>{let r=x(e,t);if(r.features.length===0)return null;let i=[`case`,[`get`,`chosen`],n.chosen,n.area];return(0,C.jsxs)(o,{id:`position-areas`,type:`geojson`,data:r,children:[(0,C.jsx)(l,{id:w,type:`fill`,filter:T,paint:{"fill-color":i,"fill-opacity":S(D(.15,.1))}}),(0,C.jsx)(l,{id:`position-area-outlines`,type:`line`,filter:T,paint:{"line-color":i,"line-width":1.5,"line-dasharray":[3,2],"line-opacity":S(.8)}}),(0,C.jsx)(l,{id:`position-area-lines`,type:`line`,filter:E,layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-color":i,"line-width":6,"line-opacity":S(D(.6,.35))}})]})},k=(e,t)=>{let n=document.createElement(`span`);n.style.color=`var(${t})`,e.append(n);let r=getComputedStyle(n).color;n.remove();let i=document.createElement(`canvas`);i.width=1,i.height=1;let a=i.getContext(`2d`,{willReadFrequently:!0});if(!a)return r;a.fillStyle=r,a.fillRect(0,0,1,1);let[o,s,c,l]=a.getImageData(0,0,1,1).data;return`rgba(${o}, ${s}, ${c}, ${l/255})`},A=28,j={padding:48,maxZoom:15,duration:0},M={padding:48,maxZoom:16,duration:300},N=32,P=new Intl.NumberFormat(`en-IE`,{notation:`compact`,maximumFractionDigits:1}),F=e=>[[e.west,e.south],[e.east,e.north]],I=({style:e,layers:t,initial:o,points:l,buckets:f,fit:m,onFitted:h,onMove:g,selected:_,covered:v,onSelect:y,onClear:b,markerLabel:x,bucketLabel:S})=>{let T=(0,p.useRef)(null),[E,D]=(0,p.useState)([]),[I,L]=(0,p.useState)(),R=new globalThis.Map(l.map(e=>[e.key,e])),z=l.map(e=>e.key).join(`,`),B=m&&JSON.stringify(m),V=()=>{let e=T.current?.getMap();e&&D(n(l.map(t=>({key:t.key,...e.project([t.longitude,t.latitude])})),A))},H=()=>{let e=T.current?.getMap();if(!e)return;let t=e.getBounds(),n=e.getCenter();g({bounds:{south:t.getSouth(),west:t.getWest(),north:t.getNorth(),east:t.getEast()},zoom:e.getZoom()},{latitude:n.lat,longitude:n.lng,zoom:e.getZoom()})},U=()=>{let e=T.current?.getMap();e&&m&&(e.fitBounds(F(m),j),h(),H())};(0,p.useEffect)(V,[z]),(0,p.useEffect)(U,[B]);let W=E.find(e=>_!==void 0&&e.keys.some(e=>_.includes(e)))?.at;return(0,p.useEffect)(()=>{let e=T.current?.getMap(),t=W===void 0?void 0:R.get(W);if(!e||!t||v===0)return;let{y:n}=e.project([t.longitude,t.latitude]),r=e.getContainer().clientHeight-v;n>N&&n<r||e.easeTo({center:[t.longitude,t.latitude],offset:[0,(N-v)/2],duration:300})},[W,v]),(0,C.jsxs)(u,{ref:T,mapLib:d,mapStyle:e,initialViewState:o??{latitude:0,longitude:0,zoom:1},style:{width:`100%`,height:`100%`},onLoad:()=>{let e=T.current.getMap().getContainer();L({area:k(e,`--primary`),chosen:k(e,`--foreground`)}),V(),m?U():H()},onZoomEnd:V,onMoveEnd:H,onClick:b,children:[(0,C.jsx)(i,{showCompass:!1}),(0,C.jsx)(s,{layers:t,below:w}),I&&(0,C.jsx)(O,{points:l,selected:_,colors:I}),f.map(e=>(0,C.jsx)(c,{latitude:e.latitude,longitude:e.longitude,anchor:`center`,children:(0,C.jsx)(`button`,{type:`button`,"aria-label":S(e.count),className:`flex size-10 cursor-pointer items-center justify-center rounded-full border-2 border-background bg-primary text-xs font-semibold text-primary-foreground tabular-nums shadow`,onClick:t=>{t.stopPropagation(),T.current?.getMap().fitBounds(F(e.bounds),M)},children:P.format(e.count)})},`${e.latitude},${e.longitude}`)),E.map(e=>{let t=R.get(e.at);if(!t)return null;let n=_!==void 0&&e.keys.some(e=>_.includes(e)),i=e.keys.every(e=>R.get(e)?.approximate);return(0,C.jsx)(c,{latitude:t.latitude,longitude:t.longitude,anchor:`bottom`,style:{zIndex:+!!n},children:(0,C.jsxs)(`button`,{type:`button`,"aria-label":x(e.keys),"aria-pressed":n,className:`relative block cursor-pointer`,onClick:t=>{t.stopPropagation(),y(e.keys)},children:[(0,C.jsx)(a,{"aria-hidden":!0,"data-approximate":i||void 0,className:r(`size-8 drop-shadow`,i?n?`fill-background text-foreground`:`fill-background text-primary`:n?`fill-foreground text-background`:`fill-primary text-primary-foreground`),strokeWidth:i?2:1.5,strokeDasharray:i?`3 2`:void 0}),e.keys.length>1&&(0,C.jsx)(`span`,{className:`absolute -right-2 -top-1 min-w-5 rounded-full border border-background bg-foreground px-1 text-center text-[11px] font-medium leading-4 text-background tabular-nums`,children:e.keys.length})]})},e.at)})]})};export{I as RecordsMap};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{lt as n,u as r}from"./app-GKl91FLS.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./maplibre-DHotMteL.js";import{t as f}from"./jsx-runtime-NZYk81nU.js";var p=e(t(),1),m=512,h=85.051129,g=16,_=Array.from({length:23},(e,t)=>t),v=e=>e.type===`LineString`?e.coordinates:e.type===`MultiPolygon`?e.coordinates.flat(2):e.coordinates.flat(),y=e=>{let t=Math.max(-85.051129,Math.min(h,e))*Math.PI/180;return .5-Math.log(Math.tan(Math.PI/4+t/2))/(2*Math.PI)},b=e=>{let t=v(e),n=t.map(([e])=>e),r=t.map(([,e])=>y(e)),i=(Math.max(...n)-Math.min(...n))/360*m,a=(Math.max(...r)-Math.min(...r))*m;return Math.max(i,a)},x=(e,t)=>{let n=e.flatMap(e=>{if(!e.area)return[];let n=e.area.type===`LineString`||e.area.type===`MultiLineString`?`line`:`polygon`;return[{type:`Feature`,geometry:e.area,properties:{key:e.key,kind:n,span:b(e.area),chosen:t?.includes(e.key)??!1}}]});return{type:`FeatureCollection`,features:[...n.filter(e=>!e.properties.chosen),...n.filter(e=>e.properties.chosen)]}},S=e=>[`interpolate`,[`linear`],[`zoom`],..._.flatMap(t=>[t,[`*`,e,[`min`,1,[`max`,0,[`/`,[`-`,[`*`,[`get`,`span`],2**t],g],32]]]]])],C=e(f(),1),w=`position-area-fills`,T=[`==`,[`get`,`kind`],`polygon`],E=[`==`,[`get`,`kind`],`line`],D=(e,t)=>[`case`,[`get`,`chosen`],e,t],O=({points:e,selected:t,colors:n})=>{let r=x(e,t);if(r.features.length===0)return null;let i=[`case`,[`get`,`chosen`],n.chosen,n.area];return(0,C.jsxs)(o,{id:`position-areas`,type:`geojson`,data:r,children:[(0,C.jsx)(l,{id:w,type:`fill`,filter:T,paint:{"fill-color":i,"fill-opacity":S(D(.15,.1))}}),(0,C.jsx)(l,{id:`position-area-outlines`,type:`line`,filter:T,paint:{"line-color":i,"line-width":1.5,"line-dasharray":[3,2],"line-opacity":S(.8)}}),(0,C.jsx)(l,{id:`position-area-lines`,type:`line`,filter:E,layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-color":i,"line-width":6,"line-opacity":S(D(.6,.35))}})]})},k=(e,t)=>{let n=document.createElement(`span`);n.style.color=`var(${t})`,e.append(n);let r=getComputedStyle(n).color;n.remove();let i=document.createElement(`canvas`);i.width=1,i.height=1;let a=i.getContext(`2d`,{willReadFrequently:!0});if(!a)return r;a.fillStyle=r,a.fillRect(0,0,1,1);let[o,s,c,l]=a.getImageData(0,0,1,1).data;return`rgba(${o}, ${s}, ${c}, ${l/255})`},A=28,j={padding:48,maxZoom:15,duration:0},M={padding:48,maxZoom:16,duration:300},N=32,P=new Intl.NumberFormat(`en-IE`,{notation:`compact`,maximumFractionDigits:1}),F=e=>[[e.west,e.south],[e.east,e.north]],I=({style:e,layers:t,initial:o,points:l,buckets:f,fit:m,onFitted:h,onMove:g,selected:_,covered:v,onSelect:y,onClear:b,markerLabel:x,bucketLabel:S})=>{let T=(0,p.useRef)(null),[E,D]=(0,p.useState)([]),[I,L]=(0,p.useState)(),R=new globalThis.Map(l.map(e=>[e.key,e])),z=l.map(e=>e.key).join(`,`),B=m&&JSON.stringify(m),V=()=>{let e=T.current?.getMap();e&&D(r(l.map(t=>({key:t.key,...e.project([t.longitude,t.latitude])})),A))},H=()=>{let e=T.current?.getMap();if(!e)return;let t=e.getBounds(),n=e.getCenter();g({bounds:{south:t.getSouth(),west:t.getWest(),north:t.getNorth(),east:t.getEast()},zoom:e.getZoom()},{latitude:n.lat,longitude:n.lng,zoom:e.getZoom()})},U=()=>{let e=T.current?.getMap();e&&m&&(e.fitBounds(F(m),j),h(),H())};(0,p.useEffect)(V,[z]),(0,p.useEffect)(U,[B]);let W=E.find(e=>_!==void 0&&e.keys.some(e=>_.includes(e)))?.at;return(0,p.useEffect)(()=>{let e=T.current?.getMap(),t=W===void 0?void 0:R.get(W);if(!e||!t||v===0)return;let{y:n}=e.project([t.longitude,t.latitude]),r=e.getContainer().clientHeight-v;n>N&&n<r||e.easeTo({center:[t.longitude,t.latitude],offset:[0,(N-v)/2],duration:300})},[W,v]),(0,C.jsxs)(u,{ref:T,mapLib:d,mapStyle:e,initialViewState:o??{latitude:0,longitude:0,zoom:1},style:{width:`100%`,height:`100%`},onLoad:()=>{let e=T.current.getMap().getContainer();L({area:k(e,`--primary`),chosen:k(e,`--foreground`)}),V(),m?U():H()},onZoomEnd:V,onMoveEnd:H,onClick:b,children:[(0,C.jsx)(i,{showCompass:!1}),(0,C.jsx)(s,{layers:t,below:w}),I&&(0,C.jsx)(O,{points:l,selected:_,colors:I}),f.map(e=>(0,C.jsx)(c,{latitude:e.latitude,longitude:e.longitude,anchor:`center`,children:(0,C.jsx)(`button`,{type:`button`,"aria-label":S(e.count),className:`flex size-10 cursor-pointer items-center justify-center rounded-full border-2 border-background bg-primary text-xs font-semibold text-primary-foreground tabular-nums shadow`,onClick:t=>{t.stopPropagation(),T.current?.getMap().fitBounds(F(e.bounds),M)},children:P.format(e.count)})},`${e.latitude},${e.longitude}`)),E.map(e=>{let t=R.get(e.at);if(!t)return null;let r=_!==void 0&&e.keys.some(e=>_.includes(e)),i=e.keys.every(e=>R.get(e)?.approximate);return(0,C.jsx)(c,{latitude:t.latitude,longitude:t.longitude,anchor:`bottom`,style:{zIndex:+!!r},children:(0,C.jsxs)(`button`,{type:`button`,"aria-label":x(e.keys),"aria-pressed":r,className:`relative block cursor-pointer`,onClick:t=>{t.stopPropagation(),y(e.keys)},children:[(0,C.jsx)(a,{"aria-hidden":!0,"data-approximate":i||void 0,className:n(`size-8 drop-shadow`,i?r?`fill-background text-foreground`:`fill-background text-primary`:r?`fill-foreground text-background`:`fill-primary text-primary-foreground`),strokeWidth:i?2:1.5,strokeDasharray:i?`3 2`:void 0}),e.keys.length>1&&(0,C.jsx)(`span`,{className:`absolute -right-2 -top-1 min-w-5 rounded-full border border-background bg-foreground px-1 text-center text-[11px] font-medium leading-4 text-background tabular-nums`,children:e.keys.length})]})},e.at)})]})};export{I as RecordsMap};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$ as t,A as n,B as r,C as i,D as a,E as o,F as s,G as c,H as ee,I as te,J as ne,K as l,L as u,M as d,N as f,O as p,P as m,Q as h,R as g,S as _,T as v,U as y,V as b,W as x,X as S,Y as C,Z as w,_ as T,a as E,at as D,b as O,c as k,ct as A,d as j,et as M,f as re,g as N,h as P,i as F,it as I,j as L,k as R,l as z,lt as B,m as V,n as H,nt as U,o as W,p as G,r as K,rt as q,s as J,st as Y,t as X,tt as ie,v as Z,w as ae,x as oe,y as se,z as ce}from"./app-GKl91FLS.js";import{t as le}from"./jsx-runtime-NZYk81nU.js";var Q=e(le(),1),$=({row:e,resource:t,recordKey:n,...r})=>{let i=re(),a=O(),o=t??i?.resource??a?.model.name;if(o===void 0)throw Error(`RecordLink needs a resource outside a list display or a record`);return(0,Q.jsx)(Z,{to:{kind:`record`,resource:o,key:e?e.key:n},...r})},ue=({name:e,label:t,options:n,value:r,onChange:i})=>(0,Q.jsx)(`div`,{role:`radiogroup`,"aria-label":t,className:`flex flex-col gap-2`,children:n.map(t=>(0,Q.jsxs)(`label`,{className:B(`block rounded-lg border p-3 transition-colors has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-primary`,t.disabled?`cursor-default bg-background opacity-60`:t.value===r?`cursor-pointer border-primary bg-primary-soft`:`cursor-pointer bg-background hover:bg-surface`),children:[(0,Q.jsx)(`input`,{type:`radio`,name:e,value:t.value,checked:t.value===r,disabled:t.disabled,onChange:()=>i(t.value),className:`sr-only`}),(0,Q.jsx)(`span`,{className:B(`block font-medium`,t.value===r&&`text-primary-text`),children:t.label}),t.description&&(0,Q.jsx)(`span`,{className:`mt-0.5 block text-xs leading-snug text-muted-foreground`,children:t.description})]},t.value))});export{s as ActionCard,w as ApiProvider,X as App,Z as AppLink,ae as AssistantDock,S as AuthLayout,U as Button,ce as ChatMessage,g as ChatThread,ue as Choices,ne as CodeForm,f as CompactTable,u as Composer,ie as Dialog,n as DiffView,T as Field,m as FieldList,k as Form,D as Input,A as LogoMark,z as MenuSelect,M as OtpInput,o as PartView,$ as RecordLink,C as ResendCodeButton,V as ResponsiveDialog,N as Section,Y as Segmented,te as SidePanel,G as SignInPrompt,I as Spinner,R as StepList,P as Textarea,q as buttonClass,a as definePlugin,p as defineUi,L as diffStats,H as isConflict,c as mergeUi,d as parseDiff,ee as pluginApi,y as protobaseVersion,l as uiFromModule,b as useApiToken,se as useAppAddress,i as useAssistant,_ as useAssistantClient,v as useBackendData,h as useClient,E as useFacets,W as useHistogram,O as useLayoutRecord,F as useList,j as useListDisplay,oe as useMeta,x as usePlugin,r as useRecord,t as useResourceClient,J as useSeries,K as useUpdateRecord};
@@ -16,15 +16,15 @@
16
16
  }
17
17
  document.documentElement.dataset.theme = stored === 'light' || stored === 'dark' ? stored : matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
18
18
  </script>
19
- <script type="importmap">{"imports":{"react":"/assets/shared-react-DhkZ2M4l.js","react/jsx-runtime":"/assets/shared-react-jsx-runtime-xPQrWk0g.js","react-dom":"/assets/shared-react-dom-D508a1cq.js","@protobase/ui":"/assets/shared-protobase-ui-CN1HmyDa.js"}}</script>
20
- <script type="module" crossorigin src="/assets/index-cMmFPuUQ.js"></script>
19
+ <script type="importmap">{"imports":{"react":"/assets/shared-react-DhkZ2M4l.js","react/jsx-runtime":"/assets/shared-react-jsx-runtime-xPQrWk0g.js","react-dom":"/assets/shared-react-dom-D508a1cq.js","@protobase/ui":"/assets/shared-protobase-ui-D7kkYiTL.js"}}</script>
20
+ <script type="module" crossorigin src="/assets/index-BB2BN-6s.js"></script>
21
21
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
22
22
  <link rel="modulepreload" crossorigin href="/assets/react-Cvdyeg_0.js">
23
23
  <link rel="modulepreload" crossorigin href="/assets/react-dom-B-VxWsjA.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-NZYk81nU.js">
25
- <link rel="modulepreload" crossorigin href="/assets/app-D8i5r_6U.js">
25
+ <link rel="modulepreload" crossorigin href="/assets/app-GKl91FLS.js">
26
26
  <link rel="stylesheet" crossorigin href="/assets/app-GUjJKojE.css">
27
- <link rel="stylesheet" crossorigin href="/assets/index-Cuulz26c.css">
27
+ <link rel="stylesheet" crossorigin href="/assets/index-DxV5Rp_F.css">
28
28
  <link rel="stylesheet" href="/protobase.theme.css">
29
29
  <link rel="icon" type="image/svg+xml" href="/protobase.favicon.svg">
30
30
  </head>
@@ -1,5 +1,5 @@
1
1
  {
2
- "protobase": "0.19.8",
2
+ "protobase": "0.19.10",
3
3
  "pluginApi": 1,
4
4
  "paths": [
5
5
  "/index.html",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/ui",
3
- "version": "0.19.8",
3
+ "version": "0.19.10",
4
4
  "description": "The Protobase admin app and the React hooks and components for custom UI.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -39,15 +39,17 @@
39
39
  "dependencies": {
40
40
  "@dnd-kit/core": "^6.3.1",
41
41
  "@dnd-kit/sortable": "^10.0.0",
42
- "@protobase/client": "0.19.8",
43
- "@protobase/layout": "0.19.8",
44
- "@protobase/schema": "0.19.8",
42
+ "@protobase/client": "0.19.10",
43
+ "@protobase/layout": "0.19.10",
44
+ "@protobase/schema": "0.19.10",
45
45
  "@sentry/browser": "^11.7.0",
46
46
  "@tanstack/react-query": "^5.104.1",
47
47
  "@tanstack/react-table": "^9.2.6",
48
+ "dompurify": "^3.4.17",
48
49
  "fflate": "^0.8.3",
49
50
  "lucide-react": "^1.52.0",
50
51
  "maplibre-gl": "^6.14.0",
52
+ "marked": "^18.1.1",
51
53
  "pmtiles": "^4.5.0",
52
54
  "react": "^19.3.0",
53
55
  "react-dom": "^19.3.0",