@p4code/cli 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +1 -1
  2. package/dist/bin.mjs +2518 -499
  3. package/dist/client/assets/DiffPanel-CP_cM9m0.js +98 -0
  4. package/dist/client/assets/{FilePreviewPanel-CXPZlxI3.js → FilePreviewPanel-CLho0PPu.js} +5 -5
  5. package/dist/client/assets/PreviewPanel-DvnUpMQv.js +2 -0
  6. package/dist/client/assets/{angular-html-B5E_J1fS.js → angular-html-CEMakyzJ.js} +2 -2
  7. package/dist/client/assets/{angular-ts-COv5JKxn.js → angular-ts-YXZHq2uz.js} +2 -2
  8. package/dist/client/assets/{apl-BQsQyMXO.js → apl-BTa85Bsd.js} +2 -2
  9. package/dist/client/assets/arrow-right-Bi8kADrV.js +2 -0
  10. package/dist/client/assets/{astro-B8L9Cn_4.js → astro-DIbti84c.js} +2 -2
  11. package/dist/client/assets/{blade-B_Che9pT.js → blade-CKAdvdwG.js} +2 -2
  12. package/dist/client/assets/{c-CPSBTKBx.js → c-DW17xzCK.js} +2 -2
  13. package/dist/client/assets/{cobol-BriE1iNK.js → cobol-DXiicIcZ.js} +2 -2
  14. package/dist/client/assets/{coffee-ClgsI2Oz.js → coffee-9Pdmmdn2.js} +2 -2
  15. package/dist/client/assets/{cpp-BoIGp4CN.js → cpp-bm3vFVmW.js} +2 -2
  16. package/dist/client/assets/{crystal-B-s92Xor.js → crystal-DbxZDZf9.js} +2 -2
  17. package/dist/client/assets/{css-lm7yIvqf.js → css-BEBnbxDe.js} +2 -2
  18. package/dist/client/assets/{edge-BdwKb_XJ.js → edge-K97wVEy_.js} +2 -2
  19. package/dist/client/assets/{elixir-Dd3gZy8B.js → elixir-Rc2JDLLD.js} +2 -2
  20. package/dist/client/assets/{elm-BUwJ0Z6D.js → elm-QsA8aREL.js} +2 -2
  21. package/dist/client/assets/{erb-BmkGyaa3.js → erb-CliRJz4v.js} +2 -2
  22. package/dist/client/assets/{fileCommentAnnotations-aElZ1ls9.js → fileCommentAnnotations-DtIPA0Fm.js} +2 -2
  23. package/dist/client/assets/{git-rebase-CgG-fpnH.js → git-rebase-Da_Wuhd_.js} +2 -2
  24. package/dist/client/assets/{glimmer-js-CgCxySf7.js → glimmer-js-XPbTw3tC.js} +2 -2
  25. package/dist/client/assets/{glimmer-ts-D0qJCdA3.js → glimmer-ts-BtK3NOkH.js} +2 -2
  26. package/dist/client/assets/{glsl-D-TJl_NC.js → glsl-DqEtJptk.js} +2 -2
  27. package/dist/client/assets/{graphql-tJKOdjT8.js → graphql-BSRTeXs0.js} +2 -2
  28. package/dist/client/assets/{hack-CNRyS4CV.js → hack-Dw9HaNHZ.js} +2 -2
  29. package/dist/client/assets/{haml-DZHEkAiU.js → haml-BBNabTlb.js} +2 -2
  30. package/dist/client/assets/{handlebars-C2vebdS9.js → handlebars-BgXzhWSj.js} +2 -2
  31. package/dist/client/assets/{html-derivative-C5tQldZt.js → html-derivative-CANLUZ-z.js} +2 -2
  32. package/dist/client/assets/{html-DCuQyWj1.js → html-wBdSHoow.js} +2 -2
  33. package/dist/client/assets/{http-BAgKJQ4_.js → http-BY44QKMy.js} +2 -2
  34. package/dist/client/assets/{hurl-CPO35wiX.js → hurl-EMZQkkjM.js} +2 -2
  35. package/dist/client/assets/index-Dol3ssFp.css +1 -0
  36. package/dist/client/assets/index-kwzTYbVb.js +775 -0
  37. package/dist/client/assets/{java-DdKunJP-.js → java-ByjPbT42.js} +2 -2
  38. package/dist/client/assets/{javascript-BzCImGGh.js → javascript-C9vbUEcm.js} +2 -2
  39. package/dist/client/assets/{jinja-KxDS67Zm.js → jinja-DH-AbsBN.js} +2 -2
  40. package/dist/client/assets/{jison-CB_VQ7nH.js → jison-Bef1Ntr_.js} +2 -2
  41. package/dist/client/assets/{json-DW5yQfU4.js → json-Gk_oM0bP.js} +2 -2
  42. package/dist/client/assets/{jsx-BCRm4K8K.js → jsx-Ds7YHLou.js} +2 -2
  43. package/dist/client/assets/{julia-B7zmtt-j.js → julia-Dm-6xpIK.js} +2 -2
  44. package/dist/client/assets/{just-BPUjF3fe.js → just-BXY93QN4.js} +2 -2
  45. package/dist/client/assets/{latex-DlHsgJiO.js → latex-B3-eYkFA.js} +2 -2
  46. package/dist/client/assets/{liquid-DkAYrmIm.js → liquid-C10OBLnm.js} +2 -2
  47. package/dist/client/assets/{lua-CkWXcEtU.js → lua-BUR8bsxC.js} +2 -2
  48. package/dist/client/assets/{marko-BreU7Tr4.js → marko-COPLM_fz.js} +2 -2
  49. package/dist/client/assets/{mdc-BIy4U_CM.js → mdc-CTAUTBsz.js} +2 -2
  50. package/dist/client/assets/{nginx-CaBRBNvW.js → nginx-D1BLqLRM.js} +2 -2
  51. package/dist/client/assets/{nim-Dh_VcD-W.js → nim-Xs8VbhdY.js} +2 -2
  52. package/dist/client/assets/{perl-DljrVQhk.js → perl-D7-zmFa1.js} +2 -2
  53. package/dist/client/assets/{php-DcpMefw4.js → php-BiTVgoaL.js} +2 -2
  54. package/dist/client/assets/{pug-BquSKFGg.js → pug-DphfHoFa.js} +2 -2
  55. package/dist/client/assets/{qml-DEzduZ1z.js → qml-CYcNnFOd.js} +2 -2
  56. package/dist/client/assets/{r-D0PJ1YHw.js → r-BrJ-p0TS.js} +2 -2
  57. package/dist/client/assets/{razor-C9NzXzG1.js → razor-1gio6m_g.js} +2 -2
  58. package/dist/client/assets/{regexp-Bppxv8Nd.js → regexp-CNiuKup7.js} +2 -2
  59. package/dist/client/assets/{rst-BHL4HPZF.js → rst-BPOsO8_U.js} +2 -2
  60. package/dist/client/assets/{ruby-BgqgMbbJ.js → ruby-CpfKHKDc.js} +2 -2
  61. package/dist/client/assets/{sas-CWVKvcbG.js → sas-CngX1we2.js} +2 -2
  62. package/dist/client/assets/{scss-Cw6AvzKE.js → scss-B2remLQX.js} +2 -2
  63. package/dist/client/assets/{shellscript-BmSXT-3L.js → shellscript-CQmxALRY.js} +2 -2
  64. package/dist/client/assets/{shellsession-CoR9jXze.js → shellsession-BB-5CB_r.js} +2 -2
  65. package/dist/client/assets/{soy-C4LA8zVY.js → soy-kYUnX51I.js} +2 -2
  66. package/dist/client/assets/{sql-ByI0x14l.js → sql-Cq9fRkwr.js} +2 -2
  67. package/dist/client/assets/{stata-fHDl5JMD.js → stata-17nboilR.js} +2 -2
  68. package/dist/client/assets/{surrealql-bNPgbvaA.js → surrealql-D1hrcsSn.js} +2 -2
  69. package/dist/client/assets/{svelte-BvpeBLSH.js → svelte-GmGi3eK8.js} +2 -2
  70. package/dist/client/assets/{templ-uUxwDReQ.js → templ-DySdTLEs.js} +2 -2
  71. package/dist/client/assets/{tex-DvBkmY5z.js → tex-CblcFqPi.js} +2 -2
  72. package/dist/client/assets/textarea-Cf56oU_6.js +46 -0
  73. package/dist/client/assets/{ts-tags-CNdGGSEK.js → ts-tags-BQC5pzJI.js} +2 -2
  74. package/dist/client/assets/{tsx-C-xKLmxT.js → tsx-1bNjXgiV.js} +2 -2
  75. package/dist/client/assets/{twig-BwP3uniF.js → twig-CNwthYXl.js} +2 -2
  76. package/dist/client/assets/{typescript-EVQqiZdz.js → typescript-BTKoaKmx.js} +2 -2
  77. package/dist/client/assets/{vue-CcDCYMax.js → vue-B4XpWxge.js} +2 -2
  78. package/dist/client/assets/{vue-html-D78T-MxH.js → vue-html-CcUSqexV.js} +2 -2
  79. package/dist/client/assets/{vue-vine-CZ6XjTDM.js → vue-vine-JDMd26pY.js} +2 -2
  80. package/dist/client/assets/{xml-Clr4M-ss.js → xml-DRuNSJP8.js} +2 -2
  81. package/dist/client/assets/{xsl-CboPzliu.js → xsl-BIJJg1B0.js} +2 -2
  82. package/dist/client/assets/{yaml-DOfnzofq.js → yaml-BNEnOsJI.js} +2 -2
  83. package/dist/client/index.html +3 -3
  84. package/package.json +1 -1
  85. package/dist/client/assets/DiffPanel-rTTo7hcH.js +0 -98
  86. package/dist/client/assets/PreviewPanel-BFuAVjo6.js +0 -2
  87. package/dist/client/assets/arrow-right-SCFydakV.js +0 -2
  88. package/dist/client/assets/index-DXGA7g9I.js +0 -655
  89. package/dist/client/assets/index-MItVmi4T.css +0 -1
  90. package/dist/client/assets/textarea-CbUaa52I.js +0 -46
