@gemeentenijmegen/webapp 0.0.4 → 0.0.5

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.
@@ -98,11 +98,11 @@ var require_Response = __commonJS({
98
98
  var require_cookie = __commonJS({
99
99
  "node_modules/@gemeentenijmegen/session/node_modules/cookie/index.js"(exports2) {
100
100
  "use strict";
101
- exports2.parse = parse3;
101
+ exports2.parse = parse;
102
102
  exports2.serialize = serialize;
103
103
  var __toString = Object.prototype.toString;
104
104
  var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
105
- function parse3(str, options) {
105
+ function parse(str, options) {
106
106
  if (typeof str !== "string") {
107
107
  throw new TypeError("argument str must be a string");
108
108
  }
@@ -417,11 +417,11 @@ var require_lib = __commonJS({
417
417
  var require_cookie2 = __commonJS({
418
418
  "node_modules/cookie/index.js"(exports2) {
419
419
  "use strict";
420
- exports2.parse = parse3;
420
+ exports2.parse = parse;
421
421
  exports2.serialize = serialize;
422
422
  var __toString = Object.prototype.toString;
423
423
  var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
424
- function parse3(str, options) {
424
+ function parse(str, options) {
425
425
  if (typeof str !== "string") {
426
426
  throw new TypeError("argument str must be a string");
427
427
  }
@@ -558,6 +558,478 @@ var require_cookie2 = __commonJS({
558
558
  }
559
559
  });
560
560
 
561
+ // node_modules/mustache/mustache.js
562
+ var require_mustache = __commonJS({
563
+ "node_modules/mustache/mustache.js"(exports2, module2) {
564
+ "use strict";
565
+ (function(global, factory) {
566
+ typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = global || self, global.Mustache = factory());
567
+ })(exports2, function() {
568
+ "use strict";
569
+ var objectToString = Object.prototype.toString;
570
+ var isArray = Array.isArray || function isArrayPolyfill(object) {
571
+ return objectToString.call(object) === "[object Array]";
572
+ };
573
+ function isFunction(object) {
574
+ return typeof object === "function";
575
+ }
576
+ function typeStr(obj) {
577
+ return isArray(obj) ? "array" : typeof obj;
578
+ }
579
+ function escapeRegExp(string) {
580
+ return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
581
+ }
582
+ function hasProperty(obj, propName) {
583
+ return obj != null && typeof obj === "object" && propName in obj;
584
+ }
585
+ function primitiveHasOwnProperty(primitive, propName) {
586
+ return primitive != null && typeof primitive !== "object" && primitive.hasOwnProperty && primitive.hasOwnProperty(propName);
587
+ }
588
+ var regExpTest = RegExp.prototype.test;
589
+ function testRegExp(re, string) {
590
+ return regExpTest.call(re, string);
591
+ }
592
+ var nonSpaceRe = /\S/;
593
+ function isWhitespace(string) {
594
+ return !testRegExp(nonSpaceRe, string);
595
+ }
596
+ var entityMap = {
597
+ "&": "&",
598
+ "<": "&lt;",
599
+ ">": "&gt;",
600
+ '"': "&quot;",
601
+ "'": "&#39;",
602
+ "/": "&#x2F;",
603
+ "`": "&#x60;",
604
+ "=": "&#x3D;"
605
+ };
606
+ function escapeHtml(string) {
607
+ return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
608
+ return entityMap[s];
609
+ });
610
+ }
611
+ var whiteRe = /\s*/;
612
+ var spaceRe = /\s+/;
613
+ var equalsRe = /\s*=/;
614
+ var curlyRe = /\s*\}/;
615
+ var tagRe = /#|\^|\/|>|\{|&|=|!/;
616
+ function parseTemplate(template3, tags) {
617
+ if (!template3)
618
+ return [];
619
+ var lineHasNonSpace = false;
620
+ var sections = [];
621
+ var tokens = [];
622
+ var spaces = [];
623
+ var hasTag = false;
624
+ var nonSpace = false;
625
+ var indentation = "";
626
+ var tagIndex = 0;
627
+ function stripSpace() {
628
+ if (hasTag && !nonSpace) {
629
+ while (spaces.length)
630
+ delete tokens[spaces.pop()];
631
+ } else {
632
+ spaces = [];
633
+ }
634
+ hasTag = false;
635
+ nonSpace = false;
636
+ }
637
+ var openingTagRe, closingTagRe, closingCurlyRe;
638
+ function compileTags(tagsToCompile) {
639
+ if (typeof tagsToCompile === "string")
640
+ tagsToCompile = tagsToCompile.split(spaceRe, 2);
641
+ if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)
642
+ throw new Error("Invalid tags: " + tagsToCompile);
643
+ openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + "\\s*");
644
+ closingTagRe = new RegExp("\\s*" + escapeRegExp(tagsToCompile[1]));
645
+ closingCurlyRe = new RegExp("\\s*" + escapeRegExp("}" + tagsToCompile[1]));
646
+ }
647
+ compileTags(tags || mustache2.tags);
648
+ var scanner = new Scanner(template3);
649
+ var start, type, value, chr, token, openSection;
650
+ while (!scanner.eos()) {
651
+ start = scanner.pos;
652
+ value = scanner.scanUntil(openingTagRe);
653
+ if (value) {
654
+ for (var i = 0, valueLength = value.length; i < valueLength; ++i) {
655
+ chr = value.charAt(i);
656
+ if (isWhitespace(chr)) {
657
+ spaces.push(tokens.length);
658
+ indentation += chr;
659
+ } else {
660
+ nonSpace = true;
661
+ lineHasNonSpace = true;
662
+ indentation += " ";
663
+ }
664
+ tokens.push(["text", chr, start, start + 1]);
665
+ start += 1;
666
+ if (chr === "\n") {
667
+ stripSpace();
668
+ indentation = "";
669
+ tagIndex = 0;
670
+ lineHasNonSpace = false;
671
+ }
672
+ }
673
+ }
674
+ if (!scanner.scan(openingTagRe))
675
+ break;
676
+ hasTag = true;
677
+ type = scanner.scan(tagRe) || "name";
678
+ scanner.scan(whiteRe);
679
+ if (type === "=") {
680
+ value = scanner.scanUntil(equalsRe);
681
+ scanner.scan(equalsRe);
682
+ scanner.scanUntil(closingTagRe);
683
+ } else if (type === "{") {
684
+ value = scanner.scanUntil(closingCurlyRe);
685
+ scanner.scan(curlyRe);
686
+ scanner.scanUntil(closingTagRe);
687
+ type = "&";
688
+ } else {
689
+ value = scanner.scanUntil(closingTagRe);
690
+ }
691
+ if (!scanner.scan(closingTagRe))
692
+ throw new Error("Unclosed tag at " + scanner.pos);
693
+ if (type == ">") {
694
+ token = [type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace];
695
+ } else {
696
+ token = [type, value, start, scanner.pos];
697
+ }
698
+ tagIndex++;
699
+ tokens.push(token);
700
+ if (type === "#" || type === "^") {
701
+ sections.push(token);
702
+ } else if (type === "/") {
703
+ openSection = sections.pop();
704
+ if (!openSection)
705
+ throw new Error('Unopened section "' + value + '" at ' + start);
706
+ if (openSection[1] !== value)
707
+ throw new Error('Unclosed section "' + openSection[1] + '" at ' + start);
708
+ } else if (type === "name" || type === "{" || type === "&") {
709
+ nonSpace = true;
710
+ } else if (type === "=") {
711
+ compileTags(value);
712
+ }
713
+ }
714
+ stripSpace();
715
+ openSection = sections.pop();
716
+ if (openSection)
717
+ throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos);
718
+ return nestTokens(squashTokens(tokens));
719
+ }
720
+ function squashTokens(tokens) {
721
+ var squashedTokens = [];
722
+ var token, lastToken;
723
+ for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
724
+ token = tokens[i];
725
+ if (token) {
726
+ if (token[0] === "text" && lastToken && lastToken[0] === "text") {
727
+ lastToken[1] += token[1];
728
+ lastToken[3] = token[3];
729
+ } else {
730
+ squashedTokens.push(token);
731
+ lastToken = token;
732
+ }
733
+ }
734
+ }
735
+ return squashedTokens;
736
+ }
737
+ function nestTokens(tokens) {
738
+ var nestedTokens = [];
739
+ var collector = nestedTokens;
740
+ var sections = [];
741
+ var token, section;
742
+ for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
743
+ token = tokens[i];
744
+ switch (token[0]) {
745
+ case "#":
746
+ case "^":
747
+ collector.push(token);
748
+ sections.push(token);
749
+ collector = token[4] = [];
750
+ break;
751
+ case "/":
752
+ section = sections.pop();
753
+ section[5] = token[2];
754
+ collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;
755
+ break;
756
+ default:
757
+ collector.push(token);
758
+ }
759
+ }
760
+ return nestedTokens;
761
+ }
762
+ function Scanner(string) {
763
+ this.string = string;
764
+ this.tail = string;
765
+ this.pos = 0;
766
+ }
767
+ Scanner.prototype.eos = function eos() {
768
+ return this.tail === "";
769
+ };
770
+ Scanner.prototype.scan = function scan(re) {
771
+ var match = this.tail.match(re);
772
+ if (!match || match.index !== 0)
773
+ return "";
774
+ var string = match[0];
775
+ this.tail = this.tail.substring(string.length);
776
+ this.pos += string.length;
777
+ return string;
778
+ };
779
+ Scanner.prototype.scanUntil = function scanUntil(re) {
780
+ var index = this.tail.search(re), match;
781
+ switch (index) {
782
+ case -1:
783
+ match = this.tail;
784
+ this.tail = "";
785
+ break;
786
+ case 0:
787
+ match = "";
788
+ break;
789
+ default:
790
+ match = this.tail.substring(0, index);
791
+ this.tail = this.tail.substring(index);
792
+ }
793
+ this.pos += match.length;
794
+ return match;
795
+ };
796
+ function Context(view, parentContext) {
797
+ this.view = view;
798
+ this.cache = { ".": this.view };
799
+ this.parent = parentContext;
800
+ }
801
+ Context.prototype.push = function push(view) {
802
+ return new Context(view, this);
803
+ };
804
+ Context.prototype.lookup = function lookup(name) {
805
+ var cache = this.cache;
806
+ var value;
807
+ if (cache.hasOwnProperty(name)) {
808
+ value = cache[name];
809
+ } else {
810
+ var context = this, intermediateValue, names, index, lookupHit = false;
811
+ while (context) {
812
+ if (name.indexOf(".") > 0) {
813
+ intermediateValue = context.view;
814
+ names = name.split(".");
815
+ index = 0;
816
+ while (intermediateValue != null && index < names.length) {
817
+ if (index === names.length - 1)
818
+ lookupHit = hasProperty(intermediateValue, names[index]) || primitiveHasOwnProperty(intermediateValue, names[index]);
819
+ intermediateValue = intermediateValue[names[index++]];
820
+ }
821
+ } else {
822
+ intermediateValue = context.view[name];
823
+ lookupHit = hasProperty(context.view, name);
824
+ }
825
+ if (lookupHit) {
826
+ value = intermediateValue;
827
+ break;
828
+ }
829
+ context = context.parent;
830
+ }
831
+ cache[name] = value;
832
+ }
833
+ if (isFunction(value))
834
+ value = value.call(this.view);
835
+ return value;
836
+ };
837
+ function Writer() {
838
+ this.templateCache = {
839
+ _cache: {},
840
+ set: function set(key, value) {
841
+ this._cache[key] = value;
842
+ },
843
+ get: function get(key) {
844
+ return this._cache[key];
845
+ },
846
+ clear: function clear() {
847
+ this._cache = {};
848
+ }
849
+ };
850
+ }
851
+ Writer.prototype.clearCache = function clearCache() {
852
+ if (typeof this.templateCache !== "undefined") {
853
+ this.templateCache.clear();
854
+ }
855
+ };
856
+ Writer.prototype.parse = function parse(template3, tags) {
857
+ var cache = this.templateCache;
858
+ var cacheKey = template3 + ":" + (tags || mustache2.tags).join(":");
859
+ var isCacheEnabled = typeof cache !== "undefined";
860
+ var tokens = isCacheEnabled ? cache.get(cacheKey) : void 0;
861
+ if (tokens == void 0) {
862
+ tokens = parseTemplate(template3, tags);
863
+ isCacheEnabled && cache.set(cacheKey, tokens);
864
+ }
865
+ return tokens;
866
+ };
867
+ Writer.prototype.render = function render2(template3, view, partials, config) {
868
+ var tags = this.getConfigTags(config);
869
+ var tokens = this.parse(template3, tags);
870
+ var context = view instanceof Context ? view : new Context(view, void 0);
871
+ return this.renderTokens(tokens, context, partials, template3, config);
872
+ };
873
+ Writer.prototype.renderTokens = function renderTokens(tokens, context, partials, originalTemplate, config) {
874
+ var buffer = "";
875
+ var token, symbol, value;
876
+ for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
877
+ value = void 0;
878
+ token = tokens[i];
879
+ symbol = token[0];
880
+ if (symbol === "#")
881
+ value = this.renderSection(token, context, partials, originalTemplate, config);
882
+ else if (symbol === "^")
883
+ value = this.renderInverted(token, context, partials, originalTemplate, config);
884
+ else if (symbol === ">")
885
+ value = this.renderPartial(token, context, partials, config);
886
+ else if (symbol === "&")
887
+ value = this.unescapedValue(token, context);
888
+ else if (symbol === "name")
889
+ value = this.escapedValue(token, context, config);
890
+ else if (symbol === "text")
891
+ value = this.rawValue(token);
892
+ if (value !== void 0)
893
+ buffer += value;
894
+ }
895
+ return buffer;
896
+ };
897
+ Writer.prototype.renderSection = function renderSection(token, context, partials, originalTemplate, config) {
898
+ var self2 = this;
899
+ var buffer = "";
900
+ var value = context.lookup(token[1]);
901
+ function subRender(template3) {
902
+ return self2.render(template3, context, partials, config);
903
+ }
904
+ if (!value)
905
+ return;
906
+ if (isArray(value)) {
907
+ for (var j = 0, valueLength = value.length; j < valueLength; ++j) {
908
+ buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate, config);
909
+ }
910
+ } else if (typeof value === "object" || typeof value === "string" || typeof value === "number") {
911
+ buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate, config);
912
+ } else if (isFunction(value)) {
913
+ if (typeof originalTemplate !== "string")
914
+ throw new Error("Cannot use higher-order sections without the original template");
915
+ value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);
916
+ if (value != null)
917
+ buffer += value;
918
+ } else {
919
+ buffer += this.renderTokens(token[4], context, partials, originalTemplate, config);
920
+ }
921
+ return buffer;
922
+ };
923
+ Writer.prototype.renderInverted = function renderInverted(token, context, partials, originalTemplate, config) {
924
+ var value = context.lookup(token[1]);
925
+ if (!value || isArray(value) && value.length === 0)
926
+ return this.renderTokens(token[4], context, partials, originalTemplate, config);
927
+ };
928
+ Writer.prototype.indentPartial = function indentPartial(partial, indentation, lineHasNonSpace) {
929
+ var filteredIndentation = indentation.replace(/[^ \t]/g, "");
930
+ var partialByNl = partial.split("\n");
931
+ for (var i = 0; i < partialByNl.length; i++) {
932
+ if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {
933
+ partialByNl[i] = filteredIndentation + partialByNl[i];
934
+ }
935
+ }
936
+ return partialByNl.join("\n");
937
+ };
938
+ Writer.prototype.renderPartial = function renderPartial(token, context, partials, config) {
939
+ if (!partials)
940
+ return;
941
+ var tags = this.getConfigTags(config);
942
+ var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];
943
+ if (value != null) {
944
+ var lineHasNonSpace = token[6];
945
+ var tagIndex = token[5];
946
+ var indentation = token[4];
947
+ var indentedValue = value;
948
+ if (tagIndex == 0 && indentation) {
949
+ indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);
950
+ }
951
+ var tokens = this.parse(indentedValue, tags);
952
+ return this.renderTokens(tokens, context, partials, indentedValue, config);
953
+ }
954
+ };
955
+ Writer.prototype.unescapedValue = function unescapedValue(token, context) {
956
+ var value = context.lookup(token[1]);
957
+ if (value != null)
958
+ return value;
959
+ };
960
+ Writer.prototype.escapedValue = function escapedValue(token, context, config) {
961
+ var escape = this.getConfigEscape(config) || mustache2.escape;
962
+ var value = context.lookup(token[1]);
963
+ if (value != null)
964
+ return typeof value === "number" && escape === mustache2.escape ? String(value) : escape(value);
965
+ };
966
+ Writer.prototype.rawValue = function rawValue(token) {
967
+ return token[1];
968
+ };
969
+ Writer.prototype.getConfigTags = function getConfigTags(config) {
970
+ if (isArray(config)) {
971
+ return config;
972
+ } else if (config && typeof config === "object") {
973
+ return config.tags;
974
+ } else {
975
+ return void 0;
976
+ }
977
+ };
978
+ Writer.prototype.getConfigEscape = function getConfigEscape(config) {
979
+ if (config && typeof config === "object" && !isArray(config)) {
980
+ return config.escape;
981
+ } else {
982
+ return void 0;
983
+ }
984
+ };
985
+ var mustache2 = {
986
+ name: "mustache.js",
987
+ version: "4.2.0",
988
+ tags: ["{{", "}}"],
989
+ clearCache: void 0,
990
+ escape: void 0,
991
+ parse: void 0,
992
+ render: void 0,
993
+ Scanner: void 0,
994
+ Context: void 0,
995
+ Writer: void 0,
996
+ /**
997
+ * Allows a user to override the default caching strategy, by providing an
998
+ * object with set, get and clear methods. This can also be used to disable
999
+ * the cache by setting it to the literal `undefined`.
1000
+ */
1001
+ set templateCache(cache) {
1002
+ defaultWriter.templateCache = cache;
1003
+ },
1004
+ /**
1005
+ * Gets the default or overridden caching object from the default writer.
1006
+ */
1007
+ get templateCache() {
1008
+ return defaultWriter.templateCache;
1009
+ }
1010
+ };
1011
+ var defaultWriter = new Writer();
1012
+ mustache2.clearCache = function clearCache() {
1013
+ return defaultWriter.clearCache();
1014
+ };
1015
+ mustache2.parse = function parse(template3, tags) {
1016
+ return defaultWriter.parse(template3, tags);
1017
+ };
1018
+ mustache2.render = function render2(template3, view, partials, config) {
1019
+ if (typeof template3 !== "string") {
1020
+ throw new TypeError('Invalid template! Template should be a "string" but "' + typeStr(template3) + '" was given as the first argument for mustache#render(template, view, partials)');
1021
+ }
1022
+ return defaultWriter.render(template3, view, partials, config);
1023
+ };
1024
+ mustache2.escape = escapeHtml;
1025
+ mustache2.Scanner = Scanner;
1026
+ mustache2.Context = Context;
1027
+ mustache2.Writer = Writer;
1028
+ return mustache2;
1029
+ });
1030
+ }
1031
+ });
1032
+
561
1033
  // src/webapp/logout/logout.lambda.ts
