@leatcom/portal-sessions 0.0.40 → 0.0.41
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.
|
@@ -18725,7 +18725,7 @@ function xE() {
|
|
|
18725
18725
|
}
|
|
18726
18726
|
function gu() {
|
|
18727
18727
|
const e = mn();
|
|
18728
|
-
return /* @__PURE__ */ T.jsx("div", { className: "container m-auto h-
|
|
18728
|
+
return /* @__PURE__ */ T.jsx("div", { className: "container m-auto max-h-screen max-w-3xl", children: /* @__PURE__ */ T.jsx(gn, { children: /* @__PURE__ */ T.jsx(Us, { callback: () => e("../") }) }) });
|
|
18729
18729
|
}
|
|
18730
18730
|
function hh() {
|
|
18731
18731
|
const { session: e } = Zt();
|
|
@@ -102,4 +102,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
102
102
|
* LICENSE.md file in the root directory of this source tree.
|
|
103
103
|
*
|
|
104
104
|
* @license MIT
|
|
105
|
-
*/function Br(){return Br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Br.apply(this,arguments)}function Qs(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}const Lo="get",_o="application/x-www-form-urlencoded";function Vo(e){return e!=null&&typeof e.tagName=="string"}function wb(e){return Vo(e)&&e.tagName.toLowerCase()==="button"}function Eb(e){return Vo(e)&&e.tagName.toLowerCase()==="form"}function xb(e){return Vo(e)&&e.tagName.toLowerCase()==="input"}function Cb(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ab(e,t){return e.button===0&&(!t||t==="_self")&&!Cb(e)}let qo=null;function Sb(){if(qo===null)try{new FormData(document.createElement("form"),0),qo=!1}catch{qo=!0}return qo}const Tb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $s(e){return e!=null&&!Tb.has(e)?(process.env.NODE_ENV!=="production"&&Lt(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+_o+'"')),null):e}function Ob(e,t){let n,r,i,a,s;if(Eb(e)){let c=e.getAttribute("action");r=c?wn(c,t):null,n=e.getAttribute("method")||Lo,i=$s(e.getAttribute("enctype"))||_o,a=new FormData(e)}else if(wb(e)||xb(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||c.getAttribute("action");if(r=h?wn(h,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Lo,i=$s(e.getAttribute("formenctype"))||$s(c.getAttribute("enctype"))||_o,a=new FormData(c,e),!Sb()){let{name:g,type:d,value:E}=e;if(d==="image"){let u=g?g+".":"";a.append(u+"x","0"),a.append(u+"y","0")}else g&&a.append(g,E)}}else{if(Vo(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Lo,r=null,i=_o,s=e}return a&&i==="text/plain"&&(s=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:s}}const Db=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Ib=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],Rb=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],Nb="6";try{window.__reactRouterVersion=Nb}catch{}const Hs=be.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Hs.displayName="ViewTransition");const Td=be.createContext(new Map);process.env.NODE_ENV!=="production"&&(Td.displayName="Fetchers");const Od=be["startTransition"],Dd=yh["flushSync"];function Pb(e){Od?Od(e):e()}function Mi(e){Dd?Dd(e):e()}class Mb{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function Bb(e){let{fallbackElement:t,router:n,future:r}=e,[i,a]=be.useState(n.state),[s,c]=be.useState(),[h,g]=be.useState({isTransitioning:!1}),[d,E]=be.useState(),[u,w]=be.useState(),[o,l]=be.useState(),p=be.useRef(new Map),{v7_startTransition:f}=r||{},m=be.useCallback(A=>{f?Pb(A):A()},[f]),b=be.useCallback((A,N)=>{let{deletedFetchers:I,unstable_flushSync:_,unstable_viewTransitionOpts:Q}=N;I.forEach(V=>p.current.delete(V)),A.fetchers.forEach((V,K)=>{V.data!==void 0&&p.current.set(K,V.data)});let $=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!Q||$){_?Mi(()=>a(A)):m(()=>a(A));return}if(_){Mi(()=>{u&&(d&&d.resolve(),u.skipTransition()),g({isTransitioning:!0,flushSync:!0,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation})});let V=n.window.document.startViewTransition(()=>{Mi(()=>a(A))});V.finished.finally(()=>{Mi(()=>{E(void 0),w(void 0),c(void 0),g({isTransitioning:!1})})}),Mi(()=>w(V));return}u?(d&&d.resolve(),u.skipTransition(),l({state:A,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation})):(c(A),g({isTransitioning:!0,flushSync:!1,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation}))},[n.window,u,d,p,m]);be.useLayoutEffect(()=>n.subscribe(b),[n,b]),be.useEffect(()=>{h.isTransitioning&&!h.flushSync&&E(new Mb)},[h]),be.useEffect(()=>{if(d&&s&&n.window){let A=s,N=d.promise,I=n.window.document.startViewTransition(async()=>{m(()=>a(A)),await N});I.finished.finally(()=>{E(void 0),w(void 0),c(void 0),g({isTransitioning:!1})}),w(I)}},[m,s,d,n.window]),be.useEffect(()=>{d&&s&&i.location.key===s.location.key&&d.resolve()},[d,u,i.location,s]),be.useEffect(()=>{!h.isTransitioning&&o&&(c(o.state),g({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}),l(void 0))},[h.isTransitioning,o]),be.useEffect(()=>{process.env.NODE_ENV!=="production"&&Lt(t==null||!n.future.v7_partialHydration,"`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead")},[]);let C=be.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:A=>n.navigate(A),push:(A,N,I)=>n.navigate(A,{state:N,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(A,N,I)=>n.navigate(A,{replace:!0,state:N,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[n]),S=n.basename||"/",D=be.useMemo(()=>({router:n,navigator:C,static:!1,basename:S}),[n,C,S]);return be.createElement(be.Fragment,null,be.createElement(Pr.Provider,{value:D},be.createElement(Fo.Provider,{value:i},be.createElement(Td.Provider,{value:p.current},be.createElement(Hs.Provider,{value:h},be.createElement(vb,{basename:S,location:i.location,navigationType:i.historyAction,navigator:C,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},i.initialized||n.future.v7_partialHydration?be.createElement(kb,{routes:n.routes,future:n.future,state:i}):t))))),null)}function kb(e){let{routes:t,future:n,state:r}=e;return ab(t,void 0,r,n)}process.env.NODE_ENV;const Fb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Id=be.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:s,state:c,target:h,to:g,preventScrollReset:d,unstable_viewTransition:E}=t,u=Qs(t,Db),{basename:w}=be.useContext(xn),o,l=!1;if(typeof g=="string"&&jb.test(g)&&(o=g,Fb))try{let b=new URL(window.location.href),C=g.startsWith("//")?new URL(b.protocol+g):new URL(g),S=wn(C.pathname,w);C.origin===b.origin&&S!=null?g=S+C.search+C.hash:l=!0}catch{process.env.NODE_ENV!=="production"&&Lt(!1,'<Link to="'+g+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let p=nb(g,{relative:i}),f=qb(g,{replace:s,state:c,target:h,preventScrollReset:d,relative:i,unstable_viewTransition:E});function m(b){r&&r(b),b.defaultPrevented||f(b)}return be.createElement("a",Br({},u,{href:o||p,onClick:l||a?r:m,ref:n,target:h}))});process.env.NODE_ENV!=="production"&&(Id.displayName="Link");const Lb=be.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:a="",end:s=!1,style:c,to:h,unstable_viewTransition:g,children:d}=t,E=Qs(t,Ib),u=Ni(h,{relative:E.relative}),w=er(),o=be.useContext(Fo),{navigator:l,basename:p}=be.useContext(xn),f=o!=null&&$b(u)&&g===!0,m=l.encodeLocation?l.encodeLocation(u).pathname:u.pathname,b=w.pathname,C=o&&o.navigation&&o.navigation.location?o.navigation.location.pathname:null;i||(b=b.toLowerCase(),C=C?C.toLowerCase():null,m=m.toLowerCase()),C&&p&&(C=wn(C,p)||C);const S=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let D=b===m||!s&&b.startsWith(m)&&b.charAt(S)==="/",A=C!=null&&(C===m||!s&&C.startsWith(m)&&C.charAt(m.length)==="/"),N={isActive:D,isPending:A,isTransitioning:f},I=D?r:void 0,_;typeof a=="function"?_=a(N):_=[a,D?"active":null,A?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let Q=typeof c=="function"?c(N):c;return be.createElement(Id,Br({},E,{"aria-current":I,className:_,ref:n,style:Q,to:h,unstable_viewTransition:g}),typeof d=="function"?d(N):d)});process.env.NODE_ENV!=="production"&&(Lb.displayName="NavLink");const _b=be.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:i,replace:a,state:s,method:c=Lo,action:h,onSubmit:g,relative:d,preventScrollReset:E,unstable_viewTransition:u}=e,w=Qs(e,Rb),o=Kb(),l=Qb(h,{relative:d}),p=c.toLowerCase()==="get"?"get":"post",f=m=>{if(g&&g(m),m.defaultPrevented)return;m.preventDefault();let b=m.nativeEvent.submitter,C=(b==null?void 0:b.getAttribute("formmethod"))||c;o(b||m.currentTarget,{fetcherKey:n,method:C,navigate:r,replace:a,state:s,relative:d,preventScrollReset:E,unstable_viewTransition:u})};return be.createElement("form",Br({ref:t,method:p,action:l,onSubmit:i?g:f},w))});process.env.NODE_ENV!=="production"&&(_b.displayName="Form"),process.env.NODE_ENV;var Uo;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Uo||(Uo={}));var Rd;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Rd||(Rd={}));function Vb(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function Nd(e){let t=be.useContext(Pr);return t||(process.env.NODE_ENV!=="production"?Le(!1,Vb(e)):Le(!1)),t}function qb(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,unstable_viewTransition:c}=t===void 0?{}:t,h=hn(),g=er(),d=Ni(e,{relative:s});return be.useCallback(E=>{if(Ab(E,n)){E.preventDefault();let u=r!==void 0?r:ur(g)===ur(d);h(e,{replace:u,state:i,preventScrollReset:a,relative:s,unstable_viewTransition:c})}},[g,h,d,r,i,n,e,a,s,c])}function Ub(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let Gb=0,Yb=()=>"__"+String(++Gb)+"__";function Kb(){let{router:e}=Nd(Uo.UseSubmit),{basename:t}=be.useContext(xn),n=gb();return be.useCallback(function(r,i){i===void 0&&(i={}),Ub();let{action:a,method:s,encType:c,formData:h,body:g}=Ob(r,t);if(i.navigate===!1){let d=i.fetcherKey||Yb();e.fetch(d,n,i.action||a,{preventScrollReset:i.preventScrollReset,formData:h,body:g,formMethod:i.method||s,formEncType:i.encType||c,unstable_flushSync:i.unstable_flushSync})}else e.navigate(i.action||a,{preventScrollReset:i.preventScrollReset,formData:h,body:g,formMethod:i.method||s,formEncType:i.encType||c,replace:i.replace,state:i.state,fromRouteId:n,unstable_flushSync:i.unstable_flushSync,unstable_viewTransition:i.unstable_viewTransition})},[e,t,n])}function Qb(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=be.useContext(xn),i=be.useContext(Cn);i||(process.env.NODE_ENV!=="production"?Le(!1,"useFormAction must be used inside a RouteContext"):Le(!1));let[a]=i.matches.slice(-1),s=Br({},Ni(e||".",{relative:n})),c=er();if(e==null){s.search=c.search;let h=new URLSearchParams(s.search);h.has("index")&&h.get("index")===""&&(h.delete("index"),s.search=h.toString()?"?"+h.toString():"")}return(!e||e===".")&&a.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:Nn([r,s.pathname])),ur(s)}function $b(e,t){t===void 0&&(t={});let n=be.useContext(Hs);n==null&&(process.env.NODE_ENV!=="production"?Le(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):Le(!1));let{basename:r}=Nd(Uo.useViewTransitionState),i=Ni(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=wn(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=wn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ns(i.pathname,s)!=null||Ns(i.pathname,a)!=null}const Hb="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.37482%209.55838C0.802045%2011.696%200.887351%2013.9567%201.61959%2016.045C2.35183%2018.1334%203.69695%2019.9524%205.47921%2021.2642C7.26146%2022.5761%209.39798%2023.3199%2011.6096%2023.3985C13.8212%2023.477%2016.0051%2022.8866%2017.876%2021.7045C19.7468%2020.5223%2021.2175%2018.8034%2022.0961%2016.7722C22.9746%2014.7411%2023.2201%2012.4921%2022.8004%2010.3193C22.3807%208.1464%2021.3154%206.15066%2019.7436%204.59277C18.1718%203.03489%2016.1667%201.98732%2013.9902%201.58693M7.14096%202.53681C5.21049%203.48732%203.60119%204.98315%202.51232%206.8391M10.7049%201.48193C10.452%201.51191%2010.2003%201.55066%209.95012%201.59811M18.1995%2015.656C18.757%2014.5927%2019.0317%2013.4039%2018.9971%2012.2038C18.9625%2011.0037%2018.6198%209.83263%2018.002%208.8032C17.3842%207.77377%2016.512%206.92055%2015.4692%206.32553C14.4264%205.73051%2013.2481%205.4137%2012.0476%205.40554C10.847%205.39739%209.66449%205.69816%208.61372%206.27895C7.56295%206.85974%206.67923%207.70104%206.04747%208.72198C5.41572%209.74292%205.05717%2010.9092%205.00628%2012.1087C4.9554%2013.3082%205.21389%2014.5007%205.75691%2015.5714M9.15764%2013.3648C9.00624%2012.9162%208.96314%2012.4382%209.03189%2011.9698C9.10064%2011.5014%209.27926%2011.0559%209.55317%2010.6697C9.82708%2010.2836%2010.1885%209.96774%2010.6079%209.74803C11.0272%209.52832%2011.4926%209.41098%2011.966%209.4056C12.4394%209.40023%2012.9074%209.50697%2013.3316%209.71709C13.7559%209.92722%2014.1244%2010.2348%2014.407%2010.6146C14.6896%2010.9944%2014.8783%2011.4358%2014.9576%2011.9025C15.037%2012.3692%2015.0048%2012.8481%2014.8636%2013.3M14.0993%2010.2622C14.0043%2010.1691%2013.9032%2010.0825%2013.7967%2010.0028M8.2478%2018.3147C9.32147%2018.9965%2010.5606%2019.3728%2011.832%2019.4033C13.1035%2019.4339%2014.3592%2019.1174%2015.4644%2018.488'%20stroke='%233430FF'%20stroke-width='2'%20stroke-linecap='round'/%3e%3c/svg%3e";function Wb(){const e=hn(),{t}=mt(),n=ir();return k.useEffect(()=>{n.sessionUuid&&e(`/${n.sessionUuid}`)},[n.sessionUuid,e]),T.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center gap-12 text-center",children:[T.jsxs("div",{className:"flex items-center justify-center gap-3",children:[T.jsx("img",{alt:"logo",src:Hb,className:"z-10 h-16 w-16 hover:animate-spin"}),T.jsxs("p",{className:"z-10 text-7xl font-semibold tracking-wide text-gray-600",children:["Welcome to ",T.jsx("span",{className:"italic",children:"PortalSessions"})]})]}),n.sessionUuid?T.jsx(gt,{style:{padding:"1.5rem 2rem"},label:t("continue"),onClick:()=>e(`/${n.sessionUuid}`)}):T.jsx("p",{className:"text-error-600",children:`${t("somethingWentWrong")} ${t("portalSessionNotFound")}.`})]})}function Jb(){const e=hn(),{t}=mt(),{sessionUuid:n}=ir(),{session:r,isLoading:i,mutate:a}=Ht();return k.useEffect(()=>{if(!i&&r){const s=r.type in Pn?`/${r.type.toLowerCase()}`:"/";e(s)}},[i,a,e,r]),i?T.jsx(Tc,{}):T.jsx("div",{className:"flex w-full items-center justify-center text-error-600",children:`${t("portalSessionNotFound")} (${n})`})}Mr([{path:"/",element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ws,{})},{path:"/top-up/:hash",element:T.jsx(Md,{})},{path:"/redeem/:hash",element:T.jsx(Pd,{})}]}]);function Ws(){const{t:e}=mt(),[t,n]=k.useState(""),[r,i]=k.useState(!1),{session:a}=Ht(),s=hn(),c=a==null?void 0:a.input_data.scanner_type,h=k.useCallback(()=>a.results.remaining_amount??(a==null?void 0:a.input_data.amount_in_cents),[a]),g=k.useCallback(async()=>{i(!0);const{data:{data:d}}=await ja.get(t);s(`${a.type===pr.REDEEM_GIFTCARD?"redeem":"top-up"}/${d.hash}`)},[t,s,a]);return k.useEffect(()=>{c===mn.CAMERA&&t&&!r&&g().then()},[t,r,c,g]),(a==null?void 0:a.type)===pr.REDEEM_GIFTCARD&&!(a!=null&&a.input_data.amount_in_cents)?T.jsx(T.Fragment,{children:e("xIsRequired",{x:"Amount in cents"})}):T.jsx("div",{className:"container m-auto max-h-screen max-w-3xl",children:T.jsx(un,{children:T.jsxs("div",{className:"flex flex-col gap-3",children:[T.jsx(lt,{size:"sm",weight:"extralight",children:e("scanGiftcard")}),(a==null?void 0:a.type)===pr.REDEEM_GIFTCARD&&T.jsx(lt,{size:"lg",children:`${e("amountToBePaid")}: ${qr(h())}`}),T.jsx(co,{dataSetter:n,type:c,label:e("hash")}),c===mn.HAND_SCANNER&&T.jsx("div",{children:T.jsx(gt,{type:"submit",label:e("submit"),onClick:g})})]})})})}function Pd(){const{t:e}=mt(),{hash:t}=xd(),{giftcard:n,mutate:r}=Ol(t),{session:i,mutate:a}=Ht(),{onUseGiftcard:s}=ir(),c=hn(),h=(i==null?void 0:i.input_data.amount_in_cents)??0,g=(i==null?void 0:i.input_data.allow_multiple_giftcards)??!0;if(!n)return T.jsx(T.Fragment,{children:e("giftcardNotFound")});const d=async()=>{const w=await ja.transaction(n.uuid,-u());await r();const o=await a(),l=o==null?void 0:o.data.data.events;Ui(l),Xe.success(`${e("transactionSuccessful")}!`),s&&s(w.data.data)},E=()=>i.results.remaining_amount??h,u=()=>Math.min(E(),n.amount_in_cents);return T.jsx("div",{className:"container m-auto",children:T.jsx(un,{children:T.jsxs("div",{className:"flex h-96 flex-col items-center justify-between",children:[T.jsxs("div",{children:[T.jsxs(lt,{size:"md",align:"center",children:[e("giftcard"),": ",n.hash]}),T.jsx(lt,{size:"sm",align:"center",weight:"light",className:"text-gray-500",children:n.expiration_date?e("expiresAtDate",{date:n.formatted_expiration_date}):n.formatted_expiration_date})]}),T.jsxs("div",{children:[T.jsx(lt,{size:"lg",align:"center",children:e("balance")}),T.jsx(lt,{size:"4xl",align:"center",children:n.display_amount})]}),T.jsx("div",{className:"mx-auto flex gap-2",children:u()?T.jsx(gt,{label:e("confirmAndPay",{amount:qr(u(),i==null?void 0:i.currency)}),onClick:d}):T.jsxs("div",{className:"flex flex-col gap-4",children:[T.jsx(lt,{size:"lg",align:"center",className:"text-gray-500",children:e("xOfYPaid",{x:E()?qr(h-E(),i==null?void 0:i.currency):e("fullAmount"),y:qr(h,i==null?void 0:i.currency)})}),g&&E()?T.jsx(gt,{label:e("useAnotherGiftcard"),onClick:()=>c("../")}):null]})})]})})})}function Md(){const{t:e}=mt(),{hash:t}=xd(),{giftcard:n,mutate:r}=Ol(t),[i,a]=k.useState(!1),[s,c]=k.useState("");if(!n)return T.jsx(T.Fragment,{children:e("giftcardNotFound")});const h=async()=>{const g=await ja.transaction(n.uuid,parseFloat(s)*100);await r(),Xe.success(`${e("transactionSuccessful")}! ${e("totalUpgradedAmount")}: ${qr(g.data.data.amount_in_cents)}`),a(!1)};return T.jsxs("div",{className:"container m-auto",children:[T.jsx(un,{children:T.jsxs("div",{className:"flex h-96 flex-col items-center justify-between",children:[T.jsxs("div",{children:[T.jsxs(lt,{size:"md",align:"center",children:[e("giftcard"),": ",n.hash]}),T.jsx(lt,{size:"sm",align:"center",weight:"light",className:"text-gray-500",children:n.expiration_date?e("expiresAtDate",{date:n.formatted_expiration_date}):n.formatted_expiration_date})]}),T.jsxs("div",{children:[T.jsx(lt,{size:"lg",align:"center",children:e("balance")}),T.jsx(lt,{size:"4xl",align:"center",children:n.display_amount})]}),T.jsx("div",{className:"mx-auto flex gap-2",children:T.jsx(gt,{label:e("topUp"),onClick:()=>a(!0)})})]})}),T.jsx(Er,{isOpen:i,onClose:()=>a(!1),children:T.jsxs("div",{className:"flex flex-col gap-4",children:[T.jsx(Ua,{value:s,valueSetter:c}),T.jsx(gt,{label:e("submit"),onClick:h})]})})]})}Mr([{path:"/",element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(kd,{})},{path:"email",element:T.jsx(Fd,{})},{path:"identifier",element:T.jsx(Js,{})},{path:"register",element:T.jsx(jd,{})}]}]);function zb(){const{t:e}=mt(),{contact:t,isLoading:n,mutate:r}=so(),[i,a]=k.useState(),[s,c]=k.useState();k.useEffect(()=>{i||(async()=>{const{data:d}=await Tl.get();a(d.data.elements)})()},[t,i]);const h=(d,E)=>{c({...s,[d]:E})},g=async()=>{s&&(await Tl.update(s),await r(),Xe.success(e("contactAttributesUpdated")))};return!i||n?T.jsx(Tc,{}):T.jsxs("div",{className:"flex h-full flex-col gap-6",children:[T.jsx("div",{className:"flex justify-end",children:T.jsx(gt,{label:e("saveChanges"),onClick:g})}),T.jsx("hr",{}),T.jsx("div",{className:"grid h-full grid-cols-2 gap-x-6 gap-y-2 overflow-y-auto p-1",children:i.map(d=>{if(d.type==="media_upload")return;const E=d.disabled?T.jsx(pm,{type:d.type,value:t.current_display_values[d.name],label:d.label,underlying_value:t.current_values[d.name]}):T.jsx(gm,{...d,onChange:h});return T.jsx("div",{children:E},d.id)})})]})}function Zb(){const{t:e}=mt(),{data:t,isLoading:n,mutate:r}=om(),i=async s=>{await im.update({subscription_type_id:s.subscription_type.id}),await r()},a=s=>{const c=s.subscription_type.strategy,h=s.status;if(c===br.FUNCTIONAL)return e("disabled");switch(h){case Xr.SUBSCRIBED:return e("unsubscribe");case Xr.UNSUBSCRIBED:return c===br.OPT_IN||br.OPT_OUT?e("subscribe"):e("sendConfirmationEmail");case Xr.PENDING_CONFIRMATION:return e("sendReminder");default:return""}};return n?T.jsx(Rf,{rows:5}):T.jsx("div",{children:t.data.data.map(s=>T.jsxs("div",{className:"mb-4 flex justify-between rounded-lg border border-gray-200 px-6 py-4 bg-white",children:[T.jsxs("div",{children:[T.jsxs("div",{className:"flex gap-3",children:[T.jsx(lt,{weight:"normal",children:s.subscription_type.name}),T.jsx("span",{className:`flex gap-2 rounded-full px-2 py-0.5 text-sm font-light ${s.is_subscribed?"bg-[#03985515] text-[#039855]":"bg-[#E0273115] text-[#E02731]"}`,children:s.status.charAt(0)+s.status.substring(1).toLowerCase()})]}),T.jsx(lt,{color:"text-gray-400",size:"sm",children:s.subscription_type.description})]}),T.jsx(gt,{style:{color:"inherit",backgroundColor:"white",border:"1px solid rgb(229 231 235)"},disabled:s.subscription_type.strategy===br.FUNCTIONAL,onClick:()=>i(s),label:a(s)})]},s.subscription_type.uuid))})}const Bd="contact-identifiers",Xb={create:e=>xt.instance.post(pt(Bd),e)},ew=()=>{const{data:e,error:t,isLoading:n,isValidating:r,mutate:i}=Kn(pt(Bd));return{identifiers:e==null?void 0:e.data.data,data:e,error:t,isLoading:n,isValidating:r,mutate:i}};function tw(){const{t:e}=mt(),{data:t,isLoading:n,mutate:r}=ew(),[i,a]=k.useState(!1),[s,c]=k.useState(""),[h,g]=k.useState(!1),d=()=>{g(!0),Xb.create({value:s}).then(()=>{r(),a(!1)}).catch(E=>Xe.error(E)).finally(()=>g(!1))};return n?T.jsx(Rf,{rows:5}):T.jsxs("div",{className:"flex flex-col gap-2",children:[T.jsx("div",{className:"flex justify-end",children:T.jsx(gt,{label:e("addIdentifier"),onClick:()=>a(!0)})}),t.data.data.map(E=>T.jsx("div",{className:"flex justify-between rounded-lg border border-gray-200 px-6 py-4 bg-white",children:T.jsxs("div",{children:[T.jsx(lt,{weight:"semibold",children:E.name}),T.jsx(lt,{children:E.value})]})},E.value)),T.jsx(Er,{isOpen:i,onClose:()=>a(!1),title:e("addIdentifier"),children:T.jsxs("div",{className:"flex flex-col gap-4 min-w-96",children:[T.jsx(wr,{id:"add-identifier",name:"identifier",label:"Identifier value",type:"text",onChange:(E,u)=>c(u),autoFocus:!0}),T.jsx(gt,{label:e("addIdentifier"),onClick:d,disabled:h})]})})]})}function nw(){const{t:e}=mt(),[t,n]=k.useState(),r=k.useMemo(()=>[{id:0,label:e("contactDetails"),icon:T.jsx("path",{d:"M10 0a10 10 0 1 0 10 10A10.011 10.011 0 0 0 10 0Zm0 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm0 13a8.949 8.949 0 0 1-4.951-1.488A3.987 3.987 0 0 1 9 13h2a3.987 3.987 0 0 1 3.951 3.512A8.949 8.949 0 0 1 10 18Z"}),content:T.jsx(zb,{})},{id:1,label:e("subscriptions"),icon:T.jsx("path",{d:"M18 7.5h-.423l-.452-1.09.3-.3a1.5 1.5 0 0 0 0-2.121L16.01 2.575a1.5 1.5 0 0 0-2.121 0l-.3.3-1.089-.452V2A1.5 1.5 0 0 0 11 .5H9A1.5 1.5 0 0 0 7.5 2v.423l-1.09.452-.3-.3a1.5 1.5 0 0 0-2.121 0L2.576 3.99a1.5 1.5 0 0 0 0 2.121l.3.3L2.423 7.5H2A1.5 1.5 0 0 0 .5 9v2A1.5 1.5 0 0 0 2 12.5h.423l.452 1.09-.3.3a1.5 1.5 0 0 0 0 2.121l1.415 1.413a1.5 1.5 0 0 0 2.121 0l.3-.3 1.09.452V18A1.5 1.5 0 0 0 9 19.5h2a1.5 1.5 0 0 0 1.5-1.5v-.423l1.09-.452.3.3a1.5 1.5 0 0 0 2.121 0l1.415-1.414a1.5 1.5 0 0 0 0-2.121l-.3-.3.452-1.09H18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 18 7.5Zm-8 6a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Z"}),content:T.jsx(Zb,{})},{id:2,label:e("identifiers"),icon:T.jsx("path",{d:"M18 7.5h-.423l-.452-1.09.3-.3a1.5 1.5 0 0 0 0-2.121L16.01 2.575a1.5 1.5 0 0 0-2.121 0l-.3.3-1.089-.452V2A1.5 1.5 0 0 0 11 .5H9A1.5 1.5 0 0 0 7.5 2v.423l-1.09.452-.3-.3a1.5 1.5 0 0 0-2.121 0L2.576 3.99a1.5 1.5 0 0 0 0 2.121l.3.3L2.423 7.5H2A1.5 1.5 0 0 0 .5 9v2A1.5 1.5 0 0 0 2 12.5h.423l.452 1.09-.3.3a1.5 1.5 0 0 0 0 2.121l1.415 1.413a1.5 1.5 0 0 0 2.121 0l.3-.3 1.09.452V18A1.5 1.5 0 0 0 9 19.5h2a1.5 1.5 0 0 0 1.5-1.5v-.423l1.09-.452.3.3a1.5 1.5 0 0 0 2.121 0l1.415-1.414a1.5 1.5 0 0 0 0-2.121l-.3-.3.452-1.09H18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 18 7.5Zm-8 6a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Z"}),content:T.jsx(tw,{})}],[e]);return k.useEffect(()=>{t||n(r[0])},[r,t]),T.jsxs("div",{className:"h-full sm:flex",children:[T.jsx("ul",{className:"flex-column space-y mb-4 space-y-4 text-sm font-medium text-gray-500 md:mb-0 md:me-4",children:r.map(i=>T.jsx("li",{children:T.jsxs("div",{className:`inline-flex w-full cursor-pointer items-center rounded-lg px-4 py-3 ${i.id===(t==null?void 0:t.id)?"bg-primary-600 text-white":"bg-gray-50 hover:bg-gray-100 hover:text-gray-900"}`,onClick:()=>n(i),children:[T.jsx("svg",{className:`me-2 h-4 w-4 ${i.id===(t==null?void 0:t.id)?"text-white":"text-gray-500"}`,"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20",children:i.icon}),T.jsx("p",{className:"truncate",children:i.label})]})},i.id))}),T.jsx("div",{className:"text-medium h-full w-full rounded-lg bg-gray-50 p-6",children:t&&t.content})]})}function rw(){const{data:e,isLoading:t,mutate:n}=rm(),{mutate:r}=so(),{onClaimReward:i}=ir(),{t:a}=mt(),{mutate:s}=Ht(),c=async h=>{const g=await nm.claim(h);n(),r();const d=await s(),E=d==null?void 0:d.data.data.events;Ui(E);const u=E.filter(o=>o.data.reward.uuid===g.data.data.uuid),{data:{uuid:w}}=u.reduce((o,l)=>new Date(o.created_at)>new Date(l.created_at)?o:l);Xe.success(a("rewardClaimed",{name:g.data.data.title})),i&&i(g.data.data,w)};return T.jsx(Nf,{header:t?[]:e.data.data.header.items,rows:t?[]:e.data.data.rows,pending:t,onClick:c})}function iw(){const{data:e,isLoading:t,mutate:n}=am(),{mutate:r}=Ht(),{onRedeemVoucher:i}=ir(),{t:a}=mt(),s=async c=>{const h=await Va.redeemById(c),g=await r(),d=g==null?void 0:g.data.data.events;Ui(d),n(),Xe.success(a("voucherSuccessfullyRedeemed")),i&&i(h.data.data)};return T.jsx(Nf,{header:t?[]:e.data.data.header.items,rows:t?[]:e.data.data.rows,pending:t,onClick:s})}function ow(){const{t:e}=mt(),{session:{loyalty_program:t}}=Ht(),{contact:n,isLoading:r}=so();if(r)return T.jsx(T.Fragment,{});const i=[{value:n.credit_balance.balance,label:t.custom_credit_name||e("points")},{value:n.current_display_values.loyalty_number_of_transactions,label:e("transactions")},{value:n.tier?n.tier.name:"-",label:e("tier")}];return T.jsxs("div",{className:"flex w-full justify-between text-inherit",children:[T.jsxs("div",{children:[T.jsx("p",{className:"text-md font-medium",children:`${n.current_display_values.firstname} ${n.current_display_values.lastname}`}),T.jsx("p",{className:"text-sm",children:n.current_display_values.email})]}),T.jsx("div",{className:"flex gap-8",children:i.map(a=>T.jsxs("div",{className:"flex flex-col items-center",children:[T.jsx("p",{className:"text-md font-medium",children:a.value}),T.jsx("p",{className:"text-sm",children:a.label})]},a.label))})]})}function aw(){const{t:e}=mt(),{session:t}=Ht(),n=t.contact,[r,i]=k.useState("rewards");if(!n)return T.jsx(T.Fragment,{children:e("contactNotFound")});const a=()=>{switch(r){case"profile":return T.jsx(nw,{});case"rewards":return T.jsx(rw,{});case"vouchers":return T.jsx(iw,{})}};return T.jsx("div",{className:"container m-auto flex h-full p-4",children:T.jsx(un,{children:T.jsxs("div",{className:"flex h-full flex-col gap-6",children:[T.jsx(ow,{}),T.jsx("hr",{}),T.jsx("div",{children:T.jsx(lm,{elements:[{key:"profile",label:e("profile"),active:r==="profile"},{key:"rewards",label:e("rewards"),active:r==="rewards"},{key:"vouchers",label:e("vouchers"),active:r==="vouchers"}],onClick:s=>i(s)})}),T.jsx("div",{className:"overflow-y-auto",children:a()})]})})})}function sw(){const{session:e}=Ht(),t=hn(),{t:n}=mt();return T.jsxs("div",{className:"m-auto flex flex-col items-center gap-4",children:[T.jsx("p",{children:n("noContactLinked")}),T.jsxs("div",{className:"flex gap-4",children:[e.input_data.enable_registration&&T.jsx(gt,{label:n("registerNewContact"),onClick:()=>t("register")}),e.input_data.enable_email_identification&&T.jsx(gt,{label:n("linkViaEmail"),onClick:()=>t("email")}),T.jsx(gt,{label:n("linkViaCard"),onClick:()=>t("identifier")})]})]})}function Js(){const e=hn();return T.jsx("div",{className:"container m-auto h-full max-w-3xl",children:T.jsx(un,{children:T.jsx(Ka,{callback:()=>e("../")})})})}function kd(){const{session:e}=Ht();return e&&(e.contact?T.jsx(aw,{}):!e.input_data.enable_registration&&!e.input_data.enable_email_identification?T.jsx(Js,{}):T.jsx(sw,{}))}function Fd(){const[e,t]=k.useState(""),{session:n,mutate:r}=Ht(),i=hn(),{t:a}=mt(),s=async()=>{n&&(await uo.setContact(n.uuid,{email:e}),await r(),Xe.success(a("contactSavedToSession")),i("../"))};return T.jsx("div",{className:"container m-auto",children:T.jsx(un,{children:T.jsxs("div",{className:"flex flex-col gap-3",children:[T.jsx("p",{children:a("fillInXBelow",{x:a("emailAddress").toLowerCase()})}),T.jsx(wr,{autoFocus:!0,id:"email-input",name:"email",label:a("emailAddress"),type:"email",onChange:(c,h)=>t(h)}),T.jsx("div",{children:T.jsx(gt,{type:"submit",label:a("linkContact"),onClick:s})})]})})})}function jd(){const[e,t]=k.useState(""),{session:n,mutate:r}=Ht(),i=hn(),{t:a}=mt(),s=async()=>{n&&(await ka.create(e),await r(),Xe.success(a("contactSavedToSession")),i("../"))};return T.jsx("div",{className:"container m-auto",children:T.jsx(un,{children:T.jsxs("div",{className:"flex flex-col gap-3",children:[T.jsx("p",{children:a("fillInXBelow",{x:a("emailAddress").toLowerCase()})}),T.jsx(wr,{autoFocus:!0,id:"email-input",name:"email",label:a("emailAddress"),type:"email",onChange:(c,h)=>t(h)}),T.jsx("div",{children:T.jsx(gt,{type:"submit",label:a("register"),onClick:s})})]})})})}Mr([{path:"/",element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ld,{})},{path:"balance",element:T.jsx(_d,{})}]}]);function Ld(){const e=hn();return T.jsx("div",{className:"container m-auto max-h-screen max-w-3xl",children:T.jsx(un,{children:T.jsx(Ka,{callback:()=>e("balance")})})})}function _d(){const{t:e}=mt(),{balance:t,mutate:n}=tm(),[r,i]=k.useState(""),[a,s]=k.useState(1),[c,h]=k.useState(!1),g=async()=>{r&&(await em.transaction({amount_in_cents:parseFloat(r)*100*a}),await n(),Xe.success(e("prepaidTransactionCreated")),h(!1))};return T.jsxs("div",{className:"container m-auto",children:[T.jsxs(un,{children:[T.jsxs(lt,{size:"lg",align:"center",weight:"normal",children:[e("prepaidBalance"),": ",t==null?void 0:t.balance]}),T.jsx("div",{className:"mt-6 flex justify-center",children:T.jsxs("div",{className:"grid w-1/3 grid-cols-2 gap-x-2",children:[T.jsx(gt,{label:e("upgrade"),onClick:()=>{h(!0),s(1)}}),T.jsx(gt,{label:e("depreciate"),onClick:()=>{h(!0),s(-1)}})]})})]}),T.jsx(Er,{isOpen:c,onClose:()=>h(!1),children:T.jsxs("div",{className:"flex flex-col gap-4",children:[T.jsx(Ua,{value:r,valueSetter:i}),T.jsx(gt,{label:e("submit"),onClick:g})]})})]})}Mr([{path:"/",element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Vd,{})},{path:"success",element:T.jsx(qd,{})}]}]);function Vd(){const{t:e}=mt(),[t,n]=k.useState(""),[r,i]=k.useState(!1),{session:a,mutate:s}=Ht(),c=hn(),h=async()=>{if(t){const{data:{data:g}}=await Xg.create({unit_value:parseFloat(t)});await s(),c("success",{state:{transaction:g}})}};return k.useEffect(()=>{a&&a.contact&&i(!0)},[c,a]),T.jsxs("div",{className:"container m-auto max-h-screen max-w-3xl",children:[T.jsx(un,{children:T.jsx(Ka,{})}),T.jsx(Er,{isOpen:r,children:T.jsxs("div",{className:"flex flex-col gap-4",children:[T.jsxs("p",{className:"text-center",children:[e("unitValue"),":"]}),T.jsx(Ua,{value:t,valueSetter:n}),T.jsx(gt,{label:e("submit"),onClick:h})]})})]})}function qd(){const{state:e}=er(),{t}=mt(),{session:{loyalty_program:n}}=Ht(),{contact:r}=so();return T.jsx("div",{className:"m-auto",children:T.jsx(Ll,{children:T.jsxs("div",{className:"mt-8 flex w-96 flex-col gap-4",children:[T.jsxs(lt,{size:"lg",weight:"bold",align:"center",children:[t("creditReceptionCreated"),"!"]}),e&&e.transaction&&T.jsxs(lt,{color:"text-gray-500",align:"center",children:["+",e.transaction.credits," ",n.custom_credit_name||t("points").toLowerCase()]}),T.jsx("div",{className:"h-24"}),r&&T.jsxs("div",{className:"flex justify-between",children:[T.jsxs(lt,{color:"text-gray-200",children:[t("currentCreditBalance"),":"]}),T.jsxs(lt,{color:"text-gray-200",children:[r.credit_balance.balance," ",n.custom_credit_name||t("points").toLowerCase()]})]})]})})})}Mr([{path:"/",element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ud,{})},{path:"success",element:T.jsx(Gd,{})}]}]);function Ud(){const{t:e}=mt(),[t,n]=k.useState(""),[r,i]=k.useState(""),[a,s]=k.useState(!1),[c,h]=k.useState(!1),{session:g,mutate:d}=Ht(),E=g==null?void 0:g.input_data.scanner_type,u=hn(),w=k.useCallback(async()=>{r&&await uo.setContact(g.uuid,{contact_identifier_value:r});const{data:{data:l}}=await Va.redeemByCode(t),p=await d(),f=p==null?void 0:p.data.data.events;Ui(f),u("success",{state:{voucher:l}})},[t,r,u,g]),o=k.useCallback(async()=>{if(g){s(!0);const{data:{data:l}}=await Va.get(t);l.contact||g.contact?await w():h(!0),s(!1)}},[t,w,g]);return k.useEffect(()=>{E===mn.CAMERA&&t&&!a&&(async()=>await o())()},[t,a,E,o,c]),T.jsxs("div",{className:"container m-auto max-h-screen max-w-3xl",children:[T.jsxs(un,{children:[T.jsx(co,{dataSetter:n,type:E,label:e("voucherCode")}),E===mn.HAND_SCANNER&&T.jsx("div",{className:"pt-3",children:T.jsx(gt,{type:"submit",label:e("redeemVoucher"),onClick:o})})]}),T.jsxs(Er,{isOpen:c,onClose:()=>h(!1),children:[T.jsx("p",{className:"text-error-600 pb-4",children:e("noContactLinkedToVoucher")}),T.jsx(co,{dataSetter:i,type:E,label:e("contactIdentifier")}),E===mn.HAND_SCANNER&&T.jsx("div",{className:"pt-3",children:T.jsx(gt,{type:"submit",label:e("redeemVoucher"),onClick:w})})]})]})}function Gd(){const{t:e}=mt(),{state:t}=er();return T.jsx("div",{className:"m-auto",children:T.jsx(Ll,{children:T.jsx(lt,{size:"lg",align:"center",className:"pt-6",children:e("voucherWithCodeSuccessfullyRedeemed",{code:t.voucher.code})})})})}const uw=Mr([{path:"/",element:T.jsx(Wb,{})},{path:":portalSessionUuid",element:T.jsx(Jb,{}),errorElement:T.jsx("div",{children:"No session UUID"})},{path:Pn.REDEEM_GIFTCARD,element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ws,{})},{path:"redeem/:hash",element:T.jsx(Pd,{})}]},{path:Pn.TOP_UP_GIFTCARD,element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ws,{})},{path:"top-up/:hash",element:T.jsx(Md,{})}]},{path:Pn.PORTAL,element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(kd,{})},{path:"email",element:T.jsx(Fd,{})},{path:"identifier",element:T.jsx(Js,{})},{path:"register",element:T.jsx(jd,{})}]},{path:Pn.PREPAID,element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ld,{})},{path:"balance",element:T.jsx(_d,{})}]},{path:Pn.SAVE,element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Vd,{})},{path:"success",element:T.jsx(qd,{})}]},{path:Pn.VOUCHER,element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ud,{})},{path:"success",element:T.jsx(Gd,{})}]}]),Yd=()=>T.jsx(Bb,{router:uw});function lw(e){return T.jsx(s1,{config:e,payload:{type:e.type??pr.PORTAL,api_key:e.apiKey,shop_uuid:e.shopUuid,contact_uuid:e.contactUuid,...e.amountInCents&&{amount_in_cents:e.amountInCents},...e.allowMultipleGiftcards&&{allow_multiple_giftcards:e.allowMultipleGiftcards},...e.scannerType&&{scanner_type:e.scannerType},...e.enableRegistration&&{enable_registration:e.enableRegistration},...e.enableEmailIdentification&&{enable_email_identification:e.enableEmailIdentification},...e.enableOnScreenKeyboard&&{enable_on_screen_keyboard:e.enableOnScreenKeyboard}},children:T.jsx(Yd,{})})}function cw({uuid:e,host:t}){const[n,r]=k.useState(!1);return k.useEffect(()=>{n||(xt.initialize(void 0,t),r(!0))},[t,n]),n?T.jsxs(k.StrictMode,{children:[T.jsx(Il,{sessionUuid:e,children:T.jsx("div",{className:"flex h-screen w-screen bg-primary-50",children:T.jsxs("div",{className:"flex h-screen w-screen flex-col bg-primary-50",children:[T.jsx("div",{className:"flex h-full overflow-auto",children:T.jsx(Yd,{})}),e&&T.jsx(jl,{})]})})}),T.jsx(Iu,{position:"bottom-center"})]}):T.jsx(T.Fragment,{children:"Initializing..."})}Bt.DefaultSession=cw,Bt.PortalRoute=Pn,Bt.PortalSession=lw,Bt.PortalType=pr,Bt.ScannerType=mn,Bt.SubscriptionStatus=Xr,Bt.SubscriptionStrategy=br,Bt.VoucherStatus=Pl,Object.defineProperty(Bt,Symbol.toStringTag,{value:"Module"})});
|
|
105
|
+
*/function Br(){return Br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Br.apply(this,arguments)}function Qs(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}const Lo="get",_o="application/x-www-form-urlencoded";function Vo(e){return e!=null&&typeof e.tagName=="string"}function wb(e){return Vo(e)&&e.tagName.toLowerCase()==="button"}function Eb(e){return Vo(e)&&e.tagName.toLowerCase()==="form"}function xb(e){return Vo(e)&&e.tagName.toLowerCase()==="input"}function Cb(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ab(e,t){return e.button===0&&(!t||t==="_self")&&!Cb(e)}let qo=null;function Sb(){if(qo===null)try{new FormData(document.createElement("form"),0),qo=!1}catch{qo=!0}return qo}const Tb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $s(e){return e!=null&&!Tb.has(e)?(process.env.NODE_ENV!=="production"&&Lt(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+_o+'"')),null):e}function Ob(e,t){let n,r,i,a,s;if(Eb(e)){let c=e.getAttribute("action");r=c?wn(c,t):null,n=e.getAttribute("method")||Lo,i=$s(e.getAttribute("enctype"))||_o,a=new FormData(e)}else if(wb(e)||xb(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||c.getAttribute("action");if(r=h?wn(h,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Lo,i=$s(e.getAttribute("formenctype"))||$s(c.getAttribute("enctype"))||_o,a=new FormData(c,e),!Sb()){let{name:g,type:d,value:E}=e;if(d==="image"){let u=g?g+".":"";a.append(u+"x","0"),a.append(u+"y","0")}else g&&a.append(g,E)}}else{if(Vo(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Lo,r=null,i=_o,s=e}return a&&i==="text/plain"&&(s=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:s}}const Db=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Ib=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],Rb=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],Nb="6";try{window.__reactRouterVersion=Nb}catch{}const Hs=be.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Hs.displayName="ViewTransition");const Td=be.createContext(new Map);process.env.NODE_ENV!=="production"&&(Td.displayName="Fetchers");const Od=be["startTransition"],Dd=yh["flushSync"];function Pb(e){Od?Od(e):e()}function Mi(e){Dd?Dd(e):e()}class Mb{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function Bb(e){let{fallbackElement:t,router:n,future:r}=e,[i,a]=be.useState(n.state),[s,c]=be.useState(),[h,g]=be.useState({isTransitioning:!1}),[d,E]=be.useState(),[u,w]=be.useState(),[o,l]=be.useState(),p=be.useRef(new Map),{v7_startTransition:f}=r||{},m=be.useCallback(A=>{f?Pb(A):A()},[f]),b=be.useCallback((A,N)=>{let{deletedFetchers:I,unstable_flushSync:_,unstable_viewTransitionOpts:Q}=N;I.forEach(V=>p.current.delete(V)),A.fetchers.forEach((V,K)=>{V.data!==void 0&&p.current.set(K,V.data)});let $=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!Q||$){_?Mi(()=>a(A)):m(()=>a(A));return}if(_){Mi(()=>{u&&(d&&d.resolve(),u.skipTransition()),g({isTransitioning:!0,flushSync:!0,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation})});let V=n.window.document.startViewTransition(()=>{Mi(()=>a(A))});V.finished.finally(()=>{Mi(()=>{E(void 0),w(void 0),c(void 0),g({isTransitioning:!1})})}),Mi(()=>w(V));return}u?(d&&d.resolve(),u.skipTransition(),l({state:A,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation})):(c(A),g({isTransitioning:!0,flushSync:!1,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation}))},[n.window,u,d,p,m]);be.useLayoutEffect(()=>n.subscribe(b),[n,b]),be.useEffect(()=>{h.isTransitioning&&!h.flushSync&&E(new Mb)},[h]),be.useEffect(()=>{if(d&&s&&n.window){let A=s,N=d.promise,I=n.window.document.startViewTransition(async()=>{m(()=>a(A)),await N});I.finished.finally(()=>{E(void 0),w(void 0),c(void 0),g({isTransitioning:!1})}),w(I)}},[m,s,d,n.window]),be.useEffect(()=>{d&&s&&i.location.key===s.location.key&&d.resolve()},[d,u,i.location,s]),be.useEffect(()=>{!h.isTransitioning&&o&&(c(o.state),g({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}),l(void 0))},[h.isTransitioning,o]),be.useEffect(()=>{process.env.NODE_ENV!=="production"&&Lt(t==null||!n.future.v7_partialHydration,"`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead")},[]);let C=be.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:A=>n.navigate(A),push:(A,N,I)=>n.navigate(A,{state:N,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(A,N,I)=>n.navigate(A,{replace:!0,state:N,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[n]),S=n.basename||"/",D=be.useMemo(()=>({router:n,navigator:C,static:!1,basename:S}),[n,C,S]);return be.createElement(be.Fragment,null,be.createElement(Pr.Provider,{value:D},be.createElement(Fo.Provider,{value:i},be.createElement(Td.Provider,{value:p.current},be.createElement(Hs.Provider,{value:h},be.createElement(vb,{basename:S,location:i.location,navigationType:i.historyAction,navigator:C,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},i.initialized||n.future.v7_partialHydration?be.createElement(kb,{routes:n.routes,future:n.future,state:i}):t))))),null)}function kb(e){let{routes:t,future:n,state:r}=e;return ab(t,void 0,r,n)}process.env.NODE_ENV;const Fb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Id=be.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:s,state:c,target:h,to:g,preventScrollReset:d,unstable_viewTransition:E}=t,u=Qs(t,Db),{basename:w}=be.useContext(xn),o,l=!1;if(typeof g=="string"&&jb.test(g)&&(o=g,Fb))try{let b=new URL(window.location.href),C=g.startsWith("//")?new URL(b.protocol+g):new URL(g),S=wn(C.pathname,w);C.origin===b.origin&&S!=null?g=S+C.search+C.hash:l=!0}catch{process.env.NODE_ENV!=="production"&&Lt(!1,'<Link to="'+g+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let p=nb(g,{relative:i}),f=qb(g,{replace:s,state:c,target:h,preventScrollReset:d,relative:i,unstable_viewTransition:E});function m(b){r&&r(b),b.defaultPrevented||f(b)}return be.createElement("a",Br({},u,{href:o||p,onClick:l||a?r:m,ref:n,target:h}))});process.env.NODE_ENV!=="production"&&(Id.displayName="Link");const Lb=be.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:a="",end:s=!1,style:c,to:h,unstable_viewTransition:g,children:d}=t,E=Qs(t,Ib),u=Ni(h,{relative:E.relative}),w=er(),o=be.useContext(Fo),{navigator:l,basename:p}=be.useContext(xn),f=o!=null&&$b(u)&&g===!0,m=l.encodeLocation?l.encodeLocation(u).pathname:u.pathname,b=w.pathname,C=o&&o.navigation&&o.navigation.location?o.navigation.location.pathname:null;i||(b=b.toLowerCase(),C=C?C.toLowerCase():null,m=m.toLowerCase()),C&&p&&(C=wn(C,p)||C);const S=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let D=b===m||!s&&b.startsWith(m)&&b.charAt(S)==="/",A=C!=null&&(C===m||!s&&C.startsWith(m)&&C.charAt(m.length)==="/"),N={isActive:D,isPending:A,isTransitioning:f},I=D?r:void 0,_;typeof a=="function"?_=a(N):_=[a,D?"active":null,A?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let Q=typeof c=="function"?c(N):c;return be.createElement(Id,Br({},E,{"aria-current":I,className:_,ref:n,style:Q,to:h,unstable_viewTransition:g}),typeof d=="function"?d(N):d)});process.env.NODE_ENV!=="production"&&(Lb.displayName="NavLink");const _b=be.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:i,replace:a,state:s,method:c=Lo,action:h,onSubmit:g,relative:d,preventScrollReset:E,unstable_viewTransition:u}=e,w=Qs(e,Rb),o=Kb(),l=Qb(h,{relative:d}),p=c.toLowerCase()==="get"?"get":"post",f=m=>{if(g&&g(m),m.defaultPrevented)return;m.preventDefault();let b=m.nativeEvent.submitter,C=(b==null?void 0:b.getAttribute("formmethod"))||c;o(b||m.currentTarget,{fetcherKey:n,method:C,navigate:r,replace:a,state:s,relative:d,preventScrollReset:E,unstable_viewTransition:u})};return be.createElement("form",Br({ref:t,method:p,action:l,onSubmit:i?g:f},w))});process.env.NODE_ENV!=="production"&&(_b.displayName="Form"),process.env.NODE_ENV;var Uo;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Uo||(Uo={}));var Rd;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Rd||(Rd={}));function Vb(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function Nd(e){let t=be.useContext(Pr);return t||(process.env.NODE_ENV!=="production"?Le(!1,Vb(e)):Le(!1)),t}function qb(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,unstable_viewTransition:c}=t===void 0?{}:t,h=hn(),g=er(),d=Ni(e,{relative:s});return be.useCallback(E=>{if(Ab(E,n)){E.preventDefault();let u=r!==void 0?r:ur(g)===ur(d);h(e,{replace:u,state:i,preventScrollReset:a,relative:s,unstable_viewTransition:c})}},[g,h,d,r,i,n,e,a,s,c])}function Ub(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let Gb=0,Yb=()=>"__"+String(++Gb)+"__";function Kb(){let{router:e}=Nd(Uo.UseSubmit),{basename:t}=be.useContext(xn),n=gb();return be.useCallback(function(r,i){i===void 0&&(i={}),Ub();let{action:a,method:s,encType:c,formData:h,body:g}=Ob(r,t);if(i.navigate===!1){let d=i.fetcherKey||Yb();e.fetch(d,n,i.action||a,{preventScrollReset:i.preventScrollReset,formData:h,body:g,formMethod:i.method||s,formEncType:i.encType||c,unstable_flushSync:i.unstable_flushSync})}else e.navigate(i.action||a,{preventScrollReset:i.preventScrollReset,formData:h,body:g,formMethod:i.method||s,formEncType:i.encType||c,replace:i.replace,state:i.state,fromRouteId:n,unstable_flushSync:i.unstable_flushSync,unstable_viewTransition:i.unstable_viewTransition})},[e,t,n])}function Qb(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=be.useContext(xn),i=be.useContext(Cn);i||(process.env.NODE_ENV!=="production"?Le(!1,"useFormAction must be used inside a RouteContext"):Le(!1));let[a]=i.matches.slice(-1),s=Br({},Ni(e||".",{relative:n})),c=er();if(e==null){s.search=c.search;let h=new URLSearchParams(s.search);h.has("index")&&h.get("index")===""&&(h.delete("index"),s.search=h.toString()?"?"+h.toString():"")}return(!e||e===".")&&a.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:Nn([r,s.pathname])),ur(s)}function $b(e,t){t===void 0&&(t={});let n=be.useContext(Hs);n==null&&(process.env.NODE_ENV!=="production"?Le(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):Le(!1));let{basename:r}=Nd(Uo.useViewTransitionState),i=Ni(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=wn(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=wn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ns(i.pathname,s)!=null||Ns(i.pathname,a)!=null}const Hb="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.37482%209.55838C0.802045%2011.696%200.887351%2013.9567%201.61959%2016.045C2.35183%2018.1334%203.69695%2019.9524%205.47921%2021.2642C7.26146%2022.5761%209.39798%2023.3199%2011.6096%2023.3985C13.8212%2023.477%2016.0051%2022.8866%2017.876%2021.7045C19.7468%2020.5223%2021.2175%2018.8034%2022.0961%2016.7722C22.9746%2014.7411%2023.2201%2012.4921%2022.8004%2010.3193C22.3807%208.1464%2021.3154%206.15066%2019.7436%204.59277C18.1718%203.03489%2016.1667%201.98732%2013.9902%201.58693M7.14096%202.53681C5.21049%203.48732%203.60119%204.98315%202.51232%206.8391M10.7049%201.48193C10.452%201.51191%2010.2003%201.55066%209.95012%201.59811M18.1995%2015.656C18.757%2014.5927%2019.0317%2013.4039%2018.9971%2012.2038C18.9625%2011.0037%2018.6198%209.83263%2018.002%208.8032C17.3842%207.77377%2016.512%206.92055%2015.4692%206.32553C14.4264%205.73051%2013.2481%205.4137%2012.0476%205.40554C10.847%205.39739%209.66449%205.69816%208.61372%206.27895C7.56295%206.85974%206.67923%207.70104%206.04747%208.72198C5.41572%209.74292%205.05717%2010.9092%205.00628%2012.1087C4.9554%2013.3082%205.21389%2014.5007%205.75691%2015.5714M9.15764%2013.3648C9.00624%2012.9162%208.96314%2012.4382%209.03189%2011.9698C9.10064%2011.5014%209.27926%2011.0559%209.55317%2010.6697C9.82708%2010.2836%2010.1885%209.96774%2010.6079%209.74803C11.0272%209.52832%2011.4926%209.41098%2011.966%209.4056C12.4394%209.40023%2012.9074%209.50697%2013.3316%209.71709C13.7559%209.92722%2014.1244%2010.2348%2014.407%2010.6146C14.6896%2010.9944%2014.8783%2011.4358%2014.9576%2011.9025C15.037%2012.3692%2015.0048%2012.8481%2014.8636%2013.3M14.0993%2010.2622C14.0043%2010.1691%2013.9032%2010.0825%2013.7967%2010.0028M8.2478%2018.3147C9.32147%2018.9965%2010.5606%2019.3728%2011.832%2019.4033C13.1035%2019.4339%2014.3592%2019.1174%2015.4644%2018.488'%20stroke='%233430FF'%20stroke-width='2'%20stroke-linecap='round'/%3e%3c/svg%3e";function Wb(){const e=hn(),{t}=mt(),n=ir();return k.useEffect(()=>{n.sessionUuid&&e(`/${n.sessionUuid}`)},[n.sessionUuid,e]),T.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center gap-12 text-center",children:[T.jsxs("div",{className:"flex items-center justify-center gap-3",children:[T.jsx("img",{alt:"logo",src:Hb,className:"z-10 h-16 w-16 hover:animate-spin"}),T.jsxs("p",{className:"z-10 text-7xl font-semibold tracking-wide text-gray-600",children:["Welcome to ",T.jsx("span",{className:"italic",children:"PortalSessions"})]})]}),n.sessionUuid?T.jsx(gt,{style:{padding:"1.5rem 2rem"},label:t("continue"),onClick:()=>e(`/${n.sessionUuid}`)}):T.jsx("p",{className:"text-error-600",children:`${t("somethingWentWrong")} ${t("portalSessionNotFound")}.`})]})}function Jb(){const e=hn(),{t}=mt(),{sessionUuid:n}=ir(),{session:r,isLoading:i,mutate:a}=Ht();return k.useEffect(()=>{if(!i&&r){const s=r.type in Pn?`/${r.type.toLowerCase()}`:"/";e(s)}},[i,a,e,r]),i?T.jsx(Tc,{}):T.jsx("div",{className:"flex w-full items-center justify-center text-error-600",children:`${t("portalSessionNotFound")} (${n})`})}Mr([{path:"/",element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ws,{})},{path:"/top-up/:hash",element:T.jsx(Md,{})},{path:"/redeem/:hash",element:T.jsx(Pd,{})}]}]);function Ws(){const{t:e}=mt(),[t,n]=k.useState(""),[r,i]=k.useState(!1),{session:a}=Ht(),s=hn(),c=a==null?void 0:a.input_data.scanner_type,h=k.useCallback(()=>a.results.remaining_amount??(a==null?void 0:a.input_data.amount_in_cents),[a]),g=k.useCallback(async()=>{i(!0);const{data:{data:d}}=await ja.get(t);s(`${a.type===pr.REDEEM_GIFTCARD?"redeem":"top-up"}/${d.hash}`)},[t,s,a]);return k.useEffect(()=>{c===mn.CAMERA&&t&&!r&&g().then()},[t,r,c,g]),(a==null?void 0:a.type)===pr.REDEEM_GIFTCARD&&!(a!=null&&a.input_data.amount_in_cents)?T.jsx(T.Fragment,{children:e("xIsRequired",{x:"Amount in cents"})}):T.jsx("div",{className:"container m-auto max-h-screen max-w-3xl",children:T.jsx(un,{children:T.jsxs("div",{className:"flex flex-col gap-3",children:[T.jsx(lt,{size:"sm",weight:"extralight",children:e("scanGiftcard")}),(a==null?void 0:a.type)===pr.REDEEM_GIFTCARD&&T.jsx(lt,{size:"lg",children:`${e("amountToBePaid")}: ${qr(h())}`}),T.jsx(co,{dataSetter:n,type:c,label:e("hash")}),c===mn.HAND_SCANNER&&T.jsx("div",{children:T.jsx(gt,{type:"submit",label:e("submit"),onClick:g})})]})})})}function Pd(){const{t:e}=mt(),{hash:t}=xd(),{giftcard:n,mutate:r}=Ol(t),{session:i,mutate:a}=Ht(),{onUseGiftcard:s}=ir(),c=hn(),h=(i==null?void 0:i.input_data.amount_in_cents)??0,g=(i==null?void 0:i.input_data.allow_multiple_giftcards)??!0;if(!n)return T.jsx(T.Fragment,{children:e("giftcardNotFound")});const d=async()=>{const w=await ja.transaction(n.uuid,-u());await r();const o=await a(),l=o==null?void 0:o.data.data.events;Ui(l),Xe.success(`${e("transactionSuccessful")}!`),s&&s(w.data.data)},E=()=>i.results.remaining_amount??h,u=()=>Math.min(E(),n.amount_in_cents);return T.jsx("div",{className:"container m-auto",children:T.jsx(un,{children:T.jsxs("div",{className:"flex h-96 flex-col items-center justify-between",children:[T.jsxs("div",{children:[T.jsxs(lt,{size:"md",align:"center",children:[e("giftcard"),": ",n.hash]}),T.jsx(lt,{size:"sm",align:"center",weight:"light",className:"text-gray-500",children:n.expiration_date?e("expiresAtDate",{date:n.formatted_expiration_date}):n.formatted_expiration_date})]}),T.jsxs("div",{children:[T.jsx(lt,{size:"lg",align:"center",children:e("balance")}),T.jsx(lt,{size:"4xl",align:"center",children:n.display_amount})]}),T.jsx("div",{className:"mx-auto flex gap-2",children:u()?T.jsx(gt,{label:e("confirmAndPay",{amount:qr(u(),i==null?void 0:i.currency)}),onClick:d}):T.jsxs("div",{className:"flex flex-col gap-4",children:[T.jsx(lt,{size:"lg",align:"center",className:"text-gray-500",children:e("xOfYPaid",{x:E()?qr(h-E(),i==null?void 0:i.currency):e("fullAmount"),y:qr(h,i==null?void 0:i.currency)})}),g&&E()?T.jsx(gt,{label:e("useAnotherGiftcard"),onClick:()=>c("../")}):null]})})]})})})}function Md(){const{t:e}=mt(),{hash:t}=xd(),{giftcard:n,mutate:r}=Ol(t),[i,a]=k.useState(!1),[s,c]=k.useState("");if(!n)return T.jsx(T.Fragment,{children:e("giftcardNotFound")});const h=async()=>{const g=await ja.transaction(n.uuid,parseFloat(s)*100);await r(),Xe.success(`${e("transactionSuccessful")}! ${e("totalUpgradedAmount")}: ${qr(g.data.data.amount_in_cents)}`),a(!1)};return T.jsxs("div",{className:"container m-auto",children:[T.jsx(un,{children:T.jsxs("div",{className:"flex h-96 flex-col items-center justify-between",children:[T.jsxs("div",{children:[T.jsxs(lt,{size:"md",align:"center",children:[e("giftcard"),": ",n.hash]}),T.jsx(lt,{size:"sm",align:"center",weight:"light",className:"text-gray-500",children:n.expiration_date?e("expiresAtDate",{date:n.formatted_expiration_date}):n.formatted_expiration_date})]}),T.jsxs("div",{children:[T.jsx(lt,{size:"lg",align:"center",children:e("balance")}),T.jsx(lt,{size:"4xl",align:"center",children:n.display_amount})]}),T.jsx("div",{className:"mx-auto flex gap-2",children:T.jsx(gt,{label:e("topUp"),onClick:()=>a(!0)})})]})}),T.jsx(Er,{isOpen:i,onClose:()=>a(!1),children:T.jsxs("div",{className:"flex flex-col gap-4",children:[T.jsx(Ua,{value:s,valueSetter:c}),T.jsx(gt,{label:e("submit"),onClick:h})]})})]})}Mr([{path:"/",element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(kd,{})},{path:"email",element:T.jsx(Fd,{})},{path:"identifier",element:T.jsx(Js,{})},{path:"register",element:T.jsx(jd,{})}]}]);function zb(){const{t:e}=mt(),{contact:t,isLoading:n,mutate:r}=so(),[i,a]=k.useState(),[s,c]=k.useState();k.useEffect(()=>{i||(async()=>{const{data:d}=await Tl.get();a(d.data.elements)})()},[t,i]);const h=(d,E)=>{c({...s,[d]:E})},g=async()=>{s&&(await Tl.update(s),await r(),Xe.success(e("contactAttributesUpdated")))};return!i||n?T.jsx(Tc,{}):T.jsxs("div",{className:"flex h-full flex-col gap-6",children:[T.jsx("div",{className:"flex justify-end",children:T.jsx(gt,{label:e("saveChanges"),onClick:g})}),T.jsx("hr",{}),T.jsx("div",{className:"grid h-full grid-cols-2 gap-x-6 gap-y-2 overflow-y-auto p-1",children:i.map(d=>{if(d.type==="media_upload")return;const E=d.disabled?T.jsx(pm,{type:d.type,value:t.current_display_values[d.name],label:d.label,underlying_value:t.current_values[d.name]}):T.jsx(gm,{...d,onChange:h});return T.jsx("div",{children:E},d.id)})})]})}function Zb(){const{t:e}=mt(),{data:t,isLoading:n,mutate:r}=om(),i=async s=>{await im.update({subscription_type_id:s.subscription_type.id}),await r()},a=s=>{const c=s.subscription_type.strategy,h=s.status;if(c===br.FUNCTIONAL)return e("disabled");switch(h){case Xr.SUBSCRIBED:return e("unsubscribe");case Xr.UNSUBSCRIBED:return c===br.OPT_IN||br.OPT_OUT?e("subscribe"):e("sendConfirmationEmail");case Xr.PENDING_CONFIRMATION:return e("sendReminder");default:return""}};return n?T.jsx(Rf,{rows:5}):T.jsx("div",{children:t.data.data.map(s=>T.jsxs("div",{className:"mb-4 flex justify-between rounded-lg border border-gray-200 px-6 py-4 bg-white",children:[T.jsxs("div",{children:[T.jsxs("div",{className:"flex gap-3",children:[T.jsx(lt,{weight:"normal",children:s.subscription_type.name}),T.jsx("span",{className:`flex gap-2 rounded-full px-2 py-0.5 text-sm font-light ${s.is_subscribed?"bg-[#03985515] text-[#039855]":"bg-[#E0273115] text-[#E02731]"}`,children:s.status.charAt(0)+s.status.substring(1).toLowerCase()})]}),T.jsx(lt,{color:"text-gray-400",size:"sm",children:s.subscription_type.description})]}),T.jsx(gt,{style:{color:"inherit",backgroundColor:"white",border:"1px solid rgb(229 231 235)"},disabled:s.subscription_type.strategy===br.FUNCTIONAL,onClick:()=>i(s),label:a(s)})]},s.subscription_type.uuid))})}const Bd="contact-identifiers",Xb={create:e=>xt.instance.post(pt(Bd),e)},ew=()=>{const{data:e,error:t,isLoading:n,isValidating:r,mutate:i}=Kn(pt(Bd));return{identifiers:e==null?void 0:e.data.data,data:e,error:t,isLoading:n,isValidating:r,mutate:i}};function tw(){const{t:e}=mt(),{data:t,isLoading:n,mutate:r}=ew(),[i,a]=k.useState(!1),[s,c]=k.useState(""),[h,g]=k.useState(!1),d=()=>{g(!0),Xb.create({value:s}).then(()=>{r(),a(!1)}).catch(E=>Xe.error(E)).finally(()=>g(!1))};return n?T.jsx(Rf,{rows:5}):T.jsxs("div",{className:"flex flex-col gap-2",children:[T.jsx("div",{className:"flex justify-end",children:T.jsx(gt,{label:e("addIdentifier"),onClick:()=>a(!0)})}),t.data.data.map(E=>T.jsx("div",{className:"flex justify-between rounded-lg border border-gray-200 px-6 py-4 bg-white",children:T.jsxs("div",{children:[T.jsx(lt,{weight:"semibold",children:E.name}),T.jsx(lt,{children:E.value})]})},E.value)),T.jsx(Er,{isOpen:i,onClose:()=>a(!1),title:e("addIdentifier"),children:T.jsxs("div",{className:"flex flex-col gap-4 min-w-96",children:[T.jsx(wr,{id:"add-identifier",name:"identifier",label:"Identifier value",type:"text",onChange:(E,u)=>c(u),autoFocus:!0}),T.jsx(gt,{label:e("addIdentifier"),onClick:d,disabled:h})]})})]})}function nw(){const{t:e}=mt(),[t,n]=k.useState(),r=k.useMemo(()=>[{id:0,label:e("contactDetails"),icon:T.jsx("path",{d:"M10 0a10 10 0 1 0 10 10A10.011 10.011 0 0 0 10 0Zm0 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm0 13a8.949 8.949 0 0 1-4.951-1.488A3.987 3.987 0 0 1 9 13h2a3.987 3.987 0 0 1 3.951 3.512A8.949 8.949 0 0 1 10 18Z"}),content:T.jsx(zb,{})},{id:1,label:e("subscriptions"),icon:T.jsx("path",{d:"M18 7.5h-.423l-.452-1.09.3-.3a1.5 1.5 0 0 0 0-2.121L16.01 2.575a1.5 1.5 0 0 0-2.121 0l-.3.3-1.089-.452V2A1.5 1.5 0 0 0 11 .5H9A1.5 1.5 0 0 0 7.5 2v.423l-1.09.452-.3-.3a1.5 1.5 0 0 0-2.121 0L2.576 3.99a1.5 1.5 0 0 0 0 2.121l.3.3L2.423 7.5H2A1.5 1.5 0 0 0 .5 9v2A1.5 1.5 0 0 0 2 12.5h.423l.452 1.09-.3.3a1.5 1.5 0 0 0 0 2.121l1.415 1.413a1.5 1.5 0 0 0 2.121 0l.3-.3 1.09.452V18A1.5 1.5 0 0 0 9 19.5h2a1.5 1.5 0 0 0 1.5-1.5v-.423l1.09-.452.3.3a1.5 1.5 0 0 0 2.121 0l1.415-1.414a1.5 1.5 0 0 0 0-2.121l-.3-.3.452-1.09H18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 18 7.5Zm-8 6a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Z"}),content:T.jsx(Zb,{})},{id:2,label:e("identifiers"),icon:T.jsx("path",{d:"M18 7.5h-.423l-.452-1.09.3-.3a1.5 1.5 0 0 0 0-2.121L16.01 2.575a1.5 1.5 0 0 0-2.121 0l-.3.3-1.089-.452V2A1.5 1.5 0 0 0 11 .5H9A1.5 1.5 0 0 0 7.5 2v.423l-1.09.452-.3-.3a1.5 1.5 0 0 0-2.121 0L2.576 3.99a1.5 1.5 0 0 0 0 2.121l.3.3L2.423 7.5H2A1.5 1.5 0 0 0 .5 9v2A1.5 1.5 0 0 0 2 12.5h.423l.452 1.09-.3.3a1.5 1.5 0 0 0 0 2.121l1.415 1.413a1.5 1.5 0 0 0 2.121 0l.3-.3 1.09.452V18A1.5 1.5 0 0 0 9 19.5h2a1.5 1.5 0 0 0 1.5-1.5v-.423l1.09-.452.3.3a1.5 1.5 0 0 0 2.121 0l1.415-1.414a1.5 1.5 0 0 0 0-2.121l-.3-.3.452-1.09H18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 18 7.5Zm-8 6a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Z"}),content:T.jsx(tw,{})}],[e]);return k.useEffect(()=>{t||n(r[0])},[r,t]),T.jsxs("div",{className:"h-full sm:flex",children:[T.jsx("ul",{className:"flex-column space-y mb-4 space-y-4 text-sm font-medium text-gray-500 md:mb-0 md:me-4",children:r.map(i=>T.jsx("li",{children:T.jsxs("div",{className:`inline-flex w-full cursor-pointer items-center rounded-lg px-4 py-3 ${i.id===(t==null?void 0:t.id)?"bg-primary-600 text-white":"bg-gray-50 hover:bg-gray-100 hover:text-gray-900"}`,onClick:()=>n(i),children:[T.jsx("svg",{className:`me-2 h-4 w-4 ${i.id===(t==null?void 0:t.id)?"text-white":"text-gray-500"}`,"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20",children:i.icon}),T.jsx("p",{className:"truncate",children:i.label})]})},i.id))}),T.jsx("div",{className:"text-medium h-full w-full rounded-lg bg-gray-50 p-6",children:t&&t.content})]})}function rw(){const{data:e,isLoading:t,mutate:n}=rm(),{mutate:r}=so(),{onClaimReward:i}=ir(),{t:a}=mt(),{mutate:s}=Ht(),c=async h=>{const g=await nm.claim(h);n(),r();const d=await s(),E=d==null?void 0:d.data.data.events;Ui(E);const u=E.filter(o=>o.data.reward.uuid===g.data.data.uuid),{data:{uuid:w}}=u.reduce((o,l)=>new Date(o.created_at)>new Date(l.created_at)?o:l);Xe.success(a("rewardClaimed",{name:g.data.data.title})),i&&i(g.data.data,w)};return T.jsx(Nf,{header:t?[]:e.data.data.header.items,rows:t?[]:e.data.data.rows,pending:t,onClick:c})}function iw(){const{data:e,isLoading:t,mutate:n}=am(),{mutate:r}=Ht(),{onRedeemVoucher:i}=ir(),{t:a}=mt(),s=async c=>{const h=await Va.redeemById(c),g=await r(),d=g==null?void 0:g.data.data.events;Ui(d),n(),Xe.success(a("voucherSuccessfullyRedeemed")),i&&i(h.data.data)};return T.jsx(Nf,{header:t?[]:e.data.data.header.items,rows:t?[]:e.data.data.rows,pending:t,onClick:s})}function ow(){const{t:e}=mt(),{session:{loyalty_program:t}}=Ht(),{contact:n,isLoading:r}=so();if(r)return T.jsx(T.Fragment,{});const i=[{value:n.credit_balance.balance,label:t.custom_credit_name||e("points")},{value:n.current_display_values.loyalty_number_of_transactions,label:e("transactions")},{value:n.tier?n.tier.name:"-",label:e("tier")}];return T.jsxs("div",{className:"flex w-full justify-between text-inherit",children:[T.jsxs("div",{children:[T.jsx("p",{className:"text-md font-medium",children:`${n.current_display_values.firstname} ${n.current_display_values.lastname}`}),T.jsx("p",{className:"text-sm",children:n.current_display_values.email})]}),T.jsx("div",{className:"flex gap-8",children:i.map(a=>T.jsxs("div",{className:"flex flex-col items-center",children:[T.jsx("p",{className:"text-md font-medium",children:a.value}),T.jsx("p",{className:"text-sm",children:a.label})]},a.label))})]})}function aw(){const{t:e}=mt(),{session:t}=Ht(),n=t.contact,[r,i]=k.useState("rewards");if(!n)return T.jsx(T.Fragment,{children:e("contactNotFound")});const a=()=>{switch(r){case"profile":return T.jsx(nw,{});case"rewards":return T.jsx(rw,{});case"vouchers":return T.jsx(iw,{})}};return T.jsx("div",{className:"container m-auto flex h-full p-4",children:T.jsx(un,{children:T.jsxs("div",{className:"flex h-full flex-col gap-6",children:[T.jsx(ow,{}),T.jsx("hr",{}),T.jsx("div",{children:T.jsx(lm,{elements:[{key:"profile",label:e("profile"),active:r==="profile"},{key:"rewards",label:e("rewards"),active:r==="rewards"},{key:"vouchers",label:e("vouchers"),active:r==="vouchers"}],onClick:s=>i(s)})}),T.jsx("div",{className:"overflow-y-auto",children:a()})]})})})}function sw(){const{session:e}=Ht(),t=hn(),{t:n}=mt();return T.jsxs("div",{className:"m-auto flex flex-col items-center gap-4",children:[T.jsx("p",{children:n("noContactLinked")}),T.jsxs("div",{className:"flex gap-4",children:[e.input_data.enable_registration&&T.jsx(gt,{label:n("registerNewContact"),onClick:()=>t("register")}),e.input_data.enable_email_identification&&T.jsx(gt,{label:n("linkViaEmail"),onClick:()=>t("email")}),T.jsx(gt,{label:n("linkViaCard"),onClick:()=>t("identifier")})]})]})}function Js(){const e=hn();return T.jsx("div",{className:"container m-auto max-h-screen max-w-3xl",children:T.jsx(un,{children:T.jsx(Ka,{callback:()=>e("../")})})})}function kd(){const{session:e}=Ht();return e&&(e.contact?T.jsx(aw,{}):!e.input_data.enable_registration&&!e.input_data.enable_email_identification?T.jsx(Js,{}):T.jsx(sw,{}))}function Fd(){const[e,t]=k.useState(""),{session:n,mutate:r}=Ht(),i=hn(),{t:a}=mt(),s=async()=>{n&&(await uo.setContact(n.uuid,{email:e}),await r(),Xe.success(a("contactSavedToSession")),i("../"))};return T.jsx("div",{className:"container m-auto",children:T.jsx(un,{children:T.jsxs("div",{className:"flex flex-col gap-3",children:[T.jsx("p",{children:a("fillInXBelow",{x:a("emailAddress").toLowerCase()})}),T.jsx(wr,{autoFocus:!0,id:"email-input",name:"email",label:a("emailAddress"),type:"email",onChange:(c,h)=>t(h)}),T.jsx("div",{children:T.jsx(gt,{type:"submit",label:a("linkContact"),onClick:s})})]})})})}function jd(){const[e,t]=k.useState(""),{session:n,mutate:r}=Ht(),i=hn(),{t:a}=mt(),s=async()=>{n&&(await ka.create(e),await r(),Xe.success(a("contactSavedToSession")),i("../"))};return T.jsx("div",{className:"container m-auto",children:T.jsx(un,{children:T.jsxs("div",{className:"flex flex-col gap-3",children:[T.jsx("p",{children:a("fillInXBelow",{x:a("emailAddress").toLowerCase()})}),T.jsx(wr,{autoFocus:!0,id:"email-input",name:"email",label:a("emailAddress"),type:"email",onChange:(c,h)=>t(h)}),T.jsx("div",{children:T.jsx(gt,{type:"submit",label:a("register"),onClick:s})})]})})})}Mr([{path:"/",element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ld,{})},{path:"balance",element:T.jsx(_d,{})}]}]);function Ld(){const e=hn();return T.jsx("div",{className:"container m-auto max-h-screen max-w-3xl",children:T.jsx(un,{children:T.jsx(Ka,{callback:()=>e("balance")})})})}function _d(){const{t:e}=mt(),{balance:t,mutate:n}=tm(),[r,i]=k.useState(""),[a,s]=k.useState(1),[c,h]=k.useState(!1),g=async()=>{r&&(await em.transaction({amount_in_cents:parseFloat(r)*100*a}),await n(),Xe.success(e("prepaidTransactionCreated")),h(!1))};return T.jsxs("div",{className:"container m-auto",children:[T.jsxs(un,{children:[T.jsxs(lt,{size:"lg",align:"center",weight:"normal",children:[e("prepaidBalance"),": ",t==null?void 0:t.balance]}),T.jsx("div",{className:"mt-6 flex justify-center",children:T.jsxs("div",{className:"grid w-1/3 grid-cols-2 gap-x-2",children:[T.jsx(gt,{label:e("upgrade"),onClick:()=>{h(!0),s(1)}}),T.jsx(gt,{label:e("depreciate"),onClick:()=>{h(!0),s(-1)}})]})})]}),T.jsx(Er,{isOpen:c,onClose:()=>h(!1),children:T.jsxs("div",{className:"flex flex-col gap-4",children:[T.jsx(Ua,{value:r,valueSetter:i}),T.jsx(gt,{label:e("submit"),onClick:g})]})})]})}Mr([{path:"/",element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Vd,{})},{path:"success",element:T.jsx(qd,{})}]}]);function Vd(){const{t:e}=mt(),[t,n]=k.useState(""),[r,i]=k.useState(!1),{session:a,mutate:s}=Ht(),c=hn(),h=async()=>{if(t){const{data:{data:g}}=await Xg.create({unit_value:parseFloat(t)});await s(),c("success",{state:{transaction:g}})}};return k.useEffect(()=>{a&&a.contact&&i(!0)},[c,a]),T.jsxs("div",{className:"container m-auto max-h-screen max-w-3xl",children:[T.jsx(un,{children:T.jsx(Ka,{})}),T.jsx(Er,{isOpen:r,children:T.jsxs("div",{className:"flex flex-col gap-4",children:[T.jsxs("p",{className:"text-center",children:[e("unitValue"),":"]}),T.jsx(Ua,{value:t,valueSetter:n}),T.jsx(gt,{label:e("submit"),onClick:h})]})})]})}function qd(){const{state:e}=er(),{t}=mt(),{session:{loyalty_program:n}}=Ht(),{contact:r}=so();return T.jsx("div",{className:"m-auto",children:T.jsx(Ll,{children:T.jsxs("div",{className:"mt-8 flex w-96 flex-col gap-4",children:[T.jsxs(lt,{size:"lg",weight:"bold",align:"center",children:[t("creditReceptionCreated"),"!"]}),e&&e.transaction&&T.jsxs(lt,{color:"text-gray-500",align:"center",children:["+",e.transaction.credits," ",n.custom_credit_name||t("points").toLowerCase()]}),T.jsx("div",{className:"h-24"}),r&&T.jsxs("div",{className:"flex justify-between",children:[T.jsxs(lt,{color:"text-gray-200",children:[t("currentCreditBalance"),":"]}),T.jsxs(lt,{color:"text-gray-200",children:[r.credit_balance.balance," ",n.custom_credit_name||t("points").toLowerCase()]})]})]})})})}Mr([{path:"/",element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ud,{})},{path:"success",element:T.jsx(Gd,{})}]}]);function Ud(){const{t:e}=mt(),[t,n]=k.useState(""),[r,i]=k.useState(""),[a,s]=k.useState(!1),[c,h]=k.useState(!1),{session:g,mutate:d}=Ht(),E=g==null?void 0:g.input_data.scanner_type,u=hn(),w=k.useCallback(async()=>{r&&await uo.setContact(g.uuid,{contact_identifier_value:r});const{data:{data:l}}=await Va.redeemByCode(t),p=await d(),f=p==null?void 0:p.data.data.events;Ui(f),u("success",{state:{voucher:l}})},[t,r,u,g]),o=k.useCallback(async()=>{if(g){s(!0);const{data:{data:l}}=await Va.get(t);l.contact||g.contact?await w():h(!0),s(!1)}},[t,w,g]);return k.useEffect(()=>{E===mn.CAMERA&&t&&!a&&(async()=>await o())()},[t,a,E,o,c]),T.jsxs("div",{className:"container m-auto max-h-screen max-w-3xl",children:[T.jsxs(un,{children:[T.jsx(co,{dataSetter:n,type:E,label:e("voucherCode")}),E===mn.HAND_SCANNER&&T.jsx("div",{className:"pt-3",children:T.jsx(gt,{type:"submit",label:e("redeemVoucher"),onClick:o})})]}),T.jsxs(Er,{isOpen:c,onClose:()=>h(!1),children:[T.jsx("p",{className:"text-error-600 pb-4",children:e("noContactLinkedToVoucher")}),T.jsx(co,{dataSetter:i,type:E,label:e("contactIdentifier")}),E===mn.HAND_SCANNER&&T.jsx("div",{className:"pt-3",children:T.jsx(gt,{type:"submit",label:e("redeemVoucher"),onClick:w})})]})]})}function Gd(){const{t:e}=mt(),{state:t}=er();return T.jsx("div",{className:"m-auto",children:T.jsx(Ll,{children:T.jsx(lt,{size:"lg",align:"center",className:"pt-6",children:e("voucherWithCodeSuccessfullyRedeemed",{code:t.voucher.code})})})})}const uw=Mr([{path:"/",element:T.jsx(Wb,{})},{path:":portalSessionUuid",element:T.jsx(Jb,{}),errorElement:T.jsx("div",{children:"No session UUID"})},{path:Pn.REDEEM_GIFTCARD,element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ws,{})},{path:"redeem/:hash",element:T.jsx(Pd,{})}]},{path:Pn.TOP_UP_GIFTCARD,element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ws,{})},{path:"top-up/:hash",element:T.jsx(Md,{})}]},{path:Pn.PORTAL,element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(kd,{})},{path:"email",element:T.jsx(Fd,{})},{path:"identifier",element:T.jsx(Js,{})},{path:"register",element:T.jsx(jd,{})}]},{path:Pn.PREPAID,element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ld,{})},{path:"balance",element:T.jsx(_d,{})}]},{path:Pn.SAVE,element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Vd,{})},{path:"success",element:T.jsx(qd,{})}]},{path:Pn.VOUCHER,element:T.jsx(An,{}),children:[{index:!0,element:T.jsx(Ud,{})},{path:"success",element:T.jsx(Gd,{})}]}]),Yd=()=>T.jsx(Bb,{router:uw});function lw(e){return T.jsx(s1,{config:e,payload:{type:e.type??pr.PORTAL,api_key:e.apiKey,shop_uuid:e.shopUuid,contact_uuid:e.contactUuid,...e.amountInCents&&{amount_in_cents:e.amountInCents},...e.allowMultipleGiftcards&&{allow_multiple_giftcards:e.allowMultipleGiftcards},...e.scannerType&&{scanner_type:e.scannerType},...e.enableRegistration&&{enable_registration:e.enableRegistration},...e.enableEmailIdentification&&{enable_email_identification:e.enableEmailIdentification},...e.enableOnScreenKeyboard&&{enable_on_screen_keyboard:e.enableOnScreenKeyboard}},children:T.jsx(Yd,{})})}function cw({uuid:e,host:t}){const[n,r]=k.useState(!1);return k.useEffect(()=>{n||(xt.initialize(void 0,t),r(!0))},[t,n]),n?T.jsxs(k.StrictMode,{children:[T.jsx(Il,{sessionUuid:e,children:T.jsx("div",{className:"flex h-screen w-screen bg-primary-50",children:T.jsxs("div",{className:"flex h-screen w-screen flex-col bg-primary-50",children:[T.jsx("div",{className:"flex h-full overflow-auto",children:T.jsx(Yd,{})}),e&&T.jsx(jl,{})]})})}),T.jsx(Iu,{position:"bottom-center"})]}):T.jsx(T.Fragment,{children:"Initializing..."})}Bt.DefaultSession=cw,Bt.PortalRoute=Pn,Bt.PortalSession=lw,Bt.PortalType=pr,Bt.ScannerType=mn,Bt.SubscriptionStatus=Xr,Bt.SubscriptionStrategy=br,Bt.VoucherStatus=Pl,Object.defineProperty(Bt,Symbol.toStringTag,{value:"Module"})});
|