opencami 1.5.0 → 1.5.1

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 (91) hide show
  1. package/dist/client/assets/{CSPContext-EgWK8bIJ.js → CSPContext-BBLAL_m_.js} +1 -1
  2. package/dist/client/assets/{DirectionContext-DXtY05YF.js → DirectionContext-DXnZc0zz.js} +1 -1
  3. package/dist/client/assets/{_sessionKey-B89e7G3y.js → _sessionKey-BidmO1-D.js} +32 -32
  4. package/dist/client/assets/agents-CtZs_u1j.js +2 -0
  5. package/dist/client/assets/agents-screen-Basce5qo.js +1 -0
  6. package/dist/client/assets/bots-C_dWjy3z.js +2 -0
  7. package/dist/client/assets/bots-screen-n_xhYOEE.js +1 -0
  8. package/dist/client/assets/{button-nDcsaNPl.js → button-BaHefIXU.js} +1 -1
  9. package/dist/client/assets/c-BIGW1oBm.js +1 -0
  10. package/dist/client/assets/{connect-w4lLOqiJ.js → connect-DHr3hhUR.js} +1 -1
  11. package/dist/client/assets/core-BrHBc0Zp.js +12 -0
  12. package/dist/client/assets/cpp-B-lmv-kZ.js +1 -0
  13. package/dist/client/assets/csharp-K5feNrxe.js +1 -0
  14. package/dist/client/assets/css-DPfMkruS.js +1 -0
  15. package/dist/client/assets/diff-D97Zzqfu.js +1 -0
  16. package/dist/client/assets/dockerfile-BcOcwvcX.js +1 -0
  17. package/dist/client/assets/engine-javascript-PwbX1GN8.js +141 -0
  18. package/dist/client/assets/file-explorer-screen-8t6M4Xco.js +1 -0
  19. package/dist/client/assets/files-BdlpK3Cy.js +2 -0
  20. package/dist/client/assets/go-Dn2_MT6a.js +1 -0
  21. package/dist/client/assets/graphql-ChdNCCLP.js +1 -0
  22. package/dist/client/assets/html-GMplVEZG.js +1 -0
  23. package/dist/client/assets/index-B2iG4EM1.js +3 -0
  24. package/dist/client/assets/{index-36G0WCxU.js → index-GTR-Xzl2.js} +1 -1
  25. package/dist/client/assets/index-T4TOjvD0.js +1 -0
  26. package/dist/client/assets/java-CylS5w8V.js +1 -0
  27. package/dist/client/assets/javascript-wDzz0qaB.js +1 -0
  28. package/dist/client/assets/json-Cp-IABpG.js +1 -0
  29. package/dist/client/assets/jsx-g9-lgVsj.js +1 -0
  30. package/dist/client/assets/{keyboard-shortcuts-dialog-BdCeXRjD.js → keyboard-shortcuts-dialog-CcKSlK52.js} +1 -1
  31. package/dist/client/assets/kotlin-BdnUsdx6.js +1 -0
  32. package/dist/client/assets/{main-B3N0eQFg.js → main-mIHr_ble.js} +3 -3
  33. package/dist/client/assets/markdown-Cvjx9yec.js +1 -0
  34. package/dist/client/assets/{opencami-logo-DD0DPFRQ.js → opencami-logo-CRIdKbbZ.js} +1 -1
  35. package/dist/client/assets/php-CDn_0X-4.js +1 -0
  36. package/dist/client/assets/python-B6aJPvgy.js +1 -0
  37. package/dist/client/assets/react-Cfq4ot0g.js +1 -0
  38. package/dist/client/assets/regexp-CDVJQ6XC.js +1 -0
  39. package/dist/client/assets/ruby-FDmvQDUv.js +1 -0
  40. package/dist/client/assets/rust-B1yitclQ.js +1 -0
  41. package/dist/client/assets/search-dialog-D19x_xaG.js +1 -0
  42. package/dist/client/assets/{session-export-dialog-DtHKG2zW.js → session-export-dialog-DRlJwhMa.js} +1 -1
  43. package/dist/client/assets/settings-dialog-BA5FjiyP.js +1 -0
  44. package/dist/client/assets/shell-DfDnw5Jg.js +1 -0
  45. package/dist/client/assets/skills-lmNPZksG.js +2 -0
  46. package/dist/client/assets/{skills-panel-BLUjzfjJ.js → skills-panel-Cv-N_MDk.js} +2 -2
  47. package/dist/client/assets/sql-BLtJtn59.js +1 -0
  48. package/dist/client/assets/styles-JgjN_ZCd.css +1 -0
  49. package/dist/client/assets/swift-Dg5xB15N.js +1 -0
  50. package/dist/client/assets/switch-Bh9tVOYh.js +1 -0
  51. package/dist/client/assets/tabs-BfaEc9zS.js +1 -0
  52. package/dist/client/assets/toml-vGWfd6FD.js +1 -0
  53. package/dist/client/assets/tooltip-w9D-e_R-.js +1 -0
  54. package/dist/client/assets/tsx-COt5Ahok.js +1 -0
  55. package/dist/client/assets/typescript-BPQ3VLAy.js +1 -0
  56. package/dist/client/assets/{use-file-explorer-state-BnaJEqRP.js → use-file-explorer-state-CLaDuI9X.js} +2 -2
  57. package/dist/client/assets/useButton-DsMdJPGn.js +1 -0
  58. package/dist/client/assets/{useCompositeItem-BgiEMKAt.js → useCompositeItem-CaYygSfB.js} +1 -1
  59. package/dist/client/assets/{useControlled-BhUuiHAm.js → useControlled-wOKVgKF4.js} +1 -1
  60. package/dist/client/assets/{useMutation-CFmVaBag.js → useMutation-fJnleJAb.js} +1 -1
  61. package/dist/client/assets/{visuallyHidden-DCCICp6T.js → visuallyHidden-CqGRL_Oq.js} +2 -2
  62. package/dist/client/assets/vitesse-dark-D0r3Knsf.js +1 -0
  63. package/dist/client/assets/vitesse-light-CVO1_9PV.js +1 -0
  64. package/dist/client/assets/xml-sdJ4AIDG.js +1 -0
  65. package/dist/client/assets/yaml-Buea-lGh.js +1 -0
  66. package/dist/server/assets/{_sessionKey-tRze5NLR.js → _sessionKey-B5UHBd2U.js} +16 -12
  67. package/dist/server/assets/{_tanstack-start-manifest_v-CyfoMvUa.js → _tanstack-start-manifest_v-D11xMFUx.js} +1 -1
  68. package/dist/server/assets/{connect-d3AqjAqe.js → connect-CbgijWz4.js} +1 -34
  69. package/dist/server/assets/{index-CRfLKh30.js → index--_jH_0mX.js} +1 -1
  70. package/dist/server/assets/{index-CNIATlJ9.js → index-Dl2BOKP7.js} +94 -79
  71. package/dist/server/assets/{router-rn7pJO_D.js → router-DJA7GtMo.js} +4 -4
  72. package/dist/server/assets/{search-dialog-Bz4Cu0KW.js → search-dialog-C2a3OYm_.js} +45 -81
  73. package/dist/server/assets/{settings-dialog-BBM7jCjE.js → settings-dialog-CHVzrou9.js} +9 -38
  74. package/dist/server/server.js +2 -2
  75. package/package.json +2 -1
  76. package/dist/client/assets/agents-screen-1BiEZ9od.js +0 -1
  77. package/dist/client/assets/agents-x54ocA9z.js +0 -2
  78. package/dist/client/assets/bots-screen-BNQciUeJ.js +0 -1
  79. package/dist/client/assets/bots-x86ZHG4b.js +0 -2
  80. package/dist/client/assets/file-explorer-screen-CAsjd3w8.js +0 -1
  81. package/dist/client/assets/files-Bype5Mnb.js +0 -2
  82. package/dist/client/assets/index-BXkRE220.js +0 -153
  83. package/dist/client/assets/react-B16OrBeM.js +0 -1
  84. package/dist/client/assets/search-dialog-BjTPceEl.js +0 -1
  85. package/dist/client/assets/settings-dialog-hiqdk_UD.js +0 -1
  86. package/dist/client/assets/skills-DhwyFq3y.js +0 -2
  87. package/dist/client/assets/styles-CHP4l6vZ.css +0 -1
  88. package/dist/client/assets/switch-J6wLIVu2.js +0 -1
  89. package/dist/client/assets/tabs-DvPgTz5I.js +0 -1
  90. package/dist/client/assets/tooltip-C14vdXHK.js +0 -1
  91. package/dist/client/assets/useButton-Bnnac1eR.js +0 -1
