rebill-web-components-sdk 1.13.19 → 1.13.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/cjs/card-fields-wrapper_11.cjs.entry.js +1 -1
  2. package/dist/cjs/{google-maps.service-C61Pm1no.js → google-maps.service-CZcMzFBX.js} +49 -3
  3. package/dist/cjs/google-maps.service-CZcMzFBX.js.map +1 -0
  4. package/dist/cjs/index-C-VTnc0I.js.map +1 -1
  5. package/dist/cjs/rebill-change-card.cjs.entry.js +1 -1
  6. package/dist/cjs/rebill-checkout.cjs.entry.js +1 -1
  7. package/dist/cjs/rebill-renewal.cjs.entry.js +1 -1
  8. package/dist/collection/utils/google-maps.service.js +47 -1
  9. package/dist/collection/utils/google-maps.service.js.map +1 -1
  10. package/dist/components/p-8BpuJ_V5.js.map +1 -1
  11. package/dist/components/{p-BLo8Aps6.js → p-8MtEW13e.js} +49 -3
  12. package/dist/components/p-8MtEW13e.js.map +1 -0
  13. package/dist/components/{p-D2qupJgh.js → p-C8zfxcyS.js} +3 -3
  14. package/dist/components/{p-D2qupJgh.js.map → p-C8zfxcyS.js.map} +1 -1
  15. package/dist/components/rebill-address-search.js +1 -1
  16. package/dist/components/rebill-address.js +1 -1
  17. package/dist/components/rebill-change-card.js +2 -2
  18. package/dist/components/rebill-checkout.js +2 -2
  19. package/dist/components/rebill-renewal.js +2 -2
  20. package/dist/esm/card-fields-wrapper_11.entry.js +1 -1
  21. package/dist/esm/{google-maps.service-DM1Z3gTC.js → google-maps.service-C2nYpE_A.js} +49 -3
  22. package/dist/esm/google-maps.service-C2nYpE_A.js.map +1 -0
  23. package/dist/esm/index-D8cwEAmw.js.map +1 -1
  24. package/dist/esm/rebill-change-card.entry.js +1 -1
  25. package/dist/esm/rebill-checkout.entry.js +1 -1
  26. package/dist/esm/rebill-renewal.entry.js +1 -1
  27. package/dist/rebill-web-components-sdk/p-C2nYpE_A.js +2 -0
  28. package/dist/rebill-web-components-sdk/p-C2nYpE_A.js.map +1 -0
  29. package/dist/rebill-web-components-sdk/p-D8cwEAmw.js.map +1 -1
  30. package/dist/rebill-web-components-sdk/{p-f08ee974.entry.js → p-b9a3b27f.entry.js} +2 -2
  31. package/dist/rebill-web-components-sdk/{p-fa2647be.entry.js → p-bf15156a.entry.js} +2 -2
  32. package/dist/rebill-web-components-sdk/{p-0c396bf4.entry.js → p-c327a984.entry.js} +2 -2
  33. package/dist/rebill-web-components-sdk/{p-5c4c4d5f.entry.js → p-f3859b65.entry.js} +2 -2
  34. package/dist/rebill-web-components-sdk/rebill-web-components-sdk.esm.js +1 -1
  35. package/package.json +1 -1
  36. package/dist/cjs/google-maps.service-C61Pm1no.js.map +0 -1
  37. package/dist/components/p-BLo8Aps6.js.map +0 -1
  38. package/dist/esm/google-maps.service-DM1Z3gTC.js.map +0 -1
  39. package/dist/rebill-web-components-sdk/p-DM1Z3gTC.js +0 -2
  40. package/dist/rebill-web-components-sdk/p-DM1Z3gTC.js.map +0 -1
  41. /package/dist/rebill-web-components-sdk/{p-f08ee974.entry.js.map → p-b9a3b27f.entry.js.map} +0 -0
  42. /package/dist/rebill-web-components-sdk/{p-fa2647be.entry.js.map → p-bf15156a.entry.js.map} +0 -0
  43. /package/dist/rebill-web-components-sdk/{p-0c396bf4.entry.js.map → p-c327a984.entry.js.map} +0 -0
  44. /package/dist/rebill-web-components-sdk/{p-5c4c4d5f.entry.js.map → p-f3859b65.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{r as t,c as e,h as i}from"./p-D8cwEAmw.js";import{c as s}from"./p-MMCcKmy_.js";import{a as n}from"./p-CtVYl54u.js";import{g as o,P as a,C as r,a as l}from"./p-CYYBIKsp.js";import{s as c,a as d,I as h,S as u,i as m,P as p,o as f,b as y}from"./p-B0zTy7-V.js";import{S as b}from"./p-vsLqF4hk.js";import{B as g,g as w,i as k}from"./p-Do_vNuMa.js";import{G as x}from"./p-DM1Z3gTC.js";import{m as v,b as C,s as I,i as P,g as S}from"./p-CznPkI5O.js";import{P as N}from"./p-NRdSSs6s.js";import"./p-E-ZsRS8r.js";import"./p-gx2Z4Khq.js";const j={checkoutSummary:true,submitButton:true,billingAddress:true,customerInformation:true,discountCode:true,logo:true,footer:true,sandboxMode:true,processingPayment:true,successPage:true,errorMessage:true,useAddressSearch:true};var M;(function(t){t["BAMBOO"]="bamboo_payment";t["FISERV"]="fiserv";t["KUSHKI"]="kushki";t["PAYWAY"]="payway";t["DOCK"]="dock";t["KLAP"]="klap";t["MOVII"]="movii";t["STRIPE"]="stripe";t["DECIDIR"]="decidir"})(M||(M={}));function R(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//")}function D(t){return`${t}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}function T(t,e){const i=document.createElement("link");i.rel="stylesheet";i.href=t;i.id=e;i.setAttribute("data-rebill-injected","true");return i}function z(t,e){const i=document.createElement("style");i.id=e;i.setAttribute("data-rebill-injected","true");i.textContent=t;return i}function q(t,e){const i=document.createElement("script");i.src=t;i.id=e;i.setAttribute("data-rebill-injected","true");i.async=true;return i}function A(t,e){const i=document.createElement("script");i.id=e;i.setAttribute("data-rebill-injected","true");i.textContent=t;return i}function E(t){if(!t){return}try{t.remove()}catch(t){console.warn("Error removing injected resource:",t)}}function O(t,e=null){if(!t){return null}E(e);const i=D("rebill-checkout-css");const s=R(t)?T(t,i):z(t,i);document.head.appendChild(s);return s}function F(t,e=null){if(!t){return null}E(e);const i=D("rebill-checkout-js");const s=R(t)?q(t,i):A(t,i);document.head.appendChild(s);return s}function K(t){E(t)}function B(t){E(t)}const L=async(t,e,i)=>{const s=await n.checkout.getRequiredFields({currency:t,method:e},i);return{fields:v(s.data),original:s.data}};const V=async()=>{const t=c.data?.itemInformation?.paymentMethods;const e=t.map((async t=>{try{const e=N.mapToAPMPaymentMethod(t,c.data?.pricing?.country);const i=await L(c.data.pricing.currency,e,c.data.organization.id);return{paymentMethod:t,...i}}catch(e){console.error(`Error getting required fields for ${t}:`,e);return{paymentMethod:t,fields:[],original:[]}}}));const i=await Promise.all(e);const s={};i.forEach((t=>{s[t.paymentMethod]={fields:t.fields,original:t.original}}));return s};const $=(t,e)=>{const i=e[t];if(i){return i}else{return{fields:[],original:[]}}};const Z=t=>typeof t==="string"?JSON.parse(t):t;const Y=t=>Z(t);const _=()=>"190.188.127.250";const J=async({publicKey:t,instantProduct:e,instantPlan:i})=>{const s=Z(e?e:i);const{metadata:a,...r}=s;const l=await n.sessions.createSDKInstantSessionRequest(r,o(),_(),t);const c={...l.data,...l.data.plan&&{plan:{...l.data.plan,description:s.description||[],metadata:a||null}},...l.data.product&&{product:{...l.data.product,description:s.description||[],metadata:a||null}}};const d=c;return d};const U=async({publicKey:t,productId:e,planId:i})=>{const s=await n.sessions.createSDKItemSessionRequest({...e?{productId:e}:{},...i?{planId:i}:{},idempotencyKey:o(),deviceId:"123123123",clientIP:_(),publicKey:t});const a=s.data;return a};const X=async({publicKey:t,checkoutLandingSession:e,instantProduct:i,instantPlan:s,productId:n,planId:o})=>{if(e){const t=await Y(e);return{session:t,type:d.CHECKOUT_LANDING}}if(i||s){const e=await J({publicKey:t,instantProduct:i,instantPlan:s});return{session:e,type:d.INSTANT}}if(n||o){const e=await U({publicKey:t,productId:n,planId:o});return{session:e,type:d.SDK_ITEM}}};const W="@media (max-width: 1024px){.rebill-checkout{width:100%;flex-direction:column;gap:0;justify-content:flex-start;background:var(--rebill-color-background);padding:20px}.right-section-checkout .left-section{width:100%;height:100%;background:var(--rebill-color-background)}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;gap:24px;height:100%}.otp-container{display:flex;flex-direction:column;justify-content:flex-start;gap:24px}.rebill-checkout.full-width-layout .left-section{width:100%}.rebill-checkout.full-width-layout .left-section-container{max-width:none;width:100%}}@media (min-width: 1025px){.rebill-checkout{width:100%;min-height:600px;display:flex;flex-direction:row;justify-content:center;overflow-y:auto}.left-section{display:flex;width:60%;background:var(--rebill-color-background-left);justify-content:space-around}.right-section-checkout{display:flex;padding-top:72px;width:40%;background:var(--rebill-color-background-right);position:sticky;top:0;justify-content:center}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;margin-bottom:36px;gap:32px}.left-section-container{max-width:450px;min-width:450px;margin:2.5rem 2rem 1.5rem 2rem;display:flex;flex-direction:column}.checkout-summary-section{max-width:450px;min-width:350px;margin:0rem 2rem;background:var(--rebill-color-background-right);display:flex;flex-direction:column;justify-content:flex-start;width:100%}.checkout-form-section user-information,.checkout-form-section payment-method-selector,.checkout-form-section rebill-address,.checkout-summary-section rebill-summary{width:100%}.rebill-checkout.full-width-layout .left-section{width:100%;justify-content:stretch}.rebill-checkout.full-width-layout .left-section-container{max-width:none;min-width:auto;width:100%;margin:2.5rem 2rem 1.5rem 2rem}.pac-container{border-radius:4px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border:1px solid #e0e0e0;margin-top:4px;font-family:inherit}.pac-item{padding:10px 12px;cursor:pointer;border-top:none}.pac-item:first-child{border-top:none}.pac-item:hover{background-color:#f5f5f5}.pac-item-query{font-weight:500}.pac-icon{display:none}}.payment-button-container{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.animated-component{transition:all 0.3s ease-in-out;overflow:visible}.fade-in{animation:fadeIn 0.4s ease-in-out}.slide-in{animation:slideIn 0.5s ease-out}@keyframes fadeIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideIn{from{opacity:0;transform:translateX(-20px);max-height:0}to{opacity:1;transform:translateX(0);max-height:450px}}.animated-component.hide{animation:fadeOut 0.3s ease-in-out forwards}@keyframes fadeOut{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}rebill-mode-sandbox{position:fixed;bottom:50px;left:50%;transform:translateX(-50%);z-index:1000}@media (max-width: 1024px){rebill-test-mode-chip{bottom:46px}}@media (min-width: 1025px){rebill-test-mode-chip{bottom:46px}}.mode-sandbox-mobile-container{display:flex;align-items:center;width:100%;padding:0;margin:0;box-sizing:border-box}@media (min-width: 1451px){.left-section-container{min-width:450px;margin:2.5rem 5rem 1.5rem 5rem}.checkout-summary-section{min-width:450px;margin:0rem 5rem}}";const G=class{constructor(i){t(this,i);this.error=e(this,"error");this.success=e(this,"success");this.successRedirect=e(this,"successRedirect");this.formChange=e(this,"formChange");this.paymentMethodSelected=e(this,"paymentMethodSelected")}productId;planId;publicKey;instantProduct;instantPlan;display;customerInformation;oneClickCheckout=true;css;js;language;async handleLanguageChange(t,e){if(t&&t!==e){try{await h.changeLanguage(t);u.changeLanguage(t);console.log(`[RebillCheckout] Language changed from ${e} to ${t}`)}catch(t){console.error("[RebillCheckout] Failed to change language:",t)}}}error;success;successRedirect;formChange;couponCode;checkoutLandingSession;externalPayment;rejectedPaymentCard=false;rejectedPaymentAPM=false;countries=[];currentPaymentMethod;checkoutResponse=null;isSubmitting=false;isCardSubmitting=false;isCardSuccess=false;isAPMSubmitting=false;isAPMSuccess=false;storedCheckoutResults=new Map;alertErrorKeys=null;currentApmPaymentMethod=null;breakpoint=g.DESKTOP;showRefreshModal=false;cardError={showCardInvalid:false,type:null};initialData={};allRequiredFields={};currentRequiredFields=[];customerExists=false;showOtp=false;otpVerified=false;responseCheckoutCard=null;cardMode=null;formElement;emailDebounceTimeout=null;injectedStyleElement=null;injectedScriptElement=null;get displayConfig(){if(!this.display){return j}if(typeof this.display==="string"){try{const t=JSON.parse(this.display);return{...j,...t}}catch(t){console.warn("Invalid display configuration string, using defaults:",t);return j}}return{...j,...this.display}}get parsedCustomerInformation(){if(!this.customerInformation){return null}if(typeof this.customerInformation==="string"){try{return JSON.parse(this.customerInformation)}catch(t){console.warn("Invalid customerInformation configuration string, ignoring:",t);return null}}return this.customerInformation}get filteredPaymentMethods(){const t=c.data?.itemInformation?.paymentMethods||[];const e=this.displayConfig.excludePaymentMethods;if(!e||e.length===0){return t}return t.filter((t=>!e.includes(t)))}getCombinedUserData(t={}){const e=c.data.userInformation;const i=this.parsedCustomerInformation;return{email:t?.email||i?.email||e.email,fullName:t?.fullName||i?.fullName||e.fullName,countryCodePhoneNumber:t?.countryCodePhoneNumber||i?.phoneNumber?.countryCode||i?.countryCode||e.countryCode,phoneNumber:t?.phoneNumber||i?.phoneNumber?.number||e.phoneNumber,documentType:t?.documentType||i?.documentType||e.documentType,documentNumber:t?.documentNumber||i?.documentNumber||e.documentNumber,"billing-country":t?.["billing-country"]||i?.address?.billingAddress?.country||e.address?.billingAddress?.country,"billing-state":t?.["billing-state"]||i?.address?.billingAddress?.state||e.address?.billingAddress?.state,"billing-address":t?.["billing-address"]||i?.address?.billingAddress?.address||e.address?.billingAddress?.address,"billing-city":t?.["billing-city"]||i?.address?.billingAddress?.city||e.address?.billingAddress?.city,"billing-zip":t?.["billing-zip"]||i?.address?.billingAddress?.zip||e.address?.billingAddress?.zip,"billing-addInformation":t?.["billing-addInformation"]||i?.address?.billingAddress?.addInformation||e.address?.billingAddress?.addInformation}}injectCustomCSS(){this.injectedStyleElement=O(this.css,this.injectedStyleElement)}cleanupInjectedCSS(){K(this.injectedStyleElement);this.injectedStyleElement=null}injectCustomJS(){this.injectedScriptElement=F(this.js,this.injectedScriptElement)}cleanupInjectedJS(){B(this.injectedScriptElement);this.injectedScriptElement=null}timeToRedirectAPM=5e3;resizeHandler=()=>{const t=w(window.innerWidth);if(t!==this.breakpoint){this.breakpoint=t}};disconnectedCallback(){window.removeEventListener("resize",this.resizeHandler);if(this.emailDebounceTimeout){clearTimeout(this.emailDebounceTimeout);this.emailDebounceTimeout=null}this.cleanupInjectedCSS();this.cleanupInjectedJS()}async componentWillLoad(){try{this.resizeHandler();window.addEventListener("resize",this.resizeHandler);this.injectCustomCSS();this.injectCustomJS();if(this.language){await h.changeLanguage(this.language)}else{m()}const{session:t,type:e}=await X({publicKey:this.publicKey,checkoutLandingSession:this.checkoutLandingSession,instantProduct:this.instantProduct,instantPlan:this.instantPlan,productId:this.productId,planId:this.planId});const i=t?.restoredOTP;u.initializeSession({session:t,type:e,payment:typeof this.externalPayment==="string"?JSON.parse(this.externalPayment):this.externalPayment});if(i){u.setAccessToken(i.accessToken);u.setCustomerId(i.customerId);u.setUserInformation(i.userInformation);this.otpVerified=true;this.cardMode="select"}if(c.sessionRefreshed){this.showRefreshModal=true}x.loadGoogleMapsScript();const s=await n.data.getCountries();this.countries=s.data;if(this.parsedCustomerInformation){u.setUserInformation(this.parsedCustomerInformation)}this.initialData=this.getInitialData();this.allRequiredFields=await V();if(this.filteredPaymentMethods.length>0){if(c.data.paymentStatus===a.REJECTED||c.data.paymentStatus===a.APPROVED&&this.filteredPaymentMethods.includes(p.BANK_TRANSFER)){const t=this.filteredPaymentMethods.find((t=>t===p.BANK_TRANSFER));if(t){this.changePaymentMethod(t);u.setPaymentMethodSelected(t)}}else{this.changePaymentMethod(this.filteredPaymentMethods[0])}}if(c.data.providerKey===M.DECIDIR&&!c.deviceId){try{const t=crypto.randomUUID();const e=await n.fingerPrint.getFingerPrint(t);c.deviceId=t;const i=e.result.script;const s=document.createElement("script");s.innerHTML=i;document.body.appendChild(s)}catch(t){console.error("[RebillCheckout] Failed to initialize Decidir fingerprint:",t)}}if(this.oneClickCheckout){n.customers.exists({email:c.data?.prefilledData?.email},this.publicKey).then((t=>{this.customerExists=t.data.exists}))}this.cardMode=c.cardMode;f("cardMode",(()=>{this.cardMode=c.cardMode}))}catch(t){console.error("Error initializing checkout:",t)}}componentWillUpdate(){this.injectCustomCSS();this.injectCustomJS()}async changePaymentMethod(t){if(t!==this.currentPaymentMethod&&this.filteredPaymentMethods.includes(t)){if(this.checkoutResponse){this.checkoutResponse=null;u.clearCheckoutResponse()}this.currentPaymentMethod=t;u.setPaymentMethodSelected(t);if(t!==p.CARD){this.cardMode="input";u.setCardMode("input")}this.isSubmitting=false;this.currentApmPaymentMethod=N.mapToAPMPaymentMethod(t,c.data?.pricing?.country);if(t!==p.CASH&&t!==p.BANK_TRANSFER){this.checkoutResponse=null;u.clearCheckoutResponse()}else{this.checkoutResponse=null;u.clearCheckoutResponse()}this.paymentMethodSelected.emit(t);try{this.currentRequiredFields=$(t,this.allRequiredFields).fields;const e=await n.sessions.updateCurrentSessionPaymentMethod(c.data.sessionId,{paymentMethodName:N.mapToAPMPaymentMethod(t,c.data.pricing.country),paymentMethodType:t,currency:c.data.pricing.currency});u.setProviderKey(e.providerKey);if(e.providerKey===M.DECIDIR||c.data.providerKey===M.DECIDIR){const t=crypto.randomUUID();const e=await n.fingerPrint.getFingerPrint(t);c.deviceId=t;const i=e.result.script;const s=document.createElement("script");s.innerHTML=i;document.body.appendChild(s)}}catch(t){console.error("Failed to update payment method or get required fields:",t)}}}get currentPaymentError(){if(this.currentPaymentMethod===p.CARD){return this.rejectedPaymentCard}else if(this.currentPaymentMethod===p.CASH||this.currentPaymentMethod===p.BANK_TRANSFER){return this.rejectedPaymentAPM}return false}paymentMethodSelected;async handlePaymentMethodSelected(t){t.stopPropagation();const e=t.detail;this.changePaymentMethod(e);if(this.formElement){this.formElement.resetValidation()}}async handleSubmit(t){if(this.isSubmitting){return}this.rejectedPaymentCard=false;this.rejectedPaymentAPM=false;if(this.currentPaymentMethod===p.CARD){this.handleSubmitCard(t)}else if(this.currentPaymentMethod===p.CASH||this.currentPaymentMethod===p.BANK_TRANSFER){this.handleSubmitAPM(t)}}handleFormChange(t){const e=t.detail;let i=true;let s={};if(this.formElement?.errors){s=this.formElement.errors;i=Object.keys(s).length===0}this.formChange.emit({data:e,isValid:i,errors:Object.keys(s).length>0?s:undefined})}async handleSubmitCard(t){const e=t.detail;const i=this.getCombinedUserData(e);if(!c.data.cardTokenId&&!c.data.cardId){this.cardError={showCardInvalid:true,type:"card_error"};return}if(!c.data.cardInformation&&!c.data.cardId){this.cardError={showCardInvalid:true,type:"tokenization_error"};return}this.cardError={showCardInvalid:false,type:null};const s={transaction:{quantity:1,...c.data.discount.couponCode&&{couponCode:c.data.discount.couponCode}},installments:Number(e.installments||c.data.cardInformation?.installments?.selectedInstallment?.installment),...c.data.cardTokenId&&{cardTokenId:c.data.cardTokenId,...c.data?.itemInformation?.type!==y.PLAN&&{saveCard:c.saveCard}},...c.data.cardId&&{cardId:c.data.cardId},...(!this.otpVerified||this.cardMode==="input")&&{customer:{firstName:i.fullName?.split(" ")[0],lastName:i.fullName?.split(" ").slice(1).join(" "),email:i.email,phone:{countryCode:i.countryCodePhoneNumber,number:i.phoneNumber}}},billingDetails:{address:{lineOne:i["billing-address"],city:i["billing-city"],state:i["billing-state"],country:i["billing-country"]||"",zipCode:i["billing-zip"],lineTwo:i["billing-addInformation"]},identification:C(c.data?.pricing?.currency,i.documentType,i.documentNumber,this.currentPaymentMethod)},customAttributes:{...c.deviceId&&{deviceId:c.deviceId,..."production"!=="production"}},...c.metadata&&{paymentMetadata:c.metadata}};const l=o();this.isSubmitting=true;this.isCardSubmitting=true;try{const t=await n.checkout.createCardCheckoutRequest(c.data.sessionId,l,s,c.data.accessToken||undefined);u.setCheckoutResponse(t.data);this.responseCheckoutCard=t.data;if(t.data.result?.status.toUpperCase()===r.APPROVED){this.isCardSuccess=true;u.setPaymentStatus(a.APPROVED);this.success.emit({paymentMethod:this.currentPaymentMethod,data:t.data});c.data.cardInformation.lastFour=t.data.result?.cardLastFour}else{this.error.emit({paymentMethod:this.currentPaymentMethod,data:t.data});u.setCheckoutResponse(t.data);this.rejectedPaymentCard=true;this.alertErrorKeys={message:t.data.result?.statusDetail.toLowerCase()??t.data.error?.error?.message?.toLowerCase()}}}catch(t){this.error.emit({paymentMethod:this.currentPaymentMethod,data:t.data});u.setCheckoutResponse(t.data);this.responseCheckoutCard=t.data;this.rejectedPaymentCard=true;this.alertErrorKeys={message:t.data?.error?.type?.toLowerCase()??t.data?.result?.statusDetail?.toLowerCase()}}finally{this.isSubmitting=false;this.isCardSubmitting=false}}async handleSubmitAPM(t){if(this.currentPaymentMethod!==p.CASH&&this.currentPaymentMethod!==p.BANK_TRANSFER){return}this.isSubmitting=true;const e=t.detail;const i=this.getCombinedUserData(e);try{const t={address:{country:i["billing-country"]||"",state:i["billing-state"]||"",city:i["billing-city"]||"",zipCode:i["billing-zip"]||"",lineOne:i["billing-address"]||"",lineTwo:i["billing-addInformation"]},identification:C(c.data?.pricing?.currency,i.documentType,i.documentNumber,this.currentPaymentMethod)};const s=this.currentApmPaymentMethod||N.mapToAPMPaymentMethod(this.currentPaymentMethod,c.data?.pricing?.country);const a={transaction:{quantity:1,...c.data.discount.couponCode&&{couponCode:c.data.discount.couponCode}},method:s,billingDetails:t,redirect:{approved:window.location.origin+"/payment/success",rejected:window.location.origin+"/payment/failure"},paymentMetadata:c.metadata,customAttributes:{bank:e.bankId||c.data?.bankId?.code}};{a.customer={firstName:i.fullName?.split(" ")[0]||"",lastName:i.fullName?.split(" ").slice(1).join(" ")||"",email:i.email,phone:{countryCode:i.countryCodePhoneNumber||"",number:i.phoneNumber||""}}}const r=o();const l=await n.checkout.createAPMCheckoutRequest(c.data.sessionId,r,a);this.isSubmitting=false;this.checkoutResponse=l.data;this.storedCheckoutResults.set(this.currentPaymentMethod,l.data);if(l.data?.date){c.data.paymentDate=l.data.date;c.createdAt=l.data.date}if(l.data?.traceId){c.data.paymentReference=l.data.traceId}}catch(t){this.isSubmitting=false;this.checkoutResponse=t.data;this.alertErrorKeys={message:t.data?.error?.type?.toLowerCase()??t.data?.result?.statusDetail?.toLowerCase()};this.rejectedPaymentAPM=true}}async submit(){if(this.formElement&&typeof this.formElement.submit==="function"){this.formElement.submit()}else{await this.handleSubmit({detail:{}})}}handlePaymentStatusChange=t=>{if(t.isCompleted){if(t.status===b.APPROVED){u.setPaymentStatus(a.APPROVED);this.success.emit({paymentMethod:this.currentPaymentMethod,data:this.checkoutResponse})}else if(t.status===b.REJECTED){u.setPaymentStatus(a.REJECTED);this.alertErrorKeys={alertTitle:a.APM_ERROR_GENERIC,message:a.APM_MESSAGE_ERROR}}}};async handleInputChange(t){if(t?.detail?.id==="email"&&this.oneClickCheckout){if(this.emailDebounceTimeout){clearTimeout(this.emailDebounceTimeout)}if(!t.detail.value||t.detail.value.trim()===""){this.customerExists=false;u.clearCustomerIdAndToken();return}this.emailDebounceTimeout=setTimeout((async()=>{try{const t=await n.customers.exists({email:c.data.userInformation.email},this.publicKey);this.customerExists=t.data.exists}catch(t){this.customerExists=false}}),500)}}get validationSchema(){const t=this.currentRequiredFields;const e=this.otpVerified;const i=this.cardMode;const n=this.currentPaymentMethod;return{email:s().when([],{is:()=>!e,then:t=>t.email("validation.emailInvalid").matches(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"validation.emailInvalid").required("validation.emailRequired"),otherwise:t=>t.notRequired()}),fullName:s().when([],{is:()=>!e,then:t=>t.required("validation.fullNameRequired").matches(/^[a-zA-ZÀ-ÿ\u00f1\u00d1\s]{2,}\s+[a-zA-ZÀ-ÿ\u00f1\u00d1\s]{2,}$/,"validation.fullNameInvalid"),otherwise:t=>t.notRequired()}),phoneNumber:s().when([],{is:()=>P("phoneNumber",t)&&!e||e&&i==="input",then:t=>t.required("validation.phoneRequired"),otherwise:t=>t.notRequired()}),isValidPhoneNumber:s().when([],{is:()=>P("phoneNumber",t)&&!e||e&&i==="input",then:t=>t.equals(["true"],"validation.phoneRequired"),otherwise:t=>t.notRequired()}),"billing-country":s().when([],{is:()=>P("billing-country",t)&&!e||e&&i==="input",then:t=>t.required("validation.countryRequired"),otherwise:t=>t.notRequired()}),"billing-state":s().when([],{is:()=>P("billing-state",t)&&!e||e&&i==="input",then:t=>t.required("validation.stateRequired"),otherwise:t=>t.notRequired()}),"billing-address":s().when([],{is:()=>P("billing-address",t)&&!e||e&&i==="input",then:t=>t.required("validation.addressRequired"),otherwise:t=>t.notRequired()}),"billing-city":s().when([],{is:()=>P("billing-city",t)&&!e||e&&i==="input",then:t=>t.required("validation.cityRequired"),otherwise:t=>t.notRequired()}),"billing-zip":s().when([],{is:()=>P("billing-zip",t)&&!e||e&&i==="input",then:t=>t.required("validation.zipRequired"),otherwise:t=>t.notRequired()}),bankId:s().when([],{is:()=>P("bankId",t),then:t=>t.required("validation.bankRequired"),otherwise:t=>t.notRequired()}),installments:s().when([],{is:()=>n===p.CARD&&c.data?.cardInformation?.installments?.isAvailableInstallments&&(c.data?.cardInformation?.installments?.installments?.length??0)>0&&c.data?.itemInformation?.type!==y.PLAN,then:t=>t.required("validation.installmentsRequired"),otherwise:t=>t.notRequired()}),documentType:s().when([],{is:()=>I(c.data?.pricing?.currency)&&((P("documentType",t)||P("documentNumber",t))&&!e||e&&i==="input"),then:t=>t.required("validation.documentTypeRequired"),otherwise:t=>t.notRequired()}),documentNumber:s().when([],{is:()=>I(c.data?.pricing?.currency)&&((P("documentNumber",t)||P("documentType",t))&&!e||e&&i==="input"),then:t=>{const e=t.required("validation.documentNumberRequired").min(7,"validation.documentInvalid");if(c.data?.pricing?.country==="BR"){return e.test("numeric-only","validation.documentNumberNumericOnly",(t=>{if(!t)return true;return/^\d+$/.test(t)}))}return e},otherwise:t=>t.notRequired()})}}getInitialData=()=>({email:c.data.userInformation.email||"",fullName:c.data.userInformation.fullName||"",phoneNumber:c.data.userInformation.phoneNumber?.number||"",countryCodePhoneNumber:c.data.userInformation.countryCode||"",documentType:"",documentNumber:"","billing-country":c.data.userInformation.address?.billingAddress?.country||"","billing-state":c.data.userInformation?.address?.billingAddress?.state||"","billing-address":c.data.userInformation?.address?.billingAddress?.address||"","billing-city":c.data.userInformation?.address?.billingAddress?.city||"","billing-zip":c.data.userInformation?.address?.billingAddress?.zip||"",bankId:c.data.bankId?.code||"",card:"",installments:c.data.cardInformation?.installments?.selectedInstallment?.installment?.toString()||""});hasPrefilledAddress=()=>{const t=["billing-country","billing-state","billing-address","billing-city","billing-zip"];return t.some((t=>{const e=this.initialData[t];return e&&e.trim()!==""}))};get isQrCodeVisible(){return!!this.checkoutResponse?.result?.data?.qrCode}get isBankTransferVisible(){return!!this.checkoutResponse?.result?.data?.account&&!!this.checkoutResponse?.result?.data?.bankName&&!!this.checkoutResponse?.result?.data?.reference}get isBoletoVisible(){return this.currentPaymentMethod===p.CASH&&c.data?.pricing?.country==="BR"&&!!this.checkoutResponse?.result?.data?.barcode}isPaymentApproved=()=>{if(c.data.paymentStatus===a.APPROVED){return true}return false};handleRebillAccountClick(t){this.showOtp=t.detail}handleReturnForm(t){this.showOtp=t.detail;u.clearCustomerIdAndToken()}handleSignOut(){this.showOtp=false;this.otpVerified=false;if(!c?.data?.prefilledData?.email){this.customerExists=false}u.clearCustomerIdAndToken();u.clearUserInformation();u.setCardId(null);u.setCardTokenId(null);this.cardMode="input";u.setCardMode("input");this.cardError={showCardInvalid:false,type:null};this.alertErrorKeys=null;this.rejectedPaymentCard=false;this.rejectedPaymentAPM=false}handleCodeVerified(){this.otpVerified=true;this.showOtp=false;this.rejectedPaymentCard=false;this.alertErrorKeys=null;this.cardError={showCardInvalid:false,type:null};if(this.formElement){this.formElement.resetValidation()}}isPaymentRejected(){return c.data.paymentStatus===a.REJECTED&&this.currentPaymentMethod===p.BANK_TRANSFER}render(){const t=this.countries.map((t=>({label:t.country,value:t.isoCountryCode})));const e=(t={})=>i("rebill-summary",{key:"27bf2a0eb744f9be27c6d11c9585a3db69c563f1",totalAmount:c.data.pricing.total,currency:c.data.pricing.currency,itemTitle:c._session?.getTitle(),itemDescription:c._session?.getDescription(),itemAmount:c.data.pricing.subtotal,subtotal:c.data.pricing.subtotal,allowCoupon:c._session?.getAllowCoupon(this.displayConfig),currentBreakpoint:this.breakpoint,planFrequency:c._session?.getPlanFrequency(),planFrequencyCount:c._session?.getPlanFrequencyCount(),discountType:c.data.discount.discountType,discountedPercentage:c.data.discount.discountedPercentage,discountDuration:c.data.discount.discountDuration,discountAmount:c.data.discount.discountAmount,initialCouponCode:this.couponCode,...t});return c.isInitialized&&i(i.Fragment,null,this.showRefreshModal&&i("rebill-modal-overlay",{key:"e8923ed0d91e204e56259842e998820586f04493"}),this.displayConfig.processingPayment&&i("rebill-processing-payment",{key:"48b27b39d74c703bdd1172c567255ce924dab0ce",style:{display:this.isCardSubmitting?"block":"none"}}),this.displayConfig.successPage&&this.isPaymentApproved()&&c.isInitialized?i("success-page",{typePaymentMethod:c.data.paymentMethodSelected,paymentMethodName:N.mapToAPMPaymentMethod(c.data.paymentMethodSelected||c.data.payment?.paymentMethodType,c.data?.pricing?.country),country:c.data?.pricing?.country,bank:c.data.payment?.paymentMethodMetadata?.bankName,cardLastFour:this.responseCheckoutCard?.result?.cardLastFour||c.data.cardInformation?.lastFour,paymentDate:c.data.paymentDate||this.responseCheckoutCard?.date||c.data.payment?.createdAt||this.checkoutResponse?.result?.data?.createdAt,referenceNumber:c.data.paymentReference||c.data.payment?.traceId||this.responseCheckoutCard?.traceId,onSuccessRedirect:t=>{this.successRedirect.emit(t.detail)},trialPeriodDays:c.data?.itemInformation?.trial?.trialPeriodDays,debitDay:c.data?.itemInformation?.debitDay,planAmount:c.data?.pricing?.planAmount}):i(i.Fragment,null,this.displayConfig.sandboxMode&&c.isSandbox&&c.data.sessionType===d.CHECKOUT_LANDING&&k(this.breakpoint,g.DESKTOP)&&i("div",{class:"mode-sandbox-mobile-container",style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"}},i("rebill-mode-sandbox-mobile",null)),i("rebill-checkout-form",{ref:t=>this.formElement=t,style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"},validationSchema:this.validationSchema,initialData:this.initialData,onSubmit:t=>this.handleSubmit(t),onChange:t=>this.handleFormChange(t),renderForm:({submit:s,formData:n,errors:o})=>{const a=!this.isCardSuccess&&this.checkoutResponse?.result&&(this.currentPaymentMethod===p.CASH||this.currentPaymentMethod===p.BANK_TRANSFER);return i("div",{class:`rebill-checkout ${!this.displayConfig.checkoutSummary?"full-width-layout":""}`},i("div",{class:"left-section"},i("div",{class:"left-section-container"},this.displayConfig.logo&&i("organization-logo",{organization:c.data.organization}),i("div",{class:"otp-container",style:{display:this.showOtp?"block":"none"}},i("otp-component",null)),i("div",{style:{display:this.showOtp?"none":"block"}},i("div",{class:"checkout-form-section"},this.displayConfig.checkoutSummary&&i("div",{class:"summary-mobile-tablet",style:{display:k(this.breakpoint,g.DESKTOP)?"block":"none"}},e({displayedComponents:["totalAmount","discount","timelineFreeTrial","timelineDebitDay","itemDetails"]})),!this.otpVerified&&this.displayConfig.customerInformation&&i("user-information",{customerExists:this.customerExists,disabled:this.isSubmitting,errors:{email:o.email,fullName:o.fullName}}),this.otpVerified&&this.displayConfig.customerInformation&&i("user-information-static",{variant:"otp",userInfo:{customerName:c.data.userInformation.fullName?.split(" ")[0],customerEmail:c.data.userInformation.email}}),i("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},i("payment-method-selector",{enabledPaymentMethods:this.filteredPaymentMethods,defaultSelected:this.currentPaymentMethod,disabled:this.isSubmitting,errorComponent:{showErrorComponent:this.displayConfig.errorMessage&&(this.currentPaymentError||this.isPaymentRejected()),alertTitle:l.getErrorTitle(this.currentPaymentMethod,c.data?.pricing?.country||"",this.alertErrorKeys?.alertTitle),message:l.getErrorMessage(this.alertErrorKeys?.message,this.currentPaymentMethod,c.data?.pricing?.country)},country:c.data?.pricing?.country,installmentsError:o.installments,showDocument:(!this.otpVerified||this.otpVerified&&this.cardMode==="input")&&!a&&!this.isQrCodeVisible&&I(c.data?.pricing?.currency)&&(P("documentNumber",this.currentRequiredFields)||P("documentType",this.currentRequiredFields)),documentTypeError:o.documentType,documentNumberError:o.documentNumber,cardError:this.cardError,customCSS:this.css}),!a&&(()=>{const t=P("bankId",this.currentRequiredFields);return t})()&&i("div",{class:"animated-component fade-in"},i("rebill-bank-selector",{banks:S("bank",this.allRequiredFields[this.currentPaymentMethod].original)||[],defaultSelectedBankId:n.bankId||"",error:o?.bankId,disabled:this.isSubmitting}))),!a&&(!this.otpVerified||this.cardMode==="input")&&i(i.Fragment,null,this.displayConfig.billingAddress&&(P("billing-country",this.currentRequiredFields)||P("billing-state",this.currentRequiredFields)||P("billing-address",this.currentRequiredFields)||P("billing-city",this.currentRequiredFields)||P("billing-zip",this.currentRequiredFields))&&i("div",{class:"animated-component slide-in"},i("rebill-address",{disabled:this.isSubmitting,countryOptions:t,billingView:(()=>{if(this.displayConfig.useAddressSearch!==undefined&&this.displayConfig.useAddressSearch===false){return"form"}return this.hasPrefilledAddress()?"form":"search"})(),errors:{"billing-country":o["billing-country"],"billing-state":o["billing-state"],"billing-address":o["billing-address"],"billing-city":o["billing-city"],"billing-zip":o["billing-zip"]}})),this.displayConfig.customerInformation&&P("phoneNumber",this.currentRequiredFields)&&i("div",{class:"animated-component fade-in"},i("user-information-phone",{disabled:this.isSubmitting,error:o?.phoneNumber||o?.isValidPhoneNumber,countryCode:c.data.userInformation?.countryCode||c.data.country}))),a&&(()=>{const t=this.currentPaymentMethod===p.CASH&&c.data?.pricing?.country==="BR"&&this.checkoutResponse?.result?.data?.barcode;return i("apm-checkout",{paymentMethod:this.currentPaymentMethod,barcode:t?this.checkoutResponse?.result?.data?.barcode:undefined,referenceId:this.currentPaymentMethod===p.CASH&&!t?this.checkoutResponse?.result?.data?.referenceId:undefined,qrCodeData:this.currentPaymentMethod===p.BANK_TRANSFER?this.checkoutResponse?.result?.data?.qrCode:undefined,code:this.currentPaymentMethod===p.BANK_TRANSFER?this.checkoutResponse?.result?.data?.code:undefined,checkoutRequestId:this.checkoutResponse?.result?.checkoutRequestId,providerName:c.data.providerKey,expirationDate:(()=>{const t=new Date;t.setDate(t.getDate()+30);return t.toISOString()})(),onPaymentStatusChange:t=>this.handlePaymentStatusChange(t.detail),country:c.data?.pricing?.country,redirectUrl:this.checkoutResponse?.result?.data?.url,timeToRedirect:this.timeToRedirectAPM,bearerToken:this.checkoutResponse?.result?.data?.bearerToken,bankTransferData:this.checkoutResponse?.result?.data?.account&&this.checkoutResponse?.result?.data?.bankName&&this.checkoutResponse?.result?.data?.reference?{account:this.checkoutResponse.result.data.account,bankName:this.checkoutResponse.result.data.bankName,reference:this.checkoutResponse.result.data.reference}:undefined})})(),this.displayConfig.checkoutSummary&&i("div",{class:"summary-price-details",style:{display:k(this.breakpoint,g.DESKTOP)?"block":"none"}},e({displayedComponents:["priceDetails"]})),this.displayConfig.submitButton&&!(a&&(this.isQrCodeVisible||this.isBankTransferVisible||this.isBoletoVisible))&&i("div",{class:"payment-button-container"},i("payment-button",{paymentMethod:this.currentPaymentMethod,isLoading:this.isSubmitting,trialPeriodDays:c.data?.itemInformation?.trial?.trialPeriodDays,onSubmit:()=>{s()},redirectUrl:!!this.checkoutResponse?.result?.data?.url,timeToRedirect:this.timeToRedirectAPM,isDisabled:c.data.fetchingInstallments,country:c.data?.pricing?.country}),i("rebill-alert",{type:"secure",variant:"variant-secure",icon:"lock-outline",message:h.translate("otp.secureMessage")}))),this.displayConfig.sandboxMode&&c.isSandbox&&c.data.sessionType===d.CHECKOUT_LANDING&&!k(this.breakpoint,g.DESKTOP)&&i("rebill-mode-sandbox",null)),this.displayConfig.footer&&i("rebill-footer",{style:{marginTop:k(this.breakpoint,g.DESKTOP)?"24px":"auto"}}))),this.displayConfig.checkoutSummary&&i("div",{class:"right-section-checkout"},i("div",{class:"checkout-summary-section"},i("div",{class:"summary-desktop",style:{display:!k(this.breakpoint,g.DESKTOP)?"block":"none"}},e()))))}})))}static get watchers(){return{language:["handleLanguageChange"]}}};G.style=W;export{G as rebill_checkout};
2
- //# sourceMappingURL=p-5c4c4d5f.entry.js.map
1
+ import{r as t,c as e,h as i}from"./p-D8cwEAmw.js";import{c as s}from"./p-MMCcKmy_.js";import{a as n}from"./p-CtVYl54u.js";import{g as o,P as a,C as r,a as l}from"./p-CYYBIKsp.js";import{s as c,a as d,I as h,S as u,i as m,P as p,o as f,b as y}from"./p-B0zTy7-V.js";import{S as b}from"./p-vsLqF4hk.js";import{B as g,g as w,i as k}from"./p-Do_vNuMa.js";import{G as x}from"./p-C2nYpE_A.js";import{m as v,b as C,s as I,i as P,g as S}from"./p-CznPkI5O.js";import{P as N}from"./p-NRdSSs6s.js";import"./p-E-ZsRS8r.js";import"./p-gx2Z4Khq.js";const j={checkoutSummary:true,submitButton:true,billingAddress:true,customerInformation:true,discountCode:true,logo:true,footer:true,sandboxMode:true,processingPayment:true,successPage:true,errorMessage:true,useAddressSearch:true};var M;(function(t){t["BAMBOO"]="bamboo_payment";t["FISERV"]="fiserv";t["KUSHKI"]="kushki";t["PAYWAY"]="payway";t["DOCK"]="dock";t["KLAP"]="klap";t["MOVII"]="movii";t["STRIPE"]="stripe";t["DECIDIR"]="decidir"})(M||(M={}));function R(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//")}function D(t){return`${t}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}function T(t,e){const i=document.createElement("link");i.rel="stylesheet";i.href=t;i.id=e;i.setAttribute("data-rebill-injected","true");return i}function z(t,e){const i=document.createElement("style");i.id=e;i.setAttribute("data-rebill-injected","true");i.textContent=t;return i}function q(t,e){const i=document.createElement("script");i.src=t;i.id=e;i.setAttribute("data-rebill-injected","true");i.async=true;return i}function A(t,e){const i=document.createElement("script");i.id=e;i.setAttribute("data-rebill-injected","true");i.textContent=t;return i}function E(t){if(!t){return}try{t.remove()}catch(t){console.warn("Error removing injected resource:",t)}}function O(t,e=null){if(!t){return null}E(e);const i=D("rebill-checkout-css");const s=R(t)?T(t,i):z(t,i);document.head.appendChild(s);return s}function F(t,e=null){if(!t){return null}E(e);const i=D("rebill-checkout-js");const s=R(t)?q(t,i):A(t,i);document.head.appendChild(s);return s}function K(t){E(t)}function B(t){E(t)}const L=async(t,e,i)=>{const s=await n.checkout.getRequiredFields({currency:t,method:e},i);return{fields:v(s.data),original:s.data}};const V=async()=>{const t=c.data?.itemInformation?.paymentMethods;const e=t.map((async t=>{try{const e=N.mapToAPMPaymentMethod(t,c.data?.pricing?.country);const i=await L(c.data.pricing.currency,e,c.data.organization.id);return{paymentMethod:t,...i}}catch(e){console.error(`Error getting required fields for ${t}:`,e);return{paymentMethod:t,fields:[],original:[]}}}));const i=await Promise.all(e);const s={};i.forEach((t=>{s[t.paymentMethod]={fields:t.fields,original:t.original}}));return s};const $=(t,e)=>{const i=e[t];if(i){return i}else{return{fields:[],original:[]}}};const Y=t=>typeof t==="string"?JSON.parse(t):t;const _=t=>Y(t);const Z=()=>"190.188.127.250";const J=async({publicKey:t,instantProduct:e,instantPlan:i})=>{const s=Y(e?e:i);const{metadata:a,...r}=s;const l=await n.sessions.createSDKInstantSessionRequest(r,o(),Z(),t);const c={...l.data,...l.data.plan&&{plan:{...l.data.plan,description:s.description||[],metadata:a||null}},...l.data.product&&{product:{...l.data.product,description:s.description||[],metadata:a||null}}};const d=c;return d};const U=async({publicKey:t,productId:e,planId:i})=>{const s=await n.sessions.createSDKItemSessionRequest({...e?{productId:e}:{},...i?{planId:i}:{},idempotencyKey:o(),deviceId:"123123123",clientIP:Z(),publicKey:t});const a=s.data;return a};const X=async({publicKey:t,checkoutLandingSession:e,instantProduct:i,instantPlan:s,productId:n,planId:o})=>{if(e){const t=await _(e);return{session:t,type:d.CHECKOUT_LANDING}}if(i||s){const e=await J({publicKey:t,instantProduct:i,instantPlan:s});return{session:e,type:d.INSTANT}}if(n||o){const e=await U({publicKey:t,productId:n,planId:o});return{session:e,type:d.SDK_ITEM}}};const W="@media (max-width: 1024px){.rebill-checkout{width:100%;flex-direction:column;gap:0;justify-content:flex-start;background:var(--rebill-color-background);padding:20px}.right-section-checkout .left-section{width:100%;height:100%;background:var(--rebill-color-background)}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;gap:24px;height:100%}.otp-container{display:flex;flex-direction:column;justify-content:flex-start;gap:24px}.rebill-checkout.full-width-layout .left-section{width:100%}.rebill-checkout.full-width-layout .left-section-container{max-width:none;width:100%}}@media (min-width: 1025px){.rebill-checkout{width:100%;min-height:600px;display:flex;flex-direction:row;justify-content:center;overflow-y:auto}.left-section{display:flex;width:60%;background:var(--rebill-color-background-left);justify-content:space-around}.right-section-checkout{display:flex;padding-top:72px;width:40%;background:var(--rebill-color-background-right);position:sticky;top:0;justify-content:center}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;margin-bottom:36px;gap:32px}.left-section-container{max-width:450px;min-width:450px;margin:2.5rem 2rem 1.5rem 2rem;display:flex;flex-direction:column}.checkout-summary-section{max-width:450px;min-width:350px;margin:0rem 2rem;background:var(--rebill-color-background-right);display:flex;flex-direction:column;justify-content:flex-start;width:100%}.checkout-form-section user-information,.checkout-form-section payment-method-selector,.checkout-form-section rebill-address,.checkout-summary-section rebill-summary{width:100%}.rebill-checkout.full-width-layout .left-section{width:100%;justify-content:stretch}.rebill-checkout.full-width-layout .left-section-container{max-width:none;min-width:auto;width:100%;margin:2.5rem 2rem 1.5rem 2rem}.pac-container{border-radius:4px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border:1px solid #e0e0e0;margin-top:4px;font-family:inherit}.pac-item{padding:10px 12px;cursor:pointer;border-top:none}.pac-item:first-child{border-top:none}.pac-item:hover{background-color:#f5f5f5}.pac-item-query{font-weight:500}.pac-icon{display:none}}.payment-button-container{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.animated-component{transition:all 0.3s ease-in-out;overflow:visible}.fade-in{animation:fadeIn 0.4s ease-in-out}.slide-in{animation:slideIn 0.5s ease-out}@keyframes fadeIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideIn{from{opacity:0;transform:translateX(-20px);max-height:0}to{opacity:1;transform:translateX(0);max-height:450px}}.animated-component.hide{animation:fadeOut 0.3s ease-in-out forwards}@keyframes fadeOut{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}rebill-mode-sandbox{position:fixed;bottom:50px;left:50%;transform:translateX(-50%);z-index:1000}@media (max-width: 1024px){rebill-test-mode-chip{bottom:46px}}@media (min-width: 1025px){rebill-test-mode-chip{bottom:46px}}.mode-sandbox-mobile-container{display:flex;align-items:center;width:100%;padding:0;margin:0;box-sizing:border-box}@media (min-width: 1451px){.left-section-container{min-width:450px;margin:2.5rem 5rem 1.5rem 5rem}.checkout-summary-section{min-width:450px;margin:0rem 5rem}}";const G=class{constructor(i){t(this,i);this.error=e(this,"error");this.success=e(this,"success");this.successRedirect=e(this,"successRedirect");this.formChange=e(this,"formChange");this.paymentMethodSelected=e(this,"paymentMethodSelected")}productId;planId;publicKey;instantProduct;instantPlan;display;customerInformation;oneClickCheckout=true;css;js;language;async handleLanguageChange(t,e){if(t&&t!==e){try{await h.changeLanguage(t);u.changeLanguage(t);console.log(`[RebillCheckout] Language changed from ${e} to ${t}`)}catch(t){console.error("[RebillCheckout] Failed to change language:",t)}}}error;success;successRedirect;formChange;couponCode;checkoutLandingSession;externalPayment;rejectedPaymentCard=false;rejectedPaymentAPM=false;countries=[];currentPaymentMethod;checkoutResponse=null;isSubmitting=false;isCardSubmitting=false;isCardSuccess=false;isAPMSubmitting=false;isAPMSuccess=false;storedCheckoutResults=new Map;alertErrorKeys=null;currentApmPaymentMethod=null;breakpoint=g.DESKTOP;showRefreshModal=false;cardError={showCardInvalid:false,type:null};initialData={};allRequiredFields={};currentRequiredFields=[];customerExists=false;showOtp=false;otpVerified=false;responseCheckoutCard=null;cardMode=null;formElement;emailDebounceTimeout=null;injectedStyleElement=null;injectedScriptElement=null;get displayConfig(){if(!this.display){return j}if(typeof this.display==="string"){try{const t=JSON.parse(this.display);return{...j,...t}}catch(t){console.warn("Invalid display configuration string, using defaults:",t);return j}}return{...j,...this.display}}get parsedCustomerInformation(){if(!this.customerInformation){return null}if(typeof this.customerInformation==="string"){try{return JSON.parse(this.customerInformation)}catch(t){console.warn("Invalid customerInformation configuration string, ignoring:",t);return null}}return this.customerInformation}get filteredPaymentMethods(){const t=c.data?.itemInformation?.paymentMethods||[];const e=this.displayConfig.excludePaymentMethods;if(!e||e.length===0){return t}return t.filter((t=>!e.includes(t)))}getCombinedUserData(t={}){const e=c.data.userInformation;const i=this.parsedCustomerInformation;return{email:t?.email||i?.email||e.email,fullName:t?.fullName||i?.fullName||e.fullName,countryCodePhoneNumber:t?.countryCodePhoneNumber||i?.phoneNumber?.countryCode||i?.countryCode||e.countryCode,phoneNumber:t?.phoneNumber||i?.phoneNumber?.number||e.phoneNumber,documentType:t?.documentType||i?.documentType||e.documentType,documentNumber:t?.documentNumber||i?.documentNumber||e.documentNumber,"billing-country":t?.["billing-country"]||i?.address?.billingAddress?.country||e.address?.billingAddress?.country,"billing-state":t?.["billing-state"]||i?.address?.billingAddress?.state||e.address?.billingAddress?.state,"billing-address":t?.["billing-address"]||i?.address?.billingAddress?.address||e.address?.billingAddress?.address,"billing-city":t?.["billing-city"]||i?.address?.billingAddress?.city||e.address?.billingAddress?.city,"billing-zip":t?.["billing-zip"]||i?.address?.billingAddress?.zip||e.address?.billingAddress?.zip,"billing-addInformation":t?.["billing-addInformation"]||i?.address?.billingAddress?.addInformation||e.address?.billingAddress?.addInformation}}injectCustomCSS(){this.injectedStyleElement=O(this.css,this.injectedStyleElement)}cleanupInjectedCSS(){K(this.injectedStyleElement);this.injectedStyleElement=null}injectCustomJS(){this.injectedScriptElement=F(this.js,this.injectedScriptElement)}cleanupInjectedJS(){B(this.injectedScriptElement);this.injectedScriptElement=null}timeToRedirectAPM=5e3;resizeHandler=()=>{const t=w(window.innerWidth);if(t!==this.breakpoint){this.breakpoint=t}};disconnectedCallback(){window.removeEventListener("resize",this.resizeHandler);if(this.emailDebounceTimeout){clearTimeout(this.emailDebounceTimeout);this.emailDebounceTimeout=null}this.cleanupInjectedCSS();this.cleanupInjectedJS()}async componentWillLoad(){try{this.resizeHandler();window.addEventListener("resize",this.resizeHandler);this.injectCustomCSS();this.injectCustomJS();if(this.language){await h.changeLanguage(this.language)}else{m()}const{session:t,type:e}=await X({publicKey:this.publicKey,checkoutLandingSession:this.checkoutLandingSession,instantProduct:this.instantProduct,instantPlan:this.instantPlan,productId:this.productId,planId:this.planId});const i=t?.restoredOTP;u.initializeSession({session:t,type:e,payment:typeof this.externalPayment==="string"?JSON.parse(this.externalPayment):this.externalPayment});if(i){u.setAccessToken(i.accessToken);u.setCustomerId(i.customerId);u.setUserInformation(i.userInformation);this.otpVerified=true;this.cardMode="select"}if(c.sessionRefreshed){this.showRefreshModal=true}x.loadGoogleMapsScript();const s=await n.data.getCountries();this.countries=s.data;if(this.parsedCustomerInformation){u.setUserInformation(this.parsedCustomerInformation)}this.initialData=this.getInitialData();this.allRequiredFields=await V();if(this.filteredPaymentMethods.length>0){if(c.data.paymentStatus===a.REJECTED||c.data.paymentStatus===a.APPROVED&&this.filteredPaymentMethods.includes(p.BANK_TRANSFER)){const t=this.filteredPaymentMethods.find((t=>t===p.BANK_TRANSFER));if(t){this.changePaymentMethod(t);u.setPaymentMethodSelected(t)}}else{this.changePaymentMethod(this.filteredPaymentMethods[0])}}if(c.data.providerKey===M.DECIDIR&&!c.deviceId){try{const t=crypto.randomUUID();const e=await n.fingerPrint.getFingerPrint(t);c.deviceId=t;const i=e.result.script;const s=document.createElement("script");s.innerHTML=i;document.body.appendChild(s)}catch(t){console.error("[RebillCheckout] Failed to initialize Decidir fingerprint:",t)}}if(this.oneClickCheckout){n.customers.exists({email:c.data?.prefilledData?.email},this.publicKey).then((t=>{this.customerExists=t.data.exists}))}this.cardMode=c.cardMode;f("cardMode",(()=>{this.cardMode=c.cardMode}))}catch(t){console.error("Error initializing checkout:",t)}}componentWillUpdate(){this.injectCustomCSS();this.injectCustomJS()}async changePaymentMethod(t){if(t!==this.currentPaymentMethod&&this.filteredPaymentMethods.includes(t)){if(this.checkoutResponse){this.checkoutResponse=null;u.clearCheckoutResponse()}this.currentPaymentMethod=t;u.setPaymentMethodSelected(t);if(t!==p.CARD){this.cardMode="input";u.setCardMode("input")}this.isSubmitting=false;this.currentApmPaymentMethod=N.mapToAPMPaymentMethod(t,c.data?.pricing?.country);if(t!==p.CASH&&t!==p.BANK_TRANSFER){this.checkoutResponse=null;u.clearCheckoutResponse()}else{this.checkoutResponse=null;u.clearCheckoutResponse()}this.paymentMethodSelected.emit(t);try{this.currentRequiredFields=$(t,this.allRequiredFields).fields;const e=await n.sessions.updateCurrentSessionPaymentMethod(c.data.sessionId,{paymentMethodName:N.mapToAPMPaymentMethod(t,c.data.pricing.country),paymentMethodType:t,currency:c.data.pricing.currency});u.setProviderKey(e.providerKey);if(e.providerKey===M.DECIDIR||c.data.providerKey===M.DECIDIR){const t=crypto.randomUUID();const e=await n.fingerPrint.getFingerPrint(t);c.deviceId=t;const i=e.result.script;const s=document.createElement("script");s.innerHTML=i;document.body.appendChild(s)}}catch(t){console.error("Failed to update payment method or get required fields:",t)}}}get currentPaymentError(){if(this.currentPaymentMethod===p.CARD){return this.rejectedPaymentCard}else if(this.currentPaymentMethod===p.CASH||this.currentPaymentMethod===p.BANK_TRANSFER){return this.rejectedPaymentAPM}return false}paymentMethodSelected;async handlePaymentMethodSelected(t){t.stopPropagation();const e=t.detail;this.changePaymentMethod(e);if(this.formElement){this.formElement.resetValidation()}}async handleSubmit(t){if(this.isSubmitting){return}this.rejectedPaymentCard=false;this.rejectedPaymentAPM=false;if(this.currentPaymentMethod===p.CARD){this.handleSubmitCard(t)}else if(this.currentPaymentMethod===p.CASH||this.currentPaymentMethod===p.BANK_TRANSFER){this.handleSubmitAPM(t)}}handleFormChange(t){const e=t.detail;let i=true;let s={};if(this.formElement?.errors){s=this.formElement.errors;i=Object.keys(s).length===0}this.formChange.emit({data:e,isValid:i,errors:Object.keys(s).length>0?s:undefined})}async handleSubmitCard(t){const e=t.detail;const i=this.getCombinedUserData(e);if(!c.data.cardTokenId&&!c.data.cardId){this.cardError={showCardInvalid:true,type:"card_error"};return}if(!c.data.cardInformation&&!c.data.cardId){this.cardError={showCardInvalid:true,type:"tokenization_error"};return}this.cardError={showCardInvalid:false,type:null};const s={transaction:{quantity:1,...c.data.discount.couponCode&&{couponCode:c.data.discount.couponCode}},installments:Number(e.installments||c.data.cardInformation?.installments?.selectedInstallment?.installment),...c.data.cardTokenId&&{cardTokenId:c.data.cardTokenId,...c.data?.itemInformation?.type!==y.PLAN&&{saveCard:c.saveCard}},...c.data.cardId&&{cardId:c.data.cardId},...(!this.otpVerified||this.cardMode==="input")&&{customer:{firstName:i.fullName?.split(" ")[0],lastName:i.fullName?.split(" ").slice(1).join(" "),email:i.email,phone:{countryCode:i.countryCodePhoneNumber,number:i.phoneNumber}}},billingDetails:{address:{lineOne:i["billing-address"],city:i["billing-city"],state:i["billing-state"],country:i["billing-country"]||"",zipCode:i["billing-zip"],lineTwo:i["billing-addInformation"]},identification:C(c.data?.pricing?.currency,i.documentType,i.documentNumber,this.currentPaymentMethod)},customAttributes:{...c.deviceId&&{deviceId:c.deviceId,..."production"!=="production"}},...c.metadata&&{paymentMetadata:c.metadata}};const l=o();this.isSubmitting=true;this.isCardSubmitting=true;try{const t=await n.checkout.createCardCheckoutRequest(c.data.sessionId,l,s,c.data.accessToken||undefined);u.setCheckoutResponse(t.data);this.responseCheckoutCard=t.data;if(t.data.result?.status.toUpperCase()===r.APPROVED){this.isCardSuccess=true;u.setPaymentStatus(a.APPROVED);this.success.emit({paymentMethod:this.currentPaymentMethod,data:t.data});c.data.cardInformation.lastFour=t.data.result?.cardLastFour}else{this.error.emit({paymentMethod:this.currentPaymentMethod,data:t.data});u.setCheckoutResponse(t.data);this.rejectedPaymentCard=true;this.alertErrorKeys={message:t.data.result?.statusDetail.toLowerCase()??t.data.error?.error?.message?.toLowerCase()}}}catch(t){this.error.emit({paymentMethod:this.currentPaymentMethod,data:t.data});u.setCheckoutResponse(t.data);this.responseCheckoutCard=t.data;this.rejectedPaymentCard=true;this.alertErrorKeys={message:t.data?.error?.type?.toLowerCase()??t.data?.result?.statusDetail?.toLowerCase()}}finally{this.isSubmitting=false;this.isCardSubmitting=false}}async handleSubmitAPM(t){if(this.currentPaymentMethod!==p.CASH&&this.currentPaymentMethod!==p.BANK_TRANSFER){return}this.isSubmitting=true;const e=t.detail;const i=this.getCombinedUserData(e);try{const t={address:{country:i["billing-country"]||"",state:i["billing-state"]||"",city:i["billing-city"]||"",zipCode:i["billing-zip"]||"",lineOne:i["billing-address"]||"",lineTwo:i["billing-addInformation"]},identification:C(c.data?.pricing?.currency,i.documentType,i.documentNumber,this.currentPaymentMethod)};const s=this.currentApmPaymentMethod||N.mapToAPMPaymentMethod(this.currentPaymentMethod,c.data?.pricing?.country);const a={transaction:{quantity:1,...c.data.discount.couponCode&&{couponCode:c.data.discount.couponCode}},method:s,billingDetails:t,redirect:{approved:window.location.origin+"/payment/success",rejected:window.location.origin+"/payment/failure"},paymentMetadata:c.metadata,customAttributes:{bank:e.bankId||c.data?.bankId?.code}};{a.customer={firstName:i.fullName?.split(" ")[0]||"",lastName:i.fullName?.split(" ").slice(1).join(" ")||"",email:i.email,phone:{countryCode:i.countryCodePhoneNumber||"",number:i.phoneNumber||""}}}const r=o();const l=await n.checkout.createAPMCheckoutRequest(c.data.sessionId,r,a);this.isSubmitting=false;this.checkoutResponse=l.data;this.storedCheckoutResults.set(this.currentPaymentMethod,l.data);if(l.data?.date){c.data.paymentDate=l.data.date;c.createdAt=l.data.date}if(l.data?.traceId){c.data.paymentReference=l.data.traceId}}catch(t){this.isSubmitting=false;this.checkoutResponse=t.data;this.alertErrorKeys={message:t.data?.error?.type?.toLowerCase()??t.data?.result?.statusDetail?.toLowerCase()};this.rejectedPaymentAPM=true}}async submit(){if(this.formElement&&typeof this.formElement.submit==="function"){this.formElement.submit()}else{await this.handleSubmit({detail:{}})}}handlePaymentStatusChange=t=>{if(t.isCompleted){if(t.status===b.APPROVED){u.setPaymentStatus(a.APPROVED);this.success.emit({paymentMethod:this.currentPaymentMethod,data:this.checkoutResponse})}else if(t.status===b.REJECTED){u.setPaymentStatus(a.REJECTED);this.alertErrorKeys={alertTitle:a.APM_ERROR_GENERIC,message:a.APM_MESSAGE_ERROR}}}};async handleInputChange(t){if(t?.detail?.id==="email"&&this.oneClickCheckout){if(this.emailDebounceTimeout){clearTimeout(this.emailDebounceTimeout)}if(!t.detail.value||t.detail.value.trim()===""){this.customerExists=false;u.clearCustomerIdAndToken();return}this.emailDebounceTimeout=setTimeout((async()=>{try{const t=await n.customers.exists({email:c.data.userInformation.email},this.publicKey);this.customerExists=t.data.exists}catch(t){this.customerExists=false}}),500)}}get validationSchema(){const t=this.currentRequiredFields;const e=this.otpVerified;const i=this.cardMode;const n=this.currentPaymentMethod;return{email:s().when([],{is:()=>!e,then:t=>t.email("validation.emailInvalid").matches(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"validation.emailInvalid").required("validation.emailRequired"),otherwise:t=>t.notRequired()}),fullName:s().when([],{is:()=>!e,then:t=>t.required("validation.fullNameRequired").matches(/^[a-zA-ZÀ-ÿ\u00f1\u00d1\s]{2,}\s+[a-zA-ZÀ-ÿ\u00f1\u00d1\s]{2,}$/,"validation.fullNameInvalid"),otherwise:t=>t.notRequired()}),phoneNumber:s().when([],{is:()=>P("phoneNumber",t)&&!e||e&&i==="input",then:t=>t.required("validation.phoneRequired"),otherwise:t=>t.notRequired()}),isValidPhoneNumber:s().when([],{is:()=>P("phoneNumber",t)&&!e||e&&i==="input",then:t=>t.equals(["true"],"validation.phoneRequired"),otherwise:t=>t.notRequired()}),"billing-country":s().when([],{is:()=>P("billing-country",t)&&!e||e&&i==="input",then:t=>t.required("validation.countryRequired"),otherwise:t=>t.notRequired()}),"billing-state":s().when([],{is:()=>P("billing-state",t)&&!e||e&&i==="input",then:t=>t.required("validation.stateRequired"),otherwise:t=>t.notRequired()}),"billing-address":s().when([],{is:()=>P("billing-address",t)&&!e||e&&i==="input",then:t=>t.required("validation.addressRequired"),otherwise:t=>t.notRequired()}),"billing-city":s().when([],{is:()=>P("billing-city",t)&&!e||e&&i==="input",then:t=>t.required("validation.cityRequired"),otherwise:t=>t.notRequired()}),"billing-zip":s().when([],{is:()=>P("billing-zip",t)&&!e||e&&i==="input",then:t=>t.required("validation.zipRequired"),otherwise:t=>t.notRequired()}),bankId:s().when([],{is:()=>P("bankId",t),then:t=>t.required("validation.bankRequired"),otherwise:t=>t.notRequired()}),installments:s().when([],{is:()=>n===p.CARD&&c.data?.cardInformation?.installments?.isAvailableInstallments&&(c.data?.cardInformation?.installments?.installments?.length??0)>0&&c.data?.itemInformation?.type!==y.PLAN,then:t=>t.required("validation.installmentsRequired"),otherwise:t=>t.notRequired()}),documentType:s().when([],{is:()=>I(c.data?.pricing?.currency)&&((P("documentType",t)||P("documentNumber",t))&&!e||e&&i==="input"),then:t=>t.required("validation.documentTypeRequired"),otherwise:t=>t.notRequired()}),documentNumber:s().when([],{is:()=>I(c.data?.pricing?.currency)&&((P("documentNumber",t)||P("documentType",t))&&!e||e&&i==="input"),then:t=>{const e=t.required("validation.documentNumberRequired").min(7,"validation.documentInvalid");if(c.data?.pricing?.country==="BR"){return e.test("numeric-only","validation.documentNumberNumericOnly",(t=>{if(!t)return true;return/^\d+$/.test(t)}))}return e},otherwise:t=>t.notRequired()})}}getInitialData=()=>({email:c.data.userInformation.email||"",fullName:c.data.userInformation.fullName||"",phoneNumber:c.data.userInformation.phoneNumber?.number||"",countryCodePhoneNumber:c.data.userInformation.countryCode||"",documentType:"",documentNumber:"","billing-country":c.data.userInformation.address?.billingAddress?.country||"","billing-state":c.data.userInformation?.address?.billingAddress?.state||"","billing-address":c.data.userInformation?.address?.billingAddress?.address||"","billing-city":c.data.userInformation?.address?.billingAddress?.city||"","billing-zip":c.data.userInformation?.address?.billingAddress?.zip||"",bankId:c.data.bankId?.code||"",card:"",installments:c.data.cardInformation?.installments?.selectedInstallment?.installment?.toString()||""});hasPrefilledAddress=()=>{const t=["billing-country","billing-state","billing-address","billing-city","billing-zip"];return t.some((t=>{const e=this.initialData[t];return e&&e.trim()!==""}))};get isQrCodeVisible(){return!!this.checkoutResponse?.result?.data?.qrCode}get isBankTransferVisible(){return!!this.checkoutResponse?.result?.data?.account&&!!this.checkoutResponse?.result?.data?.bankName&&!!this.checkoutResponse?.result?.data?.reference}get isBoletoVisible(){return this.currentPaymentMethod===p.CASH&&c.data?.pricing?.country==="BR"&&!!this.checkoutResponse?.result?.data?.barcode}isPaymentApproved=()=>{if(c.data.paymentStatus===a.APPROVED){return true}return false};handleRebillAccountClick(t){this.showOtp=t.detail}handleReturnForm(t){this.showOtp=t.detail;u.clearCustomerIdAndToken()}handleSignOut(){this.showOtp=false;this.otpVerified=false;if(!c?.data?.prefilledData?.email){this.customerExists=false}u.clearCustomerIdAndToken();u.clearUserInformation();u.setCardId(null);u.setCardTokenId(null);this.cardMode="input";u.setCardMode("input");this.cardError={showCardInvalid:false,type:null};this.alertErrorKeys=null;this.rejectedPaymentCard=false;this.rejectedPaymentAPM=false}handleCodeVerified(){this.otpVerified=true;this.showOtp=false;this.rejectedPaymentCard=false;this.alertErrorKeys=null;this.cardError={showCardInvalid:false,type:null};if(this.formElement){this.formElement.resetValidation()}}isPaymentRejected(){return c.data.paymentStatus===a.REJECTED&&this.currentPaymentMethod===p.BANK_TRANSFER}render(){const t=this.countries.map((t=>({label:t.country,value:t.isoCountryCode})));const e=(t={})=>i("rebill-summary",{key:"27bf2a0eb744f9be27c6d11c9585a3db69c563f1",totalAmount:c.data.pricing.total,currency:c.data.pricing.currency,itemTitle:c._session?.getTitle(),itemDescription:c._session?.getDescription(),itemAmount:c.data.pricing.subtotal,subtotal:c.data.pricing.subtotal,allowCoupon:c._session?.getAllowCoupon(this.displayConfig),currentBreakpoint:this.breakpoint,planFrequency:c._session?.getPlanFrequency(),planFrequencyCount:c._session?.getPlanFrequencyCount(),discountType:c.data.discount.discountType,discountedPercentage:c.data.discount.discountedPercentage,discountDuration:c.data.discount.discountDuration,discountAmount:c.data.discount.discountAmount,initialCouponCode:this.couponCode,...t});return c.isInitialized&&i(i.Fragment,null,this.showRefreshModal&&i("rebill-modal-overlay",{key:"e8923ed0d91e204e56259842e998820586f04493"}),this.displayConfig.processingPayment&&i("rebill-processing-payment",{key:"48b27b39d74c703bdd1172c567255ce924dab0ce",style:{display:this.isCardSubmitting?"block":"none"}}),this.displayConfig.successPage&&this.isPaymentApproved()&&c.isInitialized?i("success-page",{typePaymentMethod:c.data.paymentMethodSelected,paymentMethodName:N.mapToAPMPaymentMethod(c.data.paymentMethodSelected||c.data.payment?.paymentMethodType,c.data?.pricing?.country),country:c.data?.pricing?.country,bank:c.data.payment?.paymentMethodMetadata?.bankName,cardLastFour:this.responseCheckoutCard?.result?.cardLastFour||c.data.cardInformation?.lastFour,paymentDate:c.data.paymentDate||this.responseCheckoutCard?.date||c.data.payment?.createdAt||this.checkoutResponse?.result?.data?.createdAt,referenceNumber:c.data.paymentReference||c.data.payment?.traceId||this.responseCheckoutCard?.traceId,onSuccessRedirect:t=>{this.successRedirect.emit(t.detail)},trialPeriodDays:c.data?.itemInformation?.trial?.trialPeriodDays,debitDay:c.data?.itemInformation?.debitDay,planAmount:c.data?.pricing?.planAmount}):i(i.Fragment,null,this.displayConfig.sandboxMode&&c.isSandbox&&c.data.sessionType===d.CHECKOUT_LANDING&&k(this.breakpoint,g.DESKTOP)&&i("div",{class:"mode-sandbox-mobile-container",style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"}},i("rebill-mode-sandbox-mobile",null)),i("rebill-checkout-form",{ref:t=>this.formElement=t,style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"},validationSchema:this.validationSchema,initialData:this.initialData,onSubmit:t=>this.handleSubmit(t),onChange:t=>this.handleFormChange(t),renderForm:({submit:s,formData:n,errors:o})=>{const a=!this.isCardSuccess&&this.checkoutResponse?.result&&(this.currentPaymentMethod===p.CASH||this.currentPaymentMethod===p.BANK_TRANSFER);return i("div",{class:`rebill-checkout ${!this.displayConfig.checkoutSummary?"full-width-layout":""}`},i("div",{class:"left-section"},i("div",{class:"left-section-container"},this.displayConfig.logo&&i("organization-logo",{organization:c.data.organization}),i("div",{class:"otp-container",style:{display:this.showOtp?"block":"none"}},i("otp-component",null)),i("div",{style:{display:this.showOtp?"none":"block"}},i("div",{class:"checkout-form-section"},this.displayConfig.checkoutSummary&&i("div",{class:"summary-mobile-tablet",style:{display:k(this.breakpoint,g.DESKTOP)?"block":"none"}},e({displayedComponents:["totalAmount","discount","timelineFreeTrial","timelineDebitDay","itemDetails"]})),!this.otpVerified&&this.displayConfig.customerInformation&&i("user-information",{customerExists:this.customerExists,disabled:this.isSubmitting,errors:{email:o.email,fullName:o.fullName}}),this.otpVerified&&this.displayConfig.customerInformation&&i("user-information-static",{variant:"otp",userInfo:{customerName:c.data.userInformation.fullName?.split(" ")[0],customerEmail:c.data.userInformation.email}}),i("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},i("payment-method-selector",{enabledPaymentMethods:this.filteredPaymentMethods,defaultSelected:this.currentPaymentMethod,disabled:this.isSubmitting,errorComponent:{showErrorComponent:this.displayConfig.errorMessage&&(this.currentPaymentError||this.isPaymentRejected()),alertTitle:l.getErrorTitle(this.currentPaymentMethod,c.data?.pricing?.country||"",this.alertErrorKeys?.alertTitle),message:l.getErrorMessage(this.alertErrorKeys?.message,this.currentPaymentMethod,c.data?.pricing?.country)},country:c.data?.pricing?.country,installmentsError:o.installments,showDocument:(!this.otpVerified||this.otpVerified&&this.cardMode==="input")&&!a&&!this.isQrCodeVisible&&I(c.data?.pricing?.currency)&&(P("documentNumber",this.currentRequiredFields)||P("documentType",this.currentRequiredFields)),documentTypeError:o.documentType,documentNumberError:o.documentNumber,cardError:this.cardError,customCSS:this.css}),!a&&(()=>{const t=P("bankId",this.currentRequiredFields);return t})()&&i("div",{class:"animated-component fade-in"},i("rebill-bank-selector",{banks:S("bank",this.allRequiredFields[this.currentPaymentMethod].original)||[],defaultSelectedBankId:n.bankId||"",error:o?.bankId,disabled:this.isSubmitting}))),!a&&(!this.otpVerified||this.cardMode==="input")&&i(i.Fragment,null,this.displayConfig.billingAddress&&(P("billing-country",this.currentRequiredFields)||P("billing-state",this.currentRequiredFields)||P("billing-address",this.currentRequiredFields)||P("billing-city",this.currentRequiredFields)||P("billing-zip",this.currentRequiredFields))&&i("div",{class:"animated-component slide-in"},i("rebill-address",{disabled:this.isSubmitting,countryOptions:t,billingView:(()=>{if(this.displayConfig.useAddressSearch!==undefined&&this.displayConfig.useAddressSearch===false){return"form"}return this.hasPrefilledAddress()?"form":"search"})(),errors:{"billing-country":o["billing-country"],"billing-state":o["billing-state"],"billing-address":o["billing-address"],"billing-city":o["billing-city"],"billing-zip":o["billing-zip"]}})),this.displayConfig.customerInformation&&P("phoneNumber",this.currentRequiredFields)&&i("div",{class:"animated-component fade-in"},i("user-information-phone",{disabled:this.isSubmitting,error:o?.phoneNumber||o?.isValidPhoneNumber,countryCode:c.data.userInformation?.countryCode||c.data.country}))),a&&(()=>{const t=this.currentPaymentMethod===p.CASH&&c.data?.pricing?.country==="BR"&&this.checkoutResponse?.result?.data?.barcode;return i("apm-checkout",{paymentMethod:this.currentPaymentMethod,barcode:t?this.checkoutResponse?.result?.data?.barcode:undefined,referenceId:this.currentPaymentMethod===p.CASH&&!t?this.checkoutResponse?.result?.data?.referenceId:undefined,qrCodeData:this.currentPaymentMethod===p.BANK_TRANSFER?this.checkoutResponse?.result?.data?.qrCode:undefined,code:this.currentPaymentMethod===p.BANK_TRANSFER?this.checkoutResponse?.result?.data?.code:undefined,checkoutRequestId:this.checkoutResponse?.result?.checkoutRequestId,providerName:c.data.providerKey,expirationDate:(()=>{const t=new Date;t.setDate(t.getDate()+30);return t.toISOString()})(),onPaymentStatusChange:t=>this.handlePaymentStatusChange(t.detail),country:c.data?.pricing?.country,redirectUrl:this.checkoutResponse?.result?.data?.url,timeToRedirect:this.timeToRedirectAPM,bearerToken:this.checkoutResponse?.result?.data?.bearerToken,bankTransferData:this.checkoutResponse?.result?.data?.account&&this.checkoutResponse?.result?.data?.bankName&&this.checkoutResponse?.result?.data?.reference?{account:this.checkoutResponse.result.data.account,bankName:this.checkoutResponse.result.data.bankName,reference:this.checkoutResponse.result.data.reference}:undefined})})(),this.displayConfig.checkoutSummary&&i("div",{class:"summary-price-details",style:{display:k(this.breakpoint,g.DESKTOP)?"block":"none"}},e({displayedComponents:["priceDetails"]})),this.displayConfig.submitButton&&!(a&&(this.isQrCodeVisible||this.isBankTransferVisible||this.isBoletoVisible))&&i("div",{class:"payment-button-container"},i("payment-button",{paymentMethod:this.currentPaymentMethod,isLoading:this.isSubmitting,trialPeriodDays:c.data?.itemInformation?.trial?.trialPeriodDays,onSubmit:()=>{s()},redirectUrl:!!this.checkoutResponse?.result?.data?.url,timeToRedirect:this.timeToRedirectAPM,isDisabled:c.data.fetchingInstallments,country:c.data?.pricing?.country}),i("rebill-alert",{type:"secure",variant:"variant-secure",icon:"lock-outline",message:h.translate("otp.secureMessage")}))),this.displayConfig.sandboxMode&&c.isSandbox&&c.data.sessionType===d.CHECKOUT_LANDING&&!k(this.breakpoint,g.DESKTOP)&&i("rebill-mode-sandbox",null)),this.displayConfig.footer&&i("rebill-footer",{style:{marginTop:k(this.breakpoint,g.DESKTOP)?"24px":"auto"}}))),this.displayConfig.checkoutSummary&&i("div",{class:"right-section-checkout"},i("div",{class:"checkout-summary-section"},i("div",{class:"summary-desktop",style:{display:!k(this.breakpoint,g.DESKTOP)?"block":"none"}},e()))))}})))}static get watchers(){return{language:["handleLanguageChange"]}}};G.style=W;export{G as rebill_checkout};
2
+ //# sourceMappingURL=p-f3859b65.entry.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,b as t}from"./p-D8cwEAmw.js";export{s as setNonce}from"./p-D8cwEAmw.js";import{g as r}from"./p-DQuL1Twl.js";var a=()=>{const t=import.meta.url;const r={};if(t!==""){r.resourcesUrl=new URL(".",t).href}return e(r)};a().then((async e=>{await r();return t(JSON.parse('[["p-5c4c4d5f",[[256,"rebill-checkout",{"productId":[1,"product-id"],"planId":[1,"plan-id"],"publicKey":[1,"public-key"],"instantProduct":[1,"instant-product"],"instantPlan":[1,"instant-plan"],"display":[1],"customerInformation":[1,"customer-information"],"oneClickCheckout":[4,"one-click-checkout"],"css":[1],"js":[1],"language":[1],"couponCode":[1,"coupon-code"],"checkoutLandingSession":[1,"checkout-landing-session"],"externalPayment":[1,"external-payment"],"rejectedPaymentCard":[32],"rejectedPaymentAPM":[32],"countries":[32],"currentPaymentMethod":[32],"checkoutResponse":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"isAPMSubmitting":[32],"isAPMSuccess":[32],"storedCheckoutResults":[32],"alertErrorKeys":[32],"currentApmPaymentMethod":[32],"breakpoint":[32],"showRefreshModal":[32],"cardError":[32],"initialData":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"customerExists":[32],"showOtp":[32],"otpVerified":[32],"responseCheckoutCard":[32],"cardMode":[32],"submit":[64]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"input","handleInputChange"],[0,"onRebillAccountClick","handleRebillAccountClick"],[0,"returnForm","handleReturnForm"],[0,"signOut","handleSignOut"],[0,"codeVerified","handleCodeVerified"]],{"language":["handleLanguageChange"]}]]],["p-fa2647be",[[256,"rebill-renewal",{"renewalData":[1,"renewal-data"],"renewalToken":[1,"renewal-token"],"currentPaymentMethod":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"errorPaymentAPM":[32],"initialData":[32],"checkoutResponse":[32],"currentApmPaymentMethod":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"bankSelected","handleBankSelected"],[0,"cardSelected","handleCardSelected"]]]]],["p-f08ee974",[[256,"rebill-change-card",{"changeCardData":[1,"change-card-data"],"changeCardToken":[1,"change-card-token"],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"initialData":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32],"completedAt":[32]}]]],["p-70cf5bb8",[[256,"root-component",{"isLoading":[32],"currentLang":[32],"formData":[32]}]]],["p-85d3974b",[[256,"rebill-card-carousel",{"interval":[2],"size":[1],"color":[1],"showAllCards":[4,"show-all-cards"],"currentIndex":[32]}]]],["p-ecf4cff4",[[260,"rebill-flex-container",{"direction":[1],"wrap":[1],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-85a17349",[[260,"rebill-grid-container",{"columns":[2],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-2292f5cb",[[260,"rebill-typography",{"variant":[1],"color":[1],"align":[1],"noWrap":[4,"no-wrap"],"gutterBottom":[4,"gutter-bottom"],"paragraph":[4]}],[256,"rebill-icon",{"name":[1],"size":[1],"color":[1],"svgContent":[32]}]]],["p-3800e494",[[256,"renewal-success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}]]],["p-41e57546",[[256,"change-card-success",{"customerName":[1,"customer-name"],"cardLastFour":[1,"card-last-four"],"cardBrand":[1,"card-brand"],"paymentDate":[1,"payment-date"],"customerEmail":[1,"customer-email"],"currentLocale":[32]}]]],["p-6ec7d549",[[256,"discount-coupon",{"hideLabel":[4,"hide-label"],"displayMode":[1,"display-mode"],"readonlyCouponCode":[1,"readonly-coupon-code"],"readonlyDiscountAmount":[2,"readonly-discount-amount"],"readonlyCurrency":[1,"readonly-currency"],"initialCouponCode":[1,"initial-coupon-code"],"couponCode":[32],"actionStatus":[32],"isLoading":[32],"isError":[32],"currentLocale":[32]}],[256,"rebill-divider"],[260,"collapsible-card",{"header":[1],"open":[4],"variant":[1],"isOpen":[32]}]]],["p-a6cdb7b1",[[256,"renewal-summary",{"displayedComponents":[16],"totalAmount":[2,"total-amount"],"subTotalAmount":[2,"sub-total-amount"],"subscriptionTitle":[1,"subscription-title"],"subscriptionAmount":[2,"subscription-amount"],"nextChargeDate":[1,"next-charge-date"],"frequency":[16],"currency":[1],"couponCode":[1,"coupon-code"],"discountAmount":[2,"discount-amount"],"discountPercentage":[2,"discount-percentage"],"titleKey":[1,"title-key"],"forceUpdate":[32]}]]],["p-ac778c24",[[256,"input-otp",{"error":[1],"otp":[1],"clearable":[4],"placeholder":[1],"otpValue":[32]}]]],["p-38d7cee1",[[260,"rebill-container",{"maxWidth":[1,"max-width"],"padding":[1],"fluid":[4]}],[256,"rebill-input-checkbox",{"label":[1],"checked":[1540],"error":[1],"id":[1],"disabled":[4]},[[4,"change","handleFormChange"]]]]],["p-04ba839d",[[256,"rebill-timeline-debit-day",{"debitDay":[2,"debit-day"],"totalAmount":[2,"total-amount"],"planAmount":[2,"plan-amount"],"currency":[1],"debitStrategy":[1,"debit-strategy"],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}],[256,"rebill-timeline-free-trial",{"trialPeriodEndsAt":[1,"trial-period-ends-at"],"trialPeriodEndsReminderAt":[1,"trial-period-ends-reminder-at"],"trialPeriodDays":[2,"trial-period-days"],"subtotal":[2],"currency":[1],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}]]],["p-e81d6673",[[256,"rebill-mode-sandbox",{"isPanelVisible":[32],"isPanelClosing":[32],"isCardsPanelVisible":[32],"isCardsPanelClosing":[32],"currentLanguage":[32]}],[256,"rebill-mode-sandbox-mobile",{"isPanelVisible":[32],"currentLanguage":[32]}]]],["p-6d59117f",[[256,"rebill-card",{"cardTitle":[1,"card-title"],"cardLabels":[16]}],[256,"rebill-input-email",{"label":[1],"placeholder":[1],"value":[1537],"error":[1],"id":[1],"disabled":[4],"leftIcon":[1,"left-icon"],"clearable":[4],"variant":[1],"emailSuggestions":[32],"highlightedSuggestionIndex":[32],"emailCorrectionSuggestion":[32],"dropdownPosition":[32],"getInputElement":[64]},[[4,"change","handleFormChange"],[4,"click","handleDocumentClick"],[5,"touchend","handleDocumentTouchEnd"]]]]],["p-d616792b",[[256,"rebill-vertical-divider",{"height":[1],"color":[1],"thickness":[1],"dashed":[4],"connectorActive":[4,"connector-active"],"withDot":[4,"with-dot"]}]]],["p-ee5e293c",[[256,"rebill-alert",{"type":[1],"message":[1],"alertTitle":[1,"alert-title"],"icon":[1],"variant":[1],"size":[1],"colorIcon":[1,"color-icon"]}]]],["p-03e56f51",[[256,"rebill-input-text",{"label":[1],"placeholder":[1],"value":[1537],"error":[1],"id":[1],"disabled":[4],"leftIcon":[1,"left-icon"],"rightIcon":[1,"right-icon"],"clearable":[4],"variant":[1],"uppercase":[4],"getInputElement":[64]},[[4,"change","handleFormChange"]]]]],["p-644f0d63",[[256,"rebill-input-select",{"label":[1],"options":[16],"value":[1537],"error":[1],"id":[1],"disabled":[4],"placeholder":[1],"variant":[1],"arrowIcon":[1,"arrow-icon"],"dropPosition":[1,"drop-position"],"fontSize":[1,"font-size"],"backgroundColor":[1,"background-color"],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"loading":[4],"isOpen":[32],"componentId":[32],"highlightedIndex":[32],"searchTerm":[32],"filteredOptions":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"],[0,"keydown","handleKeyDown"]]]]],["p-4b8ba30e",[[260,"rebill-button",{"type":[1],"disabled":[4],"id":[1],"loading":[4],"showSpinnerWithText":[4,"show-spinner-with-text"],"nonClickable":[4,"non-clickable"],"variant":[1],"theme":[1],"size":[1],"icon":[1],"iconColor":[1,"icon-color"]}]]],["p-ba4d1631",[[256,"rebill-card-icon",{"cardBrand":[1,"card-brand"],"width":[2],"height":[2]}],[260,"rebill-checkout-single-column"],[256,"rebill-footer",{"breakpoint":[32]}],[256,"organization-logo",{"organization":[16]}]]],["p-1071451c",[[256,"rebill-summary",{"totalAmount":[8,"total-amount"],"itemTitle":[1,"item-title"],"itemDescription":[1,"item-description"],"itemAmount":[8,"item-amount"],"planFrequency":[1,"plan-frequency"],"planFrequencyCount":[2,"plan-frequency-count"],"subtotal":[8],"discount":[8],"currency":[1],"displayedComponents":[16],"allowCoupon":[4,"allow-coupon"],"currentBreakpoint":[1,"current-breakpoint"],"initialCouponCode":[1,"initial-coupon-code"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"discountApplied":[32]},[[0,"discountApplied","handleDiscountApplied"]]],[256,"success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}],[256,"user-information",{"userInformation":[16],"errors":[16],"customerExists":[4,"customer-exists"],"disabled":[4]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]]],[256,"otp-component",{"timeLeft":[32],"isTimerRunning":[32],"codeResent":[32],"isVerifying":[32],"otpValue":[32],"error":[32]}],[256,"rebill-modal-overlay",{"visible":[32],"languageUpdateTrigger":[32]}]]],["p-3a703f22",[[260,"rebill-autofill-detector",{"targetSelector":[1,"target-selector"],"disabled":[4],"browserAutocompleteDetected":[32],"disabledDetector":[32]}]]],["p-10d543f4",[[260,"rebill-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"formData":[32],"errors":[32],"submitForm":[64],"resetValidation":[64],"clearError":[64]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]],{"initialData":["handleInitialDataChange"],"validationSchema":["handleValidationSchemaChange"]}]]],["p-0c396bf4",[[256,"card-fields-wrapper",{"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"showDocument":[4,"show-document"],"customCSS":[1,"custom-c-s-s"]}],[256,"rebill-address-form",{"addressType":[1,"address-type"],"countryOptions":[16],"stateOptions":[16],"errors":[16],"disabled":[4],"showAdditionalInformation":[32]}],[256,"rebill-address-search",{"addressType":[1,"address-type"],"placeholder":[1],"error":[1],"disabled":[4],"value":[1],"showManualEntryLink":[4,"show-manual-entry-link"],"isInitialized":[32],"currentLocale":[32],"editingValue":[32],"justSelectedPlace":[32]},null,{"value":["valueWatcher"],"error":["errorWatcher"],"disabled":["disabledWatcher"]}],[256,"single-payment-method",{"paymentMethod":[1,"payment-method"],"currencyCountry":[1,"currency-country"],"paymentMethodDetails":[16],"icons":[16]}],[256,"rebill-input-phone",{"placeholder":[1],"value":[1537],"error":[1],"phoneNumberId":[1,"phone-number-id"],"countryCodeId":[1,"country-code-id"],"validationErrorId":[1,"validation-error-id"],"disabled":[4],"initialCountry":[1,"initial-country"],"required":[4],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"selectedCountry":[32],"isDropdownOpen":[32],"validationError":[32],"searchTerm":[32],"filteredCountries":[32],"componentId":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[260,"selectable-card",{"selected":[4],"label":[1],"cardKey":[1,"card-key"],"disabled":[4]}],[256,"rebill-installments",{"error":[1],"currentValue":[32],"isDisabled":[32],"value":[32],"placeholder":[32]}],[256,"card-identification",{"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"disabled":[4],"documentTypes":[32],"country":[32],"currentLanguage":[32]}],[256,"card-iframe",{"customCSS":[1,"custom-c-s-s"],"iframeLoaded":[32],"currentLang":[32],"initialLang":[32],"iframeHeight":[32],"showCvcTooltip":[32],"tooltipPosition":[32]}],[256,"rebill-input-combo",{"label":[1],"options":[16],"selectValue":[1537,"select-value"],"inputValue":[1537,"input-value"],"inputPlaceholder":[1,"input-placeholder"],"selectPlaceholder":[1,"select-placeholder"],"error":[1],"selectId":[1,"select-id"],"inputId":[1,"input-id"],"disabled":[4],"selectWidth":[1,"select-width"],"isOpen":[32],"highlightedIndex":[32],"componentId":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[256,"card-skeleton"]]],["p-9fa0e894",[[256,"apm-checkout",{"paymentMethod":[1,"payment-method"],"referenceId":[1,"reference-id"],"qrCodeData":[1,"qr-code-data"],"code":[1],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"country":[1],"redirectUrl":[1,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"checkoutRequestId":[1,"checkout-request-id"],"bearerToken":[1,"bearer-token"],"bankTransferData":[8,"bank-transfer-data"],"barcode":[1],"amount":[2],"currency":[1],"showRedirectMessage":[32],"isPolling":[32],"minutesLeft":[32],"qrStartTime":[32],"downloadData":[32]}],[256,"rebill-bank-selector",{"banks":[16],"defaultSelectedBankId":[1,"default-selected-bank-id"],"error":[1],"disabled":[4],"selectedBankId":[32],"languageUpdateTrigger":[32]}],[256,"payment-method-selector",{"enabledPaymentMethods":[16],"defaultSelected":[1,"default-selected"],"showErrorComponent":[4,"show-error-component"],"cardError":[16],"country":[1],"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"showDocument":[4,"show-document"],"documentNumberError":[1,"document-number-error"],"customCSS":[1,"custom-c-s-s"],"errorComponent":[16],"disabled":[4],"icon":[32],"selectedPaymentMethod":[32],"saveCard":[32]},[[0,"selectableCardClick","handleSelectableCardClick"]]],[256,"rebill-address",{"billingView":[1537,"billing-view"],"disabled":[4],"countryOptions":[16],"errors":[16],"currentBillingStateOptions":[32],"isLoadingAddress":[32],"addressLine":[32],"addressCommitted":[32]}],[256,"rebill-processing-payment",{"titleKey":[1,"title-key"],"subtitleKey":[1,"subtitle-key"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32]}],[256,"bank-transfer",{"bankTransferData":[8,"bank-transfer-data"]}],[256,"qr-code",{"qrCodeData":[1,"qr-code-data"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"paymentMethod":[1,"payment-method"],"code":[1],"qrCodeSvg":[32],"isImage":[32],"timeLeft":[32],"formattedTime":[32],"hasCopied":[32]}],[256,"user-information-static",{"userInfo":[16],"variant":[1]}],[256,"apm-download",{"data":[16]}],[256,"payment-button",{"isDisabled":[4,"is-disabled"],"isLoading":[4,"is-loading"],"paymentMethod":[1,"payment-method"],"isRenewal":[4,"is-renewal"],"isChangeCard":[4,"is-change-card"],"trialPeriodDays":[2,"trial-period-days"],"redirectUrl":[4,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"country":[1],"currentLanguage":[32],"countdownSeconds":[32],"paymentMethodDisplayName":[32]},null,{"redirectUrl":["onRedirectPropsChange"],"timeToRedirect":["onRedirectPropsChange"]}],[256,"user-information-phone",{"error":[1],"countryCode":[1,"country-code"],"disabled":[4],"languageUpdateTrigger":[32]}],[256,"boleto-payment",{"barcode":[1],"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32],"hasCopied":[32]}],[256,"rebill-checkout-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"resetValidation":[64]},[[0,"change","handleFormChange"]]],[256,"reference-code",{"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32]}]]]]'),e)}));
1
+ import{p as e,b as t}from"./p-D8cwEAmw.js";export{s as setNonce}from"./p-D8cwEAmw.js";import{g as r}from"./p-DQuL1Twl.js";var a=()=>{const t=import.meta.url;const r={};if(t!==""){r.resourcesUrl=new URL(".",t).href}return e(r)};a().then((async e=>{await r();return t(JSON.parse('[["p-f3859b65",[[256,"rebill-checkout",{"productId":[1,"product-id"],"planId":[1,"plan-id"],"publicKey":[1,"public-key"],"instantProduct":[1,"instant-product"],"instantPlan":[1,"instant-plan"],"display":[1],"customerInformation":[1,"customer-information"],"oneClickCheckout":[4,"one-click-checkout"],"css":[1],"js":[1],"language":[1],"couponCode":[1,"coupon-code"],"checkoutLandingSession":[1,"checkout-landing-session"],"externalPayment":[1,"external-payment"],"rejectedPaymentCard":[32],"rejectedPaymentAPM":[32],"countries":[32],"currentPaymentMethod":[32],"checkoutResponse":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"isAPMSubmitting":[32],"isAPMSuccess":[32],"storedCheckoutResults":[32],"alertErrorKeys":[32],"currentApmPaymentMethod":[32],"breakpoint":[32],"showRefreshModal":[32],"cardError":[32],"initialData":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"customerExists":[32],"showOtp":[32],"otpVerified":[32],"responseCheckoutCard":[32],"cardMode":[32],"submit":[64]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"input","handleInputChange"],[0,"onRebillAccountClick","handleRebillAccountClick"],[0,"returnForm","handleReturnForm"],[0,"signOut","handleSignOut"],[0,"codeVerified","handleCodeVerified"]],{"language":["handleLanguageChange"]}]]],["p-bf15156a",[[256,"rebill-renewal",{"renewalData":[1,"renewal-data"],"renewalToken":[1,"renewal-token"],"currentPaymentMethod":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"errorPaymentAPM":[32],"initialData":[32],"checkoutResponse":[32],"currentApmPaymentMethod":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"bankSelected","handleBankSelected"],[0,"cardSelected","handleCardSelected"]]]]],["p-b9a3b27f",[[256,"rebill-change-card",{"changeCardData":[1,"change-card-data"],"changeCardToken":[1,"change-card-token"],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"initialData":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32],"completedAt":[32]}]]],["p-70cf5bb8",[[256,"root-component",{"isLoading":[32],"currentLang":[32],"formData":[32]}]]],["p-85d3974b",[[256,"rebill-card-carousel",{"interval":[2],"size":[1],"color":[1],"showAllCards":[4,"show-all-cards"],"currentIndex":[32]}]]],["p-ecf4cff4",[[260,"rebill-flex-container",{"direction":[1],"wrap":[1],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-85a17349",[[260,"rebill-grid-container",{"columns":[2],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-2292f5cb",[[260,"rebill-typography",{"variant":[1],"color":[1],"align":[1],"noWrap":[4,"no-wrap"],"gutterBottom":[4,"gutter-bottom"],"paragraph":[4]}],[256,"rebill-icon",{"name":[1],"size":[1],"color":[1],"svgContent":[32]}]]],["p-3800e494",[[256,"renewal-success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}]]],["p-41e57546",[[256,"change-card-success",{"customerName":[1,"customer-name"],"cardLastFour":[1,"card-last-four"],"cardBrand":[1,"card-brand"],"paymentDate":[1,"payment-date"],"customerEmail":[1,"customer-email"],"currentLocale":[32]}]]],["p-6ec7d549",[[256,"discount-coupon",{"hideLabel":[4,"hide-label"],"displayMode":[1,"display-mode"],"readonlyCouponCode":[1,"readonly-coupon-code"],"readonlyDiscountAmount":[2,"readonly-discount-amount"],"readonlyCurrency":[1,"readonly-currency"],"initialCouponCode":[1,"initial-coupon-code"],"couponCode":[32],"actionStatus":[32],"isLoading":[32],"isError":[32],"currentLocale":[32]}],[256,"rebill-divider"],[260,"collapsible-card",{"header":[1],"open":[4],"variant":[1],"isOpen":[32]}]]],["p-a6cdb7b1",[[256,"renewal-summary",{"displayedComponents":[16],"totalAmount":[2,"total-amount"],"subTotalAmount":[2,"sub-total-amount"],"subscriptionTitle":[1,"subscription-title"],"subscriptionAmount":[2,"subscription-amount"],"nextChargeDate":[1,"next-charge-date"],"frequency":[16],"currency":[1],"couponCode":[1,"coupon-code"],"discountAmount":[2,"discount-amount"],"discountPercentage":[2,"discount-percentage"],"titleKey":[1,"title-key"],"forceUpdate":[32]}]]],["p-ac778c24",[[256,"input-otp",{"error":[1],"otp":[1],"clearable":[4],"placeholder":[1],"otpValue":[32]}]]],["p-38d7cee1",[[260,"rebill-container",{"maxWidth":[1,"max-width"],"padding":[1],"fluid":[4]}],[256,"rebill-input-checkbox",{"label":[1],"checked":[1540],"error":[1],"id":[1],"disabled":[4]},[[4,"change","handleFormChange"]]]]],["p-04ba839d",[[256,"rebill-timeline-debit-day",{"debitDay":[2,"debit-day"],"totalAmount":[2,"total-amount"],"planAmount":[2,"plan-amount"],"currency":[1],"debitStrategy":[1,"debit-strategy"],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}],[256,"rebill-timeline-free-trial",{"trialPeriodEndsAt":[1,"trial-period-ends-at"],"trialPeriodEndsReminderAt":[1,"trial-period-ends-reminder-at"],"trialPeriodDays":[2,"trial-period-days"],"subtotal":[2],"currency":[1],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}]]],["p-e81d6673",[[256,"rebill-mode-sandbox",{"isPanelVisible":[32],"isPanelClosing":[32],"isCardsPanelVisible":[32],"isCardsPanelClosing":[32],"currentLanguage":[32]}],[256,"rebill-mode-sandbox-mobile",{"isPanelVisible":[32],"currentLanguage":[32]}]]],["p-6d59117f",[[256,"rebill-card",{"cardTitle":[1,"card-title"],"cardLabels":[16]}],[256,"rebill-input-email",{"label":[1],"placeholder":[1],"value":[1537],"error":[1],"id":[1],"disabled":[4],"leftIcon":[1,"left-icon"],"clearable":[4],"variant":[1],"emailSuggestions":[32],"highlightedSuggestionIndex":[32],"emailCorrectionSuggestion":[32],"dropdownPosition":[32],"getInputElement":[64]},[[4,"change","handleFormChange"],[4,"click","handleDocumentClick"],[5,"touchend","handleDocumentTouchEnd"]]]]],["p-d616792b",[[256,"rebill-vertical-divider",{"height":[1],"color":[1],"thickness":[1],"dashed":[4],"connectorActive":[4,"connector-active"],"withDot":[4,"with-dot"]}]]],["p-ee5e293c",[[256,"rebill-alert",{"type":[1],"message":[1],"alertTitle":[1,"alert-title"],"icon":[1],"variant":[1],"size":[1],"colorIcon":[1,"color-icon"]}]]],["p-03e56f51",[[256,"rebill-input-text",{"label":[1],"placeholder":[1],"value":[1537],"error":[1],"id":[1],"disabled":[4],"leftIcon":[1,"left-icon"],"rightIcon":[1,"right-icon"],"clearable":[4],"variant":[1],"uppercase":[4],"getInputElement":[64]},[[4,"change","handleFormChange"]]]]],["p-644f0d63",[[256,"rebill-input-select",{"label":[1],"options":[16],"value":[1537],"error":[1],"id":[1],"disabled":[4],"placeholder":[1],"variant":[1],"arrowIcon":[1,"arrow-icon"],"dropPosition":[1,"drop-position"],"fontSize":[1,"font-size"],"backgroundColor":[1,"background-color"],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"loading":[4],"isOpen":[32],"componentId":[32],"highlightedIndex":[32],"searchTerm":[32],"filteredOptions":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"],[0,"keydown","handleKeyDown"]]]]],["p-4b8ba30e",[[260,"rebill-button",{"type":[1],"disabled":[4],"id":[1],"loading":[4],"showSpinnerWithText":[4,"show-spinner-with-text"],"nonClickable":[4,"non-clickable"],"variant":[1],"theme":[1],"size":[1],"icon":[1],"iconColor":[1,"icon-color"]}]]],["p-ba4d1631",[[256,"rebill-card-icon",{"cardBrand":[1,"card-brand"],"width":[2],"height":[2]}],[260,"rebill-checkout-single-column"],[256,"rebill-footer",{"breakpoint":[32]}],[256,"organization-logo",{"organization":[16]}]]],["p-1071451c",[[256,"rebill-summary",{"totalAmount":[8,"total-amount"],"itemTitle":[1,"item-title"],"itemDescription":[1,"item-description"],"itemAmount":[8,"item-amount"],"planFrequency":[1,"plan-frequency"],"planFrequencyCount":[2,"plan-frequency-count"],"subtotal":[8],"discount":[8],"currency":[1],"displayedComponents":[16],"allowCoupon":[4,"allow-coupon"],"currentBreakpoint":[1,"current-breakpoint"],"initialCouponCode":[1,"initial-coupon-code"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"discountApplied":[32]},[[0,"discountApplied","handleDiscountApplied"]]],[256,"success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}],[256,"user-information",{"userInformation":[16],"errors":[16],"customerExists":[4,"customer-exists"],"disabled":[4]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]]],[256,"otp-component",{"timeLeft":[32],"isTimerRunning":[32],"codeResent":[32],"isVerifying":[32],"otpValue":[32],"error":[32]}],[256,"rebill-modal-overlay",{"visible":[32],"languageUpdateTrigger":[32]}]]],["p-3a703f22",[[260,"rebill-autofill-detector",{"targetSelector":[1,"target-selector"],"disabled":[4],"browserAutocompleteDetected":[32],"disabledDetector":[32]}]]],["p-10d543f4",[[260,"rebill-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"formData":[32],"errors":[32],"submitForm":[64],"resetValidation":[64],"clearError":[64]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]],{"initialData":["handleInitialDataChange"],"validationSchema":["handleValidationSchemaChange"]}]]],["p-c327a984",[[256,"card-fields-wrapper",{"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"showDocument":[4,"show-document"],"customCSS":[1,"custom-c-s-s"]}],[256,"rebill-address-form",{"addressType":[1,"address-type"],"countryOptions":[16],"stateOptions":[16],"errors":[16],"disabled":[4],"showAdditionalInformation":[32]}],[256,"rebill-address-search",{"addressType":[1,"address-type"],"placeholder":[1],"error":[1],"disabled":[4],"value":[1],"showManualEntryLink":[4,"show-manual-entry-link"],"isInitialized":[32],"currentLocale":[32],"editingValue":[32],"justSelectedPlace":[32]},null,{"value":["valueWatcher"],"error":["errorWatcher"],"disabled":["disabledWatcher"]}],[256,"single-payment-method",{"paymentMethod":[1,"payment-method"],"currencyCountry":[1,"currency-country"],"paymentMethodDetails":[16],"icons":[16]}],[256,"rebill-input-phone",{"placeholder":[1],"value":[1537],"error":[1],"phoneNumberId":[1,"phone-number-id"],"countryCodeId":[1,"country-code-id"],"validationErrorId":[1,"validation-error-id"],"disabled":[4],"initialCountry":[1,"initial-country"],"required":[4],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"selectedCountry":[32],"isDropdownOpen":[32],"validationError":[32],"searchTerm":[32],"filteredCountries":[32],"componentId":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[260,"selectable-card",{"selected":[4],"label":[1],"cardKey":[1,"card-key"],"disabled":[4]}],[256,"rebill-installments",{"error":[1],"currentValue":[32],"isDisabled":[32],"value":[32],"placeholder":[32]}],[256,"card-identification",{"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"disabled":[4],"documentTypes":[32],"country":[32],"currentLanguage":[32]}],[256,"card-iframe",{"customCSS":[1,"custom-c-s-s"],"iframeLoaded":[32],"currentLang":[32],"initialLang":[32],"iframeHeight":[32],"showCvcTooltip":[32],"tooltipPosition":[32]}],[256,"rebill-input-combo",{"label":[1],"options":[16],"selectValue":[1537,"select-value"],"inputValue":[1537,"input-value"],"inputPlaceholder":[1,"input-placeholder"],"selectPlaceholder":[1,"select-placeholder"],"error":[1],"selectId":[1,"select-id"],"inputId":[1,"input-id"],"disabled":[4],"selectWidth":[1,"select-width"],"isOpen":[32],"highlightedIndex":[32],"componentId":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[256,"card-skeleton"]]],["p-9fa0e894",[[256,"apm-checkout",{"paymentMethod":[1,"payment-method"],"referenceId":[1,"reference-id"],"qrCodeData":[1,"qr-code-data"],"code":[1],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"country":[1],"redirectUrl":[1,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"checkoutRequestId":[1,"checkout-request-id"],"bearerToken":[1,"bearer-token"],"bankTransferData":[8,"bank-transfer-data"],"barcode":[1],"amount":[2],"currency":[1],"showRedirectMessage":[32],"isPolling":[32],"minutesLeft":[32],"qrStartTime":[32],"downloadData":[32]}],[256,"rebill-bank-selector",{"banks":[16],"defaultSelectedBankId":[1,"default-selected-bank-id"],"error":[1],"disabled":[4],"selectedBankId":[32],"languageUpdateTrigger":[32]}],[256,"payment-method-selector",{"enabledPaymentMethods":[16],"defaultSelected":[1,"default-selected"],"showErrorComponent":[4,"show-error-component"],"cardError":[16],"country":[1],"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"showDocument":[4,"show-document"],"documentNumberError":[1,"document-number-error"],"customCSS":[1,"custom-c-s-s"],"errorComponent":[16],"disabled":[4],"icon":[32],"selectedPaymentMethod":[32],"saveCard":[32]},[[0,"selectableCardClick","handleSelectableCardClick"]]],[256,"rebill-address",{"billingView":[1537,"billing-view"],"disabled":[4],"countryOptions":[16],"errors":[16],"currentBillingStateOptions":[32],"isLoadingAddress":[32],"addressLine":[32],"addressCommitted":[32]}],[256,"rebill-processing-payment",{"titleKey":[1,"title-key"],"subtitleKey":[1,"subtitle-key"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32]}],[256,"bank-transfer",{"bankTransferData":[8,"bank-transfer-data"]}],[256,"qr-code",{"qrCodeData":[1,"qr-code-data"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"paymentMethod":[1,"payment-method"],"code":[1],"qrCodeSvg":[32],"isImage":[32],"timeLeft":[32],"formattedTime":[32],"hasCopied":[32]}],[256,"user-information-static",{"userInfo":[16],"variant":[1]}],[256,"apm-download",{"data":[16]}],[256,"payment-button",{"isDisabled":[4,"is-disabled"],"isLoading":[4,"is-loading"],"paymentMethod":[1,"payment-method"],"isRenewal":[4,"is-renewal"],"isChangeCard":[4,"is-change-card"],"trialPeriodDays":[2,"trial-period-days"],"redirectUrl":[4,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"country":[1],"currentLanguage":[32],"countdownSeconds":[32],"paymentMethodDisplayName":[32]},null,{"redirectUrl":["onRedirectPropsChange"],"timeToRedirect":["onRedirectPropsChange"]}],[256,"user-information-phone",{"error":[1],"countryCode":[1,"country-code"],"disabled":[4],"languageUpdateTrigger":[32]}],[256,"boleto-payment",{"barcode":[1],"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32],"hasCopied":[32]}],[256,"rebill-checkout-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"resetValidation":[64]},[[0,"change","handleFormChange"]]],[256,"reference-code",{"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32]}]]]]'),e)}));
2
2
  //# sourceMappingURL=rebill-web-components-sdk.esm.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rebill-web-components-sdk",
3
- "version": "1.13.19",
3
+ "version": "1.13.21",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-maps.service-C61Pm1no.js","sources":["src/utils/google-maps.service.ts"],"sourcesContent":["export interface AddressComponents {\n address: string;\n city: string;\n state: string;\n country: string;\n zip: string;\n addInformation?: string;\n formattedAddress?: string; // Dirección completa de Google para usar como fallback\n}\n\nexport class GoogleMapsService {\n private static instance: GoogleMapsService;\n private isLoaded: boolean = false;\n private loadPromise: Promise<boolean> | null = null;\n\n static getInstance(): GoogleMapsService {\n if (!GoogleMapsService.instance) {\n GoogleMapsService.instance = new GoogleMapsService();\n GoogleMapsService.setupShadowDOMPatch();\n }\n return GoogleMapsService.instance;\n }\n\n private static setupShadowDOMPatch() {\n if ((window as any).gmpShadowPatched) return;\n\n const originalAttachShadow = Element.prototype.attachShadow;\n\n Element.prototype.attachShadow = function (init: ShadowRootInit) {\n if (this.localName === 'gmp-place-autocomplete') {\n return originalAttachShadow.call(this, { ...init, mode: 'open' });\n }\n return originalAttachShadow.call(this, init);\n };\n\n (window as any).gmpShadowPatched = true;\n }\n\n async waitForAPI(): Promise<boolean> {\n if (this.isLoaded && window.google) {\n return true;\n }\n\n if (this.loadPromise) {\n return this.loadPromise;\n }\n\n this.loadPromise = new Promise(resolve => {\n let attempts = 0;\n const maxAttempts = 100; // 10 seconds max wait\n\n const checkAPI = () => {\n attempts++;\n\n if (window.google) {\n this.isLoaded = true;\n resolve(true);\n } else if (attempts >= maxAttempts) {\n console.error('Google Maps API failed to load within timeout');\n resolve(false);\n } else {\n setTimeout(checkAPI, 100);\n }\n };\n checkAPI();\n });\n\n return this.loadPromise;\n }\n\n /**\n * Crea autocomplete usando la nueva API de Google Places (PlaceAutocompleteElement).\n * containerElement: donde se inserta (ej. search-input-container). Debe tener position: relative.\n * inputElement: input para sincronizar valor al seleccionar y para focus/blur.\n * Retorna el elemento y una función destroy para limpiar al desmontar.\n */\n async createAutocomplete(\n containerElement: HTMLElement,\n inputElement: HTMLInputElement,\n onPlaceSelected: (address: AddressComponents) => void,\n options?: {\n placeholder?: string;\n componentRestrictions?: { country: string | string[] };\n error?: string;\n disabled?: boolean;\n },\n ): Promise<{\n element: HTMLElement;\n destroy: () => void;\n syncToGoogle: (value?: string) => void;\n setError: (error?: string) => void;\n setDisabled: (disabled: boolean) => void;\n } | null> {\n const isReady = await this.waitForAPI();\n if (!isReady) {\n console.error('Google Maps API not available');\n return null;\n }\n\n try {\n // Nueva API: importLibrary carga Places (New)\n await google.maps.importLibrary('places');\n\n const elementOptions: google.maps.places.PlaceAutocompleteElementOptions = {\n types: ['address'],\n };\n\n if (options?.componentRestrictions?.country) {\n const countries = Array.isArray(options.componentRestrictions.country)\n ? options.componentRestrictions.country\n : [options.componentRestrictions.country];\n elementOptions.componentRestrictions = { country: countries };\n }\n\n const placeAutocomplete = new google.maps.places.PlaceAutocompleteElement(elementOptions);\n\n if (options?.placeholder) {\n placeAutocomplete.setAttribute('placeholder', options.placeholder);\n }\n\n // Agregar clase error si existe\n if (options?.error) {\n placeAutocomplete.classList.add('error');\n }\n\n // Deshabilitar si corresponde\n if (options?.disabled) {\n placeAutocomplete.setAttribute('disabled', 'true');\n const googleInput = placeAutocomplete.shadowRoot?.querySelector('input');\n if (googleInput) googleInput.disabled = true;\n }\n\n // Insertar en el container; el CSS del padre lo posiciona como overlay\n containerElement.appendChild(placeAutocomplete);\n await new Promise(resolve => setTimeout(resolve, 300));\n\n // Inyectar estilos Rebill en el shadow DOM (modo open vía setupShadowDOMPatch)\n this.injectRebillStyles(placeAutocomplete);\n\n // Ocultar elementos de branding de Google que se renderizan fuera del Shadow DOM\n this.hideGoogleBranding();\n\n // Sincronizar valor del input → Google (SOLO una dirección)\n let isSyncing = false;\n const syncToGoogle = (value?: string) => {\n if (isSyncing) return;\n isSyncing = true;\n\n const val = value ?? inputElement.value;\n const googleInput = placeAutocomplete.shadowRoot?.querySelector('input');\n if (googleInput) {\n googleInput.value = val;\n // Disparar eventos para que Google detecte el cambio\n googleInput.dispatchEvent(new Event('input', { bubbles: true }));\n googleInput.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n setTimeout(() => {\n isSyncing = false;\n }, 50);\n };\n\n const inputHandler = () => {\n if (!isSyncing) {\n syncToGoogle();\n }\n };\n inputElement.addEventListener('input', inputHandler);\n\n // Sincronizar valor inicial\n setTimeout(() => syncToGoogle(), 100);\n\n // Evento correcto: gmp-select (no gmp-placeselect)\n const selectHandler = async (ev: Event) => {\n const evt = ev as CustomEvent & {\n placePrediction?: { toPlace: () => Promise<google.maps.places.Place> };\n };\n const placePrediction = evt.placePrediction ?? (evt.detail as any)?.placePrediction;\n if (!placePrediction) return;\n const place = await placePrediction.toPlace();\n await place.fetchFields({\n fields: ['addressComponents', 'formattedAddress'],\n });\n\n if (place.addressComponents) {\n const address = this.parseAddressComponentsNew(\n place.addressComponents as any[],\n place.formattedAddress ?? undefined,\n );\n\n address.formattedAddress = place.formattedAddress ?? undefined;\n\n // Forzar actualización del input de Google con solo calle + número\n // Esto sobrescribe el texto completo que Google pone automáticamente\n setTimeout(() => {\n const googleInput = placeAutocomplete.shadowRoot?.querySelector('input');\n if (googleInput && address.address) {\n googleInput.value = address.address;\n }\n }, 10);\n\n onPlaceSelected(address);\n }\n };\n\n placeAutocomplete.addEventListener('gmp-select', selectHandler);\n\n const setError = (error?: string) => {\n if (error) {\n placeAutocomplete.classList.add('error');\n } else {\n placeAutocomplete.classList.remove('error');\n }\n };\n\n const setDisabled = (disabled: boolean) => {\n if (disabled) {\n placeAutocomplete.setAttribute('disabled', 'true');\n } else {\n placeAutocomplete.removeAttribute('disabled');\n }\n const googleInput = placeAutocomplete.shadowRoot?.querySelector('input');\n if (googleInput) {\n googleInput.disabled = disabled;\n }\n };\n\n const destroy = () => {\n inputElement.removeEventListener('input', inputHandler);\n placeAutocomplete.removeEventListener('gmp-select', selectHandler);\n placeAutocomplete.remove();\n containerElement.classList.remove('autocomplete-active');\n };\n\n return { element: placeAutocomplete, destroy, syncToGoogle, setError, setDisabled };\n } catch (error) {\n console.error('Failed to create Google Maps PlaceAutocompleteElement:', error);\n return null;\n }\n }\n\n private hideGoogleBranding() {\n // Inyectar CSS global para ocultar branding de Google\n const globalStyleId = 'rebill-hide-google-branding';\n if (document.getElementById(globalStyleId)) return;\n\n const style = document.createElement('style');\n style.id = globalStyleId;\n style.textContent = `\n /* Ocultar TODOS los elementos de branding de Google Maps */\n gmp-internal-attribution,\n gmp-internal-dialog,\n gmp-place-autocomplete::part(attribution),\n gmp-place-autocomplete + *,\n gmp-place-autocomplete ~ *,\n a[href*=\"maps.google.com\"],\n a[title*=\"Google Maps\"],\n [aria-label*=\"Google Maps\"],\n div:has(> a[href*=\"google.com\"]),\n .dismissButton {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n height: 0 !important;\n max-height: 0 !important;\n overflow: hidden !important;\n position: absolute !important;\n left: -9999px !important;\n }\n `;\n document.head.appendChild(style);\n\n // Remover elementos de branding continuamente (Google los puede agregar dinámicamente)\n const removeGoogleBranding = () => {\n // Remover Web Components de Google\n document.querySelectorAll('gmp-internal-attribution, gmp-internal-dialog').forEach(el => {\n el.remove();\n });\n\n // Remover links y elementos con \"Google Maps\"\n document\n .querySelectorAll('a[href*=\"maps.google.com\"], a[title*=\"Google Maps\"]')\n .forEach(el => {\n const parent = el.closest('div');\n if (parent && parent.textContent?.includes('Google Maps')) {\n parent.style.display = 'none';\n }\n el.remove();\n });\n\n // Remover cualquier SVG con aria-label=\"Google Maps\"\n document.querySelectorAll('svg[aria-label*=\"Google Maps\"]').forEach(el => {\n el.remove();\n });\n };\n\n // Ejecutar inmediatamente y periódicamente\n removeGoogleBranding();\n setInterval(removeGoogleBranding, 500);\n\n // Observer para elementos que se agregan dinámicamente\n const observer = new MutationObserver(() => {\n removeGoogleBranding();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n }\n\n private injectRebillStyles(placeAutocomplete: HTMLElement) {\n const shadow = placeAutocomplete.shadowRoot;\n if (!shadow) {\n console.warn('Shadow DOM not available - styles cannot be injected');\n return;\n }\n\n const style = document.createElement('style');\n style.textContent = `\n /* Resetear TODO */\n * {\n box-sizing: border-box !important;\n }\n\n :host {\n display: block !important;\n width: 100% !important;\n height: 38.33px !important;\n max-height: 38.33px !important;\n font-family: inherit !important;\n border: none !important;\n outline: none !important;\n box-shadow: none !important;\n background: transparent !important;\n overflow: visible !important;\n }\n\n /* Contenedores - resetear */\n div, span, ul, li {\n all: revert !important;\n }\n\n /* INPUT PRINCIPAL - Copiar estilos exactos de rebill-input-text */\n input {\n display: block !important;\n width: 100% !important;\n height: 38.33px !important;\n min-height: 38.33px !important;\n box-sizing: border-box !important;\n border-radius: 8px !important;\n border: 1.5px solid #E5E7EB !important;\n padding: 10px 14px !important;\n padding-right: 40px !important;\n font-size: 14px !important;\n line-height: 20px !important;\n font-weight: 400 !important;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;\n color: #111827 !important;\n background-color: #FFFFFF !important;\n outline: none !important;\n transition: all 0.2s ease !important;\n -webkit-appearance: none !important;\n appearance: none !important;\n }\n\n input::placeholder {\n color: #9CA3AF !important;\n opacity: 1 !important;\n }\n\n input:focus {\n border-color: var(--rebill-color-primary) !important;\n box-shadow: none !important;\n }\n\n input:disabled {\n background-color: var(--rebill-color-background) !important;\n border-color: var(--rebill-color-disabled) !important;\n color: var(--rebill-color-text-secondary) !important;\n cursor: not-allowed !important;\n opacity: 0.7 !important;\n }\n\n input:disabled:focus {\n border-color: var(--rebill-color-disabled) !important;\n box-shadow: none !important;\n }\n\n /* Estado de error - border rojo igual que inputs de Rebill */\n :host(.error) input,\n :host([error]) input {\n border-color: var(--rebill-color-error, #EF4444) !important;\n }\n\n :host(.error) input:focus,\n :host([error]) input:focus {\n border-color: var(--rebill-color-error, #EF4444) !important;\n box-shadow: 0 0 0 2px var(--rebill-color-error-light, rgba(239, 68, 68, 0.1)) !important;\n }\n\n /* Ocultar elementos decorativos de Google */\n [class*=\"icon\"],\n [class*=\"suffix\"],\n [class*=\"prefix\"],\n [class*=\"logo\"],\n [class*=\"powered\"],\n [class*=\"google\"],\n [class*=\"branding\"],\n [class*=\"divider\"],\n [class*=\"separator\"],\n [aria-label*=\"Google\"],\n [aria-label*=\"clear\"],\n [aria-label*=\"Clear\"],\n button,\n svg,\n a[href*=\"google.com\"] {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n height: 0 !important;\n width: 0 !important;\n overflow: hidden !important;\n }\n\n /* Ocultar elementos hermanos del input EXCEPTO error-message */\n input + *:not(.error-message),\n input ~ *:not(.error-message) {\n display: none !important;\n }\n\n /* Dropdown - Estilo Rebill */\n [role=\"listbox\"] {\n position: absolute !important;\n z-index: 9999 !important;\n margin-top: 4px !important;\n width: 100% !important;\n max-height: 300px !important;\n overflow-y: auto !important;\n background: #FFFFFF !important;\n border: 1px solid #E5E7EB !important;\n border-radius: 8px !important;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;\n padding: 0 !important;\n }\n\n ul {\n list-style: none !important;\n padding: 0 !important;\n margin: 0 !important;\n }\n\n /* Ocultar contenedor de atribuciones */\n .attributions,\n [role=\"presentation\"],\n div:has(> gmp-internal-attribution) {\n display: none !important;\n height: 0 !important;\n margin: 0 !important;\n padding: 0 !important;\n border: none !important;\n }\n\n /* Ocultar UL vacío cuando no hay sugerencias */\n ul:empty {\n display: none !important;\n }\n\n [role=\"option\"] {\n padding: 0.75rem !important;\n cursor: pointer !important;\n color: var(--rebill-color-text-primary) !important;\n font-size: 0.875rem !important;\n font-weight: 400 !important;\n border-bottom: 1px solid var(--rebill-color-border) !important;\n list-style: none !important;\n list-style-type: none !important;\n transition: background-color 0.15s ease !important;\n background-color: transparent !important;\n }\n\n [role=\"option\"]::before,\n [role=\"option\"]::marker {\n display: none !important;\n content: none !important;\n }\n\n [role=\"option\"]:last-child {\n border-bottom: none !important;\n }\n\n [role=\"option\"]:hover,\n [role=\"option\"][aria-selected=\"true\"] {\n background-color: #f0f9ff !important;\n }\n\n /* Texto dentro - mismo color que la opción */\n [role=\"option\"] * {\n color: var(--rebill-color-text-primary) !important;\n font-family: inherit !important;\n font-weight: inherit !important;\n }\n\n /* Ocultar botón de cerrar (X) */\n button[aria-label*=\"dismiss\"],\n button[aria-label*=\"close\"],\n .dismiss,\n .close-button {\n display: none !important;\n }\n\n /* Texto dentro de las sugerencias */\n [role=\"option\"] * {\n color: inherit !important;\n font-family: inherit !important;\n }\n `;\n shadow.appendChild(style);\n }\n\n private parseAddressComponentsNew(\n components: any[],\n formattedAddress?: string,\n ): AddressComponents {\n const getComponent = (type: string, useShortName = false) => {\n const component = components.find((c: any) => c.types.includes(type));\n return component ? (useShortName ? component.shortText : component.longText) : '';\n };\n\n const streetNumber = getComponent('street_number');\n const route = getComponent('route');\n const city = getComponent('locality');\n const state = getComponent('administrative_area_level_1');\n const country = getComponent('country', true);\n const zip = getComponent('postal_code');\n\n let addressLine = '';\n\n // Prioridad 1: Usar street_number + route si ambos existen\n if (streetNumber && route) {\n addressLine = `${route} ${streetNumber}`.trim();\n } else if (route) {\n // Si solo hay route, usarlo\n addressLine = route;\n } else if (streetNumber) {\n // Si solo hay número, usarlo\n addressLine = streetNumber;\n }\n\n // Si ya tenemos una dirección de los componentes, usarla\n if (addressLine.length > 0) {\n return {\n address: addressLine,\n city,\n state,\n country,\n zip,\n };\n }\n\n // Prioridad 2: Extraer de formattedAddress\n if (formattedAddress) {\n // Separar por coma y tomar solo la primera parte (calle + número)\n const parts = formattedAddress.split(',').map(p => p.trim());\n const firstPart = parts[0] ?? '';\n\n // Verificar si la primera parte no contiene el nombre de la ciudad\n // Esto previene que se incluya ciudad en la dirección\n const containsCity = city && firstPart.toLowerCase().includes(city.toLowerCase());\n const containsState = state && firstPart.toLowerCase().includes(state.toLowerCase());\n\n if (firstPart.length > 0 && !containsCity && !containsState && /[0-9A-Za-z]/.test(firstPart)) {\n addressLine = firstPart;\n }\n }\n\n return {\n address: addressLine,\n city,\n state,\n country,\n zip,\n };\n }\n\n static loadGoogleMapsScript(googleMapsApiKey?: string) {\n // Use new API key\n const apiKey = googleMapsApiKey || 'AIzaSyB9pS5LHbPKjnmMQ89BQHD0SVZXVsi95pk';\n\n if (!apiKey) {\n console.warn('Google Maps API key not provided. Address autocomplete will not be available.');\n return;\n }\n\n // Check if script is already loaded\n if (document.querySelector('script[src*=\"maps.googleapis.com\"]')) {\n return;\n }\n\n const script = document.createElement('script');\n // Nueva API: loading=async, Places se carga vía importLibrary en createAutocomplete\n script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&loading=async&callback=initGoogleMaps`;\n script.async = true;\n script.defer = true;\n\n // Add global callback for when Google Maps is ready\n (window as any).initGoogleMaps = () => {\n delete (window as any).initGoogleMaps; // Clean up\n };\n\n script.onerror = () => {\n console.error(\n 'Failed to load Google Maps script. Please check your API key and network connection.',\n );\n };\n\n document.head.appendChild(script);\n }\n}\n"],"names":[],"mappings":";;MAUa,iBAAiB,CAAA;IACpB,OAAO,QAAQ;IACf,QAAQ,GAAY,KAAK;IACzB,WAAW,GAA4B,IAAI;AAEnD,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CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAA,EACnC,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAC,eAAe,EACrB,KAAK,EAAE;AACL,gBAAA,KAAK,EAAE,2BAA2B;AAClC,gBAAA,QAAQ,EAAE,SAAS;AACnB,gBAAA,OAAO,EAAE,OAAO;AAChB,gBAAA,UAAU,EAAE,MAAM;aACnB,EAAA,EAEA,IAAI,CAAC,KAAK,CACN,CACH,CACP,EACA,IAAI,CAAC,mBAAmB,KACvB,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,2BAA2B,EAAA,EACpC,CAAA,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAQ,KAAK,EAAC,mBAAmB,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAA,EAC7E,CAAA,CAAA,mBAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE,WAAW,CAAC,SAAS,EAC5B,KAAK,EAAC,aAAa,EAElB,EAAA,WAAW,CAAC,SAAS,CAAC,GAAG,cAAc,CAAA,YAAA,CAAc,EAAE,wBAAwB,CAAC,CAC/D,CACb,CACL,CACP,CACG,CACmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","sessionState"],"sources":["src/utils/google-maps.service.ts","src/components/checkout/address/address-search/address-search.css?tag=rebill-address-search","src/components/checkout/address/address-search/address-search.tsx"],"sourcesContent":["export interface AddressComponents {\n address: string;\n city: string;\n state: string;\n country: string;\n zip: string;\n addInformation?: string;\n formattedAddress?: string; // Dirección completa de Google para usar como fallback\n}\n\nexport class GoogleMapsService {\n private static instance: GoogleMapsService;\n private isLoaded: boolean = false;\n private loadPromise: Promise<boolean> | null = null;\n\n static getInstance(): GoogleMapsService {\n if (!GoogleMapsService.instance) {\n GoogleMapsService.instance = new GoogleMapsService();\n GoogleMapsService.setupShadowDOMPatch();\n }\n return GoogleMapsService.instance;\n }\n\n private static setupShadowDOMPatch() {\n if ((window as any).gmpShadowPatched) return;\n\n const originalAttachShadow = Element.prototype.attachShadow;\n\n Element.prototype.attachShadow = function (init: ShadowRootInit) {\n if (this.localName === 'gmp-place-autocomplete') {\n return originalAttachShadow.call(this, { ...init, mode: 'open' });\n }\n return originalAttachShadow.call(this, init);\n };\n\n (window as any).gmpShadowPatched = true;\n }\n\n async waitForAPI(): Promise<boolean> {\n if (this.isLoaded && window.google) {\n return true;\n }\n\n if (this.loadPromise) {\n return this.loadPromise;\n }\n\n this.loadPromise = new Promise(resolve => {\n let attempts = 0;\n const maxAttempts = 100; // 10 seconds max wait\n\n const checkAPI = () => {\n attempts++;\n\n if (window.google) {\n this.isLoaded = true;\n resolve(true);\n } else if (attempts >= maxAttempts) {\n console.error('Google Maps API failed to load within timeout');\n resolve(false);\n } else {\n setTimeout(checkAPI, 100);\n }\n };\n checkAPI();\n });\n\n return this.loadPromise;\n }\n\n /**\n * Crea autocomplete usando la nueva API de Google Places (PlaceAutocompleteElement).\n * containerElement: donde se inserta (ej. search-input-container). Debe tener position: relative.\n * inputElement: input para sincronizar valor al seleccionar y para focus/blur.\n * Retorna el elemento y una función destroy para limpiar al desmontar.\n */\n async createAutocomplete(\n containerElement: HTMLElement,\n inputElement: HTMLInputElement,\n onPlaceSelected: (address: AddressComponents) => void,\n options?: {\n placeholder?: string;\n componentRestrictions?: { country: string | string[] };\n error?: string;\n disabled?: boolean;\n },\n ): Promise<{\n element: HTMLElement;\n destroy: () => void;\n syncToGoogle: (value?: string) => void;\n setError: (error?: string) => void;\n setDisabled: (disabled: boolean) => void;\n } | null> {\n const isReady = await this.waitForAPI();\n if (!isReady) {\n console.error('Google Maps API not available');\n return null;\n }\n\n try {\n // Nueva API: importLibrary carga Places (New)\n await google.maps.importLibrary('places');\n\n const elementOptions: google.maps.places.PlaceAutocompleteElementOptions = {\n types: ['address'],\n };\n\n if (options?.componentRestrictions?.country) {\n const countries = Array.isArray(options.componentRestrictions.country)\n ? options.componentRestrictions.country\n : [options.componentRestrictions.country];\n elementOptions.componentRestrictions = { country: countries };\n }\n\n const placeAutocomplete = new google.maps.places.PlaceAutocompleteElement(elementOptions);\n\n if (options?.placeholder) {\n placeAutocomplete.setAttribute('placeholder', options.placeholder);\n }\n\n // Agregar clase error si existe\n if (options?.error) {\n placeAutocomplete.classList.add('error');\n }\n\n // Deshabilitar si corresponde\n if (options?.disabled) {\n placeAutocomplete.setAttribute('disabled', 'true');\n const googleInput = placeAutocomplete.shadowRoot?.querySelector('input');\n if (googleInput) googleInput.disabled = true;\n }\n\n // Insertar en el container; el CSS del padre lo posiciona como overlay\n containerElement.appendChild(placeAutocomplete);\n await new Promise(resolve => setTimeout(resolve, 300));\n\n // Inyectar estilos Rebill en el shadow DOM (modo open vía setupShadowDOMPatch)\n this.injectRebillStyles(placeAutocomplete);\n\n // Ocultar elementos de branding de Google que se renderizan fuera del Shadow DOM\n this.hideGoogleBranding();\n\n // Sincronizar valor del input → Google (SOLO una dirección)\n let isSyncing = false;\n const syncToGoogle = (value?: string) => {\n if (isSyncing) return;\n isSyncing = true;\n\n const val = value ?? inputElement.value;\n const googleInput = placeAutocomplete.shadowRoot?.querySelector('input');\n if (googleInput) {\n googleInput.value = val;\n // Disparar eventos para que Google detecte el cambio\n googleInput.dispatchEvent(new Event('input', { bubbles: true }));\n googleInput.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n setTimeout(() => {\n isSyncing = false;\n }, 50);\n };\n\n const inputHandler = () => {\n if (!isSyncing) {\n syncToGoogle();\n }\n };\n inputElement.addEventListener('input', inputHandler);\n\n // Sincronizar valor inicial\n setTimeout(() => syncToGoogle(), 100);\n\n // Evento correcto: gmp-select (no gmp-placeselect)\n const selectHandler = async (ev: Event) => {\n const evt = ev as CustomEvent & {\n placePrediction?: { toPlace: () => Promise<google.maps.places.Place> };\n };\n const placePrediction = evt.placePrediction ?? (evt.detail as any)?.placePrediction;\n if (!placePrediction) return;\n const place = await placePrediction.toPlace();\n await place.fetchFields({\n fields: ['addressComponents', 'formattedAddress'],\n });\n\n if (place.addressComponents) {\n const address = this.parseAddressComponentsNew(\n place.addressComponents as any[],\n place.formattedAddress ?? undefined,\n );\n\n address.formattedAddress = place.formattedAddress ?? undefined;\n\n // Forzar actualización del input de Google con solo calle + número\n // Esto sobrescribe el texto completo que Google pone automáticamente\n setTimeout(() => {\n const googleInput = placeAutocomplete.shadowRoot?.querySelector('input');\n if (googleInput && address.address) {\n googleInput.value = address.address;\n }\n }, 10);\n\n onPlaceSelected(address);\n }\n };\n\n placeAutocomplete.addEventListener('gmp-select', selectHandler);\n\n const setError = (error?: string) => {\n if (error) {\n placeAutocomplete.classList.add('error');\n } else {\n placeAutocomplete.classList.remove('error');\n }\n };\n\n const setDisabled = (disabled: boolean) => {\n if (disabled) {\n placeAutocomplete.setAttribute('disabled', 'true');\n } else {\n placeAutocomplete.removeAttribute('disabled');\n }\n const googleInput = placeAutocomplete.shadowRoot?.querySelector('input');\n if (googleInput) {\n googleInput.disabled = disabled;\n }\n };\n\n const destroy = () => {\n inputElement.removeEventListener('input', inputHandler);\n placeAutocomplete.removeEventListener('gmp-select', selectHandler);\n placeAutocomplete.remove();\n containerElement.classList.remove('autocomplete-active');\n };\n\n return { element: placeAutocomplete, destroy, syncToGoogle, setError, setDisabled };\n } catch (error) {\n console.error('Failed to create Google Maps PlaceAutocompleteElement:', error);\n return null;\n }\n }\n\n private hideGoogleBranding() {\n // Inyectar CSS global para ocultar branding de Google\n const globalStyleId = 'rebill-hide-google-branding';\n if (document.getElementById(globalStyleId)) return;\n\n const style = document.createElement('style');\n style.id = globalStyleId;\n style.textContent = `\n /* Ocultar TODOS los elementos de branding de Google Maps */\n gmp-internal-attribution,\n gmp-internal-dialog,\n gmp-place-autocomplete::part(attribution),\n gmp-place-autocomplete + *,\n gmp-place-autocomplete ~ *,\n a[href*=\"maps.google.com\"],\n a[title*=\"Google Maps\"],\n [aria-label*=\"Google Maps\"],\n div:has(> a[href*=\"google.com\"]),\n .dismissButton {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n height: 0 !important;\n max-height: 0 !important;\n overflow: hidden !important;\n position: absolute !important;\n left: -9999px !important;\n }\n `;\n document.head.appendChild(style);\n\n // Remover elementos de branding continuamente (Google los puede agregar dinámicamente)\n const removeGoogleBranding = () => {\n // Remover Web Components de Google\n document.querySelectorAll('gmp-internal-attribution, gmp-internal-dialog').forEach(el => {\n el.remove();\n });\n\n // Remover links y elementos con \"Google Maps\"\n document\n .querySelectorAll('a[href*=\"maps.google.com\"], a[title*=\"Google Maps\"]')\n .forEach(el => {\n const parent = el.closest('div');\n if (parent && parent.textContent?.includes('Google Maps')) {\n parent.style.display = 'none';\n }\n el.remove();\n });\n\n // Remover cualquier SVG con aria-label=\"Google Maps\"\n document.querySelectorAll('svg[aria-label*=\"Google Maps\"]').forEach(el => {\n el.remove();\n });\n };\n\n // Ejecutar inmediatamente y periódicamente\n removeGoogleBranding();\n setInterval(removeGoogleBranding, 500);\n\n // Observer para elementos que se agregan dinámicamente\n const observer = new MutationObserver(() => {\n removeGoogleBranding();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n }\n\n private injectRebillStyles(placeAutocomplete: HTMLElement) {\n const shadow = placeAutocomplete.shadowRoot;\n if (!shadow) {\n console.warn('Shadow DOM not available - styles cannot be injected');\n return;\n }\n\n const style = document.createElement('style');\n style.textContent = `\n /* Resetear TODO */\n * {\n box-sizing: border-box !important;\n }\n\n :host {\n display: block !important;\n width: 100% !important;\n height: 38.33px !important;\n max-height: 38.33px !important;\n font-family: inherit !important;\n border: none !important;\n outline: none !important;\n box-shadow: none !important;\n background: transparent !important;\n overflow: visible !important;\n }\n\n /* Contenedores - resetear */\n div, span, ul, li {\n all: revert !important;\n }\n\n /* INPUT PRINCIPAL - Copiar estilos exactos de rebill-input-text */\n input {\n display: block !important;\n width: 100% !important;\n height: 38.33px !important;\n min-height: 38.33px !important;\n box-sizing: border-box !important;\n border-radius: 8px !important;\n border: 1.5px solid #E5E7EB !important;\n padding: 10px 14px !important;\n padding-right: 40px !important;\n font-size: 14px !important;\n line-height: 20px !important;\n font-weight: 400 !important;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;\n color: #111827 !important;\n background-color: #FFFFFF !important;\n outline: none !important;\n transition: all 0.2s ease !important;\n -webkit-appearance: none !important;\n appearance: none !important;\n }\n\n input::placeholder {\n color: #9CA3AF !important;\n opacity: 1 !important;\n }\n\n input:focus {\n border-color: var(--rebill-color-primary) !important;\n box-shadow: none !important;\n }\n\n input:disabled {\n background-color: var(--rebill-color-background) !important;\n border-color: var(--rebill-color-disabled) !important;\n color: var(--rebill-color-text-secondary) !important;\n cursor: not-allowed !important;\n opacity: 0.7 !important;\n }\n\n input:disabled:focus {\n border-color: var(--rebill-color-disabled) !important;\n box-shadow: none !important;\n }\n\n /* Estado de error - border rojo igual que inputs de Rebill */\n :host(.error) input,\n :host([error]) input {\n border-color: var(--rebill-color-error, #EF4444) !important;\n }\n\n :host(.error) input:focus,\n :host([error]) input:focus {\n border-color: var(--rebill-color-error, #EF4444) !important;\n box-shadow: 0 0 0 2px var(--rebill-color-error-light, rgba(239, 68, 68, 0.1)) !important;\n }\n\n /* Ocultar elementos decorativos de Google */\n [class*=\"icon\"],\n [class*=\"suffix\"],\n [class*=\"prefix\"],\n [class*=\"logo\"],\n [class*=\"powered\"],\n [class*=\"google\"],\n [class*=\"branding\"],\n [class*=\"divider\"],\n [class*=\"separator\"],\n [aria-label*=\"Google\"],\n [aria-label*=\"clear\"],\n [aria-label*=\"Clear\"],\n button,\n svg,\n a[href*=\"google.com\"] {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n height: 0 !important;\n width: 0 !important;\n overflow: hidden !important;\n }\n\n /* Ocultar elementos hermanos del input EXCEPTO error-message */\n input + *:not(.error-message),\n input ~ *:not(.error-message) {\n display: none !important;\n }\n\n /* Dropdown - Estilo Rebill */\n [role=\"listbox\"] {\n position: absolute !important;\n z-index: 9999 !important;\n margin-top: 4px !important;\n width: 100% !important;\n max-height: 300px !important;\n overflow-y: auto !important;\n background: #FFFFFF !important;\n border: 1px solid #E5E7EB !important;\n border-radius: 8px !important;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;\n padding: 0 !important;\n }\n\n ul {\n list-style: none !important;\n padding: 0 !important;\n margin: 0 !important;\n }\n\n /* Ocultar contenedor de atribuciones */\n .attributions,\n [role=\"presentation\"],\n div:has(> gmp-internal-attribution) {\n display: none !important;\n height: 0 !important;\n margin: 0 !important;\n padding: 0 !important;\n border: none !important;\n }\n\n /* Ocultar UL vacío cuando no hay sugerencias */\n ul:empty {\n display: none !important;\n }\n\n [role=\"option\"] {\n padding: 0.75rem !important;\n cursor: pointer !important;\n color: var(--rebill-color-text-primary) !important;\n font-size: 0.875rem !important;\n font-weight: 400 !important;\n border-bottom: 1px solid var(--rebill-color-border) !important;\n list-style: none !important;\n list-style-type: none !important;\n transition: background-color 0.15s ease !important;\n background-color: transparent !important;\n }\n\n [role=\"option\"]::before,\n [role=\"option\"]::marker {\n display: none !important;\n content: none !important;\n }\n\n [role=\"option\"]:last-child {\n border-bottom: none !important;\n }\n\n [role=\"option\"]:hover,\n [role=\"option\"][aria-selected=\"true\"] {\n background-color: #f0f9ff !important;\n }\n\n /* Texto dentro - mismo color que la opción */\n [role=\"option\"] * {\n color: var(--rebill-color-text-primary) !important;\n font-family: inherit !important;\n font-weight: inherit !important;\n }\n\n /* Ocultar botón de cerrar (X) */\n button[aria-label*=\"dismiss\"],\n button[aria-label*=\"close\"],\n .dismiss,\n .close-button {\n display: none !important;\n }\n\n /* Texto dentro de las sugerencias */\n [role=\"option\"] * {\n color: inherit !important;\n font-family: inherit !important;\n }\n `;\n shadow.appendChild(style);\n }\n\n private parseAddressComponentsNew(\n components: any[],\n formattedAddress?: string,\n ): AddressComponents {\n const getComponent = (type: string, useShortName = false) => {\n const component = components.find((c: any) => c.types.includes(type));\n return component ? (useShortName ? component.shortText : component.longText) : '';\n };\n\n const streetNumber = getComponent('street_number');\n const route = getComponent('route');\n const city = getComponent('locality');\n const state = getComponent('administrative_area_level_1');\n const country = getComponent('country', true);\n const zip = getComponent('postal_code');\n\n let addressLine = '';\n\n // Prioridad 1: Usar street_number + route si ambos existen\n if (streetNumber && route) {\n addressLine = `${route} ${streetNumber}`.trim();\n } else if (route) {\n // Si solo hay route, usarlo\n addressLine = route;\n } else if (streetNumber) {\n // Si solo hay número, usarlo\n addressLine = streetNumber;\n }\n\n // Si ya tenemos una dirección de los componentes, usarla\n if (addressLine.length > 0) {\n return {\n address: addressLine,\n city,\n state,\n country,\n zip,\n };\n }\n\n // Prioridad 2: Extraer de formattedAddress\n if (formattedAddress) {\n // Separar por coma y tomar solo la primera parte (calle + número)\n const parts = formattedAddress.split(',').map(p => p.trim());\n const firstPart = parts[0] ?? '';\n\n // Verificar si la primera parte no contiene el nombre de la ciudad\n // Esto previene que se incluya ciudad en la dirección\n const containsCity = city && firstPart.toLowerCase().includes(city.toLowerCase());\n const containsState = state && firstPart.toLowerCase().includes(state.toLowerCase());\n\n if (firstPart.length > 0 && !containsCity && !containsState && /[0-9A-Za-z]/.test(firstPart)) {\n addressLine = firstPart;\n }\n }\n\n return {\n address: addressLine,\n city,\n state,\n country,\n zip,\n };\n }\n\n static loadGoogleMapsScript(googleMapsApiKey?: string) {\n // Use new API key\n const apiKey = googleMapsApiKey || 'AIzaSyB9pS5LHbPKjnmMQ89BQHD0SVZXVsi95pk';\n\n if (!apiKey) {\n console.warn('Google Maps API key not provided. Address autocomplete will not be available.');\n return;\n }\n\n // Check if script is already loaded\n if (document.querySelector('script[src*=\"maps.googleapis.com\"]')) {\n return;\n }\n\n const script = document.createElement('script');\n // Nueva API: loading=async, Places se carga vía importLibrary en createAutocomplete\n script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&loading=async&callback=initGoogleMaps`;\n script.async = true;\n script.defer = true;\n\n // Add global callback for when Google Maps is ready\n (window as any).initGoogleMaps = () => {\n delete (window as any).initGoogleMaps; // Clean up\n };\n\n script.onerror = () => {\n console.error(\n 'Failed to load Google Maps script. Please check your API key and network connection.',\n );\n };\n\n document.head.appendChild(script);\n }\n}\n",":host {\n display: block;\n}\n\n.address-search-container {\n width: 100%;\n margin-bottom: 24px;\n}\n\n.search-input-container {\n position: relative;\n margin-bottom: 8px;\n overflow: visible;\n height: 38.33px;\n min-height: 38.33px;\n}\n\n/* PlaceAutocompleteElement de Google se superpone; el dropdown debe ser visible */\n.search-input-container gmp-place-autocomplete {\n position: absolute !important;\n top: 0;\n left: 0;\n width: 100% !important;\n height: 38.33px !important;\n min-height: 38.33px !important;\n max-height: 38.33px !important;\n opacity: 1 !important;\n pointer-events: auto !important;\n z-index: 10;\n /* Estilos del host para consistencia visual */\n color-scheme: light;\n}\n\n/* Ocultar input nativo cuando Google overlay está activo (evita doble input) */\n.search-input-container.autocomplete-active rebill-input-text {\n visibility: hidden;\n}\n\n.manual-entry-link-wrapper {\n display: flex;\n justify-content: flex-start;\n}\n\n.manual-entry-link {\n background: none;\n border: none;\n color: var(--rebill-color-primary);\n cursor: pointer;\n font-size: 14px;\n padding: 4px 0;\n text-decoration: underline;\n text-decoration-color: var(--rebill-color-text-secondary);\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, State, Watch } from '@stencil/core';\nimport { I18nService } from '../../../../i18n/i18n.service';\nimport { sessionState, SessionStore } from '../../../../store/session.store';\nimport { COLORS_ENUM } from '../../../../utils/color-class-mapper';\nimport { AddressComponents, GoogleMapsService } from '../../../../utils/google-maps.service';\n\n@Component({\n tag: 'rebill-address-search',\n styleUrl: 'address-search.css',\n shadow: false,\n})\nexport class AddressSearch {\n @Element() el: HTMLElement;\n @State() isInitialized = false;\n @State() currentLocale: string = sessionState.currentLocale;\n /** Valor mientras el usuario edita (null = mostrar value prop) */\n @State() editingValue: string | null = null;\n /** True justo después de seleccionar un lugar para no emitir freeText en el siguiente blur */\n @State() justSelectedPlace: boolean = false;\n /** Para distinguir Enter con y sin selección de Google */\n private lastPlaceChangedAt: number = 0;\n private lastEnterAt: number = 0;\n\n @Prop() addressType: 'billing' | 'shipping' = 'billing';\n @Prop() placeholder?: string;\n @Prop() error?: string;\n @Prop() disabled: boolean = false;\n /** Valor mostrado en el input (ej. calle + número tras seleccionar o texto libre) */\n @Prop() value: string = '';\n /** Si false, no se muestra el enlace \"Ingresar dirección manualmente\" (vista unificada) */\n @Prop() showManualEntryLink: boolean = true;\n private autocompleteSetError?: (error?: string) => void;\n\n @Event() addressSelected: EventEmitter<AddressComponents>;\n @Event() manualEntryRequested: EventEmitter<void>;\n /** Se emite al salir del input con el texto actual cuando el usuario no eligió una sugerencia */\n @Event() freeTextAddress: EventEmitter<string>;\n /** Se emite al pulsar Enter sin seleccionar (para mostrar el resto de campos) */\n @Event() commitRequested: EventEmitter<void>;\n private googleMapsService = GoogleMapsService.getInstance();\n private autocompleteDestroy: (() => void) | null = null;\n private autocompleteSync: ((value?: string) => void) | null = null;\n private autocompleteSetDisabled?: (disabled: boolean) => void;\n private unsubscribeCurrentLocaleStore?: () => void;\n private inputEl: HTMLInputElement | null = null;\n private onKeyDown?: (e: KeyboardEvent) => void;\n private pendingEnterTimer: ReturnType<typeof setTimeout> | null = null;\n\n async componentDidLoad() {\n await this.initializeAutocomplete();\n\n // Listen for language changes\n this.unsubscribeCurrentLocaleStore = SessionStore.onChange('currentLocale', () => {\n this.currentLocale = sessionState.currentLocale;\n });\n }\n\n disconnectedCallback() {\n this.cleanup();\n\n if (this.unsubscribeCurrentLocaleStore) {\n this.unsubscribeCurrentLocaleStore();\n }\n }\n\n private async initializeAutocomplete() {\n if (this.isInitialized) return;\n\n try {\n const inputElement = await this.getInputElement();\n if (!inputElement) return;\n this.inputEl = inputElement;\n\n const container = this.el?.querySelector('.search-input-container') as HTMLElement;\n if (!container) return;\n\n const translationKey = this.addressType === 'shipping' ? 'shippingAddress' : 'billingAddress';\n const placeholder =\n this.placeholder ||\n I18nService.translate(`${translationKey}.searchPlaceholder`, 'Search for an address...');\n\n const result = await this.googleMapsService.createAutocomplete(\n container,\n inputElement,\n (address: AddressComponents) => this.handleAddressSelected(address),\n { placeholder, error: this.error, disabled: this.disabled },\n );\n if (result) {\n this.autocompleteDestroy = result.destroy;\n this.autocompleteSync = result.syncToGoogle;\n this.autocompleteSetError = result.setError;\n this.autocompleteSetDisabled = result.setDisabled;\n container.classList.add('autocomplete-active');\n }\n // Enter:\n // - Si selecciona sugerencia con Enter, Google dispara place_changed.\n // - Si NO hay selección, place_changed no sucede: tratamos Enter como texto libre y abrimos campos.\n this.onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== 'Enter') return;\n if (this.disabled) return;\n\n this.lastEnterAt = Date.now();\n // Valor puede venir del input nativo o del PlaceAutocompleteElement\n const googleInput = container\n .querySelector('gmp-place-autocomplete')\n ?.shadowRoot?.querySelector('input');\n const value = (googleInput?.value ?? this.inputEl?.value ?? '').trim();\n\n if (this.pendingEnterTimer) clearTimeout(this.pendingEnterTimer);\n this.pendingEnterTimer = setTimeout(() => {\n this.pendingEnterTimer = null;\n if (this.lastPlaceChangedAt >= this.lastEnterAt) return;\n\n if (value) this.freeTextAddress.emit(value);\n this.commitRequested.emit();\n this.justSelectedPlace = false;\n this.editingValue = value;\n }, 250);\n };\n container.addEventListener('keydown', this.onKeyDown);\n if (this.autocompleteDestroy) {\n this.isInitialized = true;\n }\n } catch (error) {\n console.error(`Failed to initialize ${this.addressType} autocomplete:`, error);\n }\n }\n\n private async getInputElement(): Promise<HTMLInputElement | null> {\n const inputComponent = this.el?.querySelector('rebill-input-text') as any;\n if (!inputComponent) {\n console.error(`Input component not found for ${this.addressType}-search`);\n return null;\n }\n\n try {\n return await inputComponent.getInputElement();\n } catch (error) {\n console.error(`Failed to get input element:`, error);\n return null;\n }\n }\n\n @Watch('value')\n valueWatcher() {\n if (this.justSelectedPlace) return;\n this.editingValue = null;\n this.autocompleteSync?.(this.displayValue);\n }\n\n @Watch('error')\n errorWatcher() {\n this.autocompleteSetError?.(this.error);\n }\n\n @Watch('disabled')\n disabledWatcher() {\n this.autocompleteSetDisabled?.(this.disabled);\n }\n\n private async handleAddressSelected(address: AddressComponents) {\n this.lastPlaceChangedAt = Date.now();\n if (this.pendingEnterTimer) {\n clearTimeout(this.pendingEnterTimer);\n this.pendingEnterTimer = null;\n }\n this.justSelectedPlace = true;\n // Evitar re-consultar el DOM: preferir la referencia ya inicializada\n const inputEl = this.inputEl ?? (await this.getInputElement());\n const addressLine = (address.address ?? '').trim();\n // En el search solo debe quedar \"número + calle\" (sin ciudad)\n this.editingValue = addressLine;\n this.addressSelected.emit(address);\n if (inputEl) {\n inputEl.value = addressLine;\n // Forzar actualización después de un pequeño delay para sobrescribir el valor de Google\n setTimeout(() => {\n if (inputEl) inputEl.value = addressLine;\n }, 50);\n }\n }\n\n private handleAddressInput = (ev: CustomEvent<{ id: string; value: string }>) => {\n this.editingValue = ev.detail?.value ?? '';\n };\n\n private handleAddressInputBlur = (ev: CustomEvent<{ id: string; value: string }>) => {\n const value = (ev.detail?.value ?? '').trim();\n if (!this.justSelectedPlace) {\n this.freeTextAddress.emit(value);\n }\n this.justSelectedPlace = false;\n this.editingValue = null;\n };\n\n private handleManualEntry = () => {\n this.manualEntryRequested.emit();\n };\n\n private get displayValue(): string {\n return this.editingValue !== null ? this.editingValue : this.value;\n }\n private cleanup() {\n if (this.pendingEnterTimer) {\n clearTimeout(this.pendingEnterTimer);\n this.pendingEnterTimer = null;\n }\n const container = this.el?.querySelector('.search-input-container');\n if (container && this.onKeyDown) {\n container.removeEventListener('keydown', this.onKeyDown);\n }\n this.onKeyDown = undefined;\n this.inputEl = null;\n this.autocompleteDestroy?.();\n this.autocompleteDestroy = null;\n this.autocompleteSync = null;\n this.isInitialized = false;\n }\n\n render() {\n const translationKey = this.addressType === 'shipping' ? 'shippingAddress' : 'billingAddress';\n const defaultPlaceholder = I18nService.translate(\n `${translationKey}.searchPlaceholder`,\n 'Search for an address...',\n );\n\n return (\n <rebill-autofill-detector\n target-selector=\"rebill-input-text input\"\n disabled={this.disabled}\n onAutofillDetected={event => this.handleAddressSelected(event.detail)}\n onManualEntryRequested={() => this.handleManualEntry()}\n >\n <div class=\"address-search-container\">\n <div class=\"search-input-container\">\n <rebill-input-text\n id={`${this.addressType}-search`}\n value={this.displayValue}\n placeholder={this.placeholder || defaultPlaceholder}\n rightIcon=\"search\"\n error={this.error}\n disabled={this.disabled}\n onInput={e => this.handleAddressInput(e as CustomEvent)}\n onBlur={e => this.handleAddressInputBlur(e as CustomEvent)}\n />\n </div>\n {this.error && (\n <div style={{ marginTop: '0.375rem' }}>\n <span\n class=\"error-message\"\n style={{\n color: 'var(--rebill-color-error)',\n fontSize: '0.75rem',\n display: 'block',\n lineHeight: '1rem',\n }}\n >\n {this.error}\n </span>\n </div>\n )}\n {this.showManualEntryLink && (\n <div class=\"manual-entry-link-wrapper\">\n <button class=\"manual-entry-link\" type=\"button\" onClick={this.handleManualEntry}>\n <rebill-typography\n variant=\"subtitle2\"\n color={COLORS_ENUM.SECONDARY}\n class=\"footer-link\"\n >\n {I18nService.translate(`${translationKey}.manualEntry`, 'Enter address manually')}\n </rebill-typography>\n </button>\n </div>\n )}\n </div>\n </rebill-autofill-detector>\n );\n }\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-maps.service-DM1Z3gTC.js","sources":["src/utils/google-maps.service.ts"],"sourcesContent":["export interface AddressComponents {\n address: string;\n city: string;\n state: string;\n country: string;\n zip: string;\n addInformation?: string;\n formattedAddress?: string; // Dirección completa de Google para usar como fallback\n}\n\nexport class GoogleMapsService {\n private static instance: GoogleMapsService;\n private isLoaded: boolean = false;\n private loadPromise: Promise<boolean> | null = null;\n\n static getInstance(): GoogleMapsService {\n if (!GoogleMapsService.instance) {\n GoogleMapsService.instance = new GoogleMapsService();\n GoogleMapsService.setupShadowDOMPatch();\n }\n return GoogleMapsService.instance;\n }\n\n private static setupShadowDOMPatch() {\n if ((window as any).gmpShadowPatched) return;\n\n const originalAttachShadow = Element.prototype.attachShadow;\n\n Element.prototype.attachShadow = function (init: ShadowRootInit) {\n if (this.localName === 'gmp-place-autocomplete') {\n return originalAttachShadow.call(this, { ...init, mode: 'open' });\n }\n return originalAttachShadow.call(this, init);\n };\n\n (window as any).gmpShadowPatched = true;\n }\n\n async waitForAPI(): Promise<boolean> {\n if (this.isLoaded && window.google) {\n return true;\n }\n\n if (this.loadPromise) {\n return this.loadPromise;\n }\n\n this.loadPromise = new Promise(resolve => {\n let attempts = 0;\n const maxAttempts = 100; // 10 seconds max wait\n\n const checkAPI = () => {\n attempts++;\n\n if (window.google) {\n this.isLoaded = true;\n resolve(true);\n } else if (attempts >= maxAttempts) {\n console.error('Google Maps API failed to load within timeout');\n resolve(false);\n } else {\n setTimeout(checkAPI, 100);\n }\n };\n checkAPI();\n });\n\n return this.loadPromise;\n }\n\n /**\n * Crea autocomplete usando la nueva API de Google Places (PlaceAutocompleteElement).\n * containerElement: donde se inserta (ej. search-input-container). Debe tener position: relative.\n * inputElement: input para sincronizar valor al seleccionar y para focus/blur.\n * Retorna el elemento y una función destroy para limpiar al desmontar.\n */\n async createAutocomplete(\n containerElement: HTMLElement,\n inputElement: HTMLInputElement,\n onPlaceSelected: (address: AddressComponents) => void,\n options?: {\n placeholder?: string;\n componentRestrictions?: { country: string | string[] };\n error?: string;\n disabled?: boolean;\n },\n ): Promise<{\n element: HTMLElement;\n destroy: () => void;\n syncToGoogle: (value?: string) => void;\n setError: (error?: string) => void;\n setDisabled: (disabled: boolean) => void;\n } | null> {\n const isReady = await this.waitForAPI();\n if (!isReady) {\n console.error('Google Maps API not available');\n return null;\n }\n\n try {\n // Nueva API: importLibrary carga Places (New)\n await google.maps.importLibrary('places');\n\n const elementOptions: google.maps.places.PlaceAutocompleteElementOptions = {\n types: ['address'],\n };\n\n if (options?.componentRestrictions?.country) {\n const countries = Array.isArray(options.componentRestrictions.country)\n ? options.componentRestrictions.country\n : [options.componentRestrictions.country];\n elementOptions.componentRestrictions = { country: countries };\n }\n\n const placeAutocomplete = new google.maps.places.PlaceAutocompleteElement(elementOptions);\n\n if (options?.placeholder) {\n placeAutocomplete.setAttribute('placeholder', options.placeholder);\n }\n\n // Agregar clase error si existe\n if (options?.error) {\n placeAutocomplete.classList.add('error');\n }\n\n // Deshabilitar si corresponde\n if (options?.disabled) {\n placeAutocomplete.setAttribute('disabled', 'true');\n const googleInput = placeAutocomplete.shadowRoot?.querySelector('input');\n if (googleInput) googleInput.disabled = true;\n }\n\n // Insertar en el container; el CSS del padre lo posiciona como overlay\n containerElement.appendChild(placeAutocomplete);\n await new Promise(resolve => setTimeout(resolve, 300));\n\n // Inyectar estilos Rebill en el shadow DOM (modo open vía setupShadowDOMPatch)\n this.injectRebillStyles(placeAutocomplete);\n\n // Ocultar elementos de branding de Google que se renderizan fuera del Shadow DOM\n this.hideGoogleBranding();\n\n // Sincronizar valor del input → Google (SOLO una dirección)\n let isSyncing = false;\n const syncToGoogle = (value?: string) => {\n if (isSyncing) return;\n isSyncing = true;\n\n const val = value ?? inputElement.value;\n const googleInput = placeAutocomplete.shadowRoot?.querySelector('input');\n if (googleInput) {\n googleInput.value = val;\n // Disparar eventos para que Google detecte el cambio\n googleInput.dispatchEvent(new Event('input', { bubbles: true }));\n googleInput.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n setTimeout(() => {\n isSyncing = false;\n }, 50);\n };\n\n const inputHandler = () => {\n if (!isSyncing) {\n syncToGoogle();\n }\n };\n inputElement.addEventListener('input', inputHandler);\n\n // Sincronizar valor inicial\n setTimeout(() => syncToGoogle(), 100);\n\n // Evento correcto: gmp-select (no gmp-placeselect)\n const selectHandler = async (ev: Event) => {\n const evt = ev as CustomEvent & {\n placePrediction?: { toPlace: () => Promise<google.maps.places.Place> };\n };\n const placePrediction = evt.placePrediction ?? (evt.detail as any)?.placePrediction;\n if (!placePrediction) return;\n const place = await placePrediction.toPlace();\n await place.fetchFields({\n fields: ['addressComponents', 'formattedAddress'],\n });\n\n if (place.addressComponents) {\n const address = this.parseAddressComponentsNew(\n place.addressComponents as any[],\n place.formattedAddress ?? undefined,\n );\n\n address.formattedAddress = place.formattedAddress ?? undefined;\n\n // Forzar actualización del input de Google con solo calle + número\n // Esto sobrescribe el texto completo que Google pone automáticamente\n setTimeout(() => {\n const googleInput = placeAutocomplete.shadowRoot?.querySelector('input');\n if (googleInput && address.address) {\n googleInput.value = address.address;\n }\n }, 10);\n\n onPlaceSelected(address);\n }\n };\n\n placeAutocomplete.addEventListener('gmp-select', selectHandler);\n\n const setError = (error?: string) => {\n if (error) {\n placeAutocomplete.classList.add('error');\n } else {\n placeAutocomplete.classList.remove('error');\n }\n };\n\n const setDisabled = (disabled: boolean) => {\n if (disabled) {\n placeAutocomplete.setAttribute('disabled', 'true');\n } else {\n placeAutocomplete.removeAttribute('disabled');\n }\n const googleInput = placeAutocomplete.shadowRoot?.querySelector('input');\n if (googleInput) {\n googleInput.disabled = disabled;\n }\n };\n\n const destroy = () => {\n inputElement.removeEventListener('input', inputHandler);\n placeAutocomplete.removeEventListener('gmp-select', selectHandler);\n placeAutocomplete.remove();\n containerElement.classList.remove('autocomplete-active');\n };\n\n return { element: placeAutocomplete, destroy, syncToGoogle, setError, setDisabled };\n } catch (error) {\n console.error('Failed to create Google Maps PlaceAutocompleteElement:', error);\n return null;\n }\n }\n\n private hideGoogleBranding() {\n // Inyectar CSS global para ocultar branding de Google\n const globalStyleId = 'rebill-hide-google-branding';\n if (document.getElementById(globalStyleId)) return;\n\n const style = document.createElement('style');\n style.id = globalStyleId;\n style.textContent = `\n /* Ocultar TODOS los elementos de branding de Google Maps */\n gmp-internal-attribution,\n gmp-internal-dialog,\n gmp-place-autocomplete::part(attribution),\n gmp-place-autocomplete + *,\n gmp-place-autocomplete ~ *,\n a[href*=\"maps.google.com\"],\n a[title*=\"Google Maps\"],\n [aria-label*=\"Google Maps\"],\n div:has(> a[href*=\"google.com\"]),\n .dismissButton {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n height: 0 !important;\n max-height: 0 !important;\n overflow: hidden !important;\n position: absolute !important;\n left: -9999px !important;\n }\n `;\n document.head.appendChild(style);\n\n // Remover elementos de branding continuamente (Google los puede agregar dinámicamente)\n const removeGoogleBranding = () => {\n // Remover Web Components de Google\n document.querySelectorAll('gmp-internal-attribution, gmp-internal-dialog').forEach(el => {\n el.remove();\n });\n\n // Remover links y elementos con \"Google Maps\"\n document\n .querySelectorAll('a[href*=\"maps.google.com\"], a[title*=\"Google Maps\"]')\n .forEach(el => {\n const parent = el.closest('div');\n if (parent && parent.textContent?.includes('Google Maps')) {\n parent.style.display = 'none';\n }\n el.remove();\n });\n\n // Remover cualquier SVG con aria-label=\"Google Maps\"\n document.querySelectorAll('svg[aria-label*=\"Google Maps\"]').forEach(el => {\n el.remove();\n });\n };\n\n // Ejecutar inmediatamente y periódicamente\n removeGoogleBranding();\n setInterval(removeGoogleBranding, 500);\n\n // Observer para elementos que se agregan dinámicamente\n const observer = new MutationObserver(() => {\n removeGoogleBranding();\n });\n observer.observe(document.body, { childList: true, subtree: true });\n }\n\n private injectRebillStyles(placeAutocomplete: HTMLElement) {\n const shadow = placeAutocomplete.shadowRoot;\n if (!shadow) {\n console.warn('Shadow DOM not available - styles cannot be injected');\n return;\n }\n\n const style = document.createElement('style');\n style.textContent = `\n /* Resetear TODO */\n * {\n box-sizing: border-box !important;\n }\n\n :host {\n display: block !important;\n width: 100% !important;\n height: 38.33px !important;\n max-height: 38.33px !important;\n font-family: inherit !important;\n border: none !important;\n outline: none !important;\n box-shadow: none !important;\n background: transparent !important;\n overflow: visible !important;\n }\n\n /* Contenedores - resetear */\n div, span, ul, li {\n all: revert !important;\n }\n\n /* INPUT PRINCIPAL - Copiar estilos exactos de rebill-input-text */\n input {\n display: block !important;\n width: 100% !important;\n height: 38.33px !important;\n min-height: 38.33px !important;\n box-sizing: border-box !important;\n border-radius: 8px !important;\n border: 1.5px solid #E5E7EB !important;\n padding: 10px 14px !important;\n padding-right: 40px !important;\n font-size: 14px !important;\n line-height: 20px !important;\n font-weight: 400 !important;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;\n color: #111827 !important;\n background-color: #FFFFFF !important;\n outline: none !important;\n transition: all 0.2s ease !important;\n -webkit-appearance: none !important;\n appearance: none !important;\n }\n\n input::placeholder {\n color: #9CA3AF !important;\n opacity: 1 !important;\n }\n\n input:focus {\n border-color: var(--rebill-color-primary) !important;\n box-shadow: none !important;\n }\n\n input:disabled {\n background-color: var(--rebill-color-background) !important;\n border-color: var(--rebill-color-disabled) !important;\n color: var(--rebill-color-text-secondary) !important;\n cursor: not-allowed !important;\n opacity: 0.7 !important;\n }\n\n input:disabled:focus {\n border-color: var(--rebill-color-disabled) !important;\n box-shadow: none !important;\n }\n\n /* Estado de error - border rojo igual que inputs de Rebill */\n :host(.error) input,\n :host([error]) input {\n border-color: var(--rebill-color-error, #EF4444) !important;\n }\n\n :host(.error) input:focus,\n :host([error]) input:focus {\n border-color: var(--rebill-color-error, #EF4444) !important;\n box-shadow: 0 0 0 2px var(--rebill-color-error-light, rgba(239, 68, 68, 0.1)) !important;\n }\n\n /* Ocultar elementos decorativos de Google */\n [class*=\"icon\"],\n [class*=\"suffix\"],\n [class*=\"prefix\"],\n [class*=\"logo\"],\n [class*=\"powered\"],\n [class*=\"google\"],\n [class*=\"branding\"],\n [class*=\"divider\"],\n [class*=\"separator\"],\n [aria-label*=\"Google\"],\n [aria-label*=\"clear\"],\n [aria-label*=\"Clear\"],\n button,\n svg,\n a[href*=\"google.com\"] {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n height: 0 !important;\n width: 0 !important;\n overflow: hidden !important;\n }\n\n /* Ocultar elementos hermanos del input EXCEPTO error-message */\n input + *:not(.error-message),\n input ~ *:not(.error-message) {\n display: none !important;\n }\n\n /* Dropdown - Estilo Rebill */\n [role=\"listbox\"] {\n position: absolute !important;\n z-index: 9999 !important;\n margin-top: 4px !important;\n width: 100% !important;\n max-height: 300px !important;\n overflow-y: auto !important;\n background: #FFFFFF !important;\n border: 1px solid #E5E7EB !important;\n border-radius: 8px !important;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;\n padding: 0 !important;\n }\n\n ul {\n list-style: none !important;\n padding: 0 !important;\n margin: 0 !important;\n }\n\n /* Ocultar contenedor de atribuciones */\n .attributions,\n [role=\"presentation\"],\n div:has(> gmp-internal-attribution) {\n display: none !important;\n height: 0 !important;\n margin: 0 !important;\n padding: 0 !important;\n border: none !important;\n }\n\n /* Ocultar UL vacío cuando no hay sugerencias */\n ul:empty {\n display: none !important;\n }\n\n [role=\"option\"] {\n padding: 0.75rem !important;\n cursor: pointer !important;\n color: var(--rebill-color-text-primary) !important;\n font-size: 0.875rem !important;\n font-weight: 400 !important;\n border-bottom: 1px solid var(--rebill-color-border) !important;\n list-style: none !important;\n list-style-type: none !important;\n transition: background-color 0.15s ease !important;\n background-color: transparent !important;\n }\n\n [role=\"option\"]::before,\n [role=\"option\"]::marker {\n display: none !important;\n content: none !important;\n }\n\n [role=\"option\"]:last-child {\n border-bottom: none !important;\n }\n\n [role=\"option\"]:hover,\n [role=\"option\"][aria-selected=\"true\"] {\n background-color: #f0f9ff !important;\n }\n\n /* Texto dentro - mismo color que la opción */\n [role=\"option\"] * {\n color: var(--rebill-color-text-primary) !important;\n font-family: inherit !important;\n font-weight: inherit !important;\n }\n\n /* Ocultar botón de cerrar (X) */\n button[aria-label*=\"dismiss\"],\n button[aria-label*=\"close\"],\n .dismiss,\n .close-button {\n display: none !important;\n }\n\n /* Texto dentro de las sugerencias */\n [role=\"option\"] * {\n color: inherit !important;\n font-family: inherit !important;\n }\n `;\n shadow.appendChild(style);\n }\n\n private parseAddressComponentsNew(\n components: any[],\n formattedAddress?: string,\n ): AddressComponents {\n const getComponent = (type: string, useShortName = false) => {\n const component = components.find((c: any) => c.types.includes(type));\n return component ? (useShortName ? component.shortText : component.longText) : '';\n };\n\n const streetNumber = getComponent('street_number');\n const route = getComponent('route');\n const city = getComponent('locality');\n const state = getComponent('administrative_area_level_1');\n const country = getComponent('country', true);\n const zip = getComponent('postal_code');\n\n let addressLine = '';\n\n // Prioridad 1: Usar street_number + route si ambos existen\n if (streetNumber && route) {\n addressLine = `${route} ${streetNumber}`.trim();\n } else if (route) {\n // Si solo hay route, usarlo\n addressLine = route;\n } else if (streetNumber) {\n // Si solo hay número, usarlo\n addressLine = streetNumber;\n }\n\n // Si ya tenemos una dirección de los componentes, usarla\n if (addressLine.length > 0) {\n return {\n address: addressLine,\n city,\n state,\n country,\n zip,\n };\n }\n\n // Prioridad 2: Extraer de formattedAddress\n if (formattedAddress) {\n // Separar por coma y tomar solo la primera parte (calle + número)\n const parts = formattedAddress.split(',').map(p => p.trim());\n const firstPart = parts[0] ?? '';\n\n // Verificar si la primera parte no contiene el nombre de la ciudad\n // Esto previene que se incluya ciudad en la dirección\n const containsCity = city && firstPart.toLowerCase().includes(city.toLowerCase());\n const containsState = state && firstPart.toLowerCase().includes(state.toLowerCase());\n\n if (firstPart.length > 0 && !containsCity && !containsState && /[0-9A-Za-z]/.test(firstPart)) {\n addressLine = firstPart;\n }\n }\n\n return {\n address: addressLine,\n city,\n state,\n country,\n zip,\n };\n }\n\n static loadGoogleMapsScript(googleMapsApiKey?: string) {\n // Use new API key\n const apiKey = googleMapsApiKey || 'AIzaSyB9pS5LHbPKjnmMQ89BQHD0SVZXVsi95pk';\n\n if (!apiKey) {\n console.warn('Google Maps API key not provided. Address autocomplete will not be available.');\n return;\n }\n\n // Check if script is already loaded\n if (document.querySelector('script[src*=\"maps.googleapis.com\"]')) {\n return;\n }\n\n const script = document.createElement('script');\n // Nueva API: loading=async, Places se carga vía importLibrary en createAutocomplete\n script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&loading=async&callback=initGoogleMaps`;\n script.async = true;\n script.defer = true;\n\n // Add global callback for when Google Maps is ready\n (window as any).initGoogleMaps = () => {\n delete (window as any).initGoogleMaps; // Clean up\n };\n\n script.onerror = () => {\n console.error(\n 'Failed to load Google Maps script. Please check your API key and network connection.',\n );\n };\n\n document.head.appendChild(script);\n }\n}\n"],"names":[],"mappings":"MAUa,iBAAiB,CAAA;IACpB,OAAO,QAAQ;IACf,QAAQ,GAAY,KAAK;IACzB,WAAW,GAA4B,IAAI;AAEnD,IAAA,OAAO,WAAW,GAAA;AAChB,QAAA,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE;AAC/B,YAAA,iBAAiB,CAAC,QAAQ,GAAG,IAAI,iBAAiB,EAAE;YACpD,iBAAiB,CAAC,mBAAmB,EAAE;;QAEzC,OAAO,iBAAiB,CAAC,QAAQ;;AAG3B,IAAA,OAAO,mBAAmB,GAAA;QAChC,IAAK,MAAc,CAAC,gBAAgB;YAAE;AAEtC,QAAA,MAAM,oBAAoB,GAAG,OAAO,CAAC,SAAS,CAAC,YAAY;AAE3D,QAAA,OAAO,CAAC,SAAS,CAAC,YAAY,GAAG,UAAU,IAAoB,EAAA;AAC7D,YAAA,IAAI,IAAI,CAAC,SAAS,KAAK,wBAAwB,EAAE;AAC/C,gBAAA,OAAO,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;YAEnE,OAAO,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;AAC9C,SAAC;AAEA,QAAA,MAAc,CAAC,gBAAgB,GAAG,IAAI;;AAGzC,IAAA,MAAM,UAAU,GAAA;QACd,IAAI,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