powerpagestoolkit 1.1.23 → 1.1.25

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.
@@ -0,0 +1,1100 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["powerpagestoolkit"] = factory();
8
+ else
9
+ root["powerpagestoolkit"] = factory();
10
+ })(this, () => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ "use strict";
13
+ /******/ var __webpack_modules__ = ({
14
+
15
+ /***/ 693:
16
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
17
+
18
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
20
+ /* harmony export */ });
21
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(601);
22
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
23
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(314);
24
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
25
+ // Imports
26
+
27
+
28
+ var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
29
+ // Module
30
+ ___CSS_LOADER_EXPORT___.push([module.id, `.info-icon {
31
+ position: relative;
32
+ display: inline-block;
33
+ }
34
+
35
+ .info-icon .fa-info-circle {
36
+ cursor: pointer; /* Ensures the icon is recognized as interactive */
37
+ }
38
+
39
+ .info-icon .flyout-content {
40
+ display: none; /* Initially hidden */
41
+ position: absolute;
42
+ top: 100%;
43
+ left: 50%; /* Center horizontally */
44
+ transform: translateX(-50%); /* Adjust positioning */
45
+ background-color: #f9f9f9;
46
+ padding: 10px;
47
+ border: 1px solid #ddd;
48
+ z-index: 1;
49
+ max-width: 90vw; /* Ensure it doesn't overflow on mobile */
50
+ min-width: 200px; /* Minimum width for better readability */
51
+ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
52
+ border-radius: 4px; /* Rounded corners */
53
+ }
54
+ `, ""]);
55
+ // Exports
56
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
57
+
58
+
59
+ /***/ }),
60
+
61
+ /***/ 314:
62
+ /***/ ((module) => {
63
+
64
+
65
+
66
+ /*
67
+ MIT License http://www.opensource.org/licenses/mit-license.php
68
+ Author Tobias Koppers @sokra
69
+ */
70
+ module.exports = function (cssWithMappingToString) {
71
+ var list = [];
72
+
73
+ // return the list of modules as css string
74
+ list.toString = function toString() {
75
+ return this.map(function (item) {
76
+ var content = "";
77
+ var needLayer = typeof item[5] !== "undefined";
78
+ if (item[4]) {
79
+ content += "@supports (".concat(item[4], ") {");
80
+ }
81
+ if (item[2]) {
82
+ content += "@media ".concat(item[2], " {");
83
+ }
84
+ if (needLayer) {
85
+ content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
86
+ }
87
+ content += cssWithMappingToString(item);
88
+ if (needLayer) {
89
+ content += "}";
90
+ }
91
+ if (item[2]) {
92
+ content += "}";
93
+ }
94
+ if (item[4]) {
95
+ content += "}";
96
+ }
97
+ return content;
98
+ }).join("");
99
+ };
100
+
101
+ // import a list of modules into the list
102
+ list.i = function i(modules, media, dedupe, supports, layer) {
103
+ if (typeof modules === "string") {
104
+ modules = [[null, modules, undefined]];
105
+ }
106
+ var alreadyImportedModules = {};
107
+ if (dedupe) {
108
+ for (var k = 0; k < this.length; k++) {
109
+ var id = this[k][0];
110
+ if (id != null) {
111
+ alreadyImportedModules[id] = true;
112
+ }
113
+ }
114
+ }
115
+ for (var _k = 0; _k < modules.length; _k++) {
116
+ var item = [].concat(modules[_k]);
117
+ if (dedupe && alreadyImportedModules[item[0]]) {
118
+ continue;
119
+ }
120
+ if (typeof layer !== "undefined") {
121
+ if (typeof item[5] === "undefined") {
122
+ item[5] = layer;
123
+ } else {
124
+ item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
125
+ item[5] = layer;
126
+ }
127
+ }
128
+ if (media) {
129
+ if (!item[2]) {
130
+ item[2] = media;
131
+ } else {
132
+ item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
133
+ item[2] = media;
134
+ }
135
+ }
136
+ if (supports) {
137
+ if (!item[4]) {
138
+ item[4] = "".concat(supports);
139
+ } else {
140
+ item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
141
+ item[4] = supports;
142
+ }
143
+ }
144
+ list.push(item);
145
+ }
146
+ };
147
+ return list;
148
+ };
149
+
150
+ /***/ }),
151
+
152
+ /***/ 601:
153
+ /***/ ((module) => {
154
+
155
+
156
+
157
+ module.exports = function (i) {
158
+ return i[1];
159
+ };
160
+
161
+ /***/ }),
162
+
163
+ /***/ 72:
164
+ /***/ ((module) => {
165
+
166
+
167
+
168
+ var stylesInDOM = [];
169
+ function getIndexByIdentifier(identifier) {
170
+ var result = -1;
171
+ for (var i = 0; i < stylesInDOM.length; i++) {
172
+ if (stylesInDOM[i].identifier === identifier) {
173
+ result = i;
174
+ break;
175
+ }
176
+ }
177
+ return result;
178
+ }
179
+ function modulesToDom(list, options) {
180
+ var idCountMap = {};
181
+ var identifiers = [];
182
+ for (var i = 0; i < list.length; i++) {
183
+ var item = list[i];
184
+ var id = options.base ? item[0] + options.base : item[0];
185
+ var count = idCountMap[id] || 0;
186
+ var identifier = "".concat(id, " ").concat(count);
187
+ idCountMap[id] = count + 1;
188
+ var indexByIdentifier = getIndexByIdentifier(identifier);
189
+ var obj = {
190
+ css: item[1],
191
+ media: item[2],
192
+ sourceMap: item[3],
193
+ supports: item[4],
194
+ layer: item[5]
195
+ };
196
+ if (indexByIdentifier !== -1) {
197
+ stylesInDOM[indexByIdentifier].references++;
198
+ stylesInDOM[indexByIdentifier].updater(obj);
199
+ } else {
200
+ var updater = addElementStyle(obj, options);
201
+ options.byIndex = i;
202
+ stylesInDOM.splice(i, 0, {
203
+ identifier: identifier,
204
+ updater: updater,
205
+ references: 1
206
+ });
207
+ }
208
+ identifiers.push(identifier);
209
+ }
210
+ return identifiers;
211
+ }
212
+ function addElementStyle(obj, options) {
213
+ var api = options.domAPI(options);
214
+ api.update(obj);
215
+ var updater = function updater(newObj) {
216
+ if (newObj) {
217
+ if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
218
+ return;
219
+ }
220
+ api.update(obj = newObj);
221
+ } else {
222
+ api.remove();
223
+ }
224
+ };
225
+ return updater;
226
+ }
227
+ module.exports = function (list, options) {
228
+ options = options || {};
229
+ list = list || [];
230
+ var lastIdentifiers = modulesToDom(list, options);
231
+ return function update(newList) {
232
+ newList = newList || [];
233
+ for (var i = 0; i < lastIdentifiers.length; i++) {
234
+ var identifier = lastIdentifiers[i];
235
+ var index = getIndexByIdentifier(identifier);
236
+ stylesInDOM[index].references--;
237
+ }
238
+ var newLastIdentifiers = modulesToDom(newList, options);
239
+ for (var _i = 0; _i < lastIdentifiers.length; _i++) {
240
+ var _identifier = lastIdentifiers[_i];
241
+ var _index = getIndexByIdentifier(_identifier);
242
+ if (stylesInDOM[_index].references === 0) {
243
+ stylesInDOM[_index].updater();
244
+ stylesInDOM.splice(_index, 1);
245
+ }
246
+ }
247
+ lastIdentifiers = newLastIdentifiers;
248
+ };
249
+ };
250
+
251
+ /***/ }),
252
+
253
+ /***/ 659:
254
+ /***/ ((module) => {
255
+
256
+
257
+
258
+ var memo = {};
259
+
260
+ /* istanbul ignore next */
261
+ function getTarget(target) {
262
+ if (typeof memo[target] === "undefined") {
263
+ var styleTarget = document.querySelector(target);
264
+
265
+ // Special case to return head of iframe instead of iframe itself
266
+ if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
267
+ try {
268
+ // This will throw an exception if access to iframe is blocked
269
+ // due to cross-origin restrictions
270
+ styleTarget = styleTarget.contentDocument.head;
271
+ } catch (e) {
272
+ // istanbul ignore next
273
+ styleTarget = null;
274
+ }
275
+ }
276
+ memo[target] = styleTarget;
277
+ }
278
+ return memo[target];
279
+ }
280
+
281
+ /* istanbul ignore next */
282
+ function insertBySelector(insert, style) {
283
+ var target = getTarget(insert);
284
+ if (!target) {
285
+ throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
286
+ }
287
+ target.appendChild(style);
288
+ }
289
+ module.exports = insertBySelector;
290
+
291
+ /***/ }),
292
+
293
+ /***/ 540:
294
+ /***/ ((module) => {
295
+
296
+
297
+
298
+ /* istanbul ignore next */
299
+ function insertStyleElement(options) {
300
+ var element = document.createElement("style");
301
+ options.setAttributes(element, options.attributes);
302
+ options.insert(element, options.options);
303
+ return element;
304
+ }
305
+ module.exports = insertStyleElement;
306
+
307
+ /***/ }),
308
+
309
+ /***/ 56:
310
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
311
+
312
+
313
+
314
+ /* istanbul ignore next */
315
+ function setAttributesWithoutAttributes(styleElement) {
316
+ var nonce = true ? __webpack_require__.nc : 0;
317
+ if (nonce) {
318
+ styleElement.setAttribute("nonce", nonce);
319
+ }
320
+ }
321
+ module.exports = setAttributesWithoutAttributes;
322
+
323
+ /***/ }),
324
+
325
+ /***/ 825:
326
+ /***/ ((module) => {
327
+
328
+
329
+
330
+ /* istanbul ignore next */
331
+ function apply(styleElement, options, obj) {
332
+ var css = "";
333
+ if (obj.supports) {
334
+ css += "@supports (".concat(obj.supports, ") {");
335
+ }
336
+ if (obj.media) {
337
+ css += "@media ".concat(obj.media, " {");
338
+ }
339
+ var needLayer = typeof obj.layer !== "undefined";
340
+ if (needLayer) {
341
+ css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
342
+ }
343
+ css += obj.css;
344
+ if (needLayer) {
345
+ css += "}";
346
+ }
347
+ if (obj.media) {
348
+ css += "}";
349
+ }
350
+ if (obj.supports) {
351
+ css += "}";
352
+ }
353
+ var sourceMap = obj.sourceMap;
354
+ if (sourceMap && typeof btoa !== "undefined") {
355
+ css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
356
+ }
357
+
358
+ // For old IE
359
+ /* istanbul ignore if */
360
+ options.styleTagTransform(css, styleElement, options.options);
361
+ }
362
+ function removeStyleElement(styleElement) {
363
+ // istanbul ignore if
364
+ if (styleElement.parentNode === null) {
365
+ return false;
366
+ }
367
+ styleElement.parentNode.removeChild(styleElement);
368
+ }
369
+
370
+ /* istanbul ignore next */
371
+ function domAPI(options) {
372
+ if (typeof document === "undefined") {
373
+ return {
374
+ update: function update() {},
375
+ remove: function remove() {}
376
+ };
377
+ }
378
+ var styleElement = options.insertStyleElement(options);
379
+ return {
380
+ update: function update(obj) {
381
+ apply(styleElement, options, obj);
382
+ },
383
+ remove: function remove() {
384
+ removeStyleElement(styleElement);
385
+ }
386
+ };
387
+ }
388
+ module.exports = domAPI;
389
+
390
+ /***/ }),
391
+
392
+ /***/ 113:
393
+ /***/ ((module) => {
394
+
395
+
396
+
397
+ /* istanbul ignore next */
398
+ function styleTagTransform(css, styleElement) {
399
+ if (styleElement.styleSheet) {
400
+ styleElement.styleSheet.cssText = css;
401
+ } else {
402
+ while (styleElement.firstChild) {
403
+ styleElement.removeChild(styleElement.firstChild);
404
+ }
405
+ styleElement.appendChild(document.createTextNode(css));
406
+ }
407
+ }
408
+ module.exports = styleTagTransform;
409
+
410
+ /***/ })
411
+
412
+ /******/ });
413
+ /************************************************************************/
414
+ /******/ // The module cache
415
+ /******/ var __webpack_module_cache__ = {};
416
+ /******/
417
+ /******/ // The require function
418
+ /******/ function __webpack_require__(moduleId) {
419
+ /******/ // Check if module is in cache
420
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
421
+ /******/ if (cachedModule !== undefined) {
422
+ /******/ return cachedModule.exports;
423
+ /******/ }
424
+ /******/ // Create a new module (and put it into the cache)
425
+ /******/ var module = __webpack_module_cache__[moduleId] = {
426
+ /******/ id: moduleId,
427
+ /******/ // no module.loaded needed
428
+ /******/ exports: {}
429
+ /******/ };
430
+ /******/
431
+ /******/ // Execute the module function
432
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
433
+ /******/
434
+ /******/ // Return the exports of the module
435
+ /******/ return module.exports;
436
+ /******/ }
437
+ /******/
438
+ /************************************************************************/
439
+ /******/ /* webpack/runtime/compat get default export */
440
+ /******/ (() => {
441
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
442
+ /******/ __webpack_require__.n = (module) => {
443
+ /******/ var getter = module && module.__esModule ?
444
+ /******/ () => (module['default']) :
445
+ /******/ () => (module);
446
+ /******/ __webpack_require__.d(getter, { a: getter });
447
+ /******/ return getter;
448
+ /******/ };
449
+ /******/ })();
450
+ /******/
451
+ /******/ /* webpack/runtime/define property getters */
452
+ /******/ (() => {
453
+ /******/ // define getter functions for harmony exports
454
+ /******/ __webpack_require__.d = (exports, definition) => {
455
+ /******/ for(var key in definition) {
456
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
457
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
458
+ /******/ }
459
+ /******/ }
460
+ /******/ };
461
+ /******/ })();
462
+ /******/
463
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
464
+ /******/ (() => {
465
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
466
+ /******/ })();
467
+ /******/
468
+ /******/ /* webpack/runtime/make namespace object */
469
+ /******/ (() => {
470
+ /******/ // define __esModule on exports
471
+ /******/ __webpack_require__.r = (exports) => {
472
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
473
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
474
+ /******/ }
475
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
476
+ /******/ };
477
+ /******/ })();
478
+ /******/
479
+ /******/ /* webpack/runtime/nonce */
480
+ /******/ (() => {
481
+ /******/ __webpack_require__.nc = undefined;
482
+ /******/ })();
483
+ /******/
484
+ /************************************************************************/
485
+ var __webpack_exports__ = {};
486
+ // ESM COMPAT FLAG
487
+ __webpack_require__.r(__webpack_exports__);
488
+
489
+ // EXPORTS
490
+ __webpack_require__.d(__webpack_exports__, {
491
+ API: () => (/* reexport */ JS_API),
492
+ createDOMNodeReference: () => (/* reexport */ createDOMNodeReference)
493
+ });
494
+
495
+ ;// ./src/JS/safeAjax.js
496
+ function safeAjax(ajaxOptions) {
497
+ var deferredAjax = $.Deferred();
498
+
499
+ // shell is only available via runtime in a PowerPages portal
500
+ //eslint-disable-next-line
501
+ shell.getTokenDeferred().done(function (token) {
502
+ // add headers for AJAX
503
+ if (!ajaxOptions.headers) {
504
+ $.extend(ajaxOptions, {
505
+ headers: {
506
+ __RequestVerificationToken: token
507
+ }
508
+ });
509
+ } else {
510
+ ajaxOptions.headers["__RequestVerificationToken"] = token;
511
+ }
512
+ $.ajax(ajaxOptions).done(function (data, textStatus, jqXHR) {
513
+ //eslint-disable-next-line
514
+ validateLoginSession(data, textStatus, jqXHR, deferredAjax.resolve);
515
+ }).fail(deferredAjax.reject); //AJAX
516
+ }).fail(function () {
517
+ deferredAjax.rejectWith(this, arguments); // on token failure pass the token AJAX and args
518
+ });
519
+ return deferredAjax.promise();
520
+ }
521
+ ;// ./src/JS/API.js
522
+
523
+ var API = {
524
+ /**
525
+ *
526
+ * @param {Class} schema an instance of a schema class, containing the desired information for the POST request
527
+ * @returns a Promise resolving the successful results *[record id]* of the POST request, or rejecting the failed results *[error]* of the POST request.
528
+ */
529
+ createRecord: function createRecord(schema) {
530
+ return new Promise(function (resolve, reject) {
531
+ safeAjax({
532
+ type: "POST",
533
+ url: "/_api/".concat(schema.logicalName()),
534
+ data: schema.value(),
535
+ contentType: "application/json",
536
+ success: function success(response, status, xhr) {
537
+ resolve(xhr.getResponseHeader("entityid"));
538
+ },
539
+ error: function error(_error) {
540
+ reject(_error);
541
+ }
542
+ });
543
+ });
544
+ },
545
+ /**
546
+ *
547
+ * @param {string} tableSetName The DataVerse SET name of the table being queried
548
+ * @param {string} recordID the GUID of the records to be retrieved
549
+ * @param {string} selectColumns *OPTIONAL* if desired, enter your own custom OData query for advanced GET results. Format = select=column1,column2,column3...
550
+ * @returns a Promise resolving the successful results of the GET request, or rejecting the failed results of the GET request
551
+ */
552
+ getRecord: function getRecord(tableSetName, recordID, selectColumns) {
553
+ return new Promise(function (resolve, reject) {
554
+ var url = "/_api/".concat(tableSetName, "(").concat(recordID, ")").concat(selectColumns ? "?$".concat(selectColumns) : "");
555
+ safeAjax({
556
+ type: "GET",
557
+ url: url,
558
+ success: resolve,
559
+ error: reject
560
+ });
561
+ });
562
+ },
563
+ /**
564
+ *
565
+ * @param {String} tableSetName The DataVerse SET name of the table being queried
566
+ * @param {String} queryParameters *OPTIONAL* the OData query parameters for refining search results: *format = $filter=filters&$select=columns*
567
+ * @returns a Promise resolving the successful results of the GET request, or rejecting the failed results of the GET request
568
+ */
569
+ getMultiple: function getMultiple(tableSetName, queryParameters) {
570
+ return new Promise(function (resolve, reject) {
571
+ // Construct the URL based on the presence of query parameters
572
+ var url = "/_api/".concat(tableSetName).concat(queryParameters ? "?".concat(queryParameters) : "");
573
+ safeAjax({
574
+ type: "GET",
575
+ url: url,
576
+ success: function success(response) {
577
+ resolve(response.value);
578
+ },
579
+ error: reject
580
+ });
581
+ });
582
+ }
583
+ };
584
+ /* harmony default export */ const JS_API = (API);
585
+ ;// ./src/JS/common_functions.js
586
+ /**
587
+ * @description a function that will wait for a targeted element to appear in the DOM, and then resolve a promise to allow further action to be performed after the targeted elements appears
588
+ * @param {String} selector a query selector expression to target a specific element that you want to appear in the DOM before taking further action
589
+ * @returns {Promise} the element targeted by ID *selector*
590
+ */
591
+
592
+ function waitFor(selector) {
593
+ return new Promise(function (resolve) {
594
+ if (document.querySelector(selector)) {
595
+ return resolve(document.querySelector(selector));
596
+ }
597
+ var observer = new MutationObserver(function () {
598
+ if (document.querySelector(selector)) {
599
+ observer.disconnect();
600
+ resolve(document.querySelector(selector));
601
+ }
602
+ });
603
+ observer.observe(document.body, {
604
+ subtree: true
605
+ });
606
+ });
607
+ }
608
+ ;// ./src/JS/FieldValidation.class.js
609
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
610
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
611
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
612
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
613
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
614
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
615
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
616
+ var FieldValidation = /*#__PURE__*/_createClass(function FieldValidation(fieldLogicalName, fieldDisplayname, evaluationFunction) {
617
+ _classCallCheck(this, FieldValidation);
618
+ _defineProperty(this, "createValidator", function () {
619
+ if (typeof Page_Validators == "undefined") return;
620
+ // Create new validator
621
+ var newValidator = document.createElement("span");
622
+ newValidator.style.display = "none";
623
+ newValidator.id = "".concat(this.fieldLogicalName, "Validator");
624
+ newValidator.controltovalidate = "".concat(this.fieldLogicalName);
625
+ newValidator.errormessage = "<a href='#".concat(this.fieldDisplayname, "_label'>").concat(this.fieldDisplayname, " is a required field</a>");
626
+ newValidator.validationGroup = ""; // Set this if you have set ValidationGroup on the form
627
+ newValidator.initialvalue = "";
628
+ newValidator.evaluationfunction = this.evaluationFunction;
629
+ // Add the new validator to the page validators array:
630
+ // eslint-disable-next-line no-undef
631
+ Page_Validators.push(newValidator);
632
+ });
633
+ this.fieldLogicalName = fieldLogicalName;
634
+ this.fieldDisplayname = fieldDisplayname;
635
+ this.evaluationFunction = evaluationFunction.bind(this);
636
+ this.createValidator();
637
+ });
638
+
639
+ // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
640
+ var injectStylesIntoStyleTag = __webpack_require__(72);
641
+ var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
642
+ // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleDomAPI.js
643
+ var styleDomAPI = __webpack_require__(825);
644
+ var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
645
+ // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertBySelector.js
646
+ var insertBySelector = __webpack_require__(659);
647
+ var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
648
+ // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
649
+ var setAttributesWithoutAttributes = __webpack_require__(56);
650
+ var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
651
+ // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertStyleElement.js
652
+ var insertStyleElement = __webpack_require__(540);
653
+ var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
654
+ // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleTagTransform.js
655
+ var styleTagTransform = __webpack_require__(113);
656
+ var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
657
+ // EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./src/CSS/infoEl.style.css
658
+ var infoEl_style = __webpack_require__(693);
659
+ ;// ./src/CSS/infoEl.style.css
660
+
661
+
662
+
663
+
664
+
665
+
666
+
667
+
668
+
669
+
670
+
671
+ var options = {};
672
+
673
+ options.styleTagTransform = (styleTagTransform_default());
674
+ options.setAttributes = (setAttributesWithoutAttributes_default());
675
+ options.insert = insertBySelector_default().bind(null, "head");
676
+ options.domAPI = (styleDomAPI_default());
677
+ options.insertStyleElement = (insertStyleElement_default());
678
+
679
+ var update = injectStylesIntoStyleTag_default()(infoEl_style/* default */.A, options);
680
+
681
+
682
+
683
+
684
+ /* harmony default export */ const CSS_infoEl_style = (infoEl_style/* default */.A && infoEl_style/* default */.A.locals ? infoEl_style/* default */.A.locals : undefined);
685
+
686
+ ;// ./src/JS/createInfoElement.js
687
+ // Import the CSS file
688
+
689
+ function CreateInfoEl(titleString) {
690
+ var span = document.createElement("span");
691
+ span.classList.add("info-icon");
692
+ var icon = document.createElement("i");
693
+ icon.classList.add("fa", "fa-solid", "fa-info-circle");
694
+ icon.setAttribute("aria-label", "Info");
695
+ icon.style.cursor = "pointer";
696
+ var flyoutContent = document.createElement("div");
697
+ flyoutContent.innerHTML = titleString;
698
+ flyoutContent.classList.add("flyout-content");
699
+ span.appendChild(icon);
700
+ span.appendChild(flyoutContent);
701
+ icon.addEventListener("mouseenter", function () {
702
+ flyoutContent.style.display = "block";
703
+ });
704
+ icon.addEventListener("mouseleave", function () {
705
+ flyoutContent.style.display = "none";
706
+ });
707
+ icon.addEventListener("touchstart", function (event) {
708
+ event.preventDefault();
709
+ flyoutContent.style.display = flyoutContent.style.display === "none" ? "block" : "none";
710
+ });
711
+ document.body.addEventListener("click", function (event) {
712
+ if (!span.contains(event.target)) {
713
+ flyoutContent.style.display = "none";
714
+ }
715
+ });
716
+ return span;
717
+ }
718
+ ;// ./src/JS/DOMNodeReferences.js
719
+ function DOMNodeReferences_typeof(o) { "@babel/helpers - typeof"; return DOMNodeReferences_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, DOMNodeReferences_typeof(o); }
720
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == DOMNodeReferences_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(DOMNodeReferences_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
721
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
722
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
723
+ function DOMNodeReferences_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
724
+ function DOMNodeReferences_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, DOMNodeReferences_toPropertyKey(o.key), o); } }
725
+ function DOMNodeReferences_createClass(e, r, t) { return r && DOMNodeReferences_defineProperties(e.prototype, r), t && DOMNodeReferences_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
726
+ function DOMNodeReferences_toPropertyKey(t) { var i = DOMNodeReferences_toPrimitive(t, "string"); return "symbol" == DOMNodeReferences_typeof(i) ? i : i + ""; }
727
+ function DOMNodeReferences_toPrimitive(t, r) { if ("object" != DOMNodeReferences_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != DOMNodeReferences_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
728
+
729
+
730
+
731
+
732
+ /**
733
+ * Class representing a reference to a DOM node.
734
+ */
735
+ var DOMNodeReference = /*#__PURE__*/function () {
736
+ /**
737
+ * Creates an instance of DOMNodeReference.
738
+ * @param {string} querySelector - The CSS selector to find the desired DOM element.
739
+ */
740
+ function DOMNodeReference(querySelector) {
741
+ DOMNodeReferences_classCallCheck(this, DOMNodeReference);
742
+ this.querySelector = querySelector;
743
+ this.element = null;
744
+ this.isLoaded = false;
745
+ // Deferred initialization
746
+ }
747
+
748
+ /**
749
+ * Initializes the DOMNodeReference instance by waiting for the element to be available in the DOM.
750
+ * @returns {Promise<Proxy>} A promise that resolves to a Proxy of the DOMNodeReference instance.
751
+ * @throws {Error} Throws an error if the element cannot be found using the provided query selector.
752
+ */
753
+ return DOMNodeReferences_createClass(DOMNodeReference, [{
754
+ key: "init",
755
+ value: (function () {
756
+ var _init = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
757
+ var element;
758
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
759
+ while (1) switch (_context.prev = _context.next) {
760
+ case 0:
761
+ _context.next = 2;
762
+ return waitFor(this.querySelector);
763
+ case 2:
764
+ element = _context.sent;
765
+ if (element) {
766
+ _context.next = 5;
767
+ break;
768
+ }
769
+ throw new Error("[SYNACT] No Element could be found with the provided query selector: ".concat(this.querySelector));
770
+ case 5:
771
+ this.element = element;
772
+ this.parentElement = element.parentElement;
773
+ this.container = element.parentElement.parentElement.parentElement;
774
+ this.isLoaded = true;
775
+ if (!this.element.classList.contains("boolean-radio")) {
776
+ _context.next = 16;
777
+ break;
778
+ }
779
+ _context.next = 12;
780
+ return createDOMNodeReference("#".concat(this.element.id, "_1"));
781
+ case 12:
782
+ this.yesRadio = _context.sent;
783
+ _context.next = 15;
784
+ return createDOMNodeReference("#".concat(this.element.id, "_0"));
785
+ case 15:
786
+ this.noRadio = _context.sent;
787
+ case 16:
788
+ this.defaultDisplay = this.element.style.display || "block";
789
+ this.defaultParentDisplay = this.parentElement.style.display || "block";
790
+ this.defaultContainerDisplay = this.container.style.display || "block";
791
+ case 19:
792
+ case "end":
793
+ return _context.stop();
794
+ }
795
+ }, _callee, this);
796
+ }));
797
+ function init() {
798
+ return _init.apply(this, arguments);
799
+ }
800
+ return init;
801
+ }()
802
+ /**
803
+ * Hides the element by setting its display style to "none".
804
+ * @method hide
805
+ */
806
+ )
807
+ }, {
808
+ key: "hide",
809
+ value: function hide() {
810
+ this.element.style.display = "none";
811
+ }
812
+
813
+ /**
814
+ * Shows the element by restoring its default display style.
815
+ * @method show
816
+ */
817
+ }, {
818
+ key: "show",
819
+ value: function show() {
820
+ this.element.style.display = this.defaultDisplay;
821
+ }
822
+
823
+ /**
824
+ * Hides the parent element by setting its display style to "none".
825
+ * @method hideParent
826
+ */
827
+ }, {
828
+ key: "hideParent",
829
+ value: function hideParent() {
830
+ this.parentElement.style.display = "none";
831
+ }
832
+
833
+ /**
834
+ * Shows the parent element by restoring its default display style.
835
+ * @method showParent
836
+ */
837
+ }, {
838
+ key: "showParent",
839
+ value: function showParent() {
840
+ this.parentElement.style.display = this.defaultParentDisplay;
841
+ }
842
+
843
+ /**
844
+ * Hides the container (grandparent of the element) by setting its display style to "none".
845
+ * @method hideContainer
846
+ */
847
+ }, {
848
+ key: "hideContainer",
849
+ value: function hideContainer() {
850
+ this.element.parentElement.parentElement.parentElement.style.display = "none";
851
+ }
852
+
853
+ /**
854
+ * Shows the container (grandparent of the element) by restoring its default display style.
855
+ * @method showContainer
856
+ */
857
+ }, {
858
+ key: "showContainer",
859
+ value: function showContainer() {
860
+ this.element.parentElement.parentElement.parentElement.style.display = this.defaultContainerDisplay;
861
+ }
862
+
863
+ /**
864
+ * Sets the value of the HTML element.
865
+ * @method setValue
866
+ * @param {string} value - The value to set for the HTML element.
867
+ */
868
+ }, {
869
+ key: "setValue",
870
+ value: function setValue(value) {
871
+ this.element.value = value;
872
+ }
873
+
874
+ /**
875
+ * Gets the value of the HTML element.
876
+ * @method getValue
877
+ * @returns {string} The current value of the HTML element.
878
+ */
879
+ }, {
880
+ key: "getValue",
881
+ value: function getValue() {
882
+ return this.element.value;
883
+ }
884
+
885
+ /**
886
+ * Appends child elements to the HTML element.
887
+ * @method append
888
+ * @param {...HTMLElement} elements - The elements to append to the HTML element.
889
+ */
890
+ }, {
891
+ key: "append",
892
+ value: function append() {
893
+ var _this$element;
894
+ (_this$element = this.element).append.apply(_this$element, arguments);
895
+ }
896
+
897
+ /**
898
+ * Inserts elements after the HTML element.
899
+ * @method after
900
+ * @param {...HTMLElement} elements - The elements to insert after the HTML element.
901
+ */
902
+ }, {
903
+ key: "after",
904
+ value: function after() {
905
+ var _this$element2;
906
+ (_this$element2 = this.element).after.apply(_this$element2, arguments);
907
+ }
908
+
909
+ /**
910
+ * Retrieves the label associated with the HTML element.
911
+ * @method getLabel
912
+ * @returns {HTMLElement} The label element associated with this element.
913
+ * @throws {Error} Throws an error if the label cannot be found.
914
+ */
915
+ }, {
916
+ key: "getLabel",
917
+ value: function getLabel() {
918
+ return document.querySelector("#".concat(this.element.id, "_label"));
919
+ }
920
+
921
+ /**
922
+ * Appends child elements to the label associated with the HTML element.
923
+ * @method appendToLabel
924
+ * @param {...HTMLElement} elements - The elements to append to the label.
925
+ */
926
+ }, {
927
+ key: "appendToLabel",
928
+ value: function appendToLabel() {
929
+ var label = this.getLabel();
930
+ for (var _len = arguments.length, elements = new Array(_len), _key = 0; _key < _len; _key++) {
931
+ elements[_key] = arguments[_key];
932
+ }
933
+ label.append.apply(label, [" "].concat(elements));
934
+ }
935
+
936
+ /**
937
+ * Adds a click event listener to the HTML element.
938
+ * @method addClickListener
939
+ * @param {Function} eventHandler - The function to execute when the element is clicked.
940
+ */
941
+ }, {
942
+ key: "addClickListener",
943
+ value: function addClickListener(eventHandler) {
944
+ this.element.addEventListener("click", function (e) {
945
+ e.preventDefault();
946
+ eventHandler();
947
+ });
948
+ }
949
+
950
+ /**
951
+ * Adds a change event listener to the HTML element.
952
+ * @method addChangeListener
953
+ * @param {Function} eventHandler - The function to execute when the element's value changes.
954
+ */
955
+ }, {
956
+ key: "addChangeListener",
957
+ value: function addChangeListener(eventHandler) {
958
+ this.element.addEventListener("change", function (e) {
959
+ e.preventDefault();
960
+ eventHandler();
961
+ });
962
+ }
963
+
964
+ /**
965
+ * Unchecks both the yes and no radio buttons if they exist.
966
+ * @method uncheckRadios
967
+ */
968
+ }, {
969
+ key: "uncheckRadios",
970
+ value: function uncheckRadios() {
971
+ if (this.yesRadio && this.noRadio) {
972
+ this.yesRadio.element.checked = false;
973
+ this.noRadio.element.checked = false;
974
+ } else {
975
+ console.error("[SYNACT] Attempted to uncheck radios for an element that has no radios");
976
+ }
977
+ }
978
+
979
+ /**
980
+ * Creates a validation instance for the field.
981
+ * @method createValidation
982
+ * @param {Function} evaluationFunction - The function used to evaluate the field.
983
+ * @param {string} fieldDisplayName - The field name to display in error if validation fails.
984
+ */
985
+ }, {
986
+ key: "createValidation",
987
+ value: function createValidation(evaluationFunction, fieldDisplayName) {
988
+ new FieldValidation(this.id, "'".concat(fieldDisplayName, "'"), evaluationFunction);
989
+ }
990
+
991
+ /**
992
+ * Adds a tooltip with specified text to the label associated with the HTML element.
993
+ * @method addLabelTooltip
994
+ * @param {string} text - The text to display in the tooltip.
995
+ */
996
+ }, {
997
+ key: "addLabelTooltip",
998
+ value: function addLabelTooltip(text) {
999
+ this.appendToLabel(CreateInfoEl(text));
1000
+ }
1001
+
1002
+ /**
1003
+ * Sets the inner HTML content of the HTML element.
1004
+ * @method setTextContent
1005
+ * @param {string} text - The text to set as the inner HTML of the element.
1006
+ */
1007
+ }, {
1008
+ key: "setTextContent",
1009
+ value: function setTextContent(text) {
1010
+ this.element.innerHTML = text;
1011
+ }
1012
+
1013
+ /**
1014
+ * Executes a callback function once the element is fully loaded.
1015
+ * If the element is already loaded, the callback is called immediately.
1016
+ * Otherwise, a MutationObserver is used to detect when the element is added to the DOM.
1017
+ * @method onceLoaded
1018
+ * @param {Function} callback - A callback function to execute once the element is loaded.
1019
+ */
1020
+ }, {
1021
+ key: "onceLoaded",
1022
+ value: function onceLoaded(callback) {
1023
+ var _this = this;
1024
+ console.log("loading element");
1025
+ if (this.isLoaded) {
1026
+ callback(this);
1027
+ } else {
1028
+ var observer = new MutationObserver(function () {
1029
+ if (document.querySelector(_this.querySelector)) {
1030
+ observer.disconnect(); // Stop observing once loaded
1031
+ _this.isLoaded = true;
1032
+ callback(_this); // Call the provided callback
1033
+ }
1034
+ });
1035
+ observer.observe(document.body, {
1036
+ subtree: true,
1037
+ childList: true
1038
+ });
1039
+ }
1040
+ }
1041
+ }]);
1042
+ }();
1043
+ /**
1044
+ * Creates and initializes a DOMNodeReference instance.
1045
+ * @async
1046
+ * @function createDOMNodeReference
1047
+ * @param {string} querySelector - The CSS selector for the desired DOM element.
1048
+ * @returns {Promise<DOMNodeReference>} A promise that resolves to a Proxy of the initialized DOMNodeReference instance.
1049
+ */
1050
+ function createDOMNodeReference(_x) {
1051
+ return _createDOMNodeReference.apply(this, arguments);
1052
+ }
1053
+ function _createDOMNodeReference() {
1054
+ _createDOMNodeReference = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(querySelector) {
1055
+ var instance;
1056
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1057
+ while (1) switch (_context2.prev = _context2.next) {
1058
+ case 0:
1059
+ instance = new DOMNodeReference(querySelector);
1060
+ _context2.next = 3;
1061
+ return instance.init();
1062
+ case 3:
1063
+ return _context2.abrupt("return", new Proxy(instance, {
1064
+ get: function get(target, prop) {
1065
+ // do not proxy the initialization method
1066
+ // init() is only needed in this factory function
1067
+ if (prop == "init") return undefined;
1068
+
1069
+ // proxy the class to wrap all methods in the 'onceLoaded' method, to make sure the
1070
+ // element is always available before executing method
1071
+ var value = target[prop];
1072
+ if (typeof value === "function" && prop !== "onceLoaded") {
1073
+ return function () {
1074
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1075
+ args[_key2] = arguments[_key2];
1076
+ }
1077
+ return target.onceLoaded(function () {
1078
+ return value.apply(target, args);
1079
+ });
1080
+ };
1081
+ }
1082
+ return value;
1083
+ }
1084
+ }));
1085
+ case 4:
1086
+ case "end":
1087
+ return _context2.stop();
1088
+ }
1089
+ }, _callee2);
1090
+ }));
1091
+ return _createDOMNodeReference.apply(this, arguments);
1092
+ }
1093
+ ;// ./src/index.js
1094
+
1095
+
1096
+
1097
+ /******/ return __webpack_exports__;
1098
+ /******/ })()
1099
+ ;
1100
+ });
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "powerpagestoolkit",
3
- "version": "1.1.23",
3
+ "version": "1.1.25",
4
4
  "description": "Reference, manipulate, and engage with Power Pages sites through the nodes in the DOM; use a variety of custom methods that allow customizing your power pages site quicker and easier. ",
