diff --git a/news/198.bugfix b/news/198.bugfix new file mode 100644 index 0000000..1c95d25 --- /dev/null +++ b/news/198.bugfix @@ -0,0 +1,2 @@ +Fix bug when pattern class is not the first one, after adding a new row. +[frapell] diff --git a/package.json b/package.json index c985259..a6e5f51 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "yarn": "^1.22.19" }, "dependencies": { - "@patternslib/patternslib": "9.9.16", - "@plone/mockup": "5.1.13" + "@patternslib/patternslib": "^9.9.16", + "@plone/mockup": "^5.1.14" }, "devDependencies": { "@patternslib/dev": "^3.6.1" diff --git a/resources/js/datagridfield.pattern.js b/resources/js/datagridfield.pattern.js index 359fd06..1f644a4 100644 --- a/resources/js/datagridfield.pattern.js +++ b/resources/js/datagridfield.pattern.js @@ -338,11 +338,12 @@ export default Base.extend({ var $new_row = $(new_row); // enable patternslib - $new_row - .find('*[class^="dgw-disabled-pat-"]') - .attr("class", function (i, cls) { - return cls.replace(/dgw\-disabled-pat-/, "pat-"); + const disabled_prefix = "dgw-disabled-pat-"; + new_row.querySelectorAll(`[class*="${disabled_prefix}"]`).forEach(el => { + el.classList.forEach(cls => { + el.classList.replace(cls, cls.replace(disabled_prefix, "pat-")); }); + }); return new_row; }, diff --git a/src/collective/z3cform/datagridfield/static/chunks/245.26f6a815b7b177fc847b.min.js.map b/src/collective/z3cform/datagridfield/static/chunks/245.26f6a815b7b177fc847b.min.js.map deleted file mode 100644 index 2c57cb9..0000000 --- a/src/collective/z3cform/datagridfield/static/chunks/245.26f6a815b7b177fc847b.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"chunks/245.26f6a815b7b177fc847b.min.js","mappings":"2MAOAA,EAAAA,EAAQC,SAAS,QACLD,EAAAA,EAAQE,UAAU,iBAGfC,EAAAA,EAAKC,OAAO,CACvBC,KAAM,gBACNC,QAAS,qBACTC,OAAQ,SAERC,KAAM,WACF,6BAKAC,KAAKC,GAAKD,KAAKE,IAAI,GACnBF,KAAKG,QAAUH,KAA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AAWnD,EAAKqC,GACrBrC,EAAIN,QAAQ2B,MAAQgB,EACpBA,IACJ,GAAGjD,MAEH,IAAIoG,EAAcpG,KAAKG,QAAQG,QAAQ8F,YAAc,IACtCpG,KAAKC,GAAGG,cACnB,eAAiBgG,EAAc,WAE1BU,MAAQ9G,KAAK0D,YAEtB1D,KAAK+C,YACT,EAEAgE,aAAc,SAAUC,GACpB,IAAIC,EAASD,EAAKvF,QAAQ,uBAC1B,OAAIwF,GAGG,IACX,EAEAnG,kBAAmB,WA0Bf,IAAIkC,EAAOhD,KAAKsD,UACZ4D,EAAelH,KAAKU,iBAGxB,SAAIsC,EAAKE,QAAkC,IAAxBgE,EAAahE,UAC5BlD,KAAK0B,mBACE,EAGf,ICjkBJyF,EAAAA,EAASpH,M","sources":["webpack://collective-z3cform-datagridfield/./resources/js/datagridfield.pattern.js","webpack://collective-z3cform-datagridfield/./resources/datagridfield-config.js"],"sourcesContent":["// Layout Mosaic pattern.\nimport \"regenerator-runtime/runtime\"; // needed for ``await`` support\nimport $ from \"jquery\";\nimport Base from \"@patternslib/patternslib/src/core/base\";\nimport Registry from \"@patternslib/patternslib/src/core/registry\";\nimport logging from \"@patternslib/patternslib/src/core/logging\";\n\nlogging.setLevel(\"INFO\");\nconst log = logging.getLogger(\"datagridfield\");\n\n\nexport default Base.extend({\n name: \"datagridfield\",\n trigger: \".pat-datagridfield\",\n parser: \"mockup\",\n\n init: function () {\n import(\"../scss/datagridfield.scss\");\n\n // - Make sure, at least one empty row is always shown.\n // - Auto append a new row when editing the last row.\n\n this.el = this.$el[0];\n this.el_body = this.el.querySelector(\".datagridwidget-body\");\n\n this.auto_append = (this.el.dataset.autoAppend || \"true\").toLowerCase() !== \"false\"; // prettier-ignore\n\n this._defineHandler();\n\n // Before ensureMinimumRows, as creating a row initializes row ui again.\n this.getVisibleRows().forEach(function (row) {\n this.initRowUI(row);\n }, this);\n\n if (!this.ensureMinimumRows()) {\n // If ensureMinimumRows returned true, it already did the update.\n this.updateOrderIndex();\n }\n this.initAutoAppendHandler();\n\n this.el.dispatchEvent(\n new Event(\"afterdatagridfieldinit\", {\n bubbles: true,\n cancelable: true,\n })\n );\n },\n\n _defineHandler: function () {\n // Store event handler which also has to be removed, so we can detach it.\n // See: https://stackoverflow.com/a/10444156/1337474 , also comment about \"bind\"\n // using ``bind`` will change the function signature too.\n\n this.handler_auto_append = function (e) {\n if (e) {\n e.stopPropagation();\n }\n // Also allow direct call without event.\n if (e && !e.target.closest(\".datagridwidget-cell\")) {\n return;\n }\n this.auto_append_row();\n }.bind(this);\n\n this.handler_auto_append_input = function (e) {\n var row = e.currentTarget;\n row.classList.remove(\"auto-append\");\n row.dataset.oldIndex = row.dataset.index; // store for replacing.\n delete row.dataset.index; // remove \"AA\" index\n this.updateOrderIndex();\n row.removeEventListener(\n \"input\",\n this.handler_auto_append_input\n );\n }.bind(this);\n },\n\n initRowUI: function (row) {\n row.querySelectorAll(\".dgf--row-add\").forEach(function (el) {\n el.addEventListener(\n \"click\",\n function (e) {\n e.preventDefault();\n this.insertRow(row);\n this.updateOrderIndex();\n }.bind(this)\n );\n }, this);\n\n row.querySelectorAll(\".dgf--row-delete\").forEach(function (el) {\n el.addEventListener(\n \"click\",\n function (e) {\n e.preventDefault();\n e.stopPropagation();\n this.removeFieldRow(row);\n }.bind(this)\n );\n }, this);\n\n row.querySelectorAll(\".dgf--row-moveup\").forEach(function (el) {\n el.addEventListener(\n \"click\",\n function (e) {\n e.preventDefault();\n this.moveRowUp(row);\n }.bind(this)\n );\n }, this);\n\n row.querySelectorAll(\".dgf--row-movedown\").forEach(function (el) {\n el.addEventListener(\n \"click\",\n function (e) {\n e.preventDefault();\n this.moveRowDown(row);\n }.bind(this)\n );\n }, this);\n },\n\n get_row_buttons: function (row) {\n return {\n add: row.querySelector(\".dgf--row-add\"),\n delete: row.querySelector(\".dgf--row-delete\"),\n up: row.querySelector(\".dgf--row-moveup\"),\n down: row.querySelector(\".dgf--row-movedown\"),\n };\n },\n\n setUIState: function () {\n var rows = this.getVisibleRows();\n for (var cnt = 0; cnt < rows.length; cnt++) {\n var row = rows[cnt];\n var buttons = this.get_row_buttons(row);\n\n if (this.auto_append === true && row.dataset.index === \"AA\") {\n // Special case AA\n\n if (buttons.add) {\n buttons.add.disabled = true;\n }\n if (buttons.delete) {\n buttons.delete.disabled = true;\n }\n if (buttons.up) {\n buttons.up.disabled = true;\n }\n if (buttons.down) {\n buttons.down.disabled = true;\n }\n if (cnt > 0) {\n // Set the previous buttons also, if available.\n var before_aa_buttons = this.get_row_buttons(\n rows[cnt - 1]\n );\n if (before_aa_buttons.down) {\n before_aa_buttons.down.disabled = true;\n }\n }\n } else if (cnt === 0) {\n // First row\n\n if (buttons.add) {\n buttons.add.disabled = false;\n }\n if (buttons.delete) {\n buttons.delete.disabled = false;\n }\n if (buttons.up) {\n buttons.up.disabled = true;\n }\n if (buttons.down) {\n buttons.down.disabled = rows.length === 1; // disable if 1 row.\n }\n } else if (cnt === rows.length - 1) {\n // Last button - if no AA buttons.\n // Also, if this is reached, it's not the only row.\n\n if (buttons.add) {\n buttons.add.disabled = false;\n }\n if (buttons.delete) {\n buttons.delete.disabled = false;\n }\n if (buttons.up) {\n buttons.up.disabled = false;\n }\n if (buttons.down) {\n buttons.down.disabled = true;\n }\n } else {\n // Normal in-between case.\n\n if (buttons.add) {\n buttons.add.disabled = false;\n }\n if (buttons.delete) {\n buttons.delete.disabled = false;\n }\n if (buttons.up) {\n buttons.up.disabled = false;\n }\n if (buttons.down) {\n buttons.down.disabled = false;\n }\n }\n }\n },\n\n getRows: function () {\n // Return primary nodes with class of datagridwidget-row, they can be any tag: tr, div, etc.\n return this.el_body.querySelectorAll(\".datagridwidget-row\");\n },\n\n getVisibleRows: function () {\n return this.el_body.querySelectorAll(\n \".datagridwidget-row:not([data-index=TT])\"\n );\n },\n\n getLastRow: function () {\n return this.el_body.querySelector(\".datagridwidget-row:last-child\");\n },\n\n getLastVisibleRow: function () {\n var result = this.el_body.querySelectorAll(\n \".datagridwidget-row:not([data-index=TT])\"\n );\n return result[result.length - 1];\n },\n\n countRows: function () {\n var count = 0;\n this.getRows().forEach(function (row) {\n // do not include the TT and the AA rows in the count\n if ([\"AA\", \"TT\"].indexOf(row.dataset.index) === -1) {\n count++;\n }\n }, this);\n return count;\n },\n\n initAutoAppendHandler: function () {\n if (!this.auto_append) {\n return;\n }\n\n this.getVisibleRows().forEach(function (row) {\n row.removeEventListener(\"focusout\", this.handler_auto_append);\n }, this);\n\n var last_row = this.getLastVisibleRow();\n if (last_row) {\n last_row.addEventListener(\"focusout\", this.handler_auto_append);\n }\n },\n\n auto_append_row: function () {\n this.el.dispatchEvent(new Event(\"beforeaddrowauto\"));\n this.getVisibleRows().forEach(function (row) {\n row.classList.remove(\"auto-append\");\n if (row.dataset.index !== \"TT\") {\n // actually, getVisibleRows should only return non-\"TT\"\n // rows, but to be clear here...\n // delete the index, we're setting it in updateOrderIndex again.\n row.dataset.oldIndex = row.dataset.index; // store for replacing.\n delete row.dataset.index;\n }\n });\n var last_row = this.getLastVisibleRow() || this.getLastRow();\n var new_row = this.insertRow(last_row);\n new_row.classList.add(\"auto-append\");\n this.reindexRow(new_row, \"AA\");\n this.updateOrderIndex();\n new_row.addEventListener(\"input\", this.handler_auto_append_input);\n this.el.dispatchEvent(new Event(\"afteraddrowauto\"));\n },\n\n insertRow: function (ref_row, before) {\n /**\n * Add a new row when changing the last row\n *\n * @param {DOM node} ref_row insert row after this one.\n */\n\n // Create a new row\n var newtr = this.createNewRow();\n var $newtr = $(newtr);\n\n /* Put new row to DOM tree after our current row. Do this before\n * reindexing to ensure that any Javascript we insert that depends on\n * DOM element IDs (such as plone.formwidget.autocomplete) will\n * pick up this row before any IDs get changed. At this point,\n * we techinically have duplicate TT IDs in our document\n * (one for this new row, one for the hidden row), but jQuery\n * selectors will pick up elements in this new row first.\n */\n\n this.$el.trigger(\"beforeaddrow\", [this.$el, $newtr]);\n\n if (before) {\n $newtr.insertBefore(ref_row);\n } else {\n $newtr.insertAfter(ref_row);\n }\n\n this.initRowUI(newtr);\n Registry.scan($newtr);\n\n this.initAutoAppendHandler();\n\n this.$el.trigger(\"afteraddrow\", [this.$el, $newtr]);\n\n return newtr;\n },\n\n createNewRow: function () {\n /**\n * Creates a new row.\n *\n * The row is not inserted to the table, but is returned.\n */\n\n // hidden template row\n var template_row = this.el_body.querySelector(\"[data-index=TT]\");\n if (!template_row) {\n throw new Error(\"Could not locate empty template row in DGF\");\n }\n\n var new_row = document.createElement(\"table\");\n new_row.innerHTML = template_row.outerHTML;\n new_row = new_row.querySelector(\"tr\");\n\n new_row.dataset.oldIndex = new_row.dataset.index; // store for replacing.\n delete new_row.dataset.index; // fresh row.\n new_row.classList.remove(\"datagridwidget-empty-row\");\n\n var $new_row = $(new_row);\n // enable patternslib\n $new_row\n .find('*[class^=\"dgw-disabled-pat-\"]')\n .attr(\"class\", function (i, cls) {\n return cls.replace(/dgw\\-disabled-pat-/, \"pat-\");\n });\n return new_row;\n },\n\n removeFieldRow: function (row) {\n /* Remove the row in which the given node is found */\n $(row).remove();\n\n if (!this.ensureMinimumRows()) {\n // If ensureMinimumRows returned true, it already did the update.\n this.updateOrderIndex();\n }\n this.updateOrderIndex();\n this.initAutoAppendHandler();\n },\n\n moveRowDown: function (row) {\n this.moveRow(row, \"down\");\n this.updateOrderIndex();\n this.initAutoAppendHandler();\n },\n\n moveRowUp: function (row) {\n this.moveRow(row, \"up\");\n this.updateOrderIndex();\n this.initAutoAppendHandler();\n },\n\n moveRowToTop: function (row) {\n var rows = this.getRows();\n $(row).insertBefore(rows[0]);\n this.updateOrderIndex();\n this.initAutoAppendHandler();\n },\n\n moveRowToBottom: function (row) {\n var rows = this.getRows();\n\n // make sure we insert the directly above any auto appended rows\n var insert_after = 0;\n $(rows).each(function (i, _row) {\n if ([\"AA\", \"TT\"].indexOf(_row.dataset.index) === -1) {\n insert_after = i;\n }\n });\n $(row).insertAfter(rows[insert_after]);\n this.updateOrderIndex();\n this.initAutoAppendHandler();\n },\n\n moveRow: function (row, direction) {\n /* Move the given row down one */\n var nextRow;\n var rows = this.getRows();\n var idx = null;\n\n // We can't use nextSibling because of blank text nodes in some browsers\n // Need to find the index of the row\n $(rows).each(function (i, _row) {\n if (row === _row) {\n idx = i;\n }\n });\n\n // Abort if the current row wasn't found\n if (idx === null) {\n return;\n }\n\n // The up and down should cycle through the rows, excluding the auto-append and\n // empty-row rows.\n var validrows = this.countRows();\n\n if (idx + 1 == validrows) {\n if (direction == \"down\") {\n this.moveRowToTop(row);\n } else {\n nextRow = rows[idx - 1];\n this.shiftRow(nextRow, row);\n }\n } else if (idx === 0) {\n if (direction == \"up\") {\n this.moveRowToBottom(row);\n } else {\n nextRow = rows[parseInt(idx + 1, 10)];\n this.shiftRow(row, nextRow);\n }\n } else {\n if (direction == \"up\") {\n nextRow = rows[idx - 1];\n this.shiftRow(nextRow, row);\n } else {\n nextRow = rows[parseInt(idx + 1, 10)];\n this.shiftRow(row, nextRow);\n }\n }\n this.$el.trigger(\"aftermoverow\", [this.$el, row]);\n },\n\n shiftRow: function (bottom, top) {\n /* Put node top before node bottom */\n $(top).insertBefore(bottom);\n },\n\n reindexRow: function (row, new_index) {\n /**\n * Fixup all attributes on all child elements that contain\n * the row index. The following attributes are scanned:\n * - name\n * - id\n * - for\n * - href\n * - data-fieldname\n *\n * On the server side, the DGF logic will rebuild rows based\n * on this information.\n *\n * If indexing for some reasons fails you'll get double\n * input values and Zope converts inputs to list, failing\n * in funny ways.\n *\n * @param {DOM} row\n * @param {Number} new_index\n */\n\n var name_prefix = this.el_body.dataset.name_prefix + \".\";\n var id_prefix = this.el_body.dataset.id_prefix + \"-\";\n var old_index = row.dataset.oldIndex || row.dataset.index;\n delete row.dataset.oldIndex;\n\n function replaceIndex(el, attr, prefix) {\n var val = el.getAttribute(attr);\n if (val) {\n var pattern = new RegExp(\"^\" + prefix + old_index);\n el.setAttribute(\n attr,\n val.replace(pattern, prefix + new_index)\n );\n }\n }\n\n row.dataset.index = new_index; // update index data\n\n row.querySelectorAll('[id^=\"formfield-' + id_prefix + '\"]').forEach(function (el) {\n replaceIndex(el, \"id\", \"formfield-\" + id_prefix);\n }, this); // prettier-ignore\n row.querySelectorAll('[name^=\"' + name_prefix + '\"]').forEach(function (el) {\n replaceIndex(el, \"name\", name_prefix);\n }, this); // prettier-ignore\n row.querySelectorAll('[id^=\"' + id_prefix + '\"]').forEach(function (el) {\n replaceIndex(el, \"id\", id_prefix);\n }, this); // prettier-ignore\n row.querySelectorAll('[for^=\"' + id_prefix + '\"]').forEach(function (el) {\n replaceIndex(el, \"for\", id_prefix);\n }, this); // prettier-ignore\n row.querySelectorAll('[href*=\"#' + id_prefix + '\"]').forEach(function (el) {\n replaceIndex(el, \"href\", \"#\" + id_prefix);\n }, this); // prettier-ignore\n row.querySelectorAll('[data-fieldname^=\"' + name_prefix + '\"]').forEach(function (el) {\n replaceIndex(el, \"data-fieldname\", name_prefix);\n }, this); // prettier-ignore\n },\n\n updateOrderIndex: function () {\n /**\n * Update all row indexes on a DGF table.\n *\n * Each and input widget has recalculated row index number in its name,\n * so that the server can then parsit the submitted data in the correct order.\n */\n\n var cnt = 0;\n var rows = this.getRows();\n rows.forEach(function (row) {\n var index = row.dataset.index;\n if ([\"AA\", \"TT\"].indexOf(index) > -1) {\n this.reindexRow(row, index);\n return;\n }\n this.reindexRow(row, cnt);\n row.dataset.index = cnt;\n cnt++; // we start counting with \"0\"\n }, this);\n\n var name_prefix = this.el_body.dataset.name_prefix + \".\";\n var count_el = this.el.querySelector(\n 'input[name=\"' + name_prefix + 'count\"]'\n );\n count_el.value = this.countRows();\n\n this.setUIState();\n },\n\n getParentRow: function (node) {\n var parent = node.closest(\".datagridwidget-row\");\n if (parent) {\n return parent;\n }\n return null;\n },\n\n ensureMinimumRows: function () {\n /**\n * Make sure there is at least one visible row available in DGF\n * to edit in all the time.\n *\n * We need a lot of special logic for the case where\n * we have empty datagridfield and need to have one OPTIONAL\n * row present there for the editing when the user opens\n * the form for the first time.\n *\n * There are cases where one doesn't want to have the count of DGF\n * rows to go down to zero. Otherwise there no insert handle left\n * on the edit mode and the user cannot add any more rows.\n *\n * One should case is when\n *\n * - DGF is empty on new form\n *\n * - Auto append is set to false (initial row is not visible)\n *\n * We fix this situation by checking the available rows\n * and generating one empty AA row if needed.\n *\n * ... or simply when the user removes all the rows\n */\n\n var rows = this.getRows();\n var filteredRows = this.getVisibleRows();\n\n // Rows = 0 -> make one AA row available\n if (rows.length && filteredRows.length === 0) {\n this.auto_append_row();\n return true;\n }\n return false;\n },\n\n});\n","import registry from \"@patternslib/patternslib/src/core/registry\";\nimport \"./js/datagridfield.pattern\";\n\nregistry.init();\n"],"names":["logging","setLevel","getLogger","Base","extend","name","trigger","parser","init","this","el","$el","el_body","querySelector","auto_append","dataset","autoAppend","toLowerCase","_defineHandler","getVisibleRows","forEach","row","initRowUI","ensureMinimumRows","updateOrderIndex","initAutoAppendHandler","dispatchEvent","Event","bubbles","cancelable","handler_auto_append","e","stopPropagation","target","closest","auto_append_row","bind","handler_auto_append_input","currentTarget","classList","remove","oldIndex","index","removeEventListener","querySelectorAll","addEventListener","preventDefault","insertRow","removeFieldRow","moveRowUp","moveRowDown","get_row_buttons","add","delete","up","down","setUIState","rows","cnt","length","buttons","disabled","before_aa_buttons","getRows","getLastRow","getLastVisibleRow","result","countRows","count","indexOf","last_row","new_row","reindexRow","ref_row","before","newtr","createNewRow","$newtr","$","insertBefore","insertAfter","Registry","scan","template_row","Error","document","createElement","innerHTML","outerHTML","find","attr","i","cls","replace","moveRow","moveRowToTop","moveRowToBottom","insert_after","each","_row","direction","nextRow","idx","validrows","shiftRow","parseInt","bottom","top","new_index","name_prefix","id_prefix","old_index","replaceIndex","prefix","val","getAttribute","pattern","RegExp","setAttribute","value","getParentRow","node","parent","filteredRows","registry"],"sourceRoot":""} \ No newline at end of file diff --git a/src/collective/z3cform/datagridfield/static/chunks/245.26f6a815b7b177fc847b.min.js b/src/collective/z3cform/datagridfield/static/chunks/245.68c1fea4b716b78c19a5.min.js similarity index 60% rename from src/collective/z3cform/datagridfield/static/chunks/245.26f6a815b7b177fc847b.min.js rename to src/collective/z3cform/datagridfield/static/chunks/245.68c1fea4b716b78c19a5.min.js index 153c249..f00fd73 100644 --- a/src/collective/z3cform/datagridfield/static/chunks/245.26f6a815b7b177fc847b.min.js +++ b/src/collective/z3cform/datagridfield/static/chunks/245.68c1fea4b716b78c19a5.min.js @@ -1,2 +1,2 @@ -"use strict";(self.webpackChunkcollective_z3cform_datagridfield=self.webpackChunkcollective_z3cform_datagridfield||[]).push([[245],{245:(e,t,i)=>{var d=i(288),n=(i(452),i(22)),o=i.n(n),a=i(553),r=i(505);r.A.setLevel("INFO");r.A.getLogger("datagridfield"),a.A.extend({name:"datagridfield",trigger:".pat-datagridfield",parser:"mockup",init:function(){i.e(267).then(i.bind(i,267)),this.el=this.$el[0],this.el_body=this.el.querySelector(".datagridwidget-body"),this.auto_append="false"!==(this.el.dataset.autoAppend||"true").toLowerCase(),this._defineHandler(),this.getVisibleRows().forEach((function(e){this.initRowUI(e)}),this),this.ensureMinimumRows()||this.updateOrderIndex(),this.initAutoAppendHandler(),this.el.dispatchEvent(new Event("afterdatagridfieldinit",{bubbles:!0,cancelable:!0}))},_defineHandler:function(){this.handler_auto_append=function(e){e&&e.stopPropagation(),e&&!e.target.closest(".datagridwidget-cell")||this.auto_append_row()}.bind(this),this.handler_auto_append_input=function(e){var t=e.currentTarget;t.classList.remove("auto-append"),t.dataset.oldIndex=t.dataset.index,delete t.dataset.index,this.updateOrderIndex(),t.removeEventListener("input",this.handler_auto_append_input)}.bind(this)},initRowUI:function(e){e.querySelectorAll(".dgf--row-add").forEach((function(t){t.addEventListener("click",function(t){t.preventDefault(),this.insertRow(e),this.updateOrderIndex()}.bind(this))}),this),e.querySelectorAll(".dgf--row-delete").forEach((function(t){t.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation(),this.removeFieldRow(e)}.bind(this))}),this),e.querySelectorAll(".dgf--row-moveup").forEach((function(t){t.addEventListener("click",function(t){t.preventDefault(),this.moveRowUp(e)}.bind(this))}),this),e.querySelectorAll(".dgf--row-movedown").forEach((function(t){t.addEventListener("click",function(t){t.preventDefault(),this.moveRowDown(e)}.bind(this))}),this)},get_row_buttons:function(e){return{add:e.querySelector(".dgf--row-add"),delete:e.querySelector(".dgf--row-delete"),up:e.querySelector(".dgf--row-moveup"),down:e.querySelector(".dgf--row-movedown")}},setUIState:function(){for(var e=this.getVisibleRows(),t=0;t0){var n=this.get_row_buttons(e[t-1]);n.down&&(n.down.disabled=!0)}}else 0===t?(d.add&&(d.add.disabled=!1),d.delete&&(d.delete.disabled=!1),d.up&&(d.up.disabled=!0),d.down&&(d.down.disabled=1===e.length)):t===e.length-1?(d.add&&(d.add.disabled=!1),d.delete&&(d.delete.disabled=!1),d.up&&(d.up.disabled=!1),d.down&&(d.down.disabled=!0)):(d.add&&(d.add.disabled=!1),d.delete&&(d.delete.disabled=!1),d.up&&(d.up.disabled=!1),d.down&&(d.down.disabled=!1))}},getRows:function(){return this.el_body.querySelectorAll(".datagridwidget-row")},getVisibleRows:function(){return this.el_body.querySelectorAll(".datagridwidget-row:not([data-index=TT])")},getLastRow:function(){return this.el_body.querySelector(".datagridwidget-row:last-child")},getLastVisibleRow:function(){var e=this.el_body.querySelectorAll(".datagridwidget-row:not([data-index=TT])");return e[e.length-1]},countRows:function(){var e=0;return this.getRows().forEach((function(t){-1===["AA","TT"].indexOf(t.dataset.index)&&e++}),this),e},initAutoAppendHandler:function(){if(this.auto_append){this.getVisibleRows().forEach((function(e){e.removeEventListener("focusout",this.handler_auto_append)}),this);var e=this.getLastVisibleRow();e&&e.addEventListener("focusout",this.handler_auto_append)}},auto_append_row:function(){this.el.dispatchEvent(new Event("beforeaddrowauto")),this.getVisibleRows().forEach((function(e){e.classList.remove("auto-append"),"TT"!==e.dataset.index&&(e.dataset.oldIndex=e.dataset.index,delete e.dataset.index)}));var e=this.getLastVisibleRow()||this.getLastRow(),t=this.insertRow(e);t.classList.add("auto-append"),this.reindexRow(t,"AA"),this.updateOrderIndex(),t.addEventListener("input",this.handler_auto_append_input),this.el.dispatchEvent(new Event("afteraddrowauto"))},insertRow:function(e,t){var i=this.createNewRow(),n=o()(i);return this.$el.trigger("beforeaddrow",[this.$el,n]),t?n.insertBefore(e):n.insertAfter(e),this.initRowUI(i),d.A.scan(n),this.initAutoAppendHandler(),this.$el.trigger("afteraddrow",[this.$el,n]),i},createNewRow:function(){var e=this.el_body.querySelector("[data-index=TT]");if(!e)throw new Error("Could not locate empty template row in DGF");var t=document.createElement("table");return t.innerHTML=e.outerHTML,(t=t.querySelector("tr")).dataset.oldIndex=t.dataset.index,delete t.dataset.index,t.classList.remove("datagridwidget-empty-row"),o()(t).find('*[class^="dgw-disabled-pat-"]').attr("class",(function(e,t){return t.replace(/dgw\-disabled-pat-/,"pat-")})),t},removeFieldRow:function(e){o()(e).remove(),this.ensureMinimumRows()||this.updateOrderIndex(),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowDown:function(e){this.moveRow(e,"down"),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowUp:function(e){this.moveRow(e,"up"),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowToTop:function(e){var t=this.getRows();o()(e).insertBefore(t[0]),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowToBottom:function(e){var t=this.getRows(),i=0;o()(t).each((function(e,t){-1===["AA","TT"].indexOf(t.dataset.index)&&(i=e)})),o()(e).insertAfter(t[i]),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRow:function(e,t){var i,d=this.getRows(),n=null;if(o()(d).each((function(t,i){e===i&&(n=t)})),null!==n){var a=this.countRows();n+1==a?"down"==t?this.moveRowToTop(e):(i=d[n-1],this.shiftRow(i,e)):0===n?"up"==t?this.moveRowToBottom(e):(i=d[parseInt(n+1,10)],this.shiftRow(e,i)):"up"==t?(i=d[n-1],this.shiftRow(i,e)):(i=d[parseInt(n+1,10)],this.shiftRow(e,i)),this.$el.trigger("aftermoverow",[this.$el,e])}},shiftRow:function(e,t){o()(t).insertBefore(e)},reindexRow:function(e,t){var i=this.el_body.dataset.name_prefix+".",d=this.el_body.dataset.id_prefix+"-",n=e.dataset.oldIndex||e.dataset.index;function o(e,i,d){var o=e.getAttribute(i);if(o){var a=new RegExp("^"+d+n);e.setAttribute(i,o.replace(a,d+t))}}delete e.dataset.oldIndex,e.dataset.index=t,e.querySelectorAll('[id^="formfield-'+d+'"]').forEach((function(e){o(e,"id","formfield-"+d)}),this),e.querySelectorAll('[name^="'+i+'"]').forEach((function(e){o(e,"name",i)}),this),e.querySelectorAll('[id^="'+d+'"]').forEach((function(e){o(e,"id",d)}),this),e.querySelectorAll('[for^="'+d+'"]').forEach((function(e){o(e,"for",d)}),this),e.querySelectorAll('[href*="#'+d+'"]').forEach((function(e){o(e,"href","#"+d)}),this),e.querySelectorAll('[data-fieldname^="'+i+'"]').forEach((function(e){o(e,"data-fieldname",i)}),this)},updateOrderIndex:function(){var e=0;this.getRows().forEach((function(t){var i=t.dataset.index;["AA","TT"].indexOf(i)>-1?this.reindexRow(t,i):(this.reindexRow(t,e),t.dataset.index=e,e++)}),this);var t=this.el_body.dataset.name_prefix+".";this.el.querySelector('input[name="'+t+'count"]').value=this.countRows(),this.setUIState()},getParentRow:function(e){var t=e.closest(".datagridwidget-row");return t||null},ensureMinimumRows:function(){var e=this.getRows(),t=this.getVisibleRows();return!(!e.length||0!==t.length)&&(this.auto_append_row(),!0)}});d.A.init()}}]); -//# sourceMappingURL=245.26f6a815b7b177fc847b.min.js.map \ No newline at end of file +"use strict";(self.webpackChunkcollective_z3cform_datagridfield=self.webpackChunkcollective_z3cform_datagridfield||[]).push([[245],{245:(e,t,i)=>{var d=i(288),n=(i(452),i(22)),o=i.n(n),a=i(553),r=i(505);r.A.setLevel("INFO");r.A.getLogger("datagridfield"),a.A.extend({name:"datagridfield",trigger:".pat-datagridfield",parser:"mockup",init:function(){i.e(267).then(i.bind(i,267)),this.el=this.$el[0],this.el_body=this.el.querySelector(".datagridwidget-body"),this.auto_append="false"!==(this.el.dataset.autoAppend||"true").toLowerCase(),this._defineHandler(),this.getVisibleRows().forEach((function(e){this.initRowUI(e)}),this),this.ensureMinimumRows()||this.updateOrderIndex(),this.initAutoAppendHandler(),this.el.dispatchEvent(new Event("afterdatagridfieldinit",{bubbles:!0,cancelable:!0}))},_defineHandler:function(){this.handler_auto_append=function(e){e&&e.stopPropagation(),e&&!e.target.closest(".datagridwidget-cell")||this.auto_append_row()}.bind(this),this.handler_auto_append_input=function(e){var t=e.currentTarget;t.classList.remove("auto-append"),t.dataset.oldIndex=t.dataset.index,delete t.dataset.index,this.updateOrderIndex(),t.removeEventListener("input",this.handler_auto_append_input)}.bind(this)},initRowUI:function(e){e.querySelectorAll(".dgf--row-add").forEach((function(t){t.addEventListener("click",function(t){t.preventDefault(),this.insertRow(e),this.updateOrderIndex()}.bind(this))}),this),e.querySelectorAll(".dgf--row-delete").forEach((function(t){t.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation(),this.removeFieldRow(e)}.bind(this))}),this),e.querySelectorAll(".dgf--row-moveup").forEach((function(t){t.addEventListener("click",function(t){t.preventDefault(),this.moveRowUp(e)}.bind(this))}),this),e.querySelectorAll(".dgf--row-movedown").forEach((function(t){t.addEventListener("click",function(t){t.preventDefault(),this.moveRowDown(e)}.bind(this))}),this)},get_row_buttons:function(e){return{add:e.querySelector(".dgf--row-add"),delete:e.querySelector(".dgf--row-delete"),up:e.querySelector(".dgf--row-moveup"),down:e.querySelector(".dgf--row-movedown")}},setUIState:function(){for(var e=this.getVisibleRows(),t=0;t0){var n=this.get_row_buttons(e[t-1]);n.down&&(n.down.disabled=!0)}}else 0===t?(d.add&&(d.add.disabled=!1),d.delete&&(d.delete.disabled=!1),d.up&&(d.up.disabled=!0),d.down&&(d.down.disabled=1===e.length)):t===e.length-1?(d.add&&(d.add.disabled=!1),d.delete&&(d.delete.disabled=!1),d.up&&(d.up.disabled=!1),d.down&&(d.down.disabled=!0)):(d.add&&(d.add.disabled=!1),d.delete&&(d.delete.disabled=!1),d.up&&(d.up.disabled=!1),d.down&&(d.down.disabled=!1))}},getRows:function(){return this.el_body.querySelectorAll(".datagridwidget-row")},getVisibleRows:function(){return this.el_body.querySelectorAll(".datagridwidget-row:not([data-index=TT])")},getLastRow:function(){return this.el_body.querySelector(".datagridwidget-row:last-child")},getLastVisibleRow:function(){var e=this.el_body.querySelectorAll(".datagridwidget-row:not([data-index=TT])");return e[e.length-1]},countRows:function(){var e=0;return this.getRows().forEach((function(t){-1===["AA","TT"].indexOf(t.dataset.index)&&e++}),this),e},initAutoAppendHandler:function(){if(this.auto_append){this.getVisibleRows().forEach((function(e){e.removeEventListener("focusout",this.handler_auto_append)}),this);var e=this.getLastVisibleRow();e&&e.addEventListener("focusout",this.handler_auto_append)}},auto_append_row:function(){this.el.dispatchEvent(new Event("beforeaddrowauto")),this.getVisibleRows().forEach((function(e){e.classList.remove("auto-append"),"TT"!==e.dataset.index&&(e.dataset.oldIndex=e.dataset.index,delete e.dataset.index)}));var e=this.getLastVisibleRow()||this.getLastRow(),t=this.insertRow(e);t.classList.add("auto-append"),this.reindexRow(t,"AA"),this.updateOrderIndex(),t.addEventListener("input",this.handler_auto_append_input),this.el.dispatchEvent(new Event("afteraddrowauto"))},insertRow:function(e,t){var i=this.createNewRow(),n=o()(i);return this.$el.trigger("beforeaddrow",[this.$el,n]),t?n.insertBefore(e):n.insertAfter(e),this.initRowUI(i),d.A.scan(n),this.initAutoAppendHandler(),this.$el.trigger("afteraddrow",[this.$el,n]),i},createNewRow:function(){var e=this.el_body.querySelector("[data-index=TT]");if(!e)throw new Error("Could not locate empty template row in DGF");var t=document.createElement("table");t.innerHTML=e.outerHTML,(t=t.querySelector("tr")).dataset.oldIndex=t.dataset.index,delete t.dataset.index,t.classList.remove("datagridwidget-empty-row");o()(t);const i="dgw-disabled-pat-";return t.querySelectorAll(`[class*="${i}"]`).forEach((e=>{e.classList.forEach((t=>{e.classList.replace(t,t.replace(i,"pat-"))}))})),t},removeFieldRow:function(e){o()(e).remove(),this.ensureMinimumRows()||this.updateOrderIndex(),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowDown:function(e){this.moveRow(e,"down"),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowUp:function(e){this.moveRow(e,"up"),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowToTop:function(e){var t=this.getRows();o()(e).insertBefore(t[0]),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowToBottom:function(e){var t=this.getRows(),i=0;o()(t).each((function(e,t){-1===["AA","TT"].indexOf(t.dataset.index)&&(i=e)})),o()(e).insertAfter(t[i]),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRow:function(e,t){var i,d=this.getRows(),n=null;if(o()(d).each((function(t,i){e===i&&(n=t)})),null!==n){var a=this.countRows();n+1==a?"down"==t?this.moveRowToTop(e):(i=d[n-1],this.shiftRow(i,e)):0===n?"up"==t?this.moveRowToBottom(e):(i=d[parseInt(n+1,10)],this.shiftRow(e,i)):"up"==t?(i=d[n-1],this.shiftRow(i,e)):(i=d[parseInt(n+1,10)],this.shiftRow(e,i)),this.$el.trigger("aftermoverow",[this.$el,e])}},shiftRow:function(e,t){o()(t).insertBefore(e)},reindexRow:function(e,t){var i=this.el_body.dataset.name_prefix+".",d=this.el_body.dataset.id_prefix+"-",n=e.dataset.oldIndex||e.dataset.index;function o(e,i,d){var o=e.getAttribute(i);if(o){var a=new RegExp("^"+d+n);e.setAttribute(i,o.replace(a,d+t))}}delete e.dataset.oldIndex,e.dataset.index=t,e.querySelectorAll('[id^="formfield-'+d+'"]').forEach((function(e){o(e,"id","formfield-"+d)}),this),e.querySelectorAll('[name^="'+i+'"]').forEach((function(e){o(e,"name",i)}),this),e.querySelectorAll('[id^="'+d+'"]').forEach((function(e){o(e,"id",d)}),this),e.querySelectorAll('[for^="'+d+'"]').forEach((function(e){o(e,"for",d)}),this),e.querySelectorAll('[href*="#'+d+'"]').forEach((function(e){o(e,"href","#"+d)}),this),e.querySelectorAll('[data-fieldname^="'+i+'"]').forEach((function(e){o(e,"data-fieldname",i)}),this)},updateOrderIndex:function(){var e=0;this.getRows().forEach((function(t){var i=t.dataset.index;["AA","TT"].indexOf(i)>-1?this.reindexRow(t,i):(this.reindexRow(t,e),t.dataset.index=e,e++)}),this);var t=this.el_body.dataset.name_prefix+".";this.el.querySelector('input[name="'+t+'count"]').value=this.countRows(),this.setUIState()},getParentRow:function(e){var t=e.closest(".datagridwidget-row");return t||null},ensureMinimumRows:function(){var e=this.getRows(),t=this.getVisibleRows();return!(!e.length||0!==t.length)&&(this.auto_append_row(),!0)}});d.A.init()}}]); +//# sourceMappingURL=245.68c1fea4b716b78c19a5.min.js.map \ No newline at end of file diff --git a/src/collective/z3cform/datagridfield/static/chunks/245.68c1fea4b716b78c19a5.min.js.map b/src/collective/z3cform/datagridfield/static/chunks/245.68c1fea4b716b78c19a5.min.js.map new file mode 100644 index 0000000..2a0eb33 --- /dev/null +++ b/src/collective/z3cform/datagridfield/static/chunks/245.68c1fea4b716b78c19a5.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"chunks/245.68c1fea4b716b78c19a5.min.js","mappings":"2MAOAA,EAAAA,EAAQC,SAAS,QACLD,EAAAA,EAAQE,UAAU,iBAGfC,EAAAA,EAAKC,OAAO,CACvBC,KAAM,gBACNC,QAAS,qBACTC,OAAQ,SAERC,KAAM,WACF,6BAKAC,KAAKC,GAAKD,KAAKE,IAAI,GACnBF,KAAKG,QAAUH,KAAKC,GAAGG,cAAc,wBAErCJ,KAAKK,YAAuE,WAAxDL,KAAKC,GAAGK,QAAQC,YAAc,QAAQC,cAE1DR,KAAKS,iBAGLT,KAAKU,iBAAiBC,SAAQ,SAAUC,GACpCZ,KAAKa,UAAUD,EACnB,GAAGZ,MAEEA,KAAKc,qBAENd,KAAKe,mBAETf,KAAKgB,wBAELhB,KAAKC,GAAGgB,cACJ,IAAIC,MAAM,yBAA0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G,KAAK0D,YAEtB1D,KAAK+C,YACT,EAEAgE,aAAc,SAAUC,GACpB,IAAIC,EAASD,EAAKvF,QAAQ,uBAC1B,OAAIwF,GAGG,IACX,EAEAnG,kBAAmB,WA0Bf,IAAIkC,EAAOhD,KAAKsD,UACZ4D,EAAelH,KAAKU,iBAGxB,SAAIsC,EAAKE,QAAkC,IAAxBgE,EAAahE,UAC5BlD,KAAK0B,mBACE,EAGf,IClkBJyF,EAAAA,EAASpH,M","sources":["webpack://collective-z3cform-datagridfield/./resources/js/datagridfield.pattern.js","webpack://collective-z3cform-datagridfield/./resources/datagridfield-config.js"],"sourcesContent":["// Layout Mosaic pattern.\nimport \"regenerator-runtime/runtime\"; // needed for ``await`` support\nimport $ from \"jquery\";\nimport Base from \"@patternslib/patternslib/src/core/base\";\nimport Registry from \"@patternslib/patternslib/src/core/registry\";\nimport logging from \"@patternslib/patternslib/src/core/logging\";\n\nlogging.setLevel(\"INFO\");\nconst log = logging.getLogger(\"datagridfield\");\n\n\nexport default Base.extend({\n name: \"datagridfield\",\n trigger: \".pat-datagridfield\",\n parser: \"mockup\",\n\n init: function () {\n import(\"../scss/datagridfield.scss\");\n\n // - Make sure, at least one empty row is always shown.\n // - Auto append a new row when editing the last row.\n\n this.el = this.$el[0];\n this.el_body = this.el.querySelector(\".datagridwidget-body\");\n\n this.auto_append = (this.el.dataset.autoAppend || \"true\").toLowerCase() !== \"false\"; // prettier-ignore\n\n this._defineHandler();\n\n // Before ensureMinimumRows, as creating a row initializes row ui again.\n this.getVisibleRows().forEach(function (row) {\n this.initRowUI(row);\n }, this);\n\n if (!this.ensureMinimumRows()) {\n // If ensureMinimumRows returned true, it already did the update.\n this.updateOrderIndex();\n }\n this.initAutoAppendHandler();\n\n this.el.dispatchEvent(\n new Event(\"afterdatagridfieldinit\", {\n bubbles: true,\n cancelable: true,\n })\n );\n },\n\n _defineHandler: function () {\n // Store event handler which also has to be removed, so we can detach it.\n // See: https://stackoverflow.com/a/10444156/1337474 , also comment about \"bind\"\n // using ``bind`` will change the function signature too.\n\n this.handler_auto_append = function (e) {\n if (e) {\n e.stopPropagation();\n }\n // Also allow direct call without event.\n if (e && !e.target.closest(\".datagridwidget-cell\")) {\n return;\n }\n this.auto_append_row();\n }.bind(this);\n\n this.handler_auto_append_input = function (e) {\n var row = e.currentTarget;\n row.classList.remove(\"auto-append\");\n row.dataset.oldIndex = row.dataset.index; // store for replacing.\n delete row.dataset.index; // remove \"AA\" index\n this.updateOrderIndex();\n row.removeEventListener(\n \"input\",\n this.handler_auto_append_input\n );\n }.bind(this);\n },\n\n initRowUI: function (row) {\n row.querySelectorAll(\".dgf--row-add\").forEach(function (el) {\n el.addEventListener(\n \"click\",\n function (e) {\n e.preventDefault();\n this.insertRow(row);\n this.updateOrderIndex();\n }.bind(this)\n );\n }, this);\n\n row.querySelectorAll(\".dgf--row-delete\").forEach(function (el) {\n el.addEventListener(\n \"click\",\n function (e) {\n e.preventDefault();\n e.stopPropagation();\n this.removeFieldRow(row);\n }.bind(this)\n );\n }, this);\n\n row.querySelectorAll(\".dgf--row-moveup\").forEach(function (el) {\n el.addEventListener(\n \"click\",\n function (e) {\n e.preventDefault();\n this.moveRowUp(row);\n }.bind(this)\n );\n }, this);\n\n row.querySelectorAll(\".dgf--row-movedown\").forEach(function (el) {\n el.addEventListener(\n \"click\",\n function (e) {\n e.preventDefault();\n this.moveRowDown(row);\n }.bind(this)\n );\n }, this);\n },\n\n get_row_buttons: function (row) {\n return {\n add: row.querySelector(\".dgf--row-add\"),\n delete: row.querySelector(\".dgf--row-delete\"),\n up: row.querySelector(\".dgf--row-moveup\"),\n down: row.querySelector(\".dgf--row-movedown\"),\n };\n },\n\n setUIState: function () {\n var rows = this.getVisibleRows();\n for (var cnt = 0; cnt < rows.length; cnt++) {\n var row = rows[cnt];\n var buttons = this.get_row_buttons(row);\n\n if (this.auto_append === true && row.dataset.index === \"AA\") {\n // Special case AA\n\n if (buttons.add) {\n buttons.add.disabled = true;\n }\n if (buttons.delete) {\n buttons.delete.disabled = true;\n }\n if (buttons.up) {\n buttons.up.disabled = true;\n }\n if (buttons.down) {\n buttons.down.disabled = true;\n }\n if (cnt > 0) {\n // Set the previous buttons also, if available.\n var before_aa_buttons = this.get_row_buttons(\n rows[cnt - 1]\n );\n if (before_aa_buttons.down) {\n before_aa_buttons.down.disabled = true;\n }\n }\n } else if (cnt === 0) {\n // First row\n\n if (buttons.add) {\n buttons.add.disabled = false;\n }\n if (buttons.delete) {\n buttons.delete.disabled = false;\n }\n if (buttons.up) {\n buttons.up.disabled = true;\n }\n if (buttons.down) {\n buttons.down.disabled = rows.length === 1; // disable if 1 row.\n }\n } else if (cnt === rows.length - 1) {\n // Last button - if no AA buttons.\n // Also, if this is reached, it's not the only row.\n\n if (buttons.add) {\n buttons.add.disabled = false;\n }\n if (buttons.delete) {\n buttons.delete.disabled = false;\n }\n if (buttons.up) {\n buttons.up.disabled = false;\n }\n if (buttons.down) {\n buttons.down.disabled = true;\n }\n } else {\n // Normal in-between case.\n\n if (buttons.add) {\n buttons.add.disabled = false;\n }\n if (buttons.delete) {\n buttons.delete.disabled = false;\n }\n if (buttons.up) {\n buttons.up.disabled = false;\n }\n if (buttons.down) {\n buttons.down.disabled = false;\n }\n }\n }\n },\n\n getRows: function () {\n // Return primary nodes with class of datagridwidget-row, they can be any tag: tr, div, etc.\n return this.el_body.querySelectorAll(\".datagridwidget-row\");\n },\n\n getVisibleRows: function () {\n return this.el_body.querySelectorAll(\n \".datagridwidget-row:not([data-index=TT])\"\n );\n },\n\n getLastRow: function () {\n return this.el_body.querySelector(\".datagridwidget-row:last-child\");\n },\n\n getLastVisibleRow: function () {\n var result = this.el_body.querySelectorAll(\n \".datagridwidget-row:not([data-index=TT])\"\n );\n return result[result.length - 1];\n },\n\n countRows: function () {\n var count = 0;\n this.getRows().forEach(function (row) {\n // do not include the TT and the AA rows in the count\n if ([\"AA\", \"TT\"].indexOf(row.dataset.index) === -1) {\n count++;\n }\n }, this);\n return count;\n },\n\n initAutoAppendHandler: function () {\n if (!this.auto_append) {\n return;\n }\n\n this.getVisibleRows().forEach(function (row) {\n row.removeEventListener(\"focusout\", this.handler_auto_append);\n }, this);\n\n var last_row = this.getLastVisibleRow();\n if (last_row) {\n last_row.addEventListener(\"focusout\", this.handler_auto_append);\n }\n },\n\n auto_append_row: function () {\n this.el.dispatchEvent(new Event(\"beforeaddrowauto\"));\n this.getVisibleRows().forEach(function (row) {\n row.classList.remove(\"auto-append\");\n if (row.dataset.index !== \"TT\") {\n // actually, getVisibleRows should only return non-\"TT\"\n // rows, but to be clear here...\n // delete the index, we're setting it in updateOrderIndex again.\n row.dataset.oldIndex = row.dataset.index; // store for replacing.\n delete row.dataset.index;\n }\n });\n var last_row = this.getLastVisibleRow() || this.getLastRow();\n var new_row = this.insertRow(last_row);\n new_row.classList.add(\"auto-append\");\n this.reindexRow(new_row, \"AA\");\n this.updateOrderIndex();\n new_row.addEventListener(\"input\", this.handler_auto_append_input);\n this.el.dispatchEvent(new Event(\"afteraddrowauto\"));\n },\n\n insertRow: function (ref_row, before) {\n /**\n * Add a new row when changing the last row\n *\n * @param {DOM node} ref_row insert row after this one.\n */\n\n // Create a new row\n var newtr = this.createNewRow();\n var $newtr = $(newtr);\n\n /* Put new row to DOM tree after our current row. Do this before\n * reindexing to ensure that any Javascript we insert that depends on\n * DOM element IDs (such as plone.formwidget.autocomplete) will\n * pick up this row before any IDs get changed. At this point,\n * we techinically have duplicate TT IDs in our document\n * (one for this new row, one for the hidden row), but jQuery\n * selectors will pick up elements in this new row first.\n */\n\n this.$el.trigger(\"beforeaddrow\", [this.$el, $newtr]);\n\n if (before) {\n $newtr.insertBefore(ref_row);\n } else {\n $newtr.insertAfter(ref_row);\n }\n\n this.initRowUI(newtr);\n Registry.scan($newtr);\n\n this.initAutoAppendHandler();\n\n this.$el.trigger(\"afteraddrow\", [this.$el, $newtr]);\n\n return newtr;\n },\n\n createNewRow: function () {\n /**\n * Creates a new row.\n *\n * The row is not inserted to the table, but is returned.\n */\n\n // hidden template row\n var template_row = this.el_body.querySelector(\"[data-index=TT]\");\n if (!template_row) {\n throw new Error(\"Could not locate empty template row in DGF\");\n }\n\n var new_row = document.createElement(\"table\");\n new_row.innerHTML = template_row.outerHTML;\n new_row = new_row.querySelector(\"tr\");\n\n new_row.dataset.oldIndex = new_row.dataset.index; // store for replacing.\n delete new_row.dataset.index; // fresh row.\n new_row.classList.remove(\"datagridwidget-empty-row\");\n\n var $new_row = $(new_row);\n // enable patternslib\n const disabled_prefix = \"dgw-disabled-pat-\";\n new_row.querySelectorAll(`[class*=\"${disabled_prefix}\"]`).forEach(el => {\n el.classList.forEach(cls => {\n el.classList.replace(cls, cls.replace(disabled_prefix, \"pat-\"));\n });\n });\n return new_row;\n },\n\n removeFieldRow: function (row) {\n /* Remove the row in which the given node is found */\n $(row).remove();\n\n if (!this.ensureMinimumRows()) {\n // If ensureMinimumRows returned true, it already did the update.\n this.updateOrderIndex();\n }\n this.updateOrderIndex();\n this.initAutoAppendHandler();\n },\n\n moveRowDown: function (row) {\n this.moveRow(row, \"down\");\n this.updateOrderIndex();\n this.initAutoAppendHandler();\n },\n\n moveRowUp: function (row) {\n this.moveRow(row, \"up\");\n this.updateOrderIndex();\n this.initAutoAppendHandler();\n },\n\n moveRowToTop: function (row) {\n var rows = this.getRows();\n $(row).insertBefore(rows[0]);\n this.updateOrderIndex();\n this.initAutoAppendHandler();\n },\n\n moveRowToBottom: function (row) {\n var rows = this.getRows();\n\n // make sure we insert the directly above any auto appended rows\n var insert_after = 0;\n $(rows).each(function (i, _row) {\n if ([\"AA\", \"TT\"].indexOf(_row.dataset.index) === -1) {\n insert_after = i;\n }\n });\n $(row).insertAfter(rows[insert_after]);\n this.updateOrderIndex();\n this.initAutoAppendHandler();\n },\n\n moveRow: function (row, direction) {\n /* Move the given row down one */\n var nextRow;\n var rows = this.getRows();\n var idx = null;\n\n // We can't use nextSibling because of blank text nodes in some browsers\n // Need to find the index of the row\n $(rows).each(function (i, _row) {\n if (row === _row) {\n idx = i;\n }\n });\n\n // Abort if the current row wasn't found\n if (idx === null) {\n return;\n }\n\n // The up and down should cycle through the rows, excluding the auto-append and\n // empty-row rows.\n var validrows = this.countRows();\n\n if (idx + 1 == validrows) {\n if (direction == \"down\") {\n this.moveRowToTop(row);\n } else {\n nextRow = rows[idx - 1];\n this.shiftRow(nextRow, row);\n }\n } else if (idx === 0) {\n if (direction == \"up\") {\n this.moveRowToBottom(row);\n } else {\n nextRow = rows[parseInt(idx + 1, 10)];\n this.shiftRow(row, nextRow);\n }\n } else {\n if (direction == \"up\") {\n nextRow = rows[idx - 1];\n this.shiftRow(nextRow, row);\n } else {\n nextRow = rows[parseInt(idx + 1, 10)];\n this.shiftRow(row, nextRow);\n }\n }\n this.$el.trigger(\"aftermoverow\", [this.$el, row]);\n },\n\n shiftRow: function (bottom, top) {\n /* Put node top before node bottom */\n $(top).insertBefore(bottom);\n },\n\n reindexRow: function (row, new_index) {\n /**\n * Fixup all attributes on all child elements that contain\n * the row index. The following attributes are scanned:\n * - name\n * - id\n * - for\n * - href\n * - data-fieldname\n *\n * On the server side, the DGF logic will rebuild rows based\n * on this information.\n *\n * If indexing for some reasons fails you'll get double\n * input values and Zope converts inputs to list, failing\n * in funny ways.\n *\n * @param {DOM} row\n * @param {Number} new_index\n */\n\n var name_prefix = this.el_body.dataset.name_prefix + \".\";\n var id_prefix = this.el_body.dataset.id_prefix + \"-\";\n var old_index = row.dataset.oldIndex || row.dataset.index;\n delete row.dataset.oldIndex;\n\n function replaceIndex(el, attr, prefix) {\n var val = el.getAttribute(attr);\n if (val) {\n var pattern = new RegExp(\"^\" + prefix + old_index);\n el.setAttribute(\n attr,\n val.replace(pattern, prefix + new_index)\n );\n }\n }\n\n row.dataset.index = new_index; // update index data\n\n row.querySelectorAll('[id^=\"formfield-' + id_prefix + '\"]').forEach(function (el) {\n replaceIndex(el, \"id\", \"formfield-\" + id_prefix);\n }, this); // prettier-ignore\n row.querySelectorAll('[name^=\"' + name_prefix + '\"]').forEach(function (el) {\n replaceIndex(el, \"name\", name_prefix);\n }, this); // prettier-ignore\n row.querySelectorAll('[id^=\"' + id_prefix + '\"]').forEach(function (el) {\n replaceIndex(el, \"id\", id_prefix);\n }, this); // prettier-ignore\n row.querySelectorAll('[for^=\"' + id_prefix + '\"]').forEach(function (el) {\n replaceIndex(el, \"for\", id_prefix);\n }, this); // prettier-ignore\n row.querySelectorAll('[href*=\"#' + id_prefix + '\"]').forEach(function (el) {\n replaceIndex(el, \"href\", \"#\" + id_prefix);\n }, this); // prettier-ignore\n row.querySelectorAll('[data-fieldname^=\"' + name_prefix + '\"]').forEach(function (el) {\n replaceIndex(el, \"data-fieldname\", name_prefix);\n }, this); // prettier-ignore\n },\n\n updateOrderIndex: function () {\n /**\n * Update all row indexes on a DGF table.\n *\n * Each and input widget has recalculated row index number in its name,\n * so that the server can then parsit the submitted data in the correct order.\n */\n\n var cnt = 0;\n var rows = this.getRows();\n rows.forEach(function (row) {\n var index = row.dataset.index;\n if ([\"AA\", \"TT\"].indexOf(index) > -1) {\n this.reindexRow(row, index);\n return;\n }\n this.reindexRow(row, cnt);\n row.dataset.index = cnt;\n cnt++; // we start counting with \"0\"\n }, this);\n\n var name_prefix = this.el_body.dataset.name_prefix + \".\";\n var count_el = this.el.querySelector(\n 'input[name=\"' + name_prefix + 'count\"]'\n );\n count_el.value = this.countRows();\n\n this.setUIState();\n },\n\n getParentRow: function (node) {\n var parent = node.closest(\".datagridwidget-row\");\n if (parent) {\n return parent;\n }\n return null;\n },\n\n ensureMinimumRows: function () {\n /**\n * Make sure there is at least one visible row available in DGF\n * to edit in all the time.\n *\n * We need a lot of special logic for the case where\n * we have empty datagridfield and need to have one OPTIONAL\n * row present there for the editing when the user opens\n * the form for the first time.\n *\n * There are cases where one doesn't want to have the count of DGF\n * rows to go down to zero. Otherwise there no insert handle left\n * on the edit mode and the user cannot add any more rows.\n *\n * One should case is when\n *\n * - DGF is empty on new form\n *\n * - Auto append is set to false (initial row is not visible)\n *\n * We fix this situation by checking the available rows\n * and generating one empty AA row if needed.\n *\n * ... or simply when the user removes all the rows\n */\n\n var rows = this.getRows();\n var filteredRows = this.getVisibleRows();\n\n // Rows = 0 -> make one AA row available\n if (rows.length && filteredRows.length === 0) {\n this.auto_append_row();\n return true;\n }\n return false;\n },\n\n});\n","import registry from \"@patternslib/patternslib/src/core/registry\";\nimport \"./js/datagridfield.pattern\";\n\nregistry.init();\n"],"names":["logging","setLevel","getLogger","Base","extend","name","trigger","parser","init","this","el","$el","el_body","querySelector","auto_append","dataset","autoAppend","toLowerCase","_defineHandler","getVisibleRows","forEach","row","initRowUI","ensureMinimumRows","updateOrderIndex","initAutoAppendHandler","dispatchEvent","Event","bubbles","cancelable","handler_auto_append","e","stopPropagation","target","closest","auto_append_row","bind","handler_auto_append_input","currentTarget","classList","remove","oldIndex","index","removeEventListener","querySelectorAll","addEventListener","preventDefault","insertRow","removeFieldRow","moveRowUp","moveRowDown","get_row_buttons","add","delete","up","down","setUIState","rows","cnt","length","buttons","disabled","before_aa_buttons","getRows","getLastRow","getLastVisibleRow","result","countRows","count","indexOf","last_row","new_row","reindexRow","ref_row","before","newtr","createNewRow","$newtr","$","insertBefore","insertAfter","Registry","scan","template_row","Error","document","createElement","innerHTML","outerHTML","disabled_prefix","cls","replace","moveRow","moveRowToTop","moveRowToBottom","insert_after","each","i","_row","direction","nextRow","idx","validrows","shiftRow","parseInt","bottom","top","new_index","name_prefix","id_prefix","old_index","replaceIndex","attr","prefix","val","getAttribute","pattern","RegExp","setAttribute","value","getParentRow","node","parent","filteredRows","registry"],"sourceRoot":""} \ No newline at end of file diff --git a/src/collective/z3cform/datagridfield/static/datagridfield-remote.min.js b/src/collective/z3cform/datagridfield/static/datagridfield-remote.min.js index c5a5ef2..e6166f0 100644 --- a/src/collective/z3cform/datagridfield/static/datagridfield-remote.min.js +++ b/src/collective/z3cform/datagridfield/static/datagridfield-remote.min.js @@ -1,2 +1,2 @@ -var __patternslib_mf__datagridfield;(()=>{"use strict";var e,r,t,n,o,a,i,l,f,u,d,s,c,p,h,v,g,m,b,y={317:(e,r,t)=>{var n={"./main":()=>Promise.all([t.e(644),t.e(245)]).then((()=>()=>t(245)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},w={};function S(e){var r=w[e];if(void 0!==r)return r.exports;var t=w[e]={id:e,exports:{}};return y[e].call(t.exports,t,t.exports,S),t.exports}S.m=y,S.c=w,S.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return S.d(r,{a:r}),r},S.d=(e,r)=>{for(var t in r)S.o(r,t)&&!S.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},S.f={},S.e=e=>Promise.all(Object.keys(S.f).reduce(((r,t)=>(S.f[t](e,r),r)),[])),S.u=e=>"chunks/"+e+"."+{245:"26f6a815b7b177fc847b",267:"b05f3df573b06c619bb5",644:"362cfa62704842136084",692:"283a97cd832931f6b9a9"}[e]+".min.js",S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="collective-z3cform-datagridfield:",S.l=(t,n,o,a)=>{if(e[t])e[t].push(n);else{var i,l;if(void 0!==o)for(var f=document.getElementsByTagName("script"),u=0;u{i.onerror=i.onload=null,clearTimeout(c);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},c=setTimeout(s.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=s.bind(null,i.onerror),i.onload=s.bind(null,i.onload),l&&document.head.appendChild(i)}},S.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{S.S={};var e={},r={};S.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];S.o(S.S,t)||(S.S[t]={});var a=S.S[t],i="collective-z3cform-datagridfield",l=[];if("default"===t)((e,r,t,n)=>{var o=a[e]=a[e]||{},l=o[r];(!l||!l.loaded&&(!n!=!l.eager?n:i>l.from))&&(o[r]={get:t,from:i,eager:!!n})})("jquery","3.7.1",(()=>S.e(692).then((()=>()=>S(692)))));return l.length?e[t]=Promise.all(l).then((()=>e[t]=1)):e[t]=1}}})(),(()=>{var e;S.g.importScripts&&(e=S.g.location+"");var r=S.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),S.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n=r.length)return"u"==a;var i=r[n],l=(typeof i)[0];if(a!=l)return"o"==a&&"n"==l||"s"==l||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,a=1;a0?".":"")+(n=2,l);return t}var i=[];for(a=1;a{if(0 in e){r=t(r);var n=e[0],o=n<0;o&&(n=-n-1);for(var i=0,l=1,f=!0;;l++,i++){var u,d,s=l=r.length||"o"==(d=(typeof(u=r[i]))[0]))return!f||("u"==s?l>n&&!o:""==s!=o);if("u"==d){if(!f||"u"!=s)return!1}else if(f)if(s==d)if(l<=n){if(u!=e[l])return!1}else{if(o?u>e[l]:ue&&S.o(e,r),l=e=>(e.loaded=1,e.get()),f=e=>Object.keys(e).reduce(((r,t)=>(e[t].eager&&(r[t]=e[t]),r)),{}),u=(e,r,t)=>{var o=t?f(e[r]):e[r];return Object.keys(o).reduce(((e,r)=>!e||!o[e].loaded&&n(e,r)?r:e),0)},d=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+o(n)+")",s=e=>{throw new Error(e)},c=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},p=(e,r,t)=>t?t():((e,r)=>s("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),h=(e=>function(r,t,n,o,a){var i=S.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,S.S[r],t,!1,o,a)):e(r,S.S[r],t,n,o,a)})(((e,r,t,n,o,f)=>{if(!i(r,t))return p(e,t,f);var s=u(r,t,n);return a(o,s)||c(d(r,t,s,o)),l(r[t][s])})),v={},g={22:()=>h("default","jquery",!1,[4,3,7,1],(()=>S.e(692).then((()=>()=>S(692)))))},m={245:[22]},b={},S.f.consumes=(e,r)=>{S.o(m,e)&&m[e].forEach((e=>{if(S.o(v,e))return r.push(v[e]);if(!b[e]){var t=r=>{v[e]=0,S.m[e]=t=>{delete S.c[e],t.exports=r()}};b[e]=!0;var n=r=>{delete v[e],S.m[e]=t=>{throw delete S.c[e],r}};try{var o=g[e]();o.then?r.push(v[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}}))},(()=>{var e={541:0};S.f.j=(r,t)=>{var n=S.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=S.p+S.u(r),i=new Error;S.l(a,(t=>{if(S.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,i,l]=t,f=0;if(a.some((r=>0!==e[r]))){for(n in i)S.o(i,n)&&(S.m[n]=i[n]);if(l)l(S)}for(r&&r(t);f{"use strict";var e,r,t,n,o,i,a,l,u,f,d,s,c,p,h,v,g,m,b,y={483:(e,r,t)=>{var n={"./main":()=>Promise.all([t.e(644),t.e(245)]).then((()=>()=>t(245)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),i=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>i})}},w={};function S(e){var r=w[e];if(void 0!==r)return r.exports;var t=w[e]={id:e,exports:{}};return y[e].call(t.exports,t,t.exports,S),t.exports}S.m=y,S.c=w,S.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return S.d(r,{a:r}),r},S.d=(e,r)=>{for(var t in r)S.o(r,t)&&!S.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},S.f={},S.e=e=>Promise.all(Object.keys(S.f).reduce(((r,t)=>(S.f[t](e,r),r)),[])),S.u=e=>"chunks/"+e+"."+{245:"68c1fea4b716b78c19a5",267:"b05f3df573b06c619bb5",644:"362cfa62704842136084",692:"283a97cd832931f6b9a9"}[e]+".min.js",S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="collective-z3cform-datagridfield:",S.l=(t,n,o,i)=>{if(e[t])e[t].push(n);else{var a,l;if(void 0!==o)for(var u=document.getElementsByTagName("script"),f=0;f{a.onerror=a.onload=null,clearTimeout(c);var o=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(n))),r)return r(n)},c=setTimeout(s.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=s.bind(null,a.onerror),a.onload=s.bind(null,a.onload),l&&document.head.appendChild(a)}},S.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{S.S={};var e={},r={};S.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];S.o(S.S,t)||(S.S[t]={});var i=S.S[t],a="collective-z3cform-datagridfield",l=[];if("default"===t)((e,r,t,n)=>{var o=i[e]=i[e]||{},l=o[r];(!l||!l.loaded&&(!n!=!l.eager?n:a>l.from))&&(o[r]={get:t,from:a,eager:!!n})})("jquery","3.7.1",(()=>S.e(692).then((()=>()=>S(692)))));return l.length?e[t]=Promise.all(l).then((()=>e[t]=1)):e[t]=1}}})(),(()=>{var e;S.g.importScripts&&(e=S.g.location+"");var r=S.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),S.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n=r.length)return"u"==i;var a=r[n],l=(typeof a)[0];if(i!=l)return"o"==i&&"n"==l||"s"==l||"u"==i;if("o"!=i&&"u"!=i&&o!=a)return o{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,i=1;i0?".":"")+(n=2,l);return t}var a=[];for(i=1;i{if(0 in e){r=t(r);var n=e[0],o=n<0;o&&(n=-n-1);for(var a=0,l=1,u=!0;;l++,a++){var f,d,s=l=r.length||"o"==(d=(typeof(f=r[a]))[0]))return!u||("u"==s?l>n&&!o:""==s!=o);if("u"==d){if(!u||"u"!=s)return!1}else if(u)if(s==d)if(l<=n){if(f!=e[l])return!1}else{if(o?f>e[l]:fe&&S.o(e,r),l=e=>(e.loaded=1,e.get()),u=e=>Object.keys(e).reduce(((r,t)=>(e[t].eager&&(r[t]=e[t]),r)),{}),f=(e,r,t)=>{var o=t?u(e[r]):e[r];return Object.keys(o).reduce(((e,r)=>!e||!o[e].loaded&&n(e,r)?r:e),0)},d=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+o(n)+")",s=e=>{throw new Error(e)},c=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},p=(e,r,t)=>t?t():((e,r)=>s("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),h=(e=>function(r,t,n,o,i){var a=S.I(r);return a&&a.then&&!n?a.then(e.bind(e,r,S.S[r],t,!1,o,i)):e(r,S.S[r],t,n,o,i)})(((e,r,t,n,o,u)=>{if(!a(r,t))return p(e,t,u);var s=f(r,t,n);return i(o,s)||c(d(r,t,s,o)),l(r[t][s])})),v={},g={22:()=>h("default","jquery",!1,[4,3,7,1],(()=>S.e(692).then((()=>()=>S(692)))))},m={245:[22]},b={},S.f.consumes=(e,r)=>{S.o(m,e)&&m[e].forEach((e=>{if(S.o(v,e))return r.push(v[e]);if(!b[e]){var t=r=>{v[e]=0,S.m[e]=t=>{delete S.c[e],t.exports=r()}};b[e]=!0;var n=r=>{delete v[e],S.m[e]=t=>{throw delete S.c[e],r}};try{var o=g[e]();o.then?r.push(v[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}}))},(()=>{var e={541:0};S.f.j=(r,t)=>{var n=S.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var i=S.p+S.u(r),a=new Error;S.l(i,(t=>{if(S.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;a.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,n[1](a)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[i,a,l]=t,u=0;if(i.some((r=>0!==e[r]))){for(n in a)S.o(a,n)&&(S.m[n]=a[n]);if(l)l(S)}for(r&&r(t);u {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","var parseVersion = (str) => {\n\t// see webpack/lib/util/semver.js for original code\n\tvar p=p=>{return p.split(\".\").map((p=>{return+p==p?+p:p}))},n=/^([^-+]+)?(?:-([^+]+))?(?:\\+(.+))?$/.exec(str),r=n[1]?p(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,p(n[2]))),n[3]&&(r.push([]),r.push.apply(r,p(n[3]))),r;\n}\nvar versionLt = (a, b) => {\n\t// see webpack/lib/util/semver.js for original code\n\ta=parseVersion(a),b=parseVersion(b);for(var r=0;;){if(r>=a.length)return r=b.length)return\"u\"==n;var t=b[r],f=(typeof t)[0];if(n!=f)return\"o\"==n&&\"n\"==f||(\"s\"==f||\"u\"==n);if(\"o\"!=n&&\"u\"!=n&&e!=t)return e {\n\t// see webpack/lib/util/semver.js for original code\n\tvar r=range[0],n=\"\";if(1===range.length)return\"*\";if(r+.5){n+=0==r?\">=\":-1==r?\"<\":1==r?\"^\":2==r?\"~\":r>0?\"=\":\"!=\";for(var e=1,a=1;a0?\".\":\"\")+(e=2,t)}return n}var g=[];for(a=1;a {\n\t// see webpack/lib/util/semver.js for original code\n\tif(0 in range){version=parseVersion(version);var e=range[0],r=e<0;r&&(e=-e-1);for(var n=0,i=1,a=!0;;i++,n++){var f,s,g=i=version.length||\"o\"==(s=(typeof(f=version[n]))[0]))return!a||(\"u\"==g?i>e&&!r:\"\"==g!=r);if(\"u\"==s){if(!a||\"u\"!=g)return!1}else if(a)if(g==s)if(i<=e){if(f!=range[i])return!1}else{if(r?f>range[i]:f {\n\treturn scope && __webpack_require__.o(scope, key);\n}\nvar get = (entry) => {\n\tentry.loaded = 1;\n\treturn entry.get()\n};\nvar eagerOnly = (versions) => {\n\treturn Object.keys(versions).reduce((filtered, version) => {\n\t\t\tif (versions[version].eager) {\n\t\t\t\tfiltered[version] = versions[version];\n\t\t\t}\n\t\t\treturn filtered;\n\t}, {});\n};\nvar findLatestVersion = (scope, key, eager) => {\n\tvar versions = eager ? eagerOnly(scope[key]) : scope[key];\n\tvar key = Object.keys(versions).reduce((a, b) => {\n\t\treturn !a || versionLt(a, b) ? b : a;\n\t}, 0);\n\treturn key && versions[key];\n};\nvar findSatisfyingVersion = (scope, key, requiredVersion, eager) => {\n\tvar versions = eager ? eagerOnly(scope[key]) : scope[key];\n\tvar key = Object.keys(versions).reduce((a, b) => {\n\t\tif (!satisfy(requiredVersion, b)) return a;\n\t\treturn !a || versionLt(a, b) ? b : a;\n\t}, 0);\n\treturn key && versions[key]\n};\nvar findSingletonVersionKey = (scope, key, eager) => {\n\tvar versions = eager ? eagerOnly(scope[key]) : scope[key];\n\treturn Object.keys(versions).reduce((a, b) => {\n\t\treturn !a || (!versions[a].loaded && versionLt(a, b)) ? b : a;\n\t}, 0);\n};\nvar getInvalidSingletonVersionMessage = (scope, key, version, requiredVersion) => {\n\treturn \"Unsatisfied version \" + version + \" from \" + (version && scope[key][version].from) + \" of shared singleton module \" + key + \" (required \" + rangeToString(requiredVersion) + \")\"\n};\nvar getInvalidVersionMessage = (scope, scopeName, key, requiredVersion, eager) => {\n\tvar versions = scope[key];\n\treturn \"No satisfying version (\" + rangeToString(requiredVersion) + \")\" + (eager ? \" for eager consumption\" : \"\") + \" of shared module \" + key + \" found in shared scope \" + scopeName + \".\\n\" +\n\t\t\"Available versions: \" + Object.keys(versions).map((key) => {\n\t\treturn key + \" from \" + versions[key].from;\n\t}).join(\", \");\n};\nvar fail = (msg) => {\n\tthrow new Error(msg);\n}\nvar failAsNotExist = (scopeName, key) => {\n\treturn fail(\"Shared module \" + key + \" doesn't exist in shared scope \" + scopeName);\n}\nvar warn = /*#__PURE__*/ (msg) => {\n\tif (typeof console !== \"undefined\" && console.warn) console.warn(msg);\n};\nvar init = (fn) => (function(scopeName, key, eager, c, d) {\n\tvar promise = __webpack_require__.I(scopeName);\n\tif (promise && promise.then && !eager) {\n\t\treturn promise.then(fn.bind(fn, scopeName, __webpack_require__.S[scopeName], key, false, c, d));\n\t}\n\treturn fn(scopeName, __webpack_require__.S[scopeName], key, eager, c, d);\n});\n\nvar useFallback = (scopeName, key, fallback) => {\n\treturn fallback ? fallback() : failAsNotExist(scopeName, key);\n}\nvar load = /*#__PURE__*/ init((scopeName, scope, key, eager, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\treturn get(findLatestVersion(scope, key, eager));\n});\nvar loadVersion = /*#__PURE__*/ init((scopeName, scope, key, eager, requiredVersion, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar satisfyingVersion = findSatisfyingVersion(scope, key, requiredVersion, eager);\n\tif (satisfyingVersion) return get(satisfyingVersion);\n\twarn(getInvalidVersionMessage(scope, scopeName, key, requiredVersion, eager))\n\treturn get(findLatestVersion(scope, key, eager));\n});\nvar loadStrictVersion = /*#__PURE__*/ init((scopeName, scope, key, eager, requiredVersion, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar satisfyingVersion = findSatisfyingVersion(scope, key, requiredVersion, eager);\n\tif (satisfyingVersion) return get(satisfyingVersion);\n\tif (fallback) return fallback();\n\tfail(getInvalidVersionMessage(scope, scopeName, key, requiredVersion, eager));\n});\nvar loadSingleton = /*#__PURE__*/ init((scopeName, scope, key, eager, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar version = findSingletonVersionKey(scope, key, eager);\n\treturn get(scope[key][version]);\n});\nvar loadSingletonVersion = /*#__PURE__*/ init((scopeName, scope, key, eager, requiredVersion, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar version = findSingletonVersionKey(scope, key, eager);\n\tif (!satisfy(requiredVersion, version)) {\n\t\twarn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));\n\t}\n\treturn get(scope[key][version]);\n});\nvar loadStrictSingletonVersion = /*#__PURE__*/ init((scopeName, scope, key, eager, requiredVersion, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar version = findSingletonVersionKey(scope, key, eager);\n\tif (!satisfy(requiredVersion, version)) {\n\t\tfail(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));\n\t}\n\treturn get(scope[key][version]);\n});\nvar installedModules = {};\nvar moduleToHandlerMapping = {\n\t22: () => (loadSingletonVersion(\"default\", \"jquery\", false, [4,3,7,1], () => (__webpack_require__.e(692).then(() => (() => (__webpack_require__(692)))))))\n};\n// no consumes in initial chunks\nvar chunkMapping = {\n\t\"245\": [\n\t\t22\n\t]\n};\nvar startedInstallModules = {};\n__webpack_require__.f.consumes = (chunkId, promises) => {\n\tif(__webpack_require__.o(chunkMapping, chunkId)) {\n\t\tchunkMapping[chunkId].forEach((id) => {\n\t\t\tif(__webpack_require__.o(installedModules, id)) return promises.push(installedModules[id]);\n\t\t\tif(!startedInstallModules[id]) {\n\t\t\tvar onFactory = (factory) => {\n\t\t\t\tinstalledModules[id] = 0;\n\t\t\t\t__webpack_require__.m[id] = (module) => {\n\t\t\t\t\tdelete __webpack_require__.c[id];\n\t\t\t\t\tmodule.exports = factory();\n\t\t\t\t}\n\t\t\t};\n\t\t\tstartedInstallModules[id] = true;\n\t\t\tvar onError = (error) => {\n\t\t\t\tdelete installedModules[id];\n\t\t\t\t__webpack_require__.m[id] = (module) => {\n\t\t\t\t\tdelete __webpack_require__.c[id];\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tvar promise = moduleToHandlerMapping[id]();\n\t\t\t\tif(promise.then) {\n\t\t\t\t\tpromises.push(installedModules[id] = promise.then(onFactory)['catch'](onError));\n\t\t\t\t} else onFactory(promise);\n\t\t\t} catch(e) { onError(e); }\n\t\t\t}\n\t\t});\n\t}\n}","var moduleMap = {\n\t\"./main\": () => {\n\t\treturn Promise.all([__webpack_require__.e(644), __webpack_require__.e(245)]).then(() => (() => ((__webpack_require__(245)))));\n\t}\n};\nvar get = (module, getScope) => {\n\t__webpack_require__.R = getScope;\n\tgetScope = (\n\t\t__webpack_require__.o(moduleMap, module)\n\t\t\t? moduleMap[module]()\n\t\t\t: Promise.resolve().then(() => {\n\t\t\t\tthrow new Error('Module \"' + module + '\" does not exist in container.');\n\t\t\t})\n\t);\n\t__webpack_require__.R = undefined;\n\treturn getScope;\n};\nvar init = (shareScope, initScope) => {\n\tif (!__webpack_require__.S) return;\n\tvar name = \"default\"\n\tvar oldScope = __webpack_require__.S[name];\n\tif(oldScope && oldScope !== shareScope) throw new Error(\"Container initialization failed as it has already been initialized with a different share scope\");\n\t__webpack_require__.S[name] = shareScope;\n\treturn __webpack_require__.I(name, initScope);\n};\n\n// This exports getters to disallow modifications\n__webpack_require__.d(exports, {\n\tget: () => (get),\n\tinit: () => (init)\n});","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// expose the module cache\n__webpack_require__.c = __webpack_module_cache__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"chunks/\" + chunkId + \".\" + {\"245\":\"26f6a815b7b177fc847b\",\"267\":\"b05f3df573b06c619bb5\",\"644\":\"362cfa62704842136084\",\"692\":\"283a97cd832931f6b9a9\"}[chunkId] + \".min.js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.S = {};\nvar initPromises = {};\nvar initTokens = {};\n__webpack_require__.I = (name, initScope) => {\n\tif(!initScope) initScope = [];\n\t// handling circular init calls\n\tvar initToken = initTokens[name];\n\tif(!initToken) initToken = initTokens[name] = {};\n\tif(initScope.indexOf(initToken) >= 0) return;\n\tinitScope.push(initToken);\n\t// only runs once\n\tif(initPromises[name]) return initPromises[name];\n\t// creates a new share scope if needed\n\tif(!__webpack_require__.o(__webpack_require__.S, name)) __webpack_require__.S[name] = {};\n\t// runs all init snippets from all modules reachable\n\tvar scope = __webpack_require__.S[name];\n\tvar warn = (msg) => {\n\t\tif (typeof console !== \"undefined\" && console.warn) console.warn(msg);\n\t};\n\tvar uniqueName = \"collective-z3cform-datagridfield\";\n\tvar register = (name, version, factory, eager) => {\n\t\tvar versions = scope[name] = scope[name] || {};\n\t\tvar activeVersion = versions[version];\n\t\tif(!activeVersion || (!activeVersion.loaded && (!eager != !activeVersion.eager ? eager : uniqueName > activeVersion.from))) versions[version] = { get: factory, from: uniqueName, eager: !!eager };\n\t};\n\tvar initExternal = (id) => {\n\t\tvar handleError = (err) => (warn(\"Initialization of sharing external failed: \" + err));\n\t\ttry {\n\t\t\tvar module = __webpack_require__(id);\n\t\t\tif(!module) return;\n\t\t\tvar initFn = (module) => (module && module.init && module.init(__webpack_require__.S[name], initScope))\n\t\t\tif(module.then) return promises.push(module.then(initFn, handleError));\n\t\t\tvar initResult = initFn(module);\n\t\t\tif(initResult && initResult.then) return promises.push(initResult['catch'](handleError));\n\t\t} catch(err) { handleError(err); }\n\t}\n\tvar promises = [];\n\tswitch(name) {\n\t\tcase \"default\": {\n\t\t\tregister(\"jquery\", \"3.7.1\", () => (__webpack_require__.e(692).then(() => (() => (__webpack_require__(692))))));\n\t\t}\n\t\tbreak;\n\t}\n\tif(!promises.length) return initPromises[name] = 1;\n\treturn initPromises[name] = Promise.all(promises).then(() => (initPromises[name] = 1));\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t541: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkcollective_z3cform_datagridfield\"] = self[\"webpackChunkcollective_z3cform_datagridfield\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// module cache are used so entry inlining is disabled\n// startup\n// Load entry module and return exports\nvar __webpack_exports__ = __webpack_require__(317);\n"],"names":["inProgress","dataWebpackPrefix","parseVersion","versionLt","rangeToString","satisfy","exists","get","eagerOnly","findSingletonVersionKey","getInvalidSingletonVersionMessage","fail","warn","useFallback","loadSingletonVersion","installedModules","moduleToHandlerMapping","chunkMapping","startedInstallModules","moduleMap","Promise","all","__webpack_require__","e","then","module","getScope","R","o","resolve","Error","undefined","init","shareScope","initScope","S","name","oldScope","I","d","exports","__webpack_module_cache__","moduleId","cachedModule","id","__webpack_modules__","call","m","c","n","getter","__esModule","a","definition","key","Object","defineProperty","enumerable","f","chunkId","keys","reduce","promises","u","g","globalThis","this","Function","window","obj","prop","prototype","hasOwnProperty","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","r","Symbol","toStringTag","value","initPromises","initTokens","initToken","indexOf","scope","uniqueName","version","factory","eager","versions","activeVersion","loaded","from","register","scriptUrl","importScripts","location","currentScript","tagName","toUpperCase","test","replace","p","str","split","map","exec","apply","b","t","range","pop","entry","filtered","requiredVersion","msg","console","scopeName","fallback","failAsNotExist","promise","consumes","onFactory","onError","error","installedChunks","j","installedChunkData","reject","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"datagridfield-remote.min.js","mappings":"2DAAIA,EACAC,ECDAC,EAIAC,EAIAC,EAIAC,EAIAC,EAGAC,EAIAC,EAuBAC,EAMAC,EAUAC,EAMAC,EAWAC,EA0BAC,EAgBAC,EACAC,EAIAC,EAKAC,E,iBCnIJ,IAAIC,EAAY,CACf,SAAU,IACFC,QAAQC,IAAI,CAACC,EAAoBC,EAAE,KAAMD,EAAoBC,EAAE,OAAOC,MAAK,IAAM,IAASF,EAAoB,QAGnHf,EAAM,CAACkB,EAAQC,KAClBJ,EAAoBK,EAAID,EACxBA,EACCJ,EAAoBM,EAAET,EAAWM,GAC9BN,EAAUM,KACVL,QAAQS,UAAUL,MAAK,KACxB,MAAM,IAAIM,MAAM,WAAaL,EAAS,iCAAiC,IAG1EH,EAAoBK,OAAII,EACjBL,GAEJM,EAAO,CAACC,EAAYC,KACvB,GAAKZ,EAAoBa,EAAzB,CACA,IAAIC,EAAO,UACPC,EAAWf,EAAoBa,EAAEC,GACrC,GAAGC,GAAYA,IAAaJ,EAAY,MAAM,IAAIH,MAAM,mGAExD,OADAR,EAAoBa,EAAEC,GAAQH,EACvBX,EAAoBgB,EAAEF,EAAMF,EALD,CAKW,EAI9CZ,EAAoBiB,EAAEC,EAAS,CAC9BjC,IAAK,IAAM,EACXyB,KAAM,IAAM,G,GC5BTS,EAA2B,CAAC,EAGhC,SAASnB,EAAoBoB,GAE5B,IAAIC,EAAeF,EAAyBC,GAC5C,QAAqBX,IAAjBY,EACH,OAAOA,EAAaH,QAGrB,IAAIf,EAASgB,EAAyBC,GAAY,CACjDE,GAAIF,EAEJF,QAAS,CAAC,GAOX,OAHAK,EAAoBH,GAAUI,KAAKrB,EAAOe,QAASf,EAAQA,EAAOe,QAASlB,GAGpEG,EAAOe,OACf,CAGAlB,EAAoByB,EAAIF,EAGxBvB,EAAoB0B,EAAIP,EC3BxBnB,EAAoB2B,EAAKxB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EAAoBM,EAAEkI,EAAiBnG,KAEf,KAD1BqG,EAAqBF,EAAgBnG,MACRmG,EAAgBnG,QAAW5B,GACrDiI,GAAoB,CACtB,IAAIE,EAAYpE,IAAyB,SAAfA,EAAMW,KAAkB,UAAYX,EAAMW,MAChE0D,EAAUrE,GAASA,EAAMY,QAAUZ,EAAMY,OAAOf,IACpDkE,EAAMO,QAAU,iBAAmBzG,EAAU,cAAgBuG,EAAY,KAAOC,EAAU,IAC1FN,EAAMzH,KAAO,iBACbyH,EAAMpD,KAAOyD,EACbL,EAAMQ,QAAUF,EAChBH,EAAmB,GAAGH,EACvB,CACD,GAEwC,SAAWlG,EAASA,EAE/D,CACD,EAcF,IAAI2G,EAAuB,CAACC,EAA4BC,KACvD,IAGI9H,EAAUiB,GAHT8G,EAAUC,EAAaC,GAAWH,EAGhBtF,EAAI,EAC3B,GAAGuF,EAASG,MAAMhI,GAAgC,IAAxBkH,EAAgBlH,KAAa,CACtD,IAAIF,KAAYgI,EACZpJ,EAAoBM,EAAE8I,EAAahI,KACrCpB,EAAoByB,EAAEL,GAAYgI,EAAYhI,IAGhD,GAAGiI,EAAsBA,EAAQrJ,EAClC,CAEA,IADGiJ,GAA4BA,EAA2BC,GACrDtF,EAAIuF,EAAStF,OAAQD,IACzBvB,EAAU8G,EAASvF,GAChB5D,EAAoBM,EAAEkI,EAAiBnG,IAAYmG,EAAgBnG,IACrEmG,EAAgBnG,GAAS,KAE1BmG,EAAgBnG,GAAW,CAC5B,EAIGkH,EAAqBC,KAAmD,6CAAIA,KAAmD,8CAAK,GACxID,EAAmBxE,QAAQiE,EAAqB9D,KAAK,KAAM,IAC3DqE,EAAmBjG,KAAO0F,EAAqB9D,KAAK,KAAMqE,EAAmBjG,KAAK4B,KAAKqE,G,KCrFvFvJ,EAAoBmE,QAAK1D,ECGzB,IAAIgJ,EAAsBzJ,EAAoB,K","sources":["webpack://collective-z3cform-datagridfield/webpack/runtime/load script","webpack://collective-z3cform-datagridfield/webpack/runtime/consumes","webpack://collective-z3cform-datagridfield/webpack/container-entry","webpack://collective-z3cform-datagridfield/webpack/bootstrap","webpack://collective-z3cform-datagridfield/webpack/runtime/compat get default export","webpack://collective-z3cform-datagridfield/webpack/runtime/define property getters","webpack://collective-z3cform-datagridfield/webpack/runtime/ensure chunk","webpack://collective-z3cform-datagridfield/webpack/runtime/get javascript chunk filename","webpack://collective-z3cform-datagridfield/webpack/runtime/global","webpack://collective-z3cform-datagridfield/webpack/runtime/hasOwnProperty shorthand","webpack://collective-z3cform-datagridfield/webpack/runtime/make namespace object","webpack://collective-z3cform-datagridfield/webpack/runtime/sharing","webpack://collective-z3cform-datagridfield/webpack/runtime/publicPath","webpack://collective-z3cform-datagridfield/webpack/runtime/jsonp chunk loading","webpack://collective-z3cform-datagridfield/webpack/runtime/nonce","webpack://collective-z3cform-datagridfield/webpack/startup"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"collective-z3cform-datagridfield:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","var parseVersion = (str) => {\n\t// see webpack/lib/util/semver.js for original code\n\tvar p=p=>{return p.split(\".\").map((p=>{return+p==p?+p:p}))},n=/^([^-+]+)?(?:-([^+]+))?(?:\\+(.+))?$/.exec(str),r=n[1]?p(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,p(n[2]))),n[3]&&(r.push([]),r.push.apply(r,p(n[3]))),r;\n}\nvar versionLt = (a, b) => {\n\t// see webpack/lib/util/semver.js for original code\n\ta=parseVersion(a),b=parseVersion(b);for(var r=0;;){if(r>=a.length)return r=b.length)return\"u\"==n;var t=b[r],f=(typeof t)[0];if(n!=f)return\"o\"==n&&\"n\"==f||(\"s\"==f||\"u\"==n);if(\"o\"!=n&&\"u\"!=n&&e!=t)return e {\n\t// see webpack/lib/util/semver.js for original code\n\tvar r=range[0],n=\"\";if(1===range.length)return\"*\";if(r+.5){n+=0==r?\">=\":-1==r?\"<\":1==r?\"^\":2==r?\"~\":r>0?\"=\":\"!=\";for(var e=1,a=1;a0?\".\":\"\")+(e=2,t)}return n}var g=[];for(a=1;a {\n\t// see webpack/lib/util/semver.js for original code\n\tif(0 in range){version=parseVersion(version);var e=range[0],r=e<0;r&&(e=-e-1);for(var n=0,i=1,a=!0;;i++,n++){var f,s,g=i=version.length||\"o\"==(s=(typeof(f=version[n]))[0]))return!a||(\"u\"==g?i>e&&!r:\"\"==g!=r);if(\"u\"==s){if(!a||\"u\"!=g)return!1}else if(a)if(g==s)if(i<=e){if(f!=range[i])return!1}else{if(r?f>range[i]:f {\n\treturn scope && __webpack_require__.o(scope, key);\n}\nvar get = (entry) => {\n\tentry.loaded = 1;\n\treturn entry.get()\n};\nvar eagerOnly = (versions) => {\n\treturn Object.keys(versions).reduce((filtered, version) => {\n\t\t\tif (versions[version].eager) {\n\t\t\t\tfiltered[version] = versions[version];\n\t\t\t}\n\t\t\treturn filtered;\n\t}, {});\n};\nvar findLatestVersion = (scope, key, eager) => {\n\tvar versions = eager ? eagerOnly(scope[key]) : scope[key];\n\tvar key = Object.keys(versions).reduce((a, b) => {\n\t\treturn !a || versionLt(a, b) ? b : a;\n\t}, 0);\n\treturn key && versions[key];\n};\nvar findSatisfyingVersion = (scope, key, requiredVersion, eager) => {\n\tvar versions = eager ? eagerOnly(scope[key]) : scope[key];\n\tvar key = Object.keys(versions).reduce((a, b) => {\n\t\tif (!satisfy(requiredVersion, b)) return a;\n\t\treturn !a || versionLt(a, b) ? b : a;\n\t}, 0);\n\treturn key && versions[key]\n};\nvar findSingletonVersionKey = (scope, key, eager) => {\n\tvar versions = eager ? eagerOnly(scope[key]) : scope[key];\n\treturn Object.keys(versions).reduce((a, b) => {\n\t\treturn !a || (!versions[a].loaded && versionLt(a, b)) ? b : a;\n\t}, 0);\n};\nvar getInvalidSingletonVersionMessage = (scope, key, version, requiredVersion) => {\n\treturn \"Unsatisfied version \" + version + \" from \" + (version && scope[key][version].from) + \" of shared singleton module \" + key + \" (required \" + rangeToString(requiredVersion) + \")\"\n};\nvar getInvalidVersionMessage = (scope, scopeName, key, requiredVersion, eager) => {\n\tvar versions = scope[key];\n\treturn \"No satisfying version (\" + rangeToString(requiredVersion) + \")\" + (eager ? \" for eager consumption\" : \"\") + \" of shared module \" + key + \" found in shared scope \" + scopeName + \".\\n\" +\n\t\t\"Available versions: \" + Object.keys(versions).map((key) => {\n\t\treturn key + \" from \" + versions[key].from;\n\t}).join(\", \");\n};\nvar fail = (msg) => {\n\tthrow new Error(msg);\n}\nvar failAsNotExist = (scopeName, key) => {\n\treturn fail(\"Shared module \" + key + \" doesn't exist in shared scope \" + scopeName);\n}\nvar warn = /*#__PURE__*/ (msg) => {\n\tif (typeof console !== \"undefined\" && console.warn) console.warn(msg);\n};\nvar init = (fn) => (function(scopeName, key, eager, c, d) {\n\tvar promise = __webpack_require__.I(scopeName);\n\tif (promise && promise.then && !eager) {\n\t\treturn promise.then(fn.bind(fn, scopeName, __webpack_require__.S[scopeName], key, false, c, d));\n\t}\n\treturn fn(scopeName, __webpack_require__.S[scopeName], key, eager, c, d);\n});\n\nvar useFallback = (scopeName, key, fallback) => {\n\treturn fallback ? fallback() : failAsNotExist(scopeName, key);\n}\nvar load = /*#__PURE__*/ init((scopeName, scope, key, eager, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\treturn get(findLatestVersion(scope, key, eager));\n});\nvar loadVersion = /*#__PURE__*/ init((scopeName, scope, key, eager, requiredVersion, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar satisfyingVersion = findSatisfyingVersion(scope, key, requiredVersion, eager);\n\tif (satisfyingVersion) return get(satisfyingVersion);\n\twarn(getInvalidVersionMessage(scope, scopeName, key, requiredVersion, eager))\n\treturn get(findLatestVersion(scope, key, eager));\n});\nvar loadStrictVersion = /*#__PURE__*/ init((scopeName, scope, key, eager, requiredVersion, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar satisfyingVersion = findSatisfyingVersion(scope, key, requiredVersion, eager);\n\tif (satisfyingVersion) return get(satisfyingVersion);\n\tif (fallback) return fallback();\n\tfail(getInvalidVersionMessage(scope, scopeName, key, requiredVersion, eager));\n});\nvar loadSingleton = /*#__PURE__*/ init((scopeName, scope, key, eager, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar version = findSingletonVersionKey(scope, key, eager);\n\treturn get(scope[key][version]);\n});\nvar loadSingletonVersion = /*#__PURE__*/ init((scopeName, scope, key, eager, requiredVersion, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar version = findSingletonVersionKey(scope, key, eager);\n\tif (!satisfy(requiredVersion, version)) {\n\t\twarn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));\n\t}\n\treturn get(scope[key][version]);\n});\nvar loadStrictSingletonVersion = /*#__PURE__*/ init((scopeName, scope, key, eager, requiredVersion, fallback) => {\n\tif (!exists(scope, key)) return useFallback(scopeName, key, fallback);\n\tvar version = findSingletonVersionKey(scope, key, eager);\n\tif (!satisfy(requiredVersion, version)) {\n\t\tfail(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));\n\t}\n\treturn get(scope[key][version]);\n});\nvar installedModules = {};\nvar moduleToHandlerMapping = {\n\t22: () => (loadSingletonVersion(\"default\", \"jquery\", false, [4,3,7,1], () => (__webpack_require__.e(692).then(() => (() => (__webpack_require__(692)))))))\n};\n// no consumes in initial chunks\nvar chunkMapping = {\n\t\"245\": [\n\t\t22\n\t]\n};\nvar startedInstallModules = {};\n__webpack_require__.f.consumes = (chunkId, promises) => {\n\tif(__webpack_require__.o(chunkMapping, chunkId)) {\n\t\tchunkMapping[chunkId].forEach((id) => {\n\t\t\tif(__webpack_require__.o(installedModules, id)) return promises.push(installedModules[id]);\n\t\t\tif(!startedInstallModules[id]) {\n\t\t\tvar onFactory = (factory) => {\n\t\t\t\tinstalledModules[id] = 0;\n\t\t\t\t__webpack_require__.m[id] = (module) => {\n\t\t\t\t\tdelete __webpack_require__.c[id];\n\t\t\t\t\tmodule.exports = factory();\n\t\t\t\t}\n\t\t\t};\n\t\t\tstartedInstallModules[id] = true;\n\t\t\tvar onError = (error) => {\n\t\t\t\tdelete installedModules[id];\n\t\t\t\t__webpack_require__.m[id] = (module) => {\n\t\t\t\t\tdelete __webpack_require__.c[id];\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tvar promise = moduleToHandlerMapping[id]();\n\t\t\t\tif(promise.then) {\n\t\t\t\t\tpromises.push(installedModules[id] = promise.then(onFactory)['catch'](onError));\n\t\t\t\t} else onFactory(promise);\n\t\t\t} catch(e) { onError(e); }\n\t\t\t}\n\t\t});\n\t}\n}","var moduleMap = {\n\t\"./main\": () => {\n\t\treturn Promise.all([__webpack_require__.e(644), __webpack_require__.e(245)]).then(() => (() => ((__webpack_require__(245)))));\n\t}\n};\nvar get = (module, getScope) => {\n\t__webpack_require__.R = getScope;\n\tgetScope = (\n\t\t__webpack_require__.o(moduleMap, module)\n\t\t\t? moduleMap[module]()\n\t\t\t: Promise.resolve().then(() => {\n\t\t\t\tthrow new Error('Module \"' + module + '\" does not exist in container.');\n\t\t\t})\n\t);\n\t__webpack_require__.R = undefined;\n\treturn getScope;\n};\nvar init = (shareScope, initScope) => {\n\tif (!__webpack_require__.S) return;\n\tvar name = \"default\"\n\tvar oldScope = __webpack_require__.S[name];\n\tif(oldScope && oldScope !== shareScope) throw new Error(\"Container initialization failed as it has already been initialized with a different share scope\");\n\t__webpack_require__.S[name] = shareScope;\n\treturn __webpack_require__.I(name, initScope);\n};\n\n// This exports getters to disallow modifications\n__webpack_require__.d(exports, {\n\tget: () => (get),\n\tinit: () => (init)\n});","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// expose the module cache\n__webpack_require__.c = __webpack_module_cache__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"chunks/\" + chunkId + \".\" + {\"245\":\"68c1fea4b716b78c19a5\",\"267\":\"b05f3df573b06c619bb5\",\"644\":\"362cfa62704842136084\",\"692\":\"283a97cd832931f6b9a9\"}[chunkId] + \".min.js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.S = {};\nvar initPromises = {};\nvar initTokens = {};\n__webpack_require__.I = (name, initScope) => {\n\tif(!initScope) initScope = [];\n\t// handling circular init calls\n\tvar initToken = initTokens[name];\n\tif(!initToken) initToken = initTokens[name] = {};\n\tif(initScope.indexOf(initToken) >= 0) return;\n\tinitScope.push(initToken);\n\t// only runs once\n\tif(initPromises[name]) return initPromises[name];\n\t// creates a new share scope if needed\n\tif(!__webpack_require__.o(__webpack_require__.S, name)) __webpack_require__.S[name] = {};\n\t// runs all init snippets from all modules reachable\n\tvar scope = __webpack_require__.S[name];\n\tvar warn = (msg) => {\n\t\tif (typeof console !== \"undefined\" && console.warn) console.warn(msg);\n\t};\n\tvar uniqueName = \"collective-z3cform-datagridfield\";\n\tvar register = (name, version, factory, eager) => {\n\t\tvar versions = scope[name] = scope[name] || {};\n\t\tvar activeVersion = versions[version];\n\t\tif(!activeVersion || (!activeVersion.loaded && (!eager != !activeVersion.eager ? eager : uniqueName > activeVersion.from))) versions[version] = { get: factory, from: uniqueName, eager: !!eager };\n\t};\n\tvar initExternal = (id) => {\n\t\tvar handleError = (err) => (warn(\"Initialization of sharing external failed: \" + err));\n\t\ttry {\n\t\t\tvar module = __webpack_require__(id);\n\t\t\tif(!module) return;\n\t\t\tvar initFn = (module) => (module && module.init && module.init(__webpack_require__.S[name], initScope))\n\t\t\tif(module.then) return promises.push(module.then(initFn, handleError));\n\t\t\tvar initResult = initFn(module);\n\t\t\tif(initResult && initResult.then) return promises.push(initResult['catch'](handleError));\n\t\t} catch(err) { handleError(err); }\n\t}\n\tvar promises = [];\n\tswitch(name) {\n\t\tcase \"default\": {\n\t\t\tregister(\"jquery\", \"3.7.1\", () => (__webpack_require__.e(692).then(() => (() => (__webpack_require__(692))))));\n\t\t}\n\t\tbreak;\n\t}\n\tif(!promises.length) return initPromises[name] = 1;\n\treturn initPromises[name] = Promise.all(promises).then(() => (initPromises[name] = 1));\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t541: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkcollective_z3cform_datagridfield\"] = self[\"webpackChunkcollective_z3cform_datagridfield\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// module cache are used so entry inlining is disabled\n// startup\n// Load entry module and return exports\nvar __webpack_exports__ = __webpack_require__(483);\n"],"names":["inProgress","dataWebpackPrefix","parseVersion","versionLt","rangeToString","satisfy","exists","get","eagerOnly","findSingletonVersionKey","getInvalidSingletonVersionMessage","fail","warn","useFallback","loadSingletonVersion","installedModules","moduleToHandlerMapping","chunkMapping","startedInstallModules","moduleMap","Promise","all","__webpack_require__","e","then","module","getScope","R","o","resolve","Error","undefined","init","shareScope","initScope","S","name","oldScope","I","d","exports","__webpack_module_cache__","moduleId","cachedModule","id","__webpack_modules__","call","m","c","n","getter","__esModule","a","definition","key","Object","defineProperty","enumerable","f","chunkId","keys","reduce","promises","u","g","globalThis","this","Function","window","obj","prop","prototype","hasOwnProperty","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","r","Symbol","toStringTag","value","initPromises","initTokens","initToken","indexOf","scope","uniqueName","version","factory","eager","versions","activeVersion","loaded","from","register","scriptUrl","importScripts","location","currentScript","tagName","toUpperCase","test","replace","p","str","split","map","exec","apply","b","t","range","pop","entry","filtered","requiredVersion","msg","console","scopeName","fallback","failAsNotExist","promise","consumes","onFactory","onError","error","installedChunks","j","installedChunkData","reject","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/src/collective/z3cform/datagridfield/static/datagridfield.min.js b/src/collective/z3cform/datagridfield/static/datagridfield.min.js index 369ca9d..8d63f47 100644 --- a/src/collective/z3cform/datagridfield/static/datagridfield.min.js +++ b/src/collective/z3cform/datagridfield/static/datagridfield.min.js @@ -1,2 +1,2 @@ -(()=>{var t,e,r={553:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var n=r(22),o=r.n(n),i=r(288),a=r(505);const s={getOptions(t,e,r){r=r||{},0===t.length||o().nodeName(t[0],"body")||(r=this.getOptions(t.parent(),e,r));let n={};if(0!==t.length&&(n=t.data("pat-"+e),n&&"string"==typeof n)){const t={};o().each(n.split(";"),(function(e,r){(r=r.split(":")).reverse();let n=r.pop();n=n.replace(/^\s+|\s+$/g,""),r.reverse();let o=r.join(":");o=o.replace(/^\s+|\s+$/g,""),t[n]=o})),n=t}return o().extend(!0,{},r,n)}},l=a.A.getLogger("Patternslib Base"),d=function(t,e,r){t.jquery||(t=o()(t));const n=this.prototype.name,l=a.A.getLogger(`pat.${n}`);let d=t.data(`pattern-${n}`);if(void 0===d&&i.A.patterns[n])try{t.data(`pattern-${n}`,"initializing"),e="mockup"===this.prototype.parser?s.getOptions(t,n,e):e,d=new i.A.patterns[n](t,e,r)}catch(t){l.error(`Failed while initializing ${n} pattern.`,t)}return d},u=async function(t,e,r){t?.jquery&&0===t.length||!t?l.warn("No element given to pattern."):(t.jquery||(t=o()(t)),this.$el=t,this.el=t[0],this.options=o().extend(!0,{},this.defaults||{},e||{}),this.emit("pre-init"),await this.init(t,e,r),this.$el.data(`pattern-${this.name}`,this),this.el[`pattern-${this.name}`]=this,this.emit("init"))};u.prototype={constructor:u,on(t,e){this.$el.on(`${t}.${this.name}.patterns`,e)},one(t,e){this.$el.one(`${t}.${this.name}.patterns`,e)},emit(t,e){void 0===e&&(e=[]),this.$el.trigger(`${t}.${this.name}.patterns`,e)}},u.extend=function(t){const e=this;let r;if(!t)throw new Error("Pattern configuration properties required when calling Base.extend");r=Object.hasOwnProperty.call(t,"constructor")?t.constructor:function(){e.apply(this,arguments)},r.extend=u.extend,r.init=d,r.jquery_plugin=!0,r.trigger=t.trigger,r.parser=t?.parser||null;var n=function(){this.constructor=r};return n.prototype=e.prototype,r.prototype=new n,o().extend(!0,r.prototype,t),r.__super__=e.prototype,t.name?t.trigger?!1!==t.autoregister&&i.A.register(r,t.name):l.warn(`The pattern ${t.name} does not have a trigger attribute, it will not be registered.`):l.warn("This pattern without a name attribute will not be registered!"),r};const c=u},505:(t,e,r)=>{"use strict";var n,o;r.d(e,{A:()=>c}),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),r=this,n=function(){},o=function(){return r.apply(this instanceof n&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return n.prototype=this.prototype,o.prototype=new n,o});var i={DEBUG:10,INFO:20,WARN:30,ERROR:40,FATAL:50};function a(){}function s(t,e){this._loggers={},this.name=t||"",this._parent=e||null,e||(this._enabled=!0,this._level=i.WARN)}function l(t){o=t}a.prototype={output:function(t,e,r){t&&r.unshift(t+":"),e<=i.DEBUG?(r.unshift("[DEBUG]"),console.log.apply(console,r)):e<=i.INFO?console.info.apply(console,r):e<=i.WARN?console.warn.apply(console,r):console.error.apply(console,r)}},s.prototype={getLogger:function(t){for(var e=t.split("."),r=this,n=this.name?[this.name]:[];e.length;){var o=e.shift();n.push(o),o in r._loggers||(r._loggers[o]=new s(n.join("."),r)),r=r._loggers[o]}return r},_getFlag:function(t){var e=this;for(t="_"+t;null!==e;){if(void 0!==e[t])return e[t];e=e._parent}return null},setEnabled:function(t){this._enabled=!!t},isEnabled:function(){this._getFlag("enabled")},setLevel:function(t){"number"==typeof t?this._level=t:"string"==typeof t&&(t=t.toUpperCase())in i&&(this._level=i[t])},getLevel:function(){return this._getFlag("level")},log:function(t,e){!e.length||!this._getFlag("enabled")||t{"use strict";r.d(e,{A:()=>$});var n=r(22),o=r.n(n),i=r(505);const a=i.A.getLogger("core dom"),s="__patternslib__data_prefix__",l="__patternslib__style__display";function d(t,e,r=!1,n=!1){let o=window.getComputedStyle(t).getPropertyValue(e);return(r||n)&&(o=parseFloat(o)||0),r&&!n&&(o=parseInt(Math.round(o),10)),o}const u=(t,e=document.body)=>{e===window&&(e=document.body);const r=Math.abs(t.getBoundingClientRect().left+e.scrollLeft-e.getBoundingClientRect().left-h.get_css_value(e,"border-left-width",!0));return{top:Math.abs(t.getBoundingClientRect().top+e.scrollTop-e.getBoundingClientRect().top-h.get_css_value(e,"border-top-width",!0)),left:r}},c=(t,e,r)=>t[`${s}${e}`]||r,f=(t,e,r)=>{t[`${s}${e}`]=r},h={toNodeArray:t=>(t.jquery||t instanceof NodeList?t=[...t]:t instanceof Array==!1&&(t=[t]),t),querySelectorAllAndMe:(t,e)=>{if(!t)return[];const r=[...t.querySelectorAll(e)];return t.matches(e)&&r.unshift(t),r},wrap:(t,e)=>{t.parentNode.insertBefore(e,t),e.appendChild(t)},hide:t=>{"none"!==t.style.display&&(t.style.display&&(t[l]=t.style.display),t.style.display="none")},show:t=>{const e=t[l]||null;t.style.display=e,delete t[l]},find_parents:(t,e)=>{const r=[];let n=t;for(;n;)n=n.parentNode?.closest?.(e),n&&r.push(n);return r},find_scoped:(t,e)=>(0===e.indexOf("#")?document:t).querySelectorAll(e),get_parents:t=>{const e=[];let r=t?.parentNode;for(;r;)e.push(r),r=r?.parentNode,r=r instanceof HTMLElement?r:null;return e},acquire_attribute:(t,e,r=!1,n=!1)=>{let o=t;const i=[];for(;o;){const t=o.getAttribute(e);if(t||r&&""===t){if(!n)return t;i.push(t)}o=o.parentElement}if(n)return i},is_visible:t=>t.offsetWidth>0&&t.offsetHeight>0,is_input:t=>/^(?:input|select|textarea|button)$/i.test(t.nodeName),create_from_string:t=>document.createRange().createContextualFragment(t.trim()),get_css_value:d,find_scroll_container:(t,e,r=document.body)=>{for(;t&&t!==document.body;){if(!e||"y"===e){let e=d(t,"overflow-y");if(["auto","scroll"].includes(e))return t}if(!e||"x"===e){let e=d(t,"overflow-x");if(["auto","scroll"].includes(e))return t}t=t.parentElement}return r},get_scroll_x:t=>void 0!==t.scrollLeft?t.scrollLeft:t.scrollX,get_scroll_y:t=>void 0!==t.scrollTop?t.scrollTop:t.scrollY,get_relative_position:u,scroll_to_element:(t,e,r=0,n="top")=>{const o=u(t,e),i={behavior:"auto"};"top"!==n&&"both"!==n||(i.top=o.top-r),"left"!==n&&"both"!==n||(i.left=o.left-r),e.scrollTo(i)},scroll_to_top:(t=document.body,e=0)=>{t.scrollTo({top:0-e,behavior:"auto"})},scroll_to_bottom:(t=document.body,e=0)=>{const r=(t===window?document.body:t).scrollHeight;t.scrollTo({top:r-e,behavior:"auto"})},get_data:c,set_data:f,delete_data:(t,e)=>{delete t[`${s}${e}`]},template:(t,e={})=>(a.warn("Using dom.template is not recommended due to a problem with Content-Security-Policy."),new Function("return `"+t+"`;").call(e)),get_visible_ratio:(t,e)=>{if(!t)return 0;const r=t.getBoundingClientRect(),n=e!==window?e.getBoundingClientRect():{top:0,bottom:window.innerHeight};let o=0;if(r.topn.top){const t=r.bottom-r.top;o=(Math.min(r.bottom,n.bottom)-Math.max(r.top,n.top))/t}return o},escape_css_id:t=>`#${CSS.escape(t.split("#")[1])}`,element_uuid:t=>{if(!c(t,"uuid",!1)){let e;if(window.crypto.randomUUID)e=window.crypto.randomUUID();else{const t=new Uint32Array(4);e=window.crypto.getRandomValues(t).join("")}f(t,"uuid",e)}return c(t,"uuid")},find_form:t=>t.closest(".pat-subform")||t.form||t.querySelector("input, select, textarea, button")?.form||t.closest("form")},p=h;o().fn.safeClone=function(){return this.clone()},Array.prototype.forEach||(Array.prototype.forEach=function(t,e){var r,n;if(null===this)throw new TypeError(" this is null or not defined");var o=Object(this),i=o.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(arguments.length>1&&(r=e),n=0;n0===t))&&(e?n.top<=0+r&&n.bottom>=0+r:n.top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth))}var b={jqueryPlugin:function(t){return function(e,r){return 0===this.length?this:("object"==typeof e&&(r=e,e=void 0),"function"==typeof t?g.call(this,t,e,r):w.call(this,t,e,r))}},escapeRegExp:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isObject:m,extend:function(t){if(!m(t))return t;for(var e,r,n=1,o=arguments.length;n!r.test(t)));n.length?e.setAttribute("class",n.join(" ")):e.removeAttribute("class")}}},hideOrShow:(t,e,r,n)=>{t=p.toNodeArray(t);const i={none:{hide:"hide",show:"show"},fade:{hide:"fadeOut",show:"fadeIn"},slide:{hide:"slideUp",show:"slideDown"}},a="css"===r.transition||"none"===r.transition?null:r.effect.duration,s=t=>{t.classList.remove("in-progress"),t.classList.add(e?"visible":"hidden"),o()(t).trigger("pat-update",{pattern:n,action:"attribute-changed",dom:t,transition:"complete"})};for(const l of t)if(l.classList.remove("visible"),l.classList.remove("hidden"),l.classList.remove("in-progress"),a){const t=i[r.transition];l.classList.add("in-progress"),o()(l).trigger("pat-update",{pattern:n,action:"attribute-changed",dom:l,transition:"start"}),o()(l)[e?t.show:t.hide]({duration:a,easing:r.effect.easing,complete:()=>s(l)})}else"css"!==r.transition&&p[e?"show":"hide"](l),s(l)},addURLQueryParameter:function(t,e,r){var n=new RegExp("(\\?|\\&)"+e+"=.*?(?=(&|$))"),o=t.toString().split("#"),i=o[0],a=o[1],s=i;return s=n.test(i)?i.replace(n,"$1"+e+"="+r):/\?.+$/.test(i)?i+"&"+e+"="+r:i+"?"+e+"="+r,a&&(s+="#"+a),s},removeDuplicateObjects:function(t){const e=function(t,e){return this[t]===e};return t.reduce((function(t,r){let n=!1;for(const o of t)n=Object.keys(o).length===Object.keys(r).length&&0===Object.entries(o).filter((t=>!e.bind(r)(t[0],t[1]))).length;return n||t.push(r),t}),[])},mergeStack:function(t,e){const r=[];for(let t=0;tt?t:i])}return r},isElementInViewport:y,hasValue:function(t){return"INPUT"===t.tagName?"checkbox"===t.type||"radio"===t.type?t.checked:""!==t.value:"SELECT"===t.tagName?-1!==t.selectedIndex:"TEXTAREA"===t.tagName&&""!==t.value},parseTime:function(t){var e=/^(\d+(?:\.\d+)?)\s*(\w*)/.exec(t);if(!e)throw new Error("Invalid time");var r=parseFloat(e[1]);switch(e[2]){case"s":return Math.round(1e3*r);case"m":return Math.round(1e3*r*60);default:return Math.round(r)}},parseLength:function(t,e=null){const r=/^(\d+(?:\.\d+)?)\s*(\%?\w*)/.exec(t);if(!r)throw new Error("Invalid length");const n=parseFloat(r[1]);switch(r[2]){case"px":default:return Math.round(n);case"%":return e?e/100*Math.round(n):0;case"vw":return Math.round(n*window.innerWidth/100);case"vh":return Math.round(n*window.innerHeight/100);case"vmin":return Math.round(n*Math.min(window.innerWidth,window.innerHeight)/100);case"vmax":return Math.round(n*Math.max(window.innerWidth,window.innerHeight)/100)}},findRelatives:function(t){var e=o()(t),r=o()(t),n=o()();if(r=(r=r.add(e.closest("label"))).add(e.closest("fieldset")),t.id&&(n=o()("label[for='"+t.id+"']")),!n.length){var i=e.closest("form");i.length||(i=o()(document.body)),n=i.find("label[for='"+t.name+"']")}return r=r.add(n)},get_bounds:function(t){const e=t.getBoundingClientRect();return{x:parseInt(Math.round(e.x),10)||0,y:parseInt(Math.round(e.y),10)||0,top:parseInt(Math.round(e.top),10)||0,bottom:parseInt(Math.round(e.bottom),10)||0,left:parseInt(Math.round(e.left),10)||0,right:parseInt(Math.round(e.right),10)||0,width:parseInt(Math.round(e.width),10)||0,height:parseInt(Math.round(e.height),10)||0}},checkInputSupport:function(t,e){let r=!1;const n=document.createElement("input");return n.setAttribute("type",t),r=n.type==t,void 0!==e&&(n.setAttribute("value",e),r=n.value!==e),r},checkCSSFeature:(t,e,r="div")=>{let n=void 0!==(r=document.createElement(r)).style[t];return n&&void 0!==e&&(r.style[t]=e,n=r.style[t]===e),n},animation_frame:()=>new Promise(window.requestAnimationFrame),timeout:t=>new Promise((e=>setTimeout(e,t))),debounce:(t,e,r={timer:null},n=!0)=>(r.last_run=0,function(){const o=arguments;!n&&r.timer&&Date.now()-r.last_run<=e||(clearTimeout(r.timer),r.last_run=Date.now(),r.timer=setTimeout((()=>{t.apply(this,o)}),e))}),isIE:()=>!!document.documentMode,jqToNode:t=>(t.jquery&&(t=t[0]),t),ensureArray:(t,e)=>!!(NodeList.prototype.isPrototypeOf(t)||Array.isArray(t)||t.jquery)?e?[...t]:t:[t],localized_isodate:t=>{const e=t.getDate().toString().padStart(2,"0"),r=(t.getMonth()+1).toString().padStart(2,"0");return`${t.getFullYear().toString()}-${r}-${e}`},escape_html:t=>{if(!t)return"";const e=document.createElement("div");return e.appendChild(document.createTextNode(t)),e.innerHTML.replace(/"/g,""")},unescape_html:t=>{if(!t)return"";return(new DOMParser).parseFromString(t,"text/html").documentElement.textContent.replace(/"/g,'"')},is_iso_date_time:(t,e=!1)=>(e?/^\d{4}-[01]\d-[0-3]\d(T[0-2]\d:[0-5]\d)?$/:/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d$/).test(t),is_iso_date:t=>/^\d{4}-[01]\d-[0-3]\d$/.test(t),date_diff:(t,e)=>{const r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()),n=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate());return Math.floor((r-n)/864e5)},threshold_list:(t=0)=>{let e=[];for(let r=1;r<=t;r++)e.push(r/t);return e.push(0),e.sort()},is_option_truthy:t=>![void 0,null,"none",!1,"false",""].includes(t),elementInViewport:t=>(console.warn("Deprecated. Use utils.isElementInViewport"),y(t))};const _=b,x=i.A.getLogger("registry"),A=/patterns-disable=([^&]+)/g,E=/patterns-dont-catch/g,L={};let R,S=!1;for(;null!==(R=A.exec(window.location.search));)L[R[1]]=!0,x.info("Pattern disabled via url config:",R[1]);for(;null!==(R=E.exec(window.location.search));)S=!0,x.info("I will not catch init exceptions");void 0===window.__patternslib_registry&&(window.__patternslib_registry={});const T=window.__patternslib_registry;void 0===window.__patternslib_registry_initialized&&(window.__patternslib_registry_initialized=!1);const O={patterns:T,init(){o()(document).ready((function(){window.__patternslib_registry_initialized||(window.__patternslib_registry_initialized=!0,x.debug("Loaded: "+Object.keys(O.patterns).sort().join(", ")),O.scan(document.body),x.debug("Finished initial scan."))}))},clear(){for(const t in O.patterns)delete O.patterns[t]},transformPattern(t,e){if(L[t])return void x.debug(`Skipping disabled pattern: ${t}.`);const r=O.patterns[t],n=r.transform||r.prototype?.transform;if(n)try{n(o()(e))}catch(e){if(S)throw e;x.error(`Transform error for pattern ${t}.`,e)}},initPattern(t,e,r){const n=o()(e),a=O.patterns[t],s=i.A.getLogger(`pat.${t}`);if(e.matches(a.trigger)){s.debug("Initialising.",e);try{a.init?a.init(n,null,r):new a(n,null,r),s.debug("done.")}catch(t){if(S)throw t;s.error("Caught error:",t)}}},orderPatterns:t=>(t.includes("validation")&&(t.splice(t.indexOf("validation"),1),t.unshift("validation")),t.includes("clone-code")&&(t.splice(t.indexOf("clone-code"),1),t.unshift("clone-code")),t),scan(t,e,r){if(!t)return;if("string"==typeof t)t=document.querySelector(t);else{if(t instanceof Text)return;t.jquery&&(t=t[0])}const n=[];e=this.orderPatterns(e||Object.keys(O.patterns));for(const r of e){this.transformPattern(r,t);const e=O.patterns[r];e.trigger&&n.unshift(e.trigger)}let o=p.querySelectorAllAndMe(t,n.map((t=>t.trim().replace(/,$/,""))).join(","));o=o.filter((t=>!(t.matches(".disable-patterns")||t?.parentNode?.closest?.(".disable-patterns")||t?.parentNode?.closest?.("pre")||t?.parentNode?.closest?.("template")||t.matches(".cant-touch-this")||t?.parentNode?.closest?.(".cant-touch-this"))));for(const t of o.reverse())for(const n of e)this.initPattern(n,t,r);document.body.classList.add("patterns-loaded")},register(t,e){if(!(e=e||t.name))return x.error("Pattern lacks a name.",t),!1;if(O.patterns[e])return x.debug(`Already have a pattern called ${e}.`),!1;if(O.patterns[e]=t,t.jquery_plugin){const r=("pat-"+e).replace(/-([a-zA-Z])/g,(function(t,e){return e.toUpperCase()}));o().fn[r]=_.jqueryPlugin(t),o().fn[r.replace(/^pat/,"pattern")]=o().fn[r]}return x.debug(`Registered pattern ${e}`,t),window.__patternslib_registry_initialized&&(O.scan(document.body,[e]),x.debug(`Re-scanned dom with newly registered pattern ${e}.`)),!0}},$=O},245:(t,e,r)=>{"use strict";var n=r(288),o=(r(452),r(22)),i=r.n(o),a=r(553),s=r(505);s.A.setLevel("INFO");s.A.getLogger("datagridfield"),a.A.extend({name:"datagridfield",trigger:".pat-datagridfield",parser:"mockup",init:function(){r.e(267).then(r.bind(r,267)),this.el=this.$el[0],this.el_body=this.el.querySelector(".datagridwidget-body"),this.auto_append="false"!==(this.el.dataset.autoAppend||"true").toLowerCase(),this._defineHandler(),this.getVisibleRows().forEach((function(t){this.initRowUI(t)}),this),this.ensureMinimumRows()||this.updateOrderIndex(),this.initAutoAppendHandler(),this.el.dispatchEvent(new Event("afterdatagridfieldinit",{bubbles:!0,cancelable:!0}))},_defineHandler:function(){this.handler_auto_append=function(t){t&&t.stopPropagation(),t&&!t.target.closest(".datagridwidget-cell")||this.auto_append_row()}.bind(this),this.handler_auto_append_input=function(t){var e=t.currentTarget;e.classList.remove("auto-append"),e.dataset.oldIndex=e.dataset.index,delete e.dataset.index,this.updateOrderIndex(),e.removeEventListener("input",this.handler_auto_append_input)}.bind(this)},initRowUI:function(t){t.querySelectorAll(".dgf--row-add").forEach((function(e){e.addEventListener("click",function(e){e.preventDefault(),this.insertRow(t),this.updateOrderIndex()}.bind(this))}),this),t.querySelectorAll(".dgf--row-delete").forEach((function(e){e.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),this.removeFieldRow(t)}.bind(this))}),this),t.querySelectorAll(".dgf--row-moveup").forEach((function(e){e.addEventListener("click",function(e){e.preventDefault(),this.moveRowUp(t)}.bind(this))}),this),t.querySelectorAll(".dgf--row-movedown").forEach((function(e){e.addEventListener("click",function(e){e.preventDefault(),this.moveRowDown(t)}.bind(this))}),this)},get_row_buttons:function(t){return{add:t.querySelector(".dgf--row-add"),delete:t.querySelector(".dgf--row-delete"),up:t.querySelector(".dgf--row-moveup"),down:t.querySelector(".dgf--row-movedown")}},setUIState:function(){for(var t=this.getVisibleRows(),e=0;e0){var o=this.get_row_buttons(t[e-1]);o.down&&(o.down.disabled=!0)}}else 0===e?(n.add&&(n.add.disabled=!1),n.delete&&(n.delete.disabled=!1),n.up&&(n.up.disabled=!0),n.down&&(n.down.disabled=1===t.length)):e===t.length-1?(n.add&&(n.add.disabled=!1),n.delete&&(n.delete.disabled=!1),n.up&&(n.up.disabled=!1),n.down&&(n.down.disabled=!0)):(n.add&&(n.add.disabled=!1),n.delete&&(n.delete.disabled=!1),n.up&&(n.up.disabled=!1),n.down&&(n.down.disabled=!1))}},getRows:function(){return this.el_body.querySelectorAll(".datagridwidget-row")},getVisibleRows:function(){return this.el_body.querySelectorAll(".datagridwidget-row:not([data-index=TT])")},getLastRow:function(){return this.el_body.querySelector(".datagridwidget-row:last-child")},getLastVisibleRow:function(){var t=this.el_body.querySelectorAll(".datagridwidget-row:not([data-index=TT])");return t[t.length-1]},countRows:function(){var t=0;return this.getRows().forEach((function(e){-1===["AA","TT"].indexOf(e.dataset.index)&&t++}),this),t},initAutoAppendHandler:function(){if(this.auto_append){this.getVisibleRows().forEach((function(t){t.removeEventListener("focusout",this.handler_auto_append)}),this);var t=this.getLastVisibleRow();t&&t.addEventListener("focusout",this.handler_auto_append)}},auto_append_row:function(){this.el.dispatchEvent(new Event("beforeaddrowauto")),this.getVisibleRows().forEach((function(t){t.classList.remove("auto-append"),"TT"!==t.dataset.index&&(t.dataset.oldIndex=t.dataset.index,delete t.dataset.index)}));var t=this.getLastVisibleRow()||this.getLastRow(),e=this.insertRow(t);e.classList.add("auto-append"),this.reindexRow(e,"AA"),this.updateOrderIndex(),e.addEventListener("input",this.handler_auto_append_input),this.el.dispatchEvent(new Event("afteraddrowauto"))},insertRow:function(t,e){var r=this.createNewRow(),o=i()(r);return this.$el.trigger("beforeaddrow",[this.$el,o]),e?o.insertBefore(t):o.insertAfter(t),this.initRowUI(r),n.A.scan(o),this.initAutoAppendHandler(),this.$el.trigger("afteraddrow",[this.$el,o]),r},createNewRow:function(){var t=this.el_body.querySelector("[data-index=TT]");if(!t)throw new Error("Could not locate empty template row in DGF");var e=document.createElement("table");return e.innerHTML=t.outerHTML,(e=e.querySelector("tr")).dataset.oldIndex=e.dataset.index,delete e.dataset.index,e.classList.remove("datagridwidget-empty-row"),i()(e).find('*[class^="dgw-disabled-pat-"]').attr("class",(function(t,e){return e.replace(/dgw\-disabled-pat-/,"pat-")})),e},removeFieldRow:function(t){i()(t).remove(),this.ensureMinimumRows()||this.updateOrderIndex(),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowDown:function(t){this.moveRow(t,"down"),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowUp:function(t){this.moveRow(t,"up"),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowToTop:function(t){var e=this.getRows();i()(t).insertBefore(e[0]),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowToBottom:function(t){var e=this.getRows(),r=0;i()(e).each((function(t,e){-1===["AA","TT"].indexOf(e.dataset.index)&&(r=t)})),i()(t).insertAfter(e[r]),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRow:function(t,e){var r,n=this.getRows(),o=null;if(i()(n).each((function(e,r){t===r&&(o=e)})),null!==o){var a=this.countRows();o+1==a?"down"==e?this.moveRowToTop(t):(r=n[o-1],this.shiftRow(r,t)):0===o?"up"==e?this.moveRowToBottom(t):(r=n[parseInt(o+1,10)],this.shiftRow(t,r)):"up"==e?(r=n[o-1],this.shiftRow(r,t)):(r=n[parseInt(o+1,10)],this.shiftRow(t,r)),this.$el.trigger("aftermoverow",[this.$el,t])}},shiftRow:function(t,e){i()(e).insertBefore(t)},reindexRow:function(t,e){var r=this.el_body.dataset.name_prefix+".",n=this.el_body.dataset.id_prefix+"-",o=t.dataset.oldIndex||t.dataset.index;function i(t,r,n){var i=t.getAttribute(r);if(i){var a=new RegExp("^"+n+o);t.setAttribute(r,i.replace(a,n+e))}}delete t.dataset.oldIndex,t.dataset.index=e,t.querySelectorAll('[id^="formfield-'+n+'"]').forEach((function(t){i(t,"id","formfield-"+n)}),this),t.querySelectorAll('[name^="'+r+'"]').forEach((function(t){i(t,"name",r)}),this),t.querySelectorAll('[id^="'+n+'"]').forEach((function(t){i(t,"id",n)}),this),t.querySelectorAll('[for^="'+n+'"]').forEach((function(t){i(t,"for",n)}),this),t.querySelectorAll('[href*="#'+n+'"]').forEach((function(t){i(t,"href","#"+n)}),this),t.querySelectorAll('[data-fieldname^="'+r+'"]').forEach((function(t){i(t,"data-fieldname",r)}),this)},updateOrderIndex:function(){var t=0;this.getRows().forEach((function(e){var r=e.dataset.index;["AA","TT"].indexOf(r)>-1?this.reindexRow(e,r):(this.reindexRow(e,t),e.dataset.index=t,t++)}),this);var e=this.el_body.dataset.name_prefix+".";this.el.querySelector('input[name="'+e+'count"]').value=this.countRows(),this.setUIState()},getParentRow:function(t){var e=t.closest(".datagridwidget-row");return e||null},ensureMinimumRows:function(){var t=this.getRows(),e=this.getVisibleRows();return!(!t.length||0!==e.length)&&(this.auto_append_row(),!0)}});n.A.init()},452:t=>{var e=function(t){"use strict";var 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",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new $(n||[]);return o(a,"_invoke",{value:R(t,r,s)}),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f="suspendedStart",h="suspendedYield",p="executing",g="completed",w={};function m(){}function v(){}function y(){}var b={};d(b,a,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(j([])));x&&x!==r&&n.call(x,a)&&(b=x);var A=y.prototype=m.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,s){var l=c(t[o],t,i);if("throw"!==l.type){var d=l.arg,u=d.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(u).then((function(t){d.value=t,a(d)}),(function(t){return r("throw",t,a,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function R(t,r,n){var o=f;return function(i,a){if(o===p)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var l=S(s,n);if(l){if(l===w)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var d=c(t,r,n);if("normal"===d.type){if(o=n.done?g:h,d.arg===w)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=g,n.method="throw",n.arg=d.arg)}}}function S(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),w;var i=c(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,w;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,w):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,w)}function T(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function $(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function j(t){if(null!=t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),d=n.call(a,"finallyLoc");if(l&&d){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),w}},catch:function(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;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:j(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),w}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={id:t,exports:{}};return r[t].call(i.exports,i,i.exports,o),i.exports}o.m=r,o.c=n,o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.f={},o.e=t=>Promise.all(Object.keys(o.f).reduce(((e,r)=>(o.f[r](t,e),e)),[])),o.u=t=>"chunks/"+t+"."+{267:"b05f3df573b06c619bb5",692:"283a97cd832931f6b9a9"}[t]+".min.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="collective-z3cform-datagridfield:",o.l=(r,n,i,a)=>{if(t[r])t[r].push(n);else{var s,l;if(void 0!==i)for(var d=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(h);var o=t[r];if(delete t[r],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((t=>t(n))),e)return e(n)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),l&&document.head.appendChild(s)}},o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{o.S={};var t={},e={};o.I=(r,n)=>{n||(n=[]);var i=e[r];if(i||(i=e[r]={}),!(n.indexOf(i)>=0)){if(n.push(i),t[r])return t[r];o.o(o.S,r)||(o.S[r]={});var a=o.S[r],s="collective-z3cform-datagridfield",l=[];if("default"===r)((t,e,r,n)=>{var o=a[t]=a[t]||{},i=o[e];(!i||!i.loaded&&(!n!=!i.eager?n:s>i.from))&&(o[e]={get:r,from:s,eager:!!n})})("jquery","3.7.1",(()=>o.e(692).then((()=>()=>o(692)))));return l.length?t[r]=Promise.all(l).then((()=>t[r]=1)):t[r]=1}}})(),(()=>{var t;o.g.importScripts&&(t=o.g.location+"");var e=o.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t})(),(()=>{var t=t=>{var e=t=>t.split(".").map((t=>+t==t?+t:t)),r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(t),n=r[1]?e(r[1]):[];return r[2]&&(n.length++,n.push.apply(n,e(r[2]))),r[3]&&(n.push([]),n.push.apply(n,e(r[3]))),n},e=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n=r.length)return"u"==i;var a=r[n],s=(typeof a)[0];if(i!=s)return"o"==i&&"n"==s||"s"==s||"u"==i;if("o"!=i&&"u"!=i&&o!=a)return o{var e=t[0],n="";if(1===t.length)return"*";if(e+.5){n+=0==e?">=":-1==e?"<":1==e?"^":2==e?"~":e>0?"=":"!=";for(var o=1,i=1;i0?".":"")+(o=2,s);return n}var a=[];for(i=1;i{if(0 in e){r=t(r);var o=e[0],i=o<0;i&&(o=-o-1);for(var a=0,s=1,l=!0;;s++,a++){var d,u,c=s=r.length||"o"==(u=(typeof(d=r[a]))[0]))return!l||("u"==c?s>o&&!i:""==c!=i);if("u"==u){if(!l||"u"!=c)return!1}else if(l)if(c==u)if(s<=o){if(d!=e[s])return!1}else{if(i?d>e[s]:dt&&o.o(t,e),a=t=>(t.loaded=1,t.get()),s=t=>Object.keys(t).reduce(((e,r)=>(t[r].eager&&(e[r]=t[r]),e)),{}),l=(t,r,n)=>{var o=n?s(t[r]):t[r];return Object.keys(o).reduce(((t,r)=>!t||!o[t].loaded&&e(t,r)?r:t),0)},d=(t,e,n,o)=>"Unsatisfied version "+n+" from "+(n&&t[e][n].from)+" of shared singleton module "+e+" (required "+r(o)+")",u=t=>{throw new Error(t)},c=t=>{"undefined"!=typeof console&&console.warn&&console.warn(t)},f=t=>function(e,r,n,i,a){var s=o.I(e);return s&&s.then&&!n?s.then(t.bind(t,e,o.S[e],r,!1,i,a)):t(e,o.S[e],r,n,i,a)},h=(t,e,r)=>r?r():((t,e)=>u("Shared module "+e+" doesn't exist in shared scope "+t))(t,e),p=f(((t,e,r,o,s,u)=>{if(!i(e,r))return h(t,r,u);var f=l(e,r,o);return n(s,f)||c(d(e,r,f,s)),a(e[r][f])})),g={},w={22:()=>p("default","jquery",!1,[4,3,7,1],(()=>o.e(692).then((()=>()=>o(692)))))};[22].forEach((t=>{o.m[t]=e=>{g[t]=0,delete o.c[t];var r=w[t]();if("function"!=typeof r)throw new Error("Shared module is not available for eager consumption: "+t);e.exports=r()}}));var m={},v={};o.f.consumes=(t,e)=>{o.o(m,t)&&m[t].forEach((t=>{if(o.o(g,t))return e.push(g[t]);if(!v[t]){var r=e=>{g[t]=0,o.m[t]=r=>{delete o.c[t],r.exports=e()}};v[t]=!0;var n=e=>{delete g[t],o.m[t]=r=>{throw delete o.c[t],e}};try{var i=w[t]();i.then?e.push(g[t]=i.then(r).catch(n)):r(i)}catch(t){n(t)}}}))}})(),(()=>{var t={907:0,245:0,644:0};o.f.j=(e,r)=>{var n=o.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,o)=>n=t[e]=[r,o]));r.push(n[2]=i);var a=o.p+o.u(e),s=new Error;o.l(a,(r=>{if(o.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+e+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,n[1](s)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,i,[a,s,l]=r,d=0;if(a.some((e=>0!==t[e]))){for(n in s)o.o(s,n)&&(o.m[n]=s[n]);if(l)l(o)}for(e&&e(r);d{var t,e,r={553:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var n=r(22),o=r.n(n),i=r(288),a=r(505);const s={getOptions(t,e,r){r=r||{},0===t.length||o().nodeName(t[0],"body")||(r=this.getOptions(t.parent(),e,r));let n={};if(0!==t.length&&(n=t.data("pat-"+e),n&&"string"==typeof n)){const t={};o().each(n.split(";"),(function(e,r){(r=r.split(":")).reverse();let n=r.pop();n=n.replace(/^\s+|\s+$/g,""),r.reverse();let o=r.join(":");o=o.replace(/^\s+|\s+$/g,""),t[n]=o})),n=t}return o().extend(!0,{},r,n)}},l=a.A.getLogger("Patternslib Base"),d=function(t,e,r){t.jquery||(t=o()(t));const n=this.prototype.name,l=a.A.getLogger(`pat.${n}`);let d=t.data(`pattern-${n}`);if(void 0===d&&i.A.patterns[n])try{t.data(`pattern-${n}`,"initializing"),e="mockup"===this.prototype.parser?s.getOptions(t,n,e):e,d=new i.A.patterns[n](t,e,r)}catch(t){l.error(`Failed while initializing ${n} pattern.`,t)}return d},u=async function(t,e,r){t?.jquery&&0===t.length||!t?l.warn("No element given to pattern."):(t.jquery||(t=o()(t)),this.$el=t,this.el=t[0],this.options=o().extend(!0,{},this.defaults||{},e||{}),this.emit("pre-init"),await this.init(t,e,r),this.$el.data(`pattern-${this.name}`,this),this.el[`pattern-${this.name}`]=this,this.emit("init"))};u.prototype={constructor:u,on(t,e){this.$el.on(`${t}.${this.name}.patterns`,e)},one(t,e){this.$el.one(`${t}.${this.name}.patterns`,e)},emit(t,e){void 0===e&&(e=[]),this.$el.trigger(`${t}.${this.name}.patterns`,e)}},u.extend=function(t){const e=this;let r;if(!t)throw new Error("Pattern configuration properties required when calling Base.extend");r=Object.hasOwnProperty.call(t,"constructor")?t.constructor:function(){e.apply(this,arguments)},r.extend=u.extend,r.init=d,r.jquery_plugin=!0,r.trigger=t.trigger,r.parser=t?.parser||null;var n=function(){this.constructor=r};return n.prototype=e.prototype,r.prototype=new n,o().extend(!0,r.prototype,t),r.__super__=e.prototype,t.name?t.trigger?!1!==t.autoregister&&i.A.register(r,t.name):l.warn(`The pattern ${t.name} does not have a trigger attribute, it will not be registered.`):l.warn("This pattern without a name attribute will not be registered!"),r};const c=u},505:(t,e,r)=>{"use strict";var n,o;r.d(e,{A:()=>c}),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),r=this,n=function(){},o=function(){return r.apply(this instanceof n&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return n.prototype=this.prototype,o.prototype=new n,o});var i={DEBUG:10,INFO:20,WARN:30,ERROR:40,FATAL:50};function a(){}function s(t,e){this._loggers={},this.name=t||"",this._parent=e||null,e||(this._enabled=!0,this._level=i.WARN)}function l(t){o=t}a.prototype={output:function(t,e,r){t&&r.unshift(t+":"),e<=i.DEBUG?(r.unshift("[DEBUG]"),console.log.apply(console,r)):e<=i.INFO?console.info.apply(console,r):e<=i.WARN?console.warn.apply(console,r):console.error.apply(console,r)}},s.prototype={getLogger:function(t){for(var e=t.split("."),r=this,n=this.name?[this.name]:[];e.length;){var o=e.shift();n.push(o),o in r._loggers||(r._loggers[o]=new s(n.join("."),r)),r=r._loggers[o]}return r},_getFlag:function(t){var e=this;for(t="_"+t;null!==e;){if(void 0!==e[t])return e[t];e=e._parent}return null},setEnabled:function(t){this._enabled=!!t},isEnabled:function(){this._getFlag("enabled")},setLevel:function(t){"number"==typeof t?this._level=t:"string"==typeof t&&(t=t.toUpperCase())in i&&(this._level=i[t])},getLevel:function(){return this._getFlag("level")},log:function(t,e){!e.length||!this._getFlag("enabled")||t{"use strict";r.d(e,{A:()=>$});var n=r(22),o=r.n(n),i=r(505);const a=i.A.getLogger("core dom"),s="__patternslib__data_prefix__",l="__patternslib__style__display";function d(t,e,r=!1,n=!1){let o=window.getComputedStyle(t).getPropertyValue(e);return(r||n)&&(o=parseFloat(o)||0),r&&!n&&(o=parseInt(Math.round(o),10)),o}const u=(t,e=document.body)=>{e===window&&(e=document.body);const r=Math.abs(t.getBoundingClientRect().left+e.scrollLeft-e.getBoundingClientRect().left-h.get_css_value(e,"border-left-width",!0));return{top:Math.abs(t.getBoundingClientRect().top+e.scrollTop-e.getBoundingClientRect().top-h.get_css_value(e,"border-top-width",!0)),left:r}},c=(t,e,r)=>t[`${s}${e}`]||r,f=(t,e,r)=>{t[`${s}${e}`]=r},h={toNodeArray:t=>(t.jquery||t instanceof NodeList?t=[...t]:t instanceof Array==!1&&(t=[t]),t),querySelectorAllAndMe:(t,e)=>{if(!t)return[];const r=[...t.querySelectorAll(e)];return t.matches(e)&&r.unshift(t),r},wrap:(t,e)=>{t.parentNode.insertBefore(e,t),e.appendChild(t)},hide:t=>{"none"!==t.style.display&&(t.style.display&&(t[l]=t.style.display),t.style.display="none")},show:t=>{const e=t[l]||null;t.style.display=e,delete t[l]},find_parents:(t,e)=>{const r=[];let n=t;for(;n;)n=n.parentNode?.closest?.(e),n&&r.push(n);return r},find_scoped:(t,e)=>(0===e.indexOf("#")?document:t).querySelectorAll(e),get_parents:t=>{const e=[];let r=t?.parentNode;for(;r;)e.push(r),r=r?.parentNode,r=r instanceof HTMLElement?r:null;return e},acquire_attribute:(t,e,r=!1,n=!1)=>{let o=t;const i=[];for(;o;){const t=o.getAttribute(e);if(t||r&&""===t){if(!n)return t;i.push(t)}o=o.parentElement}if(n)return i},is_visible:t=>t.offsetWidth>0&&t.offsetHeight>0,is_input:t=>/^(?:input|select|textarea|button)$/i.test(t.nodeName),create_from_string:t=>document.createRange().createContextualFragment(t.trim()),get_css_value:d,find_scroll_container:(t,e,r=document.body)=>{for(;t&&t!==document.body;){if(!e||"y"===e){let e=d(t,"overflow-y");if(["auto","scroll"].includes(e))return t}if(!e||"x"===e){let e=d(t,"overflow-x");if(["auto","scroll"].includes(e))return t}t=t.parentElement}return r},get_scroll_x:t=>void 0!==t.scrollLeft?t.scrollLeft:t.scrollX,get_scroll_y:t=>void 0!==t.scrollTop?t.scrollTop:t.scrollY,get_relative_position:u,scroll_to_element:(t,e,r=0,n="top")=>{const o=u(t,e),i={behavior:"auto"};"top"!==n&&"both"!==n||(i.top=o.top-r),"left"!==n&&"both"!==n||(i.left=o.left-r),e.scrollTo(i)},scroll_to_top:(t=document.body,e=0)=>{t.scrollTo({top:0-e,behavior:"auto"})},scroll_to_bottom:(t=document.body,e=0)=>{const r=(t===window?document.body:t).scrollHeight;t.scrollTo({top:r-e,behavior:"auto"})},get_data:c,set_data:f,delete_data:(t,e)=>{delete t[`${s}${e}`]},template:(t,e={})=>(a.warn("Using dom.template is not recommended due to a problem with Content-Security-Policy."),new Function("return `"+t+"`;").call(e)),get_visible_ratio:(t,e)=>{if(!t)return 0;const r=t.getBoundingClientRect(),n=e!==window?e.getBoundingClientRect():{top:0,bottom:window.innerHeight};let o=0;if(r.topn.top){const t=r.bottom-r.top;o=(Math.min(r.bottom,n.bottom)-Math.max(r.top,n.top))/t}return o},escape_css_id:t=>`#${CSS.escape(t.split("#")[1])}`,element_uuid:t=>{if(!c(t,"uuid",!1)){let e;if(window.crypto.randomUUID)e=window.crypto.randomUUID();else{const t=new Uint32Array(4);e=window.crypto.getRandomValues(t).join("")}f(t,"uuid",e)}return c(t,"uuid")},find_form:t=>t.closest(".pat-subform")||t.form||t.querySelector("input, select, textarea, button")?.form||t.closest("form")},p=h;o().fn.safeClone=function(){return this.clone()},Array.prototype.forEach||(Array.prototype.forEach=function(t,e){var r,n;if(null===this)throw new TypeError(" this is null or not defined");var o=Object(this),i=o.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(arguments.length>1&&(r=e),n=0;n0===t))&&(e?n.top<=0+r&&n.bottom>=0+r:n.top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth))}var b={jqueryPlugin:function(t){return function(e,r){return 0===this.length?this:("object"==typeof e&&(r=e,e=void 0),"function"==typeof t?g.call(this,t,e,r):w.call(this,t,e,r))}},escapeRegExp:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isObject:m,extend:function(t){if(!m(t))return t;for(var e,r,n=1,o=arguments.length;n!r.test(t)));n.length?e.setAttribute("class",n.join(" ")):e.removeAttribute("class")}}},hideOrShow:(t,e,r,n)=>{t=p.toNodeArray(t);const i={none:{hide:"hide",show:"show"},fade:{hide:"fadeOut",show:"fadeIn"},slide:{hide:"slideUp",show:"slideDown"}},a="css"===r.transition||"none"===r.transition?null:r.effect.duration,s=t=>{t.classList.remove("in-progress"),t.classList.add(e?"visible":"hidden"),o()(t).trigger("pat-update",{pattern:n,action:"attribute-changed",dom:t,transition:"complete"})};for(const l of t)if(l.classList.remove("visible"),l.classList.remove("hidden"),l.classList.remove("in-progress"),a){const t=i[r.transition];l.classList.add("in-progress"),o()(l).trigger("pat-update",{pattern:n,action:"attribute-changed",dom:l,transition:"start"}),o()(l)[e?t.show:t.hide]({duration:a,easing:r.effect.easing,complete:()=>s(l)})}else"css"!==r.transition&&p[e?"show":"hide"](l),s(l)},addURLQueryParameter:function(t,e,r){var n=new RegExp("(\\?|\\&)"+e+"=.*?(?=(&|$))"),o=t.toString().split("#"),i=o[0],a=o[1],s=i;return s=n.test(i)?i.replace(n,"$1"+e+"="+r):/\?.+$/.test(i)?i+"&"+e+"="+r:i+"?"+e+"="+r,a&&(s+="#"+a),s},removeDuplicateObjects:function(t){const e=function(t,e){return this[t]===e};return t.reduce((function(t,r){let n=!1;for(const o of t)n=Object.keys(o).length===Object.keys(r).length&&0===Object.entries(o).filter((t=>!e.bind(r)(t[0],t[1]))).length;return n||t.push(r),t}),[])},mergeStack:function(t,e){const r=[];for(let t=0;tt?t:i])}return r},isElementInViewport:y,hasValue:function(t){return"INPUT"===t.tagName?"checkbox"===t.type||"radio"===t.type?t.checked:""!==t.value:"SELECT"===t.tagName?-1!==t.selectedIndex:"TEXTAREA"===t.tagName&&""!==t.value},parseTime:function(t){var e=/^(\d+(?:\.\d+)?)\s*(\w*)/.exec(t);if(!e)throw new Error("Invalid time");var r=parseFloat(e[1]);switch(e[2]){case"s":return Math.round(1e3*r);case"m":return Math.round(1e3*r*60);default:return Math.round(r)}},parseLength:function(t,e=null){const r=/^(\d+(?:\.\d+)?)\s*(\%?\w*)/.exec(t);if(!r)throw new Error("Invalid length");const n=parseFloat(r[1]);switch(r[2]){case"px":default:return Math.round(n);case"%":return e?e/100*Math.round(n):0;case"vw":return Math.round(n*window.innerWidth/100);case"vh":return Math.round(n*window.innerHeight/100);case"vmin":return Math.round(n*Math.min(window.innerWidth,window.innerHeight)/100);case"vmax":return Math.round(n*Math.max(window.innerWidth,window.innerHeight)/100)}},findRelatives:function(t){var e=o()(t),r=o()(t),n=o()();if(r=(r=r.add(e.closest("label"))).add(e.closest("fieldset")),t.id&&(n=o()("label[for='"+t.id+"']")),!n.length){var i=e.closest("form");i.length||(i=o()(document.body)),n=i.find("label[for='"+t.name+"']")}return r=r.add(n)},get_bounds:function(t){const e=t.getBoundingClientRect();return{x:parseInt(Math.round(e.x),10)||0,y:parseInt(Math.round(e.y),10)||0,top:parseInt(Math.round(e.top),10)||0,bottom:parseInt(Math.round(e.bottom),10)||0,left:parseInt(Math.round(e.left),10)||0,right:parseInt(Math.round(e.right),10)||0,width:parseInt(Math.round(e.width),10)||0,height:parseInt(Math.round(e.height),10)||0}},checkInputSupport:function(t,e){let r=!1;const n=document.createElement("input");return n.setAttribute("type",t),r=n.type==t,void 0!==e&&(n.setAttribute("value",e),r=n.value!==e),r},checkCSSFeature:(t,e,r="div")=>{let n=void 0!==(r=document.createElement(r)).style[t];return n&&void 0!==e&&(r.style[t]=e,n=r.style[t]===e),n},animation_frame:()=>new Promise(window.requestAnimationFrame),timeout:t=>new Promise((e=>setTimeout(e,t))),debounce:(t,e,r={timer:null},n=!0)=>(r.last_run=0,function(){const o=arguments;!n&&r.timer&&Date.now()-r.last_run<=e||(clearTimeout(r.timer),r.last_run=Date.now(),r.timer=setTimeout((()=>{t.apply(this,o)}),e))}),isIE:()=>!!document.documentMode,jqToNode:t=>(t.jquery&&(t=t[0]),t),ensureArray:(t,e)=>!!(NodeList.prototype.isPrototypeOf(t)||Array.isArray(t)||t.jquery)?e?[...t]:t:[t],localized_isodate:t=>{const e=t.getDate().toString().padStart(2,"0"),r=(t.getMonth()+1).toString().padStart(2,"0");return`${t.getFullYear().toString()}-${r}-${e}`},escape_html:t=>{if(!t)return"";const e=document.createElement("div");return e.appendChild(document.createTextNode(t)),e.innerHTML.replace(/"/g,""")},unescape_html:t=>{if(!t)return"";return(new DOMParser).parseFromString(t,"text/html").documentElement.textContent.replace(/"/g,'"')},is_iso_date_time:(t,e=!1)=>(e?/^\d{4}-[01]\d-[0-3]\d(T[0-2]\d:[0-5]\d)?$/:/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d$/).test(t),is_iso_date:t=>/^\d{4}-[01]\d-[0-3]\d$/.test(t),date_diff:(t,e)=>{const r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()),n=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate());return Math.floor((r-n)/864e5)},threshold_list:(t=0)=>{let e=[];for(let r=1;r<=t;r++)e.push(r/t);return e.push(0),e.sort()},is_option_truthy:t=>![void 0,null,"none",!1,"false",""].includes(t),elementInViewport:t=>(console.warn("Deprecated. Use utils.isElementInViewport"),y(t))};const _=b,x=i.A.getLogger("registry"),E=/patterns-disable=([^&]+)/g,A=/patterns-dont-catch/g,L={};let R,S=!1;for(;null!==(R=E.exec(window.location.search));)L[R[1]]=!0,x.info("Pattern disabled via url config:",R[1]);for(;null!==(R=A.exec(window.location.search));)S=!0,x.info("I will not catch init exceptions");void 0===window.__patternslib_registry&&(window.__patternslib_registry={});const T=window.__patternslib_registry;void 0===window.__patternslib_registry_initialized&&(window.__patternslib_registry_initialized=!1);const O={patterns:T,init(){o()(document).ready((function(){window.__patternslib_registry_initialized||(window.__patternslib_registry_initialized=!0,x.debug("Loaded: "+Object.keys(O.patterns).sort().join(", ")),O.scan(document.body),x.debug("Finished initial scan."))}))},clear(){for(const t in O.patterns)delete O.patterns[t]},transformPattern(t,e){if(L[t])return void x.debug(`Skipping disabled pattern: ${t}.`);const r=O.patterns[t],n=r.transform||r.prototype?.transform;if(n)try{n(o()(e))}catch(e){if(S)throw e;x.error(`Transform error for pattern ${t}.`,e)}},initPattern(t,e,r){const n=o()(e),a=O.patterns[t],s=i.A.getLogger(`pat.${t}`);if(e.matches(a.trigger)){s.debug("Initialising.",e);try{a.init?a.init(n,null,r):new a(n,null,r),s.debug("done.")}catch(t){if(S)throw t;s.error("Caught error:",t)}}},orderPatterns:t=>(t.includes("validation")&&(t.splice(t.indexOf("validation"),1),t.unshift("validation")),t.includes("clone-code")&&(t.splice(t.indexOf("clone-code"),1),t.unshift("clone-code")),t),scan(t,e,r){if(!t)return;if("string"==typeof t)t=document.querySelector(t);else{if(t instanceof Text)return;t.jquery&&(t=t[0])}const n=[];e=this.orderPatterns(e||Object.keys(O.patterns));for(const r of e){this.transformPattern(r,t);const e=O.patterns[r];e.trigger&&n.unshift(e.trigger)}let o=p.querySelectorAllAndMe(t,n.map((t=>t.trim().replace(/,$/,""))).join(","));o=o.filter((t=>!(t.matches(".disable-patterns")||t?.parentNode?.closest?.(".disable-patterns")||t?.parentNode?.closest?.("pre")||t?.parentNode?.closest?.("template")||t.matches(".cant-touch-this")||t?.parentNode?.closest?.(".cant-touch-this"))));for(const t of o.reverse())for(const n of e)this.initPattern(n,t,r);document.body.classList.add("patterns-loaded")},register(t,e){if(!(e=e||t.name))return x.error("Pattern lacks a name.",t),!1;if(O.patterns[e])return x.debug(`Already have a pattern called ${e}.`),!1;if(O.patterns[e]=t,t.jquery_plugin){const r=("pat-"+e).replace(/-([a-zA-Z])/g,(function(t,e){return e.toUpperCase()}));o().fn[r]=_.jqueryPlugin(t),o().fn[r.replace(/^pat/,"pattern")]=o().fn[r]}return x.debug(`Registered pattern ${e}`,t),window.__patternslib_registry_initialized&&(O.scan(document.body,[e]),x.debug(`Re-scanned dom with newly registered pattern ${e}.`)),!0}},$=O},245:(t,e,r)=>{"use strict";var n=r(288),o=(r(452),r(22)),i=r.n(o),a=r(553),s=r(505);s.A.setLevel("INFO");s.A.getLogger("datagridfield"),a.A.extend({name:"datagridfield",trigger:".pat-datagridfield",parser:"mockup",init:function(){r.e(267).then(r.bind(r,267)),this.el=this.$el[0],this.el_body=this.el.querySelector(".datagridwidget-body"),this.auto_append="false"!==(this.el.dataset.autoAppend||"true").toLowerCase(),this._defineHandler(),this.getVisibleRows().forEach((function(t){this.initRowUI(t)}),this),this.ensureMinimumRows()||this.updateOrderIndex(),this.initAutoAppendHandler(),this.el.dispatchEvent(new Event("afterdatagridfieldinit",{bubbles:!0,cancelable:!0}))},_defineHandler:function(){this.handler_auto_append=function(t){t&&t.stopPropagation(),t&&!t.target.closest(".datagridwidget-cell")||this.auto_append_row()}.bind(this),this.handler_auto_append_input=function(t){var e=t.currentTarget;e.classList.remove("auto-append"),e.dataset.oldIndex=e.dataset.index,delete e.dataset.index,this.updateOrderIndex(),e.removeEventListener("input",this.handler_auto_append_input)}.bind(this)},initRowUI:function(t){t.querySelectorAll(".dgf--row-add").forEach((function(e){e.addEventListener("click",function(e){e.preventDefault(),this.insertRow(t),this.updateOrderIndex()}.bind(this))}),this),t.querySelectorAll(".dgf--row-delete").forEach((function(e){e.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),this.removeFieldRow(t)}.bind(this))}),this),t.querySelectorAll(".dgf--row-moveup").forEach((function(e){e.addEventListener("click",function(e){e.preventDefault(),this.moveRowUp(t)}.bind(this))}),this),t.querySelectorAll(".dgf--row-movedown").forEach((function(e){e.addEventListener("click",function(e){e.preventDefault(),this.moveRowDown(t)}.bind(this))}),this)},get_row_buttons:function(t){return{add:t.querySelector(".dgf--row-add"),delete:t.querySelector(".dgf--row-delete"),up:t.querySelector(".dgf--row-moveup"),down:t.querySelector(".dgf--row-movedown")}},setUIState:function(){for(var t=this.getVisibleRows(),e=0;e0){var o=this.get_row_buttons(t[e-1]);o.down&&(o.down.disabled=!0)}}else 0===e?(n.add&&(n.add.disabled=!1),n.delete&&(n.delete.disabled=!1),n.up&&(n.up.disabled=!0),n.down&&(n.down.disabled=1===t.length)):e===t.length-1?(n.add&&(n.add.disabled=!1),n.delete&&(n.delete.disabled=!1),n.up&&(n.up.disabled=!1),n.down&&(n.down.disabled=!0)):(n.add&&(n.add.disabled=!1),n.delete&&(n.delete.disabled=!1),n.up&&(n.up.disabled=!1),n.down&&(n.down.disabled=!1))}},getRows:function(){return this.el_body.querySelectorAll(".datagridwidget-row")},getVisibleRows:function(){return this.el_body.querySelectorAll(".datagridwidget-row:not([data-index=TT])")},getLastRow:function(){return this.el_body.querySelector(".datagridwidget-row:last-child")},getLastVisibleRow:function(){var t=this.el_body.querySelectorAll(".datagridwidget-row:not([data-index=TT])");return t[t.length-1]},countRows:function(){var t=0;return this.getRows().forEach((function(e){-1===["AA","TT"].indexOf(e.dataset.index)&&t++}),this),t},initAutoAppendHandler:function(){if(this.auto_append){this.getVisibleRows().forEach((function(t){t.removeEventListener("focusout",this.handler_auto_append)}),this);var t=this.getLastVisibleRow();t&&t.addEventListener("focusout",this.handler_auto_append)}},auto_append_row:function(){this.el.dispatchEvent(new Event("beforeaddrowauto")),this.getVisibleRows().forEach((function(t){t.classList.remove("auto-append"),"TT"!==t.dataset.index&&(t.dataset.oldIndex=t.dataset.index,delete t.dataset.index)}));var t=this.getLastVisibleRow()||this.getLastRow(),e=this.insertRow(t);e.classList.add("auto-append"),this.reindexRow(e,"AA"),this.updateOrderIndex(),e.addEventListener("input",this.handler_auto_append_input),this.el.dispatchEvent(new Event("afteraddrowauto"))},insertRow:function(t,e){var r=this.createNewRow(),o=i()(r);return this.$el.trigger("beforeaddrow",[this.$el,o]),e?o.insertBefore(t):o.insertAfter(t),this.initRowUI(r),n.A.scan(o),this.initAutoAppendHandler(),this.$el.trigger("afteraddrow",[this.$el,o]),r},createNewRow:function(){var t=this.el_body.querySelector("[data-index=TT]");if(!t)throw new Error("Could not locate empty template row in DGF");var e=document.createElement("table");e.innerHTML=t.outerHTML,(e=e.querySelector("tr")).dataset.oldIndex=e.dataset.index,delete e.dataset.index,e.classList.remove("datagridwidget-empty-row");i()(e);const r="dgw-disabled-pat-";return e.querySelectorAll(`[class*="${r}"]`).forEach((t=>{t.classList.forEach((e=>{t.classList.replace(e,e.replace(r,"pat-"))}))})),e},removeFieldRow:function(t){i()(t).remove(),this.ensureMinimumRows()||this.updateOrderIndex(),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowDown:function(t){this.moveRow(t,"down"),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowUp:function(t){this.moveRow(t,"up"),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowToTop:function(t){var e=this.getRows();i()(t).insertBefore(e[0]),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRowToBottom:function(t){var e=this.getRows(),r=0;i()(e).each((function(t,e){-1===["AA","TT"].indexOf(e.dataset.index)&&(r=t)})),i()(t).insertAfter(e[r]),this.updateOrderIndex(),this.initAutoAppendHandler()},moveRow:function(t,e){var r,n=this.getRows(),o=null;if(i()(n).each((function(e,r){t===r&&(o=e)})),null!==o){var a=this.countRows();o+1==a?"down"==e?this.moveRowToTop(t):(r=n[o-1],this.shiftRow(r,t)):0===o?"up"==e?this.moveRowToBottom(t):(r=n[parseInt(o+1,10)],this.shiftRow(t,r)):"up"==e?(r=n[o-1],this.shiftRow(r,t)):(r=n[parseInt(o+1,10)],this.shiftRow(t,r)),this.$el.trigger("aftermoverow",[this.$el,t])}},shiftRow:function(t,e){i()(e).insertBefore(t)},reindexRow:function(t,e){var r=this.el_body.dataset.name_prefix+".",n=this.el_body.dataset.id_prefix+"-",o=t.dataset.oldIndex||t.dataset.index;function i(t,r,n){var i=t.getAttribute(r);if(i){var a=new RegExp("^"+n+o);t.setAttribute(r,i.replace(a,n+e))}}delete t.dataset.oldIndex,t.dataset.index=e,t.querySelectorAll('[id^="formfield-'+n+'"]').forEach((function(t){i(t,"id","formfield-"+n)}),this),t.querySelectorAll('[name^="'+r+'"]').forEach((function(t){i(t,"name",r)}),this),t.querySelectorAll('[id^="'+n+'"]').forEach((function(t){i(t,"id",n)}),this),t.querySelectorAll('[for^="'+n+'"]').forEach((function(t){i(t,"for",n)}),this),t.querySelectorAll('[href*="#'+n+'"]').forEach((function(t){i(t,"href","#"+n)}),this),t.querySelectorAll('[data-fieldname^="'+r+'"]').forEach((function(t){i(t,"data-fieldname",r)}),this)},updateOrderIndex:function(){var t=0;this.getRows().forEach((function(e){var r=e.dataset.index;["AA","TT"].indexOf(r)>-1?this.reindexRow(e,r):(this.reindexRow(e,t),e.dataset.index=t,t++)}),this);var e=this.el_body.dataset.name_prefix+".";this.el.querySelector('input[name="'+e+'count"]').value=this.countRows(),this.setUIState()},getParentRow:function(t){var e=t.closest(".datagridwidget-row");return e||null},ensureMinimumRows:function(){var t=this.getRows(),e=this.getVisibleRows();return!(!t.length||0!==e.length)&&(this.auto_append_row(),!0)}});n.A.init()},452:t=>{var e=function(t){"use strict";var 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",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new $(n||[]);return o(a,"_invoke",{value:R(t,r,s)}),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f="suspendedStart",h="suspendedYield",p="executing",g="completed",w={};function m(){}function v(){}function y(){}var b={};d(b,a,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(j([])));x&&x!==r&&n.call(x,a)&&(b=x);var E=y.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,s){var l=c(t[o],t,i);if("throw"!==l.type){var d=l.arg,u=d.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(u).then((function(t){d.value=t,a(d)}),(function(t){return r("throw",t,a,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function R(t,r,n){var o=f;return function(i,a){if(o===p)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var l=S(s,n);if(l){if(l===w)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var d=c(t,r,n);if("normal"===d.type){if(o=n.done?g:h,d.arg===w)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=g,n.method="throw",n.arg=d.arg)}}}function S(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),w;var i=c(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,w;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,w):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,w)}function T(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function $(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function j(t){if(null!=t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),d=n.call(a,"finallyLoc");if(l&&d){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),w}},catch:function(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;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:j(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),w}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={id:t,exports:{}};return r[t].call(i.exports,i,i.exports,o),i.exports}o.m=r,o.c=n,o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.f={},o.e=t=>Promise.all(Object.keys(o.f).reduce(((e,r)=>(o.f[r](t,e),e)),[])),o.u=t=>"chunks/"+t+"."+{267:"b05f3df573b06c619bb5",692:"283a97cd832931f6b9a9"}[t]+".min.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="collective-z3cform-datagridfield:",o.l=(r,n,i,a)=>{if(t[r])t[r].push(n);else{var s,l;if(void 0!==i)for(var d=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(h);var o=t[r];if(delete t[r],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((t=>t(n))),e)return e(n)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),l&&document.head.appendChild(s)}},o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{o.S={};var t={},e={};o.I=(r,n)=>{n||(n=[]);var i=e[r];if(i||(i=e[r]={}),!(n.indexOf(i)>=0)){if(n.push(i),t[r])return t[r];o.o(o.S,r)||(o.S[r]={});var a=o.S[r],s="collective-z3cform-datagridfield",l=[];if("default"===r)((t,e,r,n)=>{var o=a[t]=a[t]||{},i=o[e];(!i||!i.loaded&&(!n!=!i.eager?n:s>i.from))&&(o[e]={get:r,from:s,eager:!!n})})("jquery","3.7.1",(()=>o.e(692).then((()=>()=>o(692)))));return l.length?t[r]=Promise.all(l).then((()=>t[r]=1)):t[r]=1}}})(),(()=>{var t;o.g.importScripts&&(t=o.g.location+"");var e=o.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t})(),(()=>{var t=t=>{var e=t=>t.split(".").map((t=>+t==t?+t:t)),r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(t),n=r[1]?e(r[1]):[];return r[2]&&(n.length++,n.push.apply(n,e(r[2]))),r[3]&&(n.push([]),n.push.apply(n,e(r[3]))),n},e=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n=r.length)return"u"==i;var a=r[n],s=(typeof a)[0];if(i!=s)return"o"==i&&"n"==s||"s"==s||"u"==i;if("o"!=i&&"u"!=i&&o!=a)return o{var e=t[0],n="";if(1===t.length)return"*";if(e+.5){n+=0==e?">=":-1==e?"<":1==e?"^":2==e?"~":e>0?"=":"!=";for(var o=1,i=1;i0?".":"")+(o=2,s);return n}var a=[];for(i=1;i{if(0 in e){r=t(r);var o=e[0],i=o<0;i&&(o=-o-1);for(var a=0,s=1,l=!0;;s++,a++){var d,u,c=s=r.length||"o"==(u=(typeof(d=r[a]))[0]))return!l||("u"==c?s>o&&!i:""==c!=i);if("u"==u){if(!l||"u"!=c)return!1}else if(l)if(c==u)if(s<=o){if(d!=e[s])return!1}else{if(i?d>e[s]:dt&&o.o(t,e),a=t=>(t.loaded=1,t.get()),s=t=>Object.keys(t).reduce(((e,r)=>(t[r].eager&&(e[r]=t[r]),e)),{}),l=(t,r,n)=>{var o=n?s(t[r]):t[r];return Object.keys(o).reduce(((t,r)=>!t||!o[t].loaded&&e(t,r)?r:t),0)},d=(t,e,n,o)=>"Unsatisfied version "+n+" from "+(n&&t[e][n].from)+" of shared singleton module "+e+" (required "+r(o)+")",u=t=>{throw new Error(t)},c=t=>{"undefined"!=typeof console&&console.warn&&console.warn(t)},f=t=>function(e,r,n,i,a){var s=o.I(e);return s&&s.then&&!n?s.then(t.bind(t,e,o.S[e],r,!1,i,a)):t(e,o.S[e],r,n,i,a)},h=(t,e,r)=>r?r():((t,e)=>u("Shared module "+e+" doesn't exist in shared scope "+t))(t,e),p=f(((t,e,r,o,s,u)=>{if(!i(e,r))return h(t,r,u);var f=l(e,r,o);return n(s,f)||c(d(e,r,f,s)),a(e[r][f])})),g={},w={22:()=>p("default","jquery",!1,[4,3,7,1],(()=>o.e(692).then((()=>()=>o(692)))))};[22].forEach((t=>{o.m[t]=e=>{g[t]=0,delete o.c[t];var r=w[t]();if("function"!=typeof r)throw new Error("Shared module is not available for eager consumption: "+t);e.exports=r()}}));var m={907:[22]},v={};o.f.consumes=(t,e)=>{o.o(m,t)&&m[t].forEach((t=>{if(o.o(g,t))return e.push(g[t]);if(!v[t]){var r=e=>{g[t]=0,o.m[t]=r=>{delete o.c[t],r.exports=e()}};v[t]=!0;var n=e=>{delete g[t],o.m[t]=r=>{throw delete o.c[t],e}};try{var i=w[t]();i.then?e.push(g[t]=i.then(r).catch(n)):r(i)}catch(t){n(t)}}}))}})(),(()=>{var t={245:0,644:0,907:0};o.f.j=(e,r)=>{var n=o.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,o)=>n=t[e]=[r,o]));r.push(n[2]=i);var a=o.p+o.u(e),s=new Error;o.l(a,(r=>{if(o.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+e+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,n[1](s)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,i,[a,s,l]=r,d=0;if(a.some((e=>0!==t[e]))){for(n in s)o.o(s,n)&&(o.m[n]=s[n]);if(l)l(o)}for(e&&e(r);d {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","import $ from \"jquery\";\n\nvar parser = {\n getOptions($el, patternName, options) {\n /* This is the Mockup parser. An alternative parser for Patternslib\n * patterns.\n *\n * NOTE: Use of the Mockup parser is discouraged and is added here for\n * legacy support for the Plone Mockup project.\n *\n * It parses a DOM element for pattern configuration options.\n */\n options = options || {};\n // get options from parent element first, stop if element tag name is 'body'\n if ($el.length !== 0 && !$.nodeName($el[0], \"body\")) {\n options = this.getOptions($el.parent(), patternName, options);\n }\n // collect all options from element\n let elOptions = {};\n if ($el.length !== 0) {\n elOptions = $el.data(\"pat-\" + patternName);\n if (elOptions) {\n // parse options if string\n if (typeof elOptions === \"string\") {\n const tmpOptions = {};\n $.each(elOptions.split(\";\"), function (i, item) {\n item = item.split(\":\");\n item.reverse();\n let key = item.pop();\n key = key.replace(/^\\s+|\\s+$/g, \"\"); // trim\n item.reverse();\n let value = item.join(\":\");\n value = value.replace(/^\\s+|\\s+$/g, \"\"); // trim\n tmpOptions[key] = value;\n });\n elOptions = tmpOptions;\n }\n }\n }\n return $.extend(true, {}, options, elOptions);\n },\n};\n\nexport default parser;\n","/**\n * A Base pattern for creating scoped patterns. It's similar to Backbone's\n * Model class. The advantage of this approach is that each instance of a\n * pattern has its own local scope (closure).\n *\n * A new instance is created for each DOM element on which a pattern applies.\n *\n * You can assign values, such as $el, to `this` for an instance and they\n * will remain unique to that instance.\n *\n * Older Patternslib patterns on the other hand have a single global scope for\n * all DOM elements.\n */\nimport $ from \"jquery\";\nimport Registry from \"./registry\";\nimport logging from \"./logging\";\nimport mockupParser from \"./mockup-parser\";\n\nconst log = logging.getLogger(\"Patternslib Base\");\n\nconst initBasePattern = function ($el, options, trigger) {\n if (!$el.jquery) {\n $el = $($el);\n }\n const name = this.prototype.name;\n const plog = logging.getLogger(`pat.${name}`);\n let pattern = $el.data(`pattern-${name}`);\n if (pattern === undefined && Registry.patterns[name]) {\n try {\n // Immediately set the pattern instance to the temporary value\n // ``initializing`` before the async Base constructor is setting\n // the value later.\n // This prevents re-init the pattern on this element on multiple\n // initialization calls..\n $el.data(`pattern-${name}`, \"initializing\");\n options =\n this.prototype.parser === \"mockup\"\n ? mockupParser.getOptions($el, name, options)\n : options;\n pattern = new Registry.patterns[name]($el, options, trigger);\n } catch (e) {\n plog.error(`Failed while initializing ${name} pattern.`, e);\n }\n }\n return pattern;\n};\n\nconst Base = async function ($el, options, trigger) {\n if (($el?.jquery && $el.length === 0) || !$el) {\n log.warn(\"No element given to pattern.\");\n return;\n }\n if (!$el.jquery) {\n $el = $($el);\n }\n this.$el = $el;\n this.el = $el[0];\n this.options = $.extend(true, {}, this.defaults || {}, options || {});\n\n this.emit(\"pre-init\");\n\n await this.init($el, options, trigger);\n\n // Store pattern instance on element\n this.$el.data(`pattern-${this.name}`, this);\n this.el[`pattern-${this.name}`] = this;\n\n this.emit(\"init\");\n};\n\nBase.prototype = {\n constructor: Base,\n on(eventName, eventCallback) {\n this.$el.on(`${eventName}.${this.name}.patterns`, eventCallback);\n },\n one(eventName, eventCallback) {\n this.$el.one(`${eventName}.${this.name}.patterns`, eventCallback);\n },\n emit(eventName, args) {\n // args should be a list\n if (args === undefined) {\n args = [];\n }\n this.$el.trigger(`${eventName}.${this.name}.patterns`, args);\n },\n};\n\nBase.extend = function (patternProps) {\n /* Helper function to correctly set up the prototype chain for new patterns.\n */\n const parent = this;\n let child;\n\n // Check that the required configuration properties are given.\n if (!patternProps) {\n throw new Error(\n \"Pattern configuration properties required when calling Base.extend\"\n );\n }\n\n // The constructor function for the new subclass is either defined by you\n // (the \"constructor\" property in your `extend` definition), or defaulted\n // by us to simply call the parent's constructor.\n if (Object.hasOwnProperty.call(patternProps, \"constructor\")) {\n child = patternProps.constructor;\n } else {\n child = function () {\n parent.apply(this, arguments);\n };\n }\n\n // Allow patterns to be extended indefinitely\n child.extend = Base.extend;\n\n // Static properties required by the Patternslib registry\n child.init = initBasePattern;\n child.jquery_plugin = true;\n child.trigger = patternProps.trigger;\n child.parser = patternProps?.parser || null;\n\n // Set the prototype chain to inherit from `parent`, without calling\n // `parent`'s constructor function.\n var Surrogate = function () {\n this.constructor = child;\n };\n Surrogate.prototype = parent.prototype;\n child.prototype = new Surrogate();\n\n // Add pattern's configuration properties (instance properties) to the subclass,\n $.extend(true, child.prototype, patternProps);\n\n // Set a convenience property in case the parent's prototype is needed\n // later.\n child.__super__ = parent.prototype;\n\n // Register the pattern in the Patternslib registry.\n if (!patternProps.name) {\n log.warn(\"This pattern without a name attribute will not be registered!\");\n } else if (!patternProps.trigger) {\n log.warn(\n `The pattern ${patternProps.name} does not have a trigger attribute, it will not be registered.`\n );\n } else if (patternProps.autoregister !== false) {\n Registry.register(child, patternProps.name);\n }\n return child;\n};\n\nexport default Base;\n","/**\n * Patterns logging - minimal logging framework\n *\n * Copyright 2012 Simplon B.V.\n */\n\n// source: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind\nif (!Function.prototype.bind) {\n Function.prototype.bind = function (oThis) {\n if (typeof this !== \"function\") {\n // closest thing possible to the ECMAScript 5 internal IsCallable function\n throw new TypeError(\n \"Function.prototype.bind - what is trying to be bound is not callable\"\n );\n }\n\n var aArgs = Array.prototype.slice.call(arguments, 1),\n fToBind = this,\n fNOP = function () {},\n fBound = function () {\n return fToBind.apply(\n this instanceof fNOP && oThis ? this : oThis,\n aArgs.concat(Array.prototype.slice.call(arguments))\n );\n };\n fNOP.prototype = this.prototype;\n fBound.prototype = new fNOP();\n\n return fBound;\n };\n}\n\nvar root, // root logger instance\n writer; // writer instance, used to output log entries\n\nvar Level = {\n DEBUG: 10,\n INFO: 20,\n WARN: 30,\n ERROR: 40,\n FATAL: 50,\n};\n\nfunction ConsoleWriter() {}\n\nConsoleWriter.prototype = {\n output: function (log_name, level, messages) {\n if (log_name) messages.unshift(log_name + \":\");\n if (level <= Level.DEBUG) {\n // console.debug exists but is deprecated\n messages.unshift(\"[DEBUG]\");\n console.log.apply(console, messages);\n } else if (level <= Level.INFO) console.info.apply(console, messages);\n else if (level <= Level.WARN) console.warn.apply(console, messages);\n else console.error.apply(console, messages);\n },\n};\n\nfunction Logger(name, parent) {\n this._loggers = {};\n this.name = name || \"\";\n this._parent = parent || null;\n if (!parent) {\n this._enabled = true;\n this._level = Level.WARN;\n }\n}\n\nLogger.prototype = {\n getLogger: function (name) {\n var path = name.split(\".\"),\n root = this,\n route = this.name ? [this.name] : [];\n while (path.length) {\n var entry = path.shift();\n route.push(entry);\n if (!(entry in root._loggers))\n root._loggers[entry] = new Logger(route.join(\".\"), root);\n root = root._loggers[entry];\n }\n return root;\n },\n\n _getFlag: function (flag) {\n var context = this;\n flag = \"_\" + flag;\n while (context !== null) {\n if (context[flag] !== undefined) return context[flag];\n context = context._parent;\n }\n return null;\n },\n\n setEnabled: function (state) {\n this._enabled = !!state;\n },\n\n isEnabled: function () {\n this._getFlag(\"enabled\");\n },\n\n setLevel: function (level) {\n if (typeof level === \"number\") this._level = level;\n else if (typeof level === \"string\") {\n level = level.toUpperCase();\n if (level in Level) this._level = Level[level];\n }\n },\n\n getLevel: function () {\n return this._getFlag(\"level\");\n },\n\n log: function (level, messages) {\n if (\n !messages.length ||\n !this._getFlag(\"enabled\") ||\n level < this._getFlag(\"level\")\n )\n return;\n messages = Array.prototype.slice.call(messages);\n writer.output(this.name, level, messages);\n },\n\n debug: function () {\n this.log(Level.DEBUG, arguments);\n },\n\n info: function () {\n this.log(Level.INFO, arguments);\n },\n\n warn: function () {\n this.log(Level.WARN, arguments);\n },\n\n error: function () {\n this.log(Level.ERROR, arguments);\n },\n\n fatal: function () {\n this.log(Level.FATAL, arguments);\n },\n};\n\nfunction getWriter() {\n return writer;\n}\n\nfunction setWriter(w) {\n writer = w;\n}\n\nsetWriter(new ConsoleWriter());\n\nroot = new Logger();\n\nvar logconfig = /loglevel(|-[^=]+)=([^&]+)/g,\n match;\n\nwhile ((match = logconfig.exec(window.location.search)) !== null) {\n var logger = match[1] === \"\" ? root : root.getLogger(match[1].slice(1));\n logger.setLevel(match[2].toUpperCase());\n}\n\nvar api = {\n Level: Level,\n getLogger: root.getLogger.bind(root),\n setEnabled: root.setEnabled.bind(root),\n isEnabled: root.isEnabled.bind(root),\n setLevel: root.setLevel.bind(root),\n getLevel: root.getLevel.bind(root),\n debug: root.debug.bind(root),\n info: root.info.bind(root),\n warn: root.warn.bind(root),\n error: root.error.bind(root),\n fatal: root.fatal.bind(root),\n getWriter: getWriter,\n setWriter: setWriter,\n};\n\nexport default api;\n","/* Utilities for DOM traversal or navigation */\nimport logging from \"./logging\";\n\nconst logger = logging.getLogger(\"core dom\");\n\nconst DATA_PREFIX = \"__patternslib__data_prefix__\";\nconst DATA_STYLE_DISPLAY = \"__patternslib__style__display\";\n\n/**\n * Return an array of DOM nodes.\n *\n * @param {Node|NodeList|jQuery} nodes - The DOM node to start the search from.\n *\n * @returns {Array} - An array of DOM nodes.\n */\nconst toNodeArray = (nodes) => {\n if (nodes.jquery || nodes instanceof NodeList) {\n // jQuery or document.querySelectorAll\n nodes = [...nodes];\n } else if (nodes instanceof Array === false) {\n nodes = [nodes];\n }\n return nodes;\n};\n\n/**\n * Like querySelectorAll but including the element where it starts from.\n * Returns an Array, not a NodeList\n *\n * @param {Node} el - The DOM node to start the search from.\n *\n * @returns {Array} - The DOM nodes found.\n */\nconst querySelectorAllAndMe = (el, selector) => {\n if (!el) {\n return [];\n }\n\n const all = [...el.querySelectorAll(selector)];\n if (el.matches(selector)) {\n all.unshift(el); // start element should be first.\n }\n return all;\n};\n\n/**\n * Wrap a element with a wrapper element.\n *\n * The element to be wrapped will be moved into the wrapper element and the\n * wrapper element is placed just before the old element was.\n *\n * @param {Node} el - The DOM node to wrap.\n * @param {Node} wrapper - The wrapper element.\n */\nconst wrap = (el, wrapper) => {\n // See: https://stackoverflow.com/a/13169465/1337474\n el.parentNode.insertBefore(wrapper, el);\n wrapper.appendChild(el);\n};\n\n/**\n * Hides the element with ``display: none`` and stores the current display value.\n *\n * @param {Node} el - The DOM node to hide.\n */\nconst hide = (el) => {\n if (el.style.display === \"none\") {\n // Nothing to do.\n return;\n }\n if (el.style.display) {\n el[DATA_STYLE_DISPLAY] = el.style.display;\n }\n el.style.display = \"none\";\n};\n\n/**\n * Shows element by removing ``display: none`` and restoring the display value\n * to whatever it was before.\n *\n * @param {Node} el - The DOM node to show.\n */\nconst show = (el) => {\n const val = el[DATA_STYLE_DISPLAY] || null;\n el.style.display = val;\n delete el[DATA_STYLE_DISPLAY];\n};\n\n/**\n * Test, if a element is visible or not.\n *\n * @param {Node} el - The DOM node to test.\n * @returns {Boolean} - True if the element is visible.\n */\nconst is_visible = (el) => {\n // Check, if element is visible in DOM.\n // https://stackoverflow.com/a/19808107/1337474\n return el.offsetWidth > 0 && el.offsetHeight > 0;\n};\n\n/**\n * Test, if a element is a input-type element.\n *\n * This is taken from Sizzle/jQuery at:\n * https://github.com/jquery/sizzle/blob/f2a2412e5e8a5d9edf168ae3b6633ac8e6bd9f2e/src/sizzle.js#L139\n * https://github.com/jquery/sizzle/blob/f2a2412e5e8a5d9edf168ae3b6633ac8e6bd9f2e/src/sizzle.js#L1773\n *\n * @param {Node} el - The DOM node to test.\n * @returns {Boolean} - True if the element is a input-type element.\n */\nconst is_input = (el) => {\n const re_input = /^(?:input|select|textarea|button)$/i;\n return re_input.test(el.nodeName);\n};\n\n/**\n * Return all direct parents of ``el`` matching ``selector``.\n * This matches against all parents but not the element itself.\n * The order of elements is from the search starting point up to higher\n * DOM levels.\n *\n * @param {Node} el - The DOM node to start the search from.\n * @param {String} selector - CSS selector to match against.\n * @returns {Array} - List of matching DOM nodes.\n */\nconst find_parents = (el, selector) => {\n const ret = [];\n let parent = el;\n while (parent) {\n parent = parent.parentNode?.closest?.(selector);\n if (parent) ret.push(parent);\n }\n return ret;\n};\n\n/**\n * Find an element in the whole DOM tree if the selector is an ID selector,\n * otherwise use the given element as the starting point.\n *\n * @param {Node} el - The DOM node to start the search from.\n * @param {String} selector - The CSS selector to search for.\n *\n * @returns {NodeList} - The DOM nodes found.\n *\n */\nconst find_scoped = (el, selector) => {\n // If the selector starts with an object id do a global search,\n // otherwise do a local search.\n return (selector.indexOf(\"#\") === 0 ? document : el).querySelectorAll(selector);\n};\n\n/**\n * Return all HTMLElement parents of el, starting from the direct parent of el.\n * The document itself is excluded because it's not a real DOM node.\n *\n * @param {Node} el - The DOM node to start the search from.\n *\n * @returns {Array} - The DOM nodes found.\n */\nconst get_parents = (el) => {\n // Return all HTMLElement parents of el, starting from the direct parent of el.\n const parents = [];\n let parent = el?.parentNode;\n while (parent) {\n parents.push(parent);\n parent = parent?.parentNode;\n parent = parent instanceof HTMLElement ? parent : null;\n }\n return parents;\n};\n\n/**\n * Return the value of the first attribute found in the list of parents.\n *\n * @param {Node} el - The DOM element to start the acquisition search for the given attribute.\n * @param {string} attribute - Name of the attribute to search for.\n * @param {Boolean} include_empty - Also return empty values.\n * @param {Boolean} include_all - Return a list of attribute values found in all parents.\n *\n * @returns {*} - Returns the value of the searched attribute or a list of all attributes.\n */\nconst acquire_attribute = (\n el,\n attribute,\n include_empty = false,\n include_all = false\n) => {\n let _el = el;\n const ret = []; // array for ``include_all`` mode.\n while (_el) {\n const val = _el.getAttribute(attribute);\n if (val || (include_empty && val === \"\")) {\n if (!include_all) {\n return val;\n }\n ret.push(val);\n }\n _el = _el.parentElement;\n }\n if (include_all) {\n return ret;\n }\n};\n\n/**\n * Return a DocumentFragment from a given string.\n *\n * @param {String} string - The HTML structure as a string.\n *\n * @returns {DocumentFragment} - The DOM nodes as a DocumentFragment.\n */\nconst create_from_string = (string) => {\n // See: https://davidwalsh.name/convert-html-stings-dom-nodes\n return document.createRange().createContextualFragment(string.trim());\n};\n\n/**\n * Return a CSS property value for a given DOM node.\n * For length-values, relative values are converted to pixels.\n * Optionally parse as pixels, if applicable.\n *\n * Note: The element must be attached to the body to make CSS caluclations work.\n *\n * @param {Node} el - DOM node.\n * @param {String} property - CSS property to query on DOM node.\n * @param {Boolean} [as_pixels=false] - Convert value to pixels, if applicable.\n * @param {Boolean} [as_float=false] - Convert value to float, if applicable.\n *\n * @returns {(String|Number)} - The CSS value to return.\n */\nfunction get_css_value(el, property, as_pixels = false, as_float = false) {\n let value = window.getComputedStyle(el).getPropertyValue(property);\n if (as_pixels || as_float) {\n value = parseFloat(value) || 0.0;\n }\n if (as_pixels && !as_float) {\n value = parseInt(Math.round(value), 10);\n }\n return value;\n}\n\n/**\n * Find a scrollable element up in the DOM tree.\n *\n * Note: Setting the ``overflow`` shorthand property also sets the individual overflow-y and overflow-y properties.\n *\n * @param {Node} el - The DOM element to start the search on.\n * @param {String} [direction=] - Not given: Search for any scrollable element up in the DOM tree.\n * ``x``: Search for a horizontally scrollable element.\n * ``y``: Search for a vertically scrollable element.\n * @param {(Node|null)} [fallback=document.body] - Fallback, if no scroll container can be found.\n * The default is to use document.body.\n *\n * @returns {Node} - Return the first scrollable element.\n * If no other element could be found, document.body would be returned.\n */\nconst find_scroll_container = (el, direction, fallback = document.body) => {\n while (el && el !== document.body) {\n if (!direction || direction === \"y\") {\n let overflow_y = get_css_value(el, \"overflow-y\");\n if ([\"auto\", \"scroll\"].includes(overflow_y)) {\n return el;\n }\n }\n if (!direction || direction === \"x\") {\n let overflow_x = get_css_value(el, \"overflow-x\");\n if ([\"auto\", \"scroll\"].includes(overflow_x)) {\n return el;\n }\n }\n el = el.parentElement;\n }\n return fallback;\n};\n\n/**\n * Get the horizontal scroll position.\n *\n * @param {Node} scroll_reference - The element to get the scroll position from.\n *\n * @returns {number} The horizontal scroll position.\n */\nconst get_scroll_x = (scroll_reference) => {\n // scroll_listener == window: window.scrollX\n // scroll_listener == html: html.scrollLeft == window.scrollX\n // scroll_listener == DOM node: node.scrollLeft\n return typeof scroll_reference.scrollLeft !== \"undefined\"\n ? scroll_reference.scrollLeft\n : scroll_reference.scrollX;\n};\n\n/**\n * Get the vertical scroll position.\n *\n * @param {Node} scroll_reference - The element to get the scroll position from.\n *\n * @returns {number} The vertical scroll position.\n */\nconst get_scroll_y = (scroll_reference) => {\n // scroll_listener == window: window.scrollY\n // scroll_listener == html: html.scrollTop == window.scrollY\n // scroll_listener == DOM node: node.scrollTop\n return typeof scroll_reference.scrollTop !== \"undefined\"\n ? scroll_reference.scrollTop\n : scroll_reference.scrollY;\n};\n\n/**\n * Get the elements position relative to another element.\n *\n * @param {Node} el - The DOM element to get the position for.\n * @param {Node} [reference_el=document.body] - The DOM element to get the position relative to.\n *\n * @returns {{top: number, left: number}} - The position of the element relative to the other element.\n */\nconst get_relative_position = (el, reference_el = document.body) => {\n // Get the reference element to which against we calculate\n // the relative position of the target.\n // In case of a scroll container of window, we do not have\n // getBoundingClientRect method, so get the body instead.\n if (reference_el === window) {\n reference_el = document.body;\n }\n\n // Calculate absolute [¹] position difference between\n // scroll_container and scroll_target.\n // Substract the container's border from the scrolling\n // value, as this one isn't respected by\n // getBoundingClientRect [²] and would lead to covered\n // items [³].\n // ¹) so that it doesn't make a difference, if the element\n // is below or above the scrolling container. We just need\n // to know the absolute difference.\n // ²) Calculations are based from the viewport.\n // ³) See:\n // https://docs.microsoft.com/en-us/previous-versions//hh781509(v=vs.85)\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect\n const left = Math.abs(\n el.getBoundingClientRect().left +\n reference_el.scrollLeft -\n reference_el.getBoundingClientRect().left -\n dom.get_css_value(reference_el, \"border-left-width\", true)\n );\n const top = Math.abs(\n el.getBoundingClientRect().top +\n reference_el.scrollTop -\n reference_el.getBoundingClientRect().top -\n dom.get_css_value(reference_el, \"border-top-width\", true)\n );\n\n return { top, left };\n};\n\n/**\n * Scroll to a given element.\n * The element will be scrolled to the top of the scroll container.\n *\n * @param {Node} el - The element which should be scrolled to.\n * @param {Node} scroll_container - The element which is scrollable.\n * @param {number} [offset=0] - Optional offset in pixels to stop scrolling before the target position. Can also be a negative number.\n * @param {string} [direction=\"top\"] - The direction to scroll to. Can be either \"top\", \"left\" or \"both\".\n */\nconst scroll_to_element = (el, scroll_container, offset = 0, direction = \"top\") => {\n // Get the position of the element relative to the scroll container.\n const position = get_relative_position(el, scroll_container);\n\n const options = { behavior: \"auto\" };\n if (direction === \"top\" || direction === \"both\") {\n options.top = position.top - offset;\n }\n if (direction === \"left\" || direction === \"both\") {\n options.left = position.left - offset;\n }\n\n // Scroll to the target position.\n scroll_container.scrollTo(options);\n};\n\n/**\n * Scroll to the top of a scrolling container.\n *\n * @param {Node} [scroll_container = document.body] - The element which is scrollable.\n * @param {number} [offset=0] - Optional offset in pixels to stop scrolling before the target position. Can also be a negative number.\n */\nconst scroll_to_top = (scroll_container = document.body, offset = 0) => {\n // Just scroll up, period.\n scroll_container.scrollTo({ top: 0 - offset, behavior: \"auto\" });\n};\n\n/**\n * Scroll to the bottom of a scrolling container.\n *\n * @param {Node} [scroll_container = document.body] - The element which is scrollable.\n * @param {number} [offset=0] - Optional offset in pixels to stop scrolling before the target position. Can also be a negative number.\n */\nconst scroll_to_bottom = (scroll_container = document.body, offset = 0) => {\n // Just scroll up, period.\n //\n const top = (scroll_container === window ? document.body : scroll_container)\n .scrollHeight;\n scroll_container.scrollTo({ top: top - offset, behavior: \"auto\" });\n};\n\n/**\n * Get data stored directly on the node instance.\n * We are using a prefix to make sure the data doesn't collide with other attributes.\n *\n * @param el {Node} - The DOM node from which we want to retrieve the data.\n * @param name {String} - The name of the variable. Note - this is stored on\n * the DOM node prefixed with the DATA_PREFIX.\n * @param default_value {Any} - Optional default value.\n * @returns {Any} - The value which is stored on the DOM node.\n */\nconst get_data = (el, name, default_value) => {\n return el[`${DATA_PREFIX}${name}`] || default_value;\n};\n\n/**\n * Set and store data directly on the node instance.\n * We are using a prefix to make sure the data doesn't collide with other attributes.\n *\n * @param el {Node} - The DOM node which we want to store the data on.\n * @param name {String} - The name of the variable. Note - this is stored on\n * the DOM node prefixed with the DATA_PREFIX.\n * @param value {Any} - The value we want to store on the DOM node.\n */\nconst set_data = (el, name, value) => {\n el[`${DATA_PREFIX}${name}`] = value;\n};\n\n/**\n * Delete a variable from the node instance.\n * We are using a prefix to make sure the data doesn't collide with other attributes.\n *\n * @param el {Node} - The DOM node which we want to delete the variable from.\n * @param name {String} - The name of the variable. Note - this is stored on\n * the DOM node prefixed with the DATA_PREFIX.\n */\nconst delete_data = (el, name) => {\n delete el[`${DATA_PREFIX}${name}`];\n};\n\n/**\n * Simple template engine, based on JS template literal\n *\n * NOTE: This uses eval and would break if Content-Security-Policy does not\n * allow 'unsafe-eval'.\n * Because of this CSR problem the use of this method is not recommended.\n *\n * Please note: You cannot pass a template literal as template_string.\n * JavaScript itself would try to expand it and would fail.\n *\n * See: https://stackoverflow.com/a/37217166/1337474\n *\n * @param {String} template_string - The template string as a JavaScript template literal.\n * For each variable in the template you have to use ``this``.\n * E.g. if you pass ``{message: \"ok\"}`` as template_variables, you can use it like so:\n * `

${this.message}

`\n * @param {Object} template_variables - Object literal with all the variables which should be used in the template.\n *\n * @returns {String} - Returns the a string as template expanded with the template_variables.\n */\nconst template = (template_string, template_variables = {}) => {\n logger.warn(\n \"Using dom.template is not recommended due to a problem with Content-Security-Policy.\"\n );\n return new Function(\"return `\" + template_string + \"`;\").call(template_variables);\n};\n\n/**\n * Get the visible ratio of an element compared to container.\n * If no container is given, the viewport is used.\n *\n * Note: currently only vertical ratio is supported.\n *\n * @param {Node} el - The element to get the visible ratio from.\n * @param {Node} [container] - The container to compare the element to.\n * @returns {number} - The visible ratio of the element.\n * 0 means the element is not visible.\n * 1 means the element is fully visible.\n */\nconst get_visible_ratio = (el, container) => {\n if (!el) {\n return 0;\n }\n\n const rect = el.getBoundingClientRect();\n const container_rect =\n container !== window\n ? container.getBoundingClientRect()\n : {\n top: 0,\n bottom: window.innerHeight,\n };\n\n let visible_ratio = 0;\n if (rect.top < container_rect.bottom && rect.bottom > container_rect.top) {\n const rect_height = rect.bottom - rect.top;\n const visible_height =\n Math.min(rect.bottom, container_rect.bottom) -\n Math.max(rect.top, container_rect.top);\n visible_ratio = visible_height / rect_height;\n }\n\n return visible_ratio;\n};\n\n/**\n * Get an escaped CSS selector for a given id string.\n *\n * id selectors should - but don't have to - start with a letter.\n * If the id starts with a number or a dash, it should be escaped.\n * This method does that for you.\n *\n * Alse see:\n * - https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id\n * - https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape\n *\n * @param {String} id - The id to escape.\n *\n * @returns {String} - The escaped CSS selector.\n *\n * @example\n * escape_css_id_selector(\"#123\"); // returns \"#\\\\31 23\"\"\n * escape_css_id_selector(\"#-123\"); // returns \"#-\\\\31 23\"\n */\nconst escape_css_id = (id) => {\n return `#${CSS.escape(id.split(\"#\")[1])}`;\n};\n\n/**\n * Get a universally unique id (uuid) for a DOM element.\n *\n * This method returns a uuid for the given element. On the first call it will\n * generate a uuid and store it on the element.\n *\n * @param {Node} el - The DOM node to get the uuid for.\n * @returns {String} - The uuid.\n */\nconst element_uuid = (el) => {\n if (!get_data(el, \"uuid\", false)) {\n let uuid;\n if (window.crypto.randomUUID) {\n // Create a real UUID\n // window.crypto.randomUUID does only exist in browsers with secure\n // context.\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID\n uuid = window.crypto.randomUUID();\n } else {\n // Create a sufficiently unique ID\n const array = new Uint32Array(4);\n uuid = window.crypto.getRandomValues(array).join(\"\");\n }\n set_data(el, \"uuid\", uuid);\n }\n return get_data(el, \"uuid\");\n};\n\n/**\n * Find a related form element.\n *\n * @param {Node} el - The DOM node to start the search from.\n * @returns {Node} - The closest form element.\n *\n * @example\n * find_form(document.querySelector(\"input\"));\n */\nconst find_form = (el) => {\n // Prefer input.form which allows for input outside form elements and fall\n // back to search for a parent form.\n const form =\n el.closest(\".pat-subform\") || // Special Patternslib subform concept has precedence.\n el.form ||\n el.querySelector(\"input, select, textarea, button\")?.form ||\n el.closest(\"form\");\n return form;\n};\n\nconst dom = {\n toNodeArray: toNodeArray,\n querySelectorAllAndMe: querySelectorAllAndMe,\n wrap: wrap,\n hide: hide,\n show: show,\n find_parents: find_parents,\n find_scoped: find_scoped,\n get_parents: get_parents,\n acquire_attribute: acquire_attribute,\n is_visible: is_visible,\n is_input: is_input,\n create_from_string: create_from_string,\n get_css_value: get_css_value,\n find_scroll_container: find_scroll_container,\n get_scroll_x: get_scroll_x,\n get_scroll_y: get_scroll_y,\n get_relative_position: get_relative_position,\n scroll_to_element: scroll_to_element,\n scroll_to_top: scroll_to_top,\n scroll_to_bottom: scroll_to_bottom,\n get_data: get_data,\n set_data: set_data,\n delete_data: delete_data,\n template: template,\n get_visible_ratio: get_visible_ratio,\n escape_css_id: escape_css_id,\n element_uuid: element_uuid,\n find_form: find_form,\n};\n\nexport default dom;\n","import $ from \"jquery\";\nimport dom from \"./dom\";\n\nconst _MS_PER_DAY = 1000 * 60 * 60 * 24; // Milliseconds per day.\n\n$.fn.safeClone = function () {\n var $clone = this.clone();\n return $clone;\n};\n\n// Production steps of ECMA-262, Edition 5, 15.4.4.18\n// Reference: http://es5.github.io/#x15.4.4.18\nif (!Array.prototype.forEach) {\n Array.prototype.forEach = function (callback, thisArg) {\n var T, k;\n if (this === null) {\n throw new TypeError(\" this is null or not defined\");\n }\n // 1. Let O be the result of calling ToObject passing the |this| value as the argument.\n var O = Object(this);\n // 2. Let lenValue be the result of calling the Get internal method of O with the argument \"length\".\n // 3. Let len be ToUint32(lenValue).\n var len = O.length >>> 0;\n // 4. If IsCallable(callback) is false, throw a TypeError exception.\n // See: http://es5.github.com/#x9.11\n if (typeof callback !== \"function\") {\n throw new TypeError(callback + \" is not a function\");\n }\n // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\n if (arguments.length > 1) {\n T = thisArg;\n }\n // 6. Let k be 0\n k = 0;\n // 7. Repeat, while k < len\n while (k < len) {\n var kValue;\n // a. Let Pk be ToString(k).\n // This is implicit for LHS operands of the in operator\n // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk.\n // This step can be combined with c\n // c. If kPresent is true, then\n if (k in O) {\n // i. Let kValue be the result of calling the Get internal method of O with argument Pk.\n kValue = O[k];\n // ii. Call the Call internal method of callback with T as the this value and\n // argument list containing kValue, k, and O.\n callback.call(T, kValue, k, O);\n }\n // d. Increase k by 1.\n k++;\n }\n // 8. return undefined\n };\n}\n\nvar singleBoundJQueryPlugin = function (pattern, method, options) {\n /* This is a jQuery plugin for patterns which are invoked ONCE FOR EACH\n * matched element in the DOM.\n *\n * This is how the Mockup-type patterns behave. They are constructor\n * functions which need to be invoked once per jQuery-wrapped DOM node\n * for all DOM nodes on which the pattern applies.\n */\n var $this = this;\n $this.each(function () {\n var pat,\n $el = $(this);\n pat = pattern.init($el, options);\n if (method) {\n if (pat[method] === undefined) {\n $.error(\n \"Method \" + method + \" does not exist on jQuery.\" + pattern.name\n );\n return false;\n }\n if (method.charAt(0) === \"_\") {\n $.error(\"Method \" + method + \" is private on jQuery.\" + pattern.name);\n return false;\n }\n pat[method].apply(pat, [options]);\n }\n });\n return $this;\n};\n\nvar pluralBoundJQueryPlugin = function (pattern, method, options) {\n /* This is a jQuery plugin for patterns which are invoked ONCE FOR ALL\n * matched elements in the DOM.\n *\n * This is how the vanilla Patternslib-type patterns behave. They are\n * simple objects with an init method and this method gets called once\n * with a list of jQuery-wrapped DOM nodes on which the pattern\n * applies.\n */\n var $this = this;\n if (method) {\n if (pattern[method]) {\n return pattern[method].apply($this, [$this].concat([options]));\n } else {\n $.error(\"Method \" + method + \" does not exist on jQuery.\" + pattern.name);\n }\n } else {\n pattern.init.apply($this, [$this].concat([options]));\n }\n return $this;\n};\n\nvar jqueryPlugin = function (pattern) {\n return function (method, options) {\n var $this = this;\n if ($this.length === 0) {\n return $this;\n }\n if (typeof method === \"object\") {\n options = method;\n method = undefined;\n }\n if (typeof pattern === \"function\") {\n return singleBoundJQueryPlugin.call(this, pattern, method, options);\n } else {\n return pluralBoundJQueryPlugin.call(this, pattern, method, options);\n }\n };\n};\n\n// Is a given variable an object?\nfunction isObject(obj) {\n var type = typeof obj;\n return type === \"function\" || (type === \"object\" && !!obj);\n}\n\n// Extend a given object with all the properties in passed-in object(s).\nfunction extend(obj) {\n if (!isObject(obj)) return obj;\n var source, prop;\n for (var i = 1, length = arguments.length; i < length; i++) {\n source = arguments[i];\n for (prop in source) {\n if (hasOwnProperty.call(source, prop)) {\n obj[prop] = source[prop];\n }\n }\n }\n return obj;\n}\n// END: Taken from Underscore.js until here.\n\nfunction findLabel(input) {\n var $label;\n for (\n var label = input.parentNode;\n label && label.nodeType !== 11;\n label = label.parentNode\n ) {\n if (label.tagName === \"LABEL\") {\n return label;\n }\n }\n if (input.id) {\n $label = $('label[for=\"' + input.id + '\"]');\n }\n if ($label && $label.length === 0 && input.form) {\n $label = $('label[for=\"' + input.name + '\"]', input.form);\n }\n if ($label && $label.length) {\n return $label[0];\n } else {\n return null;\n }\n}\n\n// Taken from http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex\nfunction escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\");\n}\n\n/**\n * Create a RegExp object of a wildcard search string.\n *\n * @param {string} wildcard: A search string which can contain wildcards \"*\".\n * The wildcard \"*\" can be anywhere in the string and\n * can also be used multiple times. If no wildcard is\n * present the search string is used for an exact match.\n\n * @returns {RegExp}: A RegExp object which can be used to match strings.\n */\nfunction regexp_from_wildcard(wildcard) {\n let regexp = wildcard.replace(/[\\-\\[\\]{}()+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n regexp = regexp.replace(/[*]/g, \".*\");\n regexp = new RegExp(`^${regexp}$`);\n return regexp;\n}\n\n/**\n * Remove classes from a list of targets if they match a specific pattern.\n *\n * @param {Node, NodeList} targets: Dom Node or NodeList where the classes should be removed.\n * @param {string} classes: String matching classes to be removed.\n * You can add a \"*\" as wildcard to search for classes to be removed.\n * E.g. \"icon-*-alert\" to remove any of \"icon-1-alert icon-2-alert\".\n *\n * @returns {undefined}: This method directly operates on the targets.\n */\nfunction removeWildcardClass(targets, classes) {\n targets = utils.ensureArray(targets);\n\n if (classes.indexOf(\"*\") === -1) {\n for (const target of targets) {\n target.classList.remove(classes);\n }\n } else {\n const matcher = regexp_from_wildcard(classes);\n for (const target of targets) {\n const class_list = (target.getAttribute(\"class\") || \"\").split(/\\s+/);\n if (!class_list.length) {\n continue;\n }\n const ok = class_list.filter((it) => !matcher.test(it));\n if (ok.length) {\n target.setAttribute(\"class\", ok.join(\" \"));\n } else {\n target.removeAttribute(\"class\");\n }\n }\n }\n}\n\nfunction hasValue(el) {\n if (el.tagName === \"INPUT\") {\n if (el.type === \"checkbox\" || el.type === \"radio\") {\n return el.checked;\n }\n return el.value !== \"\";\n }\n if (el.tagName === \"SELECT\") {\n return el.selectedIndex !== -1;\n }\n if (el.tagName === \"TEXTAREA\") {\n return el.value !== \"\";\n }\n return false;\n}\n\nconst hideOrShow = (nodes, visible, options, pattern_name) => {\n nodes = dom.toNodeArray(nodes);\n\n const transitions = {\n none: { hide: \"hide\", show: \"show\" },\n fade: { hide: \"fadeOut\", show: \"fadeIn\" },\n slide: { hide: \"slideUp\", show: \"slideDown\" },\n };\n\n const duration =\n options.transition === \"css\" || options.transition === \"none\"\n ? null\n : options.effect.duration;\n\n const on_complete = (el) => {\n el.classList.remove(\"in-progress\");\n el.classList.add(visible ? \"visible\" : \"hidden\");\n $(el).trigger(\"pat-update\", {\n pattern: pattern_name,\n action: \"attribute-changed\",\n dom: el,\n transition: \"complete\",\n });\n };\n\n for (const el of nodes) {\n el.classList.remove(\"visible\");\n el.classList.remove(\"hidden\");\n el.classList.remove(\"in-progress\");\n\n if (duration) {\n const t = transitions[options.transition];\n el.classList.add(\"in-progress\");\n $(el).trigger(\"pat-update\", {\n pattern: pattern_name,\n action: \"attribute-changed\",\n dom: el,\n transition: \"start\",\n });\n $(el)[visible ? t.show : t.hide]({\n duration: duration,\n easing: options.effect.easing,\n complete: () => on_complete(el),\n });\n } else {\n if (options.transition !== \"css\") {\n dom[visible ? \"show\" : \"hide\"](el);\n }\n on_complete(el);\n }\n }\n};\n\nfunction addURLQueryParameter(fullURL, param, value) {\n /* Using a positive lookahead (?=\\=) to find the given parameter,\n * preceded by a ? or &, and followed by a = with a value after\n * than (using a non-greedy selector) and then followed by\n * a & or the end of the string.\n *\n * Taken from http://stackoverflow.com/questions/7640270/adding-modify-query-string-get-variables-in-a-url-with-javascript\n */\n var val = new RegExp(\"(\\\\?|\\\\&)\" + param + \"=.*?(?=(&|$))\"),\n parts = fullURL.toString().split(\"#\"),\n url = parts[0],\n hash = parts[1],\n qstring = /\\?.+$/,\n newURL = url;\n // Check if the parameter exists\n if (val.test(url)) {\n // if it does, replace it, using the captured group\n // to determine & or ? at the beginning\n newURL = url.replace(val, \"$1\" + param + \"=\" + value);\n } else if (qstring.test(url)) {\n // otherwise, if there is a query string at all\n // add the param to the end of it\n newURL = url + \"&\" + param + \"=\" + value;\n } else {\n // if there's no query string, add one\n newURL = url + \"?\" + param + \"=\" + value;\n }\n if (hash) {\n newURL += \"#\" + hash;\n }\n return newURL;\n}\n\nfunction removeDuplicateObjects(objs) {\n /* Given an array of objects, remove any duplicate objects which might\n * be present.\n */\n const comparator = function (k, v) {\n return this[k] === v;\n };\n\n return objs.reduce(function (list, next_obj) {\n let is_duplicate = false;\n for (const obj of list) {\n is_duplicate =\n Object.keys(obj).length === Object.keys(next_obj).length &&\n Object.entries(obj).filter(\n (it) => !comparator.bind(next_obj)(it[0], it[1])\n ).length === 0;\n }\n if (!is_duplicate) {\n list.push(next_obj);\n }\n return list;\n }, []);\n}\n\nfunction mergeStack(stack, length) {\n /* Given a list of lists of objects (which for brevity we call a stack),\n * return a list of objects where each object is the merge of all the\n * corresponding original objects at that particular index.\n *\n * If a certain sub-list doesn't have an object at that particular\n * index, the last object in that list is merged.\n */\n const results = [];\n for (let i = 0; i < length; i++) {\n results.push({});\n }\n for (const frame of stack) {\n const frame_length = frame.length - 1;\n for (let x = 0; x < length; x++) {\n results[x] = $.extend(\n results[x] || {},\n frame[x > frame_length ? frame_length : x]\n );\n }\n }\n return results;\n}\n\nfunction isElementInViewport(el, partial = false, offset = 0) {\n /* returns true if element is visible to the user ie. is in the viewport.\n * Setting partial parameter to true, will only check if a part of the element is visible\n * in the viewport, specifically that some part of that element is touching the top part\n * of the viewport. This only applies to the vertical direction, ie. doesnt check partial\n * visibility for horizontal scrolling\n * some code taken from:\n * http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport/7557433#7557433\n */\n if (el instanceof $) {\n el = el[0];\n }\n\n const rec = el.getBoundingClientRect();\n const rec_values = [rec.top, rec.bottom, rec.left, rec.right];\n\n if (rec_values.every((val) => val === 0)) {\n // if every property of rec is 0, the element is invisible;\n return false;\n } else if (partial) {\n // when using getBoundingClientRect() (in the vertical case)\n // negative means above top of viewport, positive means below top of viewport\n // therefore for part of the element to be touching or crossing the top of the viewport\n // rec.top must <= 0 and rec.bottom must >= 0\n // an optional tolerance offset can be added for when the desired element is not exactly\n // toucing the top of the viewport but needs to be considered as touching.\n return (\n rec.top <= 0 + offset && rec.bottom >= 0 + offset\n //(rec.top >= 0+offset && rec.top <= window.innerHeight) // this checks if the element\n // touches bottom part of viewport\n // XXX do we want to include a check for the padding of an element?\n // using window.getComputedStyle(target).paddingTop\n );\n } else {\n // this will return true if the entire element is completely in the viewport\n return (\n rec.top >= 0 &&\n rec.left >= 0 &&\n rec.bottom <=\n (window.innerHeight || document.documentElement.clientHeight) &&\n rec.right <= (window.innerWidth || document.documentElement.clientWidth)\n );\n }\n}\n\n/* parseTime - Parse a duration from a string and return the parsed time in milliseconds.\n *\n * @param {String} time - A duration/time string like ``1ms``, ``1s`` or ``1m``.\n *\n * @returns {Number} - A integer which represents the parsed time in milliseconds.\n */\nfunction parseTime(time) {\n var m = /^(\\d+(?:\\.\\d+)?)\\s*(\\w*)/.exec(time);\n if (!m) {\n throw new Error(\"Invalid time\");\n }\n var amount = parseFloat(m[1]);\n switch (m[2]) {\n case \"s\":\n return Math.round(amount * 1000);\n case \"m\":\n return Math.round(amount * 1000 * 60);\n case \"ms\":\n default:\n return Math.round(amount);\n }\n}\n\n/*\n\n * parseLength - Parse a length from a string and return the parsed length in\n * pixels.\n\n * @param {String} length - A length string like `1px` or `25%`. Lengths without a unit are treated as pixels.\n * @param {Number} reference_length - The reference length to use for percentage lengths.\n *\n * @returns {Number} - A integer which represents the parsed length in pixels.\n *\n * @throws {Error} - If the length string is invalid.\n *\n * @example\n * parseLength(\"1px\"); // 1\n * parseLength(\"10%\", 100); // 10\n *\n */\nfunction parseLength(length, reference_length = null) {\n const m = /^(\\d+(?:\\.\\d+)?)\\s*(\\%?\\w*)/.exec(length);\n if (!m) {\n throw new Error(\"Invalid length\");\n }\n const amount = parseFloat(m[1]);\n switch (m[2]) {\n case \"px\":\n return Math.round(amount);\n case \"%\":\n if (!reference_length) {\n return 0;\n }\n return (reference_length / 100) * Math.round(amount);\n case \"vw\":\n return Math.round((amount * window.innerWidth) / 100);\n case \"vh\":\n return Math.round((amount * window.innerHeight) / 100);\n case \"vmin\":\n return Math.round(\n (amount * Math.min(window.innerWidth, window.innerHeight)) / 100\n );\n case \"vmax\":\n return Math.round(\n (amount * Math.max(window.innerWidth, window.innerHeight)) / 100\n );\n default:\n return Math.round(amount);\n }\n}\n\n// Return a jQuery object with elements related to an input element.\nfunction findRelatives(el) {\n var $el = $(el),\n $relatives = $(el),\n $label = $();\n\n $relatives = $relatives.add($el.closest(\"label\"));\n $relatives = $relatives.add($el.closest(\"fieldset\"));\n\n if (el.id) $label = $(\"label[for='\" + el.id + \"']\");\n if (!$label.length) {\n var $form = $el.closest(\"form\");\n if (!$form.length) $form = $(document.body);\n $label = $form.find(\"label[for='\" + el.name + \"']\");\n }\n $relatives = $relatives.add($label);\n return $relatives;\n}\n\nfunction get_bounds(el) {\n // Return bounds of an element with it's values rounded and converted to ints.\n const bounds = el.getBoundingClientRect();\n return {\n x: parseInt(Math.round(bounds.x), 10) || 0,\n y: parseInt(Math.round(bounds.y), 10) || 0,\n top: parseInt(Math.round(bounds.top), 10) || 0,\n bottom: parseInt(Math.round(bounds.bottom), 10) || 0,\n left: parseInt(Math.round(bounds.left), 10) || 0,\n right: parseInt(Math.round(bounds.right), 10) || 0,\n width: parseInt(Math.round(bounds.width), 10) || 0,\n height: parseInt(Math.round(bounds.height), 10) || 0,\n };\n}\n\nfunction checkInputSupport(type, invalid_value) {\n /* Check input type support.\n * See: https://stackoverflow.com/a/10199306/1337474\n */\n let support = false;\n const input = document.createElement(\"input\");\n input.setAttribute(\"type\", type);\n support = input.type == type;\n\n if (invalid_value !== undefined) {\n // Check for input type UI support\n input.setAttribute(\"value\", invalid_value);\n support = input.value !== invalid_value;\n }\n return support;\n}\n\nconst checkCSSFeature = (attribute, value, tag = \"div\") => {\n /* Check for browser support of specific CSS feature.\n */\n tag = document.createElement(tag);\n let supported = tag.style[attribute] !== undefined;\n if (supported && value !== undefined) {\n tag.style[attribute] = value;\n supported = tag.style[attribute] === value;\n }\n return supported;\n};\n\nconst animation_frame = () => {\n // Return promise to await next repaint cycle\n // Use it in your async function like so: ``await utils.animation_frame()``\n // From: http://www.albertlobo.com/fractals/async-await-requestanimationframe-buddhabrot\n return new Promise(window.requestAnimationFrame);\n};\n\nconst timeout = (ms) => {\n return new Promise((resolve) => setTimeout(resolve, ms));\n};\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds.\n * From: https://underscorejs.org/#debounce\n *\n * @param {Function} func - The function to debounce.\n * @param {Number} ms - The time in milliseconds to debounce.\n * @param {Object} timer - A module-global timer as an object.\n * @param {Boolean} [postpone=true] - If true, the function will only be called\n * at the end, after it stops being called for N milliseconds. If false, the\n * function will be called no more than each [ms] milliseconds, ensuring that\n * the function isn't postponed for for too long.\n *\n * @returns {Function} - The debounced function.\n */\nconst debounce = (func, ms, timer = { timer: null }, postpone = true) => {\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds.\n // From: https://underscorejs.org/#debounce\n //\n // Make sure to initialize ``debounce`` only once per to-be-debounced\n // function to not reinitialize the timer each time and debounce not being\n // able to cancel previouse runs.\n //\n // Pass a module-global timer as an object ``{ timer: null }`` if you want\n // to also cancel debounced functions from other pattern-invocations.\n timer.last_run = 0;\n return function () {\n const args = arguments;\n if (!postpone && timer.timer && Date.now() - timer.last_run <= ms) {\n return;\n }\n clearTimeout(timer.timer);\n timer.last_run = Date.now();\n timer.timer = setTimeout(() => {\n func.apply(this, args);\n }, ms);\n };\n};\n\nconst isIE = () => {\n // See: https://stackoverflow.com/a/9851769/1337474\n // Internet Explorer 6-11\n return /*@cc_on!@*/ false || !!document.documentMode;\n};\n\nconst jqToNode = (el) => {\n // Return a DOM node if a jQuery node was passed.\n if (el.jquery) {\n el = el[0];\n }\n return el;\n};\n\n/**\n * Always return an iterable object.\n *\n * @param {any} it: The object which needs to be wrapped in an array or returned as is if it is iterable.\n * @param {boolean} force_array: If the object is iterable but not an Array, convert it to an array (e.g. For jQuery items or NodeList objects).\n *\n * @returns {Array}: Returns the object wrapped in an Array, expanded to an Array or as-is if it is already iterable.\n */\nconst ensureArray = (it, force_array) => {\n // Ensure to return always an array\n const array_like = !!(\n NodeList.prototype.isPrototypeOf(it) || // eslint-disable-line no-prototype-builtins\n Array.isArray(it) ||\n it.jquery\n );\n return array_like ? (force_array ? [...it] : it) : [it];\n};\n\nconst localized_isodate = (date) => {\n // Return a iso date (date only) in the current timezone instead of a\n // UTC ISO 8601 date+time component which toISOString returns.\n\n const day = date.getDate().toString().padStart(2, \"0\");\n const month = (date.getMonth() + 1).toString().padStart(2, \"0\");\n const year = date.getFullYear().toString();\n\n return `${year}-${month}-${day}`;\n};\n\n/**\n * Replace HTML reserved characters with html entities to add HTML for user\n * editing to e.g. a textarea or a contenteditable.\n *\n * See:\n * https://stackoverflow.com/a/22706073/1337474\n * https://developer.mozilla.org/en-US/docs/Glossary/Entity#reserved_characters\n *\n * @param {string} html - The HTML string to encode.\n *\n * @returns {string} - Returns the escaped html string:\n * ``&`` will be replaced with ``&``.\n * ``<`` will be repalced with ``<``,\n * ``>`` will be replaced with ``>``,\n * ``\"`` will be replaced with ``"``.\n */\nconst escape_html = (html) => {\n if (!html) {\n return \"\";\n }\n const el = document.createElement(\"div\");\n el.appendChild(document.createTextNode(html));\n // Return escaped html and also replace quotes.\n return el.innerHTML.replace(/\"/g, \""\");\n};\n\n/**\n * Return unescaped, raw HTML from an escaped HTML string.\n *\n * See:\n * https://stackoverflow.com/a/34064434/1337474\n * https://developer.mozilla.org/en-US/docs/Glossary/Entity#reserved_characters\n *\n * @param {string} escaped_html - The HTML string to decode.\n *\n * @returns {string} - Returns the escaped html string:\n * ``&`` will be replaced with ``&``,\n * ``<`` will be repalced with ``<``,\n * ``>`` will be replaced with ``>``,\n * ``"`` will be replaced with ``\"``.\n */\nconst unescape_html = (escaped_html) => {\n if (!escaped_html) {\n return \"\";\n }\n const doc = new DOMParser().parseFromString(escaped_html, \"text/html\");\n // Return unescaped html and also unescape quote named entities.\n return doc.documentElement.textContent.replace(/"/g, '\"');\n};\n\n/**\n * Return true, if the given value is a valid ISO 8601 date/time string with or without an optional time component.\n *\n * @param {String} value - The date/time value to be checked.\n * @param {Boolean} [optional_time=false] - True, if time component is optional.\n * @return {Boolean} - True, if the given value is a valid Date string. False if not.\n */\nconst is_iso_date_time = (value, optional_time = false) => {\n const re_date_time = optional_time\n ? /^\\d{4}-[01]\\d-[0-3]\\d(T[0-2]\\d:[0-5]\\d)?$/\n : /^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d$/;\n return re_date_time.test(value);\n};\n\n/**\n * Return true, if the given value is a valid ISO 8601 date string and without a time component.\n *\n * @param {String} value - The date value to be checked.\n * @return {Boolean} - True, if the given value is a valid ISO 8601 date string without a time component. False if not.\n */\nconst is_iso_date = (value) => {\n const re_date_time = /^\\d{4}-[01]\\d-[0-3]\\d$/;\n return re_date_time.test(value);\n};\n\n/**\n * Return the number of days between two dates.\n * Based on: https://stackoverflow.com/a/15289883/1337474\n *\n * @param {Date} date_1 - First date to compare. We will substract date_2 from date_1.\n * @param {Date} date_2 - Second date to compare.\n * @return {Number} - The number of days between the two dates.\n */\nconst date_diff = (date_1, date_2) => {\n // Discard the time and time-zone information.\n const utc_1 = Date.UTC(date_1.getFullYear(), date_1.getMonth(), date_1.getDate());\n const utc_2 = Date.UTC(date_2.getFullYear(), date_2.getMonth(), date_2.getDate());\n\n return Math.floor((utc_1 - utc_2) / _MS_PER_DAY);\n};\n\n/**\n * Build intersection observer threshold list.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#building_the_array_of_threshold_ratios\n *\n * @param {Number} num_steps - The number of steps to use.\n *\n * @returns {Array} - Returns the threshold list.\n */\nconst threshold_list = (num_steps = 0) => {\n let thresholds = [];\n\n for (let i = 1.0; i <= num_steps; i++) {\n thresholds.push(i / num_steps);\n }\n thresholds.push(0);\n return thresholds.sort();\n};\n\n/**\n * is_option_truthy - Check if an Pattern option is set.\n *\n * An option is set if it is not one of:\n * - undefined\n * - null\n * - \"none\"\n * - \"\"\n *\n * @param {String} option - The option to check.\n *\n * @returns {Boolean} - Returns true if the option is set, false otherwise.\n *\n * @example\n *\n * is_option_truthy() // false\n * is_option_truthy(undefined) // false\n * is_option_truthy(null) // false\n * is_option_truthy(\"\") // false\n * is_option_truthy(\"none\") // false\n * is_option_truthy(\"false\") // false\n * is_option_truthy(\"foo\") // true\n * is_option_truthy(true) // true\n * is_option_truthy(0) // true\n *\n */\nconst is_option_truthy = (option) => {\n return ![undefined, null, \"none\", false, \"false\", \"\"].includes(option);\n};\n\nvar utils = {\n jqueryPlugin: jqueryPlugin,\n escapeRegExp: escapeRegExp,\n isObject: isObject,\n extend: extend,\n findLabel: findLabel,\n regexp_from_wildcard: regexp_from_wildcard,\n removeWildcardClass: removeWildcardClass,\n hideOrShow: hideOrShow,\n addURLQueryParameter: addURLQueryParameter,\n removeDuplicateObjects: removeDuplicateObjects,\n mergeStack: mergeStack,\n isElementInViewport: isElementInViewport,\n hasValue: hasValue,\n parseTime: parseTime,\n parseLength: parseLength,\n findRelatives: findRelatives,\n get_bounds: get_bounds,\n checkInputSupport: checkInputSupport,\n checkCSSFeature: checkCSSFeature,\n animation_frame: animation_frame,\n timeout: timeout,\n debounce: debounce,\n isIE: isIE,\n jqToNode: jqToNode,\n ensureArray: ensureArray,\n localized_isodate: localized_isodate,\n escape_html: escape_html,\n unescape_html: unescape_html,\n is_iso_date_time: is_iso_date_time,\n is_iso_date: is_iso_date,\n date_diff: date_diff,\n threshold_list: threshold_list,\n is_option_truthy: is_option_truthy,\n //getCSSValue: dom.get_css_value, // BBB: moved to dom. TODO: Remove in upcoming version.\n elementInViewport: (el) => {\n // BBB: Remove with next major version.\n console.warn(\"Deprecated. Use utils.isElementInViewport\");\n return isElementInViewport(el);\n },\n};\n\nexport default utils;\n","/**\n * Patterns registry - Central registry and scan logic for patterns\n *\n * Copyright 2012-2013 Simplon B.V.\n * Copyright 2012-2013 Florian Friesdorf\n * Copyright 2013 Marko Durkovic\n * Copyright 2013 Rok Garbas\n * Copyright 2014-2015 Syslab.com GmBH, JC Brand\n */\n\n/*\n * changes to previous patterns.register/scan mechanism\n * - if you want initialised class, do it in init\n * - init returns set of elements actually initialised\n * - handle once within init\n * - no turnstile anymore\n * - set pattern.jquery_plugin if you want it\n */\nimport $ from \"jquery\";\nimport dom from \"./dom\";\nimport logging from \"./logging\";\nimport utils from \"./utils\";\n\nconst log = logging.getLogger(\"registry\");\nconst disable_re = /patterns-disable=([^&]+)/g;\nconst dont_catch_re = /patterns-dont-catch/g;\nconst disabled = {};\nlet dont_catch = false;\nlet match;\n\nwhile ((match = disable_re.exec(window.location.search)) !== null) {\n disabled[match[1]] = true;\n log.info(\"Pattern disabled via url config:\", match[1]);\n}\n\nwhile ((match = dont_catch_re.exec(window.location.search)) !== null) {\n dont_catch = true;\n log.info(\"I will not catch init exceptions\");\n}\n\n/**\n * Global pattern registry.\n *\n * This is a singleton and shared among any instance of the Patternslib\n * registry since Patternslib version 8.\n *\n * You normally don't need this as the registry handles it for you.\n */\nif (typeof window.__patternslib_registry === \"undefined\") {\n window.__patternslib_registry = {};\n}\nexport const PATTERN_REGISTRY = window.__patternslib_registry;\nif (typeof window.__patternslib_registry_initialized === \"undefined\") {\n window.__patternslib_registry_initialized = false;\n}\n\nconst registry = {\n patterns: PATTERN_REGISTRY, // reference to global patterns registry\n // as long as the registry is not initialized, pattern\n // registration just registers a pattern. Once init is called,\n // the DOM is scanned. After that registering a new pattern\n // results in rescanning the DOM only for this pattern.\n init() {\n $(document).ready(function () {\n if (window.__patternslib_registry_initialized) {\n // Do not reinitialize a already initialized registry.\n return;\n }\n window.__patternslib_registry_initialized = true;\n log.debug(\"Loaded: \" + Object.keys(registry.patterns).sort().join(\", \"));\n registry.scan(document.body);\n log.debug(\"Finished initial scan.\");\n });\n },\n\n clear() {\n // Removes all patterns from the registry. Currently only being\n // used in tests.\n for (const name in registry.patterns) {\n delete registry.patterns[name];\n }\n },\n\n transformPattern(name, content) {\n /* Call the transform method on the pattern with the given name, if\n * it exists.\n */\n if (disabled[name]) {\n log.debug(`Skipping disabled pattern: ${name}.`);\n return;\n }\n\n const pattern = registry.patterns[name];\n const transform = pattern.transform || pattern.prototype?.transform;\n if (transform) {\n try {\n transform($(content));\n } catch (e) {\n if (dont_catch) {\n throw e;\n }\n log.error(`Transform error for pattern ${name}.`, e);\n }\n }\n },\n\n initPattern(name, el, trigger) {\n /* Initialize the pattern with the provided name and in the context\n * of the passed in DOM element.\n */\n const $el = $(el);\n const pattern = registry.patterns[name];\n const plog = logging.getLogger(`pat.${name}`);\n if (el.matches(pattern.trigger)) {\n plog.debug(\"Initialising.\", el);\n try {\n if (pattern.init) {\n // old style initialisation\n pattern.init($el, null, trigger);\n } else {\n // class based pattern initialisation\n new pattern($el, null, trigger);\n }\n\n plog.debug(\"done.\");\n } catch (e) {\n if (dont_catch) {\n throw e;\n }\n plog.error(\"Caught error:\", e);\n }\n }\n },\n\n orderPatterns(patterns) {\n // Always add pat-validation as first pattern, so that it can prevent\n // other patterns from reacting to submit events if form validation\n // fails.\n if (patterns.includes(\"validation\")) {\n patterns.splice(patterns.indexOf(\"validation\"), 1);\n patterns.unshift(\"validation\");\n }\n // Add clone-code to the very beginning - we want to copy the markup\n // before any other patterns changed the markup.\n if (patterns.includes(\"clone-code\")) {\n patterns.splice(patterns.indexOf(\"clone-code\"), 1);\n patterns.unshift(\"clone-code\");\n }\n\n return patterns;\n },\n\n scan(content, patterns, trigger) {\n if (!content) {\n return;\n }\n\n if (typeof content === \"string\") {\n content = document.querySelector(content);\n } else if (content instanceof Text) {\n // No need to scan a TextNode.\n return;\n } else if (content.jquery) {\n content = content[0];\n }\n\n const selectors = [];\n patterns = this.orderPatterns(patterns || Object.keys(registry.patterns));\n for (const name of patterns) {\n this.transformPattern(name, content);\n const pattern = registry.patterns[name];\n if (pattern.trigger) {\n selectors.unshift(pattern.trigger);\n }\n }\n\n let matches = dom.querySelectorAllAndMe(\n content,\n selectors.map((it) => it.trim().replace(/,$/, \"\")).join(\",\")\n );\n matches = matches.filter((el) => {\n // Filter out patterns:\n // - with class ``.disable-patterns``\n // - wrapped in ``.disable-patterns`` elements\n // - wrapped in ``
`` elements\n            // - wrapped in ``