@burdenoff/microfe-technospam 2026.1102.1 → 2026.1102.3

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 (133) hide show
  1. package/dist/generated/wspace-types.d.ts +7468 -141
  2. package/dist/generated/wspace-types.d.ts.map +1 -1
  3. package/dist/node_modules/@codemirror/autocomplete/dist/index.js +527 -0
  4. package/dist/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -0
  5. package/dist/node_modules/@codemirror/commands/dist/index.js +1108 -0
  6. package/dist/node_modules/@codemirror/commands/dist/index.js.map +1 -0
  7. package/dist/node_modules/@codemirror/lang-go/dist/index.js +206 -0
  8. package/dist/node_modules/@codemirror/lang-go/dist/index.js.map +1 -0
  9. package/dist/node_modules/@codemirror/lang-javascript/dist/index.js +321 -0
  10. package/dist/node_modules/@codemirror/lang-javascript/dist/index.js.map +1 -0
  11. package/dist/node_modules/@codemirror/lang-python/dist/index.js +265 -0
  12. package/dist/node_modules/@codemirror/lang-python/dist/index.js.map +1 -0
  13. package/dist/node_modules/@codemirror/language/dist/index.js +957 -0
  14. package/dist/node_modules/@codemirror/language/dist/index.js.map +1 -0
  15. package/dist/node_modules/@codemirror/legacy-modes/mode/ruby.js +164 -0
  16. package/dist/node_modules/@codemirror/legacy-modes/mode/ruby.js.map +1 -0
  17. package/dist/node_modules/@codemirror/legacy-modes/mode/shell.js +109 -0
  18. package/dist/node_modules/@codemirror/legacy-modes/mode/shell.js.map +1 -0
  19. package/dist/node_modules/@codemirror/state/dist/index.js +1739 -0
  20. package/dist/node_modules/@codemirror/state/dist/index.js.map +1 -0
  21. package/dist/node_modules/@codemirror/streamparser/dist/index.js +70 -0
  22. package/dist/node_modules/@codemirror/streamparser/dist/index.js.map +1 -0
  23. package/dist/node_modules/@codemirror/view/dist/index.js +5427 -0
  24. package/dist/node_modules/@codemirror/view/dist/index.js.map +1 -0
  25. package/dist/node_modules/@lezer/common/dist/index.js +896 -0
  26. package/dist/node_modules/@lezer/common/dist/index.js.map +1 -0
  27. package/dist/node_modules/@lezer/go/dist/index.js +215 -0
  28. package/dist/node_modules/@lezer/go/dist/index.js.map +1 -0
  29. package/dist/node_modules/@lezer/highlight/dist/index.js +395 -0
  30. package/dist/node_modules/@lezer/highlight/dist/index.js.map +1 -0
  31. package/dist/node_modules/@lezer/javascript/dist/index.js +437 -0
  32. package/dist/node_modules/@lezer/javascript/dist/index.js.map +1 -0
  33. package/dist/node_modules/@lezer/lr/dist/index.js +842 -0
  34. package/dist/node_modules/@lezer/lr/dist/index.js.map +1 -0
  35. package/dist/node_modules/@lezer/python/dist/index.js +352 -0
  36. package/dist/node_modules/@lezer/python/dist/index.js.map +1 -0
  37. package/dist/node_modules/@marijn/find-cluster-break/src/index.js +66 -0
  38. package/dist/node_modules/@marijn/find-cluster-break/src/index.js.map +1 -0
  39. package/dist/node_modules/style-mod/src/style-mod.js +74 -0
  40. package/dist/node_modules/style-mod/src/style-mod.js.map +1 -0
  41. package/dist/node_modules/w3c-keyname/index.js +90 -0
  42. package/dist/node_modules/w3c-keyname/index.js.map +1 -0
  43. package/dist/stories/fixtures/technospamFixtures.d.ts.map +1 -1
  44. package/dist/stories/journeys/Problems.stories.d.ts.map +1 -1
  45. package/dist/technospam/TechnoSpamRoot.d.ts.map +1 -1
  46. package/dist/technospam/TechnoSpamRoot.js +187 -178
  47. package/dist/technospam/TechnoSpamRoot.js.map +1 -1
  48. package/dist/technospam/api/technospamApi.d.ts +39 -0
  49. package/dist/technospam/api/technospamApi.d.ts.map +1 -1
  50. package/dist/technospam/api/technospamApi.js +184 -150
  51. package/dist/technospam/api/technospamApi.js.map +1 -1
  52. package/dist/technospam/components/MediaCover.js +2 -2
  53. package/dist/technospam/components/MediaCover.js.map +1 -1
  54. package/dist/technospam/components/MobileSectionTabs.d.ts +9 -0
  55. package/dist/technospam/components/MobileSectionTabs.d.ts.map +1 -0
  56. package/dist/technospam/components/MobileSectionTabs.js +43 -0
  57. package/dist/technospam/components/MobileSectionTabs.js.map +1 -0
  58. package/dist/technospam/components/PageLayout.d.ts +7 -1
  59. package/dist/technospam/components/PageLayout.d.ts.map +1 -1
  60. package/dist/technospam/components/PageLayout.js +40 -28
  61. package/dist/technospam/components/PageLayout.js.map +1 -1
  62. package/dist/technospam/components/SubmissionViews.d.ts +6 -2
  63. package/dist/technospam/components/SubmissionViews.d.ts.map +1 -1
  64. package/dist/technospam/components/SubmissionViews.js +6 -5
  65. package/dist/technospam/components/SubmissionViews.js.map +1 -1
  66. package/dist/technospam/components/TechnoSpamErrorBoundary.d.ts +6 -0
  67. package/dist/technospam/components/TechnoSpamErrorBoundary.d.ts.map +1 -1
  68. package/dist/technospam/components/TechnoSpamErrorBoundary.js +2 -2
  69. package/dist/technospam/components/TechnoSpamErrorBoundary.js.map +1 -1
  70. package/dist/technospam/components/editor/CodeEditor.d.ts +26 -0
  71. package/dist/technospam/components/editor/CodeEditor.d.ts.map +1 -0
  72. package/dist/technospam/components/editor/CodeEditor.js +102 -0
  73. package/dist/technospam/components/editor/CodeEditor.js.map +1 -0
  74. package/dist/technospam/components/editor/RunOutputPanel.d.ts +14 -0
  75. package/dist/technospam/components/editor/RunOutputPanel.d.ts.map +1 -0
  76. package/dist/technospam/components/editor/RunOutputPanel.js +127 -0
  77. package/dist/technospam/components/editor/RunOutputPanel.js.map +1 -0
  78. package/dist/technospam/components/editor/editorLanguages.d.ts +11 -0
  79. package/dist/technospam/components/editor/editorLanguages.d.ts.map +1 -0
  80. package/dist/technospam/components/editor/editorLanguages.js +30 -0
  81. package/dist/technospam/components/editor/editorLanguages.js.map +1 -0
  82. package/dist/technospam/components/editor/editorTheme.d.ts +11 -0
  83. package/dist/technospam/components/editor/editorTheme.d.ts.map +1 -0
  84. package/dist/technospam/components/editor/editorTheme.js +120 -0
  85. package/dist/technospam/components/editor/editorTheme.js.map +1 -0
  86. package/dist/technospam/components/lesson/SaveCourseOffline.js +6 -6
  87. package/dist/technospam/hooks/usePhoneLayout.d.ts +18 -0
  88. package/dist/technospam/hooks/usePhoneLayout.d.ts.map +1 -0
  89. package/dist/technospam/hooks/usePhoneLayout.js +14 -0
  90. package/dist/technospam/hooks/usePhoneLayout.js.map +1 -0
  91. package/dist/technospam/hooks/useSolutionRunner.d.ts +35 -0
  92. package/dist/technospam/hooks/useSolutionRunner.d.ts.map +1 -0
  93. package/dist/technospam/hooks/useSolutionRunner.js +66 -0
  94. package/dist/technospam/hooks/useSolutionRunner.js.map +1 -0
  95. package/dist/technospam/hooks/useTechnoSpamAnalytics.d.ts +1 -1
  96. package/dist/technospam/hooks/useTechnoSpamAnalytics.d.ts.map +1 -1
  97. package/dist/technospam/hooks/useTechnoSpamAnalytics.js.map +1 -1
  98. package/dist/technospam/pages/AdminAdminDashboardPagePage.js +1 -1
  99. package/dist/technospam/pages/AdminAdminDashboardPagePage.js.map +1 -1
  100. package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.d.ts.map +1 -1
  101. package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js +416 -263
  102. package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js.map +1 -1
  103. package/dist/technospam/pages/ApplicationsProblemsPagePage.d.ts.map +1 -1
  104. package/dist/technospam/pages/ApplicationsProblemsPagePage.js +89 -87
  105. package/dist/technospam/pages/ApplicationsProblemsPagePage.js.map +1 -1
  106. package/dist/technospam/pages/CoursesCourseDetailsPagePage.js +3 -3
  107. package/dist/technospam/pages/CoursesCourseDetailsPagePage.js.map +1 -1
  108. package/dist/technospam/pages/CoursesCoursesPagePage.d.ts.map +1 -1
  109. package/dist/technospam/pages/CoursesCoursesPagePage.js +117 -81
  110. package/dist/technospam/pages/CoursesCoursesPagePage.js.map +1 -1
  111. package/dist/technospam/pages/CoursesMyLearningPagePage.js +1 -1
  112. package/dist/technospam/pages/CoursesMyLearningPagePage.js.map +1 -1
  113. package/dist/technospam/pages/DashboardDashboardPagePage.d.ts.map +1 -1
  114. package/dist/technospam/pages/DashboardDashboardPagePage.js +21 -17
  115. package/dist/technospam/pages/DashboardDashboardPagePage.js.map +1 -1
  116. package/dist/technospam/pages/HackathonsHackathonDetailsPagePage.js +3 -3
  117. package/dist/technospam/pages/HackathonsHackathonDetailsPagePage.js.map +1 -1
  118. package/dist/technospam/pages/MentorshipMentorProfilePagePage.js +4 -4
  119. package/dist/technospam/pages/MentorshipMentorProfilePagePage.js.map +1 -1
  120. package/dist/technospam/pages/MentorshipMentorsPagePage.d.ts.map +1 -1
  121. package/dist/technospam/pages/MentorshipMentorsPagePage.js +6 -4
  122. package/dist/technospam/pages/MentorshipMentorsPagePage.js.map +1 -1
  123. package/dist/technospam/pages/MentorshipSessionsPagePage.js +1 -1
  124. package/dist/technospam/pages/MentorshipSessionsPagePage.js.map +1 -1
  125. package/dist/technospam/types/index.d.ts +7 -0
  126. package/dist/technospam/types/index.d.ts.map +1 -1
  127. package/dist/technospam/utils/mobileTabs.d.ts +45 -0
  128. package/dist/technospam/utils/mobileTabs.d.ts.map +1 -0
  129. package/dist/technospam/utils/mobileTabs.js +70 -0
  130. package/dist/technospam/utils/mobileTabs.js.map +1 -0
  131. package/dist/test/matchMedia.d.ts +6 -0
  132. package/dist/test/matchMedia.d.ts.map +1 -0
  133. package/package.json +16 -6
