PageSourceSearch

https://golebimarket.pl/application/assets/storefront/chunk-p24_installments_modal_initializer.4p746BG.js

js golebimarket.pl collected 2026-10-04 19:43:44 UTC 5,057 bytes, 19 lines download raw bytes

1import{bq as h,bh as M,M as f,bz as p,S as A,C as S}from"./storefrontApp.CsApItsi.min.js";import{b as d,d as c,$ as g,e as _}from"./chunk-vendor-lit.NvY0u02.js";import{B as E}from"./chunk-basket_updated_handler.eDRRsA9.js";import{P as L}from"./chunk-product_stock_changed_handler.C3zWS6V.js";import{S as N}from"./chunk-storefront_base_lit_element.lX23Jvc.js";import{S as v}from"./chunk-storefront_settings_constants.DIF02Gz.js";import"./chunk-vendor-di.Bh23gdA.js";import"./chunk-vendor-rxjs.Dp7kflo.js";import"./chunk-vendor-lodash.CWHFt7Z.js";import"./chunk-vendor-phoenix.cdKS79L.js";import"./chunk-product_events_constants.BHFu5GP.js";const C="p24-installments-button",m={visible:"p24-installments-modal_visible"},l={product:"product",basket:"basket"},T={ready:"READY"},I={closeModal:"closeModal"};var b=Object.defineProperty,u=(a,t,s,i)=>{for(var e=void 0,n=a.length-1,r;n>=0;n--)(r=a[n])&&(e=r(t,s,e)||e);return e&&b(t,s,e),e};class o extends N{constructor(){super(),this.amount=0,this.mode=l.product,this._installmentsModalRef=d(),this._installmentsModalFrameRef=d(),this._$installmentsButton=null,this._installmentCalculatorApp=null,this._handleModalReady=()=>{this._installmentsModalFrameRef.value?.contentWindow?.postMessage({config:this._config},"*")},this._closeModal=()=>{this._installmentsModalRef.value?.classList.remove(m.visible)},this._initP24InstallmentsCalculatorScript=async()=>{await h.create("p24-installment-calculator","https://apm.przelewy24.pl/installments/installment-calculator-app.umd.sdk.js")},this._setupModalConfig=()=>{const t=this._storefrontSettingsApi.getP24InstallmentsSettings();t&&(this._config={sign:t.installmentsHubSign,posid:t.partnerMerchantId,method:t.installmentsHubMethodId,amount:this.amount,currency:t.currency,lang:new M(t.locale).getLocaleLanguage(),cms:"shoper",test:t.isTest})},this._setupCalculator=()=>{if(!this._config||typeof InstallmentCalculatorApp>"u"){console.error("InstallmentCalculatorApp or config is not available.");return}this._installmentCalculatorApp=new InstallmentCalculatorApp(this._config),this._updateModalLink()},this._updateModalOnBasketUpdate=({body:t})=>{if(!t)return;const s=this._convertPriceToMinorUnitFractions(t?.sum.grossValue);this._updateModal(s)},this._updateModalOnStockChanged=({body:t})=>{if(!t)return;const s=this._convertPriceToMinorUnitFractions(t.price.gross.final.float);this._updateModal(s)},this._updateModal=t=>{if(!this._config){console.error("Missing config");return}this.amount=t,this._config={...this._config,amount:t},this._installmentCalculatorApp&&(this._installmentCalculatorApp.widgetConfig.amount=t,this._updateModalLink())},this._updateModalLink=()=>{const t=this._installmentCalculatorApp?.getCalculatorUrl();t&&this._installmentsModalFrameRef.value?.getAttribute("src")!==t&&this._installmentsModalFrameRef.value?.setAttribute("src",t)},this._openModal=()=>{this._installmentsModalRef.value?.classList.add(m.visible)},this._handleModalActions=t=>{const s=t.data,i=s?.type||s?.action;if(i&&this._isValidActionName(i)){const e=this._modalActionsMap[i];e()}},this._messageStorageApi=this.getApiSync(f),this._storefrontSettingsApi=this.getApiSync(v.api),this._modalActionsMap={[T.ready]:this._handleModalReady,[I.closeModal]:this._closeModal}}static{this.moduleName=p.component}connectedCallback(){super.connectedCallback(),this._$installmentsButton||(this._$installmentsButton=this.querySelector(`#${C}`))}async firstUpdated(t){super.firstUpdated(t),await this._initP24InstallmentsCalculatorScript(),this._setupModalConfig(),this._setupCalculator(),this._setupEvents()}_setupEvents(){this.mode===l.product?new L(this._updateModalOnStockChanged):this.mode===l.basket&&new E(this._updateModalOnBasketUpdate,this._messageStorageApi),this._$installmentsButton?.addEventListener("click",this._openModal),window.addEventListener("message",this._handleModalActions)}_convertPriceToMinorUnitFractions(t){return t*100}_isValidActionName(t){return t in this._modalActionsMap}disconnectedCallback(){super.disconnectedCallback(),this._$installmentsButton?.removeEventListener("click",this._openModal),window.removeEventListener("message",this._handleModalActions)}render(){return g`
2            ${this.getSlot("modal-opener")}
3
4            <div
5                id="p24-installments-modal"
6                class="p24-installments-modal"
7                ${c(this._installmentsModalRef)}
8            >
9                <div class="p24-installments-modal__content">
10                    <iframe
11                        id="p24-installments-modal-frame"
12                        class="p24-installments-modal__frame"
13                        title="installment-calculator"
14                        ${c(this._installmentsModalFrameRef)}
15                    >
16                    </iframe>
17                </div>
18            </div>
19        `}}u([_({type:Number})],o.prototype,"amount");u([_({type:String})],o.prototype,"mode");class V extends A{static{this.featureName=p.feature}init(){return{cores:[{type:S,instance:[o]}]}}}export{V as P24InstallmentsModalInitializer};

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.