Formules en cartes avec prix (catalogue de l'API) et sélecteur mensuel / annuel, étapes numérotées, bouton explicite ; après création, récapitulatif de ce qui est parti automatiquement (magasin, compte Dirigeant, lien de paiement) et identifiants à copier. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
76 lines
281 KiB
JavaScript
76 lines
281 KiB
JavaScript
function bf(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in e)){const s=Object.getOwnPropertyDescriptor(r,l);s&&Object.defineProperty(e,l,s.get?s:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(l){if(l.ep)return;l.ep=!0;const s=n(l);fetch(l.href,s)}})();function Wf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wu={exports:{}},ql={},Vu={exports:{}},I={};/**
|
||
* @license React
|
||
* react.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Ar=Symbol.for("react.element"),Vf=Symbol.for("react.portal"),Hf=Symbol.for("react.fragment"),Qf=Symbol.for("react.strict_mode"),Kf=Symbol.for("react.profiler"),Yf=Symbol.for("react.provider"),Gf=Symbol.for("react.context"),qf=Symbol.for("react.forward_ref"),Jf=Symbol.for("react.suspense"),Xf=Symbol.for("react.memo"),Zf=Symbol.for("react.lazy"),go=Symbol.iterator;function ep(e){return e===null||typeof e!="object"?null:(e=go&&e[go]||e["@@iterator"],typeof e=="function"?e:null)}var Hu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qu=Object.assign,Ku={};function Dn(e,t,n){this.props=e,this.context=t,this.refs=Ku,this.updater=n||Hu}Dn.prototype.isReactComponent={};Dn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Dn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Yu(){}Yu.prototype=Dn.prototype;function ca(e,t,n){this.props=e,this.context=t,this.refs=Ku,this.updater=n||Hu}var da=ca.prototype=new Yu;da.constructor=ca;Qu(da,Dn.prototype);da.isPureReactComponent=!0;var vo=Array.isArray,Gu=Object.prototype.hasOwnProperty,fa={current:null},qu={key:!0,ref:!0,__self:!0,__source:!0};function Ju(e,t,n){var r,l={},s=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(s=""+t.key),t)Gu.call(t,r)&&!qu.hasOwnProperty(r)&&(l[r]=t[r]);var o=arguments.length-2;if(o===1)l.children=n;else if(1<o){for(var u=Array(o),c=0;c<o;c++)u[c]=arguments[c+2];l.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)l[r]===void 0&&(l[r]=o[r]);return{$$typeof:Ar,type:e,key:s,ref:a,props:l,_owner:fa.current}}function tp(e,t){return{$$typeof:Ar,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function pa(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ar}function np(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var yo=/\/+/g;function Ss(e,t){return typeof e=="object"&&e!==null&&e.key!=null?np(""+e.key):t.toString(36)}function il(e,t,n,r,l){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Ar:case Vf:a=!0}}if(a)return a=e,l=l(a),e=r===""?"."+Ss(a,0):r,vo(l)?(n="",e!=null&&(n=e.replace(yo,"$&/")+"/"),il(l,t,n,"",function(c){return c})):l!=null&&(pa(l)&&(l=tp(l,n+(!l.key||a&&a.key===l.key?"":(""+l.key).replace(yo,"$&/")+"/")+e)),t.push(l)),1;if(a=0,r=r===""?".":r+":",vo(e))for(var o=0;o<e.length;o++){s=e[o];var u=r+Ss(s,o);a+=il(s,t,n,u,l)}else if(u=ep(e),typeof u=="function")for(e=u.call(e),o=0;!(s=e.next()).done;)s=s.value,u=r+Ss(s,o++),a+=il(s,t,n,u,l);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function $r(e,t,n){if(e==null)return e;var r=[],l=0;return il(e,r,"","",function(s){return t.call(n,s,l++)}),r}function rp(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var he={current:null},al={transition:null},lp={ReactCurrentDispatcher:he,ReactCurrentBatchConfig:al,ReactCurrentOwner:fa};function Xu(){throw Error("act(...) is not supported in production builds of React.")}I.Children={map:$r,forEach:function(e,t,n){$r(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $r(e,function(){t++}),t},toArray:function(e){return $r(e,function(t){return t})||[]},only:function(e){if(!pa(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};I.Component=Dn;I.Fragment=Hf;I.Profiler=Kf;I.PureComponent=ca;I.StrictMode=Qf;I.Suspense=Jf;I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lp;I.act=Xu;I.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Qu({},e.props),l=e.key,s=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,a=fa.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)Gu.call(t,u)&&!qu.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&o!==void 0?o[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){o=Array(u);for(var c=0;c<u;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:Ar,type:e.type,key:l,ref:s,props:r,_owner:a}};I.createContext=function(e){return e={$$typeof:Gf,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Yf,_context:e},e.Consumer=e};I.createElement=Ju;I.createFactory=function(e){var t=Ju.bind(null,e);return t.type=e,t};I.createRef=function(){return{current:null}};I.forwardRef=function(e){return{$$typeof:qf,render:e}};I.isValidElement=pa;I.lazy=function(e){return{$$typeof:Zf,_payload:{_status:-1,_result:e},_init:rp}};I.memo=function(e,t){return{$$typeof:Xf,type:e,compare:t===void 0?null:t}};I.startTransition=function(e){var t=al.transition;al.transition={};try{e()}finally{al.transition=t}};I.unstable_act=Xu;I.useCallback=function(e,t){return he.current.useCallback(e,t)};I.useContext=function(e){return he.current.useContext(e)};I.useDebugValue=function(){};I.useDeferredValue=function(e){return he.current.useDeferredValue(e)};I.useEffect=function(e,t){return he.current.useEffect(e,t)};I.useId=function(){return he.current.useId()};I.useImperativeHandle=function(e,t,n){return he.current.useImperativeHandle(e,t,n)};I.useInsertionEffect=function(e,t){return he.current.useInsertionEffect(e,t)};I.useLayoutEffect=function(e,t){return he.current.useLayoutEffect(e,t)};I.useMemo=function(e,t){return he.current.useMemo(e,t)};I.useReducer=function(e,t,n){return he.current.useReducer(e,t,n)};I.useRef=function(e){return he.current.useRef(e)};I.useState=function(e){return he.current.useState(e)};I.useSyncExternalStore=function(e,t,n){return he.current.useSyncExternalStore(e,t,n)};I.useTransition=function(){return he.current.useTransition()};I.version="18.3.1";Vu.exports=I;var j=Vu.exports;const sp=Wf(j),ip=bf({__proto__:null,default:sp},[j]);/**
|
||
* @license React
|
||
* react-jsx-runtime.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var ap=j,op=Symbol.for("react.element"),up=Symbol.for("react.fragment"),cp=Object.prototype.hasOwnProperty,dp=ap.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,fp={key:!0,ref:!0,__self:!0,__source:!0};function Zu(e,t,n){var r,l={},s=null,a=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)cp.call(t,r)&&!fp.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:op,type:e,key:s,ref:a,props:l,_owner:dp.current}}ql.Fragment=up;ql.jsx=Zu;ql.jsxs=Zu;Wu.exports=ql;var i=Wu.exports,ec={exports:{}},Pe={},tc={exports:{}},nc={};/**
|
||
* @license React
|
||
* scheduler.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/(function(e){function t(R,_){var z=R.length;R.push(_);e:for(;0<z;){var H=z-1>>>1,Z=R[H];if(0<l(Z,_))R[H]=_,R[z]=Z,z=H;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var _=R[0],z=R.pop();if(z!==_){R[0]=z;e:for(var H=0,Z=R.length,nn=Z>>>1;H<nn;){var Ut=2*(H+1)-1,ws=R[Ut],$t=Ut+1,Ur=R[$t];if(0>l(ws,z))$t<Z&&0>l(Ur,ws)?(R[H]=Ur,R[$t]=z,H=$t):(R[H]=ws,R[Ut]=z,H=Ut);else if($t<Z&&0>l(Ur,z))R[H]=Ur,R[$t]=z,H=$t;else break e}}return _}function l(R,_){var z=R.sortIndex-_.sortIndex;return z!==0?z:R.id-_.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var u=[],c=[],p=1,g=null,m=3,y=!1,x=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(R){for(var _=n(c);_!==null;){if(_.callback===null)r(c);else if(_.startTime<=R)r(c),_.sortIndex=_.expirationTime,t(u,_);else break;_=n(c)}}function v(R){if(w=!1,h(R),!x)if(n(u)!==null)x=!0,Ae(N);else{var _=n(c);_!==null&&Ze(v,_.startTime-R)}}function N(R,_){x=!1,w&&(w=!1,f(C),C=-1),y=!0;var z=m;try{for(h(_),g=n(u);g!==null&&(!(g.expirationTime>_)||R&&!U());){var H=g.callback;if(typeof H=="function"){g.callback=null,m=g.priorityLevel;var Z=H(g.expirationTime<=_);_=e.unstable_now(),typeof Z=="function"?g.callback=Z:g===n(u)&&r(u),h(_)}else r(u);g=n(u)}if(g!==null)var nn=!0;else{var Ut=n(c);Ut!==null&&Ze(v,Ut.startTime-_),nn=!1}return nn}finally{g=null,m=z,y=!1}}var E=!1,k=null,C=-1,M=5,A=-1;function U(){return!(e.unstable_now()-A<M)}function Le(){if(k!==null){var R=e.unstable_now();A=R;var _=!0;try{_=k(!0,R)}finally{_?L():(E=!1,k=null)}}else E=!1}var L;if(typeof d=="function")L=function(){d(Le)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,se=W.port2;W.port1.onmessage=Le,L=function(){se.postMessage(null)}}else L=function(){S(Le,0)};function Ae(R){k=R,E||(E=!0,L())}function Ze(R,_){C=S(function(){R(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){x||y||(x=!0,Ae(N))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(R){switch(m){case 1:case 2:case 3:var _=3;break;default:_=m}var z=m;m=_;try{return R()}finally{m=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,_){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var z=m;m=R;try{return _()}finally{m=z}},e.unstable_scheduleCallback=function(R,_,z){var H=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?H+z:H):z=H,R){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=z+Z,R={id:p++,callback:_,priorityLevel:R,startTime:z,expirationTime:Z,sortIndex:-1},z>H?(R.sortIndex=z,t(c,R),n(u)===null&&R===n(c)&&(w?(f(C),C=-1):w=!0,Ze(v,z-H))):(R.sortIndex=Z,t(u,R),x||y||(x=!0,Ae(N))),R},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(R){var _=m;return function(){var z=m;m=_;try{return R.apply(this,arguments)}finally{m=z}}}})(nc);tc.exports=nc;var pp=tc.exports;/**
|
||
* @license React
|
||
* react-dom.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var mp=j,ke=pp;function P(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var rc=new Set,cr={};function en(e,t){En(e,t),En(e+"Capture",t)}function En(e,t){for(cr[e]=t,e=0;e<t.length;e++)rc.add(t[e])}var it=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),li=Object.prototype.hasOwnProperty,hp=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,xo={},jo={};function gp(e){return li.call(jo,e)?!0:li.call(xo,e)?!1:hp.test(e)?jo[e]=!0:(xo[e]=!0,!1)}function vp(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function yp(e,t,n,r){if(t===null||typeof t>"u"||vp(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ge(e,t,n,r,l,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var oe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){oe[e]=new ge(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];oe[t]=new ge(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){oe[e]=new ge(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){oe[e]=new ge(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){oe[e]=new ge(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){oe[e]=new ge(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){oe[e]=new ge(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){oe[e]=new ge(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){oe[e]=new ge(e,5,!1,e.toLowerCase(),null,!1,!1)});var ma=/[\-:]([a-z])/g;function ha(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ma,ha);oe[t]=new ge(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ma,ha);oe[t]=new ge(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ma,ha);oe[t]=new ge(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){oe[e]=new ge(e,1,!1,e.toLowerCase(),null,!1,!1)});oe.xlinkHref=new ge("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){oe[e]=new ge(e,1,!1,e.toLowerCase(),null,!0,!0)});function ga(e,t,n,r){var l=oe.hasOwnProperty(t)?oe[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(yp(t,n,l,r)&&(n=null),r||l===null?gp(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ct=mp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Br=Symbol.for("react.element"),an=Symbol.for("react.portal"),on=Symbol.for("react.fragment"),va=Symbol.for("react.strict_mode"),si=Symbol.for("react.profiler"),lc=Symbol.for("react.provider"),sc=Symbol.for("react.context"),ya=Symbol.for("react.forward_ref"),ii=Symbol.for("react.suspense"),ai=Symbol.for("react.suspense_list"),xa=Symbol.for("react.memo"),pt=Symbol.for("react.lazy"),ic=Symbol.for("react.offscreen"),wo=Symbol.iterator;function bn(e){return e===null||typeof e!="object"?null:(e=wo&&e[wo]||e["@@iterator"],typeof e=="function"?e:null)}var G=Object.assign,Ns;function qn(e){if(Ns===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ns=t&&t[1]||""}return`
|
||
`+Ns+e}var Cs=!1;function Es(e,t){if(!e||Cs)return"";Cs=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var l=c.stack.split(`
|
||
`),s=r.stack.split(`
|
||
`),a=l.length-1,o=s.length-1;1<=a&&0<=o&&l[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(l[a]!==s[o]){if(a!==1||o!==1)do if(a--,o--,0>o||l[a]!==s[o]){var u=`
|
||
`+l[a].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=a&&0<=o);break}}}finally{Cs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qn(e):""}function xp(e){switch(e.tag){case 5:return qn(e.type);case 16:return qn("Lazy");case 13:return qn("Suspense");case 19:return qn("SuspenseList");case 0:case 2:case 15:return e=Es(e.type,!1),e;case 11:return e=Es(e.type.render,!1),e;case 1:return e=Es(e.type,!0),e;default:return""}}function oi(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case on:return"Fragment";case an:return"Portal";case si:return"Profiler";case va:return"StrictMode";case ii:return"Suspense";case ai:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sc:return(e.displayName||"Context")+".Consumer";case lc:return(e._context.displayName||"Context")+".Provider";case ya:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case xa:return t=e.displayName||null,t!==null?t:oi(e.type)||"Memo";case pt:t=e._payload,e=e._init;try{return oi(e(t))}catch{}}return null}function jp(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return oi(t);case 8:return t===va?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function At(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ac(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wp(e){var t=ac(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function br(e){e._valueTracker||(e._valueTracker=wp(e))}function oc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ac(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function jl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ui(e,t){var n=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function So(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=At(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function uc(e,t){t=t.checked,t!=null&&ga(e,"checked",t,!1)}function ci(e,t){uc(e,t);var n=At(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?di(e,t.type,n):t.hasOwnProperty("defaultValue")&&di(e,t.type,At(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function No(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function di(e,t,n){(t!=="number"||jl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Jn=Array.isArray;function xn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+At(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function fi(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(P(91));return G({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Co(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(P(92));if(Jn(n)){if(1<n.length)throw Error(P(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:At(n)}}function cc(e,t){var n=At(t.value),r=At(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Eo(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function dc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pi(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?dc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Wr,fc=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Wr=Wr||document.createElement("div"),Wr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Wr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function dr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var er={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Sp=["Webkit","ms","Moz","O"];Object.keys(er).forEach(function(e){Sp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),er[t]=er[e]})});function pc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||er.hasOwnProperty(e)&&er[e]?(""+t).trim():t+"px"}function mc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=pc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Np=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function mi(e,t){if(t){if(Np[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(P(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(P(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(P(61))}if(t.style!=null&&typeof t.style!="object")throw Error(P(62))}}function hi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gi=null;function ja(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vi=null,jn=null,wn=null;function ko(e){if(e=zr(e)){if(typeof vi!="function")throw Error(P(280));var t=e.stateNode;t&&(t=ts(t),vi(e.stateNode,e.type,t))}}function hc(e){jn?wn?wn.push(e):wn=[e]:jn=e}function gc(){if(jn){var e=jn,t=wn;if(wn=jn=null,ko(e),t)for(e=0;e<t.length;e++)ko(t[e])}}function vc(e,t){return e(t)}function yc(){}var ks=!1;function xc(e,t,n){if(ks)return e(t,n);ks=!0;try{return vc(e,t,n)}finally{ks=!1,(jn!==null||wn!==null)&&(yc(),gc())}}function fr(e,t){var n=e.stateNode;if(n===null)return null;var r=ts(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(P(231,t,typeof n));return n}var yi=!1;if(it)try{var Wn={};Object.defineProperty(Wn,"passive",{get:function(){yi=!0}}),window.addEventListener("test",Wn,Wn),window.removeEventListener("test",Wn,Wn)}catch{yi=!1}function Cp(e,t,n,r,l,s,a,o,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(p){this.onError(p)}}var tr=!1,wl=null,Sl=!1,xi=null,Ep={onError:function(e){tr=!0,wl=e}};function kp(e,t,n,r,l,s,a,o,u){tr=!1,wl=null,Cp.apply(Ep,arguments)}function Pp(e,t,n,r,l,s,a,o,u){if(kp.apply(this,arguments),tr){if(tr){var c=wl;tr=!1,wl=null}else throw Error(P(198));Sl||(Sl=!0,xi=c)}}function tn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function jc(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Po(e){if(tn(e)!==e)throw Error(P(188))}function Rp(e){var t=e.alternate;if(!t){if(t=tn(e),t===null)throw Error(P(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var s=l.alternate;if(s===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===s.child){for(s=l.child;s;){if(s===n)return Po(l),e;if(s===r)return Po(l),t;s=s.sibling}throw Error(P(188))}if(n.return!==r.return)n=l,r=s;else{for(var a=!1,o=l.child;o;){if(o===n){a=!0,n=l,r=s;break}if(o===r){a=!0,r=l,n=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===n){a=!0,n=s,r=l;break}if(o===r){a=!0,r=s,n=l;break}o=o.sibling}if(!a)throw Error(P(189))}}if(n.alternate!==r)throw Error(P(190))}if(n.tag!==3)throw Error(P(188));return n.stateNode.current===n?e:t}function wc(e){return e=Rp(e),e!==null?Sc(e):null}function Sc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Sc(e);if(t!==null)return t;e=e.sibling}return null}var Nc=ke.unstable_scheduleCallback,Ro=ke.unstable_cancelCallback,Tp=ke.unstable_shouldYield,Lp=ke.unstable_requestPaint,X=ke.unstable_now,Ap=ke.unstable_getCurrentPriorityLevel,wa=ke.unstable_ImmediatePriority,Cc=ke.unstable_UserBlockingPriority,Nl=ke.unstable_NormalPriority,Mp=ke.unstable_LowPriority,Ec=ke.unstable_IdlePriority,Jl=null,Ye=null;function _p(e){if(Ye&&typeof Ye.onCommitFiberRoot=="function")try{Ye.onCommitFiberRoot(Jl,e,void 0,(e.current.flags&128)===128)}catch{}}var be=Math.clz32?Math.clz32:Fp,zp=Math.log,Ip=Math.LN2;function Fp(e){return e>>>=0,e===0?32:31-(zp(e)/Ip|0)|0}var Vr=64,Hr=4194304;function Xn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Cl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~l;o!==0?r=Xn(o):(s&=a,s!==0&&(r=Xn(s)))}else a=n&~l,a!==0?r=Xn(a):s!==0&&(r=Xn(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,s=t&-t,l>=s||l===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-be(t),l=1<<n,r|=e[n],t&=~l;return r}function Dp(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Op(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-be(s),o=1<<a,u=l[a];u===-1?(!(o&n)||o&r)&&(l[a]=Dp(o,t)):u<=t&&(e.expiredLanes|=o),s&=~o}}function ji(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function kc(){var e=Vr;return Vr<<=1,!(Vr&4194240)&&(Vr=64),e}function Ps(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Mr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-be(t),e[t]=n}function Up(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var l=31-be(n),s=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~s}}function Sa(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-be(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var D=0;function Pc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Rc,Na,Tc,Lc,Ac,wi=!1,Qr=[],wt=null,St=null,Nt=null,pr=new Map,mr=new Map,ht=[],$p="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function To(e,t){switch(e){case"focusin":case"focusout":wt=null;break;case"dragenter":case"dragleave":St=null;break;case"mouseover":case"mouseout":Nt=null;break;case"pointerover":case"pointerout":pr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":mr.delete(t.pointerId)}}function Vn(e,t,n,r,l,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[l]},t!==null&&(t=zr(t),t!==null&&Na(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function Bp(e,t,n,r,l){switch(t){case"focusin":return wt=Vn(wt,e,t,n,r,l),!0;case"dragenter":return St=Vn(St,e,t,n,r,l),!0;case"mouseover":return Nt=Vn(Nt,e,t,n,r,l),!0;case"pointerover":var s=l.pointerId;return pr.set(s,Vn(pr.get(s)||null,e,t,n,r,l)),!0;case"gotpointercapture":return s=l.pointerId,mr.set(s,Vn(mr.get(s)||null,e,t,n,r,l)),!0}return!1}function Mc(e){var t=Vt(e.target);if(t!==null){var n=tn(t);if(n!==null){if(t=n.tag,t===13){if(t=jc(n),t!==null){e.blockedOn=t,Ac(e.priority,function(){Tc(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ol(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Si(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);gi=r,n.target.dispatchEvent(r),gi=null}else return t=zr(n),t!==null&&Na(t),e.blockedOn=n,!1;t.shift()}return!0}function Lo(e,t,n){ol(e)&&n.delete(t)}function bp(){wi=!1,wt!==null&&ol(wt)&&(wt=null),St!==null&&ol(St)&&(St=null),Nt!==null&&ol(Nt)&&(Nt=null),pr.forEach(Lo),mr.forEach(Lo)}function Hn(e,t){e.blockedOn===t&&(e.blockedOn=null,wi||(wi=!0,ke.unstable_scheduleCallback(ke.unstable_NormalPriority,bp)))}function hr(e){function t(l){return Hn(l,e)}if(0<Qr.length){Hn(Qr[0],e);for(var n=1;n<Qr.length;n++){var r=Qr[n];r.blockedOn===e&&(r.blockedOn=null)}}for(wt!==null&&Hn(wt,e),St!==null&&Hn(St,e),Nt!==null&&Hn(Nt,e),pr.forEach(t),mr.forEach(t),n=0;n<ht.length;n++)r=ht[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ht.length&&(n=ht[0],n.blockedOn===null);)Mc(n),n.blockedOn===null&&ht.shift()}var Sn=ct.ReactCurrentBatchConfig,El=!0;function Wp(e,t,n,r){var l=D,s=Sn.transition;Sn.transition=null;try{D=1,Ca(e,t,n,r)}finally{D=l,Sn.transition=s}}function Vp(e,t,n,r){var l=D,s=Sn.transition;Sn.transition=null;try{D=4,Ca(e,t,n,r)}finally{D=l,Sn.transition=s}}function Ca(e,t,n,r){if(El){var l=Si(e,t,n,r);if(l===null)Ds(e,t,r,kl,n),To(e,r);else if(Bp(l,e,t,n,r))r.stopPropagation();else if(To(e,r),t&4&&-1<$p.indexOf(e)){for(;l!==null;){var s=zr(l);if(s!==null&&Rc(s),s=Si(e,t,n,r),s===null&&Ds(e,t,r,kl,n),s===l)break;l=s}l!==null&&r.stopPropagation()}else Ds(e,t,r,null,n)}}var kl=null;function Si(e,t,n,r){if(kl=null,e=ja(r),e=Vt(e),e!==null)if(t=tn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=jc(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return kl=e,null}function _c(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ap()){case wa:return 1;case Cc:return 4;case Nl:case Mp:return 16;case Ec:return 536870912;default:return 16}default:return 16}}var vt=null,Ea=null,ul=null;function zc(){if(ul)return ul;var e,t=Ea,n=t.length,r,l="value"in vt?vt.value:vt.textContent,s=l.length;for(e=0;e<n&&t[e]===l[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===l[s-r];r++);return ul=l.slice(e,1<r?1-r:void 0)}function cl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Kr(){return!0}function Ao(){return!1}function Re(e){function t(n,r,l,s,a){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Kr:Ao,this.isPropagationStopped=Ao,this}return G(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Kr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Kr)},persist:function(){},isPersistent:Kr}),t}var On={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ka=Re(On),_r=G({},On,{view:0,detail:0}),Hp=Re(_r),Rs,Ts,Qn,Xl=G({},_r,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pa,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Qn&&(Qn&&e.type==="mousemove"?(Rs=e.screenX-Qn.screenX,Ts=e.screenY-Qn.screenY):Ts=Rs=0,Qn=e),Rs)},movementY:function(e){return"movementY"in e?e.movementY:Ts}}),Mo=Re(Xl),Qp=G({},Xl,{dataTransfer:0}),Kp=Re(Qp),Yp=G({},_r,{relatedTarget:0}),Ls=Re(Yp),Gp=G({},On,{animationName:0,elapsedTime:0,pseudoElement:0}),qp=Re(Gp),Jp=G({},On,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Xp=Re(Jp),Zp=G({},On,{data:0}),_o=Re(Zp),em={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tm={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},nm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=nm[e])?!!t[e]:!1}function Pa(){return rm}var lm=G({},_r,{key:function(e){if(e.key){var t=em[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=cl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?tm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pa,charCode:function(e){return e.type==="keypress"?cl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?cl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),sm=Re(lm),im=G({},Xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zo=Re(im),am=G({},_r,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pa}),om=Re(am),um=G({},On,{propertyName:0,elapsedTime:0,pseudoElement:0}),cm=Re(um),dm=G({},Xl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),fm=Re(dm),pm=[9,13,27,32],Ra=it&&"CompositionEvent"in window,nr=null;it&&"documentMode"in document&&(nr=document.documentMode);var mm=it&&"TextEvent"in window&&!nr,Ic=it&&(!Ra||nr&&8<nr&&11>=nr),Io=" ",Fo=!1;function Fc(e,t){switch(e){case"keyup":return pm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var un=!1;function hm(e,t){switch(e){case"compositionend":return Dc(t);case"keypress":return t.which!==32?null:(Fo=!0,Io);case"textInput":return e=t.data,e===Io&&Fo?null:e;default:return null}}function gm(e,t){if(un)return e==="compositionend"||!Ra&&Fc(e,t)?(e=zc(),ul=Ea=vt=null,un=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ic&&t.locale!=="ko"?null:t.data;default:return null}}var vm={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Do(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!vm[e.type]:t==="textarea"}function Oc(e,t,n,r){hc(r),t=Pl(t,"onChange"),0<t.length&&(n=new ka("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var rr=null,gr=null;function ym(e){Gc(e,0)}function Zl(e){var t=fn(e);if(oc(t))return e}function xm(e,t){if(e==="change")return t}var Uc=!1;if(it){var As;if(it){var Ms="oninput"in document;if(!Ms){var Oo=document.createElement("div");Oo.setAttribute("oninput","return;"),Ms=typeof Oo.oninput=="function"}As=Ms}else As=!1;Uc=As&&(!document.documentMode||9<document.documentMode)}function Uo(){rr&&(rr.detachEvent("onpropertychange",$c),gr=rr=null)}function $c(e){if(e.propertyName==="value"&&Zl(gr)){var t=[];Oc(t,gr,e,ja(e)),xc(ym,t)}}function jm(e,t,n){e==="focusin"?(Uo(),rr=t,gr=n,rr.attachEvent("onpropertychange",$c)):e==="focusout"&&Uo()}function wm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zl(gr)}function Sm(e,t){if(e==="click")return Zl(t)}function Nm(e,t){if(e==="input"||e==="change")return Zl(t)}function Cm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ve=typeof Object.is=="function"?Object.is:Cm;function vr(e,t){if(Ve(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var l=n[r];if(!li.call(t,l)||!Ve(e[l],t[l]))return!1}return!0}function $o(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bo(e,t){var n=$o(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$o(n)}}function Bc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bc(){for(var e=window,t=jl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=jl(e.document)}return t}function Ta(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Em(e){var t=bc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Bc(n.ownerDocument.documentElement,n)){if(r!==null&&Ta(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,s=Math.min(r.start,l);r=r.end===void 0?s:Math.min(r.end,l),!e.extend&&s>r&&(l=r,r=s,s=l),l=Bo(n,s);var a=Bo(n,r);l&&a&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var km=it&&"documentMode"in document&&11>=document.documentMode,cn=null,Ni=null,lr=null,Ci=!1;function bo(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ci||cn==null||cn!==jl(r)||(r=cn,"selectionStart"in r&&Ta(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),lr&&vr(lr,r)||(lr=r,r=Pl(Ni,"onSelect"),0<r.length&&(t=new ka("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=cn)))}function Yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var dn={animationend:Yr("Animation","AnimationEnd"),animationiteration:Yr("Animation","AnimationIteration"),animationstart:Yr("Animation","AnimationStart"),transitionend:Yr("Transition","TransitionEnd")},_s={},Wc={};it&&(Wc=document.createElement("div").style,"AnimationEvent"in window||(delete dn.animationend.animation,delete dn.animationiteration.animation,delete dn.animationstart.animation),"TransitionEvent"in window||delete dn.transitionend.transition);function es(e){if(_s[e])return _s[e];if(!dn[e])return e;var t=dn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Wc)return _s[e]=t[n];return e}var Vc=es("animationend"),Hc=es("animationiteration"),Qc=es("animationstart"),Kc=es("transitionend"),Yc=new Map,Wo="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function _t(e,t){Yc.set(e,t),en(t,[e])}for(var zs=0;zs<Wo.length;zs++){var Is=Wo[zs],Pm=Is.toLowerCase(),Rm=Is[0].toUpperCase()+Is.slice(1);_t(Pm,"on"+Rm)}_t(Vc,"onAnimationEnd");_t(Hc,"onAnimationIteration");_t(Qc,"onAnimationStart");_t("dblclick","onDoubleClick");_t("focusin","onFocus");_t("focusout","onBlur");_t(Kc,"onTransitionEnd");En("onMouseEnter",["mouseout","mouseover"]);En("onMouseLeave",["mouseout","mouseover"]);En("onPointerEnter",["pointerout","pointerover"]);En("onPointerLeave",["pointerout","pointerover"]);en("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));en("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));en("onBeforeInput",["compositionend","keypress","textInput","paste"]);en("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));en("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));en("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Tm=new Set("cancel close invalid load scroll toggle".split(" ").concat(Zn));function Vo(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Pp(r,t,void 0,e),e.currentTarget=null}function Gc(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],u=o.instance,c=o.currentTarget;if(o=o.listener,u!==s&&l.isPropagationStopped())break e;Vo(l,o,c),s=u}else for(a=0;a<r.length;a++){if(o=r[a],u=o.instance,c=o.currentTarget,o=o.listener,u!==s&&l.isPropagationStopped())break e;Vo(l,o,c),s=u}}}if(Sl)throw e=xi,Sl=!1,xi=null,e}function B(e,t){var n=t[Ti];n===void 0&&(n=t[Ti]=new Set);var r=e+"__bubble";n.has(r)||(qc(t,e,2,!1),n.add(r))}function Fs(e,t,n){var r=0;t&&(r|=4),qc(n,e,r,t)}var Gr="_reactListening"+Math.random().toString(36).slice(2);function yr(e){if(!e[Gr]){e[Gr]=!0,rc.forEach(function(n){n!=="selectionchange"&&(Tm.has(n)||Fs(n,!1,e),Fs(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Gr]||(t[Gr]=!0,Fs("selectionchange",!1,t))}}function qc(e,t,n,r){switch(_c(t)){case 1:var l=Wp;break;case 4:l=Vp;break;default:l=Ca}n=l.bind(null,t,n,e),l=void 0,!yi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function Ds(e,t,n,r,l){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===l||o.nodeType===8&&o.parentNode===l)break;if(a===4)for(a=r.return;a!==null;){var u=a.tag;if((u===3||u===4)&&(u=a.stateNode.containerInfo,u===l||u.nodeType===8&&u.parentNode===l))return;a=a.return}for(;o!==null;){if(a=Vt(o),a===null)return;if(u=a.tag,u===5||u===6){r=s=a;continue e}o=o.parentNode}}r=r.return}xc(function(){var c=s,p=ja(n),g=[];e:{var m=Yc.get(e);if(m!==void 0){var y=ka,x=e;switch(e){case"keypress":if(cl(n)===0)break e;case"keydown":case"keyup":y=sm;break;case"focusin":x="focus",y=Ls;break;case"focusout":x="blur",y=Ls;break;case"beforeblur":case"afterblur":y=Ls;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=Mo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=Kp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=om;break;case Vc:case Hc:case Qc:y=qp;break;case Kc:y=cm;break;case"scroll":y=Hp;break;case"wheel":y=fm;break;case"copy":case"cut":case"paste":y=Xp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=zo}var w=(t&4)!==0,S=!w&&e==="scroll",f=w?m!==null?m+"Capture":null:m;w=[];for(var d=c,h;d!==null;){h=d;var v=h.stateNode;if(h.tag===5&&v!==null&&(h=v,f!==null&&(v=fr(d,f),v!=null&&w.push(xr(d,v,h)))),S)break;d=d.return}0<w.length&&(m=new y(m,x,null,n,p),g.push({event:m,listeners:w}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",m&&n!==gi&&(x=n.relatedTarget||n.fromElement)&&(Vt(x)||x[at]))break e;if((y||m)&&(m=p.window===p?p:(m=p.ownerDocument)?m.defaultView||m.parentWindow:window,y?(x=n.relatedTarget||n.toElement,y=c,x=x?Vt(x):null,x!==null&&(S=tn(x),x!==S||x.tag!==5&&x.tag!==6)&&(x=null)):(y=null,x=c),y!==x)){if(w=Mo,v="onMouseLeave",f="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(w=zo,v="onPointerLeave",f="onPointerEnter",d="pointer"),S=y==null?m:fn(y),h=x==null?m:fn(x),m=new w(v,d+"leave",y,n,p),m.target=S,m.relatedTarget=h,v=null,Vt(p)===c&&(w=new w(f,d+"enter",x,n,p),w.target=h,w.relatedTarget=S,v=w),S=v,y&&x)t:{for(w=y,f=x,d=0,h=w;h;h=rn(h))d++;for(h=0,v=f;v;v=rn(v))h++;for(;0<d-h;)w=rn(w),d--;for(;0<h-d;)f=rn(f),h--;for(;d--;){if(w===f||f!==null&&w===f.alternate)break t;w=rn(w),f=rn(f)}w=null}else w=null;y!==null&&Ho(g,m,y,w,!1),x!==null&&S!==null&&Ho(g,S,x,w,!0)}}e:{if(m=c?fn(c):window,y=m.nodeName&&m.nodeName.toLowerCase(),y==="select"||y==="input"&&m.type==="file")var N=xm;else if(Do(m))if(Uc)N=Nm;else{N=wm;var E=jm}else(y=m.nodeName)&&y.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(N=Sm);if(N&&(N=N(e,c))){Oc(g,N,n,p);break e}E&&E(e,m,c),e==="focusout"&&(E=m._wrapperState)&&E.controlled&&m.type==="number"&&di(m,"number",m.value)}switch(E=c?fn(c):window,e){case"focusin":(Do(E)||E.contentEditable==="true")&&(cn=E,Ni=c,lr=null);break;case"focusout":lr=Ni=cn=null;break;case"mousedown":Ci=!0;break;case"contextmenu":case"mouseup":case"dragend":Ci=!1,bo(g,n,p);break;case"selectionchange":if(km)break;case"keydown":case"keyup":bo(g,n,p)}var k;if(Ra)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else un?Fc(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Ic&&n.locale!=="ko"&&(un||C!=="onCompositionStart"?C==="onCompositionEnd"&&un&&(k=zc()):(vt=p,Ea="value"in vt?vt.value:vt.textContent,un=!0)),E=Pl(c,C),0<E.length&&(C=new _o(C,e,null,n,p),g.push({event:C,listeners:E}),k?C.data=k:(k=Dc(n),k!==null&&(C.data=k)))),(k=mm?hm(e,n):gm(e,n))&&(c=Pl(c,"onBeforeInput"),0<c.length&&(p=new _o("onBeforeInput","beforeinput",null,n,p),g.push({event:p,listeners:c}),p.data=k))}Gc(g,t)})}function xr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Pl(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,s=l.stateNode;l.tag===5&&s!==null&&(l=s,s=fr(e,n),s!=null&&r.unshift(xr(e,s,l)),s=fr(e,t),s!=null&&r.push(xr(e,s,l))),e=e.return}return r}function rn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ho(e,t,n,r,l){for(var s=t._reactName,a=[];n!==null&&n!==r;){var o=n,u=o.alternate,c=o.stateNode;if(u!==null&&u===r)break;o.tag===5&&c!==null&&(o=c,l?(u=fr(n,s),u!=null&&a.unshift(xr(n,u,o))):l||(u=fr(n,s),u!=null&&a.push(xr(n,u,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var Lm=/\r\n?/g,Am=/\u0000|\uFFFD/g;function Qo(e){return(typeof e=="string"?e:""+e).replace(Lm,`
|
||
`).replace(Am,"")}function qr(e,t,n){if(t=Qo(t),Qo(e)!==t&&n)throw Error(P(425))}function Rl(){}var Ei=null,ki=null;function Pi(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ri=typeof setTimeout=="function"?setTimeout:void 0,Mm=typeof clearTimeout=="function"?clearTimeout:void 0,Ko=typeof Promise=="function"?Promise:void 0,_m=typeof queueMicrotask=="function"?queueMicrotask:typeof Ko<"u"?function(e){return Ko.resolve(null).then(e).catch(zm)}:Ri;function zm(e){setTimeout(function(){throw e})}function Os(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),hr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);hr(t)}function Ct(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Yo(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Un=Math.random().toString(36).slice(2),Ke="__reactFiber$"+Un,jr="__reactProps$"+Un,at="__reactContainer$"+Un,Ti="__reactEvents$"+Un,Im="__reactListeners$"+Un,Fm="__reactHandles$"+Un;function Vt(e){var t=e[Ke];if(t)return t;for(var n=e.parentNode;n;){if(t=n[at]||n[Ke]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Yo(e);e!==null;){if(n=e[Ke])return n;e=Yo(e)}return t}e=n,n=e.parentNode}return null}function zr(e){return e=e[Ke]||e[at],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function fn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(P(33))}function ts(e){return e[jr]||null}var Li=[],pn=-1;function zt(e){return{current:e}}function b(e){0>pn||(e.current=Li[pn],Li[pn]=null,pn--)}function $(e,t){pn++,Li[pn]=e.current,e.current=t}var Mt={},fe=zt(Mt),xe=zt(!1),Gt=Mt;function kn(e,t){var n=e.type.contextTypes;if(!n)return Mt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},s;for(s in n)l[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function je(e){return e=e.childContextTypes,e!=null}function Tl(){b(xe),b(fe)}function Go(e,t,n){if(fe.current!==Mt)throw Error(P(168));$(fe,t),$(xe,n)}function Jc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(P(108,jp(e)||"Unknown",l));return G({},n,r)}function Ll(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Mt,Gt=fe.current,$(fe,e),$(xe,xe.current),!0}function qo(e,t,n){var r=e.stateNode;if(!r)throw Error(P(169));n?(e=Jc(e,t,Gt),r.__reactInternalMemoizedMergedChildContext=e,b(xe),b(fe),$(fe,e)):b(xe),$(xe,n)}var tt=null,ns=!1,Us=!1;function Xc(e){tt===null?tt=[e]:tt.push(e)}function Dm(e){ns=!0,Xc(e)}function It(){if(!Us&&tt!==null){Us=!0;var e=0,t=D;try{var n=tt;for(D=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}tt=null,ns=!1}catch(l){throw tt!==null&&(tt=tt.slice(e+1)),Nc(wa,It),l}finally{D=t,Us=!1}}return null}var mn=[],hn=0,Al=null,Ml=0,Me=[],_e=0,qt=null,nt=1,rt="";function bt(e,t){mn[hn++]=Ml,mn[hn++]=Al,Al=e,Ml=t}function Zc(e,t,n){Me[_e++]=nt,Me[_e++]=rt,Me[_e++]=qt,qt=e;var r=nt;e=rt;var l=32-be(r)-1;r&=~(1<<l),n+=1;var s=32-be(t)+l;if(30<s){var a=l-l%5;s=(r&(1<<a)-1).toString(32),r>>=a,l-=a,nt=1<<32-be(t)+l|n<<l|r,rt=s+e}else nt=1<<s|n<<l|r,rt=e}function La(e){e.return!==null&&(bt(e,1),Zc(e,1,0))}function Aa(e){for(;e===Al;)Al=mn[--hn],mn[hn]=null,Ml=mn[--hn],mn[hn]=null;for(;e===qt;)qt=Me[--_e],Me[_e]=null,rt=Me[--_e],Me[_e]=null,nt=Me[--_e],Me[_e]=null}var Ce=null,Ne=null,V=!1,Be=null;function ed(e,t){var n=ze(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Jo(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ce=e,Ne=Ct(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ce=e,Ne=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=qt!==null?{id:nt,overflow:rt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ze(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ce=e,Ne=null,!0):!1;default:return!1}}function Ai(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Mi(e){if(V){var t=Ne;if(t){var n=t;if(!Jo(e,t)){if(Ai(e))throw Error(P(418));t=Ct(n.nextSibling);var r=Ce;t&&Jo(e,t)?ed(r,n):(e.flags=e.flags&-4097|2,V=!1,Ce=e)}}else{if(Ai(e))throw Error(P(418));e.flags=e.flags&-4097|2,V=!1,Ce=e}}}function Xo(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ce=e}function Jr(e){if(e!==Ce)return!1;if(!V)return Xo(e),V=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Pi(e.type,e.memoizedProps)),t&&(t=Ne)){if(Ai(e))throw td(),Error(P(418));for(;t;)ed(e,t),t=Ct(t.nextSibling)}if(Xo(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(P(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ne=Ct(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ne=null}}else Ne=Ce?Ct(e.stateNode.nextSibling):null;return!0}function td(){for(var e=Ne;e;)e=Ct(e.nextSibling)}function Pn(){Ne=Ce=null,V=!1}function Ma(e){Be===null?Be=[e]:Be.push(e)}var Om=ct.ReactCurrentBatchConfig;function Kn(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(P(309));var r=n.stateNode}if(!r)throw Error(P(147,e));var l=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(a){var o=l.refs;a===null?delete o[s]:o[s]=a},t._stringRef=s,t)}if(typeof e!="string")throw Error(P(284));if(!n._owner)throw Error(P(290,e))}return e}function Xr(e,t){throw e=Object.prototype.toString.call(t),Error(P(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Zo(e){var t=e._init;return t(e._payload)}function nd(e){function t(f,d){if(e){var h=f.deletions;h===null?(f.deletions=[d],f.flags|=16):h.push(d)}}function n(f,d){if(!e)return null;for(;d!==null;)t(f,d),d=d.sibling;return null}function r(f,d){for(f=new Map;d!==null;)d.key!==null?f.set(d.key,d):f.set(d.index,d),d=d.sibling;return f}function l(f,d){return f=Rt(f,d),f.index=0,f.sibling=null,f}function s(f,d,h){return f.index=h,e?(h=f.alternate,h!==null?(h=h.index,h<d?(f.flags|=2,d):h):(f.flags|=2,d)):(f.flags|=1048576,d)}function a(f){return e&&f.alternate===null&&(f.flags|=2),f}function o(f,d,h,v){return d===null||d.tag!==6?(d=Qs(h,f.mode,v),d.return=f,d):(d=l(d,h),d.return=f,d)}function u(f,d,h,v){var N=h.type;return N===on?p(f,d,h.props.children,v,h.key):d!==null&&(d.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===pt&&Zo(N)===d.type)?(v=l(d,h.props),v.ref=Kn(f,d,h),v.return=f,v):(v=vl(h.type,h.key,h.props,null,f.mode,v),v.ref=Kn(f,d,h),v.return=f,v)}function c(f,d,h,v){return d===null||d.tag!==4||d.stateNode.containerInfo!==h.containerInfo||d.stateNode.implementation!==h.implementation?(d=Ks(h,f.mode,v),d.return=f,d):(d=l(d,h.children||[]),d.return=f,d)}function p(f,d,h,v,N){return d===null||d.tag!==7?(d=Yt(h,f.mode,v,N),d.return=f,d):(d=l(d,h),d.return=f,d)}function g(f,d,h){if(typeof d=="string"&&d!==""||typeof d=="number")return d=Qs(""+d,f.mode,h),d.return=f,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Br:return h=vl(d.type,d.key,d.props,null,f.mode,h),h.ref=Kn(f,null,d),h.return=f,h;case an:return d=Ks(d,f.mode,h),d.return=f,d;case pt:var v=d._init;return g(f,v(d._payload),h)}if(Jn(d)||bn(d))return d=Yt(d,f.mode,h,null),d.return=f,d;Xr(f,d)}return null}function m(f,d,h,v){var N=d!==null?d.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return N!==null?null:o(f,d,""+h,v);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Br:return h.key===N?u(f,d,h,v):null;case an:return h.key===N?c(f,d,h,v):null;case pt:return N=h._init,m(f,d,N(h._payload),v)}if(Jn(h)||bn(h))return N!==null?null:p(f,d,h,v,null);Xr(f,h)}return null}function y(f,d,h,v,N){if(typeof v=="string"&&v!==""||typeof v=="number")return f=f.get(h)||null,o(d,f,""+v,N);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Br:return f=f.get(v.key===null?h:v.key)||null,u(d,f,v,N);case an:return f=f.get(v.key===null?h:v.key)||null,c(d,f,v,N);case pt:var E=v._init;return y(f,d,h,E(v._payload),N)}if(Jn(v)||bn(v))return f=f.get(h)||null,p(d,f,v,N,null);Xr(d,v)}return null}function x(f,d,h,v){for(var N=null,E=null,k=d,C=d=0,M=null;k!==null&&C<h.length;C++){k.index>C?(M=k,k=null):M=k.sibling;var A=m(f,k,h[C],v);if(A===null){k===null&&(k=M);break}e&&k&&A.alternate===null&&t(f,k),d=s(A,d,C),E===null?N=A:E.sibling=A,E=A,k=M}if(C===h.length)return n(f,k),V&&bt(f,C),N;if(k===null){for(;C<h.length;C++)k=g(f,h[C],v),k!==null&&(d=s(k,d,C),E===null?N=k:E.sibling=k,E=k);return V&&bt(f,C),N}for(k=r(f,k);C<h.length;C++)M=y(k,f,C,h[C],v),M!==null&&(e&&M.alternate!==null&&k.delete(M.key===null?C:M.key),d=s(M,d,C),E===null?N=M:E.sibling=M,E=M);return e&&k.forEach(function(U){return t(f,U)}),V&&bt(f,C),N}function w(f,d,h,v){var N=bn(h);if(typeof N!="function")throw Error(P(150));if(h=N.call(h),h==null)throw Error(P(151));for(var E=N=null,k=d,C=d=0,M=null,A=h.next();k!==null&&!A.done;C++,A=h.next()){k.index>C?(M=k,k=null):M=k.sibling;var U=m(f,k,A.value,v);if(U===null){k===null&&(k=M);break}e&&k&&U.alternate===null&&t(f,k),d=s(U,d,C),E===null?N=U:E.sibling=U,E=U,k=M}if(A.done)return n(f,k),V&&bt(f,C),N;if(k===null){for(;!A.done;C++,A=h.next())A=g(f,A.value,v),A!==null&&(d=s(A,d,C),E===null?N=A:E.sibling=A,E=A);return V&&bt(f,C),N}for(k=r(f,k);!A.done;C++,A=h.next())A=y(k,f,C,A.value,v),A!==null&&(e&&A.alternate!==null&&k.delete(A.key===null?C:A.key),d=s(A,d,C),E===null?N=A:E.sibling=A,E=A);return e&&k.forEach(function(Le){return t(f,Le)}),V&&bt(f,C),N}function S(f,d,h,v){if(typeof h=="object"&&h!==null&&h.type===on&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Br:e:{for(var N=h.key,E=d;E!==null;){if(E.key===N){if(N=h.type,N===on){if(E.tag===7){n(f,E.sibling),d=l(E,h.props.children),d.return=f,f=d;break e}}else if(E.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===pt&&Zo(N)===E.type){n(f,E.sibling),d=l(E,h.props),d.ref=Kn(f,E,h),d.return=f,f=d;break e}n(f,E);break}else t(f,E);E=E.sibling}h.type===on?(d=Yt(h.props.children,f.mode,v,h.key),d.return=f,f=d):(v=vl(h.type,h.key,h.props,null,f.mode,v),v.ref=Kn(f,d,h),v.return=f,f=v)}return a(f);case an:e:{for(E=h.key;d!==null;){if(d.key===E)if(d.tag===4&&d.stateNode.containerInfo===h.containerInfo&&d.stateNode.implementation===h.implementation){n(f,d.sibling),d=l(d,h.children||[]),d.return=f,f=d;break e}else{n(f,d);break}else t(f,d);d=d.sibling}d=Ks(h,f.mode,v),d.return=f,f=d}return a(f);case pt:return E=h._init,S(f,d,E(h._payload),v)}if(Jn(h))return x(f,d,h,v);if(bn(h))return w(f,d,h,v);Xr(f,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,d!==null&&d.tag===6?(n(f,d.sibling),d=l(d,h),d.return=f,f=d):(n(f,d),d=Qs(h,f.mode,v),d.return=f,f=d),a(f)):n(f,d)}return S}var Rn=nd(!0),rd=nd(!1),_l=zt(null),zl=null,gn=null,_a=null;function za(){_a=gn=zl=null}function Ia(e){var t=_l.current;b(_l),e._currentValue=t}function _i(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Nn(e,t){zl=e,_a=gn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ye=!0),e.firstContext=null)}function Fe(e){var t=e._currentValue;if(_a!==e)if(e={context:e,memoizedValue:t,next:null},gn===null){if(zl===null)throw Error(P(308));gn=e,zl.dependencies={lanes:0,firstContext:e}}else gn=gn.next=e;return t}var Ht=null;function Fa(e){Ht===null?Ht=[e]:Ht.push(e)}function ld(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Fa(t)):(n.next=l.next,l.next=n),t.interleaved=n,ot(e,r)}function ot(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var mt=!1;function Da(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function st(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Et(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,F&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,ot(e,n)}return l=r.interleaved,l===null?(t.next=t,Fa(r)):(t.next=l.next,l.next=t),r.interleaved=t,ot(e,n)}function dl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Sa(e,n)}}function eu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?l=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?l=s=t:s=s.next=t}else l=s=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Il(e,t,n,r){var l=e.updateQueue;mt=!1;var s=l.firstBaseUpdate,a=l.lastBaseUpdate,o=l.shared.pending;if(o!==null){l.shared.pending=null;var u=o,c=u.next;u.next=null,a===null?s=c:a.next=c,a=u;var p=e.alternate;p!==null&&(p=p.updateQueue,o=p.lastBaseUpdate,o!==a&&(o===null?p.firstBaseUpdate=c:o.next=c,p.lastBaseUpdate=u))}if(s!==null){var g=l.baseState;a=0,p=c=u=null,o=s;do{var m=o.lane,y=o.eventTime;if((r&m)===m){p!==null&&(p=p.next={eventTime:y,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var x=e,w=o;switch(m=t,y=n,w.tag){case 1:if(x=w.payload,typeof x=="function"){g=x.call(y,g,m);break e}g=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,m=typeof x=="function"?x.call(y,g,m):x,m==null)break e;g=G({},g,m);break e;case 2:mt=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,m=l.effects,m===null?l.effects=[o]:m.push(o))}else y={eventTime:y,lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},p===null?(c=p=y,u=g):p=p.next=y,a|=m;if(o=o.next,o===null){if(o=l.shared.pending,o===null)break;m=o,o=m.next,m.next=null,l.lastBaseUpdate=m,l.shared.pending=null}}while(!0);if(p===null&&(u=g),l.baseState=u,l.firstBaseUpdate=c,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do a|=l.lane,l=l.next;while(l!==t)}else s===null&&(l.shared.lanes=0);Xt|=a,e.lanes=a,e.memoizedState=g}}function tu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error(P(191,l));l.call(r)}}}var Ir={},Ge=zt(Ir),wr=zt(Ir),Sr=zt(Ir);function Qt(e){if(e===Ir)throw Error(P(174));return e}function Oa(e,t){switch($(Sr,t),$(wr,e),$(Ge,Ir),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=pi(t,e)}b(Ge),$(Ge,t)}function Tn(){b(Ge),b(wr),b(Sr)}function id(e){Qt(Sr.current);var t=Qt(Ge.current),n=pi(t,e.type);t!==n&&($(wr,e),$(Ge,n))}function Ua(e){wr.current===e&&(b(Ge),b(wr))}var Q=zt(0);function Fl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var $s=[];function $a(){for(var e=0;e<$s.length;e++)$s[e]._workInProgressVersionPrimary=null;$s.length=0}var fl=ct.ReactCurrentDispatcher,Bs=ct.ReactCurrentBatchConfig,Jt=0,K=null,te=null,re=null,Dl=!1,sr=!1,Nr=0,Um=0;function ue(){throw Error(P(321))}function Ba(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ve(e[n],t[n]))return!1;return!0}function ba(e,t,n,r,l,s){if(Jt=s,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fl.current=e===null||e.memoizedState===null?Wm:Vm,e=n(r,l),sr){s=0;do{if(sr=!1,Nr=0,25<=s)throw Error(P(301));s+=1,re=te=null,t.updateQueue=null,fl.current=Hm,e=n(r,l)}while(sr)}if(fl.current=Ol,t=te!==null&&te.next!==null,Jt=0,re=te=K=null,Dl=!1,t)throw Error(P(300));return e}function Wa(){var e=Nr!==0;return Nr=0,e}function Qe(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return re===null?K.memoizedState=re=e:re=re.next=e,re}function De(){if(te===null){var e=K.alternate;e=e!==null?e.memoizedState:null}else e=te.next;var t=re===null?K.memoizedState:re.next;if(t!==null)re=t,te=e;else{if(e===null)throw Error(P(310));te=e,e={memoizedState:te.memoizedState,baseState:te.baseState,baseQueue:te.baseQueue,queue:te.queue,next:null},re===null?K.memoizedState=re=e:re=re.next=e}return re}function Cr(e,t){return typeof t=="function"?t(e):t}function bs(e){var t=De(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var r=te,l=r.baseQueue,s=n.pending;if(s!==null){if(l!==null){var a=l.next;l.next=s.next,s.next=a}r.baseQueue=l=s,n.pending=null}if(l!==null){s=l.next,r=r.baseState;var o=a=null,u=null,c=s;do{var p=c.lane;if((Jt&p)===p)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var g={lane:p,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(o=u=g,a=r):u=u.next=g,K.lanes|=p,Xt|=p}c=c.next}while(c!==null&&c!==s);u===null?a=r:u.next=o,Ve(r,t.memoizedState)||(ye=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do s=l.lane,K.lanes|=s,Xt|=s,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ws(e){var t=De(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,s=t.memoizedState;if(l!==null){n.pending=null;var a=l=l.next;do s=e(s,a.action),a=a.next;while(a!==l);Ve(s,t.memoizedState)||(ye=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function ad(){}function od(e,t){var n=K,r=De(),l=t(),s=!Ve(r.memoizedState,l);if(s&&(r.memoizedState=l,ye=!0),r=r.queue,Va(dd.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||re!==null&&re.memoizedState.tag&1){if(n.flags|=2048,Er(9,cd.bind(null,n,r,l,t),void 0,null),le===null)throw Error(P(349));Jt&30||ud(n,t,l)}return l}function ud(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t={lastEffect:null,stores:null},K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function cd(e,t,n,r){t.value=n,t.getSnapshot=r,fd(t)&&pd(e)}function dd(e,t,n){return n(function(){fd(t)&&pd(e)})}function fd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ve(e,n)}catch{return!0}}function pd(e){var t=ot(e,1);t!==null&&We(t,e,1,-1)}function nu(e){var t=Qe();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:e},t.queue=e,e=e.dispatch=bm.bind(null,K,e),[t.memoizedState,e]}function Er(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=K.updateQueue,t===null?(t={lastEffect:null,stores:null},K.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function md(){return De().memoizedState}function pl(e,t,n,r){var l=Qe();K.flags|=e,l.memoizedState=Er(1|t,n,void 0,r===void 0?null:r)}function rs(e,t,n,r){var l=De();r=r===void 0?null:r;var s=void 0;if(te!==null){var a=te.memoizedState;if(s=a.destroy,r!==null&&Ba(r,a.deps)){l.memoizedState=Er(t,n,s,r);return}}K.flags|=e,l.memoizedState=Er(1|t,n,s,r)}function ru(e,t){return pl(8390656,8,e,t)}function Va(e,t){return rs(2048,8,e,t)}function hd(e,t){return rs(4,2,e,t)}function gd(e,t){return rs(4,4,e,t)}function vd(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function yd(e,t,n){return n=n!=null?n.concat([e]):null,rs(4,4,vd.bind(null,t,e),n)}function Ha(){}function xd(e,t){var n=De();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ba(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function jd(e,t){var n=De();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ba(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function wd(e,t,n){return Jt&21?(Ve(n,t)||(n=kc(),K.lanes|=n,Xt|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ye=!0),e.memoizedState=n)}function $m(e,t){var n=D;D=n!==0&&4>n?n:4,e(!0);var r=Bs.transition;Bs.transition={};try{e(!1),t()}finally{D=n,Bs.transition=r}}function Sd(){return De().memoizedState}function Bm(e,t,n){var r=Pt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Nd(e))Cd(t,n);else if(n=ld(e,t,n,r),n!==null){var l=me();We(n,e,r,l),Ed(n,t,r)}}function bm(e,t,n){var r=Pt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Nd(e))Cd(t,l);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,n);if(l.hasEagerState=!0,l.eagerState=o,Ve(o,a)){var u=t.interleaved;u===null?(l.next=l,Fa(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=ld(e,t,l,r),n!==null&&(l=me(),We(n,e,r,l),Ed(n,t,r))}}function Nd(e){var t=e.alternate;return e===K||t!==null&&t===K}function Cd(e,t){sr=Dl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ed(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Sa(e,n)}}var Ol={readContext:Fe,useCallback:ue,useContext:ue,useEffect:ue,useImperativeHandle:ue,useInsertionEffect:ue,useLayoutEffect:ue,useMemo:ue,useReducer:ue,useRef:ue,useState:ue,useDebugValue:ue,useDeferredValue:ue,useTransition:ue,useMutableSource:ue,useSyncExternalStore:ue,useId:ue,unstable_isNewReconciler:!1},Wm={readContext:Fe,useCallback:function(e,t){return Qe().memoizedState=[e,t===void 0?null:t],e},useContext:Fe,useEffect:ru,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,pl(4194308,4,vd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return pl(4194308,4,e,t)},useInsertionEffect:function(e,t){return pl(4,2,e,t)},useMemo:function(e,t){var n=Qe();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Qe();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Bm.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=Qe();return e={current:e},t.memoizedState=e},useState:nu,useDebugValue:Ha,useDeferredValue:function(e){return Qe().memoizedState=e},useTransition:function(){var e=nu(!1),t=e[0];return e=$m.bind(null,e[1]),Qe().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=K,l=Qe();if(V){if(n===void 0)throw Error(P(407));n=n()}else{if(n=t(),le===null)throw Error(P(349));Jt&30||ud(r,t,n)}l.memoizedState=n;var s={value:n,getSnapshot:t};return l.queue=s,ru(dd.bind(null,r,s,e),[e]),r.flags|=2048,Er(9,cd.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Qe(),t=le.identifierPrefix;if(V){var n=rt,r=nt;n=(r&~(1<<32-be(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Nr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Um++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Vm={readContext:Fe,useCallback:xd,useContext:Fe,useEffect:Va,useImperativeHandle:yd,useInsertionEffect:hd,useLayoutEffect:gd,useMemo:jd,useReducer:bs,useRef:md,useState:function(){return bs(Cr)},useDebugValue:Ha,useDeferredValue:function(e){var t=De();return wd(t,te.memoizedState,e)},useTransition:function(){var e=bs(Cr)[0],t=De().memoizedState;return[e,t]},useMutableSource:ad,useSyncExternalStore:od,useId:Sd,unstable_isNewReconciler:!1},Hm={readContext:Fe,useCallback:xd,useContext:Fe,useEffect:Va,useImperativeHandle:yd,useInsertionEffect:hd,useLayoutEffect:gd,useMemo:jd,useReducer:Ws,useRef:md,useState:function(){return Ws(Cr)},useDebugValue:Ha,useDeferredValue:function(e){var t=De();return te===null?t.memoizedState=e:wd(t,te.memoizedState,e)},useTransition:function(){var e=Ws(Cr)[0],t=De().memoizedState;return[e,t]},useMutableSource:ad,useSyncExternalStore:od,useId:Sd,unstable_isNewReconciler:!1};function Ue(e,t){if(e&&e.defaultProps){t=G({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function zi(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:G({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ls={isMounted:function(e){return(e=e._reactInternals)?tn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=me(),l=Pt(e),s=st(r,l);s.payload=t,n!=null&&(s.callback=n),t=Et(e,s,l),t!==null&&(We(t,e,l,r),dl(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=me(),l=Pt(e),s=st(r,l);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Et(e,s,l),t!==null&&(We(t,e,l,r),dl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=me(),r=Pt(e),l=st(n,r);l.tag=2,t!=null&&(l.callback=t),t=Et(e,l,r),t!==null&&(We(t,e,r,n),dl(t,e,r))}};function lu(e,t,n,r,l,s,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,a):t.prototype&&t.prototype.isPureReactComponent?!vr(n,r)||!vr(l,s):!0}function kd(e,t,n){var r=!1,l=Mt,s=t.contextType;return typeof s=="object"&&s!==null?s=Fe(s):(l=je(t)?Gt:fe.current,r=t.contextTypes,s=(r=r!=null)?kn(e,l):Mt),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ls,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=s),t}function su(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ls.enqueueReplaceState(t,t.state,null)}function Ii(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},Da(e);var s=t.contextType;typeof s=="object"&&s!==null?l.context=Fe(s):(s=je(t)?Gt:fe.current,l.context=kn(e,s)),l.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(zi(e,t,s,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&ls.enqueueReplaceState(l,l.state,null),Il(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function Ln(e,t){try{var n="",r=t;do n+=xp(r),r=r.return;while(r);var l=n}catch(s){l=`
|
||
Error generating stack: `+s.message+`
|
||
`+s.stack}return{value:e,source:t,stack:l,digest:null}}function Vs(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Fi(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Qm=typeof WeakMap=="function"?WeakMap:Map;function Pd(e,t,n){n=st(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){$l||($l=!0,Qi=r),Fi(e,t)},n}function Rd(e,t,n){n=st(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){Fi(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Fi(e,t),typeof r!="function"&&(kt===null?kt=new Set([this]):kt.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function iu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qm;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=ih.bind(null,e,t,n),t.then(e,e))}function au(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ou(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=st(-1,1),t.tag=2,Et(n,t,1))),n.lanes|=1),e)}var Km=ct.ReactCurrentOwner,ye=!1;function pe(e,t,n,r){t.child=e===null?rd(t,null,n,r):Rn(t,e.child,n,r)}function uu(e,t,n,r,l){n=n.render;var s=t.ref;return Nn(t,l),r=ba(e,t,n,r,s,l),n=Wa(),e!==null&&!ye?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,ut(e,t,l)):(V&&n&&La(t),t.flags|=1,pe(e,t,r,l),t.child)}function cu(e,t,n,r,l){if(e===null){var s=n.type;return typeof s=="function"&&!Za(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Td(e,t,s,r,l)):(e=vl(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&l)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:vr,n(a,r)&&e.ref===t.ref)return ut(e,t,l)}return t.flags|=1,e=Rt(s,r),e.ref=t.ref,e.return=t,t.child=e}function Td(e,t,n,r,l){if(e!==null){var s=e.memoizedProps;if(vr(s,r)&&e.ref===t.ref)if(ye=!1,t.pendingProps=r=s,(e.lanes&l)!==0)e.flags&131072&&(ye=!0);else return t.lanes=e.lanes,ut(e,t,l)}return Di(e,t,n,r,l)}function Ld(e,t,n){var r=t.pendingProps,l=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},$(yn,Se),Se|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,$(yn,Se),Se|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,$(yn,Se),Se|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,$(yn,Se),Se|=r;return pe(e,t,l,n),t.child}function Ad(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Di(e,t,n,r,l){var s=je(n)?Gt:fe.current;return s=kn(t,s),Nn(t,l),n=ba(e,t,n,r,s,l),r=Wa(),e!==null&&!ye?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,ut(e,t,l)):(V&&r&&La(t),t.flags|=1,pe(e,t,n,l),t.child)}function du(e,t,n,r,l){if(je(n)){var s=!0;Ll(t)}else s=!1;if(Nn(t,l),t.stateNode===null)ml(e,t),kd(t,n,r),Ii(t,n,r,l),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var u=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=Fe(c):(c=je(n)?Gt:fe.current,c=kn(t,c));var p=n.getDerivedStateFromProps,g=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function";g||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||u!==c)&&su(t,a,r,c),mt=!1;var m=t.memoizedState;a.state=m,Il(t,r,a,l),u=t.memoizedState,o!==r||m!==u||xe.current||mt?(typeof p=="function"&&(zi(t,n,p,r),u=t.memoizedState),(o=mt||lu(t,n,o,r,m,u,c))?(g||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,sd(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:Ue(t.type,o),a.props=c,g=t.pendingProps,m=a.context,u=n.contextType,typeof u=="object"&&u!==null?u=Fe(u):(u=je(n)?Gt:fe.current,u=kn(t,u));var y=n.getDerivedStateFromProps;(p=typeof y=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==g||m!==u)&&su(t,a,r,u),mt=!1,m=t.memoizedState,a.state=m,Il(t,r,a,l);var x=t.memoizedState;o!==g||m!==x||xe.current||mt?(typeof y=="function"&&(zi(t,n,y,r),x=t.memoizedState),(c=mt||lu(t,n,c,r,m,x,u)||!1)?(p||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,x,u),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,x,u)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),a.props=r,a.state=x,a.context=u,r=c):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Oi(e,t,n,r,s,l)}function Oi(e,t,n,r,l,s){Ad(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return l&&qo(t,n,!1),ut(e,t,s);r=t.stateNode,Km.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Rn(t,e.child,null,s),t.child=Rn(t,null,o,s)):pe(e,t,o,s),t.memoizedState=r.state,l&&qo(t,n,!0),t.child}function Md(e){var t=e.stateNode;t.pendingContext?Go(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Go(e,t.context,!1),Oa(e,t.containerInfo)}function fu(e,t,n,r,l){return Pn(),Ma(l),t.flags|=256,pe(e,t,n,r),t.child}var Ui={dehydrated:null,treeContext:null,retryLane:0};function $i(e){return{baseLanes:e,cachePool:null,transitions:null}}function _d(e,t,n){var r=t.pendingProps,l=Q.current,s=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(l&2)!==0),o?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),$(Q,l&1),e===null)return Mi(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,s?(r=t.mode,s=t.child,a={mode:"hidden",children:a},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=as(a,r,0,null),e=Yt(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=$i(n),t.memoizedState=Ui,e):Qa(t,a));if(l=e.memoizedState,l!==null&&(o=l.dehydrated,o!==null))return Ym(e,t,a,r,o,l,n);if(s){s=r.fallback,a=t.mode,l=e.child,o=l.sibling;var u={mode:"hidden",children:r.children};return!(a&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Rt(l,u),r.subtreeFlags=l.subtreeFlags&14680064),o!==null?s=Rt(o,s):(s=Yt(s,a,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,a=e.child.memoizedState,a=a===null?$i(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=e.childLanes&~n,t.memoizedState=Ui,r}return s=e.child,e=s.sibling,r=Rt(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Qa(e,t){return t=as({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Zr(e,t,n,r){return r!==null&&Ma(r),Rn(t,e.child,null,n),e=Qa(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ym(e,t,n,r,l,s,a){if(n)return t.flags&256?(t.flags&=-257,r=Vs(Error(P(422))),Zr(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,l=t.mode,r=as({mode:"visible",children:r.children},l,0,null),s=Yt(s,l,a,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Rn(t,e.child,null,a),t.child.memoizedState=$i(a),t.memoizedState=Ui,s);if(!(t.mode&1))return Zr(e,t,a,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(P(419)),r=Vs(s,r,void 0),Zr(e,t,a,r)}if(o=(a&e.childLanes)!==0,ye||o){if(r=le,r!==null){switch(a&-a){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|a)?0:l,l!==0&&l!==s.retryLane&&(s.retryLane=l,ot(e,l),We(r,e,l,-1))}return Xa(),r=Vs(Error(P(421))),Zr(e,t,a,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=ah.bind(null,e),l._reactRetry=t,null):(e=s.treeContext,Ne=Ct(l.nextSibling),Ce=t,V=!0,Be=null,e!==null&&(Me[_e++]=nt,Me[_e++]=rt,Me[_e++]=qt,nt=e.id,rt=e.overflow,qt=t),t=Qa(t,r.children),t.flags|=4096,t)}function pu(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_i(e.return,t,n)}function Hs(e,t,n,r,l){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=l)}function zd(e,t,n){var r=t.pendingProps,l=r.revealOrder,s=r.tail;if(pe(e,t,r.children,n),r=Q.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&pu(e,n,t);else if(e.tag===19)pu(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if($(Q,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Fl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Hs(t,!1,l,n,s);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Fl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Hs(t,!0,n,null,s);break;case"together":Hs(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ml(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ut(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Xt|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(P(153));if(t.child!==null){for(e=t.child,n=Rt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Rt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Gm(e,t,n){switch(t.tag){case 3:Md(t),Pn();break;case 5:id(t);break;case 1:je(t.type)&&Ll(t);break;case 4:Oa(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;$(_l,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?($(Q,Q.current&1),t.flags|=128,null):n&t.child.childLanes?_d(e,t,n):($(Q,Q.current&1),e=ut(e,t,n),e!==null?e.sibling:null);$(Q,Q.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return zd(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),$(Q,Q.current),r)break;return null;case 22:case 23:return t.lanes=0,Ld(e,t,n)}return ut(e,t,n)}var Id,Bi,Fd,Dd;Id=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Bi=function(){};Fd=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Qt(Ge.current);var s=null;switch(n){case"input":l=ui(e,l),r=ui(e,r),s=[];break;case"select":l=G({},l,{value:void 0}),r=G({},r,{value:void 0}),s=[];break;case"textarea":l=fi(e,l),r=fi(e,r),s=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Rl)}mi(n,r);var a;n=null;for(c in l)if(!r.hasOwnProperty(c)&&l.hasOwnProperty(c)&&l[c]!=null)if(c==="style"){var o=l[c];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(cr.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var u=r[c];if(o=l!=null?l[c]:void 0,r.hasOwnProperty(c)&&u!==o&&(u!=null||o!=null))if(c==="style")if(o){for(a in o)!o.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&o[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(s||(s=[]),s.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(s=s||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(cr.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&B("scroll",e),s||o===u||(s=[])):(s=s||[]).push(c,u))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};Dd=function(e,t,n,r){n!==r&&(t.flags|=4)};function Yn(e,t){if(!V)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ce(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function qm(e,t,n){var r=t.pendingProps;switch(Aa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ce(t),null;case 1:return je(t.type)&&Tl(),ce(t),null;case 3:return r=t.stateNode,Tn(),b(xe),b(fe),$a(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Jr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Be!==null&&(Gi(Be),Be=null))),Bi(e,t),ce(t),null;case 5:Ua(t);var l=Qt(Sr.current);if(n=t.type,e!==null&&t.stateNode!=null)Fd(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(P(166));return ce(t),null}if(e=Qt(Ge.current),Jr(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Ke]=t,r[jr]=s,e=(t.mode&1)!==0,n){case"dialog":B("cancel",r),B("close",r);break;case"iframe":case"object":case"embed":B("load",r);break;case"video":case"audio":for(l=0;l<Zn.length;l++)B(Zn[l],r);break;case"source":B("error",r);break;case"img":case"image":case"link":B("error",r),B("load",r);break;case"details":B("toggle",r);break;case"input":So(r,s),B("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},B("invalid",r);break;case"textarea":Co(r,s),B("invalid",r)}mi(n,s),l=null;for(var a in s)if(s.hasOwnProperty(a)){var o=s[a];a==="children"?typeof o=="string"?r.textContent!==o&&(s.suppressHydrationWarning!==!0&&qr(r.textContent,o,e),l=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&qr(r.textContent,o,e),l=["children",""+o]):cr.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&B("scroll",r)}switch(n){case"input":br(r),No(r,s,!0);break;case"textarea":br(r),Eo(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Rl)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=dc(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Ke]=t,e[jr]=r,Id(e,t,!1,!1),t.stateNode=e;e:{switch(a=hi(n,r),n){case"dialog":B("cancel",e),B("close",e),l=r;break;case"iframe":case"object":case"embed":B("load",e),l=r;break;case"video":case"audio":for(l=0;l<Zn.length;l++)B(Zn[l],e);l=r;break;case"source":B("error",e),l=r;break;case"img":case"image":case"link":B("error",e),B("load",e),l=r;break;case"details":B("toggle",e),l=r;break;case"input":So(e,r),l=ui(e,r),B("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=G({},r,{value:void 0}),B("invalid",e);break;case"textarea":Co(e,r),l=fi(e,r),B("invalid",e);break;default:l=r}mi(n,l),o=l;for(s in o)if(o.hasOwnProperty(s)){var u=o[s];s==="style"?mc(e,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&fc(e,u)):s==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&dr(e,u):typeof u=="number"&&dr(e,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(cr.hasOwnProperty(s)?u!=null&&s==="onScroll"&&B("scroll",e):u!=null&&ga(e,s,u,a))}switch(n){case"input":br(e),No(e,r,!1);break;case"textarea":br(e),Eo(e);break;case"option":r.value!=null&&e.setAttribute("value",""+At(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?xn(e,!!r.multiple,s,!1):r.defaultValue!=null&&xn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Rl)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ce(t),null;case 6:if(e&&t.stateNode!=null)Dd(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(P(166));if(n=Qt(Sr.current),Qt(Ge.current),Jr(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ke]=t,(s=r.nodeValue!==n)&&(e=Ce,e!==null))switch(e.tag){case 3:qr(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&qr(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ke]=t,t.stateNode=r}return ce(t),null;case 13:if(b(Q),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(V&&Ne!==null&&t.mode&1&&!(t.flags&128))td(),Pn(),t.flags|=98560,s=!1;else if(s=Jr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(P(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(P(317));s[Ke]=t}else Pn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ce(t),s=!1}else Be!==null&&(Gi(Be),Be=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Q.current&1?ne===0&&(ne=3):Xa())),t.updateQueue!==null&&(t.flags|=4),ce(t),null);case 4:return Tn(),Bi(e,t),e===null&&yr(t.stateNode.containerInfo),ce(t),null;case 10:return Ia(t.type._context),ce(t),null;case 17:return je(t.type)&&Tl(),ce(t),null;case 19:if(b(Q),s=t.memoizedState,s===null)return ce(t),null;if(r=(t.flags&128)!==0,a=s.rendering,a===null)if(r)Yn(s,!1);else{if(ne!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Fl(e),a!==null){for(t.flags|=128,Yn(s,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,a=s.alternate,a===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=a.childLanes,s.lanes=a.lanes,s.child=a.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=a.memoizedProps,s.memoizedState=a.memoizedState,s.updateQueue=a.updateQueue,s.type=a.type,e=a.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return $(Q,Q.current&1|2),t.child}e=e.sibling}s.tail!==null&&X()>An&&(t.flags|=128,r=!0,Yn(s,!1),t.lanes=4194304)}else{if(!r)if(e=Fl(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Yn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!V)return ce(t),null}else 2*X()-s.renderingStartTime>An&&n!==1073741824&&(t.flags|=128,r=!0,Yn(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=X(),t.sibling=null,n=Q.current,$(Q,r?n&1|2:n&1),t):(ce(t),null);case 22:case 23:return Ja(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Se&1073741824&&(ce(t),t.subtreeFlags&6&&(t.flags|=8192)):ce(t),null;case 24:return null;case 25:return null}throw Error(P(156,t.tag))}function Jm(e,t){switch(Aa(t),t.tag){case 1:return je(t.type)&&Tl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Tn(),b(xe),b(fe),$a(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ua(t),null;case 13:if(b(Q),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(P(340));Pn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return b(Q),null;case 4:return Tn(),null;case 10:return Ia(t.type._context),null;case 22:case 23:return Ja(),null;case 24:return null;default:return null}}var el=!1,de=!1,Xm=typeof WeakSet=="function"?WeakSet:Set,T=null;function vn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){J(e,t,r)}else n.current=null}function bi(e,t,n){try{n()}catch(r){J(e,t,r)}}var mu=!1;function Zm(e,t){if(Ei=El,e=bc(),Ta(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,u=-1,c=0,p=0,g=e,m=null;t:for(;;){for(var y;g!==n||l!==0&&g.nodeType!==3||(o=a+l),g!==s||r!==0&&g.nodeType!==3||(u=a+r),g.nodeType===3&&(a+=g.nodeValue.length),(y=g.firstChild)!==null;)m=g,g=y;for(;;){if(g===e)break t;if(m===n&&++c===l&&(o=a),m===s&&++p===r&&(u=a),(y=g.nextSibling)!==null)break;g=m,m=g.parentNode}g=y}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ki={focusedElem:e,selectionRange:n},El=!1,T=t;T!==null;)if(t=T,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,T=e;else for(;T!==null;){t=T;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var w=x.memoizedProps,S=x.memoizedState,f=t.stateNode,d=f.getSnapshotBeforeUpdate(t.elementType===t.type?w:Ue(t.type,w),S);f.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(v){J(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,T=e;break}T=t.return}return x=mu,mu=!1,x}function ir(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var s=l.destroy;l.destroy=void 0,s!==void 0&&bi(t,n,s)}l=l.next}while(l!==r)}}function ss(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Wi(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Od(e){var t=e.alternate;t!==null&&(e.alternate=null,Od(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ke],delete t[jr],delete t[Ti],delete t[Im],delete t[Fm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ud(e){return e.tag===5||e.tag===3||e.tag===4}function hu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ud(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Vi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Rl));else if(r!==4&&(e=e.child,e!==null))for(Vi(e,t,n),e=e.sibling;e!==null;)Vi(e,t,n),e=e.sibling}function Hi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Hi(e,t,n),e=e.sibling;e!==null;)Hi(e,t,n),e=e.sibling}var ie=null,$e=!1;function ft(e,t,n){for(n=n.child;n!==null;)$d(e,t,n),n=n.sibling}function $d(e,t,n){if(Ye&&typeof Ye.onCommitFiberUnmount=="function")try{Ye.onCommitFiberUnmount(Jl,n)}catch{}switch(n.tag){case 5:de||vn(n,t);case 6:var r=ie,l=$e;ie=null,ft(e,t,n),ie=r,$e=l,ie!==null&&($e?(e=ie,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ie.removeChild(n.stateNode));break;case 18:ie!==null&&($e?(e=ie,n=n.stateNode,e.nodeType===8?Os(e.parentNode,n):e.nodeType===1&&Os(e,n),hr(e)):Os(ie,n.stateNode));break;case 4:r=ie,l=$e,ie=n.stateNode.containerInfo,$e=!0,ft(e,t,n),ie=r,$e=l;break;case 0:case 11:case 14:case 15:if(!de&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var s=l,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&bi(n,t,a),l=l.next}while(l!==r)}ft(e,t,n);break;case 1:if(!de&&(vn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){J(n,t,o)}ft(e,t,n);break;case 21:ft(e,t,n);break;case 22:n.mode&1?(de=(r=de)||n.memoizedState!==null,ft(e,t,n),de=r):ft(e,t,n);break;default:ft(e,t,n)}}function gu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Xm),t.forEach(function(r){var l=oh.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Oe(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var s=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 5:ie=o.stateNode,$e=!1;break e;case 3:ie=o.stateNode.containerInfo,$e=!0;break e;case 4:ie=o.stateNode.containerInfo,$e=!0;break e}o=o.return}if(ie===null)throw Error(P(160));$d(s,a,l),ie=null,$e=!1;var u=l.alternate;u!==null&&(u.return=null),l.return=null}catch(c){J(l,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Bd(t,e),t=t.sibling}function Bd(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Oe(t,e),He(e),r&4){try{ir(3,e,e.return),ss(3,e)}catch(w){J(e,e.return,w)}try{ir(5,e,e.return)}catch(w){J(e,e.return,w)}}break;case 1:Oe(t,e),He(e),r&512&&n!==null&&vn(n,n.return);break;case 5:if(Oe(t,e),He(e),r&512&&n!==null&&vn(n,n.return),e.flags&32){var l=e.stateNode;try{dr(l,"")}catch(w){J(e,e.return,w)}}if(r&4&&(l=e.stateNode,l!=null)){var s=e.memoizedProps,a=n!==null?n.memoizedProps:s,o=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&uc(l,s),hi(o,a);var c=hi(o,s);for(a=0;a<u.length;a+=2){var p=u[a],g=u[a+1];p==="style"?mc(l,g):p==="dangerouslySetInnerHTML"?fc(l,g):p==="children"?dr(l,g):ga(l,p,g,c)}switch(o){case"input":ci(l,s);break;case"textarea":cc(l,s);break;case"select":var m=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!s.multiple;var y=s.value;y!=null?xn(l,!!s.multiple,y,!1):m!==!!s.multiple&&(s.defaultValue!=null?xn(l,!!s.multiple,s.defaultValue,!0):xn(l,!!s.multiple,s.multiple?[]:"",!1))}l[jr]=s}catch(w){J(e,e.return,w)}}break;case 6:if(Oe(t,e),He(e),r&4){if(e.stateNode===null)throw Error(P(162));l=e.stateNode,s=e.memoizedProps;try{l.nodeValue=s}catch(w){J(e,e.return,w)}}break;case 3:if(Oe(t,e),He(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{hr(t.containerInfo)}catch(w){J(e,e.return,w)}break;case 4:Oe(t,e),He(e);break;case 13:Oe(t,e),He(e),l=e.child,l.flags&8192&&(s=l.memoizedState!==null,l.stateNode.isHidden=s,!s||l.alternate!==null&&l.alternate.memoizedState!==null||(Ga=X())),r&4&&gu(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(de=(c=de)||p,Oe(t,e),de=c):Oe(t,e),He(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!p&&e.mode&1)for(T=e,p=e.child;p!==null;){for(g=T=p;T!==null;){switch(m=T,y=m.child,m.tag){case 0:case 11:case 14:case 15:ir(4,m,m.return);break;case 1:vn(m,m.return);var x=m.stateNode;if(typeof x.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(w){J(r,n,w)}}break;case 5:vn(m,m.return);break;case 22:if(m.memoizedState!==null){yu(g);continue}}y!==null?(y.return=m,T=y):yu(g)}p=p.sibling}e:for(p=null,g=e;;){if(g.tag===5){if(p===null){p=g;try{l=g.stateNode,c?(s=l.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=g.stateNode,u=g.memoizedProps.style,a=u!=null&&u.hasOwnProperty("display")?u.display:null,o.style.display=pc("display",a))}catch(w){J(e,e.return,w)}}}else if(g.tag===6){if(p===null)try{g.stateNode.nodeValue=c?"":g.memoizedProps}catch(w){J(e,e.return,w)}}else if((g.tag!==22&&g.tag!==23||g.memoizedState===null||g===e)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===e)break e;for(;g.sibling===null;){if(g.return===null||g.return===e)break e;p===g&&(p=null),g=g.return}p===g&&(p=null),g.sibling.return=g.return,g=g.sibling}}break;case 19:Oe(t,e),He(e),r&4&&gu(e);break;case 21:break;default:Oe(t,e),He(e)}}function He(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Ud(n)){var r=n;break e}n=n.return}throw Error(P(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(dr(l,""),r.flags&=-33);var s=hu(e);Hi(e,s,l);break;case 3:case 4:var a=r.stateNode.containerInfo,o=hu(e);Vi(e,o,a);break;default:throw Error(P(161))}}catch(u){J(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function eh(e,t,n){T=e,bd(e)}function bd(e,t,n){for(var r=(e.mode&1)!==0;T!==null;){var l=T,s=l.child;if(l.tag===22&&r){var a=l.memoizedState!==null||el;if(!a){var o=l.alternate,u=o!==null&&o.memoizedState!==null||de;o=el;var c=de;if(el=a,(de=u)&&!c)for(T=l;T!==null;)a=T,u=a.child,a.tag===22&&a.memoizedState!==null?xu(l):u!==null?(u.return=a,T=u):xu(l);for(;s!==null;)T=s,bd(s),s=s.sibling;T=l,el=o,de=c}vu(e)}else l.subtreeFlags&8772&&s!==null?(s.return=l,T=s):vu(e)}}function vu(e){for(;T!==null;){var t=T;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:de||ss(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!de)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:Ue(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&tu(t,s,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}tu(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var p=c.memoizedState;if(p!==null){var g=p.dehydrated;g!==null&&hr(g)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(P(163))}de||t.flags&512&&Wi(t)}catch(m){J(t,t.return,m)}}if(t===e){T=null;break}if(n=t.sibling,n!==null){n.return=t.return,T=n;break}T=t.return}}function yu(e){for(;T!==null;){var t=T;if(t===e){T=null;break}var n=t.sibling;if(n!==null){n.return=t.return,T=n;break}T=t.return}}function xu(e){for(;T!==null;){var t=T;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ss(4,t)}catch(u){J(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(u){J(t,l,u)}}var s=t.return;try{Wi(t)}catch(u){J(t,s,u)}break;case 5:var a=t.return;try{Wi(t)}catch(u){J(t,a,u)}}}catch(u){J(t,t.return,u)}if(t===e){T=null;break}var o=t.sibling;if(o!==null){o.return=t.return,T=o;break}T=t.return}}var th=Math.ceil,Ul=ct.ReactCurrentDispatcher,Ka=ct.ReactCurrentOwner,Ie=ct.ReactCurrentBatchConfig,F=0,le=null,ee=null,ae=0,Se=0,yn=zt(0),ne=0,kr=null,Xt=0,is=0,Ya=0,ar=null,ve=null,Ga=0,An=1/0,et=null,$l=!1,Qi=null,kt=null,tl=!1,yt=null,Bl=0,or=0,Ki=null,hl=-1,gl=0;function me(){return F&6?X():hl!==-1?hl:hl=X()}function Pt(e){return e.mode&1?F&2&&ae!==0?ae&-ae:Om.transition!==null?(gl===0&&(gl=kc()),gl):(e=D,e!==0||(e=window.event,e=e===void 0?16:_c(e.type)),e):1}function We(e,t,n,r){if(50<or)throw or=0,Ki=null,Error(P(185));Mr(e,n,r),(!(F&2)||e!==le)&&(e===le&&(!(F&2)&&(is|=n),ne===4&>(e,ae)),we(e,r),n===1&&F===0&&!(t.mode&1)&&(An=X()+500,ns&&It()))}function we(e,t){var n=e.callbackNode;Op(e,t);var r=Cl(e,e===le?ae:0);if(r===0)n!==null&&Ro(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ro(n),t===1)e.tag===0?Dm(ju.bind(null,e)):Xc(ju.bind(null,e)),_m(function(){!(F&6)&&It()}),n=null;else{switch(Pc(r)){case 1:n=wa;break;case 4:n=Cc;break;case 16:n=Nl;break;case 536870912:n=Ec;break;default:n=Nl}n=qd(n,Wd.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Wd(e,t){if(hl=-1,gl=0,F&6)throw Error(P(327));var n=e.callbackNode;if(Cn()&&e.callbackNode!==n)return null;var r=Cl(e,e===le?ae:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=bl(e,r);else{t=r;var l=F;F|=2;var s=Hd();(le!==e||ae!==t)&&(et=null,An=X()+500,Kt(e,t));do try{lh();break}catch(o){Vd(e,o)}while(!0);za(),Ul.current=s,F=l,ee!==null?t=0:(le=null,ae=0,t=ne)}if(t!==0){if(t===2&&(l=ji(e),l!==0&&(r=l,t=Yi(e,l))),t===1)throw n=kr,Kt(e,0),gt(e,r),we(e,X()),n;if(t===6)gt(e,r);else{if(l=e.current.alternate,!(r&30)&&!nh(l)&&(t=bl(e,r),t===2&&(s=ji(e),s!==0&&(r=s,t=Yi(e,s))),t===1))throw n=kr,Kt(e,0),gt(e,r),we(e,X()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(P(345));case 2:Wt(e,ve,et);break;case 3:if(gt(e,r),(r&130023424)===r&&(t=Ga+500-X(),10<t)){if(Cl(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){me(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=Ri(Wt.bind(null,e,ve,et),t);break}Wt(e,ve,et);break;case 4:if(gt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var a=31-be(r);s=1<<a,a=t[a],a>l&&(l=a),r&=~s}if(r=l,r=X()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*th(r/1960))-r,10<r){e.timeoutHandle=Ri(Wt.bind(null,e,ve,et),r);break}Wt(e,ve,et);break;case 5:Wt(e,ve,et);break;default:throw Error(P(329))}}}return we(e,X()),e.callbackNode===n?Wd.bind(null,e):null}function Yi(e,t){var n=ar;return e.current.memoizedState.isDehydrated&&(Kt(e,t).flags|=256),e=bl(e,t),e!==2&&(t=ve,ve=n,t!==null&&Gi(t)),e}function Gi(e){ve===null?ve=e:ve.push.apply(ve,e)}function nh(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var l=n[r],s=l.getSnapshot;l=l.value;try{if(!Ve(s(),l))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gt(e,t){for(t&=~Ya,t&=~is,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-be(t),r=1<<n;e[n]=-1,t&=~r}}function ju(e){if(F&6)throw Error(P(327));Cn();var t=Cl(e,0);if(!(t&1))return we(e,X()),null;var n=bl(e,t);if(e.tag!==0&&n===2){var r=ji(e);r!==0&&(t=r,n=Yi(e,r))}if(n===1)throw n=kr,Kt(e,0),gt(e,t),we(e,X()),n;if(n===6)throw Error(P(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wt(e,ve,et),we(e,X()),null}function qa(e,t){var n=F;F|=1;try{return e(t)}finally{F=n,F===0&&(An=X()+500,ns&&It())}}function Zt(e){yt!==null&&yt.tag===0&&!(F&6)&&Cn();var t=F;F|=1;var n=Ie.transition,r=D;try{if(Ie.transition=null,D=1,e)return e()}finally{D=r,Ie.transition=n,F=t,!(F&6)&&It()}}function Ja(){Se=yn.current,b(yn)}function Kt(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Mm(n)),ee!==null)for(n=ee.return;n!==null;){var r=n;switch(Aa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Tl();break;case 3:Tn(),b(xe),b(fe),$a();break;case 5:Ua(r);break;case 4:Tn();break;case 13:b(Q);break;case 19:b(Q);break;case 10:Ia(r.type._context);break;case 22:case 23:Ja()}n=n.return}if(le=e,ee=e=Rt(e.current,null),ae=Se=t,ne=0,kr=null,Ya=is=Xt=0,ve=ar=null,Ht!==null){for(t=0;t<Ht.length;t++)if(n=Ht[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,s=n.pending;if(s!==null){var a=s.next;s.next=l,r.next=a}n.pending=r}Ht=null}return e}function Vd(e,t){do{var n=ee;try{if(za(),fl.current=Ol,Dl){for(var r=K.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}Dl=!1}if(Jt=0,re=te=K=null,sr=!1,Nr=0,Ka.current=null,n===null||n.return===null){ne=1,kr=t,ee=null;break}e:{var s=e,a=n.return,o=n,u=t;if(t=ae,o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,p=o,g=p.tag;if(!(p.mode&1)&&(g===0||g===11||g===15)){var m=p.alternate;m?(p.updateQueue=m.updateQueue,p.memoizedState=m.memoizedState,p.lanes=m.lanes):(p.updateQueue=null,p.memoizedState=null)}var y=au(a);if(y!==null){y.flags&=-257,ou(y,a,o,s,t),y.mode&1&&iu(s,c,t),t=y,u=c;var x=t.updateQueue;if(x===null){var w=new Set;w.add(u),t.updateQueue=w}else x.add(u);break e}else{if(!(t&1)){iu(s,c,t),Xa();break e}u=Error(P(426))}}else if(V&&o.mode&1){var S=au(a);if(S!==null){!(S.flags&65536)&&(S.flags|=256),ou(S,a,o,s,t),Ma(Ln(u,o));break e}}s=u=Ln(u,o),ne!==4&&(ne=2),ar===null?ar=[s]:ar.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var f=Pd(s,u,t);eu(s,f);break e;case 1:o=u;var d=s.type,h=s.stateNode;if(!(s.flags&128)&&(typeof d.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(kt===null||!kt.has(h)))){s.flags|=65536,t&=-t,s.lanes|=t;var v=Rd(s,o,t);eu(s,v);break e}}s=s.return}while(s!==null)}Kd(n)}catch(N){t=N,ee===n&&n!==null&&(ee=n=n.return);continue}break}while(!0)}function Hd(){var e=Ul.current;return Ul.current=Ol,e===null?Ol:e}function Xa(){(ne===0||ne===3||ne===2)&&(ne=4),le===null||!(Xt&268435455)&&!(is&268435455)||gt(le,ae)}function bl(e,t){var n=F;F|=2;var r=Hd();(le!==e||ae!==t)&&(et=null,Kt(e,t));do try{rh();break}catch(l){Vd(e,l)}while(!0);if(za(),F=n,Ul.current=r,ee!==null)throw Error(P(261));return le=null,ae=0,ne}function rh(){for(;ee!==null;)Qd(ee)}function lh(){for(;ee!==null&&!Tp();)Qd(ee)}function Qd(e){var t=Gd(e.alternate,e,Se);e.memoizedProps=e.pendingProps,t===null?Kd(e):ee=t,Ka.current=null}function Kd(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Jm(n,t),n!==null){n.flags&=32767,ee=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ne=6,ee=null;return}}else if(n=qm(n,t,Se),n!==null){ee=n;return}if(t=t.sibling,t!==null){ee=t;return}ee=t=e}while(t!==null);ne===0&&(ne=5)}function Wt(e,t,n){var r=D,l=Ie.transition;try{Ie.transition=null,D=1,sh(e,t,n,r)}finally{Ie.transition=l,D=r}return null}function sh(e,t,n,r){do Cn();while(yt!==null);if(F&6)throw Error(P(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(P(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(Up(e,s),e===le&&(ee=le=null,ae=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||tl||(tl=!0,qd(Nl,function(){return Cn(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Ie.transition,Ie.transition=null;var a=D;D=1;var o=F;F|=4,Ka.current=null,Zm(e,n),Bd(n,e),Em(ki),El=!!Ei,ki=Ei=null,e.current=n,eh(n),Lp(),F=o,D=a,Ie.transition=s}else e.current=n;if(tl&&(tl=!1,yt=e,Bl=l),s=e.pendingLanes,s===0&&(kt=null),_p(n.stateNode),we(e,X()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if($l)throw $l=!1,e=Qi,Qi=null,e;return Bl&1&&e.tag!==0&&Cn(),s=e.pendingLanes,s&1?e===Ki?or++:(or=0,Ki=e):or=0,It(),null}function Cn(){if(yt!==null){var e=Pc(Bl),t=Ie.transition,n=D;try{if(Ie.transition=null,D=16>e?16:e,yt===null)var r=!1;else{if(e=yt,yt=null,Bl=0,F&6)throw Error(P(331));var l=F;for(F|=4,T=e.current;T!==null;){var s=T,a=s.child;if(T.flags&16){var o=s.deletions;if(o!==null){for(var u=0;u<o.length;u++){var c=o[u];for(T=c;T!==null;){var p=T;switch(p.tag){case 0:case 11:case 15:ir(8,p,s)}var g=p.child;if(g!==null)g.return=p,T=g;else for(;T!==null;){p=T;var m=p.sibling,y=p.return;if(Od(p),p===c){T=null;break}if(m!==null){m.return=y,T=m;break}T=y}}}var x=s.alternate;if(x!==null){var w=x.child;if(w!==null){x.child=null;do{var S=w.sibling;w.sibling=null,w=S}while(w!==null)}}T=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,T=a;else e:for(;T!==null;){if(s=T,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ir(9,s,s.return)}var f=s.sibling;if(f!==null){f.return=s.return,T=f;break e}T=s.return}}var d=e.current;for(T=d;T!==null;){a=T;var h=a.child;if(a.subtreeFlags&2064&&h!==null)h.return=a,T=h;else e:for(a=d;T!==null;){if(o=T,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:ss(9,o)}}catch(N){J(o,o.return,N)}if(o===a){T=null;break e}var v=o.sibling;if(v!==null){v.return=o.return,T=v;break e}T=o.return}}if(F=l,It(),Ye&&typeof Ye.onPostCommitFiberRoot=="function")try{Ye.onPostCommitFiberRoot(Jl,e)}catch{}r=!0}return r}finally{D=n,Ie.transition=t}}return!1}function wu(e,t,n){t=Ln(n,t),t=Pd(e,t,1),e=Et(e,t,1),t=me(),e!==null&&(Mr(e,1,t),we(e,t))}function J(e,t,n){if(e.tag===3)wu(e,e,n);else for(;t!==null;){if(t.tag===3){wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(kt===null||!kt.has(r))){e=Ln(n,e),e=Rd(t,e,1),t=Et(t,e,1),e=me(),t!==null&&(Mr(t,1,e),we(t,e));break}}t=t.return}}function ih(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=me(),e.pingedLanes|=e.suspendedLanes&n,le===e&&(ae&n)===n&&(ne===4||ne===3&&(ae&130023424)===ae&&500>X()-Ga?Kt(e,0):Ya|=n),we(e,t)}function Yd(e,t){t===0&&(e.mode&1?(t=Hr,Hr<<=1,!(Hr&130023424)&&(Hr=4194304)):t=1);var n=me();e=ot(e,t),e!==null&&(Mr(e,t,n),we(e,n))}function ah(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yd(e,n)}function oh(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(P(314))}r!==null&&r.delete(t),Yd(e,n)}var Gd;Gd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||xe.current)ye=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ye=!1,Gm(e,t,n);ye=!!(e.flags&131072)}else ye=!1,V&&t.flags&1048576&&Zc(t,Ml,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ml(e,t),e=t.pendingProps;var l=kn(t,fe.current);Nn(t,n),l=ba(null,t,r,e,l,n);var s=Wa();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,je(r)?(s=!0,Ll(t)):s=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Da(t),l.updater=ls,t.stateNode=l,l._reactInternals=t,Ii(t,r,e,n),t=Oi(null,t,r,!0,s,n)):(t.tag=0,V&&s&&La(t),pe(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ml(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=ch(r),e=Ue(r,e),l){case 0:t=Di(null,t,r,e,n);break e;case 1:t=du(null,t,r,e,n);break e;case 11:t=uu(null,t,r,e,n);break e;case 14:t=cu(null,t,r,Ue(r.type,e),n);break e}throw Error(P(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),Di(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),du(e,t,r,l,n);case 3:e:{if(Md(t),e===null)throw Error(P(387));r=t.pendingProps,s=t.memoizedState,l=s.element,sd(e,t),Il(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){l=Ln(Error(P(423)),t),t=fu(e,t,r,n,l);break e}else if(r!==l){l=Ln(Error(P(424)),t),t=fu(e,t,r,n,l);break e}else for(Ne=Ct(t.stateNode.containerInfo.firstChild),Ce=t,V=!0,Be=null,n=rd(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Pn(),r===l){t=ut(e,t,n);break e}pe(e,t,r,n)}t=t.child}return t;case 5:return id(t),e===null&&Mi(t),r=t.type,l=t.pendingProps,s=e!==null?e.memoizedProps:null,a=l.children,Pi(r,l)?a=null:s!==null&&Pi(r,s)&&(t.flags|=32),Ad(e,t),pe(e,t,a,n),t.child;case 6:return e===null&&Mi(t),null;case 13:return _d(e,t,n);case 4:return Oa(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Rn(t,null,r,n):pe(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),uu(e,t,r,l,n);case 7:return pe(e,t,t.pendingProps,n),t.child;case 8:return pe(e,t,t.pendingProps.children,n),t.child;case 12:return pe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,s=t.memoizedProps,a=l.value,$(_l,r._currentValue),r._currentValue=a,s!==null)if(Ve(s.value,a)){if(s.children===l.children&&!xe.current){t=ut(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=st(-1,n&-n),u.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?u.next=u:(u.next=p.next,p.next=u),c.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),_i(s.return,n,t),o.lanes|=n;break}u=u.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(P(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),_i(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}pe(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Nn(t,n),l=Fe(l),r=r(l),t.flags|=1,pe(e,t,r,n),t.child;case 14:return r=t.type,l=Ue(r,t.pendingProps),l=Ue(r.type,l),cu(e,t,r,l,n);case 15:return Td(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),ml(e,t),t.tag=1,je(r)?(e=!0,Ll(t)):e=!1,Nn(t,n),kd(t,r,l),Ii(t,r,l,n),Oi(null,t,r,!0,e,n);case 19:return zd(e,t,n);case 22:return Ld(e,t,n)}throw Error(P(156,t.tag))};function qd(e,t){return Nc(e,t)}function uh(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ze(e,t,n,r){return new uh(e,t,n,r)}function Za(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ch(e){if(typeof e=="function")return Za(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ya)return 11;if(e===xa)return 14}return 2}function Rt(e,t){var n=e.alternate;return n===null?(n=ze(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function vl(e,t,n,r,l,s){var a=2;if(r=e,typeof e=="function")Za(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case on:return Yt(n.children,l,s,t);case va:a=8,l|=8;break;case si:return e=ze(12,n,t,l|2),e.elementType=si,e.lanes=s,e;case ii:return e=ze(13,n,t,l),e.elementType=ii,e.lanes=s,e;case ai:return e=ze(19,n,t,l),e.elementType=ai,e.lanes=s,e;case ic:return as(n,l,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case lc:a=10;break e;case sc:a=9;break e;case ya:a=11;break e;case xa:a=14;break e;case pt:a=16,r=null;break e}throw Error(P(130,e==null?e:typeof e,""))}return t=ze(a,n,t,l),t.elementType=e,t.type=r,t.lanes=s,t}function Yt(e,t,n,r){return e=ze(7,e,r,t),e.lanes=n,e}function as(e,t,n,r){return e=ze(22,e,r,t),e.elementType=ic,e.lanes=n,e.stateNode={isHidden:!1},e}function Qs(e,t,n){return e=ze(6,e,null,t),e.lanes=n,e}function Ks(e,t,n){return t=ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function dh(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ps(0),this.expirationTimes=Ps(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ps(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function eo(e,t,n,r,l,s,a,o,u){return e=new dh(e,t,n,o,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=ze(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Da(s),e}function fh(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:an,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Jd(e){if(!e)return Mt;e=e._reactInternals;e:{if(tn(e)!==e||e.tag!==1)throw Error(P(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(je(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(P(171))}if(e.tag===1){var n=e.type;if(je(n))return Jc(e,n,t)}return t}function Xd(e,t,n,r,l,s,a,o,u){return e=eo(n,r,!0,e,l,s,a,o,u),e.context=Jd(null),n=e.current,r=me(),l=Pt(n),s=st(r,l),s.callback=t??null,Et(n,s,l),e.current.lanes=l,Mr(e,l,r),we(e,r),e}function os(e,t,n,r){var l=t.current,s=me(),a=Pt(l);return n=Jd(n),t.context===null?t.context=n:t.pendingContext=n,t=st(s,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Et(l,t,a),e!==null&&(We(e,l,a,s),dl(e,l,a)),a}function Wl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Su(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function to(e,t){Su(e,t),(e=e.alternate)&&Su(e,t)}function ph(){return null}var Zd=typeof reportError=="function"?reportError:function(e){console.error(e)};function no(e){this._internalRoot=e}us.prototype.render=no.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(P(409));os(e,t,null,null)};us.prototype.unmount=no.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Zt(function(){os(null,e,null,null)}),t[at]=null}};function us(e){this._internalRoot=e}us.prototype.unstable_scheduleHydration=function(e){if(e){var t=Lc();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ht.length&&t!==0&&t<ht[n].priority;n++);ht.splice(n,0,e),n===0&&Mc(e)}};function ro(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function cs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Nu(){}function mh(e,t,n,r,l){if(l){if(typeof r=="function"){var s=r;r=function(){var c=Wl(a);s.call(c)}}var a=Xd(t,r,e,0,null,!1,!1,"",Nu);return e._reactRootContainer=a,e[at]=a.current,yr(e.nodeType===8?e.parentNode:e),Zt(),a}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var o=r;r=function(){var c=Wl(u);o.call(c)}}var u=eo(e,0,!1,null,null,!1,!1,"",Nu);return e._reactRootContainer=u,e[at]=u.current,yr(e.nodeType===8?e.parentNode:e),Zt(function(){os(t,u,n,r)}),u}function ds(e,t,n,r,l){var s=n._reactRootContainer;if(s){var a=s;if(typeof l=="function"){var o=l;l=function(){var u=Wl(a);o.call(u)}}os(t,a,e,l)}else a=mh(n,t,e,l,r);return Wl(a)}Rc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Xn(t.pendingLanes);n!==0&&(Sa(t,n|1),we(t,X()),!(F&6)&&(An=X()+500,It()))}break;case 13:Zt(function(){var r=ot(e,1);if(r!==null){var l=me();We(r,e,1,l)}}),to(e,1)}};Na=function(e){if(e.tag===13){var t=ot(e,134217728);if(t!==null){var n=me();We(t,e,134217728,n)}to(e,134217728)}};Tc=function(e){if(e.tag===13){var t=Pt(e),n=ot(e,t);if(n!==null){var r=me();We(n,e,t,r)}to(e,t)}};Lc=function(){return D};Ac=function(e,t){var n=D;try{return D=e,t()}finally{D=n}};vi=function(e,t,n){switch(t){case"input":if(ci(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=ts(r);if(!l)throw Error(P(90));oc(r),ci(r,l)}}}break;case"textarea":cc(e,n);break;case"select":t=n.value,t!=null&&xn(e,!!n.multiple,t,!1)}};vc=qa;yc=Zt;var hh={usingClientEntryPoint:!1,Events:[zr,fn,ts,hc,gc,qa]},Gn={findFiberByHostInstance:Vt,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},gh={bundleType:Gn.bundleType,version:Gn.version,rendererPackageName:Gn.rendererPackageName,rendererConfig:Gn.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ct.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=wc(e),e===null?null:e.stateNode},findFiberByHostInstance:Gn.findFiberByHostInstance||ph,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nl.isDisabled&&nl.supportsFiber)try{Jl=nl.inject(gh),Ye=nl}catch{}}Pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hh;Pe.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ro(t))throw Error(P(200));return fh(e,t,null,n)};Pe.createRoot=function(e,t){if(!ro(e))throw Error(P(299));var n=!1,r="",l=Zd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=eo(e,1,!1,null,null,n,!1,r,l),e[at]=t.current,yr(e.nodeType===8?e.parentNode:e),new no(t)};Pe.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(P(188)):(e=Object.keys(e).join(","),Error(P(268,e)));return e=wc(t),e=e===null?null:e.stateNode,e};Pe.flushSync=function(e){return Zt(e)};Pe.hydrate=function(e,t,n){if(!cs(t))throw Error(P(200));return ds(null,e,t,!0,n)};Pe.hydrateRoot=function(e,t,n){if(!ro(e))throw Error(P(405));var r=n!=null&&n.hydratedSources||null,l=!1,s="",a=Zd;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Xd(t,null,e,1,n??null,l,!1,s,a),e[at]=t.current,yr(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new us(t)};Pe.render=function(e,t,n){if(!cs(t))throw Error(P(200));return ds(null,e,t,!1,n)};Pe.unmountComponentAtNode=function(e){if(!cs(e))throw Error(P(40));return e._reactRootContainer?(Zt(function(){ds(null,null,e,!1,function(){e._reactRootContainer=null,e[at]=null})}),!0):!1};Pe.unstable_batchedUpdates=qa;Pe.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!cs(n))throw Error(P(200));if(e==null||e._reactInternals===void 0)throw Error(P(38));return ds(e,t,n,!1,r)};Pe.version="18.3.1-next-f1338f8080-20240426";function ef(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ef)}catch(e){console.error(e)}}ef(),ec.exports=Pe;var vh=ec.exports,tf,Cu=vh;tf=Cu.createRoot,Cu.hydrateRoot;/**
|
||
* @remix-run/router v1.23.4
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function Pr(){return Pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pr.apply(null,arguments)}var xt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(xt||(xt={}));const Eu="popstate";function yh(e){e===void 0&&(e={});function t(r,l){let{pathname:s,search:a,hash:o}=r.location;return qi("",{pathname:s,search:a,hash:o},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:Vl(l)}return jh(t,n,null,e)}function Y(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nf(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xh(){return Math.random().toString(36).substr(2,8)}function ku(e,t){return{usr:e.state,key:e.key,idx:t}}function qi(e,t,n,r){return n===void 0&&(n=null),Pr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?$n(t):t,{state:n,key:t&&t.key||r||xh()})}function Vl(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function $n(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function jh(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:s=!1}=r,a=l.history,o=xt.Pop,u=null,c=p();c==null&&(c=0,a.replaceState(Pr({},a.state,{idx:c}),""));function p(){return(a.state||{idx:null}).idx}function g(){o=xt.Pop;let S=p(),f=S==null?null:S-c;c=S,u&&u({action:o,location:w.location,delta:f})}function m(S,f){o=xt.Push;let d=qi(w.location,S,f);c=p()+1;let h=ku(d,c),v=w.createHref(d);try{a.pushState(h,"",v)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;l.location.assign(v)}s&&u&&u({action:o,location:w.location,delta:1})}function y(S,f){o=xt.Replace;let d=qi(w.location,S,f);c=p();let h=ku(d,c),v=w.createHref(d);a.replaceState(h,"",v),s&&u&&u({action:o,location:w.location,delta:0})}function x(S){let f=l.location.origin!=="null"?l.location.origin:l.location.href,d=typeof S=="string"?S:Vl(S);return d=d.replace(/ $/,"%20"),Y(f,"No window.location.(origin|href) available to create URL for href: "+d),new URL(d,f)}let w={get action(){return o},get location(){return e(l,a)},listen(S){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(Eu,g),u=S,()=>{l.removeEventListener(Eu,g),u=null}},createHref(S){return t(l,S)},createURL:x,encodeLocation(S){let f=x(S);return{pathname:f.pathname,search:f.search,hash:f.hash}},push:m,replace:y,go(S){return a.go(S)}};return w}var Pu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Pu||(Pu={}));function wh(e,t,n){return n===void 0&&(n="/"),Sh(e,t,n)}function Sh(e,t,n,r){let l=typeof t=="string"?$n(t):t,s=Mn(l.pathname||"/",n);if(s==null)return null;let a=rf(e);Nh(a);let o=null,u=zh(s);for(let c=0;o==null&&c<a.length;++c)o=Mh(a[c],u);return o}function rf(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let l=(s,a,o)=>{let u={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};u.relativePath.startsWith("/")&&(Y(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Tt([r,u.relativePath]),p=n.concat(u);s.children&&s.children.length>0&&(Y(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),rf(s.children,t,p,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:Lh(c,s.index),routesMeta:p})};return e.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))l(s,a);else for(let u of lf(s.path))l(s,a,u)}),t}function lf(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return l?[s,""]:[s];let a=lf(r.join("/")),o=[];return o.push(...a.map(u=>u===""?s:[s,u].join("/"))),l&&o.push(...a),o.map(u=>e.startsWith("/")&&u===""?"/":u)}function Nh(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Ah(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Ch=/^:[\w-]+$/,Eh=3,kh=2,Ph=1,Rh=10,Th=-2,Ru=e=>e==="*";function Lh(e,t){let n=e.split("/"),r=n.length;return n.some(Ru)&&(r+=Th),t&&(r+=kh),n.filter(l=>!Ru(l)).reduce((l,s)=>l+(Ch.test(s)?Eh:s===""?Ph:Rh),r)}function Ah(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Mh(e,t,n){let{routesMeta:r}=e,l={},s="/",a=[];for(let o=0;o<r.length;++o){let u=r[o],c=o===r.length-1,p=s==="/"?t:t.slice(s.length)||"/",g=Ji({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},p),m=u.route;if(!g)return null;Object.assign(l,g.params),a.push({params:l,pathname:Tt([s,g.pathname]),pathnameBase:Dh(Tt([s,g.pathnameBase])),route:m}),g.pathnameBase!=="/"&&(s=Tt([s,g.pathnameBase]))}return a}function Ji(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=_h(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let s=l[0],a=s.replace(/(.)\/+$/,"$1"),o=l.slice(1);return{params:r.reduce((c,p,g)=>{let{paramName:m,isOptional:y}=p;if(m==="*"){let w=o[g]||"";a=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const x=o[g];return y&&!x?c[m]=void 0:c[m]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:a,pattern:e}}function _h(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),nf(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,u)=>(r.push({paramName:o,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function zh(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return nf(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Mn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Ih(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?$n(e):e,s;return n?(n=sf(n),n.startsWith("/")?s=Tu(n.substring(1),"/"):s=Tu(n,t)):s=t,{pathname:s,search:Oh(r),hash:Uh(l)}}function Tu(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Ys(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Fh(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function lo(e,t){let n=Fh(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function so(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=$n(e):(l=Pr({},e),Y(!l.pathname||!l.pathname.includes("?"),Ys("?","pathname","search",l)),Y(!l.pathname||!l.pathname.includes("#"),Ys("#","pathname","hash",l)),Y(!l.search||!l.search.includes("#"),Ys("#","search","hash",l)));let s=e===""||l.pathname==="",a=s?"/":l.pathname,o;if(a==null)o=n;else{let g=t.length-1;if(!r&&a.startsWith("..")){let m=a.split("/");for(;m[0]==="..";)m.shift(),g-=1;l.pathname=m.join("/")}o=g>=0?t[g]:"/"}let u=Ih(l,o),c=a&&a!=="/"&&a.endsWith("/"),p=(s||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||p)&&(u.pathname+="/"),u}const sf=e=>e.replace(/\/\/+/g,"/"),Tt=e=>sf(e.join("/")),Dh=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Oh=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Uh=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function $h(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const af=["post","put","patch","delete"];new Set(af);const Bh=["get",...af];new Set(Bh);/**
|
||
* React Router v6.30.6
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function Rr(){return Rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rr.apply(null,arguments)}const fs=j.createContext(null),of=j.createContext(null),dt=j.createContext(null),ps=j.createContext(null),Je=j.createContext({outlet:null,matches:[],isDataRoute:!1}),uf=j.createContext(null);function bh(e,t){let{relative:n}=t===void 0?{}:t;Bn()||Y(!1);let{basename:r,navigator:l}=j.useContext(dt),{hash:s,pathname:a,search:o}=ms(e,{relative:n}),u=a;return r!=="/"&&(u=a==="/"?r:Tt([r,a])),l.createHref({pathname:u,search:o,hash:s})}function Bn(){return j.useContext(ps)!=null}function Ft(){return Bn()||Y(!1),j.useContext(ps).location}function cf(e){j.useContext(dt).static||j.useLayoutEffect(e)}function Dt(){let{isDataRoute:e}=j.useContext(Je);return e?rg():Wh()}function Wh(){Bn()||Y(!1);let e=j.useContext(fs),{basename:t,future:n,navigator:r}=j.useContext(dt),{matches:l}=j.useContext(Je),{pathname:s}=Ft(),a=JSON.stringify(lo(l,n.v7_relativeSplatPath)),o=j.useRef(!1);return cf(()=>{o.current=!0}),j.useCallback(function(c,p){if(p===void 0&&(p={}),!o.current)return;if(typeof c=="number"){r.go(c);return}let g=so(c,JSON.parse(a),s,p.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Tt([t,g.pathname])),(p.replace?r.replace:r.push)(g,p.state,p)},[t,r,a,s,e])}const Vh=j.createContext(null);function Hh(e){let t=j.useContext(Je).outlet;return t&&j.createElement(Vh.Provider,{value:e},t)}function df(){let{matches:e}=j.useContext(Je),t=e[e.length-1];return t?t.params:{}}function ms(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=j.useContext(dt),{matches:l}=j.useContext(Je),{pathname:s}=Ft(),a=JSON.stringify(lo(l,r.v7_relativeSplatPath));return j.useMemo(()=>so(e,JSON.parse(a),s,n==="path"),[e,a,s,n])}function Qh(e,t){return Kh(e,t)}function Kh(e,t,n,r){Bn()||Y(!1);let{navigator:l}=j.useContext(dt),{matches:s}=j.useContext(Je),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let c=Ft(),p;if(t){var g;let S=typeof t=="string"?$n(t):t;u==="/"||(g=S.pathname)!=null&&g.startsWith(u)||Y(!1),p=S}else p=c;let m=p.pathname||"/",y=m;if(u!=="/"){let S=u.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(S.length).join("/")}let x=wh(e,{pathname:y}),w=Xh(x&&x.map(S=>Object.assign({},S,{params:Object.assign({},o,S.params),pathname:Tt([u,l.encodeLocation?l.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?u:Tt([u,l.encodeLocation?l.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),s,n,r);return t&&w?j.createElement(ps.Provider,{value:{location:Rr({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:xt.Pop}},w):w}function Yh(){let e=ng(),t=$h(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:l},n):null,null)}const Gh=j.createElement(Yh,null);class qh extends j.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?j.createElement(Je.Provider,{value:this.props.routeContext},j.createElement(uf.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Jh(e){let{routeContext:t,match:n,children:r}=e,l=j.useContext(fs);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),j.createElement(Je.Provider,{value:t},r)}function Xh(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=(l=n)==null?void 0:l.errors;if(o!=null){let p=a.findIndex(g=>g.route.id&&(o==null?void 0:o[g.route.id])!==void 0);p>=0||Y(!1),a=a.slice(0,Math.min(a.length,p+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let p=0;p<a.length;p++){let g=a[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=p),g.route.id){let{loaderData:m,errors:y}=n,x=g.route.loader&&m[g.route.id]===void 0&&(!y||y[g.route.id]===void 0);if(g.route.lazy||x){u=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((p,g,m)=>{let y,x=!1,w=null,S=null;n&&(y=o&&g.route.id?o[g.route.id]:void 0,w=g.route.errorElement||Gh,u&&(c<0&&m===0?(lg("route-fallback"),x=!0,S=null):c===m&&(x=!0,S=g.route.hydrateFallbackElement||null)));let f=t.concat(a.slice(0,m+1)),d=()=>{let h;return y?h=w:x?h=S:g.route.Component?h=j.createElement(g.route.Component,null):g.route.element?h=g.route.element:h=p,j.createElement(Jh,{match:g,routeContext:{outlet:p,matches:f,isDataRoute:n!=null},children:h})};return n&&(g.route.ErrorBoundary||g.route.errorElement||m===0)?j.createElement(qh,{location:n.location,revalidation:n.revalidation,component:w,error:y,children:d(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):d()},null)}var ff=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ff||{}),pf=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(pf||{});function Zh(e){let t=j.useContext(fs);return t||Y(!1),t}function eg(e){let t=j.useContext(of);return t||Y(!1),t}function tg(e){let t=j.useContext(Je);return t||Y(!1),t}function mf(e){let t=tg(),n=t.matches[t.matches.length-1];return n.route.id||Y(!1),n.route.id}function ng(){var e;let t=j.useContext(uf),n=eg(),r=mf();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function rg(){let{router:e}=Zh(ff.UseNavigateStable),t=mf(pf.UseNavigateStable),n=j.useRef(!1);return cf(()=>{n.current=!0}),j.useCallback(function(l,s){s===void 0&&(s={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,Rr({fromRouteId:t},s)))},[e,t])}const Lu={};function lg(e,t,n){Lu[e]||(Lu[e]=!0)}function sg(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function yl(e){let{to:t,replace:n,state:r,relative:l}=e;Bn()||Y(!1);let{future:s,static:a}=j.useContext(dt),{matches:o}=j.useContext(Je),{pathname:u}=Ft(),c=Dt(),p=so(t,lo(o,s.v7_relativeSplatPath),u,l==="path"),g=JSON.stringify(p);return j.useEffect(()=>c(JSON.parse(g),{replace:n,state:r,relative:l}),[c,g,l,n,r]),null}function ig(e){return Hh(e.context)}function q(e){Y(!1)}function ag(e){let{basename:t="/",children:n=null,location:r,navigationType:l=xt.Pop,navigator:s,static:a=!1,future:o}=e;Bn()&&Y(!1);let u=t.replace(/^\/*/,"/"),c=j.useMemo(()=>({basename:u,navigator:s,static:a,future:Rr({v7_relativeSplatPath:!1},o)}),[u,o,s,a]);typeof r=="string"&&(r=$n(r));let{pathname:p="/",search:g="",hash:m="",state:y=null,key:x="default"}=r,w=j.useMemo(()=>{let S=Mn(p,u);return S==null?null:{location:{pathname:S,search:g,hash:m,state:y,key:x},navigationType:l}},[u,p,g,m,y,x,l]);return w==null?null:j.createElement(dt.Provider,{value:c},j.createElement(ps.Provider,{children:n,value:w}))}function Xi(e){let{children:t,location:n}=e;return Qh(Zi(t),n)}new Promise(()=>{});function Zi(e,t){t===void 0&&(t=[]);let n=[];return j.Children.forEach(e,(r,l)=>{if(!j.isValidElement(r))return;let s=[...t,l];if(r.type===j.Fragment){n.push.apply(n,Zi(r.props.children,s));return}r.type!==q&&Y(!1),!r.props.index||!r.props.children||Y(!1);let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=Zi(r.props.children,s)),n.push(a)}),n}/**
|
||
* React Router DOM v6.30.6
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function Hl(){return Hl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hl.apply(null,arguments)}function hf(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function og(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ug(e,t){return e.button===0&&(!t||t==="_self")&&!og(e)}function ea(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function cg(e,t){let n=ea(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(s=>{n.append(l,s)})}),n}const dg=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],fg=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],pg="6";try{window.__reactRouterVersion=pg}catch{}const mg=j.createContext({isTransitioning:!1}),hg="startTransition",Au=ip[hg];function gg(e){let{basename:t,children:n,future:r,window:l}=e,s=j.useRef();s.current==null&&(s.current=yh({window:l,v5Compat:!0}));let a=s.current,[o,u]=j.useState({action:a.action,location:a.location}),{v7_startTransition:c}=r||{},p=j.useCallback(g=>{c&&Au?Au(()=>u(g)):u(g)},[u,c]);return j.useLayoutEffect(()=>a.listen(p),[a,p]),j.useEffect(()=>sg(r),[r]),j.createElement(ag,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:a,future:r})}const vg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",yg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ee=j.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:s,replace:a,state:o,target:u,to:c,preventScrollReset:p,viewTransition:g}=t,m=hf(t,dg),{basename:y}=j.useContext(dt),x,w=!1;if(typeof c=="string"&&yg.test(c)&&(x=c,vg))try{let h=new URL(window.location.href),v=c.startsWith("//")?new URL(h.protocol+c):new URL(c),N=Mn(v.pathname,y);v.origin===h.origin&&N!=null?c=N+v.search+v.hash:w=!0}catch{}let S=bh(c,{relative:l}),f=jg(c,{replace:a,state:o,target:u,preventScrollReset:p,relative:l,viewTransition:g});function d(h){r&&r(h),h.defaultPrevented||f(h)}return j.createElement("a",Hl({},m,{href:x||S,onClick:w||s?r:d,ref:n,target:u}))}),xl=j.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:s="",end:a=!1,style:o,to:u,viewTransition:c,children:p}=t,g=hf(t,fg),m=ms(u,{relative:g.relative}),y=Ft(),x=j.useContext(of),{navigator:w,basename:S}=j.useContext(dt),f=x!=null&&wg(m)&&c===!0,d=w.encodeLocation?w.encodeLocation(m).pathname:m.pathname,h=y.pathname,v=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;l||(h=h.toLowerCase(),v=v?v.toLowerCase():null,d=d.toLowerCase()),v&&S&&(v=Mn(v,S)||v);const N=d!=="/"&&d.endsWith("/")?d.length-1:d.length;let E=h===d||!a&&h.startsWith(d)&&h.charAt(N)==="/",k=v!=null&&(v===d||!a&&v.startsWith(d)&&v.charAt(d.length)==="/"),C={isActive:E,isPending:k,isTransitioning:f},M=E?r:void 0,A;typeof s=="function"?A=s(C):A=[s,E?"active":null,k?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let U=typeof o=="function"?o(C):o;return j.createElement(Ee,Hl({},g,{"aria-current":M,className:A,ref:n,style:U,to:u,viewTransition:c}),typeof p=="function"?p(C):p)});var ta;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ta||(ta={}));var Mu;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Mu||(Mu={}));function xg(e){let t=j.useContext(fs);return t||Y(!1),t}function jg(e,t){let{target:n,replace:r,state:l,preventScrollReset:s,relative:a,viewTransition:o}=t===void 0?{}:t,u=Dt(),c=Ft(),p=ms(e,{relative:a});return j.useCallback(g=>{if(ug(g,n)){g.preventDefault();let m=r!==void 0?r:Vl(c)===Vl(p);u(e,{replace:m,state:l,preventScrollReset:s,relative:a,viewTransition:o})}},[c,u,p,r,l,n,e,s,a,o])}function io(e){let t=j.useRef(ea(e)),n=j.useRef(!1),r=Ft(),l=j.useMemo(()=>cg(r.search,n.current?null:t.current),[r.search]),s=Dt(),a=j.useCallback((o,u)=>{const c=ea(typeof o=="function"?o(l):o);n.current=!0,s("?"+c,u)},[s,l]);return[l,a]}function wg(e,t){t===void 0&&(t={});let n=j.useContext(mg);n==null&&Y(!1);let{basename:r}=xg(ta.useViewTransitionState),l=ms(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Mn(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Mn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ji(l.pathname,a)!=null||Ji(l.pathname,s)!=null}const Tr="https://api.monespacepro.eu",hs="mep.admin.refresh",ao="mep.admin.kind";let Lt=null,gf=()=>{};class gs extends Error{constructor(t,n){super(n),this.status=t}}function na(e){return e?`${Tr}${e}`:null}function Sg(e){gf=e}function Ng(){try{return localStorage.getItem(hs)?localStorage.getItem(ao)==="staff"?"staff":"admin":null}catch{return null}}function oo(e,t){Lt=e.accessToken;try{localStorage.setItem(hs,e.refreshToken),t&&localStorage.setItem(ao,t)}catch{}}function uo(){Lt=null;try{localStorage.removeItem(hs),localStorage.removeItem(ao)}catch{}gf()}async function Cg(e,t){const n=await lt("POST","/api/auth/admin/login",{email:e,password:t},!1);oo(n,"admin")}async function Eg(e,t){const n=await lt("POST","/api/auth/staff/login",{email:e,password:t},!1);oo(n,"staff")}const ra={get:e=>lt("GET",e,void 0,!1),post:(e,t)=>lt("POST",e,t,!1)};let Gs=null;async function Ql(){let e=null;try{e=localStorage.getItem(hs)}catch{}return e?(Gs??(Gs=fetch(`${Tr}/api/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})}).then(async t=>t.ok?(oo(await t.json()),!0):!1).catch(()=>!1).finally(()=>{Gs=null})),Gs):!1}async function lt(e,t,n,r=!0,l=!0){r&&!Lt&&await Ql();const s=n instanceof FormData,a=await fetch(`${Tr}${t}`,{method:e,headers:{...n!==void 0&&!s&&{"Content-Type":"application/json"},...r&&Lt&&{Authorization:`Bearer ${Lt}`}},body:n===void 0?void 0:s?n:JSON.stringify(n)});if(a.status===401&&r){if(l&&await Ql())return lt(e,t,n,r,!1);uo()}if(!a.ok){const u=await a.json().catch(()=>({})),c=Array.isArray(u.message)?u.message.join(" · "):u.message;throw new gs(a.status,c||"Une erreur est survenue")}const o=await a.text();return o?JSON.parse(o):null}async function la(e,t){Lt||await Ql();let n=await fetch(`${Tr}${e}`,{headers:{Authorization:`Bearer ${Lt}`}});if(n.status===401&&await Ql()&&(n=await fetch(`${Tr}${e}`,{headers:{Authorization:`Bearer ${Lt}`}})),!n.ok)throw new gs(n.status,"Téléchargement impossible");const r=URL.createObjectURL(await n.blob());Object.assign(document.createElement("a"),{href:r,download:t}).click(),setTimeout(()=>URL.revokeObjectURL(r),1e4)}const O={get:e=>lt("GET",e),post:(e,t)=>lt("POST",e,t??{}),put:(e,t)=>lt("PUT",e,t),patch:(e,t)=>lt("PATCH",e,t)},qe={ESSENTIEL:"Essentiel",PRO:"Pro",RESEAU:"Réseau"};function kg({size:e=32}){return i.jsxs("svg",{width:e,height:e,viewBox:"0.5 -2 64 64","aria-hidden":"true",children:[i.jsx("path",{d:"M12 54V32a9 9 0 0 1 18 0v22M30 32a9 9 0 0 1 18 0v22",fill:"none",stroke:"var(--brand-arch)",strokeWidth:"8"}),i.jsx("circle",{cx:"51",cy:"12",r:"6",fill:"#F2B544"})]})}function Fr({admin:e=!0}){return i.jsxs("div",{className:"brand",children:[i.jsx(kg,{}),i.jsxs("span",{className:"brand-name",children:["MonEspace",i.jsx("b",{children:"Pro"})]}),e&&i.jsx("span",{className:"badge DRAFT",style:{marginLeft:"auto",height:22},children:"Admin"})]})}function Pg(){return i.jsxs("div",{className:"shell",children:[i.jsxs("aside",{className:"sidebar",children:[i.jsx(Fr,{}),i.jsx("nav",{"aria-label":"Navigation principale",children:i.jsx(xl,{to:"/magasins",children:"Magasins"})}),i.jsx("div",{className:"bottom",children:i.jsx("button",{type:"button",className:"btn secondary small",onClick:uo,children:"Se déconnecter"})})]}),i.jsx("main",{className:"main",children:i.jsx("div",{className:"container",children:i.jsx(ig,{})})})]})}const vf={DRAFT:"Brouillon",ACTIVE:"Actif",SUSPENDED:"Suspendu",CLOSED:"Fermé"};function yf({status:e}){return i.jsx("span",{className:`badge ${e}`,children:vf[e]})}function Rg({onLogin:e}){const t=Dt(),[n,r]=j.useState(""),[l,s]=j.useState(""),[a,o]=j.useState(null),[u,c]=j.useState(!1);async function p(g){g.preventDefault(),c(!0),o(null);try{await Cg(n,l),e(),t("/magasins")}catch(m){o(m.message)}finally{c(!1)}}return i.jsx("main",{style:{minHeight:"100vh",display:"grid",placeItems:"center",padding:16},children:i.jsxs("form",{className:"card",onSubmit:p,style:{width:"100%",maxWidth:420,display:"flex",flexDirection:"column",gap:20},children:[i.jsx(Fr,{}),i.jsxs("div",{children:[i.jsx("h1",{style:{fontSize:26},children:"Connexion"}),i.jsx("p",{className:"muted",style:{margin:0},children:"Espace d'administration MonEspacePro"})]}),a&&i.jsx("div",{className:"alert error",role:"alert",children:a}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"email",children:"E-mail"}),i.jsx("input",{id:"email",className:"input",type:"email",autoComplete:"username",required:!0,value:n,onChange:g=>r(g.target.value)})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"password",children:"Mot de passe"}),i.jsx("input",{id:"password",className:"input",type:"password",autoComplete:"current-password",required:!0,minLength:8,value:l,onChange:g=>s(g.target.value)})]}),i.jsx("button",{className:"btn",disabled:u,children:u?"Connexion…":"Se connecter"})]})})}const Tg=["ALL","DRAFT","ACTIVE","SUSPENDED","CLOSED"];function Lg(e){return e.split(" ").filter(t=>t.length>2).slice(-2).map(t=>t[0]).join("").toUpperCase()}function Ag({s:e}){const[t,n]=e.subscriptionStatus==="ACTIVE"?["Payé","ACTIVE"]:e.subscriptionStatus==="PAST_DUE"?["Impayé","CLOSED"]:e.subscriptionStatus==="INCOMPLETE"?["En attente","SUSPENDED"]:e.subscriptionStatus==="CANCELED"?["Résilié","DRAFT"]:["Aucun","DRAFT"];return i.jsxs("span",{className:"row",style:{gap:8,flexWrap:"nowrap"},children:[i.jsx("span",{className:`badge ${n}`,children:t}),e.plan&&i.jsx("span",{className:"role-pill mgr",children:qe[e.plan]})]})}const Mg=[["recent","Plus récents"],["name","Nom"],["customers","Clients"]];function _g(){const e=Dt(),[t,n]=j.useState(""),[r,l]=j.useState("ALL"),[s,a]=j.useState("recent"),[o,u]=j.useState(null),[c,p]=j.useState(null);j.useEffect(()=>{const S=setTimeout(()=>{const f=new URLSearchParams;t.trim()&&f.set("q",t.trim()),r!=="ALL"&&f.set("status",r),O.get(`/api/admin/stores?${f}`).then(u).catch(d=>p(d.message))},250);return()=>clearTimeout(S)},[t,r]);const g=[...(o==null?void 0:o.items)??[]].sort((S,f)=>s==="name"?S.name.localeCompare(f.name):s==="customers"?f.customers-S.customers:f.createdAt.localeCompare(S.createdAt)),m=o?Object.values(o.counts).reduce((S,f)=>S+(f??0),0):0,y=(o==null?void 0:o.items.filter(S=>S.subscriptionStatus==="PAST_DUE").length)??0,x=(o==null?void 0:o.items.reduce((S,f)=>S+f.customers,0))??0,w=(o==null?void 0:o.counts.DRAFT)??0;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"row between",style:{alignItems:"flex-end"},children:[i.jsxs("div",{children:[i.jsx("h1",{children:"Magasins"}),i.jsxs("p",{className:"muted",style:{margin:0},children:[m," magasins inscrits"]})]}),i.jsx(Ee,{to:"/magasins/nouveau",className:"btn",children:"+ Nouveau magasin"})]}),i.jsxs("div",{className:"kpis",children:[i.jsxs("div",{className:"kpi ok",children:[i.jsx("b",{children:(o==null?void 0:o.counts.ACTIVE)??"—"}),i.jsx("span",{children:"magasins ouverts"})]}),i.jsxs("div",{className:`kpi${w?" warn":""}`,children:[i.jsx("b",{children:o?w:"—"}),i.jsx("span",{children:"en cours d’ouverture"})]}),i.jsxs("div",{className:`kpi${y?" err":""}`,children:[i.jsx("b",{children:o?y:"—"}),i.jsx("span",{children:"abonnements impayés"})]}),i.jsxs("div",{className:"kpi",children:[i.jsx("b",{children:o?x.toLocaleString("fr-FR"):"—"}),i.jsx("span",{children:"cartes clients"})]})]}),i.jsxs("div",{className:"row",children:[i.jsxs("div",{style:{flex:"1 1 320px",maxWidth:420},children:[i.jsx("label",{htmlFor:"search",className:"sr-only",children:"Rechercher un magasin"}),i.jsx("input",{id:"search",type:"search",className:"input",placeholder:"Rechercher par nom ou ville",value:t,onChange:S=>n(S.target.value)})]}),i.jsxs("label",{className:"row",style:{gap:8,marginLeft:"auto"},children:[i.jsx("span",{className:"muted",style:{fontSize:14},children:"Trier par"}),i.jsx("select",{className:"input",style:{width:"auto",height:40},value:s,onChange:S=>a(S.target.value),children:Mg.map(([S,f])=>i.jsx("option",{value:S,children:f},S))})]}),i.jsx("div",{role:"group","aria-label":"Filtrer par statut",className:"row",style:{gap:8,flexBasis:"100%"},children:Tg.map(S=>i.jsxs("button",{type:"button",className:"chip","aria-pressed":r===S,onClick:()=>l(S),children:[S==="ALL"?"Tous":vf[S],i.jsx("span",{style:{opacity:.8,fontWeight:500},children:S==="ALL"?m:(o==null?void 0:o.counts[S])??0})]},S))})]}),c&&i.jsx("div",{className:"alert error",children:c}),i.jsxs("div",{className:"table-wrap",children:[i.jsx("div",{className:"table-scroll",children:i.jsxs("table",{style:{minWidth:860},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",style:{paddingLeft:24,width:"36%"},children:"Magasin"}),i.jsx("th",{scope:"col",children:"Statut"}),i.jsx("th",{scope:"col",className:"num",children:"Clients"}),i.jsx("th",{scope:"col",children:"Abonnement"}),i.jsx("th",{scope:"col",children:"Créé le"})]})}),i.jsx("tbody",{children:g.map(S=>i.jsxs("tr",{className:"clickable",onClick:()=>e(`/magasins/${S.id}`),children:[i.jsx("td",{style:{paddingLeft:24},children:i.jsxs(Ee,{to:`/magasins/${S.id}`,style:{display:"inline-flex",alignItems:"center",gap:12,color:"var(--text)",fontWeight:600,textDecoration:"none"},children:[i.jsx("span",{style:{width:36,height:36,borderRadius:10,background:"var(--primary-soft)",color:"var(--primary)",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:800},children:Lg(S.name)}),i.jsxs("span",{children:[S.name,i.jsxs("span",{className:"muted",style:{display:"block",fontWeight:400,fontSize:14},children:[S.city," · ",S.contactName]})]})]})}),i.jsx("td",{children:i.jsx(yf,{status:S.status})}),i.jsx("td",{className:"num",style:{fontWeight:700},children:S.customers.toLocaleString("fr-FR")}),i.jsx("td",{children:i.jsx(Ag,{s:S})}),i.jsx("td",{className:"muted",children:new Date(S.createdAt).toLocaleDateString("fr-FR",{day:"numeric",month:"short",year:"numeric"})})]},S.id))})]})}),o&&o.items.length===0&&i.jsxs("div",{style:{padding:"48px 24px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[i.jsx("span",{style:{fontSize:36},"aria-hidden":"true",children:"🏪"}),m===0?i.jsxs(i.Fragment,{children:[i.jsx("strong",{children:"Aucun magasin pour l’instant"}),i.jsx("p",{className:"muted",style:{margin:0},children:"Les commerçants s’inscrivent seuls depuis la page Tarif ; vous pouvez aussi en créer un ici."}),i.jsx(Ee,{to:"/magasins/nouveau",className:"btn",style:{marginTop:8},children:"Créer un magasin"})]}):i.jsxs(i.Fragment,{children:[i.jsx("strong",{children:"Aucun magasin trouvé"}),i.jsx("p",{className:"muted",style:{margin:0},children:"Essayez un autre nom, une autre ville ou retirez le filtre de statut."})]})]})]})]})}const zg={name:"",siret:"",addressLine:"",postalCode:"",city:"",contactName:"",contactEmail:"",contactPhone:"",maxAmountEuros:500,minScanIntervalMin:5};function qs({icon:e,title:t,sub:n}){return i.jsxs("div",{style:{display:"flex",gap:14,alignItems:"flex-start"},children:[i.jsx("span",{className:"mod-ic on","aria-hidden":"true",style:{width:44,height:44,fontSize:22},children:e}),i.jsxs("div",{children:[i.jsx("h2",{style:{margin:0},children:t}),i.jsx("p",{className:"muted",style:{margin:"2px 0 0",fontSize:14},children:n})]})]})}function xf({initial:e,submitLabel:t,onSubmit:n}){const[r,l]=j.useState(e),[s,a]=j.useState(null),[o,u]=j.useState(!1),c=y=>x=>l(w=>({...w,[y]:typeof w[y]=="number"?Number(x.target.value):x.target.value})),p=Object.keys(e).some(y=>String(r[y])!==String(e[y]));async function g(y){y.preventDefault(),u(!0),a(null);try{await n(r)}catch(x){a(x.message)}finally{u(!1)}}const m=(y,x,w={})=>i.jsxs("div",{className:"field",children:[i.jsxs("label",{htmlFor:y,children:[x," *"]}),i.jsx("input",{id:y,className:"input",required:!0,value:r[y],onChange:c(y),...w})]});return i.jsxs("form",{onSubmit:g,style:{display:"flex",flexDirection:"column",gap:24},children:[i.jsx("p",{className:"muted",style:{margin:0},children:"Les champs marqués d'un astérisque (*) sont obligatoires."}),s&&i.jsx("div",{className:"alert error",role:"alert",children:s}),i.jsxs("section",{className:"card",style:{display:"flex",flexDirection:"column",gap:20},children:[i.jsx(qs,{icon:"🏪",title:"Commerce",sub:"Identité légale du magasin, reprise sur les factures."}),i.jsxs("div",{className:"grid-2",children:[m("name","Nom du magasin"),m("siret","SIRET",{placeholder:"14 chiffres",inputMode:"numeric",pattern:"[0-9 ]{14,17}"})]}),m("addressLine","Adresse",{placeholder:"Numéro et nom de rue"}),i.jsxs("div",{className:"grid-2",children:[m("postalCode","Code postal",{placeholder:"5 chiffres",inputMode:"numeric",pattern:"[0-9]{5}"}),m("city","Ville")]})]}),i.jsxs("section",{className:"card",style:{display:"flex",flexDirection:"column",gap:20},children:[i.jsx(qs,{icon:"👤",title:"Dirigeant",sub:"Destinataire des e-mails : lien de paiement, factures, exports CSV."}),m("contactName","Prénom et nom",{placeholder:"Prénom Nom"}),i.jsxs("div",{className:"grid-2",children:[m("contactEmail","E-mail",{type:"email",placeholder:"contact@exemple.fr"}),m("contactPhone","Téléphone",{type:"tel",placeholder:"06 12 34 56 78"})]})]}),i.jsxs("section",{className:"card",style:{display:"flex",flexDirection:"column",gap:20},children:[i.jsx(qs,{icon:"🛡️",title:"Anti-triche",sub:"Limitent les crédits abusifs. Une opération hors limites est refusée et reste visible dans l’historique de l’app."}),i.jsxs("div",{className:"grid-2",children:[i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"maxAmountEuros",children:"Plafond par opération (€) *"}),i.jsx("input",{id:"maxAmountEuros",className:"input",type:"number",min:1,max:1e4,required:!0,value:r.maxAmountEuros,onChange:c("maxAmountEuros")}),i.jsx("span",{className:"hint",children:"Montant maximum saisi en une fois (mode points). Ex. : 500 € pour une boulangerie."})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"minScanIntervalMin",children:"Délai minimum entre deux crédits (min) *"}),i.jsx("input",{id:"minScanIntervalMin",className:"input",type:"number",min:0,max:1440,required:!0,value:r.minScanIntervalMin,onChange:c("minScanIntervalMin")}),i.jsx("span",{className:"hint",children:"Évite de créditer deux fois la même carte. 0 = aucun délai."})]})]})]}),i.jsxs("div",{className:`form-save${p?" dirty":""}`,children:[p&&i.jsx("span",{className:"muted",style:{fontSize:14},children:"Modifications non enregistrées"}),p&&i.jsx("button",{type:"button",className:"btn secondary",disabled:o,onClick:()=>l(e),children:"Annuler"}),i.jsx("button",{className:"btn",disabled:o,children:o?"Enregistrement…":t})]})]})}const Ig=["ESSENTIEL","PRO","RESEAU"],Fg=e=>(e/100).toLocaleString("fr-FR",{style:"currency",currency:"EUR",minimumFractionDigits:e%100?2:0});function Dg(){const e=Dt(),[t,n]=j.useState("PRO"),[r,l]=j.useState("MONTH"),[s,a]=j.useState([]),[o,u]=j.useState(null),[c,p]=j.useState(!1);if(j.useEffect(()=>{ra.get("/api/public/signup/plans").then(a).catch(()=>{})},[]),o)return i.jsxs(i.Fragment,{children:[i.jsx(Ee,{to:"/magasins",children:"← Magasins"}),i.jsxs("section",{className:"card",style:{display:"flex",flexDirection:"column",gap:18,maxWidth:760},children:[i.jsxs("div",{className:"row",style:{gap:14,flexWrap:"nowrap"},children:[i.jsx("span",{className:"store-avatar","aria-hidden":"true",style:{background:"var(--ok-bg)",color:"var(--ok)"},children:"✓"}),i.jsxs("div",{children:[i.jsxs("h1",{style:{fontSize:28,lineHeight:"34px"},children:[o.name," est créé"]}),i.jsxs("p",{className:"muted",style:{margin:0},children:["Formule ",qe[t],", ",r==="YEAR"?"annuelle":"mensuelle"," · ",o.city]})]})]}),i.jsxs("ul",{className:"open-steps","aria-label":"Ce qui a été fait",children:[i.jsx("li",{className:"done",children:"✓ Magasin créé"}),i.jsxs("li",{className:o.manager?"done":"",children:[o.manager?"✓":"○"," Compte Dirigeant"]}),i.jsxs("li",{className:o.link.emailedTo?"done":"",children:[o.link.emailedTo?"✓":"○"," Lien de paiement envoyé"]})]}),o.link.emailedTo?i.jsxs("div",{className:"alert ok",children:["Lien de paiement envoyé à ",i.jsx("strong",{children:o.link.emailedTo}),o.manager&&", avec ses identifiants Dirigeant",". Le magasin s’ouvrira automatiquement dès le paiement validé et la carte conçue."]}):i.jsxs("div",{className:"alert warn",children:["Le lien de paiement n’a pas pu être envoyé : ",o.link.error,". Renvoyez-le depuis l’onglet Facturation."]}),o.manager?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[i.jsx("strong",{children:"Identifiants du Dirigeant"}),i.jsxs("div",{className:"copy-line",style:{flexWrap:"wrap"},children:[i.jsx("span",{className:"muted",children:"E-mail :"}),i.jsx("code",{children:o.manager.email})]}),i.jsxs("div",{className:"copy-line",style:{flexWrap:"wrap"},children:[i.jsx("span",{className:"muted",children:"Mot de passe provisoire :"}),i.jsx("code",{style:{fontSize:18,fontWeight:800,letterSpacing:1},children:o.manager.provisionalPassword}),i.jsx("button",{type:"button",className:"btn secondary small",onClick:()=>{var m;return(m=navigator.clipboard)==null?void 0:m.writeText(o.manager.provisionalPassword??"").then(()=>p(!0))},children:c?"Copié ✓":"Copier"})]}),i.jsx("span",{className:"muted",style:{fontSize:14},children:"Il ne sera plus affiché ensuite. Il a aussi été envoyé par e-mail avec le lien de paiement."})]}):i.jsx("div",{className:"alert warn",children:"Un compte existe déjà avec l’e-mail du contact : créez le Dirigeant à la main dans l’onglet Employés."}),i.jsxs("div",{className:"row",style:{gap:8,justifyContent:"flex-end"},children:[i.jsx("button",{className:"btn secondary",onClick:()=>e(`/magasins/${o.id}`),children:"Ouvrir la fiche"}),i.jsx("button",{className:"btn",onClick:()=>e(`/magasins/${o.id}/carte`),children:"Concevoir la carte"})]})]})]});const g=s.length?s:Ig.map(m=>({plan:m,name:qe[m],tagline:"",priceCents:{MONTH:0,YEAR:0}}));return i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx(Ee,{to:"/magasins",children:"← Magasins"}),i.jsx("h1",{children:"Nouveau magasin"}),i.jsx("p",{className:"muted",style:{margin:0,maxWidth:720},children:"À la création, le contact reçoit automatiquement par e-mail le lien de paiement de la formule choisie et ses identifiants Dirigeant. Les commerçants peuvent aussi s’inscrire seuls depuis la page Tarif du site."})]}),i.jsxs("section",{className:"card",style:{display:"flex",flexDirection:"column",gap:16},children:[i.jsxs("div",{className:"row between",children:[i.jsxs("div",{className:"s-title",children:[i.jsx("span",{className:"s-num",children:"1"}),i.jsx("h2",{style:{margin:0},children:"Formule"})]}),i.jsxs("div",{role:"group","aria-label":"Périodicité",className:"s-seg",children:[i.jsx("button",{type:"button","aria-pressed":r==="MONTH",onClick:()=>l("MONTH"),children:"Mensuel"}),i.jsx("button",{type:"button","aria-pressed":r==="YEAR",onClick:()=>l("YEAR"),children:"Annuel · 2 mois offerts"})]})]}),i.jsx("div",{className:"s-plans",role:"radiogroup","aria-label":"Formule",children:g.map(m=>i.jsxs("label",{className:`s-plan${t===m.plan?" on":""}`,children:[i.jsx("input",{type:"radio",name:"plan",className:"sr-only",checked:t===m.plan,onChange:()=>n(m.plan)}),m.plan==="PRO"&&i.jsx("span",{className:"s-tag",children:"Conseillée"}),i.jsx("strong",{children:m.name}),m.priceCents[r]>0&&i.jsxs("span",{className:"s-price",children:[Fg(m.priceCents[r]),i.jsxs("small",{children:[" / ",r==="YEAR"?"an":"mois"]})]}),m.tagline&&i.jsx("span",{className:"muted",style:{fontSize:14},children:m.tagline})]},m.plan))})]}),i.jsxs("div",{className:"s-title",children:[i.jsx("span",{className:"s-num",children:"2"}),i.jsx("h2",{style:{margin:0},children:"Le magasin"})]}),i.jsx(xf,{initial:zg,submitLabel:`Créer le magasin et envoyer le lien (${qe[t]})`,onSubmit:async m=>{u(await O.post("/api/admin/stores",{...m,plan:t,interval:r})),window.scrollTo({top:0})}})]})}function jf({size:e}){const n=e/21,r=(s,a)=>i.jsxs("g",{children:[i.jsx("rect",{x:s*n,y:a*n,width:7*n,height:7*n,fill:"#000"}),i.jsx("rect",{x:(s+1)*n,y:(a+1)*n,width:5*n,height:5*n,fill:"#fff"}),i.jsx("rect",{x:(s+2)*n,y:(a+2)*n,width:3*n,height:3*n,fill:"#000"})]},`${s}-${a}`),l=[];for(let s=0;s<21;s++)for(let a=0;a<21;a++)!(a<8&&s<8||a>12&&s<8||a<8&&s>12)&&(a*7+s*13+a*s)%3===0&&l.push(i.jsx("rect",{x:a*n,y:s*n,width:n,height:n,fill:"#000"},`${a}.${s}`));return i.jsxs("svg",{width:e,height:e,"aria-hidden":"true",children:[i.jsx("rect",{width:e,height:e,fill:"#fff"}),r(0,0),r(14,0),r(0,14),l]})}function wf(e){return e.pointsMode==="STAMP"?{label:"TAMPONS",value:"7"}:{label:"POINTS",value:"120"}}function Kl(e){const t=e.pointsMode==="STAMP"?7:120,n=(e.rewards??[]).filter(s=>s.active!==!1&&s.label.trim()).sort((s,a)=>s.cost-a.cost);if(!n.length)return null;const r=n.filter(s=>s.cost<=t);if(r.length)return`${r[r.length-1].label} : disponible !`;const l=n[0].cost-t;return`${n[0].label} : encore ${l} ${e.pointsMode==="STAMP"?"tampon":"point"}${l>1?"s":""}`}function Og({d:e}){const t=wf(e);return i.jsxs("div",{style:{width:320,borderRadius:14,overflow:"hidden",background:e.backgroundColor,color:e.foregroundColor,boxShadow:"0 12px 32px rgb(0 0 0 / 0.25)",fontFamily:"-apple-system, system-ui, sans-serif"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 14px",height:50},children:[e.logoUrl?i.jsx("img",{src:e.logoUrl,alt:"",style:{maxHeight:34,maxWidth:140,objectFit:"contain"}}):i.jsx("span",{style:{fontWeight:700},children:e.storeName}),i.jsxs("div",{style:{textAlign:"right"},children:[i.jsx("div",{style:{fontSize:10,fontWeight:600,color:e.labelColor},children:t.label}),i.jsx("div",{style:{fontSize:18},children:t.value})]})]}),i.jsx("div",{style:{position:"relative",height:123,background:e.stripUrl?`center/cover url(${e.stripUrl})`:"rgb(255 255 255 / 0.08)"},children:i.jsxs("div",{style:{position:"absolute",left:14,bottom:10},children:[i.jsx("div",{style:{fontSize:11,fontWeight:600,color:e.labelColor,textShadow:e.stripUrl?"0 1px 2px rgb(0 0 0 / 0.5)":void 0},children:"SOLDE"}),i.jsx("div",{style:{fontSize:36,lineHeight:1,textShadow:e.stripUrl?"0 1px 3px rgb(0 0 0 / 0.5)":void 0},children:t.value})]})}),i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"10px 14px"},children:[i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:10,fontWeight:600,color:e.labelColor},children:"PROGRAMME"}),i.jsx("div",{style:{fontSize:14},children:e.programName||"—"})]}),i.jsxs("div",{style:{textAlign:"right"},children:[i.jsx("div",{style:{fontSize:10,fontWeight:600,color:e.labelColor},children:"MEMBRE"}),i.jsx("div",{style:{fontSize:14},children:"Camille"})]})]}),Kl(e)&&i.jsxs("div",{style:{padding:"0 14px 6px"},children:[i.jsx("div",{style:{fontSize:10,fontWeight:600,color:e.labelColor},children:"PROCHAINE RÉCOMPENSE"}),i.jsx("div",{style:{fontSize:14},children:Kl(e)})]}),i.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"14px 0 20px"},children:i.jsx("div",{style:{background:"#fff",padding:8,borderRadius:6},children:i.jsx(jf,{size:120})})})]})}function Ug({d:e}){const t=wf(e);return i.jsxs("div",{style:{width:320,borderRadius:20,overflow:"hidden",background:e.backgroundColor,color:e.foregroundColor,boxShadow:"0 12px 32px rgb(0 0 0 / 0.25)",fontFamily:"Roboto, system-ui, sans-serif"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 16px"},children:[i.jsx("span",{style:{width:32,height:32,borderRadius:"50%",background:"#fff",overflow:"hidden",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.logoUrl&&i.jsx("img",{src:e.logoUrl,alt:"",style:{width:"100%",height:"100%",objectFit:"contain"}})}),i.jsx("span",{style:{fontSize:14},children:e.storeName})]}),i.jsx("div",{style:{padding:"0 16px 12px",fontSize:22},children:e.programName||"—"}),i.jsxs("div",{style:{display:"flex",gap:32,padding:"0 16px 16px"},children:[i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:11,opacity:.8},children:t.label==="POINTS"?"Points":"Tampons"}),i.jsx("div",{style:{fontSize:18},children:t.value})]}),i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:11,opacity:.8},children:"Membre"}),i.jsx("div",{style:{fontSize:18},children:"Camille"})]})]}),Kl(e)&&i.jsxs("div",{style:{padding:"0 16px 12px"},children:[i.jsx("div",{style:{fontSize:11,opacity:.8},children:"Prochaine récompense"}),i.jsx("div",{style:{fontSize:15},children:Kl(e)})]}),i.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0 16px"},children:i.jsx("div",{style:{background:"#fff",padding:10,borderRadius:12},children:i.jsx(jf,{size:120})})}),e.stripUrl&&i.jsx("img",{src:e.stripUrl,alt:"",style:{display:"block",width:"100%",aspectRatio:"1125 / 432",objectFit:"cover"}})]})}var Dr={},$g=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Sf={},Te={};let co;const Bg=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Te.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};Te.getSymbolTotalCodewords=function(t){return Bg[t]};Te.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};Te.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');co=t};Te.isKanjiModeEnabled=function(){return typeof co<"u"};Te.toSJIS=function(t){return co(t)};var vs={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,l){if(e.isValid(r))return r;try{return t(r)}catch{return l}}})(vs);function Nf(){this.buffer=[],this.length=0}Nf.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var bg=Nf;function Or(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Or.prototype.set=function(e,t,n,r){const l=e*this.size+t;this.data[l]=n,r&&(this.reservedBit[l]=!0)};Or.prototype.get=function(e,t){return this.data[e*this.size+t]};Or.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};Or.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Wg=Or,Cf={};(function(e){const t=Te.getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const l=Math.floor(r/7)+2,s=t(r),a=s===145?26:Math.ceil((s-13)/(2*l-2))*2,o=[s-7];for(let u=1;u<l-1;u++)o[u]=o[u-1]-a;return o.push(6),o.reverse()},e.getPositions=function(r){const l=[],s=e.getRowColCoords(r),a=s.length;for(let o=0;o<a;o++)for(let u=0;u<a;u++)o===0&&u===0||o===0&&u===a-1||o===a-1&&u===0||l.push([s[o],s[u]]);return l}})(Cf);var Ef={};const Vg=Te.getSymbolSize,_u=7;Ef.getPositions=function(t){const n=Vg(t);return[[0,0],[n-_u,0],[0,n-_u]]};var kf={};(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(l){return l!=null&&l!==""&&!isNaN(l)&&l>=0&&l<=7},e.from=function(l){return e.isValid(l)?parseInt(l,10):void 0},e.getPenaltyN1=function(l){const s=l.size;let a=0,o=0,u=0,c=null,p=null;for(let g=0;g<s;g++){o=u=0,c=p=null;for(let m=0;m<s;m++){let y=l.get(g,m);y===c?o++:(o>=5&&(a+=t.N1+(o-5)),c=y,o=1),y=l.get(m,g),y===p?u++:(u>=5&&(a+=t.N1+(u-5)),p=y,u=1)}o>=5&&(a+=t.N1+(o-5)),u>=5&&(a+=t.N1+(u-5))}return a},e.getPenaltyN2=function(l){const s=l.size;let a=0;for(let o=0;o<s-1;o++)for(let u=0;u<s-1;u++){const c=l.get(o,u)+l.get(o,u+1)+l.get(o+1,u)+l.get(o+1,u+1);(c===4||c===0)&&a++}return a*t.N2},e.getPenaltyN3=function(l){const s=l.size;let a=0,o=0,u=0;for(let c=0;c<s;c++){o=u=0;for(let p=0;p<s;p++)o=o<<1&2047|l.get(c,p),p>=10&&(o===1488||o===93)&&a++,u=u<<1&2047|l.get(p,c),p>=10&&(u===1488||u===93)&&a++}return a*t.N3},e.getPenaltyN4=function(l){let s=0;const a=l.data.length;for(let u=0;u<a;u++)s+=l.data[u];return Math.abs(Math.ceil(s*100/a/5)-10)*t.N4};function n(r,l,s){switch(r){case e.Patterns.PATTERN000:return(l+s)%2===0;case e.Patterns.PATTERN001:return l%2===0;case e.Patterns.PATTERN010:return s%3===0;case e.Patterns.PATTERN011:return(l+s)%3===0;case e.Patterns.PATTERN100:return(Math.floor(l/2)+Math.floor(s/3))%2===0;case e.Patterns.PATTERN101:return l*s%2+l*s%3===0;case e.Patterns.PATTERN110:return(l*s%2+l*s%3)%2===0;case e.Patterns.PATTERN111:return(l*s%3+(l+s)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}e.applyMask=function(l,s){const a=s.size;for(let o=0;o<a;o++)for(let u=0;u<a;u++)s.isReserved(u,o)||s.xor(u,o,n(l,u,o))},e.getBestMask=function(l,s){const a=Object.keys(e.Patterns).length;let o=0,u=1/0;for(let c=0;c<a;c++){s(c),e.applyMask(c,l);const p=e.getPenaltyN1(l)+e.getPenaltyN2(l)+e.getPenaltyN3(l)+e.getPenaltyN4(l);e.applyMask(c,l),p<u&&(u=p,o=c)}return o}})(kf);var ys={};const jt=vs,rl=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],ll=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];ys.getBlocksCount=function(t,n){switch(n){case jt.L:return rl[(t-1)*4+0];case jt.M:return rl[(t-1)*4+1];case jt.Q:return rl[(t-1)*4+2];case jt.H:return rl[(t-1)*4+3];default:return}};ys.getTotalCodewordsCount=function(t,n){switch(n){case jt.L:return ll[(t-1)*4+0];case jt.M:return ll[(t-1)*4+1];case jt.Q:return ll[(t-1)*4+2];case jt.H:return ll[(t-1)*4+3];default:return}};var Pf={},xs={};const ur=new Uint8Array(512),Yl=new Uint8Array(256);(function(){let t=1;for(let n=0;n<255;n++)ur[n]=t,Yl[t]=n,t<<=1,t&256&&(t^=285);for(let n=255;n<512;n++)ur[n]=ur[n-255]})();xs.log=function(t){if(t<1)throw new Error("log("+t+")");return Yl[t]};xs.exp=function(t){return ur[t]};xs.mul=function(t,n){return t===0||n===0?0:ur[Yl[t]+Yl[n]]};(function(e){const t=xs;e.mul=function(r,l){const s=new Uint8Array(r.length+l.length-1);for(let a=0;a<r.length;a++)for(let o=0;o<l.length;o++)s[a+o]^=t.mul(r[a],l[o]);return s},e.mod=function(r,l){let s=new Uint8Array(r);for(;s.length-l.length>=0;){const a=s[0];for(let u=0;u<l.length;u++)s[u]^=t.mul(l[u],a);let o=0;for(;o<s.length&&s[o]===0;)o++;s=s.slice(o)}return s},e.generateECPolynomial=function(r){let l=new Uint8Array([1]);for(let s=0;s<r;s++)l=e.mul(l,new Uint8Array([1,t.exp(s)]));return l}})(Pf);const Rf=Pf;function fo(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}fo.prototype.initialize=function(t){this.degree=t,this.genPoly=Rf.generateECPolynomial(this.degree)};fo.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(t.length+this.degree);n.set(t);const r=Rf.mod(n,this.genPoly),l=this.degree-r.length;if(l>0){const s=new Uint8Array(this.degree);return s.set(r,l),s}return r};var Hg=fo,Tf={},Ot={},po={};po.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var Xe={};const Lf="[0-9]+",Qg="[A-Z $%*+\\-./:]+";let Lr="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Lr=Lr.replace(/u/g,"\\u");const Kg="(?:(?![A-Z0-9 $%*+\\-./:]|"+Lr+`)(?:.|[\r
|
||
]))+`;Xe.KANJI=new RegExp(Lr,"g");Xe.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Xe.BYTE=new RegExp(Kg,"g");Xe.NUMERIC=new RegExp(Lf,"g");Xe.ALPHANUMERIC=new RegExp(Qg,"g");const Yg=new RegExp("^"+Lr+"$"),Gg=new RegExp("^"+Lf+"$"),qg=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Xe.testKanji=function(t){return Yg.test(t)};Xe.testNumeric=function(t){return Gg.test(t)};Xe.testAlphanumeric=function(t){return qg.test(t)};(function(e){const t=po,n=Xe;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(s,a){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!t.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?s.ccBits[0]:a<27?s.ccBits[1]:s.ccBits[2]},e.getBestModeForData=function(s){return n.testNumeric(s)?e.NUMERIC:n.testAlphanumeric(s)?e.ALPHANUMERIC:n.testKanji(s)?e.KANJI:e.BYTE},e.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},e.isValid=function(s){return s&&s.bit&&s.ccBits};function r(l){if(typeof l!="string")throw new Error("Param is not a string");switch(l.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+l)}}e.from=function(s,a){if(e.isValid(s))return s;try{return r(s)}catch{return a}}})(Ot);(function(e){const t=Te,n=ys,r=vs,l=Ot,s=po,a=7973,o=t.getBCHDigit(a);function u(m,y,x){for(let w=1;w<=40;w++)if(y<=e.getCapacity(w,x,m))return w}function c(m,y){return l.getCharCountIndicator(m,y)+4}function p(m,y){let x=0;return m.forEach(function(w){const S=c(w.mode,y);x+=S+w.getBitsLength()}),x}function g(m,y){for(let x=1;x<=40;x++)if(p(m,x)<=e.getCapacity(x,y,l.MIXED))return x}e.from=function(y,x){return s.isValid(y)?parseInt(y,10):x},e.getCapacity=function(y,x,w){if(!s.isValid(y))throw new Error("Invalid QR Code version");typeof w>"u"&&(w=l.BYTE);const S=t.getSymbolTotalCodewords(y),f=n.getTotalCodewordsCount(y,x),d=(S-f)*8;if(w===l.MIXED)return d;const h=d-c(w,y);switch(w){case l.NUMERIC:return Math.floor(h/10*3);case l.ALPHANUMERIC:return Math.floor(h/11*2);case l.KANJI:return Math.floor(h/13);case l.BYTE:default:return Math.floor(h/8)}},e.getBestVersionForData=function(y,x){let w;const S=r.from(x,r.M);if(Array.isArray(y)){if(y.length>1)return g(y,S);if(y.length===0)return 1;w=y[0]}else w=y;return u(w.mode,w.getLength(),S)},e.getEncodedBits=function(y){if(!s.isValid(y)||y<7)throw new Error("Invalid QR Code version");let x=y<<12;for(;t.getBCHDigit(x)-o>=0;)x^=a<<t.getBCHDigit(x)-o;return y<<12|x}})(Tf);var Af={};const sa=Te,Mf=1335,Jg=21522,zu=sa.getBCHDigit(Mf);Af.getEncodedBits=function(t,n){const r=t.bit<<3|n;let l=r<<10;for(;sa.getBCHDigit(l)-zu>=0;)l^=Mf<<sa.getBCHDigit(l)-zu;return(r<<10|l)^Jg};var _f={};const Xg=Ot;function _n(e){this.mode=Xg.NUMERIC,this.data=e.toString()}_n.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};_n.prototype.getLength=function(){return this.data.length};_n.prototype.getBitsLength=function(){return _n.getBitsLength(this.data.length)};_n.prototype.write=function(t){let n,r,l;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),l=parseInt(r,10),t.put(l,10);const s=this.data.length-n;s>0&&(r=this.data.substr(n),l=parseInt(r,10),t.put(l,s*3+1))};var Zg=_n;const ev=Ot,Js=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function zn(e){this.mode=ev.ALPHANUMERIC,this.data=e}zn.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};zn.prototype.getLength=function(){return this.data.length};zn.prototype.getBitsLength=function(){return zn.getBitsLength(this.data.length)};zn.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let r=Js.indexOf(this.data[n])*45;r+=Js.indexOf(this.data[n+1]),t.put(r,11)}this.data.length%2&&t.put(Js.indexOf(this.data[n]),6)};var tv=zn;const nv=Ot;function In(e){this.mode=nv.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}In.getBitsLength=function(t){return t*8};In.prototype.getLength=function(){return this.data.length};In.prototype.getBitsLength=function(){return In.getBitsLength(this.data.length)};In.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};var rv=In;const lv=Ot,sv=Te;function Fn(e){this.mode=lv.KANJI,this.data=e}Fn.getBitsLength=function(t){return t*13};Fn.prototype.getLength=function(){return this.data.length};Fn.prototype.getBitsLength=function(){return Fn.getBitsLength(this.data.length)};Fn.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=sv.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
|
||
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var iv=Fn,zf={exports:{}};(function(e){var t={single_source_shortest_paths:function(n,r,l){var s={},a={};a[r]=0;var o=t.PriorityQueue.make();o.push(r,0);for(var u,c,p,g,m,y,x,w,S;!o.empty();){u=o.pop(),c=u.value,g=u.cost,m=n[c]||{};for(p in m)m.hasOwnProperty(p)&&(y=m[p],x=g+y,w=a[p],S=typeof a[p]>"u",(S||w>x)&&(a[p]=x,o.push(p,x),s[p]=c))}if(typeof l<"u"&&typeof a[l]>"u"){var f=["Could not find a path from ",r," to ",l,"."].join("");throw new Error(f)}return s},extract_shortest_path_from_predecessor_list:function(n,r){for(var l=[],s=r;s;)l.push(s),n[s],s=n[s];return l.reverse(),l},find_path:function(n,r,l){var s=t.single_source_shortest_paths(n,r,l);return t.extract_shortest_path_from_predecessor_list(s,l)},PriorityQueue:{make:function(n){var r=t.PriorityQueue,l={},s;n=n||{};for(s in r)r.hasOwnProperty(s)&&(l[s]=r[s]);return l.queue=[],l.sorter=n.sorter||r.default_sorter,l},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var l={value:n,cost:r};this.queue.push(l),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(zf);var av=zf.exports;(function(e){const t=Ot,n=Zg,r=tv,l=rv,s=iv,a=Xe,o=Te,u=av;function c(f){return unescape(encodeURIComponent(f)).length}function p(f,d,h){const v=[];let N;for(;(N=f.exec(h))!==null;)v.push({data:N[0],index:N.index,mode:d,length:N[0].length});return v}function g(f){const d=p(a.NUMERIC,t.NUMERIC,f),h=p(a.ALPHANUMERIC,t.ALPHANUMERIC,f);let v,N;return o.isKanjiModeEnabled()?(v=p(a.BYTE,t.BYTE,f),N=p(a.KANJI,t.KANJI,f)):(v=p(a.BYTE_KANJI,t.BYTE,f),N=[]),d.concat(h,v,N).sort(function(k,C){return k.index-C.index}).map(function(k){return{data:k.data,mode:k.mode,length:k.length}})}function m(f,d){switch(d){case t.NUMERIC:return n.getBitsLength(f);case t.ALPHANUMERIC:return r.getBitsLength(f);case t.KANJI:return s.getBitsLength(f);case t.BYTE:return l.getBitsLength(f)}}function y(f){return f.reduce(function(d,h){const v=d.length-1>=0?d[d.length-1]:null;return v&&v.mode===h.mode?(d[d.length-1].data+=h.data,d):(d.push(h),d)},[])}function x(f){const d=[];for(let h=0;h<f.length;h++){const v=f[h];switch(v.mode){case t.NUMERIC:d.push([v,{data:v.data,mode:t.ALPHANUMERIC,length:v.length},{data:v.data,mode:t.BYTE,length:v.length}]);break;case t.ALPHANUMERIC:d.push([v,{data:v.data,mode:t.BYTE,length:v.length}]);break;case t.KANJI:d.push([v,{data:v.data,mode:t.BYTE,length:c(v.data)}]);break;case t.BYTE:d.push([{data:v.data,mode:t.BYTE,length:c(v.data)}])}}return d}function w(f,d){const h={},v={start:{}};let N=["start"];for(let E=0;E<f.length;E++){const k=f[E],C=[];for(let M=0;M<k.length;M++){const A=k[M],U=""+E+M;C.push(U),h[U]={node:A,lastCount:0},v[U]={};for(let Le=0;Le<N.length;Le++){const L=N[Le];h[L]&&h[L].node.mode===A.mode?(v[L][U]=m(h[L].lastCount+A.length,A.mode)-m(h[L].lastCount,A.mode),h[L].lastCount+=A.length):(h[L]&&(h[L].lastCount=A.length),v[L][U]=m(A.length,A.mode)+4+t.getCharCountIndicator(A.mode,d))}}N=C}for(let E=0;E<N.length;E++)v[N[E]].end=0;return{map:v,table:h}}function S(f,d){let h;const v=t.getBestModeForData(f);if(h=t.from(d,v),h!==t.BYTE&&h.bit<v.bit)throw new Error('"'+f+'" cannot be encoded with mode '+t.toString(h)+`.
|
||
Suggested mode is: `+t.toString(v));switch(h===t.KANJI&&!o.isKanjiModeEnabled()&&(h=t.BYTE),h){case t.NUMERIC:return new n(f);case t.ALPHANUMERIC:return new r(f);case t.KANJI:return new s(f);case t.BYTE:return new l(f)}}e.fromArray=function(d){return d.reduce(function(h,v){return typeof v=="string"?h.push(S(v,null)):v.data&&h.push(S(v.data,v.mode)),h},[])},e.fromString=function(d,h){const v=g(d,o.isKanjiModeEnabled()),N=x(v),E=w(N,h),k=u.find_path(E.map,"start","end"),C=[];for(let M=1;M<k.length-1;M++)C.push(E.table[k[M]].node);return e.fromArray(y(C))},e.rawSplit=function(d){return e.fromArray(g(d,o.isKanjiModeEnabled()))}})(_f);const js=Te,Xs=vs,ov=bg,uv=Wg,cv=Cf,dv=Ef,ia=kf,aa=ys,fv=Hg,Gl=Tf,pv=Af,mv=Ot,Zs=_f;function hv(e,t){const n=e.size,r=dv.getPositions(t);for(let l=0;l<r.length;l++){const s=r[l][0],a=r[l][1];for(let o=-1;o<=7;o++)if(!(s+o<=-1||n<=s+o))for(let u=-1;u<=7;u++)a+u<=-1||n<=a+u||(o>=0&&o<=6&&(u===0||u===6)||u>=0&&u<=6&&(o===0||o===6)||o>=2&&o<=4&&u>=2&&u<=4?e.set(s+o,a+u,!0,!0):e.set(s+o,a+u,!1,!0))}}function gv(e){const t=e.size;for(let n=8;n<t-8;n++){const r=n%2===0;e.set(n,6,r,!0),e.set(6,n,r,!0)}}function vv(e,t){const n=cv.getPositions(t);for(let r=0;r<n.length;r++){const l=n[r][0],s=n[r][1];for(let a=-2;a<=2;a++)for(let o=-2;o<=2;o++)a===-2||a===2||o===-2||o===2||a===0&&o===0?e.set(l+a,s+o,!0,!0):e.set(l+a,s+o,!1,!0)}}function yv(e,t){const n=e.size,r=Gl.getEncodedBits(t);let l,s,a;for(let o=0;o<18;o++)l=Math.floor(o/3),s=o%3+n-8-3,a=(r>>o&1)===1,e.set(l,s,a,!0),e.set(s,l,a,!0)}function ei(e,t,n){const r=e.size,l=pv.getEncodedBits(t,n);let s,a;for(s=0;s<15;s++)a=(l>>s&1)===1,s<6?e.set(s,8,a,!0):s<8?e.set(s+1,8,a,!0):e.set(r-15+s,8,a,!0),s<8?e.set(8,r-s-1,a,!0):s<9?e.set(8,15-s-1+1,a,!0):e.set(8,15-s-1,a,!0);e.set(r-8,8,1,!0)}function xv(e,t){const n=e.size;let r=-1,l=n-1,s=7,a=0;for(let o=n-1;o>0;o-=2)for(o===6&&o--;;){for(let u=0;u<2;u++)if(!e.isReserved(l,o-u)){let c=!1;a<t.length&&(c=(t[a]>>>s&1)===1),e.set(l,o-u,c),s--,s===-1&&(a++,s=7)}if(l+=r,l<0||n<=l){l-=r,r=-r;break}}}function jv(e,t,n){const r=new ov;n.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),mv.getCharCountIndicator(u.mode,e)),u.write(r)});const l=js.getSymbolTotalCodewords(e),s=aa.getTotalCodewordsCount(e,t),a=(l-s)*8;for(r.getLengthInBits()+4<=a&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const o=(a-r.getLengthInBits())/8;for(let u=0;u<o;u++)r.put(u%2?17:236,8);return wv(r,e,t)}function wv(e,t,n){const r=js.getSymbolTotalCodewords(t),l=aa.getTotalCodewordsCount(t,n),s=r-l,a=aa.getBlocksCount(t,n),o=r%a,u=a-o,c=Math.floor(r/a),p=Math.floor(s/a),g=p+1,m=c-p,y=new fv(m);let x=0;const w=new Array(a),S=new Array(a);let f=0;const d=new Uint8Array(e.buffer);for(let k=0;k<a;k++){const C=k<u?p:g;w[k]=d.slice(x,x+C),S[k]=y.encode(w[k]),x+=C,f=Math.max(f,C)}const h=new Uint8Array(r);let v=0,N,E;for(N=0;N<f;N++)for(E=0;E<a;E++)N<w[E].length&&(h[v++]=w[E][N]);for(N=0;N<m;N++)for(E=0;E<a;E++)h[v++]=S[E][N];return h}function Sv(e,t,n,r){let l;if(Array.isArray(e))l=Zs.fromArray(e);else if(typeof e=="string"){let c=t;if(!c){const p=Zs.rawSplit(e);c=Gl.getBestVersionForData(p,n)}l=Zs.fromString(e,c||40)}else throw new Error("Invalid data");const s=Gl.getBestVersionForData(l,n);if(!s)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=s;else if(t<s)throw new Error(`
|
||
The chosen QR Code version cannot contain this amount of data.
|
||
Minimum version required to store current data is: `+s+`.
|
||
`);const a=jv(t,n,l),o=js.getSymbolSize(t),u=new uv(o);return hv(u,t),gv(u),vv(u,t),ei(u,n,0),t>=7&&yv(u,t),xv(u,a),isNaN(r)&&(r=ia.getBestMask(u,ei.bind(null,u,n))),ia.applyMask(r,u),ei(u,n,r),{modules:u,version:t,errorCorrectionLevel:n,maskPattern:r,segments:l}}Sf.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let r=Xs.M,l,s;return typeof n<"u"&&(r=Xs.from(n.errorCorrectionLevel,Xs.M),l=Gl.from(n.version),s=ia.from(n.maskPattern),n.toSJISFunc&&js.setToSJISFunction(n.toSJISFunc)),Sv(t,l,r,s)};var If={},mo={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(s){return[s,s]}))),r.length===6&&r.push("F","F");const l=parseInt(r.join(""),16);return{r:l>>24&255,g:l>>16&255,b:l>>8&255,a:l&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const l=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,s=r.width&&r.width>=21?r.width:void 0,a=r.scale||4;return{width:s,scale:s?4:a,margin:l,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,l){return l.width&&l.width>=r+l.margin*2?l.width/(r+l.margin*2):l.scale},e.getImageWidth=function(r,l){const s=e.getScale(r,l);return Math.floor((r+l.margin*2)*s)},e.qrToImageData=function(r,l,s){const a=l.modules.size,o=l.modules.data,u=e.getScale(a,s),c=Math.floor((a+s.margin*2)*u),p=s.margin*u,g=[s.color.light,s.color.dark];for(let m=0;m<c;m++)for(let y=0;y<c;y++){let x=(m*c+y)*4,w=s.color.light;if(m>=p&&y>=p&&m<c-p&&y<c-p){const S=Math.floor((m-p)/u),f=Math.floor((y-p)/u);w=g[o[S*a+f]?1:0]}r[x++]=w.r,r[x++]=w.g,r[x++]=w.b,r[x]=w.a}}})(mo);(function(e){const t=mo;function n(l,s,a){l.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=a,s.width=a,s.style.height=a+"px",s.style.width=a+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(s,a,o){let u=o,c=a;typeof u>"u"&&(!a||!a.getContext)&&(u=a,a=void 0),a||(c=r()),u=t.getOptions(u);const p=t.getImageWidth(s.modules.size,u),g=c.getContext("2d"),m=g.createImageData(p,p);return t.qrToImageData(m.data,s,u),n(g,c,p),g.putImageData(m,0,0),c},e.renderToDataURL=function(s,a,o){let u=o;typeof u>"u"&&(!a||!a.getContext)&&(u=a,a=void 0),u||(u={});const c=e.render(s,a,u),p=u.type||"image/png",g=u.rendererOpts||{};return c.toDataURL(p,g.quality)}})(If);var Ff={};const Nv=mo;function Iu(e,t){const n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function ti(e,t,n){let r=e+t;return typeof n<"u"&&(r+=" "+n),r}function Cv(e,t,n){let r="",l=0,s=!1,a=0;for(let o=0;o<e.length;o++){const u=Math.floor(o%t),c=Math.floor(o/t);!u&&!s&&(s=!0),e[o]?(a++,o>0&&u>0&&e[o-1]||(r+=s?ti("M",u+n,.5+c+n):ti("m",l,0),l=0,s=!1),u+1<t&&e[o+1]||(r+=ti("h",a),a=0)):l++}return r}Ff.render=function(t,n,r){const l=Nv.getOptions(n),s=t.modules.size,a=t.modules.data,o=s+l.margin*2,u=l.color.light.a?"<path "+Iu(l.color.light,"fill")+' d="M0 0h'+o+"v"+o+'H0z"/>':"",c="<path "+Iu(l.color.dark,"stroke")+' d="'+Cv(a,s,l.margin)+'"/>',p='viewBox="0 0 '+o+" "+o+'"',m='<svg xmlns="http://www.w3.org/2000/svg" '+(l.width?'width="'+l.width+'" height="'+l.width+'" ':"")+p+' shape-rendering="crispEdges">'+u+c+`</svg>
|
||
`;return typeof r=="function"&&r(null,m),m};const Ev=$g,oa=Sf,Df=If,kv=Ff;function ho(e,t,n,r,l){const s=[].slice.call(arguments,1),a=s.length,o=typeof s[a-1]=="function";if(!o&&!Ev())throw new Error("Callback required as last argument");if(o){if(a<2)throw new Error("Too few arguments provided");a===2?(l=n,n=t,t=r=void 0):a===3&&(t.getContext&&typeof l>"u"?(l=r,r=void 0):(l=r,r=n,n=t,t=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(n=t,t=r=void 0):a===2&&!t.getContext&&(r=n,n=t,t=void 0),new Promise(function(u,c){try{const p=oa.create(n,r);u(e(p,t,r))}catch(p){c(p)}})}try{const u=oa.create(n,r);l(null,e(u,t,r))}catch(u){l(u)}}Dr.create=oa.create;Dr.toCanvas=ho.bind(null,Df.render);Dr.toDataURL=ho.bind(null,Df.renderToDataURL);Dr.toString=ho.bind(null,function(e,t,n){return kv.render(e,n)});const Pv={A5:{w:148,h:210,pad:12,logo:14,store:6,eyebrow:3.8,title:10,qr:66,qrWithRewards:50,body:4.5,small:4,maxRewards:4},A6:{w:105,h:148,pad:8,logo:10,store:4.5,eyebrow:3,title:7,qr:46,qrWithRewards:34,body:3.4,small:3.1,maxRewards:3}};function Of(e){const t=Pv[e.format],n=(e.rewards??[]).filter(c=>c.active!==!1&&c.label.trim()).sort((c,p)=>c.cost-p.cost),r=n.slice(0,t.maxRewards),l=e.pointsMode==="STAMP"?"tampons":"points",s=r.length?t.qrWithRewards:t.qr,[a,o]=j.useState("");j.useEffect(()=>{Dr.toString(e.url,{type:"svg",errorCorrectionLevel:"Q",margin:0,color:{dark:"#111111",light:"#FFFFFF"}}).then(o)},[e.url]);const u=c=>`${c}mm`;return i.jsxs("div",{className:"poster",style:{width:u(t.w),height:u(t.h),padding:u(t.pad),boxSizing:"border-box",background:e.backgroundColor,color:e.foregroundColor,fontFamily:"'Figtree', system-ui, sans-serif",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",textAlign:"center",overflow:"hidden",printColorAdjust:"exact",WebkitPrintColorAdjust:"exact"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:u(3)},children:[e.logoUrl&&i.jsx("img",{src:e.logoUrl,alt:"",style:{width:u(t.logo),height:u(t.logo),objectFit:"contain",borderRadius:u(2.5),background:"#fff"}}),i.jsx("span",{style:{fontSize:u(t.store),fontWeight:700},children:e.storeName})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:u(2.5)},children:[i.jsx("span",{style:{fontSize:u(t.eyebrow),fontWeight:700,letterSpacing:"0.1em",textTransform:"uppercase",color:e.labelColor},children:e.programName}),i.jsx("span",{style:{fontSize:u(t.title),lineHeight:1.12,fontWeight:800,letterSpacing:"-0.02em",maxWidth:"92%"},children:"Scannez pour obtenir votre carte de fidélité"})]}),i.jsx("div",{role:"img","aria-label":"QR code d'inscription",style:{background:"#fff",borderRadius:u(3.5),padding:u(4),width:u(s),height:u(s),boxSizing:"content-box"},dangerouslySetInnerHTML:{__html:a}}),r.length>0&&i.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:u(1.6)},children:[i.jsx("span",{style:{fontSize:u(t.small),fontWeight:700,letterSpacing:"0.1em",textTransform:"uppercase",color:e.labelColor},children:"Vos récompenses"}),i.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:u(1.2)},children:r.map(c=>i.jsxs("li",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:u(3),padding:`${u(1.4)} ${u(3)}`,borderRadius:u(2.5),background:"rgba(255,255,255,0.12)",fontSize:u(t.body),lineHeight:1.25},children:[i.jsx("span",{style:{fontWeight:700,textAlign:"left"},children:c.label}),i.jsxs("span",{style:{whiteSpace:"nowrap",color:e.labelColor,fontWeight:600},children:[c.cost," ",l]})]},`${c.label}-${c.cost}`))}),n.length>r.length&&i.jsxs("span",{style:{fontSize:u(t.small),color:e.labelColor},children:["et ",n.length-r.length," autre(s) à découvrir sur votre carte"]})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:u(1.5)},children:[i.jsx("span",{style:{fontSize:u(t.body),lineHeight:1.4,fontWeight:600},children:"Ajoutez-la à Apple Wallet ou Google Wallet."}),i.jsx("span",{style:{fontSize:u(t.small),lineHeight:1.4,color:e.labelColor},children:"Gratuit, sans application à télécharger."})]})]})}function Uf(e){return new Promise((t,n)=>{const r=URL.createObjectURL(e),l=new Image;l.onload=()=>{URL.revokeObjectURL(r),t(l)},l.onerror=()=>n(new Error("Image illisible")),l.src=r})}function $f(e){return new Promise((t,n)=>e.toBlob(r=>r?t(r):n(new Error("Conversion impossible")),"image/png"))}async function Rv(e){const t=await Uf(e),n=1125,r=432,l=Math.max(n/t.width,r/t.height),s=n/l,a=r/l,o=Object.assign(document.createElement("canvas"),{width:n,height:r});return o.getContext("2d").drawImage(t,(t.width-s)/2,(t.height-a)/2,s,a,0,0,n,r),$f(o)}async function Tv(e){const t=await Uf(e),n=Math.min(1,480/Math.max(t.width,t.height)),r=Object.assign(document.createElement("canvas"),{width:Math.round(t.width*n),height:Math.round(t.height*n)});return r.getContext("2d").drawImage(t,0,0,r.width,r.height),$f(r)}async function Lv(e){const t=new Image;t.crossOrigin="anonymous",t.src=e;try{await t.decode()}catch{return null}const r=Object.assign(document.createElement("canvas"),{width:48,height:48}).getContext("2d");r.drawImage(t,0,0,48,48);let l;try{l=r.getImageData(0,0,48,48).data}catch{return null}const s=new Map;for(let u=0;u<l.length;u+=4){const[c,p,g,m]=[l[u],l[u+1],l[u+2],l[u+3]];if(m<128||c>235&&p>235&&g>235)continue;const y=`${c>>5}${p>>5}${g>>5}`,x=s.get(y)??{n:0,r:0,g:0,b:0};s.set(y,{n:x.n+1,r:x.r+c,g:x.g+p,b:x.b+g})}const a=[...s.values()].sort((u,c)=>c.n-u.n)[0];if(!a)return null;const o=u=>Math.round(u/a.n).toString(16).padStart(2,"0");return`#${o(a.r)}${o(a.g)}${o(a.b)}`.toUpperCase()}function Fu(e,t){const n=s=>{const[a,o,u]=[1,3,5].map(c=>{const p=parseInt(s.slice(c,c+2),16)/255;return p<=.03928?p/12.92:((p+.055)/1.055)**2.4});return .2126*a+.7152*o+.0722*u},[r,l]=[n(e),n(t)].sort((s,a)=>a-s);return(r+.05)/(l+.05)}const ni=["Identité","Couleurs","Règle de points","Récompenses","Récapitulatif"],Av=[["Ardoise","#1F2937","#FFFFFF","#D1D5DB"],["Émeraude","#0E7A66","#FFFFFF","#CDEDE4"],["Brique","#A64B17","#FFF4E4","#F7D58B"],["Marine","#1E3A5F","#FFFFFF","#BFD3EA"],["Prune","#5B2245","#FFFFFF","#E9C6DA"],["Crème","#FFF8EC","#3B2A1A","#8A6A4A"]],Mv=["Café offert","Viennoiserie offerte","Dessert offert","-10 % sur le prochain achat"];function _v(e){return{programName:`Fidélité ${e.name}`.slice(0,40),backgroundColor:"#1F2937",foregroundColor:"#FFFFFF",labelColor:"#D1D5DB",pointsMode:"AMOUNT",pointsPerEuro:1,rewards:[]}}function Bf({store:e,onSaved:t,base:n=`/api/admin/stores/${e.id}/card-design`,posterHref:r=`/magasins/${e.id}/affichette`,draftNote:l}){const[s,a]=j.useState(0),[o,u]=j.useState(null),[c,p]=j.useState({logoUrl:null,stripUrl:null}),[g,m]=j.useState(!1),[y,x]=j.useState("apple"),[w,S]=j.useState(null),[f,d]=j.useState(!1),[h,v]=j.useState(null);function N(L){const{logoUrl:W,stripUrl:se,...Ae}=L;u(Ae),p({logoUrl:na(W),stripUrl:na(se)}),m(!0)}if(j.useEffect(()=>{O.get(n).then(L=>L?N(L):u(_v(e))).catch(L=>S(L.message))},[n,e]),j.useEffect(()=>{c.logoUrl&&Lv(c.logoUrl).then(v)},[c.logoUrl]),!o)return w?i.jsx("div",{className:"alert error",children:w}):i.jsx("p",{className:"muted",children:"Chargement…"});const E=(L,W)=>u({...o,[L]:W});async function k(){S(null),d(!0);try{const{programName:L,backgroundColor:W,foregroundColor:se,labelColor:Ae,pointsMode:Ze,pointsPerEuro:R}=o,_=o.rewards.map(({id:z,label:H,cost:Z,active:nn})=>({id:z,label:H,cost:Z,active:nn}));return N(await O.put(n,{programName:L,backgroundColor:W,foregroundColor:se,labelColor:Ae,pointsMode:Ze,pointsPerEuro:R,rewards:_})),t(),!0}catch(L){return S(L.message),!1}finally{d(!1)}}async function C(){await k()&&a(L=>Math.min(L+1,ni.length-1))}async function M(L,W){var Ae;const se=(Ae=W.target.files)==null?void 0:Ae[0];if(W.target.value="",!!se&&!(!g&&!await k())){d(!0),S(null);try{const Ze=L==="logo"?await Tv(se):await Rv(se),R=new FormData;R.append("file",Ze,`${L}.png`),N(await O.post(`${n}/images/${L}`,R))}catch(Ze){S(Ze.message)}finally{d(!1)}}}const A={...o,...c,storeName:e.name},U=Fu(o.backgroundColor,o.foregroundColor),Le=Fu(o.backgroundColor,o.labelColor);return i.jsxs("div",{className:"wizard",children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:24},children:[i.jsx("ol",{className:"steps","aria-label":"Étapes",children:ni.map((L,W)=>i.jsx("li",{children:i.jsxs("button",{type:"button","aria-current":W===s?"step":void 0,className:W<s?"done":void 0,onClick:()=>a(W),children:[i.jsx("span",{className:"n",children:W<s?"✓":W+1}),L]})},L))}),w&&i.jsx("div",{className:"alert error",role:"alert",children:w}),i.jsxs("section",{className:"card",style:{display:"flex",flexDirection:"column",gap:20},children:[s===0&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{children:"Identité"}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"programName",children:"Nom du programme *"}),i.jsx("input",{id:"programName",className:"input",maxLength:40,value:o.programName,onChange:L=>E("programName",L.target.value)})]}),i.jsxs("div",{className:"field",children:[i.jsx("span",{style:{fontWeight:600},children:"Logo"}),i.jsxs("div",{className:"upload-drop",children:[c.logoUrl&&i.jsx("img",{src:c.logoUrl,alt:"Logo actuel"}),i.jsxs("label",{className:"btn secondary small",children:[c.logoUrl?"Remplacer":"Choisir un fichier",i.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/webp",className:"sr-only",onChange:L=>M("logo",L),disabled:f})]}),i.jsx("span",{className:"hint",children:"PNG carré conseillé, fond transparent."})]})]}),i.jsxs("div",{className:"field",children:[i.jsx("span",{style:{fontWeight:600},children:"Bandeau"}),i.jsxs("div",{className:"upload-drop",children:[c.stripUrl&&i.jsx("img",{src:c.stripUrl,alt:"Bandeau actuel"}),i.jsxs("label",{className:"btn secondary small",children:[c.stripUrl?"Remplacer":"Choisir un fichier",i.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/webp",className:"sr-only",onChange:L=>M("strip",L),disabled:f})]}),i.jsx("span",{className:"hint",children:"Recadré automatiquement au format Wallet (1125 × 432)."})]})]})]}),s===1&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{children:"Couleurs"}),i.jsxs("div",{className:"field",children:[i.jsx("span",{style:{fontWeight:600},children:"Palettes prêtes à l’emploi"}),i.jsx("div",{className:"palettes",children:Av.map(([L,W,se,Ae])=>i.jsxs("button",{type:"button",className:"palette","aria-pressed":o.backgroundColor===W&&o.foregroundColor===se,onClick:()=>u({...o,backgroundColor:W,foregroundColor:se,labelColor:Ae}),children:[i.jsx("span",{style:{background:W,color:se},children:"Aa"}),L]},L))})]}),h&&h!==o.backgroundColor&&i.jsxs("div",{className:"row",style:{gap:12},children:[i.jsx("span",{style:{width:28,height:28,borderRadius:8,background:h,border:"1px solid var(--border)"}}),i.jsxs("span",{children:["Couleur extraite du logo : ",h]}),i.jsx("button",{type:"button",className:"btn secondary small",onClick:()=>E("backgroundColor",h),children:"Utiliser comme fond"})]}),[["backgroundColor","Fond"],["foregroundColor","Texte"],["labelColor","Libellés"]].map(([L,W])=>i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:L,children:W}),i.jsxs("div",{className:"color-row",children:[i.jsx("input",{type:"color","aria-label":`${W} (sélecteur)`,value:o[L],onChange:se=>E(L,se.target.value.toUpperCase())}),i.jsx("input",{id:L,className:"input",style:{maxWidth:160},value:o[L],pattern:"#[0-9A-Fa-f]{6}",onChange:se=>E(L,se.target.value)})]})]},L)),U<4.5&&i.jsxs("div",{className:"alert warn",children:["Contraste texte/fond insuffisant (",U.toFixed(1),":1, minimum 4,5:1) : le solde sera difficile à lire."]}),Le<3&&i.jsxs("div",{className:"alert warn",children:["Contraste libellés/fond faible (",Le.toFixed(1),":1, minimum conseillé 3:1)."]})]}),s===2&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{children:"Règle de points"}),i.jsxs("div",{className:"mode-cards",role:"radiogroup",children:[i.jsxs("label",{className:"mode-card",children:[i.jsx("input",{type:"radio",name:"mode",checked:o.pointsMode==="AMOUNT",onChange:()=>E("pointsMode","AMOUNT")}),i.jsxs("span",{children:[i.jsx("strong",{children:"Points selon le montant"}),i.jsx("br",{}),i.jsx("span",{className:"muted",children:"X points par euro dépensé"})]})]}),i.jsxs("label",{className:"mode-card",children:[i.jsx("input",{type:"radio",name:"mode",checked:o.pointsMode==="STAMP",onChange:()=>E("pointsMode","STAMP")}),i.jsxs("span",{children:[i.jsx("strong",{children:"Tampons"}),i.jsx("br",{}),i.jsx("span",{className:"muted",children:"1 tampon par passage"})]})]})]}),o.pointsMode==="AMOUNT"?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"ppe",children:"Points par euro *"}),i.jsx("input",{id:"ppe",className:"input",type:"number",step:"0.01",min:.01,max:100,style:{maxWidth:160},value:o.pointsPerEuro,onChange:L=>E("pointsPerEuro",Number(L.target.value))})]}),i.jsxs("p",{className:"muted",style:{margin:0},children:["Exemple : un panier de 23,50 € = ",i.jsxs("strong",{children:[Math.floor(23.5*o.pointsPerEuro)," points"]})," (arrondi à l'inférieur)."]})]}):i.jsx("p",{className:"muted",style:{margin:0},children:"Chaque passage validé par un employé ajoute un tampon, quel que soit le montant."})]}),s===3&&i.jsx(zv,{rewards:o.rewards,unit:o.pointsMode==="STAMP"?"tampons":"points",onChange:L=>E("rewards",L)}),s===4&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{children:"Récapitulatif"}),i.jsxs("ul",{style:{margin:0,paddingLeft:20,lineHeight:1.8},children:[i.jsxs("li",{children:["Programme : ",i.jsx("strong",{children:o.programName})]}),i.jsxs("li",{children:["Règle : ",o.pointsMode==="STAMP"?"1 tampon par passage":`${o.pointsPerEuro} point(s) par euro`]}),i.jsxs("li",{children:["Récompenses : ",o.rewards.filter(L=>L.active!==!1).map(L=>`${L.label} (${L.cost})`).join(", ")||"aucune"]}),i.jsxs("li",{children:["Logo : ",c.logoUrl?"oui":i.jsx("span",{style:{color:"var(--warn)"},children:"manquant"})," · Bandeau : ",c.stripUrl?"oui":"non"]})]}),i.jsx("h3",{style:{margin:"8px 0 0"},children:"Affichette du comptoir"}),i.jsxs("div",{style:{display:"flex",gap:24,flexWrap:"wrap",alignItems:"flex-start"},children:[i.jsx("div",{style:{width:222,height:315,overflow:"hidden",borderRadius:8,boxShadow:"0 4px 16px rgb(0 0 0 / 0.15)"},children:i.jsx("div",{style:{transform:"scale(0.4)",transformOrigin:"top left"},children:i.jsx(Of,{format:"A5",url:e.enrollUrl,storeName:e.name,programName:o.programName,logoUrl:c.logoUrl,backgroundColor:o.backgroundColor,foregroundColor:o.foregroundColor,labelColor:o.labelColor,rewards:o.rewards,pointsMode:o.pointsMode})})}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,flex:"1 1 220px"},children:[i.jsx("p",{style:{margin:0},children:"Le QR mène à la page d'inscription :"}),i.jsx("a",{href:e.enrollUrl,target:"_blank",rel:"noreferrer",style:{wordBreak:"break-all"},children:e.enrollUrl}),i.jsx(Ee,{to:r,className:"btn secondary",children:"Imprimer l'affichette (A5 / A6)"})]})]}),e.status==="DRAFT"&&(l??i.jsxs("p",{style:{margin:0},children:["Le programme s'ouvre automatiquement dès que l'abonnement est payé. Sinon, utilisez le bouton ",i.jsx("strong",{children:"Activer"})," en haut de la fiche."]}))]}),i.jsxs("div",{className:"row between",children:[i.jsx("button",{type:"button",className:"btn secondary",disabled:s===0,onClick:()=>a(s-1),children:"Précédent"}),s<ni.length-1?i.jsx("button",{type:"button",className:"btn",disabled:f,onClick:C,children:"Enregistrer et continuer"}):i.jsx("button",{type:"button",className:"btn",disabled:f,onClick:k,children:"Enregistrer"})]})]})]}),i.jsxs("aside",{className:"preview-col","aria-label":"Aperçu de la carte",children:[i.jsxs("div",{role:"group","aria-label":"Plateforme",className:"row",style:{gap:8},children:[i.jsx("button",{type:"button",className:"chip","aria-pressed":y==="apple",onClick:()=>x("apple"),children:"Apple Wallet"}),i.jsx("button",{type:"button",className:"chip","aria-pressed":y==="google",onClick:()=>x("google"),children:"Google Wallet"})]}),y==="apple"?i.jsx(Og,{d:A}):i.jsx(Ug,{d:A}),i.jsx("span",{className:"muted",style:{fontSize:14},children:"Aperçu indicatif — QR et solde fictifs."})]})]})}function zv({rewards:e,unit:t,onChange:n}){const r=(l,s)=>n(e.map((a,o)=>o===l?{...a,...s}:a));return i.jsxs(i.Fragment,{children:[i.jsx("h2",{children:"Récompenses"}),e.length===0&&i.jsxs("div",{className:"field",children:[i.jsx("p",{className:"muted",style:{margin:0},children:"Aucune récompense pour l’instant. Ajoutez-en une, ou partez d’une idée :"}),i.jsx("div",{className:"row",style:{gap:8},children:Mv.map(l=>i.jsxs("button",{type:"button",className:"chip",onClick:()=>n([...e,{label:l,cost:10}]),children:["+ ",l]},l))})]}),e.map((l,s)=>i.jsxs("div",{className:"row",style:{alignItems:"flex-end",opacity:l.active===!1?.6:1},children:[i.jsxs("div",{className:"field",style:{flex:"1 1 240px"},children:[i.jsx("label",{htmlFor:`rw-label-${s}`,children:"Libellé"}),i.jsx("input",{id:`rw-label-${s}`,className:"input",maxLength:60,value:l.label,onChange:a=>r(s,{label:a.target.value})})]}),i.jsxs("div",{className:"field",style:{width:140},children:[i.jsxs("label",{htmlFor:`rw-cost-${s}`,children:["Coût (",t,")"]}),i.jsx("input",{id:`rw-cost-${s}`,className:"input",type:"number",min:1,value:l.cost,onChange:a=>r(s,{cost:Number(a.target.value)})})]}),l.active===!1?i.jsx("button",{type:"button",className:"btn secondary",onClick:()=>r(s,{active:!0}),children:"Réactiver"}):i.jsx("button",{type:"button",className:"btn secondary","aria-label":`Retirer ${l.label||"la récompense"}`,onClick:()=>n(e.filter((a,o)=>o!==s)),children:"Retirer"})]},l.id??`new-${s}`)),i.jsx("div",{children:i.jsx("button",{type:"button",className:"btn secondary",disabled:e.length>=20,onClick:()=>n([...e,{label:"",cost:10}]),children:"+ Ajouter une récompense"})})]})}const ua={MANAGER:"Dirigeant",EMPLOYEE:"Employé"};function Iv({storeId:e}){const t=`/api/admin/stores/${e}/staff`,[n,r]=j.useState([]),[l,s]=j.useState(null),[a,o]=j.useState(null),u=j.useRef(null),c=j.useRef(null),p=j.useCallback(()=>{O.get(t).then(r).catch(d=>s(d.message))},[t]);j.useEffect(p,[p]);function g(d){var h;o(d),(h=c.current)==null||h.showModal(),p()}async function m(d){try{await O.patch(`${t}/${d.id}`,{active:!d.active}),p()}catch(h){s(h.message)}}async function y(d){if(window.confirm(`Générer un nouveau mot de passe pour ${d.displayName} ? Ses sessions seront fermées.`))try{g(await O.post(`${t}/${d.id}/reset-password`))}catch(h){s(h.message)}}async function x(d){const h=d.role==="MANAGER"?"EMPLOYEE":"MANAGER";if(window.confirm(`${d.displayName} devient ${ua[h]}. Ses sessions ouvertes seront fermées.`))try{await O.patch(`${t}/${d.id}`,{role:h}),p()}catch(v){s(v.message)}}const w=n.filter(d=>d.active),S=w.filter(d=>d.role==="MANAGER").length,f=[...n].sort((d,h)=>Number(h.active)-Number(d.active)||d.role.localeCompare(h.role)||d.displayName.localeCompare(h.displayName));return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"row between",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Employés"}),i.jsxs("p",{className:"muted",style:{margin:0},children:[w.length," compte",w.length>1?"s":""," actif",w.length>1?"s":""," · ",S," dirigeant",S>1?"s":""]})]}),i.jsx("button",{className:"btn",onClick:()=>{var d;return(d=u.current)==null?void 0:d.showModal()},children:"+ Nouvel employé"})]}),l&&i.jsx("div",{className:"alert error",role:"alert",children:l}),n.length>0&&S===0&&i.jsx("div",{className:"alert warn",children:"Aucun Dirigeant actif : personne ne peut configurer le magasin depuis l’app. Créez un compte Dirigeant ou changez le rôle d’un employé."}),n.length===0?i.jsxs("section",{className:"card",style:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:12,padding:40},children:[i.jsx("span",{className:"staff-avatar big","aria-hidden":"true",children:"👥"}),i.jsx("h3",{style:{margin:0},children:"Aucun compte pour l’instant"}),i.jsx("p",{className:"muted",style:{margin:0,maxWidth:420},children:"Créez au moins un Dirigeant : il pourra ensuite ajouter lui-même son équipe depuis l’app MonEspacePro."}),i.jsx("button",{className:"btn",onClick:()=>{var d;return(d=u.current)==null?void 0:d.showModal()},children:"Créer le premier compte"})]}):i.jsx("div",{className:"staff-grid",children:f.map(d=>i.jsxs("article",{className:`card staff-card${d.active?"":" off"}`,children:[i.jsxs("div",{className:"row",style:{gap:12,flexWrap:"nowrap"},children:[i.jsx("span",{className:`staff-avatar${d.role==="MANAGER"?" mgr":""}`,"aria-hidden":"true",children:d.displayName.charAt(0).toUpperCase()}),i.jsxs("div",{style:{minWidth:0},children:[i.jsx("strong",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.displayName}),i.jsx("span",{className:"muted",style:{fontSize:14,display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.email})]})]}),i.jsxs("div",{className:"row",style:{gap:6},children:[i.jsx("span",{className:`role-pill${d.role==="MANAGER"?" mgr":""}`,children:ua[d.role]}),d.active?i.jsx("span",{className:"badge ACTIVE",children:"Actif"}):i.jsx("span",{className:"badge DRAFT",children:"Désactivé"}),i.jsxs("span",{className:"muted",style:{fontSize:13},children:["depuis le ",new Date(d.createdAt).toLocaleDateString("fr-FR",{day:"numeric",month:"short",year:"numeric"})]})]}),i.jsxs("div",{className:"row",style:{gap:8},children:[i.jsx("button",{className:"btn secondary small",onClick:()=>x(d),children:d.role==="MANAGER"?"Passer Employé":"Passer Dirigeant"}),i.jsx("button",{className:"btn secondary small",onClick:()=>y(d),children:"Nouveau mot de passe"}),i.jsx("button",{className:"btn secondary small",onClick:()=>m(d),children:d.active?"Désactiver":"Réactiver"})]})]},d.id))}),i.jsx("dialog",{ref:u,"aria-labelledby":"new-staff-title",children:i.jsx(Fv,{base:t,onCancel:()=>{var d;return(d=u.current)==null?void 0:d.close()},onCreated:d=>{var h;(h=u.current)==null||h.close(),g(d)}})}),i.jsx("dialog",{ref:c,"aria-labelledby":"pwd-title",children:i.jsxs("div",{className:"dialog-body",children:[i.jsx("h2",{id:"pwd-title",children:"Mot de passe provisoire"}),i.jsxs("p",{style:{margin:0},children:["Communiquez-le à ",i.jsx("strong",{children:a==null?void 0:a.displayName})," (",a==null?void 0:a.email,"). Il ne sera plus affiché ensuite."]}),i.jsx("div",{className:"password-box",children:a==null?void 0:a.provisionalPassword}),i.jsxs("div",{className:"row",style:{justifyContent:"flex-end"},children:[i.jsx("button",{className:"btn secondary",onClick:()=>{var d;return(d=navigator.clipboard)==null?void 0:d.writeText((a==null?void 0:a.provisionalPassword)??"")},children:"Copier"}),i.jsx("button",{className:"btn",onClick:()=>{var d;return(d=c.current)==null?void 0:d.close()},children:"J'ai noté le mot de passe"})]})]})})]})}function Fv({base:e,onCancel:t,onCreated:n}){const[r,l]=j.useState(""),[s,a]=j.useState(""),[o,u]=j.useState("EMPLOYEE"),[c,p]=j.useState(null),[g,m]=j.useState(!1);async function y(x){x.preventDefault(),m(!0),p(null);try{n(await O.post(e,{displayName:r,email:s,role:o})),l(""),a(""),u("EMPLOYEE")}catch(w){p(w.message)}finally{m(!1)}}return i.jsxs("form",{className:"dialog-body",onSubmit:y,children:[i.jsx("h2",{id:"new-staff-title",children:"Nouvel employé"}),c&&i.jsx("div",{className:"alert error",role:"alert",children:c}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"staff-name",children:"Prénom et nom *"}),i.jsx("input",{id:"staff-name",className:"input",required:!0,placeholder:"Prénom Nom",value:r,onChange:x=>l(x.target.value)})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"staff-email",children:"E-mail *"}),i.jsx("input",{id:"staff-email",className:"input",type:"email",required:!0,placeholder:"prenom@exemple.fr",value:s,onChange:x=>a(x.target.value)})]}),i.jsxs("fieldset",{style:{border:0,padding:0,margin:0},className:"field",children:[i.jsx("legend",{style:{fontWeight:600,marginBottom:6},children:"Rôle *"}),i.jsx("div",{className:"mode-cards",children:["EMPLOYEE","MANAGER"].map(x=>i.jsxs("label",{className:"mode-card",children:[i.jsx("input",{type:"radio",name:"role",checked:o===x,onChange:()=>u(x)}),i.jsxs("span",{children:[i.jsx("strong",{children:ua[x]}),i.jsx("br",{}),i.jsx("span",{className:"muted",style:{fontSize:14},children:x==="MANAGER"?"Toute la configuration : carte, modules, campagnes, employés, statistiques":"Scanne les cartes et crédite les points, voit ses opérations"})]})]},x))})]}),i.jsx("p",{className:"muted",style:{margin:0,fontSize:14},children:"Un mot de passe provisoire sera généré à la création."}),i.jsxs("div",{className:"row",style:{justifyContent:"flex-end"},children:[i.jsx("button",{type:"button",className:"btn secondary",onClick:t,children:"Annuler"}),i.jsx("button",{className:"btn",disabled:g,children:"Créer le compte"})]})]})}const Du={ACTIVE:["Actif","ACTIVE"],INCOMPLETE:["En attente de paiement","DRAFT"],PAST_DUE:["Impayé","SUSPENDED"],CANCELED:["Résilié","CLOSED"]},Dv={multiStore:"Carte commune à plusieurs magasins"},sl=e=>(e/100).toLocaleString("fr-FR",{style:"currency",currency:"EUR",minimumFractionDigits:e%100?2:0}),ln=e=>new Date(e).toLocaleDateString("fr-FR",{day:"numeric",month:"short",year:"numeric"});function Ov({storeId:e,contactEmail:t,onChange:n}){const[r,l]=j.useState(null),[s,a]=j.useState(null),[o,u]=j.useState(null),[c,p]=j.useState(!1),[g,m]=j.useState(null),[y,x]=j.useState(null),w=j.useCallback(()=>{O.get(`/api/admin/stores/${e}/billing`).then(l).catch(C=>a(C.message))},[e]);j.useEffect(w,[w]);async function S(C,M,A){p(!0),a(null);try{const U=await O.post(M,A);u({...U,label:C}),w(),n()}catch(U){a(U.message)}finally{p(!1)}}if(!r)return s?i.jsx("div",{className:"alert error",children:s}):i.jsx("p",{className:"muted",children:"Chargement…"});const f=r.subscription,d=f&&f.status!=="CANCELED"&&f.hasSubscription?r.catalog.find(C=>C.plan===f.plan):null,h=!d,v=g??(f==null?void 0:f.plan)??"PRO",N=y??(f==null?void 0:f.interval)??"MONTH",E=r.invoices.filter(C=>C.paidAt).reduce((C,M)=>C+M.amountCents,0),k=r.invoices.filter(C=>!C.paidAt).length;return i.jsxs(i.Fragment,{children:[r.testMode&&i.jsx("div",{className:"alert warn",children:"Stripe est en mode test : aucun paiement réel n'est encaissé (carte de test 4242 4242 4242 4242)."}),s&&i.jsx("div",{className:"alert error",role:"alert",children:s}),i.jsxs("div",{className:"kpis",children:[i.jsxs("div",{className:`kpi${d?" ok":""}`,children:[i.jsx("b",{children:d?d.name:"—"}),i.jsx("span",{children:d?`formule ${f.interval==="YEAR"?"annuelle":"mensuelle"}`:(f==null?void 0:f.status)==="INCOMPLETE"?`en attente · ${qe[f.plan]} choisie`:"aucune formule"})]}),i.jsxs("div",{className:"kpi",children:[i.jsx("b",{children:d?sl(d.priceCents[f.interval]):"—"}),i.jsx("span",{children:d?`par ${f.interval==="YEAR"?"an":"mois"}`:"montant"})]}),i.jsxs("div",{className:`kpi${f!=null&&f.cancelAtPeriodEnd?" warn":""}`,children:[i.jsx("b",{style:{fontSize:20,lineHeight:"34px"},children:f!=null&&f.currentPeriodEnd&&f.status==="ACTIVE"?ln(f.currentPeriodEnd):"—"}),i.jsx("span",{children:f!=null&&f.cancelAtPeriodEnd?"fin de l’abonnement":"prochain prélèvement"})]}),i.jsxs("div",{className:`kpi${k?" err":""}`,children:[i.jsx("b",{children:sl(E)}),i.jsxs("span",{children:[r.invoices.length," facture",r.invoices.length>1?"s":"",k?` · ${k} impayée${k>1?"s":""}`:" · tout est réglé"]})]})]}),i.jsxs("section",{className:"card",style:{display:"flex",flexDirection:"column",gap:16},children:[i.jsxs("div",{className:"row between",children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Abonnement"}),i.jsx("p",{className:"muted",style:{margin:0},children:d?`Formule ${d.name}${f.legacyPrice?" (tarif fondateur)":""} — ${f.interval==="YEAR"?"annuelle":"mensuelle"}`:"Aucune formule souscrite. Sans abonnement actif, le magasin a les droits de la formule Essentiel."})]}),i.jsx("span",{className:`badge ${f?Du[f.status][1]:"DRAFT"}`,children:f?Du[f.status][0]:"Aucun abonnement"})]}),(f==null?void 0:f.cancelAtPeriodEnd)&&f.currentPeriodEnd&&i.jsxs("div",{className:"alert warn",children:["Résiliation demandée : l'abonnement s'arrête le ",i.jsx("strong",{children:ln(f.currentPeriodEnd)}),"."]}),(f==null?void 0:f.currentPeriodEnd)&&f.status==="ACTIVE"&&!f.cancelAtPeriodEnd&&i.jsxs("p",{style:{margin:0},children:["Prochain prélèvement le ",i.jsx("strong",{children:ln(f.currentPeriodEnd)}),"."]}),r.billingSuspended&&i.jsx("div",{className:"alert warn",children:"Magasin suspendu automatiquement pour impayé. Il sera réactivé dès que le paiement passera."}),d&&i.jsxs("div",{className:"row",style:{gap:8},children:[i.jsxs("button",{className:"btn",disabled:c,onClick:()=>S("Espace abonnement",`/api/admin/stores/${e}/billing/portal-link`,{sendEmail:!0}),children:["Envoyer l'espace abonnement à ",t]}),i.jsx("button",{className:"btn secondary",disabled:c,onClick:()=>S("Espace abonnement",`/api/admin/stores/${e}/billing/portal-link`,{sendEmail:!1}),children:"Ouvrir l'espace abonnement"}),i.jsx("span",{className:"muted",style:{fontSize:14},children:"Changer de formule, de moyen de paiement, résilier."})]})]}),h&&i.jsxs("section",{className:"card",style:{display:"flex",flexDirection:"column",gap:20},children:[i.jsxs("div",{className:"row between",children:[i.jsx("h2",{children:"Choisir une formule"}),i.jsxs("div",{role:"group","aria-label":"Périodicité",className:"row",style:{gap:8},children:[i.jsx("button",{type:"button",className:"chip","aria-pressed":N==="MONTH",onClick:()=>x("MONTH"),children:"Mensuel"}),i.jsx("button",{type:"button",className:"chip","aria-pressed":N==="YEAR",onClick:()=>x("YEAR"),children:"Annuel — 2 mois offerts"})]})]}),i.jsx("div",{className:"mode-cards",role:"radiogroup","aria-label":"Formule",children:r.catalog.map(C=>i.jsxs("label",{className:"mode-card",style:{flexDirection:"column",gap:8},children:[i.jsxs("span",{className:"row",style:{gap:10},children:[i.jsx("input",{type:"radio",name:"plan",checked:v===C.plan,onChange:()=>m(C.plan)}),i.jsx("strong",{style:{fontSize:18},children:C.name}),C.plan==="PRO"&&i.jsx("span",{className:"badge ACTIVE",style:{height:22},children:"Conseillée"})]}),i.jsxs("span",{style:{fontSize:24,fontWeight:800},children:[sl(C.priceCents[N]),i.jsxs("span",{className:"muted",style:{fontSize:14,fontWeight:500},children:[" / ",N==="YEAR"?"an":"mois",C.plan==="RESEAU"?" / magasin":""]})]}),i.jsx("span",{className:"muted",style:{fontSize:14},children:C.tagline}),i.jsxs("ul",{style:{margin:0,paddingLeft:18,fontSize:14,lineHeight:1.6},children:[i.jsx("li",{children:C.limits.maxStaff?`${C.limits.maxStaff} employés`:"Employés illimités"}),i.jsx("li",{children:"Carte Wallet, points ou tampons, récompenses, mises à jour en direct"}),C.features.map(M=>i.jsx("li",{children:Dv[M]??M},M))]}),i.jsx("span",{style:{fontSize:14,fontWeight:700},children:C.modules.length?`Modules inclus (${C.modules.length})`:"Aucun module inclus"}),C.modules.length>0&&i.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:14,lineHeight:1.6},children:C.modules.map(M=>i.jsx("li",{title:M.tagline,children:M.name},M.id))})]},C.plan))}),i.jsxs("div",{className:"copy-line",style:{flexWrap:"wrap"},children:[i.jsx("span",{className:"muted",children:"Lien de paiement permanent :"}),i.jsx("code",{children:r.subscribeUrl}),i.jsx("button",{type:"button",className:"btn secondary small",onClick:()=>{var C;return(C=navigator.clipboard)==null?void 0:C.writeText(r.subscribeUrl)},children:"Copier"})]}),i.jsx("p",{className:"muted",style:{margin:0,fontSize:14},children:"Il ne périme pas. Le commerçant peut saisir un code promo sur la page de paiement (codes à créer dans Stripe → Coupons)."}),i.jsxs("div",{className:"row",style:{gap:8},children:[i.jsxs("button",{className:"btn",disabled:c,onClick:()=>S("Lien d'abonnement",`/api/admin/stores/${e}/billing/checkout-link`,{plan:v,interval:N,sendEmail:!0}),children:["Envoyer le lien à ",t]}),i.jsx("button",{className:"btn secondary",disabled:c,onClick:()=>S("Lien d'abonnement",`/api/admin/stores/${e}/billing/checkout-link`,{plan:v,interval:N,sendEmail:!1}),children:"Enregistrer la formule sans envoyer"})]})]}),o&&i.jsxs("div",{className:"alert ok",children:[o.label," ",o.emailedTo?i.jsxs(i.Fragment,{children:["envoyé à ",i.jsx("strong",{children:o.emailedTo}),". "]}):"créé. ",i.jsx("a",{href:o.url,target:"_blank",rel:"noreferrer",style:{wordBreak:"break-all"},children:o.url})]}),i.jsxs("div",{className:"row between",style:{marginTop:8},children:[i.jsx("h2",{children:"Factures"}),i.jsx("span",{className:"muted",style:{fontSize:14},children:"Émises et envoyées automatiquement à chaque paiement."})]}),i.jsxs("div",{className:"table-wrap",children:[i.jsx("div",{className:"table-scroll",children:i.jsxs("table",{style:{minWidth:720},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",style:{paddingLeft:24},children:"Facture"}),i.jsx("th",{scope:"col",children:"Objet"}),i.jsx("th",{scope:"col",children:"Période"}),i.jsx("th",{scope:"col",className:"num",children:"Montant"}),i.jsx("th",{scope:"col",children:"Statut"}),i.jsx("th",{scope:"col",children:i.jsx("span",{className:"sr-only",children:"PDF"})})]})}),i.jsx("tbody",{children:r.invoices.map(C=>i.jsxs("tr",{children:[i.jsx("td",{style:{paddingLeft:24,fontWeight:600},children:C.number}),i.jsx("td",{style:{fontSize:14},children:C.description.replace("Abonnement MonEspacePro — ","")}),i.jsxs("td",{children:[ln(C.periodStart)," → ",ln(C.periodEnd)]}),i.jsx("td",{className:"num",children:sl(C.amountCents)}),i.jsx("td",{children:C.paidAt?i.jsxs("span",{className:"badge ACTIVE",children:["Payée le ",ln(C.paidAt)]}):i.jsx("span",{className:"badge SUSPENDED",children:"Impayée"})}),i.jsx("td",{style:{textAlign:"right",paddingRight:24},children:i.jsx("button",{className:"btn secondary small",onClick:()=>la(`/api/admin/invoices/${C.id}/pdf`,`${C.number}.pdf`).catch(M=>a(M.message)),children:"PDF"})})]},C.id))})]})}),r.invoices.length===0&&i.jsx("p",{className:"muted",style:{padding:24,margin:0,textAlign:"center"},children:"Aucune facture pour l'instant. Elles sont créées automatiquement à chaque paiement."})]})]})}const Ou=e=>new Date(e).toLocaleString("fr-FR",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"});function Uv({storeId:e,storeName:t}){const[n,r]=j.useState(null),[l,s]=j.useState(""),[a,o]=j.useState(null),[u,c]=j.useState(null),[p,g]=j.useState(null),[m,y]=j.useState(!1),x=j.useCallback(()=>{O.get(`/api/admin/stores/${e}/campaigns`).then(r).catch(d=>c(d.message))},[e]);if(j.useEffect(x,[x]),!n)return u?i.jsx("div",{className:"alert error",children:u}):i.jsx("p",{className:"muted",children:"Chargement…"});const w=l.trim(),S=!n.allowed||!!n.nextAllowedAt;async function f(){if(confirm(`Envoyer ce message aux ${n.audience.cards} cartes de ${t} ?
|
||
|
||
« ${w} »`)){y(!0),c(null);try{await O.post(`/api/admin/stores/${e}/campaigns`,{message:w,title:(a??n.defaultTitle).trim()}),s(""),g("Campagne envoyée. Les cartes se mettent à jour dans les minutes qui suivent."),x()}catch(d){c(d.message)}finally{y(!1)}}}return i.jsxs(i.Fragment,{children:[u&&i.jsx("div",{className:"alert error",role:"alert",children:u}),p&&i.jsx("div",{className:"alert ok",role:"status",children:p}),i.jsxs("section",{className:"card",style:{display:"flex",flexDirection:"column",gap:16},children:[i.jsxs("div",{children:[i.jsx("h2",{children:"Nouvelle campagne"}),i.jsxs("p",{className:"muted",style:{margin:0},children:["Le message apparaît en notification sur le téléphone des clients et reste visible sur leur carte. Audience : ",i.jsx("strong",{children:n.audience.cards})," cartes, dont ",i.jsx("strong",{children:n.audience.appleDevices})," iPhone joignables (Google Wallet : tous les clients qui ont ajouté la carte)."]})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"campaign-title",children:"Titre de la notification"}),i.jsx("input",{id:"campaign-title",className:"input",maxLength:40,value:a??n.defaultTitle,onChange:d=>o(d.target.value),disabled:S||m}),i.jsx("span",{className:"muted",style:{fontSize:14},children:"Affiché sur Google Wallet. Sur iPhone, le nom du magasin apparaît toujours en titre."})]}),i.jsx("label",{htmlFor:"campaign-msg",children:"Message"}),i.jsx("textarea",{id:"campaign-msg",className:"input",rows:3,maxLength:n.maxLength,placeholder:"Ex. : -20 % sur les viennoiseries ce samedi, sur présentation de votre carte !",value:l,onChange:d=>s(d.target.value),disabled:S||m}),i.jsxs("div",{className:"row between",children:[i.jsxs("span",{className:"muted",style:{fontSize:14},children:[w.length," / ",n.maxLength," caractères · 1 campagne toutes les ",n.minIntervalHours," h maximum"]}),i.jsx("button",{className:"btn",disabled:S||m||w.length<5,onClick:f,children:m?"Envoi…":"Envoyer la campagne"})]}),n.nextAllowedAt&&i.jsxs("div",{className:"alert warn",children:["Prochain envoi possible le ",Ou(n.nextAllowedAt),"."]})]}),i.jsxs("section",{className:"card",children:[i.jsx("h2",{children:"Historique"}),n.items.length===0?i.jsx("p",{className:"muted",style:{margin:0},children:"Aucune campagne envoyée pour l'instant."}):i.jsx("div",{className:"table-scroll",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",children:"Date"}),i.jsx("th",{scope:"col",children:"Message"}),i.jsx("th",{scope:"col",children:"Envoyée par"}),i.jsx("th",{scope:"col",className:"num",children:"Cartes"})]})}),i.jsx("tbody",{children:n.items.map(d=>i.jsxs("tr",{children:[i.jsx("td",{className:"muted",style:{whiteSpace:"nowrap"},children:Ou(d.createdAt)}),i.jsxs("td",{children:[d.title&&i.jsxs("strong",{children:[d.title," · "]}),d.message]}),i.jsx("td",{children:d.sentByName}),i.jsx("td",{className:"num",children:d.cards})]},d.id))})]})})]})]})}const $v={campaigns:"📣",reminders:"⏰",birthday:"🎂",reviews:"⭐",referral:"🤝",stats:"📊",whiteLabel:"🏷️"},Uu=e=>e.type==="text"||e.type==="textarea";function Bv({m:e}){const[t,n]=e.override===!0?["Ajouté sur mesure","ACTIVE"]:e.override===!1?["Retiré","CLOSED"]:e.inPlan?["Inclus dans la formule","ACTIVE"]:["Non inclus","DRAFT"];return i.jsx("span",{className:`badge ${n}`,children:t})}function bv({f:e,value:t,onChange:n}){var o;const r=`f-${e.key}`,l=i.jsxs(i.Fragment,{children:[e.help&&i.jsxs("span",{className:"muted",style:{fontSize:14},children:[e.help," "]}),"variables"in e&&((o=e.variables)!=null&&o.length)?i.jsxs("span",{className:"muted",style:{fontSize:14},children:["Variables : ",e.variables.map(u=>i.jsx("code",{style:{marginRight:6},children:u},u))]}):null]});if(e.type==="boolean")return i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,fontWeight:600},children:[i.jsx("input",{type:"checkbox",checked:!!t,onChange:u=>n(u.target.checked)}),e.label,e.help&&i.jsxs("span",{className:"muted",style:{fontWeight:400,fontSize:14},children:["— ",e.help]})]});if(e.type==="int"||e.type==="hour")return i.jsxs("div",{children:[i.jsx("label",{htmlFor:r,style:{fontWeight:600},children:e.label}),i.jsxs("div",{className:"row",style:{gap:8,alignItems:"center"},children:[i.jsx("input",{id:r,className:"input",type:"number",style:{width:120},min:e.min,max:e.max,value:Number(t),onChange:u=>n(Math.floor(Number(u.target.value)||0))}),i.jsx("span",{className:"muted",children:e.type==="hour"?"h":e.unit})]}),l]});const s=e,a=String(t??"");return i.jsxs("div",{children:[i.jsx("label",{htmlFor:r,style:{fontWeight:600},children:e.label}),s.type==="textarea"?i.jsx("textarea",{id:r,className:"input",rows:2,maxLength:s.maxLength,value:a,onChange:u=>n(u.target.value)}):i.jsx("input",{id:r,className:"input",type:s.type==="url"?"url":"text",maxLength:s.maxLength,value:a,onChange:u=>n(u.target.value)}),i.jsxs("div",{className:"row between",style:{gap:8},children:[i.jsx("span",{children:l}),i.jsxs("span",{className:"muted",style:{fontSize:13},children:[a.length," / ",s.maxLength]})]}),s.type!=="url"&&a!==s.default&&i.jsx("button",{type:"button",className:"link",style:{fontSize:14},onClick:()=>n(s.default),children:"Remettre le texte par défaut"})]})}function Wv({storeId:e,storeName:t,initial:n,onChanged:r}){const[l,s]=j.useState(n),[a,o]=j.useState(n.config),[u,c]=j.useState(!1),[p,g]=j.useState(!1),[m,y]=j.useState(null),[x,w]=j.useState(null),S=`/api/admin/stores/${e}/modules/${l.id}`,f=v=>{s(v),o(v.config)};j.useEffect(()=>{u&&O.get(S).then(f).catch(v=>y(v.message))},[u,S]);async function d(v,N){g(!0),y(null),w(null);try{f(await v()),w(N),r()}catch(E){y(E.message)}finally{g(!1)}}const h=JSON.stringify(a)!==JSON.stringify(l.config);return i.jsxs("section",{className:"card",style:{display:"flex",flexDirection:"column",gap:14},children:[i.jsxs("div",{className:"row between",style:{alignItems:"flex-start",gap:12},children:[i.jsxs("div",{style:{flex:"1 1 320px",display:"flex",gap:14},children:[i.jsx("span",{className:`mod-ic${l.available&&l.config.enabled?" on":""}`,"aria-hidden":"true",children:$v[l.id]??"🧩"}),i.jsxs("div",{children:[i.jsxs("div",{className:"row",style:{gap:10,alignItems:"center"},children:[i.jsx("h2",{style:{margin:0},children:l.name}),i.jsx(Bv,{m:l})]}),i.jsx("p",{className:"muted",style:{margin:"6px 0 0"},children:l.description})]})]}),i.jsxs("div",{className:"row",style:{gap:8},children:[l.available&&i.jsxs("label",{className:"switch",title:l.config.enabled?"Désactiver le module":"Activer le module",children:[i.jsx("input",{type:"checkbox",checked:l.config.enabled,disabled:p,onChange:v=>{const N=v.target.checked;d(()=>O.put(S,{enabled:N}),N?"Module activé.":"Module désactivé.")}}),i.jsx("span",{"aria-hidden":"true"}),i.jsx("span",{className:"sr-only",children:"Module activé"})]}),i.jsx("label",{className:"sr-only",htmlFor:`ov-${l.id}`,children:"Disponibilité du module"}),i.jsxs("select",{id:`ov-${l.id}`,className:"input",style:{width:"auto"},disabled:p,value:l.override===null?"plan":l.override?"add":"remove",onChange:v=>{const N=v.target.value==="plan"?null:v.target.value==="add";d(()=>O.put(`${S}/override`,{value:N}),N===null?"Module remis selon la formule.":N?"Module ajouté sur mesure.":"Module retiré.")},children:[i.jsxs("option",{value:"plan",children:["Selon la formule",l.inPlan?" (inclus)":" (non inclus)"]}),i.jsx("option",{value:"add",children:"Ajouter sur mesure"}),i.jsx("option",{value:"remove",children:"Retirer"})]}),i.jsx("button",{type:"button",className:"btn secondary",onClick:()=>c(!u),"aria-expanded":u,children:u?"Fermer":"Personnaliser"})]})]}),m&&i.jsx("div",{className:"alert error",role:"alert",children:m}),x&&i.jsx("div",{className:"alert ok",role:"status",children:x}),u&&i.jsxs(i.Fragment,{children:[!l.available&&i.jsx("div",{className:"alert warn",children:"Module non disponible pour ce magasin : ajoutez-le sur mesure ou changez de formule pour l'activer. Vous pouvez déjà préparer ses réglages."}),l.stats&&i.jsx("div",{className:"kpis",children:Object.entries(l.stats).map(([v,N])=>i.jsxs("div",{className:"kpi",children:[i.jsx("b",{children:N??"—"}),i.jsx("span",{children:v})]},v))}),[["Réglages",l.fields.filter(v=>!Uu(v)),"mod-grid"],["Messages",l.fields.filter(Uu),"mod-stack"]].map(([v,N,E])=>N.length?i.jsxs("fieldset",{className:"mod-group",children:[i.jsx("legend",{children:v}),i.jsx("div",{className:E,children:N.map(k=>i.jsx(bv,{f:k,value:a[k.key],onChange:C=>o({...a,[k.key]:C})},k.key))})]},v):null),l.id==="stats"&&i.jsx(Ee,{to:"../statistiques",children:"Voir les statistiques du magasin →"}),i.jsxs("div",{className:`row mod-save${h?" dirty":""}`,style:{gap:8,justifyContent:"flex-end"},children:[h&&i.jsx("span",{className:"muted",style:{marginRight:"auto",fontSize:14},children:"Modifications non enregistrées"}),h&&i.jsx("button",{type:"button",className:"btn secondary",disabled:p,onClick:()=>o(l.config),children:"Annuler"}),i.jsx("button",{type:"button",className:"btn",disabled:p||!h,onClick:()=>d(()=>O.put(S,a),"Réglages enregistrés."),children:p?"Enregistrement…":"Enregistrer"})]}),l.id==="campaigns"&&l.available&&l.config.enabled&&i.jsx(Uv,{storeId:e,storeName:t})]})]})}function Vv({storeId:e,storeName:t}){const[n,r]=j.useState(null),[l,s]=j.useState(null),a=j.useCallback(()=>{O.get(`/api/admin/stores/${e}/modules`).then(r).catch(p=>s(p.message))},[e]);if(j.useEffect(a,[a]),!n)return l?i.jsx("div",{className:"alert error",children:l}):i.jsx("p",{className:"muted",children:"Chargement…"});const o=n.filter(p=>p.available&&p.config.enabled).length,u=n.filter(p=>p.available).length,c=n.filter(p=>p.override!==null).length;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"kpis",children:[i.jsxs("div",{className:"kpi ok",children:[i.jsx("b",{children:o}),i.jsx("span",{children:"modules activés"})]}),i.jsxs("div",{className:"kpi",children:[i.jsxs("b",{children:[u," / ",n.length]}),i.jsx("span",{children:"disponibles pour ce magasin"})]}),i.jsxs("div",{className:"kpi",children:[i.jsx("b",{children:c}),i.jsx("span",{children:"ajout(s) ou retrait(s) sur mesure"})]})]}),i.jsx("p",{className:"muted",style:{margin:0},children:"Chaque module est inclus ou non dans la formule ; vous pouvez l’ajouter ou le retirer sur mesure. L’interrupteur l’active d’un clic, « Personnaliser » ouvre tous ses textes et réglages. Le dirigeant peut aussi les régler depuis l’app MonEspacePro."}),n.map(p=>i.jsx(Wv,{storeId:e,storeName:t,initial:p,onChanged:a},p.id))]})}const Hv=[[30,"30 jours"],[90,"3 mois"],[365,"12 mois"]],ri=e=>(e/100).toLocaleString("fr-FR",{style:"currency",currency:"EUR",maximumFractionDigits:e>=1e5?0:2}),sn=e=>e.toLocaleString("fr-FR");function Qv({value:e}){if(e===null)return null;const t=e>=0;return i.jsxs("span",{style:{fontSize:13,fontWeight:700,color:t?"var(--ok)":"var(--err)"},children:[t?"▲":"▼"," ",Math.abs(e).toLocaleString("fr-FR")," %"]})}function Bt({icon:e,label:t,value:n,hint:r,change:l}){return i.jsxs("div",{className:"card",style:{padding:16,display:"flex",flexDirection:"column",gap:4},children:[i.jsxs("span",{className:"muted",style:{fontSize:14,display:"flex",gap:8,alignItems:"center"},children:[i.jsx("span",{"aria-hidden":"true",children:e}),t]}),i.jsx("span",{style:{fontSize:26,fontWeight:800},children:n}),i.jsxs("span",{style:{display:"flex",gap:8,alignItems:"baseline"},children:[l!==void 0&&i.jsx(Qv,{value:l}),r&&i.jsx("span",{className:"muted",style:{fontSize:13},children:r})]})]})}function Kv({series:e}){const t=Math.max(1,...e.map(l=>Math.max(l.visits,l.newCards))),n=100/e.length,r=Math.ceil(e.length/8);return i.jsxs("svg",{viewBox:"0 0 100 46",preserveAspectRatio:"none",style:{width:"100%",height:220},role:"img","aria-label":"Passages et nouvelles cartes sur la période",children:[e.map((l,s)=>i.jsxs("g",{children:[i.jsx("title",{children:`${l.label} : ${l.visits} passage(s), ${l.newCards} nouvelle(s) carte(s)`}),i.jsx("rect",{x:s*n+n*.1,y:40-l.visits/t*38,width:n*.45,height:l.visits/t*38,fill:"var(--primary)"}),i.jsx("rect",{x:s*n+n*.55,y:40-l.newCards/t*38,width:n*.35,height:l.newCards/t*38,fill:"var(--primary-soft)",stroke:"var(--primary)",strokeWidth:.1}),s%r===0&&i.jsx("text",{x:s*n+n/2,y:45,fontSize:2.2,textAnchor:"middle",fill:"currentColor",opacity:.6,children:l.label})]},s)),i.jsx("line",{x1:0,x2:100,y1:40,y2:40,stroke:"var(--border)",strokeWidth:.2})]})}function Yv({heat:e}){const t=Array.from({length:15},(r,l)=>l+7),n=Math.max(1,...e.values.flat());return i.jsx("div",{className:"table-scroll",children:i.jsxs("table",{style:{borderCollapse:"separate",borderSpacing:3,minWidth:560},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{}),t.map(r=>i.jsxs("th",{style:{fontSize:12,fontWeight:500,padding:0,textAlign:"center"},children:[r,"h"]},r))]})}),i.jsx("tbody",{children:e.weekdays.map((r,l)=>i.jsxs("tr",{children:[i.jsx("th",{scope:"row",style:{fontSize:13,fontWeight:600,padding:"0 8px 0 0"},children:r}),t.map(s=>{const a=e.values[l][s];return i.jsx("td",{title:`${r} ${s} h : ${a} passage(s)`,style:{padding:0,height:26,borderRadius:4,background:a?`color-mix(in srgb, var(--primary) ${Math.round(15+a/n*85)}%, transparent)`:"var(--surface-2)"}},s)})]},r))})]})})}function Gv({storeId:e,storeSlug:t}){const[n,r]=j.useState(30),[l,s]=j.useState(null),[a,o]=j.useState(null),[u,c]=j.useState(null);j.useEffect(()=>{o(null),O.get(`/api/admin/stores/${e}/stats?days=${n}`).then(s).catch(y=>o(y.message))},[e,n]);async function p(y){c(y);try{const x=new Date().toISOString().slice(0,10);y==="customers"?await la(`/api/admin/stores/${e}/export/customers`,`clients-${t}-${x}.csv`):await la(`/api/admin/stores/${e}/export/transactions?days=${n}`,`operations-${t}-${n}j-${x}.csv`)}catch(x){o(x.message)}finally{c(null)}}const g=l==null?void 0:l.kpis,m=(l==null?void 0:l.pointsMode)==="STAMP"?"tampons":"points";return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"row between",style:{alignItems:"center"},children:[i.jsx("div",{role:"group","aria-label":"Période",className:"s-seg",children:Hv.map(([y,x])=>i.jsx("button",{type:"button","aria-pressed":n===y,onClick:()=>r(y),children:x},y))}),i.jsxs("div",{className:"row",style:{gap:8},children:[i.jsx("button",{className:"btn secondary",disabled:!!u,onClick:()=>p("customers"),children:u==="customers"?"Export…":"📇 Clients (CSV)"}),i.jsx("button",{className:"btn secondary",disabled:!!u,onClick:()=>p("transactions"),children:u==="transactions"?"Export…":"🧾 Opérations (CSV)"})]})]}),a&&i.jsx("div",{className:"alert error",role:"alert",children:a}),l&&!l.allowed&&i.jsx("div",{className:"alert warn",children:"Ce magasin n'a pas la formule Pro : il ne voit pas ces statistiques dans son app (vous, si)."}),!l||!g?!a&&i.jsx("p",{className:"muted",children:"Chargement…"}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(190px, 1fr))",gap:12},children:[i.jsx(Bt,{icon:"🚶",label:"Passages",value:sn(g.visits),change:g.visitsChange,hint:"vs période précédente"}),i.jsx(Bt,{icon:"🆕",label:"Nouvelles cartes",value:sn(g.newCards),change:g.newCardsChange,hint:`${sn(g.cardsTotal)} au total`}),i.jsx(Bt,{icon:"👥",label:"Clients actifs",value:sn(g.activeCustomers),hint:`${g.visitsPerCustomer.toLocaleString("fr-FR")} passage(s) par client`}),i.jsx(Bt,{icon:"🔁",label:"Clients fidèles",value:g.returningRate===null?"—":`${g.returningRate.toLocaleString("fr-FR")} %`,hint:"venus au moins 2 fois"}),l.pointsMode==="AMOUNT"&&i.jsx(Bt,{icon:"💶",label:"Achats enregistrés",value:ri(g.revenueCents),hint:g.averageBasketCents===null?void 0:`panier moyen ${ri(g.averageBasketCents)}`}),i.jsx(Bt,{icon:"🎁",label:"Récompenses",value:sn(g.rewardsRedeemed),hint:`${sn(g.pointsGiven)} ${m} distribués`}),i.jsx(Bt,{icon:"📱",label:"Cartes dans Apple Wallet",value:g.appleWalletRate===null?"—":`${g.appleWalletRate.toLocaleString("fr-FR")} %`,hint:"iPhone joignables"})]}),i.jsxs("div",{className:"stats-pair",children:[i.jsxs("section",{className:"card",children:[i.jsx("h2",{children:"Fréquentation"}),i.jsxs("p",{className:"muted",style:{marginTop:0,fontSize:14},children:[i.jsx("span",{style:{display:"inline-block",width:10,height:10,background:"var(--primary)",borderRadius:2}})," Passages ",i.jsx("span",{style:{display:"inline-block",width:10,height:10,background:"var(--primary-soft)",border:"1px solid var(--primary)",borderRadius:2}})," Nouvelles cartes"]}),i.jsx(Kv,{series:l.series})]}),i.jsxs("section",{className:"card",children:[i.jsx("h2",{children:"Heures d'affluence"}),i.jsx("p",{className:"muted",style:{marginTop:0},children:l.busiest?`Créneau le plus fréquenté : ${l.busiest}.`:"Pas encore de passage sur la période."}),i.jsx(Yv,{heat:l.heatmap})]})]}),i.jsxs("section",{className:"card",children:[i.jsx("h2",{children:"Meilleurs clients"}),l.top.length===0?i.jsx("p",{className:"muted",style:{margin:0},children:"Pas encore de passage sur la période."}):i.jsx("div",{className:"table-scroll",children:i.jsxs("table",{children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",style:{width:56},children:"Rang"}),i.jsx("th",{scope:"col",children:"Client"}),i.jsx("th",{scope:"col",className:"num",children:"Passages"}),l.pointsMode==="AMOUNT"&&i.jsx("th",{scope:"col",className:"num",children:"Achats"}),i.jsx("th",{scope:"col",className:"num",children:"Solde"})]})}),i.jsx("tbody",{children:l.top.map((y,x)=>i.jsxs("tr",{children:[i.jsx("td",{children:i.jsx("span",{className:`rank${x<3?" top":""}`,children:["🥇","🥈","🥉"][x]??x+1})}),i.jsx("td",{style:{fontWeight:600},children:y.firstName}),i.jsx("td",{className:"num",children:y.visits}),l.pointsMode==="AMOUNT"&&i.jsx("td",{className:"num",children:ri(y.amountCents)}),i.jsx("td",{className:"num",children:y.balance})]},x))})]})})]})]})]})}const qv=[["infos","Infos"],["carte","Carte de fidélité"],["employes","Employés"],["modules","Modules"],["statistiques","Statistiques"],["facturation","Facturation"]];function Jv(){var c,p,g;const{id:e}=df(),[t,n]=j.useState(null),[r,l]=j.useState(null),[s,a]=j.useState(null),o=j.useCallback(()=>{O.get(`/api/admin/stores/${e}`).then(n).catch(m=>l(m.message))},[e]);j.useEffect(o,[o]);async function u(m,y){if(!(y&&!window.confirm(y))){l(null);try{await O.patch(`/api/admin/stores/${e}/status`,{status:m}),o()}catch(x){l(x.message)}}}return t?i.jsxs(i.Fragment,{children:[i.jsx(Ee,{to:"/magasins",children:"← Magasins"}),i.jsxs("section",{className:"card store-head",children:[i.jsxs("div",{className:"store-id",children:[i.jsx("span",{className:"store-avatar","aria-hidden":"true",children:t.name.charAt(0).toUpperCase()}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[i.jsxs("div",{className:"row",style:{gap:12},children:[i.jsx("h1",{style:{fontSize:28,lineHeight:"34px"},children:t.name}),i.jsx(yf,{status:t.status}),((c=t.subscription)==null?void 0:c.stripeSubscriptionId)&&t.subscription.status!=="CANCELED"&&i.jsx(xl,{to:"facturation",className:"badge DRAFT",style:{textDecoration:"none"},title:"Formule d'abonnement",children:qe[t.subscription.plan]})]}),i.jsxs("p",{className:"muted",style:{margin:0},children:[t.city," · ",t.counts.cards," clients · ",t.counts.staff," employés · ",t.contactName]}),i.jsxs("ul",{className:"open-steps","aria-label":"Étapes d’ouverture",children:[i.jsxs("li",{className:((p=t.subscription)==null?void 0:p.status)==="ACTIVE"?"done":"",children:[((g=t.subscription)==null?void 0:g.status)==="ACTIVE"?"✓":"○"," Abonnement payé"]}),i.jsxs("li",{className:t.hasCard?"done":"",children:[t.hasCard?"✓":"○"," Carte conçue"]}),i.jsxs("li",{className:t.status==="ACTIVE"?"done":"",children:[t.status==="ACTIVE"?"✓":"○"," Programme ouvert"]})]})]})]}),i.jsxs("div",{className:"row",style:{gap:8},children:[(t.status==="DRAFT"||t.status==="CLOSED")&&i.jsx("button",{className:"btn",onClick:()=>u("ACTIVE"),children:"Activer"}),t.status==="SUSPENDED"&&i.jsx("button",{className:"btn",onClick:()=>u("ACTIVE"),children:"Réactiver"}),t.status==="ACTIVE"&&i.jsx("button",{className:"btn secondary",onClick:()=>u("SUSPENDED","Suspendre ce magasin ? Les employés ne pourront plus scanner."),children:"Suspendre"}),t.status!=="CLOSED"&&i.jsx("button",{className:"btn secondary",onClick:()=>u("CLOSED","Fermer ce magasin ?"),children:"Fermer"})]}),i.jsxs("div",{className:"copy-line",style:{flexBasis:"100%"},children:[i.jsx("span",{className:"muted",children:"Lien d’inscription :"}),i.jsx("code",{children:t.enrollUrl}),i.jsx("button",{type:"button",className:"btn secondary small",onClick:()=>{var m;return(m=navigator.clipboard)==null?void 0:m.writeText(t.enrollUrl).then(()=>a("Lien copié."))},children:"Copier"})]})]}),t.status==="SUSPENDED"&&i.jsxs("div",{className:"alert warn",role:"status",children:["Magasin suspendu",t.billingSuspended?" pour impayé":""," : les scans et les nouvelles inscriptions sont refusés.",t.billingSuspended&&i.jsxs(i.Fragment,{children:[" Voir l'onglet ",i.jsx(xl,{to:"facturation",children:"Facturation"}),"."]})]}),r&&i.jsx("div",{className:"alert error",role:"alert",children:r}),s&&i.jsx("div",{className:"alert ok",role:"status",children:s}),i.jsx("nav",{className:"tabs","aria-label":"Sections du magasin",children:qv.map(([m,y])=>i.jsx(xl,{to:m,children:y},m))}),i.jsxs(Xi,{children:[i.jsx(q,{index:!0,element:i.jsx(yl,{to:"infos",replace:!0})}),i.jsx(q,{path:"infos",element:i.jsx(xf,{initial:t,submitLabel:"Enregistrer",onSubmit:async m=>{const{name:y,siret:x,addressLine:w,postalCode:S,city:f,contactName:d,contactEmail:h,contactPhone:v,maxAmountEuros:N,minScanIntervalMin:E}=m;await O.patch(`/api/admin/stores/${e}`,{name:y,siret:x,addressLine:w,postalCode:S,city:f,contactName:d,contactEmail:h,contactPhone:v,maxAmountEuros:N,minScanIntervalMin:E}),a("Modifications enregistrées."),o()}},t.id)}),i.jsx(q,{path:"carte",element:i.jsx(Bf,{store:t,onSaved:o})}),i.jsx(q,{path:"employes",element:i.jsx(Iv,{storeId:t.id})}),i.jsx(q,{path:"modules",element:i.jsx(Vv,{storeId:t.id,storeName:t.name})}),i.jsx(q,{path:"statistiques",element:i.jsx(Gv,{storeId:t.id,storeSlug:t.slug})}),i.jsx(q,{path:"facturation",element:i.jsx(Ov,{storeId:t.id,contactEmail:t.contactEmail,onChange:o})})]})]}):r?i.jsx("div",{className:"alert error",children:r}):i.jsx("p",{className:"muted",children:"Chargement…"})}function $u({merchant:e=!1}){const{id:t}=df(),n=e?"/api/staff/store":`/api/admin/stores/${t}`,r=e?"/api/staff/card-design":`/api/admin/stores/${t}/card-design`,[l,s]=io(),a=l.get("format")==="A6"?"A6":"A5",[o,u]=j.useState(null),[c,p]=j.useState(null),[g,m]=j.useState(null);return j.useEffect(()=>{Promise.all([O.get(n),O.get(r)]).then(([y,x])=>{u(y),p(x)}).catch(y=>m(y.message))},[n,r]),g?i.jsx("div",{className:"alert error",style:{margin:24},children:g}):o?c?i.jsxs("div",{className:"poster-page",children:[i.jsx("style",{children:`@page{size:${a};margin:0}@media print{.no-print{display:none!important}body{background:#fff}.poster-page{padding:0!important}}`}),i.jsxs("div",{className:"no-print row between",style:{padding:16},children:[i.jsx(Ee,{to:e?"/espace":`/magasins/${t}/carte`,children:"← Retour à la carte"}),i.jsxs("div",{className:"row",style:{gap:8},children:[["A5","A6"].map(y=>i.jsx("button",{type:"button",className:"chip","aria-pressed":a===y,onClick:()=>s({format:y}),children:y},y)),i.jsx("button",{type:"button",className:"btn",onClick:()=>window.print(),children:"Imprimer"})]})]}),o.status!=="ACTIVE"&&i.jsx("div",{className:"alert warn no-print",style:{margin:"0 16px 16px"},children:"Le magasin n'est pas actif : le QR mène pour l'instant à une page « introuvable » ou « indisponible »."}),i.jsx("div",{style:{display:"flex",justifyContent:"center",padding:16},className:"poster-page",children:i.jsx(Of,{format:a,url:o.enrollUrl,storeName:o.name,programName:c.programName,logoUrl:na(c.logoUrl),backgroundColor:c.backgroundColor,foregroundColor:c.foregroundColor,labelColor:c.labelColor,rewards:c.rewards,pointsMode:c.pointsMode})}),i.jsx("p",{className:"no-print muted",style:{textAlign:"center"},children:o.enrollUrl})]}):i.jsx("div",{className:"alert warn",style:{margin:24},children:"Concevez d'abord la carte de fidélité."}):i.jsx("p",{className:"muted",style:{margin:24},children:"Chargement…"})}const Bu=e=>(e/100).toLocaleString("fr-FR",{style:"currency",currency:"EUR",minimumFractionDigits:e%100?2:0}),bu=["ESSENTIEL","PRO","RESEAU"],Xv=[["name","Nom du commerce",{autoComplete:"organization",placeholder:"Boulangerie Kerlann",maxLength:120}],["siret","SIRET",{inputMode:"numeric",placeholder:"123 456 789 00012"}],["addressLine","Adresse",{autoComplete:"street-address",maxLength:200}],["postalCode","Code postal",{autoComplete:"postal-code",inputMode:"numeric",maxLength:5}],["city","Ville",{autoComplete:"address-level2",maxLength:120}],["contactName","Prénom et nom",{autoComplete:"name",maxLength:120}],["contactPhone","Téléphone",{autoComplete:"tel",type:"tel"}],["contactEmail","E-mail (votre identifiant de connexion)",{autoComplete:"email",type:"email"}]];function Zv(){const[e]=io(),t=(e.get("formule")??"").toUpperCase(),[n,r]=j.useState(bu.includes(t)?t:"PRO"),[l,s]=j.useState(e.get("periode")==="annuel"?"YEAR":"MONTH"),[a,o]=j.useState([]),[u,c]=j.useState({name:"",siret:"",addressLine:"",postalCode:"",city:"",contactName:"",contactPhone:"",contactEmail:"",password:""}),[p,g]=j.useState(!1),[m,y]=j.useState(e.get("annule")?"Paiement annulé : rien n’a été prélevé. Vous pouvez reprendre quand vous voulez.":null),[x,w]=j.useState(!1);j.useEffect(()=>{const v=N=>N.persisted&&w(!1);return window.addEventListener("pageshow",v),()=>window.removeEventListener("pageshow",v)},[]),j.useEffect(()=>{ra.get("/api/public/signup/plans").then(o).catch(()=>{})},[]);async function S(v){v.preventDefault(),w(!0),y(null);try{const{url:N}=await ra.post("/api/public/signup",{...u,plan:n,interval:l,cgv:p});window.location.assign(N)}catch(N){y(N.message),w(!1),window.scrollTo({top:0,behavior:"smooth"})}}const f=a.find(v=>v.plan===n),d=a.length?a:bu.map(v=>({plan:v,name:qe[v],tagline:"",priceCents:{MONTH:0,YEAR:0},modules:[],limits:{maxStaff:null}})),h=v=>{const[,N,E]=Xv.find(([k])=>k===v);return i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:`s-${v}`,children:N}),i.jsx("input",{id:`s-${v}`,className:"input",required:!0,value:u[v],onChange:k=>c({...u,[v]:k.target.value}),...E})]},v)};return i.jsxs("main",{className:"s-page",children:[i.jsxs("header",{className:"s-head",children:[i.jsx("a",{href:"https://monespacepro.eu/",style:{textDecoration:"none",color:"inherit"},"aria-label":"MonEspacePro, accueil",children:i.jsx(Fr,{admin:!1})}),i.jsxs("span",{className:"muted",style:{fontSize:14},children:["Déjà inscrit ? ",i.jsx(Ee,{to:"/espace",children:"Se connecter"})]})]}),i.jsxs("form",{onSubmit:S,className:"s-layout",children:[i.jsxs("div",{className:"s-main",children:[i.jsxs("div",{children:[i.jsx("h1",{children:"Créer mon programme de fidélité"}),i.jsx("p",{className:"muted",style:{margin:"6px 0 0"},children:"Trois minutes, sans engagement. Votre espace est prêt dès le paiement validé."})]}),m&&i.jsx("div",{className:"alert error",role:"alert",children:m}),i.jsxs("section",{className:"card s-section",children:[i.jsxs("div",{className:"s-title",children:[i.jsx("span",{className:"s-num",children:"1"}),i.jsx("h2",{children:"Votre formule"})]}),i.jsxs("div",{role:"group","aria-label":"Périodicité",className:"s-seg",children:[i.jsx("button",{type:"button","aria-pressed":l==="MONTH",onClick:()=>s("MONTH"),children:"Mensuel"}),i.jsx("button",{type:"button","aria-pressed":l==="YEAR",onClick:()=>s("YEAR"),children:"Annuel · 2 mois offerts"})]}),i.jsx("div",{className:"s-plans",role:"radiogroup","aria-label":"Formule",children:d.map(v=>i.jsxs("label",{className:`s-plan${n===v.plan?" on":""}`,children:[i.jsx("input",{type:"radio",name:"plan",className:"sr-only",checked:n===v.plan,onChange:()=>r(v.plan)}),v.plan==="PRO"&&i.jsx("span",{className:"s-tag",children:"Conseillée"}),i.jsx("strong",{children:v.name}),v.priceCents[l]>0&&i.jsxs("span",{className:"s-price",children:[Bu(v.priceCents[l]),i.jsxs("small",{children:[" / ",l==="YEAR"?"an":"mois"]})]}),i.jsx("span",{className:"muted",style:{fontSize:14},children:v.tagline})]},v.plan))})]}),i.jsxs("section",{className:"card s-section",children:[i.jsxs("div",{className:"s-title",children:[i.jsx("span",{className:"s-num",children:"2"}),i.jsx("h2",{children:"Votre commerce"})]}),h("name"),h("siret"),h("addressLine"),i.jsxs("div",{className:"s-two",children:[h("postalCode"),h("city")]})]}),i.jsxs("section",{className:"card s-section",children:[i.jsxs("div",{className:"s-title",children:[i.jsx("span",{className:"s-num",children:"3"}),i.jsx("h2",{children:"Vos identifiants"})]}),i.jsxs("div",{className:"s-two",children:[h("contactName"),h("contactPhone")]}),h("contactEmail"),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"s-password",children:"Mot de passe"}),i.jsx("input",{id:"s-password",className:"input",type:"password",required:!0,minLength:10,autoComplete:"new-password",value:u.password,onChange:v=>c({...u,password:v.target.value})}),i.jsx("span",{className:"muted",style:{fontSize:14},children:"10 caractères minimum. Il ouvre votre espace web et l’app MonEspacePro."})]})]})]}),i.jsx("aside",{className:"s-side",children:i.jsxs("section",{className:"card s-summary",children:[i.jsx("span",{className:"muted",style:{fontSize:13,textTransform:"uppercase",letterSpacing:".05em"},children:"Récapitulatif"}),i.jsxs("div",{className:"row between",style:{alignItems:"baseline"},children:[i.jsxs("strong",{style:{fontSize:20},children:["Formule ",(f==null?void 0:f.name)??qe[n]]}),f&&i.jsxs("span",{style:{fontSize:22,fontWeight:800},children:[Bu(f.priceCents[l]),i.jsxs("span",{className:"muted",style:{fontSize:14,fontWeight:500},children:[" / ",l==="YEAR"?"an":"mois"]})]})]}),f&&i.jsxs("ul",{className:"s-list",children:[i.jsx("li",{children:"Carte dans Apple Wallet et Google Wallet"}),i.jsx("li",{children:f.limits.maxStaff?`${f.limits.maxStaff} employés`:"Employés illimités"}),f.modules.map(v=>i.jsx("li",{children:v.name},v.id))]}),i.jsxs("label",{className:"row",style:{gap:10,alignItems:"flex-start",flexWrap:"nowrap",fontSize:14},children:[i.jsx("input",{type:"checkbox",required:!0,checked:p,onChange:v=>g(v.target.checked),style:{marginTop:3}}),i.jsxs("span",{children:["J’accepte les ",i.jsx("a",{href:"https://monespacepro.eu/cgv/",target:"_blank",rel:"noreferrer",children:"CGV"})," et la"," ",i.jsx("a",{href:"https://monespacepro.eu/confidentialite/",target:"_blank",rel:"noreferrer",children:"politique de confidentialité"}),"."]})]}),i.jsx("button",{className:"btn",disabled:x,style:{width:"100%"},children:x?"Redirection vers le paiement…":"Continuer vers le paiement"}),i.jsxs("ul",{className:"s-trust",children:[i.jsx("li",{children:"🔒 Paiement sécurisé par Stripe"}),i.jsx("li",{children:"💳 Carte bancaire ou prélèvement SEPA"}),i.jsx("li",{children:"↩︎ Sans engagement, résiliable à tout moment"})]})]})})]})]})}function ey({onLogin:e}){const t=Dt(),[n]=io(),r=n.has("bienvenue"),[l,s]=j.useState(""),[a,o]=j.useState(""),[u,c]=j.useState(null),[p,g]=j.useState(!1);async function m(y){y.preventDefault(),g(!0),c(null);try{await Eg(l,a),e(),t("/espace",{replace:!0})}catch(x){c(r&&x instanceof gs&&x.status===401?"Votre espace est en cours de création. Réessayez dans quelques secondes.":x.message)}finally{g(!1)}}return i.jsx("main",{style:{minHeight:"100vh",display:"grid",placeItems:"center",padding:16},children:i.jsxs("form",{className:"card",onSubmit:m,style:{width:"100%",maxWidth:420,display:"flex",flexDirection:"column",gap:20},children:[i.jsx(Fr,{admin:!1}),r&&i.jsx("div",{className:"alert ok",children:"Paiement reçu, merci ! Connectez-vous avec l’e-mail et le mot de passe choisis à l’inscription."}),i.jsxs("div",{children:[i.jsx("h1",{style:{fontSize:26},children:"Mon espace"}),i.jsx("p",{className:"muted",style:{margin:0},children:"Mêmes identifiants que l’app MonEspacePro."})]}),u&&i.jsx("div",{className:"alert error",role:"alert",children:u}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"m-email",children:"E-mail"}),i.jsx("input",{id:"m-email",className:"input",type:"email",autoComplete:"username",required:!0,value:l,onChange:y=>s(y.target.value)})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"m-password",children:"Mot de passe"}),i.jsx("input",{id:"m-password",className:"input",type:"password",autoComplete:"current-password",required:!0,value:a,onChange:y=>o(y.target.value)})]}),i.jsx("button",{className:"btn",disabled:p,children:p?"Connexion…":"Se connecter"}),i.jsxs("p",{className:"muted",style:{margin:0,fontSize:14,textAlign:"center"},children:["Pas encore client ? ",i.jsx(Ee,{to:"/inscription",children:"Créer mon programme"})]})]})})}function ty(){const[e,t]=j.useState(null),[n,r]=j.useState(null),[l,s]=j.useState(!1),[a,o]=j.useState(null),u=j.useCallback(()=>{O.get("/api/staff/store").then(t).catch(x=>r(x instanceof gs&&x.status===403?"Cet espace est réservé au Dirigeant du magasin. Utilisez l’app MonEspacePro pour scanner les cartes.":x.message)),O.get("/api/staff/card-design").then(x=>o(!!x)).catch(()=>o(null))},[]);j.useEffect(u,[u]);function c(x){var w;(w=navigator.clipboard)==null||w.writeText(x).then(()=>{s(!0),setTimeout(()=>s(!1),2e3)})}const p=!!e&&!e.subscribeUrl,g=(e==null?void 0:e.status)==="ACTIVE",m=[["Abonnement",p?`Formule ${e!=null&&e.subscription?qe[e.subscription.plan]:""} active`:"En attente du paiement",p],["Carte de fidélité",a?"Conçue":"Logo, couleurs, récompenses",!!a],["Programme ouvert",g?"Vos clients peuvent s’inscrire":"S’ouvre automatiquement",g]],y=m.findIndex(([,,x])=>!x);return i.jsxs("div",{style:{minHeight:"100vh"},children:[i.jsxs("header",{className:"m-top",children:[i.jsx(Fr,{admin:!1}),i.jsx("span",{className:"grow"}),e&&i.jsx("span",{className:"muted",style:{fontSize:14},children:e.name}),e&&i.jsx("span",{className:"m-avatar","aria-hidden":"true",children:e.name.charAt(0).toUpperCase()}),i.jsx("button",{type:"button",className:"btn secondary small",onClick:uo,children:"Se déconnecter"})]}),i.jsxs("main",{className:"container",style:{padding:24,display:"flex",flexDirection:"column",gap:24},children:[n&&i.jsx("div",{className:"alert error",role:"alert",children:n}),!e&&!n&&i.jsx("p",{className:"muted",children:"Chargement…"}),e&&i.jsxs(i.Fragment,{children:[i.jsxs("section",{className:"m-hero",children:[i.jsxs("div",{children:[i.jsx("h1",{children:e.name}),i.jsxs("p",{children:[e.subscription?`Formule ${qe[e.subscription.plan]}`:"Aucune formule"," ·"," ",g?"programme ouvert à vos clients":e.status==="SUSPENDED"?"programme suspendu":"programme pas encore ouvert"]})]}),e.subscribeUrl&&i.jsx("a",{className:"btn",href:e.subscribeUrl,children:"Activer mon abonnement"})]}),e.status==="SUSPENDED"&&i.jsx("div",{className:"alert warn",children:"Programme suspendu. Il rouvre automatiquement dès le paiement de l’abonnement régularisé."}),i.jsx("ol",{className:"m-steps","aria-label":"Étapes d’ouverture",children:m.map(([x,w,S],f)=>i.jsxs("li",{className:`m-step${S?" done":""}${f===y?" current":""}`,"aria-current":f===y?"step":void 0,children:[i.jsx("span",{className:"dot",children:S?"✓":f+1}),i.jsxs("div",{children:[i.jsx("strong",{children:x}),i.jsx("span",{children:w})]})]},x))}),i.jsxs("div",{className:"m-grid",children:[i.jsxs("section",{className:"card m-tile",children:[i.jsx("span",{className:"ico","aria-hidden":"true",children:"🔗"}),i.jsx("h2",{children:"Lien d’inscription"}),i.jsx("p",{className:"muted",style:{margin:0,fontSize:14},children:"Vos clients s’inscrivent ici (c’est le QR code de l’affichette)."}),i.jsxs("div",{className:"m-copy",children:[i.jsx("code",{children:e.enrollUrl}),i.jsx("button",{type:"button",className:"btn secondary small",onClick:()=>c(e.enrollUrl),children:l?"Copié ✓":"Copier"})]})]}),i.jsxs("section",{className:"card m-tile",children:[i.jsx("span",{className:"ico","aria-hidden":"true",children:"🖨️"}),i.jsx("h2",{children:"Affichette du comptoir"}),i.jsx("p",{className:"muted",style:{margin:0,fontSize:14},children:"À imprimer en A5 ou A6 et à poser près de la caisse."}),i.jsx("div",{children:a?i.jsx(Ee,{className:"btn secondary",to:"/espace/affichette",children:"Imprimer l’affichette"}):i.jsx("span",{className:"muted",style:{fontSize:14},children:"Disponible une fois la carte conçue."})})]}),i.jsxs("section",{className:"card m-tile",children:[i.jsx("span",{className:"ico","aria-hidden":"true",children:"📱"}),i.jsx("h2",{children:"App MonEspacePro"}),i.jsx("p",{className:"muted",style:{margin:0,fontSize:14},children:"Scan des cartes, employés, modules (campagnes, anniversaire, relances…) et statistiques : avec les mêmes identifiants."})]})]}),i.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:12},children:[i.jsx("h2",{children:"Ma carte de fidélité"}),i.jsx(Bf,{store:e,onSaved:u,base:"/api/staff/card-design",posterHref:"/espace/affichette",draftNote:i.jsx("p",{style:{margin:0},children:e.subscribeUrl?"Votre programme s’ouvrira automatiquement dès votre abonnement activé.":"Enregistrez la carte : votre programme s’ouvre automatiquement à vos clients."})})]})]})]})]})}function ny(){const e=Dt(),t=Ft(),[n,r]=j.useState(Ng()),l=t.pathname.startsWith("/espace");j.useEffect(()=>{Sg(()=>{r(null),e(l?"/espace":"/connexion")})},[e,l]);const s=i.jsx(ey,{onLogin:()=>r("staff")});return n!=="admin"||t.pathname==="/inscription"?i.jsxs(Xi,{children:[i.jsx(q,{path:"/inscription",element:i.jsx(Zv,{})}),n==="staff"?i.jsxs(i.Fragment,{children:[i.jsx(q,{path:"/espace/affichette",element:i.jsx($u,{merchant:!0})}),i.jsx(q,{path:"/espace",element:i.jsx(ty,{})}),i.jsx(q,{path:"*",element:i.jsx(yl,{to:"/espace",replace:!0})})]}):i.jsxs(i.Fragment,{children:[i.jsx(q,{path:"/espace",element:s}),i.jsx(q,{path:"/connexion",element:i.jsx(Rg,{onLogin:()=>r("admin")})}),i.jsx(q,{path:"*",element:i.jsx(yl,{to:l?"/espace":"/connexion",replace:!0})})]})]}):i.jsxs(Xi,{children:[i.jsx(q,{path:"/espace",element:s}),i.jsx(q,{path:"/magasins/:id/affichette",element:i.jsx($u,{})}),i.jsxs(q,{element:i.jsx(Pg,{}),children:[i.jsx(q,{path:"/magasins",element:i.jsx(_g,{})}),i.jsx(q,{path:"/magasins/nouveau",element:i.jsx(Dg,{})}),i.jsx(q,{path:"/magasins/:id/*",element:i.jsx(Jv,{})})]}),i.jsx(q,{path:"*",element:i.jsx(yl,{to:"/magasins",replace:!0})})]})}tf(document.getElementById("root")).render(i.jsx(j.StrictMode,{children:i.jsx(gg,{future:{v7_startTransition:!0},children:i.jsx(ny,{})})}));
|