@movmo/express-checkout-button 2.0.3 → 2.1.0

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.
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @movmo/express-checkout-button v2.0.3
2
+ * @movmo/express-checkout-button v2.1.0
3
3
  * React component plugin for embedding Movmo Express Checkout on airline websites.
4
4
  * (c) Movmo
5
5
  * @license MIT
6
6
  */
7
- "use strict";var e=require("react/jsx-runtime"),t=require("react");let n="granted",o=!1;function r(){return typeof navigator<"u"&&!0===navigator.globalPrivacyControl}function i(){return o?"granted"===n:"granted"===n&&!r()}const s=Object.freeze({SEARCH_PERFORMED:"search_performed",RESULTS_VIEWED:"results_viewed",FARE_COMPARED:"fare_compared",OFFER_SELECTED:"offer_selected",CHECKOUT_STARTED:"checkout_started",CONTACT_INFO_COMPLETED:"contact_info_completed",PASSENGER_INFO_COMPLETED:"passenger_info_completed",PASSENGER_AUTOFILLED:"passenger_autofilled",PASSENGER_FORM_CLEARED:"passenger_form_cleared",PASSENGER_SELECTED:"passenger_selected",SEAT_MAP_OPENED:"seat_map_opened",SEAT_SELECTED:"seat_selected",BAG_ADDED:"bag_added",BAG_REMOVED:"bag_removed",INSURANCE_SELECTED:"insurance_selected",OFFER_EXPIRY_WARNING:"offer_expiry_warning",OFFER_EXPIRED:"offer_expired",EXPIRED_MODAL_ACTION:"expired_modal_action",PAYMENT_STARTED:"payment_started",PAYMENT_SUBMITTED:"payment_submitted",PAYMENT_FAILED:"payment_failed",BOOKING_CONFIRMED:"booking_confirmed",CONFIRMATION_VIEWED:"confirmation_viewed",BOOKING_RATED:"booking_rated",REFERRAL_CLICKED:"referral_clicked",AIRLINE_HELP_CLICKED:"airline_help_clicked",SIGNIN_WALL_SHOWN:"signin_wall_shown",SIGNIN_STARTED:"signin_started",OTP_REQUESTED:"otp_requested",OTP_VERIFIED:"otp_verified",OAUTH_CONSENT_VIEWED:"oauth_consent_viewed",OAUTH_CONSENT_GRANTED:"oauth_consent_granted",OAUTH_CONSENT_DENIED:"oauth_consent_denied",SIGN_IN:"sign_in",SIGN_OUT:"sign_out",PROFILE_UPDATED:"profile_updated",PAYMENT_METHOD_ADDED:"payment_method_added",PASSENGER_SAVED:"passenger_saved",LOYALTY_PROGRAM_ADDED:"loyalty_program_added",PAYMENT_METHOD_AUTOSELECTED:"payment_method_autoselected",PAYMENT_METHOD_SELECTED:"payment_method_selected",PAYMENT_METHOD_EDITED:"payment_method_edited",PAYMENT_METHOD_DELETED:"payment_method_deleted",PAYMENT_METHOD_SET_DEFAULT:"payment_method_set_default",FORM_VALIDATION_ERROR:"form_validation_error",LOCALE_CHANGED:"locale_changed",CURRENCY_CHANGED:"currency_changed",LOYALTY_PROGRAM_OPTED_IN:"loyalty_program_opted_in",LOYALTY_PROGRAM_OPTED_OUT:"loyalty_program_opted_out",LOYALTY_PROGRAM_HOVERED:"loyalty_program_hovered",PLUGIN_LOADED:"plugin_loaded",BUTTON_VIEWED:"button_viewed",BUTTON_HOVERED:"button_hovered",BUTTON_CLICKED:"button_clicked",OFFER_SAVE_STARTED:"offer_save_started",OFFER_SAVE_SUCCEEDED:"offer_save_succeeded",OFFER_SAVE_FAILED:"offer_save_failed",CHECKOUT_REDIRECT_STARTED:"checkout_redirect_started",CHECKOUT_RETURNED:"checkout_returned",PASSKEY_PROMPT_SHOWN:"passkey_prompt_shown",PASSKEY_PROMPT_ACCEPTED:"passkey_prompt_accepted",PASSKEY_PROMPT_DECLINED:"passkey_prompt_declined"}),a=Object.freeze({CLICK:"$click",RAGE_CLICK:"$rage_click",HOVER:"$hover",FIELD_ENGAGED:"$field_engaged",SECTION_VIEWED:"$section_viewed",SCROLL:"$scroll",EXCEPTION:"$exception",PAGE:"$page",VITAL:"$vital",API_TIMING:"$api_timing"});Object.values(s),Object.values(a);class c{constructor(e){this.buf=[],this.retryBatches=[],this.destroyed=!1,this.timer=null,this.pagehideHandler=null,this.endpoint=e.endpoint,this.maxBatch=e.maxBatch??25;const t=e.flushIntervalMs??1e4;this.timer=setInterval((()=>{this.flush()}),t)}enqueue(e){i()&&(this.buf.push(e),this.buf.length>=this.maxBatch&&setTimeout((()=>{this.flush()}),0))}async flush(){if(!i())return this.buf=[],void(this.retryBatches=[]);const e=this.retryBatches.splice(0);this.buf.length>0&&e.push({events:this.buf.splice(0,this.maxBatch),attempts:0});for(const t of e)try{const e=await fetch(this.endpoint,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify({events:t.events})});if(!e.ok)throw new Error("collector http "+e.status)}catch{!this.destroyed&&t.attempts<2&&this.retryBatches.push({events:t.events,attempts:t.attempts+1})}}installPagehideFlush(){this.pagehideHandler=()=>{if(!i())return this.buf=[],void(this.retryBatches=[]);const e=this.retryBatches.splice(0).flatMap((e=>e.events)).concat(this.buf.splice(0,this.buf.length));if(0!==e.length)for(let t=0;t<e.length;t+=this.maxBatch)this.sendOnUnload(e.slice(t,t+this.maxBatch))},window.addEventListener("pagehide",this.pagehideHandler)}sendOnUnload(e){const t=JSON.stringify({events:e});try{if("function"==typeof fetch)return void fetch(this.endpoint,{method:"POST",keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"},body:t}).catch((()=>{}));typeof navigator<"u"&&"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(this.endpoint,t)}catch{}}destroy(){this.destroyed=!0,this.timer&&clearInterval(this.timer),this.pagehideHandler&&window.removeEventListener("pagehide",this.pagehideHandler),this.buf=[],this.retryBatches=[]}}const d="mv_sid",l="mv_seq",u="mv_uid",f="mv_internal",m=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function h(e){try{return sessionStorage.getItem(e)}catch{return null}}function _(e,t){try{sessionStorage.setItem(e,t)}catch{}}let p=null,E=0,v=null,g=!1;function y(){if(p)return;const e=function(){try{const e=new URLSearchParams(window.location.search).get("mvs");if(e)return e;const t=window.location.hash,n=t.indexOf("?");return-1===n?null:new URLSearchParams(t.slice(n+1)).get("mvs")}catch{return null}}();!e||!m.test(e)||(h(d)!==e&&(E=0,_(l,"0")),p=e,_(d,e))}function I(e){return"1"===e||"true"===e}function T(e){(e||I(function(){try{const e=new URLSearchParams(window.location.search).get("mv_internal");if(e)return e;const t=window.location.hash,n=t.indexOf("?");return-1===n?null:new URLSearchParams(t.slice(n+1)).get("mv_internal")}catch{return null}}())||I(h(f)))&&(g=!0,_(f,"1"))}function O(){return!!g||(g=I(h(f)),g)}function R(){if(p)return p;const e=h(d);if(e)return p=e,e;if(y(),p)return p;const t=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}));return p=t,_(d,t),t}function D(){if(0===E){const e=Number(h(l)??0);E=Number.isFinite(e)?e:0}return E+=1,_(l,String(E)),E}function w(e){if(v=e,null===e)try{sessionStorage.removeItem(u)}catch{}else _(u,e)}function x(e){let t=!1;try{t=window.self!==window.top}catch{t=!0}const n=typeof location<"u"?e?location.hostname:location.pathname:"",o=e?"":typeof document<"u"?document.referrer:"";return{page:n.slice(0,512),referrer:o.slice(0,512),viewport:typeof window<"u"?`${window.innerWidth}x${window.innerHeight}`:"0x0",locale:typeof navigator<"u"?navigator.language:"",embedded:t}}const A=new class{constructor(){this.config=null,this.queue=null,this.teardowns=[]}init(e){var t;this.config||(this.config=e,t=e.consent,o||(n=t??"granted",r()&&(n="denied")),y(),T(!0===e.internal),this.queue=new c({endpoint:e.endpoint,flushIntervalMs:e.flushIntervalMs,maxBatch:e.maxBatch}),this.queue.installPagehideFlush())}registerTeardown(e){this.teardowns.push(e)}isScoped(){var e;return!0===(null==(e=this.config)?void 0:e.scoped)}isInitialized(){return null!==this.config}getSessionId(){return this.config?R():null}isInternal(){return!!this.config&&O()}buildEvent(e,t){var n;if(!this.config)throw new Error("@movmo_app/analytics: buildEvent before init");const o=this.config;return{event_id:typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),ts:(new Date).toISOString(),schema_version:1,app:o.app,env:o.env,partner_id:o.partnerId??null,session_id:R(),seq:D(),user_id:v||(v=h(u),v),event_name:e,props:t,context:x(!0===(null==(n=this.config)?void 0:n.scoped)),is_internal:O()}}track(e,t={}){try{if(!this.config||!this.queue)return;this.queue.enqueue(this.buildEvent(e,t))}catch{}}page(e){var t;const n=!0===(null==(t=this.config)?void 0:t.scoped),o=typeof location<"u"?n?location.hostname:location.pathname:"";this.track(a.PAGE,{name:e??o})}identify(e){w(e)}reset(){w(null)}setConsent(e){o=!0,n=e.analytics?"granted":"denied"}shutdown(){var e;for(const e of this.teardowns)try{e()}catch{}this.teardowns=[],null==(e=this.queue)||e.destroy(),this.queue=null,this.config=null,function(){p=null,E=0,v=null,g=!1;try{sessionStorage.removeItem(d),sessionStorage.removeItem(l),sessionStorage.removeItem(u),sessionStorage.removeItem(f)}catch{}}(),o=!1,n="granted"}},S=!0;function C(e){try{const t=globalThis.process,n=t?.env?.[e];return"string"==typeof n&&""!==n?n:void 0}catch{return}}function P(e){const t=C(e);if(void 0!==t)return function(e){try{const t=new URL(e);if(t.username||t.password)return!1;const n=t.hostname.toLowerCase();return"https:"===t.protocol?"movmo.io"===n||n.endsWith(".movmo.io"):"http:"===t.protocol&&("localhost"===n||"127.0.0.1"===n)}catch{return!1}}(t)?t:void 0}const N=(e,t)=>{const n={Accept:"application/json","Content-Type":"application/json","x-api-key":e,"X-Forwarded-Host":"undefined"!=typeof window?window.location.host:"","movmo-customer-id":t},o=C("REACT_APP_CLOUD_FRONT_PROXY_SECRET_HEADER");"undefined"==typeof window||"localhost"!==window.location.hostname&&"127.0.0.1"!==window.location.hostname||!o||(n["X-Movmo-Proxy-Auth"]=o);const r=(e=>{if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const o=t[n].trim();if(o.startsWith(e+"="))return decodeURIComponent(o.substring(e.length+1))}return null})("movmo_csrf_token");return r&&(n["X-CSRF-Token"]=r),n};function L(e){try{return decodeURIComponent(e)}catch{return e}}const b=["movmo_exit","movmo_state","movmo_booking_id","movmo_pnr"];const U=/^movmo_pnr(?:=.*)?$/;function M(e){if(e.length<=1)return"";const t=e.slice(1).split(/([?&])/);let n="",o=null,r=!1;for(let e=0;e<t.length;e+=2){const i=0===e?"":t[e-1],s=t[e];if(U.test(s)){r=!0,null===o&&(o=i);continue}let a=i;null!==o&&(""!==o&&"?"!==o||(a=""===n?"":o),o=null),n+=a+s}return r?""===n?"":`#${n}`:e}const k="movmo:checkout:pending",F="https://flights.movmo.io",$="https://flights.e2e.movmo.io",H=864e5;function B(e){const t=new URLSearchParams({offerId:e.offerId,providerId:e.providerId,airlineRef:e.airlineRef});return e.mvs&&t.set("mvs",e.mvs),e.internal&&t.set("mv_internal","1"),t.set("returnUrl",e.returnUrl),e.state&&t.set("state",e.state),`${function(e){const t=P("REACT_APP_MOVMO_CHECKOUT_URL");return t?t.replace(/\/+$/,""):e?F:$}(e.isProd)}/booking?${t.toString()}`}function G(e){const t=new URL(e),n=function(e){return/^#!?\//.test(e)}(t.hash)?M(t.hash):"";return`${t.origin}${t.pathname}${function(e){if(e.length<=1)return"?"===e?"":e;const t=e.slice(1).split("&").filter((e=>!L(e.split("=")[0]).startsWith("movmo_")));return t.length>0?`?${t.join("&")}`:""}(t.search)}${n}`}function V(){try{sessionStorage.removeItem(k)}catch{}}function Y(e,t){try{if(A.isInitialized())return;const n=(S?P("REACT_APP_MOVMO_ANALYTICS_URL"):void 0)||(t?"https://api.movmo.io/v1/t":"https://e2e.api.movmo.io/v1/t");A.init({app:"express-checkout-button",env:t?"prd":"e2e",partnerId:e,endpoint:n,scoped:!0}),A.track(s.PLUGIN_LOADED)}catch{}}function j(e,t={}){try{A.track(e,t)}catch{}}function K(){try{return A.getSessionId()}catch{return null}}function q(){try{return A.isInternal()}catch{return!1}}const W=["search_again","offer_unavailable","booking_confirmed"];let X=null,J=!1,z=!1;function Q(e){if(e.length<=1)return null;const t=e.lastIndexOf("?"),n=new URLSearchParams(e.slice(-1===t?1:t+1)).getAll("movmo_pnr");return n.length>0?n[n.length-1]:null}function Z(){try{const{pathname:e,search:t,hash:n}=window.location,o=function(e,t){if(e.length<=1)return"?"===e?"":e;const n=e.slice(1).split("&"),o=n.filter((e=>!t.includes(L(e.split("=")[0]))));return o.length===n.length?e:o.length>0?`?${o.join("&")}`:""}(t,b),r=M(n);if(o===t&&r===n)return;window.history.replaceState(window.history.state,"",`${e}${o}${r}`)}catch{}}function ee(e,t){try{t()}catch(e){}}function te(e){if("undefined"==typeof window||z)return!1;try{const t=e??{};if(!J){const e=new URLSearchParams(window.location.search),t=e.get("movmo_exit");if(null===t)return Z(),!1;J=!0,X={exit:t,state:e.get("movmo_state"),bookingId:e.get("movmo_booking_id"),pnr:Q(window.location.hash)},Z()}if(!X)return!1;const n=function(){try{const e=sessionStorage.getItem(k);if(!e)return null;const t=JSON.parse(e);if(t&&"string"==typeof t.state&&""!==t.state&&"string"==typeof t.offerId&&"number"==typeof t.startedAt)return Date.now()-t.startedAt>H?(V(),null):{state:t.state,offerId:t.offerId,startedAt:t.startedAt,..."string"==typeof t.providerId?{providerId:t.providerId}:{},..."string"==typeof t.airlineRef?{airlineRef:t.airlineRef}:{},..."boolean"==typeof t.isProd?{isProd:t.isProd}:{}}}catch{}return null}();if(n&&!function(e,t){return!(e.iataCode&&t.airlineRef&&e.iataCode!==t.airlineRef||e.providerID&&t.providerId&&e.providerID!==t.providerId||e.offerId&&t.offerId&&e.offerId!==t.offerId)}(t,n))return!1;const{exit:o,state:r,bookingId:i,pnr:a}=X;if(X=null,z=!0,!n||!r||r!==n.state)return!1;V();const c=W.includes(o)?o:"search_again",d=n.airlineRef??t.iataCode,l=n.providerId??t.providerID;if("booking_confirmed"===c&&i){const e=a?.trim(),n={bookingId:i,...e?{airlinePnr:e}:{},...void 0!==d?{airlineRef:d}:{},...void 0!==l?{providerId:l}:{}},{onBookingComplete:o}=t;o&&ee(0,(()=>o(n)))}const{onExit:u}=t;u&&ee(0,(()=>u({reason:c})));const f=n.isProd??t.isProd;return void 0!==f&&Y(d??"",f),j(s.CHECKOUT_RETURNED,{reason:c,ms_away:Date.now()-n.startedAt}),!0}catch(e){return!1}}exports.MovmoCheckoutButton=({iataCode:n,apiKey:o,providerID:r,flightOffer:i,flightOfferID:a,isProd:c=!1,className:d,returnUrl:l,onExit:u,onBookingComplete:f,onError:m})=>{const[h,_]=t.useState(!1),[p,E]=t.useState(!1),v=t.useRef(null),g=t.useRef(null),y=((e,t,n=!1)=>{const o=n?"https://flights.movmo.io":"https://flights.e2e.movmo.io",r=P("REACT_APP_MOVMO_CHECKOUT_API_URL")||`${o}/v1/proxy`;return{async post(n,o){const i=`${r.replace(/\/+$/,"")}/${n.replace(/^\/+/,"")}`,s=new AbortController,a=setTimeout((()=>s.abort()),3e4);try{const r=await fetch(i,{method:"POST",headers:N(e,t),body:JSON.stringify(o),credentials:"include",signal:s.signal});if(!r.ok){let e;try{e=await r.json()}catch{}throw Object.assign(new Error(`Movmo API request failed: ${r.status} ${r.statusText} (${n})`),{status:r.status,body:e})}return await r.json()}finally{clearTimeout(a)}}}})(o,n,c),I={iataCode:n,providerID:r,isProd:c,offerId:a,onExit:u,onBookingComplete:f},T=t.useRef(I);T.current=I,t.useEffect((()=>{if(Y(n,c),"undefined"==typeof IntersectionObserver||!v.current)return;const e=new IntersectionObserver((t=>{t.some((e=>e.isIntersecting))&&(j(s.BUTTON_VIEWED),e.disconnect())}),{threshold:.5});return e.observe(v.current),()=>e.disconnect()}),[]),t.useEffect((()=>{te(T.current)}),[]),t.useEffect((()=>{if("undefined"==typeof window)return;const e=e=>{e.persisted&&E(!1)};return window.addEventListener("pageshow",e),()=>window.removeEventListener("pageshow",e)}),[]);const O=`\n movmo-checkout-button\n movmo-px-7 movmo-py-5\n movmo-font-inter movmo-font-semibold movmo-text-lg\n movmo-rounded-xl\n movmo-text-white\n movmo-border-none\n ${p?"movmo-cursor-progress":"movmo-cursor-pointer"}\n movmo-inline-grid movmo-place-items-center\n movmo-transition-all movmo-duration-200\n movmo-outline-none\n ${h?"movmo-bg-gradient-hover":"movmo-bg-gradient-normal"}\n ${d??""}\n `.trim(),R="\n movmo-ml-2 movmo-px-2 movmo-py-1\n movmo-bg-white\n movmo-text-[#171412]\n movmo-rounded-md\n movmo-text-lg\n ".trim(),D="movmo-col-start-1 movmo-row-start-1 movmo-inline-flex movmo-items-center";return e.jsxs("button",{ref:v,onClick:async()=>{if(p)return;E(!0),g.current=null,j(s.BUTTON_CLICKED);let e=a;if(!e&&i){j(s.OFFER_SAVE_STARTED);const t=Date.now(),n=await(async(e,t,n)=>{try{const o=await n.post(`/v1/flights/providers/${e}/offers`,t);return o?.offer_id?{ok:!0,offerId:o.offer_id}:{ok:!1,message:"no offer_id in response"}}catch(e){const t=e?.status,n=e?.body,o=(e=>{if(!e||"object"!=typeof e)return;const{message:t,error:n}=e;if("string"==typeof t&&t)return t;if("string"==typeof n&&n)return n;if(n&&"object"==typeof n){const e=n.message;if("string"==typeof e&&e)return e}})(n)??(e instanceof Error?e.message:String(e));return{ok:!1,status:t,message:o,cause:e}}})(r,i,y),o=Date.now()-t;if(!n.ok)return j(s.OFFER_SAVE_FAILED,{latency_ms:o}),m?.({stage:"save_offer",status:n.status,message:n.message}),void E(!1);j(s.OFFER_SAVE_SUCCEEDED,{latency_ms:o}),e=n.offerId}if(!e)return m?.({stage:"missing_offer",message:"neither flightOfferID nor flightOffer was provided"}),void E(!1);const t=function(){try{const e=globalThis.crypto;if(e&&"function"==typeof e.randomUUID)return e.randomUUID();if(e&&"function"==typeof e.getRandomValues){const t=e.getRandomValues(new Uint8Array(16));return Array.from(t,(e=>e.toString(16).padStart(2,"0"))).join("")}}catch{}return null}();t&&function(e){try{sessionStorage.setItem(k,JSON.stringify(e))}catch{}}({state:t,offerId:e,startedAt:Date.now(),providerId:r,airlineRef:n,isProd:c});const o=B({offerId:e,providerId:r,airlineRef:n,mvs:K(),internal:q(),returnUrl:l??G(window.location.href),state:t,isProd:c});j(s.CHECKOUT_REDIRECT_STARTED);try{window.location.assign(o)}catch(e){E(!1)}},onMouseEnter:()=>{_(!0),g.current=Date.now()},onMouseLeave:()=>{if(_(!1),null!==g.current){const e=Date.now()-g.current;g.current=null,e>=200&&j(s.BUTTON_HOVERED,{dwell_ms:e})}},className:O,disabled:p,"aria-busy":p?"true":void 0,children:[e.jsxs("span",{className:`${D} ${p?"movmo-invisible":""}`.trim(),children:["Express Checkout",e.jsx("span",{className:R,children:"Movmo"})]}),e.jsxs("span",{className:`${D} movmo-gap-2 ${p?"":"movmo-invisible"}`.trim(),"aria-hidden":p?void 0:"true",children:[e.jsx("span",{className:"movmo-checkout-spinner","aria-hidden":"true"}),"Opening Movmo…"]})]})},exports.consumeMovmoCheckoutReturn=te;
7
+ "use strict";var e=require("react/jsx-runtime"),t=require("react");let n="granted",o=!1;function r(){return typeof navigator<"u"&&!0===navigator.globalPrivacyControl}function i(){return o?"granted"===n:"granted"===n&&!r()}const s=Object.freeze({SEARCH_PERFORMED:"search_performed",RESULTS_VIEWED:"results_viewed",FARE_COMPARED:"fare_compared",OFFER_SELECTED:"offer_selected",CHECKOUT_STARTED:"checkout_started",CONTACT_INFO_COMPLETED:"contact_info_completed",PASSENGER_INFO_COMPLETED:"passenger_info_completed",PASSENGER_AUTOFILLED:"passenger_autofilled",PASSENGER_FORM_CLEARED:"passenger_form_cleared",PASSENGER_SELECTED:"passenger_selected",SEAT_MAP_OPENED:"seat_map_opened",SEAT_SELECTED:"seat_selected",BAG_ADDED:"bag_added",BAG_REMOVED:"bag_removed",INSURANCE_SELECTED:"insurance_selected",OFFER_EXPIRY_WARNING:"offer_expiry_warning",OFFER_EXPIRED:"offer_expired",EXPIRED_MODAL_ACTION:"expired_modal_action",PAYMENT_STARTED:"payment_started",PAYMENT_SUBMITTED:"payment_submitted",PAYMENT_FAILED:"payment_failed",BOOKING_CONFIRMED:"booking_confirmed",CONFIRMATION_VIEWED:"confirmation_viewed",BOOKING_RATED:"booking_rated",REFERRAL_CLICKED:"referral_clicked",AIRLINE_HELP_CLICKED:"airline_help_clicked",SIGNIN_WALL_SHOWN:"signin_wall_shown",SIGNIN_STARTED:"signin_started",OTP_REQUESTED:"otp_requested",OTP_VERIFIED:"otp_verified",OAUTH_CONSENT_VIEWED:"oauth_consent_viewed",OAUTH_CONSENT_GRANTED:"oauth_consent_granted",OAUTH_CONSENT_DENIED:"oauth_consent_denied",SIGN_IN:"sign_in",SIGN_OUT:"sign_out",PROFILE_UPDATED:"profile_updated",PAYMENT_METHOD_ADDED:"payment_method_added",PASSENGER_SAVED:"passenger_saved",LOYALTY_PROGRAM_ADDED:"loyalty_program_added",PAYMENT_METHOD_AUTOSELECTED:"payment_method_autoselected",PAYMENT_METHOD_SELECTED:"payment_method_selected",PAYMENT_METHOD_EDITED:"payment_method_edited",PAYMENT_METHOD_DELETED:"payment_method_deleted",PAYMENT_METHOD_SET_DEFAULT:"payment_method_set_default",FORM_VALIDATION_ERROR:"form_validation_error",LOCALE_CHANGED:"locale_changed",CURRENCY_CHANGED:"currency_changed",LOYALTY_PROGRAM_OPTED_IN:"loyalty_program_opted_in",LOYALTY_PROGRAM_OPTED_OUT:"loyalty_program_opted_out",LOYALTY_PROGRAM_HOVERED:"loyalty_program_hovered",PLUGIN_LOADED:"plugin_loaded",BUTTON_VIEWED:"button_viewed",BUTTON_HOVERED:"button_hovered",BUTTON_CLICKED:"button_clicked",OFFER_SAVE_STARTED:"offer_save_started",OFFER_SAVE_SUCCEEDED:"offer_save_succeeded",OFFER_SAVE_FAILED:"offer_save_failed",CHECKOUT_REDIRECT_STARTED:"checkout_redirect_started",CHECKOUT_RETURNED:"checkout_returned",PASSKEY_PROMPT_SHOWN:"passkey_prompt_shown",PASSKEY_PROMPT_ACCEPTED:"passkey_prompt_accepted",PASSKEY_PROMPT_DECLINED:"passkey_prompt_declined"}),a=Object.freeze({CLICK:"$click",RAGE_CLICK:"$rage_click",HOVER:"$hover",FIELD_ENGAGED:"$field_engaged",SECTION_VIEWED:"$section_viewed",SCROLL:"$scroll",EXCEPTION:"$exception",PAGE:"$page",VITAL:"$vital",API_TIMING:"$api_timing"});Object.values(s),Object.values(a);class c{constructor(e){this.buf=[],this.retryBatches=[],this.destroyed=!1,this.timer=null,this.pagehideHandler=null,this.endpoint=e.endpoint,this.maxBatch=e.maxBatch??25;const t=e.flushIntervalMs??1e4;this.timer=setInterval((()=>{this.flush()}),t)}enqueue(e){i()&&(this.buf.push(e),this.buf.length>=this.maxBatch&&setTimeout((()=>{this.flush()}),0))}async flush(){if(!i())return this.buf=[],void(this.retryBatches=[]);const e=this.retryBatches.splice(0);this.buf.length>0&&e.push({events:this.buf.splice(0,this.maxBatch),attempts:0});for(const t of e)try{const e=await fetch(this.endpoint,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify({events:t.events})});if(!e.ok)throw new Error("collector http "+e.status)}catch{!this.destroyed&&t.attempts<2&&this.retryBatches.push({events:t.events,attempts:t.attempts+1})}}installPagehideFlush(){this.pagehideHandler=()=>{if(!i())return this.buf=[],void(this.retryBatches=[]);const e=this.retryBatches.splice(0).flatMap((e=>e.events)).concat(this.buf.splice(0,this.buf.length));if(0!==e.length)for(let t=0;t<e.length;t+=this.maxBatch)this.sendOnUnload(e.slice(t,t+this.maxBatch))},window.addEventListener("pagehide",this.pagehideHandler)}sendOnUnload(e){const t=JSON.stringify({events:e});try{if("function"==typeof fetch)return void fetch(this.endpoint,{method:"POST",keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"},body:t}).catch((()=>{}));typeof navigator<"u"&&"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(this.endpoint,t)}catch{}}destroy(){this.destroyed=!0,this.timer&&clearInterval(this.timer),this.pagehideHandler&&window.removeEventListener("pagehide",this.pagehideHandler),this.buf=[],this.retryBatches=[]}}const l="mv_sid",d="mv_seq",u="mv_uid",f="mv_internal",m=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function h(e){try{return sessionStorage.getItem(e)}catch{return null}}function _(e,t){try{sessionStorage.setItem(e,t)}catch{}}let p=null,v=0,E=null,g=!1;function I(){if(p)return;const e=function(){try{const e=new URLSearchParams(window.location.search).get("mvs");if(e)return e;const t=window.location.hash,n=t.indexOf("?");return-1===n?null:new URLSearchParams(t.slice(n+1)).get("mvs")}catch{return null}}();!e||!m.test(e)||(h(l)!==e&&(v=0,_(d,"0")),p=e,_(l,e))}function y(e){return"1"===e||"true"===e}function R(e){(e||y(function(){try{const e=new URLSearchParams(window.location.search).get("mv_internal");if(e)return e;const t=window.location.hash,n=t.indexOf("?");return-1===n?null:new URLSearchParams(t.slice(n+1)).get("mv_internal")}catch{return null}}())||y(h(f)))&&(g=!0,_(f,"1"))}function T(){return!!g||(g=y(h(f)),g)}function O(){if(p)return p;const e=h(l);if(e)return p=e,e;if(I(),p)return p;const t=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}));return p=t,_(l,t),t}function w(){if(0===v){const e=Number(h(d)??0);v=Number.isFinite(e)?e:0}return v+=1,_(d,String(v)),v}function D(e){if(E=e,null===e)try{sessionStorage.removeItem(u)}catch{}else _(u,e)}function A(e){let t=!1;try{t=window.self!==window.top}catch{t=!0}const n=typeof location<"u"?e?location.hostname:location.pathname:"",o=e?"":typeof document<"u"?document.referrer:"";return{page:n.slice(0,512),referrer:o.slice(0,512),viewport:typeof window<"u"?`${window.innerWidth}x${window.innerHeight}`:"0x0",locale:typeof navigator<"u"?navigator.language:"",embedded:t}}const x=new class{constructor(){this.config=null,this.queue=null,this.teardowns=[]}init(e){var t;this.config||(this.config=e,t=e.consent,o||(n=t??"granted",r()&&(n="denied")),I(),R(!0===e.internal),this.queue=new c({endpoint:e.endpoint,flushIntervalMs:e.flushIntervalMs,maxBatch:e.maxBatch}),this.queue.installPagehideFlush())}registerTeardown(e){this.teardowns.push(e)}isScoped(){var e;return!0===(null==(e=this.config)?void 0:e.scoped)}isInitialized(){return null!==this.config}getSessionId(){return this.config?O():null}isInternal(){return!!this.config&&T()}buildEvent(e,t){var n;if(!this.config)throw new Error("@movmo_app/analytics: buildEvent before init");const o=this.config;return{event_id:typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),ts:(new Date).toISOString(),schema_version:1,app:o.app,env:o.env,partner_id:o.partnerId??null,session_id:O(),seq:w(),user_id:E||(E=h(u),E),event_name:e,props:t,context:A(!0===(null==(n=this.config)?void 0:n.scoped)),is_internal:T()}}track(e,t={}){try{if(!this.config||!this.queue)return;this.queue.enqueue(this.buildEvent(e,t))}catch{}}page(e){var t;const n=!0===(null==(t=this.config)?void 0:t.scoped),o=typeof location<"u"?n?location.hostname:location.pathname:"";this.track(a.PAGE,{name:e??o})}identify(e){D(e)}reset(){D(null)}setConsent(e){o=!0,n=e.analytics?"granted":"denied"}shutdown(){var e;for(const e of this.teardowns)try{e()}catch{}this.teardowns=[],null==(e=this.queue)||e.destroy(),this.queue=null,this.config=null,function(){p=null,v=0,E=null,g=!1;try{sessionStorage.removeItem(l),sessionStorage.removeItem(d),sessionStorage.removeItem(u),sessionStorage.removeItem(f)}catch{}}(),o=!1,n="granted"}},S=!0;function C(e){try{const t=globalThis.process,n=t?.env?.[e];return"string"==typeof n&&""!==n?n:void 0}catch{return}}function P(e){const t=C(e);if(void 0!==t)return function(e){try{const t=new URL(e);if(t.username||t.password)return!1;const n=t.hostname.toLowerCase();return"https:"===t.protocol?"movmo.io"===n||n.endsWith(".movmo.io"):"http:"===t.protocol&&("localhost"===n||"127.0.0.1"===n)}catch{return!1}}(t)?t:void 0}const N=(e,t)=>{const n={Accept:"application/json","Content-Type":"application/json","x-api-key":e,"X-Forwarded-Host":"undefined"!=typeof window?window.location.host:"","movmo-customer-id":t},o=C("REACT_APP_CLOUD_FRONT_PROXY_SECRET_HEADER");"undefined"==typeof window||"localhost"!==window.location.hostname&&"127.0.0.1"!==window.location.hostname||!o||(n["X-Movmo-Proxy-Auth"]=o);const r=(e=>{if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const o=t[n].trim();if(o.startsWith(e+"="))return decodeURIComponent(o.substring(e.length+1))}return null})("movmo_csrf_token");return r&&(n["X-CSRF-Token"]=r),n},b=(e,t,n=!1,o="flights")=>{const r=t,i="events"===o,s=i?n?"https://events.movmo.io":"https://events.e2e.movmo.io":n?"https://flights.movmo.io":"https://flights.e2e.movmo.io",a=(i?void 0:P("REACT_APP_MOVMO_CHECKOUT_API_URL"))||`${s}/v1/proxy`;return{async post(t,n){const o=`${a.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`,i=new AbortController,s=setTimeout((()=>i.abort()),3e4);try{const s=await fetch(o,{method:"POST",headers:N(e,r),body:JSON.stringify(n),credentials:"include",signal:i.signal});if(!s.ok){let e;try{e=await s.json()}catch{}throw Object.assign(new Error(`Movmo API request failed: ${s.status} ${s.statusText} (${t})`),{status:s.status,body:e})}return await s.json()}finally{clearTimeout(s)}}}},U=async(e,t,n)=>{try{const o=await n.post(e,t);if(!o?.offer_id){return{ok:!1,message:"no offer_id in response"}}return{ok:!0,offerId:o.offer_id}}catch(e){const t=e?.status,n=e?.body,o=(e=>{if(!e||"object"!=typeof e)return;const{message:t,error:n}=e;if("string"==typeof t&&t)return t;if("string"==typeof n&&n)return n;if(n&&"object"==typeof n){const e=n.message;if("string"==typeof e&&e)return e}})(n)??(e instanceof Error?e.message:String(e));return{ok:!1,status:t,message:o,cause:e}}};function L(e){try{return decodeURIComponent(e)}catch{return e}}const M=["movmo_exit","movmo_state","movmo_booking_id","movmo_pnr"];const k=/^movmo_pnr(?:=.*)?$/;function F(e){if(e.length<=1)return"";const t=e.slice(1).split(/([?&])/);let n="",o=null,r=!1;for(let e=0;e<t.length;e+=2){const i=0===e?"":t[e-1],s=t[e];if(k.test(s)){r=!0,null===o&&(o=i);continue}let a=i;null!==o&&(""!==o&&"?"!==o||(a=""===n?"":o),o=null),n+=a+s}return r?""===n?"":`#${n}`:e}const $="movmo:checkout:pending",H="https://flights.movmo.io",B="https://flights.e2e.movmo.io",V="https://events.movmo.io",G="https://events.e2e.movmo.io",j=864e5;function Y(e){const t=new URLSearchParams({offerId:e.offerId,providerId:e.providerId,sellerRef:e.sellerRef});return e.mvs&&t.set("mvs",e.mvs),e.internal&&t.set("mv_internal","1"),t.set("returnUrl",e.returnUrl),e.state&&t.set("state",e.state),`${function(e){const t=P("REACT_APP_MOVMO_EVENTS_CHECKOUT_URL");return t?t.replace(/\/+$/,""):e?V:G}(e.isProd)}/booking?${t.toString()}`}function K(e){const t=new URLSearchParams({offerId:e.offerId,providerId:e.providerId,airlineRef:e.airlineRef});return e.mvs&&t.set("mvs",e.mvs),e.internal&&t.set("mv_internal","1"),t.set("returnUrl",e.returnUrl),e.state&&t.set("state",e.state),`${function(e){const t=P("REACT_APP_MOVMO_CHECKOUT_URL");return t?t.replace(/\/+$/,""):e?H:B}(e.isProd)}/booking?${t.toString()}`}function q(e){const t=new URL(e),n=function(e){return/^#!?\//.test(e)}(t.hash)?F(t.hash):"";return`${t.origin}${t.pathname}${function(e){if(e.length<=1)return"?"===e?"":e;const t=e.slice(1).split("&").filter((e=>!L(e.split("=")[0]).startsWith("movmo_")));return t.length>0?`?${t.join("&")}`:""}(t.search)}${n}`}function W(){try{const e=globalThis.crypto;if(e&&"function"==typeof e.randomUUID)return e.randomUUID();if(e&&"function"==typeof e.getRandomValues){const t=e.getRandomValues(new Uint8Array(16));return Array.from(t,(e=>e.toString(16).padStart(2,"0"))).join("")}}catch{}return null}function X(e){try{sessionStorage.setItem($,JSON.stringify(e))}catch{}}function J(){try{sessionStorage.removeItem($)}catch{}}function z(e,t){try{if(x.isInitialized())return;const n=(S?P("REACT_APP_MOVMO_ANALYTICS_URL"):void 0)||(t?"https://api.movmo.io/v1/t":"https://e2e.api.movmo.io/v1/t");x.init({app:"express-checkout-button",env:t?"prd":"e2e",partnerId:e,endpoint:n,scoped:!0}),x.track(s.PLUGIN_LOADED)}catch{}}function Q(e,t={}){try{x.track(e,t)}catch{}}function Z(){try{return x.getSessionId()}catch{return null}}function ee(){try{return x.isInternal()}catch{return!1}}const te=["search_again","offer_unavailable","booking_confirmed"];let ne=null,oe=!1,re=!1;function ie(e){if(e.length<=1)return null;const t=e.lastIndexOf("?"),n=new URLSearchParams(e.slice(-1===t?1:t+1)).getAll("movmo_pnr");return n.length>0?n[n.length-1]:null}function se(){try{const{pathname:e,search:t,hash:n}=window.location,o=function(e,t){if(e.length<=1)return"?"===e?"":e;const n=e.slice(1).split("&"),o=n.filter((e=>!t.includes(L(e.split("=")[0]))));return o.length===n.length?e:o.length>0?`?${o.join("&")}`:""}(t,M),r=F(n);if(o===t&&r===n)return;window.history.replaceState(window.history.state,"",`${e}${o}${r}`)}catch{}}function ae(e,t){try{t()}catch(e){}}function ce(e){if("undefined"==typeof window||re)return!1;try{const t=e??{};if(!oe){const e=new URLSearchParams(window.location.search),t=e.get("movmo_exit");if(null===t)return se(),!1;oe=!0,ne={exit:t,state:e.get("movmo_state"),bookingId:e.get("movmo_booking_id"),pnr:ie(window.location.hash)},se()}if(!ne)return!1;const n=function(){try{const e=sessionStorage.getItem($);if(!e)return null;const t=JSON.parse(e);if(t&&"string"==typeof t.state&&""!==t.state&&"string"==typeof t.offerId&&"number"==typeof t.startedAt)return Date.now()-t.startedAt>j?(J(),null):{state:t.state,offerId:t.offerId,startedAt:t.startedAt,..."string"==typeof t.providerId?{providerId:t.providerId}:{},..."string"==typeof t.airlineRef?{airlineRef:t.airlineRef}:{},..."boolean"==typeof t.isProd?{isProd:t.isProd}:{},..."events"===t.product||"flights"===t.product?{product:t.product}:{},..."string"==typeof t.sellerRef?{sellerRef:t.sellerRef}:{}}}catch{}return null}();if(n&&!function(e,t){const n=t.product??"flights";if(void 0!==e.sellerRef){if("events"!==n)return!1;if(e.sellerRef!==t.sellerRef)return!1}else if("flights"!==n)return!1;return!(e.iataCode&&t.airlineRef&&e.iataCode!==t.airlineRef||e.providerID&&t.providerId&&e.providerID!==t.providerId||e.offerId&&t.offerId&&e.offerId!==t.offerId)}(t,n))return!1;const{exit:o,state:r,bookingId:i,pnr:a}=ne;if(ne=null,re=!0,!n||!r||r!==n.state)return!1;J();const c=te.includes(o)?o:"search_again",l="events"===n.product,d=l?void 0:n.airlineRef??t.iataCode,u=l?n.sellerRef??t.sellerRef:void 0,f=n.providerId??t.providerID;if("booking_confirmed"===c&&i){const e=l?void 0:a?.trim(),n={bookingId:i,...e?{airlinePnr:e}:{},...void 0!==d?{airlineRef:d}:{},...void 0!==u?{sellerRef:u}:{},...void 0!==f?{providerId:f}:{}},{onBookingComplete:o}=t;o&&ae(0,(()=>o(n)))}const{onExit:m}=t;m&&ae(0,(()=>m({reason:c})));const h=n.isProd??t.isProd;return void 0!==h&&z(d??u??"",h),Q(s.CHECKOUT_RETURNED,{reason:c,ms_away:Date.now()-n.startedAt}),!0}catch(e){return!1}}exports.MovmoCheckoutButton=n=>{const{apiKey:o,providerID:r,isProd:i=!1,className:a,returnUrl:c,onExit:l,onBookingComplete:d,onError:u}=n,f=void 0!==n.sellerRef||void 0!==n.eventTicket,m=n.iataCode??"",h=n.sellerRef??"",_=n.eventTicket,{flightOffer:p,flightOfferID:v}=n,E=f?h:m,g=f&&i,[I,y]=t.useState(!1),[R,T]=t.useState(!1),O=t.useRef(null),w=t.useRef(null),D=f?b(o,h,i,"events"):b(o,m,i),A={...f?{sellerRef:h}:{iataCode:m},providerID:r,isProd:i,offerId:f?void 0:v,onExit:l,onBookingComplete:d},x=t.useRef(A);x.current=A,t.useEffect((()=>{if(g)return;if(z(E,i),"undefined"==typeof IntersectionObserver||!O.current)return;const e=new IntersectionObserver((t=>{t.some((e=>e.isIntersecting))&&(Q(s.BUTTON_VIEWED),e.disconnect())}),{threshold:.5});return e.observe(O.current),()=>e.disconnect()}),[]),t.useEffect((()=>{ce(x.current)}),[]),t.useEffect((()=>{if("undefined"==typeof window)return;const e=e=>{e.persisted&&T(!1)};return window.addEventListener("pageshow",e),()=>window.removeEventListener("pageshow",e)}),[]);const S=async()=>{if(R)return;const e=i?"Movmo events checkout is not available in production yet.":function(e){const t=e;if(!t||"object"!=typeof t)return"eventTicket is required";const n=[];"string"==typeof t.eventId&&""!==t.eventId.trim()||n.push("eventTicket.eventId"),"string"==typeof t.listingId&&""!==t.listingId.trim()||n.push("eventTicket.listingId");const o=t.quantity;return("number"!=typeof o||!Number.isInteger(o)||o<1||o>20)&&n.push("eventTicket.quantity (a whole number from 1 to 20)"),n.length>0?`invalid ${n.join(", ")}`:null}(_);if(null!==e||!_||""===h.trim()||!r||!o){const t=e??"sellerRef, providerID and apiKey are required";return void u?.(Object.assign(new Error(t),{message:t,stage:i?"not_available":"invalid_options"}))}T(!0),w.current=null,Q(s.BUTTON_CLICKED),Q(s.OFFER_SAVE_STARTED);const t=Date.now(),n=await((e,t,n)=>U(`/v1/events/providers/${encodeURIComponent(e)}/website-offers`,{event_id:t.eventId,listing_id:t.listingId,quantity:t.quantity},n))(r,_,D),a=Date.now()-t;if(!n.ok)return Q(s.OFFER_SAVE_FAILED,{latency_ms:a}),u?.({stage:"save_offer",status:n.status,message:n.message}),void T(!1);Q(s.OFFER_SAVE_SUCCEEDED,{latency_ms:a});const l=W();l&&X({state:l,offerId:n.offerId,startedAt:Date.now(),providerId:r,product:"events",sellerRef:h,isProd:i});const d=Y({offerId:n.offerId,providerId:r,sellerRef:h,mvs:Z(),internal:ee(),returnUrl:c??q(window.location.href),state:l,isProd:i});Q(s.CHECKOUT_REDIRECT_STARTED);try{window.location.assign(d)}catch(e){T(!1)}},C=`\n movmo-checkout-button\n movmo-px-7 movmo-py-5\n movmo-font-inter movmo-font-semibold movmo-text-lg\n movmo-rounded-xl\n movmo-text-white\n movmo-border-none\n ${R?"movmo-cursor-progress":"movmo-cursor-pointer"}\n movmo-inline-grid movmo-place-items-center\n movmo-transition-all movmo-duration-200\n movmo-outline-none\n ${I?"movmo-bg-gradient-hover":"movmo-bg-gradient-normal"}\n ${a??""}\n `.trim(),P="\n movmo-ml-2 movmo-px-2 movmo-py-1\n movmo-bg-white\n movmo-text-[#171412]\n movmo-rounded-md\n movmo-text-lg\n ".trim(),N="movmo-col-start-1 movmo-row-start-1 movmo-inline-flex movmo-items-center";return e.jsxs("button",{ref:O,onClick:async()=>{if(f)return S();if(R)return;T(!0),w.current=null,Q(s.BUTTON_CLICKED);let e=v;if(!e&&p){Q(s.OFFER_SAVE_STARTED);const t=Date.now(),n=await((e,t,n)=>U(`/v1/flights/providers/${e}/offers`,t,n))(r,p,D),o=Date.now()-t;if(!n.ok)return Q(s.OFFER_SAVE_FAILED,{latency_ms:o}),u?.({stage:"save_offer",status:n.status,message:n.message}),void T(!1);Q(s.OFFER_SAVE_SUCCEEDED,{latency_ms:o}),e=n.offerId}if(!e)return u?.({stage:"missing_offer",message:"neither flightOfferID nor flightOffer was provided"}),void T(!1);const t=W();t&&X({state:t,offerId:e,startedAt:Date.now(),providerId:r,airlineRef:m,isProd:i});const n=K({offerId:e,providerId:r,airlineRef:m,mvs:Z(),internal:ee(),returnUrl:c??q(window.location.href),state:t,isProd:i});Q(s.CHECKOUT_REDIRECT_STARTED);try{window.location.assign(n)}catch(e){T(!1)}},onMouseEnter:()=>{y(!0),g||(w.current=Date.now())},onMouseLeave:()=>{if(y(!1),!g&&null!==w.current){const e=Date.now()-w.current;w.current=null,e>=200&&Q(s.BUTTON_HOVERED,{dwell_ms:e})}},className:C,disabled:R,"aria-busy":R?"true":void 0,children:[e.jsxs("span",{className:`${N} ${R?"movmo-invisible":""}`.trim(),children:["Express Checkout",e.jsx("span",{className:P,children:"Movmo"})]}),e.jsxs("span",{className:`${N} movmo-gap-2 ${R?"":"movmo-invisible"}`.trim(),"aria-hidden":R?void 0:"true",children:[e.jsx("span",{className:"movmo-checkout-spinner","aria-hidden":"true"}),"Opening Movmo…"]})]})},exports.consumeMovmoCheckoutReturn=ce;
8
8
  //# sourceMappingURL=index.cjs.map