@@ -1,2 +1,2 @@
1
- import{Ep as e}from"./textarea-CbUaa52I.js";import{t}from"./java-DdKunJP-.js";var n=e({default:()=>i}),r=Object.freeze(JSON.parse(`{"displayName":"XML","name":"xml","patterns":[{"begin":"(<\\\\?)\\\\s*([-0-9A-Z_a-z]+)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.xml"}},"end":"(\\\\?>)","name":"meta.tag.preprocessor.xml","patterns":[{"match":" ([-A-Za-z]+)","name":"entity.other.attribute-name.xml"},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},{"begin":"(<!)(DOCTYPE)\\\\s+([:A-Z_a-z][-.0-:A-Z_a-z]*)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"keyword.other.doctype.xml"},"3":{"name":"variable.language.documentroot.xml"}},"end":"\\\\s*(>)","name":"meta.tag.sgml.doctype.xml","patterns":[{"include":"#internalSubset"}]},{"include":"#comments"},{"begin":"(<)((?:([-0-9A-Z_a-z]+)(:))?([-0-:A-Z_a-z]+))(?=(\\\\s[^>]*)?></\\\\2>)","beginCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.xml"},"3":{"name":"entity.name.tag.namespace.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"end":"(>)(</)((?:([-0-9A-Z_a-z]+)(:))?([-0-:A-Z_a-z]+))(>)","endCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"punctuation.definition.tag.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"entity.name.tag.namespace.xml"},"5":{"name":"punctuation.separator.namespace.xml"},"6":{"name":"entity.name.tag.localname.xml"},"7":{"name":"punctuation.definition.tag.xml"}},"name":"meta.tag.no-content.xml","patterns":[{"include":"#tagStuff"}]},{"begin":"(</?)(?:([-.\\\\w]+)((:)))?([-.:\\\\w]+)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.namespace.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"end":"(/?>)","name":"meta.tag.xml","patterns":[{"include":"#tagStuff"}]},{"include":"#entity"},{"include":"#bare-ampersand"},{"begin":"<%@","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.xml"}},"end":"%>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.xml"}},"name":"source.java-props.embedded.xml","patterns":[{"match":"page|include|taglib","name":"keyword.other.page-props.xml"}]},{"begin":"<%[!=]?(?!--)","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.xml"}},"end":"(?!--)%>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.xml"}},"name":"source.java.embedded.xml","patterns":[{"include":"source.java"}]},{"begin":"<!\\\\[CDATA\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"]]>","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.unquoted.cdata.xml"}],"repository":{"EntityDecl":{"begin":"(<!)(ENTITY)\\\\s+(%\\\\s+)?([:A-Z_a-z][-.0-:A-Z_a-z]*)(\\\\s+(?:SYSTEM|PUBLIC)\\\\s+)?","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"keyword.other.entity.xml"},"3":{"name":"punctuation.definition.entity.xml"},"4":{"name":"variable.language.entity.xml"},"5":{"name":"keyword.other.entitytype.xml"}},"end":"(>)","patterns":[{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},"bare-ampersand":{"match":"&","name":"invalid.illegal.bad-ampersand.xml"},"comments":{"patterns":[{"begin":"<%--","captures":{"0":{"name":"punctuation.definition.comment.xml"},"end":"--%>","name":"comment.block.xml"}},{"begin":"<!--","captures":{"0":{"name":"punctuation.definition.comment.xml"}},"end":"-->","name":"comment.block.xml","patterns":[{"begin":"--(?!>)","captures":{"0":{"name":"invalid.illegal.bad-comments-or-CDATA.xml"}}}]}]},"doublequotedString":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.double.xml","patterns":[{"include":"#entity"},{"include":"#bare-ampersand"}]},"entity":{"captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"match":"(&)([:A-Z_a-z][-.0-:A-Z_a-z]*|#[0-9]+|#x\\\\h+)(;)","name":"constant.character.entity.xml"},"internalSubset":{"begin":"(\\\\[)","captures":{"1":{"name":"punctuation.definition.constant.xml"}},"end":"(])","name":"meta.internalsubset.xml","patterns":[{"include":"#EntityDecl"},{"include":"#parameterEntity"},{"include":"#comments"}]},"parameterEntity":{"captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"match":"(%)([:A-Z_a-z][-.0-:A-Z_a-z]*)(;)","name":"constant.character.parameter-entity.xml"},"singlequotedString":{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.single.xml","patterns":[{"include":"#entity"},{"include":"#bare-ampersand"}]},"tagStuff":{"patterns":[{"captures":{"1":{"name":"entity.other.attribute-name.namespace.xml"},"2":{"name":"entity.other.attribute-name.xml"},"3":{"name":"punctuation.separator.namespace.xml"},"4":{"name":"entity.other.attribute-name.localname.xml"}},"match":"(?:^|\\\\s+)(?:([-.\\\\w]+)((:)))?([-.:\\\\w]+)\\\\s*="},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]}},"scopeName":"text.xml","embeddedLangs":["java"]}`)),i=[...t,r];export{n,i as t};
2
- //# sourceMappingURL=xml-Clr4M-ss.js.map
1
+ import{Dp as e}from"./textarea-Cf56oU_6.js";import{t}from"./java-ByjPbT42.js";var n=e({default:()=>i}),r=Object.freeze(JSON.parse(`{"displayName":"XML","name":"xml","patterns":[{"begin":"(<\\\\?)\\\\s*([-0-9A-Z_a-z]+)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.xml"}},"end":"(\\\\?>)","name":"meta.tag.preprocessor.xml","patterns":[{"match":" ([-A-Za-z]+)","name":"entity.other.attribute-name.xml"},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},{"begin":"(<!)(DOCTYPE)\\\\s+([:A-Z_a-z][-.0-:A-Z_a-z]*)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"keyword.other.doctype.xml"},"3":{"name":"variable.language.documentroot.xml"}},"end":"\\\\s*(>)","name":"meta.tag.sgml.doctype.xml","patterns":[{"include":"#internalSubset"}]},{"include":"#comments"},{"begin":"(<)((?:([-0-9A-Z_a-z]+)(:))?([-0-:A-Z_a-z]+))(?=(\\\\s[^>]*)?></\\\\2>)","beginCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.xml"},"3":{"name":"entity.name.tag.namespace.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"end":"(>)(</)((?:([-0-9A-Z_a-z]+)(:))?([-0-:A-Z_a-z]+))(>)","endCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"punctuation.definition.tag.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"entity.name.tag.namespace.xml"},"5":{"name":"punctuation.separator.namespace.xml"},"6":{"name":"entity.name.tag.localname.xml"},"7":{"name":"punctuation.definition.tag.xml"}},"name":"meta.tag.no-content.xml","patterns":[{"include":"#tagStuff"}]},{"begin":"(</?)(?:([-.\\\\w]+)((:)))?([-.:\\\\w]+)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.namespace.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"end":"(/?>)","name":"meta.tag.xml","patterns":[{"include":"#tagStuff"}]},{"include":"#entity"},{"include":"#bare-ampersand"},{"begin":"<%@","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.xml"}},"end":"%>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.xml"}},"name":"source.java-props.embedded.xml","patterns":[{"match":"page|include|taglib","name":"keyword.other.page-props.xml"}]},{"begin":"<%[!=]?(?!--)","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.xml"}},"end":"(?!--)%>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.xml"}},"name":"source.java.embedded.xml","patterns":[{"include":"source.java"}]},{"begin":"<!\\\\[CDATA\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"]]>","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.unquoted.cdata.xml"}],"repository":{"EntityDecl":{"begin":"(<!)(ENTITY)\\\\s+(%\\\\s+)?([:A-Z_a-z][-.0-:A-Z_a-z]*)(\\\\s+(?:SYSTEM|PUBLIC)\\\\s+)?","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"keyword.other.entity.xml"},"3":{"name":"punctuation.definition.entity.xml"},"4":{"name":"variable.language.entity.xml"},"5":{"name":"keyword.other.entitytype.xml"}},"end":"(>)","patterns":[{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},"bare-ampersand":{"match":"&","name":"invalid.illegal.bad-ampersand.xml"},"comments":{"patterns":[{"begin":"<%--","captures":{"0":{"name":"punctuation.definition.comment.xml"},"end":"--%>","name":"comment.block.xml"}},{"begin":"<!--","captures":{"0":{"name":"punctuation.definition.comment.xml"}},"end":"-->","name":"comment.block.xml","patterns":[{"begin":"--(?!>)","captures":{"0":{"name":"invalid.illegal.bad-comments-or-CDATA.xml"}}}]}]},"doublequotedString":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.double.xml","patterns":[{"include":"#entity"},{"include":"#bare-ampersand"}]},"entity":{"captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"match":"(&)([:A-Z_a-z][-.0-:A-Z_a-z]*|#[0-9]+|#x\\\\h+)(;)","name":"constant.character.entity.xml"},"internalSubset":{"begin":"(\\\\[)","captures":{"1":{"name":"punctuation.definition.constant.xml"}},"end":"(])","name":"meta.internalsubset.xml","patterns":[{"include":"#EntityDecl"},{"include":"#parameterEntity"},{"include":"#comments"}]},"parameterEntity":{"captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"match":"(%)([:A-Z_a-z][-.0-:A-Z_a-z]*)(;)","name":"constant.character.parameter-entity.xml"},"singlequotedString":{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.single.xml","patterns":[{"include":"#entity"},{"include":"#bare-ampersand"}]},"tagStuff":{"patterns":[{"captures":{"1":{"name":"entity.other.attribute-name.namespace.xml"},"2":{"name":"entity.other.attribute-name.xml"},"3":{"name":"punctuation.separator.namespace.xml"},"4":{"name":"entity.other.attribute-name.localname.xml"}},"match":"(?:^|\\\\s+)(?:([-.\\\\w]+)((:)))?([-.:\\\\w]+)\\\\s*="},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]}},"scopeName":"text.xml","embeddedLangs":["java"]}`)),i=[...t,r];export{n,i as t};
2
+ //# sourceMappingURL=xml-DRuNSJP8.js.map
@@ -1,2 +1,2 @@
1
- import{t as e}from"./xml-Clr4M-ss.js";var t=Object.freeze(JSON.parse(`{"displayName":"XSL","name":"xsl","patterns":[{"begin":"(<)(xsl)((:))(template)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.namespace.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"end":"(>)","name":"meta.tag.xml.template","patterns":[{"captures":{"1":{"name":"entity.other.attribute-name.namespace.xml"},"2":{"name":"entity.other.attribute-name.xml"},"3":{"name":"punctuation.separator.namespace.xml"},"4":{"name":"entity.other.attribute-name.localname.xml"}},"match":" (?:([-0-9A-Z_a-z]+)((:)))?([-A-Za-z]+)"},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},{"include":"text.xml"}],"repository":{"doublequotedString":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.double.xml"},"singlequotedString":{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.single.xml"}},"scopeName":"text.xml.xsl","embeddedLangs":["xml"]}`)),n=[...e,t];export{n as default};
2
- //# sourceMappingURL=xsl-CboPzliu.js.map
1
+ import{t as e}from"./xml-DRuNSJP8.js";var t=Object.freeze(JSON.parse(`{"displayName":"XSL","name":"xsl","patterns":[{"begin":"(<)(xsl)((:))(template)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.namespace.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"end":"(>)","name":"meta.tag.xml.template","patterns":[{"captures":{"1":{"name":"entity.other.attribute-name.namespace.xml"},"2":{"name":"entity.other.attribute-name.xml"},"3":{"name":"punctuation.separator.namespace.xml"},"4":{"name":"entity.other.attribute-name.localname.xml"}},"match":" (?:([-0-9A-Z_a-z]+)((:)))?([-A-Za-z]+)"},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},{"include":"text.xml"}],"repository":{"doublequotedString":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.double.xml"},"singlequotedString":{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.single.xml"}},"scopeName":"text.xml.xsl","embeddedLangs":["xml"]}`)),n=[...e,t];export{n as default};
2
+ //# sourceMappingURL=xsl-BIJJg1B0.js.map
@@ -1,2 +1,2 @@
1
- import{Ep as e}from"./textarea-CbUaa52I.js";var t=e({default:()=>n}),n=[Object.freeze(JSON.parse(`{"displayName":"YAML","fileTypes":["yaml","yml","rviz","reek","clang-format","yaml-tmlanguage","syntax","sublime-syntax"],"firstLineMatch":"^%YAML( ?1.\\\\d+)?","name":"yaml","patterns":[{"include":"#comment"},{"include":"#property"},{"include":"#directive"},{"match":"^---","name":"entity.other.document.begin.yaml"},{"match":"^\\\\.{3}","name":"entity.other.document.end.yaml"},{"include":"#node"}],"repository":{"block-collection":{"patterns":[{"include":"#block-sequence"},{"include":"#block-mapping"}]},"block-mapping":{"patterns":[{"include":"#block-pair"}]},"block-node":{"patterns":[{"include":"#prototype"},{"include":"#block-scalar"},{"include":"#block-collection"},{"include":"#flow-scalar-plain-out"},{"include":"#flow-node"}]},"block-pair":{"patterns":[{"begin":"\\\\?","beginCaptures":{"1":{"name":"punctuation.definition.key-value.begin.yaml"}},"end":"(?=\\\\?)|^ *(:)|(:)","endCaptures":{"1":{"name":"punctuation.separator.key-value.mapping.yaml"},"2":{"name":"invalid.illegal.expected-newline.yaml"}},"name":"meta.block-mapping.yaml","patterns":[{"include":"#block-node"}]},{"begin":"(?=(?:[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?]\\\\S)([^:\\\\s]|:\\\\S|\\\\s+(?![#\\\\s]))*\\\\s*:(\\\\s|$))","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$))","patterns":[{"include":"#flow-scalar-plain-out-implicit-type"},{"begin":"[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?]\\\\S","beginCaptures":{"0":{"name":"entity.name.tag.yaml"}},"contentName":"entity.name.tag.yaml","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$))","name":"string.unquoted.plain.out.yaml"}]},{"match":":(?=\\\\s|$)","name":"punctuation.separator.key-value.mapping.yaml"}]},"block-scalar":{"begin":"(?:(\\\\|)|(>))([1-9])?([-+])?(.*\\\\n?)","beginCaptures":{"1":{"name":"keyword.control.flow.block-scalar.literal.yaml"},"2":{"name":"keyword.control.flow.block-scalar.folded.yaml"},"3":{"name":"constant.numeric.indentation-indicator.yaml"},"4":{"name":"storage.modifier.chomping-indicator.yaml"},"5":{"patterns":[{"include":"#comment"},{"match":".+","name":"invalid.illegal.expected-comment-or-newline.yaml"}]}},"end":"^(?=\\\\S)|(?!\\\\G)","patterns":[{"begin":"^( +)(?! )","end":"^(?!\\\\1|\\\\s*$)","name":"string.unquoted.block.yaml"}]},"block-sequence":{"match":"(-)(?!\\\\S)","name":"punctuation.definition.block.sequence.item.yaml"},"comment":{"begin":"(?:^([\\\\t ]*)|[\\\\t ]+)(?=#\\\\p{print}*$)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.yaml"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.yaml"}},"end":"\\\\n","name":"comment.line.number-sign.yaml"}]},"directive":{"begin":"^%","beginCaptures":{"0":{"name":"punctuation.definition.directive.begin.yaml"}},"end":"(?=$|[\\\\t ]+($|#))","name":"meta.directive.yaml","patterns":[{"captures":{"1":{"name":"keyword.other.directive.yaml.yaml"},"2":{"name":"constant.numeric.yaml-version.yaml"}},"match":"\\\\G(YAML)[\\\\t ]+(\\\\d+\\\\.\\\\d+)"},{"captures":{"1":{"name":"keyword.other.directive.tag.yaml"},"2":{"name":"storage.type.tag-handle.yaml"},"3":{"name":"support.type.tag-prefix.yaml"}},"match":"\\\\G(TAG)(?:[\\\\t ]+(!(?:[-0-9A-Za-z]*!)?)(?:[\\\\t ]+(!(?:%\\\\h{2}|[]!#$\\\\&-;=?-\\\\[_a-z~])*|(?![]!,\\\\[{}])(?:%\\\\h{2}|[]!#$\\\\&-;=?-\\\\[_a-z~])+))?)?"},{"captures":{"1":{"name":"support.other.directive.reserved.yaml"},"2":{"name":"string.unquoted.directive-name.yaml"},"3":{"name":"string.unquoted.directive-parameter.yaml"}},"match":"\\\\G(\\\\w+)(?:[\\\\t ]+(\\\\w+)(?:[\\\\t ]+(\\\\w+))?)?"},{"match":"\\\\S+","name":"invalid.illegal.unrecognized.yaml"}]},"flow-alias":{"captures":{"1":{"name":"keyword.control.flow.alias.yaml"},"2":{"name":"punctuation.definition.alias.yaml"},"3":{"name":"variable.other.alias.yaml"},"4":{"name":"invalid.illegal.character.anchor.yaml"}},"match":"((\\\\*))([^],/\\\\[{}\\\\s]+)([^],}\\\\s]\\\\S*)?"},"flow-collection":{"patterns":[{"include":"#flow-sequence"},{"include":"#flow-mapping"}]},"flow-mapping":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.mapping.begin.yaml"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.mapping.end.yaml"}},"name":"meta.flow-mapping.yaml","patterns":[{"include":"#prototype"},{"match":",","name":"punctuation.separator.mapping.yaml"},{"include":"#flow-pair"}]},"flow-node":{"patterns":[{"include":"#prototype"},{"include":"#flow-alias"},{"include":"#flow-collection"},{"include":"#flow-scalar"}]},"flow-pair":{"patterns":[{"begin":"\\\\?","beginCaptures":{"0":{"name":"punctuation.definition.key-value.begin.yaml"}},"end":"(?=[],}])","name":"meta.flow-pair.explicit.yaml","patterns":[{"include":"#prototype"},{"include":"#flow-pair"},{"include":"#flow-node"},{"begin":":(?=\\\\s|$|[],\\\\[{}])","beginCaptures":{"0":{"name":"punctuation.separator.key-value.mapping.yaml"}},"end":"(?=[],}])","patterns":[{"include":"#flow-value"}]}]},{"begin":"(?=(?:[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?][^],\\\\[{}\\\\s])([^],:\\\\[{}\\\\s]|:[^],\\\\[{}\\\\s]|\\\\s+(?![#\\\\s]))*\\\\s*:(\\\\s|$))","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$)|\\\\s*:[],\\\\[{}]|\\\\s*[],\\\\[{}])","name":"meta.flow-pair.key.yaml","patterns":[{"include":"#flow-scalar-plain-in-implicit-type"},{"begin":"[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?][^],\\\\[{}\\\\s]","beginCaptures":{"0":{"name":"entity.name.tag.yaml"}},"contentName":"entity.name.tag.yaml","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$)|\\\\s*:[],\\\\[{}]|\\\\s*[],\\\\[{}])","name":"string.unquoted.plain.in.yaml"}]},{"include":"#flow-node"},{"begin":":(?=\\\\s|$|[],\\\\[{}])","captures":{"0":{"name":"punctuation.separator.key-value.mapping.yaml"}},"end":"(?=[],}])","name":"meta.flow-pair.yaml","patterns":[{"include":"#flow-value"}]}]},"flow-scalar":{"patterns":[{"include":"#flow-scalar-double-quoted"},{"include":"#flow-scalar-single-quoted"},{"include":"#flow-scalar-plain-in"}]},"flow-scalar-double-quoted":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.yaml"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.yaml"}},"name":"string.quoted.double.yaml","patterns":[{"match":"\\\\\\\\([ \\"/0LN\\\\\\\\_abefnprtv]|x\\\\d\\\\d|u\\\\d{4}|U\\\\d{8})","name":"constant.character.escape.yaml"},{"match":"\\\\\\\\\\\\n","name":"constant.character.escape.double-quoted.newline.yaml"}]},"flow-scalar-plain-in":{"patterns":[{"include":"#flow-scalar-plain-in-implicit-type"},{"begin":"[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?][^],\\\\[{}\\\\s]","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$)|\\\\s*:[],\\\\[{}]|\\\\s*[],\\\\[{}])","name":"string.unquoted.plain.in.yaml"}]},"flow-scalar-plain-in-implicit-type":{"patterns":[{"captures":{"1":{"name":"constant.language.null.yaml"},"2":{"name":"constant.language.boolean.yaml"},"3":{"name":"constant.numeric.integer.yaml"},"4":{"name":"constant.numeric.float.yaml"},"5":{"name":"constant.other.timestamp.yaml"},"6":{"name":"constant.language.value.yaml"},"7":{"name":"constant.language.merge.yaml"}},"match":"(?:(null|Null|NULL|~)|([Yy]|yes|Yes|YES|[Nn]|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)|([-+]?0b[01_]+|[-+]?0[0-7_]+|[-+]?(?:0|[1-9][0-9_]*)|[-+]?0x[_\\\\h]+|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)|([-+]?(?:[0-9][0-9_]*)?\\\\.[.0-9]*(?:[Ee][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\\\.[0-9_]*|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))|(\\\\d{4}-\\\\d{2}-\\\\d{2}|\\\\d{4}-\\\\d{1,2}-\\\\d{1,2}(?:[Tt]|[\\\\t ]+)\\\\d{1,2}:\\\\d{2}:\\\\d{2}(?:\\\\.\\\\d*)?(?:[\\\\t ]*Z|[-+]\\\\d{1,2}(?::\\\\d{1,2})?)?)|(=)|(<<))(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$)|\\\\s*:[],\\\\[{}]|\\\\s*[],\\\\[{}])"}]},"flow-scalar-plain-out":{"patterns":[{"include":"#flow-scalar-plain-out-implicit-type"},{"begin":"[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?]\\\\S","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$))","name":"string.unquoted.plain.out.yaml"}]},"flow-scalar-plain-out-implicit-type":{"patterns":[{"captures":{"1":{"name":"constant.language.null.yaml"},"2":{"name":"constant.language.boolean.yaml"},"3":{"name":"constant.numeric.integer.yaml"},"4":{"name":"constant.numeric.float.yaml"},"5":{"name":"constant.other.timestamp.yaml"},"6":{"name":"constant.language.value.yaml"},"7":{"name":"constant.language.merge.yaml"}},"match":"(?:(null|Null|NULL|~)|([Yy]|yes|Yes|YES|[Nn]|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)|([-+]?0b[01_]+|[-+]?0[0-7_]+|[-+]?(?:0|[1-9][0-9_]*)|[-+]?0x[_\\\\h]+|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)|([-+]?(?:[0-9][0-9_]*)?\\\\.[.0-9]*(?:[Ee][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\\\.[0-9_]*|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))|(\\\\d{4}-\\\\d{2}-\\\\d{2}|\\\\d{4}-\\\\d{1,2}-\\\\d{1,2}(?:[Tt]|[\\\\t ]+)\\\\d{1,2}:\\\\d{2}:\\\\d{2}(?:\\\\.\\\\d*)?(?:[\\\\t ]*Z|[-+]\\\\d{1,2}(?::\\\\d{1,2})?)?)|(=)|(<<))(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$))"}]},"flow-scalar-single-quoted":{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.yaml"}},"end":"'(?!')","endCaptures":{"0":{"name":"punctuation.definition.string.end.yaml"}},"name":"string.quoted.single.yaml","patterns":[{"match":"''","name":"constant.character.escape.single-quoted.yaml"}]},"flow-sequence":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.sequence.begin.yaml"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.sequence.end.yaml"}},"name":"meta.flow-sequence.yaml","patterns":[{"include":"#prototype"},{"match":",","name":"punctuation.separator.sequence.yaml"},{"include":"#flow-pair"},{"include":"#flow-node"}]},"flow-value":{"patterns":[{"begin":"\\\\G(?![],}])","end":"(?=[],}])","name":"meta.flow-pair.value.yaml","patterns":[{"include":"#flow-node"}]}]},"node":{"patterns":[{"include":"#block-node"}]},"property":{"begin":"(?=[!\\\\&])","end":"(?!\\\\G)","name":"meta.property.yaml","patterns":[{"captures":{"1":{"name":"keyword.control.property.anchor.yaml"},"2":{"name":"punctuation.definition.anchor.yaml"},"3":{"name":"entity.name.type.anchor.yaml"},"4":{"name":"invalid.illegal.character.anchor.yaml"}},"match":"\\\\G((&))([^],/\\\\[{}\\\\s]+)(\\\\S+)?"},{"match":"\\\\G!(?:<(?:%\\\\h{2}|[]!#$\\\\&-;=?-\\\\[_a-z~])+>|(?:[-0-9A-Za-z]*!)?(?:%\\\\h{2}|[#$\\\\&-+\\\\--;=?-Z_a-z~])+|)(?=[\\\\t ]|$)","name":"storage.type.tag-handle.yaml"},{"match":"\\\\S+","name":"invalid.illegal.tag-handle.yaml"}]},"prototype":{"patterns":[{"include":"#comment"},{"include":"#property"}]}},"scopeName":"source.yaml","aliases":["yml"]}`))];export{t as n,n as t};
2
- //# sourceMappingURL=yaml-DOfnzofq.js.map
1
+ import{Dp as e}from"./textarea-Cf56oU_6.js";var t=e({default:()=>n}),n=[Object.freeze(JSON.parse(`{"displayName":"YAML","fileTypes":["yaml","yml","rviz","reek","clang-format","yaml-tmlanguage","syntax","sublime-syntax"],"firstLineMatch":"^%YAML( ?1.\\\\d+)?","name":"yaml","patterns":[{"include":"#comment"},{"include":"#property"},{"include":"#directive"},{"match":"^---","name":"entity.other.document.begin.yaml"},{"match":"^\\\\.{3}","name":"entity.other.document.end.yaml"},{"include":"#node"}],"repository":{"block-collection":{"patterns":[{"include":"#block-sequence"},{"include":"#block-mapping"}]},"block-mapping":{"patterns":[{"include":"#block-pair"}]},"block-node":{"patterns":[{"include":"#prototype"},{"include":"#block-scalar"},{"include":"#block-collection"},{"include":"#flow-scalar-plain-out"},{"include":"#flow-node"}]},"block-pair":{"patterns":[{"begin":"\\\\?","beginCaptures":{"1":{"name":"punctuation.definition.key-value.begin.yaml"}},"end":"(?=\\\\?)|^ *(:)|(:)","endCaptures":{"1":{"name":"punctuation.separator.key-value.mapping.yaml"},"2":{"name":"invalid.illegal.expected-newline.yaml"}},"name":"meta.block-mapping.yaml","patterns":[{"include":"#block-node"}]},{"begin":"(?=(?:[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?]\\\\S)([^:\\\\s]|:\\\\S|\\\\s+(?![#\\\\s]))*\\\\s*:(\\\\s|$))","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$))","patterns":[{"include":"#flow-scalar-plain-out-implicit-type"},{"begin":"[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?]\\\\S","beginCaptures":{"0":{"name":"entity.name.tag.yaml"}},"contentName":"entity.name.tag.yaml","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$))","name":"string.unquoted.plain.out.yaml"}]},{"match":":(?=\\\\s|$)","name":"punctuation.separator.key-value.mapping.yaml"}]},"block-scalar":{"begin":"(?:(\\\\|)|(>))([1-9])?([-+])?(.*\\\\n?)","beginCaptures":{"1":{"name":"keyword.control.flow.block-scalar.literal.yaml"},"2":{"name":"keyword.control.flow.block-scalar.folded.yaml"},"3":{"name":"constant.numeric.indentation-indicator.yaml"},"4":{"name":"storage.modifier.chomping-indicator.yaml"},"5":{"patterns":[{"include":"#comment"},{"match":".+","name":"invalid.illegal.expected-comment-or-newline.yaml"}]}},"end":"^(?=\\\\S)|(?!\\\\G)","patterns":[{"begin":"^( +)(?! )","end":"^(?!\\\\1|\\\\s*$)","name":"string.unquoted.block.yaml"}]},"block-sequence":{"match":"(-)(?!\\\\S)","name":"punctuation.definition.block.sequence.item.yaml"},"comment":{"begin":"(?:^([\\\\t ]*)|[\\\\t ]+)(?=#\\\\p{print}*$)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.yaml"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.yaml"}},"end":"\\\\n","name":"comment.line.number-sign.yaml"}]},"directive":{"begin":"^%","beginCaptures":{"0":{"name":"punctuation.definition.directive.begin.yaml"}},"end":"(?=$|[\\\\t ]+($|#))","name":"meta.directive.yaml","patterns":[{"captures":{"1":{"name":"keyword.other.directive.yaml.yaml"},"2":{"name":"constant.numeric.yaml-version.yaml"}},"match":"\\\\G(YAML)[\\\\t ]+(\\\\d+\\\\.\\\\d+)"},{"captures":{"1":{"name":"keyword.other.directive.tag.yaml"},"2":{"name":"storage.type.tag-handle.yaml"},"3":{"name":"support.type.tag-prefix.yaml"}},"match":"\\\\G(TAG)(?:[\\\\t ]+(!(?:[-0-9A-Za-z]*!)?)(?:[\\\\t ]+(!(?:%\\\\h{2}|[]!#$\\\\&-;=?-\\\\[_a-z~])*|(?![]!,\\\\[{}])(?:%\\\\h{2}|[]!#$\\\\&-;=?-\\\\[_a-z~])+))?)?"},{"captures":{"1":{"name":"support.other.directive.reserved.yaml"},"2":{"name":"string.unquoted.directive-name.yaml"},"3":{"name":"string.unquoted.directive-parameter.yaml"}},"match":"\\\\G(\\\\w+)(?:[\\\\t ]+(\\\\w+)(?:[\\\\t ]+(\\\\w+))?)?"},{"match":"\\\\S+","name":"invalid.illegal.unrecognized.yaml"}]},"flow-alias":{"captures":{"1":{"name":"keyword.control.flow.alias.yaml"},"2":{"name":"punctuation.definition.alias.yaml"},"3":{"name":"variable.other.alias.yaml"},"4":{"name":"invalid.illegal.character.anchor.yaml"}},"match":"((\\\\*))([^],/\\\\[{}\\\\s]+)([^],}\\\\s]\\\\S*)?"},"flow-collection":{"patterns":[{"include":"#flow-sequence"},{"include":"#flow-mapping"}]},"flow-mapping":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.mapping.begin.yaml"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.mapping.end.yaml"}},"name":"meta.flow-mapping.yaml","patterns":[{"include":"#prototype"},{"match":",","name":"punctuation.separator.mapping.yaml"},{"include":"#flow-pair"}]},"flow-node":{"patterns":[{"include":"#prototype"},{"include":"#flow-alias"},{"include":"#flow-collection"},{"include":"#flow-scalar"}]},"flow-pair":{"patterns":[{"begin":"\\\\?","beginCaptures":{"0":{"name":"punctuation.definition.key-value.begin.yaml"}},"end":"(?=[],}])","name":"meta.flow-pair.explicit.yaml","patterns":[{"include":"#prototype"},{"include":"#flow-pair"},{"include":"#flow-node"},{"begin":":(?=\\\\s|$|[],\\\\[{}])","beginCaptures":{"0":{"name":"punctuation.separator.key-value.mapping.yaml"}},"end":"(?=[],}])","patterns":[{"include":"#flow-value"}]}]},{"begin":"(?=(?:[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?][^],\\\\[{}\\\\s])([^],:\\\\[{}\\\\s]|:[^],\\\\[{}\\\\s]|\\\\s+(?![#\\\\s]))*\\\\s*:(\\\\s|$))","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$)|\\\\s*:[],\\\\[{}]|\\\\s*[],\\\\[{}])","name":"meta.flow-pair.key.yaml","patterns":[{"include":"#flow-scalar-plain-in-implicit-type"},{"begin":"[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?][^],\\\\[{}\\\\s]","beginCaptures":{"0":{"name":"entity.name.tag.yaml"}},"contentName":"entity.name.tag.yaml","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$)|\\\\s*:[],\\\\[{}]|\\\\s*[],\\\\[{}])","name":"string.unquoted.plain.in.yaml"}]},{"include":"#flow-node"},{"begin":":(?=\\\\s|$|[],\\\\[{}])","captures":{"0":{"name":"punctuation.separator.key-value.mapping.yaml"}},"end":"(?=[],}])","name":"meta.flow-pair.yaml","patterns":[{"include":"#flow-value"}]}]},"flow-scalar":{"patterns":[{"include":"#flow-scalar-double-quoted"},{"include":"#flow-scalar-single-quoted"},{"include":"#flow-scalar-plain-in"}]},"flow-scalar-double-quoted":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.yaml"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.yaml"}},"name":"string.quoted.double.yaml","patterns":[{"match":"\\\\\\\\([ \\"/0LN\\\\\\\\_abefnprtv]|x\\\\d\\\\d|u\\\\d{4}|U\\\\d{8})","name":"constant.character.escape.yaml"},{"match":"\\\\\\\\\\\\n","name":"constant.character.escape.double-quoted.newline.yaml"}]},"flow-scalar-plain-in":{"patterns":[{"include":"#flow-scalar-plain-in-implicit-type"},{"begin":"[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?][^],\\\\[{}\\\\s]","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$)|\\\\s*:[],\\\\[{}]|\\\\s*[],\\\\[{}])","name":"string.unquoted.plain.in.yaml"}]},"flow-scalar-plain-in-implicit-type":{"patterns":[{"captures":{"1":{"name":"constant.language.null.yaml"},"2":{"name":"constant.language.boolean.yaml"},"3":{"name":"constant.numeric.integer.yaml"},"4":{"name":"constant.numeric.float.yaml"},"5":{"name":"constant.other.timestamp.yaml"},"6":{"name":"constant.language.value.yaml"},"7":{"name":"constant.language.merge.yaml"}},"match":"(?:(null|Null|NULL|~)|([Yy]|yes|Yes|YES|[Nn]|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)|([-+]?0b[01_]+|[-+]?0[0-7_]+|[-+]?(?:0|[1-9][0-9_]*)|[-+]?0x[_\\\\h]+|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)|([-+]?(?:[0-9][0-9_]*)?\\\\.[.0-9]*(?:[Ee][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\\\.[0-9_]*|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))|(\\\\d{4}-\\\\d{2}-\\\\d{2}|\\\\d{4}-\\\\d{1,2}-\\\\d{1,2}(?:[Tt]|[\\\\t ]+)\\\\d{1,2}:\\\\d{2}:\\\\d{2}(?:\\\\.\\\\d*)?(?:[\\\\t ]*Z|[-+]\\\\d{1,2}(?::\\\\d{1,2})?)?)|(=)|(<<))(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$)|\\\\s*:[],\\\\[{}]|\\\\s*[],\\\\[{}])"}]},"flow-scalar-plain-out":{"patterns":[{"include":"#flow-scalar-plain-out-implicit-type"},{"begin":"[^-\\\\]!\\"#%\\\\&'*,:>?@\\\\[\`{|}\\\\s]|[-:?]\\\\S","end":"(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$))","name":"string.unquoted.plain.out.yaml"}]},"flow-scalar-plain-out-implicit-type":{"patterns":[{"captures":{"1":{"name":"constant.language.null.yaml"},"2":{"name":"constant.language.boolean.yaml"},"3":{"name":"constant.numeric.integer.yaml"},"4":{"name":"constant.numeric.float.yaml"},"5":{"name":"constant.other.timestamp.yaml"},"6":{"name":"constant.language.value.yaml"},"7":{"name":"constant.language.merge.yaml"}},"match":"(?:(null|Null|NULL|~)|([Yy]|yes|Yes|YES|[Nn]|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)|([-+]?0b[01_]+|[-+]?0[0-7_]+|[-+]?(?:0|[1-9][0-9_]*)|[-+]?0x[_\\\\h]+|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)|([-+]?(?:[0-9][0-9_]*)?\\\\.[.0-9]*(?:[Ee][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\\\.[0-9_]*|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))|(\\\\d{4}-\\\\d{2}-\\\\d{2}|\\\\d{4}-\\\\d{1,2}-\\\\d{1,2}(?:[Tt]|[\\\\t ]+)\\\\d{1,2}:\\\\d{2}:\\\\d{2}(?:\\\\.\\\\d*)?(?:[\\\\t ]*Z|[-+]\\\\d{1,2}(?::\\\\d{1,2})?)?)|(=)|(<<))(?=\\\\s*$|\\\\s+#|\\\\s*:(\\\\s|$))"}]},"flow-scalar-single-quoted":{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.yaml"}},"end":"'(?!')","endCaptures":{"0":{"name":"punctuation.definition.string.end.yaml"}},"name":"string.quoted.single.yaml","patterns":[{"match":"''","name":"constant.character.escape.single-quoted.yaml"}]},"flow-sequence":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.sequence.begin.yaml"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.sequence.end.yaml"}},"name":"meta.flow-sequence.yaml","patterns":[{"include":"#prototype"},{"match":",","name":"punctuation.separator.sequence.yaml"},{"include":"#flow-pair"},{"include":"#flow-node"}]},"flow-value":{"patterns":[{"begin":"\\\\G(?![],}])","end":"(?=[],}])","name":"meta.flow-pair.value.yaml","patterns":[{"include":"#flow-node"}]}]},"node":{"patterns":[{"include":"#block-node"}]},"property":{"begin":"(?=[!\\\\&])","end":"(?!\\\\G)","name":"meta.property.yaml","patterns":[{"captures":{"1":{"name":"keyword.control.property.anchor.yaml"},"2":{"name":"punctuation.definition.anchor.yaml"},"3":{"name":"entity.name.type.anchor.yaml"},"4":{"name":"invalid.illegal.character.anchor.yaml"}},"match":"\\\\G((&))([^],/\\\\[{}\\\\s]+)(\\\\S+)?"},{"match":"\\\\G!(?:<(?:%\\\\h{2}|[]!#$\\\\&-;=?-\\\\[_a-z~])+>|(?:[-0-9A-Za-z]*!)?(?:%\\\\h{2}|[#$\\\\&-+\\\\--;=?-Z_a-z~])+|)(?=[\\\\t ]|$)","name":"storage.type.tag-handle.yaml"},{"match":"\\\\S+","name":"invalid.illegal.tag-handle.yaml"}]},"prototype":{"patterns":[{"include":"#comment"},{"include":"#property"}]}},"scopeName":"source.yaml","aliases":["yml"]}`))];export{t as n,n as t};
2
+ //# sourceMappingURL=yaml-BNEnOsJI.js.map
@@ -90,9 +90,9 @@
90
90
  does not flash a stage label the client will not use.
