bhl-forms 0.0.80 → 0.0.82

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.
@@ -9327,14 +9327,15 @@ var getCoords$1 = (elem) => {
9327
9327
  left: box2.left + window.pageXOffset
9328
9328
  };
9329
9329
  };
9330
- var postJSON = /* @__PURE__ */ function() {
9330
+ var postData = /* @__PURE__ */ function() {
9331
9331
  var _ref = _asyncToGenerator(function* (url3, data2) {
9332
+ var contentType = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "application/json";
9332
9333
  dbg$1("Post to: " + url3);
9333
9334
  var raw2 = yield fetch(url3, {
9334
9335
  method: "POST",
9335
9336
  headers: {
9336
9337
  "Accept": "application/json",
9337
- "Content-Type": "application/json"
9338
+ "Content-Type": contentType
9338
9339
  },
9339
9340
  body: JSON.stringify(data2)
9340
9341
  });
@@ -9349,12 +9350,12 @@ var postJSON = /* @__PURE__ */ function() {
9349
9350
  dbg$1("Post resp: " + JSON.stringify(res, null, 2));
9350
9351
  return res;
9351
9352
  });
9352
- return function postJSON2(_x, _x2) {
9353
+ return function postData2(_x, _x2) {
9353
9354
  return _ref.apply(this, arguments);
9354
9355
  };
9355
9356
  }();
9356
9357
  var redirectTo = (url3) => {
9357
- window.location.href = url3;
9358
+ window.location = url3;
9358
9359
  };
9359
9360
  var openNewTab = (url3) => {
9360
9361
  var otherTab = window.open();
@@ -9477,6 +9478,7 @@ function usePrepop() {
9477
9478
  prepopSettings
9478
9479
  };
9479
9480
  }
9481
+ var explicitKeys$1 = ["__key", "__init", "__shim", "__original", "__index", "__prevKey"];
9480
9482
  function token$1() {
9481
9483
  return Math.random().toString(36).substring(2, 15);
9482
9484
  }
@@ -9519,7 +9521,7 @@ function kebab$1(str) {
9519
9521
  return str.replace(/([a-z0-9])([A-Z])/g, (_s, trail, cap) => trail + "-" + cap.toLowerCase()).replace(" ", "-").toLowerCase();
9520
9522
  }
9521
9523
  function clone$1(obj) {
9522
- var explicit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["__key", "__init"];
9524
+ var explicit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : explicitKeys$1;
9523
9525
  if (obj === null || obj instanceof RegExp || obj instanceof Date || obj instanceof Map || obj instanceof Set || typeof File === "function" && obj instanceof File)
9524
9526
  return obj;
9525
9527
  var returnObject;
@@ -9898,7 +9900,7 @@ function createValue$1(options2) {
9898
9900
  } else if (options2.type === "list") {
9899
9901
  return init$2(Array.isArray(options2.value) ? options2.value : []);
9900
9902
  }
9901
- return options2.value === null ? "" : options2.value;
9903
+ return options2.value;
9902
9904
  }
9903
9905
  function input$1(node2, context, value) {
9904
9906
  var async = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
@@ -10037,6 +10039,14 @@ function define$1(node2, context, definition) {
10037
10039
  type: node2.type,
10038
10040
  value: context.value
10039
10041
  });
10042
+ if (definition.forceTypeProp) {
10043
+ if (node2.props.type)
10044
+ node2.props.originalType = node2.props.type;
10045
+ context.props.type = definition.forceTypeProp;
10046
+ }
10047
+ if (definition.family) {
10048
+ context.props.family = definition.family;
10049
+ }
10040
10050
  if (definition.features) {
10041
10051
  definition.features.forEach((feature) => feature(node2));
10042
10052
  }
@@ -10686,6 +10696,7 @@ var dataDefaults = {
10686
10696
  submit: function submit(postUrl) {
10687
10697
  var prepData2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
10688
10698
  var redirect = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
10699
+ var contentType = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "application/json";
10689
10700
  return /* @__PURE__ */ function() {
10690
10701
  var _ref6 = _asyncToGenerator(function* (formData, node2) {
10691
10702
  if (prepData2 && prepData2 != "null") {
@@ -10696,13 +10707,14 @@ var dataDefaults = {
10696
10707
  }
10697
10708
  var abort = false;
10698
10709
  try {
10699
- var res = yield postJSON(postUrl, formData);
10710
+ var res = yield postData(postUrl, formData, contentType);
10700
10711
  node2.clearErrors();
10701
10712
  } catch (err) {
10713
+ console.error(err);
10702
10714
  abort = handleSubmitError(err, node2);
10703
10715
  }
10704
10716
  if (abort) {
10705
- return false;
10717
+ return;
10706
10718
  }
10707
10719
  if (typeof redirect === "string" && redirect !== "null") {
10708
10720
  if (formData) {
@@ -10710,9 +10722,8 @@ var dataDefaults = {
10710
10722
  }
10711
10723
  redirectTo(redirect);
10712
10724
  } else if (redirect) {
10713
- redirect(formData, node2);
10725
+ yield redirect(formData, node2);
10714
10726
  }
10715
- return true;
10716
10727
  });
10717
10728
  return function(_x3, _x4) {
10718
10729
  return _ref6.apply(this, arguments);
@@ -10796,6 +10807,7 @@ $$4({ target: "Array", proto: true, forced: String(test) === String(test.reverse
10796
10807
  }
10797
10808
  });
10798
10809
  var _excluded$2 = ["value", "name", "modelValue", "config", "plugins"];
10810
+ var explicitKeys = ["__key", "__init", "__shim", "__original", "__index", "__prevKey"];
10799
10811
  function token() {
10800
10812
  return Math.random().toString(36).substring(2, 15);
10801
10813
  }
@@ -11037,8 +11049,23 @@ function camel(str) {
11037
11049
  function kebab(str) {
11038
11050
  return str.replace(/([a-z0-9])([A-Z])/g, (_s, trail, cap) => trail + "-" + cap.toLowerCase()).replace(" ", "-").toLowerCase();
11039
11051
  }
11052
+ function shallowClone(obj) {
11053
+ var explicit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : explicitKeys;
11054
+ if (obj !== null && typeof obj === "object") {
11055
+ var returnObject;
11056
+ if (Array.isArray(obj))
11057
+ returnObject = [...obj];
11058
+ else if (isPojo(obj))
11059
+ returnObject = _objectSpread2({}, obj);
11060
+ if (returnObject) {
11061
+ applyExplicit(obj, returnObject, explicit);
11062
+ return returnObject;
11063
+ }
11064
+ }
11065
+ return obj;
11066
+ }
11040
11067
  function clone(obj) {
11041
- var explicit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["__key", "__init"];
11068
+ var explicit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : explicitKeys;
11042
11069
  if (obj === null || obj instanceof RegExp || obj instanceof Date || obj instanceof Map || obj instanceof Set || typeof File === "function" && obj instanceof File)
11043
11070
  return obj;
11044
11071
  var returnObject;
@@ -11096,6 +11123,17 @@ function init$1(obj) {
11096
11123
  function slugify(str) {
11097
11124
  return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]/g, " ").trim().replace(/\s+/g, "-");
11098
11125
  }
11126
+ function applyExplicit(original, obj, explicit) {
11127
+ for (var key of explicit) {
11128
+ if (key in original) {
11129
+ Object.defineProperty(obj, key, {
11130
+ enumerable: false,
11131
+ value: original[key]
11132
+ });
11133
+ }
11134
+ }
11135
+ return obj;
11136
+ }
11099
11137
  var _excluded$1 = ["$formkit", "for", "if", "children", "bind"], _excluded2 = ["$reset"];
11100
11138
  function createDispatcher$1() {
11101
11139
  var middleware = [];
@@ -11757,7 +11795,7 @@ function createValue(options2) {
11757
11795
  } else if (options2.type === "list") {
11758
11796
  return init$1(Array.isArray(options2.value) ? options2.value : []);
11759
11797
  }
11760
- return options2.value === null ? "" : options2.value;
11798
+ return options2.value;
11761
11799
  }
11762
11800
  function input(node2, context, value) {
11763
11801
  var async = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
@@ -12774,7 +12812,7 @@ function clearErrors(id2) {
12774
12812
  warn(652, id2);
12775
12813
  }
12776
12814
  }
12777
- var FORMKIT_VERSION = "1.0.0-beta.10";
12815
+ var FORMKIT_VERSION = "1.0.0-beta.11";
12778
12816
  function createLibraryPlugin() {
12779
12817
  for (var _len = arguments.length, libraries = new Array(_len), _key = 0; _key < _len; _key++) {
12780
12818
  libraries[_key] = arguments[_key];
@@ -12790,6 +12828,64 @@ function createLibraryPlugin() {
12790
12828
  };
12791
12829
  return plugin2;
12792
12830
  }
12831
+ function normalizeOptions(options2) {
12832
+ var i3 = 1;
12833
+ if (Array.isArray(options2)) {
12834
+ return options2.map((option2) => {
12835
+ if (typeof option2 === "string" || typeof option2 === "number") {
12836
+ return {
12837
+ label: String(option2),
12838
+ value: String(option2)
12839
+ };
12840
+ }
12841
+ if (typeof option2 == "object") {
12842
+ if ("value" in option2 && typeof option2.value !== "string") {
12843
+ Object.assign(option2, {
12844
+ value: "__mask_".concat(i3++),
12845
+ __original: option2.value
12846
+ });
12847
+ }
12848
+ }
12849
+ return option2;
12850
+ });
12851
+ }
12852
+ return Object.keys(options2).map((value) => {
12853
+ return {
12854
+ label: options2[value],
12855
+ value
12856
+ };
12857
+ });
12858
+ }
12859
+ function optionValue(options2, value) {
12860
+ if (Array.isArray(options2)) {
12861
+ for (var _option of options2) {
12862
+ if (value == _option.value) {
12863
+ return "__original" in _option ? _option.__original : _option.value;
12864
+ }
12865
+ }
12866
+ }
12867
+ return value;
12868
+ }
12869
+ function shouldSelect(valueA, valueB) {
12870
+ if (valueA == valueB)
12871
+ return true;
12872
+ if (isPojo(valueA) && isPojo(valueB))
12873
+ return eq(valueA, valueB);
12874
+ return false;
12875
+ }
12876
+ function options(node2) {
12877
+ node2.hook.prop((prop, next3) => {
12878
+ if (prop.prop === "options") {
12879
+ if (typeof prop.value === "function") {
12880
+ node2.props.optionsLoader = prop.value;
12881
+ prop.value = [];
12882
+ } else {
12883
+ prop.value = normalizeOptions(prop.value);
12884
+ }
12885
+ }
12886
+ return next3(prop);
12887
+ });
12888
+ }
12793
12889
  var outer = createSection("outer", () => ({
12794
12890
  $el: "div",
12795
12891
  attrs: {
@@ -13105,60 +13201,6 @@ function normalizeBoxes(node2) {
13105
13201
  return next3(prop);
13106
13202
  };
13107
13203
  }
13108
- function normalizeOptions(options2) {
13109
- var i3 = 1;
13110
- if (Array.isArray(options2)) {
13111
- return options2.map((option2) => {
13112
- if (typeof option2 === "string" || typeof option2 === "number") {
13113
- return {
13114
- label: option2,
13115
- value: option2
13116
- };
13117
- }
13118
- if (typeof option2 == "object") {
13119
- if ("value" in option2 && typeof option2.value !== "string") {
13120
- Object.assign(option2, {
13121
- value: "__mask_".concat(i3++),
13122
- __original: option2.value
13123
- });
13124
- }
13125
- }
13126
- return option2;
13127
- });
13128
- }
13129
- return Object.keys(options2).map((value) => {
13130
- return {
13131
- label: options2[value],
13132
- value
13133
- };
13134
- });
13135
- }
13136
- function optionValue(options2, value) {
13137
- if (Array.isArray(options2)) {
13138
- for (var _option of options2) {
13139
- if (value == _option.value) {
13140
- return "__original" in _option ? _option.__original : _option.value;
13141
- }
13142
- }
13143
- }
13144
- return value;
13145
- }
13146
- function shouldSelect(valueA, valueB) {
13147
- if (valueA == valueB)
13148
- return true;
13149
- if (isPojo(valueA) && isPojo(valueB))
13150
- return eq(valueA, valueB);
13151
- return false;
13152
- }
13153
- function options(node2) {
13154
- node2.hook.prop((prop, next3) => {
13155
- if (prop.prop === "options") {
13156
- var _options = normalizeOptions(prop.value);
13157
- prop.value = _options;
13158
- }
13159
- return next3(prop);
13160
- });
13161
- }
13162
13204
  function toggleChecked$1(node2, e2) {
13163
13205
  var el = e2.target;
13164
13206
  if (el instanceof HTMLInputElement) {
@@ -13584,12 +13626,15 @@ function createRoot(rootSection) {
13584
13626
  function $if(condition, then2, otherwise) {
13585
13627
  return (extensions) => {
13586
13628
  var node2 = then2(extensions);
13587
- if (otherwise) {
13588
- return {
13629
+ if (otherwise || isSchemaObject(node2) && "if" in node2 || isSlotCondition(node2)) {
13630
+ var conditionalNode = {
13589
13631
  if: condition,
13590
- then: node2,
13591
- else: otherwise(extensions)
13632
+ then: node2
13592
13633
  };
13634
+ if (otherwise) {
13635
+ conditionalNode.else = otherwise(extensions);
13636
+ }
13637
+ return conditionalNode;
13593
13638
  } else if (isSlotCondition(node2)) {
13594
13639
  Object.assign(node2.else, {
13595
13640
  if: condition
@@ -13635,7 +13680,7 @@ var checkbox = {
13635
13680
  }), decorator(icon("decorator")), suffix()), $if("$option.label", boxLabel("$option.label"))), boxHelp("$option.help"))))), $if("$options == undefined && $help", help("$help")), messages(message("$message.value"))),
13636
13681
  type: "input",
13637
13682
  family: "box",
13638
- props: ["options", "onValue", "offValue"],
13683
+ props: ["options", "onValue", "offValue", "optionsLoader"],
13639
13684
  features: [options, checkboxes, defaultIcon("decorator", "checkboxDecorator")]
13640
13685
  };
13641
13686
  var file = {
@@ -13677,16 +13722,16 @@ var radio = {
13677
13722
  value: "$option.value",
13678
13723
  checked: "$fns.isChecked($option.value)"
13679
13724
  }
13680
- }), decorator(icon("decorator")), suffix()), $if("$option.label", boxLabel("$option.label"))), boxHelp("$option.help"))))), $if("$options == undefined && $help", help("$help")), messages(message("$message.value"))),
13725
+ }), decorator(icon("decorator")), suffix()), $if("$option.label", boxLabel("$option.label"))), boxHelp("$option.help"))))), $if("$options === undefined && $help", help("$help")), messages(message("$message.value"))),
13681
13726
  type: "input",
