PageSourceSearch

https://www.lepona.de/public/theme/af75b816cf655c543e36d5ca303bf3f…rp.order-document-download.plugin.a1184c.js

js lepona.de collected 2026-10-08 10:53:57 UTC 11,753 bytes, 8 lines download raw bytes

1"use strict";(self.webpackChunkhastedt_erp=self.webpackChunkhastedt_erp||[]).push([[65623],{156(e){var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==n},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function r(e,t,n){return e.concat(t).map(function(e){return i(e,n)})}function s(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function o(e,t){try{return t in e}catch(e){return!1}}function a(e,n,l){(l=l||{}).arrayMerge=l.arrayMerge||r,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=i;var c,u,h=Array.isArray(n);return h!==Array.isArray(e)?i(n,l):h?l.arrayMerge(e,n,l):(u={},(c=l).isMergeableObject(e)&&s(e).forEach(function(t){u[t]=i(e[t],c)}),s(n).forEach(function(t){(!o(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(o(e,t)&&c.isMergeableObject(n[t])?u[t]=(function(e,t){if(!t.customMerge)return a;var n=t.customMerge(e);return"function"==typeof n?n:a})(t,c)(e[t],n[t],c):u[t]=i(n[t],c))}),u)}a.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,n){return a(e,n,t)},{})},e.exports=a},623(e,t,n){n.r(t),n.d(t,{default:()=>o});var i=n(737);class r{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",i=this._createPreparedRequest("GET",e,n);return this._sendRequest(i,null,t)}post(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let r=this._createPreparedRequest("POST",e,i);return this._sendRequest(r,t,n)}delete(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let r=this._createPreparedRequest("DELETE",e,i);return this._sendRequest(r,t,n)}patch(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(t,i);let r=this._createPreparedRequest("PATCH",e,i);return this._sendRequest(r,t,n)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(e){this._errorHandlingInternal=e}_registerOnLoaded(e,t){t&&(!0===this._errorHandlingInternal?(e.addEventListener("load",()=>{t(e.responseText,e)}),e.addEventListener("abort",()=>{console.warn(`the request to ${e.responseURL} was aborted`)}),e.addEventListener("error",()=>{console.warn(`the request to ${e.responseURL} failed with status ${e.status}`)}),e.addEventListener("timeout",()=>{console.warn(`the request to ${e.responseURL} timed out`)})):e.addEventListener("loadend",()=>{t(e.responseText,e)}))}_sendRequest(e,t,n){return this._registerOnLoaded(e,n),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,n){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),n&&this._request.setRequestHeader("Content-type",n),this._request}}var s=n(795);class o extends i.A{static #e=this.options={fileIconSelector:".file-icon",warningIconSelector:".warning-icon",textSelector:".invoice-text",spinnerSelector:".spinner-border"};init(){this._client=new r,this._fileIcon=s.A.querySelector(this.el,this.options.fileIconSelector,!1),this._warningIcon=s.A.querySelector(this.el,this.options.warningIconSelector,!1),this._textElement=s.A.querySelector(this.el,this.options.textSelector,!1),this._spinner=s.A.querySelector(this.el,this.options.spinnerSelector,!1),this.registerEvents()}registerEvents(){this.el.addEventListener("click",this.onInvoiceButtonClick.bind(this))}onInvoiceButtonClick(e){e.preventDefault();let t=this.el.dataset.orderNumber,n=this.el.dataset.invoiceUrl,i=this.el.dataset.documentType,r=this.el.dataset.documentId;this.setLoading(!0),this._client.post(n,JSON.stringify({orderNumber:t,documentType:i,documentId:r}),this.handleResponse.bind(this))}handleResponse(e){let t;this.setLoading(!1);try{t=JSON.parse(e)}catch{this.handleUnavailableInvoice();return}t.error?this.handleUnavailableInvoice():this.downloadInvoice(t)}handleUnavailableInvoice(){this._textElement&&(this._textElement.textContent=this.el.dataset.noInvoiceText),this._fileIcon&&(this._fileIcon.style.display="none"),this._warningIcon&&(this._warningIcon.style.display="inline-block"),this.el.disabled=!0,this.el.classList.remove("btn-primary"),this.el.classList.add("btn-outline-danger")}downloadInvoice(e){let t=this.base64ToBlob(e.content,"application/pdf"),n=document.createElement("a");n.href=window.URL.createObjectURL(t),n.download=e.filename||`invoice_${e.id}.pdf`,n.click()}base64ToBlob(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"application/octet-stream";if(!/^[A-Za-z0-9+/]*={0,2}$/.test(e))return console.error("Invalid base64 string"),null;e+="===".slice(0,(4-e.length%4)%4);let n=window.atob(e),i=n.length,r=new Uint8Array(i);for(let e=0;e<i;e++)r[e]=n.charCodeAt(e);return new Blob([r],{type:t})}setLoading(e){this.el.disabled=e,this._spinner&&(this._spinner.style.display=e?"inline-block":"none"),this._fileIcon&&(this._fileIcon.style.display=e?"none":"inline-block"),this._textElement&&(this._textElement.style.display=e?"none":"inline-block")}}},707(e,t,n){n.d(t,{A:()=>i});
1class i{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let n=i.toUpperCamelCase(e,t);return i.lcFirst(n)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>i.ucFirst(e.toLowerCase())).join(""):i.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}},737(e,t,n){n.d(t,{A:()=>a});var i=n(156),r=n.n(i),s=n(707);class o{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(e,{detail:t,cancelable:n});return this.el.dispatchEvent(i),i}subscribe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,r=e.split("."),s=n.scope?t.bind(n.scope):t;if(n.once&&!0===n.once){let t=s;s=function(n){i.unsubscribe(e),t(n)}}return this.el.addEventListener(r[0],s),this.listeners.push({splitEventName:r,opts:n,cb:s}),!0}unsubscribe(e){arguments.length>1&&"function"==typeof arguments[1]&&console.warn(`[NativeEventEmitter] Unsubscribing by passing the subscriber function as a second argument is not supported. By default, all listeners for the event will be removed. Use a suffix (separated by a dot) on the event name when subscribing/unsubscribing to identify/target your specific listener only, e.g. "${e}.MyCustomPlugin"`);let t=e.split(".");return this.listeners=this.listeners.reduce((e,n)=>([...n.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(n.splitEventName[0],n.cb):e.push(n),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}}class a{constructor(e,t={},n=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${n}".`);return}this.el=e,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(n),this.options=this._mergeOptions(t),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(){}destroy(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let t=[this.constructor.options,this.options,e];return t.push(this._getConfigFromDataAttribute()),t.push(this._getOptionsFromDataAttribute()),r().all(t.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_getConfigFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=s.A.toDashCase(this._pluginName),n=this.el.getAttribute(`data-${t}-config`);return n?window.PluginConfigManager.get(this._pluginName,n):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=s.A.toDashCase(this._pluginName),n=this.el.getAttribute(`data-${t}-options`);if(n)try{return JSON.parse(n)}catch(e){console.error(`The data attribute "data-${t}-options" could not be parsed to json: ${e.message}`)}return e}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}}},795(e,t,n){n.d(t,{A:()=>r});var i=n(707);class r{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!r.isNode(e))throw Error("The element must be a valid HTML Node!");return"function"==typeof e.hasAttribute&&e.hasAttribute(t)}static getAttribute(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(n&&!1===r.hasAttribute(e,t))throw Error(`The required property "${t}" does not exist!`);
1if("function"!=typeof e.getAttribute){if(n)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=t.replace(/^data(|-)/,""),o=i.A.toLowerCamelCase(s,"-");if(!r.isNode(e)){if(n)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===e.dataset){if(n)throw Error("This node doesn't support the dataset attribute!");return}let a=e.dataset[o];if(void 0===a){if(n)throw Error(`The required data attribute "${t}" does not exist on ${e}!`);return a}return i.A.parsePrimitive(a)}static querySelector(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(n&&!r.isNode(e))throw Error("The parent node is not a valid HTML Node!");let i=e.querySelector(t)||!1;if(n&&!1===i)throw Error(`The required element "${t}" does not exist in parent node!`);return i}static querySelectorAll(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(n&&!r.isNode(e))throw Error("The parent node is not a valid HTML Node!");let i=e.querySelectorAll(t);if(0===i.length&&(i=!1),n&&!1===i)throw Error(`At least one item of "${t}" must exist in parent node!`);return i}static getFocusableElements(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,t=`
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 e.querySelectorAll(t)}static getFirstFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(e)[0]}static getLastFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=this.getFocusableElements(e);return t[t.length-1]}}}}]);

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.