PageSourceSearch

https://www.jolifin.de/theme/86db693bb4f539ecaff1140e784845e8/js/p…-theme.pns-form-validation.plugin.cd4289.js

js jolifin.de collected 2026-10-02 00:40:00 UTC 18,174 bytes, 8 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[76394],{1714(t,e,i){i.d(e,{A:()=>r});class r{static datasetCamelCase(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t;return e&&(r=r.replace(/[[\]]/g,"")),i&&(r=r.replace(/=.*/,"")),r.toLowerCase().replace("data-","").replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})}}},4059(t,e,i){i.d(e,{A:()=>r});class r{static debounce(t,e){let i,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var s=arguments.length,n=Array(s),a=0;a<s;a++)n[a]=arguments[a];r&&!i&&setTimeout(t.bind(t,...n),0),clearTimeout(i),i=setTimeout(t.bind(t,...n),e)}}}},4154(t,e,i){i.d(e,{A:()=>r});class r{static iterate(t,e){if(t instanceof Map||Array.isArray(t))return t.forEach(e);if(t instanceof FormData){for(var i of t.entries())e(i[1],i[0]);return}if(t instanceof NodeList)return t.forEach(e);if(t instanceof HTMLCollection)return Array.from(t).forEach(e);if(t instanceof Object)return Object.keys(t).forEach(i=>{e(t[i],i)});throw Error(`The element type ${typeof t} is not iterable!`)}}},4156(t){var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(t,e){return!1!==e.clone&&e.isMergeableObject(t)?o(Array.isArray(t)?[]:{},t,e):t}function s(t,e,i){return t.concat(e).map(function(t){return r(t,i)})}function n(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function a(t,e){try{return e in t}catch(t){return!1}}function o(t,i,l){(l=l||{}).arrayMerge=l.arrayMerge||s,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=r;var d,h,u=Array.isArray(i);return u!==Array.isArray(t)?r(i,l):u?l.arrayMerge(t,i,l):(h={},(d=l).isMergeableObject(t)&&n(t).forEach(function(e){h[e]=r(t[e],d)}),n(i).forEach(function(e){(!a(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(a(t,e)&&d.isMergeableObject(i[e])?h[e]=(function(t,e){if(!e.customMerge)return o;var i=e.customMerge(t);return"function"==typeof i?i:o})(e,d)(t[e],i[e],d):h[e]=r(i[e],d))}),h)}o.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return o(t,i,e)},{})},t.exports=o},4707(t,e,i){i.d(e,{A:()=>r});class r{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let i=r.toUpperCamelCase(t,e);return r.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>r.ucFirst(t.toLowerCase())).join(""):r.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}},6394(t,e,i){i.r(e),i.d(e,{default:()=>d});var r=i(7220),s=i(4059);class n extends r.A{static #t=this.options={stylingEnabled:!0,styleCls:"was-validated",hintCls:"invalid-feedback",debounceTime:"150",eventName:"ValidateEqual",equalAttr:"data-form-validation-equal",lengthAttr:"data-form-validation-length",lengthTextAttr:"data-form-validation-length-text",requiredAttr:"data-form-validation-required"};init(){if(!1===this._isFormElement())throw Error("Element is not of type <form>");this.options.stylingEnabled&&this._setNoValidate(),this._registerEvents()}_isFormElement(){return"form"===this.el.tagName.toLowerCase()}_setNoValidate(){this.el.setAttribute("novalidate","")}_registerEvents(){this.options.stylingEnabled&&this.el.addEventListener("submit",this._onFormSubmit.bind(this)),this._registerValidationListener(this.options.equalAttr,this._onValidateEqualTrigger.bind(this),["change"]),this._registerValidationListener(this.options.equalAttr,s.A.debounce(this._onValidateEqual.bind(this),this.options.debounceTime),[this.options.eventName]),this._registerValidationListener(this.options.lengthAttr,this._onValidateLength.bind(this),["change"]),this._registerValidationListener(this.options.requiredAttr,this._onValidateRequired.bind(this),["change"])}_registerValidationListener(t,e,i){let r=this.el.querySelectorAll(`[${t}]`);r&&r.forEach(t=>
1{i.forEach(i=>{t.removeEventListener(i,e),t.addEventListener(i,e)})})}_onFormSubmit(t){let e=this.el.checkValidity();!1===e&&(t.preventDefault(),t.stopPropagation()),this.el.classList.add(this.options.styleCls),this.$emitter.publish("beforeSubmit",{validity:e})}_onValidateEqualTrigger(t){let e=t.target.getAttribute(this.options.equalAttr),i=this.el.querySelectorAll(`[${this.options.equalAttr}='${e}']`);i[1].value.trim().length>0&&i.forEach(e=>{e.dispatchEvent(new CustomEvent(this.options.eventName,{target:t.target}))}),this.$emitter.publish("onValidateEqualTrigger")}_onValidateEqual(t){let e=t.target.getAttribute(this.options.equalAttr),i=this.el.querySelectorAll(`[${this.options.equalAttr}='${e}']`),r=!0;[...i].reduce((t,e)=>(t.value.trim()!==e.value.trim()&&(r=!1),e)),i.forEach(t=>{r?this._setFieldToValid(t,this.options.equalAttr):this._setFieldToInvalid(t,this.options.equalAttr)}),this.$emitter.publish("onValidateEqual")}_onValidateLength(t){let e=t.target,i=e.value.trim(),r=t.target.getAttribute(this.options.lengthAttr),s=e.nextElementSibling;i.length<r?(this._setFieldToInvalid(e,this.options.lengthAttr),s&&s.hasAttribute(this.options.lengthTextAttr)&&s.classList.add(this.options.hintCls)):(this._setFieldToValid(e,this.options.lengthAttr),s&&s.hasAttribute(this.options.lengthTextAttr)&&s.classList.remove(this.options.hintCls)),this.$emitter.publish("onValidateLength")}_onValidateRequired(t){let e=t.target;""===e.value.trim()?this._setFieldToInvalid(e,this.options.requiredAttr):this._setFieldToValid(e,this.options.requiredAttr),this.$emitter.publish("onValidateRequired")}_setFieldToInvalid(t,e){this._showInvalidMessage(t,e),t.setAttribute("invalid",!0),this.$emitter.publish("setFieldToInvalid")}_showInvalidMessage(t,e){let i=t.parentElement;i&&this.options.stylingEnabled&&i.classList.add(this.options.styleCls);let r=t.getAttribute(`${e}-message`);r&&(i.querySelector(".js-validation-message")||t.insertAdjacentHTML("afterEnd",`<div class="invalid-feedback js-validation-message" data-type="${e}">${r}</div>`),t.setCustomValidity(r)),this.$emitter.publish("showInvalidMessage")}_setFieldToValid(t,e){this._hideInvalidMessage(t,e),t.removeAttribute("invalid"),t.setCustomValidity(""),this.$emitter.publish("setFieldToValid")}_hideInvalidMessage(t,e){let i=t.parentElement;if(i&&this.options.stylingEnabled&&i.classList.remove(this.options.styleCls),i){let t=i.querySelector(`.js-validation-message[data-type=${e}]`);t&&t.remove()}this.$emitter.publish("hideInvalidMessage")}}var a=i(8176),o=i(4154),l=i(1714);class d extends n{static #t=this.options={...n.options,patternAttr:"data-form-validation-pattern",patternContextAttr:"data-form-validation-pattern-context",maxAttr:"data-form-validation-max",minAttr:"data-form-validation-min",stepAttr:"data-form-validation-step"};static #e=this.feedbackIdCounter=0;init(){this.formId=this.el.id,this.extendedForm=a.A.querySelector(document,`[data-form="${this.formId}"]`,!1),this.extendedForm&&(this.extendedInputs=[].slice.call(this.extendedForm.querySelectorAll(`[form="${this.formId}"]`))),super.init()}_registerEvents(){super._registerEvents(),this._registerValidationListener(this.options.patternAttr,this._onValidatePattern.bind(this),["focus","change","blur"]);let t=this._onValidateNumericConstraints.bind(this);[this.options.maxAttr,this.options.minAttr,this.options.stepAttr].forEach(e=>{this._registerValidationListener(e,t,["input","change"])})}_onValidateNumericConstraints(t){let e=t.target,i=[[this.options.maxAttr,"rangeOverflow"],[this.options.minAttr,"rangeUnderflow"],[this.options.stepAttr,"stepMismatch"]].filter(t=>{let[i]=t;return e.hasAttribute(i)}),r=i.find(t=>{let[,i]=t;return e.validity[i]});i.forEach(t=>{let[i]=t;r&&r[0]===i||this._setFieldToValid(e,i)}),r&&this._setFieldToInvalid(e,r[0]),this.$emitter.publish("onValidateNumericConstraints")}_showInvalidMessage(t,e){super._showInvalidMessage(t,e),this._linkFeedbackMessage(t,e)}_setFieldToValid(t,e){super._setFieldToValid(t,e),this._unlinkFeedbackMessage(t,e)}_linkFeedbackMessage(t,e){let i=t.parentElement;if(!i)return;let r=i.querySelector(`.js-validation-message[data-type=${e}]`);if(!r)return;r.id||(r.id=`${e}-feedback-${++d.feedbackIdCounter}`);let s=(t.getAttribute("aria-describedby")||"").split(" ").filter(
1Boolean);s.includes(r.id)||t.setAttribute("aria-describedby",[...s,r.id].join(" "))}_unlinkFeedbackMessage(t,e){let i=(t.getAttribute("aria-describedby")||"").split(" ").filter(Boolean),r=i.filter(t=>!t.startsWith(`${e}-feedback-`));r.length!==i.length&&(r.length?t.setAttribute("aria-describedby",r.join(" ")):t.removeAttribute("aria-describedby"))}_onFormSubmit(t){let e;this._triggerChangeOnAllFields();let i=this.el.checkValidity();this.extendedInputs&&this.extendedInputs.length&&(e=this.extendedInputs.every(t=>!0===t.checkValidity())),(!1===i||!1===e)&&(t.preventDefault(),t.stopPropagation()),this.el.classList.add(this.options.styleCls),this.$emitter.publish("beforeSubmit",{validity:i})}_triggerChangeOnAllFields(){this._triggerChangeOnFieldType(this.options.equalAttr),this._triggerChangeOnFieldType(this.options.requiredAttr),this._triggerChangeOnFieldType(this.options.lengthAttr)}_triggerChangeOnFieldType(t){let e=a.A.querySelectorAll(this.el,`[${t}]`,!1);e&&(this.extendedForm&&(e=[...e,...a.A.querySelectorAll(this.extendedForm,`[${t}]`,!1)]),o.A.iterate(e,t=>{let e=new Event("change");t.dispatchEvent(e)}))}_registerValidationListener(t,e,i){let r=a.A.querySelectorAll(this.el,`[${t}]`,!1);if(r){if(this.extendedForm){let e=a.A.querySelectorAll(this.extendedForm,`[${t}]`,!1);e&&(r=[...r,...e])}o.A.iterate(r,t=>{o.A.iterate(i,i=>{t.removeEventListener(i,e),t.addEventListener(i,e)})})}}_onValidateEqualTrigger(t){let e=a.A.getDataAttribute(t.target,this.options.equalAttr),i=a.A.querySelectorAll(this.el,`[${this.options.equalAttr}='${e}']`,!1);i||(i=a.A.querySelectorAll(this.extendedForm,`[${this.options.equalAttr}='${e}']`,!1)),i[1].value.trim().length>0&&o.A.iterate(i,e=>{e.dispatchEvent(new CustomEvent(this.options.eventName,{target:t.target}))}),this.$emitter.publish("onValidateEqualTrigger")}_onValidateEqual(t){let e=a.A.getDataAttribute(t.target,this.options.equalAttr),i=a.A.querySelectorAll(this.el,`[${this.options.equalAttr}='${e}']`,!1);i||(i=a.A.querySelectorAll(this.extendedForm,`[${this.options.equalAttr}='${e}']`,!1));let r=!0;[...i].reduce((t,e)=>{t.value.trim()!==e.value.trim()&&(r=!1)}),o.A.iterate(i,t=>{r?this._setFieldToValid(t,this.options.equalAttr):this._setFieldToInvalid(t,this.options.equalAttr)}),this.$emitter.publish("onValidateEqual")}_isCheckableInput(t){return t instanceof HTMLInputElement&&("checkbox"===t.type||"radio"===t.type)}_isGroupChecked(t){if("radio"!==t.type||!t.name)return t.checked;let e=a.A.querySelectorAll(this.el,`input[type="radio"][name="${t.name}"]`,!1);if(this.extendedForm){let i=a.A.querySelectorAll(this.extendedForm,`input[type="radio"][name="${t.name}"]`,!1);i&&(e=e?[...e,...i]:i)}return e?[...e].some(t=>t.checked):t.checked}_onValidateRequired(t){let e=t.target;(this._isCheckableInput(e)?this._isGroupChecked(e):""!==e.value.trim())?this._setFieldToValid(e,this.options.requiredAttr):this._setFieldToInvalid(e,this.options.requiredAttr),this.$emitter.publish("onValidateRequired")}_onValidatePattern(t){let e=t.target,i=e.closest("form");if(!i)return console.error("Error: Input field is not inside a form."),!1;let r=this._getValidationContext(e);if(!r)return!1;if(""===e.value.trim())return this._setFieldToValid(e,this.options.patternAttr),!e.hasAttribute(this.options.requiredAttr)||this._onValidateRequired(t);let s=this._getFieldNamePrefix(e),n=this._getCountryField(i,s);if(!n)return!0;let a=n.value,o=this._getRegexForCountryId(r,a);return o?RegExp(o,"u").test(e.value)?(this._setFieldToValid(e,this.options.patternAttr),!0):(this._setFieldToInvalid(e,this.options.patternAttr),!1):(this._setFieldToValid(e,this.options.patternAttr),!0)}_getFieldNamePrefix(t){let e=t.getAttribute("name");if(!e)return null;let i=e.match(/^(.+?)\[/);return i?i[1]:null}_getCountryField(t,e){return t.querySelector(`[name$="${e}[countryId]"]`)}_getValidationContext(t){let e=t.dataset[l.A.datasetCamelCase(this.options.patternContextAttr)];if(!e)return console.error("Validation context not found on field."),null;try{return JSON.parse(e)}catch(t){return console.error("Invalid JSON format in validation context:",t),null}}_getRegexForCountryId(t,e){return t[e]||null}}},7220(t,e,i){i.d(e,{A:()=>
1o});var r=i(4156),s=i.n(r),n=i(4707),a=i(8308);class o{constructor(t,e={},i=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=t,this.$emitter=new a.A(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let e=[this.constructor.options,this.options,t];return e.push(this._getConfigFromDataAttribute()),e.push(this._getOptionsFromDataAttribute()),s().all(e.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_getConfigFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=n.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=n.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-options`);if(i)try{return JSON.parse(i)}catch(t){console.error(`The data attribute "data-${e}-options" could not be parsed to json: ${t.message}`)}return t}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}}},8176(t,e,i){i.d(e,{A:()=>s});var r=i(4707);class s{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!s.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!1===s.hasAttribute(t,e))throw Error(`The required property "${e}" does not exist!`);if("function"!=typeof t.getAttribute){if(i)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=e.replace(/^data(|-)/,""),a=r.A.toLowerCamelCase(n,"-");if(!s.isNode(t)){if(i)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(i)throw Error("This node doesn't support the dataset attribute!");return}let o=t.dataset[a];if(void 0===o){if(i)throw Error(`The required data attribute "${e}" does not exist on ${t}!`);return o}return r.A.parsePrimitive(o)}static querySelector(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!s.isNode(t))throw Error("The parent node is not a valid HTML Node!");let r=t.querySelector(e)||!1;if(i&&!1===r)throw Error(`The required element "${e}" does not exist in parent node!`);return r}static querySelectorAll(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!s.isNode(t))throw Error("The parent node is not a valid HTML Node!");let r=t.querySelectorAll(e);if(0===r.length&&(r=!1),i&&!1===r)throw Error(`At least one item of "${e}" must exist in parent node!`);return r}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,e=`
2            input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),
3            select:not([tabindex^="-"]):not([disabled]),
4            textarea:not([tabindex^="-"]):not([disabled]),
5            button:not([tabindex^="-"]):not([disabled]),
6            a[href]:not([tabindex^="-"]):not([disabled]),
7            [tabindex]:not([tabindex^="-"]):not([disabled])
8        `;return t.querySelectorAll(e)}static getFirstFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(t)[0]}static getLastFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=this.getFocusableElements(t);return e[e.length-1]}}},8308(t,e,i){i.d(e,{A:()=>r});
8class r{constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(r),r}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this,s=t.split("."),n=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=n;n=function(i){r.unsubscribe(t),e(i)}}return this.el.addEventListener(s[0],n),this.listeners.push({splitEventName:s,opts:i,cb:n}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,i)=>([...i.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):t.push(i),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.