5
- "main": "out/index.bundle.js",
5
+ "main": "dist/index.bundle.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
- "build": "webpack --config webpack.config.cjs"
8
+ "clean": "rimraf dist",
9
+ "build": "npm run clean && webpack --config webpack.config.cjs"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@babel/core": "^7.25.8",
@@ -15,11 +15,12 @@
15
15
  "babel-loader": "^9.2.1",
16
16
  "css-loader": "^7.1.2",
17
17
  "eslint": "^8.57.1",
18
+ "rimraf": "^6.0.1",
18
19
  "style-loader": "^4.0.0",
20
+ "terser-webpack-plugin": "^5.3.4",
19
21
  "typescript": "^5.6.3",
20
22
  "webpack": "^5.95.0",
21
- "webpack-cli": "^5.1.4",
22
- "terser-webpack-plugin": "^5.3.4"
23
+ "webpack-cli": "^5.1.4"
23
24
  },
24
25
  "author": "KeatonBrewster",
25
26
  "license": "SSPL-1.0",
@@ -29,7 +30,7 @@
29
30
  "url": "https://github.com/Keaton-Brewster/PowerPagesToolKit"
30
31
  },
31
32
  "files": [
32
- "out/index.bundle.js",
33
+ "dist",
33
34
  "index.d.ts"
34
35
  ]
