@bryanhu/codexly 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/CHANGELOG.md +34 -1
  2. package/dist/{chunk-AWQWQU2B.js → chunk-63TSFHXS.js} +429 -77
  3. package/dist/{chunk-TEPSAXZZ.js → chunk-6W2NSQP6.js} +1 -1
  4. package/dist/{chunk-2P25XCI6.js → chunk-I5XCZA2U.js} +191 -39
  5. package/dist/{chunk-MH54VCZJ.js → chunk-TGDKFWII.js} +60 -2
  6. package/dist/cli.js +5 -5
  7. package/dist/client/index.js +25 -3
  8. package/dist/protocol/index.js +1 -1
  9. package/dist/providers/codex/index.js +2 -2
  10. package/dist/server/index.js +4 -4
  11. package/dist/web/.vite/manifest.json +264 -257
  12. package/dist/web/.vite/manifest.json.br +0 -0
  13. package/dist/web/.vite/manifest.json.gz +0 -0
  14. package/dist/web/assets/button-SdoQawHa.js +1 -0
  15. package/dist/web/assets/button-SdoQawHa.js.br +0 -0
  16. package/dist/web/assets/button-SdoQawHa.js.gz +0 -0
  17. package/dist/web/assets/button-group-cIDkfDF9.js +1 -0
  18. package/dist/web/assets/button-group-cIDkfDF9.js.br +0 -0
  19. package/dist/web/assets/button-group-cIDkfDF9.js.gz +0 -0
  20. package/dist/web/assets/{checkbox-CCES4UbV.js → checkbox-BlpFo5_d.js} +1 -1
  21. package/dist/web/assets/checkbox-BlpFo5_d.js.br +0 -0
  22. package/dist/web/assets/{checkbox-CCES4UbV.js.gz → checkbox-BlpFo5_d.js.gz} +0 -0
  23. package/dist/web/assets/{chunk-BO2N2NFS-BWAdG1_E.js → chunk-BO2N2NFS-D3J36g1Z.js} +5 -5
  24. package/dist/web/assets/chunk-BO2N2NFS-D3J36g1Z.js.br +0 -0
  25. package/dist/web/assets/chunk-BO2N2NFS-D3J36g1Z.js.gz +0 -0
  26. package/dist/web/assets/{code-highlighter-CHF26Qu6.js → code-highlighter-Cl_7OKC4.js} +1 -1
  27. package/dist/web/assets/code-highlighter-Cl_7OKC4.js.br +0 -0
  28. package/dist/web/assets/code-highlighter-Cl_7OKC4.js.gz +0 -0
  29. package/dist/web/assets/code-languages-CoeGleQS.js +2 -0
  30. package/dist/web/assets/code-languages-CoeGleQS.js.br +0 -0
  31. package/dist/web/assets/code-languages-CoeGleQS.js.gz +0 -0
  32. package/dist/web/assets/cpp-DrC1WCyF.js +1 -0
  33. package/dist/web/assets/cpp-DrC1WCyF.js.br +0 -0
  34. package/dist/web/assets/cpp-DrC1WCyF.js.gz +0 -0
  35. package/dist/web/assets/cpp-DuI2J82L.js +1 -0
  36. package/dist/web/assets/cpp-DuI2J82L.js.br +0 -0
  37. package/dist/web/assets/cpp-DuI2J82L.js.gz +0 -0
  38. package/dist/web/assets/{engine-compile-DQ0HPfe0.js → engine-compile-Bqjaa_8Z.js} +14 -14
  39. package/dist/web/assets/engine-compile-Bqjaa_8Z.js.br +0 -0
  40. package/dist/web/assets/engine-compile-Bqjaa_8Z.js.gz +0 -0
  41. package/dist/web/assets/es2015-B-skuqay.js +41 -0
  42. package/dist/web/assets/es2015-B-skuqay.js.br +0 -0
  43. package/dist/web/assets/es2015-B-skuqay.js.gz +0 -0
  44. package/dist/web/assets/{file-CdvUKvsI.js → file-DwOQ4CRt.js} +1 -1
  45. package/dist/web/assets/file-DwOQ4CRt.js.br +0 -0
  46. package/dist/web/assets/file-DwOQ4CRt.js.gz +0 -0
  47. package/dist/web/assets/{file-review-dialog-D2A8VOae.js → file-review-dialog-BmXxZad1.js} +2 -2
  48. package/dist/web/assets/file-review-dialog-BmXxZad1.js.br +0 -0
  49. package/dist/web/assets/file-review-dialog-BmXxZad1.js.gz +0 -0
  50. package/dist/web/assets/{file-tree-AZsgAlZn.js → file-tree-Bl6o98td.js} +1 -1
  51. package/dist/web/assets/file-tree-Bl6o98td.js.br +0 -0
  52. package/dist/web/assets/file-tree-Bl6o98td.js.gz +0 -0
  53. package/dist/web/assets/{git-commit-horizontal-C0Tc8kLo.js → git-commit-horizontal-1BtAo1_y.js} +1 -1
  54. package/dist/web/assets/git-commit-horizontal-1BtAo1_y.js.br +0 -0
  55. package/dist/web/assets/git-commit-horizontal-1BtAo1_y.js.gz +0 -0
  56. package/dist/web/assets/{git-history-panel-CeJ0MXUi.js → git-history-panel-zXprGDsD.js} +2 -2
  57. package/dist/web/assets/git-history-panel-zXprGDsD.js.br +0 -0
  58. package/dist/web/assets/git-history-panel-zXprGDsD.js.gz +0 -0
  59. package/dist/web/assets/global-settings-dialog-CQK8OvfF.js +1 -0
  60. package/dist/web/assets/global-settings-dialog-CQK8OvfF.js.br +0 -0
  61. package/dist/web/assets/global-settings-dialog-CQK8OvfF.js.gz +0 -0
  62. package/dist/web/assets/grammar-cpp-support-CH6jZNJS.js +1 -0
  63. package/dist/web/assets/grammar-cpp-support-CH6jZNJS.js.br +0 -0
  64. package/dist/web/assets/grammar-cpp-support-CH6jZNJS.js.gz +0 -0
  65. package/dist/web/assets/{highlighted-body-OFNGDK62-CBB2e5gz.js → highlighted-body-OFNGDK62-DLuRF1Ir.js} +1 -1
  66. package/dist/web/assets/highlighted-body-OFNGDK62-DLuRF1Ir.js.br +0 -0
  67. package/dist/web/assets/highlighted-body-OFNGDK62-DLuRF1Ir.js.gz +0 -0
  68. package/dist/web/assets/index-BQDjXTIj.js +4 -0
  69. package/dist/web/assets/index-BQDjXTIj.js.br +0 -0
  70. package/dist/web/assets/index-BQDjXTIj.js.gz +0 -0
  71. package/dist/web/assets/index-Cg_JyLiC.css +2 -0
  72. package/dist/web/assets/index-Cg_JyLiC.css.br +0 -0
  73. package/dist/web/assets/index-Cg_JyLiC.css.gz +0 -0
  74. package/dist/web/assets/lazy-message-response-BAESsr6y.js +2 -0
  75. package/dist/web/assets/lazy-message-response-BAESsr6y.js.br +0 -0
  76. package/dist/web/assets/lazy-message-response-BAESsr6y.js.gz +0 -0
  77. package/dist/web/assets/mermaid-GHXKKRXX-D80VLkUl.js +1 -0
  78. package/dist/web/assets/mermaid-GHXKKRXX-D80VLkUl.js.br +0 -0
  79. package/dist/web/assets/mermaid-GHXKKRXX-D80VLkUl.js.gz +0 -0
  80. package/dist/web/assets/message-response-ll2GyVvz.js +7 -0
  81. package/dist/web/assets/message-response-ll2GyVvz.js.br +0 -0
  82. package/dist/web/assets/message-response-ll2GyVvz.js.gz +0 -0
  83. package/dist/web/assets/{patch-diff-viewer-BlbG4Z8Q.js → patch-diff-viewer-7Ar-plzV.js} +2 -2
  84. package/dist/web/assets/patch-diff-viewer-7Ar-plzV.js.br +0 -0
  85. package/dist/web/assets/patch-diff-viewer-7Ar-plzV.js.gz +0 -0
  86. package/dist/web/assets/{perl-Br95gH8g.js → perl-C4NAnH_t.js} +1 -1
  87. package/dist/web/assets/perl-C4NAnH_t.js.br +0 -0
  88. package/dist/web/assets/{perl-Br95gH8g.js.gz → perl-C4NAnH_t.js.gz} +0 -0
  89. package/dist/web/assets/{php-CYrBA5iX.js → php-CQT4wx5i.js} +1 -1
  90. package/dist/web/assets/php-CQT4wx5i.js.br +0 -0
  91. package/dist/web/assets/{php-CYrBA5iX.js.gz → php-CQT4wx5i.js.gz} +0 -0
  92. package/dist/web/assets/prompt-input-controls-t69FYoWk.js +1 -0
  93. package/dist/web/assets/prompt-input-controls-t69FYoWk.js.br +0 -0
  94. package/dist/web/assets/prompt-input-controls-t69FYoWk.js.gz +0 -0
  95. package/dist/web/assets/{provider-connection-queries-bzb4TYim.js → provider-connection-queries-BKyJMJn1.js} +1 -1
  96. package/dist/web/assets/provider-connection-queries-BKyJMJn1.js.br +0 -0
  97. package/dist/web/assets/provider-connection-queries-BKyJMJn1.js.gz +0 -0
  98. package/dist/web/assets/{ruby-CbXu8Ywv.js → ruby-Oh3ZbUP2.js} +1 -1
  99. package/dist/web/assets/ruby-Oh3ZbUP2.js.br +0 -0
  100. package/dist/web/assets/ruby-Oh3ZbUP2.js.gz +0 -0
  101. package/dist/web/assets/{shiki-bundle-BndEhlUP.js → shiki-bundle-UDLEjOL9.js} +1 -1
  102. package/dist/web/assets/shiki-bundle-UDLEjOL9.js.br +0 -0
  103. package/dist/web/assets/shiki-bundle-UDLEjOL9.js.gz +0 -0
  104. package/dist/web/assets/swift-CyEgAFGc.js +1 -0
  105. package/dist/web/assets/swift-CyEgAFGc.js.br +0 -0
  106. package/dist/web/assets/swift-CyEgAFGc.js.gz +0 -0
  107. package/dist/web/assets/upload-Bbk2LEzM.js +1 -0
  108. package/dist/web/assets/upload-Bbk2LEzM.js.br +0 -0
  109. package/dist/web/assets/upload-Bbk2LEzM.js.gz +0 -0
  110. package/dist/web/assets/{vue-BpAUjojh.js → vue-BcFuTOIy.js} +1 -1
  111. package/dist/web/assets/vue-BcFuTOIy.js.br +0 -0
  112. package/dist/web/assets/vue-BcFuTOIy.js.gz +0 -0
  113. package/dist/web/assets/workbench-inspector-changes-CumCxeA7.js +1 -0
  114. package/dist/web/assets/workbench-inspector-changes-CumCxeA7.js.br +0 -0
  115. package/dist/web/assets/workbench-inspector-changes-CumCxeA7.js.gz +0 -0
  116. package/dist/web/assets/workbench-shell-D21PPmmO.js +13 -0
  117. package/dist/web/assets/workbench-shell-D21PPmmO.js.br +0 -0
  118. package/dist/web/assets/workbench-shell-D21PPmmO.js.gz +0 -0
  119. package/dist/web/index.html +8 -8
  120. package/dist/web/index.html.br +0 -0
  121. package/dist/web/index.html.gz +0 -0
  122. package/package.json +7 -10
  123. package/dist/web/assets/button-DPWbWvQN.js +0 -1
  124. package/dist/web/assets/button-DPWbWvQN.js.br +0 -0
  125. package/dist/web/assets/button-DPWbWvQN.js.gz +0 -0
  126. package/dist/web/assets/button-group-CvflSgg8.js +0 -1
  127. package/dist/web/assets/button-group-CvflSgg8.js.br +0 -0
  128. package/dist/web/assets/button-group-CvflSgg8.js.gz +0 -0
  129. package/dist/web/assets/checkbox-CCES4UbV.js.br +0 -0
  130. package/dist/web/assets/chunk-BO2N2NFS-BWAdG1_E.js.br +0 -0
  131. package/dist/web/assets/chunk-BO2N2NFS-BWAdG1_E.js.gz +0 -0
  132. package/dist/web/assets/code-highlighter-CHF26Qu6.js.br +0 -0
  133. package/dist/web/assets/code-highlighter-CHF26Qu6.js.gz +0 -0
  134. package/dist/web/assets/code-languages-0g9buMoI.js +0 -2
  135. package/dist/web/assets/code-languages-0g9buMoI.js.br +0 -0
  136. package/dist/web/assets/code-languages-0g9buMoI.js.gz +0 -0
  137. package/dist/web/assets/cpp-BcHBJY00.js +0 -1
  138. package/dist/web/assets/cpp-BcHBJY00.js.br +0 -0
  139. package/dist/web/assets/cpp-BcHBJY00.js.gz +0 -0
  140. package/dist/web/assets/cpp-CIkEvbIe.js +0 -1
  141. package/dist/web/assets/cpp-CIkEvbIe.js.br +0 -0
  142. package/dist/web/assets/cpp-CIkEvbIe.js.gz +0 -0
  143. package/dist/web/assets/engine-compile-DQ0HPfe0.js.br +0 -0
  144. package/dist/web/assets/engine-compile-DQ0HPfe0.js.gz +0 -0
  145. package/dist/web/assets/es2015-DsWAjMth.js +0 -41
  146. package/dist/web/assets/es2015-DsWAjMth.js.br +0 -0
  147. package/dist/web/assets/es2015-DsWAjMth.js.gz +0 -0
  148. package/dist/web/assets/file-CdvUKvsI.js.br +0 -0
  149. package/dist/web/assets/file-CdvUKvsI.js.gz +0 -0
  150. package/dist/web/assets/file-review-dialog-D2A8VOae.js.br +0 -0
  151. package/dist/web/assets/file-review-dialog-D2A8VOae.js.gz +0 -0
  152. package/dist/web/assets/file-tree-AZsgAlZn.js.br +0 -0
  153. package/dist/web/assets/file-tree-AZsgAlZn.js.gz +0 -0
  154. package/dist/web/assets/git-commit-horizontal-C0Tc8kLo.js.br +0 -0
  155. package/dist/web/assets/git-commit-horizontal-C0Tc8kLo.js.gz +0 -0
  156. package/dist/web/assets/git-history-panel-CeJ0MXUi.js.br +0 -0
  157. package/dist/web/assets/git-history-panel-CeJ0MXUi.js.gz +0 -0
  158. package/dist/web/assets/global-settings-dialog-BdOP1wS8.js +0 -1
  159. package/dist/web/assets/global-settings-dialog-BdOP1wS8.js.br +0 -0
  160. package/dist/web/assets/global-settings-dialog-BdOP1wS8.js.gz +0 -0
  161. package/dist/web/assets/grammar-cpp-support-CV8oNpIY.js +0 -1
  162. package/dist/web/assets/grammar-cpp-support-CV8oNpIY.js.br +0 -0
  163. package/dist/web/assets/grammar-cpp-support-CV8oNpIY.js.gz +0 -0
  164. package/dist/web/assets/highlighted-body-OFNGDK62-CBB2e5gz.js.br +0 -0
  165. package/dist/web/assets/highlighted-body-OFNGDK62-CBB2e5gz.js.gz +0 -0
  166. package/dist/web/assets/index-BoX8xH2D.css +0 -2
  167. package/dist/web/assets/index-BoX8xH2D.css.br +0 -0
  168. package/dist/web/assets/index-BoX8xH2D.css.gz +0 -0
  169. package/dist/web/assets/index-CoRYl0EO.js +0 -4
  170. package/dist/web/assets/index-CoRYl0EO.js.br +0 -0
  171. package/dist/web/assets/index-CoRYl0EO.js.gz +0 -0
  172. package/dist/web/assets/lazy-message-response-Be__rdOq.js +0 -2
  173. package/dist/web/assets/lazy-message-response-Be__rdOq.js.br +0 -0
  174. package/dist/web/assets/lazy-message-response-Be__rdOq.js.gz +0 -0
  175. package/dist/web/assets/mermaid-GHXKKRXX-C4HZuN1f.js +0 -1
  176. package/dist/web/assets/mermaid-GHXKKRXX-C4HZuN1f.js.br +0 -0
  177. package/dist/web/assets/mermaid-GHXKKRXX-C4HZuN1f.js.gz +0 -0
  178. package/dist/web/assets/message-response-UwCHtKG1.js +0 -7
  179. package/dist/web/assets/message-response-UwCHtKG1.js.br +0 -0
  180. package/dist/web/assets/message-response-UwCHtKG1.js.gz +0 -0
  181. package/dist/web/assets/patch-diff-viewer-BlbG4Z8Q.js.br +0 -0
  182. package/dist/web/assets/patch-diff-viewer-BlbG4Z8Q.js.gz +0 -0
  183. package/dist/web/assets/perl-Br95gH8g.js.br +0 -0
  184. package/dist/web/assets/php-CYrBA5iX.js.br +0 -0
  185. package/dist/web/assets/prompt-input-controls-DRwTXxuF.js +0 -1
  186. package/dist/web/assets/prompt-input-controls-DRwTXxuF.js.br +0 -0
  187. package/dist/web/assets/prompt-input-controls-DRwTXxuF.js.gz +0 -0
  188. package/dist/web/assets/provider-connection-queries-bzb4TYim.js.br +0 -0
  189. package/dist/web/assets/provider-connection-queries-bzb4TYim.js.gz +0 -0
  190. package/dist/web/assets/ruby-CbXu8Ywv.js.br +0 -0
  191. package/dist/web/assets/ruby-CbXu8Ywv.js.gz +0 -0
  192. package/dist/web/assets/shiki-bundle-BndEhlUP.js.br +0 -0
  193. package/dist/web/assets/shiki-bundle-BndEhlUP.js.gz +0 -0
  194. package/dist/web/assets/swift-DonLKvLd.js +0 -1
  195. package/dist/web/assets/swift-DonLKvLd.js.br +0 -0
  196. package/dist/web/assets/swift-DonLKvLd.js.gz +0 -0
  197. package/dist/web/assets/vue-BpAUjojh.js.br +0 -0
  198. package/dist/web/assets/vue-BpAUjojh.js.gz +0 -0
  199. package/dist/web/assets/workbench-inspector-changes-8ZkoC9AD.js +0 -1
  200. package/dist/web/assets/workbench-inspector-changes-8ZkoC9AD.js.br +0 -0
  201. package/dist/web/assets/workbench-inspector-changes-8ZkoC9AD.js.gz +0 -0
  202. package/dist/web/assets/workbench-shell-BLSbA9u6.js +0 -13
  203. package/dist/web/assets/workbench-shell-BLSbA9u6.js.br +0 -0
  204. package/dist/web/assets/workbench-shell-BLSbA9u6.js.gz +0 -0
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/message-response-UwCHtKG1.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CVaUQXZF.js","assets/button-DPWbWvQN.js","assets/bundle-mjs-rHxsej31.js","assets/file-CdvUKvsI.js","assets/index-CoRYl0EO.js","assets/es2015-DsWAjMth.js","assets/checkbox-CCES4UbV.js","assets/file-tree-AZsgAlZn.js","assets/provider-connection-queries-bzb4TYim.js","assets/index-BoX8xH2D.css","assets/chunk-BO2N2NFS-BWAdG1_E.js","assets/lib-DrPFkMXk.js","assets/prompt-reference-token-Cxx6C-IR.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CVaUQXZF.js";import{s as r,u as i}from"./button-DPWbWvQN.js";import{L as a}from"./es2015-DsWAjMth.js";import{m as o}from"./prompt-input-controls-DRwTXxuF.js";import{lt as s}from"./index-CoRYl0EO.js";var c=r(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),l=r(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),u=r(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),d=e(t(),1),f=n();function p(e,t,n){let r=0;for(let i=0;i<e.length;){let a=e.codePointAt(i);if(a===void 0)break;if(i+=a>65535?2:1,r+=1,r>t)return new File([e],n,{type:`text/plain`})}}function m(e,t){return t===void 0||t.trim()===``||t.split(`,`).some(t=>{let n=t.trim();return n.startsWith(`.`)?e.name.toLowerCase().endsWith(n.toLowerCase()):n.endsWith(`/*`)?e.type.startsWith(n.slice(0,-1)):e.type===n})}function h(e){e.previewUrl.startsWith(`blob:`)&&URL.revokeObjectURL(e.previewUrl)}function g({attachments:e,children:t,className:n=``,disabled:r=!1,fileAccept:s,globalDrop:c=!1,imageAccept:l,largePasteCharacterThreshold:u=1/0,maxFileTotalSize:g=1/0,maxFileSize:_=1/0,maxImageSize:v=1/0,maxImages:y=1/0,maxImageTotalSize:b=1/0,multiple:x=!1,onAttachmentsChange:S,onError:C,onPaste:w,onPasteCapture:T,onSubmit:E,pastedTextFileName:D=`Pasted text.txt`,resetKey:O,...k}){let{t:A}=i(`conversation`),[j,M]=(0,d.useState)([]),N=e??j,P=(0,d.useRef)(N),F=(0,d.useRef)(e!==void 0),I=(0,d.useRef)(O);P.current=N,F.current=e!==void 0;let L=(0,d.useCallback)(t=>{if(e!==void 0){S?.(t(e));return}M(e=>[...t(e)])},[e,S]),R=(0,d.useCallback)((e,t=!1)=>{L(n=>{if(r)return n;let i=[],o=n.filter(e=>e.kind===`image`).length,c=n.reduce((e,t)=>e+(t.kind===`image`?t.size:0),0),u=n.reduce((e,t)=>e+(t.kind===`image`?0:t.size),0);for(let n of e){let e=t?`text`:m(n,l)?`image`:`file`;if(!(e===`text`||(e===`image`?m(n,l):m(n,s)))){C?.({code:`invalid_file_type`,message:A(`agentComponents.invalidFileType`,{name:n.name})});continue}if(e!==`image`&&n.size>_){C?.({code:`file_too_large`,message:A(`agentComponents.fileTooLarge`,{name:n.name})});continue}if(e===`image`&&n.size>v){C?.({code:`file_too_large`,message:A(`agentComponents.fileTooLarge`,{name:n.name})});continue}if(e===`image`&&o>=y){C?.({code:`too_many_images`,message:A(`agentComponents.tooManyImages`,{count:y})});continue}if(e===`image`&&c+n.size>b){C?.({code:`total_size_exceeded`,message:A(`agentComponents.totalImageSizeExceeded`)});continue}if(e!==`image`&&u+n.size>g){C?.({code:`total_size_exceeded`,message:A(`agentComponents.totalAttachmentSizeExceeded`)});continue}if(i.push({file:n,id:a(),kind:e,mediaType:n.type,name:n.name,previewUrl:URL.createObjectURL(n),size:n.size,source:`browser`}),e===`image`?(o+=1,c+=n.size):u+=n.size,!x)break}return[...n,...i]})},[r,s,l,_,g,v,y,b,x,C,A,L]),z=(0,d.useCallback)(()=>{L(e=>(e.forEach(h),[]))},[L]);(0,d.useLayoutEffect)(()=>{I.current!==O&&(I.current=O,e===void 0&&z())},[e,z,O]);let B=(0,d.useCallback)(e=>{L(t=>{let n=t.find(t=>t.id===e);return n!==void 0&&h(n),t.filter(t=>t.id!==e)})},[L]);(0,d.useEffect)(()=>()=>{F.current||P.current.forEach(h)},[]),(0,d.useEffect)(()=>{e===void 0&&S?.(j)},[e,j,S]),(0,d.useEffect)(()=>{if(!c||r)return;let e=e=>{e.dataTransfer?.types.includes(`Files`)===!0&&e.preventDefault()},t=e=>{e.dataTransfer?.files.length&&(e.preventDefault(),R([...e.dataTransfer.files]))};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[R,r,c]);let V=(0,d.useMemo)(()=>({clear:z,disabled:r,files:N,remove:B}),[z,r,N,B]);return(0,f.jsx)(o.Provider,{value:V,children:(0,f.jsx)(`form`,{...k,className:`overflow-visible rounded-surface border border-transparent bg-raised shadow-floating transition-[border-color,box-shadow] focus-within:border-brand focus-within:shadow-focus ${n}`,"data-prompt-input":``,onPasteCapture:e=>{if(T?.(e),r||e.defaultPrevented||e.clipboardData.files.length>0)return;let t=p(e.clipboardData.getData(`text/plain`),u,D);t!==void 0&&(e.preventDefault(),R([t],!0))},onPaste:e=>{if(w?.(e),r||e.defaultPrevented)return;let t=[...e.clipboardData.files];t.length>0&&(e.preventDefault(),R(t))},onSubmit:e=>{e.preventDefault();let t=new FormData(e.currentTarget).get(`message`);E?.({files:N,text:typeof t==`string`?t:``},e)},children:t})})}function _(e){return e.approvalPolicy===`never`?`never`:e.approvalPolicy===`on-request`&&e.approvalsReviewer===`auto_review`?`auto-review`:`on-request`}function v(e,t){return t===`auto-review`?{...e,approvalPolicy:`on-request`,approvalsReviewer:`auto_review`}:{...e,approvalPolicy:t,approvalsReviewer:`user`}}function y(){return s(()=>import(`./message-response-UwCHtKG1.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))}var b=(0,d.lazy)(y);function x({children:e=``,className:t=``,...n}){return(0,f.jsx)(d.Suspense,{fallback:(0,f.jsx)(`div`,{className:`size-full whitespace-pre-wrap break-words ${t}`,children:(0,f.jsx)(`p`,{children:e})}),children:(0,f.jsx)(b,{className:t,...n,children:e})})}export{u as a,g as i,v as n,l as o,_ as r,c as s,x as t};
@@ -1 +0,0 @@
1
- import{s as e}from"./chunk-BO2N2NFS-BWAdG1_E.js";export{e as Mermaid};
@@ -1,7 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CVaUQXZF.js";import{t as i,u as a}from"./button-DPWbWvQN.js";import{t as o}from"./file-CdvUKvsI.js";import{tt as s}from"./index-CoRYl0EO.js";import{a as c,i as l,o as u,r as d}from"./chunk-BO2N2NFS-BWAdG1_E.js";import{t as f}from"./prompt-reference-token-Cxx6C-IR.js";var p=e(t(),1),m=e(n(),1),h=r(),g=/^::code-comment\{(.*)\}\s*$/,_=/([a-z]+)=(?:"((?:\\.|[^"\\])*)"|(\d+))/g,v=[`/apps/`,`/packages/`,`/src/`,`/tests/`,`/.superwork/`],y=8,b=12;function x(e){try{return JSON.parse(`"${e}"`)}catch{return e}}function S(e){let t=new Map;for(let n of e.matchAll(_)){let e=n[1],r=n[2],i=n[3];e!==void 0&&t.set(e,r===void 0?i??``:x(r))}let n=t.get(`body`),r=t.get(`file`),i=t.get(`title`);if(n===void 0||r===void 0||i===void 0)return null;let a=e=>{let n=t.get(e);return n===void 0?null:Number.parseInt(n,10)};return{body:n,end:a(`end`),file:r,priority:a(`priority`),start:a(`start`),title:i}}function C(e){let t=g.exec(e)?.[1];return t===void 0?null:S(t)}function w(e){for(let t of v){let n=e.indexOf(t);if(n>=0)return e.slice(n+1)}return e.split(/[\\/]/).at(-1)??e}function ee(e){let t=w(e.file);return e.start===null?t:`${t}:${e.end===null||e.end===e.start?String(e.start):`${String(e.start)}-${String(e.end)}`}`}function T(e){return e.replace(/^\[P\d+\]\s*/,``)}function E({comment:e,commentIndex:t}){let n=(0,p.useRef)(null),r=(0,p.useRef)(null),i=(0,p.useId)(),[a,o]=(0,p.useState)(!1),[s,c]=(0,p.useState)(),l=T(e.title),u=ee(e),f=(0,p.useCallback)(()=>{let e=n.current,t=r.current;if(e===null||t===null)return;let i=e.getBoundingClientRect(),a=t.getBoundingClientRect(),o=Math.max(b,window.innerWidth-a.width-b),s=Math.min(Math.max(i.left,b),o),l=i.bottom+y+a.height<=window.innerHeight-b?i.bottom+y:i.top-a.height-y,u=Math.max(b,window.innerHeight-a.height-b);c({left:s,top:Math.min(Math.max(l,b),u)})},[]);return(0,p.useLayoutEffect)(()=>{if(!a){c(void 0);return}return f(),window.addEventListener(`resize`,f),window.addEventListener(`scroll`,f,!0),()=>{window.removeEventListener(`resize`,f),window.removeEventListener(`scroll`,f,!0)}},[a,f]),(0,h.jsxs)(`li`,{"aria-describedby":a?i:void 0,className:`flex min-w-0 cursor-pointer items-center gap-3 rounded-control px-1 py-2 text-body-small transition-colors hover:bg-control-hover focus-visible:bg-control-hover`,onBlur:()=>{o(!1)},onFocus:()=>{o(!0)},onMouseEnter:()=>{o(!0)},onMouseLeave:()=>{o(!1)},ref:n,tabIndex:0,children:[(0,h.jsx)(`span`,{className:`shrink-0 rounded-control border border-separator-strong px-1.5 py-0.5 text-label text-muted-foreground`,children:e.priority===null?`--`:`P${String(e.priority)}`}),(0,h.jsx)(`span`,{className:`min-w-0 shrink font-semibold text-foreground`,children:l}),(0,h.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:u}),a&&typeof document<`u`?(0,m.createPortal)((0,h.jsxs)(`div`,{className:`pointer-events-none fixed z-50 w-[min(28rem,calc(100vw-1.5rem))] rounded-surface border border-separator-strong bg-raised p-3 text-left shadow-floating`,id:i,ref:r,role:`tooltip`,style:s===void 0?{left:0,top:0,visibility:`hidden`}:{left:s.left,top:s.top},children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`rounded-control border border-separator-strong px-1.5 py-0.5 text-label text-muted-foreground`,children:e.priority===null?`--`:`P${String(e.priority)}`}),(0,h.jsx)(`p`,{className:`font-semibold text-foreground`,children:l})]}),(0,h.jsx)(`p`,{className:`mt-2 break-all font-mono text-meta text-muted-foreground`,children:u}),(0,h.jsx)(d,{className:`mt-2 text-body-small leading-5 text-foreground [&_a]:text-brand [&_a]:underline [&_a]:underline-offset-2 [&_code]:font-mono [&_code]:text-body-small [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,controls:!1,children:e.body})]}),document.body):null]},`${e.file}:${String(e.start)}:${String(t)}`)}function D({comments:e}){let{t}=a(`conversation`);return e.length===0?null:(0,h.jsxs)(`section`,{"aria-label":t(`agentComponents.codeComments`,{count:e.length}),className:`my-4 overflow-hidden rounded-surface border border-separator-strong bg-raised`,"data-code-comments":`true`,children:[(0,h.jsxs)(`header`,{className:`flex min-h-12 items-center gap-3 border-b border-separator px-4 text-body font-semibold`,children:[(0,h.jsx)(`span`,{className:`grid size-8 place-items-center rounded-control bg-control`,children:(0,h.jsx)(s,{className:`size-4 text-muted-foreground`,"aria-hidden":`true`})}),(0,h.jsx)(`span`,{children:t(`agentComponents.codeComments`,{count:e.length})})]}),(0,h.jsx)(`ol`,{className:`divide-y divide-separator px-4 py-1`,children:e.map((e,t)=>(0,h.jsx)(E,{comment:e,commentIndex:t},`${e.file}:${String(e.start)}:${String(t)}`))})]})}var O=/(?<=\]\()(?:[a-z]:[\\/]|\\\\)[^)\r\n]+?\.[a-z0-9]+(?::\d+(?::\d+)?)?(?=\))/gi,k=/(?<=\]\()(?![a-z][a-z0-9+.-]*:|\/|#)[^)\r\n]+?\.[a-z0-9]+(?::\d+(?::\d+)?)?(?=\))/gi,A=/(?<=\]\()\/(?!\/)[^)\r\n]+?\.[a-z0-9]+(?::\d+(?::\d+)?)?(?=\))/gi,j=/\s+|\S+/gu,M=/^\s+$/u,N=/\n{3,}/g,P=/\[\^[\w-]{1,200}\](?!:)/,F=/\[\^[\w-]{1,200}\]:/,I=`/__codexly_unc__/`,L=`/__codexly_relative__/`;function R(e){return e.replace(O,e=>{let t=e.replaceAll(`\\`,`/`);return/^[a-z]:/i.test(t)?`/${t}`:`${I}${t.slice(2)}`}).replace(k,e=>`${L}${e}`).replace(A,e=>e.replaceAll(` `,`%20`).replaceAll(` `,`%09`))}var z=class e{output;trailingWhitespace;constructor(e=``,t=``){this.output=e,this.trailingWhitespace=t}append(e){let t=[],n=this.output.length>0;for(let r of e.matchAll(j)){let e=r[0];if(M.test(e)){this.trailingWhitespace+=e;continue}n&&this.trailingWhitespace.length>0&&t.push(this.trailingWhitespace.replace(N,`
2
-
3
- `)),this.trailingWhitespace=``,t.push(e),n=!0}t.length>0&&(this.output+=t.join(``))}clone(){return new e(this.output,this.trailingWhitespace)}materialize(){return this.output}};function B(e,t,n){let r=C(e);return r===null?n.discardBlankLines&&e.trim().length===0?!0:(n.whitespace.append(`${R(e)}${t?`
4
- `:``}`),!1):(n.comments.push(r),t&&n.whitespace.append(`
5
- `),!0)}var V=class{cachedResult={comments:[],markdown:``};committedComments=[];discardBlankLines=!1;pendingLine=``;previousSource=``;whitespace=new z;process(e){if(e===this.previousSource)return this.cachedResult;e.startsWith(this.previousSource)||this.reset(),this.pendingLine+=e.slice(this.previousSource.length),this.previousSource=e;let t=this.pendingLine.indexOf(`
6
- `);for(;t>=0;){let e=this.pendingLine.slice(0,t);this.pendingLine=this.pendingLine.slice(t+1),this.discardBlankLines=B(e,!0,{comments:this.committedComments,discardBlankLines:this.discardBlankLines,whitespace:this.whitespace}),t=this.pendingLine.indexOf(`
7
- `)}let n=[...this.committedComments],r=this.whitespace.clone();return this.pendingLine.length>0&&B(this.pendingLine,!1,{comments:n,discardBlankLines:this.discardBlankLines,whitespace:r}),this.cachedResult={comments:n,markdown:r.materialize()},this.cachedResult}reset(){this.cachedResult={comments:[],markdown:``},this.committedComments=[],this.discardBlankLines=!1,this.pendingLine=``,this.previousSource=``,this.whitespace=new z}};function H(e=u){let t=[],n=``;return r=>{if(r===n)return t;let i=0,a=Math.min(n.length,r.length);for(;i<a&&n.charCodeAt(i)===r.charCodeAt(i);)i+=1;let o=0,s=0;for(;o<t.length&&s+(t[o]?.length??0)<=i;)s+=t[o]?.length??0,o+=1;o>0&&(--o,s-=t[o]?.length??0);let c=r.slice(s);return t=P.test(c)||F.test(c)?[r]:[...t.slice(0,o),...e(c)],n=r,t}}var U=(0,p.createContext)(null),W=/^(?<path>(?:\/|[a-z]:[\\/]|\\\\).+?\.[a-z0-9]+?)(?::(?<line>\d+)(?::\d+)?)?$/i,G=`/__codexly_prompt_reference__/`,K=/(^|\s)@(?<path>[^\s,!?;:,。!?;:、()[\]{}"'`]+)(?=$|\s|[,!?;:,。!?;:、()[\]{}"'`])/gu,q={code:{copy:!0,download:!1},mermaid:!1,table:!1};function J(e){try{return decodeURIComponent(e)}catch{return e}}function Y(e){if(e===void 0)return null;let t=J(e);if(t.startsWith(G))return{lineNumber:null,path:t.slice(30),prompt:!0};let n=W.exec(t)?.groups;if(n===void 0)return null;let r=n.path,i=r?.startsWith(`/__codexly_unc__/`)?`//${r.slice(I.length)}`:r?.startsWith(`/__codexly_relative__/`)?r.slice(L.length):r?.match(/^\/[a-z]:[\\/]/i)?r.slice(1):r;return i===void 0?null:{lineNumber:n.line??null,path:i,prompt:!1}}function X(e){let t=[],n=0;for(let r of e.matchAll(K)){let i=r.groups?.path;if(i===void 0)continue;let a=r.index+(r[1]?.length??0);a>n&&t.push({type:`text`,value:e.slice(n,a)}),t.push({children:[{type:`text`,value:i.split(`/`).at(-1)??i}],type:`link`,url:`${G}${encodeURIComponent(i)}`}),n=a+i.length+1}return n<e.length&&t.push({type:`text`,value:e.slice(n)}),t}function Z(){return e=>{let t=e=>{e.type===`link`||e.type===`linkReference`||e.children===void 0||(e.children=e.children.flatMap(e=>e.type===`text`&&e.value!==void 0?X(e.value):(t(e),e)))};t(e)}}function Q(){return e=>{let t=(e,n)=>{if(e.type===`html`){e.type=n===`paragraph`?`inlineCode`:`code`,e.type===`code`&&(e.lang=`xml`);return}for(let n of e.children??[])t(n,e.type)};t(e)}}function te({children:e,className:t=``,href:n,node:r,...a}){let s=Y(n),c=(0,p.useContext)(U);if(s!==null){if(s.prompt){let n=`${f} relative top-0.5 select-none ${t}`,r=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(o,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,h.jsx)(`span`,{className:`truncate`,children:e})]});return c===null?(0,h.jsx)(`span`,{className:n,"data-prompt-file-reference":s.path,title:s.path,children:r}):(0,h.jsx)(i,{variant:`embedded`,"aria-label":`@${s.path}`,className:`${n} cursor-pointer hover:bg-control-hover`,"data-prompt-file-reference":s.path,onClick:()=>{c({lineNumber:null,path:s.path})},size:`embedded`,title:s.path,type:`button`,children:r})}let n=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`span`,{children:e}),s.lineNumber===null?null:(0,h.jsx)(`span`,{className:`markdown-file-reference__line`,children:`(line ${s.lineNumber})`})]});return c===null?(0,h.jsx)(`span`,{className:`markdown-file-reference text-brand ${t}`,"data-file-reference":`true`,title:s.path,children:n}):(0,h.jsx)(i,{variant:`ghost`,className:`markdown-file-reference cursor-pointer text-brand underline decoration-transparent underline-offset-2 transition-colors hover:text-brand-strong hover:decoration-current ${t}`,"data-file-reference":`true`,onClick:()=>{c({lineNumber:s.lineNumber===null?null:Number(s.lineNumber),path:s.path})},title:s.path,type:`button`,children:n})}return(0,h.jsx)(`a`,{className:`font-medium text-brand underline decoration-current/35 underline-offset-2 transition-colors hover:text-brand-strong ${t}`,href:n,rel:`noopener noreferrer`,target:`_blank`,...a,children:e})}function ne(e){let t=(0,p.useContext)(l),n=(0,p.useMemo)(()=>({...t,isAnimating:!1}),[t]);return(0,h.jsx)(l.Provider,{value:n,children:(0,h.jsx)(c,{...e})})}function re({children:e,className:t=``,components:n,onOpenFileReference:r,parseMarkdownIntoBlocksFn:i,promptFileReferences:a=!1,remarkPlugins:o,...s}){let c=(0,p.useMemo)(()=>new V,[]),l=(0,p.useMemo)(()=>H(),[]),u=c.process(e??``),f=(0,p.useMemo)(()=>({...n,a:te}),[n]),m=(0,p.useMemo)(()=>[Q,...a?[Z]:[],...o??[]],[a,o]);return(0,h.jsxs)(U.Provider,{value:r??null,children:[(0,h.jsx)(d,{className:`size-full break-words [&_blockquote]:border-l-2 [&_blockquote]:border-separator [&_blockquote]:pl-3 [&_code]:font-mono [&_code]:text-body-small [&_h1]:text-xl [&_h1]:font-semibold [&_h2]:text-lg [&_h2]:font-semibold [&_h3]:font-semibold [&_img]:block [&_img]:h-auto [&_img]:max-w-full [&_img]:object-contain [&_pre]:overflow-x-auto [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 ${t}`,controls:q,...s,BlockComponent:ne,components:f,parseMarkdownIntoBlocksFn:i??l,remarkPlugins:m,children:u.markdown}),(0,h.jsx)(D,{comments:u.comments})]})}var $=(0,p.memo)(re,(e,t)=>e.children===t.children&&e.isAnimating===t.isAnimating&&e.mode===t.mode&&e.onOpenFileReference===t.onOpenFileReference&&e.promptFileReferences===t.promptFileReferences);$.displayName=`MessageResponse`;export{$ as MessageResponse,$ as default};
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CVaUQXZF.js";import{s as r,t as i,u as a}from"./button-DPWbWvQN.js";import{D as o}from"./es2015-DsWAjMth.js";import{i as s,n as c}from"./checkbox-CCES4UbV.js";var l=r(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),u=r(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),d=r(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),f=r(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),p=e(t(),1);function m(e){return e.isComposing||e.keyCode===229}function h(e){return e.key===`Enter`&&(e.shiftKey||e.metaKey||e.ctrlKey)}var g=(0,p.createContext)(void 0);function _(){let e=(0,p.useContext)(g);if(e===void 0)throw Error(`usePromptInputAttachments must be used inside PromptInput`);return e}var v=n();function y({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`overflow-hidden rounded-surface border border-separator-strong bg-raised shadow-floating ${e}`,"data-prompt-input-command":``,role:`listbox`,...t})}function b({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`max-h-96 overflow-y-auto p-1 ${e}`,"data-prompt-input-command-list":``,...t})}function x({children:e,className:t=``,label:n,...r}){return(0,v.jsxs)(`div`,{"aria-label":n,className:t,role:`group`,...r,children:[(0,v.jsx)(`div`,{className:`px-2 py-1.5 text-caption font-medium text-muted-foreground`,children:n}),e]})}function S({active:e=!1,className:t=``,onMouseDown:n,selected:r=!1,type:a=`button`,...o}){let s=(0,p.useRef)(null);return(0,p.useEffect)(()=>{e&&s.current?.scrollIntoView({block:`nearest`})},[e]),(0,v.jsx)(i,{variant:`ghost`,"aria-selected":r,className:`flex h-auto min-h-8 w-full items-center gap-2 whitespace-normal rounded-control px-2 py-2 text-left text-body-small text-foreground transition-colors hover:bg-control-hover disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent ${e?`bg-control-active`:``} ${t}`,"data-active":e||void 0,onMouseDown:e=>{e.preventDefault(),n?.(e)},ref:s,role:`option`,type:a,...o})}function C({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`px-3 py-5 text-center text-body-small text-muted-foreground ${e}`,role:`status`,...t})}function w({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`px-3 pt-2 ${e}`,...t})}function T({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`px-3 pt-2 ${e}`,...t})}function E({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`flex min-h-10 items-center justify-between gap-2 px-2 pb-2 ${e}`,...t})}function D({className:e=``,...t}){return(0,v.jsx)(`div`,{className:`flex min-w-0 items-center gap-1 ${e}`,...t})}(0,p.forwardRef)(function({className:e=``,name:t=`message`,onKeyDown:n,rows:r=2,...i},a){return(0,v.jsx)(`textarea`,{className:`max-h-40 min-h-12 w-full resize-none bg-transparent px-1 py-1 text-sm leading-5 text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed ${e}`,name:t,onKeyDown:e=>{n?.(e),!e.defaultPrevented&&e.key===`Enter`&&!h(e)&&!m(e.nativeEvent)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},ref:a,rows:r,...i})});function O({children:e,label:t,onClick:n,onSelectKind:r,...o}){let s=_(),{t:c}=a(`conversation`),[f,m]=(0,p.useState)(!1),h=(0,p.useRef)(null),g=o.disabled===!0||s.disabled,y=t??c(`agentComponents.addImageOrFile`);return(0,p.useEffect)(()=>{if(!f)return;let e=e=>{h.current?.contains(e.target)||m(!1)},t=e=>{e.key===`Escape`&&m(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[f]),(0,v.jsxs)(`div`,{className:`relative`,ref:h,children:[(0,v.jsx)(k,{...o,"aria-expanded":f,"aria-haspopup":`menu`,"aria-label":y,disabled:g,onClick:e=>{n?.(e),e.defaultPrevented||m(e=>!e)},title:y,children:e??(0,v.jsx)(d,{"aria-hidden":`true`,className:`size-3.5`})}),(0,v.jsxs)(`div`,{className:`absolute bottom-9 left-0 z-50 min-w-36 rounded-control border border-separator-strong bg-raised p-1 shadow-floating`,hidden:!f,role:`menu`,children:[(0,v.jsxs)(i,{variant:`ghost`,className:`flex h-8 w-full items-center gap-2 rounded-control px-2 text-left text-label text-foreground hover:bg-control-hover`,onClick:()=>{m(!1),r(`image`)},role:`menuitem`,type:`button`,children:[(0,v.jsx)(u,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),c(`agentComponents.addImage`)]}),(0,v.jsxs)(i,{variant:`ghost`,className:`flex h-8 w-full items-center gap-2 rounded-control px-2 text-left text-label text-foreground hover:bg-control-hover`,onClick:()=>{m(!1),r(`file`)},role:`menuitem`,type:`button`,children:[(0,v.jsx)(l,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),c(`agentComponents.addFile`)]})]})]})}function k({children:e,className:t=``,type:n=`button`,...r}){return(0,v.jsx)(i,{className:`max-workbench:min-w-11 ${t}`,size:`sm`,type:n,variant:`ghost`,...r,children:e??(0,v.jsx)(c,{className:`size-3.5`,"aria-hidden":`true`})})}function A({className:e=``,...t}){return(0,v.jsx)(`select`,{className:`h-7 w-auto max-w-40 appearance-none rounded-control border-0 bg-transparent px-1.5 text-label text-muted-foreground outline-none [field-sizing:content] hover:bg-control-hover disabled:cursor-not-allowed disabled:opacity-45 max-workbench:h-11 ${e}`,...t})}function j({children:e,className:t=``,status:n,type:r=`submit`,...a}){let c=n===`reconnecting`||n===`submitting`;return(0,v.jsx)(i,{className:t,size:`icon-compact`,type:r,variant:`inverse`,...a,children:e??(n===`running`?(0,v.jsx)(f,{className:`size-3.5 fill-current`,"aria-hidden":`true`}):c?(0,v.jsx)(o,{className:`size-4 animate-spin`,"aria-hidden":`true`}):(0,v.jsx)(s,{className:`size-4`,"aria-hidden":`true`}))})}export{_,C as a,u as b,b as c,A as d,j as f,h as g,m as h,y as i,E as l,g as m,w as n,x as o,D as p,k as r,S as s,O as t,T as u,f as v,l as x,d as y};
Binary file
Binary file
@@ -1 +0,0 @@
1
- var e=[Object.freeze(JSON.parse('{"displayName":"Swift","fileTypes":["swift"],"firstLineMatch":"^#!/.*\\\\bswift","name":"swift","patterns":[{"include":"#root"}],"repository":{"async-throws":{"captures":{"1":{"name":"invalid.illegal.await-must-precede-throws.swift"},"2":{"name":"storage.modifier.exception.swift"},"3":{"name":"storage.modifier.async.swift"}},"match":"\\\\b(?:((?:throws\\\\s+|rethrows\\\\s+)async)|((?:|re)throws)|(async))\\\\b"},"attributes":{"patterns":[{"begin":"((@)available)(\\\\()","beginCaptures":{"1":{"name":"storage.modifier.attribute.swift"},"2":{"name":"punctuation.definition.attribute.swift"},"3":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.attribute.available.swift","patterns":[{"captures":{"1":{"name":"keyword.other.platform.os.swift"},"2":{"name":"constant.numeric.swift"}},"match":"\\\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|visionOS|UIKitForMac)(?:ApplicationExtension)?)\\\\b(?:\\\\s+([0-9]+(?:\\\\.[0-9]+)*)\\\\b)?"},{"begin":"\\\\b((?:introduc|deprecat|obsolet)ed)\\\\s*(:)\\\\s*","beginCaptures":{"1":{"name":"keyword.other.swift"},"2":{"name":"punctuation.separator.key-value.swift"}},"end":"(?!\\\\G)","patterns":[{"match":"\\\\b[0-9]+(?:\\\\.[0-9]+)*\\\\b","name":"constant.numeric.swift"}]},{"begin":"\\\\b(message|renamed)\\\\s*(:)\\\\s*(?=\\")","beginCaptures":{"1":{"name":"keyword.other.swift"},"2":{"name":"punctuation.separator.key-value.swift"}},"end":"(?!\\\\G)","patterns":[{"include":"#literals"}]},{"captures":{"1":{"name":"keyword.other.platform.all.swift"},"2":{"name":"keyword.other.swift"},"3":{"name":"invalid.illegal.character-not-allowed-here.swift"}},"match":"(?:(\\\\*)|\\\\b(deprecated|unavailable|noasync)\\\\b)\\\\s*(.*?)(?=[),])"}]},{"begin":"((@)objc)(\\\\()","beginCaptures":{"1":{"name":"storage.modifier.attribute.swift"},"2":{"name":"punctuation.definition.attribute.swift"},"3":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.attribute.objc.swift","patterns":[{"captures":{"1":{"name":"invalid.illegal.missing-colon-after-selector-piece.swift"}},"match":"\\\\w*(?::(?:\\\\w*:)*(\\\\w*))?","name":"entity.name.function.swift"}]},{"begin":"(@)(?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>)","beginCaptures":{"0":{"name":"storage.modifier.attribute.swift"},"1":{"name":"punctuation.definition.attribute.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"}},"end":"(?!\\\\G\\\\()","name":"meta.attribute.swift","patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.arguments.attribute.swift","patterns":[{"include":"#expressions"}]}]}]},"builtin-functions":{"patterns":[{"match":"(?<=\\\\.)(?:s(?:ort(?:ed)?|plit)|contains|index|partition|f(?:i(?:lter|rst)|orEach|latMap)|with(?:MutableCharacters|CString|U(?:nsafe(?:Mutable(?:BufferPointer|Pointer(?:s|To(?:Header|Elements)))|BufferPointer)|TF8Buffer))|m(?:in|a[px]))(?=\\\\s*[({])\\\\b","name":"support.function.swift"},{"match":"(?<=\\\\.)(?:s(?:ymmetricDifference|t(?:oreBytes|arts|ride)|ortInPlace|u(?:ccessor|ffix|btract(?:ing|InPlace|WithOverflow)?)|quareRoot|amePosition)|h(?:oldsUnique(?:|OrPinned)Reference|as(?:Suf|Pre)fix)|ne(?:gated?|xt)|c(?:o(?:untByEnumerating|py(?:Bytes)?)|lamp(?:ed)?|reate)|t(?:o(?:IntMax|Opaque|UIntMax)|ake(?:R|Unr)etainedValue|r(?:uncatingRemainder|a(?:nscodedLength|ilSurrogate)))|i(?:s(?:MutableAndUniquelyReferenced(?:OrPinned)?|S(?:trictSu(?:perset(?:Of)?|bset(?:Of)?)|u(?:perset(?:Of)?|bset(?:Of)?))|Continuation|T(?:otallyOrdered|railSurrogate)|Disjoint(?:With)?|Unique(?:Reference|lyReferenced(?:OrPinned)?)|Equal|Le(?:ss(?:ThanOrEqualTo)?|adSurrogate))|n(?:sert(?:ContentsOf)?|tersect(?:ion|InPlace)?|itialize(?:Memory|From)?|dex(?:Of|ForKey)))|o(?:verlaps|bjectAt)|d(?:i(?:stance(?:To)?|vide(?:d|WithOverflow)?)|e(?:s(?:cendant|troy)|code(?:CString)?|initialize|alloc(?:ate(?:Capacity)?)?)|rop(?:First|Last))|u(?:n(?:ion(?:InPlace)?|derestimateCount|wrappedOrError)|p(?:date(?:Value)?|percased))|join(?:ed|WithSeparator)|p(?:op(?:First|Last)|ass(?:R|Unr)etained|re(?:decessor|fix))|e(?:scaped?|n(?:code|umerated?)|lementsEqual|xclusiveOr(?:InPlace)?)|f(?:orm(?:Remainder|S(?:ymmetricDifference|quareRoot)|TruncatingRemainder|In(?:tersection|dex)|Union)|latten|rom(?:CString(?:RepairingIllFormedUTF8)?|Opaque))|w(?:i(?:thMemoryRebound|dth)|rite(?:To)?)|l(?:o(?:wercased|ad)|e(?:adSurrogate|xicographical(?:Compare|lyPrecedes)))|a(?:ss(?:ign(?:(?:Backward|)From)?|umingMemoryBound)|d(?:d(?:ing(?:Product)?|Product|WithOverflow)?|vanced(?:By)?)|utorelease|ppend(?:ContentsOf)?|lloc(?:ate)?|bs)|r(?:ound(?:ed)?|e(?:serveCapacity|tain|duce|place(?:(?:R|Subr)ange)?|versed?|quest(?:Native|UniqueMutableBacking)Buffer|lease|m(?:ove(?:Range|Subrange|Value(?:ForKey)?|First|Last|A(?:tIndex|ll))?|ainder(?:WithOverflow)?)))|ge(?:nerate|t(?:Objects|Element))|m(?:in(?:imum(?:Magnitude)?|Element)|ove(?:Initialize(?:Memory|BackwardFrom|From)?|Assign(?:From)?)?|ultipl(?:y(?:WithOverflow)?|ied)|easure|a(?:ke(?:Iterator|Description)|x(?:imum(?:Magnitude)?|Element)))|bindMemory)(?=\\\\s*\\\\()","name":"support.function.swift"},{"match":"(?<=\\\\.)(?:s(?:uperclassMirror|amePositionIn|tartsWith)|nextObject|c(?:haracterAtIndex|o(?:untByEnumeratingWithState|pyWithZone)|ustom(?:Mirror|PlaygroundQuickLook))|is(?:EmptyInput|ASCII)|object(?:Enumerator|ForKey|AtIndex)|join|put|keyEnumerator|withUnsafeMutablePointerToValue|length|getMirror|m(?:oveInitializeAssignFrom|ember))(?=\\\\s*\\\\()","name":"support.function.swift"}]},"builtin-global-functions":{"patterns":[{"begin":"\\\\b(type)(\\\\()\\\\s*(of)(:)","beginCaptures":{"1":{"name":"support.function.dynamic-type.swift"},"2":{"name":"punctuation.definition.arguments.begin.swift"},"3":{"name":"support.variable.parameter.swift"},"4":{"name":"punctuation.separator.argument-label.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"patterns":[{"include":"#expressions"}]},{"match":"\\\\ba(?:nyGenerator|utoreleasepool)(?=\\\\s*[({])\\\\b","name":"support.function.swift"},{"match":"\\\\b(?:s(?:tride(?:of(?:Value)?)?|izeof(?:Value)?|equence|wap)|numericCast|transcode|is(?:UniquelyReferenced(?:NonObjC)?|KnownUniquelyReferenced)|zip|d(?:ump|ebugPrint)|unsafe(?:BitCast|Downcast|Unwrap|Address(?:Of)?)|pr(?:int|econdition(?:Failure)?)|fatalError|with(?:Unsafe(?:Mutable|)Pointer|ExtendedLifetime|VaList)|a(?:ssert(?:ionFailure)?|lignof(?:Value)?|bs)|re(?:peatElement|adLine)|getVaList|m(?:in|ax))(?=\\\\s*\\\\()","name":"support.function.swift"},{"match":"\\\\b(?:s(?:ort|uffix|pli(?:ce|t))|insert|overlaps|d(?:istance|rop(?:First|Last))|join|prefix|extend|withUnsafe(?:Mutable|)Pointers|lazy|advance|re(?:flect|move(?:Range|Last|A(?:tIndex|ll))))(?=\\\\s*\\\\()","name":"support.function.swift"}]},"builtin-properties":{"patterns":[{"match":"(?<=(?:^|\\\\W)(?:Process\\\\.|CommandLine\\\\.))(arguments|argc|unsafeArgv)","name":"support.variable.swift"},{"match":"(?<=\\\\.)(?:s(?:t(?:artIndex|ri(?:ngValue|de))|i(?:ze|gn(?:BitIndex|ificand(?:Bit(?:Count|Pattern)|Width)?|alingNaN)?)|u(?:perclassMirror|mmary|bscriptBaseAddress))|h(?:eader|as(?:hValue|PointerRepresentation))|n(?:ulTerminatedUTF8|ext(?:Down|Up)|a(?:n|tiveOwner))|c(?:haracters|ount(?:TrailingZeros)?|ustom(?:Mirror|PlaygroundQuickLook)|apacity)|i(?:s(?:S(?:ign(?:Minus|aling(?:NaN)?)|ubnormal)|N(?:ormal|aN)|Canonical|Infinite|Zero|Empty|Finite|ASCII)|n(?:dices|finity)|dentity)|owner|de(?:|bugDe)scription|u(?:n(?:safelyUnwrapped|icodeScalars?|derestimatedCount)|tf(?:16|8(?:Start|C(?:String|odeUnitCount))?)|intValue|ppercaseString|lp(?:OfOne)?)|p(?:i|ointee)|e(?:ndIndex|lements|xponent(?:Bit(?:Count|Pattern))?)|values?|keys|quietNaN|f(?:irst(?:ElementAddress(?:IfContiguous)?)?|loatingPointClass)|l(?:ittleEndian|owercaseString|eastNo(?:nzero|rmal)Magnitude|a(?:st|zy))|a(?:l(?:ignment|l(?:ocatedElementCount|Zeros))|rray(?:PropertyIsNativeTypeChecked)?)|ra(?:dix|wValue)|greatestFiniteMagnitude|m(?:in|emory|ax)|b(?:yteS(?:ize|wapped)|i(?:nade|tPattern|gEndian)|uffer|ase(?:Address)?))\\\\b","name":"support.variable.swift"},{"match":"(?<=\\\\.)(?:boolValue|disposition|end|objectIdentifier|quickLookObject|start|valueType)\\\\b","name":"support.variable.swift"},{"match":"(?<=\\\\.)(?:s(?:calarValue|i(?:ze|gnalingNaN)|o(?:und|me)|uppressed|prite|et)|n(?:one|egative(?:Subnormal|Normal|Infinity|Zero))|c(?:ol(?:or|lection)|ustomized)|t(?:o(?:NearestOr(?:Even|AwayFromZero)|wardZero)|uple|ext)|i(?:nt|mage)|optional|d(?:ictionary|o(?:uble|wn))|u(?:Int|p|rl)|p(?:o(?:sitive(?:Subnormal|Normal|Infinity|Zero)|int)|lus)|e(?:rror|mptyInput)|view|quietNaN|float|a(?:ttributedString|wayFromZero)|r(?:ectangle|ange)|generated|minus|b(?:ool|ezierPath))\\\\b","name":"support.variable.swift"}]},"builtin-types":{"patterns":[{"include":"#builtin-types-builtin-class-type"},{"include":"#builtin-types-builtin-enum-type"},{"include":"#builtin-types-builtin-protocol-type"},{"include":"#builtin-types-builtin-struct-type"},{"include":"#builtin-types-builtin-typealias"},{"match":"\\\\bAny\\\\b","name":"support.type.any.swift"}]},"builtin-types-builtin-class-type":{"match":"\\\\b(Managed((?:|Proto)Buffer)|NonObjectiveCBase|AnyGenerator)\\\\b","name":"support.class.swift"},"builtin-types-builtin-enum-type":{"patterns":[{"match":"\\\\b(?:CommandLine|Process(?=\\\\.))\\\\b","name":"support.constant.swift"},{"match":"\\\\bNever\\\\b","name":"support.constant.never.swift"},{"match":"\\\\b(?:ImplicitlyUnwrappedOptional|Representation|MemoryLayout|FloatingPointClassification|SetIndexRepresentation|SetIteratorRepresentation|FloatingPointRoundingRule|UnicodeDecodingResult|Optional|DictionaryIndexRepresentation|AncestorRepresentation|DisplayStyle|PlaygroundQuickLook|Never|FloatingPointSign|Bit|DictionaryIteratorRepresentation)\\\\b","name":"support.type.swift"},{"match":"\\\\b(?:MirrorDisposition|QuickLookObject)\\\\b","name":"support.type.swift"}]},"builtin-types-builtin-protocol-type":{"patterns":[{"match":"\\\\b(?:Ra(?:n(?:domAccess(?:Collection|Indexable)|geReplaceable(?:Collection|Indexable))|wRepresentable)|M(?:irrorPath|utable(?:Collection|Indexable))|Bi(?:naryFloatingPoint|twiseOperations|directional(?:Collection|Indexable))|S(?:tr(?:ide|eam)able|igned(?:Number|Integer)|e(?:tAlgebra|quence))|Hashable|C(?:o(?:llection|mparable)|ustom(?:Reflecta|StringConverti|DebugStringConverti|PlaygroundQuickLooka|LeafReflecta)ble|VarArg)|TextOutputStream|I(?:n(?:teger(?:Arithmetic)?|dexable(?:Base)?)|teratorProtocol)|OptionSet|Un(?:signedInteger|icodeCodec)|E(?:quatable|rror|xpressibleBy(?:BooleanLiteral|String(?:Interpolation|Literal)|NilLiteral|IntegerLiteral|DictionaryLiteral|UnicodeScalarLiteral|ExtendedGraphemeClusterLiteral|FloatLiteral|ArrayLiteral))|FloatingPoint|L(?:osslessStringConvertible|azy(?:Sequence|Collection)Protocol)|A(?:nyObject|bsoluteValuable))\\\\b","name":"support.type.swift"},{"match":"\\\\b(?:Ran(?:domAccessIndex|geReplaceableCollection)Type|GeneratorType|M(?:irror(?:|Path)Type|utable(?:Sliceable|CollectionType))|B(?:i(?:twiseOperations|directionalIndex)Type|oolean(?:Type|LiteralConvertible))|S(?:tring(?:Interpolation|Literal)Convertible|i(?:nk|gned(?:Numb|Integ)er)Type|e(?:tAlgebra|quence)Type|liceable)|NilLiteralConvertible|C(?:ollection|VarArg)Type|Inte(?:rvalType|ger(?:Type|LiteralConvertible|ArithmeticType))|O(?:utputStream|ptionSet)Type|DictionaryLiteralConvertible|Un(?:signedIntegerType|icode(?:ScalarLiteralConvertible|CodecType))|E(?:rrorType|xten(?:sibleCollectionType|dedGraphemeClusterLiteralConvertible))|F(?:orwardIndexType|loat(?:ingPointType|LiteralConvertible))|A(?:nyCollectionType|rrayLiteralConvertible))\\\\b","name":"support.type.swift"}]},"builtin-types-builtin-struct-type":{"patterns":[{"match":"\\\\b(?:R(?:e(?:peat(?:ed)?|versed(?:RandomAccess(?:Collection|Index)|Collection|Index))|an(?:domAccessSlice|ge(?:Replaceable(?:RandomAccess|Bidirectional|)Slice|Generator)?))|Generator(?:Sequence|OfOne)|M(?:irror|utable(?:Ran(?:domAccess|geReplaceable(?:RandomAccess|Bidirectional|))|Bidirectional|)Slice|anagedBufferPointer)|B(?:idirectionalSlice|ool)|S(?:t(?:aticString|ri(?:ng|deT(?:hrough(?:(?:Gen|It)erator)?|o(?:(?:Gen|It)erator)?)))|et(?:I(?:ndex|terator))?|lice)|HalfOpenInterval|C(?:haracter(?:View)?|o(?:ntiguousArray|untable(?:|Closed)Range|llectionOfOne)|OpaquePointer|losed(?:Range(?:I(?:ndex|terator))?|Interval)|VaListPointer)|I(?:n(?:t(?:16|8|32|64)?|d(?:ices|ex(?:ing(?:Gen|It)erator)?))|terator(?:Sequence|OverOne)?)|Zip2(?:Sequence|Iterator)|O(?:paquePointer|bjectIdentifier)|D(?:ictionary(?:I(?:ndex|terator)|Literal)?|ouble|efault(?:RandomAccess|Bidirectional|)Indices)|U(?:n(?:safe(?:RawPointer|Mutable(?:Raw|Buffer|)Pointer|BufferPointer(?:(?:Gen|It)erator)?|Pointer)|icodeScalar(?:View)?|foldSequence|managed)|TF(?:16(?:View)?|8(?:View)?|32)|Int(?:16|8|32|64)?)|Join(?:Generator|ed(?:Sequence|Iterator))|PermutationGenerator|E(?:numerate(?:Generator|Sequence|d(?:Sequence|Iterator))|mpty(?:Generator|Collection|Iterator))|Fl(?:oat(?:80)?|atten(?:Generator|BidirectionalCollection(?:Index)?|Sequence|Collection(?:Index)?|Iterator))|L(?:egacyChildren|azy(?:RandomAccessCollection|Map(?:RandomAccessCollection|Generator|BidirectionalCollection|Sequence|Collection|Iterator)|BidirectionalCollection|Sequence|Collection|Filter(?:Generator|BidirectionalCollection|Sequence|Collection|I(?:ndex|terator))))|A(?:ny(?:RandomAccessCollection|Generator|BidirectionalCollection|Sequence|Hashable|Collection|I(?:ndex|terator))|utoreleasingUnsafeMutablePointer|rray(?:Slice)?))\\\\b","name":"support.type.swift"},{"match":"\\\\b(?:R(?:everse(?:RandomAccess(?:Collection|Index)|Collection|Index)|awByte)|Map(?:Generator|Sequence|Collection)|S(?:inkOf|etGenerator)|Zip2Generator|DictionaryGenerator|Filter(?:Generator|Sequence|Collection(?:Index)?)|LazyForwardCollection|Any(?:RandomAccessIndex|BidirectionalIndex|Forward(?:Collection|Index)))\\\\b","name":"support.type.swift"}]},"builtin-types-builtin-typealias":{"patterns":[{"match":"\\\\b(?:Raw(?:Significand|Exponent|Value)|B(?:ooleanLiteralType|uffer|ase)|S(?:t(?:orage|r(?:i(?:ngLiteralType|de)|eam[12]))|ubSequence)|NativeBuffer|C(?:hild(?:ren)?|Bool|S(?:hort|ignedChar)|odeUnit|Char(?:16|32)?|Int|Double|Unsigned(?:Short|Char|Int|Long(?:Long)?)|Float|WideChar|Long(?:Long)?)|I(?:n(?:t(?:Max|egerLiteralType)|d(?:ices|ex(?:Distance)?))|terator)|Distance|U(?:n(?:icodeScalar(?:Type|Index|View|LiteralType)|foldFirstSequence)|TF(?:16(?:Index|View)|8Index)|IntMax)|E(?:lements?|x(?:tendedGraphemeCluster(?:|Literal)Type|ponent))|V(?:oid|alue)|Key|Float(?:32|LiteralType|64)|AnyClass)\\\\b","name":"support.type.swift"},{"match":"\\\\b(?:Generator|PlaygroundQuickLook|UWord|Word)\\\\b","name":"support.type.swift"}]},"code-block":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.scope.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.scope.end.swift"}},"patterns":[{"include":"$self"}]},"comments":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.comment.swift"}},"match":"\\\\A^(#!).*$\\\\n?","name":"comment.line.number-sign.swift"},{"begin":"/\\\\*\\\\*(?!/)","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.swift"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.swift"}},"name":"comment.block.documentation.swift","patterns":[{"include":"#comments-nested"}]},{"begin":"/\\\\*:","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.swift"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.swift"}},"name":"comment.block.documentation.playground.swift","patterns":[{"include":"#comments-nested"}]},{"begin":"/\\\\*","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.swift"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.swift"}},"name":"comment.block.swift","patterns":[{"include":"#comments-nested"}]},{"match":"\\\\*/","name":"invalid.illegal.unexpected-end-of-block-comment.swift"},{"begin":"(^[\\\\t ]+)?(?=//)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.swift"}},"end":"(?!\\\\G)","patterns":[{"begin":"///","beginCaptures":{"0":{"name":"punctuation.definition.comment.swift"}},"end":"$","name":"comment.line.triple-slash.documentation.swift"},{"begin":"//:","beginCaptures":{"0":{"name":"punctuation.definition.comment.swift"}},"end":"$","name":"comment.line.double-slash.documentation.swift"},{"begin":"//","beginCaptures":{"0":{"name":"punctuation.definition.comment.swift"}},"end":"$","name":"comment.line.double-slash.swift"}]}]},"comments-nested":{"begin":"/\\\\*","end":"\\\\*/","patterns":[{"include":"#comments-nested"}]},"compiler-control":{"patterns":[{"begin":"^\\\\s*(#)(if|elseif)\\\\s+(false)\\\\b.*?(?=$|//|/\\\\*)","beginCaptures":{"0":{"name":"meta.preprocessor.conditional.swift"},"1":{"name":"punctuation.definition.preprocessor.swift"},"2":{"name":"keyword.control.import.preprocessor.conditional.swift"},"3":{"name":"constant.language.boolean.swift"}},"contentName":"comment.block.preprocessor.swift","end":"(?=^\\\\s*(#(e(?:lseif|lse|ndif)))\\\\b)"},{"begin":"^\\\\s*(#)(if|elseif)\\\\s+","captures":{"1":{"name":"punctuation.definition.preprocessor.swift"},"2":{"name":"keyword.control.import.preprocessor.conditional.swift"}},"end":"(?=\\\\s*/[*/])|$","name":"meta.preprocessor.conditional.swift","patterns":[{"match":"(&&|\\\\|\\\\|)","name":"keyword.operator.logical.swift"},{"match":"\\\\b(true|false)\\\\b","name":"constant.language.boolean.swift"},{"captures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"},"3":{"name":"support.constant.platform.architecture.swift"},"4":{"name":"punctuation.definition.parameters.end.swift"}},"match":"\\\\b(arch)\\\\s*(\\\\()\\\\s*(?:(arm|arm64|powerpc64|powerpc64le|i386|x86_64|s390x)|\\\\w+)\\\\s*(\\\\))"},{"captures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"},"3":{"name":"support.constant.platform.os.swift"},"4":{"name":"punctuation.definition.parameters.end.swift"}},"match":"\\\\b(os)\\\\s*(\\\\()\\\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|visionOS|Android|Linux|FreeBSD|Windows|PS4)|\\\\w+)\\\\s*(\\\\))"},{"captures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"},"3":{"name":"entity.name.type.module.swift"},"4":{"name":"punctuation.definition.parameters.end.swift"}},"match":"\\\\b(canImport)\\\\s*(\\\\()([_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*)(\\\\))"},{"begin":"\\\\b(targetEnvironment)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"}},"end":"(\\\\))|$","endCaptures":{"1":{"name":"punctuation.definition.parameters.end.swift"}},"patterns":[{"match":"\\\\b(simulator|UIKitForMac)\\\\b","name":"support.constant.platform.environment.swift"}]},{"begin":"\\\\b(swift|compiler)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"keyword.other.condition.swift"},"2":{"name":"punctuation.definition.parameters.begin.swift"}},"end":"(\\\\))|$","endCaptures":{"1":{"name":"punctuation.definition.parameters.end.swift"}},"patterns":[{"match":">=|<","name":"keyword.operator.comparison.swift"},{"match":"\\\\b[0-9]+(?:\\\\.[0-9]+)*\\\\b","name":"constant.numeric.swift"}]}]},{"captures":{"1":{"name":"punctuation.definition.preprocessor.swift"},"2":{"name":"keyword.control.import.preprocessor.conditional.swift"},"3":{"patterns":[{"match":"\\\\S+","name":"invalid.illegal.character-not-allowed-here.swift"}]}},"match":"^\\\\s*(#)(e(?:lse|ndif))(.*?)(?=$|//|/\\\\*)","name":"meta.preprocessor.conditional.swift"},{"captures":{"1":{"name":"punctuation.definition.preprocessor.swift"},"2":{"name":"keyword.control.import.preprocessor.sourcelocation.swift"},"4":{"name":"punctuation.definition.parameters.begin.swift"},"5":{"patterns":[{"begin":"(file)\\\\s*(:)\\\\s*(?=\\")","beginCaptures":{"1":{"name":"support.variable.parameter.swift"},"2":{"name":"punctuation.separator.key-value.swift"}},"end":"(?!\\\\G)","patterns":[{"include":"#literals"}]},{"captures":{"1":{"name":"support.variable.parameter.swift"},"2":{"name":"punctuation.separator.key-value.swift"},"3":{"name":"constant.numeric.integer.swift"}},"match":"(line)\\\\s*(:)\\\\s*([0-9]+)"},{"match":",","name":"punctuation.separator.parameters.swift"},{"match":"\\\\S+","name":"invalid.illegal.character-not-allowed-here.swift"}]},"6":{"name":"punctuation.definition.parameters.begin.swift"},"7":{"patterns":[{"match":"\\\\S+","name":"invalid.illegal.character-not-allowed-here.swift"}]}},"match":"^\\\\s*(#)(sourceLocation)((\\\\()([^)]*)(\\\\)))(.*?)(?=$|//|/\\\\*)","name":"meta.preprocessor.sourcelocation.swift"}]},"conditionals":{"patterns":[{"begin":"(?<!\\\\.)\\\\b(if|guard|switch|for)\\\\b","beginCaptures":{"1":{"patterns":[{"include":"#keywords"}]}},"end":"(?=\\\\{)","patterns":[{"include":"#expressions-without-trailing-closures"}]},{"begin":"(?<!\\\\.)\\\\b(while)\\\\b","beginCaptures":{"1":{"patterns":[{"include":"#keywords"}]}},"end":"(?=\\\\{)|$","patterns":[{"include":"#expressions-without-trailing-closures"}]}]},"declarations":{"patterns":[{"include":"#declarations-function"},{"include":"#declarations-function-initializer"},{"include":"#declarations-function-subscript"},{"include":"#declarations-typed-variable-declaration"},{"include":"#declarations-import"},{"include":"#declarations-operator"},{"include":"#declarations-precedencegroup"},{"include":"#declarations-protocol"},{"include":"#declarations-type"},{"include":"#declarations-extension"},{"include":"#declarations-typealias"},{"include":"#declarations-macro"}]},"declarations-available-types":{"patterns":[{"include":"#comments"},{"include":"#builtin-types"},{"include":"#attributes"},{"match":"\\\\basync\\\\b","name":"storage.modifier.async.swift"},{"match":"\\\\b(?:|re)throws\\\\b","name":"storage.modifier.exception.swift"},{"match":"\\\\bsome\\\\b","name":"keyword.other.operator.type.opaque.swift"},{"match":"\\\\bany\\\\b","name":"keyword.other.operator.type.existential.swift"},{"match":"\\\\b(?:repeat|each)\\\\b","name":"keyword.control.loop.swift"},{"match":"\\\\b(?:inout|isolated|borrowing|consuming)\\\\b","name":"storage.modifier.swift"},{"match":"\\\\bSelf\\\\b","name":"variable.language.swift"},{"captures":{"1":{"name":"keyword.operator.type.function.swift"}},"match":"(?<![-!%\\\\&*+./<=>^|~])(->)(?![-!%\\\\&*+./<=>^|~])"},{"captures":{"1":{"name":"keyword.operator.type.composition.swift"}},"match":"(?<![-!%\\\\&*+./<=>^|~])(&)(?![-!%\\\\&*+./<=>^|~])"},{"match":"[!?]","name":"keyword.operator.type.optional.swift"},{"match":"\\\\.\\\\.\\\\.","name":"keyword.operator.function.variadic-parameter.swift"},{"match":"\\\\bprotocol\\\\b","name":"keyword.other.type.composition.swift"},{"match":"(?<=\\\\.)(?:Protocol|Type)\\\\b","name":"keyword.other.type.metatype.swift"},{"include":"#declarations-available-types-tuple-type"},{"include":"#declarations-available-types-collection-type"},{"include":"#declarations-generic-argument-clause"}]},"declarations-available-types-collection-type":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.section.collection-type.begin.swift"}},"end":"]|(?=[)>{}])","endCaptures":{"0":{"name":"punctuation.section.collection-type.end.swift"}},"patterns":[{"include":"#declarations-available-types"},{"include":"#literals-numeric"},{"match":"\\\\b_\\\\b","name":"support.variable.inferred.swift"},{"match":"(?<=\\\\s)\\\\bof\\\\b(?=\\\\s+[(\\\\[_\\\\p{L}\\\\d\\\\p{N}\\\\p{M}])","name":"keyword.other.inline-array.swift"},{"begin":":","beginCaptures":{"0":{"name":"punctuation.separator.key-value.swift"}},"end":"(?=[])>{}])","patterns":[{"match":":","name":"invalid.illegal.extra-colon-in-dictionary-type.swift"},{"include":"#declarations-available-types"}]}]},"declarations-available-types-tuple-type":{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.tuple-type.begin.swift"}},"end":"\\\\)|(?=[]>{}])","endCaptures":{"0":{"name":"punctuation.section.tuple-type.end.swift"}},"patterns":[{"include":"#declarations-available-types"}]},"declarations-extension":{"begin":"\\\\b(extension)\\\\s+","beginCaptures":{"1":{"name":"storage.type.$1.swift"}},"end":"(?<=})","name":"meta.definition.type.$1.swift","patterns":[{"begin":"\\\\G(?!\\\\s*[\\\\n:{])","end":"(?=\\\\s*[\\\\n:{])|(?!\\\\G)(?=\\\\s*where\\\\b)","name":"entity.name.type.swift","patterns":[{"include":"#declarations-available-types"}]},{"include":"#comments"},{"include":"#declarations-generic-where-clause"},{"include":"#declarations-inheritance-clause"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.type.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.type.end.swift"}},"name":"meta.definition.type.body.swift","patterns":[{"include":"$self"}]}]},"declarations-function":{"begin":"\\\\b(func)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>)|(?:((?<oph>[-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷‖‗†-‧‰-‾⁁-⁓⁕-⁞←-⏿─-❵➔-⯿⸀-⹿、。〃〈-〰])(\\\\g<oph>|(?<opc>[̀-ͯ᷀-᷿⃐-⃿︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))*)|(\\\\.(\\\\g<oph>|\\\\g<opc>|\\\\.)+)))\\\\s*(?=[(<])","beginCaptures":{"1":{"name":"storage.type.function.swift"},"2":{"name":"entity.name.function.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?<=})|$","name":"meta.definition.function.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#declarations-function-result"},{"include":"#async-throws"},{"include":"#declarations-generic-where-clause"},{"begin":"(\\\\{)","beginCaptures":{"1":{"name":"punctuation.section.function.begin.swift"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.section.function.end.swift"}},"name":"meta.definition.function.body.swift","patterns":[{"include":"$self"}]}]},"declarations-function-initializer":{"begin":"(?<!\\\\.)\\\\b(init[!?]*)\\\\s*(?=[(<])","beginCaptures":{"1":{"name":"storage.type.function.swift","patterns":[{"match":"(?<=[!?])[!?]+","name":"invalid.illegal.character-not-allowed-here.swift"}]}},"end":"(?<=})|$","name":"meta.definition.function.initializer.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#async-throws"},{"include":"#declarations-generic-where-clause"},{"begin":"(\\\\{)","beginCaptures":{"1":{"name":"punctuation.section.function.begin.swift"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.section.function.end.swift"}},"name":"meta.definition.function.body.swift","patterns":[{"include":"$self"}]}]},"declarations-function-result":{"begin":"(?<![-!%\\\\&*+./<=>^|~])(->)(?![-!%\\\\&*+./<=>^|~])\\\\s*","beginCaptures":{"1":{"name":"keyword.operator.function-result.swift"}},"end":"(?!\\\\G)(?=\\\\{|\\\\bwhere\\\\b|[;=])|$","name":"meta.function-result.swift","patterns":[{"match":"\\\\bsending\\\\b","name":"storage.modifier.swift"},{"include":"#declarations-available-types"}]},"declarations-function-subscript":{"begin":"(?<!\\\\.)\\\\b(subscript)\\\\s*(?=[(<])","beginCaptures":{"1":{"name":"storage.type.function.swift"}},"end":"(?<=})|$","name":"meta.definition.function.subscript.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#declarations-function-result"},{"include":"#async-throws"},{"include":"#declarations-generic-where-clause"},{"begin":"(\\\\{)","beginCaptures":{"1":{"name":"punctuation.section.function.begin.swift"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.section.function.end.swift"}},"name":"meta.definition.function.body.swift","patterns":[{"include":"$self"}]}]},"declarations-generic-argument-clause":{"begin":"<","beginCaptures":{"0":{"name":"punctuation.separator.generic-argument-clause.begin.swift"}},"end":">|(?=[]){}])","endCaptures":{"0":{"name":"punctuation.separator.generic-argument-clause.end.swift"}},"name":"meta.generic-argument-clause.swift","patterns":[{"include":"#literals-numeric"},{"include":"#declarations-available-types"}]},"declarations-generic-parameter-clause":{"begin":"<","beginCaptures":{"0":{"name":"punctuation.separator.generic-parameter-clause.begin.swift"}},"end":">|(?=[^\\\\&,:<=>`\\\\w\\\\d\\\\s])","endCaptures":{"0":{"name":"punctuation.separator.generic-parameter-clause.end.swift"}},"name":"meta.generic-parameter-clause.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-where-clause"},{"match":"\\\\blet\\\\b","name":"keyword.other.declaration-specifier.swift"},{"match":"\\\\beach\\\\b","name":"keyword.control.loop.swift"},{"captures":{"1":{"name":"variable.language.generic-parameter.swift"}},"match":"\\\\b((?!\\\\d)\\\\w[\\\\w\\\\d]*)\\\\b"},{"match":",","name":"punctuation.separator.generic-parameters.swift"},{"begin":"(:)\\\\s*","beginCaptures":{"1":{"name":"punctuation.separator.generic-parameter-constraint.swift"}},"end":"(?=[,>]|(?!\\\\G)\\\\bwhere\\\\b)","name":"meta.generic-parameter-constraint.swift","patterns":[{"begin":"\\\\G","end":"(?=[,>]|(?!\\\\G)\\\\bwhere\\\\b)","name":"entity.other.inherited-class.swift","patterns":[{"include":"#declarations-type-identifier"},{"include":"#declarations-type-operators"}]}]}]},"declarations-generic-where-clause":{"begin":"\\\\b(where)\\\\b\\\\s*","beginCaptures":{"1":{"name":"keyword.other.generic-constraint-introducer.swift"}},"end":"(?!\\\\G)$|(?=[\\\\n;>{}]|//|/\\\\*)","name":"meta.generic-where-clause.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-where-clause-requirement-list"}]},"declarations-generic-where-clause-requirement-list":{"begin":"\\\\G|,\\\\s*","end":"(?=[\\\\n,;>{}]|//|/\\\\*)","patterns":[{"include":"#comments"},{"include":"#constraint"},{"include":"#declarations-available-types"},{"begin":"(?<![-!%\\\\&*+./<=>^|~])(==)(?![-!%\\\\&*+./<=>^|~])","beginCaptures":{"1":{"name":"keyword.operator.generic-constraint.same-type.swift"}},"end":"(?=\\\\s*[\\\\n,;>{}]|//|/\\\\*)","name":"meta.generic-where-clause.same-type-requirement.swift","patterns":[{"include":"#declarations-available-types"}]},{"begin":"(?<![-!%\\\\&*+./<=>^|~])(:)(?![-!%\\\\&*+./<=>^|~])","beginCaptures":{"1":{"name":"keyword.operator.generic-constraint.conforms-to.swift"}},"end":"(?=\\\\s*[\\\\n,;>{}]|//|/\\\\*)","name":"meta.generic-where-clause.conformance-requirement.swift","patterns":[{"begin":"\\\\G\\\\s*","contentName":"entity.other.inherited-class.swift","end":"(?=\\\\s*[\\\\n,;>{}]|//|/\\\\*)","patterns":[{"include":"#declarations-available-types"}]}]}]},"declarations-import":{"begin":"(?<!\\\\.)\\\\b(import)\\\\s+","beginCaptures":{"1":{"name":"keyword.control.import.swift"}},"end":"(;)|$\\\\n?|(?=/[*/])","endCaptures":{"1":{"name":"punctuation.terminator.statement.swift"}},"name":"meta.import.swift","patterns":[{"begin":"\\\\G(?!;|$|//|/\\\\*)(?:(typealias|struct|class|actor|enum|protocol|var|func)\\\\s+)?","beginCaptures":{"1":{"name":"storage.modifier.swift"}},"end":"(?=;|$|//|/\\\\*)","patterns":[{"captures":{"1":{"name":"punctuation.definition.identifier.swift"},"2":{"name":"punctuation.definition.identifier.swift"}},"match":"(?<=\\\\G|\\\\.)(?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>)","name":"entity.name.type.swift"},{"match":"(?<=\\\\G|\\\\.)\\\\$[0-9]+","name":"entity.name.type.swift"},{"captures":{"1":{"patterns":[{"match":"\\\\.","name":"invalid.illegal.dot-not-allowed-here.swift"}]}},"match":"(?<=\\\\G|\\\\.)(?:((?<oph>[-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷‖‗†-‧‰-‾⁁-⁓⁕-⁞←-⏿─-❵➔-⯿⸀-⹿、。〃〈-〰])(\\\\g<oph>|(?<opc>[̀-ͯ᷀-᷿⃐-⃿︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))*)|(\\\\.(\\\\g<oph>|\\\\g<opc>|\\\\.)+))(?=[.;]|$|//|/\\\\*|\\\\s)","name":"entity.name.type.swift"},{"match":"\\\\.","name":"punctuation.separator.import.swift"},{"begin":"(?!\\\\s*(;|$|//|/\\\\*))","end":"(?=\\\\s*(;|$|//|/\\\\*))","name":"invalid.illegal.character-not-allowed-here.swift"}]}]},"declarations-inheritance-clause":{"begin":"(:)(?=\\\\s*\\\\{)|(:)\\\\s*","beginCaptures":{"1":{"name":"invalid.illegal.empty-inheritance-clause.swift"},"2":{"name":"punctuation.separator.inheritance-clause.swift"}},"end":"(?!\\\\G)$|(?=[={}]|(?!\\\\G)\\\\bwhere\\\\b)","name":"meta.inheritance-clause.swift","patterns":[{"begin":"\\\\bclass\\\\b","beginCaptures":{"0":{"name":"storage.type.class.swift"}},"end":"(?=[={}]|(?!\\\\G)\\\\bwhere\\\\b)","patterns":[{"include":"#comments"},{"include":"#declarations-inheritance-clause-more-types"}]},{"begin":"\\\\G","end":"(?!\\\\G)$|(?=[={}]|(?!\\\\G)\\\\bwhere\\\\b)","patterns":[{"include":"#attributes"},{"include":"#comments"},{"include":"#declarations-inheritance-clause-inherited-type"},{"include":"#declarations-inheritance-clause-more-types"},{"include":"#declarations-type-operators"}]}]},"declarations-inheritance-clause-inherited-type":{"begin":"(?=[_`\\\\p{L}])","end":"(?!\\\\G)","name":"entity.other.inherited-class.swift","patterns":[{"include":"#declarations-type-identifier"}]},"declarations-inheritance-clause-more-types":{"begin":",\\\\s*","end":"(?!\\\\G)(?!/[*/])|(?=[,={}]|(?!\\\\G)\\\\bwhere\\\\b)","name":"meta.inheritance-list.more-types","patterns":[{"include":"#attributes"},{"include":"#comments"},{"include":"#declarations-inheritance-clause-inherited-type"},{"include":"#declarations-inheritance-clause-more-types"},{"include":"#declarations-type-operators"}]},"declarations-macro":{"begin":"\\\\b(macro)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*(?=[(<=])","beginCaptures":{"1":{"name":"storage.type.function.swift"},"2":{"name":"entity.name.function.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"$|(?=;|//|/\\\\*|[=}])","name":"meta.definition.macro.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#declarations-function-result"},{"include":"#async-throws"},{"include":"#declarations-generic-where-clause"}]},"declarations-operator":{"begin":"(?:\\\\b((?:pre|in|post)fix)\\\\s+)?\\\\b(operator)\\\\s+(((?<oph>[-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷‖‗†-‧‰-‾⁁-⁓⁕-⁞←-⏿─-❵➔-⯿⸀-⹿、。〃〈-〰])(\\\\g<oph>|\\\\.|(?<opc>[̀-ͯ᷀-᷿⃐-⃿︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))*+)|(\\\\.(\\\\g<oph>|\\\\g<opc>|\\\\.)++))\\\\s*","beginCaptures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"storage.type.function.operator.swift"},"3":{"name":"entity.name.function.operator.swift"},"4":{"name":"entity.name.function.operator.swift","patterns":[{"match":"\\\\.","name":"invalid.illegal.dot-not-allowed-here.swift"}]}},"end":"(;)|$\\\\n?|(?=/[*/])","endCaptures":{"1":{"name":"punctuation.terminator.statement.swift"}},"name":"meta.definition.operator.swift","patterns":[{"include":"#declarations-operator-swift2"},{"include":"#declarations-operator-swift3"},{"match":"((?!$|;|//|/\\\\*)\\\\S)+","name":"invalid.illegal.character-not-allowed-here.swift"}]},"declarations-operator-swift2":{"begin":"\\\\G(\\\\{)","beginCaptures":{"1":{"name":"punctuation.definition.operator.begin.swift"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.definition.operator.end.swift"}},"patterns":[{"include":"#comments"},{"captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"keyword.other.operator.associativity.swift"}},"match":"\\\\b(associativity)\\\\s+(left|right)\\\\b"},{"captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"constant.numeric.integer.swift"}},"match":"\\\\b(precedence)\\\\s+([0-9]+)\\\\b"},{"captures":{"1":{"name":"storage.modifier.swift"}},"match":"\\\\b(assignment)\\\\b"}]},"declarations-operator-swift3":{"captures":{"2":{"name":"entity.other.inherited-class.swift","patterns":[{"include":"#declarations-types-precedencegroup"}]},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"match":"\\\\G(:)\\\\s*((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))"},"declarations-parameter-clause":{"begin":"(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.parameters.begin.swift"}},"end":"(\\\\))(?:\\\\s*(async)\\\\b)?","endCaptures":{"1":{"name":"punctuation.definition.parameters.end.swift"},"2":{"name":"storage.modifier.async.swift"}},"name":"meta.parameter-clause.swift","patterns":[{"include":"#declarations-parameter-list"}]},"declarations-parameter-list":{"patterns":[{"captures":{"1":{"name":"entity.name.function.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"variable.parameter.function.swift"},"5":{"name":"punctuation.definition.identifier.swift"},"6":{"name":"punctuation.definition.identifier.swift"}},"match":"((?<q1>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q1>))\\\\s+((?<q2>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q2>))(?=\\\\s*:)"},{"captures":{"1":{"name":"variable.parameter.function.swift"},"2":{"name":"entity.name.function.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"match":"(((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>)))(?=\\\\s*:)"},{"begin":":\\\\s*(?!\\\\s)","end":"(?=[),])","patterns":[{"match":"\\\\bsending\\\\b","name":"storage.modifier.swift"},{"include":"#declarations-available-types"},{"match":":","name":"invalid.illegal.extra-colon-in-parameter-list.swift"},{"begin":"=","beginCaptures":{"0":{"name":"keyword.operator.assignment.swift"}},"end":"(?=[),])","patterns":[{"include":"#expressions"}]}]}]},"declarations-precedencegroup":{"begin":"\\\\b(precedencegroup)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*(?=\\\\{)","beginCaptures":{"1":{"name":"storage.type.precedencegroup.swift"},"2":{"name":"entity.name.type.precedencegroup.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?!\\\\G)","name":"meta.definition.precedencegroup.swift","patterns":[{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.precedencegroup.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.precedencegroup.end.swift"}},"patterns":[{"include":"#comments"},{"captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"entity.other.inherited-class.swift","patterns":[{"include":"#declarations-types-precedencegroup"}]},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"match":"\\\\b((?:high|low)erThan)\\\\s*:\\\\s*((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))"},{"captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"keyword.other.operator.associativity.swift"}},"match":"\\\\b(associativity)\\\\b(?:\\\\s*:\\\\s*(right|left|none)\\\\b)?"},{"captures":{"1":{"name":"storage.modifier.swift"},"2":{"name":"constant.language.boolean.swift"}},"match":"\\\\b(assignment)\\\\b(?:\\\\s*:\\\\s*(true|false)\\\\b)?"}]}]},"declarations-protocol":{"begin":"\\\\b(protocol)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))","beginCaptures":{"1":{"name":"storage.type.$1.swift"},"2":{"name":"entity.name.type.$1.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?<=})","name":"meta.definition.type.protocol.swift","patterns":[{"include":"#comments"},{"include":"#declarations-inheritance-clause"},{"include":"#declarations-generic-where-clause"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.type.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.type.end.swift"}},"name":"meta.definition.type.body.swift","patterns":[{"include":"#declarations-protocol-protocol-method"},{"include":"#declarations-protocol-protocol-initializer"},{"include":"#declarations-protocol-associated-type"},{"include":"$self"}]}]},"declarations-protocol-associated-type":{"begin":"\\\\b(associatedtype)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*","beginCaptures":{"1":{"name":"keyword.other.declaration-specifier.swift"},"2":{"name":"variable.language.associatedtype.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?!\\\\G)$|(?=[;}]|$)","name":"meta.definition.associatedtype.swift","patterns":[{"include":"#declarations-inheritance-clause"},{"include":"#declarations-generic-where-clause"},{"include":"#declarations-typealias-assignment"}]},"declarations-protocol-protocol-initializer":{"begin":"(?<!\\\\.)\\\\b(init[!?]*)\\\\s*(?=[(<])","beginCaptures":{"1":{"name":"storage.type.function.swift","patterns":[{"match":"(?<=[!?])[!?]+","name":"invalid.illegal.character-not-allowed-here.swift"}]}},"end":"$|(?=;|//|/\\\\*|})","name":"meta.definition.function.initializer.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#async-throws"},{"include":"#declarations-generic-where-clause"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.function.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.function.end.swift"}},"name":"invalid.illegal.function-body-not-allowed-in-protocol.swift","patterns":[{"include":"$self"}]}]},"declarations-protocol-protocol-method":{"begin":"\\\\b(func)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>)|(?:((?<oph>[-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷‖‗†-‧‰-‾⁁-⁓⁕-⁞←-⏿─-❵➔-⯿⸀-⹿、。〃〈-〰])(\\\\g<oph>|(?<opc>[̀-ͯ᷀-᷿⃐-⃿︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))*)|(\\\\.(\\\\g<oph>|\\\\g<opc>|\\\\.)+)))\\\\s*(?=[(<])","beginCaptures":{"1":{"name":"storage.type.function.swift"},"2":{"name":"entity.name.function.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"$|(?=;|//|/\\\\*|})","name":"meta.definition.function.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-parameter-clause"},{"include":"#declarations-function-result"},{"include":"#async-throws"},{"include":"#declarations-generic-where-clause"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.function.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.function.end.swift"}},"name":"invalid.illegal.function-body-not-allowed-in-protocol.swift","patterns":[{"include":"$self"}]}]},"declarations-type":{"patterns":[{"begin":"\\\\b(class(?!\\\\s+(?:func|var|let)\\\\b)|struct|actor)\\\\b\\\\s*((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))","beginCaptures":{"1":{"name":"storage.type.$1.swift"},"2":{"name":"entity.name.type.$1.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?<=})","name":"meta.definition.type.$1.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-generic-where-clause"},{"include":"#declarations-inheritance-clause"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.type.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.type.end.swift"}},"name":"meta.definition.type.body.swift","patterns":[{"include":"$self"}]}]},{"include":"#declarations-type-enum"}]},"declarations-type-enum":{"begin":"\\\\b(enum)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))","beginCaptures":{"1":{"name":"storage.type.$1.swift"},"2":{"name":"entity.name.type.$1.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?<=})","name":"meta.definition.type.$1.swift","patterns":[{"include":"#comments"},{"include":"#declarations-generic-parameter-clause"},{"include":"#declarations-generic-where-clause"},{"include":"#declarations-inheritance-clause"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.type.begin.swift"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.type.end.swift"}},"name":"meta.definition.type.body.swift","patterns":[{"include":"#declarations-type-enum-enum-case-clause"},{"include":"$self"}]}]},"declarations-type-enum-associated-values":{"begin":"\\\\G\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.parameters.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.swift"}},"patterns":[{"include":"#comments"},{"begin":"(?:(_)|((?<q1>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*\\\\k<q1>))\\\\s+(((?<q2>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*\\\\k<q2>))\\\\s*(:)","beginCaptures":{"1":{"name":"entity.name.function.swift"},"2":{"name":"invalid.illegal.distinct-labels-not-allowed.swift"},"5":{"name":"variable.parameter.function.swift"},"7":{"name":"punctuation.separator.argument-label.swift"}},"end":"(?=[]),])","patterns":[{"include":"#declarations-available-types"}]},{"begin":"(((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*\\\\k<q>))\\\\s*(:)","beginCaptures":{"1":{"name":"entity.name.function.swift"},"2":{"name":"variable.parameter.function.swift"},"4":{"name":"punctuation.separator.argument-label.swift"}},"end":"(?=[]),])","patterns":[{"include":"#declarations-available-types"}]},{"begin":"(?![]),])(?=\\\\S)","end":"(?=[]),])","patterns":[{"include":"#declarations-available-types"},{"match":":","name":"invalid.illegal.extra-colon-in-parameter-list.swift"}]}]},"declarations-type-enum-enum-case":{"begin":"((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*","beginCaptures":{"1":{"name":"variable.other.enummember.swift"}},"end":"(?<=\\\\))|(?![(=])","patterns":[{"include":"#comments"},{"include":"#declarations-type-enum-associated-values"},{"include":"#declarations-type-enum-raw-value-assignment"}]},"declarations-type-enum-enum-case-clause":{"begin":"\\\\b(case)\\\\b\\\\s*","beginCaptures":{"1":{"name":"storage.type.enum.case.swift"}},"end":"(?=[;}])|(?!\\\\G)(?!/[*/])(?=[^,\\\\s])","patterns":[{"include":"#comments"},{"include":"#declarations-type-enum-enum-case"},{"include":"#declarations-type-enum-more-cases"}]},"declarations-type-enum-more-cases":{"begin":",\\\\s*","end":"(?!\\\\G)(?!/[*/])(?=[;}[^,\\\\s]])","name":"meta.enum-case.more-cases","patterns":[{"include":"#comments"},{"include":"#declarations-type-enum-enum-case"},{"include":"#declarations-type-enum-more-cases"}]},"declarations-type-enum-raw-value-assignment":{"begin":"(=)\\\\s*","beginCaptures":{"1":{"name":"keyword.operator.assignment.swift"}},"end":"(?!\\\\G)","patterns":[{"include":"#comments"},{"include":"#literals"}]},"declarations-type-identifier":{"begin":"((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*","beginCaptures":{"1":{"name":"meta.type-name.swift","patterns":[{"include":"#builtin-types"}]},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"}},"end":"(?!<)","patterns":[{"begin":"(?=<)","end":"(?!\\\\G)","patterns":[{"include":"#declarations-generic-argument-clause"}]}]},"declarations-type-operators":{"patterns":[{"captures":{"1":{"name":"keyword.operator.type.composition.swift"}},"match":"(?<![-!%\\\\&*+./<=>^|~])(&)(?![-!%\\\\&*+./<=>^|~])"},{"captures":{"1":{"name":"keyword.operator.type.requirement-suppression.swift"}},"match":"(?<![-!%\\\\&*+./<=>^|~])(~)(?![-!%\\\\&*+./<=>^|~])"}]},"declarations-typealias":{"begin":"\\\\b(typealias)\\\\s+((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*","beginCaptures":{"1":{"name":"keyword.other.declaration-specifier.swift"},"2":{"name":"entity.name.type.typealias.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.identifier.swift"}},"end":"(?!\\\\G)$|(?=;|//|/\\\\*|$)","name":"meta.definition.typealias.swift","patterns":[{"begin":"\\\\G(?=<)","end":"(?!\\\\G)","patterns":[{"include":"#declarations-generic-parameter-clause"}]},{"include":"#declarations-typealias-assignment"}]},"declarations-typealias-assignment":{"begin":"(=)\\\\s*","beginCaptures":{"1":{"name":"keyword.operator.assignment.swift"}},"end":"(?!\\\\G)$|(?=;|//|/\\\\*|$)","patterns":[{"include":"#declarations-available-types"}]},"declarations-typed-variable-declaration":{"begin":"\\\\b(?:(async)\\\\s+)?(let|var)\\\\b\\\\s+(?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>)\\\\s*:","beginCaptures":{"1":{"name":"storage.modifier.async.swift"},"2":{"name":"keyword.other.declaration-specifier.swift"}},"end":"(?=$|[={])","patterns":[{"include":"#declarations-available-types"}]},"declarations-types-precedencegroup":{"patterns":[{"match":"\\\\b(?:BitwiseShift|Assignment|RangeFormation|Casting|Addition|NilCoalescing|Comparison|LogicalConjunction|LogicalDisjunction|Default|Ternary|Multiplication|FunctionArrow)Precedence\\\\b","name":"support.type.swift"}]},"expressions":{"patterns":[{"include":"#expressions-without-trailing-closures-or-member-references"},{"include":"#expressions-trailing-closure"},{"include":"#member-reference"}]},"expressions-trailing-closure":{"patterns":[{"captures":{"1":{"name":"support.function.any-method.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"}},"match":"(#?(?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))(?=\\\\s*\\\\{)","name":"meta.function-call.trailing-closure-only.swift"},{"captures":{"1":{"name":"support.function.any-method.trailing-closure-label.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.separator.argument-label.swift"}},"match":"((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*(:)(?=\\\\s*\\\\{)"}]},"expressions-without-trailing-closures":{"patterns":[{"include":"#expressions-without-trailing-closures-or-member-references"},{"include":"#member-references"}]},"expressions-without-trailing-closures-or-member-references":{"patterns":[{"include":"#comments"},{"include":"#code-block"},{"include":"#attributes"},{"include":"#expressions-without-trailing-closures-or-member-references-closure-parameter"},{"include":"#literals"},{"include":"#operators"},{"include":"#builtin-types"},{"include":"#builtin-functions"},{"include":"#builtin-global-functions"},{"include":"#builtin-properties"},{"include":"#expressions-without-trailing-closures-or-member-references-compound-name"},{"include":"#conditionals"},{"include":"#keywords"},{"include":"#expressions-without-trailing-closures-or-member-references-availability-condition"},{"include":"#expressions-without-trailing-closures-or-member-references-function-or-macro-call-expression"},{"include":"#expressions-without-trailing-closures-or-member-references-macro-expansion"},{"include":"#expressions-without-trailing-closures-or-member-references-subscript-expression"},{"include":"#expressions-without-trailing-closures-or-member-references-parenthesized-expression"},{"match":"\\\\b_\\\\b","name":"support.variable.discard-value.swift"}]},"expressions-without-trailing-closures-or-member-references-availability-condition":{"begin":"\\\\B(#(?:un)?available)(\\\\()","beginCaptures":{"1":{"name":"support.function.availability-condition.swift"},"2":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"patterns":[{"captures":{"1":{"name":"keyword.other.platform.os.swift"},"2":{"name":"constant.numeric.swift"}},"match":"\\\\s*\\\\b((?:iOS|macOS|OSX|watchOS|tvOS|visionOS|UIKitForMac)(?:ApplicationExtension)?)\\\\b\\\\s+([0-9]+(?:\\\\.[0-9]+)*)\\\\b"},{"captures":{"1":{"name":"keyword.other.platform.all.swift"},"2":{"name":"invalid.illegal.character-not-allowed-here.swift"}},"match":"(\\\\*)\\\\s*(.*?)(?=[),])"},{"match":"[^),\\\\s]+","name":"invalid.illegal.character-not-allowed-here.swift"}]},"expressions-without-trailing-closures-or-member-references-closure-parameter":{"match":"\\\\$[0-9]+","name":"variable.language.closure-parameter.swift"},"expressions-without-trailing-closures-or-member-references-compound-name":{"captures":{"1":{"name":"entity.name.function.compound-name.swift"},"2":{"name":"punctuation.definition.entity.swift"},"3":{"name":"punctuation.definition.entity.swift"},"4":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.entity.swift"},"2":{"name":"punctuation.definition.entity.swift"}},"match":"(?<q>`?)(?!_:)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>):","name":"entity.name.function.compound-name.swift"}]}},"match":"((?<q1>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q1>))\\\\(((((?<q2>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q2>)):)+)\\\\)"},"expressions-without-trailing-closures-or-member-references-expression-element-list":{"patterns":[{"include":"#comments"},{"begin":"((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*(:)","beginCaptures":{"1":{"name":"support.function.any-method.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.separator.argument-label.swift"}},"end":"(?=[]),])","patterns":[{"include":"#expressions"}]},{"begin":"(?![]),])(?=\\\\S)","end":"(?=[]),])","patterns":[{"include":"#expressions"}]}]},"expressions-without-trailing-closures-or-member-references-function-or-macro-call-expression":{"patterns":[{"begin":"(#?(?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))\\\\s*(\\\\()","beginCaptures":{"1":{"name":"support.function.any-method.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"},"4":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.function-call.swift","patterns":[{"include":"#expressions-without-trailing-closures-or-member-references-expression-element-list"}]},{"begin":"(?<=[])>_`}\\\\p{L}\\\\p{N}\\\\p{M}])\\\\s*(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.function-call.swift","patterns":[{"include":"#expressions-without-trailing-closures-or-member-references-expression-element-list"}]}]},"expressions-without-trailing-closures-or-member-references-macro-expansion":{"match":"(#(?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))","name":"support.function.any-method.swift"},"expressions-without-trailing-closures-or-member-references-parenthesized-expression":{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.tuple.begin.swift"}},"end":"(\\\\))\\\\s*((?:\\\\b(?:async|throws|rethrows)\\\\s)*)","endCaptures":{"1":{"name":"punctuation.section.tuple.end.swift"},"2":{"patterns":[{"match":"\\\\brethrows\\\\b","name":"invalid.illegal.rethrows-only-allowed-on-function-declarations.swift"},{"include":"#async-throws"}]}},"patterns":[{"include":"#expressions-without-trailing-closures-or-member-references-expression-element-list"}]},"expressions-without-trailing-closures-or-member-references-subscript-expression":{"begin":"(?<=[_`\\\\p{L}\\\\p{N}\\\\p{M}])\\\\s*(\\\\[)","beginCaptures":{"1":{"name":"punctuation.definition.arguments.begin.swift"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"name":"meta.subscript-expression.swift","patterns":[{"include":"#expressions-without-trailing-closures-or-member-references-expression-element-list"}]},"keywords":{"patterns":[{"match":"(?<!\\\\.)\\\\b(?:if|else|guard|where|switch|case|default|fallthrough)\\\\b","name":"keyword.control.branch.swift"},{"match":"(?<!\\\\.)\\\\b(?:continue|break|fallthrough|return|yield)\\\\b","name":"keyword.control.transfer.swift"},{"match":"(?<!\\\\.)\\\\b(?:while|for|in|each)\\\\b","name":"keyword.control.loop.swift"},{"match":"(?<=\\\\s)\\\\bof\\\\b(?=\\\\s+[(\\\\[_\\\\p{L}\\\\d\\\\p{N}\\\\p{M}])","name":"keyword.other.inline-array.swift"},{"match":"\\\\bany\\\\b(?=\\\\s*`?[_\\\\p{L}])","name":"keyword.other.operator.type.existential.swift"},{"captures":{"1":{"name":"keyword.control.loop.swift"},"2":{"name":"punctuation.whitespace.trailing.repeat.swift"}},"match":"(?<!\\\\.)\\\\b(repeat)\\\\b(\\\\s*)"},{"match":"(?<!\\\\.)\\\\bdefer\\\\b","name":"keyword.control.defer.swift"},{"captures":{"1":{"name":"invalid.illegal.try-must-precede-await.swift"},"2":{"name":"keyword.control.await.swift"}},"match":"(?<!\\\\.)\\\\b(?:(await\\\\s+try)|(await))\\\\b"},{"match":"(?<!\\\\.)\\\\b(?:catch|throw|try)\\\\b|\\\\btry[!?]\\\\B","name":"keyword.control.exception.swift"},{"match":"(?<!\\\\.)\\\\b(?:|re)throws\\\\b","name":"storage.modifier.exception.swift"},{"captures":{"1":{"name":"keyword.control.exception.swift"},"2":{"name":"punctuation.whitespace.trailing.do.swift"}},"match":"(?<!\\\\.)\\\\b(do)\\\\b(\\\\s*)"},{"captures":{"1":{"name":"storage.modifier.async.swift"},"2":{"name":"keyword.other.declaration-specifier.swift"}},"match":"(?<!\\\\.)\\\\b(?:(async)\\\\s+)?(let|var)\\\\b"},{"match":"(?<!\\\\.)\\\\b(?:associatedtype|operator|typealias)\\\\b","name":"keyword.other.declaration-specifier.swift"},{"match":"(?<!\\\\.)\\\\b(class|enum|extension|precedencegroup|protocol|struct|actor)\\\\b(?=\\\\s*`?[_\\\\p{L}])","name":"storage.type.$1.swift"},{"match":"(?<!\\\\.)\\\\b(?:inout|static|final|lazy|mutating|nonmutating|optional|indirect|required|override|dynamic|convenience|infix|prefix|postfix|distributed|nonisolated|borrowing|consuming)\\\\b","name":"storage.modifier.swift"},{"match":"\\\\binit[!?]|\\\\binit\\\\b|(?<!\\\\.)\\\\b(?:func|deinit|subscript|didSet|get|set|willSet|yielding\\\\s+borrow|yielding\\\\s+mutate)\\\\b","name":"storage.type.function.swift"},{"match":"(?<!\\\\.)\\\\b(?:fileprivate|private|internal|public|open|package)\\\\b","name":"keyword.other.declaration-specifier.accessibility.swift"},{"match":"(?<!\\\\.)\\\\bunowned\\\\((?:|un)safe\\\\)|(?<!\\\\.)\\\\b(?:weak|unowned)\\\\b","name":"keyword.other.capture-specifier.swift"},{"captures":{"1":{"name":"keyword.other.type.swift"},"2":{"name":"keyword.other.type.metatype.swift"}},"match":"(?<=\\\\.)(?:(dynamicType|self)|(Protocol|Type))\\\\b"},{"match":"(?<!\\\\.)\\\\b(?:super|self|Self)\\\\b","name":"variable.language.swift"},{"match":"(?:\\\\B#(?:file|filePath|fileID|line|column|function|dsohandle)|\\\\b__(?:FILE|LINE|COLUMN|FUNCTION|DSO_HANDLE)__)\\\\b","name":"support.variable.swift"},{"match":"(?<!\\\\.)\\\\bimport\\\\b","name":"keyword.control.import.swift"},{"match":"(?<!\\\\.)\\\\bconsume(?=\\\\s+`?[_\\\\p{L}])","name":"keyword.control.consume.swift"},{"match":"(?<!\\\\.)\\\\bcopy(?=\\\\s+`?[_\\\\p{L}])","name":"keyword.control.copy.swift"}]},"literals":{"patterns":[{"include":"#literals-boolean"},{"include":"#literals-numeric"},{"include":"#literals-string"},{"match":"\\\\bnil\\\\b","name":"constant.language.nil.swift"},{"match":"\\\\B#((?:color|image|file)Literal)\\\\b","name":"support.function.object-literal.swift"},{"match":"\\\\B#externalMacro\\\\b","name":"support.function.builtin-macro.swift"},{"match":"\\\\B#keyPath\\\\b","name":"support.function.key-path.swift"},{"begin":"\\\\B(#selector)(\\\\()(?:\\\\s*([gs]etter)\\\\s*(:))?","beginCaptures":{"1":{"name":"support.function.selector-reference.swift"},"2":{"name":"punctuation.definition.arguments.begin.swift"},"3":{"name":"support.variable.parameter.swift"},"4":{"name":"punctuation.separator.argument-label.swift"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.arguments.end.swift"}},"patterns":[{"include":"#expressions"}]},{"include":"#literals-regular-expression-literal"}]},"literals-boolean":{"match":"\\\\b(true|false)\\\\b","name":"constant.language.boolean.swift"},"literals-numeric":{"patterns":[{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)[0-9][0-9_]*(?=\\\\.[0-9]|[Ee])(?:\\\\.[0-9][0-9_]*)?(?:[Ee][-+]?[0-9][0-9_]*)?\\\\b(?!\\\\.[0-9])","name":"constant.numeric.float.decimal.swift"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)(0x\\\\h[_\\\\h]*)(?:\\\\.\\\\h[_\\\\h]*)?[Pp][-+]?[0-9][0-9_]*\\\\b(?!\\\\.[0-9])","name":"constant.numeric.float.hexadecimal.swift"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)(0x\\\\h[_\\\\h]*)(?:\\\\.\\\\h[_\\\\h]*)?[Pp][-+]?\\\\w*\\\\b(?!\\\\.[0-9])","name":"invalid.illegal.numeric.float.invalid-exponent.swift"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)(0x\\\\h[_\\\\h]*)\\\\.[0-9][.\\\\w]*","name":"invalid.illegal.numeric.float.missing-exponent.swift"},{"match":"(?<=\\\\s|^)-?\\\\.[0-9][.\\\\w]*","name":"invalid.illegal.numeric.float.missing-leading-zero.swift"},{"match":"(\\\\B-|\\\\b)0[box]_[_\\\\h]*(?:[EPep][-+]?\\\\w+)?[.\\\\w]+","name":"invalid.illegal.numeric.leading-underscore.swift"},{"match":"(?<=[]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)[0-9]+\\\\b"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)0b[01][01_]*\\\\b(?!\\\\.[0-9])","name":"constant.numeric.integer.binary.swift"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)0o[0-7][0-7_]*\\\\b(?!\\\\.[0-9])","name":"constant.numeric.integer.octal.swift"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)[0-9][0-9_]*\\\\b(?!\\\\.[0-9])","name":"constant.numeric.integer.decimal.swift"},{"match":"(\\\\B-|\\\\b)(?<![]()\\\\[_{}\\\\p{L}\\\\p{N}\\\\p{M}]\\\\.)0x\\\\h[_\\\\h]*\\\\b(?!\\\\.[0-9])","name":"constant.numeric.integer.hexadecimal.swift"},{"match":"(\\\\B-|\\\\b)[0-9][.\\\\w]*","name":"invalid.illegal.numeric.other.swift"}]},"literals-regular-expression-literal":{"patterns":[{"begin":"(#+)/\\\\n","end":"/\\\\1","name":"string.regexp.block.swift","patterns":[{"include":"#literals-regular-expression-literal-regex-guts"},{"include":"#literals-regular-expression-literal-line-comment"}]},{"captures":{"0":{"patterns":[{"include":"#literals-regular-expression-literal-regex-guts"}]},"1":{"name":"punctuation.definition.string.begin.regexp.swift"},"3":{"name":"punctuation.definition.string.end.regexp.swift"}},"match":"(/)(?!\\\\s)(?!/)(?:\\\\\\\\\\\\s(?=/)|(?<guts>(?>(?:\\\\\\\\Q(?:(?!\\\\\\\\E)(?!/).)*+(?:\\\\\\\\E|(?=/))|\\\\\\\\.|\\\\(\\\\?#[^)]*\\\\)|\\\\(\\\\?(?>\\\\{(?:[^{].*?|\\\\{[^{].*?}|\\\\{\\\\{[^{].*?}}|\\\\{\\\\{\\\\{[^{].*?}}}|\\\\{\\\\{\\\\{\\\\{[^{].*?}}}}|\\\\{\\\\{\\\\{\\\\{\\\\{.+?}}}}})})(?:\\\\[(?!\\\\d)\\\\w+])?[<>X]?\\\\)|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\]|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\]|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\]|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\])+])+])+])+]|\\\\(\\\\g<guts>?+\\\\)|(?:(?!/)[^()\\\\[\\\\\\\\])+)+))?+(?<!\\\\s))(/)","name":"string.regexp.line.swift"},{"captures":{"0":{"patterns":[{"include":"#literals-regular-expression-literal-regex-guts"}]},"1":{"name":"punctuation.definition.string.begin.regexp.swift"},"4":{"name":"punctuation.definition.string.end.regexp.swift"},"5":{"name":"invalid.illegal.returns-not-allowed.regexp"}},"match":"((#+)/)(?<guts>(?>(?:\\\\\\\\Q(?:(?!\\\\\\\\E)(?!/\\\\2).)*+(?:\\\\\\\\E|(?=/\\\\2))|\\\\\\\\.|\\\\(\\\\?#[^)]*\\\\)|\\\\(\\\\?(?>\\\\{(?:[^{].*?|\\\\{[^{].*?}|\\\\{\\\\{[^{].*?}}|\\\\{\\\\{\\\\{[^{].*?}}}|\\\\{\\\\{\\\\{\\\\{[^{].*?}}}}|\\\\{\\\\{\\\\{\\\\{\\\\{.+?}}}}})})(?:\\\\[(?!\\\\d)\\\\w+])?[<>X]?\\\\)|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\]|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\]|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\]|\\\\[(?:\\\\\\\\.|[^]\\\\[\\\\\\\\])+])+])+])+]|\\\\(\\\\g<guts>?+\\\\)|(?:(?!/\\\\2)[^()\\\\[\\\\\\\\])+)+))?+(/\\\\2)|#+/.+(\\\\n)","name":"string.regexp.line.extended.swift"}]},"literals-regular-expression-literal-backreference-or-subpattern":{"patterns":[{"captures":{"1":{"name":"constant.character.escape.backslash.regexp"},"2":{"name":"variable.other.group-name.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"constant.numeric.integer.decimal.regexp"},"6":{"name":"keyword.operator.recursion-level.regexp"},"7":{"name":"constant.numeric.integer.decimal.regexp"},"8":{"name":"constant.character.escape.backslash.regexp"}},"match":"(\\\\\\\\g\\\\{)(?:((?!\\\\d)\\\\w+)(?:([-+])(\\\\d+))?|([-+]?\\\\d+)(?:([-+])(\\\\d+))?)(})"},{"captures":{"1":{"name":"constant.character.escape.backslash.regexp"},"2":{"name":"constant.numeric.integer.decimal.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"}},"match":"(\\\\\\\\g)([-+]?\\\\d+)(?:([-+])(\\\\d+))?"},{"captures":{"1":{"name":"constant.character.escape.backslash.regexp"},"2":{"name":"variable.other.group-name.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"constant.numeric.integer.decimal.regexp"},"6":{"name":"keyword.operator.recursion-level.regexp"},"7":{"name":"constant.numeric.integer.decimal.regexp"},"8":{"name":"constant.character.escape.backslash.regexp"}},"match":"(\\\\\\\\[gk]<)(?:((?!\\\\d)\\\\w+)(?:([-+])(\\\\d+))?|([-+]?\\\\d+)(?:([-+])(\\\\d+))?)(>)"},{"captures":{"1":{"name":"constant.character.escape.backslash.regexp"},"2":{"name":"variable.other.group-name.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"constant.numeric.integer.decimal.regexp"},"6":{"name":"keyword.operator.recursion-level.regexp"},"7":{"name":"constant.numeric.integer.decimal.regexp"},"8":{"name":"constant.character.escape.backslash.regexp"}},"match":"(\\\\\\\\[gk]\')(?:((?!\\\\d)\\\\w+)(?:([-+])(\\\\d+))?|([-+]?\\\\d+)(?:([-+])(\\\\d+))?)(\')"},{"captures":{"1":{"name":"constant.character.escape.backslash.regexp"},"2":{"name":"variable.other.group-name.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"constant.character.escape.backslash.regexp"}},"match":"(\\\\\\\\k\\\\{)((?!\\\\d)\\\\w+)(?:([-+])(\\\\d+))?(})"},{"match":"\\\\\\\\[1-9][0-9]+","name":"keyword.other.back-reference.regexp"},{"captures":{"1":{"name":"keyword.other.back-reference.regexp"},"2":{"name":"variable.other.group-name.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"keyword.other.back-reference.regexp"}},"match":"(\\\\(\\\\?(?:P[=>]|&))((?!\\\\d)\\\\w+)(?:([-+])(\\\\d+))?(\\\\))"},{"match":"\\\\(\\\\?R\\\\)","name":"keyword.other.back-reference.regexp"},{"captures":{"1":{"name":"keyword.other.back-reference.regexp"},"2":{"name":"constant.numeric.integer.decimal.regexp"},"3":{"name":"keyword.operator.recursion-level.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"keyword.other.back-reference.regexp"}},"match":"(\\\\(\\\\?)([-+]?\\\\d+)(?:([-+])(\\\\d+))?(\\\\))"}]},"literals-regular-expression-literal-backtracking-directive-or-global-matching-option":{"captures":{"1":{"name":"keyword.control.directive.regexp"},"2":{"name":"keyword.control.directive.regexp"},"3":{"name":"keyword.control.directive.regexp"},"4":{"name":"variable.language.tag.regexp"},"5":{"name":"keyword.control.directive.regexp"},"6":{"name":"keyword.operator.assignment.regexp"},"7":{"name":"constant.numeric.integer.decimal.regexp"},"8":{"name":"keyword.control.directive.regexp"},"9":{"name":"keyword.control.directive.regexp"}},"match":"(\\\\(\\\\*)(?:(ACCEPT|FAIL|F|MARK(?=:)|(?=:)|COMMIT|PRUNE|SKIP|THEN)(?:(:)([^)]+))?|(LIMIT_(?:DEPTH|HEAP|MATCH))(=)(\\\\d+)|(CRLF|CR|ANYCRLF|ANY|LF|NUL|BSR_ANYCRLF|BSR_UNICODE|NOTEMPTY_ATSTART|NOTEMPTY|NO_AUTO_POSSESS|NO_DOTSTAR_ANCHOR|NO_JIT|NO_START_OPT|UTF|UCP))(\\\\))"},"literals-regular-expression-literal-callout":{"captures":{"1":{"name":"punctuation.definition.group.regexp"},"2":{"name":"keyword.control.callout.regexp"},"3":{"name":"constant.numeric.integer.decimal.regexp"},"4":{"name":"entity.name.function.callout.regexp"},"5":{"name":"entity.name.function.callout.regexp"},"6":{"name":"entity.name.function.callout.regexp"},"7":{"name":"entity.name.function.callout.regexp"},"8":{"name":"entity.name.function.callout.regexp"},"9":{"name":"entity.name.function.callout.regexp"},"10":{"name":"entity.name.function.callout.regexp"},"11":{"name":"entity.name.function.callout.regexp"},"12":{"name":"punctuation.definition.group.regexp"},"13":{"name":"punctuation.definition.group.regexp"},"14":{"name":"keyword.control.callout.regexp"},"15":{"name":"entity.name.function.callout.regexp"},"16":{"name":"variable.language.tag-name.regexp"},"17":{"name":"punctuation.definition.group.regexp"},"18":{"name":"punctuation.definition.group.regexp"},"19":{"name":"keyword.control.callout.regexp"},"21":{"name":"variable.language.tag-name.regexp"},"22":{"name":"keyword.control.callout.regexp"},"23":{"name":"punctuation.definition.group.regexp"}},"match":"(\\\\()(?<keyw>\\\\?C)(?:(?<num>\\\\d+)|`(?<name>(?:[^`]|``)*)`|\'(?<name>(?:[^\']|\'\')*)\'|\\"(?<name>(?:[^\\"]|\\"\\")*)\\"|\\\\^(?<name>(?:[^^]|\\\\^\\\\^)*)\\\\^|%(?<name>(?:[^%]|%%)*)%|#(?<name>(?:[^#]|##)*)#|\\\\$(?<name>(?:[^$]|\\\\$\\\\$)*)\\\\$|\\\\{(?<name>(?:[^}]|}})*)})?(\\\\))|(\\\\()(?<keyw>\\\\*)(?<name>(?!\\\\d)\\\\w+)(?:\\\\[(?<tag>(?!\\\\d)\\\\w+)])?(?:\\\\{[^,}]+(?:,[^,}]+)*})?(\\\\))|(\\\\()(?<keyw>\\\\?)(?>(\\\\{(?:\\\\g<20>|(?!\\\\{).*?)}))(?:\\\\[(?<tag>(?!\\\\d)\\\\w+)])?(?<keyw>[<>X]?)(\\\\))","name":"meta.callout.regexp"},"literals-regular-expression-literal-character-properties":{"captures":{"1":{"name":"support.variable.character-property.regexp"},"2":{"name":"punctuation.definition.character-class.regexp"},"3":{"name":"support.variable.character-property.regexp"},"4":{"name":"punctuation.definition.character-class.regexp"}},"match":"\\\\\\\\[Pp]\\\\{([-\\\\s\\\\w]+(?:=[-\\\\s\\\\w]+)?)}|(\\\\[:)([-\\\\s\\\\w]+(?:=[-\\\\s\\\\w]+)?)(:])","name":"constant.other.character-class.set.regexp"},"literals-regular-expression-literal-custom-char-class":{"patterns":[{"begin":"(\\\\[)(\\\\^)?","beginCaptures":{"1":{"name":"punctuation.definition.character-class.regexp"},"2":{"name":"keyword.operator.negation.regexp"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.character-class.regexp"}},"name":"constant.other.character-class.set.regexp","patterns":[{"include":"#literals-regular-expression-literal-custom-char-class-members"}]}]},"literals-regular-expression-literal-custom-char-class-members":{"patterns":[{"match":"\\\\\\\\b","name":"constant.character.escape.backslash.regexp"},{"include":"#literals-regular-expression-literal-custom-char-class"},{"include":"#literals-regular-expression-literal-quote"},{"include":"#literals-regular-expression-literal-set-operators"},{"include":"#literals-regular-expression-literal-unicode-scalars"},{"include":"#literals-regular-expression-literal-character-properties"}]},"literals-regular-expression-literal-group-option-toggle":{"match":"\\\\(\\\\?(?:\\\\^(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})*|(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})+|(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})*-(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})*)\\\\)","name":"keyword.other.option-toggle.regexp"},"literals-regular-expression-literal-group-or-conditional":{"patterns":[{"begin":"(\\\\()(\\\\?~)","beginCaptures":{"1":{"name":"punctuation.definition.group.regexp"},"2":{"name":"keyword.control.conditional.absent.regexp"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.regexp"}},"name":"meta.group.absent.regexp","patterns":[{"include":"#literals-regular-expression-literal-regex-guts"}]},{"begin":"(\\\\()(?<cond>\\\\?\\\\()(?:(?<NumberRef>(?<num>[-+]?\\\\d+)(?:(?<op>[-+])(?<num>\\\\d+))?)|(?<cond>R)\\\\g<NumberRef>?|(?<cond>R&)(?<NamedRef>(?<name>(?!\\\\d)\\\\w+)(?:(?<op>[-+])(?<num>\\\\d+))?)|(?<cond><)(?:\\\\g<NamedRef>|\\\\g<NumberRef>)(?<cond>>)|(?<cond>\')(?:\\\\g<NamedRef>|\\\\g<NumberRef>)(?<cond>\')|(?<cond>DEFINE)|(?<cond>VERSION)(?<compar>>?=)(?<num>\\\\d+\\\\.\\\\d+))(?<cond>\\\\))|(\\\\()(?<cond>\\\\?)(?=\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.group.regexp"},"2":{"name":"keyword.control.conditional.regexp"},"4":{"name":"constant.numeric.integer.decimal.regexp"},"5":{"name":"keyword.operator.recursion-level.regexp"},"6":{"name":"constant.numeric.integer.decimal.regexp"},"7":{"name":"keyword.control.conditional.regexp"},"8":{"name":"keyword.control.conditional.regexp"},"10":{"name":"variable.other.group-name.regexp"},"11":{"name":"keyword.operator.recursion-level.regexp"},"12":{"name":"constant.numeric.integer.decimal.regexp"},"13":{"name":"keyword.control.conditional.regexp"},"14":{"name":"keyword.control.conditional.regexp"},"15":{"name":"keyword.control.conditional.regexp"},"16":{"name":"keyword.control.conditional.regexp"},"17":{"name":"keyword.control.conditional.regexp"},"18":{"name":"keyword.control.conditional.regexp"},"19":{"name":"keyword.operator.comparison.regexp"},"20":{"name":"constant.numeric.integer.decimal.regexp"},"21":{"name":"keyword.control.conditional.regexp"},"22":{"name":"punctuation.definition.group.regexp"},"23":{"name":"keyword.control.conditional.regexp"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.regexp"}},"name":"meta.group.conditional.regexp","patterns":[{"include":"#literals-regular-expression-literal-regex-guts"}]},{"begin":"(\\\\()((\\\\?)(?:([!*:=>|]|<[!*=])|P?<(?:((?!\\\\d)\\\\w+)(-))?((?!\\\\d)\\\\w+)>|\'(?:((?!\\\\d)\\\\w+)(-))?((?!\\\\d)\\\\w+)\'|(?:\\\\^(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})*|(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})+|(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})*-(?:[DJPSUWimnswx]|xx|y\\\\{[gw]})*):)|\\\\*(atomic|pla|positive_lookahead|nla|negative_lookahead|plb|positive_lookbehind|nlb|negative_lookbehind|napla|non_atomic_positive_lookahead|naplb|non_atomic_positive_lookbehind|sr|script_run|asr|atomic_script_run):)?+","beginCaptures":{"1":{"name":"punctuation.definition.group.regexp"},"2":{"name":"keyword.other.group-options.regexp"},"3":{"name":"punctuation.definition.group.regexp"},"4":{"name":"punctuation.definition.group.regexp"},"5":{"name":"variable.other.group-name.regexp"},"6":{"name":"keyword.operator.balancing-group.regexp"},"7":{"name":"variable.other.group-name.regexp"},"8":{"name":"variable.other.group-name.regexp"},"9":{"name":"keyword.operator.balancing-group.regexp"},"10":{"name":"variable.other.group-name.regexp"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.regexp"}},"name":"meta.group.regexp","patterns":[{"include":"#literals-regular-expression-literal-regex-guts"}]}]},"literals-regular-expression-literal-line-comment":{"captures":{"1":{"name":"punctuation.definition.comment.regexp"}},"match":"(#).*$","name":"comment.line.regexp"},"literals-regular-expression-literal-quote":{"begin":"\\\\\\\\Q","beginCaptures":{"0":{"name":"constant.character.escape.backslash.regexp"}},"end":"\\\\\\\\E|(\\\\n)","endCaptures":{"0":{"name":"constant.character.escape.backslash.regexp"},"1":{"name":"invalid.illegal.returns-not-allowed.regexp"}},"name":"string.quoted.other.regexp.swift"},"literals-regular-expression-literal-regex-guts":{"patterns":[{"include":"#literals-regular-expression-literal-quote"},{"begin":"\\\\(\\\\?#","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.regexp"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.comment.end.regexp"}},"name":"comment.block.regexp"},{"begin":"<\\\\{","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.regexp"}},"end":"}>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.regexp"}},"name":"meta.embedded.expression.regexp"},{"include":"#literals-regular-expression-literal-unicode-scalars"},{"include":"#literals-regular-expression-literal-character-properties"},{"match":"[$^]|\\\\\\\\[ABGYZbyz]|\\\\\\\\K","name":"keyword.control.anchor.regexp"},{"include":"#literals-regular-expression-literal-backtracking-directive-or-global-matching-option"},{"include":"#literals-regular-expression-literal-callout"},{"include":"#literals-regular-expression-literal-backreference-or-subpattern"},{"match":"\\\\.|\\\\\\\\[CDHNORSVWXdhsvw]","name":"constant.character.character-class.regexp"},{"match":"\\\\\\\\c.","name":"constant.character.entity.control-character.regexp"},{"match":"\\\\\\\\[^c]","name":"constant.character.escape.backslash.regexp"},{"match":"\\\\|","name":"keyword.operator.or.regexp"},{"match":"[*+?]","name":"keyword.operator.quantifier.regexp"},{"match":"\\\\{(?:\\\\s*\\\\d+\\\\s*(?:,\\\\s*\\\\d*\\\\s*)?}|\\\\s*,\\\\s*\\\\d+\\\\s*})","name":"keyword.operator.quantifier.regexp"},{"include":"#literals-regular-expression-literal-custom-char-class"},{"include":"#literals-regular-expression-literal-group-option-toggle"},{"include":"#literals-regular-expression-literal-group-or-conditional"}]},"literals-regular-expression-literal-set-operators":{"patterns":[{"match":"&&","name":"keyword.operator.intersection.regexp.swift"},{"match":"--","name":"keyword.operator.subtraction.regexp.swift"},{"match":"~~","name":"keyword.operator.symmetric-difference.regexp.swift"}]},"literals-regular-expression-literal-unicode-scalars":{"match":"\\\\\\\\(?:u\\\\{\\\\s*(?:\\\\h+\\\\s*)+}|u\\\\h{4}|x\\\\{\\\\h+}|x\\\\h{0,2}|U\\\\h{8}|o\\\\{[0-7]+}|0[0-7]{0,3}|N\\\\{(?:U\\\\+\\\\h{1,8}|[-\\\\s\\\\w]+)})","name":"constant.character.numeric.regexp"},"literals-string":{"patterns":[{"begin":"\\"\\"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.swift"}},"end":"\\"\\"\\"(#*)","endCaptures":{"0":{"name":"punctuation.definition.string.end.swift"},"1":{"name":"invalid.illegal.extra-closing-delimiter.swift"}},"name":"string.quoted.double.block.swift","patterns":[{"match":"\\\\G(?:.+(?=\\"\\"\\")|.+)","name":"invalid.illegal.content-after-opening-delimiter.swift"},{"match":"\\\\\\\\\\\\s*\\\\n","name":"constant.character.escape.newline.swift"},{"include":"#literals-string-string-guts"},{"match":"\\\\S((?!\\\\\\\\\\\\().)*(?=\\"\\"\\")","name":"invalid.illegal.content-before-closing-delimiter.swift"}]},{"begin":"#\\"\\"\\"(?!#)(?=(?:[^\\"]|\\"(?!#))*$)","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.swift"}},"end":"\\"\\"\\"#(#*)","endCaptures":{"0":{"name":"punctuation.definition.string.end.swift"},"1":{"name":"invalid.illegal.extra-closing-delimiter.swift"}},"name":"string.quoted.double.block.raw.swift","patterns":[{"match":"\\\\G(?:.+(?=\\"\\"\\")|.+)","name":"invalid.illegal.content-after-opening-delimiter.swift"},{"match":"\\\\\\\\#\\\\s*\\\\n","name":"constant.character.escape.newline.swift"},{"include":"#literals-string-raw-string-guts"},{"match":"\\\\S((?!\\\\\\\\#\\\\().)*(?=\\"\\"\\")","name":"invalid.illegal.content-before-closing-delimiter.swift"}]},{"begin":"(?<!#)(##+)\\"\\"\\"(?!\\\\1)(?=(?:[^\\"]|\\"(?!\\\\1))*$)","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.swift"}},"end":"\\"\\"\\"\\\\1(#*)","endCaptures":{"0":{"name":"punctuation.definition.string.end.swift"},"1":{"name":"invalid.illegal.extra-closing-delimiter.swift"}},"name":"string.quoted.double.block.raw.swift","patterns":[{"match":"\\\\G(?:.+(?=\\"\\"\\")|.+)","name":"invalid.illegal.content-after-opening-delimiter.swift"}]},{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.swift"}},"end":"\\"(#*)","endCaptures":{"0":{"name":"punctuation.definition.string.end.swift"},"1":{"name":"invalid.illegal.extra-closing-delimiter.swift"}},"name":"string.quoted.double.single-line.swift","patterns":[{"match":"[\\\\n\\\\r]","name":"invalid.illegal.returns-not-allowed.swift"},{"include":"#literals-string-string-guts"}]},{"begin":"(?<!#)(##+)\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.raw.swift"}},"end":"\\"\\\\1(#*)","endCaptures":{"0":{"name":"punctuation.definition.string.end.raw.swift"},"1":{"name":"invalid.illegal.extra-closing-delimiter.swift"}},"name":"string.quoted.double.single-line.raw.swift","patterns":[{"match":"[\\\\n\\\\r]","name":"invalid.illegal.returns-not-allowed.swift"}]},{"begin":"#\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.raw.swift"}},"end":"\\"#(#*)","endCaptures":{"0":{"name":"punctuation.definition.string.end.raw.swift"},"1":{"name":"invalid.illegal.extra-closing-delimiter.swift"}},"name":"string.quoted.double.single-line.raw.swift","patterns":[{"match":"[\\\\n\\\\r]","name":"invalid.illegal.returns-not-allowed.swift"},{"include":"#literals-string-raw-string-guts"}]}]},"literals-string-raw-string-guts":{"patterns":[{"match":"\\\\\\\\#[\\"\'0\\\\\\\\nrt]","name":"constant.character.escape.swift"},{"match":"\\\\\\\\#u\\\\{\\\\h{1,8}}","name":"constant.character.escape.unicode.swift"},{"begin":"\\\\\\\\#\\\\(","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.swift"}},"contentName":"source.swift","end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.embedded.end.swift"}},"name":"meta.embedded.line.swift","patterns":[{"include":"$self"},{"begin":"\\\\(","end":"\\\\)"}]},{"match":"\\\\\\\\#.","name":"invalid.illegal.escape-not-recognized"}]},"literals-string-string-guts":{"patterns":[{"match":"\\\\\\\\[\\"\'0\\\\\\\\nrt]","name":"constant.character.escape.swift"},{"match":"\\\\\\\\u\\\\{\\\\h{1,8}}","name":"constant.character.escape.unicode.swift"},{"begin":"\\\\\\\\\\\\(","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.swift"}},"contentName":"source.swift","end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.embedded.end.swift"}},"name":"meta.embedded.line.swift","patterns":[{"include":"$self"},{"begin":"\\\\(","end":"\\\\)"}]},{"match":"\\\\\\\\.","name":"invalid.illegal.escape-not-recognized"}]},"member-reference":{"patterns":[{"captures":{"1":{"name":"variable.other.swift"},"2":{"name":"punctuation.definition.identifier.swift"},"3":{"name":"punctuation.definition.identifier.swift"}},"match":"(?<=\\\\.)((?<q>`?)[_\\\\p{L}][_\\\\p{L}\\\\p{N}\\\\p{M}]*(\\\\k<q>))"}]},"operators":{"patterns":[{"match":"\\\\b(is\\\\b|as([!?]\\\\B|\\\\b))","name":"keyword.operator.type-casting.swift"},{"begin":"(?=(?<oph>[-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷‖‗†-‧‰-‾⁁-⁓⁕-⁞←-⏿─-❵➔-⯿⸀-⹿、。〃〈-〰])|\\\\.(\\\\g<oph>|[.̀-ͯ᷀-᷿⃐-⃿︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))","end":"(?!\\\\G)","patterns":[{"captures":{"0":{"patterns":[{"match":"\\\\G(\\\\+\\\\+|--)$","name":"keyword.operator.increment-or-decrement.swift"},{"match":"\\\\G([-+])$","name":"keyword.operator.arithmetic.unary.swift"},{"match":"\\\\G!$","name":"keyword.operator.logical.not.swift"},{"match":"\\\\G~$","name":"keyword.operator.bitwise.not.swift"},{"match":".+","name":"keyword.operator.custom.prefix.swift"}]}},"match":"\\\\G(?<=^|[(,:;\\\\[{\\\\s])((?!(//|/\\\\*|\\\\*/))([-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷̀-ͯ᷀-᷿‖‗†-‧‰-‾⁁-⁓⁕-⁞⃐-⃿←-⏿─-❵➔-⯿⸀-⹿、。〃〈-〰︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))++(?![]),:;}\\\\s]|\\\\z)"},{"captures":{"0":{"patterns":[{"match":"\\\\G(\\\\+\\\\+|--)$","name":"keyword.operator.increment-or-decrement.swift"},{"match":"\\\\G!$","name":"keyword.operator.increment-or-decrement.swift"},{"match":".+","name":"keyword.operator.custom.postfix.swift"}]}},"match":"\\\\G(?<!^|[(,:;\\\\[{\\\\s])((?!(//|/\\\\*|\\\\*/))([-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷̀-ͯ᷀-᷿‖‗†-‧‰-‾⁁-⁓⁕-⁞⃐-⃿←-⏿─-❵➔-⯿⸀-⹿、。〃〈-〰︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))++(?=[]),:;}\\\\s]|\\\\z)"},{"captures":{"0":{"patterns":[{"match":"\\\\G=$","name":"keyword.operator.assignment.swift"},{"match":"\\\\G([-%*+/]|<<|>>|[\\\\&^|]|&&|\\\\|\\\\|)=$","name":"keyword.operator.assignment.compound.swift"},{"match":"\\\\G([-*+/])$","name":"keyword.operator.arithmetic.swift"},{"match":"\\\\G&([-*+])$","name":"keyword.operator.arithmetic.overflow.swift"},{"match":"\\\\G%$","name":"keyword.operator.arithmetic.remainder.swift"},{"match":"\\\\G(==|!=|[<>]|>=|<=|~=)$","name":"keyword.operator.comparison.swift"},{"match":"\\\\G\\\\?\\\\?$","name":"keyword.operator.coalescing.swift"},{"match":"\\\\G(&&|\\\\|\\\\|)$","name":"keyword.operator.logical.swift"},{"match":"\\\\G([\\\\&^|]|<<|>>)$","name":"keyword.operator.bitwise.swift"},{"match":"\\\\G([!=]==)$","name":"keyword.operator.bitwise.swift"},{"match":"\\\\G\\\\?$","name":"keyword.operator.ternary.swift"},{"match":".+","name":"keyword.operator.custom.infix.swift"}]}},"match":"\\\\G((?!(//|/\\\\*|\\\\*/))([-!%\\\\&*+/<-?^|~¡-§©«¬®°±¶»¿×÷̀-ͯ᷀-᷿‖‗†-‧‰-‾⁁-⁓⁕-⁞⃐-⃿←-⏿─-❵➔-⯿⸀-⹿、。〃〈-〰︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))++"},{"captures":{"0":{"patterns":[{"match":".+","name":"keyword.operator.custom.prefix.dot.swift"}]}},"match":"\\\\G(?<=^|[(,:;\\\\[{\\\\s])\\\\.((?!(//|/\\\\*|\\\\*/))([-!%\\\\&*+./<-?^|~¡-§©«¬®°±¶»¿×÷̀-ͯ᷀-᷿‖‗†-‧‰-‾⁁-⁓⁕-⁞⃐-⃿←-⏿─-❵➔-⯿⸀-⹿、。〃〈-〰︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))++(?![]),:;}\\\\s]|\\\\z)"},{"captures":{"0":{"patterns":[{"match":".+","name":"keyword.operator.custom.postfix.dot.swift"}]}},"match":"\\\\G(?<!^|[(,:;\\\\[{\\\\s])\\\\.((?!(//|/\\\\*|\\\\*/))([-!%\\\\&*+./<-?^|~¡-§©«¬®°±¶»¿×÷̀-ͯ᷀-᷿‖‗†-‧‰-‾⁁-⁓⁕-⁞⃐-⃿←-⏿─-❵➔-⯿⸀-⹿、。〃〈-〰︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))++(?=[]),:;}\\\\s]|\\\\z)"},{"captures":{"0":{"patterns":[{"match":"\\\\G\\\\.\\\\.[.<]$","name":"keyword.operator.range.swift"},{"match":".+","name":"keyword.operator.custom.infix.dot.swift"}]}},"match":"\\\\G\\\\.((?!(//|/\\\\*|\\\\*/))([-!%\\\\&*+./<-?^|~¡-§©«¬®°±¶»¿×÷̀-ͯ᷀-᷿‖‗†-‧‰-‾⁁-⁓⁕-⁞⃐-⃿←-⏿─-❵➔-⯿⸀-⹿、。〃〈-〰︀-️︠-︯\\\\x{E0100}-\\\\x{E01EF}]))++"}]},{"match":":","name":"keyword.operator.ternary.swift"}]},"root":{"patterns":[{"include":"#compiler-control"},{"include":"#declarations"},{"include":"#expressions"}]}},"scopeName":"source.swift"}'))];export{e as default};
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CVaUQXZF.js";import{n as r,o as i,s as a,t as o,u as s,y as c}from"./button-DPWbWvQN.js";import{D as l,O as u,X as d,a as f,c as p,o as m,st as h}from"./es2015-DsWAjMth.js";import{l as g,o as _,r as v,s as y,t as b,u as x}from"./checkbox-CCES4UbV.js";import{C as S,S as C,a as w,i as T,j as E,o as D,r as O,t as k}from"./file-tree-AZsgAlZn.js";import{n as A,r as j,t as M}from"./button-group-CvflSgg8.js";import{r as N,x as P}from"./prompt-input-controls-DRwTXxuF.js";import{D as ee,E as te,O as F,T as I,d as ne,f as re,k as L,p as R,u as ie,w as ae,x as oe}from"./index-CoRYl0EO.js";var z=a(`file-minus-corner`,[[`path`,{d:`M20 14V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12`,key:`l9p8hp`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),se=a(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),B=e(t(),1),V=n(),H=i(`min-w-0 text-foreground outline-none transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50`,{defaultVariants:{variant:`default`},variants:{variant:{default:`min-h-20 w-full resize-y rounded-control bg-control px-3 py-2 text-body focus-visible:shadow-focus`,embedded:`flex-1 resize-none bg-transparent`}}});function U({className:e,variant:t=`default`,...n}){return(0,V.jsx)(`textarea`,{className:r(H({className:e,variant:t})),"data-slot":`textarea`,"data-variant":t,...n})}function W({className:e,...t}){return(0,V.jsx)(`div`,{className:r(`group/input-group flex w-full min-w-0 items-center`,e),"data-slot":`input-group`,role:`group`,...t})}function G({align:e=`inline-start`,className:t,...n}){return(0,V.jsx)(`div`,{className:r(`flex shrink-0 items-center`,t),"data-align":e,"data-slot":`input-group-addon`,role:`group`,...n})}function ce({className:e,...t}){return(0,V.jsx)(U,{className:r(`min-w-0 flex-1`,e),"data-slot":`input-group-control`,variant:`embedded`,...t})}function K(e){return[...e].sort((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name,`en`):e.kind===`file`?-1:1)}function q(e){let t=[e.name],n=e;for(;n.children.size===1;){let e=n.children.values().next().value;if(e?.kind!==`folder`)break;t.push(e.name),n=e}return{children:K([...n.children.values()].map(e=>e.kind===`folder`?q(e):e)),kind:`folder`,name:t.join(`/`),path:n.path}}function le(e){let t={children:new Map,kind:`folder`,name:``,path:``};for(let n of e){let e=n.path.split(`/`),r=e.pop();if(r===void 0)continue;let i=t;for(let t of e){let e=i.path===``?t:`${i.path}/${t}`,n=i.children.get(t);if(n?.kind===`folder`){i=n;continue}let r={children:new Map,kind:`folder`,name:t,path:e};i.children.set(t,r),i=r}i.children.set(r,{kind:`file`,name:r,path:n.path,status:n.kind})}return K([...t.children.values()].map(e=>e.kind===`folder`?q(e):e))}function J(e,t){for(let n of e)n.kind===`folder`&&(t.add(n.path),J(n.children,t))}function Y(e){return e===`create`?`text-diff-added`:e===`delete`?`text-danger`:`text-warning`}function X(e){let t=r(`size-3.5`,Y(e));return e===`create`?(0,V.jsx)(P,{"aria-hidden":`true`,className:t}):e===`delete`?(0,V.jsx)(z,{"aria-hidden":`true`,className:t}):(0,V.jsx)(j,{"aria-hidden":`true`,className:t})}function ue(e){return e===`create`?`A`:e===`delete`?`D`:`M`}function Z({changesByPath:e,disabled:t,label:n,nodes:r,onOpenFileDiff:i,onTogglePath:a,selectedPaths:o}){return r.map(r=>{if(r.kind===`folder`)return(0,V.jsx)(T,{name:r.name,path:r.path,children:(0,V.jsx)(Z,{changesByPath:e,disabled:t,label:n,nodes:r.children,onOpenFileDiff:i,onTogglePath:a,selectedPaths:o})},r.path);let s=o.has(r.path),c=e.get(r.path);return(0,V.jsxs)(O,{"aria-label":r.path,className:Y(r.status),icon:X(r.status),name:r.name,onClick:()=>{c!==void 0&&i(c)},path:r.path,trailing:(0,V.jsx)(`span`,{className:`ml-auto w-3 text-center text-meta font-semibold text-muted-foreground`,children:ue(r.status)}),children:[(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`size-5 shrink-0`}),(0,V.jsx)(b,{"aria-label":`${n}: ${r.path}`,checked:s,disabled:t,onCheckedChange:()=>{a(r.path)},onClick:e=>{e.stopPropagation()}}),(0,V.jsx)(w,{children:X(r.status)}),(0,V.jsx)(D,{title:r.path,children:r.name})]},r.path)})}function Q({changes:e,disabled:t=!1,label:n,onOpenFileDiff:r,onSelectedPathsChange:i,selectedPaths:a}){let o=(0,B.useMemo)(()=>le(e),[e]),s=(0,B.useMemo)(()=>new Map(e.map(e=>[e.path,e])),[e]),c=(0,B.useMemo)(()=>[...new Set(e.map(e=>e.path))],[e]),l=(0,B.useMemo)(()=>{let e=new Set;return J(o,e),e},[o]);if(c.length===0)return null;let u=c.filter(e=>a.has(e)).length,d=u===0?!1:u===c.length||`indeterminate`;return(0,V.jsxs)(`section`,{"aria-label":n,className:`py-0.5`,children:[(0,V.jsxs)(`div`,{className:`flex min-h-7 items-center gap-1.5 px-3`,children:[(0,V.jsx)(b,{"aria-label":n,checked:d,disabled:t||c.length===0,onCheckedChange:e=>{let t=new Set(a);for(let n of c)e===!0?t.add(n):t.delete(n);i(t)}}),(0,V.jsx)(`h3`,{className:`text-label font-semibold text-foreground`,children:n}),(0,V.jsx)(`span`,{className:`ml-auto text-caption text-muted-foreground`,children:c.length})]}),o.length===0?null:(0,V.jsx)(k,{"aria-label":n,className:`px-1`,defaultExpanded:l,children:(0,V.jsx)(Z,{changesByPath:s,disabled:t,label:n,nodes:o,onOpenFileDiff:r,onTogglePath:e=>{let t=new Set(a);t.has(e)?t.delete(e):t.add(e),i(t)},selectedPaths:a})})]})}function de(e){let t=new Map;for(let n of e.staged)t.set(n.path,{path:n.path,staged:!0,unstaged:!1});for(let n of e.unstaged){let e=t.get(n.path);t.set(n.path,{path:n.path,staged:e?.staged??!1,unstaged:!0})}return[...t.values()].sort((e,t)=>e.path.localeCompare(t.path,`en`))}function fe(e){if(e.repositoryMode!==`children`)return[];let t=new Set;for(let n of[...e.staged,...e.unstaged]){let e=n.path.indexOf(`/`);e>0&&t.add(n.path.slice(0,e))}return[...t].toSorted((e,t)=>e.localeCompare(t,`en`))}function $(e,t){return{identity:e,message:``,selectedPaths:new Set(t.map(e=>e.path))}}function pe({error:e=null,gitStatus:t,isCommitting:n=!1,isGenerating:r=!1,isRepositoryLoading:i=!1,onCommit:a,onGenerateMessage:c,onOpenFileDiff:d,onSelectRepository:h=()=>void 0,repositories:_=[],result:y=null,selectedRepository:b=null}){let{t:x}=s(`workbench`),S=(0,B.useMemo)(()=>de(t),[t]),C=`${b??`root`}:${t.snapshot}`,[w,T]=(0,B.useState)(()=>$(C,S)),E=(0,B.useRef)(g());w.identity!==C&&T($(C,S));let{message:D,selectedPaths:O}=w,k=r||n,j=_.length>0||t.repositoryMode===`children`,P=!j||b!==null&&!i&&t.repositoryMode===`root`,z=P&&O.size>0&&!k&&y===null,H=z&&D.trim().length>0,U=()=>E.current.run(async()=>{let e=await c({expectedSnapshot:t.snapshot,paths:[...O],...b===null?{}:{repository:b}});T(t=>({...t,message:e}))}),K=e=>E.current.run(()=>a({action:e,expectedSnapshot:t.snapshot,message:D,paths:[...O],...b===null?{}:{repository:b}}));return(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,"data-slot":`commit-changes-panel`,children:[j?(0,V.jsxs)(`div`,{className:`shrink-0 border-b border-separator px-3 py-2`,children:[(0,V.jsx)(`label`,{className:`text-label font-medium`,id:`commit-repository-label`,children:x(`commit.repository`)}),(0,V.jsxs)(ae,{disabled:k||y!==null,onValueChange:h,...b===null?{}:{value:b},children:[(0,V.jsx)(F,{"aria-labelledby":`commit-repository-label`,className:`mt-1 w-full`,children:(0,V.jsx)(L,{placeholder:x(`commit.selectRepository`)})}),(0,V.jsx)(I,{position:`popper`,children:(0,V.jsx)(te,{children:_.map(e=>(0,V.jsx)(ee,{value:e,children:e},e))})})]}),i?(0,V.jsx)(`p`,{className:`mt-1 text-caption text-muted-foreground`,role:`status`,children:x(`commit.repositoryLoading`)}):null,_.length===0?(0,V.jsx)(`p`,{className:`mt-1 text-caption text-danger`,role:`alert`,children:x(`commit.repositoryUnavailable`)}):null]}):null,e===null?null:(0,V.jsx)(`p`,{className:`mx-3 mt-2 shrink-0 text-caption text-danger`,role:`alert`,children:e.message}),P?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`section`,{className:`shrink-0 px-3 py-2`,children:[(0,V.jsxs)(W,{className:`h-8 gap-1 rounded-surface border border-separator-strong bg-panel shadow-sm focus-within:border-brand focus-within:shadow-focus max-workbench:h-11`,children:[(0,V.jsx)(ce,{"aria-label":x(`commit.commitMessage`),className:`h-full min-h-0 overflow-y-auto px-2 py-1.5 text-label leading-5 max-workbench:py-3`,disabled:k||y!==null,id:`commit-message`,onChange:e=>{let t=e.currentTarget.value;T(e=>({...e,message:t}))},placeholder:x(`commit.messagePlaceholder`),rows:1,value:D}),(0,V.jsx)(G,{align:`inline-end`,className:`ml-auto`,children:(0,V.jsxs)(f,{children:[(0,V.jsx)(p,{asChild:!0,children:(0,V.jsx)(N,{"aria-label":x(`commit.generateMessage`),className:`size-7 shrink-0 justify-center p-0 [&_svg]:size-3.5 max-workbench:size-11`,disabled:!z,onClick:()=>{U().catch(()=>void 0)},type:`button`,children:r?(0,V.jsx)(l,{"aria-hidden":`true`,className:`animate-spin`}):(0,V.jsx)(A,{"aria-hidden":`true`})})}),(0,V.jsx)(m,{side:`top`,children:x(`commit.generateMessage`)})]})})]}),y===null?(0,V.jsxs)(M,{className:`mt-2 w-full`,children:[(0,V.jsxs)(o,{className:`flex-1 rounded-r-none`,disabled:!H,onClick:()=>{K(`commit`).catch(()=>void 0)},type:`button`,children:[n?(0,V.jsx)(l,{"aria-hidden":`true`,className:`animate-spin`}):(0,V.jsx)(v,{"aria-hidden":`true`}),x(`commit.commit`)]}),(0,V.jsxs)(ie,{children:[(0,V.jsx)(oe,{asChild:!0,children:(0,V.jsx)(o,{"aria-label":x(`commit.commitActions`),className:`w-10 rounded-l-none border-l border-brand-contrast/30 px-0`,disabled:!H,type:`button`,children:(0,V.jsx)(u,{"aria-hidden":`true`})})}),(0,V.jsx)(ne,{align:`end`,children:(0,V.jsxs)(re,{children:[(0,V.jsxs)(R,{onSelect:()=>{K(`commit`).catch(()=>void 0)},children:[(0,V.jsx)(v,{"aria-hidden":`true`,className:`size-3.5`}),x(`commit.commit`)]}),(0,V.jsxs)(R,{onSelect:()=>{K(`commit_and_push`).catch(()=>void 0)},children:[(0,V.jsx)(se,{"aria-hidden":`true`,className:`size-3.5`}),x(`commit.commitAndPush`)]})]})})]})]}):(0,V.jsx)(`p`,{className:`mt-2 font-mono text-caption text-muted-foreground`,role:`status`,children:y.commitSha.slice(0,7)})]}),(0,V.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col border-t border-separator`,children:[(0,V.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center px-3 text-label font-semibold`,children:[(0,V.jsx)(`span`,{children:x(`commit.changes`)}),(0,V.jsx)(`span`,{className:`ml-auto text-caption font-normal text-muted-foreground`,children:x(`commit.totalFiles`,{count:S.length})})]}),(0,V.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain py-0.5`,"data-slot":`commit-changes-scroll`,children:[(0,V.jsx)(Q,{changes:t.staged,disabled:k||y!==null,label:x(`commit.staged`),onOpenFileDiff:d,onSelectedPathsChange:e=>{T(t=>({...t,selectedPaths:e}))},selectedPaths:O}),(0,V.jsx)(Q,{changes:t.unstaged,disabled:k||y!==null,label:x(`commit.unstaged`),onOpenFileDiff:d,onSelectedPathsChange:e=>{T(t=>({...t,selectedPaths:e}))},selectedPaths:O})]})]})]}):null]})}function me(e){return e.pushStatus===`pushed`?`commit.commitAndPushSucceeded`:e.pushStatus===`not_requested`?`commit.commitSucceeded`:null}function he({client:e,detailsError:t=null,detailsPending:n=!1,gitStatus:r,onOpenFileDiff:i,projectId:a,rootPath:o}){let{t:c}=s(`workbench`),l=h(),u=x(S(a,o,e)),f=x({...C(a,o,e),meta:{actionNotification:{successMessage:!1}}}),p=(0,B.useMemo)(()=>fe(r),[r]),[m,g]=(0,B.useState)(),[v,b]=(0,B.useState)(null),w=v!==null&&p.includes(v)?v:p[0]??null,T=d(E(a,o,w,r.repositoryMode===`children`,e)),D=r.repositoryMode===`root`?r:T.data??r,O=m?.snapshot===D.snapshot?m.result:null;return(0,V.jsx)(pe,{error:t??T.error,gitStatus:D,isCommitting:f.isPending,isGenerating:u.isPending,isRepositoryLoading:n||T.isFetching,onCommit:async e=>{let t=e.expectedSnapshot,n=await f.mutateAsync(e);g({result:n,snapshot:t}),l.invalidateQueries({queryKey:[`projects`,a,o,`git-status`]}),l.invalidateQueries({queryKey:[`projects`,a,o,`git-history`]});let r=me(n);if(r!==null){y(c(r));return}_(Error(n.pushError??c(`commit.commitCompletePushFailed`)))},onGenerateMessage:async e=>(await u.mutateAsync(e)).message,onOpenFileDiff:i,onSelectRepository:e=>{g(void 0),u.reset(),f.reset(),b(e)},repositories:p,result:O,selectedRepository:w})}function ge({client:e,detailsError:t,detailsPending:n,detailsStatus:r,gitStatus:i,gitStatusError:a,onOpenFileDiff:o,projectId:s,rootPath:l}){return s!==void 0&&e!==void 0&&i!==void 0?(0,V.jsx)(he,{client:e,detailsError:t,detailsPending:n,gitStatus:r??i,onOpenFileDiff:o,projectId:s,rootPath:l}):a===null?(0,V.jsx)(`p`,{className:`p-3 text-caption text-muted-foreground`,role:`status`,children:c.t(`inspector.gitLoading`,{ns:`conversation`})}):(0,V.jsx)(`p`,{className:`p-3 text-caption text-danger`,role:`alert`,children:a.message})}export{ge as WorkbenchInspectorChanges};