13682
13727
  family: "box",
13683
- props: ["options", "onValue", "offValue"],
13728
+ props: ["options", "onValue", "offValue", "optionsLoader"],
13684
13729
  features: [options, radios, defaultIcon("decorator", "radioDecorator")]
13685
13730
  };
13686
13731
  var select = {
13687
13732
  schema: outer(wrapper(label("$label"), inner(icon("prefix"), prefix(), selectInput$1($if("$slots.default", () => "$slots.default", $if("$slots.option", optionSlot, option("$option.label")))), $if("$attrs.multiple !== undefined", () => "", icon("select")), suffix(), icon("suffix"))), help("$help"), messages(message("$message.value"))),
13688
13733
  type: "input",
13689
- props: ["options", "placeholder"],
13734
+ props: ["options", "placeholder", "optionsLoader"],
13690
13735
  features: [options, select$1, defaultIcon("select", "select")]
13691
13736
  };
13692
13737
  var textarea = {
@@ -14950,6 +14995,7 @@ var accepted = function accepted2(_ref) {
14950
14995
  } = _ref;
14951
14996
  return ["yes", "on", "1", 1, true, "true"].includes(value);
14952
14997
  };
14998
+ accepted.skipEmpty = false;
14953
14999
  var date_after = function date_after2(_ref2) {
14954
15000
  var {
14955
15001
  value
@@ -15687,7 +15733,11 @@ var ui$s = {
15687
15733
  removeAll: "Remove all",
15688
15734
  incomplete: "Sorry, not all fields are filled out correctly.",
15689
15735
  submit: "Submit",
15690
- noFiles: "No file chosen"
15736
+ noFiles: "No file chosen",
15737
+ moveUp: "Move up",
15738
+ moveDown: "Move down",
15739
+ isLoading: "Loading...",
15740
+ loadMore: "Load more"
15691
15741
  };
15692
15742
  var validation$s = {
15693
15743
  accepted(_ref126) {
@@ -16272,7 +16322,7 @@ function createIconHandler(iconLoader, iconLoaderUrl) {
16272
16322
  iconName = isDefault ? iconName.split(":")[1] : iconName;
16273
16323
  var loadedIcon = void 0;
16274
16324
  if (icon2 || iconName in iconRegistry) {
16275
- return icon2;
16325
+ return iconRegistry[iconName];
16276
16326
  } else if (!iconRequests[iconName]) {
16277
16327
  loadedIcon = getIconFromStylesheet(iconName);
16278
16328
  loadedIcon = isClient && typeof loadedIcon === "undefined" ? Promise.resolve(loadedIcon) : loadedIcon;
@@ -16438,61 +16488,67 @@ var errors = {
16438
16488
  } = _ref9;
16439
16489
  return "Cannot set ".concat(node2.name, " to non array value: ").concat(value);
16440
16490
  },
16441
- 600: (_ref10) => {
16491
+ 300: (_ref10) => {
16442
16492
  var {
16443
- data: node2
16493
+ data: [node2]
16444
16494
  } = _ref10;
16445
- return "Unknown input type".concat(typeof node2.props.type === "string" ? ' "' + node2.props.type + '"' : "", ' ("').concat(node2.name, '")');
16495
+ return "Cannot set behavior prop to overscroll (on ".concat(node2.name, " input) when options prop is a function.");
16446
16496
  },
16447
- 601: (_ref11) => {
16497
+ 600: (_ref11) => {
16448
16498
  var {
16449
16499
  data: node2
16450
16500
  } = _ref11;
16501
+ return "Unknown input type".concat(typeof node2.props.type === "string" ? ' "' + node2.props.type + '"' : "", ' ("').concat(node2.name, '")');
16502
+ },
16503
+ 601: (_ref12) => {
16504
+ var {
16505
+ data: node2
16506
+ } = _ref12;
16451
16507
  return "Input definition".concat(typeof node2.props.type === "string" ? ' "' + node2.props.type + '"' : "", " is missing a schema or component property (").concat(node2.name, ").");
16452
16508
  }
16453
16509
  };
16454
16510
  var warnings = {
16455
- 150: (_ref12) => {
16511
+ 150: (_ref13) => {
16456
16512
  var {
16457
16513
  data: fn
16458
- } = _ref12;
16514
+ } = _ref13;
16459
16515
  return 'Schema function "'.concat(fn, '()" is not a valid function.');
16460
16516
  },
16461
- 151: (_ref13) => {
16517
+ 151: (_ref14) => {
16462
16518
  var {
16463
16519
  data: id2
16464
- } = _ref13;
16520
+ } = _ref14;
16465
16521
  return "No form element with id: ".concat(id2);
16466
16522
  },
16467
- 152: (_ref14) => {
16523
+ 152: (_ref15) => {
16468
16524
  var {
16469
16525
  data: id2
16470
- } = _ref14;
16526
+ } = _ref15;
16471
16527
  return "No input element with id: ".concat(id2);
16472
16528
  },
16473
- 350: (_ref15) => {
16529
+ 350: (_ref16) => {
16474
16530
  var {
16475
16531
  data: node2
16476
- } = _ref15;
16532
+ } = _ref16;
16477
16533
  return "Invalid options prop for radio input (".concat(node2.name, "). See https://formkit.com/inputs/radio");
16478
16534
  },
16479
16535
  650: 'Schema "$get()" must use the id of an input to access.',
16480
- 651: (_ref16) => {
16536
+ 651: (_ref17) => {
16481
16537
  var {
16482
16538
  data: id2
16483
- } = _ref16;
16539
+ } = _ref17;
16484
16540
  return 'Cannot setErrors() on "'.concat(id2, '" because no such id exists.');
16485
16541
  },
16486
- 652: (_ref17) => {
16542
+ 652: (_ref18) => {
16487
16543
  var {
16488
16544
  data: id2
16489
- } = _ref17;
16545
+ } = _ref18;
16490
16546
  return 'Cannot clearErrors() on "'.concat(id2, '" because no such id exists.');
16491
16547
  },
16492
- 800: (_ref18) => {
16548
+ 800: (_ref19) => {
16493
16549
  var {
16494
16550
  data: name
16495
- } = _ref18;
16551
+ } = _ref19;
16496
16552
  return "".concat(name, " is deprecated.");
16497
16553
  }
16498
16554
  };
@@ -16542,17 +16598,20 @@ function getValue(set34, path) {
16542
16598
  return void 0;
16543
16599
  }
16544
16600
  var foundValue = void 0;
16545
- path.reduce((obj, segment, i3, arr) => {
16546
- if (typeof obj !== "object") {
16601
+ var obj = set34;
16602
+ for (var _i in path) {
16603
+ var key = path[_i];
16604
+ if (typeof obj !== "object" || obj === null) {
16547
16605
  foundValue = void 0;
16548
- return arr.splice(1);
16606
+ break;
16549
16607
  }
16550
- var currentValue = obj[segment];
16551
- if (i3 === path.length - 1 && currentValue !== void 0) {
16608
+ var currentValue = obj[key];
16609
+ if (Number(_i) === path.length - 1 && currentValue !== void 0) {
16552
16610
  foundValue = currentValue;
16611
+ break;
16553
16612
  }
16554
- return obj[segment];
16555
- }, set34);
16613
+ obj = currentValue;
16614
+ }
16556
16615
  return foundValue;
16557
16616
  }
16558
16617
  function get$1(nodeRefs, id2) {
@@ -17363,6 +17422,9 @@ function useInput(props2, context) {
17363
17422
  else
17364
17423
  (_a = node2.at(path)) === null || _a === void 0 ? void 0 : _a.input(value2, false);
17365
17424
  });
17425
+ if (node2.value !== value) {
17426
+ node2.emit("modelUpdated");
17427
+ }
17366
17428
  }
17367
17429
  onUnmounted(() => node2.destroy());
17368
17430
  return node2;
@@ -17608,15 +17670,23 @@ var vueBindings = function vueBindings2(node2) {
17608
17670
  var {
17609
17671
  payload
17610
17672
  } = _ref8;
17611
- _value.value = payload;
17612
- triggerRef(_value);
17673
+ if (node2.type !== "input" && !isRef(payload) && !isReactive(payload)) {
17674
+ _value.value = shallowClone(payload);
17675
+ } else {
17676
+ _value.value = payload;
17677
+ triggerRef(_value);
17678
+ }
17613
17679
  });
17614
17680
  node2.on("commit", (_ref9) => {
17615
17681
  var {
17616
17682
  payload
17617
17683
  } = _ref9;
17618
- value.value = _value.value = payload;
17619
- triggerRef(value);
17684
+ if (node2.type !== "input" && !isRef(payload) && !isReactive(payload)) {
17685
+ value.value = _value.value = shallowClone(payload);
17686
+ } else {
17687
+ value.value = _value.value = payload;
17688
+ triggerRef(value);
17689
+ }
17620
17690
  node2.emit("modelUpdated");
17621
17691
  if (!context.state.dirty && node2.isCreated && hasTicked && !eq(value.value, node2.props._init))
17622
17692
  context.handlers.touch();
@@ -18061,32 +18131,40 @@ var doRedirect = (redirectUrl, newTabUrl) => {
18061
18131
  dbg("redirect:", redirectUrl, "newTab:", newTabUrl);
18062
18132
  redirectTo(redirectUrl);
18063
18133
  };
18064
- var handleRedirect = (formData, node2) => {
18065
- try {
18066
- var redirectUrl = getRedirect(formData, node2);
18067
- if (redirectUrl && redirectUrl !== "null") {
18068
- if (node2 && node2.props.attrs.popUnder) {
18069
- var popUnderUrl = node2.props.attrs.popUnder;
18070
- var res = openNewTab(redirectUrl);
18071
- if (res !== null) {
18072
- if (popUnderUrl && formData) {
18073
- popUnderUrl = strSubUrl(popUnderUrl, formData);
18134
+ var handleRedirect = /* @__PURE__ */ function() {
18135
+ var _ref = _asyncToGenerator(function* (formData, node2) {
18136
+ try {
18137
+ var redirectUrl = getRedirect(formData, node2);
18138
+ if (redirectUrl && redirectUrl !== "null") {
18139
+ if (node2 && node2.props.attrs.popUnder) {
18140
+ var popUnderUrl = node2.props.attrs.popUnder;
18141
+ var res = openNewTab(redirectUrl);
18142
+ if (res !== null) {
18143
+ if (popUnderUrl && formData) {
18144
+ popUnderUrl = strSubUrl(popUnderUrl, formData);
18145
+ }
18146
+ doRedirect(popUnderUrl, redirectUrl);
18147
+ } else {
18148
+ dbg("new tab failed");
18149
+ doRedirect(redirectUrl, "failed");
18074
18150
  }
18075
- doRedirect(popUnderUrl, redirectUrl);
18076
18151
  } else {
18077
- dbg("new tab failed");
18078
- doRedirect(redirectUrl, "failed");
18152
+ doRedirect(redirectUrl, null);
18079
18153
  }
18154
+ yield new Promise((resolve3) => setTimeout(resolve3, 2e3));
18080
18155
  } else {
18081
- doRedirect(redirectUrl, null);
18156
+ rollbar("warning", "No redirectUrl found");
18082
18157
  }
18158
+ } catch (err) {
18159
+ var msg = "failed to handleRedirect: " + err.toString();
18160
+ console.warn(msg);
18161
+ rollbar("warning", msg);
18083
18162
  }
18084
- } catch (err) {
18085
- var msg = "failed to handleRedirect: " + err.toString();
18086
- console.warn(msg);
18087
- rollbar("warning", msg);
18088
- }
18089
- };
18163
+ });
18164
+ return function handleRedirect2(_x2, _x3) {
18165
+ return _ref.apply(this, arguments);
18166
+ };
18167
+ }();
18090
18168
  var textClassification = {
18091
18169
  label: "t-block t-mb-3 t-font-semibold t-text-base formkit-invalid:t-text-red-500",
18092
18170
  inner: "\n t-max-w-lg\n t-border\n t-border-gray-400\n formkit-invalid:t-border-red-500\n t-rounded t-mb-1\n t-overflow-hidden\n focus-within:t-border-blue-500\n ",