@apollosproject/canvas-embeds 2.1.1124 → 2.1.1126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/widget/index.js +2 -2
package/package.json
CHANGED
package/widget/index.js
CHANGED
|
@@ -1824,7 +1824,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1824
1824
|
`.concat(JSON.stringify(A,null,2)))}}return m?{partialMatch:!0}:void 0;case"[]":for(var Z=GM0(a.args),H;!(H=Z()).done;){var V=H.value;if(t[0]===V)return t.length===1?{match:!0,matchedChars:t}:n?{overflow:!0}:{match:!0,matchedChars:[V]}}return;default:throw new Error("Unsupported instruction tree: ".concat(a))}}function Np(t){"@babel/helpers - typeof";return Np=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},Np(t)}function KM0(t,a){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=tm1(t))||a){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1825
1825
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tm1(t,a){if(t){if(typeof t=="string")return QM0(t,a);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?QM0(t,a):void 0}}function QM0(t,a){(a==null||a>t.length)&&(a=t.length);for(var n=0,r=Array(a);n<a;n++)r[n]=t[n];return r}function am1(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function nm1(t,a){for(var n=0;n<a.length;n++){var r=a[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,lm1(r.key),r)}}function rm1(t,a,n){return a&&nm1(t.prototype,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function lm1(t){var a=im1(t,"string");return Np(a)=="symbol"?a:a+""}function im1(t,a){if(Np(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,a);if(Np(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var gN="9",om1=15,cm1=lH(gN,om1),sm1=/[- ]/,mm1=function(){return/\[([^\[\]])*\]/g},dm1=function(){return/\d(?=[^,}][^,}])/g},um1=new RegExp("["+Fn+"]*\\$1["+Fn+"]*(\\$\\d["+Fn+"]*)*$"),XM0=3,pm1=(function(){function t(a){a.state;var n=a.metadata;am1(this,t),this.metadata=n,this.resetFormat()}return rm1(t,[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(n,r){this.resetFormat(),n?(this.isNANP=n.callingCode()==="1",this.matchingFormats=n.formats(),r.nationalSignificantNumber&&this.narrowDownMatchingFormats(r)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(n,r){var l=this;if(Ps1(r.nationalSignificantNumber,r.country,this.metadata))for(var i=KM0(this.matchingFormats),o;!(o=i()).done;){var c=o.value,m=Ts1(r,c,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(p){return l.shouldTryNationalPrefixFormattingRule(p,{international:r.international,nationalPrefix:r.nationalPrefix})},getSeparatorAfterNationalPrefix:function(p){return l.getSeparatorAfterNationalPrefix(p)}});if(m)return this.resetFormat(),this.chosenFormat=c,this.setNationalNumberTemplate(m.replace(/\d/g,Ln),r),this.populatedNationalNumberTemplate=m,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(Ln),m}return this.formatNationalNumberWithNextDigits(n,r)}},{key:"formatNationalNumberWithNextDigits",value:function(n,r){var l=this.chosenFormat,i=this.chooseFormat(r);if(i)return i===l?this.formatNextNationalNumberDigits(n):this.formatNextNationalNumberDigits(r.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(n){var r=this,l=n.nationalSignificantNumber,i=n.nationalPrefix,o=n.international,c=l,m=c.length-XM0;m<0&&(m=0),this.matchingFormats=this.matchingFormats.filter(function(u){return r.formatSuits(u,o,i)&&r.formatMatches(u,c,m)}),this.chosenFormat&&this.matchingFormats.indexOf(this.chosenFormat)===-1&&this.resetFormat()}},{key:"formatSuits",value:function(n,r,l){return!(l&&!n.usesNationalPrefix()&&!n.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!r&&!l&&n.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(n,r,l){var i=n.leadingDigitsPatterns().length;if(i===0)return!0;l=Math.min(l,i-1);var o=n.leadingDigitsPatterns()[l];if(r.length<XM0)try{return new em1(o).match(r,{allowOverflow:!0})!==void 0}catch(c){return console.error(c),!0}return new RegExp("^(".concat(o,")")).test(r)}},{key:"getFormatFormat",value:function(n,r){return r?n.internationalFormat():n.format()}},{key:"chooseFormat",value:function(n){for(var r=this,l=function(){var u=c.value;return r.chosenFormat===u?0:um1.test(r.getFormatFormat(u,n.international))?r.createTemplateForFormat(u,n)?(r.chosenFormat=u,0):(r.matchingFormats=r.matchingFormats.filter(function(p){return p!==u}),1):1},i,o=KM0(this.matchingFormats.slice()),c;!(c=o()).done&&(i=l(),i!==0););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(n,r){if(!(n.pattern().indexOf("|")>=0)){var l=this.getTemplateForFormat(n,r);if(l)return this.setNationalNumberTemplate(l,r),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(n){return this.isNANP||n&&n.nationalPrefixFormattingRule()&&sm1.test(n.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(n,r){var l=n.IDDPrefix,i=n.missingPlus;return l?r&&r.spacing===!1?l:l+" ":i?"":"+"}},{key:"getTemplate",value:function(n){if(this.template){for(var r=-1,l=0,i=n.international?this.getInternationalPrefixBeforeCountryCallingCode(n,{spacing:!1}):"";l<i.length+n.getDigitsWithoutInternationalPrefix().length;)r=this.template.indexOf(Ln,r+1),l++;return qM0(this.template,r+1)}}},{key:"setNationalNumberTemplate",value:function(n,r){this.nationalNumberTemplate=n,this.populatedNationalNumberTemplate=n,this.populatedNationalNumberTemplatePosition=-1,r.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(r).replace(/[\d\+]/g,Ln)+lH(Ln,r.callingCode.length)+" "+n:this.template=n}},{key:"getTemplateForFormat",value:function(n,r){var l=r.nationalSignificantNumber,i=r.international,o=r.nationalPrefix,c=r.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,m=n.pattern();m=m.replace(mm1(),"\\d").replace(dm1(),"\\d");var u=cm1.match(m)[0];if(!(l.length>u.length)){var p=new RegExp("^"+m+"$"),f=l.replace(/\d/g,gN);p.test(f)&&(u=f);var A=this.getFormatFormat(n,i),Z;if(this.shouldTryNationalPrefixFormattingRule(n,{international:i,nationalPrefix:o})){var H=A.replace(ZM0,n.nationalPrefixFormattingRule());if(rH(n.nationalPrefixFormattingRule())===(o||"")+rH("$1")&&(A=H,Z=!0,o))for(var V=o.length;V>0;)A=A.replace(/\d/,Ln),V--}var b=u.replace(new RegExp(m),A).replace(new RegExp(gN,"g"),Ln);return Z||(c?b=lH(Ln,c.length)+" "+b:o&&(b=lH(Ln,o.length)+this.getSeparatorAfterNationalPrefix(n)+b)),i&&(b=gM0(b)),b}}},{key:"formatNextNationalNumberDigits",value:function(n){var r=$s1(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,n);if(!r){this.resetFormat();return}return this.populatedNationalNumberTemplate=r[0],this.populatedNationalNumberTemplatePosition=r[1],qM0(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(n,r){var l=r.international,i=r.nationalPrefix;if(n.nationalPrefixFormattingRule()){var o=n.usesNationalPrefix();if(o&&i||!o&&!l)return!0}}}])})();function $p(t){"@babel/helpers - typeof";return $p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},$p(t)}function JM0(t,a){return vm1(t)||Am1(t,a)||fm1(t,a)||hm1()}function hm1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1826
1826
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fm1(t,a){if(t){if(typeof t=="string")return eE0(t,a);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eE0(t,a):void 0}}function eE0(t,a){(a==null||a>t.length)&&(a=t.length);for(var n=0,r=Array(a);n<a;n++)r[n]=t[n];return r}function Am1(t,a){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,l,i,o,c=[],m=!0,u=!1;try{if(i=(n=n.call(t)).next,a!==0)for(;!(m=(r=i.call(n)).done)&&(c.push(r.value),c.length!==a);m=!0);}catch(p){u=!0,l=p}finally{try{if(!m&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw l}}return c}}function vm1(t){if(Array.isArray(t))return t}function gm1(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function Zm1(t,a){for(var n=0;n<a.length;n++){var r=a[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Mm1(r.key),r)}}function Hm1(t,a,n){return a&&Zm1(t.prototype,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function Mm1(t){var a=Em1(t,"string");return $p(a)=="symbol"?a:a+""}function Em1(t,a){if($p(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,a);if($p(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Vm1="["+Fn+sa+"]+",ym1=new RegExp("^"+Vm1+"$","i"),bm1="(?:["+aH+"]["+Fn+sa+"]*|["+Fn+sa+"]+)",Sm1=new RegExp("[^"+Fn+sa+"]+.*$"),Fm1=/[^\d\[\]]/,Lm1=(function(){function t(a){var n=a.defaultCountry,r=a.defaultCallingCode,l=a.metadata,i=a.onNationalSignificantNumberChange;gm1(this,t),this.defaultCountry=n,this.defaultCallingCode=r,this.metadata=l,this.onNationalSignificantNumberChange=i}return Hm1(t,[{key:"input",value:function(n,r){var l=wm1(n),i=JM0(l,2),o=i[0],c=i[1],m=rH(o),u;return c&&(r.digits||(r.startInternationalNumber(void 0,void 0),m||(u=!0))),m&&this.inputDigits(m,r),{digits:m,justLeadingPlus:u}}},{key:"inputDigits",value:function(n,r){var l=r.digits,i=l.length<3&&l.length+n.length>=3;if(r.appendDigits(n),i&&this.extractIddPrefix(r),this.isWaitingForCountryCallingCode(r)){if(!this.extractCountryCallingCode(r))return}else r.appendNationalSignificantNumberDigits(n);r.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(r.getNationalDigits(),function(o){return r.update(o)})}},{key:"isWaitingForCountryCallingCode",value:function(n){var r=n.international,l=n.callingCode;return r&&!l}},{key:"extractCountryCallingCode",value:function(n){var r=cN("+"+n.getDigitsWithoutInternationalPrefix(),n.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),l=r.countryCallingCode,i=r.number;if(l)return n.setCallingCode(l),n.update({nationalSignificantNumber:i}),!0}},{key:"reset",value:function(n){if(n){this.hasSelectedNumberingPlan=!0;var r=n._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=r&&Fm1.test(r)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(n,r){if(this.hasSelectedNumberingPlan){var l=lN(n,this.metadata),i=l.nationalPrefix,o=l.nationalNumber,c=l.carrierCode;if(o!==n)return this.onExtractedNationalNumber(i,c,o,n,r),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(n,r,l){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(n,l);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var i=lN(n,this.metadata),o=i.nationalPrefix,c=i.nationalNumber,m=i.carrierCode;if(c!==r)return this.onExtractedNationalNumber(o,m,c,n,l),!0}}},{key:"onExtractedNationalNumber",value:function(n,r,l,i,o){var c=!1,m,u=i.lastIndexOf(l);if(u<0||u!==i.length-l.length)c=!0;else{var p=i.slice(0,u);p&&p!==n&&(m=p)}o({nationalPrefix:n,carrierCode:r,nationalSignificantNumber:l,nationalSignificantNumberIsModified:c,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:m}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(n){if(this.extractAnotherNationalSignificantNumber(n.getNationalDigits(),n.nationalSignificantNumber,function(r){return n.update(r)}))return!0;if(this.extractIddPrefix(n))return this.extractCallingCodeAndNationalSignificantNumber(n),!0;if(this.fixMissingPlus(n))return this.extractCallingCodeAndNationalSignificantNumber(n),!0}},{key:"extractIddPrefix",value:function(n){var r=n.international,l=n.IDDPrefix,i=n.digits;if(n.nationalSignificantNumber,!(r||l)){var o=hM0(i,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(o!==void 0&&o!==i)return n.update({IDDPrefix:i.slice(0,i.length-o.length)}),this.startInternationalNumber(n,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(n){if(!n.international){var r=vM0(n.digits,n.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),l=r.countryCallingCode;if(l)return n.update({missingPlus:!0}),this.startInternationalNumber(n,{country:n.country,callingCode:l}),!0}}},{key:"startInternationalNumber",value:function(n,r){var l=r.country,i=r.callingCode;n.startInternationalNumber(l,i),n.nationalSignificantNumber&&(n.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(n){this.extractCountryCallingCode(n)&&this.extractNationalSignificantNumber(n.getNationalDigits(),function(r){return n.update(r)})}}])})();function _m1(t){var a=t.search(bm1);if(!(a<0)){t=t.slice(a);var n;return t[0]==="+"&&(n=!0,t=t.slice(1)),t=t.replace(Sm1,""),n&&(t="+"+t),t}}function km1(t){var a=_m1(t)||"";return a[0]==="+"?[a.slice(1),!0]:[a]}function wm1(t){var a=km1(t),n=JM0(a,2),r=n[0],l=n[1];return ym1.test(r)||(r=""),[r,l]}function Tp(t){"@babel/helpers - typeof";return Tp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},Tp(t)}function Cm1(t,a){return Pm1(t)||Tm1(t,a)||$m1(t,a)||Nm1()}function Nm1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1827
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $m1(t,a){if(t){if(typeof t=="string")return tE0(t,a);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tE0(t,a):void 0}}function tE0(t,a){(a==null||a>t.length)&&(a=t.length);for(var n=0,r=Array(a);n<a;n++)r[n]=t[n];return r}function Tm1(t,a){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,l,i,o,c=[],m=!0,u=!1;try{if(i=(n=n.call(t)).next,a!==0)for(;!(m=(r=i.call(n)).done)&&(c.push(r.value),c.length!==a);m=!0);}catch(p){u=!0,l=p}finally{try{if(!m&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw l}}return c}}function Pm1(t){if(Array.isArray(t))return t}function Om1(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function xm1(t,a){for(var n=0;n<a.length;n++){var r=a[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,jm1(r.key),r)}}function Im1(t,a,n){return a&&xm1(t.prototype,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function jm1(t){var a=Rm1(t,"string");return Tp(a)=="symbol"?a:a+""}function Rm1(t,a){if(Tp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,a);if(Tp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var aE0=(function(){function t(a,n){Om1(this,t),this.metadata=new et(n);var r=this.getCountryAndCallingCode(a),l=Cm1(r,2),i=l[0],o=l[1];this.defaultCountry=i,this.defaultCallingCode=o,this.reset()}return Im1(t,[{key:"getCountryAndCallingCode",value:function(n){var r,l;return n&&(P5(n)?(r=n.defaultCountry,l=n.defaultCallingCode):r=n),r&&!this.metadata.hasCountry(r)&&(r=void 0),[r,l]}},{key:"input",value:function(n){var r=this.parser.input(n,this.state),l=r.digits,i=r.justLeadingPlus;if(i)this.formattedOutput="+";else if(l){this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state);var o;if(this.metadata.hasSelectedNumberingPlan()&&(o=this.formatter.format(l,this.state)),o===void 0&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var c=this.state.getNationalDigits();c&&(o=this.formatter.format(c,this.state))}this.formattedOutput=o?this.getFullNumber(o):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var n=this;return this.state=new ks1({onCountryChange:function(l){n.country=l},onCallingCodeChange:function(l,i){n.metadata.selectNumberingPlan(i,l),n.formatter.reset(n.metadata.numberingPlan,n.state),n.parser.reset(n.metadata.numberingPlan)}}),this.formatter=new pm1({state:this.state,metadata:this.metadata}),this.parser=new Lm1({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){n.determineTheCountryIfNeeded(),n.formatter.reset(n.metadata.numberingPlan,n.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){var n=this.state.digits;if(n)return this._getCountry()}},{key:"_getCountry",value:function(){var n=this.state.country;return n}},{key:"determineTheCountryIfNeeded",value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:"getFullNumber",value:function(n){var r=this;if(this.isInternational()){var l=function(c){return r.formatter.getInternationalPrefixBeforeCountryCallingCode(r.state,{spacing:!!c})+c},i=this.state.callingCode;return l(i?n?"".concat(i," ").concat(n):i:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return n}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var n=this.state,r=n.nationalSignificantNumber,l=n.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,i=n.nationalPrefix,o=r,c=l||i;return c&&(o=c+o),o}},{key:"getNonFormattedNumber",value:function(){var n=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(n?this.state.getNationalDigits():this.getNonFormattedNationalNumberWithPrefix())}},{key:"getNonFormattedTemplate",value:function(){var n=this.getNonFormattedNumber();if(n)return n.replace(/[\+\d]/g,Ln)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var n=this.state.callingCode,r=this.metadata.getCountryCodesForCallingCode(n);return r&&r.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(iN(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var n=this.state,r=n.digits,l=n.callingCode,i=n.country,o=n.nationalSignificantNumber;if(r){if(this.isInternational())return l?"+"+l+o:"+"+r;if(i||l){var c=i?this.metadata.countryCallingCode():l;return"+"+c+o}}}},{key:"getNumber",value:function(){var n=this.state,r=n.nationalSignificantNumber,l=n.carrierCode,i=n.callingCode,o=this._getCountry();if(r&&!(!o&&!i)){if(o&&o===this.defaultCountry){var c=new et(this.metadata.metadata);c.selectNumberingPlan(o);var m=c.numberingPlan.callingCode(),u=this.metadata.getCountryCodesForCallingCode(m);if(u.length>1){var p=AM0(r,{countries:u,metadata:this.metadata.metadata});p&&(o=p)}}var f=new SM0(o||i,r,this.metadata.metadata);return l&&(f.carrierCode=l),f}}},{key:"isPossible",value:function(){var n=this.getNumber();return n?n.isPossible():!1}},{key:"isValid",value:function(){var n=this.getNumber();return n?n.isValid():!1}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])})();function Dm1(){return lM0(Hs1,arguments)}function jc(){return lM0(ys1,arguments)}function iH(t){return aE0.call(this,t,rM0)}iH.prototype=Object.create(aE0.prototype,{}),iH.prototype.constructor=iH;const zm1=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,24V88H36V68ZM36,188V112H220v76Zm172-24a12,12,0,0,1-12,12H164a12,12,0,0,1,0-24h32A12,12,0,0,1,208,164Zm-68,0a12,12,0,0,1-12,12H116a12,12,0,0,1,0-24h12A12,12,0,0,1,140,164Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M232,96v96a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V96Z",opacity:"0.2"}),e.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM136,176H120a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm64,0H168a8,8,0,0,1,0-16h32a8,8,0,0,1,0,16ZM32,88V64H224V88Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50ZM32,62H224a2,2,0,0,1,2,2V90H30V64A2,2,0,0,1,32,62ZM224,194H32a2,2,0,0,1-2-2V102H226v90A2,2,0,0,1,224,194Zm-18-26a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h32A6,6,0,0,1,206,168Zm-64,0a6,6,0,0,1-6,6H120a6,6,0,0,1,0-12h16A6,6,0,0,1,142,168Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52ZM32,60H224a4,4,0,0,1,4,4V92H28V64A4,4,0,0,1,32,60ZM224,196H32a4,4,0,0,1-4-4V100H228v92A4,4,0,0,1,224,196Zm-20-28a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h32A4,4,0,0,1,204,168Zm-64,0a4,4,0,0,1-4,4H120a4,4,0,0,1,0-8h16A4,4,0,0,1,140,168Z"}))]]),ZN=e.forwardRef((t,a)=>e.createElement(E,{ref:a,...t,weights:zm1}));ZN.displayName="CreditCardIcon";const nE0=ZN,Bm1=Object.freeze(Object.defineProperty({__proto__:null,CreditCard:nE0,CreditCardIcon:ZN},Symbol.toStringTag,{value:"Module"}));function oH(t){"@babel/helpers - typeof";return oH=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},oH(t)}function Bl(t){if(t===null||t===!0||t===!1)return NaN;var a=Number(t);return isNaN(a)?a:a<0?Math.ceil(a):Math.floor(a)}function ft(t,a){if(a.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+a.length+" present")}function R4(t){ft(1,arguments);var a=Object.prototype.toString.call(t);return t instanceof Date||oH(t)==="object"&&a==="[object Date]"?new Date(t.getTime()):typeof t=="number"||a==="[object Number]"?new Date(t):((typeof t=="string"||a==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Um1(t,a){ft(2,arguments);var n=R4(t),r=Bl(a);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function qm1(t,a){ft(2,arguments);var n=R4(t),r=Bl(a);if(isNaN(r))return new Date(NaN);if(!r)return n;var l=n.getDate(),i=new Date(n.getTime());i.setMonth(n.getMonth()+r+1,0);var o=i.getDate();return l>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),l),n)}function Wm1(t,a){ft(2,arguments);var n=R4(t).getTime(),r=Bl(a);return new Date(n+r)}var Gm1={};function cH(){return Gm1}function Ym1(t){var a=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return a.setUTCFullYear(t.getFullYear()),t.getTime()-a.getTime()}function Km1(t){return ft(1,arguments),t instanceof Date||oH(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Qm1(t){if(ft(1,arguments),!Km1(t)&&typeof t!="number")return!1;var a=R4(t);return!isNaN(Number(a))}function Xm1(t,a){ft(2,arguments);var n=Bl(a);return Wm1(t,-n)}var Jm1=864e5;function ed1(t){ft(1,arguments);var a=R4(t),n=a.getTime();a.setUTCMonth(0,1),a.setUTCHours(0,0,0,0);var r=a.getTime(),l=n-r;return Math.floor(l/Jm1)+1}function sH(t){ft(1,arguments);var a=1,n=R4(t),r=n.getUTCDay(),l=(r<a?7:0)+r-a;return n.setUTCDate(n.getUTCDate()-l),n.setUTCHours(0,0,0,0),n}function rE0(t){ft(1,arguments);var a=R4(t),n=a.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var l=sH(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var o=sH(i);return a.getTime()>=l.getTime()?n+1:a.getTime()>=o.getTime()?n:n-1}function td1(t){ft(1,arguments);var a=rE0(t),n=new Date(0);n.setUTCFullYear(a,0,4),n.setUTCHours(0,0,0,0);var r=sH(n);return r}var ad1=6048e5;function nd1(t){ft(1,arguments);var a=R4(t),n=sH(a).getTime()-td1(a).getTime();return Math.round(n/ad1)+1}function mH(t,a){var n,r,l,i,o,c,m,u;ft(1,arguments);var p=cH(),f=Bl((n=(r=(l=(i=a?.weekStartsOn)!==null&&i!==void 0?i:a==null||(o=a.locale)===null||o===void 0||(c=o.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&l!==void 0?l:p.weekStartsOn)!==null&&r!==void 0?r:(m=p.locale)===null||m===void 0||(u=m.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var A=R4(t),Z=A.getUTCDay(),H=(Z<f?7:0)+Z-f;return A.setUTCDate(A.getUTCDate()-H),A.setUTCHours(0,0,0,0),A}function lE0(t,a){var n,r,l,i,o,c,m,u;ft(1,arguments);var p=R4(t),f=p.getUTCFullYear(),A=cH(),Z=Bl((n=(r=(l=(i=a?.firstWeekContainsDate)!==null&&i!==void 0?i:a==null||(o=a.locale)===null||o===void 0||(c=o.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&l!==void 0?l:A.firstWeekContainsDate)!==null&&r!==void 0?r:(m=A.locale)===null||m===void 0||(u=m.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(Z>=1&&Z<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var H=new Date(0);H.setUTCFullYear(f+1,0,Z),H.setUTCHours(0,0,0,0);var V=mH(H,a),b=new Date(0);b.setUTCFullYear(f,0,Z),b.setUTCHours(0,0,0,0);var S=mH(b,a);return p.getTime()>=V.getTime()?f+1:p.getTime()>=S.getTime()?f:f-1}function rd1(t,a){var n,r,l,i,o,c,m,u;ft(1,arguments);var p=cH(),f=Bl((n=(r=(l=(i=a?.firstWeekContainsDate)!==null&&i!==void 0?i:a==null||(o=a.locale)===null||o===void 0||(c=o.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&l!==void 0?l:p.firstWeekContainsDate)!==null&&r!==void 0?r:(m=p.locale)===null||m===void 0||(u=m.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),A=lE0(t,a),Z=new Date(0);Z.setUTCFullYear(A,0,f),Z.setUTCHours(0,0,0,0);var H=mH(Z,a);return H}var ld1=6048e5;function id1(t,a){ft(1,arguments);var n=R4(t),r=mH(n,a).getTime()-rd1(n,a).getTime();return Math.round(r/ld1)+1}function t8(t,a){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<a;)r="0"+r;return n+r}var Si={y:function(a,n){var r=a.getUTCFullYear(),l=r>0?r:1-r;return t8(n==="yy"?l%100:l,n.length)},M:function(a,n){var r=a.getUTCMonth();return n==="M"?String(r+1):t8(r+1,2)},d:function(a,n){return t8(a.getUTCDate(),n.length)},a:function(a,n){var r=a.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return r==="am"?"a.m.":"p.m."}},h:function(a,n){return t8(a.getUTCHours()%12||12,n.length)},H:function(a,n){return t8(a.getUTCHours(),n.length)},m:function(a,n){return t8(a.getUTCMinutes(),n.length)},s:function(a,n){return t8(a.getUTCSeconds(),n.length)},S:function(a,n){var r=n.length,l=a.getUTCMilliseconds(),i=Math.floor(l*Math.pow(10,r-3));return t8(i,n.length)}},Rc={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},od1={G:function(a,n,r){var l=a.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(l,{width:"abbreviated"});case"GGGGG":return r.era(l,{width:"narrow"});default:return r.era(l,{width:"wide"})}},y:function(a,n,r){if(n==="yo"){var l=a.getUTCFullYear(),i=l>0?l:1-l;return r.ordinalNumber(i,{unit:"year"})}return Si.y(a,n)},Y:function(a,n,r,l){var i=lE0(a,l),o=i>0?i:1-i;if(n==="YY"){var c=o%100;return t8(c,2)}return n==="Yo"?r.ordinalNumber(o,{unit:"year"}):t8(o,n.length)},R:function(a,n){var r=rE0(a);return t8(r,n.length)},u:function(a,n){var r=a.getUTCFullYear();return t8(r,n.length)},Q:function(a,n,r){var l=Math.ceil((a.getUTCMonth()+1)/3);switch(n){case"Q":return String(l);case"QQ":return t8(l,2);case"Qo":return r.ordinalNumber(l,{unit:"quarter"});case"QQQ":return r.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(l,{width:"narrow",context:"formatting"});default:return r.quarter(l,{width:"wide",context:"formatting"})}},q:function(a,n,r){var l=Math.ceil((a.getUTCMonth()+1)/3);switch(n){case"q":return String(l);case"qq":return t8(l,2);case"qo":return r.ordinalNumber(l,{unit:"quarter"});case"qqq":return r.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(l,{width:"narrow",context:"standalone"});default:return r.quarter(l,{width:"wide",context:"standalone"})}},M:function(a,n,r){var l=a.getUTCMonth();switch(n){case"M":case"MM":return Si.M(a,n);case"Mo":return r.ordinalNumber(l+1,{unit:"month"});case"MMM":return r.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(l,{width:"narrow",context:"formatting"});default:return r.month(l,{width:"wide",context:"formatting"})}},L:function(a,n,r){var l=a.getUTCMonth();switch(n){case"L":return String(l+1);case"LL":return t8(l+1,2);case"Lo":return r.ordinalNumber(l+1,{unit:"month"});case"LLL":return r.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(l,{width:"narrow",context:"standalone"});default:return r.month(l,{width:"wide",context:"standalone"})}},w:function(a,n,r,l){var i=id1(a,l);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):t8(i,n.length)},I:function(a,n,r){var l=nd1(a);return n==="Io"?r.ordinalNumber(l,{unit:"week"}):t8(l,n.length)},d:function(a,n,r){return n==="do"?r.ordinalNumber(a.getUTCDate(),{unit:"date"}):Si.d(a,n)},D:function(a,n,r){var l=ed1(a);return n==="Do"?r.ordinalNumber(l,{unit:"dayOfYear"}):t8(l,n.length)},E:function(a,n,r){var l=a.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(l,{width:"short",context:"formatting"});default:return r.day(l,{width:"wide",context:"formatting"})}},e:function(a,n,r,l){var i=a.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return t8(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(a,n,r,l){var i=a.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return t8(o,n.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(a,n,r){var l=a.getUTCDay(),i=l===0?7:l;switch(n){case"i":return String(i);case"ii":return t8(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(l,{width:"short",context:"formatting"});default:return r.day(l,{width:"wide",context:"formatting"})}},a:function(a,n,r){var l=a.getUTCHours(),i=l/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(a,n,r){var l=a.getUTCHours(),i;switch(l===12?i=Rc.noon:l===0?i=Rc.midnight:i=l/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(a,n,r){var l=a.getUTCHours(),i;switch(l>=17?i=Rc.evening:l>=12?i=Rc.afternoon:l>=4?i=Rc.morning:i=Rc.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(a,n,r){if(n==="ho"){var l=a.getUTCHours()%12;return l===0&&(l=12),r.ordinalNumber(l,{unit:"hour"})}return Si.h(a,n)},H:function(a,n,r){return n==="Ho"?r.ordinalNumber(a.getUTCHours(),{unit:"hour"}):Si.H(a,n)},K:function(a,n,r){var l=a.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(l,{unit:"hour"}):t8(l,n.length)},k:function(a,n,r){var l=a.getUTCHours();return l===0&&(l=24),n==="ko"?r.ordinalNumber(l,{unit:"hour"}):t8(l,n.length)},m:function(a,n,r){return n==="mo"?r.ordinalNumber(a.getUTCMinutes(),{unit:"minute"}):Si.m(a,n)},s:function(a,n,r){return n==="so"?r.ordinalNumber(a.getUTCSeconds(),{unit:"second"}):Si.s(a,n)},S:function(a,n){return Si.S(a,n)},X:function(a,n,r,l){var i=l._originalDate||a,o=i.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return oE0(o);case"XXXX":case"XX":return O5(o);default:return O5(o,":")}},x:function(a,n,r,l){var i=l._originalDate||a,o=i.getTimezoneOffset();switch(n){case"x":return oE0(o);case"xxxx":case"xx":return O5(o);default:return O5(o,":")}},O:function(a,n,r,l){var i=l._originalDate||a,o=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+iE0(o,":");default:return"GMT"+O5(o,":")}},z:function(a,n,r,l){var i=l._originalDate||a,o=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+iE0(o,":");default:return"GMT"+O5(o,":")}},t:function(a,n,r,l){var i=l._originalDate||a,o=Math.floor(i.getTime()/1e3);return t8(o,n.length)},T:function(a,n,r,l){var i=l._originalDate||a,o=i.getTime();return t8(o,n.length)}};function iE0(t,a){var n=t>0?"-":"+",r=Math.abs(t),l=Math.floor(r/60),i=r%60;if(i===0)return n+String(l);var o=a;return n+String(l)+o+t8(i,2)}function oE0(t,a){if(t%60===0){var n=t>0?"-":"+";return n+t8(Math.abs(t)/60,2)}return O5(t,a)}function O5(t,a){var n=a||"",r=t>0?"-":"+",l=Math.abs(t),i=t8(Math.floor(l/60),2),o=t8(l%60,2);return r+i+n+o}var cE0=function(a,n){switch(a){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});default:return n.date({width:"full"})}},sE0=function(a,n){switch(a){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});default:return n.time({width:"full"})}},cd1=function(a,n){var r=a.match(/(P+)(p+)?/)||[],l=r[1],i=r[2];if(!i)return cE0(a,n);var o;switch(l){case"P":o=n.dateTime({width:"short"});break;case"PP":o=n.dateTime({width:"medium"});break;case"PPP":o=n.dateTime({width:"long"});break;default:o=n.dateTime({width:"full"});break}return o.replace("{{date}}",cE0(l,n)).replace("{{time}}",sE0(i,n))},sd1={p:sE0,P:cd1},md1=["D","DD"],dd1=["YY","YYYY"];function ud1(t){return md1.indexOf(t)!==-1}function pd1(t){return dd1.indexOf(t)!==-1}function mE0(t,a,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(a,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(a,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(a,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(a,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var hd1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},fd1=function(a,n,r){var l,i=hd1[a];return typeof i=="string"?l=i:n===1?l=i.one:l=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+l:l+" ago":l};function HN(t){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=a.width?String(a.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var Ad1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},vd1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gd1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Zd1={date:HN({formats:Ad1,defaultWidth:"full"}),time:HN({formats:vd1,defaultWidth:"full"}),dateTime:HN({formats:gd1,defaultWidth:"full"})},Hd1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Md1=function(a,n,r,l){return Hd1[a]};function Pp(t){return function(a,n){var r=n!=null&&n.context?String(n.context):"standalone",l;if(r==="formatting"&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,o=n!=null&&n.width?String(n.width):i;l=t.formattingValues[o]||t.formattingValues[i]}else{var c=t.defaultWidth,m=n!=null&&n.width?String(n.width):t.defaultWidth;l=t.values[m]||t.values[c]}var u=t.argumentCallback?t.argumentCallback(a):a;return l[u]}}var Ed1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Vd1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yd1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},bd1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Sd1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Fd1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ld1=function(a,n){var r=Number(a),l=r%100;if(l>20||l<10)switch(l%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},_d1={ordinalNumber:Ld1,era:Pp({values:Ed1,defaultWidth:"wide"}),quarter:Pp({values:Vd1,defaultWidth:"wide",argumentCallback:function(a){return a-1}}),month:Pp({values:yd1,defaultWidth:"wide"}),day:Pp({values:bd1,defaultWidth:"wide"}),dayPeriod:Pp({values:Sd1,defaultWidth:"wide",formattingValues:Fd1,defaultFormattingWidth:"wide"})};function Op(t){return function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,l=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=a.match(l);if(!i)return null;var o=i[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],m=Array.isArray(c)?wd1(c,function(f){return f.test(o)}):kd1(c,function(f){return f.test(o)}),u;u=t.valueCallback?t.valueCallback(m):m,u=n.valueCallback?n.valueCallback(u):u;var p=a.slice(o.length);return{value:u,rest:p}}}function kd1(t,a){for(var n in t)if(t.hasOwnProperty(n)&&a(t[n]))return n}function wd1(t,a){for(var n=0;n<t.length;n++)if(a(t[n]))return n}function Cd1(t){return function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=a.match(t.matchPattern);if(!r)return null;var l=r[0],i=a.match(t.parsePattern);if(!i)return null;var o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var c=a.slice(l.length);return{value:o,rest:c}}}var Nd1=/^(\d+)(th|st|nd|rd)?/i,$d1=/\d+/i,Td1={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Pd1={any:[/^b/i,/^(a|c)/i]},Od1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xd1={any:[/1/i,/2/i,/3/i,/4/i]},Id1={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},jd1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Rd1={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Dd1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},zd1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Bd1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ud1={ordinalNumber:Cd1({matchPattern:Nd1,parsePattern:$d1,valueCallback:function(a){return parseInt(a,10)}}),era:Op({matchPatterns:Td1,defaultMatchWidth:"wide",parsePatterns:Pd1,defaultParseWidth:"any"}),quarter:Op({matchPatterns:Od1,defaultMatchWidth:"wide",parsePatterns:xd1,defaultParseWidth:"any",valueCallback:function(a){return a+1}}),month:Op({matchPatterns:Id1,defaultMatchWidth:"wide",parsePatterns:jd1,defaultParseWidth:"any"}),day:Op({matchPatterns:Rd1,defaultMatchWidth:"wide",parsePatterns:Dd1,defaultParseWidth:"any"}),dayPeriod:Op({matchPatterns:zd1,defaultMatchWidth:"any",parsePatterns:Bd1,defaultParseWidth:"any"})},qd1={code:"en-US",formatDistance:fd1,formatLong:Zd1,formatRelative:Md1,localize:_d1,match:Ud1,options:{weekStartsOn:0,firstWeekContainsDate:1}},Wd1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Gd1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Yd1=/^'([^]*?)'?$/,Kd1=/''/g,Qd1=/[a-zA-Z]/;function Xd1(t,a,n){var r,l,i,o,c,m,u,p,f,A,Z,H,V,b;ft(2,arguments);var S=String(a),_=cH(),k=(r=(l=void 0)!==null&&l!==void 0?l:_.locale)!==null&&r!==void 0?r:qd1,C=Bl((i=(o=(c=(m=void 0)!==null&&m!==void 0?m:void 0)!==null&&c!==void 0?c:_.firstWeekContainsDate)!==null&&o!==void 0?o:(u=_.locale)===null||u===void 0||(p=u.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var F=Bl((f=(A=(Z=(H=void 0)!==null&&H!==void 0?H:void 0)!==null&&Z!==void 0?Z:_.weekStartsOn)!==null&&A!==void 0?A:(V=_.locale)===null||V===void 0||(b=V.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&f!==void 0?f:0);if(!(F>=0&&F<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw new RangeError("locale must contain localize property");if(!k.formatLong)throw new RangeError("locale must contain formatLong property");var $=R4(t);if(!Qm1($))throw new RangeError("Invalid time value");var O=Ym1($),R=Xm1($,O),U={firstWeekContainsDate:C,weekStartsOn:F,locale:k,_originalDate:$},I=S.match(Gd1).map(function(K){var r0=K[0];if(r0==="p"||r0==="P"){var l0=sd1[r0];return l0(K,k.formatLong)}return K}).join("").match(Wd1).map(function(K){if(K==="''")return"'";var r0=K[0];if(r0==="'")return Jd1(K);var l0=od1[r0];if(l0)return pd1(K)&&mE0(K,a,String(t)),ud1(K)&&mE0(K,a,String(t)),l0(R,K,k.localize,U);if(r0.match(Qd1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r0+"`");return K}).join("");return I}function Jd1(t){var a=t.match(Yd1);return a?a[1].replace(Kd1,"'"):t}const dH=t=>{const[a,n,r]=t.split("-").map(Number);return new Date(a,n-1,r)},x5=t=>{const a=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${a}-${n}-${r}`},dE0=()=>x5(new Date),eu1=t=>t.id==="1st and 15th"?dH(pE0()):new Date,uE0=t=>{if(t.id==="1st and 15th")return dH(pE0());const a=new Date;return t.intervalUnit==="month"?qm1(a,t.intervalCount):Um1(a,t.intervalCount)},tu1=(t,a)=>{if(a.id==="1st and 15th"){const c=(t?dH(t):new Date).getDate();if(c!==1&&c!==15)return!1}if(!t)return!0;const n=eu1(a),r=x5(n),l=uE0(a),i=x5(l);return t>=r&&t<=i},pE0=()=>{const t=new Date,a=t.getDate(),n=t.getMonth(),r=t.getFullYear();if(a===1)return x5(t);if(a<=15){const l=new Date(r,n,15);return x5(l)}else{const l=new Date(r,n+1,1);return x5(l)}},hE0=t=>!t?.donationFunds||t.donationFunds.length===0?null:[...t.donationFunds].sort((n,r)=>(n.displayOrder??0)-(r.displayOrder??0))[0];function au1(t,a){if(!a?.donationFunds||a.donationFunds.length===0)return null;if(!t)return hE0(a);const n=a.donationFunds.find(o=>o.id===t.id);if(n)return n;if(t.parentFund){const o=a.donationFunds.find(c=>c.parentFund?.id===t.parentFund?.id);if(o)return o}const r=KC(t.name.replace(/_/g," ")),l=t.displayName?KC(t.displayName.replace(/_/g," ")):null,i=a.donationFunds.find(o=>!!(r&&Sn(r,o.name)||l&&Sn(l,o.name)||r&&o.displayName&&Sn(r,o.displayName)||l&&o.displayName&&Sn(l,o.displayName)));return i||hE0(a)}const Dc=t=>Number(t).toFixed(2),N6=t=>{if(typeof t=="string"){const a=parseFloat(t);return isNaN(a)?0:a}return t||0},uH=new Map,fE0=t=>typeof window>"u"?Promise.resolve(null):(uH.has(t)||uH.set(t,Promise.resolve().then(()=>Soe).then(({loadStripe:a})=>{if(!a)throw new Error("loadStripe function not available");return a(t)}).catch(a=>(console.error("Failed to load Stripe.js",a),uH.delete(t),null))),uH.get(t)),MN=({churchName:t,churchLogo:a,message:n,title:r,displayLogo:l,theme:i})=>{const o=l!=="false"&&a,c=r&&r.trim()!==""?r:null;return w.jsx(w.Fragment,{children:o||c||n?w.jsxs("div",{className:"px-6 py-6 text-center",children:[o?w.jsx("div",{className:"mb-3",children:w.jsx("div",{className:"w-20 h-20 rounded-full flex items-center justify-center mx-auto",style:{backgroundColor:i?.colors?.base?.primary||"rgb(var(--color-brand-primary))"},children:w.jsx("img",{src:a,alt:`${t} logo`,className:"max-w-[48px] max-h-[48px] object-contain"})})}):null,c?w.jsx(ve,{as:"h2",children:c}):null,c==="Enter Payment Info"?w.jsx(ve,{fg:"secondary",className:"text-sm sm:text-base mt-1",children:"Pay by bank account or credit card"}):n&&n!==""?w.jsx(ve,{className:"text-sm mt-2",fg:"secondary",children:n}):null]}):null})};MN.propTypes={churchName:e1.string.isRequired,churchLogo:e1.string,message:e1.string,title:e1.string,displayLogo:e1.string};const nu1=({onConfirm:t,onError:a,onReady:n,expressCheckoutOptions:r})=>{const l=qH0(),i=BH0(),o=async c=>{if(!l||!i){a(new Error("Stripe or Elements not available"));return}try{const{error:m}=await i.submit();if(m){a(m instanceof Error?m:new Error(m.message||"Payment submission failed"));return}const u={detail:{email:c.detail?.email,phone:c.detail?.phone,name:c.detail?.name}};await t(u,l,i)}catch(m){a(m instanceof Error?m:new Error("Payment failed"))}};return w.jsx(WH0,{options:r,onConfirm:o,onReady:n})};function ru1({isElementReady:t,elementsKey:a,stripePromise:n,elementsOptions:r,onConfirm:l,onError:i,onReady:o,expressCheckoutOptions:c}){return w.jsxs("div",{className:"mt-4 grid [&>*]:col-start-1 [&>*]:row-start-1",children:[w.jsx("div",{className:`h-[50px] flex items-center justify-center rounded-md bg-black dark:bg-white transition-opacity duration-200 ${t?"opacity-0":"opacity-100"}`,children:w.jsx(vr,{size:20,className:"animate-spin text-white dark:text-black"})}),w.jsx("div",{className:`transition-opacity duration-200 ${t?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"}`,children:w.jsx(WC,{stripe:n,options:r,children:w.jsx(nu1,{onConfirm:l,onError:m=>i({message:m.message}),onReady:o,expressCheckoutOptions:c})},a)})]})}function lu1(){const[t,a]=e.useState(()=>typeof document>"u"?"light":document.documentElement.classList.contains("dark")?"dark":"light");return e.useEffect(()=>{const n=new MutationObserver(()=>{const i=document.documentElement.classList.contains("dark");a(i?"dark":"light")});n.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]});const r=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>{!document.documentElement.classList.contains("dark")&&!document.documentElement.classList.contains("light")&&a(r.matches?"dark":"light")};return r.addEventListener("change",l),()=>{n.disconnect(),r.removeEventListener("change",l)}},[]),t}const AE0=({amount:t,selectedFrequency:a,selectedCampus:n,selectedFund:r,isRecurring:l,minimumAllowedAmount:i,initialPaymentIntentId:o,initialSetupIntentId:c,onIntentChanged:m,onError:u,onSuccess:p})=>{const[f,A]=e.useState(!1);e.useEffect(()=>{A(!0)},[]);const{currentChurch:Z}=Mp(),H=I9(),V=A91(),b=lu1(),[S]=GH0(),[_,k]=e.useState(null),[C,F]=e.useState(!1),[$,O]=e.useState(!1),[R,U]=e.useState(null),[I,K]=e.useState(0),[r0,l0]=e.useState(null),[J,X]=e.useState(!1),[y0,Z0]=e.useState(o??null),[o0,p0]=e.useState(c??null),Q=e.useRef(S);Q.current=S;const G=e.useRef(u);G.current=u;const t0=e.useRef(m);t0.current=m;const B=e.useRef(R);B.current=R,e.useEffect(()=>{const h0=Z?.stripeConnectAccount?.publishableKey;if(!h0){k(null),F(!1);return}const z=fE0(h0);k(z),z.then(q=>{F(!!q)}).catch(()=>{F(!1)})},[Z?.stripeConnectAccount?.publishableKey]);const M0=N6(t)>0&&n&&r&&(!l||a);e.useEffect(()=>{if(!M0||!C||!n||!r){U(null);return}const h0=N6(t);if(h0<=0||h0<i)return;let z=!1;const _0=setTimeout(()=>{if(z)return;X(!1),U(null);const Q0={amount:Math.round(h0*100),frequency:tM0(a),futureStartDate:aM0(a),campusId:n.id,fundId:r.id||null,paymentIntentId:y0,setupIntentId:o0,source:"EXPRESS_CHECKOUT"};Q.current({variables:{input:Q0}}).then(v1=>{if(z)return;if(v1.errors){G.current({message:v1.errors[0]?.message??"Failed to create payment intent"});return}const u1=v1.data?.createOrUpdateGiveIntent;u1?.clientSecret&&U(u1.clientSecret),u1?.onBehalfOf&&l0(u1.onBehalfOf),u1?.paymentIntentId&&Z0(u1.paymentIntentId),u1?.setupIntentId&&p0(u1.setupIntentId),K(N1=>N1+1),t0.current?.({paymentIntentId:u1?.paymentIntentId??null,setupIntentId:u1?.setupIntentId??null})}).catch(v1=>{z||G.current({message:v1?.message??"Failed to create payment intent"})})},!!(y0||o0)?500:0);return()=>{z=!0,clearTimeout(_0)}},[M0,C,t,i,n,r,a]);const E0=e.useMemo(()=>{if(!l||!a)return;const h0=Z?.name||"Church",z=Z?.givingWebUrl||(typeof window<"u"?window.location.href:"");return{recurringPaymentRequest:{paymentDescription:`${h0} ${a.id} donation`,managementURL:z,regularBilling:{amount:Math.round(N6(t)*100),label:`${a.id} donation`,recurringPaymentIntervalUnit:a.intervalUnit,recurringPaymentIntervalCount:a.intervalCount}}}},[l,a,t,Z?.name,Z?.givingWebUrl]),m0=e.useMemo(()=>{const h0=b==="dark";return{buttonHeight:50,buttonType:{applePay:"donate",googlePay:"donate"},buttonTheme:{applePay:h0?"white":"black",googlePay:h0?"white":"black"},paymentMethods:{applePay:"auto",googlePay:"auto",link:"never",paypal:"never",klarna:"never",amazonPay:"never"},emailRequired:!0,phoneNumberRequired:!0,billingAddressRequired:!0,...E0&&{applePay:E0}}},[b,E0]),O0=e.useMemo(()=>{const h0={light:{primary:V?.colors?.base?.primary||"#00676D",background:fe.colors.light.fill.screen,componentBackground:fe.colors.light.fill.paper,componentBorder:fe.colors.light.neutral.gray5,componentDivider:fe.colors.light.neutral.gray4,primaryText:fe.colors.light.text.primary,secondaryText:fe.colors.light.text.secondary,componentText:fe.colors.light.text.primary,icon:fe.colors.light.neutral.gray},dark:{primary:V?.colors?.base?.primary||"#00676D",background:fe.colors.dark.fill.screen,componentBackground:fe.colors.dark.fill.paper,componentBorder:fe.colors.dark.neutral.gray5,componentDivider:fe.colors.dark.neutral.gray4,primaryText:fe.colors.dark.text.primary,secondaryText:fe.colors.dark.text.secondary,componentText:fe.colors.dark.text.primary,icon:fe.colors.dark.neutral.gray}};return{theme:b==="dark"?"night":"stripe",variables:{colorPrimary:V?.colors?.base?.secondary||"#17B582",colorBackground:b==="dark"?h0.dark.componentBackground:h0.light.componentBackground,colorText:b==="dark"?h0.dark.primaryText:h0.light.primaryText,colorTextSecondary:b==="dark"?h0.dark.secondaryText:h0.light.secondaryText,colorTextPlaceholder:b==="dark"?h0.dark.secondaryText:h0.light.secondaryText,colorDanger:V?.colors?.base?.alert||"#FF4444",colorSuccess:V?.colors?.base?.success||"#17B582",colorWarning:V?.colors?.base?.warning||"#FFA500",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",fontSizeBase:"16px",spacingUnit:V?.space?.xxxs||"4px",borderRadius:V?.radii?.base||"6px",iconColor:b==="dark"?h0.dark.icon:h0.light.icon}}},[V,b]),a0=async(h0,z,q)=>{const n0=N6(t);if(!n0||n0<=0||!n||!r){u({message:"Please complete all required fields"});return}if(n0<i){u({message:`Please enter an amount of $${Dc(i)} or more`});return}if(l&&!a){u({message:"Please select a frequency"});return}if(!z||!q){u({message:"Stripe or Elements not available"});return}try{const g0=B.current;if(!g0)throw new Error("Payment intent not ready. Please try again.");const _0=g0.startsWith("seti_"),Q0={name:h0.detail?.name??void 0,email:h0.detail?.email??void 0,phone:h0.detail?.phone??void 0},v1={return_url:typeof window<"u"?window.location.href:"",...Q0.name??Q0.email??Q0.phone?{payment_method_data:{billing_details:Q0}}:{}};if(_0){const{error:N1,setupIntent:c1}=await z.confirmSetup({elements:q,clientSecret:g0,confirmParams:v1,redirect:"if_required"});if(N1)throw N1;if(!c1)throw new Error("Could not confirm setup intent");if(c1.status==="requires_action")throw new Error("Payment requires additional authentication");if(c1.status!=="succeeded")throw new Error(`Setup not successful. Status: ${c1.status}`)}else{const{error:N1,paymentIntent:c1}=await z.confirmPayment({elements:q,clientSecret:g0,confirmParams:v1,redirect:"if_required"});if(N1)throw N1;if(!c1)throw new Error("Could not confirm payment");if(c1.status!=="succeeded"&&c1.status!=="processing")throw c1.status==="requires_action"?new Error("Payment requires additional authentication"):new Error(`Payment not successful. Status: ${c1.status}`)}H.track("Donation Completed",{amount:n0,fund:r.id,campusId:n.id,is_recurring:l});const u1=h0.detail?.email||"";p&&typeof p=="function"&&p(u1)}catch(g0){console.error("Express checkout payment error:",g0);const _0=g0 instanceof Error?g0.message:"Express checkout payment failed";u({message:_0})}},u0=e.useMemo(()=>{if(!R)return null;if(l&&r0){const h0=Math.round(N6(t)*100);return h0<=0?null:{mode:"subscription",amount:h0,currency:"usd",appearance:O0,onBehalfOf:r0}}return{clientSecret:R,appearance:O0}},[R,O0,l,r0,t]);e.useEffect(()=>{if(M0&&C){const h0=setTimeout(()=>{O(!0)},50);return()=>clearTimeout(h0)}else O(!1)},[M0,C]);const A0=e.useMemo(()=>`${b}-${l?"subscription":"payment"}-${R??"loading"}-${I}`,[b,l,R,I]);if(!f)return null;const b0=M0&&_&&C&&u0;return w.jsx("div",{className:`transition-all duration-300 ease-out ${$?"opacity-100 translate-y-0":"opacity-0 -translate-y-2"}`,style:{transitionProperty:"opacity, transform"},"data-testid":b0?"donation-express-checkout":"express-checkout-slot",children:w.jsx("div",{className:"mt-4 min-h-[50px]","aria-hidden":!b0,children:b0&&u0?w.jsx(ru1,{isElementReady:J,elementsKey:A0,stripePromise:_,elementsOptions:u0,onConfirm:a0,onError:u,onReady:()=>X(!0),expressCheckoutOptions:m0}):null})})},iu1=(t,a)=>{const n=new iH("US").input(a),r=n.replace(/\D/gm,"").length<t.replace(/\D/gm,"").length,l=n.replace(/\D/gm,""),i=l.length;if(l.startsWith("1")&&i>11||!l.startsWith("1")&&i>10)return null;if(a.length<n.length&&n[n.length-1]===")")return n.slice(0,n.length-1);const o=jc(t,"US"),c=jc(n,"US");return o&&!c&&!r?null:n},ou1=t=>{const a=Dm1(t,"US");return a?a.formatNational():""},vE0=({amount:t,selectedFrequency:a,selectedCampusId:n,selectedFundId:r,selectedFundName:l,clientSecret:i,paymentIntentId:o,setupIntentId:c,paymentIntentError:m,onRetryPaymentIntent:u,onStripeReady:p,onSuccess:f,onError:A,isProcessing:Z=!1,onProcessingChange:H,onBack:V,userFullName:b,userEmail:S,userPhone:_,churchName:k,churchLogo:C,message:F,displayLogo:$,displayHeader:O})=>{const R=qH0(),U=BH0(),{currentChurch:I}=Mp(),{campuses:K}=YC(),r0=aW0();e.useEffect(()=>{R&&p?.()},[R,p]);const[l0,J]=e.useState(!1),[X,y0]=e.useState(b||""),[Z0,o0]=e.useState(S||""),[p0,Q]=e.useState(!1),t0=f91()==="dark";let M0=e.useContext(XC);if(!M0&&I?.theme)try{const T0=typeof I.theme=="string"?JSON.parse(I.theme):I.theme;T0?.colors?.secondary?M0={colors:{base:{secondary:T0.colors.secondary,primary:T0.colors.primary||T0.colors.secondary}}}:(T0?.colors?.base?.secondary,M0=T0)}catch{M0=null}const[E0,m0]=e.useState(_?ou1(_):""),O0=T0=>{const X0=T0.target.value,S0=iu1(E0,X0);S0&&m0(S0)},a0=X.trim()!==""&&Z0.trim()!==""&&jc(E0,"US")&&p0,u0=async T0=>{if(!a0){if(T0.preventDefault(),!p0&&U){const X0=U.getElement("payment");X0&&(X0.focus(),setTimeout(()=>{U.submit().catch(()=>{})},50));return}if(X.trim()===""&&!b){document.getElementById("fullName")?.focus();return}if(Z0.trim()===""&&!S){document.getElementById("email")?.focus();return}if(!jc(E0,"US")){document.getElementById("phoneNumber")?.focus();return}}},A0=Ep(a),b0=K.find(T0=>T0.id===n),h0=b0?.donationFunds?.find(T0=>T0.id===r),z=()=>{const T0={name:`${b0?.name||"Church"} Donation`,amount:Math.round(N6(t)*100)};return h0&&(T0.name=`${h0.displayName||h0.name} Donation`),[T0]},q=()=>!A0||!a?void 0:{recurringPaymentRequest:{paymentDescription:`${k} ${a.id} donation`,managementURL:I?.givingWebUrl||window.location.href,regularBilling:{amount:Math.round(N6(t)*100),label:`${a.id} donation`,recurringPaymentIntervalUnit:a.intervalUnit,recurringPaymentIntervalCount:a.intervalCount}}},n0=async T0=>{const{error:X0,paymentIntent:S0,setupIntent:P0}=T0;if(X0){const y1=new Error(X0.message||"Payment failed");throw A(y1),y1}const J0=S0||P0;return J0&&J0.status==="succeeded"?(r0("Donation Completed",{user_id:"",userId:Z0,group_id:I?.slug||"",email:Z0,phone:E0,is_logged_in:!1,amount:N6(t),fund:r||"",schedule:A0&&a?`${a.intervalCount} ${a.intervalUnit}`:"one-time",is_recurring:!!(A0&&a)}),typeof f=="function"&&f(Z0),!0):J0&&J0.status==="requires_action"?(typeof f=="function"&&f(Z0),!0):J0&&J0.status==="processing"?(r0("Donation Completed",{user_id:"",userId:Z0,group_id:I?.slug||"",email:Z0,phone:E0,is_logged_in:!1,amount:N6(t),fund:r||"",schedule:A0&&a?`${a.intervalCount} ${a.intervalUnit}`:"one-time",is_recurring:!!(A0&&a)}),typeof f=="function"&&f(Z0),!0):(A(new Error(`Payment not successful. Status: ${J0?.status||"unknown"}`)),!1)},g0=async(T0={})=>{if(!R||!U)throw new Error("Stripe or Elements not available");const{error:X0}=await U.submit();if(X0)throw new Error(X0.message||"Payment validation failed");const S0=U._lastSubmittedOptions?.clientSecret||i,P0=S0?.includes("seti_");try{sessionStorage.setItem("donation_email",Z0)}catch{}if(!P0&&S0){const{paymentIntent:y1}=await R.retrievePaymentIntent(S0);if(y1&&(y1.status==="processing"||y1.status==="succeeded"))return{paymentIntent:y1,error:null}}const J0={elements:U,redirect:"if_required",confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:{name:X,email:Z0,phone:E0},metadata:{amount:N6(t).toString(),frequency:a?a.id:"one-time",campusId:n||"",fundId:r||"",isRecurring:A0&&a?"true":"false",churchSlug:I?.slug||""}},...T0}};return P0?await R.confirmSetup(J0):await R.confirmPayment(J0)},_0=async T0=>{if(!R||!U)throw new Error("Stripe or Elements not available");try{const{error:X0}=await U.submit();if(X0)throw X0;const{error:S0,confirmationToken:P0}=await R.createConfirmationToken({elements:U,params:{payment_method_data:{billing_details:{email:T0.detail?.email,phone:T0.detail?.phone,name:T0.detail?.name},metadata:{amount:N6(t).toString(),frequency:a?a.id:"one-time",campusId:n||"",fundId:r||"",isRecurring:A0&&a?"true":"false",churchSlug:I?.slug||""}},return_url:window.location.href}});if(S0)throw S0;const J0=U._lastSubmittedOptions?.clientSecret||i,y1=J0?.includes("seti_"),Y1={clientSecret:J0,confirmParams:{confirmation_token:P0.id},redirect:"if_required"};return y1?await R.confirmSetup(Y1):await R.confirmPayment(Y1)}catch(X0){throw console.error("Express checkout payment error:",X0),X0}},Q0=async T0=>{if(T0.preventDefault(),!R||!U)return;if(!X.trim()){A(new Error("Please enter your full name"));return}if(!Z0.trim()){A(new Error("Please enter your email address"));return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(Z0)){A(new Error("Please enter a valid email address"));return}if(!jc(E0,"US")){A(new Error("Please enter a valid 10-digit phone number"));return}H(!0);let S0=!1;try{const P0=await g0();S0=await n0(P0)}catch(P0){A(P0 instanceof Error?P0:new Error("Payment failed"))}finally{S0||H(!1)}},v1=async T0=>{if(!R)return;r0("Apple Pay Button Tapped",{}),H(!0);let X0=!1;try{const S0=await _0(T0);X0=await n0(S0)}catch(S0){console.error("Express checkout payment error:",S0),A(S0 instanceof Error?S0:new Error("Express checkout payment failed"))}finally{X0||H(!1)}},u1=()=>{J(!0)},N1=I?.givingFullPlatform===!0?void 0:z(),c1=I?.givingFullPlatform===!0?void 0:q(),t1=I?.givingFullPlatform===!0?void 0:{emailRequired:!0,phoneNumberRequired:!0,lineItems:N1,applePay:c1,buttonType:{applePay:"donate",googlePay:"donate"},buttonTheme:{applePay:t0?"white":"black",googlePay:t0?"white":"black"},paymentMethods:{amazonPay:"never",applePay:"auto",googlePay:"auto",link:"never",paypal:"never",klarna:"never"}};return w.jsx("div",{className:"flex flex-col h-full min-h-[400px]","data-testid":"donation-payment-form",children:w.jsxs("form",{onSubmit:Q0,className:"h-full flex flex-col",children:[O!=="false"?w.jsx(MN,{churchName:k,churchLogo:C,message:F,title:"Enter Payment Info",displayLogo:$,theme:M0||void 0}):null,w.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:w.jsxs("div",{className:"space-y-4",children:[w.jsx("div",{className:"bg-system-regular dark:bg-system-regular-dark rounded-lg p-4",children:w.jsxs(ve,{className:"text-sm",fg:"secondary",children:["Gift of $",Dc(N6(t))," ",nM0(a)," to"," ",h0?.displayName||h0?.name||l||"..."," ",w.jsx("button",{type:"button",onClick:V,className:"bg-transparent border-none p-0 cursor-pointer hover:decoration-[rgb(var(--color-brand-secondary))]","data-secondary-link":!0,children:w.jsxs("span",{children:["(",w.jsx("span",{className:"underline text-[rgb(var(--color-brand-secondary))] decoration-[rgb(var(--color-brand-secondary)/50%)]",children:"edit details"}),")"]})})]})}),w.jsx(AE0,{amount:String(t),selectedFrequency:a,selectedCampus:b0||void 0,selectedFund:h0||void 0,isRecurring:A0,minimumAllowedAmount:.5,initialPaymentIntentId:o,initialSetupIntentId:c,onError:T0=>A(T0 instanceof Error?T0:new Error(T0.message||"Payment failed")),onSuccess:f}),w.jsx(mr,{children:w.jsx(Ld,{children:m?w.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[w.jsx("p",{className:"text-sm text-fg-secondary dark:text-fg-secondary-dark text-center",children:"Unable to load payment options. Please try again."}),u?w.jsx("button",{type:"button",onClick:u,className:"text-primary hover:underline text-sm font-medium",children:"Retry"}):null]}):R?w.jsx("div",{className:"min-h-[120px] py-2",children:w.jsx(r91,{onChange:T0=>Q(T0.complete),options:{layout:{type:"accordion"},paymentMethodOrder:["us_bank_account","card"],wallets:{applePay:"never",googlePay:"never",link:"never"},fields:{billingDetails:{name:"never",email:"never",phone:"never",address:"auto"}}}})}):w.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2","data-testid":"payment-intent-loading-skeleton",children:[w.jsx(vr,{size:24,className:"animate-spin",weight:"bold"}),w.jsx(ve,{className:"text-sm",fg:"secondary",children:"Loading payment options…"})]})})}),w.jsxs(_x0,{className:"space-y-2",children:[b?w.jsx(o4,{type:"hidden",id:"fullName",name:"fullName",value:X,onChange:T0=>y0(T0.target.value),required:!0}):w.jsxs(Ob,{className:"[&>[data-slot=label]+[data-slot=control]]:mt-0",children:[w.jsx(pv,{htmlFor:"fullName",className:"!font-normal !text-gray-700 dark:!text-gray-300 block text-left",children:"Full Name"}),w.jsx(o4,{type:"text",id:"fullName",name:"fullName",value:X,onChange:T0=>y0(T0.target.value),required:!0,placeholder:"Enter your full name",className:"text-base sm:text-sm h-11 px-3 py-2"})]}),S?w.jsx(o4,{type:"hidden",id:"email",name:"email",value:Z0,onChange:T0=>o0(T0.target.value),required:!0}):w.jsxs(Ob,{className:"[&>[data-slot=label]+[data-slot=control]]:mt-0",children:[w.jsx(pv,{htmlFor:"email",className:"!font-normal !text-gray-700 dark:!text-gray-300 block text-left",children:"Email Address"}),w.jsx(o4,{type:"email",id:"email",name:"email",value:Z0,onChange:T0=>o0(T0.target.value),required:!0,placeholder:"Enter your email address",className:"text-base sm:text-sm h-11 px-3 py-2"})]}),_?w.jsx(o4,{type:"hidden",id:"phoneNumber",name:"phoneNumber",value:E0,onChange:O0,maxLength:16,required:!0}):w.jsxs(Ob,{className:"[&>[data-slot=label]+[data-slot=control]]:mt-0",children:[w.jsx(pv,{htmlFor:"phoneNumber",className:"!font-normal !text-gray-700 dark:!text-gray-300 block text-left",children:"Phone Number"}),w.jsx(o4,{type:"tel",id:"phoneNumber",name:"phoneNumber",value:E0,onChange:O0,required:!0,maxLength:16,placeholder:"(555) 555-5555",className:"text-base sm:text-sm h-11 px-3 py-2"})]})]})]})}),w.jsx("div",{className:"sticky bottom-0 z-10 p-4",children:I?.givingFullPlatform===!0?w.jsx("div",{className:"space-y-4",children:w.jsx(Je,{type:"submit",mode:"solid",className:"w-full",disabled:!R||Z,surface:a0?"solid":"system",...a0&&{"data-secondary-button":!0},onClick:u0,children:Z?w.jsx("div",{className:"flex items-center justify-center gap-2",children:w.jsx(vr,{size:20,className:"animate-spin",weight:"bold"})}):(()=>{if(!p0)return"Select Payment Method";if(!b&&X.trim()==="")return"Enter Name";if(!S&&Z0.trim()==="")return"Enter Email";if(!_&&!jc(E0,"US"))return"Enter Phone";const P0=Dc(N6(t));if(!A0||!a)return`Give $${P0}`;{const J0=a.startDate,y1=!J0||J0===dE0(),Y1=a.id||"";return y1?`Give $${P0} ${Y1}`:`Schedule $${P0} ${nM0(a)}`}})()})}):w.jsxs("div",{className:"space-y-4",style:{display:l0?"block":"none"},children:[w.jsx(WH0,{options:t1,onConfirm:v1,onReady:u1}),w.jsxs(Je,{href:I?.givingWebUrl,target:"_blank",rel:"noopener noreferrer",className:"w-full !rounded-[5px]",disabled:!R||Z,surface:"system",onClick:()=>{r0("Button Used",{label:"Other Payment Methods",action:"Tapped",component:"Button",component_url:I?.givingWebUrl||"",group_id:I?.slug||""})},children:[w.jsx(nE0,{size:20}),"Other Payment Methods"]})]})})]})})};vE0.propTypes={amount:e1.oneOfType([e1.string,e1.number]).isRequired,selectedFrequency:e1.object,selectedCampusId:e1.string,selectedFundId:e1.string,selectedFundName:e1.string,onSuccess:e1.func.isRequired,onError:e1.func.isRequired,isProcessing:e1.bool,onProcessingChange:e1.func.isRequired,onBack:e1.func.isRequired,churchName:e1.string.isRequired,churchLogo:e1.string,message:e1.string,displayLogo:e1.string,title:e1.string,displayHeader:e1.string};const cu1=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),e.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),EN=e.forwardRef((t,a)=>e.createElement(E,{ref:a,...t,weights:cu1}));EN.displayName="CaretDownIcon";const gE0=EN,su1=Object.freeze(Object.defineProperty({__proto__:null,CaretDown:gE0,CaretDownIcon:EN},Symbol.toStringTag,{value:"Module"})),mu1=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,36H48A20,20,0,0,0,28,56v56c0,54.29,26.32,87.22,48.4,105.29,23.71,19.39,47.44,26,48.44,26.29a12.1,12.1,0,0,0,6.32,0c1-.28,24.73-6.9,48.44-26.29,22.08-18.07,48.4-51,48.4-105.29V56A20,20,0,0,0,208,36Zm-4,76c0,35.71-13.09,64.69-38.91,86.15A126.28,126.28,0,0,1,128,219.38a126.14,126.14,0,0,1-37.09-21.23C65.09,176.69,52,147.71,52,112V60H204ZM79.51,144.49a12,12,0,1,1,17-17L112,143l47.51-47.52a12,12,0,0,1,17,17l-56,56a12,12,0,0,1-17,0Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M216,56v56c0,96-88,120-88,120S40,208,40,112V56a8,8,0,0,1,8-8H208A8,8,0,0,1,216,56Z",opacity:"0.2"}),e.createElement("path",{d:"M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.26,47,25.53a8,8,0,0,0,4.2,0c1-.27,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0ZM82.34,141.66a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32l-56,56a8,8,0,0,1-11.32,0Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.26,47,25.53a8,8,0,0,0,4.2,0c1-.27,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm-34.32,69.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,42H48A14,14,0,0,0,34,56v56c0,51.94,25.12,83.4,46.2,100.64,22.73,18.6,45.27,24.89,46.22,25.15a6,6,0,0,0,3.16,0c.95-.26,23.49-6.55,46.22-25.15C196.88,195.4,222,163.94,222,112V56A14,14,0,0,0,208,42Zm2,70c0,37.76-13.94,68.39-41.44,91.06A131.17,131.17,0,0,1,128,225.72a130.94,130.94,0,0,1-40.56-22.66C59.94,180.39,46,149.76,46,112V56a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2ZM172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.26,47,25.53a8,8,0,0,0,4.2,0c1-.27,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0ZM82.34,141.66a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32l-56,56a8,8,0,0,1-11.32,0Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,44H48A12,12,0,0,0,36,56v56c0,51.16,24.73,82.12,45.47,99.1,22.4,18.32,44.55,24.5,45.48,24.76a4,4,0,0,0,2.1,0c.93-.26,23.08-6.44,45.48-24.76,20.74-17,45.47-47.94,45.47-99.1V56A12,12,0,0,0,208,44Zm4,68c0,38.44-14.23,69.63-42.29,92.71A132.45,132.45,0,0,1,128,227.82a132.23,132.23,0,0,1-41.71-23.11C58.23,181.63,44,150.44,44,112V56a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Zm-41.17-10.83a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17Z"}))]]),VN=e.forwardRef((t,a)=>e.createElement(E,{ref:a,...t,weights:mu1}));VN.displayName="ShieldCheckIcon";const ZE0=VN,du1=Object.freeze(Object.defineProperty({__proto__:null,ShieldCheck:ZE0,ShieldCheckIcon:VN},Symbol.toStringTag,{value:"Module"})),uu1=({startDate:t,frequency:a,onStartDateChange:n,disabled:r=!1})=>{const l=e.useRef(null),i=e.useMemo(()=>dE0(),[]),o=e.useMemo(()=>uE0(a),[a]),c=x5(o),m=A=>{if(A===null)return"Today";const Z=dH(A);return Xd1(Z,"MMMM d, yyyy")},u=A=>{const Z=A.target.value;Z===i?n(null):Z&&n(Z)},p=()=>{if(!r&&l.current)try{l.current.focus(),l.current.showPicker()}catch{l.current?.focus()}},f=t||i;return w.jsxs("div",{children:[w.jsx(ve,{className:"mb-1 text-xs text-left",fg:"secondary",children:"Starting"}),w.jsxs("div",{className:"relative [&_[data-slot=control]]:!border-system-regular [&_[data-slot=control]]:dark:!border-system-regular-dark [&_input]:!border-system-regular [&_input]:dark:!border-system-regular-dark [&_input]:data-[hover]:!border-system-regular [&_input]:dark:data-[hover]:!border-system-regular-dark",children:[w.jsx(o4,{type:"text",value:m(t),readOnly:!0,onClick:p,disabled:r,className:"cursor-pointer h-[48px] pr-10"}),w.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-zinc-500 dark:text-zinc-400",children:w.jsx(l_,{size:18,color:"currentColor"})}),w.jsx("input",{ref:l,type:"date",value:f,min:i,max:c,onChange:u,disabled:r,tabIndex:-1,className:"absolute top-0 left-0 w-full h-full opacity-0 pointer-events-none"})]})]})},pu1=`
|
|
1827
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $m1(t,a){if(t){if(typeof t=="string")return tE0(t,a);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tE0(t,a):void 0}}function tE0(t,a){(a==null||a>t.length)&&(a=t.length);for(var n=0,r=Array(a);n<a;n++)r[n]=t[n];return r}function Tm1(t,a){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,l,i,o,c=[],m=!0,u=!1;try{if(i=(n=n.call(t)).next,a!==0)for(;!(m=(r=i.call(n)).done)&&(c.push(r.value),c.length!==a);m=!0);}catch(p){u=!0,l=p}finally{try{if(!m&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw l}}return c}}function Pm1(t){if(Array.isArray(t))return t}function Om1(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function xm1(t,a){for(var n=0;n<a.length;n++){var r=a[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,jm1(r.key),r)}}function Im1(t,a,n){return a&&xm1(t.prototype,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function jm1(t){var a=Rm1(t,"string");return Tp(a)=="symbol"?a:a+""}function Rm1(t,a){if(Tp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,a);if(Tp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var aE0=(function(){function t(a,n){Om1(this,t),this.metadata=new et(n);var r=this.getCountryAndCallingCode(a),l=Cm1(r,2),i=l[0],o=l[1];this.defaultCountry=i,this.defaultCallingCode=o,this.reset()}return Im1(t,[{key:"getCountryAndCallingCode",value:function(n){var r,l;return n&&(P5(n)?(r=n.defaultCountry,l=n.defaultCallingCode):r=n),r&&!this.metadata.hasCountry(r)&&(r=void 0),[r,l]}},{key:"input",value:function(n){var r=this.parser.input(n,this.state),l=r.digits,i=r.justLeadingPlus;if(i)this.formattedOutput="+";else if(l){this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state);var o;if(this.metadata.hasSelectedNumberingPlan()&&(o=this.formatter.format(l,this.state)),o===void 0&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var c=this.state.getNationalDigits();c&&(o=this.formatter.format(c,this.state))}this.formattedOutput=o?this.getFullNumber(o):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var n=this;return this.state=new ks1({onCountryChange:function(l){n.country=l},onCallingCodeChange:function(l,i){n.metadata.selectNumberingPlan(i,l),n.formatter.reset(n.metadata.numberingPlan,n.state),n.parser.reset(n.metadata.numberingPlan)}}),this.formatter=new pm1({state:this.state,metadata:this.metadata}),this.parser=new Lm1({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){n.determineTheCountryIfNeeded(),n.formatter.reset(n.metadata.numberingPlan,n.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){var n=this.state.digits;if(n)return this._getCountry()}},{key:"_getCountry",value:function(){var n=this.state.country;return n}},{key:"determineTheCountryIfNeeded",value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:"getFullNumber",value:function(n){var r=this;if(this.isInternational()){var l=function(c){return r.formatter.getInternationalPrefixBeforeCountryCallingCode(r.state,{spacing:!!c})+c},i=this.state.callingCode;return l(i?n?"".concat(i," ").concat(n):i:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return n}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var n=this.state,r=n.nationalSignificantNumber,l=n.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,i=n.nationalPrefix,o=r,c=l||i;return c&&(o=c+o),o}},{key:"getNonFormattedNumber",value:function(){var n=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(n?this.state.getNationalDigits():this.getNonFormattedNationalNumberWithPrefix())}},{key:"getNonFormattedTemplate",value:function(){var n=this.getNonFormattedNumber();if(n)return n.replace(/[\+\d]/g,Ln)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var n=this.state.callingCode,r=this.metadata.getCountryCodesForCallingCode(n);return r&&r.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(iN(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var n=this.state,r=n.digits,l=n.callingCode,i=n.country,o=n.nationalSignificantNumber;if(r){if(this.isInternational())return l?"+"+l+o:"+"+r;if(i||l){var c=i?this.metadata.countryCallingCode():l;return"+"+c+o}}}},{key:"getNumber",value:function(){var n=this.state,r=n.nationalSignificantNumber,l=n.carrierCode,i=n.callingCode,o=this._getCountry();if(r&&!(!o&&!i)){if(o&&o===this.defaultCountry){var c=new et(this.metadata.metadata);c.selectNumberingPlan(o);var m=c.numberingPlan.callingCode(),u=this.metadata.getCountryCodesForCallingCode(m);if(u.length>1){var p=AM0(r,{countries:u,metadata:this.metadata.metadata});p&&(o=p)}}var f=new SM0(o||i,r,this.metadata.metadata);return l&&(f.carrierCode=l),f}}},{key:"isPossible",value:function(){var n=this.getNumber();return n?n.isPossible():!1}},{key:"isValid",value:function(){var n=this.getNumber();return n?n.isValid():!1}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])})();function Dm1(){return lM0(Hs1,arguments)}function jc(){return lM0(ys1,arguments)}function iH(t){return aE0.call(this,t,rM0)}iH.prototype=Object.create(aE0.prototype,{}),iH.prototype.constructor=iH;const zm1=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,24V88H36V68ZM36,188V112H220v76Zm172-24a12,12,0,0,1-12,12H164a12,12,0,0,1,0-24h32A12,12,0,0,1,208,164Zm-68,0a12,12,0,0,1-12,12H116a12,12,0,0,1,0-24h12A12,12,0,0,1,140,164Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M232,96v96a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V96Z",opacity:"0.2"}),e.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM136,176H120a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm64,0H168a8,8,0,0,1,0-16h32a8,8,0,0,1,0,16ZM32,88V64H224V88Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50ZM32,62H224a2,2,0,0,1,2,2V90H30V64A2,2,0,0,1,32,62ZM224,194H32a2,2,0,0,1-2-2V102H226v90A2,2,0,0,1,224,194Zm-18-26a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h32A6,6,0,0,1,206,168Zm-64,0a6,6,0,0,1-6,6H120a6,6,0,0,1,0-12h16A6,6,0,0,1,142,168Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52ZM32,60H224a4,4,0,0,1,4,4V92H28V64A4,4,0,0,1,32,60ZM224,196H32a4,4,0,0,1-4-4V100H228v92A4,4,0,0,1,224,196Zm-20-28a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h32A4,4,0,0,1,204,168Zm-64,0a4,4,0,0,1-4,4H120a4,4,0,0,1,0-8h16A4,4,0,0,1,140,168Z"}))]]),ZN=e.forwardRef((t,a)=>e.createElement(E,{ref:a,...t,weights:zm1}));ZN.displayName="CreditCardIcon";const nE0=ZN,Bm1=Object.freeze(Object.defineProperty({__proto__:null,CreditCard:nE0,CreditCardIcon:ZN},Symbol.toStringTag,{value:"Module"}));function oH(t){"@babel/helpers - typeof";return oH=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},oH(t)}function Bl(t){if(t===null||t===!0||t===!1)return NaN;var a=Number(t);return isNaN(a)?a:a<0?Math.ceil(a):Math.floor(a)}function ft(t,a){if(a.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+a.length+" present")}function R4(t){ft(1,arguments);var a=Object.prototype.toString.call(t);return t instanceof Date||oH(t)==="object"&&a==="[object Date]"?new Date(t.getTime()):typeof t=="number"||a==="[object Number]"?new Date(t):((typeof t=="string"||a==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Um1(t,a){ft(2,arguments);var n=R4(t),r=Bl(a);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function qm1(t,a){ft(2,arguments);var n=R4(t),r=Bl(a);if(isNaN(r))return new Date(NaN);if(!r)return n;var l=n.getDate(),i=new Date(n.getTime());i.setMonth(n.getMonth()+r+1,0);var o=i.getDate();return l>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),l),n)}function Wm1(t,a){ft(2,arguments);var n=R4(t).getTime(),r=Bl(a);return new Date(n+r)}var Gm1={};function cH(){return Gm1}function Ym1(t){var a=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return a.setUTCFullYear(t.getFullYear()),t.getTime()-a.getTime()}function Km1(t){return ft(1,arguments),t instanceof Date||oH(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Qm1(t){if(ft(1,arguments),!Km1(t)&&typeof t!="number")return!1;var a=R4(t);return!isNaN(Number(a))}function Xm1(t,a){ft(2,arguments);var n=Bl(a);return Wm1(t,-n)}var Jm1=864e5;function ed1(t){ft(1,arguments);var a=R4(t),n=a.getTime();a.setUTCMonth(0,1),a.setUTCHours(0,0,0,0);var r=a.getTime(),l=n-r;return Math.floor(l/Jm1)+1}function sH(t){ft(1,arguments);var a=1,n=R4(t),r=n.getUTCDay(),l=(r<a?7:0)+r-a;return n.setUTCDate(n.getUTCDate()-l),n.setUTCHours(0,0,0,0),n}function rE0(t){ft(1,arguments);var a=R4(t),n=a.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var l=sH(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var o=sH(i);return a.getTime()>=l.getTime()?n+1:a.getTime()>=o.getTime()?n:n-1}function td1(t){ft(1,arguments);var a=rE0(t),n=new Date(0);n.setUTCFullYear(a,0,4),n.setUTCHours(0,0,0,0);var r=sH(n);return r}var ad1=6048e5;function nd1(t){ft(1,arguments);var a=R4(t),n=sH(a).getTime()-td1(a).getTime();return Math.round(n/ad1)+1}function mH(t,a){var n,r,l,i,o,c,m,u;ft(1,arguments);var p=cH(),f=Bl((n=(r=(l=(i=a?.weekStartsOn)!==null&&i!==void 0?i:a==null||(o=a.locale)===null||o===void 0||(c=o.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&l!==void 0?l:p.weekStartsOn)!==null&&r!==void 0?r:(m=p.locale)===null||m===void 0||(u=m.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var A=R4(t),Z=A.getUTCDay(),H=(Z<f?7:0)+Z-f;return A.setUTCDate(A.getUTCDate()-H),A.setUTCHours(0,0,0,0),A}function lE0(t,a){var n,r,l,i,o,c,m,u;ft(1,arguments);var p=R4(t),f=p.getUTCFullYear(),A=cH(),Z=Bl((n=(r=(l=(i=a?.firstWeekContainsDate)!==null&&i!==void 0?i:a==null||(o=a.locale)===null||o===void 0||(c=o.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&l!==void 0?l:A.firstWeekContainsDate)!==null&&r!==void 0?r:(m=A.locale)===null||m===void 0||(u=m.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(Z>=1&&Z<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var H=new Date(0);H.setUTCFullYear(f+1,0,Z),H.setUTCHours(0,0,0,0);var V=mH(H,a),b=new Date(0);b.setUTCFullYear(f,0,Z),b.setUTCHours(0,0,0,0);var S=mH(b,a);return p.getTime()>=V.getTime()?f+1:p.getTime()>=S.getTime()?f:f-1}function rd1(t,a){var n,r,l,i,o,c,m,u;ft(1,arguments);var p=cH(),f=Bl((n=(r=(l=(i=a?.firstWeekContainsDate)!==null&&i!==void 0?i:a==null||(o=a.locale)===null||o===void 0||(c=o.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&l!==void 0?l:p.firstWeekContainsDate)!==null&&r!==void 0?r:(m=p.locale)===null||m===void 0||(u=m.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),A=lE0(t,a),Z=new Date(0);Z.setUTCFullYear(A,0,f),Z.setUTCHours(0,0,0,0);var H=mH(Z,a);return H}var ld1=6048e5;function id1(t,a){ft(1,arguments);var n=R4(t),r=mH(n,a).getTime()-rd1(n,a).getTime();return Math.round(r/ld1)+1}function t8(t,a){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<a;)r="0"+r;return n+r}var Si={y:function(a,n){var r=a.getUTCFullYear(),l=r>0?r:1-r;return t8(n==="yy"?l%100:l,n.length)},M:function(a,n){var r=a.getUTCMonth();return n==="M"?String(r+1):t8(r+1,2)},d:function(a,n){return t8(a.getUTCDate(),n.length)},a:function(a,n){var r=a.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return r==="am"?"a.m.":"p.m."}},h:function(a,n){return t8(a.getUTCHours()%12||12,n.length)},H:function(a,n){return t8(a.getUTCHours(),n.length)},m:function(a,n){return t8(a.getUTCMinutes(),n.length)},s:function(a,n){return t8(a.getUTCSeconds(),n.length)},S:function(a,n){var r=n.length,l=a.getUTCMilliseconds(),i=Math.floor(l*Math.pow(10,r-3));return t8(i,n.length)}},Rc={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},od1={G:function(a,n,r){var l=a.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(l,{width:"abbreviated"});case"GGGGG":return r.era(l,{width:"narrow"});default:return r.era(l,{width:"wide"})}},y:function(a,n,r){if(n==="yo"){var l=a.getUTCFullYear(),i=l>0?l:1-l;return r.ordinalNumber(i,{unit:"year"})}return Si.y(a,n)},Y:function(a,n,r,l){var i=lE0(a,l),o=i>0?i:1-i;if(n==="YY"){var c=o%100;return t8(c,2)}return n==="Yo"?r.ordinalNumber(o,{unit:"year"}):t8(o,n.length)},R:function(a,n){var r=rE0(a);return t8(r,n.length)},u:function(a,n){var r=a.getUTCFullYear();return t8(r,n.length)},Q:function(a,n,r){var l=Math.ceil((a.getUTCMonth()+1)/3);switch(n){case"Q":return String(l);case"QQ":return t8(l,2);case"Qo":return r.ordinalNumber(l,{unit:"quarter"});case"QQQ":return r.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(l,{width:"narrow",context:"formatting"});default:return r.quarter(l,{width:"wide",context:"formatting"})}},q:function(a,n,r){var l=Math.ceil((a.getUTCMonth()+1)/3);switch(n){case"q":return String(l);case"qq":return t8(l,2);case"qo":return r.ordinalNumber(l,{unit:"quarter"});case"qqq":return r.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(l,{width:"narrow",context:"standalone"});default:return r.quarter(l,{width:"wide",context:"standalone"})}},M:function(a,n,r){var l=a.getUTCMonth();switch(n){case"M":case"MM":return Si.M(a,n);case"Mo":return r.ordinalNumber(l+1,{unit:"month"});case"MMM":return r.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(l,{width:"narrow",context:"formatting"});default:return r.month(l,{width:"wide",context:"formatting"})}},L:function(a,n,r){var l=a.getUTCMonth();switch(n){case"L":return String(l+1);case"LL":return t8(l+1,2);case"Lo":return r.ordinalNumber(l+1,{unit:"month"});case"LLL":return r.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(l,{width:"narrow",context:"standalone"});default:return r.month(l,{width:"wide",context:"standalone"})}},w:function(a,n,r,l){var i=id1(a,l);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):t8(i,n.length)},I:function(a,n,r){var l=nd1(a);return n==="Io"?r.ordinalNumber(l,{unit:"week"}):t8(l,n.length)},d:function(a,n,r){return n==="do"?r.ordinalNumber(a.getUTCDate(),{unit:"date"}):Si.d(a,n)},D:function(a,n,r){var l=ed1(a);return n==="Do"?r.ordinalNumber(l,{unit:"dayOfYear"}):t8(l,n.length)},E:function(a,n,r){var l=a.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(l,{width:"short",context:"formatting"});default:return r.day(l,{width:"wide",context:"formatting"})}},e:function(a,n,r,l){var i=a.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return t8(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(a,n,r,l){var i=a.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return t8(o,n.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(a,n,r){var l=a.getUTCDay(),i=l===0?7:l;switch(n){case"i":return String(i);case"ii":return t8(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(l,{width:"short",context:"formatting"});default:return r.day(l,{width:"wide",context:"formatting"})}},a:function(a,n,r){var l=a.getUTCHours(),i=l/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(a,n,r){var l=a.getUTCHours(),i;switch(l===12?i=Rc.noon:l===0?i=Rc.midnight:i=l/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(a,n,r){var l=a.getUTCHours(),i;switch(l>=17?i=Rc.evening:l>=12?i=Rc.afternoon:l>=4?i=Rc.morning:i=Rc.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(a,n,r){if(n==="ho"){var l=a.getUTCHours()%12;return l===0&&(l=12),r.ordinalNumber(l,{unit:"hour"})}return Si.h(a,n)},H:function(a,n,r){return n==="Ho"?r.ordinalNumber(a.getUTCHours(),{unit:"hour"}):Si.H(a,n)},K:function(a,n,r){var l=a.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(l,{unit:"hour"}):t8(l,n.length)},k:function(a,n,r){var l=a.getUTCHours();return l===0&&(l=24),n==="ko"?r.ordinalNumber(l,{unit:"hour"}):t8(l,n.length)},m:function(a,n,r){return n==="mo"?r.ordinalNumber(a.getUTCMinutes(),{unit:"minute"}):Si.m(a,n)},s:function(a,n,r){return n==="so"?r.ordinalNumber(a.getUTCSeconds(),{unit:"second"}):Si.s(a,n)},S:function(a,n){return Si.S(a,n)},X:function(a,n,r,l){var i=l._originalDate||a,o=i.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return oE0(o);case"XXXX":case"XX":return O5(o);default:return O5(o,":")}},x:function(a,n,r,l){var i=l._originalDate||a,o=i.getTimezoneOffset();switch(n){case"x":return oE0(o);case"xxxx":case"xx":return O5(o);default:return O5(o,":")}},O:function(a,n,r,l){var i=l._originalDate||a,o=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+iE0(o,":");default:return"GMT"+O5(o,":")}},z:function(a,n,r,l){var i=l._originalDate||a,o=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+iE0(o,":");default:return"GMT"+O5(o,":")}},t:function(a,n,r,l){var i=l._originalDate||a,o=Math.floor(i.getTime()/1e3);return t8(o,n.length)},T:function(a,n,r,l){var i=l._originalDate||a,o=i.getTime();return t8(o,n.length)}};function iE0(t,a){var n=t>0?"-":"+",r=Math.abs(t),l=Math.floor(r/60),i=r%60;if(i===0)return n+String(l);var o=a;return n+String(l)+o+t8(i,2)}function oE0(t,a){if(t%60===0){var n=t>0?"-":"+";return n+t8(Math.abs(t)/60,2)}return O5(t,a)}function O5(t,a){var n=a||"",r=t>0?"-":"+",l=Math.abs(t),i=t8(Math.floor(l/60),2),o=t8(l%60,2);return r+i+n+o}var cE0=function(a,n){switch(a){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});default:return n.date({width:"full"})}},sE0=function(a,n){switch(a){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});default:return n.time({width:"full"})}},cd1=function(a,n){var r=a.match(/(P+)(p+)?/)||[],l=r[1],i=r[2];if(!i)return cE0(a,n);var o;switch(l){case"P":o=n.dateTime({width:"short"});break;case"PP":o=n.dateTime({width:"medium"});break;case"PPP":o=n.dateTime({width:"long"});break;default:o=n.dateTime({width:"full"});break}return o.replace("{{date}}",cE0(l,n)).replace("{{time}}",sE0(i,n))},sd1={p:sE0,P:cd1},md1=["D","DD"],dd1=["YY","YYYY"];function ud1(t){return md1.indexOf(t)!==-1}function pd1(t){return dd1.indexOf(t)!==-1}function mE0(t,a,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(a,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(a,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(a,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(a,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var hd1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},fd1=function(a,n,r){var l,i=hd1[a];return typeof i=="string"?l=i:n===1?l=i.one:l=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+l:l+" ago":l};function HN(t){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=a.width?String(a.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var Ad1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},vd1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gd1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Zd1={date:HN({formats:Ad1,defaultWidth:"full"}),time:HN({formats:vd1,defaultWidth:"full"}),dateTime:HN({formats:gd1,defaultWidth:"full"})},Hd1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Md1=function(a,n,r,l){return Hd1[a]};function Pp(t){return function(a,n){var r=n!=null&&n.context?String(n.context):"standalone",l;if(r==="formatting"&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,o=n!=null&&n.width?String(n.width):i;l=t.formattingValues[o]||t.formattingValues[i]}else{var c=t.defaultWidth,m=n!=null&&n.width?String(n.width):t.defaultWidth;l=t.values[m]||t.values[c]}var u=t.argumentCallback?t.argumentCallback(a):a;return l[u]}}var Ed1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Vd1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yd1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},bd1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Sd1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Fd1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ld1=function(a,n){var r=Number(a),l=r%100;if(l>20||l<10)switch(l%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},_d1={ordinalNumber:Ld1,era:Pp({values:Ed1,defaultWidth:"wide"}),quarter:Pp({values:Vd1,defaultWidth:"wide",argumentCallback:function(a){return a-1}}),month:Pp({values:yd1,defaultWidth:"wide"}),day:Pp({values:bd1,defaultWidth:"wide"}),dayPeriod:Pp({values:Sd1,defaultWidth:"wide",formattingValues:Fd1,defaultFormattingWidth:"wide"})};function Op(t){return function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,l=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=a.match(l);if(!i)return null;var o=i[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],m=Array.isArray(c)?wd1(c,function(f){return f.test(o)}):kd1(c,function(f){return f.test(o)}),u;u=t.valueCallback?t.valueCallback(m):m,u=n.valueCallback?n.valueCallback(u):u;var p=a.slice(o.length);return{value:u,rest:p}}}function kd1(t,a){for(var n in t)if(t.hasOwnProperty(n)&&a(t[n]))return n}function wd1(t,a){for(var n=0;n<t.length;n++)if(a(t[n]))return n}function Cd1(t){return function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=a.match(t.matchPattern);if(!r)return null;var l=r[0],i=a.match(t.parsePattern);if(!i)return null;var o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var c=a.slice(l.length);return{value:o,rest:c}}}var Nd1=/^(\d+)(th|st|nd|rd)?/i,$d1=/\d+/i,Td1={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Pd1={any:[/^b/i,/^(a|c)/i]},Od1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xd1={any:[/1/i,/2/i,/3/i,/4/i]},Id1={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},jd1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Rd1={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Dd1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},zd1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Bd1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ud1={ordinalNumber:Cd1({matchPattern:Nd1,parsePattern:$d1,valueCallback:function(a){return parseInt(a,10)}}),era:Op({matchPatterns:Td1,defaultMatchWidth:"wide",parsePatterns:Pd1,defaultParseWidth:"any"}),quarter:Op({matchPatterns:Od1,defaultMatchWidth:"wide",parsePatterns:xd1,defaultParseWidth:"any",valueCallback:function(a){return a+1}}),month:Op({matchPatterns:Id1,defaultMatchWidth:"wide",parsePatterns:jd1,defaultParseWidth:"any"}),day:Op({matchPatterns:Rd1,defaultMatchWidth:"wide",parsePatterns:Dd1,defaultParseWidth:"any"}),dayPeriod:Op({matchPatterns:zd1,defaultMatchWidth:"any",parsePatterns:Bd1,defaultParseWidth:"any"})},qd1={code:"en-US",formatDistance:fd1,formatLong:Zd1,formatRelative:Md1,localize:_d1,match:Ud1,options:{weekStartsOn:0,firstWeekContainsDate:1}},Wd1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Gd1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Yd1=/^'([^]*?)'?$/,Kd1=/''/g,Qd1=/[a-zA-Z]/;function Xd1(t,a,n){var r,l,i,o,c,m,u,p,f,A,Z,H,V,b;ft(2,arguments);var S=String(a),_=cH(),k=(r=(l=void 0)!==null&&l!==void 0?l:_.locale)!==null&&r!==void 0?r:qd1,C=Bl((i=(o=(c=(m=void 0)!==null&&m!==void 0?m:void 0)!==null&&c!==void 0?c:_.firstWeekContainsDate)!==null&&o!==void 0?o:(u=_.locale)===null||u===void 0||(p=u.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var F=Bl((f=(A=(Z=(H=void 0)!==null&&H!==void 0?H:void 0)!==null&&Z!==void 0?Z:_.weekStartsOn)!==null&&A!==void 0?A:(V=_.locale)===null||V===void 0||(b=V.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&f!==void 0?f:0);if(!(F>=0&&F<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw new RangeError("locale must contain localize property");if(!k.formatLong)throw new RangeError("locale must contain formatLong property");var $=R4(t);if(!Qm1($))throw new RangeError("Invalid time value");var O=Ym1($),R=Xm1($,O),U={firstWeekContainsDate:C,weekStartsOn:F,locale:k,_originalDate:$},I=S.match(Gd1).map(function(K){var r0=K[0];if(r0==="p"||r0==="P"){var l0=sd1[r0];return l0(K,k.formatLong)}return K}).join("").match(Wd1).map(function(K){if(K==="''")return"'";var r0=K[0];if(r0==="'")return Jd1(K);var l0=od1[r0];if(l0)return pd1(K)&&mE0(K,a,String(t)),ud1(K)&&mE0(K,a,String(t)),l0(R,K,k.localize,U);if(r0.match(Qd1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r0+"`");return K}).join("");return I}function Jd1(t){var a=t.match(Yd1);return a?a[1].replace(Kd1,"'"):t}const dH=t=>{const[a,n,r]=t.split("-").map(Number);return new Date(a,n-1,r)},x5=t=>{const a=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${a}-${n}-${r}`},dE0=()=>x5(new Date),eu1=t=>t.id==="1st and 15th"?dH(pE0()):new Date,uE0=t=>{if(t.id==="1st and 15th")return dH(pE0());const a=new Date;return t.intervalUnit==="month"?qm1(a,t.intervalCount):Um1(a,t.intervalCount)},tu1=(t,a)=>{if(a.id==="1st and 15th"){const c=(t?dH(t):new Date).getDate();if(c!==1&&c!==15)return!1}if(!t)return!0;const n=eu1(a),r=x5(n),l=uE0(a),i=x5(l);return t>=r&&t<=i},pE0=()=>{const t=new Date,a=t.getDate(),n=t.getMonth(),r=t.getFullYear();if(a===1)return x5(t);if(a<=15){const l=new Date(r,n,15);return x5(l)}else{const l=new Date(r,n+1,1);return x5(l)}},hE0=t=>!t?.donationFunds||t.donationFunds.length===0?null:[...t.donationFunds].sort((n,r)=>(n.displayOrder??0)-(r.displayOrder??0))[0];function au1(t,a){if(!a?.donationFunds||a.donationFunds.length===0)return null;if(!t)return hE0(a);const n=a.donationFunds.find(o=>o.id===t.id);if(n)return n;if(t.parentFund){const o=a.donationFunds.find(c=>c.parentFund?.id===t.parentFund?.id);if(o)return o}const r=KC(t.name.replace(/_/g," ")),l=t.displayName?KC(t.displayName.replace(/_/g," ")):null,i=a.donationFunds.find(o=>!!(r&&Sn(r,o.name)||l&&Sn(l,o.name)||r&&o.displayName&&Sn(r,o.displayName)||l&&o.displayName&&Sn(l,o.displayName)));return i||hE0(a)}const Dc=t=>Number(t).toFixed(2),N6=t=>{if(typeof t=="string"){const a=parseFloat(t);return isNaN(a)?0:a}return t||0},uH=new Map,fE0=t=>typeof window>"u"?Promise.resolve(null):(uH.has(t)||uH.set(t,Promise.resolve().then(()=>Soe).then(({loadStripe:a})=>{if(!a)throw new Error("loadStripe function not available");return a(t)}).catch(a=>(console.error("Failed to load Stripe.js",a),uH.delete(t),null))),uH.get(t)),MN=({churchName:t,churchLogo:a,message:n,title:r,displayLogo:l,theme:i})=>{const o=l!=="false"&&a,c=r&&r.trim()!==""?r:null;return w.jsx(w.Fragment,{children:o||c||n?w.jsxs("div",{className:"px-6 py-6 text-center",children:[o?w.jsx("div",{className:"mb-3",children:w.jsx("div",{className:"w-20 h-20 rounded-full flex items-center justify-center mx-auto",style:{backgroundColor:i?.colors?.base?.primary||"rgb(var(--color-brand-primary))"},children:w.jsx("img",{src:a,alt:`${t} logo`,className:"max-w-[48px] max-h-[48px] object-contain"})})}):null,c?w.jsx(ve,{as:"h2",children:c}):null,c==="Enter Payment Info"?w.jsx(ve,{fg:"secondary",className:"text-sm sm:text-base mt-1",children:"Pay by bank account or credit card"}):n&&n!==""?w.jsx(ve,{className:"text-sm mt-2",fg:"secondary",children:n}):null]}):null})};MN.propTypes={churchName:e1.string.isRequired,churchLogo:e1.string,message:e1.string,title:e1.string,displayLogo:e1.string};const nu1=({onConfirm:t,onError:a,onReady:n,expressCheckoutOptions:r})=>{const l=qH0(),i=BH0(),o=async c=>{if(!l||!i){a(new Error("Stripe or Elements not available"));return}try{const{error:m}=await i.submit();if(m){a(m instanceof Error?m:new Error(m.message||"Payment submission failed"));return}const u={detail:{email:c.detail?.email,phone:c.detail?.phone,name:c.detail?.name}};await t(u,l,i)}catch(m){a(m instanceof Error?m:new Error("Payment failed"))}};return w.jsx(WH0,{options:r,onConfirm:o,onReady:n})};function ru1({isElementReady:t,elementsKey:a,stripePromise:n,elementsOptions:r,onConfirm:l,onError:i,onReady:o,expressCheckoutOptions:c}){return w.jsxs("div",{className:"mt-4 grid [&>*]:col-start-1 [&>*]:row-start-1",children:[w.jsx("div",{className:`h-[50px] flex items-center justify-center rounded-md bg-black dark:bg-white transition-opacity duration-200 ${t?"opacity-0":"opacity-100"}`,children:w.jsx(vr,{size:20,className:"animate-spin text-white dark:text-black"})}),w.jsx("div",{className:`transition-opacity duration-200 ${t?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"}`,children:w.jsx(WC,{stripe:n,options:r,children:w.jsx(nu1,{onConfirm:l,onError:m=>i({message:m.message}),onReady:o,expressCheckoutOptions:c})},a)})]})}function lu1(){const[t,a]=e.useState(()=>typeof document>"u"?"light":document.documentElement.classList.contains("dark")?"dark":"light");return e.useEffect(()=>{const n=new MutationObserver(()=>{const i=document.documentElement.classList.contains("dark");a(i?"dark":"light")});n.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]});const r=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>{!document.documentElement.classList.contains("dark")&&!document.documentElement.classList.contains("light")&&a(r.matches?"dark":"light")};return r.addEventListener("change",l),()=>{n.disconnect(),r.removeEventListener("change",l)}},[]),t}const AE0=({amount:t,selectedFrequency:a,selectedCampus:n,selectedFund:r,isRecurring:l,minimumAllowedAmount:i,initialPaymentIntentId:o,initialSetupIntentId:c,onIntentChanged:m,onError:u,onSuccess:p})=>{const[f,A]=e.useState(!1);e.useEffect(()=>{A(!0)},[]);const{currentChurch:Z}=Mp(),H=I9(),V=A91(),b=lu1(),[S]=GH0(),[_,k]=e.useState(null),[C,F]=e.useState(!1),[$,O]=e.useState(!1),[R,U]=e.useState(null),[I,K]=e.useState(0),[r0,l0]=e.useState(null),[J,X]=e.useState(!1),[y0,Z0]=e.useState(o??null),[o0,p0]=e.useState(c??null),Q=e.useRef(S);Q.current=S;const G=e.useRef(u);G.current=u;const t0=e.useRef(m);t0.current=m;const B=e.useRef(R);B.current=R,e.useEffect(()=>{const h0=Z?.stripeConnectAccount?.publishableKey;if(!h0){k(null),F(!1);return}const z=fE0(h0);k(z),z.then(q=>{F(!!q)}).catch(()=>{F(!1)})},[Z?.stripeConnectAccount?.publishableKey]);const M0=N6(t)>0&&n&&r&&(!l||a);e.useEffect(()=>{if(!M0||!C||!n||!r){U(null);return}const h0=N6(t);if(h0<=0||h0<i)return;let z=!1;const _0=setTimeout(()=>{if(z)return;X(!1),U(null);const Q0={amount:Math.round(h0*100),frequency:tM0(a),futureStartDate:aM0(a),campusId:n.id,fundId:r.id||null,paymentIntentId:y0,setupIntentId:o0,source:"EXPRESS_CHECKOUT"};Q.current({variables:{input:Q0}}).then(v1=>{if(z)return;if(v1.errors){G.current({message:v1.errors[0]?.message??"Failed to create payment intent"});return}const u1=v1.data?.createOrUpdateGiveIntent;u1?.clientSecret&&U(u1.clientSecret),u1?.onBehalfOf&&l0(u1.onBehalfOf),u1?.paymentIntentId&&Z0(u1.paymentIntentId),u1?.setupIntentId&&p0(u1.setupIntentId),K(N1=>N1+1),t0.current?.({paymentIntentId:u1?.paymentIntentId??null,setupIntentId:u1?.setupIntentId??null})}).catch(v1=>{z||G.current({message:v1?.message??"Failed to create payment intent"})})},!!(y0||o0)?500:0);return()=>{z=!0,clearTimeout(_0)}},[M0,C,t,i,n,r,a]);const E0=e.useMemo(()=>{if(!l||!a)return;const h0=Z?.name||"Church",z=Z?.givingWebUrl||(typeof window<"u"?window.location.href:"");return{recurringPaymentRequest:{paymentDescription:`${h0} ${a.id} donation`,managementURL:z,regularBilling:{amount:Math.round(N6(t)*100),label:`${a.id} donation`,recurringPaymentIntervalUnit:a.intervalUnit,recurringPaymentIntervalCount:a.intervalCount}}}},[l,a,t,Z?.name,Z?.givingWebUrl]),m0=e.useMemo(()=>{const h0=b==="dark";return{buttonHeight:50,buttonType:{applePay:"donate",googlePay:"donate"},buttonTheme:{applePay:h0?"white":"black",googlePay:h0?"white":"black"},paymentMethods:{applePay:"auto",googlePay:"auto",link:"never",paypal:"never",klarna:"never",amazonPay:"never"},emailRequired:!0,phoneNumberRequired:!0,billingAddressRequired:!0,...E0&&{applePay:E0}}},[b,E0]),O0=e.useMemo(()=>{const h0={light:{primary:V?.colors?.base?.primary||"#00676D",background:fe.colors.light.fill.screen,componentBackground:fe.colors.light.fill.paper,componentBorder:fe.colors.light.neutral.gray5,componentDivider:fe.colors.light.neutral.gray4,primaryText:fe.colors.light.text.primary,secondaryText:fe.colors.light.text.secondary,componentText:fe.colors.light.text.primary,icon:fe.colors.light.neutral.gray},dark:{primary:V?.colors?.base?.primary||"#00676D",background:fe.colors.dark.fill.screen,componentBackground:fe.colors.dark.fill.paper,componentBorder:fe.colors.dark.neutral.gray5,componentDivider:fe.colors.dark.neutral.gray4,primaryText:fe.colors.dark.text.primary,secondaryText:fe.colors.dark.text.secondary,componentText:fe.colors.dark.text.primary,icon:fe.colors.dark.neutral.gray}};return{theme:b==="dark"?"night":"stripe",variables:{colorPrimary:V?.colors?.base?.secondary||"#17B582",colorBackground:b==="dark"?h0.dark.componentBackground:h0.light.componentBackground,colorText:b==="dark"?h0.dark.primaryText:h0.light.primaryText,colorTextSecondary:b==="dark"?h0.dark.secondaryText:h0.light.secondaryText,colorTextPlaceholder:b==="dark"?h0.dark.secondaryText:h0.light.secondaryText,colorDanger:V?.colors?.base?.alert||"#FF4444",colorSuccess:V?.colors?.base?.success||"#17B582",colorWarning:V?.colors?.base?.warning||"#FFA500",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",fontSizeBase:"16px",spacingUnit:V?.space?.xxxs||"4px",borderRadius:V?.radii?.base||"6px",iconColor:b==="dark"?h0.dark.icon:h0.light.icon}}},[V,b]),a0=async(h0,z,q)=>{const n0=N6(t);if(!n0||n0<=0||!n||!r){u({message:"Please complete all required fields"});return}if(n0<i){u({message:`Please enter an amount of $${Dc(i)} or more`});return}if(l&&!a){u({message:"Please select a frequency"});return}if(!z||!q){u({message:"Stripe or Elements not available"});return}try{const g0=B.current;if(!g0)throw new Error("Payment intent not ready. Please try again.");const _0=g0.startsWith("seti_"),Q0={name:h0.detail?.name??void 0,email:h0.detail?.email??void 0,phone:h0.detail?.phone??void 0},v1={return_url:typeof window<"u"?window.location.href:"",...Q0.name??Q0.email??Q0.phone?{payment_method_data:{billing_details:Q0}}:{}};if(_0){const{error:N1,setupIntent:c1}=await z.confirmSetup({elements:q,clientSecret:g0,confirmParams:v1,redirect:"if_required"});if(N1)throw N1;if(!c1)throw new Error("Could not confirm setup intent");if(c1.status==="requires_action")throw new Error("Payment requires additional authentication");if(c1.status!=="succeeded")throw new Error(`Setup not successful. Status: ${c1.status}`)}else{const{error:N1,paymentIntent:c1}=await z.confirmPayment({elements:q,clientSecret:g0,confirmParams:v1,redirect:"if_required"});if(N1)throw N1;if(!c1)throw new Error("Could not confirm payment");if(c1.status!=="succeeded"&&c1.status!=="processing")throw c1.status==="requires_action"?new Error("Payment requires additional authentication"):new Error(`Payment not successful. Status: ${c1.status}`)}H.track("Donation Completed",{amount:n0,fund:r.id,campusId:n.id,is_recurring:l});const u1=h0.detail?.email||"";p&&typeof p=="function"&&p(u1)}catch(g0){console.error("Express checkout payment error:",g0);const _0=g0 instanceof Error?g0.message:"Express checkout payment failed";u({message:_0})}},u0=e.useMemo(()=>{if(!R)return null;if(l&&r0){const h0=Math.round(N6(t)*100);return h0<=0?null:{mode:"subscription",amount:h0,currency:"usd",appearance:O0,onBehalfOf:r0}}return{clientSecret:R,appearance:O0}},[R,O0,l,r0,t]);e.useEffect(()=>{if(M0&&C){const h0=setTimeout(()=>{O(!0)},50);return()=>clearTimeout(h0)}else O(!1)},[M0,C]);const A0=e.useMemo(()=>`${b}-${l?"subscription":"payment"}-${R??"loading"}-${I}`,[b,l,R,I]);if(!f)return null;const b0=M0&&_&&C&&u0;return w.jsx("div",{className:`transition-all duration-300 ease-out ${$?"opacity-100 translate-y-0":"opacity-0 -translate-y-2"}`,style:{transitionProperty:"opacity, transform"},"data-testid":b0?"donation-express-checkout":"express-checkout-slot",children:w.jsx("div",{className:"mt-4 min-h-[50px]","aria-hidden":!b0,children:b0&&u0?w.jsx(ru1,{isElementReady:J,elementsKey:A0,stripePromise:_,elementsOptions:u0,onConfirm:a0,onError:u,onReady:()=>X(!0),expressCheckoutOptions:m0}):null})})},iu1=(t,a)=>{const n=new iH("US").input(a),r=n.replace(/\D/gm,"").length<t.replace(/\D/gm,"").length,l=n.replace(/\D/gm,""),i=l.length;if(l.startsWith("1")&&i>11||!l.startsWith("1")&&i>10)return null;if(a.length<n.length&&n[n.length-1]===")")return n.slice(0,n.length-1);const o=jc(t,"US"),c=jc(n,"US");return o&&!c&&!r?null:n},ou1=t=>{const a=Dm1(t,"US");return a?a.formatNational():""},vE0=({amount:t,selectedFrequency:a,selectedCampusId:n,selectedFundId:r,selectedFundName:l,clientSecret:i,paymentIntentId:o,setupIntentId:c,paymentIntentError:m,onRetryPaymentIntent:u,onStripeReady:p,onSuccess:f,onError:A,isProcessing:Z=!1,onProcessingChange:H,onBack:V,userFullName:b,userEmail:S,userPhone:_,churchName:k,churchLogo:C,message:F,displayLogo:$,displayHeader:O})=>{const R=qH0(),U=BH0(),{currentChurch:I}=Mp(),{campuses:K}=YC(),r0=aW0();e.useEffect(()=>{R&&p?.()},[R,p]);const[l0,J]=e.useState(!1),[X,y0]=e.useState(b||""),[Z0,o0]=e.useState(S||""),[p0,Q]=e.useState(!1),t0=f91()==="dark";let M0=e.useContext(XC);if(!M0&&I?.theme)try{const T0=typeof I.theme=="string"?JSON.parse(I.theme):I.theme;T0?.colors?.secondary?M0={colors:{base:{secondary:T0.colors.secondary,primary:T0.colors.primary||T0.colors.secondary}}}:(T0?.colors?.base?.secondary,M0=T0)}catch{M0=null}const[E0,m0]=e.useState(_?ou1(_):""),O0=T0=>{const X0=T0.target.value,S0=iu1(E0,X0);S0&&m0(S0)},a0=X.trim()!==""&&Z0.trim()!==""&&jc(E0,"US")&&p0,u0=async T0=>{if(!a0){if(T0.preventDefault(),!p0&&U){const X0=U.getElement("payment");X0&&(X0.focus(),setTimeout(()=>{U.submit().catch(()=>{})},50));return}if(X.trim()===""&&!b){document.getElementById("fullName")?.focus();return}if(Z0.trim()===""&&!S){document.getElementById("email")?.focus();return}if(!jc(E0,"US")){document.getElementById("phoneNumber")?.focus();return}}},A0=Ep(a),b0=K.find(T0=>T0.id===n),h0=b0?.donationFunds?.find(T0=>T0.id===r),z=()=>{const T0={name:`${b0?.name||"Church"} Donation`,amount:Math.round(N6(t)*100)};return h0&&(T0.name=`${h0.displayName||h0.name} Donation`),[T0]},q=()=>!A0||!a?void 0:{recurringPaymentRequest:{paymentDescription:`${k} ${a.id} donation`,managementURL:I?.givingWebUrl||window.location.href,regularBilling:{amount:Math.round(N6(t)*100),label:`${a.id} donation`,recurringPaymentIntervalUnit:a.intervalUnit,recurringPaymentIntervalCount:a.intervalCount}}},n0=async T0=>{const{error:X0,paymentIntent:S0,setupIntent:P0}=T0;if(X0){const y1=new Error(X0.message||"Payment failed");throw A(y1),y1}const J0=S0||P0;return J0&&J0.status==="succeeded"?(r0("Donation Completed",{user_id:"",userId:Z0,group_id:I?.slug||"",email:Z0,phone:E0,is_logged_in:!1,amount:N6(t),fund:r||"",schedule:A0&&a?`${a.intervalCount} ${a.intervalUnit}`:"one-time",is_recurring:!!(A0&&a)}),typeof f=="function"&&f(Z0),!0):J0&&J0.status==="requires_action"?(typeof f=="function"&&f(Z0),!0):J0&&J0.status==="processing"?(r0("Donation Completed",{user_id:"",userId:Z0,group_id:I?.slug||"",email:Z0,phone:E0,is_logged_in:!1,amount:N6(t),fund:r||"",schedule:A0&&a?`${a.intervalCount} ${a.intervalUnit}`:"one-time",is_recurring:!!(A0&&a)}),typeof f=="function"&&f(Z0),!0):(A(new Error(`Payment not successful. Status: ${J0?.status||"unknown"}`)),!1)},g0=async(T0={})=>{if(!R||!U)throw new Error("Stripe or Elements not available");const{error:X0}=await U.submit();if(X0)throw new Error(X0.message||"Payment validation failed");const S0=U._lastSubmittedOptions?.clientSecret||i,P0=S0?.includes("seti_");try{sessionStorage.setItem("donation_email",Z0)}catch{}if(!P0&&S0){const{paymentIntent:y1}=await R.retrievePaymentIntent(S0);if(y1&&(y1.status==="processing"||y1.status==="succeeded"))return{paymentIntent:y1,error:null}}const J0={elements:U,redirect:"if_required",confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:{name:X,email:Z0,phone:E0},metadata:{amount:N6(t).toString(),frequency:a?a.id:"one-time",campusId:n||"",fundId:r||"",isRecurring:A0&&a?"true":"false",churchSlug:I?.slug||""}},...T0}};return P0?await R.confirmSetup(J0):await R.confirmPayment(J0)},_0=async T0=>{if(!R||!U)throw new Error("Stripe or Elements not available");try{const{error:X0}=await U.submit();if(X0)throw X0;const{error:S0,confirmationToken:P0}=await R.createConfirmationToken({elements:U,params:{payment_method_data:{billing_details:{email:T0.detail?.email,phone:T0.detail?.phone,name:T0.detail?.name},metadata:{amount:N6(t).toString(),frequency:a?a.id:"one-time",campusId:n||"",fundId:r||"",isRecurring:A0&&a?"true":"false",churchSlug:I?.slug||""}},return_url:window.location.href}});if(S0)throw S0;const J0=U._lastSubmittedOptions?.clientSecret||i,y1=J0?.includes("seti_"),Y1={clientSecret:J0,confirmParams:{confirmation_token:P0.id},redirect:"if_required"};return y1?await R.confirmSetup(Y1):await R.confirmPayment(Y1)}catch(X0){throw console.error("Express checkout payment error:",X0),X0}},Q0=async T0=>{if(T0.preventDefault(),!R||!U)return;if(!X.trim()){A(new Error("Please enter your full name"));return}if(!Z0.trim()){A(new Error("Please enter your email address"));return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(Z0)){A(new Error("Please enter a valid email address"));return}if(!jc(E0,"US")){A(new Error("Please enter a valid 10-digit phone number"));return}H(!0);let S0=!1;try{const P0=await g0();S0=await n0(P0)}catch(P0){A(P0 instanceof Error?P0:new Error("Payment failed"))}finally{S0||H(!1)}},v1=async T0=>{if(!R)return;r0("Apple Pay Button Tapped",{}),H(!0);let X0=!1;try{const S0=await _0(T0);X0=await n0(S0)}catch(S0){console.error("Express checkout payment error:",S0),A(S0 instanceof Error?S0:new Error("Express checkout payment failed"))}finally{X0||H(!1)}},u1=()=>{J(!0)},N1=I?.givingFullPlatform===!0?void 0:z(),c1=I?.givingFullPlatform===!0?void 0:q(),t1=I?.givingFullPlatform===!0?void 0:{emailRequired:!0,phoneNumberRequired:!0,lineItems:N1,applePay:c1,buttonType:{applePay:"donate",googlePay:"donate"},buttonTheme:{applePay:t0?"white":"black",googlePay:t0?"white":"black"},paymentMethods:{amazonPay:"never",applePay:"auto",googlePay:"auto",link:"never",paypal:"never",klarna:"never"}};return w.jsx("div",{className:"flex flex-col h-full min-h-[400px]","data-testid":"donation-payment-form",children:w.jsxs("form",{onSubmit:Q0,className:"h-full flex flex-col",children:[O!=="false"?w.jsx(MN,{churchName:k,churchLogo:C,message:F,title:"Enter Payment Info",displayLogo:$,theme:M0||void 0}):null,w.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:w.jsxs("div",{className:"space-y-4",children:[w.jsx("div",{className:"bg-system-regular dark:bg-system-regular-dark rounded-lg p-4",children:w.jsxs(ve,{className:"text-sm",fg:"secondary",children:["Gift of $",Dc(N6(t))," ",nM0(a)," to"," ",h0?.displayName||h0?.name||l||"..."," ",w.jsx("button",{type:"button",onClick:V,className:"bg-transparent border-none p-0 cursor-pointer hover:decoration-[rgb(var(--color-brand-secondary))]","data-secondary-link":!0,children:w.jsxs("span",{children:["(",w.jsx("span",{className:"underline text-[rgb(var(--color-brand-secondary))] decoration-[rgb(var(--color-brand-secondary)/50%)]",children:"edit details"}),")"]})})]})}),w.jsx(AE0,{amount:String(t),selectedFrequency:a,selectedCampus:b0||void 0,selectedFund:h0||void 0,isRecurring:A0,minimumAllowedAmount:.5,initialPaymentIntentId:o,initialSetupIntentId:c,onError:T0=>A(T0 instanceof Error?T0:new Error(T0.message||"Payment failed")),onSuccess:f}),w.jsx(mr,{children:w.jsx(Ld,{children:m?w.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[w.jsx("p",{className:"text-sm text-fg-secondary dark:text-fg-secondary-dark text-center",children:"Unable to load payment options. Please try again."}),u?w.jsx("button",{type:"button",onClick:u,className:"text-primary hover:underline text-sm font-medium",children:"Retry"}):null]}):R?w.jsx("div",{className:"min-h-[120px] py-2",children:w.jsx(r91,{onChange:T0=>Q(T0.complete),options:{layout:{type:"accordion",defaultCollapsed:!0},paymentMethodOrder:["us_bank_account","card"],wallets:{applePay:"never",googlePay:"never",link:"never"},fields:{billingDetails:{name:"never",email:"never",phone:"never",address:"auto"}}}})}):w.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2","data-testid":"payment-intent-loading-skeleton",children:[w.jsx(vr,{size:24,className:"animate-spin",weight:"bold"}),w.jsx(ve,{className:"text-sm",fg:"secondary",children:"Loading payment options…"})]})})}),w.jsxs(_x0,{className:"space-y-2",children:[b?w.jsx(o4,{type:"hidden",id:"fullName",name:"fullName",value:X,onChange:T0=>y0(T0.target.value),required:!0}):w.jsxs(Ob,{className:"[&>[data-slot=label]+[data-slot=control]]:mt-0",children:[w.jsx(pv,{htmlFor:"fullName",className:"!font-normal !text-gray-700 dark:!text-gray-300 block text-left",children:"Full Name"}),w.jsx(o4,{type:"text",id:"fullName",name:"fullName",value:X,onChange:T0=>y0(T0.target.value),required:!0,placeholder:"Enter your full name",className:"text-base sm:text-sm h-11 px-3 py-2"})]}),S?w.jsx(o4,{type:"hidden",id:"email",name:"email",value:Z0,onChange:T0=>o0(T0.target.value),required:!0}):w.jsxs(Ob,{className:"[&>[data-slot=label]+[data-slot=control]]:mt-0",children:[w.jsx(pv,{htmlFor:"email",className:"!font-normal !text-gray-700 dark:!text-gray-300 block text-left",children:"Email Address"}),w.jsx(o4,{type:"email",id:"email",name:"email",value:Z0,onChange:T0=>o0(T0.target.value),required:!0,placeholder:"Enter your email address",className:"text-base sm:text-sm h-11 px-3 py-2"})]}),_?w.jsx(o4,{type:"hidden",id:"phoneNumber",name:"phoneNumber",value:E0,onChange:O0,maxLength:16,required:!0}):w.jsxs(Ob,{className:"[&>[data-slot=label]+[data-slot=control]]:mt-0",children:[w.jsx(pv,{htmlFor:"phoneNumber",className:"!font-normal !text-gray-700 dark:!text-gray-300 block text-left",children:"Phone Number"}),w.jsx(o4,{type:"tel",id:"phoneNumber",name:"phoneNumber",value:E0,onChange:O0,required:!0,maxLength:16,placeholder:"(555) 555-5555",className:"text-base sm:text-sm h-11 px-3 py-2"})]})]})]})}),w.jsx("div",{className:"sticky bottom-0 z-10 p-4",children:I?.givingFullPlatform===!0?w.jsx("div",{className:"space-y-4",children:w.jsx(Je,{type:"submit",mode:"solid",className:"w-full",disabled:!R||Z,surface:a0?"solid":"system",...a0&&{"data-secondary-button":!0},onClick:u0,children:Z?w.jsx("div",{className:"flex items-center justify-center gap-2",children:w.jsx(vr,{size:20,className:"animate-spin",weight:"bold"})}):(()=>{if(!p0)return"Select Payment Method";if(!b&&X.trim()==="")return"Enter Name";if(!S&&Z0.trim()==="")return"Enter Email";if(!_&&!jc(E0,"US"))return"Enter Phone";const P0=Dc(N6(t));if(!A0||!a)return`Give $${P0}`;{const J0=a.startDate,y1=!J0||J0===dE0(),Y1=a.id||"";return y1?`Give $${P0} ${Y1}`:`Schedule $${P0} ${nM0(a)}`}})()})}):w.jsxs("div",{className:"space-y-4",style:{display:l0?"block":"none"},children:[w.jsx(WH0,{options:t1,onConfirm:v1,onReady:u1}),w.jsxs(Je,{href:I?.givingWebUrl,target:"_blank",rel:"noopener noreferrer",className:"w-full !rounded-[5px]",disabled:!R||Z,surface:"system",onClick:()=>{r0("Button Used",{label:"Other Payment Methods",action:"Tapped",component:"Button",component_url:I?.givingWebUrl||"",group_id:I?.slug||""})},children:[w.jsx(nE0,{size:20}),"Other Payment Methods"]})]})})]})})};vE0.propTypes={amount:e1.oneOfType([e1.string,e1.number]).isRequired,selectedFrequency:e1.object,selectedCampusId:e1.string,selectedFundId:e1.string,selectedFundName:e1.string,onSuccess:e1.func.isRequired,onError:e1.func.isRequired,isProcessing:e1.bool,onProcessingChange:e1.func.isRequired,onBack:e1.func.isRequired,churchName:e1.string.isRequired,churchLogo:e1.string,message:e1.string,displayLogo:e1.string,title:e1.string,displayHeader:e1.string};const cu1=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),e.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),EN=e.forwardRef((t,a)=>e.createElement(E,{ref:a,...t,weights:cu1}));EN.displayName="CaretDownIcon";const gE0=EN,su1=Object.freeze(Object.defineProperty({__proto__:null,CaretDown:gE0,CaretDownIcon:EN},Symbol.toStringTag,{value:"Module"})),mu1=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,36H48A20,20,0,0,0,28,56v56c0,54.29,26.32,87.22,48.4,105.29,23.71,19.39,47.44,26,48.44,26.29a12.1,12.1,0,0,0,6.32,0c1-.28,24.73-6.9,48.44-26.29,22.08-18.07,48.4-51,48.4-105.29V56A20,20,0,0,0,208,36Zm-4,76c0,35.71-13.09,64.69-38.91,86.15A126.28,126.28,0,0,1,128,219.38a126.14,126.14,0,0,1-37.09-21.23C65.09,176.69,52,147.71,52,112V60H204ZM79.51,144.49a12,12,0,1,1,17-17L112,143l47.51-47.52a12,12,0,0,1,17,17l-56,56a12,12,0,0,1-17,0Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M216,56v56c0,96-88,120-88,120S40,208,40,112V56a8,8,0,0,1,8-8H208A8,8,0,0,1,216,56Z",opacity:"0.2"}),e.createElement("path",{d:"M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.26,47,25.53a8,8,0,0,0,4.2,0c1-.27,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0ZM82.34,141.66a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32l-56,56a8,8,0,0,1-11.32,0Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.26,47,25.53a8,8,0,0,0,4.2,0c1-.27,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm-34.32,69.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,42H48A14,14,0,0,0,34,56v56c0,51.94,25.12,83.4,46.2,100.64,22.73,18.6,45.27,24.89,46.22,25.15a6,6,0,0,0,3.16,0c.95-.26,23.49-6.55,46.22-25.15C196.88,195.4,222,163.94,222,112V56A14,14,0,0,0,208,42Zm2,70c0,37.76-13.94,68.39-41.44,91.06A131.17,131.17,0,0,1,128,225.72a130.94,130.94,0,0,1-40.56-22.66C59.94,180.39,46,149.76,46,112V56a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2ZM172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.26,47,25.53a8,8,0,0,0,4.2,0c1-.27,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0ZM82.34,141.66a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32l-56,56a8,8,0,0,1-11.32,0Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,44H48A12,12,0,0,0,36,56v56c0,51.16,24.73,82.12,45.47,99.1,22.4,18.32,44.55,24.5,45.48,24.76a4,4,0,0,0,2.1,0c.93-.26,23.08-6.44,45.48-24.76,20.74-17,45.47-47.94,45.47-99.1V56A12,12,0,0,0,208,44Zm4,68c0,38.44-14.23,69.63-42.29,92.71A132.45,132.45,0,0,1,128,227.82a132.23,132.23,0,0,1-41.71-23.11C58.23,181.63,44,150.44,44,112V56a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Zm-41.17-10.83a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17Z"}))]]),VN=e.forwardRef((t,a)=>e.createElement(E,{ref:a,...t,weights:mu1}));VN.displayName="ShieldCheckIcon";const ZE0=VN,du1=Object.freeze(Object.defineProperty({__proto__:null,ShieldCheck:ZE0,ShieldCheckIcon:VN},Symbol.toStringTag,{value:"Module"})),uu1=({startDate:t,frequency:a,onStartDateChange:n,disabled:r=!1})=>{const l=e.useRef(null),i=e.useMemo(()=>dE0(),[]),o=e.useMemo(()=>uE0(a),[a]),c=x5(o),m=A=>{if(A===null)return"Today";const Z=dH(A);return Xd1(Z,"MMMM d, yyyy")},u=A=>{const Z=A.target.value;Z===i?n(null):Z&&n(Z)},p=()=>{if(!r&&l.current)try{l.current.focus(),l.current.showPicker()}catch{l.current?.focus()}},f=t||i;return w.jsxs("div",{children:[w.jsx(ve,{className:"mb-1 text-xs text-left",fg:"secondary",children:"Starting"}),w.jsxs("div",{className:"relative [&_[data-slot=control]]:!border-system-regular [&_[data-slot=control]]:dark:!border-system-regular-dark [&_input]:!border-system-regular [&_input]:dark:!border-system-regular-dark [&_input]:data-[hover]:!border-system-regular [&_input]:dark:data-[hover]:!border-system-regular-dark",children:[w.jsx(o4,{type:"text",value:m(t),readOnly:!0,onClick:p,disabled:r,className:"cursor-pointer h-[48px] pr-10"}),w.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-zinc-500 dark:text-zinc-400",children:w.jsx(l_,{size:18,color:"currentColor"})}),w.jsx("input",{ref:l,type:"date",value:f,min:i,max:c,onChange:u,disabled:r,tabIndex:-1,className:"absolute top-0 left-0 w-full h-full opacity-0 pointer-events-none"})]})]})},pu1=`
|
|
1828
1828
|
/* Custom selection color using brand theme color */
|
|
1829
1829
|
input::selection {
|
|
1830
1830
|
background-color: rgb(var(--color-brand-primary) / 0.3);
|
|
@@ -1834,7 +1834,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1834
1834
|
background-color: rgb(var(--color-brand-primary) / 0.3);
|
|
1835
1835
|
color: inherit;
|
|
1836
1836
|
}
|
|
1837
|
-
`,hu1=({amount:t="0",selectedFrequency:a=null,selectedCampus:n=null,selectedFund:r=null,predefinedAmounts:l="",onError:i,isProcessing:o=!1,onShowPayment:c,onSuccess:m,onAmountChange:u,onFrequencyChange:p,onCampusChange:f,onFundChange:A,onStartDateChange:Z,churchName:H,churchLogo:V,message:b,displayLogo:S,title:_,displayHeader:k})=>{const{currentChurch:C}=Mp(),F=I9(),$=YH0(),{campuses:O,loading:R}=YC(),U=O.filter(q=>q.donationFunds&&q.donationFunds.length>0),I=q=>{if(q.digital)return"Online";const n0=[];return q.street1&&n0.push(q.street1),q.city&&n0.push(q.city),q.state&&n0.push(q.state),q.postalCode&&n0.push(q.postalCode),n0.length>0?n0.join(", "):""},[K,r0]=e.useState(Ep(a)),l0=a?Ep(a):K,X=["crossroads","crossroads_sandbox"].includes(C?.slug??"")?1:.5,[y0,Z0]=e.useState(!1),o0=e.useRef(null),p0=e.useRef(null),Q=e.useRef(null),G=e.useRef(null),t0=e.useRef(null),B=l?l.split(",").map(q=>q.trim()).filter(q=>q):[];e.useEffect(()=>{F.page("Donate screen viewed",{path:"/donate",church_slug:C?.slug||""})},[F,C?.slug]),e.useEffect(()=>{a&&r0(Ep(a))},[a]),e.useEffect(()=>{K&&o0.current&&Q.current&&setTimeout(()=>{const q=Q.current,n0=o0.current;if(q&&n0){const g0=q.getBoundingClientRect();n0.getBoundingClientRect().bottom>g0.bottom&&n0.scrollIntoView({behavior:"smooth",block:"nearest"})}},100)},[K]),e.useEffect(()=>{n&&p0.current&&Q.current&&setTimeout(()=>{const q=Q.current,n0=p0.current;if(q&&n0){const g0=q.getBoundingClientRect();n0.getBoundingClientRect().bottom>g0.bottom&&n0.scrollIntoView({behavior:"smooth",block:"nearest"})}},100)},[n]);const[M0,E0]=e.useState(80),m0=e.useRef(null);e.useEffect(()=>{m0.current&&(m0.current.textContent=t||"0",E0(Math.max(m0.current.offsetWidth+16,80)))},[t]),e.useEffect(()=>{const q=setTimeout(()=>{m0.current&&(m0.current.textContent=t||"0",E0(Math.max(m0.current.offsetWidth+16,80)))},10);return()=>clearTimeout(q)},[t]);const O0=q=>{const n0=parseFloat(q);return!isNaN(n0)&&n0>999999.99},a0=q=>{let n0=q.replace(/[^0-9.]/g,"");if(n0.includes(".")){const g0=n0.split(".");g0.length>2&&(n0=g0[0]+"."+g0.slice(1).join("")),g0[1]&&g0[1].length>2&&(n0=g0[0]+"."+g0[1].substring(0,2))}return n0.length>1&&n0[0]==="0"&&n0[1]!=="."&&(n0=n0.substring(1)),O0(n0)?t:(n0==="."&&(n0="0."),u?.(n0),n0)},u0=q=>{const n0=O.find(g0=>g0.id===q);if(n0){const g0={...n0,donationFunds:n0.donationFunds?n0.donationFunds.map(Q0=>({...Q0})):[]};f?.(g0);const _0=au1(r,g0);A?.(_0)}else f?.(null),A?.(null)},A0=q=>{if(!n)return;const n0=n.donationFunds?.find(g0=>g0.id===q);A?.(n0?{...n0}:null)},b0=q=>{const g0=Oc.find(_0=>_0.id===q)||null;g0&&a?.startDate&&(tu1(a.startDate,g0)||Z?.(null)),p?.(g0)},h0=q=>{Z?.(q)},z=()=>{const q=N6(t);if(!q||q<=0){setTimeout(()=>{G.current&&(G.current.focus(),G.current.select(),G.current.scrollIntoView({behavior:"smooth",block:"center"}))},100);return}if(q<X){i({message:`Please enter an amount of $${Dc(X)} or more`}),setTimeout(()=>{G.current&&(G.current.focus(),G.current.select(),G.current.scrollIntoView({behavior:"smooth",block:"center"}))},100);return}if(!n){Z0(!0);return}if(!r){requestAnimationFrame(()=>{requestAnimationFrame(()=>{const n0=document.querySelector("[data-fund-dropdown-button]");n0&&(n0.scrollIntoView({behavior:"smooth",block:"center"}),n0.focus({preventScroll:!0}))})});return}if(l0&&!a){setTimeout(()=>{t0.current&&(t0.current.focus(),t0.current.scrollIntoView({behavior:"smooth",block:"center"}))},100);return}F.track("Donation Started",{amount:q,fund:r?.id||"",campusId:n?.id||"",is_recurring:l0}),c&&c()};return w.jsxs("div",{className:"flex flex-col h-full","data-testid":"donation-setup-form",children:[w.jsx("style",{children:pu1}),k!=="false"?w.jsx(MN,{churchName:H,churchLogo:V,message:b,title:_,displayLogo:S,theme:$||void 0}):null,w.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-6",ref:Q,children:w.jsxs("div",{className:"space-y-4",children:[w.jsx("div",{className:"flex flex-col items-center",children:w.jsxs("button",{type:"button",onClick:()=>Z0(!0),disabled:o||R,className:"flex items-center gap-1 text-fg-primary dark:text-fg-primary-dark hover:opacity-70 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed",children:[C?.logo?w.jsx("div",{className:"w-6 h-6 rounded-full overflow-hidden flex-shrink-0 flex items-center justify-center p-1",style:{backgroundColor:$?.colors?.base?.primary||"rgb(var(--color-brand-primary, 0 103 109))"},children:w.jsx("img",{src:C.logo,alt:`${H} logo`,className:"w-full h-full object-contain"})}):null,w.jsx("span",{className:"text-base font-medium",children:n?.name||"Select a Location"}),w.jsx(gE0,{size:16,weight:"bold",className:"flex-shrink-0",style:{color:$?.colors?.base?.secondary||"rgb(var(--color-brand-secondary, 23 181 130))"}})]})}),w.jsxs("div",{className:"",children:[w.jsxs("div",{className:Q1("flex items-start justify-center text-[60px] font-bold leading-none min-h-[60px] transition-opacity",(o||R)&&"opacity-60"),children:[w.jsx("span",{className:"text-3xl leading-normal font-bold mt-3 flex-none text-primary dark:text-white",children:"$"}),w.jsx("span",{ref:m0,className:"absolute invisible h-0 overflow-hidden whitespace-pre text-[80px] font-bold font-inherit p-0 m-0",style:{fontFamily:"inherit",position:"absolute",left:"-9999px",top:"-9999px"},children:t||"0"}),w.jsx("input",{ref:G,type:"text",inputMode:"decimal",placeholder:"0",value:t,onKeyDown:q=>{if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].includes(q.key)){if(/^[0-9]$/.test(q.key)||q.key==="."||q.ctrlKey||q.metaKey){if(q.key==="."&&t.includes(".")){q.preventDefault();return}if(/^[0-9]$/.test(q.key)){const n0=q.target,g0=n0.value,_0=n0.selectionStart||0,Q0=g0.substring(0,_0)+q.key+g0.substring(n0.selectionEnd||0);if(O0(Q0)){q.preventDefault();return}}return}q.preventDefault()}},onChange:q=>{const n0=q.target.value,g0=a0(n0);requestAnimationFrame(()=>{if(m0.current){const _0=g0??t;m0.current.textContent=_0||"0";const Q0=Math.max(m0.current.offsetWidth+16,80);E0(Q0)}})},onInput:q=>{const n0=q.target.value;if(m0.current){m0.current.textContent=n0||"0";const g0=Math.max(m0.current.offsetWidth+16,80);E0(g0)}},onKeyUp:q=>{const n0=q.target.value;if(m0.current){m0.current.textContent=n0||"0";const g0=Math.max(m0.current.offsetWidth+16,80);E0(g0)}},onFocus:q=>{setTimeout(()=>{q.target.select()},0)},onBlur:()=>{const q=N6(t);q>0&&u?.(Dc(q))},onClick:q=>{q.target.select()},disabled:o||R,className:"text-[80px] font-bold border-none outline-none bg-transparent flex-none p-0 m-0 text-primary dark:text-white caret-current text-center appearance-none transition-[width] duration-100 ease-in-out",style:{width:`${M0}px`}})]}),B&&B.length>0?w.jsx("div",{className:"flex flex-wrap pt-12",style:{gap:"6px"},children:B.map(q=>w.jsxs(Je,{onClick:()=>a0(q),disabled:o||R,surface:t===q?"solid":"system",className:"min-w-0 flex-1",style:{flexBasis:"calc(25% - 4.5px)",minWidth:"0",...t===q&&{"--btn-bg":"rgb(var(--color-brand-primary))","--btn-hover-overlay":"rgb(255 255 255 / 15%)"}},children:["$",q]},q))}):null]}),n?w.jsx("div",{ref:p0,className:"flex flex-col items-center",children:n.donationFunds&&n.donationFunds.length>0?w.jsxs(Cb,{children:[w.jsxs(Ax0,{disabled:o,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-system-regular dark:bg-system-regular-dark font-semibold focus:outline focus:outline-2 focus:outline-offset-4",style:{outlineColor:$?.colors?.base?.secondary||"#17B582"},"data-fund-dropdown-button":!0,children:[w.jsx("span",{children:r?.displayName||r?.name||"Select a fund"}),w.jsx(dr,{size:16,weight:"bold"})]}),w.jsx(Nb,{className:"!z-30",children:n.donationFunds?.sort((q,n0)=>(q.displayOrder||0)-(n0.displayOrder||0)).map(q=>w.jsx(Sl,{onClick:()=>A0(q.id),children:q.displayName||q.name},q.id))})]}):w.jsx("div",{className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-system-regular dark:bg-system-regular-dark font-semibold text-fg-secondary dark:text-fg-secondary-dark",children:w.jsx("span",{children:"No funds available"})})}):null,w.jsx("div",{className:Q1("relative block w-full h-[48px] rounded-lg before:absolute before:inset-px before:rounded-[calc(theme(borderRadius.lg)-1px)] before:bg-white before:shadow-[0_1px_2px_0_rgba(0,0,0,0.07),0_1px_1px_-1px_rgba(0,0,0,0.08)] before:pointer-events-none dark:before:hidden bg-transparent dark:bg-white/5",(o||R)&&"opacity-50"),children:w.jsxs("div",{className:"relative z-10 flex items-center justify-between h-full rounded-lg border border-system-thin dark:border-system-thin-dark px-[calc(theme(spacing[3.5])-1px)] py-[calc(theme(spacing[2.5])-1px)] sm:px-[calc(theme(spacing[3])-1px)] sm:py-[calc(theme(spacing[1.5])-1px)]",children:[w.jsx(ve,{className:"text-base/6 text-fg-primary dark:text-fg-primary-dark sm:text-sm/6",children:"Make Recurring"}),w.jsxs(sx0,{checked:K,onChange:q=>{r0(q),q||p?.(null)},disabled:o||R,className:Q1("inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-action disabled:opacity-50 disabled:cursor-not-allowed",l0?"bg-action":"bg-system-regular dark:bg-system-regular-dark"),children:[w.jsx("span",{className:"sr-only",children:"Make Recurring"}),w.jsx("span",{"aria-hidden":"true",className:Q1("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",l0?"translate-x-5":"translate-x-0")})]})]})}),K?w.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[w.jsxs("div",{ref:o0,className:"[&_[data-slot=control]]:h-[48px] [&_select]:h-full [&_select]:flex [&_select]:items-center",children:[w.jsx(ve,{className:"mb-1 text-xs text-left",fg:"secondary",children:"Frequency"}),w.jsxs(eI0,{ref:t0,value:a?.id||"",onChange:q=>b0(q.target.value),disabled:o||R,required:!0,surface:"system",className:"focus-within:outline focus-within:outline-2 focus-within:outline-offset-2 focus-within:rounded-lg",style:{outlineColor:$?.colors?.base?.secondary||"#17B582"},children:[w.jsx("option",{value:"",children:"Select a frequency"}),Oc.map(q=>w.jsx("option",{value:q.id,children:q.id},q.id))]})]}),w.jsx("div",{children:w.jsx(uu1,{startDate:a?.startDate??null,frequency:a||Oc[2],onStartDateChange:h0,disabled:o||R})})]}):null]})}),w.jsxs("div",{className:"sticky bottom-0 z-10 px-6 py-4",children:[w.jsx(Je,{type:"button",className:"w-full py-3",onClick:z,disabled:o||R,surface:N6(t)>0&&n&&r&&(!l0||a)?"solid":"system","data-secondary-button":N6(t)>0&&n&&r&&(!l0||a)?!0:void 0,children:o?w.jsx("div",{className:"flex items-center justify-center gap-2",children:w.jsx(vr,{size:20,className:"animate-spin",weight:"bold"})}):N6(t)<=0?"To Give, Enter Amount":n?r?l0&&!a?"Next: Select Frequency":`Give $${Dc(N6(t))}${l0&&a?` ${a.id}`:""}`:"Next: Select Fund":"Next: Select Location"}),w.jsx(AE0,{amount:t,selectedFrequency:a,selectedCampus:n,selectedFund:r,isRecurring:l0,minimumAllowedAmount:X,onError:i,onSuccess:m}),w.jsxs("div",{className:"text-center mt-4 px-6 space-y-3",children:[w.jsxs(ve,{className:"text-sm text-fg-secondary dark:text-fg-secondary-dark",children:["Powered by"," ",w.jsx("a",{href:"https://apollos.com",target:"_blank",rel:"noopener noreferrer",className:"underline","data-footer-link":!0,children:"Apollos"}),". By making this gift, I agree to the Apollos"," ",w.jsx("a",{href:"https://apollos.com/terms",target:"_blank",rel:"noopener noreferrer",className:"underline","data-footer-link":!0,children:"Terms of Service"})," ","and"," ",w.jsx("a",{href:"https://apollos.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline","data-footer-link":!0,children:"Privacy Policy"}),"."]}),w.jsxs("div",{className:"inline-flex items-center justify-center gap-2 px-3 py-2 rounded-lg bg-white dark:bg-system-regular-dark",children:[w.jsx(ZE0,{size:16,color:"#17B582",className:"flex-shrink-0",weight:"bold"}),w.jsx(ve,{className:"text-sm font-light",fg:"secondary",children:"Secure & Encrypted"})]})]})]}),w.jsx(Hx0,{open:y0,onClose:()=>Z0(!1),className:"!max-w-2xl !max-h-[90vh] !p-0 flex flex-col",children:w.jsxs("div",{className:"flex flex-col max-h-[90vh]",children:[w.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-system-regular dark:border-system-regular-dark flex-shrink-0",children:[w.jsx(Mx0,{children:"Location"}),w.jsx(Je,{type:"button",onClick:()=>Z0(!1),surface:"system",className:"p-2",children:w.jsx(ni,{size:20})})]}),w.jsx(Ex0,{className:"flex-1 overflow-y-auto px-6 py-4 !mt-0 min-h-0",children:R?w.jsx("div",{className:"flex items-center justify-center py-8",children:w.jsx(ve,{fg:"secondary",children:"Loading..."})}):w.jsx(Gx0,{value:n?.id||"",onChange:q=>u0(q),className:"space-y-3",children:U.map(q=>{const n0=I(q);return w.jsxs(Yx0,{variant:"card",children:[w.jsx(Xx0,{value:q.id}),w.jsxs(pv,{className:"!flex !flex-col !items-start !p-4 !gap-0",children:[w.jsx("span",{className:"font-semibold text-base text-fg-primary dark:text-fg-primary-dark",children:q.name}),n0?w.jsx("span",{className:"text-sm text-fg-secondary dark:text-fg-secondary-dark mt-0.5",children:n0}):null]})]},q.id)})})}),w.jsx(Vx0,{className:"!mt-0 !flex-col border-t border-system-regular dark:border-system-regular-dark px-6 py-4 [&>*]:!w-full",children:w.jsx(Je,{type:"button",onClick:()=>Z0(!1),surface:n?"solid":"system","data-secondary-button":n?!0:void 0,className:"w-full",children:"Done"})})]})})]})},HE0=({onRetry:t,email:a})=>w.jsx("div",{className:"text-center p-6 flex flex-col items-center",children:w.jsxs("div",{className:"flex flex-col items-stretch gap-8",children:[w.jsx("div",{className:"self-center",children:w.jsx(cg,{size:64,color:"#22c55e",weight:"fill"})}),w.jsxs("div",{className:"flex flex-col items-center gap-1",children:[w.jsx(ve,{as:"h3",children:"Thank you for your gift!"}),a&&w.jsxs(ve,{fg:"secondary",children:["We've sent a confirmation to ",a]})]}),w.jsx("div",{className:"w-full",children:w.jsx(Je,{surface:"solid",onClick:t,className:"w-full","data-secondary-button":!0,children:"Give Again"})})]})});HE0.propTypes={onRetry:e1.func.isRequired,email:e1.string.isRequired};const fu1=({amount:t="0",frequency:a,message:n="",campus:r="",fund:l="",predefinedAmounts:i="",width:o="",height:c="",displayLogo:m="",title:u="",displayHeader:p="",prefilledPayment:f=null,userFirstName:A=null,userLastName:Z=null,userEmail:H=null,userPhone:V=null,currentUser:b=null,onAuthRequired:S,onOnboardingRequired:_,onClearParams:k,onGiveAgain:C})=>{const F=o1=>typeof o1=="string"&&parseFloat(o1)>0,$=o1=>typeof o1=="string"&&o1.trim().length>0,O=o1=>o1===null||typeof o1=="string"&&o1.trim().length>0,R=o1=>o1==null||typeof o1=="object"&&!!o1.id,U=e.useCallback(o1=>o1?F(o1.amount)&&$(o1.campusId)&&O(o1.fundId||null)&&R(o1.selectedFrequency):!1,[]),[I,K]=e.useState("setup"),[r0,l0]=e.useState(""),[J,X]=e.useState(null),[y0,Z0]=e.useState(null),[o0,p0]=e.useState(null),[Q,G]=e.useState(null),[t0,B]=e.useState(null),[M0,E0]=e.useState(!1),[m0,O0]=e.useState(null),[a0,u0]=e.useState(()=>({amount:t,selectedFrequency:eN(a),selectedCampusId:r||null,selectedFundId:l||null,selectedCampus:null,selectedFund:null})),[A0,b0]=e.useState(!1);e.useEffect(()=>{f&&f.amount&&f.campusId&&u0({amount:f.amount,selectedFrequency:f.selectedFrequency??null,selectedCampusId:f.campusId,selectedFundId:f.fundId??null,selectedCampus:null,selectedFund:null})},[f]);const h0=e.useRef({amount:t,campus:r,fund:l}),{currentChurch:z,loading:q,error:n0}=Mp(),{campuses:g0}=YC(),{matchedCampus:_0,matchedFund:Q0}=s91(g0,a0.selectedCampusId,a0.selectedFundId),v1=h91(),u1=YH0(),N1=e.useMemo(()=>{const o1={light:{primary:u1?.colors?.base?.primary||"#00676D",background:fe.colors.light.fill.screen,componentBackground:fe.colors.light.fill.paper,componentBorder:fe.colors.light.neutral.gray5,componentDivider:fe.colors.light.neutral.gray4,primaryText:fe.colors.light.text.primary,secondaryText:fe.colors.light.text.secondary,componentText:fe.colors.light.text.primary,icon:fe.colors.light.neutral.gray},dark:{primary:u1?.colors?.base?.primary||"#00676D",background:fe.colors.dark.fill.screen,componentBackground:fe.colors.dark.fill.paper,componentBorder:fe.colors.dark.neutral.gray5,componentDivider:fe.colors.dark.neutral.gray4,primaryText:fe.colors.dark.text.primary,secondaryText:fe.colors.dark.text.secondary,componentText:fe.colors.dark.text.primary,icon:fe.colors.dark.neutral.gray}};return{theme:v1==="dark"?"night":"stripe",variables:{colorPrimary:u1?.colors?.base?.secondary||"#17B582",colorBackground:v1==="dark"?o1.dark.componentBackground:o1.light.componentBackground,colorText:v1==="dark"?o1.dark.primaryText:o1.light.primaryText,colorTextSecondary:v1==="dark"?o1.dark.secondaryText:o1.light.secondaryText,colorTextPlaceholder:v1==="dark"?o1.dark.secondaryText:o1.light.secondaryText,colorDanger:u1?.colors?.base?.alert||"#FF4444",colorSuccess:u1?.colors?.base?.success||"#17B582",colorWarning:u1?.colors?.base?.warning||"#FFA500",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",fontSizeBase:"16px",spacingUnit:u1?.space?.xxxs||"4px",borderRadius:u1?.radii?.base||"6px",iconColor:v1==="dark"?o1.dark.icon:o1.light.icon}}},[u1,v1]);e.useEffect(()=>{const o1=z?.stripeConnectAccount?.publishableKey;if(!o1){O0(null);return}const C1=fE0(o1);O0(C1)},[z?.stripeConnectAccount?.publishableKey]),e.useEffect(()=>{if(!f)if(a!==void 0)u0(o1=>({...o1,selectedFrequency:eN(a)}));else if(z?.givingDefaultFrequency){const o1=v91(z.givingDefaultFrequency,Oc.map(_e=>_e.id)),C1=o1&&Oc.find(_e=>_e.id===o1)||null;u0(_e=>({..._e,selectedFrequency:C1}))}else u0(o1=>({...o1,selectedFrequency:null}))},[z?.givingDefaultFrequency,f,a]),e.useEffect(()=>{!f&&t!==h0.current.amount&&t!==a0.amount&&u0(o1=>({...o1,amount:t})),h0.current.amount=t},[t,a0.amount,f]),e.useEffect(()=>{!f&&r!==h0.current.campus&&r!==a0.selectedCampusId&&u0(o1=>({...o1,selectedCampusId:r||null,selectedCampus:null,selectedFund:null,selectedFundId:null})),h0.current.campus=r},[r,a0.selectedCampusId,f]),e.useEffect(()=>{!f&&l!==h0.current.fund&&l!==a0.selectedFundId&&u0(o1=>({...o1,selectedFundId:l||null,selectedFund:null})),h0.current.fund=l},[l,a0.selectedFundId,f]),e.useEffect(()=>{if(!f&&a0.selectedFundId&&a0.selectedCampus?.donationFunds&&!a0.selectedFund){let o1=a0.selectedCampus.donationFunds.find(C1=>C1.id===a0.selectedFundId);o1||(o1=a0.selectedCampus.donationFunds.find(C1=>Sn(a0.selectedFundId,C1.name)||C1.displayName&&Sn(a0.selectedFundId,C1.displayName))),o1&&u0(C1=>({...C1,selectedFund:{...o1}}))}},[f,a0.selectedFundId,a0.selectedCampus?.donationFunds,a0.selectedFund]),e.useEffect(()=>{if(!a0.selectedCampus&&_0){const o1={..._0,donationFunds:_0.donationFunds?_0.donationFunds.map(C1=>({...C1})):[]};u0(C1=>({...C1,selectedCampus:o1,selectedCampusId:o1.id,selectedFund:Q0?{...Q0}:C1.selectedFund}))}},[_0,Q0,a0.selectedCampus]);const[c1,{loading:t1}]=GH0(),T0=e.useCallback(o1=>{B(o1),K("success")},[]),X0=e.useCallback(o1=>{l0(o1.message)},[]),S0=e.useCallback(()=>{l0("")},[]),P0=e.useCallback(()=>{if(C){C();return}if(K("setup"),l0(""),X(null),p0(null),G(null),b0(!1),B(null),u0({amount:t,selectedFrequency:eN(a),selectedCampusId:null,selectedFundId:null,selectedCampus:null,selectedFund:null}),E0(!1),k)k();else if(typeof window<"u"){const o1=new URL(window.location.href);o1.search="",window.history.replaceState({},"",o1.pathname)}},[C,t,a,k]),J0=e.useCallback(o1=>{u0(C1=>({...C1,amount:o1}))},[]),y1=e.useCallback(o1=>{u0(C1=>{const _e=o1?{...o1,startDate:C1.selectedFrequency?.startDate}:null;return{...C1,selectedFrequency:_e}})},[]),Y1=e.useCallback(o1=>{u0(C1=>({...C1,selectedFrequency:C1.selectedFrequency?{...C1.selectedFrequency,startDate:o1??void 0}:null}))},[]),r1=e.useCallback(o1=>{u0(C1=>({...C1,selectedCampus:o1,selectedCampusId:o1?.id||null,selectedFund:null,selectedFundId:null}))},[]),_1=e.useCallback(o1=>{u0(C1=>({...C1,selectedFund:o1,selectedFundId:o1?.id||null}))},[]),$1=e.useCallback(async(o1,C1,_e,_2,Z8)=>{if(!b&&S){S({amount:o1,frequency:C1,campusId:_e,fundId:_2,startDate:Z8});return}if(b&&!b.connectedChurchProfile?.id&&_){_({amount:o1,frequency:C1,campusId:_e,fundId:_2,startDate:Z8});return}try{const Y8=a0.selectedFrequency,f2={amount:Math.round(o1*100),frequency:tM0(Y8),futureStartDate:aM0(Y8),campusId:_e||"",fundId:_2||null,paymentIntentId:o0,setupIntentId:Q},{data:L8,errors:I8}=await c1({variables:{input:f2}});if(I8)throw new Error(I8[0].message);const c2=L8?.createOrUpdateGiveIntent;if(c2?.clientSecret)X(c2.clientSecret),Z0(c2.customerSecret??null),c2.paymentIntentId&&p0(c2.paymentIntentId),c2.setupIntentId&&G(c2.setupIntentId),K("payment");else throw new Error("No client secret received from server")}catch(Y8){X0(Y8)}},[c1,X0,b,S,_,a0.selectedFrequency]),He=e.useCallback(()=>{K("setup"),X(null),Z0(null)},[]),me={width:o?isNaN(Number(o))?o:`${o}px`:"100%",height:c?isNaN(Number(c))?c:`${c}px`:"500px",maxWidth:o?void 0:"400px",margin:o?"0":"0 auto",border:"none",position:"relative",overflow:"hidden",padding:0};if(e.useEffect(()=>{f&&U(f)&&!q&&!t1&&!A0&&I==="setup"&&(b0(!0),u0({amount:f.amount,selectedFrequency:f.selectedFrequency??null,selectedCampusId:f.campusId,selectedFundId:f.fundId??null,selectedCampus:null,selectedFund:null}),$1(parseFloat(f.amount),eM0(f.selectedFrequency),f.campusId,f.fundId??"",f.startDate??null))},[f,q,t1,A0,I,$1,U]),n0)return w.jsx("div",{style:me,className:"flex flex-col h-full",children:w.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center p-3",children:[w.jsx(ve,{fg:"secondary",className:"text-center px-8",children:"Unable to load church information. Please try again later."}),w.jsx(Je,{surface:"tinted",onClick:P0,className:"mt-2",children:"Try Again"})]})});if(!q&&z&&z.givingEnabled===!1)return w.jsx("div",{style:me,className:"flex flex-col h-full",children:w.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center p-3 space-y-2",children:[w.jsx(wH0,{size:32,weight:"duotone"}),w.jsx(ve,{fg:"secondary",className:"text-center px-8",children:"Online giving is closed. For questions, please contact support."}),w.jsx(Je,{href:"mailto:support@apollos.app",surface:"tinted",className:"mt-2",children:"Contact Us"})]})});if(!q&&z&&z.givingInMaintenance===!0)return w.jsx("div",{style:me,className:"flex flex-col h-full",children:w.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center p-3 space-y-2",children:[w.jsx(kH0,{size:32,weight:"duotone"}),w.jsx(ve,{fg:"secondary",className:"text-center px-8",children:"We're updating the giving experience. Please check back shortly."})]})});if(!q&&!m0)return w.jsx("div",{style:me,className:"flex flex-col h-full",children:w.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center p-3",children:[w.jsx(CH0,{size:32,weight:"duotone"}),w.jsx(ve,{fg:"secondary",className:"text-center",children:"Online giving is not currently available. Please contact your church for assistance."}),w.jsx(Je,{href:"mailto:support@apollos.app",surface:"tinted",className:"mt-2",children:"Contact Us"})]})});if(I==="success")return w.jsx("div",{style:me,className:"flex flex-col h-full",children:w.jsx("div",{className:"flex-1 flex flex-col justify-center items-center",children:w.jsx(HE0,{onRetry:P0,email:t0})})});const ue=A||Z?`${A} ${Z}`.trim():"",xe=z?.name||"Your Church",qe="div",e2={style:me,className:"flex flex-col h-full"};return w.jsxs(qe,{...e2,children:[r0?w.jsxs("div",{className:"absolute top-0 left-0 right-0 z-[50] p-3 flex items-center gap-2 bg-red-50 dark:bg-red-900 rounded-xl",style:{borderColor:u1?.colors?.base?.alert||"#FF4444"},children:[w.jsx(NH0,{size:20,color:u1?.colors?.base?.alert||"#FF4444",weight:"fill"}),w.jsx("div",{className:"flex-1",children:w.jsx(ve,{className:"text-red-700 dark:text-red-300 font-medium text-sm",children:r0})}),w.jsx(Je,{surface:"tinted",onClick:S0,className:"p-1 min-w-0 text-red-700 dark:text-red-300 hover:bg-red-100 dark:hover:bg-red-800/30",children:w.jsx(ni,{size:16})})]}):null,w.jsx("div",{className:"flex flex-col h-full min-h-[400px]",children:I==="payment"&&J&&m0?w.jsx(WC,{stripe:m0,options:{clientSecret:J,appearance:N1,...y0?{customerSessionClientSecret:y0}:{}},children:w.jsx(vE0,{amount:a0?.amount?parseFloat(a0.amount):parseFloat(t),selectedFrequency:a0?.selectedFrequency,selectedCampusId:a0?.selectedCampusId||void 0,selectedFundId:a0?.selectedFundId||void 0,clientSecret:J,paymentIntentId:o0,setupIntentId:Q,onSuccess:T0,onError:X0,isProcessing:M0,onProcessingChange:E0,onBack:He,userFullName:ue,userEmail:H||void 0,userPhone:V||void 0,churchName:xe,churchLogo:z?.logo,message:n,displayLogo:m,title:u,displayHeader:p})}):I==="payment"?w.jsxs("div",{className:"flex flex-col justify-center items-center h-full min-h-[400px]",children:[w.jsx(vr,{size:32,className:"animate-spin mx-auto mb-2"}),w.jsx(ve,{children:"Loading payment form..."})]}):I==="setup"&&!(f&&U(f)&&!A0)?w.jsx(hu1,{amount:a0.amount,selectedFrequency:a0.selectedFrequency,selectedCampus:a0.selectedCampus,selectedFund:a0.selectedFund,predefinedAmounts:i,onError:o1=>X0(new Error(o1.message)),onSuccess:T0,isProcessing:t1,onAmountChange:J0,onFrequencyChange:y1,onCampusChange:r1,onFundChange:_1,onStartDateChange:Y1,onShowPayment:()=>{const o1=typeof a0.amount=="string"?parseFloat(a0.amount):a0.amount,C1=eM0(a0.selectedFrequency);$1(o1,C1,a0.selectedCampusId||"",a0.selectedFundId||"",a0.selectedFrequency?.startDate??null)},churchName:xe,churchLogo:z?.logo,message:n,displayLogo:m,title:u,displayHeader:p}):I==="setup"&&f&&U(f)&&!A0?w.jsxs("div",{className:"flex flex-col justify-center items-center h-full min-h-[400px]",children:[w.jsx(vr,{size:32,className:"animate-spin mx-auto mb-2"}),w.jsx(ve,{children:"Preparing your donation..."})]}):null})]})},Au1=t=>{const[a,n]=e.useState(!1);e.useEffect(()=>{n(!0)},[]);const r=()=>({width:t.width?isNaN(Number(t.width))?t.width:`${t.width}px`:"100%",height:t.height?isNaN(Number(t.height))?t.height:`${t.height}px`:"500px",maxWidth:t.width?void 0:"400px",margin:t.width?"0":"0 auto",border:"none",position:"relative",overflow:"hidden",padding:0});return w.jsx(XH0,{children:a?w.jsx(fu1,{...t}):w.jsx("div",{style:r(),className:"flex flex-col h-full",children:w.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center",children:[w.jsx(vr,{size:24,className:"animate-spin text-fg-tertiary dark:text-fg-tertiary-dark mb-3",weight:"regular"}),w.jsx(ve,{className:"text-sm text-fg-secondary dark:text-fg-secondary-dark",children:"Loading donation form..."})]})})})},vu1=e.forwardRef(function({to:a,href:n,isExternal:r,...l},i){const{navigate:o}=PZ(),c=_g0(),m=kg0(),u=wg0(),p=nC(),f=Nr1();if(r&&n||!a)return w.jsx("a",{ref:i,href:n,...l});let A,Z=!1;const H=S=>typeof S=="string"&&S.startsWith("/")?S:`/${S}`,V=S=>typeof S=="string"?S?.split("/").filter(Boolean).slice(-1)[0]:null;if(typeof a=="object"){if(!a.contentId)return null;A=a.contentId.split(":").join("-"),Z=A?.startsWith("FeatureFeed-")}else if(typeof a=="string"){const S=H(a),_=V(S);if(S.includes("/f/")){if(!u&&!p){const k=il1();return w.jsx("a",{ref:i,...l,href:`${k}${S}`,target:"_blank",rel:"noopener noreferrer"})}if(!_)return null;A=_.startsWith("FeatureFeed-")?_:`FeatureFeed-${_}`,Z=!0}else if(S.includes("/live/")){if(!_)return null;A=_.startsWith("Livestream-")?_:`Livestream-${_}`}else if(_?.includes("-"))A=_,Z=A.startsWith("FeatureFeed-");else if(_?.includes(":"))A=_.split(":").join("-"),Z=A.startsWith("FeatureFeed-");else return null}else return null;if(!u&&!p)return w.jsx("a",{ref:i,...l,href:`https://apollos.site/@${f}/c/${A}`,target:"_blank",rel:"noopener noreferrer"});let b=m&&p?`/${Z?"af":"ac"}/${A}`:`?${c?"apollosId":"id"}=${A}`;return p||(b=`${u}${n}`),w.jsx("a",{ref:i,...l,href:b,onClick:S=>{S.preventDefault(),o({id:A})}})}),gu1=({children:t})=>w.jsx(mx0,{linkComponent:vu1,children:t});function pH(){return pH=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var n=arguments[a];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pH.apply(null,arguments)}function ME0(t,a){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(a.includes(r))continue;n[r]=t[r]}return n}function yN(t,a){return yN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},yN(t,a)}function EE0(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,yN(t,a)}function Zu1(t,a){return t.classList?!!a&&t.classList.contains(a):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+a+" ")!==-1}function Hu1(t,a){t.classList?t.classList.add(a):Zu1(t,a)||(typeof t.className=="string"?t.className=t.className+" "+a:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+a))}function VE0(t,a){return t.replace(new RegExp("(^|\\s)"+a+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Mu1(t,a){t.classList?t.classList.remove(a):typeof t.className=="string"?t.className=VE0(t.className,a):t.setAttribute("class",VE0(t.className&&t.className.baseVal||"",a))}const yE0={disabled:!1};var bE0={},Eu1=bE0.NODE_ENV!=="production"?e1.oneOfType([e1.number,e1.shape({enter:e1.number,exit:e1.number,appear:e1.number}).isRequired]):null,Vu1=bE0.NODE_ENV!=="production"?e1.oneOfType([e1.string,e1.shape({enter:e1.string,exit:e1.string,active:e1.string}),e1.shape({enter:e1.string,enterDone:e1.string,enterActive:e1.string,exit:e1.string,exitDone:e1.string,exitActive:e1.string})]):null;const SE0=I0.createContext(null);var FE0=function(a){return a.scrollTop},yu1={},xp="unmounted",I5="exited",j5="entering",zc="entered",bN="exiting",kr=(function(t){EE0(a,t);function a(r,l){var i;i=t.call(this,r,l)||this;var o=l,c=o&&!o.isMounting?r.enter:r.appear,m;return i.appearStatus=null,r.in?c?(m=I5,i.appearStatus=j5):m=zc:r.unmountOnExit||r.mountOnEnter?m=xp:m=I5,i.state={status:m},i.nextCallback=null,i}a.getDerivedStateFromProps=function(l,i){var o=l.in;return o&&i.status===xp?{status:I5}:null};var n=a.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(l){var i=null;if(l!==this.props){var o=this.state.status;this.props.in?o!==j5&&o!==zc&&(i=j5):(o===j5||o===zc)&&(i=bN)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var l=this.props.timeout,i,o,c;return i=o=c=l,l!=null&&typeof l!="number"&&(i=l.exit,o=l.enter,c=l.appear!==void 0?l.appear:o),{exit:i,enter:o,appear:c}},n.updateStatus=function(l,i){if(l===void 0&&(l=!1),i!==null)if(this.cancelNextCallback(),i===j5){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:Ym.findDOMNode(this);o&&FE0(o)}this.performEnter(l)}else this.performExit();else this.props.unmountOnExit&&this.state.status===I5&&this.setState({status:xp})},n.performEnter=function(l){var i=this,o=this.props.enter,c=this.context?this.context.isMounting:l,m=this.props.nodeRef?[c]:[Ym.findDOMNode(this),c],u=m[0],p=m[1],f=this.getTimeouts(),A=c?f.appear:f.enter;if(!l&&!o||yE0.disabled){this.safeSetState({status:zc},function(){i.props.onEntered(u)});return}this.props.onEnter(u,p),this.safeSetState({status:j5},function(){i.props.onEntering(u,p),i.onTransitionEnd(A,function(){i.safeSetState({status:zc},function(){i.props.onEntered(u,p)})})})},n.performExit=function(){var l=this,i=this.props.exit,o=this.getTimeouts(),c=this.props.nodeRef?void 0:Ym.findDOMNode(this);if(!i||yE0.disabled){this.safeSetState({status:I5},function(){l.props.onExited(c)});return}this.props.onExit(c),this.safeSetState({status:bN},function(){l.props.onExiting(c),l.onTransitionEnd(o.exit,function(){l.safeSetState({status:I5},function(){l.props.onExited(c)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(l,i){i=this.setNextCallback(i),this.setState(l,i)},n.setNextCallback=function(l){var i=this,o=!0;return this.nextCallback=function(c){o&&(o=!1,i.nextCallback=null,l(c))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},n.onTransitionEnd=function(l,i){this.setNextCallback(i);var o=this.props.nodeRef?this.props.nodeRef.current:Ym.findDOMNode(this),c=l==null&&!this.props.addEndListener;if(!o||c){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var m=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],u=m[0],p=m[1];this.props.addEndListener(u,p)}l!=null&&setTimeout(this.nextCallback,l)},n.render=function(){var l=this.state.status;if(l===xp)return null;var i=this.props,o=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var c=ME0(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return I0.createElement(SE0.Provider,{value:null},typeof o=="function"?o(l,c):I0.cloneElement(I0.Children.only(o),c))},a})(I0.Component);kr.contextType=SE0,kr.propTypes=yu1.NODE_ENV!=="production"?{nodeRef:e1.shape({current:typeof Element>"u"?e1.any:function(t,a,n,r,l,i){var o=t[a];return e1.instanceOf(o&&"ownerDocument"in o?o.ownerDocument.defaultView.Element:Element)(t,a,n,r,l,i)}}),children:e1.oneOfType([e1.func.isRequired,e1.element.isRequired]).isRequired,in:e1.bool,mountOnEnter:e1.bool,unmountOnExit:e1.bool,appear:e1.bool,enter:e1.bool,exit:e1.bool,timeout:function(a){var n=Eu1;a.addEndListener||(n=n.isRequired);for(var r=arguments.length,l=new Array(r>1?r-1:0),i=1;i<r;i++)l[i-1]=arguments[i];return n.apply(void 0,[a].concat(l))},addEndListener:e1.func,onEnter:e1.func,onEntering:e1.func,onEntered:e1.func,onExit:e1.func,onExiting:e1.func,onExited:e1.func}:{};function Bc(){}kr.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Bc,onEntering:Bc,onEntered:Bc,onExit:Bc,onExiting:Bc,onExited:Bc},kr.UNMOUNTED=xp,kr.EXITED=I5,kr.ENTERING=j5,kr.ENTERED=zc,kr.EXITING=bN;var bu1={},Su1=function(a,n){return a&&n&&n.split(" ").forEach(function(r){return Hu1(a,r)})},SN=function(a,n){return a&&n&&n.split(" ").forEach(function(r){return Mu1(a,r)})},FN=(function(t){EE0(a,t);function a(){for(var r,l=arguments.length,i=new Array(l),o=0;o<l;o++)i[o]=arguments[o];return r=t.call.apply(t,[this].concat(i))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(c,m){var u=r.resolveArguments(c,m),p=u[0],f=u[1];r.removeClasses(p,"exit"),r.addClass(p,f?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(c,m)},r.onEntering=function(c,m){var u=r.resolveArguments(c,m),p=u[0],f=u[1],A=f?"appear":"enter";r.addClass(p,A,"active"),r.props.onEntering&&r.props.onEntering(c,m)},r.onEntered=function(c,m){var u=r.resolveArguments(c,m),p=u[0],f=u[1],A=f?"appear":"enter";r.removeClasses(p,A),r.addClass(p,A,"done"),r.props.onEntered&&r.props.onEntered(c,m)},r.onExit=function(c){var m=r.resolveArguments(c),u=m[0];r.removeClasses(u,"appear"),r.removeClasses(u,"enter"),r.addClass(u,"exit","base"),r.props.onExit&&r.props.onExit(c)},r.onExiting=function(c){var m=r.resolveArguments(c),u=m[0];r.addClass(u,"exit","active"),r.props.onExiting&&r.props.onExiting(c)},r.onExited=function(c){var m=r.resolveArguments(c),u=m[0];r.removeClasses(u,"exit"),r.addClass(u,"exit","done"),r.props.onExited&&r.props.onExited(c)},r.resolveArguments=function(c,m){return r.props.nodeRef?[r.props.nodeRef.current,c]:[c,m]},r.getClassNames=function(c){var m=r.props.classNames,u=typeof m=="string",p=u&&m?m+"-":"",f=u?""+p+c:m[c],A=u?f+"-active":m[c+"Active"],Z=u?f+"-done":m[c+"Done"];return{baseClassName:f,activeClassName:A,doneClassName:Z}},r}var n=a.prototype;return n.addClass=function(l,i,o){var c=this.getClassNames(i)[o+"ClassName"],m=this.getClassNames("enter"),u=m.doneClassName;i==="appear"&&o==="done"&&u&&(c+=" "+u),o==="active"&&l&&FE0(l),c&&(this.appliedClasses[i][o]=c,Su1(l,c))},n.removeClasses=function(l,i){var o=this.appliedClasses[i],c=o.base,m=o.active,u=o.done;this.appliedClasses[i]={},c&&SN(l,c),m&&SN(l,m),u&&SN(l,u)},n.render=function(){var l=this.props;l.classNames;var i=ME0(l,["classNames"]);return I0.createElement(kr,pH({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},a})(I0.Component);FN.defaultProps={classNames:""},FN.propTypes=bu1.NODE_ENV!=="production"?pH({},kr.propTypes,{classNames:Vu1,onEnter:e1.func,onEntering:e1.func,onEntered:e1.func,onExit:e1.func,onExiting:e1.func,onExited:e1.func}):{};const LE0={Search:Oe(FN)`
|
|
1837
|
+
`,hu1=({amount:t="0",selectedFrequency:a=null,selectedCampus:n=null,selectedFund:r=null,predefinedAmounts:l="",onError:i,isProcessing:o=!1,onShowPayment:c,onSuccess:m,onAmountChange:u,onFrequencyChange:p,onCampusChange:f,onFundChange:A,onStartDateChange:Z,churchName:H,churchLogo:V,message:b,displayLogo:S,title:_,displayHeader:k})=>{const{currentChurch:C}=Mp(),F=I9(),$=YH0(),{campuses:O,loading:R}=YC(),U=O.filter(q=>q.donationFunds&&q.donationFunds.length>0),I=q=>{if(q.digital)return"Online";const n0=[];return q.street1&&n0.push(q.street1),q.city&&n0.push(q.city),q.state&&n0.push(q.state),q.postalCode&&n0.push(q.postalCode),n0.length>0?n0.join(", "):""},[K,r0]=e.useState(Ep(a)),l0=a?Ep(a):K,X=["crossroads","crossroads_sandbox"].includes(C?.slug??"")?1:.5,[y0,Z0]=e.useState(!1),o0=e.useRef(null),p0=e.useRef(null),Q=e.useRef(null),G=e.useRef(null),t0=e.useRef(null),B=l?l.split(",").map(q=>q.trim()).filter(q=>q):[];e.useEffect(()=>{F.page("Donate screen viewed",{path:"/donate",church_slug:C?.slug||""})},[F,C?.slug]),e.useEffect(()=>{a&&r0(Ep(a))},[a]),e.useEffect(()=>{K&&o0.current&&Q.current&&setTimeout(()=>{const q=Q.current,n0=o0.current;if(q&&n0){const g0=q.getBoundingClientRect();n0.getBoundingClientRect().bottom>g0.bottom&&n0.scrollIntoView({behavior:"smooth",block:"nearest"})}},100)},[K]),e.useEffect(()=>{n&&p0.current&&Q.current&&setTimeout(()=>{const q=Q.current,n0=p0.current;if(q&&n0){const g0=q.getBoundingClientRect();n0.getBoundingClientRect().bottom>g0.bottom&&n0.scrollIntoView({behavior:"smooth",block:"nearest"})}},100)},[n]);const[M0,E0]=e.useState(80),m0=e.useRef(null);e.useEffect(()=>{m0.current&&(m0.current.textContent=t||"0",E0(Math.max(m0.current.offsetWidth+16,80)))},[t]),e.useEffect(()=>{const q=setTimeout(()=>{m0.current&&(m0.current.textContent=t||"0",E0(Math.max(m0.current.offsetWidth+16,80)))},10);return()=>clearTimeout(q)},[t]);const O0=q=>{const n0=parseFloat(q);return!isNaN(n0)&&n0>999999.99},a0=q=>{let n0=q.replace(/[^0-9.]/g,"");if(n0.includes(".")){const g0=n0.split(".");g0.length>2&&(n0=g0[0]+"."+g0.slice(1).join("")),g0[1]&&g0[1].length>2&&(n0=g0[0]+"."+g0[1].substring(0,2))}return n0.length>1&&n0[0]==="0"&&n0[1]!=="."&&(n0=n0.substring(1)),O0(n0)?t:(n0==="."&&(n0="0."),u?.(n0),n0)},u0=q=>{const n0=O.find(g0=>g0.id===q);if(n0){const g0={...n0,donationFunds:n0.donationFunds?n0.donationFunds.map(Q0=>({...Q0})):[]};f?.(g0);const _0=au1(r,g0);A?.(_0)}else f?.(null),A?.(null)},A0=q=>{if(!n)return;const n0=n.donationFunds?.find(g0=>g0.id===q);A?.(n0?{...n0}:null)},b0=q=>{const g0=Oc.find(_0=>_0.id===q)||null;g0&&a?.startDate&&(tu1(a.startDate,g0)||Z?.(null)),p?.(g0)},h0=q=>{Z?.(q)},z=()=>{const q=N6(t);if(!q||q<=0){setTimeout(()=>{G.current&&(G.current.focus(),G.current.select(),G.current.scrollIntoView({behavior:"smooth",block:"center"}))},100);return}if(q<X){i({message:`Please enter an amount of $${Dc(X)} or more`}),setTimeout(()=>{G.current&&(G.current.focus(),G.current.select(),G.current.scrollIntoView({behavior:"smooth",block:"center"}))},100);return}if(!n){Z0(!0);return}if(!r){requestAnimationFrame(()=>{requestAnimationFrame(()=>{const n0=document.querySelector("[data-fund-dropdown-button]");n0&&(n0.scrollIntoView({behavior:"smooth",block:"center"}),n0.focus({preventScroll:!0}))})});return}if(l0&&!a){setTimeout(()=>{t0.current&&(t0.current.focus(),t0.current.scrollIntoView({behavior:"smooth",block:"center"}))},100);return}F.track("Donation Started",{amount:q,fund:r?.id||"",campusId:n?.id||"",is_recurring:l0}),c&&c()};return w.jsxs("div",{className:"flex flex-col h-full","data-testid":"donation-setup-form",children:[w.jsx("style",{children:pu1}),k!=="false"?w.jsx(MN,{churchName:H,churchLogo:V,message:b,title:_,displayLogo:S,theme:$||void 0}):null,w.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-6",ref:Q,children:w.jsxs("div",{className:"space-y-4",children:[w.jsx("div",{className:"flex flex-col items-center",children:w.jsxs("button",{type:"button",onClick:()=>Z0(!0),disabled:o||R,className:"flex items-center gap-1 text-fg-primary dark:text-fg-primary-dark hover:opacity-70 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed",children:[C?.logo?w.jsx("div",{className:"w-6 h-6 rounded-full overflow-hidden flex-shrink-0 flex items-center justify-center p-1",style:{backgroundColor:$?.colors?.base?.primary||"rgb(var(--color-brand-primary, 0 103 109))"},children:w.jsx("img",{src:C.logo,alt:`${H} logo`,className:"w-full h-full object-contain"})}):null,w.jsx("span",{className:"text-base font-medium",children:n?.name||"Select a Location"}),w.jsx(gE0,{size:16,weight:"bold",className:"flex-shrink-0",style:{color:$?.colors?.base?.secondary||"rgb(var(--color-brand-secondary, 23 181 130))"}})]})}),w.jsxs("div",{className:"",children:[w.jsxs("div",{className:Q1("flex items-start justify-center text-[60px] font-bold leading-none min-h-[60px] transition-opacity",(o||R)&&"opacity-60"),children:[w.jsx("span",{className:"text-3xl leading-normal font-bold mt-3 flex-none text-primary dark:text-white",children:"$"}),w.jsx("span",{ref:m0,className:"absolute invisible h-0 overflow-hidden whitespace-pre text-[80px] font-bold font-inherit p-0 m-0",style:{fontFamily:"inherit",position:"absolute",left:"-9999px",top:"-9999px"},children:t||"0"}),w.jsx("input",{ref:G,type:"text",inputMode:"decimal",placeholder:"0",value:t,onKeyDown:q=>{if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].includes(q.key)){if(/^[0-9]$/.test(q.key)||q.key==="."||q.ctrlKey||q.metaKey){if(q.key==="."&&t.includes(".")){q.preventDefault();return}if(/^[0-9]$/.test(q.key)){const n0=q.target,g0=n0.value,_0=n0.selectionStart||0,Q0=g0.substring(0,_0)+q.key+g0.substring(n0.selectionEnd||0);if(O0(Q0)){q.preventDefault();return}}return}q.preventDefault()}},onChange:q=>{const n0=q.target.value,g0=a0(n0);requestAnimationFrame(()=>{if(m0.current){const _0=g0??t;m0.current.textContent=_0||"0";const Q0=Math.max(m0.current.offsetWidth+16,80);E0(Q0)}})},onInput:q=>{const n0=q.target.value;if(m0.current){m0.current.textContent=n0||"0";const g0=Math.max(m0.current.offsetWidth+16,80);E0(g0)}},onKeyUp:q=>{const n0=q.target.value;if(m0.current){m0.current.textContent=n0||"0";const g0=Math.max(m0.current.offsetWidth+16,80);E0(g0)}},onFocus:q=>{setTimeout(()=>{q.target.select()},0)},onBlur:()=>{const q=N6(t);q>0&&u?.(Dc(q))},onClick:q=>{q.target.select()},disabled:o||R,className:"text-[80px] font-bold border-none outline-none bg-transparent flex-none p-0 m-0 text-primary dark:text-white caret-current text-center appearance-none transition-[width] duration-100 ease-in-out",style:{width:`${M0}px`}})]}),B&&B.length>0?w.jsx("div",{className:"flex flex-wrap pt-12",style:{gap:"6px"},children:B.map(q=>w.jsxs(Je,{onClick:()=>a0(q),disabled:o||R,surface:t===q?"solid":"system",className:"min-w-0 flex-1",style:{flexBasis:"calc(25% - 4.5px)",minWidth:"0",...t===q&&{"--btn-bg":"rgb(var(--color-brand-primary))","--btn-hover-overlay":"rgb(255 255 255 / 15%)"}},children:["$",q]},q))}):null]}),n?w.jsx("div",{ref:p0,className:"flex flex-col items-center",children:n.donationFunds&&n.donationFunds.length>0?w.jsxs(Cb,{children:[w.jsxs(Ax0,{disabled:o,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-system-regular dark:bg-system-regular-dark font-semibold focus:outline focus:outline-2 focus:outline-offset-4",style:{outlineColor:$?.colors?.base?.secondary||"#17B582"},"data-fund-dropdown-button":!0,children:[w.jsx("span",{children:r?.displayName||r?.name||"Select a fund"}),w.jsx(dr,{size:16,weight:"bold"})]}),w.jsx(Nb,{className:"!z-30",children:n.donationFunds?.sort((q,n0)=>(q.displayOrder||0)-(n0.displayOrder||0)).map(q=>w.jsx(Sl,{onClick:()=>A0(q.id),children:q.displayName||q.name},q.id))})]}):w.jsx("div",{className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-system-regular dark:bg-system-regular-dark font-semibold text-fg-secondary dark:text-fg-secondary-dark",children:w.jsx("span",{children:"No funds available"})})}):null,w.jsx("div",{className:Q1("relative block w-full h-[48px] rounded-lg before:absolute before:inset-px before:rounded-[calc(theme(borderRadius.lg)-1px)] before:bg-white before:shadow-[0_1px_2px_0_rgba(0,0,0,0.07),0_1px_1px_-1px_rgba(0,0,0,0.08)] before:pointer-events-none dark:before:hidden bg-transparent dark:bg-white/5",(o||R)&&"opacity-50"),children:w.jsxs("div",{className:"relative z-10 flex items-center justify-between h-full rounded-lg border border-system-thin dark:border-system-thin-dark px-[calc(theme(spacing[3.5])-1px)] py-[calc(theme(spacing[2.5])-1px)] sm:px-[calc(theme(spacing[3])-1px)] sm:py-[calc(theme(spacing[1.5])-1px)]",children:[w.jsx(ve,{className:"text-base/6 text-fg-primary dark:text-fg-primary-dark sm:text-sm/6",children:"Make Recurring"}),w.jsxs(sx0,{checked:K,onChange:q=>{r0(q),q||p?.(null)},disabled:o||R,className:Q1("inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-action disabled:opacity-50 disabled:cursor-not-allowed",l0?"bg-action":"bg-system-regular dark:bg-system-regular-dark"),children:[w.jsx("span",{className:"sr-only",children:"Make Recurring"}),w.jsx("span",{"aria-hidden":"true",className:Q1("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",l0?"translate-x-5":"translate-x-0")})]})]})}),K?w.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[w.jsxs("div",{ref:o0,className:"[&_[data-slot=control]]:h-[48px] [&_select]:h-full [&_select]:flex [&_select]:items-center",children:[w.jsx(ve,{className:"mb-1 text-xs text-left",fg:"secondary",children:"Frequency"}),w.jsxs(eI0,{ref:t0,value:a?.id||"",onChange:q=>b0(q.target.value),disabled:o||R,required:!0,surface:"system",className:"focus-within:outline focus-within:outline-2 focus-within:outline-offset-2 focus-within:rounded-lg",style:{outlineColor:$?.colors?.base?.secondary||"#17B582"},children:[w.jsx("option",{value:"",children:"Select a frequency"}),Oc.map(q=>w.jsx("option",{value:q.id,children:q.id},q.id))]})]}),w.jsx("div",{children:w.jsx(uu1,{startDate:a?.startDate??null,frequency:a||Oc[2],onStartDateChange:h0,disabled:o||R})})]}):null]})}),w.jsxs("div",{className:"sticky bottom-0 z-10 px-6 py-4",children:[w.jsx(Je,{type:"button",className:"w-full py-3",onClick:z,disabled:o||R,surface:N6(t)>0&&n&&r&&(!l0||a)?"solid":"system","data-secondary-button":N6(t)>0&&n&&r&&(!l0||a)?!0:void 0,children:o?w.jsx("div",{className:"flex items-center justify-center gap-2",children:w.jsx(vr,{size:20,className:"animate-spin",weight:"bold"})}):N6(t)<=0?"To Give, Enter Amount":n?r?l0&&!a?"Next: Select Frequency":`Give $${Dc(N6(t))}${l0&&a?` ${a.id}`:""}`:"Next: Select Fund":"Next: Select Location"}),w.jsx(AE0,{amount:t,selectedFrequency:a,selectedCampus:n,selectedFund:r,isRecurring:l0,minimumAllowedAmount:X,onError:i,onSuccess:m}),w.jsxs("div",{className:"text-center mt-4 px-6 space-y-3",children:[w.jsxs(ve,{className:"text-sm text-fg-secondary dark:text-fg-secondary-dark",children:["Powered by"," ",w.jsx("a",{href:"https://apollos.com",target:"_blank",rel:"noopener noreferrer",className:"underline","data-footer-link":!0,children:"Apollos"}),". By making this gift, I agree to the Apollos"," ",w.jsx("a",{href:"https://apollos.com/terms",target:"_blank",rel:"noopener noreferrer",className:"underline","data-footer-link":!0,children:"Terms of Service"})," ","and"," ",w.jsx("a",{href:"https://apollos.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline","data-footer-link":!0,children:"Privacy Policy"}),"."]}),w.jsxs("div",{className:"inline-flex items-center justify-center gap-2 px-3 py-2 rounded-lg bg-white dark:bg-system-regular-dark",children:[w.jsx(ZE0,{size:16,color:"#17B582",className:"flex-shrink-0",weight:"bold"}),w.jsx(ve,{className:"text-sm font-light",fg:"secondary",children:"Secure & Encrypted"})]})]})]}),w.jsx(Hx0,{open:y0,onClose:()=>Z0(!1),className:"!max-w-2xl !max-h-[90vh] !p-0 flex flex-col",children:w.jsxs("div",{className:"flex flex-col max-h-[90vh]",children:[w.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-system-regular dark:border-system-regular-dark flex-shrink-0",children:[w.jsx(Mx0,{children:"Location"}),w.jsx(Je,{type:"button",onClick:()=>Z0(!1),surface:"system",className:"p-2",children:w.jsx(ni,{size:20})})]}),w.jsx(Ex0,{className:"flex-1 overflow-y-auto px-6 py-4 !mt-0 min-h-0",children:R?w.jsx("div",{className:"flex items-center justify-center py-8",children:w.jsx(ve,{fg:"secondary",children:"Loading..."})}):w.jsx(Gx0,{value:n?.id||"",onChange:q=>u0(q),className:"space-y-3",children:U.map(q=>{const n0=I(q);return w.jsxs(Yx0,{variant:"card",children:[w.jsx(Xx0,{value:q.id}),w.jsxs(pv,{className:"!flex !flex-col !items-start !p-4 !gap-0",children:[w.jsx("span",{className:"font-semibold text-base text-fg-primary dark:text-fg-primary-dark",children:q.name}),n0?w.jsx("span",{className:"text-sm text-fg-secondary dark:text-fg-secondary-dark mt-0.5",children:n0}):null]})]},q.id)})})}),w.jsx(Vx0,{className:"!mt-0 !flex-col border-t border-system-regular dark:border-system-regular-dark px-6 py-4 [&>*]:!w-full",children:w.jsx(Je,{type:"button",onClick:()=>Z0(!1),surface:n?"solid":"system","data-secondary-button":n?!0:void 0,className:"w-full",children:"Done"})})]})})]})},HE0=({onRetry:t,email:a})=>w.jsx("div",{className:"text-center p-6 flex flex-col items-center",children:w.jsxs("div",{className:"flex flex-col items-stretch gap-8",children:[w.jsx("div",{className:"self-center",children:w.jsx(cg,{size:64,color:"#22c55e",weight:"fill"})}),w.jsxs("div",{className:"flex flex-col items-center gap-1",children:[w.jsx(ve,{as:"h3",children:"Thank you for your gift!"}),a&&w.jsxs(ve,{fg:"secondary",children:["We've sent a confirmation to ",a]})]}),w.jsx("div",{className:"w-full",children:w.jsx(Je,{surface:"solid",onClick:t,className:"w-full","data-secondary-button":!0,children:"Done"})})]})});HE0.propTypes={onRetry:e1.func.isRequired,email:e1.string.isRequired};const fu1=({amount:t="0",frequency:a,message:n="",campus:r="",fund:l="",predefinedAmounts:i="",width:o="",height:c="",displayLogo:m="",title:u="",displayHeader:p="",prefilledPayment:f=null,userFirstName:A=null,userLastName:Z=null,userEmail:H=null,userPhone:V=null,currentUser:b=null,onAuthRequired:S,onOnboardingRequired:_,onClearParams:k,onGiveAgain:C})=>{const F=o1=>typeof o1=="string"&&parseFloat(o1)>0,$=o1=>typeof o1=="string"&&o1.trim().length>0,O=o1=>o1===null||typeof o1=="string"&&o1.trim().length>0,R=o1=>o1==null||typeof o1=="object"&&!!o1.id,U=e.useCallback(o1=>o1?F(o1.amount)&&$(o1.campusId)&&O(o1.fundId||null)&&R(o1.selectedFrequency):!1,[]),[I,K]=e.useState("setup"),[r0,l0]=e.useState(""),[J,X]=e.useState(null),[y0,Z0]=e.useState(null),[o0,p0]=e.useState(null),[Q,G]=e.useState(null),[t0,B]=e.useState(null),[M0,E0]=e.useState(!1),[m0,O0]=e.useState(null),[a0,u0]=e.useState(()=>({amount:t,selectedFrequency:eN(a),selectedCampusId:r||null,selectedFundId:l||null,selectedCampus:null,selectedFund:null})),[A0,b0]=e.useState(!1);e.useEffect(()=>{f&&f.amount&&f.campusId&&u0({amount:f.amount,selectedFrequency:f.selectedFrequency??null,selectedCampusId:f.campusId,selectedFundId:f.fundId??null,selectedCampus:null,selectedFund:null})},[f]);const h0=e.useRef({amount:t,campus:r,fund:l}),{currentChurch:z,loading:q,error:n0}=Mp(),{campuses:g0}=YC(),{matchedCampus:_0,matchedFund:Q0}=s91(g0,a0.selectedCampusId,a0.selectedFundId),v1=h91(),u1=YH0(),N1=e.useMemo(()=>{const o1={light:{primary:u1?.colors?.base?.primary||"#00676D",background:fe.colors.light.fill.screen,componentBackground:fe.colors.light.fill.paper,componentBorder:fe.colors.light.neutral.gray5,componentDivider:fe.colors.light.neutral.gray4,primaryText:fe.colors.light.text.primary,secondaryText:fe.colors.light.text.secondary,componentText:fe.colors.light.text.primary,icon:fe.colors.light.neutral.gray},dark:{primary:u1?.colors?.base?.primary||"#00676D",background:fe.colors.dark.fill.screen,componentBackground:fe.colors.dark.fill.paper,componentBorder:fe.colors.dark.neutral.gray5,componentDivider:fe.colors.dark.neutral.gray4,primaryText:fe.colors.dark.text.primary,secondaryText:fe.colors.dark.text.secondary,componentText:fe.colors.dark.text.primary,icon:fe.colors.dark.neutral.gray}};return{theme:v1==="dark"?"night":"stripe",variables:{colorPrimary:u1?.colors?.base?.secondary||"#17B582",colorBackground:v1==="dark"?o1.dark.componentBackground:o1.light.componentBackground,colorText:v1==="dark"?o1.dark.primaryText:o1.light.primaryText,colorTextSecondary:v1==="dark"?o1.dark.secondaryText:o1.light.secondaryText,colorTextPlaceholder:v1==="dark"?o1.dark.secondaryText:o1.light.secondaryText,colorDanger:u1?.colors?.base?.alert||"#FF4444",colorSuccess:u1?.colors?.base?.success||"#17B582",colorWarning:u1?.colors?.base?.warning||"#FFA500",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",fontSizeBase:"16px",spacingUnit:u1?.space?.xxxs||"4px",borderRadius:u1?.radii?.base||"6px",iconColor:v1==="dark"?o1.dark.icon:o1.light.icon}}},[u1,v1]);e.useEffect(()=>{const o1=z?.stripeConnectAccount?.publishableKey;if(!o1){O0(null);return}const C1=fE0(o1);O0(C1)},[z?.stripeConnectAccount?.publishableKey]),e.useEffect(()=>{if(!f)if(a!==void 0)u0(o1=>({...o1,selectedFrequency:eN(a)}));else if(z?.givingDefaultFrequency){const o1=v91(z.givingDefaultFrequency,Oc.map(_e=>_e.id)),C1=o1&&Oc.find(_e=>_e.id===o1)||null;u0(_e=>({..._e,selectedFrequency:C1}))}else u0(o1=>({...o1,selectedFrequency:null}))},[z?.givingDefaultFrequency,f,a]),e.useEffect(()=>{!f&&t!==h0.current.amount&&t!==a0.amount&&u0(o1=>({...o1,amount:t})),h0.current.amount=t},[t,a0.amount,f]),e.useEffect(()=>{!f&&r!==h0.current.campus&&r!==a0.selectedCampusId&&u0(o1=>({...o1,selectedCampusId:r||null,selectedCampus:null,selectedFund:null,selectedFundId:null})),h0.current.campus=r},[r,a0.selectedCampusId,f]),e.useEffect(()=>{!f&&l!==h0.current.fund&&l!==a0.selectedFundId&&u0(o1=>({...o1,selectedFundId:l||null,selectedFund:null})),h0.current.fund=l},[l,a0.selectedFundId,f]),e.useEffect(()=>{if(!f&&a0.selectedFundId&&a0.selectedCampus?.donationFunds&&!a0.selectedFund){let o1=a0.selectedCampus.donationFunds.find(C1=>C1.id===a0.selectedFundId);o1||(o1=a0.selectedCampus.donationFunds.find(C1=>Sn(a0.selectedFundId,C1.name)||C1.displayName&&Sn(a0.selectedFundId,C1.displayName))),o1&&u0(C1=>({...C1,selectedFund:{...o1}}))}},[f,a0.selectedFundId,a0.selectedCampus?.donationFunds,a0.selectedFund]),e.useEffect(()=>{if(!a0.selectedCampus&&_0){const o1={..._0,donationFunds:_0.donationFunds?_0.donationFunds.map(C1=>({...C1})):[]};u0(C1=>({...C1,selectedCampus:o1,selectedCampusId:o1.id,selectedFund:Q0?{...Q0}:C1.selectedFund}))}},[_0,Q0,a0.selectedCampus]);const[c1,{loading:t1}]=GH0(),T0=e.useCallback(o1=>{B(o1),K("success")},[]),X0=e.useCallback(o1=>{l0(o1.message)},[]),S0=e.useCallback(()=>{l0("")},[]),P0=e.useCallback(()=>{if(C){C();return}if(K("setup"),l0(""),X(null),p0(null),G(null),b0(!1),B(null),u0({amount:t,selectedFrequency:eN(a),selectedCampusId:null,selectedFundId:null,selectedCampus:null,selectedFund:null}),E0(!1),k)k();else if(typeof window<"u"){const o1=new URL(window.location.href);o1.search="",window.history.replaceState({},"",o1.pathname)}},[C,t,a,k]),J0=e.useCallback(o1=>{u0(C1=>({...C1,amount:o1}))},[]),y1=e.useCallback(o1=>{u0(C1=>{const _e=o1?{...o1,startDate:C1.selectedFrequency?.startDate}:null;return{...C1,selectedFrequency:_e}})},[]),Y1=e.useCallback(o1=>{u0(C1=>({...C1,selectedFrequency:C1.selectedFrequency?{...C1.selectedFrequency,startDate:o1??void 0}:null}))},[]),r1=e.useCallback(o1=>{u0(C1=>({...C1,selectedCampus:o1,selectedCampusId:o1?.id||null,selectedFund:null,selectedFundId:null}))},[]),_1=e.useCallback(o1=>{u0(C1=>({...C1,selectedFund:o1,selectedFundId:o1?.id||null}))},[]),$1=e.useCallback(async(o1,C1,_e,_2,Z8)=>{if(!b&&S){S({amount:o1,frequency:C1,campusId:_e,fundId:_2,startDate:Z8});return}if(b&&!b.connectedChurchProfile?.id&&_){_({amount:o1,frequency:C1,campusId:_e,fundId:_2,startDate:Z8});return}try{const Y8=a0.selectedFrequency,f2={amount:Math.round(o1*100),frequency:tM0(Y8),futureStartDate:aM0(Y8),campusId:_e||"",fundId:_2||null,paymentIntentId:o0,setupIntentId:Q},{data:L8,errors:I8}=await c1({variables:{input:f2}});if(I8)throw new Error(I8[0].message);const c2=L8?.createOrUpdateGiveIntent;if(c2?.clientSecret)X(c2.clientSecret),Z0(c2.customerSecret??null),c2.paymentIntentId&&p0(c2.paymentIntentId),c2.setupIntentId&&G(c2.setupIntentId),K("payment");else throw new Error("No client secret received from server")}catch(Y8){X0(Y8)}},[c1,X0,b,S,_,a0.selectedFrequency]),He=e.useCallback(()=>{K("setup"),X(null),Z0(null)},[]),me={width:o?isNaN(Number(o))?o:`${o}px`:"100%",height:c?isNaN(Number(c))?c:`${c}px`:"500px",maxWidth:o?void 0:"400px",margin:o?"0":"0 auto",border:"none",position:"relative",overflow:"hidden",padding:0};if(e.useEffect(()=>{f&&U(f)&&!q&&!t1&&!A0&&I==="setup"&&(b0(!0),u0({amount:f.amount,selectedFrequency:f.selectedFrequency??null,selectedCampusId:f.campusId,selectedFundId:f.fundId??null,selectedCampus:null,selectedFund:null}),$1(parseFloat(f.amount),eM0(f.selectedFrequency),f.campusId,f.fundId??"",f.startDate??null))},[f,q,t1,A0,I,$1,U]),n0)return w.jsx("div",{style:me,className:"flex flex-col h-full",children:w.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center p-3",children:[w.jsx(ve,{fg:"secondary",className:"text-center px-8",children:"Unable to load church information. Please try again later."}),w.jsx(Je,{surface:"tinted",onClick:P0,className:"mt-2",children:"Try Again"})]})});if(!q&&z&&z.givingEnabled===!1)return w.jsx("div",{style:me,className:"flex flex-col h-full",children:w.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center p-3 space-y-2",children:[w.jsx(wH0,{size:32,weight:"duotone"}),w.jsx(ve,{fg:"secondary",className:"text-center px-8",children:"Online giving is closed. For questions, please contact support."}),w.jsx(Je,{href:"mailto:support@apollos.app",surface:"tinted",className:"mt-2",children:"Contact Us"})]})});if(!q&&z&&z.givingInMaintenance===!0)return w.jsx("div",{style:me,className:"flex flex-col h-full",children:w.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center p-3 space-y-2",children:[w.jsx(kH0,{size:32,weight:"duotone"}),w.jsx(ve,{fg:"secondary",className:"text-center px-8",children:"We're updating the giving experience. Please check back shortly."})]})});if(!q&&!m0)return w.jsx("div",{style:me,className:"flex flex-col h-full",children:w.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center p-3",children:[w.jsx(CH0,{size:32,weight:"duotone"}),w.jsx(ve,{fg:"secondary",className:"text-center",children:"Online giving is not currently available. Please contact your church for assistance."}),w.jsx(Je,{href:"mailto:support@apollos.app",surface:"tinted",className:"mt-2",children:"Contact Us"})]})});if(I==="success")return w.jsx("div",{style:me,className:"flex flex-col h-full",children:w.jsx("div",{className:"flex-1 flex flex-col justify-center items-center",children:w.jsx(HE0,{onRetry:P0,email:t0})})});const ue=A||Z?`${A} ${Z}`.trim():"",xe=z?.name||"Your Church",qe="div",e2={style:me,className:"flex flex-col h-full"};return w.jsxs(qe,{...e2,children:[r0?w.jsxs("div",{className:"absolute top-0 left-0 right-0 z-[50] p-3 flex items-center gap-2 bg-red-50 dark:bg-red-900 rounded-xl",style:{borderColor:u1?.colors?.base?.alert||"#FF4444"},children:[w.jsx(NH0,{size:20,color:u1?.colors?.base?.alert||"#FF4444",weight:"fill"}),w.jsx("div",{className:"flex-1",children:w.jsx(ve,{className:"text-red-700 dark:text-red-300 font-medium text-sm",children:r0})}),w.jsx(Je,{surface:"tinted",onClick:S0,className:"p-1 min-w-0 text-red-700 dark:text-red-300 hover:bg-red-100 dark:hover:bg-red-800/30",children:w.jsx(ni,{size:16})})]}):null,w.jsx("div",{className:"flex flex-col h-full min-h-[400px]",children:I==="payment"&&J&&m0?w.jsx(WC,{stripe:m0,options:{clientSecret:J,appearance:N1,...y0?{customerSessionClientSecret:y0}:{}},children:w.jsx(vE0,{amount:a0?.amount?parseFloat(a0.amount):parseFloat(t),selectedFrequency:a0?.selectedFrequency,selectedCampusId:a0?.selectedCampusId||void 0,selectedFundId:a0?.selectedFundId||void 0,clientSecret:J,paymentIntentId:o0,setupIntentId:Q,onSuccess:T0,onError:X0,isProcessing:M0,onProcessingChange:E0,onBack:He,userFullName:ue,userEmail:H||void 0,userPhone:V||void 0,churchName:xe,churchLogo:z?.logo,message:n,displayLogo:m,title:u,displayHeader:p})}):I==="payment"?w.jsxs("div",{className:"flex flex-col justify-center items-center h-full min-h-[400px]",children:[w.jsx(vr,{size:32,className:"animate-spin mx-auto mb-2"}),w.jsx(ve,{children:"Loading payment form..."})]}):I==="setup"&&!(f&&U(f)&&!A0)?w.jsx(hu1,{amount:a0.amount,selectedFrequency:a0.selectedFrequency,selectedCampus:a0.selectedCampus,selectedFund:a0.selectedFund,predefinedAmounts:i,onError:o1=>X0(new Error(o1.message)),onSuccess:T0,isProcessing:t1,onAmountChange:J0,onFrequencyChange:y1,onCampusChange:r1,onFundChange:_1,onStartDateChange:Y1,onShowPayment:()=>{const o1=typeof a0.amount=="string"?parseFloat(a0.amount):a0.amount,C1=eM0(a0.selectedFrequency);$1(o1,C1,a0.selectedCampusId||"",a0.selectedFundId||"",a0.selectedFrequency?.startDate??null)},churchName:xe,churchLogo:z?.logo,message:n,displayLogo:m,title:u,displayHeader:p}):I==="setup"&&f&&U(f)&&!A0?w.jsxs("div",{className:"flex flex-col justify-center items-center h-full min-h-[400px]",children:[w.jsx(vr,{size:32,className:"animate-spin mx-auto mb-2"}),w.jsx(ve,{children:"Preparing your donation..."})]}):null})]})},Au1=t=>{const[a,n]=e.useState(!1);e.useEffect(()=>{n(!0)},[]);const r=()=>({width:t.width?isNaN(Number(t.width))?t.width:`${t.width}px`:"100%",height:t.height?isNaN(Number(t.height))?t.height:`${t.height}px`:"500px",maxWidth:t.width?void 0:"400px",margin:t.width?"0":"0 auto",border:"none",position:"relative",overflow:"hidden",padding:0});return w.jsx(XH0,{children:a?w.jsx(fu1,{...t}):w.jsx("div",{style:r(),className:"flex flex-col h-full",children:w.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center",children:[w.jsx(vr,{size:24,className:"animate-spin text-fg-tertiary dark:text-fg-tertiary-dark mb-3",weight:"regular"}),w.jsx(ve,{className:"text-sm text-fg-secondary dark:text-fg-secondary-dark",children:"Loading donation form..."})]})})})},vu1=e.forwardRef(function({to:a,href:n,isExternal:r,...l},i){const{navigate:o}=PZ(),c=_g0(),m=kg0(),u=wg0(),p=nC(),f=Nr1();if(r&&n||!a)return w.jsx("a",{ref:i,href:n,...l});let A,Z=!1;const H=S=>typeof S=="string"&&S.startsWith("/")?S:`/${S}`,V=S=>typeof S=="string"?S?.split("/").filter(Boolean).slice(-1)[0]:null;if(typeof a=="object"){if(!a.contentId)return null;A=a.contentId.split(":").join("-"),Z=A?.startsWith("FeatureFeed-")}else if(typeof a=="string"){const S=H(a),_=V(S);if(S.includes("/f/")){if(!u&&!p){const k=il1();return w.jsx("a",{ref:i,...l,href:`${k}${S}`,target:"_blank",rel:"noopener noreferrer"})}if(!_)return null;A=_.startsWith("FeatureFeed-")?_:`FeatureFeed-${_}`,Z=!0}else if(S.includes("/live/")){if(!_)return null;A=_.startsWith("Livestream-")?_:`Livestream-${_}`}else if(_?.includes("-"))A=_,Z=A.startsWith("FeatureFeed-");else if(_?.includes(":"))A=_.split(":").join("-"),Z=A.startsWith("FeatureFeed-");else return null}else return null;if(!u&&!p)return w.jsx("a",{ref:i,...l,href:`https://apollos.site/@${f}/c/${A}`,target:"_blank",rel:"noopener noreferrer"});let b=m&&p?`/${Z?"af":"ac"}/${A}`:`?${c?"apollosId":"id"}=${A}`;return p||(b=`${u}${n}`),w.jsx("a",{ref:i,...l,href:b,onClick:S=>{S.preventDefault(),o({id:A})}})}),gu1=({children:t})=>w.jsx(mx0,{linkComponent:vu1,children:t});function pH(){return pH=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var n=arguments[a];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pH.apply(null,arguments)}function ME0(t,a){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(a.includes(r))continue;n[r]=t[r]}return n}function yN(t,a){return yN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},yN(t,a)}function EE0(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,yN(t,a)}function Zu1(t,a){return t.classList?!!a&&t.classList.contains(a):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+a+" ")!==-1}function Hu1(t,a){t.classList?t.classList.add(a):Zu1(t,a)||(typeof t.className=="string"?t.className=t.className+" "+a:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+a))}function VE0(t,a){return t.replace(new RegExp("(^|\\s)"+a+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Mu1(t,a){t.classList?t.classList.remove(a):typeof t.className=="string"?t.className=VE0(t.className,a):t.setAttribute("class",VE0(t.className&&t.className.baseVal||"",a))}const yE0={disabled:!1};var bE0={},Eu1=bE0.NODE_ENV!=="production"?e1.oneOfType([e1.number,e1.shape({enter:e1.number,exit:e1.number,appear:e1.number}).isRequired]):null,Vu1=bE0.NODE_ENV!=="production"?e1.oneOfType([e1.string,e1.shape({enter:e1.string,exit:e1.string,active:e1.string}),e1.shape({enter:e1.string,enterDone:e1.string,enterActive:e1.string,exit:e1.string,exitDone:e1.string,exitActive:e1.string})]):null;const SE0=I0.createContext(null);var FE0=function(a){return a.scrollTop},yu1={},xp="unmounted",I5="exited",j5="entering",zc="entered",bN="exiting",kr=(function(t){EE0(a,t);function a(r,l){var i;i=t.call(this,r,l)||this;var o=l,c=o&&!o.isMounting?r.enter:r.appear,m;return i.appearStatus=null,r.in?c?(m=I5,i.appearStatus=j5):m=zc:r.unmountOnExit||r.mountOnEnter?m=xp:m=I5,i.state={status:m},i.nextCallback=null,i}a.getDerivedStateFromProps=function(l,i){var o=l.in;return o&&i.status===xp?{status:I5}:null};var n=a.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(l){var i=null;if(l!==this.props){var o=this.state.status;this.props.in?o!==j5&&o!==zc&&(i=j5):(o===j5||o===zc)&&(i=bN)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var l=this.props.timeout,i,o,c;return i=o=c=l,l!=null&&typeof l!="number"&&(i=l.exit,o=l.enter,c=l.appear!==void 0?l.appear:o),{exit:i,enter:o,appear:c}},n.updateStatus=function(l,i){if(l===void 0&&(l=!1),i!==null)if(this.cancelNextCallback(),i===j5){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:Ym.findDOMNode(this);o&&FE0(o)}this.performEnter(l)}else this.performExit();else this.props.unmountOnExit&&this.state.status===I5&&this.setState({status:xp})},n.performEnter=function(l){var i=this,o=this.props.enter,c=this.context?this.context.isMounting:l,m=this.props.nodeRef?[c]:[Ym.findDOMNode(this),c],u=m[0],p=m[1],f=this.getTimeouts(),A=c?f.appear:f.enter;if(!l&&!o||yE0.disabled){this.safeSetState({status:zc},function(){i.props.onEntered(u)});return}this.props.onEnter(u,p),this.safeSetState({status:j5},function(){i.props.onEntering(u,p),i.onTransitionEnd(A,function(){i.safeSetState({status:zc},function(){i.props.onEntered(u,p)})})})},n.performExit=function(){var l=this,i=this.props.exit,o=this.getTimeouts(),c=this.props.nodeRef?void 0:Ym.findDOMNode(this);if(!i||yE0.disabled){this.safeSetState({status:I5},function(){l.props.onExited(c)});return}this.props.onExit(c),this.safeSetState({status:bN},function(){l.props.onExiting(c),l.onTransitionEnd(o.exit,function(){l.safeSetState({status:I5},function(){l.props.onExited(c)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(l,i){i=this.setNextCallback(i),this.setState(l,i)},n.setNextCallback=function(l){var i=this,o=!0;return this.nextCallback=function(c){o&&(o=!1,i.nextCallback=null,l(c))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},n.onTransitionEnd=function(l,i){this.setNextCallback(i);var o=this.props.nodeRef?this.props.nodeRef.current:Ym.findDOMNode(this),c=l==null&&!this.props.addEndListener;if(!o||c){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var m=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],u=m[0],p=m[1];this.props.addEndListener(u,p)}l!=null&&setTimeout(this.nextCallback,l)},n.render=function(){var l=this.state.status;if(l===xp)return null;var i=this.props,o=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var c=ME0(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return I0.createElement(SE0.Provider,{value:null},typeof o=="function"?o(l,c):I0.cloneElement(I0.Children.only(o),c))},a})(I0.Component);kr.contextType=SE0,kr.propTypes=yu1.NODE_ENV!=="production"?{nodeRef:e1.shape({current:typeof Element>"u"?e1.any:function(t,a,n,r,l,i){var o=t[a];return e1.instanceOf(o&&"ownerDocument"in o?o.ownerDocument.defaultView.Element:Element)(t,a,n,r,l,i)}}),children:e1.oneOfType([e1.func.isRequired,e1.element.isRequired]).isRequired,in:e1.bool,mountOnEnter:e1.bool,unmountOnExit:e1.bool,appear:e1.bool,enter:e1.bool,exit:e1.bool,timeout:function(a){var n=Eu1;a.addEndListener||(n=n.isRequired);for(var r=arguments.length,l=new Array(r>1?r-1:0),i=1;i<r;i++)l[i-1]=arguments[i];return n.apply(void 0,[a].concat(l))},addEndListener:e1.func,onEnter:e1.func,onEntering:e1.func,onEntered:e1.func,onExit:e1.func,onExiting:e1.func,onExited:e1.func}:{};function Bc(){}kr.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Bc,onEntering:Bc,onEntered:Bc,onExit:Bc,onExiting:Bc,onExited:Bc},kr.UNMOUNTED=xp,kr.EXITED=I5,kr.ENTERING=j5,kr.ENTERED=zc,kr.EXITING=bN;var bu1={},Su1=function(a,n){return a&&n&&n.split(" ").forEach(function(r){return Hu1(a,r)})},SN=function(a,n){return a&&n&&n.split(" ").forEach(function(r){return Mu1(a,r)})},FN=(function(t){EE0(a,t);function a(){for(var r,l=arguments.length,i=new Array(l),o=0;o<l;o++)i[o]=arguments[o];return r=t.call.apply(t,[this].concat(i))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(c,m){var u=r.resolveArguments(c,m),p=u[0],f=u[1];r.removeClasses(p,"exit"),r.addClass(p,f?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(c,m)},r.onEntering=function(c,m){var u=r.resolveArguments(c,m),p=u[0],f=u[1],A=f?"appear":"enter";r.addClass(p,A,"active"),r.props.onEntering&&r.props.onEntering(c,m)},r.onEntered=function(c,m){var u=r.resolveArguments(c,m),p=u[0],f=u[1],A=f?"appear":"enter";r.removeClasses(p,A),r.addClass(p,A,"done"),r.props.onEntered&&r.props.onEntered(c,m)},r.onExit=function(c){var m=r.resolveArguments(c),u=m[0];r.removeClasses(u,"appear"),r.removeClasses(u,"enter"),r.addClass(u,"exit","base"),r.props.onExit&&r.props.onExit(c)},r.onExiting=function(c){var m=r.resolveArguments(c),u=m[0];r.addClass(u,"exit","active"),r.props.onExiting&&r.props.onExiting(c)},r.onExited=function(c){var m=r.resolveArguments(c),u=m[0];r.removeClasses(u,"exit"),r.addClass(u,"exit","done"),r.props.onExited&&r.props.onExited(c)},r.resolveArguments=function(c,m){return r.props.nodeRef?[r.props.nodeRef.current,c]:[c,m]},r.getClassNames=function(c){var m=r.props.classNames,u=typeof m=="string",p=u&&m?m+"-":"",f=u?""+p+c:m[c],A=u?f+"-active":m[c+"Active"],Z=u?f+"-done":m[c+"Done"];return{baseClassName:f,activeClassName:A,doneClassName:Z}},r}var n=a.prototype;return n.addClass=function(l,i,o){var c=this.getClassNames(i)[o+"ClassName"],m=this.getClassNames("enter"),u=m.doneClassName;i==="appear"&&o==="done"&&u&&(c+=" "+u),o==="active"&&l&&FE0(l),c&&(this.appliedClasses[i][o]=c,Su1(l,c))},n.removeClasses=function(l,i){var o=this.appliedClasses[i],c=o.base,m=o.active,u=o.done;this.appliedClasses[i]={},c&&SN(l,c),m&&SN(l,m),u&&SN(l,u)},n.render=function(){var l=this.props;l.classNames;var i=ME0(l,["classNames"]);return I0.createElement(kr,pH({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},a})(I0.Component);FN.defaultProps={classNames:""},FN.propTypes=bu1.NODE_ENV!=="production"?pH({},kr.propTypes,{classNames:Vu1,onEnter:e1.func,onEntering:e1.func,onEntered:e1.func,onExit:e1.func,onExiting:e1.func,onExited:e1.func}):{};const LE0={Search:Oe(FN)`
|
|
1838
1838
|
opacity: 0;
|
|
1839
1839
|
transition: opacity 0.3s ease-in-out;
|
|
1840
1840
|
|