@wavemaker/angular-codegen 11.15.6-1.647701 → 11.15.7-rc.647843

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.
@@ -131454,6 +131454,13 @@ function requireDom$1 () {
131454
131454
  * used for attributes or DocumentType entities
131455
131455
  */
131456
131456
  function NamedNodeMap() {
131457
+ // nodeName -> Attr membership index; lets the parse-time de-duplication in
131458
+ // setNamedItem resolve an existing attribute in O(1) instead of scanning the
131459
+ // list, so building an element with M attributes costs O(M) rather than O(M^2).
131460
+ // The numbered entries and length remain the sole authority for attribute order.
131461
+ // Object.create(null) so an attribute named __proto__ or constructor is an
131462
+ // ordinary key.
131463
+ this._nameIndex = Object.create(null);
131457
131464
  }
131458
131465
  function _findNodeIndex(list,node){
131459
131466
  var i = list.length;
@@ -131462,12 +131469,27 @@ function requireDom$1 () {
131462
131469
  }
131463
131470
  }
131464
131471
 
131472
+ function _nnmIndexAdd(list, attr) {
131473
+ list._nameIndex[attr.nodeName] = attr;
131474
+ }
131475
+ function _nnmIndexRemove(list, attr) {
131476
+ // Only drop the entry if it still points at this attribute; a replacement with
131477
+ // a different nodeName may already have re-keyed it.
131478
+ if (list._nameIndex[attr.nodeName] === attr) {
131479
+ delete list._nameIndex[attr.nodeName];
131480
+ }
131481
+ }
131482
+
131465
131483
  function _addNamedNode(el,list,newAttr,oldAttr){
131466
131484
  if(oldAttr){
131467
131485
  list[_findNodeIndex(list,oldAttr)] = newAttr;
131486
+ // oldAttr leaves the list; drop its index entry (its nodeName may differ
131487
+ // from newAttr's when the replacement came via setNamedItemNS).
131488
+ _nnmIndexRemove(list, oldAttr);
131468
131489
  }else {
131469
131490
  list[list.length++] = newAttr;
131470
131491
  }
131492
+ _nnmIndexAdd(list, newAttr);
131471
131493
  if(el){
131472
131494
  newAttr.ownerElement = el;
131473
131495
  var doc = el.ownerDocument;
@@ -131486,6 +131508,7 @@ function requireDom$1 () {
131486
131508
  list[i] = list[++i];
131487
131509
  }
131488
131510
  list.length = lastIndex;
131511
+ _nnmIndexRemove(list, attr);
131489
131512
  if(el){
131490
131513
  var doc = el.ownerDocument;
131491
131514
  if(doc){
@@ -131519,7 +131542,11 @@ function requireDom$1 () {
131519
131542
  if(el && el!=this._ownerElement){
131520
131543
  throw new DOMException(INUSE_ATTRIBUTE_ERR);
131521
131544
  }
131522
- var oldAttr = this.getNamedItem(attr.nodeName);
131545
+ // Resolve any existing attribute with the same nodeName through the O(1)
131546
+ // membership index rather than an O(M) scan — this is the parse-dedup hot
131547
+ // path (setAttributeNode per attribute during parse). Absent -> undefined,
131548
+ // matching getNamedItem's contract.
131549
+ var oldAttr = this._nameIndex[attr.nodeName];
131523
131550
  _addNamedNode(this._ownerElement,this,attr,oldAttr);
131524
131551
  return oldAttr;
131525
131552
  },
@@ -131752,9 +131779,38 @@ function requireDom$1 () {
131752
131779
  while (child) {
131753
131780
  var next = child.nextSibling;
131754
131781
  if (next !== null && next.nodeType === TEXT_NODE && child.nodeType === TEXT_NODE) {
131755
- node.removeChild(next);
131756
- child.appendData(next.data);
131757
- // Do not advance child: re-check new nextSibling for another text run
131782
+ // Merge the whole run of adjacent text nodes at once: gather the
131783
+ // following text siblings' data, unlink them in a single pass, and
131784
+ // re-index the child list a single time. Per-sibling `removeChild`
131785
+ // (each an O(K) re-index) plus per-sibling `appendData` (each an O(K)
131786
+ // string rebuild) is O(K^2) over a long run of single-character text
131787
+ // nodes; this keeps it O(K). The first text node of the run survives
131788
+ // and carries the concatenated data, preserving node identity and
131789
+ // locator semantics.
131790
+ var tail = [];
131791
+ var sibling = next;
131792
+ while (sibling !== null && sibling.nodeType === TEXT_NODE) {
131793
+ tail.push(sibling.data);
131794
+ sibling = sibling.nextSibling;
131795
+ }
131796
+ // `sibling` is now the first non-text node after the run, or null.
131797
+ var removed = child.nextSibling;
131798
+ while (removed !== sibling) {
131799
+ var following = removed.nextSibling;
131800
+ removed.parentNode = null;
131801
+ removed.previousSibling = null;
131802
+ removed.nextSibling = null;
131803
+ removed = following;
131804
+ }
131805
+ child.nextSibling = sibling;
131806
+ if (sibling !== null) {
131807
+ sibling.previousSibling = child;
131808
+ } else {
131809
+ node.lastChild = child;
131810
+ }
131811
+ child.appendData(tail.join('')); // single O(K) string rebuild
131812
+ _onUpdateChild(node.ownerDocument, node); // single O(K) re-index
131813
+ child = sibling;
131758
131814
  } else {
131759
131815
  child = next;
131760
131816
  }
@@ -132565,8 +132621,10 @@ function requireDom$1 () {
132565
132621
  * - it does not do any input validation on the arguments and doesn't throw "InvalidCharacterError".
132566
132622
  *
132567
132623
  * Note: When the resulting document is serialized with `requireWellFormed: true`, the
132568
- * serializer throws with code `INVALID_STATE_ERR` if `.data` contains `?>` (W3C DOM Parsing
132569
- * §3.2.1.7). Without that option the data is emitted verbatim.
132624
+ * serializer throws with code `INVALID_STATE_ERR` if `.target` is not a valid XML `NCName`
132625
+ * (a `Name` with no colon) or is an ASCII case-insensitive match for `"xml"`, or if `.data`
132626
+ * contains `?>` (W3C DOM Parsing §3.2.1.7). Without that option the target and data are
132627
+ * emitted verbatim.
132570
132628
  *
132571
132629
  * @param {string} target
132572
132630
  * @param {string} data
@@ -132591,7 +132649,27 @@ function requireDom$1 () {
132591
132649
  node.specified = true;
132592
132650
  return node;
132593
132651
  },
132652
+ /**
132653
+ * Creates an EntityReference object, serialized as `&name;`.
132654
+ *
132655
+ * The `name` is validated against the XML `Name` production at creation time; an invalid name
132656
+ * throws a `DOMException` with code `INVALID_CHARACTER_ERR`. When the resulting node is
132657
+ * serialized with `requireWellFormed: true`, the serializer re-validates `nodeName` and throws
132658
+ * a `DOMException` with code `INVALID_STATE_ERR` if a later `nodeName` mutation made it invalid;
132659
+ * without that option the name is emitted verbatim.
132660
+ *
132661
+ * Note: xmldom does not expand entities — the parser resolves entity references inline and never
132662
+ * constructs `EntityReference` nodes, so this method is the only producer.
132663
+ *
132664
+ * @param {string} name The name of the entity to reference.
132665
+ * @returns {EntityReference}
132666
+ * @throws {DOMException} With code `INVALID_CHARACTER_ERR` when `name` is not a valid XML `Name`.
132667
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-392B75AE
132668
+ */
132594
132669
  createEntityReference : function(name){
132670
+ if (!tagNamePattern.test(name)) {
132671
+ throw new DOMException(INVALID_CHARACTER_ERR, 'not a valid xml name "' + name + '"');
132672
+ }
132595
132673
  var node = new EntityReference();
132596
132674
  node.ownerDocument = this;
132597
132675
  node.nodeName = name;
@@ -132803,15 +132881,16 @@ function requireDom$1 () {
132803
132881
  /**
132804
132882
  * Represents a DocumentType node (the `<!DOCTYPE ...>` declaration).
132805
132883
  *
132806
- * `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
132884
+ * `name`, `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
132807
132885
  * xmldom does not enforce the `readonly` constraint declared by the WHATWG DOM spec —
132808
132886
  * direct property writes succeed silently. Values are serialized verbatim when
132809
132887
  * `requireWellFormed` is false (the default). When the serializer is invoked with
132810
132888
  * `requireWellFormed: true` (via the 4th-parameter options object), it validates each
132811
- * field and throws `DOMException` with code `INVALID_STATE_ERR` on invalid values.
132889
+ * field — including `name`, which is checked against the XML `Name` production — and throws
132890
+ * `DOMException` with code `INVALID_STATE_ERR` on invalid values.
132812
132891
  *
132813
132892
  * @class
132814
- * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentType MDN
132893
+ * @see https://developer.mozilla.org/docs/Web/API/DocumentType MDN
132815
132894
  */
132816
132895
  function DocumentType() {
132817
132896
  } DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
@@ -132825,6 +132904,20 @@ function requireDom$1 () {
132825
132904
  } Entity.prototype.nodeType = ENTITY_NODE;
132826
132905
  _extends(Entity,Node);
132827
132906
 
132907
+ /**
132908
+ * Represents an EntityReference node, serialized as `&nodeName;`.
132909
+ *
132910
+ * `nodeName` is the referenced entity's name, stored verbatim. When serialized with
132911
+ * `requireWellFormed: true`, the serializer validates `nodeName` against the XML `Name` production
132912
+ * and throws a `DOMException` with code `INVALID_STATE_ERR` if it does not match; without that
132913
+ * option the name is emitted verbatim between `&` and `;`.
132914
+ *
132915
+ * Note: xmldom does not expand entities — the parser resolves entity references inline and never
132916
+ * constructs `EntityReference` nodes, so the only producer is `Document.createEntityReference`.
132917
+ *
132918
+ * @class
132919
+ * @see https://www.w3.org/TR/xml/#NT-Name
132920
+ */
132828
132921
  function EntityReference() {
132829
132922
  } EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
132830
132923
  _extends(EntityReference,Node);
@@ -132867,12 +132960,15 @@ function requireDom$1 () {
132867
132960
  * not a valid XML QName,
132868
132961
  * - a CDATASection node's data contains `"]]>"`,
132869
132962
  * - a Comment node's data contains `"-->"` (bare `"--"` does not throw on this branch),
132870
- * - a ProcessingInstruction's data contains `"?>"`,
132963
+ * - a ProcessingInstruction's target is not a valid XML `NCName` (a `Name` with no colon) or is
132964
+ * an ASCII case-insensitive match for `"xml"`, or its data contains `"?>"`,
132965
+ * - a DocumentType's `name` is not a valid XML `Name` (XML 1.0 production [5]),
132871
132966
  * - a DocumentType's `publicId` is non-empty and does not match the XML `PubidLiteral`
132872
132967
  * production,
132873
132968
  * - a DocumentType's `systemId` is non-empty and does not match the XML `SystemLiteral`
132874
- * production, or
132875
- * - a DocumentType's `internalSubset` contains `"]>"`.
132969
+ * production,
132970
+ * - a DocumentType's `internalSubset` contains `"]>"`, or
132971
+ * - an EntityReference's `nodeName` is not a valid XML `Name` (XML 1.0 production [5]).
132876
132972
  * Note: xmldom does not enforce `readonly` on DocumentType fields — direct property
132877
132973
  * writes succeed and are covered by the serializer-level checks above.
132878
132974
  * @see https://html.spec.whatwg.org/#dom-xmlserializer-serializetostring
@@ -133127,6 +133223,9 @@ function requireDom$1 () {
133127
133223
 
133128
133224
  case DOCUMENT_TYPE_NODE:
133129
133225
  if (requireWellFormed) {
133226
+ if (!tagNamePattern.test(n.name)) {
133227
+ throw new DOMException(INVALID_STATE_ERR, 'The doctype name "' + n.name + '" is not a valid XML Name');
133228
+ }
133130
133229
  if (n.publicId && !/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(n.publicId)) {
133131
133230
  throw new DOMException(INVALID_STATE_ERR, 'DocumentType publicId is not a valid PubidLiteral');
133132
133231
  }
@@ -133158,13 +133257,27 @@ function requireDom$1 () {
133158
133257
  return null;
133159
133258
 
133160
133259
  case PROCESSING_INSTRUCTION_NODE:
133161
- if (requireWellFormed && n.data.indexOf('?>') !== -1) {
133162
- throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
133260
+ if (requireWellFormed) {
133261
+ if (!tagNamePattern.test(n.target) || n.target.indexOf(':') !== -1 || n.target.toLowerCase() === 'xml') {
133262
+ throw new DOMException(
133263
+ INVALID_STATE_ERR,
133264
+ 'The processing instruction target "' + n.target + '" is not a valid XML NCName or is reserved'
133265
+ );
133266
+ }
133267
+ if (n.data.indexOf('?>') !== -1) {
133268
+ throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
133269
+ }
133163
133270
  }
133164
133271
  buf.push('<?', n.target, ' ', n.data, '?>');
133165
133272
  return null;
133166
133273
 
133167
133274
  case ENTITY_REFERENCE_NODE:
133275
+ if (requireWellFormed && !tagNamePattern.test(n.nodeName)) {
133276
+ throw new DOMException(
133277
+ INVALID_STATE_ERR,
133278
+ 'The entity reference name "' + n.nodeName + '" is not a valid XML Name'
133279
+ );
133280
+ }
133168
133281
  buf.push('&', n.nodeName, ';');
133169
133282
  return null;
133170
133283
 
@@ -135657,7 +135770,13 @@ function requireSax$1 () {
135657
135770
  switch(source.charAt(tagStart+1)){
135658
135771
  case '/':
135659
135772
  var end = source.indexOf('>',tagStart+3);
135660
- var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, '');
135773
+ // Anchored trailing-whitespace trim. The former `/[ \t\n\r]+$/g` backtracked
135774
+ // quadratically on a name shaped `whitespace-run + non-whitespace char`
135775
+ // (an end tag `</ … x>`): from every start position it extended `[ws]+`
135776
+ // to the end and then failed the `$` anchor. This anchored form matches the
135777
+ // whole string once and captures everything up to the last non-whitespace
135778
+ // character, so it trims in linear time with byte-identical output.
135779
+ var tagName = source.substring(tagStart + 2, end).replace(/^([\s\S]*?[^ \t\n\r])?[ \t\n\r]*$/, '$1');
135661
135780
  var config = parseStack.pop();
135662
135781
  if(end<0){
135663
135782
 
@@ -135668,6 +135787,14 @@ function requireSax$1 () {
135668
135787
  tagName = tagName.replace(/[\s<].*/,'');
135669
135788
  errorHandler.error("end tag name: "+tagName+' maybe not complete');
135670
135789
  end = tagStart+1+tagName.length;
135790
+ }else if(/[ \t\n\r]/.test(tagName) && tagNamePattern.test(tagName.split(/[ \t\n\r]/)[0])){
135791
+ // The XML `ETag` production is `'</' Name S? '>'`: only optional whitespace may follow
135792
+ // the `Name`. A valid `Name` followed by whitespace and non-whitespace residue (e.g.
135793
+ // `</a\nbogus>` or `</a bogus>`) is not well-formed, but historically it was silently
135794
+ // accepted (the malformed end tag ignored, the residue dropped, the element left on the
135795
+ // stack). Report it as a recoverable `error` (which a custom errorHandler may escalate to
135796
+ // fatal) while keeping the existing recovery so the parsed DOM stays byte-identical.
135797
+ errorHandler.error('end tag name is followed by whitespace and trailing content: "'+tagName+'"');
135671
135798
  }
135672
135799
  var localNSMap = config.localNSMap;
135673
135800
  var endMatch = config.tagName == tagName;
@@ -135791,6 +135918,15 @@ function requireSax$1 () {
135791
135918
  var s = S_TAG;//status
135792
135919
  while(true){
135793
135920
  var c = source.charAt(p);
135921
+ if (s === S_TAG && c === '<') {
135922
+ // A `<` can never occur inside a tag name. Without this guard the scan runs
135923
+ // on to the next `>` (or EOF) before the tag name is rejected, so a document
135924
+ // with many `<` inside a malformed tag makes each one-character recovery step
135925
+ // re-scan to the distant `>` — O(n^2). Stopping at the `<` keeps each recovery
135926
+ // step bounded. The candidate scanned so far is reported raw, consistent with
135927
+ // the sibling invalid-tag-name throw below.
135928
+ throw new Error('unexpected < in tag name: ' + source.slice(start, p));
135929
+ }
135794
135930
  switch(c){
135795
135931
  case '=':
135796
135932
  if(s === S_ATTR){//attrName
@@ -135983,9 +136119,13 @@ function requireSax$1 () {
135983
136119
  if(nsPrefix !== false){//hack!!
135984
136120
  if(localNSMap == null){
135985
136121
  localNSMap = {};
135986
- //console.log(currentNSMap,0)
135987
- _copy(currentNSMap,currentNSMap={});
135988
- //console.log(currentNSMap,1)
136122
+ // Derive the child scope's namespace map by prototype-chain inheritance
136123
+ // instead of a flat copy: lookups inherit ancestor prefixes transparently,
136124
+ // so a document nesting N scopes retains O(N) map entries rather than
136125
+ // sum(1..N) = O(N^2). localNSMap stays a flat own-only record of the
136126
+ // prefixes declared at THIS element, so own-property enumeration
136127
+ // (endPrefixMapping below) still reports only local declarations.
136128
+ currentNSMap = Object.create(currentNSMap);
135989
136129
  }
135990
136130
  currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
135991
136131
  a.uri = NAMESPACE.XMLNS;
@@ -143024,7 +143164,7 @@ function requireMomentTimezone$1 () {
143024
143164
  hasRequiredMomentTimezone$1 = 1;
143025
143165
  (function (module) {
143026
143166
  //! moment-timezone.js
143027
- //! version : 0.6.3
143167
+ //! version : 0.6.6
143028
143168
  //! Copyright (c) JS Foundation and other contributors
143029
143169
  //! license : MIT
143030
143170
  //! github.com/moment/moment-timezone
@@ -143050,12 +143190,18 @@ function requireMomentTimezone$1 () {
143050
143190
  // return moment;
143051
143191
  // }
143052
143192
 
143053
- var VERSION = "0.6.3",
143193
+ var VERSION = "0.6.6",
143054
143194
  zones = {},
143055
143195
  links = {},
143056
143196
  countries = {},
143057
143197
  names = {},
143058
143198
  guesses = {},
143199
+ parsingInZone = false,
143200
+ parsingNow,
143201
+ parsingNowFunction,
143202
+ hasParsingNow = false,
143203
+ ignoreDefaultZoneForInput,
143204
+ hasIgnoredDefaultZoneInput = false,
143059
143205
  cachedGuess;
143060
143206
 
143061
143207
  if (!moment || typeof moment.version !== 'string') {
@@ -143227,17 +143373,16 @@ function requireMomentTimezone$1 () {
143227
143373
  offsets = this.offsets,
143228
143374
  untils = this.untils,
143229
143375
  max = untils.length - 1,
143230
- offset, offsetNext, offsetPrev, i;
143376
+ offset, offsetNext, i;
143231
143377
 
143232
143378
  for (i = 0; i < max; i++) {
143233
143379
  offset = offsets[i];
143234
143380
  offsetNext = offsets[i + 1];
143235
- offsetPrev = offsets[i ? i - 1 : i];
143236
143381
 
143237
143382
  if (offset < offsetNext && tz.moveAmbiguousForward) {
143238
143383
  offset = offsetNext;
143239
- } else if (offset > offsetPrev && tz.moveInvalidForward) {
143240
- offset = offsetPrev;
143384
+ } else if (offset > offsetNext && tz.moveInvalidForward) {
143385
+ offset = offsetNext;
143241
143386
  }
143242
143387
 
143243
143388
  if (target < untils[i] - (offset * 60000)) {
@@ -143262,6 +143407,15 @@ function requireMomentTimezone$1 () {
143262
143407
  }
143263
143408
  };
143264
143409
 
143410
+ var utcDefaultZone = new Zone();
143411
+ utcDefaultZone._set({
143412
+ name : 'UTC',
143413
+ abbrs : ['UTC'],
143414
+ untils : [Infinity],
143415
+ offsets : [0],
143416
+ population : 0
143417
+ });
143418
+
143265
143419
  /************************************
143266
143420
  Country object
143267
143421
  ************************************/
@@ -143275,6 +143429,10 @@ function requireMomentTimezone$1 () {
143275
143429
  Current Timezone
143276
143430
  ************************************/
143277
143431
 
143432
+ function hasOwnProp(a, b) {
143433
+ return Object.prototype.hasOwnProperty.call(a, b);
143434
+ }
143435
+
143278
143436
  function OffsetAt(at) {
143279
143437
  var timeString = at.toTimeString();
143280
143438
  var abbr = timeString.match(/\([a-z ]+\)/i);
@@ -143387,12 +143545,12 @@ function requireMomentTimezone$1 () {
143387
143545
 
143388
143546
  for (i = 0; i < offsetsLength; i++) {
143389
143547
  offset = offsets[i].offset;
143390
- if (checkedOffsets.hasOwnProperty(offset)) {
143548
+ if (hasOwnProp(checkedOffsets, offset)) {
143391
143549
  continue;
143392
143550
  }
143393
143551
  guessesOffset = guesses[offset] || {};
143394
143552
  for (j in guessesOffset) {
143395
- if (guessesOffset.hasOwnProperty(j)) {
143553
+ if (hasOwnProp(guessesOffset, j)) {
143396
143554
  filteredGuesses[j] = true;
143397
143555
  }
143398
143556
  }
@@ -143400,7 +143558,7 @@ function requireMomentTimezone$1 () {
143400
143558
  }
143401
143559
 
143402
143560
  for (i in filteredGuesses) {
143403
- if (filteredGuesses.hasOwnProperty(i)) {
143561
+ if (hasOwnProp(filteredGuesses, i)) {
143404
143562
  out.push(names[i]);
143405
143563
  }
143406
143564
  }
@@ -143455,7 +143613,7 @@ function requireMomentTimezone$1 () {
143455
143613
  ************************************/
143456
143614
 
143457
143615
  function normalizeName (name) {
143458
- return (name || '').toLowerCase().replace(/\//g, '_');
143616
+ return (typeof name === 'string' ? name : '').toLowerCase().replace(/\//g, '_');
143459
143617
  }
143460
143618
 
143461
143619
  function addZone (packed) {
@@ -143479,7 +143637,7 @@ function requireMomentTimezone$1 () {
143479
143637
 
143480
143638
  name = normalizeName(name);
143481
143639
 
143482
- var zone = zones[name];
143640
+ var zone = hasOwnProp(zones, name) ? zones[name] : undefined;
143483
143641
  var link;
143484
143642
 
143485
143643
  if (zone instanceof Zone) {
@@ -143493,7 +143651,7 @@ function requireMomentTimezone$1 () {
143493
143651
  }
143494
143652
 
143495
143653
  // Pass getZone to prevent recursion more than 1 level deep
143496
- if (links[name] && caller !== getZone && (link = getZone(links[name], getZone))) {
143654
+ if (hasOwnProp(links, name) && caller !== getZone && (link = getZone(links[name], getZone))) {
143497
143655
  zone = zones[name] = new Zone();
143498
143656
  zone._set(link);
143499
143657
  zone.name = names[name];
@@ -143507,7 +143665,7 @@ function requireMomentTimezone$1 () {
143507
143665
  var i, out = [];
143508
143666
 
143509
143667
  for (i in names) {
143510
- if (names.hasOwnProperty(i) && (zones[i] || zones[links[i]]) && names[i]) {
143668
+ if (hasOwnProp(names, i) && (zones[i] || zones[links[i]]) && names[i]) {
143511
143669
  out.push(names[i]);
143512
143670
  }
143513
143671
  }
@@ -143555,8 +143713,9 @@ function requireMomentTimezone$1 () {
143555
143713
  }
143556
143714
 
143557
143715
  function getCountry (name) {
143716
+ if (typeof name !== 'string') return null;
143558
143717
  name = name.toUpperCase();
143559
- return countries[name] || null;
143718
+ return hasOwnProp(countries, name) ? countries[name] : null;
143560
143719
  }
143561
143720
 
143562
143721
  function zonesForCountry(country, with_offset) {
@@ -143599,6 +143758,85 @@ function requireMomentTimezone$1 () {
143599
143758
  return !!(m._a && (m._tzm === undefined) && !isUnixTimestamp);
143600
143759
  }
143601
143760
 
143761
+ function isObjectInput (input) {
143762
+ var prop;
143763
+
143764
+ if (moment.isMoment(input) || input === null || Object.prototype.toString.call(input) !== '[object Object]') {
143765
+ return false;
143766
+ }
143767
+ if (Object.getOwnPropertyNames) {
143768
+ return Object.getOwnPropertyNames(input).length > 0;
143769
+ }
143770
+ for (prop in input) {
143771
+ if (hasOwnProp(input, prop)) {
143772
+ return true;
143773
+ }
143774
+ }
143775
+ return false;
143776
+ }
143777
+
143778
+ function parseWithZoneNow (args, name, stringInput) {
143779
+ var savedNow = moment.now,
143780
+ savedDefaultZone = moment.defaultZone,
143781
+ savedParsingInZone = parsingInZone,
143782
+ savedParsingNow = parsingNow,
143783
+ savedParsingNowFunction = parsingNowFunction,
143784
+ savedHasParsingNow = hasParsingNow,
143785
+ now,
143786
+ hasNow = false,
143787
+ zonedNow,
143788
+ wallNow,
143789
+ parsedDateParts,
143790
+ out;
143791
+
143792
+ if (!parsingInZone) {
143793
+ parsingNow = undefined;
143794
+ parsingNowFunction = savedNow;
143795
+ hasParsingNow = false;
143796
+ }
143797
+ parsingInZone = true;
143798
+ moment.now = function () {
143799
+ if (!hasNow) {
143800
+ if (!hasParsingNow) {
143801
+ parsingNow = parsingNowFunction.call(moment);
143802
+ hasParsingNow = true;
143803
+ }
143804
+ now = parsingNow;
143805
+ hasNow = true;
143806
+ zonedNow = moment.tz(now, name);
143807
+ wallNow = zonedNow.valueOf() + zonedNow.utcOffset() * 60000;
143808
+ }
143809
+ return wallNow;
143810
+ };
143811
+ if (stringInput) {
143812
+ moment.defaultZone = utcDefaultZone;
143813
+ }
143814
+ try {
143815
+ out = moment.utc.apply(null, args);
143816
+ if (stringInput && hasNow && out._a && out._tzm !== undefined) {
143817
+ parsedDateParts = out.parsingFlags().parsedDateParts;
143818
+ if (!parsedDateParts || parsedDateParts[0] == null || parsedDateParts[1] == null || parsedDateParts[2] == null) {
143819
+ moment.now = function () {
143820
+ return now;
143821
+ };
143822
+ moment.defaultZone = savedDefaultZone;
143823
+ out = moment.utc.apply(null, args);
143824
+ }
143825
+ }
143826
+ } finally {
143827
+ moment.now = savedNow;
143828
+ moment.defaultZone = savedDefaultZone;
143829
+ parsingInZone = savedParsingInZone;
143830
+ if (!savedParsingInZone) {
143831
+ parsingNow = savedParsingNow;
143832
+ parsingNowFunction = savedParsingNowFunction;
143833
+ hasParsingNow = savedHasParsingNow;
143834
+ }
143835
+ }
143836
+
143837
+ return out;
143838
+ }
143839
+
143602
143840
  function logError (message) {
143603
143841
  if (typeof console !== 'undefined' && typeof console.error === 'function') {
143604
143842
  console.error(message);
@@ -143612,10 +143850,13 @@ function requireMomentTimezone$1 () {
143612
143850
  function tz (input) {
143613
143851
  var args = Array.prototype.slice.call(arguments, 0, -1),
143614
143852
  name = arguments[arguments.length - 1],
143615
- out = moment.utc.apply(null, args),
143616
- zone;
143853
+ objectInput = isObjectInput(input),
143854
+ stringInput = args.length > 0 && typeof input === 'string',
143855
+ zone = objectInput || stringInput ? getZone(name) : null,
143856
+ out = objectInput && zone ? parseWithZoneNow(args, name) :
143857
+ stringInput && zone ? parseWithZoneNow(args, name, true) : moment.utc.apply(null, args);
143617
143858
 
143618
- if (!moment.isMoment(input) && needsOffset(out) && (zone = getZone(name))) {
143859
+ if (!moment.isMoment(input) && needsOffset(out) && (zone || (!objectInput && (zone = getZone(name))))) {
143619
143860
  out.add(zone.parse(out), 'minutes');
143620
143861
  }
143621
143862
 
@@ -143655,10 +143896,49 @@ function requireMomentTimezone$1 () {
143655
143896
  moment.tz = tz;
143656
143897
 
143657
143898
  moment.defaultZone = null;
143899
+ var momentGetDefaultDateParts = moment._getDefaultDateParts;
143900
+ if (momentGetDefaultDateParts) {
143901
+ moment._getDefaultDateParts = function (config, now, forWeek) {
143902
+ var zone = moment.defaultZone,
143903
+ zonedNow,
143904
+ dateParts,
143905
+ savedIgnoredInput,
143906
+ savedHasIgnoredInput;
143907
+ forWeek = forWeek || config._isDefaultDatePartsForWeek;
143908
+
143909
+ if (parsingInZone && config._tzm === undefined) {
143910
+ zonedNow = new Date(now);
143911
+ return [zonedNow.getUTCFullYear(), zonedNow.getUTCMonth(), zonedNow.getUTCDate()];
143912
+ }
143913
+
143914
+ if (zone && !config._useUTC && config._tzm === undefined) {
143915
+ zonedNow = new Date(now - zone.utcOffset(now) * 60000);
143916
+ return [zonedNow.getUTCFullYear(), zonedNow.getUTCMonth(), zonedNow.getUTCDate()];
143917
+ }
143918
+
143919
+ if (forWeek && (config._useUTC || config._tzm !== undefined)) {
143920
+ savedIgnoredInput = ignoreDefaultZoneForInput;
143921
+ savedHasIgnoredInput = hasIgnoredDefaultZoneInput;
143922
+ ignoreDefaultZoneForInput = now;
143923
+ hasIgnoredDefaultZoneInput = true;
143924
+ try {
143925
+ dateParts = momentGetDefaultDateParts.call(this, config, now, forWeek);
143926
+ } finally {
143927
+ ignoreDefaultZoneForInput = savedIgnoredInput;
143928
+ hasIgnoredDefaultZoneInput = savedHasIgnoredInput;
143929
+ }
143930
+ return dateParts;
143931
+ }
143932
+
143933
+ return momentGetDefaultDateParts.call(this, config, now, forWeek);
143934
+ };
143935
+ }
143658
143936
 
143659
143937
  moment.updateOffset = function (mom, keepTime) {
143660
- var zone = moment.defaultZone,
143661
- offset;
143938
+ var zone = hasIgnoredDefaultZoneInput && ignoreDefaultZoneForInput === mom._i ? null : moment.defaultZone,
143939
+ offset,
143940
+ localTimestamp,
143941
+ normalizedTimestamp;
143662
143942
 
143663
143943
  if (mom._z === undefined) {
143664
143944
  if (zone && needsOffset(mom) && !mom._isUTC && mom.isValid()) {
@@ -143669,6 +143949,20 @@ function requireMomentTimezone$1 () {
143669
143949
  }
143670
143950
  if (mom._z) {
143671
143951
  offset = mom._z.utcOffset(mom);
143952
+ if (keepTime) {
143953
+ // Resolve local times inside a forward gap using the configured
143954
+ // invalid-input policy before applying the new offset.
143955
+ localTimestamp = mom._d.valueOf();
143956
+ if (!mom._isUTC) {
143957
+ localTimestamp -= mom._d.getTimezoneOffset() * 60000;
143958
+ }
143959
+ if (mom._z.utcOffset(localTimestamp + offset * 60000) !== offset) {
143960
+ offset = mom._z.parse(localTimestamp);
143961
+ localTimestamp += offset * 60000;
143962
+ offset = mom._z.utcOffset(localTimestamp);
143963
+ normalizedTimestamp = localTimestamp - offset * 60000;
143964
+ }
143965
+ }
143672
143966
  if (Math.abs(offset) < 16) {
143673
143967
  offset = offset / 60;
143674
143968
  }
@@ -143679,6 +143973,9 @@ function requireMomentTimezone$1 () {
143679
143973
  } else {
143680
143974
  mom.zone(offset, keepTime);
143681
143975
  }
143976
+ if (normalizedTimestamp != null) {
143977
+ mom._d.setTime(normalizedTimestamp);
143978
+ }
143682
143979
  }
143683
143980
  };
143684
143981
 
@@ -188521,6 +188818,13 @@ function requireDom () {
188521
188818
  * used for attributes or DocumentType entities
188522
188819
  */
188523
188820
  function NamedNodeMap() {
188821
+ // nodeName -> Attr membership index; lets the parse-time de-duplication in
188822
+ // setNamedItem resolve an existing attribute in O(1) instead of scanning the
188823
+ // list, so building an element with M attributes costs O(M) rather than O(M^2).
188824
+ // The numbered entries and length remain the sole authority for attribute order.
188825
+ // Object.create(null) so an attribute named __proto__ or constructor is an
188826
+ // ordinary key.
188827
+ this._nameIndex = Object.create(null);
188524
188828
  }
188525
188829
  function _findNodeIndex(list,node){
188526
188830
  var i = list.length;
@@ -188529,12 +188833,27 @@ function requireDom () {
188529
188833
  }
188530
188834
  }
188531
188835
 
188836
+ function _nnmIndexAdd(list, attr) {
188837
+ list._nameIndex[attr.nodeName] = attr;
188838
+ }
188839
+ function _nnmIndexRemove(list, attr) {
188840
+ // Only drop the entry if it still points at this attribute; a replacement with
188841
+ // a different nodeName may already have re-keyed it.
188842
+ if (list._nameIndex[attr.nodeName] === attr) {
188843
+ delete list._nameIndex[attr.nodeName];
188844
+ }
188845
+ }
188846
+
188532
188847
  function _addNamedNode(el,list,newAttr,oldAttr){
188533
188848
  if(oldAttr){
188534
188849
  list[_findNodeIndex(list,oldAttr)] = newAttr;
188850
+ // oldAttr leaves the list; drop its index entry (its nodeName may differ
188851
+ // from newAttr's when the replacement came via setNamedItemNS).
188852
+ _nnmIndexRemove(list, oldAttr);
188535
188853
  }else {
188536
188854
  list[list.length++] = newAttr;
188537
188855
  }
188856
+ _nnmIndexAdd(list, newAttr);
188538
188857
  if(el){
188539
188858
  newAttr.ownerElement = el;
188540
188859
  var doc = el.ownerDocument;
@@ -188553,6 +188872,7 @@ function requireDom () {
188553
188872
  list[i] = list[++i];
188554
188873
  }
188555
188874
  list.length = lastIndex;
188875
+ _nnmIndexRemove(list, attr);
188556
188876
  if(el){
188557
188877
  var doc = el.ownerDocument;
188558
188878
  if(doc){
@@ -188586,7 +188906,11 @@ function requireDom () {
188586
188906
  if(el && el!=this._ownerElement){
188587
188907
  throw new DOMException(INUSE_ATTRIBUTE_ERR);
188588
188908
  }
188589
- var oldAttr = this.getNamedItem(attr.nodeName);
188909
+ // Resolve any existing attribute with the same nodeName through the O(1)
188910
+ // membership index rather than an O(M) scan — this is the parse-dedup hot
188911
+ // path (setAttributeNode per attribute during parse). Absent -> undefined,
188912
+ // matching getNamedItem's contract.
188913
+ var oldAttr = this._nameIndex[attr.nodeName];
188590
188914
  _addNamedNode(this._ownerElement,this,attr,oldAttr);
188591
188915
  return oldAttr;
188592
188916
  },
@@ -188819,9 +189143,38 @@ function requireDom () {
188819
189143
  while (child) {
188820
189144
  var next = child.nextSibling;
188821
189145
  if (next !== null && next.nodeType === TEXT_NODE && child.nodeType === TEXT_NODE) {
188822
- node.removeChild(next);
188823
- child.appendData(next.data);
188824
- // Do not advance child: re-check new nextSibling for another text run
189146
+ // Merge the whole run of adjacent text nodes at once: gather the
189147
+ // following text siblings' data, unlink them in a single pass, and
189148
+ // re-index the child list a single time. Per-sibling `removeChild`
189149
+ // (each an O(K) re-index) plus per-sibling `appendData` (each an O(K)
189150
+ // string rebuild) is O(K^2) over a long run of single-character text
189151
+ // nodes; this keeps it O(K). The first text node of the run survives
189152
+ // and carries the concatenated data, preserving node identity and
189153
+ // locator semantics.
189154
+ var tail = [];
189155
+ var sibling = next;
189156
+ while (sibling !== null && sibling.nodeType === TEXT_NODE) {
189157
+ tail.push(sibling.data);
189158
+ sibling = sibling.nextSibling;
189159
+ }
189160
+ // `sibling` is now the first non-text node after the run, or null.
189161
+ var removed = child.nextSibling;
189162
+ while (removed !== sibling) {
189163
+ var following = removed.nextSibling;
189164
+ removed.parentNode = null;
189165
+ removed.previousSibling = null;
189166
+ removed.nextSibling = null;
189167
+ removed = following;
189168
+ }
189169
+ child.nextSibling = sibling;
189170
+ if (sibling !== null) {
189171
+ sibling.previousSibling = child;
189172
+ } else {
189173
+ node.lastChild = child;
189174
+ }
189175
+ child.appendData(tail.join('')); // single O(K) string rebuild
189176
+ _onUpdateChild(node.ownerDocument, node); // single O(K) re-index
189177
+ child = sibling;
188825
189178
  } else {
188826
189179
  child = next;
188827
189180
  }
@@ -189632,8 +189985,10 @@ function requireDom () {
189632
189985
  * - it does not do any input validation on the arguments and doesn't throw "InvalidCharacterError".
189633
189986
  *
189634
189987
  * Note: When the resulting document is serialized with `requireWellFormed: true`, the
189635
- * serializer throws with code `INVALID_STATE_ERR` if `.data` contains `?>` (W3C DOM Parsing
189636
- * §3.2.1.7). Without that option the data is emitted verbatim.
189988
+ * serializer throws with code `INVALID_STATE_ERR` if `.target` is not a valid XML `NCName`
189989
+ * (a `Name` with no colon) or is an ASCII case-insensitive match for `"xml"`, or if `.data`
189990
+ * contains `?>` (W3C DOM Parsing §3.2.1.7). Without that option the target and data are
189991
+ * emitted verbatim.
189637
189992
  *
189638
189993
  * @param {string} target
189639
189994
  * @param {string} data
@@ -189658,7 +190013,27 @@ function requireDom () {
189658
190013
  node.specified = true;
189659
190014
  return node;
189660
190015
  },
190016
+ /**
190017
+ * Creates an EntityReference object, serialized as `&name;`.
190018
+ *
190019
+ * The `name` is validated against the XML `Name` production at creation time; an invalid name
190020
+ * throws a `DOMException` with code `INVALID_CHARACTER_ERR`. When the resulting node is
190021
+ * serialized with `requireWellFormed: true`, the serializer re-validates `nodeName` and throws
190022
+ * a `DOMException` with code `INVALID_STATE_ERR` if a later `nodeName` mutation made it invalid;
190023
+ * without that option the name is emitted verbatim.
190024
+ *
190025
+ * Note: xmldom does not expand entities — the parser resolves entity references inline and never
190026
+ * constructs `EntityReference` nodes, so this method is the only producer.
190027
+ *
190028
+ * @param {string} name The name of the entity to reference.
190029
+ * @returns {EntityReference}
190030
+ * @throws {DOMException} With code `INVALID_CHARACTER_ERR` when `name` is not a valid XML `Name`.
190031
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-392B75AE
190032
+ */
189661
190033
  createEntityReference : function(name){
190034
+ if (!tagNamePattern.test(name)) {
190035
+ throw new DOMException(INVALID_CHARACTER_ERR, 'not a valid xml name "' + name + '"');
190036
+ }
189662
190037
  var node = new EntityReference();
189663
190038
  node.ownerDocument = this;
189664
190039
  node.nodeName = name;
@@ -189870,15 +190245,16 @@ function requireDom () {
189870
190245
  /**
189871
190246
  * Represents a DocumentType node (the `<!DOCTYPE ...>` declaration).
189872
190247
  *
189873
- * `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
190248
+ * `name`, `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
189874
190249
  * xmldom does not enforce the `readonly` constraint declared by the WHATWG DOM spec —
189875
190250
  * direct property writes succeed silently. Values are serialized verbatim when
189876
190251
  * `requireWellFormed` is false (the default). When the serializer is invoked with
189877
190252
  * `requireWellFormed: true` (via the 4th-parameter options object), it validates each
189878
- * field and throws `DOMException` with code `INVALID_STATE_ERR` on invalid values.
190253
+ * field — including `name`, which is checked against the XML `Name` production — and throws
190254
+ * `DOMException` with code `INVALID_STATE_ERR` on invalid values.
189879
190255
  *
189880
190256
  * @class
189881
- * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentType MDN
190257
+ * @see https://developer.mozilla.org/docs/Web/API/DocumentType MDN
189882
190258
  */
189883
190259
  function DocumentType() {
189884
190260
  } DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
@@ -189892,6 +190268,20 @@ function requireDom () {
189892
190268
  } Entity.prototype.nodeType = ENTITY_NODE;
189893
190269
  _extends(Entity,Node);
189894
190270
 
190271
+ /**
190272
+ * Represents an EntityReference node, serialized as `&nodeName;`.
190273
+ *
190274
+ * `nodeName` is the referenced entity's name, stored verbatim. When serialized with
190275
+ * `requireWellFormed: true`, the serializer validates `nodeName` against the XML `Name` production
190276
+ * and throws a `DOMException` with code `INVALID_STATE_ERR` if it does not match; without that
190277
+ * option the name is emitted verbatim between `&` and `;`.
190278
+ *
190279
+ * Note: xmldom does not expand entities — the parser resolves entity references inline and never
190280
+ * constructs `EntityReference` nodes, so the only producer is `Document.createEntityReference`.
190281
+ *
190282
+ * @class
190283
+ * @see https://www.w3.org/TR/xml/#NT-Name
190284
+ */
189895
190285
  function EntityReference() {
189896
190286
  } EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
189897
190287
  _extends(EntityReference,Node);
@@ -189934,12 +190324,15 @@ function requireDom () {
189934
190324
  * not a valid XML QName,
189935
190325
  * - a CDATASection node's data contains `"]]>"`,
189936
190326
  * - a Comment node's data contains `"-->"` (bare `"--"` does not throw on this branch),
189937
- * - a ProcessingInstruction's data contains `"?>"`,
190327
+ * - a ProcessingInstruction's target is not a valid XML `NCName` (a `Name` with no colon) or is
190328
+ * an ASCII case-insensitive match for `"xml"`, or its data contains `"?>"`,
190329
+ * - a DocumentType's `name` is not a valid XML `Name` (XML 1.0 production [5]),
189938
190330
  * - a DocumentType's `publicId` is non-empty and does not match the XML `PubidLiteral`
189939
190331
  * production,
189940
190332
  * - a DocumentType's `systemId` is non-empty and does not match the XML `SystemLiteral`
189941
- * production, or
189942
- * - a DocumentType's `internalSubset` contains `"]>"`.
190333
+ * production,
190334
+ * - a DocumentType's `internalSubset` contains `"]>"`, or
190335
+ * - an EntityReference's `nodeName` is not a valid XML `Name` (XML 1.0 production [5]).
189943
190336
  * Note: xmldom does not enforce `readonly` on DocumentType fields — direct property
189944
190337
  * writes succeed and are covered by the serializer-level checks above.
189945
190338
  * @see https://html.spec.whatwg.org/#dom-xmlserializer-serializetostring
@@ -190194,6 +190587,9 @@ function requireDom () {
190194
190587
 
190195
190588
  case DOCUMENT_TYPE_NODE:
190196
190589
  if (requireWellFormed) {
190590
+ if (!tagNamePattern.test(n.name)) {
190591
+ throw new DOMException(INVALID_STATE_ERR, 'The doctype name "' + n.name + '" is not a valid XML Name');
190592
+ }
190197
190593
  if (n.publicId && !/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(n.publicId)) {
190198
190594
  throw new DOMException(INVALID_STATE_ERR, 'DocumentType publicId is not a valid PubidLiteral');
190199
190595
  }
@@ -190225,13 +190621,27 @@ function requireDom () {
190225
190621
  return null;
190226
190622
 
190227
190623
  case PROCESSING_INSTRUCTION_NODE:
190228
- if (requireWellFormed && n.data.indexOf('?>') !== -1) {
190229
- throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
190624
+ if (requireWellFormed) {
190625
+ if (!tagNamePattern.test(n.target) || n.target.indexOf(':') !== -1 || n.target.toLowerCase() === 'xml') {
190626
+ throw new DOMException(
190627
+ INVALID_STATE_ERR,
190628
+ 'The processing instruction target "' + n.target + '" is not a valid XML NCName or is reserved'
190629
+ );
190630
+ }
190631
+ if (n.data.indexOf('?>') !== -1) {
190632
+ throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
190633
+ }
190230
190634
  }
190231
190635
  buf.push('<?', n.target, ' ', n.data, '?>');
190232
190636
  return null;
190233
190637
 
190234
190638
  case ENTITY_REFERENCE_NODE:
190639
+ if (requireWellFormed && !tagNamePattern.test(n.nodeName)) {
190640
+ throw new DOMException(
190641
+ INVALID_STATE_ERR,
190642
+ 'The entity reference name "' + n.nodeName + '" is not a valid XML Name'
190643
+ );
190644
+ }
190235
190645
  buf.push('&', n.nodeName, ';');
190236
190646
  return null;
190237
190647
 
@@ -192724,7 +193134,13 @@ function requireSax () {
192724
193134
  switch(source.charAt(tagStart+1)){
192725
193135
  case '/':
192726
193136
  var end = source.indexOf('>',tagStart+3);
192727
- var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, '');
193137
+ // Anchored trailing-whitespace trim. The former `/[ \t\n\r]+$/g` backtracked
193138
+ // quadratically on a name shaped `whitespace-run + non-whitespace char`
193139
+ // (an end tag `</ … x>`): from every start position it extended `[ws]+`
193140
+ // to the end and then failed the `$` anchor. This anchored form matches the
193141
+ // whole string once and captures everything up to the last non-whitespace
193142
+ // character, so it trims in linear time with byte-identical output.
193143
+ var tagName = source.substring(tagStart + 2, end).replace(/^([\s\S]*?[^ \t\n\r])?[ \t\n\r]*$/, '$1');
192728
193144
  var config = parseStack.pop();
192729
193145
  if(end<0){
192730
193146
 
@@ -192735,6 +193151,14 @@ function requireSax () {
192735
193151
  tagName = tagName.replace(/[\s<].*/,'');
192736
193152
  errorHandler.error("end tag name: "+tagName+' maybe not complete');
192737
193153
  end = tagStart+1+tagName.length;
193154
+ }else if(/[ \t\n\r]/.test(tagName) && tagNamePattern.test(tagName.split(/[ \t\n\r]/)[0])){
193155
+ // The XML `ETag` production is `'</' Name S? '>'`: only optional whitespace may follow
193156
+ // the `Name`. A valid `Name` followed by whitespace and non-whitespace residue (e.g.
193157
+ // `</a\nbogus>` or `</a bogus>`) is not well-formed, but historically it was silently
193158
+ // accepted (the malformed end tag ignored, the residue dropped, the element left on the
193159
+ // stack). Report it as a recoverable `error` (which a custom errorHandler may escalate to
193160
+ // fatal) while keeping the existing recovery so the parsed DOM stays byte-identical.
193161
+ errorHandler.error('end tag name is followed by whitespace and trailing content: "'+tagName+'"');
192738
193162
  }
192739
193163
  var localNSMap = config.localNSMap;
192740
193164
  var endMatch = config.tagName == tagName;
@@ -192858,6 +193282,15 @@ function requireSax () {
192858
193282
  var s = S_TAG;//status
192859
193283
  while(true){
192860
193284
  var c = source.charAt(p);
193285
+ if (s === S_TAG && c === '<') {
193286
+ // A `<` can never occur inside a tag name. Without this guard the scan runs
193287
+ // on to the next `>` (or EOF) before the tag name is rejected, so a document
193288
+ // with many `<` inside a malformed tag makes each one-character recovery step
193289
+ // re-scan to the distant `>` — O(n^2). Stopping at the `<` keeps each recovery
193290
+ // step bounded. The candidate scanned so far is reported raw, consistent with
193291
+ // the sibling invalid-tag-name throw below.
193292
+ throw new Error('unexpected < in tag name: ' + source.slice(start, p));
193293
+ }
192861
193294
  switch(c){
192862
193295
  case '=':
192863
193296
  if(s === S_ATTR){//attrName
@@ -193050,9 +193483,13 @@ function requireSax () {
193050
193483
  if(nsPrefix !== false){//hack!!
193051
193484
  if(localNSMap == null){
193052
193485
  localNSMap = {};
193053
- //console.log(currentNSMap,0)
193054
- _copy(currentNSMap,currentNSMap={});
193055
- //console.log(currentNSMap,1)
193486
+ // Derive the child scope's namespace map by prototype-chain inheritance
193487
+ // instead of a flat copy: lookups inherit ancestor prefixes transparently,
193488
+ // so a document nesting N scopes retains O(N) map entries rather than
193489
+ // sum(1..N) = O(N^2). localNSMap stays a flat own-only record of the
193490
+ // prefixes declared at THIS element, so own-property enumeration
193491
+ // (endPrefixMapping below) still reports only local declarations.
193492
+ currentNSMap = Object.create(currentNSMap);
193056
193493
  }
193057
193494
  currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
193058
193495
  a.uri = NAMESPACE.XMLNS;
@@ -200091,7 +200528,7 @@ function requireMomentTimezone () {
200091
200528
  hasRequiredMomentTimezone = 1;
200092
200529
  (function (module) {
200093
200530
  //! moment-timezone.js
200094
- //! version : 0.6.3
200531
+ //! version : 0.6.6
200095
200532
  //! Copyright (c) JS Foundation and other contributors
200096
200533
  //! license : MIT
200097
200534
  //! github.com/moment/moment-timezone
@@ -200117,12 +200554,18 @@ function requireMomentTimezone () {
200117
200554
  // return moment;
200118
200555
  // }
200119
200556
 
200120
- var VERSION = "0.6.3",
200557
+ var VERSION = "0.6.6",
200121
200558
  zones = {},
200122
200559
  links = {},
200123
200560
  countries = {},
200124
200561
  names = {},
200125
200562
  guesses = {},
200563
+ parsingInZone = false,
200564
+ parsingNow,
200565
+ parsingNowFunction,
200566
+ hasParsingNow = false,
200567
+ ignoreDefaultZoneForInput,
200568
+ hasIgnoredDefaultZoneInput = false,
200126
200569
  cachedGuess;
200127
200570
 
200128
200571
  if (!moment || typeof moment.version !== 'string') {
@@ -200294,17 +200737,16 @@ function requireMomentTimezone () {
200294
200737
  offsets = this.offsets,
200295
200738
  untils = this.untils,
200296
200739
  max = untils.length - 1,
200297
- offset, offsetNext, offsetPrev, i;
200740
+ offset, offsetNext, i;
200298
200741
 
200299
200742
  for (i = 0; i < max; i++) {
200300
200743
  offset = offsets[i];
200301
200744
  offsetNext = offsets[i + 1];
200302
- offsetPrev = offsets[i ? i - 1 : i];
200303
200745
 
200304
200746
  if (offset < offsetNext && tz.moveAmbiguousForward) {
200305
200747
  offset = offsetNext;
200306
- } else if (offset > offsetPrev && tz.moveInvalidForward) {
200307
- offset = offsetPrev;
200748
+ } else if (offset > offsetNext && tz.moveInvalidForward) {
200749
+ offset = offsetNext;
200308
200750
  }
200309
200751
 
200310
200752
  if (target < untils[i] - (offset * 60000)) {
@@ -200329,6 +200771,15 @@ function requireMomentTimezone () {
200329
200771
  }
200330
200772
  };
200331
200773
 
200774
+ var utcDefaultZone = new Zone();
200775
+ utcDefaultZone._set({
200776
+ name : 'UTC',
200777
+ abbrs : ['UTC'],
200778
+ untils : [Infinity],
200779
+ offsets : [0],
200780
+ population : 0
200781
+ });
200782
+
200332
200783
  /************************************
200333
200784
  Country object
200334
200785
  ************************************/
@@ -200342,6 +200793,10 @@ function requireMomentTimezone () {
200342
200793
  Current Timezone
200343
200794
  ************************************/
200344
200795
 
200796
+ function hasOwnProp(a, b) {
200797
+ return Object.prototype.hasOwnProperty.call(a, b);
200798
+ }
200799
+
200345
200800
  function OffsetAt(at) {
200346
200801
  var timeString = at.toTimeString();
200347
200802
  var abbr = timeString.match(/\([a-z ]+\)/i);
@@ -200454,12 +200909,12 @@ function requireMomentTimezone () {
200454
200909
 
200455
200910
  for (i = 0; i < offsetsLength; i++) {
200456
200911
  offset = offsets[i].offset;
200457
- if (checkedOffsets.hasOwnProperty(offset)) {
200912
+ if (hasOwnProp(checkedOffsets, offset)) {
200458
200913
  continue;
200459
200914
  }
200460
200915
  guessesOffset = guesses[offset] || {};
200461
200916
  for (j in guessesOffset) {
200462
- if (guessesOffset.hasOwnProperty(j)) {
200917
+ if (hasOwnProp(guessesOffset, j)) {
200463
200918
  filteredGuesses[j] = true;
200464
200919
  }
200465
200920
  }
@@ -200467,7 +200922,7 @@ function requireMomentTimezone () {
200467
200922
  }
200468
200923
 
200469
200924
  for (i in filteredGuesses) {
200470
- if (filteredGuesses.hasOwnProperty(i)) {
200925
+ if (hasOwnProp(filteredGuesses, i)) {
200471
200926
  out.push(names[i]);
200472
200927
  }
200473
200928
  }
@@ -200522,7 +200977,7 @@ function requireMomentTimezone () {
200522
200977
  ************************************/
200523
200978
 
200524
200979
  function normalizeName (name) {
200525
- return (name || '').toLowerCase().replace(/\//g, '_');
200980
+ return (typeof name === 'string' ? name : '').toLowerCase().replace(/\//g, '_');
200526
200981
  }
200527
200982
 
200528
200983
  function addZone (packed) {
@@ -200546,7 +201001,7 @@ function requireMomentTimezone () {
200546
201001
 
200547
201002
  name = normalizeName(name);
200548
201003
 
200549
- var zone = zones[name];
201004
+ var zone = hasOwnProp(zones, name) ? zones[name] : undefined;
200550
201005
  var link;
200551
201006
 
200552
201007
  if (zone instanceof Zone) {
@@ -200560,7 +201015,7 @@ function requireMomentTimezone () {
200560
201015
  }
200561
201016
 
200562
201017
  // Pass getZone to prevent recursion more than 1 level deep
200563
- if (links[name] && caller !== getZone && (link = getZone(links[name], getZone))) {
201018
+ if (hasOwnProp(links, name) && caller !== getZone && (link = getZone(links[name], getZone))) {
200564
201019
  zone = zones[name] = new Zone();
200565
201020
  zone._set(link);
200566
201021
  zone.name = names[name];
@@ -200574,7 +201029,7 @@ function requireMomentTimezone () {
200574
201029
  var i, out = [];
200575
201030
 
200576
201031
  for (i in names) {
200577
- if (names.hasOwnProperty(i) && (zones[i] || zones[links[i]]) && names[i]) {
201032
+ if (hasOwnProp(names, i) && (zones[i] || zones[links[i]]) && names[i]) {
200578
201033
  out.push(names[i]);
200579
201034
  }
200580
201035
  }
@@ -200622,8 +201077,9 @@ function requireMomentTimezone () {
200622
201077
  }
200623
201078
 
200624
201079
  function getCountry (name) {
201080
+ if (typeof name !== 'string') return null;
200625
201081
  name = name.toUpperCase();
200626
- return countries[name] || null;
201082
+ return hasOwnProp(countries, name) ? countries[name] : null;
200627
201083
  }
200628
201084
 
200629
201085
  function zonesForCountry(country, with_offset) {
@@ -200666,6 +201122,85 @@ function requireMomentTimezone () {
200666
201122
  return !!(m._a && (m._tzm === undefined) && !isUnixTimestamp);
200667
201123
  }
200668
201124
 
201125
+ function isObjectInput (input) {
201126
+ var prop;
201127
+
201128
+ if (moment.isMoment(input) || input === null || Object.prototype.toString.call(input) !== '[object Object]') {
201129
+ return false;
201130
+ }
201131
+ if (Object.getOwnPropertyNames) {
201132
+ return Object.getOwnPropertyNames(input).length > 0;
201133
+ }
201134
+ for (prop in input) {
201135
+ if (hasOwnProp(input, prop)) {
201136
+ return true;
201137
+ }
201138
+ }
201139
+ return false;
201140
+ }
201141
+
201142
+ function parseWithZoneNow (args, name, stringInput) {
201143
+ var savedNow = moment.now,
201144
+ savedDefaultZone = moment.defaultZone,
201145
+ savedParsingInZone = parsingInZone,
201146
+ savedParsingNow = parsingNow,
201147
+ savedParsingNowFunction = parsingNowFunction,
201148
+ savedHasParsingNow = hasParsingNow,
201149
+ now,
201150
+ hasNow = false,
201151
+ zonedNow,
201152
+ wallNow,
201153
+ parsedDateParts,
201154
+ out;
201155
+
201156
+ if (!parsingInZone) {
201157
+ parsingNow = undefined;
201158
+ parsingNowFunction = savedNow;
201159
+ hasParsingNow = false;
201160
+ }
201161
+ parsingInZone = true;
201162
+ moment.now = function () {
201163
+ if (!hasNow) {
201164
+ if (!hasParsingNow) {
201165
+ parsingNow = parsingNowFunction.call(moment);
201166
+ hasParsingNow = true;
201167
+ }
201168
+ now = parsingNow;
201169
+ hasNow = true;
201170
+ zonedNow = moment.tz(now, name);
201171
+ wallNow = zonedNow.valueOf() + zonedNow.utcOffset() * 60000;
201172
+ }
201173
+ return wallNow;
201174
+ };
201175
+ if (stringInput) {
201176
+ moment.defaultZone = utcDefaultZone;
201177
+ }
201178
+ try {
201179
+ out = moment.utc.apply(null, args);
201180
+ if (stringInput && hasNow && out._a && out._tzm !== undefined) {
201181
+ parsedDateParts = out.parsingFlags().parsedDateParts;
201182
+ if (!parsedDateParts || parsedDateParts[0] == null || parsedDateParts[1] == null || parsedDateParts[2] == null) {
201183
+ moment.now = function () {
201184
+ return now;
201185
+ };
201186
+ moment.defaultZone = savedDefaultZone;
201187
+ out = moment.utc.apply(null, args);
201188
+ }
201189
+ }
201190
+ } finally {
201191
+ moment.now = savedNow;
201192
+ moment.defaultZone = savedDefaultZone;
201193
+ parsingInZone = savedParsingInZone;
201194
+ if (!savedParsingInZone) {
201195
+ parsingNow = savedParsingNow;
201196
+ parsingNowFunction = savedParsingNowFunction;
201197
+ hasParsingNow = savedHasParsingNow;
201198
+ }
201199
+ }
201200
+
201201
+ return out;
201202
+ }
201203
+
200669
201204
  function logError (message) {
200670
201205
  if (typeof console !== 'undefined' && typeof console.error === 'function') {
200671
201206
  console.error(message);
@@ -200679,10 +201214,13 @@ function requireMomentTimezone () {
200679
201214
  function tz (input) {
200680
201215
  var args = Array.prototype.slice.call(arguments, 0, -1),
200681
201216
  name = arguments[arguments.length - 1],
200682
- out = moment.utc.apply(null, args),
200683
- zone;
201217
+ objectInput = isObjectInput(input),
201218
+ stringInput = args.length > 0 && typeof input === 'string',
201219
+ zone = objectInput || stringInput ? getZone(name) : null,
201220
+ out = objectInput && zone ? parseWithZoneNow(args, name) :
201221
+ stringInput && zone ? parseWithZoneNow(args, name, true) : moment.utc.apply(null, args);
200684
201222
 
200685
- if (!moment.isMoment(input) && needsOffset(out) && (zone = getZone(name))) {
201223
+ if (!moment.isMoment(input) && needsOffset(out) && (zone || (!objectInput && (zone = getZone(name))))) {
200686
201224
  out.add(zone.parse(out), 'minutes');
200687
201225
  }
200688
201226
 
@@ -200722,10 +201260,49 @@ function requireMomentTimezone () {
200722
201260
  moment.tz = tz;
200723
201261
 
200724
201262
  moment.defaultZone = null;
201263
+ var momentGetDefaultDateParts = moment._getDefaultDateParts;
201264
+ if (momentGetDefaultDateParts) {
201265
+ moment._getDefaultDateParts = function (config, now, forWeek) {
201266
+ var zone = moment.defaultZone,
201267
+ zonedNow,
201268
+ dateParts,
201269
+ savedIgnoredInput,
201270
+ savedHasIgnoredInput;
201271
+ forWeek = forWeek || config._isDefaultDatePartsForWeek;
201272
+
201273
+ if (parsingInZone && config._tzm === undefined) {
201274
+ zonedNow = new Date(now);
201275
+ return [zonedNow.getUTCFullYear(), zonedNow.getUTCMonth(), zonedNow.getUTCDate()];
201276
+ }
201277
+
201278
+ if (zone && !config._useUTC && config._tzm === undefined) {
201279
+ zonedNow = new Date(now - zone.utcOffset(now) * 60000);
201280
+ return [zonedNow.getUTCFullYear(), zonedNow.getUTCMonth(), zonedNow.getUTCDate()];
201281
+ }
201282
+
201283
+ if (forWeek && (config._useUTC || config._tzm !== undefined)) {
201284
+ savedIgnoredInput = ignoreDefaultZoneForInput;
201285
+ savedHasIgnoredInput = hasIgnoredDefaultZoneInput;
201286
+ ignoreDefaultZoneForInput = now;
201287
+ hasIgnoredDefaultZoneInput = true;
201288
+ try {
201289
+ dateParts = momentGetDefaultDateParts.call(this, config, now, forWeek);
201290
+ } finally {
201291
+ ignoreDefaultZoneForInput = savedIgnoredInput;
201292
+ hasIgnoredDefaultZoneInput = savedHasIgnoredInput;
201293
+ }
201294
+ return dateParts;
201295
+ }
201296
+
201297
+ return momentGetDefaultDateParts.call(this, config, now, forWeek);
201298
+ };
201299
+ }
200725
201300
 
200726
201301
  moment.updateOffset = function (mom, keepTime) {
200727
- var zone = moment.defaultZone,
200728
- offset;
201302
+ var zone = hasIgnoredDefaultZoneInput && ignoreDefaultZoneForInput === mom._i ? null : moment.defaultZone,
201303
+ offset,
201304
+ localTimestamp,
201305
+ normalizedTimestamp;
200729
201306
 
200730
201307
  if (mom._z === undefined) {
200731
201308
  if (zone && needsOffset(mom) && !mom._isUTC && mom.isValid()) {
@@ -200736,6 +201313,20 @@ function requireMomentTimezone () {
200736
201313
  }
200737
201314
  if (mom._z) {
200738
201315
  offset = mom._z.utcOffset(mom);
201316
+ if (keepTime) {
201317
+ // Resolve local times inside a forward gap using the configured
201318
+ // invalid-input policy before applying the new offset.
201319
+ localTimestamp = mom._d.valueOf();
201320
+ if (!mom._isUTC) {
201321
+ localTimestamp -= mom._d.getTimezoneOffset() * 60000;
201322
+ }
201323
+ if (mom._z.utcOffset(localTimestamp + offset * 60000) !== offset) {
201324
+ offset = mom._z.parse(localTimestamp);
201325
+ localTimestamp += offset * 60000;
201326
+ offset = mom._z.utcOffset(localTimestamp);
201327
+ normalizedTimestamp = localTimestamp - offset * 60000;
201328
+ }
201329
+ }
200739
201330
  if (Math.abs(offset) < 16) {
200740
201331
  offset = offset / 60;
200741
201332
  }
@@ -200746,6 +201337,9 @@ function requireMomentTimezone () {
200746
201337
  } else {
200747
201338
  mom.zone(offset, keepTime);
200748
201339
  }
201340
+ if (normalizedTimestamp != null) {
201341
+ mom._d.setTime(normalizedTimestamp);
201342
+ }
200749
201343
  }
200750
201344
  };
200751
201345