function _v(i,c){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&s(m)}).observe(document,{childList:!0,subtree:!0});function r(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function s(o){if(o.ep)return;o.ep=!0;const d=r(o);fetch(o.href,d)}})();function zv(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var er={exports:{}},Qa={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Uh;function Cv(){if(Uh)return Qa;Uh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function r(s,o,d){var m=null;if(d!==void 0&&(m=""+d),o.key!==void 0&&(m=""+o.key),"key"in o){d={};for(var v in o)v!=="key"&&(d[v]=o[v])}else d=o;return o=d.ref,{$$typeof:i,type:s,key:m,ref:o!==void 0?o:null,props:d}}return Qa.Fragment=c,Qa.jsx=r,Qa.jsxs=r,Qa}var Mh;function jv(){return Mh||(Mh=1,er.exports=Cv()),er.exports}var T=jv(),lr={exports:{}},lt={};/** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Dh;function Uv(){if(Dh)return lt;Dh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),Y=Symbol.iterator;function X(S){return S===null||typeof S!="object"?null:(S=Y&&S[Y]||S["@@iterator"],typeof S=="function"?S:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,U={};function Z(S,H,Q){this.props=S,this.context=H,this.refs=U,this.updater=Q||x}Z.prototype.isReactComponent={},Z.prototype.setState=function(S,H){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,H,"setState")},Z.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function F(){}F.prototype=Z.prototype;function w(S,H,Q){this.props=S,this.context=H,this.refs=U,this.updater=Q||x}var J=w.prototype=new F;J.constructor=w,D(J,Z.prototype),J.isPureReactComponent=!0;var st=Array.isArray;function Ot(){}var P={H:null,A:null,T:null,S:null},_t=Object.prototype.hasOwnProperty;function Vt(S,H,Q){var V=Q.ref;return{$$typeof:i,type:S,key:H,ref:V!==void 0?V:null,props:Q}}function de(S,H){return Vt(S.type,H,S.props)}function It(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function Yt(S){var H={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(Q){return H[Q]})}var he=/\/+/g;function Zt(S,H){return typeof S=="object"&&S!==null&&S.key!=null?Yt(""+S.key):H.toString(36)}function le(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(Ot,Ot):(S.status="pending",S.then(function(H){S.status==="pending"&&(S.status="fulfilled",S.value=H)},function(H){S.status==="pending"&&(S.status="rejected",S.reason=H)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function j(S,H,Q,V,et){var ut=typeof S;(ut==="undefined"||ut==="boolean")&&(S=null);var vt=!1;if(S===null)vt=!0;else switch(ut){case"bigint":case"string":case"number":vt=!0;break;case"object":switch(S.$$typeof){case i:case c:vt=!0;break;case E:return vt=S._init,j(vt(S._payload),H,Q,V,et)}}if(vt)return et=et(S),vt=V===""?"."+Zt(S,0):V,st(et)?(Q="",vt!=null&&(Q=vt.replace(he,"$&/")+"/"),j(et,H,Q,"",function(Fn){return Fn})):et!=null&&(It(et)&&(et=de(et,Q+(et.key==null||S&&S.key===et.key?"":(""+et.key).replace(he,"$&/")+"/")+vt)),H.push(et)),1;vt=0;var te=V===""?".":V+":";if(st(S))for(var Ut=0;Ut>>1,pt=j[mt];if(0>>1;mto(Q,W))Vo(et,Q)?(j[mt]=et,j[V]=W,mt=V):(j[mt]=Q,j[H]=W,mt=H);else if(Vo(et,W))j[mt]=et,j[V]=W,mt=V;else break t}}return G}function o(j,G){var W=j.sortIndex-G.sortIndex;return W!==0?W:j.id-G.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;i.unstable_now=function(){return d.now()}}else{var m=Date,v=m.now();i.unstable_now=function(){return m.now()-v}}var p=[],y=[],E=1,A=null,Y=3,X=!1,x=!1,D=!1,U=!1,Z=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function J(j){for(var G=r(y);G!==null;){if(G.callback===null)s(y);else if(G.startTime<=j)s(y),G.sortIndex=G.expirationTime,c(p,G);else break;G=r(y)}}function st(j){if(D=!1,J(j),!x)if(r(p)!==null)x=!0,Ot||(Ot=!0,Yt());else{var G=r(y);G!==null&&le(st,G.startTime-j)}}var Ot=!1,P=-1,_t=5,Vt=-1;function de(){return U?!0:!(i.unstable_now()-Vt<_t)}function It(){if(U=!1,Ot){var j=i.unstable_now();Vt=j;var G=!0;try{t:{x=!1,D&&(D=!1,F(P),P=-1),X=!0;var W=Y;try{e:{for(J(j),A=r(p);A!==null&&!(A.expirationTime>j&&de());){var mt=A.callback;if(typeof mt=="function"){A.callback=null,Y=A.priorityLevel;var pt=mt(A.expirationTime<=j);if(j=i.unstable_now(),typeof pt=="function"){A.callback=pt,J(j),G=!0;break e}A===r(p)&&s(p),J(j)}else s(p);A=r(p)}if(A!==null)G=!0;else{var S=r(y);S!==null&&le(st,S.startTime-j),G=!1}}break t}finally{A=null,Y=W,X=!1}G=void 0}}finally{G?Yt():Ot=!1}}}var Yt;if(typeof w=="function")Yt=function(){w(It)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,Zt=he.port2;he.port1.onmessage=It,Yt=function(){Zt.postMessage(null)}}else Yt=function(){Z(It,0)};function le(j,G){P=Z(function(){j(i.unstable_now())},G)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(j){j.callback=null},i.unstable_forceFrameRate=function(j){0>j||125mt?(j.sortIndex=W,c(y,j),r(p)===null&&j===r(y)&&(D?(F(P),P=-1):D=!0,le(st,W-mt))):(j.sortIndex=pt,c(p,j),x||X||(x=!0,Ot||(Ot=!0,Yt()))),j},i.unstable_shouldYield=de,i.unstable_wrapCallback=function(j){var G=Y;return function(){var W=Y;Y=G;try{return j.apply(this,arguments)}finally{Y=W}}}})(ur)),ur}var Hh;function qv(){return Hh||(Hh=1,ar.exports=Bv()),ar.exports}var ir={exports:{}},$t={};/** * @license React * react-dom.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Lh;function Hv(){if(Lh)return $t;Lh=1;var i=Er();function c(p){var y="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),ir.exports=Hv(),ir.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Yh;function Lv(){if(Yh)return Xa;Yh=1;var i=qv(),c=Er(),r=ym();function s(t){var e="https://react.dev/errors/"+t;if(1pt||(t.current=mt[pt],mt[pt]=null,pt--)}function Q(t,e){pt++,mt[pt]=t.current,t.current=e}var V=S(null),et=S(null),ut=S(null),vt=S(null);function te(t,e){switch(Q(ut,e),Q(et,t),Q(V,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?eh(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=eh(e),t=lh(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(V),Q(V,t)}function Ut(){H(V),H(et),H(ut)}function Fn(t){t.memoizedState!==null&&Q(vt,t);var e=V.current,l=lh(e,t.type);e!==l&&(Q(et,t),Q(V,l))}function eu(t){et.current===t&&(H(V),H(et)),vt.current===t&&(H(vt),La._currentValue=W)}var Hi,zr;function ql(t){if(Hi===void 0)try{throw Error()}catch(l){var e=l.stack.trim().match(/\n( *(at )?)/);Hi=e&&e[1]||"",zr=-1)":-1a||g[n]!==N[a]){var M=` `+g[n].replace(" at new "," at ");return t.displayName&&M.includes("")&&(M=M.replace("",t.displayName)),M}while(1<=n&&0<=a);break}}}finally{Li=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?ql(l):""}function uy(t,e){switch(t.tag){case 26:case 27:case 5:return ql(t.type);case 16:return ql("Lazy");case 13:return t.child!==e&&e!==null?ql("Suspense Fallback"):ql("Suspense");case 19:return ql("SuspenseList");case 0:case 15:return wi(t.type,!1);case 11:return wi(t.type.render,!1);case 1:return wi(t.type,!0);case 31:return ql("Activity");default:return""}}function Cr(t){try{var e="",l=null;do e+=uy(t,l),l=t,t=t.return;while(t);return e}catch(n){return` Error generating stack: `+n.message+` `+n.stack}}var Yi=Object.prototype.hasOwnProperty,Gi=i.unstable_scheduleCallback,Qi=i.unstable_cancelCallback,iy=i.unstable_shouldYield,cy=i.unstable_requestPaint,me=i.unstable_now,sy=i.unstable_getCurrentPriorityLevel,jr=i.unstable_ImmediatePriority,Ur=i.unstable_UserBlockingPriority,lu=i.unstable_NormalPriority,ry=i.unstable_LowPriority,Mr=i.unstable_IdlePriority,fy=i.log,oy=i.unstable_setDisableYieldValue,Wn=null,ye=null;function sl(t){if(typeof fy=="function"&&oy(t),ye&&typeof ye.setStrictMode=="function")try{ye.setStrictMode(Wn,t)}catch{}}var ve=Math.clz32?Math.clz32:my,dy=Math.log,hy=Math.LN2;function my(t){return t>>>=0,t===0?32:31-(dy(t)/hy|0)|0}var nu=256,au=262144,uu=4194304;function Hl(t){var e=t&42;if(e!==0)return e;switch(t&-t){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function iu(t,e,l){var n=t.pendingLanes;if(n===0)return 0;var a=0,u=t.suspendedLanes,f=t.pingedLanes;t=t.warmLanes;var h=n&134217727;return h!==0?(n=h&~u,n!==0?a=Hl(n):(f&=h,f!==0?a=Hl(f):l||(l=h&~t,l!==0&&(a=Hl(l))))):(h=n&~u,h!==0?a=Hl(h):f!==0?a=Hl(f):l||(l=n&~t,l!==0&&(a=Hl(l)))),a===0?0:e!==0&&e!==a&&(e&u)===0&&(u=a&-a,l=e&-e,u>=l||u===32&&(l&4194048)!==0)?e:a}function $n(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function yy(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32: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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Dr(){var t=uu;return uu<<=1,(uu&62914560)===0&&(uu=4194304),t}function Xi(t){for(var e=[],l=0;31>l;l++)e.push(t);return e}function Pn(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function vy(t,e,l,n,a,u){var f=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var h=t.entanglements,g=t.expirationTimes,N=t.hiddenUpdates;for(l=f&~l;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Ty=/[\n"\\]/g;function xe(t){return t.replace(Ty,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Fi(t,e,l,n,a,u,f,h){t.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?t.type=f:t.removeAttribute("type"),e!=null?f==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Oe(e)):t.value!==""+Oe(e)&&(t.value=""+Oe(e)):f!=="submit"&&f!=="reset"||t.removeAttribute("value"),e!=null?Wi(t,f,Oe(e)):l!=null?Wi(t,f,Oe(l)):n!=null&&t.removeAttribute("value"),a==null&&u!=null&&(t.defaultChecked=!!u),a!=null&&(t.checked=a&&typeof a!="function"&&typeof a!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+Oe(h):t.removeAttribute("name")}function Jr(t,e,l,n,a,u,f,h){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),e!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||e!=null)){ki(t);return}l=l!=null?""+Oe(l):"",e=e!=null?""+Oe(e):l,h||e===t.value||(t.value=e),t.defaultValue=e}n=n??a,n=typeof n!="function"&&typeof n!="symbol"&&!!n,t.checked=h?t.checked:!!n,t.defaultChecked=!!n,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(t.name=f),ki(t)}function Wi(t,e,l){e==="number"&&ru(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function on(t,e,l,n){if(t=t.options,e){e={};for(var a=0;a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ec=!1;if(Ze)try{var la={};Object.defineProperty(la,"passive",{get:function(){ec=!0}}),window.addEventListener("test",la,la),window.removeEventListener("test",la,la)}catch{ec=!1}var fl=null,lc=null,ou=null;function tf(){if(ou)return ou;var t,e=lc,l=e.length,n,a="value"in fl?fl.value:fl.textContent,u=a.length;for(t=0;t=ua),cf=" ",sf=!1;function rf(t,e){switch(t){case"keyup":return Wy.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ff(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var yn=!1;function Py(t,e){switch(t){case"compositionend":return ff(e);case"keypress":return e.which!==32?null:(sf=!0,cf);case"textInput":return t=e.data,t===cf&&sf?null:t;default:return null}}function Iy(t,e){if(yn)return t==="compositionend"||!cc&&rf(t,e)?(t=tf(),ou=lc=fl=null,yn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:l,offset:e-t};t=n}t:{for(;l;){if(l.nextSibling){l=l.nextSibling;break t}l=l.parentNode}l=void 0}l=gf(l)}}function bf(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?bf(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Ef(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=ru(t.document);e instanceof t.HTMLIFrameElement;){try{var l=typeof e.contentWindow.location.href=="string"}catch{l=!1}if(l)t=e.contentWindow;else break;e=ru(t.document)}return e}function fc(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var c0=Ze&&"documentMode"in document&&11>=document.documentMode,vn=null,oc=null,ra=null,dc=!1;function Tf(t,e,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;dc||vn==null||vn!==ru(n)||(n=vn,"selectionStart"in n&&fc(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),ra&&sa(ra,n)||(ra=n,n=ai(oc,"onSelect"),0>=f,a-=f,we=1<<32-ve(e)+a|l<at?(ft=k,k=null):ft=k.sibling;var ht=_(O,k,R[at],q);if(ht===null){k===null&&(k=ft);break}t&&k&&ht.alternate===null&&e(O,k),b=u(ht,b,at),dt===null?$=ht:dt.sibling=ht,dt=ht,k=ft}if(at===R.length)return l(O,k),ot&&Je(O,at),$;if(k===null){for(;atat?(ft=k,k=null):ft=k.sibling;var Ul=_(O,k,ht.value,q);if(Ul===null){k===null&&(k=ft);break}t&&k&&Ul.alternate===null&&e(O,k),b=u(Ul,b,at),dt===null?$=Ul:dt.sibling=Ul,dt=Ul,k=ft}if(ht.done)return l(O,k),ot&&Je(O,at),$;if(k===null){for(;!ht.done;at++,ht=R.next())ht=L(O,ht.value,q),ht!==null&&(b=u(ht,b,at),dt===null?$=ht:dt.sibling=ht,dt=ht);return ot&&Je(O,at),$}for(k=n(k);!ht.done;at++,ht=R.next())ht=C(k,O,at,ht.value,q),ht!==null&&(t&&ht.alternate!==null&&k.delete(ht.key===null?at:ht.key),b=u(ht,b,at),dt===null?$=ht:dt.sibling=ht,dt=ht);return t&&k.forEach(function(Nv){return e(O,Nv)}),ot&&Je(O,at),$}function Tt(O,b,R,q){if(typeof R=="object"&&R!==null&&R.type===D&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case X:t:{for(var $=R.key;b!==null;){if(b.key===$){if($=R.type,$===D){if(b.tag===7){l(O,b.sibling),q=a(b,R.props.children),q.return=O,O=q;break t}}else if(b.elementType===$||typeof $=="object"&&$!==null&&$.$$typeof===_t&&kl($)===b.type){l(O,b.sibling),q=a(b,R.props),ya(q,R),q.return=O,O=q;break t}l(O,b);break}else e(O,b);b=b.sibling}R.type===D?(q=Xl(R.props.children,O.mode,q,R.key),q.return=O,O=q):(q=Eu(R.type,R.key,R.props,null,O.mode,q),ya(q,R),q.return=O,O=q)}return f(O);case x:t:{for($=R.key;b!==null;){if(b.key===$)if(b.tag===4&&b.stateNode.containerInfo===R.containerInfo&&b.stateNode.implementation===R.implementation){l(O,b.sibling),q=a(b,R.children||[]),q.return=O,O=q;break t}else{l(O,b);break}else e(O,b);b=b.sibling}q=Sc(R,O.mode,q),q.return=O,O=q}return f(O);case _t:return R=kl(R),Tt(O,b,R,q)}if(le(R))return K(O,b,R,q);if(Yt(R)){if($=Yt(R),typeof $!="function")throw Error(s(150));return R=$.call(R),I(O,b,R,q)}if(typeof R.then=="function")return Tt(O,b,_u(R),q);if(R.$$typeof===w)return Tt(O,b,Ou(O,R),q);zu(O,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,b!==null&&b.tag===6?(l(O,b.sibling),q=a(b,R),q.return=O,O=q):(l(O,b),q=gc(R,O.mode,q),q.return=O,O=q),f(O)):l(O,b)}return function(O,b,R,q){try{ma=0;var $=Tt(O,b,R,q);return Nn=null,$}catch(k){if(k===Rn||k===Ru)throw k;var dt=ge(29,k,null,O.mode);return dt.lanes=q,dt.return=O,dt}finally{}}}var Wl=Zf(!0),Kf=Zf(!1),yl=!1;function jc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Uc(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function vl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function pl(t,e,l){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,(yt&2)!==0){var a=n.pending;return a===null?e.next=e:(e.next=a.next,a.next=e),n.pending=e,e=bu(t),zf(t,null,l),e}return Su(t,n,e,l),bu(t)}function va(t,e,l){if(e=e.updateQueue,e!==null&&(e=e.shared,(l&4194048)!==0)){var n=e.lanes;n&=t.pendingLanes,l|=n,e.lanes=l,qr(t,l)}}function Mc(t,e){var l=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var a=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var f={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?a=u=f:u=u.next=f,l=l.next}while(l!==null);u===null?a=u=e:u=u.next=e}else a=u=e;l={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:n.shared,callbacks:n.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=e:t.next=e,l.lastBaseUpdate=e}var Dc=!1;function pa(){if(Dc){var t=xn;if(t!==null)throw t}}function ga(t,e,l,n){Dc=!1;var a=t.updateQueue;yl=!1;var u=a.firstBaseUpdate,f=a.lastBaseUpdate,h=a.shared.pending;if(h!==null){a.shared.pending=null;var g=h,N=g.next;g.next=null,f===null?u=N:f.next=N,f=g;var M=t.alternate;M!==null&&(M=M.updateQueue,h=M.lastBaseUpdate,h!==f&&(h===null?M.firstBaseUpdate=N:h.next=N,M.lastBaseUpdate=g))}if(u!==null){var L=a.baseState;f=0,M=N=g=null,h=u;do{var _=h.lane&-536870913,C=_!==h.lane;if(C?(rt&_)===_:(n&_)===_){_!==0&&_===On&&(Dc=!0),M!==null&&(M=M.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var K=t,I=h;_=e;var Tt=l;switch(I.tag){case 1:if(K=I.payload,typeof K=="function"){L=K.call(Tt,L,_);break t}L=K;break t;case 3:K.flags=K.flags&-65537|128;case 0:if(K=I.payload,_=typeof K=="function"?K.call(Tt,L,_):K,_==null)break t;L=A({},L,_);break t;case 2:yl=!0}}_=h.callback,_!==null&&(t.flags|=64,C&&(t.flags|=8192),C=a.callbacks,C===null?a.callbacks=[_]:C.push(_))}else C={lane:_,tag:h.tag,payload:h.payload,callback:h.callback,next:null},M===null?(N=M=C,g=L):M=M.next=C,f|=_;if(h=h.next,h===null){if(h=a.shared.pending,h===null)break;C=h,h=C.next,C.next=null,a.lastBaseUpdate=C,a.shared.pending=null}}while(!0);M===null&&(g=L),a.baseState=g,a.firstBaseUpdate=N,a.lastBaseUpdate=M,u===null&&(a.shared.lanes=0),Tl|=f,t.lanes=f,t.memoizedState=L}}function Jf(t,e){if(typeof t!="function")throw Error(s(191,t));t.call(e)}function kf(t,e){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;tu?u:8;var f=j.T,h={};j.T=h,Ic(t,!1,e,l);try{var g=a(),N=j.S;if(N!==null&&N(h,g),g!==null&&typeof g=="object"&&typeof g.then=="function"){var M=v0(g,n);Ea(t,e,M,Ae(t))}else Ea(t,e,n,Ae(t))}catch(L){Ea(t,e,{then:function(){},status:"rejected",reason:L},Ae())}finally{G.p=u,f!==null&&h.types!==null&&(f.types=h.types),j.T=f}}function T0(){}function $c(t,e,l,n){if(t.tag!==5)throw Error(s(476));var a=No(t).queue;Ro(t,a,e,W,l===null?T0:function(){return _o(t),l(n)})}function No(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$e,lastRenderedState:W},next:null};var l={};return e.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$e,lastRenderedState:l},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function _o(t){var e=No(t);e.next===null&&(e=t.alternate.memoizedState),Ea(t,e.next.queue,{},Ae())}function Pc(){return kt(La)}function zo(){return Dt().memoizedState}function Co(){return Dt().memoizedState}function A0(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var l=Ae();t=vl(l);var n=pl(e,t,l);n!==null&&(re(n,e,l),va(n,e,l)),e={cache:Nc()},t.payload=e;return}e=e.return}}function O0(t,e,l){var n=Ae();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},wu(t)?Uo(e,l):(l=vc(t,e,l,n),l!==null&&(re(l,t,n),Mo(l,e,n)))}function jo(t,e,l){var n=Ae();Ea(t,e,l,n)}function Ea(t,e,l,n){var a={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(wu(t))Uo(e,a);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=e.lastRenderedReducer,u!==null))try{var f=e.lastRenderedState,h=u(f,l);if(a.hasEagerState=!0,a.eagerState=h,pe(h,f))return Su(t,e,a,0),At===null&&gu(),!1}catch{}finally{}if(l=vc(t,e,a,n),l!==null)return re(l,t,n),Mo(l,e,n),!0}return!1}function Ic(t,e,l,n){if(n={lane:2,revertLane:js(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},wu(t)){if(e)throw Error(s(479))}else e=vc(t,l,n,2),e!==null&&re(e,t,2)}function wu(t){var e=t.alternate;return t===nt||e!==null&&e===nt}function Uo(t,e){zn=Uu=!0;var l=t.pending;l===null?e.next=e:(e.next=l.next,l.next=e),t.pending=e}function Mo(t,e,l){if((l&4194048)!==0){var n=e.lanes;n&=t.pendingLanes,l|=n,e.lanes=l,qr(t,l)}}var Ta={readContext:kt,use:Bu,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt};Ta.useEffectEvent=zt;var Do={readContext:kt,use:Bu,useCallback:function(t,e){return ee().memoizedState=[t,e===void 0?null:e],t},useContext:kt,useEffect:po,useImperativeHandle:function(t,e,l){l=l!=null?l.concat([t]):null,Hu(4194308,4,Eo.bind(null,e,t),l)},useLayoutEffect:function(t,e){return Hu(4194308,4,t,e)},useInsertionEffect:function(t,e){Hu(4,2,t,e)},useMemo:function(t,e){var l=ee();e=e===void 0?null:e;var n=t();if($l){sl(!0);try{t()}finally{sl(!1)}}return l.memoizedState=[n,e],n},useReducer:function(t,e,l){var n=ee();if(l!==void 0){var a=l(e);if($l){sl(!0);try{l(e)}finally{sl(!1)}}}else a=e;return n.memoizedState=n.baseState=a,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:a},n.queue=t,t=t.dispatch=O0.bind(null,nt,t),[n.memoizedState,t]},useRef:function(t){var e=ee();return t={current:t},e.memoizedState=t},useState:function(t){t=Kc(t);var e=t.queue,l=jo.bind(null,nt,e);return e.dispatch=l,[t.memoizedState,l]},useDebugValue:Fc,useDeferredValue:function(t,e){var l=ee();return Wc(l,t,e)},useTransition:function(){var t=Kc(!1);return t=Ro.bind(null,nt,t.queue,!0,!1),ee().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,l){var n=nt,a=ee();if(ot){if(l===void 0)throw Error(s(407));l=l()}else{if(l=e(),At===null)throw Error(s(349));(rt&127)!==0||to(n,e,l)}a.memoizedState=l;var u={value:l,getSnapshot:e};return a.queue=u,po(lo.bind(null,n,u,t),[t]),n.flags|=2048,jn(9,{destroy:void 0},eo.bind(null,n,u,l,e),null),l},useId:function(){var t=ee(),e=At.identifierPrefix;if(ot){var l=Ye,n=we;l=(n&~(1<<32-ve(n)-1)).toString(32)+l,e="_"+e+"R_"+l,l=Mu++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof n.is=="string"?f.createElement("select",{is:n.is}):f.createElement("select"),n.multiple?u.multiple=!0:n.size&&(u.size=n.size);break;default:u=typeof n.is=="string"?f.createElement(a,{is:n.is}):f.createElement(a)}}u[Kt]=e,u[ne]=n;t:for(f=e.child;f!==null;){if(f.tag===5||f.tag===6)u.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break t;for(;f.sibling===null;){if(f.return===null||f.return===e)break t;f=f.return}f.sibling.return=f.return,f=f.sibling}e.stateNode=u;t:switch(Wt(u,a,n),a){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break t;case"img":n=!0;break t;default:n=!1}n&&Ie(e)}}return Rt(e),hs(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,l),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==n&&Ie(e);else{if(typeof n!="string"&&e.stateNode===null)throw Error(s(166));if(t=ut.current,Tn(e)){if(t=e.stateNode,l=e.memoizedProps,n=null,a=Jt,a!==null)switch(a.tag){case 27:case 5:n=a.memoizedProps}t[Kt]=e,t=!!(t.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||Id(t.nodeValue,l)),t||hl(e,!0)}else t=ui(t).createTextNode(n),t[Kt]=e,e.stateNode=t}return Rt(e),null;case 31:if(l=e.memoizedState,t===null||t.memoizedState!==null){if(n=Tn(e),l!==null){if(t===null){if(!n)throw Error(s(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[Kt]=e}else Vl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Rt(e),t=!1}else l=Ac(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return e.flags&256?(be(e),e):(be(e),null);if((e.flags&128)!==0)throw Error(s(558))}return Rt(e),null;case 13:if(n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(a=Tn(e),n!==null&&n.dehydrated!==null){if(t===null){if(!a)throw Error(s(318));if(a=e.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));a[Kt]=e}else Vl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Rt(e),a=!1}else a=Ac(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),a=!0;if(!a)return e.flags&256?(be(e),e):(be(e),null)}return be(e),(e.flags&128)!==0?(e.lanes=l,e):(l=n!==null,t=t!==null&&t.memoizedState!==null,l&&(n=e.child,a=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(a=n.alternate.memoizedState.cachePool.pool),u=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==a&&(n.flags|=2048)),l!==t&&l&&(e.child.flags|=8192),Vu(e,e.updateQueue),Rt(e),null);case 4:return Ut(),t===null&&Bs(e.stateNode.containerInfo),Rt(e),null;case 10:return Fe(e.type),Rt(e),null;case 19:if(H(Mt),n=e.memoizedState,n===null)return Rt(e),null;if(a=(e.flags&128)!==0,u=n.rendering,u===null)if(a)Oa(n,!1);else{if(Ct!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(u=ju(t),u!==null){for(e.flags|=128,Oa(n,!1),t=u.updateQueue,e.updateQueue=t,Vu(e,t),e.subtreeFlags=0,t=l,l=e.child;l!==null;)Cf(l,t),l=l.sibling;return Q(Mt,Mt.current&1|2),ot&&Je(e,n.treeForkCount),e.child}t=t.sibling}n.tail!==null&&me()>Fu&&(e.flags|=128,a=!0,Oa(n,!1),e.lanes=4194304)}else{if(!a)if(t=ju(u),t!==null){if(e.flags|=128,a=!0,t=t.updateQueue,e.updateQueue=t,Vu(e,t),Oa(n,!0),n.tail===null&&n.tailMode==="hidden"&&!u.alternate&&!ot)return Rt(e),null}else 2*me()-n.renderingStartTime>Fu&&l!==536870912&&(e.flags|=128,a=!0,Oa(n,!1),e.lanes=4194304);n.isBackwards?(u.sibling=e.child,e.child=u):(t=n.last,t!==null?t.sibling=u:e.child=u,n.last=u)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=me(),t.sibling=null,l=Mt.current,Q(Mt,a?l&1|2:l&1),ot&&Je(e,n.treeForkCount),t):(Rt(e),null);case 22:case 23:return be(e),qc(),n=e.memoizedState!==null,t!==null?t.memoizedState!==null!==n&&(e.flags|=8192):n&&(e.flags|=8192),n?(l&536870912)!==0&&(e.flags&128)===0&&(Rt(e),e.subtreeFlags&6&&(e.flags|=8192)):Rt(e),l=e.updateQueue,l!==null&&Vu(e,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==l&&(e.flags|=2048),t!==null&&H(Jl),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),e.memoizedState.cache!==l&&(e.flags|=2048),Fe(qt),Rt(e),null;case 25:return null;case 30:return null}throw Error(s(156,e.tag))}function z0(t,e){switch(Ec(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Fe(qt),Ut(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return eu(e),null;case 31:if(e.memoizedState!==null){if(be(e),e.alternate===null)throw Error(s(340));Vl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(be(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(s(340));Vl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return H(Mt),null;case 4:return Ut(),null;case 10:return Fe(e.type),null;case 22:case 23:return be(e),qc(),t!==null&&H(Jl),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Fe(qt),null;case 25:return null;default:return null}}function ad(t,e){switch(Ec(e),e.tag){case 3:Fe(qt),Ut();break;case 26:case 27:case 5:eu(e);break;case 4:Ut();break;case 31:e.memoizedState!==null&&be(e);break;case 13:be(e);break;case 19:H(Mt);break;case 10:Fe(e.type);break;case 22:case 23:be(e),qc(),t!==null&&H(Jl);break;case 24:Fe(qt)}}function xa(t,e){try{var l=e.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var a=n.next;l=a;do{if((l.tag&t)===t){n=void 0;var u=l.create,f=l.inst;n=u(),f.destroy=n}l=l.next}while(l!==a)}}catch(h){St(e,e.return,h)}}function bl(t,e,l){try{var n=e.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var u=a.next;n=u;do{if((n.tag&t)===t){var f=n.inst,h=f.destroy;if(h!==void 0){f.destroy=void 0,a=e;var g=l,N=h;try{N()}catch(M){St(a,g,M)}}}n=n.next}while(n!==u)}}catch(M){St(e,e.return,M)}}function ud(t){var e=t.updateQueue;if(e!==null){var l=t.stateNode;try{kf(e,l)}catch(n){St(t,t.return,n)}}}function id(t,e,l){l.props=Pl(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(n){St(t,e,n)}}function Ra(t,e){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var n=t.stateNode;break;case 30:n=t.stateNode;break;default:n=t.stateNode}typeof l=="function"?t.refCleanup=l(n):l.current=n}}catch(a){St(t,e,a)}}function Ge(t,e){var l=t.ref,n=t.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(a){St(t,e,a)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(a){St(t,e,a)}else l.current=null}function cd(t){var e=t.type,l=t.memoizedProps,n=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break t;case"img":l.src?n.src=l.src:l.srcSet&&(n.srcset=l.srcSet)}}catch(a){St(t,t.return,a)}}function ms(t,e,l){try{var n=t.stateNode;$0(n,t.type,l,e),n[ne]=e}catch(a){St(t,t.return,a)}}function sd(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Nl(t.type)||t.tag===4}function ys(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||sd(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Nl(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function vs(t,e,l){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,e):(e=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,e.appendChild(t),l=l._reactRootContainer,l!=null||e.onclick!==null||(e.onclick=Ve));else if(n!==4&&(n===27&&Nl(t.type)&&(l=t.stateNode,e=null),t=t.child,t!==null))for(vs(t,e,l),t=t.sibling;t!==null;)vs(t,e,l),t=t.sibling}function Zu(t,e,l){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?l.insertBefore(t,e):l.appendChild(t);else if(n!==4&&(n===27&&Nl(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(Zu(t,e,l),t=t.sibling;t!==null;)Zu(t,e,l),t=t.sibling}function rd(t){var e=t.stateNode,l=t.memoizedProps;try{for(var n=t.type,a=e.attributes;a.length;)e.removeAttributeNode(a[0]);Wt(e,n,l),e[Kt]=t,e[ne]=l}catch(u){St(t,t.return,u)}}var tl=!1,wt=!1,ps=!1,fd=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function C0(t,e){if(t=t.containerInfo,Ls=di,t=Ef(t),fc(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else t:{l=(l=t.ownerDocument)&&l.defaultView||window;var n=l.getSelection&&l.getSelection();if(n&&n.rangeCount!==0){l=n.anchorNode;var a=n.anchorOffset,u=n.focusNode;n=n.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break t}var f=0,h=-1,g=-1,N=0,M=0,L=t,_=null;e:for(;;){for(var C;L!==l||a!==0&&L.nodeType!==3||(h=f+a),L!==u||n!==0&&L.nodeType!==3||(g=f+n),L.nodeType===3&&(f+=L.nodeValue.length),(C=L.firstChild)!==null;)_=L,L=C;for(;;){if(L===t)break e;if(_===l&&++N===a&&(h=f),_===u&&++M===n&&(g=f),(C=L.nextSibling)!==null)break;L=_,_=L.parentNode}L=C}l=h===-1||g===-1?null:{start:h,end:g}}else l=null}l=l||{start:0,end:0}}else l=null;for(ws={focusedElem:t,selectionRange:l},di=!1,Xt=e;Xt!==null;)if(e=Xt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Xt=t;else for(;Xt!==null;){switch(e=Xt,u=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l title"))),Wt(u,n,l),u[Kt]=t,Qt(u),n=u;break t;case"link":var f=vh("link","href",a).get(n+(l.href||""));if(f){for(var h=0;hTt&&(f=Tt,Tt=I,I=f);var O=Sf(h,I),b=Sf(h,Tt);if(O&&b&&(C.rangeCount!==1||C.anchorNode!==O.node||C.anchorOffset!==O.offset||C.focusNode!==b.node||C.focusOffset!==b.offset)){var R=L.createRange();R.setStart(O.node,O.offset),C.removeAllRanges(),I>Tt?(C.addRange(R),C.extend(b.node,b.offset)):(R.setEnd(b.node,b.offset),C.addRange(R))}}}}for(L=[],C=h;C=C.parentNode;)C.nodeType===1&&L.push({element:C,left:C.scrollLeft,top:C.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;hl?32:l,j.T=null,l=Os,Os=null;var u=Ol,f=ul;if(Gt=0,qn=Ol=null,ul=0,(yt&6)!==0)throw Error(s(331));var h=yt;if(yt|=4,Ed(u.current),gd(u,u.current,f,l),yt=h,Ua(0,!1),ye&&typeof ye.onPostCommitFiberRoot=="function")try{ye.onPostCommitFiberRoot(Wn,u)}catch{}return!0}finally{G.p=a,j.T=n,wd(t,e)}}function Gd(t,e,l){e=Ne(l,e),e=ns(t.stateNode,e,2),t=pl(t,e,2),t!==null&&(Pn(t,2),Qe(t))}function St(t,e,l){if(t.tag===3)Gd(t,t,l);else for(;e!==null;){if(e.tag===3){Gd(e,t,l);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Al===null||!Al.has(n))){t=Ne(l,t),l=Qo(2),n=pl(e,l,2),n!==null&&(Xo(l,n,e,t),Pn(n,2),Qe(n));break}}e=e.return}}function _s(t,e,l){var n=t.pingCache;if(n===null){n=t.pingCache=new M0;var a=new Set;n.set(e,a)}else a=n.get(e),a===void 0&&(a=new Set,n.set(e,a));a.has(l)||(bs=!0,a.add(l),t=L0.bind(null,t,e,l),e.then(t,t))}function L0(t,e,l){var n=t.pingCache;n!==null&&n.delete(e),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,At===t&&(rt&l)===l&&(Ct===4||Ct===3&&(rt&62914560)===rt&&300>me()-ku?(yt&2)===0&&Hn(t,0):Es|=l,Bn===rt&&(Bn=0)),Qe(t)}function Qd(t,e){e===0&&(e=Dr()),t=Ql(t,e),t!==null&&(Pn(t,e),Qe(t))}function w0(t){var e=t.memoizedState,l=0;e!==null&&(l=e.retryLane),Qd(t,l)}function Y0(t,e){var l=0;switch(t.tag){case 31:case 13:var n=t.stateNode,a=t.memoizedState;a!==null&&(l=a.retryLane);break;case 19:n=t.stateNode;break;case 22:n=t.stateNode._retryCache;break;default:throw Error(s(314))}n!==null&&n.delete(e),Qd(t,l)}function G0(t,e){return Gi(t,e)}var ei=null,wn=null,zs=!1,li=!1,Cs=!1,Rl=0;function Qe(t){t!==wn&&t.next===null&&(wn===null?ei=wn=t:wn=wn.next=t),li=!0,zs||(zs=!0,X0())}function Ua(t,e){if(!Cs&&li){Cs=!0;do for(var l=!1,n=ei;n!==null;){if(t!==0){var a=n.pendingLanes;if(a===0)var u=0;else{var f=n.suspendedLanes,h=n.pingedLanes;u=(1<<31-ve(42|t)+1)-1,u&=a&~(f&~h),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,Kd(n,u))}else u=rt,u=iu(n,n===At?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(u&3)===0||$n(n,u)||(l=!0,Kd(n,u));n=n.next}while(l);Cs=!1}}function Q0(){Xd()}function Xd(){li=zs=!1;var t=0;Rl!==0&&I0()&&(t=Rl);for(var e=me(),l=null,n=ei;n!==null;){var a=n.next,u=Vd(n,e);u===0?(n.next=null,l===null?ei=a:l.next=a,a===null&&(wn=l)):(l=n,(t!==0||(u&3)!==0)&&(li=!0)),n=a}Gt!==0&&Gt!==5||Ua(t),Rl!==0&&(Rl=0)}function Vd(t,e){for(var l=t.suspendedLanes,n=t.pingedLanes,a=t.expirationTimes,u=t.pendingLanes&-62914561;0h)break;var M=g.transferSize,L=g.initiatorType;M&&th(L)&&(g=g.responseEnd,f+=M*(g"u"?null:document;function dh(t,e,l){var n=Yn;if(n&&typeof e=="string"&&e){var a=xe(e);a='link[rel="'+t+'"][href="'+a+'"]',typeof l=="string"&&(a+='[crossorigin="'+l+'"]'),oh.has(a)||(oh.add(a),t={rel:t,crossOrigin:l,href:e},n.querySelector(a)===null&&(e=n.createElement("link"),Wt(e,"link",t),Qt(e),n.head.appendChild(e)))}}function sv(t){il.D(t),dh("dns-prefetch",t,null)}function rv(t,e){il.C(t,e),dh("preconnect",t,e)}function fv(t,e,l){il.L(t,e,l);var n=Yn;if(n&&t&&e){var a='link[rel="preload"][as="'+xe(e)+'"]';e==="image"&&l&&l.imageSrcSet?(a+='[imagesrcset="'+xe(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(a+='[imagesizes="'+xe(l.imageSizes)+'"]')):a+='[href="'+xe(t)+'"]';var u=a;switch(e){case"style":u=Gn(t);break;case"script":u=Qn(t)}Me.has(u)||(t=A({rel:"preload",href:e==="image"&&l&&l.imageSrcSet?void 0:t,as:e},l),Me.set(u,t),n.querySelector(a)!==null||e==="style"&&n.querySelector(qa(u))||e==="script"&&n.querySelector(Ha(u))||(e=n.createElement("link"),Wt(e,"link",t),Qt(e),n.head.appendChild(e)))}}function ov(t,e){il.m(t,e);var l=Yn;if(l&&t){var n=e&&typeof e.as=="string"?e.as:"script",a='link[rel="modulepreload"][as="'+xe(n)+'"][href="'+xe(t)+'"]',u=a;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Qn(t)}if(!Me.has(u)&&(t=A({rel:"modulepreload",href:t},e),Me.set(u,t),l.querySelector(a)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Ha(u)))return}n=l.createElement("link"),Wt(n,"link",t),Qt(n),l.head.appendChild(n)}}}function dv(t,e,l){il.S(t,e,l);var n=Yn;if(n&&t){var a=rn(n).hoistableStyles,u=Gn(t);e=e||"default";var f=a.get(u);if(!f){var h={loading:0,preload:null};if(f=n.querySelector(qa(u)))h.loading=5;else{t=A({rel:"stylesheet",href:t,"data-precedence":e},l),(l=Me.get(u))&&Ks(t,l);var g=f=n.createElement("link");Qt(g),Wt(g,"link",t),g._p=new Promise(function(N,M){g.onload=N,g.onerror=M}),g.addEventListener("load",function(){h.loading|=1}),g.addEventListener("error",function(){h.loading|=2}),h.loading|=4,ci(f,e,n)}f={type:"stylesheet",instance:f,count:1,state:h},a.set(u,f)}}}function hv(t,e){il.X(t,e);var l=Yn;if(l&&t){var n=rn(l).hoistableScripts,a=Qn(t),u=n.get(a);u||(u=l.querySelector(Ha(a)),u||(t=A({src:t,async:!0},e),(e=Me.get(a))&&Js(t,e),u=l.createElement("script"),Qt(u),Wt(u,"link",t),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(a,u))}}function mv(t,e){il.M(t,e);var l=Yn;if(l&&t){var n=rn(l).hoistableScripts,a=Qn(t),u=n.get(a);u||(u=l.querySelector(Ha(a)),u||(t=A({src:t,async:!0,type:"module"},e),(e=Me.get(a))&&Js(t,e),u=l.createElement("script"),Qt(u),Wt(u,"link",t),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(a,u))}}function hh(t,e,l,n){var a=(a=ut.current)?ii(a):null;if(!a)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(e=Gn(l.href),l=rn(a).hoistableStyles,n=l.get(e),n||(n={type:"style",instance:null,count:0,state:null},l.set(e,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Gn(l.href);var u=rn(a).hoistableStyles,f=u.get(t);if(f||(a=a.ownerDocument||a,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,f),(u=a.querySelector(qa(t)))&&!u._p&&(f.instance=u,f.state.loading=5),Me.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Me.set(t,l),u||yv(a,t,l,f.state))),e&&n===null)throw Error(s(528,""));return f}if(e&&n!==null)throw Error(s(529,""));return null;case"script":return e=l.async,l=l.src,typeof l=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Qn(l),l=rn(a).hoistableScripts,n=l.get(e),n||(n={type:"script",instance:null,count:0,state:null},l.set(e,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Gn(t){return'href="'+xe(t)+'"'}function qa(t){return'link[rel="stylesheet"]['+t+"]"}function mh(t){return A({},t,{"data-precedence":t.precedence,precedence:null})}function yv(t,e,l,n){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?n.loading=1:(e=t.createElement("link"),n.preload=e,e.addEventListener("load",function(){return n.loading|=1}),e.addEventListener("error",function(){return n.loading|=2}),Wt(e,"link",l),Qt(e),t.head.appendChild(e))}function Qn(t){return'[src="'+xe(t)+'"]'}function Ha(t){return"script[async]"+t}function yh(t,e,l){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+xe(l.href)+'"]');if(n)return e.instance=n,Qt(n),n;var a=A({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(t.ownerDocument||t).createElement("style"),Qt(n),Wt(n,"style",a),ci(n,l.precedence,t),e.instance=n;case"stylesheet":a=Gn(l.href);var u=t.querySelector(qa(a));if(u)return e.state.loading|=4,e.instance=u,Qt(u),u;n=mh(l),(a=Me.get(a))&&Ks(n,a),u=(t.ownerDocument||t).createElement("link"),Qt(u);var f=u;return f._p=new Promise(function(h,g){f.onload=h,f.onerror=g}),Wt(u,"link",n),e.state.loading|=4,ci(u,l.precedence,t),e.instance=u;case"script":return u=Qn(l.src),(a=t.querySelector(Ha(u)))?(e.instance=a,Qt(a),a):(n=l,(a=Me.get(u))&&(n=A({},l),Js(n,a)),t=t.ownerDocument||t,a=t.createElement("script"),Qt(a),Wt(a,"link",n),t.head.appendChild(a),e.instance=a);case"void":return null;default:throw Error(s(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(n=e.instance,e.state.loading|=4,ci(n,l.precedence,t));return e.instance}function ci(t,e,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=n.length?n[n.length-1]:null,u=a,f=0;f title"):null)}function vv(t,e,l){if(l===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function gh(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function pv(t,e,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var a=Gn(n.href),u=e.querySelector(qa(a));if(u){e=u._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=ri.bind(t),e.then(t,t)),l.state.loading|=4,l.instance=u,Qt(u);return}u=e.ownerDocument||e,n=mh(n),(a=Me.get(a))&&Ks(n,a),u=u.createElement("link"),Qt(u);var f=u;f._p=new Promise(function(h,g){f.onload=h,f.onerror=g}),Wt(u,"link",n),l.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,e),(e=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=ri.bind(t),e.addEventListener("load",l),e.addEventListener("error",l))}}var ks=0;function gv(t,e){return t.stylesheets&&t.count===0&&oi(t,t.stylesheets),0ks?50:800)+e);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(n),clearTimeout(a)}}:null}function ri(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)oi(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var fi=null;function oi(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,fi=new Map,e.forEach(Sv,t),fi=null,ri.call(t))}function Sv(t,e){if(!(e.state.loading&4)){var l=fi.get(t);if(l)var n=l.get(null);else{l=new Map,fi.set(t,l);for(var a=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),nr.exports=Lv(),nr.exports}var Yv=wv();ym();/** * @remix-run/router v1.23.2 * * 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 Ka(){return Ka=Object.assign?Object.assign.bind():function(i){for(var c=1;c"u")throw new Error(c)}function Tr(i,c){if(!i){typeof console<"u"&&console.warn(c);try{throw new Error(c)}catch{}}}function Qv(){return Math.random().toString(36).substr(2,8)}function Xh(i,c){return{usr:i.state,key:i.key,idx:c}}function hr(i,c,r,s){return r===void 0&&(r=null),Ka({pathname:typeof i=="string"?i:i.pathname,search:"",hash:""},typeof c=="string"?Jn(c):c,{state:r,key:c&&c.key||s||Qv()})}function Oi(i){let{pathname:c="/",search:r="",hash:s=""}=i;return r&&r!=="?"&&(c+=r.charAt(0)==="?"?r:"?"+r),s&&s!=="#"&&(c+=s.charAt(0)==="#"?s:"#"+s),c}function Jn(i){let c={};if(i){let r=i.indexOf("#");r>=0&&(c.hash=i.substr(r),i=i.substr(0,r));let s=i.indexOf("?");s>=0&&(c.search=i.substr(s),i=i.substr(0,s)),i&&(c.pathname=i)}return c}function Xv(i,c,r,s){s===void 0&&(s={});let{window:o=document.defaultView,v5Compat:d=!1}=s,m=o.history,v=Ml.Pop,p=null,y=E();y==null&&(y=0,m.replaceState(Ka({},m.state,{idx:y}),""));function E(){return(m.state||{idx:null}).idx}function A(){v=Ml.Pop;let U=E(),Z=U==null?null:U-y;y=U,p&&p({action:v,location:D.location,delta:Z})}function Y(U,Z){v=Ml.Push;let F=hr(D.location,U,Z);y=E()+1;let w=Xh(F,y),J=D.createHref(F);try{m.pushState(w,"",J)}catch(st){if(st instanceof DOMException&&st.name==="DataCloneError")throw st;o.location.assign(J)}d&&p&&p({action:v,location:D.location,delta:1})}function X(U,Z){v=Ml.Replace;let F=hr(D.location,U,Z);y=E();let w=Xh(F,y),J=D.createHref(F);m.replaceState(w,"",J),d&&p&&p({action:v,location:D.location,delta:0})}function x(U){let Z=o.location.origin!=="null"?o.location.origin:o.location.href,F=typeof U=="string"?U:Oi(U);return F=F.replace(/ $/,"%20"),jt(Z,"No window.location.(origin|href) available to create URL for href: "+F),new URL(F,Z)}let D={get action(){return v},get location(){return i(o,m)},listen(U){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(Qh,A),p=U,()=>{o.removeEventListener(Qh,A),p=null}},createHref(U){return c(o,U)},createURL:x,encodeLocation(U){let Z=x(U);return{pathname:Z.pathname,search:Z.search,hash:Z.hash}},push:Y,replace:X,go(U){return m.go(U)}};return D}var Vh;(function(i){i.data="data",i.deferred="deferred",i.redirect="redirect",i.error="error"})(Vh||(Vh={}));function Vv(i,c,r){return r===void 0&&(r="/"),Zv(i,c,r)}function Zv(i,c,r,s){let o=typeof c=="string"?Jn(c):c,d=Zn(o.pathname||"/",r);if(d==null)return null;let m=vm(i);Kv(m);let v=null;for(let p=0;v==null&&p{let p={relativePath:v===void 0?d.path||"":v,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};p.relativePath.startsWith("/")&&(jt(p.relativePath.startsWith(s),'Absolute route path "'+p.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),p.relativePath=p.relativePath.slice(s.length));let y=Dl([s,p.relativePath]),E=r.concat(p);d.children&&d.children.length>0&&(jt(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),vm(d.children,c,E,y)),!(d.path==null&&!d.index)&&c.push({path:y,score:Iv(y,d.index),routesMeta:E})};return i.forEach((d,m)=>{var v;if(d.path===""||!((v=d.path)!=null&&v.includes("?")))o(d,m);else for(let p of pm(d.path))o(d,m,p)}),c}function pm(i){let c=i.split("/");if(c.length===0)return[];let[r,...s]=c,o=r.endsWith("?"),d=r.replace(/\?$/,"");if(s.length===0)return o?[d,""]:[d];let m=pm(s.join("/")),v=[];return v.push(...m.map(p=>p===""?d:[d,p].join("/"))),o&&v.push(...m),v.map(p=>i.startsWith("/")&&p===""?"/":p)}function Kv(i){i.sort((c,r)=>c.score!==r.score?r.score-c.score:tp(c.routesMeta.map(s=>s.childrenIndex),r.routesMeta.map(s=>s.childrenIndex)))}const Jv=/^:[\w-]+$/,kv=3,Fv=2,Wv=1,$v=10,Pv=-2,Zh=i=>i==="*";function Iv(i,c){let r=i.split("/"),s=r.length;return r.some(Zh)&&(s+=Pv),c&&(s+=Fv),r.filter(o=>!Zh(o)).reduce((o,d)=>o+(Jv.test(d)?kv:d===""?Wv:$v),s)}function tp(i,c){return i.length===c.length&&i.slice(0,-1).every((s,o)=>s===c[o])?i[i.length-1]-c[c.length-1]:0}function ep(i,c,r){let{routesMeta:s}=i,o={},d="/",m=[];for(let v=0;v{let{paramName:Y,isOptional:X}=E;if(Y==="*"){let D=v[A]||"";m=d.slice(0,d.length-D.length).replace(/(.)\/+$/,"$1")}const x=v[A];return X&&!x?y[Y]=void 0:y[Y]=(x||"").replace(/%2F/g,"/"),y},{}),pathname:d,pathnameBase:m,pattern:i}}function lp(i,c,r){c===void 0&&(c=!1),r===void 0&&(r=!0),Tr(i==="*"||!i.endsWith("*")||i.endsWith("/*"),'Route path "'+i+'" will be treated as if it were '+('"'+i.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+i.replace(/\*$/,"/*")+'".'));let s=[],o="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,v,p)=>(s.push({paramName:v,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)"));return i.endsWith("*")?(s.push({paramName:"*"}),o+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":i!==""&&i!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,c?void 0:"i"),s]}function np(i){try{return i.split("/").map(c=>decodeURIComponent(c).replace(/\//g,"%2F")).join("/")}catch(c){return Tr(!1,'The URL path "'+i+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+c+").")),i}}function Zn(i,c){if(c==="/")return i;if(!i.toLowerCase().startsWith(c.toLowerCase()))return null;let r=c.endsWith("/")?c.length-1:c.length,s=i.charAt(r);return s&&s!=="/"?null:i.slice(r)||"/"}const ap=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,up=i=>ap.test(i);function ip(i,c){c===void 0&&(c="/");let{pathname:r,search:s="",hash:o=""}=typeof i=="string"?Jn(i):i,d;if(r)if(up(r))d=r;else{if(r.includes("//")){let m=r;r=r.replace(/\/\/+/g,"/"),Tr(!1,"Pathnames cannot have embedded double slashes - normalizing "+(m+" -> "+r))}r.startsWith("/")?d=Kh(r.substring(1),"/"):d=Kh(r,c)}else d=c;return{pathname:d,search:rp(s),hash:fp(o)}}function Kh(i,c){let r=c.replace(/\/+$/,"").split("/");return i.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function cr(i,c,r,s){return"Cannot include a '"+i+"' character in a manually specified "+("`to."+c+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function cp(i){return i.filter((c,r)=>r===0||c.route.path&&c.route.path.length>0)}function gm(i,c){let r=cp(i);return c?r.map((s,o)=>o===r.length-1?s.pathname:s.pathnameBase):r.map(s=>s.pathnameBase)}function Sm(i,c,r,s){s===void 0&&(s=!1);let o;typeof i=="string"?o=Jn(i):(o=Ka({},i),jt(!o.pathname||!o.pathname.includes("?"),cr("?","pathname","search",o)),jt(!o.pathname||!o.pathname.includes("#"),cr("#","pathname","hash",o)),jt(!o.search||!o.search.includes("#"),cr("#","search","hash",o)));let d=i===""||o.pathname==="",m=d?"/":o.pathname,v;if(m==null)v=r;else{let A=c.length-1;if(!s&&m.startsWith("..")){let Y=m.split("/");for(;Y[0]==="..";)Y.shift(),A-=1;o.pathname=Y.join("/")}v=A>=0?c[A]:"/"}let p=ip(o,v),y=m&&m!=="/"&&m.endsWith("/"),E=(d||m===".")&&r.endsWith("/");return!p.pathname.endsWith("/")&&(y||E)&&(p.pathname+="/"),p}const Dl=i=>i.join("/").replace(/\/\/+/g,"/"),sp=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),rp=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,fp=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i;function op(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}const bm=["post","put","patch","delete"];new Set(bm);const dp=["get",...bm];new Set(dp);/** * React Router v6.30.3 * * 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 Ja(){return Ja=Object.assign?Object.assign.bind():function(i){for(var c=1;c{v.current=!0}),B.useCallback(function(y,E){if(E===void 0&&(E={}),!v.current)return;if(typeof y=="number"){s.go(y);return}let A=Sm(y,JSON.parse(m),d,E.relative==="path");i==null&&c!=="/"&&(A.pathname=A.pathname==="/"?c:Dl([c,A.pathname])),(E.replace?s.replace:s.push)(A,E.state,E)},[c,s,m,d,i])}const yp=B.createContext(null);function vp(i){let c=B.useContext(cl).outlet;return c&&B.createElement(yp.Provider,{value:i},c)}function pp(){let{matches:i}=B.useContext(cl),c=i[i.length-1];return c?c.params:{}}function Ci(i,c){let{relative:r}=c===void 0?{}:c,{future:s}=B.useContext(Bl),{matches:o}=B.useContext(cl),{pathname:d}=Fa(),m=JSON.stringify(gm(o,s.v7_relativeSplatPath));return B.useMemo(()=>Sm(i,JSON.parse(m),d,r==="path"),[i,m,d,r])}function gp(i,c){return Sp(i,c)}function Sp(i,c,r,s){ka()||jt(!1);let{navigator:o}=B.useContext(Bl),{matches:d}=B.useContext(cl),m=d[d.length-1],v=m?m.params:{};m&&m.pathname;let p=m?m.pathnameBase:"/";m&&m.route;let y=Fa(),E;if(c){var A;let U=typeof c=="string"?Jn(c):c;p==="/"||(A=U.pathname)!=null&&A.startsWith(p)||jt(!1),E=U}else E=y;let Y=E.pathname||"/",X=Y;if(p!=="/"){let U=p.replace(/^\//,"").split("/");X="/"+Y.replace(/^\//,"").split("/").slice(U.length).join("/")}let x=Vv(i,{pathname:X}),D=Op(x&&x.map(U=>Object.assign({},U,{params:Object.assign({},v,U.params),pathname:Dl([p,o.encodeLocation?o.encodeLocation(U.pathname).pathname:U.pathname]),pathnameBase:U.pathnameBase==="/"?p:Dl([p,o.encodeLocation?o.encodeLocation(U.pathnameBase).pathname:U.pathnameBase])})),d,r,s);return c&&D?B.createElement(zi.Provider,{value:{location:Ja({pathname:"/",search:"",hash:"",state:null,key:"default"},E),navigationType:Ml.Pop}},D):D}function bp(){let i=_p(),c=op(i)?i.status+" "+i.statusText:i instanceof Error?i.message:JSON.stringify(i),r=i instanceof Error?i.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return B.createElement(B.Fragment,null,B.createElement("h2",null,"Unexpected Application Error!"),B.createElement("h3",{style:{fontStyle:"italic"}},c),r?B.createElement("pre",{style:o},r):null,null)}const Ep=B.createElement(bp,null);class Tp extends B.Component{constructor(c){super(c),this.state={location:c.location,revalidation:c.revalidation,error:c.error}}static getDerivedStateFromError(c){return{error:c}}static getDerivedStateFromProps(c,r){return r.location!==c.location||r.revalidation!=="idle"&&c.revalidation==="idle"?{error:c.error,location:c.location,revalidation:c.revalidation}:{error:c.error!==void 0?c.error:r.error,location:r.location,revalidation:c.revalidation||r.revalidation}}componentDidCatch(c,r){console.error("React Router caught the following error during render",c,r)}render(){return this.state.error!==void 0?B.createElement(cl.Provider,{value:this.props.routeContext},B.createElement(Tm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ap(i){let{routeContext:c,match:r,children:s}=i,o=B.useContext(_i);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),B.createElement(cl.Provider,{value:c},s)}function Op(i,c,r,s){var o;if(c===void 0&&(c=[]),r===void 0&&(r=null),s===void 0&&(s=null),i==null){var d;if(!r)return null;if(r.errors)i=r.matches;else if((d=s)!=null&&d.v7_partialHydration&&c.length===0&&!r.initialized&&r.matches.length>0)i=r.matches;else return null}let m=i,v=(o=r)==null?void 0:o.errors;if(v!=null){let E=m.findIndex(A=>A.route.id&&(v==null?void 0:v[A.route.id])!==void 0);E>=0||jt(!1),m=m.slice(0,Math.min(m.length,E+1))}let p=!1,y=-1;if(r&&s&&s.v7_partialHydration)for(let E=0;E=0?m=m.slice(0,y+1):m=[m[0]];break}}}return m.reduceRight((E,A,Y)=>{let X,x=!1,D=null,U=null;r&&(X=v&&A.route.id?v[A.route.id]:void 0,D=A.route.errorElement||Ep,p&&(y<0&&Y===0?(Cp("route-fallback"),x=!0,U=null):y===Y&&(x=!0,U=A.route.hydrateFallbackElement||null)));let Z=c.concat(m.slice(0,Y+1)),F=()=>{let w;return X?w=D:x?w=U:A.route.Component?w=B.createElement(A.route.Component,null):A.route.element?w=A.route.element:w=E,B.createElement(Ap,{match:A,routeContext:{outlet:E,matches:Z,isDataRoute:r!=null},children:w})};return r&&(A.route.ErrorBoundary||A.route.errorElement||Y===0)?B.createElement(Tp,{location:r.location,revalidation:r.revalidation,component:D,error:X,children:F(),routeContext:{outlet:null,matches:Z,isDataRoute:!0}}):F()},null)}var xm=(function(i){return i.UseBlocker="useBlocker",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i})(xm||{}),Rm=(function(i){return i.UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i.UseRouteId="useRouteId",i})(Rm||{});function xp(i){let c=B.useContext(_i);return c||jt(!1),c}function Rp(i){let c=B.useContext(Em);return c||jt(!1),c}function Np(i){let c=B.useContext(cl);return c||jt(!1),c}function Nm(i){let c=Np(),r=c.matches[c.matches.length-1];return r.route.id||jt(!1),r.route.id}function _p(){var i;let c=B.useContext(Tm),r=Rp(),s=Nm();return c!==void 0?c:(i=r.errors)==null?void 0:i[s]}function zp(){let{router:i}=xp(xm.UseNavigateStable),c=Nm(Rm.UseNavigateStable),r=B.useRef(!1);return Am(()=>{r.current=!0}),B.useCallback(function(o,d){d===void 0&&(d={}),r.current&&(typeof o=="number"?i.navigate(o):i.navigate(o,Ja({fromRouteId:c},d)))},[i,c])}const Jh={};function Cp(i,c,r){Jh[i]||(Jh[i]=!0)}function jp(i,c){i==null||i.v7_startTransition,i==null||i.v7_relativeSplatPath}function Up(i){return vp(i.context)}function en(i){jt(!1)}function Mp(i){let{basename:c="/",children:r=null,location:s,navigationType:o=Ml.Pop,navigator:d,static:m=!1,future:v}=i;ka()&&jt(!1);let p=c.replace(/^\/*/,"/"),y=B.useMemo(()=>({basename:p,navigator:d,static:m,future:Ja({v7_relativeSplatPath:!1},v)}),[p,v,d,m]);typeof s=="string"&&(s=Jn(s));let{pathname:E="/",search:A="",hash:Y="",state:X=null,key:x="default"}=s,D=B.useMemo(()=>{let U=Zn(E,p);return U==null?null:{location:{pathname:U,search:A,hash:Y,state:X,key:x},navigationType:o}},[p,E,A,Y,X,x,o]);return D==null?null:B.createElement(Bl.Provider,{value:y},B.createElement(zi.Provider,{children:r,value:D}))}function Dp(i){let{children:c,location:r}=i;return gp(yr(c),r)}new Promise(()=>{});function yr(i,c){c===void 0&&(c=[]);let r=[];return B.Children.forEach(i,(s,o)=>{if(!B.isValidElement(s))return;let d=[...c,o];if(s.type===B.Fragment){r.push.apply(r,yr(s.props.children,d));return}s.type!==en&&jt(!1),!s.props.index||!s.props.children||jt(!1);let m={id:s.props.id||d.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(m.children=yr(s.props.children,d)),r.push(m)}),r}/** * React Router DOM v6.30.3 * * 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 xi(){return xi=Object.assign?Object.assign.bind():function(i){for(var c=1;c=0)&&(r[o]=i[o]);return r}function Bp(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function qp(i,c){return i.button===0&&(!c||c==="_self")&&!Bp(i)}const Hp=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Lp=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],wp="6";try{window.__reactRouterVersion=wp}catch{}const Yp=B.createContext({isTransitioning:!1}),Gp="startTransition",kh=Dv[Gp];function Qp(i){let{basename:c,children:r,future:s,window:o}=i,d=B.useRef();d.current==null&&(d.current=Gv({window:o,v5Compat:!0}));let m=d.current,[v,p]=B.useState({action:m.action,location:m.location}),{v7_startTransition:y}=s||{},E=B.useCallback(A=>{y&&kh?kh(()=>p(A)):p(A)},[p,y]);return B.useLayoutEffect(()=>m.listen(E),[m,E]),B.useEffect(()=>jp(s),[s]),B.createElement(Mp,{basename:c,children:r,location:v.location,navigationType:v.action,navigator:m,future:s})}const Xp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Vp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ri=B.forwardRef(function(c,r){let{onClick:s,relative:o,reloadDocument:d,replace:m,state:v,target:p,to:y,preventScrollReset:E,viewTransition:A}=c,Y=_m(c,Hp),{basename:X}=B.useContext(Bl),x,D=!1;if(typeof y=="string"&&Vp.test(y)&&(x=y,Xp))try{let w=new URL(window.location.href),J=y.startsWith("//")?new URL(w.protocol+y):new URL(y),st=Zn(J.pathname,X);J.origin===w.origin&&st!=null?y=st+J.search+J.hash:D=!0}catch{}let U=hp(y,{relative:o}),Z=Kp(y,{replace:m,state:v,target:p,preventScrollReset:E,relative:o,viewTransition:A});function F(w){s&&s(w),w.defaultPrevented||Z(w)}return B.createElement("a",xi({},Y,{href:x||U,onClick:D||d?s:F,ref:r,target:p}))}),Si=B.forwardRef(function(c,r){let{"aria-current":s="page",caseSensitive:o=!1,className:d="",end:m=!1,style:v,to:p,viewTransition:y,children:E}=c,A=_m(c,Lp),Y=Ci(p,{relative:A.relative}),X=Fa(),x=B.useContext(Em),{navigator:D,basename:U}=B.useContext(Bl),Z=x!=null&&Jp(Y)&&y===!0,F=D.encodeLocation?D.encodeLocation(Y).pathname:Y.pathname,w=X.pathname,J=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;o||(w=w.toLowerCase(),J=J?J.toLowerCase():null,F=F.toLowerCase()),J&&U&&(J=Zn(J,U)||J);const st=F!=="/"&&F.endsWith("/")?F.length-1:F.length;let Ot=w===F||!m&&w.startsWith(F)&&w.charAt(st)==="/",P=J!=null&&(J===F||!m&&J.startsWith(F)&&J.charAt(F.length)==="/"),_t={isActive:Ot,isPending:P,isTransitioning:Z},Vt=Ot?s:void 0,de;typeof d=="function"?de=d(_t):de=[d,Ot?"active":null,P?"pending":null,Z?"transitioning":null].filter(Boolean).join(" ");let It=typeof v=="function"?v(_t):v;return B.createElement(Ri,xi({},A,{"aria-current":Vt,className:de,ref:r,style:It,to:p,viewTransition:y}),typeof E=="function"?E(_t):E)});var vr;(function(i){i.UseScrollRestoration="useScrollRestoration",i.UseSubmit="useSubmit",i.UseSubmitFetcher="useSubmitFetcher",i.UseFetcher="useFetcher",i.useViewTransitionState="useViewTransitionState"})(vr||(vr={}));var Fh;(function(i){i.UseFetcher="useFetcher",i.UseFetchers="useFetchers",i.UseScrollRestoration="useScrollRestoration"})(Fh||(Fh={}));function Zp(i){let c=B.useContext(_i);return c||jt(!1),c}function Kp(i,c){let{target:r,replace:s,state:o,preventScrollReset:d,relative:m,viewTransition:v}=c===void 0?{}:c,p=Om(),y=Fa(),E=Ci(i,{relative:m});return B.useCallback(A=>{if(qp(A,r)){A.preventDefault();let Y=s!==void 0?s:Oi(y)===Oi(E);p(i,{replace:Y,state:o,preventScrollReset:d,relative:m,viewTransition:v})}},[y,p,E,s,o,r,i,d,m,v])}function Jp(i,c){c===void 0&&(c={});let r=B.useContext(Yp);r==null&&jt(!1);let{basename:s}=Zp(vr.useViewTransitionState),o=Ci(i,{relative:c.relative});if(!r.isTransitioning)return!1;let d=Zn(r.currentLocation.pathname,s)||r.currentLocation.pathname,m=Zn(r.nextLocation.pathname,s)||r.nextLocation.pathname;return mr(o.pathname,m)!=null||mr(o.pathname,d)!=null}const zm="librairie-books",sr=[{id:"1",title:"Le Petit Prince",author:"Antoine de Saint-Exupéry",year:1943,genre:"Conte",price:8.5,read:!0},{id:"2",title:"1984",author:"George Orwell",year:1949,genre:"Science-fiction",price:9.9,read:!1}];function Cm(i){const c=Number(i==null?void 0:i.price);return{...i,price:Number.isFinite(c)?c:10}}function kp(){try{const i=localStorage.getItem(zm);if(i===null)return sr;const c=JSON.parse(i);return Array.isArray(c)?c.map(Cm):sr}catch{return sr}}function Fp(i){localStorage.setItem(zm,JSON.stringify(i))}const jm=B.createContext(null);function Wp({children:i}){const[c,r]=B.useState(kp);B.useEffect(()=>{Fp(c)},[c]);const s=B.useCallback(v=>{const p=crypto.randomUUID();r(y=>[...y,Cm({...v,id:p})])},[]),o=B.useCallback(v=>{r(p=>p.filter(y=>y.id!==v))},[]),d=B.useCallback(v=>{r(p=>p.map(y=>y.id===v?{...y,read:!y.read}:y))},[]),m={books:c,postBook:s,removeBook:o,toggleRead:d};return T.jsx(jm.Provider,{value:m,children:i})}function ji(){const i=B.useContext(jm);if(!i)throw new Error("useBooks doit être utilisé dans un BooksProvider");return i}const Um="librairie-orders";function $p(){try{const i=localStorage.getItem(Um);if(i===null)return[];const c=JSON.parse(i);return Array.isArray(c)?c:[]}catch{return[]}}function Pp(i){localStorage.setItem(Um,JSON.stringify(i))}function Ar(i){return Math.round((Number(i)+Number.EPSILON)*100)/100}function Ip(i){return Ar(i.reduce((c,r)=>c+Number(r.unitPrice)*Number(r.qty),0))}function tg({subtotal:i,promotion:c}){if(!c)return 0;if(c.type==="percent"){const r=Number(c.value);return!Number.isFinite(r)||r<=0?0:Ar(i*r/100)}return 0}const Mm=B.createContext(null);function eg({children:i}){const[c,r]=B.useState($p);B.useEffect(()=>{Pp(c)},[c]);const s=B.useCallback(d=>{const v=(Array.isArray(d==null?void 0:d.items)?d.items:[]).map(X=>({bookId:String(X.bookId),title:String(X.title||""),unitPrice:Number(X.unitPrice),qty:Math.max(0,Math.trunc(Number(X.qty)||0))})).filter(X=>X.bookId&&X.qty>0&&Number.isFinite(X.unitPrice));if(v.length===0)throw new Error("Aucun article dans la commande");const p=Ip(v),y=d!=null&&d.promotion?{code:String(d.promotion.code||""),type:String(d.promotion.type||"percent"),value:Number(d.promotion.value)}:null,E=tg({subtotal:p,promotion:y}),A=Ar(Math.max(0,p-E)),Y={id:crypto.randomUUID(),createdAt:new Date().toISOString(),items:v,promotion:y&&y.code?y:null,subtotal:p,discount:E,total:A};return r(X=>[Y,...X]),Y},[]),o=B.useMemo(()=>({orders:c,createOrder:s}),[c,s]);return T.jsx(Mm.Provider,{value:o,children:i})}function lg(){const i=B.useContext(Mm);if(!i)throw new Error("useOrders doit être utilisé dans un OrdersProvider");return i}const Dm="librairie-promotions";function ng(){try{const i=localStorage.getItem(Dm);if(i===null)return[];const c=JSON.parse(i);return Array.isArray(c)?c:[]}catch{return[]}}function ag(i){localStorage.setItem(Dm,JSON.stringify(i))}function Va(i){return String(i||"").trim().toUpperCase().replace(/\s+/g,"")}const Bm=B.createContext(null);function ug({children:i}){const[c,r]=B.useState(ng);B.useEffect(()=>{ag(c)},[c]);const s=B.useCallback(p=>{const y=Va(p.code),E=Number(p.value);if(!y)throw new Error("Code promo invalide");if(!Number.isFinite(E)||E<=0)throw new Error("Valeur de promo invalide");r(A=>{if(A.some(X=>X.code===y))throw new Error("Ce code promo existe déjà");return[...A,{id:crypto.randomUUID(),code:y,type:"percent",value:E,active:!0,createdAt:new Date().toISOString()}]})},[]),o=B.useCallback((p,y)=>{const E=Va(p);r(A=>A.map(Y=>Y.code===E?{...Y,active:y}:Y))},[]),d=B.useCallback(p=>{const y=Va(p);r(E=>E.filter(A=>A.code!==y))},[]),m=B.useCallback(p=>{const y=Va(p);return c.find(E=>E.code===y&&E.active)||null},[c]),v=B.useMemo(()=>({promotions:c,createPromotion:s,removePromotion:d,setPromotionActive:o,getActivePromotionByCode:m,normalizeCode:Va}),[c,s,d,o,m]);return T.jsx(Bm.Provider,{value:v,children:i})}function qm(){const i=B.useContext(Bm);if(!i)throw new Error("usePromotions doit être utilisé dans un PromotionsProvider");return i}function ig(){return T.jsxs("div",{className:"app",children:[T.jsx("header",{className:"app-header",children:T.jsxs("div",{className:"header-row",children:[T.jsxs("div",{className:"brand",children:[T.jsx("span",{className:"logo","aria-hidden":!0,children:"📚"}),T.jsx("div",{children:T.jsx("h1",{children:"Ma librairie"})})]}),T.jsxs("nav",{className:"main-nav","aria-label":"Navigation principale",children:[T.jsx(Si,{to:"/",end:!0,className:({isActive:i})=>i?"nav-link active":"nav-link",children:"Mes livres"}),T.jsx(Si,{to:"/recherche",className:({isActive:i})=>i?"nav-link active":"nav-link",children:"Recherche (Axios)"}),T.jsx(Si,{to:"/commande",className:({isActive:i})=>i?"nav-link active":"nav-link",children:"Commande"}),T.jsx(Si,{to:"/promotions",className:({isActive:i})=>i?"nav-link active":"nav-link",children:"Promotions"})]})]})}),T.jsx("div",{className:"route-outlet",children:T.jsx(Up,{})}),T.jsx("footer",{className:"app-footer",children:T.jsxs("p",{children:["React + Vite · React Router (",T.jsx("code",{children:"Outlet"}),") ·"," ",T.jsx("code",{children:"useContext"})," · Axios (Open Library)"]})})]})}function cg(){const{id:i}=pp(),c=Om(),{books:r,toggleRead:s,removeBook:o}=ji(),d=r.find(v=>v.id===i);if(!d)return T.jsxs("div",{className:"book-detail",children:[T.jsx("p",{className:"book-detail-missing",children:"Livre introuvable."}),T.jsx(Ri,{to:"/",className:"nav-link",children:"← Retour à mes livres"})]});function m(){o(d.id),c("/")}return T.jsxs("article",{className:"book-detail",children:[T.jsx(Ri,{to:"/",className:"nav-link book-detail-back",children:"← Catalogue"}),T.jsx("span",{className:`badge ${d.read?"read":"unread"}`,children:d.read?"Lu":"À lire"}),T.jsx("h2",{className:"book-detail-title",children:d.title}),T.jsx("p",{className:"book-detail-author",children:d.author}),T.jsxs("dl",{className:"book-detail-meta",children:[T.jsxs("div",{children:[T.jsx("dt",{children:"Année"}),T.jsx("dd",{children:d.year})]}),T.jsxs("div",{children:[T.jsx("dt",{children:"Prix"}),T.jsxs("dd",{children:[Number(d.price??10).toFixed(2)," €"]})]}),d.genre?T.jsxs("div",{children:[T.jsx("dt",{children:"Genre"}),T.jsx("dd",{children:d.genre})]}):null,T.jsxs("div",{children:[T.jsx("dt",{children:"Identifiant"}),T.jsx("dd",{children:T.jsx("code",{children:d.id})})]})]}),T.jsxs("div",{className:"book-detail-actions",children:[T.jsx("button",{type:"button",className:"btn",onClick:()=>s(d.id),children:d.read?"Marquer non lu":"Marquer lu"}),T.jsx("button",{type:"button",className:"btn danger",onClick:m,children:"Supprimer de mes livres"})]})]})}function Vn(i){const c=Number(i)||0;return new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR",maximumFractionDigits:2}).format(c)}function sg(i){const c=new Map;for(const r of i)c.set(r.bookId,r.qty);return c}function rg(){const{books:i}=ji(),{createOrder:c}=lg(),{getActivePromotionByCode:r,normalizeCode:s}=qm(),[o,d]=B.useState(()=>({})),[m,v]=B.useState(""),[p,y]=B.useState(null),[E,A]=B.useState(null),Y=B.useMemo(()=>i.map(w=>{const J=Math.max(0,Math.trunc(Number(o[w.id])||0)),st=Number(w.price);return{bookId:w.id,title:w.title,unitPrice:Number.isFinite(st)?st:10,qty:J}}).filter(w=>w.qty>0),[i,o]),X=B.useMemo(()=>Y.reduce((w,J)=>w+J.unitPrice*J.qty,0),[Y]),x=B.useMemo(()=>{const w=s(m);return w?r(w):null},[m,r,s]),D=B.useMemo(()=>x?X*x.value/100:0,[x,X]),U=B.useMemo(()=>Math.max(0,X-D),[X,D]);function Z(w,J){d(st=>({...st,[w]:J}))}function F(){A(null),y(null);try{const w=c({items:Y,promotion:x?{code:x.code,type:x.type,value:x.value}:null});d({}),v("");const J=sg(w.items);y(`Commande ${w.id.slice(0,8)} créée (${J.size} livre${J.size>1?"s":""}). Total: ${Vn(w.total)}.`)}catch(w){A((w==null?void 0:w.message)||"Impossible de créer la commande.")}}return T.jsxs("div",{className:"commande-page",children:[T.jsx("h2",{className:"page-title",children:"Passer une commande"}),T.jsxs("p",{className:"page-lead",children:["Équivalent local de ",T.jsx("code",{children:"POST /api/orders"})," (aucun backend)."]}),E?T.jsx("p",{className:"form-error",role:"alert",children:E}):null,p?T.jsx("p",{className:"form-notice",children:p}):null,i.length===0?T.jsx("p",{className:"empty-state",children:"Aucun livre dans le catalogue. Ajoute un livre dans “Mes livres” d’abord."}):T.jsxs("div",{className:"order-grid",children:[T.jsxs("section",{className:"order-panel",children:[T.jsx("h3",{className:"panel-title",children:"Catalogue"}),T.jsx("ul",{className:"order-catalog",children:i.map(w=>T.jsx("li",{className:"order-catalog-item",children:T.jsxs("div",{className:"order-catalog-main",children:[T.jsxs("div",{children:[T.jsx("p",{className:"order-book-title",children:w.title}),T.jsxs("p",{className:"order-book-meta",children:[w.author," · ",Vn(w.price??10)]})]}),T.jsxs("label",{className:"qty",children:[T.jsx("span",{className:"qty-label",children:"Qté"}),T.jsx("input",{type:"number",min:0,step:1,value:o[w.id]??0,onChange:J=>Z(w.id,J.target.value),"aria-label":`Quantité pour ${w.title}`})]})]})},w.id))})]}),T.jsxs("aside",{className:"order-panel",children:[T.jsx("h3",{className:"panel-title",children:"Récapitulatif"}),Y.length===0?T.jsx("p",{className:"empty-state",children:"Sélectionne au moins un livre (quantité > 0)."}):T.jsx("ul",{className:"order-summary",children:Y.map(w=>T.jsxs("li",{className:"order-summary-item",children:[T.jsxs("span",{children:[w.title," × ",w.qty]}),T.jsx("span",{children:Vn(w.unitPrice*w.qty)})]},w.bookId))}),T.jsxs("div",{className:"promo-box",children:[T.jsxs("label",{className:"promo-label",children:["Code promo",T.jsx("input",{className:"promo-input",placeholder:"Ex. BUT10",value:m,onChange:w=>v(w.target.value)})]}),T.jsxs("p",{className:"promo-hint",children:["Équivalent local de ",T.jsx("code",{children:"POST /api/promotions"})," (créées dans “Promotions”)."]}),m.trim()&&!x?T.jsx("p",{className:"promo-warn",children:"Code invalide ou inactif."}):null,x?T.jsxs("p",{className:"promo-ok",children:["Promo appliquée : ",T.jsx("strong",{children:x.code})," (−",x.value,"%)"]}):null]}),T.jsxs("div",{className:"totals",children:[T.jsxs("div",{className:"totals-row",children:[T.jsx("span",{children:"Sous-total"}),T.jsx("span",{children:Vn(X)})]}),T.jsxs("div",{className:"totals-row",children:[T.jsx("span",{children:"Remise"}),T.jsxs("span",{children:["−",Vn(D)]})]}),T.jsxs("div",{className:"totals-row total",children:[T.jsx("span",{children:"Total"}),T.jsx("span",{children:Vn(U)})]})]}),T.jsx("button",{type:"button",className:"btn primary",onClick:F,children:"Passer commande (POST)"})]})]})]})}const Wh=()=>({title:"",author:"",year:new Date().getFullYear(),genre:"",price:10,read:!1});function fg({onSubmit:i}){const[c,r]=B.useState(()=>Wh());function s(o){o.preventDefault(),!(!c.title.trim()||!c.author.trim())&&(i(c),r(Wh()))}return T.jsxs("form",{className:"book-form",onSubmit:s,children:[T.jsx("h2",{children:"Enregistrer un nouveau livre"}),T.jsx("p",{className:"book-form-story",children:"Je veux enregistrer un nouveau livre"}),T.jsxs("p",{className:"book-form-api",children:[T.jsx("code",{children:"POST /api/books"}),T.jsxs("span",{className:"book-form-api-note",children:[" ","(dans cette appli : enregistrement local, pas de serveur)"]})]}),T.jsxs("div",{className:"form-grid",children:[T.jsxs("label",{children:["Titre",T.jsx("input",{required:!0,value:c.title,onChange:o=>r(d=>({...d,title:o.target.value})),placeholder:"Ex. Les Misérables"})]}),T.jsxs("label",{children:["Auteur·ice",T.jsx("input",{required:!0,value:c.author,onChange:o=>r(d=>({...d,author:o.target.value})),placeholder:"Ex. Victor Hugo"})]}),T.jsxs("label",{children:["Année",T.jsx("input",{type:"number",min:1e3,max:2100,value:c.year,onChange:o=>r(d=>({...d,year:Number(o.target.value)||d.year}))})]}),T.jsxs("label",{children:["Genre",T.jsx("input",{value:c.genre,onChange:o=>r(d=>({...d,genre:o.target.value})),placeholder:"Roman, essai…"})]}),T.jsxs("label",{children:["Prix (€)",T.jsx("input",{type:"number",min:0,step:"0.5",value:c.price,onChange:o=>r(d=>({...d,price:Number(o.target.value)})),placeholder:"Ex. 12.5"})]})]}),T.jsxs("label",{className:"checkbox-row",children:[T.jsx("input",{type:"checkbox",checked:c.read,onChange:o=>r(d=>({...d,read:o.target.checked}))}),"Déjà lu"]}),T.jsx("div",{className:"form-actions",children:T.jsx("button",{type:"submit",className:"btn primary",children:"Enregistrer (POST)"})})]})}const og=[["all","Tous"],["read","Lus"],["unread","À lire"]];function dg({books:i,filter:c,query:r,onFilterChange:s,onQueryChange:o,onToggleRead:d,onRemove:m}){const v=r.trim().toLowerCase(),p=i.filter(y=>c==="read"&&!y.read||c==="unread"&&y.read?!1:v?y.title.toLowerCase().includes(v)||y.author.toLowerCase().includes(v)||y.genre&&y.genre.toLowerCase().includes(v):!0);return T.jsxs("section",{className:"book-list-section",children:[T.jsxs("div",{className:"toolbar",children:[T.jsx("input",{type:"search",className:"search",placeholder:"Rechercher par titre, auteur ou genre…",value:r,onChange:y=>o(y.target.value),"aria-label":"Recherche"}),T.jsx("div",{className:"filter-tabs",role:"tablist",children:og.map(([y,E])=>T.jsx("button",{type:"button",role:"tab","aria-selected":c===y,className:c===y?"tab active":"tab",onClick:()=>s(y),children:E},y))})]}),p.length===0?T.jsx("p",{className:"empty-state",children:i.length===0?"Aucun livre enregistré. Utilisez le formulaire à gauche : Je veux enregistrer un nouveau livre (POST /api/books).":"Aucun résultat pour ces critères."}):T.jsx("ul",{className:"book-grid",children:p.map(y=>T.jsxs("li",{className:"book-card",children:[T.jsxs("div",{className:"book-card-top",children:[T.jsx("span",{className:`badge ${y.read?"read":"unread"}`,children:y.read?"Lu":"À lire"}),y.genre?T.jsx("span",{className:"genre",children:y.genre}):null]}),T.jsx("h3",{children:T.jsx(Ri,{className:"book-title-link",to:`/${y.id}`,children:y.title})}),T.jsx("p",{className:"author",children:y.author}),T.jsxs("p",{className:"year",children:[y.year," · ",Number(y.price??10).toFixed(2)," €"]}),T.jsxs("div",{className:"card-actions",children:[T.jsx("button",{type:"button",className:"btn small",onClick:()=>d(y.id),children:y.read?"Marquer non lu":"Marquer lu"}),T.jsx("button",{type:"button",className:"btn small danger",onClick:()=>m(y.id),children:"Supprimer"})]})]},y.id))})]})}function hg(){const{books:i,postBook:c,removeBook:r,toggleRead:s}=ji(),[o,d]=B.useState("all"),[m,v]=B.useState(""),p=B.useMemo(()=>{const y=i.filter(E=>E.read).length;return{total:i.length,read:y,unread:i.length-y}},[i]);return T.jsxs("div",{className:"mes-livres-page",children:[T.jsx("div",{className:"mes-livres-intro",children:T.jsxs("p",{className:"tagline mes-livres-tagline",children:[p.total," livre",p.total!==1?"s":""," enregistré",p.total!==1?"s":""," — ",p.read," lu",p.read!==1?"s":""]})}),T.jsxs("div",{className:"app-main",children:[T.jsx("aside",{className:"sidebar",children:T.jsx(fg,{onSubmit:c})}),T.jsx(dg,{books:i,filter:o,query:m,onFilterChange:d,onQueryChange:v,onToggleRead:s,onRemove:r})]})]})}function mg(){const{promotions:i,createPromotion:c,removePromotion:r,setPromotionActive:s}=qm(),[o,d]=B.useState(""),[m,v]=B.useState(10),[p,y]=B.useState(null),[E,A]=B.useState(null),Y=B.useMemo(()=>[...i].sort((x,D)=>x.active!==D.active?x.active?-1:1:String(x.code).localeCompare(String(D.code))),[i]);function X(x){x.preventDefault(),A(null),y(null);try{c({code:o,value:m}),y("Promotion créée."),d(""),v(10)}catch(D){A((D==null?void 0:D.message)||"Impossible de créer la promotion.")}}return T.jsxs("div",{className:"promotions-page",children:[T.jsx("h2",{className:"page-title",children:"Promotions"}),T.jsxs("p",{className:"page-lead",children:["Équivalent local de ",T.jsx("code",{children:"POST /api/promotions"})," (aucun backend)."]}),E?T.jsx("p",{className:"form-error",role:"alert",children:E}):null,p?T.jsx("p",{className:"form-notice",children:p}):null,T.jsxs("div",{className:"promo-grid",children:[T.jsxs("section",{className:"order-panel",children:[T.jsx("h3",{className:"panel-title",children:"Créer une promotion"}),T.jsxs("form",{className:"promo-form",onSubmit:X,children:[T.jsxs("label",{children:["Code",T.jsx("input",{value:o,onChange:x=>d(x.target.value),placeholder:"Ex. BUT10"})]}),T.jsxs("label",{children:["Remise (%)",T.jsx("input",{type:"number",min:1,max:90,value:m,onChange:x=>v(Number(x.target.value)||0)})]}),T.jsx("button",{type:"submit",className:"btn primary",children:"Créer (POST)"})]}),T.jsx("p",{className:"promo-hint",children:"Astuce : le code est normalisé (majuscules, sans espaces)."})]}),T.jsxs("section",{className:"order-panel",children:[T.jsx("h3",{className:"panel-title",children:"Promotions existantes"}),Y.length===0?T.jsx("p",{className:"empty-state",children:"Aucune promotion créée."}):T.jsx("ul",{className:"promo-list",children:Y.map(x=>T.jsx("li",{className:"promo-item",children:T.jsxs("div",{className:"promo-item-main",children:[T.jsxs("div",{children:[T.jsx("p",{className:"promo-code",children:x.code}),T.jsxs("p",{className:"promo-meta",children:["−",x.value,"%"]})]}),T.jsxs("div",{className:"promo-actions",children:[T.jsx("button",{type:"button",className:"btn small",onClick:()=>s(x.code,!x.active),children:x.active?"Désactiver":"Activer"}),T.jsx("button",{type:"button",className:"btn small danger",onClick:()=>r(x.code),children:"Supprimer"})]})]})},x.id))})]})]})]})}function Hm(i,c){return function(){return i.apply(c,arguments)}}const{toString:yg}=Object.prototype,{getPrototypeOf:Or}=Object,{iterator:Ui,toStringTag:Lm}=Symbol,Mi=(i=>c=>{const r=yg.call(c);return i[r]||(i[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Le=i=>(i=i.toLowerCase(),c=>Mi(c)===i),Di=i=>c=>typeof c===i,{isArray:kn}=Array,Kn=Di("undefined");function Wa(i){return i!==null&&!Kn(i)&&i.constructor!==null&&!Kn(i.constructor)&&fe(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}const wm=Le("ArrayBuffer");function vg(i){let c;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?c=ArrayBuffer.isView(i):c=i&&i.buffer&&wm(i.buffer),c}const pg=Di("string"),fe=Di("function"),Ym=Di("number"),$a=i=>i!==null&&typeof i=="object",gg=i=>i===!0||i===!1,Ei=i=>{if(Mi(i)!=="object")return!1;const c=Or(i);return(c===null||c===Object.prototype||Object.getPrototypeOf(c)===null)&&!(Lm in i)&&!(Ui in i)},Sg=i=>{if(!$a(i)||Wa(i))return!1;try{return Object.keys(i).length===0&&Object.getPrototypeOf(i)===Object.prototype}catch{return!1}},bg=Le("Date"),Eg=Le("File"),Tg=i=>!!(i&&typeof i.uri<"u"),Ag=i=>i&&typeof i.getParts<"u",Og=Le("Blob"),xg=Le("FileList"),Rg=i=>$a(i)&&fe(i.pipe);function Ng(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const $h=Ng(),Ph=typeof $h.FormData<"u"?$h.FormData:void 0,_g=i=>{let c;return i&&(Ph&&i instanceof Ph||fe(i.append)&&((c=Mi(i))==="formdata"||c==="object"&&fe(i.toString)&&i.toString()==="[object FormData]"))},zg=Le("URLSearchParams"),[Cg,jg,Ug,Mg]=["ReadableStream","Request","Response","Headers"].map(Le),Dg=i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Pa(i,c,{allOwnKeys:r=!1}={}){if(i===null||typeof i>"u")return;let s,o;if(typeof i!="object"&&(i=[i]),kn(i))for(s=0,o=i.length;s0;)if(o=r[s],c===o.toLowerCase())return o;return null}const ln=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Qm=i=>!Kn(i)&&i!==ln;function pr(){const{caseless:i,skipUndefined:c}=Qm(this)&&this||{},r={},s=(o,d)=>{if(d==="__proto__"||d==="constructor"||d==="prototype")return;const m=i&&Gm(r,d)||d;Ei(r[m])&&Ei(o)?r[m]=pr(r[m],o):Ei(o)?r[m]=pr({},o):kn(o)?r[m]=o.slice():(!c||!Kn(o))&&(r[m]=o)};for(let o=0,d=arguments.length;o(Pa(c,(o,d)=>{r&&fe(o)?Object.defineProperty(i,d,{value:Hm(o,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(i,d,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),i),qg=i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),Hg=(i,c,r,s)=>{i.prototype=Object.create(c.prototype,s),Object.defineProperty(i.prototype,"constructor",{value:i,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(i,"super",{value:c.prototype}),r&&Object.assign(i.prototype,r)},Lg=(i,c,r,s)=>{let o,d,m;const v={};if(c=c||{},i==null)return c;do{for(o=Object.getOwnPropertyNames(i),d=o.length;d-- >0;)m=o[d],(!s||s(m,i,c))&&!v[m]&&(c[m]=i[m],v[m]=!0);i=r!==!1&&Or(i)}while(i&&(!r||r(i,c))&&i!==Object.prototype);return c},wg=(i,c,r)=>{i=String(i),(r===void 0||r>i.length)&&(r=i.length),r-=c.length;const s=i.indexOf(c,r);return s!==-1&&s===r},Yg=i=>{if(!i)return null;if(kn(i))return i;let c=i.length;if(!Ym(c))return null;const r=new Array(c);for(;c-- >0;)r[c]=i[c];return r},Gg=(i=>c=>i&&c instanceof i)(typeof Uint8Array<"u"&&Or(Uint8Array)),Qg=(i,c)=>{const s=(i&&i[Ui]).call(i);let o;for(;(o=s.next())&&!o.done;){const d=o.value;c.call(i,d[0],d[1])}},Xg=(i,c)=>{let r;const s=[];for(;(r=i.exec(c))!==null;)s.push(r);return s},Vg=Le("HTMLFormElement"),Zg=i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,s,o){return s.toUpperCase()+o}),Ih=(({hasOwnProperty:i})=>(c,r)=>i.call(c,r))(Object.prototype),Kg=Le("RegExp"),Xm=(i,c)=>{const r=Object.getOwnPropertyDescriptors(i),s={};Pa(r,(o,d)=>{let m;(m=c(o,d,i))!==!1&&(s[d]=m||o)}),Object.defineProperties(i,s)},Jg=i=>{Xm(i,(c,r)=>{if(fe(i)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const s=i[r];if(fe(s)){if(c.enumerable=!1,"writable"in c){c.writable=!1;return}c.set||(c.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},kg=(i,c)=>{const r={},s=o=>{o.forEach(d=>{r[d]=!0})};return kn(i)?s(i):s(String(i).split(c)),r},Fg=()=>{},Wg=(i,c)=>i!=null&&Number.isFinite(i=+i)?i:c;function $g(i){return!!(i&&fe(i.append)&&i[Lm]==="FormData"&&i[Ui])}const Pg=i=>{const c=new Array(10),r=(s,o)=>{if($a(s)){if(c.indexOf(s)>=0)return;if(Wa(s))return s;if(!("toJSON"in s)){c[o]=s;const d=kn(s)?[]:{};return Pa(s,(m,v)=>{const p=r(m,o+1);!Kn(p)&&(d[v]=p)}),c[o]=void 0,d}}return s};return r(i,0)},Ig=Le("AsyncFunction"),t1=i=>i&&($a(i)||fe(i))&&fe(i.then)&&fe(i.catch),Vm=((i,c)=>i?setImmediate:c?((r,s)=>(ln.addEventListener("message",({source:o,data:d})=>{o===ln&&d===r&&s.length&&s.shift()()},!1),o=>{s.push(o),ln.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",fe(ln.postMessage)),e1=typeof queueMicrotask<"u"?queueMicrotask.bind(ln):typeof process<"u"&&process.nextTick||Vm,l1=i=>i!=null&&fe(i[Ui]),z={isArray:kn,isArrayBuffer:wm,isBuffer:Wa,isFormData:_g,isArrayBufferView:vg,isString:pg,isNumber:Ym,isBoolean:gg,isObject:$a,isPlainObject:Ei,isEmptyObject:Sg,isReadableStream:Cg,isRequest:jg,isResponse:Ug,isHeaders:Mg,isUndefined:Kn,isDate:bg,isFile:Eg,isReactNativeBlob:Tg,isReactNative:Ag,isBlob:Og,isRegExp:Kg,isFunction:fe,isStream:Rg,isURLSearchParams:zg,isTypedArray:Gg,isFileList:xg,forEach:Pa,merge:pr,extend:Bg,trim:Dg,stripBOM:qg,inherits:Hg,toFlatObject:Lg,kindOf:Mi,kindOfTest:Le,endsWith:wg,toArray:Yg,forEachEntry:Qg,matchAll:Xg,isHTMLForm:Vg,hasOwnProperty:Ih,hasOwnProp:Ih,reduceDescriptors:Xm,freezeMethods:Jg,toObjectSet:kg,toCamelCase:Zg,noop:Fg,toFiniteNumber:Wg,findKey:Gm,global:ln,isContextDefined:Qm,isSpecCompliantForm:$g,toJSONObject:Pg,isAsyncFn:Ig,isThenable:t1,setImmediate:Vm,asap:e1,isIterable:l1};let tt=class Zm extends Error{static from(c,r,s,o,d,m){const v=new Zm(c.message,r||c.code,s,o,d);return v.cause=c,v.name=c.name,c.status!=null&&v.status==null&&(v.status=c.status),m&&Object.assign(v,m),v}constructor(c,r,s,o,d){super(c),Object.defineProperty(this,"message",{value:c,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),s&&(this.config=s),o&&(this.request=o),d&&(this.response=d,this.status=d.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.status}}};tt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";tt.ERR_BAD_OPTION="ERR_BAD_OPTION";tt.ECONNABORTED="ECONNABORTED";tt.ETIMEDOUT="ETIMEDOUT";tt.ERR_NETWORK="ERR_NETWORK";tt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";tt.ERR_DEPRECATED="ERR_DEPRECATED";tt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";tt.ERR_BAD_REQUEST="ERR_BAD_REQUEST";tt.ERR_CANCELED="ERR_CANCELED";tt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";tt.ERR_INVALID_URL="ERR_INVALID_URL";const n1=null;function gr(i){return z.isPlainObject(i)||z.isArray(i)}function Km(i){return z.endsWith(i,"[]")?i.slice(0,-2):i}function rr(i,c,r){return i?i.concat(c).map(function(o,d){return o=Km(o),!r&&d?"["+o+"]":o}).join(r?".":""):c}function a1(i){return z.isArray(i)&&!i.some(gr)}const u1=z.toFlatObject(z,{},null,function(c){return/^is[A-Z]/.test(c)});function Bi(i,c,r){if(!z.isObject(i))throw new TypeError("target must be an object");c=c||new FormData,r=z.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(D,U){return!z.isUndefined(U[D])});const s=r.metaTokens,o=r.visitor||E,d=r.dots,m=r.indexes,p=(r.Blob||typeof Blob<"u"&&Blob)&&z.isSpecCompliantForm(c);if(!z.isFunction(o))throw new TypeError("visitor must be a function");function y(x){if(x===null)return"";if(z.isDate(x))return x.toISOString();if(z.isBoolean(x))return x.toString();if(!p&&z.isBlob(x))throw new tt("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(x)||z.isTypedArray(x)?p&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function E(x,D,U){let Z=x;if(z.isReactNative(c)&&z.isReactNativeBlob(x))return c.append(rr(U,D,d),y(x)),!1;if(x&&!U&&typeof x=="object"){if(z.endsWith(D,"{}"))D=s?D:D.slice(0,-2),x=JSON.stringify(x);else if(z.isArray(x)&&a1(x)||(z.isFileList(x)||z.endsWith(D,"[]"))&&(Z=z.toArray(x)))return D=Km(D),Z.forEach(function(w,J){!(z.isUndefined(w)||w===null)&&c.append(m===!0?rr([D],J,d):m===null?D:D+"[]",y(w))}),!1}return gr(x)?!0:(c.append(rr(U,D,d),y(x)),!1)}const A=[],Y=Object.assign(u1,{defaultVisitor:E,convertValue:y,isVisitable:gr});function X(x,D){if(!z.isUndefined(x)){if(A.indexOf(x)!==-1)throw Error("Circular reference detected in "+D.join("."));A.push(x),z.forEach(x,function(Z,F){(!(z.isUndefined(Z)||Z===null)&&o.call(c,Z,z.isString(F)?F.trim():F,D,Y))===!0&&X(Z,D?D.concat(F):[F])}),A.pop()}}if(!z.isObject(i))throw new TypeError("data must be an object");return X(i),c}function tm(i){const c={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,function(s){return c[s]})}function xr(i,c){this._pairs=[],i&&Bi(i,this,c)}const Jm=xr.prototype;Jm.append=function(c,r){this._pairs.push([c,r])};Jm.toString=function(c){const r=c?function(s){return c.call(this,s,tm)}:tm;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function i1(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function km(i,c,r){if(!c)return i;const s=r&&r.encode||i1,o=z.isFunction(r)?{serialize:r}:r,d=o&&o.serialize;let m;if(d?m=d(c,o):m=z.isURLSearchParams(c)?c.toString():new xr(c,o).toString(s),m){const v=i.indexOf("#");v!==-1&&(i=i.slice(0,v)),i+=(i.indexOf("?")===-1?"?":"&")+m}return i}class em{constructor(){this.handlers=[]}use(c,r,s){return this.handlers.push({fulfilled:c,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(c){this.handlers[c]&&(this.handlers[c]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(c){z.forEach(this.handlers,function(s){s!==null&&c(s)})}}const Rr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},c1=typeof URLSearchParams<"u"?URLSearchParams:xr,s1=typeof FormData<"u"?FormData:null,r1=typeof Blob<"u"?Blob:null,f1={isBrowser:!0,classes:{URLSearchParams:c1,FormData:s1,Blob:r1},protocols:["http","https","file","blob","url","data"]},Nr=typeof window<"u"&&typeof document<"u",Sr=typeof navigator=="object"&&navigator||void 0,o1=Nr&&(!Sr||["ReactNative","NativeScript","NS"].indexOf(Sr.product)<0),d1=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",h1=Nr&&window.location.href||"http://localhost",m1=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Nr,hasStandardBrowserEnv:o1,hasStandardBrowserWebWorkerEnv:d1,navigator:Sr,origin:h1},Symbol.toStringTag,{value:"Module"})),Pt={...m1,...f1};function y1(i,c){return Bi(i,new Pt.classes.URLSearchParams,{visitor:function(r,s,o,d){return Pt.isNode&&z.isBuffer(r)?(this.append(s,r.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)},...c})}function v1(i){return z.matchAll(/\w+|\[(\w*)]/g,i).map(c=>c[0]==="[]"?"":c[1]||c[0])}function p1(i){const c={},r=Object.keys(i);let s;const o=r.length;let d;for(s=0;s=r.length;return m=!m&&z.isArray(o)?o.length:m,p?(z.hasOwnProp(o,m)?o[m]=[o[m],s]:o[m]=s,!v):((!o[m]||!z.isObject(o[m]))&&(o[m]=[]),c(r,s,o[m],d)&&z.isArray(o[m])&&(o[m]=p1(o[m])),!v)}if(z.isFormData(i)&&z.isFunction(i.entries)){const r={};return z.forEachEntry(i,(s,o)=>{c(v1(s),o,r,0)}),r}return null}function g1(i,c,r){if(z.isString(i))try{return(c||JSON.parse)(i),z.trim(i)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(i)}const Ia={transitional:Rr,adapter:["xhr","http","fetch"],transformRequest:[function(c,r){const s=r.getContentType()||"",o=s.indexOf("application/json")>-1,d=z.isObject(c);if(d&&z.isHTMLForm(c)&&(c=new FormData(c)),z.isFormData(c))return o?JSON.stringify(Fm(c)):c;if(z.isArrayBuffer(c)||z.isBuffer(c)||z.isStream(c)||z.isFile(c)||z.isBlob(c)||z.isReadableStream(c))return c;if(z.isArrayBufferView(c))return c.buffer;if(z.isURLSearchParams(c))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),c.toString();let v;if(d){if(s.indexOf("application/x-www-form-urlencoded")>-1)return y1(c,this.formSerializer).toString();if((v=z.isFileList(c))||s.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return Bi(v?{"files[]":c}:c,p&&new p,this.formSerializer)}}return d||o?(r.setContentType("application/json",!1),g1(c)):c}],transformResponse:[function(c){const r=this.transitional||Ia.transitional,s=r&&r.forcedJSONParsing,o=this.responseType==="json";if(z.isResponse(c)||z.isReadableStream(c))return c;if(c&&z.isString(c)&&(s&&!this.responseType||o)){const m=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(c,this.parseReviver)}catch(v){if(m)throw v.name==="SyntaxError"?tt.from(v,tt.ERR_BAD_RESPONSE,this,null,this.response):v}}return c}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pt.classes.FormData,Blob:Pt.classes.Blob},validateStatus:function(c){return c>=200&&c<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};z.forEach(["delete","get","head","post","put","patch"],i=>{Ia.headers[i]={}});const S1=z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),b1=i=>{const c={};let r,s,o;return i&&i.split(` `).forEach(function(m){o=m.indexOf(":"),r=m.substring(0,o).trim().toLowerCase(),s=m.substring(o+1).trim(),!(!r||c[r]&&S1[r])&&(r==="set-cookie"?c[r]?c[r].push(s):c[r]=[s]:c[r]=c[r]?c[r]+", "+s:s)}),c},lm=Symbol("internals");function Za(i){return i&&String(i).trim().toLowerCase()}function Ti(i){return i===!1||i==null?i:z.isArray(i)?i.map(Ti):String(i)}function E1(i){const c=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=r.exec(i);)c[s[1]]=s[2];return c}const T1=i=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim());function fr(i,c,r,s,o){if(z.isFunction(s))return s.call(this,c,r);if(o&&(c=r),!!z.isString(c)){if(z.isString(s))return c.indexOf(s)!==-1;if(z.isRegExp(s))return s.test(c)}}function A1(i){return i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(c,r,s)=>r.toUpperCase()+s)}function O1(i,c){const r=z.toCamelCase(" "+c);["get","set","has"].forEach(s=>{Object.defineProperty(i,s+r,{value:function(o,d,m){return this[s].call(this,c,o,d,m)},configurable:!0})})}let oe=class{constructor(c){c&&this.set(c)}set(c,r,s){const o=this;function d(v,p,y){const E=Za(p);if(!E)throw new Error("header name must be a non-empty string");const A=z.findKey(o,E);(!A||o[A]===void 0||y===!0||y===void 0&&o[A]!==!1)&&(o[A||p]=Ti(v))}const m=(v,p)=>z.forEach(v,(y,E)=>d(y,E,p));if(z.isPlainObject(c)||c instanceof this.constructor)m(c,r);else if(z.isString(c)&&(c=c.trim())&&!T1(c))m(b1(c),r);else if(z.isObject(c)&&z.isIterable(c)){let v={},p,y;for(const E of c){if(!z.isArray(E))throw TypeError("Object iterator must return a key-value pair");v[y=E[0]]=(p=v[y])?z.isArray(p)?[...p,E[1]]:[p,E[1]]:E[1]}m(v,r)}else c!=null&&d(r,c,s);return this}get(c,r){if(c=Za(c),c){const s=z.findKey(this,c);if(s){const o=this[s];if(!r)return o;if(r===!0)return E1(o);if(z.isFunction(r))return r.call(this,o,s);if(z.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(c,r){if(c=Za(c),c){const s=z.findKey(this,c);return!!(s&&this[s]!==void 0&&(!r||fr(this,this[s],s,r)))}return!1}delete(c,r){const s=this;let o=!1;function d(m){if(m=Za(m),m){const v=z.findKey(s,m);v&&(!r||fr(s,s[v],v,r))&&(delete s[v],o=!0)}}return z.isArray(c)?c.forEach(d):d(c),o}clear(c){const r=Object.keys(this);let s=r.length,o=!1;for(;s--;){const d=r[s];(!c||fr(this,this[d],d,c,!0))&&(delete this[d],o=!0)}return o}normalize(c){const r=this,s={};return z.forEach(this,(o,d)=>{const m=z.findKey(s,d);if(m){r[m]=Ti(o),delete r[d];return}const v=c?A1(d):String(d).trim();v!==d&&delete r[d],r[v]=Ti(o),s[v]=!0}),this}concat(...c){return this.constructor.concat(this,...c)}toJSON(c){const r=Object.create(null);return z.forEach(this,(s,o)=>{s!=null&&s!==!1&&(r[o]=c&&z.isArray(s)?s.join(", "):s)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([c,r])=>c+": "+r).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(c){return c instanceof this?c:new this(c)}static concat(c,...r){const s=new this(c);return r.forEach(o=>s.set(o)),s}static accessor(c){const s=(this[lm]=this[lm]={accessors:{}}).accessors,o=this.prototype;function d(m){const v=Za(m);s[v]||(O1(o,m),s[v]=!0)}return z.isArray(c)?c.forEach(d):d(c),this}};oe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);z.reduceDescriptors(oe.prototype,({value:i},c)=>{let r=c[0].toUpperCase()+c.slice(1);return{get:()=>i,set(s){this[r]=s}}});z.freezeMethods(oe);function or(i,c){const r=this||Ia,s=c||r,o=oe.from(s.headers);let d=s.data;return z.forEach(i,function(v){d=v.call(r,d,o.normalize(),c?c.status:void 0)}),o.normalize(),d}function Wm(i){return!!(i&&i.__CANCEL__)}let tu=class extends tt{constructor(c,r,s){super(c??"canceled",tt.ERR_CANCELED,r,s),this.name="CanceledError",this.__CANCEL__=!0}};function $m(i,c,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?i(r):c(new tt("Request failed with status code "+r.status,[tt.ERR_BAD_REQUEST,tt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function x1(i){const c=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return c&&c[1]||""}function R1(i,c){i=i||10;const r=new Array(i),s=new Array(i);let o=0,d=0,m;return c=c!==void 0?c:1e3,function(p){const y=Date.now(),E=s[d];m||(m=y),r[o]=p,s[o]=y;let A=d,Y=0;for(;A!==o;)Y+=r[A++],A=A%i;if(o=(o+1)%i,o===d&&(d=(d+1)%i),y-m{r=E,o=null,d&&(clearTimeout(d),d=null),i(...y)};return[(...y)=>{const E=Date.now(),A=E-r;A>=s?m(y,E):(o=y,d||(d=setTimeout(()=>{d=null,m(o)},s-A)))},()=>o&&m(o)]}const Ni=(i,c,r=3)=>{let s=0;const o=R1(50,250);return N1(d=>{const m=d.loaded,v=d.lengthComputable?d.total:void 0,p=m-s,y=o(p),E=m<=v;s=m;const A={loaded:m,total:v,progress:v?m/v:void 0,bytes:p,rate:y||void 0,estimated:y&&v&&E?(v-m)/y:void 0,event:d,lengthComputable:v!=null,[c?"download":"upload"]:!0};i(A)},r)},nm=(i,c)=>{const r=i!=null;return[s=>c[0]({lengthComputable:r,total:i,loaded:s}),c[1]]},am=i=>(...c)=>z.asap(()=>i(...c)),_1=Pt.hasStandardBrowserEnv?((i,c)=>r=>(r=new URL(r,Pt.origin),i.protocol===r.protocol&&i.host===r.host&&(c||i.port===r.port)))(new URL(Pt.origin),Pt.navigator&&/(msie|trident)/i.test(Pt.navigator.userAgent)):()=>!0,z1=Pt.hasStandardBrowserEnv?{write(i,c,r,s,o,d,m){if(typeof document>"u")return;const v=[`${i}=${encodeURIComponent(c)}`];z.isNumber(r)&&v.push(`expires=${new Date(r).toUTCString()}`),z.isString(s)&&v.push(`path=${s}`),z.isString(o)&&v.push(`domain=${o}`),d===!0&&v.push("secure"),z.isString(m)&&v.push(`SameSite=${m}`),document.cookie=v.join("; ")},read(i){if(typeof document>"u")return null;const c=document.cookie.match(new RegExp("(?:^|; )"+i+"=([^;]*)"));return c?decodeURIComponent(c[1]):null},remove(i){this.write(i,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function C1(i){return typeof i!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function j1(i,c){return c?i.replace(/\/?\/$/,"")+"/"+c.replace(/^\/+/,""):i}function Pm(i,c,r){let s=!C1(c);return i&&(s||r==!1)?j1(i,c):c}const um=i=>i instanceof oe?{...i}:i;function an(i,c){c=c||{};const r={};function s(y,E,A,Y){return z.isPlainObject(y)&&z.isPlainObject(E)?z.merge.call({caseless:Y},y,E):z.isPlainObject(E)?z.merge({},E):z.isArray(E)?E.slice():E}function o(y,E,A,Y){if(z.isUndefined(E)){if(!z.isUndefined(y))return s(void 0,y,A,Y)}else return s(y,E,A,Y)}function d(y,E){if(!z.isUndefined(E))return s(void 0,E)}function m(y,E){if(z.isUndefined(E)){if(!z.isUndefined(y))return s(void 0,y)}else return s(void 0,E)}function v(y,E,A){if(A in c)return s(y,E);if(A in i)return s(void 0,y)}const p={url:d,method:d,data:d,baseURL:m,transformRequest:m,transformResponse:m,paramsSerializer:m,timeout:m,timeoutMessage:m,withCredentials:m,withXSRFToken:m,adapter:m,responseType:m,xsrfCookieName:m,xsrfHeaderName:m,onUploadProgress:m,onDownloadProgress:m,decompress:m,maxContentLength:m,maxBodyLength:m,beforeRedirect:m,transport:m,httpAgent:m,httpsAgent:m,cancelToken:m,socketPath:m,responseEncoding:m,validateStatus:v,headers:(y,E,A)=>o(um(y),um(E),A,!0)};return z.forEach(Object.keys({...i,...c}),function(E){if(E==="__proto__"||E==="constructor"||E==="prototype")return;const A=z.hasOwnProp(p,E)?p[E]:o,Y=A(i[E],c[E],E);z.isUndefined(Y)&&A!==v||(r[E]=Y)}),r}const Im=i=>{const c=an({},i);let{data:r,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:d,headers:m,auth:v}=c;if(c.headers=m=oe.from(m),c.url=km(Pm(c.baseURL,c.url,c.allowAbsoluteUrls),i.params,i.paramsSerializer),v&&m.set("Authorization","Basic "+btoa((v.username||"")+":"+(v.password?unescape(encodeURIComponent(v.password)):""))),z.isFormData(r)){if(Pt.hasStandardBrowserEnv||Pt.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if(z.isFunction(r.getHeaders)){const p=r.getHeaders(),y=["content-type","content-length"];Object.entries(p).forEach(([E,A])=>{y.includes(E.toLowerCase())&&m.set(E,A)})}}if(Pt.hasStandardBrowserEnv&&(s&&z.isFunction(s)&&(s=s(c)),s||s!==!1&&_1(c.url))){const p=o&&d&&z1.read(d);p&&m.set(o,p)}return c},U1=typeof XMLHttpRequest<"u",M1=U1&&function(i){return new Promise(function(r,s){const o=Im(i);let d=o.data;const m=oe.from(o.headers).normalize();let{responseType:v,onUploadProgress:p,onDownloadProgress:y}=o,E,A,Y,X,x;function D(){X&&X(),x&&x(),o.cancelToken&&o.cancelToken.unsubscribe(E),o.signal&&o.signal.removeEventListener("abort",E)}let U=new XMLHttpRequest;U.open(o.method.toUpperCase(),o.url,!0),U.timeout=o.timeout;function Z(){if(!U)return;const w=oe.from("getAllResponseHeaders"in U&&U.getAllResponseHeaders()),st={data:!v||v==="text"||v==="json"?U.responseText:U.response,status:U.status,statusText:U.statusText,headers:w,config:i,request:U};$m(function(P){r(P),D()},function(P){s(P),D()},st),U=null}"onloadend"in U?U.onloadend=Z:U.onreadystatechange=function(){!U||U.readyState!==4||U.status===0&&!(U.responseURL&&U.responseURL.indexOf("file:")===0)||setTimeout(Z)},U.onabort=function(){U&&(s(new tt("Request aborted",tt.ECONNABORTED,i,U)),U=null)},U.onerror=function(J){const st=J&&J.message?J.message:"Network Error",Ot=new tt(st,tt.ERR_NETWORK,i,U);Ot.event=J||null,s(Ot),U=null},U.ontimeout=function(){let J=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const st=o.transitional||Rr;o.timeoutErrorMessage&&(J=o.timeoutErrorMessage),s(new tt(J,st.clarifyTimeoutError?tt.ETIMEDOUT:tt.ECONNABORTED,i,U)),U=null},d===void 0&&m.setContentType(null),"setRequestHeader"in U&&z.forEach(m.toJSON(),function(J,st){U.setRequestHeader(st,J)}),z.isUndefined(o.withCredentials)||(U.withCredentials=!!o.withCredentials),v&&v!=="json"&&(U.responseType=o.responseType),y&&([Y,x]=Ni(y,!0),U.addEventListener("progress",Y)),p&&U.upload&&([A,X]=Ni(p),U.upload.addEventListener("progress",A),U.upload.addEventListener("loadend",X)),(o.cancelToken||o.signal)&&(E=w=>{U&&(s(!w||w.type?new tu(null,i,U):w),U.abort(),U=null)},o.cancelToken&&o.cancelToken.subscribe(E),o.signal&&(o.signal.aborted?E():o.signal.addEventListener("abort",E)));const F=x1(o.url);if(F&&Pt.protocols.indexOf(F)===-1){s(new tt("Unsupported protocol "+F+":",tt.ERR_BAD_REQUEST,i));return}U.send(d||null)})},D1=(i,c)=>{const{length:r}=i=i?i.filter(Boolean):[];if(c||r){let s=new AbortController,o;const d=function(y){if(!o){o=!0,v();const E=y instanceof Error?y:this.reason;s.abort(E instanceof tt?E:new tu(E instanceof Error?E.message:E))}};let m=c&&setTimeout(()=>{m=null,d(new tt(`timeout of ${c}ms exceeded`,tt.ETIMEDOUT))},c);const v=()=>{i&&(m&&clearTimeout(m),m=null,i.forEach(y=>{y.unsubscribe?y.unsubscribe(d):y.removeEventListener("abort",d)}),i=null)};i.forEach(y=>y.addEventListener("abort",d));const{signal:p}=s;return p.unsubscribe=()=>z.asap(v),p}},B1=function*(i,c){let r=i.byteLength;if(r{const o=q1(i,c);let d=0,m,v=p=>{m||(m=!0,s&&s(p))};return new ReadableStream({async pull(p){try{const{done:y,value:E}=await o.next();if(y){v(),p.close();return}let A=E.byteLength;if(r){let Y=d+=A;r(Y)}p.enqueue(new Uint8Array(E))}catch(y){throw v(y),y}},cancel(p){return v(p),o.return()}},{highWaterMark:2})},cm=64*1024,{isFunction:bi}=z,L1=(({Request:i,Response:c})=>({Request:i,Response:c}))(z.global),{ReadableStream:sm,TextEncoder:rm}=z.global,fm=(i,...c)=>{try{return!!i(...c)}catch{return!1}},w1=i=>{i=z.merge.call({skipUndefined:!0},L1,i);const{fetch:c,Request:r,Response:s}=i,o=c?bi(c):typeof fetch=="function",d=bi(r),m=bi(s);if(!o)return!1;const v=o&&bi(sm),p=o&&(typeof rm=="function"?(x=>D=>x.encode(D))(new rm):async x=>new Uint8Array(await new r(x).arrayBuffer())),y=d&&v&&fm(()=>{let x=!1;const D=new r(Pt.origin,{body:new sm,method:"POST",get duplex(){return x=!0,"half"}}).headers.has("Content-Type");return x&&!D}),E=m&&v&&fm(()=>z.isReadableStream(new s("").body)),A={stream:E&&(x=>x.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(x=>{!A[x]&&(A[x]=(D,U)=>{let Z=D&&D[x];if(Z)return Z.call(D);throw new tt(`Response type '${x}' is not supported`,tt.ERR_NOT_SUPPORT,U)})});const Y=async x=>{if(x==null)return 0;if(z.isBlob(x))return x.size;if(z.isSpecCompliantForm(x))return(await new r(Pt.origin,{method:"POST",body:x}).arrayBuffer()).byteLength;if(z.isArrayBufferView(x)||z.isArrayBuffer(x))return x.byteLength;if(z.isURLSearchParams(x)&&(x=x+""),z.isString(x))return(await p(x)).byteLength},X=async(x,D)=>{const U=z.toFiniteNumber(x.getContentLength());return U??Y(D)};return async x=>{let{url:D,method:U,data:Z,signal:F,cancelToken:w,timeout:J,onDownloadProgress:st,onUploadProgress:Ot,responseType:P,headers:_t,withCredentials:Vt="same-origin",fetchOptions:de}=Im(x),It=c||fetch;P=P?(P+"").toLowerCase():"text";let Yt=D1([F,w&&w.toAbortSignal()],J),he=null;const Zt=Yt&&Yt.unsubscribe&&(()=>{Yt.unsubscribe()});let le;try{if(Ot&&y&&U!=="get"&&U!=="head"&&(le=await X(_t,Z))!==0){let S=new r(D,{method:"POST",body:Z,duplex:"half"}),H;if(z.isFormData(Z)&&(H=S.headers.get("content-type"))&&_t.setContentType(H),S.body){const[Q,V]=nm(le,Ni(am(Ot)));Z=im(S.body,cm,Q,V)}}z.isString(Vt)||(Vt=Vt?"include":"omit");const j=d&&"credentials"in r.prototype,G={...de,signal:Yt,method:U.toUpperCase(),headers:_t.normalize().toJSON(),body:Z,duplex:"half",credentials:j?Vt:void 0};he=d&&new r(D,G);let W=await(d?It(he,de):It(D,G));const mt=E&&(P==="stream"||P==="response");if(E&&(st||mt&&Zt)){const S={};["status","statusText","headers"].forEach(et=>{S[et]=W[et]});const H=z.toFiniteNumber(W.headers.get("content-length")),[Q,V]=st&&nm(H,Ni(am(st),!0))||[];W=new s(im(W.body,cm,Q,()=>{V&&V(),Zt&&Zt()}),S)}P=P||"text";let pt=await A[z.findKey(A,P)||"text"](W,x);return!mt&&Zt&&Zt(),await new Promise((S,H)=>{$m(S,H,{data:pt,headers:oe.from(W.headers),status:W.status,statusText:W.statusText,config:x,request:he})})}catch(j){throw Zt&&Zt(),j&&j.name==="TypeError"&&/Load failed|fetch/i.test(j.message)?Object.assign(new tt("Network Error",tt.ERR_NETWORK,x,he,j&&j.response),{cause:j.cause||j}):tt.from(j,j&&j.code,x,he,j&&j.response)}}},Y1=new Map,ty=i=>{let c=i&&i.env||{};const{fetch:r,Request:s,Response:o}=c,d=[s,o,r];let m=d.length,v=m,p,y,E=Y1;for(;v--;)p=d[v],y=E.get(p),y===void 0&&E.set(p,y=v?new Map:w1(c)),E=y;return y};ty();const _r={http:n1,xhr:M1,fetch:{get:ty}};z.forEach(_r,(i,c)=>{if(i){try{Object.defineProperty(i,"name",{value:c})}catch{}Object.defineProperty(i,"adapterName",{value:c})}});const om=i=>`- ${i}`,G1=i=>z.isFunction(i)||i===null||i===!1;function Q1(i,c){i=z.isArray(i)?i:[i];const{length:r}=i;let s,o;const d={};for(let m=0;m`adapter ${p} `+(y===!1?"is not supported by the environment":"is not available in the build"));let v=r?m.length>1?`since : `+m.map(om).join(` `):" "+om(m[0]):"as no adapter specified";throw new tt("There is no suitable adapter to dispatch the request "+v,"ERR_NOT_SUPPORT")}return o}const ey={getAdapter:Q1,adapters:_r};function dr(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new tu(null,i)}function dm(i){return dr(i),i.headers=oe.from(i.headers),i.data=or.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),ey.getAdapter(i.adapter||Ia.adapter,i)(i).then(function(s){return dr(i),s.data=or.call(i,i.transformResponse,s),s.headers=oe.from(s.headers),s},function(s){return Wm(s)||(dr(i),s&&s.response&&(s.response.data=or.call(i,i.transformResponse,s.response),s.response.headers=oe.from(s.response.headers))),Promise.reject(s)})}const ly="1.13.6",qi={};["object","boolean","number","function","string","symbol"].forEach((i,c)=>{qi[i]=function(s){return typeof s===i||"a"+(c<1?"n ":" ")+i}});const hm={};qi.transitional=function(c,r,s){function o(d,m){return"[Axios v"+ly+"] Transitional option '"+d+"'"+m+(s?". "+s:"")}return(d,m,v)=>{if(c===!1)throw new tt(o(m," has been removed"+(r?" in "+r:"")),tt.ERR_DEPRECATED);return r&&!hm[m]&&(hm[m]=!0,console.warn(o(m," has been deprecated since v"+r+" and will be removed in the near future"))),c?c(d,m,v):!0}};qi.spelling=function(c){return(r,s)=>(console.warn(`${s} is likely a misspelling of ${c}`),!0)};function X1(i,c,r){if(typeof i!="object")throw new tt("options must be an object",tt.ERR_BAD_OPTION_VALUE);const s=Object.keys(i);let o=s.length;for(;o-- >0;){const d=s[o],m=c[d];if(m){const v=i[d],p=v===void 0||m(v,d,i);if(p!==!0)throw new tt("option "+d+" must be "+p,tt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new tt("Unknown option "+d,tt.ERR_BAD_OPTION)}}const Ai={assertOptions:X1,validators:qi},De=Ai.validators;let nn=class{constructor(c){this.defaults=c||{},this.interceptors={request:new em,response:new em}}async request(c,r){try{return await this._request(c,r)}catch(s){if(s instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const d=o.stack?o.stack.replace(/^.+\n/,""):"";try{s.stack?d&&!String(s.stack).endsWith(d.replace(/^.+\n.+\n/,""))&&(s.stack+=` `+d):s.stack=d}catch{}}throw s}}_request(c,r){typeof c=="string"?(r=r||{},r.url=c):r=c||{},r=an(this.defaults,r);const{transitional:s,paramsSerializer:o,headers:d}=r;s!==void 0&&Ai.assertOptions(s,{silentJSONParsing:De.transitional(De.boolean),forcedJSONParsing:De.transitional(De.boolean),clarifyTimeoutError:De.transitional(De.boolean),legacyInterceptorReqResOrdering:De.transitional(De.boolean)},!1),o!=null&&(z.isFunction(o)?r.paramsSerializer={serialize:o}:Ai.assertOptions(o,{encode:De.function,serialize:De.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Ai.assertOptions(r,{baseUrl:De.spelling("baseURL"),withXsrfToken:De.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let m=d&&z.merge(d.common,d[r.method]);d&&z.forEach(["delete","get","head","post","put","patch","common"],x=>{delete d[x]}),r.headers=oe.concat(m,d);const v=[];let p=!0;this.interceptors.request.forEach(function(D){if(typeof D.runWhen=="function"&&D.runWhen(r)===!1)return;p=p&&D.synchronous;const U=r.transitional||Rr;U&&U.legacyInterceptorReqResOrdering?v.unshift(D.fulfilled,D.rejected):v.push(D.fulfilled,D.rejected)});const y=[];this.interceptors.response.forEach(function(D){y.push(D.fulfilled,D.rejected)});let E,A=0,Y;if(!p){const x=[dm.bind(this),void 0];for(x.unshift(...v),x.push(...y),Y=x.length,E=Promise.resolve(r);A{if(!s._listeners)return;let d=s._listeners.length;for(;d-- >0;)s._listeners[d](o);s._listeners=null}),this.promise.then=o=>{let d;const m=new Promise(v=>{s.subscribe(v),d=v}).then(o);return m.cancel=function(){s.unsubscribe(d)},m},c(function(d,m,v){s.reason||(s.reason=new tu(d,m,v),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(c){if(this.reason){c(this.reason);return}this._listeners?this._listeners.push(c):this._listeners=[c]}unsubscribe(c){if(!this._listeners)return;const r=this._listeners.indexOf(c);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const c=new AbortController,r=s=>{c.abort(s)};return this.subscribe(r),c.signal.unsubscribe=()=>this.unsubscribe(r),c.signal}static source(){let c;return{token:new ny(function(o){c=o}),cancel:c}}};function Z1(i){return function(r){return i.apply(null,r)}}function K1(i){return z.isObject(i)&&i.isAxiosError===!0}const br={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(br).forEach(([i,c])=>{br[c]=i});function ay(i){const c=new nn(i),r=Hm(nn.prototype.request,c);return z.extend(r,nn.prototype,c,{allOwnKeys:!0}),z.extend(r,c,null,{allOwnKeys:!0}),r.create=function(o){return ay(an(i,o))},r}const Bt=ay(Ia);Bt.Axios=nn;Bt.CanceledError=tu;Bt.CancelToken=V1;Bt.isCancel=Wm;Bt.VERSION=ly;Bt.toFormData=Bi;Bt.AxiosError=tt;Bt.Cancel=Bt.CanceledError;Bt.all=function(c){return Promise.all(c)};Bt.spread=Z1;Bt.isAxiosError=K1;Bt.mergeConfig=an;Bt.AxiosHeaders=oe;Bt.formToJSON=i=>Fm(z.isHTMLForm(i)?new FormData(i):i);Bt.getAdapter=ey.getAdapter;Bt.HttpStatusCode=br;Bt.default=Bt;const{Axios:tS,AxiosError:eS,CanceledError:lS,isCancel:nS,CancelToken:aS,VERSION:uS,all:iS,Cancel:cS,isAxiosError:sS,spread:rS,toFormData:fS,AxiosHeaders:oS,HttpStatusCode:dS,formToJSON:hS,getAdapter:mS,mergeConfig:yS}=Bt,J1="https://openlibrary.org/search.json";function k1(i){return{title:i.title||"Sans titre",author:Array.isArray(i.author_name)?i.author_name[0]:"Auteur inconnu",year:typeof i.first_publish_year=="number"?i.first_publish_year:new Date().getFullYear(),genre:Array.isArray(i.subject)?i.subject[0]:"",price:10,read:!1}}function mm(i,c){return i.key||i.cover_edition_key||`${i.title||"work"}-${c}`}function F1(){const{postBook:i}=ji(),[c,r]=B.useState(""),[s,o]=B.useState(!1),[d,m]=B.useState(null),[v,p]=B.useState([]),[y,E]=B.useState(()=>new Set),[A,Y]=B.useState("");async function X(D){var Z,F;D.preventDefault();const U=c.trim();if(U){o(!0),m(null),p([]),E(()=>new Set),Y(U);try{const{data:w}=await Bt.get(J1,{params:{q:U,limit:15},timeout:15e3});p(Array.isArray(w.docs)?w.docs:[])}catch(w){m(((F=(Z=w.response)==null?void 0:Z.data)==null?void 0:F.error)||w.message||"Impossible de contacter Open Library.")}finally{o(!1)}}}function x(D,U){i(k1(D));const Z=mm(D,U);E(F=>new Set(F).add(Z))}return T.jsxs("div",{className:"search-page",children:[T.jsx("h2",{className:"search-page-title",children:"Recherche Open Library"}),T.jsx("p",{className:"search-page-lead",children:"Interroge l’API publique Open Library avec Axios, puis ajoute un ouvrage à ton catalogue local."}),T.jsxs("form",{className:"search-form",onSubmit:X,children:[T.jsx("input",{type:"search",className:"search search-wide",placeholder:"Titre, auteur, sujet…",value:c,onChange:D=>r(D.target.value),"aria-label":"Requête Open Library"}),T.jsx("button",{type:"submit",className:"btn primary",disabled:s,children:s?"Recherche…":"Rechercher"})]}),d?T.jsx("p",{className:"search-error",role:"alert",children:d}):null,!s&&v.length===0&&!d&&!A?T.jsx("p",{className:"search-hint",children:"Saisis un mot-clé et lance la recherche."}):null,!s&&v.length===0&&!d&&A?T.jsxs("p",{className:"search-hint",children:["Aucun résultat pour « ",A," »."]}):null,v.length>0?T.jsx("ul",{className:"ol-results",children:v.map((D,U)=>{const Z=mm(D,U),F=typeof D.first_publish_year=="number"?D.first_publish_year:"—",w=Array.isArray(D.author_name)?D.author_name.slice(0,2).join(", "):"—",J=y.has(Z);return T.jsxs("li",{className:"ol-result-card",children:[T.jsx("h3",{className:"ol-result-title",children:D.title||"Sans titre"}),T.jsxs("p",{className:"ol-result-meta",children:[w," · ",F]}),T.jsx("button",{type:"button",className:"btn small primary",onClick:()=>x(D,U),disabled:J,children:J?"Enregistré":"Enregistrer (POST /api/books)"})]},Z)})}):null]})}function W1(){return T.jsx(Dp,{children:T.jsxs(en,{path:"/",element:T.jsx(ig,{}),children:[T.jsx(en,{index:!0,element:T.jsx(hg,{})}),T.jsx(en,{path:"recherche",element:T.jsx(F1,{})}),T.jsx(en,{path:"commande",element:T.jsx(rg,{})}),T.jsx(en,{path:"promotions",element:T.jsx(mg,{})}),T.jsx(en,{path:":id",element:T.jsx(cg,{})})]})})}Yv.createRoot(document.getElementById("root")).render(T.jsx(B.StrictMode,{children:T.jsx(Qp,{children:T.jsx(ug,{children:T.jsx(eg,{children:T.jsx(Wp,{children:T.jsx(W1,{})})})})})}));