562
1034
  var import_client_dynamodb = require("@aws-sdk/client-dynamodb");
563
1035
  var import_Response2 = __toESM(require_Response());
@@ -570,467 +1042,6 @@ var import_cookie = __toESM(require_cookie2());
570
1042
  // src/webapp/logout/templates/logout.mustache
571
1043
  var logout_default = '{{>header}}\n\n<main>\n <!-- START: template component(s) -->\n <div class="container" id="section-1">\n <h1>Uitgelogd</h1>\n <p class="lead">U bent nu uitgelogd.</p>\n </div>\n </div>\n\n <!-- END: template component(s) -->\n</main>\n\n{{>footer}}';
572
1044
 
573
- // node_modules/mustache/mustache.mjs
574
- var objectToString = Object.prototype.toString;
575
- var isArray = Array.isArray || function isArrayPolyfill(object) {
576
- return objectToString.call(object) === "[object Array]";
577
- };
578
- function isFunction(object) {
579
- return typeof object === "function";
580
- }
581
- function typeStr(obj) {
582
- return isArray(obj) ? "array" : typeof obj;
583
- }
584
- function escapeRegExp(string) {
585
- return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
586
- }
587
- function hasProperty(obj, propName) {
588
- return obj != null && typeof obj === "object" && propName in obj;
589
- }
590
- function primitiveHasOwnProperty(primitive, propName) {
591
- return primitive != null && typeof primitive !== "object" && primitive.hasOwnProperty && primitive.hasOwnProperty(propName);
592
- }
593
- var regExpTest = RegExp.prototype.test;
594
- function testRegExp(re, string) {
595
- return regExpTest.call(re, string);
596
- }
597
- var nonSpaceRe = /\S/;
598
- function isWhitespace(string) {
599
- return !testRegExp(nonSpaceRe, string);
600
- }
601
- var entityMap = {
602
- "&": "&amp;",
603
- "<": "&lt;",
604
- ">": "&gt;",
605
- '"': "&quot;",
606
- "'": "&#39;",
607
- "/": "&#x2F;",
608
- "`": "&#x60;",
609
- "=": "&#x3D;"
610
- };
611
- function escapeHtml(string) {
612
- return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
613
- return entityMap[s];
614
- });
615
- }
616
- var whiteRe = /\s*/;
617
- var spaceRe = /\s+/;
618
- var equalsRe = /\s*=/;
619
- var curlyRe = /\s*\}/;
620
- var tagRe = /#|\^|\/|>|\{|&|=|!/;
621
- function parseTemplate(template3, tags) {
622
- if (!template3)
623
- return [];
624
- var lineHasNonSpace = false;
625
- var sections = [];
626
- var tokens = [];
627
- var spaces = [];
628
- var hasTag = false;
629
- var nonSpace = false;
630
- var indentation = "";
631
- var tagIndex = 0;
632
- function stripSpace() {
633
- if (hasTag && !nonSpace) {
634
- while (spaces.length)
635
- delete tokens[spaces.pop()];
636
- } else {
637
- spaces = [];
638
- }
639
- hasTag = false;
640
- nonSpace = false;
641
- }
642
- var openingTagRe, closingTagRe, closingCurlyRe;
643
- function compileTags(tagsToCompile) {
644
- if (typeof tagsToCompile === "string")
645
- tagsToCompile = tagsToCompile.split(spaceRe, 2);
646
- if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)
647
- throw new Error("Invalid tags: " + tagsToCompile);
648
- openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + "\\s*");
649
- closingTagRe = new RegExp("\\s*" + escapeRegExp(tagsToCompile[1]));
650
- closingCurlyRe = new RegExp("\\s*" + escapeRegExp("}" + tagsToCompile[1]));
651
- }
652
- compileTags(tags || mustache.tags);
653
- var scanner = new Scanner(template3);
654
- var start, type, value, chr, token, openSection;
655
- while (!scanner.eos()) {
656
- start = scanner.pos;
657
- value = scanner.scanUntil(openingTagRe);
658
- if (value) {
659
- for (var i = 0, valueLength = value.length; i < valueLength; ++i) {
660
- chr = value.charAt(i);
661
- if (isWhitespace(chr)) {
662
- spaces.push(tokens.length);
663
- indentation += chr;
664
- } else {
665
- nonSpace = true;
666
- lineHasNonSpace = true;
667
- indentation += " ";
668
- }
669
- tokens.push(["text", chr, start, start + 1]);
670
- start += 1;
671
- if (chr === "\n") {
672
- stripSpace();
673
- indentation = "";
674
- tagIndex = 0;
675
- lineHasNonSpace = false;
676
- }
677
- }
678
- }
679
- if (!scanner.scan(openingTagRe))
680
- break;
681
- hasTag = true;
682
- type = scanner.scan(tagRe) || "name";
683
- scanner.scan(whiteRe);
684
- if (type === "=") {
685
- value = scanner.scanUntil(equalsRe);
686
- scanner.scan(equalsRe);
687
- scanner.scanUntil(closingTagRe);
688
- } else if (type === "{") {
689
- value = scanner.scanUntil(closingCurlyRe);
690
- scanner.scan(curlyRe);
691
- scanner.scanUntil(closingTagRe);
692
- type = "&";
693
- } else {
694
- value = scanner.scanUntil(closingTagRe);
695
- }
696
- if (!scanner.scan(closingTagRe))
697
- throw new Error("Unclosed tag at " + scanner.pos);
698
- if (type == ">") {
699
- token = [type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace];
700
- } else {
701
- token = [type, value, start, scanner.pos];
702
- }
703
- tagIndex++;
704
- tokens.push(token);
705
- if (type === "#" || type === "^") {
706
- sections.push(token);
707
- } else if (type === "/") {
708
- openSection = sections.pop();
709
- if (!openSection)
710
- throw new Error('Unopened section "' + value + '" at ' + start);
711
- if (openSection[1] !== value)
712
- throw new Error('Unclosed section "' + openSection[1] + '" at ' + start);
713
- } else if (type === "name" || type === "{" || type === "&") {
714
- nonSpace = true;
715
- } else if (type === "=") {
716
- compileTags(value);
717
- }
718
- }
719
- stripSpace();
720
- openSection = sections.pop();
721
- if (openSection)
722
- throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos);
723
- return nestTokens(squashTokens(tokens));
724
- }
725
- function squashTokens(tokens) {
726
- var squashedTokens = [];
727
- var token, lastToken;
728
- for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
729
- token = tokens[i];
730
- if (token) {
731
- if (token[0] === "text" && lastToken && lastToken[0] === "text") {
732
- lastToken[1] += token[1];
733
- lastToken[3] = token[3];
734
- } else {
735
- squashedTokens.push(token);
736
- lastToken = token;
737
- }
738
- }
739
- }
740
- return squashedTokens;
741
- }
742
- function nestTokens(tokens) {
743
- var nestedTokens = [];
744
- var collector = nestedTokens;
745
- var sections = [];
746
- var token, section;
747
- for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
748
- token = tokens[i];
749
- switch (token[0]) {
750
- case "#":
751
- case "^":
752
- collector.push(token);
753
- sections.push(token);
754
- collector = token[4] = [];
755
- break;
756
- case "/":
757
- section = sections.pop();
758
- section[5] = token[2];
759
- collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;
760
- break;
761
- default:
762
- collector.push(token);
763
- }
764
- }
765
- return nestedTokens;
766
- }
767
- function Scanner(string) {
768
- this.string = string;
769
- this.tail = string;
770
- this.pos = 0;
771
- }
772
- Scanner.prototype.eos = function eos() {
773
- return this.tail === "";
774
- };
775
- Scanner.prototype.scan = function scan(re) {
776
- var match = this.tail.match(re);
777
- if (!match || match.index !== 0)
778
- return "";
779
- var string = match[0];
780
- this.tail = this.tail.substring(string.length);
781
- this.pos += string.length;
782
- return string;
783
- };
784
- Scanner.prototype.scanUntil = function scanUntil(re) {
785
- var index = this.tail.search(re), match;
786
- switch (index) {
787
- case -1:
788
- match = this.tail;
789
- this.tail = "";
790
- break;
791
- case 0:
792
- match = "";
793
- break;
794
- default:
795
- match = this.tail.substring(0, index);
796
- this.tail = this.tail.substring(index);
797
- }
798
- this.pos += match.length;
799
- return match;
800
- };
801
- function Context(view, parentContext) {
802
- this.view = view;
803
- this.cache = { ".": this.view };
804
- this.parent = parentContext;
805
- }
806
- Context.prototype.push = function push(view) {
807
- return new Context(view, this);
808
- };
809
- Context.prototype.lookup = function lookup(name) {
810
- var cache = this.cache;
811
- var value;
812
- if (cache.hasOwnProperty(name)) {
813
- value = cache[name];
814
- } else {
815
- var context = this, intermediateValue, names, index, lookupHit = false;
816
- while (context) {
817
- if (name.indexOf(".") > 0) {
818
- intermediateValue = context.view;
819
- names = name.split(".");
820
- index = 0;
821
- while (intermediateValue != null && index < names.length) {
822
- if (index === names.length - 1)
823
- lookupHit = hasProperty(intermediateValue, names[index]) || primitiveHasOwnProperty(intermediateValue, names[index]);
824
- intermediateValue = intermediateValue[names[index++]];
825
- }
826
- } else {
827
- intermediateValue = context.view[name];
828
- lookupHit = hasProperty(context.view, name);
829
- }
830
- if (lookupHit) {
831
- value = intermediateValue;
832
- break;
833
- }
834
- context = context.parent;
835
- }
836
- cache[name] = value;
837
- }
838
- if (isFunction(value))
839
- value = value.call(this.view);
840
- return value;
841
- };
842
- function Writer() {
843
- this.templateCache = {
844
- _cache: {},
845
- set: function set(key, value) {
846
- this._cache[key] = value;
847
- },
848
- get: function get(key) {
849
- return this._cache[key];
850
- },
851
- clear: function clear() {
852
- this._cache = {};
853
- }
854
- };
855
- }
856
- Writer.prototype.clearCache = function clearCache() {
857
- if (typeof this.templateCache !== "undefined") {
858
- this.templateCache.clear();
859
- }
860
- };
861
- Writer.prototype.parse = function parse(template3, tags) {
862
- var cache = this.templateCache;
863
- var cacheKey = template3 + ":" + (tags || mustache.tags).join(":");
864
- var isCacheEnabled = typeof cache !== "undefined";
865
- var tokens = isCacheEnabled ? cache.get(cacheKey) : void 0;
866
- if (tokens == void 0) {
867
- tokens = parseTemplate(template3, tags);
868
- isCacheEnabled && cache.set(cacheKey, tokens);
869
- }
870
- return tokens;
871
- };
872
- Writer.prototype.render = function render(template3, view, partials, config) {
873
- var tags = this.getConfigTags(config);
874
- var tokens = this.parse(template3, tags);
875
- var context = view instanceof Context ? view : new Context(view, void 0);
876
- return this.renderTokens(tokens, context, partials, template3, config);
877
- };
878
- Writer.prototype.renderTokens = function renderTokens(tokens, context, partials, originalTemplate, config) {
879
- var buffer = "";
880
- var token, symbol, value;
881
- for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
882
- value = void 0;
883
- token = tokens[i];
884
- symbol = token[0];
885
- if (symbol === "#")
886
- value = this.renderSection(token, context, partials, originalTemplate, config);
887
- else if (symbol === "^")
888
- value = this.renderInverted(token, context, partials, originalTemplate, config);
889
- else if (symbol === ">")
890
- value = this.renderPartial(token, context, partials, config);
891
- else if (symbol === "&")
892
- value = this.unescapedValue(token, context);
893
- else if (symbol === "name")
894
- value = this.escapedValue(token, context, config);
895
- else if (symbol === "text")
896
- value = this.rawValue(token);
897
- if (value !== void 0)
898
- buffer += value;
899
- }
900
- return buffer;
901
- };
902
- Writer.prototype.renderSection = function renderSection(token, context, partials, originalTemplate, config) {
903
- var self = this;
904
- var buffer = "";
905
- var value = context.lookup(token[1]);
906
- function subRender(template3) {
907
- return self.render(template3, context, partials, config);
908
- }
909
- if (!value)
910
- return;
911
- if (isArray(value)) {
912
- for (var j = 0, valueLength = value.length; j < valueLength; ++j) {
913
- buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate, config);
914
- }
915
- } else if (typeof value === "object" || typeof value === "string" || typeof value === "number") {
916
- buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate, config);
917
- } else if (isFunction(value)) {
918
- if (typeof originalTemplate !== "string")
919
- throw new Error("Cannot use higher-order sections without the original template");
920
- value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);
921
- if (value != null)
922
- buffer += value;
923
- } else {
924
- buffer += this.renderTokens(token[4], context, partials, originalTemplate, config);
925
- }
926
- return buffer;
927
- };
928
- Writer.prototype.renderInverted = function renderInverted(token, context, partials, originalTemplate, config) {
929
- var value = context.lookup(token[1]);
930
- if (!value || isArray(value) && value.length === 0)
931
- return this.renderTokens(token[4], context, partials, originalTemplate, config);
932
- };
933
- Writer.prototype.indentPartial = function indentPartial(partial, indentation, lineHasNonSpace) {
934
- var filteredIndentation = indentation.replace(/[^ \t]/g, "");
935
- var partialByNl = partial.split("\n");
936
- for (var i = 0; i < partialByNl.length; i++) {
937
- if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {
938
- partialByNl[i] = filteredIndentation + partialByNl[i];
939
- }
940
- }
941
- return partialByNl.join("\n");
942
- };
943
- Writer.prototype.renderPartial = function renderPartial(token, context, partials, config) {
944
- if (!partials)
945
- return;
946
- var tags = this.getConfigTags(config);
947
- var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];
948
- if (value != null) {
949
- var lineHasNonSpace = token[6];
950
- var tagIndex = token[5];
951
- var indentation = token[4];
952
- var indentedValue = value;
953
- if (tagIndex == 0 && indentation) {
954
- indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);
955
- }
956
- var tokens = this.parse(indentedValue, tags);
957
- return this.renderTokens(tokens, context, partials, indentedValue, config);
958
- }
959
- };
960
- Writer.prototype.unescapedValue = function unescapedValue(token, context) {
961
- var value = context.lookup(token[1]);
962
- if (value != null)
963
- return value;
964
- };
965
- Writer.prototype.escapedValue = function escapedValue(token, context, config) {
966
- var escape = this.getConfigEscape(config) || mustache.escape;
967
- var value = context.lookup(token[1]);
968
- if (value != null)
969
- return typeof value === "number" && escape === mustache.escape ? String(value) : escape(value);
970
- };
971
- Writer.prototype.rawValue = function rawValue(token) {
972
- return token[1];
973
- };
974
- Writer.prototype.getConfigTags = function getConfigTags(config) {
975
- if (isArray(config)) {
976
- return config;
977
- } else if (config && typeof config === "object") {
978
- return config.tags;
979
- } else {
980
- return void 0;
981
- }
982
- };
983
- Writer.prototype.getConfigEscape = function getConfigEscape(config) {
984
- if (config && typeof config === "object" && !isArray(config)) {
985
- return config.escape;
986
- } else {
987
- return void 0;
988
- }
989
- };
990
- var mustache = {
991
- name: "mustache.js",
992
- version: "4.2.0",
993
- tags: ["{{", "}}"],
994
- clearCache: void 0,
995
- escape: void 0,
996
- parse: void 0,
997
- render: void 0,
998
- Scanner: void 0,
999
- Context: void 0,
1000
- Writer: void 0,
1001
- /**
1002
- * Allows a user to override the default caching strategy, by providing an
1003
- * object with set, get and clear methods. This can also be used to disable
1004
- * the cache by setting it to the literal `undefined`.
1005
- */
1006
- set templateCache(cache) {
1007
- defaultWriter.templateCache = cache;
1008
- },
1009
- /**
1010
- * Gets the default or overridden caching object from the default writer.
1011
- */
1012
- get templateCache() {
1013
- return defaultWriter.templateCache;
1014
- }
1015
- };
1016
- var defaultWriter = new Writer();
1017
- mustache.clearCache = function clearCache2() {
1018
- return defaultWriter.clearCache();
1019
- };
1020
- mustache.parse = function parse2(template3, tags) {
1021
- return defaultWriter.parse(template3, tags);
1022
- };
1023
- mustache.render = function render2(template3, view, partials, config) {
1024
- if (typeof template3 !== "string") {
1025
- throw new TypeError('Invalid template! Template should be a "string" but "' + typeStr(template3) + '" was given as the first argument for mustache#render(template, view, partials)');
1026
- }
1027
- return defaultWriter.render(template3, view, partials, config);
1028
- };
1029
- mustache.escape = escapeHtml;
1030
- mustache.Scanner = Scanner;
1031
- mustache.Context = Context;
1032
- mustache.Writer = Writer;
1033
-
1034
1045
  // src/webapp/util/Files.ts