@@ -0,0 +1,141 @@
1
+ function H(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function yr(e,r,t){return e.has(r)||e.set(r,t),e.get(r)}const Ce=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),x=String.raw;function j(e,r){if(e==null)throw new Error(r??"Value expected");return e}const He=x`\[\^?`,je=`c.? | C(?:-.?)?|${x`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${x`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${x`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${x`o\{[^\}]*\}?`}|${x`\d{1,3}`}`,be=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,K=new RegExp(x`
2
+ \\ (?:
3
+ ${je}
4
+ | [gk]<[^>]*>?
5
+ | [gk]'[^']*'?
6
+ | .
7
+ )
8
+ | \( (?:
9
+ \? (?:
10
+ [:=!>({]
11
+ | <[=!]
12
+ | <[^>]*>
13
+ | '[^']*'
14
+ | ~\|?
15
+ | #(?:[^)\\]|\\.?)*
16
+ | [^:)]*[:)]
17
+ )?
18
+ | \*[^\)]*\)?
19
+ )?
20
+ | (?:${be.source})+
21
+ | ${He}
22
+ | .
23
+ `.replace(/\s+/g,""),"gsu"),oe=new RegExp(x`
24
+ \\ (?:
25
+ ${je}
26
+ | .
27
+ )
28
+ | \[:(?:\^?\p{Alpha}+|\^):\]
29
+ | ${He}
30
+ | &&
31
+ | .
32
+ `.replace(/\s+/g,""),"gsu");function Cr(e,r={}){const t={flags:"",...r,rules:{captureGroup:!1,singleline:!1,...r.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const n=Or(t.flags),a=[n.extended],s={captureGroup:t.rules.captureGroup,getCurrentModX(){return a.at(-1)},numOpenGroups:0,popModX(){a.pop()},pushModX(p){a.push(p)},replaceCurrentModX(p){a[a.length-1]=p},singleline:t.rules.singleline};let o=[],i;for(K.lastIndex=0;i=K.exec(e);){const p=br(s,e,i[0],K.lastIndex);p.tokens?o.push(...p.tokens):p.token&&o.push(p.token),p.lastIndex!==void 0&&(K.lastIndex=p.lastIndex)}const u=[];let c=0;o.filter(p=>p.type==="GroupOpen").forEach(p=>{p.kind==="capturing"?p.number=++c:p.raw==="("&&u.push(p)}),c||u.forEach((p,f)=>{p.kind="capturing",p.number=f+1});const l=c||u.length;return{tokens:o.map(p=>p.type==="EscapedNumber"?Br(p,l):p).flat(),flags:n}}function br(e,r,t,n){const[a,s]=t;if(t==="["||t==="[^"){const o=xr(r,t,n);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(a==="\\"){if("AbBGyYzZ".includes(s))return{token:Ae(t,t)};if(/^\\g[<']/.test(t)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(t))throw new Error(`Invalid group name "${t}"`);return{token:Nr(t)}}if(/^\\k[<']/.test(t)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(t))throw new Error(`Invalid group name "${t}"`);return{token:Ze(t)}}if(s==="K")return{token:Qe("keep",t)};if(s==="N"||s==="R")return{token:U("newline",t,{negate:s==="N"})};if(s==="O")return{token:U("any",t)};if(s==="X")return{token:U("text_segment",t)};const o=Xe(t,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(a==="("){if(s==="*")return{token:Pr(t)};if(t==="(?{")throw new Error(`Unsupported callout "${t}"`);if(t.startsWith("(?#")){if(r[n]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:n+1}}if(/^\(\?[-imx]+[:)]$/.test(t))return{token:Gr(t,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,t==="("&&!e.captureGroup||t==="(?:")return{token:z("group",t)};if(t==="(?>")return{token:z("atomic",t)};if(t==="(?="||t==="(?!"||t==="(?<="||t==="(?<!")return{token:z(t[2]==="<"?"lookbehind":"lookahead",t,{negate:t.endsWith("!")})};if(t==="("&&e.captureGroup||t.startsWith("(?<")&&t.endsWith(">")||t.startsWith("(?'")&&t.endsWith("'"))return{token:z("capturing",t,{...t!=="("&&{name:t.slice(3,-1)}})};if(t.startsWith("(?~")){if(t==="(?~|")throw new Error(`Unsupported absence function kind "${t}"`);return{token:z("absence_repeater",t)}}throw t==="(?("?new Error(`Unsupported conditional "${t}"`):new Error(`Invalid or unsupported group option "${t}"`)}if(t===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:vr(t)}}if(e.getCurrentModX()){if(t==="#"){const o=r.indexOf(`
33
+ `,n);return{lastIndex:o===-1?r.length:o}}if(/^\s$/.test(t)){const o=/\s+/y;return o.lastIndex=n,{lastIndex:o.exec(r)?o.lastIndex:n}}}if(t===".")return{token:U("dot",t)};if(t==="^"||t==="$"){const o=e.singleline?{"^":x`\A`,$:x`\Z`}[t]:t;return{token:Ae(o,t)}}return t==="|"?{token:Er(t)}:be.test(t)?{tokens:Tr(t)}:{token:N(H(t),t)}}function xr(e,r,t){const n=[Ie(r[1]==="^",r)];let a=1,s;for(oe.lastIndex=t;s=oe.exec(e);){const o=s[0];if(o[0]==="["&&o[1]!==":")a++,n.push(Ie(o[1]==="^",o));else if(o==="]"){if(n.at(-1).type==="CharacterClassOpen")n.push(N(93,o));else if(a--,n.push($r(o)),!a)break}else{const i=kr(o);Array.isArray(i)?n.push(...i):n.push(i)}}return{tokens:n,lastIndex:oe.lastIndex||e.length}}function kr(e){if(e[0]==="\\")return Xe(e,{inCharClass:!0});if(e[0]==="["){const r=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!r||!Ce.has(r.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return U("posix",e,{value:r.groups.name,negate:!!r.groups.negate})}return e==="-"?Ar(e):e==="&&"?Ir(e):N(H(e),e)}function Xe(e,{inCharClass:r}){const t=e[1];if(t==="c"||t==="C")return Fr(e);if("dDhHsSwW".includes(t))return Rr(e);if(e.startsWith(x`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return Ur(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const n=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),a=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(n)),s=new TextEncoder;return[...a].map(o=>{const i=[...s.encode(o)].map(u=>`\\x${u.toString(16)}`).join("");return N(H(o),i)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(t==="u"||t==="x")return N(Dr(e),e);if(Se.has(t))return N(Se.get(t),e);if(/\d/.test(t))return Sr(r,e);if(e==="\\")throw new Error(x`Incomplete escape "\"`);if(t==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return N(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function Er(e){return{type:"Alternator",raw:e}}function Ae(e,r){return{type:"Assertion",kind:e,raw:r}}function Ze(e){return{type:"Backreference",raw:e}}function N(e,r){return{type:"Character",value:e,raw:r}}function $r(e){return{type:"CharacterClassClose",raw:e}}function Ar(e){return{type:"CharacterClassHyphen",raw:e}}function Ir(e){return{type:"CharacterClassIntersector",raw:e}}function Ie(e,r){return{type:"CharacterClassOpen",negate:e,raw:r}}function U(e,r,t={}){return{type:"CharacterSet",kind:e,...t,raw:r}}function Qe(e,r,t={}){return e==="keep"?{type:"Directive",kind:e,raw:r}:{type:"Directive",kind:e,flags:j(t.flags),raw:r}}function Sr(e,r){return{type:"EscapedNumber",inCharClass:e,raw:r}}function vr(e){return{type:"GroupClose",raw:e}}function z(e,r,t={}){return{type:"GroupOpen",kind:e,...t,raw:r}}function _r(e,r,t,n){return{type:"NamedCallout",kind:e,tag:r,arguments:t,raw:n}}function Mr(e,r,t,n){return{type:"Quantifier",kind:e,min:r,max:t,raw:n}}function Nr(e){return{type:"Subroutine",raw:e}}const Lr=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Se=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Fr(e){const r=e[1]==="c"?e[2]:e[3];if(!r||!/[A-Za-z]/.test(r))throw new Error(`Unsupported control character "${e}"`);return N(H(r.toUpperCase())-64,e)}function Gr(e,r){let{on:t,off:n}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;n??="";const a=(r.getCurrentModX()||t.includes("x"))&&!n.includes("x"),s=_e(t),o=_e(n),i={};if(s&&(i.enable=s),o&&(i.disable=o),e.endsWith(")"))return r.replaceCurrentModX(a),Qe("flags",e,{flags:i});if(e.endsWith(":"))return r.pushModX(a),r.numOpenGroups++,z("group",e,{...(s||o)&&{flags:i}});throw new Error(`Unexpected flag modifier "${e}"`)}function Pr(e){const r=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!r)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:t,tag:n,args:a}=r.groups;if(!t)throw new Error(`Invalid named callout "${e}"`);if(n==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const s=a?a.split(",").filter(l=>l!=="").map(l=>/^[+-]?\d+$/.test(l)?+l:l):[],[o,i,u]=s,c=Lr.has(t)?t.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(s.length===2&&(typeof i=="number"||!/^[<>X]$/.test(i)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${i}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof i=="number"||!/^(?:[<>!=]=|[<>])$/.test(i))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${i}"`);if(typeof u=="string"&&!/^[A-Za-z_]\w*$/.test(u))throw new Error(`Named callout argument three must be a tag or number "${u}"`);break;case"custom":throw new Error(`Undefined callout name "${t}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return _r(c,n??null,a?.split(",")??null,e)}function ve(e){let r=null,t,n;if(e[0]==="{"){const{minStr:a,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+a>o||s&&+s>o)throw new Error("Quantifier value unsupported in Oniguruma");if(t=+a,n=s===void 0?+a:s===""?1/0:+s,t>n&&(r="possessive",[t,n]=[n,t]),e.endsWith("?")){if(r==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');r="lazy"}else r||(r="greedy")}else t=e[0]==="+"?1:0,n=e[0]==="?"?1:1/0,r=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Mr(r,t,n,e)}function Rr(e){const r=e[1].toLowerCase();return U({d:"digit",h:"hex",s:"space",w:"word"}[r],e,{negate:e[1]!==r})}function Ur(e){const{p:r,neg:t,value:n}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return U("property",e,{value:n,negate:r==="P"&&!t||r==="p"&&!!t})}function _e(e){const r={};return e.includes("i")&&(r.ignoreCase=!0),e.includes("m")&&(r.dotAll=!0),e.includes("x")&&(r.extended=!0),Object.keys(r).length?r:null}function Or(e){const r={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let t=0;t<e.length;t++){const n=e[t];if(!"imxDPSWy".includes(n))throw new Error(`Invalid flag "${n}"`);if(n==="y"){if(!/^y{[gw]}/.test(e.slice(t)))throw new Error('Invalid or unspecified flag "y" mode');r.textSegmentMode=e[t+2]==="g"?"grapheme":"word",t+=3;continue}r[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[n]]=!0}return r}function Dr(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const r=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(r,16)}function Br(e,r){const{raw:t,inCharClass:n}=e,a=t.slice(1);if(!n&&(a!=="0"&&a.length===1||a[0]!=="0"&&+a<=r))return[Ze(t)];const s=[],o=a.match(/^[0-7]+|\d/g);for(let i=0;i<o.length;i++){const u=o[i];let c;if(i===0&&u!=="8"&&u!=="9"){if(c=parseInt(u,8),c>127)throw new Error(x`Octal encoded byte above 177 unsupported "${t}"`)}else c=H(u);s.push(N(c,(i===0?"\\":"")+u))}return s}function Tr(e){const r=[],t=new RegExp(be,"gy");let n;for(;n=t.exec(e);){const a=n[0];if(a[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(a);if(s){const{min:o,max:i}=s.groups;if(+o>+i&&a.endsWith("?")){t.lastIndex--,r.push(ve(a.slice(0,-1)));continue}}}r.push(ve(a))}return r}function qe(e,r){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const t=e.body[0];return!r||Object.keys(r).every(n=>r[n]===t[n])}function Vr(e){return zr.has(e.type)}const zr=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Je(e,r={}){const t={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...r,rules:{captureGroup:!1,singleline:!1,...r.rules}},n=Cr(e,{flags:t.flags,rules:{captureGroup:t.rules.captureGroup,singleline:t.rules.singleline}}),a=(f,g)=>{const d=n.tokens[s.nextIndex];switch(s.parent=f,s.nextIndex++,d.type){case"Alternator":return O();case"Assertion":return Wr(d);case"Backreference":return Hr(d,s);case"Character":return ne(d.value,{useLastValid:!!g.isCheckingRangeEnd});case"CharacterClassHyphen":return jr(d,s,g);case"CharacterClassOpen":return Xr(d,s,g);case"CharacterSet":return Zr(d,s);case"Directive":return et(d.kind,{flags:d.flags});case"GroupOpen":return Qr(d,s,g);case"NamedCallout":return tt(d.kind,d.tag,d.arguments);case"Quantifier":return qr(d,s);case"Subroutine":return Jr(d,s);default:throw new Error(`Unexpected token type "${d.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:t.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:t.skipBackrefValidation,skipLookbehindValidation:t.skipLookbehindValidation,skipPropertyNameValidation:t.skipPropertyNameValidation,subroutines:[],tokens:n.tokens,unicodePropertyMap:t.unicodePropertyMap,walk:a},o=st(rt(n.flags));let i=o.body[0];for(;s.nextIndex<n.tokens.length;){const f=a(i,{});f.type==="Alternative"?(o.body.push(f),i=f):i.body.push(f)}const{capturingGroups:u,hasNumberedRef:c,namedGroupsByName:l,subroutines:p}=s;if(c&&l.size&&!t.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:f}of p)if(typeof f=="number"){if(f>u.length)throw new Error("Subroutine uses a group number that's not defined");f&&(u[f-1].isSubroutined=!0)}else if(l.has(f)){if(l.get(f).length>1)throw new Error(x`Subroutine uses a duplicate group name "\g<${f}>"`);l.get(f)[0].isSubroutined=!0}else throw new Error(x`Subroutine uses a group name that's not defined "\g<${f}>"`);return o}function Wr({kind:e}){return de(j({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===x`\B`||e===x`\Y`})}function Hr({raw:e},r){const t=/^\\k[<']/.test(e),n=t?e.slice(3,-1):e.slice(1),a=(s,o=!1)=>{const i=r.capturingGroups.length;let u=!1;if(s>i)if(r.skipBackrefValidation)u=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return r.hasNumberedRef=!0,ge(o?i+1-s:s,{orphan:u})};if(t){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);if(s)return a(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(n))throw new Error(`Invalid backref name "${e}"`);if(!r.namedGroupsByName.has(n))throw new Error(`Group name not defined to the left "${e}"`);return ge(n)}return a(+n)}function jr(e,r,t){const{tokens:n,walk:a}=r,s=r.parent,o=s.body.at(-1),i=n[r.nextIndex];if(!t.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&i&&i.type!=="CharacterClassOpen"&&i.type!=="CharacterClassClose"&&i.type!=="CharacterClassIntersector"){const u=a(s,{...t,isCheckingRangeEnd:!0});if(o.type==="Character"&&u.type==="Character")return s.body.pop(),Yr(o,u);throw new Error("Invalid character class range")}return ne(H("-"))}function Xr({negate:e},r,t){const{tokens:n,walk:a}=r,s=n[r.nextIndex],o=[re()];let i=Le(s);for(;i.type!=="CharacterClassClose";){if(i.type==="CharacterClassIntersector")o.push(re()),r.nextIndex++;else{const c=o.at(-1);c.body.push(a(c,t))}i=Le(n[r.nextIndex],s)}const u=re({negate:e});return o.length===1?u.body=o[0].body:(u.kind="intersection",u.body=o.map(c=>c.body.length===1?c.body[0]:c)),r.nextIndex++,u}function Zr({kind:e,negate:r,value:t},n){const{normalizeUnknownPropertyNames:a,skipPropertyNameValidation:s,unicodePropertyMap:o}=n;if(e==="property"){const i=se(t);if(Ce.has(i)&&!o?.has(i))e="posix",t=i;else return W(t,{negate:r,normalizeUnknownPropertyNames:a,skipPropertyNameValidation:s,unicodePropertyMap:o})}return e==="posix"?nt(t,{negate:r}):he(e,{negate:r})}function Qr(e,r,t){const{tokens:n,capturingGroups:a,namedGroupsByName:s,skipLookbehindValidation:o,walk:i}=r,u=at(e),c=u.type==="AbsenceFunction",l=Ne(u),p=l&&u.negate;if(u.type==="CapturingGroup"&&(a.push(u),u.name&&yr(s,u.name,[]).push(u)),c&&t.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let f=Fe(n[r.nextIndex]);for(;f.type!=="GroupClose";){if(f.type==="Alternator")u.body.push(O()),r.nextIndex++;else{const g=u.body.at(-1),d=i(g,{...t,isInAbsenceFunction:t.isInAbsenceFunction||c,isInLookbehind:t.isInLookbehind||l,isInNegLookbehind:t.isInNegLookbehind||p});if(g.body.push(d),(l||t.isInLookbehind)&&!o){const w="Lookbehind includes a pattern not allowed by Oniguruma";if(p||t.isInNegLookbehind){if(Me(d)||d.type==="CapturingGroup")throw new Error(w)}else if(Me(d)||Ne(d)&&d.negate)throw new Error(w)}}f=Fe(n[r.nextIndex])}return r.nextIndex++,u}function qr({kind:e,min:r,max:t},n){const a=n.parent,s=a.body.at(-1);if(!s||!Vr(s))throw new Error("Quantifier requires a repeatable token");const o=Ye(e,r,t,s);return a.body.pop(),o}function Jr({raw:e},r){const{capturingGroups:t,subroutines:n}=r;let a=e.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(a);if(s){const i=+s.groups.num,u=t.length;if(r.hasNumberedRef=!0,a={"":i,"+":u+i,"-":u+1-i}[s.groups.sign],a<1)throw new Error("Invalid subroutine number")}else a==="0"&&(a=0);const o=er(a);return n.push(o),o}function Kr(e,r){return{type:"AbsenceFunction",kind:e,body:q(r?.body)}}function O(e){return{type:"Alternative",body:rr(e?.body)}}function de(e,r){const t={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(t.negate=!!r?.negate),t}function ge(e,r){const t=!!r?.orphan;return{type:"Backreference",ref:e,...t&&{orphan:t}}}function Ke(e,r){const t={name:void 0,isSubroutined:!1,...r};if(t.name!==void 0&&!ot(t.name))throw new Error(`Group name "${t.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...t.name&&{name:t.name},...t.isSubroutined&&{isSubroutined:t.isSubroutined},body:q(r?.body)}}function ne(e,r){const t={useLastValid:!1,...r};if(e>1114111){const n=e.toString(16);if(t.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${n}}"`):new Error(`Invalid code point out of range in JS "\\x{${n}}"`)}return{type:"Character",value:e}}function re(e){const r={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:r.kind,negate:r.negate,body:rr(e?.body)}}function Yr(e,r){if(r.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:r}}function he(e,r){const t=!!r?.negate,n={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(n.negate=t),(e==="text_segment"||e==="newline"&&!t)&&(n.variableLength=!0),n}function et(e,r={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:j(r.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function rt(e){return{type:"Flags",...e}}function v(e){const r=e?.atomic,t=e?.flags;if(r&&t)throw new Error("Atomic group cannot have flags");return{type:"Group",...r&&{atomic:r},...t&&{flags:t},body:q(e?.body)}}function R(e){const r={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:r.behind?"lookbehind":"lookahead",negate:r.negate,body:q(e?.body)}}function tt(e,r,t){return{type:"NamedCallout",kind:e,tag:r,arguments:t}}function nt(e,r){const t=!!r?.negate;if(!Ce.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:t}}function Ye(e,r,t,n){if(r>t)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:r,max:t,body:n}}function st(e,r){return{type:"Regex",body:q(r?.body),flags:e}}function er(e){return{type:"Subroutine",ref:e}}function W(e,r){const t={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...r};let n=t.unicodePropertyMap?.get(se(e));if(!n){if(t.normalizeUnknownPropertyNames)n=it(e);else if(t.unicodePropertyMap&&!t.skipPropertyNameValidation)throw new Error(x`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:n??e,negate:t.negate}}function at({flags:e,kind:r,name:t,negate:n,number:a}){switch(r){case"absence_repeater":return Kr("repeater");case"atomic":return v({atomic:!0});case"capturing":return Ke(a,{name:t});case"group":return v({flags:e});case"lookahead":case"lookbehind":return R({behind:r==="lookbehind",negate:n});default:throw new Error(`Unexpected group kind "${r}"`)}}function q(e){if(e===void 0)e=[O()];else if(!Array.isArray(e)||!e.length||!e.every(r=>r.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function rr(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(r=>!!r.type))throw new Error("Invalid body; expected array of nodes");return e}function Me(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Ne(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function ot(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function it(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,r=>r[0].toUpperCase()+r.slice(1).toLowerCase())}function se(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Le(e,r){return j(e,`${r?.type==="Character"&&r.value===93?"Empty":"Unclosed"} character class`)}function Fe(e){return j(e,"Unclosed group")}function Z(e,r,t=null){function n(s,o){for(let i=0;i<s.length;i++){const u=a(s[i],o,i,s);i=Math.max(-1,i+u)}}function a(s,o=null,i=null,u=null){let c=0,l=!1;const p={node:s,parent:o,key:i,container:u,root:e,remove(){Y(u).splice(Math.max(0,T(i)+c),1),c--,l=!0},removeAllNextSiblings(){return Y(u).splice(T(i)+1)},removeAllPrevSiblings(){const y=T(i)+c;return c-=y,Y(u).splice(0,Math.max(0,y))},replaceWith(y,E={}){const $=!!E.traverse;u?u[Math.max(0,T(i)+c)]=y:j(o,"Can't replace root node")[i]=y,$&&a(y,o,i,u),l=!0},replaceWithMultiple(y,E={}){const $=!!E.traverse;if(Y(u).splice(Math.max(0,T(i)+c),1,...y),c+=y.length-1,$){let k=0;for(let A=0;A<y.length;A++)k+=a(y[A],o,T(i)+A+k,u)}l=!0},skip(){l=!0}},{type:f}=s,g=r["*"],d=r[f],w=typeof g=="function"?g:g?.enter,m=typeof d=="function"?d:d?.enter;if(w?.(p,t),m?.(p,t),!l)switch(f){case"AbsenceFunction":case"CapturingGroup":case"Group":n(s.body,s);break;case"Alternative":case"CharacterClass":n(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":a(s.min,s,"min"),a(s.max,s,"max");break;case"LookaroundAssertion":n(s.body,s);break;case"Quantifier":a(s.body,s,"body");break;case"Regex":n(s.body,s),a(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${f}"`)}return d?.exit?.(p,t),g?.exit?.(p,t),c}return a(e),e}function Y(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function T(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const ut=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function ct(e,r){for(let t=0;t<e.length;t++)e[t]>=r&&e[t]++}function lt(e,r,t,n){return e.slice(0,r)+n+e.slice(r+t.length)}const S=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function xe(e,r,t,n){const a=new RegExp(String.raw`${r}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,i="";for(const u of e.matchAll(a)){const{0:c,groups:{$skip:l}}=u;if(!l&&(!n||n===S.DEFAULT==!o)){t instanceof Function?i+=t(u,{context:o?S.CHAR_CLASS:S.DEFAULT,negated:s[s.length-1]}):i+=t;continue}c[0]==="["?(o++,s.push(c[1]==="^")):c==="]"&&o&&(o--,s.pop()),i+=c}return i}function tr(e,r,t,n){xe(e,r,t,n)}function pt(e,r,t=0,n){if(!new RegExp(r,"su").test(e))return null;const a=new RegExp(`${r}|(?<$skip>\\\\?.)`,"gsu");a.lastIndex=t;let s=0,o;for(;o=a.exec(e);){const{0:i,groups:{$skip:u}}=o;if(!u&&(!n||n===S.DEFAULT==!s))return o;i==="["?s++:i==="]"&&s&&s--,a.lastIndex==o.index&&a.lastIndex++}return null}function ee(e,r,t){return!!pt(e,r,0,t)}function ft(e,r){const t=/\\?./gsu;t.lastIndex=r;let n=e.length,a=0,s=1,o;for(;o=t.exec(e);){const[i]=o;if(i==="[")a++;else if(a)i==="]"&&a--;else if(i==="(")s++;else if(i===")"&&(s--,!s)){n=o.index;break}}return e.slice(r,n)}const Ge=new RegExp(String.raw`(?<noncapturingStart>${ut})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function dt(e,r){const t=r?.hiddenCaptures??[];let n=r?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:n,hiddenCaptures:t};const a="(?>",s="(?:(?=(",o=[0],i=[];let u=0,c=0,l=NaN,p;do{p=!1;let f=0,g=0,d=!1,w;for(Ge.lastIndex=Number.isNaN(l)?0:l+s.length;w=Ge.exec(e);){const{0:m,index:y,groups:{capturingStart:E,noncapturingStart:$}}=w;if(m==="[")f++;else if(f)m==="]"&&f--;else if(m===a&&!d)l=y,d=!0;else if(d&&$)g++;else if(E)d?g++:(u++,o.push(u+c));else if(m===")"&&d){if(!g){c++;const k=u+c;if(e=`${e.slice(0,l)}${s}${e.slice(l+a.length,y)}))<$$${k}>)${e.slice(y+1)}`,p=!0,i.push(k),ct(t,k),n.size){const A=new Map;n.forEach((J,D)=>{A.set(D>=k?D+1:D,J.map(B=>B>=k?B+1:B))}),n=A}break}g--}}}while(p);return t.push(...i),e=xe(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:f,groups:{backrefNum:g,wrappedBackrefNum:d}})=>{if(g){const w=+g;if(w>o.length-1)throw new Error(`Backref "${f}" greater than number of captures`);return`\\${o[w]}`}return`\\${d}`},S.DEFAULT),{pattern:e,captureTransfers:n,hiddenCaptures:t}}const nr=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,ie=new RegExp(String.raw`
34
+ \\(?: \d+
35
+ | c[A-Za-z]
36
+ | [gk]<[^>]+>
37
+ | [pPu]\{[^\}]+\}
38
+ | u[A-Fa-f\d]{4}
39
+ | x[A-Fa-f\d]{2}
40
+ )
41
+ | \((?: \? (?: [:=!>]
42
+ | <(?:[=!]|[^>]+>)
43
+ | [A-Za-z\-]+:
44
+ | \(DEFINE\)
45
+ ))?
46
+ | (?<qBase>${nr})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
47
+ | \\?.
48
+ `.replace(/\s+/g,""),"gsu");function gt(e){if(!new RegExp(`${nr}\\+`).test(e))return{pattern:e};const r=[];let t=null,n=null,a="",s=0,o;for(ie.lastIndex=0;o=ie.exec(e);){const{0:i,index:u,groups:{qBase:c,qMod:l,invalidQ:p}}=o;if(i==="[")s||(n=u),s++;else if(i==="]")s?s--:n=null;else if(!s)if(l==="+"&&a&&!a.startsWith("(")){if(p)throw new Error(`Invalid quantifier "${i}"`);let f=-1;if(/^\{\d+\}$/.test(c))e=lt(e,u+c.length,l,"");else{if(a===")"||a==="]"){const g=a===")"?t:n;if(g===null)throw new Error(`Invalid unmatched "${a}"`);e=`${e.slice(0,g)}(?>${e.slice(g,u)}${c})${e.slice(u+i.length)}`}else e=`${e.slice(0,u-a.length)}(?>${a}${c})${e.slice(u+i.length)}`;f+=4}ie.lastIndex+=f}else i[0]==="("?r.push(u):i===")"&&(t=r.length?r.pop():null);a=i}return{pattern:e}}const I=String.raw,ht=I`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,we=I`\(\?R=(?<rDepth>[^\)]+)\)|${ht}`,ae=I`\(\?<(?![=!])(?<captureName>[^>]+)>`,sr=I`${ae}|(?<unnamed>\()(?!\?)`,P=new RegExp(I`${ae}|${we}|\(\?|\\?.`,"gsu"),ue="Cannot use multiple overlapping recursions";function wt(e,r){const{hiddenCaptures:t,mode:n}={hiddenCaptures:[],mode:"plugin",...r};let a=r?.captureTransfers??new Map;if(!new RegExp(we,"su").test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:t};if(n==="plugin"&&ee(e,I`\(\?\(DEFINE\)`,S.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const s=[],o=ee(e,I`\\[1-9]`,S.DEFAULT),i=new Map,u=[];let c=!1,l=0,p=0,f;for(P.lastIndex=0;f=P.exec(e);){const{0:g,groups:{captureName:d,rDepth:w,gRNameOrNum:m,gRDepth:y}}=f;if(g==="[")l++;else if(l)g==="]"&&l--;else if(w){if(Pe(w),c)throw new Error(ue);if(o)throw new Error(`${n==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const E=e.slice(0,f.index),$=e.slice(P.lastIndex);if(ee($,we,S.DEFAULT))throw new Error(ue);const k=+w-1;e=Re(E,$,k,!1,t,s,p),a=Oe(a,E,k,s.length,0,p);break}else if(m){Pe(y);let E=!1;for(const X of u)if(X.name===m||X.num===+m){if(E=!0,X.hasRecursedWithin)throw new Error(ue);break}if(!E)throw new Error(I`Recursive \g cannot be used outside the referenced group "${n==="external"?m:I`\g<${m}&R=${y}>`}"`);const $=i.get(m),k=ft(e,$);if(o&&ee(k,I`${ae}|\((?!\?)`,S.DEFAULT))throw new Error(`${n==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const A=e.slice($,f.index),J=k.slice(A.length+g.length),D=s.length,B=+y-1,$e=Re(A,J,B,!0,t,s,p);a=Oe(a,A,B,s.length-D,D,p);const wr=e.slice(0,$),mr=e.slice($+k.length);e=`${wr}${$e}${mr}`,P.lastIndex+=$e.length-g.length-A.length-J.length,u.forEach(X=>X.hasRecursedWithin=!0),c=!0}else if(d)p++,i.set(String(p),P.lastIndex),i.set(d,P.lastIndex),u.push({num:p,name:d});else if(g[0]==="("){const E=g==="(";E&&(p++,i.set(String(p),P.lastIndex)),u.push(E?{num:p}:{})}else g===")"&&u.pop()}return t.push(...s),{pattern:e,captureTransfers:a,hiddenCaptures:t}}function Pe(e){const r=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(r);if(e=+e,e<2||e>100)throw new Error(r)}function Re(e,r,t,n,a,s,o){const i=new Set;n&&tr(e+r,ae,({groups:{captureName:c}})=>{i.add(c)},S.DEFAULT);const u=[t,n?i:null,a,s,o];return`${e}${Ue(`(?:${e}`,"forward",...u)}(?:)${Ue(`${r})`,"backward",...u)}${r}`}function Ue(e,r,t,n,a,s,o){const u=l=>r==="forward"?l+2:t-l+2-1;let c="";for(let l=0;l<t;l++){const p=u(l);c+=xe(e,I`${sr}|\\k<(?<backref>[^>]+)>`,({0:f,groups:{captureName:g,unnamed:d,backref:w}})=>{if(w&&n&&!n.has(w))return f;const m=`_$${p}`;if(d||g){const y=o+s.length+1;return s.push(y),mt(a,y),d?f:`(?<${g}${m}>`}return I`\k<${w}${m}>`},S.DEFAULT)}return c}function mt(e,r){for(let t=0;t<e.length;t++)e[t]>=r&&e[t]++}function Oe(e,r,t,n,a,s){if(e.size&&n){let o=0;tr(r,sr,()=>o++,S.DEFAULT);const i=s-o+a,u=new Map;return e.forEach((c,l)=>{const p=(n-o*t)/t,f=o*t,g=l>i+o?l+n:l,d=[];for(const w of c)if(w<=i)d.push(w);else if(w>i+o+p)d.push(w+n);else if(w<=i+o)for(let m=0;m<=t;m++)d.push(w+o*m);else for(let m=0;m<=t;m++)d.push(w+f+p*m);u.set(g,d)}),u}return e}var b=String.fromCodePoint,h=String.raw,L={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("[[]]","v")}catch{return!1}return!0})()};L.bugFlagVLiteralHyphenIsRange=L.unicodeSets?(()=>{try{new RegExp(h`[\d\-a]`,"v")}catch{return!0}return!1})():!1;L.bugNestedClassIgnoresNegation=L.unicodeSets&&new RegExp("[[^a]]","v").test("a");function te(e,{enable:r,disable:t}){return{dotAll:!t?.dotAll&&!!(r?.dotAll||e.dotAll),ignoreCase:!t?.ignoreCase&&!!(r?.ignoreCase||e.ignoreCase)}}function Q(e,r,t){return e.has(r)||e.set(r,t),e.get(r)}function me(e,r){return De[e]>=De[r]}function yt(e,r){if(e==null)throw new Error(r??"Value expected");return e}var De={ES2025:2025,ES2024:2024,ES2018:2018},Ct={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function ar(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!Ct[e.target])throw new Error(`Unexpected target "${e.target}"`);const r={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return r.target==="auto"&&(r.target=L.flagGroups?"ES2025":L.unicodeSets?"ES2024":"ES2018"),r}var bt="[ -\r ]",xt=new Set([b(304),b(305)]),_=h`[\p{L}\p{M}\p{N}\p{Pc}]`;function or(e){if(xt.has(e))return[e];const r=new Set,t=e.toLowerCase(),n=t.toUpperCase(),a=$t.get(t),s=kt.get(t),o=Et.get(t);return[...n].length===1&&r.add(n),o&&r.add(o),a&&r.add(a),r.add(t),s&&r.add(s),[...r]}var ke=new Map(`C Other
49
+ Cc Control cntrl
50
+ Cf Format
51
+ Cn Unassigned
52
+ Co Private_Use
53
+ Cs Surrogate
54
+ L Letter
55
+ LC Cased_Letter
56
+ Ll Lowercase_Letter
57
+ Lm Modifier_Letter
58
+ Lo Other_Letter
59
+ Lt Titlecase_Letter
60
+ Lu Uppercase_Letter
61
+ M Mark Combining_Mark
62
+ Mc Spacing_Mark
63
+ Me Enclosing_Mark
64
+ Mn Nonspacing_Mark
65
+ N Number
66
+ Nd Decimal_Number digit
67
+ Nl Letter_Number
68
+ No Other_Number
69
+ P Punctuation punct
70
+ Pc Connector_Punctuation
71
+ Pd Dash_Punctuation
72
+ Pe Close_Punctuation
73
+ Pf Final_Punctuation
74
+ Pi Initial_Punctuation
75
+ Po Other_Punctuation
76
+ Ps Open_Punctuation
77
+ S Symbol
78
+ Sc Currency_Symbol
79
+ Sk Modifier_Symbol
80
+ Sm Math_Symbol
81
+ So Other_Symbol
82
+ Z Separator
83
+ Zl Line_Separator
84
+ Zp Paragraph_Separator
85
+ Zs Space_Separator
86
+ ASCII
87
+ ASCII_Hex_Digit AHex
88
+ Alphabetic Alpha
89
+ Any
90
+ Assigned
91
+ Bidi_Control Bidi_C
92
+ Bidi_Mirrored Bidi_M
93
+ Case_Ignorable CI
94
+ Cased
95
+ Changes_When_Casefolded CWCF
96
+ Changes_When_Casemapped CWCM
97
+ Changes_When_Lowercased CWL
98
+ Changes_When_NFKC_Casefolded CWKCF
99
+ Changes_When_Titlecased CWT
100
+ Changes_When_Uppercased CWU
101
+ Dash
102
+ Default_Ignorable_Code_Point DI
103
+ Deprecated Dep
104
+ Diacritic Dia
105
+ Emoji
106
+ Emoji_Component EComp
107
+ Emoji_Modifier EMod
108
+ Emoji_Modifier_Base EBase
109
+ Emoji_Presentation EPres
110
+ Extended_Pictographic ExtPict
111
+ Extender Ext
112
+ Grapheme_Base Gr_Base
113
+ Grapheme_Extend Gr_Ext
114
+ Hex_Digit Hex
115
+ IDS_Binary_Operator IDSB
116
+ IDS_Trinary_Operator IDST
117
+ ID_Continue IDC
118
+ ID_Start IDS
119
+ Ideographic Ideo
120
+ Join_Control Join_C
121
+ Logical_Order_Exception LOE
122
+ Lowercase Lower
123
+ Math
124
+ Noncharacter_Code_Point NChar
125
+ Pattern_Syntax Pat_Syn
126
+ Pattern_White_Space Pat_WS
127
+ Quotation_Mark QMark
128
+ Radical
129
+ Regional_Indicator RI
130
+ Sentence_Terminal STerm
131
+ Soft_Dotted SD
132
+ Terminal_Punctuation Term
133
+ Unified_Ideograph UIdeo
134
+ Uppercase Upper
135
+ Variation_Selector VS
136
+ White_Space space
137
+ XID_Continue XIDC
138
+ XID_Start XIDS`.split(/\s/).map(e=>[se(e),e])),kt=new Map([["s",b(383)],[b(383),"s"]]),Et=new Map([[b(223),b(7838)],[b(107),b(8490)],[b(229),b(8491)],[b(969),b(8486)]]),$t=new Map([F(453),F(456),F(459),F(498),...ce(8072,8079),...ce(8088,8095),...ce(8104,8111),F(8124),F(8140),F(8188)]),At=new Map([["alnum",h`[\p{Alpha}\p{Nd}]`],["alpha",h`\p{Alpha}`],["ascii",h`\p{ASCII}`],["blank",h`[\p{Zs}\t]`],["cntrl",h`\p{Cc}`],["digit",h`\p{Nd}`],["graph",h`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",h`\p{Lower}`],["print",h`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",h`[\p{P}\p{S}]`],["space",h`\p{space}`],["upper",h`\p{Upper}`],["word",h`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",h`\p{AHex}`]]);function It(e,r){const t=[];for(let n=e;n<=r;n++)t.push(n);return t}function F(e){const r=b(e);return[r.toLowerCase(),r]}function ce(e,r){return It(e,r).map(t=>F(t))}var ir=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function St(e,r){const t={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...r};ur(e);const n={accuracy:t.accuracy,asciiWordBoundaries:t.asciiWordBoundaries,avoidSubclass:t.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:me(t.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Z(e,vt,n);const a={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:a,prevFlags:null,globalFlags:a,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:n.subroutineRefMap};Z(e,_t,s);const o={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return Z(e,Mt,o),e._originMap=s.groupOriginByCopy,e._strategy=n.strategy,e}var vt={AbsenceFunction({node:e,parent:r,replaceWith:t}){const{body:n,kind:a}=e;if(a==="repeater"){const s=v();s.body[0].body.push(R({negate:!0,body:n}),W("Any"));const o=v();o.body[0].body.push(Ye("greedy",0,1/0,s)),t(C(o,r),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:r,key:t},{flagDirectivesByAlt:n}){const a=e.body.filter(s=>s.kind==="flags");for(let s=t+1;s<r.body.length;s++){const o=r.body[s];Q(n,o,[]).push(...a)}},exit({node:e},{flagDirectivesByAlt:r}){if(r.get(e)?.length){const t=lr(r.get(e));if(t){const n=v({flags:t});n.body[0].body=e.body,e.body=[C(n,e)]}}}},Assertion({node:e,parent:r,key:t,container:n,root:a,remove:s,replaceWith:o},i){const{kind:u,negate:c}=e,{asciiWordBoundaries:l,avoidSubclass:p,supportedGNodes:f,wordIsAscii:g}=i;if(u==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${c?"Y":"y"}"`);if(u==="line_end")o(C(R({body:[O({body:[de("string_end")]}),O({body:[ne(10)]})]}),r));else if(u==="line_start")o(C(M(h`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),r));else if(u==="search_start")if(f.has(e))a.flags.sticky=!0,s();else{const d=n[t-1];if(d&&Rt(d))o(C(R({negate:!0}),r));else{if(p)throw new Error(h`Uses "\G" in a way that requires a subclass`);o(G(de("string_start"),r)),i.strategy="clip_search"}}else if(!(u==="string_end"||u==="string_start"))if(u==="string_end_newline")o(C(M(h`(?=\n?\z)`),r));else if(u==="word_boundary"){if(!g&&!l){const d=`(?:(?<=${_})(?!${_})|(?<!${_})(?=${_}))`,w=`(?:(?<=${_})(?=${_})|(?<!${_})(?!${_}))`;o(C(M(c?w:d),r))}}else throw new Error(`Unexpected assertion kind "${u}"`)},Backreference({node:e},{jsGroupNameMap:r}){let{ref:t}=e;typeof t=="string"&&!pe(t)&&(t=le(t,r),e.ref=t)},CapturingGroup({node:e},{jsGroupNameMap:r,subroutineRefMap:t}){let{name:n}=e;n&&!pe(n)&&(n=le(n,r),e.name=n),t.set(e.number,e),n&&t.set(n,e)},CharacterClassRange({node:e,parent:r,replaceWith:t}){if(r.kind==="intersection"){const n=re({body:[e]});t(C(n,r),{traverse:!0})}},CharacterSet({node:e,parent:r,replaceWith:t},{accuracy:n,minTargetEs2024:a,digitIsAscii:s,spaceIsAscii:o,wordIsAscii:i}){const{kind:u,negate:c,value:l}=e;if(s&&(u==="digit"||l==="digit")){t(G(he("digit",{negate:c}),r));return}if(o&&(u==="space"||l==="space")){t(C(fe(M(bt),c),r));return}if(i&&(u==="word"||l==="word")){t(G(he("word",{negate:c}),r));return}if(u==="any")t(G(W("Any"),r));else if(u==="digit")t(G(W("Nd",{negate:c}),r));else if(u!=="dot")if(u==="text_segment"){if(n==="strict")throw new Error(h`Use of "\X" requires non-strict accuracy`);const p="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",f=h`\p{RI}{2}|${p}(?:\u200D${p})*`;t(C(M(h`(?>\r\n|${a?h`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),r))}else if(u==="hex")t(G(W("AHex",{negate:c}),r));else if(u==="newline")t(C(M(c?`[^
139
+ ]`:`(?>\r
140
+ ?|[
141
+ \v\f…\u2028\u2029])`),r));else if(u==="posix")if(!a&&(l==="graph"||l==="print")){if(n==="strict")throw new Error(`POSIX class "${l}" requires min target ES2024 or non-strict accuracy`);let p={graph:"!-~",print:" -~"}[l];c&&(p=`\0-${b(p.codePointAt(0)-1)}${b(p.codePointAt(2)+1)}-􏿿`),t(C(M(`[${p}]`),r))}else t(C(fe(M(At.get(l)),c),r));else if(u==="property")ke.has(se(l))||(e.key="sc");else if(u==="space")t(G(W("space",{negate:c}),r));else if(u==="word")t(C(fe(M(_),c),r));else throw new Error(`Unexpected character set kind "${u}"`)},Directive({node:e,parent:r,root:t,remove:n,replaceWith:a,removeAllPrevSiblings:s,removeAllNextSiblings:o}){const{kind:i,flags:u}=e;if(i==="flags")if(!u.enable&&!u.disable)n();else{const c=v({flags:u});c.body[0].body=o(),a(C(c,r),{traverse:!0})}else if(i==="keep"){const c=t.body[0],p=t.body.length===1&&qe(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:t;if(r.parent!==p||p.body.length>1)throw new Error(h`Uses "\K" in a way that's unsupported`);const f=R({behind:!0});f.body[0].body=s(),a(C(f,r))}else throw new Error(`Unexpected directive kind "${i}"`)},Flags({node:e,parent:r}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),r.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:r,disable:t}=e.flags;r?.extended&&delete r.extended,t?.extended&&delete t.extended,r?.dotAll&&t?.dotAll&&delete r.dotAll,r?.ignoreCase&&t?.ignoreCase&&delete r.ignoreCase,r&&!Object.keys(r).length&&delete e.flags.enable,t&&!Object.keys(t).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},r){const{kind:t}=e;t==="lookbehind"&&(r.passedLookbehind=!0)},NamedCallout({node:e,parent:r,replaceWith:t}){const{kind:n}=e;if(n==="fail")t(C(R({negate:!0}),r));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const r=v();r.body[0].body.push(e.body),e.body=C(r,e)}},Regex:{enter({node:e},{supportedGNodes:r}){const t=[];let n=!1,a=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const o=fr(s.body);o?(n=!0,Array.isArray(o)?t.push(...o):t.push(o)):a=!0}n&&!a&&t.forEach(s=>r.add(s))},exit(e,{accuracy:r,passedLookbehind:t,strategy:n}){if(r==="strict"&&t&&n)throw new Error(h`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:r}){let{ref:t}=e;typeof t=="string"&&!pe(t)&&(t=le(t,r),e.ref=t)}},_t={Backreference({node:e},{multiplexCapturesToLeftByRef:r,reffedNodesByReferencer:t}){const{orphan:n,ref:a}=e;n||t.set(e,[...r.get(a).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:r,replaceWith:t,skip:n},{groupOriginByCopy:a,groupsByName:s,multiplexCapturesToLeftByRef:o,openRefs:i,reffedNodesByReferencer:u}){const c=a.get(e);if(c&&i.has(e.number)){const p=G(Be(e.number),r);u.set(p,i.get(e.number)),t(p);return}i.set(e.number,e),o.set(e.number,[]),e.name&&Q(o,e.name,[]);const l=o.get(e.name??e.number);for(let p=0;p<l.length;p++){const f=l[p];if(c===f.node||c&&c===f.origin||e===f.origin){l.splice(p,1);break}}if(o.get(e.number).push({node:e,origin:c}),e.name&&o.get(e.name).push({node:e,origin:c}),e.name){const p=Q(s,e.name,new Map);let f=!1;if(c)f=!0;else for(const g of p.values())if(!g.hasDuplicateNameToRemove){f=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:f})}},exit({node:e},{openRefs:r}){r.delete(e.number)}},Group:{enter({node:e},r){r.prevFlags=r.currentFlags,e.flags&&(r.currentFlags=te(r.currentFlags,e.flags))},exit(e,r){r.currentFlags=r.prevFlags}},Subroutine({node:e,parent:r,replaceWith:t},n){const{isRecursive:a,ref:s}=e;if(a){let l=r;for(;(l=l.parent)&&!(l.type==="CapturingGroup"&&(l.name===s||l.number===s)););n.reffedNodesByReferencer.set(e,l);return}const o=n.subroutineRefMap.get(s),i=s===0,u=i?Be(0):cr(o,n.groupOriginByCopy,null);let c=u;if(!i){const l=lr(Ft(o,f=>f.type==="Group"&&!!f.flags)),p=l?te(n.globalFlags,l):n.globalFlags;Nt(p,n.currentFlags)||(c=v({flags:Gt(p)}),c.body[0].body.push(u))}t(C(c,r),{traverse:!i})}},Mt={Backreference({node:e,parent:r,replaceWith:t},n){if(e.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,e.ref);return}const s=n.reffedNodesByReferencer.get(e).filter(o=>Lt(o,e));if(!s.length)t(C(R({negate:!0}),r));else if(s.length>1){const o=v({atomic:!0,body:s.reverse().map(i=>O({body:[ge(i.number)]}))});t(C(o,r))}else e.ref=s[0].number},CapturingGroup({node:e},r){e.number=++r.numCapturesToLeft,e.name&&r.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},r){const t=Math.max(r.highestOrphanBackref-r.numCapturesToLeft,0);for(let n=0;n<t;n++){const a=Ke();e.body.at(-1).body.push(a)}}},Subroutine({node:e},r){!e.isRecursive||e.ref===0||(e.ref=r.reffedNodesByReferencer.get(e).number)}};function ur(e){Z(e,{"*"({node:r,parent:t}){r.parent=t}})}function Nt(e,r){return e.dotAll===r.dotAll&&e.ignoreCase===r.ignoreCase}function Lt(e,r){let t=r;do{if(t.type==="Regex")return!1;if(t.type==="Alternative")continue;if(t===e)return!1;const n=pr(t.parent);for(const a of n){if(a===t)break;if(a===e||dr(a,e))return!0}}while(t=t.parent);throw new Error("Unexpected path")}function cr(e,r,t,n){const a=Array.isArray(e)?[]:{};for(const[s,o]of Object.entries(e))s==="parent"?a.parent=Array.isArray(t)?n:t:o&&typeof o=="object"?a[s]=cr(o,r,a,t):(s==="type"&&o==="CapturingGroup"&&r.set(a,r.get(e)??e),a[s]=o);return a}function Be(e){const r=er(e);return r.isRecursive=!0,r}function Ft(e,r){const t=[];for(;e=e.parent;)(!r||r(e))&&t.push(e);return t}function le(e,r){if(r.has(e))return r.get(e);const t=`$${r.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return r.set(e,t),t}function lr(e){const r=["dotAll","ignoreCase"],t={enable:{},disable:{}};return e.forEach(({flags:n})=>{r.forEach(a=>{n.enable?.[a]&&(delete t.disable[a],t.enable[a]=!0),n.disable?.[a]&&(t.disable[a]=!0)})}),Object.keys(t.enable).length||delete t.enable,Object.keys(t.disable).length||delete t.disable,t.enable||t.disable?t:null}function Gt({dotAll:e,ignoreCase:r}){const t={};return(e||r)&&(t.enable={},e&&(t.enable.dotAll=!0),r&&(t.enable.ignoreCase=!0)),(!e||!r)&&(t.disable={},!e&&(t.disable.dotAll=!0),!r&&(t.disable.ignoreCase=!0)),t}function pr(e){if(!e)throw new Error("Node expected");const{body:r}=e;return Array.isArray(r)?r:r?[r]:null}function fr(e){const r=e.find(t=>t.kind==="search_start"||Ut(t,{negate:!1})||!Pt(t));if(!r)return null;if(r.kind==="search_start")return r;if(r.type==="LookaroundAssertion")return r.body[0].body[0];if(r.type==="CapturingGroup"||r.type==="Group"){const t=[];for(const n of r.body){const a=fr(n.body);if(!a)return null;Array.isArray(a)?t.push(...a):t.push(a)}return t}return null}function dr(e,r){const t=pr(e)??[];for(const n of t)if(n===r||dr(n,r))return!0;return!1}function Pt({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Rt(e){const r=["Character","CharacterClass","CharacterSet"];return r.includes(e.type)||e.type==="Quantifier"&&e.min&&r.includes(e.body.type)}function Ut(e,r){const t={negate:null,...r};return e.type==="LookaroundAssertion"&&(t.negate===null||e.negate===t.negate)&&e.body.length===1&&qe(e.body[0],{type:"Assertion",kind:"search_start"})}function pe(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function M(e,r){const n=Je(e,{...r,unicodePropertyMap:ke}).body;return n.length>1||n[0].body.length>1?v({body:n}):n[0].body[0]}function fe(e,r){return e.negate=r,e}function G(e,r){return e.parent=r,e}function C(e,r){return ur(e),e.parent=r,e}function Ot(e,r){const t=ar(r),n=me(t.target,"ES2024"),a=me(t.target,"ES2025"),s=t.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,i=null;if(!a){const g=[e.flags.ignoreCase];Z(e,Dt,{getCurrentModI:()=>g.at(-1),popModI(){g.pop()},pushModI(d){g.push(d)},setHasCasedChar(){g.at(-1)?o=!0:i=!0}})}const u={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!i)};let c=e;const l={accuracy:t.accuracy,appliedGlobalFlags:u,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!a&&o&&i),useFlagMods:a,useFlagV:n,verbose:t.verbose};function p(g){return l.lastNode=c,c=g,yt(Bt[g.type],`Unexpected node type "${g.type}"`)(g,l,p)}const f={pattern:e.body.map(p).join("|"),flags:p(e.flags),options:{...e.options}};return n||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],l.captureMap.forEach((g,d)=>{g.hidden&&f._hiddenCaptures.push(d),g.transferTo&&Q(f._captureTransfers,g.transferTo,[]).push(d)}),f}var Dt={"*":{enter({node:e},r){if(Ve(e)){const t=r.getCurrentModI();r.pushModI(e.flags?te({ignoreCase:t},e.flags).ignoreCase:t)}},exit({node:e},r){Ve(e)&&r.popModI()}},Backreference(e,r){r.setHasCasedChar()},Character({node:e},r){Ee(b(e.value))&&r.setHasCasedChar()},CharacterClassRange({node:e,skip:r},t){r(),gr(e,{firstOnly:!0}).length&&t.setHasCasedChar()},CharacterSet({node:e},r){e.kind==="property"&&ir.has(e.value)&&r.setHasCasedChar()}},Bt={Alternative({body:e},r,t){return e.map(t).join("")},Assertion({kind:e,negate:r}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return r?h`\B`:h`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},r){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!r.useFlagMods&&r.accuracy==="strict"&&r.currentFlags.ignoreCase&&!r.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,r,t){const{body:n,name:a,number:s}=e,o={ignoreCase:r.currentFlags.ignoreCase},i=r.originMap.get(e);return i&&(o.hidden=!0,s>i.number&&(o.transferTo=i.number)),r.captureMap.set(s,o),`(${a?`?<${a}>`:""}${n.map(t).join("|")})`},Character({value:e},r){const t=b(e),n=V(e,{escDigit:r.lastNode.type==="Backreference",inCharClass:r.inCharClass,useFlagV:r.useFlagV});if(n!==t)return n;if(r.useAppliedIgnoreCase&&r.currentFlags.ignoreCase&&Ee(t)){const a=or(t);return r.inCharClass?a.join(""):a.length>1?`[${a.join("")}]`:a[0]}return t},CharacterClass(e,r,t){const{kind:n,negate:a,parent:s}=e;let{body:o}=e;if(n==="intersection"&&!r.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");L.bugFlagVLiteralHyphenIsRange&&r.useFlagV&&o.some(ze)&&(o=[ne(45),...o.filter(c=>!ze(c))]);const i=()=>`[${a?"^":""}${o.map(t).join(n==="intersection"?"&&":"")}]`;if(!r.inCharClass){if((!r.useFlagV||L.bugNestedClassIgnoresNegation)&&!a){const l=o.filter(p=>p.type==="CharacterClass"&&p.kind==="union"&&p.negate);if(l.length){const p=v(),f=p.body[0];return p.parent=s,f.parent=p,o=o.filter(g=>!l.includes(g)),e.body=o,o.length?(e.parent=f,f.body.push(e)):p.body.pop(),l.forEach(g=>{const d=O({body:[g]});g.parent=d,d.parent=p,p.body.push(d)}),t(p)}}r.inCharClass=!0;const c=i();return r.inCharClass=!1,c}const u=o[0];if(n==="union"&&!a&&u&&((!r.useFlagV||!r.verbose)&&s.kind==="union"&&!(L.bugFlagVLiteralHyphenIsRange&&r.useFlagV)||!r.verbose&&s.kind==="intersection"&&o.length===1&&u.type!=="CharacterClassRange"))return o.map(t).join("");if(!r.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return i()},CharacterClassRange(e,r){const t=e.min.value,n=e.max.value,a={escDigit:!1,inCharClass:!0,useFlagV:r.useFlagV},s=V(t,a),o=V(n,a),i=new Set;if(r.useAppliedIgnoreCase&&r.currentFlags.ignoreCase){const u=gr(e);Ht(u).forEach(l=>{i.add(Array.isArray(l)?`${V(l[0],a)}-${V(l[1],a)}`:V(l,a))})}return`${s}-${o}${[...i].join("")}`},CharacterSet({kind:e,negate:r,value:t,key:n},a){if(e==="dot")return a.currentFlags.dotAll?a.appliedGlobalFlags.dotAll||a.useFlagMods?".":"[^]":h`[^\n]`;if(e==="digit")return r?h`\D`:h`\d`;if(e==="property"){if(a.useAppliedIgnoreCase&&a.currentFlags.ignoreCase&&ir.has(t))throw new Error(`Unicode property "${t}" can't be case-insensitive when other chars have specific case`);return`${r?h`\P`:h`\p`}{${n?`${n}=`:""}${t}}`}if(e==="word")return r?h`\W`:h`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,r){return(r.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:r,flags:t,parent:n},a,s){const o=a.currentFlags;t&&(a.currentFlags=te(o,t));const i=r.map(s).join("|"),u=!a.verbose&&r.length===1&&n.type!=="Quantifier"&&!e&&(!a.useFlagMods||!t)?i:`(?${jt(e,t,a.useFlagMods)}${i})`;return a.currentFlags=o,u},LookaroundAssertion({body:e,kind:r,negate:t},n,a){return`(?${`${r==="lookahead"?"":"<"}${t?"!":"="}`}${e.map(a).join("|")})`},Quantifier(e,r,t){return t(e.body)+Xt(e)},Subroutine({isRecursive:e,ref:r},t){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=t.recursionLimit;return r===0?`(?R=${n})`:h`\g<${r}&R=${n}>`}},Tt=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Vt=new Set(["-","\\","]","^","["]),zt=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Te=new Map([[9,h`\t`],[10,h`\n`],[11,h`\v`],[12,h`\f`],[13,h`\r`],[8232,h`\u2028`],[8233,h`\u2029`],[65279,h`\uFEFF`]]),Wt=new RegExp("^\\p{Cased}$","u");function Ee(e){return Wt.test(e)}function gr(e,r){const t=!!r?.firstOnly,n=e.min.value,a=e.max.value,s=[];if(n<65&&(a===65535||a>=131071)||n===65536&&a>=131071)return s;for(let o=n;o<=a;o++){const i=b(o);if(!Ee(i))continue;const u=or(i).filter(c=>{const l=c.codePointAt(0);return l<n||l>a});if(u.length&&(s.push(...u),t))break}return s}function V(e,{escDigit:r,inCharClass:t,useFlagV:n}){if(Te.has(e))return Te.get(e);if(e<32||e>126&&e<160||e>262143||r&&Zt(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const a=t?n?zt:Vt:Tt,s=b(e);return(a.has(s)?"\\":"")+s}function Ht(e){const r=e.map(a=>a.codePointAt(0)).sort((a,s)=>a-s),t=[];let n=null;for(let a=0;a<r.length;a++)r[a+1]===r[a]+1?n??=r[a]:n===null?t.push(r[a]):(t.push([n,r[a]]),n=null);return t}function jt(e,r,t){if(e)return">";let n="";if(r&&t){const{enable:a,disable:s}=r;n=(a?.ignoreCase?"i":"")+(a?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${n}:`}function Xt({kind:e,max:r,min:t}){let n;return!t&&r===1?n="?":!t&&r===1/0?n="*":t===1&&r===1/0?n="+":t===r?n=`{${t}}`:n=`{${t},${r===1/0?"":r}}`,n+{greedy:"",lazy:"?",possessive:"+"}[e]}function Ve({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function Zt(e){return e>47&&e<58}function ze({type:e,value:r}){return e==="Character"&&r===45}var Qt=class ye extends RegExp{#r=new Map;#e=null;#n;#t=null;#s=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(r,t,n){const a=!!n?.lazyCompile;if(r instanceof RegExp){if(n)throw new Error("Cannot provide options when copying a regexp");const s=r;super(s,t),this.#n=s.source,s instanceof ye&&(this.#r=s.#r,this.#t=s.#t,this.#s=s.#s,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...n};super(a?"":r,t),this.#n=r,this.#r=Jt(s.hiddenCaptures,s.transfers),this.#s=s.strategy,this.rawOptions=n??{}}a||(this.#e=this)}exec(r){if(!this.#e){const{lazyCompile:a,...s}=this.rawOptions;this.#e=new ye(this.#n,this.flags,s)}const t=this.global||this.sticky,n=this.lastIndex;if(this.#s==="clip_search"&&t&&n){this.lastIndex=0;const a=this.#a(r.slice(n));return a&&(qt(a,n,r,this.hasIndices),this.lastIndex+=n),a}return this.#a(r)}#a(r){this.#e.lastIndex=this.lastIndex;const t=super.exec.call(this.#e,r);if(this.lastIndex=this.#e.lastIndex,!t||!this.#r.size)return t;const n=[...t];t.length=1;let a;this.hasIndices&&(a=[...t.indices],t.indices.length=1);const s=[0];for(let o=1;o<n.length;o++){const{hidden:i,transferTo:u}=this.#r.get(o)??{};if(i?s.push(null):(s.push(t.length),t.push(n[o]),this.hasIndices&&t.indices.push(a[o])),u&&n[o]!==void 0){const c=s[u];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(t[c]=n[o],this.hasIndices&&(t.indices[c]=a[o]),t.groups){this.#t||(this.#t=Kt(this.source));const l=this.#t.get(u);l&&(t.groups[l]=n[o],this.hasIndices&&(t.indices.groups[l]=a[o]))}}}return t}};function qt(e,r,t,n){if(e.index+=r,e.input=t,n){const a=e.indices;for(let o=0;o<a.length;o++){const i=a[o];i&&(a[o]=[i[0]+r,i[1]+r])}const s=a.groups;s&&Object.keys(s).forEach(o=>{const i=s[o];i&&(s[o]=[i[0]+r,i[1]+r])})}}function Jt(e,r){const t=new Map;for(const n of e)t.set(n,{hidden:!0});for(const[n,a]of r)for(const s of a)Q(t,s,{}).transferTo=n;return t}function Kt(e){const r=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,t=new Map;let n=0,a=0,s;for(;s=r.exec(e);){const{0:o,groups:{capture:i,name:u}}=s;o==="["?n++:n?o==="]"&&n--:i&&(a++,u&&t.set(a,u))}return t}function Yt(e,r){const t=en(e,r);return t.options?new Qt(t.pattern,t.flags,t.options):new RegExp(t.pattern,t.flags)}function en(e,r){const t=ar(r),n=Je(e,{flags:t.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:t.rules.captureGroup,singleline:t.rules.singleline},skipBackrefValidation:t.rules.allowOrphanBackrefs,unicodePropertyMap:ke}),a=St(n,{accuracy:t.accuracy,asciiWordBoundaries:t.rules.asciiWordBoundaries,avoidSubclass:t.avoidSubclass,bestEffortTarget:t.target}),s=Ot(a,t),o=wt(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),i=gt(o.pattern),u=dt(i.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),c={pattern:u.pattern,flags:`${t.hasIndices?"d":""}${t.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(t.avoidSubclass){if(t.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const l=u.hiddenCaptures.sort((d,w)=>d-w),p=Array.from(u.captureTransfers),f=a._strategy,g=c.pattern.length>=t.lazyCompileLength;(l.length||p.length||f||g)&&(c.options={...l.length&&{hiddenCaptures:l},...p.length&&{transfers:p},...f&&{strategy:f},...g&&{lazyCompile:g}})}return c}const We=4294967295;class hr{constructor(r,t={}){this.patterns=r,this.options=t;const{forgiving:n=!1,cache:a,regexConstructor:s}=t;if(!s)throw new Error("Option `regexConstructor` is not provided");this.regexps=r.map(o=>{if(typeof o!="string")return o;const i=a?.get(o);if(i){if(i instanceof RegExp)return i;if(n)return null;throw i}try{const u=s(o);return a?.set(o,u),u}catch(u){if(a?.set(o,u),n)return null;throw u}})}regexps;findNextMatchSync(r,t,n){const a=typeof r=="string"?r:r.content,s=[];function o(i,u,c=0){return{index:i,captureIndices:u.indices.map(l=>l==null?{start:We,end:We,length:0}:{start:l[0]+c,end:l[1]+c,length:l[1]-l[0]})}}for(let i=0;i<this.regexps.length;i++){const u=this.regexps[i];if(u)try{u.lastIndex=t;const c=u.exec(a);if(!c)continue;if(c.index===t)return o(i,c,0);s.push([i,c,0])}catch(c){if(this.options.forgiving)continue;throw c}}if(s.length){const i=Math.min(...s.map(u=>u[1].index));for(const[u,c,l]of s)if(c.index===i)return o(u,c,l)}return null}}function rn(e,r){return Yt(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...r})}function tn(e={}){const r=Object.assign({target:"auto",cache:new Map},e);return r.regexConstructor||=t=>rn(t,{target:r.target}),{createScanner(t){return new hr(t,r)},createString(t){return{content:t}}}}function nn(){const e={cache:new Map,regexConstructor:()=>{throw new Error("JavaScriptRawEngine: only support precompiled grammar")}};return{createScanner(r){return new hr(r,e)},createString(r){return{content:r}}}}export{hr as JavaScriptScanner,nn as createJavaScriptRawEngine,tn as createJavaScriptRegexEngine,rn as defaultJavaScriptRegexConstructor};
@@ -0,0 +1 @@
1
+ import{j as e,r,L as se,u as L}from"./main-mIHr_ble.js";import{m as E,A,u as ie}from"./visuallyHidden-CqGRL_Oq.js";import{G as be,c as h,b as ne,B as k,H as j,I as ye,r as ve,K as je,L as we,M as Ne,N as Ce,O as ke,Q as ae,W as re,Y as ce,Z as De,_ as Se,k as Ee,$ as Fe,a0 as ze,a1 as de,a2 as ue,a3 as Me,a4 as Re,a5 as Te,a6 as Le,a7 as Ke,a8 as $e,S as ee,a9 as Ue,V as Ie}from"./button-BaHefIXU.js";import{T as P,a as W,b as B,c as O,s as Ae,d as Pe,g as te}from"./tooltip-w9D-e_R-.js";import{u as F,M as We,e as Be,f as Oe,g as le,D as Q,a as _,b as V,c as H,d as G}from"./use-file-explorer-state-CLaDuI9X.js";import{u as K}from"./useMutation-fJnleJAb.js";import"./DirectionContext-DXnZc0zz.js";import"./useButton-DsMdJPGn.js";import"./useCompositeItem-CaYygSfB.js";import"./react-Cfq4ot0g.js";function qe({className:i}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",className:i,children:[e.jsx("rect",{width:"80",height:"80",fill:"currentColor",className:"text-transparent"}),e.jsx("path",{d:"M61.9624 45.5729C62.5862 44.3371 63.0907 43.3377 63.4782 41.9826C69.8221 28.8286 70.5847 14.0975 67.1723 4.32469C65.8317 0.249835 62.7688 0.254311 62.6374 3.58605C61.355 12.189 58.9061 17.6275 57.1756 21.0554C52.8087 29.7058 45.9949 37.7278 39.3706 42.7305C28.6217 50.8021 25.0716 44.614 24.3711 37.8823C23.8822 32.1203 24.7206 25.5721 26.24 18.2889C27.102 15.3261 24.3944 13.9592 22.5223 16.4122C20.4062 19.3487 18.5586 22.4209 17.1838 25.7318C12.9928 33.4462 10.3896 45.3332 11.4505 57.6273C12.2296 63.5357 13.1688 68.4057 14.1079 73.2757C15.2695 79.0941 19.1598 79.5073 24.3117 78.0088C39.7921 74.0789 54.143 58.872 59.7093 49.1011C60.7255 48.0229 61.3494 46.7872 61.9624 45.5729Z",fill:"currentColor",className:"text-primary-950"})]})}function Qe(){return r.useMemo(()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[])}function _e({isCollapsed:i,onToggleCollapse:s,onSelectAction:n}){const{navigateTo:a,currentPath:o}=F(),c=Qe(),t=r.useMemo(()=>({duration:c?0:.15,ease:i?"easeIn":"easeOut"}),[i,c]),l=r.useCallback(d=>{a(d)},[a]),m=r.useCallback((d,C)=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),C())},[]),v=r.useMemo(()=>[{path:"/",icon:be,label:"Home",id:"home"}],[]),y=r.useMemo(()=>({className:"border-r border-primary-200 h-full overflow-hidden bg-primary-100 flex flex-col"}),[]),f=48,u=300;return e.jsxs(E.aside,{initial:!1,animate:{width:c?i?f:u:void 0},style:{width:c?void 0:i?f:u},transition:t,className:y.className,role:"navigation","aria-label":"File explorer navigation",children:[e.jsxs(E.div,{layout:!0,transition:{layout:t},className:h("flex items-center h-12 px-2 justify-between"),children:[e.jsx(A,{initial:!1,children:i?null:e.jsx(E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:t,children:e.jsxs(se,{to:"/new",className:h(ne({variant:"ghost",size:"sm"}),"w-full pl-1.5 justify-start","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),children:[e.jsx(qe,{className:"size-5 rounded-sm","aria-hidden":"true"}),e.jsx("span",{children:"WebClaw"})]})})}),e.jsx(P,{children:e.jsxs(W,{children:[e.jsx(B,{onClick:s,onKeyDown:d=>m(d,s),render:e.jsx(k,{size:"icon-sm",variant:"ghost","aria-label":i?"Expand sidebar":"Collapse sidebar",className:h("focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),children:e.jsx(j,{icon:ye,size:20,strokeWidth:1.5,"aria-hidden":"true"})})}),e.jsx(O,{side:"right",children:i?"Expand sidebar":"Collapse sidebar"})]})})]}),e.jsx("div",{className:"px-2 mb-4",children:e.jsx(E.div,{layout:!0,transition:{layout:t},className:"w-full",children:e.jsx(P,{children:e.jsxs(W,{children:[e.jsx(B,{asChild:!0,children:e.jsxs(se,{to:"/chat/$sessionKey",params:{sessionKey:"main"},className:h(ne({variant:"ghost",size:"sm"}),"w-full pl-1.5 justify-start","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),onClick:n,children:[e.jsx(j,{icon:ve,size:20,strokeWidth:1.5,className:"min-w-5","aria-hidden":"true"}),e.jsx(A,{initial:!1,mode:"wait",children:i?null:e.jsx(E.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:t,className:"overflow-hidden whitespace-nowrap",children:"Back to Chat"})})]})}),i?e.jsx(O,{side:"right",children:"Back to Chat"}):null]})})})}),e.jsx("div",{className:"flex-1 min-h-0 relative overflow-hidden",children:e.jsx(A,{initial:!1,children:i?e.jsx(E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:t,className:"px-2 space-y-1",children:v.map(d=>e.jsx(P,{children:e.jsxs(W,{children:[e.jsx(B,{onClick:()=>l(d.path),onKeyDown:C=>m(C,()=>l(d.path)),render:e.jsx(k,{size:"icon-sm",variant:"ghost","aria-current":o===d.path?"page":void 0,"aria-label":`Navigate to ${d.label}`,className:h("w-full text-primary-600 hover:text-primary-900","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation",o===d.path&&"bg-primary-200 text-primary-900"),children:e.jsx(j,{icon:d.icon,size:20,strokeWidth:1.5,"aria-hidden":"true"})})}),e.jsx(O,{side:"right",children:d.label})]})},d.id))},"collapsed-content"):e.jsx(E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:t,className:"absolute inset-0 pt-0 flex flex-col w-[300px] min-h-0",children:e.jsxs("div",{className:"flex-1 min-h-0 px-2",children:[e.jsx("div",{className:"mb-4",children:e.jsx("h2",{className:"text-sm font-medium text-primary-700 mb-3 px-1.5",children:"Quick Access"})}),e.jsx("nav",{className:"space-y-1",role:"list","aria-label":"Quick access folders",children:v.map(d=>e.jsx("div",{role:"listitem",children:e.jsxs(k,{variant:"ghost",size:"sm",onClick:()=>l(d.path),onKeyDown:C=>m(C,()=>l(d.path)),"aria-current":o===d.path?"page":void 0,className:h("w-full pl-1.5 justify-start text-primary-600 hover:text-primary-900","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation",o===d.path&&"bg-primary-200 text-primary-900 font-medium"),"aria-label":`Navigate to ${d.label}`,children:[e.jsx(j,{icon:d.icon,size:20,strokeWidth:1.5,className:"min-w-5","aria-hidden":"true"}),e.jsx("span",{className:"overflow-hidden whitespace-nowrap min-w-0 truncate",children:d.label})]})},d.id))})]})},"content")})}),e.jsx("div",{className:"px-2 py-3 border-t border-primary-200 bg-primary-100",children:e.jsx(E.div,{layout:!0,transition:{layout:t},className:"w-full",children:e.jsx(P,{children:e.jsxs(W,{children:[e.jsx(B,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:i?"icon-sm":"sm",className:h(i?"w-full":"w-full justify-start pl-1.5","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),"aria-label":"Settings",children:[e.jsx(j,{icon:je,size:20,strokeWidth:1.5,className:"min-w-5","aria-hidden":"true"}),e.jsx(A,{initial:!1,mode:"wait",children:i?null:e.jsx(E.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:t,className:"overflow-hidden whitespace-nowrap",children:"Settings"})})]})}),i?e.jsx(O,{side:"right",children:"Settings"}):null]})})})})]})}function Ve(i,s){return i.isCollapsed===s.isCollapsed}const He=r.memo(_e,Ve);function Ge({path:i}){const{navigateTo:s}=F(),n=i==="/"?[]:i.split("/").filter(Boolean),a=[{name:"Home",path:"/"},...n.map((t,l)=>({name:t,path:"/"+n.slice(0,l+1).join("/")}))],o=r.useCallback(t=>{s(t)},[s]),c=r.useCallback((t,l)=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),s(l))},[s]);return e.jsx("nav",{"aria-label":"File navigation",className:"text-sm text-primary-600",children:e.jsx("ol",{className:"flex items-center gap-1",children:a.map((t,l)=>e.jsxs("li",{className:"flex items-center gap-1",children:[l>0?e.jsx(j,{icon:we,size:16,strokeWidth:1.5,className:"text-primary-400","aria-hidden":"true"}):null,e.jsxs("button",{type:"button",onClick:()=>o(t.path),onKeyDown:m=>c(m,t.path),"aria-current":l===a.length-1?"page":void 0,className:h("flex items-center gap-1.5 rounded-md px-2 py-1","transition-colors duration-150 ease-out","hover:bg-primary-100 hover:text-primary-900","focus-visible:bg-primary-100 focus-visible:text-primary-900","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation",l===a.length-1?"text-primary-900 font-medium":"text-primary-600"),children:[l===0?e.jsx(j,{icon:Ne,size:16,strokeWidth:1.5,"aria-hidden":"true"}):null,e.jsx("span",{className:"whitespace-nowrap",children:t.name})]})]},t.path))})})}const Z=[{label:"Name",value:"name"},{label:"Size",value:"size"},{label:"Modified",value:"modified"}];function Je({onUpload:i,onCreateFolder:s}){const{viewMode:n,sortBy:a,sortAsc:o,setViewMode:c,setSortBy:t,toggleSort:l}=F(),m=r.useCallback(()=>{c("list")},[c]),v=r.useCallback(()=>{c("grid")},[c]),y=r.useCallback(u=>{t(u)},[t]),f=r.useCallback((u,d)=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),d())},[]);return e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center border border-primary-200 rounded-lg overflow-hidden",role:"group","aria-label":"View mode",children:[e.jsx(k,{size:"sm",variant:n==="list"?"default":"ghost",onClick:m,onKeyDown:u=>f(u,m),"aria-label":"Switch to list view","aria-pressed":n==="list",className:h("rounded-none border-0","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),children:e.jsx(j,{icon:Ce,size:18,strokeWidth:1.5,"aria-hidden":"true"})}),e.jsx(k,{size:"sm",variant:n==="grid"?"default":"ghost",onClick:v,onKeyDown:u=>f(u,v),"aria-label":"Switch to grid view","aria-pressed":n==="grid",className:h("rounded-none border-0 border-l border-primary-200","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),children:e.jsx(j,{icon:ke,size:18,strokeWidth:1.5,"aria-hidden":"true"})})]}),e.jsxs(We,{children:[e.jsx(Be,{render:e.jsxs(k,{variant:"ghost",size:"sm",className:h("gap-1","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),"aria-label":`Sort by ${Z.find(u=>u.value===a)?.label}, ${o?"ascending":"descending"}`,children:[e.jsxs("span",{children:["Sort: ",Z.find(u=>u.value===a)?.label]}),e.jsx(j,{icon:o?ae:re,size:16,strokeWidth:1.5,"aria-hidden":"true"})]})}),e.jsxs(Oe,{side:"bottom",align:"start",children:[Z.map(u=>e.jsx(le,{onClick:()=>y(u.value),className:h(a===u.value&&"bg-primary-100 text-primary-900","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none"),"aria-current":a===u.value?"true":"false",children:u.label},u.value)),e.jsxs(le,{onClick:l,className:"focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none",children:[e.jsx(j,{icon:o?re:ae,size:16,strokeWidth:1.5,"aria-hidden":"true"}),o?"Sort Descending":"Sort Ascending"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(k,{variant:"ghost",size:"sm",onClick:i,onKeyDown:u=>f(u,i),className:h("gap-2","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),"aria-label":"Upload files",children:[e.jsx(j,{icon:ce,size:18,strokeWidth:1.5,"aria-hidden":"true"}),e.jsx("span",{children:"Upload"})]}),e.jsxs(k,{variant:"ghost",size:"sm",onClick:s,onKeyDown:u=>f(u,s),className:h("gap-2","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),"aria-label":"Create new folder",children:[e.jsx(j,{icon:De,size:18,strokeWidth:1.5,"aria-hidden":"true"}),e.jsx("span",{children:"New Folder"})]})]})]})}const z={all:["files"],listing:i=>["files","listing",i],content:i=>["files","content",i]};function Xe(i){return ie({queryKey:z.content(i||""),queryFn:async({signal:s})=>{const n=await fetch(`/api/files/read?path=${encodeURIComponent(i)}`,{signal:s});if(!n.ok){const a=await n.json().catch(()=>({error:"Failed to read file"}));throw new Error(a.error||"Failed to read file")}return n.json()},enabled:!!i,staleTime:30*1e3,gcTime:300*1e3})}function Ye(){const i=L(),s=r.useRef(null);return r.useEffect(()=>()=>{s.current?.abort()},[]),K({mutationFn:async({path:n,content:a})=>{s.current?.abort();const o=new AbortController;s.current=o;const c=await fetch("/api/files/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:a}),signal:o.signal});if(!c.ok){const t=await c.json().catch(()=>({error:"Failed to save file"}));throw new Error(t.error||"Failed to save file")}return c.json()},onSuccess:(n,a)=>{i.invalidateQueries({queryKey:z.content(a.path)});const o=a.path.split("/").slice(0,-1).join("/")||"/";i.invalidateQueries({queryKey:z.listing(o)})}})}function Ze(i){return ie({queryKey:z.listing(i),queryFn:async({signal:s})=>{const n=await fetch(`/api/files/list?path=${encodeURIComponent(i)}`,{signal:s});if(!n.ok){const a=await n.text();throw new Error(`Failed to load files: ${a}`)}return n.json()},staleTime:300*1e3,gcTime:600*1e3,retry:3})}function ei(){const i=new Set,s=r.useRef(null);return r.useEffect(()=>()=>{s.current?.abort(),i.forEach(n=>URL.revokeObjectURL(n)),i.clear()},[]),K({mutationFn:async n=>{s.current?.abort();const a=new AbortController;s.current=a;const o=await fetch(`/api/files/download?path=${encodeURIComponent(n)}`,{signal:a.signal});if(!o.ok){const v=await o.text();throw new Error(`Download failed: ${v}`)}const c=await o.blob(),t=window.URL.createObjectURL(c);i.add(t);const l=n.split("/").pop()||"download",m=document.createElement("a");m.href=t,m.download=l,document.body.appendChild(m),m.click(),document.body.removeChild(m),setTimeout(()=>{i.has(t)&&(URL.revokeObjectURL(t),i.delete(t))},100)},onError:n=>{n instanceof Error&&n.name==="AbortError"||console.error("Download failed:",n)}})}function ii(){const i=L(),s=r.useRef(null);return r.useEffect(()=>()=>{s.current?.abort()},[]),K({mutationFn:async({files:n,path:a})=>{s.current?.abort();const o=new AbortController;s.current=o;const c=[];for(let t=0;t<n.length;t++){const l=new FormData;l.append("path",a),l.append("file",n[t]);const m=await fetch("/api/files/upload",{method:"POST",body:l,signal:o.signal});if(!m.ok){const v=await m.text();throw new Error(`Upload failed for ${n[t].name}: ${v}`)}c.push(await m.json())}return c},onSuccess:(n,a)=>{i.invalidateQueries({queryKey:z.listing(a.path)})},onError:n=>{n instanceof Error&&n.name==="AbortError"||console.error("Upload failed:",n)}})}function si(){const i=L(),s=r.useRef(null);return r.useEffect(()=>()=>{s.current?.abort()},[]),K({mutationFn:async n=>{s.current?.abort();const a=new AbortController;s.current=a;const o=await fetch(`/api/files/delete?path=${encodeURIComponent(n)}`,{method:"DELETE",signal:a.signal});if(!o.ok){const c=await o.text();throw new Error(`Delete failed: ${c}`)}return o.json()},onSuccess:(n,a)=>{const o=a.split("/").slice(0,-1).join("/")||"/";i.invalidateQueries({queryKey:z.listing(o)})},onError:n=>{n instanceof Error&&n.name==="AbortError"||console.error("Delete failed:",n)}})}function ni(){const i=L(),s=r.useRef(null);return r.useEffect(()=>()=>{s.current?.abort()},[]),K({mutationFn:async({path:n,name:a})=>{s.current?.abort();const o=new AbortController;s.current=o;const c=await fetch("/api/files/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:`${n}/${a}`}),signal:o.signal});if(!c.ok){const t=await c.text();throw new Error(`Create folder failed: ${t}`)}return c.json()},onSuccess:(n,a)=>{i.invalidateQueries({queryKey:z.listing(a.path)})},onError:n=>{n instanceof Error&&n.name==="AbortError"||console.error("Create folder failed:",n)}})}function ai(){const i=L(),s=r.useRef(null);return r.useEffect(()=>()=>{s.current?.abort()},[]),K({mutationFn:async({oldPath:n,newName:a})=>{s.current?.abort();const o=new AbortController;s.current=o;const t=`${n.split("/").slice(0,-1).join("/")}/${a}`,l=await fetch("/api/files/rename",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({src:n,dst:t}),signal:o.signal});if(!l.ok){const m=await l.text();throw new Error(`Rename failed: ${m}`)}return l.json()},onSuccess:(n,a)=>{const o=a.oldPath.split("/").slice(0,-1).join("/")||"/";i.invalidateQueries({queryKey:z.listing(o)})},onError:n=>{n instanceof Error&&n.name==="AbortError"||console.error("Rename failed:",n)}})}const ri=new Set(["txt","md","log","json","xml","yaml","yml","csv","ini","conf","cfg","js","ts","jsx","tsx","py","java","cpp","c","h","css","html","htm","php","rb","go","rs","sh","bash","zsh","toml","env","gitignore","dockerfile","makefile","sql","graphql","svelte","vue","scss","less"]);function me({item:i,children:s,onOpenFile:n}){const[a,o]=r.useState(!1),[c,t]=r.useState({x:0,y:0}),[l,m]=r.useState(!1),[v,y]=r.useState(!1),[f,u]=r.useState(i.name),[d,C]=r.useState(""),N=r.useRef(null),{navigateTo:w}=F(),p=ei(),x=si(),D=ai(),M=r.useCallback(b=>{switch(b){case"open":i.isDir&&w(i.path);break;case"edit":n&&n(i.path);break;case"download":i.isDir||p.mutate(i.path);break;case"rename":u(i.name),C(""),m(!0);break;case"delete":y(!0);break}},[i,p,w]),X=r.useCallback(b=>{b.preventDefault(),b.stopPropagation(),t({x:b.clientX,y:b.clientY}),o(!0)},[]),$=r.useCallback(async()=>{if(!f||f===i.name){m(!1);return}C("");try{await D.mutateAsync({oldPath:i.path,newName:f.trim()}),m(!1)}catch(b){const T=b instanceof Error?b.message:"Failed to rename";C(T)}},[f,i,D]),U=r.useCallback(async()=>{try{await x.mutateAsync(i.path),y(!1)}catch(b){console.error("Delete failed:",b)}},[i.path,x]),Y=r.useCallback(b=>{b.key==="Enter"?(b.preventDefault(),$()):b.key==="Escape"&&(b.preventDefault(),m(!1))},[$]),g=r.useCallback(b=>{u(b.target.value),d&&C("")},[d]);r.useEffect(()=>{if(l&&N.current){const b=N.current;if(b.focus(),!i.isDir&&i.extension){const T=i.name.replace(new RegExp(`\\.${i.extension}$`),"");b.setSelectionRange(0,T.length)}else b.select()}},[l,i]);const S=f.trim().length>0&&!/[<>:"/\\|?*]/.test(f)&&!f.includes("..")&&f!==i.name,R=()=>p.isPending?"Downloading…":"Download",fe=()=>D.isPending?"Renaming…":"Rename",he=()=>x.isPending?"Deleting…":"Delete";r.useEffect(()=>{if(!a)return;const b=()=>o(!1),T=ge=>{ge.key==="Escape"&&o(!1)},xe=setTimeout(()=>{document.addEventListener("click",b),document.addEventListener("contextmenu",b),document.addEventListener("keydown",T)},0);return()=>{clearTimeout(xe),document.removeEventListener("click",b),document.removeEventListener("contextmenu",b),document.removeEventListener("keydown",T)}},[a]);const I=r.useCallback(b=>{o(!1),M(b)},[M]);return e.jsxs(e.Fragment,{children:[e.jsx("div",{onContextMenu:X,children:s}),a?e.jsx("div",{className:"fixed inset-0 z-50","aria-modal":"true",role:"dialog",children:e.jsxs("div",{className:"fixed min-w-[140px] rounded-lg bg-primary-50 p-1 text-sm text-primary-900 shadow-lg outline outline-primary-900/10 z-50",style:{left:c.x,top:c.y},role:"menu",onClick:b=>b.stopPropagation(),children:[i.isDir?e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>I("open"),className:h("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-primary-900","hover:bg-primary-100 select-none font-[450]","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none"),children:[e.jsx(j,{icon:Se,size:16,strokeWidth:1.5,"aria-hidden":"true"}),"Open"]}):null,i.isDir?null:e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>I("download"),disabled:p.isPending,className:h("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-primary-900","hover:bg-primary-100 select-none font-[450]","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none"),children:[e.jsx(j,{icon:Ee,size:16,strokeWidth:1.5,"aria-hidden":"true"}),R()]}),!i.isDir&&ri.has(i.extension.toLowerCase())?e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>I("edit"),className:h("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-primary-900","hover:bg-primary-100 select-none font-[450]","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none"),children:[e.jsx(j,{icon:Fe,size:16,strokeWidth:1.5,"aria-hidden":"true"}),"Edit"]}):null,e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>I("rename"),className:h("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-primary-900","hover:bg-primary-100 select-none font-[450]","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none"),children:[e.jsx(j,{icon:ze,size:16,strokeWidth:1.5,"aria-hidden":"true"}),"Rename"]}),e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>I("delete"),className:h("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm","text-red-600 hover:bg-red-50 select-none font-[450]","focus-visible:ring-2 focus-visible:ring-red-300 focus-visible:outline-none"),children:[e.jsx(j,{icon:de,size:16,strokeWidth:1.5,"aria-hidden":"true"}),"Delete"]})]})}):null,e.jsx(Q,{open:l,onOpenChange:m,children:e.jsx(_,{children:e.jsxs("div",{className:"p-6",children:[e.jsxs(V,{className:"mb-2",children:["Rename ",i.isDir?"Folder":"File"]}),e.jsxs(H,{className:"mb-4",children:['Enter a new name for "',i.name,'"']}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("label",{htmlFor:"rename-input",className:"block text-sm font-medium text-primary-900 mb-2",children:[i.isDir?"Folder":"File"," Name"]}),e.jsx("input",{id:"rename-input",ref:N,type:"text",value:f,onChange:g,onKeyDown:Y,autoFocus:!0,spellCheck:!1,"aria-describedby":d?"rename-error":void 0,"aria-invalid":d?"true":"false",className:h("w-full px-3 py-2 border rounded-lg","transition-colors duration-150 ease-out","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation",d?"border-red-300 focus-visible:ring-red-300":"border-primary-200 focus:border-primary-300")}),d?e.jsx("p",{id:"rename-error",className:"text-sm text-red-600 mt-1",role:"alert","aria-live":"polite",children:d}):null]}),D.isPending?e.jsx("div",{className:"mb-4 p-3 bg-primary-50 rounded-lg","aria-live":"polite",children:e.jsx("p",{className:"text-sm text-primary-600",children:"Renaming…"})}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(G,{disabled:D.isPending,className:h("focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),children:"Cancel"}),e.jsx(k,{onClick:$,disabled:!S||D.isPending,className:h("focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation",(!S||D.isPending)&&"opacity-50 cursor-not-allowed"),children:fe()})]})]})})}),e.jsx(Q,{open:v,onOpenChange:y,children:e.jsx(_,{children:e.jsxs("div",{className:"p-6",children:[e.jsxs(V,{className:"mb-2",children:["Delete ",i.isDir?"Folder":"File"]}),e.jsxs(H,{className:"mb-4",children:['Are you sure you want to delete "',i.name,'"?',i.isDir?" This will delete the folder and all its contents.":""," ","This action cannot be undone."]}),x.isPending?e.jsx("div",{className:"mb-4 p-3 bg-red-50 rounded-lg","aria-live":"polite",children:e.jsx("p",{className:"text-sm text-red-700",children:"Deleting…"})}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(G,{disabled:x.isPending,className:h("focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),children:"Cancel"}),e.jsx(k,{variant:"destructive",onClick:U,disabled:x.isPending,className:h("focus-visible:ring-2 focus-visible:ring-red-300 focus-visible:outline-none","touch-manipulation",x.isPending&&"opacity-50 cursor-not-allowed"),children:he()})]})]})})})]})}const ti=new Set(["txt","md","log","json","xml","yaml","yml","csv","ini","conf","cfg","js","ts","jsx","tsx","py","java","cpp","c","h","css","html","htm","php","rb","go","rs","sh","bash","zsh","toml","env","gitignore","dockerfile","makefile","sql","graphql","svelte","vue","scss","less"]);function J(i){if(i===0)return"0 B";const s=1024,n=["B","KB","MB","GB","TB"],a=Math.floor(Math.log(i)/Math.log(s));return parseFloat((i/Math.pow(s,a)).toFixed(1))+" "+n[a]}function q(i){const s=new Date(i),a=new Date().getTime()-s.getTime(),o=Math.floor(a/1e3),c=Math.floor(o/60),t=Math.floor(c/60),l=Math.floor(t/24);return l>7?s.toLocaleDateString():l>0?l===1?"yesterday":`${l} days ago`:t>0?t===1?"1 hour ago":`${t} hours ago`:c>0?c===1?"1 minute ago":`${c} minutes ago`:"just now"}function pe(i){if(i.isDir)return ue;const s=i.extension.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp"].includes(s)?Me:["mp4","avi","mkv","mov","wmv","flv","webm"].includes(s)?Re:["mp3","wav","flac","aac","ogg","m4a"].includes(s)?Te:["zip","rar","7z","tar","gz","bz2"].includes(s)?Le:["txt","md","log","json","xml","yaml","yml"].includes(s)?Ke:["js","ts","jsx","tsx","py","java","cpp","c","h","css","html","php","rb","go","rs"].includes(s)?$e:ee}function li(i,s,n){return r.useMemo(()=>[...i].sort((o,c)=>{if(o.isDir&&!c.isDir)return-1;if(!o.isDir&&c.isDir)return 1;let t=0;switch(s){case"name":t=o.name.localeCompare(c.name);break;case"size":t=o.size-c.size;break;case"modified":t=new Date(o.modified).getTime()-new Date(c.modified).getTime();break;default:t=o.name.localeCompare(c.name)}return n?t:-t}),[i,s,n])}function oi(){return r.useMemo(()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[])}function ci({viewMode:i}){const s=i==="grid"?12:8;return i==="grid"?e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8 gap-3 p-4","aria-busy":"true","aria-label":"Loading files",children:Array.from({length:s},(n,a)=>e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg",children:[e.jsx("div",{className:"w-12 h-12 bg-primary-200 rounded animate-pulse mb-2"}),e.jsx("div",{className:"w-16 h-4 bg-primary-200 rounded animate-pulse"})]},a))}):e.jsx("div",{className:"divide-y divide-primary-200","aria-busy":"true","aria-label":"Loading files",children:Array.from({length:s},(n,a)=>e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e.jsx("div",{className:"w-6 h-6 bg-primary-200 rounded animate-pulse"}),e.jsx("div",{className:"flex-1 min-w-0 h-4 bg-primary-200 rounded animate-pulse"}),e.jsx("div",{className:"w-16 h-4 bg-primary-200 rounded animate-pulse"}),e.jsx("div",{className:"w-20 h-4 bg-primary-200 rounded animate-pulse"})]},a))})}const di=r.memo(function({item:s,isSelected:n,onClick:a,onDoubleClick:o,onKeyDown:c,onOpenFile:t,reduceMotion:l}){const m=r.useCallback(()=>{a(s)},[a,s]),v=r.useCallback(()=>{o(s)},[o,s]),y=r.useCallback(d=>{c(d,s)},[c,s]),f=()=>s.isDir?`${s.name}, folder`:`${s.name}, ${s.extension} file, ${J(s.size)}, modified ${q(s.modified)}`,u=e.jsxs(E.button,{type:"button",whileHover:l?{}:{scale:1.02},whileTap:l?{}:{scale:.98},transition:{duration:l?0:.15},onClick:m,onDoubleClick:v,onKeyDown:y,"aria-label":f(),className:h("flex flex-col items-center p-3 rounded-lg w-full border border-transparent","transition-all duration-150 ease-out","hover:bg-primary-50 hover:border-primary-100 focus-visible:bg-primary-50","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation",n&&"bg-primary-100 border-primary-200"),children:[e.jsx(j,{icon:pe(s),size:40,strokeWidth:1,className:h("mb-2",s.isDir?"text-sky-500":"text-primary-500"),"aria-hidden":"true"}),e.jsx("span",{className:"text-[11px] text-center text-primary-900 font-medium truncate w-full min-w-0",children:s.name}),s.isDir?null:e.jsx("span",{className:"text-[10px] text-primary-400 mt-0.5 tabular-nums",children:J(s.size)})]});return e.jsx(me,{item:s,onOpenFile:t,children:u})}),ui=r.memo(function({item:s,isSelected:n,onClick:a,onDoubleClick:o,onKeyDown:c,onOpenFile:t,reduceMotion:l}){const m=r.useCallback(()=>{a(s)},[a,s]),v=r.useCallback(()=>{o(s)},[o,s]),y=r.useCallback(d=>{c(d,s)},[c,s]),f=()=>s.isDir?`${s.name}, folder, modified ${q(s.modified)}`:`${s.name}, ${s.extension} file, ${J(s.size)}, modified ${q(s.modified)}`,u=e.jsxs(E.button,{type:"button",whileHover:l?{}:{backgroundColor:"rgb(248 250 252)"},transition:{duration:l?0:.15},onClick:m,onDoubleClick:v,onKeyDown:y,"aria-label":f(),className:h("w-full grid grid-cols-[auto_1fr_auto_auto] gap-4 px-4 py-2.5 text-left","transition-all duration-150 ease-out","hover:bg-primary-50 focus-visible:bg-primary-50","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation",n&&"bg-primary-100"),children:[e.jsx(j,{icon:pe(s),size:18,strokeWidth:1.5,className:h("mt-0.5 shrink-0",s.isDir?"text-sky-500":"text-primary-500"),"aria-hidden":"true"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("span",{className:"text-[13px] text-primary-900 font-medium truncate block",children:s.name})}),e.jsx("div",{className:"text-xs text-primary-500 text-right w-16 tabular-nums shrink-0",children:s.isDir?"—":J(s.size)}),e.jsx("div",{className:"text-xs text-primary-500 text-right w-20 tabular-nums shrink-0",children:q(s.modified)})]});return e.jsx(me,{item:s,onOpenFile:t,children:u})}),mi=e.jsx("div",{className:"flex items-center justify-center h-full py-12",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-lg bg-primary-50 mb-3",children:e.jsx(j,{icon:ue,size:24,strokeWidth:1.5,className:"text-primary-400","aria-hidden":"true"})}),e.jsx("p",{className:"text-sm text-primary-500",children:"This folder is empty"}),e.jsx("p",{className:"text-xs text-primary-400 mt-1",children:"Upload files or create a new folder to get started"})]})});function pi({listing:i,loading:s,onOpenFile:n}){const{viewMode:a,sortBy:o,sortAsc:c,selectedFiles:t,navigateTo:l,toggleFileSelection:m}=F(),[v,y]=r.useState(0),f=r.useRef(null),u=oi(),d=li(i?.items||[],o,c),C=r.useCallback(p=>{m(p.path)},[m]),N=r.useCallback(p=>{p.isDir?l(p.path):n&&ti.has(p.extension.toLowerCase())&&n(p.path)},[l,n]),w=r.useCallback((p,x)=>{p.key==="Enter"?(p.preventDefault(),x.isDir?l(x.path):m(x.path)):p.key===" "&&(p.preventDefault(),m(x.path))},[l,m]);return r.useEffect(()=>{const p=x=>{if(d.length)switch(x.key){case"ArrowDown":x.preventDefault(),y(D=>Math.min(D+1,d.length-1));break;case"ArrowUp":x.preventDefault(),y(D=>Math.max(D-1,0));break;case"Home":x.preventDefault(),y(0);break;case"End":x.preventDefault(),y(d.length-1);break}};if(f.current)return f.current.addEventListener("keydown",p),()=>{f.current?.removeEventListener("keydown",p)}},[d.length]),s?e.jsx(ci,{viewMode:a}):i?d.length===0?mi:a==="grid"?e.jsx("div",{ref:f,className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8 gap-3 p-4 overflow-y-auto",role:"grid","aria-label":"Files grid",tabIndex:0,children:d.map((p,x)=>e.jsx("div",{role:"gridcell",children:e.jsx(di,{item:p,isSelected:t.has(p.path),onClick:C,onDoubleClick:N,onKeyDown:w,onOpenFile:n,reduceMotion:u})},p.path))}):e.jsx("div",{ref:f,className:"overflow-y-auto",role:"table","aria-label":"Files list",tabIndex:0,children:e.jsxs("div",{className:"divide-y divide-primary-100",children:[e.jsxs("div",{className:"grid grid-cols-[auto_1fr_auto_auto] gap-4 px-4 py-2 text-xs font-medium text-primary-400 uppercase tracking-wider bg-primary-50/50",role:"row",children:[e.jsx("div",{className:"w-6",role:"columnheader","aria-label":"File type"}),e.jsx("div",{role:"columnheader",children:"Name"}),e.jsx("div",{className:"w-16 text-right",role:"columnheader",children:"Size"}),e.jsx("div",{className:"w-20 text-right",role:"columnheader",children:"Modified"})]}),d.map((p,x)=>e.jsx("div",{role:"row",children:e.jsx(ui,{item:p,isSelected:t.has(p.path),onClick:C,onDoubleClick:N,onKeyDown:w,onOpenFile:n,reduceMotion:u})},p.path))]})}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("p",{className:"text-primary-500",children:"No listing available"})})}function oe(i){if(i===0)return"0 B";const s=1024,n=["B","KB","MB","GB"],a=Math.floor(Math.log(i)/Math.log(s));return parseFloat((i/Math.pow(s,a)).toFixed(1))+" "+n[a]}function fi({open:i,onOpenChange:s,currentPath:n}){const[a,o]=r.useState([]),[c,t]=r.useState(!1),[l,m]=r.useState("idle"),v=r.useRef(null),y=ii(),f=r.useCallback(()=>{o([]),m("idle"),v.current&&(v.current.value="")},[]),u=r.useCallback(g=>{if(!g)return;const S=Array.from(g).map(R=>({file:R,id:Math.random().toString(36).substr(2,9)}));o(R=>[...R,...S])},[]),d=r.useCallback(g=>{u(g.target.files)},[u]),C=r.useCallback(g=>{g.preventDefault(),t(!1),u(g.dataTransfer.files)},[u]),N=r.useCallback(g=>{g.preventDefault(),t(!0)},[]),w=r.useCallback(g=>{g.preventDefault(),t(!1)},[]),p=r.useCallback(g=>{o(S=>S.filter(R=>R.id!==g))},[]),x=r.useCallback(()=>{v.current?.click()},[]),D=r.useCallback(g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),x())},[x]),M=r.useCallback(async()=>{if(a.length===0)return;const g=new DataTransfer;a.forEach(({file:S})=>{g.items.add(S)}),m("uploading");try{await y.mutateAsync({files:g.files,path:n}),m("success"),f(),s(!1)}catch(S){m("error"),console.error("Upload failed:",S)}},[a,n,y,f,s]),X=r.useCallback(g=>{g||f(),s(g)},[f,s]),$=a.reduce((g,{file:S})=>g+S.size,0),U=a.length,Y=()=>y.isPending||l==="uploading"?"Uploading…":U===0?"Upload":U===1?"Upload 1 File":`Upload ${U} Files`;return e.jsx(Q,{open:i,onOpenChange:X,children:e.jsx(_,{className:"w-[min(500px,92vw)]",children:e.jsxs("div",{className:"p-6",children:[e.jsx(V,{className:"mb-2",children:"Upload Files"}),e.jsxs(H,{className:"mb-6",children:["Upload files to ",n==="/"?"root directory":n]}),e.jsxs("div",{onDrop:C,onDragOver:N,onDragLeave:w,onClick:x,onKeyDown:D,tabIndex:0,role:"button","aria-label":"Drop files here or click to choose files",className:h("border-2 border-dashed rounded-lg p-8 text-center cursor-pointer","transition-colors duration-150 ease-out","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation",c?"border-primary-400 bg-primary-50":"border-primary-200 hover:border-primary-300 hover:bg-primary-50"),children:[e.jsx(j,{icon:ce,size:48,strokeWidth:1,className:"mx-auto text-primary-400 mb-4","aria-hidden":"true"}),e.jsx("p",{className:"text-primary-600 font-medium mb-2",children:"Drag and drop files here"}),e.jsx("p",{className:"text-sm text-primary-500 mb-4",children:"or"}),e.jsxs(k,{variant:"outline",className:h("gap-2","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),"aria-label":"Choose files from computer",children:[e.jsx(j,{icon:ee,size:18,strokeWidth:1.5,"aria-hidden":"true"}),e.jsx("span",{children:"Choose Files"})]}),e.jsx("input",{ref:v,type:"file",multiple:!0,onChange:d,className:"hidden","aria-hidden":"true"})]}),e.jsx(A,{children:a.length>0?e.jsxs(E.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mt-6",children:[e.jsxs("h4",{className:"text-sm font-medium text-primary-900 mb-3",children:["Selected Files (",a.length,")"]}),e.jsx("div",{className:"max-h-32 overflow-y-auto border border-primary-200 rounded-lg",children:a.map(({file:g,id:S})=>e.jsxs(E.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},exit:{opacity:0,x:10},className:"flex items-center justify-between p-2 border-b border-primary-100 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(j,{icon:ee,size:16,strokeWidth:1.5,className:"text-primary-600 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"text-sm text-primary-900 truncate min-w-0",children:g.name}),e.jsx("span",{className:"text-xs text-primary-500 shrink-0 tabular-nums",children:oe(g.size)})]}),e.jsx(k,{size:"icon-sm",variant:"ghost",onClick:()=>p(S),className:h("text-primary-500 hover:text-red-600 shrink-0","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),"aria-label":`Remove ${g.name} from upload list`,children:e.jsx(j,{icon:de,size:14,strokeWidth:1.5,"aria-hidden":"true"})})]},S))}),e.jsxs("p",{className:"text-xs text-primary-600 mt-2 tabular-nums",children:["Total size: ",oe($)]})]}):null}),y.isPending||l==="uploading"?e.jsxs(E.div,{initial:{opacity:0},animate:{opacity:1},className:"mt-4 p-3 bg-primary-50 rounded-lg","aria-live":"polite",children:[e.jsx("p",{className:"text-sm text-primary-600 mb-2",children:"Uploading files…"}),e.jsx("div",{className:"bg-primary-200 rounded-full h-2",role:"progressbar","aria-label":"Upload progress",children:e.jsx("div",{className:"bg-primary-600 h-2 rounded-full w-1/2 animate-pulse"})})]}):null,l==="success"?e.jsx("div",{className:"mt-4 p-3 bg-green-50 rounded-lg","aria-live":"polite",children:e.jsx("p",{className:"text-sm text-green-700",children:"Files uploaded successfully!"})}):null,l==="error"?e.jsx("div",{className:"mt-4 p-3 bg-red-50 rounded-lg","aria-live":"polite",children:e.jsx("p",{className:"text-sm text-red-700",children:"Upload failed. Please try again."})}):null,e.jsxs("div",{className:"flex justify-end gap-2 mt-6",children:[e.jsx(G,{disabled:y.isPending||l==="uploading",className:h("focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),children:"Cancel"}),e.jsx(k,{onClick:M,disabled:a.length===0||y.isPending||l==="uploading",className:h("focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),children:Y()})]})]})})})}function hi({open:i,onOpenChange:s,currentPath:n}){const[a,o]=r.useState(""),[c,t]=r.useState(""),l=ni(),m=r.useCallback(async()=>{if(a.trim()){t("");try{await l.mutateAsync({path:n,name:a.trim()}),o(""),s(!1)}catch(p){const x=p instanceof Error?p.message:"Failed to create folder";t(x),console.error("Create folder failed:",p)}}},[a,n,l,s]),v=r.useCallback(p=>{p||(o(""),t("")),s(p)},[s]),y=r.useCallback(p=>{p.key==="Enter"&&(p.preventDefault(),m())},[m]),f=r.useCallback(p=>{const x=p.target.value;o(x),c&&t("")},[c]),u=a.trim().length>0&&!/[<>:"/\\|?*]/.test(a)&&!a.includes(".."),d=()=>l.isPending?"Creating…":"Create Folder",N=a.trim()?a.includes("..")?'Folder name cannot contain ".."':/[<>:"/\\|?*]/.test(a)?'Invalid characters: < > : " / \\ | ? *':"":"",w=c||N;return e.jsx(Q,{open:i,onOpenChange:v,children:e.jsx(_,{children:e.jsxs("div",{className:"p-6",children:[e.jsx(V,{className:"mb-2",children:"Create New Folder"}),e.jsxs(H,{className:"mb-4",children:["Create a new folder in ",n==="/"?"root directory":n]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{htmlFor:"folder-name",className:"block text-sm font-medium text-primary-900 mb-2",children:"Folder Name"}),e.jsx("input",{id:"folder-name",type:"text",value:a,onChange:f,onKeyDown:y,placeholder:"Enter folder name",autoComplete:"off",spellCheck:!1,autoFocus:!0,"aria-describedby":w?"folder-name-error":void 0,"aria-invalid":w?"true":"false",className:h("w-full px-3 py-2 border rounded-lg","transition-colors duration-150 ease-out","focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation",w?"border-red-300 focus-visible:ring-red-300":"border-primary-200 focus:border-primary-300")}),w?e.jsx("p",{id:"folder-name-error",className:"text-sm text-red-600 mt-1",role:"alert","aria-live":"polite",children:c||N}):null]}),l.isPending?e.jsx("div",{className:"mb-4 p-3 bg-primary-50 rounded-lg","aria-live":"polite",children:e.jsx("p",{className:"text-sm text-primary-600",children:"Creating folder…"})}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(G,{disabled:l.isPending,className:h("focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation"),children:"Cancel"}),e.jsx(k,{onClick:m,disabled:!u||l.isPending,className:h("focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none","touch-manipulation",(!u||l.isPending)&&"opacity-50 cursor-not-allowed"),"aria-describedby":u?void 0:"create-button-help",children:d()})]}),!u&&a.length>0?e.jsx("p",{id:"create-button-help",className:"text-xs text-primary-500 mt-2",children:"Please enter a valid folder name"}):null]})})})}const xi={js:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",py:"Python",json:"JSON",yaml:"YAML",yml:"YAML",md:"Markdown",html:"HTML",css:"CSS",scss:"SCSS",sh:"Shell",bash:"Bash",sql:"SQL",xml:"XML",toml:"TOML",ini:"INI",conf:"Config",cfg:"Config",env:"Env",txt:"Text",log:"Log",csv:"CSV",go:"Go",rs:"Rust",rb:"Ruby",php:"PHP",java:"Java",c:"C",cpp:"C++",h:"Header",dockerfile:"Dockerfile",makefile:"Makefile",graphql:"GraphQL",svelte:"Svelte",vue:"Vue"};function gi({filePath:i,onClose:s}){const n=Xe(i),a=Ye(),o=r.useRef(null),[c,t]=r.useState(null),[l,m]=r.useState(!1);r.useEffect(()=>{n.data&&c===null&&t(n.data.content)},[n.data,c]);const v=r.useMemo(()=>n.data?xi[n.data.extension.toLowerCase()]||n.data.extension.toUpperCase():"",[n.data]),y=r.useCallback(N=>{t(N.target.value),m(N.target.value!==n.data?.content)},[n.data]),f=r.useCallback(async()=>{if(c!==null)try{await a.mutateAsync({path:i,content:c}),m(!1)}catch{}},[i,c,a]),u=r.useCallback(()=>{l&&!window.confirm("You have unsaved changes. Discard them?")||s()},[l,s]);r.useEffect(()=>{const N=w=>{(w.ctrlKey||w.metaKey)&&w.key==="s"&&(w.preventDefault(),l&&f()),w.key==="Escape"&&u()};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[f,u,l]);const d=r.useCallback(N=>{if(N.key==="Tab"){N.preventDefault();const w=N.currentTarget,p=w.selectionStart,x=w.selectionEnd,D=w.value,M=D.substring(0,p)+" "+D.substring(x);t(M),m(M!==n.data?.content),requestAnimationFrame(()=>{w.selectionStart=w.selectionEnd=p+2})}},[n.data]),C=i.split("/").pop()||i;return e.jsxs("div",{className:"fixed inset-0 z-50 bg-surface flex flex-col",children:[e.jsxs("header",{className:"flex items-center justify-between px-4 py-2 border-b border-primary-200 bg-primary-50",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("h2",{className:"text-sm font-semibold text-primary-900 truncate",children:C}),v?e.jsx("span",{className:"text-xs text-primary-500 bg-primary-100 px-2 py-0.5 rounded-full shrink-0",children:v}):null,l?e.jsx("span",{className:"text-xs text-amber-600 bg-amber-50 px-2 py-0.5 rounded-full shrink-0",children:"Unsaved"}):null,a.isError?e.jsx("span",{className:"text-xs text-red-600",children:a.error.message}):null]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(k,{size:"sm",variant:"default",onClick:f,disabled:!l||a.isPending,className:h((!l||a.isPending)&&"opacity-50 cursor-not-allowed"),children:[e.jsx(j,{icon:Ue,size:16,strokeWidth:1.5,"aria-hidden":"true"}),a.isPending?"Saving…":"Save"]}),e.jsx(k,{size:"icon-sm",variant:"ghost",onClick:u,"aria-label":"Close editor",children:e.jsx(j,{icon:Ie,size:20,strokeWidth:1.5,"aria-hidden":"true"})})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:n.isLoading?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("p",{className:"text-primary-500 text-sm",children:"Loading file…"})}):n.isError?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-red-600 text-sm mb-2",children:n.error instanceof Error?n.error.message:"Failed to load file"}),e.jsx(k,{size:"sm",variant:"secondary",onClick:()=>{n.refetch()},children:"Retry"})]})}):e.jsx("textarea",{ref:o,value:c??"",onChange:y,onKeyDown:d,spellCheck:!1,autoFocus:!0,className:h("w-full h-full p-4 resize-none","bg-primary-950 text-primary-100","font-mono text-sm leading-relaxed","focus:outline-none","selection:bg-blue-800/50")})}),n.data?e.jsxs("footer",{className:"flex items-center justify-between px-4 py-1 border-t border-primary-200 bg-primary-50 text-xs text-primary-500",children:[e.jsx("span",{children:i}),e.jsx("span",{children:bi(n.data.size)})]}):null]})}function bi(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function Fi(){const i=L(),{currentPath:s,editingFile:n}=F(),[a,o]=r.useState(!1),[c,t]=r.useState(!1),l=Ze(s),v=ie({queryKey:Pe,queryFn:function(){return te(i)},initialData:function(){return te(i)},staleTime:1/0}).data?.isSidebarCollapsed??!1,y=r.useCallback(()=>{Ae(i,function(x){return{...x,isSidebarCollapsed:!x.isSidebarCollapsed}})},[i]),f=r.useCallback(()=>{o(!0)},[]),u=r.useCallback(()=>{t(!0)},[]),d=r.useCallback(p=>{F.getState().openInEditor(p)},[]),C=r.useCallback(()=>{F.getState().closeEditor()},[]),N=r.useMemo(()=>({display:"flex",flexDirection:"column",height:"100%",minHeight:0}),[]),w=e.jsx(He,{isCollapsed:v,onToggleCollapse:y,onSelectAction:()=>{}});return e.jsxs("div",{className:"h-screen bg-surface text-primary-900",children:[e.jsxs("div",{className:h("h-full overflow-hidden grid grid-cols-[auto_1fr]"),children:[w,e.jsxs("main",{"aria-label":"File explorer",style:N,children:[e.jsxs("header",{className:"border-b border-primary-100 px-4 py-3",children:[e.jsx("div",{className:"flex items-center justify-between mb-3",children:e.jsx(Ge,{path:s})}),e.jsx(Je,{onUpload:f,onCreateFolder:u})]}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-auto",children:[e.jsx(pi,{listing:l.data,loading:l.isLoading,onOpenFile:d}),l.isError?e.jsxs("div",{className:"p-4 text-center","aria-live":"polite",children:[e.jsx("p",{className:"text-red-600 text-sm",children:l.error instanceof Error?l.error.message:"Failed to load files"}),e.jsx("button",{onClick:()=>{l.refetch()},className:"mt-2 text-sm text-primary-600 hover:text-primary-900 underline focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:outline-none rounded-sm",children:"Retry"})]}):null]}),e.jsx(fi,{open:a,onOpenChange:o,currentPath:s}),e.jsx(hi,{open:c,onOpenChange:t,currentPath:s})]})]}),n?e.jsx(gi,{filePath:n,onClose:C}):null]})}export{Fi as FileExplorerScreen};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/file-explorer-screen-8t6M4Xco.js","assets/main-mIHr_ble.js","assets/visuallyHidden-CqGRL_Oq.js","assets/button-BaHefIXU.js","assets/tooltip-w9D-e_R-.js","assets/DirectionContext-DXnZc0zz.js","assets/useButton-DsMdJPGn.js","assets/use-file-explorer-state-CLaDuI9X.js","assets/useCompositeItem-CaYygSfB.js","assets/react-Cfq4ot0g.js","assets/useMutation-fJnleJAb.js"])))=>i.map(i=>d[i]);
2
+ import{j as e,r,_ as s}from"./main-mIHr_ble.js";const n=r.lazy(()=>s(()=>import("./file-explorer-screen-8t6M4Xco.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(t=>({default:t.FileExplorerScreen})));function o(){return e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"flex h-screen items-center justify-center text-primary-500 text-sm",children:"Loading…"}),children:e.jsx(n,{})})}export{o as component};
@@ -0,0 +1 @@
1
+ const e=Object.freeze(JSON.parse(`{"displayName":"Go","name":"go","patterns":[{"include":"#statements"}],"repository":{"after_control_variables":{"captures":{"1":{"patterns":[{"include":"#type-declarations-without-brackets"},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\w+","name":"variable.other.go"}]}},"match":"(?<=\\\\brange\\\\b|;|\\\\bif\\\\b|\\\\bfor\\\\b|[<>]|<=|>=|==|!=|\\\\w[-%*+/]|\\\\w[-%*+/]=|\\\\|\\\\||&&)\\\\s*((?![]\\\\[]+)[-\\\\]!%*+./:<=>\\\\[_[:alnum:]]+)\\\\s*(?=\\\\{)"},"brackets":{"patterns":[{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.begin.bracket.curly.go"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.curly.go"}},"patterns":[{"include":"$self"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"include":"$self"}]},{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.begin.bracket.square.go"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.square.go"}},"patterns":[{"include":"$self"}]}]},"built_in_functions":{"patterns":[{"match":"\\\\b(append|cap|close|complex|copy|delete|imag|len|panic|print|println|real|recover|min|max|clear)\\\\b(?=\\\\()","name":"entity.name.function.support.builtin.go"},{"begin":"\\\\b(new)\\\\b(\\\\()","beginCaptures":{"1":{"name":"entity.name.function.support.builtin.go"},"2":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"include":"#functions"},{"include":"#struct_variables_types"},{"include":"#type-declarations"},{"include":"#generic_types"},{"match":"\\\\w+","name":"entity.name.type.go"},{"include":"$self"}]},{"begin":"\\\\b(make)\\\\b(\\\\()((?:(?:[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+(?:\\\\([^)]+\\\\))?)?[]*\\\\[]+{0,1}(?:(?!\\\\bmap\\\\b)[.\\\\w]+)?(\\\\[(?:\\\\S+(?:,\\\\s*\\\\S+)*)?])?,?)?","beginCaptures":{"1":{"name":"entity.name.function.support.builtin.go"},"2":{"name":"punctuation.definition.begin.bracket.round.go"},"3":{"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#parameter-variable-types"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"include":"$self"}]}]},"comments":{"patterns":[{"begin":"(/\\\\*)","beginCaptures":{"1":{"name":"punctuation.definition.comment.go"}},"end":"(\\\\*/)","endCaptures":{"1":{"name":"punctuation.definition.comment.go"}},"name":"comment.block.go"},{"begin":"(//)","beginCaptures":{"1":{"name":"punctuation.definition.comment.go"}},"end":"\\\\n|$","name":"comment.line.double-slash.go"}]},"const_assignment":{"patterns":[{"captures":{"1":{"patterns":[{"include":"#delimiters"},{"match":"\\\\w+","name":"variable.other.constant.go"}]},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#generic_types"},{"match":"\\\\(","name":"punctuation.definition.begin.bracket.round.go"},{"match":"\\\\)","name":"punctuation.definition.end.bracket.round.go"},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"(?<=\\\\bconst\\\\b)\\\\s*\\\\b([.\\\\w]+(?:,\\\\s*[.\\\\w]+)*)\\\\s*((?:(?:[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+(?:\\\\([^)]+\\\\))?)?(?![]*\\\\[]+{0,1}\\\\b(?:struct|func|map)\\\\b)(?:[]*.\\\\[\\\\w]+(?:,\\\\s*[]*.\\\\[\\\\w]+)*)?\\\\s*=?)?"},{"begin":"(?<=\\\\bconst\\\\b)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"captures":{"1":{"patterns":[{"include":"#delimiters"},{"match":"\\\\w+","name":"variable.other.constant.go"}]},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#generic_types"},{"match":"\\\\(","name":"punctuation.definition.begin.bracket.round.go"},{"match":"\\\\)","name":"punctuation.definition.end.bracket.round.go"},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"^\\\\s*\\\\b([.\\\\w]+(?:,\\\\s*[.\\\\w]+)*)\\\\s*((?:(?:[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+(?:\\\\([^)]+\\\\))?)?(?![]*\\\\[]+{0,1}\\\\b(?:struct|func|map)\\\\b)(?:[]*.\\\\[\\\\w]+(?:,\\\\s*[]*.\\\\[\\\\w]+)*)?\\\\s*=?)?"},{"include":"$self"}]}]},"delimiters":{"patterns":[{"match":",","name":"punctuation.other.comma.go"},{"match":"\\\\.(?!\\\\.\\\\.)","name":"punctuation.other.period.go"},{"match":":(?!=)","name":"punctuation.other.colon.go"}]},"double_parentheses_types":{"captures":{"1":{"patterns":[{"include":"#type-declarations-without-brackets"},{"match":"\\\\(","name":"punctuation.definition.begin.bracket.round.go"},{"match":"\\\\)","name":"punctuation.definition.end.bracket.round.go"},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\{","name":"punctuation.definition.begin.bracket.curly.go"},{"match":"}","name":"punctuation.definition.end.bracket.curly.go"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"(?<!\\\\w)(\\\\([]*\\\\[]+{0,1}[.\\\\w]+(?:\\\\[(?:[]*.\\\\[{}\\\\w]+(?:,\\\\s*[]*.\\\\[{}\\\\w]+)*)?])?\\\\))(?=\\\\()"},"function_declaration":{"begin":"^\\\\b(func)\\\\b\\\\s*(\\\\([^)]+\\\\)\\\\s*)?(?:(\\\\w+)(?=[(\\\\[]))?","beginCaptures":{"1":{"name":"keyword.function.go"},"2":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"captures":{"1":{"name":"variable.parameter.go"},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#parameter-variable-types"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"(\\\\w+\\\\s+)?([*.\\\\w]+(?:\\\\[(?:[*.\\\\w]+(?:,\\\\s+)?)+{0,1}])?)"},{"include":"$self"}]}]},"3":{"patterns":[{"match":"\\\\d\\\\w*","name":"invalid.illegal.identifier.go"},{"match":"\\\\w+","name":"entity.name.function.go"}]}},"end":"(?<=\\\\))\\\\s*((?:[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}(?![]*\\\\[]+{0,1}\\\\b(?:struct|interface)\\\\b)[-\\\\]*.\\\\[\\\\w]+)?\\\\s*(?=\\\\{)","endCaptures":{"1":{"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#parameter-variable-types"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"include":"#function_param_types"}]},{"begin":"([*.\\\\w]+)?(\\\\[)","beginCaptures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]},"2":{"name":"punctuation.definition.begin.bracket.square.go"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.square.go"}},"patterns":[{"include":"#generic_param_types"}]},{"captures":{"1":{"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#parameter-variable-types"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"(?<=\\\\))\\\\s*((?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}[-\\\\]*.<>\\\\[\\\\w]+\\\\s*(?:/[*/].*)?)$"},{"include":"$self"}]},"function_param_types":{"patterns":[{"include":"#struct_variables_types"},{"include":"#interface_variables_types"},{"include":"#type-declarations-without-brackets"},{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.parameter.go"}]}},"match":"((?:\\\\b\\\\w+,\\\\s*)+{0,1}\\\\b\\\\w+)\\\\s+(?=(?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}[]*\\\\[]+{0,1}\\\\b(?:struct|interface)\\\\b\\\\s*\\\\{)"},{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.parameter.go"}]}},"match":"(?:(?<=\\\\()|^\\\\s*)((?:\\\\b\\\\w+,\\\\s*)+(?:/[*/].*)?)$"},{"captures":{"1":{"patterns":[{"include":"#delimiters"},{"match":"\\\\w+","name":"variable.parameter.go"}]},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#parameter-variable-types"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"((?:\\\\b\\\\w+,\\\\s*)+{0,1}\\\\b\\\\w+)\\\\s+((?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}(?:[]*.\\\\[\\\\w]+{0,1}(?:\\\\bfunc\\\\b\\\\([^)]+{0,1}\\\\)(?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}\\\\s*)+(?:[]*.\\\\[\\\\w]+|\\\\([^)]+{0,1}\\\\))?|(?:[]*\\\\[]+{0,1}[*.\\\\w]+(?:\\\\[[^]]+])?[*.\\\\w]+{0,1})+))"},{"begin":"([*.\\\\w]+)?(\\\\[)","beginCaptures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]},"2":{"name":"punctuation.definition.begin.bracket.square.go"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.square.go"}},"patterns":[{"include":"#generic_param_types"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"include":"#function_param_types"}]},{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"([.\\\\w]+)"},{"include":"$self"}]},"functions":{"begin":"\\\\b(func)\\\\b(?=\\\\()","beginCaptures":{"1":{"name":"keyword.function.go"}},"end":"(?<=\\\\))(\\\\s*(?:[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+)?(\\\\s*(?:[]*\\\\[]+{0,1}[*.\\\\w]+)?(?:\\\\[(?:[*.\\\\w]+{0,1}(?:\\\\[[^]]+{0,1}])?(?:,\\\\s+)?)+]|\\\\([^)]+{0,1}\\\\))?[*.\\\\w]+{0,1}\\\\s*(?=\\\\{)|\\\\s*(?:[]*\\\\[]+{0,1}(?!\\\\bfunc\\\\b)[*.\\\\w]+(?:\\\\[(?:[*.\\\\w]+{0,1}(?:\\\\[[^]]+{0,1}])?(?:,\\\\s+)?)+])?[*.\\\\w]+{0,1}|\\\\([^)]+{0,1}\\\\)))?","endCaptures":{"1":{"patterns":[{"include":"#type-declarations"}]},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#parameter-variable-types"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"patterns":[{"include":"#parameter-variable-types"}]},"functions_inline":{"captures":{"1":{"name":"keyword.function.go"},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"include":"#function_param_types"},{"include":"$self"}]},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\{","name":"punctuation.definition.begin.bracket.curly.go"},{"match":"}","name":"punctuation.definition.end.bracket.curly.go"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"\\\\b(func)\\\\b(\\\\([^/]*?\\\\)\\\\s+\\\\([^/]*?\\\\))\\\\s+(?=\\\\{)"},"generic_param_types":{"patterns":[{"include":"#struct_variables_types"},{"include":"#interface_variables_types"},{"include":"#type-declarations-without-brackets"},{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.parameter.go"}]}},"match":"((?:\\\\b\\\\w+,\\\\s*)+{0,1}\\\\b\\\\w+)\\\\s+(?=(?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}[]*\\\\[]+{0,1}\\\\b(?:struct|interface)\\\\b\\\\s*\\\\{)"},{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.parameter.go"}]}},"match":"(?:(?<=\\\\()|^\\\\s*)((?:\\\\b\\\\w+,\\\\s*)+(?:/[*/].*)?)$"},{"captures":{"1":{"patterns":[{"include":"#delimiters"},{"match":"\\\\w+","name":"variable.parameter.go"}]},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#parameter-variable-types"},{"match":"\\\\w+","name":"entity.name.type.go"}]},"3":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"((?:\\\\b\\\\w+,\\\\s*)+{0,1}\\\\b\\\\w+)\\\\s+((?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}(?:[]*.\\\\[\\\\w]+{0,1}(?:\\\\bfunc\\\\b\\\\([^)]+{0,1}\\\\)(?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}\\\\s*)+(?:[*.\\\\w]+|\\\\([^)]+{0,1}\\\\))?|(?:(?:[*.~\\\\w]+|\\\\[(?:[*.\\\\w]+{0,1}(?:\\\\[[^]]+{0,1}])?(?:,\\\\s+)?)+])[*.\\\\w]+{0,1})+))"},{"begin":"([*.\\\\w]+)?(\\\\[)","beginCaptures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]},"2":{"name":"punctuation.definition.begin.bracket.square.go"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.square.go"}},"patterns":[{"include":"#generic_param_types"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"include":"#function_param_types"}]},{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"\\\\b([.\\\\w]+)"},{"include":"$self"}]},"generic_types":{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]},"2":{"patterns":[{"include":"#parameter-variable-types"}]}},"match":"([*.\\\\w]+)(\\\\[[^]]+{0,1}])"},"group-functions":{"patterns":[{"include":"#function_declaration"},{"include":"#functions_inline"},{"include":"#functions"},{"include":"#built_in_functions"},{"include":"#support_functions"}]},"group-types":{"patterns":[{"include":"#other_struct_interface_expressions"},{"include":"#type_assertion_inline"},{"include":"#struct_variables_types"},{"include":"#interface_variables_types"},{"include":"#single_type"},{"include":"#multi_types"},{"include":"#struct_interface_declaration"},{"include":"#double_parentheses_types"},{"include":"#switch_types"},{"include":"#type-declarations"}]},"group-variables":{"patterns":[{"include":"#const_assignment"},{"include":"#var_assignment"},{"include":"#variable_assignment"},{"include":"#label_loop_variables"},{"include":"#slice_index_variables"},{"include":"#property_variables"},{"include":"#switch_variables"},{"include":"#other_variables"}]},"hover":{"patterns":[{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.other.property.go"}]},"2":{"patterns":[{"match":"\\\\binvalid\\\\b\\\\s+\\\\btype\\\\b","name":"invalid.field.go"},{"include":"#type-declarations-without-brackets"},{"include":"#parameter-variable-types"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"(?<=^\\\\bfield\\\\b)\\\\s+([*.\\\\w]+)\\\\s+([\\\\s\\\\S]+)"},{"captures":{"1":{"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#parameter-variable-types"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"(?<=^\\\\breturns\\\\b)\\\\s+([\\\\s\\\\S]+)"}]},"import":{"patterns":[{"begin":"\\\\b(import)\\\\s+","beginCaptures":{"1":{"name":"keyword.control.import.go"}},"end":"(?!\\\\G)","patterns":[{"include":"#imports"}]}]},"imports":{"patterns":[{"captures":{"1":{"patterns":[{"include":"#delimiters"},{"match":"\\\\w+","name":"variable.other.import.go"}]},"2":{"name":"string.quoted.double.go"},"3":{"name":"punctuation.definition.string.begin.go"},"4":{"name":"entity.name.import.go"},"5":{"name":"punctuation.definition.string.end.go"}},"match":"(\\\\s*[.\\\\w]+)?\\\\s*((\\")([^\\"]*)(\\"))"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.imports.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.imports.end.bracket.round.go"}},"patterns":[{"include":"#comments"},{"include":"#imports"}]},{"include":"$self"}]},"interface_variables_types":{"begin":"\\\\b(interface)\\\\b\\\\s*(\\\\{)","beginCaptures":{"1":{"name":"keyword.interface.go"},"2":{"name":"punctuation.definition.begin.bracket.curly.go"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.curly.go"}},"patterns":[{"include":"#interface_variables_types_field"},{"include":"$self"}]},"interface_variables_types_field":{"patterns":[{"include":"#support_functions"},{"include":"#type-declarations-without-brackets"},{"begin":"([*.\\\\w]+)?(\\\\[)","beginCaptures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]},"2":{"name":"punctuation.definition.begin.bracket.square.go"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.square.go"}},"patterns":[{"include":"#generic_param_types"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"include":"#function_param_types"}]},{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"([.\\\\w]+)"}]},"keywords":{"patterns":[{"match":"\\\\b(break|case|continue|default|defer|else|fallthrough|for|go|goto|if|range|return|select|switch)\\\\b","name":"keyword.control.go"},{"match":"\\\\bchan\\\\b","name":"keyword.channel.go"},{"match":"\\\\bconst\\\\b","name":"keyword.const.go"},{"match":"\\\\bvar\\\\b","name":"keyword.var.go"},{"match":"\\\\bfunc\\\\b","name":"keyword.function.go"},{"match":"\\\\binterface\\\\b","name":"keyword.interface.go"},{"match":"\\\\bmap\\\\b","name":"keyword.map.go"},{"match":"\\\\bstruct\\\\b","name":"keyword.struct.go"},{"match":"\\\\bimport\\\\b","name":"keyword.control.import.go"},{"match":"\\\\btype\\\\b","name":"keyword.type.go"}]},"label_loop_variables":{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.other.label.go"}]}},"match":"^(\\\\s*\\\\w+:\\\\s*|\\\\s*\\\\b(?:break|goto|continue)\\\\b\\\\s+\\\\w+(?:\\\\s*/[*/]\\\\s*.*)?)$"},"language_constants":{"captures":{"1":{"name":"constant.language.boolean.go"},"2":{"name":"constant.language.null.go"},"3":{"name":"constant.language.iota.go"}},"match":"\\\\b(?:(true|false)|(nil)|(iota))\\\\b"},"map_types":{"begin":"\\\\b(map)\\\\b(\\\\[)","beginCaptures":{"1":{"name":"keyword.map.go"},"2":{"name":"punctuation.definition.begin.bracket.square.go"}},"end":"(])((?:[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}(?![]*\\\\[]+{0,1}\\\\b(?:func|struct|map)\\\\b)[]*\\\\[]+{0,1}[.\\\\w]+(?:\\\\[(?:[]*.\\\\[{}\\\\w]+(?:,\\\\s*[]*.\\\\[{}\\\\w]+)*)?])?)?","endCaptures":{"1":{"name":"punctuation.definition.end.bracket.square.go"},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#parameter-variable-types"},{"include":"#functions"},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\{","name":"punctuation.definition.begin.bracket.curly.go"},{"match":"}","name":"punctuation.definition.end.bracket.curly.go"},{"match":"\\\\(","name":"punctuation.definition.begin.bracket.round.go"},{"match":"\\\\)","name":"punctuation.definition.end.bracket.round.go"},{"match":"\\\\w+","name":"entity.name.type.go"}]},"multi_types":{"begin":"\\\\b(type)\\\\b\\\\s*(\\\\()","beginCaptures":{"1":{"name":"keyword.type.go"},"2":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"include":"#struct_variables_types"},{"include":"#interface_variables_types"},{"include":"#type-declarations-without-brackets"},{"include":"#parameter-variable-types"},{"match":"\\\\w+","name":"entity.name.type.go"}]},"numeric_literals":{"captures":{"0":{"patterns":[{"begin":"(?=.)","end":"\\\\n|$","patterns":[{"captures":{"1":{"name":"constant.numeric.decimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"2":{"name":"punctuation.separator.constant.numeric.go"},"3":{"name":"constant.numeric.decimal.point.go"},"4":{"name":"constant.numeric.decimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"5":{"name":"punctuation.separator.constant.numeric.go"},"6":{"name":"keyword.other.unit.exponent.decimal.go"},"7":{"name":"keyword.operator.plus.exponent.decimal.go"},"8":{"name":"keyword.operator.minus.exponent.decimal.go"},"9":{"name":"constant.numeric.exponent.decimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"10":{"name":"keyword.other.unit.imaginary.go"},"11":{"name":"constant.numeric.decimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"12":{"name":"punctuation.separator.constant.numeric.go"},"13":{"name":"keyword.other.unit.exponent.decimal.go"},"14":{"name":"keyword.operator.plus.exponent.decimal.go"},"15":{"name":"keyword.operator.minus.exponent.decimal.go"},"16":{"name":"constant.numeric.exponent.decimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"17":{"name":"keyword.other.unit.imaginary.go"},"18":{"name":"constant.numeric.decimal.point.go"},"19":{"name":"constant.numeric.decimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"20":{"name":"punctuation.separator.constant.numeric.go"},"21":{"name":"keyword.other.unit.exponent.decimal.go"},"22":{"name":"keyword.operator.plus.exponent.decimal.go"},"23":{"name":"keyword.operator.minus.exponent.decimal.go"},"24":{"name":"constant.numeric.exponent.decimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"25":{"name":"keyword.other.unit.imaginary.go"},"26":{"name":"keyword.other.unit.hexadecimal.go"},"27":{"name":"constant.numeric.hexadecimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"28":{"name":"punctuation.separator.constant.numeric.go"},"29":{"name":"constant.numeric.hexadecimal.go"},"30":{"name":"constant.numeric.hexadecimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"31":{"name":"punctuation.separator.constant.numeric.go"},"32":{"name":"keyword.other.unit.exponent.hexadecimal.go"},"33":{"name":"keyword.operator.plus.exponent.hexadecimal.go"},"34":{"name":"keyword.operator.minus.exponent.hexadecimal.go"},"35":{"name":"constant.numeric.exponent.hexadecimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"36":{"name":"keyword.other.unit.imaginary.go"},"37":{"name":"keyword.other.unit.hexadecimal.go"},"38":{"name":"constant.numeric.hexadecimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"39":{"name":"punctuation.separator.constant.numeric.go"},"40":{"name":"keyword.other.unit.exponent.hexadecimal.go"},"41":{"name":"keyword.operator.plus.exponent.hexadecimal.go"},"42":{"name":"keyword.operator.minus.exponent.hexadecimal.go"},"43":{"name":"constant.numeric.exponent.hexadecimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"44":{"name":"keyword.other.unit.imaginary.go"},"45":{"name":"keyword.other.unit.hexadecimal.go"},"46":{"name":"constant.numeric.hexadecimal.go"},"47":{"name":"constant.numeric.hexadecimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"48":{"name":"punctuation.separator.constant.numeric.go"},"49":{"name":"keyword.other.unit.exponent.hexadecimal.go"},"50":{"name":"keyword.operator.plus.exponent.hexadecimal.go"},"51":{"name":"keyword.operator.minus.exponent.hexadecimal.go"},"52":{"name":"constant.numeric.exponent.hexadecimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"53":{"name":"keyword.other.unit.imaginary.go"}},"match":"\\\\G(?:(?:(?:(?:(?:(?=[.0-9])(?!0[BOXbox])([0-9](?:[0-9]|((?<=\\\\h)_(?=\\\\h)))*)((?<=[0-9])\\\\.|\\\\.(?=[0-9]))([0-9](?:[0-9]|((?<=\\\\h)_(?=\\\\h)))*)?(?:(?<!_)([Ee])(\\\\+?)(-?)([0-9](?:[0-9]|(?<=\\\\h)_(?=\\\\h))*))?(i(?!\\\\w))?(?:\\\\n|$)|(?=[.0-9])(?!0[BOXbox])([0-9](?:[0-9]|((?<=\\\\h)_(?=\\\\h)))*)(?<!_)([Ee])(\\\\+?)(-?)([0-9](?:[0-9]|(?<=\\\\h)_(?=\\\\h))*)(i(?!\\\\w))?(?:\\\\n|$))|((?<=[0-9])\\\\.|\\\\.(?=[0-9]))([0-9](?:[0-9]|((?<=\\\\h)_(?=\\\\h)))*)(?:(?<!_)([Ee])(\\\\+?)(-?)([0-9](?:[0-9]|(?<=\\\\h)_(?=\\\\h))*))?(i(?!\\\\w))?(?:\\\\n|$))|(0[Xx])_?(\\\\h(?:\\\\h|((?<=\\\\h)_(?=\\\\h)))*)((?<=\\\\h)\\\\.|\\\\.(?=\\\\h))(\\\\h(?:\\\\h|((?<=\\\\h)_(?=\\\\h)))*)?(?<!_)([Pp])(\\\\+?)(-?)([0-9](?:[0-9]|(?<=\\\\h)_(?=\\\\h))*)(i(?!\\\\w))?(?:\\\\n|$))|(0[Xx])_?(\\\\h(?:\\\\h|((?<=\\\\h)_(?=\\\\h)))*)(?<!_)([Pp])(\\\\+?)(-?)([0-9](?:[0-9]|(?<=\\\\h)_(?=\\\\h))*)(i(?!\\\\w))?(?:\\\\n|$))|(0[Xx])((?<=\\\\h)\\\\.|\\\\.(?=\\\\h))(\\\\h(?:\\\\h|((?<=\\\\h)_(?=\\\\h)))*)(?<!_)([Pp])(\\\\+?)(-?)([0-9](?:[0-9]|(?<=\\\\h)_(?=\\\\h))*)(i(?!\\\\w))?(?:\\\\n|$))"},{"captures":{"1":{"name":"constant.numeric.decimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"2":{"name":"punctuation.separator.constant.numeric.go"},"3":{"name":"keyword.other.unit.imaginary.go"},"4":{"name":"keyword.other.unit.binary.go"},"5":{"name":"constant.numeric.binary.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"6":{"name":"punctuation.separator.constant.numeric.go"},"7":{"name":"keyword.other.unit.imaginary.go"},"8":{"name":"keyword.other.unit.octal.go"},"9":{"name":"constant.numeric.octal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"10":{"name":"punctuation.separator.constant.numeric.go"},"11":{"name":"keyword.other.unit.imaginary.go"},"12":{"name":"keyword.other.unit.hexadecimal.go"},"13":{"name":"constant.numeric.hexadecimal.go","patterns":[{"match":"(?<=\\\\h)_(?=\\\\h)","name":"punctuation.separator.constant.numeric.go"}]},"14":{"name":"punctuation.separator.constant.numeric.go"},"15":{"name":"keyword.other.unit.imaginary.go"}},"match":"\\\\G(?:(?:(?:(?=[.0-9])(?!0[BOXbox])([0-9](?:[0-9]|((?<=\\\\h)_(?=\\\\h)))*)(i(?!\\\\w))?(?:\\\\n|$)|(0[Bb])_?([01](?:[01]|((?<=\\\\h)_(?=\\\\h)))*)(i(?!\\\\w))?(?:\\\\n|$))|(0[Oo]?)_?((?:[0-7]|((?<=\\\\h)_(?=\\\\h)))+)(i(?!\\\\w))?(?:\\\\n|$))|(0[Xx])_?(\\\\h(?:\\\\h|((?<=\\\\h)_(?=\\\\h)))*)(i(?!\\\\w))?(?:\\\\n|$))"},{"match":"(?:[.0-9A-Z_a-z]|(?<=[EPep])[-+])+","name":"invalid.illegal.constant.numeric.go"}]}]}},"match":"(?<!\\\\w)\\\\.?\\\\d(?:[.0-9A-Z_a-z]|(?<=[EPep])[-+])*"},"operators":{"patterns":[{"match":"(?<!\\\\w)[\\\\&*]+(?!\\\\d)(?=[]\\\\[\\\\w]|<-)","name":"keyword.operator.address.go"},{"match":"<-","name":"keyword.operator.channel.go"},{"match":"--","name":"keyword.operator.decrement.go"},{"match":"\\\\+\\\\+","name":"keyword.operator.increment.go"},{"match":"(==|!=|<=|>=|<(?!<)|>(?!>))","name":"keyword.operator.comparison.go"},{"match":"(&&|\\\\|\\\\||!)","name":"keyword.operator.logical.go"},{"match":"((?:|[-%*+/:^|]|<<|>>|&\\\\^?)=)","name":"keyword.operator.assignment.go"},{"match":"([-%*+/])","name":"keyword.operator.arithmetic.go"},{"match":"(&(?!\\\\^)|[\\\\^|]|&\\\\^|<<|>>|~)","name":"keyword.operator.arithmetic.bitwise.go"},{"match":"\\\\.\\\\.\\\\.","name":"keyword.operator.ellipsis.go"}]},"other_struct_interface_expressions":{"patterns":[{"include":"#after_control_variables"},{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\{","name":"punctuation.definition.begin.bracket.curly.go"},{"match":"}","name":"punctuation.definition.end.bracket.curly.go"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"\\\\b(?!(?:struct|interface)\\\\b)([.\\\\w]+)(?<brackets>\\\\[(?:[^]\\\\[]|\\\\g<brackets>)*])?(?=\\\\{)"}]},"other_variables":{"match":"\\\\w+","name":"variable.other.go"},"package_name":{"patterns":[{"begin":"\\\\b(package)\\\\s+","beginCaptures":{"1":{"name":"keyword.package.go"}},"end":"(?!\\\\G)","patterns":[{"match":"\\\\d\\\\w*","name":"invalid.illegal.identifier.go"},{"match":"\\\\w+","name":"entity.name.type.package.go"}]}]},"parameter-variable-types":{"patterns":[{"match":"\\\\{","name":"punctuation.definition.begin.bracket.curly.go"},{"match":"}","name":"punctuation.definition.end.bracket.curly.go"},{"begin":"([*.\\\\w]+)?(\\\\[)","beginCaptures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]},"2":{"name":"punctuation.definition.begin.bracket.square.go"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.square.go"}},"patterns":[{"include":"#generic_param_types"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"include":"#function_param_types"}]}]},"property_variables":{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.other.property.go"}]}},"match":"\\\\b([.\\\\w]+:(?!=))"},"raw_string_literals":{"begin":"\`","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.go"}},"end":"\`","endCaptures":{"0":{"name":"punctuation.definition.string.end.go"}},"name":"string.quoted.raw.go","patterns":[{"include":"#string_placeholder"}]},"runes":{"patterns":[{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.go"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.go"}},"name":"string.quoted.rune.go","patterns":[{"match":"\\\\G(\\\\\\\\([0-7]{3}|[\\"'\\\\\\\\abfnrtv]|x\\\\h{2}|u\\\\h{4}|U\\\\h{8})|.)(?=')","name":"constant.other.rune.go"},{"match":"[^']+","name":"invalid.illegal.unknown-rune.go"}]}]},"single_type":{"patterns":[{"captures":{"1":{"name":"keyword.type.go"},"2":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]},"3":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"include":"#function_param_types"},{"include":"$self"}]},{"include":"#type-declarations"},{"include":"#generic_types"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"^\\\\s*\\\\b(type)\\\\b\\\\s*([*.\\\\w]+)\\\\s+(?!(?:=\\\\s*)?[]*\\\\[]+{0,1}\\\\b(?:struct|interface)\\\\b)([\\\\s\\\\S]+)"},{"begin":"(?:^|\\\\s+)\\\\b(type)\\\\b\\\\s*([*.\\\\w]+)(?=\\\\[)","beginCaptures":{"1":{"name":"keyword.type.go"},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"end":"(?<=])(\\\\s+(?:=\\\\s*)?(?:[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}(?![]*\\\\[]+{0,1}\\\\b(?:struct|interface|func)\\\\b)[-\\\\]*.\\\\[\\\\w]+(?:,\\\\s*[]*.\\\\[\\\\w]+)*)?","endCaptures":{"1":{"patterns":[{"include":"#type-declarations-without-brackets"},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"patterns":[{"include":"#struct_variables_types"},{"include":"#type-declarations-without-brackets"},{"include":"#parameter-variable-types"},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\{","name":"punctuation.definition.begin.bracket.curly.go"},{"match":"}","name":"punctuation.definition.end.bracket.curly.go"},{"match":"\\\\(","name":"punctuation.definition.begin.bracket.round.go"},{"match":"\\\\)","name":"punctuation.definition.end.bracket.round.go"},{"match":"\\\\w+","name":"entity.name.type.go"}]}]},"slice_index_variables":{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.other.go"}]}},"match":"(?<=\\\\w\\\\[)((?:\\\\b[-%\\\\&*+./<>|\\\\w]+:|:\\\\b[-%\\\\&*+./<>|\\\\w]+)(?:\\\\b[-%\\\\&*+./<>|\\\\w]+)?(?::\\\\b[-%\\\\&*+./<>|\\\\w]+)?)(?=])"},"statements":{"patterns":[{"include":"#package_name"},{"include":"#import"},{"include":"#syntax_errors"},{"include":"#group-functions"},{"include":"#group-types"},{"include":"#group-variables"},{"include":"#hover"}]},"storage_types":{"patterns":[{"match":"\\\\bbool\\\\b","name":"storage.type.boolean.go"},{"match":"\\\\bbyte\\\\b","name":"storage.type.byte.go"},{"match":"\\\\berror\\\\b","name":"storage.type.error.go"},{"match":"\\\\b(complex(64|128)|float(32|64)|u?int(8|16|32|64)?)\\\\b","name":"storage.type.numeric.go"},{"match":"\\\\brune\\\\b","name":"storage.type.rune.go"},{"match":"\\\\bstring\\\\b","name":"storage.type.string.go"},{"match":"\\\\buintptr\\\\b","name":"storage.type.uintptr.go"},{"match":"\\\\bany\\\\b","name":"entity.name.type.any.go"},{"match":"\\\\bcomparable\\\\b","name":"entity.name.type.comparable.go"}]},"string_escaped_char":{"patterns":[{"match":"\\\\\\\\([0-7]{3}|[\\"'\\\\\\\\abfnrtv]|x\\\\h{2}|u\\\\h{4}|U\\\\h{8})","name":"constant.character.escape.go"},{"match":"\\\\\\\\[^\\"'0-7Uabfnrtuvx]","name":"invalid.illegal.unknown-escape.go"}]},"string_literals":{"patterns":[{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.go"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.go"}},"name":"string.quoted.double.go","patterns":[{"include":"#string_escaped_char"},{"include":"#string_placeholder"}]}]},"string_placeholder":{"patterns":[{"match":"%(\\\\[\\\\d+])?([- #+0]{0,2}((\\\\d+|\\\\*)?(\\\\.?(\\\\d+|\\\\*|(\\\\[\\\\d+])\\\\*?)?(\\\\[\\\\d+])?)?))?[%EFGTUXb-gopqstvwx]","name":"constant.other.placeholder.go"}]},"struct_interface_declaration":{"captures":{"1":{"name":"keyword.type.go"},"2":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"^\\\\s*\\\\b(type)\\\\b\\\\s*([.\\\\w]+)"},"struct_variable_types_fields_multi":{"patterns":[{"begin":"\\\\b(\\\\w+(?:,\\\\s*\\\\b\\\\w+)*(?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}\\\\s*[]*\\\\[]+{0,1})\\\\b(struct)\\\\b\\\\s*(\\\\{)","beginCaptures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.other.property.go"}]},"2":{"name":"keyword.struct.go"},"3":{"name":"punctuation.definition.begin.bracket.curly.go"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.curly.go"}},"patterns":[{"include":"#struct_variables_types_fields"},{"include":"$self"}]},{"begin":"\\\\b(\\\\w+(?:,\\\\s*\\\\b\\\\w+)*(?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}\\\\s*[]*\\\\[]+{0,1})\\\\b(interface)\\\\b\\\\s*(\\\\{)","beginCaptures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.other.property.go"}]},"2":{"name":"keyword.interface.go"},"3":{"name":"punctuation.definition.begin.bracket.curly.go"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.curly.go"}},"patterns":[{"include":"#interface_variables_types_field"},{"include":"$self"}]},{"begin":"\\\\b(\\\\w+(?:,\\\\s*\\\\b\\\\w+)*(?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}\\\\s*[]*\\\\[]+{0,1})\\\\b(func)\\\\b\\\\s*(\\\\()","beginCaptures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.other.property.go"}]},"2":{"name":"keyword.function.go"},"3":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"include":"#function_param_types"},{"include":"$self"}]},{"include":"#parameter-variable-types"}]},"struct_variables_types":{"begin":"\\\\b(struct)\\\\b\\\\s*(\\\\{)","beginCaptures":{"1":{"name":"keyword.struct.go"},"2":{"name":"punctuation.definition.begin.bracket.curly.go"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.curly.go"}},"patterns":[{"include":"#struct_variables_types_fields"},{"include":"$self"}]},"struct_variables_types_fields":{"patterns":[{"include":"#struct_variable_types_fields_multi"},{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"(?<=\\\\{)\\\\s*((?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}[]*.\\\\[\\\\w]+)\\\\s*(?=})"},{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.other.property.go"}]},"2":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"(?<=\\\\{)\\\\s*((?:\\\\w+,\\\\s*)+{0,1}\\\\w+\\\\s+)((?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}[]*.\\\\[\\\\w]+)\\\\s*(?=})"},{"captures":{"1":{"patterns":[{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.other.property.go"}]},"2":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"((?:\\\\w+,\\\\s*)+{0,1}\\\\w+\\\\s+)?((?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}[^/\\\\s]+;?)"}]}},"match":"(?<=\\\\{)((?:\\\\s*(?:(?:\\\\w+,\\\\s*)+{0,1}\\\\w+\\\\s+)?(?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}[^/\\\\s]+;?)+)\\\\s*(?=})"},{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"((?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}[*.\\\\w]+\\\\s*)(?:(?=[\\"/\`])|$)"},{"captures":{"1":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.other.property.go"}]},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#parameter-variable-types"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"\\\\b(\\\\w+(?:\\\\s*,\\\\s*\\\\b\\\\w+)*)\\\\s*([^\\"/\`]+)"}]},"support_functions":{"captures":{"1":{"name":"entity.name.function.support.go"},"2":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\d\\\\w*","name":"invalid.illegal.identifier.go"},{"match":"\\\\w+","name":"entity.name.function.support.go"}]},"3":{"patterns":[{"include":"#type-declarations-without-brackets"},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\{","name":"punctuation.definition.begin.bracket.curly.go"},{"match":"}","name":"punctuation.definition.end.bracket.curly.go"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"(?:((?<=\\\\.)\\\\b\\\\w+)|\\\\b(\\\\w+))(?<brackets>\\\\[(?:[^]\\\\[]|\\\\g<brackets>)*])?(?=\\\\()"},"switch_types":{"begin":"(?<=\\\\bswitch\\\\b)\\\\s*(\\\\w+\\\\s*:=)?\\\\s*([-\\\\]%\\\\&(-+./<>\\\\[|\\\\w]+)(\\\\.\\\\(\\\\btype\\\\b\\\\)\\\\s*)(\\\\{)","beginCaptures":{"1":{"patterns":[{"include":"#operators"},{"match":"\\\\w+","name":"variable.other.assignment.go"}]},"2":{"patterns":[{"include":"#support_functions"},{"include":"#type-declarations"},{"match":"\\\\w+","name":"variable.other.go"}]},"3":{"patterns":[{"include":"#delimiters"},{"include":"#brackets"},{"match":"\\\\btype\\\\b","name":"keyword.type.go"}]},"4":{"name":"punctuation.definition.begin.bracket.curly.go"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.curly.go"}},"patterns":[{"captures":{"1":{"name":"keyword.control.go"},"2":{"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]},"3":{"name":"punctuation.other.colon.go"},"4":{"patterns":[{"include":"#comments"}]}},"match":"^\\\\s*\\\\b(case)\\\\b\\\\s+([!*,.<=>\\\\w\\\\s]+)(:)(\\\\s*/[*/]\\\\s*.*)?$"},{"begin":"\\\\bcase\\\\b","beginCaptures":{"0":{"name":"keyword.control.go"}},"end":":","endCaptures":{"0":{"name":"punctuation.other.colon.go"}},"patterns":[{"include":"#type-declarations"},{"match":"\\\\w+","name":"entity.name.type.go"}]},{"include":"$self"}]},"switch_variables":{"patterns":[{"captures":{"1":{"name":"keyword.control.go"},"2":{"patterns":[{"include":"#type-declarations"},{"include":"#support_functions"},{"include":"#variable_assignment"},{"match":"\\\\w+","name":"variable.other.go"}]}},"match":"^\\\\s*\\\\b(case)\\\\b\\\\s+([\\\\s\\\\S]+:\\\\s*(?:/[*/].*)?)$"},{"begin":"(?<=\\\\bswitch\\\\b)\\\\s*((?:[.\\\\w]+(?:\\\\s*[-!%\\\\&+,/:<=>|]+\\\\s*[.\\\\w]+)*\\\\s*[-!%\\\\&+,/:<=>|]+)?\\\\s*[-\\\\]%\\\\&(-+./<>\\\\[|\\\\w]+{0,1}\\\\s*(?:;\\\\s*[-\\\\]%\\\\&(-+./<>\\\\[|\\\\w]+\\\\s*)?)(\\\\{)","beginCaptures":{"1":{"patterns":[{"include":"#support_functions"},{"include":"#type-declarations"},{"include":"#variable_assignment"},{"match":"\\\\w+","name":"variable.other.go"}]},"2":{"name":"punctuation.definition.begin.bracket.curly.go"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.curly.go"}},"patterns":[{"begin":"\\\\bcase\\\\b","beginCaptures":{"0":{"name":"keyword.control.go"}},"end":":","endCaptures":{"0":{"name":"punctuation.other.colon.go"}},"patterns":[{"include":"#support_functions"},{"include":"#type-declarations"},{"include":"#variable_assignment"},{"match":"\\\\w+","name":"variable.other.go"}]},{"include":"$self"}]}]},"syntax_errors":{"patterns":[{"captures":{"1":{"name":"invalid.illegal.slice.go"}},"match":"\\\\[](\\\\s+)"},{"match":"\\\\b0[0-7]*[89]\\\\d*\\\\b","name":"invalid.illegal.numeric.go"}]},"terminators":{"match":";","name":"punctuation.terminator.go"},"type-declarations":{"patterns":[{"include":"#language_constants"},{"include":"#comments"},{"include":"#map_types"},{"include":"#brackets"},{"include":"#delimiters"},{"include":"#keywords"},{"include":"#operators"},{"include":"#runes"},{"include":"#storage_types"},{"include":"#raw_string_literals"},{"include":"#string_literals"},{"include":"#numeric_literals"},{"include":"#terminators"}]},"type-declarations-without-brackets":{"patterns":[{"include":"#language_constants"},{"include":"#comments"},{"include":"#map_types"},{"include":"#delimiters"},{"include":"#keywords"},{"include":"#operators"},{"include":"#runes"},{"include":"#storage_types"},{"include":"#raw_string_literals"},{"include":"#string_literals"},{"include":"#numeric_literals"},{"include":"#terminators"}]},"type_assertion_inline":{"captures":{"1":{"name":"keyword.type.go"},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"match":"\\\\(","name":"punctuation.definition.begin.bracket.round.go"},{"match":"\\\\)","name":"punctuation.definition.end.bracket.round.go"},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\{","name":"punctuation.definition.begin.bracket.curly.go"},{"match":"}","name":"punctuation.definition.end.bracket.curly.go"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"(?<=\\\\.\\\\()(?:\\\\b(type)\\\\b|((?:\\\\s*[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+{0,1}[]*\\\\[]+{0,1}[.\\\\w]+(?:\\\\[(?:[]*.\\\\[{}\\\\w]+(?:,\\\\s*[]*.\\\\[{}\\\\w]+)*)?])?))(?=\\\\))"},"var_assignment":{"patterns":[{"captures":{"1":{"patterns":[{"include":"#delimiters"},{"match":"\\\\w+","name":"variable.other.assignment.go"}]},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#generic_types"},{"match":"\\\\(","name":"punctuation.definition.begin.bracket.round.go"},{"match":"\\\\)","name":"punctuation.definition.end.bracket.round.go"},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"(?<=\\\\bvar\\\\b)\\\\s*\\\\b([.\\\\w]+(?:,\\\\s*[.\\\\w]+)*)\\\\s*((?:(?:[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+(?:\\\\([^)]+\\\\))?)?(?![]*\\\\[]+{0,1}\\\\b(?:struct|func|map)\\\\b)(?:[]*.\\\\[\\\\w]+(?:,\\\\s*[]*.\\\\[\\\\w]+)*)?\\\\s*=?)?"},{"begin":"(?<=\\\\bvar\\\\b)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.begin.bracket.round.go"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.end.bracket.round.go"}},"patterns":[{"captures":{"1":{"patterns":[{"include":"#delimiters"},{"match":"\\\\w+","name":"variable.other.assignment.go"}]},"2":{"patterns":[{"include":"#type-declarations-without-brackets"},{"include":"#generic_types"},{"match":"\\\\(","name":"punctuation.definition.begin.bracket.round.go"},{"match":"\\\\)","name":"punctuation.definition.end.bracket.round.go"},{"match":"\\\\[","name":"punctuation.definition.begin.bracket.square.go"},{"match":"]","name":"punctuation.definition.end.bracket.square.go"},{"match":"\\\\w+","name":"entity.name.type.go"}]}},"match":"^\\\\s*\\\\b([.\\\\w]+(?:,\\\\s*[.\\\\w]+)*)\\\\s*((?:(?:[]*\\\\[]+{0,1}(?:<-\\\\s*)?\\\\bchan\\\\b(?:\\\\s*<-)?\\\\s*)+(?:\\\\([^)]+\\\\))?)?(?![]*\\\\[]+{0,1}\\\\b(?:struct|func|map)\\\\b)(?:[]*.\\\\[\\\\w]+(?:,\\\\s*[]*.\\\\[\\\\w]+)*)?\\\\s*=?)?"},{"include":"$self"}]}]},"variable_assignment":{"patterns":[{"captures":{"0":{"patterns":[{"include":"#delimiters"},{"match":"\\\\d\\\\w*","name":"invalid.illegal.identifier.go"},{"match":"\\\\w+","name":"variable.other.assignment.go"}]}},"match":"\\\\b\\\\w+(?:,\\\\s*\\\\w+)*(?=\\\\s*:=)"},{"captures":{"0":{"patterns":[{"include":"#delimiters"},{"include":"#operators"},{"match":"\\\\d\\\\w*","name":"invalid.illegal.identifier.go"},{"match":"\\\\w+","name":"variable.other.assignment.go"}]}},"match":"\\\\b[*.\\\\w]+(?:,\\\\s*[*.\\\\w]+)*(?=\\\\s*=(?!=))"}]}},"scopeName":"source.go"}`)),n=[e];export{n as default};