@sentropic/design-system-elements 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # @sentropic/design-system-elements
2
2
 
3
- JSON-render standard, lot L2: thin Svelte custom-element wrappers over the
3
+ JSON-render standard, lots L2/L6: thin Svelte custom-element wrappers over the
4
4
  catalogue components of the sentropic design system. One ESM browser bundle
5
- registers three elements:
5
+ registers three elements (lot L6 imposes the Focus renderer defaults
6
+ F-R0–F-R7 on the dossier engine chunk; see below):
6
7
 
7
8
  | Element | Catalogue component | Engine chunk (§6.6) |
8
9
  | --- | --- | --- |
@@ -78,7 +79,46 @@ interface IntentDetail {
78
79
 
79
80
  | Interaction | Element behaviour |
80
81
  | --- | --- |
81
- | option card click / keyboard activation (when enabled) | `st-intent` `choose-option`, `target = <option id>`; an option gated inert by an `interactions` entry `{ name: "choose-option", targetRef, enabled: false }` dispatches nothing |
82
+ | option card click / keyboard activation (when enabled) | `st-intent` `choose-option`, `target = <option id>`; an option gated inert by an `interactions` entry `{ name: "choose-option", targetRef, enabled: false }` renders as an inert card and dispatches nothing |
83
+ | card click again / another card (single-selection rule) | local renderer state only: reselecting clears the card with no emission, choosing another card moves the selection with one emission; the envelope and the document are never written back |
84
+ | expand control on a long card | toggles the folded argument, emits nothing, never selects |
85
+
86
+ ### Dossier renderer defaults (F-R0–F-R7, lot L6)
87
+
88
+ The `focus-renderer` chunk (`src/element/dom/engines/focus-renderer.ts` plus
89
+ its stylesheet `dossier-styles.ts`) imposes the §11.2 defaults; the author
90
+ cannot work around them:
91
+
92
+ - F-R0: no author layout property exists anywhere — a `layout` hint at
93
+ `root` level is refused by the catalogue structure and one inside the
94
+ document by the embedded focus schema, both with `schema-violation`
95
+ (§4.5 panel, never a partial dossier).
96
+ - F-R1: the whole option card is the single selection control (one node
97
+ carries both `data-option-card` and `data-option-id`).
98
+ - F-R2: card outlines are `1px solid var(--st-…)`; every colour resolves to
99
+ a `--st-*` token and no rule exceeds 1 px (static scan in
100
+ `tests/focus-renderer-l6.test.ts`, computed scan in
101
+ `tests/browser/chromium-suite.mjs`).
102
+ - F-R3: selection is a light local state (1 px outline change and/or token
103
+ tint, no layout shift); F-R7: nothing is ever preselected, not even the
104
+ recommended option.
105
+ - F-R4: an argument over 300 characters (the option `body`, else its
106
+ label-plus-consequence text) renders collapsed with a labelled expand
107
+ control; shorter arguments render fully with no fold control.
108
+ - F-R5: the renderer alone picks `list` (any long option, or one or two
109
+ options) or `grid` (three or more short options, capped at two columns),
110
+ exposed as `data-st-layout` (`decideOptionSetLayout`).
111
+ - F-R6: annotations render as display state only — no per-option control
112
+ besides the card (and the fold control on long cards).
113
+ - F-R7: the recommended option carries one discreet badge; an unmatched
114
+ `recommendedAnswer` renders as question context text, never as a
115
+ preselection.
116
+
117
+ Content parity with the owner `renderHtml` is witnessed on the
118
+ presentation-valid fixtures (`tests/focus-renderer-l6.test.ts`); inputs the
119
+ owner presentation gate refuses (long bodies, legacy documents) still render
120
+ their sections, ids and outcome from the input. Diagrams render as the
121
+ fenced fallback until a diagram renderer exists.
82
122
 
83
123
  ### `st-bpmn-canvas` (`BpmnCanvas`)
84
124
 
@@ -103,8 +143,11 @@ the wrappers define no font of their own (the content inherits the page's).
103
143
  (`npm run build:browser` re-runs the bundle step alone). `sri.json` lists
104
144
  every file with raw / gzip / brotli sizes and a sha384 integrity hash
105
145
  (`sri.json` never lists itself). The §6.6 core budget — the entry closure
106
- that renders `<st-bar-chart>` — is 53,916 B gzip of the 153,600 B budget
107
- (re-measured at 0.1.0; 23 files pinned by `sri.json`).
146
+ that renders `<st-bar-chart>` — is 53,920 B gzip of the 153,600 B budget
147
+ (53,919 B at L7a, +1 B rebuild variance; 23 files pinned by `sri.json`).
148
+ The L6 `focus` chunk is 21,174 B gzip (19,073 B at L7a, +2,101 B for the
149
+ stylesheet, fold/layout and selection logic); core + focus raw bytes stay
150
+ far under the §8.3 2 MiB `ui://` resource budget.
108
151
  The bundle is eval-free (§6.4: no `eval`, no `new Function` in any chunk —
109
152
  enforced by `scripts/elements-browser-artifacts.test.mjs`), works mounted
110
153
  under any subpath (no document-anchored preload hints), and needs no
@@ -117,7 +160,7 @@ pinned — never a range, never `latest` (the version segment is bumped with
117
160
  each release):
118
161
 
119
162
  ```
120
- https://cdn.jsdelivr.net/npm/@sentropic/design-system-elements@0.1.0/dist/browser/
163
+ https://cdn.jsdelivr.net/npm/@sentropic/design-system-elements@0.2.0/dist/browser/
121
164
  ```
122
165
 
123
166
  Load the entry with its integrity hash (the sha384 from
@@ -125,7 +168,7 @@ Load the entry with its integrity hash (the sha384 from
125
168
 
126
169
  ```html
127
170
  <script type="module"
128
- src="https://cdn.jsdelivr.net/npm/@sentropic/design-system-elements@0.1.0/dist/browser/elements.js"
171
+ src="https://cdn.jsdelivr.net/npm/@sentropic/design-system-elements@0.2.0/dist/browser/elements.js"
129
172
  integrity="sha384-<hash from dist/browser/sri.json>"
130
173
  crossorigin="anonymous"></script>
131
174
  ```
@@ -0,0 +1,10 @@
1
+ function e(e,t){this.v=e,this.k=t}function t(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 n(e){if(Array.isArray(e))return e}function r(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 i(){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 a(e,t){return n(e)||r(e,t)||o(e,t)||i()}function o(e,n){if(e){if(typeof e==`string`)return t(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function s(t){var n,r;function i(n,r){try{var o=t[n](r),s=o.value,c=s instanceof e;Promise.resolve(c?s.v:s).then(function(e){if(c){var r=n===`return`&&s.k?n:`next`;if(!s.k||e.done)return i(r,e);e=t[r](e).value}a(!!o.done,e)},function(e){i(`throw`,e)})}catch(e){a(2,e)}}function a(e,t){e===2?n.reject(t):n.resolve({value:t,done:e}),(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(a,o){var s={key:e,arg:t,resolve:a,reject:o,next:null};r?r=r.next=s:(n=r=s,i(e,t))})},typeof t.return!=`function`&&(this.return=void 0)}s.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},s.prototype.next=function(e){return this._invoke(`next`,e)},s.prototype.throw=function(e){return this._invoke(`throw`,e)},s.prototype.return=function(e){return this._invoke(`return`,e)};var c=Object.entries,l=Object.setPrototypeOf,u=Object.isFrozen,d=Object.getPrototypeOf,f=Object.getOwnPropertyDescriptor,p=Object.freeze,m=Object.seal,h=Object.create,ee=typeof Reflect<`u`&&Reflect,g=ee.apply,_=ee.construct;p||=function(e){return e},m||=function(e){return e},g||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},_||=function(e){return new e(...[...arguments].slice(1))};var v=E(Array.prototype.forEach);Array.prototype.indexOf;var y=E(Array.prototype.lastIndexOf),te=E(Array.prototype.pop),b=E(Array.prototype.push),ne=E(Array.prototype.slice),re=E(Array.prototype.splice),ie=Array.isArray,ae=D(Set),oe=E(Set.prototype.add),se=E(Set.prototype.has),ce=E(String.prototype.toLowerCase),le=E(String.prototype.toString),ue=E(String.prototype.match),de=E(String.prototype.replace),fe=E(String.prototype.indexOf),pe=E(String.prototype.trim),me=E(Number.prototype.toString),he=E(Boolean.prototype.toString),x=typeof BigInt>`u`?null:E(BigInt.prototype.toString),ge=typeof Symbol>`u`?null:E(Symbol.prototype.toString),S=E(Object.prototype.hasOwnProperty),C=E(Object.prototype.toString),w=E(RegExp.prototype.test),T=D(TypeError);function E(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return g(e,t,n)}}function D(e){return function(){return _(e,[...arguments])}}function O(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ce;if(l&&l(e,null),!ie(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(u(t)||(t[r]=e),i=e)}e[i]=!0}return e}function _e(e){for(let t=0;t<e.length;t++)S(e,t)||(e[t]=null);return e}function k(e){let t=h(null);for(let r of c(e)){var n=a(r,2);let i=n[0],o=n[1];S(e,i)&&(t[i]=ie(o)?_e(o):o&&typeof o==`object`&&o.constructor===Object?k(o):o)}return t}function ve(e){switch(typeof e){case`string`:return e;case`number`:return me(e);case`boolean`:return he(e);case`bigint`:return x?x(e):`0`;case`symbol`:return ge?ge(e):`Symbol()`;case`undefined`:return C(e);case`function`:case`object`:{if(e===null)return C(e);let t=e,n=A(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:C(e)}return C(e)}default:return C(e)}}function A(e,t){for(;e!==null;){let n=f(e,t);if(n){if(n.get)return E(n.get);if(typeof n.value==`function`)return E(n.value)}e=d(e)}function n(){return null}return n}function ye(e,t){for(;e!==null;){let n=f(e,t);if(n)return n.get?E(n.get):null;e=d(e)}return null}function be(e){try{return w(e,``),!0}catch{return!1}}var xe=p(`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(`.`)),Se=p(`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(`.`)),Ce=p([`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`]),we=p([`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`]),Te=p(`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(`.`)),Ee=p([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),De=p([`#text`]),Oe=p(`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(`.`)),ke=p(`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(`.`)),Ae=p(`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(`.`)),je=p([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Me=m(/{{[\w\W]*|^[\w\W]*}}/g),Ne=m(/<%[\w\W]*|^[\w\W]*%>/g),Pe=m(/\${[\w\W]*/g),Fe=m(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ie=m(/^aria-[\-\w]+$/),Le=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Re=m(/^(?:\w+script|data):/i),ze=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Be=m(/^html$/i),Ve=m(/^[a-z][.\w]*(-[.\w]+)+$/i),He=m(/<[/\w!]/g),Ue=m(/<[/\w]/g),We=m(/<\/no(script|embed|frames)/i),Ge=m(/\/>/i),j={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ke=p(O({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),qe=function(){return typeof window>`u`?null:window},Je=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}},Ye=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},M=function(e,t,n,r){return S(e,t)&&ie(e[t])?O(r.base?k(r.base):{},e[t],r.transform):n},Xe=function(e,t,n){let r=S(e,t)?e[t]:void 0;return r&&typeof r==`object`?k(r):n()};function Ze(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qe(),t=e=>Ze(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==j.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,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,d=e.trustedTypes,f=s.prototype,ee=A(f,`cloneNode`),g=A(f,`remove`),_=A(f,`removeAttributeNode`),me=A(f,`nextSibling`),he=A(f,`childNodes`),x=A(f,`parentNode`),ge=A(f,`shadowRoot`),C=A(f,`attributes`),E=o&&o.prototype?A(o.prototype,`nodeType`):null,D=o&&o.prototype?A(o.prototype,`nodeName`):null,_e=o&&o.prototype?A(o.prototype,`ownerDocument`):null,N=function(e){return E?E(e):e.nodeType},Qe=function(e){return D?D(e):e.nodeName},P=ye(f,`namespaceURI`),F=function(e){return P?P(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let I,L=``,$e,et=!1,tt=0,R=function(){if(tt>0)throw T(`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.`)},nt=function(e){R(),tt++;try{return I.createHTML(e)}finally{tt--}},rt=function(e){R(),tt++;try{return I.createScriptURL(e)}finally{tt--}},it=function(){return et||=($e=Je(d,i),!0),$e},at=n,ot=at.implementation,st=at.createNodeIterator,ct=at.createDocumentFragment,lt=at.getElementsByTagName,z=r.importNode,B=Ye();t.isSupported=typeof c==`function`&&typeof x==`function`&&ot&&ot.createHTMLDocument!==void 0;let ut=Me,dt=Ne,ft=Pe,pt=Fe,mt=Ie,ht=Re,gt=ze,_t=Ve,vt=Le,V=null,yt=O({},[...xe,...Se,...Ce,...Te,...De]),H=null,bt=O({},[...Oe,...ke,...Ae,...je]),U=Object.seal(h(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}})),xt=null,St=null,W=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ct=!0,wt=!0,Tt=!1,Et=!0,G=!1,K=!0,q=!1,Dt=!1,Ot=null,kt=null,At=!1,J=!1,Y=!1,jt=!1,Mt=!0,Nt=!1,Pt=`user-content-`,Ft=!0,It=!1,X=null,Lt={},Rt=null,zt=O({},`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(`.`)),Bt=null,Vt=O({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ht=null,Ut=O({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Wt=`http://www.w3.org/1998/Math/MathML`,Gt=`http://www.w3.org/2000/svg`,Z=`http://www.w3.org/1999/xhtml`,Kt=Z,qt=!1,Jt=null,Yt=O({},[Wt,Gt,Z],le),Xt=p([`mi`,`mo`,`mn`,`ms`,`mtext`]),Zt=O({},Xt),Qt=p([`annotation-xml`]),$t=O({},Qt),en=O({},[`title`,`style`,`font`,`a`,`script`]),tn=null,nn=[`application/xhtml+xml`,`text/html`],Q=null,rn=null,an=n.createElement(`form`),on=function(e){return e instanceof RegExp||e instanceof Function},sn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(rn&&rn===e)return;(!e||typeof e!=`object`)&&(e={}),e=k(e),tn=nn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Q=tn===`application/xhtml+xml`?le:ce,V=M(e,`ALLOWED_TAGS`,yt,{transform:Q}),H=M(e,`ALLOWED_ATTR`,bt,{transform:Q}),Jt=M(e,`ALLOWED_NAMESPACES`,Yt,{transform:le}),Ht=M(e,`ADD_URI_SAFE_ATTR`,Ut,{transform:Q,base:Ut}),Bt=M(e,`ADD_DATA_URI_TAGS`,Vt,{transform:Q,base:Vt}),Rt=M(e,`FORBID_CONTENTS`,zt,{transform:Q}),xt=M(e,`FORBID_TAGS`,k({}),{transform:Q}),St=M(e,`FORBID_ATTR`,k({}),{transform:Q}),Lt=S(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?k(e.USE_PROFILES):e.USE_PROFILES:!1,Ct=e.ALLOW_ARIA_ATTR!==!1,wt=e.ALLOW_DATA_ATTR!==!1,Tt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Et=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=e.SAFE_FOR_TEMPLATES||!1,K=e.SAFE_FOR_XML!==!1,q=e.WHOLE_DOCUMENT||!1,J=e.RETURN_DOM||!1,Y=e.RETURN_DOM_FRAGMENT||!1,jt=e.RETURN_TRUSTED_TYPE||!1,At=e.FORCE_BODY||!1,Mt=e.SANITIZE_DOM!==!1,Nt=e.SANITIZE_NAMED_PROPS||!1,Ft=e.KEEP_CONTENT!==!1,It=e.IN_PLACE||!1,vt=be(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Le,Kt=typeof e.NAMESPACE==`string`?e.NAMESPACE:Z,Zt=Xe(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>O({},Xt)),$t=Xe(e,`HTML_INTEGRATION_POINTS`,()=>O({},Qt));let t=Xe(e,`CUSTOM_ELEMENT_HANDLING`,()=>h(null));if(U=h(null),S(t,`tagNameCheck`)&&on(t.tagNameCheck)&&(U.tagNameCheck=t.tagNameCheck),S(t,`attributeNameCheck`)&&on(t.attributeNameCheck)&&(U.attributeNameCheck=t.attributeNameCheck),S(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(U.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),m(U),G&&(wt=!1),Y&&(J=!0),Lt&&(V=O({},De),H=h(null),Lt.html===!0&&(O(V,xe),O(H,Oe)),Lt.svg===!0&&(O(V,Se),O(H,ke),O(H,je)),Lt.svgFilters===!0&&(O(V,Ce),O(H,ke),O(H,je)),Lt.mathMl===!0&&(O(V,Te),O(H,Ae),O(H,je))),W.tagCheck=null,W.attributeCheck=null,S(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?W.tagCheck=e.ADD_TAGS:ie(e.ADD_TAGS)&&(V===yt&&(V=k(V)),O(V,e.ADD_TAGS,Q))),S(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?W.attributeCheck=e.ADD_ATTR:ie(e.ADD_ATTR)&&(H===bt&&(H=k(H)),O(H,e.ADD_ATTR,Q))),S(e,`ADD_FORBID_CONTENTS`)&&ie(e.ADD_FORBID_CONTENTS)&&(Rt===zt&&(Rt=k(Rt)),O(Rt,e.ADD_FORBID_CONTENTS,Q)),Ft&&(V[`#text`]=!0),q&&O(V,[`html`,`head`,`body`]),V.table&&(O(V,[`tbody`]),delete xt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=I;I=e.TRUSTED_TYPES_POLICY;try{L=nt(``)}catch(e){throw I=t,e}}else e.TRUSTED_TYPES_POLICY===null?(I=void 0,L=``):(I===void 0&&(I=it()),I&&typeof L==`string`&&(L=nt(``)));p&&p(e),rn=e},cn=O({},[...Se,...Ce,...we]),ln=O({},[...Te,...Ee]),un=function(e,t,n){return t.namespaceURI===Z?e===`svg`:t.namespaceURI===Wt?e===`svg`&&(n===`annotation-xml`||Zt[n]):!!cn[e]},dn=function(e,t,n){return t.namespaceURI===Z?e===`math`:t.namespaceURI===Gt?e===`math`&&$t[n]:!!ln[e]},fn=function(e,t,n){return t.namespaceURI===Gt&&!$t[n]||t.namespaceURI===Wt&&!Zt[n]?!1:!ln[e]&&(en[e]||!cn[e])},pn=function(e){let t=F(e),n=ce(Qe(e)),r=x(e),i,a;return r&&N(r)===j.element?(i={namespaceURI:F(r)},a=ce(Qe(r))):(i={namespaceURI:Kt},a=`template`),Jt[t]?t===Gt?un(n,i,a):t===Wt?dn(n,i,a):t===Z?fn(n,i,a):!!(tn===`application/xhtml+xml`&&Jt[t]):!1},mn=function(e){b(t.removed,{element:e});try{x(e).removeChild(e)}catch{if(g(e),!x(e))throw T(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},hn=function(e,t,n){try{_(e,t)}catch{try{e.removeAttribute(n)}catch{}}},gn=function(e){bn(e);let t=he(e);t&&v(ne(t),e=>{try{g(e)}catch{}});let n=N(e)===j.element?C(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&hn(e,r,i)}},_n=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}b(t.removed,{attribute:r||null,from:n});try{r?_(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(J||Y)try{mn(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},vn=function(e){let t=C(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||H[Q(i)]||hn(e,r,i)}},yn=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&&N(e)===j.element){let t=ge(e);Fn(t)&&r.push(t)}let i=he(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},bn=function(e){yn(e,e=>{N(e)===j.element&&vn(e)})},xn=function(e){let t=[];return yn(e,e=>{t.push(e)},!0),t},Sn=function(e,t){let n=ae();v(xn(e),e=>{N(e)===j.element&&oe(n,e)}),v(t,e=>{N(e)===j.element&&!se(n,e)&&vn(e)})},Cn=function(e,n){let r=!1;return v(t.removed,t=>{t.element&&(r||=t.element===e,bn(t.element))}),Sn(e,n),r},wn=function(e,t){let n=X,r=null,i=()=>(r||(r=ae(),v(t,e=>{oe(r,e)})),r);for(let t=0;;t++){let r=xn(e),a=[e],o=!1;if(v(r,e=>{N(e)===j.documentFragment?b(a,e):!o&&!se(n,e)&&(o=se(i(),e))}),!o)return;if(t>=8)throw T(`the tree kept changing during in-place sanitization; refusing to return it`);v(a,(t,n)=>{Tn(t,n>0,e,i())})}},Tn=function(e,t,n,r){let i=An(e),a;for(;a=i.nextNode();)se(r,a)&&!se(X,a)&&(t&&$(B.uponSanitizeShadowNode,a,null),Hn(a,n),Yn(a,n),Fn(a.content)&&Xn(a.content))},En=function(e){X&&oe(X,e)},Dn=function(e,t){return K?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},On=function(e){K&&yn(e,e=>{let t=N(e);if(t===j.processingInstruction||t===j.comment&&w(Ue,e.data)){try{g(e)}catch{}return!1}if(t===j.element){let t=e,n=Q(Qe(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Dn(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},kn=function(e){let t=null,r=null;if(At)e=`<remove></remove>`+e;else{let t=ue(e,/^[\r\n\t ]+/);r=t&&t[0]}tn===`application/xhtml+xml`&&Kt===Z&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=I?nt(e):e;if(Kt===Z)try{t=new u().parseFromString(i,tn)}catch{}if(!t||!t.documentElement){t=ot.createDocument(Kt,`template`,null);try{t.documentElement.innerHTML=qt?L:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Kt===Z?lt.call(t,q?`html`:`body`)[0]:q?t.documentElement:a},An=function(e){let t=_e?_e(e):e.ownerDocument;return st.call(t||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},jn=function(e){return e=de(e,ut,` `),e=de(e,dt,` `),e=de(e,ft,` `),e},Mn=function(e){Nn(e);let t=e.querySelectorAll?.call(e,`template`);t&&v(t,e=>{Fn(e.content)&&Mn(e.content)})},Nn=function(e){e.normalize();let t=_e?_e(e):e.ownerDocument,n=st.call(t||e,e,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=jn(r.data),r=n.nextNode()},Pn=function(e){let t=D?D(e):null;return typeof t!=`string`||Q(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==C(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==E(e)||e.childNodes!==he(e)},Fn=function(e){if(!E||typeof e!=`object`||!e)return!1;try{return E(e)===j.documentFragment}catch{return!1}},In=function(e){if(!E||typeof e!=`object`||!e)return!1;try{return typeof E(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&v(e,e=>{e.call(t,n,r,rn)})}let Ln=function(e,t){return!!(K&&e.hasChildNodes()&&!In(e.firstElementChild)&&w(He,e.textContent)&&w(He,e.innerHTML)||K&&Ke[t]&&N(e)===j.element&&F(e)===Z&&(In(e.firstElementChild)||typeof e.textContent==`string`&&w(He,e.textContent))||e.nodeType===j.processingInstruction||K&&e.nodeType===j.comment&&w(Ue,e.data))},Rn=function(e,t){return e instanceof RegExp?w(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},zn=function(e,t,n){if(!xt[t]&&Gn(t)&&Rn(U.tagNameCheck,t))return!1;if(Ft&&!Rt[t]&&!Rt[ce(t)]){let t=x(e),r=he(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?ee(r[a],!0):r[a];t.insertBefore(i,me(e))}}}return mn(e),!0},Bn=function(e,t,n,r){return e.length===0?t:t===n||t===r?k(t):t},Vn=function(e,t){return e===t||x(e)!==null?!1:(It&&bn(e),!0)},Hn=function(e,n){if(En(e),$(B.beforeSanitizeElements,e,null),Vn(e,n))return!0;if(Pn(e))return mn(e),!0;let r=Q(Qe(e));if(V=Bn(B.uponSanitizeElement,V,yt,Ot),$(B.uponSanitizeElement,e,{tagName:r,allowedTags:V}),Vn(e,n))return!0;if(Ln(e,r))return mn(e),!0;if(xt[r]||!(W.tagCheck instanceof Function&&W.tagCheck(r))&&!V[r]){let t=zn(e,r,n);return t===!1&&($(B.afterSanitizeElements,e,null),Vn(e,n))?!0:t}if(N(e)===j.element&&!pn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&w(We,e.innerHTML))return mn(e),!0;if(G&&e.nodeType===j.text){let n=jn(e.textContent);e.textContent!==n&&(b(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(B.afterSanitizeElements,e,null),Vn(e,n)},Un=function(e,t,r){if(St[t]||Dn(t,e)||Mt&&(t===`id`||t===`name`)&&(r in n||r in an))return!1;let i=H[t]||W.attributeCheck instanceof Function&&W.attributeCheck(t,e);return wt&&w(pt,t)||Ct&&w(mt,t)?!0:i?Ht[t]||w(vt,de(r,gt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&fe(r,`data:`)===0&&Bt[e]||Tt&&!w(ht,de(r,gt,``))?!0:!r:Gn(e)&&Rn(U.tagNameCheck,e)&&Rn(U.attributeNameCheck,t,e)||t===`is`&&U.allowCustomizedBuiltInElements&&Rn(U.tagNameCheck,r)},Wn=O({},[`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[ce(e)]&&w(_t,e)},Kn=function(e,t,n,r){if(I&&typeof d==`object`&&typeof d.getAttributeType==`function`&&!n)switch(d.getAttributeType(e,t)){case`TrustedHTML`:return nt(r);case`TrustedScriptURL`:return rt(r)}return r},qn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Pn(e)||(mn(e),!1)}catch{return _n(t,e),!1}},Jn=function(e,t){return K&&w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:ce(e)===`attributename`&&ue(t,`href`)!==null},Yn=function(e,n){if($(B.beforeSanitizeAttributes,e,null),Vn(e,n))return;let r=e.attributes;if(!r||Pn(e))return;H=Bn(B.uponSanitizeAttribute,H,bt,kt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0},a=r.length,o=Q(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=Q(s),d=l,f=s===`value`?d:pe(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$(B.uponSanitizeAttribute,e,i),f=i.attrValue,Nt&&(u===`id`||u===`name`)&&fe(f,Pt)!==0&&(_n(s,e,n),f=Pt+f,p=!0),Jn(s,f)?_n(s,e,n):i.forceKeepAttr||(i.keepAttr?!Et&&w(Ge,f)?_n(s,e,n):(G&&(f=jn(f)),Un(o,u,f)?(f=Kn(o,u,c,f),f!==d&&qn(e,s,c,f)&&p&&te(t.removed)):_n(s,e,n)):_n(s,e,n))}$(B.afterSanitizeAttributes,e,null),Vn(e,n)},Xn=function(e){let t=null,n=An(e);for($(B.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(B.uponSanitizeShadowNode,t,null),Hn(t,e),Yn(t,e),Fn(t.content)&&Xn(t.content),N(t)===j.element){let e=ge(t);Fn(e)&&(Zn(e),Xn(e))}G&&Nn(e),$(B.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=N(n)===j.element,i=he(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=D?D(n):null;if(typeof e==`string`&&Q(e)===`template`){let e=n.content;Fn(e)&&t.push({node:e,shadow:null})}}if(r){let e=ge(n);Fn(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(qt=!e,qt&&(e=`<!-->`),typeof e!=`string`&&!In(e)&&(e=ve(e),typeof e!=`string`))throw T(`dirty is not a string, aborting`);if(!t.isSupported)return e;Dt?(V=Ot,H=kt):sn(n),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(V=k(V)),B.uponSanitizeAttribute.length>0&&(H=k(H)),t.removed=[];let c=It&&typeof e!=`string`&&In(e),l=[],u=X;if(c){On(e);let t=Qe(e);if(typeof t==`string`){let n=Q(t);if(!V[n]||xt[n])throw gn(e),T(`root node is forbidden and cannot be sanitized in-place`)}if(Pn(e))throw gn(e),T(`root node is clobbered and cannot be sanitized in-place`);l=xn(e),X=ae()}else if(In(e))i=kn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===j.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Zn(i);else{if(!J&&!G&&!q&&e.indexOf(`<`)===-1)return I&&jt?nt(e):e;if(i=kn(e),!i)return J?null:jt?L:``}i&&At&&mn(i.firstChild);let d=c?e:i;try{c&&Zn(e);let t=An(d);for(;o=t.nextNode();)Hn(o,d),Yn(o,d),Fn(o.content)&&Xn(o.content);c&&wn(e,l)}catch(t){throw c&&(gn(e),Cn(e,l)),t}finally{X=u}if(c){if(Cn(e,l))throw T(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return G&&Mn(e),e}if(J){if(G&&Mn(i),Y)for(s=ct.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(H.shadowroot||H.shadowrootmode)&&(s=z.call(r,s,!0)),s}let f=q?i.outerHTML:i.innerHTML;return q&&V[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&w(Be,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
+ `+f),G&&(f=jn(f)),I&&jt?nt(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sn(e),Dt=!0,Ot=V,kt=H},t.clearConfig=function(){rn=null,Dt=!1,Ot=null,kt=null,I=$e,L=``},t.isValidAttribute=function(e,t,n){rn||sn({});let r=Q(e),i=Q(t);return typeof n==`string`&&(Jn(t,n)||!Et&&w(Ge,n))?!1:Un(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&S(B,e)&&b(B[e],t)},t.removeHook=function(e,t){if(S(B,e)){if(t!==void 0){let n=y(B[e],t);return n===-1?void 0:re(B[e],n,1)[0]}return te(B[e])}},t.removeHooks=function(e){S(B,e)&&(B[e]=[])},t.removeAllHooks=function(){B=Ye()},t}var N=Ze(),Qe=class extends Error{issue;constructor(e){super(e.message),this.issue=e}},P=(e,t,n)=>{throw new Qe({path:e,code:t,message:n})};function F(e,t,n,r=[]){(!e||typeof e!=`object`||Array.isArray(e))&&P(t,`invalid_evidence`,`Expected a closed object`);let i=e;for(let e of Object.keys(i))[...n,...r].includes(e)||P(`${t}.${e}`,`invalid_evidence`,`Unknown evidence field`);for(let e of n)Object.hasOwn(i,e)||P(`${t}.${e}`,`invalid_evidence`,`Missing evidence field`);return i}function I(e,t,n=!1){return(typeof e!=`string`||!n&&!e.trim())&&P(t,`invalid_evidence`,`Expected a non-empty string`),e}function L(e,t){return Array.isArray(e)||P(t,`invalid_evidence`,`Expected an array`),e}var $e=(e,t)=>L(e,t).map((e,n)=>I(e,`${t}[${n}]`));function et(e,t){let n=t=>new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(t);if(t===`image/png`){if(e.length>=33&&[137,80,78,71,13,10,26,10].every((t,n)=>e[n]===t)&&n(8)===13&&n(12)===1229472850)return[n(16),n(20)]}else if(e[0]===255&&e[1]===216){let t=2;for(;t+4<e.length&&e[t]===255;){let n=e[t+1],r=e[t+2]<<8|e[t+3];if(r<2||t+2+r>e.length)break;if([192,193,194,195,197,198,199,201,202,203,205,206,207].includes(n)&&r>=8)return[e[t+7]<<8|e[t+8],e[t+5]<<8|e[t+6]];t+=r+2}}}var tt=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],R=(e,t)=>e>>>t|e<<32-t;function nt(e){let t=new Uint8Array(Math.ceil((e.length+9)/64)*64);t.set(e),t[e.length]=128;let n=new DataView(t.buffer),r=e.length*8;n.setUint32(t.length-8,Math.floor(r/4294967296)),n.setUint32(t.length-4,r>>>0);let i=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],a=new Int32Array(64);for(let e=0;e<t.length;e+=64){for(let t=0;t<16;t++)a[t]=n.getInt32(e+t*4);for(let e=16;e<64;e++){let t=a[e-15],n=a[e-2];a[e]=a[e-16]+(R(t,7)^R(t,18)^t>>>3)+a[e-7]+(R(n,17)^R(n,19)^n>>>10)}let[t,r,o,s,c,l,u,d]=i;for(let e=0;e<64;e++){let n=d+(R(c,6)^R(c,11)^R(c,25))+(c&l^~c&u)+tt[e]+a[e]|0,i=(R(t,2)^R(t,13)^R(t,22))+(t&r^t&o^r&o)|0;d=u,u=l,l=c,c=s+n|0,s=o,o=r,r=t,t=n+i|0}[t,r,o,s,c,l,u,d].forEach((e,t)=>{i[t]=i[t]+e|0})}return i.map(e=>(e>>>0).toString(16).padStart(8,`0`)).join(``)}function rt(e){if(e.length%4||/[^A-Za-z0-9+/]/.test(e.replace(/={1,2}$/,``)))throw Error(`Invalid base64`);let t=atob(e);if(btoa(t)!==e)throw Error(`Non-canonical base64`);let n=new Uint8Array(t.length);for(let e=0;e<n.length;e++)n[e]=t.charCodeAt(e);return n}var it=e=>new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0}).decode(e),at=e=>e.split(/\r\n|\n|\r/),ot=e=>/^text\/[a-z0-9.+-]+$/.test(e)||[`application/json`,`application/yaml`,`application/x-yaml`,`application/x-ndjson`].includes(e);function st(e,t){let n=new Map;return{sources:L(e,`$.sources`).map((e,r)=>{let i=`$.sources[${r}]`,a=F(e,i,[`id`,`title`,`origin`,`mediaType`,`encoding`,`data`,`sha256`,`size`],[`width`,`height`,`alt`]);for(let e of[`id`,`title`,`mediaType`,`sha256`])I(a[e],`${i}.${e}`);t(a.id,`${i}.id`);let o=a.origin,s=o&&Object.hasOwn(o,`uri`)?[`uri`]:[`repo`,`revision`,`path`];F(o,`${i}.origin`,s);for(let e of s)I(o[e],`${i}.origin.${e}`);a.encoding!==`base64`&&P(`${i}.encoding`,`source_encoding`,`Only original base64 bytes are accepted`);let c=a.mediaType;!ot(c)&&![`image/png`,`image/jpeg`].includes(c)&&P(`${i}.mediaType`,`unsupported_media`,`Unsupported media for source ${a.id}`);let l;try{l=rt(I(a.data,`${i}.data`,!0))}catch{return P(`${i}.data`,`source_encoding`,`Invalid base64 for source ${a.id}`)}if((!Number.isSafeInteger(a.size)||a.size!==l.length)&&P(`${i}.size`,`source_size`,`Byte size mismatch for source ${a.id}`),(!/^[a-f0-9]{64}$/.test(a.sha256)||nt(l)!==a.sha256)&&P(`${i}.sha256`,`source_digest`,`SHA-256 mismatch for source ${a.id}`),ot(c)){try{n.set(a.id,at(it(l)).length)}catch{P(`${i}.data`,`source_encoding`,`Invalid UTF-8 for source ${a.id}`)}for(let e of[`width`,`height`,`alt`])a[e]!==void 0&&P(`${i}.${e}`,`invalid_evidence`,`Image metadata on text`)}else{I(a.alt,`${i}.alt`);let e=et(l,c);(!e||!Number.isSafeInteger(a.width)||!Number.isSafeInteger(a.height)||e[0]<=0||e[1]<=0||e[0]!==a.width||e[1]!==a.height)&&P(i,`image_metadata`,`Image dimensions/signature mismatch for source ${a.id}`)}return a}),lineCounts:n}}function ct(e,t){try{let{schemaVersion:n,sources:r,citations:i,evidenceGroups:a,annexes:o,...s}=e,c=new Map,l=(e,t)=>{if(!e||typeof e!=`object`||Array.isArray(e))return e;let{citationRefs:n,...r}=e;return n!==void 0&&c.set(t,$e(n,`${t}.citationRefs`)),r};Array.isArray(s.sections)&&(s.sections=s.sections.map((e,t)=>{let n=l(e,`$.sections[${t}]`);return n?.kind===`optionSet`&&Array.isArray(n.options)?{...n,options:n.options.map((e,n)=>l(e,`$.sections[${t}].options[${n}]`))}:n}));let u=t(s);if(!u.ok)return u;let d=u.value,f=new Set,p=new Set([d.ref]),m=(e,t)=>{f.has(e)&&P(t,`duplicate_id`,`Duplicate id ${e}`),f.add(e)};d.sections.forEach(e=>{m(e.id,`$.sections`),p.add(e.id),p.add(e.targetRef),e.kind===`optionSet`&&e.options.forEach(e=>{m(e.id,`$.sections.options`),p.add(e.id),p.add(e.targetRef)})});let{sources:h,lineCounts:ee}=st(r,m),g=new Map(h.map(e=>[e.id,e])),_=L(i,`$.citations`).map((e,t)=>{let n=`$.citations[${t}]`,r=F(e,n,[`id`,`sourceId`,`label`,`locator`]);for(let e of[`id`,`sourceId`,`label`])I(r[e],`${n}.${e}`);m(r.id,`${n}.id`);let i=g.get(r.sourceId)??P(`${n}.sourceId`,`unresolved_source`,`Unknown source ${r.sourceId}`),a=r.locator;return a?.kind===`lines`?(F(a,`${n}.locator`,[`kind`,`start`,`end`]),ee.has(i.id)||P(`${n}.locator`,`citation_media`,`Source ${i.id} is not text`),(!Number.isSafeInteger(a.start)||!Number.isSafeInteger(a.end)||a.start<1||a.end<a.start||a.end>ee.get(i.id))&&P(`${n}.locator`,`citation_range`,`Invalid inclusive line range for ${i.id}`)):a?.kind===`image`?(F(a,`${n}.locator`,[`kind`,`caption`]),I(a.caption,`${n}.locator.caption`),i.mediaType.startsWith(`image/`)||P(`${n}.locator`,`citation_media`,`Source ${i.id} is not an image`)):P(`${n}.locator`,`invalid_evidence`,`Unknown citation locator`),r}),v=new Set(_.map(e=>e.id)),y=(e,t,n,r)=>{let i=$e(e,t);for(let e of i)n.has(e)||P(t,r,`Unresolved reference ${e}`);return i};for(let[e,t]of c)y(t,`${e}.citationRefs`,v,`unresolved_citation`);let te=L(a,`$.evidenceGroups`).map((e,t)=>{let n=`$.evidenceGroups[${t}]`,r=F(e,n,[`id`,`summary`,`citationRefs`,`sourceRefs`]);return m(I(r.id,`${n}.id`),`${n}.id`),I(r.summary,`${n}.summary`),y(r.citationRefs,`${n}.citationRefs`,v,`unresolved_citation`),y(r.sourceRefs,`${n}.sourceRefs`,new Set(g.keys()),`unresolved_source`),r}),b=L(o,`$.annexes`).map((e,t)=>{let n=`$.annexes[${t}]`,r=F(e,n,[`id`,`title`,`summary`,`blocks`,`backRefs`]);return m(I(r.id,`${n}.id`),`${n}.id`),I(r.title,`${n}.title`),I(r.summary,`${n}.summary`),y(r.backRefs,`${n}.backRefs`,p,`unresolved_target`),L(r.blocks,`${n}.blocks`).forEach((e,t)=>{let r=`${n}.blocks[${t}]`,i=e?.kind;if(i===`text`||i===`code`){let t=F(e,r,[`kind`,`text`],i===`code`?[`language`]:[]);I(t.text,`${r}.text`,!0),t.language!==void 0&&I(t.language,`${r}.language`)}else if(i===`table`){let t=F(e,r,[`kind`,`columns`,`rows`]),n=$e(t.columns,`${r}.columns`);n.length||P(r,`invalid_evidence`,`A table needs columns`),L(t.rows,`${r}.rows`).forEach((e,t)=>{let i=L(e,`${r}.rows[${t}]`);i.forEach((e,n)=>I(e,`${r}.rows[${t}][${n}]`,!0)),i.length!==n.length&&P(r,`invalid_evidence`,`Table row width mismatch`)})}else if(i===`references`){let t=F(e,r,[`kind`,`citationRefs`]);y(t.citationRefs,`${r}.citationRefs`,v,`unresolved_citation`)}else P(`${r}.kind`,`invalid_evidence`,`Unsupported annex block (no decisions or active content)`)}),r}),ne=(e,t)=>c.has(t)?{...e,citationRefs:c.get(t)}:e,re=d.sections.map((e,t)=>ne(e.kind===`optionSet`?{...e,options:e.options.map((e,n)=>ne(e,`$.sections[${t}].options[${n}]`))}:e,`$.sections[${t}]`));return{ok:!0,value:{...d,schemaVersion:2,sections:re,sources:h,citations:_,evidenceGroups:te,annexes:b}}}catch(e){if(e instanceof Qe)return{ok:!1,issues:[e.issue]};throw e}}var lt=e=>typeof e==`object`&&!!e&&!Array.isArray(e),z=(e,t,n)=>({path:e,code:t,message:n}),B=(e,t,n,r,i,a)=>{if(!lt(e)){a.push(z(t,`invalid_type`,`expected an object`));return}let o=new Set(n);for(let n of Object.keys(e))o.has(n)||a.push(z(`${t}.${n}`,`unknown_field`,`field not in the closed schema`));for(let n of r)e[n]===void 0&&a.push(z(`${t}.${n}`,`missing_field`,`required field is missing`));for(let n of i)e[n]!==void 0&&typeof e[n]!=`string`&&a.push(z(`${t}.${n}`,`invalid_type`,`expected a string`));return e},ut=(e,t,n,r)=>{(typeof e!=`string`||!n.includes(e))&&r.push(z(t,`invalid_enum`,`expected one of: ${n.join(` | `)}`))},dt=[`ref`,`subject`,`title`,`hash`,`cursor`,`sections`,`interactions`,`provenance`,`amendmentTrace`],ft=[`ref`,`subject`,`title`,`hash`,`cursor`],pt=[...dt,`readability`],mt=(e,t,n)=>{let r=n.length,i=B(e,t,[`kind`,`id`,`targetRef`,`label`,`body`,`annotation`,`annotationComment`,`consequence`],[`kind`,`id`,`targetRef`,`label`,`annotation`],[`id`,`targetRef`,`label`,`body`,`annotationComment`,`consequence`],n);if(i!==void 0&&(i.kind!==`option`&&n.push(z(`${t}.kind`,`invalid_discriminator`,`expected "option"`)),ut(i.annotation,`${t}.annotation`,[`none`,`accept`,`reject`,`comment`],n),n.length===r))return{kind:`option`,id:i.id,targetRef:i.targetRef,label:i.label,...typeof i.body==`string`?{body:i.body}:{},annotation:i.annotation,...typeof i.annotationComment==`string`?{annotationComment:i.annotationComment}:{},...typeof i.consequence==`string`?{consequence:i.consequence}:{}}},ht=(e,t,n)=>{let r=n.length,i=B(e,t,[`at`,`author`,`summary`],[`at`,`author`,`summary`],[`at`,`author`,`summary`],n);if(i!==void 0&&n.length===r)return{at:i.at,author:i.author,summary:i.summary}},gt=(e,t,n)=>{if(!lt(e)){n.push(z(t,`invalid_type`,`expected an object`));return}let r=e.kind;if(r!==`prose`&&r!==`question`&&r!==`optionSet`&&r!==`outcome`&&r!==`amendmentTrace`&&r!==`diagram`){n.push(z(`${t}.kind`,r===void 0?`missing_field`:`unknown_node_kind`,`unknown section kind ${typeof r==`string`?`"${r}"`:` discriminant`}`));return}let i=n.length;switch(r){case`prose`:{let r=B(e,t,[`kind`,`id`,`targetRef`,`markdown`,`questionId`],[`kind`,`id`,`targetRef`,`markdown`],[`id`,`targetRef`,`markdown`,`questionId`],n);return r===void 0||n.length!==i?void 0:{kind:`prose`,id:r.id,targetRef:r.targetRef,markdown:r.markdown,...typeof r.questionId==`string`?{questionId:r.questionId}:{}}}case`question`:{let r=B(e,t,[`kind`,`id`,`targetRef`,`question`,`recommendedAnswer`,`answer`,`state`,`context`,`readingTimeMinutes`,`recommendedOptionId`],[`kind`,`id`,`targetRef`,`question`,`state`],[`id`,`targetRef`,`question`,`recommendedAnswer`,`answer`,`context`,`recommendedOptionId`],n);return r===void 0||(ut(r.state,`${t}.state`,[`open`,`answered`,`validated`],n),r.readingTimeMinutes!==void 0&&(typeof r.readingTimeMinutes!=`number`||!Number.isFinite(r.readingTimeMinutes))&&n.push(z(`${t}.readingTimeMinutes`,`invalid_type`,`expected a finite number`)),n.length!==i)?void 0:{kind:`question`,id:r.id,targetRef:r.targetRef,question:r.question,...typeof r.recommendedAnswer==`string`?{recommendedAnswer:r.recommendedAnswer}:{},...typeof r.answer==`string`?{answer:r.answer}:{},state:r.state,...typeof r.context==`string`?{context:r.context}:{},...typeof r.recommendedOptionId==`string`?{recommendedOptionId:r.recommendedOptionId}:{},...typeof r.readingTimeMinutes==`number`?{readingTimeMinutes:r.readingTimeMinutes}:{}}}case`optionSet`:{let r=B(e,t,[`kind`,`id`,`targetRef`,`title`,`options`,`questionId`],[`kind`,`id`,`targetRef`,`options`],[`id`,`targetRef`,`title`,`questionId`],n);if(r===void 0)return;let a=[];return Array.isArray(r.options)?r.options.forEach((e,r)=>{let i=mt(e,`${t}.options[${r}]`,n);i!==void 0&&a.push(i)}):n.push(z(`${t}.options`,`invalid_type`,`expected an array`)),n.length===i?{kind:`optionSet`,id:r.id,targetRef:r.targetRef,...typeof r.title==`string`?{title:r.title}:{},options:a,...typeof r.questionId==`string`?{questionId:r.questionId}:{}}:void 0}case`outcome`:{let r=B(e,t,[`kind`,`id`,`targetRef`,`modality`,`statement`,`questionId`],[`kind`,`id`,`targetRef`,`modality`,`statement`],[`id`,`targetRef`,`statement`,`questionId`],n);return r===void 0||(ut(r.modality,`${t}.modality`,[`decision`,`orientation`,`amendment`,`comment`],n),n.length!==i)?void 0:{kind:`outcome`,id:r.id,targetRef:r.targetRef,modality:r.modality,statement:r.statement,...typeof r.questionId==`string`?{questionId:r.questionId}:{}}}case`amendmentTrace`:{let r=B(e,t,[`kind`,`id`,`targetRef`,`steps`],[`kind`,`id`,`targetRef`,`steps`],[`id`,`targetRef`],n);if(r===void 0)return;let a=[];return Array.isArray(r.steps)?r.steps.forEach((e,r)=>{let i=ht(e,`${t}.steps[${r}]`,n);i!==void 0&&a.push(i)}):n.push(z(`${t}.steps`,`invalid_type`,`expected an array`)),n.length===i?{kind:`amendmentTrace`,id:r.id,targetRef:r.targetRef,steps:a}:void 0}case`diagram`:{let r=B(e,t,[`kind`,`id`,`targetRef`,`syntax`,`source`,`alt`,`scene`],[`kind`,`id`,`targetRef`,`syntax`,`source`,`alt`],[`id`,`targetRef`,`source`,`alt`],n);return r===void 0||(ut(r.syntax,`${t}.syntax`,[`mermaid`,`plantuml`],n),r.scene!==void 0&&!lt(r.scene)&&n.push(z(`${t}.scene`,`invalid_type`,`expected a diagram-core SemanticDocument object`)),n.length!==i)?void 0:{kind:`diagram`,id:r.id,targetRef:r.targetRef,syntax:r.syntax,source:r.source,alt:r.alt,...r.scene===void 0?{}:{scene:r.scene}}}}},_t=(e,t,n)=>{let r=n.length,i=B(e,t,[`name`,`targetRef`,`label`,`enabled`],[`name`,`targetRef`,`label`,`enabled`],[`name`,`targetRef`,`label`],n);if(i!==void 0&&(i.enabled!==!1&&n.push(z(`${t}.enabled`,`enabled_action`,`snapshot interactions must stay disabled (enabled:false)`)),n.length===r))return{name:i.name,targetRef:i.targetRef,label:i.label,enabled:!1}},vt=(e,t,n)=>{let r=n.length,i=B(e,t,[`term`,`definition`],[`term`,`definition`],[`term`,`definition`],n);if(i!==void 0&&n.length===r)return{term:i.term,definition:i.definition}},V=(e,t,n)=>{let r=n.length,i=B(e,t,[`ownerRequestQuote`,`noOwnerRequest`,`stakes`,`stakesLevel`,`readingBudgetMinutes`,`glossary`],[],[`ownerRequestQuote`,`stakes`],n);if(i===void 0)return;i.stakesLevel!==void 0&&ut(i.stakesLevel,`${t}.stakesLevel`,[`low`,`medium`,`high`],n),i.noOwnerRequest!==void 0&&typeof i.noOwnerRequest!=`boolean`&&n.push(z(`${t}.noOwnerRequest`,`invalid_type`,`expected a boolean`)),i.readingBudgetMinutes!==void 0&&(typeof i.readingBudgetMinutes!=`number`||!Number.isFinite(i.readingBudgetMinutes))&&n.push(z(`${t}.readingBudgetMinutes`,`invalid_type`,`expected a finite number`));let a;if(i.glossary!==void 0&&(a=[],Array.isArray(i.glossary)?i.glossary.forEach((e,r)=>{let i=vt(e,`${t}.glossary[${r}]`,n);i!==void 0&&a.push(i)}):n.push(z(`${t}.glossary`,`invalid_type`,`expected an array`))),n.length===r)return{...typeof i.ownerRequestQuote==`string`?{ownerRequestQuote:i.ownerRequestQuote}:{},...typeof i.noOwnerRequest==`boolean`?{noOwnerRequest:i.noOwnerRequest}:{},...typeof i.stakes==`string`?{stakes:i.stakes}:{},...i.stakesLevel===void 0?{}:{stakesLevel:i.stakesLevel},...typeof i.readingBudgetMinutes==`number`?{readingBudgetMinutes:i.readingBudgetMinutes}:{},...a===void 0?{}:{glossary:a}}},yt=e=>{let t=[],n=B(e,`$`,[...pt],[...dt],[...ft],t);if(n===void 0)return{ok:!1,issues:t};let r=[];Array.isArray(n.sections)?n.sections.forEach((e,n)=>{let i=gt(e,`$.sections[${n}]`,t);i!==void 0&&r.push(i)}):t.push(z(`$.sections`,`invalid_type`,`expected an array`));let i=[];Array.isArray(n.interactions)?n.interactions.forEach((e,n)=>{let r=_t(e,`$.interactions[${n}]`,t);r!==void 0&&i.push(r)}):t.push(z(`$.interactions`,`invalid_type`,`expected an array`));let a,o=B(n.provenance,`$.provenance`,[`source`,`readAt`,`comprehensionEvidence`],[`source`,`readAt`],[`source`,`readAt`],t);if(o!==void 0){let e;if(o.comprehensionEvidence!==void 0){let n=t.length,r=B(o.comprehensionEvidence,`$.provenance.comprehensionEvidence`,[`subject`,`dossierHash`,`signature`],[`subject`,`dossierHash`],[`subject`,`dossierHash`,`signature`],t);r!==void 0&&t.length===n&&(e={subject:r.subject,dossierHash:r.dossierHash,...typeof r.signature==`string`?{signature:r.signature}:{}})}a={source:o.source,readAt:o.readAt,...e===void 0?{}:{comprehensionEvidence:e}}}let s=[];Array.isArray(n.amendmentTrace)?n.amendmentTrace.forEach((e,n)=>{let r=ht(e,`$.amendmentTrace[${n}]`,t);r!==void 0&&s.push(r)}):t.push(z(`$.amendmentTrace`,`invalid_type`,`expected an array`));let c;return n.readability!==void 0&&(c=V(n.readability,`$.readability`,t)),t.length>0||a===void 0||n.readability!==void 0&&c===void 0||typeof n.ref!=`string`||typeof n.subject!=`string`||typeof n.title!=`string`||typeof n.hash!=`string`||typeof n.cursor!=`string`?{ok:!1,issues:t}:{ok:!0,value:{ref:n.ref,subject:n.subject,title:n.title,hash:n.hash,cursor:n.cursor,sections:r,interactions:i,provenance:a,amendmentTrace:s,...c===void 0?{}:{readability:c}}}},H=e=>lt(e)&&Object.hasOwn(e,`schemaVersion`)?e.schemaVersion===2?ct(e,yt):{ok:!1,issues:[z(`$.schemaVersion`,`unsupported_version`,`Supported explicit version: 2; omit schemaVersion for legacy v1`)]}:yt(e),bt=e=>{let t=[],n=new Map,r=(e,r)=>{let i=n.get(e);i===void 0?n.set(e,r):t.push(z(r,`duplicate_id`,`node id "${e}" already used at ${i}`))};e.sections.forEach((e,t)=>{let n=`$.sections[${t}]`;r(e.id,`${n}.id`),e.kind===`optionSet`&&e.options.forEach((e,t)=>{r(e.id,`${n}.options[${t}].id`)})});let i=new Set([e.ref]);for(let t of e.sections)if(i.add(t.id),i.add(t.targetRef),t.kind===`optionSet`)for(let e of t.options)i.add(e.id),i.add(e.targetRef);e.interactions.forEach((e,n)=>{i.has(e.targetRef)||t.push(z(`$.interactions[${n}].targetRef`,`unresolved_target`,`interaction target "${e.targetRef}" resolves to no node`))});let a=e.provenance.comprehensionEvidence;return a!==void 0&&a.dossierHash!==e.hash&&t.push(z(`$.provenance.comprehensionEvidence.dossierHash`,`evidence_mismatch`,`comprehension evidence does not match the snapshot hash`)),t},U=e=>{let t=H(e);if(!t.ok)return t;let n=bt(t.value);return n.length>0?{ok:!1,issues:n}:t};function xt(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function St(e){let t=[],n=e=>(t.push(e),`\u0000${t.length-1}\u0000`),r=xt(e);return r=r.replace(/`([^`]+)`/g,(e,t)=>n(`<code>${t}</code>`)),r=r.replace(/\[([^\]]*)\]\((https:\/\/[^)\s]+)\)/g,(e,t,r)=>{let i=r.replace(/"/g,`%22`);return n(`<a href="${i}">${t}</a>`)}),r=r.replace(/\*\*([^*]+)\*\*/g,`<strong>$1</strong>`),r=r.replace(/\*([^*]+)\*/g,`<em>$1</em>`),r.replace(/\u0000(\d+)\u0000/g,(e,n)=>t[Number(n)]??``)}function W(e,t){return e[t]??``}function Ct(e){return/^- /.test(e)}function wt(e){let t=e.replace(/\r\n?/g,`
4
+ `).split(`
5
+ `),n=[],r=0;for(;r<t.length;){let e=W(t,r);if(e.trim()===``){r+=1;continue}if(Ct(e)){let e=[];for(;r<t.length&&Ct(W(t,r));)e.push(`<li>${St(W(t,r).slice(2))}</li>`),r+=1;n.push(`<ul>\n${e.join(`
6
+ `)}\n</ul>`);continue}let i=[];for(;r<t.length;){let e=W(t,r);if(e.trim()===``||Ct(e))break;i.push(St(e)),r+=1}n.push(`<p>${i.join(`
7
+ `)}</p>`)}return n.join(`
8
+ `)}function Tt(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Et(e){let t=e.startsWith(`$`)?e.slice(1):e,n=[];for(let e of t.matchAll(/([^.[\]]+)|\[(\d+)\]/g)){let t=e[1]??e[2];t!==void 0&&n.push(Tt(t))}return n.length===0?``:`/${n.join(`/`)}`}function G(e){return{source:`focus`,validate(t){let n=e(t);return n.ok?[]:n.issues.map(e=>({code:e.code,message:e.message,pointer:Et(e.path),severity:`error`}))}}}var K,q=[`.st-dossier{display:block;color:var(--st-semantic-text-primary);}`,`.st-dossier__header{margin:0 0 var(--st-spacing-4);}`,`.st-dossier__subject{margin:0 0 var(--st-spacing-1);color:var(--st-semantic-text-secondary);}`,`.st-dossier__title{margin:0;color:var(--st-semantic-text-primary);}`,`.st-dossier__prose{color:var(--st-semantic-text-primary);}`,`.st-dossier__prose p{margin:0 0 var(--st-spacing-2);}`,`.st-dossier__prose a{color:var(--st-semantic-action-primary);}`,`.st-dossier__prose code{color:var(--st-semantic-text-secondary);}`,`.st-dossier__question{margin:0 0 var(--st-spacing-3);}`,`.st-dossier__questionText{margin:0 0 var(--st-spacing-1);color:var(--st-semantic-text-primary);}`,`.st-dossier__state{display:inline-block;border:var(--st-borderWidth-thin) var(--st-borderStyle-solid) var(--st-semantic-border-strong);border-radius:var(--st-radius-pill);padding:0 var(--st-spacing-2);color:var(--st-semantic-text-secondary);}`,`.st-dossier__questionContext{margin:var(--st-spacing-1) 0 0;color:var(--st-semantic-text-secondary);}`,`.st-dossier__readingTime{margin:var(--st-spacing-1) 0 0;color:var(--st-semantic-text-muted);}`,`.st-dossier__questionAnswer{margin:var(--st-spacing-1) 0 0;color:var(--st-semantic-text-secondary);}`,`.st-dossier__questionReco{margin:var(--st-spacing-1) 0 0;color:var(--st-semantic-text-secondary);}`,`.st-dossier__options[data-st-layout="list"]{display:flex;flex-direction:column;gap:var(--st-spacing-2);}`,`.st-dossier__options[data-st-layout="grid"]{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:var(--st-spacing-2);}`,`.st-dossier__optionsTitle{margin:0;color:var(--st-semantic-text-secondary);}`,`.st-dossier__optionCard{display:flex;flex-direction:column;gap:var(--st-spacing-2);}`,`.st-dossier__optionSelect{display:flex;flex-direction:column;gap:var(--st-spacing-2);align-items:flex-start;text-align:left;width:100%;box-sizing:border-box;font:inherit;cursor:pointer;border:var(--st-borderWidth-thin) var(--st-borderStyle-solid) var(--st-semantic-border-subtle);border-radius:var(--st-radius-md);padding:var(--st-spacing-3);background-color:var(--st-semantic-surface-default);color:var(--st-semantic-text-primary);}`,`.st-dossier__optionSelect[data-st-selected="true"]{border-color:var(--st-semantic-border-interactive);background-color:var(--st-semantic-surface-subtle);}`,`.st-dossier__optionSelect:focus-visible{outline:var(--st-borderWidth-thin) var(--st-borderStyle-solid) var(--st-focus-color);outline-offset:1px;}`,`.st-dossier__optionHead{display:flex;align-items:center;justify-content:space-between;gap:var(--st-spacing-2);width:100%;}`,`.st-dossier__optionCard--disabled{cursor:default;border:var(--st-borderWidth-thin) var(--st-borderStyle-solid) var(--st-semantic-border-subtle);border-radius:var(--st-radius-md);padding:var(--st-spacing-3);background-color:var(--st-semantic-surface-default);color:var(--st-semantic-text-secondary);}`,`.st-dossier__optionLabel{font-weight:600;}`,`.st-dossier__badge{align-self:center;font-size:var(--st-component-badge-fontSize);font-weight:var(--st-component-badge-fontWeight);line-height:var(--st-component-badge-lineHeight);padding-block:0;padding-inline:var(--st-component-badge-paddingInline);border-radius:var(--st-component-badge-radius);background-color:var(--st-component-badge-infoBackground);color:var(--st-component-badge-infoText);}`,`.st-dossier__optionConsequence{color:var(--st-semantic-text-secondary);}`,`.st-dossier__optionAnnotation{color:var(--st-semantic-text-secondary);}`,`.st-dossier__optionAnnotation[data-annotation="accept"]{color:var(--st-semantic-feedback-success);}`,`.st-dossier__optionAnnotation[data-annotation="reject"]{color:var(--st-semantic-feedback-error);}`,`.st-dossier__optionAnnotation[data-annotation="comment"]{color:var(--st-semantic-feedback-info);}`,`.st-dossier__optionAnnotationComment{color:var(--st-semantic-text-secondary);font-style:italic;}`,`.st-dossier__optionBody{color:var(--st-semantic-text-primary);}`,`.st-dossier__optionBody[hidden]{display:none;}`,`.st-dossier__optionFold{align-self:flex-start;position:relative;z-index:1;cursor:pointer;border:var(--st-borderWidth-thin) var(--st-borderStyle-solid) var(--st-semantic-border-subtle);border-radius:var(--st-radius-pill);padding:var(--st-spacing-1) var(--st-spacing-2);background-color:var(--st-semantic-surface-default);color:var(--st-semantic-action-primary);}`,`.st-dossier__optionFold:focus-visible{outline:var(--st-borderWidth-thin) var(--st-borderStyle-solid) var(--st-focus-color);outline-offset:1px;}`,`.st-dossier__outcome{margin:var(--st-spacing-3) 0 0;}`,`.st-dossier__outcomeText{margin:0;color:var(--st-semantic-text-primary);}`,`.st-dossier__modality{display:inline-block;border:var(--st-borderWidth-thin) var(--st-borderStyle-solid) var(--st-semantic-border-strong);border-radius:var(--st-radius-pill);padding:0 var(--st-spacing-2);color:var(--st-semantic-text-secondary);}`,`.st-dossier__trace{margin:var(--st-spacing-3) 0 0;padding-left:var(--st-spacing-4);color:var(--st-semantic-text-secondary);}`,`.st-dossier__traceFooter{margin:var(--st-spacing-3) 0 0;color:var(--st-semantic-text-secondary);}`,`.st-dossier__provenance{margin:var(--st-spacing-2) 0 0;color:var(--st-semantic-text-muted);}`,`.st-dossier__diagram{margin:var(--st-spacing-3) 0 0;border:var(--st-borderWidth-thin) var(--st-borderStyle-solid) var(--st-semantic-border-subtle);border-radius:var(--st-radius-md);padding:var(--st-spacing-3);}`,`.st-dossier__diagramAlt{margin:0 0 var(--st-spacing-1);color:var(--st-semantic-text-secondary);}`,`.st-dossier__diagramSource{margin:0;color:var(--st-semantic-text-primary);}`,`.st-dossier__unknownSection{color:var(--st-semantic-text-secondary);}`].join(`
9
+ `);function Dt(){return typeof CSSStyleSheet<`u`}function Ot(e){let t=e.adoptedStyleSheets;if(Dt()&&Array.isArray(t))try{K===void 0&&(K=new CSSStyleSheet,K.replaceSync(q)),t.includes(K)||(e.adoptedStyleSheets=[...t,K]);return}catch{K=void 0}let n=e;if(n.querySelector?.(`style[data-st-dossier-sheet]`)!=null)return;let r=e.createElement?.(`style`)??document.createElement(`style`);r.setAttribute(`data-st-dossier-sheet`,``),r.textContent=q;let i=e;e===document&&i.head!==void 0?i.head.append(r):n instanceof ShadowRoot?n.append(r):document.head.append(r)}var kt=G(U);function At(e,t){return t||e<=2?`list`:`grid`}function J(e){return typeof e==`string`&&e.length>0?e:void 0}function Y(e){let t=J(e.body);return t===void 0?[J(e.label)??``,J(e.consequence)??``].filter(e=>e.length>0).join(`
10
+ `):t}function jt(e){return Y(e).length>300}var Mt=[`p`,`ul`,`li`,`code`,`a`,`strong`,`em`],Nt=[`href`],Pt=/^https:\/\/[^\s"'<>]+$/i;function Ft(e){return N.sanitize(e,{ALLOWED_TAGS:Mt,ALLOWED_ATTR:Nt,ALLOW_DATA_ATTR:!1,ALLOWED_URI_REGEXP:Pt})}function It(e){let t=document.createElement(`div`);return t.className=`st-dossier__prose`,t.innerHTML=Ft(wt(e)),t}function X(e,t,n){let r=document.createElement(e);return r.className=t,r.textContent=n,r}function Lt(e,t){return e.some(e=>typeof e==`object`&&!!e&&e.name===`choose-option`&&e.targetRef===t&&e.enabled===!1)}function Rt(e){let t=new Set;for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;if(e.kind===`optionSet`&&Array.isArray(e.options))for(let n of e.options){if(typeof n!=`object`||!n)continue;let e=J(n.id);e!==void 0&&t.add(e)}}return t}function zt(e){let t=new Map;for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;if(e.kind!==`question`)continue;let r=J(e.id),i=J(e.recommendedOptionId);r!==void 0&&i!==void 0&&t.set(r,i)}return t}function Bt(e,t){let n=[];for(let r of e){if(typeof r!=`object`||!r)continue;let e=r;e.kind===`optionSet`&&J(e.questionId)===t&&n.push(e)}return n}function Vt(e,t){let n=J(e.recommendedAnswer);if(n===void 0)return;let r=n.trim(),i=J(e.id),a=J(e.recommendedOptionId);if(i===void 0||a===void 0)return r;let o=Bt(t,i).flatMap(e=>Array.isArray(e.options)?e.options:[]).find(e=>typeof e==`object`&&!!e&&J(e.id)===a),s=o===void 0?void 0:J(o.label);if(s===void 0)return r;let c=s.trim();return r.toLowerCase().startsWith(c.toLowerCase())&&/^(?:$|[\s,:;.!?—–-])/.test(r.slice(c.length))?r:`${c} — ${r}`}function Ht(e){let t=J(e.annotation);if(t===void 0||t===`none`)return;let n=X(`span`,`st-dossier__optionAnnotation`,t);return n.setAttribute(`data-annotation`,t),n}function Ut(e,t){let n=document.createElement(`div`);return n.className=`st-dossier__optionHead`,n.append(X(`span`,`st-dossier__optionLabel`,e)),t&&n.append(X(`span`,`st-dossier__badge`,`Recommended`)),n}function Wt(e,t){let n=J(e.id)??``,r=J(e.label)??``,i=J(e.consequence),a=J(e.annotationComment),o=J(e.body),s=jt(e);if(t.disabled){let c=document.createElement(`div`);if(c.className=`st-dossier__optionCard st-dossier__optionCard--disabled`,c.setAttribute(`data-option-disabled`,n),c.setAttribute(`aria-disabled`,`true`),c.append(Ut(r,t.recommended)),s){if(o!==void 0){i!==void 0&&c.append(X(`span`,`st-dossier__optionConsequence`,i));let e=X(`span`,`st-dossier__optionBody`,o);e.id=`st-dossier-body-${n}`,e.setAttribute(`hidden`,``),c.append(e)}else{let t=X(`span`,`st-dossier__optionBody`,i??Y(e));t.id=`st-dossier-body-${n}`,t.setAttribute(`hidden`,``),c.append(t)}}else i!==void 0&&c.append(X(`span`,`st-dossier__optionConsequence`,i)),o!==void 0&&c.append(X(`span`,`st-dossier__optionBody`,o));let l=Ht(e);return l!==void 0&&c.append(l),a!==void 0&&c.append(X(`span`,`st-dossier__optionAnnotationComment`,a)),c}let c=document.createElement(`div`);c.className=`st-dossier__optionCard`,c.setAttribute(`data-option-card`,n),c.setAttribute(`role`,`group`);let l=document.createElement(`button`);l.type=`button`,l.className=`st-dossier__optionSelect`,l.setAttribute(`data-option-id`,n),l.setAttribute(`aria-pressed`,t.selected?`true`:`false`),t.selected&&l.setAttribute(`data-st-selected`,`true`),l.append(Ut(r,t.recommended)),!(s&&o===void 0)&&i!==void 0&&l.append(X(`span`,`st-dossier__optionConsequence`,i));let u=Ht(e);if(u!==void 0&&l.append(u),a!==void 0&&l.append(X(`span`,`st-dossier__optionAnnotationComment`,a)),!s&&o!==void 0&&l.append(X(`span`,`st-dossier__optionBody`,o)),c.append(l),s){let r=document.createElement(`button`);r.type=`button`,r.className=`st-dossier__optionFold`,r.setAttribute(`data-option-fold`,n),r.setAttribute(`aria-expanded`,t.expanded?`true`:`false`),r.setAttribute(`aria-controls`,`st-dossier-body-${n}`),r.textContent=t.expanded?`Hide details`:`Show details`,c.append(r);let a=X(`span`,`st-dossier__optionBody`,o??i??Y(e));a.id=`st-dossier-body-${n}`,t.expanded||a.setAttribute(`hidden`,``),c.append(a)}return c}function Gt(e,t){let n=J(e.kind)??``;if(n===`prose`)return It(J(e.markdown)??``);if(n===`question`){let n=document.createElement(`div`);n.className=`st-dossier__question`,n.setAttribute(`data-st-question`,J(e.id)??``);let r=X(`h3`,`st-dossier__questionText`,J(e.question)??``);r.setAttribute(`data-st-question-text`,``),n.append(r);let i=J(e.state);if(i!==void 0){let e=X(`span`,`st-dossier__state`,i);e.setAttribute(`data-st-question-state`,i),n.append(e)}let a=J(e.context);a!==void 0&&n.append(X(`p`,`st-dossier__questionContext`,a));let o=e.readingTimeMinutes;typeof o==`number`&&n.append(X(`p`,`st-dossier__readingTime`,`Reading time: ${o} min`));let s=J(e.answer);s!==void 0&&n.append(X(`p`,`st-dossier__questionAnswer`,s));let c=J(e.recommendedAnswer);return c!==void 0&&n.append(X(`p`,`st-dossier__questionReco`,Vt(e,t.sections)??c)),n}if(n===`optionSet`){let n=document.createElement(`div`);n.className=`st-dossier__options`,n.setAttribute(`data-st-option-set`,J(e.id)??``);let r=(Array.isArray(e.options)?e.options:[]).filter(e=>typeof e==`object`&&!!e);n.setAttribute(`data-st-layout`,At(r.length,r.some(jt)));let i=J(e.title);i!==void 0&&n.append(X(`h4`,`st-dossier__optionsTitle`,i));let a=J(e.id)??``,o=J(e.questionId)??J(e.targetRef),s=o===void 0?void 0:t.recommended.get(o);for(let e of r){let r=J(e.id)??``;n.append(Wt(e,{disabled:Lt(t.interactions,r),recommended:s!==void 0&&s===r,selected:t.selected.get(a)===r,expanded:t.expanded.has(r)}))}return n}if(n===`outcome`){let t=document.createElement(`div`);t.className=`st-dossier__outcome`,t.setAttribute(`data-st-outcome`,J(e.id)??``);let n=X(`p`,`st-dossier__outcomeText`,J(e.statement)??``);n.setAttribute(`data-st-outcome-statement`,``),t.append(n);let r=J(e.modality);return r!==void 0&&t.append(X(`span`,`st-dossier__modality`,r)),t}if(n===`amendmentTrace`){let t=document.createElement(`ol`);t.className=`st-dossier__trace`,t.setAttribute(`data-st-trace`,J(e.id)??``);let n=Array.isArray(e.steps)?e.steps:[];for(let e of n)if(typeof e==`object`&&e){let n=e,r=J(n.at)??``,i=J(n.author)??``,a=X(`li`,`st-dossier__traceStep`,J(n.summary)??``);a.setAttribute(`data-st-trace-step`,`${r} ${i}`.trim()),t.append(a)}return t}if(n===`diagram`){let t=document.createElement(`figure`);t.className=`st-dossier__diagram`,t.setAttribute(`data-st-diagram`,J(e.id)??``);let n=J(e.alt);n!==void 0&&t.append(X(`figcaption`,`st-dossier__diagramAlt`,n));let r=X(`pre`,`st-dossier__diagramSource`,J(e.source)??``);return r.setAttribute(`data-st-diagram-source`,``),t.append(r),t}return X(`div`,`st-dossier__unknownSection`,n)}function Z(e,t,n){let r=t??{},i=Array.isArray(r.sections)?r.sections:[],a=Array.isArray(r.interactions)?r.interactions:[],o=zt(i),s=Rt(i),c=new Map,l=new Set,u=e.getRootNode();Ot(u instanceof ShadowRoot||u instanceof Document?u:document);let d=document.createElement(`article`);d.className=`st-dossier`,d.setAttribute(`data-st-dossier`,``);let f=document.createElement(`header`);f.className=`st-dossier__header`;let p=J(r.subject);p!==void 0&&f.append(X(`p`,`st-dossier__subject`,p)),f.append(X(`h2`,`st-dossier__title`,J(r.title)??``)),f.setAttribute(`data-st-dossier-title`,``),d.append(f);let m={interactions:a,recommended:o,knownOptions:s,selected:c,expanded:l,sections:i},h=new Set;for(let e of i){if(typeof e!=`object`||!e)continue;let t=e;if(t.kind!==`question`)continue;let n=J(t.id);n!==void 0&&h.add(n)}let ee=[],g=new Set;for(let e of i){if(typeof e!=`object`||!e)continue;let t=e;if(t.kind===`optionSet`){let e=J(t.questionId);if(e!==void 0&&h.has(e))continue;let n=Gt(t,m);ee.push(n),d.append(n)}else if(d.append(Gt(t,m)),t.kind===`question`){let e=J(t.id);if(e===void 0)continue;for(let t of Bt(i,e)){if(g.has(t))continue;g.add(t);let e=Gt(t,m);ee.push(e),d.append(e)}}}let _=Array.isArray(r.amendmentTrace)?r.amendmentTrace:[];if(_.length>0){let e=document.createElement(`footer`);e.className=`st-dossier__traceFooter`,e.setAttribute(`data-st-trace-footer`,``);for(let t of _)if(typeof t==`object`&&t){let n=t,r=X(`p`,`st-dossier__traceEntry`,J(n.summary)??``);r.setAttribute(`data-st-trace-at`,J(n.at)??``),e.append(r)}d.append(e)}let v=J((r.provenance??{}).source);if(v!==void 0){let e=X(`p`,`st-dossier__provenance`,v);e.setAttribute(`data-st-provenance`,v),d.append(e)}let y=e=>{let t=e.getAttribute(`data-option-id`);if(t===null)return;let r=e.closest(`[data-st-option-set]`),i=r?.getAttribute(`data-st-option-set`)??``;if(c.get(i)===t){c.delete(i),e.removeAttribute(`data-st-selected`),e.setAttribute(`aria-pressed`,`false`);return}let a=r?.querySelector(`[data-st-selected="true"]`);a?.removeAttribute(`data-st-selected`),a?.setAttribute(`aria-pressed`,`false`),c.set(i,t),e.setAttribute(`data-st-selected`,`true`),e.setAttribute(`aria-pressed`,`true`),n(t)},te=t=>{let n=t.target;if(!(n instanceof Element)||n.closest(`[data-option-fold]`)!==null)return;let r=n.closest(`[data-option-id]`);if(r!==null&&e.contains(r)&&r.closest(`[data-option-disabled]`)===null){y(r);return}let i=n.closest(`[data-option-card]`);if(i!==null&&e.contains(i)&&i.closest(`[data-option-disabled]`)===null){let e=i.querySelector(`[data-option-id]`);e!==null&&y(e)}},b=t=>{if(!(t instanceof KeyboardEvent)||t.key!==`Enter`&&t.key!==` `)return;let n=t.target;if(!(n instanceof Element)||n.closest(`[data-option-fold]`)!==null)return;let r=n.closest(`[data-option-id]`);r!==null&&e.contains(r)&&r.closest(`[data-option-disabled]`)===null&&(t.preventDefault(),y(r))},ne=t=>{let n=t.target;if(!(n instanceof Element))return;let r=n.closest(`[data-option-fold]`);if(r===null||!e.contains(r))return;t.stopPropagation();let i=r.getAttribute(`data-option-fold`)??``,a=r.closest(`[data-option-card]`)?.querySelector(`.st-dossier__optionBody`)??void 0;l.has(i)?(l.delete(i),r.setAttribute(`aria-expanded`,`false`),r.textContent=`Show details`,a?.setAttribute(`hidden`,``)):(l.add(i),r.setAttribute(`aria-expanded`,`true`),r.textContent=`Hide details`,a?.removeAttribute(`hidden`))};return e.addEventListener(`click`,te),e.addEventListener(`keydown`,b),e.addEventListener(`click`,ne),e.replaceChildren(d),()=>{e.removeEventListener(`click`,te),e.removeEventListener(`keydown`,b),e.removeEventListener(`click`,ne),e.replaceChildren()}}export{Y as argumentText,At as decideOptionSetLayout,jt as isLongOption,kt as port,Z as renderDossier,Ft as renderMarkdownToSafeHtml};
@@ -45,7 +45,7 @@ typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var e={},t=Symb
45
45
 
46
46
  /* --- Crosshair layer (FR-3) ----------------------------------------------
47
47
  A tokenised dashed line on the CATEGORY axis at the active (hovered/
48
- controlled) bar. Decorative (aria-hidden). */.st-barChart__crosshairLine.svelte-14iupu9 {stroke:var(--st-semantic-border-strong);stroke-width:1;stroke-dasharray:3 3;opacity:0.7;}`};function fa(e,t){Ve(t,!0),zr(e,da);let n=ci(t,`width`,3,480),r=ci(t,`height`,3,240),i=ci(t,`orientation`,3,`vertical`),a=ci(t,`selectedKeys`,19,()=>[]),o=ci(t,`scale`,3,`linear`),s=ci(t,`invertAxis`,3,!1),c={top:12,right:16,bottom:32,left:44};function l(e,t,n=5){if(!Number.isFinite(e)||!Number.isFinite(t)||e===t)return[Number.isFinite(t)?t:0];let r=(t-e)/Math.max(n-1,1),i=10**Math.floor(Math.log10(r)),a=r/i,o;o=a<1.5?1*i:a<3?2*i:a<7?5*i:10*i;let s=Math.floor(e/o)*o,c=Math.ceil(t/o)*o,l=[];for(let e=s;e<=c+o/2;e+=o)l.push(Number(e.toFixed(10)));return l}let u=e=>Array.from(new Set(e.filter(Number.isFinite).map(e=>Number(e.toFixed(10))))).sort((e,t)=>e-t);function d(e,t,n=5){return!Number.isFinite(e)||!Number.isFinite(t)||e>=t?l(e,t,n):u([e,...l(e,t,n).filter(n=>n>e&&n<t),t])}function f(...e){let t=1/0;for(let n of e)Number.isFinite(n)&&n>0&&n<t&&(t=n);return Number.isFinite(t)?t:1}function p(e,t){let n=e>0?e:1,r=t>n?t:n*10,i=Math.floor(Math.log10(n)),a=Math.ceil(Math.log10(r)),o=[];for(let e=i;e<=a;e++)o.push(Number((10**e).toFixed(10)));return o.length?o:[n]}function m(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||e>=t?p(e,t):u([e,...p(e,t).filter(n=>n>e&&n<t),t])}function h(e){return e&&Number.isFinite(e[0])&&Number.isFinite(e[1])&&e[0]<e[1]?e:null}function g(e){return e&&Number.isFinite(e[0])&&Number.isFinite(e[1])&&e[0]>0&&e[0]<e[1]?e:null}function _(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function v(e){return Math.abs(e)>=1e3?`${(e/1e3).toFixed(e%1e3==0?0:1)}k`:Number.isInteger(e)?String(e):e.toFixed(1)}function y(e,t){return`${e}--${t??`neutral`}`}function b(e,t,n,r,i,a,o=`y`){let s=e,c=t,l=e=>{e!==void 0&&Number.isFinite(e)&&(e<s&&(s=e),e>c&&(c=e))};for(let e of n??[])(e.axis??`y`)===o&&l(e.value);for(let e of r??[])l(e.from),l(e.to);i&&l(i.value);for(let e of a)l(e);return[s,c]}function x(e,t,n){let r=[];for(let t of e??[])Number.isFinite(t.value)&&r.push(t.label?`Référence: ${t.label} = ${t.value}`:`Référence: ${t.value}`);for(let e of t??[]){if(!Number.isFinite(e.from)||!Number.isFinite(e.to))continue;let t=Math.min(e.from,e.to),n=Math.max(e.from,e.to);r.push(e.label?`Bande: ${e.label} (${t}–${n})`:`Bande: ${t}–${n}`)}return n&&Number.isFinite(n.value)&&r.push(n.label?`Objectif: ${n.label} = ${n.value}`:`Objectif: ${n.value}`),r}let S=F(null),ee=P(()=>new Set(a())),te=P(()=>K(ee).size>0),ne=P(()=>typeof t.onSelect==`function`),re=P(()=>o()===`log`),C=P(()=>K(re)?g(t.domain):h(t.domain)),ie=P(()=>t.goalLine&&Number.isFinite(t.goalLine.value)?t.goalLine:null),ae=P(()=>i()===`vertical`?`y`:`x`),w=P(()=>{let e=t.data.map(e=>e.value),i=t.data.flatMap(e=>[e.errorLow,e.errorHigh].filter(e=>e!==void 0&&Number.isFinite(e))),a,o;if(K(re)){let s=[...(t.referenceLines??[]).filter(e=>(e.axis??`y`)===K(ae)).map(e=>e.value),...(t.bands??[]).flatMap(e=>[e.from,e.to]),...K(ie)?[K(ie).value]:[],...i];K(C)?(a=K(C)[0],o=K(C)[1]):(a=f(...e,...s),o=Math.max(a,...e.filter(e=>e>0),...s.filter(e=>e>0)));let l=K(C)?m(a,o):p(a,o);return{ticks:l,domainMin:l[0],domainMax:l[l.length-1],plotWidth:Math.max(n()-c.left-c.right,1),plotHeight:Math.max(r()-c.top-c.bottom,1)}}a=K(C)?K(C)[0]:Math.min(0,...e),o=K(C)?K(C)[1]:Math.max(0,...e),K(C)||([a,o]=b(a,o,t.referenceLines,t.bands,K(ie),i,K(ae)));let s=K(C)?d(a,o,5):l(a,o,5);return{ticks:s,domainMin:s[0],domainMax:s[s.length-1],plotWidth:Math.max(n()-c.left-c.right,1),plotHeight:Math.max(r()-c.top-c.bottom,1)}}),oe=P(()=>e=>{let{domainMin:t,domainMax:n}=K(w),r;if(K(re)){let i=Math.log10(t),a=Math.log10(n);r=a===i?0:(Math.log10(e>0?e:t)-i)/(a-i)}else r=n===t?0:(e-t)/(n-t);return _(s()?1-r:r)}),se=P(()=>K(re)?K(w).domainMin:Math.min(K(w).domainMax,Math.max(K(w).domainMin,0))),T=P(()=>{let{plotWidth:e,plotHeight:n}=K(w);if(t.data.length===0)return[];if(i()===`vertical`){let r=e/t.data.length,i=r*.62,a=e=>n*(1-K(oe)(e)),o=a(K(se));return t.data.map((e,t)=>{let n=a(e.value),s=Math.min(n,o),l=Math.abs(o-n);return{x:c.left+r*t+(r-i)/2,y:c.top+s,width:i,height:Math.max(l,.5),cx:c.left+r*(t+.5),cy:c.top+n,datum:e,tone:e.tone??`category1`}})}let r=n/t.data.length,a=r*.62,o=t=>e*K(oe)(t),s=o(K(se));return t.data.map((e,t)=>{let n=o(e.value),i=Math.min(n,s),l=Math.abs(n-s),u=c.top+r*t+(r-a)/2;return{x:c.left+i,y:u,width:Math.max(l,.5),height:a,cx:c.left+n,cy:c.top+r*(t+.5),datum:e,tone:e.tone??`category1`}})}),E=P(()=>i()===`vertical`),ce=P(()=>e=>{let{plotWidth:t,plotHeight:n}=K(w);return K(E)?c.top+n*(1-K(oe)(e)):c.left+t*K(oe)(e)}),le=P(()=>(t.bands??[]).filter(e=>Number.isFinite(e.from)&&Number.isFinite(e.to)).map((e,t)=>{let n=K(ce)(e.from),r=K(ce)(e.to);return K(E)?{key:t,x:c.left,y:Math.min(n,r),width:K(w).plotWidth,height:Math.max(Math.abs(r-n),.5),label:e.label,tone:e.tone}:{key:t,x:Math.min(n,r),y:c.top,width:Math.max(Math.abs(r-n),.5),height:K(w).plotHeight,label:e.label,tone:e.tone}})),ue=P(()=>(t.referenceLines??[]).filter(e=>Number.isFinite(e.value)).map((e,t)=>{let n=K(ce)(e.value);return K(E)?{key:t,x1:c.left,x2:c.left+K(w).plotWidth,y1:n,y2:n,label:e.label,tone:e.tone}:{key:t,x1:n,x2:n,y1:c.top,y2:c.top+K(w).plotHeight,label:e.label,tone:e.tone}})),de=P(()=>K(ie)?{p:K(ce)(K(ie).value),label:K(ie).label,value:K(ie).value}:null),fe=P(()=>{let e=[];for(let t of K(T)){let{errorLow:n,errorHigh:r}=t.datum,i=n!==void 0&&Number.isFinite(n),a=r!==void 0&&Number.isFinite(r);if(!i&&!a)continue;let o=i?n:t.datum.value,s=a?r:t.datum.value,c=K(ce)(o),l=K(ce)(s);if(K(E)){let n=t.x+t.width/2;e.push({key:t.datum.label,stem:{x1:n,y1:c,x2:n,y2:l},capLow:{x1:n-4,y1:c,x2:n+4,y2:c},capHigh:{x1:n-4,y1:l,x2:n+4,y2:l}})}else{let n=t.y+t.height/2;e.push({key:t.datum.label,stem:{x1:c,y1:n,x2:l,y2:n},capLow:{x1:c,y1:n-4,x2:c,y2:n+4},capHigh:{x1:l,y1:n-4,x2:l,y2:n+4}})}}return e}),pe=P(()=>e=>{let t=K(T).find(t=>t.datum.label===String(e));return t?K(E)?t.cx-c.left:t.cy-c.top:null}),me=P(()=>e=>Number.isFinite(e)?K(ce)(e)-(K(E)?c.top:c.left):null),he=P(()=>e=>!e||K(E)?e:e.map(e=>{switch(e.kind){case`line`:return{...e,axis:e.axis===`x`?`y`:`x`};case`region`:return{...e,axis:e.axis===`x`?`y`:`x`};case`point`:return{...e,x:e.y,y:typeof e.x==`number`?e.x:NaN};case`label`:return{...e,x:e.y,y:typeof e.x==`number`?e.x:NaN};case`shape`:return{...e,points:e.points.map(e=>({x:e.y,y:typeof e.x==`number`?e.x:NaN}))}}})),ge=P(()=>e=>K(E)?K(pe)(e):typeof e==`number`?K(me)(e):null),_e=P(()=>e=>K(E)?K(me)(e):K(pe)(e)),ve=P(()=>bi(K(he)(t.annotations),{xScale:K(ge),yScale:K(_e),plotLeft:c.left,plotTop:c.top,plotWidth:K(w).plotWidth,plotHeight:K(w).plotHeight})),ye=P(()=>K(ve).filter(e=>e.kind===`region`)),be=P(()=>K(ve).filter(e=>e.kind!==`region`)),xe=P(()=>Ci(t.dataLabels)),Se=P(()=>K(xe).enabled?K(T).map(e=>{let t=wi(e.datum.value,K(xe),v),n=K(xe).position??`outside`,r=n===`inside`||n===`center`;if(K(E)){let n=e.cx,i=r?e.y+e.height/2:e.cy-6;return{key:e.datum.label,x:n,y:i,text:t,anchor:`middle`,baseline:r?`middle`:`auto`}}let i=e.cy,a=r?e.x+e.width/2:e.cx+4;return{key:e.datum.label,x:a,y:i,text:t,anchor:r?`middle`:`start`,baseline:`middle`}}):[]),Ce=P(()=>[...t.data.map(e=>`${e.label}: ${e.value}`),...x(t.referenceLines,t.bands,K(ie)),...xi(t.annotations)]),we=P(()=>{let{ticks:e,plotWidth:t,plotHeight:n}=K(w);return i()===`vertical`?e.map(e=>({value:e,x1:c.left,x2:c.left+t,y:c.top+n*(1-K(oe)(e)),x:void 0,y1:void 0,y2:void 0})):e.map(e=>({value:e,x:c.left+t*K(oe)(e),y1:c.top,y2:c.top+n,x1:void 0,x2:void 0,y:void 0}))}),Te=P(()=>K(T).map(e=>e.datum.label));function Ee(e){t.onHoverKeyChange?.(e==null?null:K(Te)[e]??null)}function De(){I(S,null),Ee(null)}function Oe(e){let t=e.target;if(!(t instanceof Element)){I(S,null),Ee(null);return}let n=Number(t.getAttribute(`data-chart-index`)),r=Number.isInteger(n)?n:null;I(S,r,!0),Ee(r)}let ke=P(()=>Ei(t.hoverKey,K(S),K(Te))),Ae=F(-1),je=[],D=P(()=>(t.keyboardNav===!0||t.onSelectKey!==void 0)&&K(T).length>0);function Me(e){I(Ae,e,!0),je[e]?.focus(),Ee(e)}function O(e,n){let r=Di(e.key,n,K(T).length);r&&(e.preventDefault(),r.kind===`move`?Me(r.index):r.kind===`select`?t.onSelectKey?.(K(T)[n].datum.label):(I(Ae,-1),Ee(null),t.onSelectKey?.(null),e.currentTarget.blur()))}let k=()=>[`st-barChart`,t.class].filter(Boolean).join(` `);var Ne=ua(),Pe=L(Ne),Fe=L(Pe),Ie=L(Fe),Le=e=>{var t=yr();Z(R(t),17,()=>K(we),e=>e.value,(e,t)=>{var n=Ai(),r=R(n),i=z(r),a=L(i,!0);A(i),B(e=>{Q(r,`x1`,K(t).x1),Q(r,`x2`,K(t).x2),Q(r,`y1`,K(t).y),Q(r,`y2`,K(t).y),Q(i,`x`,c.left-6),Q(i,`y`,K(t).y),Y(a,e)},[()=>v(K(t).value)]),J(e,n)}),J(e,t)},Re=e=>{var t=yr();Z(R(t),17,()=>K(we),e=>e.value,(e,t)=>{var n=ji(),i=R(n),a=z(i),o=L(a,!0);A(a),B(e=>{Q(i,`x1`,K(t).x),Q(i,`x2`,K(t).x),Q(i,`y1`,K(t).y1),Q(i,`y2`,K(t).y2),Q(a,`x`,K(t).x),Q(a,`y`,r()-c.bottom+16),Y(o,e)},[()=>v(K(t).value)]),J(e,n)}),J(e,t)};X(Ie,e=>{i()===`vertical`?e(Le):e(Re,-1)});var ze=z(Ie),j=z(ze),Be=z(j);Z(Be,19,()=>K(T),e=>e.datum.label,(e,t)=>{var n=yr(),a=R(n),o=e=>{var n=Mi(),i=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).x+K(t).width/2),Q(n,`y`,r()-c.bottom+16),Y(i,K(t).datum.label)}),J(e,n)},s=e=>{var n=Ni(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,c.left-6),Q(n,`y`,K(t).y+K(t).height/2),Y(r,K(t).datum.label)}),J(e,n)};X(a,e=>{i()===`vertical`?e(o):e(s,-1)}),J(e,n)});var Ue=z(Be);Z(Ue,17,()=>K(le),e=>e.key,(e,t)=>{var n=Fi(),r=R(n),i=z(r),a=e=>{var n=Pi(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).x+4),Q(n,`y`,K(t).y+11),Y(r,K(t).label)}),J(e,n)};X(i,e=>{K(t).label&&e(a)}),B(e=>{Yr(r,0,e,`svelte-14iupu9`),Q(r,`x`,K(t).x),Q(r,`y`,K(t).y),Q(r,`width`,K(t).width),Q(r,`height`,K(t).height)},[()=>`st-barChart__band ${y(`st-barChart__band`,K(t).tone)}`]),J(e,n)});var We=z(Ue);Z(We,17,()=>K(ue),e=>e.key,(e,t)=>{var n=Li(),r=R(n),i=z(r),a=e=>{var n=Ii(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(E)?c.left+K(w).plotWidth-4:K(t).x1+4),Q(n,`y`,K(E)?K(t).y1-4:c.top+11),Q(n,`text-anchor`,K(E)?`end`:`start`),Y(r,K(t).label)}),J(e,n)};X(i,e=>{K(t).label&&e(a)}),B(e=>{Yr(r,0,e,`svelte-14iupu9`),Q(r,`x1`,K(t).x1),Q(r,`x2`,K(t).x2),Q(r,`y1`,K(t).y1),Q(r,`y2`,K(t).y2)},[()=>`st-barChart__refLine ${y(`st-barChart__refLine`,K(t).tone)}`]),J(e,n)});var Ge=z(We),Ke=e=>{var t=Bi();Z(t,21,()=>K(ye),e=>e.key,(e,t)=>{var n=yr(),r=R(n),i=e=>{var n=zi(),r=R(n),i=z(r),a=e=>{var n=Ri(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).x+4),Q(n,`y`,K(t).y+11),Y(r,K(t).label)}),J(e,n)};X(i,e=>{K(t).label&&e(a)}),B(()=>{Q(r,`x`,K(t).x),Q(r,`y`,K(t).y),Q(r,`width`,K(t).width),Q(r,`height`,K(t).height)}),J(e,n)};X(r,e=>{K(t).kind===`region`&&e(i)}),J(e,n)}),A(t),J(e,t)};X(Ge,e=>{K(ye).length>0&&e(Ke)});var qe=z(Ge);Z(qe,19,()=>K(T),e=>e.datum.label,(e,n,r)=>{let i=P(()=>K(ee).has(K(n).datum.label));var a=Vi();let o;B(()=>{o=Yr(a,0,`st-barChart__bar st-barChart__bar--${K(n).tone??``}`,`svelte-14iupu9`,o,{"st-barChart__bar--selected":K(i),"st-barChart__bar--dim":K(te)&&!K(i),"st-barChart__bar--interactive":K(ne)}),Q(a,`x`,K(n).x),Q(a,`y`,K(n).y),Q(a,`width`,K(n).width),Q(a,`height`,K(n).height),Q(a,`data-chart-index`,K(r))}),lr(`click`,a,function(...e){(K(ne)?()=>t.onSelect?.(K(n).datum.label):void 0)?.apply(this,e)}),J(e,a)});var Je=z(qe);Z(Je,17,()=>K(fe),e=>e.key,(e,t)=>{var n=Hi(),r=L(n),i=z(r),a=z(i);A(n),B(()=>{Q(r,`x1`,K(t).stem.x1),Q(r,`y1`,K(t).stem.y1),Q(r,`x2`,K(t).stem.x2),Q(r,`y2`,K(t).stem.y2),Q(i,`x1`,K(t).capLow.x1),Q(i,`y1`,K(t).capLow.y1),Q(i,`x2`,K(t).capLow.x2),Q(i,`y2`,K(t).capLow.y2),Q(a,`x1`,K(t).capHigh.x1),Q(a,`y1`,K(t).capHigh.y1),Q(a,`x2`,K(t).capHigh.x2),Q(a,`y2`,K(t).capHigh.y2)}),J(e,n)});var Ye=z(Je),Xe=e=>{var t=Gi(),n=R(t),r=e=>{var t=Ui();B(()=>{Q(t,`x1`,c.left),Q(t,`x2`,c.left+K(w).plotWidth),Q(t,`y1`,K(de).p),Q(t,`y2`,K(de).p)}),J(e,t)},i=e=>{var t=Wi();B(()=>{Q(t,`x1`,K(de).p),Q(t,`x2`,K(de).p),Q(t,`y1`,c.top),Q(t,`y2`,c.top+K(w).plotHeight)}),J(e,t)};X(n,e=>{K(E)?e(r):e(i,-1)});var a=z(n),o=L(a,!0);A(a),B(()=>{Q(a,`x`,K(E)?c.left+K(w).plotWidth-4:K(de).p+4),Q(a,`y`,K(E)?K(de).p-4:c.top+11),Q(a,`text-anchor`,K(E)?`end`:`start`),Y(o,K(de).label??`Objectif ${K(de).value}`)}),J(e,t)};X(Ye,e=>{K(de)&&e(Xe)});var M=z(Ye),Ze=e=>{var t=$i();Z(t,21,()=>K(be),e=>e.key,(e,t)=>{var n=yr(),r=R(n),i=e=>{var n=qi(),r=R(n),i=z(r),a=e=>{var n=Ki(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).axis===`x`?K(t).x1+4:c.left+K(w).plotWidth-4),Q(n,`y`,K(t).axis===`x`?c.top+11:K(t).y1-4),Q(n,`text-anchor`,K(t).axis===`x`?`start`:`end`),Y(r,K(t).label)}),J(e,n)};X(i,e=>{K(t).label&&e(a)}),B(()=>{Q(r,`x1`,K(t).x1),Q(r,`y1`,K(t).y1),Q(r,`x2`,K(t).x2),Q(r,`y2`,K(t).y2)}),J(e,n)},a=e=>{var n=Yi(),r=R(n),i=z(r),a=e=>{var n=Ji(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).labelX),Q(n,`y`,K(t).labelY),Y(r,K(t).label)}),J(e,n)};X(i,e=>{K(t).label&&e(a)}),B(e=>Q(r,`points`,e),[()=>Si(K(t).points)]),J(e,n)},o=e=>{var n=Zi(),r=R(n),i=z(r),a=e=>{var n=Xi(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).x),Q(n,`y`,K(t).y-8),Y(r,K(t).label)}),J(e,n)};X(i,e=>{K(t).label&&e(a)}),B(()=>{Q(r,`cx`,K(t).x),Q(r,`cy`,K(t).y)}),J(e,n)},s=e=>{var n=Qi(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).x),Q(n,`y`,K(t).y),Q(n,`text-anchor`,K(t).anchor),Y(r,K(t).text)}),J(e,n)};X(r,e=>{K(t).kind===`line`?e(i):K(t).kind===`shape`?e(a,1):K(t).kind===`point`?e(o,2):e(s,-1)}),J(e,n)}),A(t),J(e,t)};X(M,e=>{K(be).length>0&&e(Ze)});var Qe=z(M),$e=e=>{var t=ta();Z(t,21,()=>K(Se),e=>e.key,(e,t)=>{var n=ea(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).x),Q(n,`y`,K(t).y),Q(n,`text-anchor`,K(t).anchor),Q(n,`dominant-baseline`,K(t).baseline),Y(r,K(t).text)}),J(e,n)}),A(t),J(e,t)};X(Qe,e=>{K(Se).length>0&&e($e)});var et=z(Qe),tt=e=>{let t=P(()=>K(T)[K(ke)]);var n=ia(),r=L(n),i=e=>{var n=na();B(()=>{Q(n,`x1`,K(t).cx),Q(n,`x2`,K(t).cx),Q(n,`y1`,c.top),Q(n,`y2`,c.top+K(w).plotHeight)}),J(e,n)},a=e=>{var n=ra();B(()=>{Q(n,`x1`,c.left),Q(n,`x2`,c.left+K(w).plotWidth),Q(n,`y1`,K(t).cy),Q(n,`y2`,K(t).cy)}),J(e,n)};X(r,e=>{K(E)?e(i):e(a,-1)}),A(n),J(e,n)};X(et,e=>{K(ke)>=0&&K(T)[K(ke)]&&e(tt)}),A(Fe);var nt=z(Fe,2),N=e=>{var i=oa();Z(i,23,()=>K(T),e=>e.datum.label,(e,t,n)=>{var r=aa();ai(r,(e,t)=>je[t]=e,e=>je?.[e],()=>[K(n)]),B((e,n)=>{Q(r,`x`,K(t).x),Q(r,`y`,K(t).y),Q(r,`width`,K(t).width),Q(r,`height`,K(t).height),Q(r,`tabindex`,e),Q(r,`aria-label`,n)},[()=>Oi(K(n),K(Ae),K(T).length),()=>ki(K(t).datum.label,K(t).datum.value)]),lr(`keydown`,r,e=>O(e,K(n))),cr(`focus`,r,()=>{I(Ae,K(n),!0),Ee(K(n))}),J(e,r)}),A(i),B(()=>{Q(i,`viewBox`,`0 0 ${n()??``} ${r()??``}`),Q(i,`aria-label`,`${t.label} — points de données`)}),J(e,i)};X(nt,e=>{K(D)&&e(N)}),A(Pe);var rt=z(Pe,2),it=e=>{var n=ca();Z(n,21,()=>K(T),e=>e.datum.label,(e,n)=>{let r=P(()=>K(ee).has(K(n).datum.label));var i=sa();let a;var o=z(L(i));A(i),B(()=>{a=Yr(i,1,`st-barChart__filterChip st-barChart__filterChip--${K(n).tone??``}`,`svelte-14iupu9`,a,{"st-barChart__filterChip--selected":K(r)}),Q(i,`aria-pressed`,K(r)),Y(o,` ${K(n).datum.label??``}: ${K(n).datum.value??``}`)}),lr(`click`,i,()=>t.onSelect?.(K(n).datum.label)),J(e,i)}),A(n),B(()=>Q(n,`aria-label`,`Filtrer par ${t.label}`)),J(e,n)};X(rt,e=>{K(ne)&&e(it)});var at=z(rt,2);vi(at,{get label(){return t.label},get items(){return K(Ce)}});var ot=z(at,2),st=e=>{let t=P(()=>K(T)[K(ke)]);var i=la(),a=L(i),o=L(a,!0);A(a);var s=z(a,2),c=L(s,!0);A(s),A(i),B(()=>{Zr(i,`left: ${K(t).cx/n()*100}%; top: ${K(t).cy/r()*100}%`),Y(o,K(t).datum.label),Y(c,K(t).datum.value)}),J(e,i)};X(ot,e=>{K(ke)>=0&&K(T)[K(ke)]&&e(st)}),A(Ne),B(e=>{Yr(Ne,1,e,`svelte-14iupu9`),Q(Pe,`aria-label`,t.label),Q(Fe,`viewBox`,`0 0 ${n()??``} ${r()??``}`),Q(ze,`x1`,c.left),Q(ze,`x2`,c.left),Q(ze,`y1`,c.top),Q(ze,`y2`,r()-c.bottom),Q(j,`x1`,c.left),Q(j,`x2`,n()-c.right),Q(j,`y1`,r()-c.bottom),Q(j,`y2`,r()-c.bottom)},[()=>Ur(k())]),lr(`pointermove`,Pe,Oe),cr(`pointerleave`,Pe,De),J(e,Ne),He()}ur([`pointermove`,`click`,`keydown`]);function pa(e,t){return{code:`engine-load-failed`,path:``,message:`the ${e} engine failed to load: ${t}`,severity:`error`,source:`host`,detail:{chunk:e,cause:t}}}var ma=1048576,ha=`document`;function ga(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function _a(e,t){return`${e}/${ga(t)}`}function va(e){let t;try{let n=JSON.stringify(e);if(typeof n!=`string`)return{ok:!1,kind:`not-json-value`,message:`the envelope is not a JSON value (§4.3)`};t=n}catch(e){return{ok:!1,kind:`not-serializable`,message:`the envelope is not JSON-serializable (§4.3): ${e instanceof Error?e.message:String(e)}`}}return{ok:!0,value:JSON.parse(t),text:t}}function ya(e){let t=0;for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);r<=127?t+=1:r<=2047?t+=2:r>=55296&&r<=56319?(t+=4,n+=1):t+=3}return t}function ba(e){let t=/^([0-9]+)\.([0-9]+)$/.exec(e);if(t!=null)return{major:Number(t[1]),minor:Number(t[2])}}function xa(e,t){return e.map(e=>{let n=`${t}${e.pointer}`;return e.keyword===`required`&&e.missingProperty!==void 0?n=_a(n,e.missingProperty):(e.keyword===`unevaluatedProperties`||e.keyword===`additionalProperties`)&&e.additionalProperty!==void 0&&(n=_a(n,e.additionalProperty)),{code:`schema-violation`,path:n,message:e.message,severity:`error`,source:`catalog`,detail:{keyword:e.keyword}}})}function Sa(e){let{catalog:t,structure:n,ports:r}=e;return{validate(e){let i=va(e);if(!i.ok)return[{code:`schema-violation`,path:``,message:i.message,severity:`error`,source:`catalog`}];let a=i.text,o=ya(a);if(o>1048576)return[{code:`payload-too-large`,path:``,message:`the envelope is ${o} UTF-8 bytes, over the ${ma}-byte budget (§4.3 item 3)`,severity:`error`,source:`catalog`,detail:{limitBytes:ma,actualBytes:o}}];let s=n.validateEnvelope(i.value);if(s.length>0)return xa(s,``);let c=i.value,l=c.catalogId;if(l!==void 0&&l!==t.catalogId)return[{code:`schema-violation`,path:`/catalogId`,message:`the envelope must name its catalogue (${String(t.catalogId)})`,severity:`error`,source:`catalog`,detail:{expected:t.catalogId,found:l}}];if(c.mode===`preview`)return[{code:`unsupported-mode`,path:`/mode`,message:`mode "preview" is reserved and not rendered by this catalogue (§10.3)`,severity:`error`,source:`catalog`,detail:{mode:`preview`}}];let u=c.root,d=u.component;if(typeof d!=`string`||!(d in t.components))return[{code:`unknown-component`,path:`/root/component`,message:`no catalogued component is named ${String(d)}`,severity:`error`,source:`catalog`,detail:{component:d}}];let f=t.components[d];if(f===void 0)return[{code:`unknown-component`,path:`/root/component`,message:`no catalogued component is named ${d}`,severity:`error`,source:`catalog`,detail:{component:d}}];let p=f[`x-sentropic`];if(p?.status===`unknown`)return[{code:`component-unavailable`,path:`/root/component`,message:`${d} is catalogued as a placeholder (x-sentropic.status "unknown") and cannot render`,severity:`error`,source:`catalog`,detail:{component:d}}];let m=c.contract,h=p?.contract;if(typeof h!=`string`)return[{code:`schema-violation`,path:`/root/component`,message:`the catalogued entry for ${d} declares no x-sentropic contract`,severity:`error`,source:`catalog`}];let g=ba(h),_=typeof m==`string`?ba(m):void 0;if(g===void 0||_===void 0)return[{code:`schema-violation`,path:`/contract`,message:`contract versions are "major.minor" strings (§4.4): envelope ${String(m)}, entry ${h}`,severity:`error`,source:`catalog`}];if(_.major!==g.major||_.minor>g.minor)return[{code:`unsupported-contract`,path:`/contract`,message:`the envelope targets contract ${String(m)} but ${d} is at ${h} (§4.4: an envelope may be older, never newer)`,severity:`error`,source:`catalog`,detail:{expected:h,found:m}}];let v=n.validateComponent(d,u);if(v.length>0)return xa(v,`/root`);let y=p?.engine;if(typeof y!=`string`||!y.startsWith(`lazy:`))return[];let b=y.slice(5),x=r?.[b],S=`/root/${ha}`;if(x===void 0)return[{code:`host-capability-missing`,path:S,message:`the host did not inject the ${b} semantic port (engine ${y}); the owning runtime validates this payload (§4.3 item 2)`,severity:`error`,source:`host`,detail:{chunk:b,engine:y}}];let ee;try{ee=x.validate(u[ha])}catch(e){return[{...pa(b,e instanceof Error?e.message:String(e)),path:S}]}return ee.map(e=>({code:e.severity===`warning`?e.code:`semantic-invalid`,path:`${S}${e.pointer??``}`,message:e.message,severity:e.severity,source:x.source,detail:{code:e.code}}))}}}var Ca={$defs:{CatalogComponentCommon:{properties:{weight:{description:`The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.`,type:`number`}},type:`object`},DecisionDossierDocument:{$defs:{amendmentStep:{additionalProperties:!1,properties:{at:{type:`string`},author:{type:`string`},summary:{type:`string`}},required:[`at`,`author`,`summary`],type:`object`},amendmentTraceNode:{additionalProperties:!1,properties:{id:{type:`string`},kind:{const:`amendmentTrace`},steps:{items:{$ref:`#/$defs/DecisionDossierDocument/$defs/amendmentStep`},type:`array`},targetRef:{type:`string`}},required:[`id`,`kind`,`steps`,`targetRef`],type:`object`},comprehensionEvidence:{additionalProperties:!1,properties:{dossierHash:{type:`string`},signature:{type:`string`},subject:{type:`string`}},required:[`dossierHash`,`subject`],type:`object`},diagramNode:{additionalProperties:!1,properties:{alt:{type:`string`},id:{type:`string`},kind:{const:`diagram`},scene:{description:`diagram-core SemanticDocument, profile generic@1, without views, geometry or layout hints. Opaque JSON until the design-system publishes its authoritative schema; no Focus-specific scene model.`,type:`object`},source:{type:`string`},syntax:{enum:[`mermaid`,`plantuml`]},targetRef:{type:`string`}},required:[`alt`,`id`,`kind`,`source`,`syntax`,`targetRef`],type:`object`},glossaryEntry:{additionalProperties:!1,properties:{definition:{type:`string`},term:{type:`string`}},required:[`definition`,`term`],type:`object`},interaction:{additionalProperties:!1,properties:{enabled:{const:!1},label:{type:`string`},name:{type:`string`},targetRef:{type:`string`}},required:[`enabled`,`label`,`name`,`targetRef`],type:`object`},optionNode:{additionalProperties:!1,properties:{annotation:{enum:[`accept`,`comment`,`none`,`reject`]},annotationComment:{type:`string`},body:{type:`string`},consequence:{type:`string`},id:{type:`string`},kind:{const:`option`},label:{type:`string`},targetRef:{type:`string`}},required:[`annotation`,`id`,`kind`,`label`,`targetRef`],type:`object`},optionSetNode:{additionalProperties:!1,properties:{id:{type:`string`},kind:{const:`optionSet`},options:{items:{$ref:`#/$defs/DecisionDossierDocument/$defs/optionNode`},type:`array`},questionId:{type:`string`},targetRef:{type:`string`},title:{type:`string`}},required:[`id`,`kind`,`options`,`targetRef`],type:`object`},outcomeNode:{additionalProperties:!1,properties:{id:{type:`string`},kind:{const:`outcome`},modality:{enum:[`amendment`,`comment`,`decision`,`orientation`]},questionId:{type:`string`},statement:{type:`string`},targetRef:{type:`string`}},required:[`id`,`kind`,`modality`,`statement`,`targetRef`],type:`object`},proseNode:{additionalProperties:!1,properties:{id:{type:`string`},kind:{const:`prose`},markdown:{type:`string`},questionId:{type:`string`},targetRef:{type:`string`}},required:[`id`,`kind`,`markdown`,`targetRef`],type:`object`},provenance:{additionalProperties:!1,properties:{comprehensionEvidence:{$ref:`#/$defs/DecisionDossierDocument/$defs/comprehensionEvidence`},readAt:{type:`string`},source:{type:`string`}},required:[`readAt`,`source`],type:`object`},questionNode:{additionalProperties:!1,properties:{answer:{type:`string`},context:{type:`string`},id:{type:`string`},kind:{const:`question`},question:{type:`string`},readingTimeMinutes:{type:`number`},recommendedAnswer:{type:`string`},recommendedOptionId:{type:`string`},state:{enum:[`answered`,`open`,`validated`]},targetRef:{type:`string`}},required:[`id`,`kind`,`question`,`state`,`targetRef`],type:`object`},readability:{additionalProperties:!1,properties:{glossary:{items:{$ref:`#/$defs/DecisionDossierDocument/$defs/glossaryEntry`},type:`array`},noOwnerRequest:{type:`boolean`},ownerRequestQuote:{type:`string`},readingBudgetMinutes:{type:`number`},stakes:{type:`string`},stakesLevel:{enum:[`high`,`low`,`medium`]}},type:`object`},section:{oneOf:[{$ref:`#/$defs/DecisionDossierDocument/$defs/proseNode`},{$ref:`#/$defs/DecisionDossierDocument/$defs/questionNode`},{$ref:`#/$defs/DecisionDossierDocument/$defs/optionSetNode`},{$ref:`#/$defs/DecisionDossierDocument/$defs/outcomeNode`},{$ref:`#/$defs/DecisionDossierDocument/$defs/amendmentTraceNode`},{$ref:`#/$defs/DecisionDossierDocument/$defs/diagramNode`}]}},$schema:`https://json-schema.org/draft/2020-12/schema`,additionalProperties:!1,description:`Read-only decision-dossier snapshot published by @sentropic/focus. Closed: unknown fields refuse. Snapshot interactions are disabled metadata (enabled:false); live decisions, signatures and amendments require separately qualified runtime capabilities.`,properties:{amendmentTrace:{items:{$ref:`#/$defs/DecisionDossierDocument/$defs/amendmentStep`},type:`array`},cursor:{type:`string`},hash:{type:`string`},interactions:{items:{$ref:`#/$defs/DecisionDossierDocument/$defs/interaction`},type:`array`},provenance:{$ref:`#/$defs/DecisionDossierDocument/$defs/provenance`},readability:{$ref:`#/$defs/DecisionDossierDocument/$defs/readability`},ref:{type:`string`},sections:{items:{$ref:`#/$defs/DecisionDossierDocument/$defs/section`},type:`array`},subject:{type:`string`},title:{type:`string`}},required:[`amendmentTrace`,`cursor`,`hash`,`interactions`,`provenance`,`ref`,`sections`,`subject`,`title`],title:`DecisionDossierDocument`,type:`object`},anyComponent:{oneOf:[{$ref:`#/components/BarChart`},{$ref:`#/components/BpmnCanvas`},{$ref:`#/components/DecisionDossier`}]},theme:{properties:{themeId:{type:`string`}},type:`object`}},$id:`https://design-system.sent-tech.ca/catalogs/elements/v1/catalog.json`,$schema:`https://json-schema.org/draft/2020-12/schema`,catalogId:`https://design-system.sent-tech.ca/catalogs/elements/v1/catalog.json`,components:JSON.parse(`{"BarChart":{"allOf":[{"$ref":"https://a2ui.org/specification/v0_9_1/common_types.json#/$defs/ComponentCommon"},{"$ref":"#/$defs/CatalogComponentCommon"},{"properties":{"accessibility":{"additionalProperties":false,"properties":{"description":{"type":"string"},"label":{"type":"string"}},"type":"object"},"annotations":{"description":"Annotation overlay in data space (see ChartAnnotation).","items":{"anyOf":[{"additionalProperties":false,"properties":{"kind":{"const":"point","type":"string"},"label":{"type":"string"},"marker":{"description":"Marker glyph for a point annotation.","enum":["circle","diamond","square"],"type":"string"},"x":{"type":["number","string"]},"y":{"type":"number"}},"required":["kind","x","y"],"type":"object"},{"additionalProperties":false,"properties":{"anchor":{"enum":["end","middle","start"],"type":"string"},"kind":{"const":"label","type":"string"},"text":{"type":"string"},"x":{"type":["number","string"]},"y":{"type":"number"}},"required":["kind","text","x","y"],"type":"object"},{"additionalProperties":false,"properties":{"axis":{"enum":["x","y"],"type":"string"},"kind":{"const":"line","type":"string"},"label":{"type":"string"},"value":{"type":"number"}},"required":["axis","kind","value"],"type":"object"},{"additionalProperties":false,"properties":{"axis":{"enum":["x","y"],"type":"string"},"from":{"type":"number"},"kind":{"const":"region","type":"string"},"label":{"type":"string"},"to":{"type":"number"}},"required":["axis","from","kind","to"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"shape","type":"string"},"label":{"type":"string"},"points":{"items":{"additionalProperties":false,"properties":{"x":{"type":["number","string"]},"y":{"type":"number"}},"required":["x","y"],"type":"object"},"type":"array"}},"required":["kind","points"],"type":"object"}],"description":"Annotation overlay in data space, discriminated on \`kind\`. The \`x\` coordinate is categorical for this chart: it matches a bar by its \`label\` and is ignored otherwise; \`y\` and every value-axis number are numeric."},"type":"array"},"bands":{"description":"Shaded value-axis bands.","items":{"additionalProperties":false,"description":"A shaded band between two value-axis positions.","properties":{"from":{"description":"Band start in value-axis units.","type":"number"},"label":{"description":"Human-readable band label.","type":"string"},"to":{"description":"Band end in value-axis units.","type":"number"},"tone":{"description":"Feedback-token tone for the band.","enum":["error","info","neutral","success","warning"],"type":"string"}},"required":["from","to"],"type":"object"},"type":"array"},"component":{"const":"BarChart"},"data":{"description":"The bars, in draw order. Required.","items":{"additionalProperties":false,"description":"One bar: its label is also its selection key.","properties":{"errorHigh":{"description":"Upper error-bar extent (value-axis units). Drawn only when finite.","type":"number"},"errorLow":{"description":"Lower error-bar extent (value-axis units). Drawn only when finite.","type":"number"},"label":{"description":"The bar's category label; also its key for selection and hover.","type":"string"},"tone":{"description":"Explicit categorical tone; the palette default when absent.","enum":["category1","category2","category3","category4","category5","category6","category7","category8"],"type":"string"},"value":{"description":"The bar's value (value-axis units).","type":"number"}},"required":["label","value"],"type":"object"},"type":"array"},"dataLabels":{"anyOf":[{"type":"boolean"},{"additionalProperties":false,"properties":{"position":{"description":"Placement hint; the chart's default when absent.","enum":["auto","center","inside","outside","top"],"type":"string"}},"type":"object"}],"description":"Per-bar value labels; absent or false renders none."},"domain":{"description":"Fixed value-axis domain [min, max]; the auto data range when absent.","items":{"type":"number"},"maxItems":2,"minItems":2,"type":"array"},"goalLine":{"additionalProperties":false,"description":"A single goal line, emphasised above the bars.","properties":{"label":{"description":"Human-readable goal label.","type":"string"},"value":{"description":"Position of the goal line in value-axis units.","type":"number"}},"required":["value"],"type":"object"},"height":{"description":"Fixed pixel height; the component's default when absent.","type":"number"},"hoverKey":{"description":"Controlled synchronised hover key (a bar's label, or null for none).","type":["null","string"]},"invertAxis":{"description":"Inverts the value axis (high values toward the origin). Default false.","type":"boolean"},"keyboardNav":{"description":"Keyboard navigation of the data points (roving tabindex).","type":"boolean"},"label":{"description":"Human-readable chart label (also the accessible name). Required.","type":"string"},"orientation":{"description":"Bar direction; \\"vertical\\" by default.","enum":["horizontal","vertical"],"type":"string"},"referenceLines":{"description":"Reference lines on the value axis.","items":{"additionalProperties":false,"description":"A reference line on one axis (default axis: \\"y\\").","properties":{"axis":{"description":"Which axis the line spans; \\"y\\" by default.","enum":["x","y"],"type":"string"},"label":{"description":"Human-readable line label.","type":"string"},"tone":{"description":"Feedback-token tone for the line.","enum":["error","info","neutral","success","warning"],"type":"string"},"value":{"description":"Position of the line in value-axis units.","type":"number"}},"required":["value"],"type":"object"},"type":"array"},"scale":{"description":"Value-axis scale; \\"linear\\" by default, \\"log\\" needs positive values.","enum":["linear","log"],"type":"string"},"selectedKeys":{"description":"Keys of the currently selected bars (a bar's key is its label). Controlled.","items":{"type":"string"},"type":"array"},"showLegend":{"description":"Accepted for cross-chart parity; BarChart has no separate legend surface.","type":"boolean"},"width":{"description":"Fixed pixel width; the container's when absent.","type":"number"}},"required":["component","data","label"],"type":"object"}],"type":"object","unevaluatedProperties":false,"x-sentropic":{"contract":"1.0","element":"st-bar-chart","engine":"core","events":["select"],"example":{"component":"BarChart","data":[{"label":"Q1","value":12},{"label":"Q2","value":18},{"label":"Q3","value":9}],"dataLabels":true,"id":"root","label":"Revenue (M€)","referenceLines":[{"label":"Target","value":15}]},"fallback":"svg","parity":{"angular":{"comparedProps":17,"file":"packages/components-angular/src/BarChart.ts","status":"match","type":"BarChartProps"},"react":{"comparedProps":17,"file":"packages/components-react/src/BarChart.tsx","note":"Own members after subtracting React.HTMLAttributes<HTMLDivElement>; className is React's name for the class style hook.","status":"match","type":"BarChartProps"},"svelte":{"file":"packages/components-svelte/src/lib/BarChart.svelte","note":"Reference pilot (§3.1); not mechanically generatable (Svelte file), mirrored here member for member.","status":"source-of-truth","type":"BarChartProps"},"vue":{"comparedProps":17,"file":"packages/components-vue/src/BarChart.ts","status":"match","type":"BarChartProps"}},"schema":"https://design-system.sent-tech.ca/catalogs/elements/v1/components/BarChart.json"}},"BpmnCanvas":{"allOf":[{"$ref":"https://a2ui.org/specification/v0_9_1/common_types.json#/$defs/ComponentCommon"},{"$ref":"#/$defs/CatalogComponentCommon"},{"properties":{"accessibility":{"additionalProperties":false,"properties":{"description":{"type":"string"},"label":{"type":"string"}},"type":"object"},"component":{"const":"BpmnCanvas"},"document":{"additionalProperties":{},"description":"The F1 document to render: a structural envelope the engine's hydrate validates.","properties":{"$type":{"description":"F1 type discriminator, e.g. \\"bpmn:Definitions\\".","type":"string"}},"required":["$type"],"type":"object"}},"required":["component","document"],"type":"object"}],"type":"object","unevaluatedProperties":false,"x-sentropic":{"contract":"1.0","element":"st-bpmn-canvas","engine":"lazy:bpmn-canvas","events":[],"example":{"component":"BpmnCanvas","document":{"$type":"bpmn:Definitions","id":"definitions-1","targetNamespace":"https://example.com/bpmn"},"id":"root"},"fallback":"svg","parity":{"angular":{"file":"packages/components-angular","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"},"react":{"file":"packages/components-react","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"},"svelte":{"file":"packages/components-svelte","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"},"vue":{"file":"packages/components-vue","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"}},"schema":"https://design-system.sent-tech.ca/catalogs/elements/v1/components/BpmnCanvas.json","semantic":{"runtimePackage":"@sentropic/bpmn-canvas","source":"bpmn-canvas"}}},"DecisionDossier":{"allOf":[{"$ref":"https://a2ui.org/specification/v0_9_1/common_types.json#/$defs/ComponentCommon"},{"$ref":"#/$defs/CatalogComponentCommon"},{"properties":{"accessibility":{"additionalProperties":false,"properties":{"description":{"type":"string"},"label":{"type":"string"}},"type":"object"},"component":{"const":"DecisionDossier"},"document":{"$ref":"#/$defs/DecisionDossierDocument"}},"required":["component","document"],"type":"object"}],"type":"object","unevaluatedProperties":false,"x-sentropic":{"contract":"1.0","element":"st-decision-dossier","engine":"lazy:focus","events":["choose-option"],"example":{"component":"DecisionDossier","document":{"amendmentTrace":[],"cursor":"2026-10-30T10:00:00Z","hash":"b7d3f0c9","interactions":[],"provenance":{"readAt":"2026-10-30T10:00:00Z","source":"track"},"ref":"decision-1","sections":[{"id":"q1","kind":"question","question":"Which rendering contract do we adopt?","state":"open","targetRef":"decision-1"},{"id":"options-1","kind":"optionSet","options":[{"annotation":"none","id":"opt-json","kind":"option","label":"Adopt the JSON render standard","targetRef":"q1"},{"annotation":"none","id":"opt-status-quo","kind":"option","label":"Keep the status quo","targetRef":"q1"}],"targetRef":"q1","title":"Options"}],"subject":"Adopt the JSON render standard for design-system rendering","title":"Decision: adopt the JSON render standard"},"id":"root"},"fallback":"text","parity":{"angular":{"file":"packages/components-angular","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"},"react":{"file":"packages/components-react","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"},"svelte":{"file":"packages/components-svelte","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"},"vue":{"file":"packages/components-vue","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"}},"schema":"https://design-system.sent-tech.ca/catalogs/elements/v1/components/DecisionDossier.json","semantic":{"runtimePackage":"@sentropic/focus@0.5.0","schemaId":"urn:sentropic:focus:DecisionDossierDocument:1.0.0","schemaSubpath":"schemas/decision-dossier-document.v1.schema.json","sha256":"725bc07e7c6b6ad51a1f720cc9fb02649d8f31bc54e71c61c350fd20058c8852","source":"focus"}}}}`),description:`A2UI v0.9.1 basic catalogue of the Sentropic design system elements (JSON render standard, spec/SPEC_EVOL_DS_JSON_RENDER_STANDARD.md §5.2). Each component carries its x-sentropic contract version, element name, engine, events, fallback and standalone schema id; semantic documents are validated by their owning runtimes (§4.3).`,functions:{},title:`Sentropic design system elements catalogue`},wa={$id:`https://design-system.sent-tech.ca/catalogs/elements/v1/envelope.json`,$schema:`https://json-schema.org/draft/2020-12/schema`,description:"The render envelope of the JSON render standard (§4.2): one A2UI v0.9.1 component object under `root`, with the targeted component's contract version and an optional mode. The root interior is validated by the targeted component's catalogue entry, not by this schema.",properties:{catalogId:{type:`string`},contract:{pattern:`^[0-9]+\\.[0-9]+$`,type:`string`},mode:{enum:[`preview`,`snapshot`],type:`string`},root:{properties:{component:{type:`string`},id:{const:`root`}},required:[`component`,`id`],type:`object`}},required:[`contract`,`root`],title:`Sentropic render envelope`,type:`object`,unevaluatedProperties:!1},Ta={$defs:{AccessibilityAttributes:{description:`Attributes to enhance accessibility when using assistive technologies like screen readers.`,properties:{description:{$ref:`#/$defs/DynamicString`,description:`Additional information provided by assistive technologies about an element such as instructions, format requirements, or result of an action. For example, a mute button might have a label of 'Mute' and a description of 'Silences notifications about this conversation'.`},label:{$ref:`#/$defs/DynamicString`,description:`A short string, typically 1 to 3 words, used by assistive technologies to convey the purpose or intent of an element. For example, an input field might have an accessible label of 'User ID' or a button might be labeled 'Submit'.`}},type:`object`},Action:{description:`Defines an interaction handler that can either trigger a server-side event or execute a local client-side function.`,oneOf:[{additionalProperties:!1,description:`Triggers a server-side event.`,properties:{event:{additionalProperties:!1,description:`The event to dispatch to the server.`,properties:{context:{additionalProperties:{$ref:`#/$defs/DynamicValue`},description:`A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.`,type:`object`},name:{description:`The name of the action to be dispatched to the server.`,type:`string`}},required:[`name`],type:`object`}},required:[`event`],type:`object`},{additionalProperties:!1,description:`Executes a local client-side function.`,properties:{functionCall:{$ref:`#/$defs/FunctionCall`}},required:[`functionCall`],type:`object`}]},CheckRule:{additionalProperties:!1,description:`A single validation rule applied to an input component.`,properties:{condition:{$ref:`#/$defs/DynamicBoolean`},message:{description:`The error message to display if the check fails.`,type:`string`}},required:[`condition`,`message`],type:`object`},Checkable:{description:`Properties for components that support client-side checks.`,properties:{checks:{description:`A list of checks to perform. These are function calls that must return a boolean indicating validity.`,items:{$ref:`#/$defs/CheckRule`},type:`array`}},type:`object`},ChildList:{oneOf:[{description:`A static list of child component IDs.`,items:{$ref:`#/$defs/ComponentId`},type:`array`},{additionalProperties:!1,description:"A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.",properties:{componentId:{$ref:`#/$defs/ComponentId`},path:{description:`The path to the list of component property objects in the data model.`,type:`string`}},required:[`componentId`,`path`],type:`object`}]},ComponentCommon:{properties:{accessibility:{$ref:`#/$defs/AccessibilityAttributes`},id:{$ref:`#/$defs/ComponentId`}},required:[`id`],type:`object`},ComponentId:{description:`The unique identifier for a component, used for both definitions and references within the same surface.`,type:`string`},DataBinding:{additionalProperties:!1,properties:{path:{description:`A JSON Pointer path to a value in the data model.`,type:`string`}},required:[`path`],type:`object`},DynamicBoolean:{description:`A boolean value that can be a literal, a path, or a function call returning a boolean.`,oneOf:[{type:`boolean`},{$ref:`#/$defs/DataBinding`},{allOf:[{$ref:`#/$defs/FunctionCall`},{properties:{returnType:{const:`boolean`}}}]}]},DynamicNumber:{description:`Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number.`,oneOf:[{type:`number`},{$ref:`#/$defs/DataBinding`},{allOf:[{$ref:`#/$defs/FunctionCall`},{properties:{returnType:{const:`number`}}}]}]},DynamicString:{description:`Represents a string`,oneOf:[{type:`string`},{$ref:`#/$defs/DataBinding`},{allOf:[{$ref:`#/$defs/FunctionCall`},{properties:{returnType:{const:`string`}}}]}]},DynamicStringList:{description:`Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array.`,oneOf:[{items:{type:`string`},type:`array`},{$ref:`#/$defs/DataBinding`},{allOf:[{$ref:`#/$defs/FunctionCall`},{properties:{returnType:{const:`array`}}}]}]},DynamicValue:{description:`A value that can be a literal, a path, or a function call returning any type.`,oneOf:[{type:`string`},{type:`number`},{type:`boolean`},{type:`array`},{$ref:`#/$defs/DataBinding`},{$ref:`#/$defs/FunctionCall`}]},FunctionCall:{description:`Invokes a named function on the client.`,oneOf:[{$ref:`catalog.json#/$defs/anyFunction`}],properties:{args:{additionalProperties:{anyOf:[{$ref:`#/$defs/DynamicValue`},{description:`A literal object argument (e.g. configuration).`,type:`object`}]},description:`Arguments passed to the function.`,type:`object`},call:{description:`The name of the function to call.`,type:`string`},returnType:{default:`boolean`,description:`The expected return type of the function call.`,enum:[`any`,`array`,`boolean`,`number`,`object`,`string`,`void`],type:`string`}},required:[`call`],type:`object`}},$id:`https://a2ui.org/specification/v0_9_1/common_types.json`,$schema:`https://json-schema.org/draft/2020-12/schema`,description:`Common type definitions used across A2UI schemas.`,title:`A2UI Common Types`},Ea={$defs:{anyFunction:{not:{}}},$id:`https://a2ui.org/specification/v0_9_1/catalog.json`,$schema:`https://json-schema.org/draft/2020-12/schema`},Da=new Set([`$ref`,`type`,`enum`,`const`,`pattern`,`properties`,`required`,`additionalProperties`,`unevaluatedProperties`,`items`,`minItems`,`maxItems`,`allOf`,`anyOf`,`oneOf`,`not`]),Oa=new Set([`$schema`,`$id`,`$defs`,`$anchor`,`$dynamicAnchor`,`$comment`,`$vocabulary`,`title`,`description`,`default`,`examples`,`example`,`note`,`deprecated`,`readOnly`,`writeOnly`,`catalogId`,`components`,`functions`,`x-sentropic`]),ka=new Set([`multipleOf`,`maximum`,`exclusiveMaximum`,`minimum`,`exclusiveMinimum`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`uniqueItems`,`contains`,`maxContains`,`minContains`,`patternProperties`,`dependentRequired`,`dependentSchemas`,`propertyNames`,`prefixItems`,`unevaluatedItems`,`if`,`then`,`else`,`definitions`,`$dynamicRef`,`$recursiveRef`]);function $(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Aa(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ja(e,t){if(e===t)return!0;if(!$(e)&&!Array.isArray(e))return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>ja(e,t[n]));if(!$(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Object.hasOwn(t,n)&&ja(e[n],t[n]))}function Ma(e,t){switch(e){case`object`:return $(t);case`array`:return Array.isArray(t);case`string`:return typeof t==`string`;case`number`:return typeof t==`number`;case`integer`:return typeof t==`number`&&Number.isInteger(t);case`boolean`:return typeof t==`boolean`;case`null`:return t===null;default:return!0}}var Na=class{#e=new Map;register(e,t){if(!$(e)||typeof e.$id!=`string`||e.$id.length===0)throw Error(`the ${t} must carry its $id so every $ref resolves without network access`);return this.#e.set(e.$id,e),e.$id}resolve(e,t){let n=e.indexOf(`#`),r=n===-1?e:e.slice(0,n),i=n===-1?``:e.slice(n+1),a=t;r.length>0&&(a=/^[a-z][a-z0-9+.-]*:/i.test(r)?r:Pa(t,r));let o=this.#e.get(a);if(o===void 0)throw Error(`the $ref "${e}" does not name a registered document (from ${t})`);return{schema:i.length===0?o:Fa(o,i,e),baseId:a}}};function Pa(e,t){let n=e.lastIndexOf(`/`);return n===-1?t:`${e.slice(0,n+1)}${t}`}function Fa(e,t,n){if(!t.startsWith(`/`))throw Error(`the $ref "${n}" must use a JSON pointer (URI fragments are not used by the registered documents)`);let r=e;for(let e of t.slice(1).split(`/`)){let t=e.replace(/~1/g,`/`).replace(/~0/g,`~`);if(Array.isArray(r)){let e=Number(t);if(!Number.isInteger(e)||e<0||e>=r.length)throw Error(`the $ref "${n}" does not resolve: no array item ${t}`);r=r[e]}else{if(!$(r)||!Object.hasOwn(r,t))throw Error(`the $ref "${n}" does not resolve: no property "${t}"`);r=r[t]}}return r}function Ia(e,t){if(typeof e==`boolean`)return;if(!$(e))throw Error(`the ${t} contains a schema that is neither a boolean nor an object`);for(let n of Object.keys(e))if(!(n.startsWith(`x-`)||Oa.has(n)||Da.has(n)))throw ka.has(n)?Error(`the ${t} uses "${n}", outside the browser structure interpreter's keyword set (§6.4): extend src/structure/interpreter.ts and its oracle test`):Error(`the ${t} uses unknown keyword "${n}": extend src/structure/interpreter.ts and its oracle test, or allowlist it as an annotation`);let n=e.items;if(Array.isArray(n))throw Error(`the ${t} uses "items" in its legacy tuple form, which the browser structure interpreter does not implement`);if(n!==void 0&&!$(n)&&typeof n!=`boolean`)throw Error(`the ${t} uses "items" in a non-schema form, which the browser structure interpreter does not implement`);for(let n of[`additionalProperties`,`unevaluatedProperties`,`not`]){let r=e[n];if(r!==void 0&&!$(r)&&typeof r!=`boolean`)throw Error(`the ${t} uses "${n}" in a non-schema form, which the browser structure interpreter does not implement`)}for(let n of[`allOf`,`anyOf`,`oneOf`]){let r=e[n];if(r!==void 0&&!Array.isArray(r))throw Error(`the ${t} uses "${n}" in a non-array form, which the browser structure interpreter does not implement`)}let r=[];for(let t of[`$defs`,`properties`,`components`]){let n=e[t];if($(n))for(let e of Object.values(n))r.push([`${t} entry`,e])}n!==void 0&&r.push([`items`,n]);for(let t of[`additionalProperties`,`unevaluatedProperties`,`not`]){let n=e[t];($(n)||typeof n==`boolean`)&&r.push([t,n])}for(let t of[`allOf`,`anyOf`,`oneOf`]){let n=e[t];if(Array.isArray(n))for(let e of n)r.push([t,e])}for(let[e,n]of r)Ia(n,`${t} (${e})`)}var La=new Set;function Ra(e,t,n,r,i,a){if(e===!0)return{ok:!0,evaluated:La};if(e===!1||e==null)return a.push({pointer:n,message:`the schema is false here`,keyword:`schema`}),{ok:!1,evaluated:La};if(!$(e))return a.push({pointer:n,message:`the schema node is neither a boolean nor an object`,keyword:`schema`}),{ok:!1,evaluated:La};let o=!0,s=new Set,c=e=>{o=!1,a.push(e)},l=e.$ref,u=r;if(typeof l==`string`){let e=i.resolve(l,r),c=Ra(e.schema,t,n,e.baseId,i,a);for(let e of c.evaluated)s.add(e);c.ok||(o=!1)}let d=e.type;if(d!==void 0){let e=Array.isArray(d)?d:[d],r=e.filter(e=>typeof e==`string`);e.length>0&&r.length===e.length&&!r.some(e=>Ma(e,t))&&c({pointer:n,message:`must be ${r.join(`,`)}`,keyword:`type`})}let f=e.enum;Array.isArray(f)&&!f.some(e=>ja(e,t))&&c({pointer:n,message:`must be equal to one of the allowed values`,keyword:`enum`}),Object.hasOwn(e,`const`)&&!ja(e.const,t)&&c({pointer:n,message:`must be equal to constant`,keyword:`const`});let p=e.pattern;if(typeof p==`string`&&typeof t==`string`&&!new RegExp(p,`u`).test(t)&&c({pointer:n,message:`must match pattern "${p}"`,keyword:`pattern`}),$(t)){let r=Object.keys(t),l=e.required;if(Array.isArray(l))for(let e of l)typeof e==`string`&&!Object.hasOwn(t,e)&&c({pointer:n,message:`must have required property '${e}'`,keyword:`required`,missingProperty:e});let d=$(e.properties)?e.properties:{};for(let[e,r]of Object.entries(d))Object.hasOwn(t,e)&&(s.add(e),Ra(r,t[e],`${n}/${Aa(e)}`,u,i,a).ok||(o=!1));let f=e.additionalProperties,p=new Set(Object.keys(d));if(f===!1)for(let e of r)p.has(e)||(s.add(e),c({pointer:n,message:`must NOT have additional properties`,keyword:`additionalProperties`,additionalProperty:e}));else if($(f)||f===!0){let e=$(f);for(let c of r)p.has(c)||(s.add(c),!e)||Ra(f,t[c],`${n}/${Aa(c)}`,u,i,a).ok||(o=!1)}}if(Array.isArray(t)){let r=e.minItems;typeof r==`number`&&t.length<r&&c({pointer:n,message:`must NOT have fewer than ${r} items`,keyword:`minItems`});let s=e.maxItems;typeof s==`number`&&t.length>s&&c({pointer:n,message:`must NOT have more than ${s} items`,keyword:`maxItems`});let l=e.items;l!==void 0&&!Array.isArray(l)&&t.forEach((e,t)=>{Ra(l,e,`${n}/${t}`,u,i,a).ok||(o=!1)})}let m=e.allOf;if(Array.isArray(m))for(let e of m){let r=Ra(e,t,n,u,i,a);for(let e of r.evaluated)s.add(e);r.ok||(o=!1)}let h=e.anyOf;if(Array.isArray(h)){let e=!1,r=[];for(let a of h){let o=[],c=Ra(a,t,n,u,i,o);if(r.push(o),c.ok){e=!0;for(let e of c.evaluated)s.add(e)}}if(!e){o=!1;for(let e of r)a.push(...e);a.push({pointer:n,message:`must match a schema in anyOf`,keyword:`anyOf`})}}let g=e.oneOf;if(Array.isArray(g)){let e=[],r=[],c=0,l=-1;if(g.forEach((a,o)=>{let s=[],d=Ra(a,t,n,u,i,s);e.push(s),r.push(d.evaluated),d.ok&&(c+=1,l=o)}),c===1&&l>=0)for(let e of r[l]??[])s.add(e);else{o=!1;for(let t of e)a.push(...t);a.push({pointer:n,message:`must match exactly one schema in oneOf`,keyword:`oneOf`})}}let _=e.not;if(_!==void 0&&Ra(_,t,n,u,i,[]).ok&&(a.push({pointer:n,message:`must NOT be valid`,keyword:`not`}),o=!1),$(t)){let r=e.unevaluatedProperties;if(r!==void 0){let e=Object.keys(t).filter(e=>!s.has(e));if(r===!1)for(let t of e)c({pointer:n,message:`must NOT have unevaluated properties`,keyword:`unevaluatedProperties`,additionalProperty:t});else if(($(r)||r===!0)&&$(r))for(let c of e)Ra(r,t[c],`${n}/${Aa(c)}`,u,i,a).ok?s.add(c):o=!1}}return{ok:o,evaluated:s}}function za(e){let t=new Na,n=t.register(e.catalog,`catalogue document`);if(typeof e.catalog.catalogId!=`string`||e.catalog.catalogId.length===0)throw Error(`the catalogue document must carry its catalogId (§5.2: $id = catalogId)`);let r=t.register(e.envelopeSchema,`envelope schema`);return t.register(e.commonTypes,`A2UI common types`),t.register(Ea,`built catalog.json stub`),Ia(e.catalog,`catalogue document`),Ia(e.envelopeSchema,`envelope schema`),Ia(e.commonTypes,`A2UI common types`),Ia(Ea,`built catalog.json stub`),{validateEnvelope(n){let i=[];return Ra(e.envelopeSchema,n,``,r,t,i),i},validateComponent(r,i){let a=e.catalog.components[r];if(a===void 0)return[{pointer:`/component`,message:`no catalogued component is named ${r}`,keyword:`$compile`}];let o=[];return Ra(a,i,``,n,t,o),o}}}var Ba=new Map;function Va(){return new Proxy({},{get(e,t){return Ba.get(t)}})}var Ha;function Ua(){return Ha===void 0&&(Ha=Sa({catalog:Ca,envelopeSchema:wa,commonTypes:Ta,ports:Va(),structure:za({catalog:Ca,envelopeSchema:wa,commonTypes:Ta})})),Ha}function Wa(e,t){Ba.set(e,t)}var Ga=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),Ka=function(e){return`/`+e},qa={},Ja=function(e){return e.pathname.endsWith(`.css`)},Ya=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Xa=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Ka(t,n);let r=s(t),i=Ja(r);return Ya(qa,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Ga,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Za={BpmnCanvas:`bpmn-canvas`,DecisionDossier:`focus`},Qa=new Map;async function $a(e){let t=Qa.get(e);if(t!==void 0)return t;let n=(e===`BpmnCanvas`?Xa(()=>import(`./chunks/bpmn-canvas-DeAWdJFy.js`).then(e=>e.t),[]):e===`DecisionDossier`?Xa(()=>import(`./chunks/focus-renderer-BgsZGo7n.js`),[]):Promise.reject(Error(`core components load no engine chunk`))).catch(t=>{throw Qa.delete(e),t});return Qa.set(e,n),n}function eo(e){return e.root??{}}function to(e,t){return{code:`unknown-component`,path:`/root/component`,message:`<${`st-${e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}`}> requires root.component "${e}", got "${t}"`,severity:`error`,source:`catalog`,detail:{expected:e,found:t}}}function no(e,t){if(e===`BarChart`)return!1;let n=Za[e];return t.length>0&&t.every(e=>e.code===`host-capability-missing`&&e.detail?.chunk===n)}function ro(e){let t=e?.bpmn?.watermark;if(t===void 0)return;let{hidden:n,license:r}=t;if(n===!0&&typeof r==`string`&&r.trim()!==``)return{hidden:!0,license:r}}function io(e){let t=F(`idle`),n=F(Kt([])),r=F(null),i=new Set,a=!1,o=0;function s(e){if(I(t,e,!0),!a&&(e===`rendered`||e===`refused`)){a=!0;for(let e of i)e()}}function c(e){return a?e():i.add(e),()=>i.delete(e)}function l(...e){I(n,[...e],!0)}function u(e){K(n).some(t=>t.code===e.code&&t.path===e.path&&t.message===e.message)||I(n,[...K(n),e],!0)}async function d(i,a){let c=++o;I(t,`rendering`);try{let t=va(i),l=Ua().validate(t.ok?t.value:i);if(c!==o)return;let u=(t.ok?t.value:i)?.root?.component;if(typeof u==`string`&&u!==e){I(n,[to(e,u)],!0),I(r,null),s(`refused`);return}let d=l.filter(e=>e.severity===`error`);if(d.length>0&&!no(e,d)){I(n,[...l],!0),I(r,null),s(`refused`);return}if(e!==`BarChart`&&d.length>0){let a=await $a(e);if(Wa(Za[e],a.port),c!==o)return;let l=Ua().validate(t.ok?t.value:i);if(c!==o)return;if(l.filter(e=>e.severity===`error`).length>0){I(n,[...l],!0),I(r,null),s(`refused`);return}I(n,[...l],!0)}else I(n,[...l],!0);if(!t.ok){I(r,null),s(`refused`);return}let f=eo(t.value);if(e===`BarChart`){let{component:e,id:t,...n}=f;I(r,{kind:`bar-chart`,props:n},!0)}else if(e===`BpmnCanvas`){let{toXml:t}=await $a(e),i=await t(f.document);if(c!==o)return;if(!i.ok){I(n,[{code:`semantic-invalid`,path:`/root/document`,message:i.message,severity:`error`,source:`bpmn-canvas`,detail:{code:i.code}}],!0),I(r,null),s(`refused`);return}I(r,{kind:`bpmn`,xml:i.xml,assetBase:typeof a?.assetBase==`string`?a.assetBase:void 0,watermark:ro(a)},!0)}else I(r,{kind:`dossier`,document:f.document},!0);s(`rendered`)}catch(t){if(c!==o)return;let n=t instanceof Error?t.message:String(t),r=Za[e];l(r===void 0?{code:`semantic-invalid`,path:``,message:`the element failed to render the envelope: ${n}`,severity:`error`,source:`host`,detail:{cause:n}}:pa(r,n)),s(`refused`)}}return{get state(){return K(t)},get diagnostics(){return K(n)},get payload(){return K(r)},ingest:d,onSettle:c,noteEngineDiagnostic:u}}var ao=new WeakMap,oo=new WeakMap;function so(e){let t=oo.get(e);if(t===void 0){let n;t={promise:new Promise(e=>{n=e}),resolve:n},oo.set(e,t),ao.get(e)?.onSettle(n)}return t}function co(e,t){ao.set(e,t);let n=oo.get(e);n!==void 0&&t.onSettle(n.resolve)}function lo(e){let t=customElements.get(e);if(t===void 0)throw Error(`the ${e} element is not registered; import its module first`);let n=t.prototype;Object.defineProperty(n,"state",{get(){return ao.get(this)?.state??`idle`}}),Object.defineProperty(n,"diagnostics",{get(){return ao.get(this)?.diagnostics??[]}}),Object.defineProperty(n,"ready",{get(){return so(this).promise}})}var uo=`/* Generated by packages/themes/scripts/build-css.mjs. */
48
+ controlled) bar. Decorative (aria-hidden). */.st-barChart__crosshairLine.svelte-14iupu9 {stroke:var(--st-semantic-border-strong);stroke-width:1;stroke-dasharray:3 3;opacity:0.7;}`};function fa(e,t){Ve(t,!0),zr(e,da);let n=ci(t,`width`,3,480),r=ci(t,`height`,3,240),i=ci(t,`orientation`,3,`vertical`),a=ci(t,`selectedKeys`,19,()=>[]),o=ci(t,`scale`,3,`linear`),s=ci(t,`invertAxis`,3,!1),c={top:12,right:16,bottom:32,left:44};function l(e,t,n=5){if(!Number.isFinite(e)||!Number.isFinite(t)||e===t)return[Number.isFinite(t)?t:0];let r=(t-e)/Math.max(n-1,1),i=10**Math.floor(Math.log10(r)),a=r/i,o;o=a<1.5?1*i:a<3?2*i:a<7?5*i:10*i;let s=Math.floor(e/o)*o,c=Math.ceil(t/o)*o,l=[];for(let e=s;e<=c+o/2;e+=o)l.push(Number(e.toFixed(10)));return l}let u=e=>Array.from(new Set(e.filter(Number.isFinite).map(e=>Number(e.toFixed(10))))).sort((e,t)=>e-t);function d(e,t,n=5){return!Number.isFinite(e)||!Number.isFinite(t)||e>=t?l(e,t,n):u([e,...l(e,t,n).filter(n=>n>e&&n<t),t])}function f(...e){let t=1/0;for(let n of e)Number.isFinite(n)&&n>0&&n<t&&(t=n);return Number.isFinite(t)?t:1}function p(e,t){let n=e>0?e:1,r=t>n?t:n*10,i=Math.floor(Math.log10(n)),a=Math.ceil(Math.log10(r)),o=[];for(let e=i;e<=a;e++)o.push(Number((10**e).toFixed(10)));return o.length?o:[n]}function m(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||e>=t?p(e,t):u([e,...p(e,t).filter(n=>n>e&&n<t),t])}function h(e){return e&&Number.isFinite(e[0])&&Number.isFinite(e[1])&&e[0]<e[1]?e:null}function g(e){return e&&Number.isFinite(e[0])&&Number.isFinite(e[1])&&e[0]>0&&e[0]<e[1]?e:null}function _(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function v(e){return Math.abs(e)>=1e3?`${(e/1e3).toFixed(e%1e3==0?0:1)}k`:Number.isInteger(e)?String(e):e.toFixed(1)}function y(e,t){return`${e}--${t??`neutral`}`}function b(e,t,n,r,i,a,o=`y`){let s=e,c=t,l=e=>{e!==void 0&&Number.isFinite(e)&&(e<s&&(s=e),e>c&&(c=e))};for(let e of n??[])(e.axis??`y`)===o&&l(e.value);for(let e of r??[])l(e.from),l(e.to);i&&l(i.value);for(let e of a)l(e);return[s,c]}function x(e,t,n){let r=[];for(let t of e??[])Number.isFinite(t.value)&&r.push(t.label?`Référence: ${t.label} = ${t.value}`:`Référence: ${t.value}`);for(let e of t??[]){if(!Number.isFinite(e.from)||!Number.isFinite(e.to))continue;let t=Math.min(e.from,e.to),n=Math.max(e.from,e.to);r.push(e.label?`Bande: ${e.label} (${t}–${n})`:`Bande: ${t}–${n}`)}return n&&Number.isFinite(n.value)&&r.push(n.label?`Objectif: ${n.label} = ${n.value}`:`Objectif: ${n.value}`),r}let S=F(null),ee=P(()=>new Set(a())),te=P(()=>K(ee).size>0),ne=P(()=>typeof t.onSelect==`function`),re=P(()=>o()===`log`),C=P(()=>K(re)?g(t.domain):h(t.domain)),ie=P(()=>t.goalLine&&Number.isFinite(t.goalLine.value)?t.goalLine:null),ae=P(()=>i()===`vertical`?`y`:`x`),w=P(()=>{let e=t.data.map(e=>e.value),i=t.data.flatMap(e=>[e.errorLow,e.errorHigh].filter(e=>e!==void 0&&Number.isFinite(e))),a,o;if(K(re)){let s=[...(t.referenceLines??[]).filter(e=>(e.axis??`y`)===K(ae)).map(e=>e.value),...(t.bands??[]).flatMap(e=>[e.from,e.to]),...K(ie)?[K(ie).value]:[],...i];K(C)?(a=K(C)[0],o=K(C)[1]):(a=f(...e,...s),o=Math.max(a,...e.filter(e=>e>0),...s.filter(e=>e>0)));let l=K(C)?m(a,o):p(a,o);return{ticks:l,domainMin:l[0],domainMax:l[l.length-1],plotWidth:Math.max(n()-c.left-c.right,1),plotHeight:Math.max(r()-c.top-c.bottom,1)}}a=K(C)?K(C)[0]:Math.min(0,...e),o=K(C)?K(C)[1]:Math.max(0,...e),K(C)||([a,o]=b(a,o,t.referenceLines,t.bands,K(ie),i,K(ae)));let s=K(C)?d(a,o,5):l(a,o,5);return{ticks:s,domainMin:s[0],domainMax:s[s.length-1],plotWidth:Math.max(n()-c.left-c.right,1),plotHeight:Math.max(r()-c.top-c.bottom,1)}}),oe=P(()=>e=>{let{domainMin:t,domainMax:n}=K(w),r;if(K(re)){let i=Math.log10(t),a=Math.log10(n);r=a===i?0:(Math.log10(e>0?e:t)-i)/(a-i)}else r=n===t?0:(e-t)/(n-t);return _(s()?1-r:r)}),se=P(()=>K(re)?K(w).domainMin:Math.min(K(w).domainMax,Math.max(K(w).domainMin,0))),T=P(()=>{let{plotWidth:e,plotHeight:n}=K(w);if(t.data.length===0)return[];if(i()===`vertical`){let r=e/t.data.length,i=r*.62,a=e=>n*(1-K(oe)(e)),o=a(K(se));return t.data.map((e,t)=>{let n=a(e.value),s=Math.min(n,o),l=Math.abs(o-n);return{x:c.left+r*t+(r-i)/2,y:c.top+s,width:i,height:Math.max(l,.5),cx:c.left+r*(t+.5),cy:c.top+n,datum:e,tone:e.tone??`category1`}})}let r=n/t.data.length,a=r*.62,o=t=>e*K(oe)(t),s=o(K(se));return t.data.map((e,t)=>{let n=o(e.value),i=Math.min(n,s),l=Math.abs(n-s),u=c.top+r*t+(r-a)/2;return{x:c.left+i,y:u,width:Math.max(l,.5),height:a,cx:c.left+n,cy:c.top+r*(t+.5),datum:e,tone:e.tone??`category1`}})}),E=P(()=>i()===`vertical`),ce=P(()=>e=>{let{plotWidth:t,plotHeight:n}=K(w);return K(E)?c.top+n*(1-K(oe)(e)):c.left+t*K(oe)(e)}),le=P(()=>(t.bands??[]).filter(e=>Number.isFinite(e.from)&&Number.isFinite(e.to)).map((e,t)=>{let n=K(ce)(e.from),r=K(ce)(e.to);return K(E)?{key:t,x:c.left,y:Math.min(n,r),width:K(w).plotWidth,height:Math.max(Math.abs(r-n),.5),label:e.label,tone:e.tone}:{key:t,x:Math.min(n,r),y:c.top,width:Math.max(Math.abs(r-n),.5),height:K(w).plotHeight,label:e.label,tone:e.tone}})),ue=P(()=>(t.referenceLines??[]).filter(e=>Number.isFinite(e.value)).map((e,t)=>{let n=K(ce)(e.value);return K(E)?{key:t,x1:c.left,x2:c.left+K(w).plotWidth,y1:n,y2:n,label:e.label,tone:e.tone}:{key:t,x1:n,x2:n,y1:c.top,y2:c.top+K(w).plotHeight,label:e.label,tone:e.tone}})),de=P(()=>K(ie)?{p:K(ce)(K(ie).value),label:K(ie).label,value:K(ie).value}:null),fe=P(()=>{let e=[];for(let t of K(T)){let{errorLow:n,errorHigh:r}=t.datum,i=n!==void 0&&Number.isFinite(n),a=r!==void 0&&Number.isFinite(r);if(!i&&!a)continue;let o=i?n:t.datum.value,s=a?r:t.datum.value,c=K(ce)(o),l=K(ce)(s);if(K(E)){let n=t.x+t.width/2;e.push({key:t.datum.label,stem:{x1:n,y1:c,x2:n,y2:l},capLow:{x1:n-4,y1:c,x2:n+4,y2:c},capHigh:{x1:n-4,y1:l,x2:n+4,y2:l}})}else{let n=t.y+t.height/2;e.push({key:t.datum.label,stem:{x1:c,y1:n,x2:l,y2:n},capLow:{x1:c,y1:n-4,x2:c,y2:n+4},capHigh:{x1:l,y1:n-4,x2:l,y2:n+4}})}}return e}),pe=P(()=>e=>{let t=K(T).find(t=>t.datum.label===String(e));return t?K(E)?t.cx-c.left:t.cy-c.top:null}),me=P(()=>e=>Number.isFinite(e)?K(ce)(e)-(K(E)?c.top:c.left):null),he=P(()=>e=>!e||K(E)?e:e.map(e=>{switch(e.kind){case`line`:return{...e,axis:e.axis===`x`?`y`:`x`};case`region`:return{...e,axis:e.axis===`x`?`y`:`x`};case`point`:return{...e,x:e.y,y:typeof e.x==`number`?e.x:NaN};case`label`:return{...e,x:e.y,y:typeof e.x==`number`?e.x:NaN};case`shape`:return{...e,points:e.points.map(e=>({x:e.y,y:typeof e.x==`number`?e.x:NaN}))}}})),ge=P(()=>e=>K(E)?K(pe)(e):typeof e==`number`?K(me)(e):null),_e=P(()=>e=>K(E)?K(me)(e):K(pe)(e)),ve=P(()=>bi(K(he)(t.annotations),{xScale:K(ge),yScale:K(_e),plotLeft:c.left,plotTop:c.top,plotWidth:K(w).plotWidth,plotHeight:K(w).plotHeight})),ye=P(()=>K(ve).filter(e=>e.kind===`region`)),be=P(()=>K(ve).filter(e=>e.kind!==`region`)),xe=P(()=>Ci(t.dataLabels)),Se=P(()=>K(xe).enabled?K(T).map(e=>{let t=wi(e.datum.value,K(xe),v),n=K(xe).position??`outside`,r=n===`inside`||n===`center`;if(K(E)){let n=e.cx,i=r?e.y+e.height/2:e.cy-6;return{key:e.datum.label,x:n,y:i,text:t,anchor:`middle`,baseline:r?`middle`:`auto`}}let i=e.cy,a=r?e.x+e.width/2:e.cx+4;return{key:e.datum.label,x:a,y:i,text:t,anchor:r?`middle`:`start`,baseline:`middle`}}):[]),Ce=P(()=>[...t.data.map(e=>`${e.label}: ${e.value}`),...x(t.referenceLines,t.bands,K(ie)),...xi(t.annotations)]),we=P(()=>{let{ticks:e,plotWidth:t,plotHeight:n}=K(w);return i()===`vertical`?e.map(e=>({value:e,x1:c.left,x2:c.left+t,y:c.top+n*(1-K(oe)(e)),x:void 0,y1:void 0,y2:void 0})):e.map(e=>({value:e,x:c.left+t*K(oe)(e),y1:c.top,y2:c.top+n,x1:void 0,x2:void 0,y:void 0}))}),Te=P(()=>K(T).map(e=>e.datum.label));function Ee(e){t.onHoverKeyChange?.(e==null?null:K(Te)[e]??null)}function De(){I(S,null),Ee(null)}function Oe(e){let t=e.target;if(!(t instanceof Element)){I(S,null),Ee(null);return}let n=Number(t.getAttribute(`data-chart-index`)),r=Number.isInteger(n)?n:null;I(S,r,!0),Ee(r)}let ke=P(()=>Ei(t.hoverKey,K(S),K(Te))),Ae=F(-1),je=[],D=P(()=>(t.keyboardNav===!0||t.onSelectKey!==void 0)&&K(T).length>0);function Me(e){I(Ae,e,!0),je[e]?.focus(),Ee(e)}function O(e,n){let r=Di(e.key,n,K(T).length);r&&(e.preventDefault(),r.kind===`move`?Me(r.index):r.kind===`select`?t.onSelectKey?.(K(T)[n].datum.label):(I(Ae,-1),Ee(null),t.onSelectKey?.(null),e.currentTarget.blur()))}let k=()=>[`st-barChart`,t.class].filter(Boolean).join(` `);var Ne=ua(),Pe=L(Ne),Fe=L(Pe),Ie=L(Fe),Le=e=>{var t=yr();Z(R(t),17,()=>K(we),e=>e.value,(e,t)=>{var n=Ai(),r=R(n),i=z(r),a=L(i,!0);A(i),B(e=>{Q(r,`x1`,K(t).x1),Q(r,`x2`,K(t).x2),Q(r,`y1`,K(t).y),Q(r,`y2`,K(t).y),Q(i,`x`,c.left-6),Q(i,`y`,K(t).y),Y(a,e)},[()=>v(K(t).value)]),J(e,n)}),J(e,t)},Re=e=>{var t=yr();Z(R(t),17,()=>K(we),e=>e.value,(e,t)=>{var n=ji(),i=R(n),a=z(i),o=L(a,!0);A(a),B(e=>{Q(i,`x1`,K(t).x),Q(i,`x2`,K(t).x),Q(i,`y1`,K(t).y1),Q(i,`y2`,K(t).y2),Q(a,`x`,K(t).x),Q(a,`y`,r()-c.bottom+16),Y(o,e)},[()=>v(K(t).value)]),J(e,n)}),J(e,t)};X(Ie,e=>{i()===`vertical`?e(Le):e(Re,-1)});var ze=z(Ie),j=z(ze),Be=z(j);Z(Be,19,()=>K(T),e=>e.datum.label,(e,t)=>{var n=yr(),a=R(n),o=e=>{var n=Mi(),i=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).x+K(t).width/2),Q(n,`y`,r()-c.bottom+16),Y(i,K(t).datum.label)}),J(e,n)},s=e=>{var n=Ni(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,c.left-6),Q(n,`y`,K(t).y+K(t).height/2),Y(r,K(t).datum.label)}),J(e,n)};X(a,e=>{i()===`vertical`?e(o):e(s,-1)}),J(e,n)});var Ue=z(Be);Z(Ue,17,()=>K(le),e=>e.key,(e,t)=>{var n=Fi(),r=R(n),i=z(r),a=e=>{var n=Pi(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).x+4),Q(n,`y`,K(t).y+11),Y(r,K(t).label)}),J(e,n)};X(i,e=>{K(t).label&&e(a)}),B(e=>{Yr(r,0,e,`svelte-14iupu9`),Q(r,`x`,K(t).x),Q(r,`y`,K(t).y),Q(r,`width`,K(t).width),Q(r,`height`,K(t).height)},[()=>`st-barChart__band ${y(`st-barChart__band`,K(t).tone)}`]),J(e,n)});var We=z(Ue);Z(We,17,()=>K(ue),e=>e.key,(e,t)=>{var n=Li(),r=R(n),i=z(r),a=e=>{var n=Ii(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(E)?c.left+K(w).plotWidth-4:K(t).x1+4),Q(n,`y`,K(E)?K(t).y1-4:c.top+11),Q(n,`text-anchor`,K(E)?`end`:`start`),Y(r,K(t).label)}),J(e,n)};X(i,e=>{K(t).label&&e(a)}),B(e=>{Yr(r,0,e,`svelte-14iupu9`),Q(r,`x1`,K(t).x1),Q(r,`x2`,K(t).x2),Q(r,`y1`,K(t).y1),Q(r,`y2`,K(t).y2)},[()=>`st-barChart__refLine ${y(`st-barChart__refLine`,K(t).tone)}`]),J(e,n)});var Ge=z(We),Ke=e=>{var t=Bi();Z(t,21,()=>K(ye),e=>e.key,(e,t)=>{var n=yr(),r=R(n),i=e=>{var n=zi(),r=R(n),i=z(r),a=e=>{var n=Ri(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).x+4),Q(n,`y`,K(t).y+11),Y(r,K(t).label)}),J(e,n)};X(i,e=>{K(t).label&&e(a)}),B(()=>{Q(r,`x`,K(t).x),Q(r,`y`,K(t).y),Q(r,`width`,K(t).width),Q(r,`height`,K(t).height)}),J(e,n)};X(r,e=>{K(t).kind===`region`&&e(i)}),J(e,n)}),A(t),J(e,t)};X(Ge,e=>{K(ye).length>0&&e(Ke)});var qe=z(Ge);Z(qe,19,()=>K(T),e=>e.datum.label,(e,n,r)=>{let i=P(()=>K(ee).has(K(n).datum.label));var a=Vi();let o;B(()=>{o=Yr(a,0,`st-barChart__bar st-barChart__bar--${K(n).tone??``}`,`svelte-14iupu9`,o,{"st-barChart__bar--selected":K(i),"st-barChart__bar--dim":K(te)&&!K(i),"st-barChart__bar--interactive":K(ne)}),Q(a,`x`,K(n).x),Q(a,`y`,K(n).y),Q(a,`width`,K(n).width),Q(a,`height`,K(n).height),Q(a,`data-chart-index`,K(r))}),lr(`click`,a,function(...e){(K(ne)?()=>t.onSelect?.(K(n).datum.label):void 0)?.apply(this,e)}),J(e,a)});var Je=z(qe);Z(Je,17,()=>K(fe),e=>e.key,(e,t)=>{var n=Hi(),r=L(n),i=z(r),a=z(i);A(n),B(()=>{Q(r,`x1`,K(t).stem.x1),Q(r,`y1`,K(t).stem.y1),Q(r,`x2`,K(t).stem.x2),Q(r,`y2`,K(t).stem.y2),Q(i,`x1`,K(t).capLow.x1),Q(i,`y1`,K(t).capLow.y1),Q(i,`x2`,K(t).capLow.x2),Q(i,`y2`,K(t).capLow.y2),Q(a,`x1`,K(t).capHigh.x1),Q(a,`y1`,K(t).capHigh.y1),Q(a,`x2`,K(t).capHigh.x2),Q(a,`y2`,K(t).capHigh.y2)}),J(e,n)});var Ye=z(Je),Xe=e=>{var t=Gi(),n=R(t),r=e=>{var t=Ui();B(()=>{Q(t,`x1`,c.left),Q(t,`x2`,c.left+K(w).plotWidth),Q(t,`y1`,K(de).p),Q(t,`y2`,K(de).p)}),J(e,t)},i=e=>{var t=Wi();B(()=>{Q(t,`x1`,K(de).p),Q(t,`x2`,K(de).p),Q(t,`y1`,c.top),Q(t,`y2`,c.top+K(w).plotHeight)}),J(e,t)};X(n,e=>{K(E)?e(r):e(i,-1)});var a=z(n),o=L(a,!0);A(a),B(()=>{Q(a,`x`,K(E)?c.left+K(w).plotWidth-4:K(de).p+4),Q(a,`y`,K(E)?K(de).p-4:c.top+11),Q(a,`text-anchor`,K(E)?`end`:`start`),Y(o,K(de).label??`Objectif ${K(de).value}`)}),J(e,t)};X(Ye,e=>{K(de)&&e(Xe)});var M=z(Ye),Ze=e=>{var t=$i();Z(t,21,()=>K(be),e=>e.key,(e,t)=>{var n=yr(),r=R(n),i=e=>{var n=qi(),r=R(n),i=z(r),a=e=>{var n=Ki(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).axis===`x`?K(t).x1+4:c.left+K(w).plotWidth-4),Q(n,`y`,K(t).axis===`x`?c.top+11:K(t).y1-4),Q(n,`text-anchor`,K(t).axis===`x`?`start`:`end`),Y(r,K(t).label)}),J(e,n)};X(i,e=>{K(t).label&&e(a)}),B(()=>{Q(r,`x1`,K(t).x1),Q(r,`y1`,K(t).y1),Q(r,`x2`,K(t).x2),Q(r,`y2`,K(t).y2)}),J(e,n)},a=e=>{var n=Yi(),r=R(n),i=z(r),a=e=>{var n=Ji(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).labelX),Q(n,`y`,K(t).labelY),Y(r,K(t).label)}),J(e,n)};X(i,e=>{K(t).label&&e(a)}),B(e=>Q(r,`points`,e),[()=>Si(K(t).points)]),J(e,n)},o=e=>{var n=Zi(),r=R(n),i=z(r),a=e=>{var n=Xi(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).x),Q(n,`y`,K(t).y-8),Y(r,K(t).label)}),J(e,n)};X(i,e=>{K(t).label&&e(a)}),B(()=>{Q(r,`cx`,K(t).x),Q(r,`cy`,K(t).y)}),J(e,n)},s=e=>{var n=Qi(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).x),Q(n,`y`,K(t).y),Q(n,`text-anchor`,K(t).anchor),Y(r,K(t).text)}),J(e,n)};X(r,e=>{K(t).kind===`line`?e(i):K(t).kind===`shape`?e(a,1):K(t).kind===`point`?e(o,2):e(s,-1)}),J(e,n)}),A(t),J(e,t)};X(M,e=>{K(be).length>0&&e(Ze)});var Qe=z(M),$e=e=>{var t=ta();Z(t,21,()=>K(Se),e=>e.key,(e,t)=>{var n=ea(),r=L(n,!0);A(n),B(()=>{Q(n,`x`,K(t).x),Q(n,`y`,K(t).y),Q(n,`text-anchor`,K(t).anchor),Q(n,`dominant-baseline`,K(t).baseline),Y(r,K(t).text)}),J(e,n)}),A(t),J(e,t)};X(Qe,e=>{K(Se).length>0&&e($e)});var et=z(Qe),tt=e=>{let t=P(()=>K(T)[K(ke)]);var n=ia(),r=L(n),i=e=>{var n=na();B(()=>{Q(n,`x1`,K(t).cx),Q(n,`x2`,K(t).cx),Q(n,`y1`,c.top),Q(n,`y2`,c.top+K(w).plotHeight)}),J(e,n)},a=e=>{var n=ra();B(()=>{Q(n,`x1`,c.left),Q(n,`x2`,c.left+K(w).plotWidth),Q(n,`y1`,K(t).cy),Q(n,`y2`,K(t).cy)}),J(e,n)};X(r,e=>{K(E)?e(i):e(a,-1)}),A(n),J(e,n)};X(et,e=>{K(ke)>=0&&K(T)[K(ke)]&&e(tt)}),A(Fe);var nt=z(Fe,2),N=e=>{var i=oa();Z(i,23,()=>K(T),e=>e.datum.label,(e,t,n)=>{var r=aa();ai(r,(e,t)=>je[t]=e,e=>je?.[e],()=>[K(n)]),B((e,n)=>{Q(r,`x`,K(t).x),Q(r,`y`,K(t).y),Q(r,`width`,K(t).width),Q(r,`height`,K(t).height),Q(r,`tabindex`,e),Q(r,`aria-label`,n)},[()=>Oi(K(n),K(Ae),K(T).length),()=>ki(K(t).datum.label,K(t).datum.value)]),lr(`keydown`,r,e=>O(e,K(n))),cr(`focus`,r,()=>{I(Ae,K(n),!0),Ee(K(n))}),J(e,r)}),A(i),B(()=>{Q(i,`viewBox`,`0 0 ${n()??``} ${r()??``}`),Q(i,`aria-label`,`${t.label} — points de données`)}),J(e,i)};X(nt,e=>{K(D)&&e(N)}),A(Pe);var rt=z(Pe,2),it=e=>{var n=ca();Z(n,21,()=>K(T),e=>e.datum.label,(e,n)=>{let r=P(()=>K(ee).has(K(n).datum.label));var i=sa();let a;var o=z(L(i));A(i),B(()=>{a=Yr(i,1,`st-barChart__filterChip st-barChart__filterChip--${K(n).tone??``}`,`svelte-14iupu9`,a,{"st-barChart__filterChip--selected":K(r)}),Q(i,`aria-pressed`,K(r)),Y(o,` ${K(n).datum.label??``}: ${K(n).datum.value??``}`)}),lr(`click`,i,()=>t.onSelect?.(K(n).datum.label)),J(e,i)}),A(n),B(()=>Q(n,`aria-label`,`Filtrer par ${t.label}`)),J(e,n)};X(rt,e=>{K(ne)&&e(it)});var at=z(rt,2);vi(at,{get label(){return t.label},get items(){return K(Ce)}});var ot=z(at,2),st=e=>{let t=P(()=>K(T)[K(ke)]);var i=la(),a=L(i),o=L(a,!0);A(a);var s=z(a,2),c=L(s,!0);A(s),A(i),B(()=>{Zr(i,`left: ${K(t).cx/n()*100}%; top: ${K(t).cy/r()*100}%`),Y(o,K(t).datum.label),Y(c,K(t).datum.value)}),J(e,i)};X(ot,e=>{K(ke)>=0&&K(T)[K(ke)]&&e(st)}),A(Ne),B(e=>{Yr(Ne,1,e,`svelte-14iupu9`),Q(Pe,`aria-label`,t.label),Q(Fe,`viewBox`,`0 0 ${n()??``} ${r()??``}`),Q(ze,`x1`,c.left),Q(ze,`x2`,c.left),Q(ze,`y1`,c.top),Q(ze,`y2`,r()-c.bottom),Q(j,`x1`,c.left),Q(j,`x2`,n()-c.right),Q(j,`y1`,r()-c.bottom),Q(j,`y2`,r()-c.bottom)},[()=>Ur(k())]),lr(`pointermove`,Pe,Oe),cr(`pointerleave`,Pe,De),J(e,Ne),He()}ur([`pointermove`,`click`,`keydown`]);function pa(e,t){return{code:`engine-load-failed`,path:``,message:`the ${e} engine failed to load: ${t}`,severity:`error`,source:`host`,detail:{chunk:e,cause:t}}}var ma=1048576,ha=`document`;function ga(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function _a(e,t){return`${e}/${ga(t)}`}function va(e){let t;try{let n=JSON.stringify(e);if(typeof n!=`string`)return{ok:!1,kind:`not-json-value`,message:`the envelope is not a JSON value (§4.3)`};t=n}catch(e){return{ok:!1,kind:`not-serializable`,message:`the envelope is not JSON-serializable (§4.3): ${e instanceof Error?e.message:String(e)}`}}return{ok:!0,value:JSON.parse(t),text:t}}function ya(e){let t=0;for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);r<=127?t+=1:r<=2047?t+=2:r>=55296&&r<=56319?(t+=4,n+=1):t+=3}return t}function ba(e){let t=/^([0-9]+)\.([0-9]+)$/.exec(e);if(t!=null)return{major:Number(t[1]),minor:Number(t[2])}}function xa(e,t){return e.map(e=>{let n=`${t}${e.pointer}`;return e.keyword===`required`&&e.missingProperty!==void 0?n=_a(n,e.missingProperty):(e.keyword===`unevaluatedProperties`||e.keyword===`additionalProperties`)&&e.additionalProperty!==void 0&&(n=_a(n,e.additionalProperty)),{code:`schema-violation`,path:n,message:e.message,severity:`error`,source:`catalog`,detail:{keyword:e.keyword}}})}function Sa(e){let{catalog:t,structure:n,ports:r}=e;return{validate(e){let i=va(e);if(!i.ok)return[{code:`schema-violation`,path:``,message:i.message,severity:`error`,source:`catalog`}];let a=i.text,o=ya(a);if(o>1048576)return[{code:`payload-too-large`,path:``,message:`the envelope is ${o} UTF-8 bytes, over the ${ma}-byte budget (§4.3 item 3)`,severity:`error`,source:`catalog`,detail:{limitBytes:ma,actualBytes:o}}];let s=n.validateEnvelope(i.value);if(s.length>0)return xa(s,``);let c=i.value,l=c.catalogId;if(l!==void 0&&l!==t.catalogId)return[{code:`schema-violation`,path:`/catalogId`,message:`the envelope must name its catalogue (${String(t.catalogId)})`,severity:`error`,source:`catalog`,detail:{expected:t.catalogId,found:l}}];if(c.mode===`preview`)return[{code:`unsupported-mode`,path:`/mode`,message:`mode "preview" is reserved and not rendered by this catalogue (§10.3)`,severity:`error`,source:`catalog`,detail:{mode:`preview`}}];let u=c.root,d=u.component;if(typeof d!=`string`||!(d in t.components))return[{code:`unknown-component`,path:`/root/component`,message:`no catalogued component is named ${String(d)}`,severity:`error`,source:`catalog`,detail:{component:d}}];let f=t.components[d];if(f===void 0)return[{code:`unknown-component`,path:`/root/component`,message:`no catalogued component is named ${d}`,severity:`error`,source:`catalog`,detail:{component:d}}];let p=f[`x-sentropic`];if(p?.status===`unknown`)return[{code:`component-unavailable`,path:`/root/component`,message:`${d} is catalogued as a placeholder (x-sentropic.status "unknown") and cannot render`,severity:`error`,source:`catalog`,detail:{component:d}}];let m=c.contract,h=p?.contract;if(typeof h!=`string`)return[{code:`schema-violation`,path:`/root/component`,message:`the catalogued entry for ${d} declares no x-sentropic contract`,severity:`error`,source:`catalog`}];let g=ba(h),_=typeof m==`string`?ba(m):void 0;if(g===void 0||_===void 0)return[{code:`schema-violation`,path:`/contract`,message:`contract versions are "major.minor" strings (§4.4): envelope ${String(m)}, entry ${h}`,severity:`error`,source:`catalog`}];if(_.major!==g.major||_.minor>g.minor)return[{code:`unsupported-contract`,path:`/contract`,message:`the envelope targets contract ${String(m)} but ${d} is at ${h} (§4.4: an envelope may be older, never newer)`,severity:`error`,source:`catalog`,detail:{expected:h,found:m}}];let v=n.validateComponent(d,u);if(v.length>0)return xa(v,`/root`);let y=p?.engine;if(typeof y!=`string`||!y.startsWith(`lazy:`))return[];let b=y.slice(5),x=r?.[b],S=`/root/${ha}`;if(x===void 0)return[{code:`host-capability-missing`,path:S,message:`the host did not inject the ${b} semantic port (engine ${y}); the owning runtime validates this payload (§4.3 item 2)`,severity:`error`,source:`host`,detail:{chunk:b,engine:y}}];let ee;try{ee=x.validate(u[ha])}catch(e){return[{...pa(b,e instanceof Error?e.message:String(e)),path:S}]}return ee.map(e=>({code:e.severity===`warning`?e.code:`semantic-invalid`,path:`${S}${e.pointer??``}`,message:e.message,severity:e.severity,source:x.source,detail:{code:e.code}}))}}}var Ca={$defs:{CatalogComponentCommon:{properties:{weight:{description:`The relative weight of this component within a Row or Column. This is similar to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column.`,type:`number`}},type:`object`},DecisionDossierDocument:{$defs:{amendmentStep:{additionalProperties:!1,properties:{at:{type:`string`},author:{type:`string`},summary:{type:`string`}},required:[`at`,`author`,`summary`],type:`object`},amendmentTraceNode:{additionalProperties:!1,properties:{id:{type:`string`},kind:{const:`amendmentTrace`},steps:{items:{$ref:`#/$defs/DecisionDossierDocument/$defs/amendmentStep`},type:`array`},targetRef:{type:`string`}},required:[`id`,`kind`,`steps`,`targetRef`],type:`object`},comprehensionEvidence:{additionalProperties:!1,properties:{dossierHash:{type:`string`},signature:{type:`string`},subject:{type:`string`}},required:[`dossierHash`,`subject`],type:`object`},diagramNode:{additionalProperties:!1,properties:{alt:{type:`string`},id:{type:`string`},kind:{const:`diagram`},scene:{description:`diagram-core SemanticDocument, profile generic@1, without views, geometry or layout hints. Opaque JSON until the design-system publishes its authoritative schema; no Focus-specific scene model.`,type:`object`},source:{type:`string`},syntax:{enum:[`mermaid`,`plantuml`]},targetRef:{type:`string`}},required:[`alt`,`id`,`kind`,`source`,`syntax`,`targetRef`],type:`object`},glossaryEntry:{additionalProperties:!1,properties:{definition:{type:`string`},term:{type:`string`}},required:[`definition`,`term`],type:`object`},interaction:{additionalProperties:!1,properties:{enabled:{const:!1},label:{type:`string`},name:{type:`string`},targetRef:{type:`string`}},required:[`enabled`,`label`,`name`,`targetRef`],type:`object`},optionNode:{additionalProperties:!1,properties:{annotation:{enum:[`accept`,`comment`,`none`,`reject`]},annotationComment:{type:`string`},body:{type:`string`},consequence:{type:`string`},id:{type:`string`},kind:{const:`option`},label:{type:`string`},targetRef:{type:`string`}},required:[`annotation`,`id`,`kind`,`label`,`targetRef`],type:`object`},optionSetNode:{additionalProperties:!1,properties:{id:{type:`string`},kind:{const:`optionSet`},options:{items:{$ref:`#/$defs/DecisionDossierDocument/$defs/optionNode`},type:`array`},questionId:{type:`string`},targetRef:{type:`string`},title:{type:`string`}},required:[`id`,`kind`,`options`,`targetRef`],type:`object`},outcomeNode:{additionalProperties:!1,properties:{id:{type:`string`},kind:{const:`outcome`},modality:{enum:[`amendment`,`comment`,`decision`,`orientation`]},questionId:{type:`string`},statement:{type:`string`},targetRef:{type:`string`}},required:[`id`,`kind`,`modality`,`statement`,`targetRef`],type:`object`},proseNode:{additionalProperties:!1,properties:{id:{type:`string`},kind:{const:`prose`},markdown:{type:`string`},questionId:{type:`string`},targetRef:{type:`string`}},required:[`id`,`kind`,`markdown`,`targetRef`],type:`object`},provenance:{additionalProperties:!1,properties:{comprehensionEvidence:{$ref:`#/$defs/DecisionDossierDocument/$defs/comprehensionEvidence`},readAt:{type:`string`},source:{type:`string`}},required:[`readAt`,`source`],type:`object`},questionNode:{additionalProperties:!1,properties:{answer:{type:`string`},context:{type:`string`},id:{type:`string`},kind:{const:`question`},question:{type:`string`},readingTimeMinutes:{type:`number`},recommendedAnswer:{type:`string`},recommendedOptionId:{type:`string`},state:{enum:[`answered`,`open`,`validated`]},targetRef:{type:`string`}},required:[`id`,`kind`,`question`,`state`,`targetRef`],type:`object`},readability:{additionalProperties:!1,properties:{glossary:{items:{$ref:`#/$defs/DecisionDossierDocument/$defs/glossaryEntry`},type:`array`},noOwnerRequest:{type:`boolean`},ownerRequestQuote:{type:`string`},readingBudgetMinutes:{type:`number`},stakes:{type:`string`},stakesLevel:{enum:[`high`,`low`,`medium`]}},type:`object`},section:{oneOf:[{$ref:`#/$defs/DecisionDossierDocument/$defs/proseNode`},{$ref:`#/$defs/DecisionDossierDocument/$defs/questionNode`},{$ref:`#/$defs/DecisionDossierDocument/$defs/optionSetNode`},{$ref:`#/$defs/DecisionDossierDocument/$defs/outcomeNode`},{$ref:`#/$defs/DecisionDossierDocument/$defs/amendmentTraceNode`},{$ref:`#/$defs/DecisionDossierDocument/$defs/diagramNode`}]}},$schema:`https://json-schema.org/draft/2020-12/schema`,additionalProperties:!1,description:`Read-only decision-dossier snapshot published by @sentropic/focus. Closed: unknown fields refuse. Snapshot interactions are disabled metadata (enabled:false); live decisions, signatures and amendments require separately qualified runtime capabilities.`,properties:{amendmentTrace:{items:{$ref:`#/$defs/DecisionDossierDocument/$defs/amendmentStep`},type:`array`},cursor:{type:`string`},hash:{type:`string`},interactions:{items:{$ref:`#/$defs/DecisionDossierDocument/$defs/interaction`},type:`array`},provenance:{$ref:`#/$defs/DecisionDossierDocument/$defs/provenance`},readability:{$ref:`#/$defs/DecisionDossierDocument/$defs/readability`},ref:{type:`string`},sections:{items:{$ref:`#/$defs/DecisionDossierDocument/$defs/section`},type:`array`},subject:{type:`string`},title:{type:`string`}},required:[`amendmentTrace`,`cursor`,`hash`,`interactions`,`provenance`,`ref`,`sections`,`subject`,`title`],title:`DecisionDossierDocument`,type:`object`},anyComponent:{oneOf:[{$ref:`#/components/BarChart`},{$ref:`#/components/BpmnCanvas`},{$ref:`#/components/DecisionDossier`}]},theme:{properties:{themeId:{type:`string`}},type:`object`}},$id:`https://design-system.sent-tech.ca/catalogs/elements/v1/catalog.json`,$schema:`https://json-schema.org/draft/2020-12/schema`,catalogId:`https://design-system.sent-tech.ca/catalogs/elements/v1/catalog.json`,components:JSON.parse(`{"BarChart":{"allOf":[{"$ref":"https://a2ui.org/specification/v0_9_1/common_types.json#/$defs/ComponentCommon"},{"$ref":"#/$defs/CatalogComponentCommon"},{"properties":{"accessibility":{"additionalProperties":false,"properties":{"description":{"type":"string"},"label":{"type":"string"}},"type":"object"},"annotations":{"description":"Annotation overlay in data space (see ChartAnnotation).","items":{"anyOf":[{"additionalProperties":false,"properties":{"kind":{"const":"point","type":"string"},"label":{"type":"string"},"marker":{"description":"Marker glyph for a point annotation.","enum":["circle","diamond","square"],"type":"string"},"x":{"type":["number","string"]},"y":{"type":"number"}},"required":["kind","x","y"],"type":"object"},{"additionalProperties":false,"properties":{"anchor":{"enum":["end","middle","start"],"type":"string"},"kind":{"const":"label","type":"string"},"text":{"type":"string"},"x":{"type":["number","string"]},"y":{"type":"number"}},"required":["kind","text","x","y"],"type":"object"},{"additionalProperties":false,"properties":{"axis":{"enum":["x","y"],"type":"string"},"kind":{"const":"line","type":"string"},"label":{"type":"string"},"value":{"type":"number"}},"required":["axis","kind","value"],"type":"object"},{"additionalProperties":false,"properties":{"axis":{"enum":["x","y"],"type":"string"},"from":{"type":"number"},"kind":{"const":"region","type":"string"},"label":{"type":"string"},"to":{"type":"number"}},"required":["axis","from","kind","to"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"shape","type":"string"},"label":{"type":"string"},"points":{"items":{"additionalProperties":false,"properties":{"x":{"type":["number","string"]},"y":{"type":"number"}},"required":["x","y"],"type":"object"},"type":"array"}},"required":["kind","points"],"type":"object"}],"description":"Annotation overlay in data space, discriminated on \`kind\`. The \`x\` coordinate is categorical for this chart: it matches a bar by its \`label\` and is ignored otherwise; \`y\` and every value-axis number are numeric."},"type":"array"},"bands":{"description":"Shaded value-axis bands.","items":{"additionalProperties":false,"description":"A shaded band between two value-axis positions.","properties":{"from":{"description":"Band start in value-axis units.","type":"number"},"label":{"description":"Human-readable band label.","type":"string"},"to":{"description":"Band end in value-axis units.","type":"number"},"tone":{"description":"Feedback-token tone for the band.","enum":["error","info","neutral","success","warning"],"type":"string"}},"required":["from","to"],"type":"object"},"type":"array"},"component":{"const":"BarChart"},"data":{"description":"The bars, in draw order. Required.","items":{"additionalProperties":false,"description":"One bar: its label is also its selection key.","properties":{"errorHigh":{"description":"Upper error-bar extent (value-axis units). Drawn only when finite.","type":"number"},"errorLow":{"description":"Lower error-bar extent (value-axis units). Drawn only when finite.","type":"number"},"label":{"description":"The bar's category label; also its key for selection and hover.","type":"string"},"tone":{"description":"Explicit categorical tone; the palette default when absent.","enum":["category1","category2","category3","category4","category5","category6","category7","category8"],"type":"string"},"value":{"description":"The bar's value (value-axis units).","type":"number"}},"required":["label","value"],"type":"object"},"type":"array"},"dataLabels":{"anyOf":[{"type":"boolean"},{"additionalProperties":false,"properties":{"position":{"description":"Placement hint; the chart's default when absent.","enum":["auto","center","inside","outside","top"],"type":"string"}},"type":"object"}],"description":"Per-bar value labels; absent or false renders none."},"domain":{"description":"Fixed value-axis domain [min, max]; the auto data range when absent.","items":{"type":"number"},"maxItems":2,"minItems":2,"type":"array"},"goalLine":{"additionalProperties":false,"description":"A single goal line, emphasised above the bars.","properties":{"label":{"description":"Human-readable goal label.","type":"string"},"value":{"description":"Position of the goal line in value-axis units.","type":"number"}},"required":["value"],"type":"object"},"height":{"description":"Fixed pixel height; the component's default when absent.","type":"number"},"hoverKey":{"description":"Controlled synchronised hover key (a bar's label, or null for none).","type":["null","string"]},"invertAxis":{"description":"Inverts the value axis (high values toward the origin). Default false.","type":"boolean"},"keyboardNav":{"description":"Keyboard navigation of the data points (roving tabindex).","type":"boolean"},"label":{"description":"Human-readable chart label (also the accessible name). Required.","type":"string"},"orientation":{"description":"Bar direction; \\"vertical\\" by default.","enum":["horizontal","vertical"],"type":"string"},"referenceLines":{"description":"Reference lines on the value axis.","items":{"additionalProperties":false,"description":"A reference line on one axis (default axis: \\"y\\").","properties":{"axis":{"description":"Which axis the line spans; \\"y\\" by default.","enum":["x","y"],"type":"string"},"label":{"description":"Human-readable line label.","type":"string"},"tone":{"description":"Feedback-token tone for the line.","enum":["error","info","neutral","success","warning"],"type":"string"},"value":{"description":"Position of the line in value-axis units.","type":"number"}},"required":["value"],"type":"object"},"type":"array"},"scale":{"description":"Value-axis scale; \\"linear\\" by default, \\"log\\" needs positive values.","enum":["linear","log"],"type":"string"},"selectedKeys":{"description":"Keys of the currently selected bars (a bar's key is its label). Controlled.","items":{"type":"string"},"type":"array"},"showLegend":{"description":"Accepted for cross-chart parity; BarChart has no separate legend surface.","type":"boolean"},"width":{"description":"Fixed pixel width; the container's when absent.","type":"number"}},"required":["component","data","label"],"type":"object"}],"type":"object","unevaluatedProperties":false,"x-sentropic":{"contract":"1.0","element":"st-bar-chart","engine":"core","events":["select"],"example":{"component":"BarChart","data":[{"label":"Q1","value":12},{"label":"Q2","value":18},{"label":"Q3","value":9}],"dataLabels":true,"id":"root","label":"Revenue (M€)","referenceLines":[{"label":"Target","value":15}]},"fallback":"svg","parity":{"angular":{"comparedProps":17,"file":"packages/components-angular/src/BarChart.ts","status":"match","type":"BarChartProps"},"react":{"comparedProps":17,"file":"packages/components-react/src/BarChart.tsx","note":"Own members after subtracting React.HTMLAttributes<HTMLDivElement>; className is React's name for the class style hook.","status":"match","type":"BarChartProps"},"svelte":{"file":"packages/components-svelte/src/lib/BarChart.svelte","note":"Reference pilot (§3.1); not mechanically generatable (Svelte file), mirrored here member for member.","status":"source-of-truth","type":"BarChartProps"},"vue":{"comparedProps":17,"file":"packages/components-vue/src/BarChart.ts","status":"match","type":"BarChartProps"}},"schema":"https://design-system.sent-tech.ca/catalogs/elements/v1/components/BarChart.json"}},"BpmnCanvas":{"allOf":[{"$ref":"https://a2ui.org/specification/v0_9_1/common_types.json#/$defs/ComponentCommon"},{"$ref":"#/$defs/CatalogComponentCommon"},{"properties":{"accessibility":{"additionalProperties":false,"properties":{"description":{"type":"string"},"label":{"type":"string"}},"type":"object"},"component":{"const":"BpmnCanvas"},"document":{"additionalProperties":{},"description":"The F1 document to render: a structural envelope the engine's hydrate validates.","properties":{"$type":{"description":"F1 type discriminator, e.g. \\"bpmn:Definitions\\".","type":"string"}},"required":["$type"],"type":"object"}},"required":["component","document"],"type":"object"}],"type":"object","unevaluatedProperties":false,"x-sentropic":{"contract":"1.0","element":"st-bpmn-canvas","engine":"lazy:bpmn-canvas","events":[],"example":{"component":"BpmnCanvas","document":{"$type":"bpmn:Definitions","id":"definitions-1","targetNamespace":"https://example.com/bpmn"},"id":"root"},"fallback":"svg","parity":{"angular":{"file":"packages/components-angular","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"},"react":{"file":"packages/components-react","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"},"svelte":{"file":"packages/components-svelte","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"},"vue":{"file":"packages/components-vue","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"}},"schema":"https://design-system.sent-tech.ca/catalogs/elements/v1/components/BpmnCanvas.json","semantic":{"runtimePackage":"@sentropic/bpmn-canvas","source":"bpmn-canvas"}}},"DecisionDossier":{"allOf":[{"$ref":"https://a2ui.org/specification/v0_9_1/common_types.json#/$defs/ComponentCommon"},{"$ref":"#/$defs/CatalogComponentCommon"},{"properties":{"accessibility":{"additionalProperties":false,"properties":{"description":{"type":"string"},"label":{"type":"string"}},"type":"object"},"component":{"const":"DecisionDossier"},"document":{"$ref":"#/$defs/DecisionDossierDocument"}},"required":["component","document"],"type":"object"}],"type":"object","unevaluatedProperties":false,"x-sentropic":{"contract":"1.0","element":"st-decision-dossier","engine":"lazy:focus","events":["choose-option"],"example":{"component":"DecisionDossier","document":{"amendmentTrace":[],"cursor":"2026-10-30T10:00:00Z","hash":"b7d3f0c9","interactions":[],"provenance":{"readAt":"2026-10-30T10:00:00Z","source":"track"},"ref":"decision-1","sections":[{"id":"q1","kind":"question","question":"Which rendering contract do we adopt?","state":"open","targetRef":"decision-1"},{"id":"options-1","kind":"optionSet","options":[{"annotation":"none","id":"opt-json","kind":"option","label":"Adopt the JSON render standard","targetRef":"q1"},{"annotation":"none","id":"opt-status-quo","kind":"option","label":"Keep the status quo","targetRef":"q1"}],"targetRef":"q1","title":"Options"}],"subject":"Adopt the JSON render standard for design-system rendering","title":"Decision: adopt the JSON render standard"},"id":"root"},"fallback":"text","parity":{"angular":{"file":"packages/components-angular","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"},"react":{"file":"packages/components-react","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"},"svelte":{"file":"packages/components-svelte","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"},"vue":{"file":"packages/components-vue","note":"No counterpart in this framework package (§5.1: components with no framework counterpart record that fact).","status":"no-counterpart"}},"schema":"https://design-system.sent-tech.ca/catalogs/elements/v1/components/DecisionDossier.json","semantic":{"runtimePackage":"@sentropic/focus@0.5.0","schemaId":"urn:sentropic:focus:DecisionDossierDocument:1.0.0","schemaSubpath":"schemas/decision-dossier-document.v1.schema.json","sha256":"725bc07e7c6b6ad51a1f720cc9fb02649d8f31bc54e71c61c350fd20058c8852","source":"focus"}}}}`),description:`A2UI v0.9.1 basic catalogue of the Sentropic design system elements (JSON render standard, spec/SPEC_EVOL_DS_JSON_RENDER_STANDARD.md §5.2). Each component carries its x-sentropic contract version, element name, engine, events, fallback and standalone schema id; semantic documents are validated by their owning runtimes (§4.3).`,functions:{},title:`Sentropic design system elements catalogue`},wa={$id:`https://design-system.sent-tech.ca/catalogs/elements/v1/envelope.json`,$schema:`https://json-schema.org/draft/2020-12/schema`,description:"The render envelope of the JSON render standard (§4.2): one A2UI v0.9.1 component object under `root`, with the targeted component's contract version and an optional mode. The root interior is validated by the targeted component's catalogue entry, not by this schema.",properties:{catalogId:{type:`string`},contract:{pattern:`^[0-9]+\\.[0-9]+$`,type:`string`},mode:{enum:[`preview`,`snapshot`],type:`string`},root:{properties:{component:{type:`string`},id:{const:`root`}},required:[`component`,`id`],type:`object`}},required:[`contract`,`root`],title:`Sentropic render envelope`,type:`object`,unevaluatedProperties:!1},Ta={$defs:{AccessibilityAttributes:{description:`Attributes to enhance accessibility when using assistive technologies like screen readers.`,properties:{description:{$ref:`#/$defs/DynamicString`,description:`Additional information provided by assistive technologies about an element such as instructions, format requirements, or result of an action. For example, a mute button might have a label of 'Mute' and a description of 'Silences notifications about this conversation'.`},label:{$ref:`#/$defs/DynamicString`,description:`A short string, typically 1 to 3 words, used by assistive technologies to convey the purpose or intent of an element. For example, an input field might have an accessible label of 'User ID' or a button might be labeled 'Submit'.`}},type:`object`},Action:{description:`Defines an interaction handler that can either trigger a server-side event or execute a local client-side function.`,oneOf:[{additionalProperties:!1,description:`Triggers a server-side event.`,properties:{event:{additionalProperties:!1,description:`The event to dispatch to the server.`,properties:{context:{additionalProperties:{$ref:`#/$defs/DynamicValue`},description:`A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.`,type:`object`},name:{description:`The name of the action to be dispatched to the server.`,type:`string`}},required:[`name`],type:`object`}},required:[`event`],type:`object`},{additionalProperties:!1,description:`Executes a local client-side function.`,properties:{functionCall:{$ref:`#/$defs/FunctionCall`}},required:[`functionCall`],type:`object`}]},CheckRule:{additionalProperties:!1,description:`A single validation rule applied to an input component.`,properties:{condition:{$ref:`#/$defs/DynamicBoolean`},message:{description:`The error message to display if the check fails.`,type:`string`}},required:[`condition`,`message`],type:`object`},Checkable:{description:`Properties for components that support client-side checks.`,properties:{checks:{description:`A list of checks to perform. These are function calls that must return a boolean indicating validity.`,items:{$ref:`#/$defs/CheckRule`},type:`array`}},type:`object`},ChildList:{oneOf:[{description:`A static list of child component IDs.`,items:{$ref:`#/$defs/ComponentId`},type:`array`},{additionalProperties:!1,description:"A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.",properties:{componentId:{$ref:`#/$defs/ComponentId`},path:{description:`The path to the list of component property objects in the data model.`,type:`string`}},required:[`componentId`,`path`],type:`object`}]},ComponentCommon:{properties:{accessibility:{$ref:`#/$defs/AccessibilityAttributes`},id:{$ref:`#/$defs/ComponentId`}},required:[`id`],type:`object`},ComponentId:{description:`The unique identifier for a component, used for both definitions and references within the same surface.`,type:`string`},DataBinding:{additionalProperties:!1,properties:{path:{description:`A JSON Pointer path to a value in the data model.`,type:`string`}},required:[`path`],type:`object`},DynamicBoolean:{description:`A boolean value that can be a literal, a path, or a function call returning a boolean.`,oneOf:[{type:`boolean`},{$ref:`#/$defs/DataBinding`},{allOf:[{$ref:`#/$defs/FunctionCall`},{properties:{returnType:{const:`boolean`}}}]}]},DynamicNumber:{description:`Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number.`,oneOf:[{type:`number`},{$ref:`#/$defs/DataBinding`},{allOf:[{$ref:`#/$defs/FunctionCall`},{properties:{returnType:{const:`number`}}}]}]},DynamicString:{description:`Represents a string`,oneOf:[{type:`string`},{$ref:`#/$defs/DataBinding`},{allOf:[{$ref:`#/$defs/FunctionCall`},{properties:{returnType:{const:`string`}}}]}]},DynamicStringList:{description:`Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array.`,oneOf:[{items:{type:`string`},type:`array`},{$ref:`#/$defs/DataBinding`},{allOf:[{$ref:`#/$defs/FunctionCall`},{properties:{returnType:{const:`array`}}}]}]},DynamicValue:{description:`A value that can be a literal, a path, or a function call returning any type.`,oneOf:[{type:`string`},{type:`number`},{type:`boolean`},{type:`array`},{$ref:`#/$defs/DataBinding`},{$ref:`#/$defs/FunctionCall`}]},FunctionCall:{description:`Invokes a named function on the client.`,oneOf:[{$ref:`catalog.json#/$defs/anyFunction`}],properties:{args:{additionalProperties:{anyOf:[{$ref:`#/$defs/DynamicValue`},{description:`A literal object argument (e.g. configuration).`,type:`object`}]},description:`Arguments passed to the function.`,type:`object`},call:{description:`The name of the function to call.`,type:`string`},returnType:{default:`boolean`,description:`The expected return type of the function call.`,enum:[`any`,`array`,`boolean`,`number`,`object`,`string`,`void`],type:`string`}},required:[`call`],type:`object`}},$id:`https://a2ui.org/specification/v0_9_1/common_types.json`,$schema:`https://json-schema.org/draft/2020-12/schema`,description:`Common type definitions used across A2UI schemas.`,title:`A2UI Common Types`},Ea={$defs:{anyFunction:{not:{}}},$id:`https://a2ui.org/specification/v0_9_1/catalog.json`,$schema:`https://json-schema.org/draft/2020-12/schema`},Da=new Set([`$ref`,`type`,`enum`,`const`,`pattern`,`properties`,`required`,`additionalProperties`,`unevaluatedProperties`,`items`,`minItems`,`maxItems`,`allOf`,`anyOf`,`oneOf`,`not`]),Oa=new Set([`$schema`,`$id`,`$defs`,`$anchor`,`$dynamicAnchor`,`$comment`,`$vocabulary`,`title`,`description`,`default`,`examples`,`example`,`note`,`deprecated`,`readOnly`,`writeOnly`,`catalogId`,`components`,`functions`,`x-sentropic`]),ka=new Set([`multipleOf`,`maximum`,`exclusiveMaximum`,`minimum`,`exclusiveMinimum`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`uniqueItems`,`contains`,`maxContains`,`minContains`,`patternProperties`,`dependentRequired`,`dependentSchemas`,`propertyNames`,`prefixItems`,`unevaluatedItems`,`if`,`then`,`else`,`definitions`,`$dynamicRef`,`$recursiveRef`]);function $(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Aa(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ja(e,t){if(e===t)return!0;if(!$(e)&&!Array.isArray(e))return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>ja(e,t[n]));if(!$(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Object.hasOwn(t,n)&&ja(e[n],t[n]))}function Ma(e,t){switch(e){case`object`:return $(t);case`array`:return Array.isArray(t);case`string`:return typeof t==`string`;case`number`:return typeof t==`number`;case`integer`:return typeof t==`number`&&Number.isInteger(t);case`boolean`:return typeof t==`boolean`;case`null`:return t===null;default:return!0}}var Na=class{#e=new Map;register(e,t){if(!$(e)||typeof e.$id!=`string`||e.$id.length===0)throw Error(`the ${t} must carry its $id so every $ref resolves without network access`);return this.#e.set(e.$id,e),e.$id}resolve(e,t){let n=e.indexOf(`#`),r=n===-1?e:e.slice(0,n),i=n===-1?``:e.slice(n+1),a=t;r.length>0&&(a=/^[a-z][a-z0-9+.-]*:/i.test(r)?r:Pa(t,r));let o=this.#e.get(a);if(o===void 0)throw Error(`the $ref "${e}" does not name a registered document (from ${t})`);return{schema:i.length===0?o:Fa(o,i,e),baseId:a}}};function Pa(e,t){let n=e.lastIndexOf(`/`);return n===-1?t:`${e.slice(0,n+1)}${t}`}function Fa(e,t,n){if(!t.startsWith(`/`))throw Error(`the $ref "${n}" must use a JSON pointer (URI fragments are not used by the registered documents)`);let r=e;for(let e of t.slice(1).split(`/`)){let t=e.replace(/~1/g,`/`).replace(/~0/g,`~`);if(Array.isArray(r)){let e=Number(t);if(!Number.isInteger(e)||e<0||e>=r.length)throw Error(`the $ref "${n}" does not resolve: no array item ${t}`);r=r[e]}else{if(!$(r)||!Object.hasOwn(r,t))throw Error(`the $ref "${n}" does not resolve: no property "${t}"`);r=r[t]}}return r}function Ia(e,t){if(typeof e==`boolean`)return;if(!$(e))throw Error(`the ${t} contains a schema that is neither a boolean nor an object`);for(let n of Object.keys(e))if(!(n.startsWith(`x-`)||Oa.has(n)||Da.has(n)))throw ka.has(n)?Error(`the ${t} uses "${n}", outside the browser structure interpreter's keyword set (§6.4): extend src/structure/interpreter.ts and its oracle test`):Error(`the ${t} uses unknown keyword "${n}": extend src/structure/interpreter.ts and its oracle test, or allowlist it as an annotation`);let n=e.items;if(Array.isArray(n))throw Error(`the ${t} uses "items" in its legacy tuple form, which the browser structure interpreter does not implement`);if(n!==void 0&&!$(n)&&typeof n!=`boolean`)throw Error(`the ${t} uses "items" in a non-schema form, which the browser structure interpreter does not implement`);for(let n of[`additionalProperties`,`unevaluatedProperties`,`not`]){let r=e[n];if(r!==void 0&&!$(r)&&typeof r!=`boolean`)throw Error(`the ${t} uses "${n}" in a non-schema form, which the browser structure interpreter does not implement`)}for(let n of[`allOf`,`anyOf`,`oneOf`]){let r=e[n];if(r!==void 0&&!Array.isArray(r))throw Error(`the ${t} uses "${n}" in a non-array form, which the browser structure interpreter does not implement`)}let r=[];for(let t of[`$defs`,`properties`,`components`]){let n=e[t];if($(n))for(let e of Object.values(n))r.push([`${t} entry`,e])}n!==void 0&&r.push([`items`,n]);for(let t of[`additionalProperties`,`unevaluatedProperties`,`not`]){let n=e[t];($(n)||typeof n==`boolean`)&&r.push([t,n])}for(let t of[`allOf`,`anyOf`,`oneOf`]){let n=e[t];if(Array.isArray(n))for(let e of n)r.push([t,e])}for(let[e,n]of r)Ia(n,`${t} (${e})`)}var La=new Set;function Ra(e,t,n,r,i,a){if(e===!0)return{ok:!0,evaluated:La};if(e===!1||e==null)return a.push({pointer:n,message:`the schema is false here`,keyword:`schema`}),{ok:!1,evaluated:La};if(!$(e))return a.push({pointer:n,message:`the schema node is neither a boolean nor an object`,keyword:`schema`}),{ok:!1,evaluated:La};let o=!0,s=new Set,c=e=>{o=!1,a.push(e)},l=e.$ref,u=r;if(typeof l==`string`){let e=i.resolve(l,r),c=Ra(e.schema,t,n,e.baseId,i,a);for(let e of c.evaluated)s.add(e);c.ok||(o=!1)}let d=e.type;if(d!==void 0){let e=Array.isArray(d)?d:[d],r=e.filter(e=>typeof e==`string`);e.length>0&&r.length===e.length&&!r.some(e=>Ma(e,t))&&c({pointer:n,message:`must be ${r.join(`,`)}`,keyword:`type`})}let f=e.enum;Array.isArray(f)&&!f.some(e=>ja(e,t))&&c({pointer:n,message:`must be equal to one of the allowed values`,keyword:`enum`}),Object.hasOwn(e,`const`)&&!ja(e.const,t)&&c({pointer:n,message:`must be equal to constant`,keyword:`const`});let p=e.pattern;if(typeof p==`string`&&typeof t==`string`&&!new RegExp(p,`u`).test(t)&&c({pointer:n,message:`must match pattern "${p}"`,keyword:`pattern`}),$(t)){let r=Object.keys(t),l=e.required;if(Array.isArray(l))for(let e of l)typeof e==`string`&&!Object.hasOwn(t,e)&&c({pointer:n,message:`must have required property '${e}'`,keyword:`required`,missingProperty:e});let d=$(e.properties)?e.properties:{};for(let[e,r]of Object.entries(d))Object.hasOwn(t,e)&&(s.add(e),Ra(r,t[e],`${n}/${Aa(e)}`,u,i,a).ok||(o=!1));let f=e.additionalProperties,p=new Set(Object.keys(d));if(f===!1)for(let e of r)p.has(e)||(s.add(e),c({pointer:n,message:`must NOT have additional properties`,keyword:`additionalProperties`,additionalProperty:e}));else if($(f)||f===!0){let e=$(f);for(let c of r)p.has(c)||(s.add(c),!e)||Ra(f,t[c],`${n}/${Aa(c)}`,u,i,a).ok||(o=!1)}}if(Array.isArray(t)){let r=e.minItems;typeof r==`number`&&t.length<r&&c({pointer:n,message:`must NOT have fewer than ${r} items`,keyword:`minItems`});let s=e.maxItems;typeof s==`number`&&t.length>s&&c({pointer:n,message:`must NOT have more than ${s} items`,keyword:`maxItems`});let l=e.items;l!==void 0&&!Array.isArray(l)&&t.forEach((e,t)=>{Ra(l,e,`${n}/${t}`,u,i,a).ok||(o=!1)})}let m=e.allOf;if(Array.isArray(m))for(let e of m){let r=Ra(e,t,n,u,i,a);for(let e of r.evaluated)s.add(e);r.ok||(o=!1)}let h=e.anyOf;if(Array.isArray(h)){let e=!1,r=[];for(let a of h){let o=[],c=Ra(a,t,n,u,i,o);if(r.push(o),c.ok){e=!0;for(let e of c.evaluated)s.add(e)}}if(!e){o=!1;for(let e of r)a.push(...e);a.push({pointer:n,message:`must match a schema in anyOf`,keyword:`anyOf`})}}let g=e.oneOf;if(Array.isArray(g)){let e=[],r=[],c=0,l=-1;if(g.forEach((a,o)=>{let s=[],d=Ra(a,t,n,u,i,s);e.push(s),r.push(d.evaluated),d.ok&&(c+=1,l=o)}),c===1&&l>=0)for(let e of r[l]??[])s.add(e);else{o=!1;for(let t of e)a.push(...t);a.push({pointer:n,message:`must match exactly one schema in oneOf`,keyword:`oneOf`})}}let _=e.not;if(_!==void 0&&Ra(_,t,n,u,i,[]).ok&&(a.push({pointer:n,message:`must NOT be valid`,keyword:`not`}),o=!1),$(t)){let r=e.unevaluatedProperties;if(r!==void 0){let e=Object.keys(t).filter(e=>!s.has(e));if(r===!1)for(let t of e)c({pointer:n,message:`must NOT have unevaluated properties`,keyword:`unevaluatedProperties`,additionalProperty:t});else if(($(r)||r===!0)&&$(r))for(let c of e)Ra(r,t[c],`${n}/${Aa(c)}`,u,i,a).ok?s.add(c):o=!1}}return{ok:o,evaluated:s}}function za(e){let t=new Na,n=t.register(e.catalog,`catalogue document`);if(typeof e.catalog.catalogId!=`string`||e.catalog.catalogId.length===0)throw Error(`the catalogue document must carry its catalogId (§5.2: $id = catalogId)`);let r=t.register(e.envelopeSchema,`envelope schema`);return t.register(e.commonTypes,`A2UI common types`),t.register(Ea,`built catalog.json stub`),Ia(e.catalog,`catalogue document`),Ia(e.envelopeSchema,`envelope schema`),Ia(e.commonTypes,`A2UI common types`),Ia(Ea,`built catalog.json stub`),{validateEnvelope(n){let i=[];return Ra(e.envelopeSchema,n,``,r,t,i),i},validateComponent(r,i){let a=e.catalog.components[r];if(a===void 0)return[{pointer:`/component`,message:`no catalogued component is named ${r}`,keyword:`$compile`}];let o=[];return Ra(a,i,``,n,t,o),o}}}var Ba=new Map;function Va(){return new Proxy({},{get(e,t){return Ba.get(t)}})}var Ha;function Ua(){return Ha===void 0&&(Ha=Sa({catalog:Ca,envelopeSchema:wa,commonTypes:Ta,ports:Va(),structure:za({catalog:Ca,envelopeSchema:wa,commonTypes:Ta})})),Ha}function Wa(e,t){Ba.set(e,t)}var Ga=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),Ka=function(e){return`/`+e},qa={},Ja=function(e){return e.pathname.endsWith(`.css`)},Ya=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Xa=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Ka(t,n);let r=s(t),i=Ja(r);return Ya(qa,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Ga,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Za={BpmnCanvas:`bpmn-canvas`,DecisionDossier:`focus`},Qa=new Map;async function $a(e){let t=Qa.get(e);if(t!==void 0)return t;let n=(e===`BpmnCanvas`?Xa(()=>import(`./chunks/bpmn-canvas-DeAWdJFy.js`).then(e=>e.t),[]):e===`DecisionDossier`?Xa(()=>import(`./chunks/focus-renderer-0elVToA2.js`),[]):Promise.reject(Error(`core components load no engine chunk`))).catch(t=>{throw Qa.delete(e),t});return Qa.set(e,n),n}function eo(e){return e.root??{}}function to(e,t){return{code:`unknown-component`,path:`/root/component`,message:`<${`st-${e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}`}> requires root.component "${e}", got "${t}"`,severity:`error`,source:`catalog`,detail:{expected:e,found:t}}}function no(e,t){if(e===`BarChart`)return!1;let n=Za[e];return t.length>0&&t.every(e=>e.code===`host-capability-missing`&&e.detail?.chunk===n)}function ro(e){let t=e?.bpmn?.watermark;if(t===void 0)return;let{hidden:n,license:r}=t;if(n===!0&&typeof r==`string`&&r.trim()!==``)return{hidden:!0,license:r}}function io(e){let t=F(`idle`),n=F(Kt([])),r=F(null),i=new Set,a=!1,o=0;function s(e){if(I(t,e,!0),!a&&(e===`rendered`||e===`refused`)){a=!0;for(let e of i)e()}}function c(e){return a?e():i.add(e),()=>i.delete(e)}function l(...e){I(n,[...e],!0)}function u(e){K(n).some(t=>t.code===e.code&&t.path===e.path&&t.message===e.message)||I(n,[...K(n),e],!0)}async function d(i,a){let c=++o;I(t,`rendering`);try{let t=va(i),l=Ua().validate(t.ok?t.value:i);if(c!==o)return;let u=(t.ok?t.value:i)?.root?.component;if(typeof u==`string`&&u!==e){I(n,[to(e,u)],!0),I(r,null),s(`refused`);return}let d=l.filter(e=>e.severity===`error`);if(d.length>0&&!no(e,d)){I(n,[...l],!0),I(r,null),s(`refused`);return}if(e!==`BarChart`&&d.length>0){let a=await $a(e);if(Wa(Za[e],a.port),c!==o)return;let l=Ua().validate(t.ok?t.value:i);if(c!==o)return;if(l.filter(e=>e.severity===`error`).length>0){I(n,[...l],!0),I(r,null),s(`refused`);return}I(n,[...l],!0)}else I(n,[...l],!0);if(!t.ok){I(r,null),s(`refused`);return}let f=eo(t.value);if(e===`BarChart`){let{component:e,id:t,...n}=f;I(r,{kind:`bar-chart`,props:n},!0)}else if(e===`BpmnCanvas`){let{toXml:t}=await $a(e),i=await t(f.document);if(c!==o)return;if(!i.ok){I(n,[{code:`semantic-invalid`,path:`/root/document`,message:i.message,severity:`error`,source:`bpmn-canvas`,detail:{code:i.code}}],!0),I(r,null),s(`refused`);return}I(r,{kind:`bpmn`,xml:i.xml,assetBase:typeof a?.assetBase==`string`?a.assetBase:void 0,watermark:ro(a)},!0)}else I(r,{kind:`dossier`,document:f.document},!0);s(`rendered`)}catch(t){if(c!==o)return;let n=t instanceof Error?t.message:String(t),r=Za[e];l(r===void 0?{code:`semantic-invalid`,path:``,message:`the element failed to render the envelope: ${n}`,severity:`error`,source:`host`,detail:{cause:n}}:pa(r,n)),s(`refused`)}}return{get state(){return K(t)},get diagnostics(){return K(n)},get payload(){return K(r)},ingest:d,onSettle:c,noteEngineDiagnostic:u}}var ao=new WeakMap,oo=new WeakMap;function so(e){let t=oo.get(e);if(t===void 0){let n;t={promise:new Promise(e=>{n=e}),resolve:n},oo.set(e,t),ao.get(e)?.onSettle(n)}return t}function co(e,t){ao.set(e,t);let n=oo.get(e);n!==void 0&&t.onSettle(n.resolve)}function lo(e){let t=customElements.get(e);if(t===void 0)throw Error(`the ${e} element is not registered; import its module first`);let n=t.prototype;Object.defineProperty(n,"state",{get(){return ao.get(this)?.state??`idle`}}),Object.defineProperty(n,"diagnostics",{get(){return ao.get(this)?.diagnostics??[]}}),Object.defineProperty(n,"ready",{get(){return so(this).promise}})}var uo=`/* Generated by packages/themes/scripts/build-css.mjs. */
49
49
  /* Theme: Sent Tech (sent-tech) */
50
50
  /* Dark mode: 3 blocks (light + auto + explicit) */
51
51
  [data-st-theme="sent-tech"] {
@@ -2218,4 +2218,4 @@ typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var e={},t=Symb
2218
2218
  --st-component-graph-community4: oklch(73% 0.09 195);
2219
2219
  }
2220
2220
  `;function fo(e){return`[data-st-theme="${e}"]`}function po(e,t){return e.replace(RegExp(`(^|[\\s,>+~])\\:root(?=\\[data-color-mode=)`,`g`),`$1${fo(t)}`).replace(RegExp(`(^|[\\s,>+~])\\:root(?=\\:not\\()`,`g`),`$1${fo(t)}`).replace(RegExp(`(^|[\\s,>+~])\\:root(?=[\\s,{])`,`g`),`$1${fo(t)}`)}var mo=[`sent-tech`,`forge`,`entropic`],ho={"sent-tech":async()=>uo,forge:async()=>(await Xa(async()=>{let{default:e}=await import(`./chunks/forge-B8hrW4lA.js`);return{default:e}},[])).default,entropic:async()=>(await Xa(async()=>{let{default:e}=await import(`./chunks/entropic-CM5BHERN.js`);return{default:e}},[])).default},go=new Map;function _o(e){return typeof e==`string`&&mo.includes(e)?e:`sent-tech`}async function vo(e){let t=go.get(e);if(t!==void 0)return t;let n=await ho[e](),r=new CSSStyleSheet;return r.replaceSync(po(n,e)),go.set(e,r),r}async function yo(e,t){let n=await vo(t);e.adoptedStyleSheets=[...e.adoptedStyleSheets.filter(e=>e!==n),n]}function bo(e,t){let n=go.get(t);e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n)}function xo(e){return e===`light`||e===`dark`?e:void 0}function So(e){let t=()=>{for(let t of[...e.querySelectorAll(`style`)]){let n=t.textContent??``;try{let r=new CSSStyleSheet;r.replaceSync(n),e.adoptedStyleSheets=[...e.adoptedStyleSheets.filter(e=>e!==r),r],t.remove()}catch{}}};t();let n=new MutationObserver(t);return n.observe(e,{childList:!0}),()=>n.disconnect()}function Co(e,t){let n=e.getRootNode(),r=n instanceof ShadowRoot?n:void 0,i=r?.host;i instanceof HTMLElement&&co(i,t.runtime);let a=_o(t.theme),o;return r!==void 0&&(yo(r,a),o=So(r)),{update(e){let t=_o(e.theme);t!==a&&(r!==void 0&&(bo(r,a),yo(r,t)),a=t)},destroy(){o?.()}}}function wo(e){return _o(e)}function To(e){return xo(e)}function Eo(e){if(e===null||e.textContent===null)return;let t=e.textContent;try{return{value:JSON.parse(t),parsed:!0}}catch{return{value:t,parsed:!1}}}function Do(e){for(let t of e.children)if(t instanceof HTMLScriptElement&&t.type===`application/json`)return Eo(t)}function Oo(e){let t=e.getElementById(`st-host-config`);if(t===null)return;let n=Eo(t);return n!==void 0&&n.parsed?n.value:void 0}function ko(e,t){let n=new MutationObserver(()=>{t(Do(e))});return n.observe(e,{childList:!0,subtree:!1}),()=>n.disconnect()}function Ao(e,t){let n=e.getRootNode(),r=n instanceof ShadowRoot&&n.host instanceof HTMLElement?n.host:void 0,i;if(r!==void 0){let e=Do(r);e!==void 0&&t.apply(e.value),i=ko(r,e=>{t.apply(e===void 0?void 0:e.value)})}return{destroy(){i?.()}}}function jo(e,t,n,r={}){let i={event:`intent`,name:t,target:n,context:r};e.dispatchEvent(new CustomEvent(`st-intent`,{detail:i,bubbles:!0,composed:!0}))}var Mo=_r(`<li class="st-element__errorItem svelte-ia8wso" data-st-error-item=""><code class="st-element__errorCode svelte-ia8wso" data-st-error-code=""> </code> <span class="st-element__errorPath svelte-ia8wso" data-st-error-path=""> </span> <span class="st-element__errorMessage" data-st-error-message=""> </span></li>`),No=_r(`<div class="st-element__error svelte-ia8wso" role="alert" data-st-error=""><p class="st-element__errorTitle svelte-ia8wso" data-st-error-title=""> </p> <ul class="st-element__errorList svelte-ia8wso"></ul></div>`),Po={hash:`svelte-ia8wso`,code:`.st-element__error.svelte-ia8wso {border:1px solid var(--st-color-feedback-error-border, #dc2626);border-radius:8px;padding:12px;font-family:inherit;color:var(--st-color-feedback-error-text, #7f1d1d);background:var(--st-color-feedback-error-background, #fef2f2);}.st-element__errorTitle.svelte-ia8wso {margin:0 0 8px;font-weight:600;}.st-element__errorList.svelte-ia8wso {margin:0;padding:0;list-style:none;}.st-element__errorItem.svelte-ia8wso {display:grid;grid-template-columns:auto auto 1fr;gap:8px;margin:4px 0;font-size:0.875rem;}.st-element__errorCode.svelte-ia8wso {font-family:ui-monospace, monospace;}.st-element__errorPath.svelte-ia8wso {font-family:ui-monospace, monospace;opacity:0.8;}`};function Fo(e,t){Ve(t,!0),zr(e,Po);var n=No(),r=L(n),i=L(r);A(r);var a=z(r,2);Z(a,21,()=>t.diagnostics,e=>e.code+`|`+e.path+`|`+e.message,(e,t)=>{var n=Mo(),r=L(n),i=L(r,!0);A(r);var a=z(r,2),o=L(a,!0);A(a);var s=z(a,2),c=L(s,!0);A(s),A(n),B(()=>{Y(i,K(t).code),Y(o,K(t).path||`(envelope)`),Y(c,K(t).message)}),J(e,n)}),A(a),A(n),B(()=>Y(i,`The envelope does not render — ${t.diagnostics.length??``}
2221
- ${t.diagnostics.length===1?`diagnostic`:`diagnostics`}:`)),J(e,n),He()}var Io=_r(`<div class="st-element__root svelte-17allio"><!></div>`),Lo={hash:`svelte-17allio`,code:`.st-element__root.svelte-17allio {display:block;}`};function Ro(e,t){Ve(t,!0),zr(e,Lo);let n=ci(t,`envelope`,7),r=ci(t,`hostConfig`,7),i=io(`BarChart`),a=F(void 0),o=F(void 0),s=F(void 0),c=F(!1);kr(()=>{I(s,Oo(globalThis.document),!0),I(c,!0)});let l=P(()=>n()??K(o)),u=P(()=>r()??K(s));fn(()=>{(K(l)!==void 0||K(c))&&i.ingest(K(l),K(u))});var d={get envelope(){return n()},set envelope(e){n(e),pt()},get hostConfig(){return r()},set hostConfig(e){r(e),pt()}},f=Io(),p=L(f),m=e=>{Fo(e,{get diagnostics(){return i.diagnostics}})},h=e=>{fa(e,si(()=>i.payload.props,{onSelect:e=>{K(a)!==void 0&&jo(K(a),`select`,e)},onSelectKey:e=>{e!==null&&K(a)!==void 0&&jo(K(a),`select`,e)}}))};return X(p,e=>{i.state===`refused`?e(m):i.payload?.kind===`bar-chart`&&e(h,1)}),A(f),ai(f,e=>I(a,e),()=>K(a)),Br(f,(e,t)=>Co?.(e,t),()=>({runtime:i,theme:K(u)?.theme,colorScheme:K(u)?.colorScheme})),Br(f,(e,t)=>Ao?.(e,t),()=>({apply:e=>I(o,e,!0)})),B((e,t)=>{Q(f,`data-st-theme`,e),Q(f,`data-color-mode`,t)},[()=>wo(K(u)?.theme),()=>To(K(u)?.colorScheme)]),J(e,f),He(d)}customElements.define(`st-bar-chart`,mi(Ro,{envelope:{},hostConfig:{}},[],[],{mode:`open`}));function zo(e,t){let n=t,r=0,i;async function a(){let t=++r,a=n.runtime.payload;if(a===null||a.kind!==`bpmn`)return;let o=await Xa(()=>import(`./chunks/bpmn-canvas-DeAWdJFy.js`).then(e=>e.t),[]);t===r&&(i?.(),i=await o.renderBpmn(e,a,n.runtime.noteEngineDiagnostic),t!==r&&(i?.(),i=void 0))}return a(),{update(e){n=e,a()},destroy(){r++,i?.(),i=void 0}}}function Bo(e,t){let n=t,r=0,i;async function a(){let t=++r,a=n.runtime.payload;if(a===null||a.kind!==`dossier`)return;let o=await Xa(()=>import(`./chunks/focus-renderer-BgsZGo7n.js`),[]);t===r&&(i?.(),i=o.renderDossier(e,a.document,t=>{jo(e,`choose-option`,t)}),t!==r&&(i?.(),i=void 0))}return a(),{update(e){n=e,a()},destroy(){r++,i?.(),i=void 0}}}var Vo=_r(`<div class="st-element__body svelte-ji2uxk"></div>`),Ho=_r(`<div class="st-element__root svelte-ji2uxk"><!></div>`),Uo={hash:`svelte-ji2uxk`,code:`.st-element__root.svelte-ji2uxk {display:block;}.st-element__body.svelte-ji2uxk {min-height:120px;}`};function Wo(e,t){Ve(t,!0),zr(e,Uo);let n=ci(t,`envelope`,7),r=ci(t,`hostConfig`,7),i=io(`BpmnCanvas`),a=F(void 0),o=F(void 0),s=F(!1);kr(()=>{I(o,Oo(globalThis.document),!0),I(s,!0)});let c=P(()=>n()??K(a)),l=P(()=>r()??K(o));fn(()=>{(K(c)!==void 0||K(s))&&i.ingest(K(c),K(l))});var u={get envelope(){return n()},set envelope(e){n(e),pt()},get hostConfig(){return r()},set hostConfig(e){r(e),pt()}},d=Ho(),f=L(d),p=e=>{Fo(e,{get diagnostics(){return i.diagnostics}})},m=e=>{var t=Vo();Br(t,(e,t)=>zo?.(e,t),()=>({runtime:i})),J(e,t)};return X(f,e=>{i.state===`refused`?e(p):i.payload?.kind===`bpmn`&&e(m,1)}),A(d),Br(d,(e,t)=>Co?.(e,t),()=>({runtime:i,theme:K(l)?.theme,colorScheme:K(l)?.colorScheme})),Br(d,(e,t)=>Ao?.(e,t),()=>({apply:e=>I(a,e,!0)})),B((e,t)=>{Q(d,`data-st-theme`,e),Q(d,`data-color-mode`,t)},[()=>wo(K(l)?.theme),()=>To(K(l)?.colorScheme)]),J(e,d),He(u)}customElements.define(`st-bpmn-canvas`,mi(Wo,{envelope:{},hostConfig:{}},[],[],{mode:`open`}));var Go=_r(`<div class="st-element__body"></div>`),Ko=_r(`<div class="st-element__root svelte-2k2x7w"><!></div>`),qo={hash:`svelte-2k2x7w`,code:`.st-element__root.svelte-2k2x7w {display:block;}`};function Jo(e,t){Ve(t,!0),zr(e,qo);let n=ci(t,`envelope`,7),r=ci(t,`hostConfig`,7),i=io(`DecisionDossier`),a=F(void 0),o=F(void 0),s=F(!1);kr(()=>{I(o,Oo(globalThis.document),!0),I(s,!0)});let c=P(()=>n()??K(a)),l=P(()=>r()??K(o));fn(()=>{(K(c)!==void 0||K(s))&&i.ingest(K(c),K(l))});var u={get envelope(){return n()},set envelope(e){n(e),pt()},get hostConfig(){return r()},set hostConfig(e){r(e),pt()}},d=Ko(),f=L(d),p=e=>{Fo(e,{get diagnostics(){return i.diagnostics}})},m=e=>{var t=Go();Br(t,(e,t)=>Bo?.(e,t),()=>({runtime:i})),J(e,t)};return X(f,e=>{i.state===`refused`?e(p):i.payload?.kind===`dossier`&&e(m,1)}),A(d),Br(d,(e,t)=>Co?.(e,t),()=>({runtime:i,theme:K(l)?.theme,colorScheme:K(l)?.colorScheme})),Br(d,(e,t)=>Ao?.(e,t),()=>({apply:e=>I(a,e,!0)})),B((e,t)=>{Q(d,`data-st-theme`,e),Q(d,`data-color-mode`,t)},[()=>wo(K(l)?.theme),()=>To(K(l)?.colorScheme)]),J(e,d),He(u)}customElements.define(`st-decision-dossier`,mi(Jo,{envelope:{},hostConfig:{}},[],[],{mode:`open`})),lo(`st-bar-chart`),lo(`st-bpmn-canvas`),lo(`st-decision-dossier`);export{Hr as n,Xa as t};
2221
+ ${t.diagnostics.length===1?`diagnostic`:`diagnostics`}:`)),J(e,n),He()}var Io=_r(`<div class="st-element__root svelte-17allio"><!></div>`),Lo={hash:`svelte-17allio`,code:`.st-element__root.svelte-17allio {display:block;}`};function Ro(e,t){Ve(t,!0),zr(e,Lo);let n=ci(t,`envelope`,7),r=ci(t,`hostConfig`,7),i=io(`BarChart`),a=F(void 0),o=F(void 0),s=F(void 0),c=F(!1);kr(()=>{I(s,Oo(globalThis.document),!0),I(c,!0)});let l=P(()=>n()??K(o)),u=P(()=>r()??K(s));fn(()=>{(K(l)!==void 0||K(c))&&i.ingest(K(l),K(u))});var d={get envelope(){return n()},set envelope(e){n(e),pt()},get hostConfig(){return r()},set hostConfig(e){r(e),pt()}},f=Io(),p=L(f),m=e=>{Fo(e,{get diagnostics(){return i.diagnostics}})},h=e=>{fa(e,si(()=>i.payload.props,{onSelect:e=>{K(a)!==void 0&&jo(K(a),`select`,e)},onSelectKey:e=>{e!==null&&K(a)!==void 0&&jo(K(a),`select`,e)}}))};return X(p,e=>{i.state===`refused`?e(m):i.payload?.kind===`bar-chart`&&e(h,1)}),A(f),ai(f,e=>I(a,e),()=>K(a)),Br(f,(e,t)=>Co?.(e,t),()=>({runtime:i,theme:K(u)?.theme,colorScheme:K(u)?.colorScheme})),Br(f,(e,t)=>Ao?.(e,t),()=>({apply:e=>I(o,e,!0)})),B((e,t)=>{Q(f,`data-st-theme`,e),Q(f,`data-color-mode`,t)},[()=>wo(K(u)?.theme),()=>To(K(u)?.colorScheme)]),J(e,f),He(d)}customElements.define(`st-bar-chart`,mi(Ro,{envelope:{},hostConfig:{}},[],[],{mode:`open`}));function zo(e,t){let n=t,r=0,i;async function a(){let t=++r,a=n.runtime.payload;if(a===null||a.kind!==`bpmn`)return;let o=await Xa(()=>import(`./chunks/bpmn-canvas-DeAWdJFy.js`).then(e=>e.t),[]);t===r&&(i?.(),i=await o.renderBpmn(e,a,n.runtime.noteEngineDiagnostic),t!==r&&(i?.(),i=void 0))}return a(),{update(e){n=e,a()},destroy(){r++,i?.(),i=void 0}}}function Bo(e,t){let n=t,r=0,i;async function a(){let t=++r,a=n.runtime.payload;if(a===null||a.kind!==`dossier`)return;let o=await Xa(()=>import(`./chunks/focus-renderer-0elVToA2.js`),[]);t===r&&(i?.(),i=o.renderDossier(e,a.document,t=>{jo(e,`choose-option`,t)}),t!==r&&(i?.(),i=void 0))}return a(),{update(e){n=e,a()},destroy(){r++,i?.(),i=void 0}}}var Vo=_r(`<div class="st-element__body svelte-ji2uxk"></div>`),Ho=_r(`<div class="st-element__root svelte-ji2uxk"><!></div>`),Uo={hash:`svelte-ji2uxk`,code:`.st-element__root.svelte-ji2uxk {display:block;}.st-element__body.svelte-ji2uxk {min-height:120px;}`};function Wo(e,t){Ve(t,!0),zr(e,Uo);let n=ci(t,`envelope`,7),r=ci(t,`hostConfig`,7),i=io(`BpmnCanvas`),a=F(void 0),o=F(void 0),s=F(!1);kr(()=>{I(o,Oo(globalThis.document),!0),I(s,!0)});let c=P(()=>n()??K(a)),l=P(()=>r()??K(o));fn(()=>{(K(c)!==void 0||K(s))&&i.ingest(K(c),K(l))});var u={get envelope(){return n()},set envelope(e){n(e),pt()},get hostConfig(){return r()},set hostConfig(e){r(e),pt()}},d=Ho(),f=L(d),p=e=>{Fo(e,{get diagnostics(){return i.diagnostics}})},m=e=>{var t=Vo();Br(t,(e,t)=>zo?.(e,t),()=>({runtime:i})),J(e,t)};return X(f,e=>{i.state===`refused`?e(p):i.payload?.kind===`bpmn`&&e(m,1)}),A(d),Br(d,(e,t)=>Co?.(e,t),()=>({runtime:i,theme:K(l)?.theme,colorScheme:K(l)?.colorScheme})),Br(d,(e,t)=>Ao?.(e,t),()=>({apply:e=>I(a,e,!0)})),B((e,t)=>{Q(d,`data-st-theme`,e),Q(d,`data-color-mode`,t)},[()=>wo(K(l)?.theme),()=>To(K(l)?.colorScheme)]),J(e,d),He(u)}customElements.define(`st-bpmn-canvas`,mi(Wo,{envelope:{},hostConfig:{}},[],[],{mode:`open`}));var Go=_r(`<div class="st-element__body"></div>`),Ko=_r(`<div class="st-element__root svelte-2k2x7w"><!></div>`),qo={hash:`svelte-2k2x7w`,code:`.st-element__root.svelte-2k2x7w {display:block;}`};function Jo(e,t){Ve(t,!0),zr(e,qo);let n=ci(t,`envelope`,7),r=ci(t,`hostConfig`,7),i=io(`DecisionDossier`),a=F(void 0),o=F(void 0),s=F(!1);kr(()=>{I(o,Oo(globalThis.document),!0),I(s,!0)});let c=P(()=>n()??K(a)),l=P(()=>r()??K(o));fn(()=>{(K(c)!==void 0||K(s))&&i.ingest(K(c),K(l))});var u={get envelope(){return n()},set envelope(e){n(e),pt()},get hostConfig(){return r()},set hostConfig(e){r(e),pt()}},d=Ko(),f=L(d),p=e=>{Fo(e,{get diagnostics(){return i.diagnostics}})},m=e=>{var t=Go();Br(t,(e,t)=>Bo?.(e,t),()=>({runtime:i})),J(e,t)};return X(f,e=>{i.state===`refused`?e(p):i.payload?.kind===`dossier`&&e(m,1)}),A(d),Br(d,(e,t)=>Co?.(e,t),()=>({runtime:i,theme:K(l)?.theme,colorScheme:K(l)?.colorScheme})),Br(d,(e,t)=>Ao?.(e,t),()=>({apply:e=>I(a,e,!0)})),B((e,t)=>{Q(d,`data-st-theme`,e),Q(d,`data-color-mode`,t)},[()=>wo(K(l)?.theme),()=>To(K(l)?.colorScheme)]),J(e,d),He(u)}customElements.define(`st-decision-dossier`,mi(Jo,{envelope:{},hostConfig:{}},[],[],{mode:`open`})),lo(`st-bar-chart`),lo(`st-bpmn-canvas`),lo(`st-decision-dossier`);export{Hr as n,Xa as t};
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.0",
2
+ "version": "0.2.0",
3
3
  "files": {
4
4
  "assets/bpmn-CZlEAdL6.ttf": {
5
5
  "bytes": 48652,
@@ -113,11 +113,11 @@
113
113
  "integrity": "sha384-k/IBoHbdks/+6maYUo8tyGlwgYpHZlQPZWZU77Yhx3BdmT85wFafDhD7LioQ6bSJ",
114
114
  "group": "theme:entropic"
115
115
  },
116
- "chunks/focus-renderer-BgsZGo7n.js": {
117
- "bytes": 53400,
118
- "gzip": 19285,
119
- "brotli": 17022,
120
- "integrity": "sha384-pgrHCl0m3N31klcRikWpHMcsHuzDew0bof+qMVK+H2eFITYAHtg7bL9wRCdU0mOZ",
116
+ "chunks/focus-renderer-0elVToA2.js": {
117
+ "bytes": 65848,
118
+ "gzip": 21949,
119
+ "brotli": 19442,
120
+ "integrity": "sha384-R9QQuw5Q1m4itYq4nnOTswUoaaEh+AbC7jn1Hf555Zvhmc+UPxeexVT0oy43LlBv",
121
121
  "group": "engine:focus"
122
122
  },
123
123
  "chunks/forge-B8hrW4lA.js": {
@@ -158,8 +158,8 @@
158
158
  "elements.js": {
159
159
  "bytes": 240753,
160
160
  "gzip": 54153,
161
- "brotli": 40800,
162
- "integrity": "sha384-HinwhQaL9Xe+nrnD+WnXIjOC5HrgC6srM3Xjq60l+EAV9jrGN0whFwQXnYkpCRaK",
161
+ "brotli": 40830,
162
+ "integrity": "sha384-VKv/Inmn+u17kOZ/rlbqfjd7R15+IF5c6QdHfuf8ms86THfIMgtCt6E0TtFaWKMR",
163
163
  "group": "core"
164
164
  }
165
165
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentropic/design-system-elements",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,8 +0,0 @@
1
- function e(e,t){this.v=e,this.k=t}function t(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 n(e){if(Array.isArray(e))return e}function r(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 i(){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 a(e,t){return n(e)||r(e,t)||o(e,t)||i()}function o(e,n){if(e){if(typeof e==`string`)return t(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function s(t){var n,r;function i(n,r){try{var o=t[n](r),s=o.value,c=s instanceof e;Promise.resolve(c?s.v:s).then(function(e){if(c){var r=n===`return`&&s.k?n:`next`;if(!s.k||e.done)return i(r,e);e=t[r](e).value}a(!!o.done,e)},function(e){i(`throw`,e)})}catch(e){a(2,e)}}function a(e,t){e===2?n.reject(t):n.resolve({value:t,done:e}),(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(a,o){var s={key:e,arg:t,resolve:a,reject:o,next:null};r?r=r.next=s:(n=r=s,i(e,t))})},typeof t.return!=`function`&&(this.return=void 0)}s.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},s.prototype.next=function(e){return this._invoke(`next`,e)},s.prototype.throw=function(e){return this._invoke(`throw`,e)},s.prototype.return=function(e){return this._invoke(`return`,e)};var c=Object.entries,l=Object.setPrototypeOf,u=Object.isFrozen,d=Object.getPrototypeOf,f=Object.getOwnPropertyDescriptor,p=Object.freeze,m=Object.seal,h=Object.create,ee=typeof Reflect<`u`&&Reflect,g=ee.apply,te=ee.construct;p||=function(e){return e},m||=function(e){return e},g||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},te||=function(e){return new e(...[...arguments].slice(1))};var _=w(Array.prototype.forEach);Array.prototype.indexOf;var ne=w(Array.prototype.lastIndexOf),re=w(Array.prototype.pop),ie=w(Array.prototype.push),ae=w(Array.prototype.slice),oe=w(Array.prototype.splice),se=Array.isArray,ce=T(Set),le=w(Set.prototype.add),ue=w(Set.prototype.has),v=w(String.prototype.toLowerCase),de=w(String.prototype.toString),fe=w(String.prototype.match),pe=w(String.prototype.replace),me=w(String.prototype.indexOf),he=w(String.prototype.trim),ge=w(Number.prototype.toString),_e=w(Boolean.prototype.toString),y=typeof BigInt>`u`?null:w(BigInt.prototype.toString),ve=typeof Symbol>`u`?null:w(Symbol.prototype.toString),b=w(Object.prototype.hasOwnProperty),x=w(Object.prototype.toString),S=w(RegExp.prototype.test),C=T(TypeError);function w(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return g(e,t,n)}}function T(e){return function(){return te(e,[...arguments])}}function E(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v;if(l&&l(e,null),!se(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(u(t)||(t[r]=e),i=e)}e[i]=!0}return e}function ye(e){for(let t=0;t<e.length;t++)b(e,t)||(e[t]=null);return e}function D(e){let t=h(null);for(let r of c(e)){var n=a(r,2);let i=n[0],o=n[1];b(e,i)&&(t[i]=se(o)?ye(o):o&&typeof o==`object`&&o.constructor===Object?D(o):o)}return t}function be(e){switch(typeof e){case`string`:return e;case`number`:return ge(e);case`boolean`:return _e(e);case`bigint`:return y?y(e):`0`;case`symbol`:return ve?ve(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=f(e,t);if(n){if(n.get)return w(n.get);if(typeof n.value==`function`)return w(n.value)}e=d(e)}function n(){return null}return n}function xe(e,t){for(;e!==null;){let n=f(e,t);if(n)return n.get?w(n.get):null;e=d(e)}return null}function Se(e){try{return S(e,``),!0}catch{return!1}}var Ce=p(`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(`.`)),we=p(`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(`.`)),Te=p([`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`]),Ee=p([`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`]),De=p(`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(`.`)),Oe=p([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),ke=p([`#text`]),Ae=p(`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(`.`)),je=p(`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(`.`)),Me=p(`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(`.`)),Ne=p([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Pe=m(/{{[\w\W]*|^[\w\W]*}}/g),Fe=m(/<%[\w\W]*|^[\w\W]*%>/g),Ie=m(/\${[\w\W]*/g),Le=m(/^data-[\-\w.\u00B7-\uFFFF]+$/),Re=m(/^aria-[\-\w]+$/),ze=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Be=m(/^(?:\w+script|data):/i),Ve=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),He=m(/^html$/i),Ue=m(/^[a-z][.\w]*(-[.\w]+)+$/i),We=m(/<[/\w!]/g),Ge=m(/<[/\w]/g),Ke=m(/<\/no(script|embed|frames)/i),qe=m(/\/>/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},Je=p(E({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),Ye=function(){return typeof window>`u`?null:window},Xe=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}},Ze=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},A=function(e,t,n,r){return b(e,t)&&se(e[t])?E(r.base?D(r.base):{},e[t],r.transform):n},Qe=function(e,t,n){let r=b(e,t)?e[t]:void 0;return r&&typeof r==`object`?D(r):n()};function $e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ye(),t=e=>$e(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,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,d=e.trustedTypes,f=s.prototype,ee=O(f,`cloneNode`),g=O(f,`remove`),te=O(f,`removeAttributeNode`),ge=O(f,`nextSibling`),_e=O(f,`childNodes`),y=O(f,`parentNode`),ve=O(f,`shadowRoot`),x=O(f,`attributes`),w=o&&o.prototype?O(o.prototype,`nodeType`):null,T=o&&o.prototype?O(o.prototype,`nodeName`):null,ye=o&&o.prototype?O(o.prototype,`ownerDocument`):null,j=function(e){return w?w(e):e.nodeType},M=function(e){return T?T(e):e.nodeName},N=xe(f,`namespaceURI`),P=function(e){return N?N(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let F,I=``,et,tt=!1,nt=0,L=function(){if(nt>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.`)},R=function(e){L(),nt++;try{return F.createHTML(e)}finally{nt--}},rt=function(e){L(),nt++;try{return F.createScriptURL(e)}finally{nt--}},it=function(){return tt||=(et=Xe(d,i),!0),et},at=n,ot=at.implementation,st=at.createNodeIterator,ct=at.createDocumentFragment,lt=at.getElementsByTagName,z=r.importNode,B=Ze();t.isSupported=typeof c==`function`&&typeof y==`function`&&ot&&ot.createHTMLDocument!==void 0;let ut=Pe,dt=Fe,ft=Ie,pt=Le,mt=Re,ht=Be,gt=Ve,_t=Ue,vt=ze,V=null,yt=E({},[...Ce,...we,...Te,...De,...ke]),H=null,bt=E({},[...Ae,...je,...Me,...Ne]),U=Object.seal(h(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}})),xt=null,St=null,W=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ct=!0,wt=!0,Tt=!1,Et=!0,G=!1,K=!0,q=!1,Dt=!1,Ot=null,kt=null,At=!1,J=!1,Y=!1,jt=!1,Mt=!0,Nt=!1,Pt=`user-content-`,Ft=!0,It=!1,Lt=null,Rt={},zt=null,Bt=E({},`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(`.`)),Vt=null,Ht=E({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ut=null,Wt=E({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Gt=`http://www.w3.org/1998/Math/MathML`,Kt=`http://www.w3.org/2000/svg`,X=`http://www.w3.org/1999/xhtml`,qt=X,Jt=!1,Yt=null,Xt=E({},[Gt,Kt,X],de),Zt=p([`mi`,`mo`,`mn`,`ms`,`mtext`]),Qt=E({},Zt),$t=p([`annotation-xml`]),en=E({},$t),tn=E({},[`title`,`style`,`font`,`a`,`script`]),nn=null,rn=[`application/xhtml+xml`,`text/html`],Z=null,an=null,on=n.createElement(`form`),sn=function(e){return e instanceof RegExp||e instanceof Function},cn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(an&&an===e)return;(!e||typeof e!=`object`)&&(e={}),e=D(e),nn=rn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Z=nn===`application/xhtml+xml`?de:v,V=A(e,`ALLOWED_TAGS`,yt,{transform:Z}),H=A(e,`ALLOWED_ATTR`,bt,{transform:Z}),Yt=A(e,`ALLOWED_NAMESPACES`,Xt,{transform:de}),Ut=A(e,`ADD_URI_SAFE_ATTR`,Wt,{transform:Z,base:Wt}),Vt=A(e,`ADD_DATA_URI_TAGS`,Ht,{transform:Z,base:Ht}),zt=A(e,`FORBID_CONTENTS`,Bt,{transform:Z}),xt=A(e,`FORBID_TAGS`,D({}),{transform:Z}),St=A(e,`FORBID_ATTR`,D({}),{transform:Z}),Rt=b(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?D(e.USE_PROFILES):e.USE_PROFILES:!1,Ct=e.ALLOW_ARIA_ATTR!==!1,wt=e.ALLOW_DATA_ATTR!==!1,Tt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Et=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=e.SAFE_FOR_TEMPLATES||!1,K=e.SAFE_FOR_XML!==!1,q=e.WHOLE_DOCUMENT||!1,J=e.RETURN_DOM||!1,Y=e.RETURN_DOM_FRAGMENT||!1,jt=e.RETURN_TRUSTED_TYPE||!1,At=e.FORCE_BODY||!1,Mt=e.SANITIZE_DOM!==!1,Nt=e.SANITIZE_NAMED_PROPS||!1,Ft=e.KEEP_CONTENT!==!1,It=e.IN_PLACE||!1,vt=Se(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:ze,qt=typeof e.NAMESPACE==`string`?e.NAMESPACE:X,Qt=Qe(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>E({},Zt)),en=Qe(e,`HTML_INTEGRATION_POINTS`,()=>E({},$t));let t=Qe(e,`CUSTOM_ELEMENT_HANDLING`,()=>h(null));if(U=h(null),b(t,`tagNameCheck`)&&sn(t.tagNameCheck)&&(U.tagNameCheck=t.tagNameCheck),b(t,`attributeNameCheck`)&&sn(t.attributeNameCheck)&&(U.attributeNameCheck=t.attributeNameCheck),b(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(U.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),m(U),G&&(wt=!1),Y&&(J=!0),Rt&&(V=E({},ke),H=h(null),Rt.html===!0&&(E(V,Ce),E(H,Ae)),Rt.svg===!0&&(E(V,we),E(H,je),E(H,Ne)),Rt.svgFilters===!0&&(E(V,Te),E(H,je),E(H,Ne)),Rt.mathMl===!0&&(E(V,De),E(H,Me),E(H,Ne))),W.tagCheck=null,W.attributeCheck=null,b(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?W.tagCheck=e.ADD_TAGS:se(e.ADD_TAGS)&&(V===yt&&(V=D(V)),E(V,e.ADD_TAGS,Z))),b(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?W.attributeCheck=e.ADD_ATTR:se(e.ADD_ATTR)&&(H===bt&&(H=D(H)),E(H,e.ADD_ATTR,Z))),b(e,`ADD_FORBID_CONTENTS`)&&se(e.ADD_FORBID_CONTENTS)&&(zt===Bt&&(zt=D(zt)),E(zt,e.ADD_FORBID_CONTENTS,Z)),Ft&&(V[`#text`]=!0),q&&E(V,[`html`,`head`,`body`]),V.table&&(E(V,[`tbody`]),delete xt.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=F;F=e.TRUSTED_TYPES_POLICY;try{I=R(``)}catch(e){throw F=t,e}}else e.TRUSTED_TYPES_POLICY===null?(F=void 0,I=``):(F===void 0&&(F=it()),F&&typeof I==`string`&&(I=R(``)));p&&p(e),an=e},ln=E({},[...we,...Te,...Ee]),un=E({},[...De,...Oe]),dn=function(e,t,n){return t.namespaceURI===X?e===`svg`:t.namespaceURI===Gt?e===`svg`&&(n===`annotation-xml`||Qt[n]):!!ln[e]},fn=function(e,t,n){return t.namespaceURI===X?e===`math`:t.namespaceURI===Kt?e===`math`&&en[n]:!!un[e]},pn=function(e,t,n){return t.namespaceURI===Kt&&!en[n]||t.namespaceURI===Gt&&!Qt[n]?!1:!un[e]&&(tn[e]||!ln[e])},mn=function(e){let t=P(e),n=v(M(e)),r=y(e),i,a;return r&&j(r)===k.element?(i={namespaceURI:P(r)},a=v(M(r))):(i={namespaceURI:qt},a=`template`),Yt[t]?t===Kt?dn(n,i,a):t===Gt?fn(n,i,a):t===X?pn(n,i,a):!!(nn===`application/xhtml+xml`&&Yt[t]):!1},hn=function(e){ie(t.removed,{element:e});try{y(e).removeChild(e)}catch{if(g(e),!y(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`)}},gn=function(e,t,n){try{te(e,t)}catch{try{e.removeAttribute(n)}catch{}}},_n=function(e){xn(e);let t=_e(e);t&&_(ae(t),e=>{try{g(e)}catch{}});let n=j(e)===k.element?x(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&gn(e,r,i)}},vn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}ie(t.removed,{attribute:r||null,from:n});try{r?te(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(J||Y)try{hn(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},yn=function(e){let t=x(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||H[Z(i)]||gn(e,r,i)}},bn=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&&j(e)===k.element){let t=ve(e);Q(t)&&r.push(t)}let i=_e(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},xn=function(e){bn(e,e=>{j(e)===k.element&&yn(e)})},Sn=function(e){let t=[];return bn(e,e=>{t.push(e)},!0),t},Cn=function(e,t){let n=ce();_(Sn(e),e=>{j(e)===k.element&&le(n,e)}),_(t,e=>{j(e)===k.element&&!ue(n,e)&&yn(e)})},wn=function(e,n){let r=!1;return _(t.removed,t=>{t.element&&(r||=t.element===e,xn(t.element))}),Cn(e,n),r},Tn=function(e,t){let n=Lt,r=null,i=()=>(r||(r=ce(),_(t,e=>{le(r,e)})),r);for(let t=0;;t++){let r=Sn(e),a=[e],o=!1;if(_(r,e=>{j(e)===k.documentFragment?ie(a,e):!o&&!ue(n,e)&&(o=ue(i(),e))}),!o)return;if(t>=8)throw C(`the tree kept changing during in-place sanitization; refusing to return it`);_(a,(t,n)=>{En(t,n>0,e,i())})}},En=function(e,t,n,r){let i=jn(e),a;for(;a=i.nextNode();)ue(r,a)&&!ue(Lt,a)&&(t&&$(B.uponSanitizeShadowNode,a,null),Hn(a,n),Yn(a,n),Q(a.content)&&Xn(a.content))},Dn=function(e){Lt&&le(Lt,e)},On=function(e,t){return K?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},kn=function(e){K&&bn(e,e=>{let t=j(e);if(t===k.processingInstruction||t===k.comment&&S(Ge,e.data)){try{g(e)}catch{}return!1}if(t===k.element){let t=e,n=Z(M(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&On(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},An=function(e){let t=null,r=null;if(At)e=`<remove></remove>`+e;else{let t=fe(e,/^[\r\n\t ]+/);r=t&&t[0]}nn===`application/xhtml+xml`&&qt===X&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=F?R(e):e;if(qt===X)try{t=new u().parseFromString(i,nn)}catch{}if(!t||!t.documentElement){t=ot.createDocument(qt,`template`,null);try{t.documentElement.innerHTML=Jt?I:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),qt===X?lt.call(t,q?`html`:`body`)[0]:q?t.documentElement:a},jn=function(e){let t=ye?ye(e):e.ownerDocument;return st.call(t||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Mn=function(e){return e=pe(e,ut,` `),e=pe(e,dt,` `),e=pe(e,ft,` `),e},Nn=function(e){Pn(e);let t=e.querySelectorAll?.call(e,`template`);t&&_(t,e=>{Q(e.content)&&Nn(e.content)})},Pn=function(e){e.normalize();let t=ye?ye(e):e.ownerDocument,n=st.call(t||e,e,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Mn(r.data),r=n.nextNode()},Fn=function(e){let t=T?T(e):null;return typeof t!=`string`||Z(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==x(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!==w(e)||e.childNodes!==_e(e)},Q=function(e){if(!w||typeof e!=`object`||!e)return!1;try{return w(e)===k.documentFragment}catch{return!1}},In=function(e){if(!w||typeof e!=`object`||!e)return!1;try{return typeof w(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&_(e,e=>{e.call(t,n,r,an)})}let Ln=function(e,t){return!!(K&&e.hasChildNodes()&&!In(e.firstElementChild)&&S(We,e.textContent)&&S(We,e.innerHTML)||K&&Je[t]&&j(e)===k.element&&P(e)===X&&(In(e.firstElementChild)||typeof e.textContent==`string`&&S(We,e.textContent))||e.nodeType===k.processingInstruction||K&&e.nodeType===k.comment&&S(Ge,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(!xt[t]&&Gn(t)&&Rn(U.tagNameCheck,t))return!1;if(Ft&&!zt[t]&&!zt[v(t)]){let t=y(e),r=_e(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?ee(r[a],!0):r[a];t.insertBefore(i,ge(e))}}}return hn(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||y(e)!==null?!1:(It&&xn(e),!0)},Hn=function(e,n){if(Dn(e),$(B.beforeSanitizeElements,e,null),Vn(e,n))return!0;if(Fn(e))return hn(e),!0;let r=Z(M(e));if(V=Bn(B.uponSanitizeElement,V,yt,Ot),$(B.uponSanitizeElement,e,{tagName:r,allowedTags:V}),Vn(e,n))return!0;if(Ln(e,r))return hn(e),!0;if(xt[r]||!(W.tagCheck instanceof Function&&W.tagCheck(r))&&!V[r]){let t=zn(e,r,n);return t===!1&&($(B.afterSanitizeElements,e,null),Vn(e,n))?!0:t}if(j(e)===k.element&&!mn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&S(Ke,e.innerHTML))return hn(e),!0;if(G&&e.nodeType===k.text){let n=Mn(e.textContent);e.textContent!==n&&(ie(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(B.afterSanitizeElements,e,null),Vn(e,n)},Un=function(e,t,r){if(St[t]||On(t,e)||Mt&&(t===`id`||t===`name`)&&(r in n||r in on))return!1;let i=H[t]||W.attributeCheck instanceof Function&&W.attributeCheck(t,e);return wt&&S(pt,t)||Ct&&S(mt,t)?!0:i?Ut[t]||S(vt,pe(r,gt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&me(r,`data:`)===0&&Vt[e]||Tt&&!S(ht,pe(r,gt,``))?!0:!r:Gn(e)&&Rn(U.tagNameCheck,e)&&Rn(U.attributeNameCheck,t,e)||t===`is`&&U.allowCustomizedBuiltInElements&&Rn(U.tagNameCheck,r)},Wn=E({},[`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[v(e)]&&S(_t,e)},Kn=function(e,t,n,r){if(F&&typeof d==`object`&&typeof d.getAttributeType==`function`&&!n)switch(d.getAttributeType(e,t)){case`TrustedHTML`:return R(r);case`TrustedScriptURL`:return rt(r)}return r},qn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Fn(e)||(hn(e),!1)}catch{return vn(t,e),!1}},Jn=function(e,t){return K&&S(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:v(e)===`attributename`&&fe(t,`href`)!==null},Yn=function(e,n){if($(B.beforeSanitizeAttributes,e,null),Vn(e,n))return;let r=e.attributes;if(!r||Fn(e))return;H=Bn(B.uponSanitizeAttribute,H,bt,kt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0},a=r.length,o=Z(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=Z(s),d=l,f=s===`value`?d:he(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$(B.uponSanitizeAttribute,e,i),f=i.attrValue,Nt&&(u===`id`||u===`name`)&&me(f,Pt)!==0&&(vn(s,e,n),f=Pt+f,p=!0),Jn(s,f)?vn(s,e,n):i.forceKeepAttr||(i.keepAttr?!Et&&S(qe,f)?vn(s,e,n):(G&&(f=Mn(f)),Un(o,u,f)?(f=Kn(o,u,c,f),f!==d&&qn(e,s,c,f)&&p&&re(t.removed)):vn(s,e,n)):vn(s,e,n))}$(B.afterSanitizeAttributes,e,null),Vn(e,n)},Xn=function(e){let t=null,n=jn(e);for($(B.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(B.uponSanitizeShadowNode,t,null),Hn(t,e),Yn(t,e),Q(t.content)&&Xn(t.content),j(t)===k.element){let e=ve(t);Q(e)&&(Zn(e),Xn(e))}G&&Pn(e),$(B.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=j(n)===k.element,i=_e(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=T?T(n):null;if(typeof e==`string`&&Z(e)===`template`){let e=n.content;Q(e)&&t.push({node:e,shadow:null})}}if(r){let e=ve(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(Jt=!e,Jt&&(e=`<!-->`),typeof e!=`string`&&!In(e)&&(e=be(e),typeof e!=`string`))throw C(`dirty is not a string, aborting`);if(!t.isSupported)return e;Dt?(V=Ot,H=kt):cn(n),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(V=D(V)),B.uponSanitizeAttribute.length>0&&(H=D(H)),t.removed=[];let c=It&&typeof e!=`string`&&In(e),l=[],u=Lt;if(c){kn(e);let t=M(e);if(typeof t==`string`){let n=Z(t);if(!V[n]||xt[n])throw _n(e),C(`root node is forbidden and cannot be sanitized in-place`)}if(Fn(e))throw _n(e),C(`root node is clobbered and cannot be sanitized in-place`);l=Sn(e),Lt=ce()}else if(In(e))i=An(`<!---->`),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(!J&&!G&&!q&&e.indexOf(`<`)===-1)return F&&jt?R(e):e;if(i=An(e),!i)return J?null:jt?I:``}i&&At&&hn(i.firstChild);let d=c?e:i;try{c&&Zn(e);let t=jn(d);for(;o=t.nextNode();)Hn(o,d),Yn(o,d),Q(o.content)&&Xn(o.content);c&&Tn(e,l)}catch(t){throw c&&(_n(e),wn(e,l)),t}finally{Lt=u}if(c){if(wn(e,l))throw C(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return G&&Nn(e),e}if(J){if(G&&Nn(i),Y)for(s=ct.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(H.shadowroot||H.shadowrootmode)&&(s=z.call(r,s,!0)),s}let f=q?i.outerHTML:i.innerHTML;return q&&V[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&S(He,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
- `+f),G&&(f=Mn(f)),F&&jt?R(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};cn(e),Dt=!0,Ot=V,kt=H},t.clearConfig=function(){an=null,Dt=!1,Ot=null,kt=null,F=et,I=``},t.isValidAttribute=function(e,t,n){an||cn({});let r=Z(e),i=Z(t);return typeof n==`string`&&(Jn(t,n)||!Et&&S(qe,n))?!1:Un(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&b(B,e)&&ie(B[e],t)},t.removeHook=function(e,t){if(b(B,e)){if(t!==void 0){let n=ne(B[e],t);return n===-1?void 0:oe(B[e],n,1)[0]}return re(B[e])}},t.removeHooks=function(e){b(B,e)&&(B[e]=[])},t.removeAllHooks=function(){B=Ze()},t}var j=$e(),M=class extends Error{issue;constructor(e){super(e.message),this.issue=e}},N=(e,t,n)=>{throw new M({path:e,code:t,message:n})};function P(e,t,n,r=[]){(!e||typeof e!=`object`||Array.isArray(e))&&N(t,`invalid_evidence`,`Expected a closed object`);let i=e;for(let e of Object.keys(i))[...n,...r].includes(e)||N(`${t}.${e}`,`invalid_evidence`,`Unknown evidence field`);for(let e of n)Object.hasOwn(i,e)||N(`${t}.${e}`,`invalid_evidence`,`Missing evidence field`);return i}function F(e,t,n=!1){return(typeof e!=`string`||!n&&!e.trim())&&N(t,`invalid_evidence`,`Expected a non-empty string`),e}function I(e,t){return Array.isArray(e)||N(t,`invalid_evidence`,`Expected an array`),e}var et=(e,t)=>I(e,t).map((e,n)=>F(e,`${t}[${n}]`));function tt(e,t){let n=t=>new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(t);if(t===`image/png`){if(e.length>=33&&[137,80,78,71,13,10,26,10].every((t,n)=>e[n]===t)&&n(8)===13&&n(12)===1229472850)return[n(16),n(20)]}else if(e[0]===255&&e[1]===216){let t=2;for(;t+4<e.length&&e[t]===255;){let n=e[t+1],r=e[t+2]<<8|e[t+3];if(r<2||t+2+r>e.length)break;if([192,193,194,195,197,198,199,201,202,203,205,206,207].includes(n)&&r>=8)return[e[t+7]<<8|e[t+8],e[t+5]<<8|e[t+6]];t+=r+2}}}var nt=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],L=(e,t)=>e>>>t|e<<32-t;function R(e){let t=new Uint8Array(Math.ceil((e.length+9)/64)*64);t.set(e),t[e.length]=128;let n=new DataView(t.buffer),r=e.length*8;n.setUint32(t.length-8,Math.floor(r/4294967296)),n.setUint32(t.length-4,r>>>0);let i=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],a=new Int32Array(64);for(let e=0;e<t.length;e+=64){for(let t=0;t<16;t++)a[t]=n.getInt32(e+t*4);for(let e=16;e<64;e++){let t=a[e-15],n=a[e-2];a[e]=a[e-16]+(L(t,7)^L(t,18)^t>>>3)+a[e-7]+(L(n,17)^L(n,19)^n>>>10)}let[t,r,o,s,c,l,u,d]=i;for(let e=0;e<64;e++){let n=d+(L(c,6)^L(c,11)^L(c,25))+(c&l^~c&u)+nt[e]+a[e]|0,i=(L(t,2)^L(t,13)^L(t,22))+(t&r^t&o^r&o)|0;d=u,u=l,l=c,c=s+n|0,s=o,o=r,r=t,t=n+i|0}[t,r,o,s,c,l,u,d].forEach((e,t)=>{i[t]=i[t]+e|0})}return i.map(e=>(e>>>0).toString(16).padStart(8,`0`)).join(``)}function rt(e){if(e.length%4||/[^A-Za-z0-9+/]/.test(e.replace(/={1,2}$/,``)))throw Error(`Invalid base64`);let t=atob(e);if(btoa(t)!==e)throw Error(`Non-canonical base64`);let n=new Uint8Array(t.length);for(let e=0;e<n.length;e++)n[e]=t.charCodeAt(e);return n}var it=e=>new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0}).decode(e),at=e=>e.split(/\r\n|\n|\r/),ot=e=>/^text\/[a-z0-9.+-]+$/.test(e)||[`application/json`,`application/yaml`,`application/x-yaml`,`application/x-ndjson`].includes(e);function st(e,t){let n=new Map;return{sources:I(e,`$.sources`).map((e,r)=>{let i=`$.sources[${r}]`,a=P(e,i,[`id`,`title`,`origin`,`mediaType`,`encoding`,`data`,`sha256`,`size`],[`width`,`height`,`alt`]);for(let e of[`id`,`title`,`mediaType`,`sha256`])F(a[e],`${i}.${e}`);t(a.id,`${i}.id`);let o=a.origin,s=o&&Object.hasOwn(o,`uri`)?[`uri`]:[`repo`,`revision`,`path`];P(o,`${i}.origin`,s);for(let e of s)F(o[e],`${i}.origin.${e}`);a.encoding!==`base64`&&N(`${i}.encoding`,`source_encoding`,`Only original base64 bytes are accepted`);let c=a.mediaType;!ot(c)&&![`image/png`,`image/jpeg`].includes(c)&&N(`${i}.mediaType`,`unsupported_media`,`Unsupported media for source ${a.id}`);let l;try{l=rt(F(a.data,`${i}.data`,!0))}catch{return N(`${i}.data`,`source_encoding`,`Invalid base64 for source ${a.id}`)}if((!Number.isSafeInteger(a.size)||a.size!==l.length)&&N(`${i}.size`,`source_size`,`Byte size mismatch for source ${a.id}`),(!/^[a-f0-9]{64}$/.test(a.sha256)||R(l)!==a.sha256)&&N(`${i}.sha256`,`source_digest`,`SHA-256 mismatch for source ${a.id}`),ot(c)){try{n.set(a.id,at(it(l)).length)}catch{N(`${i}.data`,`source_encoding`,`Invalid UTF-8 for source ${a.id}`)}for(let e of[`width`,`height`,`alt`])a[e]!==void 0&&N(`${i}.${e}`,`invalid_evidence`,`Image metadata on text`)}else{F(a.alt,`${i}.alt`);let e=tt(l,c);(!e||!Number.isSafeInteger(a.width)||!Number.isSafeInteger(a.height)||e[0]<=0||e[1]<=0||e[0]!==a.width||e[1]!==a.height)&&N(i,`image_metadata`,`Image dimensions/signature mismatch for source ${a.id}`)}return a}),lineCounts:n}}function ct(e,t){try{let{schemaVersion:n,sources:r,citations:i,evidenceGroups:a,annexes:o,...s}=e,c=new Map,l=(e,t)=>{if(!e||typeof e!=`object`||Array.isArray(e))return e;let{citationRefs:n,...r}=e;return n!==void 0&&c.set(t,et(n,`${t}.citationRefs`)),r};Array.isArray(s.sections)&&(s.sections=s.sections.map((e,t)=>{let n=l(e,`$.sections[${t}]`);return n?.kind===`optionSet`&&Array.isArray(n.options)?{...n,options:n.options.map((e,n)=>l(e,`$.sections[${t}].options[${n}]`))}:n}));let u=t(s);if(!u.ok)return u;let d=u.value,f=new Set,p=new Set([d.ref]),m=(e,t)=>{f.has(e)&&N(t,`duplicate_id`,`Duplicate id ${e}`),f.add(e)};d.sections.forEach(e=>{m(e.id,`$.sections`),p.add(e.id),p.add(e.targetRef),e.kind===`optionSet`&&e.options.forEach(e=>{m(e.id,`$.sections.options`),p.add(e.id),p.add(e.targetRef)})});let{sources:h,lineCounts:ee}=st(r,m),g=new Map(h.map(e=>[e.id,e])),te=I(i,`$.citations`).map((e,t)=>{let n=`$.citations[${t}]`,r=P(e,n,[`id`,`sourceId`,`label`,`locator`]);for(let e of[`id`,`sourceId`,`label`])F(r[e],`${n}.${e}`);m(r.id,`${n}.id`);let i=g.get(r.sourceId)??N(`${n}.sourceId`,`unresolved_source`,`Unknown source ${r.sourceId}`),a=r.locator;return a?.kind===`lines`?(P(a,`${n}.locator`,[`kind`,`start`,`end`]),ee.has(i.id)||N(`${n}.locator`,`citation_media`,`Source ${i.id} is not text`),(!Number.isSafeInteger(a.start)||!Number.isSafeInteger(a.end)||a.start<1||a.end<a.start||a.end>ee.get(i.id))&&N(`${n}.locator`,`citation_range`,`Invalid inclusive line range for ${i.id}`)):a?.kind===`image`?(P(a,`${n}.locator`,[`kind`,`caption`]),F(a.caption,`${n}.locator.caption`),i.mediaType.startsWith(`image/`)||N(`${n}.locator`,`citation_media`,`Source ${i.id} is not an image`)):N(`${n}.locator`,`invalid_evidence`,`Unknown citation locator`),r}),_=new Set(te.map(e=>e.id)),ne=(e,t,n,r)=>{let i=et(e,t);for(let e of i)n.has(e)||N(t,r,`Unresolved reference ${e}`);return i};for(let[e,t]of c)ne(t,`${e}.citationRefs`,_,`unresolved_citation`);let re=I(a,`$.evidenceGroups`).map((e,t)=>{let n=`$.evidenceGroups[${t}]`,r=P(e,n,[`id`,`summary`,`citationRefs`,`sourceRefs`]);return m(F(r.id,`${n}.id`),`${n}.id`),F(r.summary,`${n}.summary`),ne(r.citationRefs,`${n}.citationRefs`,_,`unresolved_citation`),ne(r.sourceRefs,`${n}.sourceRefs`,new Set(g.keys()),`unresolved_source`),r}),ie=I(o,`$.annexes`).map((e,t)=>{let n=`$.annexes[${t}]`,r=P(e,n,[`id`,`title`,`summary`,`blocks`,`backRefs`]);return m(F(r.id,`${n}.id`),`${n}.id`),F(r.title,`${n}.title`),F(r.summary,`${n}.summary`),ne(r.backRefs,`${n}.backRefs`,p,`unresolved_target`),I(r.blocks,`${n}.blocks`).forEach((e,t)=>{let r=`${n}.blocks[${t}]`,i=e?.kind;if(i===`text`||i===`code`){let t=P(e,r,[`kind`,`text`],i===`code`?[`language`]:[]);F(t.text,`${r}.text`,!0),t.language!==void 0&&F(t.language,`${r}.language`)}else if(i===`table`){let t=P(e,r,[`kind`,`columns`,`rows`]),n=et(t.columns,`${r}.columns`);n.length||N(r,`invalid_evidence`,`A table needs columns`),I(t.rows,`${r}.rows`).forEach((e,t)=>{let i=I(e,`${r}.rows[${t}]`);i.forEach((e,n)=>F(e,`${r}.rows[${t}][${n}]`,!0)),i.length!==n.length&&N(r,`invalid_evidence`,`Table row width mismatch`)})}else if(i===`references`){let t=P(e,r,[`kind`,`citationRefs`]);ne(t.citationRefs,`${r}.citationRefs`,_,`unresolved_citation`)}else N(`${r}.kind`,`invalid_evidence`,`Unsupported annex block (no decisions or active content)`)}),r}),ae=(e,t)=>c.has(t)?{...e,citationRefs:c.get(t)}:e,oe=d.sections.map((e,t)=>ae(e.kind===`optionSet`?{...e,options:e.options.map((e,n)=>ae(e,`$.sections[${t}].options[${n}]`))}:e,`$.sections[${t}]`));return{ok:!0,value:{...d,schemaVersion:2,sections:oe,sources:h,citations:te,evidenceGroups:re,annexes:ie}}}catch(e){if(e instanceof M)return{ok:!1,issues:[e.issue]};throw e}}var lt=e=>typeof e==`object`&&!!e&&!Array.isArray(e),z=(e,t,n)=>({path:e,code:t,message:n}),B=(e,t,n,r,i,a)=>{if(!lt(e)){a.push(z(t,`invalid_type`,`expected an object`));return}let o=new Set(n);for(let n of Object.keys(e))o.has(n)||a.push(z(`${t}.${n}`,`unknown_field`,`field not in the closed schema`));for(let n of r)e[n]===void 0&&a.push(z(`${t}.${n}`,`missing_field`,`required field is missing`));for(let n of i)e[n]!==void 0&&typeof e[n]!=`string`&&a.push(z(`${t}.${n}`,`invalid_type`,`expected a string`));return e},ut=(e,t,n,r)=>{(typeof e!=`string`||!n.includes(e))&&r.push(z(t,`invalid_enum`,`expected one of: ${n.join(` | `)}`))},dt=[`ref`,`subject`,`title`,`hash`,`cursor`,`sections`,`interactions`,`provenance`,`amendmentTrace`],ft=[`ref`,`subject`,`title`,`hash`,`cursor`],pt=[...dt,`readability`],mt=(e,t,n)=>{let r=n.length,i=B(e,t,[`kind`,`id`,`targetRef`,`label`,`body`,`annotation`,`annotationComment`,`consequence`],[`kind`,`id`,`targetRef`,`label`,`annotation`],[`id`,`targetRef`,`label`,`body`,`annotationComment`,`consequence`],n);if(i!==void 0&&(i.kind!==`option`&&n.push(z(`${t}.kind`,`invalid_discriminator`,`expected "option"`)),ut(i.annotation,`${t}.annotation`,[`none`,`accept`,`reject`,`comment`],n),n.length===r))return{kind:`option`,id:i.id,targetRef:i.targetRef,label:i.label,...typeof i.body==`string`?{body:i.body}:{},annotation:i.annotation,...typeof i.annotationComment==`string`?{annotationComment:i.annotationComment}:{},...typeof i.consequence==`string`?{consequence:i.consequence}:{}}},ht=(e,t,n)=>{let r=n.length,i=B(e,t,[`at`,`author`,`summary`],[`at`,`author`,`summary`],[`at`,`author`,`summary`],n);if(i!==void 0&&n.length===r)return{at:i.at,author:i.author,summary:i.summary}},gt=(e,t,n)=>{if(!lt(e)){n.push(z(t,`invalid_type`,`expected an object`));return}let r=e.kind;if(r!==`prose`&&r!==`question`&&r!==`optionSet`&&r!==`outcome`&&r!==`amendmentTrace`&&r!==`diagram`){n.push(z(`${t}.kind`,r===void 0?`missing_field`:`unknown_node_kind`,`unknown section kind ${typeof r==`string`?`"${r}"`:` discriminant`}`));return}let i=n.length;switch(r){case`prose`:{let r=B(e,t,[`kind`,`id`,`targetRef`,`markdown`,`questionId`],[`kind`,`id`,`targetRef`,`markdown`],[`id`,`targetRef`,`markdown`,`questionId`],n);return r===void 0||n.length!==i?void 0:{kind:`prose`,id:r.id,targetRef:r.targetRef,markdown:r.markdown,...typeof r.questionId==`string`?{questionId:r.questionId}:{}}}case`question`:{let r=B(e,t,[`kind`,`id`,`targetRef`,`question`,`recommendedAnswer`,`answer`,`state`,`context`,`readingTimeMinutes`,`recommendedOptionId`],[`kind`,`id`,`targetRef`,`question`,`state`],[`id`,`targetRef`,`question`,`recommendedAnswer`,`answer`,`context`,`recommendedOptionId`],n);return r===void 0||(ut(r.state,`${t}.state`,[`open`,`answered`,`validated`],n),r.readingTimeMinutes!==void 0&&(typeof r.readingTimeMinutes!=`number`||!Number.isFinite(r.readingTimeMinutes))&&n.push(z(`${t}.readingTimeMinutes`,`invalid_type`,`expected a finite number`)),n.length!==i)?void 0:{kind:`question`,id:r.id,targetRef:r.targetRef,question:r.question,...typeof r.recommendedAnswer==`string`?{recommendedAnswer:r.recommendedAnswer}:{},...typeof r.answer==`string`?{answer:r.answer}:{},state:r.state,...typeof r.context==`string`?{context:r.context}:{},...typeof r.recommendedOptionId==`string`?{recommendedOptionId:r.recommendedOptionId}:{},...typeof r.readingTimeMinutes==`number`?{readingTimeMinutes:r.readingTimeMinutes}:{}}}case`optionSet`:{let r=B(e,t,[`kind`,`id`,`targetRef`,`title`,`options`,`questionId`],[`kind`,`id`,`targetRef`,`options`],[`id`,`targetRef`,`title`,`questionId`],n);if(r===void 0)return;let a=[];return Array.isArray(r.options)?r.options.forEach((e,r)=>{let i=mt(e,`${t}.options[${r}]`,n);i!==void 0&&a.push(i)}):n.push(z(`${t}.options`,`invalid_type`,`expected an array`)),n.length===i?{kind:`optionSet`,id:r.id,targetRef:r.targetRef,...typeof r.title==`string`?{title:r.title}:{},options:a,...typeof r.questionId==`string`?{questionId:r.questionId}:{}}:void 0}case`outcome`:{let r=B(e,t,[`kind`,`id`,`targetRef`,`modality`,`statement`,`questionId`],[`kind`,`id`,`targetRef`,`modality`,`statement`],[`id`,`targetRef`,`statement`,`questionId`],n);return r===void 0||(ut(r.modality,`${t}.modality`,[`decision`,`orientation`,`amendment`,`comment`],n),n.length!==i)?void 0:{kind:`outcome`,id:r.id,targetRef:r.targetRef,modality:r.modality,statement:r.statement,...typeof r.questionId==`string`?{questionId:r.questionId}:{}}}case`amendmentTrace`:{let r=B(e,t,[`kind`,`id`,`targetRef`,`steps`],[`kind`,`id`,`targetRef`,`steps`],[`id`,`targetRef`],n);if(r===void 0)return;let a=[];return Array.isArray(r.steps)?r.steps.forEach((e,r)=>{let i=ht(e,`${t}.steps[${r}]`,n);i!==void 0&&a.push(i)}):n.push(z(`${t}.steps`,`invalid_type`,`expected an array`)),n.length===i?{kind:`amendmentTrace`,id:r.id,targetRef:r.targetRef,steps:a}:void 0}case`diagram`:{let r=B(e,t,[`kind`,`id`,`targetRef`,`syntax`,`source`,`alt`,`scene`],[`kind`,`id`,`targetRef`,`syntax`,`source`,`alt`],[`id`,`targetRef`,`source`,`alt`],n);return r===void 0||(ut(r.syntax,`${t}.syntax`,[`mermaid`,`plantuml`],n),r.scene!==void 0&&!lt(r.scene)&&n.push(z(`${t}.scene`,`invalid_type`,`expected a diagram-core SemanticDocument object`)),n.length!==i)?void 0:{kind:`diagram`,id:r.id,targetRef:r.targetRef,syntax:r.syntax,source:r.source,alt:r.alt,...r.scene===void 0?{}:{scene:r.scene}}}}},_t=(e,t,n)=>{let r=n.length,i=B(e,t,[`name`,`targetRef`,`label`,`enabled`],[`name`,`targetRef`,`label`,`enabled`],[`name`,`targetRef`,`label`],n);if(i!==void 0&&(i.enabled!==!1&&n.push(z(`${t}.enabled`,`enabled_action`,`snapshot interactions must stay disabled (enabled:false)`)),n.length===r))return{name:i.name,targetRef:i.targetRef,label:i.label,enabled:!1}},vt=(e,t,n)=>{let r=n.length,i=B(e,t,[`term`,`definition`],[`term`,`definition`],[`term`,`definition`],n);if(i!==void 0&&n.length===r)return{term:i.term,definition:i.definition}},V=(e,t,n)=>{let r=n.length,i=B(e,t,[`ownerRequestQuote`,`noOwnerRequest`,`stakes`,`stakesLevel`,`readingBudgetMinutes`,`glossary`],[],[`ownerRequestQuote`,`stakes`],n);if(i===void 0)return;i.stakesLevel!==void 0&&ut(i.stakesLevel,`${t}.stakesLevel`,[`low`,`medium`,`high`],n),i.noOwnerRequest!==void 0&&typeof i.noOwnerRequest!=`boolean`&&n.push(z(`${t}.noOwnerRequest`,`invalid_type`,`expected a boolean`)),i.readingBudgetMinutes!==void 0&&(typeof i.readingBudgetMinutes!=`number`||!Number.isFinite(i.readingBudgetMinutes))&&n.push(z(`${t}.readingBudgetMinutes`,`invalid_type`,`expected a finite number`));let a;if(i.glossary!==void 0&&(a=[],Array.isArray(i.glossary)?i.glossary.forEach((e,r)=>{let i=vt(e,`${t}.glossary[${r}]`,n);i!==void 0&&a.push(i)}):n.push(z(`${t}.glossary`,`invalid_type`,`expected an array`))),n.length===r)return{...typeof i.ownerRequestQuote==`string`?{ownerRequestQuote:i.ownerRequestQuote}:{},...typeof i.noOwnerRequest==`boolean`?{noOwnerRequest:i.noOwnerRequest}:{},...typeof i.stakes==`string`?{stakes:i.stakes}:{},...i.stakesLevel===void 0?{}:{stakesLevel:i.stakesLevel},...typeof i.readingBudgetMinutes==`number`?{readingBudgetMinutes:i.readingBudgetMinutes}:{},...a===void 0?{}:{glossary:a}}},yt=e=>{let t=[],n=B(e,`$`,[...pt],[...dt],[...ft],t);if(n===void 0)return{ok:!1,issues:t};let r=[];Array.isArray(n.sections)?n.sections.forEach((e,n)=>{let i=gt(e,`$.sections[${n}]`,t);i!==void 0&&r.push(i)}):t.push(z(`$.sections`,`invalid_type`,`expected an array`));let i=[];Array.isArray(n.interactions)?n.interactions.forEach((e,n)=>{let r=_t(e,`$.interactions[${n}]`,t);r!==void 0&&i.push(r)}):t.push(z(`$.interactions`,`invalid_type`,`expected an array`));let a,o=B(n.provenance,`$.provenance`,[`source`,`readAt`,`comprehensionEvidence`],[`source`,`readAt`],[`source`,`readAt`],t);if(o!==void 0){let e;if(o.comprehensionEvidence!==void 0){let n=t.length,r=B(o.comprehensionEvidence,`$.provenance.comprehensionEvidence`,[`subject`,`dossierHash`,`signature`],[`subject`,`dossierHash`],[`subject`,`dossierHash`,`signature`],t);r!==void 0&&t.length===n&&(e={subject:r.subject,dossierHash:r.dossierHash,...typeof r.signature==`string`?{signature:r.signature}:{}})}a={source:o.source,readAt:o.readAt,...e===void 0?{}:{comprehensionEvidence:e}}}let s=[];Array.isArray(n.amendmentTrace)?n.amendmentTrace.forEach((e,n)=>{let r=ht(e,`$.amendmentTrace[${n}]`,t);r!==void 0&&s.push(r)}):t.push(z(`$.amendmentTrace`,`invalid_type`,`expected an array`));let c;return n.readability!==void 0&&(c=V(n.readability,`$.readability`,t)),t.length>0||a===void 0||n.readability!==void 0&&c===void 0||typeof n.ref!=`string`||typeof n.subject!=`string`||typeof n.title!=`string`||typeof n.hash!=`string`||typeof n.cursor!=`string`?{ok:!1,issues:t}:{ok:!0,value:{ref:n.ref,subject:n.subject,title:n.title,hash:n.hash,cursor:n.cursor,sections:r,interactions:i,provenance:a,amendmentTrace:s,...c===void 0?{}:{readability:c}}}},H=e=>lt(e)&&Object.hasOwn(e,`schemaVersion`)?e.schemaVersion===2?ct(e,yt):{ok:!1,issues:[z(`$.schemaVersion`,`unsupported_version`,`Supported explicit version: 2; omit schemaVersion for legacy v1`)]}:yt(e),bt=e=>{let t=[],n=new Map,r=(e,r)=>{let i=n.get(e);i===void 0?n.set(e,r):t.push(z(r,`duplicate_id`,`node id "${e}" already used at ${i}`))};e.sections.forEach((e,t)=>{let n=`$.sections[${t}]`;r(e.id,`${n}.id`),e.kind===`optionSet`&&e.options.forEach((e,t)=>{r(e.id,`${n}.options[${t}].id`)})});let i=new Set([e.ref]);for(let t of e.sections)if(i.add(t.id),i.add(t.targetRef),t.kind===`optionSet`)for(let e of t.options)i.add(e.id),i.add(e.targetRef);e.interactions.forEach((e,n)=>{i.has(e.targetRef)||t.push(z(`$.interactions[${n}].targetRef`,`unresolved_target`,`interaction target "${e.targetRef}" resolves to no node`))});let a=e.provenance.comprehensionEvidence;return a!==void 0&&a.dossierHash!==e.hash&&t.push(z(`$.provenance.comprehensionEvidence.dossierHash`,`evidence_mismatch`,`comprehension evidence does not match the snapshot hash`)),t},U=e=>{let t=H(e);if(!t.ok)return t;let n=bt(t.value);return n.length>0?{ok:!1,issues:n}:t};function xt(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function St(e){let t=[],n=e=>(t.push(e),`\u0000${t.length-1}\u0000`),r=xt(e);return r=r.replace(/`([^`]+)`/g,(e,t)=>n(`<code>${t}</code>`)),r=r.replace(/\[([^\]]*)\]\((https:\/\/[^)\s]+)\)/g,(e,t,r)=>{let i=r.replace(/"/g,`%22`);return n(`<a href="${i}">${t}</a>`)}),r=r.replace(/\*\*([^*]+)\*\*/g,`<strong>$1</strong>`),r=r.replace(/\*([^*]+)\*/g,`<em>$1</em>`),r.replace(/\u0000(\d+)\u0000/g,(e,n)=>t[Number(n)]??``)}function W(e,t){return e[t]??``}function Ct(e){return/^- /.test(e)}function wt(e){let t=e.replace(/\r\n?/g,`
4
- `).split(`
5
- `),n=[],r=0;for(;r<t.length;){let e=W(t,r);if(e.trim()===``){r+=1;continue}if(Ct(e)){let e=[];for(;r<t.length&&Ct(W(t,r));)e.push(`<li>${St(W(t,r).slice(2))}</li>`),r+=1;n.push(`<ul>\n${e.join(`
6
- `)}\n</ul>`);continue}let i=[];for(;r<t.length;){let e=W(t,r);if(e.trim()===``||Ct(e))break;i.push(St(e)),r+=1}n.push(`<p>${i.join(`
7
- `)}</p>`)}return n.join(`
8
- `)}function Tt(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Et(e){let t=e.startsWith(`$`)?e.slice(1):e,n=[];for(let e of t.matchAll(/([^.[\]]+)|\[(\d+)\]/g)){let t=e[1]??e[2];t!==void 0&&n.push(Tt(t))}return n.length===0?``:`/${n.join(`/`)}`}function G(e){return{source:`focus`,validate(t){let n=e(t);return n.ok?[]:n.issues.map(e=>({code:e.code,message:e.message,pointer:Et(e.path),severity:`error`}))}}}var K=G(U);function q(e){return typeof e==`string`&&e.length>0?e:void 0}var Dt=[`p`,`ul`,`li`,`code`,`a`,`strong`,`em`],Ot=[`href`],kt=/^https:\/\/[^\s"'<>]+$/i;function At(e){return j.sanitize(e,{ALLOWED_TAGS:Dt,ALLOWED_ATTR:Ot,ALLOW_DATA_ATTR:!1,ALLOWED_URI_REGEXP:kt})}function J(e){let t=document.createElement(`div`);return t.className=`st-dossier__prose`,t.innerHTML=At(wt(e)),t}function Y(e,t,n){let r=document.createElement(e);return r.className=t,r.textContent=n,r}function jt(e,t){return e.some(e=>typeof e==`object`&&!!e&&e.name===`choose-option`&&e.targetRef===t&&e.enabled===!1)}function Mt(e,t){let n=q(e.id)??``,r=q(e.label)??``;if(t){let e=Y(`div`,`st-dossier__option st-dossier__option--disabled`,r);return e.setAttribute(`data-option-disabled`,n),e}let i=document.createElement(`button`);i.type=`button`,i.className=`st-dossier__option`,i.setAttribute(`data-option-id`,n),i.append(Y(`span`,`st-dossier__optionLabel`,r));let a=q(e.body);a!==void 0&&i.append(Y(`span`,`st-dossier__optionBody`,a));let o=q(e.annotation);return o!==void 0&&o!==`none`&&i.append(Y(`span`,`st-dossier__optionAnnotation`,o)),i}function Nt(e,t){let n=q(e.kind)??``;if(n===`prose`)return J(q(e.markdown)??``);if(n===`question`){let t=document.createElement(`div`);t.className=`st-dossier__question`,t.setAttribute(`data-st-question`,q(e.id)??``);let n=Y(`h3`,`st-dossier__questionText`,q(e.question)??``);n.setAttribute(`data-st-question-text`,``),t.append(n);let r=q(e.state);if(r!==void 0){let e=Y(`span`,`st-dossier__state`,r);e.setAttribute(`data-st-question-state`,r),t.append(e)}return t}if(n===`optionSet`){let n=document.createElement(`div`);n.className=`st-dossier__options`,n.setAttribute(`data-st-option-set`,q(e.id)??``);let r=q(e.title);r!==void 0&&n.append(Y(`h4`,`st-dossier__optionsTitle`,r));let i=Array.isArray(e.options)?e.options:[];for(let e of i)if(typeof e==`object`&&e){let r=e;n.append(Mt(r,jt(t,q(r.id)??``)))}return n}if(n===`outcome`){let t=document.createElement(`div`);t.className=`st-dossier__outcome`,t.setAttribute(`data-st-outcome`,q(e.id)??``);let n=Y(`p`,`st-dossier__outcomeText`,q(e.statement)??``);n.setAttribute(`data-st-outcome-statement`,``),t.append(n);let r=q(e.modality);return r!==void 0&&t.append(Y(`span`,`st-dossier__modality`,r)),t}if(n===`amendmentTrace`){let t=document.createElement(`ol`);t.className=`st-dossier__trace`,t.setAttribute(`data-st-trace`,q(e.id)??``);let n=Array.isArray(e.steps)?e.steps:[];for(let e of n)if(typeof e==`object`&&e){let n=e,r=q(n.at)??``,i=q(n.author)??``,a=Y(`li`,`st-dossier__traceStep`,q(n.summary)??``);a.setAttribute(`data-st-trace-step`,`${r} ${i}`.trim()),t.append(a)}return t}if(n===`diagram`){let t=document.createElement(`figure`);t.className=`st-dossier__diagram`,t.setAttribute(`data-st-diagram`,q(e.id)??``);let n=q(e.alt);n!==void 0&&t.append(Y(`figcaption`,`st-dossier__diagramAlt`,n));let r=Y(`pre`,`st-dossier__diagramSource`,q(e.source)??``);return r.setAttribute(`data-st-diagram-source`,``),t.append(r),t}return Y(`div`,`st-dossier__unknownSection`,n)}function Pt(e,t,n){let r=t??{},i=Array.isArray(r.sections)?r.sections:[],a=Array.isArray(r.interactions)?r.interactions:[],o=document.createElement(`article`);o.className=`st-dossier`,o.setAttribute(`data-st-dossier`,``);let s=document.createElement(`header`);s.className=`st-dossier__header`;let c=q(r.subject);c!==void 0&&s.append(Y(`p`,`st-dossier__subject`,c)),s.append(Y(`h2`,`st-dossier__title`,q(r.title)??``)),s.setAttribute(`data-st-dossier-title`,``),o.append(s);for(let e of i)typeof e==`object`&&e&&o.append(Nt(e,a));let l=Array.isArray(r.amendmentTrace)?r.amendmentTrace:[];if(l.length>0){let e=document.createElement(`footer`);e.className=`st-dossier__traceFooter`,e.setAttribute(`data-st-trace-footer`,``);for(let t of l)if(typeof t==`object`&&t){let n=t,r=Y(`p`,`st-dossier__traceEntry`,q(n.summary)??``);r.setAttribute(`data-st-trace-at`,q(n.at)??``),e.append(r)}o.append(e)}let u=q((r.provenance??{}).source);if(u!==void 0){let e=Y(`p`,`st-dossier__provenance`,u);e.setAttribute(`data-st-provenance`,u),o.append(e)}let d=t=>{let r=t.target;if(!(r instanceof Element))return;let i=r.closest(`[data-option-id]`);i!==null&&e.contains(i)&&n(i.getAttribute(`data-option-id`)??``)};return e.addEventListener(`click`,d),e.replaceChildren(o),()=>{e.removeEventListener(`click`,d),e.replaceChildren()}}export{K as port,Pt as renderDossier,At as renderMarkdownToSafeHtml};