@solvimon/solvimon-web 0.1.0-alpha.4 → 0.1.0-alpha.5

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 (75) hide show
  1. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-LQgNMjOT.js → BillingInformation.vue_vue_type_script_setup_true_lang-BouYyZhD.js} +1 -1
  2. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-_GGUwxEJ.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CvUwy_tp.mjs} +2 -2
  3. package/dist/{ContentWithAsideLayout-BQpDxDXI.js → ContentWithAsideLayout-BjJufFeN.js} +1 -1
  4. package/dist/{ContentWithAsideLayout-BJ0Ccghd.mjs → ContentWithAsideLayout-CKbnuXMU.mjs} +1 -1
  5. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DxoeHBT0.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DaEPSNrY.mjs} +1 -1
  6. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BgcSUvE1.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-sbmK2un9.js} +1 -1
  7. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CCJ-J0t4.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CLU-8-Ao.mjs} +1 -1
  8. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BKlI9Y8m.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-NRmK7iN3.js} +1 -1
  9. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Dhoaaymm.js → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Ck_1lRDB.js} +1 -1
  10. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D_JmUGZS.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DFCX2tcj.mjs} +3 -3
  11. package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-DCfpg7nK.js → PricingGroupContent.vue_vue_type_script_setup_true_lang-BOZurit_.js} +1 -1
  12. package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-wxetfLSR.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-DAwMy1l8.mjs} +1 -1
  13. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DcunVa40.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-Cj4cnM8z.mjs} +4 -4
  14. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-C6AOtXAD.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-D49i1DHa.js} +1 -1
  15. package/dist/{component-BhrlC5ZJ.mjs → component-B0RYS5uK.mjs} +1 -1
  16. package/dist/{component-B5y7wYnP.js → component-BeqkeC9h.js} +1 -1
  17. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  18. package/dist/components/BillingInformation/BillingInformation.es.js +3 -3
  19. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  20. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +2 -2
  21. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  22. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +3 -3
  23. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  24. package/dist/components/Invoice/Invoice.es.js +5 -5
  25. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  26. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
  27. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  28. package/dist/components/InvoicesList/InvoicesList.es.js +2 -2
  29. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  30. package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
  31. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  32. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +4 -4
  33. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  34. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +2 -2
  35. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  36. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +4 -4
  37. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  38. package/dist/components/WalletBalances/WalletBalances.es.js +2 -2
  39. package/dist/core/index.cjs.js +1 -1
  40. package/dist/core/index.es.js +1 -1
  41. package/dist/index.cjs.js +1 -1
  42. package/dist/index.es.js +1 -1
  43. package/dist/{invoices-BYnoNgSR.js → invoices-CUrXmVXe.js} +1 -1
  44. package/dist/{invoices-C8nfTLon.mjs → invoices-CoEBP5UT.mjs} +1 -1
  45. package/dist/{paymentMethods-BJVTwjzp.mjs → paymentMethods-C2gWIbEr.mjs} +1 -1
  46. package/dist/{paymentMethods-CwzFgccc.js → paymentMethods-D_rYLg3F.js} +1 -1
  47. package/dist/{payments-Da5LVn5H.js → payments-ClJySb0d.js} +1 -1
  48. package/dist/{payments-AWzaFsBd.mjs → payments-DLjkq_hN.mjs} +1 -1
  49. package/dist/{registry-DN-NWLUK.js → registry-EPF-VAYZ.js} +1 -1
  50. package/dist/{registry-Dll2lIBv.mjs → registry-bo_7pcbl.mjs} +2 -2
  51. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  52. package/dist/screens/Checkout/Checkout.es.js +8 -8
  53. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  54. package/dist/screens/CustomerOverview/CustomerOverview.es.js +9 -9
  55. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  56. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +5 -5
  57. package/dist/{subscriptions-CMBt--lb.mjs → subscriptions-BepBTXR5.mjs} +1 -1
  58. package/dist/{subscriptions-0_i6paaS.js → subscriptions-DERHtyHo.js} +1 -1
  59. package/dist/{useActionDispatchProvider-J1S-vXqg.mjs → useActionDispatchProvider-B_SkyymZ.mjs} +1 -1
  60. package/dist/{useActionDispatchProvider-C-uVJcgJ.js → useActionDispatchProvider-D4OtXsNA.js} +1 -1
  61. package/dist/{useCustomer-DZKD_AMw.mjs → useCustomer-C0RKKfGJ.mjs} +1 -1
  62. package/dist/{useCustomer-ClGwkeNn.js → useCustomer-CEFUPIDZ.js} +1 -1
  63. package/dist/{useCustomerPaymentMethodOptions-D_5UvLze.js → useCustomerPaymentMethodOptions-BgCFkLeQ.js} +1 -1
  64. package/dist/{useCustomerPaymentMethodOptions-CbnzYwYp.mjs → useCustomerPaymentMethodOptions-BlFH4zxG.mjs} +3 -3
  65. package/dist/{useIncrementalLoading-DbQxYZ1J.mjs → useIncrementalLoading-BqD4k_-r.mjs} +1 -1
  66. package/dist/{useIncrementalLoading-DrgYXlRK.js → useIncrementalLoading-CDpeHhKs.js} +1 -1
  67. package/dist/{useInvoiceData-ca_-ah5G.mjs → useInvoiceData-7mqBeSPa.mjs} +2 -2
  68. package/dist/{useInvoiceData-BtxiSooD.js → useInvoiceData-DvNf2402.js} +1 -1
  69. package/dist/{useInvoicesList-CbzCTBaM.mjs → useInvoicesList-B5vYDRyl.mjs} +4 -4
  70. package/dist/{useInvoicesList-BMeLWF8r.js → useInvoicesList-CBqZG_rw.js} +1 -1
  71. package/dist/{usePaymentMethods-CuhSSaz4.mjs → usePaymentMethods-4Io2ZHlo.mjs} +2 -2
  72. package/dist/{usePaymentMethods-CaE9qm2M.js → usePaymentMethods-BdZkt6re.js} +1 -1
  73. package/dist/{useWalletBalanceItems-Cjis6nYZ.mjs → useWalletBalanceItems-B0NZuM3W.mjs} +1 -1
  74. package/dist/{useWalletBalanceItems-B-6IRohi.js → useWalletBalanceItems-CzV3PcJH.js} +1 -1
  75. package/package.json +1 -1
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-B5y7wYnP.js"),i=require("../../subscriptions-0_i6paaS.js"),n=require("../../_Uint8Array-DxISR7XF.js"),o=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Dhoaaymm.js"),a=require("../../invoices-BYnoNgSR.js"),r=require("../../index-DRdBmZ2-.js"),l=require("../../index-2jo9BSPM.js"),c=require("../../cloneDeep-DranHQkY.js"),u=require("../../paymentMethods-CwzFgccc.js"),d=require("../../useService-D-CUtlp3.js"),s=require("../../ContentWithAsideLayout-BQpDxDXI.js"),p=require("../../PricingGroupContent.vue_vue_type_script_setup_true_lang-DCfpg7nK.js"),m=require("../../index-CWSXne1Q.js"),g=require("../../Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js"),f=require("../../payments-Da5LVn5H.js");var v=n.Symbol?n.Symbol.prototype:void 0;v&&v.toString;var y=Object.prototype.hasOwnProperty;var _=0;function h(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function b(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?h(Object(i),!0).forEach(function(t){M(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):h(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function M(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function N(e){return"function"==typeof e}function I(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function k(e){return N(e.$validator)?b({},e):{$validator:e}}function C(e){return"object"==typeof e?e.$valid:e}function x(e){return e.$validator||e}const E=t=>{if(t=e.unref(t),Array.isArray(t))return!!t.length;if(null==t)return!1;if(!1===t)return!0;if(t instanceof Date)return!isNaN(t.getTime());if("object"==typeof t){for(let e in t)return!0;return!1}return!!String(t).length};function D(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return t=>(t=e.unref(t),!E(t)||i.every(e=>(e.lastIndex=0,e.test(t))))}var A=Object.freeze({__proto__:null,forEach:function(t){return{$validator(i){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return e.unref(i).reduce((e,i,n)=>{const a=Object.entries(i).reduce((e,a)=>{let[r,l]=a;const c=t[r]||{},u=Object.entries(c).reduce((e,t)=>{let[a,c]=t;const u=x(c).call(this,l,i,n,...o),d=C(u);if(e.$data[a]=u,e.$data.$invalid=!d||!!e.$data.$invalid,e.$data.$error=e.$data.$invalid,!d){let t=c.$message||"";const i=c.$params||{};"function"==typeof t&&(t=t({$pending:!1,$invalid:!d,$params:i,$model:l,$response:u})),e.$errors.push({$property:r,$message:t,$params:i,$response:u,$model:l,$pending:!1,$validator:a})}return{$valid:e.$valid&&d,$data:e.$data,$errors:e.$errors}},{$valid:!0,$data:{},$errors:[]});return e.$data[r]=u.$data,e.$errors[r]=u.$errors,{$valid:e.$valid&&u.$valid,$data:e.$data,$errors:e.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:e.$valid&&a.$valid,$data:e.$data.concat(a.$data),$errors:e.$errors.concat(a.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:e=>{let{$response:t}=e;return t?t.$errors.map(e=>Object.values(e).map(e=>e.map(e=>e.$message)).reduce((e,t)=>e.concat(t),[])):[]}}},len:t=>(t=e.unref(t),Array.isArray(t)?t.length:"object"==typeof t?Object.keys(t).length:String(t).length),normalizeValidatorObject:k,regex:D,req:E,unwrap:e.unref,unwrapNormalizedValidator:x,unwrapValidatorResponse:C,withAsync:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return b(b({},k(e)),{},{$async:!0,$watchTargets:t})},withMessage:function(t,i){if(!N(t)&&"string"!=typeof e.unref(t))throw new Error('[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided '+typeof t);if(!I(i)&&!N(i))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const n=k(i);return n.$message=t,n},withParams:function(e,t){if(!I(e))throw new Error('[@vuelidate/validators]: First parameter to "withParams" should be an object, provided '+typeof e);if(!I(t)&&!N(t))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const i=k(t);return i.$params=b(b({},i.$params||{}),e),i}});D(/^[a-zA-Z]*$/),D(/^[a-zA-Z0-9]*$/),D(/^\d*(\.\d+)?$/);D(/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i);D(/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i),D(/(^[0-9]*$)|(^-[0-9]+$)/),D(/^[-]?\d*(\.\d+)?$/);const w={AT:{regex:/^ATU\d{8}$/,prefix:"AT",example:"ATU12345678"},BE:{regex:/^BE0?\d{9}$/,prefix:"BE",example:"BE0123456789"},BG:{regex:/^BG\d{9,10}$/,prefix:"BG",example:"BG123456789"},HR:{regex:/^HR\d{11}$/,prefix:"HR",example:"HR12345678901"},CY:{regex:/^CY\d{8}[A-Z]$/,prefix:"CY",example:"CY12345678X"},CZ:{regex:/^CZ\d{8,10}$/,prefix:"CZ",example:"CZ12345678"},DE:{regex:/^DE\d{9}$/,prefix:"DE",example:"DE123456789"},DK:{regex:/^DK\d{8}$/,prefix:"DK",example:"DK12345678"},EE:{regex:/^EE\d{9}$/,prefix:"EE",example:"EE123456789"},GR:{regex:/^(EL|GR)\d{9}$/,prefix:"GR",example:"GR123456789"},ES:{regex:/^ES[A-Z0-9]\d{7}[A-Z0-9]$/,prefix:"ES",example:"ESX1234567X"},FI:{regex:/^FI\d{8}$/,prefix:"FI",example:"FI12345678"},FR:{regex:/^FR[0-9A-Z]{2}\d{9}$/,prefix:"FR",example:"FRXX123456789"},HU:{regex:/^HU\d{8}$/,prefix:"HU",example:"HU12345678"},IE:{regex:/^IE[0-9A-Z]{8,9}$/,prefix:"IE",example:"IE1234567A"},IS:{regex:/^IS\d{5}$/,prefix:"IS",example:"IS12345"},IT:{regex:/^IT\d{11}$/,prefix:"IT",example:"IT12345678901"},LT:{regex:/^LT(\d{9}|\d{12})$/,prefix:"LT",example:"LT123456789 or LT123456789012"},LU:{regex:/^LU\d{8}$/,prefix:"LU",example:"LU12345678"},LV:{regex:/^LV\d{11}$/,prefix:"LV",example:"LV12345678901"},ME:{regex:/^ME\d{9}$/,prefix:"ME",example:"ME123456789"},MT:{regex:/^MT\d{8}$/,prefix:"MT",example:"MT12345678"},NL:{regex:/^NL\d{9}B\d{2}$/,prefix:"NL",example:"NL123456789B01"},PL:{regex:/^PL\d{10}$/,prefix:"PL",example:"PL1234567890"},PT:{regex:/^PT\d{9}$/,prefix:"PT",example:"PT123456789"},RO:{regex:/^RO\d{2,10}$/,prefix:"RO",example:"RO1234567890"},RU:{regex:/^RU(\d{9}|\d{10}|\d{12})$/,prefix:"RU",example:"RU123456789 or RU1234567890 or RU123456789012"},SE:{regex:/^SE\d{10}01$/,prefix:"SE",example:"SE123456789001"},SI:{regex:/^SI\d{8}$/,prefix:"SI",example:"SI12345678"},SK:{regex:/^SK\d{10}$/,prefix:"SK",example:"SK1234567890"},CH:{regex:/^CHE\d{9}(MWST|TVA|IVA)?$/,prefix:"CHE",example:"CHE123456789MWST"},NO:{regex:/^NO\d{9}MVA$/,prefix:"NO",example:"NO123456789MVA"},GB:{regex:/^GB(\d{9}|\d{12}|GD\d{3}|HA\d{3})$/,prefix:"GB",example:"GB123456789"},XI:{regex:/^XI(\d{9}|\d{12})$/,prefix:"XI",example:"XI123456789"}},P=A.withMessage(({$model:i})=>{if(!i||"string"!=typeof i||""===i.trim())return"";const n=e.inject(t.I18N_INJECTION_KEY,null);if(!n)return"Invalid tax ID";const{formatMessage:o}=n,a=Object.values(w).find(e=>i.toUpperCase().startsWith(e.prefix.toUpperCase()));return a?o({defaultMessage:"Invalid tax ID format. Example: {example}",id:"form_validation.tax_id.invalid_format",description:"Error message when tax ID format is invalid but prefix matches"},{example:a.example}):o({defaultMessage:"Invalid tax ID",id:"taxId.invalid",description:"Error message when tax ID is invalid"})},e=>!e||"string"!=typeof e||""===e.trim()||Object.values(w).some(t=>t.regex.test(e))),B=e=>{if(null==e)return!1;const t=String(e);return/^\S+$/.test(t)};A.withMessage("Everything but whitespace",B);function S({pricingPlanScheduleInfos:e,type:t}){return e.find(e=>e.pricing_plan_schedule.type===t)}function V({enabledPricings:e,seatsValues:t,pricingPlanScheduleInfos:i,pricingCurrency:n,billingPeriod:o}){const a=S({pricingPlanScheduleInfos:i,type:"DEFAULT"});if(a&&(e||t))return[{pricing_plan_schedule_id:a.id,enabled_pricings:e,seats_values:null==t?void 0:t.map(({pricing_item_config_id:e,number:t})=>({pricing_item_config_id:e,number:t})),...n&&{pricing_currency:n},...o&&{billing_period:o}}]}A.withMessage("Everything but whitespace",e=>!A.req(e)||B(String(e)));const T={AD:"EUR",AE:"AED",AF:"AFN",AG:"XCD",AI:"XCD",AL:"ALL",AM:"AMD",AO:"AOA",AR:"ARS",AS:"USD",AT:"EUR",AU:"AUD",AW:"AWG",AX:"EUR",AZ:"AZN",BA:"BAM",BB:"BBD",BD:"BDT",BE:"EUR",BF:"XOF",BG:"BGN",BH:"BHD",BI:"BIF",BJ:"XOF",BL:"EUR",BM:"BMD",BN:"BND",BO:"BOB",BQ:"USD",BR:"BRL",BS:"BSD",BT:"BTN",BV:"NOK",BW:"BWP",BY:"BYN",BZ:"BZD",CA:"CAD",CC:"AUD",CD:"CDF",CF:"XAF",CG:"XAF",CH:"CHF",CI:"XOF",CK:"NZD",CL:"CLP",CM:"XAF",CN:"CNY",CO:"COP",CR:"CRC",CU:"CUP",CV:"CVE",CW:"ANG",CX:"AUD",CY:"EUR",CZ:"CZK",DE:"EUR",DJ:"DJF",DK:"DKK",DM:"XCD",DO:"DOP",DZ:"DZD",EC:"USD",EE:"EUR",EG:"EGP",EH:"MAD",ER:"ERN",ES:"EUR",ET:"ETB",FI:"EUR",FJ:"FJD",FK:"FKP",FM:"USD",FO:"DKK",FR:"EUR",GA:"XAF",GB:"GBP",GD:"XCD",GE:"GEL",GF:"EUR",GG:"GBP",GH:"GHS",GI:"GIP",GL:"DKK",GM:"GMD",GN:"GNF",GP:"EUR",GQ:"XAF",GR:"EUR",GS:"GBP",GT:"GTQ",GU:"USD",GW:"XOF",GY:"GYD",HK:"HKD",HM:"AUD",HN:"HNL",HR:"EUR",HT:"HTG",HU:"HUF",ID:"IDR",IE:"EUR",IL:"ILS",IM:"GBP",IN:"INR",IO:"USD",IQ:"IQD",IR:"IRR",IS:"ISK",IT:"EUR",JE:"GBP",JM:"JMD",JO:"JOD",JP:"JPY",KE:"KES",KG:"KGS",KH:"KHR",KI:"AUD",KM:"KMF",KN:"XCD",KP:"KPW",KR:"KRW",KW:"KWD",KY:"KYD",KZ:"KZT",LA:"LAK",LB:"LBP",LC:"XCD",LI:"CHF",LK:"LKR",LR:"LRD",LS:"LSL",LT:"EUR",LU:"EUR",LV:"EUR",LY:"LYD",MA:"MAD",MC:"EUR",MD:"MDL",ME:"EUR",MF:"EUR",MG:"MGA",MH:"USD",MK:"MKD",ML:"XOF",MM:"MMK",MN:"MNT",MO:"MOP",MP:"USD",MQ:"EUR",MR:"MRU",MS:"XCD",MT:"EUR",MU:"MUR",MV:"MVR",MW:"MWK",MX:"MXN",MY:"MYR",MZ:"MZN",NA:"NAD",NC:"XPF",NE:"XOF",NF:"AUD",NG:"NGN",NI:"NIO",NL:"EUR",NO:"NOK",NP:"NPR",NR:"AUD",NU:"NZD",NZ:"NZD",OM:"OMR",PA:"PAB",PE:"PEN",PF:"XPF",PG:"PGK",PH:"PHP",PK:"PKR",PL:"PLN",PM:"EUR",PN:"NZD",PR:"USD",PS:"ILS",PT:"EUR",PW:"USD",PY:"PYG",QA:"QAR",RE:"EUR",RO:"RON",RS:"RSD",RU:"RUB",RW:"RWF",SA:"SAR",SB:"SBD",SC:"SCR",SD:"SDG",SE:"SEK",SG:"SGD",SH:"SHP",SI:"EUR",SJ:"NOK",SK:"EUR",SL:"SLE",SM:"EUR",SN:"XOF",SO:"SOS",SR:"SRD",SS:"SSP",ST:"STN",SV:"USD",SX:"ANG",SY:"SYP",SZ:"SZL",TC:"USD",TD:"XAF",TF:"EUR",TG:"XOF",TH:"THB",TJ:"TJS",TK:"NZD",TL:"USD",TM:"TMT",TN:"TND",TO:"TOP",TR:"TRY",TT:"TTD",TV:"AUD",TW:"TWD",TZ:"TZS",UA:"UAH",UG:"UGX",US:"USD",UY:"UYU",UZ:"UZS",VA:"EUR",VC:"XCD",VE:"VES",VG:"USD",VI:"USD",VN:"VND",VU:"VUV",WF:"XPF",WS:"WST",YE:"YER",YT:"EUR",ZA:"ZAR",ZM:"ZMW",ZW:"ZWL"},L=({country:e,pricingCurrencySettings:t,fallbackCurrency:i})=>{const n=(e=>{if(e)return T[e]})(e),o=(null==t?void 0:t.pricing_currencies)??[];return n&&o.includes(n)?n:(null==t?void 0:t.default_pricing_currency)??i??n},j=["email","country"],z={US:["addressLine1","postalCode"],CA:["state"]};function O({initialState:i,onRequiredFieldChange:n}){const o=e.ref($(i)),a=e.ref($(i)),u=e.computed(()=>{return(e=o.value.country)&&z[e]?[...z[e],...j]:j;var e}),d=e=>u.value.includes(e),s=t.useValidation({email:{required:r.required,email:r.email},country:{required:r.required},state:{required:r.requiredIf(()=>d("state"))},addressLine1:{required:r.requiredIf(()=>d("addressLine1"))},postalCode:{required:r.requiredIf(()=>d("postalCode"))},companyLegalName:r.requiredIf("ORGANIZATION"===o.value.type),companyVatNumber:{taxId:P}},o),p=e=>{e||fetch("https://api.country.is/").then(e=>e.json()).then(({country:e})=>{o.value.country=e})};return e.onMounted(async()=>{await p(null==i?void 0:i.country)}),l.watchDebounced(()=>c.cloneDeep(o.value),(e,i)=>{const o=t.objectDiff({from:i,to:e}),a=Object.keys(o).find(U);a&&(["type","companyVatNumber"].includes(a)?n(e):"seatsValues"!==a&&"enabledPricingIds"!==a?"email"!==a&&d(a)&&n(e):n(e))},{debounce:200}),{form:o,validation:s,getIsFieldRequired:d,updateInitialState:e=>{const t=$({...o.value,...e});o.value=t,a.value=c.cloneDeep(t)},initialState:a}}const $=(e={})=>({email:void 0,country:void 0,type:"INDIVIDUAL",companyLegalName:void 0,firstName:void 0,infix:void 0,lastName:void 0,addressLine1:void 0,addressLine2:void 0,postalCode:void 0,city:void 0,state:void 0,companyVatNumber:void 0,seatsValues:void 0,enabledPricingIds:void 0,...e});function U(e){return e in $()}function R(e){return e.pricing_plan_schedule_infos.flatMap(e=>{var t;return(null==(t=e.pricing_plan_version.pricing_categories)?void 0:t.flatMap(e=>e.pricing_groups??[]))??[]})}function F(e){var t,i;return function(e){if(null==e)return!0;if(n.isArrayLike(e)&&(n.isArray(e)||"string"==typeof e||"function"==typeof e.splice||n.isBuffer(e)||n.isTypedArray(e)||n.isArguments(e)))return!e.length;var t=n.getTag(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(n.isPrototype(e))return!n.baseKeys(e).length;for(var i in e)if(y.call(e,i))return!1;return!0}(e.name)?null==(i=null==(t=e.products)?void 0:t[0])?void 0:i.name:e.name}function G(e,t=void 0){const i=t??[],n=R(e);for(const o of n)if(["EXACTLY_ONE","AT_LEAST_ONE"].includes(o.selection_constraint)){const e=o.pricings.map(e=>e.id);if(null==t?void 0:t.some(t=>e.includes(t)))continue;i.push(o.pricings[0].id)}return i}function Y({initialCountry:r,initialEmail:c,subscriptionId:s,enabledPricingIds:p}){const m=e.ref(!1),g=e.ref(),{getSubscription:f}=i.createSubscriptionsService(),v=(()=>{const{getInvoicePreview:i}=a.createInvoicesService(),r=e.ref(),l=e.ref(),c=e.ref(),u=e.ref({}),d=e.ref(n.ApiStatus.Initial),s=e.ref({}),p=e.ref(),m=e=>`${e.type}:${e.value}`;return{loadInvoicePreview:async({subscription:e,subscriptionStartAt:a,checkoutForm:g,enabledPricingIds:f,promotionCode:v})=>{var y,_,h,b,M;const N={...g.addressLine1&&{line1:g.addressLine1},...g.addressLine2&&{line2:g.addressLine2},...g.city&&{city:g.city},...g.state&&{state:g.state},...g.country?{country:g.country||"NL"}:{country:"NL"},...g.postalCode&&{postal_code:g.postalCode}};d.value=n.ApiStatus.Loading;const I=S({pricingPlanScheduleInfos:e.pricing_plan_schedule_infos,type:"DEFAULT"}),k=null==(y=null==I?void 0:I.pricing_plan_version)?void 0:y.pricing_currency_settings,C=((null==(_=null==k?void 0:k.pricing_currencies)?void 0:_.length)??0)>1,x=(null==(b=null==(h=null==I?void 0:I.pricing_plan_version)?void 0:h.billing_period_settings)?void 0:b.billing_periods)??[],E=x.length>1,D=x.length>0?x.map(({period:e})=>e):e.billing_period?[e.billing_period]:[],A=L({country:g.country,pricingCurrencySettings:k,fallbackCurrency:e.billing_currency});if(!D.length)return void(d.value=n.ApiStatus.Done);const w=e.billing_period?m(e.billing_period):m(D[0]),B=D.map(async t=>{var n;const r=m(t),l=V({enabledPricings:null==f?void 0:f.map(e=>({pricing_id:e})),seatsValues:g.seatsValues,pricingPlanScheduleInfos:e.pricing_plan_schedule_infos,pricingCurrency:C?A:void 0,billingPeriod:E?t:void 0})??[];if(v){const t=null==(n=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"DEFAULT"===e.type))?void 0:n.id;if(t){const e=l.find(({pricing_plan_schedule_id:e})=>e===t);e?e.promotion_codes=[v]:l.push({pricing_plan_schedule_id:t,promotion_codes:[v]})}}const c={pricingPlanSubscriptionId:e.id,startAt:a,customizations:l,customer:{type:g.type||"INDIVIDUAL",..."INDIVIDUAL"===g.type&&{individual:{residential_address:N}},..."ORGANIZATION"===g.type&&{organization:{legal_name:g.companyLegalName||"preview",registered_address:N,...g.companyVatNumber&&{tax_id:P.$validator(g.companyVatNumber,{},{})?g.companyVatNumber:void 0}}}}},u=s.value[r];return u&&o.lodashExports.isEqual(c,u)?{periodKey:r,response:void 0}:(s.value={...s.value,[r]:c},{periodKey:r,response:await i(c)})});try{const i={...u.value},n=await Promise.all(B),o=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"TRIAL"===e.type),a=null==(M=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"DEFAULT"===e.type))?void 0:M.id;n.forEach(({periodKey:e,response:n})=>{var c;if(!n)return;p.value=null==(c=n.invoice_infos.at(-1))?void 0:c.pricing_plan_schedule_id,o&&(l.value=n.first_invoice,o.start_at&&o.end_at&&(r.value=t.convertDateRangeToTimePeriod(new Date(o.start_at),new Date(o.end_at))));const u=n.invoice_infos.find(({pricing_plan_schedule_id:e})=>e===a),d=null==u?void 0:u.invoices[0];d&&(i[e]=d)}),u.value=i,c.value=i[w]}catch(T){throw d.value=n.ApiStatus.Failed,T}finally{d.value=n.ApiStatus.Done}},invoicePreview:c,invoicePreviewByBillingPeriod:u,trialInvoicePreview:l,trialPeriod:r,lastPreviewScheduleId:p,isPending:e.computed(()=>d.value===n.ApiStatus.Loading)}})(),y=e.computed(()=>g.value&&N.form.value.country&&k.value),{paymentMethodOptions:_,loadPaymentMethodOptions:h,isPending:b}=(()=>{const t=e.ref(),{getPaymentMethodOptions:i}=u.createPaymentMethodsService(),{data:n,execute:a,isPending:r}=d.useService({initialValue:[],service:i});return{loadPaymentMethodOptions:async({subscriptionId:e,country:i,amount:n})=>{const r={subscriptionId:e,country:i,amount:n};o.lodashExports.isEqual(r,t.value)||(t.value=r,await a(r))},paymentMethodOptions:n,isPending:r}})(),M=()=>{const e={subscription:g.value,checkoutForm:N.form.value,enabledPricingIds:p,promotionCode:N.form.value.promotionCode};return N.form.value.enabledPricingIds&&(e.enabledPricingIds=N.form.value.enabledPricingIds),v.loadInvoicePreview(e)},N=O({initialState:{country:r,email:c},onRequiredFieldChange:()=>{g.value&&M().catch(()=>{})}}),I=e.computed(()=>{var e,t,i,n,o,a,r,l,c;const u=N.form.value.firstName||N.form.value.infix||N.form.value.lastName?{...N.form.value.firstName?{first_name:N.form.value.firstName}:{},...N.form.value.infix?{infix:N.form.value.infix}:{},...N.form.value.lastName?{last_name:N.form.value.lastName}:{}}:{},d={...N.form.value.addressLine1&&{line1:N.form.value.addressLine1},...N.form.value.addressLine2&&{line2:N.form.value.addressLine2},...N.form.value.city&&{city:N.form.value.city},...N.form.value.postalCode&&{postal_code:N.form.value.postalCode},...N.form.value.state&&{state:N.form.value.state},country:N.form.value.country??""},p=S({pricingPlanScheduleInfos:(null==(e=g.value)?void 0:e.pricing_plan_schedule_infos)??[],type:"DEFAULT"}),m=null==(t=null==p?void 0:p.pricing_plan_version)?void 0:t.pricing_currency_settings,f=((null==(i=null==m?void 0:m.pricing_currencies)?void 0:i.length)??0)>1,v=((null==(o=null==(n=null==p?void 0:p.pricing_plan_version)?void 0:n.billing_period_settings)?void 0:o.billing_periods)??[]).length>1,y=V({enabledPricings:null==(a=N.form.value.enabledPricingIds)?void 0:a.map(e=>({pricing_id:e})),seatsValues:N.form.value.seatsValues,pricingPlanScheduleInfos:(null==(r=g.value)?void 0:r.pricing_plan_schedule_infos)??[],pricingCurrency:f?null==(l=g.value)?void 0:l.billing_currency:void 0,billingPeriod:v?null==(c=g.value)?void 0:c.billing_period:void 0}),_=N.form.value.promotionCode,h=_&&g.value?(()=>{var e,t,i;const n=y?[...y]:[],o=(null==(e=n[0])?void 0:e.pricing_plan_schedule_id)??(null==(i=S({pricingPlanScheduleInfos:(null==(t=g.value)?void 0:t.pricing_plan_schedule_infos)??[],type:"DEFAULT"}))?void 0:i.id);if(!o)return y;const a=n.find(({pricing_plan_schedule_id:e})=>e===o);if(a)a.promotion_codes=[_];else{const e=null==y?void 0:y[0];n.push({pricing_plan_schedule_id:o,...(null==e?void 0:e.enabled_pricings)&&{enabled_pricings:e.enabled_pricings},...(null==e?void 0:e.seats_values)&&{seats_values:e.seats_values},promotion_codes:[_]})}return n})():y;return{type:"INIT_PRICING_PLAN_SUBSCRIPTION",init_pricing_plan_subscription:{template_pricing_plan_subscription_id:s,...h&&{pricing_plan_schedule_customizations:h},customer_details:{email:N.form.value.email??"",type:N.form.value.type,..."INDIVIDUAL"===N.form.value.type?{individual:{residential_address:d,...u?{name:u}:{}}}:{organization:{registered_address:d,legal_name:N.form.value.companyLegalName??"",...N.form.value.companyVatNumber&&P.$validator(N.form.value.companyVatNumber,{},{})?{tax_ids:[{id:N.form.value.companyVatNumber,type:"GENERIC_TAX_ID"}]}:{}}}}}}}),k=e.computed(()=>{var e,t;return(null==(e=v.trialInvoicePreview.value)?void 0:e.invoice_amount_including_tax)??(null==(t=v.invoicePreview.value)?void 0:t.invoice_amount_including_tax)});return e.watch([()=>N.form.value.country,k],([e,t])=>{g.value&&e&&t&&h({subscriptionId:g.value.id,country:e,amount:t})}),e.onMounted(async()=>{await(async()=>{var e,t,i,n,o,a;const r=await f({id:s,expanded:!0}),l=S({pricingPlanScheduleInfos:r.pricing_plan_schedule_infos,type:"DEFAULT"}),c=null==(n=null==(i=null==(t=null==(e=null==l?void 0:l.pricing_plan_version)?void 0:e.billing_period_settings)?void 0:t.billing_periods)?void 0:i[0])?void 0:n.period;g.value={...r,billing_period:c??r.billing_period},N.updateInitialState({...N.form.value,enabledPricingIds:G(r,p),...(null==(o=null==l?void 0:l.pricing_plan_schedule)?void 0:o.seats_values)?{seatsValues:null==(a=null==l?void 0:l.pricing_plan_schedule)?void 0:a.seats_values.map(({pricing_item_config_id:e,number:t})=>({pricing_item_config_id:e,number:t}))}:{}})})();try{await M()}catch{}}),l.watchOnce(y,e=>{e&&h({subscriptionId:g.value.id,country:N.form.value.country,amount:k.value})}),{invoicePreview:v.invoicePreview,invoicePreviewByBillingPeriod:v.invoicePreviewByBillingPeriod,trialInvoicePreview:v.trialInvoicePreview,trialPeriod:v.trialPeriod,loadInvoicePreview:M,updateInvoicePreviewOnBillingInformationChange:async e=>{const t=e.promotionCode??N.form.value.promotionCode,i=e.enabledPricingIds??N.form.value.enabledPricingIds;return await v.loadInvoicePreview({subscription:g.value,checkoutForm:{...N.form.value,...e},enabledPricingIds:i,promotionCode:t}),{trialInvoicePreview:v.trialInvoicePreview.value,invoicePreview:v.invoicePreview.value}},lastPreviewScheduleId:v.lastPreviewScheduleId,paymentMethodOptions:_,isPaymentMethodsPending:b,isInvoicePreviewPending:v.isPending,subscription:g,checkoutForm:N,authorizationContext:I,isPaid:m,amount:k}}const K={class:"grid grid-cols-1 gap-1"},q={class:"grid grid-cols-1 gap-2"},H={key:0},Q={class:"mt-2 flex flex-col gap-3"},Z={class:"grid grid-cols-3 gap-2"},X={class:"flex grow flex-col"},W={key:0},J={class:"mt-4 grid grid-cols-1 gap-3"},ee=e.defineComponent({__name:"CheckoutForm",props:e.mergeModels({validation:{type:null},initialState:{type:Object},readOnlyEmail:{type:String},showCustomerInfoOnTop:{type:Boolean},isBillingInformationMandatory:{type:Boolean},getIsFieldRequired:{type:Function},readOnly:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["submit"],["update:modelValue"]),setup(i){const n=i,o=e.ref(!1),a=e.useModel(i,"modelValue"),r=e.computed({get:()=>"ORGANIZATION"===a.value.type,set:e=>{a.value.type=e?"ORGANIZATION":"INDIVIDUAL"}}),l=e.computed(()=>"ORGANIZATION"===a.value.type),c=e.computed(()=>"US"!==a.value.country),{$t:u}=t.useIntl(),d=e=>n.getIsFieldRequired(e)?"":" "+u({defaultMessage:"(optional)",id:"checkout.optional_suffix.label",description:"The suffix for optional fields in the checkout form"}),s=e.computed(()=>a.value.country?t.getCountryNameByCode(a.value.country):void 0);return(n,p)=>(e.openBlock(),e.createElementBlock("form",{id:"checkout-form",onSubmit:p[12]||(p[12]=e.withModifiers(e=>n.$emit("submit",a.value),["prevent"]))},[e.createElementVNode("div",K,[e.createVNode(e.unref(t._sfc_main$1g),{title:e.unref(u)({defaultMessage:"Customer information",id:"checkout.contact_information_block.title",description:"The title of the contact information block in the checkout form"})},{default:e.withCtx(()=>[e.createElementVNode("div",q,[i.readOnly?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(t._sfc_main$2),{variant:"body",tag:"span",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.value.email),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",tag:"span",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value),1)]),_:1})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.email,"onUpdate:modelValue":p[0]||(p[0]=e=>a.value.email=e),required:"",type:"email",name:"email",disabled:!!i.readOnlyEmail,label:e.unref(u)({defaultMessage:"Email address",id:"checkout.email_address.label",description:"The email address of the customer in the checkout form"}),placeholder:e.unref(u)({defaultMessage:"Email address...",id:"checkout.email_address.placeholder",description:"The email address of the customer in the checkout form"})+d("email"),error:i.validation.value.email.$errors},null,8,["modelValue","disabled","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$1$),{"single-model-value":a.value.country,"onUpdate:singleModelValue":p[3]||(p[3]=e=>a.value.country=e),required:"",name:"country",label:e.unref(u)({defaultMessage:"Billing country",id:"checkout.country.label",description:"The country of the customer in the checkout form"})+d("country"),error:i.validation.value.country.$errors},{"label-suffix":e.withCtx(()=>[o.value||i.isBillingInformationMandatory?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,size:"xs",variant:"ghost","icon-prefix":"add",class:"py-0.5",onClick:p[1]||(p[1]=e=>o.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"More billing details",description:"Label of the button in the checkout that lets you fill out all billing details",id:"checkout.billing_details.add_billing_details_button.label"})),1)]),_:1})),o.value&&!i.isBillingInformationMandatory?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:1,size:"sm",variant:"ghost","icon-prefix":"close",class:"py-0.5",onClick:p[2]||(p[2]=e=>o.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"Remove billing details",id:"checkout.billing_details.remove_billing_details_button.label",description:"Label of the button in the checkout that lets you remove the billing details"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["single-model-value","label","error"])],64))]),e.createVNode(e.unref(t._sfc_main$2j),null,{default:e.withCtx(()=>[o.value||i.isBillingInformationMandatory?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",Q,[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.addressLine1,"onUpdate:modelValue":p[4]||(p[4]=e=>a.value.addressLine1=e),name:"address_line_1",label:e.unref(u)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(u)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"})+d("addressLine1"),required:"",error:i.validation.value.addressLine1.$errors},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.addressLine2,"onUpdate:modelValue":p[5]||(p[5]=e=>a.value.addressLine2=e),name:"address_line_2",placeholder:e.unref(u)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"})+d("addressLine2")},null,8,["modelValue","placeholder"]),e.createElementVNode("div",Z,[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.postalCode,"onUpdate:modelValue":p[6]||(p[6]=e=>a.value.postalCode=e),name:"postal_code",placeholder:e.unref(u)({defaultMessage:"Postal code...",id:"checkout.address.portal_code.placeholder",description:"Postal code of the customer address in the checkout form"})+d("postalCode"),error:i.validation.value.addressLine1.$errors},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.city,"onUpdate:modelValue":p[7]||(p[7]=e=>a.value.city=e),name:"city",placeholder:e.unref(u)({defaultMessage:"City...",id:"checkout.address.city.placeholder",description:"City of the customer address in the checkout form"})+d("city")},null,8,["modelValue","placeholder"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.state,"onUpdate:modelValue":p[8]||(p[8]=e=>a.value.state=e),name:"state",placeholder:e.unref(u)({defaultMessage:"State...",id:"checkout.address.state.placeholder",description:"State of the customer address in the checkout form"})+d("state"),error:i.validation.value.state.$errors},null,8,["modelValue","placeholder","error"])])])])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"]),i.readOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$20),{modelValue:r.value,"onUpdate:modelValue":p[9]||(p[9]=e=>r.value=e),"no-spacing":"","label-position":"before",class:"!flex"},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",X,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"Company purchase",id:"checkout.company_purchase_toggle.title",description:"The title of the company purchase toggle in the checkout"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"I am purchasing on behalf of a company",id:"checkout.company_purchase_toggle.sub_title",description:"The subtitle of the company purchase toggle in the checkout"})),1)]),_:1})])]),_:1},8,["modelValue"]),e.createVNode(e.unref(t._sfc_main$2j),null,{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",J,[c.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2a),{key:0,modelValue:a.value.companyVatNumber,"onUpdate:modelValue":p[10]||(p[10]=e=>a.value.companyVatNumber=e),name:"vat_number",label:e.unref(u)({defaultMessage:"VAT number",id:"checkout.vat_number.label",description:"The label for the vat number in the checkout form"}),placeholder:e.unref(u)({defaultMessage:"VAT number...",id:"checkout.vat_number.placeholder",description:"The label for the vat number in the checkout form"}),error:i.validation.value.companyVatNumber.$errors},null,8,["modelValue","label","placeholder","error"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.companyLegalName,"onUpdate:modelValue":p[11]||(p[11]=e=>a.value.companyLegalName=e),required:"",name:"legal_name",label:e.unref(u)({defaultMessage:"Legal entity name",id:"checkout.legal_name.label",description:"The legal name of the organization customer in the checkout form"}),placeholder:e.unref(u)({defaultMessage:"Legal entity name...",id:"checkout.legal_name.placeholder",description:"The legal name of the organization customer in the checkout form"})},null,8,["modelValue","label","placeholder"])])])):e.createCommentVNode("",!0)]),_:1})]),_:1}))])],32))}}),te={key:0,class:"flex items-center"},ie=["innerHTML"],ne=["innerHTML"],oe=e.defineComponent({__name:"CheckoutTitle",props:{trialPeriod:{type:Object},subscriptionName:{type:String},amount:{type:Object},billingPeriod:{type:Object},countryCode:{type:null},trialStartDate:{type:Date},subscriptionStartDate:{type:Date}},setup(i){const{$t:n}=t.useIntl();return(o,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-1",class:"inline-block"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.trialStartDate?i.subscriptionName:e.unref(n)({defaultMessage:"Pay and subscribe",id:"checkout.page_title",description:"The title of the checkout page"}))+e.toDisplayString(" "),1),i.trialPeriod?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$15),{key:0,"trial-period":i.trialPeriod,size:"lg",class:"-translate-y-0.5"},null,8,["trial-period"])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[i.countryCode?(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:i.trialStartDate?e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting {startDate, date, long}.",id:"checkout.trial_period_description",description:"The description of the trial period"},{price:e.unref(t.formatAmount)(i.amount),startDate:i.subscriptionStartDate,period_name:e.unref(t.formatBillingPeriod)(i.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:e=>`<strong>${e}</strong>`}):e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting today.",id:"checkout.subscription_description",description:"The description of the subscription"},{price:e.unref(t.formatAmount)(i.amount),period_name:e.unref(t.formatBillingPeriod)(i.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:e=>`<strong>${e}</strong>`})},null,8,ne)):(e.openBlock(),e.createElementBlock("span",te,[e.createVNode(e.unref(t._sfc_main$2e),{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(e.unref(t.TooltipContent),null,{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$1s),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Will be determined by billing information",description:"Tooltip content for the invoice preview when taxes are not determined by billing information",id:"invoice_preview.taxes_not_determined_by_billing_information_tooltip"})),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$14),{"width-class":"w-10","height-class":"h-4",shade:"darker",class:"inline-block mr-1.5"})]),_:1}),e.createElementVNode("span",{innerHTML:i.trialStartDate?e.unref(n)({defaultMessage:"per {period_name} starting, {startDate, date, long}",id:"checkout.trial_period_description",description:"The description of the trial period"},{startDate:i.subscriptionStartDate,period_name:e.unref(t.formatBillingPeriod)(i.billingPeriod,{short:!0,hideValueForExactPeriods:!0})}):e.unref(n)({defaultMessage:"per {period_name}, starting today",id:"checkout.subscription_description",description:"The description of the subscription"},{period_name:e.unref(t.formatBillingPeriod)(i.billingPeriod,{short:!0,hideValueForExactPeriods:!0})})},null,8,ie)]))]),_:1})],64))}}),ae={class:"flex w-full min-h-96 justify-center items-center"},re={class:"max-w-sm"},le=e.defineComponent({__name:"CheckoutNotAvailable",setup(i){const{$t:n}=t.useIntl(),o=()=>{window.location.reload()};return(i,a)=>(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",re,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Checkout not available",id:"checkout.not_available.title",description:"The title of the checkout not available page"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"The checkout is currently not available.",id:"checkout.not_available.description",description:"The description of the checkout not available page"}))+" ",1),e.createElementVNode("a",{href:"#",class:"text-primary-900 hover:underline",onClick:e.withModifiers(o,["prevent"])},e.toDisplayString(e.unref(n)({defaultMessage:"Reload",id:"checkout.not_available.reload_button",description:"The label of the reload button"})),1),e.createTextVNode(" "+e.toDisplayString(e.unref(n)({defaultMessage:"this page to try again, or contact customer support.",id:"checkout.not_available.contact_support_message",description:"The message shown when the user wants to contact customer support"})),1)]),_:1})])]))}}),ce=e.defineComponent({__name:"SubscriptionPaymentCompletedCard",props:{redirectUrl:{type:String}},setup(i){const n=i,{$t:a}=t.useIntl();return e.onMounted(()=>{n.redirectUrl&&window.location.replace(n.redirectUrl)}),(n,r)=>(e.openBlock(),e.createBlock(o._sfc_main$1,{status:"success",title:e.unref(a)({defaultMessage:"Payment successful",id:"subscription_payment_completed_card.title",description:"The title for when a payment has been successful"})},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-xs",shade:"lighter",tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Thank you for subscribing.",id:"subscription_payment_completed_card.thank_you_for_subscribing",description:"The text shown after a successful message before a redirect"})),1)]),_:1}),i.redirectUrl?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,to:i.redirectUrl,color:"gray",variant:"outline",size:"xs",class:"align-center"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Continue to merchant",id:"subscription_payment_completed_card.continue",description:"The text for the continue button"})),1)]),_:1},8,["to"])):e.createCommentVNode("",!0)]),_:1},8,["title"]))}}),ue={class:"flex flex-row gap-3 px-3 py-2"},de={class:"grow"},se=e.defineComponent({__name:"SubscriptionSummary",props:{subscription:{type:Object},invoice:{type:Object},loading:{type:Boolean},enabledPricingIds:{type:Array},avatar:{type:String},trialPeriod:{type:Object}},setup(i){const n=i,{$t:o}=t.useIntl(),a=e.computed(()=>{var e,t;return null==(t=null==(e=n.subscription.pricing_plan_schedule_infos)?void 0:e.at(-1))?void 0:t.pricing_plan_version.pricing_plan}),r=e.computed(()=>{var e;return(null==(e=a.value)?void 0:e.name)||n.subscription.name||o({defaultMessage:"Subscription",description:"The fallback name for when no subscription name can be determined",id:"customer_overview.subscriptions_block.fallback_subscription_name"})}),l=e.computed(()=>{var e;return n.subscription.description||(null==(e=a.value)?void 0:e.description)}),c=e.computed(()=>{if(!n.subscription||!n.enabledPricingIds)return;const e=function(e,t){const i=[];return function e(n){Array.isArray(n)?n.forEach(e):n&&"object"==typeof n&&("PRICING"===n.object_type&&t.includes(n.id)&&i.push(n),Object.values(n).forEach(e))}(e),i}(n.subscription,n.enabledPricingIds);return null==e?void 0:e.map(e=>{var t,i;return e.name??(null==(i=null==(t=e.products)?void 0:t[0])?void 0:i.name)}).join(" - ")});return(n,o)=>(e.openBlock(),e.createElementBlock("div",ue,[i.avatar?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2K),{key:0,"image-src":i.avatar,size:"lg",class:"my-1"},null,8,["image-src"])):e.createCommentVNode("",!0),e.createElementVNode("div",de,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1}),c.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:0,variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})):e.createCommentVNode("",!0),l.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" • ")],64)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])]))}}),pe={class:"grid grid-cols-1 gap-1"},me={class:"px-3 py-2"},ge={class:"flex flex-col gap-3"},fe={class:"px-3 py-2"},ve=e.defineComponent({__name:"OrderSummary",props:{subscription:{type:Object},invoice:{type:Object},invoicePreviewByBillingPeriod:{type:Object},trialInvoice:{type:Object},enabledPricingIds:{type:Array},trialPeriod:{type:Object},avatar:{type:String},isPaid:{type:Boolean},isUsageBased:{type:Boolean},isPreviewAndPaymentMethodsPending:{type:Boolean},collapsible:{type:String},noTitle:{type:Boolean},countryCode:{type:null},variant:{type:String}},emits:["billing-period-change"],setup(i,{emit:n}){const o=i,a=n,{$t:r}=t.useIntl(),{map:l,formatTimePeriod:c}=t.useTimePeriod(),u=m.useBreakpoints(m.breakpointsTailwind).smaller("md"),d=e.computed(()=>u.value?"sm":"xs"),s=e=>`${e.type}:${e.value}`,g=["DAY","WEEK","MONTH","YEAR"],f=e=>g.includes(e),v=e=>{if(!e)return;const[t,i]=e.split(":"),n=Number(i);return n&&f(t)?{type:t,value:n}:void 0},y=e.computed({get:()=>{const e=o.subscription.billing_period;return e?`${e.type}:${e.value}`:void 0},set:e=>{if(!e)return;const[t,i]=e.split(":"),n=Number(i);n&&f(t)&&a("billing-period-change",{type:t,value:n})}}),_=e=>{var i,n,a,l;const u=null==(l=null==(a=null==(n=null==(i=o.invoicePreviewByBillingPeriod)?void 0:i[s(e)])?void 0:n.periods)?void 0:a[0])?void 0:l.amount_including_tax;if(!u)return;const d="MONTH"===e.type&&3===e.value?r({defaultMessage:"/quarter",id:"checkout.order_summary_block.billing_period.per_quarter",description:"Period label for quarterly billing"}):r({defaultMessage:"/{period}",id:"checkout.order_summary_block.billing_period.per_label",description:"Period label for billing cycles"},{period:c(e,{prefix:!1,hideValueForExactPeriods:!0})});return r({defaultMessage:"{amount}{period}",id:"checkout.order_summary_block.billing_period.sub_label",description:"Billing period option sublabel showing price per period"},{amount:t.formatAmount(u),period:d})},h=e=>{var t,i,n,a;return null==(a=null==(n=null==(i=null==(t=o.invoicePreviewByBillingPeriod)?void 0:t[s(e)])?void 0:i.periods)?void 0:n[0])?void 0:a.amount_including_tax},b=e=>Number(e.quantity),M=(e,t)=>{if(!t)return;const i={DAY:365,WEEK:52,MONTH:12,YEAR:1}[e.type]/Math.max(e.value??1,1),n=b(t)*i;return Number.isFinite(n)?{quantity:n.toFixed(2),currency:t.currency}:void 0},N=(e,t)=>{if(!e||!t)return;const i=b(e)-b(t);return!Number.isFinite(i)||i<=0?void 0:{quantity:i.toFixed(2),currency:e.currency}},I=e=>{if(!e)return;return`${r({defaultMessage:"Save {amount}",id:"checkout.order_summary_block.billing_period.save_badge.prefix",description:"First line for the savings badge label"},{amount:t.formatAmount(e)})}${r({defaultMessage:"/year",id:"checkout.order_summary_block.billing_period.save_badge.suffix",description:"Second line for the savings badge label"})}`},k=e.computed(()=>{var e,t,i;const n=S({pricingPlanScheduleInfos:o.subscription.pricing_plan_schedule_infos??[],type:"DEFAULT"}),a=(null==(t=null==(e=null==n?void 0:n.pricing_plan_version)?void 0:e.billing_period_settings)?void 0:t.billing_periods)??[],r=new Map,l=e=>{e&&r.set(s(e),e)},c=e=>{var t;null==(t=null==e?void 0:e.items)||t.forEach(e=>{var t,i,n;null==(t=e.configs)||t.forEach(e=>l(e.billing_period)),null==(i=e.billing_period_configs)||i.forEach(e=>l(e.billing_period)),null==(n=e.pricing_currency_configs)||n.forEach(e=>{var t,i;null==(t=e.configs)||t.forEach(e=>l(e.billing_period)),null==(i=e.billing_period_configs)||i.forEach(e=>l(e.billing_period))})})};if(((null==(i=null==n?void 0:n.pricing_plan_version)?void 0:i.pricing_categories)??[]).forEach(e=>{var t,i;null==(t=e.pricings)||t.forEach(e=>c(e)),null==(i=e.pricing_groups)||i.forEach(e=>{var t;return null==(t=e.pricings)?void 0:t.forEach(e=>c(e))})}),!r.size)return[];const u=a.map(e=>r.get(s(e.period))).filter(e=>!!e),d=new Set(u.map(s)),p=[...r.values()].filter(e=>!d.has(s(e)));return[...u,...p]}),C=e.computed(()=>{const e=k.value[k.value.length-1],i=e?M(e,h(e)):void 0;return k.value.map(n=>{const o="MONTH"===n.type&&3===n.value?r({defaultMessage:"Billed quarterly",id:"checkout.order_summary_block.billing_period.quarterly",description:"Billing period option label for quarterly billing"}):r({defaultMessage:"Billed {period}",id:"checkout.order_summary_block.billing_period.label",description:"Billing period option label for the selected period"},{period:l.value[n.type].full}),a=h(n),c=M(n,a),u=e&&n.type===e.type&&n.value===e.value?void 0:N(c,i),s=I(u);return{label:o,subLabel:_(n),labelSuffixComponent:s?{component:t._sfc_main$3,props:{color:"primary",content:s,size:d.value,class:"whitespace-nowrap text-left leading-tight"}}:void 0,hidden:y.value===`${n.type}:${n.value}`,value:`${n.type}:${n.value}`}})}),x=e.computed(()=>{const e=C.value,t=e[0],i=e[e.length-1];return{smallestPeriod:null==t?void 0:t.value,biggestPeriod:null==i?void 0:i.value}}),E=e.computed(()=>C.value.find(e=>e.value===x.value.biggestPeriod)),D=e.computed(()=>C.value.find(e=>e.value===y.value)),A=e.computed(()=>{var e,t,i,n,a,r,l,c;const u=C.value,d=u[u.length-1],s=y.value;if(!d||!s)return"";if(s===d.value)return"";const p=v(d.value);if(!p)return"";const m=null==(n=null==(i=null==(t=null==(e=o.invoicePreviewByBillingPeriod)?void 0:e[d.value])?void 0:t.periods)?void 0:i[0])?void 0:n.amount_including_tax,g=v(s),f=null==(c=null==(l=null==(r=null==(a=o.invoicePreviewByBillingPeriod)?void 0:a[s])?void 0:r.periods)?void 0:l[0])?void 0:c.amount_including_tax;if(!g||!f)return"";const _=M(g,f),h=M(p,m);return I(N(_,h))??""}),w=e=>{const{smallestPeriod:t,biggestPeriod:i}=x.value;y.value=e?i:t};return(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-border":"","no-spacing":"","content-background":"none",title:i.noTitle?void 0:e.unref(r)({defaultMessage:"Order summary",id:"checkout.order_summary_block.title",description:"The title of the order summary block that lists the subscription cost in the checkout"})},{default:e.withCtx(()=>[e.createElementVNode("div",pe,[e.createVNode(e.unref(t._sfc_main$1g),{"no-spacing":""},{default:e.withCtx(()=>[i.subscription?(e.openBlock(),e.createBlock(se,{key:0,avatar:i.avatar,invoice:i.invoice,subscription:i.subscription,"enabled-pricing-ids":i.enabledPricingIds,loading:i.isPreviewAndPaymentMethodsPending,"trial-period":i.trialPeriod},null,8,["avatar","invoice","subscription","enabled-pricing-ids","loading","trial-period"])):e.createCommentVNode("",!0)]),_:1}),2===C.value.length?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:0,"no-spacing":"","content-classes":y.value===x.value.biggestPeriod?"border-primary-500":void 0},{default:e.withCtx(()=>{var i;return[e.createElementVNode("div",me,[e.createElementVNode("div",ge,[E.value?(e.openBlock(),e.createBlock(p._sfc_main,{key:0,name:E.value.label,description:(null==(i=D.value)?void 0:i.subLabel)??""},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$20),{"model-value":y.value===x.value.biggestPeriod,"show-suffix-label-in-input":"","onUpdate:modelValue":w},null,8,["model-value"])]),_:2},[A.value?{name:"badge",fn:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$3),{color:"primary",content:A.value,size:d.value,class:"whitespace-nowrap text-left leading-tight"},null,8,["content","size"])]),key:"0"}:void 0]),1032,["name","description"])):e.createCommentVNode("",!0)])])]}),_:1},8,["content-classes"])):C.value.length>2?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1T),{key:1,"single-model-value":y.value,"onUpdate:singleModelValue":o[0]||(o[0]=e=>y.value=e),options:C.value,size:"xl","has-large-dropdown":"","show-sub-label-in-input":"","show-suffix-in-closed-input":""},null,8,["single-model-value","options"])):e.createCommentVNode("",!0),i.isUsageBased?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:2,"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",fe,[e.createVNode(e.unref(t._sfc_main$2),{"no-spacing":"",variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"+ Usage",id:"checkout.invoice_preview.usage_based_message",description:"The message shown for the usage based invoice preview"})),1)]),_:1})])]),_:1})):e.createCommentVNode("",!0),i.invoice&&"products-inline"!==i.variant?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$a),{key:3,invoice:i.invoice,"wrapper-component":e.unref(t._sfc_main$1g)},null,8,["invoice","wrapper-component"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$1g),null,{default:e.withCtx(()=>[i.invoice?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$9),{key:0,variant:"products-inline"===i.variant?"default":"without-products",invoice:i.invoice,"trial-invoice":i.trialInvoice,"is-paid":i.isPaid,collapsible:i.collapsible,"is-preview-without-taxes":!i.countryCode,"is-customer-facing":""},null,8,["variant","invoice","trial-invoice","is-paid","collapsible","is-preview-without-taxes"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Please select a country first",description:"The message shown for the invoice preview when no country is set",id:"checkout.invoice_preview.no_country_selected_message"})),1)]),_:1}))]),_:1})])]),_:1},8,["title"]))}}),ye={class:"py-4 flex flex-col items-center justify-center"},_e=e.defineComponent({__name:"EmptyStatePlaceholder",props:{icon:{type:null}},setup:i=>(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),null,{default:e.withCtx(()=>[e.createElementVNode("div",ye,[e.createVNode(e.unref(t._sfc_main$4),{icon:i.icon,size:"lg",class:"text-gray-500"},null,8,["icon"]),e.createVNode(e.unref(t._sfc_main$2),{center:"",tag:"span",variant:"body-sm",weight:"semibold",shade:"lighter",class:"mt-2"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"title")]),_:3}),e.createVNode(e.unref(t._sfc_main$2),{center:"",tag:"span",variant:"body-xs",shade:"lightest",class:"mt-1"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"message")]),_:3})])]),_:3}))}),he={key:0,id:"svg-logo",viewBox:"0 0 35 15",class:"h-[44px]"},be={key:1,src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAxcHgiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAxMDEgMzIiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaW5ZTWluIG1lZXQiIHhtbG5zPSJodHRwOiYjeDJGOyYjeDJGO3d3dy53My5vcmcmI3gyRjsyMDAwJiN4MkY7c3ZnIj48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDEyLjIzNyAyLjggTCA0LjQzNyAyLjggQyAzLjkzNyAyLjggMy40MzcgMy4yIDMuMzM3IDMuNyBMIDAuMjM3IDIzLjcgQyAwLjEzNyAyNC4xIDAuNDM3IDI0LjQgMC44MzcgMjQuNCBMIDQuNTM3IDI0LjQgQyA1LjAzNyAyNC40IDUuNTM3IDI0IDUuNjM3IDIzLjUgTCA2LjQzNyAxOC4xIEMgNi41MzcgMTcuNiA2LjkzNyAxNy4yIDcuNTM3IDE3LjIgTCAxMC4wMzcgMTcuMiBDIDE1LjEzNyAxNy4yIDE4LjEzNyAxNC43IDE4LjkzNyA5LjggQyAxOS4yMzcgNy43IDE4LjkzNyA2IDE3LjkzNyA0LjggQyAxNi44MzcgMy41IDE0LjgzNyAyLjggMTIuMjM3IDIuOCBaIE0gMTMuMTM3IDEwLjEgQyAxMi43MzcgMTIuOSAxMC41MzcgMTIuOSA4LjUzNyAxMi45IEwgNy4zMzcgMTIuOSBMIDguMTM3IDcuNyBDIDguMTM3IDcuNCA4LjQzNyA3LjIgOC43MzcgNy4yIEwgOS4yMzcgNy4yIEMgMTAuNjM3IDcuMiAxMS45MzcgNy4yIDEyLjYzNyA4IEMgMTMuMTM3IDguNCAxMy4zMzcgOS4xIDEzLjEzNyAxMC4xIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDM1LjQzNyAxMCBMIDMxLjczNyAxMCBDIDMxLjQzNyAxMCAzMS4xMzcgMTAuMiAzMS4xMzcgMTAuNSBMIDMwLjkzNyAxMS41IEwgMzAuNjM3IDExLjEgQyAyOS44MzcgOS45IDI4LjAzNyA5LjUgMjYuMjM3IDkuNSBDIDIyLjEzNyA5LjUgMTguNjM3IDEyLjYgMTcuOTM3IDE3IEMgMTcuNTM3IDE5LjIgMTguMDM3IDIxLjMgMTkuMzM3IDIyLjcgQyAyMC40MzcgMjQgMjIuMTM3IDI0LjYgMjQuMDM3IDI0LjYgQyAyNy4zMzcgMjQuNiAyOS4yMzcgMjIuNSAyOS4yMzcgMjIuNSBMIDI5LjAzNyAyMy41IEMgMjguOTM3IDIzLjkgMjkuMjM3IDI0LjMgMjkuNjM3IDI0LjMgTCAzMy4wMzcgMjQuMyBDIDMzLjUzNyAyNC4zIDM0LjAzNyAyMy45IDM0LjEzNyAyMy40IEwgMzYuMTM3IDEwLjYgQyAzNi4yMzcgMTAuNCAzNS44MzcgMTAgMzUuNDM3IDEwIFogTSAzMC4zMzcgMTcuMiBDIDI5LjkzNyAxOS4zIDI4LjMzNyAyMC44IDI2LjEzNyAyMC44IEMgMjUuMDM3IDIwLjggMjQuMjM3IDIwLjUgMjMuNjM3IDE5LjggQyAyMy4wMzcgMTkuMSAyMi44MzcgMTguMiAyMy4wMzcgMTcuMiBDIDIzLjMzNyAxNS4xIDI1LjEzNyAxMy42IDI3LjIzNyAxMy42IEMgMjguMzM3IDEzLjYgMjkuMTM3IDE0IDI5LjczNyAxNC42IEMgMzAuMjM3IDE1LjMgMzAuNDM3IDE2LjIgMzAuMzM3IDE3LjIgWiI+PC9wYXRoPjxwYXRoIGZpbGw9IiMwMDMwODciIGQ9Ik0gNTUuMzM3IDEwIEwgNTEuNjM3IDEwIEMgNTEuMjM3IDEwIDUwLjkzNyAxMC4yIDUwLjczNyAxMC41IEwgNDUuNTM3IDE4LjEgTCA0My4zMzcgMTAuOCBDIDQzLjIzNyAxMC4zIDQyLjczNyAxMCA0Mi4zMzcgMTAgTCAzOC42MzcgMTAgQyAzOC4yMzcgMTAgMzcuODM3IDEwLjQgMzguMDM3IDEwLjkgTCA0Mi4xMzcgMjMgTCAzOC4yMzcgMjguNCBDIDM3LjkzNyAyOC44IDM4LjIzNyAyOS40IDM4LjczNyAyOS40IEwgNDIuNDM3IDI5LjQgQyA0Mi44MzcgMjkuNCA0My4xMzcgMjkuMiA0My4zMzcgMjguOSBMIDU1LjgzNyAxMC45IEMgNTYuMTM3IDEwLjYgNTUuODM3IDEwIDU1LjMzNyAxMCBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA2Ny43MzcgMi44IEwgNTkuOTM3IDIuOCBDIDU5LjQzNyAyLjggNTguOTM3IDMuMiA1OC44MzcgMy43IEwgNTUuNzM3IDIzLjYgQyA1NS42MzcgMjQgNTUuOTM3IDI0LjMgNTYuMzM3IDI0LjMgTCA2MC4zMzcgMjQuMyBDIDYwLjczNyAyNC4zIDYxLjAzNyAyNCA2MS4wMzcgMjMuNyBMIDYxLjkzNyAxOCBDIDYyLjAzNyAxNy41IDYyLjQzNyAxNy4xIDYzLjAzNyAxNy4xIEwgNjUuNTM3IDE3LjEgQyA3MC42MzcgMTcuMSA3My42MzcgMTQuNiA3NC40MzcgOS43IEMgNzQuNzM3IDcuNiA3NC40MzcgNS45IDczLjQzNyA0LjcgQyA3Mi4yMzcgMy41IDcwLjMzNyAyLjggNjcuNzM3IDIuOCBaIE0gNjguNjM3IDEwLjEgQyA2OC4yMzcgMTIuOSA2Ni4wMzcgMTIuOSA2NC4wMzcgMTIuOSBMIDYyLjgzNyAxMi45IEwgNjMuNjM3IDcuNyBDIDYzLjYzNyA3LjQgNjMuOTM3IDcuMiA2NC4yMzcgNy4yIEwgNjQuNzM3IDcuMiBDIDY2LjEzNyA3LjIgNjcuNDM3IDcuMiA2OC4xMzcgOCBDIDY4LjYzNyA4LjQgNjguNzM3IDkuMSA2OC42MzcgMTAuMSBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA5MC45MzcgMTAgTCA4Ny4yMzcgMTAgQyA4Ni45MzcgMTAgODYuNjM3IDEwLjIgODYuNjM3IDEwLjUgTCA4Ni40MzcgMTEuNSBMIDg2LjEzNyAxMS4xIEMgODUuMzM3IDkuOSA4My41MzcgOS41IDgxLjczNyA5LjUgQyA3Ny42MzcgOS41IDc0LjEzNyAxMi42IDczLjQzNyAxNyBDIDczLjAzNyAxOS4yIDczLjUzNyAyMS4zIDc0LjgzNyAyMi43IEMgNzUuOTM3IDI0IDc3LjYzNyAyNC42IDc5LjUzNyAyNC42IEMgODIuODM3IDI0LjYgODQuNzM3IDIyLjUgODQuNzM3IDIyLjUgTCA4NC41MzcgMjMuNSBDIDg0LjQzNyAyMy45IDg0LjczNyAyNC4zIDg1LjEzNyAyNC4zIEwgODguNTM3IDI0LjMgQyA4OS4wMzcgMjQuMyA4OS41MzcgMjMuOSA4OS42MzcgMjMuNCBMIDkxLjYzNyAxMC42IEMgOTEuNjM3IDEwLjQgOTEuMzM3IDEwIDkwLjkzNyAxMCBaIE0gODUuNzM3IDE3LjIgQyA4NS4zMzcgMTkuMyA4My43MzcgMjAuOCA4MS41MzcgMjAuOCBDIDgwLjQzNyAyMC44IDc5LjYzNyAyMC41IDc5LjAzNyAxOS44IEMgNzguNDM3IDE5LjEgNzguMjM3IDE4LjIgNzguNDM3IDE3LjIgQyA3OC43MzcgMTUuMSA4MC41MzcgMTMuNiA4Mi42MzcgMTMuNiBDIDgzLjczNyAxMy42IDg0LjUzNyAxNCA4NS4xMzcgMTQuNiBDIDg1LjczNyAxNS4zIDg1LjkzNyAxNi4yIDg1LjczNyAxNy4yIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDA5Y2RlIiBkPSJNIDk1LjMzNyAzLjMgTCA5Mi4xMzcgMjMuNiBDIDkyLjAzNyAyNCA5Mi4zMzcgMjQuMyA5Mi43MzcgMjQuMyBMIDk1LjkzNyAyNC4zIEMgOTYuNDM3IDI0LjMgOTYuOTM3IDIzLjkgOTcuMDM3IDIzLjQgTCAxMDAuMjM3IDMuNSBDIDEwMC4zMzcgMy4xIDEwMC4wMzcgMi44IDk5LjYzNyAyLjggTCA5Ni4wMzcgMi44IEMgOTUuNjM3IDIuOCA5NS40MzcgMyA5NS4zMzcgMy4zIFoiPjwvcGF0aD48L3N2Zz4",role:"presentation",class:"h-[22px]"},Me=e.defineComponent({__name:"ExpressPaymentMethodButton",props:{type:{type:String}},emits:["click"],setup(i,{emit:n}){const o=i,a=n,r=e.computed(()=>{switch(o.type){case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";default:return}}),l=e.computed(()=>{switch(o.type){case"applepay":return"!bg-black !py-0";case"googlepay":return"!bg-black bg-[url(https://www.gstatic.com/instantbuy/svg/dark_gpay.svg)] bg-[length:auto_42.5%]";case"paypal":return"!bg-[#ffc439]";default:return}});function c(){a("click")}return(i,n)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{size:"lg","aria-label":r.value,class:e.normalizeClass([l.value,"!block w-full h-11 bg-center bg-no-repeat"]),onClick:c},{default:e.withCtx(()=>["applepay"===o.type?(e.openBlock(),e.createElementBlock("svg",he,[...n[0]||(n[0]=[e.createElementVNode("svg",{id:"svg-logo",x:"0",y:"3.85",height:"7.3",width:"35",class:"logo",viewBox:"0 0 105 43",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createElementVNode("title",null,"Apple Logo"),e.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createElementVNode("g",{fill:"#FFF"},[e.createElementVNode("path",{d:"M19.4028,5.5674 C20.6008,4.0684 21.4138,2.0564 21.1998,0.0004 C19.4458,0.0874 17.3058,1.1574 16.0668,2.6564 C14.9538,3.9414 13.9688,6.0374 14.2258,8.0074 C16.1948,8.1784 18.1618,7.0244 19.4028,5.5674"}),e.createElementVNode("path",{d:"M21.1772,8.3926 C18.3182,8.2226 15.8872,10.0156 14.5212,10.0156 C13.1552,10.0156 11.0642,8.4786 8.8022,8.5196 C5.8592,8.5626 3.1282,10.2276 1.6342,12.8746 C-1.4378,18.1696 0.8232,26.0246 3.8112,30.3376 C5.2622,32.4716 7.0102,34.8206 9.3142,34.7366 C11.4912,34.6506 12.3442,33.3266 14.9902,33.3266 C17.6352,33.3266 18.4042,34.7366 20.7082,34.6936 C23.0972,34.6506 24.5922,32.5586 26.0422,30.4226 C27.7072,27.9906 28.3882,25.6426 28.4312,25.5126 C28.3882,25.4706 23.8232,23.7186 23.7812,18.4676 C23.7382,14.0706 27.3652,11.9786 27.5362,11.8496 C25.4882,8.8196 22.2872,8.4786 21.1772,8.3926"}),e.createElementVNode("path",{d:"M85.5508,43.0381 L85.5508,39.1991 C85.8628,39.2421 86.6158,39.2871 87.0158,39.2871 C89.2138,39.2871 90.4558,38.3551 91.2108,35.9581 L91.6548,34.5371 L83.2428,11.2321 L88.4368,11.2321 L94.2958,30.1421 L94.4068,30.1421 L100.2668,11.2321 L105.3278,11.2321 L96.6048,35.7141 C94.6078,41.3291 92.3208,43.1721 87.4828,43.1721 C87.1048,43.1721 85.8838,43.1271 85.5508,43.0381"}),e.createElementVNode("path",{d:"M42.6499,19.3555 L48.3549,19.3555 C52.6829,19.3555 55.1469,17.0255 55.1469,12.9855 C55.1469,8.9455 52.6829,6.6375 48.3769,6.6375 L42.6499,6.6375 L42.6499,19.3555 Z M49.6869,2.4425 C55.9009,2.4425 60.2289,6.7265 60.2289,12.9625 C60.2289,19.2225 55.8129,23.5285 49.5309,23.5285 L42.6499,23.5285 L42.6499,34.4705 L37.6779,34.4705 L37.6779,2.4425 L49.6869,2.4425 Z"}),e.createElementVNode("path",{d:"M76.5547,25.7705 L76.5547,23.9715 L71.0287,24.3275 C67.9207,24.5275 66.3007,25.6815 66.3007,27.7015 C66.3007,29.6545 67.9887,30.9195 70.6287,30.9195 C74.0027,30.9195 76.5547,28.7665 76.5547,25.7705 M61.4617,27.8345 C61.4617,23.7285 64.5917,21.3755 70.3627,21.0205 L76.5547,20.6425 L76.5547,18.8675 C76.5547,16.2705 74.8457,14.8495 71.8057,14.8495 C69.2967,14.8495 67.4777,16.1375 67.0997,18.1125 L62.6167,18.1125 C62.7497,13.9615 66.6567,10.9435 71.9387,10.9435 C77.6207,10.9435 81.3267,13.9175 81.3267,18.5345 L81.3267,34.4705 L76.7327,34.4705 L76.7327,30.6305 L76.6217,30.6305 C75.3127,33.1395 72.4267,34.7145 69.2967,34.7145 C64.6807,34.7145 61.4617,31.9625 61.4617,27.8345"})])])],-1)])])):"paypal"===o.type?(e.openBlock(),e.createElementBlock("img",be)):e.createCommentVNode("",!0)]),_:1},8,["aria-label","class"]))}}),Ne={class:"absolute h-[1px] w-[1px] overflow-hidden opacity-0"},Ie=e.defineComponent({__name:"ExpressPaymentMethodApplePay",props:{onBillingInformationChange:{type:Function},amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(i,{emit:n}){const a=i,r=n,l=e.ref(),c=o.useLogger(),{authorizePayment:u}=f.createPaymentsService(),d=a.paymentMethodOptionsResponse.payment_acceptor.id,s=e=>{if(!e.value)return;let t=e.value??1,i=e.type.toLowerCase();return"WEEK"===e.type&&(i="day",t=7*e.value),"day"===i||"month"===i||"year"===i||"hour"===i||"minute"===i?{recurringPaymentIntervalUnit:i,recurringPaymentIntervalCount:t}:void 0},p=e=>({postal_code:e.postalCode,city:e.locality,country:e.countryCode}),m=e=>({postal_code:e.postalCode,city:e.city,country:e.country}),g=e=>e&&v(e)?e:void 0,v=e=>t.isValidCountryCode(e),y=()=>{var e;const t=null==(e=l.value)?void 0:e.querySelector("apple-pay-button");if(t){const e=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(e)}};return e.onMounted(()=>{(async()=>{const{AdyenCheckout:e,ApplePay:t}=await Promise.resolve().then(()=>require("../../auto-PpnAChnH.js")),i=new t(await e(o.getAdyenExpressCheckoutConfiguration({amount:a.amount,locale:a.locale,countryCode:a.countryCode,paymentMethodOptionResponse:a.paymentMethodOptionsResponse})),{isExpress:!0,recurringPaymentRequest:{paymentDescription:a.billingInformation.description,billingAgreement:a.billingInformation.agreement,managementURL:"https://www.google.com",...a.billingInformation.trial&&{trialBilling:{label:a.billingInformation.trial.label,amount:a.billingInformation.trial.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:a.billingInformation.trial.startDate,recurringPaymentEndDate:a.billingInformation.trial.endDate}},...a.billingInformation.regular&&{regularBilling:{label:a.billingInformation.regular.label,amount:a.billingInformation.regular.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:a.billingInformation.regular.startDate,...s(a.billingInformation.regular.interval??{type:"MONTH",value:1})}}},requiredBillingContactFields:["postalAddress"],requiredShippingContactFields:["email"],onPaymentMethodSelected:async(e,t,i)=>{var n,o,l,c,u,d,s;const{invoicePreview:p,trialInvoicePreview:m}=await a.onBillingInformationChange({...(null==(n=i.paymentMethod.billingContact)?void 0:n.postalCode)&&{postal_code:i.paymentMethod.billingContact.postalCode},...(null==(o=i.paymentMethod.billingContact)?void 0:o.locality)&&{city:i.paymentMethod.billingContact.locality},...g(null==(l=i.paymentMethod.billingContact)?void 0:l.countryCode)&&{country:g(null==(c=i.paymentMethod.billingContact)?void 0:c.countryCode)}}),f=m?m.invoice_amount_including_tax.quantity.toString():p.invoice_amount_including_tax.quantity.toString();r("update-billing-information",{postal_code:null==(u=i.paymentMethod.billingContact)?void 0:u.postalCode,city:null==(d=i.paymentMethod.billingContact)?void 0:d.locality,country:null==(s=i.paymentMethod.billingContact)?void 0:s.countryCode}),e({newTotal:{label:a.billingInformation.regular.label,amount:f,type:"final"}})},onError:e=>{c.error("APPLE_PAY_ERROR","Apple Pay error",{error:e})},onAuthorized:async(e,t)=>{try{c.info("APPLE_PAY_AUTHORIZED","Apple Pay authorized",{data:e});const i=e.authorizedEvent;c.info("APPLE_PAY_EVENT_DATA","Apple Pay event data structure",{eventData:i,hasPaymentMethod:!!i.payment.token.paymentMethod,hasBrowserInfo:!!i.payment.token.paymentData,billingAddress:e.billingAddress});const n=i.payment.billingContact,l=e.billingAddress;n?r("update-billing-information",p(n)):l&&r("update-billing-information",m(l));const s={payment_method:o.transformObjectToAdyenObject(i.payment.token.paymentMethod),browser_info:o.transformObjectToAdyenObject(i.payment.token.paymentData)};c.info("APPLE_PAY_ADYEN_PAYLOAD","Adyen payload prepared",{adyen:s});const g=o.createReturnUrl({paymentAcceptorId:d,redirectUrl:window.location.href});c.info("APPLE_PAY_CALLING_API","Calling authorizePayment API",{paymentAcceptorId:d,amount:a.amount});const f=await u({payment_acceptor_id:d,payment_gateway_variant:"ADYEN",adyen:{...s,store_payment_method:!0},amount:a.amount,return_url:g});if(c.info("APPLE_PAY_API_RESPONSE","Payment API response received",{status:f.status,paymentResult:f}),"FAILURE"===f.status)return c.error("APPLE_PAY_AUTHORIZATION_FAILED","Payment authorization failed",{error:f}),void t.reject();if("ACTION_REQUIRED"===f.status)return c.warn("APPLE_PAY_ACTION_REQUIRED","Payment requires additional action",{action:f.action}),void t.reject();c.info("APPLE_PAY_SUCCESS","Apple Pay payment successful, resolving"),t.resolve()}catch(i){c.error("APPLE_PAY_AUTHORIZATION_FAILED","Apple Pay authorization failed",{error:i}),t.reject()}}});if(l.value)try{await i.isAvailable(),i.mount(l.value),r("ready")}catch(n){}})()}),(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[i.isVisible?(e.openBlock(),e.createBlock(Me,{key:0,type:"applepay",onClick:y})):e.createCommentVNode("",!0),e.createElementVNode("div",Ne,[e.createElementVNode("div",{ref_key:"applePayButtonRef",ref:l},null,512)])],64))}}),ke={class:"relative overflow-hidden"},Ce=e.defineComponent({__name:"ExpressPaymentMethodPaypal",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:i}){const n=t,a=i,r=e.ref(),l=o.useLogger();return e.onMounted(()=>{(async()=>{const{AdyenCheckout:e,PayPal:t}=await Promise.resolve().then(()=>require("../../auto-PpnAChnH.js")),i=new t(await e(o.getAdyenExpressCheckoutConfiguration({locale:n.locale,amount:n.amount,countryCode:n.countryCode,paymentMethodOptionResponse:n.paymentMethodOptionsResponse})),{isExpress:!0,blockPayPalPayLaterButton:!0,blockPayPalCreditButton:!0,blockPayPalVenmoButton:!0,style:{height:55},onInit:()=>{a("ready")}});if(r.value)try{await i.isAvailable(),i.mount(r.value)}catch(c){l.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","Failed mounting PayPal express button",{error:c})}else l.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","The PayPal button reference is not found and cannot be mounted")})()}),(i,n)=>(e.openBlock(),e.createElementBlock("div",ke,[t.isVisible?(e.openBlock(),e.createBlock(Me,{key:0,type:"paypal",class:"w-full"})):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"paypalButtonRef",ref:r,class:"absolute inset-0 opacity-[0.0001]"},null,512)]))}}),xe={class:"w-[1px] h-[1px] overflow-hidden opacity-0 absolute"},Ee=e.defineComponent({__name:"ExpressPaymentMethodGooglePay",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:i}){const n=t,a=i,r=e.ref(),l=o.useLogger(),c=()=>{var e;const t=null==(e=r.value)?void 0:e.querySelector("#gpay-button-online-api-id");if(t){const e=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(e)}};return e.onMounted(()=>{(async()=>{const{AdyenCheckout:e,GooglePay:t}=await Promise.resolve().then(()=>require("../../auto-PpnAChnH.js")),i=new t(await e(o.getAdyenExpressCheckoutConfiguration({locale:n.locale,amount:n.amount,countryCode:n.countryCode,paymentMethodOptionResponse:n.paymentMethodOptionsResponse})),{isExpress:!0});if(r.value)try{await i.isAvailable(),i.mount(r.value),a("ready")}catch(c){l.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","Failed mounting Google Pay express button",{error:c})}else l.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","The Google Pay button reference is not found and cannot be mounted")})()}),(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(Me,{key:0,type:"googlepay",onClick:c})):e.createCommentVNode("",!0),e.createElementVNode("div",xe,[e.createElementVNode("div",{ref_key:"googlePayButtonRef",ref:r},null,512)])],64))}}),De={key:0,class:"mt-4n"},Ae={class:"mb-2"},we={class:"grid grid-cols-6 gap-1 md:gap-2"},Pe={class:"h-4 mt-4"},Be=e.defineComponent({__name:"ExpressPaymentMethods",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},paymentMethodsOptionsResponse:{type:null},billingInformation:{type:Object},onBillingInformationChange:{type:Function}},emits:["update-billing-information"],setup(i){const n=["applepay"],o=i,{$t:a}=t.useIntl(),r=e.ref(!1),l=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var e;if(n.includes("applepay"))return null==(e=o.paymentMethodsOptionsResponse)?void 0:e.find(e=>{var t;return null==(t=e.options)?void 0:t.some(e=>"apple pay"===e.name.toLowerCase())})}),d=e.computed(()=>{var e;if(n.includes("paypal"))return null==(e=o.paymentMethodsOptionsResponse)?void 0:e.find(e=>{var t;return null==(t=e.options)?void 0:t.some(e=>"paypal"===e.name.toLowerCase())})}),s=e.computed(()=>{var e;if(n.includes("googlepay"))return null==(e=o.paymentMethodsOptionsResponse)?void 0:e.find(e=>{var t;return null==(t=e.options)?void 0:t.some(e=>"google pay"===e.name.toLowerCase())})}),p=e.computed(()=>!!(u.value||s.value||d.value)),m=e.computed(()=>{var e;if(0===(null==(e=o.paymentMethodsOptionsResponse)?void 0:e.length))return!1;const t=!u.value||r.value,i=!s.value||l.value,n=!d.value||c.value;return t&&i&&n}),f=e.computed(()=>m.value?(u.value?1:0)+(s.value?1:0)+(d.value?1:0):2);return(n,o)=>p.value?(e.openBlock(),e.createElementBlock("div",De,[e.createElementVNode("div",Ae,[m.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Subscribe instantly with",id:"checkout.express_payment_methods.title",description:"The title of the express payment methods block in the checkout form"})),1)]),_:1})):(e.openBlock(),e.createBlock(g._sfc_main,{key:0,variant:"title"}))]),e.createElementVNode("div",we,[m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(g._sfc_main,{class:"h-11 col-span-3"}),e.createVNode(g._sfc_main,{class:"h-11 col-span-3"})],64)),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!u.value,"!col-span-6":1===f.value,"md:!col-span-3":2===f.value,"!col-span-6 md:!col-span-2":3===f.value}])},[u.value?(e.openBlock(),e.createBlock(Ie,{key:0,amount:i.amount,"billing-information":i.billingInformation,"country-code":i.countryCode,locale:i.locale,"is-visible":m.value,"payment-method-options-response":u.value,"on-billing-information-change":i.onBillingInformationChange,onReady:o[0]||(o[0]=e=>r.value=!0),onUpdateBillingInformation:o[1]||(o[1]=e=>n.$emit("update-billing-information",e))},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response","on-billing-information-change"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!s.value,"col-span-6 md:col-span-6":1===f.value,"md:!col-span-3":2===f.value}])},[s.value?(e.openBlock(),e.createBlock(Ee,{key:0,amount:i.amount,"billing-information":i.billingInformation,"country-code":i.countryCode,locale:i.locale,"is-visible":m.value,"payment-method-options-response":s.value,onReady:o[2]||(o[2]=e=>l.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!d.value,"col-span-6 md:col-span-6":1===f.value,"md:!col-span-3":2===f.value}])},[d.value?(e.openBlock(),e.createBlock(Ce,{key:0,amount:i.amount,"billing-information":i.billingInformation,"country-code":i.countryCode,locale:i.locale,"is-visible":m.value,"payment-method-options-response":d.value,onReady:o[3]||(o[3]=e=>c.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2)]),e.createElementVNode("div",Pe,[m.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2q),{key:1,text:e.unref(a)({defaultMessage:"Or",id:"checkout.express_payment_methods.divider_text",description:"The text of the divider text in the express payment methods block in the checkout form"}),"text-position":"center"},null,8,["text"])):(e.openBlock(),e.createBlock(g._sfc_main,{key:0,variant:"divider-text"}))])])):e.createCommentVNode("",!0)}}),Se={class:"grid grid-cols-2 gap-2"},Ve=e.defineComponent({__name:"TieredTableRow",props:{band:{type:Object},previousBand:{type:Object},isFirst:{type:Boolean},period:{type:Object}},setup(i){const n=i,{$t:o}=t.useIntl(),{formatTimePeriod:a}=t.useTimePeriod(),r=e.computed(()=>{var e;return n.isFirst?"0":(null==(e=n.previousBand)?void 0:e.tier_top_bound)&&"number"in n.previousBand.tier_top_bound?n.previousBand.tier_top_bound.number:void 0}),l=e.computed(()=>{if(n.band.tier_top_bound&&"number"in n.band.tier_top_bound)return n.band.tier_top_bound.number});return(n,c)=>(e.openBlock(),e.createElementBlock("div",Se,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-xs",shade:"lighter",tag:"div"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"{lower_bound} - {upper_bound} seats",id:"seats.tiered_range_label",description:"The label showing the seat count range for a tiered pricing tier"},{lower_bound:r.value??"0",upper_bound:l.value})),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"> {lower_bound} seats",id:"seats.tiered_unbounded_range_label",description:"The label showing the unbounded seat count range (greater than) for a tiered pricing tier"},{lower_bound:r.value??"0"})),1)],64))]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-xs",shade:"lighter",tag:"div",class:"text-right"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.band.amount&&e.unref(o)({defaultMessage:"{amount} per seat/{period}",id:"seats.tiered_price_per_seat_period",description:"The price per seat and billing period label for a tiered pricing tier"},{amount:e.unref(t.formatAmount)(i.band.amount),period:i.period?e.unref(a)(i.period,{short:!0,hideValueForExactPeriods:!0}):""})),1)]),_:1})]))}}),Te={class:"grid grid-cols-1 gap-0.5 pt-1.5"},Le=e.defineComponent({__name:"TieredTable",props:{bands:{type:Array},period:{type:Object}},setup:t=>(i,n)=>(e.openBlock(),e.createElementBlock("div",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bands,(i,n)=>(e.openBlock(),e.createBlock(Ve,{key:n,band:i,"is-first":0===n,"previous-band":n>0?t.bands[n-1]:void 0,period:t.period},null,8,["band","is-first","previous-band","period"]))),128))]))});const je={class:"flex flex-row-reverse md:flex-row gap-4"},ze={class:"w-24 md:w-32 shrink-0 justify-start"},Oe=["tabindex"],$e={key:0},Ue={key:0},Re=e.defineComponent({__name:"SeatsEditorItem",props:e.mergeModels({modelValue:{type:Object},defaultValue:{type:Object},pricings:{type:Array}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=i,o=e.useModel(i,"modelValue"),{$t:a}=t.useIntl(),{formatTimePeriod:r}=t.useTimePeriod(),l=e.ref(!1),c=e.computed({get:()=>o.value.number?+o.value.number:1,set(e){o.value={...o.value,number:void 0!==e?e.toString():void 0}}}),u=function({pricings:t,pricingItemConfigId:i}){return e.computed(()=>{var e,n;const{config:o,productItem:a}=function({pricings:e,pricingItemConfigId:t}){var i,n;const o=e.flatMap(e=>e.items??[]).find(e=>{var i;return null==(i=e.configs)?void 0:i.some(e=>e.id===t)});return{config:null==(i=null==o?void 0:o.configs)?void 0:i.find(e=>e.id===t),productItem:null==(n=null==o?void 0:o.product_items)?void 0:n[0]}}({pricings:t,pricingItemConfigId:i});return{billing:{period:null==o?void 0:o.billing_period,billedInAdvance:null==o?void 0:o.billing_in_advance},product:{name:null==a?void 0:a.name,description:null==a?void 0:a.description},pricing:{..."FLAT"===(null==o?void 0:o.type)&&{amount:null==(n=null==(e=o.bands)?void 0:e[0])?void 0:n.amount},..."TIERED"===(null==o?void 0:o.type)&&{tiered:{bands:o.bands}}}}})}({pricings:n.pricings,pricingItemConfigId:o.value.pricing_item_config_id}),d=e.computed(()=>{var e,t;return!!(null==(t=null==(e=u.value.pricing)?void 0:e.tiered)?void 0:t.bands)});return(n,o)=>{var s,p,m;return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",je,[e.createElementVNode("div",ze,[e.createVNode(e.unref(t._sfc_main$1Y),{modelValue:c.value,"onUpdate:modelValue":o[0]||(o[0]=e=>c.value=e),size:"sm",min:(null==(s=i.defaultValue)?void 0:s.number)?+i.defaultValue.number:void 0},null,8,["modelValue","min"])]),e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col grow",{"hover:cursor-pointer":d.value}]),tabindex:d.value?0:void 0,onClick:o[1]||(o[1]=e=>d.value?l.value=!l.value:void 0)},[e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u).product.name||e.unref(a)({defaultMessage:"Seats",id:"seats.label",description:"The label for the seats input field"})),1)]),_:1}),e.unref(u).pricing.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:0,tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"{amount} per seat/{period}",id:"seats.price_per_seat_period",description:"The price per seat and billing period label for seat-based pricing"},{amount:e.unref(t.formatAmount)(e.unref(u).pricing.amount),period:e.unref(u).billing.period?e.unref(r)(e.unref(u).billing.period,{short:!0,hideValueForExactPeriods:!0}):""})),1)]),_:1})):e.unref(u).pricing.tiered?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Tiered pricing",id:"seats.tiered_pricing_label",description:"The label indicating tiered pricing structure for seats"}))+" ",1),e.createVNode(e.unref(t._sfc_main$4),{icon:"keyboard_arrow_down",size:"xs",class:e.normalizeClass(["absolute transition ease-in-out text-gray-400",{"rotate-0":!l.value,"rotate-180":l.value}])},null,8,["class"])]),_:1})):e.createCommentVNode("",!0)],10,Oe)]),(null==(m=null==(p=e.unref(u).pricing)?void 0:p.tiered)?void 0:m.bands)?(e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(e.unref(t._sfc_main$2j),null,{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(Le,{bands:e.unref(u).pricing.tiered.bands,period:e.unref(u).billing.period},null,8,["bands","period"])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)])}}}),Fe=e.defineComponent({__name:"SeatsEditor",props:e.mergeModels({modelValue:{type:Array},initialSeatsValues:{type:Array},pricings:{type:Array}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=e.useModel(i,"modelValue"),o=t=>e.computed({get:()=>n.value[t],set:e=>{const i=n.value.slice();i[t]=e,n.value=i}});return(n,a)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.modelValue,(n,a)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:a},{default:e.withCtx(()=>{var t;return[n.pricing_item_config_id?(e.openBlock(),e.createBlock(Re,{key:n.pricing_item_config_id,modelValue:o(a).value,"onUpdate:modelValue":e=>o(a).value=e,"default-value":null==(t=i.initialSeatsValues)?void 0:t[a],pricings:i.pricings},null,8,["modelValue","onUpdate:modelValue","default-value","pricings"])):e.createCommentVNode("",!0)]}),_:2},1024))),128))}}),Ge={class:"flex gap-4 border-l-2 border-primary-600 px-2"},Ye={class:"grow"},Ke=e.defineComponent({__name:"PricingGroupTitle",setup:i=>(i,n)=>(e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("div",Ye,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"title")]),_:3})]),e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"description")]),_:3})])]))}),qe={class:"p-1"},He={class:"grid grid-cols-1 gap-1 pt-1"},Qe=e.defineComponent({__name:"AddonSingleEditor",props:e.mergeModels({constraint:{type:String},modelValue:{type:Array},pricings:{type:Array},billingPeriod:{type:Object},currency:{type:String},groupName:{type:String}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=i,o=e.useModel(i,"modelValue"),{$t:a}=t.useIntl(),{renderPricingForPricingItem:r}=t.usePricingItem({currency:e.toRef(n,"currency"),billingPeriod:e.toRef(n,"billingPeriod")}),l=n.pricings.map(e=>e.id),c=e.computed(()=>"AT_MOST_ONE"===n.constraint?a({defaultMessage:"Select up to one product",id:"addon_single_editor.description.at_most_one",description:"The description of the addon single editor for at most one product"}):"EXACTLY_ONE"===n.constraint?a({defaultMessage:"Select one product",id:"addon_single_editor.description.exactly_one",description:"The description of the addon single editor for exactly one product"}):"AT_LEAST_ONE"===n.constraint?a({defaultMessage:"Select at least one product",id:"addon_single_editor.description.at_least_one",description:"The description of the addon single editor for at least one product"}):""),u=e=>n.modelValue.includes(e);return(n,d)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",qe,[e.createVNode(Ke,null,{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.groupName),1)]),description:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1}),e.createElementVNode("div",He,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.pricings,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:i.id,"content-background":"none",class:e.normalizeClass({"!bg-white":u(i.id)})},{default:e.withCtx(()=>{var n,c;return[e.createVNode(p._sfc_main,{name:e.unref(F)(i)??"",description:(null==(n=i.items)?void 0:n[0])?e.unref(r)({pricingItem:null==(c=i.items)?void 0:c[0]}):e.unref(a)({defaultMessage:"Unsupported pricing",id:"pricing_item_pricing.unsupported_pricing_error",description:"Text displayed when the pricing item pricing is unsupported"})},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$20),{"model-value":u(i.id),"onUpdate:modelValue":e=>(e=>{if(u(e))o.value=o.value.filter(t=>t!==e);else{const t=o.value.filter(e=>!l.includes(e));o.value=[...t,e]}})(i.id)},null,8,["model-value","onUpdate:modelValue"])]),_:2},1032,["name","description"])]}),_:2},1032,["class"]))),128))])])]),_:1}))}}),Ze={class:"grid grid-cols-1 gap-1"},Xe=e.defineComponent({__name:"AddonMultipleEditor",props:e.mergeModels({modelValue:{type:Array},pricings:{type:Array},billingPeriod:{type:Object},currency:{type:String},groupName:{type:String}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=i,o=e.useModel(i,"modelValue"),{$t:a}=t.useIntl(),{renderPricingForPricingItem:r}=t.usePricingItem({currency:e.toRef(n,"currency"),billingPeriod:e.toRef(n,"billingPeriod")}),l=e=>o.value.includes(e),c=e=>{l(e)?o.value=o.value.filter(t=>t!==e):o.value=[...o.value,e]};return(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-spacing":"","no-border":!i.groupName,"content-background":i.groupName?"gray":"none"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["grid grid-cols-1 gap-1",{"p-1":i.groupName}])},[i.groupName?(e.openBlock(),e.createBlock(Ke,{key:0},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.groupName),1)]),description:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Select any number of products",id:"addon_multiple_editor.description",description:"The description of the addon multiple editor"})),1)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.pricings,n=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:n.id,"content-background":i.groupName||l(n.id)?"none":"gray",class:e.normalizeClass({"!bg-white":l(n.id)})},{default:e.withCtx(()=>{var i,o;return[e.createVNode(p._sfc_main,{name:e.unref(F)(n)??"",description:(null==(i=n.items)?void 0:i[0])?e.unref(r)({pricingItem:null==(o=n.items)?void 0:o[0]}):e.unref(a)({defaultMessage:"Unsupported pricing",id:"addon_multiple_editor.unsupported_pricing_error",description:"Text displayed when the pricing item pricing is unsupported"})},{default:e.withCtx(()=>[l(n.id)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,color:"gray",variant:"outline",square:"",size:"sm","icon-prefix":"remove_shopping_cart",onClick:e=>c(n.id)},null,8,["onClick"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:1,color:"primary","icon-prefix":"add",size:"sm",onClick:e=>c(n.id)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Add to subscription ",id:"addon_multiple_editor.add_to_subscription_button",description:"The button to add a pricing to the subscription"})),1)]),_:1},8,["onClick"]))]),_:2},1032,["name","description"])]}),_:2},1032,["content-background","class"]))),128))])],2)]),_:1},8,["no-border","content-background"]))}});function We(){return{isMobileViewport:m.useBreakpoints(m.breakpointsTailwind).smallerOrEqual("sm")}}const Je={class:"p-1"},et={class:"pt-1"},tt=e.defineComponent({__name:"PricingGroupSingleEditor",props:e.mergeModels({modelValue:{type:Array},pricings:{type:Array},billingPeriod:{type:Object},currency:{type:String},groupName:{type:String}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=i,o=e.useModel(i,"modelValue"),{$t:a}=t.useIntl(),{renderPricingForPricingItem:r}=t.usePricingItem({currency:e.toRef(n,"currency"),billingPeriod:e.toRef(n,"billingPeriod")}),{isMobileViewport:l}=We(),c=e.computed(()=>n.pricings.map(e=>e.id)),u=e.computed({get:()=>o.value.find(e=>c.value.includes(e))??void 0,set:e=>{const t=o.value.filter(e=>!c.value.includes(e));o.value=e?[...t,e]:t}}),d=e.computed(()=>n.pricings.map(e=>{var t;const i=null==(t=e.items)?void 0:t[0];return{label:F(e)??"",value:e.id,description:i?r({pricingItem:i}):a({defaultMessage:"Unsupported pricing",id:"pricing_item_pricing.unsupported_pricing_error",description:"Text displayed when the pricing item pricing is unsupported"})}}));return(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",Je,[e.createVNode(Ke,null,{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.groupName),1)]),_:1}),e.createElementVNode("div",et,[d.value.length<=3?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1X),{key:0,modelValue:u.value,"onUpdate:modelValue":o[0]||(o[0]=e=>u.value=e),options:d.value.slice(0,3),direction:e.unref(l)?"column":"row","show-radio":!1},null,8,["modelValue","options","direction"])):d.value.length<=6?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1T),{key:1,"single-model-value":u.value,"onUpdate:singleModelValue":o[1]||(o[1]=e=>u.value=e),options:d.value.map(({value:e,label:t,description:i})=>({label:t,subLabel:i,value:e})),size:"xl","show-sub-label-in-input":""},null,8,["single-model-value","options"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1L),{key:2,modelValue:u.value,"onUpdate:modelValue":o[2]||(o[2]=e=>u.value=e),options:d.value,name:`pricing-group-range-input-${i.groupName}`},null,8,["modelValue","options","name"]))])])]),_:1}))}});const it={class:"grid grid-cols-1 gap-1"},nt=e.defineComponent({__name:"PlanCustomizationEditor",props:e.mergeModels({subscription:{type:Object},enabledPricingIds:{type:Array},initialSeatsValues:{type:Array},billingPeriod:{type:Object},currency:{type:String}},{seatsValues:{required:!0},seatsValuesModifiers:{},enabledPricingIds:{required:!0},enabledPricingIdsModifiers:{}}),emits:["update:seatsValues","update:enabledPricingIds"],setup(i){const n=i,o=e.useModel(i,"seatsValues"),a=e.useModel(i,"enabledPricingIds"),{$t:r}=t.useIntl(),l=e.computed(()=>{var e;const t=null==(e=S({pricingPlanScheduleInfos:n.subscription.pricing_plan_schedule_infos,type:"DEFAULT"}))?void 0:e.pricing_plan_version;return t?function(e){var t;return((null==(t=e.pricing_categories)?void 0:t.flatMap(e=>e.pricings??[]))??[]).filter(e=>null!==e)}(t):[]}),c=e.computed(()=>l.value.filter(e=>"ADDON"===e.product_type)),u=e.computed(()=>R(n.subscription));return(n,d)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{title:e.unref(r)({defaultMessage:"Customize plan",id:"checkout.customize_plan_block.title",description:"The title of the customize plan block in the checkout form"}),"no-spacing":"","no-border":"","content-background":"none"},{default:e.withCtx(()=>[e.createElementVNode("div",it,[e.createVNode(Fe,{modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=e=>o.value=e),"initial-seats-values":i.initialSeatsValues,pricings:l.value},null,8,["modelValue","initial-seats-values","pricings"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.id},["DEFAULT"===t.product_type&&"EXACTLY_ONE"===t.selection_constraint?(e.openBlock(),e.createBlock(tt,{key:0,modelValue:a.value,"onUpdate:modelValue":d[1]||(d[1]=e=>a.value=e),"group-name":t.name,pricings:t.pricings,"billing-period":i.billingPeriod,currency:i.currency},null,8,["modelValue","group-name","pricings","billing-period","currency"])):"ADDON"===t.product_type&&"AT_MOST_ONE"===t.selection_constraint?(e.openBlock(),e.createBlock(Qe,{key:1,modelValue:a.value,"onUpdate:modelValue":d[2]||(d[2]=e=>a.value=e),"group-name":t.name,pricings:t.pricings,constraint:t.selection_constraint,"billing-period":i.billingPeriod,currency:i.currency},null,8,["modelValue","group-name","pricings","constraint","billing-period","currency"])):"ADDON"===t.product_type&&"ANY"===t.selection_constraint?(e.openBlock(),e.createBlock(Xe,{key:2,modelValue:a.value,"onUpdate:modelValue":d[3]||(d[3]=e=>a.value=e),pricings:t.pricings,"group-name":t.name,"billing-period":i.billingPeriod,currency:i.currency},null,8,["modelValue","pricings","group-name","billing-period","currency"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(Xe,{modelValue:a.value,"onUpdate:modelValue":d[4]||(d[4]=e=>a.value=e),pricings:c.value,"billing-period":i.billingPeriod,currency:i.currency},null,8,["modelValue","pricings","billing-period","currency"])])]),_:1},8,["title"]))}}),ot=["aria-expanded","aria-label"],at={class:"flex flex-row items-center justify-between w-full gap-3 px-3 py-2 cursor-pointer"},rt={class:"flex flex-row gap-2 items-center"},lt=["onKeydown"],ct=["aria-label"],ut={class:"flex flex-row items-center justify-between w-full gap-3 px-3 py-2 cursor-pointer"},dt={class:"flex flex-row gap-2 items-center"},st={class:"sr-only","aria-live":"polite"},pt=e.defineComponent({__name:"PromotionCodeSection",props:{promotionCode:{default:null,type:[String,null]}},emits:["update:appliedCode","apply","remove"],setup(i,{emit:n}){const{$t:o}=t.useIntl(),a=i,r=n,l=e.ref(!1),c=e.ref(""),u=e.ref(""),d=e.ref(null),s=e.ref(null),p="promotion-code-"+ ++_;const m=`${p}-label`,g=`${p}-panel`,f=e.computed(()=>null!==a.promotionCode&&""!==a.promotionCode),v=e.computed(()=>c.value.trim().length>0),y=e.computed(()=>a.promotionCode??o({defaultMessage:"Promotion applied",id:"checkout.promotion_code.applied_label",description:"Fallback label for an applied promotion code in checkout"})),h=e.computed(()=>o({defaultMessage:l.value?"Collapse promotion code input":"Expand promotion code input",id:l.value?"checkout.promotion_code.collapse_aria_label":"checkout.promotion_code.expand_aria_label",description:"Aria label for the promotion code toggle button in checkout"})),b=e.computed(()=>o({defaultMessage:"Apply promotion code",id:"checkout.promotion_code.apply_aria_label",description:"Aria label for the promotion code apply button in checkout"})),M=e.computed(()=>o({defaultMessage:"Remove promotion code",id:"checkout.promotion_code.remove_aria_label",description:"Aria label for the promotion code remove button in checkout"})),N=()=>{c.value=""},I=()=>{l.value&&(l.value=!1)},k=()=>{f.value||(l.value=!l.value)},C=()=>{if(!v.value)return;const e=c.value.trim();r("update:appliedCode",e),r("apply",e),u.value=o({defaultMessage:"Promotion code applied",id:"checkout.promotion_code.applied_status",description:"Aria live message when a promotion code is applied in checkout"}),l.value=!1},x=()=>{r("update:appliedCode",null),r("remove"),u.value=o({defaultMessage:"Promotion code removed",id:"checkout.promotion_code.removed_status",description:"Aria live message when a promotion code is removed in checkout"}),N(),e.nextTick(()=>{var e;null==(e=d.value)||e.focus()})};return e.watch(l,t=>{if(!t)return N(),void e.nextTick(()=>{var e;null==(e=d.value)||e.focus()});e.nextTick(()=>{(()=>{var e;const t=null==(e=s.value)?void 0:e.querySelector("input");t instanceof HTMLInputElement&&t.focus()})()})}),e.watch(()=>a.promotionCode,e=>{e||N()}),(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:1,"no-border":"","no-spacing":"","content-background":"none",class:"w-full relative"},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"w-full bg-white border border-primary-900 rounded","aria-label":M.value,onClick:x},[e.createElementVNode("div",ut,[e.createElementVNode("div",dt,[e.createVNode(e.unref(t._sfc_main$4),{icon:"local_activity"}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",class:"font-semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.value),1)]),_:1})]),e.createVNode(e.unref(t._sfc_main$4),{icon:"close"})])],8,ct)]),_:1})):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:0,"no-spacing":"",class:"w-full relative"},{default:e.withCtx(()=>[e.createElementVNode("button",{ref_key:"toggleRef",ref:d,type:"button",class:"w-full","aria-expanded":l.value,"aria-controls":g,"aria-label":h.value,onClick:k},[e.createElementVNode("div",at,[e.createElementVNode("div",rt,[e.createVNode(e.unref(t._sfc_main$4),{icon:"local_activity"}),e.createVNode(e.unref(t._sfc_main$2),{id:m,variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Add promotion code",id:"checkout.promotion_code.add_label",description:"Label for adding a promotion code in checkout"})),1)]),_:1})]),e.createVNode(e.unref(t._sfc_main$4),{icon:l.value?"remove":"add"},null,8,["icon"])])],8,ot),e.withDirectives(e.createElementVNode("div",{id:g,ref_key:"panelRef",ref:s,role:"region","aria-labelledby":m,class:"w-full border-t px-3 py-2 flex flex-row gap-2 items-center overflow-hidden",onKeydown:e.withKeys(e.withModifiers(I,["prevent"]),["esc"])},[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:c.value,"onUpdate:modelValue":n[0]||(n[0]=e=>c.value=e),placeholder:e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.placeholder",description:"Placeholder for promotion code input in checkout"}),"aria-label":e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.input_aria_label",description:"Aria label for promotion code input in checkout"}),class:"w-full",onKeydown:e.withKeys(e.withModifiers(C,["prevent"]),["enter"])},null,8,["modelValue","placeholder","aria-label","onKeydown"]),e.createVNode(e.unref(t._sfc_main$2H),{type:"button",disabled:!v.value,"aria-label":b.value,"aria-disabled":!v.value,onClick:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Apply",id:"checkout.promotion_code.apply_button",description:"Button label for applying a promotion code in checkout"})),1)]),_:1},8,["disabled","aria-label","aria-disabled"])],40,lt),[[e.vShow,l.value]])]),_:1})),e.createElementVNode("span",st,e.toDisplayString(u.value),1)],64))}}),mt={key:0},gt=e.defineComponent({__name:"Checkout",props:{configuration:{type:Object}},emits:["error","ready"],setup(i,{emit:n}){var a,r,l,c,u,d,m,f;const v=i,y=n,_=e.computed(()=>v.configuration),h=e.ref(),b=e.ref(),M=o.useLogger(),{$t:N,locale:I}=t.useIntl(),{formatTimePeriod:k}=t.useTimePeriod(),C=s.usePortal(),{isMobileViewport:x}=We();if(M.info("COMPONENT_INITIALIZED","Checkout component initialized"),"INIT_PRICING_PLAN_SUBSCRIPTION"!==(null==(a=C.value)?void 0:a.type))throw M.error("INVALID_TOKEN","Invalid token"),Error("Invalid token");"REVOKED"===C.value.status&&(h.value={code:"RESOURCE_REVOKED",message:`Portal url with resource id "${C.value.id}" is revoked`},M.error("RESOURCE_REVOKED",`Portal url with resource id "${C.value.id}" is revoked`));const E=null==(l=null==(r=C.value)?void 0:r.init_pricing_plan_subscription)?void 0:l.pricing_plan_subscription_id,D=null==(u=null==(c=C.value)?void 0:c.init_pricing_plan_subscription)?void 0:u.success_url,{paymentMethodOptions:A,subscription:w,isPaymentMethodsPending:P,isInvoicePreviewPending:B,checkoutForm:V,invoicePreview:T,invoicePreviewByBillingPeriod:j,trialInvoicePreview:z,trialPeriod:O,authorizationContext:$,isPaid:U,amount:F,loadInvoicePreview:G,updateInvoicePreviewOnBillingInformationChange:K}=Y({initialCountry:null==(d=v.configuration)?void 0:d.countryCode,initialEmail:null==(m=v.configuration)?void 0:m.email,subscriptionId:E,enabledPricingIds:null==(f=v.configuration)?void 0:f.enabledPricingIds}),q=async()=>{var e;await V.validation.value.$validate(),V.validation.value.$invalid||null==(e=b.value)||e.submit()},H=async()=>(await V.validation.value.$validate(),!V.validation.value.$invalid),Q=e.computed(()=>!!z.value),Z=e.computed(()=>!!T.value&&(e=>{var t;return(null==(t=e.periods)?void 0:t.some(e=>e.groups.some(e=>{var t;return null==(t=e.lines)?void 0:t.some(e=>e.product_items.some(e=>"USAGE_BASED"===e.model_type))})))??!1})(T.value)),X=e.computed(()=>V.form.value.country&&["US","CA"].includes(V.form.value.country)||!1),W=e.computed({get:()=>V.form.value.enabledPricingIds??[],set:e=>{V.form.value.enabledPricingIds=e}}),J=e.computed(()=>w.value?S({pricingPlanScheduleInfos:w.value.pricing_plan_schedule_infos,type:"DEFAULT"}):void 0),te=e.computed(()=>{var e,t;if(!w.value)return;const i=null==(t=null==(e=J.value)?void 0:e.pricing_plan_version)?void 0:t.pricing_currency_settings;return L({country:V.form.value.country,pricingCurrencySettings:i,fallbackCurrency:w.value.billing_currency})}),ie=e.computed(()=>{if(!J.value||!w.value)return new Set;const e=function({pricingPlanScheduleInfo:e}){const t=new Map;return(e.pricing_plan_version.pricing_categories??[]).forEach(e=>{var i;null==(i=e.pricings)||i.forEach(e=>{var i;null==(i=e.items)||i.forEach(e=>{var i;null==(i=e.pricing_currency_configs)||i.forEach(e=>{var i,n;const o=e.currency;null==(i=e.billing_period_configs)||i.forEach(e=>{var i;null==(i=e.configs)||i.forEach(i=>{i.id&&t.set(i.id,{currency:o,billingPeriod:e.billing_period})})}),null==(n=e.configs)||n.forEach(e=>{e.id&&t.set(e.id,{currency:o})})})})})}),t}({pricingPlanScheduleInfo:J.value}),t=te.value,i=w.value.billing_period,n=new Set;return e.forEach((e,o)=>{t&&e.currency!==t||i&&e.billingPeriod&&(e.billingPeriod.type!==i.type||e.billingPeriod.value!==i.value)||n.add(o)}),n}),ne=e.computed({get:()=>{const e=V.form.value.seatsValues??[],t=ie.value;return t.size?e.filter(({pricing_item_config_id:e})=>t.has(e)):e},set:e=>{const t=V.form.value.seatsValues??[],i=ie.value;if(!i.size)return void(V.form.value.seatsValues=e);const n=t.filter(({pricing_item_config_id:e})=>!i.has(e));V.form.value.seatsValues=n.concat(e)}}),ae=e.computed(()=>{var e,i,n,o,a;return z.value?N({defaultMessage:"{discounted_amount} for {trial_period}, then {subscription_amount}/{billing_period} until canceled, starting {start_date, date, ::MMMMd}.",id:"checkout.agreement.trial",description:"The agreement for the trial period"},{discounted_amount:"0.00"===z.value.tax_summary.total_amount.quantity?N({defaultMessage:"Free",id:"checkout.agreement.trial.free",description:"The free amount for the trial period"}):t.formatAmount(z.value.tax_summary.total_amount),trial_period:k(O.value,{short:!0}),subscription_amount:t.formatAmount((null==(e=T.value)?void 0:e.tax_summary.total_amount)??{quantity:"0.00",currency:"EUR"}),billing_period:k((null==(i=T.value)?void 0:i.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(fe.value)}):N({defaultMessage:"{subscription_amount}/{billing_period} until canceled, starting {start_date, date, long}.",id:"checkout.agreement.subscription",description:"The agreement for the subscription"},{subscription_amount:(null==(n=T.value)?void 0:n.tax_summary.total_amount)?t.formatAmount(null==(o=T.value)?void 0:o.tax_summary.total_amount):"",billing_period:k((null==(a=T.value)?void 0:a.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(fe.value)})}),re=e.computed(()=>{var e,t,i,n,o,a;if(!T.value)return;const r=(null==(e=w.value)?void 0:e.name)??(null==(o=null==(n=null==(i=null==(t=w.value)?void 0:t.pricing_plan_schedule_infos)?void 0:i.at(-1))?void 0:n.pricing_plan_version.pricing_plan)?void 0:o.name)??"Subscription";return{description:r,managementURL:"https://www.solvimon.com/account/billing",agreement:ae.value,...z.value&&O.value&&{trial:{label:N({defaultMessage:"Trial",id:"checkout.trial.label",description:"The label of the trial"}),amount:z.value.tax_summary.total_amount,startDate:pe.value?new Date(pe.value):void 0,endDate:ge.value?new Date(ge.value):void 0}},regular:{label:r,amount:T.value.tax_summary.total_amount,startDate:fe.value?new Date(fe.value):void 0,interval:(null==(a=w.value)?void 0:a.billing_period)??{type:"MONTH",value:1}}}}),ue=e=>t.isValidCountryCode(e),de=e=>{const{country:t,...i}=e;V.updateInitialState({...i,...t&&ue(t)?{country:t}:{}})},se=e.computed(()=>{var e,t;return!((null==(e=v.configuration)?void 0:e.email)&&(null==(t=v.configuration)?void 0:t.countryCode))}),pe=e.computed(()=>{var e,t,i;const n=null==(t=null==(e=z.value)?void 0:e.periods)?void 0:t[0],o=null==(i=me.value)?void 0:i.trialStartDate;return(null==n?void 0:n.start_at)?new Date(n.start_at):o}),me=e.computed(()=>function(e){var t;const i={trialStartDate:void 0,trialEndDate:void 0,subscriptionStartDate:void 0,subscriptionEndDate:void 0};if(!(null==(t=null==e?void 0:e.pricing_plan_schedule_infos)?void 0:t.length))return i;const n=new Date,o=S({type:"TRIAL",pricingPlanScheduleInfos:e.pricing_plan_schedule_infos});if((null==o?void 0:o.start_at)&&(i.trialStartDate=n,o.end_at)){const e=new Date(o.end_at).getTime()-new Date(o.start_at).getTime();i.trialEndDate=new Date(n.getTime()+e)}const a=S({type:"DEFAULT",pricingPlanScheduleInfos:e.pricing_plan_schedule_infos});if((null==a?void 0:a.start_at)&&(i.trialEndDate?i.subscriptionStartDate=i.trialEndDate:i.subscriptionStartDate=n,a.end_at)){const e=new Date(a.end_at).getTime()-new Date(a.start_at).getTime();i.subscriptionEndDate=new Date(n.getTime()+e)}return i}(w.value)),ge=e.computed(()=>{var e,t,i;const n=null==(t=null==(e=z.value)?void 0:e.periods)?void 0:t[0],o=null==(i=me.value)?void 0:i.trialEndDate;return(null==n?void 0:n.end_at)?new Date(n.end_at):o}),fe=e.computed(()=>{var e,t,i;const n=null==(t=null==(e=T.value)?void 0:e.periods)?void 0:t[0],o=null==(i=me.value)?void 0:i.subscriptionStartDate;return(null==n?void 0:n.start_at)?new Date(n.start_at):o}),ye=e.computed(()=>!!(V.form.value.seatsValues&&V.form.value.seatsValues.length>0)||(!(!w.value||!function(e){return R(e).some(e=>"EXACTLY_ONE"===e.selection_constraint||"AT_LEAST_ONE"===e.selection_constraint)}(w.value))||!(!w.value||!function(e){const t=e.pricing_plan_schedule_infos.flatMap(e=>{var t;return(null==(t=e.pricing_plan_version.pricing_categories)?void 0:t.flatMap(e=>e.pricings??[]))??[]}),i=R(e);return t.some(e=>"ADDON"===e.product_type)||i.some(e=>"ADDON"===e.object_type)}(w.value)))),he=e.ref(null),{applyPromotionCode:be,removePromotionCode:Me,isPromotionCodePending:Ne,promotionCodeErrorMessage:Ie}=function({checkoutForm:t,updateInvoicePreviewOnBillingInformationChange:i,logger:n,formatErrorMessage:o,onInvalidPromotionCode:a,onApplyError:r}){const l=e.ref(!1),c=e.ref(null),u=(e,t)=>{c.value=o?o({action:e,error:t}):"apply"===e?"Promotion code could not be applied. Please try again.":"Promotion code could not be removed. Please try again."},d=async({suppressError:e=!1,preserveErrorMessage:o=!1}={})=>{o||(c.value=null),delete t.form.value.promotionCode,l.value=!0;try{await i({})}catch(a){null==n||n.capture(a,{code:"PROMOTION_CODE_REMOVE_FAILED",message:"Failed to remove promotion code"}),e||u("remove",a)}finally{l.value=!1}};return{applyPromotionCode:async e=>{const o=null==e?void 0:e.trim();if(o){c.value=null,t.form.value.promotionCode=o,l.value=!0;try{await i({promotionCode:o})}catch(s){null==n||n.capture(s,{code:"PROMOTION_CODE_APPLY_FAILED",message:"Failed to apply promotion code"}),u("apply",s),null==r||r(),(e=>function(e){return"object"==typeof e&&null!==e&&"field"in e}(e)&&"promotion_codes"===e.field)(s)&&(null==a||a()),await d({suppressError:!0,preserveErrorMessage:!0})}finally{l.value=!1}}},removePromotionCode:d,isPromotionCodePending:l,promotionCodeErrorMessage:c}}({checkoutForm:V,updateInvoicePreviewOnBillingInformationChange:K,logger:M,formatErrorMessage:({action:e})=>N("apply"===e?{defaultMessage:"Promotion code could not be applied. Please try again.",id:"checkout.promotion_code.apply_failed",description:"Error message when applying a promotion code in checkout failed"}:{defaultMessage:"Promotion code could not be removed. Please try again.",id:"checkout.promotion_code.remove_failed",description:"Error message when removing a promotion code in checkout failed"}),onInvalidPromotionCode:()=>{he.value=null},onApplyError:()=>{he.value=null}}),ke=()=>{U.value=!0,Ie.value=null},Ce=e=>{w.value&&(w.value={...w.value,billing_period:e},G())};return e.onMounted(()=>{y("ready")}),(i,n)=>h.value?(e.openBlock(),e.createBlock(le,{key:0})):(e.openBlock(),e.createBlock(e.unref(s.ContentWithAsideLayout),{key:1},{header:e.withCtx(()=>[e.createVNode(g._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>{var t,i,n;return[e.unref(T)&&e.unref(w)&&fe.value?(e.openBlock(),e.createBlock(oe,{key:0,"trial-start-date":pe.value,"trial-period":e.unref(O),"subscription-start-date":fe.value,"subscription-name":(null==(t=e.unref(w))?void 0:t.name)??"",amount:null==(i=e.unref(T))?void 0:i.invoice_amount_including_tax,"billing-period":null==(n=e.unref(w))?void 0:n.billing_period,"country-code":e.unref(V).form.value.country},null,8,["trial-start-date","trial-period","subscription-start-date","subscription-name","amount","billing-period","country-code"])):e.createCommentVNode("",!0)]}),_:1})]),content:e.withCtx(()=>{var i,a,r;return[e.unref(w)&&e.unref(x)?(e.openBlock(),e.createBlock(ve,{key:0,subscription:e.unref(w),invoice:e.unref(T),"invoice-preview-by-billing-period":e.unref(j),"trial-invoice":e.unref(z),"enabled-pricing-ids":W.value,"trial-period":e.unref(O),avatar:null==(i=_.value)?void 0:i.avatar,"is-paid":e.unref(U),"is-usage-based":Z.value,"is-preview-and-payment-methods-pending":e.unref(P)||e.unref(B),"country-code":e.unref(V).form.value.country,collapsible:"collapsed",variant:"products-inline",onBillingPeriodChange:Ce},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending","country-code"])):e.createCommentVNode("",!0),ye.value&&e.unref(w)?(e.openBlock(),e.createBlock(nt,{key:1,"seats-values":ne.value,"onUpdate:seatsValues":n[0]||(n[0]=e=>ne.value=e),"enabled-pricing-ids":W.value,"onUpdate:enabledPricingIds":n[1]||(n[1]=e=>W.value=e),subscription:e.unref(w),"initial-seats-values":null==(a=e.unref(V).initialState)?void 0:a.value.seatsValues,"billing-period":e.unref(w).billing_period,currency:te.value},null,8,["seats-values","enabled-pricing-ids","subscription","initial-seats-values","billing-period","currency"])):e.createCommentVNode("",!0),!e.unref(U)&&e.unref(V).form.value.country&&e.unref(F)&&re.value?(e.openBlock(),e.createBlock(Be,{key:2,amount:e.unref(F),"country-code":e.unref(V).form.value.country,locale:e.unref(I),"payment-methods-options-response":e.unref(A)??[],"billing-information":re.value,"on-billing-information-change":e.unref(K),onUpdateBillingInformation:de},null,8,["amount","country-code","locale","payment-methods-options-response","billing-information","on-billing-information-change"])):e.createCommentVNode("",!0),e.unref(U)?(e.openBlock(),e.createBlock(ce,{key:3,"redirect-url":e.unref(D)},null,8,["redirect-url"])):e.createCommentVNode("",!0),e.unref(U)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ee,{key:4,modelValue:e.unref(V).form.value,"onUpdate:modelValue":n[2]||(n[2]=t=>e.unref(V).form.value=t),validation:e.unref(V).validation,"read-only-email":null==(r=v.configuration)?void 0:r.email,"show-customer-info-on-top":se.value||e.unref(U),"is-billing-information-mandatory":X.value,"get-is-field-required":e.unref(V).getIsFieldRequired,"read-only":e.unref(U)},null,8,["modelValue","validation","read-only-email","show-customer-info-on-top","is-billing-information-mandatory","get-is-field-required","read-only"])),e.unref(U)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(g._sfc_main,{key:5,variant:"section",class:"min-h-[130px]"},{default:e.withCtx(()=>[!e.unref(P)||e.unref(P)&&e.unref(A).length>0?(e.openBlock(),e.createElementBlock("div",mt,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2",class:"mb-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)({defaultMessage:"Payment method",id:"checkout.payment_method_block.title",description:"The title of the payment method block in the checkout form"})),1)]),_:1}),e.unref(V).form.value.country?0===e.unref(A).length?(e.openBlock(),e.createBlock(_e,{key:1,icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)({defaultMessage:"No payment methods available",id:"checkout.payment_method_block.no_payment_methods_available_title",description:"The title shown when there are no available payment methods"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)({defaultMessage:"There are no available payment methods. Please contact support for more information.",id:"checkout.payment_method_block.no_payment_methods_available_message",description:"The message shown when there are no available payment methods"})),1)]),_:1})):e.unref(F)&&e.unref(V).form.value.country?(e.openBlock(),e.createBlock(o._sfc_main,{key:2,ref_key:"paymentIntegrationFormRef",ref:b,"country-code":e.unref(V).form.value.country,context:e.unref($),amount:e.unref(F),variant:"AUTHORIZE","payment-method-options":e.unref(A)??[],"success-redirect-url":e.unref(D),"validate-on-submit":H,"force-store-payment-method":"",onPaymentSuccess:ke,onReady:n[3]||(n[3]=e=>y("ready"))},null,8,["country-code","context","amount","payment-method-options","success-redirect-url"])):e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_e,{key:0,icon:"captive_portal"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)({defaultMessage:"Select your billing country",id:"checkout.payment_method_block.no_country_selected_title",description:"The title shown when no country is selected"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)({defaultMessage:"Payment methods will be shown after you select the billing country.",id:"checkout.payment_method_block.no_country_selected_message",description:"The message shown when no country is selected"})),1)]),_:1}))])):e.createCommentVNode("",!0)]),_:1}))]}),aside:e.withCtx(()=>[e.createVNode(g._sfc_main,{variant:"section",class:"min-h-[220px]"},{default:e.withCtx(()=>{var t;return[e.unref(w)&&e.unref(T)?(e.openBlock(),e.createBlock(ve,{key:0,subscription:e.unref(w),invoice:e.unref(T),"invoice-preview-by-billing-period":e.unref(j),"trial-invoice":e.unref(z),"enabled-pricing-ids":W.value,"trial-period":e.unref(O),"country-code":e.unref(V).form.value.country,avatar:null==(t=_.value)?void 0:t.avatar,"is-paid":e.unref(U),"is-usage-based":Z.value,"is-preview-and-payment-methods-pending":e.unref(P)||e.unref(B),onBillingPeriodChange:Ce},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","country-code","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending"])):e.createCommentVNode("",!0)]}),_:1}),e.unref(U)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(pt,{key:0,"promotion-code":he.value,"onUpdate:appliedCode":n[4]||(n[4]=e=>he.value=e),onRemove:e.unref(Me),onApply:e.unref(be)},null,8,["promotion-code","onRemove","onApply"])),e.unref(Ie)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$16),{key:1,class:"mt-2",title:e.unref(Ie)},null,8,["title"])):e.createCommentVNode("",!0),e.unref(U)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(g._sfc_main,{key:2,class:"min-h-[44px]"},{default:e.withCtx(()=>[e.unref(T)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,type:"button",size:"lg",class:"full-width",disabled:e.unref(Ne)||0===e.unref(A).length,onClick:q},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Q.value?e.unref(N)({defaultMessage:"Start trial",id:"checkout.pay_and_subscribe_button_trial.label",description:"The label of the start trial button in the checkout form"}):e.unref(N)({defaultMessage:"Pay and subscribe",id:"checkout.pay_and_subscribe_button.label",description:"The label of the pay and subscribe button in the checkout form"})),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0)]),_:1})),e.createVNode(e.unref(t._sfc_main$2),{tag:"div",variant:"body-sm",shade:"lighter",class:"flex grow justify-center"},{default:e.withCtx(()=>[e.createVNode(p._sfc_main$1,{icon:"lock",kpi:e.unref(N)({defaultMessage:"Secure and encrypted payments",id:"checkout.kpi.encrypted_payments.label",description:"The encrypted payments KPI shown in the checkout"})},null,8,["kpi"])]),_:1})]),_:1}))}}),ft=e.defineComponent({__name:"Checkout.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},emits:["error","ready"],setup(i,{emit:n}){var a,r;const l=i,c=n,u=o.useLogger(),d=(e=>{if(e)return t.isValidCountryCode(e)?e:void u.error("INVALID_COUNTRY_CODE",`invalid country code provided: "${e}"`)})(null==(a=l.configuration)?void 0:a.countryCode),s=(e=>{if(e)return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?e:void u.error("INVALID_EMAIL",`invalid email provided: "${e}"`)})(null==(r=l.configuration)?void 0:r.email);return(n,o)=>{var a,r,l,u;return e.openBlock(),e.createBlock(t._sfc_main$1,{"custom-element-name":e.unref(yt),environment:i.environment,locale:i.locale,"portal-object":i.portalObject,"allowed-portal-types":["INIT_PRICING_PLAN_SUBSCRIPTION"],"primary-color":null==(r=null==(a=i.branding)?void 0:a.colors)?void 0:r.primary,"secondary-color":null==(u=null==(l=i.branding)?void 0:l.colors)?void 0:u.secondary,"experimental-features":i.experimentalFeatures,"log-level":i.logLevel,"on-log":i.onLog,onError:o[1]||(o[1]=e=>n.$emit("error",e))},{default:e.withCtx(()=>{var t,a,r;return[e.createVNode(gt,{avatar:null==(a=null==(t=i.branding)?void 0:t.emblem)?void 0:a.public_url,email:e.unref(s),"country-code":e.unref(d),"enabled-pricing-ids":null==(r=i.configuration)?void 0:r.enabledPricingIds,onReady:o[0]||(o[0]=e=>c("ready"))},e.createSlots({_:2},[n.$slots["terms-and-conditions"]?{name:"terms-and-conditions",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"terms-and-conditions")]),key:"0"}:void 0]),1032,["avatar","email","country-code","enabled-pricing-ids"])]}),_:3},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),vt=t.defineCustomElement(ft),yt=t.getComponentName("checkout");exports.COMPONENT_NAME=yt,exports.SolvimonCheckout=vt,exports.defineSolvimonCheckout=()=>{customElements.get(yt)||customElements.define(yt,vt)};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-BeqkeC9h.js"),i=require("../../subscriptions-DERHtyHo.js"),n=require("../../_Uint8Array-DxISR7XF.js"),o=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Ck_1lRDB.js"),a=require("../../invoices-CUrXmVXe.js"),r=require("../../index-DRdBmZ2-.js"),l=require("../../index-2jo9BSPM.js"),c=require("../../cloneDeep-DranHQkY.js"),u=require("../../paymentMethods-D_rYLg3F.js"),d=require("../../useService-D-CUtlp3.js"),s=require("../../ContentWithAsideLayout-BjJufFeN.js"),p=require("../../PricingGroupContent.vue_vue_type_script_setup_true_lang-BOZurit_.js"),m=require("../../index-CWSXne1Q.js"),g=require("../../Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js"),f=require("../../payments-ClJySb0d.js");var v=n.Symbol?n.Symbol.prototype:void 0;v&&v.toString;var y=Object.prototype.hasOwnProperty;var _=0;function h(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function b(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?h(Object(i),!0).forEach(function(t){M(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):h(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function M(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function N(e){return"function"==typeof e}function I(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function k(e){return N(e.$validator)?b({},e):{$validator:e}}function C(e){return"object"==typeof e?e.$valid:e}function x(e){return e.$validator||e}const E=t=>{if(t=e.unref(t),Array.isArray(t))return!!t.length;if(null==t)return!1;if(!1===t)return!0;if(t instanceof Date)return!isNaN(t.getTime());if("object"==typeof t){for(let e in t)return!0;return!1}return!!String(t).length};function D(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return t=>(t=e.unref(t),!E(t)||i.every(e=>(e.lastIndex=0,e.test(t))))}var A=Object.freeze({__proto__:null,forEach:function(t){return{$validator(i){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return e.unref(i).reduce((e,i,n)=>{const a=Object.entries(i).reduce((e,a)=>{let[r,l]=a;const c=t[r]||{},u=Object.entries(c).reduce((e,t)=>{let[a,c]=t;const u=x(c).call(this,l,i,n,...o),d=C(u);if(e.$data[a]=u,e.$data.$invalid=!d||!!e.$data.$invalid,e.$data.$error=e.$data.$invalid,!d){let t=c.$message||"";const i=c.$params||{};"function"==typeof t&&(t=t({$pending:!1,$invalid:!d,$params:i,$model:l,$response:u})),e.$errors.push({$property:r,$message:t,$params:i,$response:u,$model:l,$pending:!1,$validator:a})}return{$valid:e.$valid&&d,$data:e.$data,$errors:e.$errors}},{$valid:!0,$data:{},$errors:[]});return e.$data[r]=u.$data,e.$errors[r]=u.$errors,{$valid:e.$valid&&u.$valid,$data:e.$data,$errors:e.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:e.$valid&&a.$valid,$data:e.$data.concat(a.$data),$errors:e.$errors.concat(a.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:e=>{let{$response:t}=e;return t?t.$errors.map(e=>Object.values(e).map(e=>e.map(e=>e.$message)).reduce((e,t)=>e.concat(t),[])):[]}}},len:t=>(t=e.unref(t),Array.isArray(t)?t.length:"object"==typeof t?Object.keys(t).length:String(t).length),normalizeValidatorObject:k,regex:D,req:E,unwrap:e.unref,unwrapNormalizedValidator:x,unwrapValidatorResponse:C,withAsync:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return b(b({},k(e)),{},{$async:!0,$watchTargets:t})},withMessage:function(t,i){if(!N(t)&&"string"!=typeof e.unref(t))throw new Error('[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided '+typeof t);if(!I(i)&&!N(i))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const n=k(i);return n.$message=t,n},withParams:function(e,t){if(!I(e))throw new Error('[@vuelidate/validators]: First parameter to "withParams" should be an object, provided '+typeof e);if(!I(t)&&!N(t))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const i=k(t);return i.$params=b(b({},i.$params||{}),e),i}});D(/^[a-zA-Z]*$/),D(/^[a-zA-Z0-9]*$/),D(/^\d*(\.\d+)?$/);D(/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i);D(/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i),D(/(^[0-9]*$)|(^-[0-9]+$)/),D(/^[-]?\d*(\.\d+)?$/);const w={AT:{regex:/^ATU\d{8}$/,prefix:"AT",example:"ATU12345678"},BE:{regex:/^BE0?\d{9}$/,prefix:"BE",example:"BE0123456789"},BG:{regex:/^BG\d{9,10}$/,prefix:"BG",example:"BG123456789"},HR:{regex:/^HR\d{11}$/,prefix:"HR",example:"HR12345678901"},CY:{regex:/^CY\d{8}[A-Z]$/,prefix:"CY",example:"CY12345678X"},CZ:{regex:/^CZ\d{8,10}$/,prefix:"CZ",example:"CZ12345678"},DE:{regex:/^DE\d{9}$/,prefix:"DE",example:"DE123456789"},DK:{regex:/^DK\d{8}$/,prefix:"DK",example:"DK12345678"},EE:{regex:/^EE\d{9}$/,prefix:"EE",example:"EE123456789"},GR:{regex:/^(EL|GR)\d{9}$/,prefix:"GR",example:"GR123456789"},ES:{regex:/^ES[A-Z0-9]\d{7}[A-Z0-9]$/,prefix:"ES",example:"ESX1234567X"},FI:{regex:/^FI\d{8}$/,prefix:"FI",example:"FI12345678"},FR:{regex:/^FR[0-9A-Z]{2}\d{9}$/,prefix:"FR",example:"FRXX123456789"},HU:{regex:/^HU\d{8}$/,prefix:"HU",example:"HU12345678"},IE:{regex:/^IE[0-9A-Z]{8,9}$/,prefix:"IE",example:"IE1234567A"},IS:{regex:/^IS\d{5}$/,prefix:"IS",example:"IS12345"},IT:{regex:/^IT\d{11}$/,prefix:"IT",example:"IT12345678901"},LT:{regex:/^LT(\d{9}|\d{12})$/,prefix:"LT",example:"LT123456789 or LT123456789012"},LU:{regex:/^LU\d{8}$/,prefix:"LU",example:"LU12345678"},LV:{regex:/^LV\d{11}$/,prefix:"LV",example:"LV12345678901"},ME:{regex:/^ME\d{9}$/,prefix:"ME",example:"ME123456789"},MT:{regex:/^MT\d{8}$/,prefix:"MT",example:"MT12345678"},NL:{regex:/^NL\d{9}B\d{2}$/,prefix:"NL",example:"NL123456789B01"},PL:{regex:/^PL\d{10}$/,prefix:"PL",example:"PL1234567890"},PT:{regex:/^PT\d{9}$/,prefix:"PT",example:"PT123456789"},RO:{regex:/^RO\d{2,10}$/,prefix:"RO",example:"RO1234567890"},RU:{regex:/^RU(\d{9}|\d{10}|\d{12})$/,prefix:"RU",example:"RU123456789 or RU1234567890 or RU123456789012"},SE:{regex:/^SE\d{10}01$/,prefix:"SE",example:"SE123456789001"},SI:{regex:/^SI\d{8}$/,prefix:"SI",example:"SI12345678"},SK:{regex:/^SK\d{10}$/,prefix:"SK",example:"SK1234567890"},CH:{regex:/^CHE\d{9}(MWST|TVA|IVA)?$/,prefix:"CHE",example:"CHE123456789MWST"},NO:{regex:/^NO\d{9}MVA$/,prefix:"NO",example:"NO123456789MVA"},GB:{regex:/^GB(\d{9}|\d{12}|GD\d{3}|HA\d{3})$/,prefix:"GB",example:"GB123456789"},XI:{regex:/^XI(\d{9}|\d{12})$/,prefix:"XI",example:"XI123456789"}},P=A.withMessage(({$model:i})=>{if(!i||"string"!=typeof i||""===i.trim())return"";const n=e.inject(t.I18N_INJECTION_KEY,null);if(!n)return"Invalid tax ID";const{formatMessage:o}=n,a=Object.values(w).find(e=>i.toUpperCase().startsWith(e.prefix.toUpperCase()));return a?o({defaultMessage:"Invalid tax ID format. Example: {example}",id:"form_validation.tax_id.invalid_format",description:"Error message when tax ID format is invalid but prefix matches"},{example:a.example}):o({defaultMessage:"Invalid tax ID",id:"taxId.invalid",description:"Error message when tax ID is invalid"})},e=>!e||"string"!=typeof e||""===e.trim()||Object.values(w).some(t=>t.regex.test(e))),B=e=>{if(null==e)return!1;const t=String(e);return/^\S+$/.test(t)};A.withMessage("Everything but whitespace",B);function S({pricingPlanScheduleInfos:e,type:t}){return e.find(e=>e.pricing_plan_schedule.type===t)}function V({enabledPricings:e,seatsValues:t,pricingPlanScheduleInfos:i,pricingCurrency:n,billingPeriod:o}){const a=S({pricingPlanScheduleInfos:i,type:"DEFAULT"});if(a&&(e||t))return[{pricing_plan_schedule_id:a.id,enabled_pricings:e,seats_values:null==t?void 0:t.map(({pricing_item_config_id:e,number:t})=>({pricing_item_config_id:e,number:t})),...n&&{pricing_currency:n},...o&&{billing_period:o}}]}A.withMessage("Everything but whitespace",e=>!A.req(e)||B(String(e)));const T={AD:"EUR",AE:"AED",AF:"AFN",AG:"XCD",AI:"XCD",AL:"ALL",AM:"AMD",AO:"AOA",AR:"ARS",AS:"USD",AT:"EUR",AU:"AUD",AW:"AWG",AX:"EUR",AZ:"AZN",BA:"BAM",BB:"BBD",BD:"BDT",BE:"EUR",BF:"XOF",BG:"BGN",BH:"BHD",BI:"BIF",BJ:"XOF",BL:"EUR",BM:"BMD",BN:"BND",BO:"BOB",BQ:"USD",BR:"BRL",BS:"BSD",BT:"BTN",BV:"NOK",BW:"BWP",BY:"BYN",BZ:"BZD",CA:"CAD",CC:"AUD",CD:"CDF",CF:"XAF",CG:"XAF",CH:"CHF",CI:"XOF",CK:"NZD",CL:"CLP",CM:"XAF",CN:"CNY",CO:"COP",CR:"CRC",CU:"CUP",CV:"CVE",CW:"ANG",CX:"AUD",CY:"EUR",CZ:"CZK",DE:"EUR",DJ:"DJF",DK:"DKK",DM:"XCD",DO:"DOP",DZ:"DZD",EC:"USD",EE:"EUR",EG:"EGP",EH:"MAD",ER:"ERN",ES:"EUR",ET:"ETB",FI:"EUR",FJ:"FJD",FK:"FKP",FM:"USD",FO:"DKK",FR:"EUR",GA:"XAF",GB:"GBP",GD:"XCD",GE:"GEL",GF:"EUR",GG:"GBP",GH:"GHS",GI:"GIP",GL:"DKK",GM:"GMD",GN:"GNF",GP:"EUR",GQ:"XAF",GR:"EUR",GS:"GBP",GT:"GTQ",GU:"USD",GW:"XOF",GY:"GYD",HK:"HKD",HM:"AUD",HN:"HNL",HR:"EUR",HT:"HTG",HU:"HUF",ID:"IDR",IE:"EUR",IL:"ILS",IM:"GBP",IN:"INR",IO:"USD",IQ:"IQD",IR:"IRR",IS:"ISK",IT:"EUR",JE:"GBP",JM:"JMD",JO:"JOD",JP:"JPY",KE:"KES",KG:"KGS",KH:"KHR",KI:"AUD",KM:"KMF",KN:"XCD",KP:"KPW",KR:"KRW",KW:"KWD",KY:"KYD",KZ:"KZT",LA:"LAK",LB:"LBP",LC:"XCD",LI:"CHF",LK:"LKR",LR:"LRD",LS:"LSL",LT:"EUR",LU:"EUR",LV:"EUR",LY:"LYD",MA:"MAD",MC:"EUR",MD:"MDL",ME:"EUR",MF:"EUR",MG:"MGA",MH:"USD",MK:"MKD",ML:"XOF",MM:"MMK",MN:"MNT",MO:"MOP",MP:"USD",MQ:"EUR",MR:"MRU",MS:"XCD",MT:"EUR",MU:"MUR",MV:"MVR",MW:"MWK",MX:"MXN",MY:"MYR",MZ:"MZN",NA:"NAD",NC:"XPF",NE:"XOF",NF:"AUD",NG:"NGN",NI:"NIO",NL:"EUR",NO:"NOK",NP:"NPR",NR:"AUD",NU:"NZD",NZ:"NZD",OM:"OMR",PA:"PAB",PE:"PEN",PF:"XPF",PG:"PGK",PH:"PHP",PK:"PKR",PL:"PLN",PM:"EUR",PN:"NZD",PR:"USD",PS:"ILS",PT:"EUR",PW:"USD",PY:"PYG",QA:"QAR",RE:"EUR",RO:"RON",RS:"RSD",RU:"RUB",RW:"RWF",SA:"SAR",SB:"SBD",SC:"SCR",SD:"SDG",SE:"SEK",SG:"SGD",SH:"SHP",SI:"EUR",SJ:"NOK",SK:"EUR",SL:"SLE",SM:"EUR",SN:"XOF",SO:"SOS",SR:"SRD",SS:"SSP",ST:"STN",SV:"USD",SX:"ANG",SY:"SYP",SZ:"SZL",TC:"USD",TD:"XAF",TF:"EUR",TG:"XOF",TH:"THB",TJ:"TJS",TK:"NZD",TL:"USD",TM:"TMT",TN:"TND",TO:"TOP",TR:"TRY",TT:"TTD",TV:"AUD",TW:"TWD",TZ:"TZS",UA:"UAH",UG:"UGX",US:"USD",UY:"UYU",UZ:"UZS",VA:"EUR",VC:"XCD",VE:"VES",VG:"USD",VI:"USD",VN:"VND",VU:"VUV",WF:"XPF",WS:"WST",YE:"YER",YT:"EUR",ZA:"ZAR",ZM:"ZMW",ZW:"ZWL"},L=({country:e,pricingCurrencySettings:t,fallbackCurrency:i})=>{const n=(e=>{if(e)return T[e]})(e),o=(null==t?void 0:t.pricing_currencies)??[];return n&&o.includes(n)?n:(null==t?void 0:t.default_pricing_currency)??i??n},j=["email","country"],z={US:["addressLine1","postalCode"],CA:["state"]};function O({initialState:i,onRequiredFieldChange:n}){const o=e.ref($(i)),a=e.ref($(i)),u=e.computed(()=>{return(e=o.value.country)&&z[e]?[...z[e],...j]:j;var e}),d=e=>u.value.includes(e),s=t.useValidation({email:{required:r.required,email:r.email},country:{required:r.required},state:{required:r.requiredIf(()=>d("state"))},addressLine1:{required:r.requiredIf(()=>d("addressLine1"))},postalCode:{required:r.requiredIf(()=>d("postalCode"))},companyLegalName:r.requiredIf("ORGANIZATION"===o.value.type),companyVatNumber:{taxId:P}},o),p=e=>{e||fetch("https://api.country.is/").then(e=>e.json()).then(({country:e})=>{o.value.country=e})};return e.onMounted(async()=>{await p(null==i?void 0:i.country)}),l.watchDebounced(()=>c.cloneDeep(o.value),(e,i)=>{const o=t.objectDiff({from:i,to:e}),a=Object.keys(o).find(U);a&&(["type","companyVatNumber"].includes(a)?n(e):"seatsValues"!==a&&"enabledPricingIds"!==a?"email"!==a&&d(a)&&n(e):n(e))},{debounce:200}),{form:o,validation:s,getIsFieldRequired:d,updateInitialState:e=>{const t=$({...o.value,...e});o.value=t,a.value=c.cloneDeep(t)},initialState:a}}const $=(e={})=>({email:void 0,country:void 0,type:"INDIVIDUAL",companyLegalName:void 0,firstName:void 0,infix:void 0,lastName:void 0,addressLine1:void 0,addressLine2:void 0,postalCode:void 0,city:void 0,state:void 0,companyVatNumber:void 0,seatsValues:void 0,enabledPricingIds:void 0,...e});function U(e){return e in $()}function R(e){return e.pricing_plan_schedule_infos.flatMap(e=>{var t;return(null==(t=e.pricing_plan_version.pricing_categories)?void 0:t.flatMap(e=>e.pricing_groups??[]))??[]})}function F(e){var t,i;return function(e){if(null==e)return!0;if(n.isArrayLike(e)&&(n.isArray(e)||"string"==typeof e||"function"==typeof e.splice||n.isBuffer(e)||n.isTypedArray(e)||n.isArguments(e)))return!e.length;var t=n.getTag(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(n.isPrototype(e))return!n.baseKeys(e).length;for(var i in e)if(y.call(e,i))return!1;return!0}(e.name)?null==(i=null==(t=e.products)?void 0:t[0])?void 0:i.name:e.name}function G(e,t=void 0){const i=t??[],n=R(e);for(const o of n)if(["EXACTLY_ONE","AT_LEAST_ONE"].includes(o.selection_constraint)){const e=o.pricings.map(e=>e.id);if(null==t?void 0:t.some(t=>e.includes(t)))continue;i.push(o.pricings[0].id)}return i}function Y({initialCountry:r,initialEmail:c,subscriptionId:s,enabledPricingIds:p}){const m=e.ref(!1),g=e.ref(),{getSubscription:f}=i.createSubscriptionsService(),v=(()=>{const{getInvoicePreview:i}=a.createInvoicesService(),r=e.ref(),l=e.ref(),c=e.ref(),u=e.ref({}),d=e.ref(n.ApiStatus.Initial),s=e.ref({}),p=e.ref(),m=e=>`${e.type}:${e.value}`;return{loadInvoicePreview:async({subscription:e,subscriptionStartAt:a,checkoutForm:g,enabledPricingIds:f,promotionCode:v})=>{var y,_,h,b,M;const N={...g.addressLine1&&{line1:g.addressLine1},...g.addressLine2&&{line2:g.addressLine2},...g.city&&{city:g.city},...g.state&&{state:g.state},...g.country?{country:g.country||"NL"}:{country:"NL"},...g.postalCode&&{postal_code:g.postalCode}};d.value=n.ApiStatus.Loading;const I=S({pricingPlanScheduleInfos:e.pricing_plan_schedule_infos,type:"DEFAULT"}),k=null==(y=null==I?void 0:I.pricing_plan_version)?void 0:y.pricing_currency_settings,C=((null==(_=null==k?void 0:k.pricing_currencies)?void 0:_.length)??0)>1,x=(null==(b=null==(h=null==I?void 0:I.pricing_plan_version)?void 0:h.billing_period_settings)?void 0:b.billing_periods)??[],E=x.length>1,D=x.length>0?x.map(({period:e})=>e):e.billing_period?[e.billing_period]:[],A=L({country:g.country,pricingCurrencySettings:k,fallbackCurrency:e.billing_currency});if(!D.length)return void(d.value=n.ApiStatus.Done);const w=e.billing_period?m(e.billing_period):m(D[0]),B=D.map(async t=>{var n;const r=m(t),l=V({enabledPricings:null==f?void 0:f.map(e=>({pricing_id:e})),seatsValues:g.seatsValues,pricingPlanScheduleInfos:e.pricing_plan_schedule_infos,pricingCurrency:C?A:void 0,billingPeriod:E?t:void 0})??[];if(v){const t=null==(n=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"DEFAULT"===e.type))?void 0:n.id;if(t){const e=l.find(({pricing_plan_schedule_id:e})=>e===t);e?e.promotion_codes=[v]:l.push({pricing_plan_schedule_id:t,promotion_codes:[v]})}}const c={pricingPlanSubscriptionId:e.id,startAt:a,customizations:l,customer:{type:g.type||"INDIVIDUAL",..."INDIVIDUAL"===g.type&&{individual:{residential_address:N}},..."ORGANIZATION"===g.type&&{organization:{legal_name:g.companyLegalName||"preview",registered_address:N,...g.companyVatNumber&&{tax_id:P.$validator(g.companyVatNumber,{},{})?g.companyVatNumber:void 0}}}}},u=s.value[r];return u&&o.lodashExports.isEqual(c,u)?{periodKey:r,response:void 0}:(s.value={...s.value,[r]:c},{periodKey:r,response:await i(c)})});try{const i={...u.value},n=await Promise.all(B),o=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"TRIAL"===e.type),a=null==(M=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"DEFAULT"===e.type))?void 0:M.id;n.forEach(({periodKey:e,response:n})=>{var c;if(!n)return;p.value=null==(c=n.invoice_infos.at(-1))?void 0:c.pricing_plan_schedule_id,o&&(l.value=n.first_invoice,o.start_at&&o.end_at&&(r.value=t.convertDateRangeToTimePeriod(new Date(o.start_at),new Date(o.end_at))));const u=n.invoice_infos.find(({pricing_plan_schedule_id:e})=>e===a),d=null==u?void 0:u.invoices[0];d&&(i[e]=d)}),u.value=i,c.value=i[w]}catch(T){throw d.value=n.ApiStatus.Failed,T}finally{d.value=n.ApiStatus.Done}},invoicePreview:c,invoicePreviewByBillingPeriod:u,trialInvoicePreview:l,trialPeriod:r,lastPreviewScheduleId:p,isPending:e.computed(()=>d.value===n.ApiStatus.Loading)}})(),y=e.computed(()=>g.value&&N.form.value.country&&k.value),{paymentMethodOptions:_,loadPaymentMethodOptions:h,isPending:b}=(()=>{const t=e.ref(),{getPaymentMethodOptions:i}=u.createPaymentMethodsService(),{data:n,execute:a,isPending:r}=d.useService({initialValue:[],service:i});return{loadPaymentMethodOptions:async({subscriptionId:e,country:i,amount:n})=>{const r={subscriptionId:e,country:i,amount:n};o.lodashExports.isEqual(r,t.value)||(t.value=r,await a(r))},paymentMethodOptions:n,isPending:r}})(),M=()=>{const e={subscription:g.value,checkoutForm:N.form.value,enabledPricingIds:p,promotionCode:N.form.value.promotionCode};return N.form.value.enabledPricingIds&&(e.enabledPricingIds=N.form.value.enabledPricingIds),v.loadInvoicePreview(e)},N=O({initialState:{country:r,email:c},onRequiredFieldChange:()=>{g.value&&M().catch(()=>{})}}),I=e.computed(()=>{var e,t,i,n,o,a,r,l,c;const u=N.form.value.firstName||N.form.value.infix||N.form.value.lastName?{...N.form.value.firstName?{first_name:N.form.value.firstName}:{},...N.form.value.infix?{infix:N.form.value.infix}:{},...N.form.value.lastName?{last_name:N.form.value.lastName}:{}}:{},d={...N.form.value.addressLine1&&{line1:N.form.value.addressLine1},...N.form.value.addressLine2&&{line2:N.form.value.addressLine2},...N.form.value.city&&{city:N.form.value.city},...N.form.value.postalCode&&{postal_code:N.form.value.postalCode},...N.form.value.state&&{state:N.form.value.state},country:N.form.value.country??""},p=S({pricingPlanScheduleInfos:(null==(e=g.value)?void 0:e.pricing_plan_schedule_infos)??[],type:"DEFAULT"}),m=null==(t=null==p?void 0:p.pricing_plan_version)?void 0:t.pricing_currency_settings,f=((null==(i=null==m?void 0:m.pricing_currencies)?void 0:i.length)??0)>1,v=((null==(o=null==(n=null==p?void 0:p.pricing_plan_version)?void 0:n.billing_period_settings)?void 0:o.billing_periods)??[]).length>1,y=V({enabledPricings:null==(a=N.form.value.enabledPricingIds)?void 0:a.map(e=>({pricing_id:e})),seatsValues:N.form.value.seatsValues,pricingPlanScheduleInfos:(null==(r=g.value)?void 0:r.pricing_plan_schedule_infos)??[],pricingCurrency:f?null==(l=g.value)?void 0:l.billing_currency:void 0,billingPeriod:v?null==(c=g.value)?void 0:c.billing_period:void 0}),_=N.form.value.promotionCode,h=_&&g.value?(()=>{var e,t,i;const n=y?[...y]:[],o=(null==(e=n[0])?void 0:e.pricing_plan_schedule_id)??(null==(i=S({pricingPlanScheduleInfos:(null==(t=g.value)?void 0:t.pricing_plan_schedule_infos)??[],type:"DEFAULT"}))?void 0:i.id);if(!o)return y;const a=n.find(({pricing_plan_schedule_id:e})=>e===o);if(a)a.promotion_codes=[_];else{const e=null==y?void 0:y[0];n.push({pricing_plan_schedule_id:o,...(null==e?void 0:e.enabled_pricings)&&{enabled_pricings:e.enabled_pricings},...(null==e?void 0:e.seats_values)&&{seats_values:e.seats_values},promotion_codes:[_]})}return n})():y;return{type:"INIT_PRICING_PLAN_SUBSCRIPTION",init_pricing_plan_subscription:{template_pricing_plan_subscription_id:s,...h&&{pricing_plan_schedule_customizations:h},customer_details:{email:N.form.value.email??"",type:N.form.value.type,..."INDIVIDUAL"===N.form.value.type?{individual:{residential_address:d,...u?{name:u}:{}}}:{organization:{registered_address:d,legal_name:N.form.value.companyLegalName??"",...N.form.value.companyVatNumber&&P.$validator(N.form.value.companyVatNumber,{},{})?{tax_ids:[{id:N.form.value.companyVatNumber,type:"GENERIC_TAX_ID"}]}:{}}}}}}}),k=e.computed(()=>{var e,t;return(null==(e=v.trialInvoicePreview.value)?void 0:e.invoice_amount_including_tax)??(null==(t=v.invoicePreview.value)?void 0:t.invoice_amount_including_tax)});return e.watch([()=>N.form.value.country,k],([e,t])=>{g.value&&e&&t&&h({subscriptionId:g.value.id,country:e,amount:t})}),e.onMounted(async()=>{await(async()=>{var e,t,i,n,o,a;const r=await f({id:s,expanded:!0}),l=S({pricingPlanScheduleInfos:r.pricing_plan_schedule_infos,type:"DEFAULT"}),c=null==(n=null==(i=null==(t=null==(e=null==l?void 0:l.pricing_plan_version)?void 0:e.billing_period_settings)?void 0:t.billing_periods)?void 0:i[0])?void 0:n.period;g.value={...r,billing_period:c??r.billing_period},N.updateInitialState({...N.form.value,enabledPricingIds:G(r,p),...(null==(o=null==l?void 0:l.pricing_plan_schedule)?void 0:o.seats_values)?{seatsValues:null==(a=null==l?void 0:l.pricing_plan_schedule)?void 0:a.seats_values.map(({pricing_item_config_id:e,number:t})=>({pricing_item_config_id:e,number:t}))}:{}})})();try{await M()}catch{}}),l.watchOnce(y,e=>{e&&h({subscriptionId:g.value.id,country:N.form.value.country,amount:k.value})}),{invoicePreview:v.invoicePreview,invoicePreviewByBillingPeriod:v.invoicePreviewByBillingPeriod,trialInvoicePreview:v.trialInvoicePreview,trialPeriod:v.trialPeriod,loadInvoicePreview:M,updateInvoicePreviewOnBillingInformationChange:async e=>{const t=e.promotionCode??N.form.value.promotionCode,i=e.enabledPricingIds??N.form.value.enabledPricingIds;return await v.loadInvoicePreview({subscription:g.value,checkoutForm:{...N.form.value,...e},enabledPricingIds:i,promotionCode:t}),{trialInvoicePreview:v.trialInvoicePreview.value,invoicePreview:v.invoicePreview.value}},lastPreviewScheduleId:v.lastPreviewScheduleId,paymentMethodOptions:_,isPaymentMethodsPending:b,isInvoicePreviewPending:v.isPending,subscription:g,checkoutForm:N,authorizationContext:I,isPaid:m,amount:k}}const K={class:"grid grid-cols-1 gap-1"},q={class:"grid grid-cols-1 gap-2"},H={key:0},Q={class:"mt-2 flex flex-col gap-3"},Z={class:"grid grid-cols-3 gap-2"},X={class:"flex grow flex-col"},W={key:0},J={class:"mt-4 grid grid-cols-1 gap-3"},ee=e.defineComponent({__name:"CheckoutForm",props:e.mergeModels({validation:{type:null},initialState:{type:Object},readOnlyEmail:{type:String},showCustomerInfoOnTop:{type:Boolean},isBillingInformationMandatory:{type:Boolean},getIsFieldRequired:{type:Function},readOnly:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["submit"],["update:modelValue"]),setup(i){const n=i,o=e.ref(!1),a=e.useModel(i,"modelValue"),r=e.computed({get:()=>"ORGANIZATION"===a.value.type,set:e=>{a.value.type=e?"ORGANIZATION":"INDIVIDUAL"}}),l=e.computed(()=>"ORGANIZATION"===a.value.type),c=e.computed(()=>"US"!==a.value.country),{$t:u}=t.useIntl(),d=e=>n.getIsFieldRequired(e)?"":" "+u({defaultMessage:"(optional)",id:"checkout.optional_suffix.label",description:"The suffix for optional fields in the checkout form"}),s=e.computed(()=>a.value.country?t.getCountryNameByCode(a.value.country):void 0);return(n,p)=>(e.openBlock(),e.createElementBlock("form",{id:"checkout-form",onSubmit:p[12]||(p[12]=e.withModifiers(e=>n.$emit("submit",a.value),["prevent"]))},[e.createElementVNode("div",K,[e.createVNode(e.unref(t._sfc_main$1g),{title:e.unref(u)({defaultMessage:"Customer information",id:"checkout.contact_information_block.title",description:"The title of the contact information block in the checkout form"})},{default:e.withCtx(()=>[e.createElementVNode("div",q,[i.readOnly?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(t._sfc_main$2),{variant:"body",tag:"span",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.value.email),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",tag:"span",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value),1)]),_:1})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.email,"onUpdate:modelValue":p[0]||(p[0]=e=>a.value.email=e),required:"",type:"email",name:"email",disabled:!!i.readOnlyEmail,label:e.unref(u)({defaultMessage:"Email address",id:"checkout.email_address.label",description:"The email address of the customer in the checkout form"}),placeholder:e.unref(u)({defaultMessage:"Email address...",id:"checkout.email_address.placeholder",description:"The email address of the customer in the checkout form"})+d("email"),error:i.validation.value.email.$errors},null,8,["modelValue","disabled","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$1$),{"single-model-value":a.value.country,"onUpdate:singleModelValue":p[3]||(p[3]=e=>a.value.country=e),required:"",name:"country",label:e.unref(u)({defaultMessage:"Billing country",id:"checkout.country.label",description:"The country of the customer in the checkout form"})+d("country"),error:i.validation.value.country.$errors},{"label-suffix":e.withCtx(()=>[o.value||i.isBillingInformationMandatory?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,size:"xs",variant:"ghost","icon-prefix":"add",class:"py-0.5",onClick:p[1]||(p[1]=e=>o.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"More billing details",description:"Label of the button in the checkout that lets you fill out all billing details",id:"checkout.billing_details.add_billing_details_button.label"})),1)]),_:1})),o.value&&!i.isBillingInformationMandatory?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:1,size:"sm",variant:"ghost","icon-prefix":"close",class:"py-0.5",onClick:p[2]||(p[2]=e=>o.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"Remove billing details",id:"checkout.billing_details.remove_billing_details_button.label",description:"Label of the button in the checkout that lets you remove the billing details"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["single-model-value","label","error"])],64))]),e.createVNode(e.unref(t._sfc_main$2j),null,{default:e.withCtx(()=>[o.value||i.isBillingInformationMandatory?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",Q,[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.addressLine1,"onUpdate:modelValue":p[4]||(p[4]=e=>a.value.addressLine1=e),name:"address_line_1",label:e.unref(u)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(u)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"})+d("addressLine1"),required:"",error:i.validation.value.addressLine1.$errors},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.addressLine2,"onUpdate:modelValue":p[5]||(p[5]=e=>a.value.addressLine2=e),name:"address_line_2",placeholder:e.unref(u)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"})+d("addressLine2")},null,8,["modelValue","placeholder"]),e.createElementVNode("div",Z,[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.postalCode,"onUpdate:modelValue":p[6]||(p[6]=e=>a.value.postalCode=e),name:"postal_code",placeholder:e.unref(u)({defaultMessage:"Postal code...",id:"checkout.address.portal_code.placeholder",description:"Postal code of the customer address in the checkout form"})+d("postalCode"),error:i.validation.value.addressLine1.$errors},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.city,"onUpdate:modelValue":p[7]||(p[7]=e=>a.value.city=e),name:"city",placeholder:e.unref(u)({defaultMessage:"City...",id:"checkout.address.city.placeholder",description:"City of the customer address in the checkout form"})+d("city")},null,8,["modelValue","placeholder"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.state,"onUpdate:modelValue":p[8]||(p[8]=e=>a.value.state=e),name:"state",placeholder:e.unref(u)({defaultMessage:"State...",id:"checkout.address.state.placeholder",description:"State of the customer address in the checkout form"})+d("state"),error:i.validation.value.state.$errors},null,8,["modelValue","placeholder","error"])])])])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"]),i.readOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$20),{modelValue:r.value,"onUpdate:modelValue":p[9]||(p[9]=e=>r.value=e),"no-spacing":"","label-position":"before",class:"!flex"},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",X,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"Company purchase",id:"checkout.company_purchase_toggle.title",description:"The title of the company purchase toggle in the checkout"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"I am purchasing on behalf of a company",id:"checkout.company_purchase_toggle.sub_title",description:"The subtitle of the company purchase toggle in the checkout"})),1)]),_:1})])]),_:1},8,["modelValue"]),e.createVNode(e.unref(t._sfc_main$2j),null,{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",J,[c.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2a),{key:0,modelValue:a.value.companyVatNumber,"onUpdate:modelValue":p[10]||(p[10]=e=>a.value.companyVatNumber=e),name:"vat_number",label:e.unref(u)({defaultMessage:"VAT number",id:"checkout.vat_number.label",description:"The label for the vat number in the checkout form"}),placeholder:e.unref(u)({defaultMessage:"VAT number...",id:"checkout.vat_number.placeholder",description:"The label for the vat number in the checkout form"}),error:i.validation.value.companyVatNumber.$errors},null,8,["modelValue","label","placeholder","error"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.companyLegalName,"onUpdate:modelValue":p[11]||(p[11]=e=>a.value.companyLegalName=e),required:"",name:"legal_name",label:e.unref(u)({defaultMessage:"Legal entity name",id:"checkout.legal_name.label",description:"The legal name of the organization customer in the checkout form"}),placeholder:e.unref(u)({defaultMessage:"Legal entity name...",id:"checkout.legal_name.placeholder",description:"The legal name of the organization customer in the checkout form"})},null,8,["modelValue","label","placeholder"])])])):e.createCommentVNode("",!0)]),_:1})]),_:1}))])],32))}}),te={key:0,class:"flex items-center"},ie=["innerHTML"],ne=["innerHTML"],oe=e.defineComponent({__name:"CheckoutTitle",props:{trialPeriod:{type:Object},subscriptionName:{type:String},amount:{type:Object},billingPeriod:{type:Object},countryCode:{type:null},trialStartDate:{type:Date},subscriptionStartDate:{type:Date}},setup(i){const{$t:n}=t.useIntl();return(o,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-1",class:"inline-block"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.trialStartDate?i.subscriptionName:e.unref(n)({defaultMessage:"Pay and subscribe",id:"checkout.page_title",description:"The title of the checkout page"}))+e.toDisplayString(" "),1),i.trialPeriod?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$15),{key:0,"trial-period":i.trialPeriod,size:"lg",class:"-translate-y-0.5"},null,8,["trial-period"])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[i.countryCode?(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:i.trialStartDate?e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting {startDate, date, long}.",id:"checkout.trial_period_description",description:"The description of the trial period"},{price:e.unref(t.formatAmount)(i.amount),startDate:i.subscriptionStartDate,period_name:e.unref(t.formatBillingPeriod)(i.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:e=>`<strong>${e}</strong>`}):e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting today.",id:"checkout.subscription_description",description:"The description of the subscription"},{price:e.unref(t.formatAmount)(i.amount),period_name:e.unref(t.formatBillingPeriod)(i.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:e=>`<strong>${e}</strong>`})},null,8,ne)):(e.openBlock(),e.createElementBlock("span",te,[e.createVNode(e.unref(t._sfc_main$2e),{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(e.unref(t.TooltipContent),null,{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$1s),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Will be determined by billing information",description:"Tooltip content for the invoice preview when taxes are not determined by billing information",id:"invoice_preview.taxes_not_determined_by_billing_information_tooltip"})),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$14),{"width-class":"w-10","height-class":"h-4",shade:"darker",class:"inline-block mr-1.5"})]),_:1}),e.createElementVNode("span",{innerHTML:i.trialStartDate?e.unref(n)({defaultMessage:"per {period_name} starting, {startDate, date, long}",id:"checkout.trial_period_description",description:"The description of the trial period"},{startDate:i.subscriptionStartDate,period_name:e.unref(t.formatBillingPeriod)(i.billingPeriod,{short:!0,hideValueForExactPeriods:!0})}):e.unref(n)({defaultMessage:"per {period_name}, starting today",id:"checkout.subscription_description",description:"The description of the subscription"},{period_name:e.unref(t.formatBillingPeriod)(i.billingPeriod,{short:!0,hideValueForExactPeriods:!0})})},null,8,ie)]))]),_:1})],64))}}),ae={class:"flex w-full min-h-96 justify-center items-center"},re={class:"max-w-sm"},le=e.defineComponent({__name:"CheckoutNotAvailable",setup(i){const{$t:n}=t.useIntl(),o=()=>{window.location.reload()};return(i,a)=>(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",re,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Checkout not available",id:"checkout.not_available.title",description:"The title of the checkout not available page"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"The checkout is currently not available.",id:"checkout.not_available.description",description:"The description of the checkout not available page"}))+" ",1),e.createElementVNode("a",{href:"#",class:"text-primary-900 hover:underline",onClick:e.withModifiers(o,["prevent"])},e.toDisplayString(e.unref(n)({defaultMessage:"Reload",id:"checkout.not_available.reload_button",description:"The label of the reload button"})),1),e.createTextVNode(" "+e.toDisplayString(e.unref(n)({defaultMessage:"this page to try again, or contact customer support.",id:"checkout.not_available.contact_support_message",description:"The message shown when the user wants to contact customer support"})),1)]),_:1})])]))}}),ce=e.defineComponent({__name:"SubscriptionPaymentCompletedCard",props:{redirectUrl:{type:String}},setup(i){const n=i,{$t:a}=t.useIntl();return e.onMounted(()=>{n.redirectUrl&&window.location.replace(n.redirectUrl)}),(n,r)=>(e.openBlock(),e.createBlock(o._sfc_main$1,{status:"success",title:e.unref(a)({defaultMessage:"Payment successful",id:"subscription_payment_completed_card.title",description:"The title for when a payment has been successful"})},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-xs",shade:"lighter",tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Thank you for subscribing.",id:"subscription_payment_completed_card.thank_you_for_subscribing",description:"The text shown after a successful message before a redirect"})),1)]),_:1}),i.redirectUrl?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,to:i.redirectUrl,color:"gray",variant:"outline",size:"xs",class:"align-center"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Continue to merchant",id:"subscription_payment_completed_card.continue",description:"The text for the continue button"})),1)]),_:1},8,["to"])):e.createCommentVNode("",!0)]),_:1},8,["title"]))}}),ue={class:"flex flex-row gap-3 px-3 py-2"},de={class:"grow"},se=e.defineComponent({__name:"SubscriptionSummary",props:{subscription:{type:Object},invoice:{type:Object},loading:{type:Boolean},enabledPricingIds:{type:Array},avatar:{type:String},trialPeriod:{type:Object}},setup(i){const n=i,{$t:o}=t.useIntl(),a=e.computed(()=>{var e,t;return null==(t=null==(e=n.subscription.pricing_plan_schedule_infos)?void 0:e.at(-1))?void 0:t.pricing_plan_version.pricing_plan}),r=e.computed(()=>{var e;return(null==(e=a.value)?void 0:e.name)||n.subscription.name||o({defaultMessage:"Subscription",description:"The fallback name for when no subscription name can be determined",id:"customer_overview.subscriptions_block.fallback_subscription_name"})}),l=e.computed(()=>{var e;return n.subscription.description||(null==(e=a.value)?void 0:e.description)}),c=e.computed(()=>{if(!n.subscription||!n.enabledPricingIds)return;const e=function(e,t){const i=[];return function e(n){Array.isArray(n)?n.forEach(e):n&&"object"==typeof n&&("PRICING"===n.object_type&&t.includes(n.id)&&i.push(n),Object.values(n).forEach(e))}(e),i}(n.subscription,n.enabledPricingIds);return null==e?void 0:e.map(e=>{var t,i;return e.name??(null==(i=null==(t=e.products)?void 0:t[0])?void 0:i.name)}).join(" - ")});return(n,o)=>(e.openBlock(),e.createElementBlock("div",ue,[i.avatar?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2K),{key:0,"image-src":i.avatar,size:"lg",class:"my-1"},null,8,["image-src"])):e.createCommentVNode("",!0),e.createElementVNode("div",de,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1}),c.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:0,variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})):e.createCommentVNode("",!0),l.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" • ")],64)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])]))}}),pe={class:"grid grid-cols-1 gap-1"},me={class:"px-3 py-2"},ge={class:"flex flex-col gap-3"},fe={class:"px-3 py-2"},ve=e.defineComponent({__name:"OrderSummary",props:{subscription:{type:Object},invoice:{type:Object},invoicePreviewByBillingPeriod:{type:Object},trialInvoice:{type:Object},enabledPricingIds:{type:Array},trialPeriod:{type:Object},avatar:{type:String},isPaid:{type:Boolean},isUsageBased:{type:Boolean},isPreviewAndPaymentMethodsPending:{type:Boolean},collapsible:{type:String},noTitle:{type:Boolean},countryCode:{type:null},variant:{type:String}},emits:["billing-period-change"],setup(i,{emit:n}){const o=i,a=n,{$t:r}=t.useIntl(),{map:l,formatTimePeriod:c}=t.useTimePeriod(),u=m.useBreakpoints(m.breakpointsTailwind).smaller("md"),d=e.computed(()=>u.value?"sm":"xs"),s=e=>`${e.type}:${e.value}`,g=["DAY","WEEK","MONTH","YEAR"],f=e=>g.includes(e),v=e=>{if(!e)return;const[t,i]=e.split(":"),n=Number(i);return n&&f(t)?{type:t,value:n}:void 0},y=e.computed({get:()=>{const e=o.subscription.billing_period;return e?`${e.type}:${e.value}`:void 0},set:e=>{if(!e)return;const[t,i]=e.split(":"),n=Number(i);n&&f(t)&&a("billing-period-change",{type:t,value:n})}}),_=e=>{var i,n,a,l;const u=null==(l=null==(a=null==(n=null==(i=o.invoicePreviewByBillingPeriod)?void 0:i[s(e)])?void 0:n.periods)?void 0:a[0])?void 0:l.amount_including_tax;if(!u)return;const d="MONTH"===e.type&&3===e.value?r({defaultMessage:"/quarter",id:"checkout.order_summary_block.billing_period.per_quarter",description:"Period label for quarterly billing"}):r({defaultMessage:"/{period}",id:"checkout.order_summary_block.billing_period.per_label",description:"Period label for billing cycles"},{period:c(e,{prefix:!1,hideValueForExactPeriods:!0})});return r({defaultMessage:"{amount}{period}",id:"checkout.order_summary_block.billing_period.sub_label",description:"Billing period option sublabel showing price per period"},{amount:t.formatAmount(u),period:d})},h=e=>{var t,i,n,a;return null==(a=null==(n=null==(i=null==(t=o.invoicePreviewByBillingPeriod)?void 0:t[s(e)])?void 0:i.periods)?void 0:n[0])?void 0:a.amount_including_tax},b=e=>Number(e.quantity),M=(e,t)=>{if(!t)return;const i={DAY:365,WEEK:52,MONTH:12,YEAR:1}[e.type]/Math.max(e.value??1,1),n=b(t)*i;return Number.isFinite(n)?{quantity:n.toFixed(2),currency:t.currency}:void 0},N=(e,t)=>{if(!e||!t)return;const i=b(e)-b(t);return!Number.isFinite(i)||i<=0?void 0:{quantity:i.toFixed(2),currency:e.currency}},I=e=>{if(!e)return;return`${r({defaultMessage:"Save {amount}",id:"checkout.order_summary_block.billing_period.save_badge.prefix",description:"First line for the savings badge label"},{amount:t.formatAmount(e)})}${r({defaultMessage:"/year",id:"checkout.order_summary_block.billing_period.save_badge.suffix",description:"Second line for the savings badge label"})}`},k=e.computed(()=>{var e,t,i;const n=S({pricingPlanScheduleInfos:o.subscription.pricing_plan_schedule_infos??[],type:"DEFAULT"}),a=(null==(t=null==(e=null==n?void 0:n.pricing_plan_version)?void 0:e.billing_period_settings)?void 0:t.billing_periods)??[],r=new Map,l=e=>{e&&r.set(s(e),e)},c=e=>{var t;null==(t=null==e?void 0:e.items)||t.forEach(e=>{var t,i,n;null==(t=e.configs)||t.forEach(e=>l(e.billing_period)),null==(i=e.billing_period_configs)||i.forEach(e=>l(e.billing_period)),null==(n=e.pricing_currency_configs)||n.forEach(e=>{var t,i;null==(t=e.configs)||t.forEach(e=>l(e.billing_period)),null==(i=e.billing_period_configs)||i.forEach(e=>l(e.billing_period))})})};if(((null==(i=null==n?void 0:n.pricing_plan_version)?void 0:i.pricing_categories)??[]).forEach(e=>{var t,i;null==(t=e.pricings)||t.forEach(e=>c(e)),null==(i=e.pricing_groups)||i.forEach(e=>{var t;return null==(t=e.pricings)?void 0:t.forEach(e=>c(e))})}),!r.size)return[];const u=a.map(e=>r.get(s(e.period))).filter(e=>!!e),d=new Set(u.map(s)),p=[...r.values()].filter(e=>!d.has(s(e)));return[...u,...p]}),C=e.computed(()=>{const e=k.value[k.value.length-1],i=e?M(e,h(e)):void 0;return k.value.map(n=>{const o="MONTH"===n.type&&3===n.value?r({defaultMessage:"Billed quarterly",id:"checkout.order_summary_block.billing_period.quarterly",description:"Billing period option label for quarterly billing"}):r({defaultMessage:"Billed {period}",id:"checkout.order_summary_block.billing_period.label",description:"Billing period option label for the selected period"},{period:l.value[n.type].full}),a=h(n),c=M(n,a),u=e&&n.type===e.type&&n.value===e.value?void 0:N(c,i),s=I(u);return{label:o,subLabel:_(n),labelSuffixComponent:s?{component:t._sfc_main$3,props:{color:"primary",content:s,size:d.value,class:"whitespace-nowrap text-left leading-tight"}}:void 0,hidden:y.value===`${n.type}:${n.value}`,value:`${n.type}:${n.value}`}})}),x=e.computed(()=>{const e=C.value,t=e[0],i=e[e.length-1];return{smallestPeriod:null==t?void 0:t.value,biggestPeriod:null==i?void 0:i.value}}),E=e.computed(()=>C.value.find(e=>e.value===x.value.biggestPeriod)),D=e.computed(()=>C.value.find(e=>e.value===y.value)),A=e.computed(()=>{var e,t,i,n,a,r,l,c;const u=C.value,d=u[u.length-1],s=y.value;if(!d||!s)return"";if(s===d.value)return"";const p=v(d.value);if(!p)return"";const m=null==(n=null==(i=null==(t=null==(e=o.invoicePreviewByBillingPeriod)?void 0:e[d.value])?void 0:t.periods)?void 0:i[0])?void 0:n.amount_including_tax,g=v(s),f=null==(c=null==(l=null==(r=null==(a=o.invoicePreviewByBillingPeriod)?void 0:a[s])?void 0:r.periods)?void 0:l[0])?void 0:c.amount_including_tax;if(!g||!f)return"";const _=M(g,f),h=M(p,m);return I(N(_,h))??""}),w=e=>{const{smallestPeriod:t,biggestPeriod:i}=x.value;y.value=e?i:t};return(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-border":"","no-spacing":"","content-background":"none",title:i.noTitle?void 0:e.unref(r)({defaultMessage:"Order summary",id:"checkout.order_summary_block.title",description:"The title of the order summary block that lists the subscription cost in the checkout"})},{default:e.withCtx(()=>[e.createElementVNode("div",pe,[e.createVNode(e.unref(t._sfc_main$1g),{"no-spacing":""},{default:e.withCtx(()=>[i.subscription?(e.openBlock(),e.createBlock(se,{key:0,avatar:i.avatar,invoice:i.invoice,subscription:i.subscription,"enabled-pricing-ids":i.enabledPricingIds,loading:i.isPreviewAndPaymentMethodsPending,"trial-period":i.trialPeriod},null,8,["avatar","invoice","subscription","enabled-pricing-ids","loading","trial-period"])):e.createCommentVNode("",!0)]),_:1}),2===C.value.length?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:0,"no-spacing":"","content-classes":y.value===x.value.biggestPeriod?"border-primary-500":void 0},{default:e.withCtx(()=>{var i;return[e.createElementVNode("div",me,[e.createElementVNode("div",ge,[E.value?(e.openBlock(),e.createBlock(p._sfc_main,{key:0,name:E.value.label,description:(null==(i=D.value)?void 0:i.subLabel)??""},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$20),{"model-value":y.value===x.value.biggestPeriod,"show-suffix-label-in-input":"","onUpdate:modelValue":w},null,8,["model-value"])]),_:2},[A.value?{name:"badge",fn:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$3),{color:"primary",content:A.value,size:d.value,class:"whitespace-nowrap text-left leading-tight"},null,8,["content","size"])]),key:"0"}:void 0]),1032,["name","description"])):e.createCommentVNode("",!0)])])]}),_:1},8,["content-classes"])):C.value.length>2?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1T),{key:1,"single-model-value":y.value,"onUpdate:singleModelValue":o[0]||(o[0]=e=>y.value=e),options:C.value,size:"xl","has-large-dropdown":"","show-sub-label-in-input":"","show-suffix-in-closed-input":""},null,8,["single-model-value","options"])):e.createCommentVNode("",!0),i.isUsageBased?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:2,"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",fe,[e.createVNode(e.unref(t._sfc_main$2),{"no-spacing":"",variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"+ Usage",id:"checkout.invoice_preview.usage_based_message",description:"The message shown for the usage based invoice preview"})),1)]),_:1})])]),_:1})):e.createCommentVNode("",!0),i.invoice&&"products-inline"!==i.variant?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$a),{key:3,invoice:i.invoice,"wrapper-component":e.unref(t._sfc_main$1g)},null,8,["invoice","wrapper-component"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$1g),null,{default:e.withCtx(()=>[i.invoice?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$9),{key:0,variant:"products-inline"===i.variant?"default":"without-products",invoice:i.invoice,"trial-invoice":i.trialInvoice,"is-paid":i.isPaid,collapsible:i.collapsible,"is-preview-without-taxes":!i.countryCode,"is-customer-facing":""},null,8,["variant","invoice","trial-invoice","is-paid","collapsible","is-preview-without-taxes"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Please select a country first",description:"The message shown for the invoice preview when no country is set",id:"checkout.invoice_preview.no_country_selected_message"})),1)]),_:1}))]),_:1})])]),_:1},8,["title"]))}}),ye={class:"py-4 flex flex-col items-center justify-center"},_e=e.defineComponent({__name:"EmptyStatePlaceholder",props:{icon:{type:null}},setup:i=>(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),null,{default:e.withCtx(()=>[e.createElementVNode("div",ye,[e.createVNode(e.unref(t._sfc_main$4),{icon:i.icon,size:"lg",class:"text-gray-500"},null,8,["icon"]),e.createVNode(e.unref(t._sfc_main$2),{center:"",tag:"span",variant:"body-sm",weight:"semibold",shade:"lighter",class:"mt-2"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"title")]),_:3}),e.createVNode(e.unref(t._sfc_main$2),{center:"",tag:"span",variant:"body-xs",shade:"lightest",class:"mt-1"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"message")]),_:3})])]),_:3}))}),he={key:0,id:"svg-logo",viewBox:"0 0 35 15",class:"h-[44px]"},be={key:1,src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAxcHgiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAxMDEgMzIiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaW5ZTWluIG1lZXQiIHhtbG5zPSJodHRwOiYjeDJGOyYjeDJGO3d3dy53My5vcmcmI3gyRjsyMDAwJiN4MkY7c3ZnIj48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDEyLjIzNyAyLjggTCA0LjQzNyAyLjggQyAzLjkzNyAyLjggMy40MzcgMy4yIDMuMzM3IDMuNyBMIDAuMjM3IDIzLjcgQyAwLjEzNyAyNC4xIDAuNDM3IDI0LjQgMC44MzcgMjQuNCBMIDQuNTM3IDI0LjQgQyA1LjAzNyAyNC40IDUuNTM3IDI0IDUuNjM3IDIzLjUgTCA2LjQzNyAxOC4xIEMgNi41MzcgMTcuNiA2LjkzNyAxNy4yIDcuNTM3IDE3LjIgTCAxMC4wMzcgMTcuMiBDIDE1LjEzNyAxNy4yIDE4LjEzNyAxNC43IDE4LjkzNyA5LjggQyAxOS4yMzcgNy43IDE4LjkzNyA2IDE3LjkzNyA0LjggQyAxNi44MzcgMy41IDE0LjgzNyAyLjggMTIuMjM3IDIuOCBaIE0gMTMuMTM3IDEwLjEgQyAxMi43MzcgMTIuOSAxMC41MzcgMTIuOSA4LjUzNyAxMi45IEwgNy4zMzcgMTIuOSBMIDguMTM3IDcuNyBDIDguMTM3IDcuNCA4LjQzNyA3LjIgOC43MzcgNy4yIEwgOS4yMzcgNy4yIEMgMTAuNjM3IDcuMiAxMS45MzcgNy4yIDEyLjYzNyA4IEMgMTMuMTM3IDguNCAxMy4zMzcgOS4xIDEzLjEzNyAxMC4xIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDM1LjQzNyAxMCBMIDMxLjczNyAxMCBDIDMxLjQzNyAxMCAzMS4xMzcgMTAuMiAzMS4xMzcgMTAuNSBMIDMwLjkzNyAxMS41IEwgMzAuNjM3IDExLjEgQyAyOS44MzcgOS45IDI4LjAzNyA5LjUgMjYuMjM3IDkuNSBDIDIyLjEzNyA5LjUgMTguNjM3IDEyLjYgMTcuOTM3IDE3IEMgMTcuNTM3IDE5LjIgMTguMDM3IDIxLjMgMTkuMzM3IDIyLjcgQyAyMC40MzcgMjQgMjIuMTM3IDI0LjYgMjQuMDM3IDI0LjYgQyAyNy4zMzcgMjQuNiAyOS4yMzcgMjIuNSAyOS4yMzcgMjIuNSBMIDI5LjAzNyAyMy41IEMgMjguOTM3IDIzLjkgMjkuMjM3IDI0LjMgMjkuNjM3IDI0LjMgTCAzMy4wMzcgMjQuMyBDIDMzLjUzNyAyNC4zIDM0LjAzNyAyMy45IDM0LjEzNyAyMy40IEwgMzYuMTM3IDEwLjYgQyAzNi4yMzcgMTAuNCAzNS44MzcgMTAgMzUuNDM3IDEwIFogTSAzMC4zMzcgMTcuMiBDIDI5LjkzNyAxOS4zIDI4LjMzNyAyMC44IDI2LjEzNyAyMC44IEMgMjUuMDM3IDIwLjggMjQuMjM3IDIwLjUgMjMuNjM3IDE5LjggQyAyMy4wMzcgMTkuMSAyMi44MzcgMTguMiAyMy4wMzcgMTcuMiBDIDIzLjMzNyAxNS4xIDI1LjEzNyAxMy42IDI3LjIzNyAxMy42IEMgMjguMzM3IDEzLjYgMjkuMTM3IDE0IDI5LjczNyAxNC42IEMgMzAuMjM3IDE1LjMgMzAuNDM3IDE2LjIgMzAuMzM3IDE3LjIgWiI+PC9wYXRoPjxwYXRoIGZpbGw9IiMwMDMwODciIGQ9Ik0gNTUuMzM3IDEwIEwgNTEuNjM3IDEwIEMgNTEuMjM3IDEwIDUwLjkzNyAxMC4yIDUwLjczNyAxMC41IEwgNDUuNTM3IDE4LjEgTCA0My4zMzcgMTAuOCBDIDQzLjIzNyAxMC4zIDQyLjczNyAxMCA0Mi4zMzcgMTAgTCAzOC42MzcgMTAgQyAzOC4yMzcgMTAgMzcuODM3IDEwLjQgMzguMDM3IDEwLjkgTCA0Mi4xMzcgMjMgTCAzOC4yMzcgMjguNCBDIDM3LjkzNyAyOC44IDM4LjIzNyAyOS40IDM4LjczNyAyOS40IEwgNDIuNDM3IDI5LjQgQyA0Mi44MzcgMjkuNCA0My4xMzcgMjkuMiA0My4zMzcgMjguOSBMIDU1LjgzNyAxMC45IEMgNTYuMTM3IDEwLjYgNTUuODM3IDEwIDU1LjMzNyAxMCBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA2Ny43MzcgMi44IEwgNTkuOTM3IDIuOCBDIDU5LjQzNyAyLjggNTguOTM3IDMuMiA1OC44MzcgMy43IEwgNTUuNzM3IDIzLjYgQyA1NS42MzcgMjQgNTUuOTM3IDI0LjMgNTYuMzM3IDI0LjMgTCA2MC4zMzcgMjQuMyBDIDYwLjczNyAyNC4zIDYxLjAzNyAyNCA2MS4wMzcgMjMuNyBMIDYxLjkzNyAxOCBDIDYyLjAzNyAxNy41IDYyLjQzNyAxNy4xIDYzLjAzNyAxNy4xIEwgNjUuNTM3IDE3LjEgQyA3MC42MzcgMTcuMSA3My42MzcgMTQuNiA3NC40MzcgOS43IEMgNzQuNzM3IDcuNiA3NC40MzcgNS45IDczLjQzNyA0LjcgQyA3Mi4yMzcgMy41IDcwLjMzNyAyLjggNjcuNzM3IDIuOCBaIE0gNjguNjM3IDEwLjEgQyA2OC4yMzcgMTIuOSA2Ni4wMzcgMTIuOSA2NC4wMzcgMTIuOSBMIDYyLjgzNyAxMi45IEwgNjMuNjM3IDcuNyBDIDYzLjYzNyA3LjQgNjMuOTM3IDcuMiA2NC4yMzcgNy4yIEwgNjQuNzM3IDcuMiBDIDY2LjEzNyA3LjIgNjcuNDM3IDcuMiA2OC4xMzcgOCBDIDY4LjYzNyA4LjQgNjguNzM3IDkuMSA2OC42MzcgMTAuMSBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA5MC45MzcgMTAgTCA4Ny4yMzcgMTAgQyA4Ni45MzcgMTAgODYuNjM3IDEwLjIgODYuNjM3IDEwLjUgTCA4Ni40MzcgMTEuNSBMIDg2LjEzNyAxMS4xIEMgODUuMzM3IDkuOSA4My41MzcgOS41IDgxLjczNyA5LjUgQyA3Ny42MzcgOS41IDc0LjEzNyAxMi42IDczLjQzNyAxNyBDIDczLjAzNyAxOS4yIDczLjUzNyAyMS4zIDc0LjgzNyAyMi43IEMgNzUuOTM3IDI0IDc3LjYzNyAyNC42IDc5LjUzNyAyNC42IEMgODIuODM3IDI0LjYgODQuNzM3IDIyLjUgODQuNzM3IDIyLjUgTCA4NC41MzcgMjMuNSBDIDg0LjQzNyAyMy45IDg0LjczNyAyNC4zIDg1LjEzNyAyNC4zIEwgODguNTM3IDI0LjMgQyA4OS4wMzcgMjQuMyA4OS41MzcgMjMuOSA4OS42MzcgMjMuNCBMIDkxLjYzNyAxMC42IEMgOTEuNjM3IDEwLjQgOTEuMzM3IDEwIDkwLjkzNyAxMCBaIE0gODUuNzM3IDE3LjIgQyA4NS4zMzcgMTkuMyA4My43MzcgMjAuOCA4MS41MzcgMjAuOCBDIDgwLjQzNyAyMC44IDc5LjYzNyAyMC41IDc5LjAzNyAxOS44IEMgNzguNDM3IDE5LjEgNzguMjM3IDE4LjIgNzguNDM3IDE3LjIgQyA3OC43MzcgMTUuMSA4MC41MzcgMTMuNiA4Mi42MzcgMTMuNiBDIDgzLjczNyAxMy42IDg0LjUzNyAxNCA4NS4xMzcgMTQuNiBDIDg1LjczNyAxNS4zIDg1LjkzNyAxNi4yIDg1LjczNyAxNy4yIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDA5Y2RlIiBkPSJNIDk1LjMzNyAzLjMgTCA5Mi4xMzcgMjMuNiBDIDkyLjAzNyAyNCA5Mi4zMzcgMjQuMyA5Mi43MzcgMjQuMyBMIDk1LjkzNyAyNC4zIEMgOTYuNDM3IDI0LjMgOTYuOTM3IDIzLjkgOTcuMDM3IDIzLjQgTCAxMDAuMjM3IDMuNSBDIDEwMC4zMzcgMy4xIDEwMC4wMzcgMi44IDk5LjYzNyAyLjggTCA5Ni4wMzcgMi44IEMgOTUuNjM3IDIuOCA5NS40MzcgMyA5NS4zMzcgMy4zIFoiPjwvcGF0aD48L3N2Zz4",role:"presentation",class:"h-[22px]"},Me=e.defineComponent({__name:"ExpressPaymentMethodButton",props:{type:{type:String}},emits:["click"],setup(i,{emit:n}){const o=i,a=n,r=e.computed(()=>{switch(o.type){case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";default:return}}),l=e.computed(()=>{switch(o.type){case"applepay":return"!bg-black !py-0";case"googlepay":return"!bg-black bg-[url(https://www.gstatic.com/instantbuy/svg/dark_gpay.svg)] bg-[length:auto_42.5%]";case"paypal":return"!bg-[#ffc439]";default:return}});function c(){a("click")}return(i,n)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{size:"lg","aria-label":r.value,class:e.normalizeClass([l.value,"!block w-full h-11 bg-center bg-no-repeat"]),onClick:c},{default:e.withCtx(()=>["applepay"===o.type?(e.openBlock(),e.createElementBlock("svg",he,[...n[0]||(n[0]=[e.createElementVNode("svg",{id:"svg-logo",x:"0",y:"3.85",height:"7.3",width:"35",class:"logo",viewBox:"0 0 105 43",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createElementVNode("title",null,"Apple Logo"),e.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createElementVNode("g",{fill:"#FFF"},[e.createElementVNode("path",{d:"M19.4028,5.5674 C20.6008,4.0684 21.4138,2.0564 21.1998,0.0004 C19.4458,0.0874 17.3058,1.1574 16.0668,2.6564 C14.9538,3.9414 13.9688,6.0374 14.2258,8.0074 C16.1948,8.1784 18.1618,7.0244 19.4028,5.5674"}),e.createElementVNode("path",{d:"M21.1772,8.3926 C18.3182,8.2226 15.8872,10.0156 14.5212,10.0156 C13.1552,10.0156 11.0642,8.4786 8.8022,8.5196 C5.8592,8.5626 3.1282,10.2276 1.6342,12.8746 C-1.4378,18.1696 0.8232,26.0246 3.8112,30.3376 C5.2622,32.4716 7.0102,34.8206 9.3142,34.7366 C11.4912,34.6506 12.3442,33.3266 14.9902,33.3266 C17.6352,33.3266 18.4042,34.7366 20.7082,34.6936 C23.0972,34.6506 24.5922,32.5586 26.0422,30.4226 C27.7072,27.9906 28.3882,25.6426 28.4312,25.5126 C28.3882,25.4706 23.8232,23.7186 23.7812,18.4676 C23.7382,14.0706 27.3652,11.9786 27.5362,11.8496 C25.4882,8.8196 22.2872,8.4786 21.1772,8.3926"}),e.createElementVNode("path",{d:"M85.5508,43.0381 L85.5508,39.1991 C85.8628,39.2421 86.6158,39.2871 87.0158,39.2871 C89.2138,39.2871 90.4558,38.3551 91.2108,35.9581 L91.6548,34.5371 L83.2428,11.2321 L88.4368,11.2321 L94.2958,30.1421 L94.4068,30.1421 L100.2668,11.2321 L105.3278,11.2321 L96.6048,35.7141 C94.6078,41.3291 92.3208,43.1721 87.4828,43.1721 C87.1048,43.1721 85.8838,43.1271 85.5508,43.0381"}),e.createElementVNode("path",{d:"M42.6499,19.3555 L48.3549,19.3555 C52.6829,19.3555 55.1469,17.0255 55.1469,12.9855 C55.1469,8.9455 52.6829,6.6375 48.3769,6.6375 L42.6499,6.6375 L42.6499,19.3555 Z M49.6869,2.4425 C55.9009,2.4425 60.2289,6.7265 60.2289,12.9625 C60.2289,19.2225 55.8129,23.5285 49.5309,23.5285 L42.6499,23.5285 L42.6499,34.4705 L37.6779,34.4705 L37.6779,2.4425 L49.6869,2.4425 Z"}),e.createElementVNode("path",{d:"M76.5547,25.7705 L76.5547,23.9715 L71.0287,24.3275 C67.9207,24.5275 66.3007,25.6815 66.3007,27.7015 C66.3007,29.6545 67.9887,30.9195 70.6287,30.9195 C74.0027,30.9195 76.5547,28.7665 76.5547,25.7705 M61.4617,27.8345 C61.4617,23.7285 64.5917,21.3755 70.3627,21.0205 L76.5547,20.6425 L76.5547,18.8675 C76.5547,16.2705 74.8457,14.8495 71.8057,14.8495 C69.2967,14.8495 67.4777,16.1375 67.0997,18.1125 L62.6167,18.1125 C62.7497,13.9615 66.6567,10.9435 71.9387,10.9435 C77.6207,10.9435 81.3267,13.9175 81.3267,18.5345 L81.3267,34.4705 L76.7327,34.4705 L76.7327,30.6305 L76.6217,30.6305 C75.3127,33.1395 72.4267,34.7145 69.2967,34.7145 C64.6807,34.7145 61.4617,31.9625 61.4617,27.8345"})])])],-1)])])):"paypal"===o.type?(e.openBlock(),e.createElementBlock("img",be)):e.createCommentVNode("",!0)]),_:1},8,["aria-label","class"]))}}),Ne={class:"absolute h-[1px] w-[1px] overflow-hidden opacity-0"},Ie=e.defineComponent({__name:"ExpressPaymentMethodApplePay",props:{onBillingInformationChange:{type:Function},amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(i,{emit:n}){const a=i,r=n,l=e.ref(),c=o.useLogger(),{authorizePayment:u}=f.createPaymentsService(),d=a.paymentMethodOptionsResponse.payment_acceptor.id,s=e=>{if(!e.value)return;let t=e.value??1,i=e.type.toLowerCase();return"WEEK"===e.type&&(i="day",t=7*e.value),"day"===i||"month"===i||"year"===i||"hour"===i||"minute"===i?{recurringPaymentIntervalUnit:i,recurringPaymentIntervalCount:t}:void 0},p=e=>({postal_code:e.postalCode,city:e.locality,country:e.countryCode}),m=e=>({postal_code:e.postalCode,city:e.city,country:e.country}),g=e=>e&&v(e)?e:void 0,v=e=>t.isValidCountryCode(e),y=()=>{var e;const t=null==(e=l.value)?void 0:e.querySelector("apple-pay-button");if(t){const e=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(e)}};return e.onMounted(()=>{(async()=>{const{AdyenCheckout:e,ApplePay:t}=await Promise.resolve().then(()=>require("../../auto-PpnAChnH.js")),i=new t(await e(o.getAdyenExpressCheckoutConfiguration({amount:a.amount,locale:a.locale,countryCode:a.countryCode,paymentMethodOptionResponse:a.paymentMethodOptionsResponse})),{isExpress:!0,recurringPaymentRequest:{paymentDescription:a.billingInformation.description,billingAgreement:a.billingInformation.agreement,managementURL:"https://www.google.com",...a.billingInformation.trial&&{trialBilling:{label:a.billingInformation.trial.label,amount:a.billingInformation.trial.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:a.billingInformation.trial.startDate,recurringPaymentEndDate:a.billingInformation.trial.endDate}},...a.billingInformation.regular&&{regularBilling:{label:a.billingInformation.regular.label,amount:a.billingInformation.regular.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:a.billingInformation.regular.startDate,...s(a.billingInformation.regular.interval??{type:"MONTH",value:1})}}},requiredBillingContactFields:["postalAddress"],requiredShippingContactFields:["email"],onPaymentMethodSelected:async(e,t,i)=>{var n,o,l,c,u,d,s;const{invoicePreview:p,trialInvoicePreview:m}=await a.onBillingInformationChange({...(null==(n=i.paymentMethod.billingContact)?void 0:n.postalCode)&&{postal_code:i.paymentMethod.billingContact.postalCode},...(null==(o=i.paymentMethod.billingContact)?void 0:o.locality)&&{city:i.paymentMethod.billingContact.locality},...g(null==(l=i.paymentMethod.billingContact)?void 0:l.countryCode)&&{country:g(null==(c=i.paymentMethod.billingContact)?void 0:c.countryCode)}}),f=m?m.invoice_amount_including_tax.quantity.toString():p.invoice_amount_including_tax.quantity.toString();r("update-billing-information",{postal_code:null==(u=i.paymentMethod.billingContact)?void 0:u.postalCode,city:null==(d=i.paymentMethod.billingContact)?void 0:d.locality,country:null==(s=i.paymentMethod.billingContact)?void 0:s.countryCode}),e({newTotal:{label:a.billingInformation.regular.label,amount:f,type:"final"}})},onError:e=>{c.error("APPLE_PAY_ERROR","Apple Pay error",{error:e})},onAuthorized:async(e,t)=>{try{c.info("APPLE_PAY_AUTHORIZED","Apple Pay authorized",{data:e});const i=e.authorizedEvent;c.info("APPLE_PAY_EVENT_DATA","Apple Pay event data structure",{eventData:i,hasPaymentMethod:!!i.payment.token.paymentMethod,hasBrowserInfo:!!i.payment.token.paymentData,billingAddress:e.billingAddress});const n=i.payment.billingContact,l=e.billingAddress;n?r("update-billing-information",p(n)):l&&r("update-billing-information",m(l));const s={payment_method:o.transformObjectToAdyenObject(i.payment.token.paymentMethod),browser_info:o.transformObjectToAdyenObject(i.payment.token.paymentData)};c.info("APPLE_PAY_ADYEN_PAYLOAD","Adyen payload prepared",{adyen:s});const g=o.createReturnUrl({paymentAcceptorId:d,redirectUrl:window.location.href});c.info("APPLE_PAY_CALLING_API","Calling authorizePayment API",{paymentAcceptorId:d,amount:a.amount});const f=await u({payment_acceptor_id:d,payment_gateway_variant:"ADYEN",adyen:{...s,store_payment_method:!0},amount:a.amount,return_url:g});if(c.info("APPLE_PAY_API_RESPONSE","Payment API response received",{status:f.status,paymentResult:f}),"FAILURE"===f.status)return c.error("APPLE_PAY_AUTHORIZATION_FAILED","Payment authorization failed",{error:f}),void t.reject();if("ACTION_REQUIRED"===f.status)return c.warn("APPLE_PAY_ACTION_REQUIRED","Payment requires additional action",{action:f.action}),void t.reject();c.info("APPLE_PAY_SUCCESS","Apple Pay payment successful, resolving"),t.resolve()}catch(i){c.error("APPLE_PAY_AUTHORIZATION_FAILED","Apple Pay authorization failed",{error:i}),t.reject()}}});if(l.value)try{await i.isAvailable(),i.mount(l.value),r("ready")}catch(n){}})()}),(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[i.isVisible?(e.openBlock(),e.createBlock(Me,{key:0,type:"applepay",onClick:y})):e.createCommentVNode("",!0),e.createElementVNode("div",Ne,[e.createElementVNode("div",{ref_key:"applePayButtonRef",ref:l},null,512)])],64))}}),ke={class:"relative overflow-hidden"},Ce=e.defineComponent({__name:"ExpressPaymentMethodPaypal",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:i}){const n=t,a=i,r=e.ref(),l=o.useLogger();return e.onMounted(()=>{(async()=>{const{AdyenCheckout:e,PayPal:t}=await Promise.resolve().then(()=>require("../../auto-PpnAChnH.js")),i=new t(await e(o.getAdyenExpressCheckoutConfiguration({locale:n.locale,amount:n.amount,countryCode:n.countryCode,paymentMethodOptionResponse:n.paymentMethodOptionsResponse})),{isExpress:!0,blockPayPalPayLaterButton:!0,blockPayPalCreditButton:!0,blockPayPalVenmoButton:!0,style:{height:55},onInit:()=>{a("ready")}});if(r.value)try{await i.isAvailable(),i.mount(r.value)}catch(c){l.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","Failed mounting PayPal express button",{error:c})}else l.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","The PayPal button reference is not found and cannot be mounted")})()}),(i,n)=>(e.openBlock(),e.createElementBlock("div",ke,[t.isVisible?(e.openBlock(),e.createBlock(Me,{key:0,type:"paypal",class:"w-full"})):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"paypalButtonRef",ref:r,class:"absolute inset-0 opacity-[0.0001]"},null,512)]))}}),xe={class:"w-[1px] h-[1px] overflow-hidden opacity-0 absolute"},Ee=e.defineComponent({__name:"ExpressPaymentMethodGooglePay",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:i}){const n=t,a=i,r=e.ref(),l=o.useLogger(),c=()=>{var e;const t=null==(e=r.value)?void 0:e.querySelector("#gpay-button-online-api-id");if(t){const e=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(e)}};return e.onMounted(()=>{(async()=>{const{AdyenCheckout:e,GooglePay:t}=await Promise.resolve().then(()=>require("../../auto-PpnAChnH.js")),i=new t(await e(o.getAdyenExpressCheckoutConfiguration({locale:n.locale,amount:n.amount,countryCode:n.countryCode,paymentMethodOptionResponse:n.paymentMethodOptionsResponse})),{isExpress:!0});if(r.value)try{await i.isAvailable(),i.mount(r.value),a("ready")}catch(c){l.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","Failed mounting Google Pay express button",{error:c})}else l.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","The Google Pay button reference is not found and cannot be mounted")})()}),(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(Me,{key:0,type:"googlepay",onClick:c})):e.createCommentVNode("",!0),e.createElementVNode("div",xe,[e.createElementVNode("div",{ref_key:"googlePayButtonRef",ref:r},null,512)])],64))}}),De={key:0,class:"mt-4n"},Ae={class:"mb-2"},we={class:"grid grid-cols-6 gap-1 md:gap-2"},Pe={class:"h-4 mt-4"},Be=e.defineComponent({__name:"ExpressPaymentMethods",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},paymentMethodsOptionsResponse:{type:null},billingInformation:{type:Object},onBillingInformationChange:{type:Function}},emits:["update-billing-information"],setup(i){const n=["applepay"],o=i,{$t:a}=t.useIntl(),r=e.ref(!1),l=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var e;if(n.includes("applepay"))return null==(e=o.paymentMethodsOptionsResponse)?void 0:e.find(e=>{var t;return null==(t=e.options)?void 0:t.some(e=>"apple pay"===e.name.toLowerCase())})}),d=e.computed(()=>{var e;if(n.includes("paypal"))return null==(e=o.paymentMethodsOptionsResponse)?void 0:e.find(e=>{var t;return null==(t=e.options)?void 0:t.some(e=>"paypal"===e.name.toLowerCase())})}),s=e.computed(()=>{var e;if(n.includes("googlepay"))return null==(e=o.paymentMethodsOptionsResponse)?void 0:e.find(e=>{var t;return null==(t=e.options)?void 0:t.some(e=>"google pay"===e.name.toLowerCase())})}),p=e.computed(()=>!!(u.value||s.value||d.value)),m=e.computed(()=>{var e;if(0===(null==(e=o.paymentMethodsOptionsResponse)?void 0:e.length))return!1;const t=!u.value||r.value,i=!s.value||l.value,n=!d.value||c.value;return t&&i&&n}),f=e.computed(()=>m.value?(u.value?1:0)+(s.value?1:0)+(d.value?1:0):2);return(n,o)=>p.value?(e.openBlock(),e.createElementBlock("div",De,[e.createElementVNode("div",Ae,[m.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Subscribe instantly with",id:"checkout.express_payment_methods.title",description:"The title of the express payment methods block in the checkout form"})),1)]),_:1})):(e.openBlock(),e.createBlock(g._sfc_main,{key:0,variant:"title"}))]),e.createElementVNode("div",we,[m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(g._sfc_main,{class:"h-11 col-span-3"}),e.createVNode(g._sfc_main,{class:"h-11 col-span-3"})],64)),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!u.value,"!col-span-6":1===f.value,"md:!col-span-3":2===f.value,"!col-span-6 md:!col-span-2":3===f.value}])},[u.value?(e.openBlock(),e.createBlock(Ie,{key:0,amount:i.amount,"billing-information":i.billingInformation,"country-code":i.countryCode,locale:i.locale,"is-visible":m.value,"payment-method-options-response":u.value,"on-billing-information-change":i.onBillingInformationChange,onReady:o[0]||(o[0]=e=>r.value=!0),onUpdateBillingInformation:o[1]||(o[1]=e=>n.$emit("update-billing-information",e))},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response","on-billing-information-change"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!s.value,"col-span-6 md:col-span-6":1===f.value,"md:!col-span-3":2===f.value}])},[s.value?(e.openBlock(),e.createBlock(Ee,{key:0,amount:i.amount,"billing-information":i.billingInformation,"country-code":i.countryCode,locale:i.locale,"is-visible":m.value,"payment-method-options-response":s.value,onReady:o[2]||(o[2]=e=>l.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!d.value,"col-span-6 md:col-span-6":1===f.value,"md:!col-span-3":2===f.value}])},[d.value?(e.openBlock(),e.createBlock(Ce,{key:0,amount:i.amount,"billing-information":i.billingInformation,"country-code":i.countryCode,locale:i.locale,"is-visible":m.value,"payment-method-options-response":d.value,onReady:o[3]||(o[3]=e=>c.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2)]),e.createElementVNode("div",Pe,[m.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2q),{key:1,text:e.unref(a)({defaultMessage:"Or",id:"checkout.express_payment_methods.divider_text",description:"The text of the divider text in the express payment methods block in the checkout form"}),"text-position":"center"},null,8,["text"])):(e.openBlock(),e.createBlock(g._sfc_main,{key:0,variant:"divider-text"}))])])):e.createCommentVNode("",!0)}}),Se={class:"grid grid-cols-2 gap-2"},Ve=e.defineComponent({__name:"TieredTableRow",props:{band:{type:Object},previousBand:{type:Object},isFirst:{type:Boolean},period:{type:Object}},setup(i){const n=i,{$t:o}=t.useIntl(),{formatTimePeriod:a}=t.useTimePeriod(),r=e.computed(()=>{var e;return n.isFirst?"0":(null==(e=n.previousBand)?void 0:e.tier_top_bound)&&"number"in n.previousBand.tier_top_bound?n.previousBand.tier_top_bound.number:void 0}),l=e.computed(()=>{if(n.band.tier_top_bound&&"number"in n.band.tier_top_bound)return n.band.tier_top_bound.number});return(n,c)=>(e.openBlock(),e.createElementBlock("div",Se,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-xs",shade:"lighter",tag:"div"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"{lower_bound} - {upper_bound} seats",id:"seats.tiered_range_label",description:"The label showing the seat count range for a tiered pricing tier"},{lower_bound:r.value??"0",upper_bound:l.value})),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"> {lower_bound} seats",id:"seats.tiered_unbounded_range_label",description:"The label showing the unbounded seat count range (greater than) for a tiered pricing tier"},{lower_bound:r.value??"0"})),1)],64))]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-xs",shade:"lighter",tag:"div",class:"text-right"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.band.amount&&e.unref(o)({defaultMessage:"{amount} per seat/{period}",id:"seats.tiered_price_per_seat_period",description:"The price per seat and billing period label for a tiered pricing tier"},{amount:e.unref(t.formatAmount)(i.band.amount),period:i.period?e.unref(a)(i.period,{short:!0,hideValueForExactPeriods:!0}):""})),1)]),_:1})]))}}),Te={class:"grid grid-cols-1 gap-0.5 pt-1.5"},Le=e.defineComponent({__name:"TieredTable",props:{bands:{type:Array},period:{type:Object}},setup:t=>(i,n)=>(e.openBlock(),e.createElementBlock("div",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bands,(i,n)=>(e.openBlock(),e.createBlock(Ve,{key:n,band:i,"is-first":0===n,"previous-band":n>0?t.bands[n-1]:void 0,period:t.period},null,8,["band","is-first","previous-band","period"]))),128))]))});const je={class:"flex flex-row-reverse md:flex-row gap-4"},ze={class:"w-24 md:w-32 shrink-0 justify-start"},Oe=["tabindex"],$e={key:0},Ue={key:0},Re=e.defineComponent({__name:"SeatsEditorItem",props:e.mergeModels({modelValue:{type:Object},defaultValue:{type:Object},pricings:{type:Array}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=i,o=e.useModel(i,"modelValue"),{$t:a}=t.useIntl(),{formatTimePeriod:r}=t.useTimePeriod(),l=e.ref(!1),c=e.computed({get:()=>o.value.number?+o.value.number:1,set(e){o.value={...o.value,number:void 0!==e?e.toString():void 0}}}),u=function({pricings:t,pricingItemConfigId:i}){return e.computed(()=>{var e,n;const{config:o,productItem:a}=function({pricings:e,pricingItemConfigId:t}){var i,n;const o=e.flatMap(e=>e.items??[]).find(e=>{var i;return null==(i=e.configs)?void 0:i.some(e=>e.id===t)});return{config:null==(i=null==o?void 0:o.configs)?void 0:i.find(e=>e.id===t),productItem:null==(n=null==o?void 0:o.product_items)?void 0:n[0]}}({pricings:t,pricingItemConfigId:i});return{billing:{period:null==o?void 0:o.billing_period,billedInAdvance:null==o?void 0:o.billing_in_advance},product:{name:null==a?void 0:a.name,description:null==a?void 0:a.description},pricing:{..."FLAT"===(null==o?void 0:o.type)&&{amount:null==(n=null==(e=o.bands)?void 0:e[0])?void 0:n.amount},..."TIERED"===(null==o?void 0:o.type)&&{tiered:{bands:o.bands}}}}})}({pricings:n.pricings,pricingItemConfigId:o.value.pricing_item_config_id}),d=e.computed(()=>{var e,t;return!!(null==(t=null==(e=u.value.pricing)?void 0:e.tiered)?void 0:t.bands)});return(n,o)=>{var s,p,m;return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",je,[e.createElementVNode("div",ze,[e.createVNode(e.unref(t._sfc_main$1Y),{modelValue:c.value,"onUpdate:modelValue":o[0]||(o[0]=e=>c.value=e),size:"sm",min:(null==(s=i.defaultValue)?void 0:s.number)?+i.defaultValue.number:void 0},null,8,["modelValue","min"])]),e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col grow",{"hover:cursor-pointer":d.value}]),tabindex:d.value?0:void 0,onClick:o[1]||(o[1]=e=>d.value?l.value=!l.value:void 0)},[e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u).product.name||e.unref(a)({defaultMessage:"Seats",id:"seats.label",description:"The label for the seats input field"})),1)]),_:1}),e.unref(u).pricing.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:0,tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"{amount} per seat/{period}",id:"seats.price_per_seat_period",description:"The price per seat and billing period label for seat-based pricing"},{amount:e.unref(t.formatAmount)(e.unref(u).pricing.amount),period:e.unref(u).billing.period?e.unref(r)(e.unref(u).billing.period,{short:!0,hideValueForExactPeriods:!0}):""})),1)]),_:1})):e.unref(u).pricing.tiered?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Tiered pricing",id:"seats.tiered_pricing_label",description:"The label indicating tiered pricing structure for seats"}))+" ",1),e.createVNode(e.unref(t._sfc_main$4),{icon:"keyboard_arrow_down",size:"xs",class:e.normalizeClass(["absolute transition ease-in-out text-gray-400",{"rotate-0":!l.value,"rotate-180":l.value}])},null,8,["class"])]),_:1})):e.createCommentVNode("",!0)],10,Oe)]),(null==(m=null==(p=e.unref(u).pricing)?void 0:p.tiered)?void 0:m.bands)?(e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(e.unref(t._sfc_main$2j),null,{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(Le,{bands:e.unref(u).pricing.tiered.bands,period:e.unref(u).billing.period},null,8,["bands","period"])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)])}}}),Fe=e.defineComponent({__name:"SeatsEditor",props:e.mergeModels({modelValue:{type:Array},initialSeatsValues:{type:Array},pricings:{type:Array}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=e.useModel(i,"modelValue"),o=t=>e.computed({get:()=>n.value[t],set:e=>{const i=n.value.slice();i[t]=e,n.value=i}});return(n,a)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.modelValue,(n,a)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:a},{default:e.withCtx(()=>{var t;return[n.pricing_item_config_id?(e.openBlock(),e.createBlock(Re,{key:n.pricing_item_config_id,modelValue:o(a).value,"onUpdate:modelValue":e=>o(a).value=e,"default-value":null==(t=i.initialSeatsValues)?void 0:t[a],pricings:i.pricings},null,8,["modelValue","onUpdate:modelValue","default-value","pricings"])):e.createCommentVNode("",!0)]}),_:2},1024))),128))}}),Ge={class:"flex gap-4 border-l-2 border-primary-600 px-2"},Ye={class:"grow"},Ke=e.defineComponent({__name:"PricingGroupTitle",setup:i=>(i,n)=>(e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("div",Ye,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"title")]),_:3})]),e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"description")]),_:3})])]))}),qe={class:"p-1"},He={class:"grid grid-cols-1 gap-1 pt-1"},Qe=e.defineComponent({__name:"AddonSingleEditor",props:e.mergeModels({constraint:{type:String},modelValue:{type:Array},pricings:{type:Array},billingPeriod:{type:Object},currency:{type:String},groupName:{type:String}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=i,o=e.useModel(i,"modelValue"),{$t:a}=t.useIntl(),{renderPricingForPricingItem:r}=t.usePricingItem({currency:e.toRef(n,"currency"),billingPeriod:e.toRef(n,"billingPeriod")}),l=n.pricings.map(e=>e.id),c=e.computed(()=>"AT_MOST_ONE"===n.constraint?a({defaultMessage:"Select up to one product",id:"addon_single_editor.description.at_most_one",description:"The description of the addon single editor for at most one product"}):"EXACTLY_ONE"===n.constraint?a({defaultMessage:"Select one product",id:"addon_single_editor.description.exactly_one",description:"The description of the addon single editor for exactly one product"}):"AT_LEAST_ONE"===n.constraint?a({defaultMessage:"Select at least one product",id:"addon_single_editor.description.at_least_one",description:"The description of the addon single editor for at least one product"}):""),u=e=>n.modelValue.includes(e);return(n,d)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",qe,[e.createVNode(Ke,null,{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.groupName),1)]),description:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1}),e.createElementVNode("div",He,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.pricings,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:i.id,"content-background":"none",class:e.normalizeClass({"!bg-white":u(i.id)})},{default:e.withCtx(()=>{var n,c;return[e.createVNode(p._sfc_main,{name:e.unref(F)(i)??"",description:(null==(n=i.items)?void 0:n[0])?e.unref(r)({pricingItem:null==(c=i.items)?void 0:c[0]}):e.unref(a)({defaultMessage:"Unsupported pricing",id:"pricing_item_pricing.unsupported_pricing_error",description:"Text displayed when the pricing item pricing is unsupported"})},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$20),{"model-value":u(i.id),"onUpdate:modelValue":e=>(e=>{if(u(e))o.value=o.value.filter(t=>t!==e);else{const t=o.value.filter(e=>!l.includes(e));o.value=[...t,e]}})(i.id)},null,8,["model-value","onUpdate:modelValue"])]),_:2},1032,["name","description"])]}),_:2},1032,["class"]))),128))])])]),_:1}))}}),Ze={class:"grid grid-cols-1 gap-1"},Xe=e.defineComponent({__name:"AddonMultipleEditor",props:e.mergeModels({modelValue:{type:Array},pricings:{type:Array},billingPeriod:{type:Object},currency:{type:String},groupName:{type:String}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=i,o=e.useModel(i,"modelValue"),{$t:a}=t.useIntl(),{renderPricingForPricingItem:r}=t.usePricingItem({currency:e.toRef(n,"currency"),billingPeriod:e.toRef(n,"billingPeriod")}),l=e=>o.value.includes(e),c=e=>{l(e)?o.value=o.value.filter(t=>t!==e):o.value=[...o.value,e]};return(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-spacing":"","no-border":!i.groupName,"content-background":i.groupName?"gray":"none"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["grid grid-cols-1 gap-1",{"p-1":i.groupName}])},[i.groupName?(e.openBlock(),e.createBlock(Ke,{key:0},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.groupName),1)]),description:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Select any number of products",id:"addon_multiple_editor.description",description:"The description of the addon multiple editor"})),1)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.pricings,n=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:n.id,"content-background":i.groupName||l(n.id)?"none":"gray",class:e.normalizeClass({"!bg-white":l(n.id)})},{default:e.withCtx(()=>{var i,o;return[e.createVNode(p._sfc_main,{name:e.unref(F)(n)??"",description:(null==(i=n.items)?void 0:i[0])?e.unref(r)({pricingItem:null==(o=n.items)?void 0:o[0]}):e.unref(a)({defaultMessage:"Unsupported pricing",id:"addon_multiple_editor.unsupported_pricing_error",description:"Text displayed when the pricing item pricing is unsupported"})},{default:e.withCtx(()=>[l(n.id)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,color:"gray",variant:"outline",square:"",size:"sm","icon-prefix":"remove_shopping_cart",onClick:e=>c(n.id)},null,8,["onClick"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:1,color:"primary","icon-prefix":"add",size:"sm",onClick:e=>c(n.id)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Add to subscription ",id:"addon_multiple_editor.add_to_subscription_button",description:"The button to add a pricing to the subscription"})),1)]),_:1},8,["onClick"]))]),_:2},1032,["name","description"])]}),_:2},1032,["content-background","class"]))),128))])],2)]),_:1},8,["no-border","content-background"]))}});function We(){return{isMobileViewport:m.useBreakpoints(m.breakpointsTailwind).smallerOrEqual("sm")}}const Je={class:"p-1"},et={class:"pt-1"},tt=e.defineComponent({__name:"PricingGroupSingleEditor",props:e.mergeModels({modelValue:{type:Array},pricings:{type:Array},billingPeriod:{type:Object},currency:{type:String},groupName:{type:String}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=i,o=e.useModel(i,"modelValue"),{$t:a}=t.useIntl(),{renderPricingForPricingItem:r}=t.usePricingItem({currency:e.toRef(n,"currency"),billingPeriod:e.toRef(n,"billingPeriod")}),{isMobileViewport:l}=We(),c=e.computed(()=>n.pricings.map(e=>e.id)),u=e.computed({get:()=>o.value.find(e=>c.value.includes(e))??void 0,set:e=>{const t=o.value.filter(e=>!c.value.includes(e));o.value=e?[...t,e]:t}}),d=e.computed(()=>n.pricings.map(e=>{var t;const i=null==(t=e.items)?void 0:t[0];return{label:F(e)??"",value:e.id,description:i?r({pricingItem:i}):a({defaultMessage:"Unsupported pricing",id:"pricing_item_pricing.unsupported_pricing_error",description:"Text displayed when the pricing item pricing is unsupported"})}}));return(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",Je,[e.createVNode(Ke,null,{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.groupName),1)]),_:1}),e.createElementVNode("div",et,[d.value.length<=3?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1X),{key:0,modelValue:u.value,"onUpdate:modelValue":o[0]||(o[0]=e=>u.value=e),options:d.value.slice(0,3),direction:e.unref(l)?"column":"row","show-radio":!1},null,8,["modelValue","options","direction"])):d.value.length<=6?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1T),{key:1,"single-model-value":u.value,"onUpdate:singleModelValue":o[1]||(o[1]=e=>u.value=e),options:d.value.map(({value:e,label:t,description:i})=>({label:t,subLabel:i,value:e})),size:"xl","show-sub-label-in-input":""},null,8,["single-model-value","options"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1L),{key:2,modelValue:u.value,"onUpdate:modelValue":o[2]||(o[2]=e=>u.value=e),options:d.value,name:`pricing-group-range-input-${i.groupName}`},null,8,["modelValue","options","name"]))])])]),_:1}))}});const it={class:"grid grid-cols-1 gap-1"},nt=e.defineComponent({__name:"PlanCustomizationEditor",props:e.mergeModels({subscription:{type:Object},enabledPricingIds:{type:Array},initialSeatsValues:{type:Array},billingPeriod:{type:Object},currency:{type:String}},{seatsValues:{required:!0},seatsValuesModifiers:{},enabledPricingIds:{required:!0},enabledPricingIdsModifiers:{}}),emits:["update:seatsValues","update:enabledPricingIds"],setup(i){const n=i,o=e.useModel(i,"seatsValues"),a=e.useModel(i,"enabledPricingIds"),{$t:r}=t.useIntl(),l=e.computed(()=>{var e;const t=null==(e=S({pricingPlanScheduleInfos:n.subscription.pricing_plan_schedule_infos,type:"DEFAULT"}))?void 0:e.pricing_plan_version;return t?function(e){var t;return((null==(t=e.pricing_categories)?void 0:t.flatMap(e=>e.pricings??[]))??[]).filter(e=>null!==e)}(t):[]}),c=e.computed(()=>l.value.filter(e=>"ADDON"===e.product_type)),u=e.computed(()=>R(n.subscription));return(n,d)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{title:e.unref(r)({defaultMessage:"Customize plan",id:"checkout.customize_plan_block.title",description:"The title of the customize plan block in the checkout form"}),"no-spacing":"","no-border":"","content-background":"none"},{default:e.withCtx(()=>[e.createElementVNode("div",it,[e.createVNode(Fe,{modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=e=>o.value=e),"initial-seats-values":i.initialSeatsValues,pricings:l.value},null,8,["modelValue","initial-seats-values","pricings"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.id},["DEFAULT"===t.product_type&&"EXACTLY_ONE"===t.selection_constraint?(e.openBlock(),e.createBlock(tt,{key:0,modelValue:a.value,"onUpdate:modelValue":d[1]||(d[1]=e=>a.value=e),"group-name":t.name,pricings:t.pricings,"billing-period":i.billingPeriod,currency:i.currency},null,8,["modelValue","group-name","pricings","billing-period","currency"])):"ADDON"===t.product_type&&"AT_MOST_ONE"===t.selection_constraint?(e.openBlock(),e.createBlock(Qe,{key:1,modelValue:a.value,"onUpdate:modelValue":d[2]||(d[2]=e=>a.value=e),"group-name":t.name,pricings:t.pricings,constraint:t.selection_constraint,"billing-period":i.billingPeriod,currency:i.currency},null,8,["modelValue","group-name","pricings","constraint","billing-period","currency"])):"ADDON"===t.product_type&&"ANY"===t.selection_constraint?(e.openBlock(),e.createBlock(Xe,{key:2,modelValue:a.value,"onUpdate:modelValue":d[3]||(d[3]=e=>a.value=e),pricings:t.pricings,"group-name":t.name,"billing-period":i.billingPeriod,currency:i.currency},null,8,["modelValue","pricings","group-name","billing-period","currency"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(Xe,{modelValue:a.value,"onUpdate:modelValue":d[4]||(d[4]=e=>a.value=e),pricings:c.value,"billing-period":i.billingPeriod,currency:i.currency},null,8,["modelValue","pricings","billing-period","currency"])])]),_:1},8,["title"]))}}),ot=["aria-expanded","aria-label"],at={class:"flex flex-row items-center justify-between w-full gap-3 px-3 py-2 cursor-pointer"},rt={class:"flex flex-row gap-2 items-center"},lt=["onKeydown"],ct=["aria-label"],ut={class:"flex flex-row items-center justify-between w-full gap-3 px-3 py-2 cursor-pointer"},dt={class:"flex flex-row gap-2 items-center"},st={class:"sr-only","aria-live":"polite"},pt=e.defineComponent({__name:"PromotionCodeSection",props:{promotionCode:{default:null,type:[String,null]}},emits:["update:appliedCode","apply","remove"],setup(i,{emit:n}){const{$t:o}=t.useIntl(),a=i,r=n,l=e.ref(!1),c=e.ref(""),u=e.ref(""),d=e.ref(null),s=e.ref(null),p="promotion-code-"+ ++_;const m=`${p}-label`,g=`${p}-panel`,f=e.computed(()=>null!==a.promotionCode&&""!==a.promotionCode),v=e.computed(()=>c.value.trim().length>0),y=e.computed(()=>a.promotionCode??o({defaultMessage:"Promotion applied",id:"checkout.promotion_code.applied_label",description:"Fallback label for an applied promotion code in checkout"})),h=e.computed(()=>o({defaultMessage:l.value?"Collapse promotion code input":"Expand promotion code input",id:l.value?"checkout.promotion_code.collapse_aria_label":"checkout.promotion_code.expand_aria_label",description:"Aria label for the promotion code toggle button in checkout"})),b=e.computed(()=>o({defaultMessage:"Apply promotion code",id:"checkout.promotion_code.apply_aria_label",description:"Aria label for the promotion code apply button in checkout"})),M=e.computed(()=>o({defaultMessage:"Remove promotion code",id:"checkout.promotion_code.remove_aria_label",description:"Aria label for the promotion code remove button in checkout"})),N=()=>{c.value=""},I=()=>{l.value&&(l.value=!1)},k=()=>{f.value||(l.value=!l.value)},C=()=>{if(!v.value)return;const e=c.value.trim();r("update:appliedCode",e),r("apply",e),u.value=o({defaultMessage:"Promotion code applied",id:"checkout.promotion_code.applied_status",description:"Aria live message when a promotion code is applied in checkout"}),l.value=!1},x=()=>{r("update:appliedCode",null),r("remove"),u.value=o({defaultMessage:"Promotion code removed",id:"checkout.promotion_code.removed_status",description:"Aria live message when a promotion code is removed in checkout"}),N(),e.nextTick(()=>{var e;null==(e=d.value)||e.focus()})};return e.watch(l,t=>{if(!t)return N(),void e.nextTick(()=>{var e;null==(e=d.value)||e.focus()});e.nextTick(()=>{(()=>{var e;const t=null==(e=s.value)?void 0:e.querySelector("input");t instanceof HTMLInputElement&&t.focus()})()})}),e.watch(()=>a.promotionCode,e=>{e||N()}),(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:1,"no-border":"","no-spacing":"","content-background":"none",class:"w-full relative"},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"w-full bg-white border border-primary-900 rounded","aria-label":M.value,onClick:x},[e.createElementVNode("div",ut,[e.createElementVNode("div",dt,[e.createVNode(e.unref(t._sfc_main$4),{icon:"local_activity"}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",class:"font-semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.value),1)]),_:1})]),e.createVNode(e.unref(t._sfc_main$4),{icon:"close"})])],8,ct)]),_:1})):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:0,"no-spacing":"",class:"w-full relative"},{default:e.withCtx(()=>[e.createElementVNode("button",{ref_key:"toggleRef",ref:d,type:"button",class:"w-full","aria-expanded":l.value,"aria-controls":g,"aria-label":h.value,onClick:k},[e.createElementVNode("div",at,[e.createElementVNode("div",rt,[e.createVNode(e.unref(t._sfc_main$4),{icon:"local_activity"}),e.createVNode(e.unref(t._sfc_main$2),{id:m,variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Add promotion code",id:"checkout.promotion_code.add_label",description:"Label for adding a promotion code in checkout"})),1)]),_:1})]),e.createVNode(e.unref(t._sfc_main$4),{icon:l.value?"remove":"add"},null,8,["icon"])])],8,ot),e.withDirectives(e.createElementVNode("div",{id:g,ref_key:"panelRef",ref:s,role:"region","aria-labelledby":m,class:"w-full border-t px-3 py-2 flex flex-row gap-2 items-center overflow-hidden",onKeydown:e.withKeys(e.withModifiers(I,["prevent"]),["esc"])},[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:c.value,"onUpdate:modelValue":n[0]||(n[0]=e=>c.value=e),placeholder:e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.placeholder",description:"Placeholder for promotion code input in checkout"}),"aria-label":e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.input_aria_label",description:"Aria label for promotion code input in checkout"}),class:"w-full",onKeydown:e.withKeys(e.withModifiers(C,["prevent"]),["enter"])},null,8,["modelValue","placeholder","aria-label","onKeydown"]),e.createVNode(e.unref(t._sfc_main$2H),{type:"button",disabled:!v.value,"aria-label":b.value,"aria-disabled":!v.value,onClick:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Apply",id:"checkout.promotion_code.apply_button",description:"Button label for applying a promotion code in checkout"})),1)]),_:1},8,["disabled","aria-label","aria-disabled"])],40,lt),[[e.vShow,l.value]])]),_:1})),e.createElementVNode("span",st,e.toDisplayString(u.value),1)],64))}}),mt={key:0},gt=e.defineComponent({__name:"Checkout",props:{configuration:{type:Object}},emits:["error","ready"],setup(i,{emit:n}){var a,r,l,c,u,d,m,f;const v=i,y=n,_=e.computed(()=>v.configuration),h=e.ref(),b=e.ref(),M=o.useLogger(),{$t:N,locale:I}=t.useIntl(),{formatTimePeriod:k}=t.useTimePeriod(),C=s.usePortal(),{isMobileViewport:x}=We();if(M.info("COMPONENT_INITIALIZED","Checkout component initialized"),"INIT_PRICING_PLAN_SUBSCRIPTION"!==(null==(a=C.value)?void 0:a.type))throw M.error("INVALID_TOKEN","Invalid token"),Error("Invalid token");"REVOKED"===C.value.status&&(h.value={code:"RESOURCE_REVOKED",message:`Portal url with resource id "${C.value.id}" is revoked`},M.error("RESOURCE_REVOKED",`Portal url with resource id "${C.value.id}" is revoked`));const E=null==(l=null==(r=C.value)?void 0:r.init_pricing_plan_subscription)?void 0:l.pricing_plan_subscription_id,D=null==(u=null==(c=C.value)?void 0:c.init_pricing_plan_subscription)?void 0:u.success_url,{paymentMethodOptions:A,subscription:w,isPaymentMethodsPending:P,isInvoicePreviewPending:B,checkoutForm:V,invoicePreview:T,invoicePreviewByBillingPeriod:j,trialInvoicePreview:z,trialPeriod:O,authorizationContext:$,isPaid:U,amount:F,loadInvoicePreview:G,updateInvoicePreviewOnBillingInformationChange:K}=Y({initialCountry:null==(d=v.configuration)?void 0:d.countryCode,initialEmail:null==(m=v.configuration)?void 0:m.email,subscriptionId:E,enabledPricingIds:null==(f=v.configuration)?void 0:f.enabledPricingIds}),q=async()=>{var e;await V.validation.value.$validate(),V.validation.value.$invalid||null==(e=b.value)||e.submit()},H=async()=>(await V.validation.value.$validate(),!V.validation.value.$invalid),Q=e.computed(()=>!!z.value),Z=e.computed(()=>!!T.value&&(e=>{var t;return(null==(t=e.periods)?void 0:t.some(e=>e.groups.some(e=>{var t;return null==(t=e.lines)?void 0:t.some(e=>e.product_items.some(e=>"USAGE_BASED"===e.model_type))})))??!1})(T.value)),X=e.computed(()=>V.form.value.country&&["US","CA"].includes(V.form.value.country)||!1),W=e.computed({get:()=>V.form.value.enabledPricingIds??[],set:e=>{V.form.value.enabledPricingIds=e}}),J=e.computed(()=>w.value?S({pricingPlanScheduleInfos:w.value.pricing_plan_schedule_infos,type:"DEFAULT"}):void 0),te=e.computed(()=>{var e,t;if(!w.value)return;const i=null==(t=null==(e=J.value)?void 0:e.pricing_plan_version)?void 0:t.pricing_currency_settings;return L({country:V.form.value.country,pricingCurrencySettings:i,fallbackCurrency:w.value.billing_currency})}),ie=e.computed(()=>{if(!J.value||!w.value)return new Set;const e=function({pricingPlanScheduleInfo:e}){const t=new Map;return(e.pricing_plan_version.pricing_categories??[]).forEach(e=>{var i;null==(i=e.pricings)||i.forEach(e=>{var i;null==(i=e.items)||i.forEach(e=>{var i;null==(i=e.pricing_currency_configs)||i.forEach(e=>{var i,n;const o=e.currency;null==(i=e.billing_period_configs)||i.forEach(e=>{var i;null==(i=e.configs)||i.forEach(i=>{i.id&&t.set(i.id,{currency:o,billingPeriod:e.billing_period})})}),null==(n=e.configs)||n.forEach(e=>{e.id&&t.set(e.id,{currency:o})})})})})}),t}({pricingPlanScheduleInfo:J.value}),t=te.value,i=w.value.billing_period,n=new Set;return e.forEach((e,o)=>{t&&e.currency!==t||i&&e.billingPeriod&&(e.billingPeriod.type!==i.type||e.billingPeriod.value!==i.value)||n.add(o)}),n}),ne=e.computed({get:()=>{const e=V.form.value.seatsValues??[],t=ie.value;return t.size?e.filter(({pricing_item_config_id:e})=>t.has(e)):e},set:e=>{const t=V.form.value.seatsValues??[],i=ie.value;if(!i.size)return void(V.form.value.seatsValues=e);const n=t.filter(({pricing_item_config_id:e})=>!i.has(e));V.form.value.seatsValues=n.concat(e)}}),ae=e.computed(()=>{var e,i,n,o,a;return z.value?N({defaultMessage:"{discounted_amount} for {trial_period}, then {subscription_amount}/{billing_period} until canceled, starting {start_date, date, ::MMMMd}.",id:"checkout.agreement.trial",description:"The agreement for the trial period"},{discounted_amount:"0.00"===z.value.tax_summary.total_amount.quantity?N({defaultMessage:"Free",id:"checkout.agreement.trial.free",description:"The free amount for the trial period"}):t.formatAmount(z.value.tax_summary.total_amount),trial_period:k(O.value,{short:!0}),subscription_amount:t.formatAmount((null==(e=T.value)?void 0:e.tax_summary.total_amount)??{quantity:"0.00",currency:"EUR"}),billing_period:k((null==(i=T.value)?void 0:i.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(fe.value)}):N({defaultMessage:"{subscription_amount}/{billing_period} until canceled, starting {start_date, date, long}.",id:"checkout.agreement.subscription",description:"The agreement for the subscription"},{subscription_amount:(null==(n=T.value)?void 0:n.tax_summary.total_amount)?t.formatAmount(null==(o=T.value)?void 0:o.tax_summary.total_amount):"",billing_period:k((null==(a=T.value)?void 0:a.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(fe.value)})}),re=e.computed(()=>{var e,t,i,n,o,a;if(!T.value)return;const r=(null==(e=w.value)?void 0:e.name)??(null==(o=null==(n=null==(i=null==(t=w.value)?void 0:t.pricing_plan_schedule_infos)?void 0:i.at(-1))?void 0:n.pricing_plan_version.pricing_plan)?void 0:o.name)??"Subscription";return{description:r,managementURL:"https://www.solvimon.com/account/billing",agreement:ae.value,...z.value&&O.value&&{trial:{label:N({defaultMessage:"Trial",id:"checkout.trial.label",description:"The label of the trial"}),amount:z.value.tax_summary.total_amount,startDate:pe.value?new Date(pe.value):void 0,endDate:ge.value?new Date(ge.value):void 0}},regular:{label:r,amount:T.value.tax_summary.total_amount,startDate:fe.value?new Date(fe.value):void 0,interval:(null==(a=w.value)?void 0:a.billing_period)??{type:"MONTH",value:1}}}}),ue=e=>t.isValidCountryCode(e),de=e=>{const{country:t,...i}=e;V.updateInitialState({...i,...t&&ue(t)?{country:t}:{}})},se=e.computed(()=>{var e,t;return!((null==(e=v.configuration)?void 0:e.email)&&(null==(t=v.configuration)?void 0:t.countryCode))}),pe=e.computed(()=>{var e,t,i;const n=null==(t=null==(e=z.value)?void 0:e.periods)?void 0:t[0],o=null==(i=me.value)?void 0:i.trialStartDate;return(null==n?void 0:n.start_at)?new Date(n.start_at):o}),me=e.computed(()=>function(e){var t;const i={trialStartDate:void 0,trialEndDate:void 0,subscriptionStartDate:void 0,subscriptionEndDate:void 0};if(!(null==(t=null==e?void 0:e.pricing_plan_schedule_infos)?void 0:t.length))return i;const n=new Date,o=S({type:"TRIAL",pricingPlanScheduleInfos:e.pricing_plan_schedule_infos});if((null==o?void 0:o.start_at)&&(i.trialStartDate=n,o.end_at)){const e=new Date(o.end_at).getTime()-new Date(o.start_at).getTime();i.trialEndDate=new Date(n.getTime()+e)}const a=S({type:"DEFAULT",pricingPlanScheduleInfos:e.pricing_plan_schedule_infos});if((null==a?void 0:a.start_at)&&(i.trialEndDate?i.subscriptionStartDate=i.trialEndDate:i.subscriptionStartDate=n,a.end_at)){const e=new Date(a.end_at).getTime()-new Date(a.start_at).getTime();i.subscriptionEndDate=new Date(n.getTime()+e)}return i}(w.value)),ge=e.computed(()=>{var e,t,i;const n=null==(t=null==(e=z.value)?void 0:e.periods)?void 0:t[0],o=null==(i=me.value)?void 0:i.trialEndDate;return(null==n?void 0:n.end_at)?new Date(n.end_at):o}),fe=e.computed(()=>{var e,t,i;const n=null==(t=null==(e=T.value)?void 0:e.periods)?void 0:t[0],o=null==(i=me.value)?void 0:i.subscriptionStartDate;return(null==n?void 0:n.start_at)?new Date(n.start_at):o}),ye=e.computed(()=>!!(V.form.value.seatsValues&&V.form.value.seatsValues.length>0)||(!(!w.value||!function(e){return R(e).some(e=>"EXACTLY_ONE"===e.selection_constraint||"AT_LEAST_ONE"===e.selection_constraint)}(w.value))||!(!w.value||!function(e){const t=e.pricing_plan_schedule_infos.flatMap(e=>{var t;return(null==(t=e.pricing_plan_version.pricing_categories)?void 0:t.flatMap(e=>e.pricings??[]))??[]}),i=R(e);return t.some(e=>"ADDON"===e.product_type)||i.some(e=>"ADDON"===e.object_type)}(w.value)))),he=e.ref(null),{applyPromotionCode:be,removePromotionCode:Me,isPromotionCodePending:Ne,promotionCodeErrorMessage:Ie}=function({checkoutForm:t,updateInvoicePreviewOnBillingInformationChange:i,logger:n,formatErrorMessage:o,onInvalidPromotionCode:a,onApplyError:r}){const l=e.ref(!1),c=e.ref(null),u=(e,t)=>{c.value=o?o({action:e,error:t}):"apply"===e?"Promotion code could not be applied. Please try again.":"Promotion code could not be removed. Please try again."},d=async({suppressError:e=!1,preserveErrorMessage:o=!1}={})=>{o||(c.value=null),delete t.form.value.promotionCode,l.value=!0;try{await i({})}catch(a){null==n||n.capture(a,{code:"PROMOTION_CODE_REMOVE_FAILED",message:"Failed to remove promotion code"}),e||u("remove",a)}finally{l.value=!1}};return{applyPromotionCode:async e=>{const o=null==e?void 0:e.trim();if(o){c.value=null,t.form.value.promotionCode=o,l.value=!0;try{await i({promotionCode:o})}catch(s){null==n||n.capture(s,{code:"PROMOTION_CODE_APPLY_FAILED",message:"Failed to apply promotion code"}),u("apply",s),null==r||r(),(e=>function(e){return"object"==typeof e&&null!==e&&"field"in e}(e)&&"promotion_codes"===e.field)(s)&&(null==a||a()),await d({suppressError:!0,preserveErrorMessage:!0})}finally{l.value=!1}}},removePromotionCode:d,isPromotionCodePending:l,promotionCodeErrorMessage:c}}({checkoutForm:V,updateInvoicePreviewOnBillingInformationChange:K,logger:M,formatErrorMessage:({action:e})=>N("apply"===e?{defaultMessage:"Promotion code could not be applied. Please try again.",id:"checkout.promotion_code.apply_failed",description:"Error message when applying a promotion code in checkout failed"}:{defaultMessage:"Promotion code could not be removed. Please try again.",id:"checkout.promotion_code.remove_failed",description:"Error message when removing a promotion code in checkout failed"}),onInvalidPromotionCode:()=>{he.value=null},onApplyError:()=>{he.value=null}}),ke=()=>{U.value=!0,Ie.value=null},Ce=e=>{w.value&&(w.value={...w.value,billing_period:e},G())};return e.onMounted(()=>{y("ready")}),(i,n)=>h.value?(e.openBlock(),e.createBlock(le,{key:0})):(e.openBlock(),e.createBlock(e.unref(s.ContentWithAsideLayout),{key:1},{header:e.withCtx(()=>[e.createVNode(g._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>{var t,i,n;return[e.unref(T)&&e.unref(w)&&fe.value?(e.openBlock(),e.createBlock(oe,{key:0,"trial-start-date":pe.value,"trial-period":e.unref(O),"subscription-start-date":fe.value,"subscription-name":(null==(t=e.unref(w))?void 0:t.name)??"",amount:null==(i=e.unref(T))?void 0:i.invoice_amount_including_tax,"billing-period":null==(n=e.unref(w))?void 0:n.billing_period,"country-code":e.unref(V).form.value.country},null,8,["trial-start-date","trial-period","subscription-start-date","subscription-name","amount","billing-period","country-code"])):e.createCommentVNode("",!0)]}),_:1})]),content:e.withCtx(()=>{var i,a,r;return[e.unref(w)&&e.unref(x)?(e.openBlock(),e.createBlock(ve,{key:0,subscription:e.unref(w),invoice:e.unref(T),"invoice-preview-by-billing-period":e.unref(j),"trial-invoice":e.unref(z),"enabled-pricing-ids":W.value,"trial-period":e.unref(O),avatar:null==(i=_.value)?void 0:i.avatar,"is-paid":e.unref(U),"is-usage-based":Z.value,"is-preview-and-payment-methods-pending":e.unref(P)||e.unref(B),"country-code":e.unref(V).form.value.country,collapsible:"collapsed",variant:"products-inline",onBillingPeriodChange:Ce},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending","country-code"])):e.createCommentVNode("",!0),ye.value&&e.unref(w)?(e.openBlock(),e.createBlock(nt,{key:1,"seats-values":ne.value,"onUpdate:seatsValues":n[0]||(n[0]=e=>ne.value=e),"enabled-pricing-ids":W.value,"onUpdate:enabledPricingIds":n[1]||(n[1]=e=>W.value=e),subscription:e.unref(w),"initial-seats-values":null==(a=e.unref(V).initialState)?void 0:a.value.seatsValues,"billing-period":e.unref(w).billing_period,currency:te.value},null,8,["seats-values","enabled-pricing-ids","subscription","initial-seats-values","billing-period","currency"])):e.createCommentVNode("",!0),!e.unref(U)&&e.unref(V).form.value.country&&e.unref(F)&&re.value?(e.openBlock(),e.createBlock(Be,{key:2,amount:e.unref(F),"country-code":e.unref(V).form.value.country,locale:e.unref(I),"payment-methods-options-response":e.unref(A)??[],"billing-information":re.value,"on-billing-information-change":e.unref(K),onUpdateBillingInformation:de},null,8,["amount","country-code","locale","payment-methods-options-response","billing-information","on-billing-information-change"])):e.createCommentVNode("",!0),e.unref(U)?(e.openBlock(),e.createBlock(ce,{key:3,"redirect-url":e.unref(D)},null,8,["redirect-url"])):e.createCommentVNode("",!0),e.unref(U)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ee,{key:4,modelValue:e.unref(V).form.value,"onUpdate:modelValue":n[2]||(n[2]=t=>e.unref(V).form.value=t),validation:e.unref(V).validation,"read-only-email":null==(r=v.configuration)?void 0:r.email,"show-customer-info-on-top":se.value||e.unref(U),"is-billing-information-mandatory":X.value,"get-is-field-required":e.unref(V).getIsFieldRequired,"read-only":e.unref(U)},null,8,["modelValue","validation","read-only-email","show-customer-info-on-top","is-billing-information-mandatory","get-is-field-required","read-only"])),e.unref(U)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(g._sfc_main,{key:5,variant:"section",class:"min-h-[130px]"},{default:e.withCtx(()=>[!e.unref(P)||e.unref(P)&&e.unref(A).length>0?(e.openBlock(),e.createElementBlock("div",mt,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2",class:"mb-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)({defaultMessage:"Payment method",id:"checkout.payment_method_block.title",description:"The title of the payment method block in the checkout form"})),1)]),_:1}),e.unref(V).form.value.country?0===e.unref(A).length?(e.openBlock(),e.createBlock(_e,{key:1,icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)({defaultMessage:"No payment methods available",id:"checkout.payment_method_block.no_payment_methods_available_title",description:"The title shown when there are no available payment methods"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)({defaultMessage:"There are no available payment methods. Please contact support for more information.",id:"checkout.payment_method_block.no_payment_methods_available_message",description:"The message shown when there are no available payment methods"})),1)]),_:1})):e.unref(F)&&e.unref(V).form.value.country?(e.openBlock(),e.createBlock(o._sfc_main,{key:2,ref_key:"paymentIntegrationFormRef",ref:b,"country-code":e.unref(V).form.value.country,context:e.unref($),amount:e.unref(F),variant:"AUTHORIZE","payment-method-options":e.unref(A)??[],"success-redirect-url":e.unref(D),"validate-on-submit":H,"force-store-payment-method":"",onPaymentSuccess:ke,onReady:n[3]||(n[3]=e=>y("ready"))},null,8,["country-code","context","amount","payment-method-options","success-redirect-url"])):e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_e,{key:0,icon:"captive_portal"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)({defaultMessage:"Select your billing country",id:"checkout.payment_method_block.no_country_selected_title",description:"The title shown when no country is selected"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)({defaultMessage:"Payment methods will be shown after you select the billing country.",id:"checkout.payment_method_block.no_country_selected_message",description:"The message shown when no country is selected"})),1)]),_:1}))])):e.createCommentVNode("",!0)]),_:1}))]}),aside:e.withCtx(()=>[e.createVNode(g._sfc_main,{variant:"section",class:"min-h-[220px]"},{default:e.withCtx(()=>{var t;return[e.unref(w)&&e.unref(T)?(e.openBlock(),e.createBlock(ve,{key:0,subscription:e.unref(w),invoice:e.unref(T),"invoice-preview-by-billing-period":e.unref(j),"trial-invoice":e.unref(z),"enabled-pricing-ids":W.value,"trial-period":e.unref(O),"country-code":e.unref(V).form.value.country,avatar:null==(t=_.value)?void 0:t.avatar,"is-paid":e.unref(U),"is-usage-based":Z.value,"is-preview-and-payment-methods-pending":e.unref(P)||e.unref(B),onBillingPeriodChange:Ce},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","country-code","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending"])):e.createCommentVNode("",!0)]}),_:1}),e.unref(U)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(pt,{key:0,"promotion-code":he.value,"onUpdate:appliedCode":n[4]||(n[4]=e=>he.value=e),onRemove:e.unref(Me),onApply:e.unref(be)},null,8,["promotion-code","onRemove","onApply"])),e.unref(Ie)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$16),{key:1,class:"mt-2",title:e.unref(Ie)},null,8,["title"])):e.createCommentVNode("",!0),e.unref(U)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(g._sfc_main,{key:2,class:"min-h-[44px]"},{default:e.withCtx(()=>[e.unref(T)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,type:"button",size:"lg",class:"full-width",disabled:e.unref(Ne)||0===e.unref(A).length,onClick:q},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Q.value?e.unref(N)({defaultMessage:"Start trial",id:"checkout.pay_and_subscribe_button_trial.label",description:"The label of the start trial button in the checkout form"}):e.unref(N)({defaultMessage:"Pay and subscribe",id:"checkout.pay_and_subscribe_button.label",description:"The label of the pay and subscribe button in the checkout form"})),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0)]),_:1})),e.createVNode(e.unref(t._sfc_main$2),{tag:"div",variant:"body-sm",shade:"lighter",class:"flex grow justify-center"},{default:e.withCtx(()=>[e.createVNode(p._sfc_main$1,{icon:"lock",kpi:e.unref(N)({defaultMessage:"Secure and encrypted payments",id:"checkout.kpi.encrypted_payments.label",description:"The encrypted payments KPI shown in the checkout"})},null,8,["kpi"])]),_:1})]),_:1}))}}),ft=e.defineComponent({__name:"Checkout.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},emits:["error","ready"],setup(i,{emit:n}){var a,r;const l=i,c=n,u=o.useLogger(),d=(e=>{if(e)return t.isValidCountryCode(e)?e:void u.error("INVALID_COUNTRY_CODE",`invalid country code provided: "${e}"`)})(null==(a=l.configuration)?void 0:a.countryCode),s=(e=>{if(e)return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?e:void u.error("INVALID_EMAIL",`invalid email provided: "${e}"`)})(null==(r=l.configuration)?void 0:r.email);return(n,o)=>{var a,r,l,u;return e.openBlock(),e.createBlock(t._sfc_main$1,{"custom-element-name":e.unref(yt),environment:i.environment,locale:i.locale,"portal-object":i.portalObject,"allowed-portal-types":["INIT_PRICING_PLAN_SUBSCRIPTION"],"primary-color":null==(r=null==(a=i.branding)?void 0:a.colors)?void 0:r.primary,"secondary-color":null==(u=null==(l=i.branding)?void 0:l.colors)?void 0:u.secondary,"experimental-features":i.experimentalFeatures,"log-level":i.logLevel,"on-log":i.onLog,onError:o[1]||(o[1]=e=>n.$emit("error",e))},{default:e.withCtx(()=>{var t,a,r;return[e.createVNode(gt,{avatar:null==(a=null==(t=i.branding)?void 0:t.emblem)?void 0:a.public_url,email:e.unref(s),"country-code":e.unref(d),"enabled-pricing-ids":null==(r=i.configuration)?void 0:r.enabledPricingIds,onReady:o[0]||(o[0]=e=>c("ready"))},e.createSlots({_:2},[n.$slots["terms-and-conditions"]?{name:"terms-and-conditions",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"terms-and-conditions")]),key:"0"}:void 0]),1032,["avatar","email","country-code","enabled-pricing-ids"])]}),_:3},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),vt=t.defineCustomElement(ft),yt=t.getComponentName("checkout");exports.COMPONENT_NAME=yt,exports.SolvimonCheckout=vt,exports.defineSolvimonCheckout=()=>{customElements.get(yt)||customElements.define(yt,vt)};