@wavemaker/angular-codegen 11.15.5-rc.647638 → 11.15.5-rc.647771

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.
@@ -35719,8 +35719,8 @@ const getDataSource = (dataSetExpr) => {
35719
35719
  if (parts[0] === 'Variables' || parts[0] === 'Widgets') {
35720
35720
  return `${parts[0]}.${parts[1]}`;
35721
35721
  }
35722
- if (parts[0] === 'App' && parts[1] === 'activePage' && parts[2] === 'Variables' && parts[3]) {
35723
- return `App.activePage.Variables.${parts[3]}`;
35722
+ if (parts[0] === 'App' && parts[1] === 'activePage' && parts[2]?.includes('Variables') && parts[3]) {
35723
+ return `App.activePage.${parts[2]}.${parts[3]}`;
35724
35724
  }
35725
35725
  };
35726
35726
  const widgetChildAttrs = (() => {
@@ -37722,11 +37722,22 @@ function requireConventions () {
37722
37722
  XMLNS: 'http://www.w3.org/2000/xmlns/',
37723
37723
  });
37724
37724
 
37725
+ //[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
37726
+ //[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
37727
+ //[5] Name ::= NameStartChar (NameChar)*
37728
+ var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;//\u10000-\uEFFFF
37729
+ var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");
37730
+ var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$');
37731
+ //var tagNamePattern = /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/
37732
+
37725
37733
  conventions.assign = assign;
37726
37734
  conventions.find = find;
37727
37735
  conventions.freeze = freeze;
37728
37736
  conventions.MIME_TYPE = MIME_TYPE;
37729
37737
  conventions.NAMESPACE = NAMESPACE;
37738
+ conventions.nameStartChar = nameStartChar;
37739
+ conventions.nameChar = nameChar;
37740
+ conventions.tagNamePattern = tagNamePattern;
37730
37741
  return conventions;
37731
37742
  }
37732
37743
 
@@ -37739,6 +37750,7 @@ function requireDom () {
37739
37750
 
37740
37751
  var find = conventions.find;
37741
37752
  var NAMESPACE = conventions.NAMESPACE;
37753
+ var tagNamePattern = conventions.tagNamePattern;
37742
37754
 
37743
37755
  /**
37744
37756
  * A prerequisite for `[].filter`, to drop elements that are empty
@@ -37970,6 +37982,13 @@ function requireDom () {
37970
37982
  * used for attributes or DocumentType entities
37971
37983
  */
37972
37984
  function NamedNodeMap() {
37985
+ // nodeName -> Attr membership index; lets the parse-time de-duplication in
37986
+ // setNamedItem resolve an existing attribute in O(1) instead of scanning the
37987
+ // list, so building an element with M attributes costs O(M) rather than O(M^2).
37988
+ // The numbered entries and length remain the sole authority for attribute order.
37989
+ // Object.create(null) so an attribute named __proto__ or constructor is an
37990
+ // ordinary key.
37991
+ this._nameIndex = Object.create(null);
37973
37992
  }
37974
37993
  function _findNodeIndex(list,node){
37975
37994
  var i = list.length;
@@ -37978,12 +37997,27 @@ function requireDom () {
37978
37997
  }
37979
37998
  }
37980
37999
 
38000
+ function _nnmIndexAdd(list, attr) {
38001
+ list._nameIndex[attr.nodeName] = attr;
38002
+ }
38003
+ function _nnmIndexRemove(list, attr) {
38004
+ // Only drop the entry if it still points at this attribute; a replacement with
38005
+ // a different nodeName may already have re-keyed it.
38006
+ if (list._nameIndex[attr.nodeName] === attr) {
38007
+ delete list._nameIndex[attr.nodeName];
38008
+ }
38009
+ }
38010
+
37981
38011
  function _addNamedNode(el,list,newAttr,oldAttr){
37982
38012
  if(oldAttr){
37983
38013
  list[_findNodeIndex(list,oldAttr)] = newAttr;
38014
+ // oldAttr leaves the list; drop its index entry (its nodeName may differ
38015
+ // from newAttr's when the replacement came via setNamedItemNS).
38016
+ _nnmIndexRemove(list, oldAttr);
37984
38017
  }else {
37985
38018
  list[list.length++] = newAttr;
37986
38019
  }
38020
+ _nnmIndexAdd(list, newAttr);
37987
38021
  if(el){
37988
38022
  newAttr.ownerElement = el;
37989
38023
  var doc = el.ownerDocument;
@@ -38002,6 +38036,7 @@ function requireDom () {
38002
38036
  list[i] = list[++i];
38003
38037
  }
38004
38038
  list.length = lastIndex;
38039
+ _nnmIndexRemove(list, attr);
38005
38040
  if(el){
38006
38041
  var doc = el.ownerDocument;
38007
38042
  if(doc){
@@ -38035,7 +38070,11 @@ function requireDom () {
38035
38070
  if(el && el!=this._ownerElement){
38036
38071
  throw new DOMException(INUSE_ATTRIBUTE_ERR);
38037
38072
  }
38038
- var oldAttr = this.getNamedItem(attr.nodeName);
38073
+ // Resolve any existing attribute with the same nodeName through the O(1)
38074
+ // membership index rather than an O(M) scan — this is the parse-dedup hot
38075
+ // path (setAttributeNode per attribute during parse). Absent -> undefined,
38076
+ // matching getNamedItem's contract.
38077
+ var oldAttr = this._nameIndex[attr.nodeName];
38039
38078
  _addNamedNode(this._ownerElement,this,attr,oldAttr);
38040
38079
  return oldAttr;
38041
38080
  },
@@ -38268,9 +38307,38 @@ function requireDom () {
38268
38307
  while (child) {
38269
38308
  var next = child.nextSibling;
38270
38309
  if (next !== null && next.nodeType === TEXT_NODE && child.nodeType === TEXT_NODE) {
38271
- node.removeChild(next);
38272
- child.appendData(next.data);
38273
- // Do not advance child: re-check new nextSibling for another text run
38310
+ // Merge the whole run of adjacent text nodes at once: gather the
38311
+ // following text siblings' data, unlink them in a single pass, and
38312
+ // re-index the child list a single time. Per-sibling `removeChild`
38313
+ // (each an O(K) re-index) plus per-sibling `appendData` (each an O(K)
38314
+ // string rebuild) is O(K^2) over a long run of single-character text
38315
+ // nodes; this keeps it O(K). The first text node of the run survives
38316
+ // and carries the concatenated data, preserving node identity and
38317
+ // locator semantics.
38318
+ var tail = [];
38319
+ var sibling = next;
38320
+ while (sibling !== null && sibling.nodeType === TEXT_NODE) {
38321
+ tail.push(sibling.data);
38322
+ sibling = sibling.nextSibling;
38323
+ }
38324
+ // `sibling` is now the first non-text node after the run, or null.
38325
+ var removed = child.nextSibling;
38326
+ while (removed !== sibling) {
38327
+ var following = removed.nextSibling;
38328
+ removed.parentNode = null;
38329
+ removed.previousSibling = null;
38330
+ removed.nextSibling = null;
38331
+ removed = following;
38332
+ }
38333
+ child.nextSibling = sibling;
38334
+ if (sibling !== null) {
38335
+ sibling.previousSibling = child;
38336
+ } else {
38337
+ node.lastChild = child;
38338
+ }
38339
+ child.appendData(tail.join('')); // single O(K) string rebuild
38340
+ _onUpdateChild(node.ownerDocument, node); // single O(K) re-index
38341
+ child = sibling;
38274
38342
  } else {
38275
38343
  child = next;
38276
38344
  }
@@ -39081,8 +39149,10 @@ function requireDom () {
39081
39149
  * - it does not do any input validation on the arguments and doesn't throw "InvalidCharacterError".
39082
39150
  *
39083
39151
  * Note: When the resulting document is serialized with `requireWellFormed: true`, the
39084
- * serializer throws with code `INVALID_STATE_ERR` if `.data` contains `?>` (W3C DOM Parsing
39085
- * §3.2.1.7). Without that option the data is emitted verbatim.
39152
+ * serializer throws with code `INVALID_STATE_ERR` if `.target` is not a valid XML `NCName`
39153
+ * (a `Name` with no colon) or is an ASCII case-insensitive match for `"xml"`, or if `.data`
39154
+ * contains `?>` (W3C DOM Parsing §3.2.1.7). Without that option the target and data are
39155
+ * emitted verbatim.
39086
39156
  *
39087
39157
  * @param {string} target
39088
39158
  * @param {string} data
@@ -39107,7 +39177,27 @@ function requireDom () {
39107
39177
  node.specified = true;
39108
39178
  return node;
39109
39179
  },
39180
+ /**
39181
+ * Creates an EntityReference object, serialized as `&name;`.
39182
+ *
39183
+ * The `name` is validated against the XML `Name` production at creation time; an invalid name
39184
+ * throws a `DOMException` with code `INVALID_CHARACTER_ERR`. When the resulting node is
39185
+ * serialized with `requireWellFormed: true`, the serializer re-validates `nodeName` and throws
39186
+ * a `DOMException` with code `INVALID_STATE_ERR` if a later `nodeName` mutation made it invalid;
39187
+ * without that option the name is emitted verbatim.
39188
+ *
39189
+ * Note: xmldom does not expand entities — the parser resolves entity references inline and never
39190
+ * constructs `EntityReference` nodes, so this method is the only producer.
39191
+ *
39192
+ * @param {string} name The name of the entity to reference.
39193
+ * @returns {EntityReference}
39194
+ * @throws {DOMException} With code `INVALID_CHARACTER_ERR` when `name` is not a valid XML `Name`.
39195
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-392B75AE
39196
+ */
39110
39197
  createEntityReference : function(name){
39198
+ if (!tagNamePattern.test(name)) {
39199
+ throw new DOMException(INVALID_CHARACTER_ERR, 'not a valid xml name "' + name + '"');
39200
+ }
39111
39201
  var node = new EntityReference();
39112
39202
  node.ownerDocument = this;
39113
39203
  node.nodeName = name;
@@ -39319,15 +39409,16 @@ function requireDom () {
39319
39409
  /**
39320
39410
  * Represents a DocumentType node (the `<!DOCTYPE ...>` declaration).
39321
39411
  *
39322
- * `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
39412
+ * `name`, `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
39323
39413
  * xmldom does not enforce the `readonly` constraint declared by the WHATWG DOM spec —
39324
39414
  * direct property writes succeed silently. Values are serialized verbatim when
39325
39415
  * `requireWellFormed` is false (the default). When the serializer is invoked with
39326
39416
  * `requireWellFormed: true` (via the 4th-parameter options object), it validates each
39327
- * field and throws `DOMException` with code `INVALID_STATE_ERR` on invalid values.
39417
+ * field — including `name`, which is checked against the XML `Name` production — and throws
39418
+ * `DOMException` with code `INVALID_STATE_ERR` on invalid values.
39328
39419
  *
39329
39420
  * @class
39330
- * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentType MDN
39421
+ * @see https://developer.mozilla.org/docs/Web/API/DocumentType MDN
39331
39422
  */
39332
39423
  function DocumentType() {
39333
39424
  } DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
@@ -39341,6 +39432,20 @@ function requireDom () {
39341
39432
  } Entity.prototype.nodeType = ENTITY_NODE;
39342
39433
  _extends(Entity,Node);
39343
39434
 
39435
+ /**
39436
+ * Represents an EntityReference node, serialized as `&nodeName;`.
39437
+ *
39438
+ * `nodeName` is the referenced entity's name, stored verbatim. When serialized with
39439
+ * `requireWellFormed: true`, the serializer validates `nodeName` against the XML `Name` production
39440
+ * and throws a `DOMException` with code `INVALID_STATE_ERR` if it does not match; without that
39441
+ * option the name is emitted verbatim between `&` and `;`.
39442
+ *
39443
+ * Note: xmldom does not expand entities — the parser resolves entity references inline and never
39444
+ * constructs `EntityReference` nodes, so the only producer is `Document.createEntityReference`.
39445
+ *
39446
+ * @class
39447
+ * @see https://www.w3.org/TR/xml/#NT-Name
39448
+ */
39344
39449
  function EntityReference() {
39345
39450
  } EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
39346
39451
  _extends(EntityReference,Node);
@@ -39378,14 +39483,20 @@ function requireDom () {
39378
39483
  * @returns {string}
39379
39484
  * @throws {DOMException}
39380
39485
  * With code `INVALID_STATE_ERR` when `requireWellFormed` is `true` and:
39486
+ * - an Element's qualified name (including any namespace prefix) is not a valid XML QName,
39487
+ * - an attribute's qualified name (including a synthesized `xmlns:` namespace declaration) is
39488
+ * not a valid XML QName,
39381
39489
  * - a CDATASection node's data contains `"]]>"`,
39382
39490
  * - a Comment node's data contains `"-->"` (bare `"--"` does not throw on this branch),
39383
- * - a ProcessingInstruction's data contains `"?>"`,
39491
+ * - a ProcessingInstruction's target is not a valid XML `NCName` (a `Name` with no colon) or is
39492
+ * an ASCII case-insensitive match for `"xml"`, or its data contains `"?>"`,
39493
+ * - a DocumentType's `name` is not a valid XML `Name` (XML 1.0 production [5]),
39384
39494
  * - a DocumentType's `publicId` is non-empty and does not match the XML `PubidLiteral`
39385
39495
  * production,
39386
39496
  * - a DocumentType's `systemId` is non-empty and does not match the XML `SystemLiteral`
39387
- * production, or
39388
- * - a DocumentType's `internalSubset` contains `"]>"`.
39497
+ * production,
39498
+ * - a DocumentType's `internalSubset` contains `"]>"`, or
39499
+ * - an EntityReference's `nodeName` is not a valid XML `Name` (XML 1.0 production [5]).
39389
39500
  * Note: xmldom does not enforce `readonly` on DocumentType fields — direct property
39390
39501
  * writes succeed and are covered by the serializer-level checks above.
39391
39502
  * @see https://html.spec.whatwg.org/#dom-xmlserializer-serializetostring
@@ -39459,7 +39570,10 @@ function requireDom () {
39459
39570
  * @see https://www.w3.org/TR/xml11/#AVNormalize
39460
39571
  * @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes
39461
39572
  */
39462
- function addSerializedAttribute(buf, qualifiedName, value) {
39573
+ function addSerializedAttribute(buf, qualifiedName, value, requireWellFormed) {
39574
+ if (requireWellFormed && !tagNamePattern.test(qualifiedName)) {
39575
+ throw new DOMException(INVALID_STATE_ERR, 'The attribute name "' + qualifiedName + '" is not a valid XML QName');
39576
+ }
39463
39577
  buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
39464
39578
  }
39465
39579
 
@@ -39525,6 +39639,9 @@ function requireDom () {
39525
39639
  }
39526
39640
  }
39527
39641
 
39642
+ if (requireWellFormed && !tagNamePattern.test(prefixedNodeName)) {
39643
+ throw new DOMException(INVALID_STATE_ERR, 'The element name "' + prefixedNodeName + '" is not a valid XML QName');
39644
+ }
39528
39645
  buf.push('<', prefixedNodeName);
39529
39646
 
39530
39647
  // Build a fresh namespace snapshot for this element's children.
@@ -39544,7 +39661,7 @@ function requireDom () {
39544
39661
  if (needNamespaceDefine(attr, html, childNs)) {
39545
39662
  var attrPrefix = attr.prefix || '';
39546
39663
  var uri = attr.namespaceURI;
39547
- addSerializedAttribute(buf, attrPrefix ? 'xmlns:' + attrPrefix : 'xmlns', uri);
39664
+ addSerializedAttribute(buf, attrPrefix ? 'xmlns:' + attrPrefix : 'xmlns', uri, requireWellFormed);
39548
39665
  childNs.push({ prefix: attrPrefix, namespace: uri });
39549
39666
  }
39550
39667
  // Apply nodeFilter and serialize the attribute.
@@ -39553,7 +39670,7 @@ function requireDom () {
39553
39670
  if (typeof filteredAttr === 'string') {
39554
39671
  buf.push(filteredAttr);
39555
39672
  } else {
39556
- addSerializedAttribute(buf, filteredAttr.name, filteredAttr.value);
39673
+ addSerializedAttribute(buf, filteredAttr.name, filteredAttr.value, requireWellFormed);
39557
39674
  }
39558
39675
  }
39559
39676
  }
@@ -39562,7 +39679,7 @@ function requireDom () {
39562
39679
  if (nodeName === prefixedNodeName && needNamespaceDefine(n, html, childNs)) {
39563
39680
  var nodePrefix = n.prefix || '';
39564
39681
  var uri = n.namespaceURI;
39565
- addSerializedAttribute(buf, nodePrefix ? 'xmlns:' + nodePrefix : 'xmlns', uri);
39682
+ addSerializedAttribute(buf, nodePrefix ? 'xmlns:' + nodePrefix : 'xmlns', uri, requireWellFormed);
39566
39683
  childNs.push({ prefix: nodePrefix, namespace: uri });
39567
39684
  }
39568
39685
 
@@ -39595,7 +39712,7 @@ function requireDom () {
39595
39712
  return { ns: ns.slice(), isHTML: html, tag: null };
39596
39713
 
39597
39714
  case ATTRIBUTE_NODE:
39598
- addSerializedAttribute(buf, n.name, n.value);
39715
+ addSerializedAttribute(buf, n.name, n.value, requireWellFormed);
39599
39716
  return null;
39600
39717
 
39601
39718
  case TEXT_NODE:
@@ -39634,6 +39751,9 @@ function requireDom () {
39634
39751
 
39635
39752
  case DOCUMENT_TYPE_NODE:
39636
39753
  if (requireWellFormed) {
39754
+ if (!tagNamePattern.test(n.name)) {
39755
+ throw new DOMException(INVALID_STATE_ERR, 'The doctype name "' + n.name + '" is not a valid XML Name');
39756
+ }
39637
39757
  if (n.publicId && !/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(n.publicId)) {
39638
39758
  throw new DOMException(INVALID_STATE_ERR, 'DocumentType publicId is not a valid PubidLiteral');
39639
39759
  }
@@ -39665,13 +39785,27 @@ function requireDom () {
39665
39785
  return null;
39666
39786
 
39667
39787
  case PROCESSING_INSTRUCTION_NODE:
39668
- if (requireWellFormed && n.data.indexOf('?>') !== -1) {
39669
- throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
39788
+ if (requireWellFormed) {
39789
+ if (!tagNamePattern.test(n.target) || n.target.indexOf(':') !== -1 || n.target.toLowerCase() === 'xml') {
39790
+ throw new DOMException(
39791
+ INVALID_STATE_ERR,
39792
+ 'The processing instruction target "' + n.target + '" is not a valid XML NCName or is reserved'
39793
+ );
39794
+ }
39795
+ if (n.data.indexOf('?>') !== -1) {
39796
+ throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
39797
+ }
39670
39798
  }
39671
39799
  buf.push('<?', n.target, ' ', n.data, '?>');
39672
39800
  return null;
39673
39801
 
39674
39802
  case ENTITY_REFERENCE_NODE:
39803
+ if (requireWellFormed && !tagNamePattern.test(n.nodeName)) {
39804
+ throw new DOMException(
39805
+ INVALID_STATE_ERR,
39806
+ 'The entity reference name "' + n.nodeName + '" is not a valid XML Name'
39807
+ );
39808
+ }
39675
39809
  buf.push('&', n.nodeName, ';');
39676
39810
  return null;
39677
39811
 
@@ -42052,14 +42186,8 @@ function requireSax () {
42052
42186
  if (hasRequiredSax) return sax;
42053
42187
  hasRequiredSax = 1;
42054
42188
  var NAMESPACE = requireConventions().NAMESPACE;
42189
+ var tagNamePattern = requireConventions().tagNamePattern;
42055
42190
 
42056
- //[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
42057
- //[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
42058
- //[5] Name ::= NameStartChar (NameChar)*
42059
- var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;//\u10000-\uEFFFF
42060
- var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");
42061
- var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$');
42062
- //var tagNamePattern = /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/
42063
42191
  //var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')
42064
42192
 
42065
42193
  //S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
@@ -42170,7 +42298,13 @@ function requireSax () {
42170
42298
  switch(source.charAt(tagStart+1)){
42171
42299
  case '/':
42172
42300
  var end = source.indexOf('>',tagStart+3);
42173
- var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, '');
42301
+ // Anchored trailing-whitespace trim. The former `/[ \t\n\r]+$/g` backtracked
42302
+ // quadratically on a name shaped `whitespace-run + non-whitespace char`
42303
+ // (an end tag `</ … x>`): from every start position it extended `[ws]+`
42304
+ // to the end and then failed the `$` anchor. This anchored form matches the
42305
+ // whole string once and captures everything up to the last non-whitespace
42306
+ // character, so it trims in linear time with byte-identical output.
42307
+ var tagName = source.substring(tagStart + 2, end).replace(/^([\s\S]*?[^ \t\n\r])?[ \t\n\r]*$/, '$1');
42174
42308
  var config = parseStack.pop();
42175
42309
  if(end<0){
42176
42310
 
@@ -42181,6 +42315,14 @@ function requireSax () {
42181
42315
  tagName = tagName.replace(/[\s<].*/,'');
42182
42316
  errorHandler.error("end tag name: "+tagName+' maybe not complete');
42183
42317
  end = tagStart+1+tagName.length;
42318
+ }else if(/[ \t\n\r]/.test(tagName) && tagNamePattern.test(tagName.split(/[ \t\n\r]/)[0])){
42319
+ // The XML `ETag` production is `'</' Name S? '>'`: only optional whitespace may follow
42320
+ // the `Name`. A valid `Name` followed by whitespace and non-whitespace residue (e.g.
42321
+ // `</a\nbogus>` or `</a bogus>`) is not well-formed, but historically it was silently
42322
+ // accepted (the malformed end tag ignored, the residue dropped, the element left on the
42323
+ // stack). Report it as a recoverable `error` (which a custom errorHandler may escalate to
42324
+ // fatal) while keeping the existing recovery so the parsed DOM stays byte-identical.
42325
+ errorHandler.error('end tag name is followed by whitespace and trailing content: "'+tagName+'"');
42184
42326
  }
42185
42327
  var localNSMap = config.localNSMap;
42186
42328
  var endMatch = config.tagName == tagName;
@@ -42304,6 +42446,15 @@ function requireSax () {
42304
42446
  var s = S_TAG;//status
42305
42447
  while(true){
42306
42448
  var c = source.charAt(p);
42449
+ if (s === S_TAG && c === '<') {
42450
+ // A `<` can never occur inside a tag name. Without this guard the scan runs
42451
+ // on to the next `>` (or EOF) before the tag name is rejected, so a document
42452
+ // with many `<` inside a malformed tag makes each one-character recovery step
42453
+ // re-scan to the distant `>` — O(n^2). Stopping at the `<` keeps each recovery
42454
+ // step bounded. The candidate scanned so far is reported raw, consistent with
42455
+ // the sibling invalid-tag-name throw below.
42456
+ throw new Error('unexpected < in tag name: ' + source.slice(start, p));
42457
+ }
42307
42458
  switch(c){
42308
42459
  case '=':
42309
42460
  if(s === S_ATTR){//attrName
@@ -42496,9 +42647,13 @@ function requireSax () {
42496
42647
  if(nsPrefix !== false){//hack!!
42497
42648
  if(localNSMap == null){
42498
42649
  localNSMap = {};
42499
- //console.log(currentNSMap,0)
42500
- _copy(currentNSMap,currentNSMap={});
42501
- //console.log(currentNSMap,1)
42650
+ // Derive the child scope's namespace map by prototype-chain inheritance
42651
+ // instead of a flat copy: lookups inherit ancestor prefixes transparently,
42652
+ // so a document nesting N scopes retains O(N) map entries rather than
42653
+ // sum(1..N) = O(N^2). localNSMap stays a flat own-only record of the
42654
+ // prefixes declared at THIS element, so own-property enumeration
42655
+ // (endPrefixMapping below) still reports only local declarations.
42656
+ currentNSMap = Object.create(currentNSMap);
42502
42657
  }
42503
42658
  currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
42504
42659
  a.uri = NAMESPACE.XMLNS;
@@ -49537,7 +49692,7 @@ function requireMomentTimezone () {
49537
49692
  hasRequiredMomentTimezone = 1;
49538
49693
  (function (module) {
49539
49694
  //! moment-timezone.js
49540
- //! version : 0.6.2
49695
+ //! version : 0.6.5
49541
49696
  //! Copyright (c) JS Foundation and other contributors
49542
49697
  //! license : MIT
49543
49698
  //! github.com/moment/moment-timezone
@@ -49563,12 +49718,18 @@ function requireMomentTimezone () {
49563
49718
  // return moment;
49564
49719
  // }
49565
49720
 
49566
- var VERSION = "0.6.2",
49721
+ var VERSION = "0.6.5",
49567
49722
  zones = {},
49568
49723
  links = {},
49569
49724
  countries = {},
49570
49725
  names = {},
49571
49726
  guesses = {},
49727
+ parsingInZone = false,
49728
+ parsingNow,
49729
+ parsingNowFunction,
49730
+ hasParsingNow = false,
49731
+ ignoreDefaultZoneForInput,
49732
+ hasIgnoredDefaultZoneInput = false,
49572
49733
  cachedGuess;
49573
49734
 
49574
49735
  if (!moment || typeof moment.version !== 'string') {
@@ -49740,17 +49901,16 @@ function requireMomentTimezone () {
49740
49901
  offsets = this.offsets,
49741
49902
  untils = this.untils,
49742
49903
  max = untils.length - 1,
49743
- offset, offsetNext, offsetPrev, i;
49904
+ offset, offsetNext, i;
49744
49905
 
49745
49906
  for (i = 0; i < max; i++) {
49746
49907
  offset = offsets[i];
49747
49908
  offsetNext = offsets[i + 1];
49748
- offsetPrev = offsets[i ? i - 1 : i];
49749
49909
 
49750
49910
  if (offset < offsetNext && tz.moveAmbiguousForward) {
49751
49911
  offset = offsetNext;
49752
- } else if (offset > offsetPrev && tz.moveInvalidForward) {
49753
- offset = offsetPrev;
49912
+ } else if (offset > offsetNext && tz.moveInvalidForward) {
49913
+ offset = offsetNext;
49754
49914
  }
49755
49915
 
49756
49916
  if (target < untils[i] - (offset * 60000)) {
@@ -49775,6 +49935,15 @@ function requireMomentTimezone () {
49775
49935
  }
49776
49936
  };
49777
49937
 
49938
+ var utcDefaultZone = new Zone();
49939
+ utcDefaultZone._set({
49940
+ name : 'UTC',
49941
+ abbrs : ['UTC'],
49942
+ untils : [Infinity],
49943
+ offsets : [0],
49944
+ population : 0
49945
+ });
49946
+
49778
49947
  /************************************
49779
49948
  Country object
49780
49949
  ************************************/
@@ -50112,6 +50281,85 @@ function requireMomentTimezone () {
50112
50281
  return !!(m._a && (m._tzm === undefined) && !isUnixTimestamp);
50113
50282
  }
50114
50283
 
50284
+ function isObjectInput (input) {
50285
+ var prop;
50286
+
50287
+ if (moment.isMoment(input) || input === null || Object.prototype.toString.call(input) !== '[object Object]') {
50288
+ return false;
50289
+ }
50290
+ if (Object.getOwnPropertyNames) {
50291
+ return Object.getOwnPropertyNames(input).length > 0;
50292
+ }
50293
+ for (prop in input) {
50294
+ if (Object.prototype.hasOwnProperty.call(input, prop)) {
50295
+ return true;
50296
+ }
50297
+ }
50298
+ return false;
50299
+ }
50300
+
50301
+ function parseWithZoneNow (args, name, stringInput) {
50302
+ var savedNow = moment.now,
50303
+ savedDefaultZone = moment.defaultZone,
50304
+ savedParsingInZone = parsingInZone,
50305
+ savedParsingNow = parsingNow,
50306
+ savedParsingNowFunction = parsingNowFunction,
50307
+ savedHasParsingNow = hasParsingNow,
50308
+ now,
50309
+ hasNow = false,
50310
+ zonedNow,
50311
+ wallNow,
50312
+ parsedDateParts,
50313
+ out;
50314
+
50315
+ if (!parsingInZone) {
50316
+ parsingNow = undefined;
50317
+ parsingNowFunction = savedNow;
50318
+ hasParsingNow = false;
50319
+ }
50320
+ parsingInZone = true;
50321
+ moment.now = function () {
50322
+ if (!hasNow) {
50323
+ if (!hasParsingNow) {
50324
+ parsingNow = parsingNowFunction.call(moment);
50325
+ hasParsingNow = true;
50326
+ }
50327
+ now = parsingNow;
50328
+ hasNow = true;
50329
+ zonedNow = moment.tz(now, name);
50330
+ wallNow = zonedNow.valueOf() + zonedNow.utcOffset() * 60000;
50331
+ }
50332
+ return wallNow;
50333
+ };
50334
+ if (stringInput) {
50335
+ moment.defaultZone = utcDefaultZone;
50336
+ }
50337
+ try {
50338
+ out = moment.utc.apply(null, args);
50339
+ if (stringInput && hasNow && out._a && out._tzm !== undefined) {
50340
+ parsedDateParts = out.parsingFlags().parsedDateParts;
50341
+ if (!parsedDateParts || parsedDateParts[0] == null || parsedDateParts[1] == null || parsedDateParts[2] == null) {
50342
+ moment.now = function () {
50343
+ return now;
50344
+ };
50345
+ moment.defaultZone = savedDefaultZone;
50346
+ out = moment.utc.apply(null, args);
50347
+ }
50348
+ }
50349
+ } finally {
50350
+ moment.now = savedNow;
50351
+ moment.defaultZone = savedDefaultZone;
50352
+ parsingInZone = savedParsingInZone;
50353
+ if (!savedParsingInZone) {
50354
+ parsingNow = savedParsingNow;
50355
+ parsingNowFunction = savedParsingNowFunction;
50356
+ hasParsingNow = savedHasParsingNow;
50357
+ }
50358
+ }
50359
+
50360
+ return out;
50361
+ }
50362
+
50115
50363
  function logError (message) {
50116
50364
  if (typeof console !== 'undefined' && typeof console.error === 'function') {
50117
50365
  console.error(message);
@@ -50125,10 +50373,13 @@ function requireMomentTimezone () {
50125
50373
  function tz (input) {
50126
50374
  var args = Array.prototype.slice.call(arguments, 0, -1),
50127
50375
  name = arguments[arguments.length - 1],
50128
- out = moment.utc.apply(null, args),
50129
- zone;
50376
+ objectInput = isObjectInput(input),
50377
+ stringInput = args.length > 0 && typeof input === 'string',
50378
+ zone = objectInput || stringInput ? getZone(name) : null,
50379
+ out = objectInput && zone ? parseWithZoneNow(args, name) :
50380
+ stringInput && zone ? parseWithZoneNow(args, name, true) : moment.utc.apply(null, args);
50130
50381
 
50131
- if (!moment.isMoment(input) && needsOffset(out) && (zone = getZone(name))) {
50382
+ if (!moment.isMoment(input) && needsOffset(out) && (zone || (!objectInput && (zone = getZone(name))))) {
50132
50383
  out.add(zone.parse(out), 'minutes');
50133
50384
  }
50134
50385
 
@@ -50168,10 +50419,49 @@ function requireMomentTimezone () {
50168
50419
  moment.tz = tz;
50169
50420
 
50170
50421
  moment.defaultZone = null;
50422
+ var momentGetDefaultDateParts = moment._getDefaultDateParts;
50423
+ if (momentGetDefaultDateParts) {
50424
+ moment._getDefaultDateParts = function (config, now, forWeek) {
50425
+ var zone = moment.defaultZone,
50426
+ zonedNow,
50427
+ dateParts,
50428
+ savedIgnoredInput,
50429
+ savedHasIgnoredInput;
50430
+ forWeek = forWeek || config._isDefaultDatePartsForWeek;
50431
+
50432
+ if (parsingInZone && config._tzm === undefined) {
50433
+ zonedNow = new Date(now);
50434
+ return [zonedNow.getUTCFullYear(), zonedNow.getUTCMonth(), zonedNow.getUTCDate()];
50435
+ }
50436
+
50437
+ if (zone && !config._useUTC && config._tzm === undefined) {
50438
+ zonedNow = new Date(now - zone.utcOffset(now) * 60000);
50439
+ return [zonedNow.getUTCFullYear(), zonedNow.getUTCMonth(), zonedNow.getUTCDate()];
50440
+ }
50441
+
50442
+ if (forWeek && (config._useUTC || config._tzm !== undefined)) {
50443
+ savedIgnoredInput = ignoreDefaultZoneForInput;
50444
+ savedHasIgnoredInput = hasIgnoredDefaultZoneInput;
50445
+ ignoreDefaultZoneForInput = now;
50446
+ hasIgnoredDefaultZoneInput = true;
50447
+ try {
50448
+ dateParts = momentGetDefaultDateParts.call(this, config, now, forWeek);
50449
+ } finally {
50450
+ ignoreDefaultZoneForInput = savedIgnoredInput;
50451
+ hasIgnoredDefaultZoneInput = savedHasIgnoredInput;
50452
+ }
50453
+ return dateParts;
50454
+ }
50455
+
50456
+ return momentGetDefaultDateParts.call(this, config, now, forWeek);
50457
+ };
50458
+ }
50171
50459
 
50172
50460
  moment.updateOffset = function (mom, keepTime) {
50173
- var zone = moment.defaultZone,
50174
- offset;
50461
+ var zone = hasIgnoredDefaultZoneInput && ignoreDefaultZoneForInput === mom._i ? null : moment.defaultZone,
50462
+ offset,
50463
+ localTimestamp,
50464
+ normalizedTimestamp;
50175
50465
 
50176
50466
  if (mom._z === undefined) {
50177
50467
  if (zone && needsOffset(mom) && !mom._isUTC && mom.isValid()) {
@@ -50182,6 +50472,20 @@ function requireMomentTimezone () {
50182
50472
  }
50183
50473
  if (mom._z) {
50184
50474
  offset = mom._z.utcOffset(mom);
50475
+ if (keepTime) {
50476
+ // Resolve local times inside a forward gap using the configured
50477
+ // invalid-input policy before applying the new offset.
50478
+ localTimestamp = mom._d.valueOf();
50479
+ if (!mom._isUTC) {
50480
+ localTimestamp -= mom._d.getTimezoneOffset() * 60000;
50481
+ }
50482
+ if (mom._z.utcOffset(localTimestamp + offset * 60000) !== offset) {
50483
+ offset = mom._z.parse(localTimestamp);
50484
+ localTimestamp += offset * 60000;
50485
+ offset = mom._z.utcOffset(localTimestamp);
50486
+ normalizedTimestamp = localTimestamp - offset * 60000;
50487
+ }
50488
+ }
50185
50489
  if (Math.abs(offset) < 16) {
50186
50490
  offset = offset / 60;
50187
50491
  }
@@ -50192,6 +50496,9 @@ function requireMomentTimezone () {
50192
50496
  } else {
50193
50497
  mom.zone(offset, keepTime);
50194
50498
  }
50499
+ if (normalizedTimestamp != null) {
50500
+ mom._d.setTime(normalizedTimestamp);
50501
+ }
50195
50502
  }
50196
50503
  };
50197
50504
 
@@ -101981,14 +102288,10 @@ const triggerItemAction = (scope, item) => {
101981
102288
  const getDatasourceFromExpr = (expr, scope) => {
101982
102289
  const isBoundToVariable = startsWith(expr, 'Variables.');
101983
102290
  const isBoundToWidget = startsWith(expr, 'Widgets.');
101984
- const isBoundToActivePageVar = startsWith(expr, 'App.activePage.Variables.');
101985
102291
  const parts = expr.split('.');
101986
102292
  if (isBoundToVariable) {
101987
102293
  return get$1(scope.viewParent.Variables, parts[1]);
101988
102294
  }
101989
- if (isBoundToActivePageVar) {
101990
- return get$1(scope.viewParent?.App?.activePage?.Variables, parts[3]);
101991
- }
101992
102295
  if (isBoundToWidget) {
101993
102296
  const widgetScope = get$1(scope.viewParent.Widgets, parts[1]);
101994
102297
  const widgetDatasetBoundExpr = widgetScope.$attrs.get('datasetboundexpr');
@@ -104539,7 +104842,7 @@ const registerFormField = (isFormField) => {
104539
104842
  else {
104540
104843
  setDefaultPlaceholder(attrs, widgetType, 2);
104541
104844
  }
104542
- return `<${tagName$Z} data-role="${dataRole}" [formGroup]="${pCounter}.ngform" wmFormField wmCaptionPosition #${counter}="wmFormField" widgettype="${widgetType}" ${getFormMarkupAttr(attrs)}>
104845
+ return `<${tagName$Z} data-role="${dataRole}" [formGroup]="${pCounter}.ngform" wmFormField wmCaptionPosition #${counter}="wmFormField" widgettype="${widgetType}" [hidden]="!${counter}.show" ${getFormMarkupAttr(attrs)}>
104543
104846
  <div class="live-field form-group app-composite-widget clearfix caption-{{${pCounter}.captionposition}}" widget="${widgetType}">
104544
104847
  <label [hidden]="!${counter}.displayname" class="app-label control-label formfield-label {{${pCounter}._captionClass}}"
104545
104848
  [ngStyle]="{width: ${pCounter}.captionsize}" [ngClass]="{'text-danger': ${counter}._control?.invalid && ${counter}._control?.touched && ${pCounter}.isUpdateMode,