@pi-outpost/embed 0.60.1 → 0.61.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.
@@ -1,4 +1,4 @@
1
- const e=require("./conversationHistory-V6AR3Ga4.cjs"),t=require("./lib-CRTt_FoR.cjs"),n=require("./download-U7JEZ6c9.cjs"),r=require("./mermaidToImage-B7I6iJ9s.cjs"),i=require("./loadReferencedImage-D47xCpa7.cjs");var a=/["&'<>`]/g,o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,s=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,c=/[|\\{}()[\]^$+*?.]/g,l=new WeakMap;function u(e,t){return e=e.replace(t.subset?d(t.subset):a,r),t.subset||t.escapeOnly?e:e.replace(o,n).replace(s,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function d(e){let t=l.get(e);return t||(t=ee(e),l.set(e,t)),t}function ee(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(c,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var f=/[\dA-Fa-f]/;function p(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!f.test(String.fromCharCode(t))?r:r+`;`}var m=/\d/;function te(e,t,n){let r=`&#`+String(e);return n&&t&&!m.test(String.fromCharCode(t))?r:r+`;`}var ne=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),h={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},re=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],g={}.hasOwnProperty,_={},v;for(v in h)g.call(h,v)&&(_[h[v]]=v);var y=/[^\dA-Za-z]/;function b(e,t,n,r){let i=String.fromCharCode(e);if(g.call(_,i)){let e=_[i],a=`&`+e;return n&&ne.includes(e)&&!re.includes(e)&&(!r||t&&t!==61&&y.test(String.fromCharCode(t)))?a:a+`;`}return``}function ie(e,t,n){let r=p(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=b(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=te(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function x(e,t){return u(e,Object.assign({format:ie},t))}var ae=/^>|^->|<!--|-->|--!>|<!-$/g,oe=[`>`],se=[`<`,`>`];function ce(e,t,n,r){return r.settings.bogusComments?`<?`+x(e.value,Object.assign({},r.settings.characterReferences,{subset:oe}))+`>`:`<!--`+e.value.replace(ae,i)+`-->`;function i(e){return x(e,Object.assign({},r.settings.characterReferences,{subset:se}))}}function le(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var S=w(1),C=w(-1),ue=[];function w(t){return n;function n(n,r,i){let a=n?n.children:ue,o=(r||0)+t,s=a[o];if(!i)for(;s&&e.C(s);)o+=t,s=a[o];return s}}var T={}.hasOwnProperty;function E(e){return t;function t(t,n,r){return T.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var D=E({body:A,caption:O,colgroup:O,dd:P,dt:N,head:O,html:k,li:M,optgroup:I,option:L,p:j,rp:F,rt:F,tbody:z,td:H,tfoot:B,th:H,thead:R,tr:V});function O(t,n,r){let i=S(r,n,!0);return!i||i.type!==`comment`&&!(i.type===`text`&&e.C(i.value.charAt(0)))}function k(e,t,n){let r=S(n,t);return!r||r.type!==`comment`}function A(e,t,n){let r=S(n,t);return!r||r.type!==`comment`}function j(e,t,n){let r=S(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function M(e,t,n){let r=S(n,t);return!r||r.type===`element`&&r.tagName===`li`}function N(e,t,n){let r=S(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function P(e,t,n){let r=S(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function F(e,t,n){let r=S(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function I(e,t,n){let r=S(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function L(e,t,n){let r=S(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function R(e,t,n){let r=S(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function z(e,t,n){let r=S(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function B(e,t,n){return!S(n,t)}function V(e,t,n){let r=S(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function H(e,t,n){let r=S(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var U=E({body:pe,colgroup:me,head:fe,html:de,tbody:he});function de(e){let t=S(e,-1);return!t||t.type!==`comment`}function fe(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function pe(t){let n=S(t,-1,!0);return!n||n.type!==`comment`&&!(n.type===`text`&&e.C(n.value.charAt(0)))&&(n.type!==`element`||n.tagName!==`meta`&&n.tagName!==`link`&&n.tagName!==`script`&&n.tagName!==`style`&&n.tagName!==`template`)}function me(e,t,n){let r=C(n,t),i=S(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&D(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function he(e,t,n){let r=C(n,t),i=S(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&D(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var W={name:[[`
1
+ const e=require("./conversationHistory-BgnXSxWk.cjs"),t=require("./lib-CRTt_FoR.cjs"),n=require("./download-CVl_k6EM.cjs"),r=require("./mermaidToImage-B7I6iJ9s.cjs"),i=require("./loadReferencedImage-D47xCpa7.cjs");var a=/["&'<>`]/g,o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,s=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,c=/[|\\{}()[\]^$+*?.]/g,l=new WeakMap;function u(e,t){return e=e.replace(t.subset?d(t.subset):a,r),t.subset||t.escapeOnly?e:e.replace(o,n).replace(s,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function d(e){let t=l.get(e);return t||(t=ee(e),l.set(e,t)),t}function ee(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(c,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var f=/[\dA-Fa-f]/;function p(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!f.test(String.fromCharCode(t))?r:r+`;`}var m=/\d/;function te(e,t,n){let r=`&#`+String(e);return n&&t&&!m.test(String.fromCharCode(t))?r:r+`;`}var ne=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),h={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},re=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],g={}.hasOwnProperty,_={},v;for(v in h)g.call(h,v)&&(_[h[v]]=v);var y=/[^\dA-Za-z]/;function b(e,t,n,r){let i=String.fromCharCode(e);if(g.call(_,i)){let e=_[i],a=`&`+e;return n&&ne.includes(e)&&!re.includes(e)&&(!r||t&&t!==61&&y.test(String.fromCharCode(t)))?a:a+`;`}return``}function ie(e,t,n){let r=p(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=b(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=te(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function x(e,t){return u(e,Object.assign({format:ie},t))}var ae=/^>|^->|<!--|-->|--!>|<!-$/g,oe=[`>`],se=[`<`,`>`];function ce(e,t,n,r){return r.settings.bogusComments?`<?`+x(e.value,Object.assign({},r.settings.characterReferences,{subset:oe}))+`>`:`<!--`+e.value.replace(ae,i)+`-->`;function i(e){return x(e,Object.assign({},r.settings.characterReferences,{subset:se}))}}function le(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var S=w(1),C=w(-1),ue=[];function w(t){return n;function n(n,r,i){let a=n?n.children:ue,o=(r||0)+t,s=a[o];if(!i)for(;s&&e.T(s);)o+=t,s=a[o];return s}}var T={}.hasOwnProperty;function E(e){return t;function t(t,n,r){return T.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var D=E({body:A,caption:O,colgroup:O,dd:P,dt:N,head:O,html:k,li:M,optgroup:I,option:L,p:j,rp:F,rt:F,tbody:z,td:H,tfoot:B,th:H,thead:R,tr:V});function O(t,n,r){let i=S(r,n,!0);return!i||i.type!==`comment`&&!(i.type===`text`&&e.T(i.value.charAt(0)))}function k(e,t,n){let r=S(n,t);return!r||r.type!==`comment`}function A(e,t,n){let r=S(n,t);return!r||r.type!==`comment`}function j(e,t,n){let r=S(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function M(e,t,n){let r=S(n,t);return!r||r.type===`element`&&r.tagName===`li`}function N(e,t,n){let r=S(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function P(e,t,n){let r=S(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function F(e,t,n){let r=S(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function I(e,t,n){let r=S(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function L(e,t,n){let r=S(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function R(e,t,n){let r=S(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function z(e,t,n){let r=S(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function B(e,t,n){return!S(n,t)}function V(e,t,n){let r=S(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function H(e,t,n){let r=S(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var U=E({body:pe,colgroup:me,head:fe,html:de,tbody:he});function de(e){let t=S(e,-1);return!t||t.type!==`comment`}function fe(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function pe(t){let n=S(t,-1,!0);return!n||n.type!==`comment`&&!(n.type===`text`&&e.T(n.value.charAt(0)))&&(n.type!==`element`||n.tagName!==`meta`&&n.tagName!==`link`&&n.tagName!==`script`&&n.tagName!==`style`&&n.tagName!==`template`)}function me(e,t,n){let r=C(n,t),i=S(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&D(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function he(e,t,n){let r=C(n,t),i=S(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&D(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var W={name:[[`
2
2
  \f\r &/=>`.split(``),`
3
3
  \f\r "&'/=>\``.split(``)],[`\0
4
4
  \f\r "&'/<=>`.split(``),`\0
@@ -6,7 +6,7 @@ const e=require("./conversationHistory-V6AR3Ga4.cjs"),t=require("./lib-CRTt_FoR.
6
6
  \f\r &>`.split(``),`\0
7
7
  \f\r "&'<=>\``.split(``)],[`\0
8
8
  \f\r "&'<=>\``.split(``),`\0
9
- \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function ge(t,n,r,i){let a=i.schema,o=a.space!==`svg`&&i.settings.omitOptionalTags,s=a.space===`svg`?i.settings.closeEmptyElements:i.settings.voids.includes(t.tagName.toLowerCase()),c=[],l;a.space===`html`&&t.tagName===`svg`&&(i.schema=e.x);let u=_e(i,t.properties),d=i.all(a.space===`html`&&t.tagName===`template`?t.content:t);return i.schema=a,d&&(s=!1),(u||!o||!U(t,n,r))&&(c.push(`<`,t.tagName,u?` `+u:``),s&&(a.space===`svg`||i.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!i.settings.tightSelfClosing||l===`/`||l&&l!==`"`&&l!==`'`)&&c.push(` `),c.push(`/`)),c.push(`>`)),c.push(d),!s&&(!o||!D(t,n,r))&&c.push(`</`+t.tagName+`>`),c.join(``)}function _e(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=ve(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function ve(n,r,i){let a=e.S(n.schema,r),o=n.settings.allowParseErrors&&n.schema.space===`html`?0:1,s=+!n.settings.allowDangerousCharacters,c=n.quote,l;if(a.overloadedBoolean&&(i===a.attribute||i===``)?i=!0:(a.boolean||a.overloadedBoolean)&&(typeof i!=`string`||i===a.attribute||i===``)&&(i=!!i),i==null||i===!1||typeof i==`number`&&Number.isNaN(i))return``;let u=x(a.attribute,Object.assign({},n.settings.characterReferences,{subset:W.name[o][s]}));return i===!0||(i=Array.isArray(i)?(a.commaSeparated?e.w:e.y)(i,{padLeft:!n.settings.tightCommaSeparatedLists}):String(i),n.settings.collapseEmptyAttributes&&!i)?u:(n.settings.preferUnquoted&&(l=x(i,Object.assign({},n.settings.characterReferences,{attribute:!0,subset:W.unquoted[o][s]}))),l!==i&&(n.settings.quoteSmart&&t.r(i,c)>t.r(i,n.alternative)&&(c=n.alternative),l=c+x(i,Object.assign({},n.settings.characterReferences,{subset:(c===`'`?W.single:W.double)[o][s],attribute:!0}))+c),u+(l&&`=`+l))}var ye=[`<`,`&`];function G(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:x(e.value,Object.assign({},r.settings.characterReferences,{subset:ye}))}function be(e,t,n,r){return r.settings.allowDangerousHtml?e.value:G(e,t,n,r)}function xe(e,t,n,r){return r.all(e)}var Se=e.h(`type`,{invalid:Ce,unknown:we,handlers:{comment:ce,doctype:le,element:ge,raw:be,root:xe,text:G}});function Ce(e){throw Error("Expected node, not `"+e+"`")}function we(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Te={},Ee={},De=[];function Oe(t,n){let r=n||Te,i=r.quote||`"`,a=i===`"`?`'`:`"`;if(i!==`"`&&i!==`'`)throw Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:ke,all:Ae,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||e.m,characterReferences:r.characterReferences||Ee,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space===`svg`?e.x:e.b,quote:i,alternative:a}.one(Array.isArray(t)?{type:`root`,children:t}:t,void 0,void 0)}function ke(e,t,n){return Se(e,t,n,this)}function Ae(e){let t=[],n=e&&e.children||De,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var je=class extends Error{bytes;budgetBytes;constructor(e,t){super(`the conversation's images come to ${Math.round(e/1024)} kB, over the ${Math.round(t/1024)} kB this export embeds`),this.name=`ExportBudgetError`,this.bytes=e,this.budgetBytes=t}},K=t.i().use(t.u).use(t.n).use(t.t).use(e.v,{allowDangerousHtml:!0}).use(e.p).use(e.f,e.o).use(e.g,{output:`mathml`});function Me(e){let t=e.properties?.className;return(Array.isArray(t)?t.map(String):typeof t==`string`?[t]:[]).find(e=>e.startsWith(`language-`))?.slice(9)}async function q(e,t,n){if(e.tagName===`img`){let i=typeof e.properties?.src==`string`?e.properties.src:``;if(r.u(i)){let t=typeof e.properties?.alt==`string`?e.properties.alt:``;return{type:`element`,tagName:`a`,properties:{href:i},children:[{type:`text`,value:r.l(i,t)}]}}let a=i?await t.loadImage(i):void 0;if(!a)return{type:`element`,tagName:`em`,properties:{},children:[{type:`text`,value:`[image: ${typeof e.properties?.alt==`string`?e.properties.alt:i}]`}]};n.bytes+=a.bytes;let o=t.budgetBytes??41943040;if(n.bytes>o)throw new je(n.bytes,o);return{...e,properties:{...e.properties,src:a.dataUrl,loading:`lazy`}}}if(e.tagName===`pre`&&e.children?.length===1&&e.children[0].tagName===`code`){let r=e.children[0];if(Me(r)===`mermaid`&&t.renderDiagram){let e=J(r);n.diagrams+=1;let i=await t.renderDiagram(e,`pi-export-diagram-${n.diagrams}`);if(i)return{type:`element`,tagName:`figure`,properties:{className:[`diagram`]},children:[{type:`raw`,value:i}]}}}if(!e.children)return e;let i=[];for(let r of e.children)i.push(await q(r,t,n));return{...e,children:i}}function J(e){return e.type===`text`?e.value??``:(e.children??[]).map(J).join(``)}async function Y(e,n,r){return Oe(await q(await K.run(K.parse(t.g(e))),n,r),{allowDangerousHtml:!0})}function X(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}var Z=`:root {
9
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function ge(t,n,r,i){let a=i.schema,o=a.space!==`svg`&&i.settings.omitOptionalTags,s=a.space===`svg`?i.settings.closeEmptyElements:i.settings.voids.includes(t.tagName.toLowerCase()),c=[],l;a.space===`html`&&t.tagName===`svg`&&(i.schema=e.C);let u=_e(i,t.properties),d=i.all(a.space===`html`&&t.tagName===`template`?t.content:t);return i.schema=a,d&&(s=!1),(u||!o||!U(t,n,r))&&(c.push(`<`,t.tagName,u?` `+u:``),s&&(a.space===`svg`||i.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!i.settings.tightSelfClosing||l===`/`||l&&l!==`"`&&l!==`'`)&&c.push(` `),c.push(`/`)),c.push(`>`)),c.push(d),!s&&(!o||!D(t,n,r))&&c.push(`</`+t.tagName+`>`),c.join(``)}function _e(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=ve(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function ve(n,r,i){let a=e.w(n.schema,r),o=n.settings.allowParseErrors&&n.schema.space===`html`?0:1,s=+!n.settings.allowDangerousCharacters,c=n.quote,l;if(a.overloadedBoolean&&(i===a.attribute||i===``)?i=!0:(a.boolean||a.overloadedBoolean)&&(typeof i!=`string`||i===a.attribute||i===``)&&(i=!!i),i==null||i===!1||typeof i==`number`&&Number.isNaN(i))return``;let u=x(a.attribute,Object.assign({},n.settings.characterReferences,{subset:W.name[o][s]}));return i===!0||(i=Array.isArray(i)?(a.commaSeparated?e.E:e.x)(i,{padLeft:!n.settings.tightCommaSeparatedLists}):String(i),n.settings.collapseEmptyAttributes&&!i)?u:(n.settings.preferUnquoted&&(l=x(i,Object.assign({},n.settings.characterReferences,{attribute:!0,subset:W.unquoted[o][s]}))),l!==i&&(n.settings.quoteSmart&&t.r(i,c)>t.r(i,n.alternative)&&(c=n.alternative),l=c+x(i,Object.assign({},n.settings.characterReferences,{subset:(c===`'`?W.single:W.double)[o][s],attribute:!0}))+c),u+(l&&`=`+l))}var ye=[`<`,`&`];function G(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:x(e.value,Object.assign({},r.settings.characterReferences,{subset:ye}))}function be(e,t,n,r){return r.settings.allowDangerousHtml?e.value:G(e,t,n,r)}function xe(e,t,n,r){return r.all(e)}var Se=e._(`type`,{invalid:Ce,unknown:we,handlers:{comment:ce,doctype:le,element:ge,raw:be,root:xe,text:G}});function Ce(e){throw Error("Expected node, not `"+e+"`")}function we(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Te={},Ee={},De=[];function Oe(t,n){let r=n||Te,i=r.quote||`"`,a=i===`"`?`'`:`"`;if(i!==`"`&&i!==`'`)throw Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:ke,all:Ae,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||e.g,characterReferences:r.characterReferences||Ee,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space===`svg`?e.C:e.S,quote:i,alternative:a}.one(Array.isArray(t)?{type:`root`,children:t}:t,void 0,void 0)}function ke(e,t,n){return Se(e,t,n,this)}function Ae(e){let t=[],n=e&&e.children||De,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var je=class extends Error{bytes;budgetBytes;constructor(e,t){super(`the conversation's images come to ${Math.round(e/1024)} kB, over the ${Math.round(t/1024)} kB this export embeds`),this.name=`ExportBudgetError`,this.bytes=e,this.budgetBytes=t}},K=t.i().use(t.u).use(t.n).use(t.t).use(e.b,{allowDangerousHtml:!0}).use(e.h).use(e.m,e.c).use(e.v,{output:`mathml`});function Me(e){let t=e.properties?.className;return(Array.isArray(t)?t.map(String):typeof t==`string`?[t]:[]).find(e=>e.startsWith(`language-`))?.slice(9)}async function q(e,t,n){if(e.tagName===`img`){let i=typeof e.properties?.src==`string`?e.properties.src:``;if(r.u(i)){let t=typeof e.properties?.alt==`string`?e.properties.alt:``;return{type:`element`,tagName:`a`,properties:{href:i},children:[{type:`text`,value:r.l(i,t)}]}}let a=i?await t.loadImage(i):void 0;if(!a)return{type:`element`,tagName:`em`,properties:{},children:[{type:`text`,value:`[image: ${typeof e.properties?.alt==`string`?e.properties.alt:i}]`}]};n.bytes+=a.bytes;let o=t.budgetBytes??41943040;if(n.bytes>o)throw new je(n.bytes,o);return{...e,properties:{...e.properties,src:a.dataUrl,loading:`lazy`}}}if(e.tagName===`pre`&&e.children?.length===1&&e.children[0].tagName===`code`){let r=e.children[0];if(Me(r)===`mermaid`&&t.renderDiagram){let e=J(r);n.diagrams+=1;let i=await t.renderDiagram(e,`pi-export-diagram-${n.diagrams}`);if(i)return{type:`element`,tagName:`figure`,properties:{className:[`diagram`]},children:[{type:`raw`,value:i}]}}}if(!e.children)return e;let i=[];for(let r of e.children)i.push(await q(r,t,n));return{...e,children:i}}function J(e){return e.type===`text`?e.value??``:(e.children??[]).map(J).join(``)}async function Y(e,n,r){return Oe(await q(await K.run(K.parse(t.g(e))),n,r),{allowDangerousHtml:!0})}function X(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function Ne(t){return e.a(t).map(e=>{let t=[e.color?`color:${e.color}`:``,e.bold?`font-weight:600`:``,e.dim?`opacity:0.7`:``,e.italic?`font-style:italic`:``,e.underline?`text-decoration:underline`:``].filter(Boolean).join(`;`),n=X(e.text);return t?`<span style="${X(t)}">${n}</span>`:n}).join(``)}var Pe=`:root {
10
10
  --bg: #ffffff; --fg: #18181b; --muted: #71717a; --line: #e4e4e7;
11
11
  --user-bg: #eff6ff; --tool-bg: #fafafa; --mark-bg: #fffbeb; --mark-fg: #92400e;
12
12
  }
@@ -44,16 +44,16 @@ figure.diagram { margin: 1rem 0; overflow-x: auto; }
44
44
  table { border-collapse: collapse; width: 100%; }
45
45
  th, td { border: 1px solid var(--line); padding: 0.3rem 0.5rem; text-align: left; }
46
46
  blockquote { margin: 0.8rem 0; padding-left: 0.9rem; border-left: 3px solid var(--line); color: var(--muted); }
47
- footer.doc { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 0.8rem; font-size: 0.75rem; color: var(--muted); }`,Q={user:`You`,assistant:`Agent`};async function Ne(e,t,n){switch(e.kind){case`user`:{let r=(e.images??[]).map(e=>`<img src="data:${X(e.mimeType)};base64,${e.data}" alt="attached image" />`).join(`
48
- `),i=await Y(e.text,t,n);return`<article class="user"><p class="who">${Q.user}</p><div class="body">${i}${r}</div></article>`}case`assistant`:{let r=[];for(let i of e.blocks){let e=await Y(i.text,t,n);r.push(i.type===`thinking`?`<div class="body"><p class="who">reasoning</p>${e}</div>`:`<div class="body">${e}</div>`)}let i=e.errorMessage?`<p class="body"><em>${X(e.errorMessage)}</em></p>`:``;return`<article class="${e.blocks.every(e=>e.type===`thinking`)?`assistant reasoning`:`assistant`}"><p class="who">${Q.assistant}</p>${r.join(`
49
- `)}${i}</article>`}case`tool`:{let t=typeof e.args==`string`?e.args:JSON.stringify(e.args??{},null,2),n=e.isError?` — failed`:``;return[`<article class="tool"><details class="tool">`,`<summary>${X(e.toolName)}${n}</summary>`,`<pre><code>${X(t)}</code></pre>`,`<pre><code>${X(e.output)}</code></pre>`,`</details></article>`].join(``)}case`custom`:return`<article class="custom"><p class="who">${X(e.customType)}</p><div class="body"><pre><code>${X(e.text)}</code></pre></div></article>`;case`compaction`:{let r=e.tokensBefore?` — ${Math.round(e.tokensBefore/1e3)}k tokens summarised`:``,i=e.summary?`<div class="compaction-summary">${await Y(e.summary,t,n)}</div>`:``;return`<div class="compaction">conversation compacted here${X(r)}</div>${i}`}}}async function Pe(e,t){let n={bytes:0,diagrams:0},r=[];for(let[i,a]of e.entries())r.push(await Ne(a,t,n)),t.onProgress?.(i+1,e.length);let{meta:i}=t,a=i.project?`${i.session} — ${i.project}`:i.session,o=[];return i.project&&o.push(`<dt>Project</dt><dd>${X(i.project)}</dd>`),o.push(`<dt>Session</dt><dd>${X(i.session)}</dd>`),i.model&&o.push(`<dt>Model</dt><dd>${X(i.model)}</dd>`),o.push(`<dt>Exported</dt><dd>${X(i.exportedAt.toISOString().slice(0,10))}</dd>`),o.push(`<dt>Messages</dt><dd>${e.length}</dd>`),`<!doctype html>
47
+ footer.doc { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 0.8rem; font-size: 0.75rem; color: var(--muted); }`,Z={user:`You`,assistant:`Agent`};async function Fe(e,t,n){switch(e.kind){case`user`:{let r=(e.images??[]).map(e=>`<img src="data:${X(e.mimeType)};base64,${e.data}" alt="attached image" />`).join(`
48
+ `),i=await Y(e.text,t,n);return`<article class="user"><p class="who">${Z.user}</p><div class="body">${i}${r}</div></article>`}case`assistant`:{let r=[];for(let i of e.blocks){let e=await Y(i.text,t,n);r.push(i.type===`thinking`?`<div class="body"><p class="who">reasoning</p>${e}</div>`:`<div class="body">${e}</div>`)}let i=e.errorMessage?`<p class="body"><em>${X(e.errorMessage)}</em></p>`:``;return`<article class="${e.blocks.every(e=>e.type===`thinking`)?`assistant reasoning`:`assistant`}"><p class="who">${Z.assistant}</p>${r.join(`
49
+ `)}${i}</article>`}case`tool`:{let t=typeof e.args==`string`?e.args:JSON.stringify(e.args??{},null,2),n=e.isError?` — failed`:``;return[`<article class="tool"><details class="tool">`,`<summary>${X(e.toolName)}${n}</summary>`,`<pre><code>${X(t)}</code></pre>`,`<pre><code>${Ne(e.output)}</code></pre>`,`</details></article>`].join(``)}case`custom`:return`<article class="custom"><p class="who">${X(e.customType)}</p><div class="body"><pre><code>${X(e.text)}</code></pre></div></article>`;case`compaction`:{let r=e.tokensBefore?` — ${Math.round(e.tokensBefore/1e3)}k tokens summarised`:``,i=e.summary?`<div class="compaction-summary">${await Y(e.summary,t,n)}</div>`:``;return`<div class="compaction">conversation compacted here${X(r)}</div>${i}`}}}async function Q(e,t){let n={bytes:0,diagrams:0},r=[];for(let[i,a]of e.entries())r.push(await Fe(a,t,n)),t.onProgress?.(i+1,e.length);let{meta:i}=t,a=i.project?`${i.session} — ${i.project}`:i.session,o=[];return i.project&&o.push(`<dt>Project</dt><dd>${X(i.project)}</dd>`),o.push(`<dt>Session</dt><dd>${X(i.session)}</dd>`),i.model&&o.push(`<dt>Model</dt><dd>${X(i.model)}</dd>`),o.push(`<dt>Exported</dt><dd>${X(i.exportedAt.toISOString().slice(0,10))}</dd>`),o.push(`<dt>Messages</dt><dd>${e.length}</dd>`),`<!doctype html>
50
50
  <html lang="en">
51
51
  <head>
52
52
  <meta charset="utf-8" />
53
53
  <meta name="viewport" content="width=device-width, initial-scale=1" />
54
54
  <title>${X(a)}</title>
55
55
  <style>
56
- ${Z}
56
+ ${Pe}
57
57
  </style>
58
58
  </head>
59
59
  <body>
@@ -68,4 +68,4 @@ ${r.join(`
68
68
  </main>
69
69
  </body>
70
70
  </html>
71
- `}var $=class extends Error{constructor(e){super(e),this.name=`ConversationExportError`}};async function Fe(e){let t=new Map;return async n=>{if(t.has(n))return t.get(n);let r=i.n(``,n,e.serverUrl,e.token,e.workspace),a;if(r!==void 0)try{let e=await fetch(r);if(e.ok){let t=new Uint8Array(await e.arrayBuffer());a={dataUrl:`data:${e.headers.get(`content-type`)??`application/octet-stream`};base64,${Ie(t)}`,bytes:t.byteLength}}}catch{a=void 0}return t.set(n,a),a}}function Ie(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t)}async function Le(e,t){try{let{svg:n}=await r.a(e,t),{width:i,height:a}=r.o(n);return r.n(r.s(n,i,a))}catch{return}}function Re(e,t){let n=e.normalize(`NFKD`).replace(/[^\p{L}\p{N}\s-]/gu,``).trim().replace(/\s+/g,`-`).slice(0,60),r=t.toISOString().slice(0,10);return`${n||`conversation`}-${r}.html`}async function ze(t){if(t.items.length===0)throw new $(`there is no conversation to export yet`);let n=[];if(t.olderItems>0){if(!t.fetchOlderItems)throw new $(`this conversation has been compacted and the agent runtime cannot read back what it removed, so it cannot be exported in full`);try{n=await e.n(t.fetchOlderItems,e=>t.onProgress?.(`collecting`,e,t.olderItems))}catch(e){throw new $(`the earlier part of the conversation could not be read back, so nothing was exported: ${e instanceof Error?e.message:String(e)}`)}}return Pe([...n,...t.items],{meta:t.meta,loadImage:await Fe(t.connection),renderDiagram:Le,budgetBytes:t.budgetBytes??41943040,onProgress:(e,n)=>t.onProgress?.(`rendering`,e,n)})}async function Be(e){let t=await ze(e);n.t(new Blob([t],{type:`text/html;charset=utf-8`}),Re(e.meta.session,e.meta.exportedAt))}exports.exportConversation=Be;
71
+ `}var $=class extends Error{constructor(e){super(e),this.name=`ConversationExportError`}};async function Ie(e){let t=new Map;return async n=>{if(t.has(n))return t.get(n);let r=i.n(``,n,e.serverUrl,e.token,e.workspace),a;if(r!==void 0)try{let e=await fetch(r);if(e.ok){let t=new Uint8Array(await e.arrayBuffer());a={dataUrl:`data:${e.headers.get(`content-type`)??`application/octet-stream`};base64,${Le(t)}`,bytes:t.byteLength}}}catch{a=void 0}return t.set(n,a),a}}function Le(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t)}async function Re(e,t){try{let{svg:n}=await r.a(e,t),{width:i,height:a}=r.o(n);return r.n(r.s(n,i,a))}catch{return}}function ze(e,t){let n=e.normalize(`NFKD`).replace(/[^\p{L}\p{N}\s-]/gu,``).trim().replace(/\s+/g,`-`).slice(0,60),r=t.toISOString().slice(0,10);return`${n||`conversation`}-${r}.html`}async function Be(t){if(t.items.length===0)throw new $(`there is no conversation to export yet`);let n=[];if(t.olderItems>0){if(!t.fetchOlderItems)throw new $(`this conversation has been compacted and the agent runtime cannot read back what it removed, so it cannot be exported in full`);try{n=await e.n(t.fetchOlderItems,e=>t.onProgress?.(`collecting`,e,t.olderItems))}catch(e){throw new $(`the earlier part of the conversation could not be read back, so nothing was exported: ${e instanceof Error?e.message:String(e)}`)}}return Q([...n,...t.items],{meta:t.meta,loadImage:await Ie(t.connection),renderDiagram:Re,budgetBytes:t.budgetBytes??41943040,onProgress:(e,n)=>t.onProgress?.(`rendering`,e,n)})}async function Ve(e){let t=await Be(e);n.n(new Blob([t],{type:`text/html;charset=utf-8`}),ze(e.meta.session,e.meta.exportedAt))}exports.exportConversation=Ve;
@@ -1,4 +1,4 @@
1
- const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./lib-CRTt_FoR.cjs"),n=require("./workspacePath-BdmjN0W2.cjs"),r=require("./download-U7JEZ6c9.cjs"),i=require("./katex-C-T_oEhv.cjs");let a=require("react"),o=require("react/jsx-runtime"),s=require("react-dom");var c=(0,a.createContext)(`dark`),l=()=>(0,a.useContext)(c);function u({text:e,className:t,iconOnly:n=!1}){let[r,i]=(0,a.useState)(!1);async function s(){try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}}return(0,o.jsx)(`button`,{type:`button`,onClick:s,title:r?`Copied!`:n?`Copy code`:`Copy`,"aria-label":n?r?`Copied`:`Copy code`:void 0,className:t??`rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:n?r?`✓`:`⧉`:r?`✓ copied`:`⧉ copy`})}function d(e){if(e==null)return;if(!(e.getRootNode()instanceof ShadowRoot))return globalThis.document.body;let t=e;for(;t.parentElement!==null;)t=t.parentElement;return t}function f({label:e,open:t,onClose:n,children:r,actions:i,containerRef:c,anchorRef:l,testId:u=`structured-enlarged`}){(0,a.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,n]);let f=(0,a.useRef)(void 0);return f.current=d(l?.current)??f.current,t?(0,s.createPortal)((0,o.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`${e}, full size`,"data-testid":u,onClick:n,className:`fixed inset-0 z-[100] flex items-center justify-center overflow-hidden bg-black/60 p-6`,children:(0,o.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`flex max-h-full min-w-0 w-auto max-w-[95vw] flex-col overflow-hidden rounded-lg bg-white p-4 shadow-xl dark:bg-zinc-900`,children:[(0,o.jsxs)(`div`,{className:`mb-2 flex shrink-0 items-center justify-between gap-4`,children:[(0,o.jsx)(`span`,{className:`text-xs text-zinc-500`,children:e}),(0,o.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,o.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded px-2 py-0.5 text-xs text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:`✕`})})]}),(0,o.jsx)(`div`,{ref:c,role:`region`,"aria-label":`${e} content`,tabIndex:0,className:`min-h-0 min-w-0 overflow-auto [&_svg]:!max-w-none`,children:r}),i&&(0,o.jsx)(`div`,{className:`mt-2 flex shrink-0 flex-wrap items-center justify-start gap-3`,children:i})]})}),f.current??globalThis.document.body):null}var p=.8;function m(e){return e===`landscape`?`portrait`:`landscape`}function h(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=710?`landscape`:t<=e*p?`portrait`:`landscape`}var g=[`LR`,`RL`];function _(e){return g.includes(e)?`landscape`:`portrait`}function v(e){switch(e){case`LR`:return`TB`;case`TB`:return`LR`;case`RL`:return`BT`;case`BT`:return`RL`}}function y(e){let t=e.toUpperCase();return t===`TD`?`TB`:t===`TB`||t===`BT`||t===`LR`||t===`RL`?t:void 0}function b(e){let t=0;if(e[0]?.trim()===`---`){let n=e.findIndex((e,t)=>t>0&&e.trim()===`---`);if(n===-1)return-1;t=n+1}for(;t<e.length;t+=1){let n=e[t].trim();if(!(n===``||n.startsWith(`%%`)))return t}return-1}function x(e){let t=e.split(`
1
+ const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./lib-CRTt_FoR.cjs"),n=require("./workspacePath-BdmjN0W2.cjs"),r=require("./download-CVl_k6EM.cjs"),i=require("./katex-C-T_oEhv.cjs");let a=require("react"),o=require("react/jsx-runtime"),s=require("react-dom");var c=(0,a.createContext)(`dark`),l=()=>(0,a.useContext)(c);function u({text:e,className:t,iconOnly:n=!1}){let[r,i]=(0,a.useState)(!1);async function s(){try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}}return(0,o.jsx)(`button`,{type:`button`,onClick:s,title:r?`Copied!`:n?`Copy code`:`Copy`,"aria-label":n?r?`Copied`:`Copy code`:void 0,className:t??`rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:n?r?`✓`:`⧉`:r?`✓ copied`:`⧉ copy`})}function d(e){if(e==null)return;if(!(e.getRootNode()instanceof ShadowRoot))return globalThis.document.body;let t=e;for(;t.parentElement!==null;)t=t.parentElement;return t}function f({label:e,open:t,onClose:n,children:r,actions:i,containerRef:c,anchorRef:l,testId:u=`structured-enlarged`}){(0,a.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,n]);let f=(0,a.useRef)(void 0);return f.current=d(l?.current)??f.current,t?(0,s.createPortal)((0,o.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`${e}, full size`,"data-testid":u,onClick:n,className:`fixed inset-0 z-[100] flex items-center justify-center overflow-hidden bg-black/60 p-6`,children:(0,o.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`flex max-h-full min-w-0 w-auto max-w-[95vw] flex-col overflow-hidden rounded-lg bg-white p-4 shadow-xl dark:bg-zinc-900`,children:[(0,o.jsxs)(`div`,{className:`mb-2 flex shrink-0 items-center justify-between gap-4`,children:[(0,o.jsx)(`span`,{className:`text-xs text-zinc-500`,children:e}),(0,o.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,o.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded px-2 py-0.5 text-xs text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:`✕`})})]}),(0,o.jsx)(`div`,{ref:c,role:`region`,"aria-label":`${e} content`,tabIndex:0,className:`min-h-0 min-w-0 overflow-auto [&_svg]:!max-w-none`,children:r}),i&&(0,o.jsx)(`div`,{className:`mt-2 flex shrink-0 flex-wrap items-center justify-start gap-3`,children:i})]})}),f.current??globalThis.document.body):null}var p=.8;function m(e){return e===`landscape`?`portrait`:`landscape`}function h(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=710?`landscape`:t<=e*p?`portrait`:`landscape`}var g=[`LR`,`RL`];function _(e){return g.includes(e)?`landscape`:`portrait`}function v(e){switch(e){case`LR`:return`TB`;case`TB`:return`LR`;case`RL`:return`BT`;case`BT`:return`RL`}}function y(e){let t=e.toUpperCase();return t===`TD`?`TB`:t===`TB`||t===`BT`||t===`LR`||t===`RL`?t:void 0}function b(e){let t=0;if(e[0]?.trim()===`---`){let n=e.findIndex((e,t)=>t>0&&e.trim()===`---`);if(n===-1)return-1;t=n+1}for(;t<e.length;t+=1){let n=e[t].trim();if(!(n===``||n.startsWith(`%%`)))return t}return-1}function x(e){let t=e.split(`
2
2
  `),n=b(t);if(n===-1)return;let r=t[n],i=/^(\s*)(flowchart|graph)([ \t]+(TD|TB|BT|LR|RL)\b)?(.*)$/i.exec(r);if(i!==null){let[,e,r,,a,o]=i,s=a===void 0?`TB`:y(a),c=v(s),l=[...t];return l[n]=`${e}${r} ${c}${o}`,{direction:s,turned:l.join(`
3
3
  `)}}let a=/^(\s*)stateDiagram(-v2)?\s*$/i.exec(r);if(a!==null)return S(t,n,a[1])}function S(e,t,n){let r=0;for(let n=t+1;n<e.length;n+=1){let t=e[n],i=r===0?/^\s*direction\s+(TD|TB|BT|LR|RL)\s*$/i.exec(t):null;if(i!==null){let r=y(i[1]),a=[...e];return a[n]=t.replace(/(direction\s+)(TD|TB|BT|LR|RL)/i,`$1${v(r)}`),{direction:r,turned:a.join(`
4
4
  `)}}r+=(t.match(/\{/g)?.length??0)-(t.match(/\}/g)?.length??0),r<0&&(r=0)}let i=[...e];return i.splice(t+1,0,`${n} direction LR`),{direction:`TB`,turned:i.join(`
@@ -509,7 +509,7 @@ div.mxRubberband { position: absolute; overflow: hidden; border: 1px solid #29b6
509
509
  `)),l=[],u=!0)};for(let{row:e,role:t}of r){let{cells:n,heading:r}=ce(e);if(r!==void 0){d();let t=Array.isArray(e)?1:e.depth??1;c.push(`${`#`.repeat(Math.min(t+1,6))} ${nm(r)}`);continue}let a=[...n,...i?[t===void 0?null:Nc[t]]:[]];l.push(`| ${a.map(tm).join(` | `)} |`)}return d(),!u&&c.length===0&&c.push([o,s].join(`
510
510
  `)),`${c.join(`
511
511
 
512
- `)}\n`}function im(e,t){r.t(new Blob([``,em(e)],{type:`text/csv;charset=utf-8`}),t)}async function am(e,t){let{default:n}=await Promise.resolve().then(()=>require("./browser-CUQnQIhV.cjs")),i=await n([e.columns.map(e=>({value:e,fontWeight:`bold`})),...e.rows.map(e=>e.map(e=>e===null?{value:void 0}:typeof e==`number`?{value:e,type:Number}:typeof e==`boolean`?{value:e,type:Boolean}:{value:e,type:String}))]).toBlob();r.t(i,t)}function om(e,t,n,i){r.t(new Blob([rm(e,t,n)],{type:`text/markdown;charset=utf-8`}),i)}var sm=e=>JSON.parse(JSON.stringify(e));function cm(e){let t=sm(e);return delete t.comparedTo,t.rows=t.rows.filter(e=>e.type!==`task`||e.role!==`removed`).map(e=>(e.type===`task`&&(delete e.role,e.items=e.items.filter(e=>e.role!==`removed`).map(e=>(delete e.role,delete e.previous,e))),e)),t}var lm=`#e4e4e7`,um=`#ea580c`,dm=`#dc2626`,fm=`#2563eb`,pm={fill:`#e4e4e7`,stroke:`#52525b`},mm=.35,hm=.25,gm=8,_m=24,vm=18,ym=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function bm(e,t,n){let r=[];for(let i=0;i<10;i++){let a=i%2==0?n:n*.45,o=-Math.PI/2+i*Math.PI/5;r.push(`${(e+a*Math.cos(o)).toFixed(2)},${(t+a*Math.sin(o)).toFixed(2)}`)}return`M${r.join(`L`)}Z`}function xm(e,t,n,r,i=1,a=`#a1a1aa`,o=6,s=.5){let c=[],l=i=>{for(let l=o;l<n+r;l+=o){let o=Math.min(l,n),u=Math.max(0,l-n),d=Math.max(0,l-r),f=Math.min(l,r);c.push({shape:`line`,x1:e+(i?n-o:o),y1:t+u,x2:e+(i?n-d:d),y2:t+f,stroke:a,strokeWidth:.6,opacity:s})}};return(i===1||i===3)&&l(!1),(i===2||i===3)&&l(!0),c}function Sm(e){let[t,n,r]=Re(e).split(`-`);return`${Number(r)} ${ym[Number(n)-1]} ${t}`}function Cm(e,t){let n=Math.floor(t/Ce);return e.length<=n?e:`${e.slice(0,Math.max(1,n-1))}…`}function wm(e,t,n){let r=e.rows[n.row];if(r?.type!==`task`)return``;let i=r.items[n.item],a=i.type===`activity`?`${i.start} to ${i.end}`:i.date,o=i.id===void 0?[]:t.dependencies.filter(e=>e.from===i.id||e.to===i.id),s=o.filter(e=>!e.satisfied).length;return[`${i.type} ${a}`,i.label,i.kind===void 0?void 0:`kind ${i.kind}`,`task "${r.label}" (${r.id})`,o.length===0?void 0:`${o.length} ${o.length===1?`dependency`:`dependencies`}${s>0?`, ${s} not satisfied`:``}`].filter(e=>e!==void 0).join(`, `)}function Tm(e,t){let n=t.comparison===`new`?cm(e):e,r=ht(n),i=(()=>{let e=ft(n,t.today,{compact:t.compact,pxPerDay:1,onlyChanged:t.onlyChanged});return e.end-e.start+1})(),a=Qe[t.scale??n.time.scale]??Qe.month,o=!1;if(t.pxPerDay!==void 0)a=t.pxPerDay;else if(t.width!==void 0){let e=(t.width-r-16)/i;a=Math.max(hm,e),o=e<hm}let s=t.unit??(t.pxPerDay!==void 0||t.width!==void 0?t.scale:t.scale??n.time.scale),c=ft(n,t.today,{compact:t.compact,pxPerDay:a,onlyChanged:t.onlyChanged,...s===void 0?{}:{unit:s}}),l=Wf(c.kinds,t.appearance?.kinds,{dashes:!1}),u=e=>e===void 0?pm:l.get(e)??pm,d=t.referenceLine??`today`,f=t.showDependencies??!0,p=[Ff,dm,fm].map(e=>({id:gp(`tl`,e),paint:e})),m=[{id:`header-ground`,primitives:[{shape:`rect`,x:0,y:0,width:c.width,height:58,fill:`#ffffff`},...c.unitLines.map(e=>({shape:`line`,x1:e,x2:e,y1:38,y2:58,stroke:lm})),{shape:`line`,x1:0,x2:c.width,y1:57.5,y2:57.5,stroke:Ff}]},...c.upper.map(e=>({id:`upper-${e.x}`,testId:`timeline-upper`,primitives:[{shape:`line`,x1:e.x,x2:e.x,y1:18,y2:58,stroke:Ff},{shape:`text`,x:e.x+4,y:32,text:e.label,fontSize:11,fontWeight:600,fill:Pf,fontFamily:qf,testId:`timeline-upper`}]})),{id:`year-repeats`,primitives:(c.unit===`month`?c.months:[]).filter((e,t)=>t>0&&e.month%3==0&&e.month!==0).map(e=>({shape:`text`,x:e.x+4,y:32,text:String(e.year),fontSize:11,fill:Ff,fontFamily:qf,testId:`timeline-year-repeat`}))},{id:`units`,primitives:c.lower.map(e=>({shape:`text`,x:e.x+e.width/2,y:52,text:nt(e,c.unit),fontSize:10,textAnchor:`middle`,fill:Ff,fontFamily:qf,testId:`timeline-unit`}))}];c.periods.length>0&&m.push({id:`calendar-bands`,primitives:c.periods.map(e=>({shape:`rect`,x:e.x,y:18,width:e.width,height:40,fill:e.kind===void 0?`#a1a1aa`:u(e.kind).stroke,fillOpacity:e.kind===void 0?.1:.12}))}),c.headerLabels.length>0&&m.push({id:`calendar-names`,primitives:c.headerLabels.map(e=>{let t=e.of===`period`?c.periods.find(t=>t.index===e.index)?.kind:c.references.find(t=>t.index===e.index)?.kind;return{shape:`text`,...e.of===`reference`?{x:e.x+e.width/2,textAnchor:`middle`}:{x:e.x},y:12,text:e.text,fontSize:10,fill:t===void 0?Ff:u(t).stroke,fontFamily:qf,testId:`timeline-${e.of}-name`}})});let h=d===`dated`?Sm(t.today):`Today`;if(d!==`none`&&`x`in c.today){let e=c.today.x,t=Math.max(44,h.length*6+10);m.push({id:`today-tag`,testId:`timeline-today-tag`,primitives:[{shape:`rect`,x:e-t/2,y:1,width:t,height:15,rx:3,fill:um},{shape:`text`,x:e,y:12,text:h,fontSize:10,fontWeight:600,textAnchor:`middle`,fill:`#ffffff`,fontFamily:qf},{shape:`line`,x1:e,x2:e,y1:16,y2:58,stroke:um,strokeWidth:2}]})}if(d!==`none`&&`outside`in c.today){let e=c.today.outside===`before`,t=d===`dated`?Sm(c.today.day):`Today (${Re(c.today.day)})`;m.push({id:`today-outside`,primitives:[{shape:`text`,x:e?4:c.width-4,y:12,text:e?`◂ ${t} is before this range`:`${t} is after this range ▸`,fontSize:10,fontWeight:600,textAnchor:e?`start`:`end`,fill:um,fontFamily:qf,testId:`timeline-today-outside`,data:{side:c.today.outside}}]})}let g=(()=>{if(t.selection===void 0)return;let e=n.rows[t.selection.row];if(e?.type===`task`)return t.selection.item===void 0?e.id:e.items[t.selection.item]?.id})(),_=e=>g!==void 0&&(e.from===g||e.to===g),v=[{id:`rows-ground`,primitives:[{shape:`rect`,x:0,y:0,width:c.width,height:c.height,fill:`#ffffff`},...c.unitLines.map(e=>({shape:`line`,x1:e,x2:e,y1:0,y2:c.height,stroke:lm}))]},...c.rows.map(e=>e.type===`separator`?{id:`separator-${e.row}`,testId:`timeline-separator`,primitives:[{shape:`rect`,x:0,y:e.y,width:c.width,height:e.height,fill:`#f4f4f5`},{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#a1a1aa`,strokeWidth:1.5}]}:e.type===`section`?{id:`section-${e.row}`,testId:`timeline-section`,primitives:[{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#a1a1aa`,strokeWidth:1.5}]}:{id:`row-${e.row}`,primitives:[{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#f4f4f5`}]})];for(let e of c.periods){let t=n.periods[e.index],r=`${t.label??`Period`}: ${Sm(Le(t.start))} – ${Sm(Le(t.end))}`,i=[{shape:`rect`,x:e.x,y:0,width:e.width,height:c.height,fill:e.kind===void 0?`#a1a1aa`:u(e.kind).stroke,fillOpacity:e.kind===void 0?.1:.12}];e.kind===void 0&&i.push(...xm(e.x,0,e.width,c.height)),v.push({id:`period-${e.index}`,testId:`timeline-period`,title:r,data:{...e.kind?{kind:e.kind}:{}},primitives:i})}for(let e of c.references){let t=e.kind===void 0?`#3f3f46`:u(e.kind).stroke;v.push({id:`reference-${e.index}`,testId:`timeline-reference`,title:`${e.label}: ${Sm(Le(e.date))}`,data:{...e.kind?{kind:e.kind}:{}},primitives:[{shape:`line`,x1:e.x,x2:e.x,y1:0,y2:c.height,stroke:t,strokeWidth:1.5,strokeDasharray:`6 3`}]})}if(f)for(let e of c.dependencies){let t=_(e),r=t?fm:e.satisfied?Ff:dm,i=n.dependencies[e.index];v.push({id:`dependency-${e.index}`,testId:`timeline-dependency`,title:_t(n,i,e.satisfied),data:{from:e.from,to:e.to,type:e.type,satisfied:String(e.satisfied),emphasised:String(t)},primitives:[{shape:`path`,d:`M${e.points.map(e=>`${e.x},${e.y}`).join(` L`)}`,stroke:r,strokeWidth:t?2.25:1.25,...e.satisfied?{}:{strokeDasharray:`4 3`},markerEnd:gp(`tl`,r)}]})}for(let e of c.items){let r=u(e.kind),i=t.selection?.row===e.row&&t.selection.item===e.item,a=[],o=e.change===`removed`;if(e.ghost!==void 0&&(e.type===`activity`?a.push({shape:`rect`,x:e.ghost.x,y:e.ghost.y,width:e.ghost.width,height:e.ghost.height,rx:3,fill:`none`,stroke:r.stroke,strokeWidth:1.25,strokeDasharray:`4 3`,data:{previous:`true`}}):e.ghostCenter!==void 0&&(e.ghostCenter.y===e.center.y&&a.push({shape:`line`,x1:e.ghostCenter.x,x2:e.center.x,y1:e.center.y,y2:e.center.y,stroke:Ff,strokeWidth:1,strokeDasharray:`2 2`}),a.push({shape:`path`,d:bm(e.ghostCenter.x,e.ghostCenter.y,7),fill:`none`,stroke:r.stroke,strokeWidth:1,strokeDasharray:`2 2`,data:{previous:`true`}}))),o)a.push(e.type===`activity`?{shape:`rect`,x:e.glyph.x,y:e.glyph.y,width:e.glyph.width,height:e.glyph.height,rx:3,fill:`none`,stroke:r.stroke,strokeWidth:1.25,strokeDasharray:`4 3`}:{shape:`path`,d:bm(e.center.x,e.center.y,7),fill:`none`,stroke:r.stroke,strokeWidth:1,strokeDasharray:`2 2`});else if(e.type===`activity`){let t=e.kind!==void 0;a.push({shape:`rect`,x:e.glyph.x,y:e.glyph.y,width:e.glyph.width,height:e.glyph.height,rx:3,fill:t?r.stroke:r.fill,...t?{fillOpacity:mm}:{},stroke:i?fm:r.stroke,strokeWidth:i?2.5:1.25}),r.hatch!==void 0&&a.push(...xm(e.glyph.x,e.glyph.y,e.glyph.width,e.glyph.height,r.hatch,r.stroke,4,.8))}else a.push({shape:`path`,d:bm(e.center.x,e.center.y,7),fill:r.stroke,stroke:i?fm:`#ffffff`,strokeWidth:i?2:.75});e.label!==void 0&&a.push({shape:`text`,x:e.label.x,y:e.label.y+12,...e.label.note!==void 0&&e.label.text.endsWith(e.label.note)?{text:e.label.text.slice(0,-e.label.note.length).trimEnd(),note:e.label.note}:{text:e.label.text},fontSize:11,fill:Pf,fontFamily:qf,testId:`timeline-annotation`,...e.label.struck?{textDecoration:`line-through`}:{},...e.label.inside?{}:{stroke:`#ffffff`,strokeWidth:3,paintOrder:`stroke`}}),v.push({id:`item-${e.row}-${e.item}`,testId:`timeline-${e.type}`,title:wm(n,c,e),data:{row:String(e.row),item:String(e.item),...e.kind===void 0?{}:{kind:e.kind},...e.change===void 0?{}:{change:e.change},selected:String(i)},primitives:a})}d!==`none`&&`x`in c.today&&v.push({id:`today`,testId:`timeline-today`,primitives:[{shape:`line`,x1:c.today.x,x2:c.today.x,y1:0,y2:c.height,stroke:um,strokeWidth:2,opacity:.85}]});let y=c.rows.map(e=>{let t=58+e.y,n=e.type===`section`?`${e.label??``} (${e.tasks.length})`.trim():e.type===`separator`?e.label??``:e.label,i=e.type!==`task`;return{id:`label-${e.row}`,primitives:[...i?[{shape:`line`,x1:0,x2:r,y1:t+.5,y2:t+.5,stroke:`#a1a1aa`,strokeWidth:1}]:[],{shape:`text`,x:8,y:e.type===`separator`?t+e.height-6:t+e.height/2+4,text:Cm(n,r-12),fontSize:11,...i?{fontWeight:600}:{},fill:i?Ff:Pf,fontFamily:qf}]}}),b=new Map;for(let e of n.rows)if(e.type===`task`)for(let t of e.items){if(t.kind===void 0)continue;let e=b.get(t.kind)??{activity:!1,milestone:!1};e[t.type]=!0,b.set(t.kind,e)}let x=Gf(c.kinds,l),S=[],C=0,w=0,T=r+c.width;for(let e of c.kinds){let t=u(e),n=b.get(e);if(n===void 0)continue;let r=x.has(e)?`${e} (same colour as ${x.get(e).join(`, `)})`:e,i=(n.activity?22:0)+(n.milestone?16:0)+r.length*Ce+18;C>0&&C+i>T&&(C=0,w+=1);let a=w*vm,o=[],s=C;n.activity&&(o.push({shape:`rect`,x:s,y:a+4,width:16,height:8,rx:2,fill:t.stroke,stroke:t.stroke,fillOpacity:mm}),t.hatch!==void 0&&o.push(...xm(s,a+4,16,8,t.hatch,t.stroke,4,.8)),s+=22),n.milestone&&(o.push({shape:`path`,d:bm(s+6,a+8,6),fill:t.stroke}),s+=16),o.push({shape:`text`,x:s,y:a+12,text:r,fontSize:10,fill:Ff,fontFamily:qf}),S.push({id:`legend-${e}`,...t.declared===!0?{title:`${e} — project colour`,data:{kind:e,"colour-source":`project`}}:{data:{kind:e}},primitives:o}),C+=i}let E=[...c.periods.map(e=>({kind:e.kind,line:!1,text:n.periods[e.index].label??`Period`})),...c.references.map(e=>({kind:e.kind,line:!0,text:e.label}))];if(E.length>0&&(C>0&&(C=0,w+=1),E.forEach((e,t)=>{let n=22+e.text.length*Ce+18;C>0&&C+n>T&&(C=0,w+=1);let r=w*vm,i=e.kind===void 0?e.line?`#3f3f46`:`#a1a1aa`:u(e.kind).stroke;S.push({id:`legend-calendar-${t}`,testId:`timeline-calendar-legend`,primitives:[e.line?{shape:`line`,x1:C+8,x2:C+8,y1:r+2,y2:r+14,stroke:i,strokeWidth:1.5,strokeDasharray:`3 2`}:{shape:`rect`,x:C,y:r+3,width:16,height:10,fill:i,fillOpacity:.25},{shape:`text`,x:C+22,y:r+12,text:e.text,fontSize:10,fill:Ff,fontFamily:qf}]}),C+=n})),n.comparedTo!==void 0){C>0&&(C=0,w+=1);let e=w*vm,t=[{shape:`rect`,x:0,y:e+4,width:16,height:8,rx:2,fill:`none`,stroke:Ff,strokeDasharray:`4 3`},{shape:`text`,x:22,y:e+12,text:`previous dates (${n.comparedTo.label})`,fontSize:10,fill:Ff,fontFamily:qf}],r=22+(`previous dates (${n.comparedTo.label})`.length+3)*Ce;t.push({shape:`text`,x:r,y:e+12,text:`(new)`,fontStyle:`italic`,fontSize:10,fill:Ff,fontFamily:qf},{shape:`text`,x:r+5*Ce,y:e+12,text:`: added since`,fontSize:10,fill:Ff,fontFamily:qf},{shape:`text`,x:r+20*Ce,y:e+12,text:`removed`,fontSize:10,fill:Ff,fontFamily:qf,textDecoration:`line-through`},{shape:`text`,x:r+28*Ce,y:e+12,text:`: dropped since`,fontSize:10,fill:Ff,fontFamily:qf}),S.push({id:`legend-comparison`,testId:`timeline-comparison-legend`,primitives:t})}let ee=S.length===0?0:(w+1)*vm+6;return{layout:c,pxPerDay:a,overWidth:o,labelWidth:r,tints:l,markers:p,header:m,rows:v,labels:y,legend:{groups:S,height:ee}}}function Em(e,t,n){let r=e=>{switch(e.shape){case`rect`:case`text`:return{...e,x:e.x+t,y:e.y+n};case`line`:return{...e,x1:e.x1+t,x2:e.x2+t,y1:e.y1+n,y2:e.y2+n};case`path`:return{...e,d:Dm(e.d,t,n)}}};return{...e,primitives:e.primitives.map(r),...e.groups?{groups:e.groups.map(e=>Em(e,t,n))}:{}}}function Dm(e,t,n){return e.replace(/(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)/g,(e,r,i)=>`${+(Number(r)+t).toFixed(2)},${+(Number(i)+n).toFixed(2)}`)}function Om(e,t){let n=Tm(e,{...t,selection:void 0}),r=t.comparison===`new`?void 0:e.comparedTo,i=gm+(e.title?_m:0)+(r?18:0),a=gm,o=a+n.labelWidth,s=[];if(e.title&&s.push({id:`title`,primitives:[{shape:`text`,x:a,y:23,text:e.title,fontSize:13,fontWeight:600,fill:Pf,fontFamily:qf}]}),r){let t=gm+(e.title?_m:0)+12;s.push({id:`compared-to`,testId:`timeline-compared-to`,primitives:[{shape:`text`,x:a,y:t,text:`Compared with ${r.label}${r.date?` (${Sm(Le(r.date)??0)})`:``}`,fontSize:11,fill:Ff,fontFamily:qf}]})}s.push(...n.header.map(e=>Em(e,o,i))),s.push(...n.rows.map(e=>Em(e,o,i+58))),s.push(...n.labels.map(e=>Em(e,a,i)));let c=i+58+n.layout.height+10;s.push(...n.legend.groups.map(e=>Em(e,a,c)));let l=Math.ceil(o+n.layout.width+gm),u=Math.ceil(c+n.legend.height+gm);return{width:l,height:u,viewBox:`0 0 ${l} ${u}`,ariaLabel:`Timeline${e.title?` "${e.title}"`:``} from ${e.time.start} to ${e.time.end}`,background:`#ffffff`,markers:n.markers,groups:s,overWidth:n.overWidth}}var km=.21,Am=.65;function jm(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Mm(e){return e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055}function Nm(e,t,n){let r=jm(e),i=jm(t),a=jm(n),o=Math.cbrt(.4122214708*r+.5363325363*i+.0514459929*a),s=Math.cbrt(.2119034982*r+.6806995451*i+.1073969566*a),c=Math.cbrt(.0883024619*r+.2817188376*i+.6299787005*a);return{l:.2104542553*o+.793617785*s-.0040720468*c,a:1.9779984951*o-2.428592205*s+.4505937099*c,b:.0259040371*o+.7827717662*s-.808675766*c}}function Pm({l:e,a:t,b:n}){let r=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[4.0767416621*r-3.3077115913*i+.2309699292*a,-1.2684380046*r+2.6097574011*i-.3413193965*a,-.0041960863*r-.7034186147*i+1.707614701*a]}var Fm=e=>e.every(e=>e>=-1e-4&&e<=1.0001);function Im(e){return`#${e.map(e=>Math.round(Math.min(1,Math.max(0,Mm(Math.min(1,Math.max(0,e)))))*255).toString(16).padStart(2,`0`)).join(``)}`}var Lm=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,Rm=new Map;function zm(e){if(!Lm.test(e))return e;let t=Rm.get(e);if(t!==void 0)return t;let[n,r,i]=(e.length===4?[...e.slice(1)].map(e=>e+e):[1,3,5].map(t=>e.slice(t,t+2))).map(e=>Number.parseInt(e,16)/255),a=Nm(n,r,i),o=km+.73*(1-Math.min(1,Math.max(0,a.l)))**Am,s=Pm({l:o,a:a.a,b:a.b});if(!Fm(s)){let e=0,t=1;for(let n=0;n<20;n++){let n=(e+t)/2;Fm(Pm({l:o,a:a.a*n,b:a.b*n}))?e=n:t=n}let n=e;s=Pm({l:o,a:a.a*n,b:a.b*n})}let c=Im(s);return Rm.set(e,c),c}function Bm(e){if(e!==void 0&&Lm.test(e))return`light-dark(${e}, ${zm(e)})`}function Vm(e){let t=Bm(e.fill),n=Bm(e.stroke);if(t!==void 0||n!==void 0)return{...t===void 0?{}:{fill:t},...n===void 0?{}:{stroke:n}}}function Hm({primitive:e}){let t=Object.fromEntries(Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t]));switch(e.shape){case`rect`:return(0,o.jsx)(`rect`,{...t,x:e.x,y:e.y,width:e.width,height:e.height,rx:e.rx,fill:e.fill,fillOpacity:e.fillOpacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,opacity:e.opacity,style:Vm(e)});case`text`:{let n={x:e.x,y:e.y,fontSize:e.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,textAnchor:e.textAnchor},r=(0,o.jsxs)(o.Fragment,{children:[e.text,e.note!==void 0&&(0,o.jsxs)(o.Fragment,{children:[` `,(0,o.jsx)(`tspan`,{fontStyle:`italic`,children:e.note})]})]}),i=e.paintOrder===`stroke`,a=(0,o.jsx)(`text`,{...t,"data-testid":e.testId,...n,fill:e.fill,stroke:i?void 0:e.stroke,strokeWidth:i?void 0:e.strokeWidth,textDecoration:e.textDecoration,opacity:e.opacity,style:Vm({fill:e.fill,stroke:i?void 0:e.stroke}),children:r});return i?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`text`,{...n,fill:e.stroke,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,style:Vm({fill:e.stroke,stroke:e.stroke}),"aria-hidden":`true`,children:r}),a]}):a}case`line`:return(0,o.jsx)(`line`,{...t,x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,opacity:e.opacity,markerEnd:e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`,style:Vm(e)});case`path`:return(0,o.jsx)(`path`,{...t,d:e.d,fill:e.fill??`none`,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,strokeLinecap:e.strokeLinecap,opacity:e.opacity,markerEnd:e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`,pointerEvents:`none`,style:Vm(e)})}}function Um({group:e,interaction:t}){let n=Object.fromEntries(Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t])),{extra:r,before:i}=t?.(e)??{};return(0,o.jsxs)(`g`,{...n,"data-testid":e.testId,opacity:e.opacity,...r,children:[e.title===void 0?null:(0,o.jsx)(`title`,{children:e.title}),i,e.primitives.map((e,t)=>(0,o.jsx)(Hm,{primitive:e},t)),(e.groups??[]).map(e=>(0,o.jsx)(Um,{group:e,interaction:t},e.id))]})}function Wm({markers:e}){return(0,o.jsx)(`defs`,{children:e.map(e=>(0,o.jsx)(`marker`,{id:e.id,markerWidth:`7`,markerHeight:`7`,refX:`9`,refY:`5`,viewBox:`0 0 10 10`,markerUnits:`userSpaceOnUse`,orient:`auto`,children:(0,o.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:e.paint,style:Vm({fill:e.paint})})},e.id))})}var Gm=`#2563eb`,Km={fill:`#e4e4e7`,stroke:`#52525b`};function qm(e){let t=e.replace(/[^\p{L}\p{N}._-]+/gu,`-`),n=0,r=t.length;for(;n<r&&t[n]===`-`;)n+=1;for(;r>n&&t[r-1]===`-`;)--r;return t.slice(n,r)}var Jm=[`week`,`month`,`quarter`,`fit`];function Ym(e){return{scale:e.time.scale,compact:!1,showDependencies:!0,comparison:`compare`,onlyChanged:!1}}function Xm(e){return e.type===`activity`?`${e.start} to ${e.end}`:e.date}function Zm({data:e,today:t,appearance:n,display:r,onDisplayChange:i,onSelect:s,saveFigure:c,exportRef:l}){let u=t??ze(),[d,f]=(0,a.useState)(()=>Ym(e)),p=r??d,m=i??f,h=e=>t=>m(n=>({...n,[e]:typeof t==`function`?t(n[e]):t})),g=e.comparedTo!==void 0,{comparison:_,onlyChanged:v,compact:y,showDependencies:b,scale:x}=p,S=h(`comparison`),C=h(`onlyChanged`),w=(0,a.useMemo)(()=>g&&_===`new`?cm(e):e,[e,g,_]),T=g&&_===`compare`&&v,E=h(`compact`),ee=h(`showDependencies`),[D,te]=(0,a.useState)(void 0),ne=h(`scale`),re=(0,a.useRef)(null),[ie,ae]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=re.current;if(e===null||(ae(e.clientWidth),typeof ResizeObserver>`u`))return;let t=0,n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>ae(e.clientWidth))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]);let oe=(Le(w.time.end)??0)-(Le(w.time.start)??0)+1,se=ie>0?ie/oe:0,ce=x===`fit`?{pxPerDay:Math.max(hm,se)}:{pxPerDay:Math.max(Qe[x],se),unit:x},[le,ue]=(0,a.useState)(void 0),de=(0,a.useMemo)(()=>Tm(w,{today:u,compact:y,showDependencies:b,appearance:n??null,referenceLine:`today`,onlyChanged:T,...ce,...D===void 0?{}:{selection:D.type===`item`?{row:D.row,item:D.item}:{row:D.row}}}),[w,u,y,b,n,D,T,x,ie]),O=de.layout,fe=de.tints,pe=(0,a.useMemo)(()=>{let e=!1;for(let t of w.rows)if(t.type===`separator`)e=!0;else if(e)return!0;return!1},[w]),me=(0,a.useMemo)(()=>Gf(O.kinds,fe),[O.kinds,fe]),he=(0,a.useMemo)(()=>ht(w),[w]),ge=(0,a.useMemo)(()=>{let e=new Map;for(let t of w.rows)if(t.type===`task`)for(let n of t.items){if(n.kind===void 0)continue;let t=e.get(n.kind)??{activity:!1,milestone:!1};t[n.type]=!0,e.set(n.kind,t)}return e},[w]),_e=e=>e===void 0?Km:fe.get(e)??Km,ve=(e,t)=>e!==void 0&&e.type===t.type&&e.row===t.row&&(e.type===`task`||t.type===`item`&&e.item===t.item),ye=e=>{let t=ve(D,e);if(te(t=>ve(t,e)?void 0:e),!s)return;let n=w.rows[e.row];if(t||n?.type!==`task`)return s(void 0);s(e.type===`item`?{task:n,item:n.items[e.item]}:{task:n})},be=(e,t)=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),ye(t))},xe=e=>{let t=e.data?.row,n=e.data?.item;if(e.testId!==`timeline-activity`&&e.testId!==`timeline-milestone`||t===void 0||n===void 0)return{};let r={type:`item`,row:Number(t),item:Number(n)},i=`${t}:${n}`,a=O.items.find(e=>e.row===r.row&&e.item===r.item);return{extra:{role:`button`,tabIndex:0,"aria-label":e.title,"aria-pressed":e.data?.selected===`true`,style:{cursor:`pointer`,outline:`none`},onClick:()=>ye(r),onKeyDown:e=>be(e,r),onFocus:()=>ue(i),onBlur:()=>ue(e=>e===i?void 0:e)},before:a===void 0?void 0:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`rect`,{"data-testid":`timeline-hit`,x:a.glyph.x,y:a.glyph.y,width:a.glyph.width,height:a.glyph.height,fill:`transparent`}),le===i&&(0,o.jsx)(`rect`,{"data-testid":`timeline-focus-ring`,x:a.glyph.x-3,y:a.glyph.y-3,width:a.glyph.width+6,height:a.glyph.height+6,rx:4,fill:`none`,stroke:Gm,strokeWidth:1.5,strokeDasharray:`3 2`,style:Vm({stroke:Gm})})]})}},[k,A]=(0,a.useState)(null),Se=()=>ep(Om(w,{today:u,compact:y,showDependencies:b,onlyChanged:T,appearance:n??null,referenceLine:`dated`,...ce})),Ce=`timeline-${qm(w.title??`plan`)||`plan`}.svg`,we=async()=>{if(c){let e=await c(Ce,Se()).catch(()=>!1);A(e===!1?`could not save`:e)}else{let e=URL.createObjectURL(new Blob([Se()],{type:`image/svg+xml`})),t=document.createElement(`a`);t.href=e,t.download=Ce,t.click(),URL.revokeObjectURL(e),A(`SVG downloaded`)}window.setTimeout(()=>A(null),2500)};(0,a.useImperativeHandle)(l,()=>({svg:()=>void we()}));let Te=async()=>{A(await Bt(Se())?`SVG markup copied`:`could not copy`),window.setTimeout(()=>A(null),2500)};(0,a.useEffect)(()=>{let e=re.current;if(e===null)return;let t=dt(O,e.clientWidth);t!==void 0&&(e.scrollLeft=t)},[]);let Ee=(0,a.useRef)(void 0),De=e=>{let t=re.current;t!==null&&(Ee.current=O.start+(t.scrollLeft+t.clientWidth/2)/de.pxPerDay),ne(e)};return(0,a.useLayoutEffect)(()=>{let e=re.current,t=Ee.current;Ee.current=void 0,e!==null&&t!==void 0&&(e.scrollLeft=Math.max(0,(t-O.start)*de.pxPerDay-e.clientWidth/2))},[de.pxPerDay,O.start]),(0,o.jsxs)(`div`,{"data-testid":`timeline`,className:`w-full min-w-0 rounded border border-zinc-200 bg-white text-zinc-800 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100`,onKeyDown:e=>{e.key===`Escape`&&te(void 0)},children:[w.title!==void 0&&w.title!==``&&(0,o.jsx)(`p`,{className:`border-b border-zinc-200 px-2 py-1 text-sm font-medium dark:border-zinc-700`,"data-testid":`timeline-title`,children:w.title}),g&&_===`compare`&&(0,o.jsxs)(`p`,{className:`border-b border-zinc-200 px-2 py-0.5 text-xs text-zinc-500 dark:border-zinc-700 dark:text-zinc-400`,"data-testid":`timeline-compared-to`,children:[`Compared with `,(0,o.jsx)(`span`,{className:`font-medium text-zinc-700 dark:text-zinc-200`,children:e.comparedTo.label}),e.comparedTo.date===void 0?``:` (${e.comparedTo.date})`]}),(0,o.jsxs)(`div`,{className:`flex`,children:[(0,o.jsxs)(`div`,{className:`shrink-0 border-r border-zinc-200 text-xs dark:border-zinc-700`,style:{width:he},"data-testid":`timeline-labels`,children:[(0,o.jsx)(`div`,{style:{height:58}}),O.rows.map(e=>e.type===`section`?(0,o.jsxs)(`div`,{"data-testid":`timeline-section-label`,className:`flex items-center border-t border-zinc-400 px-2 font-semibold text-zinc-600 dark:border-zinc-600 dark:text-zinc-300`,style:{height:e.height},title:`${e.label??`Untitled section`}: ${e.tasks.length} ${e.tasks.length===1?`task`:`tasks`}`,children:[(0,o.jsx)(`span`,{className:`truncate`,children:e.label??``}),(0,o.jsxs)(`span`,{className:`ml-1 shrink-0 font-normal text-zinc-400 dark:text-zinc-500`,children:[`(`,e.tasks.length,`)`]})]},e.row):e.type===`separator`?(0,o.jsx)(`div`,{"data-testid":`timeline-separator-label`,className:`flex items-end border-t border-zinc-400 px-2 font-semibold text-zinc-600 dark:border-zinc-600 dark:text-zinc-300`,style:{height:e.height},children:e.label??``},e.row):(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-task-label`,"aria-pressed":D?.type===`task`&&D.row===e.row,className:`block w-full truncate border-t border-zinc-100 px-2 text-left hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-800 `+(D?.type===`task`&&D.row===e.row?`bg-blue-50 font-medium dark:bg-blue-950/50`:``),style:{height:e.height},title:`${e.label} (${e.id})`,onClick:()=>ye({type:`task`,row:e.row}),children:e.label},e.row))]}),(0,o.jsxs)(`div`,{ref:re,className:`min-w-0 flex-1 overflow-x-auto`,"data-testid":`timeline-scroller`,children:[(0,o.jsx)(`svg`,{width:O.width,height:58,role:`img`,"aria-label":`Calendar from ${w.time.start} to ${w.time.end}`,"data-testid":`timeline-header`,xmlns:`http://www.w3.org/2000/svg`,style:{display:`block`},children:de.header.map(e=>(0,o.jsx)(Um,{group:e},e.id))}),(0,o.jsxs)(`svg`,{width:O.width,height:O.height,role:`group`,"aria-label":`Tasks and items${w.title?` of ${w.title}`:``}`,"data-testid":`timeline-body`,xmlns:`http://www.w3.org/2000/svg`,style:{display:`block`},children:[(0,o.jsx)(Wm,{markers:de.markers}),de.rows.map(e=>(0,o.jsx)(Um,{group:e,interaction:xe},e.id))]})]})]}),(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-zinc-200 px-2 py-1 text-xs dark:border-zinc-700`,children:[(0,o.jsx)(`span`,{className:`flex items-center gap-1 text-zinc-500 dark:text-zinc-400`,role:`group`,"aria-label":`Scale`,"data-testid":`timeline-scale`,children:Jm.map((e,t)=>(0,o.jsxs)(`span`,{className:`flex items-center gap-1`,children:[t>0&&(0,o.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,o.jsx)(`button`,{type:`button`,"data-scale":e,"aria-pressed":x===e,className:x===e?`font-semibold text-zinc-800 dark:text-zinc-100`:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>De(e),children:e})]},e))}),g&&(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-comparison-toggle`,"aria-pressed":_===`new`,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>{te(void 0),S(e=>e===`compare`?`new`:`compare`)},children:_===`compare`?`new version only`:`show the comparison`}),g&&_===`compare`&&(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-only-changed-toggle`,"aria-pressed":v,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>{te(void 0),C(e=>!e)},children:v?`show every task`:`only what moved`}),T&&O.hiddenTasks>0&&(0,o.jsxs)(`span`,{className:`text-amber-700 dark:text-amber-400`,"data-testid":`timeline-unchanged-hidden`,children:[O.hiddenTasks,` unchanged `,O.hiddenTasks===1?`task`:`tasks`,` hidden`]}),pe&&(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-compact-toggle`,"aria-pressed":y,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>{te(e=>e?.type===`task`?void 0:e),E(e=>!e)},children:y?`one row per task`:`one row per section`}),(w.dependencies??[]).length>0&&(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-dependencies-toggle`,"aria-pressed":!b,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>ee(e=>!e),children:b?`hide dependencies`:`show dependencies`}),!b&&(0,o.jsxs)(`span`,{className:`text-amber-700 dark:text-amber-400`,"data-testid":`timeline-dependencies-hidden`,children:[O.dependencies.length,` `,O.dependencies.length===1?`dependency`:`dependencies`,` hidden`,O.dependencies.some(e=>!e.satisfied)?`, some not satisfied by the dates`:``]}),(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-download-svg`,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>void we(),children:`⤓ download SVG`}),(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-copy-svg`,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>void Te(),children:`copy markup`}),k!==null&&(0,o.jsx)(`span`,{role:`status`,className:`text-emerald-700 dark:text-emerald-400`,children:k})]}),g&&_===`compare`&&(0,o.jsxs)(`p`,{className:`flex flex-wrap items-center gap-3 border-t border-zinc-200 px-2 py-1 text-xs text-zinc-500 dark:border-zinc-700 dark:text-zinc-400`,"data-testid":`timeline-comparison-key`,children:[(0,o.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,o.jsx)(`svg`,{width:18,height:12,"aria-hidden":`true`,children:(0,o.jsx)(`rect`,{x:1,y:2,width:16,height:8,rx:2,fill:`none`,stroke:`#71717a`,strokeDasharray:`4 3`,style:Vm({stroke:`#71717a`})})}),`previous dates`]}),(0,o.jsxs)(`span`,{children:[(0,o.jsx)(`i`,{children:`(new)`}),`: added since`]}),(0,o.jsxs)(`span`,{children:[(0,o.jsx)(`span`,{className:`line-through`,children:`removed`}),`: dropped since`]})]}),(O.periods.length>0||O.references.length>0)&&(0,o.jsxs)(`ul`,{className:`flex flex-wrap gap-3 border-t border-zinc-200 px-2 py-1 text-xs text-zinc-600 dark:border-zinc-700 dark:text-zinc-300`,"data-testid":`timeline-calendar-legend`,children:[O.periods.map(e=>{let t=w.periods[e.index];return(0,o.jsxs)(`li`,{className:`flex items-center gap-1`,"data-period":e.index,title:`${t.label??`Period`}: ${t.start} – ${t.end}`,children:[(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block h-2.5 w-4 rounded-sm`,style:{background:Bm(e.kind===void 0?`#a1a1aa`:_e(e.kind).stroke),opacity:.35}}),t.label??`Period`]},`p${e.index}`)}),O.references.map(e=>(0,o.jsxs)(`li`,{className:`flex items-center gap-1`,"data-reference":e.index,title:`${e.label}: ${w.references[e.index].date}`,children:[(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block h-3 border-l-2 border-dashed`,style:{borderColor:Bm(e.kind===void 0?`#3f3f46`:_e(e.kind).stroke)}}),e.label]},`r${e.index}`))]}),O.kinds.some(e=>ge.has(e))&&(0,o.jsx)(`ul`,{className:`flex flex-wrap gap-3 border-t border-zinc-200 px-2 py-1 text-xs dark:border-zinc-700`,"data-testid":`timeline-legend`,children:O.kinds.filter(e=>ge.has(e)).map(e=>{let t=_e(e);return(0,o.jsxs)(`li`,{className:`flex items-center gap-1`,"data-kind":e,...t.declared===!0?{"data-colour-source":`project`,title:`${e} — project colour`}:{},children:[ge.get(e)?.activity&&(0,o.jsxs)(`svg`,{width:18,height:12,"aria-hidden":`true`,"data-testid":`timeline-legend-bar`,children:[(0,o.jsx)(`rect`,{x:1,y:2,width:16,height:8,rx:2,fill:t.stroke,fillOpacity:.35,stroke:t.stroke,style:Vm({fill:t.stroke,stroke:t.stroke})}),t.hatch!==void 0&&xm(1,2,16,8,t.hatch,t.stroke,4,.8).map((e,t)=>e.shape===`line`?(0,o.jsx)(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,style:Vm({stroke:e.stroke})},t):null)]}),ge.get(e)?.milestone&&(0,o.jsx)(`svg`,{width:14,height:14,"aria-hidden":`true`,"data-testid":`timeline-legend-star`,children:(0,o.jsx)(`path`,{d:bm(7,7,6),fill:t.stroke,style:Vm({fill:t.stroke})})}),(0,o.jsx)(`span`,{className:`font-mono`,children:e}),t.declared===!0&&(0,o.jsx)(`span`,{className:`sr-only`,children:` (project colour)`}),me.has(e)&&(0,o.jsxs)(`span`,{className:`text-zinc-500 dark:text-zinc-400`,"data-testid":`timeline-legend-shared`,children:[`(same colour as `,me.get(e).join(`, `),`)`]})]},e)})}),D!==void 0&&(0,o.jsx)(Qm,{data:w,selection:D,dependencies:O.dependencies})]})}function Qm({data:e,selection:t,dependencies:n}){let r=e.rows[t.row];if(r?.type!==`task`)return null;let i=t.type===`item`?r.items[t.item]:void 0,a=t.type===`task`?r.id:i?.id,s=a===void 0?[]:n.filter(e=>e.to===a),c=a===void 0?[]:n.filter(e=>e.from===a),l=(t,n)=>(0,o.jsxs)(`li`,{"data-satisfied":String(t.satisfied),className:t.satisfied?``:`text-red-700`,children:[gt(e,n),` — `,t.type,t.satisfied?``:` — not satisfied by the dates`]},t.index);return(0,o.jsx)(`div`,{className:`border-t border-zinc-200 px-2 py-1 text-xs dark:border-zinc-700`,"data-testid":`timeline-details`,role:`status`,children:(0,o.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5`,children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Task`}),(0,o.jsxs)(`dd`,{children:[r.label,` `,(0,o.jsxs)(`span`,{className:`font-mono text-zinc-500 dark:text-zinc-400`,children:[`(`,r.id,`)`]})]}),i!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Type`}),(0,o.jsx)(`dd`,{children:i.type}),(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:i.type===`activity`?`Dates`:`Date`}),(0,o.jsx)(`dd`,{className:`font-mono`,children:Xm(i)}),i.label!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Label`}),(0,o.jsx)(`dd`,{children:i.label})]}),i.kind!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Kind`}),(0,o.jsx)(`dd`,{className:`font-mono`,children:i.kind})]}),i.id!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Identifier`}),(0,o.jsx)(`dd`,{className:`font-mono`,children:i.id})]})]}),s.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Waits on`}),(0,o.jsx)(`dd`,{children:(0,o.jsx)(`ul`,{"data-testid":`timeline-predecessors`,children:s.map(e=>l(e,e.from))})})]}),c.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Needed by`}),(0,o.jsx)(`dd`,{children:(0,o.jsx)(`ul`,{"data-testid":`timeline-successors`,children:c.map(e=>l(e,e.to))})})]})]})})}var $m=(0,a.createContext)(null);function eh(e){let t=e.startsWith(`workspace:`)?e.slice(10):/^[a-z][a-z0-9+.-]*:/i.test(e)?null:e;if(t===null||t===``||/^(?:[\\/]|[a-z]:[\\/])/i.test(t))return null;let n=t.replaceAll(`\\`,`/`);return n.split(`/`).includes(`..`)?null:n}function th(e){let t=eh(e);if(t!==null)return{kind:`workspace-file`,path:t};if(/^https?:\/\//i.test(e))return{kind:`external-url`,url:e}}function nh(){let[e,t]=(0,a.useState)(void 0);return{hover:e=>({onPointerEnter:n=>t({text:e,x:n.clientX,y:n.clientY}),onPointerMove:n=>t({text:e,x:n.clientX,y:n.clientY}),onPointerLeave:()=>t(void 0)}),Tooltip:()=>e===void 0?null:(0,o.jsx)(`div`,{"data-testid":`diagram-tooltip`,role:`tooltip`,style:{position:`fixed`,left:e.x+14,top:e.y+14,zIndex:120},className:`pointer-events-none max-w-sm rounded bg-zinc-900 px-2 py-1 text-xs text-white shadow-lg dark:bg-zinc-100 dark:text-zinc-900`,children:e.text})}}function rh({data:e,isProposal:t,arrangement:n,onArrange:r,hidden:i,setHidden:s,orientation:c,viewpoint:l}){let u=(0,a.useRef)(null),[d,f]=(0,a.useState)(void 0),[p,m]=(0,a.useState)(!1),{hover:h,Tooltip:g}=nh(),_=(0,a.useRef)(void 0);(0,a.useEffect)(()=>()=>_.current?.(),[]);let v=(0,a.useContext)($m),[y,b]=(0,a.useState)(void 0),x=y??n,S=(0,a.useMemo)(()=>Tp(e,{isProposal:t,hidden:i,orientation:c,...x===void 0?{}:{arrangement:x},...l===void 0?{}:{viewpoint:l},...v===null?{}:{appearance:v}}),[e,t,i,x,c,l,v]),C=e=>{if(e.button!==0)return;let t=e.target;if(t.closest(`[data-draggable="node"]`)!==null||t.closest(`[data-legend-entry]`)!==null)return;let n=u.current?.parentElement??null;for(;n!==null&&n.scrollWidth<=n.clientWidth&&n.scrollHeight<=n.clientHeight;)n=n.parentElement;if(n===null)return;e.preventDefault();let r=e.clientX,i=e.clientY,a=n.scrollLeft,o=n.scrollTop,s=e.currentTarget;s.setPointerCapture?.(e.pointerId),m(!0);let c=e=>{n.scrollLeft=a-(e.clientX-r),n.scrollTop=o-(e.clientY-i)},l=()=>{_.current=void 0,s.releasePointerCapture?.(e.pointerId),s.removeEventListener(`pointermove`,c),s.removeEventListener(`pointerup`,l),s.removeEventListener(`pointercancel`,l),m(!1)};_.current?.(),_.current=l,s.addEventListener(`pointermove`,c),s.addEventListener(`pointerup`,l),s.addEventListener(`pointercancel`,l)},w=t=>a=>{if(a.button!==0)return;a.preventDefault();let o=u.current,s=o===null?1:(o.getBoundingClientRect().width||S.width)/S.width,l=a.clientX,d=a.clientY,{shown:p,page:m}=Cp(e,{hidden:i,orientation:c,...n===void 0?{}:{arrangement:n}}),h=m.cells.find(e=>e.id===rf(t))?.geometry;if(h===void 0)return;let g=a.currentTarget;g.setPointerCapture?.(a.pointerId),f(t);let v,y,x=e=>{let r={x:h.x+(e.clientX-l)/s,y:h.y+(e.clientY-d)/s};v=Mf(p,m,n,t,r,c),y===void 0&&(y=requestAnimationFrame(()=>{y=void 0,b(v)}))},C=()=>{_.current=void 0,y!==void 0&&cancelAnimationFrame(y),g.releasePointerCapture?.(a.pointerId),g.removeEventListener(`pointermove`,x),g.removeEventListener(`pointerup`,C),g.removeEventListener(`pointercancel`,C),f(void 0),b(void 0),v!==void 0&&r(v)};_.current?.(),_.current=C,g.addEventListener(`pointermove`,x),g.addEventListener(`pointerup`,C),g.addEventListener(`pointercancel`,C)},T=e=>{let t=new Set(i);t.delete(e)||t.add(e),s(t)},E=e=>{let t=e.data?.[`element-id`];if(e.data?.draggable===`node`&&t!==void 0)return{extra:{onPointerDown:w(t),style:{cursor:d===t?`grabbing`:`grab`},...e.title===void 0?{}:h(e.title)}};if(e.data?.[`relationship-role`]!==void 0){let t=e.primitives.find(e=>e.shape===`path`&&e.data?.edge===`line`);return{extra:e.title===void 0?{}:h(e.title),before:t===void 0||t.shape!==`path`?null:(0,o.jsx)(`path`,{"data-edge":`hit`,"data-hit":`edge`,d:t.d,fill:`none`,stroke:`transparent`,strokeWidth:14,pointerEvents:`stroke`})}}let n=e.data?.[`legend-entry`];if(n!==void 0&&e.data?.toggles===`true`){let t=e.primitives[0],r=t.shape===`rect`?t.x:t.shape===`line`?t.x1:0,i=t.shape===`rect`?t.y:t.shape===`line`?t.y1-5:0,a=e.primitives.find(e=>e.shape===`text`),s=a?.shape===`text`?op(a.text.replace(` (hidden)`,``))-8:0;return{extra:{onClick:()=>T(n),style:{cursor:`pointer`}},before:(0,o.jsx)(`rect`,{"data-hit":`legend`,x:r-3,y:i-3,width:s,height:16,fill:`transparent`})}}return{}};return(0,o.jsxs)(o.Fragment,{children:[n!==void 0&&Object.keys(n.elements).length>0&&(0,o.jsx)(`button`,{type:`button`,className:`mb-1 text-xs underline text-neutral-500 hover:text-neutral-800 dark:hover:text-neutral-200`,onClick:()=>r(void 0),children:`reset layout`}),(0,o.jsx)(g,{}),(0,o.jsxs)(`svg`,{ref:u,role:`img`,"aria-label":S.ariaLabel,viewBox:S.viewBox,width:S.width,height:S.height,xmlns:`http://www.w3.org/2000/svg`,onPointerDown:C,style:{cursor:p?`grabbing`:`grab`,touchAction:`none`},children:[(0,o.jsx)(`rect`,{x:Number(S.viewBox.split(` `)[0]),y:Number(S.viewBox.split(` `)[1]),width:S.width,height:S.height,fill:S.background,style:Vm({fill:S.background})}),(0,o.jsx)(Wm,{markers:S.markers}),S.groups.map(e=>(0,o.jsx)(Um,{group:e,interaction:E},e.id))]})]})}function ih({data:e,isProposal:t}){let{hover:n,Tooltip:r}=nh(),i=(0,a.useContext)($m),s=(0,a.useMemo)(()=>Ep(e,{isProposal:t,...i===null?{}:{appearance:i}}),[e,t,i]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`svg`,{role:`img`,"aria-label":s.ariaLabel,viewBox:s.viewBox,width:s.width,height:s.height,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`rect`,{x:0,y:0,width:s.width,height:s.height,fill:s.background,style:Vm({fill:s.background})}),(0,o.jsx)(Wm,{markers:s.markers}),s.groups.map(e=>(0,o.jsx)(Um,{group:e,interaction:e=>e.title===void 0?{}:{extra:n(e.title)}},e.id))]}),(0,o.jsx)(r,{})]})}var ah={added:`bg-emerald-50 dark:bg-emerald-950/40`,changed:`bg-amber-50 dark:bg-amber-950/40`,context:`bg-zinc-50 text-zinc-500 dark:bg-zinc-900/60 dark:text-zinc-400`,removed:`bg-red-50 text-red-800 dark:bg-red-950/40 dark:text-red-200`},oh={added:`border-emerald-600 bg-emerald-100 dark:border-emerald-400 dark:bg-emerald-900`,changed:`border-amber-600 bg-amber-100 dark:border-amber-400 dark:bg-amber-900`,context:`border-zinc-400 bg-zinc-100 dark:border-zinc-500 dark:bg-zinc-800`,removed:`border-red-600 bg-red-100 dark:border-red-400 dark:bg-red-900`},sh=48,ch=16,lh={attribute:{label:`is`,className:`text-zinc-600 dark:text-zinc-300`},expects:{label:`expects`,className:`text-amber-700 dark:text-amber-400`},assigns:{label:`asks to set`,className:`text-blue-700 dark:text-blue-400`},removes:{label:`asks to unset`,className:`text-rose-700 line-through dark:text-rose-400`}};function uh({uri:e,text:t,dispatch:n,sha256:r}){let i=th(e);return i===void 0||n===void 0?(0,o.jsx)(`span`,{"data-followable":`no`,children:t}):i.kind===`workspace-file`?(0,o.jsx)(`button`,{type:`button`,"data-followable":`workspace-file`,className:`text-left underline decoration-dotted underline-offset-2 hover:decoration-solid`,onClick:()=>n({kind:`openFile`,path:i.path,...r===void 0?{}:{sha256:r}}),children:t}):(0,o.jsx)(`a`,{"data-followable":`external-url`,className:`underline decoration-dotted underline-offset-2 hover:decoration-solid`,href:i.url,target:`_blank`,rel:`noreferrer`,children:t})}function dh({item:e,traces:t,dispatch:n}){let r=[...e.attributes.map(([e,t])=>[`attribute`,e,Me(t)]),...e.expectations.map(([e,t])=>[`expects`,e,Me(t)]),...e.assignments.map(([e,t])=>[`assigns`,e,Me(t)]),...e.removedAttributes.map(e=>[`removes`,e,``])],i=t??[];if(r.length===0&&e.locations.length===0&&e.artifacts.length===0&&i.length===0)return null;let s=[r.length>0?`${r.length} attribute${r.length===1?``:`s`}`:``,i.length>0?`${i.length} relation${i.length===1?``:`s`}`:``,e.locations.length>0?`${e.locations.length} location${e.locations.length===1?``:`s`}`:``,e.artifacts.length>0?`${e.artifacts.length} artifact${e.artifacts.length===1?``:`s`}`:``].filter(Boolean);return(0,o.jsxs)(`details`,{className:`mt-1 text-[11px]`,"data-testid":`structured-enrichment`,children:[(0,o.jsx)(`summary`,{className:`cursor-pointer text-zinc-500 dark:text-zinc-400`,children:s.join(`, `)}),(0,o.jsxs)(`dl`,{className:`mt-1 grid grid-cols-[auto_auto_1fr] gap-x-2 gap-y-0.5`,children:[r.map(([e,t,n],r)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)(`dt`,{className:`font-medium ${lh[e].className}`,"data-claim":e,children:lh[e].label}),(0,o.jsx)(`dd`,{className:`font-mono text-zinc-700 dark:text-zinc-200`,children:t}),(0,o.jsx)(`dd`,{className:`break-words text-zinc-600 dark:text-zinc-300`,children:n})]},`${e}-${t}-${r}`)),i.map((e,t)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)(`dt`,{className:`font-medium text-violet-700 dark:text-violet-400`,"data-claim":`relates`,children:e.kind}),(0,o.jsxs)(`dd`,{className:`col-span-2 break-words text-zinc-600 dark:text-zinc-300`,children:[e.fromLabel,` → `,e.toLabel,e.toRow===void 0&&e.toRef!==void 0?` (outside this document)`:``]})]},`trace-${t}`)),e.locations.map((e,t)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)(`dt`,{className:`font-medium text-zinc-500 dark:text-zinc-400`,"data-claim":`location`,children:`at`}),(0,o.jsx)(`dd`,{className:`col-span-2 break-all font-mono text-zinc-600 dark:text-zinc-300`,children:(0,o.jsx)(uh,{uri:e.uri,text:Ne(e),dispatch:n})})]},`location-${t}`)),e.artifacts.map((e,t)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)(`dt`,{className:`font-medium text-zinc-500 dark:text-zinc-400`,"data-claim":`artifact`,children:e.rel}),(0,o.jsx)(`dd`,{className:`col-span-2 break-all font-mono text-zinc-600 dark:text-zinc-300`,children:(0,o.jsx)(uh,{uri:e.uri,text:Pe(e),dispatch:n,sha256:e.sha256})})]},`artifact-${t}`))]})]})}function fh({data:e,hidden:t,setHidden:n,rows:r,traces:i=[],dispatch:s}){let[c,l]=(0,a.useState)(null),u=(0,a.useRef)(null),d=(0,a.useCallback)(()=>[...u.current?.querySelectorAll(`th`)??[]].map(e=>Math.max(sh,Math.round(e.getBoundingClientRect().width))),[]),f=(0,a.useCallback)((e,t)=>l(n=>{let r=n??d(),i=[...r];return i[e]=Math.max(sh,Math.round(t(r[e]??sh))),i}),[d]);function p(e,t){e.preventDefault();let n=e.clientX,r=c??d();l(r);let i=e=>{let i=r[t]??sh;f(t,()=>i+(e.clientX-n))},a=()=>{window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a)};window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a)}let m=c?.reduce((e,t)=>e+t,0),h=(e,t,n)=>(0,o.jsx)(`div`,{role:n?`separator`:`presentation`,"aria-orientation":n?`vertical`:void 0,"aria-label":n?`Resize column ${t}`:void 0,"aria-hidden":!n||void 0,tabIndex:n?0:void 0,onPointerDown:t=>p(t,e),onKeyDown:t=>{if(t.key!==`ArrowLeft`&&t.key!==`ArrowRight`)return;t.preventDefault();let n=t.key===`ArrowRight`?ch:-16;f(e,e=>e+n)},className:`absolute -right-px top-0 h-full w-1.5 cursor-col-resize touch-none hover:bg-zinc-400 focus:bg-zinc-400 focus:outline-none dark:hover:bg-zinc-500 dark:focus:bg-zinc-500`}),g=Fc(e),_=(e,t)=>r?.[t]?.role??Ic(e,g),v=[...new Set(e.rows.map(_).filter(e=>e!==void 0))].sort((e,t)=>Pc.indexOf(e)-Pc.indexOf(t)),y=e.rows.map((e,t)=>({row:e,index:t})).filter(({row:e,index:n})=>{let r=_(e,n);return r===void 0||!t.has(nl(`role`,r))}),b=new Map;for(let e of i)for(let t of[e.fromRow,e.toRow]){if(t===void 0)continue;let n=b.get(t);n===void 0?b.set(t,[e]):n.includes(e)||n.push(e)}let x=e=>{let r=new Set(t),i=nl(`role`,e);r.has(i)?r.delete(i):r.add(i),n(r)};return(0,o.jsxs)(`div`,{className:`overflow-x-auto`,children:[v.length>0&&(0,o.jsx)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2 text-[11px]`,"data-testid":`table-role-key`,children:v.map(e=>{let n=t.has(nl(`role`,e));return(0,o.jsxs)(`button`,{type:`button`,onClick:()=>x(e),"aria-pressed":!n,className:`flex items-center gap-1 rounded border border-zinc-300 px-1.5 py-0.5 dark:border-zinc-700 ${n?`opacity-50`:``}`,children:[(0,o.jsx)(`span`,{"data-role-swatch":e,className:`inline-block h-3 w-3 rounded-sm border-2 ${oh[e]}`}),(0,o.jsxs)(`span`,{children:[Nc[e],n?` (hidden)`:``]})]},e)})}),(0,o.jsxs)(`table`,{className:`border-collapse text-xs ${c?``:`w-full`}`,style:m===void 0?void 0:{tableLayout:`fixed`,width:m},children:[(0,o.jsx)(`colgroup`,{children:e.columns.map((e,t)=>(0,o.jsx)(`col`,{style:c?{width:c[t]}:void 0},t))}),(0,o.jsx)(`thead`,{children:(0,o.jsx)(`tr`,{ref:u,children:e.columns.map((e,t)=>(0,o.jsxs)(`th`,{className:`relative border border-zinc-300 px-2 py-1 text-left font-medium dark:border-zinc-700`,children:[(0,o.jsx)(`span`,{className:`block truncate`,children:e}),h(t,e,!0)]},t))})}),(0,o.jsx)(`tbody`,{children:y.map(({row:t,index:n},i)=>{let{cells:a,heading:c}=ce(t),l=r?.[n],u=l?.role??Ic(t,g),d=l?.id===void 0?[]:b.get(l.id)??[];if(c!==void 0){let t=Math.min(Math.max(l?.depth??1,1),6);return(0,o.jsx)(`tr`,{"data-row-heading":t,className:u===void 0?void 0:ah[u],children:(0,o.jsx)(`th`,{scope:`colgroup`,colSpan:e.columns.length,style:{paddingLeft:`${.5+(t-1)*.75}rem`},className:`border border-zinc-200 bg-zinc-50 py-1 text-left font-semibold dark:border-zinc-800 dark:bg-zinc-900 ${t===1?`text-xs`:`text-[11px] font-medium`} ${u===`removed`?`line-through`:``}`,children:c})},i)}return(0,o.jsx)(`tr`,{className:u===void 0?void 0:ah[u],"data-row-role":u,"data-row-kind":l?.kind,"data-row-ref":l?.ref,children:a.map((t,n)=>(0,o.jsxs)(`td`,{className:`relative border border-zinc-200 px-2 py-1 align-top break-words dark:border-zinc-800 ${u===`removed`?`line-through`:``}`,children:[t===null?(0,o.jsx)(`span`,{className:`opacity-40`,children:`—`}):String(t),n===0&&l!==void 0?(0,o.jsx)(dh,{item:l,traces:d,dispatch:s}):null,h(n,e.columns[n]??``,!1)]},n))},i)})})]})]})}function ph(e,t){if(e===void 0)return JSON.stringify(t,null,2);try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function mh(e,t=` `){let n=[],r=(e,r)=>{for(let i of r)n.push(`${t}${e}: ${i}`)};return r(`attribute`,e.attributes.map(([e,t])=>je(e,t))),r(`expects`,e.expectations.map(([e,t])=>je(e,t))),r(`asks to set`,e.assignments.map(([e,t])=>je(e,t))),r(`asks to unset`,e.removedAttributes),r(`at`,e.locations.map(e=>Ne(e))),r(`artifact`,e.artifacts.map(e=>Pe(e))),n}function hh(e){let t=e.profile===void 0?``:` "${e.profile}"`;if(e.state===`unchecked`)return`Could not be checked against this project's profile${t}: the project's profile registry cannot be used right now.`;if(e.state===`strays`)return`Does not conform to this project's profile${t} as it stands now.`;let n=e.openValues,r=e.findings??0,i=[n===0?void 0:`${n} value${n===1?``:`s`} outside its open enumerations`,r===0?void 0:`${r} finding${r===1?``:`s`} to check`].filter(e=>e!==void 0);return`Conforms to this project's profile${t}${i.length===0?``:`, with ${i.join(` and `)}`}.`}function gh(e,t,n=rl,r){let i=Xc(e,t),a=[];if(i.profile!==void 0&&a.push(`Profile: ${i.profile}`),r!==void 0&&a.push(`Conformance: ${hh(r)}`),i.target!==void 0){let e=i.target.revision===void 0?``:`, prepared against ${i.target.revision}`;a.push(`Proposes changes to ${i.target.ref}${e}`),a.push(`Expectations below are the producer's; the receiving authority checks them before applying.`)}for(let e of i.artifacts)a.push(`Artifact — ${Pe(e)}`);if(a.length>0&&a.push(``),e.kind===`timeline`)return a.push(...vt(e.data)),a.join(`
512
+ `)}\n`}function im(e,t){r.n(new Blob([``,em(e)],{type:`text/csv;charset=utf-8`}),t)}async function am(e,t){let{default:n}=await Promise.resolve().then(()=>require("./browser-CUQnQIhV.cjs")),i=await n([e.columns.map(e=>({value:e,fontWeight:`bold`})),...e.rows.map(e=>e.map(e=>e===null?{value:void 0}:typeof e==`number`?{value:e,type:Number}:typeof e==`boolean`?{value:e,type:Boolean}:{value:e,type:String}))]).toBlob();r.n(i,t)}function om(e,t,n,i){r.n(new Blob([rm(e,t,n)],{type:`text/markdown;charset=utf-8`}),i)}var sm=e=>JSON.parse(JSON.stringify(e));function cm(e){let t=sm(e);return delete t.comparedTo,t.rows=t.rows.filter(e=>e.type!==`task`||e.role!==`removed`).map(e=>(e.type===`task`&&(delete e.role,e.items=e.items.filter(e=>e.role!==`removed`).map(e=>(delete e.role,delete e.previous,e))),e)),t}var lm=`#e4e4e7`,um=`#ea580c`,dm=`#dc2626`,fm=`#2563eb`,pm={fill:`#e4e4e7`,stroke:`#52525b`},mm=.35,hm=.25,gm=8,_m=24,vm=18,ym=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function bm(e,t,n){let r=[];for(let i=0;i<10;i++){let a=i%2==0?n:n*.45,o=-Math.PI/2+i*Math.PI/5;r.push(`${(e+a*Math.cos(o)).toFixed(2)},${(t+a*Math.sin(o)).toFixed(2)}`)}return`M${r.join(`L`)}Z`}function xm(e,t,n,r,i=1,a=`#a1a1aa`,o=6,s=.5){let c=[],l=i=>{for(let l=o;l<n+r;l+=o){let o=Math.min(l,n),u=Math.max(0,l-n),d=Math.max(0,l-r),f=Math.min(l,r);c.push({shape:`line`,x1:e+(i?n-o:o),y1:t+u,x2:e+(i?n-d:d),y2:t+f,stroke:a,strokeWidth:.6,opacity:s})}};return(i===1||i===3)&&l(!1),(i===2||i===3)&&l(!0),c}function Sm(e){let[t,n,r]=Re(e).split(`-`);return`${Number(r)} ${ym[Number(n)-1]} ${t}`}function Cm(e,t){let n=Math.floor(t/Ce);return e.length<=n?e:`${e.slice(0,Math.max(1,n-1))}…`}function wm(e,t,n){let r=e.rows[n.row];if(r?.type!==`task`)return``;let i=r.items[n.item],a=i.type===`activity`?`${i.start} to ${i.end}`:i.date,o=i.id===void 0?[]:t.dependencies.filter(e=>e.from===i.id||e.to===i.id),s=o.filter(e=>!e.satisfied).length;return[`${i.type} ${a}`,i.label,i.kind===void 0?void 0:`kind ${i.kind}`,`task "${r.label}" (${r.id})`,o.length===0?void 0:`${o.length} ${o.length===1?`dependency`:`dependencies`}${s>0?`, ${s} not satisfied`:``}`].filter(e=>e!==void 0).join(`, `)}function Tm(e,t){let n=t.comparison===`new`?cm(e):e,r=ht(n),i=(()=>{let e=ft(n,t.today,{compact:t.compact,pxPerDay:1,onlyChanged:t.onlyChanged});return e.end-e.start+1})(),a=Qe[t.scale??n.time.scale]??Qe.month,o=!1;if(t.pxPerDay!==void 0)a=t.pxPerDay;else if(t.width!==void 0){let e=(t.width-r-16)/i;a=Math.max(hm,e),o=e<hm}let s=t.unit??(t.pxPerDay!==void 0||t.width!==void 0?t.scale:t.scale??n.time.scale),c=ft(n,t.today,{compact:t.compact,pxPerDay:a,onlyChanged:t.onlyChanged,...s===void 0?{}:{unit:s}}),l=Wf(c.kinds,t.appearance?.kinds,{dashes:!1}),u=e=>e===void 0?pm:l.get(e)??pm,d=t.referenceLine??`today`,f=t.showDependencies??!0,p=[Ff,dm,fm].map(e=>({id:gp(`tl`,e),paint:e})),m=[{id:`header-ground`,primitives:[{shape:`rect`,x:0,y:0,width:c.width,height:58,fill:`#ffffff`},...c.unitLines.map(e=>({shape:`line`,x1:e,x2:e,y1:38,y2:58,stroke:lm})),{shape:`line`,x1:0,x2:c.width,y1:57.5,y2:57.5,stroke:Ff}]},...c.upper.map(e=>({id:`upper-${e.x}`,testId:`timeline-upper`,primitives:[{shape:`line`,x1:e.x,x2:e.x,y1:18,y2:58,stroke:Ff},{shape:`text`,x:e.x+4,y:32,text:e.label,fontSize:11,fontWeight:600,fill:Pf,fontFamily:qf,testId:`timeline-upper`}]})),{id:`year-repeats`,primitives:(c.unit===`month`?c.months:[]).filter((e,t)=>t>0&&e.month%3==0&&e.month!==0).map(e=>({shape:`text`,x:e.x+4,y:32,text:String(e.year),fontSize:11,fill:Ff,fontFamily:qf,testId:`timeline-year-repeat`}))},{id:`units`,primitives:c.lower.map(e=>({shape:`text`,x:e.x+e.width/2,y:52,text:nt(e,c.unit),fontSize:10,textAnchor:`middle`,fill:Ff,fontFamily:qf,testId:`timeline-unit`}))}];c.periods.length>0&&m.push({id:`calendar-bands`,primitives:c.periods.map(e=>({shape:`rect`,x:e.x,y:18,width:e.width,height:40,fill:e.kind===void 0?`#a1a1aa`:u(e.kind).stroke,fillOpacity:e.kind===void 0?.1:.12}))}),c.headerLabels.length>0&&m.push({id:`calendar-names`,primitives:c.headerLabels.map(e=>{let t=e.of===`period`?c.periods.find(t=>t.index===e.index)?.kind:c.references.find(t=>t.index===e.index)?.kind;return{shape:`text`,...e.of===`reference`?{x:e.x+e.width/2,textAnchor:`middle`}:{x:e.x},y:12,text:e.text,fontSize:10,fill:t===void 0?Ff:u(t).stroke,fontFamily:qf,testId:`timeline-${e.of}-name`}})});let h=d===`dated`?Sm(t.today):`Today`;if(d!==`none`&&`x`in c.today){let e=c.today.x,t=Math.max(44,h.length*6+10);m.push({id:`today-tag`,testId:`timeline-today-tag`,primitives:[{shape:`rect`,x:e-t/2,y:1,width:t,height:15,rx:3,fill:um},{shape:`text`,x:e,y:12,text:h,fontSize:10,fontWeight:600,textAnchor:`middle`,fill:`#ffffff`,fontFamily:qf},{shape:`line`,x1:e,x2:e,y1:16,y2:58,stroke:um,strokeWidth:2}]})}if(d!==`none`&&`outside`in c.today){let e=c.today.outside===`before`,t=d===`dated`?Sm(c.today.day):`Today (${Re(c.today.day)})`;m.push({id:`today-outside`,primitives:[{shape:`text`,x:e?4:c.width-4,y:12,text:e?`◂ ${t} is before this range`:`${t} is after this range ▸`,fontSize:10,fontWeight:600,textAnchor:e?`start`:`end`,fill:um,fontFamily:qf,testId:`timeline-today-outside`,data:{side:c.today.outside}}]})}let g=(()=>{if(t.selection===void 0)return;let e=n.rows[t.selection.row];if(e?.type===`task`)return t.selection.item===void 0?e.id:e.items[t.selection.item]?.id})(),_=e=>g!==void 0&&(e.from===g||e.to===g),v=[{id:`rows-ground`,primitives:[{shape:`rect`,x:0,y:0,width:c.width,height:c.height,fill:`#ffffff`},...c.unitLines.map(e=>({shape:`line`,x1:e,x2:e,y1:0,y2:c.height,stroke:lm}))]},...c.rows.map(e=>e.type===`separator`?{id:`separator-${e.row}`,testId:`timeline-separator`,primitives:[{shape:`rect`,x:0,y:e.y,width:c.width,height:e.height,fill:`#f4f4f5`},{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#a1a1aa`,strokeWidth:1.5}]}:e.type===`section`?{id:`section-${e.row}`,testId:`timeline-section`,primitives:[{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#a1a1aa`,strokeWidth:1.5}]}:{id:`row-${e.row}`,primitives:[{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#f4f4f5`}]})];for(let e of c.periods){let t=n.periods[e.index],r=`${t.label??`Period`}: ${Sm(Le(t.start))} – ${Sm(Le(t.end))}`,i=[{shape:`rect`,x:e.x,y:0,width:e.width,height:c.height,fill:e.kind===void 0?`#a1a1aa`:u(e.kind).stroke,fillOpacity:e.kind===void 0?.1:.12}];e.kind===void 0&&i.push(...xm(e.x,0,e.width,c.height)),v.push({id:`period-${e.index}`,testId:`timeline-period`,title:r,data:{...e.kind?{kind:e.kind}:{}},primitives:i})}for(let e of c.references){let t=e.kind===void 0?`#3f3f46`:u(e.kind).stroke;v.push({id:`reference-${e.index}`,testId:`timeline-reference`,title:`${e.label}: ${Sm(Le(e.date))}`,data:{...e.kind?{kind:e.kind}:{}},primitives:[{shape:`line`,x1:e.x,x2:e.x,y1:0,y2:c.height,stroke:t,strokeWidth:1.5,strokeDasharray:`6 3`}]})}if(f)for(let e of c.dependencies){let t=_(e),r=t?fm:e.satisfied?Ff:dm,i=n.dependencies[e.index];v.push({id:`dependency-${e.index}`,testId:`timeline-dependency`,title:_t(n,i,e.satisfied),data:{from:e.from,to:e.to,type:e.type,satisfied:String(e.satisfied),emphasised:String(t)},primitives:[{shape:`path`,d:`M${e.points.map(e=>`${e.x},${e.y}`).join(` L`)}`,stroke:r,strokeWidth:t?2.25:1.25,...e.satisfied?{}:{strokeDasharray:`4 3`},markerEnd:gp(`tl`,r)}]})}for(let e of c.items){let r=u(e.kind),i=t.selection?.row===e.row&&t.selection.item===e.item,a=[],o=e.change===`removed`;if(e.ghost!==void 0&&(e.type===`activity`?a.push({shape:`rect`,x:e.ghost.x,y:e.ghost.y,width:e.ghost.width,height:e.ghost.height,rx:3,fill:`none`,stroke:r.stroke,strokeWidth:1.25,strokeDasharray:`4 3`,data:{previous:`true`}}):e.ghostCenter!==void 0&&(e.ghostCenter.y===e.center.y&&a.push({shape:`line`,x1:e.ghostCenter.x,x2:e.center.x,y1:e.center.y,y2:e.center.y,stroke:Ff,strokeWidth:1,strokeDasharray:`2 2`}),a.push({shape:`path`,d:bm(e.ghostCenter.x,e.ghostCenter.y,7),fill:`none`,stroke:r.stroke,strokeWidth:1,strokeDasharray:`2 2`,data:{previous:`true`}}))),o)a.push(e.type===`activity`?{shape:`rect`,x:e.glyph.x,y:e.glyph.y,width:e.glyph.width,height:e.glyph.height,rx:3,fill:`none`,stroke:r.stroke,strokeWidth:1.25,strokeDasharray:`4 3`}:{shape:`path`,d:bm(e.center.x,e.center.y,7),fill:`none`,stroke:r.stroke,strokeWidth:1,strokeDasharray:`2 2`});else if(e.type===`activity`){let t=e.kind!==void 0;a.push({shape:`rect`,x:e.glyph.x,y:e.glyph.y,width:e.glyph.width,height:e.glyph.height,rx:3,fill:t?r.stroke:r.fill,...t?{fillOpacity:mm}:{},stroke:i?fm:r.stroke,strokeWidth:i?2.5:1.25}),r.hatch!==void 0&&a.push(...xm(e.glyph.x,e.glyph.y,e.glyph.width,e.glyph.height,r.hatch,r.stroke,4,.8))}else a.push({shape:`path`,d:bm(e.center.x,e.center.y,7),fill:r.stroke,stroke:i?fm:`#ffffff`,strokeWidth:i?2:.75});e.label!==void 0&&a.push({shape:`text`,x:e.label.x,y:e.label.y+12,...e.label.note!==void 0&&e.label.text.endsWith(e.label.note)?{text:e.label.text.slice(0,-e.label.note.length).trimEnd(),note:e.label.note}:{text:e.label.text},fontSize:11,fill:Pf,fontFamily:qf,testId:`timeline-annotation`,...e.label.struck?{textDecoration:`line-through`}:{},...e.label.inside?{}:{stroke:`#ffffff`,strokeWidth:3,paintOrder:`stroke`}}),v.push({id:`item-${e.row}-${e.item}`,testId:`timeline-${e.type}`,title:wm(n,c,e),data:{row:String(e.row),item:String(e.item),...e.kind===void 0?{}:{kind:e.kind},...e.change===void 0?{}:{change:e.change},selected:String(i)},primitives:a})}d!==`none`&&`x`in c.today&&v.push({id:`today`,testId:`timeline-today`,primitives:[{shape:`line`,x1:c.today.x,x2:c.today.x,y1:0,y2:c.height,stroke:um,strokeWidth:2,opacity:.85}]});let y=c.rows.map(e=>{let t=58+e.y,n=e.type===`section`?`${e.label??``} (${e.tasks.length})`.trim():e.type===`separator`?e.label??``:e.label,i=e.type!==`task`;return{id:`label-${e.row}`,primitives:[...i?[{shape:`line`,x1:0,x2:r,y1:t+.5,y2:t+.5,stroke:`#a1a1aa`,strokeWidth:1}]:[],{shape:`text`,x:8,y:e.type===`separator`?t+e.height-6:t+e.height/2+4,text:Cm(n,r-12),fontSize:11,...i?{fontWeight:600}:{},fill:i?Ff:Pf,fontFamily:qf}]}}),b=new Map;for(let e of n.rows)if(e.type===`task`)for(let t of e.items){if(t.kind===void 0)continue;let e=b.get(t.kind)??{activity:!1,milestone:!1};e[t.type]=!0,b.set(t.kind,e)}let x=Gf(c.kinds,l),S=[],C=0,w=0,T=r+c.width;for(let e of c.kinds){let t=u(e),n=b.get(e);if(n===void 0)continue;let r=x.has(e)?`${e} (same colour as ${x.get(e).join(`, `)})`:e,i=(n.activity?22:0)+(n.milestone?16:0)+r.length*Ce+18;C>0&&C+i>T&&(C=0,w+=1);let a=w*vm,o=[],s=C;n.activity&&(o.push({shape:`rect`,x:s,y:a+4,width:16,height:8,rx:2,fill:t.stroke,stroke:t.stroke,fillOpacity:mm}),t.hatch!==void 0&&o.push(...xm(s,a+4,16,8,t.hatch,t.stroke,4,.8)),s+=22),n.milestone&&(o.push({shape:`path`,d:bm(s+6,a+8,6),fill:t.stroke}),s+=16),o.push({shape:`text`,x:s,y:a+12,text:r,fontSize:10,fill:Ff,fontFamily:qf}),S.push({id:`legend-${e}`,...t.declared===!0?{title:`${e} — project colour`,data:{kind:e,"colour-source":`project`}}:{data:{kind:e}},primitives:o}),C+=i}let E=[...c.periods.map(e=>({kind:e.kind,line:!1,text:n.periods[e.index].label??`Period`})),...c.references.map(e=>({kind:e.kind,line:!0,text:e.label}))];if(E.length>0&&(C>0&&(C=0,w+=1),E.forEach((e,t)=>{let n=22+e.text.length*Ce+18;C>0&&C+n>T&&(C=0,w+=1);let r=w*vm,i=e.kind===void 0?e.line?`#3f3f46`:`#a1a1aa`:u(e.kind).stroke;S.push({id:`legend-calendar-${t}`,testId:`timeline-calendar-legend`,primitives:[e.line?{shape:`line`,x1:C+8,x2:C+8,y1:r+2,y2:r+14,stroke:i,strokeWidth:1.5,strokeDasharray:`3 2`}:{shape:`rect`,x:C,y:r+3,width:16,height:10,fill:i,fillOpacity:.25},{shape:`text`,x:C+22,y:r+12,text:e.text,fontSize:10,fill:Ff,fontFamily:qf}]}),C+=n})),n.comparedTo!==void 0){C>0&&(C=0,w+=1);let e=w*vm,t=[{shape:`rect`,x:0,y:e+4,width:16,height:8,rx:2,fill:`none`,stroke:Ff,strokeDasharray:`4 3`},{shape:`text`,x:22,y:e+12,text:`previous dates (${n.comparedTo.label})`,fontSize:10,fill:Ff,fontFamily:qf}],r=22+(`previous dates (${n.comparedTo.label})`.length+3)*Ce;t.push({shape:`text`,x:r,y:e+12,text:`(new)`,fontStyle:`italic`,fontSize:10,fill:Ff,fontFamily:qf},{shape:`text`,x:r+5*Ce,y:e+12,text:`: added since`,fontSize:10,fill:Ff,fontFamily:qf},{shape:`text`,x:r+20*Ce,y:e+12,text:`removed`,fontSize:10,fill:Ff,fontFamily:qf,textDecoration:`line-through`},{shape:`text`,x:r+28*Ce,y:e+12,text:`: dropped since`,fontSize:10,fill:Ff,fontFamily:qf}),S.push({id:`legend-comparison`,testId:`timeline-comparison-legend`,primitives:t})}let ee=S.length===0?0:(w+1)*vm+6;return{layout:c,pxPerDay:a,overWidth:o,labelWidth:r,tints:l,markers:p,header:m,rows:v,labels:y,legend:{groups:S,height:ee}}}function Em(e,t,n){let r=e=>{switch(e.shape){case`rect`:case`text`:return{...e,x:e.x+t,y:e.y+n};case`line`:return{...e,x1:e.x1+t,x2:e.x2+t,y1:e.y1+n,y2:e.y2+n};case`path`:return{...e,d:Dm(e.d,t,n)}}};return{...e,primitives:e.primitives.map(r),...e.groups?{groups:e.groups.map(e=>Em(e,t,n))}:{}}}function Dm(e,t,n){return e.replace(/(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)/g,(e,r,i)=>`${+(Number(r)+t).toFixed(2)},${+(Number(i)+n).toFixed(2)}`)}function Om(e,t){let n=Tm(e,{...t,selection:void 0}),r=t.comparison===`new`?void 0:e.comparedTo,i=gm+(e.title?_m:0)+(r?18:0),a=gm,o=a+n.labelWidth,s=[];if(e.title&&s.push({id:`title`,primitives:[{shape:`text`,x:a,y:23,text:e.title,fontSize:13,fontWeight:600,fill:Pf,fontFamily:qf}]}),r){let t=gm+(e.title?_m:0)+12;s.push({id:`compared-to`,testId:`timeline-compared-to`,primitives:[{shape:`text`,x:a,y:t,text:`Compared with ${r.label}${r.date?` (${Sm(Le(r.date)??0)})`:``}`,fontSize:11,fill:Ff,fontFamily:qf}]})}s.push(...n.header.map(e=>Em(e,o,i))),s.push(...n.rows.map(e=>Em(e,o,i+58))),s.push(...n.labels.map(e=>Em(e,a,i)));let c=i+58+n.layout.height+10;s.push(...n.legend.groups.map(e=>Em(e,a,c)));let l=Math.ceil(o+n.layout.width+gm),u=Math.ceil(c+n.legend.height+gm);return{width:l,height:u,viewBox:`0 0 ${l} ${u}`,ariaLabel:`Timeline${e.title?` "${e.title}"`:``} from ${e.time.start} to ${e.time.end}`,background:`#ffffff`,markers:n.markers,groups:s,overWidth:n.overWidth}}var km=.21,Am=.65;function jm(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Mm(e){return e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055}function Nm(e,t,n){let r=jm(e),i=jm(t),a=jm(n),o=Math.cbrt(.4122214708*r+.5363325363*i+.0514459929*a),s=Math.cbrt(.2119034982*r+.6806995451*i+.1073969566*a),c=Math.cbrt(.0883024619*r+.2817188376*i+.6299787005*a);return{l:.2104542553*o+.793617785*s-.0040720468*c,a:1.9779984951*o-2.428592205*s+.4505937099*c,b:.0259040371*o+.7827717662*s-.808675766*c}}function Pm({l:e,a:t,b:n}){let r=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[4.0767416621*r-3.3077115913*i+.2309699292*a,-1.2684380046*r+2.6097574011*i-.3413193965*a,-.0041960863*r-.7034186147*i+1.707614701*a]}var Fm=e=>e.every(e=>e>=-1e-4&&e<=1.0001);function Im(e){return`#${e.map(e=>Math.round(Math.min(1,Math.max(0,Mm(Math.min(1,Math.max(0,e)))))*255).toString(16).padStart(2,`0`)).join(``)}`}var Lm=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,Rm=new Map;function zm(e){if(!Lm.test(e))return e;let t=Rm.get(e);if(t!==void 0)return t;let[n,r,i]=(e.length===4?[...e.slice(1)].map(e=>e+e):[1,3,5].map(t=>e.slice(t,t+2))).map(e=>Number.parseInt(e,16)/255),a=Nm(n,r,i),o=km+.73*(1-Math.min(1,Math.max(0,a.l)))**Am,s=Pm({l:o,a:a.a,b:a.b});if(!Fm(s)){let e=0,t=1;for(let n=0;n<20;n++){let n=(e+t)/2;Fm(Pm({l:o,a:a.a*n,b:a.b*n}))?e=n:t=n}let n=e;s=Pm({l:o,a:a.a*n,b:a.b*n})}let c=Im(s);return Rm.set(e,c),c}function Bm(e){if(e!==void 0&&Lm.test(e))return`light-dark(${e}, ${zm(e)})`}function Vm(e){let t=Bm(e.fill),n=Bm(e.stroke);if(t!==void 0||n!==void 0)return{...t===void 0?{}:{fill:t},...n===void 0?{}:{stroke:n}}}function Hm({primitive:e}){let t=Object.fromEntries(Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t]));switch(e.shape){case`rect`:return(0,o.jsx)(`rect`,{...t,x:e.x,y:e.y,width:e.width,height:e.height,rx:e.rx,fill:e.fill,fillOpacity:e.fillOpacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,opacity:e.opacity,style:Vm(e)});case`text`:{let n={x:e.x,y:e.y,fontSize:e.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,textAnchor:e.textAnchor},r=(0,o.jsxs)(o.Fragment,{children:[e.text,e.note!==void 0&&(0,o.jsxs)(o.Fragment,{children:[` `,(0,o.jsx)(`tspan`,{fontStyle:`italic`,children:e.note})]})]}),i=e.paintOrder===`stroke`,a=(0,o.jsx)(`text`,{...t,"data-testid":e.testId,...n,fill:e.fill,stroke:i?void 0:e.stroke,strokeWidth:i?void 0:e.strokeWidth,textDecoration:e.textDecoration,opacity:e.opacity,style:Vm({fill:e.fill,stroke:i?void 0:e.stroke}),children:r});return i?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`text`,{...n,fill:e.stroke,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,style:Vm({fill:e.stroke,stroke:e.stroke}),"aria-hidden":`true`,children:r}),a]}):a}case`line`:return(0,o.jsx)(`line`,{...t,x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,opacity:e.opacity,markerEnd:e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`,style:Vm(e)});case`path`:return(0,o.jsx)(`path`,{...t,d:e.d,fill:e.fill??`none`,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,strokeLinecap:e.strokeLinecap,opacity:e.opacity,markerEnd:e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`,pointerEvents:`none`,style:Vm(e)})}}function Um({group:e,interaction:t}){let n=Object.fromEntries(Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t])),{extra:r,before:i}=t?.(e)??{};return(0,o.jsxs)(`g`,{...n,"data-testid":e.testId,opacity:e.opacity,...r,children:[e.title===void 0?null:(0,o.jsx)(`title`,{children:e.title}),i,e.primitives.map((e,t)=>(0,o.jsx)(Hm,{primitive:e},t)),(e.groups??[]).map(e=>(0,o.jsx)(Um,{group:e,interaction:t},e.id))]})}function Wm({markers:e}){return(0,o.jsx)(`defs`,{children:e.map(e=>(0,o.jsx)(`marker`,{id:e.id,markerWidth:`7`,markerHeight:`7`,refX:`9`,refY:`5`,viewBox:`0 0 10 10`,markerUnits:`userSpaceOnUse`,orient:`auto`,children:(0,o.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:e.paint,style:Vm({fill:e.paint})})},e.id))})}var Gm=`#2563eb`,Km={fill:`#e4e4e7`,stroke:`#52525b`};function qm(e){let t=e.replace(/[^\p{L}\p{N}._-]+/gu,`-`),n=0,r=t.length;for(;n<r&&t[n]===`-`;)n+=1;for(;r>n&&t[r-1]===`-`;)--r;return t.slice(n,r)}var Jm=[`week`,`month`,`quarter`,`fit`];function Ym(e){return{scale:e.time.scale,compact:!1,showDependencies:!0,comparison:`compare`,onlyChanged:!1}}function Xm(e){return e.type===`activity`?`${e.start} to ${e.end}`:e.date}function Zm({data:e,today:t,appearance:n,display:r,onDisplayChange:i,onSelect:s,saveFigure:c,exportRef:l}){let u=t??ze(),[d,f]=(0,a.useState)(()=>Ym(e)),p=r??d,m=i??f,h=e=>t=>m(n=>({...n,[e]:typeof t==`function`?t(n[e]):t})),g=e.comparedTo!==void 0,{comparison:_,onlyChanged:v,compact:y,showDependencies:b,scale:x}=p,S=h(`comparison`),C=h(`onlyChanged`),w=(0,a.useMemo)(()=>g&&_===`new`?cm(e):e,[e,g,_]),T=g&&_===`compare`&&v,E=h(`compact`),ee=h(`showDependencies`),[D,te]=(0,a.useState)(void 0),ne=h(`scale`),re=(0,a.useRef)(null),[ie,ae]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=re.current;if(e===null||(ae(e.clientWidth),typeof ResizeObserver>`u`))return;let t=0,n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>ae(e.clientWidth))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]);let oe=(Le(w.time.end)??0)-(Le(w.time.start)??0)+1,se=ie>0?ie/oe:0,ce=x===`fit`?{pxPerDay:Math.max(hm,se)}:{pxPerDay:Math.max(Qe[x],se),unit:x},[le,ue]=(0,a.useState)(void 0),de=(0,a.useMemo)(()=>Tm(w,{today:u,compact:y,showDependencies:b,appearance:n??null,referenceLine:`today`,onlyChanged:T,...ce,...D===void 0?{}:{selection:D.type===`item`?{row:D.row,item:D.item}:{row:D.row}}}),[w,u,y,b,n,D,T,x,ie]),O=de.layout,fe=de.tints,pe=(0,a.useMemo)(()=>{let e=!1;for(let t of w.rows)if(t.type===`separator`)e=!0;else if(e)return!0;return!1},[w]),me=(0,a.useMemo)(()=>Gf(O.kinds,fe),[O.kinds,fe]),he=(0,a.useMemo)(()=>ht(w),[w]),ge=(0,a.useMemo)(()=>{let e=new Map;for(let t of w.rows)if(t.type===`task`)for(let n of t.items){if(n.kind===void 0)continue;let t=e.get(n.kind)??{activity:!1,milestone:!1};t[n.type]=!0,e.set(n.kind,t)}return e},[w]),_e=e=>e===void 0?Km:fe.get(e)??Km,ve=(e,t)=>e!==void 0&&e.type===t.type&&e.row===t.row&&(e.type===`task`||t.type===`item`&&e.item===t.item),ye=e=>{let t=ve(D,e);if(te(t=>ve(t,e)?void 0:e),!s)return;let n=w.rows[e.row];if(t||n?.type!==`task`)return s(void 0);s(e.type===`item`?{task:n,item:n.items[e.item]}:{task:n})},be=(e,t)=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),ye(t))},xe=e=>{let t=e.data?.row,n=e.data?.item;if(e.testId!==`timeline-activity`&&e.testId!==`timeline-milestone`||t===void 0||n===void 0)return{};let r={type:`item`,row:Number(t),item:Number(n)},i=`${t}:${n}`,a=O.items.find(e=>e.row===r.row&&e.item===r.item);return{extra:{role:`button`,tabIndex:0,"aria-label":e.title,"aria-pressed":e.data?.selected===`true`,style:{cursor:`pointer`,outline:`none`},onClick:()=>ye(r),onKeyDown:e=>be(e,r),onFocus:()=>ue(i),onBlur:()=>ue(e=>e===i?void 0:e)},before:a===void 0?void 0:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`rect`,{"data-testid":`timeline-hit`,x:a.glyph.x,y:a.glyph.y,width:a.glyph.width,height:a.glyph.height,fill:`transparent`}),le===i&&(0,o.jsx)(`rect`,{"data-testid":`timeline-focus-ring`,x:a.glyph.x-3,y:a.glyph.y-3,width:a.glyph.width+6,height:a.glyph.height+6,rx:4,fill:`none`,stroke:Gm,strokeWidth:1.5,strokeDasharray:`3 2`,style:Vm({stroke:Gm})})]})}},[k,A]=(0,a.useState)(null),Se=()=>ep(Om(w,{today:u,compact:y,showDependencies:b,onlyChanged:T,appearance:n??null,referenceLine:`dated`,...ce})),Ce=`timeline-${qm(w.title??`plan`)||`plan`}.svg`,we=async()=>{if(c){let e=await c(Ce,Se()).catch(()=>!1);A(e===!1?`could not save`:e)}else{let e=URL.createObjectURL(new Blob([Se()],{type:`image/svg+xml`})),t=document.createElement(`a`);t.href=e,t.download=Ce,t.click(),URL.revokeObjectURL(e),A(`SVG downloaded`)}window.setTimeout(()=>A(null),2500)};(0,a.useImperativeHandle)(l,()=>({svg:()=>void we()}));let Te=async()=>{A(await Bt(Se())?`SVG markup copied`:`could not copy`),window.setTimeout(()=>A(null),2500)};(0,a.useEffect)(()=>{let e=re.current;if(e===null)return;let t=dt(O,e.clientWidth);t!==void 0&&(e.scrollLeft=t)},[]);let Ee=(0,a.useRef)(void 0),De=e=>{let t=re.current;t!==null&&(Ee.current=O.start+(t.scrollLeft+t.clientWidth/2)/de.pxPerDay),ne(e)};return(0,a.useLayoutEffect)(()=>{let e=re.current,t=Ee.current;Ee.current=void 0,e!==null&&t!==void 0&&(e.scrollLeft=Math.max(0,(t-O.start)*de.pxPerDay-e.clientWidth/2))},[de.pxPerDay,O.start]),(0,o.jsxs)(`div`,{"data-testid":`timeline`,className:`w-full min-w-0 rounded border border-zinc-200 bg-white text-zinc-800 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100`,onKeyDown:e=>{e.key===`Escape`&&te(void 0)},children:[w.title!==void 0&&w.title!==``&&(0,o.jsx)(`p`,{className:`border-b border-zinc-200 px-2 py-1 text-sm font-medium dark:border-zinc-700`,"data-testid":`timeline-title`,children:w.title}),g&&_===`compare`&&(0,o.jsxs)(`p`,{className:`border-b border-zinc-200 px-2 py-0.5 text-xs text-zinc-500 dark:border-zinc-700 dark:text-zinc-400`,"data-testid":`timeline-compared-to`,children:[`Compared with `,(0,o.jsx)(`span`,{className:`font-medium text-zinc-700 dark:text-zinc-200`,children:e.comparedTo.label}),e.comparedTo.date===void 0?``:` (${e.comparedTo.date})`]}),(0,o.jsxs)(`div`,{className:`flex`,children:[(0,o.jsxs)(`div`,{className:`shrink-0 border-r border-zinc-200 text-xs dark:border-zinc-700`,style:{width:he},"data-testid":`timeline-labels`,children:[(0,o.jsx)(`div`,{style:{height:58}}),O.rows.map(e=>e.type===`section`?(0,o.jsxs)(`div`,{"data-testid":`timeline-section-label`,className:`flex items-center border-t border-zinc-400 px-2 font-semibold text-zinc-600 dark:border-zinc-600 dark:text-zinc-300`,style:{height:e.height},title:`${e.label??`Untitled section`}: ${e.tasks.length} ${e.tasks.length===1?`task`:`tasks`}`,children:[(0,o.jsx)(`span`,{className:`truncate`,children:e.label??``}),(0,o.jsxs)(`span`,{className:`ml-1 shrink-0 font-normal text-zinc-400 dark:text-zinc-500`,children:[`(`,e.tasks.length,`)`]})]},e.row):e.type===`separator`?(0,o.jsx)(`div`,{"data-testid":`timeline-separator-label`,className:`flex items-end border-t border-zinc-400 px-2 font-semibold text-zinc-600 dark:border-zinc-600 dark:text-zinc-300`,style:{height:e.height},children:e.label??``},e.row):(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-task-label`,"aria-pressed":D?.type===`task`&&D.row===e.row,className:`block w-full truncate border-t border-zinc-100 px-2 text-left hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-800 `+(D?.type===`task`&&D.row===e.row?`bg-blue-50 font-medium dark:bg-blue-950/50`:``),style:{height:e.height},title:`${e.label} (${e.id})`,onClick:()=>ye({type:`task`,row:e.row}),children:e.label},e.row))]}),(0,o.jsxs)(`div`,{ref:re,className:`min-w-0 flex-1 overflow-x-auto`,"data-testid":`timeline-scroller`,children:[(0,o.jsx)(`svg`,{width:O.width,height:58,role:`img`,"aria-label":`Calendar from ${w.time.start} to ${w.time.end}`,"data-testid":`timeline-header`,xmlns:`http://www.w3.org/2000/svg`,style:{display:`block`},children:de.header.map(e=>(0,o.jsx)(Um,{group:e},e.id))}),(0,o.jsxs)(`svg`,{width:O.width,height:O.height,role:`group`,"aria-label":`Tasks and items${w.title?` of ${w.title}`:``}`,"data-testid":`timeline-body`,xmlns:`http://www.w3.org/2000/svg`,style:{display:`block`},children:[(0,o.jsx)(Wm,{markers:de.markers}),de.rows.map(e=>(0,o.jsx)(Um,{group:e,interaction:xe},e.id))]})]})]}),(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-zinc-200 px-2 py-1 text-xs dark:border-zinc-700`,children:[(0,o.jsx)(`span`,{className:`flex items-center gap-1 text-zinc-500 dark:text-zinc-400`,role:`group`,"aria-label":`Scale`,"data-testid":`timeline-scale`,children:Jm.map((e,t)=>(0,o.jsxs)(`span`,{className:`flex items-center gap-1`,children:[t>0&&(0,o.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,o.jsx)(`button`,{type:`button`,"data-scale":e,"aria-pressed":x===e,className:x===e?`font-semibold text-zinc-800 dark:text-zinc-100`:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>De(e),children:e})]},e))}),g&&(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-comparison-toggle`,"aria-pressed":_===`new`,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>{te(void 0),S(e=>e===`compare`?`new`:`compare`)},children:_===`compare`?`new version only`:`show the comparison`}),g&&_===`compare`&&(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-only-changed-toggle`,"aria-pressed":v,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>{te(void 0),C(e=>!e)},children:v?`show every task`:`only what moved`}),T&&O.hiddenTasks>0&&(0,o.jsxs)(`span`,{className:`text-amber-700 dark:text-amber-400`,"data-testid":`timeline-unchanged-hidden`,children:[O.hiddenTasks,` unchanged `,O.hiddenTasks===1?`task`:`tasks`,` hidden`]}),pe&&(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-compact-toggle`,"aria-pressed":y,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>{te(e=>e?.type===`task`?void 0:e),E(e=>!e)},children:y?`one row per task`:`one row per section`}),(w.dependencies??[]).length>0&&(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-dependencies-toggle`,"aria-pressed":!b,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>ee(e=>!e),children:b?`hide dependencies`:`show dependencies`}),!b&&(0,o.jsxs)(`span`,{className:`text-amber-700 dark:text-amber-400`,"data-testid":`timeline-dependencies-hidden`,children:[O.dependencies.length,` `,O.dependencies.length===1?`dependency`:`dependencies`,` hidden`,O.dependencies.some(e=>!e.satisfied)?`, some not satisfied by the dates`:``]}),(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-download-svg`,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>void we(),children:`⤓ download SVG`}),(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-copy-svg`,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>void Te(),children:`copy markup`}),k!==null&&(0,o.jsx)(`span`,{role:`status`,className:`text-emerald-700 dark:text-emerald-400`,children:k})]}),g&&_===`compare`&&(0,o.jsxs)(`p`,{className:`flex flex-wrap items-center gap-3 border-t border-zinc-200 px-2 py-1 text-xs text-zinc-500 dark:border-zinc-700 dark:text-zinc-400`,"data-testid":`timeline-comparison-key`,children:[(0,o.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,o.jsx)(`svg`,{width:18,height:12,"aria-hidden":`true`,children:(0,o.jsx)(`rect`,{x:1,y:2,width:16,height:8,rx:2,fill:`none`,stroke:`#71717a`,strokeDasharray:`4 3`,style:Vm({stroke:`#71717a`})})}),`previous dates`]}),(0,o.jsxs)(`span`,{children:[(0,o.jsx)(`i`,{children:`(new)`}),`: added since`]}),(0,o.jsxs)(`span`,{children:[(0,o.jsx)(`span`,{className:`line-through`,children:`removed`}),`: dropped since`]})]}),(O.periods.length>0||O.references.length>0)&&(0,o.jsxs)(`ul`,{className:`flex flex-wrap gap-3 border-t border-zinc-200 px-2 py-1 text-xs text-zinc-600 dark:border-zinc-700 dark:text-zinc-300`,"data-testid":`timeline-calendar-legend`,children:[O.periods.map(e=>{let t=w.periods[e.index];return(0,o.jsxs)(`li`,{className:`flex items-center gap-1`,"data-period":e.index,title:`${t.label??`Period`}: ${t.start} – ${t.end}`,children:[(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block h-2.5 w-4 rounded-sm`,style:{background:Bm(e.kind===void 0?`#a1a1aa`:_e(e.kind).stroke),opacity:.35}}),t.label??`Period`]},`p${e.index}`)}),O.references.map(e=>(0,o.jsxs)(`li`,{className:`flex items-center gap-1`,"data-reference":e.index,title:`${e.label}: ${w.references[e.index].date}`,children:[(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block h-3 border-l-2 border-dashed`,style:{borderColor:Bm(e.kind===void 0?`#3f3f46`:_e(e.kind).stroke)}}),e.label]},`r${e.index}`))]}),O.kinds.some(e=>ge.has(e))&&(0,o.jsx)(`ul`,{className:`flex flex-wrap gap-3 border-t border-zinc-200 px-2 py-1 text-xs dark:border-zinc-700`,"data-testid":`timeline-legend`,children:O.kinds.filter(e=>ge.has(e)).map(e=>{let t=_e(e);return(0,o.jsxs)(`li`,{className:`flex items-center gap-1`,"data-kind":e,...t.declared===!0?{"data-colour-source":`project`,title:`${e} — project colour`}:{},children:[ge.get(e)?.activity&&(0,o.jsxs)(`svg`,{width:18,height:12,"aria-hidden":`true`,"data-testid":`timeline-legend-bar`,children:[(0,o.jsx)(`rect`,{x:1,y:2,width:16,height:8,rx:2,fill:t.stroke,fillOpacity:.35,stroke:t.stroke,style:Vm({fill:t.stroke,stroke:t.stroke})}),t.hatch!==void 0&&xm(1,2,16,8,t.hatch,t.stroke,4,.8).map((e,t)=>e.shape===`line`?(0,o.jsx)(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,style:Vm({stroke:e.stroke})},t):null)]}),ge.get(e)?.milestone&&(0,o.jsx)(`svg`,{width:14,height:14,"aria-hidden":`true`,"data-testid":`timeline-legend-star`,children:(0,o.jsx)(`path`,{d:bm(7,7,6),fill:t.stroke,style:Vm({fill:t.stroke})})}),(0,o.jsx)(`span`,{className:`font-mono`,children:e}),t.declared===!0&&(0,o.jsx)(`span`,{className:`sr-only`,children:` (project colour)`}),me.has(e)&&(0,o.jsxs)(`span`,{className:`text-zinc-500 dark:text-zinc-400`,"data-testid":`timeline-legend-shared`,children:[`(same colour as `,me.get(e).join(`, `),`)`]})]},e)})}),D!==void 0&&(0,o.jsx)(Qm,{data:w,selection:D,dependencies:O.dependencies})]})}function Qm({data:e,selection:t,dependencies:n}){let r=e.rows[t.row];if(r?.type!==`task`)return null;let i=t.type===`item`?r.items[t.item]:void 0,a=t.type===`task`?r.id:i?.id,s=a===void 0?[]:n.filter(e=>e.to===a),c=a===void 0?[]:n.filter(e=>e.from===a),l=(t,n)=>(0,o.jsxs)(`li`,{"data-satisfied":String(t.satisfied),className:t.satisfied?``:`text-red-700`,children:[gt(e,n),` — `,t.type,t.satisfied?``:` — not satisfied by the dates`]},t.index);return(0,o.jsx)(`div`,{className:`border-t border-zinc-200 px-2 py-1 text-xs dark:border-zinc-700`,"data-testid":`timeline-details`,role:`status`,children:(0,o.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5`,children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Task`}),(0,o.jsxs)(`dd`,{children:[r.label,` `,(0,o.jsxs)(`span`,{className:`font-mono text-zinc-500 dark:text-zinc-400`,children:[`(`,r.id,`)`]})]}),i!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Type`}),(0,o.jsx)(`dd`,{children:i.type}),(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:i.type===`activity`?`Dates`:`Date`}),(0,o.jsx)(`dd`,{className:`font-mono`,children:Xm(i)}),i.label!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Label`}),(0,o.jsx)(`dd`,{children:i.label})]}),i.kind!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Kind`}),(0,o.jsx)(`dd`,{className:`font-mono`,children:i.kind})]}),i.id!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Identifier`}),(0,o.jsx)(`dd`,{className:`font-mono`,children:i.id})]})]}),s.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Waits on`}),(0,o.jsx)(`dd`,{children:(0,o.jsx)(`ul`,{"data-testid":`timeline-predecessors`,children:s.map(e=>l(e,e.from))})})]}),c.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Needed by`}),(0,o.jsx)(`dd`,{children:(0,o.jsx)(`ul`,{"data-testid":`timeline-successors`,children:c.map(e=>l(e,e.to))})})]})]})})}var $m=(0,a.createContext)(null);function eh(e){let t=e.startsWith(`workspace:`)?e.slice(10):/^[a-z][a-z0-9+.-]*:/i.test(e)?null:e;if(t===null||t===``||/^(?:[\\/]|[a-z]:[\\/])/i.test(t))return null;let n=t.replaceAll(`\\`,`/`);return n.split(`/`).includes(`..`)?null:n}function th(e){let t=eh(e);if(t!==null)return{kind:`workspace-file`,path:t};if(/^https?:\/\//i.test(e))return{kind:`external-url`,url:e}}function nh(){let[e,t]=(0,a.useState)(void 0);return{hover:e=>({onPointerEnter:n=>t({text:e,x:n.clientX,y:n.clientY}),onPointerMove:n=>t({text:e,x:n.clientX,y:n.clientY}),onPointerLeave:()=>t(void 0)}),Tooltip:()=>e===void 0?null:(0,o.jsx)(`div`,{"data-testid":`diagram-tooltip`,role:`tooltip`,style:{position:`fixed`,left:e.x+14,top:e.y+14,zIndex:120},className:`pointer-events-none max-w-sm rounded bg-zinc-900 px-2 py-1 text-xs text-white shadow-lg dark:bg-zinc-100 dark:text-zinc-900`,children:e.text})}}function rh({data:e,isProposal:t,arrangement:n,onArrange:r,hidden:i,setHidden:s,orientation:c,viewpoint:l}){let u=(0,a.useRef)(null),[d,f]=(0,a.useState)(void 0),[p,m]=(0,a.useState)(!1),{hover:h,Tooltip:g}=nh(),_=(0,a.useRef)(void 0);(0,a.useEffect)(()=>()=>_.current?.(),[]);let v=(0,a.useContext)($m),[y,b]=(0,a.useState)(void 0),x=y??n,S=(0,a.useMemo)(()=>Tp(e,{isProposal:t,hidden:i,orientation:c,...x===void 0?{}:{arrangement:x},...l===void 0?{}:{viewpoint:l},...v===null?{}:{appearance:v}}),[e,t,i,x,c,l,v]),C=e=>{if(e.button!==0)return;let t=e.target;if(t.closest(`[data-draggable="node"]`)!==null||t.closest(`[data-legend-entry]`)!==null)return;let n=u.current?.parentElement??null;for(;n!==null&&n.scrollWidth<=n.clientWidth&&n.scrollHeight<=n.clientHeight;)n=n.parentElement;if(n===null)return;e.preventDefault();let r=e.clientX,i=e.clientY,a=n.scrollLeft,o=n.scrollTop,s=e.currentTarget;s.setPointerCapture?.(e.pointerId),m(!0);let c=e=>{n.scrollLeft=a-(e.clientX-r),n.scrollTop=o-(e.clientY-i)},l=()=>{_.current=void 0,s.releasePointerCapture?.(e.pointerId),s.removeEventListener(`pointermove`,c),s.removeEventListener(`pointerup`,l),s.removeEventListener(`pointercancel`,l),m(!1)};_.current?.(),_.current=l,s.addEventListener(`pointermove`,c),s.addEventListener(`pointerup`,l),s.addEventListener(`pointercancel`,l)},w=t=>a=>{if(a.button!==0)return;a.preventDefault();let o=u.current,s=o===null?1:(o.getBoundingClientRect().width||S.width)/S.width,l=a.clientX,d=a.clientY,{shown:p,page:m}=Cp(e,{hidden:i,orientation:c,...n===void 0?{}:{arrangement:n}}),h=m.cells.find(e=>e.id===rf(t))?.geometry;if(h===void 0)return;let g=a.currentTarget;g.setPointerCapture?.(a.pointerId),f(t);let v,y,x=e=>{let r={x:h.x+(e.clientX-l)/s,y:h.y+(e.clientY-d)/s};v=Mf(p,m,n,t,r,c),y===void 0&&(y=requestAnimationFrame(()=>{y=void 0,b(v)}))},C=()=>{_.current=void 0,y!==void 0&&cancelAnimationFrame(y),g.releasePointerCapture?.(a.pointerId),g.removeEventListener(`pointermove`,x),g.removeEventListener(`pointerup`,C),g.removeEventListener(`pointercancel`,C),f(void 0),b(void 0),v!==void 0&&r(v)};_.current?.(),_.current=C,g.addEventListener(`pointermove`,x),g.addEventListener(`pointerup`,C),g.addEventListener(`pointercancel`,C)},T=e=>{let t=new Set(i);t.delete(e)||t.add(e),s(t)},E=e=>{let t=e.data?.[`element-id`];if(e.data?.draggable===`node`&&t!==void 0)return{extra:{onPointerDown:w(t),style:{cursor:d===t?`grabbing`:`grab`},...e.title===void 0?{}:h(e.title)}};if(e.data?.[`relationship-role`]!==void 0){let t=e.primitives.find(e=>e.shape===`path`&&e.data?.edge===`line`);return{extra:e.title===void 0?{}:h(e.title),before:t===void 0||t.shape!==`path`?null:(0,o.jsx)(`path`,{"data-edge":`hit`,"data-hit":`edge`,d:t.d,fill:`none`,stroke:`transparent`,strokeWidth:14,pointerEvents:`stroke`})}}let n=e.data?.[`legend-entry`];if(n!==void 0&&e.data?.toggles===`true`){let t=e.primitives[0],r=t.shape===`rect`?t.x:t.shape===`line`?t.x1:0,i=t.shape===`rect`?t.y:t.shape===`line`?t.y1-5:0,a=e.primitives.find(e=>e.shape===`text`),s=a?.shape===`text`?op(a.text.replace(` (hidden)`,``))-8:0;return{extra:{onClick:()=>T(n),style:{cursor:`pointer`}},before:(0,o.jsx)(`rect`,{"data-hit":`legend`,x:r-3,y:i-3,width:s,height:16,fill:`transparent`})}}return{}};return(0,o.jsxs)(o.Fragment,{children:[n!==void 0&&Object.keys(n.elements).length>0&&(0,o.jsx)(`button`,{type:`button`,className:`mb-1 text-xs underline text-neutral-500 hover:text-neutral-800 dark:hover:text-neutral-200`,onClick:()=>r(void 0),children:`reset layout`}),(0,o.jsx)(g,{}),(0,o.jsxs)(`svg`,{ref:u,role:`img`,"aria-label":S.ariaLabel,viewBox:S.viewBox,width:S.width,height:S.height,xmlns:`http://www.w3.org/2000/svg`,onPointerDown:C,style:{cursor:p?`grabbing`:`grab`,touchAction:`none`},children:[(0,o.jsx)(`rect`,{x:Number(S.viewBox.split(` `)[0]),y:Number(S.viewBox.split(` `)[1]),width:S.width,height:S.height,fill:S.background,style:Vm({fill:S.background})}),(0,o.jsx)(Wm,{markers:S.markers}),S.groups.map(e=>(0,o.jsx)(Um,{group:e,interaction:E},e.id))]})]})}function ih({data:e,isProposal:t}){let{hover:n,Tooltip:r}=nh(),i=(0,a.useContext)($m),s=(0,a.useMemo)(()=>Ep(e,{isProposal:t,...i===null?{}:{appearance:i}}),[e,t,i]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`svg`,{role:`img`,"aria-label":s.ariaLabel,viewBox:s.viewBox,width:s.width,height:s.height,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`rect`,{x:0,y:0,width:s.width,height:s.height,fill:s.background,style:Vm({fill:s.background})}),(0,o.jsx)(Wm,{markers:s.markers}),s.groups.map(e=>(0,o.jsx)(Um,{group:e,interaction:e=>e.title===void 0?{}:{extra:n(e.title)}},e.id))]}),(0,o.jsx)(r,{})]})}var ah={added:`bg-emerald-50 dark:bg-emerald-950/40`,changed:`bg-amber-50 dark:bg-amber-950/40`,context:`bg-zinc-50 text-zinc-500 dark:bg-zinc-900/60 dark:text-zinc-400`,removed:`bg-red-50 text-red-800 dark:bg-red-950/40 dark:text-red-200`},oh={added:`border-emerald-600 bg-emerald-100 dark:border-emerald-400 dark:bg-emerald-900`,changed:`border-amber-600 bg-amber-100 dark:border-amber-400 dark:bg-amber-900`,context:`border-zinc-400 bg-zinc-100 dark:border-zinc-500 dark:bg-zinc-800`,removed:`border-red-600 bg-red-100 dark:border-red-400 dark:bg-red-900`},sh=48,ch=16,lh={attribute:{label:`is`,className:`text-zinc-600 dark:text-zinc-300`},expects:{label:`expects`,className:`text-amber-700 dark:text-amber-400`},assigns:{label:`asks to set`,className:`text-blue-700 dark:text-blue-400`},removes:{label:`asks to unset`,className:`text-rose-700 line-through dark:text-rose-400`}};function uh({uri:e,text:t,dispatch:n,sha256:r}){let i=th(e);return i===void 0||n===void 0?(0,o.jsx)(`span`,{"data-followable":`no`,children:t}):i.kind===`workspace-file`?(0,o.jsx)(`button`,{type:`button`,"data-followable":`workspace-file`,className:`text-left underline decoration-dotted underline-offset-2 hover:decoration-solid`,onClick:()=>n({kind:`openFile`,path:i.path,...r===void 0?{}:{sha256:r}}),children:t}):(0,o.jsx)(`a`,{"data-followable":`external-url`,className:`underline decoration-dotted underline-offset-2 hover:decoration-solid`,href:i.url,target:`_blank`,rel:`noreferrer`,children:t})}function dh({item:e,traces:t,dispatch:n}){let r=[...e.attributes.map(([e,t])=>[`attribute`,e,Me(t)]),...e.expectations.map(([e,t])=>[`expects`,e,Me(t)]),...e.assignments.map(([e,t])=>[`assigns`,e,Me(t)]),...e.removedAttributes.map(e=>[`removes`,e,``])],i=t??[];if(r.length===0&&e.locations.length===0&&e.artifacts.length===0&&i.length===0)return null;let s=[r.length>0?`${r.length} attribute${r.length===1?``:`s`}`:``,i.length>0?`${i.length} relation${i.length===1?``:`s`}`:``,e.locations.length>0?`${e.locations.length} location${e.locations.length===1?``:`s`}`:``,e.artifacts.length>0?`${e.artifacts.length} artifact${e.artifacts.length===1?``:`s`}`:``].filter(Boolean);return(0,o.jsxs)(`details`,{className:`mt-1 text-[11px]`,"data-testid":`structured-enrichment`,children:[(0,o.jsx)(`summary`,{className:`cursor-pointer text-zinc-500 dark:text-zinc-400`,children:s.join(`, `)}),(0,o.jsxs)(`dl`,{className:`mt-1 grid grid-cols-[auto_auto_1fr] gap-x-2 gap-y-0.5`,children:[r.map(([e,t,n],r)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)(`dt`,{className:`font-medium ${lh[e].className}`,"data-claim":e,children:lh[e].label}),(0,o.jsx)(`dd`,{className:`font-mono text-zinc-700 dark:text-zinc-200`,children:t}),(0,o.jsx)(`dd`,{className:`break-words text-zinc-600 dark:text-zinc-300`,children:n})]},`${e}-${t}-${r}`)),i.map((e,t)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)(`dt`,{className:`font-medium text-violet-700 dark:text-violet-400`,"data-claim":`relates`,children:e.kind}),(0,o.jsxs)(`dd`,{className:`col-span-2 break-words text-zinc-600 dark:text-zinc-300`,children:[e.fromLabel,` → `,e.toLabel,e.toRow===void 0&&e.toRef!==void 0?` (outside this document)`:``]})]},`trace-${t}`)),e.locations.map((e,t)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)(`dt`,{className:`font-medium text-zinc-500 dark:text-zinc-400`,"data-claim":`location`,children:`at`}),(0,o.jsx)(`dd`,{className:`col-span-2 break-all font-mono text-zinc-600 dark:text-zinc-300`,children:(0,o.jsx)(uh,{uri:e.uri,text:Ne(e),dispatch:n})})]},`location-${t}`)),e.artifacts.map((e,t)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)(`dt`,{className:`font-medium text-zinc-500 dark:text-zinc-400`,"data-claim":`artifact`,children:e.rel}),(0,o.jsx)(`dd`,{className:`col-span-2 break-all font-mono text-zinc-600 dark:text-zinc-300`,children:(0,o.jsx)(uh,{uri:e.uri,text:Pe(e),dispatch:n,sha256:e.sha256})})]},`artifact-${t}`))]})]})}function fh({data:e,hidden:t,setHidden:n,rows:r,traces:i=[],dispatch:s}){let[c,l]=(0,a.useState)(null),u=(0,a.useRef)(null),d=(0,a.useCallback)(()=>[...u.current?.querySelectorAll(`th`)??[]].map(e=>Math.max(sh,Math.round(e.getBoundingClientRect().width))),[]),f=(0,a.useCallback)((e,t)=>l(n=>{let r=n??d(),i=[...r];return i[e]=Math.max(sh,Math.round(t(r[e]??sh))),i}),[d]);function p(e,t){e.preventDefault();let n=e.clientX,r=c??d();l(r);let i=e=>{let i=r[t]??sh;f(t,()=>i+(e.clientX-n))},a=()=>{window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a)};window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a)}let m=c?.reduce((e,t)=>e+t,0),h=(e,t,n)=>(0,o.jsx)(`div`,{role:n?`separator`:`presentation`,"aria-orientation":n?`vertical`:void 0,"aria-label":n?`Resize column ${t}`:void 0,"aria-hidden":!n||void 0,tabIndex:n?0:void 0,onPointerDown:t=>p(t,e),onKeyDown:t=>{if(t.key!==`ArrowLeft`&&t.key!==`ArrowRight`)return;t.preventDefault();let n=t.key===`ArrowRight`?ch:-16;f(e,e=>e+n)},className:`absolute -right-px top-0 h-full w-1.5 cursor-col-resize touch-none hover:bg-zinc-400 focus:bg-zinc-400 focus:outline-none dark:hover:bg-zinc-500 dark:focus:bg-zinc-500`}),g=Fc(e),_=(e,t)=>r?.[t]?.role??Ic(e,g),v=[...new Set(e.rows.map(_).filter(e=>e!==void 0))].sort((e,t)=>Pc.indexOf(e)-Pc.indexOf(t)),y=e.rows.map((e,t)=>({row:e,index:t})).filter(({row:e,index:n})=>{let r=_(e,n);return r===void 0||!t.has(nl(`role`,r))}),b=new Map;for(let e of i)for(let t of[e.fromRow,e.toRow]){if(t===void 0)continue;let n=b.get(t);n===void 0?b.set(t,[e]):n.includes(e)||n.push(e)}let x=e=>{let r=new Set(t),i=nl(`role`,e);r.has(i)?r.delete(i):r.add(i),n(r)};return(0,o.jsxs)(`div`,{className:`overflow-x-auto`,children:[v.length>0&&(0,o.jsx)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2 text-[11px]`,"data-testid":`table-role-key`,children:v.map(e=>{let n=t.has(nl(`role`,e));return(0,o.jsxs)(`button`,{type:`button`,onClick:()=>x(e),"aria-pressed":!n,className:`flex items-center gap-1 rounded border border-zinc-300 px-1.5 py-0.5 dark:border-zinc-700 ${n?`opacity-50`:``}`,children:[(0,o.jsx)(`span`,{"data-role-swatch":e,className:`inline-block h-3 w-3 rounded-sm border-2 ${oh[e]}`}),(0,o.jsxs)(`span`,{children:[Nc[e],n?` (hidden)`:``]})]},e)})}),(0,o.jsxs)(`table`,{className:`border-collapse text-xs ${c?``:`w-full`}`,style:m===void 0?void 0:{tableLayout:`fixed`,width:m},children:[(0,o.jsx)(`colgroup`,{children:e.columns.map((e,t)=>(0,o.jsx)(`col`,{style:c?{width:c[t]}:void 0},t))}),(0,o.jsx)(`thead`,{children:(0,o.jsx)(`tr`,{ref:u,children:e.columns.map((e,t)=>(0,o.jsxs)(`th`,{className:`relative border border-zinc-300 px-2 py-1 text-left font-medium dark:border-zinc-700`,children:[(0,o.jsx)(`span`,{className:`block truncate`,children:e}),h(t,e,!0)]},t))})}),(0,o.jsx)(`tbody`,{children:y.map(({row:t,index:n},i)=>{let{cells:a,heading:c}=ce(t),l=r?.[n],u=l?.role??Ic(t,g),d=l?.id===void 0?[]:b.get(l.id)??[];if(c!==void 0){let t=Math.min(Math.max(l?.depth??1,1),6);return(0,o.jsx)(`tr`,{"data-row-heading":t,className:u===void 0?void 0:ah[u],children:(0,o.jsx)(`th`,{scope:`colgroup`,colSpan:e.columns.length,style:{paddingLeft:`${.5+(t-1)*.75}rem`},className:`border border-zinc-200 bg-zinc-50 py-1 text-left font-semibold dark:border-zinc-800 dark:bg-zinc-900 ${t===1?`text-xs`:`text-[11px] font-medium`} ${u===`removed`?`line-through`:``}`,children:c})},i)}return(0,o.jsx)(`tr`,{className:u===void 0?void 0:ah[u],"data-row-role":u,"data-row-kind":l?.kind,"data-row-ref":l?.ref,children:a.map((t,n)=>(0,o.jsxs)(`td`,{className:`relative border border-zinc-200 px-2 py-1 align-top break-words dark:border-zinc-800 ${u===`removed`?`line-through`:``}`,children:[t===null?(0,o.jsx)(`span`,{className:`opacity-40`,children:`—`}):String(t),n===0&&l!==void 0?(0,o.jsx)(dh,{item:l,traces:d,dispatch:s}):null,h(n,e.columns[n]??``,!1)]},n))},i)})})]})]})}function ph(e,t){if(e===void 0)return JSON.stringify(t,null,2);try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function mh(e,t=` `){let n=[],r=(e,r)=>{for(let i of r)n.push(`${t}${e}: ${i}`)};return r(`attribute`,e.attributes.map(([e,t])=>je(e,t))),r(`expects`,e.expectations.map(([e,t])=>je(e,t))),r(`asks to set`,e.assignments.map(([e,t])=>je(e,t))),r(`asks to unset`,e.removedAttributes),r(`at`,e.locations.map(e=>Ne(e))),r(`artifact`,e.artifacts.map(e=>Pe(e))),n}function hh(e){let t=e.profile===void 0?``:` "${e.profile}"`;if(e.state===`unchecked`)return`Could not be checked against this project's profile${t}: the project's profile registry cannot be used right now.`;if(e.state===`strays`)return`Does not conform to this project's profile${t} as it stands now.`;let n=e.openValues,r=e.findings??0,i=[n===0?void 0:`${n} value${n===1?``:`s`} outside its open enumerations`,r===0?void 0:`${r} finding${r===1?``:`s`} to check`].filter(e=>e!==void 0);return`Conforms to this project's profile${t}${i.length===0?``:`, with ${i.join(` and `)}`}.`}function gh(e,t,n=rl,r){let i=Xc(e,t),a=[];if(i.profile!==void 0&&a.push(`Profile: ${i.profile}`),r!==void 0&&a.push(`Conformance: ${hh(r)}`),i.target!==void 0){let e=i.target.revision===void 0?``:`, prepared against ${i.target.revision}`;a.push(`Proposes changes to ${i.target.ref}${e}`),a.push(`Expectations below are the producer's; the receiving authority checks them before applying.`)}for(let e of i.artifacts)a.push(`Artifact — ${Pe(e)}`);if(a.length>0&&a.push(``),e.kind===`timeline`)return a.push(...vt(e.data)),a.join(`
513
513
  `);if(i.columns!==void 0&&i.rows!==void 0){let e=e=>e!==void 0&&n.has(nl(`role`,e)),t=i.rows.filter(t=>e(t.role));t.length>0&&(a.push(`Filtered view — ${t.length} of ${i.rows.length} rows hidden (${[...new Set(t.map(e=>Nc[e.role]))].join(`, `)}).`),a.push(``)),a.push(i.columns.join(` | `));for(let t of i.rows){if(e(t.role))continue;if(t.heading!==void 0){a.push(``),a.push(`${`#`.repeat(t.depth??1)} ${t.heading}${t.role===void 0?``:` (${Nc[t.role]})`}`);continue}let n=t.cells.map(e=>e===null?``:String(e)).join(` | `),r=t.kind===void 0?``:` [${t.kind}]`;a.push(`${n}${r}${t.role===void 0?``:` (${Nc[t.role]})`}`);for(let e of t.changes)a.push(` ${Ae(e)}`);a.push(...mh(t))}if(i.traces.length>0){a.push(``);for(let e of i.traces){let t=e.label===void 0?``:`: ${e.label}`;a.push(`${e.fromLabel} —${e.kind}${t}→ ${e.toLabel}`)}}}else{if(a.push([`${i.things.length} ${i.thingNoun}s`,`${i.links.length} ${i.linkNoun}s`,...i.containers.length>0?[`${i.containers.length} containers`]:[]].join(`, `)),a.push(``),i.containers.length>0){for(let e of i.containers){let t=i.things.filter(t=>t.container===e.id);a.push(`${e.label}: ${t.length===0?`no members`:t.map(e=>e.label).join(`, `)}`)}a.push(``)}let e=new Map(i.containers.map(e=>[e.id,e.label]));for(let t of i.things){let n=t.container===void 0?void 0:e.get(t.container);a.push([t.label,t.kind===void 0?``:` [${t.kind}]`,n===void 0?``:` in ${n}`,t.role===`unchanged`?``:` (${Mc[t.role]})`,t.changes.length===0?``:` — ${t.changes.map(Ae).join(`, `)}`].join(``)),a.push(...mh(t))}i.links.length>0&&a.push(``),i.links.forEach((e,t)=>{let n=[e.kind,e.label].filter(e=>e!==void 0&&e!==``),r=n.length===0?`→`:`—${n.join(`: `)}→`;a.push([i.linkNoun===`message`?`${t+1}. `:``,`${e.fromLabel} ${r} ${e.toLabel}`,e.isLoop?` (to itself)`:``,e.role===`unchanged`?``:` (${Mc[e.role]})`,e.changes.length===0?``:` — ${e.changes.map(Ae).join(`, `)}`].join(``)),a.push(...mh(e))})}if(i.removals.length>0){a.push(``);for(let e of i.removals)a.push(`removed ${e.type}: ${e.ref}`)}return a.join(`
514
514
  `)}function _h(e,t){let n=e=>{if(e===void 0)return;let n=t.data,r=[...n.nodes??[],...n.participants??[]].find(t=>t.id===e||t.ref===e);return r===void 0?e:Zc(r)},r=t.data,i=[...r.nodes??[],...r.participants??[],...r.edges??[],...r.messages??[]].find(t=>`ref`in t&&t.ref===e.ref),a=e.from!==void 0||e.to!==void 0?`${n(e.from)??`?`} → ${n(e.to)??`?`}`:i!==void 0&&`from`in i?`${n(i.from)} → ${n(i.to)}`:void 0,o=e.label??(i===void 0?void 0:i.label),s=e.kind??(i===void 0?void 0:i.kind),c=[o,s===void 0?void 0:`[${s}]`,a].filter(e=>e!==void 0&&e!==``);return c.length===0?e.ref:`${c.join(` `)} (${e.ref})`}var vh=C;function yh(e){let t=e.target;if(typeof t!=`object`||!t)return;let n=t.revision;return typeof n==`string`?n:void 0}function bh(e){let t=e.target;if(typeof t==`string`)return t;if(typeof t==`object`&&t&&typeof t.ref==`string`)return t.ref}var xh=`The arrangement beside this document is not used: `;function Sh({envelope:e,source:t,rawOutput:n,dispatch:r,conformance:i,exportRef:s,file:c}){let l=(0,a.useContext)($m),[u,d]=(0,a.useState)(!1),[p,h]=(0,a.useState)(!1),[g,_]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),[b,x]=(0,a.useState)(!1),[S,T]=(0,a.useState)(null),E=(0,a.useRef)(null),ee=(0,a.useRef)(null),{fileIo:D}=Np(),[te,ne]=(0,a.useState)(Sl),re=(0,a.useRef)(0),[ie,ae]=(0,a.useState)(!1),[oe,se]=(0,a.useState)(!1),ce=(0,a.useRef)(``),[le,ue]=(0,a.useState)(void 0),de=c===void 0||e.kind!==`graph`?void 0:wl(c.path);(0,a.useEffect)(()=>{if(ne(Sl()),ae(!1),ue(void 0),de===void 0||D===void 0)return;let e=!0,t=()=>{let t=re.current,n=()=>e&&re.current===t;return D.read(de).then(e=>{if(!n())return;let t=Al(e.content);ne(t.ok?t.arrangement:Sl()),ae(!t.ok),ue(e=>t.ok?e?.startsWith(xh)?void 0:e:`${xh}${t.reason}.`)},()=>{n()&&(ne(Sl()),ae(!1))})};t();let n=D.onChanged(de,()=>void t());return()=>{e=!1,n()}},[de,D]);let[O,fe]=(0,a.useState)(rl),[pe,me]=(0,a.useState)(void 0),[he,ge]=(0,a.useState)(void 0),[_e,ve]=(0,a.useState)(void 0),ye=(0,a.useRef)(null),be=(0,a.useMemo)(()=>Qc(e),[e]),xe=e.target!==void 0,k=e.removals??[],A=(0,a.useMemo)(()=>Xc(e,xe),[e,xe]),Se=(0,a.useMemo)(()=>e.kind===`graph`?xp(e.data,O):`landscape`,[e,O]),Ce=he??``,we=te.views[Ce],Te=pe??we?.orientation??Se,Ee=we!==void 0&&(we.orientation===void 0||we.orientation===Te)?we:void 0,De=(e,t=Ce)=>{re.current+=1;let n={...te.views};e===void 0?delete n[t]:n[t]=e;let r={...te,views:n};ne(r),c!==void 0&&(ie?ue(`This arrangement is not kept: the arrangement file beside the document cannot be read, and is left as it is. Fix or remove it to keep moves.`):!c.writable||D?.keepArrangement===void 0?ue(`This arrangement is not kept: the document is outside the writable zone.`):(ue(void 0),D.keepArrangement(c.path,Il(r)).then(()=>void 0,e=>ue(`This arrangement was not kept: ${e.message}.`))))},Oe=(0,a.useMemo)(()=>e.kind===`graph`&&c!==void 0&&Ee!==void 0?Ap(e.data,{hidden:O,orientation:Te,arrangement:Ee}):[],[e,c,Ee,O,Te]),ke=(0,a.useMemo)(()=>e.kind===`graph`?al(e):[],[e]),Ae=ke.find(e=>e.id===he),je=Ae!==void 0&&!sl(O,ol(e.data,Ae)),Me=t=>{let n=ke.find(e=>e.id===t);ge(n?.id),fe(n===void 0?rl:ol(e.data,n))},Ne=()=>{me(e=>m(e??Te))},Fe=e.kind===`graph`?(0,o.jsx)(rh,{data:e.data,isProposal:xe,arrangement:Ee,onArrange:De,hidden:O,setHidden:fe,orientation:Te,viewpoint:Ae}):e.kind===`sequence`?(0,o.jsx)(ih,{data:e.data,isProposal:xe}):e.kind===`timeline`?(0,o.jsx)(Zm,{data:e.data,appearance:l,display:_e??Ym(e.data),onDisplayChange:t=>ve(n=>t(n??Ym(e.data))),exportRef:ye}):(0,o.jsx)(fh,{data:e.data,hidden:O,setHidden:fe,rows:A.rows,traces:A.traces,dispatch:r}),Ie=`${e.kind}-${bh(e)??`diagram`}.svg`.replace(/[^\w.-]+/g,`-`),Le=`${e.kind}-${bh(e)??`data`}`.replace(/[^\w.-]+/g,`-`),Re=()=>Qp(e.data,O,A.rows),ze=e.kind===`table`?Re().withheld:0;function Be(e){let t=e.cloneNode(!0);for(let e of t.querySelectorAll(`[data-hit]`))e.remove();for(let e of[t,...t.querySelectorAll(`[style]`)])e.style.removeProperty(`cursor`),e.style.removeProperty(`touch-action`),e.style.removeProperty(`fill`),e.style.removeProperty(`stroke`),e.getAttribute(`style`)===``&&e.removeAttribute(`style`);return t}function Ve(){let e=(ee.current??E.current)?.querySelector(`svg`);return e?new XMLSerializer().serializeToString(Be(e)):void 0}(0,a.useImperativeHandle)(s,()=>e.kind===`timeline`?{svg:()=>ye.current?.svg?.()}:e.kind===`graph`||e.kind===`sequence`?{svg:He}:e.kind===`table`?{xlsx:()=>void am(Re(),`${Le}.xlsx`),markdown:()=>rm(e.data,O,A.rows)}:null);function He(){let e=Ve();if(e===void 0)return;let t=URL.createObjectURL(new Blob([e],{type:`image/svg+xml`})),n=document.createElement(`a`);n.href=t,n.download=Ie,n.click(),URL.revokeObjectURL(t),T(`SVG downloaded`),window.setTimeout(()=>T(null),2500)}async function Ue(){let e=Ve();e!==void 0&&(T(await Bt(e)?`SVG markup copied`:`could not copy`),window.setTimeout(()=>T(null),2500))}return(0,o.jsxs)(`div`,{className:`space-y-3 text-sm`,"data-testid":`structured-document`,children:[xe&&(0,o.jsxs)(`p`,{className:`text-xs text-zinc-500`,"data-testid":`structured-proposal-note`,children:[`Proposed changes to `,(0,o.jsx)(`span`,{className:`font-mono`,children:bh(e)}),yh(e)===void 0?null:(0,o.jsxs)(o.Fragment,{children:[`, prepared against `,(0,o.jsx)(`span`,{className:`font-mono`,children:yh(e)})]}),`. Anything not mentioned is left as it is; anything shown without a change is here for context.`]}),A.profile===void 0?null:(0,o.jsxs)(`p`,{className:`text-xs text-zinc-500`,"data-testid":`structured-profile`,children:[`Vocabulary: `,(0,o.jsx)(`span`,{className:`font-mono`,children:A.profile}),(0,o.jsx)(`span`,{className:`ml-1 text-zinc-400`,children:`— names what the kinds and attributes mean; not resolved here`})]}),i===void 0?null:(0,o.jsx)(`p`,{className:i.state===`conforms`?`text-xs text-emerald-700 dark:text-emerald-400`:`text-xs text-amber-700 dark:text-amber-400`,"data-testid":`structured-conformance`,"data-state":i.state,children:hh(i)}),A.artifacts.length>0&&(0,o.jsx)(`ul`,{className:`text-xs text-zinc-500`,"data-testid":`structured-document-artifacts`,children:A.artifacts.map((e,t)=>(0,o.jsx)(`li`,{className:`break-all font-mono`,children:Pe(e)},t))}),A.traces.length>0&&(0,o.jsxs)(`p`,{className:`text-xs text-zinc-500`,"data-testid":`structured-relation-key`,children:[`Relations:`,` `,[...new Set(A.traces.map(e=>e.kind))].map((e,t)=>(0,o.jsxs)(`span`,{className:`font-mono`,children:[t>0?`, `:``,e]},e)),(0,o.jsx)(`span`,{className:`ml-1 text-zinc-400`,children:`— declared by the producer; nothing is inferred about what is missing`})]}),(O.size>0||Ae!==void 0)&&(0,o.jsxs)(`p`,{"data-testid":`structured-filtered`,className:`flex flex-wrap items-center gap-2 rounded border border-amber-300 bg-amber-50 px-2 py-1 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,children:[Ae!==void 0&&(0,o.jsxs)(`span`,{"data-testid":`structured-viewpoint`,children:[`Viewpoint: `,(0,o.jsx)(`strong`,{children:Ae.label}),` — `,Ae.concern,je?` Adjusted with the key.`:``]}),O.size>0&&(0,o.jsxs)(`span`,{children:[`Filtered view — `,[...O].map(e=>e.replace(/^(element|relationship|role):/,``)).join(`, `),` hidden.`,` `,xe?`The full proposal still applies.`:``]}),(0,o.jsx)(`button`,{type:`button`,className:`underline`,onClick:()=>Me(``),children:`show everything`})]}),(0,o.jsx)(`div`,{ref:E,className:`overflow-x-auto`,children:oe&&e.kind===`graph`?(0,o.jsx)(qp,{data:e.data,hidden:O,orientation:Te,arrangement:Ee,onArrange:e=>De(e,ce.current),onNote:ue,onDone:()=>se(!1)}):Fe}),le!==void 0&&(0,o.jsx)(`p`,{className:`text-xs text-amber-700 dark:text-amber-300`,"data-testid":`structured-arrangement-note`,children:le}),Oe.length>0&&(0,o.jsxs)(`details`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,"data-testid":`structured-arrangement-check`,children:[(0,o.jsxs)(`summary`,{className:`cursor-pointer`,children:[Oe.length,` `,Oe.length===1?`thing`:`things`,` to look at in this arrangement`]}),(0,o.jsx)(`ul`,{className:`mt-1 list-disc space-y-0.5 pl-5`,children:Oe.map((e,t)=>(0,o.jsx)(`li`,{children:e.message},t))})]}),(0,o.jsx)(f,{label:`${e.kind} view`,open:u,onClose:()=>d(!1),containerRef:ee,anchorRef:E,actions:(e.kind===`graph`||e.kind===`sequence`)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,onClick:He,className:vh,children:`⤓ download SVG`}),(0,o.jsx)(`button`,{type:`button`,onClick:Ue,className:vh,children:`copy markup`}),S!==null&&(0,o.jsx)(`span`,{className:`text-xs text-zinc-500`,children:S})]}),children:Fe}),k.length>0&&(0,o.jsx)(`ul`,{className:`space-y-1`,"data-testid":`structured-removals`,children:k.map((t,n)=>(0,o.jsxs)(`li`,{"data-relationship-role":`removed`,className:`rounded border border-red-300 bg-red-50 px-2 py-1 text-xs text-red-800 dark:border-red-800 dark:bg-red-950/40 dark:text-red-200`,children:[(0,o.jsx)(`span`,{className:`line-through`,children:_h(t,e)}),_h(t,e)===t.ref&&(0,o.jsx)(`span`,{className:`ml-2 not-italic opacity-70`,"data-testid":`removal-undescribed`,children:`— the proposal does not say what this is`}),(0,o.jsx)(`span`,{className:`ml-2 font-mono opacity-60`,children:t.type})]},n))}),(0,o.jsxs)(`div`,{className:w,children:[ke.length>0&&(0,o.jsxs)(`label`,{className:`flex items-center gap-1 text-zinc-500`,children:[`viewpoint`,(0,o.jsxs)(`select`,{"data-testid":`viewpoint-select`,className:`rounded border border-zinc-300 bg-white px-1 py-0.5 text-xs text-zinc-700 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-300`,value:Ae?.id??``,onChange:e=>Me(e.target.value),disabled:oe,title:oe?`Leave the touch-up to switch viewpoint`:void 0,children:[(0,o.jsx)(`option`,{value:``,children:`Whole document`}),ke.map(e=>(0,o.jsx)(`option`,{value:e.id,children:e.label},e.id))]})]}),(0,o.jsx)(`button`,{type:`button`,className:C,"aria-label":`Show ${e.kind} view at full size`,onClick:()=>d(!0),children:`⤢ enlarge`}),e.kind===`graph`&&(0,o.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,"data-testid":`diagram-orientation`,title:Te===`portrait`?`Turn it across the page — it is drawn down`:`Turn it down the page — it is drawn across`,"aria-label":`Turn the diagram ${m(Te)}`,onClick:Ne,disabled:oe,children:Te===`portrait`?`↔ landscape`:`↕ portrait`}),e.kind===`graph`&&c?.writable===!0&&!oe&&(0,o.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,title:`Move boxes, wire ends, bends and labels in draw.io's touch-up; kept beside the document, which is not changed`,onClick:()=>{ce.current=Ce,se(!0)},children:`✎ arrange in draw.io`}),e.kind===`table`?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:ze===0?`Save as .csv — opens in any spreadsheet`:`Save as .csv — ${ze} hidden rows are left out`,onClick:()=>im(Re(),`${Le}.csv`),children:`⤓ download CSV`}),(0,o.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:ze===0?`Save as .xlsx — one sheet, values typed as they are declared`:`Save as .xlsx — ${ze} hidden rows are left out`,onClick:()=>void am(Re(),`${Le}.xlsx`),children:`⤓ download XLSX`}),(0,o.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:ze===0?`Save as .md — each chapter a heading, its rows a table`:`Save as .md — ${ze} hidden rows are left out`,onClick:()=>om(e.data,O,A.rows,`${Le}.md`),children:`⤓ download Markdown`}),ze>0&&(0,o.jsxs)(`span`,{className:`text-xs text-amber-700 dark:text-amber-300`,"data-testid":`table-export-narrowed`,children:[`exports `,ze,` rows fewer than the table declares`]})]}):e.kind===`timeline`?null:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,className:C,title:`Save as .svg — insert it as a picture in a document`,onClick:He,children:`⤓ download SVG`}),(0,o.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:`Copy the SVG markup, for somewhere that takes it directly`,onClick:()=>void Ue(),children:`copy markup`})]}),(0,o.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>h(e=>!e),children:[p?`hide`:`show`,` text equivalent`]}),be!==void 0&&(0,o.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>_(e=>!e),children:[g?`hide`:`show`,` derived diagram syntax`]}),(0,o.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>x(e=>!e),children:[b?`hide`:`show`,` envelope`]}),n!==void 0&&(0,o.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>y(e=>!e),children:[v?`hide`:`show`,` original output`]}),S!==null&&(0,o.jsx)(`span`,{role:`status`,className:`text-emerald-600 dark:text-emerald-400`,children:S})]}),p&&(0,o.jsx)(`pre`,{"data-testid":`structured-text-equivalent`,className:`overflow-x-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:gh(e,xe,O,i)}),g&&be!==void 0&&(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`p`,{className:`mb-1 text-[11px] text-zinc-500`,children:`Derived from the structured data above. It is an export, not the source.`}),(0,o.jsx)(`pre`,{"data-testid":`structured-derived-export`,className:`overflow-x-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:be})]}),b&&(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`p`,{className:`mb-1 text-[11px] text-zinc-500`,children:`The validated document this view is drawn from. It is not sent to the model.`}),(0,o.jsx)(`pre`,{"data-testid":`structured-envelope`,className:`max-h-80 overflow-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:t})]}),v&&n!==void 0&&(0,o.jsx)(`pre`,{"data-testid":`structured-raw-output`,className:`overflow-x-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:n})]})}function Ch({item:e,dispatch:t}){let n=yl(e.structured);return n===void 0?null:(0,o.jsx)(Sh,{envelope:n,source:ph(e.structured,n),rawOutput:e.output,dispatch:t,...e.structuredConformance===void 0?{}:{conformance:e.structuredConformance}})}var wh={id:`structured-exchange`,match:e=>yl(e.structured)!==void 0,stable:!1,showsRawReveal:!0,startsExpanded:!0,Expanded:Ch},Th=class extends a.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e,t){console.error(`[pi-outpost] viewer crashed:`,e,t.componentStack)}render(){return this.state.failed?(0,o.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,o.jsxs)(`p`,{className:`max-w-md text-center text-sm text-zinc-600 dark:text-zinc-400`,children:[this.props.label??`This file`,` could not be displayed. Close and reopen it to try again.`]})}):this.props.children}},Eh=(0,a.createContext)({});function Dh(e){let t=D(e.children,`json`);return t===null?(0,o.jsx)(ne,{...e}):(0,o.jsx)(Oh,{code:t,pre:e})}function Oh({code:e,pre:t}){let n=(0,a.useContext)(Eh),r=(0,a.useMemo)(()=>bl(e),[e]);if(r.status===`not-a-document`)return(0,o.jsx)(ne,{...t});if(r.status===`valid`){let t=n[zt(e)];return(0,o.jsx)(Th,{label:`This diagram`,children:(0,o.jsx)(`div`,{className:`my-2`,"data-testid":`reply-structured-exchange`,children:(0,o.jsx)(Sh,{envelope:r.envelope,source:e,...t?{conformance:t}:{}})})})}return(0,o.jsxs)(`div`,{children:[(0,o.jsxs)(`p`,{"data-testid":`reply-structured-exchange-refused`,className:`mb-1 text-xs text-amber-700 dark:text-amber-400`,children:[`This structured-exchange document could not be drawn: `,kh(r)]}),(0,o.jsx)(ne,{...t})]})}function kh(e){if(e.status===`unsupported-version`)return`${e.schema} is not a version this application implements.`;let t=e.status===`invalid`?e.issues[0]:e.issue;return t===void 0?`it does not satisfy the schema it declares.`:`${t.message} (${t.rule}${t.path?` at ${t.path}`:``})`}function Ah(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function jh(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Mh=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nh=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ph={};function Fh(e,t){return((t||Ph).jsx?Nh:Mh).test(e)}var Ih=/[ \t\n\f\r]/g;function Lh(e){return typeof e==`object`?e.type===`text`&&Rh(e.value):Rh(e)}function Rh(e){return e.replace(Ih,``)===``}var zh=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};zh.prototype.normal={},zh.prototype.property={},zh.prototype.space=void 0;function Bh(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new zh(n,r,t)}function Vh(e){return e.toLowerCase()}var Hh=class{constructor(e,t){this.attribute=t,this.property=e}};Hh.prototype.attribute=``,Hh.prototype.booleanish=!1,Hh.prototype.boolean=!1,Hh.prototype.commaOrSpaceSeparated=!1,Hh.prototype.commaSeparated=!1,Hh.prototype.defined=!1,Hh.prototype.mustUseProperty=!1,Hh.prototype.number=!1,Hh.prototype.overloadedBoolean=!1,Hh.prototype.property=``,Hh.prototype.spaceSeparated=!1,Hh.prototype.space=void 0;var Uh=e.n({boolean:()=>P,booleanish:()=>Gh,commaOrSpaceSeparated:()=>Yh,commaSeparated:()=>Jh,number:()=>F,overloadedBoolean:()=>Kh,spaceSeparated:()=>qh}),Wh=0,P=Xh(),Gh=Xh(),Kh=Xh(),F=Xh(),qh=Xh(),Jh=Xh(),Yh=Xh();function Xh(){return 2**++Wh}var Zh=Object.keys(Uh),Qh=class extends Hh{constructor(e,t,n,r){let i=-1;if(super(e,t),$h(this,`space`,r),typeof n==`number`)for(;++i<Zh.length;){let e=Zh[i];$h(this,Zh[i],(n&Uh[e])===Uh[e])}}};Qh.prototype.defined=!0;function $h(e,t,n){n&&(e[t]=n)}function eg(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Qh(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Vh(r)]=r,n[Vh(a.attribute)]=r}return new zh(t,n,e.space)}var tg=eg({properties:{ariaActiveDescendant:null,ariaAtomic:Gh,ariaAutoComplete:null,ariaBusy:Gh,ariaChecked:Gh,ariaColCount:F,ariaColIndex:F,ariaColSpan:F,ariaControls:qh,ariaCurrent:null,ariaDescribedBy:qh,ariaDetails:null,ariaDisabled:Gh,ariaDropEffect:qh,ariaErrorMessage:null,ariaExpanded:Gh,ariaFlowTo:qh,ariaGrabbed:Gh,ariaHasPopup:null,ariaHidden:Gh,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qh,ariaLevel:F,ariaLive:null,ariaModal:Gh,ariaMultiLine:Gh,ariaMultiSelectable:Gh,ariaOrientation:null,ariaOwns:qh,ariaPlaceholder:null,ariaPosInSet:F,ariaPressed:Gh,ariaReadOnly:Gh,ariaRelevant:null,ariaRequired:Gh,ariaRoleDescription:qh,ariaRowCount:F,ariaRowIndex:F,ariaRowSpan:F,ariaSelected:Gh,ariaSetSize:F,ariaSort:null,ariaValueMax:F,ariaValueMin:F,ariaValueNow:F,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ng(e,t){return t in e?e[t]:t}function rg(e,t){return ng(e,t.toLowerCase())}var ig=eg({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Jh,acceptCharset:qh,accessKey:qh,action:null,allow:null,allowFullScreen:P,allowPaymentRequest:P,allowUserMedia:P,alpha:P,alt:null,as:null,async:P,autoCapitalize:null,autoComplete:qh,autoFocus:P,autoPlay:P,blocking:qh,capture:null,charSet:null,checked:P,cite:null,className:qh,closedBy:null,colorSpace:null,cols:F,colSpan:F,command:null,commandFor:null,content:null,contentEditable:Gh,controls:P,controlsList:qh,coords:F|Jh,crossOrigin:null,data:null,dateTime:null,decoding:null,default:P,defer:P,dir:null,dirName:null,disabled:P,download:Kh,draggable:Gh,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:P,formTarget:null,headers:qh,height:F,hidden:Kh,high:F,href:null,hrefLang:null,htmlFor:qh,httpEquiv:qh,id:null,imageSizes:null,imageSrcSet:null,inert:P,inputMode:null,integrity:null,is:null,isMap:P,itemId:null,itemProp:qh,itemRef:qh,itemScope:P,itemType:qh,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:P,low:F,manifest:null,max:null,maxLength:F,media:null,method:null,min:null,minLength:F,multiple:P,muted:P,name:null,nonce:null,noModule:P,noValidate:P,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:P,optimum:F,pattern:null,ping:qh,placeholder:null,playsInline:P,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:P,referrerPolicy:null,rel:qh,required:P,reversed:P,rows:F,rowSpan:F,sandbox:qh,scope:null,scoped:P,seamless:P,selected:P,shadowRootClonable:P,shadowRootCustomElementRegistry:P,shadowRootDelegatesFocus:P,shadowRootMode:null,shadowRootSerializable:P,shape:null,size:F,sizes:null,slot:null,span:F,spellCheck:Gh,src:null,srcDoc:null,srcLang:null,srcSet:null,start:F,step:null,style:null,tabIndex:F,target:null,title:null,translate:null,type:null,typeMustMatch:P,useMap:null,value:Gh,width:F,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qh,axis:null,background:null,bgColor:null,border:F,borderColor:null,bottomMargin:F,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:P,declare:P,event:null,face:null,frame:null,frameBorder:null,hSpace:F,leftMargin:F,link:null,longDesc:null,lowSrc:null,marginHeight:F,marginWidth:F,noResize:P,noHref:P,noShade:P,noWrap:P,object:null,profile:null,prompt:null,rev:null,rightMargin:F,rules:null,scheme:null,scrolling:Gh,standby:null,summary:null,text:null,topMargin:F,valueType:null,version:null,vAlign:null,vLink:null,vSpace:F,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:P,disablePictureInPicture:P,disableRemotePlayback:P,exportParts:Jh,part:qh,prefix:null,property:null,results:F,security:null,unselectable:null},space:`html`,transform:rg}),ag=eg({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Yh,accentHeight:F,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:F,amplitude:F,arabicForm:null,ascent:F,attributeName:null,attributeType:null,azimuth:F,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:F,by:null,calcMode:null,capHeight:F,className:qh,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:F,diffuseConstant:F,direction:null,display:null,dur:null,divisor:F,dominantBaseline:null,download:P,dx:null,dy:null,edgeMode:null,editable:null,elevation:F,enableBackground:null,end:null,event:null,exponent:F,externalResourcesRequired:null,fill:null,fillOpacity:F,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jh,g2:Jh,glyphName:Jh,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:F,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:F,horizOriginX:F,horizOriginY:F,id:null,ideographic:F,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:F,k:F,k1:F,k2:F,k3:F,k4:F,kernelMatrix:Yh,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:F,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:F,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:F,overlineThickness:F,paintOrder:null,panose1:null,path:null,pathLength:F,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qh,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:F,pointsAtY:F,pointsAtZ:F,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Yh,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Yh,rev:Yh,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Yh,requiredFeatures:Yh,requiredFonts:Yh,requiredFormats:Yh,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:F,specularExponent:F,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:F,strikethroughThickness:F,string:null,stroke:null,strokeDashArray:Yh,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:F,strokeOpacity:F,strokeWidth:null,style:null,surfaceScale:F,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yh,tabIndex:F,tableValues:null,target:null,targetX:F,targetY:F,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yh,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:F,underlineThickness:F,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:F,values:null,vAlphabetic:F,vMathematical:F,vectorEffect:null,vHanging:F,vIdeographic:F,version:null,vertAdvY:F,vertOriginX:F,vertOriginY:F,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:F,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ng}),og=eg({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),sg=eg({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:rg}),cg=eg({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),lg={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},ug=/[A-Z]/g,dg=/-[a-z]/g,fg=/^data[-\w.:]+$/i;function pg(e,t){let n=Vh(t),r=t,i=Hh;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&fg.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(dg,hg);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!dg.test(e)){let n=e.replace(ug,mg);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Qh}return new i(r,t)}function mg(e){return`-`+e.toLowerCase()}function hg(e){return e.charAt(1).toUpperCase()}var gg=Bh([tg,ig,og,sg,cg],`html`),_g=Bh([tg,ag,og,sg,cg],`svg`);function vg(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function yg(e){return e.join(` `).trim()}var bg=e.t(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
515
515
  `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),xg=e.t(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(bg());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),Sg=e.t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Cg=e.t(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(xg()),i=Sg();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),wg=Eg(`end`),Tg=Eg(`start`);function Eg(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Dg(e){let t=Tg(e),n=wg(e);if(t&&n)return{start:t,end:n}}var Og=e.r(Cg(),1),kg={}.hasOwnProperty,Ag=new Map,jg=/[A-Z]/g,Mg=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Ng=new Set([`td`,`th`]),Pg=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Fg(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Kg(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Gg(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?_g:gg,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ig(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ig(e,t,n){if(t.type===`element`)return Lg(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Rg(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Bg(e,t,n);if(t.type===`mdxjsEsm`)return zg(e,t);if(t.type===`root`)return Vg(e,t,n);if(t.type===`text`)return Hg(e,t)}function Lg(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=_g,e.schema=i),e.ancestors.push(t);let a=Qg(e,t.tagName,!1),o=qg(e,t),s=Yg(e,t);return Mg.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Lh(e)})),Ug(e,o,a,t),Wg(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Rg(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}$g(e,t.position)}function zg(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$g(e,t.position)}function Bg(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=_g,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Qg(e,t.name,!0),o=Jg(e,t),s=Yg(e,t);return Ug(e,o,a,t),Wg(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Vg(e,t,n){let r={};return Wg(r,Yg(e,t)),e.create(t,e.Fragment,r,n)}function Hg(e,t){return t.value}function Ug(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wg(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Gg(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Kg(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Tg(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function qg(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&kg.call(t.properties,i)){let a=Xg(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Ng.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Jg(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else $g(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else $g(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Yg(e,t){let n=[],r=-1,i=e.passKeys?new Map:Ag;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Ig(e,a,o);s!==void 0&&n.push(s)}return n}function Xg(e,t,n){let r=pg(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?jh(n):yg(n)),r.property===`style`){let t=typeof n==`object`?n:Zg(e,String(n));return e.stylePropertyNameCase===`css`&&(t=e_(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?lg[r.property]||r.property:r.attribute,n]}}function Zg(e,n){try{return(0,Og.default)(n,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let r=n,i=new t.f("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw i.file=e.filePath||void 0,i.url=Pg+`#cannot-parse-style-attribute`,i}}function Qg(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Fh(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Fh(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return kg.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);$g(e)}function $g(e,n){let r=new t.f("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Pg+`#cannot-handle-mdx-estrees-without-createevaluater`,r}function e_(e){let t={},n;for(n in e)kg.call(e,n)&&(t[t_(n)]=e[n]);return t}function t_(e){let t=e.replace(jg,n_);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function n_(e){return`-`+e.toLowerCase()}var r_={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]};function i_(e){let n=[],r=-1,i=0,a=0;for(;++r<e.length;){let o=e.charCodeAt(r),s=``;if(o===37&&t.d(e.charCodeAt(r+1))&&t.d(e.charCodeAt(r+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){let t=e.charCodeAt(r+1);o<56320&&t>56319&&t<57344?(s=String.fromCharCode(o,t),a=1):s=`�`}else s=String.fromCharCode(o);s&&=(n.push(e.slice(i,r),encodeURIComponent(s)),i=r+a+1,``),a&&=(r+=a,0)}return n.join(``)+e.slice(i)}function a_(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function o_(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
@@ -534,4 +534,4 @@ div.mxRubberband { position: absolute; overflow: hidden; border: 1px solid #29b6
534
534
  `).join(r)+e.slice(o)}let a=i[t];if(a===void 0)throw new GO(`the file has no page ${t+1}`);let o=qO(e,a.start),s=JO(n,o+` `).split(`
535
535
  `).join(r),c=e.slice(a.start,a.innerStart).replace(/\s*\/>$/,`>`);return e.slice(0,a.start)+c+r+s+r+o+`</diagram>`+e.slice(a.end)}function XO(e){let t=new DOMParser().parseFromString(e,`application/xml`).documentElement;if(t.nodeName===`parsererror`||t.getElementsByTagName(`parsererror`).length>0)throw Error(`it is not a draw.io diagram (not XML)`);if(t.nodeName!==`mxfile`&&t.nodeName!==`mxGraphModel`)throw Error(`it is not a draw.io diagram (its root is <${t.nodeName}>)`);return t}function ZO(e){return[...e.children].filter(e=>e.nodeName===`diagram`)}function QO(e){let t=XO(e);if(t.nodeName===`mxGraphModel`)return[`Page 1`];let n=ZO(t);if(n.length===0)throw Error(`it holds no page`);return n.map((e,t)=>e.getAttribute(`name`)?.trim()||`Page ${t+1}`)}function $O(e,t){if(t===void 0||t.trim()===``)return 0;let n=QO(e),r=t.trim(),i=n.indexOf(r),a=i>=0?i:/^\d+$/.test(r)?Number(r)-1:-1;if(a<0||a>=n.length)throw Error(`it has no page "${r}"; its pages are ${n.map(e=>`"${e}"`).join(`, `)}`);return a}function ek(e,t){let n=XO(e),r=$O(e,t);if(n.nodeName===`mxGraphModel`)return e;let i=n.cloneNode(!1);return i.appendChild(ZO(n)[r].cloneNode(!0)),new XMLSerializer().serializeToString(i)}function tk(e,t){let n=e.split(`/`).slice(0,-1),r=t.split(`/`),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i+=1;return[...n.slice(i).map(()=>`..`),...r.slice(i)].join(`/`)}var nk={dirty:!1,canUndo:!1,canRedo:!1},rk=`Discard the unsaved touch-ups to this diagram?`;function ik(e){return e.slice(e.lastIndexOf(`/`)+1).replace(/\.(drawio|dio)$/i,``)||`diagram`}function ak(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:n}));try{let t=document.createElement(`a`);t.href=r,t.download=e,t.click()}finally{URL.revokeObjectURL(r)}}function ok(e,t){let n=t?.trim().replace(/[^\p{L}\p{N}._-]+/gu,`-`).replace(/^-+|-+$/g,``);return`${ik(e)}${n?`-${n}`:``}.svg`}function sk(e,t,n){let{fileIo:r}=Np(),[i,o]=(0,a.useState)({status:`loading`}),s=(0,a.useRef)(0),c=(0,a.useCallback)(()=>{if(!t)return;if(r===void 0){o({status:`failed`,message:`files cannot be read here`});return}let n=++s.current;r.read(e).then(({content:e})=>{n===s.current&&o({status:`loaded`,content:e})},e=>{n===s.current&&o({status:`failed`,message:e instanceof Error?e.message:String(e)})})},[t,r,e]);return(0,a.useEffect)(()=>{n&&c()},[c,n]),(0,a.useEffect)(()=>{if(t&&n&&r!==void 0)return r.onChanged(e,c)},[t,n,r,e,c]),i}function ck(e,t){let[n,r]=(0,a.useState)(!t||typeof IntersectionObserver>`u`);return(0,a.useEffect)(()=>{if(n||e.current===null)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&r(!0)},{rootMargin:`600px 0px`});return t.observe(e.current),()=>t.disconnect()},[n,e]),n}function lk({path:e,xml:t,variant:n,fallback:r,onTouchUpDirtyChange:i,page:s,startTouchUp:c=!1,onEscape:l}){let{serverUrl:u,fileIo:d,onOpenFile:p}=Np(),m=(0,a.useRef)(null),h=ck(m,n===`reply`),g=sk(e,t===void 0,h),_=t??(g.status===`loaded`?g.content:null),v=(0,a.useRef)(null),y=(0,a.useRef)(null),[b,x]=(0,a.useState)(!1),[S,T]=(0,a.useState)(null),[E,ee]=(0,a.useState)(null),[D,te]=(0,a.useState)(null),ne=(0,a.useRef)(null),[re,ie]=(0,a.useState)(nk),[ae,oe]=(0,a.useState)(!1),se=(0,a.useRef)(!1),[ce,le]=(0,a.useState)(null),[ue,de]=(0,a.useState)(null),O=e=>e===`inline`?v:y,fe=e=>D===e&&ne.current!==null?ne.current.content:_,pe=d!==void 0,me=D!==null&&re.dirty,he=(0,a.useMemo)(()=>{if(s===void 0||_===null)return{index:0,problem:null};try{return{index:$O(_,s),problem:null}}catch(e){return{index:0,problem:e instanceof Error?e.message:String(e)}}},[s,_]),ge=(0,a.useRef)(!1);(0,a.useEffect)(()=>{c&&!ge.current&&_!==null&&he.problem===null&&(ge.current=!0,ve(`inline`))});let _e=(0,a.useRef)(null);(0,a.useEffect)(()=>{D===null||re.dirty||ne.current===null||_===null||_===ne.current.content||(_e.current=D,ne.current=null,ie(nk),te(null))},[_,D,re.dirty]),(0,a.useEffect)(()=>{if(D!==null||_e.current===null)return;let e=_e.current;_e.current=null,ve(e)}),(0,a.useEffect)(()=>{i?.(me)},[me,i]),(0,a.useEffect)(()=>()=>i?.(!1),[i]);async function ve(t){if(d!==void 0&&D===null){le(null),de(null);try{ne.current=await d.read(e),ie(nk),te(t)}catch(e){le({message:e instanceof Error?e.message:String(e),conflict:!1})}}}function ye(){return me&&!window.confirm(rk)?!1:(te(null),ie(nk),le(null),de(null),ne.current=null,!0)}async function be(){let t=D,n=ne.current;if(!(t===null||n===null||d===void 0||se.current)){se.current=!0,oe(!0),le(null);try{let r=await O(t).current.save(),i=YO(n.content,r.page,r.xml),{mtimeMs:a}=await d.write(e,i,n.mtimeMs);ne.current={content:i,mtimeMs:a},O(t).current?.markClean()}catch(e){let t=e instanceof WO&&e.reason===`conflict`;le({message:t?`The file changed on disk, or was removed, since this touch-up began, so it was not saved. Leave without saving to see what is there now.`:`Could not save: ${e instanceof Error?e.message:String(e)}`,conflict:t})}finally{se.current=!1,oe(!1)}}}async function xe(t){ee(null);try{let n=await O(t).current.exportSvg();ak(ok(e,n.name),n.svg,`image/svg+xml;charset=utf-8`)}catch(e){ee(e instanceof Error?e.message:String(e))}}function k(){(D!==`enlarged`||ye())&&x(!1)}let A=(0,a.useCallback)(()=>de(`Save or undo the touch-ups on this page before turning to another.`),[]),Se=(0,a.useRef)(ye);Se.current=ye;let Ce=(0,a.useRef)(k);Ce.current=k;let we=(0,a.useRef)(D);we.current=D;let Te=(0,a.useRef)(b);Te.current=b;let Ee=(0,a.useRef)(l);Ee.current=l;let De=(0,a.useCallback)(()=>{Ee.current?Ee.current():we.current===null?Te.current&&Ce.current():Se.current()},[]);(0,a.useEffect)(()=>{if(D===null)return;function e(e){e.key===`Escape`&&(e.preventDefault(),e.stopImmediatePropagation(),Ee.current?Ee.current():Se.current())}return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[D]);function Oe(t){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,className:C,disabled:_===null||S!==null,onClick:()=>void xe(t),title:`Save the page shown as .svg — insert it as a picture in a document`,children:`⤓ download SVG`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:_===null,onClick:()=>_!==null&&ak(e.slice(e.lastIndexOf(`/`)+1),_,`application/xml;charset=utf-8`),title:`Save the .drawio file, to open or share it`,children:`⤓ download .drawio`})]})}function ke(e){return D===e?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.dirty||ae,onClick:()=>void be(),children:ae?`saving…`:`✓ save`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.canUndo,onClick:()=>O(e).current?.undo(),title:`Undo (⌘Z / Ctrl+Z)`,children:`↶ undo`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.canRedo,onClick:()=>O(e).current?.redo(),title:`Redo (⇧⌘Z / Ctrl+Y)`,children:`↷ redo`}),(0,o.jsxs)(`label`,{className:`inline-flex items-center gap-1 text-xs text-zinc-500 dark:text-zinc-400`,title:`How the selected wires are drawn — or every wire of the page when none is selected — and new wires too`,children:[`wires`,(0,o.jsxs)(`select`,{className:C,"aria-label":`Wire style`,value:re.wireStyle??`orthogonal`,onChange:t=>{let n=t.target.value;n!==`mixed`&&O(e).current?.setWireStyle(n)},children:[(0,o.jsx)(`option`,{value:`straight`,children:`straight`}),(0,o.jsx)(`option`,{value:`orthogonal`,children:`orthogonal`}),(0,o.jsx)(`option`,{value:`curved`,children:`curved`}),re.wireStyle===`mixed`&&(0,o.jsx)(`option`,{value:`mixed`,disabled:!0,children:`mixed`})]})]}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.bends,onClick:()=>O(e).current?.removeBends(),title:`Remove the bends of the selected wires — or of every wire of the page when none is selected — and let draw.io route them. Double-click a bend to remove just that one.`,children:`remove bends`}),(0,o.jsx)(`button`,{type:`button`,className:C,onClick:()=>ye(),title:`Leave touch-up (Escape); unsaved touch-ups are asked about first`,children:`done`}),(0,o.jsx)(`span`,{className:`text-xs text-zinc-400`,"data-testid":`drawio-touchup-status`,children:re.dirty?`● unsaved`:`touching up — drag boxes and wire ends, double-click a label`})]}):pe&&D===null&&S===null?(0,o.jsx)(`button`,{type:`button`,className:C,disabled:_===null,onClick:()=>void ve(e),title:`Move boxes, re-attach wires and fix labels here; anything more in draw.io`,children:`✎ touch up`}):null}function Ae(e){return(0,o.jsxs)(o.Fragment,{children:[D===e&&ce&&(0,o.jsx)(`span`,{role:`alert`,"data-testid":`drawio-touchup-problem`,className:`text-red-600 dark:text-red-400`,children:ce.message}),D===e&&ue&&(0,o.jsx)(`span`,{role:`status`,className:`text-amber-700 dark:text-amber-300`,children:ue}),D===null&&ce&&(0,o.jsxs)(`span`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:[`Could not start touch-up: `,ce.message]}),E&&(0,o.jsxs)(`span`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:[`Could not download SVG: `,E]})]})}if(n===`reply`&&g.status===`failed`)return(0,o.jsxs)(`div`,{ref:m,role:`alert`,"data-testid":`drawio-block-missing`,className:`my-2 rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,children:[`The diagram `,(0,o.jsx)(`code`,{children:e}),` could not be shown: `,g.message]});let je=r??(0,o.jsxs)(`p`,{className:`px-3 py-2 text-xs text-zinc-500`,children:[`The diagram `,(0,o.jsx)(`code`,{children:e}),` could not be drawn.`]}),Me=(0,o.jsxs)(`div`,{className:`${w} ${n===`reply`?`order-3`:`shrink-0 px-3 py-1.5`}`,children:[D!==`inline`&&(0,o.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,disabled:_===null||D!==null,onClick:()=>x(!0),"aria-label":`Show diagram at full size`,children:`⤢ enlarge`}),D!==`inline`&&Oe(`inline`),n===`reply`&&p&&(0,o.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,onClick:()=>p(e),title:`Open the file in the file viewer`,children:`↗ open`}),n===`viewer`&&ke(`inline`),Ae(`inline`)]});return(0,o.jsxs)(`div`,{ref:m,"data-testid":n===`reply`?`drawio-block-reply`:`drawio-block-viewer`,className:n===`reply`?`my-2 flex flex-col gap-2 rounded-lg border border-zinc-200 bg-zinc-50 p-3 dark:border-zinc-800 dark:bg-zinc-900`:`flex h-full flex-col`,children:[n===`viewer`&&Me,he.problem!==null&&(0,o.jsxs)(`p`,{role:`alert`,"data-testid":`drawio-block-page-problem`,className:`px-3 py-1.5 text-xs text-amber-800 dark:text-amber-200`,children:[`The diagram `,(0,o.jsx)(`code`,{children:e}),` `,he.problem,`; its first page is shown.`]}),_===null||!h?(0,o.jsx)(`div`,{className:`h-80 animate-pulse rounded bg-zinc-100 dark:bg-zinc-800/60`,"data-testid":`drawio-block-loading`,"aria-label":`Loading ${e}`}):(0,o.jsx)(Wp,{ref:v,xml:fe(`inline`),serverUrl:u,title:e,fallback:je,editing:D===`inline`,onTouchUpChange:ie,onPageLocked:A,onEscape:De,onRendered:T,className:n===`reply`?`flex h-80 flex-col`:`flex min-h-[24rem] flex-1 flex-col`,page:s===void 0?void 0:he.index}),n===`reply`&&Me,(0,o.jsx)(f,{label:e,testId:`drawio-enlarged`,open:b,onClose:k,anchorRef:m,actions:(0,o.jsxs)(o.Fragment,{children:[Oe(`enlarged`),ke(`enlarged`),Ae(`enlarged`)]}),children:_!==null&&(0,o.jsx)(`div`,{style:{width:`90vw`,height:`75vh`},children:(0,o.jsx)(Wp,{ref:y,xml:fe(`enlarged`),serverUrl:u,title:`${e}, full size`,fallback:je,editing:D===`enlarged`,onTouchUpChange:ie,onPageLocked:A,onEscape:De,className:`flex h-full flex-col`})})})]})}function uk(e){return e===`className`||Array.isArray(e)&&e[0]===`className`}function dk(e){let t={};for(let[n,r]of Object.entries(e))t[n]=r.filter(e=>!uk(e));return t[`*`]=[...t[`*`]??[],`className`],t}var fk={...EO,tagNames:[...new Set([...EO.tagNames??[],`details`,`summary`])],attributes:dk(EO.attributes??{})},pk=[wO,[UO,fk],LC],mk=[t.n,t.t];function hk(e){let t=n.c(``,e);try{return decodeURIComponent(t)}catch{return t}}function gk(e){return typeof e==`string`&&e!==``&&!n.r(e)&&n.n(e.split(/[?#]/)[0])}function _k({text:e}){let[t,n]=(0,a.useState)(!1);return(0,o.jsxs)(`div`,{className:`my-1 rounded-lg border border-zinc-200 bg-zinc-50 text-sm dark:border-zinc-800/80 dark:bg-zinc-900/40`,children:[(0,o.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-zinc-500`,children:[(0,o.jsx)(`span`,{className:`italic`,children:`thinking`}),(0,o.jsx)(`span`,{className:`ml-auto`,children:t?`▾`:`▸`})]}),t&&(0,o.jsx)(`div`,{className:`whitespace-pre-wrap border-t border-zinc-200 px-3 py-2 text-xs italic text-zinc-500 dark:border-zinc-800/80`,children:e})]})}function vk({item:e,serverUrl:r=``,token:i=null,workspace:s,onOpenFile:c,hideReasoning:l=!1}){let d=l?e.blocks.filter(e=>e.type!==`thinking`):e.blocks,f=e.blocks.filter(e=>e.type===`text`).map(e=>e.text).join(`
536
536
 
537
- `).trim(),p=(0,a.useRef)(c);p.current=c;let m=(0,a.useMemo)(()=>{function e({src:e,alt:t,...a}){if(gk(e))return(0,o.jsx)(lk,{path:hk(e),variant:`reply`});let c=typeof e==`string`&&e!==``&&!n.r(e)?n.o(r,n.c(``,e),i,void 0,s):e;return(0,o.jsx)(`img`,{...a,src:c,alt:t??``,loading:`lazy`,className:`max-h-96 max-w-full rounded-lg object-contain`})}function t({href:e,children:t,...r}){if(typeof e==`string`&&e!==``&&!n.r(e)&&p.current){let i=n.c(``,e);return(0,o.jsx)(`a`,{...r,href:e,onClick:e=>{e.preventDefault(),p.current?.(i)},children:t})}return(0,o.jsx)(`a`,{...r,href:e,target:`_blank`,rel:`noreferrer`,children:t})}function a({node:e,children:t,...n}){let r=(e?.children??[]).filter(e=>e.type!==`text`||(e.value??``).trim()!==``);return r.length>0&&r.every(e=>e.type===`element`&&e.tagName===`img`&&gk(e.properties?.src))?(0,o.jsx)(`div`,{className:`my-2`,children:t}):(0,o.jsx)(`p`,{...n,children:t})}return{pre:Dh,img:e,a:t,p:a}},[r,i,s]);return d.length===0&&!e.errorMessage?null:(0,o.jsxs)(`div`,{className:`group max-w-none`,children:[f&&!e.streaming&&(0,o.jsx)(`div`,{className:`flex justify-end opacity-0 transition-opacity group-hover:opacity-100`,children:(0,o.jsx)(u,{text:f})}),d.map((e,n)=>e.type===`thinking`?(0,o.jsx)(_k,{text:e.text},e.contentIndex??n):(0,o.jsx)(`div`,{className:`prose-chat`,children:(0,o.jsx)(mv,{remarkPlugins:mk,rehypePlugins:pk,components:m,children:t.g(e.text)})},e.contentIndex??n)),e.errorMessage&&(0,o.jsx)(`div`,{className:`mt-2 rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:e.errorMessage})]})}var yk=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],bk=`worktree`,xk=class extends Error{kind;constructor(e,t){super(e),this.name=`HistoryError`,this.kind=t}};async function Sk(e,t){let n=[];for(;;){let r=await e(n.length,50);if(r.items.length===0||(n.unshift(...r.items),t?.(n.length),r.remaining===0))return n}}Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Wp}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return Lh}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Sh}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Th}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return Np}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return bl}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return wh}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return pg}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return Eh}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return mv}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return vk}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return gg}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return ek}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return WO}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return UO}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return LC}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return zC}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return bk}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Mp}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return $m}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return QO}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return $C}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Sk}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return fk}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return wO}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return yk}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return lk}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return xk}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return tk}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return lv}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return jh}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return _g}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return yg}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return l}});
537
+ `).trim(),p=(0,a.useRef)(c);p.current=c;let m=(0,a.useMemo)(()=>{function e({src:e,alt:t,...a}){if(gk(e))return(0,o.jsx)(lk,{path:hk(e),variant:`reply`});let c=typeof e==`string`&&e!==``&&!n.r(e)?n.o(r,n.c(``,e),i,void 0,s):e;return(0,o.jsx)(`img`,{...a,src:c,alt:t??``,loading:`lazy`,className:`max-h-96 max-w-full rounded-lg object-contain`})}function t({href:e,children:t,...r}){if(typeof e==`string`&&e!==``&&!n.r(e)&&p.current){let i=n.c(``,e);return(0,o.jsx)(`a`,{...r,href:e,onClick:e=>{e.preventDefault(),p.current?.(i)},children:t})}return(0,o.jsx)(`a`,{...r,href:e,target:`_blank`,rel:`noreferrer`,children:t})}function a({node:e,children:t,...n}){let r=(e?.children??[]).filter(e=>e.type!==`text`||(e.value??``).trim()!==``);return r.length>0&&r.every(e=>e.type===`element`&&e.tagName===`img`&&gk(e.properties?.src))?(0,o.jsx)(`div`,{className:`my-2`,children:t}):(0,o.jsx)(`p`,{...n,children:t})}return{pre:Dh,img:e,a:t,p:a}},[r,i,s]);return d.length===0&&!e.errorMessage?null:(0,o.jsxs)(`div`,{className:`group max-w-none`,children:[f&&!e.streaming&&(0,o.jsx)(`div`,{className:`flex justify-end opacity-0 transition-opacity group-hover:opacity-100`,children:(0,o.jsx)(u,{text:f})}),d.map((e,n)=>e.type===`thinking`?(0,o.jsx)(_k,{text:e.text},e.contentIndex??n):(0,o.jsx)(`div`,{className:`prose-chat`,children:(0,o.jsx)(mv,{remarkPlugins:mk,rehypePlugins:pk,components:m,children:t.g(e.text)})},e.contentIndex??n)),e.errorMessage&&(0,o.jsx)(`div`,{className:`mt-2 rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:e.errorMessage})]})}var yk={30:`#3f3f46`,31:`#dc2626`,32:`#16a34a`,33:`#ca8a04`,34:`#2563eb`,35:`#9333ea`,36:`#0891b2`,37:`#71717a`,90:`#a1a1aa`,91:`#ef4444`,92:`#22c55e`,93:`#eab308`,94:`#3b82f6`,95:`#a855f7`,96:`#06b6d4`,97:`#d4d4d8`};function bk(e){if(!Number.isInteger(e)||e<0||e>255)return;if(e<16)return yk[e<8?30+e:90+e-8];if(e>=232){let t=8+(e-232)*10;return`rgb(${t} ${t} ${t})`}let t=e-16,n=e=>e===0?0:55+e*40;return`rgb(${n(Math.floor(t/36))} ${n(Math.floor(t/6)%6)} ${n(t%6)})`}var xk=/\u001B\[[0-9;:]*[A-Za-z]|\u001B[()][A-Za-z0-9]|\u001B[A-Za-z]/g;function Sk(e,t){let n={...e};for(let e=0;e<t.length;e++){let r=t[e];if(r===0)for(let e of Object.keys(n))delete n[e];else if(r===1)n.bold=!0;else if(r===2)n.dim=!0;else if(r===3)n.italic=!0;else if(r===4)n.underline=!0;else if(r===22)delete n.bold,delete n.dim;else if(r===23)delete n.italic;else if(r===24)delete n.underline;else if(r===39)delete n.color;else if(yk[r]!==void 0)n.color=yk[r];else if(r===38){if(t[e+1]===2){let[r,i,a]=[t[e+2],t[e+3],t[e+4]];[r,i,a].every(e=>Number.isFinite(e))&&(n.color=`rgb(${r} ${i} ${a})`),e+=4}else if(t[e+1]===5){let r=bk(t[e+2]);r!==void 0&&(n.color=r),e+=2}}}return n}function Ck(e){let t=[],n={},r=0;xk.lastIndex=0;for(let i=xk.exec(e);i!==null;i=xk.exec(e)){i.index>r&&t.push({text:e.slice(r,i.index),...n}),r=i.index+i[0].length;let a=i[0];if(a.endsWith(`m`)){let e=a.slice(2,-1),t=e===``?[0]:e.split(/[;:]/).map(e=>e===``?0:Number(e));n=Sk(n,t)}}return r<e.length&&t.push({text:e.slice(r),...n}),t}function wk(e){return e.replace(xk,``)}var Tk=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],Ek=`worktree`,Dk=class extends Error{kind;constructor(e,t){super(e),this.name=`HistoryError`,this.kind=t}};async function Ok(e,t){let n=[];for(;;){let r=await e(n.length,50);if(r.items.length===0||(n.unshift(...r.items),t?.(n.length),r.remaining===0))return n}}Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return wh}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return _g}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Eh}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return jh}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return bl}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return Wp}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return Mp}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Th}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return Np}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return gg}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return Lh}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return zC}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Ck}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return lv}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return fk}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return QO}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return tk}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return $C}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return wO}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Ek}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return $m}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Sh}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return lk}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return UO}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Ok}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return wk}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return WO}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Tk}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return vk}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Dk}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return ek}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return LC}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return pg}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return yg}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return mv}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return u}});