PageSourceSearch

https://www.hagi.com.pl/theme/ce0421f33bad1bfbf9f0248660393878/js/…/cr-check-payment-status.baa2e5.js

js hagi.com.pl collected 2026-09-25 18:48:59 UTC 10,817 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[34325],{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!==s},s="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 n(t,e,s){return t.concat(e).map(function(t){return i(t,s)})}function r(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,s,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=i;var c,h,u=Array.isArray(s);return u!==Array.isArray(t)?i(s,l):u?l.arrayMerge(t,s,l):(h={},(c=l).isMergeableObject(t)&&r(t).forEach(function(e){h[e]=i(t[e],c)}),r(s).forEach(function(e){(!a(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(a(t,e)&&c.isMergeableObject(s[e])?h[e]=(function(t,e){if(!e.customMerge)return o;var s=e.customMerge(t);return"function"==typeof s?s:o})(e,c)(t[e],s[e],c):h[e]=i(s[e],c))}),h)}o.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,s){return o(t,s,e)},{})},t.exports=o},714:(t,e,s)=>{s.r(e),s.d(e,{default:()=>r});var i=s(373),n=s(68);class r extends i.A{static #t=this.options={orderId:"",failUrl:"",checkUrl:"",textSuccess:"",subtitleSuccess:"",textTimeout:"",subtitleTimeout:"",textDeclined:"",subtitleDeclined:"",textMismatch:"",subtitleMismatch:"",waitingTime:12e4,redirectTo:""};init(){this._client=new n.A,this._ticks=0,this._inFlight=!1,this._finished=!1,this._checkInterval=3e3,this.totalTicks=Math.floor(this.options.waitingTime/this._checkInterval),this._card=this.el.querySelector(".blik-auth-card")||this.el.querySelector("[data-info]"),this._progressBar=this.el.querySelector(".blik-progress-bar"),this._checkOrderPayment(),this._checkPaymentInterval()}_checkPaymentInterval(){this.loopInterval=setInterval(this._loop.bind(this),this._checkInterval)}_loop(){if(this._ticks++,!this._finished&&this._ticks>=this.totalTicks){this._reconcile();return}this._checkOrderPayment()}_reconcile(){this._finished||this._client.post(this.options.checkUrl,JSON.stringify({orderId:this.options.orderId,reconcile:!0}),t=>{try{let e=JSON.parse(t);!0===e.status?this._finish("success"):!0===e.mismatch?this._finish("mismatch"):this._finish("failed","timeout")}catch(t){this._finish("failed","timeout")}})}_checkOrderPayment(){this._finished||this._inFlight||(this._inFlight=!0,this._client.post(this.options.checkUrl,JSON.stringify({orderId:this.options.orderId}),t=>{this._inFlight=!1;try{this._handleStatus(JSON.parse(t))}catch(t){console.error("Error parsing payment status response",t)}}))}_handleStatus(t){if(!this._finished){if(!0===t.status&&!1===t.waiting){this._finish("success");return}if(!0===t.mismatch){this._finish("mismatch");return}(!0===t.failed||!1===t.status&&!1===t.waiting)&&this._finish("failed","declined")}}_finish(t,e){this._finished||(this._finished=!0,clearInterval(this.loopInterval),this._changeLayout(t,e),"success"===t&&this._redirectToPage())}_redirectToPage(){if(!this.options.redirectTo)return;let t=this.el.querySelector(".redirect-countdown");this._countdownInterval&&clearInterval(this._countdownInterval);let e=3,s=(e,s)=>{if(!t)return;t.textContent="Przekierowanie za ";let i=document.createElement("span");i.textContent=String(e),t.appendChild(i),t.appendChild(document.createTextNode(` ${s}...`))};t&&(s(e,"sekund"),t.style.display="block"),this._countdownInterval=setInterval(()=>{--e>0?s(e,1===e?"sekundę":"sekund"):(t&&(t.textContent="Przekierowanie..."),clearInterval(this._countdownInterval),setTimeout(()=>{window.location.replace(this.options.redirectTo)},300))},1e3)}_changeLayout(t,e){let s=this._card;if(!s)return;let i=s.querySelector("[data-title]")||s.querySelector("h2"),n=s.querySelector("[data-subtitle]"),r=s.querySelector(".spinner-border"),a=s.querySelector(".check"),o=s.querySelector("[data-error-icon]"),l=s.querySelector("#editPayment"),c=s.querySelector(".redirect-countdown");if(r&&r.classList.add("d-none"),"success"===t){a&&a.classList.remove("d-none"),o&&o.classList.add("d-none"),l&&l.classList.add("d-none"),i&&(i.textContent=this.options.textSuccess||"Płatność zakończona pomyślnie!",i.classList.remove("text-danger"),i.classList.add("text-success")),n&&(n.textContent=this.options.subtitleSuccess||""),c&&(c.style.display="block");return}if("mismatch"===t){a&&a.classList.add("d-none"),o&&o.classList.remove("d-none"),c&&(c.style.display="none"),l&&l.classList.add("d-none"),i&&(i.textContent=this.options.textMismatch||"Płatność zrealizowana, ale niezaksięgowana",i.classList.remove("text-success","text-danger"),i.classList.add("text-warning")),n&&(n.textContent=this.options.subtitleMismatch||"Płatność została zrealizowana w bramce, ale sklep jeszcze jej nie zaksięgował. Skontaktuj się z obsługą sklepu, podając numer zamówienia.");return}let h="declined"===e;a&&a.classList.add("d-none"),o&&o.classList.remove("d-none"),c&&(c.style.display="none"),i&&(i.textContent=h?this.options.textDeclined||"Płatność nie powiodła się":this.options.textTimeout||"Upłynął czas oczekiwania na płatność",i.classList.remove("text-success"),i.classList.add("text-danger")),n&&(n.textContent=h?this.options.subtitleDeclined||"Twoja płatność została odrzucona lub anulowana.":this.options.subtitleTimeout||"Nie otrzymaliśmy potwierdzenia płatności na czas."),l&&l.classList.remove("d-none")}}},373:(t,e,s)=>{s.d(e,{A:()=>
1o});var i=s(156),n=s.n(i);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 s=r.toUpperCamelCase(t,e);return r.lcFirst(s)}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()}}}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]:{},s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(t,{detail:e,cancelable:s});return this.el.dispatchEvent(i),i}subscribe(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,n=t.split("."),r=s.scope?e.bind(s.scope):e;if(s.once&&!0===s.once){let e=r;r=function(s){i.unsubscribe(t),e(s)}}return this.el.addEventListener(n[0],r),this.listeners.push({splitEventName:n,opts:s,cb:r}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,s)=>([...s.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(s.splitEventName[0],s.cb):t.push(s),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={},s=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${s}".`);return}this.el=t,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(s),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()),n().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=r.toDashCase(this._pluginName),s=this.el.getAttribute(`data-${e}-config`);return s?window.PluginConfigManager.get(this._pluginName,s):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=r.toDashCase(this._pluginName),s=this.el.getAttribute(`data-${e}-options`);if(s)try{return JSON.parse(s)}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}}},68:(t,e,s)=>{s.d(e,{A:()=>i});class i{constructor(){this._request=null,this._errorHandlingInternal=!1}get(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",i=this._createPreparedRequest("GET",t,s);return this._sendRequest(i,null,e)}post(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(e,i);let n=this._createPreparedRequest("POST",t,i);return this._sendRequest(n,e,s)}delete(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(e,i);let n=this._createPreparedRequest("DELETE",t,i);return this._sendRequest(n,e,s)}patch(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(e,i);let n=this._createPreparedRequest("PATCH",t,i);return this._sendRequest(n,e,s)}
1abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(t){this._errorHandlingInternal=t}_registerOnLoaded(t,e){e&&(!0===this._errorHandlingInternal?(t.addEventListener("load",()=>{e(t.responseText,t)}),t.addEventListener("abort",()=>{console.warn(`the request to ${t.responseURL} was aborted`)}),t.addEventListener("error",()=>{console.warn(`the request to ${t.responseURL} failed with status ${t.status}`)}),t.addEventListener("timeout",()=>{console.warn(`the request to ${t.responseURL} timed out`)})):t.addEventListener("loadend",()=>{e(t.responseText,t)}))}_sendRequest(t,e,s){return this._registerOnLoaded(t,s),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,s){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),s&&this._request.setRequestHeader("Content-type",s),this._request}}}}]);

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.