PageSourceSearch

https://living-corporate.com/assets/sponsorship-success-CmyyetsG.js

js living-corporate.com collected 2026-10-02 05:01:09 UTC 14,034 bytes, 1 lines download raw bytes

1import{R as y,j as a,b as q,N as Q,r as P,i as _,B as w,o as Y,c as G,aO as L}from"./index-QiiZ-xPT.js";import{C,b as O,c as I,d as N,a as S}from"./card-DkXabqFf.js";import{u as H}from"./useTranslation-XedzLvcK.js";import{C as j}from"./circle-check-BOGFOgJv.js";import{P as V}from"./party-popper-DBClweqV.js";var F,b;function W(){if(b)return F;b=1;var o={linear:function(e,t,n,i){var s=n-t;return s*e/i+t},easeInQuad:function(e,t,n,i){var s=n-t;return s*(e/=i)*e+t},easeOutQuad:function(e,t,n,i){var s=n-t;return-s*(e/=i)*(e-2)+t},easeInOutQuad:function(e,t,n,i){var s=n-t;return(e/=i/2)<1?s/2*e*e+t:-s/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,n,i){var s=n-t;return s*(e/=i)*e*e+t},easeOutCubic:function(e,t,n,i){var s=n-t;return s*((e=e/i-1)*e*e+1)+t},easeInOutCubic:function(e,t,n,i){var s=n-t;return(e/=i/2)<1?s/2*e*e*e+t:s/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,n,i){var s=n-t;return s*(e/=i)*e*e*e+t},easeOutQuart:function(e,t,n,i){var s=n-t;return-s*((e=e/i-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,n,i){var s=n-t;return(e/=i/2)<1?s/2*e*e*e*e+t:-s/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,n,i){var s=n-t;return s*(e/=i)*e*e*e*e+t},easeOutQuint:function(e,t,n,i){var s=n-t;return s*((e=e/i-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,n,i){var s=n-t;return(e/=i/2)<1?s/2*e*e*e*e*e+t:s/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,n,i){var s=n-t;return-s*Math.cos(e/i*(Math.PI/2))+s+t},easeOutSine:function(e,t,n,i){var s=n-t;return s*Math.sin(e/i*(Math.PI/2))+t},easeInOutSine:function(e,t,n,i){var s=n-t;return-s/2*(Math.cos(Math.PI*e/i)-1)+t},easeInExpo:function(e,t,n,i){var s=n-t;return e==0?t:s*Math.pow(2,10*(e/i-1))+t},easeOutExpo:function(e,t,n,i){var s=n-t;return e==i?t+s:s*(-Math.pow(2,-10*e/i)+1)+t},easeInOutExpo:function(e,t,n,i){var s=n-t;return e===0?t:e===i?t+s:(e/=i/2)<1?s/2*Math.pow(2,10*(e-1))+t:s/2*(-Math.pow(2,-10*--e)+2)+t},easeInCirc:function(e,t,n,i){var s=n-t;return-s*(Math.sqrt(1-(e/=i)*e)-1)+t},easeOutCirc:function(e,t,n,i){var s=n-t;return s*Math.sqrt(1-(e=e/i-1)*e)+t},easeInOutCirc:function(e,t,n,i){var s=n-t;return(e/=i/2)<1?-s/2*(Math.sqrt(1-e*e)-1)+t:s/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(e,t,n,i){var s=n-t,r,c,h;return h=1.70158,c=0,r=s,e===0?t:(e/=i)===1?t+s:(c||(c=i*.3),r<Math.abs(s)?(r=s,h=c/4):h=c/(2*Math.PI)*Math.asin(s/r),-(r*Math.pow(2,10*(e-=1))*Math.sin((e*i-h)*(2*Math.PI)/c))+t)},easeOutElastic:function(e,t,n,i){var s=n-t,r,c,h;return h=1.70158,c=0,r=s,e===0?t:(e/=i)===1?t+s:(c||(c=i*.3),r<Math.abs(s)?(r=s,h=c/4):h=c/(2*Math.PI)*Math.asin(s/r),r*Math.pow(2,-10*e)*Math.sin((e*i-h)*(2*Math.PI)/c)+s+t)},easeInOutElastic:function(e,t,n,i){var s=n-t,r,c,h;return h=1.70158,c=0,r=s,e===0?t:(e/=i/2)===2?t+s:(c||(c=i*(.3*1.5)),r<Math.abs(s)?(r=s,h=c/4):h=c/(2*Math.PI)*Math.asin(s/r),e<1?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e*i-h)*(2*Math.PI)/c))+t:r*Math.pow(2,-10*(e-=1))*Math.sin((e*i-h)*(2*Math.PI)/c)*.5+s+t)},easeInBack:function(e,t,n,i,s){var r=n-t;return s===void 0&&(s=1.70158),r*(e/=i)*e*((s+1)*e-s)+t},easeOutBack:function(e,t,n,i,s){var r=n-t;return s===void 0&&(s=1.70158),r*((e=e/i-1)*e*((s+1)*e+s)+1)+t},easeInOutBack:function(e,t,n,i,s){var r=n-t;return s===void 0&&(s=1.70158),(e/=i/2)<1?r/2*(e*e*(((s*=1.525)+1)*e-s))+t:r/2*((e-=2)*e*(((s*=1.525)+1)*e+s)+2)+t},easeInBounce:function(e,t,n,i){var s=n-t,r;return r=o.easeOutBounce(i-e,0,s,i),s-r+t},easeOutBounce:function(e,t,n,i){var s=n-t;return(e/=i)<1/2.75?s*(7.5625*e*e)+t:e<2/2.75?s*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?s*(7.5625*(e-=2.25/2.75)*e+.9375)+t:s*(7.5625*(e-=2.625/2.75)*e+.984375)+t},easeInOutBounce:function(e,t,n,i){var s=n-t,r;return e<i/2?(r=o.easeInBounce(e*2,0,s,i),r*.5+t):(r=o.easeOutBounce(e*2-i,0,s,i),r*.5+s*.5+t)}};return F=o,F}var U=W();function X(o){return o*Math.PI/180}function u(o,e){return o+Math.random()*(e-o)}function z(o,e){return Math.floor(o+Math.random()*(e-o+1))}var g;(function(o){o[o.Circle=0]="Circle",o[o.Square=1]="Square",o[o.Strip=2]="Strip"})(g||(g={}));var f;(function(o){o[o.Positive=1]="Positive",o[o.Negative=-1]="Negative"})(f||(f={}));const K=1e3/60;class ${constructor(e,t,n,i){this.getOptions=t;const{colors:s,initialVelocityX:r,initialVelocityY:c}=this.getOptions();this.context=e,this.x=n,this.y=i,this.w=u(5,20),this.h=u(5,20),this.radius=u(5,10),this.vx=typeof r=="number"?u(-r,r):u(r.min,r.max),this.vy=typeof c=="number"?u(-c,0):u(c.min,c.max),this.shape=z(0,2),this.angle=X(u(0,360)),this.angularSpin=u(-.2,.2),this.color=s[Math.floor(Math.random()*s.length)],this.rotateY=u(0,1),this.rotationDirection=u(0,1)?f.Positive:f.Negative}update(e){const{gravity:t,wind:n,friction:i,opacity:s,drawShape:r}=this.getOptions(),c=e/K;this.x+=this.vx*c,this.y+=this.vy*c,this.vy+=t*c,this.vx+=n*c,this.vx*=i**c,this.vy*=i**c,this.rotateY>=1&&this.rotationDirection===f.Positive?this.rotationDirection=f.Negative:this.rotateY<=-1&&this.rotationDirection===f.Negative&&(this.rotationDirection=f.Positive);const h=.1*this.rotationDirection*c;if(this.rotateY+=h,this.angle+=this.angularSpin,this.context.save(),this.context.translate(this.x,this.y),this.context.rotate(this.angle),this.context.scale(1,this.rotateY),this.context.rotate(this.angle),this.context.beginPath(),this.context.fillStyle=this.color,this.context.strokeStyle=this.color,this.context.globalAlpha=s,this.context.lineCap="round",this.context.lineWidth=2,r&&typeof r=="function")r.call(this,this.context);else switch(this.shape){case g.Circle:{this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break}case g.Square:{this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break}case g.Strip:{this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h);break}}
1this.context.closePath(),this.context.restore()}}class J{constructor(e,t){this.x=0,this.y=0,this.w=0,this.h=0,this.lastNumberOfPieces=0,this.tweenProgress=0,this.tweenFrom=0,this.particles=[],this.particlesGenerated=0,this.removeParticleAt=i=>{this.particles.splice(i,1)},this.getParticle=()=>{const i=u(this.x,this.w+this.x),s=u(this.y,this.h+this.y);return new $(this.context,this.getOptions,i,s)},this.animate=i=>{const{canvas:s,context:r,particlesGenerated:c,lastNumberOfPieces:h}=this,{run:p,recycle:m,numberOfPieces:x,debug:B,tweenFunction:A,tweenDuration:T}=this.getOptions();if(!p)return!1;const M=this.particles.length,v=m?M:c;if(v<x){h!==x&&(this.tweenProgress=0,this.tweenFrom=v,this.lastNumberOfPieces=x),this.tweenProgress=Math.min(T,Math.max(0,this.tweenProgress+i));const d=A(this.tweenProgress,this.tweenFrom,x,T),l=Math.round(d-v);for(let k=0;k<l;k++)this.particles.push(this.getParticle());this.particlesGenerated+=l}B&&(r.font="12px sans-serif",r.fillStyle="#333",r.textAlign="right",r.fillText(`Particles: ${M}`,s.width-10,s.height-20));for(let d=this.particles.length-1;d>=0;d--){const l=this.particles[d];l.update(i),(l.y>s.height||l.y<-100||l.x>s.width+100||l.x<-100)&&(m&&v<=x?this.particles[d]=this.getParticle():this.removeParticleAt(d))}return M>0||v<x},this.canvas=e;const n=this.canvas.getContext("2d");if(!n)throw new Error("Could not get canvas context");this.context=n,this.getOptions=t}}const E={width:typeof window<"u"?window.innerWidth:300,height:typeof window<"u"?window.innerHeight:200,numberOfPieces:200,friction:.99,wind:0,gravity:.1,initialVelocityX:4,initialVelocityY:10,colors:["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548"],opacity:1,debug:!1,tweenFunction:U.easeInOutQuad,tweenDuration:5e3,recycle:!0,run:!0};class Z{constructor(e,t){this.lastFrameTime=0,this.setOptionsWithDefaults=i=>{const s={confettiSource:{x:0,y:0,w:this.canvas.width,h:0}};this._options={...s,...E,...i},Object.assign(this,i.confettiSource)},this.update=(i=0)=>{const{options:{run:s,onConfettiComplete:r,frameRate:c},canvas:h,context:p}=this,m=Math.min(i-this.lastFrameTime,50);if(c&&m<1e3/c){this.rafId=requestAnimationFrame(this.update);return}this.lastFrameTime=i-(c?m%c:0),s&&(p.fillStyle="white",p.clearRect(0,0,h.width,h.height)),this.generator.animate(m)?this.rafId=requestAnimationFrame(this.update):(r&&typeof r=="function"&&this.generator.particlesGenerated>0&&r.call(this,this),this._options.run=!1)},this.reset=()=>{this.generator&&this.generator.particlesGenerated>0&&(this.generator.particlesGenerated=0,this.generator.particles=[],this.generator.lastNumberOfPieces=0)},this.stop=()=>{this.options={run:!1},this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=void 0)},this.canvas=e;const n=this.canvas.getContext("2d");if(!n)throw new Error("Could not get canvas context");this.context=n,this.generator=new J(this.canvas,()=>this.options),this.options=t,this.update()}get options(){return this._options}set options(e){const t=this._options?.run,n=this._options?.recycle;this.setOptionsWithDefaults(e),this.generator&&(Object.assign(this.generator,this.options.confettiSource),typeof e.recycle=="boolean"&&e.recycle&&n===!1&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),typeof e.run=="boolean"&&e.run&&t===!1&&this.update()}}const ee=y.createRef();class D extends y.Component{constructor(e){super(e),this.canvas=y.createRef(),this.canvas=e.canvasRef||ee}componentDidMount(){if(this.canvas.current){const e=R(this.props)[0];this.confetti=new Z(this.canvas.current,e)}}componentDidUpdate(){const e=R(this.props)[0];this.confetti&&(this.confetti.options=e)}componentWillUnmount(){this.confetti&&this.confetti.stop(),this.confetti=void 0}render(){const[e,t]=R(this.props),n={zIndex:2,position:"absolute",pointerEvents:"none",top:0,left:0,bottom:0,right:0,...t.style};return a.jsx("canvas",{width:e.width,height:e.height,ref:this.canvas,...t,style:n})}}D.defaultProps={...E};D.displayName="ReactConfetti";function R(o){const e={},t={},n={},i=[...Object.keys(E),"confettiSource","drawShape","onConfettiComplete","frameRate"],s=["canvasRef"];for(const r in o){const c=o[r];i.includes(r)?e[r]=c:s.includes(r)?s[r]=c:n[r]=c}return[e,n,t]}const te=y.forwardRef((o,e)=>a.jsx(D,{canvasRef:e,...o}));function oe(){const{t:o}=H(),[,e]=q(),t=Q(),n=new URLSearchParams(t),i=n.get("session_id"),s=n.get("sponsorship"),[r,c]=P.useState(!0),h=_({mutationFn:async()=>(await L("POST","/api/sponsorship/activate",{sessionId:i,sponsorshipId:s})).json()});return P.useEffect(()=>{i&&s&&!h.isSuccess&&!h.isPending&&!h.isError&&h.mutate()},[i,s]),P.useEffect(()=>{const p=setTimeout(()=>c(!1),5e3);return()=>clearTimeout(p)},[]),!i||!s?a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-50 to-blue-50",children:a.jsxs(C,{className:"max-w-md",children:[a.jsxs(O,{children:[a.jsx(I,{children:o("sponsor.success.invalidLinkTitle")}),a.jsx(N,{children:o("sponsor.success.invalidLinkDescription")})]}),a.jsx(S,{children:a.jsx(w,{onClick:()=>e("/"),"data-testid":"button-go-home",children:o("sponsor.success.goHome")})})]})}):h.isPending?a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-50 to-blue-50",children:a.jsxs("div",{className:"text-center",children:[a.jsx(Y,{className:"h-12 w-12 animate-spin text-primary mx-auto mb-4"}),a.jsx("p",{className:"text-gray-600",children:o("sponsor.success.activating")})]})}):h.isError?a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-50 to-blue-50",children:a.jsxs(C,{className:"max-w-md",children:[a.jsxs(O,{children:[a.jsx(I,{children:o("sponsor.success.activationErrorTitle")}),a.jsx(N,{children:o("sponsor.success.activationErrorDescription")})]}),a.jsx(S,{children:a.jsx(w,{onClick:()=>e("/"),"data-testid":"button-go-home",children:o("sponsor.success.goHome")})})]})}):a.jsxs(a.Fragment,{children:[r&&a.jsx(te,{recycle:!1,numberOfPieces:300}),a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-green-50 via-emerald-50 to-teal-50 py-12 px-4",children:a.jsxs(C,{className:"max-w-lg text-center",children:[a.jsxs(O,{children:[a.jsx("div",{className:"mx-auto mb-4",children:a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"h-20 w-20 rounded-full bg-gradient-to-br from-green-400 to-emerald-500 flex items-center justify-center mx-auto",children:a.jsx(j,{className:"h-12 w-12 text-white"})}),a.jsx("div",{className:"absolute -top-2 -right-2 h-10 w-10 rounded-full bg-amber-400 flex items-center justify-center animate-bounce",children:a.jsx(V,{className:"h-6 w-6 text-white"})})]})}),a.jsx(I,{className:"text-2xl","data-testid":"success-title",children:o("sponsor.success.championTitle")}),a.jsx(N,{className:"text-base",children:o("sponsor.success.championDescription")})]}),a.jsxs(S,{className:"space-y-6",children:[a.jsxs("div",{className:"bg-gradient-to-r from-purple-50 to-violet-50 rounded-lg p-4 text-left",children:[a.jsx("h3",{className:"font-semibold text-purple-900 mb-2",children:o("sponsor.success.whatsNext")}),a.jsxs("ul",{className:"space-y-2 text-sm text-purple-800",children:[a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(j,{className:"h-4 w-4 mt-0.5 text-purple-600 shrink-0"}),a.jsx("span",{children:o("sponsor.success.nextStep1")})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(j,{className:"h-4 w-4 mt-0.5 text-purple-600 shrink-0"}),a.jsx("span",{children:o("sponsor.success.nextStep2")})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(j,{className:"h-4 w-4 mt-0.5 text-purple-600 shrink-0"}),a.jsx("span",{children:o("sponsor.success.nextStep3")})]})]})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[a.jsx(w,{variant:"outline",onClick:()=>e("/"),"data-testid":"button-go-home",children:o("sponsor.success.returnHome")}
1),a.jsxs(w,{onClick:()=>e("/sponsor-dashboard"),"data-testid":"button-view-dashboard",children:[o("sponsor.success.viewDashboard"),a.jsx(G,{className:"ml-2 h-4 w-4"})]})]}),a.jsx("p",{className:"text-sm text-gray-500",children:o("sponsor.success.confirmationEmail")})]})]})})]})}export{oe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.