1035
1046
  var fs = __toESM(require("fs"));
1036
1047
  var Files = class {
@@ -1066,9 +1077,10 @@ var template2 = '<!doctype html> <html lang="nl"> <head> <meta charset="utf-
1066
1077
  var header_default = template2;
1067
1078
 
1068
1079
  // src/webapp/util/render.ts
1080
+ var mustache = require_mustache();
1069
1081
  var overwriteHeader = Files.loadTemplateOverwrite("/opt/header.mustache");
1070
1082
  var overwriteFooter = Files.loadTemplateOverwrite("/opt/footer.mustache");
1071
- async function render4(data, template3, partials) {
1083
+ async function render(data, template3, partials) {
1072
1084
  const fullPartials = {
1073
1085
  header: overwriteHeader ?? header_default,
1074
1086
  footer: overwriteFooter ?? footer_default,
@@ -1078,7 +1090,7 @@ async function render4(data, template3, partials) {
1078
1090
  logos: false,
1079
1091
  ...data
1080
1092
  };
1081
- return (void 0)(template3, data, fullPartials);
1093
+ return mustache.render(template3, data, fullPartials);
1082
1094
  }
1083
1095
 
1084
1096
  // src/webapp/logout/handleLogoutRequest.ts
@@ -1092,7 +1104,7 @@ async function handleLogoutRequest(cookies, dynamoDBClient2, templateOverwrite2)
1092
1104
  });
1093
1105
  }
1094
1106
  const template3 = templateOverwrite2 ?? logout_default;
1095
- const html = await render4({ title: "Uitgelogd" }, template3);
1107
+ const html = await render({ title: "Uitgelogd" }, template3);
1096
1108
  const emptyCookie = import_cookie.default.serialize("session", "", {
1097
1109
  httpOnly: true,
1098
1110
  secure: true
@@ -1135,7 +1147,7 @@ cookie/index.js:
1135
1147
  * MIT Licensed
1136
1148
  *)
1137
1149
 
1138
- mustache/mustache.mjs:
1150
+ mustache/mustache.js:
1139
1151
  (*!
1140
1152
  * mustache.js - Logic-less {{mustache}} templates with JavaScript
1141
1153
  * http://github.com/janl/mustache.js