@revenuecat/purchases-js 0.11.0 → 0.11.1

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.
@@ -3228,8 +3228,8 @@ class cn extends D {
3228
3228
  const _o = {
3229
3229
  error: "#f2545b",
3230
3230
  warning: "#f4e971",
3231
- focus: "#576CDB",
3232
- accent: "#576CDB",
3231
+ focus: "#000080",
3232
+ accent: "#7676767",
3233
3233
  primary: "#000000",
3234
3234
  "primary-text": "#ffffff",
3235
3235
  white: "#ffffff",
@@ -3242,8 +3242,8 @@ const _o = {
3242
3242
  }, go = {
3243
3243
  error: "#f2545b",
3244
3244
  warning: "#f4e971",
3245
- focus: "#576CDB",
3246
- accent: "#576CDB",
3245
+ focus: "#000080",
3246
+ accent: "#7676767",
3247
3247
  primary: "#ffffff",
3248
3248
  "primary-text": "#000000",
3249
3249
  white: "#ffffff",
@@ -6027,7 +6027,7 @@ function al(t) {
6027
6027
  }
6028
6028
  return e;
6029
6029
  }
6030
- const cl = "0.11.0", ul = "https://api.revenuecat.com";
6030
+ const cl = "0.11.1", ul = "https://api.revenuecat.com";
6031
6031
  var Ce;
6032
6032
  (function(t) {
6033
6033
  t[t.CONTINUE = 100] = "CONTINUE", t[t.SWITCHING_PROTOCOLS = 101] = "SWITCHING_PROTOCOLS", t[t.PROCESSING = 102] = "PROCESSING", t[t.EARLY_HINTS = 103] = "EARLY_HINTS", t[t.OK = 200] = "OK", t[t.CREATED = 201] = "CREATED", t[t.ACCEPTED = 202] = "ACCEPTED", t[t.NON_AUTHORITATIVE_INFORMATION = 203] = "NON_AUTHORITATIVE_INFORMATION", t[t.NO_CONTENT = 204] = "NO_CONTENT", t[t.RESET_CONTENT = 205] = "RESET_CONTENT", t[t.PARTIAL_CONTENT = 206] = "PARTIAL_CONTENT", t[t.MULTI_STATUS = 207] = "MULTI_STATUS", t[t.MULTIPLE_CHOICES = 300] = "MULTIPLE_CHOICES", t[t.MOVED_PERMANENTLY = 301] = "MOVED_PERMANENTLY", t[t.MOVED_TEMPORARILY = 302] = "MOVED_TEMPORARILY", t[t.SEE_OTHER = 303] = "SEE_OTHER", t[t.NOT_MODIFIED = 304] = "NOT_MODIFIED", t[t.USE_PROXY = 305] = "USE_PROXY", t[t.TEMPORARY_REDIRECT = 307] = "TEMPORARY_REDIRECT", t[t.PERMANENT_REDIRECT = 308] = "PERMANENT_REDIRECT", t[t.BAD_REQUEST = 400] = "BAD_REQUEST", t[t.UNAUTHORIZED = 401] = "UNAUTHORIZED", t[t.PAYMENT_REQUIRED = 402] = "PAYMENT_REQUIRED", t[t.FORBIDDEN = 403] = "FORBIDDEN", t[t.NOT_FOUND = 404] = "NOT_FOUND", t[t.METHOD_NOT_ALLOWED = 405] = "METHOD_NOT_ALLOWED", t[t.NOT_ACCEPTABLE = 406] = "NOT_ACCEPTABLE", t[t.PROXY_AUTHENTICATION_REQUIRED = 407] = "PROXY_AUTHENTICATION_REQUIRED", t[t.REQUEST_TIMEOUT = 408] = "REQUEST_TIMEOUT", t[t.CONFLICT = 409] = "CONFLICT", t[t.GONE = 410] = "GONE", t[t.LENGTH_REQUIRED = 411] = "LENGTH_REQUIRED", t[t.PRECONDITION_FAILED = 412] = "PRECONDITION_FAILED", t[t.REQUEST_TOO_LONG = 413] = "REQUEST_TOO_LONG", t[t.REQUEST_URI_TOO_LONG = 414] = "REQUEST_URI_TOO_LONG", t[t.UNSUPPORTED_MEDIA_TYPE = 415] = "UNSUPPORTED_MEDIA_TYPE", t[t.REQUESTED_RANGE_NOT_SATISFIABLE = 416] = "REQUESTED_RANGE_NOT_SATISFIABLE", t[t.EXPECTATION_FAILED = 417] = "EXPECTATION_FAILED", t[t.IM_A_TEAPOT = 418] = "IM_A_TEAPOT", t[t.INSUFFICIENT_SPACE_ON_RESOURCE = 419] = "INSUFFICIENT_SPACE_ON_RESOURCE", t[t.METHOD_FAILURE = 420] = "METHOD_FAILURE", t[t.MISDIRECTED_REQUEST = 421] = "MISDIRECTED_REQUEST", t[t.UNPROCESSABLE_ENTITY = 422] = "UNPROCESSABLE_ENTITY", t[t.LOCKED = 423] = "LOCKED", t[t.FAILED_DEPENDENCY = 424] = "FAILED_DEPENDENCY", t[t.UPGRADE_REQUIRED = 426] = "UPGRADE_REQUIRED", t[t.PRECONDITION_REQUIRED = 428] = "PRECONDITION_REQUIRED", t[t.TOO_MANY_REQUESTS = 429] = "TOO_MANY_REQUESTS", t[t.REQUEST_HEADER_FIELDS_TOO_LARGE = 431] = "REQUEST_HEADER_FIELDS_TOO_LARGE", t[t.UNAVAILABLE_FOR_LEGAL_REASONS = 451] = "UNAVAILABLE_FOR_LEGAL_REASONS", t[t.INTERNAL_SERVER_ERROR = 500] = "INTERNAL_SERVER_ERROR", t[t.NOT_IMPLEMENTED = 501] = "NOT_IMPLEMENTED", t[t.BAD_GATEWAY = 502] = "BAD_GATEWAY", t[t.SERVICE_UNAVAILABLE = 503] = "SERVICE_UNAVAILABLE", t[t.GATEWAY_TIMEOUT = 504] = "GATEWAY_TIMEOUT", t[t.HTTP_VERSION_NOT_SUPPORTED = 505] = "HTTP_VERSION_NOT_SUPPORTED", t[t.INSUFFICIENT_STORAGE = 507] = "INSUFFICIENT_STORAGE", t[t.NETWORK_AUTHENTICATION_REQUIRED = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
@@ -18,7 +18,7 @@
18
18
  -20px 0 #ffff;background:#fff2}50%{box-shadow:20px 0 #fff2,
19
19
  -20px 0 #fff2;background:#ffff}75%{box-shadow:20px 0 #ffff,
20
20
  -20px 0 #fff2;background:#fff2}100%{box-shadow:20px 0 #fff2,
21
- -20px 0 #fff2;background:#fff2}}`)}function so(t){let e;return{c(){e=v("div"),b(e,"class","processing svelte-rjmul6")},m(r,n){g(r,e,n)},p:h,i:h,o:h,d(r){r&&_(e)}}}class Vt extends j{constructor(e){super(),C(this,e,null,so,A,{},oo)}}const lo={error:"#f2545b",warning:"#f4e971",focus:"#576CDB",accent:"#576CDB",primary:"#000000","primary-text":"#ffffff",white:"#ffffff","grey-text-dark":"rgba(0,0,0,1)","grey-text-light":"rgba(0,0,0,0.5)","grey-ui-dark":"rgba(0,0,0,0.125)","grey-ui-light":"rgba(0,0,0,0.005)","input-background":"transparent",background:"white"},ao={error:"#f2545b",warning:"#f4e971",focus:"#576CDB",accent:"#576CDB",primary:"#ffffff","primary-text":"#000000",white:"#ffffff","grey-text-dark":"rgba(255,255,255,1)","grey-text-light":"rgba(255,255,255,0.5)","grey-ui-dark":"rgba(255,255,255,0.125)","grey-ui-light":"rgba(255,255,255,0.005)","input-background":"transparent",background:"#000000"},Yt={error:"color_error",focus:"color_accent",accent:"color_accent",primary:"color_buttons_primary"},co={...Yt,background:"color_form_bg"},uo={...Yt,background:"color_product_info_bg"},zt={"input-border-radius":"12px","input-button-border-radius":"12px","modal-border-radius":"16px"},fo={"input-border-radius":"0px","input-button-border-radius":"0px","modal-border-radius":"0px"},po={"input-border-radius":"24px","input-button-border-radius":"56px","modal-border-radius":"16px"},Wt=zt,Kt=t=>t.length==7?{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16)}:t.length==4?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null,Qt=({r:t,g:e,b:r})=>{const n=o=>(o=o/255,o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4));return .2126*n(t)+.7152*n(e)+.0722*n(r)>.179},mo=t=>{const e=Qt(t)?"0,0,0":"255,255,255";return{"grey-text-dark":`rgba(${e},1.0)`,"grey-text-light":`rgba(${e},0.50)`,"grey-ui-dark":`rgba(${e},0.125)`,"grey-ui-light":`rgba(${e},0.05)`}},_o=(t,e,r)=>{const n={"grey-text-dark":r["grey-text-dark"],"grey-text-light":r["grey-text-light"],"grey-ui-dark":r["grey-ui-dark"],"grey-ui-light":r["grey-ui-light"],"primary-text":r["primary-text"]};if(t!=null&&t.startsWith("#")){const i=Kt(t);i!==null&&Object.assign(n,mo(i))}if(e!=null&&e.startsWith("#")){const i=Kt(e);i!==null&&(n["primary-text"]=Qt(i)?"black":"white")}return n},go=(t,e)=>t||e,ho=(t,e,r)=>{const n=Object.entries(t).map(([i,o])=>[i,go(r?r[o]:null,e[i])]);return Object.fromEntries(n)},Xt=(t,e,r)=>{const n=ho(t,e,r);return r?{...e,...n,..._o(n.background,n.primary,e)}:{...e}},bo=t=>Xt(uo,ao,t),Zt=t=>Xt(co,lo,t),at=t=>{if(!t)return Wt;switch(t.shapes){case"rounded":return zt;case"rectangle":return fo;case"pill":return po;default:return Wt}},Ve=(t="",e)=>e.map(([r,n])=>`--rc-${t}-${r}: ${n}`).join("; "),Jt=t=>{const e=Ve("color",Object.entries(bo(t))),r=Ve("shape",Object.entries(at(t)));return[e,r].join("; ")},wo=t=>{const e=Ve("color",Object.entries(Zt(t))),r=Ve("shape",Object.entries(at(t)));return[e,r].join("; ")};class ct{constructor(e){this.brandingAppearance=e}get shape(){return at(this.brandingAppearance)}get formColors(){return Zt(this.brandingAppearance)}get formStyleVars(){return wo(this.brandingAppearance)}get productInfoStyleVars(){return Jt(this.brandingAppearance)}}function yo(t){R(t,"svelte-8jsoa8",".rcb-stripe-elements-container.svelte-8jsoa8{width:100%;min-height:320px;margin-top:32px;margin-bottom:24px}")}function Eo(t){let e,r;return e=new rt({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p:h,i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function vo(t){let e,r,n,i,o,s,l,a;e=new lt({props:{$$slots:{default:[Io]},$$scope:{ctx:t}}});function c(f){t[14](f)}let u={stripe:t[5],clientSecret:t[6],loader:"always",locale:"en",theme:"stripe",variables:{borderRadius:t[8]["input-border-radius"],fontSizeBase:"16px",fontSizeSm:"16px",spacingGridRow:"16px",focusBoxShadow:"none",colorDanger:t[9].error,colorTextPlaceholder:t[9]["grey-text-light"]},rules:{".Input":{boxShadow:"none",border:`2px solid ${t[9]["grey-ui-dark"]}`,backgroundColor:"transparent",color:t[9]["grey-text-dark"]},".Input:focus":{border:`2px solid ${t[9].focus}`,outline:"none"},".Label":{marginBottom:"8px",fontWeight:"500",lineHeight:"22px",color:t[9]["grey-text-dark"]},".Input--invalid":{boxShadow:"none"},".Tab":{boxShadow:"none",backgroundColor:"transparent"}},$$slots:{default:[Uo]},$$scope:{ctx:t}};return t[4]!==void 0&&(u.elements=t[4]),i=new qi({props:u}),je.push(()=>Qn(i,"elements",c)),{c(){T(e.$$.fragment),r=S(),n=v("form"),T(i.$$.fragment)},m(f,m){k(e,f,m),g(f,r,m),g(f,n,m),k(i,n,null),s=!0,l||(a=Pe(n,"submit",wt(t[7])),l=!0)},p(f,m){const w={};m&131074&&(w.$$scope={dirty:m,ctx:f}),e.$set(w);const I={};m&32&&(I.stripe=f[5]),m&131085&&(I.$$scope={dirty:m,ctx:f}),!o&&m&16&&(o=!0,I.elements=f[4],zn(()=>o=!1)),i.$set(I)},i(f){s||(d(e.$$.fragment,f),d(i.$$.fragment,f),s=!0)},o(f){p(e.$$.fragment,f),p(i.$$.fragment,f),s=!1},d(f){f&&(_(r),_(n)),P(e,f),P(i),l=!1,a()}}}function Io(t){let e,r,n,i,o,s,l;return r=new io({}),s=new st({}),s.$on("click",function(){ne(t[1])&&t[1].apply(this,arguments)}),{c(){e=v("div"),T(r.$$.fragment),n=S(),i=v("div"),i.textContent="Secure Checkout",o=S(),T(s.$$.fragment),fe(i,"margin-left","10px"),fe(e,"display","flex"),fe(e,"align-items","center"),fe(e,"justify-content","baseline")},m(a,c){g(a,e,c),k(r,e,null),L(e,n),L(e,i),g(a,o,c),k(s,a,c),l=!0},p(a,c){t=a},i(a){l||(d(r.$$.fragment,a),d(s.$$.fragment,a),l=!0)},o(a){p(r.$$.fragment,a),p(s.$$.fragment,a),l=!1},d(a){a&&(_(e),_(o)),P(r),P(s,a)}}}function $o(t){let e,r,n;return r=new ji({}),{c(){e=v("div"),T(r.$$.fragment),b(e,"class","rcb-stripe-elements-container svelte-8jsoa8")},m(i,o){g(i,e,o),k(r,e,null),n=!0},p:h,i(i){n||(d(r.$$.fragment,i),n=!0)},o(i){p(r.$$.fragment,i),n=!1},d(i){i&&_(e),P(r)}}}function ko(t){let e;return{c(){e=V("Pay")},m(r,n){g(r,e,n)},i:h,o:h,d(r){r&&_(e)}}}function Po(t){let e;return{c(){e=V("Start Trial")},m(r,n){g(r,e,n)},i:h,o:h,d(r){r&&_(e)}}}function To(t){let e,r;return e=new Vt({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Ao(t){let e,r,n,i;const o=[To,Po,ko],s=[];function l(a,c){var u,f;return a[0]?0:(f=(u=a[2].subscriptionOptions)==null?void 0:u[a[3].id])!=null&&f.trial?1:2}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ae()},m(a,c){s[e].m(a,c),g(a,n,c),i=!0},p(a,c){let u=e;e=l(a),e!==u&&(Q(),p(s[u],1,1,()=>{s[u]=null}),X(),r=s[e],r||(r=s[e]=o[e](a),r.c()),d(r,1),r.m(n.parentNode,n))},i(a){i||(d(r),i=!0)},o(a){p(r),i=!1},d(a){a&&_(n),s[e].d(a)}}}function Oo(t){let e,r;return e=new it({props:{disabled:t[0],testId:"PayButton",$$slots:{default:[Ao]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.disabled=n[0]),i&131085&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function No(t){let e,r;return e=new Re({props:{$$slots:{default:[Oo]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&131085&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Uo(t){let e,r,n,i;return e=new Ee({props:{$$slots:{default:[$o]},$$scope:{ctx:t}}}),n=new ot({props:{$$slots:{default:[No]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment),r=S(),T(n.$$.fragment)},m(o,s){k(e,o,s),g(o,r,s),k(n,o,s),i=!0},p(o,s){const l={};s&131072&&(l.$$scope={dirty:s,ctx:o}),e.$set(l);const a={};s&131085&&(a.$$scope={dirty:s,ctx:o}),n.$set(a)},i(o){i||(d(e.$$.fragment,o),d(n.$$.fragment,o),i=!0)},o(o){p(e.$$.fragment,o),p(n.$$.fragment,o),i=!1},d(o){o&&_(r),P(e,o),P(n,o)}}}function Ro(t){let e,r,n,i;const o=[vo,Eo],s=[];function l(a,c){return a[5]&&a[6]?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=v("div"),n.c()},m(a,c){g(a,e,c),s[r].m(e,null),i=!0},p(a,[c]){let u=r;r=l(a),r===u?s[r].p(a,c):(Q(),p(s[u],1,1,()=>{s[u]=null}),X(),n=s[r],n?n.p(a,c):(n=s[r]=o[r](a),n.c()),d(n,1),n.m(e,null))},i(a){i||(d(n),i=!0)},o(a){p(n),i=!1},d(a){a&&_(e),s[r].d()}}}function Lo(t,e,r){let{onClose:n}=e,{onContinue:i}=e,{onError:o}=e,{paymentInfoCollectionMetadata:s}=e,{processing:l=!1}=e,{productDetails:a}=e,{purchaseOptionToUse:c}=e,{brandingInfo:u}=e;const f=s.data.client_secret;let m=null,w,I;Ce(async()=>{const U=s.data.publishable_api_key,x=s.data.stripe_account_id;if(!U||!x)throw new Error("Stripe publishable key or account ID not found");r(5,m=await Qi(U,{stripeAccount:x}))});const O=async()=>{if(l||!m||!I)return;r(0,l=!0);const U=await m.confirmSetup({elements:I,redirect:"if_required"});U.error?(r(0,l=!1),o(new J(te.StripeError,U.error.message))):i()},y=new ct(u==null?void 0:u.appearance);let N=y.shape,ie=y.formColors;function $(U){w=U,r(4,w)}return t.$$set=U=>{"onClose"in U&&r(1,n=U.onClose),"onContinue"in U&&r(10,i=U.onContinue),"onError"in U&&r(11,o=U.onError),"paymentInfoCollectionMetadata"in U&&r(12,s=U.paymentInfoCollectionMetadata),"processing"in U&&r(0,l=U.processing),"productDetails"in U&&r(2,a=U.productDetails),"purchaseOptionToUse"in U&&r(3,c=U.purchaseOptionToUse),"brandingInfo"in U&&r(13,u=U.brandingInfo)},t.$$.update=()=>{t.$$.dirty&16&&w&&w._elements.length>0&&(I=w)},[l,n,a,c,w,m,f,O,N,ie,i,o,s,u,$]}class So extends j{constructor(e){super(),C(this,e,Lo,Ro,A,{onClose:1,onContinue:10,onError:11,paymentInfoCollectionMetadata:12,processing:0,productDetails:2,purchaseOptionToUse:3,brandingInfo:13},yo)}}function Mo(t){return t.trim()===""?"You need to provide your email address to continue.":t.match(/^[^@]+@[^@]+\.[^@]+$/)?null:"Email is not valid. Please provide a valid email address."}function Do(t){if(t&&!t.match(/^[A-Z]{3}$/)){const e=`Currency code ${t} is not valid. Please provide a valid ISO 4217 currency code.`;throw q.errorLog(e),new Z(ee.ConfigurationError,e)}}function Bo(t){R(t,"svelte-yf01ty",".container.svelte-yf01ty.svelte-yf01ty{display:flex;flex-direction:column;flex-grow:1}form.svelte-yf01ty.svelte-yf01ty{display:flex;flex-direction:column;min-height:100%;flex-grow:1}.form-container.svelte-yf01ty.svelte-yf01ty{display:flex;flex-direction:column;width:100%;margin-top:32px;margin-bottom:16px}.form-label.svelte-yf01ty.svelte-yf01ty{margin-top:8px;margin-bottom:8px;display:block;font-weight:500;line-height:22px}.form-input.error.svelte-yf01ty input.svelte-yf01ty{border-color:var(--rc-color-error)}.form-error.svelte-yf01ty.svelte-yf01ty{margin-top:4px;font-size:16px;line-height:20px;min-height:40px;color:var(--rc-color-error)}input.svelte-yf01ty.svelte-yf01ty{width:100%;box-sizing:border-box;padding:8px;border:2px solid var(--rc-color-grey-ui-dark);border-radius:var(--rc-shape-input-border-radius);font-size:16px;height:48px;padding:6px 14px;background:var(--rc-color-input-background);color:inherit}input.svelte-yf01ty.svelte-yf01ty:focus{outline:none;border:2px solid var(--rc-color-focus)}")}function Co(t){let e,r,n,i;return n=new st({}),n.$on("click",function(){ne(t[0])&&t[0].apply(this,arguments)}),{c(){e=v("span"),e.textContent="Billing email address",r=S(),T(n.$$.fragment)},m(o,s){g(o,e,s),g(o,r,s),k(n,o,s),i=!0},p(o,s){t=o},i(o){i||(d(n.$$.fragment,o),i=!0)},o(o){p(n.$$.fragment,o),i=!1},d(o){o&&(_(e),_(r)),P(n,o)}}}function en(t){let e,r;return{c(){e=v("div"),r=V(t[2]),b(e,"class","form-error svelte-yf01ty")},m(n,i){g(n,e,i),L(e,r)},p(n,i){i&4&&ue(r,n[2])},d(n){n&&_(e)}}}function jo(t){let e,r,n,i,o,s,l,a,c,u=t[2]&&en(t);return{c(){e=v("div"),r=v("div"),r.innerHTML='<label for="email">Email</label>',n=S(),i=v("div"),o=v("input"),l=S(),u&&u.c(),b(r,"class","form-label svelte-yf01ty"),b(o,"name","email"),b(o,"placeholder","john@appleseed.com"),b(o,"autocapitalize","off"),b(o,"class","svelte-yf01ty"),b(i,"class",s="form-input "+t[4]+" svelte-yf01ty"),b(e,"class","form-container svelte-yf01ty")},m(f,m){g(f,e,m),L(e,r),L(e,n),L(e,i),L(i,o),yt(o,t[3]),L(e,l),u&&u.m(e,null),a||(c=Pe(o,"input",t[8]),a=!0)},p(f,m){m&8&&o.value!==f[3]&&yt(o,f[3]),m&16&&s!==(s="form-input "+f[4]+" svelte-yf01ty")&&b(i,"class",s),f[2]?u?u.p(f,m):(u=en(f),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},d(f){f&&_(e),u&&u.d(),a=!1,c()}}}function Fo(t){let e;return{c(){e=V("Continue")},m(r,n){g(r,e,n)},i:h,o:h,d(r){r&&_(e)}}}function Ho(t){let e,r;return e=new Vt({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function qo(t){let e,r,n,i;const o=[Ho,Fo],s=[];function l(a,c){return a[1]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ae()},m(a,c){s[e].m(a,c),g(a,n,c),i=!0},p(a,c){let u=e;e=l(a),e!==u&&(Q(),p(s[u],1,1,()=>{s[u]=null}),X(),r=s[e],r||(r=s[e]=o[e](a),r.c()),d(r,1),r.m(n.parentNode,n))},i(a){i||(d(r),i=!0)},o(a){p(r),i=!1},d(a){a&&_(n),s[e].d(a)}}}function xo(t){let e,r;return e=new it({props:{disabled:t[1],type:"submit",$$slots:{default:[qo]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&2&&(o.disabled=n[1]),i&514&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Go(t){let e,r;return e=new Re({props:{$$slots:{default:[xo]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&514&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Vo(t){let e,r,n,i,o,s,l,a,c,u;return r=new lt({props:{$$slots:{default:[Co]},$$scope:{ctx:t}}}),o=new Ee({props:{$$slots:{default:[jo]},$$scope:{ctx:t}}}),l=new ot({props:{$$slots:{default:[Go]},$$scope:{ctx:t}}}),{c(){e=v("div"),T(r.$$.fragment),n=S(),i=v("form"),T(o.$$.fragment),s=S(),T(l.$$.fragment),b(i,"class","svelte-yf01ty"),b(e,"class","container svelte-yf01ty")},m(f,m){g(f,e,m),k(r,e,null),L(e,n),L(e,i),k(o,i,null),L(i,s),k(l,i,null),a=!0,c||(u=Pe(i,"submit",wt(t[5])),c=!0)},p(f,[m]){const w={};m&513&&(w.$$scope={dirty:m,ctx:f}),r.$set(w);const I={};m&540&&(I.$$scope={dirty:m,ctx:f}),o.$set(I);const O={};m&514&&(O.$$scope={dirty:m,ctx:f}),l.$set(O)},i(f){a||(d(r.$$.fragment,f),d(o.$$.fragment,f),d(l.$$.fragment,f),a=!0)},o(f){p(r.$$.fragment,f),p(o.$$.fragment,f),p(l.$$.fragment,f),a=!1},d(f){f&&_(e),P(r),P(o),P(l),c=!1,u()}}}function Yo(t,e,r){let n,i,o,{onContinue:s}=e,{onClose:l}=e,{processing:a}=e,{lastError:c}=e;const u=async()=>{const m=Mo(n);m?r(2,i=m):s({email:n})};Hn(async()=>{r(2,i=(c==null?void 0:c.message)??"")});function f(){n=this.value,r(3,n)}return t.$$set=m=>{"onContinue"in m&&r(6,s=m.onContinue),"onClose"in m&&r(0,l=m.onClose),"processing"in m&&r(1,a=m.processing),"lastError"in m&&r(7,c=m.lastError)},t.$$.update=()=>{t.$$.dirty&4&&r(4,o=i?"error":"")},r(3,n=""),r(2,i=""),[l,a,i,n,o,u,s,c,f]}class zo extends j{constructor(e){super(),C(this,e,Yo,Vo,A,{onContinue:6,onClose:0,processing:1,lastError:7},Bo)}}function Wo(t){R(t,"svelte-17tslso",".rcb-modal-backdrop.svelte-17tslso{position:fixed;top:0;left:0;right:0;min-width:100%;width:100vw;width:100dvw;min-height:100%;height:100vh;height:100dvh;background-color:rgba(40, 40, 40, 0.75);display:flex;flex-direction:column;justify-content:space-around;z-index:1000001}")}function Ko(t){let e,r;const n=t[1].default,i=H(n,t,t[0],null);return{c(){e=v("div"),i&&i.c(),b(e,"class","rcb-modal-backdrop svelte-17tslso")},m(o,s){g(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&W(i,n,o,o[0],r?z(n,o[0],s,null):K(o[0]),null)},i(o){r||(d(i,o),r=!0)},o(o){p(i,o),r=!1},d(o){o&&_(e),i&&i.d(o)}}}function Qo(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class Xo extends j{constructor(e){super(),C(this,e,Qo,Ko,A,{},Wo)}}function Zo(t){R(t,"svelte-1fufj5b",".rcb-modal-container.svelte-1fufj5b{width:100%}.rcb-modal-main.svelte-1fufj5b{box-sizing:border-box;border-radius:var(--rc-shape-modal-border-radius);background-color:var(--rc-color-background);color:var(--rc-color-grey-text-dark);padding:40px;flex-direction:column;display:flex}@media screen and (max-width: 960px){.rcb-modal-container.svelte-1fufj5b{width:calc(100% - 32px);min-width:300px;max-width:640px;margin:auto}.rcb-modal-main.svelte-1fufj5b{min-width:300px;max-width:640px;padding:32px}}")}function Jo(t){let e,r,n;const i=t[2].default,o=H(i,t,t[1],null);return{c(){e=v("div"),r=v("main"),o&&o.c(),b(r,"class","rcb-modal-main svelte-1fufj5b"),b(r,"style",t[0]),b(e,"class","rcb-modal-container svelte-1fufj5b")},m(s,l){g(s,e,l),L(e,r),o&&o.m(r,null),n=!0},p(s,[l]){o&&o.p&&(!n||l&2)&&W(o,i,s,s[1],n?z(i,s[1],l,null):K(s[1]),null),(!n||l&1)&&b(r,"style",s[0])},i(s){n||(d(o,s),n=!0)},o(s){p(o,s),n=!1},d(s){s&&_(e),o&&o.d(s)}}}function es(t,e,r){let{$$slots:n={},$$scope:i}=e,{style:o=""}=e;return t.$$set=s=>{"style"in s&&r(0,o=s.style),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class tn extends j{constructor(e){super(),C(this,e,es,Jo,A,{style:0},Zo)}}function ts(t){let e;const r=t[1].default,n=H(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&W(n,r,i,i[2],e?z(r,i[2],o,null):K(i[2]),null)},i(i){e||(d(n,i),e=!0)},o(i){p(n,i),e=!1},d(i){n&&n.d(i)}}}function ns(t){let e,r;return e=new Xo({props:{$$slots:{default:[rs]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function rs(t){let e;const r=t[1].default,n=H(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&W(n,r,i,i[2],e?z(r,i[2],o,null):K(i[2]),null)},i(i){e||(d(n,i),e=!0)},o(i){p(n,i),e=!1},d(i){n&&n.d(i)}}}function is(t){let e,r,n,i;const o=[ns,ts],s=[];function l(a,c){return a[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ae()},m(a,c){s[e].m(a,c),g(a,n,c),i=!0},p(a,[c]){let u=e;e=l(a),e===u?s[e].p(a,c):(Q(),p(s[u],1,1,()=>{s[u]=null}),X(),r=s[e],r?r.p(a,c):(r=s[e]=o[e](a),r.c()),d(r,1),r.m(n.parentNode,n))},i(a){i||(d(r),i=!0)},o(a){p(r),i=!1},d(a){a&&_(n),s[e].d(a)}}}function os(t,e,r){let{$$slots:n={},$$scope:i}=e,{condition:o=!1}=e;return t.$$set=s=>{"condition"in s&&r(0,o=s.condition),"$$scope"in s&&r(2,i=s.$$scope)},[o,n,i]}class ss extends j{constructor(e){super(),C(this,e,os,is,A,{condition:0})}}const ls=`<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"
21
+ -20px 0 #fff2;background:#fff2}}`)}function so(t){let e;return{c(){e=v("div"),b(e,"class","processing svelte-rjmul6")},m(r,n){g(r,e,n)},p:h,i:h,o:h,d(r){r&&_(e)}}}class Vt extends j{constructor(e){super(),C(this,e,null,so,A,{},oo)}}const lo={error:"#f2545b",warning:"#f4e971",focus:"#000080",accent:"#7676767",primary:"#000000","primary-text":"#ffffff",white:"#ffffff","grey-text-dark":"rgba(0,0,0,1)","grey-text-light":"rgba(0,0,0,0.5)","grey-ui-dark":"rgba(0,0,0,0.125)","grey-ui-light":"rgba(0,0,0,0.005)","input-background":"transparent",background:"white"},ao={error:"#f2545b",warning:"#f4e971",focus:"#000080",accent:"#7676767",primary:"#ffffff","primary-text":"#000000",white:"#ffffff","grey-text-dark":"rgba(255,255,255,1)","grey-text-light":"rgba(255,255,255,0.5)","grey-ui-dark":"rgba(255,255,255,0.125)","grey-ui-light":"rgba(255,255,255,0.005)","input-background":"transparent",background:"#000000"},Yt={error:"color_error",focus:"color_accent",accent:"color_accent",primary:"color_buttons_primary"},co={...Yt,background:"color_form_bg"},uo={...Yt,background:"color_product_info_bg"},zt={"input-border-radius":"12px","input-button-border-radius":"12px","modal-border-radius":"16px"},fo={"input-border-radius":"0px","input-button-border-radius":"0px","modal-border-radius":"0px"},po={"input-border-radius":"24px","input-button-border-radius":"56px","modal-border-radius":"16px"},Wt=zt,Kt=t=>t.length==7?{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16)}:t.length==4?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null,Qt=({r:t,g:e,b:r})=>{const n=o=>(o=o/255,o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4));return .2126*n(t)+.7152*n(e)+.0722*n(r)>.179},mo=t=>{const e=Qt(t)?"0,0,0":"255,255,255";return{"grey-text-dark":`rgba(${e},1.0)`,"grey-text-light":`rgba(${e},0.50)`,"grey-ui-dark":`rgba(${e},0.125)`,"grey-ui-light":`rgba(${e},0.05)`}},_o=(t,e,r)=>{const n={"grey-text-dark":r["grey-text-dark"],"grey-text-light":r["grey-text-light"],"grey-ui-dark":r["grey-ui-dark"],"grey-ui-light":r["grey-ui-light"],"primary-text":r["primary-text"]};if(t!=null&&t.startsWith("#")){const i=Kt(t);i!==null&&Object.assign(n,mo(i))}if(e!=null&&e.startsWith("#")){const i=Kt(e);i!==null&&(n["primary-text"]=Qt(i)?"black":"white")}return n},go=(t,e)=>t||e,ho=(t,e,r)=>{const n=Object.entries(t).map(([i,o])=>[i,go(r?r[o]:null,e[i])]);return Object.fromEntries(n)},Xt=(t,e,r)=>{const n=ho(t,e,r);return r?{...e,...n,..._o(n.background,n.primary,e)}:{...e}},bo=t=>Xt(uo,ao,t),Zt=t=>Xt(co,lo,t),at=t=>{if(!t)return Wt;switch(t.shapes){case"rounded":return zt;case"rectangle":return fo;case"pill":return po;default:return Wt}},Ve=(t="",e)=>e.map(([r,n])=>`--rc-${t}-${r}: ${n}`).join("; "),Jt=t=>{const e=Ve("color",Object.entries(bo(t))),r=Ve("shape",Object.entries(at(t)));return[e,r].join("; ")},wo=t=>{const e=Ve("color",Object.entries(Zt(t))),r=Ve("shape",Object.entries(at(t)));return[e,r].join("; ")};class ct{constructor(e){this.brandingAppearance=e}get shape(){return at(this.brandingAppearance)}get formColors(){return Zt(this.brandingAppearance)}get formStyleVars(){return wo(this.brandingAppearance)}get productInfoStyleVars(){return Jt(this.brandingAppearance)}}function yo(t){R(t,"svelte-8jsoa8",".rcb-stripe-elements-container.svelte-8jsoa8{width:100%;min-height:320px;margin-top:32px;margin-bottom:24px}")}function Eo(t){let e,r;return e=new rt({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p:h,i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function vo(t){let e,r,n,i,o,s,l,a;e=new lt({props:{$$slots:{default:[Io]},$$scope:{ctx:t}}});function c(f){t[14](f)}let u={stripe:t[5],clientSecret:t[6],loader:"always",locale:"en",theme:"stripe",variables:{borderRadius:t[8]["input-border-radius"],fontSizeBase:"16px",fontSizeSm:"16px",spacingGridRow:"16px",focusBoxShadow:"none",colorDanger:t[9].error,colorTextPlaceholder:t[9]["grey-text-light"]},rules:{".Input":{boxShadow:"none",border:`2px solid ${t[9]["grey-ui-dark"]}`,backgroundColor:"transparent",color:t[9]["grey-text-dark"]},".Input:focus":{border:`2px solid ${t[9].focus}`,outline:"none"},".Label":{marginBottom:"8px",fontWeight:"500",lineHeight:"22px",color:t[9]["grey-text-dark"]},".Input--invalid":{boxShadow:"none"},".Tab":{boxShadow:"none",backgroundColor:"transparent"}},$$slots:{default:[Uo]},$$scope:{ctx:t}};return t[4]!==void 0&&(u.elements=t[4]),i=new qi({props:u}),je.push(()=>Qn(i,"elements",c)),{c(){T(e.$$.fragment),r=S(),n=v("form"),T(i.$$.fragment)},m(f,m){k(e,f,m),g(f,r,m),g(f,n,m),k(i,n,null),s=!0,l||(a=Pe(n,"submit",wt(t[7])),l=!0)},p(f,m){const w={};m&131074&&(w.$$scope={dirty:m,ctx:f}),e.$set(w);const I={};m&32&&(I.stripe=f[5]),m&131085&&(I.$$scope={dirty:m,ctx:f}),!o&&m&16&&(o=!0,I.elements=f[4],zn(()=>o=!1)),i.$set(I)},i(f){s||(d(e.$$.fragment,f),d(i.$$.fragment,f),s=!0)},o(f){p(e.$$.fragment,f),p(i.$$.fragment,f),s=!1},d(f){f&&(_(r),_(n)),P(e,f),P(i),l=!1,a()}}}function Io(t){let e,r,n,i,o,s,l;return r=new io({}),s=new st({}),s.$on("click",function(){ne(t[1])&&t[1].apply(this,arguments)}),{c(){e=v("div"),T(r.$$.fragment),n=S(),i=v("div"),i.textContent="Secure Checkout",o=S(),T(s.$$.fragment),fe(i,"margin-left","10px"),fe(e,"display","flex"),fe(e,"align-items","center"),fe(e,"justify-content","baseline")},m(a,c){g(a,e,c),k(r,e,null),L(e,n),L(e,i),g(a,o,c),k(s,a,c),l=!0},p(a,c){t=a},i(a){l||(d(r.$$.fragment,a),d(s.$$.fragment,a),l=!0)},o(a){p(r.$$.fragment,a),p(s.$$.fragment,a),l=!1},d(a){a&&(_(e),_(o)),P(r),P(s,a)}}}function $o(t){let e,r,n;return r=new ji({}),{c(){e=v("div"),T(r.$$.fragment),b(e,"class","rcb-stripe-elements-container svelte-8jsoa8")},m(i,o){g(i,e,o),k(r,e,null),n=!0},p:h,i(i){n||(d(r.$$.fragment,i),n=!0)},o(i){p(r.$$.fragment,i),n=!1},d(i){i&&_(e),P(r)}}}function ko(t){let e;return{c(){e=V("Pay")},m(r,n){g(r,e,n)},i:h,o:h,d(r){r&&_(e)}}}function Po(t){let e;return{c(){e=V("Start Trial")},m(r,n){g(r,e,n)},i:h,o:h,d(r){r&&_(e)}}}function To(t){let e,r;return e=new Vt({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Ao(t){let e,r,n,i;const o=[To,Po,ko],s=[];function l(a,c){var u,f;return a[0]?0:(f=(u=a[2].subscriptionOptions)==null?void 0:u[a[3].id])!=null&&f.trial?1:2}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ae()},m(a,c){s[e].m(a,c),g(a,n,c),i=!0},p(a,c){let u=e;e=l(a),e!==u&&(Q(),p(s[u],1,1,()=>{s[u]=null}),X(),r=s[e],r||(r=s[e]=o[e](a),r.c()),d(r,1),r.m(n.parentNode,n))},i(a){i||(d(r),i=!0)},o(a){p(r),i=!1},d(a){a&&_(n),s[e].d(a)}}}function Oo(t){let e,r;return e=new it({props:{disabled:t[0],testId:"PayButton",$$slots:{default:[Ao]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.disabled=n[0]),i&131085&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function No(t){let e,r;return e=new Re({props:{$$slots:{default:[Oo]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&131085&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Uo(t){let e,r,n,i;return e=new Ee({props:{$$slots:{default:[$o]},$$scope:{ctx:t}}}),n=new ot({props:{$$slots:{default:[No]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment),r=S(),T(n.$$.fragment)},m(o,s){k(e,o,s),g(o,r,s),k(n,o,s),i=!0},p(o,s){const l={};s&131072&&(l.$$scope={dirty:s,ctx:o}),e.$set(l);const a={};s&131085&&(a.$$scope={dirty:s,ctx:o}),n.$set(a)},i(o){i||(d(e.$$.fragment,o),d(n.$$.fragment,o),i=!0)},o(o){p(e.$$.fragment,o),p(n.$$.fragment,o),i=!1},d(o){o&&_(r),P(e,o),P(n,o)}}}function Ro(t){let e,r,n,i;const o=[vo,Eo],s=[];function l(a,c){return a[5]&&a[6]?0:1}return r=l(t),n=s[r]=o[r](t),{c(){e=v("div"),n.c()},m(a,c){g(a,e,c),s[r].m(e,null),i=!0},p(a,[c]){let u=r;r=l(a),r===u?s[r].p(a,c):(Q(),p(s[u],1,1,()=>{s[u]=null}),X(),n=s[r],n?n.p(a,c):(n=s[r]=o[r](a),n.c()),d(n,1),n.m(e,null))},i(a){i||(d(n),i=!0)},o(a){p(n),i=!1},d(a){a&&_(e),s[r].d()}}}function Lo(t,e,r){let{onClose:n}=e,{onContinue:i}=e,{onError:o}=e,{paymentInfoCollectionMetadata:s}=e,{processing:l=!1}=e,{productDetails:a}=e,{purchaseOptionToUse:c}=e,{brandingInfo:u}=e;const f=s.data.client_secret;let m=null,w,I;Ce(async()=>{const U=s.data.publishable_api_key,x=s.data.stripe_account_id;if(!U||!x)throw new Error("Stripe publishable key or account ID not found");r(5,m=await Qi(U,{stripeAccount:x}))});const O=async()=>{if(l||!m||!I)return;r(0,l=!0);const U=await m.confirmSetup({elements:I,redirect:"if_required"});U.error?(r(0,l=!1),o(new J(te.StripeError,U.error.message))):i()},y=new ct(u==null?void 0:u.appearance);let N=y.shape,ie=y.formColors;function $(U){w=U,r(4,w)}return t.$$set=U=>{"onClose"in U&&r(1,n=U.onClose),"onContinue"in U&&r(10,i=U.onContinue),"onError"in U&&r(11,o=U.onError),"paymentInfoCollectionMetadata"in U&&r(12,s=U.paymentInfoCollectionMetadata),"processing"in U&&r(0,l=U.processing),"productDetails"in U&&r(2,a=U.productDetails),"purchaseOptionToUse"in U&&r(3,c=U.purchaseOptionToUse),"brandingInfo"in U&&r(13,u=U.brandingInfo)},t.$$.update=()=>{t.$$.dirty&16&&w&&w._elements.length>0&&(I=w)},[l,n,a,c,w,m,f,O,N,ie,i,o,s,u,$]}class So extends j{constructor(e){super(),C(this,e,Lo,Ro,A,{onClose:1,onContinue:10,onError:11,paymentInfoCollectionMetadata:12,processing:0,productDetails:2,purchaseOptionToUse:3,brandingInfo:13},yo)}}function Mo(t){return t.trim()===""?"You need to provide your email address to continue.":t.match(/^[^@]+@[^@]+\.[^@]+$/)?null:"Email is not valid. Please provide a valid email address."}function Do(t){if(t&&!t.match(/^[A-Z]{3}$/)){const e=`Currency code ${t} is not valid. Please provide a valid ISO 4217 currency code.`;throw q.errorLog(e),new Z(ee.ConfigurationError,e)}}function Bo(t){R(t,"svelte-yf01ty",".container.svelte-yf01ty.svelte-yf01ty{display:flex;flex-direction:column;flex-grow:1}form.svelte-yf01ty.svelte-yf01ty{display:flex;flex-direction:column;min-height:100%;flex-grow:1}.form-container.svelte-yf01ty.svelte-yf01ty{display:flex;flex-direction:column;width:100%;margin-top:32px;margin-bottom:16px}.form-label.svelte-yf01ty.svelte-yf01ty{margin-top:8px;margin-bottom:8px;display:block;font-weight:500;line-height:22px}.form-input.error.svelte-yf01ty input.svelte-yf01ty{border-color:var(--rc-color-error)}.form-error.svelte-yf01ty.svelte-yf01ty{margin-top:4px;font-size:16px;line-height:20px;min-height:40px;color:var(--rc-color-error)}input.svelte-yf01ty.svelte-yf01ty{width:100%;box-sizing:border-box;padding:8px;border:2px solid var(--rc-color-grey-ui-dark);border-radius:var(--rc-shape-input-border-radius);font-size:16px;height:48px;padding:6px 14px;background:var(--rc-color-input-background);color:inherit}input.svelte-yf01ty.svelte-yf01ty:focus{outline:none;border:2px solid var(--rc-color-focus)}")}function Co(t){let e,r,n,i;return n=new st({}),n.$on("click",function(){ne(t[0])&&t[0].apply(this,arguments)}),{c(){e=v("span"),e.textContent="Billing email address",r=S(),T(n.$$.fragment)},m(o,s){g(o,e,s),g(o,r,s),k(n,o,s),i=!0},p(o,s){t=o},i(o){i||(d(n.$$.fragment,o),i=!0)},o(o){p(n.$$.fragment,o),i=!1},d(o){o&&(_(e),_(r)),P(n,o)}}}function en(t){let e,r;return{c(){e=v("div"),r=V(t[2]),b(e,"class","form-error svelte-yf01ty")},m(n,i){g(n,e,i),L(e,r)},p(n,i){i&4&&ue(r,n[2])},d(n){n&&_(e)}}}function jo(t){let e,r,n,i,o,s,l,a,c,u=t[2]&&en(t);return{c(){e=v("div"),r=v("div"),r.innerHTML='<label for="email">Email</label>',n=S(),i=v("div"),o=v("input"),l=S(),u&&u.c(),b(r,"class","form-label svelte-yf01ty"),b(o,"name","email"),b(o,"placeholder","john@appleseed.com"),b(o,"autocapitalize","off"),b(o,"class","svelte-yf01ty"),b(i,"class",s="form-input "+t[4]+" svelte-yf01ty"),b(e,"class","form-container svelte-yf01ty")},m(f,m){g(f,e,m),L(e,r),L(e,n),L(e,i),L(i,o),yt(o,t[3]),L(e,l),u&&u.m(e,null),a||(c=Pe(o,"input",t[8]),a=!0)},p(f,m){m&8&&o.value!==f[3]&&yt(o,f[3]),m&16&&s!==(s="form-input "+f[4]+" svelte-yf01ty")&&b(i,"class",s),f[2]?u?u.p(f,m):(u=en(f),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},d(f){f&&_(e),u&&u.d(),a=!1,c()}}}function Fo(t){let e;return{c(){e=V("Continue")},m(r,n){g(r,e,n)},i:h,o:h,d(r){r&&_(e)}}}function Ho(t){let e,r;return e=new Vt({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function qo(t){let e,r,n,i;const o=[Ho,Fo],s=[];function l(a,c){return a[1]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ae()},m(a,c){s[e].m(a,c),g(a,n,c),i=!0},p(a,c){let u=e;e=l(a),e!==u&&(Q(),p(s[u],1,1,()=>{s[u]=null}),X(),r=s[e],r||(r=s[e]=o[e](a),r.c()),d(r,1),r.m(n.parentNode,n))},i(a){i||(d(r),i=!0)},o(a){p(r),i=!1},d(a){a&&_(n),s[e].d(a)}}}function xo(t){let e,r;return e=new it({props:{disabled:t[1],type:"submit",$$slots:{default:[qo]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&2&&(o.disabled=n[1]),i&514&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Go(t){let e,r;return e=new Re({props:{$$slots:{default:[xo]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&514&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Vo(t){let e,r,n,i,o,s,l,a,c,u;return r=new lt({props:{$$slots:{default:[Co]},$$scope:{ctx:t}}}),o=new Ee({props:{$$slots:{default:[jo]},$$scope:{ctx:t}}}),l=new ot({props:{$$slots:{default:[Go]},$$scope:{ctx:t}}}),{c(){e=v("div"),T(r.$$.fragment),n=S(),i=v("form"),T(o.$$.fragment),s=S(),T(l.$$.fragment),b(i,"class","svelte-yf01ty"),b(e,"class","container svelte-yf01ty")},m(f,m){g(f,e,m),k(r,e,null),L(e,n),L(e,i),k(o,i,null),L(i,s),k(l,i,null),a=!0,c||(u=Pe(i,"submit",wt(t[5])),c=!0)},p(f,[m]){const w={};m&513&&(w.$$scope={dirty:m,ctx:f}),r.$set(w);const I={};m&540&&(I.$$scope={dirty:m,ctx:f}),o.$set(I);const O={};m&514&&(O.$$scope={dirty:m,ctx:f}),l.$set(O)},i(f){a||(d(r.$$.fragment,f),d(o.$$.fragment,f),d(l.$$.fragment,f),a=!0)},o(f){p(r.$$.fragment,f),p(o.$$.fragment,f),p(l.$$.fragment,f),a=!1},d(f){f&&_(e),P(r),P(o),P(l),c=!1,u()}}}function Yo(t,e,r){let n,i,o,{onContinue:s}=e,{onClose:l}=e,{processing:a}=e,{lastError:c}=e;const u=async()=>{const m=Mo(n);m?r(2,i=m):s({email:n})};Hn(async()=>{r(2,i=(c==null?void 0:c.message)??"")});function f(){n=this.value,r(3,n)}return t.$$set=m=>{"onContinue"in m&&r(6,s=m.onContinue),"onClose"in m&&r(0,l=m.onClose),"processing"in m&&r(1,a=m.processing),"lastError"in m&&r(7,c=m.lastError)},t.$$.update=()=>{t.$$.dirty&4&&r(4,o=i?"error":"")},r(3,n=""),r(2,i=""),[l,a,i,n,o,u,s,c,f]}class zo extends j{constructor(e){super(),C(this,e,Yo,Vo,A,{onContinue:6,onClose:0,processing:1,lastError:7},Bo)}}function Wo(t){R(t,"svelte-17tslso",".rcb-modal-backdrop.svelte-17tslso{position:fixed;top:0;left:0;right:0;min-width:100%;width:100vw;width:100dvw;min-height:100%;height:100vh;height:100dvh;background-color:rgba(40, 40, 40, 0.75);display:flex;flex-direction:column;justify-content:space-around;z-index:1000001}")}function Ko(t){let e,r;const n=t[1].default,i=H(n,t,t[0],null);return{c(){e=v("div"),i&&i.c(),b(e,"class","rcb-modal-backdrop svelte-17tslso")},m(o,s){g(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&1)&&W(i,n,o,o[0],r?z(n,o[0],s,null):K(o[0]),null)},i(o){r||(d(i,o),r=!0)},o(o){p(i,o),r=!1},d(o){o&&_(e),i&&i.d(o)}}}function Qo(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}class Xo extends j{constructor(e){super(),C(this,e,Qo,Ko,A,{},Wo)}}function Zo(t){R(t,"svelte-1fufj5b",".rcb-modal-container.svelte-1fufj5b{width:100%}.rcb-modal-main.svelte-1fufj5b{box-sizing:border-box;border-radius:var(--rc-shape-modal-border-radius);background-color:var(--rc-color-background);color:var(--rc-color-grey-text-dark);padding:40px;flex-direction:column;display:flex}@media screen and (max-width: 960px){.rcb-modal-container.svelte-1fufj5b{width:calc(100% - 32px);min-width:300px;max-width:640px;margin:auto}.rcb-modal-main.svelte-1fufj5b{min-width:300px;max-width:640px;padding:32px}}")}function Jo(t){let e,r,n;const i=t[2].default,o=H(i,t,t[1],null);return{c(){e=v("div"),r=v("main"),o&&o.c(),b(r,"class","rcb-modal-main svelte-1fufj5b"),b(r,"style",t[0]),b(e,"class","rcb-modal-container svelte-1fufj5b")},m(s,l){g(s,e,l),L(e,r),o&&o.m(r,null),n=!0},p(s,[l]){o&&o.p&&(!n||l&2)&&W(o,i,s,s[1],n?z(i,s[1],l,null):K(s[1]),null),(!n||l&1)&&b(r,"style",s[0])},i(s){n||(d(o,s),n=!0)},o(s){p(o,s),n=!1},d(s){s&&_(e),o&&o.d(s)}}}function es(t,e,r){let{$$slots:n={},$$scope:i}=e,{style:o=""}=e;return t.$$set=s=>{"style"in s&&r(0,o=s.style),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class tn extends j{constructor(e){super(),C(this,e,es,Jo,A,{style:0},Zo)}}function ts(t){let e;const r=t[1].default,n=H(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&W(n,r,i,i[2],e?z(r,i[2],o,null):K(i[2]),null)},i(i){e||(d(n,i),e=!0)},o(i){p(n,i),e=!1},d(i){n&&n.d(i)}}}function ns(t){let e,r;return e=new Xo({props:{$$slots:{default:[rs]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function rs(t){let e;const r=t[1].default,n=H(r,t,t[2],null);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&4)&&W(n,r,i,i[2],e?z(r,i[2],o,null):K(i[2]),null)},i(i){e||(d(n,i),e=!0)},o(i){p(n,i),e=!1},d(i){n&&n.d(i)}}}function is(t){let e,r,n,i;const o=[ns,ts],s=[];function l(a,c){return a[0]?0:1}return e=l(t),r=s[e]=o[e](t),{c(){r.c(),n=ae()},m(a,c){s[e].m(a,c),g(a,n,c),i=!0},p(a,[c]){let u=e;e=l(a),e===u?s[e].p(a,c):(Q(),p(s[u],1,1,()=>{s[u]=null}),X(),r=s[e],r?r.p(a,c):(r=s[e]=o[e](a),r.c()),d(r,1),r.m(n.parentNode,n))},i(a){i||(d(r),i=!0)},o(a){p(r),i=!1},d(a){a&&_(n),s[e].d(a)}}}function os(t,e,r){let{$$slots:n={},$$scope:i}=e,{condition:o=!1}=e;return t.$$set=s=>{"condition"in s&&r(0,o=s.condition),"$$scope"in s&&r(2,i=s.$$scope)},[o,n,i]}class ss extends j{constructor(e){super(),C(this,e,os,is,A,{condition:0})}}const ls=`<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"
22
22
  xmlns="http://www.w3.org/2000/svg">
23
23
  <g opacity="0.5" clip-path="url(#clip0_344_3390)">
24
24
  <path d="M7 18C5.9 18 5.01 18.9 5.01 20C5.01 21.1 5.9 22 7 22C8.1 22 9 21.1 9 20C9 18.9 8.1 18 7 18ZM1 2V4H3L6.6 11.59L5.25 14.04C5.09 14.32 5 14.65 5 15C5 16.1 5.9 17 7 17H19V15H7.42C7.28 15 7.17 14.89 7.17 14.75L7.2 14.63L8.1 13H15.55C16.3 13 16.96 12.59 17.3 11.97L20.88 5.48C20.96 5.34 21 5.17 21 5C21 4.45 20.55 4 20 4H5.21L4.27 2H1ZM17 18C15.9 18 15.01 18.9 15.01 20C15.01 21.1 15.9 22 17 22C18.1 22 19 21.1 19 20C19 18.9 18.1 18 17 18Z"
@@ -31,6 +31,6 @@
31
31
  </defs>
32
32
  </svg>
33
33
  `;function as(t){let e;return{c(){e=v("div"),fe(e,"color","var(--rc-color-gray-text-dark)")},m(r,n){g(r,e,n),e.innerHTML=ls},p:h,i:h,o:h,d(r){r&&_(e)}}}class cs extends j{constructor(e){super(),C(this,e,null,as,A,{})}}function us(t){R(t,"svelte-1ny4y2s","div.svelte-1ny4y2s{background-color:var(--rc-color-warning);color:rgba(0,0,0,1);font-size:10px;font-weight:bold;text-transform:uppercase;padding:4px 10px;line-height:10px;border-radius:9px;margin:0px;margin-left:16px}")}function fs(t){let e;return{c(){e=v("div"),e.textContent="Sandbox",b(e,"class","svelte-1ny4y2s")},m(r,n){g(r,e,n)},p:h,i:h,o:h,d(r){r&&_(e)}}}class ds extends j{constructor(e){super(),C(this,e,null,fs,A,{},us)}}function ps(t){R(t,"svelte-1iuls9l",".rcb-ui-layout.svelte-1iuls9l{width:100vw;margin-right:auto;display:flex;justify-content:center;align-items:flex-start;position:relative;padding:0px 80px;box-sizing:border-box}@media screen and (max-width: 960px){.rcb-ui-layout.svelte-1iuls9l{flex-direction:column;align-items:center;justify-content:center;height:100%;min-width:100%}}@media screen and (max-width: 960px) and (max-height: 960px){.rcb-ui-layout.svelte-1iuls9l{overflow-y:scroll;justify-content:flex-start;padding:16px 0}}")}function ms(t){let e,r;const n=t[2].default,i=H(n,t,t[1],null);return{c(){e=v("div"),i&&i.c(),b(e,"class","rcb-ui-layout svelte-1iuls9l"),b(e,"style",t[0])},m(o,s){g(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&2)&&W(i,n,o,o[1],r?z(n,o[1],s,null):K(o[1]),null),(!r||s&1)&&b(e,"style",o[0])},i(o){r||(d(i,o),r=!0)},o(o){p(i,o),r=!1},d(o){o&&_(e),i&&i.d(o)}}}function _s(t,e,r){let{$$slots:n={},$$scope:i}=e,{style:o=""}=e;return t.$$set=s=>{"style"in s&&r(0,o=s.style),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class gs extends j{constructor(e){super(),C(this,e,_s,ms,A,{style:0},ps)}}function hs(t){R(t,"svelte-1sfb5if",`.rcb-ui-container.svelte-1sfb5if{color-scheme:none;font-size:16px;line-height:1.5em;font-weight:400;font-family:-apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu,
34
- Cantarell, "Open Sans", "Helvetica Neue", sans-serif}`)}function bs(t){let e,r;const n=t[2].default,i=H(n,t,t[1],null);return{c(){e=v("div"),i&&i.c(),b(e,"class","rcb-ui-container svelte-1sfb5if"),b(e,"style",t[0])},m(o,s){g(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&2)&&W(i,n,o,o[1],r?z(n,o[1],s,null):K(o[1]),null),(!r||s&1)&&b(e,"style",o[0])},i(o){r||(d(i,o),r=!0)},o(o){p(i,o),r=!1},d(o){o&&_(e),i&&i.d(o)}}}function ws(t,e,r){let{$$slots:n={},$$scope:i}=e,{style:o=""}=e;return t.$$set=s=>{"style"in s&&r(0,o=s.style),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class ys extends j{constructor(e){super(),C(this,e,ws,bs,A,{style:0},hs)}}function Es(t){R(t,"svelte-17dr902",".rcb-ui-aside.svelte-17dr902{margin-right:16px;flex:320px 1 0;max-width:480px}@media screen and (max-width: 960px){.rcb-ui-aside.svelte-17dr902{margin-right:0;margin-bottom:16px;min-width:100%;display:flex;flex-direction:column;align-items:center;flex:none;max-width:none}}")}const vs=t=>({}),nn=t=>({});function Is(t){let e,r;const n=t[2].header,i=H(n,t,t[3],nn),o=t[2].default,s=H(o,t,t[3],null);return{c(){i&&i.c(),e=S(),s&&s.c()},m(l,a){i&&i.m(l,a),g(l,e,a),s&&s.m(l,a),r=!0},p(l,a){i&&i.p&&(!r||a&8)&&W(i,n,l,l[3],r?z(n,l[3],a,vs):K(l[3]),nn),s&&s.p&&(!r||a&8)&&W(s,o,l,l[3],r?z(o,l[3],a,null):K(l[3]),null)},i(l){r||(d(i,l),d(s,l),r=!0)},o(l){p(i,l),p(s,l),r=!1},d(l){l&&_(e),i&&i.d(l),s&&s.d(l)}}}function $s(t){let e,r,n;return r=new tn({props:{$$slots:{default:[Is]},$$scope:{ctx:t}}}),{c(){e=v("div"),T(r.$$.fragment),b(e,"class","rcb-ui-aside svelte-17dr902"),b(e,"style",t[0])},m(i,o){g(i,e,o),k(r,e,null),n=!0},p(i,[o]){const s={};o&8&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(d(r.$$.fragment,i),n=!0)},o(i){p(r.$$.fragment,i),n=!1},d(i){i&&_(e),P(r)}}}function ks(t,e,r){let{$$slots:n={},$$scope:i}=e,{brandingAppearance:o=void 0}=e,s=new ct(o).productInfoStyleVars;return t.$$set=l=>{"brandingAppearance"in l&&r(1,o=l.brandingAppearance),"$$scope"in l&&r(3,i=l.$$scope)},[s,o,n,i]}class Ps extends j{constructor(e){super(),C(this,e,ks,$s,A,{brandingAppearance:1},Es)}}function Ts(t){R(t,"svelte-vpgys",".rcb-ui-main.svelte-vpgys{flex:480px 1 0;max-width:640px}@media screen and (max-width: 960px){.rcb-ui-main.svelte-vpgys{flex:none;max-width:none;min-width:100%}}")}const As=t=>({}),rn=t=>({});function Os(t){let e,r;const n=t[2].header,i=H(n,t,t[3],rn),o=t[2].default,s=H(o,t,t[3],null);return{c(){i&&i.c(),e=S(),s&&s.c()},m(l,a){i&&i.m(l,a),g(l,e,a),s&&s.m(l,a),r=!0},p(l,a){i&&i.p&&(!r||a&8)&&W(i,n,l,l[3],r?z(n,l[3],a,As):K(l[3]),rn),s&&s.p&&(!r||a&8)&&W(s,o,l,l[3],r?z(o,l[3],a,null):K(l[3]),null)},i(l){r||(d(i,l),d(s,l),r=!0)},o(l){p(i,l),p(s,l),r=!1},d(l){l&&_(e),i&&i.d(l),s&&s.d(l)}}}function Ns(t){let e,r,n;return r=new tn({props:{style:"min-height: 360px;",$$slots:{default:[Os]},$$scope:{ctx:t}}}),{c(){e=v("div"),T(r.$$.fragment),b(e,"class","rcb-ui-main svelte-vpgys"),b(e,"style",t[0])},m(i,o){g(i,e,o),k(r,e,null),n=!0},p(i,[o]){const s={};o&8&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(d(r.$$.fragment,i),n=!0)},o(i){p(r.$$.fragment,i),n=!1},d(i){i&&_(e),P(r)}}}function Us(t,e,r){let{$$slots:n={},$$scope:i}=e,{brandingAppearance:o=void 0}=e,s=new ct(o).formStyleVars;return t.$$set=l=>{"brandingAppearance"in l&&r(1,o=l.brandingAppearance),"$$scope"in l&&r(3,i=l.$$scope)},[s,o,n,i]}class Rs extends j{constructor(e){super(),C(this,e,Us,Ns,A,{brandingAppearance:1},Ts)}}function on(t){var n;let e,r;return e=new Ps({props:{brandingAppearance:(n=t[1])==null?void 0:n.appearance,$$slots:{header:[Bs],default:[Ls]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(i,o){k(e,i,o),r=!0},p(i,o){var l;const s={};o&2&&(s.brandingAppearance=(l=i[1])==null?void 0:l.appearance),o&33554454&&(s.$$scope={dirty:o,ctx:i}),e.$set(s)},i(i){r||(d(e.$$.fragment,i),r=!0)},o(i){p(e.$$.fragment,i),r=!1},d(i){P(e,i)}}}function sn(t){var n;let e,r;return e=new Nt({props:{productDetails:t[4],brandingAppearance:(n=t[1])==null?void 0:n.appearance,purchaseOption:t[8]}}),{c(){T(e.$$.fragment)},m(i,o){k(e,i,o),r=!0},p(i,o){var l;const s={};o&16&&(s.productDetails=i[4]),o&2&&(s.brandingAppearance=(l=i[1])==null?void 0:l.appearance),e.$set(s)},i(i){r||(d(e.$$.fragment,i),r=!0)},o(i){p(e.$$.fragment,i),r=!1},d(i){P(e,i)}}}function Ls(t){let e,r,n=t[4]&&t[8]&&sn(t);return{c(){n&&n.c(),e=ae()},m(i,o){n&&n.m(i,o),g(i,e,o),r=!0},p(i,o){i[4]&&i[8]?n?(n.p(i,o),o&16&&d(n,1)):(n=sn(i),n.c(),d(n,1),n.m(e.parentNode,e)):n&&(Q(),p(n,1,1,()=>{n=null}),X())},i(i){r||(d(n),r=!0)},o(i){p(n),r=!1},d(i){i&&_(e),n&&n.d(i)}}}function Ss(t){let e,r;return e=new cs({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Ms(t){let e,r;return e=new ds({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Ds(t){let e,r,n,i,o,s,l;e=new Mt({props:{brandingInfo:t[1]}});const a=[Ms,Ss],c=[];function u(f,m){return m&4&&(n=null),n==null&&(n=!!f[2].isSandbox()),n?0:1}return i=u(t,-1),o=c[i]=a[i](t),{c(){T(e.$$.fragment),r=S(),o.c(),s=ae()},m(f,m){k(e,f,m),g(f,r,m),c[i].m(f,m),g(f,s,m),l=!0},p(f,m){const w={};m&2&&(w.brandingInfo=f[1]),e.$set(w);let I=i;i=u(f,m),i!==I&&(Q(),p(c[I],1,1,()=>{c[I]=null}),X(),o=c[i],o||(o=c[i]=a[i](f),o.c()),d(o,1),o.m(s.parentNode,s))},i(f){l||(d(e.$$.fragment,f),d(o),l=!0)},o(f){p(e.$$.fragment,f),p(o),l=!1},d(f){f&&(_(r),_(s)),P(e,f),c[i].d(f)}}}function Bs(t){let e,r;return e=new lt({props:{slot:"header",$$slots:{default:[Ds]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&33554438&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function ln(t){let e,r;return e=new Nt({props:{productDetails:t[4],purchaseOption:t[8]}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.productDetails=n[4]),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function an(t){let e,r;return e=new rt({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function cn(t){let e,r;return e=new zo({props:{onContinue:t[11],onClose:t[10],processing:t[7]==="processing-auth-info",lastError:t[6]}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&128&&(o.processing=n[7]==="processing-auth-info"),i&64&&(o.lastError=n[6]),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function un(t){let e,r;return e=new So({props:{paymentInfoCollectionMetadata:t[5],onContinue:t[11],onClose:t[10],onError:t[12],processing:t[7]==="polling-purchase-status",productDetails:t[4],purchaseOptionToUse:t[8],brandingInfo:t[1]}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&32&&(o.paymentInfoCollectionMetadata=n[5]),i&128&&(o.processing=n[7]==="polling-purchase-status"),i&16&&(o.productDetails=n[4]),i&2&&(o.brandingInfo=n[1]),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function fn(t){let e,r;return e=new rt({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function dn(t){var n;let e,r;return e=new Ii({props:{brandingInfo:t[1],lastError:t[6]??new J(te.UnknownError,"Unknown error without state set."),supportEmail:(n=t[1])==null?void 0:n.seller_company_support_email,productDetails:t[4],onContinue:t[13]}}),{c(){T(e.$$.fragment)},m(i,o){k(e,i,o),r=!0},p(i,o){var l;const s={};o&2&&(s.brandingInfo=i[1]),o&64&&(s.lastError=i[6]??new J(te.UnknownError,"Unknown error without state set.")),o&2&&(s.supportEmail=(l=i[1])==null?void 0:l.seller_company_support_email),o&16&&(s.productDetails=i[4]),e.$set(s)},i(i){r||(d(e.$$.fragment,i),r=!0)},o(i){p(e.$$.fragment,i),r=!1},d(i){P(e,i)}}}function pn(t){let e,r;return e=new Li({props:{productDetails:t[4],brandingInfo:t[1],onContinue:t[11]}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.productDetails=n[4]),i&2&&(o.brandingInfo=n[1]),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Cs(t){let e,r,n,i,o,s,l,a,c=t[7]==="present-offer"&&t[4]&&t[8]&&ln(t),u=t[7]==="present-offer"&&!t[4]&&an(),f=(t[7]==="needs-auth-info"||t[7]==="processing-auth-info")&&cn(t),m=t[5]&&(t[7]==="needs-payment-info"||t[7]==="polling-purchase-status")&&t[4]&&t[8]&&un(t),w=t[7]==="loading"&&fn(),I=t[7]==="error"&&dn(t),O=t[7]==="success"&&pn(t);return{c(){c&&c.c(),e=S(),u&&u.c(),r=S(),f&&f.c(),n=S(),m&&m.c(),i=S(),w&&w.c(),o=S(),I&&I.c(),s=S(),O&&O.c(),l=ae()},m(y,N){c&&c.m(y,N),g(y,e,N),u&&u.m(y,N),g(y,r,N),f&&f.m(y,N),g(y,n,N),m&&m.m(y,N),g(y,i,N),w&&w.m(y,N),g(y,o,N),I&&I.m(y,N),g(y,s,N),O&&O.m(y,N),g(y,l,N),a=!0},p(y,N){y[7]==="present-offer"&&y[4]&&y[8]?c?(c.p(y,N),N&144&&d(c,1)):(c=ln(y),c.c(),d(c,1),c.m(e.parentNode,e)):c&&(Q(),p(c,1,1,()=>{c=null}),X()),y[7]==="present-offer"&&!y[4]?u?N&144&&d(u,1):(u=an(),u.c(),d(u,1),u.m(r.parentNode,r)):u&&(Q(),p(u,1,1,()=>{u=null}),X()),y[7]==="needs-auth-info"||y[7]==="processing-auth-info"?f?(f.p(y,N),N&128&&d(f,1)):(f=cn(y),f.c(),d(f,1),f.m(n.parentNode,n)):f&&(Q(),p(f,1,1,()=>{f=null}),X()),y[5]&&(y[7]==="needs-payment-info"||y[7]==="polling-purchase-status")&&y[4]&&y[8]?m?(m.p(y,N),N&176&&d(m,1)):(m=un(y),m.c(),d(m,1),m.m(i.parentNode,i)):m&&(Q(),p(m,1,1,()=>{m=null}),X()),y[7]==="loading"?w?N&128&&d(w,1):(w=fn(),w.c(),d(w,1),w.m(o.parentNode,o)):w&&(Q(),p(w,1,1,()=>{w=null}),X()),y[7]==="error"?I?(I.p(y,N),N&128&&d(I,1)):(I=dn(y),I.c(),d(I,1),I.m(s.parentNode,s)):I&&(Q(),p(I,1,1,()=>{I=null}),X()),y[7]==="success"?O?(O.p(y,N),N&128&&d(O,1)):(O=pn(y),O.c(),d(O,1),O.m(l.parentNode,l)):O&&(Q(),p(O,1,1,()=>{O=null}),X())},i(y){a||(d(c),d(u),d(f),d(m),d(w),d(I),d(O),a=!0)},o(y){p(c),p(u),p(f),p(m),p(w),p(I),p(O),a=!1},d(y){y&&(_(e),_(r),_(n),_(i),_(o),_(s),_(l)),c&&c.d(y),u&&u.d(y),f&&f.d(y),m&&m.d(y),w&&w.d(y),I&&I.d(y),O&&O.d(y)}}}function js(t){var s;let e=t[9].includes(t[7]),r,n,i,o=e&&on(t);return n=new Rs({props:{brandingAppearance:(s=t[1])==null?void 0:s.appearance,$$slots:{default:[Cs]},$$scope:{ctx:t}}}),{c(){o&&o.c(),r=S(),T(n.$$.fragment)},m(l,a){o&&o.m(l,a),g(l,r,a),k(n,l,a),i=!0},p(l,a){var u;a&128&&(e=l[9].includes(l[7])),e?o?(o.p(l,a),a&128&&d(o,1)):(o=on(l),o.c(),d(o,1),o.m(r.parentNode,r)):o&&(Q(),p(o,1,1,()=>{o=null}),X());const c={};a&2&&(c.brandingAppearance=(u=l[1])==null?void 0:u.appearance),a&33554674&&(c.$$scope={dirty:a,ctx:l}),n.$set(c)},i(l){i||(d(o),d(n.$$.fragment,l),i=!0)},o(l){p(o),p(n.$$.fragment,l),i=!1},d(l){l&&_(r),o&&o.d(l),P(n,l)}}}function Fs(t){let e,r;return e=new gs({props:{style:t[3],$$slots:{default:[js]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.style=n[3]),i&33554678&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Hs(t){let e,r;return e=new ss({props:{condition:t[0],$$slots:{default:[Fs]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.condition=n[0]),i&33554686&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function qs(t){let e,r;return e=new ys({props:{$$slots:{default:[Hs]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,[i]){const o={};i&33554687&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function xs(t,e,r){let{asModal:n=!0}=e,{customerEmail:i}=e,{appUserId:o}=e,{rcPackage:s}=e,{purchaseOption:l}=e,{brandingInfo:a}=e,{onFinished:c}=e,{onError:u}=e,{onClose:f}=e,{purchases:m}=e,{purchaseOperationHelper:w}=e,I="",O=null,y=null,N=null;const ie=s.rcBillingProduct.identifier??null,$=s.rcBillingProduct.defaultPurchaseOption,U=l||$;let x="present-offer";const Ke=["present-offer","needs-auth-info","processing-auth-info","needs-payment-info","polling-purchase-status","loading"];Ce(async()=>{if(r(4,O=s.rcBillingProduct),r(3,I=Jt(a==null?void 0:a.appearance)),x==="present-offer"){i?In():r(7,x="needs-auth-info");return}});const Qe=()=>{f()},In=()=>{if(ie===null){Me(new J(te.ErrorSettingUpPurchase,"Product ID was not set before purchase."));return}else x==="present-offer"&&r(7,x="loading");if(!i){Me(new J(te.MissingEmailError));return}w.startPurchase(o,ie,U,i,s.rcBillingProduct.presentedOfferingContext).then(D=>{if(D.next_action==="collect_payment_info"){r(6,N=null),r(7,x="needs-payment-info"),r(5,y=D);return}if(D.next_action==="completed"){r(6,N=null),r(7,x="success");return}}).catch(D=>{Me(D)})},vl=D=>{if(x==="needs-auth-info"){D&&(r(14,i=D.email),r(7,x="processing-auth-info")),In();return}if(x==="needs-payment-info"){r(7,x="polling-purchase-status"),w.pollCurrentPurchaseForCompletion().then(()=>{r(7,x="success")}).catch($l=>{Me($l)});return}if(x==="success"||x==="error"){c();return}r(7,x="success")},Me=D=>{if(x==="processing-auth-info"&&D.isRecoverable()){r(6,N=D),r(7,x="needs-auth-info");return}r(6,N=D),r(7,x="error")},Il=()=>{u(N??new J(te.UnknownError,"Unknown error without state set."))};return t.$$set=D=>{"asModal"in D&&r(0,n=D.asModal),"customerEmail"in D&&r(14,i=D.customerEmail),"appUserId"in D&&r(15,o=D.appUserId),"rcPackage"in D&&r(16,s=D.rcPackage),"purchaseOption"in D&&r(17,l=D.purchaseOption),"brandingInfo"in D&&r(1,a=D.brandingInfo),"onFinished"in D&&r(18,c=D.onFinished),"onError"in D&&r(19,u=D.onError),"onClose"in D&&r(20,f=D.onClose),"purchases"in D&&r(2,m=D.purchases),"purchaseOperationHelper"in D&&r(21,w=D.purchaseOperationHelper)},[n,a,m,I,O,y,N,x,U,Ke,Qe,vl,Me,Il,i,o,s,l,c,u,f,w]}class Gs extends j{constructor(e){super(),C(this,e,xs,qs,A,{asModal:0,customerEmail:14,appUserId:15,rcPackage:16,purchaseOption:17,brandingInfo:1,onFinished:18,onError:19,onClose:20,purchases:2,purchaseOperationHelper:21})}}function Vs(t){return t.expires_date==null?!0:new Date(t.expires_date)>new Date}function Ys(t,e,r,n){const i=e.product_identifier;if(i in r)return zs(t,e,r[i]);if(i in n)return Ws(t,e,n[i]);throw new Z(ee.CustomerInfoError,"Could not find entitlement product in subscriptions or non-subscriptions.")}function zs(t,e,r){return{identifier:t,isActive:Vs(e),willRenew:Xs(e,r),store:(r==null?void 0:r.store)??"unknown",latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(e.purchase_date),expirationDate:Ye(e.expires_date),productIdentifier:e.product_identifier,unsubscribeDetectedAt:Ye(r==null?void 0:r.unsubscribe_detected_at),billingIssueDetectedAt:Ye(r==null?void 0:r.billing_issues_detected_at),isSandbox:(r==null?void 0:r.is_sandbox)??!1,periodType:(r==null?void 0:r.period_type)??"normal"}}function Ws(t,e,r){return{identifier:t,isActive:!0,willRenew:!1,store:r.store,latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(r.original_purchase_date),expirationDate:null,productIdentifier:e.product_identifier,unsubscribeDetectedAt:null,billingIssueDetectedAt:null,isSandbox:r.is_sandbox,periodType:"normal"}}function Ks(t,e,r){const n={},i={};for(const o in t){const s=Ys(o,t[o],e,r);n[o]=s,s.isActive&&(i[o]=s)}return{all:n,active:i}}function Ye(t){return t==null?null:new Date(t)}function Qs(t){const e=Js(t),r=t.subscriber,n=tl(r.non_subscriptions);return{entitlements:Ks(r.entitlements,r.subscriptions,n),allExpirationDatesByProduct:e,allPurchaseDatesByProduct:Zs(t,n),activeSubscriptions:el(e),managementURL:r.management_url,requestDate:new Date(t.request_date),firstSeenDate:new Date(r.first_seen),originalPurchaseDate:Ye(r.original_purchase_date),originalAppUserId:t.subscriber.original_app_user_id}}function Xs(t,e){if(e==null)return!1;const r=e.store=="promotional",n=t.expires_date==null,i=e.unsubscribe_detected_at!=null,o=e.billing_issues_detected_at!=null;return!(r||n||i||o)}function Zs(t,e){const r={};for(const n in t.subscriber.subscriptions){const i=t.subscriber.subscriptions[n];r[n]=new Date(i.purchase_date)}for(const n in e){const i=e[n].purchase_date;i==null?r[n]=null:r[n]=new Date(i)}return r}function Js(t){const e={};for(const r in t.subscriber.subscriptions){const n=t.subscriber.subscriptions[r];n.expires_date==null?e[r]=null:e[r]=new Date(n.expires_date)}return e}function el(t){const e=new Set,r=new Date;for(const n in t){const i=t[n];(i==null||i>r)&&e.add(n)}return e}function tl(t){const e={};for(const r in t){if(t[r].length===0)continue;const n=t[r].length;e[r]=t[r][n-1]}return e}const nl="0.11.0",rl="https://api.revenuecat.com";var ze;(function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.EARLY_HINTS=103]="EARLY_HINTS",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY=305]="USE_PROXY",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",t[t.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.IM_A_TEAPOT=418]="IM_A_TEAPOT",t[t.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",t[t.METHOD_FAILURE=420]="METHOD_FAILURE",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(ze||(ze={}));function ut(t){return t?t.startsWith("rcb_sb_"):!1}async function Ie(t,e){const{apiKey:r,body:n,headers:i,httpConfig:o}=e,l=`${(o==null?void 0:o.proxyURL)??rl}${t.urlPath()}`;try{const a=await fetch(l,{method:t.method,headers:ll(r,i,o==null?void 0:o.additionalHeaders),body:ol(n)});return await il(a,t),await a.json()}catch(a){throw a instanceof TypeError?new Z(ee.NetworkError,Ne.getPublicMessage(ee.NetworkError),a.message):a}}async function il(t,e){const r=t.status;if(r>=ze.INTERNAL_SERVER_ERROR)ft(e,r,await t.text());else if(r>=ze.BAD_REQUEST){const n=await t.json(),i=n?JSON.stringify(n):null,o=n==null?void 0:n.code,s=n==null?void 0:n.message;if(o!=null){const l=Ne.convertCodeToBackendErrorCode(o);if(l==null)ft(e,r,i,o);else throw Z.getForBackendError(l,s)}else ft(e,r,i)}}function ft(t,e,r,n){throw new Z(ee.UnknownBackendError,"Unknown backend error.",`Request: ${t.name}. Status code: ${e}. Body: ${r}.`,{backendErrorCode:n})}function ol(t){return t==null?null:JSON.stringify(t)}const mn="Authorization",_n="Content-Type",gn="Accept",hn="X-Platform",bn="X-Version",wn="X-Is-Sandbox",sl=new Set([mn,_n,gn,hn,bn,wn]);function ll(t,e,r){let n={[mn]:`Bearer ${t}`,[_n]:"application/json",[gn]:"application/json",[hn]:"web",[bn]:nl,[wn]:`${ut(t)}`};return e&&(n={...n,...e}),r&&(n={...r,...n}),n}const yn="/v1/subscribers",We="/rcbilling/v1";class al{constructor(e){M(this,"appUserId");M(this,"method","GET");M(this,"name","getOfferings");this.appUserId=e}urlPath(){const e=encodeURIComponent(this.appUserId);return`${yn}/${e}/offerings`}}class cl{constructor(){M(this,"method","POST");M(this,"name","purchase")}urlPath(){return`${We}/purchase`}}class ul{constructor(e,r,n){M(this,"method","GET");M(this,"name","getProducts");M(this,"appUserId");M(this,"productIds");M(this,"currency");this.appUserId=e,this.productIds=r,this.currency=n}urlPath(){const e=encodeURIComponent(this.appUserId),r=this.productIds.map(encodeURIComponent).join("&id="),n=this.currency?`&currency=${this.currency}`:"";return`${We}/subscribers/${e}/products?id=${r}${n}`}}class fl{constructor(e){M(this,"method","GET");M(this,"name","getCustomerInfo");M(this,"appUserId");this.appUserId=e}urlPath(){const e=encodeURIComponent(this.appUserId);return`${yn}/${e}`}}class dl{constructor(){M(this,"method","GET");M(this,"name","getBrandingInfo")}urlPath(){return`${We}/branding`}}class pl{constructor(e){M(this,"method","GET");M(this,"name","getCheckoutStatus");M(this,"operationSessionId");this.operationSessionId=e}urlPath(){return`${We}/checkout/${this.operationSessionId}`}}const dt={};class ml{constructor(e,r=dt){M(this,"API_KEY");M(this,"httpConfig");this.API_KEY=e,this.httpConfig=r}async getOfferings(e){return await Ie(new al(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getCustomerInfo(e){return await Ie(new fl(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getProducts(e,r,n){return await Ie(new ul(e,r,n),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getBrandingInfo(){return await Ie(new dl,{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async postPurchase(e,r,n,i,o){const s={app_user_id:e,product_id:r,email:n,price_id:o.priceId,presented_offering_identifier:i.offeringIdentifier};return o.id!=="base_option"&&(s.offer_id=o.id),i.targetingContext&&(s.applied_targeting_rule={rule_id:i.targetingContext.ruleId,revision:i.targetingContext.revision}),i.placementIdentifier&&(s.presented_placement_identifier=i.placementIdentifier),await Ie(new cl,{apiKey:this.API_KEY,body:s,httpConfig:this.httpConfig})}async getCheckoutStatus(e){return await Ie(new pl(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}}function _l(t){if(!/^rcb_[a-zA-Z0-9_.-]+$/.test(t))throw new Z(ee.InvalidCredentialsError,"Invalid API key. Use your RevenueCat Billing API key.")}function gl(t){if(new Set(["no_user","null","none","nil","(null)","NaN","\\x00","","unidentified","undefined","unknown"]).has(t)||t.includes("/"))throw new Z(ee.InvalidAppUserIdError,'Provided user id: "'+t+'" is not valid. See https://www.revenuecat.com/docs/customers/user-ids#tips-for-setting-app-user-ids for more information.')}function hl(t){if(t!=null&&t.endsWith("/"))throw new Z(ee.ConfigurationError,"Invalid proxy URL. The proxy URL should not end with a trailing slash.")}function bl(t){if(t){for(const e in t)if(sl.has(e))throw new Z(ee.ConfigurationError,"Invalid additional headers. Some headers are reserved for internal use.")}}var pt=(t=>(t.Current="current",t))(pt||{});function wl(t,e){async function r(...n){return await this.preload(),await t.call(this,...n)}return r}const En=(t,e)=>({...t,rcBillingProduct:{...t.rcBillingProduct,presentedOfferingContext:{...t.rcBillingProduct.presentedOfferingContext,placementIdentifier:e}}}),_e=(t,e)=>t==null?null:En(t,e),yl=(t,e,r)=>{const n=t.offering_ids_by_placement??null;if(n==null)return null;const i=t.fallback_offering_id??null;let o;if(r in n){const l=n[r]??null;if(l==null)return null;o=e[l],o==null&&(o=e[i])}else o=e[i];if(o==null)return null;const s=Object.fromEntries(Object.entries(o.packagesById).map(([l,a])=>[l,En(a,r)]));return{...o,packagesById:s,availablePackages:Object.values(s),weekly:_e(o.weekly,r),monthly:_e(o.monthly,r),twoMonth:_e(o.twoMonth,r),threeMonth:_e(o.threeMonth,r),sixMonth:_e(o.sixMonth,r),annual:_e(o.annual,r),lifetime:_e(o.lifetime,r)}};function El(t,e){const r={};e.product_details.forEach(o=>{r[o.identifier]=o});const n={};t.offerings.forEach(o=>{const s=o.identifier===t.current_offering_id,l=pr(s,o,r,t.targeting);l!=null&&(n[o.identifier]=l)});const i=t.current_offering_id?n[t.current_offering_id]??null:null;return Object.keys(n).length==0&&q.debugLog("Empty offerings. Please make sure you've configured offerings correctly in the RevenueCat dashboard and that the products are properly configured."),{all:n,current:i}}vn=[wl];const le=class le{constructor(e,r,n=dt){Un(_t,5,this);M(this,"_API_KEY");M(this,"_appUserId");M(this,"_brandingInfo",null);M(this,"_loadingResourcesPromise",null);M(this,"backend");M(this,"purchaseOperationHelper");this._API_KEY=e,this._appUserId=r,ut(e)&&q.debugLog("Initializing Purchases SDK with sandbox API Key"),this.backend=new ml(this._API_KEY,n),this.purchaseOperationHelper=new Nr(this.backend)}static setLogLevel(e){q.setLogLevel(e)}static getSharedInstance(){if(le.isConfigured())return le.instance;throw new Rt}static isConfigured(){return le.instance!==void 0}static configure(e,r,n=dt){return le.instance!==void 0&&q.warnLog("Purchases is already initialized. You normally should only configure Purchases once. Creating and returning new instance."),_l(e),gl(r),hl(n.proxyURL),bl(n.additionalHeaders),le.instance=new le(e,r,n),le.getSharedInstance()}async preload(){if(this.hasLoadedResources()){q.verboseLog("Purchases resources are loaded. Skipping.");return}if(this._loadingResourcesPromise!==null){q.verboseLog("Purchases resources are loading. Waiting."),await this._loadingResourcesPromise;return}return this._loadingResourcesPromise=this.backend.getBrandingInfo().then(e=>{this._brandingInfo=e}).catch(e=>{let r=`${e}`;e instanceof Z&&(r=`${e.message}. ${e.underlyingErrorMessage?`Underlying error: ${e.underlyingErrorMessage}`:""}`),q.errorLog(`Error fetching branding info: ${r}`)}).finally(()=>{this._loadingResourcesPromise=null}),this._loadingResourcesPromise}hasLoadedResources(){return this._brandingInfo!==null}async getOfferings(e){Do(e==null?void 0:e.currency);const r=this._appUserId,n=await this.backend.getOfferings(r),i=(e==null?void 0:e.offeringIdentifier)===pt.Current?n.current_offering_id:e==null?void 0:e.offeringIdentifier;return i&&(n.offerings=n.offerings.filter(o=>o.identifier===i)),await this.getAllOfferings(n,r,e)}async getCurrentOfferingForPlacement(e,r){const n=this._appUserId,i=await this.backend.getOfferings(n),o=await this.getAllOfferings(i,n,r),s=i.placements??null;return s==null?null:yl(s,o.all,e)}async getAllOfferings(e,r,n){const i=e.offerings.flatMap(s=>s.packages).map(s=>s.platform_product_identifier),o=await this.backend.getProducts(r,i,n==null?void 0:n.currency);return this.logMissingProductIds(i,o.product_details),El(e,o)}async isEntitledTo(e){const r=await this.getCustomerInfo();return e in r.entitlements.active}purchasePackage(e,r,n){return this.purchase({rcPackage:e,customerEmail:r,htmlTarget:n})}purchase(e){const{rcPackage:r,purchaseOption:n,htmlTarget:i,customerEmail:o}=e;let s=i??document.getElementById("rcb-ui-root");if(s===null){const u=document.createElement("div");u.className="rcb-ui-root",document.body.appendChild(u),s=u}if(s===null)throw new Error("Could not generate a mount point for the billing widget");const l=s,a=!i,c=this._appUserId;return q.debugLog(`Presenting purchase form for package ${r.identifier}`),new Promise((u,f)=>{new Gs({target:l,props:{appUserId:c,rcPackage:r,purchaseOption:n,customerEmail:o,onFinished:async()=>{q.debugLog("Purchase finished"),l.innerHTML="",u({customerInfo:await this._getCustomerInfoForUserId(c)})},onClose:()=>{l.innerHTML="",q.debugLog("Purchase cancelled by user"),f(new Z(ee.UserCancelledError))},onError:m=>{l.innerHTML="",f(Z.getForPurchasesFlowError(m))},purchases:this,brandingInfo:this._brandingInfo,purchaseOperationHelper:this.purchaseOperationHelper,asModal:a}})})}async getCustomerInfo(){return await this._getCustomerInfoForUserId(this._appUserId)}getAppUserId(){return this._appUserId}async changeUser(e){return this._appUserId=e,await this.getCustomerInfo()}logMissingProductIds(e,r){const n={};r.forEach(o=>n[o.identifier]=o);const i=[];e.forEach(o=>{n[o]===void 0&&i.push(o)}),i.length>0&&q.debugLog(`Could not find product data for product ids:
34
+ Cantarell, "Open Sans", "Helvetica Neue", sans-serif}`)}function bs(t){let e,r;const n=t[2].default,i=H(n,t,t[1],null);return{c(){e=v("div"),i&&i.c(),b(e,"class","rcb-ui-container svelte-1sfb5if"),b(e,"style",t[0])},m(o,s){g(o,e,s),i&&i.m(e,null),r=!0},p(o,[s]){i&&i.p&&(!r||s&2)&&W(i,n,o,o[1],r?z(n,o[1],s,null):K(o[1]),null),(!r||s&1)&&b(e,"style",o[0])},i(o){r||(d(i,o),r=!0)},o(o){p(i,o),r=!1},d(o){o&&_(e),i&&i.d(o)}}}function ws(t,e,r){let{$$slots:n={},$$scope:i}=e,{style:o=""}=e;return t.$$set=s=>{"style"in s&&r(0,o=s.style),"$$scope"in s&&r(1,i=s.$$scope)},[o,i,n]}class ys extends j{constructor(e){super(),C(this,e,ws,bs,A,{style:0},hs)}}function Es(t){R(t,"svelte-17dr902",".rcb-ui-aside.svelte-17dr902{margin-right:16px;flex:320px 1 0;max-width:480px}@media screen and (max-width: 960px){.rcb-ui-aside.svelte-17dr902{margin-right:0;margin-bottom:16px;min-width:100%;display:flex;flex-direction:column;align-items:center;flex:none;max-width:none}}")}const vs=t=>({}),nn=t=>({});function Is(t){let e,r;const n=t[2].header,i=H(n,t,t[3],nn),o=t[2].default,s=H(o,t,t[3],null);return{c(){i&&i.c(),e=S(),s&&s.c()},m(l,a){i&&i.m(l,a),g(l,e,a),s&&s.m(l,a),r=!0},p(l,a){i&&i.p&&(!r||a&8)&&W(i,n,l,l[3],r?z(n,l[3],a,vs):K(l[3]),nn),s&&s.p&&(!r||a&8)&&W(s,o,l,l[3],r?z(o,l[3],a,null):K(l[3]),null)},i(l){r||(d(i,l),d(s,l),r=!0)},o(l){p(i,l),p(s,l),r=!1},d(l){l&&_(e),i&&i.d(l),s&&s.d(l)}}}function $s(t){let e,r,n;return r=new tn({props:{$$slots:{default:[Is]},$$scope:{ctx:t}}}),{c(){e=v("div"),T(r.$$.fragment),b(e,"class","rcb-ui-aside svelte-17dr902"),b(e,"style",t[0])},m(i,o){g(i,e,o),k(r,e,null),n=!0},p(i,[o]){const s={};o&8&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(d(r.$$.fragment,i),n=!0)},o(i){p(r.$$.fragment,i),n=!1},d(i){i&&_(e),P(r)}}}function ks(t,e,r){let{$$slots:n={},$$scope:i}=e,{brandingAppearance:o=void 0}=e,s=new ct(o).productInfoStyleVars;return t.$$set=l=>{"brandingAppearance"in l&&r(1,o=l.brandingAppearance),"$$scope"in l&&r(3,i=l.$$scope)},[s,o,n,i]}class Ps extends j{constructor(e){super(),C(this,e,ks,$s,A,{brandingAppearance:1},Es)}}function Ts(t){R(t,"svelte-vpgys",".rcb-ui-main.svelte-vpgys{flex:480px 1 0;max-width:640px}@media screen and (max-width: 960px){.rcb-ui-main.svelte-vpgys{flex:none;max-width:none;min-width:100%}}")}const As=t=>({}),rn=t=>({});function Os(t){let e,r;const n=t[2].header,i=H(n,t,t[3],rn),o=t[2].default,s=H(o,t,t[3],null);return{c(){i&&i.c(),e=S(),s&&s.c()},m(l,a){i&&i.m(l,a),g(l,e,a),s&&s.m(l,a),r=!0},p(l,a){i&&i.p&&(!r||a&8)&&W(i,n,l,l[3],r?z(n,l[3],a,As):K(l[3]),rn),s&&s.p&&(!r||a&8)&&W(s,o,l,l[3],r?z(o,l[3],a,null):K(l[3]),null)},i(l){r||(d(i,l),d(s,l),r=!0)},o(l){p(i,l),p(s,l),r=!1},d(l){l&&_(e),i&&i.d(l),s&&s.d(l)}}}function Ns(t){let e,r,n;return r=new tn({props:{style:"min-height: 360px;",$$slots:{default:[Os]},$$scope:{ctx:t}}}),{c(){e=v("div"),T(r.$$.fragment),b(e,"class","rcb-ui-main svelte-vpgys"),b(e,"style",t[0])},m(i,o){g(i,e,o),k(r,e,null),n=!0},p(i,[o]){const s={};o&8&&(s.$$scope={dirty:o,ctx:i}),r.$set(s)},i(i){n||(d(r.$$.fragment,i),n=!0)},o(i){p(r.$$.fragment,i),n=!1},d(i){i&&_(e),P(r)}}}function Us(t,e,r){let{$$slots:n={},$$scope:i}=e,{brandingAppearance:o=void 0}=e,s=new ct(o).formStyleVars;return t.$$set=l=>{"brandingAppearance"in l&&r(1,o=l.brandingAppearance),"$$scope"in l&&r(3,i=l.$$scope)},[s,o,n,i]}class Rs extends j{constructor(e){super(),C(this,e,Us,Ns,A,{brandingAppearance:1},Ts)}}function on(t){var n;let e,r;return e=new Ps({props:{brandingAppearance:(n=t[1])==null?void 0:n.appearance,$$slots:{header:[Bs],default:[Ls]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(i,o){k(e,i,o),r=!0},p(i,o){var l;const s={};o&2&&(s.brandingAppearance=(l=i[1])==null?void 0:l.appearance),o&33554454&&(s.$$scope={dirty:o,ctx:i}),e.$set(s)},i(i){r||(d(e.$$.fragment,i),r=!0)},o(i){p(e.$$.fragment,i),r=!1},d(i){P(e,i)}}}function sn(t){var n;let e,r;return e=new Nt({props:{productDetails:t[4],brandingAppearance:(n=t[1])==null?void 0:n.appearance,purchaseOption:t[8]}}),{c(){T(e.$$.fragment)},m(i,o){k(e,i,o),r=!0},p(i,o){var l;const s={};o&16&&(s.productDetails=i[4]),o&2&&(s.brandingAppearance=(l=i[1])==null?void 0:l.appearance),e.$set(s)},i(i){r||(d(e.$$.fragment,i),r=!0)},o(i){p(e.$$.fragment,i),r=!1},d(i){P(e,i)}}}function Ls(t){let e,r,n=t[4]&&t[8]&&sn(t);return{c(){n&&n.c(),e=ae()},m(i,o){n&&n.m(i,o),g(i,e,o),r=!0},p(i,o){i[4]&&i[8]?n?(n.p(i,o),o&16&&d(n,1)):(n=sn(i),n.c(),d(n,1),n.m(e.parentNode,e)):n&&(Q(),p(n,1,1,()=>{n=null}),X())},i(i){r||(d(n),r=!0)},o(i){p(n),r=!1},d(i){i&&_(e),n&&n.d(i)}}}function Ss(t){let e,r;return e=new cs({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Ms(t){let e,r;return e=new ds({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Ds(t){let e,r,n,i,o,s,l;e=new Mt({props:{brandingInfo:t[1]}});const a=[Ms,Ss],c=[];function u(f,m){return m&4&&(n=null),n==null&&(n=!!f[2].isSandbox()),n?0:1}return i=u(t,-1),o=c[i]=a[i](t),{c(){T(e.$$.fragment),r=S(),o.c(),s=ae()},m(f,m){k(e,f,m),g(f,r,m),c[i].m(f,m),g(f,s,m),l=!0},p(f,m){const w={};m&2&&(w.brandingInfo=f[1]),e.$set(w);let I=i;i=u(f,m),i!==I&&(Q(),p(c[I],1,1,()=>{c[I]=null}),X(),o=c[i],o||(o=c[i]=a[i](f),o.c()),d(o,1),o.m(s.parentNode,s))},i(f){l||(d(e.$$.fragment,f),d(o),l=!0)},o(f){p(e.$$.fragment,f),p(o),l=!1},d(f){f&&(_(r),_(s)),P(e,f),c[i].d(f)}}}function Bs(t){let e,r;return e=new lt({props:{slot:"header",$$slots:{default:[Ds]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&33554438&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function ln(t){let e,r;return e=new Nt({props:{productDetails:t[4],purchaseOption:t[8]}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.productDetails=n[4]),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function an(t){let e,r;return e=new rt({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function cn(t){let e,r;return e=new zo({props:{onContinue:t[11],onClose:t[10],processing:t[7]==="processing-auth-info",lastError:t[6]}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&128&&(o.processing=n[7]==="processing-auth-info"),i&64&&(o.lastError=n[6]),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function un(t){let e,r;return e=new So({props:{paymentInfoCollectionMetadata:t[5],onContinue:t[11],onClose:t[10],onError:t[12],processing:t[7]==="polling-purchase-status",productDetails:t[4],purchaseOptionToUse:t[8],brandingInfo:t[1]}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&32&&(o.paymentInfoCollectionMetadata=n[5]),i&128&&(o.processing=n[7]==="polling-purchase-status"),i&16&&(o.productDetails=n[4]),i&2&&(o.brandingInfo=n[1]),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function fn(t){let e,r;return e=new rt({}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function dn(t){var n;let e,r;return e=new Ii({props:{brandingInfo:t[1],lastError:t[6]??new J(te.UnknownError,"Unknown error without state set."),supportEmail:(n=t[1])==null?void 0:n.seller_company_support_email,productDetails:t[4],onContinue:t[13]}}),{c(){T(e.$$.fragment)},m(i,o){k(e,i,o),r=!0},p(i,o){var l;const s={};o&2&&(s.brandingInfo=i[1]),o&64&&(s.lastError=i[6]??new J(te.UnknownError,"Unknown error without state set.")),o&2&&(s.supportEmail=(l=i[1])==null?void 0:l.seller_company_support_email),o&16&&(s.productDetails=i[4]),e.$set(s)},i(i){r||(d(e.$$.fragment,i),r=!0)},o(i){p(e.$$.fragment,i),r=!1},d(i){P(e,i)}}}function pn(t){let e,r;return e=new Li({props:{productDetails:t[4],brandingInfo:t[1],onContinue:t[11]}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&16&&(o.productDetails=n[4]),i&2&&(o.brandingInfo=n[1]),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Cs(t){let e,r,n,i,o,s,l,a,c=t[7]==="present-offer"&&t[4]&&t[8]&&ln(t),u=t[7]==="present-offer"&&!t[4]&&an(),f=(t[7]==="needs-auth-info"||t[7]==="processing-auth-info")&&cn(t),m=t[5]&&(t[7]==="needs-payment-info"||t[7]==="polling-purchase-status")&&t[4]&&t[8]&&un(t),w=t[7]==="loading"&&fn(),I=t[7]==="error"&&dn(t),O=t[7]==="success"&&pn(t);return{c(){c&&c.c(),e=S(),u&&u.c(),r=S(),f&&f.c(),n=S(),m&&m.c(),i=S(),w&&w.c(),o=S(),I&&I.c(),s=S(),O&&O.c(),l=ae()},m(y,N){c&&c.m(y,N),g(y,e,N),u&&u.m(y,N),g(y,r,N),f&&f.m(y,N),g(y,n,N),m&&m.m(y,N),g(y,i,N),w&&w.m(y,N),g(y,o,N),I&&I.m(y,N),g(y,s,N),O&&O.m(y,N),g(y,l,N),a=!0},p(y,N){y[7]==="present-offer"&&y[4]&&y[8]?c?(c.p(y,N),N&144&&d(c,1)):(c=ln(y),c.c(),d(c,1),c.m(e.parentNode,e)):c&&(Q(),p(c,1,1,()=>{c=null}),X()),y[7]==="present-offer"&&!y[4]?u?N&144&&d(u,1):(u=an(),u.c(),d(u,1),u.m(r.parentNode,r)):u&&(Q(),p(u,1,1,()=>{u=null}),X()),y[7]==="needs-auth-info"||y[7]==="processing-auth-info"?f?(f.p(y,N),N&128&&d(f,1)):(f=cn(y),f.c(),d(f,1),f.m(n.parentNode,n)):f&&(Q(),p(f,1,1,()=>{f=null}),X()),y[5]&&(y[7]==="needs-payment-info"||y[7]==="polling-purchase-status")&&y[4]&&y[8]?m?(m.p(y,N),N&176&&d(m,1)):(m=un(y),m.c(),d(m,1),m.m(i.parentNode,i)):m&&(Q(),p(m,1,1,()=>{m=null}),X()),y[7]==="loading"?w?N&128&&d(w,1):(w=fn(),w.c(),d(w,1),w.m(o.parentNode,o)):w&&(Q(),p(w,1,1,()=>{w=null}),X()),y[7]==="error"?I?(I.p(y,N),N&128&&d(I,1)):(I=dn(y),I.c(),d(I,1),I.m(s.parentNode,s)):I&&(Q(),p(I,1,1,()=>{I=null}),X()),y[7]==="success"?O?(O.p(y,N),N&128&&d(O,1)):(O=pn(y),O.c(),d(O,1),O.m(l.parentNode,l)):O&&(Q(),p(O,1,1,()=>{O=null}),X())},i(y){a||(d(c),d(u),d(f),d(m),d(w),d(I),d(O),a=!0)},o(y){p(c),p(u),p(f),p(m),p(w),p(I),p(O),a=!1},d(y){y&&(_(e),_(r),_(n),_(i),_(o),_(s),_(l)),c&&c.d(y),u&&u.d(y),f&&f.d(y),m&&m.d(y),w&&w.d(y),I&&I.d(y),O&&O.d(y)}}}function js(t){var s;let e=t[9].includes(t[7]),r,n,i,o=e&&on(t);return n=new Rs({props:{brandingAppearance:(s=t[1])==null?void 0:s.appearance,$$slots:{default:[Cs]},$$scope:{ctx:t}}}),{c(){o&&o.c(),r=S(),T(n.$$.fragment)},m(l,a){o&&o.m(l,a),g(l,r,a),k(n,l,a),i=!0},p(l,a){var u;a&128&&(e=l[9].includes(l[7])),e?o?(o.p(l,a),a&128&&d(o,1)):(o=on(l),o.c(),d(o,1),o.m(r.parentNode,r)):o&&(Q(),p(o,1,1,()=>{o=null}),X());const c={};a&2&&(c.brandingAppearance=(u=l[1])==null?void 0:u.appearance),a&33554674&&(c.$$scope={dirty:a,ctx:l}),n.$set(c)},i(l){i||(d(o),d(n.$$.fragment,l),i=!0)},o(l){p(o),p(n.$$.fragment,l),i=!1},d(l){l&&_(r),o&&o.d(l),P(n,l)}}}function Fs(t){let e,r;return e=new gs({props:{style:t[3],$$slots:{default:[js]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&8&&(o.style=n[3]),i&33554678&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function Hs(t){let e,r;return e=new ss({props:{condition:t[0],$$slots:{default:[Fs]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,i){const o={};i&1&&(o.condition=n[0]),i&33554686&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function qs(t){let e,r;return e=new ys({props:{$$slots:{default:[Hs]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(n,i){k(e,n,i),r=!0},p(n,[i]){const o={};i&33554687&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){r||(d(e.$$.fragment,n),r=!0)},o(n){p(e.$$.fragment,n),r=!1},d(n){P(e,n)}}}function xs(t,e,r){let{asModal:n=!0}=e,{customerEmail:i}=e,{appUserId:o}=e,{rcPackage:s}=e,{purchaseOption:l}=e,{brandingInfo:a}=e,{onFinished:c}=e,{onError:u}=e,{onClose:f}=e,{purchases:m}=e,{purchaseOperationHelper:w}=e,I="",O=null,y=null,N=null;const ie=s.rcBillingProduct.identifier??null,$=s.rcBillingProduct.defaultPurchaseOption,U=l||$;let x="present-offer";const Ke=["present-offer","needs-auth-info","processing-auth-info","needs-payment-info","polling-purchase-status","loading"];Ce(async()=>{if(r(4,O=s.rcBillingProduct),r(3,I=Jt(a==null?void 0:a.appearance)),x==="present-offer"){i?In():r(7,x="needs-auth-info");return}});const Qe=()=>{f()},In=()=>{if(ie===null){Me(new J(te.ErrorSettingUpPurchase,"Product ID was not set before purchase."));return}else x==="present-offer"&&r(7,x="loading");if(!i){Me(new J(te.MissingEmailError));return}w.startPurchase(o,ie,U,i,s.rcBillingProduct.presentedOfferingContext).then(D=>{if(D.next_action==="collect_payment_info"){r(6,N=null),r(7,x="needs-payment-info"),r(5,y=D);return}if(D.next_action==="completed"){r(6,N=null),r(7,x="success");return}}).catch(D=>{Me(D)})},vl=D=>{if(x==="needs-auth-info"){D&&(r(14,i=D.email),r(7,x="processing-auth-info")),In();return}if(x==="needs-payment-info"){r(7,x="polling-purchase-status"),w.pollCurrentPurchaseForCompletion().then(()=>{r(7,x="success")}).catch($l=>{Me($l)});return}if(x==="success"||x==="error"){c();return}r(7,x="success")},Me=D=>{if(x==="processing-auth-info"&&D.isRecoverable()){r(6,N=D),r(7,x="needs-auth-info");return}r(6,N=D),r(7,x="error")},Il=()=>{u(N??new J(te.UnknownError,"Unknown error without state set."))};return t.$$set=D=>{"asModal"in D&&r(0,n=D.asModal),"customerEmail"in D&&r(14,i=D.customerEmail),"appUserId"in D&&r(15,o=D.appUserId),"rcPackage"in D&&r(16,s=D.rcPackage),"purchaseOption"in D&&r(17,l=D.purchaseOption),"brandingInfo"in D&&r(1,a=D.brandingInfo),"onFinished"in D&&r(18,c=D.onFinished),"onError"in D&&r(19,u=D.onError),"onClose"in D&&r(20,f=D.onClose),"purchases"in D&&r(2,m=D.purchases),"purchaseOperationHelper"in D&&r(21,w=D.purchaseOperationHelper)},[n,a,m,I,O,y,N,x,U,Ke,Qe,vl,Me,Il,i,o,s,l,c,u,f,w]}class Gs extends j{constructor(e){super(),C(this,e,xs,qs,A,{asModal:0,customerEmail:14,appUserId:15,rcPackage:16,purchaseOption:17,brandingInfo:1,onFinished:18,onError:19,onClose:20,purchases:2,purchaseOperationHelper:21})}}function Vs(t){return t.expires_date==null?!0:new Date(t.expires_date)>new Date}function Ys(t,e,r,n){const i=e.product_identifier;if(i in r)return zs(t,e,r[i]);if(i in n)return Ws(t,e,n[i]);throw new Z(ee.CustomerInfoError,"Could not find entitlement product in subscriptions or non-subscriptions.")}function zs(t,e,r){return{identifier:t,isActive:Vs(e),willRenew:Xs(e,r),store:(r==null?void 0:r.store)??"unknown",latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(e.purchase_date),expirationDate:Ye(e.expires_date),productIdentifier:e.product_identifier,unsubscribeDetectedAt:Ye(r==null?void 0:r.unsubscribe_detected_at),billingIssueDetectedAt:Ye(r==null?void 0:r.billing_issues_detected_at),isSandbox:(r==null?void 0:r.is_sandbox)??!1,periodType:(r==null?void 0:r.period_type)??"normal"}}function Ws(t,e,r){return{identifier:t,isActive:!0,willRenew:!1,store:r.store,latestPurchaseDate:new Date(e.purchase_date),originalPurchaseDate:new Date(r.original_purchase_date),expirationDate:null,productIdentifier:e.product_identifier,unsubscribeDetectedAt:null,billingIssueDetectedAt:null,isSandbox:r.is_sandbox,periodType:"normal"}}function Ks(t,e,r){const n={},i={};for(const o in t){const s=Ys(o,t[o],e,r);n[o]=s,s.isActive&&(i[o]=s)}return{all:n,active:i}}function Ye(t){return t==null?null:new Date(t)}function Qs(t){const e=Js(t),r=t.subscriber,n=tl(r.non_subscriptions);return{entitlements:Ks(r.entitlements,r.subscriptions,n),allExpirationDatesByProduct:e,allPurchaseDatesByProduct:Zs(t,n),activeSubscriptions:el(e),managementURL:r.management_url,requestDate:new Date(t.request_date),firstSeenDate:new Date(r.first_seen),originalPurchaseDate:Ye(r.original_purchase_date),originalAppUserId:t.subscriber.original_app_user_id}}function Xs(t,e){if(e==null)return!1;const r=e.store=="promotional",n=t.expires_date==null,i=e.unsubscribe_detected_at!=null,o=e.billing_issues_detected_at!=null;return!(r||n||i||o)}function Zs(t,e){const r={};for(const n in t.subscriber.subscriptions){const i=t.subscriber.subscriptions[n];r[n]=new Date(i.purchase_date)}for(const n in e){const i=e[n].purchase_date;i==null?r[n]=null:r[n]=new Date(i)}return r}function Js(t){const e={};for(const r in t.subscriber.subscriptions){const n=t.subscriber.subscriptions[r];n.expires_date==null?e[r]=null:e[r]=new Date(n.expires_date)}return e}function el(t){const e=new Set,r=new Date;for(const n in t){const i=t[n];(i==null||i>r)&&e.add(n)}return e}function tl(t){const e={};for(const r in t){if(t[r].length===0)continue;const n=t[r].length;e[r]=t[r][n-1]}return e}const nl="0.11.1",rl="https://api.revenuecat.com";var ze;(function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.EARLY_HINTS=103]="EARLY_HINTS",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY=305]="USE_PROXY",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",t[t.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.IM_A_TEAPOT=418]="IM_A_TEAPOT",t[t.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",t[t.METHOD_FAILURE=420]="METHOD_FAILURE",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(ze||(ze={}));function ut(t){return t?t.startsWith("rcb_sb_"):!1}async function Ie(t,e){const{apiKey:r,body:n,headers:i,httpConfig:o}=e,l=`${(o==null?void 0:o.proxyURL)??rl}${t.urlPath()}`;try{const a=await fetch(l,{method:t.method,headers:ll(r,i,o==null?void 0:o.additionalHeaders),body:ol(n)});return await il(a,t),await a.json()}catch(a){throw a instanceof TypeError?new Z(ee.NetworkError,Ne.getPublicMessage(ee.NetworkError),a.message):a}}async function il(t,e){const r=t.status;if(r>=ze.INTERNAL_SERVER_ERROR)ft(e,r,await t.text());else if(r>=ze.BAD_REQUEST){const n=await t.json(),i=n?JSON.stringify(n):null,o=n==null?void 0:n.code,s=n==null?void 0:n.message;if(o!=null){const l=Ne.convertCodeToBackendErrorCode(o);if(l==null)ft(e,r,i,o);else throw Z.getForBackendError(l,s)}else ft(e,r,i)}}function ft(t,e,r,n){throw new Z(ee.UnknownBackendError,"Unknown backend error.",`Request: ${t.name}. Status code: ${e}. Body: ${r}.`,{backendErrorCode:n})}function ol(t){return t==null?null:JSON.stringify(t)}const mn="Authorization",_n="Content-Type",gn="Accept",hn="X-Platform",bn="X-Version",wn="X-Is-Sandbox",sl=new Set([mn,_n,gn,hn,bn,wn]);function ll(t,e,r){let n={[mn]:`Bearer ${t}`,[_n]:"application/json",[gn]:"application/json",[hn]:"web",[bn]:nl,[wn]:`${ut(t)}`};return e&&(n={...n,...e}),r&&(n={...r,...n}),n}const yn="/v1/subscribers",We="/rcbilling/v1";class al{constructor(e){M(this,"appUserId");M(this,"method","GET");M(this,"name","getOfferings");this.appUserId=e}urlPath(){const e=encodeURIComponent(this.appUserId);return`${yn}/${e}/offerings`}}class cl{constructor(){M(this,"method","POST");M(this,"name","purchase")}urlPath(){return`${We}/purchase`}}class ul{constructor(e,r,n){M(this,"method","GET");M(this,"name","getProducts");M(this,"appUserId");M(this,"productIds");M(this,"currency");this.appUserId=e,this.productIds=r,this.currency=n}urlPath(){const e=encodeURIComponent(this.appUserId),r=this.productIds.map(encodeURIComponent).join("&id="),n=this.currency?`&currency=${this.currency}`:"";return`${We}/subscribers/${e}/products?id=${r}${n}`}}class fl{constructor(e){M(this,"method","GET");M(this,"name","getCustomerInfo");M(this,"appUserId");this.appUserId=e}urlPath(){const e=encodeURIComponent(this.appUserId);return`${yn}/${e}`}}class dl{constructor(){M(this,"method","GET");M(this,"name","getBrandingInfo")}urlPath(){return`${We}/branding`}}class pl{constructor(e){M(this,"method","GET");M(this,"name","getCheckoutStatus");M(this,"operationSessionId");this.operationSessionId=e}urlPath(){return`${We}/checkout/${this.operationSessionId}`}}const dt={};class ml{constructor(e,r=dt){M(this,"API_KEY");M(this,"httpConfig");this.API_KEY=e,this.httpConfig=r}async getOfferings(e){return await Ie(new al(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getCustomerInfo(e){return await Ie(new fl(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getProducts(e,r,n){return await Ie(new ul(e,r,n),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async getBrandingInfo(){return await Ie(new dl,{apiKey:this.API_KEY,httpConfig:this.httpConfig})}async postPurchase(e,r,n,i,o){const s={app_user_id:e,product_id:r,email:n,price_id:o.priceId,presented_offering_identifier:i.offeringIdentifier};return o.id!=="base_option"&&(s.offer_id=o.id),i.targetingContext&&(s.applied_targeting_rule={rule_id:i.targetingContext.ruleId,revision:i.targetingContext.revision}),i.placementIdentifier&&(s.presented_placement_identifier=i.placementIdentifier),await Ie(new cl,{apiKey:this.API_KEY,body:s,httpConfig:this.httpConfig})}async getCheckoutStatus(e){return await Ie(new pl(e),{apiKey:this.API_KEY,httpConfig:this.httpConfig})}}function _l(t){if(!/^rcb_[a-zA-Z0-9_.-]+$/.test(t))throw new Z(ee.InvalidCredentialsError,"Invalid API key. Use your RevenueCat Billing API key.")}function gl(t){if(new Set(["no_user","null","none","nil","(null)","NaN","\\x00","","unidentified","undefined","unknown"]).has(t)||t.includes("/"))throw new Z(ee.InvalidAppUserIdError,'Provided user id: "'+t+'" is not valid. See https://www.revenuecat.com/docs/customers/user-ids#tips-for-setting-app-user-ids for more information.')}function hl(t){if(t!=null&&t.endsWith("/"))throw new Z(ee.ConfigurationError,"Invalid proxy URL. The proxy URL should not end with a trailing slash.")}function bl(t){if(t){for(const e in t)if(sl.has(e))throw new Z(ee.ConfigurationError,"Invalid additional headers. Some headers are reserved for internal use.")}}var pt=(t=>(t.Current="current",t))(pt||{});function wl(t,e){async function r(...n){return await this.preload(),await t.call(this,...n)}return r}const En=(t,e)=>({...t,rcBillingProduct:{...t.rcBillingProduct,presentedOfferingContext:{...t.rcBillingProduct.presentedOfferingContext,placementIdentifier:e}}}),_e=(t,e)=>t==null?null:En(t,e),yl=(t,e,r)=>{const n=t.offering_ids_by_placement??null;if(n==null)return null;const i=t.fallback_offering_id??null;let o;if(r in n){const l=n[r]??null;if(l==null)return null;o=e[l],o==null&&(o=e[i])}else o=e[i];if(o==null)return null;const s=Object.fromEntries(Object.entries(o.packagesById).map(([l,a])=>[l,En(a,r)]));return{...o,packagesById:s,availablePackages:Object.values(s),weekly:_e(o.weekly,r),monthly:_e(o.monthly,r),twoMonth:_e(o.twoMonth,r),threeMonth:_e(o.threeMonth,r),sixMonth:_e(o.sixMonth,r),annual:_e(o.annual,r),lifetime:_e(o.lifetime,r)}};function El(t,e){const r={};e.product_details.forEach(o=>{r[o.identifier]=o});const n={};t.offerings.forEach(o=>{const s=o.identifier===t.current_offering_id,l=pr(s,o,r,t.targeting);l!=null&&(n[o.identifier]=l)});const i=t.current_offering_id?n[t.current_offering_id]??null:null;return Object.keys(n).length==0&&q.debugLog("Empty offerings. Please make sure you've configured offerings correctly in the RevenueCat dashboard and that the products are properly configured."),{all:n,current:i}}vn=[wl];const le=class le{constructor(e,r,n=dt){Un(_t,5,this);M(this,"_API_KEY");M(this,"_appUserId");M(this,"_brandingInfo",null);M(this,"_loadingResourcesPromise",null);M(this,"backend");M(this,"purchaseOperationHelper");this._API_KEY=e,this._appUserId=r,ut(e)&&q.debugLog("Initializing Purchases SDK with sandbox API Key"),this.backend=new ml(this._API_KEY,n),this.purchaseOperationHelper=new Nr(this.backend)}static setLogLevel(e){q.setLogLevel(e)}static getSharedInstance(){if(le.isConfigured())return le.instance;throw new Rt}static isConfigured(){return le.instance!==void 0}static configure(e,r,n=dt){return le.instance!==void 0&&q.warnLog("Purchases is already initialized. You normally should only configure Purchases once. Creating and returning new instance."),_l(e),gl(r),hl(n.proxyURL),bl(n.additionalHeaders),le.instance=new le(e,r,n),le.getSharedInstance()}async preload(){if(this.hasLoadedResources()){q.verboseLog("Purchases resources are loaded. Skipping.");return}if(this._loadingResourcesPromise!==null){q.verboseLog("Purchases resources are loading. Waiting."),await this._loadingResourcesPromise;return}return this._loadingResourcesPromise=this.backend.getBrandingInfo().then(e=>{this._brandingInfo=e}).catch(e=>{let r=`${e}`;e instanceof Z&&(r=`${e.message}. ${e.underlyingErrorMessage?`Underlying error: ${e.underlyingErrorMessage}`:""}`),q.errorLog(`Error fetching branding info: ${r}`)}).finally(()=>{this._loadingResourcesPromise=null}),this._loadingResourcesPromise}hasLoadedResources(){return this._brandingInfo!==null}async getOfferings(e){Do(e==null?void 0:e.currency);const r=this._appUserId,n=await this.backend.getOfferings(r),i=(e==null?void 0:e.offeringIdentifier)===pt.Current?n.current_offering_id:e==null?void 0:e.offeringIdentifier;return i&&(n.offerings=n.offerings.filter(o=>o.identifier===i)),await this.getAllOfferings(n,r,e)}async getCurrentOfferingForPlacement(e,r){const n=this._appUserId,i=await this.backend.getOfferings(n),o=await this.getAllOfferings(i,n,r),s=i.placements??null;return s==null?null:yl(s,o.all,e)}async getAllOfferings(e,r,n){const i=e.offerings.flatMap(s=>s.packages).map(s=>s.platform_product_identifier),o=await this.backend.getProducts(r,i,n==null?void 0:n.currency);return this.logMissingProductIds(i,o.product_details),El(e,o)}async isEntitledTo(e){const r=await this.getCustomerInfo();return e in r.entitlements.active}purchasePackage(e,r,n){return this.purchase({rcPackage:e,customerEmail:r,htmlTarget:n})}purchase(e){const{rcPackage:r,purchaseOption:n,htmlTarget:i,customerEmail:o}=e;let s=i??document.getElementById("rcb-ui-root");if(s===null){const u=document.createElement("div");u.className="rcb-ui-root",document.body.appendChild(u),s=u}if(s===null)throw new Error("Could not generate a mount point for the billing widget");const l=s,a=!i,c=this._appUserId;return q.debugLog(`Presenting purchase form for package ${r.identifier}`),new Promise((u,f)=>{new Gs({target:l,props:{appUserId:c,rcPackage:r,purchaseOption:n,customerEmail:o,onFinished:async()=>{q.debugLog("Purchase finished"),l.innerHTML="",u({customerInfo:await this._getCustomerInfoForUserId(c)})},onClose:()=>{l.innerHTML="",q.debugLog("Purchase cancelled by user"),f(new Z(ee.UserCancelledError))},onError:m=>{l.innerHTML="",f(Z.getForPurchasesFlowError(m))},purchases:this,brandingInfo:this._brandingInfo,purchaseOperationHelper:this.purchaseOperationHelper,asModal:a}})})}async getCustomerInfo(){return await this._getCustomerInfoForUserId(this._appUserId)}getAppUserId(){return this._appUserId}async changeUser(e){return this._appUserId=e,await this.getCustomerInfo()}logMissingProductIds(e,r){const n={};r.forEach(o=>n[o.identifier]=o);const i=[];e.forEach(o=>{n[o]===void 0&&i.push(o)}),i.length>0&&q.debugLog(`Could not find product data for product ids:
35
35
  ${i.join()}.
36
36
  Please check that your product configuration is correct.`)}isSandbox(){return ut(this._API_KEY)}close(){le.instance===this?le.instance=void 0:q.warnLog("Trying to close a Purchases instance that is not the current instance. Ignoring.")}async _getCustomerInfoForUserId(e){const r=await this.backend.getCustomerInfo(e);return Qs(r)}};_t=On(null),Rn(_t,1,"purchase",vn,le),ht(_t,le),M(le,"instance");let mt=le;E.ErrorCode=ee,E.LogLevel=se,E.OfferingKeyword=pt,E.PackageType=$t,E.ProductType=ve,E.Purchases=mt,E.PurchasesError=Z,E.UninitializedPurchasesError=Rt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@revenuecat/purchases-js",
3
3
  "description": "Web subscriptions made easy. Powered by RevenueCat",
4
4
  "private": false,
5
- "version": "0.11.0",
5
+ "version": "0.11.1",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"