@@ -0,0 +1,527 @@
1
+ import { Annotation as e, CharCategory as t, EditorSelection as n, Facet as r, MapMode as i, Prec as a, RangeSet as o, RangeValue as s, StateEffect as c, StateField as l, Text as u, Transaction as ee, codePointAt as d, codePointSize as f, fromCodePoint as te } from "../../state/dist/index.js";
2
+ import { Decoration as p, EditorView as m, WidgetType as h, keymap as g } from "../../view/dist/index.js";
3
+ import { indentUnit as ne, syntaxTree as _ } from "../../language/dist/index.js";
4
+ //#region node_modules/@codemirror/autocomplete/dist/index.js
5
+ function v(e) {
6
+ let t = Object.keys(e).join(""), n = /\w/.test(t);
7
+ return n && (t = t.replace(/\w/g, "")), `[${n ? "\\w" : ""}${t.replace(/[^\w\s]/g, "\\$&")}]`;
8
+ }
9
+ function re(e) {
10
+ let t = Object.create(null), n = Object.create(null);
11
+ for (let { label: r } of e) {
12
+ t[r[0]] = !0;
13
+ for (let e = 1; e < r.length; e++) n[r[e]] = !0;
14
+ }
15
+ let r = v(t) + v(n) + "*$";
16
+ return [RegExp("^" + r), new RegExp(r)];
17
+ }
18
+ function y(e) {
19
+ let t = e.map((e) => typeof e == "string" ? { label: e } : e), [n, r] = t.every((e) => /^\w+$/.test(e.label)) ? [/\w*$/, /\w+$/] : re(t);
20
+ return (e) => {
21
+ let i = e.matchBefore(r);
22
+ return i || e.explicit ? {
23
+ from: i ? i.from : e.pos,
24
+ options: t,
25
+ validFor: n
26
+ } : null;
27
+ };
28
+ }
29
+ function b(e, t) {
30
+ return (n) => {
31
+ for (let t = _(n.state).resolveInner(n.pos, -1); t; t = t.parent) {
32
+ if (e.indexOf(t.name) > -1) return null;
33
+ if (t.type.isTop) break;
34
+ }
35
+ return t(n);
36
+ };
37
+ }
38
+ var x = /* @__PURE__ */ e.define();
39
+ typeof navigator == "object" && navigator.platform;
40
+ var S = /* @__PURE__ */ m.baseTheme({
41
+ ".cm-tooltip.cm-tooltip-autocomplete": { "& > ul": {
42
+ fontFamily: "monospace",
43
+ whiteSpace: "nowrap",
44
+ overflow: "hidden auto",
45
+ maxWidth_fallback: "700px",
46
+ maxWidth: "min(700px, 95vw)",
47
+ minWidth: "250px",
48
+ maxHeight: "10em",
49
+ height: "100%",
50
+ listStyle: "none",
51
+ margin: 0,
52
+ padding: 0,
53
+ "& > li, & > completion-section": {
54
+ padding: "1px 3px",
55
+ lineHeight: 1.2
56
+ },
57
+ "& > li": {
58
+ overflowX: "hidden",
59
+ textOverflow: "ellipsis",
60
+ cursor: "pointer"
61
+ },
62
+ "& > completion-section": {
63
+ display: "list-item",
64
+ borderBottom: "1px solid silver",
65
+ paddingLeft: "0.5em",
66
+ opacity: .7
67
+ }
68
+ } },
69
+ "&light .cm-tooltip-autocomplete ul li[aria-selected]": {
70
+ background: "#17c",
71
+ color: "white"
72
+ },
73
+ "&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]": { background: "#777" },
74
+ "&dark .cm-tooltip-autocomplete ul li[aria-selected]": {
75
+ background: "#347",
76
+ color: "white"
77
+ },
78
+ "&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]": { background: "#444" },
79
+ ".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after": {
80
+ content: "\"···\"",
81
+ opacity: .5,
82
+ display: "block",
83
+ textAlign: "center",
84
+ cursor: "pointer"
85
+ },
86
+ ".cm-tooltip.cm-completionInfo": {
87
+ position: "absolute",
88
+ padding: "3px 9px",
89
+ width: "max-content",
90
+ maxWidth: "400px",
91
+ boxSizing: "border-box",
92
+ whiteSpace: "pre-line"
93
+ },
94
+ ".cm-completionInfo.cm-completionInfo-left": { right: "100%" },
95
+ ".cm-completionInfo.cm-completionInfo-right": { left: "100%" },
96
+ ".cm-completionInfo.cm-completionInfo-left-narrow": { right: "30px" },
97
+ ".cm-completionInfo.cm-completionInfo-right-narrow": { left: "30px" },
98
+ "&light .cm-snippetField": { backgroundColor: "#00000022" },
99
+ "&dark .cm-snippetField": { backgroundColor: "#ffffff22" },
100
+ ".cm-snippetFieldPosition": {
101
+ verticalAlign: "text-top",
102
+ width: 0,
103
+ height: "1.15em",
104
+ display: "inline-block",
105
+ margin: "0 -0.7px -.7em",
106
+ borderLeft: "1.4px dotted #888"
107
+ },
108
+ ".cm-completionMatchedText": { textDecoration: "underline" },
109
+ ".cm-completionDetail": {
110
+ marginLeft: "0.5em",
111
+ fontStyle: "italic"
112
+ },
113
+ ".cm-completionIcon": {
114
+ fontSize: "90%",
115
+ width: ".8em",
116
+ display: "inline-block",
117
+ textAlign: "center",
118
+ paddingRight: ".6em",
119
+ opacity: "0.6",
120
+ boxSizing: "content-box"
121
+ },
122
+ ".cm-completionIcon-function, .cm-completionIcon-method": { "&:after": { content: "'ƒ'" } },
123
+ ".cm-completionIcon-class": { "&:after": { content: "'○'" } },
124
+ ".cm-completionIcon-interface": { "&:after": { content: "'◌'" } },
125
+ ".cm-completionIcon-variable": { "&:after": { content: "'𝑥'" } },
126
+ ".cm-completionIcon-constant": { "&:after": { content: "'𝐶'" } },
127
+ ".cm-completionIcon-type": { "&:after": { content: "'𝑡'" } },
128
+ ".cm-completionIcon-enum": { "&:after": { content: "'∪'" } },
129
+ ".cm-completionIcon-property": { "&:after": { content: "'□'" } },
130
+ ".cm-completionIcon-keyword": { "&:after": { content: "'🔑︎'" } },
131
+ ".cm-completionIcon-namespace": { "&:after": { content: "'▢'" } },
132
+ ".cm-completionIcon-text": { "&:after": {
133
+ content: "'abc'",
134
+ fontSize: "50%",
135
+ verticalAlign: "middle"
136
+ } }
137
+ }), C = class {
138
+ constructor(e, t, n, r) {
139
+ this.field = e, this.line = t, this.from = n, this.to = r;
140
+ }
141
+ }, w = class e {
142
+ constructor(e, t, n) {
143
+ this.field = e, this.from = t, this.to = n;
144
+ }
145
+ map(t) {
146
+ let n = t.mapPos(this.from, -1, i.TrackDel), r = t.mapPos(this.to, 1, i.TrackDel);
147
+ return n == null || r == null ? null : new e(this.field, n, r);
148
+ }
149
+ }, T = class e {
150
+ constructor(e, t) {
151
+ this.lines = e, this.fieldPositions = t;
152
+ }
153
+ instantiate(e, t) {
154
+ let n = [], r = [t], i = e.doc.lineAt(t), a = /^\s*/.exec(i.text)[0];
155
+ for (let i of this.lines) {
156
+ if (n.length) {
157
+ let n = a, o = /^\t*/.exec(i)[0].length;
158
+ for (let t = 0; t < o; t++) n += e.facet(ne);
159
+ r.push(t + n.length - o), i = n + i.slice(o);
160
+ }
161
+ n.push(i), t += i.length + 1;
162
+ }
163
+ return {
164
+ text: n,
165
+ ranges: this.fieldPositions.map((e) => new w(e.field, r[e.line] + e.from, r[e.line] + e.to))
166
+ };
167
+ }
168
+ static parse(t) {
169
+ let n = [], r = [], i = [], a;
170
+ for (let e of t.split(/\r\n?|\n/)) {
171
+ for (; a = /[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);) {
172
+ let t = a[1] ? +a[1] : null, o = a[2] || a[3] || "", s = -1;
173
+ t === 0 && (t = 1e9);
174
+ let c = o.replace(/\\[{}]/g, (e) => e[1]);
175
+ for (let e = 0; e < n.length; e++) (t == null ? c && n[e].name == c : n[e].seq == t) && (s = e);
176
+ if (s < 0) {
177
+ let e = 0;
178
+ for (; e < n.length && (t == null || n[e].seq != null && n[e].seq < t);) e++;
179
+ n.splice(e, 0, {
180
+ seq: t,
181
+ name: c
182
+ }), s = e;
183
+ for (let e of i) e.field >= s && e.field++;
184
+ }
185
+ for (let e of i) if (e.line == r.length && e.from > a.index) {
186
+ let t = a[2] ? 3 + (a[1] || "").length : 2;
187
+ e.from -= t, e.to -= t;
188
+ }
189
+ i.push(new C(s, r.length, a.index, a.index + c.length)), e = e.slice(0, a.index) + o + e.slice(a.index + a[0].length);
190
+ }
191
+ e = e.replace(/\\([{}])/g, (e, t, n) => {
192
+ for (let e of i) e.line == r.length && e.from > n && (e.from--, e.to--);
193
+ return t;
194
+ }), r.push(e);
195
+ }
196
+ return new e(r, i);
197
+ }
198
+ }, E = /* @__PURE__ */ p.widget({ widget: /* @__PURE__ */ new class extends h {
199
+ toDOM() {
200
+ let e = document.createElement("span");
201
+ return e.className = "cm-snippetFieldPosition", e;
202
+ }
203
+ ignoreEvent() {
204
+ return !1;
205
+ }
206
+ }() }), D = /* @__PURE__ */ p.mark({ class: "cm-snippetField" }), O = class e {
207
+ constructor(e, t) {
208
+ this.ranges = e, this.active = t, this.deco = p.set(e.map((e) => (e.from == e.to ? E : D).range(e.from, e.to)), !0);
209
+ }
210
+ map(t) {
211
+ let n = [];
212
+ for (let e of this.ranges) {
213
+ let r = e.map(t);
214
+ if (!r) return null;
215
+ n.push(r);
216
+ }
217
+ return new e(n, this.active);
218
+ }
219
+ selectionInsideField(e) {
220
+ return e.ranges.every((e) => this.ranges.some((t) => t.field == this.active && t.from <= e.from && t.to >= e.to));
221
+ }
222
+ }, k = /* @__PURE__ */ c.define({ map(e, t) {
223
+ return e && e.map(t);
224
+ } }), ie = /* @__PURE__ */ c.define(), A = /* @__PURE__ */ l.define({
225
+ create() {
226
+ return null;
227
+ },
228
+ update(e, t) {
229
+ for (let n of t.effects) {
230
+ if (n.is(k)) return n.value;
231
+ if (n.is(ie) && e) return new O(e.ranges, n.value);
232
+ }
233
+ return e && t.docChanged && (e = e.map(t.changes)), e && t.selection && !e.selectionInsideField(t.selection) && (e = null), e;
234
+ },
235
+ provide: (e) => m.decorations.from(e, (e) => e ? e.deco : p.none)
236
+ });
237
+ function j(e, t) {
238
+ return n.create(e.filter((e) => e.field == t).map((e) => n.range(e.from, e.to)));
239
+ }
240
+ function M(e) {
241
+ let t = T.parse(e);
242
+ return (e, n, r, i) => {
243
+ let { text: a, ranges: o } = t.instantiate(e.state, r), { main: s } = e.state.selection, l = {
244
+ changes: {
245
+ from: r,
246
+ to: i == s.from ? s.to : i,
247
+ insert: u.of(a)
248
+ },
249
+ scrollIntoView: !0,
250
+ annotations: n ? [x.of(n), ee.userEvent.of("input.complete")] : void 0
251
+ };
252
+ if (o.length && (l.selection = j(o, 0)), o.some((e) => e.field > 0)) {
253
+ let t = new O(o, 0), n = l.effects = [k.of(t)];
254
+ e.state.field(A, !1) === void 0 && n.push(c.appendConfig.of([
255
+ A,
256
+ I,
257
+ R,
258
+ S
259
+ ]));
260
+ }
261
+ e.dispatch(e.state.update(l));
262
+ };
263
+ }
264
+ function N(e) {
265
+ return ({ state: t, dispatch: n }) => {
266
+ let r = t.field(A, !1);
267
+ if (!r || e < 0 && r.active == 0) return !1;
268
+ let i = r.active + e, a = e > 0 && !r.ranges.some((t) => t.field == i + e);
269
+ return n(t.update({
270
+ selection: j(r.ranges, i),
271
+ effects: k.of(a ? null : new O(r.ranges, i)),
272
+ scrollIntoView: !0
273
+ })), !0;
274
+ };
275
+ }
276
+ var P = [{
277
+ key: "Tab",
278
+ run: /* @__PURE__ */ N(1),
279
+ shift: /* @__PURE__ */ N(-1)
280
+ }, {
281
+ key: "Escape",
282
+ run: ({ state: e, dispatch: t }) => e.field(A, !1) ? (t(e.update({ effects: k.of(null) })), !0) : !1
283
+ }], F = /* @__PURE__ */ r.define({ combine(e) {
284
+ return e.length ? e[0] : P;
285
+ } }), I = /* @__PURE__ */ a.highest(/* @__PURE__ */ g.compute([F], (e) => e.facet(F)));
286
+ function L(e, t) {
287
+ return {
288
+ ...t,
289
+ apply: M(e)
290
+ };
291
+ }
292
+ var R = /* @__PURE__ */ m.domEventHandlers({ mousedown(e, t) {
293
+ let n = t.state.field(A, !1), r;
294
+ if (!n || (r = t.posAtCoords({
295
+ x: e.clientX,
296
+ y: e.clientY
297
+ })) == null) return !1;
298
+ let i = n.ranges.find((e) => e.from <= r && e.to >= r);
299
+ return !i || i.field == n.active ? !1 : (t.dispatch({
300
+ selection: j(n.ranges, i.field),
301
+ effects: k.of(n.ranges.some((e) => e.field > i.field) ? new O(n.ranges, i.field) : null),
302
+ scrollIntoView: !0
303
+ }), !0);
304
+ } }), z = {
305
+ brackets: [
306
+ "(",
307
+ "[",
308
+ "{",
309
+ "'",
310
+ "\""
311
+ ],
312
+ before: ")]}:;>",
313
+ stringPrefixes: []
314
+ }, B = /* @__PURE__ */ c.define({ map(e, t) {
315
+ return t.mapPos(e, -1, i.TrackAfter) ?? void 0;
316
+ } }), V = /* @__PURE__ */ new class extends s {}();
317
+ V.startSide = 1, V.endSide = -1;
318
+ var H = /* @__PURE__ */ l.define({
319
+ create() {
320
+ return o.empty;
321
+ },
322
+ update(e, t) {
323
+ if (e = e.map(t.changes), t.selection) {
324
+ let n = t.state.doc.lineAt(t.selection.main.head);
325
+ e = e.update({ filter: (e) => e >= n.from && e <= n.to });
326
+ }
327
+ for (let n of t.effects) n.is(B) && (e = e.update({ add: [V.range(n.value, n.value + 1)] }));
328
+ return e;
329
+ }
330
+ });
331
+ function U() {
332
+ return [J, H];
333
+ }
334
+ var W = "()[]{}<>«»»«[]{}";
335
+ function G(e) {
336
+ for (let t = 0; t < 16; t += 2) if (W.charCodeAt(t) == e) return W.charAt(t + 1);
337
+ return te(e < 128 ? e : e + 1);
338
+ }
339
+ function K(e, t) {
340
+ return e.languageDataAt("closeBrackets", t)[0] || z;
341
+ }
342
+ var q = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent), J = /* @__PURE__ */ m.inputHandler.of((e, t, n, r) => {
343
+ if ((q ? e.composing : e.compositionStarted) || e.state.readOnly) return !1;
344
+ let i = e.state.selection.main;
345
+ if (r.length > 2 || r.length == 2 && f(d(r, 0)) == 1 || t != i.from || n != i.to) return !1;
346
+ let a = oe(e.state, r);
347
+ return a ? (e.dispatch(a), !0) : !1;
348
+ }), ae = [{
349
+ key: "Backspace",
350
+ run: ({ state: e, dispatch: t }) => {
351
+ if (e.readOnly) return !1;
352
+ let r = K(e, e.selection.main.head).brackets || z.brackets, i = null, a = e.changeByRange((t) => {
353
+ if (t.empty) {
354
+ let i = se(e.doc, t.head);
355
+ for (let a of r) if (a == i && X(e.doc, t.head) == G(d(a, 0))) return {
356
+ changes: {
357
+ from: t.head - a.length,
358
+ to: t.head + a.length
359
+ },
360
+ range: n.cursor(t.head - a.length)
361
+ };
362
+ }
363
+ return { range: i = t };
364
+ });
365
+ return i || t(e.update(a, {
366
+ scrollIntoView: !0,
367
+ userEvent: "delete.backward"
368
+ })), !i;
369
+ }
370
+ }];
371
+ function oe(e, t) {
372
+ let n = K(e, e.selection.main.head), r = n.brackets || z.brackets;
373
+ for (let i of r) {
374
+ let a = G(d(i, 0));
375
+ if (t == i) return a == i ? le(e, i, r.indexOf(i + i + i) > -1, n) : ce(e, i, a, n.before || z.before);
376
+ if (t == a && Y(e, e.selection.main.from)) return Z(e, i, a);
377
+ }
378
+ return null;
379
+ }
380
+ function Y(e, t) {
381
+ let n = !1;
382
+ return e.field(H).between(0, e.doc.length, (e) => {
383
+ e == t && (n = !0);
384
+ }), n;
385
+ }
386
+ function X(e, t) {
387
+ let n = e.sliceString(t, t + 2);
388
+ return n.slice(0, f(d(n, 0)));
389
+ }
390
+ function se(e, t) {
391
+ let n = e.sliceString(t - 2, t);
392
+ return f(d(n, 0)) == n.length ? n : n.slice(1);
393
+ }
394
+ function ce(e, t, r, i) {
395
+ let a = null, o = e.changeByRange((o) => {
396
+ if (!o.empty) return {
397
+ changes: [{
398
+ insert: t,
399
+ from: o.from
400
+ }, {
401
+ insert: r,
402
+ from: o.to
403
+ }],
404
+ effects: B.of(o.to + t.length),
405
+ range: n.range(o.anchor + t.length, o.head + t.length)
406
+ };
407
+ let s = X(e.doc, o.head);
408
+ return !s || /\s/.test(s) || i.indexOf(s) > -1 ? {
409
+ changes: {
410
+ insert: t + r,
411
+ from: o.head
412
+ },
413
+ effects: B.of(o.head + t.length),
414
+ range: n.cursor(o.head + t.length)
415
+ } : { range: a = o };
416
+ });
417
+ return a ? null : e.update(o, {
418
+ scrollIntoView: !0,
419
+ userEvent: "input.type"
420
+ });
421
+ }
422
+ function Z(e, t, r) {
423
+ let i = null, a = e.changeByRange((t) => t.empty && X(e.doc, t.head) == r ? {
424
+ changes: {
425
+ from: t.head,
426
+ to: t.head + r.length,
427
+ insert: r
428
+ },
429
+ range: n.cursor(t.head + r.length)
430
+ } : i = { range: t });
431
+ return i ? null : e.update(a, {
432
+ scrollIntoView: !0,
433
+ userEvent: "input.type"
434
+ });
435
+ }
436
+ function le(e, r, i, a) {
437
+ let o = a.stringPrefixes || z.stringPrefixes, s = null, c = e.changeByRange((a) => {
438
+ if (!a.empty) return {
439
+ changes: [{
440
+ insert: r,
441
+ from: a.from
442
+ }, {
443
+ insert: r,
444
+ from: a.to
445
+ }],
446
+ effects: B.of(a.to + r.length),
447
+ range: n.range(a.anchor + r.length, a.head + r.length)
448
+ };
449
+ let c = a.head, l = X(e.doc, c), u;
450
+ if (l == r) {
451
+ if (Q(e, c)) return {
452
+ changes: {
453
+ insert: r + r,
454
+ from: c
455
+ },
456
+ effects: B.of(c + r.length),
457
+ range: n.cursor(c + r.length)
458
+ };
459
+ if (Y(e, c)) {
460
+ let t = i && e.sliceDoc(c, c + r.length * 3) == r + r + r ? r + r + r : r;
461
+ return {
462
+ changes: {
463
+ from: c,
464
+ to: c + t.length,
465
+ insert: t
466
+ },
467
+ range: n.cursor(c + t.length)
468
+ };
469
+ }
470
+ } else if (i && e.sliceDoc(c - 2 * r.length, c) == r + r && (u = $(e, c - 2 * r.length, o)) > -1 && Q(e, u)) return {
471
+ changes: {
472
+ insert: r + r + r + r,
473
+ from: c
474
+ },
475
+ effects: B.of(c + r.length),
476
+ range: n.cursor(c + r.length)
477
+ };
478
+ else if (e.charCategorizer(c)(l) != t.Word && $(e, c, o) > -1 && !ue(e, c, r, o)) return {
479
+ changes: {
480
+ insert: r + r,
481
+ from: c
482
+ },
483
+ effects: B.of(c + r.length),
484
+ range: n.cursor(c + r.length)
485
+ };
486
+ return { range: s = a };
487
+ });
488
+ return s ? null : e.update(c, {
489
+ scrollIntoView: !0,
490
+ userEvent: "input.type"
491
+ });
492
+ }
493
+ function Q(e, t) {
494
+ let n = _(e).resolveInner(t + 1);
495
+ return n.parent && n.from == t;
496
+ }
497
+ function ue(e, t, n, r) {
498
+ let i = _(e).resolveInner(t, -1), a = r.reduce((e, t) => Math.max(e, t.length), 0);
499
+ for (let o = 0; o < 5; o++) {
500
+ let o = e.sliceDoc(i.from, Math.min(i.to, i.from + n.length + a)), s = o.indexOf(n);
501
+ if (!s || s > -1 && r.indexOf(o.slice(0, s)) > -1) {
502
+ let t = i.firstChild;
503
+ for (; t && t.from == i.from && t.to - t.from > n.length + s;) {
504
+ if (e.sliceDoc(t.to - n.length, t.to) == n) return !1;
505
+ t = t.firstChild;
506
+ }
507
+ return !0;
508
+ }
509
+ let c = i.to == t && i.parent;
510
+ if (!c) break;
511
+ i = c;
512
+ }
513
+ return !1;
514
+ }
515
+ function $(e, n, r) {
516
+ let i = e.charCategorizer(n);
517
+ if (i(e.sliceDoc(n - 1, n)) != t.Word) return n;
518
+ for (let a of r) {
519
+ let r = n - a.length;
520
+ if (e.sliceDoc(r, n) == a && i(e.sliceDoc(r - 1, r)) != t.Word) return r;
521
+ }
522
+ return -1;
523
+ }
524
+ //#endregion
525
+ export { U as closeBrackets, ae as closeBracketsKeymap, y as completeFromList, b as ifNotIn, L as snippetCompletion };
526
+
527
+ //# sourceMappingURL=index.js.map