35
36
  }
@@ -1,52 +0,0 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else if(typeof exports === 'object')
7
- exports["powerpagestoolkit"] = factory();
8
- else
9
- root["powerpagestoolkit"] = factory();
10
- })(this, () => {
11
- return /******/ // The require scope
12
- /******/ var __webpack_require__ = {};
13
- /******/
14
- /************************************************************************/
15
- /******/ /* webpack/runtime/make namespace object */
16
- /******/ (() => {
17
- /******/ // define __esModule on exports
18
- /******/ __webpack_require__.r = (exports) => {
19
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
20
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
21
- /******/ }
22
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
23
- /******/ };
24
- /******/ })();
25
- /******/
26
- /************************************************************************/
27
- var __webpack_exports__ = {};
28
- __webpack_require__.r(__webpack_exports__);
29
-
30
-
31
- Object.defineProperty(exports, "__esModule", {
32
- value: true
33
- });
34
- Object.defineProperty(exports, "API", {
35
- enumerable: true,
36
- get: function get() {
37
- return _API["default"];
38
- }
39
- });
40
- Object.defineProperty(exports, "createDOMNodeReference", {
41
- enumerable: true,
42
- get: function get() {
43
- return _DOMNodeReferences["default"];
44
- }
45
- });
46
- var _API = _interopRequireDefault(require("./lib/JS/API.js"));
47
- var _DOMNodeReferences = _interopRequireDefault(require("./lib/JS/DOMNodeReferences.js"));
48
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
49
- /******/ return __webpack_exports__;
50
- ;
51
- })
52
- //# sourceMappingURL=index.bundle.js.map