vendor: 5,666 bytes, lines 1-7
1import{c as be}from"./createLucideIcon-BDBUbMPn.js";import{s as Z,m as Ee,c as y,v as w}from"./chunk-4N6VE7H7-Bf9iXIPE.js";import{a as H}from"./utils-DHV5uLOD.js";/** 2 * @license lucide-react v0.487.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Ce=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],At=be("loader-circle",Ce);function It({className:e,type:t,...r}){return Z.jsx("input",{type:t,"data-slot":"input",className:H("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...r})}var X={exports:{}},Se="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Oe=Se,xe=Oe;function ee(){}function te(){}te.resetWarningCache=ee;var Pe=function(){function e(n,o,a,c,u,i){if(i!==xe){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:te,resetWarningCache:ee};return r.PropTypes=r,r};X.exports=Pe();var we=X.exports;const f=Ee(we);function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W(Object(r),!0).forEach(function(n){re(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function A(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(t){return typeof t}:A=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(e)}function re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ke(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Re(e,t){if(e==null)return{};var r=ke(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _e(e,t){return Te(e)||Ae(e,t)||Ie(e,t)||Ne()}function Te(e){if(Array.isArray(e))return e}function Ae(e,t){var r=e&&(typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"]);if(r!=null){var n=[],o=!0,a=!1,c,u;try{for(r=r.call(e);!(o=(c=r.next()).done)&&(n.push(c.value),!(t&&n.length===t));o=!0);}catch(i){a=!0,u=i}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}return n}}function Ie(e,t){if(e){if(typeof e=="string")return q(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return q(e,t)}}function q(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 7In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var b=function(t,r,n){var o=!!n,a=y.useRef(n);y.useEffect(function(){a.current=n},[n]),y.useEffect(function(){if(!o||!t)return function(){};var c=function(){a.current&&a.current.apply(a,arguments)};return t.on(r,c),function(){t.off(r,c)}},[o,r,t,a])},je=function(t){var r=y.useRef(t);return y.useEffect(function(){r.current=t},[t]),r.current},N=function(t){return t!==null&&A(t)==="object"},z="[object Object]",De=function e(t,r){if(!N(t)||!N(r))return t===r;var n=Array.isArray(t),o=Array.isArray(r);if(n!==o)return!1;var a=Object.prototype.toString.call(t)===z,c=Object.prototype.toString.call(r)===z;if(a!==c)return!1;if(!a&&!n)return t===r;var u=Object.keys(t),i=Object.keys(r);if(u.length!==i.length)return!1;for(var l={},h=0;h<u.length;h+=1)l[u[h]]=!0;for(var s=0;s<i.length;s+=1)l[i[s]]=!0;var d=Object.keys(l);if(d.length!==u.length)return!1;var E=t,O=r,k=function(R){return e(E[R],O[R])};return d.every(k)},Fe=function(t,r,n){return N(t)?Object.keys(t).reduce(function(o,a){var c=!N(r)||!De(t[a],r[a]);return n.includes(a)?(c&&console.warn("Unsupported prop change: options.".concat(a," is not a mutable property.")),o):c?J(J({},o||{}),{},re({},a,t[a])):o},null):null},ne=y.createContext(null);ne.displayName="ElementsContext";var Me=function(t,r){if(!t)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(r," in an <Elements> provider."));return t};f.any,f.object;f.func.isRequired;var oe=y.createContext(null);oe.displayName="CheckoutSdkContext";var Le=function(t,r){if(!t)throw new Error("Could not find CheckoutProvider context; You need to wrap the part of your app that ".concat(r," in an <CheckoutProvider> provider."));return t},Ue=y.createContext(null);
7Ue.displayName="CheckoutContext";f.any,f.shape({fetchClientSecret:f.func.isRequired,elementsOptions:f.object}).isRequired;var G=function(t){var r=y.useContext(oe),n=y.useContext(ne);if(r&&n)throw new Error("You cannot wrap the part of your app that ".concat(t," in both <CheckoutProvider> and <Elements> providers."));return r?Le(r,t):Me(n,t)},$e=["mode"],Ye=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},p=function(t,r){var n="".concat(Ye(t),"Element"),o=function(i){var l=i.id,h=i.className,s=i.options,d=s===void 0?{}:s,E=i.onBlur,O=i.onFocus,k=i.onReady,U=i.onChange,R=i.onEscape,se=i.onClick,ce=i.onLoadError,ue=i.onLoaderStart,le=i.onNetworksChange,de=i.onConfirm,fe=i.onCancel,pe=i.onShippingAddressChange,me=i.onShippingRateChange,ye=i.onSavedPaymentMethodRemove,he=i.onSavedPaymentMethodUpdate,_=G("mounts <".concat(n,">")),T="elements"in _?_.elements:null,C="checkoutSdk"in _?_.checkoutSdk:null,ve=y.useState(null),$=_e(ve,2),v=$[0],ge=$[1],S=y.useRef(null),j=y.useRef(null);b(v,"blur",E),b(v,"focus",O),b(v,"escape",R),b(v,"click",se),b(v,"loaderror",ce),b(v,"loaderstart",ue),b(v,"networkschange",le),b(v,"confirm",de),b(v,"cancel",fe),b(v,"shippingaddresschange",pe),b(v,"shippingratechange",me),b(v,"savedpaymentmethodremove",ye),b(v,"savedpaymentmethodupdate",he),b(v,"change",U);var D;k&&(t==="expressCheckout"?D=k:D=function(){k(v)}),b(v,"ready",D),y.useLayoutEffect(function(){if(S.current===null&&j.current!==null&&(T||C)){var g=null;if(C)switch(t){case"payment":g=C.createPaymentElement(d);break;case"address":if("mode"in d){var B=d.mode,K=Re(d,$e);if(B==="shipping")g=C.createShippingAddressElement(K);else if(B==="billing")g=C.createBillingAddressElement(K);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":g=C.createExpressCheckoutElement(d);break;case"currencySelector":g=C.createCurrencySelectorElement();break;case"taxId":g=C.createTaxIdElement(d);break;default:throw new Error("Invalid Element type ".concat(n,". You must use either the <PaymentElement />, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."))}else T&&(g=T.create(t,d));S.current=g,ge(g),g&&g.mount(j.current)}},[T,C,d]);var Y=je(d);return y.useEffect(function(){if(S.current){var g=Fe(d,Y,["paymentRequest"]);g&&"update"in S.current&&S.current.update(g)}},[d,Y]),y.useLayoutEffect(function(){return function(){if(S.current&&typeof S.current.destroy=="function")try{S.current.destroy(),S.current=null}catch{}}},[]),y.createElement("div",{id:l,className:h,ref:j})},a=function(i){G("mounts <".concat(n,">"));var l=i.id,h=i.className;return y.createElement("div",{id:l,className:h})},c=r?a:o;return c.propTypes={id:f.string,className:f.string,onChange:f.func,onBlur:f.func,onFocus:f.func,onReady:f.func,onEscape:f.func,onClick:f.func,onLoadError:f.func,onLoaderStart:f.func,onNetworksChange:f.func,onConfirm:f.func,onCancel:f.func,onShippingAddressChange:f.func,onShippingRateChange:f.func,onSavedPaymentMethodRemove:f.func,onSavedPaymentMethodUpdate:f.func,options:f.object},c.displayName=n,c.__elementType=t,c},m=typeof window>
7"u",Be=y.createContext(null);Be.displayName="EmbeddedCheckoutProviderContext";p("auBankAccount",m);var Ke=p("card",m);p("cardNumber",m);p("cardExpiry",m);p("cardCvc",m);p("fpxBank",m);p("iban",m);p("idealBank",m);p("p24Bank",m);p("epsBank",m);p("payment",m);p("expressCheckout",m);p("currencySelector",m);p("paymentRequestButton",m);p("linkAuthentication",m);p("address",m);p("shippingAddress",m);p("paymentMethodMessaging",m);p("affirmMessage",m);p("afterpayClearpayMessage",m);p("taxId",m);var M=Object.defineProperty,We=Object.getOwnPropertyDescriptor,Je=Object.getOwnPropertyNames,qe=Object.prototype.hasOwnProperty,ze=(e,t)=>{for(var r in t)M(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Je(t))!qe.call(e,o)&&o!==r&&M(e,o,{get:()=>t[o],enumerable:!(n=We(t,o))||n.enumerable});return e},Ve=e=>Ge(M({},"__esModule",{value:!0}),e),V=(e,t,r)=>new Promise((n,o)=>{var a=i=>{try{u(r.next(i))}catch(l){o(l)}},c=i=>{try{u(r.throw(i))}catch(l){o(l)}},u=i=>i.done?n(i.value):Promise.resolve(i.value).then(a,c);u((r=r.apply(e,t)).next())}),ae={};ze(ae,{SubmissionError:()=>P,appendExtraData:()=>I,createClient:()=>ie,getDefaultClient:()=>ht,isSubmissionError:()=>at});var L=Ve(ae),x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Qe=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;function Ze(e){e=String(e);for(var t,r,n,o,a="",c=0,u=e.length%3;c<e.length;){if((r=e.charCodeAt(c++))>255||(n=e.charCodeAt(c++))>255||(o=e.charCodeAt(c++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");t=r<<16|n<<8|o,a+=x.charAt(t>>18&63)+x.charAt(t>>12&63)+x.charAt(t>>6&63)+x.charAt(t&63)}return u?a.slice(0,u-3)+"===".substring(u):a}function He(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Qe.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");e+="==".slice(2-(e.length&3));for(var t,r="",n,o,a=0;a<e.length;)t=x.indexOf(e.charAt(a++))<<18|x.indexOf(e.charAt(a++))<<12|(n=x.indexOf(e.charAt(a++)))<<6|(o=x.indexOf(e.charAt(a++))),r+=n===64?String.fromCharCode(t>>16&255):o===64?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,t&255);return r}var Xe=()=>navigator.webdriver||!!document.documentElement.getAttribute(He("d2ViZHJpdmVy"))||!!window.callPhantom||!!window._phantom,et=class{constructor(){this.loadedAt=Date.now(),this.webdriver=Xe()}data(){return{loadedAt:this.loadedAt,webdriver:this.webdriver}}},tt=class{constructor(e){this.kind="success",this.next=e.next}};function rt(e){return"next"in e&&typeof e.next=="string"}var nt=class{constructor(t,r){this.paymentIntentClientSecret=t,this.resubmitKey=r,this.kind="stripePluginPending"}};function ot(e){if("stripe"in e&&"resubmitKey"in e&&typeof e.resubmitKey=="string"){let{stripe:t}=e;return typeof t=="object"&&t!=null&&"paymentIntentClientSecret"in t&&typeof t.paymentIntentClientSecret=="string"}return!1}function at(e){return e.kind==="error"}var P=class{constructor(...e){this.kind="error",this.formErrors=[],this.fieldErrors=new Map;var t;for(let r of e){if(!r.field){this.formErrors.push({code:r.code&&it(r.code)?r.code:"UNSPECIFIED",message:r.message});continue}let n=(t=this.fieldErrors.get(r.field))!=null?t:[];n.push({code:r.code&&ct(r.code)?r.code:"UNSPECIFIED",message:r.message}),this.fieldErrors.set(r.field,n)}}getFormErrors(){return[...this.formErrors]}getFieldErrors(e){var t;return(t=this.fieldErrors.get(e))!=null?t:[]}getAllFieldErrors(){return Array.from(this.fieldErrors)}};function it(e){return e in st}var st={BLOCKED:"BLOCKED",EMPTY:"EMPTY",FILES_TOO_BIG:"FILES_TOO_BIG",FORM_NOT_FOUND:"FORM_NOT_FOUND",INACTIVE:"INACTIVE",NO_FILE_UPLOADS:"NO_FILE_UPLOADS",PROJECT_NOT_FOUND:"PROJECT_NOT_FOUND",TOO_MANY_FILES:"TOO_MANY_FILES"};function ct(e){return e in ut}var ut={REQUIRED_FIELD_EMPTY:"REQUIRED_FIELD_EMPTY",REQUIRED_FIELD_MISSING:"REQUIRED_FIELD_MISSING",STRIPE_CLIENT_ERROR:"STRIPE_CLIENT_ERROR",STRIPE_SCA_ERROR:"STRIPE_SCA_ERROR",TYPE_EMAIL:"TYPE_EMAIL",TYPE_NUMERIC:"TYPE_NUMERIC",TYPE_TEXT:"TYPE_TEXT"};function lt(e){return"errors"in e&&Array.isArray(e.errors)&&e.errors.every(t=>typeof t.message=="string")||"error"in e&&typeof e.error=="string"}var dt="4.0.0",ft=e=>Ze(JSON.stringify(e)),pt=e=>{let t=`@formspree/core@${dt}`;return e?`${e} ${t}`:t};function I(e,t,r){e instanceof FormData?e.append(t,r):e[t]=r}function mt(e){return e!==null&&typeof e=="object"}var yt=class{constructor(e={}){this.project=e.project,this.stripe=e.stripe,typeof window<"u"&&(this.session=new et)}submitForm(e,t){return V(this,arguments,function*(r,n,o={}){let a=o.endpoint||"https://formspree.io",c=this.project?`${a}/p/${this.project}/f/${r}`:`${a}/f/${r}`,u={Accept:"application/json","Formspree-Client":pt(o.clientName)};this.session&&(u["Formspree-Session-Data"]=ft(this.session.data())),n instanceof FormData||(u["Content-Type"]="application/json");function i(h){return V(this,null,function*(){try{let s=yield(yield fetch(c,{method:"POST",mode:"cors",body:h instanceof FormData?h:JSON.stringify(h),headers:u})).json();if(mt(s)){if(lt(s))return Array.isArray(s.errors)?new P(...s.errors):new P({message:s.error});if(ot(s))return new nt(s.stripe.paymentIntentClientSecret,s.resubmitKey);if(rt(s))return new tt({next:s.next})}return new P({message:"Unexpected response format"})}catch(s){let d=s instanceof Error?s.message:`Unknown error while posting to Formspree: ${JSON.stringify(s)}`;return new P({message:d})}})}if(this.stripe&&o.createPaymentMethod){let h=yield o.createPaymentMethod();if(h.error)return new P({code:"STRIPE_CLIENT_ERROR",field:"paymentMethod",message:"Error creating payment method"});I(n,"paymentMethod",h.paymentMethod.id);let s=yield i(n);if(s.kind==="error")return s;
7if(s.kind==="stripePluginPending"){let d=yield this.stripe.handleCardAction(s.paymentIntentClientSecret);if(d.error)return new P({code:"STRIPE_CLIENT_ERROR",field:"paymentMethod",message:"Stripe SCA error"});n instanceof FormData?n.delete("paymentMethod"):delete n.paymentMethod,I(n,"paymentIntent",d.paymentIntent.id),I(n,"resubmitKey",s.resubmitKey);let E=yield i(n);return Q(E),E}return s}let l=yield i(n);return Q(l),l})}};function Q(e){let{kind:t}=e;if(t!=="success"&&t!=="error")throw new Error(`Unexpected submission result (kind: ${t})`)}var ie=e=>new yt(e),ht=()=>(F||(F=ie()),F),F,vt=w.createContext({elements:null});function gt(){return w.useContext(vt)}var bt=y.createContext(null);function Et(){return w.useContext(bt)??{client:L.getDefaultClient()}}var Ct="3.0.0",St=`@formspree/react@${Ct}`;function Ot(e,t={}){let r=Et(),{client:n=r.client,extraData:o,origin:a}=t,{elements:c}=gt(),{stripe:u}=n;return async function(i){let l=xt(i)?Pt(i):i;if(typeof o=="object")for(let[d,E]of Object.entries(o)){let O;typeof E=="function"?O=await E():O=E,O!==void 0&&L.appendExtraData(l,d,O)}let h=c==null?void 0:c.getElement(Ke),s=u&&h?()=>u.createPaymentMethod({type:"card",card:h,billing_details:wt(l)}):void 0;return n.submitForm(e,l,{endpoint:a,clientName:St,createPaymentMethod:s})}}function xt(e){return"preventDefault"in e&&typeof e.preventDefault=="function"}function Pt(e){e.preventDefault();let t=e.currentTarget;if(t.tagName!="FORM")throw new Error("submit was triggered for a non-form element");return new FormData(t)}function wt(e){let t={address:kt(e)};for(let r of["name","email","phone"]){let n=e instanceof FormData?e.get(r):e[r];n&&typeof n=="string"&&(t[r]=n)}return t}function kt(e){let t={};for(let[r,n]of[["address_line1","line1"],["address_line2","line2"],["address_city","city"],["address_country","country"],["address_state","state"],["address_postal_code","postal_code"]]){let o=e instanceof FormData?e.get(r):e[r];o&&typeof o=="string"&&(t[n]=o)}return t}function jt(e,t={}){let[r,n]=w.useState(null),[o,a]=w.useState(null),[c,u]=w.useState(!1),[i,l]=w.useState(!1),h=Ot(e,{client:t.client,extraData:t.data,origin:t.endpoint});return[{errors:r,result:o,submitting:c,succeeded:i},async function(s){u(!0);let d=await h(s);u(!1),L.isSubmissionError(d)?(n(d),l(!1)):(n(null),a(d),l(!0))},function(){n(null),a(null),u(!1),l(!1)}]}function Dt({className:e,...t}){return Z.jsx("textarea",{"data-slot":"textarea",className:H("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex min-h-16 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})}export{It as I,jt as J,At as L,Dt as T};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.