@pan-stack/test 0.0.13 → 0.0.16

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.
@@ -176,12 +176,11 @@ var nb=Object.create;var pa=Object.defineProperty;var rb=Object.getOwnPropertyDe
176
176
  /* tr\u1EE3 l\xFD AI + b\xECnh lu\u1EADn (panel ph\u1EA3i) */
177
177
  .pbx-btn-sm { min-height: 28px; padding: 2px 10px; font-size: 13px; }
178
178
  .pbx-ai { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - var(--pb-top-h) - 150px); min-height: 420px; }
179
- .pbx-ai-pick { display: flex; flex-wrap: wrap; gap: 6px; } .pbx-ai-sel { flex: 1 1 7rem; min-width: 0; }
180
179
  .pbx-ai-ctx, .pbx-ai-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
181
180
  .pbx-ai-log { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 1px solid var(--pb-border); border-radius: var(--pb-radius); background: var(--pb-bg); }
182
181
  .pbx-ai-msg { padding: 8px 10px; border-radius: var(--pb-radius); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
183
182
  .pbx-ai-msg--user { align-self: flex-end; max-width: 92%; background: var(--pb-primary-soft); color: var(--pb-primary-ink); }
184
- .pbx-ai-msg--ai { background: var(--pb-surface); border: 1px solid var(--pb-border); }
183
+ .pbx-ai-msg--ai { padding: 0 2px; background: none; border: 0; color: var(--pb-fg); } /* l\u1EDDi AI l\xE0 ch\u1EEF th\u01B0\u1EDDng nh\u01B0 Cursor \u2014 kh\xF4ng khung */
185
184
  .pbx-ai-msg--error { background: var(--pb-surface); border: 1px solid var(--pb-broken); color: var(--pb-broken); }
186
185
  .pbx-ai-tool { display: flex; gap: 8px; align-items: center; min-width: 0; font-size: 13px; line-height: 1.5; color: var(--pb-fg-muted); }
187
186
  .pbx-ai-tool__ico { flex: none; display: inline-flex; }
@@ -193,7 +192,81 @@ var nb=Object.create;var pa=Object.defineProperty;var rb=Object.getOwnPropertyDe
193
192
  .pbx-ai-choices__opts { display: flex; flex-wrap: wrap; gap: 6px; }
194
193
  .pbx-ai-choices__opts .pb-btn { white-space: normal; text-align: left; height: auto; min-height: 28px; }
195
194
  .pbx-ai-files { margin: 0; padding-left: 18px; }
196
- .pbx-ai-compose { display: grid; gap: 6px; } .pbx-ai-input { width: 100%; box-sizing: border-box; resize: vertical; }
195
+ /* khung so\u1EA1n ki\u1EC3u Cursor / VS Code: m\u1ED9t h\u1ED9p bo g\xF3c, \xF4 nh\u1EADp kh\xF4ng vi\u1EC1n, thanh d\u01B0\u1EDBi (chip model \xB7 D\u1EEBng \xB7 G\u1EEDi tr\xF2n) */
196
+ .pbx-ai-box { flex: none; display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 6px 10px; border: 1px solid var(--pb-border-strong); border-radius: 12px; background: var(--pb-surface); cursor: text; transition: border-color .12s ease; }
197
+ .pbx-ai-box:focus-within { border-color: var(--pb-primary); box-shadow: 0 0 0 3px var(--pb-primary-soft); }
198
+ .pbx-ai-input { width: 100%; box-sizing: border-box; min-height: 24px; max-height: 200px; resize: none; border: 0; outline: 0; padding: 2px 0; background: transparent; color: var(--pb-fg); font: inherit; font-size: 14px; line-height: 1.5; }
199
+ .pbx-ai-input:focus, .pbx-ai-input:focus-visible { outline: none; box-shadow: none; border: 0; }
200
+ .pbx-ai-input::placeholder { color: var(--pb-fg-muted); }
201
+ .pbx-ai-bar { display: flex; align-items: center; gap: 6px; min-width: 0; }
202
+ .pbx-ai-pick { display: flex; min-width: 0; }
203
+ .pbx-ai-chip { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; height: 26px; padding: 0 6px 0 8px; border: 0; border-radius: 13px; background: var(--pb-surface-2); color: var(--pb-fg); font: inherit; font-size: 12px; cursor: pointer; }
204
+ .pbx-ai-chip:hover, .pbx-ai-chip[aria-expanded="true"] { background: var(--pb-border); }
205
+ .pbx-ai-chip:focus-visible, .pbx-ai-send:focus-visible, .pbx-ai-iconbtn:focus-visible, .pbx-ai-stopbtn:focus-visible { outline: 2px solid var(--pb-primary); outline-offset: 1px; }
206
+ .pbx-ai-chip__e { flex: none; color: var(--pb-fg-muted); }
207
+ .pbx-ai-chip__m { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
208
+ .pbx-ai-chip__x { flex: none; color: var(--pb-fg-muted); }
209
+ .pbx-ai-chip__c { flex: none; display: inline-flex; color: var(--pb-fg-muted); }
210
+ .pbx-ai-send { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--pb-primary); color: var(--pb-on-primary, #fff); cursor: pointer; }
211
+ .pbx-ai-send:hover { filter: brightness(1.08); } .pbx-ai-send:disabled { opacity: .4; cursor: default; }
212
+ .pbx-ai-stopbtn { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px solid var(--pb-border-strong); border-radius: 14px; background: var(--pb-surface); color: var(--pb-fg); font: inherit; font-size: 12px; cursor: pointer; }
213
+ .pbx-ai-stopbtn:hover { border-color: var(--pb-broken); color: var(--pb-broken); }
214
+ .pbx-ai-head { flex: none; display: flex; align-items: center; gap: 4px; min-width: 0; }
215
+ .pbx-ai-head > .pbx-ai-tabs { min-width: 0; }
216
+ .pbx-ai-iconbtn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: var(--pb-radius-sm); background: none; color: var(--pb-fg-muted); cursor: pointer; }
217
+ .pbx-ai-iconbtn:hover { background: var(--pb-surface-2); color: var(--pb-fg); }
218
+ /* menu ch\u1ECDn c\xF4ng c\u1EE5 \xB7 model \xB7 m\u1EE9c suy ngh\u0129 */
219
+ .pbx-ai-menu { position: fixed; z-index: 1000; max-height: min(70vh, 460px); overflow-y: auto; padding: 6px; border: 1px solid var(--pb-border-strong); border-radius: 10px; background: var(--pb-surface); box-shadow: 0 8px 28px rgba(0,0,0,.18); font-size: 13px; }
220
+ .pbx-ai-menu__h { padding: 6px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--pb-fg-muted); }
221
+ .pbx-ai-menu__it { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--pb-fg); font: inherit; text-align: left; cursor: pointer; }
222
+ .pbx-ai-menu__it:hover, .pbx-ai-menu__it:focus-visible { background: var(--pb-surface-2); outline: 0; }
223
+ .pbx-ai-menu__it.is-on { font-weight: 600; }
224
+ .pbx-ai-menu__l { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pbx-ai-menu__s { color: var(--pb-fg-muted); font-weight: 400; }
225
+ .pbx-ai-menu__ck { flex: none; display: inline-flex; color: var(--pb-primary); }
226
+ .pbx-ai-menu__sep { margin: 6px 4px; border: 0; border-top: 1px solid var(--pb-border); }
227
+ .pbx-ai-menu__q { width: 100%; box-sizing: border-box; margin: 0 0 4px; padding: 6px 8px; border: 1px solid var(--pb-border); border-radius: 6px; background: var(--pb-bg); color: var(--pb-fg); font: inherit; }
228
+ .pbx-ai-seg { display: flex; gap: 2px; padding: 2px; margin: 0 4px 4px; border-radius: 8px; background: var(--pb-surface-2); }
229
+ .pbx-ai-seg__b { flex: 1 1 0; min-width: 0; padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: var(--pb-fg-muted); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
230
+ .pbx-ai-seg__b.is-on { background: var(--pb-surface); color: var(--pb-fg); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
231
+ /* th\u1EBB AI h\u1ECFi / xin quy\u1EC1n khi \u0111ang ch\u1EA1y */
232
+ .pbx-ai-live { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--pb-primary); border-radius: var(--pb-radius); background: var(--pb-primary-soft); }
233
+ .pbx-ai-live--permit { border-color: var(--pb-pending); background: var(--pb-pending-bg); }
234
+ .pbx-ai-live.is-done { border-color: var(--pb-border); background: var(--pb-surface); }
235
+ .pbx-ai-live__h { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
236
+ .pbx-ai-live__h > span { display: inline-flex; }
237
+ .pbx-ai-live__cmd { display: block; padding: 6px 8px; border-radius: 6px; background: var(--pb-surface); font-family: var(--pb-font-mono); font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
238
+ .pbx-ai-live__acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
239
+ .pbx-ai-q { display: grid; gap: 6px; } .pbx-ai-q > .pb-badge { justify-self: start; }
240
+ .pbx-ai-q__t { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
241
+ .pbx-ai-q__opts { display: grid; gap: 4px; }
242
+ .pbx-ai-opt { display: flex; align-items: flex-start; gap: 8px; width: 100%; padding: 7px 9px; border: 1px solid var(--pb-border); border-radius: 8px; background: var(--pb-surface); color: var(--pb-fg); font: inherit; text-align: left; cursor: pointer; }
243
+ .pbx-ai-opt:hover:not(:disabled) { border-color: var(--pb-primary); }
244
+ .pbx-ai-opt.is-on { border-color: var(--pb-primary); box-shadow: inset 0 0 0 1px var(--pb-primary); }
245
+ .pbx-ai-opt:disabled { cursor: default; opacity: .7; }
246
+ .pbx-ai-opt__n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 4px; background: var(--pb-surface-2); color: var(--pb-fg-muted); font-size: 11px; font-weight: 600; }
247
+ .pbx-ai-opt__b { display: grid; gap: 1px; min-width: 0; } .pbx-ai-opt__l { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
248
+ .pbx-ai-opt__d { font-size: 12px; color: var(--pb-fg-muted); overflow-wrap: anywhere; }
249
+ .pbx-ai-q__other { font-size: 13px; }
250
+ .pbx-ai-result--quiet { display: flex; padding: 0 2px; border: 0; background: none; color: var(--pb-fg-muted); font-size: 12px; }
251
+ .pbx-ai-result--quiet > span { display: inline-flex; align-items: center; gap: 4px; }
252
+ /* d\xF2ng tr\u1EA1ng th\xE1i l\u01B0\u1EE3t \u0111ang ch\u1EA1y + kh\u1ED1i \xAB\u0110\xE3 l\xE0m trong Xs\xBB (nh\u01B0 Cursor) */
253
+ .pbx-ai-status { display: flex; align-items: baseline; gap: 6px; padding: 2px 2px; font-size: 13px; color: var(--pb-fg-muted); }
254
+ .pbx-ai-status__t { color: var(--pb-fg-muted); animation: pbx-ai-breathe 1.6s ease-in-out infinite; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
255
+ .pbx-ai-status__s { flex: none; font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }
256
+ @keyframes pbx-ai-breathe { 50% { opacity: .45; } }
257
+ @media (prefers-reduced-motion: reduce) { .pbx-ai-status__t { animation: none; } }
258
+ .pbx-ai-work { display: grid; gap: 8px; font-size: 13px; color: var(--pb-fg-muted); }
259
+ .pbx-ai-work__h { display: flex; align-items: baseline; gap: 6px; cursor: pointer; list-style: none; padding: 2px; border-radius: 6px; user-select: none; }
260
+ .pbx-ai-work__h::-webkit-details-marker { display: none; }
261
+ .pbx-ai-work__h::after { content: ''; flex: none; width: 6px; height: 6px; margin-left: 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
262
+ .pbx-ai-work[open] > .pbx-ai-work__h::after { transform: translateY(1px) rotate(-135deg); }
263
+ .pbx-ai-work__h:hover { color: var(--pb-fg); }
264
+ .pbx-ai-work--flat .pbx-ai-work__h, .pbx-ai-work--flat { cursor: default; }
265
+ .pbx-ai-work__m { opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
266
+ .pbx-ai-work[open] { padding-left: 8px; border-left: 2px solid var(--pb-border); }
267
+ .pbx-ai-chip__e { display: inline-flex; }
268
+ .pbx-ai-menu__ico { display: inline-flex; vertical-align: -2px; margin-right: 8px; }
269
+ .pbx-ai-dot[data-status="ask"] { background: var(--pb-pending); animation: pbx-ai-pulse 1s ease-in-out infinite; }
197
270
  /* nhi\u1EC1u cu\u1ED9c tr\xF2 chuy\u1EC7n song song (tab) + agent con (18/11/2026) */
198
271
  .pbx-ai-tabs { flex: none; display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
199
272
  .pbx-ai-tabwrap { display: inline-flex; align-items: center; flex: none; }
@@ -234,7 +307,6 @@ var nb=Object.create;var pa=Object.defineProperty;var rb=Object.getOwnPropertyDe
234
307
  .pbx-st label[hidden] { display: none; }
235
308
  /* thu\u1ED9c t\xEDnh hidden th\u1EAFng display c\u1EE7a l\u1EDBp (.pb-btn / grid) \u2014 n\xFAt D\u1EEBng, \xF4 tr\u1EA3 l\u1EDDi */
236
309
  .pbx-ai [hidden], .pbx-cm [hidden], .pbx-cm-replybox[hidden] { display: none !important; }
237
- .pbx-ai-pick .pb-select, .pbx-ai-pick .pb-combo { width: auto; flex: 1 1 6.5rem; min-width: 6.5rem; }
238
310
  /* 4 tab panel ph\u1EA3i (Thu\u1ED9c t\xEDnh \xB7 B\xECnh lu\u1EADn \xB7 Tr\u1EE3 l\xFD AI \xB7 Tham chi\u1EBFu) tr\xEAn m\u1ED9t h\xE0ng; h\u1EB9p th\xEC cu\u1ED9n ngang */
239
311
  .pb-right__tabs .pb-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
240
312
  .pb-right__tabs .pb-tab { padding: 0 6px; white-space: nowrap; flex: 0 0 auto; }
@@ -1640,6 +1712,19 @@ tr.pb-flash > td { animation: pb-flash 1.2s ease-out 1 both; }
1640
1712
  toggle: function () { return theme.set(theme.isDark() ? 'light' : 'dark'); },
1641
1713
  };
1642
1714
  if (mqDark && mqDark.addEventListener) mqDark.addEventListener('change', function () { if (theme.get() === 'system') { var d = theme.apply(); emit('theme', { mode: 'system', dark: d }); } });
1715
+ // Nh\xFAng trong Pan Studio Desktop (04/12/2026): s\xE1ng / t\u1ED1i \u0111\u1EB7t \u1EDF thanh workspace c\u1EE7a app (n\xFAt bi\u1EC3u t\u01B0\u1EE3ng c\u1EA1nh \xF4 ng\xF4n ng\u1EEF) \u2014
1716
+ // ?theme= l\xFAc m\u1EDF, postMessage { panStudio: 'theme' } khi \u0111\u1ED5i (kh\xF4ng t\u1EA3i l\u1EA1i trang); \u0111\u1ED5i trong menu t\xE0i kho\u1EA3n th\xEC b\xE1o app theo.
1717
+ var embedded = /[?&]host=desktop\\b/.test(W.location.search) && W.parent !== W;
1718
+ try { var qTheme = new URLSearchParams(W.location.search).get('theme'); if (embedded && (qTheme === 'light' || qTheme === 'dark')) store('panba.theme', qTheme); } catch (e) { /* URL l\u1EA1 */ }
1719
+ if (embedded) {
1720
+ W.addEventListener('message', function (ev) {
1721
+ var m = ev.data;
1722
+ if (ev.source !== W.parent || !m || m.panStudio !== 'theme' || (m.mode !== 'light' && m.mode !== 'dark')) return;
1723
+ if (theme.get() !== m.mode) { fromApp = true; theme.set(m.mode); fromApp = false; }
1724
+ });
1725
+ }
1726
+ var fromApp = false;
1727
+ on('theme', function (x) { if (embedded && !fromApp) W.parent.postMessage({ panBa: 'theme', mode: x.dark ? 'dark' : 'light' }, '*'); });
1643
1728
 
1644
1729
  /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 li\xEAn k\u1EBFt \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1645
1730
  var SCREENS = [
@@ -2446,8 +2531,8 @@ tr.pb-flash > td { animation: pb-flash 1.2s ease-out 1 both; }
2446
2531
  { id: 'giong-doc', label: 'Gi\u1ECDng \u0111\u1ECDc', desc: 'L\u1ED3ng ti\u1EBFng, k\u1ECBch b\u1EA3n \u0111\u1ECDc', ico: 'mic' },
2447
2532
  { id: 'tai-lieu-ba', label: 'T\xE0i li\u1EC7u BA', desc: '\u0110\u1EB7c t\u1EA3, tham chi\u1EBFu, xu\u1EA5t DOCX/PDF', ico: 'file-text' },
2448
2533
  { id: 'test-docs', label: 'T\xE0i li\u1EC7u ki\u1EC3m th\u1EED', desc: 'K\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED, k\u1EBFt qu\u1EA3, xu\u1EA5t b\xE0n giao', ico: 'check' },
2449
- // Handoff Document: t\xEAn chung cho c\u1EA3 b\xE0n giao ki\u1EC3u kho\xE1 h\u1ECDc l\u1EABn ki\u1EC3u t\xE0i li\u1EC7u (04/12/2026)
2450
- { id: 'handover-docs', label: 'Handoff Document', desc: 'H\u01B0\u1EDBng d\u1EABn c\xE0i \u0111\u1EB7t, v\u1EADn h\xE0nh, s\u1EED d\u1EE5ng \u2014 kho\xE1 h\u1ECDc ho\u1EB7c t\xE0i li\u1EC7u, xu\u1EA5t Word', ico: 'package' },
2534
+ // Handover Document: t\xEAn chung cho c\u1EA3 b\xE0n giao ki\u1EC3u kho\xE1 h\u1ECDc l\u1EABn ki\u1EC3u t\xE0i li\u1EC7u (04/12/2026)
2535
+ { id: 'handover-docs', label: 'Handover Document', desc: 'H\u01B0\u1EDBng d\u1EABn c\xE0i \u0111\u1EB7t, v\u1EADn h\xE0nh, s\u1EED d\u1EE5ng \u2014 kho\xE1 h\u1ECDc ho\u1EB7c t\xE0i li\u1EC7u, xu\u1EA5t Word', ico: 'package' },
2451
2536
  ];
2452
2537
  var ROLE_LABEL = { ba: 'BA', 'ba-lead': 'BA Lead', designer: 'Designer' };
2453
2538
  var refs = {};
@@ -3243,6 +3328,43 @@ tr.pb-flash > td { animation: pb-flash 1.2s ease-out 1 both; }
3243
3328
  'G\u1EEDi': 'Send',
3244
3329
  'D\u1EEBng': 'Stop',
3245
3330
  'Cu\u1ED9c m\u1EDBi': 'New chat',
3331
+ '\u0110ang nh\u1EADn vi\u1EC7c\u2026': 'Getting started\u2026',
3332
+ '\u0110ang suy ngh\u0129\u2026': 'Thinking\u2026',
3333
+ '\u0110ang ch\u1EDD b\u1EA1n tr\u1EA3 l\u1EDDi': 'Waiting for your answer',
3334
+ '\u0110ang vi\u1EBFt\u2026': 'Writing\u2026',
3335
+ 'Agent con \u0111ang l\xE0m\u2026': 'Sub-agent working\u2026',
3336
+ '\u0110ang \u0111\u1ECDc': 'Reading',
3337
+ '\u0110ang t\xECm': 'Searching',
3338
+ '\u0110ang ch\u1EA1y': 'Running',
3339
+ '\u0110\xE3 d\u1EEBng sau {s}': 'Stopped after {s}',
3340
+ 'L\u1ED7i sau {s}': 'Failed after {s}',
3341
+ '\u0110\xE3 l\xE0m trong {s}': 'Worked for {s}',
3342
+ '\u0111\u1ECDc {n} t\u1EC7p': 'read {n} files',
3343
+ 't\xECm {n} l\u1EA7n': '{n} searches',
3344
+ 's\u1EEDa {n} t\u1EC7p': 'edited {n} files',
3345
+ 'ch\u1EA1y {n} l\u1EC7nh': 'ran {n} commands',
3346
+ '{n} agent con': '{n} sub-agents',
3347
+ 'Nh\u1EAFn AI': 'Message the AI',
3348
+ 'Nh\u1EAFn AI\u2026 (Enter g\u1EEDi, Shift+Enter xu\u1ED1ng d\xF2ng)': 'Message the AI\u2026 (Enter to send, Shift+Enter for a new line)',
3349
+ 'G\u1EEDi (Enter)': 'Send (Enter)',
3350
+ 'Cu\u1ED9c m\u1EDBi \u2014 c\xE1c cu\u1ED9c \u0111ang ch\u1EA1y v\u1EABn ch\u1EA1y song song': 'New chat \u2014 running chats keep running in parallel',
3351
+ 'm\u1EB7c \u0111\u1ECBnh': 'default',
3352
+ 'T\xECm model': 'Search models',
3353
+ 'Kh\xF4ng c\xF2n ch\u1EDD tr\u1EA3 l\u1EDDi.': 'No longer waiting for an answer.',
3354
+ 'G\u1EEDi tr\u1EA3 l\u1EDDi': 'Send answer',
3355
+ '\u0110\xE3 tr\u1EA3 l\u1EDDi: {a}': 'Answered: {a}',
3356
+ 'AI \u0111ang h\u1ECFi b\u1EA1n': 'The AI is asking you',
3357
+ 'C\xE2u tr\u1EA3 l\u1EDDi kh\xE1c\u2026': 'Other answer\u2026',
3358
+ 'C\xE2u tr\u1EA3 l\u1EDDi kh\xE1c': 'Other answer',
3359
+ 'AI xin quy\u1EC1n: {t}': 'The AI asks permission: {t}',
3360
+ 'Cho ph\xE9p': 'Allow',
3361
+ '\u0110\xE3 cho ph\xE9p.': 'Allowed.',
3362
+ '\u0110\xE3 lu\xF4n cho ph\xE9p (m\xE1y n\xE0y, repo n\xE0y).': 'Always allowed (this machine, this repo).',
3363
+ 'T\u1EEB ch\u1ED1i': 'Deny',
3364
+ '\u0110\xE3 t\u1EEB ch\u1ED1i.': 'Denied.',
3365
+ 'Cu\u1ED9c \xAB{t}\xBB \u0111ang h\u1ECFi b\u1EA1n.': 'Chat \u201C{t}\u201D is asking you.',
3366
+ 'Cu\u1ED9c \xAB{t}\xBB \u0111ang xin quy\u1EC1n.': 'Chat \u201C{t}\u201D asks for permission.',
3367
+ 'Kh\xF4ng c\xF2n ch\u1EDD \u2014 l\u01B0\u1EE3t \u0111\xE3 k\u1EBFt th\xFAc.': 'No longer waiting \u2014 the turn has ended.',
3246
3368
  // nhi\u1EC1u cu\u1ED9c song song + agent con (18/11/2026)
3247
3369
  'C\xE1c cu\u1ED9c tr\xF2 chuy\u1EC7n AI': 'AI chats',
3248
3370
  'M\u1EDF cu\u1ED9c tr\xF2 chuy\u1EC7n m\u1EDBi \u2014 c\xE1c cu\u1ED9c \u0111ang ch\u1EA1y v\u1EABn ch\u1EA1y song song': 'Open a new chat \u2014 running chats keep going in parallel',
@@ -4380,6 +4502,17 @@ function openTab(id) {
4380
4502
  // ch\u1EA1y \u21D2 t\u1EF1 m\u1EDF cu\u1ED9c m\u1EDBi. Agent con (Claude tool Agent / Cursor task) hi\u1EC7n th\xE0nh th\u1EBB trong b\u1EA3n ghi; b\u1EA5m xem vi\u1EC7c \u0111\u01B0\u1EE3c giao,
4381
4503
  // c\xE1c b\u01B0\u1EDBc, k\u1EBFt qu\u1EA3. T\u1EA3i l\u1EA1i trang \u21D2 d\u1EF1ng l\u1EA1i tab cho c\xE1c l\u01B0\u1EE3t c\xF2n ch\u1EA1y (server gi\u1EEF l\u01B0\u1EE3t).
4382
4504
  const S = { engines: [], engine: '', model: '', effort: '', max: 4 };
4505
+ // Bi\u1EC3u t\u01B0\u1EE3ng nh\xE0 cung c\u1EA5p (v\u1EBD g\u1ECDn, kh\xF4ng ph\u1EA3i logo ch\xEDnh th\u1EE9c) \u2014 chip model ch\u1EC9 hi\u1EC7n bi\u1EC3u t\u01B0\u1EE3ng, di chu\u1ED9t th\u1EA5y t\xEAn.
4506
+ const ENGINE_ICON = {
4507
+ claude: '<svg width="14" height="14" viewBox="0 0 24 24" aria-hidden="true"><g stroke="#D97757" stroke-width="2.6" stroke-linecap="round"><path d="M12 3v18M3 12h18M5.6 5.6l12.8 12.8M18.4 5.6 5.6 18.4"/></g></svg>',
4508
+ codex: '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M12 2.5 20.2 7.2v9.6L12 21.5l-8.2-4.7V7.2z"/><path d="m9 9.5 2.5 2.5L9 14.5M13 15h3"/></svg>',
4509
+ cursor: '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M12 2.5 20.2 7.2v9.6L12 21.5l-8.2-4.7V7.2z"/><path d="M3.8 7.2 12 12l8.2-4.8M12 12v9.5" opacity=".55"/></svg>',
4510
+ };
4511
+ const engineIcon = (id) => ENGINE_ICON[id] || ENGINE_ICON.codex;
4512
+ const SVG = {
4513
+ up: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19V5"/><path d="m5 12 7-7 7 7"/></svg>',
4514
+ stop: '<svg width="12" height="12" viewBox="0 0 24 24" aria-hidden="true"><rect x="5" y="5" width="14" height="14" rx="2.5" fill="currentColor"/></svg>',
4515
+ };
4383
4516
  let el = null; // c\xE1c ph\u1EA7n t\u1EED c\u1EE7a panel
4384
4517
  let CONVS = [];
4385
4518
  let active = null;
@@ -4413,25 +4546,35 @@ async function initAi(panel) {
4413
4546
  pick: h('div', { class: 'pbx-ai-pick' }), ctx: h('div', { class: 'pbx-ai-ctx', 'data-testid': 'ai-ctx' }), quick: h('div', { class: 'pbx-ai-quick' }),
4414
4547
  tabs: h('div', { class: 'pbx-ai-tabs', role: 'tablist', 'aria-label': T('C\xE1c cu\u1ED9c tr\xF2 chuy\u1EC7n AI'), 'data-testid': 'ai-tabs' }),
4415
4548
  logBox: h('div', { class: 'pbx-ai-logbox' }),
4416
- input: h('textarea', { class: 'pb-textarea pbx-ai-input', rows: '3', 'data-testid': 'ai-input', placeholder: T('Nh\u1EAFn AI\u2026 (Ctrl+Enter \u0111\u1EC3 g\u1EEDi)') }),
4549
+ input: h('textarea', { class: 'pbx-ai-input', rows: '1', 'data-testid': 'ai-input', 'aria-label': T('Nh\u1EAFn AI'), placeholder: T('Nh\u1EAFn AI\u2026 (Enter g\u1EEDi, Shift+Enter xu\u1ED1ng d\xF2ng)') }),
4417
4550
  };
4418
- el.send = btn(T('G\u1EEDi'), { kind: 'primary', icon: 'sparkles', testid: 'ai-send', onClick: () => sendFree() });
4419
- el.stop = btn(T('D\u1EEBng'), { kind: 'danger', icon: 'x', testid: 'ai-stop', onClick: () => stop() });
4551
+ // Khung so\u1EA1n nh\u01B0 Cursor / VS Code / Claude (04/12/2026): \xF4 nh\u1EADp t\u1EF1 gi\xE3n; thanh d\u01B0\u1EDBi trong c\xF9ng khung: chip c\xF4ng c\u1EE5\xB7model\xB7m\u1EE9c suy
4552
+ // ngh\u0129 (b\u1EA5m m\u1EDF menu) \u2014 n\xFAt D\u1EEBng / G\u1EEDi tr\xF2n b\xEAn ph\u1EA3i. \xABCu\u1ED9c m\u1EDBi\xBB l\xE0 n\xFAt + c\u1EA1nh c\xE1c tab.
4553
+ el.send = h('button', { type: 'button', class: 'pbx-ai-send', 'data-testid': 'ai-send', title: T('G\u1EEDi (Enter)'), 'aria-label': T('G\u1EEDi'), html: SVG.up });
4554
+ el.send.addEventListener('click', () => sendFree());
4555
+ el.stop = h('button', { type: 'button', class: 'pbx-ai-stopbtn', 'data-testid': 'ai-stop', title: T('D\u1EEBng'), html: SVG.stop + '<span>' + T('D\u1EEBng') + '</span>' });
4556
+ el.stop.addEventListener('click', () => stop());
4420
4557
  el.stop.hidden = true;
4421
- el.fresh = btn(T('Cu\u1ED9c m\u1EDBi'), { kind: 'ghost', icon: 'plus', testid: 'ai-new', title: T('M\u1EDF cu\u1ED9c tr\xF2 chuy\u1EC7n m\u1EDBi \u2014 c\xE1c cu\u1ED9c \u0111ang ch\u1EA1y v\u1EABn ch\u1EA1y song song'), onClick: () => { const c = active && !active.run && !active.used ? active : newConv(); show(c); el.input.focus(); } });
4422
- el.input.addEventListener('keydown', (e) => { if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) { e.preventDefault(); sendFree(); } });
4558
+ el.fresh = h('button', { type: 'button', class: 'pbx-ai-iconbtn', 'data-testid': 'ai-new', title: T('Cu\u1ED9c m\u1EDBi \u2014 c\xE1c cu\u1ED9c \u0111ang ch\u1EA1y v\u1EABn ch\u1EA1y song song'), 'aria-label': T('Cu\u1ED9c m\u1EDBi'), html: C.P.icon('plus', { size: 16 }) });
4559
+ el.fresh.addEventListener('click', () => { const c = active && !active.run && !active.used ? active : newConv(); show(c); el.input.focus(); });
4560
+ const grow = () => { el.input.style.height = 'auto'; el.input.style.height = Math.min(el.input.scrollHeight, 200) + 'px'; };
4561
+ el.input.addEventListener('input', grow);
4562
+ // Enter g\u1EEDi (b\u1ECF qua khi b\u1ED9 g\xF5 ti\u1EBFng Vi\u1EC7t \u0111ang gh\xE9p ch\u1EEF \u2014 isComposing); Shift+Enter xu\u1ED1ng d\xF2ng; Ctrl/\u2318+Enter v\u1EABn g\u1EEDi.
4563
+ el.input.addEventListener('keydown', (e) => { if (e.key === 'Enter' && !e.shiftKey && !e.isComposing && e.keyCode !== 229) { e.preventDefault(); sendFree(); } });
4423
4564
  el.pick.appendChild(h('span', { class: 'pb-small pb-muted', 'data-testid': 'ai-detecting' }, T('\u0110ang t\xECm Claude Code / Codex / Cursor tr\xEAn m\xE1y\u2026')));
4424
- panel.replaceChildren(h('div', { class: 'pbx-ai', 'data-testid': 'ai-panel' }, el.pick, el.ctx, el.quick, el.tabs, el.logBox,
4425
- h('div', { class: 'pbx-ai-compose' }, el.input, h('div', { class: 'pb-row' }, el.fresh, h('span', { class: 'pbx-grow' }), el.stop, el.send))));
4565
+ const box = h('div', { class: 'pbx-ai-box' }, el.input, h('div', { class: 'pbx-ai-bar' }, el.pick, h('span', { class: 'pbx-grow' }), el.stop, el.send));
4566
+ box.addEventListener('click', (e) => { if (e.target === box) el.input.focus(); });
4567
+ panel.replaceChildren(h('div', { class: 'pbx-ai', 'data-testid': 'ai-panel' }, el.ctx, el.quick, h('div', { class: 'pbx-ai-head' }, el.tabs, h('span', { class: 'pbx-grow' }), el.fresh), el.logBox, box));
4426
4568
  const r = await api('api/ai');
4427
4569
  S.engines = r.json.engines || [];
4428
4570
  S.max = r.json.max || 4;
4429
4571
  const saved = store('panba.ai') || {};
4430
4572
  const eng = S.engines.find((e) => e.id === saved.engine) || S.engines[0];
4431
4573
  if (!eng) {
4432
- el.pick.replaceChildren(h('div', { class: 'pb-empty', 'data-testid': 'ai-none' }, h('div', { class: 'pb-empty__title' }, T('M\xE1y ch\u01B0a c\xF3 CLI AI')),
4574
+ el.logBox.replaceChildren(h('div', { class: 'pb-empty', 'data-testid': 'ai-none' }, h('div', { class: 'pb-empty__title' }, T('M\xE1y ch\u01B0a c\xF3 CLI AI')),
4433
4575
  h('p', { class: 'pb-empty__text' }, T('C\xE0i v\xE0 \u0111\u0103ng nh\u1EADp m\u1ED9t trong: Claude Code (claude), Codex (codex), Cursor (cursor-agent). Kh\xF4ng c\u1EA7n API key \u2014 d\xF9ng t\xE0i kho\u1EA3n c\u1EE7a b\u1EA1n.')),
4434
4576
  h('p', { class: 'pb-empty__text' }, T('\u0110\xE3 c\xE0i m\xE0 v\u1EABn kh\xF4ng th\u1EA5y? Ch\xE9p nh\u1EADt k\xFD g\u1EEDi \u0111\u1ED9i ph\xE1t tri\u1EC3n:')), logButton()));
4577
+ el.pick.replaceChildren();
4435
4578
  el.send.disabled = true; el.input.disabled = true;
4436
4579
  return;
4437
4580
  }
@@ -4448,10 +4591,12 @@ async function initAi(panel) {
4448
4591
  const c = newConv(shortText(list[0].label, 40));
4449
4592
  c.id = k; c.used = true;
4450
4593
  for (const x of list) {
4451
- bubble(c, 'user', x.say || x.label);
4594
+ c.turnStart = bubble(c, 'user', x.say || x.label);
4452
4595
  Object.assign(c, { run: x.id, task: x.task, extra: {}, count: 0, cur: null, engine: x.engine, session: x.session || c.session, sessionEngine: x.engine });
4453
- if (x.status === 'running') { c.status = 'running'; listen(c, x.id, 0); continue; }
4596
+ if (x.status === 'running') { c.status = 'running'; c.t0 = Date.parse(x.startedAt) || Date.now(); status(c, T('\u0110ang suy ngh\u0129\u2026')); listen(c, x.id, 0); continue; }
4597
+ c.replaying = true;
4454
4598
  for (const e of x.events || []) { onEvent(c, e); c.count++; }
4599
+ c.replaying = false;
4455
4600
  finish(c, x.end || { t: 'end', status: x.status, files: [] }, { quiet: true });
4456
4601
  }
4457
4602
  }
@@ -4459,20 +4604,84 @@ async function initAi(panel) {
4459
4604
  }
4460
4605
  const engineOf = () => S.engines.find((e) => e.id === S.engine) || {};
4461
4606
  function effortsOf() { const e = engineOf(); const m = (e.models || []).find((x) => x.id === S.model); return (m && m.efforts && m.efforts.length ? m.efforts : e.efforts) || []; }
4607
+ // Ch\u1ECDn c\xF4ng c\u1EE5 \xB7 model \xB7 m\u1EE9c suy ngh\u0129 G\u1ECCN nh\u01B0 Cursor (04/12/2026): m\u1ED9t chip trong thanh so\u1EA1n, b\u1EA5m m\u1EDF menu n\u1ED5i \u2014 m\u1EE5c C\xF4ng c\u1EE5,
4608
+ // Model (c\xF3 \xF4 t\xECm khi nhi\u1EC1u), M\u1EE9c suy ngh\u0129 (n\xFAt li\u1EC1n). Tr\u01B0\u1EDBc \u0111\xE2y ba \xF4 ch\u1ECDn to chi\u1EBFm c\u1EA3 m\u1ED9t h\xE0ng c\u1EE7a khung h\u1EB9p.
4609
+ const saveChoice = () => store('panba.ai', { engine: S.engine, model: S.model, effort: S.effort });
4462
4610
  function renderPick() {
4463
4611
  const h = C.h; const e = engineOf();
4464
- const sel = (opts, value, testid, label, on) => {
4465
- const s = h('select', { class: 'pb-select pbx-ai-sel', 'data-testid': testid, 'aria-label': label }, opts.map(([v, l]) => h('option', { value: v, selected: v === value || null }, l)));
4466
- s.addEventListener('change', () => on(s.value)); return s;
4612
+ const m = (e.models || []).find((x) => x.id === S.model);
4613
+ const chip = h('button', { type: 'button', class: 'pbx-ai-chip', 'data-testid': 'ai-pick', 'aria-haspopup': 'menu', 'aria-expanded': 'false',
4614
+ title: [e.label, m ? m.label : S.model, S.effort].filter(Boolean).join(' \xB7 ') },
4615
+ h('span', { class: 'pbx-ai-chip__e', 'aria-label': e.label || '', html: engineIcon(e.id) }), h('span', { class: 'pbx-ai-chip__m' }, m ? m.label : (S.model || T('m\u1EB7c \u0111\u1ECBnh'))),
4616
+ S.effort && effortsOf().length ? h('span', { class: 'pbx-ai-chip__x' }, S.effort) : null, h('span', { class: 'pbx-ai-chip__c', html: C.P.icon('chevron-down', { size: 14 }) }));
4617
+ chip.addEventListener('click', (ev) => { ev.stopPropagation(); pickMenu(chip); });
4618
+ el.pick.replaceChildren(chip);
4619
+ }
4620
+ const shortEngine = (e) => ({ claude: 'Claude', codex: 'Codex', cursor: 'Cursor' })[e.id] || e.label || '';
4621
+ function pickMenu(anchor) {
4622
+ const h = C.h;
4623
+ const old = document.querySelector('.pbx-ai-menu');
4624
+ if (old) { old.__close(); return; }
4625
+ const menu = h('div', { class: 'pbx-ai-menu', role: 'menu', 'data-testid': 'ai-menu' });
4626
+ const close = () => { menu.remove(); anchor.setAttribute('aria-expanded', 'false'); document.removeEventListener('mousedown', outside, true); document.removeEventListener('keydown', key, true); };
4627
+ menu.__close = close;
4628
+ const outside = (ev) => { if (!menu.contains(ev.target) && ev.target !== anchor && !anchor.contains(ev.target)) close(); };
4629
+ const key = (ev) => { if (ev.key === 'Escape') { ev.stopPropagation(); close(); anchor.focus(); } };
4630
+ const item = (label, sub, on, testid, value, pick) => {
4631
+ const b = h('button', { type: 'button', role: 'menuitemradio', 'aria-checked': String(on), class: 'pbx-ai-menu__it' + (on ? ' is-on' : ''), 'data-testid': testid, 'data-value': value },
4632
+ h('span', { class: 'pbx-ai-menu__l' }, label, sub ? (typeof sub === 'string' && label && typeof label === 'string' ? h('span', { class: 'pbx-ai-menu__s' }, ' ' + sub) : sub) : null), on ? h('span', { class: 'pbx-ai-menu__ck', html: C.P.icon('check', { size: 14 }) }) : null);
4633
+ b.addEventListener('click', () => { pick(); saveChoice(); renderPick(); paint(); });
4634
+ return b;
4467
4635
  };
4468
- const save = () => store('panba.ai', { engine: S.engine, model: S.model, effort: S.effort });
4469
- const efforts = effortsOf();
4470
- // C\xF4ng c\u1EE5 kh\xF4ng c\xF3 m\u1EE9c suy ngh\u0129 (Cursor) \u21D2 b\u1ECF h\u1EB3n \xF4 th\u1EE9 ba; replaceChildren(null) s\u1EBD in ch\u1EEF \xABnull\xBB.
4471
- el.pick.replaceChildren(...[
4472
- sel(S.engines.map((x) => [x.id, x.label]), S.engine, 'ai-engine', T('C\xF4ng c\u1EE5 AI'), (v) => { S.engine = v; const ne = engineOf(); S.model = ne.model; S.effort = ne.effort; save(); renderPick(); }),
4473
- sel((e.models || []).map((x) => [x.id, x.label]).concat((e.models || []).some((x) => x.id === S.model) || !S.model ? [] : [[S.model, S.model]]), S.model, 'ai-model', T('Model'), (v) => { S.model = v; if (!effortsOf().includes(S.effort)) S.effort = effortsOf().includes('medium') ? 'medium' : (effortsOf()[0] || ''); save(); renderPick(); }),
4474
- efforts.length ? sel(efforts.map((x) => [x, x]), S.effort, 'ai-effort', T('M\u1EE9c suy ngh\u0129'), (v) => { S.effort = v; save(); }) : null,
4475
- ].filter(Boolean));
4636
+ const paint = () => {
4637
+ const e = engineOf(); const efforts = effortsOf();
4638
+ const parts = [];
4639
+ if (S.engines.length > 1) {
4640
+ parts.push(h('div', { class: 'pbx-ai-menu__h' }, T('C\xF4ng c\u1EE5 AI')));
4641
+ for (const x of S.engines) parts.push(item(h('span', { class: 'pbx-ai-menu__ico', html: engineIcon(x.id) }), x.label, x.id === S.engine, 'ai-engine-opt', x.id, () => { S.engine = x.id; const ne = engineOf(); S.model = ne.model; S.effort = ne.effort; }));
4642
+ parts.push(h('hr', { class: 'pbx-ai-menu__sep' }));
4643
+ }
4644
+ const models = (e.models || []).concat((e.models || []).some((x) => x.id === S.model) || !S.model ? [] : [{ id: S.model, label: S.model }]);
4645
+ parts.push(h('div', { class: 'pbx-ai-menu__h' }, T('Model')));
4646
+ const list = h('div', { class: 'pbx-ai-menu__list' });
4647
+ const fill = (q) => {
4648
+ const n = String(q || '').toLowerCase().normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');
4649
+ list.replaceChildren(...models.filter((x) => !n || (x.label + ' ' + x.id).toLowerCase().normalize('NFD').replace(/[\\u0300-\\u036f]/g, '').includes(n))
4650
+ .map((x) => item(x.label, '', x.id === S.model, 'ai-model-opt', x.id, () => { S.model = x.id; if (!effortsOf().includes(S.effort)) S.effort = effortsOf().includes('medium') ? 'medium' : (effortsOf()[0] || ''); })));
4651
+ };
4652
+ if (models.length > 8) {
4653
+ const q = h('input', { class: 'pbx-ai-menu__q', type: 'search', placeholder: T('T\xECm model'), 'aria-label': T('T\xECm model'), 'data-testid': 'ai-model-q' });
4654
+ q.addEventListener('input', () => fill(q.value));
4655
+ parts.push(q);
4656
+ setTimeout(() => q.focus(), 0);
4657
+ }
4658
+ fill('');
4659
+ parts.push(list);
4660
+ if (efforts.length) {
4661
+ parts.push(h('hr', { class: 'pbx-ai-menu__sep' }));
4662
+ parts.push(h('div', { class: 'pbx-ai-menu__h' }, T('M\u1EE9c suy ngh\u0129')));
4663
+ const seg = h('div', { class: 'pbx-ai-seg', role: 'radiogroup', 'aria-label': T('M\u1EE9c suy ngh\u0129') });
4664
+ for (const x of efforts) {
4665
+ const b = h('button', { type: 'button', role: 'radio', 'aria-checked': String(x === S.effort), class: 'pbx-ai-seg__b' + (x === S.effort ? ' is-on' : ''), 'data-testid': 'ai-effort-opt', 'data-value': x }, x);
4666
+ b.addEventListener('click', () => { S.effort = x; saveChoice(); renderPick(); paint(); });
4667
+ seg.appendChild(b);
4668
+ }
4669
+ parts.push(seg);
4670
+ }
4671
+ menu.replaceChildren(...parts);
4672
+ };
4673
+ paint();
4674
+ document.body.appendChild(menu);
4675
+ // m\u1EDF l\xEAn tr\xEAn chip (thanh so\u1EA1n \u1EDF \u0111\xE1y khung); kh\xF4ng \u0111\u1EE7 ch\u1ED7 th\xEC xu\u1ED1ng d\u01B0\u1EDBi
4676
+ const r = anchor.getBoundingClientRect();
4677
+ const mw = Math.min(280, window.innerWidth - 16);
4678
+ menu.style.width = mw + 'px';
4679
+ menu.style.left = Math.max(8, Math.min(r.left, window.innerWidth - mw - 8)) + 'px';
4680
+ const mh = menu.offsetHeight;
4681
+ if (r.top - mh - 6 >= 8) menu.style.top = (r.top - mh - 6) + 'px'; else menu.style.top = Math.min(r.bottom + 6, window.innerHeight - mh - 8) + 'px';
4682
+ anchor.setAttribute('aria-expanded', 'true');
4683
+ document.addEventListener('mousedown', outside, true);
4684
+ document.addEventListener('keydown', key, true);
4476
4685
  }
4477
4686
  /** Ng\u1EEF c\u1EA3nh + vi\u1EC7c nhanh theo m\u1EE5c / ph\xE2n h\u1EC7 \u0111ang ch\u1ECDn \u2014 g\u1ECDi l\u1EA1i m\u1ED7i khi ch\u1ECDn m\u1EE5c kh\xE1c. */
4478
4687
  export function renderCtx() {
@@ -4520,7 +4729,7 @@ function closeConv(conv) {
4520
4729
  const statusDot = (status) => C.h('span', { class: 'pbx-ai-dot', 'data-status': status, 'aria-hidden': 'true' });
4521
4730
  function renderTabs() {
4522
4731
  const h = C.h;
4523
- el.tabs.hidden = CONVS.length < 2;
4732
+ el.tabs.hidden = false; // lu\xF4n hi\u1EC7n d\u1EA3i tab (nh\u01B0 Cursor) \u2014 n\xFAt + n\u1EB1m cu\u1ED1i d\u1EA3i
4524
4733
  el.tabs.replaceChildren(...CONVS.map((c) => {
4525
4734
  const tab = h('button', { type: 'button', role: 'tab', class: 'pbx-ai-tab' + (c === active ? ' is-on' : ''), 'aria-selected': String(c === active), 'data-testid': 'ai-tab', 'data-status': c.status, title: c.title }, statusDot(c.status), h('span', { class: 'pbx-ai-tab__t' }, c.title));
4526
4735
  tab.addEventListener('click', () => show(c));
@@ -4542,19 +4751,47 @@ function bubble(conv, kind, text) {
4542
4751
  conv.log.appendChild(b); scrollDown(conv);
4543
4752
  return b;
4544
4753
  }
4545
- /** \xABAI \u0111ang nh\u1EADn vi\u1EC7c\u2026\xBB (ba ch\u1EA5m) t\u1EEB l\xFAc b\u1EA5m G\u1EEDi t\u1EDBi s\u1EF1 ki\u1EC7n \u0111\u1EA7u ti\xEAn c\u1EE7a l\u01B0\u1EE3t. */
4546
- function typing(conv, on) {
4547
- const old = conv.log.querySelector('[data-testid="ai-typing"]');
4548
- if (!on) { if (old) old.remove(); return; }
4549
- if (old) return;
4550
- conv.log.appendChild(C.h('div', { class: 'pbx-ai-typing', 'data-testid': 'ai-typing', role: 'status' }, C.h('span', { class: 'pbx-dots', 'aria-hidden': 'true' }, C.h('i'), C.h('i'), C.h('i')), T('AI \u0111ang nh\u1EADn vi\u1EC7c\u2026')));
4754
+ // D\xF2ng tr\u1EA1ng th\xE1i d\u01B0\u1EDBi c\xF9ng c\u1EE7a l\u01B0\u1EE3t \u0111ang ch\u1EA1y (nh\u01B0 Cursor / Claude): \xAB\u0110ang suy ngh\u0129\u2026 5s\xBB, \xAB\u0110ang \u0111\u1ECDc \u2026\xBB, \xAB\u0110ang vi\u1EBFt\u2026\xBB,
4755
+ // \xAB\u0110ang ch\u1EDD b\u1EA1n tr\u1EA3 l\u1EDDi\xBB \u2014 ch\u1EEF nh\u1EA1t c\xF3 \xE1nh ch\u1EA1y, \u0111\u1EBFm gi\xE2y. Xong l\u01B0\u1EE3t th\xEC b\u1ECF; c\xE1c b\u01B0\u1EDBc c\u1EE7a l\u01B0\u1EE3t g\u1EADp v\xE0o \xAB\u0110\xE3 l\xE0m trong Xs\xBB.
4756
+ const VERB = { read: '\u0110ang \u0111\u1ECDc', search: '\u0110ang t\xECm', edit: '\u0110ang s\u1EEDa', run: '\u0110ang ch\u1EA1y' };
4757
+ function toolKind(name) { const n = String(name || '').toLowerCase(); return n === 'read' || n === 'ls' ? 'read' : n === 'glob' || n === 'grep' ? 'search' : n === 'bash' || n === 'shell' || n === 'powershell' ? 'run' : n === 'todowrite' ? '' : 'edit'; }
4758
+ function status(conv, text) {
4759
+ const h = C.h;
4760
+ if (text === null) { if (conv.statusEl) conv.statusEl.remove(); conv.statusEl = null; if (conv.tick) clearInterval(conv.tick); conv.tick = null; return; }
4761
+ if (!conv.statusEl) {
4762
+ conv.statusText = h('span', { class: 'pbx-ai-status__t' }); conv.statusTime = h('span', { class: 'pbx-ai-status__s' });
4763
+ conv.statusEl = h('div', { class: 'pbx-ai-status', 'data-testid': 'ai-typing', role: 'status' }, conv.statusText, conv.statusTime);
4764
+ conv.t0 = conv.t0 || Date.now();
4765
+ const paint = () => { conv.statusTime.textContent = secs(Date.now() - conv.t0) || '0s'; };
4766
+ paint(); conv.tick = setInterval(paint, 1000);
4767
+ }
4768
+ if (text) conv.statusText.textContent = text;
4769
+ conv.log.appendChild(conv.statusEl); // lu\xF4n n\u1EB1m cu\u1ED1i
4551
4770
  scrollDown(conv);
4552
4771
  }
4772
+ /** K\xE9o d\xF2ng tr\u1EA1ng th\xE1i xu\u1ED1ng cu\u1ED1i sau khi th\xEAm ph\u1EA7n t\u1EED m\u1EDBi v\xE0o b\u1EA3n ghi. */
4773
+ function keepStatus(conv) { if (conv.statusEl) { conv.log.appendChild(conv.statusEl); scrollDown(conv); } }
4774
+ /** L\u01B0\u1EE3t xong: c\xE1c b\u01B0\u1EDBc (c\xF4ng c\u1EE5, agent con, l\u1EDDi gi\u1EEFa ch\u1EEBng, th\u1EBB h\u1ECFi) g\u1EADp v\xE0o \xAB\u0110\xE3 l\xE0m trong Xs \u2304\xBB; c\xE2u tr\u1EA3 l\u1EDDi cu\u1ED1i \u0111\u1EC3 ngo\xE0i. */
4775
+ function foldTurn(conv, e) {
4776
+ const h = C.h;
4777
+ const start = conv.turnStart; conv.turnStart = null;
4778
+ if (!start || start.parentNode !== conv.log) return;
4779
+ const nodes = []; for (let n = start.nextSibling; n; n = n.nextSibling) nodes.push(n);
4780
+ const steps = nodes.filter((n) => n !== conv.lastAi && n.matches && n.matches('.pbx-ai-tool, .pbx-ai-live, .pbx-ai-msg--ai'));
4781
+ const ms = e.ms || (conv.t0 ? Date.now() - conv.t0 : 0);
4782
+ const head = e.status === 'stopped' ? T('\u0110\xE3 d\u1EEBng sau {s}', { s: secs(ms) || '0s' }) : e.status === 'error' ? T('L\u1ED7i sau {s}', { s: secs(ms) || '0s' }) : T('\u0110\xE3 l\xE0m trong {s}', { s: secs(ms) || '1s' });
4783
+ const n = { read: 0, search: 0, edit: 0, run: 0 };
4784
+ for (const s of steps) if (s.dataset && s.dataset.tool) { const k = toolKind(s.dataset.tool); if (k) n[k]++; }
4785
+ const meta = [n.read ? T('\u0111\u1ECDc {n} t\u1EC7p', { n: n.read }) : '', n.search ? T('t\xECm {n} l\u1EA7n', { n: n.search }) : '', n.edit ? T('s\u1EEDa {n} t\u1EC7p', { n: n.edit }) : '', n.run ? T('ch\u1EA1y {n} l\u1EC7nh', { n: n.run }) : ''].filter(Boolean).join(', ');
4786
+ const sum = h('summary', { class: 'pbx-ai-work__h' }, h('span', null, head), meta ? h('span', { class: 'pbx-ai-work__m' }, meta) : null);
4787
+ const box = steps.length ? h('details', { class: 'pbx-ai-work', 'data-testid': 'ai-work' }, sum, ...steps) : h('div', { class: 'pbx-ai-work pbx-ai-work--flat', 'data-testid': 'ai-work' }, sum.firstChild);
4788
+ start.after(box);
4789
+ }
4553
4790
  function scrollDown(conv) { if (conv === active) conv.log.scrollTop = conv.log.scrollHeight; }
4554
4791
  function running(on) {
4555
4792
  el.stop.hidden = !on;
4556
4793
  if (!on || !el.stop.disabled) return;
4557
- el.stop.disabled = false; el.stop.replaceChildren(C.h('span', { html: C.P.icon('x', { size: 16 }) }), T('D\u1EEBng'));
4794
+ el.stop.disabled = false; el.stop.innerHTML = SVG.stop + '<span>' + T('D\u1EEBng') + '</span>';
4558
4795
  }
4559
4796
 
4560
4797
  /** Giao vi\u1EC7c cho AI t\u1EEB b\u1EA5t k\u1EF3 \u0111\xE2u trong UI (th\u1EBB m\u1EE5c, Ki\u1EC3m tra, m\u1EE5c ch\u1EDD, g\xF3p \xFD, b\xECnh lu\u1EADn). */
@@ -4590,12 +4827,13 @@ async function ask(task, extra) {
4590
4827
  if (!conv.used) conv.title = shortText(label, 40) || conv.title;
4591
4828
  conv.used = true;
4592
4829
  show(conv);
4593
- bubble(conv, 'user', say);
4594
- typing(conv, true);
4830
+ conv.turnStart = bubble(conv, 'user', say);
4831
+ conv.t0 = Date.now();
4832
+ status(conv, T('\u0110ang nh\u1EADn vi\u1EC7c\u2026'));
4595
4833
  renderTabs(); running(true);
4596
4834
  const r = await api('api/ai/run', body).finally(() => { conv.pending = false; });
4597
4835
  if (!r.ok) {
4598
- typing(conv, false);
4836
+ status(conv, null);
4599
4837
  bubble(conv, 'error', (r.json && r.json.error) || T('Kh\xF4ng g\u1EEDi \u0111\u01B0\u1EE3c ({s}).', { s: r.status }));
4600
4838
  if (conv === active) running(false);
4601
4839
  if (!wasUsed) conv.used = true;
@@ -4627,12 +4865,18 @@ function listen(conv, id, since) {
4627
4865
  function toolRow(e) {
4628
4866
  const h = C.h;
4629
4867
  // nh\xE3n + bi\u1EC3u t\u01B0\u1EE3ng kh\xF4ng bao gi\u1EDD co (t\u1EEBng xu\u1ED1ng d\xF2ng t\u1EEBng ch\u1EEF \xAB\u0110 / \u1ECD / c\xBB); ch\u1EC9 ph\u1EA7n \u0111\u01B0\u1EDDng d\u1EABn c\u1EAFt \xAB\u2026\xBB, di chu\u1ED9t xem \u0111\u1EE7
4630
- return h('div', { class: 'pbx-ai-tool', 'data-testid': 'ai-tool', title: e.detail || null },
4868
+ return h('div', { class: 'pbx-ai-tool', 'data-testid': 'ai-tool', 'data-tool': e.name || '', title: e.detail || null },
4631
4869
  h('span', { class: 'pbx-ai-tool__ico', html: C.P.icon(toolIcon(e.name), { size: 14 }) }),
4632
4870
  h('b', { class: 'pbx-ai-tool__n' }, T(TOOL[e.name] || e.name)), h('span', { class: 'pbx-ai-tool__d' }, e.detail || ''));
4633
4871
  }
4634
4872
  function onEvent(conv, e) {
4635
- typing(conv, false);
4873
+ if (conv.statusEl && e.t !== 'end') {
4874
+ const k = e.t === 'tool' && !e.agent ? toolKind(e.name) : '';
4875
+ status(conv, e.t === 'ask' || e.t === 'permit' ? T('\u0110ang ch\u1EDD b\u1EA1n tr\u1EA3 l\u1EDDi') : e.t === 'answered' ? T('\u0110ang suy ngh\u0129\u2026') : k ? T(VERB[k]) + ' ' + shortText(String(e.detail || '').split('/').pop(), 40) : e.t === 'text' && !e.agent ? T('\u0110ang vi\u1EBFt\u2026') : e.t === 'agent-start' || e.agent ? T('Agent con \u0111ang l\xE0m\u2026') : e.t === 'session' ? T('\u0110ang suy ngh\u0129\u2026') : '');
4876
+ }
4877
+ try { onEvent0(conv, e); } finally { if (e.t !== 'end') keepStatus(conv); }
4878
+ }
4879
+ function onEvent0(conv, e) {
4636
4880
  if (e.t === 'session') { conv.session = e.id; conv.sessionEngine = conv.engine || S.engine; return; }
4637
4881
  if (e.t === 'agent-start') { agentStart(conv, e); return; }
4638
4882
  if (e.t === 'agent-progress' || e.t === 'agent-end') { agentUpdate(conv, e); return; }
@@ -4643,6 +4887,8 @@ function onEvent(conv, e) {
4643
4887
  if (e.t === 'error') { conv.cur = null; bubble(conv, 'error', e.message); return; }
4644
4888
  if (e.t === 'choices') { conv.cur = null; conv.log.appendChild(choiceCard(conv, e.question, e.options)); scrollDown(conv); return; }
4645
4889
  if (e.t === 'denied') { conv.cur = null; conv.log.appendChild(deniedCard(conv, e)); scrollDown(conv); return; }
4890
+ if (e.t === 'ask' || e.t === 'permit') { conv.cur = null; liveCard(conv, e); return; }
4891
+ if (e.t === 'answered') { answered(conv, e.id, e.text); return; }
4646
4892
  if (e.t === 'done') { if (!conv.cur && e.text) conv.lastAi = bubble(conv, 'ai', e.text); conv.cur = null; return; }
4647
4893
  if (e.t === 'end') finish(conv, e);
4648
4894
  }
@@ -4706,6 +4952,84 @@ function deniedCard(conv, e) {
4706
4952
  return card;
4707
4953
  }
4708
4954
 
4955
+ // ---------------------------------------------------------------- h\u1ECFi / xin quy\u1EC1n NGAY khi \u0111ang ch\u1EA1y (Claude Code hai chi\u1EC1u)
4956
+ // Nh\u01B0 CLI: AI d\u1EEBng ch\u1EDD, th\u1EBB hi\u1EC7n d\u01B0\u1EDBi l\u1EDDi AI; BA b\u1EA5m \u21D2 POST api/ai/reply, AI l\xE0m ti\u1EBFp TRONG C\xD9NG l\u01B0\u1EE3t (kh\xF4ng m\u1EDF l\u01B0\u1EE3t m\u1EDBi).
4957
+ // Cu\u1ED9c kh\xF4ng \u0111ang xem \u21D2 b\xE1o + ch\u1EA5m tab m\xE0u ch\u1EDD. L\u01B0\u1EE3t k\u1EBFt th\xFAc m\xE0 ch\u01B0a tr\u1EA3 l\u1EDDi (D\u1EEBng, l\u1ED7i, d\u1EF1ng l\u1EA1i l\u1ECBch s\u1EED) \u21D2 th\u1EBB kho\xE1 l\u1EA1i.
4958
+ function liveCard(conv, e) {
4959
+ const h = C.h;
4960
+ const run = conv.run;
4961
+ conv.asks = conv.asks || new Map();
4962
+ const card = h('div', { class: 'pbx-ai-live' + (e.t === 'permit' ? ' pbx-ai-live--permit' : ''), 'data-testid': e.t === 'ask' ? 'ai-ask' : 'ai-permit', role: 'group' });
4963
+ const acts = h('div', { class: 'pbx-ai-live__acts' });
4964
+ const lock = (text) => { card.classList.add('is-done'); acts.replaceChildren(h('span', { class: 'pb-small pb-muted', 'data-testid': 'ai-live-done' }, text)); card.querySelectorAll('input,button').forEach((x) => { if (!acts.contains(x)) x.disabled = true; }); };
4965
+ const reply = async (body, label) => {
4966
+ acts.querySelectorAll('button,input').forEach((x) => { x.disabled = true; });
4967
+ const r = await api('api/ai/reply', Object.assign({ run, id: e.id }, body));
4968
+ if (!r.ok) { failToast(r); lock(T('Kh\xF4ng c\xF2n ch\u1EDD tr\u1EA3 l\u1EDDi.')); return; }
4969
+ lock(label);
4970
+ };
4971
+ if (e.t === 'ask') {
4972
+ const picks = new Map(); // c\xE2u h\u1ECFi \u2192 l\u1EF1a ch\u1ECDn (nhi\u1EC1u l\u1EF1a ch\u1ECDn: Set)
4973
+ const qs = e.questions || [];
4974
+ const send = h('button', { type: 'button', class: 'pb-btn pb-btn--primary pbx-btn-sm', 'data-testid': 'ai-ask-send', disabled: true }, T('G\u1EEDi tr\u1EA3 l\u1EDDi'));
4975
+ const ready = () => qs.every((q) => { const v = picks.get(q.question); return v && (typeof v === 'string' ? v.trim() : v.size); });
4976
+ const submit = () => {
4977
+ if (!ready()) return;
4978
+ const answers = Object.fromEntries(qs.map((q) => { const v = picks.get(q.question); return [q.question, typeof v === 'string' ? v.trim() : [...v].join(', ')]; }));
4979
+ reply({ answers }, T('\u0110\xE3 tr\u1EA3 l\u1EDDi: {a}', { a: Object.values(answers).join(' \xB7 ') }));
4980
+ };
4981
+ send.addEventListener('click', submit);
4982
+ // m\u1ED9t c\xE2u m\u1ED9t l\u1EF1a ch\u1ECDn \u21D2 b\u1EA5m l\xE0 g\u1EEDi lu\xF4n (nh\u01B0 CLI); nhi\u1EC1u c\xE2u / ch\u1ECDn nhi\u1EC1u \u21D2 ch\u1ECDn xong b\u1EA5m \xABG\u1EEDi tr\u1EA3 l\u1EDDi\xBB
4983
+ const quick = qs.length === 1 && !qs[0].multiSelect;
4984
+ card.appendChild(h('div', { class: 'pbx-ai-live__h' }, h('span', { html: C.P.icon('message', { size: 14 }) }), T('AI \u0111ang h\u1ECFi b\u1EA1n')));
4985
+ for (const q of qs) {
4986
+ const box = h('div', { class: 'pbx-ai-q' }, q.header ? h('span', { class: 'pb-badge' }, q.header) : null, h('div', { class: 'pbx-ai-q__t' }, q.question));
4987
+ const opts = h('div', { class: 'pbx-ai-q__opts', role: q.multiSelect ? 'group' : 'radiogroup' });
4988
+ const paint = () => opts.querySelectorAll('[data-testid="ai-ask-opt"]').forEach((b) => { const v = picks.get(q.question); const on = q.multiSelect ? !!(v && v.has && v.has(b.dataset.value)) : v === b.dataset.value; b.classList.toggle('is-on', on); b.setAttribute('aria-checked', String(on)); });
4989
+ q.options.forEach((o, i) => {
4990
+ const b = h('button', { type: 'button', class: 'pbx-ai-opt', role: q.multiSelect ? 'checkbox' : 'radio', 'aria-checked': 'false', 'data-testid': 'ai-ask-opt', 'data-value': o.label },
4991
+ h('span', { class: 'pbx-ai-opt__n' }, String(i + 1)), h('span', { class: 'pbx-ai-opt__b' }, h('span', { class: 'pbx-ai-opt__l' }, o.label), o.description ? h('span', { class: 'pbx-ai-opt__d' }, o.description) : null));
4992
+ b.addEventListener('click', () => {
4993
+ if (q.multiSelect) { const v = picks.get(q.question); const set = v instanceof Set ? v : new Set(); if (set.has(o.label)) set.delete(o.label); else set.add(o.label); picks.set(q.question, set); }
4994
+ else picks.set(q.question, o.label);
4995
+ paint(); send.disabled = !ready();
4996
+ if (quick) submit();
4997
+ });
4998
+ opts.appendChild(b);
4999
+ });
5000
+ // \xABKh\xE1c\u2026\xBB: t\u1EF1 g\xF5 c\xE2u tr\u1EA3 l\u1EDDi
5001
+ const other = h('input', { class: 'pb-input pbx-ai-q__other', placeholder: T('C\xE2u tr\u1EA3 l\u1EDDi kh\xE1c\u2026'), 'aria-label': T('C\xE2u tr\u1EA3 l\u1EDDi kh\xE1c'), 'data-testid': 'ai-ask-other' });
5002
+ other.addEventListener('input', () => { if (other.value.trim()) picks.set(q.question, other.value); else picks.delete(q.question); paint(); send.disabled = !ready(); });
5003
+ other.addEventListener('keydown', (ev) => { if (ev.key === 'Enter' && !ev.isComposing && other.value.trim()) { ev.preventDefault(); picks.set(q.question, other.value); submit(); } });
5004
+ box.appendChild(opts); box.appendChild(other);
5005
+ card.appendChild(box);
5006
+ }
5007
+ if (!quick) acts.appendChild(send);
5008
+ } else {
5009
+ card.appendChild(h('div', { class: 'pbx-ai-live__h' }, h('span', { html: C.P.icon('shield', { size: 14 }) }), T('AI xin quy\u1EC1n: {t}', { t: T(TOOL[e.name] || e.name) })));
5010
+ if (e.detail) card.appendChild(h('code', { class: 'pbx-ai-live__cmd' }, e.detail));
5011
+ const b = (label, kind, testid, body, done) => { const x = h('button', { type: 'button', class: 'pb-btn pb-btn--' + kind + ' pbx-btn-sm', 'data-testid': testid }, label); x.addEventListener('click', () => reply(body, done)); return x; };
5012
+ acts.appendChild(b(T('Cho ph\xE9p'), 'primary', 'ai-permit-allow', { allow: true }, T('\u0110\xE3 cho ph\xE9p.')));
5013
+ if (e.rule) acts.appendChild(b(T('Lu\xF4n cho ph\xE9p'), 'secondary', 'ai-permit-always', { allow: true, always: true }, T('\u0110\xE3 lu\xF4n cho ph\xE9p (m\xE1y n\xE0y, repo n\xE0y).')));
5014
+ acts.appendChild(b(T('T\u1EEB ch\u1ED1i'), 'ghost', 'ai-permit-deny', { allow: false }, T('\u0110\xE3 t\u1EEB ch\u1ED1i.')));
5015
+ }
5016
+ card.appendChild(acts);
5017
+ conv.asks.set(e.id, { card, lock, done: false });
5018
+ conv.log.appendChild(card);
5019
+ conv.waiting = (conv.waiting || 0) + 1;
5020
+ conv.status = 'ask'; renderTabs();
5021
+ if (conv === active) scrollDown(conv);
5022
+ else if (!conv.replaying) C.P.toast(e.t === 'ask' ? T('Cu\u1ED9c \xAB{t}\xBB \u0111ang h\u1ECFi b\u1EA1n.', { t: conv.title }) : T('Cu\u1ED9c \xAB{t}\xBB \u0111ang xin quy\u1EC1n.', { t: conv.title }), { kind: 'warn' });
5023
+ }
5024
+ function answered(conv, id, text) {
5025
+ const a = conv.asks && conv.asks.get(id);
5026
+ if (!a || a.done) return;
5027
+ a.done = true;
5028
+ if (!a.card.classList.contains('is-done')) a.lock(text === 'deny' ? T('\u0110\xE3 t\u1EEB ch\u1ED1i.') : text === 'allow' ? T('\u0110\xE3 cho ph\xE9p.') : text === 'always' ? T('\u0110\xE3 lu\xF4n cho ph\xE9p (m\xE1y n\xE0y, repo n\xE0y).') : T('\u0110\xE3 tr\u1EA3 l\u1EDDi: {a}', { a: text }));
5029
+ conv.waiting = Math.max(0, (conv.waiting || 0) - 1);
5030
+ if (!conv.waiting && conv.run) { conv.status = 'running'; renderTabs(); }
5031
+ }
5032
+
4709
5033
  // ---------------------------------------------------------------- agent con
4710
5034
  function agentStart(conv, e) {
4711
5035
  const h = C.h;
@@ -4770,21 +5094,29 @@ function agentDialog(conv, id) {
4770
5094
 
4771
5095
  function finish(conv, e, o = {}) {
4772
5096
  const h = C.h; const id = conv.run; const task = conv.task; const extra = conv.extra || {};
5097
+ status(conv, null);
4773
5098
  conv.run = null; conv.cur = null; conv.status = e.status || 'done';
5099
+ for (const a of (conv.asks || new Map()).values()) if (!a.done && !a.card.classList.contains('is-done')) { a.done = true; a.lock(T('Kh\xF4ng c\xF2n ch\u1EDD \u2014 l\u01B0\u1EE3t \u0111\xE3 k\u1EBFt th\xFAc.')); }
5100
+ conv.waiting = 0;
4774
5101
  const waiters = conv.waiters || []; conv.waiters = [];
4775
5102
  // c\xE2u tr\u1EA3 l\u1EDDi k\u1EBFt th\xFAc b\u1EB1ng kh\u1ED1i l\u1EF1a ch\u1ECDn \u21D2 b\u1ECF kh\u1ED1i kh\u1ECFi bong b\xF3ng, hi\u1EC7n n\xFAt (c\u1EA3 khi d\u1EF1ng l\u1EA1i l\u1ECBch s\u1EED)
4776
5103
  const aiEl = conv.lastAi; conv.lastAi = null;
4777
5104
  const pick = aiEl ? parseChoices(aiEl.textContent) : null;
4778
5105
  if (pick) { if (pick.text) aiEl.textContent = pick.text; else aiEl.remove(); }
5106
+ conv.lastAi = aiEl && aiEl.parentNode ? aiEl : null;
5107
+ foldTurn(conv, e);
5108
+ conv.lastAi = null;
4779
5109
  for (const a of conv.agents.values()) if (a.status === 'running') { a.status = e.status === 'done' ? 'done' : 'error'; paintAgent(a); }
4780
5110
  renderTabs();
4781
5111
  if (conv === active) running(false);
4782
5112
  else if (!o.quiet) C.P.toast(e.status === 'error' ? T('Cu\u1ED9c \xAB{t}\xBB g\u1EB7p l\u1ED7i.', { t: conv.title }) : T('Cu\u1ED9c \xAB{t}\xBB \u0111\xE3 xong.', { t: conv.title }), { kind: e.status === 'error' ? 'error' : 'success' });
4783
5113
  const files = e.files || [];
4784
- const card = h('div', { class: 'pbx-ai-result', 'data-testid': 'ai-result', 'data-status': e.status });
5114
+ // xong m\xE0 kh\xF4ng \u0111\u1ED5i t\u1EC7p / kh\xF4ng lint / kh\xF4ng c\xF3 n\xFAt g\xEC \u21D2 m\u1ED9t d\xF2ng nh\u1ECF (tr\u01B0\u1EDBc \u0111\xE2y th\u1EBB in \u0111\u1EADm \xABXong \u2014 kh\xF4ng \u0111\u1ED5i t\u1EC7p n\xE0o.\xBB chi\u1EBFm ch\u1ED7)
5115
+ const quiet = e.status === 'done' && !files.length && !e.lint && !(e.answer && (task === 'binh-luan' || task === 'gop-y' || task === 'muc-cho'));
5116
+ const card = h('div', { class: 'pbx-ai-result' + (quiet ? ' pbx-ai-result--quiet' : ''), 'data-testid': 'ai-result', 'data-status': e.status });
4785
5117
  const head = e.status === 'stopped' ? T('\u0110\xE3 d\u1EEBng.') : e.status === 'error' ? T('AI g\u1EB7p l\u1ED7i.') : files.length ? T('\u0110\xE3 \u0111\u1ED5i {n} t\u1EC7p.', { n: files.length }) : T('Xong \u2014 kh\xF4ng \u0111\u1ED5i t\u1EC7p n\xE0o.');
4786
5118
  const lint = e.lint ? h('span', { class: 'pb-badge', 'data-tone': e.lint.errors ? 'error' : e.lint.warns ? 'warn' : 'ok', 'data-testid': 'ai-lint' }, e.lint.errors ? T('{n} l\u1ED7i', { n: e.lint.errors }) : e.lint.warns ? T('{n} c\u1EA3nh b\xE1o', { n: e.lint.warns }) : T('Ki\u1EC3m tra s\u1EA1ch')) : null;
4787
- card.appendChild(h('div', { class: 'pb-row' }, h('b', null, head), lint));
5119
+ card.appendChild(quiet ? h('span', null, h('span', { html: C.P.icon('check', { size: 12 }) }), T('Xong')) : h('div', { class: 'pb-row' }, h('b', null, head), lint));
4788
5120
  if (files.length) {
4789
5121
  card.appendChild(h('ul', { class: 'pbx-ai-files' }, files.map((f) => h('li', null, h('span', { class: 'pbx-lintfile' }, f)))));
4790
5122
  }
@@ -4826,7 +5158,7 @@ async function stop() {
4826
5158
  el.stop.disabled = true; el.stop.textContent = T('\u0110ang d\u1EEBng\u2026');
4827
5159
  if (!conv.run) { if (conv.pending) conv.stopAsked = true; return; } // m\xE1y ch\u1EE7 ch\u01B0a tr\u1EA3 m\xE3 l\u01B0\u1EE3t \u21D2 d\u1EEBng ngay khi c\xF3
4828
5160
  const r = await api('api/ai/stop', { run: conv.run });
4829
- if (!r.ok && conv.run) { if (conv.es) { conv.es.close(); conv.es = null; } typing(conv, false); finish(conv, { t: 'end', status: 'stopped', files: [] }); }
5161
+ if (!r.ok && conv.run) { if (conv.es) { conv.es.close(); conv.es = null; } finish(conv, { t: 'end', status: 'stopped', files: [] }); }
4830
5162
  }
4831
5163
  async function showDiff(id, files) {
4832
5164
  const h = C.h;
@@ -5176,124 +5508,124 @@ export async function api(path, body) {
5176
5508
  try { json = await res.json(); } catch { /* kh\xF4ng ph\u1EA3i JSON */ }
5177
5509
  return { status: res.status, ok: res.ok && json.ok !== false, json };
5178
5510
  }
5179
- `}});function un(e,t={}){Wc&&!t.pin||(Kc=e==="en"?"en":"vi",t.pin&&(Wc=!0))}var Kc,Wc,U,qn=Se(()=>{"use strict";S();Kc="vi",Wc=!1;U=(e,t)=>Kc==="en"?t:e});var et,Gc,zc,hn,si=Se(()=>{"use strict";S();et=["not-run","passed","failed","blocked","skipped"],Gc=["functional","non-functional"],zc=["drafting","done","deleted"],hn=["high","medium","low"]});function db(){let e=globalThis.crypto;return e?.getRandomValues?e.getRandomValues(new Uint32Array(1))[0]/2**32:Math.random()}function mn(e,t,n,r=db){for(;;){let i="";for(let a=0;a<6;a++)i+=Vc[Math.floor(r()*Vc.length)];if(!/[A-Z]/.test(i))continue;let s=`${e}-${t}-${i}`;if(!n.has(s))return s}}var Vc,ai,oi,li,fn=Se(()=>{"use strict";S();Vc="ABCDEFGHJKMNPQRSTUVWXYZ23456789",ai=/^[A-Z][A-Z0-9]{1,11}$/,oi=/^KB-([A-Z][A-Z0-9]{1,11})-([A-Z0-9]{6})$/,li=/^TC-([A-Z][A-Z0-9]{1,11})-([A-Z0-9]{6})$/});var X=B(xe=>{"use strict";S();var ua=Symbol.for("yaml.alias"),Xc=Symbol.for("yaml.document"),ci=Symbol.for("yaml.map"),Yc=Symbol.for("yaml.pair"),ha=Symbol.for("yaml.scalar"),di=Symbol.for("yaml.seq"),ht=Symbol.for("yaml.node.type"),pb=e=>!!e&&typeof e=="object"&&e[ht]===ua,ub=e=>!!e&&typeof e=="object"&&e[ht]===Xc,hb=e=>!!e&&typeof e=="object"&&e[ht]===ci,mb=e=>!!e&&typeof e=="object"&&e[ht]===Yc,Jc=e=>!!e&&typeof e=="object"&&e[ht]===ha,fb=e=>!!e&&typeof e=="object"&&e[ht]===di;function Qc(e){if(e&&typeof e=="object")switch(e[ht]){case ci:case di:return!0}return!1}function gb(e){if(e&&typeof e=="object")switch(e[ht]){case ua:case ci:case ha:case di:return!0}return!1}var bb=e=>(Jc(e)||Qc(e))&&!!e.anchor;xe.ALIAS=ua;xe.DOC=Xc;xe.MAP=ci;xe.NODE_TYPE=ht;xe.PAIR=Yc;xe.SCALAR=ha;xe.SEQ=di;xe.hasAnchor=bb;xe.isAlias=pb;xe.isCollection=Qc;xe.isDocument=ub;xe.isMap=hb;xe.isNode=gb;xe.isPair=mb;xe.isScalar=Jc;xe.isSeq=fb});var Hn=B(ma=>{"use strict";S();var me=X(),Ne=Symbol("break visit"),Zc=Symbol("skip children"),tt=Symbol("remove node");function pi(e,t){let n=ed(t);me.isDocument(e)?gn(null,e.contents,n,Object.freeze([e]))===tt&&(e.contents=null):gn(null,e,n,Object.freeze([]))}pi.BREAK=Ne;pi.SKIP=Zc;pi.REMOVE=tt;function gn(e,t,n,r){let i=td(e,t,n,r);if(me.isNode(i)||me.isPair(i))return nd(e,r,i),gn(e,i,n,r);if(typeof i!="symbol"){if(me.isCollection(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){let a=gn(s,t.items[s],n,r);if(typeof a=="number")s=a-1;else{if(a===Ne)return Ne;a===tt&&(t.items.splice(s,1),s-=1)}}}else if(me.isPair(t)){r=Object.freeze(r.concat(t));let s=gn("key",t.key,n,r);if(s===Ne)return Ne;s===tt&&(t.key=null);let a=gn("value",t.value,n,r);if(a===Ne)return Ne;a===tt&&(t.value=null)}}return i}async function ui(e,t){let n=ed(t);me.isDocument(e)?await bn(null,e.contents,n,Object.freeze([e]))===tt&&(e.contents=null):await bn(null,e,n,Object.freeze([]))}ui.BREAK=Ne;ui.SKIP=Zc;ui.REMOVE=tt;async function bn(e,t,n,r){let i=await td(e,t,n,r);if(me.isNode(i)||me.isPair(i))return nd(e,r,i),bn(e,i,n,r);if(typeof i!="symbol"){if(me.isCollection(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){let a=await bn(s,t.items[s],n,r);if(typeof a=="number")s=a-1;else{if(a===Ne)return Ne;a===tt&&(t.items.splice(s,1),s-=1)}}}else if(me.isPair(t)){r=Object.freeze(r.concat(t));let s=await bn("key",t.key,n,r);if(s===Ne)return Ne;s===tt&&(t.key=null);let a=await bn("value",t.value,n,r);if(a===Ne)return Ne;a===tt&&(t.value=null)}}return i}function ed(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function td(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(me.isMap(t))return n.Map?.(e,t,r);if(me.isSeq(t))return n.Seq?.(e,t,r);if(me.isPair(t))return n.Pair?.(e,t,r);if(me.isScalar(t))return n.Scalar?.(e,t,r);if(me.isAlias(t))return n.Alias?.(e,t,r)}function nd(e,t,n){let r=t[t.length-1];if(me.isCollection(r))r.items[e]=n;else if(me.isPair(r))e==="key"?r.key=n:r.value=n;else if(me.isDocument(r))r.contents=n;else{let i=me.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}ma.visit=pi;ma.visitAsync=ui});var fa=B(id=>{"use strict";S();var rd=X(),vb=Hn(),wb={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},yb=e=>e.replace(/[!,[\]{}]/g,t=>wb[t]),Un=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[s,a]=r;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,a),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}let[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(a){return n(String(a)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+yb(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(t&&r.length>0&&rd.isNode(t.contents)){let s={};vb.visit(t.contents,(a,o)=>{rd.isNode(o)&&o.tag&&(s[o.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of r)s==="!!"&&a==="tag:yaml.org,2002:"||(!t||i.some(o=>o.startsWith(a)))&&n.push(`%TAG ${s} ${a}`);return n.join(`
5180
- `)}};Un.defaultYaml={explicit:!1,version:"1.2"};Un.defaultTags={"!!":"tag:yaml.org,2002:"};id.Directives=Un});var hi=B(jn=>{"use strict";S();var sd=X(),xb=Hn();function kb(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function ad(e){let t=new Set;return xb.visit(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function od(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Tb(e,t){let n=[],r=new Map,i=null;return{onAnchor:s=>{n.push(s),i??(i=ad(e));let a=od(t,i);return i.add(a),a},setAnchors:()=>{for(let s of n){let a=r.get(s);if(typeof a=="object"&&a.anchor&&(sd.isScalar(a.node)||sd.isCollection(a.node)))a.node.anchor=a.anchor;else{let o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=s,o}}},sourceObjects:r}}jn.anchorIsValid=kb;jn.anchorNames=ad;jn.createNodeAnchors=Tb;jn.findNewAnchor=od});var ga=B(ld=>{"use strict";S();function Wn(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){let a=r[i],o=Wn(e,r,String(i),a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let s=r.get(i),a=Wn(e,r,i,s);a===void 0?r.delete(i):a!==s&&r.set(i,a)}else if(r instanceof Set)for(let i of Array.from(r)){let s=Wn(e,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(let[i,s]of Object.entries(r)){let a=Wn(e,r,i,s);a===void 0?delete r[i]:a!==s&&(r[i]=a)}return e.call(t,n,r)}ld.applyReviver=Wn});var Nt=B(dd=>{"use strict";S();var Sb=X();function cd(e,t,n){if(Array.isArray(e))return e.map((r,i)=>cd(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!Sb.hasAnchor(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=s=>{r.res=s,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}dd.toJS=cd});var mi=B(ud=>{"use strict";S();var Cb=ga(),pd=X(),Eb=Nt(),ba=class{constructor(t){Object.defineProperty(this,pd.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!pd.isDocument(t))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},o=Eb.toJS(this,"",a);if(typeof i=="function")for(let{count:c,res:l}of a.anchors.values())i(l,c);return typeof s=="function"?Cb.applyReviver(s,{"":o},"",o):o}};ud.NodeBase=ba});var Kn=B(hd=>{"use strict";S();var Ab=hi(),_b=Hn(),vn=X(),Nb=mi(),Pb=Nt(),va=class extends Nb.NodeBase{constructor(t){super(vn.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],_b.visit(t,{Node:(s,a)=>{(vn.isAlias(a)||vn.hasAnchor(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let i;for(let s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(t,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:s}=n,a=this.resolve(i,n);if(!a){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let o=r.get(a);if(o||(Pb.toJS(a,null,n),o=r.get(a)),o?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=fi(i,a,r)),o.count*o.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return o.res}toString(t,n,r){let i=`*${this.source}`;if(t){if(Ab.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}};function fi(e,t,n){if(vn.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(vn.isCollection(t)){let r=0;for(let i of t.items){let s=fi(e,i,n);s>r&&(r=s)}return r}else if(vn.isPair(t)){let r=fi(e,t.key,n),i=fi(e,t.value,n);return Math.max(r,i)}return 1}hd.Alias=va});var pe=B(wa=>{"use strict";S();var Ib=X(),Ob=mi(),Rb=Nt(),Lb=e=>!e||typeof e!="function"&&typeof e!="object",Pt=class extends Ob.NodeBase{constructor(t){super(Ib.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:Rb.toJS(this.value,t,n)}toString(){return String(this.value)}};Pt.BLOCK_FOLDED="BLOCK_FOLDED";Pt.BLOCK_LITERAL="BLOCK_LITERAL";Pt.PLAIN="PLAIN";Pt.QUOTE_DOUBLE="QUOTE_DOUBLE";Pt.QUOTE_SINGLE="QUOTE_SINGLE";wa.Scalar=Pt;wa.isScalarValue=Lb});var Gn=B(fd=>{"use strict";S();var Db=Kn(),Gt=X(),md=pe(),Mb="tag:yaml.org,2002:";function Bb(e,t,n){if(t){let r=n.filter(s=>s.tag===t),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function $b(e,t,n){if(Gt.isDocument(e)&&(e=e.contents),Gt.isNode(e))return e;if(Gt.isPair(e)){let d=n.schema[Gt.MAP].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:a,sourceObjects:o}=n,c;if(r&&e&&typeof e=="object"){if(c=o.get(e),c)return c.anchor??(c.anchor=i(e)),new Db.Alias(c.anchor);c={anchor:null,node:null},o.set(e,c)}t?.startsWith("!!")&&(t=Mb+t.slice(2));let l=Bb(e,t,a.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new md.Scalar(e);return c&&(c.node=d),d}l=e instanceof Map?a[Gt.MAP]:Symbol.iterator in Object(e)?a[Gt.SEQ]:a[Gt.MAP]}s&&(s(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new md.Scalar(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}fd.createNode=$b});var bi=B(gi=>{"use strict";S();var Fb=Gn(),nt=X(),qb=mi();function ya(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){let s=t[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let a=[];a[s]=r,r=a}else r=new Map([[s,r]])}return Fb.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var gd=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,xa=class extends qb.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>nt.isNode(r)||nt.isPair(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(gd(t))this.add(n);else{let[r,...i]=t,s=this.get(r,!0);if(nt.isCollection(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,ya(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){let[n,...r]=t;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(nt.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){let[r,...i]=t,s=this.get(r,!0);return i.length===0?!n&&nt.isScalar(s)?s.value:s:nt.isCollection(s)?s.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!nt.isPair(n))return!1;let r=n.value;return r==null||t&&nt.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){let[n,...r]=t;if(r.length===0)return this.has(n);let i=this.get(n,!0);return nt.isCollection(i)?i.hasIn(r):!1}setIn(t,n){let[r,...i]=t;if(i.length===0)this.set(r,n);else{let s=this.get(r,!0);if(nt.isCollection(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,ya(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};gi.Collection=xa;gi.collectionFromPath=ya;gi.isEmptyPath=gd});var zn=B(vi=>{"use strict";S();var Hb=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ka(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Ub=(e,t,n)=>e.endsWith(`
5511
+ `}});function un(e,t={}){Wc&&!t.pin||(Kc=e==="en"?"en":"vi",t.pin&&(Wc=!0))}var Kc,Wc,U,qn=Se(()=>{"use strict";S();Kc="vi",Wc=!1;U=(e,t)=>Kc==="en"?t:e});var et,Gc,zc,hn,si=Se(()=>{"use strict";S();et=["not-run","passed","failed","blocked","skipped"],Gc=["functional","non-functional"],zc=["drafting","done","deleted"],hn=["high","medium","low"]});function db(){let e=globalThis.crypto;return e?.getRandomValues?e.getRandomValues(new Uint32Array(1))[0]/2**32:Math.random()}function mn(e,t,n,r=db){for(;;){let i="";for(let a=0;a<6;a++)i+=Vc[Math.floor(r()*Vc.length)];if(!/[A-Z]/.test(i))continue;let s=`${e}-${t}-${i}`;if(!n.has(s))return s}}var Vc,ai,oi,li,fn=Se(()=>{"use strict";S();Vc="ABCDEFGHJKMNPQRSTUVWXYZ23456789",ai=/^[A-Z][A-Z0-9]{1,11}$/,oi=/^KB-([A-Z][A-Z0-9]{1,11})-([A-Z0-9]{6})$/,li=/^TC-([A-Z][A-Z0-9]{1,11})-([A-Z0-9]{6})$/});var X=B(ye=>{"use strict";S();var ua=Symbol.for("yaml.alias"),Xc=Symbol.for("yaml.document"),ci=Symbol.for("yaml.map"),Yc=Symbol.for("yaml.pair"),ha=Symbol.for("yaml.scalar"),di=Symbol.for("yaml.seq"),ht=Symbol.for("yaml.node.type"),pb=e=>!!e&&typeof e=="object"&&e[ht]===ua,ub=e=>!!e&&typeof e=="object"&&e[ht]===Xc,hb=e=>!!e&&typeof e=="object"&&e[ht]===ci,mb=e=>!!e&&typeof e=="object"&&e[ht]===Yc,Jc=e=>!!e&&typeof e=="object"&&e[ht]===ha,fb=e=>!!e&&typeof e=="object"&&e[ht]===di;function Qc(e){if(e&&typeof e=="object")switch(e[ht]){case ci:case di:return!0}return!1}function gb(e){if(e&&typeof e=="object")switch(e[ht]){case ua:case ci:case ha:case di:return!0}return!1}var bb=e=>(Jc(e)||Qc(e))&&!!e.anchor;ye.ALIAS=ua;ye.DOC=Xc;ye.MAP=ci;ye.NODE_TYPE=ht;ye.PAIR=Yc;ye.SCALAR=ha;ye.SEQ=di;ye.hasAnchor=bb;ye.isAlias=pb;ye.isCollection=Qc;ye.isDocument=ub;ye.isMap=hb;ye.isNode=gb;ye.isPair=mb;ye.isScalar=Jc;ye.isSeq=fb});var Hn=B(ma=>{"use strict";S();var me=X(),Ne=Symbol("break visit"),Zc=Symbol("skip children"),tt=Symbol("remove node");function pi(e,t){let n=ed(t);me.isDocument(e)?gn(null,e.contents,n,Object.freeze([e]))===tt&&(e.contents=null):gn(null,e,n,Object.freeze([]))}pi.BREAK=Ne;pi.SKIP=Zc;pi.REMOVE=tt;function gn(e,t,n,r){let i=td(e,t,n,r);if(me.isNode(i)||me.isPair(i))return nd(e,r,i),gn(e,i,n,r);if(typeof i!="symbol"){if(me.isCollection(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){let a=gn(s,t.items[s],n,r);if(typeof a=="number")s=a-1;else{if(a===Ne)return Ne;a===tt&&(t.items.splice(s,1),s-=1)}}}else if(me.isPair(t)){r=Object.freeze(r.concat(t));let s=gn("key",t.key,n,r);if(s===Ne)return Ne;s===tt&&(t.key=null);let a=gn("value",t.value,n,r);if(a===Ne)return Ne;a===tt&&(t.value=null)}}return i}async function ui(e,t){let n=ed(t);me.isDocument(e)?await bn(null,e.contents,n,Object.freeze([e]))===tt&&(e.contents=null):await bn(null,e,n,Object.freeze([]))}ui.BREAK=Ne;ui.SKIP=Zc;ui.REMOVE=tt;async function bn(e,t,n,r){let i=await td(e,t,n,r);if(me.isNode(i)||me.isPair(i))return nd(e,r,i),bn(e,i,n,r);if(typeof i!="symbol"){if(me.isCollection(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){let a=await bn(s,t.items[s],n,r);if(typeof a=="number")s=a-1;else{if(a===Ne)return Ne;a===tt&&(t.items.splice(s,1),s-=1)}}}else if(me.isPair(t)){r=Object.freeze(r.concat(t));let s=await bn("key",t.key,n,r);if(s===Ne)return Ne;s===tt&&(t.key=null);let a=await bn("value",t.value,n,r);if(a===Ne)return Ne;a===tt&&(t.value=null)}}return i}function ed(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function td(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(me.isMap(t))return n.Map?.(e,t,r);if(me.isSeq(t))return n.Seq?.(e,t,r);if(me.isPair(t))return n.Pair?.(e,t,r);if(me.isScalar(t))return n.Scalar?.(e,t,r);if(me.isAlias(t))return n.Alias?.(e,t,r)}function nd(e,t,n){let r=t[t.length-1];if(me.isCollection(r))r.items[e]=n;else if(me.isPair(r))e==="key"?r.key=n:r.value=n;else if(me.isDocument(r))r.contents=n;else{let i=me.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}ma.visit=pi;ma.visitAsync=ui});var fa=B(id=>{"use strict";S();var rd=X(),vb=Hn(),wb={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},xb=e=>e.replace(/[!,[\]{}]/g,t=>wb[t]),Un=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[s,a]=r;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,a),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}let[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(a){return n(String(a)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+xb(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(t&&r.length>0&&rd.isNode(t.contents)){let s={};vb.visit(t.contents,(a,o)=>{rd.isNode(o)&&o.tag&&(s[o.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of r)s==="!!"&&a==="tag:yaml.org,2002:"||(!t||i.some(o=>o.startsWith(a)))&&n.push(`%TAG ${s} ${a}`);return n.join(`
5512
+ `)}};Un.defaultYaml={explicit:!1,version:"1.2"};Un.defaultTags={"!!":"tag:yaml.org,2002:"};id.Directives=Un});var hi=B(jn=>{"use strict";S();var sd=X(),yb=Hn();function kb(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function ad(e){let t=new Set;return yb.visit(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function od(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Tb(e,t){let n=[],r=new Map,i=null;return{onAnchor:s=>{n.push(s),i??(i=ad(e));let a=od(t,i);return i.add(a),a},setAnchors:()=>{for(let s of n){let a=r.get(s);if(typeof a=="object"&&a.anchor&&(sd.isScalar(a.node)||sd.isCollection(a.node)))a.node.anchor=a.anchor;else{let o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=s,o}}},sourceObjects:r}}jn.anchorIsValid=kb;jn.anchorNames=ad;jn.createNodeAnchors=Tb;jn.findNewAnchor=od});var ga=B(ld=>{"use strict";S();function Wn(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){let a=r[i],o=Wn(e,r,String(i),a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let s=r.get(i),a=Wn(e,r,i,s);a===void 0?r.delete(i):a!==s&&r.set(i,a)}else if(r instanceof Set)for(let i of Array.from(r)){let s=Wn(e,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(let[i,s]of Object.entries(r)){let a=Wn(e,r,i,s);a===void 0?delete r[i]:a!==s&&(r[i]=a)}return e.call(t,n,r)}ld.applyReviver=Wn});var Nt=B(dd=>{"use strict";S();var Sb=X();function cd(e,t,n){if(Array.isArray(e))return e.map((r,i)=>cd(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!Sb.hasAnchor(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=s=>{r.res=s,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}dd.toJS=cd});var mi=B(ud=>{"use strict";S();var Cb=ga(),pd=X(),Eb=Nt(),ba=class{constructor(t){Object.defineProperty(this,pd.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!pd.isDocument(t))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},o=Eb.toJS(this,"",a);if(typeof i=="function")for(let{count:c,res:l}of a.anchors.values())i(l,c);return typeof s=="function"?Cb.applyReviver(s,{"":o},"",o):o}};ud.NodeBase=ba});var Kn=B(hd=>{"use strict";S();var _b=hi(),Ab=Hn(),vn=X(),Nb=mi(),Ib=Nt(),va=class extends Nb.NodeBase{constructor(t){super(vn.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],Ab.visit(t,{Node:(s,a)=>{(vn.isAlias(a)||vn.hasAnchor(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let i;for(let s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(t,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:s}=n,a=this.resolve(i,n);if(!a){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let o=r.get(a);if(o||(Ib.toJS(a,null,n),o=r.get(a)),o?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=fi(i,a,r)),o.count*o.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return o.res}toString(t,n,r){let i=`*${this.source}`;if(t){if(_b.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}};function fi(e,t,n){if(vn.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(vn.isCollection(t)){let r=0;for(let i of t.items){let s=fi(e,i,n);s>r&&(r=s)}return r}else if(vn.isPair(t)){let r=fi(e,t.key,n),i=fi(e,t.value,n);return Math.max(r,i)}return 1}hd.Alias=va});var pe=B(wa=>{"use strict";S();var Pb=X(),Ob=mi(),Rb=Nt(),Lb=e=>!e||typeof e!="function"&&typeof e!="object",It=class extends Ob.NodeBase{constructor(t){super(Pb.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:Rb.toJS(this.value,t,n)}toString(){return String(this.value)}};It.BLOCK_FOLDED="BLOCK_FOLDED";It.BLOCK_LITERAL="BLOCK_LITERAL";It.PLAIN="PLAIN";It.QUOTE_DOUBLE="QUOTE_DOUBLE";It.QUOTE_SINGLE="QUOTE_SINGLE";wa.Scalar=It;wa.isScalarValue=Lb});var Gn=B(fd=>{"use strict";S();var Mb=Kn(),Gt=X(),md=pe(),Db="tag:yaml.org,2002:";function Bb(e,t,n){if(t){let r=n.filter(s=>s.tag===t),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function $b(e,t,n){if(Gt.isDocument(e)&&(e=e.contents),Gt.isNode(e))return e;if(Gt.isPair(e)){let d=n.schema[Gt.MAP].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:a,sourceObjects:o}=n,c;if(r&&e&&typeof e=="object"){if(c=o.get(e),c)return c.anchor??(c.anchor=i(e)),new Mb.Alias(c.anchor);c={anchor:null,node:null},o.set(e,c)}t?.startsWith("!!")&&(t=Db+t.slice(2));let l=Bb(e,t,a.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new md.Scalar(e);return c&&(c.node=d),d}l=e instanceof Map?a[Gt.MAP]:Symbol.iterator in Object(e)?a[Gt.SEQ]:a[Gt.MAP]}s&&(s(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new md.Scalar(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}fd.createNode=$b});var bi=B(gi=>{"use strict";S();var Fb=Gn(),nt=X(),qb=mi();function xa(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){let s=t[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let a=[];a[s]=r,r=a}else r=new Map([[s,r]])}return Fb.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var gd=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,ya=class extends qb.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>nt.isNode(r)||nt.isPair(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(gd(t))this.add(n);else{let[r,...i]=t,s=this.get(r,!0);if(nt.isCollection(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,xa(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){let[n,...r]=t;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(nt.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){let[r,...i]=t,s=this.get(r,!0);return i.length===0?!n&&nt.isScalar(s)?s.value:s:nt.isCollection(s)?s.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!nt.isPair(n))return!1;let r=n.value;return r==null||t&&nt.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){let[n,...r]=t;if(r.length===0)return this.has(n);let i=this.get(n,!0);return nt.isCollection(i)?i.hasIn(r):!1}setIn(t,n){let[r,...i]=t;if(i.length===0)this.set(r,n);else{let s=this.get(r,!0);if(nt.isCollection(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,xa(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};gi.Collection=ya;gi.collectionFromPath=xa;gi.isEmptyPath=gd});var zn=B(vi=>{"use strict";S();var Hb=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ka(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Ub=(e,t,n)=>e.endsWith(`
5181
5513
  `)?ka(n,t):n.includes(`
5182
5514
  `)?`
5183
- `+ka(n,t):(e.endsWith(" ")?"":" ")+n;vi.indentComment=ka;vi.lineComment=Ub;vi.stringifyComment=Hb});var vd=B(Vn=>{"use strict";S();var jb="flow",Ta="block",wi="quoted";function Wb(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:o}={}){if(!i||i<0)return e;i<s&&(s=0);let c=Math.max(1+s,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r=="number"&&(r>i-Math.max(2,s)?l.push(0):d=i-r);let p,h,f=!1,m=-1,g=-1,y=-1;n===Ta&&(m=bd(e,m,t.length),m!==-1&&(d=m+c));for(let b;b=e[m+=1];){if(n===wi&&b==="\\"){switch(g=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}y=m}if(b===`
5515
+ `+ka(n,t):(e.endsWith(" ")?"":" ")+n;vi.indentComment=ka;vi.lineComment=Ub;vi.stringifyComment=Hb});var vd=B(Vn=>{"use strict";S();var jb="flow",Ta="block",wi="quoted";function Wb(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:o}={}){if(!i||i<0)return e;i<s&&(s=0);let c=Math.max(1+s,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r=="number"&&(r>i-Math.max(2,s)?l.push(0):d=i-r);let p,h,f=!1,m=-1,g=-1,x=-1;n===Ta&&(m=bd(e,m,t.length),m!==-1&&(d=m+c));for(let b;b=e[m+=1];){if(n===wi&&b==="\\"){switch(g=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}x=m}if(b===`
5184
5516
  `)n===Ta&&(m=bd(e,m,t.length)),d=m+t.length+c,p=void 0;else{if(b===" "&&h&&h!==" "&&h!==`
5185
5517
  `&&h!==" "){let C=e[m+1];C&&C!==" "&&C!==`
5186
- `&&C!==" "&&(p=m)}if(m>=d)if(p)l.push(p),d=p+c,p=void 0;else if(n===wi){for(;h===" "||h===" ";)h=b,b=e[m+=1],f=!0;let C=m>y+1?m-2:g-1;if(u[C])return e;l.push(C),u[C]=!0,d=C+c,p=void 0}else f=!0}h=b}if(f&&o&&o(),l.length===0)return e;a&&a();let T=e.slice(0,l[0]);for(let b=0;b<l.length;++b){let C=l[b],_=l[b+1]||e.length;C===0?T=`
5187
- ${t}${e.slice(0,_)}`:(n===wi&&u[C]&&(T+=`${e[C]}\\`),T+=`
5188
- ${t}${e.slice(C+1,_)}`)}return T}function bd(e,t,n){let r=t,i=t+1,s=e[i];for(;s===" "||s===" ";)if(t<i+n)s=e[++t];else{do s=e[++t];while(s&&s!==`
5189
- `);r=t,i=t+1,s=e[i]}return r}Vn.FOLD_BLOCK=Ta;Vn.FOLD_FLOW=jb;Vn.FOLD_QUOTED=wi;Vn.foldFlowLines=Wb});var Yn=B(wd=>{"use strict";S();var We=pe(),It=vd(),xi=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ki=e=>/^(%|---|\.\.\.)/m.test(e);function Kb(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let s=0,a=0;s<i;++s)if(e[s]===`
5518
+ `&&C!==" "&&(p=m)}if(m>=d)if(p)l.push(p),d=p+c,p=void 0;else if(n===wi){for(;h===" "||h===" ";)h=b,b=e[m+=1],f=!0;let C=m>x+1?m-2:g-1;if(u[C])return e;l.push(C),u[C]=!0,d=C+c,p=void 0}else f=!0}h=b}if(f&&o&&o(),l.length===0)return e;a&&a();let T=e.slice(0,l[0]);for(let b=0;b<l.length;++b){let C=l[b],A=l[b+1]||e.length;C===0?T=`
5519
+ ${t}${e.slice(0,A)}`:(n===wi&&u[C]&&(T+=`${e[C]}\\`),T+=`
5520
+ ${t}${e.slice(C+1,A)}`)}return T}function bd(e,t,n){let r=t,i=t+1,s=e[i];for(;s===" "||s===" ";)if(t<i+n)s=e[++t];else{do s=e[++t];while(s&&s!==`
5521
+ `);r=t,i=t+1,s=e[i]}return r}Vn.FOLD_BLOCK=Ta;Vn.FOLD_FLOW=jb;Vn.FOLD_QUOTED=wi;Vn.foldFlowLines=Wb});var Yn=B(wd=>{"use strict";S();var We=pe(),Pt=vd(),yi=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ki=e=>/^(%|---|\.\.\.)/m.test(e);function Kb(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let s=0,a=0;s<i;++s)if(e[s]===`
5190
5522
  `){if(s-a>r)return!0;if(a=s+1,i-a<=r)return!1}return!0}function Xn(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(ki(e)?" ":""),a="",o=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(o,c)+"\\ ",c+=1,o=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{a+=n.slice(o,c);let u=n.substr(c+2,4);switch(u){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:u.substr(0,2)==="00"?a+="\\x"+u.substr(2):a+=n.substr(c,6)}c+=5,o=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<i)c+=1;else{for(a+=n.slice(o,c)+`
5191
5523
 
5192
5524
  `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)a+=`
5193
- `,c+=2;a+=s,n[c+2]===" "&&(a+="\\"),c+=1,o=c+1}break;default:c+=1}return a=o?a+n.slice(o):n,r?a:It.foldFlowLines(a,s,It.FOLD_QUOTED,xi(t,!1))}function Sa(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
5525
+ `,c+=2;a+=s,n[c+2]===" "&&(a+="\\"),c+=1,o=c+1}break;default:c+=1}return a=o?a+n.slice(o):n,r?a:Pt.foldFlowLines(a,s,Pt.FOLD_QUOTED,yi(t,!1))}function Sa(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
5194
5526
  `)||/[ \t]\n|\n[ \t]/.test(e))return Xn(e,t);let n=t.indent||(ki(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
5195
- ${n}`)+"'";return t.implicitKey?r:It.foldFlowLines(r,n,It.FOLD_FLOW,xi(t,!1))}function wn(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=Xn;else{let i=e.includes('"'),s=e.includes("'");i&&!s?r=Sa:s&&!i?r=Xn:r=n?Sa:Xn}return r(e,t)}var Ca;try{Ca=new RegExp(`(^|(?<!
5527
+ ${n}`)+"'";return t.implicitKey?r:Pt.foldFlowLines(r,n,Pt.FOLD_FLOW,yi(t,!1))}function wn(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=Xn;else{let i=e.includes('"'),s=e.includes("'");i&&!s?r=Sa:s&&!i?r=Xn:r=n?Sa:Xn}return r(e,t)}var Ca;try{Ca=new RegExp(`(^|(?<!
5196
5528
  ))
5197
5529
  +(?!
5198
- |$)`,"g")}catch{Ca=/\n+(?!\n|$)/g}function yi({comment:e,type:t,value:n},r,i,s){let{blockQuote:a,commentString:o,lineWidth:c}=r.options;if(!a||/\n[\t ]+$/.test(n))return wn(n,r);let l=r.indent||(r.forceBlockIndent||ki(n)?" ":""),u=a==="literal"?!0:a==="folded"||t===We.Scalar.BLOCK_FOLDED?!1:t===We.Scalar.BLOCK_LITERAL?!0:!Kb(n,c,l.length);if(!n)return u?`|
5530
+ |$)`,"g")}catch{Ca=/\n+(?!\n|$)/g}function xi({comment:e,type:t,value:n},r,i,s){let{blockQuote:a,commentString:o,lineWidth:c}=r.options;if(!a||/\n[\t ]+$/.test(n))return wn(n,r);let l=r.indent||(r.forceBlockIndent||ki(n)?" ":""),u=a==="literal"?!0:a==="folded"||t===We.Scalar.BLOCK_FOLDED?!1:t===We.Scalar.BLOCK_LITERAL?!0:!Kb(n,c,l.length);if(!n)return u?`|
5199
5531
  `:`>
5200
- `;let d,p;for(p=n.length;p>0;--p){let _=n[p-1];if(_!==`
5201
- `&&_!==" "&&_!==" ")break}let h=n.substring(p),f=h.indexOf(`
5532
+ `;let d,p;for(p=n.length;p>0;--p){let A=n[p-1];if(A!==`
5533
+ `&&A!==" "&&A!==" ")break}let h=n.substring(p),f=h.indexOf(`
5202
5534
  `);f===-1?d="-":n===h||f!==h.length-1?(d="+",s&&s()):d="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
5203
- `&&(h=h.slice(0,-1)),h=h.replace(Ca,`$&${l}`));let m=!1,g,y=-1;for(g=0;g<n.length;++g){let _=n[g];if(_===" ")m=!0;else if(_===`
5204
- `)y=g;else break}let T=n.substring(0,y<g?y+1:g);T&&(n=n.substring(T.length),T=T.replace(/\n+/g,`$&${l}`));let C=(m?l?"2":"1":"")+d;if(e&&(C+=" "+o(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let _=n.replace(/\n+/g,`
5205
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),w=!1,x=xi(r,!0);a!=="folded"&&t!==We.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{w=!0});let v=It.foldFlowLines(`${T}${_}${h}`,l,It.FOLD_BLOCK,x);if(!w)return`>${C}
5535
+ `&&(h=h.slice(0,-1)),h=h.replace(Ca,`$&${l}`));let m=!1,g,x=-1;for(g=0;g<n.length;++g){let A=n[g];if(A===" ")m=!0;else if(A===`
5536
+ `)x=g;else break}let T=n.substring(0,x<g?x+1:g);T&&(n=n.substring(T.length),T=T.replace(/\n+/g,`$&${l}`));let C=(m?l?"2":"1":"")+d;if(e&&(C+=" "+o(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let A=n.replace(/\n+/g,`
5537
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),w=!1,y=yi(r,!0);a!=="folded"&&t!==We.Scalar.BLOCK_FOLDED&&(y.onOverflow=()=>{w=!0});let v=Pt.foldFlowLines(`${T}${A}${h}`,l,Pt.FOLD_BLOCK,y);if(!w)return`>${C}
5206
5538
  ${l}${v}`}return n=n.replace(/\n+/g,`$&${l}`),`|${C}
5207
5539
  ${l}${T}${n}${h}`}function Gb(e,t,n,r){let{type:i,value:s}=e,{actualString:a,implicitKey:o,indent:c,indentStep:l,inFlow:u}=t;if(o&&s.includes(`
5208
5540
  `)||u&&/[[\]{},]/.test(s))return wn(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return o||u||!s.includes(`
5209
- `)?wn(s,t):yi(e,t,n,r);if(!o&&!u&&i!==We.Scalar.PLAIN&&s.includes(`
5210
- `))return yi(e,t,n,r);if(ki(s)){if(c==="")return t.forceBlockIndent=!0,yi(e,t,n,r);if(o&&c===l)return wn(s,t)}let d=s.replace(/\n+/g,`$&
5211
- ${c}`);if(a){let p=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(d),{compat:h,tags:f}=t.doc.schema;if(f.some(p)||h?.some(p))return wn(s,t)}return o?d:It.foldFlowLines(d,c,It.FOLD_FLOW,xi(t,!1))}function zb(e,t,n,r){let{implicitKey:i,inFlow:s}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:o}=e;o!==We.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=We.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case We.Scalar.BLOCK_FOLDED:case We.Scalar.BLOCK_LITERAL:return i||s?wn(a.value,t):yi(a,t,n,r);case We.Scalar.QUOTE_DOUBLE:return Xn(a.value,t);case We.Scalar.QUOTE_SINGLE:return Sa(a.value,t);case We.Scalar.PLAIN:return Gb(a,t,n,r);default:return null}},l=c(o);if(l===null){let{defaultKeyType:u,defaultStringType:d}=t.options,p=i&&u||d;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}wd.stringifyString=zb});var Jn=B(Ea=>{"use strict";S();var Vb=hi(),Ot=X(),Xb=zn(),Yb=Yn();function Jb(e,t){let n=Object.assign({blockQuote:!0,commentString:Xb.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function Qb(e,t){if(t.tag){let i=e.filter(s=>s.tag===t.tag);if(i.length>0)return i.find(s=>s.format===t.format)??i[0]}let n,r;if(Ot.isScalar(t)){r=t.value;let i=e.filter(s=>s.identify?.(r));if(i.length>1){let s=i.filter(a=>a.test);s.length>0&&(i=s)}n=i.find(s=>s.format===t.format)??i.find(s=>!s.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function Zb(e,t,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],s=(Ot.isScalar(e)||Ot.isCollection(e))&&e.anchor;s&&Vb.anchorIsValid(s)&&(n.add(s),i.push(`&${s}`));let a=e.tag??(t.default?null:t.tag);return a&&i.push(r.directives.tagString(a)),i.join(" ")}function ev(e,t,n,r){if(Ot.isPair(e))return e.toString(t,n,r);if(Ot.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,s=Ot.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>i=c});i??(i=Qb(t.doc.schema.tags,s));let a=Zb(s,i,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);let o=typeof i.stringify=="function"?i.stringify(s,t,n,r):Ot.isScalar(s)?Yb.stringifyString(s,t,n,r):s.toString(t,n,r);return a?Ot.isScalar(s)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a}
5212
- ${t.indent}${o}`:o}Ea.createStringifyContext=Jb;Ea.stringify=ev});var Td=B(kd=>{"use strict";S();var mt=X(),yd=pe(),xd=Jn(),Qn=zn();function tv({key:e,value:t},n,r,i){let{allNullValues:s,doc:a,indent:o,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,p=mt.isNode(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(mt.isCollection(e)||!mt.isNode(e)&&typeof e=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let h=!d&&(!e||p&&t==null&&!n.inFlow||mt.isCollection(e)||(mt.isScalar(e)?e.type===yd.Scalar.BLOCK_FOLDED||e.type===yd.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(d||!s),indent:o+c});let f=!1,m=!1,g=xd.stringify(e,n,()=>f=!0,()=>m=!0);if(!h&&!n.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||t==null)return f&&r&&r(),g===""?"?":h?`? ${g}`:g}else if(s&&!d||t==null&&h)return g=`? ${g}`,p&&!f?g+=Qn.lineComment(g,n.indent,l(p)):m&&i&&i(),g;f&&(p=null),h?(p&&(g+=Qn.lineComment(g,n.indent,l(p))),g=`? ${g}
5213
- ${o}:`):(g=`${g}:`,p&&(g+=Qn.lineComment(g,n.indent,l(p))));let y,T,b;mt.isNode(t)?(y=!!t.spaceBefore,T=t.commentBefore,b=t.comment):(y=!1,T=null,b=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!h&&!p&&mt.isScalar(t)&&(n.indentAtStart=g.length+1),m=!1,!u&&c.length>=2&&!n.inFlow&&!h&&mt.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1,_=xd.stringify(t,n,()=>C=!0,()=>m=!0),w=" ";if(p||y||T){if(w=y?`
5214
- `:"",T){let x=l(T);w+=`
5215
- ${Qn.indentComment(x,n.indent)}`}_===""&&!n.inFlow?w===`
5541
+ `)?wn(s,t):xi(e,t,n,r);if(!o&&!u&&i!==We.Scalar.PLAIN&&s.includes(`
5542
+ `))return xi(e,t,n,r);if(ki(s)){if(c==="")return t.forceBlockIndent=!0,xi(e,t,n,r);if(o&&c===l)return wn(s,t)}let d=s.replace(/\n+/g,`$&
5543
+ ${c}`);if(a){let p=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(d),{compat:h,tags:f}=t.doc.schema;if(f.some(p)||h?.some(p))return wn(s,t)}return o?d:Pt.foldFlowLines(d,c,Pt.FOLD_FLOW,yi(t,!1))}function zb(e,t,n,r){let{implicitKey:i,inFlow:s}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:o}=e;o!==We.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=We.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case We.Scalar.BLOCK_FOLDED:case We.Scalar.BLOCK_LITERAL:return i||s?wn(a.value,t):xi(a,t,n,r);case We.Scalar.QUOTE_DOUBLE:return Xn(a.value,t);case We.Scalar.QUOTE_SINGLE:return Sa(a.value,t);case We.Scalar.PLAIN:return Gb(a,t,n,r);default:return null}},l=c(o);if(l===null){let{defaultKeyType:u,defaultStringType:d}=t.options,p=i&&u||d;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}wd.stringifyString=zb});var Jn=B(Ea=>{"use strict";S();var Vb=hi(),Ot=X(),Xb=zn(),Yb=Yn();function Jb(e,t){let n=Object.assign({blockQuote:!0,commentString:Xb.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function Qb(e,t){if(t.tag){let i=e.filter(s=>s.tag===t.tag);if(i.length>0)return i.find(s=>s.format===t.format)??i[0]}let n,r;if(Ot.isScalar(t)){r=t.value;let i=e.filter(s=>s.identify?.(r));if(i.length>1){let s=i.filter(a=>a.test);s.length>0&&(i=s)}n=i.find(s=>s.format===t.format)??i.find(s=>!s.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function Zb(e,t,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],s=(Ot.isScalar(e)||Ot.isCollection(e))&&e.anchor;s&&Vb.anchorIsValid(s)&&(n.add(s),i.push(`&${s}`));let a=e.tag??(t.default?null:t.tag);return a&&i.push(r.directives.tagString(a)),i.join(" ")}function ev(e,t,n,r){if(Ot.isPair(e))return e.toString(t,n,r);if(Ot.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,s=Ot.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>i=c});i??(i=Qb(t.doc.schema.tags,s));let a=Zb(s,i,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);let o=typeof i.stringify=="function"?i.stringify(s,t,n,r):Ot.isScalar(s)?Yb.stringifyString(s,t,n,r):s.toString(t,n,r);return a?Ot.isScalar(s)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a}
5544
+ ${t.indent}${o}`:o}Ea.createStringifyContext=Jb;Ea.stringify=ev});var Td=B(kd=>{"use strict";S();var mt=X(),xd=pe(),yd=Jn(),Qn=zn();function tv({key:e,value:t},n,r,i){let{allNullValues:s,doc:a,indent:o,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,p=mt.isNode(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(mt.isCollection(e)||!mt.isNode(e)&&typeof e=="object"){let y="With simple keys, collection cannot be used as a key value";throw new Error(y)}}let h=!d&&(!e||p&&t==null&&!n.inFlow||mt.isCollection(e)||(mt.isScalar(e)?e.type===xd.Scalar.BLOCK_FOLDED||e.type===xd.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(d||!s),indent:o+c});let f=!1,m=!1,g=yd.stringify(e,n,()=>f=!0,()=>m=!0);if(!h&&!n.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||t==null)return f&&r&&r(),g===""?"?":h?`? ${g}`:g}else if(s&&!d||t==null&&h)return g=`? ${g}`,p&&!f?g+=Qn.lineComment(g,n.indent,l(p)):m&&i&&i(),g;f&&(p=null),h?(p&&(g+=Qn.lineComment(g,n.indent,l(p))),g=`? ${g}
5545
+ ${o}:`):(g=`${g}:`,p&&(g+=Qn.lineComment(g,n.indent,l(p))));let x,T,b;mt.isNode(t)?(x=!!t.spaceBefore,T=t.commentBefore,b=t.comment):(x=!1,T=null,b=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!h&&!p&&mt.isScalar(t)&&(n.indentAtStart=g.length+1),m=!1,!u&&c.length>=2&&!n.inFlow&&!h&&mt.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1,A=yd.stringify(t,n,()=>C=!0,()=>m=!0),w=" ";if(p||x||T){if(w=x?`
5546
+ `:"",T){let y=l(T);w+=`
5547
+ ${Qn.indentComment(y,n.indent)}`}A===""&&!n.inFlow?w===`
5216
5548
  `&&b&&(w=`
5217
5549
 
5218
5550
  `):w+=`
5219
- ${n.indent}`}else if(!h&&mt.isCollection(t)){let x=_[0],v=_.indexOf(`
5220
- `),A=v!==-1,N=n.inFlow??t.flow??t.items.length===0;if(A||!N){let D=!1;if(A&&(x==="&"||x==="!")){let O=_.indexOf(" ");x==="&"&&O!==-1&&O<v&&_[O+1]==="!"&&(O=_.indexOf(" ",O+1)),(O===-1||v<O)&&(D=!0)}D||(w=`
5221
- ${n.indent}`)}}else(_===""||_[0]===`
5222
- `)&&(w="");return g+=w+_,n.inFlow?C&&r&&r():b&&!C?g+=Qn.lineComment(g,n.indent,l(b)):m&&i&&i(),g}kd.stringifyPair=tv});var _a=B(Aa=>{"use strict";S();var Sd=ri("process");function nv(e,...t){e==="debug"&&console.log(...t)}function rv(e,t){(e==="debug"||e==="warn")&&(typeof Sd.emitWarning=="function"?Sd.emitWarning(t):console.warn(t))}Aa.debug=nv;Aa.warn=rv});var Ai=B(Ei=>{"use strict";S();var Ci=X(),Cd=pe(),Ti="<<",Si={identify:e=>e===Ti||typeof e=="symbol"&&e.description===Ti,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Cd.Scalar(Symbol(Ti)),{addToJSMap:Ed}),stringify:()=>Ti},iv=(e,t)=>(Si.identify(t)||Ci.isScalar(t)&&(!t.type||t.type===Cd.Scalar.PLAIN)&&Si.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Si.tag&&n.default);function Ed(e,t,n){let r=Ad(e,n);if(Ci.isSeq(r))for(let i of r.items)Na(e,t,i);else if(Array.isArray(r))for(let i of r)Na(e,t,i);else Na(e,t,r)}function Na(e,t,n){let r=Ad(e,n);if(!Ci.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.toJSON(null,e,Map);for(let[s,a]of i)t instanceof Map?t.has(s)||t.set(s,a):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function Ad(e,t){return e&&Ci.isAlias(t)?t.resolve(e.doc,e):t}Ei.addMergeToJSMap=Ed;Ei.isMergeKey=iv;Ei.merge=Si});var Ia=B(Pd=>{"use strict";S();var sv=_a(),_d=Ai(),av=Jn(),Nd=X(),Pa=Nt();function ov(e,t,{key:n,value:r}){if(Nd.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(_d.isMergeKey(e,n))_d.addMergeToJSMap(e,t,r);else{let i=Pa.toJS(n,"",e);if(t instanceof Map)t.set(i,Pa.toJS(r,i,e));else if(t instanceof Set)t.add(i);else{let s=lv(n,i,e),a=Pa.toJS(r,s,e);s in t?Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[s]=a}}return t}function lv(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Nd.isNode(e)&&n?.doc){let r=av.createStringifyContext(n.doc,{});r.anchors=new Set;for(let s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=e.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),sv.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}Pd.addPairToJSMap=ov});var Rt=B(Oa=>{"use strict";S();var Id=Gn(),cv=Td(),dv=Ia(),_i=X();function pv(e,t,n){let r=Id.createNode(e,void 0,n),i=Id.createNode(t,void 0,n);return new Ni(r,i)}var Ni=class e{constructor(t,n=null){Object.defineProperty(this,_i.NODE_TYPE,{value:_i.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return _i.isNode(n)&&(n=n.clone(t)),_i.isNode(r)&&(r=r.clone(t)),new e(n,r)}toJSON(t,n){let r=n?.mapAsMap?new Map:{};return dv.addPairToJSMap(n,r,this)}toString(t,n,r){return t?.doc?cv.stringifyPair(this,t,n,r):JSON.stringify(this)}};Oa.Pair=Ni;Oa.createPair=pv});var Ra=B(Rd=>{"use strict";S();var zt=X(),Od=Jn(),Pi=zn();function uv(e,t,n){return(t.inFlow??e.flow?mv:hv)(e,t,n)}function hv({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:a,onComment:o}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:s,type:null}),d=!1,p=[];for(let f=0;f<t.length;++f){let m=t[f],g=null;if(zt.isNode(m))!d&&m.spaceBefore&&p.push(""),Ii(n,p,m.commentBefore,d),m.comment&&(g=m.comment);else if(zt.isPair(m)){let T=zt.isNode(m.key)?m.key:null;T&&(!d&&T.spaceBefore&&p.push(""),Ii(n,p,T.commentBefore,d))}d=!1;let y=Od.stringify(m,u,()=>g=null,()=>d=!0);g&&(y+=Pi.lineComment(y,s,l(g))),d&&g&&(d=!1),p.push(r+y)}let h;if(p.length===0)h=i.start+i.end;else{h=p[0];for(let f=1;f<p.length;++f){let m=p[f];h+=m?`
5551
+ ${n.indent}`}else if(!h&&mt.isCollection(t)){let y=A[0],v=A.indexOf(`
5552
+ `),_=v!==-1,N=n.inFlow??t.flow??t.items.length===0;if(_||!N){let M=!1;if(_&&(y==="&"||y==="!")){let O=A.indexOf(" ");y==="&"&&O!==-1&&O<v&&A[O+1]==="!"&&(O=A.indexOf(" ",O+1)),(O===-1||v<O)&&(M=!0)}M||(w=`
5553
+ ${n.indent}`)}}else(A===""||A[0]===`
5554
+ `)&&(w="");return g+=w+A,n.inFlow?C&&r&&r():b&&!C?g+=Qn.lineComment(g,n.indent,l(b)):m&&i&&i(),g}kd.stringifyPair=tv});var Aa=B(_a=>{"use strict";S();var Sd=ri("process");function nv(e,...t){e==="debug"&&console.log(...t)}function rv(e,t){(e==="debug"||e==="warn")&&(typeof Sd.emitWarning=="function"?Sd.emitWarning(t):console.warn(t))}_a.debug=nv;_a.warn=rv});var _i=B(Ei=>{"use strict";S();var Ci=X(),Cd=pe(),Ti="<<",Si={identify:e=>e===Ti||typeof e=="symbol"&&e.description===Ti,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Cd.Scalar(Symbol(Ti)),{addToJSMap:Ed}),stringify:()=>Ti},iv=(e,t)=>(Si.identify(t)||Ci.isScalar(t)&&(!t.type||t.type===Cd.Scalar.PLAIN)&&Si.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Si.tag&&n.default);function Ed(e,t,n){let r=_d(e,n);if(Ci.isSeq(r))for(let i of r.items)Na(e,t,i);else if(Array.isArray(r))for(let i of r)Na(e,t,i);else Na(e,t,r)}function Na(e,t,n){let r=_d(e,n);if(!Ci.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.toJSON(null,e,Map);for(let[s,a]of i)t instanceof Map?t.has(s)||t.set(s,a):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function _d(e,t){return e&&Ci.isAlias(t)?t.resolve(e.doc,e):t}Ei.addMergeToJSMap=Ed;Ei.isMergeKey=iv;Ei.merge=Si});var Pa=B(Id=>{"use strict";S();var sv=Aa(),Ad=_i(),av=Jn(),Nd=X(),Ia=Nt();function ov(e,t,{key:n,value:r}){if(Nd.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Ad.isMergeKey(e,n))Ad.addMergeToJSMap(e,t,r);else{let i=Ia.toJS(n,"",e);if(t instanceof Map)t.set(i,Ia.toJS(r,i,e));else if(t instanceof Set)t.add(i);else{let s=lv(n,i,e),a=Ia.toJS(r,s,e);s in t?Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[s]=a}}return t}function lv(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Nd.isNode(e)&&n?.doc){let r=av.createStringifyContext(n.doc,{});r.anchors=new Set;for(let s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=e.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),sv.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}Id.addPairToJSMap=ov});var Rt=B(Oa=>{"use strict";S();var Pd=Gn(),cv=Td(),dv=Pa(),Ai=X();function pv(e,t,n){let r=Pd.createNode(e,void 0,n),i=Pd.createNode(t,void 0,n);return new Ni(r,i)}var Ni=class e{constructor(t,n=null){Object.defineProperty(this,Ai.NODE_TYPE,{value:Ai.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Ai.isNode(n)&&(n=n.clone(t)),Ai.isNode(r)&&(r=r.clone(t)),new e(n,r)}toJSON(t,n){let r=n?.mapAsMap?new Map:{};return dv.addPairToJSMap(n,r,this)}toString(t,n,r){return t?.doc?cv.stringifyPair(this,t,n,r):JSON.stringify(this)}};Oa.Pair=Ni;Oa.createPair=pv});var Ra=B(Rd=>{"use strict";S();var zt=X(),Od=Jn(),Ii=zn();function uv(e,t,n){return(t.inFlow??e.flow?mv:hv)(e,t,n)}function hv({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:a,onComment:o}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:s,type:null}),d=!1,p=[];for(let f=0;f<t.length;++f){let m=t[f],g=null;if(zt.isNode(m))!d&&m.spaceBefore&&p.push(""),Pi(n,p,m.commentBefore,d),m.comment&&(g=m.comment);else if(zt.isPair(m)){let T=zt.isNode(m.key)?m.key:null;T&&(!d&&T.spaceBefore&&p.push(""),Pi(n,p,T.commentBefore,d))}d=!1;let x=Od.stringify(m,u,()=>g=null,()=>d=!0);g&&(x+=Ii.lineComment(x,s,l(g))),d&&g&&(d=!1),p.push(r+x)}let h;if(p.length===0)h=i.start+i.end;else{h=p[0];for(let f=1;f<p.length;++f){let m=p[f];h+=m?`
5223
5555
  ${c}${m}`:`
5224
5556
  `}}return e?(h+=`
5225
- `+Pi.indentComment(l(e),c),o&&o()):d&&a&&a(),h}function mv({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:s,flowCollectionPadding:a,options:{commentString:o}}=t;r+=s;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let f=0;f<e.length;++f){let m=e[f],g=null;if(zt.isNode(m))m.spaceBefore&&d.push(""),Ii(t,d,m.commentBefore,!1),m.comment&&(g=m.comment);else if(zt.isPair(m)){let T=zt.isNode(m.key)?m.key:null;T&&(T.spaceBefore&&d.push(""),Ii(t,d,T.commentBefore,!1),T.comment&&(l=!0));let b=zt.isNode(m.value)?m.value:null;b?(b.comment&&(g=b.comment),b.commentBefore&&(l=!0)):m.value==null&&T?.comment&&(g=T.comment)}g&&(l=!0);let y=Od.stringify(m,c,()=>g=null);l||(l=d.length>u||y.includes(`
5226
- `)),f<e.length-1?y+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=d.reduce((T,b)=>T+b.length+2,2)+(y.length+2)>t.options.lineWidth)),l&&(y+=",")),g&&(y+=Pi.lineComment(y,r,o(g))),d.push(y),u=d.length}let{start:p,end:h}=n;if(d.length===0)return p+h;if(!l){let f=d.reduce((m,g)=>m+g.length+2,2);l=t.options.lineWidth>0&&f>t.options.lineWidth}if(l){let f=p;for(let m of d)f+=m?`
5557
+ `+Ii.indentComment(l(e),c),o&&o()):d&&a&&a(),h}function mv({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:s,flowCollectionPadding:a,options:{commentString:o}}=t;r+=s;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let f=0;f<e.length;++f){let m=e[f],g=null;if(zt.isNode(m))m.spaceBefore&&d.push(""),Pi(t,d,m.commentBefore,!1),m.comment&&(g=m.comment);else if(zt.isPair(m)){let T=zt.isNode(m.key)?m.key:null;T&&(T.spaceBefore&&d.push(""),Pi(t,d,T.commentBefore,!1),T.comment&&(l=!0));let b=zt.isNode(m.value)?m.value:null;b?(b.comment&&(g=b.comment),b.commentBefore&&(l=!0)):m.value==null&&T?.comment&&(g=T.comment)}g&&(l=!0);let x=Od.stringify(m,c,()=>g=null);l||(l=d.length>u||x.includes(`
5558
+ `)),f<e.length-1?x+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=d.reduce((T,b)=>T+b.length+2,2)+(x.length+2)>t.options.lineWidth)),l&&(x+=",")),g&&(x+=Ii.lineComment(x,r,o(g))),d.push(x),u=d.length}let{start:p,end:h}=n;if(d.length===0)return p+h;if(!l){let f=d.reduce((m,g)=>m+g.length+2,2);l=t.options.lineWidth>0&&f>t.options.lineWidth}if(l){let f=p;for(let m of d)f+=m?`
5227
5559
  ${s}${i}${m}`:`
5228
5560
  `;return`${f}
5229
- ${i}${h}`}else return`${p}${a}${d.join(" ")}${a}${h}`}function Ii({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let s=Pi.indentComment(t(r),e);n.push(s.trimStart())}}Rd.stringifyCollection=uv});var Dt=B(Da=>{"use strict";S();var fv=Ra(),gv=Ia(),bv=bi(),Lt=X(),Oi=Rt(),vv=pe();function Zn(e,t){let n=Lt.isScalar(t)?t.value:t;for(let r of e)if(Lt.isPair(r)&&(r.key===t||r.key===n||Lt.isScalar(r.key)&&r.key.value===n))return r}var La=class extends bv.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Lt.MAP,t),this.items=[]}static from(t,n,r){let{keepUndefined:i,replacer:s}=r,a=new this(t),o=(c,l)=>{if(typeof s=="function")l=s.call(n,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||i)&&a.items.push(Oi.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)o(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))o(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){let r;Lt.isPair(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Oi.Pair(t,t?.value):r=new Oi.Pair(t.key,t.value);let i=Zn(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Lt.isScalar(i.value)&&vv.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(s){let a=this.items.findIndex(o=>s(r,o)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(t){let n=Zn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let i=Zn(this.items,t)?.value;return(!n&&Lt.isScalar(i)?i.value:i)??void 0}has(t){return!!Zn(this.items,t)}set(t,n){this.add(new Oi.Pair(t,n),!0)}toJSON(t,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let s of this.items)gv.addPairToJSMap(n,i,s);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(let i of this.items)if(!Lt.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),fv.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}};Da.YAMLMap=La;Da.findPair=Zn});var yn=B(Dd=>{"use strict";S();var wv=X(),Ld=Dt(),yv={collection:"map",default:!0,nodeClass:Ld.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return wv.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ld.YAMLMap.from(e,t,n)};Dd.map=yv});var Mt=B(Md=>{"use strict";S();var xv=Gn(),kv=Ra(),Tv=bi(),Li=X(),Sv=pe(),Cv=Nt(),Ma=class extends Tv.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Li.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=Ri(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let r=Ri(t);if(typeof r!="number")return;let i=this.items[r];return!n&&Li.isScalar(i)?i.value:i}has(t){let n=Ri(t);return typeof n=="number"&&n<this.items.length}set(t,n){let r=Ri(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);let i=this.items[r];Li.isScalar(i)&&Sv.isScalarValue(n)?i.value=n:this.items[r]=n}toJSON(t,n){let r=[];n?.onCreate&&n.onCreate(r);let i=0;for(let s of this.items)r.push(Cv.toJS(s,String(i++),n));return r}toString(t,n,r){return t?kv.stringifyCollection(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){let{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n)){let a=0;for(let o of n){if(typeof i=="function"){let c=n instanceof Set?o:String(a++);o=i.call(n,c,o)}s.items.push(xv.createNode(o,void 0,r))}}return s}};function Ri(e){let t=Li.isScalar(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}Md.YAMLSeq=Ma});var xn=B($d=>{"use strict";S();var Ev=X(),Bd=Mt(),Av={collection:"seq",default:!0,nodeClass:Bd.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Ev.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Bd.YAMLSeq.from(e,t,n)};$d.seq=Av});var er=B(Fd=>{"use strict";S();var _v=Yn(),Nv={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),_v.stringifyString(e,t,n,r)}};Fd.string=Nv});var Di=B(Ud=>{"use strict";S();var qd=pe(),Hd={identify:e=>e==null,createNode:()=>new qd.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new qd.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&Hd.test.test(e)?e:t.options.nullStr};Ud.nullTag=Hd});var Ba=B(Wd=>{"use strict";S();var Pv=pe(),jd={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Pv.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&jd.test.test(e)){let r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};Wd.boolTag=jd});var kn=B(Kd=>{"use strict";S();function Iv({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let o=t-(s.length-a-1);for(;o-- >0;)s+="0"}return s}Kd.stringifyNumber=Iv});var Fa=B(Mi=>{"use strict";S();var Ov=pe(),$a=kn(),Rv={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:$a.stringifyNumber},Lv={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():$a.stringifyNumber(e)}},Dv={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new Ov.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:$a.stringifyNumber};Mi.float=Dv;Mi.floatExp=Lv;Mi.floatNaN=Rv});var Ha=B($i=>{"use strict";S();var Gd=kn(),Bi=e=>typeof e=="bigint"||Number.isInteger(e),qa=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function zd(e,t,n){let{value:r}=e;return Bi(r)&&r>=0?n+r.toString(t):Gd.stringifyNumber(e)}var Mv={identify:e=>Bi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>qa(e,2,8,n),stringify:e=>zd(e,8,"0o")},Bv={identify:Bi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>qa(e,0,10,n),stringify:Gd.stringifyNumber},$v={identify:e=>Bi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>qa(e,2,16,n),stringify:e=>zd(e,16,"0x")};$i.int=Bv;$i.intHex=$v;$i.intOct=Mv});var Xd=B(Vd=>{"use strict";S();var Fv=yn(),qv=Di(),Hv=xn(),Uv=er(),jv=Ba(),Ua=Fa(),ja=Ha(),Wv=[Fv.map,Hv.seq,Uv.string,qv.nullTag,jv.boolTag,ja.intOct,ja.int,ja.intHex,Ua.floatNaN,Ua.floatExp,Ua.float];Vd.schema=Wv});var Qd=B(Jd=>{"use strict";S();var Kv=pe(),Gv=yn(),zv=xn();function Yd(e){return typeof e=="bigint"||Number.isInteger(e)}var Fi=({value:e})=>JSON.stringify(e),Vv=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Fi},{identify:e=>e==null,createNode:()=>new Kv.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Fi},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Fi},{identify:Yd,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Yd(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Fi}],Xv={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Yv=[Gv.map,zv.seq].concat(Vv,Xv);Jd.schema=Yv});var Ka=B(Zd=>{"use strict";S();var tr=ri("buffer"),Wa=pe(),Jv=Yn(),Qv={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof tr.Buffer=="function")return tr.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,s){if(!n)return"";let a=n,o;if(typeof tr.Buffer=="function")o=a instanceof tr.Buffer?a.toString("base64"):tr.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<a.length;++l)c+=String.fromCharCode(a[l]);o=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Wa.Scalar.BLOCK_LITERAL),t!==Wa.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(o.length/c),u=new Array(l);for(let d=0,p=0;d<l;++d,p+=c)u[d]=o.substr(p,c);o=u.join(t===Wa.Scalar.BLOCK_LITERAL?`
5230
- `:" ")}return Jv.stringifyString({comment:e,type:t,value:o},r,i,s)}};Zd.binary=Qv});var Ui=B(Hi=>{"use strict";S();var qi=X(),Ga=Rt(),Zv=pe(),ew=Mt();function ep(e,t){if(qi.isSeq(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!qi.isPair(r)){if(qi.isMap(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");let i=r.items[0]||new Ga.Pair(new Zv.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
5561
+ ${i}${h}`}else return`${p}${a}${d.join(" ")}${a}${h}`}function Pi({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let s=Ii.indentComment(t(r),e);n.push(s.trimStart())}}Rd.stringifyCollection=uv});var Mt=B(Ma=>{"use strict";S();var fv=Ra(),gv=Pa(),bv=bi(),Lt=X(),Oi=Rt(),vv=pe();function Zn(e,t){let n=Lt.isScalar(t)?t.value:t;for(let r of e)if(Lt.isPair(r)&&(r.key===t||r.key===n||Lt.isScalar(r.key)&&r.key.value===n))return r}var La=class extends bv.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Lt.MAP,t),this.items=[]}static from(t,n,r){let{keepUndefined:i,replacer:s}=r,a=new this(t),o=(c,l)=>{if(typeof s=="function")l=s.call(n,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||i)&&a.items.push(Oi.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)o(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))o(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){let r;Lt.isPair(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Oi.Pair(t,t?.value):r=new Oi.Pair(t.key,t.value);let i=Zn(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Lt.isScalar(i.value)&&vv.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(s){let a=this.items.findIndex(o=>s(r,o)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(t){let n=Zn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let i=Zn(this.items,t)?.value;return(!n&&Lt.isScalar(i)?i.value:i)??void 0}has(t){return!!Zn(this.items,t)}set(t,n){this.add(new Oi.Pair(t,n),!0)}toJSON(t,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let s of this.items)gv.addPairToJSMap(n,i,s);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(let i of this.items)if(!Lt.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),fv.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}};Ma.YAMLMap=La;Ma.findPair=Zn});var xn=B(Md=>{"use strict";S();var wv=X(),Ld=Mt(),xv={collection:"map",default:!0,nodeClass:Ld.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return wv.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ld.YAMLMap.from(e,t,n)};Md.map=xv});var Dt=B(Dd=>{"use strict";S();var yv=Gn(),kv=Ra(),Tv=bi(),Li=X(),Sv=pe(),Cv=Nt(),Da=class extends Tv.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Li.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=Ri(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let r=Ri(t);if(typeof r!="number")return;let i=this.items[r];return!n&&Li.isScalar(i)?i.value:i}has(t){let n=Ri(t);return typeof n=="number"&&n<this.items.length}set(t,n){let r=Ri(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);let i=this.items[r];Li.isScalar(i)&&Sv.isScalarValue(n)?i.value=n:this.items[r]=n}toJSON(t,n){let r=[];n?.onCreate&&n.onCreate(r);let i=0;for(let s of this.items)r.push(Cv.toJS(s,String(i++),n));return r}toString(t,n,r){return t?kv.stringifyCollection(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){let{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n)){let a=0;for(let o of n){if(typeof i=="function"){let c=n instanceof Set?o:String(a++);o=i.call(n,c,o)}s.items.push(yv.createNode(o,void 0,r))}}return s}};function Ri(e){let t=Li.isScalar(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}Dd.YAMLSeq=Da});var yn=B($d=>{"use strict";S();var Ev=X(),Bd=Dt(),_v={collection:"seq",default:!0,nodeClass:Bd.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Ev.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Bd.YAMLSeq.from(e,t,n)};$d.seq=_v});var er=B(Fd=>{"use strict";S();var Av=Yn(),Nv={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Av.stringifyString(e,t,n,r)}};Fd.string=Nv});var Mi=B(Ud=>{"use strict";S();var qd=pe(),Hd={identify:e=>e==null,createNode:()=>new qd.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new qd.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&Hd.test.test(e)?e:t.options.nullStr};Ud.nullTag=Hd});var Ba=B(Wd=>{"use strict";S();var Iv=pe(),jd={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Iv.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&jd.test.test(e)){let r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};Wd.boolTag=jd});var kn=B(Kd=>{"use strict";S();function Pv({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let o=t-(s.length-a-1);for(;o-- >0;)s+="0"}return s}Kd.stringifyNumber=Pv});var Fa=B(Di=>{"use strict";S();var Ov=pe(),$a=kn(),Rv={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:$a.stringifyNumber},Lv={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():$a.stringifyNumber(e)}},Mv={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new Ov.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:$a.stringifyNumber};Di.float=Mv;Di.floatExp=Lv;Di.floatNaN=Rv});var Ha=B($i=>{"use strict";S();var Gd=kn(),Bi=e=>typeof e=="bigint"||Number.isInteger(e),qa=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function zd(e,t,n){let{value:r}=e;return Bi(r)&&r>=0?n+r.toString(t):Gd.stringifyNumber(e)}var Dv={identify:e=>Bi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>qa(e,2,8,n),stringify:e=>zd(e,8,"0o")},Bv={identify:Bi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>qa(e,0,10,n),stringify:Gd.stringifyNumber},$v={identify:e=>Bi(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>qa(e,2,16,n),stringify:e=>zd(e,16,"0x")};$i.int=Bv;$i.intHex=$v;$i.intOct=Dv});var Xd=B(Vd=>{"use strict";S();var Fv=xn(),qv=Mi(),Hv=yn(),Uv=er(),jv=Ba(),Ua=Fa(),ja=Ha(),Wv=[Fv.map,Hv.seq,Uv.string,qv.nullTag,jv.boolTag,ja.intOct,ja.int,ja.intHex,Ua.floatNaN,Ua.floatExp,Ua.float];Vd.schema=Wv});var Qd=B(Jd=>{"use strict";S();var Kv=pe(),Gv=xn(),zv=yn();function Yd(e){return typeof e=="bigint"||Number.isInteger(e)}var Fi=({value:e})=>JSON.stringify(e),Vv=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Fi},{identify:e=>e==null,createNode:()=>new Kv.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Fi},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Fi},{identify:Yd,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Yd(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Fi}],Xv={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Yv=[Gv.map,zv.seq].concat(Vv,Xv);Jd.schema=Yv});var Ka=B(Zd=>{"use strict";S();var tr=ri("buffer"),Wa=pe(),Jv=Yn(),Qv={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof tr.Buffer=="function")return tr.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,s){if(!n)return"";let a=n,o;if(typeof tr.Buffer=="function")o=a instanceof tr.Buffer?a.toString("base64"):tr.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<a.length;++l)c+=String.fromCharCode(a[l]);o=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Wa.Scalar.BLOCK_LITERAL),t!==Wa.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(o.length/c),u=new Array(l);for(let d=0,p=0;d<l;++d,p+=c)u[d]=o.substr(p,c);o=u.join(t===Wa.Scalar.BLOCK_LITERAL?`
5562
+ `:" ")}return Jv.stringifyString({comment:e,type:t,value:o},r,i,s)}};Zd.binary=Qv});var Ui=B(Hi=>{"use strict";S();var qi=X(),Ga=Rt(),Zv=pe(),ew=Dt();function ep(e,t){if(qi.isSeq(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!qi.isPair(r)){if(qi.isMap(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");let i=r.items[0]||new Ga.Pair(new Zv.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
5231
5563
  ${i.key.commentBefore}`:r.commentBefore),r.comment){let s=i.value??i.key;s.comment=s.comment?`${r.comment}
5232
- ${s.comment}`:r.comment}r=i}e.items[n]=qi.isPair(r)?r:new Ga.Pair(r)}}else t("Expected a sequence for this tag");return e}function tp(e,t,n){let{replacer:r}=n,i=new ew.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(s++),a));let o,c;if(Array.isArray(a))if(a.length===2)o=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let l=Object.keys(a);if(l.length===1)o=l[0],c=a[o];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else o=a;i.items.push(Ga.createPair(o,c,n))}return i}var tw={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ep,createNode:tp};Hi.createPairs=tp;Hi.pairs=tw;Hi.resolvePairs=ep});var Xa=B(Va=>{"use strict";S();var np=X(),za=Nt(),nr=Dt(),nw=Mt(),rp=Ui(),Vt=class e extends nw.YAMLSeq{constructor(){super(),this.add=nr.YAMLMap.prototype.add.bind(this),this.delete=nr.YAMLMap.prototype.delete.bind(this),this.get=nr.YAMLMap.prototype.get.bind(this),this.has=nr.YAMLMap.prototype.has.bind(this),this.set=nr.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let s,a;if(np.isPair(i)?(s=za.toJS(i.key,"",n),a=za.toJS(i.value,s,n)):s=za.toJS(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,a)}return r}static from(t,n,r){let i=rp.createPairs(t,n,r),s=new this;return s.items=i.items,s}};Vt.tag="tag:yaml.org,2002:omap";var rw={collection:"seq",identify:e=>e instanceof Map,nodeClass:Vt,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=rp.resolvePairs(e,t),r=[];for(let{key:i}of n.items)np.isScalar(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Vt,n)},createNode:(e,t,n)=>Vt.from(e,t,n)};Va.YAMLOMap=Vt;Va.omap=rw});var lp=B(Ya=>{"use strict";S();var ip=pe();function sp({value:e,source:t},n){return t&&(e?ap:op).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var ap={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ip.Scalar(!0),stringify:sp},op={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ip.Scalar(!1),stringify:sp};Ya.falseTag=op;Ya.trueTag=ap});var cp=B(ji=>{"use strict";S();var iw=pe(),Ja=kn(),sw={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ja.stringifyNumber},aw={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Ja.stringifyNumber(e)}},ow={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new iw.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Ja.stringifyNumber};ji.float=ow;ji.floatExp=aw;ji.floatNaN=sw});var pp=B(ir=>{"use strict";S();var dp=kn(),rr=e=>typeof e=="bigint"||Number.isInteger(e);function Wi(e,t,n,{intAsBigInt:r}){let i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let a=BigInt(e);return i==="-"?BigInt(-1)*a:a}let s=parseInt(e,n);return i==="-"?-1*s:s}function Qa(e,t,n){let{value:r}=e;if(rr(r)){let i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return dp.stringifyNumber(e)}var lw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Wi(e,2,2,n),stringify:e=>Qa(e,2,"0b")},cw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Wi(e,1,8,n),stringify:e=>Qa(e,8,"0")},dw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Wi(e,0,10,n),stringify:dp.stringifyNumber},pw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Wi(e,2,16,n),stringify:e=>Qa(e,16,"0x")};ir.int=dw;ir.intBin=lw;ir.intHex=pw;ir.intOct=cw});var eo=B(Za=>{"use strict";S();var zi=X(),Ki=Rt(),Gi=Dt(),Xt=class e extends Gi.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;zi.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ki.Pair(t.key,null):n=new Ki.Pair(t,null),Gi.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let r=Gi.findPair(this.items,t);return!n&&zi.isPair(r)?zi.isScalar(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=Gi.findPair(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Ki.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){let{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof i=="function"&&(a=i.call(n,a,a)),s.items.push(Ki.createPair(a,null,r));return s}};Xt.tag="tag:yaml.org,2002:set";var uw={collection:"map",identify:e=>e instanceof Set,nodeClass:Xt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Xt.from(e,t,n),resolve(e,t){if(zi.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new Xt,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};Za.YAMLSet=Xt;Za.set=uw});var no=B(Vi=>{"use strict";S();var hw=kn();function to(e,t){let n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=a=>t?BigInt(a):Number(a),s=r.replace(/_/g,"").split(":").reduce((a,o)=>a*i(60)+i(o),i(0));return n==="-"?i(-1)*s:s}function up(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return hw.stringifyNumber(e);let r="";t<0&&(r="-",t*=n(-1));let i=n(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),r+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var mw={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>to(e,n),stringify:up},fw={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>to(e,!1),stringify:up},hp={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(hp.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,s,a,o]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,i,s||0,a||0,o||0,c),u=t[8];if(u&&u!=="Z"){let d=to(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Vi.floatTime=fw;Vi.intTime=mw;Vi.timestamp=hp});var gp=B(fp=>{"use strict";S();var gw=yn(),bw=Di(),vw=xn(),ww=er(),yw=Ka(),mp=lp(),ro=cp(),Xi=pp(),xw=Ai(),kw=Xa(),Tw=Ui(),Sw=eo(),io=no(),Cw=[gw.map,vw.seq,ww.string,bw.nullTag,mp.trueTag,mp.falseTag,Xi.intBin,Xi.intOct,Xi.int,Xi.intHex,ro.floatNaN,ro.floatExp,ro.float,yw.binary,xw.merge,kw.omap,Tw.pairs,Sw.set,io.intTime,io.floatTime,io.timestamp];fp.schema=Cw});var Ep=B(oo=>{"use strict";S();var yp=yn(),Ew=Di(),xp=xn(),Aw=er(),_w=Ba(),so=Fa(),ao=Ha(),Nw=Xd(),Pw=Qd(),kp=Ka(),sr=Ai(),Tp=Xa(),Sp=Ui(),bp=gp(),Cp=eo(),Yi=no(),vp=new Map([["core",Nw.schema],["failsafe",[yp.map,xp.seq,Aw.string]],["json",Pw.schema],["yaml11",bp.schema],["yaml-1.1",bp.schema]]),wp={binary:kp.binary,bool:_w.boolTag,float:so.float,floatExp:so.floatExp,floatNaN:so.floatNaN,floatTime:Yi.floatTime,int:ao.int,intHex:ao.intHex,intOct:ao.intOct,intTime:Yi.intTime,map:yp.map,merge:sr.merge,null:Ew.nullTag,omap:Tp.omap,pairs:Sp.pairs,seq:xp.seq,set:Cp.set,timestamp:Yi.timestamp},Iw={"tag:yaml.org,2002:binary":kp.binary,"tag:yaml.org,2002:merge":sr.merge,"tag:yaml.org,2002:omap":Tp.omap,"tag:yaml.org,2002:pairs":Sp.pairs,"tag:yaml.org,2002:set":Cp.set,"tag:yaml.org,2002:timestamp":Yi.timestamp};function Ow(e,t,n){let r=vp.get(t);if(r&&!e)return n&&!r.includes(sr.merge)?r.concat(sr.merge):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let s=Array.from(vp.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(let s of e)i=i.concat(s);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(sr.merge)),i.reduce((s,a)=>{let o=typeof a=="string"?wp[a]:a;if(!o){let c=JSON.stringify(a),l=Object.keys(wp).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return s.includes(o)||s.push(o),s},[])}oo.coreKnownTags=Iw;oo.getTags=Ow});var po=B(Ap=>{"use strict";S();var lo=X(),Rw=yn(),Lw=xn(),Dw=er(),Ji=Ep(),Mw=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,co=class e{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?Ji.getTags(t,"compat"):t?Ji.getTags(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Ji.coreKnownTags:{},this.tags=Ji.getTags(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,lo.MAP,{value:Rw.map}),Object.defineProperty(this,lo.SCALAR,{value:Dw.string}),Object.defineProperty(this,lo.SEQ,{value:Lw.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?Mw:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};Ap.Schema=co});var Np=B(_p=>{"use strict";S();var Bw=X(),uo=Jn(),ar=zn();function $w(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(n.push(c),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");let i=uo.createStringifyContext(e,t),{commentString:s}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=s(e.commentBefore);n.unshift(ar.indentComment(c,""))}let a=!1,o=null;if(e.contents){if(Bw.isNode(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){let u=s(e.contents.commentBefore);n.push(ar.indentComment(u,""))}i.forceBlockIndent=!!e.comment,o=e.contents.comment}let c=o?void 0:()=>a=!0,l=uo.stringify(e.contents,i,()=>o=null,c);o&&(l+=ar.lineComment(l,"",s(o))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(uo.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=s(e.comment);c.includes(`
5564
+ ${s.comment}`:r.comment}r=i}e.items[n]=qi.isPair(r)?r:new Ga.Pair(r)}}else t("Expected a sequence for this tag");return e}function tp(e,t,n){let{replacer:r}=n,i=new ew.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(s++),a));let o,c;if(Array.isArray(a))if(a.length===2)o=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let l=Object.keys(a);if(l.length===1)o=l[0],c=a[o];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else o=a;i.items.push(Ga.createPair(o,c,n))}return i}var tw={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ep,createNode:tp};Hi.createPairs=tp;Hi.pairs=tw;Hi.resolvePairs=ep});var Xa=B(Va=>{"use strict";S();var np=X(),za=Nt(),nr=Mt(),nw=Dt(),rp=Ui(),Vt=class e extends nw.YAMLSeq{constructor(){super(),this.add=nr.YAMLMap.prototype.add.bind(this),this.delete=nr.YAMLMap.prototype.delete.bind(this),this.get=nr.YAMLMap.prototype.get.bind(this),this.has=nr.YAMLMap.prototype.has.bind(this),this.set=nr.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let s,a;if(np.isPair(i)?(s=za.toJS(i.key,"",n),a=za.toJS(i.value,s,n)):s=za.toJS(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,a)}return r}static from(t,n,r){let i=rp.createPairs(t,n,r),s=new this;return s.items=i.items,s}};Vt.tag="tag:yaml.org,2002:omap";var rw={collection:"seq",identify:e=>e instanceof Map,nodeClass:Vt,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=rp.resolvePairs(e,t),r=[];for(let{key:i}of n.items)np.isScalar(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Vt,n)},createNode:(e,t,n)=>Vt.from(e,t,n)};Va.YAMLOMap=Vt;Va.omap=rw});var lp=B(Ya=>{"use strict";S();var ip=pe();function sp({value:e,source:t},n){return t&&(e?ap:op).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var ap={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ip.Scalar(!0),stringify:sp},op={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ip.Scalar(!1),stringify:sp};Ya.falseTag=op;Ya.trueTag=ap});var cp=B(ji=>{"use strict";S();var iw=pe(),Ja=kn(),sw={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ja.stringifyNumber},aw={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Ja.stringifyNumber(e)}},ow={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new iw.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Ja.stringifyNumber};ji.float=ow;ji.floatExp=aw;ji.floatNaN=sw});var pp=B(ir=>{"use strict";S();var dp=kn(),rr=e=>typeof e=="bigint"||Number.isInteger(e);function Wi(e,t,n,{intAsBigInt:r}){let i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let a=BigInt(e);return i==="-"?BigInt(-1)*a:a}let s=parseInt(e,n);return i==="-"?-1*s:s}function Qa(e,t,n){let{value:r}=e;if(rr(r)){let i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return dp.stringifyNumber(e)}var lw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Wi(e,2,2,n),stringify:e=>Qa(e,2,"0b")},cw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Wi(e,1,8,n),stringify:e=>Qa(e,8,"0")},dw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Wi(e,0,10,n),stringify:dp.stringifyNumber},pw={identify:rr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Wi(e,2,16,n),stringify:e=>Qa(e,16,"0x")};ir.int=dw;ir.intBin=lw;ir.intHex=pw;ir.intOct=cw});var eo=B(Za=>{"use strict";S();var zi=X(),Ki=Rt(),Gi=Mt(),Xt=class e extends Gi.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;zi.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ki.Pair(t.key,null):n=new Ki.Pair(t,null),Gi.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let r=Gi.findPair(this.items,t);return!n&&zi.isPair(r)?zi.isScalar(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=Gi.findPair(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Ki.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){let{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof i=="function"&&(a=i.call(n,a,a)),s.items.push(Ki.createPair(a,null,r));return s}};Xt.tag="tag:yaml.org,2002:set";var uw={collection:"map",identify:e=>e instanceof Set,nodeClass:Xt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Xt.from(e,t,n),resolve(e,t){if(zi.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new Xt,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};Za.YAMLSet=Xt;Za.set=uw});var no=B(Vi=>{"use strict";S();var hw=kn();function to(e,t){let n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=a=>t?BigInt(a):Number(a),s=r.replace(/_/g,"").split(":").reduce((a,o)=>a*i(60)+i(o),i(0));return n==="-"?i(-1)*s:s}function up(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return hw.stringifyNumber(e);let r="";t<0&&(r="-",t*=n(-1));let i=n(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),r+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var mw={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>to(e,n),stringify:up},fw={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>to(e,!1),stringify:up},hp={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(hp.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,s,a,o]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,i,s||0,a||0,o||0,c),u=t[8];if(u&&u!=="Z"){let d=to(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Vi.floatTime=fw;Vi.intTime=mw;Vi.timestamp=hp});var gp=B(fp=>{"use strict";S();var gw=xn(),bw=Mi(),vw=yn(),ww=er(),xw=Ka(),mp=lp(),ro=cp(),Xi=pp(),yw=_i(),kw=Xa(),Tw=Ui(),Sw=eo(),io=no(),Cw=[gw.map,vw.seq,ww.string,bw.nullTag,mp.trueTag,mp.falseTag,Xi.intBin,Xi.intOct,Xi.int,Xi.intHex,ro.floatNaN,ro.floatExp,ro.float,xw.binary,yw.merge,kw.omap,Tw.pairs,Sw.set,io.intTime,io.floatTime,io.timestamp];fp.schema=Cw});var Ep=B(oo=>{"use strict";S();var xp=xn(),Ew=Mi(),yp=yn(),_w=er(),Aw=Ba(),so=Fa(),ao=Ha(),Nw=Xd(),Iw=Qd(),kp=Ka(),sr=_i(),Tp=Xa(),Sp=Ui(),bp=gp(),Cp=eo(),Yi=no(),vp=new Map([["core",Nw.schema],["failsafe",[xp.map,yp.seq,_w.string]],["json",Iw.schema],["yaml11",bp.schema],["yaml-1.1",bp.schema]]),wp={binary:kp.binary,bool:Aw.boolTag,float:so.float,floatExp:so.floatExp,floatNaN:so.floatNaN,floatTime:Yi.floatTime,int:ao.int,intHex:ao.intHex,intOct:ao.intOct,intTime:Yi.intTime,map:xp.map,merge:sr.merge,null:Ew.nullTag,omap:Tp.omap,pairs:Sp.pairs,seq:yp.seq,set:Cp.set,timestamp:Yi.timestamp},Pw={"tag:yaml.org,2002:binary":kp.binary,"tag:yaml.org,2002:merge":sr.merge,"tag:yaml.org,2002:omap":Tp.omap,"tag:yaml.org,2002:pairs":Sp.pairs,"tag:yaml.org,2002:set":Cp.set,"tag:yaml.org,2002:timestamp":Yi.timestamp};function Ow(e,t,n){let r=vp.get(t);if(r&&!e)return n&&!r.includes(sr.merge)?r.concat(sr.merge):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let s=Array.from(vp.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(let s of e)i=i.concat(s);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(sr.merge)),i.reduce((s,a)=>{let o=typeof a=="string"?wp[a]:a;if(!o){let c=JSON.stringify(a),l=Object.keys(wp).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return s.includes(o)||s.push(o),s},[])}oo.coreKnownTags=Pw;oo.getTags=Ow});var po=B(_p=>{"use strict";S();var lo=X(),Rw=xn(),Lw=yn(),Mw=er(),Ji=Ep(),Dw=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,co=class e{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?Ji.getTags(t,"compat"):t?Ji.getTags(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Ji.coreKnownTags:{},this.tags=Ji.getTags(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,lo.MAP,{value:Rw.map}),Object.defineProperty(this,lo.SCALAR,{value:Mw.string}),Object.defineProperty(this,lo.SEQ,{value:Lw.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?Dw:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};_p.Schema=co});var Np=B(Ap=>{"use strict";S();var Bw=X(),uo=Jn(),ar=zn();function $w(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(n.push(c),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");let i=uo.createStringifyContext(e,t),{commentString:s}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=s(e.commentBefore);n.unshift(ar.indentComment(c,""))}let a=!1,o=null;if(e.contents){if(Bw.isNode(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){let u=s(e.contents.commentBefore);n.push(ar.indentComment(u,""))}i.forceBlockIndent=!!e.comment,o=e.contents.comment}let c=o?void 0:()=>a=!0,l=uo.stringify(e.contents,i,()=>o=null,c);o&&(l+=ar.lineComment(l,"",s(o))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(uo.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=s(e.comment);c.includes(`
5233
5565
  `)?(n.push("..."),n.push(ar.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&a&&(c=c.replace(/^\n+/,"")),c&&((!a||o)&&n[n.length-1]!==""&&n.push(""),n.push(ar.indentComment(s(c),"")))}return n.join(`
5234
5566
  `)+`
5235
- `}_p.stringifyDocument=$w});var or=B(Pp=>{"use strict";S();var Fw=Kn(),Tn=bi(),Me=X(),qw=Rt(),Hw=Nt(),Uw=po(),jw=Np(),ho=hi(),Ww=ga(),Kw=Gn(),mo=fa(),fo=class e{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Me.NODE_TYPE,{value:Me.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:a}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new mo.Directives({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){let t=Object.create(e.prototype,{[Me.NODE_TYPE]:{value:Me.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Me.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Sn(this.contents)&&this.contents.add(t)}addIn(t,n){Sn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let r=ho.anchorNames(this);t.anchor=!n||r.has(n)?ho.findNewAnchor(n||"a",r):n}return new Fw.Alias(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){let g=T=>typeof T=="number"||T instanceof String||T instanceof Number,y=n.filter(g).map(String);y.length>0&&(n=n.concat(y)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:o,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:d,setAnchors:p,sourceObjects:h}=ho.createNodeAnchors(this,a||"a"),f={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:h},m=Kw.createNode(t,u,f);return o&&Me.isCollection(m)&&(m.flow=!0),p(),m}createPair(t,n,r={}){let i=this.createNode(t,null,r),s=this.createNode(n,null,r);return new qw.Pair(i,s)}delete(t){return Sn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Tn.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):Sn(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Me.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Tn.isEmptyPath(t)?!n&&Me.isScalar(this.contents)?this.contents.value:this.contents:Me.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Me.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return Tn.isEmptyPath(t)?this.contents!==void 0:Me.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Tn.collectionFromPath(this.schema,[t],n):Sn(this.contents)&&this.contents.set(t,n)}setIn(t,n){Tn.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=Tn.collectionFromPath(this.schema,Array.from(t),n):Sn(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new mo.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new mo.Directives({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Uw.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Hw.toJS(this.contents,n??"",o);if(typeof s=="function")for(let{count:l,res:u}of o.anchors.values())s(u,l);return typeof a=="function"?Ww.applyReviver(a,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return jw.stringifyDocument(this,t)}};function Sn(e){if(Me.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}Pp.Document=fo});var dr=B(cr=>{"use strict";S();var lr=class extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}},go=class extends lr{constructor(t,n,r){super("YAMLParseError",t,n,r)}},bo=class extends lr{constructor(t,n,r){super("YAMLWarning",t,n,r)}},Gw=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(o=>t.linePos(o));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){let o=Math.min(s-39,a.length-79);a="\u2026"+a.substring(o),s-=o-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(a.substring(0,s))){let o=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);o.length>80&&(o=o.substring(0,79)+`\u2026
5567
+ `}Ap.stringifyDocument=$w});var or=B(Ip=>{"use strict";S();var Fw=Kn(),Tn=bi(),De=X(),qw=Rt(),Hw=Nt(),Uw=po(),jw=Np(),ho=hi(),Ww=ga(),Kw=Gn(),mo=fa(),fo=class e{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,De.NODE_TYPE,{value:De.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:a}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new mo.Directives({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){let t=Object.create(e.prototype,{[De.NODE_TYPE]:{value:De.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=De.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Sn(this.contents)&&this.contents.add(t)}addIn(t,n){Sn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let r=ho.anchorNames(this);t.anchor=!n||r.has(n)?ho.findNewAnchor(n||"a",r):n}return new Fw.Alias(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){let g=T=>typeof T=="number"||T instanceof String||T instanceof Number,x=n.filter(g).map(String);x.length>0&&(n=n.concat(x)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:o,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:d,setAnchors:p,sourceObjects:h}=ho.createNodeAnchors(this,a||"a"),f={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:h},m=Kw.createNode(t,u,f);return o&&De.isCollection(m)&&(m.flow=!0),p(),m}createPair(t,n,r={}){let i=this.createNode(t,null,r),s=this.createNode(n,null,r);return new qw.Pair(i,s)}delete(t){return Sn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Tn.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):Sn(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return De.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Tn.isEmptyPath(t)?!n&&De.isScalar(this.contents)?this.contents.value:this.contents:De.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return De.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return Tn.isEmptyPath(t)?this.contents!==void 0:De.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Tn.collectionFromPath(this.schema,[t],n):Sn(this.contents)&&this.contents.set(t,n)}setIn(t,n){Tn.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=Tn.collectionFromPath(this.schema,Array.from(t),n):Sn(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new mo.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new mo.Directives({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Uw.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Hw.toJS(this.contents,n??"",o);if(typeof s=="function")for(let{count:l,res:u}of o.anchors.values())s(u,l);return typeof a=="function"?Ww.applyReviver(a,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return jw.stringifyDocument(this,t)}};function Sn(e){if(De.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}Ip.Document=fo});var dr=B(cr=>{"use strict";S();var lr=class extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}},go=class extends lr{constructor(t,n,r){super("YAMLParseError",t,n,r)}},bo=class extends lr{constructor(t,n,r){super("YAMLWarning",t,n,r)}},Gw=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(o=>t.linePos(o));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){let o=Math.min(s-39,a.length-79);a="\u2026"+a.substring(o),s-=o-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(a.substring(0,s))){let o=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);o.length>80&&(o=o.substring(0,79)+`\u2026
5236
5568
  `),a=o+a}if(/[^ ]/.test(a)){let o=1,c=n.linePos[1];c?.line===r&&c.col>i&&(o=Math.max(1,Math.min(c.col-i,80-s)));let l=" ".repeat(s)+"^".repeat(o);n.message+=`:
5237
5569
 
5238
5570
  ${a}
5239
5571
  ${l}
5240
- `}};cr.YAMLError=lr;cr.YAMLParseError=go;cr.YAMLWarning=bo;cr.prettifyError=Gw});var pr=B(Ip=>{"use strict";S();function zw(e,{flow:t,indicator:n,next:r,offset:i,onError:s,parentIndent:a,startOnNewline:o}){let c=!1,l=o,u=o,d="",p="",h=!1,f=!1,m=null,g=null,y=null,T=null,b=null,C=null,_=null;for(let v of e)switch(f&&(v.type!=="space"&&v.type!=="newline"&&v.type!=="comma"&&s(v.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),m&&(l&&v.type!=="comment"&&v.type!=="newline"&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),v.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&v.source.includes(" ")&&(m=v),u=!0;break;case"comment":{u||s(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=v.source.substring(1)||" ";d?d+=p+A:d=A,p="",l=!1;break}case"newline":l?d?d+=v.source:(!C||n!=="seq-item-ind")&&(c=!0):p+=v.source,l=!0,h=!0,(g||y)&&(T=v),u=!0;break;case"anchor":g&&s(v,"MULTIPLE_ANCHORS","A node can have at most one anchor"),v.source.endsWith(":")&&s(v.offset+v.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=v,_??(_=v.offset),l=!1,u=!1,f=!0;break;case"tag":{y&&s(v,"MULTIPLE_TAGS","A node can have at most one tag"),y=v,_??(_=v.offset),l=!1,u=!1,f=!0;break}case n:(g||y)&&s(v,"BAD_PROP_ORDER",`Anchors and tags must be after the ${v.source} indicator`),C&&s(v,"UNEXPECTED_TOKEN",`Unexpected ${v.source} in ${t??"collection"}`),C=v,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){b&&s(v,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=v,l=!1,u=!1;break}default:s(v,"UNEXPECTED_TOKEN",`Unexpected ${v.type} token`),l=!1,u=!1}let w=e[e.length-1],x=w?w.offset+w.source.length:i;return f&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(l&&m.indent<=a||r?.type==="block-map"||r?.type==="block-seq")&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:C,spaceBefore:c,comment:d,hasNewline:h,anchor:g,tag:y,newlineAfterProp:T,end:x,start:_??x}}Ip.resolveProps=zw});var Qi=B(Op=>{"use strict";S();function vo(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
5241
- `))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(vo(t.key)||vo(t.value))return!0}return!1;default:return!0}}Op.containsNewline=vo});var wo=B(Rp=>{"use strict";S();var Vw=Qi();function Xw(e,t,n){if(t?.type==="flow-collection"){let r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Vw.containsNewline(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Rp.flowIndentCheck=Xw});var yo=B(Dp=>{"use strict";S();var Lp=X();function Yw(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r=="function"?r:(s,a)=>s===a||Lp.isScalar(s)&&Lp.isScalar(a)&&s.value===a.value;return t.some(s=>i(s.key,n))}Dp.mapIncludes=Yw});var Hp=B(qp=>{"use strict";S();var Mp=Rt(),Jw=Dt(),Bp=pr(),Qw=Qi(),$p=wo(),Zw=yo(),Fp="All mapping items must start at the same column";function e0({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=s?.nodeClass??Jw.YAMLMap,o=new a(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:d,key:p,sep:h,value:f}=u,m=Bp.resolveProps(d,{indicator:"explicit-key-ind",next:p??h?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),g=!m.found;if(g){if(p&&(p.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&i(c,"BAD_INDENT",Fp)),!m.anchor&&!m.tag&&!h){l=m.end,m.comment&&(o.comment?o.comment+=`
5242
- `+m.comment:o.comment=m.comment);continue}(m.newlineAfterProp||Qw.containsNewline(p))&&i(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==r.indent&&i(c,"BAD_INDENT",Fp);n.atKey=!0;let y=m.end,T=p?e(n,p,m,i):t(n,y,d,null,m,i);n.schema.compat&&$p.flowIndentCheck(r.indent,p,i),n.atKey=!1,Zw.mapIncludes(n,o.items,T)&&i(y,"DUPLICATE_KEY","Map keys must be unique");let b=Bp.resolveProps(h??[],{indicator:"map-value-ind",next:f,offset:T.range[2],onError:i,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=b.end,b.found){g&&(f?.type==="block-map"&&!b.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<b.found.offset-1024&&i(T.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let C=f?e(n,f,b,i):t(n,c,h,null,b,i);n.schema.compat&&$p.flowIndentCheck(r.indent,f,i),c=C.range[2];let _=new Mp.Pair(T,C);n.options.keepSourceTokens&&(_.srcToken=u),o.items.push(_)}else{g&&i(T.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(T.comment?T.comment+=`
5243
- `+b.comment:T.comment=b.comment);let C=new Mp.Pair(T);n.options.keepSourceTokens&&(C.srcToken=u),o.items.push(C)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),o.range=[r.offset,c,l??c],o}qp.resolveBlockMap=e0});var jp=B(Up=>{"use strict";S();var t0=Mt(),n0=pr(),r0=wo();function i0({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=s?.nodeClass??t0.YAMLSeq,o=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:d}of r.items){let p=n0.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d?.type==="block-seq"?i(p.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(o.comment=p.comment);continue}let h=d?e(n,d,p,i):t(n,p.end,u,null,p,i);n.schema.compat&&r0.flowIndentCheck(r.indent,d,i),c=h.range[2],o.items.push(h)}return o.range=[r.offset,c,l??c],o}Up.resolveBlockSeq=i0});var Cn=B(Wp=>{"use strict";S();function s0(e,t,n,r){let i="";if(e){let s=!1,a="";for(let o of e){let{source:c,type:l}=o;switch(l){case"space":s=!0;break;case"comment":{n&&!s&&r(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=a+u:i=u,a="";break}case"newline":i&&(a+=c),s=!0;break;default:r(o,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:i,offset:t}}Wp.resolveEnd=s0});var Vp=B(zp=>{"use strict";S();var a0=X(),o0=Rt(),Kp=Dt(),l0=Mt(),c0=Cn(),Gp=pr(),d0=Qi(),p0=yo(),xo="Block collections are not allowed within flow collections",ko=e=>e&&(e.type==="block-map"||e.type==="block-seq");function u0({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=r.start.source==="{",o=a?"flow map":"flow sequence",c=s?.nodeClass??(a?Kp.YAMLMap:l0.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset+r.start.source.length;for(let g=0;g<r.items.length;++g){let y=r.items[g],{start:T,key:b,sep:C,value:_}=y,w=Gp.resolveProps(T,{flow:o,indicator:"explicit-key-ind",next:b??C?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!w.found){if(!w.anchor&&!w.tag&&!C&&!_){g===0&&w.comma?i(w.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):g<r.items.length-1&&i(w.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),w.comment&&(l.comment?l.comment+=`
5244
- `+w.comment:l.comment=w.comment),d=w.end;continue}!a&&n.options.strict&&d0.containsNewline(b)&&i(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)w.comma&&i(w.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(w.comma||i(w.start,"MISSING_CHAR",`Missing , between ${o} items`),w.comment){let x="";e:for(let v of T)switch(v.type){case"comma":case"space":break;case"comment":x=v.source.substring(1);break e;default:break e}if(x){let v=l.items[l.items.length-1];a0.isPair(v)&&(v=v.value??v.key),v.comment?v.comment+=`
5245
- `+x:v.comment=x,w.comment=w.comment.substring(x.length+1)}}if(!a&&!C&&!w.found){let x=_?e(n,_,w,i):t(n,w.end,C,null,w,i);l.items.push(x),d=x.range[2],ko(_)&&i(x.range,"BLOCK_IN_FLOW",xo)}else{n.atKey=!0;let x=w.end,v=b?e(n,b,w,i):t(n,x,T,null,w,i);ko(b)&&i(v.range,"BLOCK_IN_FLOW",xo),n.atKey=!1;let A=Gp.resolveProps(C??[],{flow:o,indicator:"map-value-ind",next:_,offset:v.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(A.found){if(!a&&!w.found&&n.options.strict){if(C)for(let O of C){if(O===A.found)break;if(O.type==="newline"){i(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}w.start<A.found.offset-1024&&i(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else _&&("source"in _&&_.source?.[0]===":"?i(_,"MISSING_CHAR",`Missing space after : in ${o}`):i(A.start,"MISSING_CHAR",`Missing , or : between ${o} items`));let N=_?e(n,_,A,i):A.found?t(n,A.end,C,null,A,i):null;N?ko(_)&&i(N.range,"BLOCK_IN_FLOW",xo):A.comment&&(v.comment?v.comment+=`
5246
- `+A.comment:v.comment=A.comment);let D=new o0.Pair(v,N);if(n.options.keepSourceTokens&&(D.srcToken=y),a){let O=l;p0.mapIncludes(n,O.items,v)&&i(x,"DUPLICATE_KEY","Map keys must be unique"),O.items.push(D)}else{let O=new Kp.YAMLMap(n.schema);O.flow=!0,O.items.push(D);let F=(N??v).range;O.range=[v.range[0],F[1],F[2]],l.items.push(O)}d=N?N.range[2]:A.end}}let p=a?"}":"]",[h,...f]=r.end,m=d;if(h?.source===p)m=h.offset+h.source.length;else{let g=o[0].toUpperCase()+o.substring(1),y=u?`${g} must end with a ${p}`:`${g} in block collection must be sufficiently indented and end with a ${p}`;i(d,u?"MISSING_CHAR":"BAD_INDENT",y),h&&h.source.length!==1&&f.unshift(h)}if(f.length>0){let g=c0.resolveEnd(f,m,n.options.strict,i);g.comment&&(l.comment?l.comment+=`
5247
- `+g.comment:l.comment=g.comment),l.range=[r.offset,m,g.offset]}else l.range=[r.offset,m,m];return l}zp.resolveFlowCollection=u0});var Yp=B(Xp=>{"use strict";S();var h0=X(),m0=pe(),f0=Dt(),g0=Mt(),b0=Hp(),v0=jp(),w0=Vp();function To(e,t,n,r,i,s){let a=n.type==="block-map"?b0.resolveBlockMap(e,t,n,r,s):n.type==="block-seq"?v0.resolveBlockSeq(e,t,n,r,s):w0.resolveFlowCollection(e,t,n,r,s),o=a.constructor;return i==="!"||i===o.tagName?(a.tag=o.tagName,a):(i&&(a.tag=i),a)}function y0(e,t,n,r,i){let s=r.tag,a=s?t.directives.tagName(s.source,p=>i(s,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){let{anchor:p,newlineAfterProp:h}=r,f=p&&s?p.offset>s.offset?p:s:p??s;f&&(!h||h.offset<f.offset)&&i(f,"MISSING_CHAR","Missing newline after block sequence props")}let o=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===f0.YAMLMap.tagName&&o==="map"||a===g0.YAMLSeq.tagName&&o==="seq")return To(e,t,n,i,a);let c=t.schema.tags.find(p=>p.tag===a&&p.collection===o);if(!c){let p=t.schema.knownTags[a];if(p?.collection===o)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?i(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${o} collection, but expects ${p.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),To(e,t,n,i,a)}let l=To(e,t,n,i,a,c),u=c.resolve?.(l,p=>i(s,"TAG_RESOLVE_FAILED",p),t.options)??l,d=h0.isNode(u)?u:new m0.Scalar(u);return d.range=l.range,d.tag=a,c?.format&&(d.format=c.format),d}Xp.composeCollection=y0});var Co=B(Jp=>{"use strict";S();var So=pe();function x0(e,t,n){let r=t.offset,i=k0(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let s=i.mode===">"?So.Scalar.BLOCK_FOLDED:So.Scalar.BLOCK_LITERAL,a=t.source?T0(t.source):[],o=a.length;for(let m=a.length-1;m>=0;--m){let g=a[m][1];if(g===""||g==="\r")o=m;else break}if(o===0){let m=i.chomp==="+"&&a.length>0?`
5248
- `.repeat(Math.max(1,a.length-1)):"",g=r+i.length;return t.source&&(g+=t.source.length),{value:m,type:s,comment:i.comment,range:[r,g,g]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let m=0;m<o;++m){let[g,y]=a[m];if(y===""||y==="\r")i.indent===0&&g.length>c&&(c=g.length);else{g.length<c&&n(l+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=g.length),u=m,c===0&&!e.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=g.length+y.length+1}for(let m=a.length-1;m>=o;--m)a[m][0].length>c&&(o=m+1);let d="",p="",h=!1;for(let m=0;m<u;++m)d+=a[m][0].slice(c)+`
5249
- `;for(let m=u;m<o;++m){let[g,y]=a[m];l+=g.length+y.length+1;let T=y[y.length-1]==="\r";if(T&&(y=y.slice(0,-1)),y&&g.length<c){let C=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(l-y.length-(T?2:1),"BAD_INDENT",C),g=""}s===So.Scalar.BLOCK_LITERAL?(d+=p+g.slice(c)+y,p=`
5250
- `):g.length>c||y[0]===" "?(p===" "?p=`
5572
+ `}};cr.YAMLError=lr;cr.YAMLParseError=go;cr.YAMLWarning=bo;cr.prettifyError=Gw});var pr=B(Pp=>{"use strict";S();function zw(e,{flow:t,indicator:n,next:r,offset:i,onError:s,parentIndent:a,startOnNewline:o}){let c=!1,l=o,u=o,d="",p="",h=!1,f=!1,m=null,g=null,x=null,T=null,b=null,C=null,A=null;for(let v of e)switch(f&&(v.type!=="space"&&v.type!=="newline"&&v.type!=="comma"&&s(v.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),m&&(l&&v.type!=="comment"&&v.type!=="newline"&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),v.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&v.source.includes(" ")&&(m=v),u=!0;break;case"comment":{u||s(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let _=v.source.substring(1)||" ";d?d+=p+_:d=_,p="",l=!1;break}case"newline":l?d?d+=v.source:(!C||n!=="seq-item-ind")&&(c=!0):p+=v.source,l=!0,h=!0,(g||x)&&(T=v),u=!0;break;case"anchor":g&&s(v,"MULTIPLE_ANCHORS","A node can have at most one anchor"),v.source.endsWith(":")&&s(v.offset+v.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=v,A??(A=v.offset),l=!1,u=!1,f=!0;break;case"tag":{x&&s(v,"MULTIPLE_TAGS","A node can have at most one tag"),x=v,A??(A=v.offset),l=!1,u=!1,f=!0;break}case n:(g||x)&&s(v,"BAD_PROP_ORDER",`Anchors and tags must be after the ${v.source} indicator`),C&&s(v,"UNEXPECTED_TOKEN",`Unexpected ${v.source} in ${t??"collection"}`),C=v,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){b&&s(v,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=v,l=!1,u=!1;break}default:s(v,"UNEXPECTED_TOKEN",`Unexpected ${v.type} token`),l=!1,u=!1}let w=e[e.length-1],y=w?w.offset+w.source.length:i;return f&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(l&&m.indent<=a||r?.type==="block-map"||r?.type==="block-seq")&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:C,spaceBefore:c,comment:d,hasNewline:h,anchor:g,tag:x,newlineAfterProp:T,end:y,start:A??y}}Pp.resolveProps=zw});var Qi=B(Op=>{"use strict";S();function vo(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
5573
+ `))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(vo(t.key)||vo(t.value))return!0}return!1;default:return!0}}Op.containsNewline=vo});var wo=B(Rp=>{"use strict";S();var Vw=Qi();function Xw(e,t,n){if(t?.type==="flow-collection"){let r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Vw.containsNewline(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Rp.flowIndentCheck=Xw});var xo=B(Mp=>{"use strict";S();var Lp=X();function Yw(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r=="function"?r:(s,a)=>s===a||Lp.isScalar(s)&&Lp.isScalar(a)&&s.value===a.value;return t.some(s=>i(s.key,n))}Mp.mapIncludes=Yw});var Hp=B(qp=>{"use strict";S();var Dp=Rt(),Jw=Mt(),Bp=pr(),Qw=Qi(),$p=wo(),Zw=xo(),Fp="All mapping items must start at the same column";function ex({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=s?.nodeClass??Jw.YAMLMap,o=new a(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:d,key:p,sep:h,value:f}=u,m=Bp.resolveProps(d,{indicator:"explicit-key-ind",next:p??h?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),g=!m.found;if(g){if(p&&(p.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&i(c,"BAD_INDENT",Fp)),!m.anchor&&!m.tag&&!h){l=m.end,m.comment&&(o.comment?o.comment+=`
5574
+ `+m.comment:o.comment=m.comment);continue}(m.newlineAfterProp||Qw.containsNewline(p))&&i(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==r.indent&&i(c,"BAD_INDENT",Fp);n.atKey=!0;let x=m.end,T=p?e(n,p,m,i):t(n,x,d,null,m,i);n.schema.compat&&$p.flowIndentCheck(r.indent,p,i),n.atKey=!1,Zw.mapIncludes(n,o.items,T)&&i(x,"DUPLICATE_KEY","Map keys must be unique");let b=Bp.resolveProps(h??[],{indicator:"map-value-ind",next:f,offset:T.range[2],onError:i,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=b.end,b.found){g&&(f?.type==="block-map"&&!b.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<b.found.offset-1024&&i(T.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let C=f?e(n,f,b,i):t(n,c,h,null,b,i);n.schema.compat&&$p.flowIndentCheck(r.indent,f,i),c=C.range[2];let A=new Dp.Pair(T,C);n.options.keepSourceTokens&&(A.srcToken=u),o.items.push(A)}else{g&&i(T.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(T.comment?T.comment+=`
5575
+ `+b.comment:T.comment=b.comment);let C=new Dp.Pair(T);n.options.keepSourceTokens&&(C.srcToken=u),o.items.push(C)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),o.range=[r.offset,c,l??c],o}qp.resolveBlockMap=ex});var jp=B(Up=>{"use strict";S();var tx=Dt(),nx=pr(),rx=wo();function ix({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=s?.nodeClass??tx.YAMLSeq,o=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:d}of r.items){let p=nx.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d?.type==="block-seq"?i(p.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(o.comment=p.comment);continue}let h=d?e(n,d,p,i):t(n,p.end,u,null,p,i);n.schema.compat&&rx.flowIndentCheck(r.indent,d,i),c=h.range[2],o.items.push(h)}return o.range=[r.offset,c,l??c],o}Up.resolveBlockSeq=ix});var Cn=B(Wp=>{"use strict";S();function sx(e,t,n,r){let i="";if(e){let s=!1,a="";for(let o of e){let{source:c,type:l}=o;switch(l){case"space":s=!0;break;case"comment":{n&&!s&&r(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=a+u:i=u,a="";break}case"newline":i&&(a+=c),s=!0;break;default:r(o,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:i,offset:t}}Wp.resolveEnd=sx});var Vp=B(zp=>{"use strict";S();var ax=X(),ox=Rt(),Kp=Mt(),lx=Dt(),cx=Cn(),Gp=pr(),dx=Qi(),px=xo(),yo="Block collections are not allowed within flow collections",ko=e=>e&&(e.type==="block-map"||e.type==="block-seq");function ux({composeNode:e,composeEmptyNode:t},n,r,i,s){let a=r.start.source==="{",o=a?"flow map":"flow sequence",c=s?.nodeClass??(a?Kp.YAMLMap:lx.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset+r.start.source.length;for(let g=0;g<r.items.length;++g){let x=r.items[g],{start:T,key:b,sep:C,value:A}=x,w=Gp.resolveProps(T,{flow:o,indicator:"explicit-key-ind",next:b??C?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!w.found){if(!w.anchor&&!w.tag&&!C&&!A){g===0&&w.comma?i(w.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):g<r.items.length-1&&i(w.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),w.comment&&(l.comment?l.comment+=`
5576
+ `+w.comment:l.comment=w.comment),d=w.end;continue}!a&&n.options.strict&&dx.containsNewline(b)&&i(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)w.comma&&i(w.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(w.comma||i(w.start,"MISSING_CHAR",`Missing , between ${o} items`),w.comment){let y="";e:for(let v of T)switch(v.type){case"comma":case"space":break;case"comment":y=v.source.substring(1);break e;default:break e}if(y){let v=l.items[l.items.length-1];ax.isPair(v)&&(v=v.value??v.key),v.comment?v.comment+=`
5577
+ `+y:v.comment=y,w.comment=w.comment.substring(y.length+1)}}if(!a&&!C&&!w.found){let y=A?e(n,A,w,i):t(n,w.end,C,null,w,i);l.items.push(y),d=y.range[2],ko(A)&&i(y.range,"BLOCK_IN_FLOW",yo)}else{n.atKey=!0;let y=w.end,v=b?e(n,b,w,i):t(n,y,T,null,w,i);ko(b)&&i(v.range,"BLOCK_IN_FLOW",yo),n.atKey=!1;let _=Gp.resolveProps(C??[],{flow:o,indicator:"map-value-ind",next:A,offset:v.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!a&&!w.found&&n.options.strict){if(C)for(let O of C){if(O===_.found)break;if(O.type==="newline"){i(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}w.start<_.found.offset-1024&&i(_.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&A.source?.[0]===":"?i(A,"MISSING_CHAR",`Missing space after : in ${o}`):i(_.start,"MISSING_CHAR",`Missing , or : between ${o} items`));let N=A?e(n,A,_,i):_.found?t(n,_.end,C,null,_,i):null;N?ko(A)&&i(N.range,"BLOCK_IN_FLOW",yo):_.comment&&(v.comment?v.comment+=`
5578
+ `+_.comment:v.comment=_.comment);let M=new ox.Pair(v,N);if(n.options.keepSourceTokens&&(M.srcToken=x),a){let O=l;px.mapIncludes(n,O.items,v)&&i(y,"DUPLICATE_KEY","Map keys must be unique"),O.items.push(M)}else{let O=new Kp.YAMLMap(n.schema);O.flow=!0,O.items.push(M);let F=(N??v).range;O.range=[v.range[0],F[1],F[2]],l.items.push(O)}d=N?N.range[2]:_.end}}let p=a?"}":"]",[h,...f]=r.end,m=d;if(h?.source===p)m=h.offset+h.source.length;else{let g=o[0].toUpperCase()+o.substring(1),x=u?`${g} must end with a ${p}`:`${g} in block collection must be sufficiently indented and end with a ${p}`;i(d,u?"MISSING_CHAR":"BAD_INDENT",x),h&&h.source.length!==1&&f.unshift(h)}if(f.length>0){let g=cx.resolveEnd(f,m,n.options.strict,i);g.comment&&(l.comment?l.comment+=`
5579
+ `+g.comment:l.comment=g.comment),l.range=[r.offset,m,g.offset]}else l.range=[r.offset,m,m];return l}zp.resolveFlowCollection=ux});var Yp=B(Xp=>{"use strict";S();var hx=X(),mx=pe(),fx=Mt(),gx=Dt(),bx=Hp(),vx=jp(),wx=Vp();function To(e,t,n,r,i,s){let a=n.type==="block-map"?bx.resolveBlockMap(e,t,n,r,s):n.type==="block-seq"?vx.resolveBlockSeq(e,t,n,r,s):wx.resolveFlowCollection(e,t,n,r,s),o=a.constructor;return i==="!"||i===o.tagName?(a.tag=o.tagName,a):(i&&(a.tag=i),a)}function xx(e,t,n,r,i){let s=r.tag,a=s?t.directives.tagName(s.source,p=>i(s,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){let{anchor:p,newlineAfterProp:h}=r,f=p&&s?p.offset>s.offset?p:s:p??s;f&&(!h||h.offset<f.offset)&&i(f,"MISSING_CHAR","Missing newline after block sequence props")}let o=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===fx.YAMLMap.tagName&&o==="map"||a===gx.YAMLSeq.tagName&&o==="seq")return To(e,t,n,i,a);let c=t.schema.tags.find(p=>p.tag===a&&p.collection===o);if(!c){let p=t.schema.knownTags[a];if(p?.collection===o)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?i(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${o} collection, but expects ${p.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),To(e,t,n,i,a)}let l=To(e,t,n,i,a,c),u=c.resolve?.(l,p=>i(s,"TAG_RESOLVE_FAILED",p),t.options)??l,d=hx.isNode(u)?u:new mx.Scalar(u);return d.range=l.range,d.tag=a,c?.format&&(d.format=c.format),d}Xp.composeCollection=xx});var Co=B(Jp=>{"use strict";S();var So=pe();function yx(e,t,n){let r=t.offset,i=kx(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let s=i.mode===">"?So.Scalar.BLOCK_FOLDED:So.Scalar.BLOCK_LITERAL,a=t.source?Tx(t.source):[],o=a.length;for(let m=a.length-1;m>=0;--m){let g=a[m][1];if(g===""||g==="\r")o=m;else break}if(o===0){let m=i.chomp==="+"&&a.length>0?`
5580
+ `.repeat(Math.max(1,a.length-1)):"",g=r+i.length;return t.source&&(g+=t.source.length),{value:m,type:s,comment:i.comment,range:[r,g,g]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let m=0;m<o;++m){let[g,x]=a[m];if(x===""||x==="\r")i.indent===0&&g.length>c&&(c=g.length);else{g.length<c&&n(l+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=g.length),u=m,c===0&&!e.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=g.length+x.length+1}for(let m=a.length-1;m>=o;--m)a[m][0].length>c&&(o=m+1);let d="",p="",h=!1;for(let m=0;m<u;++m)d+=a[m][0].slice(c)+`
5581
+ `;for(let m=u;m<o;++m){let[g,x]=a[m];l+=g.length+x.length+1;let T=x[x.length-1]==="\r";if(T&&(x=x.slice(0,-1)),x&&g.length<c){let C=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(l-x.length-(T?2:1),"BAD_INDENT",C),g=""}s===So.Scalar.BLOCK_LITERAL?(d+=p+g.slice(c)+x,p=`
5582
+ `):g.length>c||x[0]===" "?(p===" "?p=`
5251
5583
  `:!h&&p===`
5252
5584
  `&&(p=`
5253
5585
 
5254
- `),d+=p+g.slice(c)+y,p=`
5255
- `,h=!0):y===""?p===`
5586
+ `),d+=p+g.slice(c)+x,p=`
5587
+ `,h=!0):x===""?p===`
5256
5588
  `?d+=`
5257
5589
  `:p=`
5258
- `:(d+=p+y,p=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let m=o;m<a.length;++m)d+=`
5590
+ `:(d+=p+x,p=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let m=o;m<a.length;++m)d+=`
5259
5591
  `+a[m][0].slice(c);d[d.length-1]!==`
5260
5592
  `&&(d+=`
5261
5593
  `);break;default:d+=`
5262
- `}let f=r+i.length+t.source.length;return{value:d,type:s,comment:i.comment,range:[r,f,f]}}function k0({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],s=i[0],a=0,o="",c=-1;for(let p=1;p<i.length;++p){let h=i[p];if(!o&&(h==="-"||h==="+"))o=h;else{let f=Number(h);!a&&f?a=f:c===-1&&(c=e+p)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",d=i.length;for(let p=1;p<t.length;++p){let h=t[p];switch(h.type){case"space":l=!0;case"newline":d+=h.source.length;break;case"comment":n&&!l&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=h.source.length,u=h.source.substring(1);break;case"error":r(h,"UNEXPECTED_TOKEN",h.message),d+=h.source.length;break;default:{let f=`Unexpected token in block scalar header: ${h.type}`;r(h,"UNEXPECTED_TOKEN",f);let m=h.source;m&&typeof m=="string"&&(d+=m.length)}}}return{mode:s,indent:a,chomp:o,comment:u,length:d}}function T0(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let a=1;a<t.length;a+=2)s.push([t[a],t[a+1]]);return s}Jp.resolveBlockScalar=x0});var Ao=B(Zp=>{"use strict";S();var Eo=pe(),S0=Cn();function C0(e,t,n){let{offset:r,type:i,source:s,end:a}=e,o,c,l=(p,h,f)=>n(r+p,h,f);switch(i){case"scalar":o=Eo.Scalar.PLAIN,c=E0(s,l);break;case"single-quoted-scalar":o=Eo.Scalar.QUOTE_SINGLE,c=A0(s,l);break;case"double-quoted-scalar":o=Eo.Scalar.QUOTE_DOUBLE,c=_0(s,l);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let u=r+s.length,d=S0.resolveEnd(a,u,t,n);return{value:c,type:o,comment:d.comment,range:[r,u,d.offset]}}function E0(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Qp(e)}function A0(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Qp(e.slice(1,-1)).replace(/''/g,"'")}function Qp(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
5594
+ `}let f=r+i.length+t.source.length;return{value:d,type:s,comment:i.comment,range:[r,f,f]}}function kx({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],s=i[0],a=0,o="",c=-1;for(let p=1;p<i.length;++p){let h=i[p];if(!o&&(h==="-"||h==="+"))o=h;else{let f=Number(h);!a&&f?a=f:c===-1&&(c=e+p)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",d=i.length;for(let p=1;p<t.length;++p){let h=t[p];switch(h.type){case"space":l=!0;case"newline":d+=h.source.length;break;case"comment":n&&!l&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=h.source.length,u=h.source.substring(1);break;case"error":r(h,"UNEXPECTED_TOKEN",h.message),d+=h.source.length;break;default:{let f=`Unexpected token in block scalar header: ${h.type}`;r(h,"UNEXPECTED_TOKEN",f);let m=h.source;m&&typeof m=="string"&&(d+=m.length)}}}return{mode:s,indent:a,chomp:o,comment:u,length:d}}function Tx(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let a=1;a<t.length;a+=2)s.push([t[a],t[a+1]]);return s}Jp.resolveBlockScalar=yx});var _o=B(Zp=>{"use strict";S();var Eo=pe(),Sx=Cn();function Cx(e,t,n){let{offset:r,type:i,source:s,end:a}=e,o,c,l=(p,h,f)=>n(r+p,h,f);switch(i){case"scalar":o=Eo.Scalar.PLAIN,c=Ex(s,l);break;case"single-quoted-scalar":o=Eo.Scalar.QUOTE_SINGLE,c=_x(s,l);break;case"double-quoted-scalar":o=Eo.Scalar.QUOTE_DOUBLE,c=Ax(s,l);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let u=r+s.length,d=Sx.resolveEnd(a,u,t,n);return{value:c,type:o,comment:d.comment,range:[r,u,d.offset]}}function Ex(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Qp(e)}function _x(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Qp(e.slice(1,-1)).replace(/''/g,"'")}function Qp(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
5263
5595
  `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
5264
5596
  `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],s=" ",a=t.lastIndex;for(n.lastIndex=a;r=n.exec(e);)r[1]===""?s===`
5265
5597
  `?i+=s:s=`
5266
- `:(i+=s+r[1],s=" "),a=n.lastIndex;let o=/[ \t]*(.*)/sy;return o.lastIndex=a,r=o.exec(e),i+s+(r?.[1]??"")}function _0(e,t){let n="";for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i==="\r"&&e[r+1]===`
5598
+ `:(i+=s+r[1],s=" "),a=n.lastIndex;let o=/[ \t]*(.*)/sy;return o.lastIndex=a,r=o.exec(e),i+s+(r?.[1]??"")}function Ax(e,t){let n="";for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i==="\r"&&e[r+1]===`
5267
5599
  `))if(i===`
5268
- `){let{fold:s,offset:a}=N0(e,r);n+=s,r=a}else if(i==="\\"){let s=e[++r],a=P0[s];if(a)n+=a;else if(s===`
5600
+ `){let{fold:s,offset:a}=Nx(e,r);n+=s,r=a}else if(i==="\\"){let s=e[++r],a=Ix[s];if(a)n+=a;else if(s===`
5269
5601
  `)for(s=e[r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="\r"&&e[r+1]===`
5270
- `)for(s=e[++r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="x"||s==="u"||s==="U"){let o=s==="x"?2:s==="u"?4:8;n+=I0(e,r+1,o,t),r+=o}else{let o=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),n+=o}}else if(i===" "||i===" "){let s=r,a=e[r+1];for(;a===" "||a===" ";)a=e[++r+1];a!==`
5602
+ `)for(s=e[++r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="x"||s==="u"||s==="U"){let o=s==="x"?2:s==="u"?4:8;n+=Px(e,r+1,o,t),r+=o}else{let o=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),n+=o}}else if(i===" "||i===" "){let s=r,a=e[r+1];for(;a===" "||a===" ";)a=e[++r+1];a!==`
5271
5603
  `&&!(a==="\r"&&e[r+2]===`
5272
- `)&&(n+=r>s?e.slice(s,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function N0(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
5604
+ `)&&(n+=r>s?e.slice(s,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function Nx(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
5273
5605
  `||r==="\r")&&!(r==="\r"&&e[t+2]!==`
5274
5606
  `);)r===`
5275
5607
  `&&(n+=`
5276
- `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}var P0={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
5277
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function I0(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let o=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}Zp.resolveFlowScalar=C0});var nu=B(tu=>{"use strict";S();var Yt=X(),eu=pe(),O0=Co(),R0=Ao();function L0(e,t,n,r){let{value:i,type:s,comment:a,range:o}=t.type==="block-scalar"?O0.resolveBlockScalar(e,t,r):R0.resolveFlowScalar(t,e.options.strict,r),c=n?e.directives.tagName(n.source,d=>r(n,"TAG_RESOLVE_FAILED",d)):null,l;e.options.stringKeys&&e.atKey?l=e.schema[Yt.SCALAR]:c?l=D0(e.schema,i,c,n,r):t.type==="scalar"?l=M0(e,i,t,r):l=e.schema[Yt.SCALAR];let u;try{let d=l.resolve(i,p=>r(n??t,"TAG_RESOLVE_FAILED",p),e.options);u=Yt.isScalar(d)?d:new eu.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);r(n??t,"TAG_RESOLVE_FAILED",p),u=new eu.Scalar(i)}return u.range=o,u.source=i,s&&(u.type=s),c&&(u.tag=c),l.format&&(u.format=l.format),a&&(u.comment=a),u}function D0(e,t,n,r,i){if(n==="!")return e[Yt.SCALAR];let s=[];for(let o of e.tags)if(!o.collection&&o.tag===n)if(o.default&&o.test)s.push(o);else return o;for(let o of s)if(o.test?.test(t))return o;let a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Yt.SCALAR])}function M0({atKey:e,directives:t,schema:n},r,i,s){let a=n.tags.find(o=>(o.default===!0||e&&o.default==="key")&&o.test?.test(r))||n[Yt.SCALAR];if(n.compat){let o=n.compat.find(c=>c.default&&c.test?.test(r))??n[Yt.SCALAR];if(a.tag!==o.tag){let c=t.tagString(a.tag),l=t.tagString(o.tag),u=`Value may be parsed as either ${c} or ${l}`;s(i,"TAG_RESOLVE_FAILED",u,!0)}}return a}tu.composeScalar=L0});var iu=B(ru=>{"use strict";S();function B0(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++r];i?.type==="space";)e+=i.source.length,i=t[++r];break}}return e}ru.emptyScalarPosition=B0});var ou=B(No=>{"use strict";S();var $0=Kn(),F0=X(),q0=Yp(),su=nu(),H0=Cn(),U0=iu(),j0={composeNode:au,composeEmptyNode:_o};function au(e,t,n,r){let i=e.atKey,{spaceBefore:s,comment:a,anchor:o,tag:c}=n,l,u=!0;switch(t.type){case"alias":l=W0(e,t,r),(o||c)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=su.composeScalar(e,t,c,r),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=q0.composeCollection(j0,e,t,n,r),o&&(l.anchor=o.source.substring(1))}catch(d){let p=d instanceof Error?d.message:String(d);r(t,"RESOURCE_EXHAUSTION",p)}break;default:{let d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=_o(e,t.offset,void 0,null,n,r)),o&&l.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!F0.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(l.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?l.comment=a:l.commentBefore=a),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function _o(e,t,n,r,{spaceBefore:i,comment:s,anchor:a,tag:o,end:c},l){let u={type:"scalar",offset:U0.emptyScalarPosition(t,n,r),indent:-1,source:""},d=su.composeScalar(e,u,o,l);return a&&(d.anchor=a.source.substring(1),d.anchor===""&&l(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=c),d}function W0({options:e},{offset:t,source:n,end:r},i){let s=new $0.Alias(n.substring(1));s.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=t+n.length,o=H0.resolveEnd(r,a,e.strict,i);return s.range=[t,a,o.offset],o.comment&&(s.comment=o.comment),s}No.composeEmptyNode=_o;No.composeNode=au});var du=B(cu=>{"use strict";S();var K0=or(),lu=ou(),G0=Cn(),z0=pr();function V0(e,t,{offset:n,start:r,value:i,end:s},a){let o=Object.assign({_directives:t},e),c=new K0.Document(void 0,o),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=z0.resolveProps(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:a,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&a(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?lu.composeNode(l,i,u,a):lu.composeEmptyNode(l,u.end,r,null,u,a);let d=c.contents.range[2],p=G0.resolveEnd(s,d,!1,a);return p.comment&&(c.comment=p.comment),c.range=[n,d,p.offset],c}cu.composeDoc=V0});var Io=B(hu=>{"use strict";S();var X0=ri("process"),Y0=fa(),J0=or(),ur=dr(),pu=X(),Q0=du(),Z0=Cn();function hr(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function uu(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){let s=e[i];switch(s[0]){case"#":t+=(t===""?"":r?`
5608
+ `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}var Ix={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
5609
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Px(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let o=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}Zp.resolveFlowScalar=Cx});var nu=B(tu=>{"use strict";S();var Yt=X(),eu=pe(),Ox=Co(),Rx=_o();function Lx(e,t,n,r){let{value:i,type:s,comment:a,range:o}=t.type==="block-scalar"?Ox.resolveBlockScalar(e,t,r):Rx.resolveFlowScalar(t,e.options.strict,r),c=n?e.directives.tagName(n.source,d=>r(n,"TAG_RESOLVE_FAILED",d)):null,l;e.options.stringKeys&&e.atKey?l=e.schema[Yt.SCALAR]:c?l=Mx(e.schema,i,c,n,r):t.type==="scalar"?l=Dx(e,i,t,r):l=e.schema[Yt.SCALAR];let u;try{let d=l.resolve(i,p=>r(n??t,"TAG_RESOLVE_FAILED",p),e.options);u=Yt.isScalar(d)?d:new eu.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);r(n??t,"TAG_RESOLVE_FAILED",p),u=new eu.Scalar(i)}return u.range=o,u.source=i,s&&(u.type=s),c&&(u.tag=c),l.format&&(u.format=l.format),a&&(u.comment=a),u}function Mx(e,t,n,r,i){if(n==="!")return e[Yt.SCALAR];let s=[];for(let o of e.tags)if(!o.collection&&o.tag===n)if(o.default&&o.test)s.push(o);else return o;for(let o of s)if(o.test?.test(t))return o;let a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Yt.SCALAR])}function Dx({atKey:e,directives:t,schema:n},r,i,s){let a=n.tags.find(o=>(o.default===!0||e&&o.default==="key")&&o.test?.test(r))||n[Yt.SCALAR];if(n.compat){let o=n.compat.find(c=>c.default&&c.test?.test(r))??n[Yt.SCALAR];if(a.tag!==o.tag){let c=t.tagString(a.tag),l=t.tagString(o.tag),u=`Value may be parsed as either ${c} or ${l}`;s(i,"TAG_RESOLVE_FAILED",u,!0)}}return a}tu.composeScalar=Lx});var iu=B(ru=>{"use strict";S();function Bx(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++r];i?.type==="space";)e+=i.source.length,i=t[++r];break}}return e}ru.emptyScalarPosition=Bx});var ou=B(No=>{"use strict";S();var $x=Kn(),Fx=X(),qx=Yp(),su=nu(),Hx=Cn(),Ux=iu(),jx={composeNode:au,composeEmptyNode:Ao};function au(e,t,n,r){let i=e.atKey,{spaceBefore:s,comment:a,anchor:o,tag:c}=n,l,u=!0;switch(t.type){case"alias":l=Wx(e,t,r),(o||c)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=su.composeScalar(e,t,c,r),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=qx.composeCollection(jx,e,t,n,r),o&&(l.anchor=o.source.substring(1))}catch(d){let p=d instanceof Error?d.message:String(d);r(t,"RESOURCE_EXHAUSTION",p)}break;default:{let d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=Ao(e,t.offset,void 0,null,n,r)),o&&l.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Fx.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(l.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?l.comment=a:l.commentBefore=a),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function Ao(e,t,n,r,{spaceBefore:i,comment:s,anchor:a,tag:o,end:c},l){let u={type:"scalar",offset:Ux.emptyScalarPosition(t,n,r),indent:-1,source:""},d=su.composeScalar(e,u,o,l);return a&&(d.anchor=a.source.substring(1),d.anchor===""&&l(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=c),d}function Wx({options:e},{offset:t,source:n,end:r},i){let s=new $x.Alias(n.substring(1));s.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=t+n.length,o=Hx.resolveEnd(r,a,e.strict,i);return s.range=[t,a,o.offset],o.comment&&(s.comment=o.comment),s}No.composeEmptyNode=Ao;No.composeNode=au});var du=B(cu=>{"use strict";S();var Kx=or(),lu=ou(),Gx=Cn(),zx=pr();function Vx(e,t,{offset:n,start:r,value:i,end:s},a){let o=Object.assign({_directives:t},e),c=new Kx.Document(void 0,o),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=zx.resolveProps(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:a,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&a(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?lu.composeNode(l,i,u,a):lu.composeEmptyNode(l,u.end,r,null,u,a);let d=c.contents.range[2],p=Gx.resolveEnd(s,d,!1,a);return p.comment&&(c.comment=p.comment),c.range=[n,d,p.offset],c}cu.composeDoc=Vx});var Po=B(hu=>{"use strict";S();var Xx=ri("process"),Yx=fa(),Jx=or(),ur=dr(),pu=X(),Qx=du(),Zx=Cn();function hr(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function uu(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){let s=e[i];switch(s[0]){case"#":t+=(t===""?"":r?`
5278
5610
 
5279
5611
  `:`
5280
- `)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var Po=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{let a=hr(n);s?this.warnings.push(new ur.YAMLWarning(a,r,i)):this.errors.push(new ur.YAMLParseError(a,r,i))},this.directives=new Y0.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:r,afterEmptyLine:i}=uu(this.prelude);if(r){let s=t.contents;if(n)t.comment=t.comment?`${t.comment}
5612
+ `)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var Io=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{let a=hr(n);s?this.warnings.push(new ur.YAMLWarning(a,r,i)):this.errors.push(new ur.YAMLParseError(a,r,i))},this.directives=new Yx.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:r,afterEmptyLine:i}=uu(this.prelude);if(r){let s=t.contents;if(n)t.comment=t.comment?`${t.comment}
5281
5613
  ${r}`:r;else if(i||t.directives.docStart||!s)t.commentBefore=r;else if(pu.isCollection(s)&&!s.flow&&s.items.length>0){let a=s.items[0];pu.isPair(a)&&(a=a.key);let o=a.commentBefore;a.commentBefore=o?`${r}
5282
5614
  ${o}`:r}else{let a=s.commentBefore;s.commentBefore=a?`${r}
5283
- ${a}`:r}}if(n){for(let s=0;s<this.errors.length;++s)t.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)t.warnings.push(this.warnings[s])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:uu(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(let i of t)yield*this.next(i);yield*this.end(n,r)}*next(t){switch(X0.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(n,r,i)=>{let s=hr(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=Q0.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new ur.YAMLParseError(hr(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new ur.YAMLParseError(hr(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=Z0.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
5284
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ur.YAMLParseError(hr(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let r=Object.assign({_directives:this.directives},this.options),i=new J0.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};hu.Composer=Po});var gu=B(Zi=>{"use strict";S();var ey=Co(),ty=Ao(),ny=dr(),mu=Yn();function ry(e,t=!0,n){if(e){let r=(i,s,a)=>{let o=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(o,s,a);else throw new ny.YAMLParseError([o,o+1],s,a)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return ty.resolveFlowScalar(e,t,r);case"block-scalar":return ey.resolveBlockScalar({options:{strict:t}},e,r)}}return null}function iy(e,t){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=t,o=mu.stringifyString({type:a,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:r,source:`
5615
+ ${a}`:r}}if(n){for(let s=0;s<this.errors.length;++s)t.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)t.warnings.push(this.warnings[s])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:uu(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(let i of t)yield*this.next(i);yield*this.end(n,r)}*next(t){switch(Xx.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(n,r,i)=>{let s=hr(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=Qx.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new ur.YAMLParseError(hr(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new ur.YAMLParseError(hr(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=Zx.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
5616
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ur.YAMLParseError(hr(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let r=Object.assign({_directives:this.directives},this.options),i=new Jx.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};hu.Composer=Io});var gu=B(Zi=>{"use strict";S();var e0=Co(),t0=_o(),n0=dr(),mu=Yn();function r0(e,t=!0,n){if(e){let r=(i,s,a)=>{let o=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(o,s,a);else throw new n0.YAMLParseError([o,o+1],s,a)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return t0.resolveFlowScalar(e,t,r);case"block-scalar":return e0.resolveBlockScalar({options:{strict:t}},e,r)}}return null}function i0(e,t){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=t,o=mu.stringifyString({type:a,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:r,source:`
5285
5617
  `}];switch(o[0]){case"|":case">":{let l=o.indexOf(`
5286
5618
  `),u=o.substring(0,l),d=o.substring(l+1)+`
5287
5619
  `,p=[{type:"block-scalar-header",offset:s,indent:r,source:u}];return fu(p,c)||p.push({type:"newline",offset:-1,indent:r,source:`
5288
- `}),{type:"block-scalar",offset:s,indent:r,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:o,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:o,end:c};default:return{type:"scalar",offset:s,indent:r,source:o,end:c}}}function sy(e,t,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:a}=n,o="indent"in e?e.indent:null;if(r&&typeof o=="number"&&(o+=2),!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let c=mu.stringifyString({type:a,value:t},{implicitKey:i||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":ay(e,c);break;case'"':Oo(e,c,"double-quoted-scalar");break;case"'":Oo(e,c,"single-quoted-scalar");break;default:Oo(e,c,"scalar")}}function ay(e,t){let n=t.indexOf(`
5620
+ `}),{type:"block-scalar",offset:s,indent:r,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:o,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:o,end:c};default:return{type:"scalar",offset:s,indent:r,source:o,end:c}}}function s0(e,t,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:a}=n,o="indent"in e?e.indent:null;if(r&&typeof o=="number"&&(o+=2),!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let c=mu.stringifyString({type:a,value:t},{implicitKey:i||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":a0(e,c);break;case'"':Oo(e,c,"double-quoted-scalar");break;case"'":Oo(e,c,"single-quoted-scalar");break;default:Oo(e,c,"scalar")}}function a0(e,t){let n=t.indexOf(`
5289
5621
  `),r=t.substring(0,n),i=t.substring(n+1)+`
5290
5622
  `;if(e.type==="block-scalar"){let s=e.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=r,e.source=i}else{let{offset:s}=e,a="indent"in e?e.indent:-1,o=[{type:"block-scalar-header",offset:s,indent:a,source:r}];fu(o,"end"in e?e.end:void 0)||o.push({type:"newline",offset:-1,indent:a,source:`
5291
5623
  `});for(let c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:a,props:o,source:i})}}function fu(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function Oo(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let r=e.props.slice(1),i=t.length;e.props[0].type==="block-scalar-header"&&(i-=e.props[0].source.length);for(let s of r)s.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{let i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
5292
- `};delete e.items,Object.assign(e,{type:n,source:t,end:[i]});break}default:{let r="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(e))s!=="type"&&s!=="offset"&&delete e[s];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}Zi.createScalarToken=iy;Zi.resolveAsScalar=ry;Zi.setScalarValue=sy});var vu=B(bu=>{"use strict";S();var oy=e=>"type"in e?ts(e):es(e);function ts(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=ts(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=es(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=es(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=es(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function es({start:e,key:t,sep:n,value:r}){let i="";for(let s of e)i+=s.source;if(t&&(i+=ts(t)),n)for(let s of n)i+=s.source;return r&&(i+=ts(r)),i}bu.stringify=oy});var ku=B(xu=>{"use strict";S();var Ro=Symbol("break visit"),ly=Symbol("skip children"),wu=Symbol("remove item");function Jt(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),yu(Object.freeze([]),e,t)}Jt.BREAK=Ro;Jt.SKIP=ly;Jt.REMOVE=wu;Jt.itemAtPath=(e,t)=>{let n=e;for(let[r,i]of t){let s=n?.[r];if(s&&"items"in s)n=s.items[i];else return}return n};Jt.parentCollection=(e,t)=>{let n=Jt.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function yu(e,t,n){let r=n(t,e);if(typeof r=="symbol")return r;for(let i of["key","value"]){let s=t[i];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let o=yu(Object.freeze(e.concat([[i,a]])),s.items[a],n);if(typeof o=="number")a=o-1;else{if(o===Ro)return Ro;o===wu&&(s.items.splice(a,1),a-=1)}}typeof r=="function"&&i==="key"&&(r=r(t,e))}}return typeof r=="function"?r(t,e):r}xu.visit=Jt});var ns=B(Pe=>{"use strict";S();var Lo=gu(),cy=vu(),dy=ku(),Do="\uFEFF",Mo="",Bo="",$o="",py=e=>!!e&&"items"in e,uy=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function hy(e){switch(e){case Do:return"<BOM>";case Mo:return"<DOC>";case Bo:return"<FLOW_END>";case $o:return"<SCALAR>";default:return JSON.stringify(e)}}function my(e){switch(e){case Do:return"byte-order-mark";case Mo:return"doc-mode";case Bo:return"flow-error-end";case $o:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
5624
+ `};delete e.items,Object.assign(e,{type:n,source:t,end:[i]});break}default:{let r="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(e))s!=="type"&&s!=="offset"&&delete e[s];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}Zi.createScalarToken=i0;Zi.resolveAsScalar=r0;Zi.setScalarValue=s0});var vu=B(bu=>{"use strict";S();var o0=e=>"type"in e?ts(e):es(e);function ts(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=ts(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=es(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=es(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=es(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function es({start:e,key:t,sep:n,value:r}){let i="";for(let s of e)i+=s.source;if(t&&(i+=ts(t)),n)for(let s of n)i+=s.source;return r&&(i+=ts(r)),i}bu.stringify=o0});var ku=B(yu=>{"use strict";S();var Ro=Symbol("break visit"),l0=Symbol("skip children"),wu=Symbol("remove item");function Jt(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),xu(Object.freeze([]),e,t)}Jt.BREAK=Ro;Jt.SKIP=l0;Jt.REMOVE=wu;Jt.itemAtPath=(e,t)=>{let n=e;for(let[r,i]of t){let s=n?.[r];if(s&&"items"in s)n=s.items[i];else return}return n};Jt.parentCollection=(e,t)=>{let n=Jt.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function xu(e,t,n){let r=n(t,e);if(typeof r=="symbol")return r;for(let i of["key","value"]){let s=t[i];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let o=xu(Object.freeze(e.concat([[i,a]])),s.items[a],n);if(typeof o=="number")a=o-1;else{if(o===Ro)return Ro;o===wu&&(s.items.splice(a,1),a-=1)}}typeof r=="function"&&i==="key"&&(r=r(t,e))}}return typeof r=="function"?r(t,e):r}yu.visit=Jt});var ns=B(Ie=>{"use strict";S();var Lo=gu(),c0=vu(),d0=ku(),Mo="\uFEFF",Do="",Bo="",$o="",p0=e=>!!e&&"items"in e,u0=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function h0(e){switch(e){case Mo:return"<BOM>";case Do:return"<DOC>";case Bo:return"<FLOW_END>";case $o:return"<SCALAR>";default:return JSON.stringify(e)}}function m0(e){switch(e){case Mo:return"byte-order-mark";case Do:return"doc-mode";case Bo:return"flow-error-end";case $o:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
5293
5625
  `:case`\r
5294
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Pe.createScalarToken=Lo.createScalarToken;Pe.resolveAsScalar=Lo.resolveAsScalar;Pe.setScalarValue=Lo.setScalarValue;Pe.stringify=cy.stringify;Pe.visit=dy.visit;Pe.BOM=Do;Pe.DOCUMENT=Mo;Pe.FLOW_END=Bo;Pe.SCALAR=$o;Pe.isCollection=py;Pe.isScalar=uy;Pe.prettyToken=hy;Pe.tokenType=my});var Ho=B(Su=>{"use strict";S();var mr=ns();function Ke(e){switch(e){case void 0:case" ":case`
5295
- `:case"\r":case" ":return!0;default:return!1}}var Tu=new Set("0123456789ABCDEFabcdef"),fy=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),rs=new Set(",[]{}"),gy=new Set(` ,[]{}
5296
- \r `),Fo=e=>!e||gy.has(e),qo=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
5626
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Ie.createScalarToken=Lo.createScalarToken;Ie.resolveAsScalar=Lo.resolveAsScalar;Ie.setScalarValue=Lo.setScalarValue;Ie.stringify=c0.stringify;Ie.visit=d0.visit;Ie.BOM=Mo;Ie.DOCUMENT=Do;Ie.FLOW_END=Bo;Ie.SCALAR=$o;Ie.isCollection=p0;Ie.isScalar=u0;Ie.prettyToken=h0;Ie.tokenType=m0});var Ho=B(Su=>{"use strict";S();var mr=ns();function Ke(e){switch(e){case void 0:case" ":case`
5627
+ `:case"\r":case" ":return!0;default:return!1}}var Tu=new Set("0123456789ABCDEFabcdef"),f0=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),rs=new Set(",[]{}"),g0=new Set(` ,[]{}
5628
+ \r `),Fo=e=>!e||g0.has(e),qo=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
5297
5629
  `?!0:n==="\r"?this.buffer[t+1]===`
5298
5630
  `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){let i=this.buffer[r+t+1];if(i===`
5299
5631
  `||!i&&!this.atEnd)return t+r+1}return n===`
@@ -5308,39 +5640,39 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
5308
5640
  `&&s>=this.pos&&s+1+n>o)t=s;else break}while(!0);return yield mr.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let s=this.buffer[r+1];if(Ke(s)||t&&rs.has(s))break;n=r}else if(Ke(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===`
5309
5641
  `?(r+=1,i=`
5310
5642
  `,s=this.buffer[r+1]):n=r),s==="#"||t&&rs.has(s))break;if(i===`
5311
- `){let a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&rs.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield mr.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Fo),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(Ke(r)||n&&rs.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Ke(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(fy.has(n))n=this.buffer[++t];else if(n==="%"&&Tu.has(this.buffer[t+1])&&Tu.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===`
5643
+ `){let a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&rs.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield mr.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Fo),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(Ke(r)||n&&rs.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Ke(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(f0.has(n))n=this.buffer[++t];else if(n==="%"&&Tu.has(this.buffer[t+1])&&Tu.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===`
5312
5644
  `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
5313
- `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Su.Lexer=qo});var jo=B(Cu=>{"use strict";S();var Uo=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){let s=n+r>>1;this.lineStarts[s]<t?n=s+1:r=s}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};let i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}};Cu.LineCounter=Uo});var Ko=B(Pu=>{"use strict";S();var by=ri("process"),Eu=ns(),vy=Ho();function Bt(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Au(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function Nu(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function is(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function En(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function ss(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function _u(e){if(e.start.type==="flow-seq-start")for(let t of e.items)t.sep&&!t.value&&!Bt(t.start,"explicit-key-ind")&&!Bt(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Nu(t.value)?t.value.end?ss(t.value.end,t.sep):t.value.end=t.sep:ss(t.start,t.sep),delete t.sep)}var Wo=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new vy.Lexer,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,by.env.LOG_TOKENS&&console.log("|",Eu.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let n=Eu.tokenType(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{let r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&_u(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Au(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Au(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}let n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){let n=is(this.peek(2)),r=En(n),i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];let s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
5645
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Su.Lexer=qo});var jo=B(Cu=>{"use strict";S();var Uo=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){let s=n+r>>1;this.lineStarts[s]<t?n=s+1:r=s}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};let i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}};Cu.LineCounter=Uo});var Ko=B(Iu=>{"use strict";S();var b0=ri("process"),Eu=ns(),v0=Ho();function Bt(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function _u(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function Nu(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function is(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function En(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function ss(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function Au(e){if(e.start.type==="flow-seq-start")for(let t of e.items)t.sep&&!t.value&&!Bt(t.start,"explicit-key-ind")&&!Bt(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Nu(t.value)?t.value.end?ss(t.value.end,t.sep):t.value.end=t.sep:ss(t.start,t.sep),delete t.sep)}var Wo=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new v0.Lexer,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,b0.env.LOG_TOKENS&&console.log("|",Eu.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let n=Eu.tokenType(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{let r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Au(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&_u(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{_u(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}let n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){let n=is(this.peek(2)),r=En(n),i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];let s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
5314
5646
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
5315
- `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){ss(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&n.sep&&!n.value){let a=[];for(let o=0;o<n.sep.length;++o){let c=n.sep[o];switch(c.type){case"newline":a.push(o);break;case"space":break;case"comment":c.indent>t.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),t.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(s.push(this.sourceToken),t.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Bt(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Nu(n.key)&&!Bt(n.sep,"newline")){let a=En(n.start),o=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:o,sep:c}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(Bt(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let a=En(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:s,key:null,sep:[this.sourceToken]}):Bt(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);i||n.value?(t.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(t);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Bt(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){ss(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Bt(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=is(r),s=En(i);_u(t);let a=t.end.splice(1,t.end.length);a.push(this.sourceToken);let o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
5647
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){ss(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&n.sep&&!n.value){let a=[];for(let o=0;o<n.sep.length;++o){let c=n.sep[o];switch(c.type){case"newline":a.push(o);break;case"space":break;case"comment":c.indent>t.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),t.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(s.push(this.sourceToken),t.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Bt(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Nu(n.key)&&!Bt(n.sep,"newline")){let a=En(n.start),o=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:o,sep:c}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(Bt(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let a=En(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:s,key:null,sep:[this.sourceToken]}):Bt(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);i||n.value?(t.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(t);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Bt(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){ss(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Bt(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=is(r),s=En(i);Au(t);let a=t.end.splice(1,t.end.length);a.push(this.sourceToken);let o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
5316
5648
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
5317
- `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=is(t),r=En(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=is(t),r=En(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Pu.Parser=Wo});var Du=B(gr=>{"use strict";S();var Iu=Io(),wy=or(),fr=dr(),yy=_a(),xy=X(),ky=jo(),Ou=Ko();function Ru(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new ky.LineCounter||null,prettyErrors:t}}function Ty(e,t={}){let{lineCounter:n,prettyErrors:r}=Ru(t),i=new Ou.Parser(n?.addNewLine),s=new Iu.Composer(t),a=Array.from(s.compose(i.parse(e)));if(r&&n)for(let o of a)o.errors.forEach(fr.prettifyError(e,n)),o.warnings.forEach(fr.prettifyError(e,n));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function Lu(e,t={}){let{lineCounter:n,prettyErrors:r}=Ru(t),i=new Ou.Parser(n?.addNewLine),s=new Iu.Composer(t),a=null;for(let o of s.compose(i.parse(e),!0,e.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new fr.YAMLParseError(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(fr.prettifyError(e,n)),a.warnings.forEach(fr.prettifyError(e,n))),a}function Sy(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let i=Lu(e,n);if(!i)return null;if(i.warnings.forEach(s=>yy.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function Cy(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=n??t??{};if(!i)return}return xy.isDocument(e)&&!r?e.toString(n):new wy.Document(e,r,n).toString(n)}gr.parse=Sy;gr.parseAllDocuments=Ty;gr.parseDocument=Lu;gr.stringify=Cy});var Bu=B(J=>{"use strict";S();var Ey=Io(),Ay=or(),_y=po(),Go=dr(),Ny=Kn(),$t=X(),Py=Rt(),Iy=pe(),Oy=Dt(),Ry=Mt(),Ly=ns(),Dy=Ho(),My=jo(),By=Ko(),as=Du(),Mu=Hn();J.Composer=Ey.Composer;J.Document=Ay.Document;J.Schema=_y.Schema;J.YAMLError=Go.YAMLError;J.YAMLParseError=Go.YAMLParseError;J.YAMLWarning=Go.YAMLWarning;J.Alias=Ny.Alias;J.isAlias=$t.isAlias;J.isCollection=$t.isCollection;J.isDocument=$t.isDocument;J.isMap=$t.isMap;J.isNode=$t.isNode;J.isPair=$t.isPair;J.isScalar=$t.isScalar;J.isSeq=$t.isSeq;J.Pair=Py.Pair;J.Scalar=Iy.Scalar;J.YAMLMap=Oy.YAMLMap;J.YAMLSeq=Ry.YAMLSeq;J.CST=Ly;J.Lexer=Dy.Lexer;J.LineCounter=My.LineCounter;J.Parser=By.Parser;J.parse=as.parse;J.parseAllDocuments=as.parseAllDocuments;J.parseDocument=as.parseDocument;J.stringify=as.stringify;J.visit=Mu.visit;J.visitAsync=Mu.visitAsync});import ft from"node:fs";import Ie from"node:path";function ls(e){let t=Ie.resolve(e);for(;;){if(ft.existsSync(Ie.join(t,Zt)))return t;let n=Ie.dirname(t);if(n===t)return null;t=n}}function cs(e){let t=e.replace(/^/,"").replace(/\r\n/g,`
5318
- `),n=/^---\n([\s\S]*?)\n---\n?/.exec(t);if(!n)return{front:{},body:t};let r=(0,An.parse)(n[1]);if(r!==null&&(typeof r!="object"||Array.isArray(r)))throw new Error("frontmatter kh\xF4ng ph\u1EA3i b\u1EA3ng kho\xE1");return{front:r??{},body:t.slice(n[0].length)}}function os(e){return(0,An.stringify)(e,$y)}function gt(e){let t={};for(let[n,r]of Object.entries(e))r==null||r===""||Array.isArray(r)&&r.length===0||typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length===0||(t[n]=r);return t}function Xo(e,t,n){return t.includes(e)?e:n}function Fu(e,t){return t.includes(e)?e:void 0}function qu(e){if(!e||typeof e!="object")return;let t=e;return{by:z(t.by),at:z(t.at)}}function Fy(e){let t=(0,An.parse)(e)??{},n=Array.isArray(t.members)?t.members.map(s=>({id:z(s.id),name:z(s.name)||z(s.id),...s.role?{role:z(s.role)}:{}})):[],r=t.overview&&typeof t.overview=="object"?t.overview:null,i=r?gt({purpose:z(r.purpose).trimEnd(),scope:z(r.scope).trimEnd(),environment:z(r.environment).trimEnd(),references:z(r.references).trimEnd(),terms:Array.isArray(r.terms)?r.terms.map(s=>({term:z(s.term),desc:z(s.desc)})).filter(s=>s.term):void 0,owner:z(r.owner),contractor:z(r.contractor),docVersion:z(r.doc_version),place:z(r.place)}):void 0;return{version:Number(t.version??1),title:z(t.title),language:t.language==="en"?"en":"vi",...t.ba?{ba:z(t.ba)}:{},members:n,...i&&Object.keys(i).length?{overview:i}:{}}}function qy(e){let t="# T\xE0i li\u1EC7u k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED (Pan Test). `ba`: repo t\xE0i li\u1EC7u BA \u0111\u1EC3 tham chi\u1EBFu [[CN-\u2026]] v\xE0 ki\u1EC3m \u0111\u1ED9 ph\u1EE7.\n",n=e.overview,r=n?gt({purpose:n.purpose,scope:n.scope,environment:n.environment,references:n.references,terms:n.terms,owner:n.owner,contractor:n.contractor,doc_version:n.docVersion,place:n.place}):void 0;return t+os(gt({version:e.version,title:e.title,language:e.language,ba:e.ba,members:e.members.map(i=>gt({...i})),overview:r}))}function Hy(e,t){let{front:n,body:r}=cs(e),i=z(n.code);if(!ai.test(i))throw new Error(`m\xE3 ph\xE2n h\u1EC7 \xAB${i}\xBB sai m\u1EABu`);return{code:i,title:z(n.title),order:Number(n.order??0),suites:Vo(n.suites),commonSteps:r.trim(),file:t}}function Uy(e){return`---
5649
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=is(t),r=En(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=is(t),r=En(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Iu.Parser=Wo});var Mu=B(gr=>{"use strict";S();var Pu=Po(),w0=or(),fr=dr(),x0=Aa(),y0=X(),k0=jo(),Ou=Ko();function Ru(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new k0.LineCounter||null,prettyErrors:t}}function T0(e,t={}){let{lineCounter:n,prettyErrors:r}=Ru(t),i=new Ou.Parser(n?.addNewLine),s=new Pu.Composer(t),a=Array.from(s.compose(i.parse(e)));if(r&&n)for(let o of a)o.errors.forEach(fr.prettifyError(e,n)),o.warnings.forEach(fr.prettifyError(e,n));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function Lu(e,t={}){let{lineCounter:n,prettyErrors:r}=Ru(t),i=new Ou.Parser(n?.addNewLine),s=new Pu.Composer(t),a=null;for(let o of s.compose(i.parse(e),!0,e.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new fr.YAMLParseError(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(fr.prettifyError(e,n)),a.warnings.forEach(fr.prettifyError(e,n))),a}function S0(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let i=Lu(e,n);if(!i)return null;if(i.warnings.forEach(s=>x0.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function C0(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=n??t??{};if(!i)return}return y0.isDocument(e)&&!r?e.toString(n):new w0.Document(e,r,n).toString(n)}gr.parse=S0;gr.parseAllDocuments=T0;gr.parseDocument=Lu;gr.stringify=C0});var Bu=B(J=>{"use strict";S();var E0=Po(),_0=or(),A0=po(),Go=dr(),N0=Kn(),$t=X(),I0=Rt(),P0=pe(),O0=Mt(),R0=Dt(),L0=ns(),M0=Ho(),D0=jo(),B0=Ko(),as=Mu(),Du=Hn();J.Composer=E0.Composer;J.Document=_0.Document;J.Schema=A0.Schema;J.YAMLError=Go.YAMLError;J.YAMLParseError=Go.YAMLParseError;J.YAMLWarning=Go.YAMLWarning;J.Alias=N0.Alias;J.isAlias=$t.isAlias;J.isCollection=$t.isCollection;J.isDocument=$t.isDocument;J.isMap=$t.isMap;J.isNode=$t.isNode;J.isPair=$t.isPair;J.isScalar=$t.isScalar;J.isSeq=$t.isSeq;J.Pair=I0.Pair;J.Scalar=P0.Scalar;J.YAMLMap=O0.YAMLMap;J.YAMLSeq=R0.YAMLSeq;J.CST=L0;J.Lexer=M0.Lexer;J.LineCounter=D0.LineCounter;J.Parser=B0.Parser;J.parse=as.parse;J.parseAllDocuments=as.parseAllDocuments;J.parseDocument=as.parseDocument;J.stringify=as.stringify;J.visit=Du.visit;J.visitAsync=Du.visitAsync});import ft from"node:fs";import Pe from"node:path";function ls(e){let t=Pe.resolve(e);for(;;){if(ft.existsSync(Pe.join(t,Zt)))return t;let n=Pe.dirname(t);if(n===t)return null;t=n}}function cs(e){let t=e.replace(/^/,"").replace(/\r\n/g,`
5650
+ `),n=/^---\n([\s\S]*?)\n---\n?/.exec(t);if(!n)return{front:{},body:t};let r=(0,_n.parse)(n[1]);if(r!==null&&(typeof r!="object"||Array.isArray(r)))throw new Error("frontmatter kh\xF4ng ph\u1EA3i b\u1EA3ng kho\xE1");return{front:r??{},body:t.slice(n[0].length)}}function os(e){return(0,_n.stringify)(e,$0)}function gt(e){let t={};for(let[n,r]of Object.entries(e))r==null||r===""||Array.isArray(r)&&r.length===0||typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length===0||(t[n]=r);return t}function Xo(e,t,n){return t.includes(e)?e:n}function Fu(e,t){return t.includes(e)?e:void 0}function qu(e){if(!e||typeof e!="object")return;let t=e;return{by:z(t.by),at:z(t.at)}}function F0(e){let t=(0,_n.parse)(e)??{},n=Array.isArray(t.members)?t.members.map(s=>({id:z(s.id),name:z(s.name)||z(s.id),...s.role?{role:z(s.role)}:{}})):[],r=t.overview&&typeof t.overview=="object"?t.overview:null,i=r?gt({purpose:z(r.purpose).trimEnd(),scope:z(r.scope).trimEnd(),environment:z(r.environment).trimEnd(),references:z(r.references).trimEnd(),terms:Array.isArray(r.terms)?r.terms.map(s=>({term:z(s.term),desc:z(s.desc)})).filter(s=>s.term):void 0,owner:z(r.owner),contractor:z(r.contractor),docVersion:z(r.doc_version),place:z(r.place)}):void 0;return{version:Number(t.version??1),title:z(t.title),language:t.language==="en"?"en":"vi",...t.ba?{ba:z(t.ba)}:{},members:n,...i&&Object.keys(i).length?{overview:i}:{}}}function q0(e){let t="# T\xE0i li\u1EC7u k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED (Pan Test). `ba`: repo t\xE0i li\u1EC7u BA \u0111\u1EC3 tham chi\u1EBFu [[CN-\u2026]] v\xE0 ki\u1EC3m \u0111\u1ED9 ph\u1EE7.\n",n=e.overview,r=n?gt({purpose:n.purpose,scope:n.scope,environment:n.environment,references:n.references,terms:n.terms,owner:n.owner,contractor:n.contractor,doc_version:n.docVersion,place:n.place}):void 0;return t+os(gt({version:e.version,title:e.title,language:e.language,ba:e.ba,members:e.members.map(i=>gt({...i})),overview:r}))}function H0(e,t){let{front:n,body:r}=cs(e),i=z(n.code);if(!ai.test(i))throw new Error(`m\xE3 ph\xE2n h\u1EC7 \xAB${i}\xBB sai m\u1EABu`);return{code:i,title:z(n.title),order:Number(n.order??0),suites:Vo(n.suites),commonSteps:r.trim(),file:t}}function U0(e){return`---
5319
5651
  ${os(gt({code:e.code,title:e.title,order:e.order,suites:e.suites}))}---
5320
5652
  ${e.commonSteps.trim()?e.commonSteps.trim()+`
5321
- `:""}`}function jy(e){if(!e||typeof e!="object")return;let t=e;return{status:Xo(t.status,et,"not-run"),...t.actual?{actual:z(t.actual)}:{},...t.by?{by:z(t.by)}:{},...t.at?{at:z(t.at)}:{},...t.env?{env:z(t.env)}:{},...t.bug?{bug:z(t.bug)}:{}}}function Wy(e){let t=qu(e.deleted),n=jy(e.result),r=Fu(e.priority,hn);return{code:z(e.code),case:z(e.case).trimEnd(),...e.requirement?{requirement:z(e.requirement).trimEnd()}:{},steps:z(e.steps).trimEnd(),expected:z(e.expected).trimEnd(),...r?{priority:r}:{},...e.tag?{tag:z(e.tag)}:{},...n?{result:n}:{},...t?{deleted:{...t,...e.deleted.reason?{reason:z(e.deleted.reason)}:{}}}:{}}}function Ky(e,t){let{front:n,body:r}=cs(e),i=/^#\s+(\S+)\s*(?:·\s*(.*))?$/m.exec(r),s=i?.[1]??"",a=oi.exec(s);if(!a)throw new Error(`thi\u1EBFu ti\xEAu \u0111\u1EC1 \xAB# KB-<PH>-XXXXXX \xB7 T\xEAn\xBB ho\u1EB7c m\xE3 sai m\u1EABu (\xAB${s}\xBB)`);let o=r.slice((i?.index??0)+(i?.[0].length??0)),c=[],l=o.indexOf(zo);if(l>=0){let p=l+zo.length,h=o.indexOf("\n```",p);if(h<0)throw new Error("kh\u1ED1i ```yaml pt:cases``` kh\xF4ng c\xF3 d\u1EA5u \u0111\xF3ng");let f=(0,An.parse)(o.slice(p,h));if(f!==null&&!Array.isArray(f))throw new Error("kh\u1ED1i pt:cases ph\u1EA3i l\xE0 danh s\xE1ch");c=(f??[]).map(m=>Wy(m??{})),o=o.slice(0,l)+o.slice(h+4)}let u=Fu(n.priority,hn),d=qu(n.created);return{code:s,module:a[1],title:(i?.[2]??"").trim(),kind:Xo(n.kind,Gc,"functional"),status:Xo(n.status,zc,"drafting"),covers:Vo(n.covers),useCases:Vo(n.use_cases),...u?{priority:u}:{},...n.preconditions?{preconditions:z(n.preconditions).trimEnd()}:{},...n.owner?{owner:z(n.owner)}:{},...d?{created:d}:{},...n.source?{source:z(n.source)}:{},description:o.trim(),cases:c,file:t}}function Gy(e){return gt({code:e.code,case:e.case,requirement:e.requirement,steps:e.steps,expected:e.expected,priority:e.priority,tag:e.tag,result:e.result?gt({...e.result}):void 0,deleted:e.deleted?gt({...e.deleted}):void 0})}function zy(e){let n=[`---
5653
+ `:""}`}function j0(e){if(!e||typeof e!="object")return;let t=e;return{status:Xo(t.status,et,"not-run"),...t.actual?{actual:z(t.actual)}:{},...t.by?{by:z(t.by)}:{},...t.at?{at:z(t.at)}:{},...t.env?{env:z(t.env)}:{},...t.bug?{bug:z(t.bug)}:{}}}function W0(e){let t=qu(e.deleted),n=j0(e.result),r=Fu(e.priority,hn);return{code:z(e.code),case:z(e.case).trimEnd(),...e.requirement?{requirement:z(e.requirement).trimEnd()}:{},steps:z(e.steps).trimEnd(),expected:z(e.expected).trimEnd(),...r?{priority:r}:{},...e.tag?{tag:z(e.tag)}:{},...n?{result:n}:{},...t?{deleted:{...t,...e.deleted.reason?{reason:z(e.deleted.reason)}:{}}}:{}}}function K0(e,t){let{front:n,body:r}=cs(e),i=/^#\s+(\S+)\s*(?:·\s*(.*))?$/m.exec(r),s=i?.[1]??"",a=oi.exec(s);if(!a)throw new Error(`thi\u1EBFu ti\xEAu \u0111\u1EC1 \xAB# KB-<PH>-XXXXXX \xB7 T\xEAn\xBB ho\u1EB7c m\xE3 sai m\u1EABu (\xAB${s}\xBB)`);let o=r.slice((i?.index??0)+(i?.[0].length??0)),c=[],l=o.indexOf(zo);if(l>=0){let p=l+zo.length,h=o.indexOf("\n```",p);if(h<0)throw new Error("kh\u1ED1i ```yaml pt:cases``` kh\xF4ng c\xF3 d\u1EA5u \u0111\xF3ng");let f=(0,_n.parse)(o.slice(p,h));if(f!==null&&!Array.isArray(f))throw new Error("kh\u1ED1i pt:cases ph\u1EA3i l\xE0 danh s\xE1ch");c=(f??[]).map(m=>W0(m??{})),o=o.slice(0,l)+o.slice(h+4)}let u=Fu(n.priority,hn),d=qu(n.created);return{code:s,module:a[1],title:(i?.[2]??"").trim(),kind:Xo(n.kind,Gc,"functional"),status:Xo(n.status,zc,"drafting"),covers:Vo(n.covers),useCases:Vo(n.use_cases),...u?{priority:u}:{},...n.preconditions?{preconditions:z(n.preconditions).trimEnd()}:{},...n.owner?{owner:z(n.owner)}:{},...d?{created:d}:{},...n.source?{source:z(n.source)}:{},description:o.trim(),cases:c,file:t}}function G0(e){return gt({code:e.code,case:e.case,requirement:e.requirement,steps:e.steps,expected:e.expected,priority:e.priority,tag:e.tag,result:e.result?gt({...e.result}):void 0,deleted:e.deleted?gt({...e.deleted}):void 0})}function z0(e){let n=[`---
5322
5654
  ${os(gt({kind:e.kind,status:e.status,covers:e.covers,use_cases:e.useCases,priority:e.priority,preconditions:e.preconditions,owner:e.owner,created:e.created,source:e.source}))}---
5323
5655
  # ${e.code} \xB7 ${e.title}
5324
5656
  `];return e.description.trim()&&n.push(`
5325
5657
  ${e.description.trim()}
5326
5658
  `),n.push(`
5327
5659
  ${zo}
5328
- ${e.cases.length?os(e.cases.map(Gy)):`[]
5660
+ ${e.cases.length?os(e.cases.map(G0)):`[]
5329
5661
  `}\`\`\`
5330
- `),n.join("")}function Vy(e){return Ie.posix.join(Qt,e.module,`${e.code}.md`)}function Xy(e){return Ie.posix.join(Qt,e,$u)}function Ge(e){let t=Fy(ft.readFileSync(Ie.join(e,Zt),"utf8")),n=[],r=[],i=[],s=Ie.join(e,Qt),a=ft.existsSync(s)?ft.readdirSync(s,{withFileTypes:!0}).filter(o=>o.isDirectory()).map(o=>o.name).sort():[];for(let o of a)for(let c of ft.readdirSync(Ie.join(s,o)).sort()){if(!c.endsWith(".md"))continue;let l=Ie.posix.join(Qt,o,c);try{let u=ft.readFileSync(Ie.join(e,l),"utf8");c===$u?n.push(Hy(u,l)):r.push(Ky(u,l))}catch(u){i.push({file:l,message:u.message})}}return n.sort((o,c)=>o.order-c.order||o.code.localeCompare(c.code)),{root:e,config:t,modules:n,suites:r,readErrors:i}}function Yo(e,t){ft.mkdirSync(Ie.dirname(e),{recursive:!0});let n=`${e}.${process.pid}.tmp`;ft.writeFileSync(n,t),ft.renameSync(n,e)}function ze(e,t){t.file=Vy(t),Yo(Ie.join(e,t.file),zy(t))}function Jo(e,t){t.file=Xy(t.code),Yo(Ie.join(e,t.file),Uy(t))}function Hu(e,t){Yo(Ie.join(e,Zt),qy(t))}var An,Zt,Qt,$u,zo,$y,z,Vo,_n=Se(()=>{"use strict";S();An=lb(Bu(),1);fn();si();Zt=".pantest.yaml",Qt="modules",$u="_module.md",zo="```yaml pt:cases";$y={lineWidth:0,blockQuote:"literal"};z=e=>e==null?"":String(e),Vo=e=>Array.isArray(e)?e.map(t=>String(t)):e?[String(e)]:[]});import Qo from"node:fs";import ds from"node:path";function ju(e,t,n=0){if(n>8)return;let r;try{r=Qo.readdirSync(e,{withFileTypes:!0})}catch{return}for(let i of r)i.isDirectory()?!Yy.has(i.name)&&!i.name.startsWith(".")&&ju(ds.join(e,i.name),t,n+1):Uu.test(i.name)&&t.push(ds.join(e,i.name))}function bt(e){let t=new Map,n=[];ju(e,n);for(let r of n){let i=Uu.exec(ds.basename(r))[1];try{let{front:s,body:a}=cs(Qo.readFileSync(r,"utf8")),o=/^#\s+(\S+)\s*(?:·\s*(.*))?$/m.exec(a);if(o?.[1]!==i)continue;t.set(i,{code:i,title:(o[2]??"").trim(),type:String(s.type??""),deleted:s.status==="deleted"})}catch{}}return t}function Ve(e,t){if(!t)return null;let n=ds.resolve(e,t);return Qo.existsSync(n)?n:null}var Uu,Yy,Nn=Se(()=>{"use strict";S();_n();Uu=/^([A-Z][A-Z0-9]*-[A-Z0-9]+-[A-Z0-9]+)\.md$/,Yy=new Set([".git","node_modules",".pan-ba","dist","build"])});import{execFileSync as Zo}from"node:child_process";import br from"node:fs";import ps from"node:path";function vt(e){let t=process.env.PAN_TEST_ME?.trim();if(t)return t;try{let n=Zo("git",["-C",e,"config","user.name"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(n)return n}catch{}return process.env.USER??process.env.USERNAME??"unknown"}function us(e,t=[]){let n=new Set(t);for(let r of e.suites){n.add(r.code);for(let i of r.cases)n.add(i.code)}return n}function Ft(e){let t=new Set;try{let n=Zo("git",["-C",e,"for-each-ref","--format=%(refname)","refs/heads","refs/remotes"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).split(`
5662
+ `),n.join("")}function V0(e){return Pe.posix.join(Qt,e.module,`${e.code}.md`)}function X0(e){return Pe.posix.join(Qt,e,$u)}function Ge(e){let t=F0(ft.readFileSync(Pe.join(e,Zt),"utf8")),n=[],r=[],i=[],s=Pe.join(e,Qt),a=ft.existsSync(s)?ft.readdirSync(s,{withFileTypes:!0}).filter(o=>o.isDirectory()).map(o=>o.name).sort():[];for(let o of a)for(let c of ft.readdirSync(Pe.join(s,o)).sort()){if(!c.endsWith(".md"))continue;let l=Pe.posix.join(Qt,o,c);try{let u=ft.readFileSync(Pe.join(e,l),"utf8");c===$u?n.push(H0(u,l)):r.push(K0(u,l))}catch(u){i.push({file:l,message:u.message})}}return n.sort((o,c)=>o.order-c.order||o.code.localeCompare(c.code)),{root:e,config:t,modules:n,suites:r,readErrors:i}}function Yo(e,t){ft.mkdirSync(Pe.dirname(e),{recursive:!0});let n=`${e}.${process.pid}.tmp`;ft.writeFileSync(n,t),ft.renameSync(n,e)}function ze(e,t){t.file=V0(t),Yo(Pe.join(e,t.file),z0(t))}function Jo(e,t){t.file=X0(t.code),Yo(Pe.join(e,t.file),U0(t))}function Hu(e,t){Yo(Pe.join(e,Zt),q0(t))}var _n,Zt,Qt,$u,zo,$0,z,Vo,An=Se(()=>{"use strict";S();_n=lb(Bu(),1);fn();si();Zt=".pantest.yaml",Qt="modules",$u="_module.md",zo="```yaml pt:cases";$0={lineWidth:0,blockQuote:"literal"};z=e=>e==null?"":String(e),Vo=e=>Array.isArray(e)?e.map(t=>String(t)):e?[String(e)]:[]});import Qo from"node:fs";import ds from"node:path";function ju(e,t,n=0){if(n>8)return;let r;try{r=Qo.readdirSync(e,{withFileTypes:!0})}catch{return}for(let i of r)i.isDirectory()?!Y0.has(i.name)&&!i.name.startsWith(".")&&ju(ds.join(e,i.name),t,n+1):Uu.test(i.name)&&t.push(ds.join(e,i.name))}function bt(e){let t=new Map,n=[];ju(e,n);for(let r of n){let i=Uu.exec(ds.basename(r))[1];try{let{front:s,body:a}=cs(Qo.readFileSync(r,"utf8")),o=/^#\s+(\S+)\s*(?:·\s*(.*))?$/m.exec(a);if(o?.[1]!==i)continue;t.set(i,{code:i,title:(o[2]??"").trim(),type:String(s.type??""),deleted:s.status==="deleted"})}catch{}}return t}function Ve(e,t){if(!t)return null;let n=ds.resolve(e,t);return Qo.existsSync(n)?n:null}var Uu,Y0,Nn=Se(()=>{"use strict";S();An();Uu=/^([A-Z][A-Z0-9]*-[A-Z0-9]+-[A-Z0-9]+)\.md$/,Y0=new Set([".git","node_modules",".pan-ba","dist","build"])});import{execFileSync as Zo}from"node:child_process";import br from"node:fs";import ps from"node:path";function vt(e){let t=process.env.PAN_TEST_ME?.trim();if(t)return t;try{let n=Zo("git",["-C",e,"config","user.name"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(n)return n}catch{}return process.env.USER??process.env.USERNAME??"unknown"}function us(e,t=[]){let n=new Set(t);for(let r of e.suites){n.add(r.code);for(let i of r.cases)n.add(i.code)}return n}function Ft(e){let t=new Set;try{let n=Zo("git",["-C",e,"for-each-ref","--format=%(refname)","refs/heads","refs/remotes"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).split(`
5331
5663
  `).filter(Boolean);for(let r of n){let i=Zo("git",["-C",e,"grep","-h","-o","-E","(KB|TC)-[A-Z][A-Z0-9]{1,11}-[A-Z0-9]{6}",r,"--",Qt],{encoding:"utf8",stdio:["ignore","pipe","ignore"],maxBuffer:67108864});for(let s of i.split(`
5332
5664
  `)){let a=s.slice(s.lastIndexOf(":")+1).trim();a&&t.add(a)}}}catch{}return t}function Ku(e,t){let n=ps.resolve(e);if(br.existsSync(ps.join(n,Zt)))throw new K(U(`${n} \u0111\xE3 l\xE0 repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED (${Zt})`,`${n} is already a test document repo (${Zt})`));let r={version:1,title:t.title,language:t.language??"vi",...t.ba?{ba:t.ba}:{},members:t.me?[{id:t.me.id,name:t.me.name,role:"Tester"}]:[]};Hu(n,r),br.mkdirSync(ps.join(n,Qt),{recursive:!0});let i=ps.join(n,".gitignore"),s=br.existsSync(i)?br.readFileSync(i,"utf8"):"";return/^\/?exports\/?$/m.test(s)||br.writeFileSync(i,s+(s&&!s.endsWith(`
5333
5665
  `)?`
5334
5666
  `:"")+`exports/
5335
- `),r}function hs(e,t,n){if(!ai.test(t))throw new K(U(`M\xE3 ph\xE2n h\u1EC7 \xAB${t}\xBB ph\u1EA3i l\xE0 ch\u1EEF hoa / s\u1ED1, 2\u201312 k\xFD t\u1EF1, b\u1EAFt \u0111\u1EA7u b\u1EB1ng ch\u1EEF.`,`Module code \xAB${t}\xBB must be 2\u201312 capitals / digits starting with a letter.`));if(e.modules.some(i=>i.code===t))throw new K(U(`\u0110\xE3 c\xF3 ph\xE2n h\u1EC7 ${t}.`,`Module ${t} already exists.`));let r={code:t,title:n,order:Math.max(0,...e.modules.map(i=>i.order))+1,suites:[],commonSteps:"",file:""};return Jo(e.root,r),e.modules.push(r),r}function vr(e,t,n){let r=ms(e,t);return Object.assign(r,n),Jo(e.root,r),r}function ms(e,t){let n=e.modules.find(r=>r.code===t);if(!n)throw new K(U(`Kh\xF4ng c\xF3 ph\xE2n h\u1EC7 ${t}.`,`No module ${t}.`));return n}function en(e,t,{withDeleted:n=!1}={}){let r=e.modules.find(s=>s.code===t),i=new Map((r?.suites??[]).map((s,a)=>[s,a]));return e.suites.filter(s=>s.module===t&&(n||s.status!=="deleted")).sort((s,a)=>(i.get(s.code)??1e9)-(i.get(a.code)??1e9)||s.code.localeCompare(a.code))}function fs(e,t){let n=ms(e,t.module);if(!t.title.trim())throw new K(U("K\u1ECBch b\u1EA3n c\u1EA7n t\xEAn.","The test suite needs a name."));let r=t.by??vt(e.root),i={code:mn("KB",n.code,us(e,t.avoid)),module:n.code,title:t.title.trim(),kind:t.kind??"functional",status:"drafting",covers:t.covers??[],useCases:t.useCases??[],...t.priority?{priority:t.priority}:{},...t.preconditions?{preconditions:t.preconditions}:{},owner:r,created:{by:r,at:Wu()},description:"",cases:[],file:""};ze(e.root,i),e.suites.push(i);let s=en(e,n.code).map(o=>o.code).filter(o=>o!==i.code),a=t.after?s.indexOf(t.after):-1;return s.splice(a>=0?a+1:s.length,0,i.code),vr(e,n.code,{suites:s}),i}function Gu(e,t){let n=e.suites.find(r=>r.code===t);if(!n)throw new K(U(`Kh\xF4ng c\xF3 k\u1ECBch b\u1EA3n ${t}.`,`No test suite ${t}.`));return n}function zu(e,t,n){let r=Gu(e,t);for(let[i,s]of Object.entries(n))s!==void 0&&(s===""&&(i==="priority"||i==="preconditions"||i==="owner")?delete r[i]:r[i]=s);return ze(e.root,r),r}function gs(e,t,n,r={}){let i=Gu(e,t);if(!n.case.trim())throw new K(U("T\xECnh hu\u1ED1ng c\u1EA7n m\xF4 t\u1EA3.","The test case needs a description."));let s={code:mn("TC",i.module,us(e,r.avoid)),case:n.case.trim(),...n.requirement?{requirement:n.requirement.trim()}:{},steps:(n.steps??"").trim(),expected:(n.expected??"").trim(),...n.priority?{priority:n.priority}:{},...n.tag?{tag:n.tag.trim()}:{}},a=r.after?i.cases.findIndex(o=>o.code===r.after):-1;return i.cases.splice(a>=0?a+1:i.cases.length,0,s),ze(e.root,i),s}function bs(e,t){if(!li.test(t))throw new K(U(`M\xE3 t\xECnh hu\u1ED1ng \xAB${t}\xBB sai m\u1EABu (TC-<PH>-XXXXXX).`,`Test case code \xAB${t}\xBB has the wrong format (TC-<MODULE>-XXXXXX).`));for(let n of e.suites){let r=n.cases.find(i=>i.code===t);if(r)return{suite:n,tc:r}}throw new K(U(`Kh\xF4ng c\xF3 t\xECnh hu\u1ED1ng ${t}.`,`No test case ${t}.`))}function vs(e,t,n){let{suite:r,tc:i}=bs(e,t);for(let[s,a]of Object.entries(n)){if(a===void 0)continue;let o=typeof a=="string"?a.trim():a;o===""&&(s==="requirement"||s==="priority"||s==="tag")?delete i[s]:i[s]=o}return ze(e.root,r),i}function Vu(e,t,n){let{suite:r,tc:i}=bs(e,t),s=r.cases.indexOf(i),a=s+n;return a<0||a>=r.cases.length||([r.cases[s],r.cases[a]]=[r.cases[a],r.cases[s]],ze(e.root,r)),i}function ws(e,t,n="",r){let{suite:i,tc:s}=bs(e,t);return s.deleted={by:r??vt(e.root),at:Wu(),...n?{reason:n}:{}},ze(e.root,i),s}function ys(e,t,n){if(!et.includes(n.status))throw new K(U(`Tr\u1EA1ng th\xE1i \xAB${n.status}\xBB kh\xF4ng h\u1EE3p l\u1EC7 (${et.join(" | ")}).`,`Invalid status \xAB${n.status}\xBB (${et.join(" | ")}).`));let{suite:r,tc:i}=bs(e,t);if(n.status==="failed"&&!(n.actual??"").trim())throw new K(U("Kh\xF4ng \u0111\u1EA1t: c\u1EA7n ghi k\u1EBFt qu\u1EA3 th\u1EF1c t\u1EBF.","Failed: enter the actual result."));if(n.status==="not-run")delete i.result;else{let s={status:n.status,by:n.by??vt(e.root),at:n.at??Jy()};n.actual?.trim()&&(s.actual=n.actual.trim()),n.env?.trim()&&(s.env=n.env.trim()),n.bug?.trim()&&(s.bug=n.bug.trim()),i.result=s}return ze(e.root,r),i}var K,Jy,Wu,wr=Se(()=>{"use strict";S();qn();fn();_n();si();K=class extends Error{},Jy=()=>new Date().toISOString().slice(0,10),Wu=()=>new Date().toISOString().replace(/\.\d{3}Z$/,"Z")});function xs(e,t){let n=[],r=Qy[e.config.language==="en"?"en":"vi"];for(let l of e.readErrors)n.push({rule:"E03",severity:"error",file:l.file,message:r.E03(l.message)});let i=new Map,s=(l,u)=>{let d=i.get(l);d?n.push({rule:"E01",severity:"error",code:l,file:u,message:r.E01(l,d)}):i.set(l,u)},a=new Set(e.modules.map(l=>l.code)),o=new Set;for(let l of e.suites){s(l.code,l.file),oi.exec(l.code)||n.push({rule:"E02",severity:"error",code:l.code,file:l.file,message:r.E02suite(l.code)}),a.has(l.module)||n.push({rule:"E04",severity:"error",code:l.code,file:l.file,message:r.E04(l.module)});for(let p of l.cases){s(p.code,l.file);let h=li.exec(p.code);h?h[1]!==l.module&&!p.deleted&&n.push({rule:"E02",severity:"error",code:p.code,file:l.file,message:r.E02mod(p.code,h[1],l.code)}):n.push({rule:"E02",severity:"error",code:p.code,file:l.file,message:r.E02case(p.code)})}if(l.status==="deleted")continue;for(let p of l.covers)o.add(p);let d=l.cases.filter(p=>!p.deleted);if(d.length===0&&n.push({rule:"T06",severity:"warn",code:l.code,file:l.file,message:r.T06(l.code)}),l.kind==="functional"&&l.covers.length===0&&n.push({rule:"T01",severity:"warn",code:l.code,file:l.file,message:r.T01(l.code)}),t)for(let p of l.covers){let h=t.get(p);h?h.deleted&&n.push({rule:"T05",severity:"warn",code:l.code,file:l.file,message:r.T05del(l.code,p)}):n.push({rule:"T05",severity:"warn",code:l.code,file:l.file,message:r.T05none(l.code,p)})}for(let p of d){let h=[!p.steps.trim()&&r.steps,!p.expected.trim()&&r.expected].filter(Boolean);h.length&&n.push({rule:"T03",severity:"warn",code:p.code,file:l.file,message:r.T03(p.code,h.join(r.and))}),p.result?.status==="failed"&&!p.result.actual?.trim()&&n.push({rule:"T04",severity:"warn",code:p.code,file:l.file,message:r.T04(p.code)})}}if(t)for(let l of t.values())l.deleted||l.type!=="function"||o.has(l.code)||n.push({rule:"T02",severity:"info",code:l.code,message:r.T02(l.code,l.title)});let c={error:0,warn:1,info:2};return n.sort((l,u)=>c[l.severity]-c[u.severity]||l.rule.localeCompare(u.rule))}function tn(){return{total:0,"not-run":0,passed:0,failed:0,blocked:0,skipped:0}}function yr(e,t=tn()){for(let n of e.cases)n.deleted||(t.total++,t[n.result?.status??"not-run"]++);return t}function Pn(e,t){let n=tn(),r=e.modules.map(s=>{let a=e.suites.filter(c=>c.module===s.code&&c.status!=="deleted"),o=tn();for(let c of a)yr(c,o);for(let c of Object.keys(n))n[c]+=o[c];return{code:s.code,title:s.title,suites:a.length,count:o}}),i=null;if(t){let s=new Set(e.suites.filter(o=>o.status!=="deleted").flatMap(o=>o.covers)),a=[...t.values()].filter(o=>o.type==="function"&&!o.deleted);i={functions:a.length,covered:a.filter(o=>s.has(o.code)).length}}return{all:n,modules:r,coverage:i}}var Qy,xr=Se(()=>{"use strict";S();fn();Qy={vi:{E03:e=>`Kh\xF4ng \u0111\u1ECDc \u0111\u01B0\u1EE3c t\u1EC7p: ${e}`,E01:(e,t)=>`Tr\xF9ng m\xE3 ${e} (\u0111\xE3 c\xF3 \u1EDF ${t}) \u2014 \u0111\u1ED5i m\xE3 m\u1ED9t b\xEAn (th\u01B0\u1EDDng do hai nh\xE1nh git c\xF9ng sinh).`,E02suite:e=>`M\xE3 k\u1ECBch b\u1EA3n \xAB${e}\xBB sai m\u1EABu.`,E04:e=>`K\u1ECBch b\u1EA3n thu\u1ED9c ph\xE2n h\u1EC7 ${e} nh\u01B0ng ch\u01B0a c\xF3 modules/${e}/_module.md.`,E02case:e=>`M\xE3 t\xECnh hu\u1ED1ng \xAB${e}\xBB sai m\u1EABu (TC-<PH>-XXXXXX).`,E02mod:(e,t,n)=>`T\xECnh hu\u1ED1ng ${e} mang m\xE3 ph\xE2n h\u1EC7 ${t} nh\u01B0ng n\u1EB1m trong k\u1ECBch b\u1EA3n ${n}.`,T06:e=>`K\u1ECBch b\u1EA3n ${e} ch\u01B0a c\xF3 t\xECnh hu\u1ED1ng.`,T01:e=>`K\u1ECBch b\u1EA3n ${e} ch\u01B0a ghi ch\u1EE9c n\u0103ng n\xE0o \u0111\u01B0\u1EE3c ki\u1EC3m (covers).`,T05none:(e,t)=>`${e} ph\u1EE7 ${t} nh\u01B0ng repo BA kh\xF4ng c\xF3 m\u1EE5c n\xE0y.`,T05del:(e,t)=>`${e} ph\u1EE7 ${t} \u2014 m\u1EE5c n\xE0y \u0111\xE3 b\u1ECB xo\xE1 trong repo BA.`,steps:"c\xE1c b\u01B0\u1EDBc",expected:"k\u1EBFt qu\u1EA3 mong \u0111\u1EE3i",and:" v\xE0 ",T03:(e,t)=>`T\xECnh hu\u1ED1ng ${e} thi\u1EBFu ${t}.`,T04:e=>`T\xECnh hu\u1ED1ng ${e} Kh\xF4ng \u0111\u1EA1t nh\u01B0ng ch\u01B0a ghi k\u1EBFt qu\u1EA3 th\u1EF1c t\u1EBF.`,T02:(e,t)=>`Ch\u1EE9c n\u0103ng ${e}${t?" \xAB"+t+"\xBB":""} ch\u01B0a c\xF3 k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED.`},en:{E03:e=>`Cannot read the file: ${e}`,E01:(e,t)=>`Duplicate code ${e} (already in ${t}) \u2014 change one of them (usually two git branches generated the same code).`,E02suite:e=>`Test suite code \xAB${e}\xBB has the wrong format.`,E04:e=>`The test suite belongs to module ${e}, but modules/${e}/_module.md does not exist.`,E02case:e=>`Test case code \xAB${e}\xBB has the wrong format (TC-<MODULE>-XXXXXX).`,E02mod:(e,t,n)=>`Test case ${e} has module code ${t} but is in test suite ${n}.`,T06:e=>`Test suite ${e} has no test cases yet.`,T01:e=>`Test suite ${e} does not name any function under test (covers).`,T05none:(e,t)=>`${e} covers ${t}, but the BA repo has no such item.`,T05del:(e,t)=>`${e} covers ${t} \u2014 that item was deleted in the BA repo.`,steps:"steps",expected:"expected result",and:" and ",T03:(e,t)=>`Test case ${e} has no ${t}.`,T04:e=>`Test case ${e} failed but has no actual result.`,T02:(e,t)=>`Function ${e}${t?" \xAB"+t+"\xBB":""} has no test suite yet.`}}});function Dr(e){"@babel/helpers - typeof";return Dr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dr(e)}function ex(e,t){if(Dr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Dr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tx(e){var t=ex(e,"string");return Dr(t)=="symbol"?t:t+""}function E(e,t,n){return(t=tx(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xu(Object(n),!0).forEach(function(r){E(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rx(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Zl(e,t){if(e==null)return{};var n,r,i=rx(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function BC(e,t){return MC(e,t||{},0,0)}function $C(e,t){return IC(e,{i:2},t&&t.out,t&&t.dictionary)}function Ah(e,t){if(t){for(var n=new oe(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(Eh)return Eh.encode(e);for(var i=e.length,s=new oe(e.length+(e.length>>1)),a=0,o=function(u){s[a++]=u},r=0;r<i;++r){if(a+5>s.length){var c=new oe(a+8+(i-r<<1));c.set(s),s=c}var l=e.charCodeAt(r);l<128||t?o(l):l<2048?(o(192|l>>6),o(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++r)&1023,o(240|l>>18),o(128|l>>12&63),o(128|l>>6&63),o(128|l&63)):(o(224|l>>12),o(128|l>>6&63),o(128|l&63))}return Vr(s,0,a)}function qC(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else{if(Hl)return Hl.decode(e);var i=FC(e),s=i.s,n=i.r;return n.length&&Ee(8),s}}function KC(e,t){t||(t={});var n={},r=[];Mf(e,"",n,t);var i=0,s=0;for(var a in n){var o=n[a],c=o[0],l=o[1],u=l.level==0?0:8,d=Ah(a),p=d.length,h=l.comment,f=h&&Ah(h),m=f&&f.length,g=Ul(l.extra);p>65535&&Ee(11);var y=u?BC(c,l):c,T=y.length,b=DC();b.p(c),r.push(Df(l,{size:c.length,crc:b.d(),c:y,f:d,m:f,u:p!=a.length||f&&h.length!=m,o:i,compression:u})),i+=30+p+g+T,s+=76+2*(p+g)+(m||0)+T}for(var C=new oe(s+22),_=i,w=s-i,x=0;x<r.length;++x){var d=r[x];_h(C,d.o,d,d.f,d.u,d.c.length);var v=30+d.f.length+Ul(d.extra);C.set(d.c,d.o+v),_h(C,i,d,d.f,d.u,d.c.length,d.o,d.m),i+=16+v+(d.m?d.m.length:0)}return WC(C,i,r.length,w,_),C}function GC(e,t){for(var n={},r=e.length-22;Be(e,r)!=101010256;--r)(!r||e.length-r>65558)&&Ee(13);var i=st(e,r+8);if(!i)return{};var s=Be(e,r+16),a=Be(e,r-20)==117853008;if(a){var o=Be(e,r-12);a=Be(e,o)==101075792,a&&(i=Be(e,o+32),s=Be(e,o+48))}for(var c=t&&t.filter,l=0;l<i;++l){var u=UC(e,s,a),d=u[0],p=u[1],h=u[2],f=u[3],m=u[4],g=u[5],y=HC(e,g);s=m,(!c||c({name:f,size:p,originalSize:h,compression:d}))&&(d?d==8?n[f]=$C(e.subarray(y,y+p),{out:new oe(h)}):Ee(14,"unknown compression type "+d):n[f]=Vr(e,y,y+p))}return n}function Oh(e,t,n,r,i,s,a){try{var o=e[s](a),c=o.value}catch(l){n(l);return}o.done?t(c):Promise.resolve(c).then(r,i)}function Kt(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function a(c){Oh(s,r,i,a,o,"next",c)}function o(c){Oh(s,r,i,a,o,"throw",c)}a(void 0)})}}var Zy,jr,Yh,Ws,nx,P,St,H,Jh,_e,ix,sx,ax,Qh,_s,ox,lx,Wr,cx,Zh,Ms,dx,nl,em,tm,j,nm,rm,px,ec,ux,hx,mx,im,le,Ks,sm,Yu,tc,fx,qt,am,om,at,gx,ve,bx,lm,vx,wx,yx,I,rl,cm,ot,kr,Pr,nn,L,ue,dm,nc,pm,um,hm,rc,xx,kx,Tx,Ju,Sx,Qu,Cx,Ex,Ax,_x,Zu,Nx,Px,Ix,ic,Ox,sc,Kr,he,Gr,Rx,Lx,Dx,Mx,Gs,ac,_r,mm,Bx,fm,$x,sn,an,Ht,Ut,Fx,qx,Hx,Ux,zs,jx,He,Wx,Kx,Gx,zx,Vx,Xx,Yx,Jx,Qx,Zx,rt,JP,ek,tk,nk,eh,Xe,Bn,rk,ik,sk,QP,ak,gm,ok,lk,$n,Tr,bm,ck,dk,pk,uk,hk,mk,il,vm,fk,gk,wm,bk,on,vk,wk,Mr,ks,yk,qe,Oe,oc,xk,ym,kk,Tk,Sk,Ck,Ek,Ak,_k,lc,xm,km,Nk,Pk,Ik,Ok,Rk,Tm,Lk,Br,Sm,Dk,Mk,Cm,Em,Bk,Am,_m,Nm,cc,$k,Fk,ct,dt,Je,$e,dc,qk,Pm,Hk,Uk,jk,Im,Wk,Kk,Om,Rm,Il,pc,Lm,Gk,Dm,zk,Vk,Xk,Yk,Jk,Qk,Zk,e1,t1,n1,uc,r1,Ol,i1,s1,sl,th,Vs,Mm,a1,o1,zr,l1,be,c1,d1,nh,p1,u1,h1,m1,f1,g1,b1,v1,w1,y1,x1,Xs,k1,T1,$m,S1,Dn,C1,Ys,Nr,rh,E1,A1,_1,Ts,N1,P1,hc,I1,mc,Fm,O1,R1,L1,qm,Um,jm,D1,M1,B1,$1,Wm,Bs,Ss,F1,q1,H1,U1,Km,j1,W1,al,K1,G1,Mn,ih,ne,z1,ZP,zm,V1,X1,Ln,sh,ol,Y1,Vm,J1,Q1,ah,Z1,eT,tT,nT,$s,rT,iT,sT,aT,it,Ns,Rl,oT,Ym,Fe,$r,Ps,Jm,fc,lT,cT,oh,dT,Is,pT,uT,hT,mT,fT,gT,bT,vT,Qm,wT,yT,xT,kT,TT,Zm,ST,lh,CT,ET,ef,AT,Fr,Ll,In,_T,tf,ll,NT,PT,IT,OT,nf,RT,LT,DT,gc,MT,BT,rf,$T,Fs,Ir,FT,Js,sf,qT,HT,UT,wt,ge,jT,Dl,Qs,WT,KT,ch,GT,zT,VT,XT,YT,JT,QT,ZT,eS,tS,nS,rS,of,iS,lf,dh,cl,sS,cf,aS,df,pf,oS,lS,cS,dS,pS,uS,uf,ph,dl,hS,hf,mS,fS,gS,bS,vS,mf,yt,wS,yS,xS,kS,TS,SS,CS,ES,AS,_S,NS,pl,PS,IS,uh,OS,RS,LS,DS,ff,gf,MS,BS,hh,mh,$S,FS,fh,qS,HS,US,gh,bh,jS,WS,KS,bf,GS,zS,VS,bc,Ct,ln,Wt,XS,YS,JS,QS,ZS,eC,tC,nC,rC,iC,sC,vf,vh,xt,wf,yf,xf,kf,Tf,Sf,aC,oC,lC,Or,vc,wh,yh,Ml,cC,dC,ul,pC,uC,hC,mC,fC,gC,wc,xh,Cf,bC,hl,vC,wC,kh,yC,Ef,Os,ml,fl,gl,xC,kC,TC,Qe,Af,_f,cn,yc,SC,oe,Le,xc,Zs,ea,Bl,Nf,Pf,If,$l,Of,CC,Th,Fl,kt,Y,lt,jt,Y,Y,Y,Y,qr,Y,EC,AC,_C,NC,bl,Ye,vl,kc,Vr,PC,Ee,IC,Tt,Sr,wl,ql,Sh,Cr,Rf,Ch,OC,Lf,RC,LC,DC,MC,Df,st,Be,yl,ke,Mf,Eh,Hl,FC,HC,UC,jC,Ul,_h,WC,zC,qs,VC,Nh,Bf,xl,Rs,Ph,jl,XC,YC,JC,Hr,Xr,Wl,Rr,QC,ZC,eE,tE,nE,rE,iE,$f,sE,aE,oE,Ff,Er,kl,lE,cE,dn,qf,Hf,dE,Uf,pE,uE,Tl,hE,Tc,mE,fE,Ih,gE,bE,Rh,Lh,Sc,jf,Wf,vE,wE,ta,pt,Kf,Gf,Te,zf,On,yE,xE,kE,Cc,Kl,Ur,Dh,TE,Mh,Bh,Gl,SE,$h,Fh,CE,EE,AE,_E,NE,zl,Ec,PE,Hs,Vf,IE,OE,Ce,RE,na,Xf,qh,LE,DE,Vl,Xl,ME,BE,$E,FE,qE,HE,UE,jE,Yf,WE,Cs,KE,GE,Es,Jf,zE,Hh,VE,XE,As,YE,JE,Uh,QE,ZE,e2,jh,t2,Yl,Sl,n2,r2,i2,Qf,Ls,s2,a2,Zf,Us,Yr,o2,eg,l2,c2,d2,Ar,tg,Cl,Wh,ng,Ac,El,p2,Kh,u2,_c,h2,m2,f2,g2,b2,Jl,v2,w2,rg,y2,Al,Gh,rn,ig,x2,k2,sg,T2,S2,C2,_l,E2,Lr,Ql,Ds,zh,A2,_2,N2,P2,I2,O2,R2,L2,ag,D2,M2,B2,$2,og,F2,q2,js,H2,lg,U2,j2,cg,dg,W2,pg,Vh,K2,G2,z2,Xh,eI,V2,tI,Nl,X2,ug=Se(()=>{S();Zy=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports);jr=class{constructor(e){E(this,"rootKey",void 0),this.rootKey=e}get writtenAs(){}},Yh=e=>e instanceof jr||typeof e=="object"&&e!==null&&typeof e.prepForXml=="function",Ws=e=>Yh(e)?e.rootKey:void 0,nx=Object.seal({}),P=class extends jr{constructor(e){super(e),E(this,"root",void 0),this.root=new Array}prepForXml(e){var t;e.stack.push(this);let n=this.root.flatMap(r=>{if(Yh(r)){let i=r.writtenAs;return i?i.map(s=>s.prepForXml(e)):r.prepForXml(e)}return r}).filter(r=>r!==void 0);return e.stack.pop(),{[this.rootKey]:n.length?n.length===1&&(!((t=n[0])===null||t===void 0)&&t._attr)?n[0]:n:nx}}addChildElement(e){return this.root.push(e),this}},St=class extends P{constructor(e,t){super(e),E(this,"includeIfEmpty",void 0),this.includeIfEmpty=t}prepForXml(e){let t=super.prepForXml(e);return this.includeIfEmpty||t&&(typeof t[this.rootKey]!="object"||Object.keys(t[this.rootKey]).length)?t:void 0}};H=class extends jr{constructor(e){super("_attr"),E(this,"root",void 0),E(this,"xmlKeys",void 0),this.root=e}prepForXml(e){let t={};return Object.entries(this.root).forEach(([n,r])=>{if(r!==void 0){let i=this.xmlKeys&&this.xmlKeys[n]||n;t[i]=r}}),{_attr:t}}},Jh=class extends jr{constructor(e){super("_attr"),E(this,"root",void 0),this.root=e}prepForXml(e){return{_attr:Object.values(this.root).filter(({value:t})=>t!==void 0).reduce((t,{key:n,value:r})=>k(k({},t),{},{[n]:r}),{})}}},_e=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val",color:"w:color",fill:"w:fill",space:"w:space",sz:"w:sz",type:"w:type",rsidR:"w:rsidR",rsidRPr:"w:rsidRPr",rsidSect:"w:rsidSect",w:"w:w",h:"w:h",top:"w:top",right:"w:right",bottom:"w:bottom",left:"w:left",header:"w:header",footer:"w:footer",gutter:"w:gutter",linePitch:"w:linePitch",pos:"w:pos"})}};ix=["elements"],sx=new Map([["amp","&"],["lt","<"],["gt",">"],["quot",'"'],["apos","'"]]),ax=/&([^;]*);?/g,Qh=e=>e.indexOf("&")===-1?e:e.replace(ax,(t,n)=>{if(!t.endsWith(";"))throw new Error(`Invalid XML: "&" that starts no entity, in "${e}"`);let r=sx.get(n);if(r!==void 0)return r;let i=/^#x[0-9a-f]+$/i.test(n)?parseInt(n.slice(2),16):/^#[0-9]+$/.test(n)?parseInt(n.slice(1),10):NaN;if(!(i>0&&i<=1114111))throw new Error(`Invalid XML: unknown entity "${t}"`);return String.fromCodePoint(i)}),_s=e=>e===" "||e===`
5336
- `||e===" "||e==="\r",ox=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,lx=e=>Object.fromEntries([...e.matchAll(ox)].map(([,t,n,r])=>[t,n??r])),Wr=(e,{keepWhitespaceText:t=!1}={})=>{let n={},r=[],i=e.charCodeAt(0)===65279?1:0;for(;i<e.length&&_s(e[i]);)i++;let s=d=>{var p;let h=r.length===0?n:r[r.length-1];((p=h.elements)!==null&&p!==void 0?p:h.elements=[]).push(d)},a=d=>{if(d.trim()===""){d!==""&&t&&s({type:"text",text:d});return}if(r.length===0)throw new Error(`Invalid XML: text outside of the root element, "${d.trim()}"`);s({type:"text",text:Qh(d)})},o=(d,p,h)=>{let f=e.indexOf(d,p);if(f===-1)throw new Error(`Invalid XML: ${h} that isn't closed`);return f};for(;i<e.length;){let d=e.indexOf("<",i);if(a(e.slice(i,d===-1?e.length:d)),d===-1)break;if(e.startsWith("<?",d)){let p=o("?>",d+2,"processing instruction"),h=e.slice(d+2,p),f=h.search(/\s/),m=f===-1?h:h.slice(0,f),g=f===-1?"":h.slice(f).trimStart();if(m.toLowerCase()==="xml"){let y=lx(g);n.declaration=Object.keys(y).length>0?{attributes:y}:{}}else s({type:"instruction",name:m,instruction:g});i=p+2}else if(e.startsWith("<!--",d)){let p=o("-->",d+4,"comment"),h=e.slice(d+4,p);h!==""&&s({type:"comment",comment:h}),i=p+3}else if(e.startsWith("<![CDATA[",d)){let p=o("]]>",d+9,"CDATA section"),h=e.slice(d+9,p);h!==""&&s({type:"cdata",cdata:h}),i=p+3}else if(e.startsWith("<!DOCTYPE",d)){let p=d+9,h,f=!1;for(;p<e.length;p++){let m=e[p];if(h!==void 0)h=m===h?void 0:h;else if(m==='"'||m==="'")h=m;else if(m==="[")f=!0;else if(m==="]")f=!1;else if(m===">"&&!f)break}if(p===e.length)throw new Error("Invalid XML: DOCTYPE that isn't closed");s({type:"doctype",doctype:e.slice(d+9,p).replace(/^ /,"")}),i=p+1}else if(e.startsWith("</",d)){let p=o(">",d+2,"closing tag"),h=e.slice(d+2,p).trimEnd(),f=r.pop();if(f?.name!==h){var c;throw new Error(`Invalid XML: closing tag </${h}> doesn't match <${(c=f?.name)!==null&&c!==void 0?c:""}>`)}i=p+1}else i=cx(e,d+1,(p,h)=>{s(p),h||r.push(p)})}if(r.length>0)throw new Error(`Invalid XML: <${r[r.length-1].name}> isn't closed`);let{elements:l}=n,u=Zl(n,ix);return l===void 0?u:k(k({},u),{},{elements:l})},cx=(e,t,n)=>{let r=t;for(;r<e.length&&!_s(e[r])&&e[r]!=="/"&&e[r]!==">";)r++;let i=e.slice(t,r);if(i==="")throw new Error("Invalid XML: tag without a name");let s=[],a=r;for(;;){for(;a<e.length&&_s(e[a]);)a++;if(a>=e.length)throw new Error(`Invalid XML: <${i}> that isn't closed`);if(e[a]===">"||e.startsWith("/>",a)){let p=e[a]==="/";return n(k({type:"element",name:i},s.length>0?{attributes:Object.fromEntries(s)}:{}),p),a+(p?2:1)}let o=e.indexOf("=",a),c=e.slice(a,o===-1?e.length:o).trimEnd();if(o===-1||c===""||/[\s/>]/.test(c))throw new Error(`Invalid XML: attribute of <${i}> without a value`);let l=o+1;for(;l<e.length&&_s(e[l]);)l++;let u=e[l];if(u!=='"'&&u!=="'")throw new Error(`Invalid XML: value of ${c} on <${i}> isn't quoted`);let d=e.indexOf(u,l+1);if(d===-1)throw new Error(`Invalid XML: value of ${c} on <${i}> isn't closed`);s.some(([p])=>p===c)||s.push([c,Qh(e.slice(l+1,d))]),a=d+1}},Zh=new Map([["&","&amp;"],['"',"&quot;"],["'","&apos;"],["<","&lt;"],[">","&gt;"]]),Ms=e=>e.replace(/[&"'<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,t=>{var n;return(n=Zh.get(t))!==null&&n!==void 0?n:""}),dx=e=>e.replace(/[&<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,t=>{var n;return(n=Zh.get(t))!==null&&n!==void 0?n:""}),nl=e=>typeof e=="string"?Ms(e):e,em=(e,t,n)=>{let r=Object.keys(e)[0],i=r===void 0?void 0:e[r],s=[],a=[],o=c=>{for(let[l,u]of Object.entries(c))s.push(`${l}="${String(nl(u))}"`)};if(typeof i=="object"){if(i!==null){let{_attr:c,_cdata:l}=i;if(c&&o(c),l&&a.push(`<![CDATA[${l.replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`),Array.isArray(i)){let u=!1;a.push("");for(let d of i)typeof d=="object"?Object.keys(d)[0]==="_attr"?o(d._attr):a.push(em(d,t,n+1)):(a.pop(),u=!0,a.push(nl(d)));u||a.push("")}}}else a.push(nl(i));return{name:r,attributes:s,content:a,indents:n>1?t.repeat(n-1):""}},tm=(e,t,n)=>{if(typeof e!="object")return String(e);let{name:r,attributes:i,content:s,indents:a}=e,{length:o}=s,c=a+(r?`<${r}`:"")+(i.length>0?` ${i.join(" ")}`:"")+(o>0?r?">":"":"/>")+(t&&o>1?`
5667
+ `),r}function hs(e,t,n){if(!ai.test(t))throw new K(U(`M\xE3 ph\xE2n h\u1EC7 \xAB${t}\xBB ph\u1EA3i l\xE0 ch\u1EEF hoa / s\u1ED1, 2\u201312 k\xFD t\u1EF1, b\u1EAFt \u0111\u1EA7u b\u1EB1ng ch\u1EEF.`,`Module code \xAB${t}\xBB must be 2\u201312 capitals / digits starting with a letter.`));if(e.modules.some(i=>i.code===t))throw new K(U(`\u0110\xE3 c\xF3 ph\xE2n h\u1EC7 ${t}.`,`Module ${t} already exists.`));let r={code:t,title:n,order:Math.max(0,...e.modules.map(i=>i.order))+1,suites:[],commonSteps:"",file:""};return Jo(e.root,r),e.modules.push(r),r}function vr(e,t,n){let r=ms(e,t);return Object.assign(r,n),Jo(e.root,r),r}function ms(e,t){let n=e.modules.find(r=>r.code===t);if(!n)throw new K(U(`Kh\xF4ng c\xF3 ph\xE2n h\u1EC7 ${t}.`,`No module ${t}.`));return n}function en(e,t,{withDeleted:n=!1}={}){let r=e.modules.find(s=>s.code===t),i=new Map((r?.suites??[]).map((s,a)=>[s,a]));return e.suites.filter(s=>s.module===t&&(n||s.status!=="deleted")).sort((s,a)=>(i.get(s.code)??1e9)-(i.get(a.code)??1e9)||s.code.localeCompare(a.code))}function fs(e,t){let n=ms(e,t.module);if(!t.title.trim())throw new K(U("K\u1ECBch b\u1EA3n c\u1EA7n t\xEAn.","The test suite needs a name."));let r=t.by??vt(e.root),i={code:mn("KB",n.code,us(e,t.avoid)),module:n.code,title:t.title.trim(),kind:t.kind??"functional",status:"drafting",covers:t.covers??[],useCases:t.useCases??[],...t.priority?{priority:t.priority}:{},...t.preconditions?{preconditions:t.preconditions}:{},owner:r,created:{by:r,at:Wu()},description:"",cases:[],file:""};ze(e.root,i),e.suites.push(i);let s=en(e,n.code).map(o=>o.code).filter(o=>o!==i.code),a=t.after?s.indexOf(t.after):-1;return s.splice(a>=0?a+1:s.length,0,i.code),vr(e,n.code,{suites:s}),i}function Gu(e,t){let n=e.suites.find(r=>r.code===t);if(!n)throw new K(U(`Kh\xF4ng c\xF3 k\u1ECBch b\u1EA3n ${t}.`,`No test suite ${t}.`));return n}function zu(e,t,n){let r=Gu(e,t);for(let[i,s]of Object.entries(n))s!==void 0&&(s===""&&(i==="priority"||i==="preconditions"||i==="owner")?delete r[i]:r[i]=s);return ze(e.root,r),r}function gs(e,t,n,r={}){let i=Gu(e,t);if(!n.case.trim())throw new K(U("T\xECnh hu\u1ED1ng c\u1EA7n m\xF4 t\u1EA3.","The test case needs a description."));let s={code:mn("TC",i.module,us(e,r.avoid)),case:n.case.trim(),...n.requirement?{requirement:n.requirement.trim()}:{},steps:(n.steps??"").trim(),expected:(n.expected??"").trim(),...n.priority?{priority:n.priority}:{},...n.tag?{tag:n.tag.trim()}:{}},a=r.after?i.cases.findIndex(o=>o.code===r.after):-1;return i.cases.splice(a>=0?a+1:i.cases.length,0,s),ze(e.root,i),s}function bs(e,t){if(!li.test(t))throw new K(U(`M\xE3 t\xECnh hu\u1ED1ng \xAB${t}\xBB sai m\u1EABu (TC-<PH>-XXXXXX).`,`Test case code \xAB${t}\xBB has the wrong format (TC-<MODULE>-XXXXXX).`));for(let n of e.suites){let r=n.cases.find(i=>i.code===t);if(r)return{suite:n,tc:r}}throw new K(U(`Kh\xF4ng c\xF3 t\xECnh hu\u1ED1ng ${t}.`,`No test case ${t}.`))}function vs(e,t,n){let{suite:r,tc:i}=bs(e,t);for(let[s,a]of Object.entries(n)){if(a===void 0)continue;let o=typeof a=="string"?a.trim():a;o===""&&(s==="requirement"||s==="priority"||s==="tag")?delete i[s]:i[s]=o}return ze(e.root,r),i}function Vu(e,t,n){let{suite:r,tc:i}=bs(e,t),s=r.cases.indexOf(i),a=s+n;return a<0||a>=r.cases.length||([r.cases[s],r.cases[a]]=[r.cases[a],r.cases[s]],ze(e.root,r)),i}function ws(e,t,n="",r){let{suite:i,tc:s}=bs(e,t);return s.deleted={by:r??vt(e.root),at:Wu(),...n?{reason:n}:{}},ze(e.root,i),s}function xs(e,t,n){if(!et.includes(n.status))throw new K(U(`Tr\u1EA1ng th\xE1i \xAB${n.status}\xBB kh\xF4ng h\u1EE3p l\u1EC7 (${et.join(" | ")}).`,`Invalid status \xAB${n.status}\xBB (${et.join(" | ")}).`));let{suite:r,tc:i}=bs(e,t);if(n.status==="failed"&&!(n.actual??"").trim())throw new K(U("Kh\xF4ng \u0111\u1EA1t: c\u1EA7n ghi k\u1EBFt qu\u1EA3 th\u1EF1c t\u1EBF.","Failed: enter the actual result."));if(n.status==="not-run")delete i.result;else{let s={status:n.status,by:n.by??vt(e.root),at:n.at??J0()};n.actual?.trim()&&(s.actual=n.actual.trim()),n.env?.trim()&&(s.env=n.env.trim()),n.bug?.trim()&&(s.bug=n.bug.trim()),i.result=s}return ze(e.root,r),i}var K,J0,Wu,wr=Se(()=>{"use strict";S();qn();fn();An();si();K=class extends Error{},J0=()=>new Date().toISOString().slice(0,10),Wu=()=>new Date().toISOString().replace(/\.\d{3}Z$/,"Z")});function ys(e,t){let n=[],r=Q0[e.config.language==="en"?"en":"vi"];for(let l of e.readErrors)n.push({rule:"E03",severity:"error",file:l.file,message:r.E03(l.message)});let i=new Map,s=(l,u)=>{let d=i.get(l);d?n.push({rule:"E01",severity:"error",code:l,file:u,message:r.E01(l,d)}):i.set(l,u)},a=new Set(e.modules.map(l=>l.code)),o=new Set;for(let l of e.suites){s(l.code,l.file),oi.exec(l.code)||n.push({rule:"E02",severity:"error",code:l.code,file:l.file,message:r.E02suite(l.code)}),a.has(l.module)||n.push({rule:"E04",severity:"error",code:l.code,file:l.file,message:r.E04(l.module)});for(let p of l.cases){s(p.code,l.file);let h=li.exec(p.code);h?h[1]!==l.module&&!p.deleted&&n.push({rule:"E02",severity:"error",code:p.code,file:l.file,message:r.E02mod(p.code,h[1],l.code)}):n.push({rule:"E02",severity:"error",code:p.code,file:l.file,message:r.E02case(p.code)})}if(l.status==="deleted")continue;for(let p of l.covers)o.add(p);let d=l.cases.filter(p=>!p.deleted);if(d.length===0&&n.push({rule:"T06",severity:"warn",code:l.code,file:l.file,message:r.T06(l.code)}),l.kind==="functional"&&l.covers.length===0&&n.push({rule:"T01",severity:"warn",code:l.code,file:l.file,message:r.T01(l.code)}),t)for(let p of l.covers){let h=t.get(p);h?h.deleted&&n.push({rule:"T05",severity:"warn",code:l.code,file:l.file,message:r.T05del(l.code,p)}):n.push({rule:"T05",severity:"warn",code:l.code,file:l.file,message:r.T05none(l.code,p)})}for(let p of d){let h=[!p.steps.trim()&&r.steps,!p.expected.trim()&&r.expected].filter(Boolean);h.length&&n.push({rule:"T03",severity:"warn",code:p.code,file:l.file,message:r.T03(p.code,h.join(r.and))}),p.result?.status==="failed"&&!p.result.actual?.trim()&&n.push({rule:"T04",severity:"warn",code:p.code,file:l.file,message:r.T04(p.code)})}}if(t)for(let l of t.values())l.deleted||l.type!=="function"||o.has(l.code)||n.push({rule:"T02",severity:"info",code:l.code,message:r.T02(l.code,l.title)});let c={error:0,warn:1,info:2};return n.sort((l,u)=>c[l.severity]-c[u.severity]||l.rule.localeCompare(u.rule))}function tn(){return{total:0,"not-run":0,passed:0,failed:0,blocked:0,skipped:0}}function xr(e,t=tn()){for(let n of e.cases)n.deleted||(t.total++,t[n.result?.status??"not-run"]++);return t}function In(e,t){let n=tn(),r=e.modules.map(s=>{let a=e.suites.filter(c=>c.module===s.code&&c.status!=="deleted"),o=tn();for(let c of a)xr(c,o);for(let c of Object.keys(n))n[c]+=o[c];return{code:s.code,title:s.title,suites:a.length,count:o}}),i=null;if(t){let s=new Set(e.suites.filter(o=>o.status!=="deleted").flatMap(o=>o.covers)),a=[...t.values()].filter(o=>o.type==="function"&&!o.deleted);i={functions:a.length,covered:a.filter(o=>s.has(o.code)).length}}return{all:n,modules:r,coverage:i}}var Q0,yr=Se(()=>{"use strict";S();fn();Q0={vi:{E03:e=>`Kh\xF4ng \u0111\u1ECDc \u0111\u01B0\u1EE3c t\u1EC7p: ${e}`,E01:(e,t)=>`Tr\xF9ng m\xE3 ${e} (\u0111\xE3 c\xF3 \u1EDF ${t}) \u2014 \u0111\u1ED5i m\xE3 m\u1ED9t b\xEAn (th\u01B0\u1EDDng do hai nh\xE1nh git c\xF9ng sinh).`,E02suite:e=>`M\xE3 k\u1ECBch b\u1EA3n \xAB${e}\xBB sai m\u1EABu.`,E04:e=>`K\u1ECBch b\u1EA3n thu\u1ED9c ph\xE2n h\u1EC7 ${e} nh\u01B0ng ch\u01B0a c\xF3 modules/${e}/_module.md.`,E02case:e=>`M\xE3 t\xECnh hu\u1ED1ng \xAB${e}\xBB sai m\u1EABu (TC-<PH>-XXXXXX).`,E02mod:(e,t,n)=>`T\xECnh hu\u1ED1ng ${e} mang m\xE3 ph\xE2n h\u1EC7 ${t} nh\u01B0ng n\u1EB1m trong k\u1ECBch b\u1EA3n ${n}.`,T06:e=>`K\u1ECBch b\u1EA3n ${e} ch\u01B0a c\xF3 t\xECnh hu\u1ED1ng.`,T01:e=>`K\u1ECBch b\u1EA3n ${e} ch\u01B0a ghi ch\u1EE9c n\u0103ng n\xE0o \u0111\u01B0\u1EE3c ki\u1EC3m (covers).`,T05none:(e,t)=>`${e} ph\u1EE7 ${t} nh\u01B0ng repo BA kh\xF4ng c\xF3 m\u1EE5c n\xE0y.`,T05del:(e,t)=>`${e} ph\u1EE7 ${t} \u2014 m\u1EE5c n\xE0y \u0111\xE3 b\u1ECB xo\xE1 trong repo BA.`,steps:"c\xE1c b\u01B0\u1EDBc",expected:"k\u1EBFt qu\u1EA3 mong \u0111\u1EE3i",and:" v\xE0 ",T03:(e,t)=>`T\xECnh hu\u1ED1ng ${e} thi\u1EBFu ${t}.`,T04:e=>`T\xECnh hu\u1ED1ng ${e} Kh\xF4ng \u0111\u1EA1t nh\u01B0ng ch\u01B0a ghi k\u1EBFt qu\u1EA3 th\u1EF1c t\u1EBF.`,T02:(e,t)=>`Ch\u1EE9c n\u0103ng ${e}${t?" \xAB"+t+"\xBB":""} ch\u01B0a c\xF3 k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED.`},en:{E03:e=>`Cannot read the file: ${e}`,E01:(e,t)=>`Duplicate code ${e} (already in ${t}) \u2014 change one of them (usually two git branches generated the same code).`,E02suite:e=>`Test suite code \xAB${e}\xBB has the wrong format.`,E04:e=>`The test suite belongs to module ${e}, but modules/${e}/_module.md does not exist.`,E02case:e=>`Test case code \xAB${e}\xBB has the wrong format (TC-<MODULE>-XXXXXX).`,E02mod:(e,t,n)=>`Test case ${e} has module code ${t} but is in test suite ${n}.`,T06:e=>`Test suite ${e} has no test cases yet.`,T01:e=>`Test suite ${e} does not name any function under test (covers).`,T05none:(e,t)=>`${e} covers ${t}, but the BA repo has no such item.`,T05del:(e,t)=>`${e} covers ${t} \u2014 that item was deleted in the BA repo.`,steps:"steps",expected:"expected result",and:" and ",T03:(e,t)=>`Test case ${e} has no ${t}.`,T04:e=>`Test case ${e} failed but has no actual result.`,T02:(e,t)=>`Function ${e}${t?" \xAB"+t+"\xBB":""} has no test suite yet.`}}});function Mr(e){"@babel/helpers - typeof";return Mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(e)}function ey(e,t){if(Mr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Mr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ty(e){var t=ey(e,"string");return Mr(t)=="symbol"?t:t+""}function E(e,t,n){return(t=ty(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xu(Object(n),!0).forEach(function(r){E(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ry(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Zl(e,t){if(e==null)return{};var n,r,i=ry(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function BC(e,t){return DC(e,t||{},0,0)}function $C(e,t){return PC(e,{i:2},t&&t.out,t&&t.dictionary)}function _h(e,t){if(t){for(var n=new oe(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(Eh)return Eh.encode(e);for(var i=e.length,s=new oe(e.length+(e.length>>1)),a=0,o=function(u){s[a++]=u},r=0;r<i;++r){if(a+5>s.length){var c=new oe(a+8+(i-r<<1));c.set(s),s=c}var l=e.charCodeAt(r);l<128||t?o(l):l<2048?(o(192|l>>6),o(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++r)&1023,o(240|l>>18),o(128|l>>12&63),o(128|l>>6&63),o(128|l&63)):(o(224|l>>12),o(128|l>>6&63),o(128|l&63))}return Vr(s,0,a)}function qC(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else{if(Hl)return Hl.decode(e);var i=FC(e),s=i.s,n=i.r;return n.length&&Ee(8),s}}function KC(e,t){t||(t={});var n={},r=[];Df(e,"",n,t);var i=0,s=0;for(var a in n){var o=n[a],c=o[0],l=o[1],u=l.level==0?0:8,d=_h(a),p=d.length,h=l.comment,f=h&&_h(h),m=f&&f.length,g=Ul(l.extra);p>65535&&Ee(11);var x=u?BC(c,l):c,T=x.length,b=MC();b.p(c),r.push(Mf(l,{size:c.length,crc:b.d(),c:x,f:d,m:f,u:p!=a.length||f&&h.length!=m,o:i,compression:u})),i+=30+p+g+T,s+=76+2*(p+g)+(m||0)+T}for(var C=new oe(s+22),A=i,w=s-i,y=0;y<r.length;++y){var d=r[y];Ah(C,d.o,d,d.f,d.u,d.c.length);var v=30+d.f.length+Ul(d.extra);C.set(d.c,d.o+v),Ah(C,i,d,d.f,d.u,d.c.length,d.o,d.m),i+=16+v+(d.m?d.m.length:0)}return WC(C,i,r.length,w,A),C}function GC(e,t){for(var n={},r=e.length-22;Be(e,r)!=101010256;--r)(!r||e.length-r>65558)&&Ee(13);var i=st(e,r+8);if(!i)return{};var s=Be(e,r+16),a=Be(e,r-20)==117853008;if(a){var o=Be(e,r-12);a=Be(e,o)==101075792,a&&(i=Be(e,o+32),s=Be(e,o+48))}for(var c=t&&t.filter,l=0;l<i;++l){var u=UC(e,s,a),d=u[0],p=u[1],h=u[2],f=u[3],m=u[4],g=u[5],x=HC(e,g);s=m,(!c||c({name:f,size:p,originalSize:h,compression:d}))&&(d?d==8?n[f]=$C(e.subarray(x,x+p),{out:new oe(h)}):Ee(14,"unknown compression type "+d):n[f]=Vr(e,x,x+p))}return n}function Oh(e,t,n,r,i,s,a){try{var o=e[s](a),c=o.value}catch(l){n(l);return}o.done?t(c):Promise.resolve(c).then(r,i)}function Kt(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function a(c){Oh(s,r,i,a,o,"next",c)}function o(c){Oh(s,r,i,a,o,"throw",c)}a(void 0)})}}var Z0,jr,Yh,Ws,ny,I,St,H,Jh,Ae,iy,sy,ay,Qh,As,oy,ly,Wr,cy,Zh,Ds,dy,nl,em,tm,j,nm,rm,py,ec,uy,hy,my,im,le,Ks,sm,Yu,tc,fy,qt,am,om,at,gy,ve,by,lm,vy,wy,xy,P,rl,cm,ot,kr,Ir,nn,L,ue,dm,nc,pm,um,hm,rc,yy,ky,Ty,Ju,Sy,Qu,Cy,Ey,_y,Ay,Zu,Ny,Iy,Py,ic,Oy,sc,Kr,he,Gr,Ry,Ly,My,Dy,Gs,ac,Ar,mm,By,fm,$y,sn,an,Ht,Ut,Fy,qy,Hy,Uy,zs,jy,He,Wy,Ky,Gy,zy,Vy,Xy,Yy,Jy,Qy,Zy,rt,JI,ek,tk,nk,eh,Xe,Bn,rk,ik,sk,QI,ak,gm,ok,lk,$n,Tr,bm,ck,dk,pk,uk,hk,mk,il,vm,fk,gk,wm,bk,on,vk,wk,Dr,ks,xk,qe,Oe,oc,yk,xm,kk,Tk,Sk,Ck,Ek,_k,Ak,lc,ym,km,Nk,Ik,Pk,Ok,Rk,Tm,Lk,Br,Sm,Mk,Dk,Cm,Em,Bk,_m,Am,Nm,cc,$k,Fk,ct,dt,Je,$e,dc,qk,Im,Hk,Uk,jk,Pm,Wk,Kk,Om,Rm,Pl,pc,Lm,Gk,Mm,zk,Vk,Xk,Yk,Jk,Qk,Zk,e1,t1,n1,uc,r1,Ol,i1,s1,sl,th,Vs,Dm,a1,o1,zr,l1,be,c1,d1,nh,p1,u1,h1,m1,f1,g1,b1,v1,w1,x1,y1,Xs,k1,T1,$m,S1,Mn,C1,Ys,Nr,rh,E1,_1,A1,Ts,N1,I1,hc,P1,mc,Fm,O1,R1,L1,qm,Um,jm,M1,D1,B1,$1,Wm,Bs,Ss,F1,q1,H1,U1,Km,j1,W1,al,K1,G1,Dn,ih,ne,z1,ZI,zm,V1,X1,Ln,sh,ol,Y1,Vm,J1,Q1,ah,Z1,eT,tT,nT,$s,rT,iT,sT,aT,it,Ns,Rl,oT,Ym,Fe,$r,Is,Jm,fc,lT,cT,oh,dT,Ps,pT,uT,hT,mT,fT,gT,bT,vT,Qm,wT,xT,yT,kT,TT,Zm,ST,lh,CT,ET,ef,_T,Fr,Ll,Pn,AT,tf,ll,NT,IT,PT,OT,nf,RT,LT,MT,gc,DT,BT,rf,$T,Fs,Pr,FT,Js,sf,qT,HT,UT,wt,ge,jT,Ml,Qs,WT,KT,ch,GT,zT,VT,XT,YT,JT,QT,ZT,eS,tS,nS,rS,of,iS,lf,dh,cl,sS,cf,aS,df,pf,oS,lS,cS,dS,pS,uS,uf,ph,dl,hS,hf,mS,fS,gS,bS,vS,mf,xt,wS,xS,yS,kS,TS,SS,CS,ES,_S,AS,NS,pl,IS,PS,uh,OS,RS,LS,MS,ff,gf,DS,BS,hh,mh,$S,FS,fh,qS,HS,US,gh,bh,jS,WS,KS,bf,GS,zS,VS,bc,Ct,ln,Wt,XS,YS,JS,QS,ZS,eC,tC,nC,rC,iC,sC,vf,vh,yt,wf,xf,yf,kf,Tf,Sf,aC,oC,lC,Or,vc,wh,xh,Dl,cC,dC,ul,pC,uC,hC,mC,fC,gC,wc,yh,Cf,bC,hl,vC,wC,kh,xC,Ef,Os,ml,fl,gl,yC,kC,TC,Qe,_f,Af,cn,xc,SC,oe,Le,yc,Zs,ea,Bl,Nf,If,Pf,$l,Of,CC,Th,Fl,kt,Y,lt,jt,Y,Y,Y,Y,qr,Y,EC,_C,AC,NC,bl,Ye,vl,kc,Vr,IC,Ee,PC,Tt,Sr,wl,ql,Sh,Cr,Rf,Ch,OC,Lf,RC,LC,MC,DC,Mf,st,Be,xl,ke,Df,Eh,Hl,FC,HC,UC,jC,Ul,Ah,WC,zC,qs,VC,Nh,Bf,yl,Rs,Ih,jl,XC,YC,JC,Hr,Xr,Wl,Rr,QC,ZC,e2,t2,n2,r2,i2,$f,s2,a2,o2,Ff,Er,kl,l2,c2,dn,qf,Hf,d2,Uf,p2,u2,Tl,h2,Tc,m2,f2,Ph,g2,b2,Rh,Lh,Sc,jf,Wf,v2,w2,ta,pt,Kf,Gf,Te,zf,On,x2,y2,k2,Cc,Kl,Ur,Mh,T2,Dh,Bh,Gl,S2,$h,Fh,C2,E2,_2,A2,N2,zl,Ec,I2,Hs,Vf,P2,O2,Ce,R2,na,Xf,qh,L2,M2,Vl,Xl,D2,B2,$2,F2,q2,H2,U2,j2,Yf,W2,Cs,K2,G2,Es,Jf,z2,Hh,V2,X2,_s,Y2,J2,Uh,Q2,Z2,eE,jh,tE,Yl,Sl,nE,rE,iE,Qf,Ls,sE,aE,Zf,Us,Yr,oE,eg,lE,cE,dE,_r,tg,Cl,Wh,ng,_c,El,pE,Kh,uE,Ac,hE,mE,fE,gE,bE,Jl,vE,wE,rg,xE,_l,Gh,rn,ig,yE,kE,sg,TE,SE,CE,Al,EE,Lr,Ql,Ms,zh,_E,AE,NE,IE,PE,OE,RE,LE,ag,ME,DE,BE,$E,og,FE,qE,js,HE,lg,UE,jE,cg,dg,WE,pg,Vh,KE,GE,zE,Xh,eP,VE,tP,Nl,XE,ug=Se(()=>{S();Z0=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports);jr=class{constructor(e){E(this,"rootKey",void 0),this.rootKey=e}get writtenAs(){}},Yh=e=>e instanceof jr||typeof e=="object"&&e!==null&&typeof e.prepForXml=="function",Ws=e=>Yh(e)?e.rootKey:void 0,ny=Object.seal({}),I=class extends jr{constructor(e){super(e),E(this,"root",void 0),this.root=new Array}prepForXml(e){var t;e.stack.push(this);let n=this.root.flatMap(r=>{if(Yh(r)){let i=r.writtenAs;return i?i.map(s=>s.prepForXml(e)):r.prepForXml(e)}return r}).filter(r=>r!==void 0);return e.stack.pop(),{[this.rootKey]:n.length?n.length===1&&(!((t=n[0])===null||t===void 0)&&t._attr)?n[0]:n:ny}}addChildElement(e){return this.root.push(e),this}},St=class extends I{constructor(e,t){super(e),E(this,"includeIfEmpty",void 0),this.includeIfEmpty=t}prepForXml(e){let t=super.prepForXml(e);return this.includeIfEmpty||t&&(typeof t[this.rootKey]!="object"||Object.keys(t[this.rootKey]).length)?t:void 0}};H=class extends jr{constructor(e){super("_attr"),E(this,"root",void 0),E(this,"xmlKeys",void 0),this.root=e}prepForXml(e){let t={};return Object.entries(this.root).forEach(([n,r])=>{if(r!==void 0){let i=this.xmlKeys&&this.xmlKeys[n]||n;t[i]=r}}),{_attr:t}}},Jh=class extends jr{constructor(e){super("_attr"),E(this,"root",void 0),this.root=e}prepForXml(e){return{_attr:Object.values(this.root).filter(({value:t})=>t!==void 0).reduce((t,{key:n,value:r})=>k(k({},t),{},{[n]:r}),{})}}},Ae=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val",color:"w:color",fill:"w:fill",space:"w:space",sz:"w:sz",type:"w:type",rsidR:"w:rsidR",rsidRPr:"w:rsidRPr",rsidSect:"w:rsidSect",w:"w:w",h:"w:h",top:"w:top",right:"w:right",bottom:"w:bottom",left:"w:left",header:"w:header",footer:"w:footer",gutter:"w:gutter",linePitch:"w:linePitch",pos:"w:pos"})}};iy=["elements"],sy=new Map([["amp","&"],["lt","<"],["gt",">"],["quot",'"'],["apos","'"]]),ay=/&([^;]*);?/g,Qh=e=>e.indexOf("&")===-1?e:e.replace(ay,(t,n)=>{if(!t.endsWith(";"))throw new Error(`Invalid XML: "&" that starts no entity, in "${e}"`);let r=sy.get(n);if(r!==void 0)return r;let i=/^#x[0-9a-f]+$/i.test(n)?parseInt(n.slice(2),16):/^#[0-9]+$/.test(n)?parseInt(n.slice(1),10):NaN;if(!(i>0&&i<=1114111))throw new Error(`Invalid XML: unknown entity "${t}"`);return String.fromCodePoint(i)}),As=e=>e===" "||e===`
5668
+ `||e===" "||e==="\r",oy=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,ly=e=>Object.fromEntries([...e.matchAll(oy)].map(([,t,n,r])=>[t,n??r])),Wr=(e,{keepWhitespaceText:t=!1}={})=>{let n={},r=[],i=e.charCodeAt(0)===65279?1:0;for(;i<e.length&&As(e[i]);)i++;let s=d=>{var p;let h=r.length===0?n:r[r.length-1];((p=h.elements)!==null&&p!==void 0?p:h.elements=[]).push(d)},a=d=>{if(d.trim()===""){d!==""&&t&&s({type:"text",text:d});return}if(r.length===0)throw new Error(`Invalid XML: text outside of the root element, "${d.trim()}"`);s({type:"text",text:Qh(d)})},o=(d,p,h)=>{let f=e.indexOf(d,p);if(f===-1)throw new Error(`Invalid XML: ${h} that isn't closed`);return f};for(;i<e.length;){let d=e.indexOf("<",i);if(a(e.slice(i,d===-1?e.length:d)),d===-1)break;if(e.startsWith("<?",d)){let p=o("?>",d+2,"processing instruction"),h=e.slice(d+2,p),f=h.search(/\s/),m=f===-1?h:h.slice(0,f),g=f===-1?"":h.slice(f).trimStart();if(m.toLowerCase()==="xml"){let x=ly(g);n.declaration=Object.keys(x).length>0?{attributes:x}:{}}else s({type:"instruction",name:m,instruction:g});i=p+2}else if(e.startsWith("<!--",d)){let p=o("-->",d+4,"comment"),h=e.slice(d+4,p);h!==""&&s({type:"comment",comment:h}),i=p+3}else if(e.startsWith("<![CDATA[",d)){let p=o("]]>",d+9,"CDATA section"),h=e.slice(d+9,p);h!==""&&s({type:"cdata",cdata:h}),i=p+3}else if(e.startsWith("<!DOCTYPE",d)){let p=d+9,h,f=!1;for(;p<e.length;p++){let m=e[p];if(h!==void 0)h=m===h?void 0:h;else if(m==='"'||m==="'")h=m;else if(m==="[")f=!0;else if(m==="]")f=!1;else if(m===">"&&!f)break}if(p===e.length)throw new Error("Invalid XML: DOCTYPE that isn't closed");s({type:"doctype",doctype:e.slice(d+9,p).replace(/^ /,"")}),i=p+1}else if(e.startsWith("</",d)){let p=o(">",d+2,"closing tag"),h=e.slice(d+2,p).trimEnd(),f=r.pop();if(f?.name!==h){var c;throw new Error(`Invalid XML: closing tag </${h}> doesn't match <${(c=f?.name)!==null&&c!==void 0?c:""}>`)}i=p+1}else i=cy(e,d+1,(p,h)=>{s(p),h||r.push(p)})}if(r.length>0)throw new Error(`Invalid XML: <${r[r.length-1].name}> isn't closed`);let{elements:l}=n,u=Zl(n,iy);return l===void 0?u:k(k({},u),{},{elements:l})},cy=(e,t,n)=>{let r=t;for(;r<e.length&&!As(e[r])&&e[r]!=="/"&&e[r]!==">";)r++;let i=e.slice(t,r);if(i==="")throw new Error("Invalid XML: tag without a name");let s=[],a=r;for(;;){for(;a<e.length&&As(e[a]);)a++;if(a>=e.length)throw new Error(`Invalid XML: <${i}> that isn't closed`);if(e[a]===">"||e.startsWith("/>",a)){let p=e[a]==="/";return n(k({type:"element",name:i},s.length>0?{attributes:Object.fromEntries(s)}:{}),p),a+(p?2:1)}let o=e.indexOf("=",a),c=e.slice(a,o===-1?e.length:o).trimEnd();if(o===-1||c===""||/[\s/>]/.test(c))throw new Error(`Invalid XML: attribute of <${i}> without a value`);let l=o+1;for(;l<e.length&&As(e[l]);)l++;let u=e[l];if(u!=='"'&&u!=="'")throw new Error(`Invalid XML: value of ${c} on <${i}> isn't quoted`);let d=e.indexOf(u,l+1);if(d===-1)throw new Error(`Invalid XML: value of ${c} on <${i}> isn't closed`);s.some(([p])=>p===c)||s.push([c,Qh(e.slice(l+1,d))]),a=d+1}},Zh=new Map([["&","&amp;"],['"',"&quot;"],["'","&apos;"],["<","&lt;"],[">","&gt;"]]),Ds=e=>e.replace(/[&"'<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,t=>{var n;return(n=Zh.get(t))!==null&&n!==void 0?n:""}),dy=e=>e.replace(/[&<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,t=>{var n;return(n=Zh.get(t))!==null&&n!==void 0?n:""}),nl=e=>typeof e=="string"?Ds(e):e,em=(e,t,n)=>{let r=Object.keys(e)[0],i=r===void 0?void 0:e[r],s=[],a=[],o=c=>{for(let[l,u]of Object.entries(c))s.push(`${l}="${String(nl(u))}"`)};if(typeof i=="object"){if(i!==null){let{_attr:c,_cdata:l}=i;if(c&&o(c),l&&a.push(`<![CDATA[${l.replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`),Array.isArray(i)){let u=!1;a.push("");for(let d of i)typeof d=="object"?Object.keys(d)[0]==="_attr"?o(d._attr):a.push(em(d,t,n+1)):(a.pop(),u=!0,a.push(nl(d)));u||a.push("")}}}else a.push(nl(i));return{name:r,attributes:s,content:a,indents:n>1?t.repeat(n-1):""}},tm=(e,t,n)=>{if(typeof e!="object")return String(e);let{name:r,attributes:i,content:s,indents:a}=e,{length:o}=s,c=a+(r?`<${r}`:"")+(i.length>0?` ${i.join(" ")}`:"")+(o>0?r?">":"":"/>")+(t&&o>1?`
5337
5669
  `:"");return o===0?c+(t?`
5338
5670
  `:""):c+s.map(l=>l===void 0?"":tm(l,t,!1)).join("")+(o>1?a:"")+(r?`</${r}>`:"")+(t&&!n?`
5339
- `:"")},j=(e,{indent:t="",declaration:n}={})=>{let r=Array.isArray(e)?e:[e],i=t?1:0,s=n?.standalone?` standalone="${Ms(n.standalone)}"`:"";return(n===void 0?"":`<?xml version="1.0" encoding="${Ms(n.encoding||"UTF-8")}"${s}?>${t?`
5340
- `:""}`)+r.map((a,o)=>tm(em(a,t,i),t,o===r.length-1)).join("")},nm=e=>Object.entries(e??{}).flatMap(([t,n])=>n==null?[]:[` ${t}="${Ms(String(n))}"`]).join(""),rm=e=>{switch(e.type){case"element":{var t,n;let r=(t=e.elements)!==null&&t!==void 0?t:[],i=`<${e.name}${nm(e.attributes)}`;return r.length>0||((n=e.attributes)===null||n===void 0?void 0:n["xml:space"])==="preserve"?`${i}>${r.map(rm).join("")}</${e.name}>`:`${i}/>`}case"text":return dx(String(e.text));case"cdata":return`<![CDATA[${String(e.cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`;case"comment":return`<!--${e.comment}-->`;case"doctype":return`<!DOCTYPE ${e.doctype}>`;case"instruction":return`<?${e.name}${e.instruction?` ${e.instruction}`:""}?>`;default:return""}},px=e=>{var t;return(e.declaration?`<?xml${nm(e.declaration.attributes)}?>`:"")+((t=e.elements)!==null&&t!==void 0?t:[]).map(rm).join("")},ec=e=>{switch(e.type){case void 0:case"element":let t=new hx(e.name,e.attributes),n=e.elements||[];for(let r of n){let i=ec(r);i!==void 0&&t.push(i)}return t;case"text":return e.text;default:return}},ux=class extends H{},hx=class extends P{static fromXmlString(e){return ec(Wr(e))}constructor(e,t){super(e),t&&this.root.push(new ux(t))}push(e){this.root.push(e)}get writtenAs(){return this.rootKey===void 0?this.root.filter(e=>typeof e!="string"):void 0}prepForXml(e){let t=this.writtenAs;return t?.length===1?t[0].prepForXml(e):super.prepForXml(e)}},mx=class extends P{constructor(e){super(""),E(this,"_attr",void 0),this._attr=e}prepForXml(e){return{_attr:this._attr}}},im=class extends P{constructor(e,t){super(e),t&&(this.root=t.root)}},le=e=>{if(!Number.isFinite(e))throw new Error(`Invalid value '${e}' specified. Must be an integer.`);return Math.floor(e)},Ks=e=>{let t=le(e);if(t<0)throw new Error(`Invalid value '${e}' specified. Must be a positive integer.`);return t},sm=(e,t)=>{let n=t*2;if(e.length!==n||isNaN(+`0x${e}`))throw new Error(`Invalid hex value '${e}'. Expected ${n} digit hex value`);return e},Yu=e=>sm(e,1),tc=e=>{let t=e.slice(-2),n=e.substring(0,e.length-2);return`${Number(n)}${t}`},fx={in:1440,cm:1440/2.54,mm:1440/25.4,pt:20,pc:240,pi:240},qt=e=>{if(typeof e=="number")return e;let t=e.slice(-2),n=Number(e.substring(0,e.length-2)),r=fx[t];if(r===void 0||Number.isNaN(n))throw new Error(`Invalid universal measure '${e}'. Expected a number followed by mm, cm, in, pt, pc or pi.`);return n*r},am=e=>{let t=tc(e);if(parseFloat(t)<0)throw new Error(`Invalid value '${t}' specified. Expected a positive number.`);return t},om=e=>e==="auto"?e:sm(e.charAt(0)==="#"?e.substring(1):e,3),at=e=>typeof e=="string"?tc(e):le(e),gx=e=>typeof e=="string"?am(e):Ks(e),ve=e=>typeof e=="string"?am(e):Ks(e),bx=e=>{let t=e.substring(0,e.length-1);return`${Number(t)}%`},lm=e=>typeof e=="number"?le(e):e.slice(-1)==="%"?bx(e):tc(e),vx=Ks,wx=Ks,yx=e=>e.toISOString(),I=class extends P{constructor(e,t=!0){super(e),t!==!0&&this.root.push(new _e({val:t}))}},rl=class extends P{constructor(e,t){super(e),this.root.push(new _e({val:gx(t)}))}},cm=class extends P{},ot=class extends P{constructor(e,t){super(e),this.root.push(new _e({val:t}))}},kr=(e,t)=>new L({name:e,attributes:{value:{key:"w:val",value:t}}}),Pr=class extends P{constructor(e,t){super(e),this.root.push(new _e({val:t}))}},nn=class extends P{constructor(e,t){super(e),this.root.push(t)}},L=class extends P{constructor({name:e,attributes:t,children:n}){super(e),t&&this.root.push(new Jh(t)),n&&this.root.push(...n)}},ue={START:"start",CENTER:"center",END:"end",BOTH:"both",MEDIUM_KASHIDA:"mediumKashida",DISTRIBUTE:"distribute",NUM_TAB:"numTab",HIGH_KASHIDA:"highKashida",LOW_KASHIDA:"lowKashida",THAI_DISTRIBUTE:"thaiDistribute",LEFT:"left",RIGHT:"right",JUSTIFIED:"both"},dm=e=>new L({name:"w:jc",attributes:{val:{key:"w:val",value:e}}}),nc={dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hyperlink:"hlink",followedHyperlink:"folHlink"},pm={dark2:"44546A",light2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hyperlink:"0563C1",followedHyperlink:"954F72"},um={dark1:{value:"windowText",lastColor:"000000"},light1:{value:"window",lastColor:"FFFFFF"}},hm=(e,t)=>{if(t==="auto")throw new Error(`Invalid theme color ${e} 'auto'. Expected 6 digit hex value`);return om(t)},rc=(e={})=>Object.fromEntries(Object.keys(nc).map(t=>{let n=e[t],r=t==="dark1"||t==="light1"?um[t].lastColor:pm[t];return[t,n===void 0?r:hm(t,n)]})),xx=(e,t)=>new L({name:"a:srgbClr",attributes:{value:{key:"val",value:hm(e,t)}}}),kx=(e,t)=>{let n=t[e],r=e==="dark1"||e==="light1"?um[e]:void 0;return new L({name:`a:${nc[e]}`,children:[n===void 0&&r?new L({name:"a:sysClr",attributes:{value:{key:"val",value:r.value},lastColor:{key:"lastClr",value:r.lastColor}}}):xx(e,n??pm[e])]})},Tx=(e,t={})=>new L({name:"a:clrScheme",attributes:{name:{key:"name",value:e}},children:Object.keys(nc).map(n=>kx(n,t))}),Ju=new Set(["dark1","light1","dark2","light2","accent1","accent2","accent3","accent4","accent5","accent6","hyperlink","followedHyperlink"]),Sx=new Map([["dk1","dark1"],["lt1","light1"],["dk2","dark2"],["lt2","light2"],["hlink","hyperlink"],["folHlink","followedHyperlink"],["text1","dark1"],["background1","light1"],["text2","dark2"],["background2","light2"]]),Qu=(e,t)=>{if(!(e>=0&&e<=100))throw new Error(`Invalid ${t} ${e}. Expected a number from 0 to 100`);return Math.round(255*(1-e/100))},Cx=({theme:e,lighter:t,darker:n})=>{if(!Ju.has(e)){let s=Sx.get(e);throw new Error(`Invalid theme color "${e}". ${s?`Did you mean "${s}"?`:`Expected one of ${[...Ju].join(", ")}`}`)}if(t!==void 0&&n!==void 0)throw new Error("Invalid theme color. Expected lighter or darker, not both");let r=t===void 0?void 0:Qu(t,"lighter"),i=n===void 0?void 0:Qu(n,"darker");return{tint:r===255?void 0:r,shade:i===255?void 0:i}},Ex=e=>{let[t,n,r]=[0,2,4].map(c=>parseInt(e.slice(c,c+2),16)/255),i=Math.max(t,n,r),s=Math.min(t,n,r),a=(i+s)/2,o=i-s;return o===0?{hue:0,saturation:0,lightness:a}:{hue:(i===t?((n-r)/o+6)%6:i===n?(r-t)/o+2:(t-n)/o+4)*60,saturation:o/(1-Math.abs(2*a-1)),lightness:a}},Ax=({hue:e,saturation:t,lightness:n})=>{let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),[s,a,o]=e<60?[r,i,0]:e<120?[i,r,0]:e<180?[0,r,i]:e<240?[0,i,r]:e<300?[i,0,r]:[r,0,i],c=n-r/2;return[s,a,o].map(l=>Math.floor((l+c)*255+1e-9).toString(16).padStart(2,"0")).join("").toUpperCase()},_x=(e,{tint:t,shade:n})=>{if(t===void 0&&n===void 0)return e;let r=Ex(e),i=t===void 0?r.lightness*n/255:r.lightness*t/255+(1-t/255);return Ax(k(k({},r),{},{lightness:i}))},Zu=e=>e===void 0?void 0:e.toString(16).padStart(2,"0").toUpperCase(),Nx=e=>typeof e=="string"?{type:"hex",value:om(e)}:{type:"theme",color:e,change:Cx(e)},Px=(e,t)=>e.type==="hex"?{color:e.value}:{color:_x(t[e.color.theme],e.change),theme:e.color.theme,tint:Zu(e.change.tint),shade:Zu(e.change.shade)},Ix=rc(),ic=class extends jr{constructor(e){super("_attr"),E(this,"attributes",void 0),this.attributes=e.map(t=>"keys"in t?{keys:t.keys,color:t.color===void 0?void 0:Nx(t.color)}:t)}prepForXml(e){var t,n;let r=(t=(n=e.file)===null||n===void 0||(n=n.Theme)===null||n===void 0?void 0:n.Colors)!==null&&t!==void 0?t:Ix,i=this.attributes.flatMap(s=>{if(!("keys"in s))return[[s.key,s.value]];if(s.color===void 0)return[];let{keys:a}=s,o=Px(s.color,r);return[[a.color,o.color],[a.theme,o.theme],[a.tint,o.tint],[a.shade,o.shade]]});return{_attr:Object.fromEntries(i.filter(([,s])=>s!==void 0))}}},Ox=class extends P{constructor(e,t){super(e),this.root.push(new ic(t))}},sc=(e,t)=>new Ox(e,t),Kr={color:"w:color",theme:"w:themeColor",tint:"w:themeTint",shade:"w:themeShade"},he=(e,{color:t,size:n,space:r,style:i})=>sc(e,[{key:"w:val",value:i},{keys:Kr,color:t},{key:"w:sz",value:n===void 0?void 0:vx(n)},{key:"w:space",value:r===void 0?void 0:wx(r)}]),Gr={SINGLE:"single",DASH_DOT_STROKED:"dashDotStroked",DASHED:"dashed",DASH_SMALL_GAP:"dashSmallGap",DOT_DASH:"dotDash",DOT_DOT_DASH:"dotDotDash",DOTTED:"dotted",DOUBLE:"double",DOUBLE_WAVE:"doubleWave",INSET:"inset",NIL:"nil",NONE:"none",OUTSET:"outset",THICK:"thick",THICK_THIN_LARGE_GAP:"thickThinLargeGap",THICK_THIN_MEDIUM_GAP:"thickThinMediumGap",THICK_THIN_SMALL_GAP:"thickThinSmallGap",THIN_THICK_LARGE_GAP:"thinThickLargeGap",THIN_THICK_MEDIUM_GAP:"thinThickMediumGap",THIN_THICK_SMALL_GAP:"thinThickSmallGap",THIN_THICK_THIN_LARGE_GAP:"thinThickThinLargeGap",THIN_THICK_THIN_MEDIUM_GAP:"thinThickThinMediumGap",THIN_THICK_THIN_SMALL_GAP:"thinThickThinSmallGap",THREE_D_EMBOSS:"threeDEmboss",THREE_D_ENGRAVE:"threeDEngrave",TRIPLE:"triple",WAVE:"wave"},Rx=class extends St{constructor(e){super("w:pBdr"),e.top&&this.root.push(he("w:top",e.top)),e.left&&this.root.push(he("w:left",e.left)),e.bottom&&this.root.push(he("w:bottom",e.bottom)),e.right&&this.root.push(he("w:right",e.right)),e.between&&this.root.push(he("w:between",e.between))}},Lx=class extends P{constructor(){super("w:pBdr");let e=he("w:bottom",{color:"auto",space:1,style:Gr.SINGLE,size:6});this.root.push(e)}},Dx=({start:e,end:t,left:n,right:r,hanging:i,firstLine:s,firstLineChars:a})=>new L({name:"w:ind",attributes:{start:{key:"w:start",value:e===void 0?void 0:at(e)},end:{key:"w:end",value:t===void 0?void 0:at(t)},left:{key:"w:left",value:n===void 0?void 0:at(n)},right:{key:"w:right",value:r===void 0?void 0:at(r)},hanging:{key:"w:hanging",value:i===void 0?void 0:ve(i)},firstLine:{key:"w:firstLine",value:s===void 0?void 0:ve(s)},firstLineChars:{key:"w:firstLineChars",value:a===void 0?void 0:le(a)}}}),Mx=()=>new L({name:"w:br"}),Gs={BEGIN:"begin",END:"end",SEPARATE:"separate"},ac=(e,t,n)=>new L({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:e},dirty:{key:"w:dirty",value:t},locked:{key:"w:fldLock",value:n}}}),_r=(e,t)=>ac(Gs.BEGIN,e,t),mm=new WeakSet,Bx=class extends L{constructor(){super({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:Gs.BEGIN},dirty:{key:"w:dirty",value:!0}}})}prepForXml(e){let t=super.prepForXml(e);return mm.add(t),t}},fm=()=>new Bx,$x=e=>typeof e=="object"&&e!==null&&mm.has(e),sn=e=>ac(Gs.SEPARATE,e),an=e=>ac(Gs.END,e),Ht={DEFAULT:"default",PRESERVE:"preserve"},Ut=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{space:"xml:space"})}},Fx=class extends P{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("PAGE")}},qx=class extends P{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("NUMPAGES")}},Hx=class extends P{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("SECTIONPAGES")}},Ux=class extends P{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("SECTION")}},zs=({fill:e,color:t,type:n})=>sc("w:shd",[{keys:{color:"w:fill",theme:"w:themeFill",tint:"w:themeFillTint",shade:"w:themeFillShade"},color:e},{keys:Kr,color:t},{key:"w:val",value:n??jx.CLEAR}]),jx={CLEAR:"clear",DIAGONAL_CROSS:"diagCross",DIAGONAL_STRIPE:"diagStripe",HORIZONTAL_CROSS:"horzCross",HORIZONTAL_STRIPE:"horzStripe",NIL:"nil",PERCENT_5:"pct5",PERCENT_10:"pct10",PERCENT_12:"pct12",PERCENT_15:"pct15",PERCENT_20:"pct20",PERCENT_25:"pct25",PERCENT_30:"pct30",PERCENT_35:"pct35",PERCENT_37:"pct37",PERCENT_40:"pct40",PERCENT_45:"pct45",PERCENT_50:"pct50",PERCENT_55:"pct55",PERCENT_60:"pct60",PERCENT_62:"pct62",PERCENT_65:"pct65",PERCENT_70:"pct70",PERCENT_75:"pct75",PERCENT_80:"pct80",PERCENT_85:"pct85",PERCENT_87:"pct87",PERCENT_90:"pct90",PERCENT_95:"pct95",REVERSE_DIAGONAL_STRIPE:"reverseDiagStripe",SOLID:"solid",THIN_DIAGONAL_CROSS:"thinDiagCross",THIN_DIAGONAL_STRIPE:"thinDiagStripe",THIN_HORIZONTAL_CROSS:"thinHorzCross",THIN_REVERSE_DIAGONAL_STRIPE:"thinReverseDiagStripe",THIN_VERTICAL_STRIPE:"thinVertStripe",VERTICAL_STRIPE:"vertStripe"},He=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date"})}},Wx=class extends P{constructor(e){super("w:del"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},Kx=class extends P{constructor(e){super("w:ins"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},Gx=({twoLinesInOne:e,brackets:t,horizontalInVertical:n,fitToLine:r,group:i})=>new L({name:"w:eastAsianLayout",attributes:{id:{key:"w:id",value:i===void 0?void 0:le(i)},combine:{key:"w:combine",value:e},combineBrackets:{key:"w:combineBrackets",value:t},vert:{key:"w:vert",value:n},vertCompress:{key:"w:vertCompress",value:r}}}),zx={DOT:"dot"},Vx=(e=zx.DOT)=>new L({name:"w:em",attributes:{val:{key:"w:val",value:e}}}),Xx="57X6y3wQZNzYjJB2L_10pxbackgroundhimselfUTF-8DEMOGRAPHICSVqvt4KW9",Yx=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i-- >0;)r+=e[Math.random()*e.length|0];return r},Jx=(e=21)=>{let t="",n=e|0;for(;n-- >0;)t+=Xx[Math.random()*64|0];return t},Qx=e=>{let t=new Int32Array(Math.ceil((e.length+9)/64)*16);for(let n=0;n<e.length;n++)t[n>>2]|=e[n]<<24-(n&3)*8;return t[e.length>>2]|=128<<24-(e.length&3)*8,t[t.length-2]=Math.floor(e.length/536870912),t[t.length-1]=e.length*8,t},Zx=e=>{let t=new Uint8Array(e.length*4);for(let n=0;n<t.length;n++)t[n]=e[n>>2]>>>24-(n&3)*8;return t},rt=(e,t)=>e>>>t|e<<32-t,JP=Int32Array.of(1518500249,1859775393,2400959708,3395469782),ek=Int32Array.of(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),tk=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],nk=new Int32Array(64),eh=e=>{let t=Qx(e),n=nk,[r,i,s,a,o,c,l,u]=tk;for(let d=0;d<t.length;d+=16){n.set(t.subarray(d,d+16));for(let C=16;C<64;C++){let _=n[C-15],w=n[C-2];n[C]=n[C-16]+(rt(_,7)^rt(_,18)^_>>>3)+n[C-7]+(rt(w,17)^rt(w,19)^w>>>10)}let[p,h,f,m,g,y,T,b]=[r,i,s,a,o,c,l,u];for(let C=0;C<64;C++){let _=b+(rt(g,6)^rt(g,11)^rt(g,25))+(g&y^~g&T)+ek[C]+n[C]|0,w=(rt(p,2)^rt(p,13)^rt(p,22))+(p&h^p&f^h&f)|0;b=T,T=y,y=g,g=m+_|0,m=f,f=h,h=p,p=_+w|0}[r,i,s,a,o,c,l,u]=[r+p|0,i+h|0,s+f|0,a+m|0,o+g|0,c+y|0,l+T|0,u+b|0]}return Zx([r,i,s,a,o,c,l,u])},Xe=e=>Math.floor(e*72*20),Bn=(e=0)=>{let t=e;return()=>++t},rk=()=>Bn(),ik=()=>Bn(1),sk=()=>Bn(),QP=sk(),ak=()=>Bn(),gm=ak(),ok=Bn(),lk=()=>-ok(),$n=()=>Jx().toLowerCase(),Tr=e=>Yx("1234567890abcdef",e)(),bm=()=>`${Tr(8)}-${Tr(4)}-${Tr(4)}-${Tr(4)}-${Tr(12)}`,ck=e=>new Uint8Array(new TextEncoder().encode(e)),dk=({width:e,group:t})=>new L({name:"w:fitText",attributes:{val:{key:"w:val",value:Math.round(qt(ve(e)))},id:{key:"w:id",value:t===void 0?lk():le(t)}}}),pk=class extends P{constructor(e){super("w:spacing"),this.root.push(new _e({val:at(e)}))}},uk=class extends P{constructor(e){super("w:color"),this.root.push(new ic([{keys:k(k({},Kr),{},{color:"w:val"}),color:e}]))}},hk=class extends P{constructor(e){super("w:highlight"),this.root.push(new _e({val:e}))}},mk=e=>new L({name:"w:lang",attributes:{value:{key:"w:val",value:e.value},eastAsia:{key:"w:eastAsia",value:e.eastAsia},bidirectional:{key:"w:bidi",value:e.bidirectional}}}),il=(e,t)=>{if(typeof e=="string"){let r=e;return new L({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:r},cs:{key:"w:cs",value:r},eastAsia:{key:"w:eastAsia",value:r},hAnsi:{key:"w:hAnsi",value:r},hint:{key:"w:hint",value:t}}})}if("theme"in e){let r=e.theme==="headings"?"major":"minor";return new L({name:"w:rFonts",attributes:{ascii:{key:"w:asciiTheme",value:`${r}HAnsi`},eastAsia:{key:"w:eastAsiaTheme",value:`${r}EastAsia`},hAnsi:{key:"w:hAnsiTheme",value:`${r}HAnsi`},cs:{key:"w:cstheme",value:`${r}Bidi`}}})}let n=e;return new L({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:n.ascii},cs:{key:"w:cs",value:n.cs},eastAsia:{key:"w:eastAsia",value:n.eastAsia},hAnsi:{key:"w:hAnsi",value:n.hAnsi},hint:{key:"w:hint",value:n.hint}}})},vm=e=>new L({name:"w:vertAlign",attributes:{val:{key:"w:val",value:e}}}),fk=()=>vm("superscript"),gk=()=>vm("subscript"),wm={SINGLE:"single",WORDS:"words",DOUBLE:"double",THICK:"thick",DOTTED:"dotted",DOTTEDHEAVY:"dottedHeavy",DASH:"dash",DASHEDHEAVY:"dashedHeavy",DASHLONG:"dashLong",DASHLONGHEAVY:"dashLongHeavy",DOTDASH:"dotDash",DASHDOTHEAVY:"dashDotHeavy",DOTDOTDASH:"dotDotDash",DASHDOTDOTHEAVY:"dashDotDotHeavy",WAVE:"wave",WAVYHEAVY:"wavyHeavy",WAVYDOUBLE:"wavyDouble",NONE:"none"},bk=(e=wm.SINGLE,t)=>sc("w:u",[{key:"w:val",value:e},{keys:Kr,color:t}]),on=class extends St{constructor(e){if(super("w:rPr"),!e)return;if(e.style&&this.push(new ot("w:rStyle",e.style)),e.font&&(typeof e.font=="string"?this.push(il(e.font)):"name"in e.font?this.push(il(e.font.name,e.font.hint)):this.push(il(e.font))),e.bold!==void 0&&this.push(new I("w:b",e.bold)),e.boldComplexScript===void 0&&e.bold!==void 0||e.boldComplexScript){var t;this.push(new I("w:bCs",(t=e.boldComplexScript)!==null&&t!==void 0?t:e.bold))}if(e.italics!==void 0&&this.push(new I("w:i",e.italics)),e.italicsComplexScript===void 0&&e.italics!==void 0||e.italicsComplexScript){var n;this.push(new I("w:iCs",(n=e.italicsComplexScript)!==null&&n!==void 0?n:e.italics))}e.smallCaps!==void 0?this.push(new I("w:smallCaps",e.smallCaps)):e.allCaps!==void 0&&this.push(new I("w:caps",e.allCaps)),e.strike!==void 0&&this.push(new I("w:strike",e.strike)),e.doubleStrike!==void 0&&this.push(new I("w:dstrike",e.doubleStrike)),e.emboss!==void 0&&this.push(new I("w:emboss",e.emboss)),e.imprint!==void 0&&this.push(new I("w:imprint",e.imprint)),e.noProof!==void 0&&this.push(new I("w:noProof",e.noProof)),e.snapToGrid!==void 0&&this.push(new I("w:snapToGrid",e.snapToGrid)),e.vanish!==void 0&&this.push(new I("w:vanish",e.vanish)),e.color&&this.push(new uk(e.color)),e.characterSpacing&&this.push(new pk(e.characterSpacing)),e.scale!==void 0&&this.push(new Pr("w:w",e.scale)),e.kern&&this.push(new rl("w:kern",e.kern)),e.position&&this.push(new ot("w:position",e.position)),e.size!==void 0&&this.push(new rl("w:sz",e.size));let r=e.sizeComplexScript===void 0||e.sizeComplexScript===!0?e.size:e.sizeComplexScript;r&&this.push(new rl("w:szCs",r)),e.highlight&&this.push(new hk(e.highlight)),e.underline&&this.push(bk(e.underline.type,e.underline.color)),e.effect&&this.push(new ot("w:effect",e.effect)),e.border&&this.push(he("w:bdr",e.border)),e.shading&&this.push(zs(e.shading)),e.fitText&&this.push(dk(e.fitText)),e.subScript&&this.push(gk()),e.superScript&&this.push(fk()),e.rightToLeft!==void 0&&this.push(new I("w:rtl",e.rightToLeft)),e.emphasisMark&&this.push(Vx(e.emphasisMark.type)),e.language&&this.push(mk(e.language)),e.eastAsianLayout&&this.push(Gx(e.eastAsianLayout)),e.specVanish!==void 0&&this.push(new I("w:specVanish",e.specVanish)),e.math!==void 0&&this.push(new I("w:oMath",e.math)),e.revision&&this.push(new wk(e.revision))}push(e){this.root.push(e)}},vk=class extends on{constructor(e){super(e),e?.insertion&&this.push(new Kx(e.insertion)),e?.deletion&&this.push(new Wx(e.deletion))}},wk=class extends P{constructor(e){super("w:rPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.addChildElement(new on(e))}},Mr=class extends P{constructor(e){if(super("w:t"),typeof e=="string")this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push(e);else{var t;this.root.push(new Ut({space:(t=e.space)!==null&&t!==void 0?t:Ht.DEFAULT})),this.root.push(e.text)}}},ks={CURRENT:"CURRENT",TOTAL_PAGES:"TOTAL_PAGES",TOTAL_PAGES_IN_SECTION:"TOTAL_PAGES_IN_SECTION",CURRENT_SECTION:"SECTION"},yk=e=>{switch(e){case ks.CURRENT:return[_r(),new Fx,sn(),an()];case ks.TOTAL_PAGES:return[_r(),new qx,sn(),an()];case ks.TOTAL_PAGES_IN_SECTION:return[_r(),new Hx,sn(),an()];case ks.CURRENT_SECTION:return[_r(),new Ux,sn(),an()];default:return}},qe=class Pl extends P{constructor(t){if(super("w:r"),E(this,"properties",void 0),E(this,"following",[]),this.properties=new on(t),this.root.push(this.properties),t.break)for(let n=0;n<t.break;n++)this.root.push(Mx());if(t.children)for(let[n,r]of t.children.entries()){if(Ws(r)==="w:r"){let i=t.children.slice(n+1);this.following=[r,...i.length>0?[new Pl(k(k({},t),{},{break:void 0,children:i}))]:[]];break}if(typeof r=="string"){let i=yk(r);if(i){let s=t.children.slice(n+1),a=l=>new Pl(k(k({},t),{},{break:void 0,children:l})),o=this.root.length===1;o&&this.root.push(i[0]);let c=o?i.slice(1):i;this.following=[...c.map(l=>a([l])),...s.length>0?[a(s)]:[]];break}this.root.push(new Mr(r));continue}this.root.push(r)}else t.text!==void 0&&this.root.push(new Mr(t.text))}get writtenAs(){return this.following.length>0?[this,...this.following.flatMap(t=>{var n;return(n=t.writtenAs)!==null&&n!==void 0?n:t})]:void 0}},Oe=class extends qe{constructor(e){super(typeof e=="string"?{text:e}:e)}},oc={EXTERNAL:"External"},xk=(e,t,n,r)=>new L({name:"Relationship",attributes:{id:{key:"Id",value:e},type:{key:"Type",value:t},target:{key:"Target",value:n},targetMode:{key:"TargetMode",value:r}}}),ym=(e,t)=>new L({name:"a:hlinkClick",attributes:k(k({},t?{xmlns:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"}}:{}),{},{id:{key:"r:id",value:`rId${e}`}})}),kk=class{constructor(e){E(this,"link",void 0),E(this,"linkId",$n()),E(this,"addedTo",new WeakSet),this.link=e}createClick(e){return ym(this.linkId,e)}addRelationship(e){let t=e.viewWrapper.Relationships;this.addedTo.has(t)||(this.addedTo.add(t),t.addRelationship(this.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",this.link,oc.EXTERNAL))}},Tk=32767,Sk=780,Ck=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],Ek=e=>e<=Tk?Ck.reduce(({rest:t,text:n},[r,i])=>({rest:t%r,text:n+i.repeat(Math.floor(t/r))}),{rest:e,text:""}).text:void 0,Ak=e=>e===0?"":e<=Sk?String.fromCharCode(65+(e-1)%26).repeat(Math.ceil(e/26)):void 0,_k=e=>{var t;return`${e}${e%100>=11&&e%100<=13?"th":(t=["th","st","nd","rd"][e%10])!==null&&t!==void 0?t:"th"}`},lc=e=>{let t=e.charAt(0)!==e.charAt(0).toUpperCase(),n=r=>i=>{var s;return t?(s=r(i))===null||s===void 0?void 0:s.toLowerCase():r(i)};switch(e.toLowerCase()){case"arabic":return String;case"roman":return n(Ek);case"alphabetic":return n(Ak);case"ordinal":return r=>r>0?_k(r):void 0;case"arabicdash":return r=>`- ${r} -`;default:return}},xm=new Set(["mergeformat","charformat","mergeformatinet"]),km=new Set(["upper","lower","firstcap","caps"]),Nk=e=>/^[#0,]*[#0][#0,]*$/.test(e),Pk=(e,t)=>{let n=[...t].filter(s=>s==="0").length,r=n+[...t].filter(s=>s==="#").length,i=String(e).padStart(n,"0");if(!(i.length<r||n===0&&e===0))return t.includes(",")?i.replace(/\B(?=(\d{3})+$)/g,","):i},Ik=(e,t)=>{switch(t){case"upper":return e.toUpperCase();case"lower":return e.toLowerCase();case"firstcap":return e.charAt(0).toUpperCase()+e.slice(1);default:return e}},Ok=e=>{var t;let n=new RegExp("^\\s*(PAGEREF|NUMPAGES|SECTIONPAGES)\\b(.*)$","is").exec(e),r=n?.[1].toUpperCase()==="PAGEREF"?new RegExp('^\\s*("?)([^\\s"\\\\]+)\\1(.*)$',"s").exec(n[2]):void 0;if(!n||n[1].toUpperCase()==="PAGEREF"&&!r)return;let i=(t=(r?r[3]:n[2]).match(/"[^"]*"|\S+/g))!==null&&t!==void 0?t:[],s,a,o=[],c=!1,l=!0;for(let h=0;h<i.length;h++){let f=i[h],m=()=>{var g;return(f.length>2?f.slice(2):(g=i[++h])!==null&&g!==void 0?g:"").replace(/^"(.*)"$/,"$1")};if(/^\\p$/i.test(f))c=!0;else if(f.startsWith("\\#")){var u;let g=m();l&&(l=a===void 0&&Nk(g)),(u=a)!==null&&u!==void 0||(a=g)}else if(f.startsWith("\\*")){let g=m(),y=g.toLowerCase();if(km.has(y))o.push(y);else if(g!==""&&!xm.has(y)){var d;l&&(l=s===void 0&&lc(g)!==void 0),(d=s)!==null&&d!==void 0||(s=g)}}}let p=k(k(k(k({},s===void 0?{}:{numberFormat:s}),a===void 0?{}:{picture:a}),o.length===0?{}:{capitals:o[0]}),{},{written:l&&o.length<=1&&o[0]!=="caps"&&(s===void 0||a===void 0)});return k(r?{type:"pageReference",bookmark:r[2],relative:c}:{type:"pageCount",scope:n[1].toUpperCase()==="NUMPAGES"?"document":"section"},p)},Rk=e=>new RegExp("^\\s*TOC\\b.*\\\\s\\b","is").test(e),Tm=(e,{enclosing:t,within:n,inTextBox:r},{estimate:i,sectionPageCount:s,blank:a,relativeTo:o})=>{let c=Ok(e);if(c===void 0)return;let{bookmarks:l,pageCount:u,bookmarkPageNumbers:d}=i,{numberFormat:p,picture:h,capitals:f,written:m}=c,g=p!==void 0||h!==void 0,y=C=>C===void 0?void 0:h===void 0?lc(p??"arabic")(C):Pk(C,h),T=c.type==="pageReference"&&c.relative&&n==="counted"&&!r?o?.(c.bookmark):void 0,b;return m?c.type==="pageCount"?b=y(c.scope==="document"?u:s):t.some(Rk)?b=void 0:g?b=y(d?.get(c.bookmark)):b=c.relative?T:l.get(c.bookmark):b=void 0,b===void 0?a?"":void 0:Ik(b,f)},Lk=(e,t)=>e==="mc:Fallback"||t==="fallback"?"fallback":e==="w:del"||e==="w:moveFrom"?"deleted":t,Br=(e,t,n,r,i="counted",s=!1)=>{for(let l=0;l<t.length;l++){let u=t[l],d=e.nameOf(u);if(d===void 0)continue;let p=n[n.length-1];if(d==="w:fldChar"){let h=e.attributeOf(u,"w:fldCharType");h==="begin"?n.push({begin:u,instruction:"",inResult:!1}):h==="separate"&&p?(e.writeClean(p.begin,p.instruction),p.inResult=!0,p.result=r.resultOf(p.instruction,{within:i,enclosing:n.slice(0,-1).map(f=>f.instruction),inTextBox:s}),p.result!==void 0&&(t.splice(l+1,0,e.textElement(p.result)),l++)):h==="end"&&n.pop()}else if(d==="w:instrText"&&p&&!p.inResult)p.instruction+=e.textOf(u);else if((d==="w:t"||d==="w:tab"||d==="w:br"||d==="w:cr")&&p?.result!==void 0)t.splice(l,1),l--;else if(d==="w:fldSimple"){let h=r.resultOf(String(e.attributeOf(u,"w:instr")),{within:i,enclosing:n.map(f=>f.instruction),inTextBox:s});if(h===void 0){var a;Br(e,(a=e.contentOf(u))!==null&&a!==void 0?a:[],[],r,i,s)}else e.setSimpleFieldResult(u,h)}else{var o;if(d==="w:p"){var c;(c=r.beforeParagraph)===null||c===void 0||c.call(r,u)}Br(e,(o=e.contentOf(u))!==null&&o!==void 0?o:[],n,r,Lk(d,i),s||d==="w:txbxContent"),d==="w:p"&&r.afterParagraph(u)}}},Sm=(e,t)=>t.flatMap(n=>{var r;let i=e.nameOf(n);return i===void 0?[]:i==="w:sectPr"?[n]:Sm(e,(r=e.contentOf(n))!==null&&r!==void 0?r:[])}),Dk=(e,t)=>{var n;return((n=e.contentOf(t))!==null&&n!==void 0?n:[]).some(r=>{var i;return e.nameOf(r)==="w:pPr"&&((i=e.contentOf(r))!==null&&i!==void 0?i:[]).some(s=>e.nameOf(s)==="w:sectPr")})},Mk=(e,t,n)=>{let r=Sm(e,[t]).reduce((i,s)=>{var a,o;let c=((a=e.contentOf(s))!==null&&a!==void 0?a:[]).flatMap(l=>{let u=e.nameOf(l);return u==="w:headerReference"||u==="w:footerReference"?[[`${u} ${String(e.attributeOf(l,"w:type"))}`,String(e.attributeOf(l,"r:id"))]]:[]});return[...i,new Map([...(o=i[i.length-1])!==null&&o!==void 0?o:[],...c])]},[]).reduce((i,s,a)=>{for(let c of s.values()){var o;i.set(c,[...(o=i.get(c))!==null&&o!==void 0?o:[],n[a]])}return i},new Map);return new Map([...r].flatMap(([i,[s,...a]])=>s!==void 0&&a.every(o=>o===s)?[[i,s]]:[]))},Cm=(e,t,n,{blank:r})=>{let{sectionPageCounts:i=[],relativePositions:s}=n,a=0,o=new Map,c=l=>{var u,d;let p=(u=o.get(l))!==null&&u!==void 0?u:0;return o.set(l,p+1),s==null||(d=s.get(l))===null||d===void 0?void 0:d[p]};return Br(e,[t],[],{resultOf:(l,u)=>Tm(l,u,{estimate:n,sectionPageCount:i[a],blank:r,relativeTo:c}),afterParagraph:l=>{a+=Dk(e,l)?1:0}}),Mk(e,t,i)},Em=(e,t,n,{blank:r,sectionPageCount:i,notes:s=!1})=>{let a=o=>{let c=n.bookmarks.get(o);return c===void 0?void 0:`on page ${c}`};Br(e,[t],[],{resultOf:(o,c)=>Tm(o,c,k({estimate:n,sectionPageCount:i,blank:r},s?{relativeTo:a}:{})),afterParagraph:()=>{}})},Bk=(e,t,{beforeParagraph:n,resultOf:r})=>Br(e,[t],[],{resultOf:(i,{within:s})=>r(i,s),beforeParagraph:n,afterParagraph:()=>{}}),Am=class extends P{constructor(e={}){super("w:instrText"),E(this,"properties",void 0),this.properties=e,this.root.push(new Ut({space:Ht.PRESERVE}));let t="TOC";if(this.properties.captionLabel&&(t=`${t} \\a "${this.properties.captionLabel}"`),this.properties.entriesFromBookmark&&(t=`${t} \\b "${this.properties.entriesFromBookmark}"`),this.properties.captionLabelIncludingNumbers&&(t=`${t} \\c "${this.properties.captionLabelIncludingNumbers}"`),this.properties.sequenceAndPageNumbersSeparator&&(t=`${t} \\d "${this.properties.sequenceAndPageNumbersSeparator}"`),this.properties.tcFieldIdentifier&&(t=`${t} \\f "${this.properties.tcFieldIdentifier}"`),this.properties.hyperlink&&(t=`${t} \\h`),this.properties.tcFieldLevelRange&&(t=`${t} \\l "${this.properties.tcFieldLevelRange}"`),this.properties.pageNumbersEntryLevelsRange&&(t=`${t} \\n "${this.properties.pageNumbersEntryLevelsRange}"`),this.properties.headingStyleRange&&(t=`${t} \\o "${this.properties.headingStyleRange}"`),this.properties.entryAndPageNumberSeparator&&(t=`${t} \\p "${this.properties.entryAndPageNumberSeparator}"`),this.properties.seqFieldIdentifierForPrefix&&(t=`${t} \\s "${this.properties.seqFieldIdentifierForPrefix}"`),this.properties.stylesWithLevels&&this.properties.stylesWithLevels.length){let n=this.properties.stylesWithLevels.map(r=>`${r.styleName},${r.level}`).join(",");t=`${t} \\t "${n}"`}this.properties.useAppliedParagraphOutlineLevel&&(t=`${t} \\u`),this.properties.preserveTabInEntries&&(t=`${t} \\w`),this.properties.preserveNewLineInEntries&&(t=`${t} \\x`),this.properties.hideTabAndPageNumbersInWebView&&(t=`${t} \\z`),this.root.push(t)}},_m=class extends P{constructor(){super("w:sdtContent")}},Nm=e=>e===void 0?fm():_r(e),cc=new WeakMap,$k=(e,t)=>{cc.set(e,t)},Fk=class{constructor(){E(this,"ids",[])}get(e){var t,n;return(n=(t=this.ids)[e])!==null&&n!==void 0||(t[e]=gm()),this.ids[e]}},ct=e=>typeof e=="object"&&e!==null?Object.keys(e)[0]:void 0,dt=e=>{let t=ct(e),n=t===void 0?void 0:e[t];return Array.isArray(n)?n:n===void 0?[]:[n]},Je=(e,t)=>dt(e).find(n=>ct(n)===t),$e=(e,t)=>{var n;return(n=Je(e,"_attr"))===null||n===void 0||(n=n._attr)===null||n===void 0?void 0:n[t]},dc=(e,t)=>{let n=$e(e,t);return n===void 0?void 0:Number(n)},qk=new Set(["w:tbl","w:tr","w:tc","w:sdt","w:sdtContent","w:customXml"]),Pm=e=>e.flatMap(t=>{let n=ct(t);return n==="w:p"||cc.has(t)?[t]:n!==void 0&&qk.has(n)?Pm(dt(t)):[]}),Hk=new Set(["w:r","w:hyperlink","w:ins","w:moveTo","w:smartTag","w:customXml","w:sdt","w:sdtContent","w:fldSimple","w:dir","w:bdo"]),Uk=e=>{switch(ct(e)){case"w:t":return dt(e).filter(t=>typeof t=="string").join("");case"w:tab":return" ";case"w:br":return[void 0,"textWrapping"].includes($e(e,"w:type"))?`
5671
+ `:"")},j=(e,{indent:t="",declaration:n}={})=>{let r=Array.isArray(e)?e:[e],i=t?1:0,s=n?.standalone?` standalone="${Ds(n.standalone)}"`:"";return(n===void 0?"":`<?xml version="1.0" encoding="${Ds(n.encoding||"UTF-8")}"${s}?>${t?`
5672
+ `:""}`)+r.map((a,o)=>tm(em(a,t,i),t,o===r.length-1)).join("")},nm=e=>Object.entries(e??{}).flatMap(([t,n])=>n==null?[]:[` ${t}="${Ds(String(n))}"`]).join(""),rm=e=>{switch(e.type){case"element":{var t,n;let r=(t=e.elements)!==null&&t!==void 0?t:[],i=`<${e.name}${nm(e.attributes)}`;return r.length>0||((n=e.attributes)===null||n===void 0?void 0:n["xml:space"])==="preserve"?`${i}>${r.map(rm).join("")}</${e.name}>`:`${i}/>`}case"text":return dy(String(e.text));case"cdata":return`<![CDATA[${String(e.cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`;case"comment":return`<!--${e.comment}-->`;case"doctype":return`<!DOCTYPE ${e.doctype}>`;case"instruction":return`<?${e.name}${e.instruction?` ${e.instruction}`:""}?>`;default:return""}},py=e=>{var t;return(e.declaration?`<?xml${nm(e.declaration.attributes)}?>`:"")+((t=e.elements)!==null&&t!==void 0?t:[]).map(rm).join("")},ec=e=>{switch(e.type){case void 0:case"element":let t=new hy(e.name,e.attributes),n=e.elements||[];for(let r of n){let i=ec(r);i!==void 0&&t.push(i)}return t;case"text":return e.text;default:return}},uy=class extends H{},hy=class extends I{static fromXmlString(e){return ec(Wr(e))}constructor(e,t){super(e),t&&this.root.push(new uy(t))}push(e){this.root.push(e)}get writtenAs(){return this.rootKey===void 0?this.root.filter(e=>typeof e!="string"):void 0}prepForXml(e){let t=this.writtenAs;return t?.length===1?t[0].prepForXml(e):super.prepForXml(e)}},my=class extends I{constructor(e){super(""),E(this,"_attr",void 0),this._attr=e}prepForXml(e){return{_attr:this._attr}}},im=class extends I{constructor(e,t){super(e),t&&(this.root=t.root)}},le=e=>{if(!Number.isFinite(e))throw new Error(`Invalid value '${e}' specified. Must be an integer.`);return Math.floor(e)},Ks=e=>{let t=le(e);if(t<0)throw new Error(`Invalid value '${e}' specified. Must be a positive integer.`);return t},sm=(e,t)=>{let n=t*2;if(e.length!==n||isNaN(+`0x${e}`))throw new Error(`Invalid hex value '${e}'. Expected ${n} digit hex value`);return e},Yu=e=>sm(e,1),tc=e=>{let t=e.slice(-2),n=e.substring(0,e.length-2);return`${Number(n)}${t}`},fy={in:1440,cm:1440/2.54,mm:1440/25.4,pt:20,pc:240,pi:240},qt=e=>{if(typeof e=="number")return e;let t=e.slice(-2),n=Number(e.substring(0,e.length-2)),r=fy[t];if(r===void 0||Number.isNaN(n))throw new Error(`Invalid universal measure '${e}'. Expected a number followed by mm, cm, in, pt, pc or pi.`);return n*r},am=e=>{let t=tc(e);if(parseFloat(t)<0)throw new Error(`Invalid value '${t}' specified. Expected a positive number.`);return t},om=e=>e==="auto"?e:sm(e.charAt(0)==="#"?e.substring(1):e,3),at=e=>typeof e=="string"?tc(e):le(e),gy=e=>typeof e=="string"?am(e):Ks(e),ve=e=>typeof e=="string"?am(e):Ks(e),by=e=>{let t=e.substring(0,e.length-1);return`${Number(t)}%`},lm=e=>typeof e=="number"?le(e):e.slice(-1)==="%"?by(e):tc(e),vy=Ks,wy=Ks,xy=e=>e.toISOString(),P=class extends I{constructor(e,t=!0){super(e),t!==!0&&this.root.push(new Ae({val:t}))}},rl=class extends I{constructor(e,t){super(e),this.root.push(new Ae({val:gy(t)}))}},cm=class extends I{},ot=class extends I{constructor(e,t){super(e),this.root.push(new Ae({val:t}))}},kr=(e,t)=>new L({name:e,attributes:{value:{key:"w:val",value:t}}}),Ir=class extends I{constructor(e,t){super(e),this.root.push(new Ae({val:t}))}},nn=class extends I{constructor(e,t){super(e),this.root.push(t)}},L=class extends I{constructor({name:e,attributes:t,children:n}){super(e),t&&this.root.push(new Jh(t)),n&&this.root.push(...n)}},ue={START:"start",CENTER:"center",END:"end",BOTH:"both",MEDIUM_KASHIDA:"mediumKashida",DISTRIBUTE:"distribute",NUM_TAB:"numTab",HIGH_KASHIDA:"highKashida",LOW_KASHIDA:"lowKashida",THAI_DISTRIBUTE:"thaiDistribute",LEFT:"left",RIGHT:"right",JUSTIFIED:"both"},dm=e=>new L({name:"w:jc",attributes:{val:{key:"w:val",value:e}}}),nc={dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hyperlink:"hlink",followedHyperlink:"folHlink"},pm={dark2:"44546A",light2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hyperlink:"0563C1",followedHyperlink:"954F72"},um={dark1:{value:"windowText",lastColor:"000000"},light1:{value:"window",lastColor:"FFFFFF"}},hm=(e,t)=>{if(t==="auto")throw new Error(`Invalid theme color ${e} 'auto'. Expected 6 digit hex value`);return om(t)},rc=(e={})=>Object.fromEntries(Object.keys(nc).map(t=>{let n=e[t],r=t==="dark1"||t==="light1"?um[t].lastColor:pm[t];return[t,n===void 0?r:hm(t,n)]})),yy=(e,t)=>new L({name:"a:srgbClr",attributes:{value:{key:"val",value:hm(e,t)}}}),ky=(e,t)=>{let n=t[e],r=e==="dark1"||e==="light1"?um[e]:void 0;return new L({name:`a:${nc[e]}`,children:[n===void 0&&r?new L({name:"a:sysClr",attributes:{value:{key:"val",value:r.value},lastColor:{key:"lastClr",value:r.lastColor}}}):yy(e,n??pm[e])]})},Ty=(e,t={})=>new L({name:"a:clrScheme",attributes:{name:{key:"name",value:e}},children:Object.keys(nc).map(n=>ky(n,t))}),Ju=new Set(["dark1","light1","dark2","light2","accent1","accent2","accent3","accent4","accent5","accent6","hyperlink","followedHyperlink"]),Sy=new Map([["dk1","dark1"],["lt1","light1"],["dk2","dark2"],["lt2","light2"],["hlink","hyperlink"],["folHlink","followedHyperlink"],["text1","dark1"],["background1","light1"],["text2","dark2"],["background2","light2"]]),Qu=(e,t)=>{if(!(e>=0&&e<=100))throw new Error(`Invalid ${t} ${e}. Expected a number from 0 to 100`);return Math.round(255*(1-e/100))},Cy=({theme:e,lighter:t,darker:n})=>{if(!Ju.has(e)){let s=Sy.get(e);throw new Error(`Invalid theme color "${e}". ${s?`Did you mean "${s}"?`:`Expected one of ${[...Ju].join(", ")}`}`)}if(t!==void 0&&n!==void 0)throw new Error("Invalid theme color. Expected lighter or darker, not both");let r=t===void 0?void 0:Qu(t,"lighter"),i=n===void 0?void 0:Qu(n,"darker");return{tint:r===255?void 0:r,shade:i===255?void 0:i}},Ey=e=>{let[t,n,r]=[0,2,4].map(c=>parseInt(e.slice(c,c+2),16)/255),i=Math.max(t,n,r),s=Math.min(t,n,r),a=(i+s)/2,o=i-s;return o===0?{hue:0,saturation:0,lightness:a}:{hue:(i===t?((n-r)/o+6)%6:i===n?(r-t)/o+2:(t-n)/o+4)*60,saturation:o/(1-Math.abs(2*a-1)),lightness:a}},_y=({hue:e,saturation:t,lightness:n})=>{let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),[s,a,o]=e<60?[r,i,0]:e<120?[i,r,0]:e<180?[0,r,i]:e<240?[0,i,r]:e<300?[i,0,r]:[r,0,i],c=n-r/2;return[s,a,o].map(l=>Math.floor((l+c)*255+1e-9).toString(16).padStart(2,"0")).join("").toUpperCase()},Ay=(e,{tint:t,shade:n})=>{if(t===void 0&&n===void 0)return e;let r=Ey(e),i=t===void 0?r.lightness*n/255:r.lightness*t/255+(1-t/255);return _y(k(k({},r),{},{lightness:i}))},Zu=e=>e===void 0?void 0:e.toString(16).padStart(2,"0").toUpperCase(),Ny=e=>typeof e=="string"?{type:"hex",value:om(e)}:{type:"theme",color:e,change:Cy(e)},Iy=(e,t)=>e.type==="hex"?{color:e.value}:{color:Ay(t[e.color.theme],e.change),theme:e.color.theme,tint:Zu(e.change.tint),shade:Zu(e.change.shade)},Py=rc(),ic=class extends jr{constructor(e){super("_attr"),E(this,"attributes",void 0),this.attributes=e.map(t=>"keys"in t?{keys:t.keys,color:t.color===void 0?void 0:Ny(t.color)}:t)}prepForXml(e){var t,n;let r=(t=(n=e.file)===null||n===void 0||(n=n.Theme)===null||n===void 0?void 0:n.Colors)!==null&&t!==void 0?t:Py,i=this.attributes.flatMap(s=>{if(!("keys"in s))return[[s.key,s.value]];if(s.color===void 0)return[];let{keys:a}=s,o=Iy(s.color,r);return[[a.color,o.color],[a.theme,o.theme],[a.tint,o.tint],[a.shade,o.shade]]});return{_attr:Object.fromEntries(i.filter(([,s])=>s!==void 0))}}},Oy=class extends I{constructor(e,t){super(e),this.root.push(new ic(t))}},sc=(e,t)=>new Oy(e,t),Kr={color:"w:color",theme:"w:themeColor",tint:"w:themeTint",shade:"w:themeShade"},he=(e,{color:t,size:n,space:r,style:i})=>sc(e,[{key:"w:val",value:i},{keys:Kr,color:t},{key:"w:sz",value:n===void 0?void 0:vy(n)},{key:"w:space",value:r===void 0?void 0:wy(r)}]),Gr={SINGLE:"single",DASH_DOT_STROKED:"dashDotStroked",DASHED:"dashed",DASH_SMALL_GAP:"dashSmallGap",DOT_DASH:"dotDash",DOT_DOT_DASH:"dotDotDash",DOTTED:"dotted",DOUBLE:"double",DOUBLE_WAVE:"doubleWave",INSET:"inset",NIL:"nil",NONE:"none",OUTSET:"outset",THICK:"thick",THICK_THIN_LARGE_GAP:"thickThinLargeGap",THICK_THIN_MEDIUM_GAP:"thickThinMediumGap",THICK_THIN_SMALL_GAP:"thickThinSmallGap",THIN_THICK_LARGE_GAP:"thinThickLargeGap",THIN_THICK_MEDIUM_GAP:"thinThickMediumGap",THIN_THICK_SMALL_GAP:"thinThickSmallGap",THIN_THICK_THIN_LARGE_GAP:"thinThickThinLargeGap",THIN_THICK_THIN_MEDIUM_GAP:"thinThickThinMediumGap",THIN_THICK_THIN_SMALL_GAP:"thinThickThinSmallGap",THREE_D_EMBOSS:"threeDEmboss",THREE_D_ENGRAVE:"threeDEngrave",TRIPLE:"triple",WAVE:"wave"},Ry=class extends St{constructor(e){super("w:pBdr"),e.top&&this.root.push(he("w:top",e.top)),e.left&&this.root.push(he("w:left",e.left)),e.bottom&&this.root.push(he("w:bottom",e.bottom)),e.right&&this.root.push(he("w:right",e.right)),e.between&&this.root.push(he("w:between",e.between))}},Ly=class extends I{constructor(){super("w:pBdr");let e=he("w:bottom",{color:"auto",space:1,style:Gr.SINGLE,size:6});this.root.push(e)}},My=({start:e,end:t,left:n,right:r,hanging:i,firstLine:s,firstLineChars:a})=>new L({name:"w:ind",attributes:{start:{key:"w:start",value:e===void 0?void 0:at(e)},end:{key:"w:end",value:t===void 0?void 0:at(t)},left:{key:"w:left",value:n===void 0?void 0:at(n)},right:{key:"w:right",value:r===void 0?void 0:at(r)},hanging:{key:"w:hanging",value:i===void 0?void 0:ve(i)},firstLine:{key:"w:firstLine",value:s===void 0?void 0:ve(s)},firstLineChars:{key:"w:firstLineChars",value:a===void 0?void 0:le(a)}}}),Dy=()=>new L({name:"w:br"}),Gs={BEGIN:"begin",END:"end",SEPARATE:"separate"},ac=(e,t,n)=>new L({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:e},dirty:{key:"w:dirty",value:t},locked:{key:"w:fldLock",value:n}}}),Ar=(e,t)=>ac(Gs.BEGIN,e,t),mm=new WeakSet,By=class extends L{constructor(){super({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:Gs.BEGIN},dirty:{key:"w:dirty",value:!0}}})}prepForXml(e){let t=super.prepForXml(e);return mm.add(t),t}},fm=()=>new By,$y=e=>typeof e=="object"&&e!==null&&mm.has(e),sn=e=>ac(Gs.SEPARATE,e),an=e=>ac(Gs.END,e),Ht={DEFAULT:"default",PRESERVE:"preserve"},Ut=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{space:"xml:space"})}},Fy=class extends I{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("PAGE")}},qy=class extends I{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("NUMPAGES")}},Hy=class extends I{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("SECTIONPAGES")}},Uy=class extends I{constructor(){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push("SECTION")}},zs=({fill:e,color:t,type:n})=>sc("w:shd",[{keys:{color:"w:fill",theme:"w:themeFill",tint:"w:themeFillTint",shade:"w:themeFillShade"},color:e},{keys:Kr,color:t},{key:"w:val",value:n??jy.CLEAR}]),jy={CLEAR:"clear",DIAGONAL_CROSS:"diagCross",DIAGONAL_STRIPE:"diagStripe",HORIZONTAL_CROSS:"horzCross",HORIZONTAL_STRIPE:"horzStripe",NIL:"nil",PERCENT_5:"pct5",PERCENT_10:"pct10",PERCENT_12:"pct12",PERCENT_15:"pct15",PERCENT_20:"pct20",PERCENT_25:"pct25",PERCENT_30:"pct30",PERCENT_35:"pct35",PERCENT_37:"pct37",PERCENT_40:"pct40",PERCENT_45:"pct45",PERCENT_50:"pct50",PERCENT_55:"pct55",PERCENT_60:"pct60",PERCENT_62:"pct62",PERCENT_65:"pct65",PERCENT_70:"pct70",PERCENT_75:"pct75",PERCENT_80:"pct80",PERCENT_85:"pct85",PERCENT_87:"pct87",PERCENT_90:"pct90",PERCENT_95:"pct95",REVERSE_DIAGONAL_STRIPE:"reverseDiagStripe",SOLID:"solid",THIN_DIAGONAL_CROSS:"thinDiagCross",THIN_DIAGONAL_STRIPE:"thinDiagStripe",THIN_HORIZONTAL_CROSS:"thinHorzCross",THIN_REVERSE_DIAGONAL_STRIPE:"thinReverseDiagStripe",THIN_VERTICAL_STRIPE:"thinVertStripe",VERTICAL_STRIPE:"vertStripe"},He=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date"})}},Wy=class extends I{constructor(e){super("w:del"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},Ky=class extends I{constructor(e){super("w:ins"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},Gy=({twoLinesInOne:e,brackets:t,horizontalInVertical:n,fitToLine:r,group:i})=>new L({name:"w:eastAsianLayout",attributes:{id:{key:"w:id",value:i===void 0?void 0:le(i)},combine:{key:"w:combine",value:e},combineBrackets:{key:"w:combineBrackets",value:t},vert:{key:"w:vert",value:n},vertCompress:{key:"w:vertCompress",value:r}}}),zy={DOT:"dot"},Vy=(e=zy.DOT)=>new L({name:"w:em",attributes:{val:{key:"w:val",value:e}}}),Xy="57X6y3wQZNzYjJB2L_10pxbackgroundhimselfUTF-8DEMOGRAPHICSVqvt4KW9",Yy=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i-- >0;)r+=e[Math.random()*e.length|0];return r},Jy=(e=21)=>{let t="",n=e|0;for(;n-- >0;)t+=Xy[Math.random()*64|0];return t},Qy=e=>{let t=new Int32Array(Math.ceil((e.length+9)/64)*16);for(let n=0;n<e.length;n++)t[n>>2]|=e[n]<<24-(n&3)*8;return t[e.length>>2]|=128<<24-(e.length&3)*8,t[t.length-2]=Math.floor(e.length/536870912),t[t.length-1]=e.length*8,t},Zy=e=>{let t=new Uint8Array(e.length*4);for(let n=0;n<t.length;n++)t[n]=e[n>>2]>>>24-(n&3)*8;return t},rt=(e,t)=>e>>>t|e<<32-t,JI=Int32Array.of(1518500249,1859775393,2400959708,3395469782),ek=Int32Array.of(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),tk=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],nk=new Int32Array(64),eh=e=>{let t=Qy(e),n=nk,[r,i,s,a,o,c,l,u]=tk;for(let d=0;d<t.length;d+=16){n.set(t.subarray(d,d+16));for(let C=16;C<64;C++){let A=n[C-15],w=n[C-2];n[C]=n[C-16]+(rt(A,7)^rt(A,18)^A>>>3)+n[C-7]+(rt(w,17)^rt(w,19)^w>>>10)}let[p,h,f,m,g,x,T,b]=[r,i,s,a,o,c,l,u];for(let C=0;C<64;C++){let A=b+(rt(g,6)^rt(g,11)^rt(g,25))+(g&x^~g&T)+ek[C]+n[C]|0,w=(rt(p,2)^rt(p,13)^rt(p,22))+(p&h^p&f^h&f)|0;b=T,T=x,x=g,g=m+A|0,m=f,f=h,h=p,p=A+w|0}[r,i,s,a,o,c,l,u]=[r+p|0,i+h|0,s+f|0,a+m|0,o+g|0,c+x|0,l+T|0,u+b|0]}return Zy([r,i,s,a,o,c,l,u])},Xe=e=>Math.floor(e*72*20),Bn=(e=0)=>{let t=e;return()=>++t},rk=()=>Bn(),ik=()=>Bn(1),sk=()=>Bn(),QI=sk(),ak=()=>Bn(),gm=ak(),ok=Bn(),lk=()=>-ok(),$n=()=>Jy().toLowerCase(),Tr=e=>Yy("1234567890abcdef",e)(),bm=()=>`${Tr(8)}-${Tr(4)}-${Tr(4)}-${Tr(4)}-${Tr(12)}`,ck=e=>new Uint8Array(new TextEncoder().encode(e)),dk=({width:e,group:t})=>new L({name:"w:fitText",attributes:{val:{key:"w:val",value:Math.round(qt(ve(e)))},id:{key:"w:id",value:t===void 0?lk():le(t)}}}),pk=class extends I{constructor(e){super("w:spacing"),this.root.push(new Ae({val:at(e)}))}},uk=class extends I{constructor(e){super("w:color"),this.root.push(new ic([{keys:k(k({},Kr),{},{color:"w:val"}),color:e}]))}},hk=class extends I{constructor(e){super("w:highlight"),this.root.push(new Ae({val:e}))}},mk=e=>new L({name:"w:lang",attributes:{value:{key:"w:val",value:e.value},eastAsia:{key:"w:eastAsia",value:e.eastAsia},bidirectional:{key:"w:bidi",value:e.bidirectional}}}),il=(e,t)=>{if(typeof e=="string"){let r=e;return new L({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:r},cs:{key:"w:cs",value:r},eastAsia:{key:"w:eastAsia",value:r},hAnsi:{key:"w:hAnsi",value:r},hint:{key:"w:hint",value:t}}})}if("theme"in e){let r=e.theme==="headings"?"major":"minor";return new L({name:"w:rFonts",attributes:{ascii:{key:"w:asciiTheme",value:`${r}HAnsi`},eastAsia:{key:"w:eastAsiaTheme",value:`${r}EastAsia`},hAnsi:{key:"w:hAnsiTheme",value:`${r}HAnsi`},cs:{key:"w:cstheme",value:`${r}Bidi`}}})}let n=e;return new L({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:n.ascii},cs:{key:"w:cs",value:n.cs},eastAsia:{key:"w:eastAsia",value:n.eastAsia},hAnsi:{key:"w:hAnsi",value:n.hAnsi},hint:{key:"w:hint",value:n.hint}}})},vm=e=>new L({name:"w:vertAlign",attributes:{val:{key:"w:val",value:e}}}),fk=()=>vm("superscript"),gk=()=>vm("subscript"),wm={SINGLE:"single",WORDS:"words",DOUBLE:"double",THICK:"thick",DOTTED:"dotted",DOTTEDHEAVY:"dottedHeavy",DASH:"dash",DASHEDHEAVY:"dashedHeavy",DASHLONG:"dashLong",DASHLONGHEAVY:"dashLongHeavy",DOTDASH:"dotDash",DASHDOTHEAVY:"dashDotHeavy",DOTDOTDASH:"dotDotDash",DASHDOTDOTHEAVY:"dashDotDotHeavy",WAVE:"wave",WAVYHEAVY:"wavyHeavy",WAVYDOUBLE:"wavyDouble",NONE:"none"},bk=(e=wm.SINGLE,t)=>sc("w:u",[{key:"w:val",value:e},{keys:Kr,color:t}]),on=class extends St{constructor(e){if(super("w:rPr"),!e)return;if(e.style&&this.push(new ot("w:rStyle",e.style)),e.font&&(typeof e.font=="string"?this.push(il(e.font)):"name"in e.font?this.push(il(e.font.name,e.font.hint)):this.push(il(e.font))),e.bold!==void 0&&this.push(new P("w:b",e.bold)),e.boldComplexScript===void 0&&e.bold!==void 0||e.boldComplexScript){var t;this.push(new P("w:bCs",(t=e.boldComplexScript)!==null&&t!==void 0?t:e.bold))}if(e.italics!==void 0&&this.push(new P("w:i",e.italics)),e.italicsComplexScript===void 0&&e.italics!==void 0||e.italicsComplexScript){var n;this.push(new P("w:iCs",(n=e.italicsComplexScript)!==null&&n!==void 0?n:e.italics))}e.smallCaps!==void 0?this.push(new P("w:smallCaps",e.smallCaps)):e.allCaps!==void 0&&this.push(new P("w:caps",e.allCaps)),e.strike!==void 0&&this.push(new P("w:strike",e.strike)),e.doubleStrike!==void 0&&this.push(new P("w:dstrike",e.doubleStrike)),e.emboss!==void 0&&this.push(new P("w:emboss",e.emboss)),e.imprint!==void 0&&this.push(new P("w:imprint",e.imprint)),e.noProof!==void 0&&this.push(new P("w:noProof",e.noProof)),e.snapToGrid!==void 0&&this.push(new P("w:snapToGrid",e.snapToGrid)),e.vanish!==void 0&&this.push(new P("w:vanish",e.vanish)),e.color&&this.push(new uk(e.color)),e.characterSpacing&&this.push(new pk(e.characterSpacing)),e.scale!==void 0&&this.push(new Ir("w:w",e.scale)),e.kern&&this.push(new rl("w:kern",e.kern)),e.position&&this.push(new ot("w:position",e.position)),e.size!==void 0&&this.push(new rl("w:sz",e.size));let r=e.sizeComplexScript===void 0||e.sizeComplexScript===!0?e.size:e.sizeComplexScript;r&&this.push(new rl("w:szCs",r)),e.highlight&&this.push(new hk(e.highlight)),e.underline&&this.push(bk(e.underline.type,e.underline.color)),e.effect&&this.push(new ot("w:effect",e.effect)),e.border&&this.push(he("w:bdr",e.border)),e.shading&&this.push(zs(e.shading)),e.fitText&&this.push(dk(e.fitText)),e.subScript&&this.push(gk()),e.superScript&&this.push(fk()),e.rightToLeft!==void 0&&this.push(new P("w:rtl",e.rightToLeft)),e.emphasisMark&&this.push(Vy(e.emphasisMark.type)),e.language&&this.push(mk(e.language)),e.eastAsianLayout&&this.push(Gy(e.eastAsianLayout)),e.specVanish!==void 0&&this.push(new P("w:specVanish",e.specVanish)),e.math!==void 0&&this.push(new P("w:oMath",e.math)),e.revision&&this.push(new wk(e.revision))}push(e){this.root.push(e)}},vk=class extends on{constructor(e){super(e),e?.insertion&&this.push(new Ky(e.insertion)),e?.deletion&&this.push(new Wy(e.deletion))}},wk=class extends I{constructor(e){super("w:rPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.addChildElement(new on(e))}},Dr=class extends I{constructor(e){if(super("w:t"),typeof e=="string")this.root.push(new Ut({space:Ht.PRESERVE})),this.root.push(e);else{var t;this.root.push(new Ut({space:(t=e.space)!==null&&t!==void 0?t:Ht.DEFAULT})),this.root.push(e.text)}}},ks={CURRENT:"CURRENT",TOTAL_PAGES:"TOTAL_PAGES",TOTAL_PAGES_IN_SECTION:"TOTAL_PAGES_IN_SECTION",CURRENT_SECTION:"SECTION"},xk=e=>{switch(e){case ks.CURRENT:return[Ar(),new Fy,sn(),an()];case ks.TOTAL_PAGES:return[Ar(),new qy,sn(),an()];case ks.TOTAL_PAGES_IN_SECTION:return[Ar(),new Hy,sn(),an()];case ks.CURRENT_SECTION:return[Ar(),new Uy,sn(),an()];default:return}},qe=class Il extends I{constructor(t){if(super("w:r"),E(this,"properties",void 0),E(this,"following",[]),this.properties=new on(t),this.root.push(this.properties),t.break)for(let n=0;n<t.break;n++)this.root.push(Dy());if(t.children)for(let[n,r]of t.children.entries()){if(Ws(r)==="w:r"){let i=t.children.slice(n+1);this.following=[r,...i.length>0?[new Il(k(k({},t),{},{break:void 0,children:i}))]:[]];break}if(typeof r=="string"){let i=xk(r);if(i){let s=t.children.slice(n+1),a=l=>new Il(k(k({},t),{},{break:void 0,children:l})),o=this.root.length===1;o&&this.root.push(i[0]);let c=o?i.slice(1):i;this.following=[...c.map(l=>a([l])),...s.length>0?[a(s)]:[]];break}this.root.push(new Dr(r));continue}this.root.push(r)}else t.text!==void 0&&this.root.push(new Dr(t.text))}get writtenAs(){return this.following.length>0?[this,...this.following.flatMap(t=>{var n;return(n=t.writtenAs)!==null&&n!==void 0?n:t})]:void 0}},Oe=class extends qe{constructor(e){super(typeof e=="string"?{text:e}:e)}},oc={EXTERNAL:"External"},yk=(e,t,n,r)=>new L({name:"Relationship",attributes:{id:{key:"Id",value:e},type:{key:"Type",value:t},target:{key:"Target",value:n},targetMode:{key:"TargetMode",value:r}}}),xm=(e,t)=>new L({name:"a:hlinkClick",attributes:k(k({},t?{xmlns:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"}}:{}),{},{id:{key:"r:id",value:`rId${e}`}})}),kk=class{constructor(e){E(this,"link",void 0),E(this,"linkId",$n()),E(this,"addedTo",new WeakSet),this.link=e}createClick(e){return xm(this.linkId,e)}addRelationship(e){let t=e.viewWrapper.Relationships;this.addedTo.has(t)||(this.addedTo.add(t),t.addRelationship(this.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",this.link,oc.EXTERNAL))}},Tk=32767,Sk=780,Ck=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],Ek=e=>e<=Tk?Ck.reduce(({rest:t,text:n},[r,i])=>({rest:t%r,text:n+i.repeat(Math.floor(t/r))}),{rest:e,text:""}).text:void 0,_k=e=>e===0?"":e<=Sk?String.fromCharCode(65+(e-1)%26).repeat(Math.ceil(e/26)):void 0,Ak=e=>{var t;return`${e}${e%100>=11&&e%100<=13?"th":(t=["th","st","nd","rd"][e%10])!==null&&t!==void 0?t:"th"}`},lc=e=>{let t=e.charAt(0)!==e.charAt(0).toUpperCase(),n=r=>i=>{var s;return t?(s=r(i))===null||s===void 0?void 0:s.toLowerCase():r(i)};switch(e.toLowerCase()){case"arabic":return String;case"roman":return n(Ek);case"alphabetic":return n(_k);case"ordinal":return r=>r>0?Ak(r):void 0;case"arabicdash":return r=>`- ${r} -`;default:return}},ym=new Set(["mergeformat","charformat","mergeformatinet"]),km=new Set(["upper","lower","firstcap","caps"]),Nk=e=>/^[#0,]*[#0][#0,]*$/.test(e),Ik=(e,t)=>{let n=[...t].filter(s=>s==="0").length,r=n+[...t].filter(s=>s==="#").length,i=String(e).padStart(n,"0");if(!(i.length<r||n===0&&e===0))return t.includes(",")?i.replace(/\B(?=(\d{3})+$)/g,","):i},Pk=(e,t)=>{switch(t){case"upper":return e.toUpperCase();case"lower":return e.toLowerCase();case"firstcap":return e.charAt(0).toUpperCase()+e.slice(1);default:return e}},Ok=e=>{var t;let n=new RegExp("^\\s*(PAGEREF|NUMPAGES|SECTIONPAGES)\\b(.*)$","is").exec(e),r=n?.[1].toUpperCase()==="PAGEREF"?new RegExp('^\\s*("?)([^\\s"\\\\]+)\\1(.*)$',"s").exec(n[2]):void 0;if(!n||n[1].toUpperCase()==="PAGEREF"&&!r)return;let i=(t=(r?r[3]:n[2]).match(/"[^"]*"|\S+/g))!==null&&t!==void 0?t:[],s,a,o=[],c=!1,l=!0;for(let h=0;h<i.length;h++){let f=i[h],m=()=>{var g;return(f.length>2?f.slice(2):(g=i[++h])!==null&&g!==void 0?g:"").replace(/^"(.*)"$/,"$1")};if(/^\\p$/i.test(f))c=!0;else if(f.startsWith("\\#")){var u;let g=m();l&&(l=a===void 0&&Nk(g)),(u=a)!==null&&u!==void 0||(a=g)}else if(f.startsWith("\\*")){let g=m(),x=g.toLowerCase();if(km.has(x))o.push(x);else if(g!==""&&!ym.has(x)){var d;l&&(l=s===void 0&&lc(g)!==void 0),(d=s)!==null&&d!==void 0||(s=g)}}}let p=k(k(k(k({},s===void 0?{}:{numberFormat:s}),a===void 0?{}:{picture:a}),o.length===0?{}:{capitals:o[0]}),{},{written:l&&o.length<=1&&o[0]!=="caps"&&(s===void 0||a===void 0)});return k(r?{type:"pageReference",bookmark:r[2],relative:c}:{type:"pageCount",scope:n[1].toUpperCase()==="NUMPAGES"?"document":"section"},p)},Rk=e=>new RegExp("^\\s*TOC\\b.*\\\\s\\b","is").test(e),Tm=(e,{enclosing:t,within:n,inTextBox:r},{estimate:i,sectionPageCount:s,blank:a,relativeTo:o})=>{let c=Ok(e);if(c===void 0)return;let{bookmarks:l,pageCount:u,bookmarkPageNumbers:d}=i,{numberFormat:p,picture:h,capitals:f,written:m}=c,g=p!==void 0||h!==void 0,x=C=>C===void 0?void 0:h===void 0?lc(p??"arabic")(C):Ik(C,h),T=c.type==="pageReference"&&c.relative&&n==="counted"&&!r?o?.(c.bookmark):void 0,b;return m?c.type==="pageCount"?b=x(c.scope==="document"?u:s):t.some(Rk)?b=void 0:g?b=x(d?.get(c.bookmark)):b=c.relative?T:l.get(c.bookmark):b=void 0,b===void 0?a?"":void 0:Pk(b,f)},Lk=(e,t)=>e==="mc:Fallback"||t==="fallback"?"fallback":e==="w:del"||e==="w:moveFrom"?"deleted":t,Br=(e,t,n,r,i="counted",s=!1)=>{for(let l=0;l<t.length;l++){let u=t[l],d=e.nameOf(u);if(d===void 0)continue;let p=n[n.length-1];if(d==="w:fldChar"){let h=e.attributeOf(u,"w:fldCharType");h==="begin"?n.push({begin:u,instruction:"",inResult:!1}):h==="separate"&&p?(e.writeClean(p.begin,p.instruction),p.inResult=!0,p.result=r.resultOf(p.instruction,{within:i,enclosing:n.slice(0,-1).map(f=>f.instruction),inTextBox:s}),p.result!==void 0&&(t.splice(l+1,0,e.textElement(p.result)),l++)):h==="end"&&n.pop()}else if(d==="w:instrText"&&p&&!p.inResult)p.instruction+=e.textOf(u);else if((d==="w:t"||d==="w:tab"||d==="w:br"||d==="w:cr")&&p?.result!==void 0)t.splice(l,1),l--;else if(d==="w:fldSimple"){let h=r.resultOf(String(e.attributeOf(u,"w:instr")),{within:i,enclosing:n.map(f=>f.instruction),inTextBox:s});if(h===void 0){var a;Br(e,(a=e.contentOf(u))!==null&&a!==void 0?a:[],[],r,i,s)}else e.setSimpleFieldResult(u,h)}else{var o;if(d==="w:p"){var c;(c=r.beforeParagraph)===null||c===void 0||c.call(r,u)}Br(e,(o=e.contentOf(u))!==null&&o!==void 0?o:[],n,r,Lk(d,i),s||d==="w:txbxContent"),d==="w:p"&&r.afterParagraph(u)}}},Sm=(e,t)=>t.flatMap(n=>{var r;let i=e.nameOf(n);return i===void 0?[]:i==="w:sectPr"?[n]:Sm(e,(r=e.contentOf(n))!==null&&r!==void 0?r:[])}),Mk=(e,t)=>{var n;return((n=e.contentOf(t))!==null&&n!==void 0?n:[]).some(r=>{var i;return e.nameOf(r)==="w:pPr"&&((i=e.contentOf(r))!==null&&i!==void 0?i:[]).some(s=>e.nameOf(s)==="w:sectPr")})},Dk=(e,t,n)=>{let r=Sm(e,[t]).reduce((i,s)=>{var a,o;let c=((a=e.contentOf(s))!==null&&a!==void 0?a:[]).flatMap(l=>{let u=e.nameOf(l);return u==="w:headerReference"||u==="w:footerReference"?[[`${u} ${String(e.attributeOf(l,"w:type"))}`,String(e.attributeOf(l,"r:id"))]]:[]});return[...i,new Map([...(o=i[i.length-1])!==null&&o!==void 0?o:[],...c])]},[]).reduce((i,s,a)=>{for(let c of s.values()){var o;i.set(c,[...(o=i.get(c))!==null&&o!==void 0?o:[],n[a]])}return i},new Map);return new Map([...r].flatMap(([i,[s,...a]])=>s!==void 0&&a.every(o=>o===s)?[[i,s]]:[]))},Cm=(e,t,n,{blank:r})=>{let{sectionPageCounts:i=[],relativePositions:s}=n,a=0,o=new Map,c=l=>{var u,d;let p=(u=o.get(l))!==null&&u!==void 0?u:0;return o.set(l,p+1),s==null||(d=s.get(l))===null||d===void 0?void 0:d[p]};return Br(e,[t],[],{resultOf:(l,u)=>Tm(l,u,{estimate:n,sectionPageCount:i[a],blank:r,relativeTo:c}),afterParagraph:l=>{a+=Mk(e,l)?1:0}}),Dk(e,t,i)},Em=(e,t,n,{blank:r,sectionPageCount:i,notes:s=!1})=>{let a=o=>{let c=n.bookmarks.get(o);return c===void 0?void 0:`on page ${c}`};Br(e,[t],[],{resultOf:(o,c)=>Tm(o,c,k({estimate:n,sectionPageCount:i,blank:r},s?{relativeTo:a}:{})),afterParagraph:()=>{}})},Bk=(e,t,{beforeParagraph:n,resultOf:r})=>Br(e,[t],[],{resultOf:(i,{within:s})=>r(i,s),beforeParagraph:n,afterParagraph:()=>{}}),_m=class extends I{constructor(e={}){super("w:instrText"),E(this,"properties",void 0),this.properties=e,this.root.push(new Ut({space:Ht.PRESERVE}));let t="TOC";if(this.properties.captionLabel&&(t=`${t} \\a "${this.properties.captionLabel}"`),this.properties.entriesFromBookmark&&(t=`${t} \\b "${this.properties.entriesFromBookmark}"`),this.properties.captionLabelIncludingNumbers&&(t=`${t} \\c "${this.properties.captionLabelIncludingNumbers}"`),this.properties.sequenceAndPageNumbersSeparator&&(t=`${t} \\d "${this.properties.sequenceAndPageNumbersSeparator}"`),this.properties.tcFieldIdentifier&&(t=`${t} \\f "${this.properties.tcFieldIdentifier}"`),this.properties.hyperlink&&(t=`${t} \\h`),this.properties.tcFieldLevelRange&&(t=`${t} \\l "${this.properties.tcFieldLevelRange}"`),this.properties.pageNumbersEntryLevelsRange&&(t=`${t} \\n "${this.properties.pageNumbersEntryLevelsRange}"`),this.properties.headingStyleRange&&(t=`${t} \\o "${this.properties.headingStyleRange}"`),this.properties.entryAndPageNumberSeparator&&(t=`${t} \\p "${this.properties.entryAndPageNumberSeparator}"`),this.properties.seqFieldIdentifierForPrefix&&(t=`${t} \\s "${this.properties.seqFieldIdentifierForPrefix}"`),this.properties.stylesWithLevels&&this.properties.stylesWithLevels.length){let n=this.properties.stylesWithLevels.map(r=>`${r.styleName},${r.level}`).join(",");t=`${t} \\t "${n}"`}this.properties.useAppliedParagraphOutlineLevel&&(t=`${t} \\u`),this.properties.preserveTabInEntries&&(t=`${t} \\w`),this.properties.preserveNewLineInEntries&&(t=`${t} \\x`),this.properties.hideTabAndPageNumbersInWebView&&(t=`${t} \\z`),this.root.push(t)}},Am=class extends I{constructor(){super("w:sdtContent")}},Nm=e=>e===void 0?fm():Ar(e),cc=new WeakMap,$k=(e,t)=>{cc.set(e,t)},Fk=class{constructor(){E(this,"ids",[])}get(e){var t,n;return(n=(t=this.ids)[e])!==null&&n!==void 0||(t[e]=gm()),this.ids[e]}},ct=e=>typeof e=="object"&&e!==null?Object.keys(e)[0]:void 0,dt=e=>{let t=ct(e),n=t===void 0?void 0:e[t];return Array.isArray(n)?n:n===void 0?[]:[n]},Je=(e,t)=>dt(e).find(n=>ct(n)===t),$e=(e,t)=>{var n;return(n=Je(e,"_attr"))===null||n===void 0||(n=n._attr)===null||n===void 0?void 0:n[t]},dc=(e,t)=>{let n=$e(e,t);return n===void 0?void 0:Number(n)},qk=new Set(["w:tbl","w:tr","w:tc","w:sdt","w:sdtContent","w:customXml"]),Im=e=>e.flatMap(t=>{let n=ct(t);return n==="w:p"||cc.has(t)?[t]:n!==void 0&&qk.has(n)?Im(dt(t)):[]}),Hk=new Set(["w:r","w:hyperlink","w:ins","w:moveTo","w:smartTag","w:customXml","w:sdt","w:sdtContent","w:fldSimple","w:dir","w:bdo"]),Uk=e=>{switch(ct(e)){case"w:t":return dt(e).filter(t=>typeof t=="string").join("");case"w:tab":return" ";case"w:br":return[void 0,"textWrapping"].includes($e(e,"w:type"))?`
5341
5673
  `:"";case"w:cr":return`
5342
- `;case"w:noBreakHyphen":return"-";default:return""}},jk=e=>{let t=[],n=r=>{let i=ct(r);if(i!==void 0&&Hk.has(i))return dt(r).map(n).join("");if(i==="w:fldChar"){let s=$e(r,"w:fldCharType");return s==="begin"?t.push(!1):s==="separate"?t[t.length-1]=!0:t.pop(),""}return t.every(Boolean)?Uk(r):""};return dt(e).map(n).join("")},Im=e=>{let t=ct(e);return t==="w:bookmarkStart"?[{start:!0,id:$e(e,"w:id"),name:$e(e,"w:name")}]:t==="w:bookmarkEnd"?[{start:!1,id:$e(e,"w:id")}]:t===void 0||t==="_attr"?[]:dt(e).flatMap(Im)},Wk=e=>{let t=new Map;return e.map(n=>{let r=Im(n),i=new Set([...t.values(),...r.flatMap(s=>s.start?[s.name]:[])]);for(let s of r)s.start?t.set(s.id,s.name):t.delete(s.id);return i})},Kk=(e,t)=>{let n=t?Wk(e):[];return e.map((r,i)=>{var s;let a=Je(r,"w:pPr");return{element:r,styleId:$e(Je(a,"w:pStyle"),"w:val"),outlineLevel:dc(Je(a,"w:outlineLvl"),"w:val"),text:jk(r),bookmarks:(s=n[i])!==null&&s!==void 0?s:new Set}})},Om=e=>{var t;let n=(t=e.file)===null||t===void 0||(t=t.Styles)===null||t===void 0?void 0:t.prepForXml(e);return new Map(dt(n).filter(r=>ct(r)==="w:style"&&["paragraph",void 0].includes($e(r,"w:type"))).map(r=>[$e(r,"w:styleId"),{name:$e(Je(r,"w:name"),"w:val"),basedOn:$e(Je(r,"w:basedOn"),"w:val"),outlineLevel:dc(Je(Je(r,"w:pPr"),"w:outlineLvl"),"w:val")}]))},Rm=e=>{let t=/^\s*(\d+)\s*-\s*(\d+)\s*$/.exec(e);return t?[Number(t[1]),Number(t[2])]:void 0},Il=(e,[t,n])=>e>=t&&e<=n,pc=(e,t)=>{var n,r;if(e===void 0)return;let i=/^heading ?([1-9])$/i.exec((n=(r=t.get(e))===null||r===void 0?void 0:r.name)!==null&&n!==void 0?n:e);return i?Number(i[1]):void 0},Lm=(e,t,n=0)=>{var r;if(e===void 0||n>t.size)return;let i=t.get(e),s=pc(e,t);return(r=i?.outlineLevel)!==null&&r!==void 0?r:s===void 0?Lm(i?.basedOn,t,n+1):s-1},Gk=e=>{let t=Om(e);return n=>{let r=Je(n,"w:pPr"),i=$e(Je(r,"w:pStyle"),"w:val"),s=pc(i,t),a=Dm({styleId:i,outlineLevel:dc(Je(r,"w:outlineLvl"),"w:val")},t),o=a===void 0||a>=9?void 0:a+1;return s!==void 0&&(o===void 0||o===s)?s:o===void 0?void 0:"unclear"}},Dm=(e,t)=>{var n;return(n=e.outlineLevel)!==null&&n!==void 0?n:Lm(e.styleId,t)},zk=(e,t,n)=>{var r;let{entriesFromBookmark:i,headingStyleRange:s,stylesWithLevels:a=[],useAppliedParagraphOutlineLevel:o}=e;if(t.text.trim()===""||i&&!t.bookmarks.has(i))return;let c=[t.styleId,t.styleId===void 0||(r=n.get(t.styleId))===null||r===void 0?void 0:r.name].filter(f=>f!==void 0).map(f=>f.toLowerCase()),l=a.find(f=>c.includes(f.styleName.toLowerCase()));if(l)return l.level;let u=!!s||a.length>0||!!o||!!e.tcFieldIdentifier||!!e.tcFieldLevelRange||!!e.captionLabel||!!e.captionLabelIncludingNumbers,d=s?Rm(s):u?void 0:[1,9],p=pc(t.styleId,n);if(d&&p!==void 0&&Il(p,d))return p;let h=o?Dm(t,n):void 0;return h!==void 0&&Il(h+1,d??[1,9])?h+1:void 0},Vk=(e,t)=>{let n=t.preserveTabInEntries?e:e.replace(/\t/g," ");return(t.preserveNewLineInEntries?n.split(`
5343
- `):[n.replace(/\n/g," ")]).map((r,i)=>new Oe({break:i>0?1:void 0,children:r.split(" ").flatMap((s,a)=>[...a>0?[new Xs]:[],...s===""?[]:[s]])}))},Xk=({text:e,separator:t})=>t==="tab"?[new Oe(e),new Oe({children:[new Xs]})]:[new Oe(`${e} `)],Yk=(e,t)=>{let n=240*(e-1)+t+240;return n<=1920?Math.ceil(n/240)*240:Math.round(n)},Jk=(e,t)=>{var n,r;return(n=(r=[...t].find(([,i])=>{var s;return((s=i.name)===null||s===void 0?void 0:s.toLowerCase())===`toc ${e}`}))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:`TOC${e}`},Qk=({properties:e,beginDirty:t,textWidth:n,tabLeader:r},i,s,a)=>{var o;let c=e.pageNumbersEntryLevelsRange?(o=Rm(e.pageNumbersEntryLevelsRange))!==null&&o!==void 0?o:[1,9]:void 0,l=new _m;return i.forEach((u,d)=>{var p;let h=c===void 0||!Il(u.level,c),f=[...u.listNumber?Xk(u.listNumber):[],...Vk(u.title,e),...h?[new Oe({children:[e.entryAndPageNumberSeparator||new Xs]}),new B1(u.bookmark,{hyperlink:e.hyperlink})]:[]];l.addChildElement(new ne({style:Jk(u.level,s),tabStops:[...((p=u.listNumber)===null||p===void 0?void 0:p.separator)==="tab"?[{type:"left",position:Yk(u.level,u.listNumber.width)}]:[],{type:"right",position:n,leader:r}],children:[...d===0?[new qe({children:[Nm(t),new Am(e),sn()]})]:[],...e.hyperlink?[new Fm({anchor:u.bookmark,children:f})]:f]}))}),l.addChildElement(new ne({children:[new qe({children:[an()]})]})),l.prepForXml(a)},Zk=(e,t,n,r)=>{let i=dt(e),s=i.findIndex(a=>ct(a)==="w:pPr")+1;e["w:p"]=[...i.slice(0,s),new Um(t,n).prepForXml(r),...i.slice(s),new jm(n).prepForXml(r)]},e1=(e,t,n,r)=>{let i=Pm(dt(e)),s=i.flatMap(u=>{let d=cc.get(u);return d?[[u,d]]:[]});if(s.length===0)return;let a=Om(t),o=s.some(([,{properties:u}])=>!!u.entriesFromBookmark),c=Kk(i.filter(u=>ct(u)==="w:p"),o).map(u=>({paragraph:u,levels:s.map(([,{properties:d}])=>zk(d,u,a))})).filter(({levels:u})=>u.some(d=>d!==void 0)).map((u,d)=>k(k({},u),{},{id:n.get(d)}));for(let{paragraph:u,id:d}of c)Zk(u.element,`_Toc${d}`,d,t);let l=c.length>0?r?.(e):void 0;s.forEach(([u,d],p)=>{let h=c.flatMap(({paragraph:f,levels:m,id:g})=>{let y=m[p],T=l?.get(`_Toc${g}`);return y===void 0?[]:[k({title:f.text,level:y,bookmark:`_Toc${g}`},T?{listNumber:T}:{})]});h.length!==0&&(u["w:sdt"]=dt(u).map(f=>ct(f)==="w:sdtContent"?Qk(d,h,a,t):f))})},t1=new RegExp("^\\p{L}[\\p{L}\\p{N}_]*$","u"),n1=e=>{var t,n;let r,i=!1,s,a=!1,o=!1;for(let d=0;d<e.length;d++){var c,l;let p=e[d],h=(c=e[d+1])!==null&&c!==void 0?c:"",f;if(d===0&&!p.startsWith("\\"))f={type:"bookmark"};else if(p==="\\c"||p==="\\n")f={type:p==="\\c"?"repeat":"next"};else if((p==="\\r"||p==="\\s")&&/^\d+$/.test(h))d++,f=p==="\\r"?{type:"reset",to:Number(h)}:{type:"heading",level:Number(h)};else if(p==="\\h")i=!0;else if(p==="\\#"&&d+1<e.length)d++,o=!0;else if(p==="\\*"&&d+1<e.length){let m=e[++d];if(km.has(m.toLowerCase()))a=!0;else if(!xm.has(m.toLowerCase())){if(s!==void 0)return;s=m}}else return;if(f&&r)return;r=(l=f)!==null&&l!==void 0?l:r}if(r?.type==="bookmark"&&e.length>1)return;let u=!o&&!(a&&s!==void 0&&s.toLowerCase()!=="arabic");return{step:(t=r)!==null&&t!==void 0?t:{type:"next"},hidden:i&&s===void 0,format:u?(n=s)!==null&&n!==void 0?n:"ARABIC":""}},uc=e=>{var t;let n=new RegExp("^\\s*SEQ\\b(.*)$","is").exec(e);if(!n)return;let[r,...i]=(t=n[1].match(/"[^"]*"|\S+/g))!==null&&t!==void 0?t:[];if(r===void 0)return{};let s=r.replace(/^"(.*)"$/,"$1");return t1.test(s)?{identifier:s,sequence:n1(i)}:{identifier:s}},r1=e=>uc(e)!==void 0,Ol=e=>typeof e!="object"||e===null?[]:Array.isArray(e)?e.flatMap(Ol):Object.entries(e).flatMap(([t,n])=>[...(t==="w:instrText"&&Array.isArray(n)?n:t==="_attr"?[n["w:instr"]]:[]).flatMap(r=>{let i=typeof r=="string"?uc(r):void 0;return i?.identifier===void 0?[]:[i.identifier.toLowerCase()]}),...Ol(n)]),i1=e=>{var t;let n=(t=e.file)===null||t===void 0?void 0:t.Comments;if(!n)return new Set;let r={View:n,Relationships:n.Relationships};return new Set(Ol(n.prepForXml(k(k({},e),{},{viewWrapper:r,stack:[]}))))},s1=e=>{let t=Gk(e),n=new Map,r=new Map,i=[],s=-1,a=-1,o,c=(l,u)=>{var d;let p=Math.max(-1,...i.slice(1,u+1).filter(m=>m!==void 0)),h=((d=r.get(l))!==null&&d!==void 0?d:[]).filter(m=>m.paragraph>=p),f=h.every(({step:m})=>m?.type==="next"||m?.type==="heading"&&m.level===u);return s>p||!f?void 0:h.length+1};return{startParagraph:l=>{a++;let u=t(l);u==="unclear"?s=a:u!==void 0&&(i[u]=a)},numberOf:(l,u)=>{var d,p,h;let{identifier:f,sequence:m}=uc(l);if(f===void 0||u==="fallback")return;(d=o)!==null&&d!==void 0||(o=i1(e));let g=f.toLowerCase();if(m?.step.type==="bookmark"&&u==="counted"&&!o.has(g))return;let y=n.has(g)?n.get(g):0,T=o.has(g)||u==="deleted"?void 0:m?.step,b=T?.type==="reset"?T.to:T?.type==="repeat"?y:T?.type==="heading"?c(g,T.level):T?.type==="next"&&y!==void 0?y+1:void 0;return n.set(g,b),r.set(g,[...(p=r.get(g))!==null&&p!==void 0?p:[],k({paragraph:a},b===void 0?{}:{step:T})]),b===void 0||m===void 0?void 0:m.hidden?"":(h=lc(m.format))===null||h===void 0?void 0:h(b)}}},sl=e=>{let t=typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.keys(e)[0]:void 0;return t==="_attr"?void 0:t},th=e=>({"w:t":[{_attr:{"xml:space":"preserve"}},e]}),Vs={nameOf:sl,contentOf:e=>{let t=e[sl(e)];return Array.isArray(t)?t:void 0},attributeOf:(e,t)=>{var n;let r=e[sl(e)],i=Array.isArray(r)?r.find(s=>typeof s=="object"&&s!==null&&"_attr"in s):r;return i==null||(n=i._attr)===null||n===void 0?void 0:n[t]},textOf:e=>Vs.contentOf(e).filter(t=>typeof t=="string").join(""),textElement:th,writeClean:e=>{if($x(e)){let t=e["w:fldChar"]._attr;e["w:fldChar"]={_attr:Object.fromEntries(Object.entries(t).filter(([n])=>n!=="w:dirty"))}}},setSimpleFieldResult:(e,t)=>{let n=e["w:fldSimple"];e["w:fldSimple"]=[...(Array.isArray(n)?n:[n]).filter(r=>typeof r=="object"&&r!==null&&"_attr"in r),{"w:r":[th(t)]}]}},Mm=new WeakMap,a1=(e,t)=>{let{startParagraph:n,numberOf:r}=s1(t);Bk(Vs,e,{beforeParagraph:i=>n(i),resultOf:(i,s)=>r1(i)?r(i,s):void 0})},o1=(e,t,n)=>{let r=n(e,t),i=Cm(Vs,e,r,{blank:!1});t.file&&Mm.set(t.file,{estimate:r,partPageCounts:i})},zr=(e,t,n)=>{let r=t.file&&Mm.get(t.file);if(!e||!r)return;let i=n===void 0?void 0:r.partPageCounts.get(`rId${n}`),s="w:footnotes"in e||"w:endnotes"in e;Em(Vs,e,r.estimate,{blank:!1,sectionPageCount:i,notes:s})},l1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns"})}},be=class Bm extends P{constructor(){super("Relationships"),this.root.push(new l1({xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}))}addRelationship(t,n,r,i){this.root.push(xk(`rId${t}`,n,r,i))}static copy(t){let n=new Bm;return n.root.push(...t.root.slice(1)),n}get RelationshipCount(){return this.root.length-1}},c1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",initials:"w:initials",author:"w:author",date:"w:date"})}},d1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{"xmlns:wpc":"xmlns:wpc","xmlns:cx":"xmlns:cx","xmlns:cx1":"xmlns:cx1","xmlns:cx2":"xmlns:cx2","xmlns:cx3":"xmlns:cx3","xmlns:cx4":"xmlns:cx4","xmlns:cx5":"xmlns:cx5","xmlns:cx6":"xmlns:cx6","xmlns:cx7":"xmlns:cx7","xmlns:cx8":"xmlns:cx8","xmlns:mc":"xmlns:mc","xmlns:aink":"xmlns:aink","xmlns:am3d":"xmlns:am3d","xmlns:o":"xmlns:o","xmlns:r":"xmlns:r","xmlns:m":"xmlns:m","xmlns:v":"xmlns:v","xmlns:wp14":"xmlns:wp14","xmlns:wp":"xmlns:wp","xmlns:w10":"xmlns:w10","xmlns:w":"xmlns:w","xmlns:w14":"xmlns:w14","xmlns:w15":"xmlns:w15","xmlns:w16cex":"xmlns:w16cex","xmlns:w16cid":"xmlns:w16cid","xmlns:w16":"xmlns:w16","xmlns:w16sdtdh":"xmlns:w16sdtdh","xmlns:w16se":"xmlns:w16se","xmlns:wpg":"xmlns:wpg","xmlns:wpi":"xmlns:wpi","xmlns:wne":"xmlns:wne","xmlns:wps":"xmlns:wps","mc:Ignorable":"mc:Ignorable"})}},nh=class extends P{constructor({id:e,initials:t,author:n,date:r=new Date,children:i},s){super("w:comment"),E(this,"paraId",void 0),this.paraId=s,this.root.push(new c1({id:e,initials:t,author:n,date:r.toISOString()}));for(let a of i)this.root.push(a)}prepForXml(e){let t=super.prepForXml(e);if(!t||!this.paraId)return t;let n=t["w:comment"];if(!Array.isArray(n))return t;for(let r=n.length-1;r>=0;r--){let i=n[r];if(i&&typeof i=="object"&&"w:p"in i){let s=i["w:p"];Array.isArray(s)&&s.unshift({_attr:{"w14:paraId":this.paraId,"w14:textId":this.paraId}});break}}return t}},p1=e=>(e+1).toString(16).toUpperCase().padStart(8,"0"),u1=class extends P{constructor({children:e}){super("w:comments"),E(this,"relationships",void 0),E(this,"threadData",void 0),E(this,"commentIdsData",void 0),E(this,"isEmpty",void 0),this.isEmpty=e.length===0,this.root.push(new d1({"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","xmlns:cx":"http://schemas.microsoft.com/office/drawing/2014/chartex","xmlns:cx1":"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex","xmlns:cx2":"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex","xmlns:cx3":"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex","xmlns:cx4":"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex","xmlns:cx5":"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex","xmlns:cx6":"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex","xmlns:cx7":"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex","xmlns:cx8":"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:aink":"http://schemas.microsoft.com/office/drawing/2016/ink","xmlns:am3d":"http://schemas.microsoft.com/office/drawing/2017/model3d","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:m":"http://schemas.openxmlformats.org/officeDocument/2006/math","xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:wp14":"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing","xmlns:wp":"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing","xmlns:w10":"urn:schemas-microsoft-com:office:word","xmlns:w":"http://schemas.openxmlformats.org/wordprocessingml/2006/main","xmlns:w14":"http://schemas.microsoft.com/office/word/2010/wordml","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","xmlns:w16cex":"http://schemas.microsoft.com/office/word/2018/wordml/cex","xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:w16":"http://schemas.microsoft.com/office/word/2018/wordml","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16se":"http://schemas.microsoft.com/office/word/2015/wordml/symex","xmlns:wpg":"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup","xmlns:wpi":"http://schemas.microsoft.com/office/word/2010/wordprocessingInk","xmlns:wne":"http://schemas.microsoft.com/office/word/2006/wordml","xmlns:wps":"http://schemas.microsoft.com/office/word/2010/wordprocessingShape","mc:Ignorable":"w14 w15 wp14"}));let t=e.some(r=>r.parentId!==void 0),n=e.some(r=>r.durableId!==void 0);if(t||n){let r=new Map(e.map(i=>[i.id,p1(i.id)]));for(let i of e)this.root.push(new nh(i,r.get(i.id)));t&&(this.threadData=e.map(i=>({paraId:r.get(i.id),parentParaId:i.parentId!==void 0?r.get(i.parentId):void 0,done:i.resolved}))),n&&(this.commentIdsData=e.map(i=>{var s;return{paraId:r.get(i.id),durableId:(s=i.durableId)!==null&&s!==void 0?s:r.get(i.id)}}))}else for(let r of e)this.root.push(new nh(r));this.relationships=new be}get Relationships(){return this.relationships}get ThreadData(){return this.threadData}get CommentIdsData(){return this.commentIdsData}get IsEmpty(){return this.isEmpty}prepForXml(e){let t=super.prepForXml(e);return zr(t,e),t}},h1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{"xmlns:wpc":"xmlns:wpc","xmlns:mc":"xmlns:mc","xmlns:w15":"xmlns:w15","mc:Ignorable":"mc:Ignorable"})}},m1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{paraId:"w15:paraId",paraIdParent:"w15:paraIdParent",done:"w15:done"})}},f1=class extends P{constructor(e){super("w15:commentEx"),this.root.push(new m1({paraId:e.paraId,paraIdParent:e.parentParaId,done:e.done!==void 0?e.done?"1":"0":void 0}))}},g1=class extends P{constructor(e){super("w15:commentsEx"),this.root.push(new h1({"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","mc:Ignorable":"w15"}));for(let t of e)this.root.push(new f1(t))}},b1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{paraId:"w16cid:paraId",durableId:"w16cid:durableId"})}},v1=class extends P{constructor(e){super("w16cid:commentId"),this.root.push(new b1({paraId:e.paraId,durableId:e.durableId}))}},w1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{"xmlns:w16cid":"xmlns:w16cid","xmlns:mc":"xmlns:mc","mc:Ignorable":"mc:Ignorable"})}},y1=class extends P{constructor(e){super("w16cid:commentsIds"),this.root.push(new w1({"xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"w16cid"}));for(let t of e)this.root.push(new v1(t))}},x1=class extends cm{constructor(){super("w:endnoteRef")}},Xs=class extends cm{constructor(){super("w:tab")}},k1={COLUMN:"column",PAGE:"page"},T1=class extends P{constructor(e){super("w:br"),this.root.push(new _e({type:e}))}},$m=class extends qe{constructor(){super({}),this.root.push(new T1(k1.PAGE))}},S1=class extends P{constructor(){super("w:pageBreakBefore")}},Dn={AT_LEAST:"atLeast",EXACTLY:"exactly",EXACT:"exact",AUTO:"auto"},C1=({after:e,before:t,line:n,lineRule:r,beforeAutoSpacing:i,afterAutoSpacing:s})=>new L({name:"w:spacing",attributes:{after:{key:"w:after",value:e},before:{key:"w:before",value:t},line:{key:"w:line",value:n},lineRule:{key:"w:lineRule",value:r},beforeAutoSpacing:{key:"w:beforeAutospacing",value:i},afterAutoSpacing:{key:"w:afterAutospacing",value:s}}}),Ys={HEADING_1:"Heading1",HEADING_2:"Heading2",HEADING_3:"Heading3",HEADING_4:"Heading4",HEADING_5:"Heading5",HEADING_6:"Heading6",TITLE:"Title"},Nr=e=>new L({name:"w:pStyle",attributes:{val:{key:"w:val",value:e}}}),rh={LEFT:"left",RIGHT:"right",CENTER:"center",BAR:"bar",CLEAR:"clear",DECIMAL:"decimal",END:"end",NUM:"num",START:"start"},E1={DOT:"dot",HYPHEN:"hyphen",MIDDLE_DOT:"middleDot",NONE:"none",UNDERSCORE:"underscore"},A1=({type:e,position:t,leader:n})=>new L({name:"w:tab",attributes:{val:{key:"w:val",value:e},pos:{key:"w:pos",value:at(t)},leader:{key:"w:leader",value:n}}}),_1=e=>new L({name:"w:tabs",children:e.map(t=>A1(t))}),Ts=class extends P{constructor(e,t){super("w:numPr"),this.root.push(new N1(t)),this.root.push(new P1(e))}},N1=class extends P{constructor(e){if(super("w:ilvl"),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new _e({val:e}))}},P1=class extends P{constructor(e){super("w:numId"),this.root.push(new _e({val:typeof e=="string"?`{${e}}`:e}))}},hc=class extends P{constructor(...e){super(...e),E(this,"fileChild",Symbol())}},I1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"r:id",history:"w:history",anchor:"w:anchor"})}},mc=class extends P{constructor(e,t,n,r){super("w:hyperlink"),E(this,"linkId",void 0),E(this,"drawingLink",void 0),this.linkId=t,this.drawingLink=n&&r!==void 0?new kk(r):void 0;let i=new I1({history:1,anchor:n||void 0,id:!n||r!==void 0?`rId${this.linkId}`:void 0});this.root.push(i),e.forEach(s=>{this.root.push(s)})}createDrawingClick(e,t){return this.drawingLink?(this.drawingLink.addRelationship(e),this.drawingLink.createClick(t)):ym(this.linkId,t)}},Fm=class extends mc{constructor(e){super(e.children,$n(),e.anchor)}},O1=class extends P{constructor(e){super("w:externalHyperlink"),E(this,"options",void 0),this.options=e}},R1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",name:"w:name"})}},L1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id"})}},qm=class Hm{constructor(t){E(this,"start",void 0),E(this,"children",void 0),E(this,"end",void 0);let n=gm();this.start=new Um(t.id,n),this.children=t.children,this.end=new jm(n)}get writtenAs(){return[this.start,...this.children.flatMap(t=>t instanceof Hm?t.writtenAs:[t]),this.end]}},Um=class extends P{constructor(e,t){super("w:bookmarkStart");let n=new R1({name:e,id:t});this.root.push(n)}},jm=class extends P{constructor(e){super("w:bookmarkEnd");let t=new L1({id:e});this.root.push(t)}},D1=e=>new L({name:"w:outlineLvl",attributes:{val:{key:"w:val",value:e}}}),M1=class extends P{constructor(e,t={}){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE}));let n=`PAGEREF ${e}`;t.hyperlink&&(n=`${n} \\h`),t.useRelativePosition&&(n=`${n} \\p`),this.root.push(n)}},B1=class extends qe{constructor(e,t={}){super({children:[fm(),new M1(e,t),sn(),an()]})}},$1=255,Wm=e=>{let t=e.indexOf("#"),n=e.length-t-1;return t>0&&n>0&&n<=$1?{target:e.slice(0,t),anchor:e.slice(t+1)}:{target:e}},Bs=(e,t,n)=>n===void 0?`${e}-${t}`:`${e}-restart ${n}`,Ss=({id:e,fontKey:t,subsetted:n},r)=>new L({name:r,attributes:k({id:{key:"r:id",value:e}},t?{fontKey:{key:"w:fontKey",value:`{${t.toUpperCase()}}`}}:{}),children:[...n?[new I("w:subsetted",n)]:[]]}),F1=({name:e,altName:t,panose1:n,charset:r,family:i,notTrueType:s,pitch:a,sig:o,embedRegular:c,embedBold:l,embedItalic:u,embedBoldItalic:d})=>new L({name:"w:font",attributes:{name:{key:"w:name",value:e}},children:[...t?[kr("w:altName",t)]:[],...n?[kr("w:panose1",n)]:[],...r?[kr("w:charset",r)]:[],...i?[kr("w:family",i)]:[],...s?[new I("w:notTrueType",s)]:[],...a?[kr("w:pitch",a)]:[],...o?[new L({name:"w:sig",attributes:{usb0:{key:"w:usb0",value:o.usb0},usb1:{key:"w:usb1",value:o.usb1},usb2:{key:"w:usb2",value:o.usb2},usb3:{key:"w:usb3",value:o.usb3},csb0:{key:"w:csb0",value:o.csb0},csb1:{key:"w:csb1",value:o.csb1}}})]:[],...c?[Ss(c,"w:embedRegular")]:[],...l?[Ss(l,"w:embedBold")]:[],...u?[Ss(u,"w:embedItalic")]:[],...d?[Ss(d,"w:embedBoldItalic")]:[]]}),q1=({name:e,characterSet:t,embedRegular:n,embedBold:r,embedItalic:i,embedBoldItalic:s})=>F1({name:e,sig:{usb0:"E0002AFF",usb1:"C000247B",usb2:"00000009",usb3:"00000000",csb0:"000001FF",csb1:"00000000"},charset:t,family:"auto",pitch:"variable",embedRegular:n,embedBold:r,embedItalic:i,embedBoldItalic:s}),H1=e=>new L({name:"w:fonts",attributes:{mc:{key:"xmlns:mc",value:"http://schemas.openxmlformats.org/markup-compatibility/2006"},r:{key:"xmlns:r",value:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},w:{key:"xmlns:w",value:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},w14:{key:"xmlns:w14",value:"http://schemas.microsoft.com/office/word/2010/wordml"},w15:{key:"xmlns:w15",value:"http://schemas.microsoft.com/office/word/2012/wordml"},w16cex:{key:"xmlns:w16cex",value:"http://schemas.microsoft.com/office/word/2018/wordml/cex"},w16cid:{key:"xmlns:w16cid",value:"http://schemas.microsoft.com/office/word/2016/wordml/cid"},w16:{key:"xmlns:w16",value:"http://schemas.microsoft.com/office/word/2018/wordml"},w16sdtdh:{key:"xmlns:w16sdtdh",value:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash"},w16se:{key:"xmlns:w16se",value:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Ignorable:{key:"mc:Ignorable",value:"w14 w15 w16se w16cid w16 w16cex w16sdtdh"}},children:e.map(q1)}),U1=[{option:"data",element:"embedRegular",bold:!1,italic:!1},{option:"bold",element:"embedBold",bold:!0,italic:!1},{option:"italic",element:"embedItalic",bold:!1,italic:!0},{option:"boldItalic",element:"embedBoldItalic",bold:!0,italic:!0}],Km=class{constructor(e){E(this,"options",void 0),E(this,"fontTable",void 0),E(this,"relationships",void 0),E(this,"fontOptionsWithKey",[]),E(this,"files",[]),this.options=e;let t=e.map(n=>U1.flatMap(({option:r,element:i,bold:s,italic:a})=>{let o=n[r];return o?[{element:i,file:{name:n.name,data:o,bold:s,italic:a,fontKey:bm()}}]:[]}));this.files=t.flatMap(n=>n.map(({file:r})=>r)),this.fontOptionsWithKey=e.map((n,r)=>k(k({},n),{},{fontKey:t[r][0].file.fontKey})),this.fontTable=H1(e.map((n,r)=>k({name:n.name,characterSet:n.characterSet},Object.fromEntries(t[r].map(({element:i,file:s})=>[i,{id:`rId${this.files.indexOf(s)+1}`,fontKey:s.fontKey}]))))),this.relationships=new be;for(let n=0;n<this.files.length;n++)this.relationships.addRelationship(n+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",`fonts/font${n+1}.odttf`)}get View(){return this.fontTable}get Relationships(){return this.relationships}},j1=()=>new L({name:"w:wordWrap",attributes:{val:{key:"w:val",value:0}}}),W1=e=>{var t,n;return new L({name:"w:framePr",attributes:{anchorLock:{key:"w:anchorLock",value:e.anchorLock},dropCap:{key:"w:dropCap",value:e.dropCap},width:{key:"w:w",value:e.width},height:{key:"w:h",value:e.height},x:{key:"w:x",value:e.position?e.position.x:void 0},y:{key:"w:y",value:e.position?e.position.y:void 0},anchorHorizontal:{key:"w:hAnchor",value:e.anchor.horizontal},anchorVertical:{key:"w:vAnchor",value:e.anchor.vertical},spaceHorizontal:{key:"w:hSpace",value:(t=e.space)===null||t===void 0?void 0:t.horizontal},spaceVertical:{key:"w:vSpace",value:(n=e.space)===null||n===void 0?void 0:n.vertical},rule:{key:"w:hRule",value:e.rule},alignmentX:{key:"w:xAlign",value:e.alignment?e.alignment.x:void 0},alignmentY:{key:"w:yAlign",value:e.alignment?e.alignment.y:void 0},lines:{key:"w:lines",value:e.lines},wrap:{key:"w:wrap",value:e.wrap}}})},al=new WeakMap,K1=Bn(),G1={left:"right",right:"left"},Mn=class extends St{constructor(e,{implicitListParagraphStyle:t=!0,inListOrder:n=!0}={}){if(super("w:pPr",e?.includeIfEmpty),E(this,"numbering",void 0),E(this,"numberProperties",void 0),!e)return this;if(e.heading&&this.push(Nr(e.heading)),t&&(e.bullet&&this.push(Nr("ListParagraph")),e.numbering&&!e.numbering.custom&&!e.style&&!e.heading&&this.push(Nr("ListParagraph"))),e.style&&this.push(Nr(e.style)),e.keepNext!==void 0&&this.push(new I("w:keepNext",e.keepNext)),e.keepLines!==void 0&&this.push(new I("w:keepLines",e.keepLines)),e.pageBreakBefore&&this.push(new S1),e.frame&&this.push(W1(e.frame)),e.widowControl!==void 0&&this.push(new I("w:widowControl",e.widowControl)),e.bullet&&this.push(new Ts(1,e.bullet.level)),e.numbering){let{reference:i,instance:s,level:a,restart:o}=e.numbering,c=typeof i=="string"?i:i.reference,l=new Ts(Bs(c,s??0),a);this.numbering={reference:c,level:a,instance:s,restartedListId:o&&n&&s===void 0?K1():void 0,definition:typeof i=="string"?void 0:i},this.numberProperties=l,this.push(l)}else e.numbering===!1&&this.push(new Ts(0,0));e.border&&this.push(new Rx(e.border)),e.thematicBreak&&this.push(new Lx),e.shading&&this.push(zs(e.shading)),e.wordWrap&&this.push(j1()),e.overflowPunctuation&&this.push(new I("w:overflowPunct",e.overflowPunctuation));let r=[...e.rightTabStop!==void 0?[{type:rh.RIGHT,position:e.rightTabStop}]:[],...e.tabStops?e.tabStops:[],...e.leftTabStop!==void 0?[{type:rh.LEFT,position:e.leftTabStop}]:[]];r.length>0&&this.push(_1(r)),e.bidirectional!==void 0&&this.push(new I("w:bidi",e.bidirectional)),e.spacing&&this.push(C1(e.spacing)),e.indent&&this.push(Dx(e.indent)),e.contextualSpacing!==void 0&&this.push(new I("w:contextualSpacing",e.contextualSpacing)),e.alignment&&this.push(dm(e.bidirectional&&G1[e.alignment]||e.alignment)),e.outlineLevel!==void 0&&this.push(D1(e.outlineLevel)),e.suppressLineNumbers!==void 0&&this.push(new I("w:suppressLineNumbers",e.suppressLineNumbers)),e.autoSpaceEastAsianText!==void 0&&this.push(new I("w:autoSpaceDN",e.autoSpaceEastAsianText)),e.run&&this.push(new vk(e.run)),e.revision&&this.push(new ih(e.revision))}push(e){this.root.push(e)}addSectionProperties(e){let t=this.root.findIndex(n=>n instanceof ih);if(t===-1){this.root.push(e);return}this.root.splice(t,0,e)}removeSectionProperties(e){let t=this.root.indexOf(e);t!==-1&&this.root.splice(t,1)}prepForXml(e){var t;if(this.numbering){var n,r;let{reference:a,level:o,instance:c=0,definition:l}=this.numbering,u=this.numbering.instance===void 0?(n=this.numbering.restartedListId)!==null&&n!==void 0?n:(r=al.get(e))===null||r===void 0?void 0:r.get(a):void 0;e.viewWrapper instanceof Km||e.file.Numbering.createConcreteNumberingInstance(a,c,l,u);let d=new Ts(Bs(a,c,u),o);this.root.splice(this.root.indexOf(this.numberProperties),1,d),this.numberProperties=d}let i=super.prepForXml(e);if(((t=this.numbering)===null||t===void 0?void 0:t.restartedListId)!==void 0){var s;al.set(e,new Map([...(s=al.get(e))!==null&&s!==void 0?s:[],[this.numbering.reference,this.numbering.restartedListId]]))}return i}},ih=class extends P{constructor(e){super("w:pPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new Mn(k(k({},e),{},{includeIfEmpty:!0}),{inListOrder:!1}))}},ne=class Gm extends hc{constructor(t){if(super("w:p"),E(this,"options",void 0),E(this,"properties",void 0),E(this,"alignment",void 0),this.options=typeof t=="string"?{text:t}:t,typeof t=="string")return this.alignment={},this.properties=new Mn({}),this.root.push(this.properties),this.root.push(new Oe(t)),this;if(this.alignment={alignment:t.alignment,bidirectional:t.bidirectional},this.properties=new Mn(t),this.root.push(this.properties),t.text&&this.root.push(new Oe(t.text)),t.children)for(let n of t.children){if(n instanceof qm){this.root.push(...n.writtenAs);continue}this.root.push(n)}}prepForXml(t){for(let n of this.root)if(Ws(n)==="w:externalHyperlink"){let r=this.root.indexOf(n),{options:i}=n,{target:s,anchor:a}=Wm(i.link),o=new mc(i.children,$n(),a,i.link);t.viewWrapper.Relationships.addRelationship(o.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",s,oc.EXTERNAL),this.root[r]=o}return super.prepForXml(t)}addSectionProperties(t){this.properties.addSectionProperties(t)}removeSectionProperties(t){this.properties.removeSectionProperties(t)}get Alignment(){return this.alignment}with(t){return new Gm(k(k({},this.options),t))}addRunToFront(t){return this.root.splice(1,0,t),this}},z1={TOP:"top",CENTER:"center",BOTTOM:"bottom"},ZP=k(k({},z1),{},{BOTH:"both"}),zm=e=>new L({name:"w:vAlign",attributes:{verticalAlign:{key:"w:val",value:e}}}),V1=({space:e,count:t,separate:n,equalWidth:r,children:i})=>new L({name:"w:cols",attributes:{space:{key:"w:space",value:e===void 0?void 0:ve(e)},count:{key:"w:num",value:t===void 0?void 0:le(t)},separate:{key:"w:sep",value:n},equalWidth:{key:"w:equalWidth",value:r}},children:!r&&i?i:void 0}),X1=({type:e,linePitch:t,charSpace:n})=>new L({name:"w:docGrid",attributes:{type:{key:"w:type",value:e},linePitch:{key:"w:linePitch",value:le(t)},charSpace:{key:"w:charSpace",value:n?le(n):void 0}}}),Ln={DEFAULT:"default",FIRST:"first",EVEN:"even"},sh={HEADER:"w:headerReference",FOOTER:"w:footerReference"},ol=(e,t)=>new L({name:e,attributes:{type:{key:"w:type",value:t.type||Ln.DEFAULT},id:{key:"r:id",value:`rId${t.id}`}}}),Y1=({countBy:e,start:t,restart:n,distance:r})=>new L({name:"w:lnNumType",attributes:{countBy:{key:"w:countBy",value:e===void 0?void 0:le(e)},start:{key:"w:start",value:t===void 0?void 0:le(t)},restart:{key:"w:restart",value:n},distance:{key:"w:distance",value:r===void 0?void 0:ve(r)}}}),Vm=({name:e,position:t,numberFormat:n,start:r,restart:i})=>new L({name:e,children:[...t===void 0?[]:[new L({name:"w:pos",attributes:{val:{key:"w:val",value:t}}})],...n?[new L({name:"w:numFmt",attributes:{val:{key:"w:val",value:n.type},format:{key:"w:format",value:n.format}}})]:[],...r===void 0?[]:[new L({name:"w:numStart",attributes:{val:{key:"w:val",value:le(r)}}})],...i===void 0?[]:[new L({name:"w:numRestart",attributes:{val:{key:"w:val",value:i}}})]]}),J1=e=>Vm(k({name:"w:footnotePr"},e)),Q1=e=>Vm(k({name:"w:endnotePr"},e)),ah=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{display:"w:display",offsetFrom:"w:offsetFrom",zOrder:"w:zOrder"})}},Z1=class extends St{constructor(e){if(super("w:pgBorders"),!e)return this;e.pageBorders?this.root.push(new ah({display:e.pageBorders.display,offsetFrom:e.pageBorders.offsetFrom,zOrder:e.pageBorders.zOrder})):this.root.push(new ah({})),e.pageBorderTop&&this.root.push(he("w:top",e.pageBorderTop)),e.pageBorderLeft&&this.root.push(he("w:left",e.pageBorderLeft)),e.pageBorderBottom&&this.root.push(he("w:bottom",e.pageBorderBottom)),e.pageBorderRight&&this.root.push(he("w:right",e.pageBorderRight))}},eT=(e,t,n,r,i,s,a)=>new L({name:"w:pgMar",attributes:{top:{key:"w:top",value:at(e)},right:{key:"w:right",value:ve(t)},bottom:{key:"w:bottom",value:at(n)},left:{key:"w:left",value:ve(r)},header:{key:"w:header",value:ve(i)},footer:{key:"w:footer",value:ve(s)},gutter:{key:"w:gutter",value:ve(a)}}}),tT={HYPHEN:"hyphen",PERIOD:"period",COLON:"colon",EM_DASH:"emDash",EN_DASH:"endash"},nT=({start:e,formatType:t,separator:n,chapterHeadingLevel:r})=>new L({name:"w:pgNumType",attributes:{start:{key:"w:start",value:e===void 0?void 0:le(e)},formatType:{key:"w:fmt",value:t},separator:{key:"w:chapSep",value:n===tT.EN_DASH?"enDash":n},chapterHeadingLevel:{key:"w:chapStyle",value:r===void 0?void 0:le(r)}}}),$s={PORTRAIT:"portrait",LANDSCAPE:"landscape"},rT=({width:e,height:t,orientation:n,code:r})=>{let i=ve(e),s=ve(t);return new L({name:"w:pgSz",attributes:{width:{key:"w:w",value:n===$s.LANDSCAPE?s:i},height:{key:"w:h",value:n===$s.LANDSCAPE?i:s},orientation:{key:"w:orient",value:n},code:{key:"w:code",value:r}}})},iT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},sT=class extends P{constructor(e){super("w:textDirection"),this.root.push(new iT({val:e}))}},aT=e=>new L({name:"w:type",attributes:{val:{key:"w:val",value:e}}}),it={TOP:1440,RIGHT:1440,BOTTOM:1440,LEFT:1440,HEADER:708,FOOTER:708,GUTTER:0},Ns={WIDTH:11906,HEIGHT:16838,ORIENTATION:$s.PORTRAIT},Rl=class Xm extends P{constructor({page:{size:{width:t=Ns.WIDTH,height:n=Ns.HEIGHT,orientation:r=Ns.ORIENTATION,code:i}={},margin:{top:s=it.TOP,right:a=it.RIGHT,bottom:o=it.BOTTOM,left:c=it.LEFT,header:l=it.HEADER,footer:u=it.FOOTER,gutter:d=it.GUTTER}={},pageNumbers:p={},borders:h,textDirection:f}={},grid:{linePitch:m=360,charSpace:g,type:y}={},headerWrapperGroup:T={},footerWrapperGroup:b={},lineNumbers:C,titlePage:_,verticalAlign:w,column:x,type:v,footnoteProperties:A,endnoteProperties:N,revision:D}={}){super("w:sectPr"),E(this,"availableTextWidth",void 0),this.availableTextWidth=Xm.calculateAvailableTextWidth({pageWidth:r===$s.LANDSCAPE?n:t,left:c,right:a,gutter:d,column:x}),this.addHeaderFooterGroup(sh.HEADER,T),this.addHeaderFooterGroup(sh.FOOTER,b),A&&this.root.push(J1(A)),N&&this.root.push(Q1(N)),v&&this.root.push(aT(v)),this.root.push(rT({width:t,height:n,orientation:r,code:i})),this.root.push(eT(s,a,o,c,l,u,d)),h&&this.root.push(new Z1(h)),C&&this.root.push(Y1(C)),this.root.push(nT(p)),x&&this.root.push(V1(x)),w&&this.root.push(zm(w)),_!==void 0&&this.root.push(new I("w:titlePg",_)),f&&this.root.push(new sT(f)),this.root.push(X1({linePitch:m,charSpace:g,type:y})),D&&this.root.push(new oT(D))}get AvailableTextWidth(){return this.availableTextWidth}static calculateAvailableTextWidth({pageWidth:t,left:n,right:r,gutter:i,column:s}){var a,o;let c=qt(t)-qt(n)-qt(r)-qt(i),l=(a=s?.count)!==null&&a!==void 0?a:1;return l<=1?c:(c-qt((o=s?.space)!==null&&o!==void 0?o:720)*(l-1))/l}addHeaderFooterGroup(t,n){n.default&&this.root.push(ol(t,{type:Ln.DEFAULT,id:n.default.View.ReferenceId})),n.first&&this.root.push(ol(t,{type:Ln.FIRST,id:n.first.View.ReferenceId})),n.even&&this.root.push(ol(t,{type:Ln.EVEN,id:n.even.View.ReferenceId}))}},oT=class extends P{constructor(e){super("w:sectPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new Rl(e))}},Ym=class extends P{constructor({pageNumbers:e}={}){super("w:body"),E(this,"sections",[]),E(this,"sectionParagraphs",new Map),E(this,"headingBookmarkIds",new Fk),E(this,"pageNumbers",void 0),this.pageNumbers=e}getSectionPropertiesFor(e){let t=e?Math.max(this.root.indexOf(e),0):0;for(let n=t;n<this.root.length;n++){let r=this.root[n];if(r instanceof Rl)return r;let i=this.sectionParagraphs.get(r);if(i)return i}return this.sections[this.sections.length-1]}addSection(e){let t=this.sections.pop(),n=this.lastParagraphOfSection();if(t&&n)this.sectionParagraphs.set(n,t);else{let r=this.createSectionParagraph();this.root.push(r),t&&this.sectionParagraphs.set(r,t)}this.sections.push(new Rl(e))}prepForXml(e){var t;this.sections.length===1&&(this.root.splice(0,1),this.root.push(this.sections.pop()));for(let[i,s]of this.sectionParagraphs)i.addSectionProperties(s);let n;try{n=super.prepForXml(e)}finally{for(let[i,s]of this.sectionParagraphs)i.removeSectionProperties(s)}let r=(t=this.pageNumbers)===null||t===void 0?void 0:t.listNumbers;return e1(n,e,this.headingBookmarkIds,r&&(i=>r(i,e))),this.pageNumbers&&(a1(n,e),o1(n,e,this.pageNumbers)),n}push(e){let t=e instanceof ne?this.sectionParagraphs.get(e):void 0;if(t){let n=this.createSectionParagraph();this.root.splice(this.root.indexOf(e)+1,0,n),this.sectionParagraphs.delete(e),this.sectionParagraphs.set(n,t)}this.root.push(e)}lastParagraphOfSection(){let e=this.root[this.root.length-1];return e instanceof ne&&e!==this.root[0]&&!this.sectionParagraphs.has(e)&&this.root.indexOf(e)===this.root.length-1?e:void 0}createSectionParagraph(){return new ne({})}},Fe={AUTO:"auto",DXA:"dxa",NIL:"nil",PERCENTAGE:"pct"},$r=(e,{type:t=Fe.AUTO,size:n})=>{let r=n;return t===Fe.PERCENTAGE&&typeof n=="number"&&(r=Math.round(n*50)),new L({name:e,attributes:{type:{key:"w:type",value:t},size:{key:"w:w",value:lm(r)}}})},Ps=Ns.WIDTH-it.LEFT-it.RIGHT-it.GUTTER,Jm=e=>e.options.columnSpan||1,fc=(e,t)=>{if(!e)return;let{type:n=Fe.AUTO,size:r}=e;if(n!==Fe.PERCENTAGE&&n!==Fe.DXA)return;let i=typeof r=="number"?n===Fe.PERCENTAGE?r/100*t:r:r.endsWith("%")?Number(r.slice(0,-1))/100*t:qt(r);return i>0?i:void 0},lT=(e,t)=>{var n;return(n=fc(e,t))!==null&&n!==void 0?n:t},cT=e=>Math.max(0,...e.map(t=>t.cells.reduce((n,r)=>n+Jm(r),0))),oh=({rows:e,width:t,availableWidth:n})=>{let r=cT(e);if(r===0)return[];let i=lT(t,n),s=Array.from({length:r},()=>{}),a=[];for(let u of e){let d=0;for(let p of u.cells){let h=Jm(p),f=fc(p.options.width,i);if(f!==void 0)if(h===1){var o,c;(c=s[o=d])!==null&&c!==void 0||(s[o]=f)}else a.push({start:d,span:h,width:f});d+=h}}for(let{start:u,span:d,width:p}of a){let h=Array.from({length:d},(g,y)=>u+y).filter(g=>g<r),f=h.filter(g=>s[g]===void 0),m=p-h.reduce((g,y)=>{var T;return g+((T=s[y])!==null&&T!==void 0?T:0)},0);if(f.length>0&&m>0)for(let g of f)s[g]=m/f.length}let l=s.flatMap((u,d)=>u===void 0?[d]:[]);if(l.length>0){let u=i-s.reduce((p,h)=>p+(h??0),0),d=u>0?u/l.length:i/r;for(let p of l)s[p]=d}return s.map(u=>Math.round(u))},dT=e=>new L({name:"w:gridCol",attributes:e!==void 0?{width:{key:"w:w",value:ve(e)}}:void 0}),Is=class extends P{constructor(e,t){super("w:tblGrid");for(let n of e)this.root.push(dT(n));t&&this.root.push(new uT(t))}},pT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id"})}},uT=class extends P{constructor(e){super("w:tblGridChange"),this.root.push(new pT({id:e.id})),this.root.push(new Is(e.columnWidths))}},hT=class extends P{constructor(e){super("w:ins"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},mT=class extends P{constructor(e){super("w:del"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},fT=class extends P{constructor(e){super("w:cellIns"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},gT=class extends P{constructor(e){super("w:cellDel"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},bT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date",verticalMerge:"w:vMerge",verticalMergeOriginal:"w:vMergeOrig"})}},vT=class extends P{constructor(e){super("w:cellMerge"),this.root.push(new bT(e))}},Qm=({marginUnitType:e=Fe.DXA,top:t,left:n,bottom:r,right:i})=>[{name:"w:top",size:t},{name:"w:left",size:n},{name:"w:bottom",size:r},{name:"w:right",size:i}].filter(s=>s.size!==void 0).map(({name:s,size:a})=>$r(s,{type:e,size:a})),wT=e=>{let t=Qm(e);if(t.length!==0)return new L({name:"w:tblCellMar",children:t})},yT=e=>{let t=Qm(e);if(t.length!==0)return new L({name:"w:tcMar",children:t})},xT=class extends St{constructor(e){super("w:tcBorders"),e.top&&this.root.push(he("w:top",e.top)),e.start&&this.root.push(he("w:start",e.start)),e.left&&this.root.push(he("w:left",e.left)),e.bottom&&this.root.push(he("w:bottom",e.bottom)),e.end&&this.root.push(he("w:end",e.end)),e.right&&this.root.push(he("w:right",e.right)),e.diagonalDown&&this.root.push(he("w:tl2br",e.diagonalDown)),e.diagonalUp&&this.root.push(he("w:tr2bl",e.diagonalUp))}},kT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},TT=class extends P{constructor(e){super("w:gridSpan"),this.root.push(new kT({val:le(e)}))}},Zm={CONTINUE:"continue",RESTART:"restart"},ST=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},lh=class extends P{constructor(e){super("w:vMerge"),this.root.push(new ST({val:e}))}},CT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},ET=class extends P{constructor(e){super("w:textDirection"),this.root.push(new CT({val:e}))}},ef=class extends St{constructor(e){if(super("w:tcPr",e.includeIfEmpty),E(this,"hasWidth",void 0),E(this,"hasColumnWidth",!1),this.hasWidth=e.width!==void 0,e.width&&this.root.push($r("w:tcW",e.width)),e.columnSpan&&this.root.push(new TT(e.columnSpan)),e.verticalMerge?this.root.push(new lh(e.verticalMerge)):e.rowSpan&&e.rowSpan>1&&this.root.push(new lh(Zm.RESTART)),e.borders&&this.root.push(new xT(e.borders)),e.shading&&this.root.push(zs(e.shading)),e.margins){let t=yT(e.margins);t&&this.root.push(t)}e.textDirection&&this.root.push(new ET(e.textDirection)),e.verticalAlign&&this.root.push(zm(e.verticalAlign)),e.insertion&&this.root.push(new fT(e.insertion)),e.deletion&&this.root.push(new gT(e.deletion)),e.cellMerge&&this.root.push(new vT(e.cellMerge)),e.revision&&this.root.push(new AT(e.revision))}setColumnWidth(e){this.hasWidth||(this.root.splice(0,this.hasColumnWidth?1:0,$r("w:tcW",{size:e,type:Fe.DXA})),this.hasColumnWidth=!0)}},AT=class extends P{constructor(e){super("w:tcPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new ef(k(k({},e),{},{includeIfEmpty:!0})))}},Fr=class extends P{constructor(e){super("w:tc"),E(this,"options",void 0),E(this,"properties",void 0),this.options=e,this.properties=new ef(e),this.root.push(this.properties);for(let t of e.children)this.root.push(t)}setColumnWidth(e){this.properties.setColumnWidth(e)}prepForXml(e){return Ws(this.root[this.root.length-1])!=="w:p"&&this.root.push(new ne({})),super.prepForXml(e)}},Ll=(e,t)=>t?new I(e):new ot(e,"off"),In={style:Gr.NONE,size:0,color:"auto"},_T={style:Gr.SINGLE,size:4,color:"auto"},tf=class extends St{constructor(e,{fillMissingSides:t=!0}={}){super("w:tblBorders");let n=[["w:top",e.top],["w:left",e.left],["w:bottom",e.bottom],["w:right",e.right],["w:insideH",e.insideHorizontal],["w:insideV",e.insideVertical]];for(let[r,i]of n){let s=i??(t?_T:void 0);s&&this.root.push(he(r,s))}}};E(tf,"NONE",{top:In,bottom:In,left:In,right:In,insideHorizontal:In,insideVertical:In});ll={CENTER:"center",INSIDE:"inside",LEFT:"left",OUTSIDE:"outside",RIGHT:"right"},NT={CENTER:"center",INSIDE:"inside",BOTTOM:"bottom",OUTSIDE:"outside",INLINE:"inline",TOP:"top"},PT=({horizontalAnchor:e,verticalAnchor:t,absoluteHorizontalPosition:n,relativeHorizontalPosition:r,absoluteVerticalPosition:i,relativeVerticalPosition:s,bottomFromText:a,topFromText:o,leftFromText:c,rightFromText:l})=>new L({name:"w:tblpPr",attributes:{leftFromText:{key:"w:leftFromText",value:c===void 0?void 0:ve(c)},rightFromText:{key:"w:rightFromText",value:l===void 0?void 0:ve(l)},topFromText:{key:"w:topFromText",value:o===void 0?void 0:ve(o)},bottomFromText:{key:"w:bottomFromText",value:a===void 0?void 0:ve(a)},absoluteHorizontalPosition:{key:"w:tblpX",value:n===void 0?void 0:at(n)},absoluteVerticalPosition:{key:"w:tblpY",value:i===void 0?void 0:at(i)},horizontalAnchor:{key:"w:horzAnchor",value:e},relativeHorizontalPosition:{key:"w:tblpXSpec",value:r},relativeVerticalPosition:{key:"w:tblpYSpec",value:s},verticalAnchor:{key:"w:vertAnchor",value:t}}}),IT=e=>new L({name:"w:tblLayout",attributes:{type:{key:"w:type",value:e}}}),OT={DXA:"dxa",NIL:"nil"},nf=({type:e=OT.DXA,value:t})=>new L({name:"w:tblCellSpacing",attributes:{type:{key:"w:type",value:e},value:{key:"w:w",value:lm(t)}}}),RT=({firstRow:e,lastRow:t,firstColumn:n,lastColumn:r,noHBand:i,noVBand:s})=>new L({name:"w:tblLook",attributes:{firstRow:{key:"w:firstRow",value:e},lastRow:{key:"w:lastRow",value:t},firstColumn:{key:"w:firstColumn",value:n},lastColumn:{key:"w:lastColumn",value:r},noHBand:{key:"w:noHBand",value:i},noVBand:{key:"w:noVBand",value:s}}}),LT=e=>new L({name:"w:tblOverlap",attributes:{val:{key:"w:val",value:e}}}),DT={[ll.LEFT]:ue.LEFT,[ll.CENTER]:ue.CENTER,[ll.RIGHT]:ue.RIGHT},gc=class extends St{constructor(e){var t,n,r;super("w:tblPr",e.includeIfEmpty),e.style&&this.root.push(new ot("w:tblStyle",e.style));let i=((t=e.float)===null||t===void 0?void 0:t.relativeVerticalPosition)===NT.INLINE,s=i?void 0:e.float;s&&this.root.push(PT(s)),s?.overlap&&this.root.push(LT(s.overlap)),e.visuallyRightToLeft!==void 0&&this.root.push(Ll("w:bidiVisual",e.visuallyRightToLeft)),e.width&&this.root.push($r("w:tblW",e.width));let a=(n=e.alignment)!==null&&n!==void 0?n:i&&(!((r=e.float)===null||r===void 0)&&r.relativeHorizontalPosition)?DT[e.float.relativeHorizontalPosition]:void 0;if(a&&this.root.push(dm(a)),e.cellSpacing&&this.root.push(nf(e.cellSpacing)),e.indent&&this.root.push($r("w:tblInd",e.indent)),e.borders&&this.root.push(new tf(e.borders,{fillMissingSides:!e.style})),e.shading&&this.root.push(zs(e.shading)),e.layout&&this.root.push(IT(e.layout)),e.cellMargin){let o=wT(e.cellMargin);o&&this.root.push(o)}e.tableLook&&this.root.push(RT(e.tableLook)),e.revision&&this.root.push(new MT(e.revision))}},MT=class extends P{constructor(e){super("w:tblPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new gc(k(k({},e),{},{includeIfEmpty:!0})))}},BT=(e,t)=>new L({name:"w:trHeight",attributes:{value:{key:"w:val",value:ve(e)},rule:{key:"w:hRule",value:t}}}),rf=class extends St{constructor(e){super("w:trPr",e.includeIfEmpty),e.cantSplit!==void 0&&this.root.push(Ll("w:cantSplit",e.cantSplit)),e.tableHeader!==void 0&&this.root.push(Ll("w:tblHeader",e.tableHeader)),e.height&&this.root.push(BT(e.height.value,e.height.rule)),e.cellSpacing&&this.root.push(nf(e.cellSpacing)),e.insertion&&this.root.push(new hT(e.insertion)),e.deletion&&this.root.push(new mT(e.deletion)),e.revision&&this.root.push(new $T(e.revision))}},$T=class extends P{constructor(e){super("w:trPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new rf(k(k({},e),{},{includeIfEmpty:!0})))}},Fs=(e,t)=>{let n=e[t];return Array.isArray(n)?n:[]},Ir=e=>Object.keys(e)[0],FT=(e,t)=>{let n=Fs(e,"w:p"),r=n.find(o=>Ir(o)==="w:pPr");if(!r)return{"w:p":[{"w:pPr":[t]},...n]};let i=Fs(r,"w:pPr");if(i.some(o=>Ir(o)==="w:keepNext"))return e;let s=i.filter(o=>Ir(o)==="w:pStyle").length,a={"w:pPr":[...i.slice(0,s),t,...i.slice(s)]};return{"w:p":n.map(o=>o===r?a:o)}},Js=class extends P{constructor(e){super("w:tr"),E(this,"options",void 0),this.options=e,this.root.push(new rf(e));for(let t of e.children)this.root.push(t)}prepForXml(e){if(this.cells.length===0)return;let t=super.prepForXml(e);if(!t||this.options.keepNext===void 0)return t;let n=new I("w:keepNext",this.options.keepNext).prepForXml(e);return{"w:tr":Fs(t,"w:tr").map(r=>Ir(r)==="w:tc"?{"w:tc":Fs(r,"w:tc").map(i=>Ir(i)==="w:p"?FT(i,n):i)}:r)}}get CellCount(){return this.options.children.length}get cells(){return this.root.filter(e=>Ws(e)==="w:tc")}addCellToIndex(e,t){this.root.splice(t+1,0,e)}addCellToColumnIndex(e,t){let n=this.columnIndexToRootIndex(t,!0);this.addCellToIndex(e,n-1)}rootIndexToColumnIndex(e){if(e<1||e>=this.root.length)throw new Error(`cell 'rootIndex' should between 1 to ${this.root.length-1}`);let t=0;for(let n=1;n<e;n++){let r=this.root[n];t+=r.options.columnSpan||1}return t}columnIndexToRootIndex(e,t=!1){if(e<0)throw new Error("cell 'columnIndex' should not less than zero");let n=0,r=1;for(;n<=e;){if(r>=this.root.length){if(t)return this.root.length;throw new Error(`cell 'columnIndex' should not great than ${n-1}`)}let i=this.root[r];r+=1,n+=i&&i.options.columnSpan||1}return r-1}},sf=class af extends hc{constructor({rows:t,width:n,columnWidths:r,columnWidthsRevision:i,margins:s,indent:a,float:o,layout:c,style:l,borders:u,alignment:d,visuallyRightToLeft:p,tableLook:h,cellSpacing:f,revision:m}){super("w:tbl"),E(this,"rows",void 0),E(this,"width",void 0),E(this,"columnWidths",void 0),E(this,"columnWidthsRevision",void 0),E(this,"resolvedColumnWidths",void 0),this.rows=t,this.width=n??{size:100},this.columnWidths=r,this.columnWidthsRevision=i,t.forEach((g,y)=>{if(y===t.length-1)return;let T=0;g.cells.forEach(b=>{if(b.options.rowSpan&&b.options.rowSpan>1){let C=b.options.children[b.options.children.length-1],_=new Fr({rowSpan:b.options.rowSpan-1,columnSpan:b.options.columnSpan,width:b.options.width,borders:b.options.borders,shading:b.options.shading,margins:b.options.margins,textDirection:b.options.textDirection,verticalAlign:b.options.verticalAlign,children:C instanceof ne?[new ne(C.Alignment)]:[],verticalMerge:Zm.CONTINUE});t[y+1].addCellToColumnIndex(_,T)}T+=b.options.columnSpan||1})}),this.setCellWidths(Ps),this.resolvedColumnWidths=r??oh({rows:t,width:this.width,availableWidth:Ps}),this.root.push(new gc({borders:l?u:u??{},width:this.width,indent:a,float:o,layout:c,style:l,alignment:d,cellMargin:s,visuallyRightToLeft:p,tableLook:h,cellSpacing:f,revision:m})),this.root.push(new Is(this.resolvedColumnWidths,i));for(let g of t)this.root.push(g)}get ColumnWidths(){return this.resolvedColumnWidths}getCellWidth(t,n){let{cells:r}=t,i=r.indexOf(n);if(i===-1)return;let s=r.slice(0,i).reduce((o,c)=>o+(c.options.columnSpan||1),0),a=this.resolvedColumnWidths.slice(s,s+(n.options.columnSpan||1));return a.length===0?void 0:a.reduce((o,c)=>o+c,0)}prepForXml(t){if(this.setCellWidths(this.resolveAvailableWidth(t)),this.columnWidths===void 0){this.resolvedColumnWidths=oh({rows:this.rows,width:this.width,availableWidth:this.resolveAvailableWidth(t)});let n=this.root.findIndex(r=>r instanceof Is);this.root[n]=new Is(this.resolvedColumnWidths,this.columnWidthsRevision)}return super.prepForXml(t)}setCellWidths(t){var n;if(this.columnWidths===void 0)return;let r=this.columnWidths.reduce((a,o)=>a+o,0),i=(n=fc(this.width,t))!==null&&n!==void 0?n:0,s=r>0&&i>r?i/r:1;for(let a of this.rows){let o=0;for(let c of a.cells){let l=c.options.columnSpan||1,u=this.columnWidths.slice(o,o+l),d=Math.round(u.reduce((p,h)=>p+h,0)*s);u.length===l&&d>0&&c.setColumnWidth(d),o+=l}}}resolveAvailableWidth(t){var n,r,i;let{stack:s}=t,a=s[s.length-1],o=s[s.length-2],c=s[s.length-3];if(a instanceof Fr&&o instanceof Js&&c instanceof af){let p=c.getCellWidth(o,a);if(p!==void 0)return p}let l=s.findIndex(p=>p instanceof Ym),u=(n=t.file)===null||n===void 0||(n=n.Document)===null||n===void 0?void 0:n.View.Body,d=l>=0?s[l].getSectionPropertiesFor((r=s[l+1])!==null&&r!==void 0?r:this):u?.getSectionPropertiesFor();return(i=d?.AvailableTextWidth)!==null&&i!==void 0?i:Ps}},qT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},HT=class extends P{constructor(){super("Properties"),this.root.push(new qT({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}))}},UT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns"})}},wt=(e,t)=>new L({name:"Default",attributes:{contentType:{key:"ContentType",value:e},extension:{key:"Extension",value:t}}}),ge=(e,t)=>new L({name:"Override",attributes:{contentType:{key:"ContentType",value:e},partName:{key:"PartName",value:t}}}),jT=class extends P{constructor({macros:e=!1}={}){super("Types"),this.root.push(new UT({xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"})),this.root.push(wt("image/png","png")),this.root.push(wt("image/jpeg","jpeg")),this.root.push(wt("image/jpeg","jpg")),this.root.push(wt("image/bmp","bmp")),this.root.push(wt("image/gif","gif")),this.root.push(wt("image/svg+xml","svg")),this.root.push(wt("application/vnd.openxmlformats-package.relationships+xml","rels")),this.root.push(wt("application/xml","xml")),this.root.push(wt("application/vnd.openxmlformats-officedocument.obfuscatedFont","odttf")),this.root.push(ge(e?"application/vnd.ms-word.document.macroEnabled.main+xml":"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","/word/document.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml","/word/styles.xml")),this.root.push(ge("application/vnd.openxmlformats-package.core-properties+xml","/docProps/core.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.custom-properties+xml","/docProps/custom.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.extended-properties+xml","/docProps/app.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml","/word/numbering.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","/word/footnotes.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml","/word/endnotes.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml","/word/settings.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml","/word/fontTable.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.theme+xml","/word/theme/theme1.xml")),e&&this.root.push(ge("application/vnd.ms-office.vbaProject","/word/vbaProject.bin"))}addComments(){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml","/word/comments.xml"))}addCommentsExtended(){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml","/word/commentsExtended.xml"))}addCommentsIds(){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml","/word/commentsIds.xml"))}addFooter(e){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",`/word/footer${e}.xml`))}addOverride(e,t){this.root.push(ge(e,t))}addHeader(e){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",`/word/header${e}.xml`))}},Dl={wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",aink:"http://schemas.microsoft.com/office/drawing/2016/ink",am3d:"http://schemas.microsoft.com/office/drawing/2017/model3d",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16:"http://schemas.microsoft.com/office/word/2018/wordml",w16sdtdh:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Qs=class extends H{constructor(e,t){super(k({Ignorable:t},Object.fromEntries(e.map(n=>[n,Dl[n]])))),E(this,"xmlKeys",k({Ignorable:"mc:Ignorable"},Object.fromEntries(Object.keys(Dl).map(n=>[n,`xmlns:${n}`]))))}},WT=class extends P{constructor(e){super("cp:coreProperties"),this.root.push(new Qs(["cp","dc","dcterms","dcmitype","xsi"])),e.title&&this.root.push(new nn("dc:title",e.title)),e.subject&&this.root.push(new nn("dc:subject",e.subject)),e.creator&&this.root.push(new nn("dc:creator",e.creator)),e.keywords&&this.root.push(new nn("cp:keywords",e.keywords)),e.description&&this.root.push(new nn("dc:description",e.description)),e.lastModifiedBy&&this.root.push(new nn("cp:lastModifiedBy",e.lastModifiedBy)),e.revision&&this.root.push(new nn("cp:revision",String(e.revision))),this.root.push(new ch("dcterms:created")),this.root.push(new ch("dcterms:modified"))}},KT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"xsi:type"})}},ch=class extends P{constructor(e){super(e),this.root.push(new KT({type:"dcterms:W3CDTF"})),this.root.push(yx(new Date))}},GT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},zT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{formatId:"fmtid",pid:"pid",name:"name"})}},VT=class extends P{constructor(e,t){super("property"),this.root.push(new zT({formatId:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:e.toString(),name:t.name})),this.root.push(new XT(t.value))}},XT=class extends P{constructor(e){super("vt:lpwstr"),this.root.push(e)}},YT=class extends P{constructor(e){super("Properties"),E(this,"nextId",void 0),E(this,"properties",[]),this.root.push(new GT({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"})),this.nextId=2;for(let t of e)this.addCustomProperty(t)}prepForXml(e){return this.root.splice(1,this.root.length-1,...this.properties),super.prepForXml(e)}addCustomProperty(e){this.properties.push(new VT(this.nextId++,e))}},JT=e=>new L({name:"ds:datastoreItem",attributes:{itemId:{key:"ds:itemID",value:e},namespace:{key:"xmlns:ds",value:"http://schemas.openxmlformats.org/officeDocument/2006/customXml"}},children:[new L({name:"ds:schemaRefs",children:[new L({name:"ds:schemaRef",attributes:{uri:{key:"ds:uri",value:"http://schemas.openxmlformats.org/officeDocument/2006/bibliography"}}})]})]}),QT={new:"wne:eventDocNew",open:"wne:eventDocOpen",close:"wne:eventDocClose",sync:"wne:eventDocSync",xmlAfterInsert:"wne:eventDocXmlAfterInsert",xmlBeforeDelete:"wne:eventDocXmlBeforeDelete",contentControlAfterAdd:"wne:eventDocContentControlAfterInsert",contentControlBeforeDelete:"wne:eventDocContentControlBeforeDelete",contentControlOnExit:"wne:eventDocContentControlOnExit",contentControlOnEnter:"wne:eventDocContentControlOnEnter",contentControlBeforeStoreUpdate:"wne:eventDocStoreUpdate",contentControlBeforeContentUpdate:"wne:eventDocContentControlContentUpdate",buildingBlockInsert:"wne:eventDocBuildingBlockAfterInsert"},ZT=e=>new L({name:"wne:vbaSuppData",attributes:{namespace:{key:"xmlns:wne",value:"http://schemas.microsoft.com/office/word/2006/wordml"}},children:[new L({name:"wne:docEvents",children:Object.entries(QT).filter(([t])=>e.includes(t)).map(([,t])=>new L({name:t}))})]}),eS=class extends P{constructor({color:e,themeColor:t,themeShade:n,themeTint:r}){if(super("w:background"),typeof e=="object"&&(t!==void 0||n!==void 0||r!==void 0))throw new Error("Invalid background. Expected a theme color in color, or themeColor, themeShade and themeTint, not both");this.root.push(new ic([{keys:Kr,color:e},{key:"w:themeColor",value:t},{key:"w:themeShade",value:n===void 0?void 0:Yu(n)},{key:"w:themeTint",value:r===void 0?void 0:Yu(r)}]))}},tS=class extends P{constructor(e){super("w:document"),E(this,"body",void 0),this.root.push(new Qs(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps","cx","cx1","cx2","cx3","cx4","cx5","cx6","cx7","cx8","aink","am3d","w16cex","w16cid","w16","w16sdtdh","w16se"],"w14 w15 wp14")),this.body=new Ym({pageNumbers:e.pageNumbers}),e.background&&this.root.push(new eS(e.background)),this.root.push(this.body)}add(e){return this.body.push(e),this}get Body(){return this.body}},nS=class{constructor(e){E(this,"document",void 0),E(this,"relationships",void 0),this.document=new tS(e),this.relationships=new be}get View(){return this.document}get Relationships(){return this.relationships}},rS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},of=class extends P{constructor(e,t){super("w:p"),E(this,"paragraph",void 0),E(this,"mark",void 0),this.paragraph=e,this.mark=t}prepForXml(e){let t=this.paragraph.prepForXml(e)["w:p"],n=Array.isArray(t)?t:[],r=n.length>0&&"w:pPr"in n[0]?1:0;return{"w:p":[...n.slice(0,r),this.mark.prepForXml(e),...n.slice(r)]}}},iS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"w:type",id:"w:id"})}},lf=class extends qe{constructor(){super({style:"EndnoteReference"}),this.root.push(new x1)}},dh={SEPARATOR:"separator",CONTINUATION_SEPARATOR:"continuationSeparator"},cl=class extends P{constructor(e){super("w:endnote"),this.root.push(new iS({type:e.type,id:e.id}));for(let[t,n]of e.children.entries())this.root.push(t===0?new of(n,new lf):n)}},sS=class extends P{constructor(){super("w:continuationSeparator")}},cf=class extends qe{constructor(){super({}),this.root.push(new sS)}},aS=class extends P{constructor(){super("w:separator")}},df=class extends qe{constructor(){super({}),this.root.push(new aS)}},pf=class extends P{constructor(){super("w:endnotes"),E(this,"ownNotes",new Map),E(this,"highestId",0),this.root.push(new rS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));let e=new cl({id:-1,type:dh.SEPARATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Dn.AUTO},children:[new df]})]});this.root.push(e);let t=new cl({id:0,type:dh.CONTINUATION_SEPARATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Dn.AUTO},children:[new cf]})]});this.root.push(t)}createEndnote(e,t){let n=new cl({id:e,children:t});this.root.push(n),Number.isFinite(e)&&(this.highestId=Math.max(this.highestId,Math.floor(e)))}idOf(e,t,n){if(n.viewWrapper!==n.file.Document)return;let r=this.ownNotes.get(e);if(r!==void 0)return r;let i=this.highestId+1;return this.createEndnote(i,t.children),this.ownNotes.set(e,i),i}prepForXml(e){let t=super.prepForXml(e);return zr(t,e),t}},oS=class{constructor(){E(this,"endnotes",void 0),E(this,"relationships",void 0),this.endnotes=new pf,this.relationships=new be}get View(){return this.endnotes}get Relationships(){return this.relationships}},lS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type"})}},cS=class extends im{constructor(e,t){super("w:ftr",t),E(this,"refId",void 0),this.refId=e,t||this.root.push(new lS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}prepForXml(e){let t=super.prepForXml(e);return zr(t,e,this.refId),t}},dS=class{constructor(e,t,n){E(this,"media",void 0),E(this,"footer",void 0),E(this,"relationships",void 0),this.media=e,this.footer=new cS(t,n),this.relationships=new be}add(e){this.footer.add(e)}addChildElement(e){this.footer.addChildElement(e)}get View(){return this.footer}get Relationships(){return this.relationships}get Media(){return this.media}},pS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"w:type",id:"w:id"})}},uS=class extends P{constructor(){super("w:footnoteRef")}},uf=class extends qe{constructor(){super({style:"FootnoteReference"}),this.root.push(new uS)}},ph={SEPERATOR:"separator",CONTINUATION_SEPERATOR:"continuationSeparator"},dl=class extends P{constructor(e){super("w:footnote"),this.root.push(new pS({type:e.type,id:e.id}));for(let[t,n]of e.children.entries())this.root.push(t===0?new of(n,new uf):n)}},hS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},hf=class extends P{constructor(){super("w:footnotes"),E(this,"ownNotes",new Map),E(this,"highestId",0),this.root.push(new hS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));let e=new dl({id:-1,type:ph.SEPERATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Dn.AUTO},children:[new df]})]});this.root.push(e);let t=new dl({id:0,type:ph.CONTINUATION_SEPERATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Dn.AUTO},children:[new cf]})]});this.root.push(t)}createFootNote(e,t){let n=new dl({id:e,children:t});this.root.push(n),Number.isFinite(e)&&(this.highestId=Math.max(this.highestId,Math.floor(e)))}idOf(e,t,n){if(n.viewWrapper!==n.file.Document)return;let r=this.ownNotes.get(e);if(r!==void 0)return r;let i=this.highestId+1;return this.createFootNote(i,t.children),this.ownNotes.set(e,i),i}prepForXml(e){let t=super.prepForXml(e);return zr(t,e),t}},mS=class{constructor(){E(this,"footnotess",void 0),E(this,"relationships",void 0),this.footnotess=new hf,this.relationships=new be}get View(){return this.footnotess}get Relationships(){return this.relationships}},fS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type",cx:"xmlns:cx",cx1:"xmlns:cx1",cx2:"xmlns:cx2",cx3:"xmlns:cx3",cx4:"xmlns:cx4",cx5:"xmlns:cx5",cx6:"xmlns:cx6",cx7:"xmlns:cx7",cx8:"xmlns:cx8",w16cid:"xmlns:w16cid",w16se:"xmlns:w16se"})}},gS=class extends im{constructor(e,t){super("w:hdr",t),E(this,"refId",void 0),this.refId=e,t||this.root.push(new fS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}prepForXml(e){let t=super.prepForXml(e);return zr(t,e,this.refId),t}},bS=class{constructor(e,t,n){E(this,"media",void 0),E(this,"header",void 0),E(this,"relationships",void 0),this.media=e,this.header=new gS(t,n),this.relationships=new be}add(e){return this.header.add(e),this}addChildElement(e){this.header.addChildElement(e)}get View(){return this.header}get Relationships(){return this.relationships}get Media(){return this.media}},vS=()=>{let e=new Map;return t=>{var n;let r=((n=e.get(t))!==null&&n!==void 0?n:0)+1;return e.set(t,r),`media/image${r}.${t}`}},mf=class{constructor(e=vS()){E(this,"map",new Map),E(this,"takePath",void 0),this.takePath=e}addImage(e,t){if(this.map.has(e))return;let n=this.takePath(t.type);this.map.set(e,k(k({},t),{},{fileName:n.slice(n.lastIndexOf("/")+1)}))}get Array(){return Array.from(this.map.values())}get Entries(){return Array.from(this.map.entries())}},yt={DECIMAL:"decimal",UPPER_ROMAN:"upperRoman",LOWER_ROMAN:"lowerRoman",UPPER_LETTER:"upperLetter",LOWER_LETTER:"lowerLetter",ORDINAL:"ordinal",CARDINAL_TEXT:"cardinalText",ORDINAL_TEXT:"ordinalText",HEX:"hex",CHICAGO:"chicago",IDEOGRAPH__DIGITAL:"ideographDigital",JAPANESE_COUNTING:"japaneseCounting",AIUEO:"aiueo",IROHA:"iroha",DECIMAL_FULL_WIDTH:"decimalFullWidth",DECIMAL_HALF_WIDTH:"decimalHalfWidth",JAPANESE_LEGAL:"japaneseLegal",JAPANESE_DIGITAL_TEN_THOUSAND:"japaneseDigitalTenThousand",DECIMAL_ENCLOSED_CIRCLE:"decimalEnclosedCircle",DECIMAL_FULL_WIDTH2:"decimalFullWidth2",AIUEO_FULL_WIDTH:"aiueoFullWidth",IROHA_FULL_WIDTH:"irohaFullWidth",DECIMAL_ZERO:"decimalZero",BULLET:"bullet",GANADA:"ganada",CHOSUNG:"chosung",DECIMAL_ENCLOSED_FULLSTOP:"decimalEnclosedFullstop",DECIMAL_ENCLOSED_PARENTHESES:"decimalEnclosedParen",DECIMAL_ENCLOSED_CIRCLE_CHINESE:"decimalEnclosedCircleChinese",IDEOGRAPH_ENCLOSED_CIRCLE:"ideographEnclosedCircle",IDEOGRAPH_TRADITIONAL:"ideographTraditional",IDEOGRAPH_ZODIAC:"ideographZodiac",IDEOGRAPH_ZODIAC_TRADITIONAL:"ideographZodiacTraditional",TAIWANESE_COUNTING:"taiwaneseCounting",IDEOGRAPH_LEGAL_TRADITIONAL:"ideographLegalTraditional",TAIWANESE_COUNTING_THOUSAND:"taiwaneseCountingThousand",TAIWANESE_DIGITAL:"taiwaneseDigital",CHINESE_COUNTING:"chineseCounting",CHINESE_LEGAL_SIMPLIFIED:"chineseLegalSimplified",CHINESE_COUNTING_THOUSAND:"chineseCountingThousand",KOREAN_DIGITAL:"koreanDigital",KOREAN_COUNTING:"koreanCounting",KOREAN_LEGAL:"koreanLegal",KOREAN_DIGITAL2:"koreanDigital2",VIETNAMESE_COUNTING:"vietnameseCounting",RUSSIAN_LOWER:"russianLower",RUSSIAN_UPPER:"russianUpper",NONE:"none",NUMBER_IN_DASH:"numberInDash",HEBREW1:"hebrew1",HEBREW2:"hebrew2",ARABIC_ALPHA:"arabicAlpha",ARABIC_ABJAD:"arabicAbjad",HINDI_VOWELS:"hindiVowels",HINDI_CONSONANTS:"hindiConsonants",HINDI_NUMBERS:"hindiNumbers",HINDI_COUNTING:"hindiCounting",THAI_LETTERS:"thaiLetters",THAI_NUMBERS:"thaiNumbers",THAI_COUNTING:"thaiCounting",BAHT_TEXT:"bahtText",DOLLAR_TEXT:"dollarText",CUSTOM:"custom"},wS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{ilvl:"w:ilvl",tentative:"w:tentative"})}},yS=class extends P{constructor(e){super("w:numFmt"),this.root.push(new _e({val:e}))}},xS=class extends P{constructor(e){super("w:lvlText"),this.root.push(new _e({val:e}))}},kS=e=>{switch(e){case ue.CENTER:return"center";case ue.END:case ue.RIGHT:return"right";default:return"left"}},TS=class extends P{constructor(e){super("w:lvlJc"),this.root.push(new _e({val:kS(e)}))}},SS=class extends P{constructor(e){super("w:suff"),this.root.push(new _e({val:e}))}},CS=class extends P{constructor(){super("w:isLgl")}},ES=class extends P{constructor({level:e,format:t,text:n,alignment:r=ue.START,start:i=1,style:s,suffix:a,isLegalNumberingStyle:o}){if(super("w:lvl"),E(this,"paragraphProperties",void 0),E(this,"runProperties",void 0),this.root.push(new Pr("w:start",le(i))),t&&this.root.push(new yS(t)),s?.style&&this.root.push(Nr(s.style)),o&&this.root.push(new CS),a&&this.root.push(new SS(a)),n&&this.root.push(new xS(n)),this.root.push(new TS(r)),this.paragraphProperties=new Mn(s&&s.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new on(s?.run&&k(k({},s.run),{},{highlight:void 0,math:void 0,revision:void 0})),this.root.push(this.paragraphProperties),this.root.push(this.runProperties),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new wS({ilvl:le(e),tentative:1}))}},AS=class extends ES{},_S=class extends P{constructor(e){super("w:multiLevelType"),this.root.push(new _e({val:e}))}},NS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{abstractNumId:"w:abstractNumId",restartNumberingAfterBreak:"w15:restartNumberingAfterBreak"})}},pl=class extends P{constructor(e,t){super("w:abstractNum"),E(this,"id",void 0),this.root.push(new NS({abstractNumId:le(e),restartNumberingAfterBreak:0})),this.root.push(new _S("hybridMultilevel")),this.id=e;for(let n of t)this.root.push(new AS(n))}},PS=class extends P{constructor(e){super("w:abstractNumId"),this.root.push(new _e({val:e}))}},IS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{numId:"w:numId"})}},uh=class extends P{constructor(e){if(super("w:num"),E(this,"numId",void 0),E(this,"reference",void 0),E(this,"instance",void 0),E(this,"restartedListId",void 0),this.numId=e.numId,this.reference=e.reference,this.instance=e.instance,this.restartedListId=e.restartedListId,this.root.push(new IS({numId:le(e.numId)})),this.root.push(new PS(le(e.abstractNumId))),e.overrideLevels&&e.overrideLevels.length)for(let t of e.overrideLevels)this.root.push(new RS(t.num,t.start))}},OS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{ilvl:"w:ilvl"})}},RS=class extends P{constructor(e,t){super("w:lvlOverride"),this.root.push(new OS({ilvl:e})),t!==void 0&&this.root.push(new DS(t))}},LS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},DS=class extends P{constructor(e){super("w:startOverride"),this.root.push(new LS({val:e}))}},ff=class extends P{constructor(e){super("w:numbering"),E(this,"abstractNumberingMap",new Map),E(this,"concreteNumberingMap",new Map),E(this,"referenceConfigMap",new Map),E(this,"abstractNumUniqueNumericId",rk()),E(this,"concreteNumUniqueNumericId",ik()),this.root.push(new Qs(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps"],"w14 w15 wp14"));let t=new pl(this.abstractNumUniqueNumericId(),[{level:0,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:Xe(.5),hanging:Xe(.25)}}}},{level:1,format:yt.BULLET,text:"\u25CB",alignment:ue.LEFT,style:{paragraph:{indent:{left:Xe(1),hanging:Xe(.25)}}}},{level:2,format:yt.BULLET,text:"\u25A0",alignment:ue.LEFT,style:{paragraph:{indent:{left:2160,hanging:Xe(.25)}}}},{level:3,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:2880,hanging:Xe(.25)}}}},{level:4,format:yt.BULLET,text:"\u25CB",alignment:ue.LEFT,style:{paragraph:{indent:{left:3600,hanging:Xe(.25)}}}},{level:5,format:yt.BULLET,text:"\u25A0",alignment:ue.LEFT,style:{paragraph:{indent:{left:4320,hanging:Xe(.25)}}}},{level:6,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:5040,hanging:Xe(.25)}}}},{level:7,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:5760,hanging:Xe(.25)}}}},{level:8,format:yt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:6480,hanging:Xe(.25)}}}}]);this.concreteNumberingMap.set("default-bullet-numbering",new uh({numId:1,abstractNumId:t.id,reference:"default-bullet-numbering",instance:0,overrideLevels:[{num:0,start:1}]})),this.abstractNumberingMap.set("default-bullet-numbering",t);for(let n of e.config)this.abstractNumberingMap.set(n.reference,new pl(this.abstractNumUniqueNumericId(),n.levels)),this.referenceConfigMap.set(n.reference,n.levels)}prepForXml(e){return this.root.splice(1,this.root.length-1,...this.abstractNumberingMap.values(),...this.concreteNumberingMap.values()),super.prepForXml(e)}createConcreteNumberingInstance(e,t,n,r){var i;n&&!this.abstractNumberingMap.has(n.reference)&&(this.abstractNumberingMap.set(n.reference,new pl(this.abstractNumUniqueNumericId(),n.levels)),this.referenceConfigMap.set(n.reference,n.levels));let s=this.abstractNumberingMap.get(e);if(!s)return;let a=Bs(e,t,r);if(this.concreteNumberingMap.has(a))return;let o=(i=this.referenceConfigMap.get(e))!==null&&i!==void 0?i:[{level:0}],c={numId:this.concreteNumUniqueNumericId(),abstractNumId:s.id,reference:e,instance:t,restartedListId:r,overrideLevels:o.map(({level:l,start:u=1})=>({num:l,start:le(u)}))};this.concreteNumberingMap.set(a,new uh(c))}get ConcreteNumbering(){return Array.from(this.concreteNumberingMap.values())}get ReferenceConfig(){return Array.from(this.referenceConfigMap.values())}},gf=class{constructor(e,t=new Set){E(this,"contentTypes",void 0),E(this,"paths",new Map),E(this,"taken",void 0),E(this,"folders",new WeakMap),this.contentTypes=e,this.taken=new Set(t)}add(e){let t=this.paths.get(e);if(t!==void 0)return t;let{folder:n,name:r,extension:i,contentType:s}=e.options,a=this.takePath(n,r,i);return this.paths.set(e,a),this.contentTypes.addOverride(s,`/word/${a}`),a}takePath(e,t,n){let r=1;for(;this.taken.has(`${e}/${t}${r}.${n}`);)r++;let i=`${e}/${t}${r}.${n}`;return this.taken.add(i),i}get Array(){return[...this.paths].map(([e,t])=>({part:e,path:t}))}createRelationships(e){let t=new be;return this.folders.set(t,e.slice(0,e.indexOf("/"))),t}getTarget(e,t){let n=this.folders.get(e);return n===void 0?t:t.startsWith(`${n}/`)?t.slice(n.length+1):`../${t}`}},MS=e=>new L({name:"w:compatSetting",attributes:{version:{key:"w:val",value:e},name:{key:"w:name",value:"compatibilityMode"},uri:{key:"w:uri",value:"http://schemas.microsoft.com/office/word"}}}),BS=class extends P{constructor(e){super("w:compat"),e.useSingleBorderforContiguousCells&&this.root.push(new I("w:useSingleBorderforContiguousCells",e.useSingleBorderforContiguousCells)),e.wordPerfectJustification&&this.root.push(new I("w:wpJustification",e.wordPerfectJustification)),e.noTabStopForHangingIndent&&this.root.push(new I("w:noTabHangInd",e.noTabStopForHangingIndent)),e.noLeading&&this.root.push(new I("w:noLeading",e.noLeading)),e.spaceForUnderline&&this.root.push(new I("w:spaceForUL",e.spaceForUnderline)),e.noColumnBalance&&this.root.push(new I("w:noColumnBalance",e.noColumnBalance)),e.balanceSingleByteDoubleByteWidth&&this.root.push(new I("w:balanceSingleByteDoubleByteWidth",e.balanceSingleByteDoubleByteWidth)),e.noExtraLineSpacing&&this.root.push(new I("w:noExtraLineSpacing",e.noExtraLineSpacing)),e.doNotLeaveBackslashAlone&&this.root.push(new I("w:doNotLeaveBackslashAlone",e.doNotLeaveBackslashAlone)),e.underlineTrailingSpaces&&this.root.push(new I("w:ulTrailSpace",e.underlineTrailingSpaces)),e.doNotExpandShiftReturn&&this.root.push(new I("w:doNotExpandShiftReturn",e.doNotExpandShiftReturn)),e.spacingInWholePoints&&this.root.push(new I("w:spacingInWholePoints",e.spacingInWholePoints)),e.lineWrapLikeWord6&&this.root.push(new I("w:lineWrapLikeWord6",e.lineWrapLikeWord6)),e.printBodyTextBeforeHeader&&this.root.push(new I("w:printBodyTextBeforeHeader",e.printBodyTextBeforeHeader)),e.printColorsBlack&&this.root.push(new I("w:printColBlack",e.printColorsBlack)),e.spaceWidth&&this.root.push(new I("w:wpSpaceWidth",e.spaceWidth)),e.showBreaksInFrames&&this.root.push(new I("w:showBreaksInFrames",e.showBreaksInFrames)),e.subFontBySize&&this.root.push(new I("w:subFontBySize",e.subFontBySize)),e.suppressBottomSpacing&&this.root.push(new I("w:suppressBottomSpacing",e.suppressBottomSpacing)),e.suppressTopSpacing&&this.root.push(new I("w:suppressTopSpacing",e.suppressTopSpacing)),e.suppressSpacingAtTopOfPage&&this.root.push(new I("w:suppressSpacingAtTopOfPage",e.suppressSpacingAtTopOfPage)),e.suppressTopSpacingWP&&this.root.push(new I("w:suppressTopSpacingWP",e.suppressTopSpacingWP)),e.suppressSpBfAfterPgBrk&&this.root.push(new I("w:suppressSpBfAfterPgBrk",e.suppressSpBfAfterPgBrk)),e.swapBordersFacingPages&&this.root.push(new I("w:swapBordersFacingPages",e.swapBordersFacingPages)),e.convertMailMergeEsc&&this.root.push(new I("w:convMailMergeEsc",e.convertMailMergeEsc)),e.truncateFontHeightsLikeWP6&&this.root.push(new I("w:truncateFontHeightsLikeWP6",e.truncateFontHeightsLikeWP6)),e.macWordSmallCaps&&this.root.push(new I("w:mwSmallCaps",e.macWordSmallCaps)),e.usePrinterMetrics&&this.root.push(new I("w:usePrinterMetrics",e.usePrinterMetrics)),e.doNotSuppressParagraphBorders&&this.root.push(new I("w:doNotSuppressParagraphBorders",e.doNotSuppressParagraphBorders)),e.wrapTrailSpaces&&this.root.push(new I("w:wrapTrailSpaces",e.wrapTrailSpaces)),e.footnoteLayoutLikeWW8&&this.root.push(new I("w:footnoteLayoutLikeWW8",e.footnoteLayoutLikeWW8)),e.shapeLayoutLikeWW8&&this.root.push(new I("w:shapeLayoutLikeWW8",e.shapeLayoutLikeWW8)),e.alignTablesRowByRow&&this.root.push(new I("w:alignTablesRowByRow",e.alignTablesRowByRow)),e.forgetLastTabAlignment&&this.root.push(new I("w:forgetLastTabAlignment",e.forgetLastTabAlignment)),e.adjustLineHeightInTable&&this.root.push(new I("w:adjustLineHeightInTable",e.adjustLineHeightInTable)),e.autoSpaceLikeWord95&&this.root.push(new I("w:autoSpaceLikeWord95",e.autoSpaceLikeWord95)),e.noSpaceRaiseLower&&this.root.push(new I("w:noSpaceRaiseLower",e.noSpaceRaiseLower)),e.doNotUseHTMLParagraphAutoSpacing&&this.root.push(new I("w:doNotUseHTMLParagraphAutoSpacing",e.doNotUseHTMLParagraphAutoSpacing)),e.layoutRawTableWidth&&this.root.push(new I("w:layoutRawTableWidth",e.layoutRawTableWidth)),e.layoutTableRowsApart&&this.root.push(new I("w:layoutTableRowsApart",e.layoutTableRowsApart)),e.useWord97LineBreakRules&&this.root.push(new I("w:useWord97LineBreakRules",e.useWord97LineBreakRules)),e.doNotBreakWrappedTables&&this.root.push(new I("w:doNotBreakWrappedTables",e.doNotBreakWrappedTables)),e.doNotSnapToGridInCell&&this.root.push(new I("w:doNotSnapToGridInCell",e.doNotSnapToGridInCell)),e.selectFieldWithFirstOrLastCharacter&&this.root.push(new I("w:selectFldWithFirstOrLastChar",e.selectFieldWithFirstOrLastCharacter)),e.applyBreakingRules&&this.root.push(new I("w:applyBreakingRules",e.applyBreakingRules)),e.doNotWrapTextWithPunctuation&&this.root.push(new I("w:doNotWrapTextWithPunct",e.doNotWrapTextWithPunctuation)),e.doNotUseEastAsianBreakRules&&this.root.push(new I("w:doNotUseEastAsianBreakRules",e.doNotUseEastAsianBreakRules)),e.useWord2002TableStyleRules&&this.root.push(new I("w:useWord2002TableStyleRules",e.useWord2002TableStyleRules)),e.growAutofit&&this.root.push(new I("w:growAutofit",e.growAutofit)),e.useFELayout&&this.root.push(new I("w:useFELayout",e.useFELayout)),e.useNormalStyleForList&&this.root.push(new I("w:useNormalStyleForList",e.useNormalStyleForList)),e.doNotUseIndentAsNumberingTabStop&&this.root.push(new I("w:doNotUseIndentAsNumberingTabStop",e.doNotUseIndentAsNumberingTabStop)),e.useAlternateEastAsianLineBreakRules&&this.root.push(new I("w:useAltKinsokuLineBreakRules",e.useAlternateEastAsianLineBreakRules)),e.allowSpaceOfSameStyleInTable&&this.root.push(new I("w:allowSpaceOfSameStyleInTable",e.allowSpaceOfSameStyleInTable)),e.doNotSuppressIndentation&&this.root.push(new I("w:doNotSuppressIndentation",e.doNotSuppressIndentation)),e.doNotAutofitConstrainedTables&&this.root.push(new I("w:doNotAutofitConstrainedTables",e.doNotAutofitConstrainedTables)),e.autofitToFirstFixedWidthCell&&this.root.push(new I("w:autofitToFirstFixedWidthCell",e.autofitToFirstFixedWidthCell)),e.underlineTabInNumberingList&&this.root.push(new I("w:underlineTabInNumList",e.underlineTabInNumberingList)),e.displayHangulFixedWidth&&this.root.push(new I("w:displayHangulFixedWidth",e.displayHangulFixedWidth)),e.splitPgBreakAndParaMark&&this.root.push(new I("w:splitPgBreakAndParaMark",e.splitPgBreakAndParaMark)),e.doNotVerticallyAlignCellWithSp&&this.root.push(new I("w:doNotVertAlignCellWithSp",e.doNotVerticallyAlignCellWithSp)),e.doNotBreakConstrainedForcedTable&&this.root.push(new I("w:doNotBreakConstrainedForcedTable",e.doNotBreakConstrainedForcedTable)),e.ignoreVerticalAlignmentInTextboxes&&this.root.push(new I("w:doNotVertAlignInTxbx",e.ignoreVerticalAlignmentInTextboxes)),e.useAnsiKerningPairs&&this.root.push(new I("w:useAnsiKerningPairs",e.useAnsiKerningPairs)),e.cachedColumnBalance&&this.root.push(new I("w:cachedColBalance",e.cachedColumnBalance)),e.version&&this.root.push(MS(e.version))}},hh=1e5,mh=15,$S=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],FS=[[44796,19929,39858,10053,20106,40212,10761],[31585,63170,64933,60267,50935,40399,11199],[17763,35526,1453,2906,5812,11624,23248],[885,1770,3540,7080,14160,28320,56640],[55369,41139,20807,41614,21821,43642,17621],[28485,56970,44341,19019,38038,14605,29210],[60195,50791,40175,10751,21502,43004,24537],[18387,36774,3949,7898,15796,31592,63184],[47201,24803,49606,37805,14203,28406,56812],[17824,35648,1697,3394,6788,13576,27152],[43601,17539,35078,557,1114,2228,4456],[30388,60776,51953,34243,7079,14158,28316],[14128,28256,56512,43425,17251,34502,7597],[13105,26210,52420,35241,883,1766,3532],[4129,8258,16516,33032,4657,9314,18628]],fh=e=>e>>14&1|e<<1&32767,qS=e=>{let t=e.slice(0,mh).split("").map(i=>{let s=i.charCodeAt(0);return(s&255)!==0?s&255:s>>8&255}),n=t.reduce((i,s,a)=>FS[mh-t.length+a].reduce((o,c,l)=>s>>l&1?o^c:o,i),$S[t.length-1]),r=(fh(t.reduceRight((i,s)=>fh(i)^s,0))^t.length^52811)&65535;return[r&255,r>>8,n&255,n>>8].map(i=>i.toString(16).toUpperCase().padStart(2,"0")).join("")},HS=(e,t,n)=>{let r=[...qS(e)].flatMap(o=>[o.charCodeAt(0),0]),i=eh(Uint8Array.from([...t,...r])),s=new Uint8Array(i.length+4),a=new DataView(s.buffer);for(let o=0;o<n;o++)s.set(i),a.setUint32(i.length,o,!0),i=eh(s);return Array.from(i)},US=e=>{var t;let n=new Uint8Array(e);return typeof((t=globalThis.crypto)===null||t===void 0?void 0:t.getRandomValues)=="function"?(globalThis.crypto.getRandomValues(n),[...n]):[...n].map(()=>Math.floor(Math.random()*256))},gh=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{edit:"w:edit",enforcement:"w:enforcement",cryptProviderType:"w:cryptProviderType",cryptAlgorithmClass:"w:cryptAlgorithmClass",cryptAlgorithmType:"w:cryptAlgorithmType",cryptAlgorithmSid:"w:cryptAlgorithmSid",cryptSpinCount:"w:cryptSpinCount",hash:"w:hash",salt:"w:salt"})}},bh=e=>btoa(String.fromCharCode(...e)),jS=class extends P{constructor({type:e,password:t}){if(super("w:documentProtection"),t===void 0||t===""){this.root.push(new gh({edit:e,enforcement:!0}));return}let n=US(16);this.root.push(new gh({edit:e,enforcement:!0,cryptProviderType:"rsaAES",cryptAlgorithmClass:"hash",cryptAlgorithmType:"typeAny",cryptAlgorithmSid:12,cryptSpinCount:hh,hash:bh(HS(t,n,hh)),salt:bh(n)}))}},WS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},KS=class extends P{constructor(e){var t,n,r,i,s,a,o,c,l;super("w:settings"),this.root.push(new WS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"})),this.root.push(new I("w:displayBackgroundShape",!0)),e.embedFonts!==void 0&&this.root.push(new I("w:embedTrueTypeFonts",e.embedFonts)),e.trackRevisions!==void 0&&this.root.push(new I("w:trackRevisions",e.trackRevisions)),e.protection!==void 0&&this.root.push(new jS(e.protection)),this.root.push(new Pr("w:defaultTabStop",(t=e.defaultTabStop)!==null&&t!==void 0?t:720)),((n=e.hyphenation)===null||n===void 0?void 0:n.autoHyphenation)!==void 0&&this.root.push(new I("w:autoHyphenation",e.hyphenation.autoHyphenation)),((r=e.hyphenation)===null||r===void 0?void 0:r.consecutiveHyphenLimit)!==void 0&&this.root.push(new Pr("w:consecutiveHyphenLimit",e.hyphenation.consecutiveHyphenLimit)),((i=e.hyphenation)===null||i===void 0?void 0:i.hyphenationZone)!==void 0&&this.root.push(new Pr("w:hyphenationZone",e.hyphenation.hyphenationZone)),((s=e.hyphenation)===null||s===void 0?void 0:s.doNotHyphenateCaps)!==void 0&&this.root.push(new I("w:doNotHyphenateCaps",e.hyphenation.doNotHyphenateCaps)),e.evenAndOddHeaders!==void 0&&this.root.push(new I("w:evenAndOddHeaders",e.evenAndOddHeaders)),e.updateFields!==void 0&&this.root.push(new I("w:updateFields",e.updateFields)),this.root.push(new BS(k(k({},(a=e.compatibility)!==null&&a!==void 0?a:{}),{},{version:(o=(c=(l=e.compatibility)===null||l===void 0?void 0:l.version)!==null&&c!==void 0?c:e.compatibilityModeVersion)!==null&&o!==void 0?o:15})))}},bf=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},GS=class extends P{constructor(e){super("w:name"),this.root.push(new bf({val:e}))}},zS=class extends P{constructor(e){super("w:uiPriority"),this.root.push(new bf({val:le(e)}))}},VS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"w:type",styleId:"w:styleId",default:"w:default",customStyle:"w:customStyle"})}},bc=class extends P{constructor(e,t){super("w:style"),this.root.push(new VS(e)),t.name&&this.root.push(new GS(t.name)),t.basedOn&&t.basedOn!==e.styleId&&this.root.push(new ot("w:basedOn",t.basedOn)),t.next&&this.root.push(new ot("w:next",t.next)),t.link&&this.root.push(new ot("w:link",t.link)),t.uiPriority!==void 0&&this.root.push(new zS(t.uiPriority)),t.semiHidden!==void 0&&this.root.push(new I("w:semiHidden",t.semiHidden)),t.unhideWhenUsed!==void 0&&this.root.push(new I("w:unhideWhenUsed",t.unhideWhenUsed)),t.quickFormat!==void 0&&this.root.push(new I("w:qFormat",t.quickFormat))}},Ct=class extends bc{constructor(e){super({type:"paragraph",styleId:e.id},e),E(this,"paragraphProperties",void 0),E(this,"runProperties",void 0),this.paragraphProperties=new Mn(e.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new on(e.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties)}},ln=class extends bc{constructor(e){super({type:"character",styleId:e.id},k({uiPriority:99,unhideWhenUsed:!0},e)),E(this,"runProperties",void 0),this.runProperties=new on(e.run),this.root.push(this.runProperties)}},Wt=class extends Ct{constructor(e){super(k({basedOn:"Normal",next:"Normal",quickFormat:!0},e))}},XS=class extends Wt{constructor(e){super(k({id:"Title",name:"Title"},e))}},YS=class extends Wt{constructor(e){super(k({id:"Heading1",name:"Heading 1"},e))}},JS=class extends Wt{constructor(e){super(k({id:"Heading2",name:"Heading 2"},e))}},QS=class extends Wt{constructor(e){super(k({id:"Heading3",name:"Heading 3"},e))}},ZS=class extends Wt{constructor(e){super(k({id:"Heading4",name:"Heading 4"},e))}},eC=class extends Wt{constructor(e){super(k({id:"Heading5",name:"Heading 5"},e))}},tC=class extends Wt{constructor(e){super(k({id:"Heading6",name:"Heading 6"},e))}},nC=class extends Wt{constructor(e){super(k({id:"Strong",name:"Strong"},e))}},rC=class extends Ct{constructor(e){super(k({id:"ListParagraph",name:"List Paragraph",basedOn:"Normal",quickFormat:!0},e))}},iC=class extends Ct{constructor(e){super(k({id:"Caption",name:"caption",basedOn:"Normal",next:"Normal",uiPriority:35,semiHidden:!0,unhideWhenUsed:!0,quickFormat:!0,paragraph:{spacing:{after:200}},run:{italics:!0,color:{theme:"dark2"},size:18}},e))}},sC=class extends Ct{constructor(e){super(k({id:"Bibliography",name:"Bibliography",basedOn:"Normal",next:"Normal",uiPriority:37,unhideWhenUsed:!0},e))}},vf=new WeakSet,vh=e=>vf.has(e),xt=class extends Ct{constructor(e,t){super({id:`TOC${e}`,name:`toc ${e}`,basedOn:"Normal",next:"Normal",uiPriority:39,semiHidden:!0,unhideWhenUsed:!0,paragraph:k({spacing:{after:100}},e>1?{indent:{left:(e-1)*t}}:{})})}prepForXml(e){let t=super.prepForXml(e);return vf.add(t),t}},wf=class extends Ct{constructor(e){super(k({id:"FootnoteText",name:"footnote text",link:"FootnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:Dn.AUTO}},run:{size:20}},e))}},yf=class extends ln{constructor(e){super(k({id:"FootnoteReference",name:"footnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}},xf=class extends ln{constructor(e){super(k({id:"FootnoteTextChar",name:"Footnote Text Char",basedOn:"DefaultParagraphFont",link:"FootnoteText",semiHidden:!0,run:{size:20}},e))}},kf=class extends Ct{constructor(e){super(k({id:"EndnoteText",name:"endnote text",link:"EndnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:Dn.AUTO}},run:{size:20}},e))}},Tf=class extends ln{constructor(e){super(k({id:"EndnoteReference",name:"endnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}},Sf=class extends ln{constructor(e){super(k({id:"EndnoteTextChar",name:"Endnote Text Char",basedOn:"DefaultParagraphFont",link:"EndnoteText",semiHidden:!0,run:{size:20}},e))}},aC=class extends ln{constructor(e){super(k({id:"Hyperlink",name:"Hyperlink",basedOn:"DefaultParagraphFont",run:{color:"0563C1",underline:{type:wm.SINGLE}}},e))}},oC=class extends ln{constructor(e){super(k({id:"LineNumber",name:"line number",basedOn:"DefaultParagraphFont",semiHidden:!0},e))}},lC=class extends bc{constructor(){super({type:"table",styleId:"TableNormal",default:!0},{name:"Normal Table",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0}),this.root.push(new gc({indent:{size:0,type:Fe.DXA},cellMargin:{top:0,left:108,bottom:0,right:108}}))}},Or=e=>typeof e=="object"?Object.keys(e)[0]:void 0,vc=e=>{var t;return(t=[e["w:style"]].flat().find(n=>n._attr))===null||t===void 0?void 0:t._attr},wh=e=>{var t;return(t=vc(e))===null||t===void 0?void 0:t["w:styleId"]},yh=e=>{var t;let n=(t=[e["w:style"]].flat().find(r=>Or(r)==="w:name"))===null||t===void 0||(t=t["w:name"])===null||t===void 0||(t=t._attr)===null||t===void 0?void 0:t["w:val"];return n===void 0?void 0:String(n).toLowerCase()},Ml=e=>{var t,n;return Or(e)==="w:style"&&((t=(n=vc(e))===null||n===void 0?void 0:n["w:type"])!==null&&t!==void 0?t:"paragraph")==="paragraph"},cC=e=>{let t=Ml(e)?vc(e):void 0;return t?.["w:default"]!==void 0&&!["0","false","off"].includes(String(t["w:default"]))},dC=e=>({"w:style":[e["w:style"]].flat().map(t=>t._attr?{_attr:k(k({},t._attr),{},{"w:default":"1"})}:t)}),ul=class extends P{constructor(e){if(super("w:styles"),e.initialStyles&&this.root.push(e.initialStyles),e.importedStyles)for(let t of e.importedStyles)this.root.push(t);if(e.paragraphStyles)for(let t of e.paragraphStyles)this.root.push(new Ct(t));if(e.characterStyles)for(let t of e.characterStyles)this.root.push(new ln(t))}prepForXml(e){let t=super.prepForXml(e),n=t["w:styles"];if(!Array.isArray(n))return t;let r=l=>n.filter(u=>Or(u)===l),i=n.map(l=>Or(l)==="w:style"?wh(l):void 0),s=n.filter((l,u)=>!["_attr","w:docDefaults","w:latentStyles"].includes(Or(l))&&(i[u]===void 0||i.lastIndexOf(i[u])===u)),a=new Set(s.filter(l=>Ml(l)&&!vh(l)).map(yh)),o=s.filter(l=>!vh(l)||!a.has(yh(l))),c=o.some(cC)?o:o.map(l=>Ml(l)&&wh(l)==="Normal"?dC(l):l);return{"w:styles":[...r("_attr"),...r("w:docDefaults").slice(-1),...r("w:latentStyles").slice(-1),...c]}}},pC=class extends P{constructor(e){super("w:pPrDefault"),this.root.push(new Mn(e,{implicitListParagraphStyle:!1,inListOrder:!1}))}},uC=class extends P{constructor(e){super("w:rPrDefault"),this.root.push(new on(e))}},hC=class extends P{constructor(e){super("w:docDefaults"),E(this,"runPropertiesDefaults",void 0),E(this,"paragraphPropertiesDefaults",void 0),this.runPropertiesDefaults=new uC(e.run),this.paragraphPropertiesDefaults=new pC(e.paragraph),this.root.push(this.runPropertiesDefaults),this.root.push(this.paragraphPropertiesDefaults)}},mC=class{newInstance(e){let t=Wr(e),n;for(let i of t.elements||[])i.name==="w:styles"&&(n=i);if(n===void 0)throw new Error("can not find styles element");let r=n.elements||[];return{initialStyles:new mx(n.attributes),importedStyles:r.map(i=>ec(i))}}},fC=e=>{var t;let n=(t=e.document)===null||t===void 0||(t=t.run)===null||t===void 0?void 0:t.size;return n===void 0?200:Math.round(typeof n=="number"?n*10:qt(n))},gC=e=>({tableOfContents1:new xt(1,e),tableOfContents2:new xt(2,e),tableOfContents3:new xt(3,e),tableOfContents4:new xt(4,e),tableOfContents5:new xt(5,e),tableOfContents6:new xt(6,e),tableOfContents7:new xt(7,e),tableOfContents8:new xt(8,e),tableOfContents9:new xt(9,e)}),wc=(e={})=>{var t;return k(k({normal:new Ct({id:"Normal",name:"Normal",quickFormat:!0}),normalTable:new lC,document:new hC((t=e.document)!==null&&t!==void 0?t:{}),title:new XS(k({run:{size:56}},e.title)),heading1:new YS(k({run:{color:"2E74B5",size:32}},e.heading1)),heading2:new JS(k({run:{color:"2E74B5",size:26}},e.heading2)),heading3:new QS(k({run:{color:"1F4D78",size:24}},e.heading3)),heading4:new ZS(k({run:{color:"2E74B5",italics:!0}},e.heading4)),heading5:new eC(k({run:{color:"2E74B5"}},e.heading5)),heading6:new tC(k({run:{color:"1F4D78"}},e.heading6)),strong:new nC(k({run:{bold:!0}},e.strong)),listParagraph:new rC(e.listParagraph||{}),caption:new iC(e.caption||{}),bibliography:new sC(e.bibliography||{})},gC(fC(e))),{},{hyperlink:new aC(e.hyperlink||{}),footnoteReference:new yf(e.footnoteReference||{}),footnoteText:new wf(e.footnoteText||{}),footnoteTextChar:new xf(e.footnoteTextChar||{}),endnoteReference:new Tf(e.endnoteReference||{}),endnoteText:new kf(e.endnoteText||{}),endnoteTextChar:new Sf(e.endnoteTextChar||{}),lineNumber:new oC(e.lineNumber||{})})},xh=class{newInstance(e={}){return{initialStyles:new Qs(["mc","r","w","w14","w15"],"w14 w15"),importedStyles:Object.values(wc(e))}}},Cf={headings:{latin:"Calibri Light",panose:"020F0302020204030204"},body:{latin:"Calibri",panose:"020F0502020204030204"}},bC=[["Jpan","\u6E38\u30B4\u30B7\u30C3\u30AF Light","\u6E38\u660E\u671D"],["Hang","\uB9D1\uC740 \uACE0\uB515"],["Hans","\u7B49\u7EBF Light","\u7B49\u7EBF"],["Hant","\u65B0\u7D30\u660E\u9AD4"],["Arab","Times New Roman","Arial"],["Hebr","Times New Roman","Arial"],["Thai","Angsana New","Cordia New"],["Ethi","Nyala"],["Beng","Vrinda"],["Gujr","Shruti"],["Khmr","MoolBoran","DaunPenh"],["Knda","Tunga"],["Guru","Raavi"],["Cans","Euphemia"],["Cher","Plantagenet Cherokee"],["Yiii","Microsoft Yi Baiti"],["Tibt","Microsoft Himalaya"],["Thaa","MV Boli"],["Deva","Mangal"],["Telu","Gautami"],["Taml","Latha"],["Syrc","Estrangelo Edessa"],["Orya","Kalinga"],["Mlym","Kartika"],["Laoo","DokChampa"],["Sinh","Iskoola Pota"],["Mong","Mongolian Baiti"],["Viet","Times New Roman","Arial"],["Uigh","Microsoft Uighur"],["Geor","Sylfaen"],["Armn","Arial"],["Bugi","Leelawadee UI"],["Bopo","Microsoft JhengHei"],["Java","Javanese Text"],["Lisu","Segoe UI"],["Mymr","Myanmar Text"],["Nkoo","Ebrima"],["Olck","Nirmala UI"],["Osma","Ebrima"],["Phag","Phagspa"],["Syrn","Estrangelo Edessa"],["Syrj","Estrangelo Edessa"],["Syre","Estrangelo Edessa"],["Sora","Nirmala UI"],["Tale","Microsoft Tai Le"],["Talu","Microsoft New Tai Lue"],["Tfng","Ebrima"]],hl=(e,t,n)=>new L({name:e,attributes:{typeface:{key:"typeface",value:t},panose:{key:"panose",value:n}}}),vC=(e,t)=>{let n=t[e],r=typeof n=="string"?n:n?.latin;return r??Cf[e].latin},wC=(e,t={})=>{let n=bC.map(([i,s,a=s])=>{var o;return[i,(o=t[i])!==null&&o!==void 0?o:e==="headings"?s:a]}),r=new Set(n.map(([i])=>i));return[...n,...Object.entries(t).filter(([i])=>!r.has(i))]},kh=(e,t)=>{let n=t[e],{eastAsia:r="",complexScript:i="",scripts:s}=typeof n=="object"?n:{},a=vC(e,t),o=Cf[e];return new L({name:e==="headings"?"a:majorFont":"a:minorFont",children:[hl("a:latin",a,a===o.latin?o.panose:void 0),hl("a:ea",r),hl("a:cs",i),...wC(e,s).map(([c,l])=>new L({name:"a:font",attributes:{script:{key:"script",value:c},typeface:{key:"typeface",value:l}}}))]})},yC=(e,t={})=>new L({name:"a:fontScheme",attributes:{name:{key:"name",value:e}},children:[kh("headings",t),kh("body",t)]}),Ef=(e=[])=>new L({name:"a:schemeClr",attributes:{value:{key:"val",value:"phClr"}},children:e.map(([t,n])=>new L({name:`a:${t}`,attributes:{value:{key:"val",value:n}}}))}),Os=e=>new L({name:"a:solidFill",children:[Ef(e)]}),ml=e=>new L({name:"a:gradFill",attributes:{rotateWithShape:{key:"rotWithShape",value:!0}},children:[new L({name:"a:gsLst",children:e.map((t,n)=>new L({name:"a:gs",attributes:{position:{key:"pos",value:n*5e4}},children:[Ef(t)]}))}),new L({name:"a:lin",attributes:{angle:{key:"ang",value:54e5},scaled:{key:"scaled",value:!1}}})]}),fl=e=>new L({name:"a:ln",attributes:{width:{key:"w",value:e},cap:{key:"cap",value:"flat"},compound:{key:"cmpd",value:"sng"},alignment:{key:"algn",value:"ctr"}},children:[Os(),new L({name:"a:prstDash",attributes:{value:{key:"val",value:"solid"}}}),new L({name:"a:miter",attributes:{limit:{key:"lim",value:8e5}}})]}),gl=e=>new L({name:"a:effectStyle",children:[new L({name:"a:effectLst",children:e})]}),xC=()=>new L({name:"a:outerShdw",attributes:{blurRadius:{key:"blurRad",value:57150},distance:{key:"dist",value:19050},direction:{key:"dir",value:54e5},alignment:{key:"algn",value:"ctr"},rotateWithShape:{key:"rotWithShape",value:!1}},children:[new L({name:"a:srgbClr",attributes:{value:{key:"val",value:"000000"}},children:[new L({name:"a:alpha",attributes:{value:{key:"val",value:63e3}}})]})]}),kC=()=>new L({name:"a:fmtScheme",attributes:{name:{key:"name",value:"Office"}},children:[new L({name:"a:fillStyleLst",children:[Os(),ml([[["lumMod",11e4],["satMod",105e3],["tint",67e3]],[["lumMod",105e3],["satMod",103e3],["tint",73e3]],[["lumMod",105e3],["satMod",109e3],["tint",81e3]]]),ml([[["satMod",103e3],["lumMod",102e3],["tint",94e3]],[["satMod",11e4],["lumMod",1e5],["shade",1e5]],[["lumMod",99e3],["satMod",12e4],["shade",78e3]]])]}),new L({name:"a:lnStyleLst",children:[fl(6350),fl(12700),fl(19050)]}),new L({name:"a:effectStyleLst",children:[gl([]),gl([]),gl([xC()])]}),new L({name:"a:bgFillStyleLst",children:[Os(),Os([["tint",95e3],["satMod",17e4]]),ml([[["tint",93e3],["satMod",15e4],["shade",98e3],["lumMod",102e3]],[["tint",98e3],["satMod",13e4],["shade",9e4],["lumMod",103e3]],[["shade",63e3],["satMod",12e4]]])]})]}),TC=class extends P{constructor({name:e="Office Theme",colors:t,fonts:n}={}){super("a:theme"),E(this,"colors",void 0),this.colors=rc(t),this.root.push(new Jh({namespace:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"},name:{key:"name",value:e}})),this.root.push(new L({name:"a:themeElements",children:[Tx(t?e:"Office",t),yC(n?e:"Office",n),kC()]})),this.root.push(new L({name:"a:objectDefaults"})),this.root.push(new L({name:"a:extraClrSchemeLst"}))}get Colors(){return this.colors}},Qe=e=>{let t=e.lastIndexOf("/");return`${e.slice(0,t+1)}_rels/${e.slice(t+1)}.rels`},Af=e=>e.replace(/(^|\/)_rels\/([^/]*)\.rels$/,"$1$2"),_f=e=>e.slice(0,e.lastIndexOf("/")+1),cn=(e,t)=>{let n=t.replace(/\\/g,"/");return(n.startsWith("/")?n:`${_f(e)}${n}`).split("/").reduce((r,i)=>i===""||i==="."?r:i===".."?r.slice(0,-1):[...r,i],[]).join("/")},yc=(e,t)=>{let n=_f(e).split("/").filter(Boolean),r=t.split("/"),i=n.findIndex((a,o)=>o>=r.length-1||r[o]!==a),s=i===-1?n.length:i;return[...n.slice(s).map(()=>".."),...r.slice(s)].join("/")},SC=(e,t)=>e.toLowerCase()===t.toLowerCase(),oe=Uint8Array,Le=Uint16Array,xc=Int32Array,Zs=new oe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ea=new oe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bl=new oe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nf=function(e,t){for(var n=new Le(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new xc(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return{b:n,r:i}},Pf=Nf(Zs,2),If=Pf.b,$l=Pf.r;If[28]=258,$l[258]=28;Of=Nf(ea,0),CC=Of.b,Th=Of.r,Fl=new Le(32768);for(Y=0;Y<32768;++Y)kt=(Y&43690)>>1|(Y&21845)<<1,kt=(kt&52428)>>2|(kt&13107)<<2,kt=(kt&61680)>>4|(kt&3855)<<4,Fl[Y]=((kt&65280)>>8|(kt&255)<<8)>>1;lt=(function(e,t,n){for(var r=e.length,i=0,s=new Le(t);i<r;++i)e[i]&&++s[e[i]-1];var a=new Le(t);for(i=1;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;var o;if(n){o=new Le(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)o[Fl[d]>>c]=l}else for(o=new Le(r),i=0;i<r;++i)e[i]&&(o[i]=Fl[a[e[i]-1]++]>>15-e[i]);return o}),jt=new oe(288);for(Y=0;Y<144;++Y)jt[Y]=8;for(Y=144;Y<256;++Y)jt[Y]=9;for(Y=256;Y<280;++Y)jt[Y]=7;for(Y=280;Y<288;++Y)jt[Y]=8;qr=new oe(32);for(Y=0;Y<32;++Y)qr[Y]=5;EC=lt(jt,9,0),AC=lt(jt,9,1),_C=lt(qr,5,0),NC=lt(qr,5,1),bl=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Ye=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},vl=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},kc=function(e){return(e+7)/8|0},Vr=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new oe(e.subarray(t,n))},PC=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ee=function(e,t,n){var r=new Error(t||PC[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Ee),!n)throw r;return r},IC=function(e,t,n,r){var i=e.length,s=r?r.length:0;if(!i||t.f&&!t.l)return n||new oe(0);var a=!n,o=a||t.i!=2,c=t.i;a&&(n=new oe(i*3));var l=function(ae){var te=n.length;if(ae>te){var Re=new oe(Math.max(te*2,ae));Re.set(n),n=Re}},u=t.f||0,d=t.p||0,p=t.b||0,h=t.l,f=t.d,m=t.m,g=t.n,y=i*8;do{if(!h){u=Ye(e,d,1);var T=Ye(e,d+1,3);if(d+=3,T)if(T==1)h=AC,f=NC,m=9,g=5;else if(T==2){var w=Ye(e,d,31)+257,x=Ye(e,d+10,15)+4,v=w+Ye(e,d+5,31)+1;d+=14;for(var A=new oe(v),N=new oe(19),D=0;D<x;++D)N[Bl[D]]=Ye(e,d+D*3,7);d+=x*3;for(var O=bl(N),F=(1<<O)-1,Q=lt(N,O,1),D=0;D<v;){var Z=Q[Ye(e,d,F)];d+=Z&15;var b=Z>>4;if(b<16)A[D++]=b;else{var V=0,G=0;for(b==16?(G=3+Ye(e,d,3),d+=2,V=A[D-1]):b==17?(G=3+Ye(e,d,7),d+=3):b==18&&(G=11+Ye(e,d,127),d+=7);G--;)A[D++]=V}}var de=A.subarray(0,w),ce=A.subarray(w);m=bl(de),g=bl(ce),h=lt(de,m,1),f=lt(ce,g,1)}else Ee(1);else{var b=kc(d)+4,C=e[b-4]|e[b-3]<<8,_=b+C;if(_>i){c&&Ee(0);break}o&&l(p+C),n.set(e.subarray(b,_),p),t.b=p+=C,t.p=d=_*8,t.f=u;continue}if(d>y){c&&Ee(0);break}}o&&l(p+131072);for(var _t=(1<<m)-1,Ae=(1<<g)-1,Ue=d;;Ue=d){var V=h[vl(e,d)&_t],we=V>>4;if(d+=V&15,d>y){c&&Ee(0);break}if(V||Ee(2),we<256)n[p++]=we;else if(we==256){Ue=d,h=null;break}else{var ye=we-254;if(we>264){var D=we-257,re=Zs[D];ye=Ye(e,d,(1<<re)-1)+If[D],d+=re}var M=f[vl(e,d)&Ae],$=M>>4;M||Ee(3),d+=M&15;var ce=CC[$];if($>3){var re=ea[$];ce+=vl(e,d)&(1<<re)-1,d+=re}if(d>y){c&&Ee(0);break}o&&l(p+131072);var q=p+ye;if(p<ce){var ie=s-ce,se=Math.min(ce,q);for(ie+p<0&&Ee(3);p<se;++p)n[p]=r[ie+p]}for(;p<q;++p)n[p]=n[p-ce]}}t.l=h,t.p=Ue,t.b=p,t.f=u,h&&(u=1,t.m=m,t.d=f,t.n=g)}while(!u);return p!=n.length&&a?Vr(n,0,p):n.subarray(0,p)},Tt=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Sr=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},wl=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return{t:Lf,l:0};if(i==1){var a=new oe(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(_,w){return _.f-w.f}),n.push({s:-1,f:25001});var o=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:o.f+c.f,l:o,r:c};u!=i-1;)o=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:o.f+c.f,l:o,r:c};for(var p=s[0].s,r=1;r<i;++r)s[r].s>p&&(p=s[r].s);var h=new Le(p+1),f=ql(n[u-1],h,0);if(f>t){var r=0,m=0,g=f-t,y=1<<g;for(s.sort(function(w,x){return h[x.s]-h[w.s]||w.f-x.f});r<i;++r){var T=s[r].s;if(h[T]>t)m+=y-(1<<f-h[T]),h[T]=t;else break}for(m>>=g;m>0;){var b=s[r].s;h[b]<t?m-=1<<t-h[b]++-1:++r}for(;r>=0&&m;--r){var C=s[r].s;h[C]==t&&(--h[C],++m)}f=t}return{t:new oe(h),l:f}},ql=function(e,t,n){return e.s==-1?Math.max(ql(e.l,t,n+1),ql(e.r,t,n+1)):t[e.s]=n},Sh=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Le(++t),r=0,i=e[0],s=1,a=function(c){n[r++]=c},o=1;o<=t;++o)if(e[o]==i&&o!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(i),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(i);s=1,i=e[o]}return{c:n.subarray(0,r),n:t}},Cr=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Rf=function(e,t,n){var r=n.length,i=kc(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s<r;++s)e[i+s+4]=n[s];return(i+4+r)*8},Ch=function(e,t,n,r,i,s,a,o,c,l,u){Tt(t,u++,n),++i[256];for(var d=wl(i,15),p=d.t,h=d.l,f=wl(s,15),m=f.t,g=f.l,y=Sh(p),T=y.c,b=y.n,C=Sh(m),_=C.c,w=C.n,x=new Le(19),v=0;v<T.length;++v)++x[T[v]&31];for(var v=0;v<_.length;++v)++x[_[v]&31];for(var A=wl(x,7),N=A.t,D=A.l,O=19;O>4&&!N[Bl[O-1]];--O);var F=l+5<<3,Q=Cr(i,jt)+Cr(s,qr)+a,Z=Cr(i,p)+Cr(s,m)+a+14+3*O+Cr(x,N)+2*x[16]+3*x[17]+7*x[18];if(c>=0&&F<=Q&&F<=Z)return Rf(t,u,e.subarray(c,c+l));var V,G,de,ce;if(Tt(t,u,1+(Z<Q)),u+=2,Z<Q){V=lt(p,h,0),G=p,de=lt(m,g,0),ce=m;var _t=lt(N,D,0);Tt(t,u,b-257),Tt(t,u+5,w-1),Tt(t,u+10,O-4),u+=14;for(var v=0;v<O;++v)Tt(t,u+3*v,N[Bl[v]]);u+=3*O;for(var Ae=[T,_],Ue=0;Ue<2;++Ue)for(var we=Ae[Ue],v=0;v<we.length;++v){var ye=we[v]&31;Tt(t,u,_t[ye]),u+=N[ye],ye>15&&(Tt(t,u,we[v]>>5&127),u+=we[v]>>12)}}else V=EC,G=jt,de=_C,ce=qr;for(var v=0;v<o;++v){var re=r[v];if(re>255){var ye=re>>18&31;Sr(t,u,V[ye+257]),u+=G[ye+257],ye>7&&(Tt(t,u,re>>23&31),u+=Zs[ye]);var M=re&31;Sr(t,u,de[M]),u+=ce[M],M>3&&(Sr(t,u,re>>5&8191),u+=ea[M])}else Sr(t,u,V[re]),u+=G[re]}return Sr(t,u,V[256]),u+G[256]},OC=new xc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Lf=new oe(0),RC=function(e,t,n,r,i,s){var a=s.z||e.length,o=new oe(r+a+5*(1+Math.ceil(a/7e3))+i),c=o.subarray(r,o.length-i),l=s.l,u=(s.r||0)&7;if(t){u&&(c[0]=s.r>>3);for(var d=OC[t-1],p=d>>13,h=d&8191,f=(1<<n)-1,m=s.p||new Le(32768),g=s.h||new Le(f+1),y=Math.ceil(n/3),T=2*y,b=function(Re){return(e[Re]^e[Re+1]<<y^e[Re+2]<<T)&f},C=new xc(25e3),_=new Le(288),w=new Le(32),x=0,v=0,A=s.i||0,N=0,D=s.w||0,O=0;A+2<a;++A){var F=b(A),Q=A&32767,Z=g[F];if(m[Q]=Z,g[F]=Q,D<=A){var V=a-A;if((x>7e3||N>24576)&&(V>423||!l)){u=Ch(e,c,0,C,_,w,v,N,O,A-O,u),N=x=v=0,O=A;for(var G=0;G<286;++G)_[G]=0;for(var G=0;G<30;++G)w[G]=0}var de=2,ce=0,_t=h,Ae=Q-Z&32767;if(V>2&&F==b(A-Ae))for(var Ue=Math.min(p,V)-1,we=Math.min(32767,A),ye=Math.min(258,V);Ae<=we&&--_t&&Q!=Z;){if(e[A+de]==e[A+de-Ae]){for(var re=0;re<ye&&e[A+re]==e[A+re-Ae];++re);if(re>de){if(de=re,ce=Ae,re>Ue)break;for(var M=Math.min(Ae,re-2),$=0,G=0;G<M;++G){var q=A-Ae+G&32767,ie=q-m[q]&32767;ie>$&&($=ie,Z=q)}}}Q=Z,Z=m[Q],Ae+=Q-Z&32767}if(ce){C[N++]=268435456|$l[de]<<18|Th[ce];var se=$l[de]&31,ae=Th[ce]&31;v+=Zs[se]+ea[ae],++_[257+se],++w[ae],D=A+de,++x}else C[N++]=e[A],++_[e[A]]}}for(A=Math.max(A,D);A<a;++A)C[N++]=e[A],++_[e[A]];u=Ch(e,c,l,C,_,w,v,N,O,A-O,u),l||(s.r=u&7|c[u/8|0]<<3,u-=7,s.h=g,s.p=m,s.i=A,s.w=D)}else{for(var A=s.w||0;A<a+l;A+=65535){var te=A+65535;te>=a&&(c[u/8|0]=l,te=a),u=Rf(c,u+1,e.subarray(A,te))}s.i=a}return Vr(o,0,r+kc(u)+i)},LC=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),DC=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=LC[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},MC=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),a=new oe(s.length+e.length);a.set(s),a.set(e,s.length),e=a,i.w=s.length}return RC(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)},Df=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},st=function(e,t){return e[t]|e[t+1]<<8},Be=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},yl=function(e,t){return Be(e,t)+Be(e,t+4)*4294967296},ke=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};Mf=function(e,t,n,r){for(var i in e){var s=e[i],a=t+i,o=r;Array.isArray(s)&&(o=Df(r,s[1]),s=s[0]),ArrayBuffer.isView(s)?n[a]=[s,o]:(n[a+="/"]=[new oe(0),o],Mf(s,a,n,r))}},Eh=typeof TextEncoder<"u"&&new TextEncoder,Hl=typeof TextDecoder<"u"&&new TextDecoder;try{Hl.decode(Lf,{stream:!0})}catch{}FC=function(e){for(var t="",n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:Vr(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};HC=function(e,t){return t+30+st(e,t+26)+st(e,t+28)},UC=function(e,t,n){var r=st(e,t+28),i=st(e,t+30),s=qC(e.subarray(t+46,t+46+r),!(st(e,t+8)&2048)),a=t+46+r,o=jC(e,a,i,n,Be(e,t+20),Be(e,t+24),Be(e,t+42)),c=o[0],l=o[1],u=o[2];return[st(e,t+10),c,l,s,a+i+st(e,t+32),u]},jC=function(e,t,n,r,i,s,a){var o=i==4294967295,c=s==4294967295,l=a==4294967295,u=t+n,d=o+c+l;if(r&&d){for(;t+4<u;t+=4+st(e,t+2))if(st(e,t)==1)return[o?yl(e,t+4+8*c):i,c?yl(e,t+4):s,l?yl(e,t+4+8*(c+o)):a,1];r<2&&Ee(13)}return[i,s,a,0]},Ul=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&Ee(9),t+=r+4}return t},_h=function(e,t,n,r,i,s,a,o){var c=r.length,l=n.extra,u=o&&o.length,d=Ul(l);ke(e,t,a!=null?33639248:67324752),t+=4,a!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(s<0&&8),e[t++]=i&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var p=new Date(n.mtime==null?Date.now():n.mtime),h=p.getFullYear()-1980;if((h<0||h>119)&&Ee(10),ke(e,t,h<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),t+=4,s!=-1&&(ke(e,t,n.crc),ke(e,t+4,s<0?-s-2:s),ke(e,t+8,n.size)),ke(e,t+12,c),ke(e,t+14,d),t+=16,a!=null&&(ke(e,t,u),ke(e,t+6,n.attrs),ke(e,t+10,a),t+=14),e.set(r,t),t+=c,d)for(var f in l){var m=l[f],g=m.length;ke(e,t,+f),ke(e,t+2,g),e.set(m,t+4),t+=4+g}return u&&(e.set(o,t),t+=u),t},WC=function(e,t,n,r,i){ke(e,t,101010256),ke(e,t+8,n),ke(e,t+10,n),ke(e,t+12,r),ke(e,t+16,i)};zC=e=>typeof e=="string"?ck(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e),qs=e=>KC(Object.fromEntries([...e].map(([t,n])=>[t,zC(n)]))),VC=1032,Nh=e=>new Error(`Corrupted zip: ${e} isn't the size the zip file gives it`),Bf=(e,t=()=>!0)=>{let n=new Map,r=0,i=GC(e,{filter:({name:a,size:o,originalSize:c})=>{if(a.endsWith("/")||!t(a))return!1;if(r+=o,r>e.length||c>o*VC)throw Nh(a);return n.set(a,c),!0}}),s=Object.entries(i).find(([a,o])=>o.length!==n.get(a));if(s!==void 0)throw Nh(s[0]);return new Map(Object.entries(i))},xl=e=>{let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t},Rs=e=>new Error(`${e} is not supported by this platform`),Ph={uint8array:e=>e,arraybuffer:e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),array:e=>Array.from(e),string:xl,binarystring:xl,base64:e=>btoa(xl(e)),blob:(e,t)=>{if(typeof Blob>"u")throw Rs("blob");return new Blob([e],{type:t})},nodebuffer:e=>{if(typeof Buffer>"u")throw Rs("nodebuffer");return Buffer.from(e.buffer,e.byteOffset,e.byteLength)},text:()=>{throw Rs("text")}},jl=(e,t,n)=>{let r=Object.prototype.hasOwnProperty.call(Ph,t.toLowerCase())?Ph[t.toLowerCase()]:void 0;if(r===void 0)throw Rs(t);return r(e,n)},XC=new Map([["dk1","dark1"],["lt1","light1"],["dk2","dark2"],["lt2","light2"],["accent1","accent1"],["accent2","accent2"],["accent3","accent3"],["accent4","accent4"],["accent5","accent5"],["accent6","accent6"],["hlink","hyperlink"],["folHlink","followedHyperlink"]]),YC=new Map([["dark1","windowText"],["light1","window"]]),JC=new Set(["http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme","http://purl.oclc.org/ooxml/officeDocument/relationships/theme"]),Hr=e=>{var t,n;return(t=e==null||(n=e.name)===null||n===void 0?void 0:n.slice(e.name.indexOf(":")+1))!==null&&t!==void 0?t:""},Xr=e=>{var t,n;return(t=e==null||(n=e.elements)===null||n===void 0?void 0:n.filter(r=>r.type==="element"))!==null&&t!==void 0?t:[]},Wl=(e,t)=>Xr(e).find(n=>Hr(n)===t),Rr=(e,t)=>{var n;let r=e==null||(n=e.attributes)===null||n===void 0?void 0:n[t];return r===void 0?void 0:String(r)},QC=e=>new TextDecoder(e[0]===255&&e[1]===254?"utf-16le":e[0]===254&&e[1]===255?"utf-16be":"utf-8").decode(e),ZC=(e,t,n)=>{let r=e.get(Qe(t)),i=Rr(r&&Xr(Wl(Wr(QC(r)),"Relationships")).find(s=>{var a;return n.has((a=Rr(s,"Type"))!==null&&a!==void 0?a:"")}),"Target");return i===void 0?void 0:cn(t,i)},eE=(e,t)=>ZC(e,t,JC),tE=(e,t,n)=>{let[r]=Xr(t),i=Hr(r)==="srgbClr"?Rr(r,"val"):Hr(r)==="sysClr"&&(n||Rr(r,"val")!==YC.get(e))?Rr(r,"lastClr"):void 0;return i!==void 0&&/^[0-9A-Fa-f]{6}$/.test(i)?i.toUpperCase():void 0},nE=(e,t=!1)=>Object.fromEntries(Xr(e).flatMap(n=>{let r=XC.get(Hr(n)),i=r&&tE(r,n,t);return r&&i?[[r,i]]:[]})),rE=e=>{let[t]=Xr(Wr(e)),n=Hr(t)==="theme"?Wl(Wl(t,"themeElements"),"clrScheme"):void 0;return n?nE(n,!0):{}},iE=[208,207,17,224,161,177,26,225],$f=class{constructor(e){var t,n,r,i,s,a,o,c,l,u,d,p,h,f;if(E(this,"currentRelationshipId",1),E(this,"documentWrapper",void 0),E(this,"headers",[]),E(this,"footers",[]),E(this,"coreProperties",void 0),E(this,"numbering",void 0),E(this,"media",void 0),E(this,"fileRelationships",void 0),E(this,"footnotesWrapper",void 0),E(this,"endnotesWrapper",void 0),E(this,"settings",void 0),E(this,"contentTypes",void 0),E(this,"customProperties",void 0),E(this,"appProperties",void 0),E(this,"styles",void 0),E(this,"comments",void 0),E(this,"commentsExtended",void 0),E(this,"commentsIds",void 0),E(this,"fontWrapper",void 0),E(this,"theme",void 0),E(this,"packageParts",void 0),E(this,"macros",void 0),E(this,"bibliography",void 0),e.macros!==void 0){let{project:b,events:C=[]}=e.macros,_=b instanceof Uint8Array?b:new Uint8Array(b);if(!iE.every((x,v)=>_[v]===x))throw new Error("macros.project isn't a VBA project. Use createMacros from docx/macros, or the word/vbaProject.bin in a .docm rather than the .docm itself");let w=new be;C.length>0&&w.addRelationship(1,"http://schemas.microsoft.com/office/2006/relationships/wordVbaData","vbaData.xml"),this.macros={project:_,events:C.length>0?ZT(C):void 0,relationships:w}}if(this.coreProperties=new WT(k(k({},e),{},{creator:(t=e.creator)!==null&&t!==void 0?t:"Un-named",revision:(n=e.revision)!==null&&n!==void 0?n:1,lastModifiedBy:(r=e.lastModifiedBy)!==null&&r!==void 0?r:"Un-named"})),this.numbering=new ff(e.numbering?e.numbering:{config:[]}),this.comments=new u1((i=e.comments)!==null&&i!==void 0?i:{children:[]}),this.comments.ThreadData&&(this.commentsExtended=new g1(this.comments.ThreadData)),this.comments.CommentIdsData&&(this.commentsIds=new y1(this.comments.CommentIdsData)),this.fileRelationships=new be,this.customProperties=new YT((s=e.customProperties)!==null&&s!==void 0?s:[]),this.appProperties=new HT,this.footnotesWrapper=new mS,this.endnotesWrapper=new oS,this.contentTypes=new jT({macros:this.macros!==void 0}),((a=this.macros)===null||a===void 0?void 0:a.events)!==void 0&&this.contentTypes.addOverride("application/vnd.ms-word.vbaData+xml","/word/vbaData.xml"),e.bibliography!==void 0){let b=new be;b.addRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps","itemProps1.xml"),this.bibliography={sources:e.bibliography.sources,properties:JT(`{${bm().toUpperCase()}}`),relationships:b},this.contentTypes.addOverride("application/vnd.openxmlformats-officedocument.customXmlProperties+xml","/customXml/itemProps1.xml")}if(this.packageParts=new gf(this.contentTypes),this.documentWrapper=new nS({background:e.background,pageNumbers:e.pageNumbers}),this.settings=new KS({compatibilityModeVersion:e.compatabilityModeVersion,compatibility:e.compatibility,evenAndOddHeaders:!!e.evenAndOddHeaderAndFooters,trackRevisions:(o=e.features)===null||o===void 0?void 0:o.trackRevisions,updateFields:(c=e.features)===null||c===void 0?void 0:c.updateFields,embedFonts:!((l=e.fonts)===null||l===void 0)&&l.length?!0:void 0,defaultTabStop:e.defaultTabStop,protection:e.protection,hyphenation:{autoHyphenation:(u=e.hyphenation)===null||u===void 0?void 0:u.autoHyphenation,hyphenationZone:(d=e.hyphenation)===null||d===void 0?void 0:d.hyphenationZone,consecutiveHyphenLimit:(p=e.hyphenation)===null||p===void 0?void 0:p.consecutiveHyphenLimit,doNotHyphenateCaps:(h=e.hyphenation)===null||h===void 0?void 0:h.doNotHyphenateCaps}}),this.media=new mf(b=>this.packageParts.takePath("media","image",b)),e.externalStyles!==void 0){var m,g,y,T;let b=(m=(g=e.styles)===null||g===void 0?void 0:g.default)!==null&&m!==void 0?m:{},C=Object.entries(wc(b)),_=([x])=>b[x]!==void 0,w=new mC().newInstance(e.externalStyles);this.styles=new ul(k(k({},w),{},{paragraphStyles:(y=e.styles)===null||y===void 0?void 0:y.paragraphStyles,characterStyles:(T=e.styles)===null||T===void 0?void 0:T.characterStyles,importedStyles:[...C.filter(x=>!_(x)).map(([,x])=>x),...w.importedStyles,...C.filter(_).map(([,x])=>x)]}))}else if(e.styles){let b=new xh().newInstance(e.styles.default);this.styles=new ul(k(k({},b),e.styles))}else{let b=new xh;this.styles=new ul(b.newInstance())}this.addDefaultRelationships();for(let b of e.sections)this.addSection(b);if(e.footnotes)for(let b in e.footnotes)this.footnotesWrapper.View.createFootNote(parseFloat(b),e.footnotes[b].children);if(e.endnotes)for(let b in e.endnotes)this.endnotesWrapper.View.createEndnote(parseFloat(b),e.endnotes[b].children);this.fontWrapper=new Km((f=e.fonts)!==null&&f!==void 0?f:[]),this.theme=new TC(e.theme),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme","theme/theme1.xml"),this.macros!==void 0&&this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2006/relationships/vbaProject","vbaProject.bin"),this.bibliography!==void 0&&this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml","../customXml/item1.xml")}addSection({headers:e={},footers:t={},children:n,properties:r}){this.documentWrapper.View.Body.addSection(k(k({},r),{},{headerWrapperGroup:{default:e.default?this.createHeader(e.default):void 0,first:e.first?this.createHeader(e.first):void 0,even:e.even?this.createHeader(e.even):void 0},footerWrapperGroup:{default:t.default?this.createFooter(t.default):void 0,first:t.first?this.createFooter(t.first):void 0,even:t.even?this.createFooter(t.even):void 0}}));for(let i of n)this.documentWrapper.View.add(i)}createHeader(e){let t=new bS(this.media,this.currentRelationshipId++);for(let n of e.options.children)t.add(n);return this.addHeaderToDocument(t),t}createFooter(e){let t=new dS(this.media,this.currentRelationshipId++);for(let n of e.options.children)t.add(n);return this.addFooterToDocument(t),t}addHeaderToDocument(e,t=Ln.DEFAULT){this.headers.push({header:e,type:t}),this.documentWrapper.Relationships.addRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",`header${this.headers.length}.xml`),this.contentTypes.addHeader(this.headers.length)}addFooterToDocument(e,t=Ln.DEFAULT){this.footers.push({footer:e,type:t}),this.documentWrapper.Relationships.addRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",`footer${this.footers.length}.xml`),this.contentTypes.addFooter(this.footers.length)}addDefaultRelationships(){this.fileRelationships.addRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument","word/document.xml"),this.fileRelationships.addRelationship(2,"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"),this.fileRelationships.addRelationship(3,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties","docProps/app.xml"),this.fileRelationships.addRelationship(4,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties","docProps/custom.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles","styles.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering","numbering.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes","footnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes","endnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings","settings.xml"),this.comments.IsEmpty||(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments","comments.xml"),this.contentTypes.addComments()),this.commentsExtended&&(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2011/relationships/commentsExtended","commentsExtended.xml"),this.contentTypes.addCommentsExtended()),this.commentsIds&&(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2016/09/relationships/commentsIds","commentsIds.xml"),this.contentTypes.addCommentsIds())}get Document(){return this.documentWrapper}get Styles(){return this.styles}get CoreProperties(){return this.coreProperties}get Numbering(){return this.numbering}get Media(){return this.media}get FileRelationships(){return this.fileRelationships}get Headers(){return this.headers.map(e=>e.header)}get Footers(){return this.footers.map(e=>e.footer)}get ContentTypes(){return this.contentTypes}get CustomProperties(){return this.customProperties}get AppProperties(){return this.appProperties}get FootNotes(){return this.footnotesWrapper}get Endnotes(){return this.endnotesWrapper}get Settings(){return this.settings}get Comments(){return this.comments}get CommentsExtended(){return this.commentsExtended}get CommentsIds(){return this.commentsIds}get FontTable(){return this.fontWrapper}get Theme(){return this.theme}get PackageParts(){return this.packageParts}get Macros(){return this.macros}get Bibliography(){return this.bibliography}},sE=class extends P{constructor(e){super("w:sdtPr"),e&&this.root.push(new ot("w:alias",e))}},aE=e=>new L({name:"w:docPartObj",children:[new ot("w:docPartGallery",e),new L({name:"w:docPartUnique"})]}),oE=["contentChildren","cachedEntries","beginDirty","tabLeader"],Ff=class extends hc{constructor(e="Table of Contents",t={}){let{contentChildren:n=[],cachedEntries:r=[],beginDirty:i,tabLeader:s=E1.DOT}=t,a=Zl(t,oE);super("w:sdt"),E(this,"fromHeadings",void 0);let o=new sE(e);o.addChildElement(aE("Table of Contents")),this.root.push(o);let c=new _m,l=[new qe({children:[Nm(i),new Am(a),sn()]})],u=[new qe({children:[an()]})];if(r!==void 0&&r.length>0){let{stylesWithLevels:d}=a,p=r.map((f,m)=>{var g,y;let T=this.buildCachedContentParagraphChild(f,a),b=(g=d==null||(y=d.find(_=>_.level===f.level))===null||y===void 0?void 0:y.styleName)!==null&&g!==void 0?g:`TOC${f.level}`,C=m===0?[...l,T]:m===r.length-1?[T,...u]:[T];return new ne({style:b,tabStops:this.getTabStopsForLevel(f.level,s),children:C})}),h=p;r.length<=1&&(h=[...p,new ne({children:u})]);for(let f of h)c.addChildElement(f)}else{let d=new ne({children:l});c.addChildElement(d);for(let h of n)c.addChildElement(h);let p=new ne({children:u});c.addChildElement(p),n.length===0&&(this.fromHeadings={properties:a,beginDirty:i,tabLeader:s})}this.root.push(c)}prepForXml(e){let t=super.prepForXml(e);return $k(t,this.fromHeadings&&k(k({},this.fromHeadings),{},{textWidth:this.textWidthIn(e)})),t}textWidthIn(e){var t,n;return(t=(n=e.file)===null||n===void 0||(n=n.Document)===null||n===void 0||(n=n.View.Body.getSectionPropertiesFor(this))===null||n===void 0?void 0:n.AvailableTextWidth)!==null&&t!==void 0?t:Ps}getTabStopsForLevel(e,t,n=9025){return[{type:"clear",position:n+1-(e-1)*240},{type:"right",position:n,leader:t}]}buildCachedContentRun(e,t){var n,r;return new qe({style:t?.hyperlink&&e.href!==void 0?"IndexLink":void 0,children:[new Mr({text:e.title}),new Xs,new Mr({text:(n=(r=e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""})]})}buildCachedContentParagraphChild(e,t){let n=this.buildCachedContentRun(e,t);return t?.hyperlink&&e.href!==void 0?new Fm({anchor:e.href,children:[n]}):n}},Er=0,kl=32,lE=32,cE=(e,t)=>{let n=t.replace(/-/g,"");if(n.length!==lE)throw new Error(`Error: Cannot extract GUID from font filename: ${t}`);let r=n.replace(/(..)/g,"$1 ").trim().split(" ").map(a=>parseInt(a,16));r.reverse();let i=e.slice(Er,kl).map((a,o)=>a^r[o%r.length]),s=new Uint8Array(Er+i.length+Math.max(0,e.length-kl));return s.set(e.slice(0,Er)),s.set(i,Er),s.set(e.slice(kl),Er+i.length),s},dn=class{format(e,t={stack:[]}){let n=e.prepForXml(t);if(n)return n;throw Error("XMLComponent did not format correctly")}},qf=/\{([^{}]+)\}/g,Hf=(e,t)=>t.size===0?e:e.replace(qf,(n,r)=>{var i;return(i=t.get(r))!==null&&i!==void 0?i:n}),dE=e=>new Set(Array.from(e.matchAll(qf),([,t])=>t)),Uf=class{replace(e,t,n){return Hf(e,new Map(t.map((r,i)=>[r.key,(n+i).toString()])))}getMediaData(e,t){let n=dE(e);return t.Entries.filter(([r])=>n.has(r)).map(([r,{fileName:i}])=>({key:r,fileName:i}))}},pE=class{replace(e,t){return Hf(e,new Map(t.map(({reference:n,instance:r,restartedListId:i,numId:s})=>[Bs(n,r,i),s.toString()])))}},uE=new dn,Tl=(e,t,n,r,i=!0)=>j(uE.format(t,{viewWrapper:{View:t,Relationships:r},file:e,stack:[]}),{indent:n,declaration:i?{standalone:"yes",encoding:"UTF-8"}:{encoding:"UTF-8"}}),hE=(e,t,n,r)=>{let{content:i}=t.options;if(i instanceof Uint8Array)return[{data:i,path:`word/${n}`}];if("files"in i)return[{data:qs(i.files.map(({path:l,content:u})=>[l,u instanceof Uint8Array?u:Tl(e,u,r,new be)])),path:`word/${n}`}];let s=e.PackageParts.createRelationships(n),a=Tl(e,i,r,s),o=n.slice(0,n.lastIndexOf("/")),c=n.slice(n.lastIndexOf("/")+1);return[{data:a,path:`word/${n}`},...s.RelationshipCount>0?[{data:Tl(e,s,r,s,!1),path:`word/${o}/_rels/${c}.rels`}]:[]]},Tc=(e,t,n=0)=>{let r=e.PackageParts.Array.slice(n);return r.length===0?[]:[...r.flatMap(({part:i,path:s})=>hE(e,i,s,t)),...Tc(e,t,n+r.length)]},mE=["PackageParts"],fE=class{constructor(){E(this,"formatter",void 0),E(this,"imageReplacer",void 0),E(this,"numberingReplacer",void 0),this.formatter=new dn,this.imageReplacer=new Uf,this.numberingReplacer=new pE}compile(e,t,n=[]){let r=this.xmlifyFile(e,t),{PackageParts:i}=r,s=Zl(r,mE),a=Object.values(s).flatMap(o=>Array.isArray(o)?o:[o]);return new Map([...a.map(({path:o,data:c})=>[o,c]),...i.map(({path:o,data:c})=>[o,c]),...n.map(({path:o,data:c})=>[o,c]),...e.Macros===void 0?[]:[["word/vbaProject.bin",e.Macros.project]],...e.Media.Array.map(o=>[`word/media/${o.fileName}`,o.data]),...e.FontTable.files.map(({data:o,fontKey:c},l)=>[`word/fonts/font${l+1}.odttf`,cE(o,c)])])}xmlifyFile(e,t){var n;let r=j(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),i=j(this.formatter.format(e.Comments,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),s=j(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),a=j(this.formatter.format(e.Endnotes.View,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),o=e.Document.Relationships.RelationshipCount+1,c=e.Comments.Relationships.RelationshipCount+1,l=e.FootNotes.Relationships.RelationshipCount+1,u=e.Endnotes.Relationships.RelationshipCount+1,d=this.imageReplacer.getMediaData(r,e.Media),p=this.imageReplacer.getMediaData(i,e.Media),h=this.imageReplacer.getMediaData(s,e.Media),f=this.imageReplacer.getMediaData(a,e.Media);return k(k(k(k(k(k({Relationships:{data:(()=>{let m=be.copy(e.Document.Relationships);return d.forEach((g,y)=>{m.addRelationship(o+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),m.addRelationship(m.RelationshipCount+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"),j(this.formatter.format(m,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{let m=this.imageReplacer.replace(r,d,o);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{let m=j(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:j(this.formatter.format(e.CoreProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},FileRelationships:{data:j(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:e.Headers.map((m,g)=>{let y=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(y,e.Media),b=be.copy(m.Relationships);return T.forEach((C,_)=>{b.addRelationship(_,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${C.fileName}`)}),{data:j(this.formatter.format(b,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${g+1}.xml.rels`}}),FooterRelationships:e.Footers.map((m,g)=>{let y=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(y,e.Media),b=be.copy(m.Relationships);return T.forEach((C,_)=>{b.addRelationship(_,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${C.fileName}`)}),{data:j(this.formatter.format(b,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${g+1}.xml.rels`}}),Headers:e.Headers.map((m,g)=>{let y=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(y,e.Media),b=this.imageReplacer.replace(y,T,0);return{data:this.numberingReplacer.replace(b,e.Numbering.ConcreteNumbering),path:`word/header${g+1}.xml`}}),Footers:e.Footers.map((m,g)=>{let y=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(y,e.Media),b=this.imageReplacer.replace(y,T,0);return{data:this.numberingReplacer.replace(b,e.Numbering.ConcreteNumbering),path:`word/footer${g+1}.xml`}}),CustomProperties:{data:j(this.formatter.format(e.CustomProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:j(this.formatter.format(e.AppProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:(()=>{let m=this.imageReplacer.replace(s,h,l);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/footnotes.xml"},FootNotesRelationships:{data:(()=>{let m=be.copy(e.FootNotes.Relationships);return h.forEach((g,y)=>{m.addRelationship(l+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),j(this.formatter.format(m,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/footnotes.xml.rels"},Endnotes:{data:(()=>{let m=this.imageReplacer.replace(a,f,u);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/endnotes.xml"},EndnotesRelationships:{data:(()=>{let m=be.copy(e.Endnotes.Relationships);return f.forEach((g,y)=>{m.addRelationship(u+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),j(this.formatter.format(m,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/endnotes.xml.rels"},Settings:{data:j(this.formatter.format(e.Settings,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"}},e.Comments.IsEmpty?{}:{Comments:{data:(()=>{let m=this.imageReplacer.replace(i,p,c);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/comments.xml"},CommentsRelationships:{data:(()=>{let m=be.copy(e.Comments.Relationships);return p.forEach((g,y)=>{m.addRelationship(c+y,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),j(this.formatter.format(m,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/comments.xml.rels"}}),e.CommentsExtended?{CommentsExtended:{data:j(this.formatter.format(e.CommentsExtended,{viewWrapper:{View:e.CommentsExtended,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/commentsExtended.xml"}}:{}),e.CommentsIds?{CommentsIds:{data:j(this.formatter.format(e.CommentsIds,{viewWrapper:{View:e.CommentsIds,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/commentsIds.xml"}}:{}),{},{FontTable:{data:j(this.formatter.format(e.FontTable.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:j(this.formatter.format(e.FontTable.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/fontTable.xml.rels"},Theme:{data:j(this.formatter.format(e.Theme,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/theme/theme1.xml"}},!((n=e.Macros)===null||n===void 0)&&n.events?{MacroEvents:{data:j(this.formatter.format(e.Macros.events,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/vbaData.xml"},MacroRelationships:{data:j(this.formatter.format(e.Macros.relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/vbaProject.bin.rels"}}:{}),e.Bibliography?{BibliographySources:{data:j(this.formatter.format(e.Bibliography.sources,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"customXml/item1.xml"},BibliographySourcesProperties:{data:j(this.formatter.format(e.Bibliography.properties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"no",encoding:"UTF-8"}}),path:"customXml/itemProps1.xml"},BibliographySourcesRelationships:{data:j(this.formatter.format(e.Bibliography.relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"customXml/_rels/item1.xml.rels"}}:{}),{},{PackageParts:Tc(e,t),Numbering:{data:j(this.formatter.format(e.Numbering,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},ContentTypes:{data:j(this.formatter.format(e.ContentTypes,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"}})}},Ih=Zy(((e,t)=>{var n=typeof Reflect=="object"?Reflect:null,r=n&&typeof n.apply=="function"?n.apply:function(x,v,A){return Function.prototype.apply.call(x,v,A)},i;n&&typeof n.ownKeys=="function"?i=n.ownKeys:Object.getOwnPropertySymbols?i=function(x){return Object.getOwnPropertyNames(x).concat(Object.getOwnPropertySymbols(x))}:i=function(x){return Object.getOwnPropertyNames(x)};function s(w){console&&console.warn&&console.warn(w)}var a=Number.isNaN||function(x){return x!==x};function o(){o.init.call(this)}t.exports=o,t.exports.once=b,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var c=10;function l(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(w){if(typeof w!="number"||w<0||a(w))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+w+".");c=w}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(x){if(typeof x!="number"||x<0||a(x))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+x+".");return this._maxListeners=x,this};function u(w){return w._maxListeners===void 0?o.defaultMaxListeners:w._maxListeners}o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(x){for(var v=[],A=1;A<arguments.length;A++)v.push(arguments[A]);var N=x==="error",D=this._events;if(D!==void 0)N=N&&D.error===void 0;else if(!N)return!1;if(N){var O;if(v.length>0&&(O=v[0]),O instanceof Error)throw O;var F=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw F.context=O,F}var Q=D[x];if(Q===void 0)return!1;if(typeof Q=="function")r(Q,this,v);else for(var Z=Q.length,V=g(Q,Z),A=0;A<Z;++A)r(V[A],this,v);return!0};function d(w,x,v,A){var N,D,O;if(l(v),D=w._events,D===void 0?(D=w._events=Object.create(null),w._eventsCount=0):(D.newListener!==void 0&&(w.emit("newListener",x,v.listener?v.listener:v),D=w._events),O=D[x]),O===void 0)O=D[x]=v,++w._eventsCount;else if(typeof O=="function"?O=D[x]=A?[v,O]:[O,v]:A?O.unshift(v):O.push(v),N=u(w),N>0&&O.length>N&&!O.warned){O.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=w,F.type=x,F.count=O.length,s(F)}return w}o.prototype.addListener=function(x,v){return d(this,x,v,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(x,v){return d(this,x,v,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(w,x,v){var A={fired:!1,wrapFn:void 0,target:w,type:x,listener:v},N=p.bind(A);return N.listener=v,A.wrapFn=N,N}o.prototype.once=function(x,v){return l(v),this.on(x,h(this,x,v)),this},o.prototype.prependOnceListener=function(x,v){return l(v),this.prependListener(x,h(this,x,v)),this},o.prototype.removeListener=function(x,v){var A,N,D,O,F;if(l(v),N=this._events,N===void 0)return this;if(A=N[x],A===void 0)return this;if(A===v||A.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete N[x],N.removeListener&&this.emit("removeListener",x,A.listener||v));else if(typeof A!="function"){for(D=-1,O=A.length-1;O>=0;O--)if(A[O]===v||A[O].listener===v){F=A[O].listener,D=O;break}if(D<0)return this;D===0?A.shift():y(A,D),A.length===1&&(N[x]=A[0]),N.removeListener!==void 0&&this.emit("removeListener",x,F||v)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(x){var v,A=this._events,N;if(A===void 0)return this;if(A.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):A[x]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete A[x]),this;if(arguments.length===0){var D=Object.keys(A),O;for(N=0;N<D.length;++N)O=D[N],O!=="removeListener"&&this.removeAllListeners(O);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=A[x],typeof v=="function")this.removeListener(x,v);else if(v!==void 0)for(N=v.length-1;N>=0;N--)this.removeListener(x,v[N]);return this};function f(w,x,v){var A=w._events;if(A===void 0)return[];var N=A[x];return N===void 0?[]:typeof N=="function"?v?[N.listener||N]:[N]:v?T(N):g(N,N.length)}o.prototype.listeners=function(x){return f(this,x,!0)},o.prototype.rawListeners=function(x){return f(this,x,!1)},o.listenerCount=function(w,x){return typeof w.listenerCount=="function"?w.listenerCount(x):m.call(w,x)},o.prototype.listenerCount=m;function m(w){var x=this._events;if(x!==void 0){var v=x[w];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(w,x){for(var v=new Array(x),A=0;A<x;++A)v[A]=w[A];return v}function y(w,x){for(;x+1<w.length;x++)w[x]=w[x+1];w.pop()}function T(w){for(var x=new Array(w.length),v=0;v<x.length;++v)x[v]=w[v].listener||w[v];return x}function b(w,x){return new Promise(function(v,A){function N(O){w.removeListener(x,D),A(O)}function D(){typeof w.removeListener=="function"&&w.removeListener("error",N),v([].slice.call(arguments))}_(w,x,D,{once:!0}),x!=="error"&&C(w,N,{once:!0})})}function C(w,x,v){typeof w.on=="function"&&_(w,"error",x,v)}function _(w,x,v,A){if(typeof w.on=="function")A.once?w.once(x,v):w.on(x,v);else if(typeof w.addEventListener=="function")w.addEventListener(x,function N(D){A.once&&w.removeEventListener(x,N),v(D)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof w)}}))();gE=class extends Ih.EventEmitter{pipe(e,t){let n=this,r=e,i=d=>{r.writable&&r.write(d)===!1&&n.pause&&n.pause()};n.on("data",i);let s=()=>{n.readable&&n.resume&&n.resume()};r.on("drain",s),!r._isStdio&&(!t||t.end!==!1)&&(n.on("end",o),n.on("close",c));let a=!1;function o(){a||(a=!0,r.end())}function c(){a||(a=!0,typeof r.destroy=="function"&&r.destroy())}function l(d){if(u(),Ih.EventEmitter.listenerCount(this,"error")===0)throw d}n.on("error",l),r.on("error",l);function u(){n.removeListener("data",i),r.removeListener("drain",s),n.removeListener("end",o),n.removeListener("close",c),n.removeListener("error",l),r.removeListener("error",l),n.removeListener("end",u),n.removeListener("close",u),r.removeListener("close",u)}return n.on("end",u),n.on("close",u),r.on("close",u),r.emit("pipe",n),r}};bE={NONE:"",WITH_2_BLANKS:" ",WITH_4_BLANKS:" ",WITH_TAB:" "},Rh=e=>e===!0?bE.WITH_2_BLANKS:e===!1?void 0:e,Lh=e=>e.Macros===void 0?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/vnd.ms-word.document.macroEnabled.12",Sc=class Rn{static pack(t,n,r){var i=this;return Kt(function*(s,a,o,c=[]){return jl(qs(i.compiler.compile(s,Rh(o),c)),a,Lh(s))}).apply(this,arguments)}static toString(t,n,r=[]){return Rn.pack(t,"string",n,r)}static toBuffer(t,n,r=[]){return Rn.pack(t,"nodebuffer",n,r)}static toBase64String(t,n,r=[]){return Rn.pack(t,"base64",n,r)}static toBlob(t,n,r=[]){return Rn.pack(t,"blob",n,r)}static toArrayBuffer(t,n,r=[]){return Rn.pack(t,"arraybuffer",n,r)}static toStream(t,n,r=[]){let i=new gE,s=this.compiler.compile(t,Rh(n),r);return new Promise(a=>setTimeout(a)).then(()=>jl(qs(s),"nodebuffer",Lh(t))).then(a=>{i.emit("data",a),i.emit("end")},a=>i.emit("error",a)),i}};E(Sc,"compiler",new fE);jf=e=>{var t;if(e.name!=="w:bookmarkStart"&&e.name!=="w:bookmarkEnd")return;let n=Number((t=e.attributes)===null||t===void 0?void 0:t["w:id"]);return Number.isInteger(n)?n:void 0},Wf=e=>{var t;let n=jf(e);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(Wf)]},vE=e=>{let t=new Set(e),n=new Map,r=e.reduce((a,o)=>Math.max(a,o),0),i=a=>{let o=n.get(a);if(o!==void 0)return o;let c=t.has(a)?r+1:a;return r=Math.max(r,c),t.add(c),n.set(a,c),c},s=a=>{let o=jf(a);return k(k(k({},a),o===void 0?{}:{attributes:k(k({},a.attributes),{},{"w:id":String(i(o))})}),a.elements===void 0?{}:{elements:a.elements.map(s)})};return a=>a.map(s)},wE=new dn,ta=e=>new TextDecoder("utf-8",{ignoreBOM:!0}).decode(e),pt=e=>Wr(e,{keepWhitespaceText:!0}),Kf=e=>{var t;return(t=pt(j(wE.format(new Mr({text:e})))).elements[0].elements)!==null&&t!==void 0?t:[]},Gf=e=>k(k({},e),{},{attributes:{"xml:space":"preserve"}}),Te=(e,t)=>{var n,r;let i=(n=e.elements)===null||n===void 0?void 0:n.find(s=>s.name===t);return i===void 0?[]:((r=i.elements)!==null&&r!==void 0||(i.elements=[]),i.elements)},zf=e=>{if(!e?.start.trim()||!e?.end.trim())throw new Error("Both start and end delimiters must be non-empty strings.")},On=(e,t,n)=>{let r=Te(e,"Types");r.some(i=>{var s,a;return i.type==="element"&&i.name==="Default"&&(i==null||(s=i.attributes)===null||s===void 0?void 0:s.ContentType)===t&&(i==null||(a=i.attributes)===null||a===void 0?void 0:a.Extension)===n})||r.push({attributes:{ContentType:t,Extension:n},name:"Default",type:"element"})},yE=(e,t,n)=>{let r=Te(e,"Types");r.some(i=>{var s;return i.type==="element"&&i.name==="Override"&&((s=i.attributes)===null||s===void 0?void 0:s.PartName)===n})||r.push({attributes:{ContentType:t,PartName:n},name:"Override",type:"element"})},xE=(e,t)=>{var n;let r=(n=e.elements)===null||n===void 0?void 0:n.find(i=>i.name==="Types");r?.elements!==void 0&&(r.elements=r.elements.filter(i=>{var s,a;return!(i.name==="Override"&&String((s=(a=i.attributes)===null||a===void 0?void 0:a.PartName)!==null&&s!==void 0?s:"").toLowerCase()===t.toLowerCase())}))},kE=e=>{let t=parseInt(e.substring(3),10);return isNaN(t)?0:t},Cc=e=>Te(e,"Relationships").map(t=>{var n,r;return kE((n=(r=t.attributes)===null||r===void 0||(r=r.Id)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"")}).reduce((t,n)=>Math.max(t,n),0)+1,Kl=(e,t,n,r,i)=>{let s=Te(e,"Relationships");return s.push({attributes:{Id:`rId${t}`,Type:n,Target:r,TargetMode:i},name:"Relationship",type:"element"}),s},Ur=()=>({declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"Relationships",attributes:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},elements:[]}]}),Dh="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",TE="application/vnd.openxmlformats-package.core-properties+xml",Mh="_rels/.rels",Bh="docProps/core.xml",Gl={cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/"},SE={title:{namespace:"dc",name:"title"},subject:{namespace:"dc",name:"subject"},creator:{namespace:"dc",name:"creator"},keywords:{namespace:"cp",name:"keywords"},description:{namespace:"dc",name:"description"},lastModifiedBy:{namespace:"cp",name:"lastModifiedBy"},revision:{namespace:"cp",name:"revision"}},$h=e=>e===""?[]:[{type:"text",text:String(e)}],Fh=e=>{var t;return(t=e.name)===null||t===void 0?void 0:t.slice(e.name.indexOf(":")+1)},CE=(e,t)=>{var n;let r=(n=Object.entries(k({},e.attributes)).find(([i,s])=>(i==="xmlns"||i.startsWith("xmlns:"))&&s===Gl[t]))===null||n===void 0?void 0:n[0];return r===void 0?(e.attributes=k(k({},e.attributes),{},{[`xmlns:${t}`]:Gl[t]}),`${t}:`):r==="xmlns"?"":`${r.slice(6)}:`},EE=e=>{let t=e[0]===255&&e[1]===254?"utf-16le":e[0]===254&&e[1]===255?"utf-16be":"utf-8";return new TextDecoder(t).decode(e)},AE=(e,t,n)=>{var r;let i=t.get(n);if(i===void 0)return e.get(n);let s=pt(EE(i));return!((r=s.declaration)===null||r===void 0)&&r.attributes&&(s.declaration.attributes.encoding="UTF-8"),t.delete(n),e.set(n,s),s},_E=e=>{var t,n;let r=(t=e.get(Mh))!==null&&t!==void 0?t:Ur(),i=(n=Te(r,"Relationships").find(s=>{var a;return((a=s.attributes)===null||a===void 0?void 0:a.Type)===Dh}))===null||n===void 0||(n=n.attributes)===null||n===void 0?void 0:n.Target;return typeof i=="string"?cn("",i):(Kl(r,Cc(r),Dh,Bh),e.set(Mh,r),Bh)},NE=(e,t,n,{addContentTypeOverride:r})=>{var i,s;let a=_E(e),o=AE(e,t,a),c=o??{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"cp:coreProperties",attributes:{"xmlns:cp":Gl.cp},elements:[]}]};o===void 0&&(e.set(a,c),r(TE,`/${a}`));let l=(i=c.elements)===null||i===void 0?void 0:i.find(u=>Fh(u)==="coreProperties");if(l===void 0)throw new Error(`Could not find the core properties in ${a}`);(s=l.elements)!==null&&s!==void 0||(l.elements=[]);for(let[u,{namespace:d,name:p}]of Object.entries(SE)){let h=n[u];if(h===void 0)continue;let f=l.elements.find(m=>Fh(m)===p);f?f.elements=$h(h):l.elements.push({type:"element",name:`${CE(l,d)}${p}`,elements:$h(h)})}},zl=new Set(["wp:inline","wp:anchor"]),Ec=new Set(["wp:docPr","wps:cNvPr","wpg:cNvPr"]),PE=new Set(["a:stCxn","a:endCxn"]),Hs=(e,t)=>{var n,r;if(!t.has((n=e.name)!==null&&n!==void 0?n:""))return;let i=Number((r=e.attributes)===null||r===void 0?void 0:r.id);return Number.isInteger(i)?i:void 0},Vf=e=>{var t;let n=Hs(e,Ec);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(Vf)]},IE=e=>{let t=n=>{var r;let i=Hs(n,Ec);return[...i===void 0?[]:[i],...((r=n.elements)!==null&&r!==void 0?r:[]).flatMap(s=>{var a;return zl.has((a=s.name)!==null&&a!==void 0?a:"")?[]:t(s)})]};return t(e)},OE=e=>{let t=new Set(e),n=e.reduce((a,o)=>Math.max(a,o),0),r=a=>{let o=t.has(a)?n+1:a;return n=Math.max(n,o),t.add(o),o},i=a=>{let o=new Map([...new Set(IE(a))].map(l=>[l,r(l)])),c=l=>{var u,d;if(l!==a&&zl.has((u=l.name)!==null&&u!==void 0?u:""))return i(l);let p=(d=Hs(l,Ec))!==null&&d!==void 0?d:Hs(l,PE),h=p===void 0?void 0:o.get(p);return k(k(k({},l),h===void 0?{}:{attributes:k(k({},l.attributes),{},{id:String(h)})}),l.elements===void 0?{}:{elements:l.elements.map(c)})};return c(a)},s=a=>{var o;return zl.has((o=a.name)!==null&&o!==void 0?o:"")?i(a):k(k({},a),a.elements===void 0?{}:{elements:a.elements.map(s)})};return a=>a.map(s)},Ce={DOCUMENT:"file",PARAGRAPH:"paragraph",TABLE_ROWS:"tableRows",DRAWING:"drawing"},RE=new Map([["wp:inline","wp:docPr"],["wp:anchor","wp:docPr"],["wpg:graphicFrame","wpg:cNvPr"],["wpc:graphicFrame","wpg:cNvPr"]]),na=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(n=>{var r;let i=n.name===void 0?void 0:RE.get(n.name),s=i===void 0||(r=n.elements)===null||r===void 0?void 0:r.find(a=>a.name===i);return[...s?[{element:n,properties:s}]:[],...na(n)]})},Xf=e=>{var t,n;return[(t=e.attributes)===null||t===void 0?void 0:t.descr,(n=e.attributes)===null||n===void 0?void 0:n.title].flatMap(r=>r===void 0?[]:[String(r)])},qh="[Content_Types].xml",LE=e=>{var t;if(!(!((t=e.elements)===null||t===void 0)&&t.some(r=>r.name==="Relationships"))){var n;e.elements=[...(n=e.elements)!==null&&n!==void 0?n:[],...Ur().elements]}return Te(e,"Relationships")},DE="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Vl=e=>{var t,n;return new Set(["r",...Object.entries((t=e.attributes)!==null&&t!==void 0?t:{}).flatMap(([r,i])=>r.startsWith("xmlns:")&&i===DE?[r.slice(6)]:[]),...((n=e.elements)!==null&&n!==void 0?n:[]).flatMap(r=>[...Vl(r)])])},Xl=(e,t)=>{var n,r;return new Set([...Object.entries((n=e.attributes)!==null&&n!==void 0?n:{}).flatMap(([i,s])=>i.includes(":")&&t.has(i.slice(0,i.indexOf(":")))?[String(s)]:[]),...((r=e.elements)!==null&&r!==void 0?r:[]).flatMap(i=>[...Xl(i,t)])])},ME=(e,t)=>{let n=l=>e.has(l)||t.has(l),r=l=>{if(n(l))return l;let u=(()=>{try{return decodeURI(l)}catch{return}})();if(u!==void 0&&n(u))return u;let d=l.toLowerCase();return[...e.keys(),...t.keys()].find(p=>p.toLowerCase()===d)},i=(l,u)=>{let d=e.get(Qe(l));return d===void 0?void 0:Te(d,"Relationships").find(p=>{var h;return p.name==="Relationship"&&((h=p.attributes)===null||h===void 0?void 0:h.Id)===u})},s=(l,u)=>{var d,p;let h=(d=u.attributes)===null||d===void 0?void 0:d.Target;return((p=u.attributes)===null||p===void 0?void 0:p.TargetMode)==="External"||h===void 0?void 0:r(cn(l,String(h)))},a=l=>[...e].some(([u,d])=>u.endsWith(".rels")&&Te(d,"Relationships").some(p=>s(Af(u),p)===l)),o=(l,u)=>{if(u===void 0||u===l||u===qh||u.endsWith(".rels")||a(u))return;let d=e.get(Qe(u));e.delete(u),t.delete(u),e.delete(Qe(u));let p=e.get(qh);p!==void 0&&xE(p,`/${u}`);for(let h of d===void 0?[]:Te(d,"Relationships"))o(u,s(u,h))};return{findRelationship:i,pathOf:s,removeIfUnreferenced:o,removeRelationships:(l,u)=>{var d,p;let h=(d=e.get(Qe(l)))===null||d===void 0||(d=d.elements)===null||d===void 0?void 0:d.find(m=>m.name==="Relationships"),f=((p=h?.elements)!==null&&p!==void 0?p:[]).filter(m=>{var g;return m.name==="Relationship"&&u.has(String((g=m.attributes)===null||g===void 0?void 0:g.Id))});if(!(h===void 0||f.length===0)){h.elements=h.elements.filter(m=>!f.includes(m));for(let m of f)o(l,s(l,m))}}}},BE=(e,{findRelationship:t,pathOf:n,removeIfUnreferenced:r},i,s)=>{let a=new dn;return{getRelatedPart:(o,c)=>{let l=t(o.path,c),u=l===void 0?void 0:n(o.path,l);return u===void 0?void 0:{path:u,xml:e.get(u)}},replaceRelatedPart:(o,c,l)=>{let u=`word/${i.PackageParts.add(l)}`,{relationshipType:d}=l.options,p=yc(o.path,u),h=c===void 0?void 0:t(o.path,c);if(h===void 0){var f;let g=Qe(o.path),y=(f=e.get(g))!==null&&f!==void 0?f:Ur();e.set(g,y);let T=c??`rId${Cc(y)}`;return LE(y).push({type:"element",name:"Relationship",attributes:{Id:T,Type:d,Target:p}}),T}let m=n(o.path,h);return h.attributes=k(k({},Object.fromEntries(Object.entries(h.attributes).filter(([g])=>g!=="TargetMode"))),{},{Type:d,Target:p}),r(o.path,m),String(h.attributes.Id)},format:o=>pt(j(a.format(o,s))).elements[0]}},$E=({parts:e,binaryParts:t,file:n,patches:r,delimiters:i},s)=>{let a=r.map(([l,u])=>({placeholder:`${i.start}${l}${i.end}`,patch:u})),o=[...e].filter(([l])=>l.startsWith("word/")&&!l.endsWith(".rels")).flatMap(([l,u])=>na(u).flatMap(d=>{let p=Xf(d.properties),h=a.filter(({placeholder:g})=>p.some(y=>y.includes(g)));if(h.length>1){var f,m;throw new Error(`The drawing "${(f=(m=d.properties.attributes)===null||m===void 0?void 0:m.name)!==null&&f!==void 0?f:""}" in ${l} has the placeholders ${h.map(({placeholder:g})=>g).join(" and ")} in its alt text. A drawing can only be patched once`)}return h.map(({placeholder:g,patch:y})=>({drawing:k(k({placeholder:g},d),{},{part:{path:l,xml:u}}),patch:y}))})),c=ME(e,t);for(let{drawing:l,patch:u}of o){let d=Xl(l.element,Vl(l.part.xml));u.patch(l,BE(e,c,n,s(l.part.path)));let p=Xl(l.part.xml,Vl(l.part.xml));c.removeRelationships(l.part.path,new Set([...d].filter(h=>!p.has(h))))}},FE=e=>typeof e=="object"&&e!==null&&"on"in e&&typeof e.on=="function",qE=e=>typeof e=="object"&&e!==null&&"generateAsync"in e&&typeof e.generateAsync=="function",HE=e=>["[object Blob]","[object File]"].includes(Object.prototype.toString.call(e)),UE=e=>new Promise((t,n)=>{let r=[];e.on("data",i=>{ArrayBuffer.isView(i)?r.push(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)):typeof i=="number"?r.push(i):n(new TypeError(`A template stream must give bytes, but it gave a ${typeof i}. A stream with an encoding set gives text, so do not set one.`))}),e.on("error",n),e.on("end",()=>{let i=new Uint8Array(r.reduce((s,a)=>s+(typeof a=="number"?1:a.length),0));r.reduce((s,a)=>typeof a=="number"?(i[s]=a,s+1):(i.set(a,s),s+a.length),0),t(i)})}),jE=(function(){var e=Kt(function*(t){return qE(t)?t.generateAsync({type:"uint8array"}):FE(t)?UE(t):HE(t)?new Uint8Array(yield t.arrayBuffer()):typeof t=="string"?Uint8Array.from({length:t.length},(n,r)=>t.charCodeAt(r)):Array.isArray(t)?Uint8Array.from(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)});return function(n){return e.apply(this,arguments)}})(),Yf=(function(){var e=Kt(function*(t,n){return Bf(yield jE(t),n)});return function(n,r){return e.apply(this,arguments)}})(),WE=new dn,Cs="word/document.xml",KE={path:"word/footnotes.xml",rootName:"w:footnotes",noteName:"w:footnote",referenceName:"w:footnoteReference",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",create:{part:()=>new hf,mark:()=>new uf,styles:()=>[new wf({}),new xf({}),new yf({})]}},GE={path:"word/endnotes.xml",rootName:"w:endnotes",noteName:"w:endnote",referenceName:"w:endnoteReference",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",create:{part:()=>new pf,mark:()=>new lf,styles:()=>[new kf({}),new Sf({}),new Tf({})]}},Es=(e,t)=>pt(j(WE.format(e,t))).elements[0],Jf=(e,t)=>{var n,r,i;let s=t.includes((n=e.name)!==null&&n!==void 0?n:"")?Number((r=e.attributes)===null||r===void 0?void 0:r["w:id"]):NaN;return[...Number.isInteger(s)?[s]:[],...((i=e.elements)!==null&&i!==void 0?i:[]).flatMap(a=>Jf(a,t))]},zE=(e,t)=>{var n,r;let i=(n=e.elements)!==null&&n!==void 0?n:[],s=((r=i[0])===null||r===void 0?void 0:r.name)==="w:pPr"?1:0;return k(k({},e),{},{elements:[...i.slice(0,s),t,...i.slice(s)]})},Hh=(e,t,n,{createContext:r,addContentTypeOverride:i,renumberBookmarks:s,renumberDrawings:a,renumberLists:o,useStyles:c})=>{let l=new Map(Object.entries(t).map(([T,b])=>[Number(T),b])),u=new Map,d=[...l.keys()].filter(Number.isFinite).reduce((T,b)=>Math.max(T,Math.floor(b)),0),p=new Map,h,f=T=>{var b,C;let _=T.name===e.referenceName?l.get(Number((b=T.attributes)===null||b===void 0?void 0:b["w:id"])):void 0;return _===void 0?T.elements===void 0?T:k(k({},T),{},{elements:T.elements.map(f)}):(h=((C=h)!==null&&C!==void 0?C:[...n.values()].flatMap(w=>Jf(w,[e.noteName,e.referenceName])).reduce((w,x)=>Math.max(w,x),0))+1,p.set(h,_),k(k({},T),{},{attributes:k(k({},T.attributes),{},{"w:id":String(h)})}))},m=()=>{var T;let b=Te((T=n.get(Qe(Cs)))!==null&&T!==void 0?T:{},"Relationships").find(_=>{var w;return((w=_.attributes)===null||w===void 0?void 0:w.Type)===e.relationshipType}),C=b?cn(Cs,String(b.attributes.Target)):e.path;return n.has(C)||(n.set(C,{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[Es(e.create.part(),r(C))]}),i(e.contentType,`/${C}`)),b||r(Cs).viewWrapper.Relationships.addRelationship($n(),e.relationshipType,yc(Cs,C)),C};return{renumber:T=>T.map(f),write:()=>{if(p.size===0)return;let T=m(),b=r(T),C=new Map([...new Set(p.values())].map(w=>{let x=Es(e.create.mark(),b);return[w,c(o(s(w.children.map(v=>Es(v,b)).map((v,A)=>A===0?zE(v,x):v))))]}));Te(n.get(T),e.rootName).push(...[...p].map(([w,x])=>({type:"element",name:e.noteName,attributes:{"w:id":String(w)},elements:[...a(C.get(x))]})));let _=n.get("word/styles.xml");if(_){let w=Te(_,"w:styles"),x=new Set(w.map(v=>{var A;return(A=v.attributes)===null||A===void 0?void 0:A["w:styleId"]}));w.push(...e.create.styles().map(v=>Es(v,b)).filter(v=>{var A;return!x.has((A=v.attributes)===null||A===void 0?void 0:A["w:styleId"])}))}},carry:(T,b)=>{let C=u.get(T);return C!==void 0?C:(d++,l.set(d,b),u.set(T,d),d)}}},VE=({footnotes:e={},endnotes:t={}},n,r)=>{let i={footnotes:Hh(KE,e,n,r),endnotes:Hh(GE,t,n,r)};return{carry:(s,a,o)=>i[s].carry(a,o),renumber:s=>Object.values(i).reduce((a,o)=>o.renumber(a),s),write:()=>{for(let s of Object.values(i))s.write()}}},XE=new dn,As="word/document.xml",YE="word/numbering.xml",JE="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Uh="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",QE="default-bullet-numbering",ZE="1",e2=(e,t)=>pt(j(XE.format(e,t))).elements[0],jh=e=>e.reduce((t,n)=>Math.max(t,n),0),t2=(e,t,{createContext:n,addContentTypeOverride:r})=>{let i=new Map,s,a=()=>{var f;return Te((f=t.get(Qe(As)))!==null&&f!==void 0?f:{},"Relationships").find(m=>{var g;return((g=m.attributes)===null||g===void 0?void 0:g.Type)===Uh})},o=(f=a())=>f?cn(As,String(f.attributes.Target)):YE,c=(f,m)=>{var g;return Te((g=t.get(o()))!==null&&g!==void 0?g:{},"w:numbering").filter(y=>y.name===f).map(y=>Number(y.attributes[m]))},l=f=>{if(f===ZE)return e.ConcreteNumbering.find(({reference:g})=>g===QE);if(!f.startsWith("{"))return;let m=e.ConcreteNumbering.find(({reference:g,instance:y})=>f===`{${g}-${y}}`);if(!m){let g=f.slice(1,-1).replace(/-\d+$/,"");throw new Error(`A paragraph in a patch uses the numbering "${g}", which isn't in the numbering option of patchDocument. Add it there with its levels, as in a Document`)}return m},u=f=>{var m;let g=i.get(f.numId);return g!==void 0?g:(s=((m=s)!==null&&m!==void 0?m:jh(c("w:num","w:numId")))+1,i.set(f.numId,s),s)},d=f=>{let m=f.name==="w:numId"?l(String(f.attributes["w:val"])):void 0;return m===void 0?f.elements===void 0?f:k(k({},f),{},{elements:f.elements.map(d)}):k(k({},f),{},{attributes:k(k({},f.attributes),{},{"w:val":String(u(m))})})},p=f=>{let m=a(),g=o(m);return t.has(g)||(t.set(g,{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[k(k({},f),{},{elements:[]})]}),r(JE,`/${g}`)),m||n(As).viewWrapper.Relationships.addRelationship($n(),Uh,yc(As,g)),g};return{renumber:f=>f.map(d),write:()=>{var f,m;if(i.size===0)return;let g=e2(e,n(o())),y=N=>Number(N.elements.find(D=>D.name==="w:abstractNumId").attributes["w:val"]),T=g.elements.filter(N=>N.name==="w:num"&&i.has(Number(N.attributes["w:numId"]))),b=jh(c("w:abstractNum","w:abstractNumId")),C=new Map([...new Set(T.map(y))].map((N,D)=>[N,b+D+1])),_=g.elements.flatMap(N=>{let D=N.name==="w:abstractNum"?C.get(Number(N.attributes["w:abstractNumId"])):void 0;return D===void 0?[]:[k(k({},N),{},{attributes:k(k({},N.attributes),{},{"w:abstractNumId":String(D)})})]}),w=p(g),x=t.get(w).elements.find(N=>N.name==="w:numbering");x.attributes=k(k(k({},Object.fromEntries(Object.entries(g.attributes).filter(([N])=>N.startsWith("xmlns:")))),x.attributes),{},{"mc:Ignorable":[...new Set([...String((f=(m=x.attributes)===null||m===void 0?void 0:m["mc:Ignorable"])!==null&&f!==void 0?f:"").split(" "),...String(g.attributes["mc:Ignorable"]).split(" ")])].filter(N=>N!=="").join(" ")});let v=Te(t.get(w),"w:numbering"),A=N=>{let D=v.findIndex(O=>N.includes(O.name));return D===-1?v.length:D};v.splice(A(["w:num","w:numIdMacAtCleanup"]),0,..._),v.splice(A(["w:numIdMacAtCleanup"]),0,...T.map(N=>k(k({},N),{},{attributes:k(k({},N.attributes),{},{"w:numId":String(i.get(Number(N.attributes["w:numId"])))}),elements:N.elements.map(D=>D.name==="w:abstractNumId"?k(k({},D),{},{attributes:{"w:val":String(C.get(y(N)))}}):D)})))}}},Yl={nameOf:e=>e.type==="element"?e.name:void 0,contentOf:e=>e.elements,attributeOf:(e,t)=>{var n;return(n=e.attributes)===null||n===void 0?void 0:n[t]},textOf:e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).filter(({type:n})=>n==="text").map(({text:n})=>String(n)).join("")},textElement:e=>({type:"element",name:"w:t",attributes:{"xml:space":"preserve"},elements:[{type:"text",text:e}]}),writeClean:(e,t)=>{var n;/^\s*(PAGEREF|TOC)\b/i.test(t)&&((n=e.attributes)===null||n===void 0?void 0:n["w:dirty"])!==void 0&&(e.attributes=Object.fromEntries(Object.entries(e.attributes).filter(([r])=>r!=="w:dirty")))},setSimpleFieldResult:(e,t)=>{e.elements=[{type:"element",name:"w:r",elements:[Yl.textElement(t)]}]}},Sl="word/document.xml",n2="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk",r2=[80,75,3,4],i2=(function(){var e=Kt(function*(t){if(r2.every((n,r)=>t[r]===n))try{let n=new Map,r=new Map;for(let[s,a]of Bf(t))/\.(xml|rels)$/.test(s)?n.set(s,pt(ta(a))):r.set(s,a);let i=yield Qf(n,r);return k({parts:n,binaryParts:r},i.size>0?{importedDocuments:i}:{})}catch{return}});return function(n){return e.apply(this,arguments)}})(),Qf=(function(){var e=Kt(function*(t,n){let r=new Map;for(let[a,o]of t){var i,s;if(a.endsWith(".rels"))for(let{attributes:c={}}of(i=(s=Ls(o))===null||s===void 0?void 0:s.elements)!==null&&i!==void 0?i:[]){let l=cn(Af(a),String(c.Target)),u=n.get(l),d=c.Type===n2&&c.TargetMode!=="External"&&u?yield i2(u):void 0;d&&r.set(l,d)}}return r});return function(n,r){return e.apply(this,arguments)}})(),Ls=e=>{var t;return e==null||(t=e.elements)===null||t===void 0?void 0:t.find(({type:n})=>n==="element")},s2=(function(){var e=Kt(function*(t,n,r=new Map){var i,s;let a=Ls(t.get(Sl));if(!a)return;let o=yield Qf(t,r),c=n(k({parts:t,binaryParts:r},o.size>0?{importedDocuments:o}:{})),l=Cm(Yl,a,c,{blank:!0}),u=(i=(s=Ls(t.get(Qe(Sl))))===null||s===void 0?void 0:s.elements)!==null&&i!==void 0?i:[];for(let{attributes:d={}}of u){let p=/\/(header|footer)$/.test(String(d.Type))?Ls(t.get(cn(Sl,String(d.Target)))):void 0;p&&Em(Yl,p,c,{blank:!0,sectionPageCount:l.get(String(d.Id))})}});return function(n,r){return e.apply(this,arguments)}})(),a2=new Set(["w:hyperlink","w:sdt","w:sdtContent","w:ins","w:moveTo","w:smartTag","w:customXml","w:fldSimple","w:dir","w:bdo"]),Zf=(e,t)=>{var n;return((n=e.elements)!==null&&n!==void 0?n:[]).flatMap((r,i)=>{var s;return r.name==="w:r"?[{element:r,path:[...t,i]}]:a2.has((s=r.name)!==null&&s!==void 0?s:"")?Zf(r,[...t,i]):[]})},Us=(e,t)=>t.reduce((n,r)=>n.elements[r],e),Yr=e=>{if(e.element.name!=="w:p")throw new Error(`Invalid node type: ${e.element.name}`);if(!e.element.elements)return{text:"",runs:[],index:-1,pathToParagraph:[]};let t=0,n=Zf(e.element,[]).map(({element:r,path:i})=>{let s=o2(r,i,t);return t+=s.text.length,s});return{text:n.reduce((r,i)=>r+i.text,""),runs:n,index:e.index,pathToParagraph:eg(e)}},o2=(e,t,n)=>{if(!e.elements)return{text:"",parts:[],path:t,start:n,end:n};let r=n,i=e.elements.map((s,a)=>{var o,c;if(s.name!=="w:t"||!s.elements||s.elements.length===0)return;let l=(o=(c=s.elements[0].text)===null||c===void 0?void 0:c.toString())!==null&&o!==void 0?o:"",u=r;return r+=l.length,{text:l,index:a,start:u,end:u+l.length-1}}).filter(s=>!!s).map(s=>s);return{text:i.reduce((s,a)=>s+a.text,""),parts:i,path:t,start:n,end:i.length>0?i[i.length-1].end:n}},eg=e=>e.parent?[...eg(e.parent),e.index]:[e.index],l2=class extends Error{constructor(e){super(`Token ${e} not found`),this.name="TokenNotFoundError"}},c2=(e,t)=>{let n=Yr({element:e,index:0,parent:void 0}).runs.find(({parts:r})=>r.some(({text:i})=>i.includes(t)));if(!n)throw new l2(t);return n.path},d2=(e,t)=>{var n,r;let i=-1,s=(n=(r=e.elements)===null||r===void 0?void 0:r.map((a,o)=>{if(i!==-1)return a;if(a.type==="element"&&a.name==="w:t"){var c,l;let u=((c=(l=a.elements)===null||l===void 0||(l=l[0])===null||l===void 0?void 0:l.text)!==null&&c!==void 0?c:"").split(t),d=u.map(p=>k(k(k({},a),Gf(a)),{},{elements:Kf(p)}));return u.length>1&&(i=o),d}else return a}).flat())!==null&&n!==void 0?n:[];return{left:k(k({},JSON.parse(JSON.stringify(e))),{},{elements:s.slice(0,i+1)}),right:k(k({},JSON.parse(JSON.stringify(e))),{},{elements:s.slice(i+1)})}},Ar={START:0,MIDDLE:1,END:2},tg=({paragraphElement:e,renderedParagraph:t,originalText:n,replacementText:r,fromIndex:i=0})=>{let s=t.text.indexOf(n,i),a=s+n.length-1,o=Ar.START;for(let c of t.runs){let l=Us(e,c.path);for(let{text:u,index:d,start:p,end:h}of c.parts)switch(o){case Ar.START:if(s>=p&&s<=h){let f=s-p,m=Math.min(a,h)-p;if(u.substring(f,m+1)==="")continue;let g=u.substring(0,f)+r+u.substring(m+1);Cl(l.elements[d],g),o=Ar.MIDDLE;continue}break;case Ar.MIDDLE:if(a<=h){let f=u.substring(a-p+1);Cl(l.elements[d],f);let m=l.elements[d];l.elements[d]=Gf(m),o=Ar.END}else Cl(l.elements[d],"")}}return e},Cl=(e,t)=>(e.elements=Kf(t),e),Wh=e=>{var t,n;return(t=(n=e.element.elements)===null||n===void 0?void 0:n.map((r,i)=>({element:r,index:i,parent:e})))!==null&&t!==void 0?t:[]},ng=e=>{let t=[],n=[...Wh({element:e,index:0,parent:void 0})],r;for(;n.length>0;)r=n.shift(),r.element.name==="w:p"&&(t=[...t,Yr(r)]),n.push(...Wh(r));return t},Ac=(e,t)=>ng(e).filter(n=>n.text.includes(t)),El="\uFFFF",p2=({json:e,patch:t,patchText:n,context:r,keepOriginalStyles:i=!0,recursive:s=!0,renumberIds:a=o=>o})=>{let o=Ac(e,n);if(o.length===0)return{element:e,didFindOccurrence:!1};let c=[...o].reverse(),l=t.type===Ce.DOCUMENT?k2(c):c,u,d=()=>{var h;return u=((h=u)!==null&&h!==void 0?h:ig(e))+1,String(u)};for(let h of l)switch(t.type){case Ce.DOCUMENT:{var p;let f=T2(e,h.pathToParagraph),m=S2(h.pathToParagraph),g=Kh(t,r,a),y=f.name==="w:tc"&&m===f.elements.length-1&&((p=g[g.length-1])===null||p===void 0?void 0:p.name)!=="w:p"?[{type:"element",name:"w:p"}]:[];f.elements.splice(m,1,...g,...y);break}case Ce.PARAGRAPH:default:{let f=sg(e,h.pathToParagraph),m=h,g=0;do g=u2({paragraphElement:f,renderedParagraph:m,patchText:n,fromIndex:g,children:Kh(t,r,a),keepOriginalStyles:i,newTrackedChangeId:d}),m=Yr({element:f,index:h.index,parent:void 0});while(s&&m.text.includes(n,g));break}}return{element:e,didFindOccurrence:!0}},Kh=(e,t,n)=>n(e.children.flatMap(r=>{var i;return(i=r.writtenAs)!==null&&i!==void 0?i:r}).flatMap(r=>{let i=r.prepForXml(t);return i?[pt(j(i)).elements[0]]:[]})),u2=({paragraphElement:e,renderedParagraph:t,patchText:n,fromIndex:r,children:i,keepOriginalStyles:s,newTrackedChangeId:a})=>{let o=t.text.indexOf(n,r);tg({paragraphElement:e,renderedParagraph:t,originalText:n,replacementText:El,fromIndex:r});let c=c2(e,El),l=c.slice(0,-1),u=Us(e,l),d=c[c.length-1],p=l.map((_,w)=>Us(e,l.slice(0,w+1))).filter(_=>_.name==="w:sdt"),h=[...p].reverse().find(h2),f=u.elements[d],{left:m,right:g}=d2(f,El),y=f.elements.find(_=>_.type==="element"&&_.name==="w:rPr"),T=h?m2(h):y,b=s&&T?i.map(_=>rg(_,T)):i,C=y?k(k({},g),{},{elements:[y,...g.elements]}):g;return u.elements.splice(d,1,m,...b,C),p.forEach(_=>b2(_,b)),w2(e,l,a),o+Yr({element:{name:"w:p",elements:[...b]},index:0,parent:void 0}).text.length},_c=e=>{var t;return(t=e.elements)===null||t===void 0?void 0:t.find(n=>n.name==="w:sdtPr")},h2=e=>{var t;return!!(!((t=_c(e))===null||t===void 0||(t=t.elements)===null||t===void 0)&&t.some(n=>n.name==="w:showingPlcHdr"))},m2=e=>{var t;return(t=_c(e))===null||t===void 0||(t=t.elements)===null||t===void 0?void 0:t.find(n=>n.name==="w:rPr")},f2=new Set(["w:rPr","w:t","w:tab","w:br"]),g2=e=>e.name==="w:bookmarkStart"||e.name==="w:bookmarkEnd"||e.name==="w:r"&&rn(e).every(t=>f2.has(t.name)),b2=(e,t)=>{let n=_c(e);if(!n?.elements)return;let r=n.elements.some(i=>i.name==="w:text")&&!t.every(g2);n.elements=n.elements.filter(i=>i.name!=="w:showingPlcHdr"&&i.name!=="w:dataBinding"&&!(r&&i.name==="w:text"))},Jl=new Set(["w:hyperlink","w:fldSimple","w:subDoc"]),v2=new Map([["w:ins",Jl],["w:moveTo",Jl],["w:hyperlink",new Set(["w:hyperlink"])]]),w2=(e,t,n)=>{for(let i=t.length;i>0;i--){var r;let s=Us(e,t.slice(0,i-1)),a=t[i-1],o=s.elements[a],c=v2.get(o.name),l=g=>!!c?.has(g.name);if(!(!((r=o.elements)===null||r===void 0)&&r.some(l)))continue;let{elements:u}=o,d=u.flatMap((g,y)=>y===0||l(g)||l(u[y-1])?[y]:[]),p=d.map((g,y)=>u.slice(g,d[y+1])),h=c===Jl,f=!0,m=p.map(g=>{if(l(g[0]))return g[0];let y=h&&!f?k(k({},o.attributes),{},{"w:id":n()}):o.attributes;return f=!1,k(k({},o),{},{attributes:y,elements:[...g]})});s.elements.splice(a,1,...m)}},rg=(e,t)=>e.name==="w:r"?y2(e,t):e.elements?k(k({},e),{},{elements:e.elements.map(n=>rg(n,t))}):e,y2=(e,t)=>{let n=rn(e).find(a=>a.type==="element"&&a.name==="w:rPr");if(!n)return k(k({},e),{},{elements:[t,...rn(e)]});let r=new Set(rn(n).map(a=>a.name)),i=[...rn(t).filter(a=>!r.has(a.name)),...rn(n)],s=k(k({},n),{},{elements:[...i].sort((a,o)=>Gh(a)-Gh(o))});return k(k({},e),{},{elements:rn(e).map(a=>a===n?s:a)})},Al=["w:rStyle","w:rFonts","w:b","w:bCs","w:i","w:iCs","w:caps","w:smallCaps","w:strike","w:dstrike","w:outline","w:shadow","w:emboss","w:imprint","w:noProof","w:snapToGrid","w:vanish","w:webHidden","w:color","w:spacing","w:w","w:kern","w:position","w:sz","w:szCs","w:highlight","w:u","w:effect","w:bdr","w:shd","w:fitText","w:vertAlign","w:rtl","w:cs","w:em","w:lang","w:eastAsianLayout","w:specVanish","w:oMath","w14:glow","w14:shadow","w14:reflection","w14:textOutline","w14:textFill","w14:scene3d","w14:props3d","w14:ligatures","w14:numForm","w14:numSpacing","w14:stylisticSets","w14:cntxtAlts"],Gh=e=>{var t;if(e.name==="w:rPrChange")return Al.length+1;let n=Al.indexOf((t=e.name)!==null&&t!==void 0?t:"");return n===-1?Al.length:n},rn=e=>{var t;return(t=e.elements)!==null&&t!==void 0?t:[]},ig=e=>{var t,n;let r=Number((t=e.attributes)===null||t===void 0?void 0:t["w:id"]);return((n=e.elements)!==null&&n!==void 0?n:[]).reduce((i,s)=>Math.max(i,ig(s)),Number.isInteger(r)?r:0)},x2=(e,t)=>e.length>t.length&&t.every((n,r)=>e[r]===n),k2=e=>e.filter(t=>!e.some(n=>x2(t.pathToParagraph,n.pathToParagraph))),sg=(e,t)=>{let n=e;for(let r=1;r<t.length;r++){let i=t[r];n=n.elements[i]}return n},T2=(e,t)=>sg(e,t.slice(0,t.length-1)),S2=e=>e[e.length-1],C2=new dn,_l="word/styles.xml",E2=new Set(["w:pStyle","w:rStyle","w:tblStyle","w:basedOn","w:next","w:link"]),Lr=e=>{var t;return String((t=e.attributes)===null||t===void 0?void 0:t["w:styleId"])},Ql=e=>{var t;let n=(t=e.elements)===null||t===void 0||(t=t.find(r=>r.name==="w:name"))===null||t===void 0||(t=t.attributes)===null||t===void 0?void 0:t["w:val"];return n===void 0?void 0:String(n).toLowerCase()},Ds=(e,t)=>{var n;return e==null||(n=e.elements)===null||n===void 0?void 0:n.find(r=>r.name===t)},zh=e=>{var t;let n=Number((t=Ds(e,"w:sz"))===null||t===void 0||(t=t.attributes)===null||t===void 0?void 0:t["w:val"]);return Number.isNaN(n)?void 0:n},A2=e=>{var t,n;let r=e.filter(a=>a.name==="w:style"),i=(t=r.find(a=>Lr(a)==="Normal"))!==null&&t!==void 0?t:r.find(a=>{var o;return((o=a.attributes)===null||o===void 0?void 0:o["w:type"])==="paragraph"&&Ql(a)==="normal"}),s=e.find(a=>a.name==="w:docDefaults");return(n=zh(Ds(i,"w:rPr")))!==null&&n!==void 0?n:zh(Ds(Ds(s,"w:rPrDefault"),"w:rPr"))},_2=(e,t)=>new Map(Object.values(wc({document:{run:{size:t}}})).map(n=>pt(j(C2.format(n,e))).elements[0]).filter(n=>n.name==="w:style").map(n=>[Lr(n),n])),N2=(e,t)=>{var n;let r=Te((n=e.get(_l))!==null&&n!==void 0?n:{},"w:styles"),i=r.filter(f=>f.name==="w:style"),s=new Set(i.map(Lr)),a,o=f=>{var m;return(m=a)!==null&&m!==void 0||(a=_2(t(_l),A2(r))),a.get(f)},c=new Set,l=new Map,u=f=>{let m=s.has(f)?void 0:o(f);if(m===void 0)return f;let g=i.find(y=>{var T,b;return((T=y.attributes)===null||T===void 0?void 0:T["w:type"])===((b=m.attributes)===null||b===void 0?void 0:b["w:type"])&&Ql(y)===Ql(m)});return g!==void 0?Lr(g):(c.add(f),f)},d=f=>(l.has(f)||l.set(f,u(f)),l.get(f)),p=f=>{var m;return E2.has((m=f.name)!==null&&m!==void 0?m:"")?k(k({},f),{},{attributes:k(k({},f.attributes),{},{"w:val":d(String(f.attributes["w:val"]))})}):f.elements===void 0?f:k(k({},f),{},{elements:f.elements.map(p)})};return{use:f=>f.map(p),write:()=>{let f=e.get(_l);if(!f)return;let m=Te(f,"w:styles"),g=new Set(m.map(Lr));for(let y of c)g.has(y)||(g.add(y),m.push(p(o(y))))}}},P2={type:Ce.PARAGRAPH,children:[]},I2=({json:e,key:t,patch:n,delimiters:{start:r,end:i},patchPlaceholder:s,renumberDrawings:a})=>{let o=`${r}${t}.`;for(let c of O2(e,o)){let l=D2(c.elements,o,i),u=n.rows.flatMap((d,p)=>{let h={type:"element",name:"w:tbl",elements:[...p===0?c.elements.map(M2):a(og(c.elements))]},f=new Map(Object.entries(d).flatMap(([m,g])=>g===void 0?[]:[[m,g]]));for(let[m,g]of f)s(h,`${t}.${m}`,g);for(let m of l.filter(g=>!f.has(g)))s(h,`${t}.${m}`,P2);return h.elements});c.parent.elements.splice(c.parent.elements.indexOf(c.elements[0]),c.elements.length,...u),c.table&&!ag(c.table.element)&&c.table.parent.elements.splice(c.table.parent.elements.indexOf(c.table.element),1)}},O2=(e,t)=>{let n=Ac(e,t).flatMap(i=>{let s=R2(e,i.pathToParagraph);return s?[s]:[]}),r=n.filter(i=>!n.some(s=>L2(i.path,s.path))).filter((i,s,a)=>a.findIndex(o=>o.row===i.row)===s);return[...new Set(r.map(i=>i.parent))].flatMap(i=>{let s=i.elements.filter(c=>c.name==="w:tr"),a=r.filter(c=>c.parent===i).map(c=>s.indexOf(c.row)).sort((c,l)=>c-l),{table:o}=r.find(c=>c.parent===i);return a.reduce((c,l)=>{let u=c[c.length-1];return u?.[u.length-1]===l-1?[...c.slice(0,-1),[...u,l]]:[...c,[l]]},[]).map(c=>{let l=i.elements.indexOf(s[c[0]]),u=i.elements.indexOf(s[c[c.length-1]]);return{parent:i,table:o,elements:i.elements.slice(l,u+1)}})})},R2=(e,t)=>{let n=e,r,i;for(let s=1;s<t.length;s++){let a=n.elements[t[s]];a.name==="w:tbl"&&(i={element:a,parent:n}),a.name==="w:tr"&&(r={parent:n,table:i,row:a,path:t.slice(0,s+1)}),n=a}return r},L2=(e,t)=>e.length>t.length&&t.every((n,r)=>e[r]===n),ag=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).some(n=>n.name==="w:tr"||n.name!=="w:tblPr"&&n.name!=="w:tblGrid"&&ag(n))},D2=(e,t,n)=>{let r=Ac({elements:[...e]},t).flatMap(({text:i})=>i.split(t).slice(1).flatMap(s=>{let a=s.indexOf(n);return a>0?[s.slice(0,a)]:[]}));return[...new Set(r)]},M2=e=>JSON.parse(JSON.stringify(e)),B2=["w14:paraId","w14:textId"],$2=["w:bookmarkStart","w:bookmarkEnd"],og=(e,t)=>e.filter(n=>{var r;return!$2.includes((r=n.name)!==null&&r!==void 0?r:"")&&!(t?.name==="w:sdtPr"&&n.name==="w:id")}).map(n=>k(k(k({},n),n.attributes===void 0?{}:{attributes:Object.fromEntries(Object.entries(n.attributes).filter(([r])=>!B2.includes(r)))}),n.elements===void 0?{}:{elements:[...og(n.elements,n)]})),F2=e=>e[0]===255&&e[1]===254||e[0]===254&&e[1]===255,q2=e=>{var t;let n=eE(e,"word/document.xml"),r=n===void 0||(t=[...e].find(([i])=>SC(i,n)))===null||t===void 0?void 0:t[1];return r===void 0||F2(r)?void 0:rc(rE(ta(r)))},js=(e,t,{start:n,end:r},i)=>{for(let s=e.indexOf(n,t);s!==-1;s=e.indexOf(n,s+1)){let a=e.indexOf(r,s+n.length);if(a===-1)return;let o=e.slice(s+n.length,a),c=o.trim();if(c!==o&&i(c))return{index:s,placeholder:e.slice(s,a+r.length),trimmed:`${n}${c}${r}`}}},H2=(e,t,n)=>{let r=e;for(let i=js(r,0,t,n);i!==void 0;i=js(r,i.index+i.trimmed.length,t,n))r=`${r.slice(0,i.index)}${i.trimmed}${r.slice(i.index+i.placeholder.length)}`;return r},lg=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(n=>[...n.name==="w:p"?[n]:[],...lg(n)])},U2=(e,t,n)=>{let r=()=>Yr({element:e,index:0,parent:void 0});for(let i=r(),s=js(i.text,0,t,n);s!==void 0;i=r(),s=js(i.text,s.index+s.trimmed.length,t,n))tg({paragraphElement:e,renderedParagraph:i,originalText:s.placeholder,replacementText:s.trimmed,fromIndex:s.index})},j2=(e,{delimiters:t,textKeys:n,tableRowsKeys:r,drawingKeys:i})=>{let s=c=>n.has(c)||r.some(l=>c.startsWith(`${l}.`));for(let c of lg(e))U2(c,t,s);let a=c=>i.has(c);for(let{properties:c}of na(e))for(let l of["descr","title"]){var o;let u=(o=c.attributes)===null||o===void 0?void 0:o[l];u!==void 0&&(c.attributes[l]=H2(String(u),t,a))}},cg=e=>{var t;return e.name==="v:shapetype"&&((t=e.attributes)===null||t===void 0?void 0:t.id)!==void 0?String(e.attributes.id):void 0},dg=e=>{var t;let n=cg(e);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(dg)]},W2=e=>{let t=new Set(dg(e)),n=r=>{let i=cg(r);return i!==void 0?t.has(i)?[]:(t.add(i),[r]):[r.elements===void 0?r:k(k({},r),{},{elements:r.elements.flatMap(n)})]};return r=>r.flatMap(n)},pg=(e,t,{inTableRow:n})=>{if(t?.type===Ce.TABLE_ROWS&&Array.isArray(t.rows)){for(let r of t.rows){if(typeof r!="object"||r===null)throw new Error(`Invalid patch "${e}". Expected each of its rows to be an object of patches, by the name of their field`);for(let[i,s]of Object.entries(r))s!==void 0&&pg(`${e}.${i}`,s,{inTableRow:!0})}return}if(!(t?.type===Ce.DRAWING?!n&&typeof t.patch=="function":t?.type!==Ce.TABLE_ROWS&&Array.isArray(t?.children)))throw new Error(`Invalid patch "${e}". Expected { type: PatchType.PARAGRAPH or PatchType.DOCUMENT, children: [...] }, ${n?"or { type: PatchType.TABLE_ROWS, rows: [...] }":"{ type: PatchType.TABLE_ROWS, rows: [...] }, or a drawing patch such as ImagePatch, or ChartDataPatch from docx/charts"}`)},Vh=new Uf,K2=new Uint8Array([255,254]),G2=new Uint8Array([254,255]),z2=new Set(["w:document","w:hdr","w:ftr","w:footnotes","w:endnotes","w:comments"]),Xh=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},eI=(function(){var e=Kt(function*({outputType:t,data:n,patches:r,keepOriginalStyles:i,placeholderDelimiters:s={start:"{{",end:"}}"},recursive:a=!0,trimPlaceholders:o=!1,footnotes:c,endnotes:l,numbering:u={config:[]},pageNumbers:d,properties:p}){let h=yield Yf(n),f=new Map,m=q2(h),g=[],y=new gf({addOverride:(M,$)=>g.push({contentType:M,partName:$})},new Set([...h.keys()].filter(M=>M.startsWith("word/")).map(M=>M.slice(5)))),T={Media:new mf(M=>y.takePath("media","image",M)),Numbering:new ff(u),Theme:m&&{Colors:m},FootNotes:{View:{idOf:(M,$,q)=>_t("footnotes",M,$,q)}},Endnotes:{View:{idOf:(M,$,q)=>_t("endnotes",M,$,q)}},PackageParts:y},b=new Map,C=[],_=[],w=!1,x=new Map;zf(s);let{start:v,end:A}=s;for(let[M,$]of Object.entries(r))pg(M,$,{inTableRow:!1});for(let[M,$]of h){var N;let q=$.slice(0,2);if(Xh(q,K2)||Xh(q,G2)){x.set(M,$);continue}if(!M.endsWith(".xml")&&!M.endsWith(".rels")){x.set(M,$);continue}let ie=pt(ta($)),se=(N=ie.elements)===null||N===void 0?void 0:N.find(ae=>{var te;return z2.has((te=ae.name)!==null&&te!==void 0?te:"")});if(se&&se.attributes){for(let ae of["mc","wp","r","w15","m","v","o"])se.attributes[`xmlns:${ae}`]=Dl[ae];se.attributes["mc:Ignorable"]=`${se.attributes["mc:Ignorable"]||""} w15`.trim()}b.set(M,ie)}let D=vE([...b.values()].flatMap(Wf)),O=OE([...b.values()].flatMap(Vf)),F=new Map,Q=M=>{let $=F.get(M);if($)return $;let q={Relationships:{addRelationship:(ie,se,ae,te)=>{_.push({key:M,id:ie,type:se,target:ae,targetMode:te})}}};return F.set(M,q),q},Z=M=>({file:T,viewWrapper:Q(M),stack:[]}),V=(M,$)=>{g.push({contentType:M,partName:$})},G=N2(b,Z),de=t2(T.Numbering,b,{createContext:Z,addContentTypeOverride:V}),ce=VE({footnotes:c,endnotes:l},b,{createContext:Z,addContentTypeOverride:V,renumberBookmarks:D,renumberDrawings:O,renumberLists:de.renumber,useStyles:G.use}),_t=(M,$,q,ie)=>ie.viewWrapper===Q("word/document.xml")?ce.carry(M,$,q):void 0;if(o){let M=q=>Object.entries(r).flatMap(([ie,se])=>q(se.type)?[ie]:[]),$={delimiters:{start:v,end:A},textKeys:new Set(M(q=>q!==Ce.TABLE_ROWS&&q!==Ce.DRAWING)),tableRowsKeys:M(q=>q===Ce.TABLE_ROWS),drawingKeys:new Set(M(q=>q===Ce.DRAWING))};for(let[q,ie]of b)q.startsWith("word/")&&!q.endsWith(".rels")&&j2(ie,$)}$E({parts:b,binaryParts:x,file:T,patches:Object.entries(r).flatMap(([M,$])=>$.type===Ce.DRAWING?[[M,$]]:[]),delimiters:{start:v,end:A}},Z);let Ae=Object.entries(r).flatMap(([M,$])=>$.type===Ce.DRAWING?[]:[[M,$]]),Ue=[...Ae.filter(([,M])=>M.type===Ce.TABLE_ROWS),...Ae.filter(([,M])=>M.type!==Ce.TABLE_ROWS)];for(let[M,$]of[...b]){if(!M.startsWith("word/")||M.endsWith(".xml.rels"))continue;let q=Z(M);f.set(M,q);let ie=W2($),se=(ae,te,Re)=>{if(Re.type===Ce.TABLE_ROWS){I2({json:ae,key:te,patch:Re,delimiters:{start:v,end:A},patchPlaceholder:se,renumberDrawings:O});return}let Uc=[],{didFindOccurrence:Zg}=p2({json:ae,patch:k(k({},Re),{},{children:Re.children.flatMap(je=>je instanceof qm?je.writtenAs:[je]).map(je=>{if(je instanceof O1){let{target:eb,anchor:tb}=Wm(je.options.link),jc=new mc(je.options.children,$n(),tb,je.options.link);return Uc.push({key:M,id:jc.linkId,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",target:eb,targetMode:oc.EXTERNAL}),jc}else return je})}),patchText:`${v}${te}${A}`,context:q,keepOriginalStyles:i,recursive:a,renumberIds:je=>G.use(de.renumber(ce.renumber(D(O(ie(je))))))});Zg&&_.push(...Uc)};for(let[ae,te]of Ue)se($,ae,te)}ce.write(),de.write(),G.write();for(let[M,$]of b){if(!M.startsWith("word/")||M.endsWith(".xml.rels"))continue;let q=Vh.getMediaData(JSON.stringify($),T.Media);q.length>0&&(w=!0,C.push({key:M,mediaDatas:q}))}for(let{key:M,mediaDatas:$}of C){var we;let q=Qe(M),ie=(we=b.get(q))!==null&&we!==void 0?we:Ur();b.set(q,ie);let se=Cc(ie),ae=Vh.replace(JSON.stringify(b.get(M)),$,se);b.set(M,JSON.parse(ae));for(let te=0;te<$.length;te++){let{fileName:Re}=$[te];Kl(ie,se+te,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${Re}`)}}for(let{key:M,id:$,type:q,target:ie,targetMode:se}of _){var ye;let ae=Qe(M),te=(ye=b.get(ae))!==null&&ye!==void 0?ye:Ur();b.set(ae,te),Kl(te,$,q,ie,se)}d&&(yield s2(b,d,x)),p&&NE(b,x,p,{addContentTypeOverride:V});let re=Tc(T,void 0);if(w||g.length>0){let M=b.get("[Content_Types].xml");if(!M)throw new Error("Could not find content types file");w&&(On(M,"image/png","png"),On(M,"image/jpeg","jpeg"),On(M,"image/jpeg","jpg"),On(M,"image/bmp","bmp"),On(M,"image/gif","gif"),On(M,"image/svg+xml","svg"));for(let{contentType:$,partName:q}of g)yE(M,$,q)}return jl(qs([...[...b].map(([M,$])=>[M,px($)]),...x,...T.Media.Array.map(({data:M,fileName:$})=>[`word/media/${$}`,M]),...re.map(({path:M,data:$})=>[M,$])]),t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document")});return function(n){return e.apply(this,arguments)}})(),V2=e=>e.startsWith("word/")&&/\.(xml|rels)$/.test(e)&&!e.endsWith(".xml.rels"),tI=(function(){var e=Kt(function*({data:t,placeholderDelimiters:n={start:"{{",end:"}}"},trimPlaceholders:r=!1}){zf(n);let i=X2(n),s=yield Yf(t,V2),a=new Set;for(let[,o]of s){let c=pt(ta(o));[...ng(c).map(l=>l.text),...na(c).flatMap(({properties:l})=>Xf(l))].flatMap(l=>{var u;return(u=l.match(i))!==null&&u!==void 0?u:[]}).map(l=>r?l.trim():l).filter(l=>l!=="").forEach(l=>a.add(l))}return Array.from(a)});return function(n){return e.apply(this,arguments)}})(),Nl=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X2=({start:e,end:t})=>new RegExp(`(?<=${Nl(e)})(?:(?!${Nl(e)}).)+?(?=${Nl(t)})`,"gs")});var wg={};ii(wg,{EXPORT_DIR:()=>Qr,FORMATS:()=>Nc,TX:()=>Jr,buildIR:()=>aa,caseRows:()=>sa,exportDoc:()=>Pc,irToDocx:()=>vg,irToHtml:()=>oa});import hg from"node:fs";import mg from"node:path";function Y2(e){return`${String(e.getDate()).padStart(2,"0")}/${String(e.getMonth()+1).padStart(2,"0")}/${e.getFullYear()}`}function Q2(e,t){let n=e.result;if(!n)return[t.status["not-run"]];let r=[t.status[n.status]];return n.actual&&r.push(t.actual+n.actual),n.bug&&r.push(t.bug+n.bug),r}function sa(e,t,n,r){let i=e.kind==="non-functional",s=e.cases.filter(l=>!l.deleted),a=[...i?n.headNf:n.headFn],o=[7,27,38,28];t.results&&(a.push(...n.headResult),o=[8,20,27,20,13,12]);let c=s.map((l,u)=>{let p=[[String(u+1),...t.codes?[l.code]:[]],ia(i&&l.requirement||l.case),ia(l.steps),ia(l.expected)];return t.results&&p.push(Q2(l,n),l.result?[l.result.by??"",J2(l.result.at,r)].filter(Boolean):[]),p});return{head:a,widths:o,rows:c}}function gg(e){let t=tn();for(let n of e)yr(n,t);return t}function aa(e,t={}){let n=e.config,r=n.overview??{},i=t.date??new Date,s=n.language==="en"?"en":"vi",a=Jr[s],o=[],c=b=>en(e,b),l=e.modules.filter(b=>c(b.code).some(C=>C.kind==="functional")),u=e.modules.filter(b=>c(b.code).some(C=>C.kind==="non-functional")),d=Ve(e.root,n.ba),p=d?bt(d):null;o.push({k:"cover",lines:[...r.owner?[{text:r.owner.toUpperCase(),bold:!0}]:[],{text:""},{text:a.coverDoc,bold:!0,size:32},{text:a.coverTitle,bold:!0,size:32},{text:n.title,bold:!0,size:28},{text:""},{text:a.docVersion+(r.docVersion||"1.0")},...t.results?[{text:a.withResults}]:[],{text:""},...r.owner?[{text:a.owner+r.owner}]:[],...r.contractor?[{text:a.contractor+r.contractor}]:[],{text:""},{text:(r.place?r.place+", ":"")+(s==="vi"?Y2(i):i.toISOString().slice(0,10))}]}),o.push({k:"pagebreak"}),o.push({k:"p",text:a.signPage,bold:!0});let h=n.members.length?n.members:[{id:"",name:"",role:""}];o.push({k:"table",head:a.signHead,widths:[6,16,30,28,20],rows:h.map((b,C)=>[[String(C+1)],[""],[b.name],[b.role??""],[""]])}),o.push({k:"pagebreak"}),o.push({k:"toc",title:a.toc}),o.push({k:"pagebreak"});let f=0;o.push({k:"h",level:1,text:`${fg[f++]}. ${a.overview}`}),o.push({k:"h",level:2,text:a.purpose}),o.push({k:"p",text:r.purpose||a.purposeText(n.title)}),o.push({k:"h",level:2,text:a.scope}),r.scope?o.push({k:"p",text:r.scope}):(o.push({k:"p",text:a.scopeIntro}),o.push({k:"list",items:e.modules.filter(b=>c(b.code).length).map(b=>b.title)})),o.push({k:"h",level:2,text:a.env}),o.push({k:"p",text:r.environment||a.envDefault}),o.push({k:"h",level:2,text:a.refs}),o.push({k:"p",text:r.references||a.refsIntro}),r.references||o.push({k:"list",items:a.refsList}),o.push({k:"h",level:2,text:a.terms});let m=r.terms?.length?r.terms:a.termsDefault;o.push({k:"table",head:a.termsHead,widths:[8,30,62],rows:m.map((b,C)=>[[String(C+1)],[b.term],[b.desc]])});let g=(b,C,_)=>{if(o.push({k:"pagebreak"}),o.push({k:"h",level:1,text:`${fg[f++]}. ${b}`}),!C.length){o.push({k:"p",text:a.noSuites,italic:!0});return}C.forEach((w,x)=>{o.push({k:"h",level:2,text:`${x+1}. ${w.title}`}),_==="functional"&&w.commonSteps.trim()&&(o.push({k:"p",text:a.commonSteps,bold:!0}),o.push({k:"list",items:ia(w.commonSteps)})),c(w.code).filter(v=>v.kind===_).forEach((v,A)=>{o.push({k:"h",level:3,text:`${x+1}.${A+1}. ${v.title}`});let N=[v.useCases.length?a.useCase+v.useCases.join(", "):"",v.covers.length?a.functions+v.covers.map(O=>p?.get(O)?.title?`${O} (${p.get(O).title})`:O).join("; "):""].filter(Boolean);if(N.length&&o.push({k:"p",text:N.join(" \xB7 "),italic:!0}),v.preconditions&&o.push({k:"p",text:a.pre+v.preconditions}),v.description.trim())for(let O of v.description.trim().split(/\n\s*\n/))o.push({k:"p",text:O.trim()});let D=sa(v,t,a,s);D.rows.length?o.push({k:"table",...D}):o.push({k:"p",text:a.noCases,italic:!0})})})};g(a.chFn,l,"functional"),g(a.chNf,u,"non-functional");let y=[];t.results&&y.push(()=>{o.push({k:"h",level:2,text:a.sumTitle});let b=e.modules.map(w=>({m:w,c:gg(c(w.code))})).filter(w=>w.c.total),C=gg(e.modules.flatMap(w=>c(w.code))),_=w=>w.total?Math.round(100*w.passed/w.total)+"%":"\u2014";o.push({k:"table",head:a.sumHead,widths:[30,10,8,10,9,9,11,13],rows:[...b.map(({m:w,c:x})=>[[w.title],[String(x.total)],[String(x.passed)],[String(x.failed)],[String(x.blocked)],[String(x.skipped)],[String(x["not-run"])],[_(x)]]),[[a.total],[String(C.total)],[String(C.passed)],[String(C.failed)],[String(C.blocked)],[String(C.skipped)],[String(C["not-run"])],[_(C)]]]})});let T=e.suites.filter(b=>b.status!=="deleted"&&b.covers.length);if(T.length&&y.push(()=>{o.push({k:"h",level:2,text:a.matrix});let b=new Map;for(let C of T)for(let _ of C.covers)b.set(_,[...b.get(_)??[],C.title]);o.push({k:"table",head:a.matrixHead,widths:[8,42,50],rows:[...b.entries()].sort((C,_)=>C[0].localeCompare(_[0])).map(([C,_],w)=>[[String(w+1)],[p?.get(C)?.title?`${C} \u2013 ${p.get(C).title}`:C],_])})}),y.length){o.push({k:"pagebreak"}),o.push({k:"h",level:1,text:a.appendix});for(let b of y)b()}return{title:n.title,lang:s,results:!!t.results,nodes:o}}function oa(e){let t=[],n=e.nodes.filter(s=>s.k==="h"),r=0;for(let s of e.nodes)if(s.k==="cover")t.push(`<section class="cover">${s.lines.map(a=>a.text?`<p class="${a.bold?"b":""}"${a.size?` style="font-size:${a.size/2}pt"`:""}>${Et(a.text)}</p>`:"<p>&nbsp;</p>").join("")}</section>`);else if(s.k==="h")t.push(`<h${s.level} id="h${r++}">${Et(s.text)}</h${s.level}>`);else if(s.k==="p")t.push(`<p${s.bold||s.italic?` class="${s.bold?"b":""} ${s.italic?"i":""}"`:""}>${Et(s.text).replace(/\n/g,"<br>")}</p>`);else if(s.k==="list")t.push(`<ul>${s.items.map(a=>`<li>${Et(a)}</li>`).join("")}</ul>`);else if(s.k==="toc")t.push(`<nav class="toc"><p class="b">${Et(s.title)}</p>${n.map((a,o)=>`<a class="l${a.level}" href="#h${o}">${Et(a.text)}</a>`).join("")}</nav>`);else if(s.k==="pagebreak")t.push('<div class="pb"></div>');else if(s.k==="table"){let a=s.widths?`<colgroup>${s.widths.map(o=>`<col style="width:${o}%">`).join("")}</colgroup>`:"";t.push(`<table>${a}<thead><tr>${s.head.map(o=>`<th>${Et(o)}</th>`).join("")}</tr></thead><tbody>${s.rows.map(o=>`<tr>${o.map(c=>`<td>${c.map(Et).join("<br>")}</td>`).join("")}</tr>`).join("")}</tbody></table>`)}return`<!doctype html><html lang="${e.lang}"><head><meta charset="utf-8"><title>${Et(e.title)}</title><style>body{background:#e9ecef;margin:0;font:12pt/1.45 "Times New Roman",serif;color:#111}
5674
+ `;case"w:noBreakHyphen":return"-";default:return""}},jk=e=>{let t=[],n=r=>{let i=ct(r);if(i!==void 0&&Hk.has(i))return dt(r).map(n).join("");if(i==="w:fldChar"){let s=$e(r,"w:fldCharType");return s==="begin"?t.push(!1):s==="separate"?t[t.length-1]=!0:t.pop(),""}return t.every(Boolean)?Uk(r):""};return dt(e).map(n).join("")},Pm=e=>{let t=ct(e);return t==="w:bookmarkStart"?[{start:!0,id:$e(e,"w:id"),name:$e(e,"w:name")}]:t==="w:bookmarkEnd"?[{start:!1,id:$e(e,"w:id")}]:t===void 0||t==="_attr"?[]:dt(e).flatMap(Pm)},Wk=e=>{let t=new Map;return e.map(n=>{let r=Pm(n),i=new Set([...t.values(),...r.flatMap(s=>s.start?[s.name]:[])]);for(let s of r)s.start?t.set(s.id,s.name):t.delete(s.id);return i})},Kk=(e,t)=>{let n=t?Wk(e):[];return e.map((r,i)=>{var s;let a=Je(r,"w:pPr");return{element:r,styleId:$e(Je(a,"w:pStyle"),"w:val"),outlineLevel:dc(Je(a,"w:outlineLvl"),"w:val"),text:jk(r),bookmarks:(s=n[i])!==null&&s!==void 0?s:new Set}})},Om=e=>{var t;let n=(t=e.file)===null||t===void 0||(t=t.Styles)===null||t===void 0?void 0:t.prepForXml(e);return new Map(dt(n).filter(r=>ct(r)==="w:style"&&["paragraph",void 0].includes($e(r,"w:type"))).map(r=>[$e(r,"w:styleId"),{name:$e(Je(r,"w:name"),"w:val"),basedOn:$e(Je(r,"w:basedOn"),"w:val"),outlineLevel:dc(Je(Je(r,"w:pPr"),"w:outlineLvl"),"w:val")}]))},Rm=e=>{let t=/^\s*(\d+)\s*-\s*(\d+)\s*$/.exec(e);return t?[Number(t[1]),Number(t[2])]:void 0},Pl=(e,[t,n])=>e>=t&&e<=n,pc=(e,t)=>{var n,r;if(e===void 0)return;let i=/^heading ?([1-9])$/i.exec((n=(r=t.get(e))===null||r===void 0?void 0:r.name)!==null&&n!==void 0?n:e);return i?Number(i[1]):void 0},Lm=(e,t,n=0)=>{var r;if(e===void 0||n>t.size)return;let i=t.get(e),s=pc(e,t);return(r=i?.outlineLevel)!==null&&r!==void 0?r:s===void 0?Lm(i?.basedOn,t,n+1):s-1},Gk=e=>{let t=Om(e);return n=>{let r=Je(n,"w:pPr"),i=$e(Je(r,"w:pStyle"),"w:val"),s=pc(i,t),a=Mm({styleId:i,outlineLevel:dc(Je(r,"w:outlineLvl"),"w:val")},t),o=a===void 0||a>=9?void 0:a+1;return s!==void 0&&(o===void 0||o===s)?s:o===void 0?void 0:"unclear"}},Mm=(e,t)=>{var n;return(n=e.outlineLevel)!==null&&n!==void 0?n:Lm(e.styleId,t)},zk=(e,t,n)=>{var r;let{entriesFromBookmark:i,headingStyleRange:s,stylesWithLevels:a=[],useAppliedParagraphOutlineLevel:o}=e;if(t.text.trim()===""||i&&!t.bookmarks.has(i))return;let c=[t.styleId,t.styleId===void 0||(r=n.get(t.styleId))===null||r===void 0?void 0:r.name].filter(f=>f!==void 0).map(f=>f.toLowerCase()),l=a.find(f=>c.includes(f.styleName.toLowerCase()));if(l)return l.level;let u=!!s||a.length>0||!!o||!!e.tcFieldIdentifier||!!e.tcFieldLevelRange||!!e.captionLabel||!!e.captionLabelIncludingNumbers,d=s?Rm(s):u?void 0:[1,9],p=pc(t.styleId,n);if(d&&p!==void 0&&Pl(p,d))return p;let h=o?Mm(t,n):void 0;return h!==void 0&&Pl(h+1,d??[1,9])?h+1:void 0},Vk=(e,t)=>{let n=t.preserveTabInEntries?e:e.replace(/\t/g," ");return(t.preserveNewLineInEntries?n.split(`
5675
+ `):[n.replace(/\n/g," ")]).map((r,i)=>new Oe({break:i>0?1:void 0,children:r.split(" ").flatMap((s,a)=>[...a>0?[new Xs]:[],...s===""?[]:[s]])}))},Xk=({text:e,separator:t})=>t==="tab"?[new Oe(e),new Oe({children:[new Xs]})]:[new Oe(`${e} `)],Yk=(e,t)=>{let n=240*(e-1)+t+240;return n<=1920?Math.ceil(n/240)*240:Math.round(n)},Jk=(e,t)=>{var n,r;return(n=(r=[...t].find(([,i])=>{var s;return((s=i.name)===null||s===void 0?void 0:s.toLowerCase())===`toc ${e}`}))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:`TOC${e}`},Qk=({properties:e,beginDirty:t,textWidth:n,tabLeader:r},i,s,a)=>{var o;let c=e.pageNumbersEntryLevelsRange?(o=Rm(e.pageNumbersEntryLevelsRange))!==null&&o!==void 0?o:[1,9]:void 0,l=new Am;return i.forEach((u,d)=>{var p;let h=c===void 0||!Pl(u.level,c),f=[...u.listNumber?Xk(u.listNumber):[],...Vk(u.title,e),...h?[new Oe({children:[e.entryAndPageNumberSeparator||new Xs]}),new B1(u.bookmark,{hyperlink:e.hyperlink})]:[]];l.addChildElement(new ne({style:Jk(u.level,s),tabStops:[...((p=u.listNumber)===null||p===void 0?void 0:p.separator)==="tab"?[{type:"left",position:Yk(u.level,u.listNumber.width)}]:[],{type:"right",position:n,leader:r}],children:[...d===0?[new qe({children:[Nm(t),new _m(e),sn()]})]:[],...e.hyperlink?[new Fm({anchor:u.bookmark,children:f})]:f]}))}),l.addChildElement(new ne({children:[new qe({children:[an()]})]})),l.prepForXml(a)},Zk=(e,t,n,r)=>{let i=dt(e),s=i.findIndex(a=>ct(a)==="w:pPr")+1;e["w:p"]=[...i.slice(0,s),new Um(t,n).prepForXml(r),...i.slice(s),new jm(n).prepForXml(r)]},e1=(e,t,n,r)=>{let i=Im(dt(e)),s=i.flatMap(u=>{let d=cc.get(u);return d?[[u,d]]:[]});if(s.length===0)return;let a=Om(t),o=s.some(([,{properties:u}])=>!!u.entriesFromBookmark),c=Kk(i.filter(u=>ct(u)==="w:p"),o).map(u=>({paragraph:u,levels:s.map(([,{properties:d}])=>zk(d,u,a))})).filter(({levels:u})=>u.some(d=>d!==void 0)).map((u,d)=>k(k({},u),{},{id:n.get(d)}));for(let{paragraph:u,id:d}of c)Zk(u.element,`_Toc${d}`,d,t);let l=c.length>0?r?.(e):void 0;s.forEach(([u,d],p)=>{let h=c.flatMap(({paragraph:f,levels:m,id:g})=>{let x=m[p],T=l?.get(`_Toc${g}`);return x===void 0?[]:[k({title:f.text,level:x,bookmark:`_Toc${g}`},T?{listNumber:T}:{})]});h.length!==0&&(u["w:sdt"]=dt(u).map(f=>ct(f)==="w:sdtContent"?Qk(d,h,a,t):f))})},t1=new RegExp("^\\p{L}[\\p{L}\\p{N}_]*$","u"),n1=e=>{var t,n;let r,i=!1,s,a=!1,o=!1;for(let d=0;d<e.length;d++){var c,l;let p=e[d],h=(c=e[d+1])!==null&&c!==void 0?c:"",f;if(d===0&&!p.startsWith("\\"))f={type:"bookmark"};else if(p==="\\c"||p==="\\n")f={type:p==="\\c"?"repeat":"next"};else if((p==="\\r"||p==="\\s")&&/^\d+$/.test(h))d++,f=p==="\\r"?{type:"reset",to:Number(h)}:{type:"heading",level:Number(h)};else if(p==="\\h")i=!0;else if(p==="\\#"&&d+1<e.length)d++,o=!0;else if(p==="\\*"&&d+1<e.length){let m=e[++d];if(km.has(m.toLowerCase()))a=!0;else if(!ym.has(m.toLowerCase())){if(s!==void 0)return;s=m}}else return;if(f&&r)return;r=(l=f)!==null&&l!==void 0?l:r}if(r?.type==="bookmark"&&e.length>1)return;let u=!o&&!(a&&s!==void 0&&s.toLowerCase()!=="arabic");return{step:(t=r)!==null&&t!==void 0?t:{type:"next"},hidden:i&&s===void 0,format:u?(n=s)!==null&&n!==void 0?n:"ARABIC":""}},uc=e=>{var t;let n=new RegExp("^\\s*SEQ\\b(.*)$","is").exec(e);if(!n)return;let[r,...i]=(t=n[1].match(/"[^"]*"|\S+/g))!==null&&t!==void 0?t:[];if(r===void 0)return{};let s=r.replace(/^"(.*)"$/,"$1");return t1.test(s)?{identifier:s,sequence:n1(i)}:{identifier:s}},r1=e=>uc(e)!==void 0,Ol=e=>typeof e!="object"||e===null?[]:Array.isArray(e)?e.flatMap(Ol):Object.entries(e).flatMap(([t,n])=>[...(t==="w:instrText"&&Array.isArray(n)?n:t==="_attr"?[n["w:instr"]]:[]).flatMap(r=>{let i=typeof r=="string"?uc(r):void 0;return i?.identifier===void 0?[]:[i.identifier.toLowerCase()]}),...Ol(n)]),i1=e=>{var t;let n=(t=e.file)===null||t===void 0?void 0:t.Comments;if(!n)return new Set;let r={View:n,Relationships:n.Relationships};return new Set(Ol(n.prepForXml(k(k({},e),{},{viewWrapper:r,stack:[]}))))},s1=e=>{let t=Gk(e),n=new Map,r=new Map,i=[],s=-1,a=-1,o,c=(l,u)=>{var d;let p=Math.max(-1,...i.slice(1,u+1).filter(m=>m!==void 0)),h=((d=r.get(l))!==null&&d!==void 0?d:[]).filter(m=>m.paragraph>=p),f=h.every(({step:m})=>m?.type==="next"||m?.type==="heading"&&m.level===u);return s>p||!f?void 0:h.length+1};return{startParagraph:l=>{a++;let u=t(l);u==="unclear"?s=a:u!==void 0&&(i[u]=a)},numberOf:(l,u)=>{var d,p,h;let{identifier:f,sequence:m}=uc(l);if(f===void 0||u==="fallback")return;(d=o)!==null&&d!==void 0||(o=i1(e));let g=f.toLowerCase();if(m?.step.type==="bookmark"&&u==="counted"&&!o.has(g))return;let x=n.has(g)?n.get(g):0,T=o.has(g)||u==="deleted"?void 0:m?.step,b=T?.type==="reset"?T.to:T?.type==="repeat"?x:T?.type==="heading"?c(g,T.level):T?.type==="next"&&x!==void 0?x+1:void 0;return n.set(g,b),r.set(g,[...(p=r.get(g))!==null&&p!==void 0?p:[],k({paragraph:a},b===void 0?{}:{step:T})]),b===void 0||m===void 0?void 0:m.hidden?"":(h=lc(m.format))===null||h===void 0?void 0:h(b)}}},sl=e=>{let t=typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.keys(e)[0]:void 0;return t==="_attr"?void 0:t},th=e=>({"w:t":[{_attr:{"xml:space":"preserve"}},e]}),Vs={nameOf:sl,contentOf:e=>{let t=e[sl(e)];return Array.isArray(t)?t:void 0},attributeOf:(e,t)=>{var n;let r=e[sl(e)],i=Array.isArray(r)?r.find(s=>typeof s=="object"&&s!==null&&"_attr"in s):r;return i==null||(n=i._attr)===null||n===void 0?void 0:n[t]},textOf:e=>Vs.contentOf(e).filter(t=>typeof t=="string").join(""),textElement:th,writeClean:e=>{if($y(e)){let t=e["w:fldChar"]._attr;e["w:fldChar"]={_attr:Object.fromEntries(Object.entries(t).filter(([n])=>n!=="w:dirty"))}}},setSimpleFieldResult:(e,t)=>{let n=e["w:fldSimple"];e["w:fldSimple"]=[...(Array.isArray(n)?n:[n]).filter(r=>typeof r=="object"&&r!==null&&"_attr"in r),{"w:r":[th(t)]}]}},Dm=new WeakMap,a1=(e,t)=>{let{startParagraph:n,numberOf:r}=s1(t);Bk(Vs,e,{beforeParagraph:i=>n(i),resultOf:(i,s)=>r1(i)?r(i,s):void 0})},o1=(e,t,n)=>{let r=n(e,t),i=Cm(Vs,e,r,{blank:!1});t.file&&Dm.set(t.file,{estimate:r,partPageCounts:i})},zr=(e,t,n)=>{let r=t.file&&Dm.get(t.file);if(!e||!r)return;let i=n===void 0?void 0:r.partPageCounts.get(`rId${n}`),s="w:footnotes"in e||"w:endnotes"in e;Em(Vs,e,r.estimate,{blank:!1,sectionPageCount:i,notes:s})},l1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns"})}},be=class Bm extends I{constructor(){super("Relationships"),this.root.push(new l1({xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}))}addRelationship(t,n,r,i){this.root.push(yk(`rId${t}`,n,r,i))}static copy(t){let n=new Bm;return n.root.push(...t.root.slice(1)),n}get RelationshipCount(){return this.root.length-1}},c1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",initials:"w:initials",author:"w:author",date:"w:date"})}},d1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{"xmlns:wpc":"xmlns:wpc","xmlns:cx":"xmlns:cx","xmlns:cx1":"xmlns:cx1","xmlns:cx2":"xmlns:cx2","xmlns:cx3":"xmlns:cx3","xmlns:cx4":"xmlns:cx4","xmlns:cx5":"xmlns:cx5","xmlns:cx6":"xmlns:cx6","xmlns:cx7":"xmlns:cx7","xmlns:cx8":"xmlns:cx8","xmlns:mc":"xmlns:mc","xmlns:aink":"xmlns:aink","xmlns:am3d":"xmlns:am3d","xmlns:o":"xmlns:o","xmlns:r":"xmlns:r","xmlns:m":"xmlns:m","xmlns:v":"xmlns:v","xmlns:wp14":"xmlns:wp14","xmlns:wp":"xmlns:wp","xmlns:w10":"xmlns:w10","xmlns:w":"xmlns:w","xmlns:w14":"xmlns:w14","xmlns:w15":"xmlns:w15","xmlns:w16cex":"xmlns:w16cex","xmlns:w16cid":"xmlns:w16cid","xmlns:w16":"xmlns:w16","xmlns:w16sdtdh":"xmlns:w16sdtdh","xmlns:w16se":"xmlns:w16se","xmlns:wpg":"xmlns:wpg","xmlns:wpi":"xmlns:wpi","xmlns:wne":"xmlns:wne","xmlns:wps":"xmlns:wps","mc:Ignorable":"mc:Ignorable"})}},nh=class extends I{constructor({id:e,initials:t,author:n,date:r=new Date,children:i},s){super("w:comment"),E(this,"paraId",void 0),this.paraId=s,this.root.push(new c1({id:e,initials:t,author:n,date:r.toISOString()}));for(let a of i)this.root.push(a)}prepForXml(e){let t=super.prepForXml(e);if(!t||!this.paraId)return t;let n=t["w:comment"];if(!Array.isArray(n))return t;for(let r=n.length-1;r>=0;r--){let i=n[r];if(i&&typeof i=="object"&&"w:p"in i){let s=i["w:p"];Array.isArray(s)&&s.unshift({_attr:{"w14:paraId":this.paraId,"w14:textId":this.paraId}});break}}return t}},p1=e=>(e+1).toString(16).toUpperCase().padStart(8,"0"),u1=class extends I{constructor({children:e}){super("w:comments"),E(this,"relationships",void 0),E(this,"threadData",void 0),E(this,"commentIdsData",void 0),E(this,"isEmpty",void 0),this.isEmpty=e.length===0,this.root.push(new d1({"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","xmlns:cx":"http://schemas.microsoft.com/office/drawing/2014/chartex","xmlns:cx1":"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex","xmlns:cx2":"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex","xmlns:cx3":"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex","xmlns:cx4":"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex","xmlns:cx5":"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex","xmlns:cx6":"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex","xmlns:cx7":"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex","xmlns:cx8":"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:aink":"http://schemas.microsoft.com/office/drawing/2016/ink","xmlns:am3d":"http://schemas.microsoft.com/office/drawing/2017/model3d","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:m":"http://schemas.openxmlformats.org/officeDocument/2006/math","xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:wp14":"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing","xmlns:wp":"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing","xmlns:w10":"urn:schemas-microsoft-com:office:word","xmlns:w":"http://schemas.openxmlformats.org/wordprocessingml/2006/main","xmlns:w14":"http://schemas.microsoft.com/office/word/2010/wordml","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","xmlns:w16cex":"http://schemas.microsoft.com/office/word/2018/wordml/cex","xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:w16":"http://schemas.microsoft.com/office/word/2018/wordml","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16se":"http://schemas.microsoft.com/office/word/2015/wordml/symex","xmlns:wpg":"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup","xmlns:wpi":"http://schemas.microsoft.com/office/word/2010/wordprocessingInk","xmlns:wne":"http://schemas.microsoft.com/office/word/2006/wordml","xmlns:wps":"http://schemas.microsoft.com/office/word/2010/wordprocessingShape","mc:Ignorable":"w14 w15 wp14"}));let t=e.some(r=>r.parentId!==void 0),n=e.some(r=>r.durableId!==void 0);if(t||n){let r=new Map(e.map(i=>[i.id,p1(i.id)]));for(let i of e)this.root.push(new nh(i,r.get(i.id)));t&&(this.threadData=e.map(i=>({paraId:r.get(i.id),parentParaId:i.parentId!==void 0?r.get(i.parentId):void 0,done:i.resolved}))),n&&(this.commentIdsData=e.map(i=>{var s;return{paraId:r.get(i.id),durableId:(s=i.durableId)!==null&&s!==void 0?s:r.get(i.id)}}))}else for(let r of e)this.root.push(new nh(r));this.relationships=new be}get Relationships(){return this.relationships}get ThreadData(){return this.threadData}get CommentIdsData(){return this.commentIdsData}get IsEmpty(){return this.isEmpty}prepForXml(e){let t=super.prepForXml(e);return zr(t,e),t}},h1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{"xmlns:wpc":"xmlns:wpc","xmlns:mc":"xmlns:mc","xmlns:w15":"xmlns:w15","mc:Ignorable":"mc:Ignorable"})}},m1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{paraId:"w15:paraId",paraIdParent:"w15:paraIdParent",done:"w15:done"})}},f1=class extends I{constructor(e){super("w15:commentEx"),this.root.push(new m1({paraId:e.paraId,paraIdParent:e.parentParaId,done:e.done!==void 0?e.done?"1":"0":void 0}))}},g1=class extends I{constructor(e){super("w15:commentsEx"),this.root.push(new h1({"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","mc:Ignorable":"w15"}));for(let t of e)this.root.push(new f1(t))}},b1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{paraId:"w16cid:paraId",durableId:"w16cid:durableId"})}},v1=class extends I{constructor(e){super("w16cid:commentId"),this.root.push(new b1({paraId:e.paraId,durableId:e.durableId}))}},w1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{"xmlns:w16cid":"xmlns:w16cid","xmlns:mc":"xmlns:mc","mc:Ignorable":"mc:Ignorable"})}},x1=class extends I{constructor(e){super("w16cid:commentsIds"),this.root.push(new w1({"xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"w16cid"}));for(let t of e)this.root.push(new v1(t))}},y1=class extends cm{constructor(){super("w:endnoteRef")}},Xs=class extends cm{constructor(){super("w:tab")}},k1={COLUMN:"column",PAGE:"page"},T1=class extends I{constructor(e){super("w:br"),this.root.push(new Ae({type:e}))}},$m=class extends qe{constructor(){super({}),this.root.push(new T1(k1.PAGE))}},S1=class extends I{constructor(){super("w:pageBreakBefore")}},Mn={AT_LEAST:"atLeast",EXACTLY:"exactly",EXACT:"exact",AUTO:"auto"},C1=({after:e,before:t,line:n,lineRule:r,beforeAutoSpacing:i,afterAutoSpacing:s})=>new L({name:"w:spacing",attributes:{after:{key:"w:after",value:e},before:{key:"w:before",value:t},line:{key:"w:line",value:n},lineRule:{key:"w:lineRule",value:r},beforeAutoSpacing:{key:"w:beforeAutospacing",value:i},afterAutoSpacing:{key:"w:afterAutospacing",value:s}}}),Ys={HEADING_1:"Heading1",HEADING_2:"Heading2",HEADING_3:"Heading3",HEADING_4:"Heading4",HEADING_5:"Heading5",HEADING_6:"Heading6",TITLE:"Title"},Nr=e=>new L({name:"w:pStyle",attributes:{val:{key:"w:val",value:e}}}),rh={LEFT:"left",RIGHT:"right",CENTER:"center",BAR:"bar",CLEAR:"clear",DECIMAL:"decimal",END:"end",NUM:"num",START:"start"},E1={DOT:"dot",HYPHEN:"hyphen",MIDDLE_DOT:"middleDot",NONE:"none",UNDERSCORE:"underscore"},_1=({type:e,position:t,leader:n})=>new L({name:"w:tab",attributes:{val:{key:"w:val",value:e},pos:{key:"w:pos",value:at(t)},leader:{key:"w:leader",value:n}}}),A1=e=>new L({name:"w:tabs",children:e.map(t=>_1(t))}),Ts=class extends I{constructor(e,t){super("w:numPr"),this.root.push(new N1(t)),this.root.push(new I1(e))}},N1=class extends I{constructor(e){if(super("w:ilvl"),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new Ae({val:e}))}},I1=class extends I{constructor(e){super("w:numId"),this.root.push(new Ae({val:typeof e=="string"?`{${e}}`:e}))}},hc=class extends I{constructor(...e){super(...e),E(this,"fileChild",Symbol())}},P1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"r:id",history:"w:history",anchor:"w:anchor"})}},mc=class extends I{constructor(e,t,n,r){super("w:hyperlink"),E(this,"linkId",void 0),E(this,"drawingLink",void 0),this.linkId=t,this.drawingLink=n&&r!==void 0?new kk(r):void 0;let i=new P1({history:1,anchor:n||void 0,id:!n||r!==void 0?`rId${this.linkId}`:void 0});this.root.push(i),e.forEach(s=>{this.root.push(s)})}createDrawingClick(e,t){return this.drawingLink?(this.drawingLink.addRelationship(e),this.drawingLink.createClick(t)):xm(this.linkId,t)}},Fm=class extends mc{constructor(e){super(e.children,$n(),e.anchor)}},O1=class extends I{constructor(e){super("w:externalHyperlink"),E(this,"options",void 0),this.options=e}},R1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",name:"w:name"})}},L1=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id"})}},qm=class Hm{constructor(t){E(this,"start",void 0),E(this,"children",void 0),E(this,"end",void 0);let n=gm();this.start=new Um(t.id,n),this.children=t.children,this.end=new jm(n)}get writtenAs(){return[this.start,...this.children.flatMap(t=>t instanceof Hm?t.writtenAs:[t]),this.end]}},Um=class extends I{constructor(e,t){super("w:bookmarkStart");let n=new R1({name:e,id:t});this.root.push(n)}},jm=class extends I{constructor(e){super("w:bookmarkEnd");let t=new L1({id:e});this.root.push(t)}},M1=e=>new L({name:"w:outlineLvl",attributes:{val:{key:"w:val",value:e}}}),D1=class extends I{constructor(e,t={}){super("w:instrText"),this.root.push(new Ut({space:Ht.PRESERVE}));let n=`PAGEREF ${e}`;t.hyperlink&&(n=`${n} \\h`),t.useRelativePosition&&(n=`${n} \\p`),this.root.push(n)}},B1=class extends qe{constructor(e,t={}){super({children:[fm(),new D1(e,t),sn(),an()]})}},$1=255,Wm=e=>{let t=e.indexOf("#"),n=e.length-t-1;return t>0&&n>0&&n<=$1?{target:e.slice(0,t),anchor:e.slice(t+1)}:{target:e}},Bs=(e,t,n)=>n===void 0?`${e}-${t}`:`${e}-restart ${n}`,Ss=({id:e,fontKey:t,subsetted:n},r)=>new L({name:r,attributes:k({id:{key:"r:id",value:e}},t?{fontKey:{key:"w:fontKey",value:`{${t.toUpperCase()}}`}}:{}),children:[...n?[new P("w:subsetted",n)]:[]]}),F1=({name:e,altName:t,panose1:n,charset:r,family:i,notTrueType:s,pitch:a,sig:o,embedRegular:c,embedBold:l,embedItalic:u,embedBoldItalic:d})=>new L({name:"w:font",attributes:{name:{key:"w:name",value:e}},children:[...t?[kr("w:altName",t)]:[],...n?[kr("w:panose1",n)]:[],...r?[kr("w:charset",r)]:[],...i?[kr("w:family",i)]:[],...s?[new P("w:notTrueType",s)]:[],...a?[kr("w:pitch",a)]:[],...o?[new L({name:"w:sig",attributes:{usb0:{key:"w:usb0",value:o.usb0},usb1:{key:"w:usb1",value:o.usb1},usb2:{key:"w:usb2",value:o.usb2},usb3:{key:"w:usb3",value:o.usb3},csb0:{key:"w:csb0",value:o.csb0},csb1:{key:"w:csb1",value:o.csb1}}})]:[],...c?[Ss(c,"w:embedRegular")]:[],...l?[Ss(l,"w:embedBold")]:[],...u?[Ss(u,"w:embedItalic")]:[],...d?[Ss(d,"w:embedBoldItalic")]:[]]}),q1=({name:e,characterSet:t,embedRegular:n,embedBold:r,embedItalic:i,embedBoldItalic:s})=>F1({name:e,sig:{usb0:"E0002AFF",usb1:"C000247B",usb2:"00000009",usb3:"00000000",csb0:"000001FF",csb1:"00000000"},charset:t,family:"auto",pitch:"variable",embedRegular:n,embedBold:r,embedItalic:i,embedBoldItalic:s}),H1=e=>new L({name:"w:fonts",attributes:{mc:{key:"xmlns:mc",value:"http://schemas.openxmlformats.org/markup-compatibility/2006"},r:{key:"xmlns:r",value:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},w:{key:"xmlns:w",value:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},w14:{key:"xmlns:w14",value:"http://schemas.microsoft.com/office/word/2010/wordml"},w15:{key:"xmlns:w15",value:"http://schemas.microsoft.com/office/word/2012/wordml"},w16cex:{key:"xmlns:w16cex",value:"http://schemas.microsoft.com/office/word/2018/wordml/cex"},w16cid:{key:"xmlns:w16cid",value:"http://schemas.microsoft.com/office/word/2016/wordml/cid"},w16:{key:"xmlns:w16",value:"http://schemas.microsoft.com/office/word/2018/wordml"},w16sdtdh:{key:"xmlns:w16sdtdh",value:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash"},w16se:{key:"xmlns:w16se",value:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Ignorable:{key:"mc:Ignorable",value:"w14 w15 w16se w16cid w16 w16cex w16sdtdh"}},children:e.map(q1)}),U1=[{option:"data",element:"embedRegular",bold:!1,italic:!1},{option:"bold",element:"embedBold",bold:!0,italic:!1},{option:"italic",element:"embedItalic",bold:!1,italic:!0},{option:"boldItalic",element:"embedBoldItalic",bold:!0,italic:!0}],Km=class{constructor(e){E(this,"options",void 0),E(this,"fontTable",void 0),E(this,"relationships",void 0),E(this,"fontOptionsWithKey",[]),E(this,"files",[]),this.options=e;let t=e.map(n=>U1.flatMap(({option:r,element:i,bold:s,italic:a})=>{let o=n[r];return o?[{element:i,file:{name:n.name,data:o,bold:s,italic:a,fontKey:bm()}}]:[]}));this.files=t.flatMap(n=>n.map(({file:r})=>r)),this.fontOptionsWithKey=e.map((n,r)=>k(k({},n),{},{fontKey:t[r][0].file.fontKey})),this.fontTable=H1(e.map((n,r)=>k({name:n.name,characterSet:n.characterSet},Object.fromEntries(t[r].map(({element:i,file:s})=>[i,{id:`rId${this.files.indexOf(s)+1}`,fontKey:s.fontKey}]))))),this.relationships=new be;for(let n=0;n<this.files.length;n++)this.relationships.addRelationship(n+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",`fonts/font${n+1}.odttf`)}get View(){return this.fontTable}get Relationships(){return this.relationships}},j1=()=>new L({name:"w:wordWrap",attributes:{val:{key:"w:val",value:0}}}),W1=e=>{var t,n;return new L({name:"w:framePr",attributes:{anchorLock:{key:"w:anchorLock",value:e.anchorLock},dropCap:{key:"w:dropCap",value:e.dropCap},width:{key:"w:w",value:e.width},height:{key:"w:h",value:e.height},x:{key:"w:x",value:e.position?e.position.x:void 0},y:{key:"w:y",value:e.position?e.position.y:void 0},anchorHorizontal:{key:"w:hAnchor",value:e.anchor.horizontal},anchorVertical:{key:"w:vAnchor",value:e.anchor.vertical},spaceHorizontal:{key:"w:hSpace",value:(t=e.space)===null||t===void 0?void 0:t.horizontal},spaceVertical:{key:"w:vSpace",value:(n=e.space)===null||n===void 0?void 0:n.vertical},rule:{key:"w:hRule",value:e.rule},alignmentX:{key:"w:xAlign",value:e.alignment?e.alignment.x:void 0},alignmentY:{key:"w:yAlign",value:e.alignment?e.alignment.y:void 0},lines:{key:"w:lines",value:e.lines},wrap:{key:"w:wrap",value:e.wrap}}})},al=new WeakMap,K1=Bn(),G1={left:"right",right:"left"},Dn=class extends St{constructor(e,{implicitListParagraphStyle:t=!0,inListOrder:n=!0}={}){if(super("w:pPr",e?.includeIfEmpty),E(this,"numbering",void 0),E(this,"numberProperties",void 0),!e)return this;if(e.heading&&this.push(Nr(e.heading)),t&&(e.bullet&&this.push(Nr("ListParagraph")),e.numbering&&!e.numbering.custom&&!e.style&&!e.heading&&this.push(Nr("ListParagraph"))),e.style&&this.push(Nr(e.style)),e.keepNext!==void 0&&this.push(new P("w:keepNext",e.keepNext)),e.keepLines!==void 0&&this.push(new P("w:keepLines",e.keepLines)),e.pageBreakBefore&&this.push(new S1),e.frame&&this.push(W1(e.frame)),e.widowControl!==void 0&&this.push(new P("w:widowControl",e.widowControl)),e.bullet&&this.push(new Ts(1,e.bullet.level)),e.numbering){let{reference:i,instance:s,level:a,restart:o}=e.numbering,c=typeof i=="string"?i:i.reference,l=new Ts(Bs(c,s??0),a);this.numbering={reference:c,level:a,instance:s,restartedListId:o&&n&&s===void 0?K1():void 0,definition:typeof i=="string"?void 0:i},this.numberProperties=l,this.push(l)}else e.numbering===!1&&this.push(new Ts(0,0));e.border&&this.push(new Ry(e.border)),e.thematicBreak&&this.push(new Ly),e.shading&&this.push(zs(e.shading)),e.wordWrap&&this.push(j1()),e.overflowPunctuation&&this.push(new P("w:overflowPunct",e.overflowPunctuation));let r=[...e.rightTabStop!==void 0?[{type:rh.RIGHT,position:e.rightTabStop}]:[],...e.tabStops?e.tabStops:[],...e.leftTabStop!==void 0?[{type:rh.LEFT,position:e.leftTabStop}]:[]];r.length>0&&this.push(A1(r)),e.bidirectional!==void 0&&this.push(new P("w:bidi",e.bidirectional)),e.spacing&&this.push(C1(e.spacing)),e.indent&&this.push(My(e.indent)),e.contextualSpacing!==void 0&&this.push(new P("w:contextualSpacing",e.contextualSpacing)),e.alignment&&this.push(dm(e.bidirectional&&G1[e.alignment]||e.alignment)),e.outlineLevel!==void 0&&this.push(M1(e.outlineLevel)),e.suppressLineNumbers!==void 0&&this.push(new P("w:suppressLineNumbers",e.suppressLineNumbers)),e.autoSpaceEastAsianText!==void 0&&this.push(new P("w:autoSpaceDN",e.autoSpaceEastAsianText)),e.run&&this.push(new vk(e.run)),e.revision&&this.push(new ih(e.revision))}push(e){this.root.push(e)}addSectionProperties(e){let t=this.root.findIndex(n=>n instanceof ih);if(t===-1){this.root.push(e);return}this.root.splice(t,0,e)}removeSectionProperties(e){let t=this.root.indexOf(e);t!==-1&&this.root.splice(t,1)}prepForXml(e){var t;if(this.numbering){var n,r;let{reference:a,level:o,instance:c=0,definition:l}=this.numbering,u=this.numbering.instance===void 0?(n=this.numbering.restartedListId)!==null&&n!==void 0?n:(r=al.get(e))===null||r===void 0?void 0:r.get(a):void 0;e.viewWrapper instanceof Km||e.file.Numbering.createConcreteNumberingInstance(a,c,l,u);let d=new Ts(Bs(a,c,u),o);this.root.splice(this.root.indexOf(this.numberProperties),1,d),this.numberProperties=d}let i=super.prepForXml(e);if(((t=this.numbering)===null||t===void 0?void 0:t.restartedListId)!==void 0){var s;al.set(e,new Map([...(s=al.get(e))!==null&&s!==void 0?s:[],[this.numbering.reference,this.numbering.restartedListId]]))}return i}},ih=class extends I{constructor(e){super("w:pPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new Dn(k(k({},e),{},{includeIfEmpty:!0}),{inListOrder:!1}))}},ne=class Gm extends hc{constructor(t){if(super("w:p"),E(this,"options",void 0),E(this,"properties",void 0),E(this,"alignment",void 0),this.options=typeof t=="string"?{text:t}:t,typeof t=="string")return this.alignment={},this.properties=new Dn({}),this.root.push(this.properties),this.root.push(new Oe(t)),this;if(this.alignment={alignment:t.alignment,bidirectional:t.bidirectional},this.properties=new Dn(t),this.root.push(this.properties),t.text&&this.root.push(new Oe(t.text)),t.children)for(let n of t.children){if(n instanceof qm){this.root.push(...n.writtenAs);continue}this.root.push(n)}}prepForXml(t){for(let n of this.root)if(Ws(n)==="w:externalHyperlink"){let r=this.root.indexOf(n),{options:i}=n,{target:s,anchor:a}=Wm(i.link),o=new mc(i.children,$n(),a,i.link);t.viewWrapper.Relationships.addRelationship(o.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",s,oc.EXTERNAL),this.root[r]=o}return super.prepForXml(t)}addSectionProperties(t){this.properties.addSectionProperties(t)}removeSectionProperties(t){this.properties.removeSectionProperties(t)}get Alignment(){return this.alignment}with(t){return new Gm(k(k({},this.options),t))}addRunToFront(t){return this.root.splice(1,0,t),this}},z1={TOP:"top",CENTER:"center",BOTTOM:"bottom"},ZI=k(k({},z1),{},{BOTH:"both"}),zm=e=>new L({name:"w:vAlign",attributes:{verticalAlign:{key:"w:val",value:e}}}),V1=({space:e,count:t,separate:n,equalWidth:r,children:i})=>new L({name:"w:cols",attributes:{space:{key:"w:space",value:e===void 0?void 0:ve(e)},count:{key:"w:num",value:t===void 0?void 0:le(t)},separate:{key:"w:sep",value:n},equalWidth:{key:"w:equalWidth",value:r}},children:!r&&i?i:void 0}),X1=({type:e,linePitch:t,charSpace:n})=>new L({name:"w:docGrid",attributes:{type:{key:"w:type",value:e},linePitch:{key:"w:linePitch",value:le(t)},charSpace:{key:"w:charSpace",value:n?le(n):void 0}}}),Ln={DEFAULT:"default",FIRST:"first",EVEN:"even"},sh={HEADER:"w:headerReference",FOOTER:"w:footerReference"},ol=(e,t)=>new L({name:e,attributes:{type:{key:"w:type",value:t.type||Ln.DEFAULT},id:{key:"r:id",value:`rId${t.id}`}}}),Y1=({countBy:e,start:t,restart:n,distance:r})=>new L({name:"w:lnNumType",attributes:{countBy:{key:"w:countBy",value:e===void 0?void 0:le(e)},start:{key:"w:start",value:t===void 0?void 0:le(t)},restart:{key:"w:restart",value:n},distance:{key:"w:distance",value:r===void 0?void 0:ve(r)}}}),Vm=({name:e,position:t,numberFormat:n,start:r,restart:i})=>new L({name:e,children:[...t===void 0?[]:[new L({name:"w:pos",attributes:{val:{key:"w:val",value:t}}})],...n?[new L({name:"w:numFmt",attributes:{val:{key:"w:val",value:n.type},format:{key:"w:format",value:n.format}}})]:[],...r===void 0?[]:[new L({name:"w:numStart",attributes:{val:{key:"w:val",value:le(r)}}})],...i===void 0?[]:[new L({name:"w:numRestart",attributes:{val:{key:"w:val",value:i}}})]]}),J1=e=>Vm(k({name:"w:footnotePr"},e)),Q1=e=>Vm(k({name:"w:endnotePr"},e)),ah=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{display:"w:display",offsetFrom:"w:offsetFrom",zOrder:"w:zOrder"})}},Z1=class extends St{constructor(e){if(super("w:pgBorders"),!e)return this;e.pageBorders?this.root.push(new ah({display:e.pageBorders.display,offsetFrom:e.pageBorders.offsetFrom,zOrder:e.pageBorders.zOrder})):this.root.push(new ah({})),e.pageBorderTop&&this.root.push(he("w:top",e.pageBorderTop)),e.pageBorderLeft&&this.root.push(he("w:left",e.pageBorderLeft)),e.pageBorderBottom&&this.root.push(he("w:bottom",e.pageBorderBottom)),e.pageBorderRight&&this.root.push(he("w:right",e.pageBorderRight))}},eT=(e,t,n,r,i,s,a)=>new L({name:"w:pgMar",attributes:{top:{key:"w:top",value:at(e)},right:{key:"w:right",value:ve(t)},bottom:{key:"w:bottom",value:at(n)},left:{key:"w:left",value:ve(r)},header:{key:"w:header",value:ve(i)},footer:{key:"w:footer",value:ve(s)},gutter:{key:"w:gutter",value:ve(a)}}}),tT={HYPHEN:"hyphen",PERIOD:"period",COLON:"colon",EM_DASH:"emDash",EN_DASH:"endash"},nT=({start:e,formatType:t,separator:n,chapterHeadingLevel:r})=>new L({name:"w:pgNumType",attributes:{start:{key:"w:start",value:e===void 0?void 0:le(e)},formatType:{key:"w:fmt",value:t},separator:{key:"w:chapSep",value:n===tT.EN_DASH?"enDash":n},chapterHeadingLevel:{key:"w:chapStyle",value:r===void 0?void 0:le(r)}}}),$s={PORTRAIT:"portrait",LANDSCAPE:"landscape"},rT=({width:e,height:t,orientation:n,code:r})=>{let i=ve(e),s=ve(t);return new L({name:"w:pgSz",attributes:{width:{key:"w:w",value:n===$s.LANDSCAPE?s:i},height:{key:"w:h",value:n===$s.LANDSCAPE?i:s},orientation:{key:"w:orient",value:n},code:{key:"w:code",value:r}}})},iT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},sT=class extends I{constructor(e){super("w:textDirection"),this.root.push(new iT({val:e}))}},aT=e=>new L({name:"w:type",attributes:{val:{key:"w:val",value:e}}}),it={TOP:1440,RIGHT:1440,BOTTOM:1440,LEFT:1440,HEADER:708,FOOTER:708,GUTTER:0},Ns={WIDTH:11906,HEIGHT:16838,ORIENTATION:$s.PORTRAIT},Rl=class Xm extends I{constructor({page:{size:{width:t=Ns.WIDTH,height:n=Ns.HEIGHT,orientation:r=Ns.ORIENTATION,code:i}={},margin:{top:s=it.TOP,right:a=it.RIGHT,bottom:o=it.BOTTOM,left:c=it.LEFT,header:l=it.HEADER,footer:u=it.FOOTER,gutter:d=it.GUTTER}={},pageNumbers:p={},borders:h,textDirection:f}={},grid:{linePitch:m=360,charSpace:g,type:x}={},headerWrapperGroup:T={},footerWrapperGroup:b={},lineNumbers:C,titlePage:A,verticalAlign:w,column:y,type:v,footnoteProperties:_,endnoteProperties:N,revision:M}={}){super("w:sectPr"),E(this,"availableTextWidth",void 0),this.availableTextWidth=Xm.calculateAvailableTextWidth({pageWidth:r===$s.LANDSCAPE?n:t,left:c,right:a,gutter:d,column:y}),this.addHeaderFooterGroup(sh.HEADER,T),this.addHeaderFooterGroup(sh.FOOTER,b),_&&this.root.push(J1(_)),N&&this.root.push(Q1(N)),v&&this.root.push(aT(v)),this.root.push(rT({width:t,height:n,orientation:r,code:i})),this.root.push(eT(s,a,o,c,l,u,d)),h&&this.root.push(new Z1(h)),C&&this.root.push(Y1(C)),this.root.push(nT(p)),y&&this.root.push(V1(y)),w&&this.root.push(zm(w)),A!==void 0&&this.root.push(new P("w:titlePg",A)),f&&this.root.push(new sT(f)),this.root.push(X1({linePitch:m,charSpace:g,type:x})),M&&this.root.push(new oT(M))}get AvailableTextWidth(){return this.availableTextWidth}static calculateAvailableTextWidth({pageWidth:t,left:n,right:r,gutter:i,column:s}){var a,o;let c=qt(t)-qt(n)-qt(r)-qt(i),l=(a=s?.count)!==null&&a!==void 0?a:1;return l<=1?c:(c-qt((o=s?.space)!==null&&o!==void 0?o:720)*(l-1))/l}addHeaderFooterGroup(t,n){n.default&&this.root.push(ol(t,{type:Ln.DEFAULT,id:n.default.View.ReferenceId})),n.first&&this.root.push(ol(t,{type:Ln.FIRST,id:n.first.View.ReferenceId})),n.even&&this.root.push(ol(t,{type:Ln.EVEN,id:n.even.View.ReferenceId}))}},oT=class extends I{constructor(e){super("w:sectPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new Rl(e))}},Ym=class extends I{constructor({pageNumbers:e}={}){super("w:body"),E(this,"sections",[]),E(this,"sectionParagraphs",new Map),E(this,"headingBookmarkIds",new Fk),E(this,"pageNumbers",void 0),this.pageNumbers=e}getSectionPropertiesFor(e){let t=e?Math.max(this.root.indexOf(e),0):0;for(let n=t;n<this.root.length;n++){let r=this.root[n];if(r instanceof Rl)return r;let i=this.sectionParagraphs.get(r);if(i)return i}return this.sections[this.sections.length-1]}addSection(e){let t=this.sections.pop(),n=this.lastParagraphOfSection();if(t&&n)this.sectionParagraphs.set(n,t);else{let r=this.createSectionParagraph();this.root.push(r),t&&this.sectionParagraphs.set(r,t)}this.sections.push(new Rl(e))}prepForXml(e){var t;this.sections.length===1&&(this.root.splice(0,1),this.root.push(this.sections.pop()));for(let[i,s]of this.sectionParagraphs)i.addSectionProperties(s);let n;try{n=super.prepForXml(e)}finally{for(let[i,s]of this.sectionParagraphs)i.removeSectionProperties(s)}let r=(t=this.pageNumbers)===null||t===void 0?void 0:t.listNumbers;return e1(n,e,this.headingBookmarkIds,r&&(i=>r(i,e))),this.pageNumbers&&(a1(n,e),o1(n,e,this.pageNumbers)),n}push(e){let t=e instanceof ne?this.sectionParagraphs.get(e):void 0;if(t){let n=this.createSectionParagraph();this.root.splice(this.root.indexOf(e)+1,0,n),this.sectionParagraphs.delete(e),this.sectionParagraphs.set(n,t)}this.root.push(e)}lastParagraphOfSection(){let e=this.root[this.root.length-1];return e instanceof ne&&e!==this.root[0]&&!this.sectionParagraphs.has(e)&&this.root.indexOf(e)===this.root.length-1?e:void 0}createSectionParagraph(){return new ne({})}},Fe={AUTO:"auto",DXA:"dxa",NIL:"nil",PERCENTAGE:"pct"},$r=(e,{type:t=Fe.AUTO,size:n})=>{let r=n;return t===Fe.PERCENTAGE&&typeof n=="number"&&(r=Math.round(n*50)),new L({name:e,attributes:{type:{key:"w:type",value:t},size:{key:"w:w",value:lm(r)}}})},Is=Ns.WIDTH-it.LEFT-it.RIGHT-it.GUTTER,Jm=e=>e.options.columnSpan||1,fc=(e,t)=>{if(!e)return;let{type:n=Fe.AUTO,size:r}=e;if(n!==Fe.PERCENTAGE&&n!==Fe.DXA)return;let i=typeof r=="number"?n===Fe.PERCENTAGE?r/100*t:r:r.endsWith("%")?Number(r.slice(0,-1))/100*t:qt(r);return i>0?i:void 0},lT=(e,t)=>{var n;return(n=fc(e,t))!==null&&n!==void 0?n:t},cT=e=>Math.max(0,...e.map(t=>t.cells.reduce((n,r)=>n+Jm(r),0))),oh=({rows:e,width:t,availableWidth:n})=>{let r=cT(e);if(r===0)return[];let i=lT(t,n),s=Array.from({length:r},()=>{}),a=[];for(let u of e){let d=0;for(let p of u.cells){let h=Jm(p),f=fc(p.options.width,i);if(f!==void 0)if(h===1){var o,c;(c=s[o=d])!==null&&c!==void 0||(s[o]=f)}else a.push({start:d,span:h,width:f});d+=h}}for(let{start:u,span:d,width:p}of a){let h=Array.from({length:d},(g,x)=>u+x).filter(g=>g<r),f=h.filter(g=>s[g]===void 0),m=p-h.reduce((g,x)=>{var T;return g+((T=s[x])!==null&&T!==void 0?T:0)},0);if(f.length>0&&m>0)for(let g of f)s[g]=m/f.length}let l=s.flatMap((u,d)=>u===void 0?[d]:[]);if(l.length>0){let u=i-s.reduce((p,h)=>p+(h??0),0),d=u>0?u/l.length:i/r;for(let p of l)s[p]=d}return s.map(u=>Math.round(u))},dT=e=>new L({name:"w:gridCol",attributes:e!==void 0?{width:{key:"w:w",value:ve(e)}}:void 0}),Ps=class extends I{constructor(e,t){super("w:tblGrid");for(let n of e)this.root.push(dT(n));t&&this.root.push(new uT(t))}},pT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id"})}},uT=class extends I{constructor(e){super("w:tblGridChange"),this.root.push(new pT({id:e.id})),this.root.push(new Ps(e.columnWidths))}},hT=class extends I{constructor(e){super("w:ins"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},mT=class extends I{constructor(e){super("w:del"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},fT=class extends I{constructor(e){super("w:cellIns"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},gT=class extends I{constructor(e){super("w:cellDel"),this.root.push(new He({id:e.id,author:e.author,date:e.date}))}},bT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date",verticalMerge:"w:vMerge",verticalMergeOriginal:"w:vMergeOrig"})}},vT=class extends I{constructor(e){super("w:cellMerge"),this.root.push(new bT(e))}},Qm=({marginUnitType:e=Fe.DXA,top:t,left:n,bottom:r,right:i})=>[{name:"w:top",size:t},{name:"w:left",size:n},{name:"w:bottom",size:r},{name:"w:right",size:i}].filter(s=>s.size!==void 0).map(({name:s,size:a})=>$r(s,{type:e,size:a})),wT=e=>{let t=Qm(e);if(t.length!==0)return new L({name:"w:tblCellMar",children:t})},xT=e=>{let t=Qm(e);if(t.length!==0)return new L({name:"w:tcMar",children:t})},yT=class extends St{constructor(e){super("w:tcBorders"),e.top&&this.root.push(he("w:top",e.top)),e.start&&this.root.push(he("w:start",e.start)),e.left&&this.root.push(he("w:left",e.left)),e.bottom&&this.root.push(he("w:bottom",e.bottom)),e.end&&this.root.push(he("w:end",e.end)),e.right&&this.root.push(he("w:right",e.right)),e.diagonalDown&&this.root.push(he("w:tl2br",e.diagonalDown)),e.diagonalUp&&this.root.push(he("w:tr2bl",e.diagonalUp))}},kT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},TT=class extends I{constructor(e){super("w:gridSpan"),this.root.push(new kT({val:le(e)}))}},Zm={CONTINUE:"continue",RESTART:"restart"},ST=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},lh=class extends I{constructor(e){super("w:vMerge"),this.root.push(new ST({val:e}))}},CT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},ET=class extends I{constructor(e){super("w:textDirection"),this.root.push(new CT({val:e}))}},ef=class extends St{constructor(e){if(super("w:tcPr",e.includeIfEmpty),E(this,"hasWidth",void 0),E(this,"hasColumnWidth",!1),this.hasWidth=e.width!==void 0,e.width&&this.root.push($r("w:tcW",e.width)),e.columnSpan&&this.root.push(new TT(e.columnSpan)),e.verticalMerge?this.root.push(new lh(e.verticalMerge)):e.rowSpan&&e.rowSpan>1&&this.root.push(new lh(Zm.RESTART)),e.borders&&this.root.push(new yT(e.borders)),e.shading&&this.root.push(zs(e.shading)),e.margins){let t=xT(e.margins);t&&this.root.push(t)}e.textDirection&&this.root.push(new ET(e.textDirection)),e.verticalAlign&&this.root.push(zm(e.verticalAlign)),e.insertion&&this.root.push(new fT(e.insertion)),e.deletion&&this.root.push(new gT(e.deletion)),e.cellMerge&&this.root.push(new vT(e.cellMerge)),e.revision&&this.root.push(new _T(e.revision))}setColumnWidth(e){this.hasWidth||(this.root.splice(0,this.hasColumnWidth?1:0,$r("w:tcW",{size:e,type:Fe.DXA})),this.hasColumnWidth=!0)}},_T=class extends I{constructor(e){super("w:tcPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new ef(k(k({},e),{},{includeIfEmpty:!0})))}},Fr=class extends I{constructor(e){super("w:tc"),E(this,"options",void 0),E(this,"properties",void 0),this.options=e,this.properties=new ef(e),this.root.push(this.properties);for(let t of e.children)this.root.push(t)}setColumnWidth(e){this.properties.setColumnWidth(e)}prepForXml(e){return Ws(this.root[this.root.length-1])!=="w:p"&&this.root.push(new ne({})),super.prepForXml(e)}},Ll=(e,t)=>t?new P(e):new ot(e,"off"),Pn={style:Gr.NONE,size:0,color:"auto"},AT={style:Gr.SINGLE,size:4,color:"auto"},tf=class extends St{constructor(e,{fillMissingSides:t=!0}={}){super("w:tblBorders");let n=[["w:top",e.top],["w:left",e.left],["w:bottom",e.bottom],["w:right",e.right],["w:insideH",e.insideHorizontal],["w:insideV",e.insideVertical]];for(let[r,i]of n){let s=i??(t?AT:void 0);s&&this.root.push(he(r,s))}}};E(tf,"NONE",{top:Pn,bottom:Pn,left:Pn,right:Pn,insideHorizontal:Pn,insideVertical:Pn});ll={CENTER:"center",INSIDE:"inside",LEFT:"left",OUTSIDE:"outside",RIGHT:"right"},NT={CENTER:"center",INSIDE:"inside",BOTTOM:"bottom",OUTSIDE:"outside",INLINE:"inline",TOP:"top"},IT=({horizontalAnchor:e,verticalAnchor:t,absoluteHorizontalPosition:n,relativeHorizontalPosition:r,absoluteVerticalPosition:i,relativeVerticalPosition:s,bottomFromText:a,topFromText:o,leftFromText:c,rightFromText:l})=>new L({name:"w:tblpPr",attributes:{leftFromText:{key:"w:leftFromText",value:c===void 0?void 0:ve(c)},rightFromText:{key:"w:rightFromText",value:l===void 0?void 0:ve(l)},topFromText:{key:"w:topFromText",value:o===void 0?void 0:ve(o)},bottomFromText:{key:"w:bottomFromText",value:a===void 0?void 0:ve(a)},absoluteHorizontalPosition:{key:"w:tblpX",value:n===void 0?void 0:at(n)},absoluteVerticalPosition:{key:"w:tblpY",value:i===void 0?void 0:at(i)},horizontalAnchor:{key:"w:horzAnchor",value:e},relativeHorizontalPosition:{key:"w:tblpXSpec",value:r},relativeVerticalPosition:{key:"w:tblpYSpec",value:s},verticalAnchor:{key:"w:vertAnchor",value:t}}}),PT=e=>new L({name:"w:tblLayout",attributes:{type:{key:"w:type",value:e}}}),OT={DXA:"dxa",NIL:"nil"},nf=({type:e=OT.DXA,value:t})=>new L({name:"w:tblCellSpacing",attributes:{type:{key:"w:type",value:e},value:{key:"w:w",value:lm(t)}}}),RT=({firstRow:e,lastRow:t,firstColumn:n,lastColumn:r,noHBand:i,noVBand:s})=>new L({name:"w:tblLook",attributes:{firstRow:{key:"w:firstRow",value:e},lastRow:{key:"w:lastRow",value:t},firstColumn:{key:"w:firstColumn",value:n},lastColumn:{key:"w:lastColumn",value:r},noHBand:{key:"w:noHBand",value:i},noVBand:{key:"w:noVBand",value:s}}}),LT=e=>new L({name:"w:tblOverlap",attributes:{val:{key:"w:val",value:e}}}),MT={[ll.LEFT]:ue.LEFT,[ll.CENTER]:ue.CENTER,[ll.RIGHT]:ue.RIGHT},gc=class extends St{constructor(e){var t,n,r;super("w:tblPr",e.includeIfEmpty),e.style&&this.root.push(new ot("w:tblStyle",e.style));let i=((t=e.float)===null||t===void 0?void 0:t.relativeVerticalPosition)===NT.INLINE,s=i?void 0:e.float;s&&this.root.push(IT(s)),s?.overlap&&this.root.push(LT(s.overlap)),e.visuallyRightToLeft!==void 0&&this.root.push(Ll("w:bidiVisual",e.visuallyRightToLeft)),e.width&&this.root.push($r("w:tblW",e.width));let a=(n=e.alignment)!==null&&n!==void 0?n:i&&(!((r=e.float)===null||r===void 0)&&r.relativeHorizontalPosition)?MT[e.float.relativeHorizontalPosition]:void 0;if(a&&this.root.push(dm(a)),e.cellSpacing&&this.root.push(nf(e.cellSpacing)),e.indent&&this.root.push($r("w:tblInd",e.indent)),e.borders&&this.root.push(new tf(e.borders,{fillMissingSides:!e.style})),e.shading&&this.root.push(zs(e.shading)),e.layout&&this.root.push(PT(e.layout)),e.cellMargin){let o=wT(e.cellMargin);o&&this.root.push(o)}e.tableLook&&this.root.push(RT(e.tableLook)),e.revision&&this.root.push(new DT(e.revision))}},DT=class extends I{constructor(e){super("w:tblPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new gc(k(k({},e),{},{includeIfEmpty:!0})))}},BT=(e,t)=>new L({name:"w:trHeight",attributes:{value:{key:"w:val",value:ve(e)},rule:{key:"w:hRule",value:t}}}),rf=class extends St{constructor(e){super("w:trPr",e.includeIfEmpty),e.cantSplit!==void 0&&this.root.push(Ll("w:cantSplit",e.cantSplit)),e.tableHeader!==void 0&&this.root.push(Ll("w:tblHeader",e.tableHeader)),e.height&&this.root.push(BT(e.height.value,e.height.rule)),e.cellSpacing&&this.root.push(nf(e.cellSpacing)),e.insertion&&this.root.push(new hT(e.insertion)),e.deletion&&this.root.push(new mT(e.deletion)),e.revision&&this.root.push(new $T(e.revision))}},$T=class extends I{constructor(e){super("w:trPrChange"),this.root.push(new He({id:e.id,author:e.author,date:e.date})),this.root.push(new rf(k(k({},e),{},{includeIfEmpty:!0})))}},Fs=(e,t)=>{let n=e[t];return Array.isArray(n)?n:[]},Pr=e=>Object.keys(e)[0],FT=(e,t)=>{let n=Fs(e,"w:p"),r=n.find(o=>Pr(o)==="w:pPr");if(!r)return{"w:p":[{"w:pPr":[t]},...n]};let i=Fs(r,"w:pPr");if(i.some(o=>Pr(o)==="w:keepNext"))return e;let s=i.filter(o=>Pr(o)==="w:pStyle").length,a={"w:pPr":[...i.slice(0,s),t,...i.slice(s)]};return{"w:p":n.map(o=>o===r?a:o)}},Js=class extends I{constructor(e){super("w:tr"),E(this,"options",void 0),this.options=e,this.root.push(new rf(e));for(let t of e.children)this.root.push(t)}prepForXml(e){if(this.cells.length===0)return;let t=super.prepForXml(e);if(!t||this.options.keepNext===void 0)return t;let n=new P("w:keepNext",this.options.keepNext).prepForXml(e);return{"w:tr":Fs(t,"w:tr").map(r=>Pr(r)==="w:tc"?{"w:tc":Fs(r,"w:tc").map(i=>Pr(i)==="w:p"?FT(i,n):i)}:r)}}get CellCount(){return this.options.children.length}get cells(){return this.root.filter(e=>Ws(e)==="w:tc")}addCellToIndex(e,t){this.root.splice(t+1,0,e)}addCellToColumnIndex(e,t){let n=this.columnIndexToRootIndex(t,!0);this.addCellToIndex(e,n-1)}rootIndexToColumnIndex(e){if(e<1||e>=this.root.length)throw new Error(`cell 'rootIndex' should between 1 to ${this.root.length-1}`);let t=0;for(let n=1;n<e;n++){let r=this.root[n];t+=r.options.columnSpan||1}return t}columnIndexToRootIndex(e,t=!1){if(e<0)throw new Error("cell 'columnIndex' should not less than zero");let n=0,r=1;for(;n<=e;){if(r>=this.root.length){if(t)return this.root.length;throw new Error(`cell 'columnIndex' should not great than ${n-1}`)}let i=this.root[r];r+=1,n+=i&&i.options.columnSpan||1}return r-1}},sf=class af extends hc{constructor({rows:t,width:n,columnWidths:r,columnWidthsRevision:i,margins:s,indent:a,float:o,layout:c,style:l,borders:u,alignment:d,visuallyRightToLeft:p,tableLook:h,cellSpacing:f,revision:m}){super("w:tbl"),E(this,"rows",void 0),E(this,"width",void 0),E(this,"columnWidths",void 0),E(this,"columnWidthsRevision",void 0),E(this,"resolvedColumnWidths",void 0),this.rows=t,this.width=n??{size:100},this.columnWidths=r,this.columnWidthsRevision=i,t.forEach((g,x)=>{if(x===t.length-1)return;let T=0;g.cells.forEach(b=>{if(b.options.rowSpan&&b.options.rowSpan>1){let C=b.options.children[b.options.children.length-1],A=new Fr({rowSpan:b.options.rowSpan-1,columnSpan:b.options.columnSpan,width:b.options.width,borders:b.options.borders,shading:b.options.shading,margins:b.options.margins,textDirection:b.options.textDirection,verticalAlign:b.options.verticalAlign,children:C instanceof ne?[new ne(C.Alignment)]:[],verticalMerge:Zm.CONTINUE});t[x+1].addCellToColumnIndex(A,T)}T+=b.options.columnSpan||1})}),this.setCellWidths(Is),this.resolvedColumnWidths=r??oh({rows:t,width:this.width,availableWidth:Is}),this.root.push(new gc({borders:l?u:u??{},width:this.width,indent:a,float:o,layout:c,style:l,alignment:d,cellMargin:s,visuallyRightToLeft:p,tableLook:h,cellSpacing:f,revision:m})),this.root.push(new Ps(this.resolvedColumnWidths,i));for(let g of t)this.root.push(g)}get ColumnWidths(){return this.resolvedColumnWidths}getCellWidth(t,n){let{cells:r}=t,i=r.indexOf(n);if(i===-1)return;let s=r.slice(0,i).reduce((o,c)=>o+(c.options.columnSpan||1),0),a=this.resolvedColumnWidths.slice(s,s+(n.options.columnSpan||1));return a.length===0?void 0:a.reduce((o,c)=>o+c,0)}prepForXml(t){if(this.setCellWidths(this.resolveAvailableWidth(t)),this.columnWidths===void 0){this.resolvedColumnWidths=oh({rows:this.rows,width:this.width,availableWidth:this.resolveAvailableWidth(t)});let n=this.root.findIndex(r=>r instanceof Ps);this.root[n]=new Ps(this.resolvedColumnWidths,this.columnWidthsRevision)}return super.prepForXml(t)}setCellWidths(t){var n;if(this.columnWidths===void 0)return;let r=this.columnWidths.reduce((a,o)=>a+o,0),i=(n=fc(this.width,t))!==null&&n!==void 0?n:0,s=r>0&&i>r?i/r:1;for(let a of this.rows){let o=0;for(let c of a.cells){let l=c.options.columnSpan||1,u=this.columnWidths.slice(o,o+l),d=Math.round(u.reduce((p,h)=>p+h,0)*s);u.length===l&&d>0&&c.setColumnWidth(d),o+=l}}}resolveAvailableWidth(t){var n,r,i;let{stack:s}=t,a=s[s.length-1],o=s[s.length-2],c=s[s.length-3];if(a instanceof Fr&&o instanceof Js&&c instanceof af){let p=c.getCellWidth(o,a);if(p!==void 0)return p}let l=s.findIndex(p=>p instanceof Ym),u=(n=t.file)===null||n===void 0||(n=n.Document)===null||n===void 0?void 0:n.View.Body,d=l>=0?s[l].getSectionPropertiesFor((r=s[l+1])!==null&&r!==void 0?r:this):u?.getSectionPropertiesFor();return(i=d?.AvailableTextWidth)!==null&&i!==void 0?i:Is}},qT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},HT=class extends I{constructor(){super("Properties"),this.root.push(new qT({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}))}},UT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns"})}},wt=(e,t)=>new L({name:"Default",attributes:{contentType:{key:"ContentType",value:e},extension:{key:"Extension",value:t}}}),ge=(e,t)=>new L({name:"Override",attributes:{contentType:{key:"ContentType",value:e},partName:{key:"PartName",value:t}}}),jT=class extends I{constructor({macros:e=!1}={}){super("Types"),this.root.push(new UT({xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"})),this.root.push(wt("image/png","png")),this.root.push(wt("image/jpeg","jpeg")),this.root.push(wt("image/jpeg","jpg")),this.root.push(wt("image/bmp","bmp")),this.root.push(wt("image/gif","gif")),this.root.push(wt("image/svg+xml","svg")),this.root.push(wt("application/vnd.openxmlformats-package.relationships+xml","rels")),this.root.push(wt("application/xml","xml")),this.root.push(wt("application/vnd.openxmlformats-officedocument.obfuscatedFont","odttf")),this.root.push(ge(e?"application/vnd.ms-word.document.macroEnabled.main+xml":"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","/word/document.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml","/word/styles.xml")),this.root.push(ge("application/vnd.openxmlformats-package.core-properties+xml","/docProps/core.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.custom-properties+xml","/docProps/custom.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.extended-properties+xml","/docProps/app.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml","/word/numbering.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","/word/footnotes.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml","/word/endnotes.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml","/word/settings.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml","/word/fontTable.xml")),this.root.push(ge("application/vnd.openxmlformats-officedocument.theme+xml","/word/theme/theme1.xml")),e&&this.root.push(ge("application/vnd.ms-office.vbaProject","/word/vbaProject.bin"))}addComments(){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml","/word/comments.xml"))}addCommentsExtended(){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml","/word/commentsExtended.xml"))}addCommentsIds(){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml","/word/commentsIds.xml"))}addFooter(e){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",`/word/footer${e}.xml`))}addOverride(e,t){this.root.push(ge(e,t))}addHeader(e){this.root.push(ge("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",`/word/header${e}.xml`))}},Ml={wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",aink:"http://schemas.microsoft.com/office/drawing/2016/ink",am3d:"http://schemas.microsoft.com/office/drawing/2017/model3d",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16:"http://schemas.microsoft.com/office/word/2018/wordml",w16sdtdh:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Qs=class extends H{constructor(e,t){super(k({Ignorable:t},Object.fromEntries(e.map(n=>[n,Ml[n]])))),E(this,"xmlKeys",k({Ignorable:"mc:Ignorable"},Object.fromEntries(Object.keys(Ml).map(n=>[n,`xmlns:${n}`]))))}},WT=class extends I{constructor(e){super("cp:coreProperties"),this.root.push(new Qs(["cp","dc","dcterms","dcmitype","xsi"])),e.title&&this.root.push(new nn("dc:title",e.title)),e.subject&&this.root.push(new nn("dc:subject",e.subject)),e.creator&&this.root.push(new nn("dc:creator",e.creator)),e.keywords&&this.root.push(new nn("cp:keywords",e.keywords)),e.description&&this.root.push(new nn("dc:description",e.description)),e.lastModifiedBy&&this.root.push(new nn("cp:lastModifiedBy",e.lastModifiedBy)),e.revision&&this.root.push(new nn("cp:revision",String(e.revision))),this.root.push(new ch("dcterms:created")),this.root.push(new ch("dcterms:modified"))}},KT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"xsi:type"})}},ch=class extends I{constructor(e){super(e),this.root.push(new KT({type:"dcterms:W3CDTF"})),this.root.push(xy(new Date))}},GT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},zT=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{formatId:"fmtid",pid:"pid",name:"name"})}},VT=class extends I{constructor(e,t){super("property"),this.root.push(new zT({formatId:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:e.toString(),name:t.name})),this.root.push(new XT(t.value))}},XT=class extends I{constructor(e){super("vt:lpwstr"),this.root.push(e)}},YT=class extends I{constructor(e){super("Properties"),E(this,"nextId",void 0),E(this,"properties",[]),this.root.push(new GT({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"})),this.nextId=2;for(let t of e)this.addCustomProperty(t)}prepForXml(e){return this.root.splice(1,this.root.length-1,...this.properties),super.prepForXml(e)}addCustomProperty(e){this.properties.push(new VT(this.nextId++,e))}},JT=e=>new L({name:"ds:datastoreItem",attributes:{itemId:{key:"ds:itemID",value:e},namespace:{key:"xmlns:ds",value:"http://schemas.openxmlformats.org/officeDocument/2006/customXml"}},children:[new L({name:"ds:schemaRefs",children:[new L({name:"ds:schemaRef",attributes:{uri:{key:"ds:uri",value:"http://schemas.openxmlformats.org/officeDocument/2006/bibliography"}}})]})]}),QT={new:"wne:eventDocNew",open:"wne:eventDocOpen",close:"wne:eventDocClose",sync:"wne:eventDocSync",xmlAfterInsert:"wne:eventDocXmlAfterInsert",xmlBeforeDelete:"wne:eventDocXmlBeforeDelete",contentControlAfterAdd:"wne:eventDocContentControlAfterInsert",contentControlBeforeDelete:"wne:eventDocContentControlBeforeDelete",contentControlOnExit:"wne:eventDocContentControlOnExit",contentControlOnEnter:"wne:eventDocContentControlOnEnter",contentControlBeforeStoreUpdate:"wne:eventDocStoreUpdate",contentControlBeforeContentUpdate:"wne:eventDocContentControlContentUpdate",buildingBlockInsert:"wne:eventDocBuildingBlockAfterInsert"},ZT=e=>new L({name:"wne:vbaSuppData",attributes:{namespace:{key:"xmlns:wne",value:"http://schemas.microsoft.com/office/word/2006/wordml"}},children:[new L({name:"wne:docEvents",children:Object.entries(QT).filter(([t])=>e.includes(t)).map(([,t])=>new L({name:t}))})]}),eS=class extends I{constructor({color:e,themeColor:t,themeShade:n,themeTint:r}){if(super("w:background"),typeof e=="object"&&(t!==void 0||n!==void 0||r!==void 0))throw new Error("Invalid background. Expected a theme color in color, or themeColor, themeShade and themeTint, not both");this.root.push(new ic([{keys:Kr,color:e},{key:"w:themeColor",value:t},{key:"w:themeShade",value:n===void 0?void 0:Yu(n)},{key:"w:themeTint",value:r===void 0?void 0:Yu(r)}]))}},tS=class extends I{constructor(e){super("w:document"),E(this,"body",void 0),this.root.push(new Qs(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps","cx","cx1","cx2","cx3","cx4","cx5","cx6","cx7","cx8","aink","am3d","w16cex","w16cid","w16","w16sdtdh","w16se"],"w14 w15 wp14")),this.body=new Ym({pageNumbers:e.pageNumbers}),e.background&&this.root.push(new eS(e.background)),this.root.push(this.body)}add(e){return this.body.push(e),this}get Body(){return this.body}},nS=class{constructor(e){E(this,"document",void 0),E(this,"relationships",void 0),this.document=new tS(e),this.relationships=new be}get View(){return this.document}get Relationships(){return this.relationships}},rS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},of=class extends I{constructor(e,t){super("w:p"),E(this,"paragraph",void 0),E(this,"mark",void 0),this.paragraph=e,this.mark=t}prepForXml(e){let t=this.paragraph.prepForXml(e)["w:p"],n=Array.isArray(t)?t:[],r=n.length>0&&"w:pPr"in n[0]?1:0;return{"w:p":[...n.slice(0,r),this.mark.prepForXml(e),...n.slice(r)]}}},iS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"w:type",id:"w:id"})}},lf=class extends qe{constructor(){super({style:"EndnoteReference"}),this.root.push(new y1)}},dh={SEPARATOR:"separator",CONTINUATION_SEPARATOR:"continuationSeparator"},cl=class extends I{constructor(e){super("w:endnote"),this.root.push(new iS({type:e.type,id:e.id}));for(let[t,n]of e.children.entries())this.root.push(t===0?new of(n,new lf):n)}},sS=class extends I{constructor(){super("w:continuationSeparator")}},cf=class extends qe{constructor(){super({}),this.root.push(new sS)}},aS=class extends I{constructor(){super("w:separator")}},df=class extends qe{constructor(){super({}),this.root.push(new aS)}},pf=class extends I{constructor(){super("w:endnotes"),E(this,"ownNotes",new Map),E(this,"highestId",0),this.root.push(new rS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));let e=new cl({id:-1,type:dh.SEPARATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Mn.AUTO},children:[new df]})]});this.root.push(e);let t=new cl({id:0,type:dh.CONTINUATION_SEPARATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Mn.AUTO},children:[new cf]})]});this.root.push(t)}createEndnote(e,t){let n=new cl({id:e,children:t});this.root.push(n),Number.isFinite(e)&&(this.highestId=Math.max(this.highestId,Math.floor(e)))}idOf(e,t,n){if(n.viewWrapper!==n.file.Document)return;let r=this.ownNotes.get(e);if(r!==void 0)return r;let i=this.highestId+1;return this.createEndnote(i,t.children),this.ownNotes.set(e,i),i}prepForXml(e){let t=super.prepForXml(e);return zr(t,e),t}},oS=class{constructor(){E(this,"endnotes",void 0),E(this,"relationships",void 0),this.endnotes=new pf,this.relationships=new be}get View(){return this.endnotes}get Relationships(){return this.relationships}},lS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type"})}},cS=class extends im{constructor(e,t){super("w:ftr",t),E(this,"refId",void 0),this.refId=e,t||this.root.push(new lS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}prepForXml(e){let t=super.prepForXml(e);return zr(t,e,this.refId),t}},dS=class{constructor(e,t,n){E(this,"media",void 0),E(this,"footer",void 0),E(this,"relationships",void 0),this.media=e,this.footer=new cS(t,n),this.relationships=new be}add(e){this.footer.add(e)}addChildElement(e){this.footer.addChildElement(e)}get View(){return this.footer}get Relationships(){return this.relationships}get Media(){return this.media}},pS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"w:type",id:"w:id"})}},uS=class extends I{constructor(){super("w:footnoteRef")}},uf=class extends qe{constructor(){super({style:"FootnoteReference"}),this.root.push(new uS)}},ph={SEPERATOR:"separator",CONTINUATION_SEPERATOR:"continuationSeparator"},dl=class extends I{constructor(e){super("w:footnote"),this.root.push(new pS({type:e.type,id:e.id}));for(let[t,n]of e.children.entries())this.root.push(t===0?new of(n,new uf):n)}},hS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},hf=class extends I{constructor(){super("w:footnotes"),E(this,"ownNotes",new Map),E(this,"highestId",0),this.root.push(new hS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));let e=new dl({id:-1,type:ph.SEPERATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Mn.AUTO},children:[new df]})]});this.root.push(e);let t=new dl({id:0,type:ph.CONTINUATION_SEPERATOR,children:[new ne({spacing:{after:0,line:240,lineRule:Mn.AUTO},children:[new cf]})]});this.root.push(t)}createFootNote(e,t){let n=new dl({id:e,children:t});this.root.push(n),Number.isFinite(e)&&(this.highestId=Math.max(this.highestId,Math.floor(e)))}idOf(e,t,n){if(n.viewWrapper!==n.file.Document)return;let r=this.ownNotes.get(e);if(r!==void 0)return r;let i=this.highestId+1;return this.createFootNote(i,t.children),this.ownNotes.set(e,i),i}prepForXml(e){let t=super.prepForXml(e);return zr(t,e),t}},mS=class{constructor(){E(this,"footnotess",void 0),E(this,"relationships",void 0),this.footnotess=new hf,this.relationships=new be}get View(){return this.footnotess}get Relationships(){return this.relationships}},fS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type",cx:"xmlns:cx",cx1:"xmlns:cx1",cx2:"xmlns:cx2",cx3:"xmlns:cx3",cx4:"xmlns:cx4",cx5:"xmlns:cx5",cx6:"xmlns:cx6",cx7:"xmlns:cx7",cx8:"xmlns:cx8",w16cid:"xmlns:w16cid",w16se:"xmlns:w16se"})}},gS=class extends im{constructor(e,t){super("w:hdr",t),E(this,"refId",void 0),this.refId=e,t||this.root.push(new fS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}prepForXml(e){let t=super.prepForXml(e);return zr(t,e,this.refId),t}},bS=class{constructor(e,t,n){E(this,"media",void 0),E(this,"header",void 0),E(this,"relationships",void 0),this.media=e,this.header=new gS(t,n),this.relationships=new be}add(e){return this.header.add(e),this}addChildElement(e){this.header.addChildElement(e)}get View(){return this.header}get Relationships(){return this.relationships}get Media(){return this.media}},vS=()=>{let e=new Map;return t=>{var n;let r=((n=e.get(t))!==null&&n!==void 0?n:0)+1;return e.set(t,r),`media/image${r}.${t}`}},mf=class{constructor(e=vS()){E(this,"map",new Map),E(this,"takePath",void 0),this.takePath=e}addImage(e,t){if(this.map.has(e))return;let n=this.takePath(t.type);this.map.set(e,k(k({},t),{},{fileName:n.slice(n.lastIndexOf("/")+1)}))}get Array(){return Array.from(this.map.values())}get Entries(){return Array.from(this.map.entries())}},xt={DECIMAL:"decimal",UPPER_ROMAN:"upperRoman",LOWER_ROMAN:"lowerRoman",UPPER_LETTER:"upperLetter",LOWER_LETTER:"lowerLetter",ORDINAL:"ordinal",CARDINAL_TEXT:"cardinalText",ORDINAL_TEXT:"ordinalText",HEX:"hex",CHICAGO:"chicago",IDEOGRAPH__DIGITAL:"ideographDigital",JAPANESE_COUNTING:"japaneseCounting",AIUEO:"aiueo",IROHA:"iroha",DECIMAL_FULL_WIDTH:"decimalFullWidth",DECIMAL_HALF_WIDTH:"decimalHalfWidth",JAPANESE_LEGAL:"japaneseLegal",JAPANESE_DIGITAL_TEN_THOUSAND:"japaneseDigitalTenThousand",DECIMAL_ENCLOSED_CIRCLE:"decimalEnclosedCircle",DECIMAL_FULL_WIDTH2:"decimalFullWidth2",AIUEO_FULL_WIDTH:"aiueoFullWidth",IROHA_FULL_WIDTH:"irohaFullWidth",DECIMAL_ZERO:"decimalZero",BULLET:"bullet",GANADA:"ganada",CHOSUNG:"chosung",DECIMAL_ENCLOSED_FULLSTOP:"decimalEnclosedFullstop",DECIMAL_ENCLOSED_PARENTHESES:"decimalEnclosedParen",DECIMAL_ENCLOSED_CIRCLE_CHINESE:"decimalEnclosedCircleChinese",IDEOGRAPH_ENCLOSED_CIRCLE:"ideographEnclosedCircle",IDEOGRAPH_TRADITIONAL:"ideographTraditional",IDEOGRAPH_ZODIAC:"ideographZodiac",IDEOGRAPH_ZODIAC_TRADITIONAL:"ideographZodiacTraditional",TAIWANESE_COUNTING:"taiwaneseCounting",IDEOGRAPH_LEGAL_TRADITIONAL:"ideographLegalTraditional",TAIWANESE_COUNTING_THOUSAND:"taiwaneseCountingThousand",TAIWANESE_DIGITAL:"taiwaneseDigital",CHINESE_COUNTING:"chineseCounting",CHINESE_LEGAL_SIMPLIFIED:"chineseLegalSimplified",CHINESE_COUNTING_THOUSAND:"chineseCountingThousand",KOREAN_DIGITAL:"koreanDigital",KOREAN_COUNTING:"koreanCounting",KOREAN_LEGAL:"koreanLegal",KOREAN_DIGITAL2:"koreanDigital2",VIETNAMESE_COUNTING:"vietnameseCounting",RUSSIAN_LOWER:"russianLower",RUSSIAN_UPPER:"russianUpper",NONE:"none",NUMBER_IN_DASH:"numberInDash",HEBREW1:"hebrew1",HEBREW2:"hebrew2",ARABIC_ALPHA:"arabicAlpha",ARABIC_ABJAD:"arabicAbjad",HINDI_VOWELS:"hindiVowels",HINDI_CONSONANTS:"hindiConsonants",HINDI_NUMBERS:"hindiNumbers",HINDI_COUNTING:"hindiCounting",THAI_LETTERS:"thaiLetters",THAI_NUMBERS:"thaiNumbers",THAI_COUNTING:"thaiCounting",BAHT_TEXT:"bahtText",DOLLAR_TEXT:"dollarText",CUSTOM:"custom"},wS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{ilvl:"w:ilvl",tentative:"w:tentative"})}},xS=class extends I{constructor(e){super("w:numFmt"),this.root.push(new Ae({val:e}))}},yS=class extends I{constructor(e){super("w:lvlText"),this.root.push(new Ae({val:e}))}},kS=e=>{switch(e){case ue.CENTER:return"center";case ue.END:case ue.RIGHT:return"right";default:return"left"}},TS=class extends I{constructor(e){super("w:lvlJc"),this.root.push(new Ae({val:kS(e)}))}},SS=class extends I{constructor(e){super("w:suff"),this.root.push(new Ae({val:e}))}},CS=class extends I{constructor(){super("w:isLgl")}},ES=class extends I{constructor({level:e,format:t,text:n,alignment:r=ue.START,start:i=1,style:s,suffix:a,isLegalNumberingStyle:o}){if(super("w:lvl"),E(this,"paragraphProperties",void 0),E(this,"runProperties",void 0),this.root.push(new Ir("w:start",le(i))),t&&this.root.push(new xS(t)),s?.style&&this.root.push(Nr(s.style)),o&&this.root.push(new CS),a&&this.root.push(new SS(a)),n&&this.root.push(new yS(n)),this.root.push(new TS(r)),this.paragraphProperties=new Dn(s&&s.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new on(s?.run&&k(k({},s.run),{},{highlight:void 0,math:void 0,revision:void 0})),this.root.push(this.paragraphProperties),this.root.push(this.runProperties),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new wS({ilvl:le(e),tentative:1}))}},_S=class extends ES{},AS=class extends I{constructor(e){super("w:multiLevelType"),this.root.push(new Ae({val:e}))}},NS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{abstractNumId:"w:abstractNumId",restartNumberingAfterBreak:"w15:restartNumberingAfterBreak"})}},pl=class extends I{constructor(e,t){super("w:abstractNum"),E(this,"id",void 0),this.root.push(new NS({abstractNumId:le(e),restartNumberingAfterBreak:0})),this.root.push(new AS("hybridMultilevel")),this.id=e;for(let n of t)this.root.push(new _S(n))}},IS=class extends I{constructor(e){super("w:abstractNumId"),this.root.push(new Ae({val:e}))}},PS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{numId:"w:numId"})}},uh=class extends I{constructor(e){if(super("w:num"),E(this,"numId",void 0),E(this,"reference",void 0),E(this,"instance",void 0),E(this,"restartedListId",void 0),this.numId=e.numId,this.reference=e.reference,this.instance=e.instance,this.restartedListId=e.restartedListId,this.root.push(new PS({numId:le(e.numId)})),this.root.push(new IS(le(e.abstractNumId))),e.overrideLevels&&e.overrideLevels.length)for(let t of e.overrideLevels)this.root.push(new RS(t.num,t.start))}},OS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{ilvl:"w:ilvl"})}},RS=class extends I{constructor(e,t){super("w:lvlOverride"),this.root.push(new OS({ilvl:e})),t!==void 0&&this.root.push(new MS(t))}},LS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},MS=class extends I{constructor(e){super("w:startOverride"),this.root.push(new LS({val:e}))}},ff=class extends I{constructor(e){super("w:numbering"),E(this,"abstractNumberingMap",new Map),E(this,"concreteNumberingMap",new Map),E(this,"referenceConfigMap",new Map),E(this,"abstractNumUniqueNumericId",rk()),E(this,"concreteNumUniqueNumericId",ik()),this.root.push(new Qs(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps"],"w14 w15 wp14"));let t=new pl(this.abstractNumUniqueNumericId(),[{level:0,format:xt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:Xe(.5),hanging:Xe(.25)}}}},{level:1,format:xt.BULLET,text:"\u25CB",alignment:ue.LEFT,style:{paragraph:{indent:{left:Xe(1),hanging:Xe(.25)}}}},{level:2,format:xt.BULLET,text:"\u25A0",alignment:ue.LEFT,style:{paragraph:{indent:{left:2160,hanging:Xe(.25)}}}},{level:3,format:xt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:2880,hanging:Xe(.25)}}}},{level:4,format:xt.BULLET,text:"\u25CB",alignment:ue.LEFT,style:{paragraph:{indent:{left:3600,hanging:Xe(.25)}}}},{level:5,format:xt.BULLET,text:"\u25A0",alignment:ue.LEFT,style:{paragraph:{indent:{left:4320,hanging:Xe(.25)}}}},{level:6,format:xt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:5040,hanging:Xe(.25)}}}},{level:7,format:xt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:5760,hanging:Xe(.25)}}}},{level:8,format:xt.BULLET,text:"\u25CF",alignment:ue.LEFT,style:{paragraph:{indent:{left:6480,hanging:Xe(.25)}}}}]);this.concreteNumberingMap.set("default-bullet-numbering",new uh({numId:1,abstractNumId:t.id,reference:"default-bullet-numbering",instance:0,overrideLevels:[{num:0,start:1}]})),this.abstractNumberingMap.set("default-bullet-numbering",t);for(let n of e.config)this.abstractNumberingMap.set(n.reference,new pl(this.abstractNumUniqueNumericId(),n.levels)),this.referenceConfigMap.set(n.reference,n.levels)}prepForXml(e){return this.root.splice(1,this.root.length-1,...this.abstractNumberingMap.values(),...this.concreteNumberingMap.values()),super.prepForXml(e)}createConcreteNumberingInstance(e,t,n,r){var i;n&&!this.abstractNumberingMap.has(n.reference)&&(this.abstractNumberingMap.set(n.reference,new pl(this.abstractNumUniqueNumericId(),n.levels)),this.referenceConfigMap.set(n.reference,n.levels));let s=this.abstractNumberingMap.get(e);if(!s)return;let a=Bs(e,t,r);if(this.concreteNumberingMap.has(a))return;let o=(i=this.referenceConfigMap.get(e))!==null&&i!==void 0?i:[{level:0}],c={numId:this.concreteNumUniqueNumericId(),abstractNumId:s.id,reference:e,instance:t,restartedListId:r,overrideLevels:o.map(({level:l,start:u=1})=>({num:l,start:le(u)}))};this.concreteNumberingMap.set(a,new uh(c))}get ConcreteNumbering(){return Array.from(this.concreteNumberingMap.values())}get ReferenceConfig(){return Array.from(this.referenceConfigMap.values())}},gf=class{constructor(e,t=new Set){E(this,"contentTypes",void 0),E(this,"paths",new Map),E(this,"taken",void 0),E(this,"folders",new WeakMap),this.contentTypes=e,this.taken=new Set(t)}add(e){let t=this.paths.get(e);if(t!==void 0)return t;let{folder:n,name:r,extension:i,contentType:s}=e.options,a=this.takePath(n,r,i);return this.paths.set(e,a),this.contentTypes.addOverride(s,`/word/${a}`),a}takePath(e,t,n){let r=1;for(;this.taken.has(`${e}/${t}${r}.${n}`);)r++;let i=`${e}/${t}${r}.${n}`;return this.taken.add(i),i}get Array(){return[...this.paths].map(([e,t])=>({part:e,path:t}))}createRelationships(e){let t=new be;return this.folders.set(t,e.slice(0,e.indexOf("/"))),t}getTarget(e,t){let n=this.folders.get(e);return n===void 0?t:t.startsWith(`${n}/`)?t.slice(n.length+1):`../${t}`}},DS=e=>new L({name:"w:compatSetting",attributes:{version:{key:"w:val",value:e},name:{key:"w:name",value:"compatibilityMode"},uri:{key:"w:uri",value:"http://schemas.microsoft.com/office/word"}}}),BS=class extends I{constructor(e){super("w:compat"),e.useSingleBorderforContiguousCells&&this.root.push(new P("w:useSingleBorderforContiguousCells",e.useSingleBorderforContiguousCells)),e.wordPerfectJustification&&this.root.push(new P("w:wpJustification",e.wordPerfectJustification)),e.noTabStopForHangingIndent&&this.root.push(new P("w:noTabHangInd",e.noTabStopForHangingIndent)),e.noLeading&&this.root.push(new P("w:noLeading",e.noLeading)),e.spaceForUnderline&&this.root.push(new P("w:spaceForUL",e.spaceForUnderline)),e.noColumnBalance&&this.root.push(new P("w:noColumnBalance",e.noColumnBalance)),e.balanceSingleByteDoubleByteWidth&&this.root.push(new P("w:balanceSingleByteDoubleByteWidth",e.balanceSingleByteDoubleByteWidth)),e.noExtraLineSpacing&&this.root.push(new P("w:noExtraLineSpacing",e.noExtraLineSpacing)),e.doNotLeaveBackslashAlone&&this.root.push(new P("w:doNotLeaveBackslashAlone",e.doNotLeaveBackslashAlone)),e.underlineTrailingSpaces&&this.root.push(new P("w:ulTrailSpace",e.underlineTrailingSpaces)),e.doNotExpandShiftReturn&&this.root.push(new P("w:doNotExpandShiftReturn",e.doNotExpandShiftReturn)),e.spacingInWholePoints&&this.root.push(new P("w:spacingInWholePoints",e.spacingInWholePoints)),e.lineWrapLikeWord6&&this.root.push(new P("w:lineWrapLikeWord6",e.lineWrapLikeWord6)),e.printBodyTextBeforeHeader&&this.root.push(new P("w:printBodyTextBeforeHeader",e.printBodyTextBeforeHeader)),e.printColorsBlack&&this.root.push(new P("w:printColBlack",e.printColorsBlack)),e.spaceWidth&&this.root.push(new P("w:wpSpaceWidth",e.spaceWidth)),e.showBreaksInFrames&&this.root.push(new P("w:showBreaksInFrames",e.showBreaksInFrames)),e.subFontBySize&&this.root.push(new P("w:subFontBySize",e.subFontBySize)),e.suppressBottomSpacing&&this.root.push(new P("w:suppressBottomSpacing",e.suppressBottomSpacing)),e.suppressTopSpacing&&this.root.push(new P("w:suppressTopSpacing",e.suppressTopSpacing)),e.suppressSpacingAtTopOfPage&&this.root.push(new P("w:suppressSpacingAtTopOfPage",e.suppressSpacingAtTopOfPage)),e.suppressTopSpacingWP&&this.root.push(new P("w:suppressTopSpacingWP",e.suppressTopSpacingWP)),e.suppressSpBfAfterPgBrk&&this.root.push(new P("w:suppressSpBfAfterPgBrk",e.suppressSpBfAfterPgBrk)),e.swapBordersFacingPages&&this.root.push(new P("w:swapBordersFacingPages",e.swapBordersFacingPages)),e.convertMailMergeEsc&&this.root.push(new P("w:convMailMergeEsc",e.convertMailMergeEsc)),e.truncateFontHeightsLikeWP6&&this.root.push(new P("w:truncateFontHeightsLikeWP6",e.truncateFontHeightsLikeWP6)),e.macWordSmallCaps&&this.root.push(new P("w:mwSmallCaps",e.macWordSmallCaps)),e.usePrinterMetrics&&this.root.push(new P("w:usePrinterMetrics",e.usePrinterMetrics)),e.doNotSuppressParagraphBorders&&this.root.push(new P("w:doNotSuppressParagraphBorders",e.doNotSuppressParagraphBorders)),e.wrapTrailSpaces&&this.root.push(new P("w:wrapTrailSpaces",e.wrapTrailSpaces)),e.footnoteLayoutLikeWW8&&this.root.push(new P("w:footnoteLayoutLikeWW8",e.footnoteLayoutLikeWW8)),e.shapeLayoutLikeWW8&&this.root.push(new P("w:shapeLayoutLikeWW8",e.shapeLayoutLikeWW8)),e.alignTablesRowByRow&&this.root.push(new P("w:alignTablesRowByRow",e.alignTablesRowByRow)),e.forgetLastTabAlignment&&this.root.push(new P("w:forgetLastTabAlignment",e.forgetLastTabAlignment)),e.adjustLineHeightInTable&&this.root.push(new P("w:adjustLineHeightInTable",e.adjustLineHeightInTable)),e.autoSpaceLikeWord95&&this.root.push(new P("w:autoSpaceLikeWord95",e.autoSpaceLikeWord95)),e.noSpaceRaiseLower&&this.root.push(new P("w:noSpaceRaiseLower",e.noSpaceRaiseLower)),e.doNotUseHTMLParagraphAutoSpacing&&this.root.push(new P("w:doNotUseHTMLParagraphAutoSpacing",e.doNotUseHTMLParagraphAutoSpacing)),e.layoutRawTableWidth&&this.root.push(new P("w:layoutRawTableWidth",e.layoutRawTableWidth)),e.layoutTableRowsApart&&this.root.push(new P("w:layoutTableRowsApart",e.layoutTableRowsApart)),e.useWord97LineBreakRules&&this.root.push(new P("w:useWord97LineBreakRules",e.useWord97LineBreakRules)),e.doNotBreakWrappedTables&&this.root.push(new P("w:doNotBreakWrappedTables",e.doNotBreakWrappedTables)),e.doNotSnapToGridInCell&&this.root.push(new P("w:doNotSnapToGridInCell",e.doNotSnapToGridInCell)),e.selectFieldWithFirstOrLastCharacter&&this.root.push(new P("w:selectFldWithFirstOrLastChar",e.selectFieldWithFirstOrLastCharacter)),e.applyBreakingRules&&this.root.push(new P("w:applyBreakingRules",e.applyBreakingRules)),e.doNotWrapTextWithPunctuation&&this.root.push(new P("w:doNotWrapTextWithPunct",e.doNotWrapTextWithPunctuation)),e.doNotUseEastAsianBreakRules&&this.root.push(new P("w:doNotUseEastAsianBreakRules",e.doNotUseEastAsianBreakRules)),e.useWord2002TableStyleRules&&this.root.push(new P("w:useWord2002TableStyleRules",e.useWord2002TableStyleRules)),e.growAutofit&&this.root.push(new P("w:growAutofit",e.growAutofit)),e.useFELayout&&this.root.push(new P("w:useFELayout",e.useFELayout)),e.useNormalStyleForList&&this.root.push(new P("w:useNormalStyleForList",e.useNormalStyleForList)),e.doNotUseIndentAsNumberingTabStop&&this.root.push(new P("w:doNotUseIndentAsNumberingTabStop",e.doNotUseIndentAsNumberingTabStop)),e.useAlternateEastAsianLineBreakRules&&this.root.push(new P("w:useAltKinsokuLineBreakRules",e.useAlternateEastAsianLineBreakRules)),e.allowSpaceOfSameStyleInTable&&this.root.push(new P("w:allowSpaceOfSameStyleInTable",e.allowSpaceOfSameStyleInTable)),e.doNotSuppressIndentation&&this.root.push(new P("w:doNotSuppressIndentation",e.doNotSuppressIndentation)),e.doNotAutofitConstrainedTables&&this.root.push(new P("w:doNotAutofitConstrainedTables",e.doNotAutofitConstrainedTables)),e.autofitToFirstFixedWidthCell&&this.root.push(new P("w:autofitToFirstFixedWidthCell",e.autofitToFirstFixedWidthCell)),e.underlineTabInNumberingList&&this.root.push(new P("w:underlineTabInNumList",e.underlineTabInNumberingList)),e.displayHangulFixedWidth&&this.root.push(new P("w:displayHangulFixedWidth",e.displayHangulFixedWidth)),e.splitPgBreakAndParaMark&&this.root.push(new P("w:splitPgBreakAndParaMark",e.splitPgBreakAndParaMark)),e.doNotVerticallyAlignCellWithSp&&this.root.push(new P("w:doNotVertAlignCellWithSp",e.doNotVerticallyAlignCellWithSp)),e.doNotBreakConstrainedForcedTable&&this.root.push(new P("w:doNotBreakConstrainedForcedTable",e.doNotBreakConstrainedForcedTable)),e.ignoreVerticalAlignmentInTextboxes&&this.root.push(new P("w:doNotVertAlignInTxbx",e.ignoreVerticalAlignmentInTextboxes)),e.useAnsiKerningPairs&&this.root.push(new P("w:useAnsiKerningPairs",e.useAnsiKerningPairs)),e.cachedColumnBalance&&this.root.push(new P("w:cachedColBalance",e.cachedColumnBalance)),e.version&&this.root.push(DS(e.version))}},hh=1e5,mh=15,$S=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],FS=[[44796,19929,39858,10053,20106,40212,10761],[31585,63170,64933,60267,50935,40399,11199],[17763,35526,1453,2906,5812,11624,23248],[885,1770,3540,7080,14160,28320,56640],[55369,41139,20807,41614,21821,43642,17621],[28485,56970,44341,19019,38038,14605,29210],[60195,50791,40175,10751,21502,43004,24537],[18387,36774,3949,7898,15796,31592,63184],[47201,24803,49606,37805,14203,28406,56812],[17824,35648,1697,3394,6788,13576,27152],[43601,17539,35078,557,1114,2228,4456],[30388,60776,51953,34243,7079,14158,28316],[14128,28256,56512,43425,17251,34502,7597],[13105,26210,52420,35241,883,1766,3532],[4129,8258,16516,33032,4657,9314,18628]],fh=e=>e>>14&1|e<<1&32767,qS=e=>{let t=e.slice(0,mh).split("").map(i=>{let s=i.charCodeAt(0);return(s&255)!==0?s&255:s>>8&255}),n=t.reduce((i,s,a)=>FS[mh-t.length+a].reduce((o,c,l)=>s>>l&1?o^c:o,i),$S[t.length-1]),r=(fh(t.reduceRight((i,s)=>fh(i)^s,0))^t.length^52811)&65535;return[r&255,r>>8,n&255,n>>8].map(i=>i.toString(16).toUpperCase().padStart(2,"0")).join("")},HS=(e,t,n)=>{let r=[...qS(e)].flatMap(o=>[o.charCodeAt(0),0]),i=eh(Uint8Array.from([...t,...r])),s=new Uint8Array(i.length+4),a=new DataView(s.buffer);for(let o=0;o<n;o++)s.set(i),a.setUint32(i.length,o,!0),i=eh(s);return Array.from(i)},US=e=>{var t;let n=new Uint8Array(e);return typeof((t=globalThis.crypto)===null||t===void 0?void 0:t.getRandomValues)=="function"?(globalThis.crypto.getRandomValues(n),[...n]):[...n].map(()=>Math.floor(Math.random()*256))},gh=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{edit:"w:edit",enforcement:"w:enforcement",cryptProviderType:"w:cryptProviderType",cryptAlgorithmClass:"w:cryptAlgorithmClass",cryptAlgorithmType:"w:cryptAlgorithmType",cryptAlgorithmSid:"w:cryptAlgorithmSid",cryptSpinCount:"w:cryptSpinCount",hash:"w:hash",salt:"w:salt"})}},bh=e=>btoa(String.fromCharCode(...e)),jS=class extends I{constructor({type:e,password:t}){if(super("w:documentProtection"),t===void 0||t===""){this.root.push(new gh({edit:e,enforcement:!0}));return}let n=US(16);this.root.push(new gh({edit:e,enforcement:!0,cryptProviderType:"rsaAES",cryptAlgorithmClass:"hash",cryptAlgorithmType:"typeAny",cryptAlgorithmSid:12,cryptSpinCount:hh,hash:bh(HS(t,n,hh)),salt:bh(n)}))}},WS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},KS=class extends I{constructor(e){var t,n,r,i,s,a,o,c,l;super("w:settings"),this.root.push(new WS({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"})),this.root.push(new P("w:displayBackgroundShape",!0)),e.embedFonts!==void 0&&this.root.push(new P("w:embedTrueTypeFonts",e.embedFonts)),e.trackRevisions!==void 0&&this.root.push(new P("w:trackRevisions",e.trackRevisions)),e.protection!==void 0&&this.root.push(new jS(e.protection)),this.root.push(new Ir("w:defaultTabStop",(t=e.defaultTabStop)!==null&&t!==void 0?t:720)),((n=e.hyphenation)===null||n===void 0?void 0:n.autoHyphenation)!==void 0&&this.root.push(new P("w:autoHyphenation",e.hyphenation.autoHyphenation)),((r=e.hyphenation)===null||r===void 0?void 0:r.consecutiveHyphenLimit)!==void 0&&this.root.push(new Ir("w:consecutiveHyphenLimit",e.hyphenation.consecutiveHyphenLimit)),((i=e.hyphenation)===null||i===void 0?void 0:i.hyphenationZone)!==void 0&&this.root.push(new Ir("w:hyphenationZone",e.hyphenation.hyphenationZone)),((s=e.hyphenation)===null||s===void 0?void 0:s.doNotHyphenateCaps)!==void 0&&this.root.push(new P("w:doNotHyphenateCaps",e.hyphenation.doNotHyphenateCaps)),e.evenAndOddHeaders!==void 0&&this.root.push(new P("w:evenAndOddHeaders",e.evenAndOddHeaders)),e.updateFields!==void 0&&this.root.push(new P("w:updateFields",e.updateFields)),this.root.push(new BS(k(k({},(a=e.compatibility)!==null&&a!==void 0?a:{}),{},{version:(o=(c=(l=e.compatibility)===null||l===void 0?void 0:l.version)!==null&&c!==void 0?c:e.compatibilityModeVersion)!==null&&o!==void 0?o:15})))}},bf=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{val:"w:val"})}},GS=class extends I{constructor(e){super("w:name"),this.root.push(new bf({val:e}))}},zS=class extends I{constructor(e){super("w:uiPriority"),this.root.push(new bf({val:le(e)}))}},VS=class extends H{constructor(...e){super(...e),E(this,"xmlKeys",{type:"w:type",styleId:"w:styleId",default:"w:default",customStyle:"w:customStyle"})}},bc=class extends I{constructor(e,t){super("w:style"),this.root.push(new VS(e)),t.name&&this.root.push(new GS(t.name)),t.basedOn&&t.basedOn!==e.styleId&&this.root.push(new ot("w:basedOn",t.basedOn)),t.next&&this.root.push(new ot("w:next",t.next)),t.link&&this.root.push(new ot("w:link",t.link)),t.uiPriority!==void 0&&this.root.push(new zS(t.uiPriority)),t.semiHidden!==void 0&&this.root.push(new P("w:semiHidden",t.semiHidden)),t.unhideWhenUsed!==void 0&&this.root.push(new P("w:unhideWhenUsed",t.unhideWhenUsed)),t.quickFormat!==void 0&&this.root.push(new P("w:qFormat",t.quickFormat))}},Ct=class extends bc{constructor(e){super({type:"paragraph",styleId:e.id},e),E(this,"paragraphProperties",void 0),E(this,"runProperties",void 0),this.paragraphProperties=new Dn(e.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new on(e.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties)}},ln=class extends bc{constructor(e){super({type:"character",styleId:e.id},k({uiPriority:99,unhideWhenUsed:!0},e)),E(this,"runProperties",void 0),this.runProperties=new on(e.run),this.root.push(this.runProperties)}},Wt=class extends Ct{constructor(e){super(k({basedOn:"Normal",next:"Normal",quickFormat:!0},e))}},XS=class extends Wt{constructor(e){super(k({id:"Title",name:"Title"},e))}},YS=class extends Wt{constructor(e){super(k({id:"Heading1",name:"Heading 1"},e))}},JS=class extends Wt{constructor(e){super(k({id:"Heading2",name:"Heading 2"},e))}},QS=class extends Wt{constructor(e){super(k({id:"Heading3",name:"Heading 3"},e))}},ZS=class extends Wt{constructor(e){super(k({id:"Heading4",name:"Heading 4"},e))}},eC=class extends Wt{constructor(e){super(k({id:"Heading5",name:"Heading 5"},e))}},tC=class extends Wt{constructor(e){super(k({id:"Heading6",name:"Heading 6"},e))}},nC=class extends Wt{constructor(e){super(k({id:"Strong",name:"Strong"},e))}},rC=class extends Ct{constructor(e){super(k({id:"ListParagraph",name:"List Paragraph",basedOn:"Normal",quickFormat:!0},e))}},iC=class extends Ct{constructor(e){super(k({id:"Caption",name:"caption",basedOn:"Normal",next:"Normal",uiPriority:35,semiHidden:!0,unhideWhenUsed:!0,quickFormat:!0,paragraph:{spacing:{after:200}},run:{italics:!0,color:{theme:"dark2"},size:18}},e))}},sC=class extends Ct{constructor(e){super(k({id:"Bibliography",name:"Bibliography",basedOn:"Normal",next:"Normal",uiPriority:37,unhideWhenUsed:!0},e))}},vf=new WeakSet,vh=e=>vf.has(e),yt=class extends Ct{constructor(e,t){super({id:`TOC${e}`,name:`toc ${e}`,basedOn:"Normal",next:"Normal",uiPriority:39,semiHidden:!0,unhideWhenUsed:!0,paragraph:k({spacing:{after:100}},e>1?{indent:{left:(e-1)*t}}:{})})}prepForXml(e){let t=super.prepForXml(e);return vf.add(t),t}},wf=class extends Ct{constructor(e){super(k({id:"FootnoteText",name:"footnote text",link:"FootnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:Mn.AUTO}},run:{size:20}},e))}},xf=class extends ln{constructor(e){super(k({id:"FootnoteReference",name:"footnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}},yf=class extends ln{constructor(e){super(k({id:"FootnoteTextChar",name:"Footnote Text Char",basedOn:"DefaultParagraphFont",link:"FootnoteText",semiHidden:!0,run:{size:20}},e))}},kf=class extends Ct{constructor(e){super(k({id:"EndnoteText",name:"endnote text",link:"EndnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:Mn.AUTO}},run:{size:20}},e))}},Tf=class extends ln{constructor(e){super(k({id:"EndnoteReference",name:"endnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}},Sf=class extends ln{constructor(e){super(k({id:"EndnoteTextChar",name:"Endnote Text Char",basedOn:"DefaultParagraphFont",link:"EndnoteText",semiHidden:!0,run:{size:20}},e))}},aC=class extends ln{constructor(e){super(k({id:"Hyperlink",name:"Hyperlink",basedOn:"DefaultParagraphFont",run:{color:"0563C1",underline:{type:wm.SINGLE}}},e))}},oC=class extends ln{constructor(e){super(k({id:"LineNumber",name:"line number",basedOn:"DefaultParagraphFont",semiHidden:!0},e))}},lC=class extends bc{constructor(){super({type:"table",styleId:"TableNormal",default:!0},{name:"Normal Table",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0}),this.root.push(new gc({indent:{size:0,type:Fe.DXA},cellMargin:{top:0,left:108,bottom:0,right:108}}))}},Or=e=>typeof e=="object"?Object.keys(e)[0]:void 0,vc=e=>{var t;return(t=[e["w:style"]].flat().find(n=>n._attr))===null||t===void 0?void 0:t._attr},wh=e=>{var t;return(t=vc(e))===null||t===void 0?void 0:t["w:styleId"]},xh=e=>{var t;let n=(t=[e["w:style"]].flat().find(r=>Or(r)==="w:name"))===null||t===void 0||(t=t["w:name"])===null||t===void 0||(t=t._attr)===null||t===void 0?void 0:t["w:val"];return n===void 0?void 0:String(n).toLowerCase()},Dl=e=>{var t,n;return Or(e)==="w:style"&&((t=(n=vc(e))===null||n===void 0?void 0:n["w:type"])!==null&&t!==void 0?t:"paragraph")==="paragraph"},cC=e=>{let t=Dl(e)?vc(e):void 0;return t?.["w:default"]!==void 0&&!["0","false","off"].includes(String(t["w:default"]))},dC=e=>({"w:style":[e["w:style"]].flat().map(t=>t._attr?{_attr:k(k({},t._attr),{},{"w:default":"1"})}:t)}),ul=class extends I{constructor(e){if(super("w:styles"),e.initialStyles&&this.root.push(e.initialStyles),e.importedStyles)for(let t of e.importedStyles)this.root.push(t);if(e.paragraphStyles)for(let t of e.paragraphStyles)this.root.push(new Ct(t));if(e.characterStyles)for(let t of e.characterStyles)this.root.push(new ln(t))}prepForXml(e){let t=super.prepForXml(e),n=t["w:styles"];if(!Array.isArray(n))return t;let r=l=>n.filter(u=>Or(u)===l),i=n.map(l=>Or(l)==="w:style"?wh(l):void 0),s=n.filter((l,u)=>!["_attr","w:docDefaults","w:latentStyles"].includes(Or(l))&&(i[u]===void 0||i.lastIndexOf(i[u])===u)),a=new Set(s.filter(l=>Dl(l)&&!vh(l)).map(xh)),o=s.filter(l=>!vh(l)||!a.has(xh(l))),c=o.some(cC)?o:o.map(l=>Dl(l)&&wh(l)==="Normal"?dC(l):l);return{"w:styles":[...r("_attr"),...r("w:docDefaults").slice(-1),...r("w:latentStyles").slice(-1),...c]}}},pC=class extends I{constructor(e){super("w:pPrDefault"),this.root.push(new Dn(e,{implicitListParagraphStyle:!1,inListOrder:!1}))}},uC=class extends I{constructor(e){super("w:rPrDefault"),this.root.push(new on(e))}},hC=class extends I{constructor(e){super("w:docDefaults"),E(this,"runPropertiesDefaults",void 0),E(this,"paragraphPropertiesDefaults",void 0),this.runPropertiesDefaults=new uC(e.run),this.paragraphPropertiesDefaults=new pC(e.paragraph),this.root.push(this.runPropertiesDefaults),this.root.push(this.paragraphPropertiesDefaults)}},mC=class{newInstance(e){let t=Wr(e),n;for(let i of t.elements||[])i.name==="w:styles"&&(n=i);if(n===void 0)throw new Error("can not find styles element");let r=n.elements||[];return{initialStyles:new my(n.attributes),importedStyles:r.map(i=>ec(i))}}},fC=e=>{var t;let n=(t=e.document)===null||t===void 0||(t=t.run)===null||t===void 0?void 0:t.size;return n===void 0?200:Math.round(typeof n=="number"?n*10:qt(n))},gC=e=>({tableOfContents1:new yt(1,e),tableOfContents2:new yt(2,e),tableOfContents3:new yt(3,e),tableOfContents4:new yt(4,e),tableOfContents5:new yt(5,e),tableOfContents6:new yt(6,e),tableOfContents7:new yt(7,e),tableOfContents8:new yt(8,e),tableOfContents9:new yt(9,e)}),wc=(e={})=>{var t;return k(k({normal:new Ct({id:"Normal",name:"Normal",quickFormat:!0}),normalTable:new lC,document:new hC((t=e.document)!==null&&t!==void 0?t:{}),title:new XS(k({run:{size:56}},e.title)),heading1:new YS(k({run:{color:"2E74B5",size:32}},e.heading1)),heading2:new JS(k({run:{color:"2E74B5",size:26}},e.heading2)),heading3:new QS(k({run:{color:"1F4D78",size:24}},e.heading3)),heading4:new ZS(k({run:{color:"2E74B5",italics:!0}},e.heading4)),heading5:new eC(k({run:{color:"2E74B5"}},e.heading5)),heading6:new tC(k({run:{color:"1F4D78"}},e.heading6)),strong:new nC(k({run:{bold:!0}},e.strong)),listParagraph:new rC(e.listParagraph||{}),caption:new iC(e.caption||{}),bibliography:new sC(e.bibliography||{})},gC(fC(e))),{},{hyperlink:new aC(e.hyperlink||{}),footnoteReference:new xf(e.footnoteReference||{}),footnoteText:new wf(e.footnoteText||{}),footnoteTextChar:new yf(e.footnoteTextChar||{}),endnoteReference:new Tf(e.endnoteReference||{}),endnoteText:new kf(e.endnoteText||{}),endnoteTextChar:new Sf(e.endnoteTextChar||{}),lineNumber:new oC(e.lineNumber||{})})},yh=class{newInstance(e={}){return{initialStyles:new Qs(["mc","r","w","w14","w15"],"w14 w15"),importedStyles:Object.values(wc(e))}}},Cf={headings:{latin:"Calibri Light",panose:"020F0302020204030204"},body:{latin:"Calibri",panose:"020F0502020204030204"}},bC=[["Jpan","\u6E38\u30B4\u30B7\u30C3\u30AF Light","\u6E38\u660E\u671D"],["Hang","\uB9D1\uC740 \uACE0\uB515"],["Hans","\u7B49\u7EBF Light","\u7B49\u7EBF"],["Hant","\u65B0\u7D30\u660E\u9AD4"],["Arab","Times New Roman","Arial"],["Hebr","Times New Roman","Arial"],["Thai","Angsana New","Cordia New"],["Ethi","Nyala"],["Beng","Vrinda"],["Gujr","Shruti"],["Khmr","MoolBoran","DaunPenh"],["Knda","Tunga"],["Guru","Raavi"],["Cans","Euphemia"],["Cher","Plantagenet Cherokee"],["Yiii","Microsoft Yi Baiti"],["Tibt","Microsoft Himalaya"],["Thaa","MV Boli"],["Deva","Mangal"],["Telu","Gautami"],["Taml","Latha"],["Syrc","Estrangelo Edessa"],["Orya","Kalinga"],["Mlym","Kartika"],["Laoo","DokChampa"],["Sinh","Iskoola Pota"],["Mong","Mongolian Baiti"],["Viet","Times New Roman","Arial"],["Uigh","Microsoft Uighur"],["Geor","Sylfaen"],["Armn","Arial"],["Bugi","Leelawadee UI"],["Bopo","Microsoft JhengHei"],["Java","Javanese Text"],["Lisu","Segoe UI"],["Mymr","Myanmar Text"],["Nkoo","Ebrima"],["Olck","Nirmala UI"],["Osma","Ebrima"],["Phag","Phagspa"],["Syrn","Estrangelo Edessa"],["Syrj","Estrangelo Edessa"],["Syre","Estrangelo Edessa"],["Sora","Nirmala UI"],["Tale","Microsoft Tai Le"],["Talu","Microsoft New Tai Lue"],["Tfng","Ebrima"]],hl=(e,t,n)=>new L({name:e,attributes:{typeface:{key:"typeface",value:t},panose:{key:"panose",value:n}}}),vC=(e,t)=>{let n=t[e],r=typeof n=="string"?n:n?.latin;return r??Cf[e].latin},wC=(e,t={})=>{let n=bC.map(([i,s,a=s])=>{var o;return[i,(o=t[i])!==null&&o!==void 0?o:e==="headings"?s:a]}),r=new Set(n.map(([i])=>i));return[...n,...Object.entries(t).filter(([i])=>!r.has(i))]},kh=(e,t)=>{let n=t[e],{eastAsia:r="",complexScript:i="",scripts:s}=typeof n=="object"?n:{},a=vC(e,t),o=Cf[e];return new L({name:e==="headings"?"a:majorFont":"a:minorFont",children:[hl("a:latin",a,a===o.latin?o.panose:void 0),hl("a:ea",r),hl("a:cs",i),...wC(e,s).map(([c,l])=>new L({name:"a:font",attributes:{script:{key:"script",value:c},typeface:{key:"typeface",value:l}}}))]})},xC=(e,t={})=>new L({name:"a:fontScheme",attributes:{name:{key:"name",value:e}},children:[kh("headings",t),kh("body",t)]}),Ef=(e=[])=>new L({name:"a:schemeClr",attributes:{value:{key:"val",value:"phClr"}},children:e.map(([t,n])=>new L({name:`a:${t}`,attributes:{value:{key:"val",value:n}}}))}),Os=e=>new L({name:"a:solidFill",children:[Ef(e)]}),ml=e=>new L({name:"a:gradFill",attributes:{rotateWithShape:{key:"rotWithShape",value:!0}},children:[new L({name:"a:gsLst",children:e.map((t,n)=>new L({name:"a:gs",attributes:{position:{key:"pos",value:n*5e4}},children:[Ef(t)]}))}),new L({name:"a:lin",attributes:{angle:{key:"ang",value:54e5},scaled:{key:"scaled",value:!1}}})]}),fl=e=>new L({name:"a:ln",attributes:{width:{key:"w",value:e},cap:{key:"cap",value:"flat"},compound:{key:"cmpd",value:"sng"},alignment:{key:"algn",value:"ctr"}},children:[Os(),new L({name:"a:prstDash",attributes:{value:{key:"val",value:"solid"}}}),new L({name:"a:miter",attributes:{limit:{key:"lim",value:8e5}}})]}),gl=e=>new L({name:"a:effectStyle",children:[new L({name:"a:effectLst",children:e})]}),yC=()=>new L({name:"a:outerShdw",attributes:{blurRadius:{key:"blurRad",value:57150},distance:{key:"dist",value:19050},direction:{key:"dir",value:54e5},alignment:{key:"algn",value:"ctr"},rotateWithShape:{key:"rotWithShape",value:!1}},children:[new L({name:"a:srgbClr",attributes:{value:{key:"val",value:"000000"}},children:[new L({name:"a:alpha",attributes:{value:{key:"val",value:63e3}}})]})]}),kC=()=>new L({name:"a:fmtScheme",attributes:{name:{key:"name",value:"Office"}},children:[new L({name:"a:fillStyleLst",children:[Os(),ml([[["lumMod",11e4],["satMod",105e3],["tint",67e3]],[["lumMod",105e3],["satMod",103e3],["tint",73e3]],[["lumMod",105e3],["satMod",109e3],["tint",81e3]]]),ml([[["satMod",103e3],["lumMod",102e3],["tint",94e3]],[["satMod",11e4],["lumMod",1e5],["shade",1e5]],[["lumMod",99e3],["satMod",12e4],["shade",78e3]]])]}),new L({name:"a:lnStyleLst",children:[fl(6350),fl(12700),fl(19050)]}),new L({name:"a:effectStyleLst",children:[gl([]),gl([]),gl([yC()])]}),new L({name:"a:bgFillStyleLst",children:[Os(),Os([["tint",95e3],["satMod",17e4]]),ml([[["tint",93e3],["satMod",15e4],["shade",98e3],["lumMod",102e3]],[["tint",98e3],["satMod",13e4],["shade",9e4],["lumMod",103e3]],[["shade",63e3],["satMod",12e4]]])]})]}),TC=class extends I{constructor({name:e="Office Theme",colors:t,fonts:n}={}){super("a:theme"),E(this,"colors",void 0),this.colors=rc(t),this.root.push(new Jh({namespace:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"},name:{key:"name",value:e}})),this.root.push(new L({name:"a:themeElements",children:[Ty(t?e:"Office",t),xC(n?e:"Office",n),kC()]})),this.root.push(new L({name:"a:objectDefaults"})),this.root.push(new L({name:"a:extraClrSchemeLst"}))}get Colors(){return this.colors}},Qe=e=>{let t=e.lastIndexOf("/");return`${e.slice(0,t+1)}_rels/${e.slice(t+1)}.rels`},_f=e=>e.replace(/(^|\/)_rels\/([^/]*)\.rels$/,"$1$2"),Af=e=>e.slice(0,e.lastIndexOf("/")+1),cn=(e,t)=>{let n=t.replace(/\\/g,"/");return(n.startsWith("/")?n:`${Af(e)}${n}`).split("/").reduce((r,i)=>i===""||i==="."?r:i===".."?r.slice(0,-1):[...r,i],[]).join("/")},xc=(e,t)=>{let n=Af(e).split("/").filter(Boolean),r=t.split("/"),i=n.findIndex((a,o)=>o>=r.length-1||r[o]!==a),s=i===-1?n.length:i;return[...n.slice(s).map(()=>".."),...r.slice(s)].join("/")},SC=(e,t)=>e.toLowerCase()===t.toLowerCase(),oe=Uint8Array,Le=Uint16Array,yc=Int32Array,Zs=new oe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ea=new oe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bl=new oe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nf=function(e,t){for(var n=new Le(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new yc(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return{b:n,r:i}},If=Nf(Zs,2),Pf=If.b,$l=If.r;Pf[28]=258,$l[258]=28;Of=Nf(ea,0),CC=Of.b,Th=Of.r,Fl=new Le(32768);for(Y=0;Y<32768;++Y)kt=(Y&43690)>>1|(Y&21845)<<1,kt=(kt&52428)>>2|(kt&13107)<<2,kt=(kt&61680)>>4|(kt&3855)<<4,Fl[Y]=((kt&65280)>>8|(kt&255)<<8)>>1;lt=(function(e,t,n){for(var r=e.length,i=0,s=new Le(t);i<r;++i)e[i]&&++s[e[i]-1];var a=new Le(t);for(i=1;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;var o;if(n){o=new Le(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)o[Fl[d]>>c]=l}else for(o=new Le(r),i=0;i<r;++i)e[i]&&(o[i]=Fl[a[e[i]-1]++]>>15-e[i]);return o}),jt=new oe(288);for(Y=0;Y<144;++Y)jt[Y]=8;for(Y=144;Y<256;++Y)jt[Y]=9;for(Y=256;Y<280;++Y)jt[Y]=7;for(Y=280;Y<288;++Y)jt[Y]=8;qr=new oe(32);for(Y=0;Y<32;++Y)qr[Y]=5;EC=lt(jt,9,0),_C=lt(jt,9,1),AC=lt(qr,5,0),NC=lt(qr,5,1),bl=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Ye=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},vl=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},kc=function(e){return(e+7)/8|0},Vr=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new oe(e.subarray(t,n))},IC=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ee=function(e,t,n){var r=new Error(t||IC[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Ee),!n)throw r;return r},PC=function(e,t,n,r){var i=e.length,s=r?r.length:0;if(!i||t.f&&!t.l)return n||new oe(0);var a=!n,o=a||t.i!=2,c=t.i;a&&(n=new oe(i*3));var l=function(ae){var te=n.length;if(ae>te){var Re=new oe(Math.max(te*2,ae));Re.set(n),n=Re}},u=t.f||0,d=t.p||0,p=t.b||0,h=t.l,f=t.d,m=t.m,g=t.n,x=i*8;do{if(!h){u=Ye(e,d,1);var T=Ye(e,d+1,3);if(d+=3,T)if(T==1)h=_C,f=NC,m=9,g=5;else if(T==2){var w=Ye(e,d,31)+257,y=Ye(e,d+10,15)+4,v=w+Ye(e,d+5,31)+1;d+=14;for(var _=new oe(v),N=new oe(19),M=0;M<y;++M)N[Bl[M]]=Ye(e,d+M*3,7);d+=y*3;for(var O=bl(N),F=(1<<O)-1,Q=lt(N,O,1),M=0;M<v;){var Z=Q[Ye(e,d,F)];d+=Z&15;var b=Z>>4;if(b<16)_[M++]=b;else{var V=0,G=0;for(b==16?(G=3+Ye(e,d,3),d+=2,V=_[M-1]):b==17?(G=3+Ye(e,d,7),d+=3):b==18&&(G=11+Ye(e,d,127),d+=7);G--;)_[M++]=V}}var de=_.subarray(0,w),ce=_.subarray(w);m=bl(de),g=bl(ce),h=lt(de,m,1),f=lt(ce,g,1)}else Ee(1);else{var b=kc(d)+4,C=e[b-4]|e[b-3]<<8,A=b+C;if(A>i){c&&Ee(0);break}o&&l(p+C),n.set(e.subarray(b,A),p),t.b=p+=C,t.p=d=A*8,t.f=u;continue}if(d>x){c&&Ee(0);break}}o&&l(p+131072);for(var At=(1<<m)-1,_e=(1<<g)-1,Ue=d;;Ue=d){var V=h[vl(e,d)&At],we=V>>4;if(d+=V&15,d>x){c&&Ee(0);break}if(V||Ee(2),we<256)n[p++]=we;else if(we==256){Ue=d,h=null;break}else{var xe=we-254;if(we>264){var M=we-257,re=Zs[M];xe=Ye(e,d,(1<<re)-1)+Pf[M],d+=re}var D=f[vl(e,d)&_e],$=D>>4;D||Ee(3),d+=D&15;var ce=CC[$];if($>3){var re=ea[$];ce+=vl(e,d)&(1<<re)-1,d+=re}if(d>x){c&&Ee(0);break}o&&l(p+131072);var q=p+xe;if(p<ce){var ie=s-ce,se=Math.min(ce,q);for(ie+p<0&&Ee(3);p<se;++p)n[p]=r[ie+p]}for(;p<q;++p)n[p]=n[p-ce]}}t.l=h,t.p=Ue,t.b=p,t.f=u,h&&(u=1,t.m=m,t.d=f,t.n=g)}while(!u);return p!=n.length&&a?Vr(n,0,p):n.subarray(0,p)},Tt=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Sr=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},wl=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return{t:Lf,l:0};if(i==1){var a=new oe(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(A,w){return A.f-w.f}),n.push({s:-1,f:25001});var o=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:o.f+c.f,l:o,r:c};u!=i-1;)o=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:o.f+c.f,l:o,r:c};for(var p=s[0].s,r=1;r<i;++r)s[r].s>p&&(p=s[r].s);var h=new Le(p+1),f=ql(n[u-1],h,0);if(f>t){var r=0,m=0,g=f-t,x=1<<g;for(s.sort(function(w,y){return h[y.s]-h[w.s]||w.f-y.f});r<i;++r){var T=s[r].s;if(h[T]>t)m+=x-(1<<f-h[T]),h[T]=t;else break}for(m>>=g;m>0;){var b=s[r].s;h[b]<t?m-=1<<t-h[b]++-1:++r}for(;r>=0&&m;--r){var C=s[r].s;h[C]==t&&(--h[C],++m)}f=t}return{t:new oe(h),l:f}},ql=function(e,t,n){return e.s==-1?Math.max(ql(e.l,t,n+1),ql(e.r,t,n+1)):t[e.s]=n},Sh=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Le(++t),r=0,i=e[0],s=1,a=function(c){n[r++]=c},o=1;o<=t;++o)if(e[o]==i&&o!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(i),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(i);s=1,i=e[o]}return{c:n.subarray(0,r),n:t}},Cr=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Rf=function(e,t,n){var r=n.length,i=kc(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s<r;++s)e[i+s+4]=n[s];return(i+4+r)*8},Ch=function(e,t,n,r,i,s,a,o,c,l,u){Tt(t,u++,n),++i[256];for(var d=wl(i,15),p=d.t,h=d.l,f=wl(s,15),m=f.t,g=f.l,x=Sh(p),T=x.c,b=x.n,C=Sh(m),A=C.c,w=C.n,y=new Le(19),v=0;v<T.length;++v)++y[T[v]&31];for(var v=0;v<A.length;++v)++y[A[v]&31];for(var _=wl(y,7),N=_.t,M=_.l,O=19;O>4&&!N[Bl[O-1]];--O);var F=l+5<<3,Q=Cr(i,jt)+Cr(s,qr)+a,Z=Cr(i,p)+Cr(s,m)+a+14+3*O+Cr(y,N)+2*y[16]+3*y[17]+7*y[18];if(c>=0&&F<=Q&&F<=Z)return Rf(t,u,e.subarray(c,c+l));var V,G,de,ce;if(Tt(t,u,1+(Z<Q)),u+=2,Z<Q){V=lt(p,h,0),G=p,de=lt(m,g,0),ce=m;var At=lt(N,M,0);Tt(t,u,b-257),Tt(t,u+5,w-1),Tt(t,u+10,O-4),u+=14;for(var v=0;v<O;++v)Tt(t,u+3*v,N[Bl[v]]);u+=3*O;for(var _e=[T,A],Ue=0;Ue<2;++Ue)for(var we=_e[Ue],v=0;v<we.length;++v){var xe=we[v]&31;Tt(t,u,At[xe]),u+=N[xe],xe>15&&(Tt(t,u,we[v]>>5&127),u+=we[v]>>12)}}else V=EC,G=jt,de=AC,ce=qr;for(var v=0;v<o;++v){var re=r[v];if(re>255){var xe=re>>18&31;Sr(t,u,V[xe+257]),u+=G[xe+257],xe>7&&(Tt(t,u,re>>23&31),u+=Zs[xe]);var D=re&31;Sr(t,u,de[D]),u+=ce[D],D>3&&(Sr(t,u,re>>5&8191),u+=ea[D])}else Sr(t,u,V[re]),u+=G[re]}return Sr(t,u,V[256]),u+G[256]},OC=new yc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Lf=new oe(0),RC=function(e,t,n,r,i,s){var a=s.z||e.length,o=new oe(r+a+5*(1+Math.ceil(a/7e3))+i),c=o.subarray(r,o.length-i),l=s.l,u=(s.r||0)&7;if(t){u&&(c[0]=s.r>>3);for(var d=OC[t-1],p=d>>13,h=d&8191,f=(1<<n)-1,m=s.p||new Le(32768),g=s.h||new Le(f+1),x=Math.ceil(n/3),T=2*x,b=function(Re){return(e[Re]^e[Re+1]<<x^e[Re+2]<<T)&f},C=new yc(25e3),A=new Le(288),w=new Le(32),y=0,v=0,_=s.i||0,N=0,M=s.w||0,O=0;_+2<a;++_){var F=b(_),Q=_&32767,Z=g[F];if(m[Q]=Z,g[F]=Q,M<=_){var V=a-_;if((y>7e3||N>24576)&&(V>423||!l)){u=Ch(e,c,0,C,A,w,v,N,O,_-O,u),N=y=v=0,O=_;for(var G=0;G<286;++G)A[G]=0;for(var G=0;G<30;++G)w[G]=0}var de=2,ce=0,At=h,_e=Q-Z&32767;if(V>2&&F==b(_-_e))for(var Ue=Math.min(p,V)-1,we=Math.min(32767,_),xe=Math.min(258,V);_e<=we&&--At&&Q!=Z;){if(e[_+de]==e[_+de-_e]){for(var re=0;re<xe&&e[_+re]==e[_+re-_e];++re);if(re>de){if(de=re,ce=_e,re>Ue)break;for(var D=Math.min(_e,re-2),$=0,G=0;G<D;++G){var q=_-_e+G&32767,ie=q-m[q]&32767;ie>$&&($=ie,Z=q)}}}Q=Z,Z=m[Q],_e+=Q-Z&32767}if(ce){C[N++]=268435456|$l[de]<<18|Th[ce];var se=$l[de]&31,ae=Th[ce]&31;v+=Zs[se]+ea[ae],++A[257+se],++w[ae],M=_+de,++y}else C[N++]=e[_],++A[e[_]]}}for(_=Math.max(_,M);_<a;++_)C[N++]=e[_],++A[e[_]];u=Ch(e,c,l,C,A,w,v,N,O,_-O,u),l||(s.r=u&7|c[u/8|0]<<3,u-=7,s.h=g,s.p=m,s.i=_,s.w=M)}else{for(var _=s.w||0;_<a+l;_+=65535){var te=_+65535;te>=a&&(c[u/8|0]=l,te=a),u=Rf(c,u+1,e.subarray(_,te))}s.i=a}return Vr(o,0,r+kc(u)+i)},LC=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),MC=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=LC[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},DC=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),a=new oe(s.length+e.length);a.set(s),a.set(e,s.length),e=a,i.w=s.length}return RC(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)},Mf=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},st=function(e,t){return e[t]|e[t+1]<<8},Be=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},xl=function(e,t){return Be(e,t)+Be(e,t+4)*4294967296},ke=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};Df=function(e,t,n,r){for(var i in e){var s=e[i],a=t+i,o=r;Array.isArray(s)&&(o=Mf(r,s[1]),s=s[0]),ArrayBuffer.isView(s)?n[a]=[s,o]:(n[a+="/"]=[new oe(0),o],Df(s,a,n,r))}},Eh=typeof TextEncoder<"u"&&new TextEncoder,Hl=typeof TextDecoder<"u"&&new TextDecoder;try{Hl.decode(Lf,{stream:!0})}catch{}FC=function(e){for(var t="",n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:Vr(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};HC=function(e,t){return t+30+st(e,t+26)+st(e,t+28)},UC=function(e,t,n){var r=st(e,t+28),i=st(e,t+30),s=qC(e.subarray(t+46,t+46+r),!(st(e,t+8)&2048)),a=t+46+r,o=jC(e,a,i,n,Be(e,t+20),Be(e,t+24),Be(e,t+42)),c=o[0],l=o[1],u=o[2];return[st(e,t+10),c,l,s,a+i+st(e,t+32),u]},jC=function(e,t,n,r,i,s,a){var o=i==4294967295,c=s==4294967295,l=a==4294967295,u=t+n,d=o+c+l;if(r&&d){for(;t+4<u;t+=4+st(e,t+2))if(st(e,t)==1)return[o?xl(e,t+4+8*c):i,c?xl(e,t+4):s,l?xl(e,t+4+8*(c+o)):a,1];r<2&&Ee(13)}return[i,s,a,0]},Ul=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&Ee(9),t+=r+4}return t},Ah=function(e,t,n,r,i,s,a,o){var c=r.length,l=n.extra,u=o&&o.length,d=Ul(l);ke(e,t,a!=null?33639248:67324752),t+=4,a!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(s<0&&8),e[t++]=i&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var p=new Date(n.mtime==null?Date.now():n.mtime),h=p.getFullYear()-1980;if((h<0||h>119)&&Ee(10),ke(e,t,h<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),t+=4,s!=-1&&(ke(e,t,n.crc),ke(e,t+4,s<0?-s-2:s),ke(e,t+8,n.size)),ke(e,t+12,c),ke(e,t+14,d),t+=16,a!=null&&(ke(e,t,u),ke(e,t+6,n.attrs),ke(e,t+10,a),t+=14),e.set(r,t),t+=c,d)for(var f in l){var m=l[f],g=m.length;ke(e,t,+f),ke(e,t+2,g),e.set(m,t+4),t+=4+g}return u&&(e.set(o,t),t+=u),t},WC=function(e,t,n,r,i){ke(e,t,101010256),ke(e,t+8,n),ke(e,t+10,n),ke(e,t+12,r),ke(e,t+16,i)};zC=e=>typeof e=="string"?ck(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e),qs=e=>KC(Object.fromEntries([...e].map(([t,n])=>[t,zC(n)]))),VC=1032,Nh=e=>new Error(`Corrupted zip: ${e} isn't the size the zip file gives it`),Bf=(e,t=()=>!0)=>{let n=new Map,r=0,i=GC(e,{filter:({name:a,size:o,originalSize:c})=>{if(a.endsWith("/")||!t(a))return!1;if(r+=o,r>e.length||c>o*VC)throw Nh(a);return n.set(a,c),!0}}),s=Object.entries(i).find(([a,o])=>o.length!==n.get(a));if(s!==void 0)throw Nh(s[0]);return new Map(Object.entries(i))},yl=e=>{let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t},Rs=e=>new Error(`${e} is not supported by this platform`),Ih={uint8array:e=>e,arraybuffer:e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),array:e=>Array.from(e),string:yl,binarystring:yl,base64:e=>btoa(yl(e)),blob:(e,t)=>{if(typeof Blob>"u")throw Rs("blob");return new Blob([e],{type:t})},nodebuffer:e=>{if(typeof Buffer>"u")throw Rs("nodebuffer");return Buffer.from(e.buffer,e.byteOffset,e.byteLength)},text:()=>{throw Rs("text")}},jl=(e,t,n)=>{let r=Object.prototype.hasOwnProperty.call(Ih,t.toLowerCase())?Ih[t.toLowerCase()]:void 0;if(r===void 0)throw Rs(t);return r(e,n)},XC=new Map([["dk1","dark1"],["lt1","light1"],["dk2","dark2"],["lt2","light2"],["accent1","accent1"],["accent2","accent2"],["accent3","accent3"],["accent4","accent4"],["accent5","accent5"],["accent6","accent6"],["hlink","hyperlink"],["folHlink","followedHyperlink"]]),YC=new Map([["dark1","windowText"],["light1","window"]]),JC=new Set(["http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme","http://purl.oclc.org/ooxml/officeDocument/relationships/theme"]),Hr=e=>{var t,n;return(t=e==null||(n=e.name)===null||n===void 0?void 0:n.slice(e.name.indexOf(":")+1))!==null&&t!==void 0?t:""},Xr=e=>{var t,n;return(t=e==null||(n=e.elements)===null||n===void 0?void 0:n.filter(r=>r.type==="element"))!==null&&t!==void 0?t:[]},Wl=(e,t)=>Xr(e).find(n=>Hr(n)===t),Rr=(e,t)=>{var n;let r=e==null||(n=e.attributes)===null||n===void 0?void 0:n[t];return r===void 0?void 0:String(r)},QC=e=>new TextDecoder(e[0]===255&&e[1]===254?"utf-16le":e[0]===254&&e[1]===255?"utf-16be":"utf-8").decode(e),ZC=(e,t,n)=>{let r=e.get(Qe(t)),i=Rr(r&&Xr(Wl(Wr(QC(r)),"Relationships")).find(s=>{var a;return n.has((a=Rr(s,"Type"))!==null&&a!==void 0?a:"")}),"Target");return i===void 0?void 0:cn(t,i)},e2=(e,t)=>ZC(e,t,JC),t2=(e,t,n)=>{let[r]=Xr(t),i=Hr(r)==="srgbClr"?Rr(r,"val"):Hr(r)==="sysClr"&&(n||Rr(r,"val")!==YC.get(e))?Rr(r,"lastClr"):void 0;return i!==void 0&&/^[0-9A-Fa-f]{6}$/.test(i)?i.toUpperCase():void 0},n2=(e,t=!1)=>Object.fromEntries(Xr(e).flatMap(n=>{let r=XC.get(Hr(n)),i=r&&t2(r,n,t);return r&&i?[[r,i]]:[]})),r2=e=>{let[t]=Xr(Wr(e)),n=Hr(t)==="theme"?Wl(Wl(t,"themeElements"),"clrScheme"):void 0;return n?n2(n,!0):{}},i2=[208,207,17,224,161,177,26,225],$f=class{constructor(e){var t,n,r,i,s,a,o,c,l,u,d,p,h,f;if(E(this,"currentRelationshipId",1),E(this,"documentWrapper",void 0),E(this,"headers",[]),E(this,"footers",[]),E(this,"coreProperties",void 0),E(this,"numbering",void 0),E(this,"media",void 0),E(this,"fileRelationships",void 0),E(this,"footnotesWrapper",void 0),E(this,"endnotesWrapper",void 0),E(this,"settings",void 0),E(this,"contentTypes",void 0),E(this,"customProperties",void 0),E(this,"appProperties",void 0),E(this,"styles",void 0),E(this,"comments",void 0),E(this,"commentsExtended",void 0),E(this,"commentsIds",void 0),E(this,"fontWrapper",void 0),E(this,"theme",void 0),E(this,"packageParts",void 0),E(this,"macros",void 0),E(this,"bibliography",void 0),e.macros!==void 0){let{project:b,events:C=[]}=e.macros,A=b instanceof Uint8Array?b:new Uint8Array(b);if(!i2.every((y,v)=>A[v]===y))throw new Error("macros.project isn't a VBA project. Use createMacros from docx/macros, or the word/vbaProject.bin in a .docm rather than the .docm itself");let w=new be;C.length>0&&w.addRelationship(1,"http://schemas.microsoft.com/office/2006/relationships/wordVbaData","vbaData.xml"),this.macros={project:A,events:C.length>0?ZT(C):void 0,relationships:w}}if(this.coreProperties=new WT(k(k({},e),{},{creator:(t=e.creator)!==null&&t!==void 0?t:"Un-named",revision:(n=e.revision)!==null&&n!==void 0?n:1,lastModifiedBy:(r=e.lastModifiedBy)!==null&&r!==void 0?r:"Un-named"})),this.numbering=new ff(e.numbering?e.numbering:{config:[]}),this.comments=new u1((i=e.comments)!==null&&i!==void 0?i:{children:[]}),this.comments.ThreadData&&(this.commentsExtended=new g1(this.comments.ThreadData)),this.comments.CommentIdsData&&(this.commentsIds=new x1(this.comments.CommentIdsData)),this.fileRelationships=new be,this.customProperties=new YT((s=e.customProperties)!==null&&s!==void 0?s:[]),this.appProperties=new HT,this.footnotesWrapper=new mS,this.endnotesWrapper=new oS,this.contentTypes=new jT({macros:this.macros!==void 0}),((a=this.macros)===null||a===void 0?void 0:a.events)!==void 0&&this.contentTypes.addOverride("application/vnd.ms-word.vbaData+xml","/word/vbaData.xml"),e.bibliography!==void 0){let b=new be;b.addRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps","itemProps1.xml"),this.bibliography={sources:e.bibliography.sources,properties:JT(`{${bm().toUpperCase()}}`),relationships:b},this.contentTypes.addOverride("application/vnd.openxmlformats-officedocument.customXmlProperties+xml","/customXml/itemProps1.xml")}if(this.packageParts=new gf(this.contentTypes),this.documentWrapper=new nS({background:e.background,pageNumbers:e.pageNumbers}),this.settings=new KS({compatibilityModeVersion:e.compatabilityModeVersion,compatibility:e.compatibility,evenAndOddHeaders:!!e.evenAndOddHeaderAndFooters,trackRevisions:(o=e.features)===null||o===void 0?void 0:o.trackRevisions,updateFields:(c=e.features)===null||c===void 0?void 0:c.updateFields,embedFonts:!((l=e.fonts)===null||l===void 0)&&l.length?!0:void 0,defaultTabStop:e.defaultTabStop,protection:e.protection,hyphenation:{autoHyphenation:(u=e.hyphenation)===null||u===void 0?void 0:u.autoHyphenation,hyphenationZone:(d=e.hyphenation)===null||d===void 0?void 0:d.hyphenationZone,consecutiveHyphenLimit:(p=e.hyphenation)===null||p===void 0?void 0:p.consecutiveHyphenLimit,doNotHyphenateCaps:(h=e.hyphenation)===null||h===void 0?void 0:h.doNotHyphenateCaps}}),this.media=new mf(b=>this.packageParts.takePath("media","image",b)),e.externalStyles!==void 0){var m,g,x,T;let b=(m=(g=e.styles)===null||g===void 0?void 0:g.default)!==null&&m!==void 0?m:{},C=Object.entries(wc(b)),A=([y])=>b[y]!==void 0,w=new mC().newInstance(e.externalStyles);this.styles=new ul(k(k({},w),{},{paragraphStyles:(x=e.styles)===null||x===void 0?void 0:x.paragraphStyles,characterStyles:(T=e.styles)===null||T===void 0?void 0:T.characterStyles,importedStyles:[...C.filter(y=>!A(y)).map(([,y])=>y),...w.importedStyles,...C.filter(A).map(([,y])=>y)]}))}else if(e.styles){let b=new yh().newInstance(e.styles.default);this.styles=new ul(k(k({},b),e.styles))}else{let b=new yh;this.styles=new ul(b.newInstance())}this.addDefaultRelationships();for(let b of e.sections)this.addSection(b);if(e.footnotes)for(let b in e.footnotes)this.footnotesWrapper.View.createFootNote(parseFloat(b),e.footnotes[b].children);if(e.endnotes)for(let b in e.endnotes)this.endnotesWrapper.View.createEndnote(parseFloat(b),e.endnotes[b].children);this.fontWrapper=new Km((f=e.fonts)!==null&&f!==void 0?f:[]),this.theme=new TC(e.theme),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme","theme/theme1.xml"),this.macros!==void 0&&this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2006/relationships/vbaProject","vbaProject.bin"),this.bibliography!==void 0&&this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml","../customXml/item1.xml")}addSection({headers:e={},footers:t={},children:n,properties:r}){this.documentWrapper.View.Body.addSection(k(k({},r),{},{headerWrapperGroup:{default:e.default?this.createHeader(e.default):void 0,first:e.first?this.createHeader(e.first):void 0,even:e.even?this.createHeader(e.even):void 0},footerWrapperGroup:{default:t.default?this.createFooter(t.default):void 0,first:t.first?this.createFooter(t.first):void 0,even:t.even?this.createFooter(t.even):void 0}}));for(let i of n)this.documentWrapper.View.add(i)}createHeader(e){let t=new bS(this.media,this.currentRelationshipId++);for(let n of e.options.children)t.add(n);return this.addHeaderToDocument(t),t}createFooter(e){let t=new dS(this.media,this.currentRelationshipId++);for(let n of e.options.children)t.add(n);return this.addFooterToDocument(t),t}addHeaderToDocument(e,t=Ln.DEFAULT){this.headers.push({header:e,type:t}),this.documentWrapper.Relationships.addRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",`header${this.headers.length}.xml`),this.contentTypes.addHeader(this.headers.length)}addFooterToDocument(e,t=Ln.DEFAULT){this.footers.push({footer:e,type:t}),this.documentWrapper.Relationships.addRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",`footer${this.footers.length}.xml`),this.contentTypes.addFooter(this.footers.length)}addDefaultRelationships(){this.fileRelationships.addRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument","word/document.xml"),this.fileRelationships.addRelationship(2,"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"),this.fileRelationships.addRelationship(3,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties","docProps/app.xml"),this.fileRelationships.addRelationship(4,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties","docProps/custom.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles","styles.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering","numbering.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes","footnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes","endnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings","settings.xml"),this.comments.IsEmpty||(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments","comments.xml"),this.contentTypes.addComments()),this.commentsExtended&&(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2011/relationships/commentsExtended","commentsExtended.xml"),this.contentTypes.addCommentsExtended()),this.commentsIds&&(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2016/09/relationships/commentsIds","commentsIds.xml"),this.contentTypes.addCommentsIds())}get Document(){return this.documentWrapper}get Styles(){return this.styles}get CoreProperties(){return this.coreProperties}get Numbering(){return this.numbering}get Media(){return this.media}get FileRelationships(){return this.fileRelationships}get Headers(){return this.headers.map(e=>e.header)}get Footers(){return this.footers.map(e=>e.footer)}get ContentTypes(){return this.contentTypes}get CustomProperties(){return this.customProperties}get AppProperties(){return this.appProperties}get FootNotes(){return this.footnotesWrapper}get Endnotes(){return this.endnotesWrapper}get Settings(){return this.settings}get Comments(){return this.comments}get CommentsExtended(){return this.commentsExtended}get CommentsIds(){return this.commentsIds}get FontTable(){return this.fontWrapper}get Theme(){return this.theme}get PackageParts(){return this.packageParts}get Macros(){return this.macros}get Bibliography(){return this.bibliography}},s2=class extends I{constructor(e){super("w:sdtPr"),e&&this.root.push(new ot("w:alias",e))}},a2=e=>new L({name:"w:docPartObj",children:[new ot("w:docPartGallery",e),new L({name:"w:docPartUnique"})]}),o2=["contentChildren","cachedEntries","beginDirty","tabLeader"],Ff=class extends hc{constructor(e="Table of Contents",t={}){let{contentChildren:n=[],cachedEntries:r=[],beginDirty:i,tabLeader:s=E1.DOT}=t,a=Zl(t,o2);super("w:sdt"),E(this,"fromHeadings",void 0);let o=new s2(e);o.addChildElement(a2("Table of Contents")),this.root.push(o);let c=new Am,l=[new qe({children:[Nm(i),new _m(a),sn()]})],u=[new qe({children:[an()]})];if(r!==void 0&&r.length>0){let{stylesWithLevels:d}=a,p=r.map((f,m)=>{var g,x;let T=this.buildCachedContentParagraphChild(f,a),b=(g=d==null||(x=d.find(A=>A.level===f.level))===null||x===void 0?void 0:x.styleName)!==null&&g!==void 0?g:`TOC${f.level}`,C=m===0?[...l,T]:m===r.length-1?[T,...u]:[T];return new ne({style:b,tabStops:this.getTabStopsForLevel(f.level,s),children:C})}),h=p;r.length<=1&&(h=[...p,new ne({children:u})]);for(let f of h)c.addChildElement(f)}else{let d=new ne({children:l});c.addChildElement(d);for(let h of n)c.addChildElement(h);let p=new ne({children:u});c.addChildElement(p),n.length===0&&(this.fromHeadings={properties:a,beginDirty:i,tabLeader:s})}this.root.push(c)}prepForXml(e){let t=super.prepForXml(e);return $k(t,this.fromHeadings&&k(k({},this.fromHeadings),{},{textWidth:this.textWidthIn(e)})),t}textWidthIn(e){var t,n;return(t=(n=e.file)===null||n===void 0||(n=n.Document)===null||n===void 0||(n=n.View.Body.getSectionPropertiesFor(this))===null||n===void 0?void 0:n.AvailableTextWidth)!==null&&t!==void 0?t:Is}getTabStopsForLevel(e,t,n=9025){return[{type:"clear",position:n+1-(e-1)*240},{type:"right",position:n,leader:t}]}buildCachedContentRun(e,t){var n,r;return new qe({style:t?.hyperlink&&e.href!==void 0?"IndexLink":void 0,children:[new Dr({text:e.title}),new Xs,new Dr({text:(n=(r=e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""})]})}buildCachedContentParagraphChild(e,t){let n=this.buildCachedContentRun(e,t);return t?.hyperlink&&e.href!==void 0?new Fm({anchor:e.href,children:[n]}):n}},Er=0,kl=32,l2=32,c2=(e,t)=>{let n=t.replace(/-/g,"");if(n.length!==l2)throw new Error(`Error: Cannot extract GUID from font filename: ${t}`);let r=n.replace(/(..)/g,"$1 ").trim().split(" ").map(a=>parseInt(a,16));r.reverse();let i=e.slice(Er,kl).map((a,o)=>a^r[o%r.length]),s=new Uint8Array(Er+i.length+Math.max(0,e.length-kl));return s.set(e.slice(0,Er)),s.set(i,Er),s.set(e.slice(kl),Er+i.length),s},dn=class{format(e,t={stack:[]}){let n=e.prepForXml(t);if(n)return n;throw Error("XMLComponent did not format correctly")}},qf=/\{([^{}]+)\}/g,Hf=(e,t)=>t.size===0?e:e.replace(qf,(n,r)=>{var i;return(i=t.get(r))!==null&&i!==void 0?i:n}),d2=e=>new Set(Array.from(e.matchAll(qf),([,t])=>t)),Uf=class{replace(e,t,n){return Hf(e,new Map(t.map((r,i)=>[r.key,(n+i).toString()])))}getMediaData(e,t){let n=d2(e);return t.Entries.filter(([r])=>n.has(r)).map(([r,{fileName:i}])=>({key:r,fileName:i}))}},p2=class{replace(e,t){return Hf(e,new Map(t.map(({reference:n,instance:r,restartedListId:i,numId:s})=>[Bs(n,r,i),s.toString()])))}},u2=new dn,Tl=(e,t,n,r,i=!0)=>j(u2.format(t,{viewWrapper:{View:t,Relationships:r},file:e,stack:[]}),{indent:n,declaration:i?{standalone:"yes",encoding:"UTF-8"}:{encoding:"UTF-8"}}),h2=(e,t,n,r)=>{let{content:i}=t.options;if(i instanceof Uint8Array)return[{data:i,path:`word/${n}`}];if("files"in i)return[{data:qs(i.files.map(({path:l,content:u})=>[l,u instanceof Uint8Array?u:Tl(e,u,r,new be)])),path:`word/${n}`}];let s=e.PackageParts.createRelationships(n),a=Tl(e,i,r,s),o=n.slice(0,n.lastIndexOf("/")),c=n.slice(n.lastIndexOf("/")+1);return[{data:a,path:`word/${n}`},...s.RelationshipCount>0?[{data:Tl(e,s,r,s,!1),path:`word/${o}/_rels/${c}.rels`}]:[]]},Tc=(e,t,n=0)=>{let r=e.PackageParts.Array.slice(n);return r.length===0?[]:[...r.flatMap(({part:i,path:s})=>h2(e,i,s,t)),...Tc(e,t,n+r.length)]},m2=["PackageParts"],f2=class{constructor(){E(this,"formatter",void 0),E(this,"imageReplacer",void 0),E(this,"numberingReplacer",void 0),this.formatter=new dn,this.imageReplacer=new Uf,this.numberingReplacer=new p2}compile(e,t,n=[]){let r=this.xmlifyFile(e,t),{PackageParts:i}=r,s=Zl(r,m2),a=Object.values(s).flatMap(o=>Array.isArray(o)?o:[o]);return new Map([...a.map(({path:o,data:c})=>[o,c]),...i.map(({path:o,data:c})=>[o,c]),...n.map(({path:o,data:c})=>[o,c]),...e.Macros===void 0?[]:[["word/vbaProject.bin",e.Macros.project]],...e.Media.Array.map(o=>[`word/media/${o.fileName}`,o.data]),...e.FontTable.files.map(({data:o,fontKey:c},l)=>[`word/fonts/font${l+1}.odttf`,c2(o,c)])])}xmlifyFile(e,t){var n;let r=j(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),i=j(this.formatter.format(e.Comments,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),s=j(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),a=j(this.formatter.format(e.Endnotes.View,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),o=e.Document.Relationships.RelationshipCount+1,c=e.Comments.Relationships.RelationshipCount+1,l=e.FootNotes.Relationships.RelationshipCount+1,u=e.Endnotes.Relationships.RelationshipCount+1,d=this.imageReplacer.getMediaData(r,e.Media),p=this.imageReplacer.getMediaData(i,e.Media),h=this.imageReplacer.getMediaData(s,e.Media),f=this.imageReplacer.getMediaData(a,e.Media);return k(k(k(k(k(k({Relationships:{data:(()=>{let m=be.copy(e.Document.Relationships);return d.forEach((g,x)=>{m.addRelationship(o+x,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),m.addRelationship(m.RelationshipCount+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"),j(this.formatter.format(m,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{let m=this.imageReplacer.replace(r,d,o);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{let m=j(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:j(this.formatter.format(e.CoreProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},FileRelationships:{data:j(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:e.Headers.map((m,g)=>{let x=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(x,e.Media),b=be.copy(m.Relationships);return T.forEach((C,A)=>{b.addRelationship(A,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${C.fileName}`)}),{data:j(this.formatter.format(b,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${g+1}.xml.rels`}}),FooterRelationships:e.Footers.map((m,g)=>{let x=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(x,e.Media),b=be.copy(m.Relationships);return T.forEach((C,A)=>{b.addRelationship(A,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${C.fileName}`)}),{data:j(this.formatter.format(b,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${g+1}.xml.rels`}}),Headers:e.Headers.map((m,g)=>{let x=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(x,e.Media),b=this.imageReplacer.replace(x,T,0);return{data:this.numberingReplacer.replace(b,e.Numbering.ConcreteNumbering),path:`word/header${g+1}.xml`}}),Footers:e.Footers.map((m,g)=>{let x=j(this.formatter.format(m.View,{viewWrapper:m,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),T=this.imageReplacer.getMediaData(x,e.Media),b=this.imageReplacer.replace(x,T,0);return{data:this.numberingReplacer.replace(b,e.Numbering.ConcreteNumbering),path:`word/footer${g+1}.xml`}}),CustomProperties:{data:j(this.formatter.format(e.CustomProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:j(this.formatter.format(e.AppProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:(()=>{let m=this.imageReplacer.replace(s,h,l);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/footnotes.xml"},FootNotesRelationships:{data:(()=>{let m=be.copy(e.FootNotes.Relationships);return h.forEach((g,x)=>{m.addRelationship(l+x,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),j(this.formatter.format(m,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/footnotes.xml.rels"},Endnotes:{data:(()=>{let m=this.imageReplacer.replace(a,f,u);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/endnotes.xml"},EndnotesRelationships:{data:(()=>{let m=be.copy(e.Endnotes.Relationships);return f.forEach((g,x)=>{m.addRelationship(u+x,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),j(this.formatter.format(m,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/endnotes.xml.rels"},Settings:{data:j(this.formatter.format(e.Settings,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"}},e.Comments.IsEmpty?{}:{Comments:{data:(()=>{let m=this.imageReplacer.replace(i,p,c);return this.numberingReplacer.replace(m,e.Numbering.ConcreteNumbering)})(),path:"word/comments.xml"},CommentsRelationships:{data:(()=>{let m=be.copy(e.Comments.Relationships);return p.forEach((g,x)=>{m.addRelationship(c+x,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${g.fileName}`)}),j(this.formatter.format(m,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/comments.xml.rels"}}),e.CommentsExtended?{CommentsExtended:{data:j(this.formatter.format(e.CommentsExtended,{viewWrapper:{View:e.CommentsExtended,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/commentsExtended.xml"}}:{}),e.CommentsIds?{CommentsIds:{data:j(this.formatter.format(e.CommentsIds,{viewWrapper:{View:e.CommentsIds,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/commentsIds.xml"}}:{}),{},{FontTable:{data:j(this.formatter.format(e.FontTable.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:j(this.formatter.format(e.FontTable.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/fontTable.xml.rels"},Theme:{data:j(this.formatter.format(e.Theme,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/theme/theme1.xml"}},!((n=e.Macros)===null||n===void 0)&&n.events?{MacroEvents:{data:j(this.formatter.format(e.Macros.events,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/vbaData.xml"},MacroRelationships:{data:j(this.formatter.format(e.Macros.relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/vbaProject.bin.rels"}}:{}),e.Bibliography?{BibliographySources:{data:j(this.formatter.format(e.Bibliography.sources,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"customXml/item1.xml"},BibliographySourcesProperties:{data:j(this.formatter.format(e.Bibliography.properties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"no",encoding:"UTF-8"}}),path:"customXml/itemProps1.xml"},BibliographySourcesRelationships:{data:j(this.formatter.format(e.Bibliography.relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"customXml/_rels/item1.xml.rels"}}:{}),{},{PackageParts:Tc(e,t),Numbering:{data:j(this.formatter.format(e.Numbering,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},ContentTypes:{data:j(this.formatter.format(e.ContentTypes,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"}})}},Ph=Z0(((e,t)=>{var n=typeof Reflect=="object"?Reflect:null,r=n&&typeof n.apply=="function"?n.apply:function(y,v,_){return Function.prototype.apply.call(y,v,_)},i;n&&typeof n.ownKeys=="function"?i=n.ownKeys:Object.getOwnPropertySymbols?i=function(y){return Object.getOwnPropertyNames(y).concat(Object.getOwnPropertySymbols(y))}:i=function(y){return Object.getOwnPropertyNames(y)};function s(w){console&&console.warn&&console.warn(w)}var a=Number.isNaN||function(y){return y!==y};function o(){o.init.call(this)}t.exports=o,t.exports.once=b,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var c=10;function l(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(w){if(typeof w!="number"||w<0||a(w))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+w+".");c=w}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(y){if(typeof y!="number"||y<0||a(y))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+y+".");return this._maxListeners=y,this};function u(w){return w._maxListeners===void 0?o.defaultMaxListeners:w._maxListeners}o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(y){for(var v=[],_=1;_<arguments.length;_++)v.push(arguments[_]);var N=y==="error",M=this._events;if(M!==void 0)N=N&&M.error===void 0;else if(!N)return!1;if(N){var O;if(v.length>0&&(O=v[0]),O instanceof Error)throw O;var F=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw F.context=O,F}var Q=M[y];if(Q===void 0)return!1;if(typeof Q=="function")r(Q,this,v);else for(var Z=Q.length,V=g(Q,Z),_=0;_<Z;++_)r(V[_],this,v);return!0};function d(w,y,v,_){var N,M,O;if(l(v),M=w._events,M===void 0?(M=w._events=Object.create(null),w._eventsCount=0):(M.newListener!==void 0&&(w.emit("newListener",y,v.listener?v.listener:v),M=w._events),O=M[y]),O===void 0)O=M[y]=v,++w._eventsCount;else if(typeof O=="function"?O=M[y]=_?[v,O]:[O,v]:_?O.unshift(v):O.push(v),N=u(w),N>0&&O.length>N&&!O.warned){O.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String(y)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=w,F.type=y,F.count=O.length,s(F)}return w}o.prototype.addListener=function(y,v){return d(this,y,v,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(y,v){return d(this,y,v,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(w,y,v){var _={fired:!1,wrapFn:void 0,target:w,type:y,listener:v},N=p.bind(_);return N.listener=v,_.wrapFn=N,N}o.prototype.once=function(y,v){return l(v),this.on(y,h(this,y,v)),this},o.prototype.prependOnceListener=function(y,v){return l(v),this.prependListener(y,h(this,y,v)),this},o.prototype.removeListener=function(y,v){var _,N,M,O,F;if(l(v),N=this._events,N===void 0)return this;if(_=N[y],_===void 0)return this;if(_===v||_.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete N[y],N.removeListener&&this.emit("removeListener",y,_.listener||v));else if(typeof _!="function"){for(M=-1,O=_.length-1;O>=0;O--)if(_[O]===v||_[O].listener===v){F=_[O].listener,M=O;break}if(M<0)return this;M===0?_.shift():x(_,M),_.length===1&&(N[y]=_[0]),N.removeListener!==void 0&&this.emit("removeListener",y,F||v)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(y){var v,_=this._events,N;if(_===void 0)return this;if(_.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):_[y]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete _[y]),this;if(arguments.length===0){var M=Object.keys(_),O;for(N=0;N<M.length;++N)O=M[N],O!=="removeListener"&&this.removeAllListeners(O);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=_[y],typeof v=="function")this.removeListener(y,v);else if(v!==void 0)for(N=v.length-1;N>=0;N--)this.removeListener(y,v[N]);return this};function f(w,y,v){var _=w._events;if(_===void 0)return[];var N=_[y];return N===void 0?[]:typeof N=="function"?v?[N.listener||N]:[N]:v?T(N):g(N,N.length)}o.prototype.listeners=function(y){return f(this,y,!0)},o.prototype.rawListeners=function(y){return f(this,y,!1)},o.listenerCount=function(w,y){return typeof w.listenerCount=="function"?w.listenerCount(y):m.call(w,y)},o.prototype.listenerCount=m;function m(w){var y=this._events;if(y!==void 0){var v=y[w];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(w,y){for(var v=new Array(y),_=0;_<y;++_)v[_]=w[_];return v}function x(w,y){for(;y+1<w.length;y++)w[y]=w[y+1];w.pop()}function T(w){for(var y=new Array(w.length),v=0;v<y.length;++v)y[v]=w[v].listener||w[v];return y}function b(w,y){return new Promise(function(v,_){function N(O){w.removeListener(y,M),_(O)}function M(){typeof w.removeListener=="function"&&w.removeListener("error",N),v([].slice.call(arguments))}A(w,y,M,{once:!0}),y!=="error"&&C(w,N,{once:!0})})}function C(w,y,v){typeof w.on=="function"&&A(w,"error",y,v)}function A(w,y,v,_){if(typeof w.on=="function")_.once?w.once(y,v):w.on(y,v);else if(typeof w.addEventListener=="function")w.addEventListener(y,function N(M){_.once&&w.removeEventListener(y,N),v(M)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof w)}}))();g2=class extends Ph.EventEmitter{pipe(e,t){let n=this,r=e,i=d=>{r.writable&&r.write(d)===!1&&n.pause&&n.pause()};n.on("data",i);let s=()=>{n.readable&&n.resume&&n.resume()};r.on("drain",s),!r._isStdio&&(!t||t.end!==!1)&&(n.on("end",o),n.on("close",c));let a=!1;function o(){a||(a=!0,r.end())}function c(){a||(a=!0,typeof r.destroy=="function"&&r.destroy())}function l(d){if(u(),Ph.EventEmitter.listenerCount(this,"error")===0)throw d}n.on("error",l),r.on("error",l);function u(){n.removeListener("data",i),r.removeListener("drain",s),n.removeListener("end",o),n.removeListener("close",c),n.removeListener("error",l),r.removeListener("error",l),n.removeListener("end",u),n.removeListener("close",u),r.removeListener("close",u)}return n.on("end",u),n.on("close",u),r.on("close",u),r.emit("pipe",n),r}};b2={NONE:"",WITH_2_BLANKS:" ",WITH_4_BLANKS:" ",WITH_TAB:" "},Rh=e=>e===!0?b2.WITH_2_BLANKS:e===!1?void 0:e,Lh=e=>e.Macros===void 0?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/vnd.ms-word.document.macroEnabled.12",Sc=class Rn{static pack(t,n,r){var i=this;return Kt(function*(s,a,o,c=[]){return jl(qs(i.compiler.compile(s,Rh(o),c)),a,Lh(s))}).apply(this,arguments)}static toString(t,n,r=[]){return Rn.pack(t,"string",n,r)}static toBuffer(t,n,r=[]){return Rn.pack(t,"nodebuffer",n,r)}static toBase64String(t,n,r=[]){return Rn.pack(t,"base64",n,r)}static toBlob(t,n,r=[]){return Rn.pack(t,"blob",n,r)}static toArrayBuffer(t,n,r=[]){return Rn.pack(t,"arraybuffer",n,r)}static toStream(t,n,r=[]){let i=new g2,s=this.compiler.compile(t,Rh(n),r);return new Promise(a=>setTimeout(a)).then(()=>jl(qs(s),"nodebuffer",Lh(t))).then(a=>{i.emit("data",a),i.emit("end")},a=>i.emit("error",a)),i}};E(Sc,"compiler",new f2);jf=e=>{var t;if(e.name!=="w:bookmarkStart"&&e.name!=="w:bookmarkEnd")return;let n=Number((t=e.attributes)===null||t===void 0?void 0:t["w:id"]);return Number.isInteger(n)?n:void 0},Wf=e=>{var t;let n=jf(e);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(Wf)]},v2=e=>{let t=new Set(e),n=new Map,r=e.reduce((a,o)=>Math.max(a,o),0),i=a=>{let o=n.get(a);if(o!==void 0)return o;let c=t.has(a)?r+1:a;return r=Math.max(r,c),t.add(c),n.set(a,c),c},s=a=>{let o=jf(a);return k(k(k({},a),o===void 0?{}:{attributes:k(k({},a.attributes),{},{"w:id":String(i(o))})}),a.elements===void 0?{}:{elements:a.elements.map(s)})};return a=>a.map(s)},w2=new dn,ta=e=>new TextDecoder("utf-8",{ignoreBOM:!0}).decode(e),pt=e=>Wr(e,{keepWhitespaceText:!0}),Kf=e=>{var t;return(t=pt(j(w2.format(new Dr({text:e})))).elements[0].elements)!==null&&t!==void 0?t:[]},Gf=e=>k(k({},e),{},{attributes:{"xml:space":"preserve"}}),Te=(e,t)=>{var n,r;let i=(n=e.elements)===null||n===void 0?void 0:n.find(s=>s.name===t);return i===void 0?[]:((r=i.elements)!==null&&r!==void 0||(i.elements=[]),i.elements)},zf=e=>{if(!e?.start.trim()||!e?.end.trim())throw new Error("Both start and end delimiters must be non-empty strings.")},On=(e,t,n)=>{let r=Te(e,"Types");r.some(i=>{var s,a;return i.type==="element"&&i.name==="Default"&&(i==null||(s=i.attributes)===null||s===void 0?void 0:s.ContentType)===t&&(i==null||(a=i.attributes)===null||a===void 0?void 0:a.Extension)===n})||r.push({attributes:{ContentType:t,Extension:n},name:"Default",type:"element"})},x2=(e,t,n)=>{let r=Te(e,"Types");r.some(i=>{var s;return i.type==="element"&&i.name==="Override"&&((s=i.attributes)===null||s===void 0?void 0:s.PartName)===n})||r.push({attributes:{ContentType:t,PartName:n},name:"Override",type:"element"})},y2=(e,t)=>{var n;let r=(n=e.elements)===null||n===void 0?void 0:n.find(i=>i.name==="Types");r?.elements!==void 0&&(r.elements=r.elements.filter(i=>{var s,a;return!(i.name==="Override"&&String((s=(a=i.attributes)===null||a===void 0?void 0:a.PartName)!==null&&s!==void 0?s:"").toLowerCase()===t.toLowerCase())}))},k2=e=>{let t=parseInt(e.substring(3),10);return isNaN(t)?0:t},Cc=e=>Te(e,"Relationships").map(t=>{var n,r;return k2((n=(r=t.attributes)===null||r===void 0||(r=r.Id)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"")}).reduce((t,n)=>Math.max(t,n),0)+1,Kl=(e,t,n,r,i)=>{let s=Te(e,"Relationships");return s.push({attributes:{Id:`rId${t}`,Type:n,Target:r,TargetMode:i},name:"Relationship",type:"element"}),s},Ur=()=>({declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"Relationships",attributes:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},elements:[]}]}),Mh="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",T2="application/vnd.openxmlformats-package.core-properties+xml",Dh="_rels/.rels",Bh="docProps/core.xml",Gl={cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/"},S2={title:{namespace:"dc",name:"title"},subject:{namespace:"dc",name:"subject"},creator:{namespace:"dc",name:"creator"},keywords:{namespace:"cp",name:"keywords"},description:{namespace:"dc",name:"description"},lastModifiedBy:{namespace:"cp",name:"lastModifiedBy"},revision:{namespace:"cp",name:"revision"}},$h=e=>e===""?[]:[{type:"text",text:String(e)}],Fh=e=>{var t;return(t=e.name)===null||t===void 0?void 0:t.slice(e.name.indexOf(":")+1)},C2=(e,t)=>{var n;let r=(n=Object.entries(k({},e.attributes)).find(([i,s])=>(i==="xmlns"||i.startsWith("xmlns:"))&&s===Gl[t]))===null||n===void 0?void 0:n[0];return r===void 0?(e.attributes=k(k({},e.attributes),{},{[`xmlns:${t}`]:Gl[t]}),`${t}:`):r==="xmlns"?"":`${r.slice(6)}:`},E2=e=>{let t=e[0]===255&&e[1]===254?"utf-16le":e[0]===254&&e[1]===255?"utf-16be":"utf-8";return new TextDecoder(t).decode(e)},_2=(e,t,n)=>{var r;let i=t.get(n);if(i===void 0)return e.get(n);let s=pt(E2(i));return!((r=s.declaration)===null||r===void 0)&&r.attributes&&(s.declaration.attributes.encoding="UTF-8"),t.delete(n),e.set(n,s),s},A2=e=>{var t,n;let r=(t=e.get(Dh))!==null&&t!==void 0?t:Ur(),i=(n=Te(r,"Relationships").find(s=>{var a;return((a=s.attributes)===null||a===void 0?void 0:a.Type)===Mh}))===null||n===void 0||(n=n.attributes)===null||n===void 0?void 0:n.Target;return typeof i=="string"?cn("",i):(Kl(r,Cc(r),Mh,Bh),e.set(Dh,r),Bh)},N2=(e,t,n,{addContentTypeOverride:r})=>{var i,s;let a=A2(e),o=_2(e,t,a),c=o??{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"cp:coreProperties",attributes:{"xmlns:cp":Gl.cp},elements:[]}]};o===void 0&&(e.set(a,c),r(T2,`/${a}`));let l=(i=c.elements)===null||i===void 0?void 0:i.find(u=>Fh(u)==="coreProperties");if(l===void 0)throw new Error(`Could not find the core properties in ${a}`);(s=l.elements)!==null&&s!==void 0||(l.elements=[]);for(let[u,{namespace:d,name:p}]of Object.entries(S2)){let h=n[u];if(h===void 0)continue;let f=l.elements.find(m=>Fh(m)===p);f?f.elements=$h(h):l.elements.push({type:"element",name:`${C2(l,d)}${p}`,elements:$h(h)})}},zl=new Set(["wp:inline","wp:anchor"]),Ec=new Set(["wp:docPr","wps:cNvPr","wpg:cNvPr"]),I2=new Set(["a:stCxn","a:endCxn"]),Hs=(e,t)=>{var n,r;if(!t.has((n=e.name)!==null&&n!==void 0?n:""))return;let i=Number((r=e.attributes)===null||r===void 0?void 0:r.id);return Number.isInteger(i)?i:void 0},Vf=e=>{var t;let n=Hs(e,Ec);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(Vf)]},P2=e=>{let t=n=>{var r;let i=Hs(n,Ec);return[...i===void 0?[]:[i],...((r=n.elements)!==null&&r!==void 0?r:[]).flatMap(s=>{var a;return zl.has((a=s.name)!==null&&a!==void 0?a:"")?[]:t(s)})]};return t(e)},O2=e=>{let t=new Set(e),n=e.reduce((a,o)=>Math.max(a,o),0),r=a=>{let o=t.has(a)?n+1:a;return n=Math.max(n,o),t.add(o),o},i=a=>{let o=new Map([...new Set(P2(a))].map(l=>[l,r(l)])),c=l=>{var u,d;if(l!==a&&zl.has((u=l.name)!==null&&u!==void 0?u:""))return i(l);let p=(d=Hs(l,Ec))!==null&&d!==void 0?d:Hs(l,I2),h=p===void 0?void 0:o.get(p);return k(k(k({},l),h===void 0?{}:{attributes:k(k({},l.attributes),{},{id:String(h)})}),l.elements===void 0?{}:{elements:l.elements.map(c)})};return c(a)},s=a=>{var o;return zl.has((o=a.name)!==null&&o!==void 0?o:"")?i(a):k(k({},a),a.elements===void 0?{}:{elements:a.elements.map(s)})};return a=>a.map(s)},Ce={DOCUMENT:"file",PARAGRAPH:"paragraph",TABLE_ROWS:"tableRows",DRAWING:"drawing"},R2=new Map([["wp:inline","wp:docPr"],["wp:anchor","wp:docPr"],["wpg:graphicFrame","wpg:cNvPr"],["wpc:graphicFrame","wpg:cNvPr"]]),na=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(n=>{var r;let i=n.name===void 0?void 0:R2.get(n.name),s=i===void 0||(r=n.elements)===null||r===void 0?void 0:r.find(a=>a.name===i);return[...s?[{element:n,properties:s}]:[],...na(n)]})},Xf=e=>{var t,n;return[(t=e.attributes)===null||t===void 0?void 0:t.descr,(n=e.attributes)===null||n===void 0?void 0:n.title].flatMap(r=>r===void 0?[]:[String(r)])},qh="[Content_Types].xml",L2=e=>{var t;if(!(!((t=e.elements)===null||t===void 0)&&t.some(r=>r.name==="Relationships"))){var n;e.elements=[...(n=e.elements)!==null&&n!==void 0?n:[],...Ur().elements]}return Te(e,"Relationships")},M2="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Vl=e=>{var t,n;return new Set(["r",...Object.entries((t=e.attributes)!==null&&t!==void 0?t:{}).flatMap(([r,i])=>r.startsWith("xmlns:")&&i===M2?[r.slice(6)]:[]),...((n=e.elements)!==null&&n!==void 0?n:[]).flatMap(r=>[...Vl(r)])])},Xl=(e,t)=>{var n,r;return new Set([...Object.entries((n=e.attributes)!==null&&n!==void 0?n:{}).flatMap(([i,s])=>i.includes(":")&&t.has(i.slice(0,i.indexOf(":")))?[String(s)]:[]),...((r=e.elements)!==null&&r!==void 0?r:[]).flatMap(i=>[...Xl(i,t)])])},D2=(e,t)=>{let n=l=>e.has(l)||t.has(l),r=l=>{if(n(l))return l;let u=(()=>{try{return decodeURI(l)}catch{return}})();if(u!==void 0&&n(u))return u;let d=l.toLowerCase();return[...e.keys(),...t.keys()].find(p=>p.toLowerCase()===d)},i=(l,u)=>{let d=e.get(Qe(l));return d===void 0?void 0:Te(d,"Relationships").find(p=>{var h;return p.name==="Relationship"&&((h=p.attributes)===null||h===void 0?void 0:h.Id)===u})},s=(l,u)=>{var d,p;let h=(d=u.attributes)===null||d===void 0?void 0:d.Target;return((p=u.attributes)===null||p===void 0?void 0:p.TargetMode)==="External"||h===void 0?void 0:r(cn(l,String(h)))},a=l=>[...e].some(([u,d])=>u.endsWith(".rels")&&Te(d,"Relationships").some(p=>s(_f(u),p)===l)),o=(l,u)=>{if(u===void 0||u===l||u===qh||u.endsWith(".rels")||a(u))return;let d=e.get(Qe(u));e.delete(u),t.delete(u),e.delete(Qe(u));let p=e.get(qh);p!==void 0&&y2(p,`/${u}`);for(let h of d===void 0?[]:Te(d,"Relationships"))o(u,s(u,h))};return{findRelationship:i,pathOf:s,removeIfUnreferenced:o,removeRelationships:(l,u)=>{var d,p;let h=(d=e.get(Qe(l)))===null||d===void 0||(d=d.elements)===null||d===void 0?void 0:d.find(m=>m.name==="Relationships"),f=((p=h?.elements)!==null&&p!==void 0?p:[]).filter(m=>{var g;return m.name==="Relationship"&&u.has(String((g=m.attributes)===null||g===void 0?void 0:g.Id))});if(!(h===void 0||f.length===0)){h.elements=h.elements.filter(m=>!f.includes(m));for(let m of f)o(l,s(l,m))}}}},B2=(e,{findRelationship:t,pathOf:n,removeIfUnreferenced:r},i,s)=>{let a=new dn;return{getRelatedPart:(o,c)=>{let l=t(o.path,c),u=l===void 0?void 0:n(o.path,l);return u===void 0?void 0:{path:u,xml:e.get(u)}},replaceRelatedPart:(o,c,l)=>{let u=`word/${i.PackageParts.add(l)}`,{relationshipType:d}=l.options,p=xc(o.path,u),h=c===void 0?void 0:t(o.path,c);if(h===void 0){var f;let g=Qe(o.path),x=(f=e.get(g))!==null&&f!==void 0?f:Ur();e.set(g,x);let T=c??`rId${Cc(x)}`;return L2(x).push({type:"element",name:"Relationship",attributes:{Id:T,Type:d,Target:p}}),T}let m=n(o.path,h);return h.attributes=k(k({},Object.fromEntries(Object.entries(h.attributes).filter(([g])=>g!=="TargetMode"))),{},{Type:d,Target:p}),r(o.path,m),String(h.attributes.Id)},format:o=>pt(j(a.format(o,s))).elements[0]}},$2=({parts:e,binaryParts:t,file:n,patches:r,delimiters:i},s)=>{let a=r.map(([l,u])=>({placeholder:`${i.start}${l}${i.end}`,patch:u})),o=[...e].filter(([l])=>l.startsWith("word/")&&!l.endsWith(".rels")).flatMap(([l,u])=>na(u).flatMap(d=>{let p=Xf(d.properties),h=a.filter(({placeholder:g})=>p.some(x=>x.includes(g)));if(h.length>1){var f,m;throw new Error(`The drawing "${(f=(m=d.properties.attributes)===null||m===void 0?void 0:m.name)!==null&&f!==void 0?f:""}" in ${l} has the placeholders ${h.map(({placeholder:g})=>g).join(" and ")} in its alt text. A drawing can only be patched once`)}return h.map(({placeholder:g,patch:x})=>({drawing:k(k({placeholder:g},d),{},{part:{path:l,xml:u}}),patch:x}))})),c=D2(e,t);for(let{drawing:l,patch:u}of o){let d=Xl(l.element,Vl(l.part.xml));u.patch(l,B2(e,c,n,s(l.part.path)));let p=Xl(l.part.xml,Vl(l.part.xml));c.removeRelationships(l.part.path,new Set([...d].filter(h=>!p.has(h))))}},F2=e=>typeof e=="object"&&e!==null&&"on"in e&&typeof e.on=="function",q2=e=>typeof e=="object"&&e!==null&&"generateAsync"in e&&typeof e.generateAsync=="function",H2=e=>["[object Blob]","[object File]"].includes(Object.prototype.toString.call(e)),U2=e=>new Promise((t,n)=>{let r=[];e.on("data",i=>{ArrayBuffer.isView(i)?r.push(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)):typeof i=="number"?r.push(i):n(new TypeError(`A template stream must give bytes, but it gave a ${typeof i}. A stream with an encoding set gives text, so do not set one.`))}),e.on("error",n),e.on("end",()=>{let i=new Uint8Array(r.reduce((s,a)=>s+(typeof a=="number"?1:a.length),0));r.reduce((s,a)=>typeof a=="number"?(i[s]=a,s+1):(i.set(a,s),s+a.length),0),t(i)})}),j2=(function(){var e=Kt(function*(t){return q2(t)?t.generateAsync({type:"uint8array"}):F2(t)?U2(t):H2(t)?new Uint8Array(yield t.arrayBuffer()):typeof t=="string"?Uint8Array.from({length:t.length},(n,r)=>t.charCodeAt(r)):Array.isArray(t)?Uint8Array.from(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)});return function(n){return e.apply(this,arguments)}})(),Yf=(function(){var e=Kt(function*(t,n){return Bf(yield j2(t),n)});return function(n,r){return e.apply(this,arguments)}})(),W2=new dn,Cs="word/document.xml",K2={path:"word/footnotes.xml",rootName:"w:footnotes",noteName:"w:footnote",referenceName:"w:footnoteReference",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",create:{part:()=>new hf,mark:()=>new uf,styles:()=>[new wf({}),new yf({}),new xf({})]}},G2={path:"word/endnotes.xml",rootName:"w:endnotes",noteName:"w:endnote",referenceName:"w:endnoteReference",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",create:{part:()=>new pf,mark:()=>new lf,styles:()=>[new kf({}),new Sf({}),new Tf({})]}},Es=(e,t)=>pt(j(W2.format(e,t))).elements[0],Jf=(e,t)=>{var n,r,i;let s=t.includes((n=e.name)!==null&&n!==void 0?n:"")?Number((r=e.attributes)===null||r===void 0?void 0:r["w:id"]):NaN;return[...Number.isInteger(s)?[s]:[],...((i=e.elements)!==null&&i!==void 0?i:[]).flatMap(a=>Jf(a,t))]},z2=(e,t)=>{var n,r;let i=(n=e.elements)!==null&&n!==void 0?n:[],s=((r=i[0])===null||r===void 0?void 0:r.name)==="w:pPr"?1:0;return k(k({},e),{},{elements:[...i.slice(0,s),t,...i.slice(s)]})},Hh=(e,t,n,{createContext:r,addContentTypeOverride:i,renumberBookmarks:s,renumberDrawings:a,renumberLists:o,useStyles:c})=>{let l=new Map(Object.entries(t).map(([T,b])=>[Number(T),b])),u=new Map,d=[...l.keys()].filter(Number.isFinite).reduce((T,b)=>Math.max(T,Math.floor(b)),0),p=new Map,h,f=T=>{var b,C;let A=T.name===e.referenceName?l.get(Number((b=T.attributes)===null||b===void 0?void 0:b["w:id"])):void 0;return A===void 0?T.elements===void 0?T:k(k({},T),{},{elements:T.elements.map(f)}):(h=((C=h)!==null&&C!==void 0?C:[...n.values()].flatMap(w=>Jf(w,[e.noteName,e.referenceName])).reduce((w,y)=>Math.max(w,y),0))+1,p.set(h,A),k(k({},T),{},{attributes:k(k({},T.attributes),{},{"w:id":String(h)})}))},m=()=>{var T;let b=Te((T=n.get(Qe(Cs)))!==null&&T!==void 0?T:{},"Relationships").find(A=>{var w;return((w=A.attributes)===null||w===void 0?void 0:w.Type)===e.relationshipType}),C=b?cn(Cs,String(b.attributes.Target)):e.path;return n.has(C)||(n.set(C,{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[Es(e.create.part(),r(C))]}),i(e.contentType,`/${C}`)),b||r(Cs).viewWrapper.Relationships.addRelationship($n(),e.relationshipType,xc(Cs,C)),C};return{renumber:T=>T.map(f),write:()=>{if(p.size===0)return;let T=m(),b=r(T),C=new Map([...new Set(p.values())].map(w=>{let y=Es(e.create.mark(),b);return[w,c(o(s(w.children.map(v=>Es(v,b)).map((v,_)=>_===0?z2(v,y):v))))]}));Te(n.get(T),e.rootName).push(...[...p].map(([w,y])=>({type:"element",name:e.noteName,attributes:{"w:id":String(w)},elements:[...a(C.get(y))]})));let A=n.get("word/styles.xml");if(A){let w=Te(A,"w:styles"),y=new Set(w.map(v=>{var _;return(_=v.attributes)===null||_===void 0?void 0:_["w:styleId"]}));w.push(...e.create.styles().map(v=>Es(v,b)).filter(v=>{var _;return!y.has((_=v.attributes)===null||_===void 0?void 0:_["w:styleId"])}))}},carry:(T,b)=>{let C=u.get(T);return C!==void 0?C:(d++,l.set(d,b),u.set(T,d),d)}}},V2=({footnotes:e={},endnotes:t={}},n,r)=>{let i={footnotes:Hh(K2,e,n,r),endnotes:Hh(G2,t,n,r)};return{carry:(s,a,o)=>i[s].carry(a,o),renumber:s=>Object.values(i).reduce((a,o)=>o.renumber(a),s),write:()=>{for(let s of Object.values(i))s.write()}}},X2=new dn,_s="word/document.xml",Y2="word/numbering.xml",J2="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Uh="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",Q2="default-bullet-numbering",Z2="1",eE=(e,t)=>pt(j(X2.format(e,t))).elements[0],jh=e=>e.reduce((t,n)=>Math.max(t,n),0),tE=(e,t,{createContext:n,addContentTypeOverride:r})=>{let i=new Map,s,a=()=>{var f;return Te((f=t.get(Qe(_s)))!==null&&f!==void 0?f:{},"Relationships").find(m=>{var g;return((g=m.attributes)===null||g===void 0?void 0:g.Type)===Uh})},o=(f=a())=>f?cn(_s,String(f.attributes.Target)):Y2,c=(f,m)=>{var g;return Te((g=t.get(o()))!==null&&g!==void 0?g:{},"w:numbering").filter(x=>x.name===f).map(x=>Number(x.attributes[m]))},l=f=>{if(f===Z2)return e.ConcreteNumbering.find(({reference:g})=>g===Q2);if(!f.startsWith("{"))return;let m=e.ConcreteNumbering.find(({reference:g,instance:x})=>f===`{${g}-${x}}`);if(!m){let g=f.slice(1,-1).replace(/-\d+$/,"");throw new Error(`A paragraph in a patch uses the numbering "${g}", which isn't in the numbering option of patchDocument. Add it there with its levels, as in a Document`)}return m},u=f=>{var m;let g=i.get(f.numId);return g!==void 0?g:(s=((m=s)!==null&&m!==void 0?m:jh(c("w:num","w:numId")))+1,i.set(f.numId,s),s)},d=f=>{let m=f.name==="w:numId"?l(String(f.attributes["w:val"])):void 0;return m===void 0?f.elements===void 0?f:k(k({},f),{},{elements:f.elements.map(d)}):k(k({},f),{},{attributes:k(k({},f.attributes),{},{"w:val":String(u(m))})})},p=f=>{let m=a(),g=o(m);return t.has(g)||(t.set(g,{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[k(k({},f),{},{elements:[]})]}),r(J2,`/${g}`)),m||n(_s).viewWrapper.Relationships.addRelationship($n(),Uh,xc(_s,g)),g};return{renumber:f=>f.map(d),write:()=>{var f,m;if(i.size===0)return;let g=eE(e,n(o())),x=N=>Number(N.elements.find(M=>M.name==="w:abstractNumId").attributes["w:val"]),T=g.elements.filter(N=>N.name==="w:num"&&i.has(Number(N.attributes["w:numId"]))),b=jh(c("w:abstractNum","w:abstractNumId")),C=new Map([...new Set(T.map(x))].map((N,M)=>[N,b+M+1])),A=g.elements.flatMap(N=>{let M=N.name==="w:abstractNum"?C.get(Number(N.attributes["w:abstractNumId"])):void 0;return M===void 0?[]:[k(k({},N),{},{attributes:k(k({},N.attributes),{},{"w:abstractNumId":String(M)})})]}),w=p(g),y=t.get(w).elements.find(N=>N.name==="w:numbering");y.attributes=k(k(k({},Object.fromEntries(Object.entries(g.attributes).filter(([N])=>N.startsWith("xmlns:")))),y.attributes),{},{"mc:Ignorable":[...new Set([...String((f=(m=y.attributes)===null||m===void 0?void 0:m["mc:Ignorable"])!==null&&f!==void 0?f:"").split(" "),...String(g.attributes["mc:Ignorable"]).split(" ")])].filter(N=>N!=="").join(" ")});let v=Te(t.get(w),"w:numbering"),_=N=>{let M=v.findIndex(O=>N.includes(O.name));return M===-1?v.length:M};v.splice(_(["w:num","w:numIdMacAtCleanup"]),0,...A),v.splice(_(["w:numIdMacAtCleanup"]),0,...T.map(N=>k(k({},N),{},{attributes:k(k({},N.attributes),{},{"w:numId":String(i.get(Number(N.attributes["w:numId"])))}),elements:N.elements.map(M=>M.name==="w:abstractNumId"?k(k({},M),{},{attributes:{"w:val":String(C.get(x(N)))}}):M)})))}}},Yl={nameOf:e=>e.type==="element"?e.name:void 0,contentOf:e=>e.elements,attributeOf:(e,t)=>{var n;return(n=e.attributes)===null||n===void 0?void 0:n[t]},textOf:e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).filter(({type:n})=>n==="text").map(({text:n})=>String(n)).join("")},textElement:e=>({type:"element",name:"w:t",attributes:{"xml:space":"preserve"},elements:[{type:"text",text:e}]}),writeClean:(e,t)=>{var n;/^\s*(PAGEREF|TOC)\b/i.test(t)&&((n=e.attributes)===null||n===void 0?void 0:n["w:dirty"])!==void 0&&(e.attributes=Object.fromEntries(Object.entries(e.attributes).filter(([r])=>r!=="w:dirty")))},setSimpleFieldResult:(e,t)=>{e.elements=[{type:"element",name:"w:r",elements:[Yl.textElement(t)]}]}},Sl="word/document.xml",nE="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk",rE=[80,75,3,4],iE=(function(){var e=Kt(function*(t){if(rE.every((n,r)=>t[r]===n))try{let n=new Map,r=new Map;for(let[s,a]of Bf(t))/\.(xml|rels)$/.test(s)?n.set(s,pt(ta(a))):r.set(s,a);let i=yield Qf(n,r);return k({parts:n,binaryParts:r},i.size>0?{importedDocuments:i}:{})}catch{return}});return function(n){return e.apply(this,arguments)}})(),Qf=(function(){var e=Kt(function*(t,n){let r=new Map;for(let[a,o]of t){var i,s;if(a.endsWith(".rels"))for(let{attributes:c={}}of(i=(s=Ls(o))===null||s===void 0?void 0:s.elements)!==null&&i!==void 0?i:[]){let l=cn(_f(a),String(c.Target)),u=n.get(l),d=c.Type===nE&&c.TargetMode!=="External"&&u?yield iE(u):void 0;d&&r.set(l,d)}}return r});return function(n,r){return e.apply(this,arguments)}})(),Ls=e=>{var t;return e==null||(t=e.elements)===null||t===void 0?void 0:t.find(({type:n})=>n==="element")},sE=(function(){var e=Kt(function*(t,n,r=new Map){var i,s;let a=Ls(t.get(Sl));if(!a)return;let o=yield Qf(t,r),c=n(k({parts:t,binaryParts:r},o.size>0?{importedDocuments:o}:{})),l=Cm(Yl,a,c,{blank:!0}),u=(i=(s=Ls(t.get(Qe(Sl))))===null||s===void 0?void 0:s.elements)!==null&&i!==void 0?i:[];for(let{attributes:d={}}of u){let p=/\/(header|footer)$/.test(String(d.Type))?Ls(t.get(cn(Sl,String(d.Target)))):void 0;p&&Em(Yl,p,c,{blank:!0,sectionPageCount:l.get(String(d.Id))})}});return function(n,r){return e.apply(this,arguments)}})(),aE=new Set(["w:hyperlink","w:sdt","w:sdtContent","w:ins","w:moveTo","w:smartTag","w:customXml","w:fldSimple","w:dir","w:bdo"]),Zf=(e,t)=>{var n;return((n=e.elements)!==null&&n!==void 0?n:[]).flatMap((r,i)=>{var s;return r.name==="w:r"?[{element:r,path:[...t,i]}]:aE.has((s=r.name)!==null&&s!==void 0?s:"")?Zf(r,[...t,i]):[]})},Us=(e,t)=>t.reduce((n,r)=>n.elements[r],e),Yr=e=>{if(e.element.name!=="w:p")throw new Error(`Invalid node type: ${e.element.name}`);if(!e.element.elements)return{text:"",runs:[],index:-1,pathToParagraph:[]};let t=0,n=Zf(e.element,[]).map(({element:r,path:i})=>{let s=oE(r,i,t);return t+=s.text.length,s});return{text:n.reduce((r,i)=>r+i.text,""),runs:n,index:e.index,pathToParagraph:eg(e)}},oE=(e,t,n)=>{if(!e.elements)return{text:"",parts:[],path:t,start:n,end:n};let r=n,i=e.elements.map((s,a)=>{var o,c;if(s.name!=="w:t"||!s.elements||s.elements.length===0)return;let l=(o=(c=s.elements[0].text)===null||c===void 0?void 0:c.toString())!==null&&o!==void 0?o:"",u=r;return r+=l.length,{text:l,index:a,start:u,end:u+l.length-1}}).filter(s=>!!s).map(s=>s);return{text:i.reduce((s,a)=>s+a.text,""),parts:i,path:t,start:n,end:i.length>0?i[i.length-1].end:n}},eg=e=>e.parent?[...eg(e.parent),e.index]:[e.index],lE=class extends Error{constructor(e){super(`Token ${e} not found`),this.name="TokenNotFoundError"}},cE=(e,t)=>{let n=Yr({element:e,index:0,parent:void 0}).runs.find(({parts:r})=>r.some(({text:i})=>i.includes(t)));if(!n)throw new lE(t);return n.path},dE=(e,t)=>{var n,r;let i=-1,s=(n=(r=e.elements)===null||r===void 0?void 0:r.map((a,o)=>{if(i!==-1)return a;if(a.type==="element"&&a.name==="w:t"){var c,l;let u=((c=(l=a.elements)===null||l===void 0||(l=l[0])===null||l===void 0?void 0:l.text)!==null&&c!==void 0?c:"").split(t),d=u.map(p=>k(k(k({},a),Gf(a)),{},{elements:Kf(p)}));return u.length>1&&(i=o),d}else return a}).flat())!==null&&n!==void 0?n:[];return{left:k(k({},JSON.parse(JSON.stringify(e))),{},{elements:s.slice(0,i+1)}),right:k(k({},JSON.parse(JSON.stringify(e))),{},{elements:s.slice(i+1)})}},_r={START:0,MIDDLE:1,END:2},tg=({paragraphElement:e,renderedParagraph:t,originalText:n,replacementText:r,fromIndex:i=0})=>{let s=t.text.indexOf(n,i),a=s+n.length-1,o=_r.START;for(let c of t.runs){let l=Us(e,c.path);for(let{text:u,index:d,start:p,end:h}of c.parts)switch(o){case _r.START:if(s>=p&&s<=h){let f=s-p,m=Math.min(a,h)-p;if(u.substring(f,m+1)==="")continue;let g=u.substring(0,f)+r+u.substring(m+1);Cl(l.elements[d],g),o=_r.MIDDLE;continue}break;case _r.MIDDLE:if(a<=h){let f=u.substring(a-p+1);Cl(l.elements[d],f);let m=l.elements[d];l.elements[d]=Gf(m),o=_r.END}else Cl(l.elements[d],"")}}return e},Cl=(e,t)=>(e.elements=Kf(t),e),Wh=e=>{var t,n;return(t=(n=e.element.elements)===null||n===void 0?void 0:n.map((r,i)=>({element:r,index:i,parent:e})))!==null&&t!==void 0?t:[]},ng=e=>{let t=[],n=[...Wh({element:e,index:0,parent:void 0})],r;for(;n.length>0;)r=n.shift(),r.element.name==="w:p"&&(t=[...t,Yr(r)]),n.push(...Wh(r));return t},_c=(e,t)=>ng(e).filter(n=>n.text.includes(t)),El="\uFFFF",pE=({json:e,patch:t,patchText:n,context:r,keepOriginalStyles:i=!0,recursive:s=!0,renumberIds:a=o=>o})=>{let o=_c(e,n);if(o.length===0)return{element:e,didFindOccurrence:!1};let c=[...o].reverse(),l=t.type===Ce.DOCUMENT?kE(c):c,u,d=()=>{var h;return u=((h=u)!==null&&h!==void 0?h:ig(e))+1,String(u)};for(let h of l)switch(t.type){case Ce.DOCUMENT:{var p;let f=TE(e,h.pathToParagraph),m=SE(h.pathToParagraph),g=Kh(t,r,a),x=f.name==="w:tc"&&m===f.elements.length-1&&((p=g[g.length-1])===null||p===void 0?void 0:p.name)!=="w:p"?[{type:"element",name:"w:p"}]:[];f.elements.splice(m,1,...g,...x);break}case Ce.PARAGRAPH:default:{let f=sg(e,h.pathToParagraph),m=h,g=0;do g=uE({paragraphElement:f,renderedParagraph:m,patchText:n,fromIndex:g,children:Kh(t,r,a),keepOriginalStyles:i,newTrackedChangeId:d}),m=Yr({element:f,index:h.index,parent:void 0});while(s&&m.text.includes(n,g));break}}return{element:e,didFindOccurrence:!0}},Kh=(e,t,n)=>n(e.children.flatMap(r=>{var i;return(i=r.writtenAs)!==null&&i!==void 0?i:r}).flatMap(r=>{let i=r.prepForXml(t);return i?[pt(j(i)).elements[0]]:[]})),uE=({paragraphElement:e,renderedParagraph:t,patchText:n,fromIndex:r,children:i,keepOriginalStyles:s,newTrackedChangeId:a})=>{let o=t.text.indexOf(n,r);tg({paragraphElement:e,renderedParagraph:t,originalText:n,replacementText:El,fromIndex:r});let c=cE(e,El),l=c.slice(0,-1),u=Us(e,l),d=c[c.length-1],p=l.map((A,w)=>Us(e,l.slice(0,w+1))).filter(A=>A.name==="w:sdt"),h=[...p].reverse().find(hE),f=u.elements[d],{left:m,right:g}=dE(f,El),x=f.elements.find(A=>A.type==="element"&&A.name==="w:rPr"),T=h?mE(h):x,b=s&&T?i.map(A=>rg(A,T)):i,C=x?k(k({},g),{},{elements:[x,...g.elements]}):g;return u.elements.splice(d,1,m,...b,C),p.forEach(A=>bE(A,b)),wE(e,l,a),o+Yr({element:{name:"w:p",elements:[...b]},index:0,parent:void 0}).text.length},Ac=e=>{var t;return(t=e.elements)===null||t===void 0?void 0:t.find(n=>n.name==="w:sdtPr")},hE=e=>{var t;return!!(!((t=Ac(e))===null||t===void 0||(t=t.elements)===null||t===void 0)&&t.some(n=>n.name==="w:showingPlcHdr"))},mE=e=>{var t;return(t=Ac(e))===null||t===void 0||(t=t.elements)===null||t===void 0?void 0:t.find(n=>n.name==="w:rPr")},fE=new Set(["w:rPr","w:t","w:tab","w:br"]),gE=e=>e.name==="w:bookmarkStart"||e.name==="w:bookmarkEnd"||e.name==="w:r"&&rn(e).every(t=>fE.has(t.name)),bE=(e,t)=>{let n=Ac(e);if(!n?.elements)return;let r=n.elements.some(i=>i.name==="w:text")&&!t.every(gE);n.elements=n.elements.filter(i=>i.name!=="w:showingPlcHdr"&&i.name!=="w:dataBinding"&&!(r&&i.name==="w:text"))},Jl=new Set(["w:hyperlink","w:fldSimple","w:subDoc"]),vE=new Map([["w:ins",Jl],["w:moveTo",Jl],["w:hyperlink",new Set(["w:hyperlink"])]]),wE=(e,t,n)=>{for(let i=t.length;i>0;i--){var r;let s=Us(e,t.slice(0,i-1)),a=t[i-1],o=s.elements[a],c=vE.get(o.name),l=g=>!!c?.has(g.name);if(!(!((r=o.elements)===null||r===void 0)&&r.some(l)))continue;let{elements:u}=o,d=u.flatMap((g,x)=>x===0||l(g)||l(u[x-1])?[x]:[]),p=d.map((g,x)=>u.slice(g,d[x+1])),h=c===Jl,f=!0,m=p.map(g=>{if(l(g[0]))return g[0];let x=h&&!f?k(k({},o.attributes),{},{"w:id":n()}):o.attributes;return f=!1,k(k({},o),{},{attributes:x,elements:[...g]})});s.elements.splice(a,1,...m)}},rg=(e,t)=>e.name==="w:r"?xE(e,t):e.elements?k(k({},e),{},{elements:e.elements.map(n=>rg(n,t))}):e,xE=(e,t)=>{let n=rn(e).find(a=>a.type==="element"&&a.name==="w:rPr");if(!n)return k(k({},e),{},{elements:[t,...rn(e)]});let r=new Set(rn(n).map(a=>a.name)),i=[...rn(t).filter(a=>!r.has(a.name)),...rn(n)],s=k(k({},n),{},{elements:[...i].sort((a,o)=>Gh(a)-Gh(o))});return k(k({},e),{},{elements:rn(e).map(a=>a===n?s:a)})},_l=["w:rStyle","w:rFonts","w:b","w:bCs","w:i","w:iCs","w:caps","w:smallCaps","w:strike","w:dstrike","w:outline","w:shadow","w:emboss","w:imprint","w:noProof","w:snapToGrid","w:vanish","w:webHidden","w:color","w:spacing","w:w","w:kern","w:position","w:sz","w:szCs","w:highlight","w:u","w:effect","w:bdr","w:shd","w:fitText","w:vertAlign","w:rtl","w:cs","w:em","w:lang","w:eastAsianLayout","w:specVanish","w:oMath","w14:glow","w14:shadow","w14:reflection","w14:textOutline","w14:textFill","w14:scene3d","w14:props3d","w14:ligatures","w14:numForm","w14:numSpacing","w14:stylisticSets","w14:cntxtAlts"],Gh=e=>{var t;if(e.name==="w:rPrChange")return _l.length+1;let n=_l.indexOf((t=e.name)!==null&&t!==void 0?t:"");return n===-1?_l.length:n},rn=e=>{var t;return(t=e.elements)!==null&&t!==void 0?t:[]},ig=e=>{var t,n;let r=Number((t=e.attributes)===null||t===void 0?void 0:t["w:id"]);return((n=e.elements)!==null&&n!==void 0?n:[]).reduce((i,s)=>Math.max(i,ig(s)),Number.isInteger(r)?r:0)},yE=(e,t)=>e.length>t.length&&t.every((n,r)=>e[r]===n),kE=e=>e.filter(t=>!e.some(n=>yE(t.pathToParagraph,n.pathToParagraph))),sg=(e,t)=>{let n=e;for(let r=1;r<t.length;r++){let i=t[r];n=n.elements[i]}return n},TE=(e,t)=>sg(e,t.slice(0,t.length-1)),SE=e=>e[e.length-1],CE=new dn,Al="word/styles.xml",EE=new Set(["w:pStyle","w:rStyle","w:tblStyle","w:basedOn","w:next","w:link"]),Lr=e=>{var t;return String((t=e.attributes)===null||t===void 0?void 0:t["w:styleId"])},Ql=e=>{var t;let n=(t=e.elements)===null||t===void 0||(t=t.find(r=>r.name==="w:name"))===null||t===void 0||(t=t.attributes)===null||t===void 0?void 0:t["w:val"];return n===void 0?void 0:String(n).toLowerCase()},Ms=(e,t)=>{var n;return e==null||(n=e.elements)===null||n===void 0?void 0:n.find(r=>r.name===t)},zh=e=>{var t;let n=Number((t=Ms(e,"w:sz"))===null||t===void 0||(t=t.attributes)===null||t===void 0?void 0:t["w:val"]);return Number.isNaN(n)?void 0:n},_E=e=>{var t,n;let r=e.filter(a=>a.name==="w:style"),i=(t=r.find(a=>Lr(a)==="Normal"))!==null&&t!==void 0?t:r.find(a=>{var o;return((o=a.attributes)===null||o===void 0?void 0:o["w:type"])==="paragraph"&&Ql(a)==="normal"}),s=e.find(a=>a.name==="w:docDefaults");return(n=zh(Ms(i,"w:rPr")))!==null&&n!==void 0?n:zh(Ms(Ms(s,"w:rPrDefault"),"w:rPr"))},AE=(e,t)=>new Map(Object.values(wc({document:{run:{size:t}}})).map(n=>pt(j(CE.format(n,e))).elements[0]).filter(n=>n.name==="w:style").map(n=>[Lr(n),n])),NE=(e,t)=>{var n;let r=Te((n=e.get(Al))!==null&&n!==void 0?n:{},"w:styles"),i=r.filter(f=>f.name==="w:style"),s=new Set(i.map(Lr)),a,o=f=>{var m;return(m=a)!==null&&m!==void 0||(a=AE(t(Al),_E(r))),a.get(f)},c=new Set,l=new Map,u=f=>{let m=s.has(f)?void 0:o(f);if(m===void 0)return f;let g=i.find(x=>{var T,b;return((T=x.attributes)===null||T===void 0?void 0:T["w:type"])===((b=m.attributes)===null||b===void 0?void 0:b["w:type"])&&Ql(x)===Ql(m)});return g!==void 0?Lr(g):(c.add(f),f)},d=f=>(l.has(f)||l.set(f,u(f)),l.get(f)),p=f=>{var m;return EE.has((m=f.name)!==null&&m!==void 0?m:"")?k(k({},f),{},{attributes:k(k({},f.attributes),{},{"w:val":d(String(f.attributes["w:val"]))})}):f.elements===void 0?f:k(k({},f),{},{elements:f.elements.map(p)})};return{use:f=>f.map(p),write:()=>{let f=e.get(Al);if(!f)return;let m=Te(f,"w:styles"),g=new Set(m.map(Lr));for(let x of c)g.has(x)||(g.add(x),m.push(p(o(x))))}}},IE={type:Ce.PARAGRAPH,children:[]},PE=({json:e,key:t,patch:n,delimiters:{start:r,end:i},patchPlaceholder:s,renumberDrawings:a})=>{let o=`${r}${t}.`;for(let c of OE(e,o)){let l=ME(c.elements,o,i),u=n.rows.flatMap((d,p)=>{let h={type:"element",name:"w:tbl",elements:[...p===0?c.elements.map(DE):a(og(c.elements))]},f=new Map(Object.entries(d).flatMap(([m,g])=>g===void 0?[]:[[m,g]]));for(let[m,g]of f)s(h,`${t}.${m}`,g);for(let m of l.filter(g=>!f.has(g)))s(h,`${t}.${m}`,IE);return h.elements});c.parent.elements.splice(c.parent.elements.indexOf(c.elements[0]),c.elements.length,...u),c.table&&!ag(c.table.element)&&c.table.parent.elements.splice(c.table.parent.elements.indexOf(c.table.element),1)}},OE=(e,t)=>{let n=_c(e,t).flatMap(i=>{let s=RE(e,i.pathToParagraph);return s?[s]:[]}),r=n.filter(i=>!n.some(s=>LE(i.path,s.path))).filter((i,s,a)=>a.findIndex(o=>o.row===i.row)===s);return[...new Set(r.map(i=>i.parent))].flatMap(i=>{let s=i.elements.filter(c=>c.name==="w:tr"),a=r.filter(c=>c.parent===i).map(c=>s.indexOf(c.row)).sort((c,l)=>c-l),{table:o}=r.find(c=>c.parent===i);return a.reduce((c,l)=>{let u=c[c.length-1];return u?.[u.length-1]===l-1?[...c.slice(0,-1),[...u,l]]:[...c,[l]]},[]).map(c=>{let l=i.elements.indexOf(s[c[0]]),u=i.elements.indexOf(s[c[c.length-1]]);return{parent:i,table:o,elements:i.elements.slice(l,u+1)}})})},RE=(e,t)=>{let n=e,r,i;for(let s=1;s<t.length;s++){let a=n.elements[t[s]];a.name==="w:tbl"&&(i={element:a,parent:n}),a.name==="w:tr"&&(r={parent:n,table:i,row:a,path:t.slice(0,s+1)}),n=a}return r},LE=(e,t)=>e.length>t.length&&t.every((n,r)=>e[r]===n),ag=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).some(n=>n.name==="w:tr"||n.name!=="w:tblPr"&&n.name!=="w:tblGrid"&&ag(n))},ME=(e,t,n)=>{let r=_c({elements:[...e]},t).flatMap(({text:i})=>i.split(t).slice(1).flatMap(s=>{let a=s.indexOf(n);return a>0?[s.slice(0,a)]:[]}));return[...new Set(r)]},DE=e=>JSON.parse(JSON.stringify(e)),BE=["w14:paraId","w14:textId"],$E=["w:bookmarkStart","w:bookmarkEnd"],og=(e,t)=>e.filter(n=>{var r;return!$E.includes((r=n.name)!==null&&r!==void 0?r:"")&&!(t?.name==="w:sdtPr"&&n.name==="w:id")}).map(n=>k(k(k({},n),n.attributes===void 0?{}:{attributes:Object.fromEntries(Object.entries(n.attributes).filter(([r])=>!BE.includes(r)))}),n.elements===void 0?{}:{elements:[...og(n.elements,n)]})),FE=e=>e[0]===255&&e[1]===254||e[0]===254&&e[1]===255,qE=e=>{var t;let n=e2(e,"word/document.xml"),r=n===void 0||(t=[...e].find(([i])=>SC(i,n)))===null||t===void 0?void 0:t[1];return r===void 0||FE(r)?void 0:rc(r2(ta(r)))},js=(e,t,{start:n,end:r},i)=>{for(let s=e.indexOf(n,t);s!==-1;s=e.indexOf(n,s+1)){let a=e.indexOf(r,s+n.length);if(a===-1)return;let o=e.slice(s+n.length,a),c=o.trim();if(c!==o&&i(c))return{index:s,placeholder:e.slice(s,a+r.length),trimmed:`${n}${c}${r}`}}},HE=(e,t,n)=>{let r=e;for(let i=js(r,0,t,n);i!==void 0;i=js(r,i.index+i.trimmed.length,t,n))r=`${r.slice(0,i.index)}${i.trimmed}${r.slice(i.index+i.placeholder.length)}`;return r},lg=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(n=>[...n.name==="w:p"?[n]:[],...lg(n)])},UE=(e,t,n)=>{let r=()=>Yr({element:e,index:0,parent:void 0});for(let i=r(),s=js(i.text,0,t,n);s!==void 0;i=r(),s=js(i.text,s.index+s.trimmed.length,t,n))tg({paragraphElement:e,renderedParagraph:i,originalText:s.placeholder,replacementText:s.trimmed,fromIndex:s.index})},jE=(e,{delimiters:t,textKeys:n,tableRowsKeys:r,drawingKeys:i})=>{let s=c=>n.has(c)||r.some(l=>c.startsWith(`${l}.`));for(let c of lg(e))UE(c,t,s);let a=c=>i.has(c);for(let{properties:c}of na(e))for(let l of["descr","title"]){var o;let u=(o=c.attributes)===null||o===void 0?void 0:o[l];u!==void 0&&(c.attributes[l]=HE(String(u),t,a))}},cg=e=>{var t;return e.name==="v:shapetype"&&((t=e.attributes)===null||t===void 0?void 0:t.id)!==void 0?String(e.attributes.id):void 0},dg=e=>{var t;let n=cg(e);return[...n===void 0?[]:[n],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(dg)]},WE=e=>{let t=new Set(dg(e)),n=r=>{let i=cg(r);return i!==void 0?t.has(i)?[]:(t.add(i),[r]):[r.elements===void 0?r:k(k({},r),{},{elements:r.elements.flatMap(n)})]};return r=>r.flatMap(n)},pg=(e,t,{inTableRow:n})=>{if(t?.type===Ce.TABLE_ROWS&&Array.isArray(t.rows)){for(let r of t.rows){if(typeof r!="object"||r===null)throw new Error(`Invalid patch "${e}". Expected each of its rows to be an object of patches, by the name of their field`);for(let[i,s]of Object.entries(r))s!==void 0&&pg(`${e}.${i}`,s,{inTableRow:!0})}return}if(!(t?.type===Ce.DRAWING?!n&&typeof t.patch=="function":t?.type!==Ce.TABLE_ROWS&&Array.isArray(t?.children)))throw new Error(`Invalid patch "${e}". Expected { type: PatchType.PARAGRAPH or PatchType.DOCUMENT, children: [...] }, ${n?"or { type: PatchType.TABLE_ROWS, rows: [...] }":"{ type: PatchType.TABLE_ROWS, rows: [...] }, or a drawing patch such as ImagePatch, or ChartDataPatch from docx/charts"}`)},Vh=new Uf,KE=new Uint8Array([255,254]),GE=new Uint8Array([254,255]),zE=new Set(["w:document","w:hdr","w:ftr","w:footnotes","w:endnotes","w:comments"]),Xh=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},eP=(function(){var e=Kt(function*({outputType:t,data:n,patches:r,keepOriginalStyles:i,placeholderDelimiters:s={start:"{{",end:"}}"},recursive:a=!0,trimPlaceholders:o=!1,footnotes:c,endnotes:l,numbering:u={config:[]},pageNumbers:d,properties:p}){let h=yield Yf(n),f=new Map,m=qE(h),g=[],x=new gf({addOverride:(D,$)=>g.push({contentType:D,partName:$})},new Set([...h.keys()].filter(D=>D.startsWith("word/")).map(D=>D.slice(5)))),T={Media:new mf(D=>x.takePath("media","image",D)),Numbering:new ff(u),Theme:m&&{Colors:m},FootNotes:{View:{idOf:(D,$,q)=>At("footnotes",D,$,q)}},Endnotes:{View:{idOf:(D,$,q)=>At("endnotes",D,$,q)}},PackageParts:x},b=new Map,C=[],A=[],w=!1,y=new Map;zf(s);let{start:v,end:_}=s;for(let[D,$]of Object.entries(r))pg(D,$,{inTableRow:!1});for(let[D,$]of h){var N;let q=$.slice(0,2);if(Xh(q,KE)||Xh(q,GE)){y.set(D,$);continue}if(!D.endsWith(".xml")&&!D.endsWith(".rels")){y.set(D,$);continue}let ie=pt(ta($)),se=(N=ie.elements)===null||N===void 0?void 0:N.find(ae=>{var te;return zE.has((te=ae.name)!==null&&te!==void 0?te:"")});if(se&&se.attributes){for(let ae of["mc","wp","r","w15","m","v","o"])se.attributes[`xmlns:${ae}`]=Ml[ae];se.attributes["mc:Ignorable"]=`${se.attributes["mc:Ignorable"]||""} w15`.trim()}b.set(D,ie)}let M=v2([...b.values()].flatMap(Wf)),O=O2([...b.values()].flatMap(Vf)),F=new Map,Q=D=>{let $=F.get(D);if($)return $;let q={Relationships:{addRelationship:(ie,se,ae,te)=>{A.push({key:D,id:ie,type:se,target:ae,targetMode:te})}}};return F.set(D,q),q},Z=D=>({file:T,viewWrapper:Q(D),stack:[]}),V=(D,$)=>{g.push({contentType:D,partName:$})},G=NE(b,Z),de=tE(T.Numbering,b,{createContext:Z,addContentTypeOverride:V}),ce=V2({footnotes:c,endnotes:l},b,{createContext:Z,addContentTypeOverride:V,renumberBookmarks:M,renumberDrawings:O,renumberLists:de.renumber,useStyles:G.use}),At=(D,$,q,ie)=>ie.viewWrapper===Q("word/document.xml")?ce.carry(D,$,q):void 0;if(o){let D=q=>Object.entries(r).flatMap(([ie,se])=>q(se.type)?[ie]:[]),$={delimiters:{start:v,end:_},textKeys:new Set(D(q=>q!==Ce.TABLE_ROWS&&q!==Ce.DRAWING)),tableRowsKeys:D(q=>q===Ce.TABLE_ROWS),drawingKeys:new Set(D(q=>q===Ce.DRAWING))};for(let[q,ie]of b)q.startsWith("word/")&&!q.endsWith(".rels")&&jE(ie,$)}$2({parts:b,binaryParts:y,file:T,patches:Object.entries(r).flatMap(([D,$])=>$.type===Ce.DRAWING?[[D,$]]:[]),delimiters:{start:v,end:_}},Z);let _e=Object.entries(r).flatMap(([D,$])=>$.type===Ce.DRAWING?[]:[[D,$]]),Ue=[..._e.filter(([,D])=>D.type===Ce.TABLE_ROWS),..._e.filter(([,D])=>D.type!==Ce.TABLE_ROWS)];for(let[D,$]of[...b]){if(!D.startsWith("word/")||D.endsWith(".xml.rels"))continue;let q=Z(D);f.set(D,q);let ie=WE($),se=(ae,te,Re)=>{if(Re.type===Ce.TABLE_ROWS){PE({json:ae,key:te,patch:Re,delimiters:{start:v,end:_},patchPlaceholder:se,renumberDrawings:O});return}let Uc=[],{didFindOccurrence:Zg}=pE({json:ae,patch:k(k({},Re),{},{children:Re.children.flatMap(je=>je instanceof qm?je.writtenAs:[je]).map(je=>{if(je instanceof O1){let{target:eb,anchor:tb}=Wm(je.options.link),jc=new mc(je.options.children,$n(),tb,je.options.link);return Uc.push({key:D,id:jc.linkId,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",target:eb,targetMode:oc.EXTERNAL}),jc}else return je})}),patchText:`${v}${te}${_}`,context:q,keepOriginalStyles:i,recursive:a,renumberIds:je=>G.use(de.renumber(ce.renumber(M(O(ie(je))))))});Zg&&A.push(...Uc)};for(let[ae,te]of Ue)se($,ae,te)}ce.write(),de.write(),G.write();for(let[D,$]of b){if(!D.startsWith("word/")||D.endsWith(".xml.rels"))continue;let q=Vh.getMediaData(JSON.stringify($),T.Media);q.length>0&&(w=!0,C.push({key:D,mediaDatas:q}))}for(let{key:D,mediaDatas:$}of C){var we;let q=Qe(D),ie=(we=b.get(q))!==null&&we!==void 0?we:Ur();b.set(q,ie);let se=Cc(ie),ae=Vh.replace(JSON.stringify(b.get(D)),$,se);b.set(D,JSON.parse(ae));for(let te=0;te<$.length;te++){let{fileName:Re}=$[te];Kl(ie,se+te,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${Re}`)}}for(let{key:D,id:$,type:q,target:ie,targetMode:se}of A){var xe;let ae=Qe(D),te=(xe=b.get(ae))!==null&&xe!==void 0?xe:Ur();b.set(ae,te),Kl(te,$,q,ie,se)}d&&(yield sE(b,d,y)),p&&N2(b,y,p,{addContentTypeOverride:V});let re=Tc(T,void 0);if(w||g.length>0){let D=b.get("[Content_Types].xml");if(!D)throw new Error("Could not find content types file");w&&(On(D,"image/png","png"),On(D,"image/jpeg","jpeg"),On(D,"image/jpeg","jpg"),On(D,"image/bmp","bmp"),On(D,"image/gif","gif"),On(D,"image/svg+xml","svg"));for(let{contentType:$,partName:q}of g)x2(D,$,q)}return jl(qs([...[...b].map(([D,$])=>[D,py($)]),...y,...T.Media.Array.map(({data:D,fileName:$})=>[`word/media/${$}`,D]),...re.map(({path:D,data:$})=>[D,$])]),t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document")});return function(n){return e.apply(this,arguments)}})(),VE=e=>e.startsWith("word/")&&/\.(xml|rels)$/.test(e)&&!e.endsWith(".xml.rels"),tP=(function(){var e=Kt(function*({data:t,placeholderDelimiters:n={start:"{{",end:"}}"},trimPlaceholders:r=!1}){zf(n);let i=XE(n),s=yield Yf(t,VE),a=new Set;for(let[,o]of s){let c=pt(ta(o));[...ng(c).map(l=>l.text),...na(c).flatMap(({properties:l})=>Xf(l))].flatMap(l=>{var u;return(u=l.match(i))!==null&&u!==void 0?u:[]}).map(l=>r?l.trim():l).filter(l=>l!=="").forEach(l=>a.add(l))}return Array.from(a)});return function(n){return e.apply(this,arguments)}})(),Nl=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),XE=({start:e,end:t})=>new RegExp(`(?<=${Nl(e)})(?:(?!${Nl(e)}).)+?(?=${Nl(t)})`,"gs")});var wg={};ii(wg,{EXPORT_DIR:()=>Qr,FORMATS:()=>Nc,TX:()=>Jr,buildIR:()=>aa,caseRows:()=>sa,exportDoc:()=>Ic,irToDocx:()=>vg,irToHtml:()=>oa});import hg from"node:fs";import mg from"node:path";function YE(e){return`${String(e.getDate()).padStart(2,"0")}/${String(e.getMonth()+1).padStart(2,"0")}/${e.getFullYear()}`}function QE(e,t){let n=e.result;if(!n)return[t.status["not-run"]];let r=[t.status[n.status]];return n.actual&&r.push(t.actual+n.actual),n.bug&&r.push(t.bug+n.bug),r}function sa(e,t,n,r){let i=e.kind==="non-functional",s=e.cases.filter(l=>!l.deleted),a=[...i?n.headNf:n.headFn],o=[7,27,38,28];t.results&&(a.push(...n.headResult),o=[8,20,27,20,13,12]);let c=s.map((l,u)=>{let p=[[String(u+1),...t.codes?[l.code]:[]],ia(i&&l.requirement||l.case),ia(l.steps),ia(l.expected)];return t.results&&p.push(QE(l,n),l.result?[l.result.by??"",JE(l.result.at,r)].filter(Boolean):[]),p});return{head:a,widths:o,rows:c}}function gg(e){let t=tn();for(let n of e)xr(n,t);return t}function aa(e,t={}){let n=e.config,r=n.overview??{},i=t.date??new Date,s=n.language==="en"?"en":"vi",a=Jr[s],o=[],c=b=>en(e,b),l=e.modules.filter(b=>c(b.code).some(C=>C.kind==="functional")),u=e.modules.filter(b=>c(b.code).some(C=>C.kind==="non-functional")),d=Ve(e.root,n.ba),p=d?bt(d):null;o.push({k:"cover",lines:[...r.owner?[{text:r.owner.toUpperCase(),bold:!0}]:[],{text:""},{text:a.coverDoc,bold:!0,size:32},{text:a.coverTitle,bold:!0,size:32},{text:n.title,bold:!0,size:28},{text:""},{text:a.docVersion+(r.docVersion||"1.0")},...t.results?[{text:a.withResults}]:[],{text:""},...r.owner?[{text:a.owner+r.owner}]:[],...r.contractor?[{text:a.contractor+r.contractor}]:[],{text:""},{text:(r.place?r.place+", ":"")+(s==="vi"?YE(i):i.toISOString().slice(0,10))}]}),o.push({k:"pagebreak"}),o.push({k:"p",text:a.signPage,bold:!0});let h=n.members.length?n.members:[{id:"",name:"",role:""}];o.push({k:"table",head:a.signHead,widths:[6,16,30,28,20],rows:h.map((b,C)=>[[String(C+1)],[""],[b.name],[b.role??""],[""]])}),o.push({k:"pagebreak"}),o.push({k:"toc",title:a.toc}),o.push({k:"pagebreak"});let f=0;o.push({k:"h",level:1,text:`${fg[f++]}. ${a.overview}`}),o.push({k:"h",level:2,text:a.purpose}),o.push({k:"p",text:r.purpose||a.purposeText(n.title)}),o.push({k:"h",level:2,text:a.scope}),r.scope?o.push({k:"p",text:r.scope}):(o.push({k:"p",text:a.scopeIntro}),o.push({k:"list",items:e.modules.filter(b=>c(b.code).length).map(b=>b.title)})),o.push({k:"h",level:2,text:a.env}),o.push({k:"p",text:r.environment||a.envDefault}),o.push({k:"h",level:2,text:a.refs}),o.push({k:"p",text:r.references||a.refsIntro}),r.references||o.push({k:"list",items:a.refsList}),o.push({k:"h",level:2,text:a.terms});let m=r.terms?.length?r.terms:a.termsDefault;o.push({k:"table",head:a.termsHead,widths:[8,30,62],rows:m.map((b,C)=>[[String(C+1)],[b.term],[b.desc]])});let g=(b,C,A)=>{if(o.push({k:"pagebreak"}),o.push({k:"h",level:1,text:`${fg[f++]}. ${b}`}),!C.length){o.push({k:"p",text:a.noSuites,italic:!0});return}C.forEach((w,y)=>{o.push({k:"h",level:2,text:`${y+1}. ${w.title}`}),A==="functional"&&w.commonSteps.trim()&&(o.push({k:"p",text:a.commonSteps,bold:!0}),o.push({k:"list",items:ia(w.commonSteps)})),c(w.code).filter(v=>v.kind===A).forEach((v,_)=>{o.push({k:"h",level:3,text:`${y+1}.${_+1}. ${v.title}`});let N=[v.useCases.length?a.useCase+v.useCases.join(", "):"",v.covers.length?a.functions+v.covers.map(O=>p?.get(O)?.title?`${O} (${p.get(O).title})`:O).join("; "):""].filter(Boolean);if(N.length&&o.push({k:"p",text:N.join(" \xB7 "),italic:!0}),v.preconditions&&o.push({k:"p",text:a.pre+v.preconditions}),v.description.trim())for(let O of v.description.trim().split(/\n\s*\n/))o.push({k:"p",text:O.trim()});let M=sa(v,t,a,s);M.rows.length?o.push({k:"table",...M}):o.push({k:"p",text:a.noCases,italic:!0})})})};g(a.chFn,l,"functional"),g(a.chNf,u,"non-functional");let x=[];t.results&&x.push(()=>{o.push({k:"h",level:2,text:a.sumTitle});let b=e.modules.map(w=>({m:w,c:gg(c(w.code))})).filter(w=>w.c.total),C=gg(e.modules.flatMap(w=>c(w.code))),A=w=>w.total?Math.round(100*w.passed/w.total)+"%":"\u2014";o.push({k:"table",head:a.sumHead,widths:[30,10,8,10,9,9,11,13],rows:[...b.map(({m:w,c:y})=>[[w.title],[String(y.total)],[String(y.passed)],[String(y.failed)],[String(y.blocked)],[String(y.skipped)],[String(y["not-run"])],[A(y)]]),[[a.total],[String(C.total)],[String(C.passed)],[String(C.failed)],[String(C.blocked)],[String(C.skipped)],[String(C["not-run"])],[A(C)]]]})});let T=e.suites.filter(b=>b.status!=="deleted"&&b.covers.length);if(T.length&&x.push(()=>{o.push({k:"h",level:2,text:a.matrix});let b=new Map;for(let C of T)for(let A of C.covers)b.set(A,[...b.get(A)??[],C.title]);o.push({k:"table",head:a.matrixHead,widths:[8,42,50],rows:[...b.entries()].sort((C,A)=>C[0].localeCompare(A[0])).map(([C,A],w)=>[[String(w+1)],[p?.get(C)?.title?`${C} \u2013 ${p.get(C).title}`:C],A])})}),x.length){o.push({k:"pagebreak"}),o.push({k:"h",level:1,text:a.appendix});for(let b of x)b()}return{title:n.title,lang:s,results:!!t.results,nodes:o}}function oa(e){let t=[],n=e.nodes.filter(s=>s.k==="h"),r=0;for(let s of e.nodes)if(s.k==="cover")t.push(`<section class="cover">${s.lines.map(a=>a.text?`<p class="${a.bold?"b":""}"${a.size?` style="font-size:${a.size/2}pt"`:""}>${Et(a.text)}</p>`:"<p>&nbsp;</p>").join("")}</section>`);else if(s.k==="h")t.push(`<h${s.level} id="h${r++}">${Et(s.text)}</h${s.level}>`);else if(s.k==="p")t.push(`<p${s.bold||s.italic?` class="${s.bold?"b":""} ${s.italic?"i":""}"`:""}>${Et(s.text).replace(/\n/g,"<br>")}</p>`);else if(s.k==="list")t.push(`<ul>${s.items.map(a=>`<li>${Et(a)}</li>`).join("")}</ul>`);else if(s.k==="toc")t.push(`<nav class="toc"><p class="b">${Et(s.title)}</p>${n.map((a,o)=>`<a class="l${a.level}" href="#h${o}">${Et(a.text)}</a>`).join("")}</nav>`);else if(s.k==="pagebreak")t.push('<div class="pb"></div>');else if(s.k==="table"){let a=s.widths?`<colgroup>${s.widths.map(o=>`<col style="width:${o}%">`).join("")}</colgroup>`:"";t.push(`<table>${a}<thead><tr>${s.head.map(o=>`<th>${Et(o)}</th>`).join("")}</tr></thead><tbody>${s.rows.map(o=>`<tr>${o.map(c=>`<td>${c.map(Et).join("<br>")}</td>`).join("")}</tr>`).join("")}</tbody></table>`)}return`<!doctype html><html lang="${e.lang}"><head><meta charset="utf-8"><title>${Et(e.title)}</title><style>body{background:#e9ecef;margin:0;font:12pt/1.45 "Times New Roman",serif;color:#111}
5344
5676
  main{background:#fff;max-width:794px;margin:24px auto;padding:72px 64px;box-shadow:0 1px 4px rgba(0,0,0,.15)}
5345
5677
  .cover{text-align:center;min-height:900px;display:flex;flex-direction:column;justify-content:center}.cover p{margin:4px 0}
5346
5678
  .b{font-weight:700}.i{font-style:italic}h1{font-size:14pt;margin:24px 0 10px}h2{font-size:13pt;margin:18px 0 8px}h3{font-size:12pt;margin:14px 0 6px}
@@ -5348,25 +5680,25 @@ p{margin:6px 0;text-align:justify}table{width:100%;border-collapse:collapse;marg
5348
5680
  th,td{border:1px solid #555;padding:4px 6px;vertical-align:top;text-align:left;overflow-wrap:break-word}th{background:#f1f3f5;overflow-wrap:normal;word-break:keep-all}
5349
5681
  .pb{height:0;border-top:1px dashed #ccc;margin:36px -64px;page-break-after:always}.toc a{display:block;color:#111;text-decoration:none;padding:2px 0}
5350
5682
  .toc .l2{padding-left:18px}.toc .l3{padding-left:36px;font-size:11pt}@media print{body{background:#fff}main{box-shadow:none;margin:0;padding:0}.pb{border:0;margin:0}}</style></head><body><main>${t.join(`
5351
- `)}</main></body></html>`}async function vg(e){let t=[],n=(i,s=!1)=>(i.length?i:[""]).map(a=>new ne({children:[new Oe({text:a,bold:s})]}));for(let i of e.nodes)if(i.k==="cover")for(let s of i.lines)t.push(new ne({alignment:ue.CENTER,spacing:{after:120},children:[new Oe({text:s.text,bold:!!s.bold,...s.size?{size:s.size}:{}})]}));else if(i.k==="h")t.push(new ne({heading:Z2[Math.min(i.level,3)-1],keepNext:!0,children:[new Oe({text:i.text})]}));else if(i.k==="p")t.push(new ne({alignment:ue.JUSTIFIED,children:i.text.split(`
5352
- `).map((s,a)=>new Oe({text:s,bold:!!i.bold,italics:!!i.italic,...a?{break:1}:{}}))}));else if(i.k==="list")for(let s of i.items)t.push(new ne({bullet:{level:0},children:[new Oe({text:s})]}));else if(i.k==="toc")t.push(new ne({alignment:ue.CENTER,children:[new Oe({text:i.title,bold:!0})]})),t.push(new Ff(i.title,{hyperlink:!0,headingStyleRange:"1-3"}));else if(i.k==="pagebreak")t.push(new ne({children:[new $m]}));else if(i.k==="table"){let s=c=>i.widths?.[c]?{width:{size:i.widths[c],type:Fe.PERCENTAGE}}:{},a=new Js({tableHeader:!0,cantSplit:!0,children:i.head.map((c,l)=>new Fr({borders:bg,shading:{fill:"F1F3F5"},...s(l),children:n([c],!0)}))}),o=i.rows.map(c=>new Js({cantSplit:!1,children:c.map((l,u)=>new Fr({borders:bg,...s(u),children:n(l)}))}));t.push(new sf({width:{size:100,type:Fe.PERCENTAGE},rows:[a,...o]})),t.push(new ne({children:[]}))}let r=new $f({creator:"Pan Test",title:e.title,features:{updateFields:!0},styles:{default:{document:{run:{font:"Times New Roman",size:26}}}},sections:[{properties:{page:{margin:{top:1134,bottom:1134,left:1701,right:1134}}},children:t}]});return Sc.toBuffer(r)}async function Pc(e,t={}){let n=aa(e,t),r=mg.resolve(e.root,t.out??Qr);hg.mkdirSync(r,{recursive:!0});let i=t.date??new Date,s=mg.join(r,`${eA(e.config.title)}${t.results?"-ket-qua":""}-${i.toISOString().slice(0,10)}`),a=[];for(let o of t.formats??["docx"]){let c=`${s}.${o}`;hg.writeFileSync(c,o==="docx"?await vg(n):oa(n)),a.push(c)}return a}var Jr,fg,ia,J2,Et,ra,bg,Z2,Qr,Nc,eA,Zr=Se(()=>{"use strict";S();ug();Nn();xr();wr();Jr={vi:{status:{"not-run":"Ch\u01B0a test",passed:"\u0110\u1EA1t",failed:"Kh\xF4ng \u0111\u1EA1t",blocked:"B\u1ECB ch\u1EB7n",skipped:"B\u1ECF qua"},actual:"Th\u1EF1c t\u1EBF: ",bug:"L\u1ED7i: ",headFn:["STT","T\xECnh hu\u1ED1ng","C\xE1c b\u01B0\u1EDBc th\u1EF1c hi\u1EC7n","K\u1EBFt qu\u1EA3 mong \u0111\u1EE3i"],headNf:["STT","Y\xEAu c\u1EA7u","K\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED","K\u1EBFt qu\u1EA3 mong \u0111\u1EE3i"],headResult:["K\u1EBFt qu\u1EA3","Ng\u01B0\u1EDDi test / ng\xE0y"],coverDoc:"T\xC0I LI\u1EC6U",coverTitle:"K\u1ECACH B\u1EA2N KI\u1EC2M TH\u1EEC (CH\u1EE8C N\u0102NG, PHI CH\u1EE8C N\u0102NG)",docVersion:"Phi\xEAn b\u1EA3n t\xE0i li\u1EC7u: ",withResults:"B\u1EA3n k\xE8m k\u1EBFt qu\u1EA3 ki\u1EC3m th\u1EED",owner:"\u0110\u01A1n v\u1ECB qu\u1EA3n l\xFD: ",contractor:"\u0110\u01A1n v\u1ECB th\u1EF1c hi\u1EC7n: ",signPage:"TRANG K\xDD",signHead:["TT","Ng\xE0y","H\u1ECD t\xEAn","Vai tr\xF2","K\xFD t\xEAn"],toc:"M\u1EE4C L\u1EE4C",overview:"T\u1ED4NG QUAN",purpose:"1. M\u1EE5c \u0111\xEDch t\xE0i li\u1EC7u",purposeText:e=>`T\xE0i li\u1EC7u n\xE0y m\xF4 t\u1EA3 c\xE1c t\xECnh hu\u1ED1ng ki\u1EC3m th\u1EED ch\u1EE9c n\u0103ng v\xE0 phi ch\u1EE9c n\u0103ng c\u1EE7a ${e}, l\xE0m c\u0103n c\u1EE9 ki\u1EC3m th\u1EED ch\u1EA5p nh\u1EADn (UAT) v\xE0 b\xE0n giao.`,scope:"2. Ph\u1EA1m vi",scopeIntro:"T\xE0i li\u1EC7u ki\u1EC3m th\u1EED c\xE1c ch\u1EE9c n\u0103ng, th\u1ECFa m\xE3n c\xE1c \u0111\u1EA7u m\u1EE5c ch\xEDnh nh\u01B0 sau:",env:"3. Th\xF4ng tin m\xF4i tr\u01B0\u1EDDng ki\u1EC3m th\u1EED",envDefault:"\u0110\u01B0\u1EDDng d\u1EABn / m\xE1y ch\u1EE7: (b\u1ED5 sung)",refs:"4. T\xE0i li\u1EC7u li\xEAn quan",refsIntro:"T\xE0i li\u1EC7u n\xE0y \u0111\u01B0\u1EE3c x\xE2y d\u1EF1ng d\u1EF1a tr\xEAn c\xE1c t\xE0i li\u1EC7u:",refsList:["T\xE0i li\u1EC7u \u0111\u1EB7c t\u1EA3 y\xEAu c\u1EA7u ph\u1EA7n m\u1EC1m;","T\xE0i li\u1EC7u thi\u1EBFt k\u1EBF chi ti\u1EBFt;","T\xE0i li\u1EC7u \u0111\u1EB7c t\u1EA3 chi ti\u1EBFt ch\u1EE9c n\u0103ng."],terms:"5. Thu\u1EADt ng\u1EEF v\xE0 \u0111\u1ECBnh ngh\u0129a",termsHead:["STT","Thu\u1EADt ng\u1EEF / vi\u1EBFt t\u1EAFt","M\xF4 t\u1EA3"],termsDefault:[{term:"UAT",desc:"Ki\u1EC3m th\u1EED ch\u1EA5p nh\u1EADn ng\u01B0\u1EDDi d\xF9ng (User Acceptance Test)"},{term:"K\u1ECBch b\u1EA3n",desc:"T\u1EADp t\xECnh hu\u1ED1ng ki\u1EC3m th\u1EED cho m\u1ED9t ch\u1EE9c n\u0103ng / use case"},{term:"T\xECnh hu\u1ED1ng",desc:"M\u1ED9t tr\u01B0\u1EDDng h\u1EE3p ki\u1EC3m th\u1EED: c\xE1c b\u01B0\u1EDBc th\u1EF1c hi\u1EC7n v\xE0 k\u1EBFt qu\u1EA3 mong \u0111\u1EE3i"}],chFn:"CHI TI\u1EBET T\xCCNH HU\u1ED0NG KI\u1EC2M TH\u1EEC Y\xCAU C\u1EA6U CH\u1EE8C N\u0102NG \u1EE8NG D\u1EE4NG",chNf:"CHI TI\u1EBET T\xCCNH HU\u1ED0NG KI\u1EC2M TH\u1EEC Y\xCAU C\u1EA6U PHI CH\u1EE8C N\u0102NG \u1EE8NG D\u1EE4NG",noSuites:"(Ch\u01B0a c\xF3 k\u1ECBch b\u1EA3n.)",noCases:"(Ch\u01B0a c\xF3 t\xECnh hu\u1ED1ng.)",commonSteps:"C\xE1c b\u01B0\u1EDBc th\u1EF1c hi\u1EC7n chung:",useCase:"Use case: ",functions:"Ch\u1EE9c n\u0103ng: ",pre:"\u0110i\u1EC1u ki\u1EC7n ti\xEAn quy\u1EBFt: ",appendix:"PH\u1EE4 L\u1EE4C",sumTitle:"T\u1ED5ng h\u1EE3p k\u1EBFt qu\u1EA3 ki\u1EC3m th\u1EED",sumHead:["Ph\xE2n h\u1EC7","T\xECnh hu\u1ED1ng","\u0110\u1EA1t","Kh\xF4ng \u0111\u1EA1t","B\u1ECB ch\u1EB7n","B\u1ECF qua","Ch\u01B0a test","T\u1EF7 l\u1EC7 \u0111\u1EA1t"],total:"T\u1ED5ng",matrix:"Ma tr\u1EADn ch\u1EE9c n\u0103ng \u2013 k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED",matrixHead:["STT","Ch\u1EE9c n\u0103ng / m\xE0n (t\xE0i li\u1EC7u BA)","K\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED"]},en:{status:{"not-run":"Not run",passed:"Passed",failed:"Failed",blocked:"Blocked",skipped:"Skipped"},actual:"Actual: ",bug:"Bug: ",headFn:["No.","Test case","Steps","Expected result"],headNf:["No.","Requirement","Test scenario","Expected result"],headResult:["Result","Tester / date"],coverDoc:"DOCUMENT",coverTitle:"TEST SCENARIOS (FUNCTIONAL, NON-FUNCTIONAL)",docVersion:"Document version: ",withResults:"With test results",owner:"Owner: ",contractor:"Contractor: ",signPage:"SIGN-OFF",signHead:["No.","Date","Full name","Role","Signature"],toc:"TABLE OF CONTENTS",overview:"OVERVIEW",purpose:"1. Purpose",purposeText:e=>`This document describes the functional and non-functional test scenarios of ${e}, used for user acceptance testing (UAT) and handover.`,scope:"2. Scope",scopeIntro:"The document covers the following main areas:",env:"3. Test environment",envDefault:"URL / server: (to be added)",refs:"4. Related documents",refsIntro:"This document is based on:",refsList:["Software requirements specification;","Detailed design;","Detailed functional specification."],terms:"5. Terms and definitions",termsHead:["No.","Term / abbreviation","Description"],termsDefault:[{term:"UAT",desc:"User Acceptance Test"},{term:"Test suite",desc:"The test cases of one function / use case"},{term:"Test case",desc:"One check: steps to perform and the expected result"}],chFn:"FUNCTIONAL TEST SCENARIOS",chNf:"NON-FUNCTIONAL TEST SCENARIOS",noSuites:"(No test suites yet.)",noCases:"(No test cases yet.)",commonSteps:"Common steps:",useCase:"Use case: ",functions:"Functions: ",pre:"Preconditions: ",appendix:"APPENDIX",sumTitle:"Test results summary",sumHead:["Module","Test cases","Passed","Failed","Blocked","Skipped","Not run","Pass rate"],total:"Total",matrix:"Function \u2013 test suite matrix",matrixHead:["No.","Function / screen (BA document)","Test suite"]}},fg=["I","II","III","IV","V","VI"],ia=e=>String(e??"").split(`
5353
- `).map(t=>t.replace(/^\s*[-*+]\s+/,"").trimEnd()).filter(t=>t.trim());J2=(e,t)=>{let n=/^(\d{4})-(\d{2})-(\d{2})/.exec(e??"");return n&&t==="vi"?`${n[3]}/${n[2]}/${n[1]}`:e??""};Et=e=>e.replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t]);ra={style:Gr.SINGLE,size:4,color:"555555"},bg={top:ra,bottom:ra,left:ra,right:ra},Z2=[Ys.HEADING_1,Ys.HEADING_2,Ys.HEADING_3];Qr="exports",Nc=["docx","html"],eA=e=>e.normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/Đ/g,"D").replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)||"tai-lieu-kiem-thu"});function kg(e){return e==="mixed"?["vi","en"]:[e]}function Ic(e){let t=[];for(let n of kg(e))for(let r of tA)for(let i of xg[n][r])t.push({kind:r,keyword:i});return t.sort((n,r)=>r.keyword.length-n.keyword.length)}function Oc(e){let t=[rA];for(let n of kg(e))for(let r of nA)t.push(...xg[n][r]);return t.sort((n,r)=>r.length-n.length)}function oA(e,t){for(let{kind:n,keyword:r}of t){let i=`${r}:`;if(e.startsWith(i))return{kind:n,keyword:r,title:e.slice(i.length).trim()}}return null}function lA(e,t){for(let n of t){let r=`${n} `;if(!e.startsWith(r))continue;let i=e.slice(r.length).trim();if(i)return{keyword:n,text:i}}return null}function cA(e){return e.trim().split(/\s+/).filter(t=>t.startsWith("@"))}function dA(e,t){let n=e.find(s=>s.trim()!=="");if(!n)return"mixed";let r=n.trim().match(iA);if(!r)return"mixed";let i=r[1].toLowerCase();if(i!=="vi"&&i!=="en")throw new Error(`Unsupported Gherkin language "${r[1]}" in ${t} (supported: vi, en)`);return i}function yg(e){if(!e.startsWith("|"))return null;let t=e.split("|");return t.length<2?null:t.slice(1,t.at(-1)?.trim()===""?-1:void 0).map(r=>r.trim())}function Tg(e){return e.length>0?e[e.length-1]:null}function pA(e,t){let n=Tg(e);n&&(n.dataTable||(n.dataTable=[]),n.dataTable.push(t))}function uA(e,t){let n=Tg(e);n&&(n.docString=t)}function hA(e,t){let{scenario:n,startLine:r,endLine:i}=e;return n.lineRange={start:r,end:i},n.rawBlock=t.slice(r-1,i).join(`
5354
- `),n}function Sg(e,t){let n=e.split(/\r?\n/),r=dA(n,t),i=sA[r],s=aA[r],a=[],o="",c=[],l=[],u=[],d=0,p=null,h="none",f,m=[],g=!1,y=[],T=null;function b(){return h==="background"?c:h==="ruleBackground"?m:p&&h==="scenario"?p.scenario.ownSteps:null}let C=new Map;function _(){if(!p)return;let w=hA(p,n);C.set(w,[...p.ruleBackgroundSteps]),l.push(w),p=null}for(let w=0;w<n.length;w+=1){let x=n[w],v=w+1,A=x.trim();if(!A)continue;if(g){A==='"""'?(T&&uA(T,y.join(`
5355
- `)),g=!1,y=[],T=null):y.push(x),p&&(p.endLine=v);continue}if(A.startsWith("@")){u.length===0&&(d=v),u.push(...cA(x));continue}if(A.startsWith("#"))continue;let N=oA(A,i);if(N){switch(N.kind){case"feature":_(),a=[...u],o=N.title,f=void 0,m=[],h="none";break;case"background":_(),h=f!==void 0?"ruleBackground":"background";break;case"rule":_(),f=N.title,m=[],h="none";break;case"scenario":case"scenarioOutline":{_();let F=u.length>0?d:v;p={startLine:F,endLine:v,ruleBackgroundSteps:[...m],scenario:{tags:[...u],title:N.title,keyword:N.keyword,isOutline:N.kind==="scenarioOutline",rule:f,steps:[],ownSteps:[],examples:[],rawBlock:"",lineRange:{start:F,end:v}}},h="scenario";break}case"examples":p&&(p.scenario.examples.push({keyword:N.keyword,headers:[],rows:[]}),p.endLine=v,h="examples");break}u=[];continue}let D=lA(A,s);if(D){h==="background"?c.push(D):h==="ruleBackground"?m.push(D):p&&(p.scenario.ownSteps.push(D),p.endLine=v,h="scenario");continue}if(h==="examples"&&p){let F=yg(A);if(F){let Q=p.scenario.examples[p.scenario.examples.length-1];Q.headers.length===0?Q.headers=F:Q.rows.push(F),p.endLine=v;continue}}if(A==='"""'){let F=b();if(F&&F.length>0){g=!0,y=[],T=F,p&&(p.endLine=v);continue}}let O=yg(A);if(O){let F=b();if(F){pA(F,O),p&&(p.endLine=v);continue}}p&&(p.endLine=v)}_();for(let w of l){let x=C.get(w)??[];w.steps=[...c,...x,...w.ownSteps]}return{filePath:t,language:r,featureTags:a,featureTitle:o,backgroundSteps:c,scenarios:l}}var xg,tA,nA,rA,iA,sA,aA,Cg=Se(()=>{"use strict";S();xg={vi:{feature:["T\xEDnh n\u0103ng"],background:["B\u1ED1i c\u1EA3nh"],rule:["Quy t\u1EAFc"],scenario:["T\xECnh hu\u1ED1ng","K\u1ECBch b\u1EA3n"],scenarioOutline:["Khung t\xECnh hu\u1ED1ng","Khung k\u1ECBch b\u1EA3n","K\u1ECBch b\u1EA3n m\u1EABu"],examples:["D\u1EEF li\u1EC7u","V\xED d\u1EE5"],given:["Bi\u1EBFt","Cho"],when:["Khi"],then:["Th\xEC"],and:["V\xE0"],but:["Nh\u01B0ng"]},en:{feature:["Feature"],background:["Background"],rule:["Rule"],scenario:["Scenario","Example"],scenarioOutline:["Scenario Outline","Scenario Template"],examples:["Examples","Scenarios"],given:["Given"],when:["When"],then:["Then"],and:["And"],but:["But"]}},tA=["feature","background","rule","scenario","scenarioOutline","examples"],nA=["given","when","then","and","but"],rA="*",iA=/^#\s*language\s*:\s*(.+?)\s*$/;sA={vi:Ic("vi"),en:Ic("en"),mixed:Ic("mixed")},aA={vi:Oc("vi"),en:Oc("en"),mixed:Oc("mixed")}});function Eg(e){let t=[];Ag(e.suites??[],t);let n=0,r=0,i=0,s=0;for(let a of t)a.status==="skipped"?s++:a.flaky?i++:a.status==="passed"?n++:r++;return{passed:n,failed:r,flaky:i,skipped:s,specs:t}}function Ag(e,t,n=""){for(let r of e){let i=r.file??n;for(let s of r.specs??[])t.push(mA(s,s.file??i));r.suites&&Ag(r.suites,t,i)}}function mA(e,t){let n=e.tests??[],r="skipped",i=!1,s=0,a;for(let o of n){let c=o.results??[];for(let u of c)s+=Number(u.duration??0)||0;let l=o.status;if(l==="flaky")i=!0,r="passed";else if(l==="expected")r="passed";else if(l==="unexpected")r="failed";else if(l==="skipped")r="skipped";else{let u=c[c.length-1]?.status;r=u==="passed"?"passed":u==="skipped"?"skipped":u?"failed":r}if(!a){let u=c.find(p=>p.error?.message||p.errors&&p.errors[0]?.message),d=u?.error?.message??u?.errors?.[0]?.message;d&&(a=fA(d).split(`
5683
+ `)}</main></body></html>`}async function vg(e){let t=[],n=(i,s=!1)=>(i.length?i:[""]).map(a=>new ne({children:[new Oe({text:a,bold:s})]}));for(let i of e.nodes)if(i.k==="cover")for(let s of i.lines)t.push(new ne({alignment:ue.CENTER,spacing:{after:120},children:[new Oe({text:s.text,bold:!!s.bold,...s.size?{size:s.size}:{}})]}));else if(i.k==="h")t.push(new ne({heading:ZE[Math.min(i.level,3)-1],keepNext:!0,children:[new Oe({text:i.text})]}));else if(i.k==="p")t.push(new ne({alignment:ue.JUSTIFIED,children:i.text.split(`
5684
+ `).map((s,a)=>new Oe({text:s,bold:!!i.bold,italics:!!i.italic,...a?{break:1}:{}}))}));else if(i.k==="list")for(let s of i.items)t.push(new ne({bullet:{level:0},children:[new Oe({text:s})]}));else if(i.k==="toc")t.push(new ne({alignment:ue.CENTER,children:[new Oe({text:i.title,bold:!0})]})),t.push(new Ff(i.title,{hyperlink:!0,headingStyleRange:"1-3"}));else if(i.k==="pagebreak")t.push(new ne({children:[new $m]}));else if(i.k==="table"){let s=c=>i.widths?.[c]?{width:{size:i.widths[c],type:Fe.PERCENTAGE}}:{},a=new Js({tableHeader:!0,cantSplit:!0,children:i.head.map((c,l)=>new Fr({borders:bg,shading:{fill:"F1F3F5"},...s(l),children:n([c],!0)}))}),o=i.rows.map(c=>new Js({cantSplit:!1,children:c.map((l,u)=>new Fr({borders:bg,...s(u),children:n(l)}))}));t.push(new sf({width:{size:100,type:Fe.PERCENTAGE},rows:[a,...o]})),t.push(new ne({children:[]}))}let r=new $f({creator:"Pan Test",title:e.title,features:{updateFields:!0},styles:{default:{document:{run:{font:"Times New Roman",size:26}}}},sections:[{properties:{page:{margin:{top:1134,bottom:1134,left:1701,right:1134}}},children:t}]});return Sc.toBuffer(r)}async function Ic(e,t={}){let n=aa(e,t),r=mg.resolve(e.root,t.out??Qr);hg.mkdirSync(r,{recursive:!0});let i=t.date??new Date,s=mg.join(r,`${e_(e.config.title)}${t.results?"-ket-qua":""}-${i.toISOString().slice(0,10)}`),a=[];for(let o of t.formats??["docx"]){let c=`${s}.${o}`;hg.writeFileSync(c,o==="docx"?await vg(n):oa(n)),a.push(c)}return a}var Jr,fg,ia,JE,Et,ra,bg,ZE,Qr,Nc,e_,Zr=Se(()=>{"use strict";S();ug();Nn();yr();wr();Jr={vi:{status:{"not-run":"Ch\u01B0a test",passed:"\u0110\u1EA1t",failed:"Kh\xF4ng \u0111\u1EA1t",blocked:"B\u1ECB ch\u1EB7n",skipped:"B\u1ECF qua"},actual:"Th\u1EF1c t\u1EBF: ",bug:"L\u1ED7i: ",headFn:["STT","T\xECnh hu\u1ED1ng","C\xE1c b\u01B0\u1EDBc th\u1EF1c hi\u1EC7n","K\u1EBFt qu\u1EA3 mong \u0111\u1EE3i"],headNf:["STT","Y\xEAu c\u1EA7u","K\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED","K\u1EBFt qu\u1EA3 mong \u0111\u1EE3i"],headResult:["K\u1EBFt qu\u1EA3","Ng\u01B0\u1EDDi test / ng\xE0y"],coverDoc:"T\xC0I LI\u1EC6U",coverTitle:"K\u1ECACH B\u1EA2N KI\u1EC2M TH\u1EEC (CH\u1EE8C N\u0102NG, PHI CH\u1EE8C N\u0102NG)",docVersion:"Phi\xEAn b\u1EA3n t\xE0i li\u1EC7u: ",withResults:"B\u1EA3n k\xE8m k\u1EBFt qu\u1EA3 ki\u1EC3m th\u1EED",owner:"\u0110\u01A1n v\u1ECB qu\u1EA3n l\xFD: ",contractor:"\u0110\u01A1n v\u1ECB th\u1EF1c hi\u1EC7n: ",signPage:"TRANG K\xDD",signHead:["TT","Ng\xE0y","H\u1ECD t\xEAn","Vai tr\xF2","K\xFD t\xEAn"],toc:"M\u1EE4C L\u1EE4C",overview:"T\u1ED4NG QUAN",purpose:"1. M\u1EE5c \u0111\xEDch t\xE0i li\u1EC7u",purposeText:e=>`T\xE0i li\u1EC7u n\xE0y m\xF4 t\u1EA3 c\xE1c t\xECnh hu\u1ED1ng ki\u1EC3m th\u1EED ch\u1EE9c n\u0103ng v\xE0 phi ch\u1EE9c n\u0103ng c\u1EE7a ${e}, l\xE0m c\u0103n c\u1EE9 ki\u1EC3m th\u1EED ch\u1EA5p nh\u1EADn (UAT) v\xE0 b\xE0n giao.`,scope:"2. Ph\u1EA1m vi",scopeIntro:"T\xE0i li\u1EC7u ki\u1EC3m th\u1EED c\xE1c ch\u1EE9c n\u0103ng, th\u1ECFa m\xE3n c\xE1c \u0111\u1EA7u m\u1EE5c ch\xEDnh nh\u01B0 sau:",env:"3. Th\xF4ng tin m\xF4i tr\u01B0\u1EDDng ki\u1EC3m th\u1EED",envDefault:"\u0110\u01B0\u1EDDng d\u1EABn / m\xE1y ch\u1EE7: (b\u1ED5 sung)",refs:"4. T\xE0i li\u1EC7u li\xEAn quan",refsIntro:"T\xE0i li\u1EC7u n\xE0y \u0111\u01B0\u1EE3c x\xE2y d\u1EF1ng d\u1EF1a tr\xEAn c\xE1c t\xE0i li\u1EC7u:",refsList:["T\xE0i li\u1EC7u \u0111\u1EB7c t\u1EA3 y\xEAu c\u1EA7u ph\u1EA7n m\u1EC1m;","T\xE0i li\u1EC7u thi\u1EBFt k\u1EBF chi ti\u1EBFt;","T\xE0i li\u1EC7u \u0111\u1EB7c t\u1EA3 chi ti\u1EBFt ch\u1EE9c n\u0103ng."],terms:"5. Thu\u1EADt ng\u1EEF v\xE0 \u0111\u1ECBnh ngh\u0129a",termsHead:["STT","Thu\u1EADt ng\u1EEF / vi\u1EBFt t\u1EAFt","M\xF4 t\u1EA3"],termsDefault:[{term:"UAT",desc:"Ki\u1EC3m th\u1EED ch\u1EA5p nh\u1EADn ng\u01B0\u1EDDi d\xF9ng (User Acceptance Test)"},{term:"K\u1ECBch b\u1EA3n",desc:"T\u1EADp t\xECnh hu\u1ED1ng ki\u1EC3m th\u1EED cho m\u1ED9t ch\u1EE9c n\u0103ng / use case"},{term:"T\xECnh hu\u1ED1ng",desc:"M\u1ED9t tr\u01B0\u1EDDng h\u1EE3p ki\u1EC3m th\u1EED: c\xE1c b\u01B0\u1EDBc th\u1EF1c hi\u1EC7n v\xE0 k\u1EBFt qu\u1EA3 mong \u0111\u1EE3i"}],chFn:"CHI TI\u1EBET T\xCCNH HU\u1ED0NG KI\u1EC2M TH\u1EEC Y\xCAU C\u1EA6U CH\u1EE8C N\u0102NG \u1EE8NG D\u1EE4NG",chNf:"CHI TI\u1EBET T\xCCNH HU\u1ED0NG KI\u1EC2M TH\u1EEC Y\xCAU C\u1EA6U PHI CH\u1EE8C N\u0102NG \u1EE8NG D\u1EE4NG",noSuites:"(Ch\u01B0a c\xF3 k\u1ECBch b\u1EA3n.)",noCases:"(Ch\u01B0a c\xF3 t\xECnh hu\u1ED1ng.)",commonSteps:"C\xE1c b\u01B0\u1EDBc th\u1EF1c hi\u1EC7n chung:",useCase:"Use case: ",functions:"Ch\u1EE9c n\u0103ng: ",pre:"\u0110i\u1EC1u ki\u1EC7n ti\xEAn quy\u1EBFt: ",appendix:"PH\u1EE4 L\u1EE4C",sumTitle:"T\u1ED5ng h\u1EE3p k\u1EBFt qu\u1EA3 ki\u1EC3m th\u1EED",sumHead:["Ph\xE2n h\u1EC7","T\xECnh hu\u1ED1ng","\u0110\u1EA1t","Kh\xF4ng \u0111\u1EA1t","B\u1ECB ch\u1EB7n","B\u1ECF qua","Ch\u01B0a test","T\u1EF7 l\u1EC7 \u0111\u1EA1t"],total:"T\u1ED5ng",matrix:"Ma tr\u1EADn ch\u1EE9c n\u0103ng \u2013 k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED",matrixHead:["STT","Ch\u1EE9c n\u0103ng / m\xE0n (t\xE0i li\u1EC7u BA)","K\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED"]},en:{status:{"not-run":"Not run",passed:"Passed",failed:"Failed",blocked:"Blocked",skipped:"Skipped"},actual:"Actual: ",bug:"Bug: ",headFn:["No.","Test case","Steps","Expected result"],headNf:["No.","Requirement","Test scenario","Expected result"],headResult:["Result","Tester / date"],coverDoc:"DOCUMENT",coverTitle:"TEST SCENARIOS (FUNCTIONAL, NON-FUNCTIONAL)",docVersion:"Document version: ",withResults:"With test results",owner:"Owner: ",contractor:"Contractor: ",signPage:"SIGN-OFF",signHead:["No.","Date","Full name","Role","Signature"],toc:"TABLE OF CONTENTS",overview:"OVERVIEW",purpose:"1. Purpose",purposeText:e=>`This document describes the functional and non-functional test scenarios of ${e}, used for user acceptance testing (UAT) and handover.`,scope:"2. Scope",scopeIntro:"The document covers the following main areas:",env:"3. Test environment",envDefault:"URL / server: (to be added)",refs:"4. Related documents",refsIntro:"This document is based on:",refsList:["Software requirements specification;","Detailed design;","Detailed functional specification."],terms:"5. Terms and definitions",termsHead:["No.","Term / abbreviation","Description"],termsDefault:[{term:"UAT",desc:"User Acceptance Test"},{term:"Test suite",desc:"The test cases of one function / use case"},{term:"Test case",desc:"One check: steps to perform and the expected result"}],chFn:"FUNCTIONAL TEST SCENARIOS",chNf:"NON-FUNCTIONAL TEST SCENARIOS",noSuites:"(No test suites yet.)",noCases:"(No test cases yet.)",commonSteps:"Common steps:",useCase:"Use case: ",functions:"Functions: ",pre:"Preconditions: ",appendix:"APPENDIX",sumTitle:"Test results summary",sumHead:["Module","Test cases","Passed","Failed","Blocked","Skipped","Not run","Pass rate"],total:"Total",matrix:"Function \u2013 test suite matrix",matrixHead:["No.","Function / screen (BA document)","Test suite"]}},fg=["I","II","III","IV","V","VI"],ia=e=>String(e??"").split(`
5685
+ `).map(t=>t.replace(/^\s*[-*+]\s+/,"").trimEnd()).filter(t=>t.trim());JE=(e,t)=>{let n=/^(\d{4})-(\d{2})-(\d{2})/.exec(e??"");return n&&t==="vi"?`${n[3]}/${n[2]}/${n[1]}`:e??""};Et=e=>e.replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t]);ra={style:Gr.SINGLE,size:4,color:"555555"},bg={top:ra,bottom:ra,left:ra,right:ra},ZE=[Ys.HEADING_1,Ys.HEADING_2,Ys.HEADING_3];Qr="exports",Nc=["docx","html"],e_=e=>e.normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/Đ/g,"D").replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)||"tai-lieu-kiem-thu"});function kg(e){return e==="mixed"?["vi","en"]:[e]}function Pc(e){let t=[];for(let n of kg(e))for(let r of t_)for(let i of yg[n][r])t.push({kind:r,keyword:i});return t.sort((n,r)=>r.keyword.length-n.keyword.length)}function Oc(e){let t=[r_];for(let n of kg(e))for(let r of n_)t.push(...yg[n][r]);return t.sort((n,r)=>r.length-n.length)}function o_(e,t){for(let{kind:n,keyword:r}of t){let i=`${r}:`;if(e.startsWith(i))return{kind:n,keyword:r,title:e.slice(i.length).trim()}}return null}function l_(e,t){for(let n of t){let r=`${n} `;if(!e.startsWith(r))continue;let i=e.slice(r.length).trim();if(i)return{keyword:n,text:i}}return null}function c_(e){return e.trim().split(/\s+/).filter(t=>t.startsWith("@"))}function d_(e,t){let n=e.find(s=>s.trim()!=="");if(!n)return"mixed";let r=n.trim().match(i_);if(!r)return"mixed";let i=r[1].toLowerCase();if(i!=="vi"&&i!=="en")throw new Error(`Unsupported Gherkin language "${r[1]}" in ${t} (supported: vi, en)`);return i}function xg(e){if(!e.startsWith("|"))return null;let t=e.split("|");return t.length<2?null:t.slice(1,t.at(-1)?.trim()===""?-1:void 0).map(r=>r.trim())}function Tg(e){return e.length>0?e[e.length-1]:null}function p_(e,t){let n=Tg(e);n&&(n.dataTable||(n.dataTable=[]),n.dataTable.push(t))}function u_(e,t){let n=Tg(e);n&&(n.docString=t)}function h_(e,t){let{scenario:n,startLine:r,endLine:i}=e;return n.lineRange={start:r,end:i},n.rawBlock=t.slice(r-1,i).join(`
5686
+ `),n}function Sg(e,t){let n=e.split(/\r?\n/),r=d_(n,t),i=s_[r],s=a_[r],a=[],o="",c=[],l=[],u=[],d=0,p=null,h="none",f,m=[],g=!1,x=[],T=null;function b(){return h==="background"?c:h==="ruleBackground"?m:p&&h==="scenario"?p.scenario.ownSteps:null}let C=new Map;function A(){if(!p)return;let w=h_(p,n);C.set(w,[...p.ruleBackgroundSteps]),l.push(w),p=null}for(let w=0;w<n.length;w+=1){let y=n[w],v=w+1,_=y.trim();if(!_)continue;if(g){_==='"""'?(T&&u_(T,x.join(`
5687
+ `)),g=!1,x=[],T=null):x.push(y),p&&(p.endLine=v);continue}if(_.startsWith("@")){u.length===0&&(d=v),u.push(...c_(y));continue}if(_.startsWith("#"))continue;let N=o_(_,i);if(N){switch(N.kind){case"feature":A(),a=[...u],o=N.title,f=void 0,m=[],h="none";break;case"background":A(),h=f!==void 0?"ruleBackground":"background";break;case"rule":A(),f=N.title,m=[],h="none";break;case"scenario":case"scenarioOutline":{A();let F=u.length>0?d:v;p={startLine:F,endLine:v,ruleBackgroundSteps:[...m],scenario:{tags:[...u],title:N.title,keyword:N.keyword,isOutline:N.kind==="scenarioOutline",rule:f,steps:[],ownSteps:[],examples:[],rawBlock:"",lineRange:{start:F,end:v}}},h="scenario";break}case"examples":p&&(p.scenario.examples.push({keyword:N.keyword,headers:[],rows:[]}),p.endLine=v,h="examples");break}u=[];continue}let M=l_(_,s);if(M){h==="background"?c.push(M):h==="ruleBackground"?m.push(M):p&&(p.scenario.ownSteps.push(M),p.endLine=v,h="scenario");continue}if(h==="examples"&&p){let F=xg(_);if(F){let Q=p.scenario.examples[p.scenario.examples.length-1];Q.headers.length===0?Q.headers=F:Q.rows.push(F),p.endLine=v;continue}}if(_==='"""'){let F=b();if(F&&F.length>0){g=!0,x=[],T=F,p&&(p.endLine=v);continue}}let O=xg(_);if(O){let F=b();if(F){p_(F,O),p&&(p.endLine=v);continue}}p&&(p.endLine=v)}A();for(let w of l){let y=C.get(w)??[];w.steps=[...c,...y,...w.ownSteps]}return{filePath:t,language:r,featureTags:a,featureTitle:o,backgroundSteps:c,scenarios:l}}var yg,t_,n_,r_,i_,s_,a_,Cg=Se(()=>{"use strict";S();yg={vi:{feature:["T\xEDnh n\u0103ng"],background:["B\u1ED1i c\u1EA3nh"],rule:["Quy t\u1EAFc"],scenario:["T\xECnh hu\u1ED1ng","K\u1ECBch b\u1EA3n"],scenarioOutline:["Khung t\xECnh hu\u1ED1ng","Khung k\u1ECBch b\u1EA3n","K\u1ECBch b\u1EA3n m\u1EABu"],examples:["D\u1EEF li\u1EC7u","V\xED d\u1EE5"],given:["Bi\u1EBFt","Cho"],when:["Khi"],then:["Th\xEC"],and:["V\xE0"],but:["Nh\u01B0ng"]},en:{feature:["Feature"],background:["Background"],rule:["Rule"],scenario:["Scenario","Example"],scenarioOutline:["Scenario Outline","Scenario Template"],examples:["Examples","Scenarios"],given:["Given"],when:["When"],then:["Then"],and:["And"],but:["But"]}},t_=["feature","background","rule","scenario","scenarioOutline","examples"],n_=["given","when","then","and","but"],r_="*",i_=/^#\s*language\s*:\s*(.+?)\s*$/;s_={vi:Pc("vi"),en:Pc("en"),mixed:Pc("mixed")},a_={vi:Oc("vi"),en:Oc("en"),mixed:Oc("mixed")}});function Eg(e){let t=[];_g(e.suites??[],t);let n=0,r=0,i=0,s=0;for(let a of t)a.status==="skipped"?s++:a.flaky?i++:a.status==="passed"?n++:r++;return{passed:n,failed:r,flaky:i,skipped:s,specs:t}}function _g(e,t,n=""){for(let r of e){let i=r.file??n;for(let s of r.specs??[])t.push(m_(s,s.file??i));r.suites&&_g(r.suites,t,i)}}function m_(e,t){let n=e.tests??[],r="skipped",i=!1,s=0,a;for(let o of n){let c=o.results??[];for(let u of c)s+=Number(u.duration??0)||0;let l=o.status;if(l==="flaky")i=!0,r="passed";else if(l==="expected")r="passed";else if(l==="unexpected")r="failed";else if(l==="skipped")r="skipped";else{let u=c[c.length-1]?.status;r=u==="passed"?"passed":u==="skipped"?"skipped":u?"failed":r}if(!a){let u=c.find(p=>p.error?.message||p.errors&&p.errors[0]?.message),d=u?.error?.message??u?.errors?.[0]?.message;d&&(a=f_(d).split(`
5356
5688
  `).slice(0,4).join(`
5357
- `))}}return{title:e.title??"(untitled)",file:t,tags:(e.tags??[]).map(o=>o.startsWith("@")?o:`@${o}`),status:r,flaky:i,durationMs:s,errorText:a}}function fA(e){return e.replace(/\u001b\[[0-9;]*[a-zA-Z]/g,"")}var _g=Se(()=>{"use strict";S()});var Mc={};ii(Mc,{applyRunResults:()=>Dc,featureFiles:()=>wA,importFeature:()=>Lc,parseRunResults:()=>la,readRunResults:()=>yA,scenarioTag:()=>Ng,scenarioToCase:()=>Ig});import ei from"node:fs";import Rc from"node:path";function Ng(e,t=[]){let n=new Set(t.map(r=>r.toLowerCase()));return e.find(r=>!/^@p\d+$/i.test(r)&&!/^@domain-/i.test(r)&&!n.has(r.toLowerCase())&&!/^@(guide-video|flake|skip|wip|manual)$/i.test(r))}function Pg(e){let t=e.text;return e.dataTable?.length&&(t+=" "+e.dataTable.map(n=>n.join(" | ")).join("; ")),e.docString&&(t+=" \xAB"+e.docString.trim().replace(/\s+/g," ").slice(0,200)+"\xBB"),t}function Ig(e){let t=[],n=[],r="do";for(let a of e.ownSteps){let o=a.keyword.trim();vA.test(o)?r="expect":(gA.test(o)||bA.test(o))&&(r="do"),(r==="expect"?n:t).push(Pg(a))}let i=t.map((a,o)=>`B${o+1}: ${a}`),s=e.examples.reduce((a,o)=>a+o.rows.length,0);return e.isOutline&&s&&i.push(`(Ch\u1EA1y v\u1EDBi ${s} b\u1ED9 d\u1EEF li\u1EC7u: ${e.examples[0].headers.join(", ")})`),{steps:i.join(`
5689
+ `))}}return{title:e.title??"(untitled)",file:t,tags:(e.tags??[]).map(o=>o.startsWith("@")?o:`@${o}`),status:r,flaky:i,durationMs:s,errorText:a}}function f_(e){return e.replace(/\u001b\[[0-9;]*[a-zA-Z]/g,"")}var Ag=Se(()=>{"use strict";S()});var Dc={};ii(Dc,{applyRunResults:()=>Mc,featureFiles:()=>w_,importFeature:()=>Lc,parseRunResults:()=>la,readRunResults:()=>x_,scenarioTag:()=>Ng,scenarioToCase:()=>Pg});import ei from"node:fs";import Rc from"node:path";function Ng(e,t=[]){let n=new Set(t.map(r=>r.toLowerCase()));return e.find(r=>!/^@p\d+$/i.test(r)&&!/^@domain-/i.test(r)&&!n.has(r.toLowerCase())&&!/^@(guide-video|flake|skip|wip|manual)$/i.test(r))}function Ig(e){let t=e.text;return e.dataTable?.length&&(t+=" "+e.dataTable.map(n=>n.join(" | ")).join("; ")),e.docString&&(t+=" \xAB"+e.docString.trim().replace(/\s+/g," ").slice(0,200)+"\xBB"),t}function Pg(e){let t=[],n=[],r="do";for(let a of e.ownSteps){let o=a.keyword.trim();v_.test(o)?r="expect":(g_.test(o)||b_.test(o))&&(r="do"),(r==="expect"?n:t).push(Ig(a))}let i=t.map((a,o)=>`B${o+1}: ${a}`),s=e.examples.reduce((a,o)=>a+o.rows.length,0);return e.isOutline&&s&&i.push(`(Ch\u1EA1y v\u1EDBi ${s} b\u1ED9 d\u1EEF li\u1EC7u: ${e.examples[0].headers.join(", ")})`),{steps:i.join(`
5358
5690
  `),expected:n.join(`
5359
- `)}}function Lc(e,t,n){let r=ms(e,n.module),i=Sg(t,n.file);if(!i.featureTitle&&!i.scenarios.length)throw new K(U(`${n.file}: kh\xF4ng th\u1EA5y \xABT\xEDnh n\u0103ng:\xBB / \xABFeature:\xBB hay k\u1ECBch b\u1EA3n n\xE0o.`,`${n.file}: no \xABFeature:\xBB / \xABT\xEDnh n\u0103ng:\xBB or scenarios found.`));let s=n.by??vt(e.root),a=us(e,n.avoid),o=e.suites.find(d=>d.source===n.file&&d.status!=="deleted"),c=!o;if(o)i.featureTitle&&(o.title=i.featureTitle);else{let d=mn("KB",r.code,a);a.add(d),o={code:d,module:r.code,title:i.featureTitle||Rc.basename(n.file,".feature"),kind:"functional",status:"drafting",covers:[],useCases:[],owner:s,created:{by:s,at:new Date().toISOString().replace(/\.\d{3}Z$/,"Z")},source:n.file,description:"",cases:[],file:""},e.suites.push(o)}i.backgroundSteps.length&&(o.preconditions=i.backgroundSteps.map(Pg).join("; "));let l={suite:o.code,created:c,added:[],updated:[],missing:[],untagged:0},u=new Set;for(let d of i.scenarios){let p=Ng(d.tags,i.featureTags);p||l.untagged++;let{steps:h,expected:f}=Ig(d),m=o.cases.filter(y=>!y.deleted),g=p?m.find(y=>y.tag?.toLowerCase()===p.toLowerCase()):m.find(y=>!y.tag&&y.case===d.title);if(g)g.case=d.title,g.steps=h,g.expected=f,u.add(g.code),l.updated.push(g.code);else{let y=mn("TC",r.code,a);a.add(y);let T={code:y,case:d.title,steps:h,expected:f,...p?{tag:p}:{}};o.cases.push(T),u.add(y),l.added.push(y)}}return l.missing=o.cases.filter(d=>!d.deleted&&d.tag&&!u.has(d.code)).map(d=>d.code),ze(e.root,o),c&&vr(e,r.code,{suites:[...en(e,r.code).map(d=>d.code).filter(d=>d!==o.code),o.code]}),l}function wA(e){let t=[],n=r=>{for(let i of ei.readdirSync(r,{withFileTypes:!0})){if(i.name.startsWith(".")||i.name==="node_modules")continue;let s=Rc.join(r,i.name);i.isDirectory()?n(s):i.name.endsWith(".feature")&&t.push(s)}};return n(e),t.sort()}function yA(e){let t=ei.existsSync(e)&&ei.statSync(e).isDirectory()?Rc.join(e,"results.json"):e;if(!ei.existsSync(t))throw new K(U(`Kh\xF4ng th\u1EA5y ${t} \u2014 c\u1EA7n results.json c\u1EE7a l\u1EA7n ch\u1EA1y pan-test (Playwright JSON reporter).`,`${t} not found \u2014 need the results.json of a pan-test run (Playwright JSON reporter).`));return la(ei.readFileSync(t,"utf8"))}function la(e){let t;try{t=JSON.parse(e)}catch{throw new K(U("results.json kh\xF4ng ph\u1EA3i JSON h\u1EE3p l\u1EC7.","results.json is not valid JSON."))}return Eg(t).specs}function Dc(e,t,n={}){let r=new Map;for(let c of t)for(let l of c.tags)r.set(l.toLowerCase(),[...r.get(l.toLowerCase())??[],c]);let i={applied:[],notRun:[],unknownTags:[]},s=new Set,a=n.at??new Date().toISOString().slice(0,10);for(let c of e.suites){if(c.status==="deleted")continue;let l=!1;for(let u of c.cases){if(u.deleted||!u.tag)continue;let d=u.tag.toLowerCase();s.add(d);let p=r.get(d);if(!p?.length){i.notRun.push(u.code);continue}let h=p.filter(g=>g.status==="failed"),f=h.length?"failed":p.every(g=>g.status==="skipped")?"skipped":"passed",m=h.length?(h.map(g=>g.errorText).find(Boolean)??"K\u1ECBch b\u1EA3n t\u1EF1 \u0111\u1ED9ng kh\xF4ng \u0111\u1EA1t.").slice(0,600):void 0;u.result={status:f,by:n.by??"pan-test",at:a,...m?{actual:m}:{},...n.env?{env:n.env}:{}},i.applied.push({code:u.code,status:f}),l=!0}l&&ze(e.root,c)}let o=/^@(p\d+|domain-.*|guide-video|flake|skip|wip)$/i;return i.unknownTags=[...r.keys()].filter(c=>!s.has(c)&&!o.test(c)).sort(),i}var gA,bA,vA,ti=Se(()=>{"use strict";S();qn();Cg();_g();fn();wr();_n();gA=/^(given|cho|biết)$/i,bA=/^(when|khi)$/i,vA=/^(then|thì)$/i});import{spawn as Og}from"node:child_process";import xA from"node:http";import kA from"node:path";function Rg(e){let t=process.env.PAN_CLI_JS?.trim();return t?{file:process.execPath,args:[t,...e],shell:!1}:{file:"pan",args:e,shell:process.platform==="win32"}}function Lg(e,t){return new Promise(n=>{let r=Rg(e),i="",s="",a;try{a=Og(r.file,r.args,{cwd:t,env:process.env,stdio:["ignore","pipe","pipe"],shell:r.shell,windowsHide:!0})}catch(o){n({code:null,json:null,stderr:o.message});return}a.stdout.on("data",o=>{i+=o.toString("utf8")}),a.stderr.on("data",o=>{s=(s+o.toString("utf8")).slice(-4e3)}),a.on("error",o=>n({code:null,json:null,stderr:o.message})),a.on("close",o=>{let c=null;for(let l of i.trim().split(`
5360
- `).reverse())if(l.trim().startsWith("{"))try{c=JSON.parse(l);break}catch{}n({code:o,json:c,stderr:s})})})}function SA(e,t){let n=pn.get(e);if(n)return n;let r=new Promise((i,s)=>{let a=TA(e,t),o=Og(a.file,a.args,{cwd:e,env:process.env,stdio:["pipe","pipe","pipe"],shell:a.shell,windowsHide:!0}),c="",l="",u=setTimeout(()=>{o.kill(),s(new Error("PAN_AI_HOST_TIMEOUT"))},3e4);o.stdout.on("data",d=>{c+=d.toString("utf8");for(let p of c.split(`
5361
- `))if(p.trim().startsWith("{"))try{let h=JSON.parse(p);if(h.event==="listening"&&h.url&&h.token){clearTimeout(u),i({url:new URL(h.url),token:h.token,child:o});return}}catch{}}),o.stderr.on("data",d=>{l=(l+d.toString("utf8")).slice(-2e3)}),o.on("error",d=>{clearTimeout(u),pn.delete(e),s(d)}),o.on("exit",d=>{clearTimeout(u),pn.delete(e),s(new Error(`PAN_AI_HOST_EXIT ${d} ${l.slice(-400)}`))})});return pn.set(e,r),r.catch(()=>pn.delete(e)),r}function Dg(){for(let e of pn.values())e.then(t=>{try{t.child.stdin.end()}catch{}}).catch(()=>{});pn.clear()}function Mg(e,t){let n=e.config.language==="en",r=Ve(e.root,e.config.ba),i=t?e.suites.find(c=>c.code===t||c.cases.some(l=>l.code===t)):void 0,s=t&&i?i.cases.find(c=>c.code===t):void 0,a=n?["You are an assistant working DIRECTLY in a test-case document repo (Pan Test, `.pantest.yaml`) in the current folder \u2014 the tester has the app open.","Rules:","- Change content ONLY through commands so codes stay unique and results are kept: `pan test module add`, `pan test new <MOD> --title \u2026 --covers CN-\u2026,SCR-\u2026`, `pan test case add <KB-\u2026> --case \u2026 --steps \u2026 --expected \u2026`, `pan test case edit <TC-\u2026> \u2026`, `pan test case rm <TC-\u2026> --reason \u2026`. Never hand-edit the ```yaml pt:cases``` blocks; never invent or renumber codes.","- Test cases: happy path first, then validation (each required field, formats, limits), permissions, edge cases from the business rules. Steps = user actions on the screen (\xABB1: \u2026\xBB, \xABB2: \u2026\xBB); expected = what the user sees (quote message text from the BA doc).","- Read the BA document (read-only) for the covered functions / screens. Do NOT invent behaviour it does not state \u2014 write \xAB[To confirm]\xBB.","- Do NOT set results (`pan test result`) unless the user says the test was run.","- When done run `pan test check`; fix errors. No commit, no push. Keys and enum values stay English.","- If the user must choose: end the answer with a ```pan-choices block (\xAB? question\xBB, then \xAB- option\xBB lines, max 5).","- Answer SHORT in English: what you added / changed (by code), what still needs a decision."]:["B\u1EA1n l\xE0 tr\u1EE3 l\xFD l\xE0m vi\u1EC7c TR\u1EF0C TI\u1EBEP trong repo t\xE0i li\u1EC7u k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED (Pan Test, `.pantest.yaml`) \u1EDF th\u01B0 m\u1EE5c hi\u1EC7n t\u1EA1i \u2014 tester \u0111ang m\u1EDF app.","Lu\u1EADt:","- S\u1EEDa n\u1ED9i dung CH\u1EC8 b\u1EB1ng l\u1EC7nh \u0111\u1EC3 m\xE3 kh\xF4ng tr\xF9ng v\xE0 k\u1EBFt qu\u1EA3 kh\xF4ng m\u1EA5t: `pan test module add`, `pan test new <PH> --title \u2026 --covers CN-\u2026,SCR-\u2026`, `pan test case add <KB-\u2026> --case \u2026 --steps \u2026 --expected \u2026`, `pan test case edit <TC-\u2026> \u2026`, `pan test case rm <TC-\u2026> --reason \u2026`. Kh\xF4ng s\u1EEDa tay kh\u1ED1i ```yaml pt:cases```; kh\xF4ng b\u1ECBa / \u0111\xE1nh l\u1EA1i m\xE3.","- T\xECnh hu\u1ED1ng: lu\u1ED3ng \u0111\xFAng tr\u01B0\u1EDBc, r\u1ED3i ki\u1EC3m tra d\u1EEF li\u1EC7u (t\u1EEBng tr\u01B0\u1EDDng b\u1EAFt bu\u1ED9c, \u0111\u1ECBnh d\u1EA1ng, gi\u1EDBi h\u1EA1n), ph\xE2n quy\u1EC1n, tr\u01B0\u1EDDng h\u1EE3p bi\xEAn theo quy t\u1EAFc nghi\u1EC7p v\u1EE5. C\xE1c b\u01B0\u1EDBc = thao t\xE1c ng\u01B0\u1EDDi d\xF9ng tr\xEAn m\xE0n (\xABB1: \u2026\xBB, \xABB2: \u2026\xBB); k\u1EBFt qu\u1EA3 mong \u0111\u1EE3i = \u0111i\u1EC1u ng\u01B0\u1EDDi d\xF9ng th\u1EA5y (th\xF4ng b\xE1o tr\xEDch nguy\xEAn v\u0103n t\xE0i li\u1EC7u BA trong \xAB\u2026\xBB).","- \u0110\u1ECDc t\xE0i li\u1EC7u BA (ch\u1EC9 \u0111\u1ECDc) cho ch\u1EE9c n\u0103ng / m\xE0n \u0111\u01B0\u1EE3c ph\u1EE7. KH\xD4NG b\u1ECBa nghi\u1EC7p v\u1EE5 t\xE0i li\u1EC7u BA kh\xF4ng n\xF3i \u2014 ghi \xAB[C\u1EA7n x\xE1c nh\u1EADn]\xBB.","- KH\xD4NG ghi k\u1EBFt qu\u1EA3 (`pan test result`) tr\u1EEB khi ng\u01B0\u1EDDi d\xF9ng n\xF3i \u0111\xE3 ch\u1EA1y test.","- Xong ch\u1EA1y `pan test check`; c\xF2n l\u1ED7i th\xEC s\u1EEDa. Kh\xF4ng commit, kh\xF4ng push. Kho\xE1 v\xE0 gi\xE1 tr\u1ECB enum gi\u1EEF ti\u1EBFng Anh.","- C\u1EA7n ng\u01B0\u1EDDi d\xF9ng ch\u1ECDn: k\u1EBFt th\xFAc c\xE2u tr\u1EA3 l\u1EDDi b\u1EB1ng kh\u1ED1i ```pan-choices (d\xF2ng \u0111\u1EA7u \xAB? c\xE2u h\u1ECFi\xBB, m\u1ED7i l\u1EF1a ch\u1ECDn m\u1ED9t d\xF2ng \xAB- \u2026\xBB, t\u1ED1i \u0111a 5).","- Tr\u1EA3 l\u1EDDi NG\u1EAEN b\u1EB1ng ti\u1EBFng Vi\u1EC7t: \u0111\xE3 th\xEAm / s\u1EEDa g\xEC (theo m\xE3), c\xF2n g\xEC c\u1EA7n quy\u1EBFt."],o=[`${n?"Document":"T\xE0i li\u1EC7u"}: \xAB${e.config.title}\xBB (${e.suites.length} ${n?"suites":"k\u1ECBch b\u1EA3n"}, ${e.suites.reduce((c,l)=>c+l.cases.length,0)} ${n?"cases":"t\xECnh hu\u1ED1ng"})`,r?`${n?"BA document repo (read-only)":"Repo t\xE0i li\u1EC7u BA (ch\u1EC9 \u0111\u1ECDc)"}: ${r}`:"",i?`${n?"Selected suite":"K\u1ECBch b\u1EA3n \u0111ang ch\u1ECDn"}: ${i.code} \xAB${i.title}\xBB${i.covers.length?` (covers ${i.covers.join(", ")})`:""} \u2014 ${i.file}`:"",s?`${n?"Selected case":"T\xECnh hu\u1ED1ng \u0111ang ch\u1ECDn"}: ${s.code} \xAB${s.case}\xBB`:""].filter(Boolean).join(`
5691
+ `)}}function Lc(e,t,n){let r=ms(e,n.module),i=Sg(t,n.file);if(!i.featureTitle&&!i.scenarios.length)throw new K(U(`${n.file}: kh\xF4ng th\u1EA5y \xABT\xEDnh n\u0103ng:\xBB / \xABFeature:\xBB hay k\u1ECBch b\u1EA3n n\xE0o.`,`${n.file}: no \xABFeature:\xBB / \xABT\xEDnh n\u0103ng:\xBB or scenarios found.`));let s=n.by??vt(e.root),a=us(e,n.avoid),o=e.suites.find(d=>d.source===n.file&&d.status!=="deleted"),c=!o;if(o)i.featureTitle&&(o.title=i.featureTitle);else{let d=mn("KB",r.code,a);a.add(d),o={code:d,module:r.code,title:i.featureTitle||Rc.basename(n.file,".feature"),kind:"functional",status:"drafting",covers:[],useCases:[],owner:s,created:{by:s,at:new Date().toISOString().replace(/\.\d{3}Z$/,"Z")},source:n.file,description:"",cases:[],file:""},e.suites.push(o)}i.backgroundSteps.length&&(o.preconditions=i.backgroundSteps.map(Ig).join("; "));let l={suite:o.code,created:c,added:[],updated:[],missing:[],untagged:0},u=new Set;for(let d of i.scenarios){let p=Ng(d.tags,i.featureTags);p||l.untagged++;let{steps:h,expected:f}=Pg(d),m=o.cases.filter(x=>!x.deleted),g=p?m.find(x=>x.tag?.toLowerCase()===p.toLowerCase()):m.find(x=>!x.tag&&x.case===d.title);if(g)g.case=d.title,g.steps=h,g.expected=f,u.add(g.code),l.updated.push(g.code);else{let x=mn("TC",r.code,a);a.add(x);let T={code:x,case:d.title,steps:h,expected:f,...p?{tag:p}:{}};o.cases.push(T),u.add(x),l.added.push(x)}}return l.missing=o.cases.filter(d=>!d.deleted&&d.tag&&!u.has(d.code)).map(d=>d.code),ze(e.root,o),c&&vr(e,r.code,{suites:[...en(e,r.code).map(d=>d.code).filter(d=>d!==o.code),o.code]}),l}function w_(e){let t=[],n=r=>{for(let i of ei.readdirSync(r,{withFileTypes:!0})){if(i.name.startsWith(".")||i.name==="node_modules")continue;let s=Rc.join(r,i.name);i.isDirectory()?n(s):i.name.endsWith(".feature")&&t.push(s)}};return n(e),t.sort()}function x_(e){let t=ei.existsSync(e)&&ei.statSync(e).isDirectory()?Rc.join(e,"results.json"):e;if(!ei.existsSync(t))throw new K(U(`Kh\xF4ng th\u1EA5y ${t} \u2014 c\u1EA7n results.json c\u1EE7a l\u1EA7n ch\u1EA1y pan-test (Playwright JSON reporter).`,`${t} not found \u2014 need the results.json of a pan-test run (Playwright JSON reporter).`));return la(ei.readFileSync(t,"utf8"))}function la(e){let t;try{t=JSON.parse(e)}catch{throw new K(U("results.json kh\xF4ng ph\u1EA3i JSON h\u1EE3p l\u1EC7.","results.json is not valid JSON."))}return Eg(t).specs}function Mc(e,t,n={}){let r=new Map;for(let c of t)for(let l of c.tags)r.set(l.toLowerCase(),[...r.get(l.toLowerCase())??[],c]);let i={applied:[],notRun:[],unknownTags:[]},s=new Set,a=n.at??new Date().toISOString().slice(0,10);for(let c of e.suites){if(c.status==="deleted")continue;let l=!1;for(let u of c.cases){if(u.deleted||!u.tag)continue;let d=u.tag.toLowerCase();s.add(d);let p=r.get(d);if(!p?.length){i.notRun.push(u.code);continue}let h=p.filter(g=>g.status==="failed"),f=h.length?"failed":p.every(g=>g.status==="skipped")?"skipped":"passed",m=h.length?(h.map(g=>g.errorText).find(Boolean)??"K\u1ECBch b\u1EA3n t\u1EF1 \u0111\u1ED9ng kh\xF4ng \u0111\u1EA1t.").slice(0,600):void 0;u.result={status:f,by:n.by??"pan-test",at:a,...m?{actual:m}:{},...n.env?{env:n.env}:{}},i.applied.push({code:u.code,status:f}),l=!0}l&&ze(e.root,c)}let o=/^@(p\d+|domain-.*|guide-video|flake|skip|wip)$/i;return i.unknownTags=[...r.keys()].filter(c=>!s.has(c)&&!o.test(c)).sort(),i}var g_,b_,v_,ti=Se(()=>{"use strict";S();qn();Cg();Ag();fn();wr();An();g_=/^(given|cho|biết)$/i,b_=/^(when|khi)$/i,v_=/^(then|thì)$/i});import{spawn as Og}from"node:child_process";import y_ from"node:http";import k_ from"node:path";function Rg(e){let t=process.env.PAN_CLI_JS?.trim();return t?{file:process.execPath,args:[t,...e],shell:!1}:{file:"pan",args:e,shell:process.platform==="win32"}}function Lg(e,t){return new Promise(n=>{let r=Rg(e),i="",s="",a;try{a=Og(r.file,r.args,{cwd:t,env:process.env,stdio:["ignore","pipe","pipe"],shell:r.shell,windowsHide:!0})}catch(o){n({code:null,json:null,stderr:o.message});return}a.stdout.on("data",o=>{i+=o.toString("utf8")}),a.stderr.on("data",o=>{s=(s+o.toString("utf8")).slice(-4e3)}),a.on("error",o=>n({code:null,json:null,stderr:o.message})),a.on("close",o=>{let c=null;for(let l of i.trim().split(`
5692
+ `).reverse())if(l.trim().startsWith("{"))try{c=JSON.parse(l);break}catch{}n({code:o,json:c,stderr:s})})})}function S_(e,t){let n=pn.get(e);if(n)return n;let r=new Promise((i,s)=>{let a=T_(e,t),o=Og(a.file,a.args,{cwd:e,env:process.env,stdio:["pipe","pipe","pipe"],shell:a.shell,windowsHide:!0}),c="",l="",u=setTimeout(()=>{o.kill(),s(new Error("PAN_AI_HOST_TIMEOUT"))},3e4);o.stdout.on("data",d=>{c+=d.toString("utf8");for(let p of c.split(`
5693
+ `))if(p.trim().startsWith("{"))try{let h=JSON.parse(p);if(h.event==="listening"&&h.url&&h.token){clearTimeout(u),i({url:new URL(h.url),token:h.token,child:o});return}}catch{}}),o.stderr.on("data",d=>{l=(l+d.toString("utf8")).slice(-2e3)}),o.on("error",d=>{clearTimeout(u),pn.delete(e),s(d)}),o.on("exit",d=>{clearTimeout(u),pn.delete(e),s(new Error(`PAN_AI_HOST_EXIT ${d} ${l.slice(-400)}`))})});return pn.set(e,r),r.catch(()=>pn.delete(e)),r}function Mg(){for(let e of pn.values())e.then(t=>{try{t.child.stdin.end()}catch{}}).catch(()=>{});pn.clear()}function Dg(e,t){let n=e.config.language==="en",r=Ve(e.root,e.config.ba),i=t?e.suites.find(c=>c.code===t||c.cases.some(l=>l.code===t)):void 0,s=t&&i?i.cases.find(c=>c.code===t):void 0,a=n?["You are an assistant working DIRECTLY in a test-case document repo (Pan Test, `.pantest.yaml`) in the current folder \u2014 the tester has the app open.","Rules:","- Change content ONLY through commands so codes stay unique and results are kept: `pan test module add`, `pan test new <MOD> --title \u2026 --covers CN-\u2026,SCR-\u2026`, `pan test case add <KB-\u2026> --case \u2026 --steps \u2026 --expected \u2026`, `pan test case edit <TC-\u2026> \u2026`, `pan test case rm <TC-\u2026> --reason \u2026`. Never hand-edit the ```yaml pt:cases``` blocks; never invent or renumber codes.","- Test cases: happy path first, then validation (each required field, formats, limits), permissions, edge cases from the business rules. Steps = user actions on the screen (\xABB1: \u2026\xBB, \xABB2: \u2026\xBB); expected = what the user sees (quote message text from the BA doc).","- Read the BA document (read-only) for the covered functions / screens. Do NOT invent behaviour it does not state \u2014 write \xAB[To confirm]\xBB.","- Do NOT set results (`pan test result`) unless the user says the test was run.","- When done run `pan test check`; fix errors. No commit, no push. Keys and enum values stay English.","- If the user must choose: end the answer with a ```pan-choices block (\xAB? question\xBB, then \xAB- option\xBB lines, max 5).","- Answer SHORT in English: what you added / changed (by code), what still needs a decision."]:["B\u1EA1n l\xE0 tr\u1EE3 l\xFD l\xE0m vi\u1EC7c TR\u1EF0C TI\u1EBEP trong repo t\xE0i li\u1EC7u k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED (Pan Test, `.pantest.yaml`) \u1EDF th\u01B0 m\u1EE5c hi\u1EC7n t\u1EA1i \u2014 tester \u0111ang m\u1EDF app.","Lu\u1EADt:","- S\u1EEDa n\u1ED9i dung CH\u1EC8 b\u1EB1ng l\u1EC7nh \u0111\u1EC3 m\xE3 kh\xF4ng tr\xF9ng v\xE0 k\u1EBFt qu\u1EA3 kh\xF4ng m\u1EA5t: `pan test module add`, `pan test new <PH> --title \u2026 --covers CN-\u2026,SCR-\u2026`, `pan test case add <KB-\u2026> --case \u2026 --steps \u2026 --expected \u2026`, `pan test case edit <TC-\u2026> \u2026`, `pan test case rm <TC-\u2026> --reason \u2026`. Kh\xF4ng s\u1EEDa tay kh\u1ED1i ```yaml pt:cases```; kh\xF4ng b\u1ECBa / \u0111\xE1nh l\u1EA1i m\xE3.","- T\xECnh hu\u1ED1ng: lu\u1ED3ng \u0111\xFAng tr\u01B0\u1EDBc, r\u1ED3i ki\u1EC3m tra d\u1EEF li\u1EC7u (t\u1EEBng tr\u01B0\u1EDDng b\u1EAFt bu\u1ED9c, \u0111\u1ECBnh d\u1EA1ng, gi\u1EDBi h\u1EA1n), ph\xE2n quy\u1EC1n, tr\u01B0\u1EDDng h\u1EE3p bi\xEAn theo quy t\u1EAFc nghi\u1EC7p v\u1EE5. C\xE1c b\u01B0\u1EDBc = thao t\xE1c ng\u01B0\u1EDDi d\xF9ng tr\xEAn m\xE0n (\xABB1: \u2026\xBB, \xABB2: \u2026\xBB); k\u1EBFt qu\u1EA3 mong \u0111\u1EE3i = \u0111i\u1EC1u ng\u01B0\u1EDDi d\xF9ng th\u1EA5y (th\xF4ng b\xE1o tr\xEDch nguy\xEAn v\u0103n t\xE0i li\u1EC7u BA trong \xAB\u2026\xBB).","- \u0110\u1ECDc t\xE0i li\u1EC7u BA (ch\u1EC9 \u0111\u1ECDc) cho ch\u1EE9c n\u0103ng / m\xE0n \u0111\u01B0\u1EE3c ph\u1EE7. KH\xD4NG b\u1ECBa nghi\u1EC7p v\u1EE5 t\xE0i li\u1EC7u BA kh\xF4ng n\xF3i \u2014 ghi \xAB[C\u1EA7n x\xE1c nh\u1EADn]\xBB.","- KH\xD4NG ghi k\u1EBFt qu\u1EA3 (`pan test result`) tr\u1EEB khi ng\u01B0\u1EDDi d\xF9ng n\xF3i \u0111\xE3 ch\u1EA1y test.","- Xong ch\u1EA1y `pan test check`; c\xF2n l\u1ED7i th\xEC s\u1EEDa. Kh\xF4ng commit, kh\xF4ng push. Kho\xE1 v\xE0 gi\xE1 tr\u1ECB enum gi\u1EEF ti\u1EBFng Anh.","- C\u1EA7n ng\u01B0\u1EDDi d\xF9ng ch\u1ECDn: k\u1EBFt th\xFAc c\xE2u tr\u1EA3 l\u1EDDi b\u1EB1ng kh\u1ED1i ```pan-choices (d\xF2ng \u0111\u1EA7u \xAB? c\xE2u h\u1ECFi\xBB, m\u1ED7i l\u1EF1a ch\u1ECDn m\u1ED9t d\xF2ng \xAB- \u2026\xBB, t\u1ED1i \u0111a 5).","- Tr\u1EA3 l\u1EDDi NG\u1EAEN b\u1EB1ng ti\u1EBFng Vi\u1EC7t: \u0111\xE3 th\xEAm / s\u1EEDa g\xEC (theo m\xE3), c\xF2n g\xEC c\u1EA7n quy\u1EBFt."],o=[`${n?"Document":"T\xE0i li\u1EC7u"}: \xAB${e.config.title}\xBB (${e.suites.length} ${n?"suites":"k\u1ECBch b\u1EA3n"}, ${e.suites.reduce((c,l)=>c+l.cases.length,0)} ${n?"cases":"t\xECnh hu\u1ED1ng"})`,r?`${n?"BA document repo (read-only)":"Repo t\xE0i li\u1EC7u BA (ch\u1EC9 \u0111\u1ECDc)"}: ${r}`:"",i?`${n?"Selected suite":"K\u1ECBch b\u1EA3n \u0111ang ch\u1ECDn"}: ${i.code} \xAB${i.title}\xBB${i.covers.length?` (covers ${i.covers.join(", ")})`:""} \u2014 ${i.file}`:"",s?`${n?"Selected case":"T\xECnh hu\u1ED1ng \u0111ang ch\u1ECDn"}: ${s.code} \xAB${s.case}\xBB`:""].filter(Boolean).join(`
5362
5694
  `);return{system:[...a,"",(n?`Context:
5363
5695
  `:`Ng\u1EEF c\u1EA3nh:
5364
5696
  `)+o].join(`
5365
- `),addDirs:r?[kA.resolve(r)]:[]}}async function Bc(e,t,n,r,i,s){let a=await SA(e,t),o=s===void 0?void 0:Buffer.from(JSON.stringify(s));await new Promise((c,l)=>{let u=xA.request({host:a.url.hostname,port:a.url.port,path:i,method:s===void 0?"GET":"POST",headers:{"x-pan-ai-token":a.token,...o?{"content-type":"application/json","content-length":String(o.length)}:{}}},d=>{r.writeHead(d.statusCode??502,{"Content-Type":String(d.headers["content-type"]||"application/json; charset=utf-8"),"Cache-Control":"no-store","X-Content-Type-Options":"nosniff"}),d.pipe(r),d.on("end",c)});u.on("error",l),n.on("close",()=>u.destroy()),u.end(o)})}var pn,TA,Bg=Se(()=>{"use strict";S();Nn();pn=new Map;TA=(e,t)=>Rg(["ai-host","--dir",e,"--lang",t,"--lifeline"])});var Wg={};ii(Wg,{CSP:()=>qc,VIEW_CSP:()=>Fc,createDocServer:()=>PA,embedSources:()=>Ug});import{randomBytes as CA,timingSafeEqual as EA}from"node:crypto";import $c from"node:fs";import AA from"node:http";import ut from"node:path";import{fileURLToPath as _A}from"node:url";function Fg(e){if(typeof R<"u"&&R[e]!==void 0)return R[e];for(let t of[ut.join($g,"ui"),ut.join($g,"..","..","src","doc","ui")]){let n=ut.join(t,ca[e].file);if($c.existsSync(n))return $c.readFileSync(n,"utf8")}throw new Error(`Thi\u1EBFu t\u1EC7p giao di\u1EC7n ${e}`)}function jg(e){let t=Ve(e.root,e.config.ba);return t?bt(t):null}function NA(e){let t=jg(e);return{root:e.root,me:vt(e.root),config:e.config,modules:e.modules,suites:e.suites,readErrors:e.readErrors,ba:t?{linked:!0,items:[...t.values()].filter(n=>!n.deleted&&(n.type==="function"||n.type==="screen")).map(n=>({code:n.code,title:n.title,type:n.type}))}:{linked:!1,path:e.config.ba??null,items:[]},summary:Pn(e,t)}}function Hg(e){let t={};for(let n of["case","steps","expected","requirement","tag"])ee(e[n])!==void 0&&(t[n]=ee(e[n]));return ee(e.priority)!==void 0&&(t.priority=ee(e.priority)),t}function PA(e){let t=ls(e.start);if(!t)throw new K(U(`Kh\xF4ng th\u1EA5y repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED (.pantest.yaml) t\u1EEB ${ut.resolve(e.start)}. T\u1EA1o b\u1EB1ng: pan-test doc init`,`No test document repo (.pantest.yaml) found from ${ut.resolve(e.start)}. Create one with: pan-test doc init`));let n=e.token??CA(24).toString("hex"),r=Ug(e.embed),i=r.length?qc.replace("frame-ancestors 'none'",`frame-ancestors ${r.join(" ")}`):qc,s=d=>({status:200,body:d}),a=r.length?Fc.replace("frame-ancestors 'self'",`frame-ancestors 'self' ${r.join(" ")}`):Fc,o={"/api/export":async(d,p)=>{let h=(Array.isArray(d.formats)?d.formats:["docx"]).map(String).filter(m=>Nc.includes(m)),f=await Pc(p,{formats:h.length?h:["docx"],results:d.results===!0,codes:d.codes===!0});return s({ok:!0,dir:ut.join(p.root,Qr),files:f.map(m=>ut.relative(p.root,m).split(ut.sep).join("/"))})},"/api/open":async(d,p)=>{let h=ut.join(p.root,Qr);$c.mkdirSync(h,{recursive:!0});let{spawn:f}=await import("node:child_process"),m=process.platform==="darwin"?"open":process.platform==="win32"?"explorer":"xdg-open";try{f(m,[h],{stdio:"ignore",detached:!0,windowsHide:!0}).unref()}catch{}return s({ok:!0,dir:h})}},c={"/api/module/new":(d,p)=>s(hs(p,String(d.code??"").trim().toUpperCase(),String(d.title??"").trim())),"/api/module":(d,p)=>s(vr(p,String(d.code),{...ee(d.title)!==void 0?{title:ee(d.title)}:{},...ee(d.commonSteps)!==void 0?{commonSteps:ee(d.commonSteps)}:{}})),"/api/suite/new":(d,p)=>s(fs(p,{module:String(d.module),title:String(d.title??""),...d.kind==="non-functional"?{kind:"non-functional"}:{},...Fn(d.covers)?{covers:Fn(d.covers)}:{},...ee(d.after)?{after:ee(d.after)}:{},avoid:Ft(p.root)})),"/api/suite":(d,p)=>{let h={};for(let f of["title","preconditions","description","owner"])ee(d[f])!==void 0&&(h[f]=ee(d[f]));return(d.kind==="functional"||d.kind==="non-functional")&&(h.kind=d.kind),(d.status==="drafting"||d.status==="done"||d.status==="deleted")&&(h.status=d.status),ee(d.priority)!==void 0&&(h.priority=ee(d.priority)),Fn(d.covers)&&(h.covers=Fn(d.covers)),Fn(d.useCases)&&(h.useCases=Fn(d.useCases)),s(zu(p,String(d.code),h))},"/api/case/new":(d,p)=>s(gs(p,String(d.suite),{case:"",...Hg(d)},{...ee(d.after)?{after:ee(d.after)}:{},avoid:Ft(p.root)})),"/api/case":(d,p)=>s(vs(p,String(d.code),Hg(d))),"/api/import/feature":(d,p)=>{let h=Array.isArray(d.files)?d.files:[];if(!h.length)throw new K(U("Ch\u01B0a ch\u1ECDn t\u1EC7p .feature n\xE0o.","No .feature file selected."));let f=Ft(p.root);return s({ok:!0,reports:h.map(m=>({name:String(m.name??""),...Lc(p,String(m.content??""),{file:String(m.name??"feature.feature"),module:String(d.module),avoid:f})}))})},"/api/results":(d,p)=>s({ok:!0,...Dc(p,la(String(d.content??"")),{...ee(d.env)?{env:ee(d.env)}:{}})}),"/api/case/move":(d,p)=>s(Vu(p,String(d.code),d.dir===-1?-1:1)),"/api/case/delete":(d,p)=>s(ws(p,String(d.code),ee(d.reason)??"")),"/api/result":(d,p)=>s(ys(p,String(d.code),{status:String(d.status),...ee(d.actual)!==void 0?{actual:ee(d.actual)}:{},...ee(d.env)!==void 0?{env:ee(d.env)}:{},...ee(d.bug)!==void 0?{bug:ee(d.bug)}:{}}))},l=()=>({status:404,body:{}}),u=AA.createServer((d,p)=>{let h=(b,C,_)=>{p.writeHead(b,{"Content-Type":_,"X-Content-Type-Options":"nosniff","Referrer-Policy":"no-referrer","Cache-Control":"no-store","Content-Security-Policy":i}),p.end(d.method==="HEAD"?void 0:C)},f=(b,C)=>h(b,JSON.stringify(C),"application/json; charset=utf-8"),m=b=>f(b instanceof K?400:500,{ok:!1,error:b.message}),g=b=>{if(p.headersSent){p.end();return}let C=U("C\u1EA7n Pan CLI (@pan-stack/cli \u2265 0.3.90) \u0111\u1EC3 d\xF9ng Tr\u1EE3 l\xFD AI: ","Pan CLI (@pan-stack/cli \u2265 0.3.90) is needed for the AI assistant: ")+b.message;T==="/api/ai"?f(200,{engines:[],max:0,runs:[],error:C}):f(503,{ok:!1,error:C})},y=b=>{Lg(["test",b,"--dir",t,"--json"],t).then(C=>{if(C.json)return f(C.json.ok===!1?400:200,C.json);let _=U("C\u1EA7n Pan CLI (@pan-stack/cli \u2265 0.3.91) \u0111\u1EC3 ph\xE1t h\xE0nh l\xEAn Pan Studio: ","Pan CLI (@pan-stack/cli \u2265 0.3.91) is needed to publish to Pan Studio: ")+(C.stderr.trim().slice(-300)||`exit ${C.code}`);return b==="studio"?f(200,{ok:!0,login:!1,cli:!1,error:_}):f(503,{ok:!1,error:_})}).catch(m)},T=(()=>{try{return new URL(d.url||"/","http://x").pathname}catch{return""}})();try{let b=u.address()?.port,C=String(d.headers.host||""),_=[`127.0.0.1:${b}`,`localhost:${b}`];if(!_.includes(C))return f(403,{error:"Host kh\xF4ng h\u1EE3p l\u1EC7"});let w=new URL(d.url||"/",`http://${C}`),x=w.pathname,v=x==="/api/ai"||x.startsWith("/api/ai/");if(d.method==="POST"){let N=c[x]??o[x]??(v||x.startsWith("/api/studio/")?l:void 0);if(!N)return f(404,{error:"Kh\xF4ng c\xF3"});let D=String(d.headers.origin||"");if(D&&!_.some(V=>D===`http://${V}`))return f(403,{error:"Origin kh\xF4ng h\u1EE3p l\u1EC7"});let O=Buffer.from(String(d.headers["x-pan-test-token"]||"")),F=Buffer.from(n);if(O.length!==F.length||!EA(O,F))return f(403,{error:"Thi\u1EBFu token phi\xEAn"});if(!String(d.headers["content-type"]||"").startsWith("application/json"))return f(415,{error:"C\u1EA7n application/json"});let Q=[],Z=0;d.on("data",V=>{Z+=V.length,Z>qg?(f(413,{error:"Qu\xE1 l\u1EDBn"}),d.destroy()):Q.push(V)}),d.on("end",()=>{if(Z>qg)return;let V;try{V=JSON.parse(Buffer.concat(Q).toString("utf8")||"{}")}catch{return f(400,{error:"JSON sai"})}if(x==="/api/studio/publish"||x==="/api/studio/remove"){y(x==="/api/studio/publish"?"publish":"unpublish");return}if(N===l){let G=Ge(t),de=x==="/api/ai/run"?{...V,...Mg(G,ee(V.item))}:V;Bc(t,G.config.language,d,p,x,de).catch(g);return}Promise.resolve().then(()=>{let G=Ge(t);return un(G.config.language),N(V,G)}).then(G=>f(G.status,G.body)).catch(m)});return}if(d.method!=="GET"&&d.method!=="HEAD")return f(405,{error:"Ch\u1EC9 cho GET/POST"});if(x==="/api/studio"){y("studio");return}if(v){let N=Ge(t);Bc(t,N.config.language,d,p,x+w.search).catch(g);return}if(x==="/"||x==="/index.html"){let N=w.searchParams.get("lang")||e.lang||Ge(t).config.language,D=Fg("index.html").replace(/<head[^>]*>/,O=>`${O}<meta name="pantest-token" content="${n}"><meta name="panba-lang" content="${N==="en"?"en":"vi"}">`);return h(200,D,ca["index.html"].type)}let A=/^\/ui\/([a-z0-9.]+)$/.exec(x);if(A&&ca[A[1]])return h(200,Fg(A[1]),ca[A[1]].type);if(x==="/favicon.ico")return h(204,"","image/x-icon");if(x==="/api/index")return f(200,NA(Ge(t)));if(x==="/view/doc"){let N=oa(aa(Ge(t),{results:w.searchParams.get("results")==="1",codes:w.searchParams.get("codes")==="1"}));return p.writeHead(200,{"Content-Type":"text/html; charset=utf-8","X-Content-Type-Options":"nosniff","Referrer-Policy":"no-referrer","Cache-Control":"no-store","Content-Security-Policy":a}),p.end(d.method==="HEAD"?void 0:N)}if(x==="/api/check"){let N=Ge(t);return f(200,{findings:xs(N,jg(N))})}return f(404,{error:"Kh\xF4ng c\xF3"})}catch(b){return m(b)}});return u.on("close",()=>Dg()),Object.assign(u,{token:n,root:t})}var $g,ca,Fc,qc,qg,Ug,ee,Fn,Kg=Se(()=>{"use strict";S();qn();Nn();xr();wr();ti();Zr();_n();Bg();$g=ut.dirname(_A(import.meta.url)),ca={"index.html":{file:"index.html",type:"text/html; charset=utf-8"},"tokens.css":{file:"tokens.css",type:"text/css; charset=utf-8"},"shell.js":{file:"shell.browser.js",type:"text/javascript; charset=utf-8"},"i18n.js":{file:"i18n.browser.js",type:"text/javascript; charset=utf-8"},"app.js":{file:"app.browser.js",type:"text/javascript; charset=utf-8"},"assist.js":{file:"assist.browser.js",type:"text/javascript; charset=utf-8"},"edit.js":{file:"edit.browser.js",type:"text/javascript; charset=utf-8"}};Fc="default-src 'none'; style-src 'unsafe-inline'; img-src 'self' data:; base-uri 'none'; form-action 'none'; frame-ancestors 'self'",qc="default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; connect-src 'self'; font-src 'self'; frame-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'",qg=24*1024*1024,Ug=e=>(e??[]).filter(t=>/^[a-z][a-z0-9+.-]*:$/.test(t)||/^https?:\/\/[A-Za-z0-9.-]+(:\d+)?$/.test(t)),ee=e=>typeof e=="string"?e:void 0,Fn=e=>Array.isArray(e)?e.map(String).map(t=>t.trim()).filter(Boolean):void 0});var Vg={};ii(Vg,{buildBundle:()=>RA});function OA(e,t,n){let r=Jr[n],i=yr(e,tn()),s=[`# ${e.code} \xB7 ${e.title}`,""],a=[e.covers.length?`- ${r.functions}${e.covers.join(", ")}`:"",e.useCases.length?`- ${r.useCase}${e.useCases.join(", ")}`:"",e.preconditions?`- ${r.pre}${e.preconditions.replace(/\n+/g," ")}`:"",`- ${r.sumHead[2]}: ${i.passed}/${i.total} \xB7 ${r.sumHead[3]}: ${i.failed} \xB7 ${r.sumHead[6]}: ${i["not-run"]}`].filter(Boolean);s.push(...a,""),e.description.trim()&&s.push(e.description.trim(),"");let o=t.modules.find(l=>l.code===e.module);o?.commonSteps.trim()&&s.push(`**${r.commonSteps}**`,"",o.commonSteps.trim(),"");let c=sa(e,{results:!0,codes:!0},r,n);if(!c.rows.length)s.push(r.noCases,"");else{s.push("| "+c.head.join(" | ")+" |","|"+c.head.map(()=>" --- |").join(""));for(let l of c.rows)s.push("| "+l.map(IA).join(" | ")+" |");s.push("")}return s.join(`
5366
- `)}function RA(e){let t=e.config.language==="en"?"en":"vi",n=Jr[t],r=Ve(e.root,e.config.ba),i=Pn(e,r?bt(r):null),s={},a=[`# ${t==="en"?"Generated by \xABpan test publish\xBB \u2014 do not edit; the test document repo is the source.":"Sinh b\u1EDFi \xABpan test publish\xBB \u2014 \u0111\u1EEBng s\u1EEDa tay; ngu\u1ED3n l\xE0 repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED."}`,`title: ${De(e.config.title)}`,`locale: ${t}`,"theme: classic","layout: document","sections:"],o=n.sumHead,c=i.modules.map(h=>[`${h.code} \xB7 ${h.title}`,h.count.total,h.count.passed,h.count.failed,h.count.blocked,h.count.skipped,h.count["not-run"],zg(h.count.passed,h.count.total)]);c.push([`**${n.total}**`,i.all.total,i.all.passed,i.all.failed,i.all.blocked,i.all.skipped,i.all["not-run"],zg(i.all.passed,i.all.total)]),s["content/tong-hop/tong-hop.md"]=[`# ${n.sumTitle}`,"","| "+o.join(" | ")+" |","|"+o.map(()=>" --- |").join(""),...c.map(h=>"| "+h.join(" | ")+" |"),"",...i.coverage?[`${t==="en"?"BA function coverage":"\u0110\u1ED9 ph\u1EE7 ch\u1EE9c n\u0103ng t\xE0i li\u1EC7u BA"}: ${i.coverage.covered}/${i.coverage.functions}`,""]:[]].join(`
5367
- `),a.push(` - id: ${De("tong-hop")}`,` title: ${De(n.sumTitle)}`," lessons:",` - id: ${De("tong-hop")}`,` title: ${De(n.sumTitle)}`," type: article",` src: ${De("content/tong-hop/tong-hop.md")}`);let l=1,u=new Set(["tong-hop"]),d=h=>{let f=h;for(let m=2;u.has(f);m++)f=`${h}-${m}`;return u.add(f),f};return[...e.modules].sort((h,f)=>h.order-f.order).forEach((h,f)=>{let m=e.suites.filter(y=>y.module===h.code&&y.status!=="deleted").sort((y,T)=>(h.suites.indexOf(y.code)+1||1e9)-(h.suites.indexOf(T.code)+1||1e9)||y.code.localeCompare(T.code));if(!m.length)return;let g=d(Gg(h.code));a.push(` - id: ${De(g)}`,` title: ${De(`${f+1}. ${h.title}`)}`," lessons:");for(let y of m){let T=d(Gg(y.code)),b=`content/${g}/${T}.md`;s[b]=OA(y,e,t),a.push(` - id: ${De(T)}`,` title: ${De(`${y.code} \xB7 ${y.title}`)}`," type: article",` src: ${De(b)}`,` code: ${De(y.code)}`,` module: ${De(h.code)}`),l++}}),s["handover.yaml"]=a.join(`
5697
+ `),addDirs:r?[k_.resolve(r)]:[]}}async function Bc(e,t,n,r,i,s){let a=await S_(e,t),o=s===void 0?void 0:Buffer.from(JSON.stringify(s));await new Promise((c,l)=>{let u=y_.request({host:a.url.hostname,port:a.url.port,path:i,method:s===void 0?"GET":"POST",headers:{"x-pan-ai-token":a.token,...o?{"content-type":"application/json","content-length":String(o.length)}:{}}},d=>{r.writeHead(d.statusCode??502,{"Content-Type":String(d.headers["content-type"]||"application/json; charset=utf-8"),"Cache-Control":"no-store","X-Content-Type-Options":"nosniff"}),d.pipe(r),d.on("end",c)});u.on("error",l),n.on("close",()=>u.destroy()),u.end(o)})}var pn,T_,Bg=Se(()=>{"use strict";S();Nn();pn=new Map;T_=(e,t)=>Rg(["ai-host","--dir",e,"--lang",t,"--lifeline"])});var Wg={};ii(Wg,{CSP:()=>qc,VIEW_CSP:()=>Fc,createDocServer:()=>I_,embedSources:()=>Ug});import{randomBytes as C_,timingSafeEqual as E_}from"node:crypto";import $c from"node:fs";import __ from"node:http";import ut from"node:path";import{fileURLToPath as A_}from"node:url";function Fg(e){if(typeof R<"u"&&R[e]!==void 0)return R[e];for(let t of[ut.join($g,"ui"),ut.join($g,"..","..","src","doc","ui")]){let n=ut.join(t,ca[e].file);if($c.existsSync(n))return $c.readFileSync(n,"utf8")}throw new Error(`Thi\u1EBFu t\u1EC7p giao di\u1EC7n ${e}`)}function jg(e){let t=Ve(e.root,e.config.ba);return t?bt(t):null}function N_(e){let t=jg(e);return{root:e.root,me:vt(e.root),config:e.config,modules:e.modules,suites:e.suites,readErrors:e.readErrors,ba:t?{linked:!0,items:[...t.values()].filter(n=>!n.deleted&&(n.type==="function"||n.type==="screen")).map(n=>({code:n.code,title:n.title,type:n.type}))}:{linked:!1,path:e.config.ba??null,items:[]},summary:In(e,t)}}function Hg(e){let t={};for(let n of["case","steps","expected","requirement","tag"])ee(e[n])!==void 0&&(t[n]=ee(e[n]));return ee(e.priority)!==void 0&&(t.priority=ee(e.priority)),t}function I_(e){let t=ls(e.start);if(!t)throw new K(U(`Kh\xF4ng th\u1EA5y repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED (.pantest.yaml) t\u1EEB ${ut.resolve(e.start)}. T\u1EA1o b\u1EB1ng: pan-test doc init`,`No test document repo (.pantest.yaml) found from ${ut.resolve(e.start)}. Create one with: pan-test doc init`));let n=e.token??C_(24).toString("hex"),r=Ug(e.embed),i=r.length?qc.replace("frame-ancestors 'none'",`frame-ancestors ${r.join(" ")}`):qc,s=d=>({status:200,body:d}),a=r.length?Fc.replace("frame-ancestors 'self'",`frame-ancestors 'self' ${r.join(" ")}`):Fc,o={"/api/export":async(d,p)=>{let h=(Array.isArray(d.formats)?d.formats:["docx"]).map(String).filter(m=>Nc.includes(m)),f=await Ic(p,{formats:h.length?h:["docx"],results:d.results===!0,codes:d.codes===!0});return s({ok:!0,dir:ut.join(p.root,Qr),files:f.map(m=>ut.relative(p.root,m).split(ut.sep).join("/"))})},"/api/open":async(d,p)=>{let h=ut.join(p.root,Qr);$c.mkdirSync(h,{recursive:!0});let{spawn:f}=await import("node:child_process"),m=process.platform==="darwin"?"open":process.platform==="win32"?"explorer":"xdg-open";try{f(m,[h],{stdio:"ignore",detached:!0,windowsHide:!0}).unref()}catch{}return s({ok:!0,dir:h})}},c={"/api/module/new":(d,p)=>s(hs(p,String(d.code??"").trim().toUpperCase(),String(d.title??"").trim())),"/api/module":(d,p)=>s(vr(p,String(d.code),{...ee(d.title)!==void 0?{title:ee(d.title)}:{},...ee(d.commonSteps)!==void 0?{commonSteps:ee(d.commonSteps)}:{}})),"/api/suite/new":(d,p)=>s(fs(p,{module:String(d.module),title:String(d.title??""),...d.kind==="non-functional"?{kind:"non-functional"}:{},...Fn(d.covers)?{covers:Fn(d.covers)}:{},...ee(d.after)?{after:ee(d.after)}:{},avoid:Ft(p.root)})),"/api/suite":(d,p)=>{let h={};for(let f of["title","preconditions","description","owner"])ee(d[f])!==void 0&&(h[f]=ee(d[f]));return(d.kind==="functional"||d.kind==="non-functional")&&(h.kind=d.kind),(d.status==="drafting"||d.status==="done"||d.status==="deleted")&&(h.status=d.status),ee(d.priority)!==void 0&&(h.priority=ee(d.priority)),Fn(d.covers)&&(h.covers=Fn(d.covers)),Fn(d.useCases)&&(h.useCases=Fn(d.useCases)),s(zu(p,String(d.code),h))},"/api/case/new":(d,p)=>s(gs(p,String(d.suite),{case:"",...Hg(d)},{...ee(d.after)?{after:ee(d.after)}:{},avoid:Ft(p.root)})),"/api/case":(d,p)=>s(vs(p,String(d.code),Hg(d))),"/api/import/feature":(d,p)=>{let h=Array.isArray(d.files)?d.files:[];if(!h.length)throw new K(U("Ch\u01B0a ch\u1ECDn t\u1EC7p .feature n\xE0o.","No .feature file selected."));let f=Ft(p.root);return s({ok:!0,reports:h.map(m=>({name:String(m.name??""),...Lc(p,String(m.content??""),{file:String(m.name??"feature.feature"),module:String(d.module),avoid:f})}))})},"/api/results":(d,p)=>s({ok:!0,...Mc(p,la(String(d.content??"")),{...ee(d.env)?{env:ee(d.env)}:{}})}),"/api/case/move":(d,p)=>s(Vu(p,String(d.code),d.dir===-1?-1:1)),"/api/case/delete":(d,p)=>s(ws(p,String(d.code),ee(d.reason)??"")),"/api/result":(d,p)=>s(xs(p,String(d.code),{status:String(d.status),...ee(d.actual)!==void 0?{actual:ee(d.actual)}:{},...ee(d.env)!==void 0?{env:ee(d.env)}:{},...ee(d.bug)!==void 0?{bug:ee(d.bug)}:{}}))},l=()=>({status:404,body:{}}),u=__.createServer((d,p)=>{let h=(b,C,A)=>{p.writeHead(b,{"Content-Type":A,"X-Content-Type-Options":"nosniff","Referrer-Policy":"no-referrer","Cache-Control":"no-store","Content-Security-Policy":i}),p.end(d.method==="HEAD"?void 0:C)},f=(b,C)=>h(b,JSON.stringify(C),"application/json; charset=utf-8"),m=b=>f(b instanceof K?400:500,{ok:!1,error:b.message}),g=b=>{if(p.headersSent){p.end();return}let C=U("C\u1EA7n Pan CLI (@pan-stack/cli \u2265 0.3.90) \u0111\u1EC3 d\xF9ng Tr\u1EE3 l\xFD AI: ","Pan CLI (@pan-stack/cli \u2265 0.3.90) is needed for the AI assistant: ")+b.message;T==="/api/ai"?f(200,{engines:[],max:0,runs:[],error:C}):f(503,{ok:!1,error:C})},x=b=>{Lg(["test",b,"--dir",t,"--json"],t).then(C=>{if(C.json)return f(C.json.ok===!1?400:200,C.json);let A=U("C\u1EA7n Pan CLI (@pan-stack/cli \u2265 0.3.91) \u0111\u1EC3 ph\xE1t h\xE0nh l\xEAn Pan Studio: ","Pan CLI (@pan-stack/cli \u2265 0.3.91) is needed to publish to Pan Studio: ")+(C.stderr.trim().slice(-300)||`exit ${C.code}`);return b==="studio"?f(200,{ok:!0,login:!1,cli:!1,error:A}):f(503,{ok:!1,error:A})}).catch(m)},T=(()=>{try{return new URL(d.url||"/","http://x").pathname}catch{return""}})();try{let b=u.address()?.port,C=String(d.headers.host||""),A=[`127.0.0.1:${b}`,`localhost:${b}`];if(!A.includes(C))return f(403,{error:"Host kh\xF4ng h\u1EE3p l\u1EC7"});let w=new URL(d.url||"/",`http://${C}`),y=w.pathname,v=y==="/api/ai"||y.startsWith("/api/ai/");if(d.method==="POST"){let N=c[y]??o[y]??(v||y.startsWith("/api/studio/")?l:void 0);if(!N)return f(404,{error:"Kh\xF4ng c\xF3"});let M=String(d.headers.origin||"");if(M&&!A.some(V=>M===`http://${V}`))return f(403,{error:"Origin kh\xF4ng h\u1EE3p l\u1EC7"});let O=Buffer.from(String(d.headers["x-pan-test-token"]||"")),F=Buffer.from(n);if(O.length!==F.length||!E_(O,F))return f(403,{error:"Thi\u1EBFu token phi\xEAn"});if(!String(d.headers["content-type"]||"").startsWith("application/json"))return f(415,{error:"C\u1EA7n application/json"});let Q=[],Z=0;d.on("data",V=>{Z+=V.length,Z>qg?(f(413,{error:"Qu\xE1 l\u1EDBn"}),d.destroy()):Q.push(V)}),d.on("end",()=>{if(Z>qg)return;let V;try{V=JSON.parse(Buffer.concat(Q).toString("utf8")||"{}")}catch{return f(400,{error:"JSON sai"})}if(y==="/api/studio/publish"||y==="/api/studio/remove"){x(y==="/api/studio/publish"?"publish":"unpublish");return}if(N===l){let G=Ge(t),de=y==="/api/ai/run"?{...V,...Dg(G,ee(V.item))}:V;Bc(t,G.config.language,d,p,y,de).catch(g);return}Promise.resolve().then(()=>{let G=Ge(t);return un(G.config.language),N(V,G)}).then(G=>f(G.status,G.body)).catch(m)});return}if(d.method!=="GET"&&d.method!=="HEAD")return f(405,{error:"Ch\u1EC9 cho GET/POST"});if(y==="/api/studio"){x("studio");return}if(v){let N=Ge(t);Bc(t,N.config.language,d,p,y+w.search).catch(g);return}if(y==="/"||y==="/index.html"){let N=w.searchParams.get("lang")||e.lang||Ge(t).config.language,M=Fg("index.html").replace(/<head[^>]*>/,O=>`${O}<meta name="pantest-token" content="${n}"><meta name="panba-lang" content="${N==="en"?"en":"vi"}">`);return h(200,M,ca["index.html"].type)}let _=/^\/ui\/([a-z0-9.]+)$/.exec(y);if(_&&ca[_[1]])return h(200,Fg(_[1]),ca[_[1]].type);if(y==="/favicon.ico")return h(204,"","image/x-icon");if(y==="/api/index")return f(200,N_(Ge(t)));if(y==="/view/doc"){let N=oa(aa(Ge(t),{results:w.searchParams.get("results")==="1",codes:w.searchParams.get("codes")==="1"}));return p.writeHead(200,{"Content-Type":"text/html; charset=utf-8","X-Content-Type-Options":"nosniff","Referrer-Policy":"no-referrer","Cache-Control":"no-store","Content-Security-Policy":a}),p.end(d.method==="HEAD"?void 0:N)}if(y==="/api/check"){let N=Ge(t);return f(200,{findings:ys(N,jg(N))})}return f(404,{error:"Kh\xF4ng c\xF3"})}catch(b){return m(b)}});return u.on("close",()=>Mg()),Object.assign(u,{token:n,root:t})}var $g,ca,Fc,qc,qg,Ug,ee,Fn,Kg=Se(()=>{"use strict";S();qn();Nn();yr();wr();ti();Zr();An();Bg();$g=ut.dirname(A_(import.meta.url)),ca={"index.html":{file:"index.html",type:"text/html; charset=utf-8"},"tokens.css":{file:"tokens.css",type:"text/css; charset=utf-8"},"shell.js":{file:"shell.browser.js",type:"text/javascript; charset=utf-8"},"i18n.js":{file:"i18n.browser.js",type:"text/javascript; charset=utf-8"},"app.js":{file:"app.browser.js",type:"text/javascript; charset=utf-8"},"assist.js":{file:"assist.browser.js",type:"text/javascript; charset=utf-8"},"edit.js":{file:"edit.browser.js",type:"text/javascript; charset=utf-8"}};Fc="default-src 'none'; style-src 'unsafe-inline'; img-src 'self' data:; base-uri 'none'; form-action 'none'; frame-ancestors 'self'",qc="default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; connect-src 'self'; font-src 'self'; frame-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'",qg=24*1024*1024,Ug=e=>(e??[]).filter(t=>/^[a-z][a-z0-9+.-]*:$/.test(t)||/^https?:\/\/[A-Za-z0-9.-]+(:\d+)?$/.test(t)),ee=e=>typeof e=="string"?e:void 0,Fn=e=>Array.isArray(e)?e.map(String).map(t=>t.trim()).filter(Boolean):void 0});var Vg={};ii(Vg,{buildBundle:()=>R_});function O_(e,t,n){let r=Jr[n],i=xr(e,tn()),s=[`# ${e.code} \xB7 ${e.title}`,""],a=[e.covers.length?`- ${r.functions}${e.covers.join(", ")}`:"",e.useCases.length?`- ${r.useCase}${e.useCases.join(", ")}`:"",e.preconditions?`- ${r.pre}${e.preconditions.replace(/\n+/g," ")}`:"",`- ${r.sumHead[2]}: ${i.passed}/${i.total} \xB7 ${r.sumHead[3]}: ${i.failed} \xB7 ${r.sumHead[6]}: ${i["not-run"]}`].filter(Boolean);s.push(...a,""),e.description.trim()&&s.push(e.description.trim(),"");let o=t.modules.find(l=>l.code===e.module);o?.commonSteps.trim()&&s.push(`**${r.commonSteps}**`,"",o.commonSteps.trim(),"");let c=sa(e,{results:!0,codes:!0},r,n);if(!c.rows.length)s.push(r.noCases,"");else{s.push("| "+c.head.join(" | ")+" |","|"+c.head.map(()=>" --- |").join(""));for(let l of c.rows)s.push("| "+l.map(P_).join(" | ")+" |");s.push("")}return s.join(`
5698
+ `)}function R_(e){let t=e.config.language==="en"?"en":"vi",n=Jr[t],r=Ve(e.root,e.config.ba),i=In(e,r?bt(r):null),s={},a=[`# ${t==="en"?"Generated by \xABpan test publish\xBB \u2014 do not edit; the test document repo is the source.":"Sinh b\u1EDFi \xABpan test publish\xBB \u2014 \u0111\u1EEBng s\u1EEDa tay; ngu\u1ED3n l\xE0 repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED."}`,`title: ${Me(e.config.title)}`,`locale: ${t}`,"theme: classic","layout: document","sections:"],o=n.sumHead,c=i.modules.map(h=>[`${h.code} \xB7 ${h.title}`,h.count.total,h.count.passed,h.count.failed,h.count.blocked,h.count.skipped,h.count["not-run"],zg(h.count.passed,h.count.total)]);c.push([`**${n.total}**`,i.all.total,i.all.passed,i.all.failed,i.all.blocked,i.all.skipped,i.all["not-run"],zg(i.all.passed,i.all.total)]),s["content/tong-hop/tong-hop.md"]=[`# ${n.sumTitle}`,"","| "+o.join(" | ")+" |","|"+o.map(()=>" --- |").join(""),...c.map(h=>"| "+h.join(" | ")+" |"),"",...i.coverage?[`${t==="en"?"BA function coverage":"\u0110\u1ED9 ph\u1EE7 ch\u1EE9c n\u0103ng t\xE0i li\u1EC7u BA"}: ${i.coverage.covered}/${i.coverage.functions}`,""]:[]].join(`
5699
+ `),a.push(` - id: ${Me("tong-hop")}`,` title: ${Me(n.sumTitle)}`," lessons:",` - id: ${Me("tong-hop")}`,` title: ${Me(n.sumTitle)}`," type: article",` src: ${Me("content/tong-hop/tong-hop.md")}`);let l=1,u=new Set(["tong-hop"]),d=h=>{let f=h;for(let m=2;u.has(f);m++)f=`${h}-${m}`;return u.add(f),f};return[...e.modules].sort((h,f)=>h.order-f.order).forEach((h,f)=>{let m=e.suites.filter(x=>x.module===h.code&&x.status!=="deleted").sort((x,T)=>(h.suites.indexOf(x.code)+1||1e9)-(h.suites.indexOf(T.code)+1||1e9)||x.code.localeCompare(T.code));if(!m.length)return;let g=d(Gg(h.code));a.push(` - id: ${Me(g)}`,` title: ${Me(`${f+1}. ${h.title}`)}`," lessons:");for(let x of m){let T=d(Gg(x.code)),b=`content/${g}/${T}.md`;s[b]=O_(x,e,t),a.push(` - id: ${Me(T)}`,` title: ${Me(`${x.code} \xB7 ${x.title}`)}`," type: article",` src: ${Me(b)}`,` code: ${Me(x.code)}`,` module: ${Me(h.code)}`),l++}}),s["handover.yaml"]=a.join(`
5368
5700
  `)+`
5369
- `,{title:e.config.title,language:t,ba:r,lessons:l,files:s}}var De,Gg,IA,zg,Xg=Se(()=>{"use strict";S();Nn();xr();Zr();De=e=>JSON.stringify(e),Gg=e=>e.normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/Đ/g,"D").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"muc",IA=e=>e.map(t=>t.replace(/\|/g,"\\|")).join("<br>")||" ",zg=(e,t)=>t?`${Math.round(e/t*100)}%`:"\u2014"});S();S();qn();import da from"node:fs";import At from"node:path";S();si();fn();_n();Nn();wr();xr();Zr();ti();var LA=`pan-test doc \u2014 t\xE0i li\u1EC7u k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED
5701
+ `,{title:e.config.title,language:t,ba:r,lessons:l,files:s}}var Me,Gg,P_,zg,Xg=Se(()=>{"use strict";S();Nn();yr();Zr();Me=e=>JSON.stringify(e),Gg=e=>e.normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/Đ/g,"D").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"muc",P_=e=>e.map(t=>t.replace(/\|/g,"\\|")).join("<br>")||" ",zg=(e,t)=>t?`${Math.round(e/t*100)}%`:"\u2014"});S();S();qn();import da from"node:fs";import _t from"node:path";S();si();fn();An();Nn();wr();yr();Zr();ti();var L_=`pan-test doc \u2014 t\xE0i li\u1EC7u k\u1ECBch b\u1EA3n ki\u1EC3m th\u1EED
5370
5702
 
5371
5703
  doc init [th\u01B0 m\u1EE5c] --title <t\xEAn> [--ba <\u0111\u01B0\u1EDDng d\u1EABn repo BA>] [--lang vi|en]
5372
5704
  doc module add <PH> --title <t\xEAn>
@@ -5387,7 +5719,7 @@ th,td{border:1px solid #555;padding:4px 6px;vertical-align:top;text-align:left;o
5387
5719
  xu\u1EA5t t\xE0i li\u1EC7u (m\u1EB7c \u0111\u1ECBnh: b\u1EA3n b\xE0n giao DOCX v\xE0o exports/); --results k\xE8m k\u1EBFt qu\u1EA3 test
5388
5720
  doc ui [--port <n>] [--no-open] [--json] [--lang vi|en] m\u1EDF app so\u1EA1n t\xE0i li\u1EC7u ki\u1EC3m th\u1EED tr\xEAn tr\xECnh duy\u1EC7t
5389
5721
 
5390
- Chung: --dir <repo> (m\u1EB7c \u0111\u1ECBnh: th\u01B0 m\u1EE5c hi\u1EC7n t\u1EA1i, d\xF2 ng\u01B0\u1EE3c l\xEAn t\u1EDBi .pantest.yaml)`,DA=`pan-test doc \u2014 test case documents
5722
+ Chung: --dir <repo> (m\u1EB7c \u0111\u1ECBnh: th\u01B0 m\u1EE5c hi\u1EC7n t\u1EA1i, d\xF2 ng\u01B0\u1EE3c l\xEAn t\u1EDBi .pantest.yaml)`,M_=`pan-test doc \u2014 test case documents
5391
5723
 
5392
5724
  doc init [dir] --title <name> [--ba <BA repo path>] [--lang vi|en]
5393
5725
  doc module add <MOD> --title <name>
@@ -5404,21 +5736,21 @@ th,td{border:1px solid #555;padding:4px 6px;vertical-align:top;text-align:left;o
5404
5736
  doc list [--json] \xB7 doc check [--json] \xB7 doc summary [--json] \xB7 doc bundle (JSON for \xABpan test publish\xBB)
5405
5737
  doc ui [--port <n>] [--no-open] [--json] [--lang vi|en] open the test document app
5406
5738
 
5407
- Common: --dir <repo> (default: current folder, searching up to .pantest.yaml)`,Yg=()=>U(LA,DA);function MA(e){let t=[],n={};for(let r=0;r<e.length;r++){let i=e[r];if(i.startsWith("--")){let s=i.indexOf("=");if(s>0)n[i.slice(2,s)]=i.slice(s+1);else{let a=e[r+1];a!==void 0&&!a.startsWith("--")?(n[i.slice(2)]=a,r++):n[i.slice(2)]=!0}}else t.push(i)}return{pos:t,opt:n}}var W=e=>typeof e=="string"?e:void 0,ni=e=>W(e)?.split(",").map(t=>t.trim()).filter(Boolean),fe=e=>W(e)?.replace(/\\n/g,`
5408
- `);function Hc(e){let t=W(e);if(t!==void 0){if(!hn.includes(t))throw new K(`--priority ph\u1EA3i l\xE0 ${hn.join(" | ")}.`);return t}}function Ze(e){let t=W(e.dir)??process.cwd(),n=ls(t);if(!n)throw new K(U(`Kh\xF4ng th\u1EA5y repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED (.pantest.yaml) t\u1EEB ${At.resolve(t)}. T\u1EA1o b\u1EB1ng: pan-test doc init`,`No test document repo (.pantest.yaml) found from ${At.resolve(t)}. Create one with: pan-test doc init`));let r=Ge(n);return un(r.config.language),r}var BA={"not-run":"Ch\u01B0a test",passed:"\u0110\u1EA1t",failed:"Kh\xF4ng \u0111\u1EA1t",blocked:"B\u1ECB ch\u1EB7n",skipped:"B\u1ECF qua"};function Jg(e){return U(`${e.total} t\xECnh hu\u1ED1ng \xB7 \u0111\u1EA1t ${e.passed} \xB7 kh\xF4ng \u0111\u1EA1t ${e.failed} \xB7 b\u1ECB ch\u1EB7n ${e.blocked} \xB7 b\u1ECF qua ${e.skipped} \xB7 ch\u01B0a test ${e["not-run"]}`,`${e.total} test case(s) \xB7 ${e.passed} passed \xB7 ${e.failed} failed \xB7 ${e.blocked} blocked \xB7 ${e.skipped} skipped \xB7 ${e["not-run"]} not run`)}async function Qg(e){let{pos:t,opt:n}=MA(e);typeof n.lang=="string"?un(n.lang,{pin:!0}):process.env.PANAUTO_LANG&&un(process.env.PANAUTO_LANG,{pin:!0});let[r,i,s]=t,a=n.json===!0,o=(c,l)=>console.log(a?JSON.stringify(c,null,2):l);try{switch(r){case void 0:case"help":return console.log(Yg()),r?0:1;case"ui":{let{createDocServer:c}=await Promise.resolve().then(()=>(Kg(),Wg)),l=W(n.embed)?.split(",").map(f=>f.trim()).filter(Boolean),u=c({start:W(n.dir)??process.cwd(),...W(n.lang)??process.env.PANAUTO_LANG?{lang:W(n.lang)??process.env.PANAUTO_LANG}:{},...l?{embed:l}:{}}),d=Number(W(n.port)??0)||0;await new Promise((f,m)=>{u.once("error",m),u.listen(d,"127.0.0.1",()=>f())});let h=`http://127.0.0.1:${u.address().port}/`;if(console.log(a?JSON.stringify({event:"listening",url:h,root:u.root}):`Pan Test \u2014 t\xE0i li\u1EC7u ki\u1EC3m th\u1EED: ${h}
5739
+ Common: --dir <repo> (default: current folder, searching up to .pantest.yaml)`,Yg=()=>U(L_,M_);function D_(e){let t=[],n={};for(let r=0;r<e.length;r++){let i=e[r];if(i.startsWith("--")){let s=i.indexOf("=");if(s>0)n[i.slice(2,s)]=i.slice(s+1);else{let a=e[r+1];a!==void 0&&!a.startsWith("--")?(n[i.slice(2)]=a,r++):n[i.slice(2)]=!0}}else t.push(i)}return{pos:t,opt:n}}var W=e=>typeof e=="string"?e:void 0,ni=e=>W(e)?.split(",").map(t=>t.trim()).filter(Boolean),fe=e=>W(e)?.replace(/\\n/g,`
5740
+ `);function Hc(e){let t=W(e);if(t!==void 0){if(!hn.includes(t))throw new K(`--priority ph\u1EA3i l\xE0 ${hn.join(" | ")}.`);return t}}function Ze(e){let t=W(e.dir)??process.cwd(),n=ls(t);if(!n)throw new K(U(`Kh\xF4ng th\u1EA5y repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED (.pantest.yaml) t\u1EEB ${_t.resolve(t)}. T\u1EA1o b\u1EB1ng: pan-test doc init`,`No test document repo (.pantest.yaml) found from ${_t.resolve(t)}. Create one with: pan-test doc init`));let r=Ge(n);return un(r.config.language),r}var B_={"not-run":"Ch\u01B0a test",passed:"\u0110\u1EA1t",failed:"Kh\xF4ng \u0111\u1EA1t",blocked:"B\u1ECB ch\u1EB7n",skipped:"B\u1ECF qua"};function Jg(e){return U(`${e.total} t\xECnh hu\u1ED1ng \xB7 \u0111\u1EA1t ${e.passed} \xB7 kh\xF4ng \u0111\u1EA1t ${e.failed} \xB7 b\u1ECB ch\u1EB7n ${e.blocked} \xB7 b\u1ECF qua ${e.skipped} \xB7 ch\u01B0a test ${e["not-run"]}`,`${e.total} test case(s) \xB7 ${e.passed} passed \xB7 ${e.failed} failed \xB7 ${e.blocked} blocked \xB7 ${e.skipped} skipped \xB7 ${e["not-run"]} not run`)}async function Qg(e){let{pos:t,opt:n}=D_(e);typeof n.lang=="string"?un(n.lang,{pin:!0}):process.env.PANAUTO_LANG&&un(process.env.PANAUTO_LANG,{pin:!0});let[r,i,s]=t,a=n.json===!0,o=(c,l)=>console.log(a?JSON.stringify(c,null,2):l);try{switch(r){case void 0:case"help":return console.log(Yg()),r?0:1;case"ui":{let{createDocServer:c}=await Promise.resolve().then(()=>(Kg(),Wg)),l=W(n.embed)?.split(",").map(f=>f.trim()).filter(Boolean),u=c({start:W(n.dir)??process.cwd(),...W(n.lang)??process.env.PANAUTO_LANG?{lang:W(n.lang)??process.env.PANAUTO_LANG}:{},...l?{embed:l}:{}}),d=Number(W(n.port)??0)||0;await new Promise((f,m)=>{u.once("error",m),u.listen(d,"127.0.0.1",()=>f())});let h=`http://127.0.0.1:${u.address().port}/`;if(console.log(a?JSON.stringify({event:"listening",url:h,root:u.root}):`Pan Test \u2014 t\xE0i li\u1EC7u ki\u1EC3m th\u1EED: ${h}
5409
5741
  repo: ${u.root}
5410
- Ctrl+C \u0111\u1EC3 d\u1EEBng.`),n["no-open"]!==!0&&!a){let{spawn:f}=await import("node:child_process"),m=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",g=process.platform==="win32"?["/c","start","",h]:[h];try{f(m,g,{stdio:"ignore",detached:!0}).unref()}catch{}}return n.lifeline===!0&&process.stdin.on("end",()=>process.exit(0)).resume(),await new Promise(()=>{}),0}case"init":{let c=At.resolve(i??W(n.dir)??"."),l=W(n.title)??At.basename(c),u=(W(n.lang)??process.env.PANAUTO_LANG)==="en"?"en":"vi",d=vt(da.existsSync(c)?c:process.cwd()),p=Ku(c,{title:l,language:u,...W(n.ba)?{ba:W(n.ba)}:{},me:{id:d,name:d}});return o(p,U(`\u2713 \u0110\xE3 t\u1EA1o repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED \xAB${p.title}\xBB \u1EDF ${c}${p.ba?` (repo BA: ${p.ba})`:""}.
5742
+ Ctrl+C \u0111\u1EC3 d\u1EEBng.`),n["no-open"]!==!0&&!a){let{spawn:f}=await import("node:child_process"),m=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",g=process.platform==="win32"?["/c","start","",h]:[h];try{f(m,g,{stdio:"ignore",detached:!0}).unref()}catch{}}return n.lifeline===!0&&process.stdin.on("end",()=>process.exit(0)).resume(),await new Promise(()=>{}),0}case"init":{let c=_t.resolve(i??W(n.dir)??"."),l=W(n.title)??_t.basename(c),u=(W(n.lang)??process.env.PANAUTO_LANG)==="en"?"en":"vi",d=vt(da.existsSync(c)?c:process.cwd()),p=Ku(c,{title:l,language:u,...W(n.ba)?{ba:W(n.ba)}:{},me:{id:d,name:d}});return o(p,U(`\u2713 \u0110\xE3 t\u1EA1o repo t\xE0i li\u1EC7u ki\u1EC3m th\u1EED \xAB${p.title}\xBB \u1EDF ${c}${p.ba?` (repo BA: ${p.ba})`:""}.
5411
5743
  Ti\u1EBFp: pan-test doc module add <PH> --title <t\xEAn ph\xE2n h\u1EC7>`,`\u2713 Created test document repo \xAB${p.title}\xBB in ${c}${p.ba?` (BA repo: ${p.ba})`:""}.
5412
- Next: pan-test doc module add <MOD> --title <module name>`)),0}case"module":{if(i!=="add"||!s)throw new K("D\xF9ng: pan-test doc module add <PH> --title <t\xEAn>");let c=Ze(n),l=hs(c,s,W(n.title)??s);return o(l,U(`\u2713 \u0110\xE3 th\xEAm ph\xE2n h\u1EC7 ${l.code} \xB7 ${l.title}`,`\u2713 Added module ${l.code} \xB7 ${l.title}`)),0}case"new":{if(!i)throw new K("D\xF9ng: pan-test doc new <PH> --title <t\xEAn k\u1ECBch b\u1EA3n>");let c=Ze(n),l=W(n.kind);if(l&&l!=="functional"&&l!=="non-functional")throw new K("--kind ph\u1EA3i l\xE0 functional | non-functional.");let u=Hc(n.priority),d=fs(c,{module:i,title:W(n.title)??"",...l?{kind:l}:{},...ni(n.covers)?{covers:ni(n.covers)}:{},...ni(n.uc)?{useCases:ni(n.uc)}:{},...u?{priority:u}:{},...fe(n.preconditions)?{preconditions:fe(n.preconditions)}:{},...W(n.after)?{after:W(n.after)}:{},avoid:Ft(c.root)});return o(d,U(`\u2713 \u0110\xE3 t\u1EA1o k\u1ECBch b\u1EA3n ${d.code} \xB7 ${d.title} (${d.file})`,`\u2713 Created test suite ${d.code} \xB7 ${d.title} (${d.file})`)),0}case"case":{let c=Ze(n);if(i==="add"&&s){let l=Hc(n.priority),u=gs(c,s,{case:fe(n.case)??"",...fe(n.steps)?{steps:fe(n.steps)}:{},...fe(n.expected)?{expected:fe(n.expected)}:{},...fe(n.requirement)?{requirement:fe(n.requirement)}:{},...l?{priority:l}:{},...W(n.tag)?{tag:W(n.tag)}:{}},{...W(n.after)?{after:W(n.after)}:{},avoid:Ft(c.root)});return o(u,U(`\u2713 \u0110\xE3 th\xEAm t\xECnh hu\u1ED1ng ${u.code} v\xE0o ${s}`,`\u2713 Added test case ${u.code} to ${s}`)),0}if(i==="edit"&&s){let l=Hc(n.priority),u=vs(c,s,{...fe(n.case)!==void 0?{case:fe(n.case)}:{},...fe(n.steps)!==void 0?{steps:fe(n.steps)}:{},...fe(n.expected)!==void 0?{expected:fe(n.expected)}:{},...fe(n.requirement)!==void 0?{requirement:fe(n.requirement)}:{},...l?{priority:l}:{},...W(n.tag)!==void 0?{tag:W(n.tag)}:{}});return o(u,U(`\u2713 \u0110\xE3 s\u1EEDa t\xECnh hu\u1ED1ng ${u.code}`,`\u2713 Updated test case ${u.code}`)),0}if(i==="rm"&&s){let l=ws(c,s,W(n.reason)??"");return o(l,U(`\u2713 \u0110\xE3 xo\xE1 (m\u1EC1m) t\xECnh hu\u1ED1ng ${l.code} \u2014 m\xE3 gi\u1EEF l\u1EA1i, kh\xF4ng d\xF9ng l\u1EA1i.`,`\u2713 Soft-deleted test case ${l.code} \u2014 the code is kept and never reused.`)),0}throw new K("D\xF9ng: pan-test doc case add <KB-\u2026> | edit <TC-\u2026> | rm <TC-\u2026>")}case"result":{if(!i||!s)throw new K(`D\xF9ng: pan-test doc result <TC-\u2026> <${et.join("|")}>`);let c=Ze(n),l=ys(c,i,{status:s,...fe(n.actual)?{actual:fe(n.actual)}:{},...W(n.env)?{env:W(n.env)}:{},...W(n.bug)?{bug:W(n.bug)}:{},...W(n.by)?{by:W(n.by)}:{}});return o(l,`\u2713 ${l.code}: ${U(BA[l.result?.status??"not-run"],l.result?.status??"not-run")}`),0}case"export":{let{exportDoc:c,FORMATS:l}=await Promise.resolve().then(()=>(Zr(),wg)),u=Ze(n),d=ni(n.format)??["docx"];if(d.filter(f=>!l.includes(f)).length)throw new K(`--format ch\u1EC9 nh\u1EADn ${l.join(", ")}.`);let h=await c(u,{formats:d,results:n.results===!0,codes:n.codes===!0,...W(n.out)?{out:W(n.out)}:{}});return o({files:h},h.map(f=>`\u2713 ${f}`).join(`
5413
- `)),0}case"import":{if(!i||!W(n.module))throw new K("D\xF9ng: pan-test doc import <t\u1EC7p.feature | th\u01B0 m\u1EE5c> --module <PH> [--json]");let{featureFiles:c,importFeature:l}=await Promise.resolve().then(()=>(ti(),Mc)),u=Ze(n),d=At.resolve(i);if(!da.existsSync(d))throw new K(`Kh\xF4ng th\u1EA5y ${d}.`);let p=da.statSync(d).isDirectory()?c(d):[d];if(!p.length)throw new K(`Kh\xF4ng c\xF3 t\u1EC7p .feature n\xE0o trong ${d}.`);let h=Ft(u.root),f=p.map(m=>({file:m,...l(u,da.readFileSync(m,"utf8"),{file:At.relative(u.root,m).split(At.sep).join("/"),module:W(n.module),avoid:h})}));return o(f,f.map(m=>`\u2713 ${At.relative(process.cwd(),m.file)} \u2192 ${m.suite}${m.created?" (m\u1EDBi)":""}: th\xEAm ${m.added.length}, c\u1EADp nh\u1EADt ${m.updated.length}${m.missing.length?`, ${m.missing.length} t\xECnh hu\u1ED1ng kh\xF4ng c\xF2n trong t\u1EC7p (gi\u1EEF nguy\xEAn, xem l\u1EA1i)`:""}${m.untagged?`, ${m.untagged} k\u1ECBch b\u1EA3n kh\xF4ng c\xF3 tag \u0111\u1ECBnh danh (kh\u1EDBp theo t\xEAn)`:""}`).join(`
5414
- `)),0}case"results":{if(!i)throw new K("D\xF9ng: pan-test doc results <results.json | th\u01B0 m\u1EE5c b\xE1o c\xE1o> [--env UAT] [--json]");let{applyRunResults:c,readRunResults:l}=await Promise.resolve().then(()=>(ti(),Mc)),u=Ze(n),d=c(u,l(At.resolve(i)),{...W(n.env)?{env:W(n.env)}:{}}),p=h=>d.applied.filter(f=>f.status===h).length;return o(d,U(`\u2713 Ghi k\u1EBFt qu\u1EA3 ${d.applied.length} t\xECnh hu\u1ED1ng: \u0111\u1EA1t ${p("passed")}, kh\xF4ng \u0111\u1EA1t ${p("failed")}, b\u1ECF qua ${p("skipped")}.`,`\u2713 Recorded ${d.applied.length} result(s): ${p("passed")} passed, ${p("failed")} failed, ${p("skipped")} skipped.`)+(d.notRun.length?`
5744
+ Next: pan-test doc module add <MOD> --title <module name>`)),0}case"module":{if(i!=="add"||!s)throw new K("D\xF9ng: pan-test doc module add <PH> --title <t\xEAn>");let c=Ze(n),l=hs(c,s,W(n.title)??s);return o(l,U(`\u2713 \u0110\xE3 th\xEAm ph\xE2n h\u1EC7 ${l.code} \xB7 ${l.title}`,`\u2713 Added module ${l.code} \xB7 ${l.title}`)),0}case"new":{if(!i)throw new K("D\xF9ng: pan-test doc new <PH> --title <t\xEAn k\u1ECBch b\u1EA3n>");let c=Ze(n),l=W(n.kind);if(l&&l!=="functional"&&l!=="non-functional")throw new K("--kind ph\u1EA3i l\xE0 functional | non-functional.");let u=Hc(n.priority),d=fs(c,{module:i,title:W(n.title)??"",...l?{kind:l}:{},...ni(n.covers)?{covers:ni(n.covers)}:{},...ni(n.uc)?{useCases:ni(n.uc)}:{},...u?{priority:u}:{},...fe(n.preconditions)?{preconditions:fe(n.preconditions)}:{},...W(n.after)?{after:W(n.after)}:{},avoid:Ft(c.root)});return o(d,U(`\u2713 \u0110\xE3 t\u1EA1o k\u1ECBch b\u1EA3n ${d.code} \xB7 ${d.title} (${d.file})`,`\u2713 Created test suite ${d.code} \xB7 ${d.title} (${d.file})`)),0}case"case":{let c=Ze(n);if(i==="add"&&s){let l=Hc(n.priority),u=gs(c,s,{case:fe(n.case)??"",...fe(n.steps)?{steps:fe(n.steps)}:{},...fe(n.expected)?{expected:fe(n.expected)}:{},...fe(n.requirement)?{requirement:fe(n.requirement)}:{},...l?{priority:l}:{},...W(n.tag)?{tag:W(n.tag)}:{}},{...W(n.after)?{after:W(n.after)}:{},avoid:Ft(c.root)});return o(u,U(`\u2713 \u0110\xE3 th\xEAm t\xECnh hu\u1ED1ng ${u.code} v\xE0o ${s}`,`\u2713 Added test case ${u.code} to ${s}`)),0}if(i==="edit"&&s){let l=Hc(n.priority),u=vs(c,s,{...fe(n.case)!==void 0?{case:fe(n.case)}:{},...fe(n.steps)!==void 0?{steps:fe(n.steps)}:{},...fe(n.expected)!==void 0?{expected:fe(n.expected)}:{},...fe(n.requirement)!==void 0?{requirement:fe(n.requirement)}:{},...l?{priority:l}:{},...W(n.tag)!==void 0?{tag:W(n.tag)}:{}});return o(u,U(`\u2713 \u0110\xE3 s\u1EEDa t\xECnh hu\u1ED1ng ${u.code}`,`\u2713 Updated test case ${u.code}`)),0}if(i==="rm"&&s){let l=ws(c,s,W(n.reason)??"");return o(l,U(`\u2713 \u0110\xE3 xo\xE1 (m\u1EC1m) t\xECnh hu\u1ED1ng ${l.code} \u2014 m\xE3 gi\u1EEF l\u1EA1i, kh\xF4ng d\xF9ng l\u1EA1i.`,`\u2713 Soft-deleted test case ${l.code} \u2014 the code is kept and never reused.`)),0}throw new K("D\xF9ng: pan-test doc case add <KB-\u2026> | edit <TC-\u2026> | rm <TC-\u2026>")}case"result":{if(!i||!s)throw new K(`D\xF9ng: pan-test doc result <TC-\u2026> <${et.join("|")}>`);let c=Ze(n),l=xs(c,i,{status:s,...fe(n.actual)?{actual:fe(n.actual)}:{},...W(n.env)?{env:W(n.env)}:{},...W(n.bug)?{bug:W(n.bug)}:{},...W(n.by)?{by:W(n.by)}:{}});return o(l,`\u2713 ${l.code}: ${U(B_[l.result?.status??"not-run"],l.result?.status??"not-run")}`),0}case"export":{let{exportDoc:c,FORMATS:l}=await Promise.resolve().then(()=>(Zr(),wg)),u=Ze(n),d=ni(n.format)??["docx"];if(d.filter(f=>!l.includes(f)).length)throw new K(`--format ch\u1EC9 nh\u1EADn ${l.join(", ")}.`);let h=await c(u,{formats:d,results:n.results===!0,codes:n.codes===!0,...W(n.out)?{out:W(n.out)}:{}});return o({files:h},h.map(f=>`\u2713 ${f}`).join(`
5745
+ `)),0}case"import":{if(!i||!W(n.module))throw new K("D\xF9ng: pan-test doc import <t\u1EC7p.feature | th\u01B0 m\u1EE5c> --module <PH> [--json]");let{featureFiles:c,importFeature:l}=await Promise.resolve().then(()=>(ti(),Dc)),u=Ze(n),d=_t.resolve(i);if(!da.existsSync(d))throw new K(`Kh\xF4ng th\u1EA5y ${d}.`);let p=da.statSync(d).isDirectory()?c(d):[d];if(!p.length)throw new K(`Kh\xF4ng c\xF3 t\u1EC7p .feature n\xE0o trong ${d}.`);let h=Ft(u.root),f=p.map(m=>({file:m,...l(u,da.readFileSync(m,"utf8"),{file:_t.relative(u.root,m).split(_t.sep).join("/"),module:W(n.module),avoid:h})}));return o(f,f.map(m=>`\u2713 ${_t.relative(process.cwd(),m.file)} \u2192 ${m.suite}${m.created?" (m\u1EDBi)":""}: th\xEAm ${m.added.length}, c\u1EADp nh\u1EADt ${m.updated.length}${m.missing.length?`, ${m.missing.length} t\xECnh hu\u1ED1ng kh\xF4ng c\xF2n trong t\u1EC7p (gi\u1EEF nguy\xEAn, xem l\u1EA1i)`:""}${m.untagged?`, ${m.untagged} k\u1ECBch b\u1EA3n kh\xF4ng c\xF3 tag \u0111\u1ECBnh danh (kh\u1EDBp theo t\xEAn)`:""}`).join(`
5746
+ `)),0}case"results":{if(!i)throw new K("D\xF9ng: pan-test doc results <results.json | th\u01B0 m\u1EE5c b\xE1o c\xE1o> [--env UAT] [--json]");let{applyRunResults:c,readRunResults:l}=await Promise.resolve().then(()=>(ti(),Dc)),u=Ze(n),d=c(u,l(_t.resolve(i)),{...W(n.env)?{env:W(n.env)}:{}}),p=h=>d.applied.filter(f=>f.status===h).length;return o(d,U(`\u2713 Ghi k\u1EBFt qu\u1EA3 ${d.applied.length} t\xECnh hu\u1ED1ng: \u0111\u1EA1t ${p("passed")}, kh\xF4ng \u0111\u1EA1t ${p("failed")}, b\u1ECF qua ${p("skipped")}.`,`\u2713 Recorded ${d.applied.length} result(s): ${p("passed")} passed, ${p("failed")} failed, ${p("skipped")} skipped.`)+(d.notRun.length?`
5415
5747
  ${d.notRun.length} t\xECnh hu\u1ED1ng c\xF3 tag nh\u01B0ng l\u1EA7n ch\u1EA1y kh\xF4ng c\xF3: ${d.notRun.slice(0,10).join(", ")}${d.notRun.length>10?"\u2026":""}`:"")+(d.unknownTags.length?`
5416
5748
  Tag trong l\u1EA7n ch\u1EA1y ch\u01B0a c\xF3 trong t\xE0i li\u1EC7u: ${d.unknownTags.slice(0,10).join(", ")}${d.unknownTags.length>10?"\u2026":""}`:"")),0}case"list":{let c=Ze(n),l=c.modules.map(d=>({code:d.code,title:d.title,suites:en(c,d.code).map(p=>({code:p.code,title:p.title,kind:p.kind,cases:p.cases.filter(h=>!h.deleted).map(h=>({code:h.code,case:h.case,status:h.result?.status??"not-run"}))}))})),u=[`${c.config.title}`];return l.forEach((d,p)=>{u.push(`${p+1}. ${d.code} \xB7 ${d.title}`),d.suites.forEach((h,f)=>{let m=h.cases.filter(g=>g.status==="passed").length;u.push(` ${p+1}.${f+1} ${h.code} \xB7 ${h.title} [${m}/${h.cases.length} ${U("\u0111\u1EA1t","passed")}]`)})}),o(l,u.join(`
5417
- `)),0}case"check":{let c=Ze(n),l=Ve(c.root,c.config.ba),u=xs(c,l?bt(l):null),d=u.filter(f=>f.severity==="error").length,p=u.filter(f=>f.severity==="warn").length,h=u.length?u.map(f=>`${f.severity==="error"?"\u2717":f.severity==="warn"?"!":"i"} ${f.rule} ${f.message}${f.file?` (${f.file})`:""}`).join(`
5749
+ `)),0}case"check":{let c=Ze(n),l=Ve(c.root,c.config.ba),u=ys(c,l?bt(l):null),d=u.filter(f=>f.severity==="error").length,p=u.filter(f=>f.severity==="warn").length,h=u.length?u.map(f=>`${f.severity==="error"?"\u2717":f.severity==="warn"?"!":"i"} ${f.rule} ${f.message}${f.file?` (${f.file})`:""}`).join(`
5418
5750
  `)+`
5419
5751
 
5420
5752
  ${U(`${d} l\u1ED7i \xB7 ${p} c\u1EA3nh b\xE1o`,`${d} error(s) \xB7 ${p} warning(s)`)}`:U("\u2713 Kh\xF4ng c\xF3 l\u1ED7i.","\u2713 No errors.");return o({errors:d,warnings:p,findings:u},(c.config.ba&&!l?`! Kh\xF4ng th\u1EA5y repo BA \xAB${c.config.ba}\xBB \u2014 b\u1ECF qua ki\u1EC3m tham chi\u1EBFu.
5421
- `:"")+h),d?2:0}case"bundle":{let{buildBundle:c}=await Promise.resolve().then(()=>(Xg(),Vg)),l=Ze(n);return console.log(JSON.stringify({root:l.root,...c(l)})),0}case"summary":{let c=Ze(n),l=Ve(c.root,c.config.ba),u=Pn(c,l?bt(l):null),d=[`${U("T\u1ED5ng","Total")}: ${Jg(u.all)}`,...u.modules.map(p=>` ${p.code} \xB7 ${p.title}: ${p.suites} ${U("k\u1ECBch b\u1EA3n","suite(s)")} \xB7 ${Jg(p.count)}`)];return u.coverage&&d.push(`${U("\u0110\u1ED9 ph\u1EE7 ch\u1EE9c n\u0103ng BA","BA function coverage")}: ${u.coverage.covered}/${u.coverage.functions}`),o(u,d.join(`
5753
+ `:"")+h),d?2:0}case"bundle":{let{buildBundle:c}=await Promise.resolve().then(()=>(Xg(),Vg)),l=Ze(n);return console.log(JSON.stringify({root:l.root,...c(l)})),0}case"summary":{let c=Ze(n),l=Ve(c.root,c.config.ba),u=In(c,l?bt(l):null),d=[`${U("T\u1ED5ng","Total")}: ${Jg(u.all)}`,...u.modules.map(p=>` ${p.code} \xB7 ${p.title}: ${p.suites} ${U("k\u1ECBch b\u1EA3n","suite(s)")} \xB7 ${Jg(p.count)}`)];return u.coverage&&d.push(`${U("\u0110\u1ED9 ph\u1EE7 ch\u1EE9c n\u0103ng BA","BA function coverage")}: ${u.coverage.covered}/${u.coverage.functions}`),o(u,d.join(`
5422
5754
  `)),0}default:throw new K(`Kh\xF4ng c\xF3 l\u1EC7nh \xABdoc ${r}\xBB.
5423
5755
 
5424
5756
  ${Yg()}`)}}catch(c){if(c instanceof K)return console.error(`\u2717 ${c.message}`),1;throw c}}Qg(process.argv.slice(2)).then(e=>process.exit(e)).catch(e=>{console.error(e),process.exit(1)});