https://www.narayana-verlag.de/theme/6d906b806b5f68f448270a01cc8f5…/intedia-affiliates.js?1790316233
1(()=>{"use strict";var t={156: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!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(t,e){return!1!==e.clone&&e.isMergeableObject(t)?o(Array.isArray(t)?[]:{},t,e):t}function s(t,e,r){return t.concat(e).map(function(t){return i(t,r)})}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,r,l){(l=l||{}).arrayMerge=l.arrayMerge||s,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=i;var u,c,h=Array.isArray(r);return h!==Array.isArray(t)?i(r,l):h?l.arrayMerge(t,r,l):(c={},(u=l).isMergeableObject(t)&&n(t).forEach(function(e){c[e]=i(t[e],u)}),n(r).forEach(function(e){(!a(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(a(t,e)&&u.isMergeableObject(r[e])?c[e]=(function(t,e){if(!e.customMerge)return o;var r=e.customMerge(t);return"function"==typeof r?r:o})(e,u)(t[e],r[e],u):c[e]=i(r[e],u))}),c)}o.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,r){return o(t,r,e)}
1,{})},t.exports=o}},e={};function r(i){var s=e[i];if(void 0!==s)return s.exports;var n=e[i]={exports:{}};return t[i](n,n.exports,r),n.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var i=r(156),s=r.n(i);class n{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 r=n.toUpperCamelCase(t,e);return n.lcFirst(r)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>n.ucFirst(t.toLowerCase())).join(""):n.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}class a{constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(t,{detail:e,cancelable:r});return this.el.dispatchEvent(i),i}subscribe(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,s=t.split("."),n=r.scope?e.bind(r.scope):e;if(r.once&&!0===r.once){let e=n;n=function(r){i.unsubscribe(t),e(r)}}return this.el.addEventListener(s[0],n),this.listeners.push({splitEventName:s,opts:r,cb:n}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,r)=>([...r.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):t.push(r),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}}class o{constructor(t,e={},r=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${r}".`);return}this.el=t,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(r),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.toDashCase(this._pluginName),r=this.el.getAttribute(`data-${e}-config`);return r?window.PluginConfigManager.get(this._pluginName,r):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=n.toDashCase(this._pluginName),r=this.el.getAttribute(`data-${e}-options`);if(r)try{return JSON.parse(r)}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}}class l extends o{static #t=this.options={tableSelector:"#affiliateTable",summarySelector:".affiliate-summary",yearDropdownTextSelector:"#yearDropdownText"};init(){this._table=document.querySelector(this.options.tableSelector),this._summary=document.querySelector(this.options.summarySelector),this._yearDropdownText=document.querySelector(this.options.yearDropdownTextSelector),this._currencyFormatter=new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}),this.el.querySelectorAll(".dropdown-item").forEach(t=>{t.addEventListener("click",this._onYearSelect.bind(this))})}_onYearSelect(t){if(t.preventDefault(),!this._table)return;let e=t.currentTarget,r=e.dataset.year;this._table.querySelectorAll(".affiliate-row-month").forEach(t=>{let e="all"===r||t.dataset.year===r,i=t.nextElementSibling;t.style.display=e?"":"none",i&&(i.style.display=e?"":"none")}),this._yearDropdownText&&(this._yearDropdownText.textContent=e.textContent.trim()),this._updateSummary()}_updateSummary(){if(!this._summary||!this._table)return;let t=this._summary.dataset.currentMonthKey,e=0,r=0,i=0;this._table.querySelectorAll(".affiliate-row-month").forEach(s=>{if("none"===s.style.display)return;let n=parseFloat(s.dataset.revenue)||0,a=parseInt(s.dataset.orderCount,10)||0;e+=n,r+=a,s.dataset.month===t&&(i=n)});let s=this._summary.querySelector('[data-summary="total-revenue"]'),n=this._summary.querySelector('[data-summary="total-orders"]'),a=this._summary.querySelector('[data-summary="current-month"]');
1s&&(s.textContent=this._currencyFormatter.format(e)),n&&(n.textContent=r),a&&(a.textContent=this._currencyFormatter.format(i))}}let u=window.PluginManager;u.register("AffiliateRegistrationForm",class extends o{init(){this._submitUrl=this.el.dataset.submitUrl,this._uploadUrl=this.el.dataset.uploadUrl,this._genericError=this.el.dataset.genericError||"Something went wrong",this._documentInput=this.el.querySelector("[data-affiliate-registration-document-input]"),this._documentStatus=this.el.querySelector("[data-affiliate-registration-document-status]"),this._documentFilename=this.el.querySelector("[data-affiliate-registration-document-filename]"),this._documentIdField=document.getElementById("affiliate-registration-documentId"),this._alertBox=document.querySelector("[data-affiliate-registration-alert]"),this._successBox=document.querySelector("[data-affiliate-registration-success]"),this._submitButton=this.el.querySelector("[data-affiliate-registration-submit]"),this._termsCheckbox=this.el.querySelector('[name="agreedToTermsOfService"]'),this.el.addEventListener("submit",this._onSubmit.bind(this)),this._documentInput&&this._documentInput.addEventListener("change",this._onDocumentChange.bind(this)),this._termsCheckbox&&(this._updateSubmitState(),this._termsCheckbox.addEventListener("change",this._updateSubmitState.bind(this)))}_updateSubmitState(){this._submitButton&&this._termsCheckbox&&(this._submitButton.disabled=!this._termsCheckbox.checked)}async _onDocumentChange(){let t=this._documentInput.files[0];if(this._clearFieldError("document"),this._documentIdField.value="",!t){this._documentStatus.textContent="",this._resetDocumentFilename();return}this._setDocumentFilename(t.name),this._documentStatus.textContent=this._documentStatus.dataset.uploadingText||"...";let e=new FormData;e.append("document",t);try{let t=await fetch(this._uploadUrl,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},credentials:"same-origin",body:e}),r=await t.json();if(!t.ok||!r.success){this._documentStatus.textContent="",this._documentInput.value="",this._resetDocumentFilename(),this._setFieldError("document",r.error||this._genericError);return}this._documentIdField.value=r.documentId,this._documentStatus.textContent=""}catch(t){this._documentStatus.textContent="",this._resetDocumentFilename(),this._setFieldError("document",this._genericError)}}_setDocumentFilename(t){this._documentFilename&&(this._documentFilename.textContent=t)}_resetDocumentFilename(){this._documentFilename&&(this._documentFilename.textContent=this._documentFilename.dataset.noFileText||"")}async _onSubmit(t){t.preventDefault(),this._clearAllErrors(),this._hideAlert();let e=this._buildPayload(),r=this._validateTaxFields(e);if(Object.keys(r).length>0){Object.keys(r).forEach(t=>{this._setFieldError(t,r[t])}),this._scrollToFirstError();return}this._submitButton&&(this._submitButton.disabled=!0),console.log(e);try{let t=await fetch(this._submitUrl,{method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},credentials:"same-origin",body:JSON.stringify(e)}),r=await t.json();if(!t.ok||!r.success){r.errors?(Object.keys(r.errors).forEach(t=>{this._setFieldError(t,r.errors[t])}),this._scrollToFirstError()):this._showAlert(r.error||this._genericError);return}this._showSuccess()}catch(t){this._showAlert(this._genericError)}finally{this._updateSubmitState()}}_validateTaxFields(t){let e={},r=t.taxStatus,i=(t.ustId||"").trim(),s=(t.taxNumber||"").trim();if("smallBusiness"!==r&&"contractor"!==r||i||s)"abroad"!==r||i||(e.ustId=this.el.dataset.ustIdRequired||"Please provide a VAT ID.");else{let t=this.el.dataset.taxIdOrNumberRequired||"Please provide either a VAT ID or a tax number.";e.ustId=t,e.taxNumber=t}return e}_buildPayload(){let t={};return this.el.querySelectorAll("[name]").forEach(e=>{if(!e.name||"file"===e.type||"submit"===e.type)return;if("checkbox"===e.type){t[e.name]=e.checked;return}if("radio"===e.type){e.checked&&(t[e.name]=e.value);return}let r=e.value;if("follower"===e.name){t[e.name]=""===r?null:parseInt(r,10);return}t[e.name]=""===r?null:r}),t}_setFieldError(t,e){let r=document.getElementById(`affiliate-registration-${t}`)||this.el.querySelector(`[name="${t}"]`),i=document.getElementById(`affiliate-registration-${t}-feedback`)||document.getElementById(`${t}-feedback`);r&&r.classList.add("is-invalid"),i&&(i.innerHTML=`<div class="invalid-feedback d-block">${e}</div>`)}_clearFieldError(t){let e=document.getElementById(`affiliate-registration-${t}`)||this.el.querySelector(`[name="${t}"]`),r=document.getElementById(`affiliate-registration-${t}-feedback`)||document.getElementById(`${t}-feedback`);e&&e.classList.remove("is-invalid"),r&&(r.innerHTML="")}_scrollToFirstError(){let t=this.el.querySelector(".is-invalid");t&&(t.scrollIntoView({behavior:"smooth",block:"center"}),t.focus({preventScroll:!0}))}_clearAllErrors(){this.el.querySelectorAll(".is-invalid").forEach(t=>t.classList.remove("is-invalid")),this.el.querySelectorAll(".form-field-feedback").forEach(t=>{t.innerHTML=""})}_showAlert(t){this._alertBox&&(this._alertBox.textContent=t,this._alertBox.classList.remove("d-none"),this._alertBox.scrollIntoView({behavior:"smooth",block:"center"}))}_hideAlert(){this._alertBox&&this._alertBox.classList.add("d-none")}_showSuccess(){this.el.classList.add("d-none"),this._successBox&&this._successBox.classList.remove("d-none")}},"[data-affiliate-registration-form]"),u.register("AffiliateOverview",l,".affiliate-panel-wrapper")})();
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.