91
91
  -->
92
92
  <title>P4Code</title>
93
- <script type="module" crossorigin src="/assets/index-DXGA7g9I.js"></script>
94
- <link rel="modulepreload" crossorigin href="/assets/textarea-CbUaa52I.js">
95
- <link rel="stylesheet" crossorigin href="/assets/index-MItVmi4T.css">
93
+ <script type="module" crossorigin src="/assets/index-kwzTYbVb.js"></script>
94
+ <link rel="modulepreload" crossorigin href="/assets/textarea-Cf56oU_6.js">
95
+ <link rel="stylesheet" crossorigin href="/assets/index-Dol3ssFp.css">
96
96
  </head>
97
97
  <body>
98
98
  <div id="root">
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "p4c": "./dist/bin.mjs"
10
10
  },
11
11
  "type": "module",
12
- "version": "0.1.16",
12
+ "version": "0.1.18",
13
13
  "license": "MIT",
14
14
  "publishConfig": {
15
15
  "access": "public"
@@ -1,98 +0,0 @@
1
- import{$f as e,$t as t,Bs as n,Dp as r,Fs as i,Ft as a,Gs as o,Hr as s,Jr as c,Ko as l,Pr as u,Qf as d,Rr as f,Sp as p,T as m,U as h,Uo as g,Vr as _,Xr as v,Yr as y,Yt as b,_ as x,as as S,d as C,h as w,in as T,is as E,ks as D,lo as O,m as k,os as A,pc as j,po as M,qr as ee,rs as te,s as ne,sp as N,wp as P,ws as re,z as ie,zi as F}from"./textarea-CbUaa52I.js";import{t as ae}from"./arrow-right-SCFydakV.js";import{a as oe,n as I,o as se,s as ce}from"./fileCommentAnnotations-aElZ1ls9.js";import{$t as L,B as le,Bn as ue,C as de,Fn as fe,G as pe,Hn as me,I as he,In as ge,Ir as _e,J as ve,K as ye,Kn as R,L as be,Ln as xe,Lr as Se,Nn as Ce,Pn as we,Q as Te,Qt as Ee,R as De,Rn as Oe,Sr as ke,T as z,Un as Ae,Vn as je,W as B,X as Me,Xt as V,Y as Ne,Yn as Pe,Z as Fe,Zt as H,_ as Ie,_r as Le,an as Re,cn as U,en as W,fn as ze,gr as Be,h as Ve,hr as He,ln as Ue,nn as We,nt as G,on as Ge,pn as Ke,q as qe,tn as Je,w as K,wn as Ye,xr as Xe,yr as Ze,z as Qe,zn as $e,zr as et}from"./index-DXGA7g9I.js";var tt=A(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),nt=A(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),rt=A(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]);function q(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function J(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var it=`theme.disableLineNumbers.overflow.themeType.disableFileHeader.disableVirtualizationBuffers.preferredHighlighter.useCSSClasses.useTokenTransformer.tokenizeMaxLineLength.tokenizeMaxLength.unsafeCSS.diffStyle.diffIndicators.disableBackground.expandUnchanged.collapsedContextThreshold.lineDiffType.maxLineDiffLength.expansionLineCount.lineHoverHighlight.enableTokenInteractionsOnWhitespace.enableGutterUtility.__debugPointerEvents.enableLineSelection.controlledSelection.disableErrorHandling`.split(`.`),at=[`theme`,`disableLineNumbers`,`overflow`,`themeType`,`disableFileHeader`,`disableVirtualizationBuffers`,`preferredHighlighter`,`useCSSClasses`,`useTokenTransformer`,`tokenizeMaxLineLength`,`tokenizeMaxLength`,`unsafeCSS`,`lineHoverHighlight`,`enableTokenInteractionsOnWhitespace`,`enableGutterUtility`,`__debugPointerEvents`,`enableLineSelection`,`controlledSelection`,`disableErrorHandling`],ot=[`renderCustomHeader`,`renderHeaderPrefix`,`renderHeaderMetadata`,`renderAnnotation`,`renderGutterUtility`,`onPostRender`,`onGutterUtilityClick`,`onLineClick`,`onLineNumberClick`,`onLineEnter`,`onLineLeave`,`onTokenClick`,`onTokenEnter`,`onTokenLeave`],st=[`onLineSelected`,`onLineSelectionStart`,`onLineSelectionChange`,`onLineSelectionEnd`],ct=Symbol(`CodeView.itemOptionsState`);function lt(e,t){Object.defineProperty(e,ct,{configurable:!1,enumerable:!1,value:t})}function ut(e){return e[ct]}function Y(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}var dt=120,ft=`--diffs-overflow-override`,pt=12e6,mt=1e6,ht=2e6,X=pt-ht,gt=pt-mt,Z=(()=>{let{navigator:e}=globalThis,t=e.userAgent,n=/iP(?:hone|ad|od)/.test(t),r=e.platform===`MacIntel`&&e.maxTouchPoints>1;return(n||r)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})(),_t=class e{static __STOP=!1;static __lastScrollPosition=0;type=`advanced`;config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=Re;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement(`div`);stickyContainer=document.createElement(`div`);stickyOffset=document.createElement(`div`);elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isContainerManaged;constructor(e={theme:Ue},t,n=!1){this.options=e,this.computeMetricsCache(e.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=t,this.isContainerManaged=n,this.stickyOffset.style.contain=`layout size`,this.stickyContainer.style.position=`sticky`,this.stickyContainer.style.width=`100%`,this.stickyContainer.style.contain=`layout style inline-size`,this.stickyContainer.style.isolation=`isolate`,this.stickyContainer.style.display=`flex`,this.stickyContainer.style.flexDirection=`column`}getLayout(){return this.options.layout??Ge}computeMetricsCache(e){return this.itemMetricsCache={hunkLineCount:e?.hunkLineCount??Re.hunkLineCount,lineHeight:e?.lineHeight??Re.lineHeight,diffHeaderHeight:e?.diffHeaderHeight??Re.diffHeaderHeight,hunkSeparatorHeight:e?.hunkSeparatorHeight,spacing:e?.spacing??Re.spacing,paddingTop:e?.paddingTop,paddingBottom:e?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??U}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return ze&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(e){if(!this.shouldValidateItemHeights()||e.element==null)return;let t=e.instance.getAdvancedStickySpecs();if(t==null)return;let n=t.height,r=e.element.getBoundingClientRect().height;n!==r&&console.error(`CodeView: reconciled item height does not match DOM height`,{id:e.item.id,type:e.type,index:e.index,version:e.version,expectedHeight:n,actualHeight:r,delta:r-n,stickyTopOffset:t.topOffset,virtualizedHeight:e.instance.getVirtualizedHeight(),top:e.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:e.element,instance:e.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;let{firstIndex:e,lastIndex:t,stickyHeight:n,stickyTop:r,stickyBottom:i}=this.renderState;if(e===-1||t===-1)return;let a=this.stickyContainer.getBoundingClientRect().height;Math.abs(a-n)<1||console.error(`CodeView: sticky container height does not match computed layout`,{computedStickyHeight:n,actualStickyHeight:a,delta:a-n,stickyTop:r,stickyBottom:i,firstIndex:e,lastIndex:t,firstStickySpecs:this.items[e]?.instance.getAdvancedStickySpecs(),lastStickySpecs:this.items[t]?.instance.getAdvancedStickySpecs(),scrollTop:this.getScrollTop(),scrollPageOffset:this.scrollPageOffset,windowSpecs:{...this.windowSpecs},stickyContainer:this.stickyContainer})}clearScrollInteractionTimer(){this.scrollInteractionFixTimer!=null&&(clearTimeout(this.scrollInteractionFixTimer),this.scrollInteractionFixTimer=void 0)}suspendScrollInteractions(){this.clearScrollInteractionTimer(),this.shouldDisablePointerEvents()&&!this.pointerEventsDisabled&&(this.stickyContainer.style.pointerEvents=`none`,this.pointerEventsDisabled=!0),Z&&!this.codeOverflowFix&&(this.stickyContainer.style.setProperty(ft,`hidden`),this.codeOverflowFix=!0),this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,dt)}restoreScrollInteractions=()=>{this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&=(this.stickyContainer.style.removeProperty(`pointer-events`),!1),this.codeOverflowFix&&=(this.stickyContainer.style.setProperty(ft,`auto`),!1)};syncLayout(){let{gap:e,paddingBottom:t,paddingTop:n}=this.getLayout();this.stickyContainer.style.gap=`${e}px`,this.container?.style.setProperty(`margin-top`,`${n}px`),this.container?.style.setProperty(`margin-bottom`,`${t}px`)}setup(t){if(this.root!=null)throw Error(`CodeView.setup: already setup`);this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor=`none`,this.root.hasAttribute(`tabindex`)||(this.root.tabIndex=-1),this.container??=document.createElement(`div`),this.container.style.contain=`layout style`,this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener(`scroll`,this.handleScroll,{passive:!0}),this.root.addEventListener(`wheel`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`touchstart`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`pointerdown`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`keydown`,this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,this.scrollTo({type:`position`,position:e.__lastScrollPosition,behavior:`instant`})):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)}}reset(){this.restoreScrollInteractions(),this.cleanAllRenderedItems(),this.selectedLines=null,this.items.length=0,this.idToItem.clear(),this.instanceToItem.clear(),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent=``,this.stickyOffset.style.height=``,this.container?.style.removeProperty(`height`),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isContainerManaged||this.flushSlotCoordinator()}cleanUp(){this.reset(),this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleScroll),this.root?.removeEventListener(`wheel`,this.clearPendingScroll),this.root?.removeEventListener(`touchstart`,this.clearPendingScroll),this.root?.removeEventListener(`pointerdown`,this.clearPendingScroll),this.root?.removeEventListener(`keydown`,this.clearPendingScroll),this.root?.style.removeProperty(`overflow-anchor`),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent=``,this.root=void 0,this.container=void 0}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let e=this.renderState.firstIndex;e<=this.renderState.lastIndex;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${e}`);this.releaseRenderedItem(t)}}primeScrollTarget(e){e.type!==`position`&&this.idToItem.get(e.id)?.instance.primeHighlightCache()}getElementPoolLimit(){let e=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:t}=this.itemMetricsCache;return Math.max(8,Math.ceil(e/Math.max(t,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let e=this.elementPool.pop();for(;e!=null&&!this.isElementPoolGenerationCurrent(e);)e=this.elementPool.pop();return e??=document.createElement(Ke),this.markElementPoolGenerationCurrent(e),e}releaseRenderedItem(e){let{element:t}=e;t!=null&&this.renderedItemOwnsFocus(t)&&(this.shouldFixContainerFocus=!0),e.instance.cleanUp(!0),e.element=void 0,t!=null&&(t.remove(),this.cleanElement(t),this.queueElementForPool(t))}renderedItemOwnsFocus(e){let{activeElement:t}=document;return t===e||e.contains(t)||e.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(e){let{shadowRoot:t}=e;if(t!=null)for(let e of Array.from(t.children))St(e)||e.remove();this.isContainerManaged||e.replaceChildren()}queueElementForPool(e){let t=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(e)||this.getElementPoolSize()>=t||(this.isElementClean(e)?this.elementPool.push(e):this.pendingElementPool.push(e))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;let{pendingElementPool:e}=this;this.pendingElementPool=[];let t=this.getElementPoolLimit();for(let n of e)this.isElementPoolGenerationCurrent(n)&&this.isElementClean(n)&&this.elementPool.length<t?this.elementPool.push(n):this.isElementPoolGenerationCurrent(n)&&this.getElementPoolSize()<t&&this.pendingElementPool.push(n)}isElementClean(e){return e.childNodes.length===0}getElementPoolSize(){return this.elementPool.length+this.pendingElementPool.length}clearElementPool(){this.elementPool.length=0,this.pendingElementPool.length=0}invalidateElementPool(){this.elementPoolVersion++,this.clearElementPool()}markElementPoolGenerationCurrent(e){this.elementPoolTracker.set(e,this.elementPoolVersion)}isElementPoolGenerationCurrent(e){return this.elementPoolTracker.get(e)===this.elementPoolVersion}resolveEffectiveScrollBehavior(e,t){return q()?`instant`:e.behavior===`smooth-auto`?Math.abs(t-this.getScrollTop())<=this.getHeight()*10?`smooth`:`instant`:e.behavior??`instant`}scrollTo(e){if(this.root==null)return;let t=this.normalizeScrollTarget(e);if(t==null)return;let n=this.resolveScrollTargetTop(t);n!=null&&(this.primeScrollTarget(t),this.resolveEffectiveScrollBehavior(t,n)===`smooth`?this.scrollAnimation??={position:this.getScrollTop(),velocity:0,lastTimestamp:performance.now()}:this.scrollAnimation=void 0,this.suspendScrollInteractions(),this.pendingLayoutAnchor=void 0,this.pendingScrollTarget=t,this.render())}setSelectedLines(e,t){this.applySelectedLines(e,t)}getSelectedLines(){return this.selectedLines}clearSelectedLines(e){this.applySelectedLines(null,e)}getItem(e){return this.idToItem.get(e)?.item}updateItem(e){let t=this.idToItem.get(e.id);return t==null?(console.error(`CodeView.updateItem: unknown item id "${e.id}"`),!1):this.syncItemRecord(t,e)?(this.markItemLayoutDirty(t),this.scrollDirty=!0,this.render(),this.syncSelection(),!0):!1}updateItemId(e,t){if(e===t)return!0;let n=this.idToItem.get(e);return n==null?(console.error(`CodeView.updateItemId: unknown item id "${e}"`),!1):this.idToItem.has(t)?(console.error(`CodeView.updateItemId: duplicate item id "${t}"`),!1):(this.idToItem.delete(e),n.item.id=t,this.idToItem.set(t,n),this.updateItemOptionsId(n.instance.options,t),this.selectedLines?.id===e&&(this.selectedLines={...this.selectedLines,id:t},this.options.onSelectedLinesChange?.(this.selectedLines)),this.renamePendingScrollTarget(e,t),this.renamePendingLayoutAnchor(e,t),this.render(),!0)}addItem(e){this.addItems([e]),this.syncSelection()}addItems(e){this.appendItemsInternal(e),this.syncSelection()}setItems(e){e.length===0?this.reset():this.items.length===0?this.appendItemsInternal(e):this.tryAppendItems(e)||this.reconcileItems(e),this.syncSelection()}appendItemsInternal(e,t=!0){if(e.length===0)return;let n=this.getLayout(),r=this.items.length===0?0:this.scrollHeight+n.gap,i=r;for(let t=0;t<e.length;t++){let i=e[t];if(i==null)throw Error(`CodeView.appendItemsInternal: missing input item`);if(this.idToItem.has(i.id))throw Error(`CodeView.addItem: duplicate id "${i.id}"`);let a=this.createItem(i,this.items.length,r);this.items.push(a),this.idToItem.set(a.item.id,a),this.instanceToItem.set(a.instance,a),a.height=vt(a),r+=a.height+n.gap}this.scrollHeight=r-n.gap,this.scrollDirty=!0,t&&(this.canSkipRenderForAppend(i)?this.syncContainerHeight():this.render())}canSkipRenderForAppend(e){return this.container!=null&&this.renderState.firstIndex!==-1&&this.pendingScrollTarget==null&&this.scrollAnimation==null&&this.layoutDirtyIndex==null&&e>this.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(e){if(e==null)return;this.capturePendingLayoutAnchor();let{options:t}=this,n=this.getLayout(),{itemMetricsCache:r}=this;yt(t,e)&&this.invalidateElementPool(),this.options=e;let i=this.computeMetricsCache(e.itemMetrics),a=!W(r,i),o=!W(n,this.getLayout());o&&this.syncLayout();let s=a||bt(t,e);if(s){let n=this.pendingLayoutReset;this.pendingLayoutReset={metrics:a?i:n?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:n?.includeEstimatedDiffHeights===!0||a||xt(t,e)}}(o||s)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),Ee(t,e)||this.renderOptionsRevision++,!this.isContainerManaged&&this.items.length>0&&this.render()}capturePendingLayoutAnchor(){this.root==null||this.items.length===0||this.pendingScrollTarget!=null||(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop()))}render(t=!1){e.__STOP||(t?(Je(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):We(this.computeRenderRangeAndEmit))}instanceChanged(e,t){let n=this.instanceToItem.get(e);if(n==null)throw Error(`CodeView.instanceChanged: An instance has changed that is not registered`);t&&this.markItemLayoutDirty(n),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getRenderedItems(){let{firstIndex:e,lastIndex:t}=this.renderState;if(e===-1||t===-1||t<e)return[];let n=[];for(let r=e;r<=t;r++){let e=this.items[r];e?.element!=null&&(e.type===`diff`?n.push({id:e.item.id,type:`diff`,item:e.item,version:e.version,element:e.element,instance:e.instance}):n.push({id:e.item.id,type:`file`,item:e.item,version:e.version,element:e.element,instance:e.instance}))}return n}setSlotCoordinator(e){return e===this.slotCoordinator?!1:(this.slotCoordinator=e,this.slotSnapshot=void 0,!0)}getSlotSnapshot(e){return Ot(this.getRenderedItems(),e)}subscribeToScroll(e){return this.scrollListeners.add(e),()=>{this.scrollListeners.delete(e)}}getLocalTopForInstance(e){let t=this.instanceToItem.get(e);if(t==null)throw Error(`CodeView.getLocalTopForInstance: unknown virtualized instance`);return t.top}getTopForItem(e){let t=this.idToItem.get(e);if(t!=null)return t.top+this.getLayout().paddingTop}createItem(e,t,n){let{itemMetricsCache:r}=this;if(e.type===`diff`){let i=new Te(this.createDiffOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`diff`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}let i=new ce(this.createFileOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`file`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}applySelectedLines(e,t){let{selectedLines:n}=this;e==null&&n==null||e!=null&&n?.id===e.id&&H(n.range,e.range)||(n!=null&&n.id!==e?.id&&this.idToItem.get(n.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=e,this.idToItem.get(e?.id??``)?.instance.setSelectedLines(e?.range??null,t))}syncSelection(){if(this.selectedLines==null)return;let e=this.idToItem.get(this.selectedLines.id);if(e==null){this.selectedLines=null;return}e.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}renamePendingScrollTarget(e,t){let{pendingScrollTarget:n}=this;n==null||n.type===`position`||n.id!==e||(this.pendingScrollTarget={...n,id:t})}renamePendingLayoutAnchor(e,t){this.pendingLayoutAnchor?.id===e&&(this.pendingLayoutAnchor.id=t)}createFileOptionsPrototype(){let e={};for(let t of at)Y(e,t,()=>this.options[t]);Y(e,`stickyHeader`,()=>this.options.stickyHeaders),Y(e,`collapsed`,e=>this.getItemOptions(ut(e),`file`)?.item.collapsed===!0);for(let t of ot)this.defineItemSharedCallback(e,`file`,t);for(let t of st)this.defineItemSelectionCallback(e,`file`,t);return e}createDiffOptionsPrototype(){let e={};for(let t of it)Y(e,t,()=>this.options[t]);Y(e,`stickyHeader`,()=>this.options.stickyHeaders),Y(e,`hunkSeparators`,()=>this.options.hunkSeparators),Y(e,`collapsed`,e=>this.getItemOptions(ut(e),`diff`)?.item.collapsed===!0);for(let t of ot)this.defineItemSharedCallback(e,`diff`,t);for(let t of st)this.defineItemSelectionCallback(e,`diff`,t);return e}createFileOptions(e){let t=Object.create(this.fileOptionsPrototype);return lt(t,{id:e}),t}createDiffOptions(e){let t=Object.create(this.diffOptionsPrototype);return lt(t,{id:e}),t}updateItemOptionsId(e,t){ut(e).id=t}getItemOptions(e,t){let n=this.idToItem.get(e.id);if(!(n==null||n.type!==t))return n}defineItemSharedCallback(e,t,n){Y(e,n,e=>{if(this.options[n]==null)return;let r=ut(e),i=r.callbackCache??={},a=i[n];return a??(a=((...e)=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=this.options[n];return a?.(...e,i)}),i[n]=a),a})}defineItemSelectionCallback(e,t,n){Y(e,n,e=>{if(this.options.enableLineSelection!==!0)return;let r=ut(e),i=r.callbackCache??={},a=i[n];return a??(a=(e=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=e==null?null:{id:i.item.id,range:e};this.options.controlledSelection!==!0&&(e!=null||this.selectedLines?.id===i.item.id)&&this.applySelectedLines(a,{notify:!1}),this.options.onSelectedLinesChange?.(a);let o=this.options[n];return o?.(e,i)}),i[n]=a),a})}markLayoutDirtyFromIndex(e){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??e,e)}markItemLayoutDirty(e){if(this.items[e.index]!==e)throw Error(`CodeView.markItemLayoutDirty: unknown item id "${e.item.id}"`);this.markLayoutDirtyFromIndex(e.index)}tryAppendItems(e){if(e.length<=this.items.length)return!1;for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null||n.item.id!==r.id||n.type!==r.type)return!1}for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null)throw Error(`CodeView.tryAppendItems: append candidate missing prefix item`);this.syncItemRecord(n,r)&&this.markLayoutDirtyFromIndex(t)}return this.appendItemsInternal(e.slice(this.items.length),!1),this.scrollDirty=!0,this.render(),!0}reconcileItems(e){let{items:t,idToItem:n}=this,r=new Set(t),i=[],a=new Map,o=new Map,s;for(let c=0;c<e.length;c++){let l=e[c];if(l==null)throw Error(`CodeView.reconcileItems: missing input item`);if(a.has(l.id))throw Error(`CodeView.setItems: duplicate id "${l.id}"`);let u=n.get(l.id),d=u!=null&&u.type===l.type?u:this.createItem(l,c,0);d.index=c,u!=null&&u.type===l.type?(r.delete(u),this.syncItemRecord(d,l)&&(s=Math.min(s??c,c))):s=Math.min(s??c,c),t[c]!==d&&(s=Math.min(s??c,c)),i.push(d),a.set(l.id,d),o.set(d.instance,d)}for(let e=0;e<t.length;e++){let n=t[e];if(n==null||!r.has(n))continue;this.releaseRenderedItem(n);let a=Math.max(i.length-1,0);s=Math.min(s??a,a)}s!=null&&(this.items=i,this.idToItem=a,this.instanceToItem=o,this.renderState.firstIndex>=i.length?this.resetRenderState():this.renderState.lastIndex>=i.length&&(this.renderState.lastIndex=i.length-1),this.markLayoutDirtyFromIndex(s),this.scrollDirty=!0,this.render())}syncItemRecord(e,t){if(e.type!==t.type)throw Error(`CodeView.syncItemRecord: type mismatch for id "${t.id}"`);return e.version===t.version?!1:(e.item=t,e.version=t.version,e.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(e){let{paddingBottom:t,paddingTop:n}=this.getLayout();return Math.max(n+e+t-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>gt}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),pt):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(e){let t=this.getMaxPagedScrollTop();return Math.max(0,Math.min(e,t))}clampScrollTop(e){let t=this.getMaxScrollTop();return Math.max(0,Math.min(e,t))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(e){let t=this.getMaxScrollPageOffset();return Math.max(0,Math.min(e,t))}resolveScrollPageWindow(e,t){let n=J(this.clampPagedScrollTop(t)),r=this.clampScrollPageOffset(e-n);return n=J(this.clampPagedScrollTop(e-r)),r=this.clampScrollPageOffset(e-n),{pagedScrollTop:n,scrollPageOffset:r}}resolvePagedScrollPosition(e){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(e),scrollPageOffset:0};let t=this.clampScrollPageOffset(this.scrollPageOffset),n=e-t,r=this.getMaxPagedScrollTop(),i=this.getMaxScrollPageOffset(),a=n>gt&&t<i,o=n<mt&&t>0;return n<0||n>r||a||o?this.resolveScrollPageWindow(e,o?Math.min(X,r):ht):{pagedScrollTop:J(this.clampPagedScrollTop(n)),scrollPageOffset:t}}needsScrollPageUpdate(e){let t=J(this.clampScrollTop(e)),{scrollPageOffset:n}=this.resolvePagedScrollPosition(t);return n!==this.scrollPageOffset}getPagedLayoutTop(e){return this.shouldRebaseScroll()?Math.max(e-this.scrollPageOffset,0):e}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(e){let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return{top:t.top,height:t.height};if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Ct(e.range)} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}normalizeScrollTarget(e){if(e.type===`position`||e.align!==`nearest`)return e;let t=this.getScrollTargetRect(e);if(t==null)return;let n=e.offset??0,r=this.getLayout().paddingTop+t.top,i=r+t.height,a=this.getScrollTop(),o=a+(e.type===`line`||e.type===`range`?this.getStickyHeaderOffset():0),s=a+this.getHeight();if(!(r-n<=o&&i+n>=s)){if(r-n<o)return{...e,align:`start`};if(i+n>s)return{...e,align:`end`}}}resolveScrollTargetTop(e){if(e.type===`position`){let t=this.clampScrollTop(e.position);return t===e.position?this.clampScrollTop(e.position-this.getStickyHeaderOffset()):t}let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top,t.height,e.align,e.offset));if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Ct(e.range)} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(e,t,n,r=0,i=0){e+=this.getLayout().paddingTop;let a=this.getHeight();return n===`center`&&t+r<a?e-(a-t)/2+r:n===`end`?e-(a-t)+r:e-i-r}getLineScrollPosition(e,t){return e.type===`diff`?e.instance.getLinePosition(t.lineNumber,t.side):e.instance.getLinePosition(t.lineNumber)}getRangeScrollPosition(e,t){let{range:n}=t,r=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.start,side:n.side}),i=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.end,side:n.endSide??n.side});if(r==null||i==null)return;let a=r.top,o=a+r.height,s=i.top,c=s+i.height,l=Math.min(a,s);return{top:l,height:Math.max(o,c)-l}}computeTargetScrollTopForFrame(e,t){if(this.pendingScrollTarget==null)return e;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null)return e;let{scrollAnimation:r}=this;return r==null?n:this.computeSpringStep(r,n,t).position}computeSpringStep(e,t,n){let r=Math.max(0,n-e.lastTimestamp),{omega:i}=this.getSmoothScrollSettings(),a=Math.exp(-i*r),o=e.position-t,s=e.velocity+i*o;return{position:t+(o+s*r)*a,velocity:(s*(1-i*r)-i*o)*a}}advanceScrollAnimation(e,t){if(this.pendingScrollTarget==null)return;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null){this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;return}let r=this.scrollAnimation;if(r==null)return n;r.position+=t;let{position:i,velocity:a}=this.computeSpringStep(r,n,e);r.lastTimestamp=e,r.position=i,r.velocity=a;let{positionEpsilon:o,velocityEpsilon:s}=this.getSmoothScrollSettings();return Math.abs(n-i)<=o&&Math.abs(a)<=s?(r.position=n,r.velocity=0,this.scrollAnimation=void 0,n):r.position}computeRenderRangeAndEmit=(t=performance.now())=>{if(e.__STOP||this.container==null)return;let n=this.getHeight(),r=this.getScrollTop(),i=r,a=this.pendingLayoutAnchor!=null,o=this.getScrollAnchor(i);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,a=!0),a&&o!=null){let e=this.resolveAnchoredScrollTop(o);if(e!=null){let t=e-i;i=e,this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}}a&&(i=this.clampScrollTop(i),this.syncContainerHeight());let s=this.computeTargetScrollTopForFrame(i,t),c=!a&&(this.renderState.scrollTop===-1||Math.abs(s-this.renderState.scrollTop)>n+this.config.overscrollSize*2);c&&(o=void 0),this.windowSpecs=V({scrollTop:s,height:n,scrollHeight:this.getScrollHeight(),fitPerfectly:c,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let l=r;(this.pendingScrollTarget!=null&&s!==l||this.needsScrollPageUpdate(s))&&(this.applyScrollFix(s,l,this.windowSpecs),l=s);let{top:u,bottom:d}=this.windowSpecs,{firstIndex:f,lastIndex:p}=this.renderState;if(f>=0)for(let e=f;e<=p;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${e}`);t.top>u-t.height&&t.top<=d||this.releaseRenderedItem(t)}let m,h=new Set,g=this.findFirstVisibleIndex(u),_=this.findLastVisibleIndex(d);for(let e=g;e<=_;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: missing item`);let{instance:n}=t;t.element==null?(t.element=this.acquireElement(),Et(this.stickyContainer,t.element,m),n.virtualizedSetup(),Tt(t,t.element)&&(t.renderedOptionsRevision=this.renderOptionsRevision,h.add(t)),m=t.element):(Et(this.stickyContainer,t.element,m),Tt(t,void 0,t.renderedOptionsRevision!==this.renderOptionsRevision)&&(t.renderedOptionsRevision=this.renderOptionsRevision,h.add(t)),m=t.element)}this.renderState.firstIndex=g<=_?g:-1,this.renderState.lastIndex=_,this.flushSlotCoordinator(),this.reconcileRenderedItems(h),this.syncContainerHeight(),this.updateStickyPositioning();let v=o==null?void 0:this.resolveAnchoredScrollTop(o);o===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);let y=v==null?0:v-i,b=s,x=!1;if(this.pendingScrollTarget!=null){let e=this.advanceScrollAnimation(t,y);e==null?b=i:(b=e,x=!0)}else b=v??s;b!==l&&(this.applyScrollFix(b,l,this.windowSpecs),l=b),x&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=J(l),this.flushManagers(h),this.validateStickyContainerHeight(),this.fixContainerFocus(),(c||this.scrollAnimation!=null)&&this.render()};flushManagers(e){for(let t of e)t.instance.flushManagers()}syncContainerHeight(){let e=this.getPagedScrollHeight();this.container==null||this.containerHeight===e||(this.container.style.height=`${e}px`,this.containerHeight=e)}getStickyBounds(e){let{firstIndex:t,lastIndex:n}=e==null?this.renderState:{firstIndex:this.findFirstVisibleIndex(e.top),lastIndex:this.findLastVisibleIndex(e.bottom)};if(t===-1||n===-1||t>n)return;let r=this.items[t]?.instance.getAdvancedStickySpecs(e),i=this.items[n]?.instance.getAdvancedStickySpecs(e);if(!(r==null||i==null))return{stickyTop:this.getPagedLayoutTop(Math.max(r.topOffset,0)),stickyBottom:this.getPagedLayoutTop(i.topOffset+i.height)}}applyStickyPositioning({stickyTop:e,stickyBottom:t}){let n=this.getHeight(),{itemMetricsCache:r}=this,i=t-e;this.renderState.stickyHeight=i,this.renderState.stickyTop=e,this.renderState.stickyBottom=t,this.stickyOffset.style.height=`${e}px`;let a=(Math.random()*r.lineHeight>>0)*-1,o=-Math.max(i+a,0)+n;this.stickyContainer.style.top=`${o}px`,this.stickyContainer.style.bottom=`${o+r.diffHeaderHeight}px`}syncPagedScrollScaffolding(e){this.syncContainerHeight();let t=this.getStickyBounds(e);t!=null&&this.applyStickyPositioning(t)}reconcileRenderedItems(e){let{firstIndex:t,lastIndex:n}=this.renderState;if(t===-1)return;let r=-1,i=!1;for(let a=t;a<this.items.length&&!(!i&&a>n);a++){let t=this.items[a];if(t==null)throw Error(`CodeView.reconcileRenderedItems: Invalid item`);r===-1?r=t.top:t.top!==r&&(t.top=r,t.instance.syncVirtualizedTop(),i=!0),(e==null?a<=n:e.has(t))&&(t.instance.reconcileHeights()&&(i=!0,t.height=t.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(t)),r+=t.instance.getVirtualizedHeight(),a<this.items.length-1&&(r+=this.getLayout().gap)}i&&r!=null&&(this.scrollDirty=!0,this.scrollHeight=r)}updateStickyPositioning(){let e=this.getStickyBounds();if(e==null)return;let{stickyTop:t,stickyBottom:n}=e;n-t===this.renderState.stickyHeight&&t===this.renderState.stickyTop&&n===this.renderState.stickyBottom||this.applyStickyPositioning(e)}handleScroll=()=>{e.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=e=>{for(let t of e)if(t.target===this.stickyContainer){if(t.borderBoxSize[0].blockSize!==this.renderState.stickyHeight){let e=this.getScrollTop(),t=this.getScrollAnchor(e);this.reconcileRenderedItems(),this.updateStickyPositioning();let n=t==null?void 0:this.resolveAnchoredScrollTop(t);if(n!=null){let t=n-e;this.applyScrollFix(n,e,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0)}}else this.scrollDirty=!0,this.heightDirty=!0,this.render()};getScrollAnchorViewportTop(e,t){return e<t?t+this.getStickyHeaderOffset():t}getScrollAnchor(e){if(this.pendingLayoutAnchor!=null)return this.pendingLayoutAnchor;let{firstIndex:t,lastIndex:n,stickyTop:r,stickyBottom:i}=this.renderState;if(t===-1||n===-1)return;let a=this.getHeight();if(!(r===-1||i===-1))for(let r=t;r<=n;r++){let t=this.items[r];if(t==null)continue;let n=this.getLayout().paddingTop+t.top;if(n+t.height<=e)continue;if(n>=e+a)break;if(n>=e)return{type:`item`,id:t.item.id,viewportOffset:n-e};let i=this.getScrollAnchorViewportTop(n,e)-n,o=t.instance.getNumericScrollAnchor(i);if(o!=null){let r=n+o.top;return{type:`line`,id:t.item.id,lineNumber:o.lineNumber,side:o.side,viewportOffset:r-e}}}}resolveAnchoredScrollTop(e){let t=this.idToItem.get(e.id);if(t==null)return;let{paddingTop:n}=this.getLayout();if(e.type===`item`){let r=n+t.top;return this.clampScrollTop(r-e.viewportOffset)}let r=t.type===`diff`?t.instance.getLinePosition(e.lineNumber,e.side):t.instance.getLinePosition(e.lineNumber);if(r==null)return;let i=n+t.top+r.top;return this.clampScrollTop(i-e.viewportOffset)}applyScrollFix(e,t,n){if(this.root==null)return;let r=J(this.clampScrollTop(e)),i=J(t),{scrollPageOffset:a}=this,o=J(this.clampPagedScrollTop(i-a)),{pagedScrollTop:s,scrollPageOffset:c}=this.resolvePagedScrollPosition(r),l=s,u=a!==c;r===this.renderState.scrollTop&&r===i&&l===o&&!u||(this.suspendScrollInteractions(),(l!==o||u)&&(this.scrollPageOffset=c,this.syncPagedScrollScaffolding(n)),l!==o&&this.root.scrollTo({top:l,behavior:`instant`}),this.renderState.scrollTop=r,this.scrollTop=r,this.scrollDirty=!1)}isPendingTargetSettled(e){let t=this.resolveScrollTargetTop(e);return t==null?!0:J(this.getScrollTop())===J(t)}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root?.scrollTop??0;return this.scrollTop=this.clampScrollTop(e+this.scrollPageOffset),this.scrollTop}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root?.getBoundingClientRect().height??0,this.height):this.height}getScrollHeight(){return this.scrollHeight}flushSlotCoordinator(){if(this.slotCoordinator==null)return;let{onSnapshotChange:e}=this.slotCoordinator,t=Ot(this.getRenderedItems(),this.slotCoordinator);kt(this.slotSnapshot,t)||(this.slotSnapshot=t,e(t))}notifyScroll(){if(this.scrollListeners.size===0)return;let e=this.getScrollTop();for(let t of this.scrollListeners)t(e,this)}findFirstVisibleIndex(e){let t=0,n=this.items.length-1,r=this.items.length;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findFirstVisibleIndex: invalid item index`);a.top+a.height>e?(r=i,n=i-1):t=i+1}return r}findLastVisibleIndex(e){let t=0,n=this.items.length-1,r=-1;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findLastVisibleIndex: invalid item index`);a.top<=e?(r=i,t=i+1):n=i-1}return r}recomputeLayout(e=0,t){if(this.items.length===0){this.scrollHeight=0;return}let n=this.getLayout(),r=0;if(e>0){let t=this.items[e-1];if(t==null)throw Error(`CodeView.recomputeLayout: invalid dirty index`);r=t.top+t.height+n.gap}for(let i=e;i<this.items.length;i++){let e=this.items[i];if(e==null)throw Error(`CodeView.recomputeLayout: invalid item index`);e.top=r,e.type===`diff`?e.height=e.instance.prepareCodeViewItem(e.item.fileDiff,r,t,e.item.annotations??[]):e.height=e.instance.prepareCodeViewItem(e.item.file,r,t,e.item.annotations??[]),r+=e.height,i<this.items.length-1&&(r+=n.gap)}r!==this.scrollHeight&&(this.scrollDirty=!0),this.scrollHeight=r}resetRenderState(){this.renderState.scrollTop=-1,this.renderState.firstIndex=-1,this.renderState.lastIndex=-1,this.renderState.stickyHeight=0,this.renderState.stickyTop=-1,this.renderState.stickyBottom=-1}getFitPerfectlyOverscroll(){return this.getLayout().gap+this.itemMetricsCache.diffHeaderHeight}};function vt(e){return e.instance.cleanUp(!0),e.type===`diff`?e.instance.prepareCodeViewItem(e.item.fileDiff,e.top,void 0,e.item.annotations??[]):e.instance.prepareCodeViewItem(e.item.file,e.top,void 0,e.item.annotations??[])}function yt(e,t){return!L(e.theme??Ue,t.theme??Ue)||(e.themeType??`system`)!==(t.themeType??`system`)||e.unsafeCSS!==t.unsafeCSS}function bt(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS||(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function xt(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function St(e){return e instanceof SVGElement?!0:G(e)&&(e.hasAttribute(`data-core-css`)||e.hasAttribute(`data-theme-css`)||e.hasAttribute(`data-unsafe-css`))}function Ct(e){let t=wt(e.start,e.side),n=wt(e.end,e.endSide??e.side);return t===n?t:`${t}-${n}`}function wt(e,t){return t==null?`${e}`:`${t===`deletions`?`D`:`A`}${e}`}function Tt(e,t,n=!1){return e.type===`diff`?e.instance.render({deferManagers:!0,fileContainer:t,fileDiff:e.item.fileDiff,forceRender:n,lineAnnotations:e.item.annotations??[]}):e.instance.render({deferManagers:!0,fileContainer:t,file:e.item.file,forceRender:n,lineAnnotations:e.item.annotations??[]})}function Et(e,t,n){if(n==null){e.firstChild!==t&&e.prepend(t);return}n.nextSibling!==t&&n.after(t)}function Dt(e){return(e.annotations?.length??0)>0}function Ot(e,{hasHeaderRenderers:t,hasAnnotationRenderer:n,hasGutterRenderer:r}){if(e.length===0)return;if(t||r)return e;if(!n)return;let i=[];for(let t of e)Dt(t.item)&&i.push(t);return i.length>0?i:void 0}function kt(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r==null||i==null||r.id!==i.id||r.type!==i.type||r.element!==i.element||r.version!==i.version)return!1}return!0}function At(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r==null||i==null||r.id!==i.id||r.type!==i.type||r.element!==i.element||r.version!==i.version)return!1}return!0}var Q=r(P(),1),$=N(),jt=r(p(),1),Mt=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function Nt(e){return{instance:void 0,items:void 0,controlled:e,managedOptions:void 0,disableFlushSync:!1,slotCoordinator:void 0}}function Pt(e,t){let{className:n,containerRef:r,disableWorkerPool:i=!1,initialItems:a,items:o,onScroll:s,onSelectedLinesChange:c,options:l,renderAnnotation:u,renderCustomHeader:d,renderGutterUtility:f,renderHeaderMetadata:p,renderHeaderPrefix:m,selectedLines:h,style:g}=e,_=o!==void 0,v=(0,Q.useContext)(de),y=(0,Q.useRef)(Nt(_)),b=d!=null,x=u!=null,S=f!=null,C=b||m!=null||p!=null,w=C||x||S,T=K(e=>{c?.(e)}),E=h!==void 0,D=(0,Q.useMemo)(()=>Bt({options:l,hasCustomHeader:b,hasGutterRenderer:S,onSelectedLinesChange:c==null?void 0:T,controlledSelection:E}),[l,b,S,c,T,E]),[O]=(0,Q.useState)(()=>zt()),[,k]=(0,Q.useState)({}),A=K(e=>{y.current.instance!=null&&(e==null||e!==y.current.instance.getContainerElement())&&(y.current.instance.cleanUp(),O.publish(void 0),y.current=Nt(_)),e!=null&&e!==y.current.instance?.getContainerElement()&&(y.current.instance=new _t(D,i?void 0:v,!0),y.current.instance.setup(e)),typeof r==`function`?r(e):r!=null&&(r.current=e)}),j=K(e=>{y.current.disableFlushSync?O.publish(e):(0,jt.flushSync)(()=>{O.publish(e)})}),M=(0,Q.useMemo)(()=>{if(!(!C&&!x&&!S))return{hasHeaderRenderers:C,hasAnnotationRenderer:x,hasGutterRenderer:S,onSnapshotChange:j}},[j,x,S,C]);return Mt(()=>s==null?void 0:y.current.instance?.subscribeToScroll(s)),Mt(()=>{let{instance:e,controlled:t,items:n,managedOptions:r,slotCoordinator:i}=y.current;if(e!=null)try{y.current.disableFlushSync=!0;let s=!1;if(Ee(D,r)||(y.current.managedOptions=D,e.setOptions(D),s=!0),t!==_){console.error(`CodeView: cannot switch between controlled and uncontrolled modes. Remount with a new key instead.`);return}if(_)o!==n&&(Lt(n,o)?y.current.items=o:It(n,o)?(y.current.items=o,e.addItems(o.slice(n.length))):(y.current.items=o,e.setItems(o),s=!0));else if(n==null){let t=a??[];y.current.items=t,t.length>0&&(e.setItems(t),s=!0)}h!==void 0&&e.setSelectedLines(h,{notify:!1});let c=e.setSlotCoordinator(M),l=!1;M!==i&&((M==null||i==null)&&(l=!0),y.current.slotCoordinator=M),(s||c)&&e.render(!0),c&&M==null&&O.publish(void 0),l&&k({})}finally{y.current.disableFlushSync=!1}}),(0,Q.useImperativeHandle)(t,()=>({addItems(e){let{controlled:t,instance:n}=y.current;Rt(t,`addItems`),n==null?console.error(`CodeView.addItems: no valid instance to append items with`,e):n.addItems(e)},getItem(e){let{instance:t}=y.current;if(t==null){console.error(`CodeView.getItem: no valid instance exists`,e);return}else return t.getItem(e)},updateItem(e){let{controlled:t,instance:n}=y.current;return Rt(t,`updateItem`),n==null?(console.error(`CodeView.updateItem: no valid instance to update item with`,e),!1):n.updateItem(e)},updateItemId(e,t){let{controlled:n,instance:r}=y.current;return Rt(n,`updateItemId`),r==null?(console.error(`CodeView.updateItemId: no valid instance to update item id with`,e,t),!1):r.updateItemId(e,t)},scrollTo(e){let{instance:t}=y.current;t==null?console.error(`CodeView.scrollTo: no valid instance to scroll with`,e):t.scrollTo(e)},setSelectedLines(e){let{instance:t}=y.current;t==null?console.error(`CodeView.setSelectedLines: no valid instance to update selection with`,e):(t.setSelectedLines(e,{notify:!1}),T(e))},getSelectedLines(){let{instance:e}=y.current;return e==null?(console.error(`CodeView.getSelectedLines: no valid instance exists`),null):e.getSelectedLines()},clearSelectedLines(){let{instance:e}=y.current;e==null?console.error(`CodeView.clearSelectedLines: no valid instance to update selection with`):(e.clearSelectedLines({notify:!1}),T(null))},getInstance(){return y.current.instance}}),[T]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{ref:A,className:n,style:g}),w&&(0,$.jsx)(Vt,{managedContentStore:O,renderCustomHeader:d,renderHeaderPrefix:m,renderHeaderMetadata:p,renderAnnotation:u,renderGutterUtility:f})]})}var Ft=(0,Q.forwardRef)(Pt);function It(e,t){if(e==null||t.length<=e.length)return!1;if(e.length===0)return!0;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}function Lt(e,t){if(e==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Rt(e,t){if(e)throw Error(`CodeView.${t} cannot be used when CodeView is controlled. Use initialItems for imperative item updates.`)}function zt(){let e,t=new Set;return{getSnapshot(){return e},publish(n){if(!At(e,n)){e=n;for(let e of t)e()}},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function Bt({options:e,hasCustomHeader:t,hasGutterRenderer:n,onSelectedLinesChange:r,controlledSelection:i}){return!t&&!n&&r==null&&!i?e:(e={...e,controlledSelection:i,onSelectedLinesChange:r},t&&(e.renderCustomHeader=Ut),n&&(e.renderGutterUtility=Ut),e)}var Vt=(0,Q.memo)(function({managedContentStore:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderMetadata:r,renderAnnotation:i,renderGutterUtility:a}){let o=K(t=>e.subscribe(t)),s=K(()=>e.getSnapshot());return(0,Q.useSyncExternalStore)(o,s,s)?.map(e=>(0,jt.createPortal)(Ht({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderMetadata:r,renderAnnotation:i,renderGutterUtility:a}),e.element,e.id))});function Ht({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderMetadata:r,renderAnnotation:i,renderGutterUtility:a}){if(e.type===`diff`){let{item:o,instance:s}=e;return z({fileDiff:o.fileDiff,renderCustomHeader:t==null?void 0:()=>t(o),renderHeaderPrefix:n==null?void 0:()=>n(o),renderHeaderMetadata:r==null?void 0:()=>r(o),renderAnnotation:i==null?void 0:e=>i(e,o),lineAnnotations:o.annotations,renderGutterUtility:a==null?void 0:e=>a(e,o),getHoveredLine:s.getHoveredLine})}else{let{item:o,instance:s}=e;return se({file:o.file,renderCustomHeader:t==null?void 0:()=>t(o),renderHeaderPrefix:n==null?void 0:()=>n(o),renderHeaderMetadata:r==null?void 0:()=>r(o),renderAnnotation:i==null?void 0:e=>i(e,o),lineAnnotations:o.annotations,renderGutterUtility:a==null?void 0:e=>a(e,o),getHoveredLine:s.getHoveredLine})}}function Ut(){}function Wt({threadRef:e,filePath:t,activeCwd:n,openInEditor:r}){if(e){ne.getState().openFile(e,t);return}r(n?B(t,n):t)}var Gt=d();function Kt(e,t){let n=(0,Gt.c)(4),r=Ye(e,t),i;return n[0]!==r.data||n[1]!==r.error||n[2]!==r.isPending?(i={data:r.data,error:r.error,isPending:r.isPending},n[0]=r.data,n[1]=r.error,n[2]=r.isPending,n[3]=i):i=n[3],i}function qt(e,t){return e.length>0&&e.every(e=>t.has(e))}function Jt(e,t){return qt(e,t)?new Set:new Set(e)}function Yt(e){return a(`flex items-center justify-between gap-2 px-4`,et&&e!==`sheet`&&e!==`embedded`?`drag-region h-[52px] border-b border-border wco:h-[env(titlebar-area-height)] wco:pr-[calc(100vw-env(titlebar-area-width)-env(titlebar-area-x)+1em)]`:`surface-subheader`)}function Xt(e){let t=(0,Gt.c)(10),n=et&&e.mode!==`sheet`&&e.mode!==`embedded`,r=e.mode===`inline`?`w-[42vw] min-w-[360px] max-w-[560px] shrink-0 border-l border-border`:`w-full`,i;t[0]===r?i=t[1]:(i=a(`flex h-full min-w-0 flex-col bg-background`,r),t[0]=r,t[1]=i);let o;t[2]!==e.header||t[3]!==e.mode||t[4]!==n?(o=n?(0,$.jsx)(`div`,{className:Yt(e.mode),children:e.header}):(0,$.jsx)(`div`,{className:Yt(e.mode),"data-surface-subheader":!0,children:e.header}),t[2]=e.header,t[3]=e.mode,t[4]=n,t[5]=o):o=t[5];let s;return t[6]!==e.children||t[7]!==i||t[8]!==o?(s=(0,$.jsxs)(`div`,{className:i,children:[o,e.children]}),t[6]=e.children,t[7]=i,t[8]=o,t[9]=s):s=t[9],s}function Zt(e){let t=(0,Gt.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,$.jsx)(R,{className:`h-4 w-32 rounded-full`}),(0,$.jsx)(R,{className:`ml-auto h-4 w-20 rounded-full`})]}),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(R,{className:`h-3 w-full rounded-full`}),(0,$.jsx)(R,{className:`h-3 w-full rounded-full`}),(0,$.jsx)(R,{className:`h-3 w-10/12 rounded-full`}),(0,$.jsx)(R,{className:`h-3 w-11/12 rounded-full`}),(0,$.jsx)(R,{className:`h-3 w-9/12 rounded-full`})]}),t[1]=r):r=t[1];let i;t[2]===e.label?i=t[3]:(i=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 px-3 py-4`,children:[r,(0,$.jsx)(`span`,{className:`sr-only`,children:e.label})]}),t[2]=e.label,t[3]=i);let a;return t[4]!==e.label||t[5]!==i?(a=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col p-2`,children:(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-md border border-border/60 bg-card/25`,role:`status`,"aria-live":`polite`,"aria-label":e.label,children:[n,i]})}),t[4]=e.label,t[5]=i,t[6]=a):a=t[6],a}var Qt=[];function $t(e){return(e.endSide??e.side)===`deletions`?`deletions`:`additions`}function en(e,t,n){let r=$t(t),i=e.findIndex(e=>e.side===r&&e.lineNumber===t.end);return i<0?[...e,{side:r,lineNumber:t.end,metadata:{entries:[n]}}]:e.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,n]}}:e)}function tn(e){let n=(0,Gt.c)(50),{files:r,sectionId:i,sectionTitle:a,composerDraftTarget:o,options:s,viewerRef:c,className:l,renderHeaderPrefix:u}=e,d=b(sn),f=b(on),p;n[0]===o?p=n[1]:(p=e=>e.getComposerDraft(o)?.reviewComments??Qt,n[0]=o,n[1]=p);let m=b(p),[h,g]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(null),y;n[2]===r?y=n[3]:(y=new Map(r.map(an)),n[2]=r,n[3]=y);let x=y,S;if(n[4]!==_||n[5]!==r||n[6]!==m||n[7]!==i){let e;n[9]!==_||n[10]!==m||n[11]!==i?(e=e=>{let{fileDiff:t,filePath:n,fileKey:r,collapsed:a}=e,o=m.filter(e=>e.sectionId===i&&e.filePath===n&&(e.fenceLanguage??`diff`)===`diff`).reduce((e,n)=>{let r=T(t,n);return r?en(e,r,{id:n.id,kind:`comment`,range:r,rangeLabel:n.rangeLabel,text:n.text}):e},[]),s=_?.fileKey===r?[...o,_.annotation]:o;return{id:r,type:`diff`,fileDiff:t,annotations:s,collapsed:a,version:ye(`${a?`1`:`0`}:${s.flatMap(nn).join(`:`)}`)}},n[9]=_,n[10]=m,n[11]=i,n[12]=e):e=n[12],S=r.map(e),n[4]=_,n[5]=r,n[6]=m,n[7]=i,n[8]=S}else S=n[8];let C=S,w;n[13]!==o||n[14]!==_?.annotation||n[15]!==f?(w=e=>{g(null),_?.annotation.metadata.entries.some(t=>t.id===e)?v(null):f(o,e)},n[13]=o,n[14]=_?.annotation,n[15]=f,n[16]=w):w=n[16];let E=w,D;n[17]!==d||n[18]!==o||n[19]!==_||n[20]!==x||n[21]!==i||n[22]!==a?(D=(e,n)=>{let r=_?.annotation.metadata.entries.find(t=>t.id===e),s=_?x.get(_.fileKey):void 0;if(!r||!s)return;let c=t({id:r.id,sectionId:i,sectionTitle:a,filePath:s.filePath,fileDiff:s.fileDiff,range:r.range,text:n});c&&d(o,c),g(null),v(null)},n[17]=d,n[18]=o,n[19]=_,n[20]=x,n[21]=i,n[22]=a,n[23]=D):D=n[23];let O=D,k;n[24]!==x||n[25]!==i||n[26]!==a?(k=(e,n)=>{if(!e)return;let r=n.item;if(r.type!==`diff`)return;let o=x.get(r.id);if(!o)return;let s=I(),c=t({id:s,sectionId:i,sectionTitle:a,filePath:o.filePath,fileDiff:o.fileDiff,range:e,text:``});c&&v({fileKey:r.id,annotation:{side:$t(e),lineNumber:e.end,metadata:{entries:[{id:s,kind:`draft`,range:e,rangeLabel:c.rangeLabel,text:``}]}}})},n[24]=x,n[25]=i,n[26]=a,n[27]=k):k=n[27];let A=k,j=_!==null,M;n[28]===c?M=n[29]:(M=c?{ref:c}:{},n[28]=c,n[29]=M);let ee;n[30]===l?ee=n[31]:(ee=l?{className:l}:{},n[30]=l,n[31]=ee);let te=!j,ne=!j,N;n[32]!==A||n[33]!==s||n[34]!==ne||n[35]!==te?(N={...s,enableGutterUtility:te,enableLineSelection:ne,onLineSelectionEnd:A},n[32]=A,n[33]=s,n[34]=ne,n[35]=te,n[36]=N):N=n[36];let P;n[37]===u?P=n[38]:(P=e=>e.type===`diff`?u(e.fileDiff,e.id,e.collapsed===!0):null,n[37]=u,n[38]=P);let re;n[39]!==E||n[40]!==O?(re=e=>(0,$.jsx)(`div`,{className:`py-1`,children:e.metadata.entries.map(e=>(0,$.jsx)(oe,{kind:e.kind,rangeLabel:e.rangeLabel,text:e.text,onCancel:()=>E(e.id),onComment:t=>O(e.id,t),onDelete:()=>E(e.id)},e.id))}),n[39]=E,n[40]=O,n[41]=re):re=n[41];let ie;return n[42]!==C||n[43]!==h||n[44]!==N||n[45]!==P||n[46]!==re||n[47]!==M||n[48]!==ee?(ie=(0,$.jsx)(Ft,{...M,...ee,items:C,selectedLines:h,onSelectedLinesChange:g,options:N,renderHeaderPrefix:P,renderAnnotation:re}),n[42]=C,n[43]=h,n[44]=N,n[45]=P,n[46]=re,n[47]=M,n[48]=ee,n[49]=ie):ie=n[49],ie}function nn(e){return e.metadata.entries.map(rn)}function rn(e){return`${e.id}:${e.rangeLabel}:${e.text}`}function an(e){return[e.fileKey,e]}function on(e){return e.removeReviewComment}function sn(e){return e.addReviewComment}var cn=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e.multiple=`data-multiple`,e}({}),ln={multiple(e){return e?{[cn.multiple]:``}:null}},un=Q.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:o=`horizontal`,multiple:s=!1,value:c,className:u,render:d,style:f,...p}=e,m=F(!0),h=Q.useMemo(()=>c!==void 0||n!==void 0,[c,n]),_=(m?.disabled??!1)||r,[v,y]=M({controlled:c,default:c===void 0?n??l:void 0,name:`ToggleGroup`,state:`value`}),b=O((e,t,n)=>{let r;s?(r=v.slice(),t?r.push(e):r.splice(v.indexOf(e),1)):r=t?[e]:[],a?.(r,n),!n.isCanceled&&y(r)}),x={disabled:_,multiple:s,orientation:o},S=Q.useMemo(()=>({disabled:_,orientation:o,setGroupValue:b,value:v,isValueInitialized:h}),[_,o,b,v,h]),C={role:`group`},w=g(`div`,e,{enabled:!!m,state:x,ref:t,props:[C,p],stateAttributesMapping:ln});return(0,$.jsx)(le.Provider,{value:S,children:m?w:(0,$.jsx)(Ce,{render:d,className:u,style:f,state:x,refs:[t],props:[C,p],stateAttributesMapping:ln,loopFocus:i,enableHomeAndEndKeys:!0,orientation:o})})}),dn=Q.createContext({size:`default`,variant:`default`});function fn(e){let t=(0,Gt.c)(24),n,r,i,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],c=t[6]):({className:r,variant:o,size:s,orientation:c,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=c);let l=o===void 0?`default`:o,u=s===void 0?`default`:s,d=c===void 0?`horizontal`:c,f;t[7]!==u||t[8]!==l?(f={size:u,variant:l},t[7]=u,t[8]=l,t[9]=f):f=t[9];let p=f,m=d===`horizontal`?`*:pointer-coarse:after:min-w-auto`:`*:pointer-coarse:after:min-h-auto`,h=l==="default"?`gap-0.5`:d===`horizontal`?`*:not-first:not-data-[slot=separator]:before:-start-[0.5px] *:not-last:not-data-[slot=separator]:before:-end-[0.5px] *:not-first:rounded-s-none *:not-last:rounded-e-none *:not-first:border-s-0 *:not-last:border-e-0 *:not-first:before:rounded-s-none *:not-last:before:rounded-e-none`:`*:not-first:not-data-[slot=separator]:before:-top-[0.5px] *:not-last:not-data-[slot=separator]:before:-bottom-[0.5px] flex-col *:not-first:rounded-t-none *:not-last:rounded-b-none *:not-first:border-t-0 *:not-last:border-b-0 *:not-first:before:rounded-t-none *:not-last:before:rounded-b-none *:data-[slot=toggle]:not-last:before:hidden dark:*:last:before:hidden dark:*:first:before:block`,g;t[10]!==r||t[11]!==m||t[12]!==h?(g=a(`flex w-fit *:focus-visible:z-10 dark:*:[[data-slot=separator]:has(+[data-slot=toggle]:hover)]:before:bg-input/64 dark:*:[[data-slot=separator]:has(+[data-slot=toggle][data-pressed])]:before:bg-input dark:*:[[data-slot=toggle]:hover+[data-slot=separator]]:before:bg-input/64 dark:*:[[data-slot=toggle][data-pressed]+[data-slot=separator]]:before:bg-input`,m,h,r),t[10]=r,t[11]=m,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==n||t[15]!==p?(_=(0,$.jsx)(dn,{value:p,children:n}),t[14]=n,t[15]=p,t[16]=_):_=t[16];let v;return t[17]!==d||t[18]!==i||t[19]!==u||t[20]!==g||t[21]!==_||t[22]!==l?(v=(0,$.jsx)(un,{className:g,"data-size":u,"data-slot":`toggle-group`,"data-variant":l,orientation:d,...i,children:_}),t[17]=d,t[18]=i,t[19]=u,t[20]=g,t[21]=_,t[22]=l,t[23]=v):v=t[23],v}function pn(e){let t=(0,Gt.c)(12),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,variant:o,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=Q.use(dn),c=o??s.variant,l=a??s.size,u;return t[6]!==n||t[7]!==r||t[8]!==i||t[9]!==l||t[10]!==c?(u=(0,$.jsx)(Qe,{className:r,"data-size":l,"data-variant":c,size:l,variant:c,...i,children:n}),t[6]=n,t[7]=r,t[8]=i,t[9]=l,t[10]=c,t[11]=u):u=t[11],u}function mn(e){return{diffPreview:D(e,{label:`environment-data:review:diff-preview`,tag:j.reviewGetDiffPreview,staleTimeMs:5e3})}}var hn=mn(h);function gn(e){return e.remoteName&&e.name.startsWith(`${e.remoteName}/`)?e.name.slice(e.remoteName.length+1):e.name}function _n(e,t){let n=new Set(t),r=e.map(e=>{let r=t.filter(t=>n.has(t)&&gn(t)===e.name),i=r.find(e=>e.remoteName===`origin`)??r[0]??null;return i&&n.delete(i),{id:`local:${e.name}`,label:e.name,local:e,remote:i}}),i=t.filter(e=>n.has(e)).map(e=>({id:`remote:${e.name}`,label:e.name,local:null,remote:e}));return[...r,...i]}function vn(e,t){let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.local?.name.toLocaleLowerCase().includes(n)===!0||e.remote?.name.toLocaleLowerCase().includes(n)===!0)}var yn=`__automatic_base_ref__`,bn=new Set,xn=`
2
- [data-diffs-header],
3
- [data-diff],
4
- [data-file],
5
- [data-error-wrapper],
6
- [data-virtualizer-buffer] {
7
- --diffs-header-font-family: var(--font-sans) !important;
8
- --diffs-font-family: var(--font-mono) !important;
9
- --diffs-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
10
- --diffs-light-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
11
- --diffs-dark-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
12
- --diffs-token-light-bg: transparent;
13
- --diffs-token-dark-bg: transparent;
14
-
15
- --diffs-bg-context-override: color-mix(in srgb, var(--background) 97%, var(--foreground));
16
- --diffs-bg-hover-override: color-mix(in srgb, var(--background) 94%, var(--foreground));
17
- --diffs-bg-separator-override: color-mix(in srgb, var(--background) 95%, var(--foreground));
18
- --diffs-bg-buffer-override: color-mix(in srgb, var(--background) 90%, var(--foreground));
19
-
20
- --diffs-bg-addition-override: color-mix(in srgb, var(--background) 92%, var(--success));
21
- --diffs-bg-addition-number-override: color-mix(in srgb, var(--background) 88%, var(--success));
22
- --diffs-bg-addition-hover-override: color-mix(in srgb, var(--background) 85%, var(--success));
23
- --diffs-bg-addition-emphasis-override: color-mix(in srgb, var(--background) 80%, var(--success));
24
-
25
- --diffs-bg-deletion-override: color-mix(in srgb, var(--background) 92%, var(--destructive));
26
- --diffs-bg-deletion-number-override: color-mix(in srgb, var(--background) 88%, var(--destructive));
27
- --diffs-bg-deletion-hover-override: color-mix(in srgb, var(--background) 85%, var(--destructive));
28
- --diffs-bg-deletion-emphasis-override: color-mix(
29
- in srgb,
30
- var(--background) 80%,
31
- var(--destructive)
32
- );
33
-
34
- background-color: var(--diffs-bg) !important;
35
- }
36
-
37
- [data-file-info] {
38
- background-color: color-mix(in srgb, var(--card) 94%, var(--foreground)) !important;
39
- border-block-color: var(--border) !important;
40
- color: var(--foreground) !important;
41
- }
42
-
43
- [data-diffs-header] {
44
- position: sticky !important;
45
- top: 0;
46
- z-index: 4;
47
- background-color: color-mix(in srgb, var(--card) 94%, var(--foreground)) !important;
48
- border-bottom: 1px solid var(--border) !important;
49
- align-items: center !important;
50
- font-family: var(--font-sans) !important;
51
- font-size: 12px !important;
52
- line-height: 1 !important;
53
- min-height: 32px !important;
54
- padding-block: 6px !important;
55
- }
56
-
57
- [data-diffs-header] [data-header-content] {
58
- align-items: center !important;
59
- line-height: 1 !important;
60
- }
61
-
62
- [data-diffs-header] [data-metadata] {
63
- align-items: center !important;
64
- line-height: 1 !important;
65
- font-variant-numeric: tabular-nums;
66
- }
67
-
68
- [data-diffs-header] [data-additions-count],
69
- [data-diffs-header] [data-deletions-count] {
70
- font-family: var(--font-mono) !important;
71
- font-size: 11px !important;
72
- font-variant-numeric: tabular-nums;
73
- line-height: 1 !important;
74
- }
75
-
76
- [data-diffs-header] [data-change-icon],
77
- [data-diffs-header] [data-rename-icon] {
78
- display: block;
79
- flex-shrink: 0;
80
- }
81
-
82
- [data-title] {
83
- cursor: pointer;
84
- transition:
85
- color 120ms ease,
86
- text-decoration-color 120ms ease;
87
- text-decoration: underline;
88
- text-decoration-color: transparent;
89
- text-underline-offset: 2px;
90
- font-family: var(--font-sans) !important;
91
- }
92
-
93
- [data-title]:hover {
94
- color: color-mix(in srgb, var(--foreground) 84%, var(--primary)) !important;
95
- text-decoration-color: currentColor;
96
- }
97
- `;function Sn({mode:t=`inline`,composerDraftTarget:r,initialGitScope:l}){let{resolvedTheme:d}=me(),p=Ze(),[h]=(0,Q.useState)(l),[g,b]=(0,Q.useState)(`stacked`),[T,D]=(0,Q.useState)(p.wordWrap),[O,A]=(0,Q.useState)(p.diffIgnoreWhitespace),[j,M]=(0,Q.useState)(``),[ne,N]=(0,Q.useState)(()=>({scopeKey:null,fileKeys:bn})),P=(0,Q.useRef)(null),F=e({strict:!1,select:e=>C(e)}),oe=F?.threadId??null,I=Le(F),se=I?.projectId??null,ce=Be(I&&se?{environmentId:I.environmentId,projectId:se}:null),L=I?.worktreePath??ce?.workspaceRoot,le=re(ie.configValueAtom(I?.environmentId??null)),de=Ae(I?.environmentId??null,le?.availableEditors??[]),ye=m(I!=null&&L!=null?He.status({environmentId:I.environmentId,input:{cwd:L}}):null),R=De(e=>be(e.byThreadKey,F,h===`unstaged`)),Ce=ye.data?.isRepo??!0,{turnDiffSummaries:Te,inferredCheckpointTurnCountByTurnId:Ee}=he(I),z=(0,Q.useMemo)(()=>[...Te].toSorted((e,t)=>{let n=e.checkpointTurnCount??Ee[e.turnId]??0,r=t.checkpointTurnCount??Ee[t.turnId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n}),[Ee,Te]);(0,Q.useEffect)(()=>{!F||R.kind!==`turn`||De.getState().reconcileTurnSelection(F,z.map(e=>e.turnId))},[R,z,F]);let B=R.kind===`turn`?R.turnId:null,V=R.kind===`unstaged`?`unstaged`:`branch`,H=R.kind===`branch`?R.baseRef:null,Ie=R.kind===`turn`?R.filePath:null,Re=R.kind===`turn`?R.revealRequestId:0,U=B===null?void 0:z.find(e=>e.turnId===B)??z[0],W=U&&(U.checkpointTurnCount??Ee[U.turnId]),ze=z[0],Ue=B===null?V===`unstaged`?`Working tree`:`Branch changes`:U?.turnId===ze?.turnId?`Latest turn`:`Turn ${W??`?`}`,We=U?`turn:${U.turnId}`:V,G=F?`${F.environmentId}:${F.threadId}:${We}`:null,Ge=ne.scopeKey===G?ne.fileKeys:bn,Ke=U?`Turn ${W??`?`}`:V===`unstaged`?`Working tree`:`Branch changes`,Je=(0,Q.useMemo)(()=>typeof W==`number`?{fromTurnCount:Math.max(0,W-1),toTurnCount:W}:null,[W]),K=Kt({environmentId:I?.environmentId??null,threadId:oe,fromTurnCount:Je?.fromTurnCount??null,toTurnCount:Je?.toTurnCount??null,ignoreWhitespace:O,cacheScope:U?`turn:${U.turnId}`:null},{enabled:Ce&&U!==void 0}),Ye=m(B===null&&I&&L?hn.diffPreview({environmentId:I.environmentId,input:{cwd:L,...H?{baseRef:H}:{},ignoreWhitespace:O}}):null),Qe=B===null&&Ye.error?.includes(`configured workspace root`)===!0&&le?.cwd!==void 0&&le.cwd!==L,et=m(Qe&&I&&le?hn.diffPreview({environmentId:I.environmentId,input:{cwd:le.cwd,...H?{baseRef:H}:{},ignoreWhitespace:O}}):null),q=Qe?et:Ye,J=q.data?.sources.find(e=>e.kind===(V===`unstaged`?`working-tree`:`branch-range`)),it=m(B===null&&V===`branch`&&I&&q.data?.cwd?He.listRefs({environmentId:I.environmentId,input:{cwd:q.data.cwd,includeMatchingRemoteRefs:!0,refKind:`local`,...j.trim().length>0?{query:j.trim()}:{},limit:100}}):null),at=m(B===null&&V===`branch`&&I&&q.data?.cwd?He.listRefs({environmentId:I.environmentId,input:{cwd:q.data.cwd,includeMatchingRemoteRefs:!0,refKind:`remote`,...j.trim().length>0?{query:j.trim()}:{},limit:100}}):null),ot=_n(it.data?.refs.filter(e=>e.name!==J?.headRef)??[],at.data?.refs??[]),st=vn(ot,j),ct=e=>H&&H===e.remote?.name?H:e.local?.name??e.remote?.name??e.id,lt=[yn,...ot.map(ct)],ut=[...j.trim().length===0?[yn]:[],...st.map(ct)],Y=J?.diff,dt=U?K.data?.diff:Y,ft=!U&&J?.truncated===!0,pt=U?K.isPending:q.isPending,mt=U?K.error:q.error,ht=typeof dt==`string`&&dt.trim().length===0,X=(0,Q.useMemo)(()=>Ne(dt,`diff-panel:${d}`,{compactPartialHunkOffsets:B===null}),[d,dt,B]),gt=(0,Q.useMemo)(()=>!X||X.kind!==`files`?[]:X.files.toSorted((e,t)=>Fe(e).localeCompare(Fe(t),void 0,{numeric:!0,sensitivity:`base`})),[X]),Z=(0,Q.useMemo)(()=>gt.map(e=>{let t=pe(e);return{fileDiff:e,filePath:Fe(e),fileKey:t,collapsed:Ge.has(t)}}),[Ge,gt]),_t=(0,Q.useMemo)(()=>Z.map(e=>e.fileKey),[Z]),vt=qt(_t,Ge),yt=(0,Q.useMemo)(()=>ve(gt),[gt]);(0,Q.useEffect)(()=>{if(!Ie)return;let e=Z.find(e=>e.filePath===Ie);e&&P.current?.scrollTo({type:`item`,id:e.fileKey,align:`start`})},[Z,Ie,Re]);let bt=(0,Q.useCallback)(e=>{Wt({threadRef:F,filePath:e,activeCwd:L,openInEditor:e=>{(async()=>{let t=await de(e);t._tag===`Failure`&&!i(t)&&console.warn(`Failed to open diff file in editor.`,{operation:`open-diff-file`,...F?{environmentId:F.environmentId,threadId:F.threadId}:{},...o(n(t))})})()}})},[L,de,F]),xt=(0,Q.useCallback)(e=>{N(t=>{let n=new Set(t.scopeKey===G?t.fileKeys:[]);return n.has(e)?n.delete(e):n.add(e),{scopeKey:G,fileKeys:n}})},[G]),St=(0,Q.useCallback)(()=>{N(e=>{let t=e.scopeKey===G?e.fileKeys:bn;return{scopeKey:G,fileKeys:Jt(_t,t)}})},[G,_t]),Ct=e=>{F&&De.getState().selectTurn(F,e)},wt=e=>{F&&De.getState().selectGitScope(F,e)},Tt=e=>{F&&De.getState().selectBranchBaseRef(F,e)};return(0,$.jsx)(Xt,{mode:t,header:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3 [-webkit-app-region:no-drag]`,children:[(0,$.jsxs)(f,{children:[(0,$.jsxs)(v,{className:`inline-flex h-6 max-w-full items-center gap-1 rounded-md bg-muted/70 px-2 text-xs font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring`,"aria-label":`Diff scope: ${Ue}`,children:[(0,$.jsx)(`span`,{className:`truncate`,children:Ue}),(0,$.jsx)(E,{className:`size-3.5 shrink-0 text-muted-foreground`})]}),(0,$.jsxs)(s,{align:`start`,className:`w-60`,children:[(0,$.jsx)(_,{className:B===null&&V===`unstaged`?`bg-foreground/[0.08]`:void 0,onClick:()=>wt(`unstaged`),children:(0,$.jsx)(`span`,{children:`Working tree`})}),(0,$.jsx)(_,{className:B===null&&V===`branch`?`bg-foreground/[0.08]`:void 0,onClick:()=>wt(`branch`),children:(0,$.jsx)(`span`,{children:`Branch changes`})}),(0,$.jsx)(_,{className:B!==null&&U?.turnId===ze?.turnId?`bg-foreground/[0.08]`:void 0,onClick:()=>{ze&&Ct(ze.turnId)},children:(0,$.jsx)(`span`,{children:`Latest turn`})}),(0,$.jsxs)(ee,{children:[(0,$.jsx)(y,{children:`Turn`}),(0,$.jsx)(c,{className:`w-64`,children:z.map(e=>{let t=e.checkpointTurnCount??Ee[e.turnId]??`?`;return(0,$.jsxs)(_,{className:e.turnId===U?.turnId?`bg-foreground/[0.08]`:void 0,onClick:()=>Ct(e.turnId),children:[(0,$.jsxs)(`span`,{children:[`Turn `,t]}),(0,$.jsx)(`span`,{className:`ml-auto text-xs tabular-nums text-muted-foreground`,children:Pe(e.completedAt,p.timestampFormat)})]},e.turnId)})})]})]})]}),B===null&&V===`branch`&&J?.baseRef&&(0,$.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2 overflow-hidden text-xs text-muted-foreground`,title:`${J.headRef??`HEAD`} → ${J.baseRef}`,"aria-label":`Comparing ${J.headRef??`HEAD`} against ${J.baseRef}`,children:[(0,$.jsx)(`span`,{className:`min-w-0 max-w-48 truncate`,children:J.headRef??`HEAD`}),(0,$.jsx)(ae,{className:`size-3.5 shrink-0 opacity-70`}),(0,$.jsxs)(fe,{items:lt,filteredItems:ut,value:H??yn,onOpenChange:e=>{e||M(``)},onValueChange:e=>{e&&Tt(e===yn?null:e)},children:[(0,$.jsxs)(je,{className:`inline-flex min-w-0 max-w-48 items-center gap-1 overflow-hidden rounded-md px-1.5 py-1 outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,"aria-label":`Change comparison target. Currently ${J.baseRef}`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:J.baseRef}),(0,$.jsx)(E,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,$.jsxs)(ue,{align:`start`,className:`w-72 min-w-0 max-w-[calc(100vw-1rem)] overflow-hidden [&>[data-slot=combobox-popup]]:min-w-0 [&>[data-slot=combobox-popup]]:overflow-hidden`,children:[(0,$.jsx)(`div`,{className:`min-w-0 shrink-0 px-3 pt-2.5`,children:(0,$.jsxs)(`div`,{className:`relative -translate-y-px border-b border-border/70 pb-1.5 transition-colors focus-within:border-ring`,children:[(0,$.jsx)(ke,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1.5 left-0 size-4 shrink-0 text-muted-foreground/55`}),(0,$.jsx)(xe,{className:`[&_input]:h-6.5 [&_input]:ps-5 [&_input]:font-sans [&_input]:leading-6.5`,inputClassName:`rounded-none bg-transparent text-sm`,placeholder:`Search refs...`,showTrigger:!1,size:`sm`,unstyled:!0,value:j,onChange:e=>M(e.target.value)})]})}),(0,$.jsxs)(`div`,{className:`grid shrink-0 grid-cols-[1rem_minmax(0,1fr)] items-center gap-2 border-b border-border/70 ps-3 pe-6.5 pt-2 pb-1.5 font-medium text-[10px] text-muted-foreground uppercase tracking-wide`,children:[(0,$.jsx)(`span`,{"aria-hidden":`true`}),(0,$.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center`,children:[(0,$.jsx)(`span`,{children:`Branch`}),(0,$.jsx)(`span`,{className:`text-right`,children:`Remote`})]})]}),(0,$.jsx)(ge,{children:`No matching refs.`}),(0,$.jsxs)($e,{className:`max-h-64 min-w-0 overflow-x-hidden`,children:[(0,$.jsx)(Oe,{className:`h-8 w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)] py-0`,contentClassName:`w-full min-w-0 overflow-hidden`,value:yn,children:(0,$.jsx)(`span`,{className:`block min-w-0 truncate`,children:`Automatic`})}),ot.map(e=>{let t=ct(e),n=e.local!==null&&e.remote!==null,r=e.remote?.name===t;return(0,$.jsx)(Oe,{className:`h-8 w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)] py-0`,contentClassName:`w-full min-w-0 overflow-hidden`,value:t,children:(0,$.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center overflow-hidden`,children:[(0,$.jsx)(`span`,{className:`block min-w-0 truncate pe-2`,children:e.label}),n?(0,$.jsx)(`div`,{className:`flex justify-end`,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,$.jsx)(we,{"aria-label":`Use remote version of ${e.label}`,checked:r,className:`[--thumb-size:--spacing(3)]`,onCheckedChange:t=>{let n=t?e.remote?.name:e.local?.name;n&&Tt(n)}})}):e.remote?(0,$.jsx)(`span`,{className:`flex justify-end text-muted-foreground`,title:`Remote only`,children:(0,$.jsx)(S,{"aria-hidden":`true`,className:`size-3`})}):null]})},e.id)})]})]})]})]})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[Z.length>0&&(0,$.jsx)(Ve,{additions:yt.additions,deletions:yt.deletions,className:`mr-1 text-[11px]`,layout:`inline`}),Z.length>0&&(0,$.jsxs)(k,{children:[(0,$.jsx)(x,{render:(0,$.jsx)(u,{type:`button`,size:`icon-xs`,variant:`outline`,"aria-label":vt?`Expand all files`:`Collapse all files`,onClick:St}),children:vt?(0,$.jsx)(_e,{className:`size-3`}):(0,$.jsx)(Se,{className:`size-3`})}),(0,$.jsx)(w,{side:`top`,children:vt?`Expand all files`:`Collapse all files`})]}),(0,$.jsxs)(fn,{className:`shrink-0`,variant:`outline`,size:`xs`,value:[g],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&b(t)},children:[(0,$.jsx)(pn,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,$.jsx)(rt,{className:`size-3`})}),(0,$.jsx)(pn,{"aria-label":`Split diff view`,value:`split`,children:(0,$.jsx)(tt,{className:`size-3`})})]}),(0,$.jsxs)(k,{children:[(0,$.jsx)(x,{render:(0,$.jsx)(pn,{"aria-label":T?`Disable diff line wrapping`:`Enable diff line wrapping`,variant:`outline`,size:`xs`,pressed:T,onPressedChange:e=>{D(!!e)}}),children:(0,$.jsx)(Xe,{className:`size-3`})}),(0,$.jsx)(w,{side:`top`,children:T?`Disable line wrapping`:`Enable line wrapping`})]}),(0,$.jsxs)(k,{children:[(0,$.jsx)(x,{render:(0,$.jsx)(pn,{"aria-label":O?`Show whitespace changes`:`Hide whitespace changes`,variant:`outline`,size:`xs`,pressed:O,onPressedChange:e=>{A(!!e)}}),children:(0,$.jsx)(nt,{className:`size-3`})}),(0,$.jsx)(w,{side:`top`,children:O?`Show whitespace changes`:`Hide whitespace changes`})]})]})]}),children:I?Ce?B!==null&&z.length===0?(0,$.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`No completed turns yet.`}):(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`div`,{className:`diff-panel-viewport flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[ft&&(0,$.jsx)(`p`,{className:`shrink-0 border-b border-border/70 bg-muted/40 px-3 py-1.5 text-[11px] text-muted-foreground`,children:`This diff was truncated because it exceeded the preview limit. The changes shown are incomplete.`}),mt&&!X&&(0,$.jsx)(`div`,{className:`px-3`,children:(0,$.jsx)(`p`,{className:`mb-2 text-[11px] text-red-500/80`,children:mt})}),X?X.kind===`files`?(0,$.jsx)(`div`,{className:`min-h-0 flex-1`,onClickCapture:e=>{let t=(e.nativeEvent.composedPath?.()??[]).find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent?.trim();t&&bt(t)},children:(0,$.jsx)(tn,{viewerRef:P,className:`diff-render-surface h-full min-h-0 overflow-auto`,files:Z,sectionId:We,sectionTitle:Ke,composerDraftTarget:r,renderHeaderPrefix:(e,t,n)=>{let r=Fe(e);return(0,$.jsxs)(k,{children:[(0,$.jsx)(x,{render:(0,$.jsx)(`button`,{type:`button`,className:a(`inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-0 transition-colors hover:bg-foreground/10 focus-visible:outline-hidden`,qe(e)),"aria-label":n?`Expand ${r}`:`Collapse ${r}`,"aria-expanded":!n,onClick:e=>{e.stopPropagation(),xt(t)}}),children:n?(0,$.jsx)(te,{className:`size-4`}):(0,$.jsx)(E,{className:`size-4`})}),(0,$.jsx)(w,{side:`top`,children:n?`Expand diff`:`Collapse diff`})]})},options:{diffStyle:g===`split`?`split`:`unified`,lineDiffType:`none`,overflow:T?`wrap`:`scroll`,theme:Me(d),themeType:d,unsafeCSS:xn,stickyHeaders:!0,itemMetrics:{diffHeaderHeight:33},layout:{paddingTop:0,paddingBottom:8,gap:8}}},G??We)}):(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground/75`,children:X.reason}),(0,$.jsx)(`pre`,{className:a(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-[11px] leading-relaxed text-muted-foreground/90`,T?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:X.text})]})}):pt?(0,$.jsx)(Zt,{label:U?`Loading checkpoint diff...`:V===`unstaged`?`Loading working tree diff...`:`Loading branch diff...`}):(0,$.jsx)(`div`,{className:`flex h-full items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,$.jsx)(`p`,{children:ht?`No net changes in this selection.`:`No patch available for this selection.`})})]})}):(0,$.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Turn diffs are unavailable because this project is not a git repository.`}):(0,$.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Select a thread to inspect turn diffs.`})})}export{Ie as DiffWorkerPoolProvider,Sn as default};
98
- //# sourceMappingURL=DiffPanel-rTTo7hcH.js.map
@@ -1,2 +0,0 @@
1
- import{Bs as e,Dp as t,E as n,Ft as r,Gr as i,Hr as a,Jr as o,Pr as s,Qf as c,Qs as l,Rr as u,Uc as d,Ur as f,Vr as p,Wr as m,Xr as h,Yr as g,Ys as _,Yt as v,Zs as y,_ as b,_u as x,ac as S,b as C,cc as w,ec as T,fc as E,h as D,m as O,os as k,qr as A,s as ee,sp as j,vs as te,wp as M,ws as N,x as ne,y as P,yu as F}from"./textarea-CbUaa52I.js";import{t as re}from"./arrow-right-SCFydakV.js";import{$n as I,A as L,An as R,Cr as ie,Dr as ae,Er as oe,F as z,Jn as B,M as V,Mn as H,Mr as U,N as se,O as W,On as G,Or as ce,P as K,Pr as le,Qn as q,Rr as ue,Xn as de,Zn as J,a as fe,ar as pe,c as me,cr as he,dr as Y,er as ge,g as _e,i as ve,ir as ye,j as be,jn as xe,k as Se,kn as Ce,kr as we,lr as Te,n as Ee,nr as De,o as Oe,or as ke,r as Ae,rr as je,s as Me,sr as Ne,t as Pe,tr as Fe,ur as X,wr as Ie}from"./index-DXGA7g9I.js";var Le=k(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Re=k(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),ze=k(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),Be=k(`radio-tower`,[[`path`,{d:`M4.9 16.1C1 12.2 1 5.8 4.9 1.9`,key:`s0qx1y`}],[`path`,{d:`M7.8 4.7a6.14 6.14 0 0 0-.8 7.5`,key:`1idnkw`}],[`circle`,{cx:`12`,cy:`9`,r:`2`,key:`1092wv`}],[`path`,{d:`M16.2 4.8c2 2 2.26 5.11.8 7.47`,key:`ojru2q`}],[`path`,{d:`M19.1 1.9a9.96 9.96 0 0 1 0 14.1`,key:`rhi7fg`}],[`path`,{d:`M9.5 18h5`,key:`mfy3pd`}],[`path`,{d:`m8 22 4-11 4 11`,key:`25yftu`}]]),Z=t(M(),1),Q=c(),$=j();function Ve(e){let t=(0,Q.c)(8),n,i;t[0]===e?(n=t[1],i=t[2]):({className:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=r(`relative inline-flex w-full min-w-0 items-center rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-ring has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-autofill:bg-foreground/4 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/6%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)]`,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,$.jsx)(`div`,{className:a,"data-slot":`input-group`,role:`group`,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}var He=te(`[&_svg]:-mx-0.5 flex h-auto cursor-text select-none items-center justify-center gap-2 leading-none [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80`,{defaultVariants:{align:`inline-start`},variants:{align:{"block-end":`order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"block-start":`order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"inline-end":`has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 order-last pe-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]`,"inline-start":`has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 order-first ps-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]`}}});function Ue(e){let t=(0,Q.c)(11),n,i,a;t[0]===e?(n=t[1],i=t[2],a=t[3]):({className:n,align:a,...i}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a);let o=a===void 0?`inline-start`:a,s;t[4]!==o||t[5]!==n?(s=r(He({align:o}),n),t[4]=o,t[5]=n,t[6]=s):s=t[6];let c;return t[7]!==o||t[8]!==i||t[9]!==s?(c=(0,$.jsx)(`div`,{className:s,"data-align":o,"data-slot":`input-group-addon`,onMouseDown:We,...i}),t[7]=o,t[8]=i,t[9]=s,t[10]=c):c=t[10],c}function We(e){if(e.target.closest(`button, a, input, select, textarea, [role='button'], [role='combobox'], [role='listbox'], [data-slot='select-trigger']`))return;e.preventDefault();let t=e.currentTarget.parentElement,n=t?.querySelector(`input, textarea`);n&&!t?.querySelector(`input:focus, textarea:focus`)&&n.focus()}function Ge(e){let t=(0,Q.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(B,{className:n,unstyled:!0,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var Ke=()=>{};function qe(e){let t=(0,Q.c)(98),{url:n,displayUrl:i,loading:a,loadProgress:o,canGoBack:c,canGoForward:l,refreshDisabled:u,inputDisabled:d,focusUrlNonce:f,onBack:p,onForward:m,onRefresh:h,onSubmit:g,onOpenInBrowser:_,onCapture:v,captureDisabled:y,recording:x,onPictureInPicture:S,pictureInPicture:C,pictureInPictureDisabled:w,onPickElement:T,pickActive:E,pickDisabled:k,pickDisabledReason:A,trailingActions:ee}=e,j=(0,Z.useRef)(null),[te,M]=(0,Z.useState)(n),[N,ne]=(0,Z.useState)(!1),P,F;t[0]===f?(P=t[1],F=t[2]):(P=()=>{if(f==null)return;let e=j.current;e&&e.focus()},F=[f],t[0]=f,t[1]=P,t[2]=F),(0,Z.useEffect)(P,F);let I;t[3]!==te||t[4]!==g?(I=e=>{e?.preventDefault();let t=te.trim();t.length!==0&&(g(t),j.current?.blur())},t[3]=te,t[4]=g,t[5]=I):I=t[5];let L=I,R=c?p:Ke,oe=!c,z;t[6]!==R||t[7]!==oe?(z=(0,$.jsx)(s,{variant:`ghost`,size:`icon-xs`,onClick:R,disabled:oe,"aria-label":`Back`,type:`button`}),t[6]=R,t[7]=oe,t[8]=z):z=t[8];let B;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(ue,{}),t[9]=B):B=t[9];let V;t[10]===z?V=t[11]:(V=(0,$.jsx)(b,{render:z,children:B}),t[10]=z,t[11]=V);let H;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(D,{children:`Back`}),t[12]=H):H=t[12];let U;t[13]===V?U=t[14]:(U=(0,$.jsxs)(O,{children:[V,H]}),t[13]=V,t[14]=U);let se=l?m:Ke,W=!l,G;t[15]!==se||t[16]!==W?(G=(0,$.jsx)(s,{variant:`ghost`,size:`icon-xs`,onClick:se,disabled:W,"aria-label":`Forward`,type:`button`}),t[15]=se,t[16]=W,t[17]=G):G=t[17];let K;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(re,{}),t[18]=K):K=t[18];let q;t[19]===G?q=t[20]:(q=(0,$.jsx)(b,{render:G,children:K}),t[19]=G,t[20]=q);let de;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(D,{children:`Forward`}),t[21]=de):de=t[21];let J;t[22]===q?J=t[23]:(J=(0,$.jsxs)(O,{children:[q,de]}),t[22]=q,t[23]=J);let fe=u?Ke:h,pe=a?`Stop`:`Refresh`,me;t[24]!==u||t[25]!==fe||t[26]!==pe?(me=(0,$.jsx)(s,{variant:`ghost`,size:`icon-xs`,onClick:fe,disabled:u,"aria-label":pe,type:`button`}),t[24]=u,t[25]=fe,t[26]=pe,t[27]=me):me=t[27];let he=a&&`animate-spin`,Y;t[28]===he?Y=t[29]:(Y=r(he),t[28]=he,t[29]=Y);let ge;t[30]===Y?ge=t[31]:(ge=(0,$.jsx)(ie,{className:Y}),t[30]=Y,t[31]=ge);let _e;t[32]!==me||t[33]!==ge?(_e=(0,$.jsx)(b,{render:me,children:ge}),t[32]=me,t[33]=ge,t[34]=_e):_e=t[34];let ve=a?`Loading…`:`Refresh`,ye;t[35]===ve?ye=t[36]:(ye=(0,$.jsx)(D,{children:ve}),t[35]=ve,t[36]=ye);let be;t[37]!==_e||t[38]!==ye?(be=(0,$.jsxs)(O,{children:[_e,ye]}),t[37]=_e,t[38]=ye,t[39]=be):be=t[39];let xe;t[40]!==U||t[41]!==J||t[42]!==be?(xe=(0,$.jsxs)(`div`,{className:`flex items-center gap-0.5`,role:`group`,"aria-label":`Navigation`,children:[U,J,be]}),t[40]=U,t[41]=J,t[42]=be,t[43]=xe):xe=t[43];let Se=N?te:i??n,Ce=_&&!N&&`group-hover/address:pe-7 transition-[padding]`,we;t[44]===Ce?we=t[45]:(we=r(Ce),t[44]=Ce,t[45]=we);let Te;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(Te=e=>M(e.target.value),t[46]=Te):Te=t[46];let Ee;t[47]===n?Ee=t[48]:(Ee=()=>{M(n),ne(!0),queueMicrotask(()=>j.current?.select())},t[47]=n,t[48]=Ee);let De;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(De=()=>{ne(!1)},t[49]=De):De=t[49];let Oe;t[50]!==L||t[51]!==n?(Oe=e=>{e.key===`Enter`&&L(e),e.key===`Escape`&&(e.preventDefault(),M(n),j.current?.blur())},t[50]=L,t[51]=n,t[52]=Oe):Oe=t[52];let ke;t[53]!==d||t[54]!==Se||t[55]!==we||t[56]!==Ee||t[57]!==Oe?(ke=(0,$.jsx)(b,{render:(0,$.jsx)(Ge,{ref:j,value:Se,className:we,onChange:Te,onFocus:Ee,onBlur:De,onKeyDown:Oe,placeholder:`Search or enter URL`,spellCheck:!1,disabled:d,"data-preview-url-input":!0,size:`sm`})}),t[53]=d,t[54]=Se,t[55]=we,t[56]=Ee,t[57]=Oe,t[58]=ke):ke=t[58];let Ae;t[59]!==i||t[60]!==N||t[61]!==n?(Ae=!N&&i?(0,$.jsx)(D,{children:n}):null,t[59]=i,t[60]=N,t[61]=n,t[62]=Ae):Ae=t[62];let je;t[63]!==ke||t[64]!==Ae?(je=(0,$.jsxs)(O,{children:[ke,Ae]}),t[63]=ke,t[64]=Ae,t[65]=je):je=t[65];let Me;t[66]!==N||t[67]!==_?(Me=_&&!N?(0,$.jsx)(Ue,{align:`inline-end`,className:`pointer-events-none absolute inset-y-0 right-0 opacity-0 transition-opacity group-hover/address:pointer-events-auto group-hover/address:opacity-100`,children:(0,$.jsxs)(O,{children:[(0,$.jsx)(b,{render:(0,$.jsx)(s,{variant:`ghost`,size:`icon-xs`,onClick:_,"aria-label":`Open in system browser`,type:`button`}),children:(0,$.jsx)(le,{})}),(0,$.jsx)(D,{children:`Open in system browser`})]})}):null,t[66]=N,t[67]=_,t[68]=Me):Me=t[68];let Ne;t[69]!==je||t[70]!==Me?(Ne=(0,$.jsxs)(Ve,{className:`group/address h-7 flex-1 rounded-md border-transparent bg-transparent shadow-none before:shadow-none hover:bg-muted/40 focus-within:bg-background`,children:[je,Me]}),t[69]=je,t[70]=Me,t[71]=Ne):Ne=t[71];let Pe;t[72]!==T||t[73]!==E||t[74]!==k||t[75]!==A?(Pe=T?(0,$.jsxs)(O,{children:[(0,$.jsx)(b,{render:(0,$.jsx)(s,{variant:E?`secondary`:`ghost`,size:`icon-xs`,onClick:T,disabled:k,"aria-label":E?`Cancel annotation`:`Annotate preview`,"aria-pressed":E?`true`:`false`,type:`button`}),children:(0,$.jsx)(ce,{className:r(E&&`text-primary`)})}),(0,$.jsx)(D,{children:k&&A?A:E?`Cancel annotation (Esc)`:`Annotate elements, regions, and drawings`})]}):null,t[72]=T,t[73]=E,t[74]=k,t[75]=A,t[76]=Pe):Pe=t[76];let Fe;t[77]!==y||t[78]!==v||t[79]!==x?(Fe=v?(0,$.jsxs)(O,{children:[(0,$.jsxs)(b,{render:(0,$.jsx)(s,{variant:x?`secondary`:`ghost`,size:`icon-xs`,onClick:e=>v(e.shiftKey),"aria-label":x?`Stop recording`:`Capture screenshot`,type:`button`,className:`relative`,disabled:y}),children:[(0,$.jsx)(Le,{className:r(x&&`text-destructive`)}),x?(0,$.jsx)(`span`,{className:`absolute right-0.5 top-0.5 size-1.5 animate-status-pulse rounded-full bg-destructive`}):null]}),(0,$.jsx)(D,{children:x?`Stop recording`:`Screenshot · Shift-click to record`})]}):null,t[77]=y,t[78]=v,t[79]=x,t[80]=Fe):Fe=t[80];let X;t[81]!==S||t[82]!==C||t[83]!==w?(X=S?(0,$.jsxs)(O,{children:[(0,$.jsx)(b,{render:(0,$.jsx)(s,{variant:C?`secondary`:`ghost`,size:`icon-xs`,onClick:S,"aria-label":C?`Close floating preview`:`Float preview over chat`,"aria-pressed":C?`true`:`false`,type:`button`,disabled:w}),children:(0,$.jsx)(ae,{className:r(C&&`text-primary`)})}),(0,$.jsx)(D,{children:C?`Close floating preview`:`Float preview over chat`})]}):null,t[81]=S,t[82]=C,t[83]=w,t[84]=X):X=t[84];let Ie;t[85]!==L||t[86]!==xe||t[87]!==Ne||t[88]!==Pe||t[89]!==Fe||t[90]!==X||t[91]!==ee?(Ie=(0,$.jsxs)(`form`,{onSubmit:L,className:`surface-subheader gap-1 px-2`,"data-surface-subheader":!0,children:[xe,Ne,Pe,Fe,X,ee]}),t[85]=L,t[86]=xe,t[87]=Ne,t[88]=Pe,t[89]=Fe,t[90]=X,t[91]=ee,t[92]=Ie):Ie=t[92];let Re;t[93]===o?Re=t[94]:(Re=o>0?(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute bottom-0 left-0 z-10 h-0.5 rounded-r-full bg-primary transition-all duration-150 ease-out`,style:{width:`${o}%`,boxShadow:`0 0 6px 1px var(--color-ring)`}}):null,t[93]=o,t[94]=Re);let ze;return t[95]!==Ie||t[96]!==Re?(ze=(0,$.jsxs)(`div`,{className:`relative`,children:[Ie,Re]}),t[95]=Ie,t[96]=Re,t[97]=ze):ze=t[97],ze}function Je(e){try{let t=new URL(e.url),n=new URL(e.environmentHttpBaseUrl);if(t.origin===n.origin&&t.pathname.startsWith(`/api/assets/`)){let n=t.pathname.split(`/`).at(-1);if(!n)return null;let r=decodeURIComponent(n);return!r||r===`.`||r===`..`?null:`${e.environmentLabel} · ${r}`}return t.protocol===`http:`||t.protocol===`https:`?t.host:null}catch{return null}}function Ye(e){let t=(0,Q.c)(6),{className:n}=e,i;t[0]===n?i=t[1]:(i=r(`relative flex flex-col gap-0.5 overflow-hidden rounded-[5px] border border-border/60 bg-card p-1 shadow-xs/5`,n),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsxs)(`div`,{className:`flex gap-[2px]`,children:[(0,$.jsx)(`span`,{className:`size-[3px] rounded-full bg-destructive/80`}),(0,$.jsx)(`span`,{className:`size-[3px] rounded-full bg-warning/80`}),(0,$.jsx)(`span`,{className:`size-[3px] rounded-full bg-success/80`})]}),t[2]=a):a=t[2];let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`div`,{className:`mt-[1px] flex flex-1 flex-col gap-[2px]`,children:[(0,$.jsx)(`span`,{className:`h-[2px] w-full rounded-full bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-[2px] w-3/5 rounded-full bg-muted-foreground/20`})]}),t[3]=o):o=t[3];let s;return t[4]===i?s=t[5]:(s=(0,$.jsxs)(`div`,{"aria-hidden":!0,className:i,children:[a,o]}),t[4]=i,t[5]=s),s}function Xe(e){let t=(0,Q.c)(17),{server:n,onOpen:r}=e,i;t[0]===n?i=t[1]:(i=Ze(n),t[0]=n,t[1]=i);let a=i,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Ye,{className:`size-7 shrink-0`}),t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:a}),t[3]=a,t[4]=s);let c;t[5]!==n.host||t[6]!==n.port?(c=(0,$.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[n.host,`:`,n.port]}),t[5]=n.host,t[6]=n.port,t[7]=c):c=t[7];let l;t[8]!==s||t[9]!==c?(l=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10];let u;t[11]===n.listening?u=t[12]:(u=n.listening?(0,$.jsx)(Qe,{}):(0,$.jsx)($e,{}),t[11]=n.listening,t[12]=u);let d;return t[13]!==r||t[14]!==l||t[15]!==u?(d=(0,$.jsxs)(`button`,{type:`button`,onClick:r,className:`group flex w-full items-center gap-3 px-3 py-3 text-left hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[o,l,u]}),t[13]=r,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function Ze(e){return e.processName?e.processName:e.listening?`Listening`:e.source===`configured`?`Configured`:`Recently seen`}function Qe(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`span`,{"aria-label":`Listening`,className:`relative inline-flex size-2 shrink-0`,children:[(0,$.jsx)(`span`,{className:`absolute inset-0 animate-status-ping rounded-full bg-success opacity-60`}),(0,$.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-success`})]}),e[0]=t):t=e[0],t}function $e(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`span`,{"aria-label":`Not currently listening`,className:`size-2 shrink-0 rounded-full bg-muted-foreground/40`}),e[0]=t):t=e[0],t}function et(e){let t=(0,Q.c)(7),n=he(e.environmentId),r;if(t[0]!==e.configuredUrls||t[1]!==e.environmentId||t[2]!==e.recentlySeenUrls||t[3]!==n){let i;t[5]===e.environmentId?i=t[6]:(i=t=>({...t,url:pe(e.environmentId,t.url)}),t[5]=e.environmentId,t[6]=i),r=tt({scanner:n.map(i),configuredUrls:e.configuredUrls??[],recentlySeenUrls:e.recentlySeenUrls??[]}),t[0]=e.configuredUrls,t[1]=e.environmentId,t[2]=e.recentlySeenUrls,t[3]=n,t[4]=r}else r=t[4];return r}function tt(e){let t=new Map;for(let n of e.configuredUrls){let e=rt(n);if(!e)continue;let r=nt(e.host,e.port);t.has(r)||t.set(r,{host:e.host,port:e.port,url:e.url,processName:null,pid:null,terminal:null,source:`configured`,listening:!1})}for(let n of e.scanner){let e=nt(n.host,n.port),r=t.get(e);if(r){t.set(e,{...r,processName:n.processName??r.processName,pid:n.pid??r.pid,terminal:n.terminal??r.terminal,listening:!0});continue}t.set(e,{...n,source:`scanner`,listening:!0})}for(let n of e.recentlySeenUrls){let e=rt(n);if(!e)continue;let r=nt(e.host,e.port);t.has(r)||t.set(r,{host:e.host,port:e.port,url:e.url,processName:null,pid:null,terminal:null,source:`recent`,listening:!1})}return Array.from(t.values()).toSorted((e,t)=>{let n={configured:0,scanner:1,recent:2};return n[e.source]===n[t.source]?e.port-t.port:n[e.source]-n[t.source]})}function nt(e,t){return`${e.toLowerCase()}:${t}`}function rt(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`||!ke(t.hostname))return null;let n=t.port?Number.parseInt(t.port,10):t.protocol===`http:`?80:443;return!Number.isFinite(n)||n<=0?null:{host:t.hostname,port:n,url:t.href}}catch{return null}}function it(e){let t=(0,Q.c)(16),{environmentId:n,configuredUrls:r,recentlySeenUrls:i,onOpenUrl:a}=e,o;t[0]!==r||t[1]!==n||t[2]!==i?(o={environmentId:n,configuredUrls:r,recentlySeenUrls:i},t[0]=r,t[1]=n,t[2]=i,t[3]=o):o=t[3];let s=et(o);if(s.length===0){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(G,{children:[(0,$.jsx)(R,{variant:`icon`,children:(0,$.jsx)(U,{className:`size-4.5 text-muted-foreground`})}),(0,$.jsx)(xe,{children:`No preview yet`}),(0,$.jsx)(Ce,{children:`Type a URL above, or run a dev script. Listening localhost ports will show up here automatically.`})]}),t[4]=e):e=t[4],e}let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(Be,{className:`size-4 shrink-0`}),(0,$.jsx)(`h2`,{className:`font-medium`,children:`Local servers`})]}),t[5]=c):c=t[5];let l;if(t[6]!==a||t[7]!==s){let e;t[9]===a?e=t[10]:(e=e=>(0,$.jsx)(Xe,{server:e,onOpen:()=>a(e.url)},`${e.host}:${e.port}`),t[9]=a,t[10]=e),l=s.map(e),t[6]=a,t[7]=s,t[8]=l}else l=t[8];let u;t[11]===l?u=t[12]:(u=(0,$.jsx)(`div`,{className:`flex flex-col divide-y divide-border/60 overflow-hidden rounded-xl border border-border/70 bg-background`,children:l}),t[11]=l,t[12]=u);let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:`Select a listening port to open it in this browser tab.`}),t[13]=d):d=t[13];let f;return t[14]===u?f=t[15]:(f=(0,$.jsx)(`div`,{className:`flex h-full min-h-0 overflow-y-auto px-5 py-8`,children:(0,$.jsxs)(`div`,{className:`m-auto flex w-full max-w-xl flex-col gap-3`,children:[c,u,d]})}),t[14]=u,t[15]=f),f}var at=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}];function ot(e){let t=(0,Q.c)(74),{tabId:n,hasWebContents:r,zoomFactor:c,colorScheme:l,deviceToolbarVisible:d,onToggleDeviceToolbar:m,nativePictureInPicture:_,onNativePictureInPicture:v}=e;if(!L)return null;let y=!n||!r,x;t[0]===n?x=t[1]:(x=e=>()=>{n&&e(n).catch(mt)},t[0]=n,t[1]=x);let S=x,C;t[2]===c?C=t[3]:(C=Math.round(c*100),t[2]=c,t[3]=C);let w=`${C}%`,T;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsxs)(O,{children:[(0,$.jsx)(b,{render:(0,$.jsx)(h,{render:(0,$.jsx)(s,{variant:`ghost`,size:`icon-xs`,type:`button`,"aria-label":`Preview menu`})}),children:(0,$.jsx)(Re,{})}),(0,$.jsx)(D,{children:`More`})]}),t[4]=T):T=t[4];let E;t[5]===S?E=t[6]:(E=S(L.hardReload),t[5]=S,t[6]=E);let k;t[7]!==E||t[8]!==y?(k=(0,$.jsx)(p,{onClick:E,disabled:y,children:`Hard reload`}),t[7]=E,t[8]=y,t[9]=k):k=t[9];let ee;t[10]===S?ee=t[11]:(ee=S(L.openDevTools),t[10]=S,t[11]=ee);let j;t[12]!==ee||t[13]!==y?(j=(0,$.jsx)(p,{onClick:ee,disabled:y,children:`Open DevTools`}),t[12]=ee,t[13]=y,t[14]=j):j=t[14];let te=_?`Close separate preview window`:`Open separate preview window`,M;t[15]!==v||t[16]!==te||t[17]!==y?(M=(0,$.jsx)(p,{onClick:v,disabled:y,children:te}),t[15]=v,t[16]=te,t[17]=y,t[18]=M):M=t[18];let N=d?`Hide device toolbar`:`Show device toolbar`,ne;t[19]!==m||t[20]!==N||t[21]!==y?(ne=(0,$.jsx)(p,{onClick:m,disabled:y,children:N}),t[19]=m,t[20]=N,t[21]=y,t[22]=ne):ne=t[22];let P;t[23]===y?P=t[24]:(P=(0,$.jsx)(g,{disabled:y,children:`Appearance`}),t[23]=y,t[24]=P);let F;t[25]===n?F=t[26]:(F=e=>{n&&L.setColorScheme(n,e).catch(pt)},t[25]=n,t[26]=F);let re;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(re=at.map(ft),t[27]=re):re=t[27];let I;t[28]!==l||t[29]!==F?(I=(0,$.jsx)(o,{className:`min-w-32`,children:(0,$.jsx)(f,{value:l,onValueChange:F,children:re})}),t[28]=l,t[29]=F,t[30]=I):I=t[30];let R;t[31]!==P||t[32]!==I?(R=(0,$.jsxs)(A,{children:[P,I]}),t[31]=P,t[32]=I,t[33]=R):R=t[33];let ie;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(i,{}),t[34]=ie):ie=t[34];let ae;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(`span`,{children:`Zoom`}),t[35]=ae):ae=t[35];let z;t[36]===S?z=t[37]:(z=S(L.zoomOut),t[36]=S,t[37]=z);let B;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(we,{}),t[38]=B):B=t[38];let V;t[39]!==z||t[40]!==y?(V=(0,$.jsx)(s,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:z,"aria-label":`Zoom out`,disabled:y,children:B}),t[39]=z,t[40]=y,t[41]=V):V=t[41];let H;t[42]===w?H=t[43]:(H=(0,$.jsx)(`span`,{className:`min-w-12 text-center text-xs tabular-nums text-muted-foreground`,children:w}),t[42]=w,t[43]=H);let U;t[44]===S?U=t[45]:(U=S(L.zoomIn),t[44]=S,t[45]=U);let se;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(oe,{}),t[46]=se):se=t[46];let W;t[47]!==U||t[48]!==y?(W=(0,$.jsx)(s,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:U,"aria-label":`Zoom in`,disabled:y,children:se}),t[47]=U,t[48]=y,t[49]=W):W=t[49];let G;t[50]===S?G=t[51]:(G=S(L.resetZoom),t[50]=S,t[51]=G);let ce;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(Ie,{}),t[52]=ce):ce=t[52];let K;t[53]!==G||t[54]!==y?(K=(0,$.jsx)(s,{variant:`ghost`,size:`icon-xs`,type:`button`,onClick:G,"aria-label":`Reset zoom`,disabled:y,children:ce}),t[53]=G,t[54]=y,t[55]=K):K=t[55];let le;t[56]!==V||t[57]!==H||t[58]!==W||t[59]!==K?(le=(0,$.jsxs)(`span`,{className:`flex items-center gap-1`,children:[V,H,W,K]}),t[56]=V,t[57]=H,t[58]=W,t[59]=K,t[60]=le):le=t[60];let q;t[61]!==le||t[62]!==y?(q=(0,$.jsxs)(p,{closeOnClick:!1,onClick:dt,className:`justify-between`,disabled:y,children:[ae,le]}),t[61]=le,t[62]=y,t[63]=q):q=t[63];let ue,de,J;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,$.jsx)(i,{}),de=(0,$.jsx)(p,{onClick:lt,children:`Clear cookies`}),J=(0,$.jsx)(p,{onClick:st,children:`Clear cache`}),t[64]=ue,t[65]=de,t[66]=J):(ue=t[64],de=t[65],J=t[66]);let fe;return t[67]!==ne||t[68]!==R||t[69]!==q||t[70]!==k||t[71]!==j||t[72]!==M?(fe=(0,$.jsxs)(u,{children:[T,(0,$.jsxs)(a,{align:`end`,sideOffset:6,className:`min-w-56`,children:[k,j,M,ne,R,ie,q,ue,de,J]})]}),t[67]=ne,t[68]=R,t[69]=q,t[70]=k,t[71]=j,t[72]=M,t[73]=fe):fe=t[73],fe}function st(){L.clearCache().catch(ct)}function ct(){}function lt(){L.clearCookies().catch(ut)}function ut(){}function dt(e){return e.preventDefault()}function ft(e){return(0,$.jsx)(m,{value:e.value,children:e.label},e.value)}function pt(){}function mt(){}function ht(e){return ye[e]||(e.length>0?e:`Network error`)}function gt(e){let t=(0,Q.c)(32),{url:n,code:r,description:i,onReload:a}=e,[o,c]=(0,Z.useState)(!1),l;t[0]===n?l=t[1]:(l=yt(n)??n,t[0]=n,t[1]=l);let u=l,d;t[2]===i?d=t[3]:(d=ht(i),t[2]=i,t[3]=d);let f=d,p;t[4]!==r||t[5]!==i?(p=i.length>0?i:`ERR_${Math.abs(r)||`FAILED`}`,t[4]=r,t[5]=i,t[6]=p):p=t[6];let m=p,h,g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(vt,{className:`mb-6 size-12 text-muted-foreground/70`}),g=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:`This site can’t be reached`}),t[7]=h,t[8]=g):(h=t[7],g=t[8]);let _;t[9]===u?_=t[10]:(_=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:u}),t[9]=u,t[10]=_);let v;t[11]!==f||t[12]!==_?(v=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[_,`: `,f,`.`]}),t[11]=f,t[12]=_,t[13]=v):v=t[13];let y;t[14]===o?y=t[15]:(y=o?(0,$.jsxs)(`div`,{className:`mt-6 rounded-lg border border-border bg-muted/40 p-4 text-sm`,children:[(0,$.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:`Try:`}),(0,$.jsxs)(`ul`,{className:`list-disc space-y-1 pl-5 text-muted-foreground`,children:[(0,$.jsx)(`li`,{children:`Checking your connection`}),(0,$.jsx)(`li`,{children:`Confirming the dev server is running`}),(0,$.jsx)(`li`,{children:`Checking the proxy and the firewall`})]})]}):null,t[14]=o,t[15]=y);let b;t[16]===m?b=t[17]:(b=(0,$.jsx)(`div`,{className:`mt-8 text-xs uppercase tracking-wide text-muted-foreground/70`,children:m}),t[16]=m,t[17]=b);let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>c(_t),t[18]=x):x=t[18];let S=o?`Hide details`:`Details`,C;t[19]===S?C=t[20]:(C=(0,$.jsx)(s,{type:`button`,variant:`outline`,size:`sm`,onClick:x,children:S}),t[19]=S,t[20]=C);let w;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(`div`,{className:`flex-1`}),t[21]=w):w=t[21];let T;t[22]===a?T=t[23]:(T=(0,$.jsx)(s,{type:`button`,size:`sm`,onClick:a,children:`Reload`}),t[22]=a,t[23]=T);let E;t[24]!==C||t[25]!==T?(E=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[C,w,T]}),t[24]=C,t[25]=T,t[26]=E):E=t[26];let D;return t[27]!==E||t[28]!==v||t[29]!==y||t[30]!==b?(D=(0,$.jsx)(`div`,{className:`relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[h,g,v,y,b,E]})}),t[27]=E,t[28]=v,t[29]=y,t[30]=b,t[31]=D):D=t[31],D}function _t(e){return!e}function vt(e){let t=(0,Q.c)(5),{className:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`path`,{d:`M16 12 L48 12 L48 52 L16 52 Z`}),i=(0,$.jsx)(`path`,{d:`M22 22 L42 22 M22 30 L36 30 M22 38 L40 38`,strokeLinecap:`round`}),a=(0,$.jsx)(`path`,{d:`M52 8 L12 56`,strokeLinecap:`round`}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,$.jsxs)(`svg`,{viewBox:`0 0 64 64`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,className:n,children:[r,i,a]}),t[3]=n,t[4]=o),o}function yt(e){try{return new URL(e).host}catch{return null}}function bt(e){let t=e.toLowerCase();return t.includes(`mac`)?`Reveal in Finder`:t.includes(`win`)?`Reveal in File Explorer`:`Reveal in Files`}var xt=120,St=220,Ct=4,wt=90,Tt=.08,Et=.5;function Dt(e){let[t,n]=(0,Z.useState)(0),r=(0,Z.useRef)(0);return r.current=t,(0,Z.useEffect)(()=>{if(!e){if(r.current===0)return;n(100);let e=window.setTimeout(()=>n(0),St);return()=>window.clearTimeout(e)}n(e=>e>0&&e<95?e:Ct);let t=window.setInterval(()=>{let e=r.current;if(e>=wt)return;let t=wt-e,i=Math.max(Et,t*Tt);n(Math.min(wt,e+i))},xt);return()=>window.clearInterval(t)},[e]),t}var Ot=class extends F()(`PreviewSessionThreadKeyParseError`,{threadKey:x}){get message(){return`Invalid scoped preview thread key: ${this.threadKey}`}},kt=_(e=>{let t=w(e);if(t===null)throw new Ot({threadKey:e});let n=Te.list({environmentId:t.environmentId,input:{threadId:t.threadId}}),r=Te.events({environmentId:t.environmentId,input:{}});return y(e=>{let i=!1,a=0,o=e=>{S(e)&&ge(t,e.value)},s=r=>{if(!S(r)||r.value.threadId!==t.threadId)return;let i=I(t).serverEpoch;if(i!==null&&i!==r.value.serverEpoch){e.refresh(n);return}J(t,r.value)};e.addFinalizer(()=>{i=!0});let c=e.once(r);e.subscribe(n,e=>{o(e)}),e.subscribe(r,e=>{a+=1,s(e)}),queueMicrotask(()=>{i||(e.refresh(n),a===0&&s(c))})}).pipe(l(1e3),T(`preview:session-sync:${e}`))});function At(e){let t=(0,Q.c)(2),n;t[0]===e?n=t[1]:(n=kt(E(e)),t[0]=e,t[1]=n),N(n)}var jt=1500,Mt=.001;function Nt(e){let t=(0,Q.c)(11),{zoomFactor:n}=e,[i,a]=(0,Z.useState)(!1),o=(0,Z.useRef)(n),s=(0,Z.useRef)(null),c,l;t[0]===n?(c=t[1],l=t[2]):(c=()=>{if(!(Math.abs(o.current-n)<Mt))return o.current=n,a(!0),s.current!==null&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{a(!1),s.current=null},jt),()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null)}},l=[n],t[0]=n,t[1]=c,t[2]=l),(0,Z.useEffect)(c,l);let u;t[3]===n?u=t[4]:(u=Math.round(n*100),t[3]=n,t[4]=u);let d=`${u}%`,f=!i,p=i?`opacity-100 translate-y-0`:`opacity-0 -translate-y-1`,m;t[5]===p?m=t[6]:(m=r(`pointer-events-none absolute top-3 right-3 z-20 select-none rounded-full border border-border/70 bg-popover/95 px-2.5 py-1 text-xs font-medium text-foreground shadow-md/10 backdrop-blur transition-all duration-200 ease-out`,p),t[5]=p,t[6]=m);let h;return t[7]!==d||t[8]!==f||t[9]!==m?(h=(0,$.jsx)(`div`,{"aria-hidden":f,className:m,children:d}),t[7]=d,t[8]=f,t[9]=m,t[10]=h):h=t[10],h}function Pt(e,t){return e?1:t===`human`?.18:.35}var Ft=700;function It(e){let t=(0,Q.c)(9),{tabId:n,zoomFactor:r,controller:i}=e,a;t[0]===n?a=t[1]:(a=e=>e.byTabId[n]??null,t[0]=n,t[1]=a);let o=me(a),s;t[2]===n?s=t[3]:(s=e=>e.byTabId[n]?.content??null,t[2]=n,t[3]=s);let c=z(s);if(!o)return null;let l;return t[4]!==c||t[5]!==i||t[6]!==o||t[7]!==r?(l=(0,$.jsx)(Lt,{event:o,content:c,zoomFactor:r,controller:i},o.sequence),t[4]=c,t[5]=i,t[6]=o,t[7]=r,t[8]=l):l=t[8],l}function Lt(e){let t=(0,Q.c)(15),{event:n,content:r,zoomFactor:i,controller:a}=e,[o,s]=(0,Z.useState)(!0),c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=window.setTimeout(()=>s(!1),Ft);return()=>window.clearTimeout(e)},l=[],t[0]=c,t[1]=l):(c=t[0],l=t[1]),(0,Z.useEffect)(c,l);let u;t[2]!==o||t[3]!==a?(u=Pt(o,a),t[2]=o,t[3]=a,t[4]=u):u=t[4];let d=`translate3d(${n.x*i*(r?.scale??1)+(r?.x??0)-(r?.scrollLeft??0)}px, ${n.y*i*(r?.scale??1)+(r?.y??0)-(r?.scrollTop??0)}px, 0)`,f;t[5]!==u||t[6]!==d?(f={opacity:u,transform:d},t[5]=u,t[6]=d,t[7]=f):f=t[7];let p;t[8]!==n.phase||t[9]!==n.sequence?(p=n.phase===`click`?(0,$.jsx)(`span`,{className:`absolute left-0.5 top-0.5 size-4 animate-status-ping rounded-full bg-primary/25 motion-reduce:animate-none`},n.sequence):null,t[8]=n.phase,t[9]=n.sequence,t[10]=p):p=t[10];let m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(ze,{className:`relative size-5 -translate-x-0.5 -translate-y-0.5 fill-background text-primary drop-shadow-sm`,strokeWidth:2}),t[11]=m):m=t[11];let h;return t[12]!==f||t[13]!==p?(h=(0,$.jsxs)(`div`,{className:`pointer-events-none absolute left-0 top-0 z-40 transition-[transform,opacity] duration-150 ease-out motion-reduce:transition-none`,style:f,"aria-hidden":`true`,"data-agent-browser-cursor":!0,children:[p,m]}),t[12]=f,t[13]=p,t[14]=h):h=t[14],h}var Rt=typeof window>`u`?null:n();function zt({threadRef:t,tabId:n,configuredUrls:r,visible:i}){let[a,o]=(0,Z.useState)(void 0),[s,c]=(0,Z.useState)(!1),l=Oe(),u=(0,Z.useRef)(!1),f=(0,Z.useRef)(!0),p=je(t),m=V(e=>be(e.byThreadKey,t)),h=v(e=>e.addPreviewAnnotation),g=v(e=>e.addImage),_=C(t.environmentId),y=ne(t.environmentId),b=P(Te.open),x=P(Te.resize,`preview viewport resize`);At(t),(0,Z.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]);let S=n??p.activeTabId,w=S?se(t,p.serverEpoch,S):null,T=S&&w?l.has(w)?w:Ae(t,S):null,D=S?p.sessions[S]??null:null,O=S?p.desktopByTabId[S]??null:null,k=D?.navStatus??{_tag:`Idle`},A=k._tag===`Idle`?``:k.url,j=O?.loading??k._tag===`Loading`,te=O?.canGoBack??D?.canGoBack??!1,M=O?.canGoForward??D?.canGoForward??!1,N=k._tag===`Idle`,F=k._tag===`LoadFailed`,re=Se(D),I=O?.controller??`none`,R=Dt(j),ie=A&&_&&y?Je({url:A,environmentLabel:_.label,environmentHttpBaseUrl:y})??void 0:void 0,ae=D?.viewport??d,oe=z(e=>w?e.byTabId[w]?.rect??null:null),B=(0,Z.useCallback)(async e=>{w&&L?(await L.navigate(w,e),Fe(t,e)):await de({openPreview:b,threadRef:t,url:e})},[b,w,t]),U=(0,Z.useCallback)(async e=>{try{await B(Ne(e))}catch{}},[B]),W=(0,Z.useCallback)(async e=>{try{await B(pe(t.environmentId,e))}catch{}},[B,t.environmentId]),G=(0,Z.useCallback)(()=>{L&&w&&L.refresh(w)},[w]),ce=(0,Z.useCallback)(()=>{L&&w&&L.zoomIn(w)},[w]),le=(0,Z.useCallback)(()=>{L&&w&&L.zoomOut(w)},[w]),q=(0,Z.useCallback)(()=>{L&&w&&L.resetZoom(w)},[w]),ue=(0,Z.useCallback)(async n=>{if(!S)return;let r=await x({environmentId:t.environmentId,input:{threadId:t.threadId,tabId:S,viewport:n}});if(r._tag===`Failure`){let t=e(r);throw X.add({type:`error`,title:`Unable to resize browser viewport`,description:t instanceof Error?t.message:`An error occurred.`}),t}De(t,r.value)},[x,S,t]),J=()=>{if(!w)return;if(ae._tag!==`fill`){Pe(w,d).catch(()=>void 0);return}let e=oe?Me(oe,O?.zoomFactor):{width:1024,height:768};Pe(w,{_tag:`freeform`,...e}).catch(()=>void 0)};(0,Z.useEffect)(()=>{if(w)return Ee(w,ue)},[ue,w]);let me=(0,Z.useCallback)(()=>{L&&w&&L.goBack(w)},[w]),he=(0,Z.useCallback)(()=>{L&&w&&L.goForward(w)},[w]),ge=(0,Z.useCallback)(()=>{!Rt||!A||Rt.shell.openExternal(A).catch(()=>void 0)},[A]),ye=(0,Z.useCallback)(()=>{if(S){if(m?.tabId===S){V.getState().close(t);return}V.getState().open(t,S),ee.getState().close(t)}},[m?.tabId,S,t]),xe=(0,Z.useCallback)(()=>{!L||!w||(O?.pictureInPicture?L.pictureInPicture.close:L.pictureInPicture.open)(w).catch(e=>{X.add({type:`error`,title:`Unable to update popped-out preview`,description:e instanceof Error?e.message:`An error occurred.`})})},[O?.pictureInPicture,w]),Ce=(0,Z.useCallback)(e=>{if(!L||!w||!S)return;let n=L;if(T){fe(T).then(e=>{if(!e)return;let t=!1,r,i=()=>{if(!navigator.clipboard?.writeText){X.update(r,Y({type:`error`,title:`Unable to copy recording path`,description:`Clipboard API unavailable.`,actionProps:a}));return}navigator.clipboard.writeText(e.path).then(()=>{t=!0,o(),window.setTimeout(()=>{t=!1,o()},2e3)},e=>{X.update(r,Y({type:`error`,title:`Unable to copy recording path`,description:e instanceof Error?e.message:`An error occurred.`,actionProps:a}))})},a={children:bt(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},o=()=>{X.update(r,Y({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:t?`Copied!`:`Copy path`,disabled:t,onClick:i},secondaryActionVariant:`outline`}}))};r=X.add(Y({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:`Copy path`,onClick:i},secondaryActionVariant:`outline`}}))},e=>{X.add({type:`error`,title:`Unable to stop recording`,description:e instanceof Error?e.message:`An error occurred.`})});return}if(e){ve(w,t,S).catch(e=>{X.add({type:`error`,title:`Unable to start recording`,description:e instanceof Error?e.message:`An error occurred.`})});return}n.captureScreenshot(w).then(e=>{let t={children:bt(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},r=!1,i=!1,a,o=(e=`success`,n=`Screenshot saved`,o)=>{X.update(a,Y({type:e,title:n,description:o,actionProps:{children:i?`Copied!`:`Copy image`,disabled:i,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:r?`Copied!`:`Copy path`,disabled:r,onClick:s}}],secondaryActionProps:{...t},secondaryActionVariant:`outline`}}))},s=()=>{if(!navigator.clipboard?.writeText){o(`error`,`Unable to copy screenshot path`,`Clipboard API unavailable.`);return}navigator.clipboard.writeText(e.path).then(()=>{r=!0,o(),window.setTimeout(()=>{r=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot path`,e instanceof Error?e.message:`An error occurred.`)})},c=()=>{n.copyArtifactToClipboard(e.path).then(()=>{i=!0,o(),window.setTimeout(()=>{i=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot`,e instanceof Error?e.message:`An error occurred.`)})};a=X.add(Y({type:`success`,title:`Screenshot saved`,actionProps:{children:`Copy image`,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:`Copy path`,onClick:s}}],secondaryActionProps:{...t},secondaryActionVariant:`outline`}}))},e=>{X.add({type:`error`,title:`Unable to capture screenshot`,description:e instanceof Error?e.message:`An error occurred.`})})},[T,w,S,t]),we=(0,Z.useCallback)(()=>{if(!L||!w)return;if(u.current){L.cancelPickElement(w).catch(()=>void 0);return}let e=typeof document<`u`?document.activeElement:null;u.current=!0,c(!0),(async()=>{try{let e=await L.pickElement(w);if(!e)return;h(t,e);let n=await _e(e);n&&e.screenshot&&g(t,{type:`image`,id:e.id,name:n.name,mimeType:n.type,sizeBytes:n.size,previewUrl:e.screenshot.dataUrl,file:n})}catch{}finally{if(u.current=!1,f.current&&c(!1),e&&e.isConnected&&typeof e.focus==`function`)try{e.focus({preventScroll:!0})}catch{}}})()},[g,h,w,t]);return(0,Z.useEffect)(()=>()=>{u.current&&(u.current=!1,L&&w&&L.cancelPickElement(w).catch(()=>void 0),f.current&&c(!1))},[w]),(0,Z.useEffect)(()=>{if(i)return H(e=>{switch(e){case`refresh`:G();return;case`focus-url`:o(e=>(e??0)+1);return;case`zoom-in`:ce();return;case`zoom-out`:le();return;case`reset-zoom`:q();return;case`toggle-panel`:return}})},[G,q,ce,le,i]),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,"data-thread-key":E(t),children:[(0,$.jsx)(qe,{url:A,displayUrl:ie,loading:j,loadProgress:R,canGoBack:te,canGoForward:M,refreshDisabled:N,focusUrlNonce:a,onBack:me,onForward:he,onRefresh:G,onSubmit:e=>void U(e),onOpenInBrowser:S?ge:void 0,onCapture:L&&S?Ce:void 0,captureDisabled:!O||F,recording:T!==null,onPictureInPicture:L&&S?ye:void 0,pictureInPicture:m?.tabId===S,pictureInPictureDisabled:!O?.hasWebContents||F,onPickElement:L&&S?we:void 0,pickActive:s,pickDisabled:!S||F,pickDisabledReason:F?`Page didn't load — pick unavailable until the page renders`:void 0,trailingActions:L?(0,$.jsx)(ot,{tabId:w,hasWebContents:O?.hasWebContents??!1,zoomFactor:O?.zoomFactor??1,colorScheme:O?.colorScheme??`system`,deviceToolbarVisible:ae._tag!==`fill`,onToggleDeviceToolbar:J,nativePictureInPicture:O?.pictureInPicture??!1,onNativePictureInPicture:xe}):null}),(0,$.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[w&&D&&!re?(0,$.jsx)(K,{tabId:w,visible:i&&!F,className:`absolute inset-0 h-full w-full`},w):null,re?(0,$.jsx)(it,{environmentId:t.environmentId,configuredUrls:r,recentlySeenUrls:p.recentlySeenUrls,onOpenUrl:e=>void W(e)}):null,D&&O?(0,$.jsx)(Nt,{zoomFactor:O.zoomFactor}):null,w&&O&&!re&&!F?(0,$.jsx)(It,{tabId:w,zoomFactor:O.zoomFactor,controller:I}):null,I===`none`?null:(0,$.jsx)(`div`,{className:`pointer-events-none absolute left-3 top-3 z-40 rounded-full border border-border/70 bg-background/90 px-2.5 py-1 text-[11px] font-medium shadow-sm backdrop-blur`,children:I===`agent`?`Agent controlling browser`:`Human control`}),k._tag===`LoadFailed`?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(gt,{url:k.url,code:k.code,description:k.description,onReload:G})}):null]})]})}function Bt(e){let t=(0,Q.c)(13),{mode:n,threadRef:r,tabId:i,configuredUrls:a,visible:o}=e;if(!q()){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:`Preview is only available in the P4Code desktop app.`})}),t[0]=e):e=t[0];let r;return t[1]===n?r=t[2]:(r=(0,$.jsx)(W,{mode:n,children:e}),t[1]=n,t[2]=r),r}let s;t[3]===i?s=t[4]:(s=i===void 0?{}:{tabId:i},t[3]=i,t[4]=s);let c;t[5]!==a||t[6]!==s||t[7]!==r||t[8]!==o?(c=(0,$.jsx)(zt,{threadRef:r,...s,configuredUrls:a,visible:o}),t[5]=a,t[6]=s,t[7]=r,t[8]=o,t[9]=c):c=t[9];let l;return t[10]!==n||t[11]!==c?(l=(0,$.jsx)(W,{mode:n,children:c}),t[10]=n,t[11]=c,t[12]=l):l=t[12],l}export{Bt as PreviewPanel};
2
- //# sourceMappingURL=PreviewPanel-BFuAVjo6.js.map
@@ -1,2 +0,0 @@
1
- import{os as e}from"./textarea-CbUaa52I.js";var t=e(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]);export{t};
2
- //# sourceMappingURL=arrow-right-SCFydakV.js.map