@react-motion-router/core 1.4.3 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -68,7 +68,7 @@ export default abstract class RouterBase<P extends RouterBaseProps = RouterBaseP
68
68
  abstract onAnimationEnd: (e: PageAnimationEndEvent) => void;
69
69
  abstract onGestureNavigationStart: () => void;
70
70
  abstract onGestureNavigationEnd: () => void;
71
- abstract onPopStateListener: (e: Event) => void;
71
+ protected onPopStateListener(e: Event): void;
72
72
  abstract onBackListener: (e: BackEvent) => void;
73
73
  abstract onNavigateListener: (e: NavigateEvent) => void;
74
74
  onDocumentTitleChange: (title: string | null) => void;
@@ -36,7 +36,6 @@ export default abstract class ScreenBase<P extends ScreenBaseProps = ScreenBaseP
36
36
  protected name: string;
37
37
  protected sharedElementScene: SharedElementScene;
38
38
  protected ref: HTMLElement | null;
39
- protected contextParams: any;
40
39
  private onRef;
41
40
  private animation;
42
41
  private pseudoElementAnimation;
@@ -44,11 +43,6 @@ export default abstract class ScreenBase<P extends ScreenBaseProps = ScreenBaseP
44
43
  protected animationProviderRef: HTMLElement | null;
45
44
  static contextType: import("react").Context<import("./RouterData").default<import("./NavigationBase").default> | null>;
46
45
  context: React.ContextType<typeof RouterDataContext>;
47
- static defaultProps: {
48
- route: {
49
- params: {};
50
- };
51
- };
52
46
  state: S;
53
47
  componentDidMount(): void;
54
48
  shouldComponentUpdate(nextProps: P): boolean;
package/build/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- import*as t from"react";var e={837:(t,e,n)=>{var i=n(810),s=Symbol.for("react.element"),o=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function l(t,e,n){var i,o={},l=null,u=null;for(i in void 0!==n&&(l=""+n),void 0!==e.key&&(l=""+e.key),void 0!==e.ref&&(u=e.ref),e)r.call(e,i)&&!h.hasOwnProperty(i)&&(o[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===o[i]&&(o[i]=e[i]);return{$$typeof:s,type:t,key:l,ref:u,props:o,_owner:a.current}}e.Fragment=o,e.jsx=l,e.jsxs=l},322:(t,e,n)=>{t.exports=n(837)},174:(t,e,n)=>{n.d(e,{Nu:()=>l,PV:()=>u,Po:()=>p,QN:()=>a,V_:()=>g,Vo:()=>m,cT:()=>o,dw:()=>y,e1:()=>h,fJ:()=>d,hR:()=>s,kI:()=>v,r2:()=>f,rL:()=>c,uZ:()=>r});var i=n(810);function s(t,e=[],n=!0){let i="";const s={};let o=0;for(let r in t)if(!e.includes(r)){if(o<t.length){const e=t[r];let n=t.getPropertyValue(e);if("visibility"===e)n="visible";i+=`${e}:${n};`}else{if(!n)break;let e=r,i=t[e];if("string"==typeof i&&"cssText"!==e&&!e.includes("webkit")&&!e.includes("grid")){switch(e){case"offset":e="cssOffset";break;case"float":e="cssFloat";break;case"visibility":i="visible"}s[e]=i}}o++}return[i,s]}function o(t,e=[]){const n={};for(const i in t)if(t[i]&&t[i].length&&"function"!=typeof t[i]){if(/^\d+$/.test(i))continue;if("offset"===i)continue;if(e.includes(i))continue;n[i]=t[i]}return n}function r(t,e,n){return t<e?e:n&&t>n?n:t}function a(t,e,n=window.location.origin){if(void 0===t||void 0===e)return t===e?{exact:!0,matchedPathname:e}:null;const i=new URLPattern(t,n),s=new URL(e,n),o=i.exec(s);let r="",a="";for(let t=0;t<i.pathname.length;t++){if(i.pathname[t]!==s.pathname[t]){a=s.pathname.substring(t);break}r+=i.pathname[t]}return o?{exact:t===e,matchedPathname:r,rest:a}:null}function h(t,e,n=window.location.origin){return e.some((e=>a(e,t,n)))}function l(t,e=window){return new Promise((n=>{queueMicrotask((()=>n(e.dispatchEvent(t))))}))}function u(t,e){return"string"==typeof e&&(e=new URL(e)),"string"!=typeof t&&(t=t.pathname),t=t.replace(/^\//,""),e.pathname.endsWith("/")||(e=new URL(e.href+"/")),new URL(t,e)}function c(t){const e=new URLSearchParams(decodeURI(t)).entries(),n={};for(const[t,i]of e){let e="";try{e=JSON.parse(i)}catch(t){console.warn("Non JSON serialisable value was passed as URL route param."),e=i}n[t]=e}return Object.keys(n).length?n:void 0}function d(t,e){return(e||c)(t)||{}}function p(t,e){try{return(e||function(t){return new URLSearchParams(t).toString()})(t)}catch(t){console.error(t),console.warn("Non JSON serialisable value was passed as route param to Anchor.")}return""}function m(t){const e=(0,i.lazy)(t);return e.preload=()=>{const n=t();return n.then((t=>e.preloaded=t.default)).catch(console.error),n},e}function v(t,e){let n=e;return new Promise(((s,o)=>{let r=!1;for(;n;){const h=n.routes;if(i.Children.forEach(h,(e=>{if(r)return;if(!(0,i.isValidElement)(e))return;a(e.props.path,t)&&(r=!0,queueMicrotask((async()=>{if("preload"in e.props.component)try{await e.props.component.preload(),s(r)}catch(t){o(t)}})))})),r)break;n=e.parentRouterData}r||s(!1)}))}function g(t,e=0){var n;const i=null===(n=null==t?void 0:t.effect)||void 0===n?void 0:n.getTiming().duration;return Number(i)||e}const f={in:{type:"none",duration:0},out:{type:"none",duration:0}},y=2147483647},623:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const s=i(n(813));class o extends s.default{constructor(t){super("doubletap",t)}}e.default=o},813:(t,e)=>{var n;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.tap=0]="tap",t[t.longpress=1]="longpress",t[t.pinchstart=2]="pinchstart",t[t.pinch=3]="pinch",t[t.pinchend=4]="pinchend",t[t.rotatestart=5]="rotatestart",t[t.rotate=6]="rotate",t[t.rotateend=7]="rotateend",t[t.swipestart=8]="swipestart",t[t.swipe=9]="swipe",t[t.swipeend=10]="swipeend",t[t.panstart=11]="panstart",t[t.pan=12]="pan",t[t.panend=13]="panend",t[t.doubletap=14]="doubletap"}(n||(n={})),void 0===window.TouchEvent&&(window.TouchEvent=PointerEvent);class i extends TouchEvent{constructor(t,e){if(super(t,{touches:Array.from(e.touches),targetTouches:Array.from(e.targetTouches),changedTouches:Array.from(e.changedTouches),ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,bubbles:!0,cancelable:!0}),t.includes("end")||e.type.includes("end"))return this.gestureTarget=e.changedTouches[0].target,this.x=e.changedTouches[0].clientX,void(this.y=e.changedTouches[0].clientY);this.gestureTarget=e.touches[0].target,this.x=e.touches[0].clientX,this.y=e.touches[0].clientY}}e.default=i},646:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const s=i(n(813));class o extends s.default{constructor(t,e){super("longpress",t),this.duration=0,this.duration=e}}e.default=o},577:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PanEndEvent=e.PanStartEvent=void 0;const s=i(n(813));var o;!function(t){t[t.start=0]="start",t[t.end=1]="end"}(o||(o={}));class r extends s.default{constructor(t,e,n){let i;switch(n){case"start":i="panstart";break;case"end":i="panend";break;default:i="pan"}super(i,t),this.velocity=e.velocity,this.translation={x:e.translation.x,y:e.translation.y,magnitude:e.translation.magnitude,clientX:e.translation.clientX,clientY:e.translation.clientY,clientMagnitude:e.translation.clientMagnitude}}}e.default=class extends r{constructor(t,e){super(t,e)}};e.PanStartEvent=class extends r{constructor(t,e){super(t,e,"start")}};e.PanEndEvent=class extends r{constructor(t,e){super(t,e,"end")}}},630:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PinchEndEvent=e.PinchStartEvent=void 0;const s=i(n(813));var o;!function(t){t[t.start=0]="start",t[t.end=1]="end"}(o||(o={}));class r extends s.default{constructor(t,e,n){let i;switch(n){case"start":i="pinchstart";break;case"end":i="pinchend";break;default:i="pinch"}super(i,t),Object.defineProperty(this,"scale",{value:e.scale,writable:!1})}}e.default=class extends r{constructor(t,e){super(t,e)}};e.PinchStartEvent=class extends r{constructor(t,e){super(t,e,"start")}};e.PinchEndEvent=class extends r{constructor(t,e){super(t,e,"end")}}},859:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.RotateEndEvent=e.RotateStartEvent=void 0;const s=i(n(813));var o;!function(t){t[t.start=0]="start",t[t.end=1]="end"}(o||(o={}));class r extends s.default{constructor(t,e,n){let i;switch(n){case"start":i="rotatestart";break;case"end":i="rotateend";break;default:i="rotate"}super(i,t),this.anchor={x:e.anchor.x,y:e.anchor.y,clientX:e.anchor.clientX,clientY:e.anchor.clientY},Object.defineProperty(this,"rotation",{value:e.rotation,writable:!1}),this.rotationDeg=e.rotationDeg}}e.default=class extends r{constructor(t,e){super(t,e)}};e.RotateStartEvent=class extends r{constructor(t,e){super(t,e,"start")}};e.RotateEndEvent=class extends r{constructor(t,e){super(t,e,"end")}}},224:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SwipeEndEvent=e.SwipeStartEvent=void 0;const s=i(n(813));var o;!function(t){t[t.start=0]="start",t[t.end=1]="end"}(o||(o={}));class r extends s.default{constructor(t,e,n){let i;switch(n){case"start":i="swipestart";break;case"end":i="swipeend";break;default:i="swipe"}super(i,t),this.velocity=e.velocity,this.direction=e.direction}}e.default=class extends r{constructor(t,e){super(t,e)}};e.SwipeStartEvent=class extends r{constructor(t,e){super(t,e,"start")}};e.SwipeEndEvent=class extends r{constructor(t,e){super(t,e,"end")}}},884:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const s=i(n(813));class o extends s.default{constructor(t){super("tap",t)}}e.default=o},878:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(e,n);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,s)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),s=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return s(e,t),e},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.RotateEndEvent=e.RotateEvent=e.RotateStartEvent=e.PinchEndEvent=e.PinchEvent=e.PinchStartEvent=e.PanEndEvent=e.PanEvent=e.PanStartEvent=e.SwipeEndEvent=e.SwipeEvent=e.SwipeStartEvent=e.DoubleTapEvent=e.LongPressEvent=e.GestureEvent=e.TapEvent=void 0;const a=r(n(813));e.GestureEvent=a.default;const h=r(n(646));e.LongPressEvent=h.default;const l=r(n(884));e.TapEvent=l.default;const u=r(n(623));e.DoubleTapEvent=u.default;const c=o(n(224));e.SwipeEvent=c.default,Object.defineProperty(e,"SwipeEndEvent",{enumerable:!0,get:function(){return c.SwipeEndEvent}}),Object.defineProperty(e,"SwipeStartEvent",{enumerable:!0,get:function(){return c.SwipeStartEvent}});const d=o(n(577));e.PanEvent=d.default,Object.defineProperty(e,"PanEndEvent",{enumerable:!0,get:function(){return d.PanEndEvent}}),Object.defineProperty(e,"PanStartEvent",{enumerable:!0,get:function(){return d.PanStartEvent}});const p=o(n(630));e.PinchEvent=p.default,Object.defineProperty(e,"PinchEndEvent",{enumerable:!0,get:function(){return p.PinchEndEvent}}),Object.defineProperty(e,"PinchStartEvent",{enumerable:!0,get:function(){return p.PinchStartEvent}});const m=o(n(859));e.RotateEvent=m.default,Object.defineProperty(e,"RotateEndEvent",{enumerable:!0,get:function(){return m.RotateEndEvent}}),Object.defineProperty(e,"RotateStartEvent",{enumerable:!0,get:function(){return m.RotateStartEvent}});const v=n(47);var g;!function(t){t[t.right=0]="right",t[t.up=1]="up",t[t.left=2]="left",t[t.down=3]="down"}(g||(g={}));class f{constructor(){this.touchStart=new TouchEvent("touchstart")||{},this.touchMove=new TouchEvent("touchmove")||{},this.touchEnd=new TouchEvent("touchend")||{},this.touchCancel=new TouchEvent("touchcancel")||{},this.velocity=0,this.dxDy=new v.Vec2(0,0),this.scale=1,this.rotation=0,this.rotationDeg=0,this.anchor=new v.Vec2(0,0),this.octant=0,this.isPanning=!1,this.isPinching=!1,this.isSwiping=!1,this.isRotating=!1,this.touchStartTime=0,this.touchEndTime=0,this.lastTouchTime=0,this.taps=0,this.scaleBase=0,this.touchMoved=!1,this.touchDown=!1,this.shouldFire=!1,this.pointers=0,this.isLongPress=!1,this.longPressTimeout=0,this.touchStartListener=this.onTouchStart.bind(this),this.touchMoveListener=this.onTouchMove.bind(this),this.touchEndListener=this.onTouchEnd.bind(this),this.touchCancelListener=this.onTouchCancel.bind(this),this.currentTarget=window,this.config={longPressDuration:500,tapDelay:500,minPointers:1,numberOfTaps:0},f.listening||(TouchEvent&&window.addEventListener("touchstart",this.touchStartListener,!0),f.listening=!0)}bind(t){this.unbind(this.currentTarget),t.addEventListener("touchmove",this.touchMoveListener,!0),t.addEventListener("touchend",this.touchEndListener,!0),t.addEventListener("touchcancel",this.touchCancelListener,!0),this.currentTarget=t}unbind(t){t.removeEventListener("touchmove",this.touchMoveListener),t.removeEventListener("touchend",this.touchEndListener),t.removeEventListener("touchcancel",this.touchCancelListener)}clean(){this.touchMoved=!1,this.touchStartTime=0,this.touchDown=!1,this.scaleBase=0,this.longPressTimeout&&!this.isLongPress&&(clearTimeout(this.longPressTimeout),this.longPressTimeout=0),this.isLongPress=!1}onPointerLeave(t){if(!t.touches.length){if(this.isSwiping){const e=new c.SwipeEndEvent(t,{velocity:this.velocity,direction:g[(0,v.closest)(this.octant,[0,1,2,3])]});this.dispatchEvent(e),this.isSwiping=!1}if(this.isPanning){const e=new d.PanEndEvent(t,{translation:this.dxDy,velocity:this.velocity});this.dispatchEvent(e),this.isPanning=!1}}if(1===t.touches.length){if(this.scaleBase=0,this.isPinching){const e=new p.PinchEndEvent(t,{scale:this.scale});this.dispatchEvent(e),this.isPinching=!1}if(this.isRotating){const e=new m.RotateEndEvent(t,{rotation:this.rotation,rotationDeg:this.rotationDeg,anchor:this.anchor});this.dispatchEvent(e),this.isRotating=!1}}}dispatchEvent(t){queueMicrotask((()=>{this.currentTarget.dispatchEvent(t)}))}onTouchStart(t){this.currentTarget!==t.touches[0].target&&(this.clean(),this.unbind(this.currentTarget),this.pointers=this.touchEnd.touches.length,this.taps=0),this.touchStart=t;const e=parseInt(t.touches[0].target.dataset.minpointers||"0")||this.config.minPointers;if(this.touchStart.touches.length<e)return void(this.shouldFire=!1);this.shouldFire=!0,this.touchStartTime=t.timeStamp,this.touchDown=!0,this.pointers||this.bind(t.touches[0].target),this.pointers=this.touchStart.touches.length;const n=parseFloat(this.currentTarget.dataset.longpressduration||"0")||this.config.longPressDuration;if(this.longPressTimeout||(this.longPressTimeout=setTimeout((()=>{if(!this.touchMoved&&this.touchDown){const t=Date.now()-this.touchStartTime,e=new h.default(this.touchStart,t);this.dispatchEvent(e),this.isLongPress=!0,this.longPressTimeout=0}}),n)),this.touchStart.touches.length>1){const t=new v.Vec2(this.touchStart.touches[0].clientX,this.touchStart.touches[0].clientY),e=new v.Vec2(this.touchStart.touches[1].clientX,this.touchStart.touches[1].clientY);this.scaleBase=t.substract(e).magnitude}else this.scaleBase=0}onTouchMove(t){if(!this.shouldFire)return;if(this.touchMoved=!0,this.touchMove=t,t.touches.length>1&&this.touchStart.touches.length>1&&(t.touches[1].clientX!==this.touchStart.touches[1].clientX||t.touches[1].clientY!==this.touchStart.touches[1].clientY)){const e=new v.Vec2(this.touchMove.touches[0].clientX,this.touchMove.touches[0].clientY),n=new v.Vec2(this.touchMove.touches[1].clientX,this.touchMove.touches[1].clientY),i=new v.Vec2(this.touchStart.touches[0].clientX,this.touchStart.touches[0].clientY),s=e.substract(n);if(this.scaleBase&&Math.abs(this.scaleBase-s.magnitude)>10){const e=s.magnitude/this.scaleBase;if(this.scale=e,this.isPinching){const n=new p.default(t,{scale:e});this.dispatchEvent(n)}else{const n=new p.PinchStartEvent(t,{scale:e});this.dispatchEvent(n),this.isPinching=!0}}this.anchor=e;let o=Math.atan2(i.clientY-n.clientY,i.clientX-n.clientX);if(o<0?o+=1.5708:o-=1.5708,this.rotation=o,this.rotationDeg=180*o/Math.PI,this.anchor=this.anchor,this.isRotating){const e=new m.default(t,{anchor:this.anchor,rotation:this.rotation,rotationDeg:this.rotationDeg});this.dispatchEvent(e)}else{const e=new m.RotateStartEvent(t,{anchor:this.anchor,rotation:this.rotation,rotationDeg:this.rotationDeg});this.dispatchEvent(e),this.isRotating=!0}}const e=new v.Vec2(this.touchStart.touches[0].clientX,this.touchStart.touches[0].clientY),n=new v.Vec2(this.touchMove.touches[0].clientX,this.touchMove.touches[0].clientY).substract(e),i=n.magnitude,s={x:n.x/i,y:n.y/i},o=Math.atan2(s.y,s.x);this.octant=Math.round(4*o/(2*Math.PI)+4)%4;const r=(t.timeStamp-this.touchStart.timeStamp)/1e3,a=n.magnitude/r;if(this.isSwiping){const e=new c.default(t,{direction:g[(0,v.closest)(this.octant,[0,1,2,3])],velocity:a});this.dispatchEvent(e)}else{const e=new c.SwipeStartEvent(t,{direction:g[(0,v.closest)(this.octant,[0,1,2,3])],velocity:a});this.dispatchEvent(e),this.isSwiping=!0}if(this.dxDy=n,this.velocity=a,this.isPanning){const e=new d.default(t,{translation:n,velocity:a});this.dispatchEvent(e)}else{const e=new d.PanStartEvent(t,{translation:n,velocity:a});this.dispatchEvent(e),this.isPanning=!0}}onTouchEnd(t){const e=parseInt(this.currentTarget.dataset.numberoftaps||"0")||this.config.numberOfTaps;if(this.taps++,this.shouldFire=Boolean(this.taps>e),this.shouldFire){this.touchEnd=t,this.touchEndTime=t.timeStamp;const n=parseFloat(this.currentTarget.dataset.tapdelay||"0")||this.config.tapDelay;if(!this.touchMoved&&!this.isLongPress)if(1===this.taps||this.touchEndTime-this.lastTouchTime<n){if(this.taps%2===e){const e=new u.default(t);this.dispatchEvent(e),this.taps=0}const n=new l.default(t);this.dispatchEvent(n)}else this.taps=0}this.pointers=this.touchEnd.touches.length,this.lastTouchTime=this.touchEndTime,this.onPointerLeave(t),this.unbind(this.currentTarget),this.clean()}onTouchCancel(t){this.shouldFire&&(this.touchCancel=t,this.unbind(this.currentTarget),this.clean())}}function y(t){const e=t.type;t.composedPath().forEach((n=>{if(n instanceof HTMLElement){const i=n[_[e]];if("function"!=typeof i)return;i.apply(n,[t])}}))}f.listening=!1,e.default=f,window.GLOBAL_EVENT_DISPATCHER||(window.addEventListener("tap",y,{passive:!0}),window.addEventListener("longpress",y,{passive:!0}),window.addEventListener("doubletap",y,{passive:!0}),window.addEventListener("swipestart",y,{passive:!0}),window.addEventListener("swipe",y,{passive:!0}),window.addEventListener("swipeend",y,{passive:!0}),window.addEventListener("panstart",y,{passive:!0}),window.addEventListener("pan",y,{passive:!0}),window.addEventListener("panend",y,{passive:!0}),window.addEventListener("pinchstart",y,{passive:!0}),window.addEventListener("pinch",y,{passive:!0}),window.addEventListener("pinchend",y,{passive:!0}),window.addEventListener("rotatestart",y,{passive:!0}),window.addEventListener("rotate",y,{passive:!0}),window.addEventListener("rotateend",y,{passive:!0}));const _={tap:"ontap",doubletap:"ondoubletap",longpress:"onlongpress",swipestart:"onswipestart",swipe:"onswipe",swipeend:"onswipeend",panstart:"onpanstart",pan:"onpan",panend:"onpanend",pinchstart:"onpinchstart",pinch:"onpinch",pinchend:"onpinchend",rotatestart:"onrotatestart",rotate:"onrotate",rotateend:"onrotateend"};TouchEvent&&(window.gestureProvider=new f),window.GLOBAL_EVENT_DISPATCHER||(window.GLOBAL_EVENT_DISPATCHER=y)},47:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.closest=e.Vec2=e.assert=void 0,e.assert=function(t,e){if(!t)throw new Error(e)};e.Vec2=class{constructor(t,e){this._x=0,this._y=0,this._clientX=0,this._clientY=0,this._clientX=t,this._clientY=e,this._x=this.translateX(t),this._y=this.translateY(e)}translateY(t){return-(t-window.innerHeight/2)}translateX(t){return t-window.innerWidth/2}get x(){return this._x}get y(){return this._y}get clientX(){return this._clientX}get clientY(){return this._clientY}set x(t){this._clientX=t,this._x=this.translateX(t)}set y(t){this._clientY=t,this._y=this.translateY(t)}add(t){return this._x+=t.x,this._y+=t.y,this._clientX+=t.clientX,this._clientY+=t.clientY,this}substract(t){return this._x-=t.x,this._y-=t.y,this._clientX-=t.clientX,this._clientY-=t.clientY,this}dot(t){return this._x*t.x+this._y*t.y}get magnitude(){return Math.sqrt(Math.pow(this._x,2)+Math.pow(this._y,2))}get clientMagnitude(){return Math.sqrt(Math.pow(this._clientX,2)+Math.pow(this._clientY,2))}},e.closest=function(t,e){return e.reduce(((e,n)=>{let i=Math.abs(e-t),s=Math.abs(n-t);return i===s?e>n?e:n:s<i?n:e}))}},810:e=>{e.exports=t}},n={};function i(t){var s=n[t];if(void 0!==s)return s.exports;var o=n[t]={exports:{}};return e[t].call(o.exports,o,o.exports,i),o.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var s={};(()=>{i.d(s,{ee:()=>z,r2:()=>h.r2,rN:()=>B,PM:()=>j,dw:()=>h.dw,y_:()=>d,DC:()=>r,GW:()=>g,sV:()=>e,RG:()=>T,GI:()=>W,rJ:()=>N,uZ:()=>h.uZ,PV:()=>h.PV,rL:()=>h.rL,Nu:()=>h.Nu,V_:()=>h.V_,hR:()=>h.hR,cT:()=>h.cT,e1:()=>h.e1,Ef:()=>L,Vo:()=>h.Vo,QN:()=>h.QN,kI:()=>h.kI,Po:()=>h.Po,fJ:()=>h.fJ,nc:()=>U,HJ:()=>M,JZ:()=>$,yj:()=>F});var t=i(810);class e{constructor(t,e){this._parentRouterData=null,this._childRouterData=null,this._dispatchEvent=null,this._addEventListener=null,this._removeEventListener=null,this._currentPath="",this._routesData=new Map,this._backNavigating=!1,this._gestureNavigating=!1,this._mountedScreen=null,this._animation=h.r2,this._ghostLayer=null,this.routerInstance=t,e&&(this.navigation=e)}destructor(){this.parentRouterData&&(this.parentRouterData.childRouterData=null)}prefetchRoute(t){return(0,h.kI)(t,this)}set parentRouterData(t){this._parentRouterData=t,this._parentRouterData&&(this._parentRouterData.childRouterData=this)}set childRouterData(t){var e;const n=null===(e=this._childRouterData)||void 0===e?void 0:e.deref();if(void 0!==n&&t&&t.routerId!==n.routerId)throw new Error("It looks like you have two navigators at the same level. Try simplifying your navigation structure by using a nested router instead.");this._childRouterData=t?new WeakRef(t):null}set dispatchEvent(t){this._dispatchEvent=t}set addEventListener(t){this._addEventListener=t}set removeEventListener(t){this._removeEventListener=t}set currentPath(t){this._currentPath=t}set routesData(t){this._routesData=t}set navigation(t){this._navigation=t}set animation(t){this._animation=t}set ghostLayer(t){this._ghostLayer=t}set backNavigating(t){this._backNavigating=t}set gestureNavigating(t){this._gestureNavigating=t}set paramsSerializer(t){this._paramsSerializer=t}set paramsDeserializer(t){this._paramsDeserializer=t}set mountedScreen(t){this._mountedScreen=t}get mountedScreen(){return this._mountedScreen}get routerId(){return this.routerInstance.id}get routes(){return this.routerInstance.props.children}get parentRouterData(){return this._parentRouterData}get childRouterData(){var t,e;return null!==(e=null===(t=this._childRouterData)||void 0===t?void 0:t.deref())&&void 0!==e?e:null}get dispatchEvent(){return this._dispatchEvent}get addEventListener(){return this._addEventListener}get removeEventListener(){return this._removeEventListener}get currentPath(){return this._currentPath}get routesData(){return this._routesData}get scrollRestorationData(){return e._scrollRestorationData}get navigation(){return this._navigation}get animation(){return this._animation}get ghostLayer(){return this._ghostLayer}get backNavigating(){return this._backNavigating}get gestureNavigating(){return this._gestureNavigating}get paramsSerializer(){return this._paramsSerializer}get paramsDeserializer(){return this._paramsDeserializer}}e._scrollRestorationData=new class{constructor(){this._map=new Map}set(t,e={x:0,y:0}){this._map.set(t,e)}get(t){return this._map.get(t)}};const n=(0,t.createContext)(null);class o{constructor(){this._map=new Map,this.mutationObserver=new MutationObserver(this.observeMutations.bind(this));const{head:t}=document;this.mutationObserver.observe(t,{childList:!0}),Array.from(t.querySelectorAll("meta")).forEach((t=>{this.mutationObserver.observe(t,{attributes:!0})})),Array.from(t.querySelectorAll("meta")).forEach(this.metaDataFromNode.bind(this))}get(t){const e=this.getMetaKey(t),n=this._map.get(e);if(!n)return;let i;return i=n.includes(",")&&n.includes("=")?n.split(/,\s*/).map((t=>t.split("="))):n,i}set(t,e){const n=this.getMetaKey(t),i=this.getMetaContent(e);this._map.set(n,i),this.updateMetaElement(n,i)}has(t){const e=this.getMetaKey(t);return this._map.has(e)}delete(t){var e;const n=this.getMetaKey(t);this._map.delete(n),null===(e=document.head.querySelector(`meta[${n}]`))||void 0===e||e.remove()}clear(){document.head.querySelectorAll("meta").forEach((t=>t.remove()))}entries(){return this._map.entries()}[Symbol.iterator](){return this.entries()}get size(){return this._map.size}observeMutations(t){for(const e of t){if("attributes"===e.type){const t=e.target;this.metaDataFromNode(t)}if("childList"!==e.type)return;e.removedNodes.forEach((t=>{if("META"===t.nodeName){const[e]=Array.from(t.attributes).filter((t=>"content"!==t.nodeName)),n=[e.nodeName,e.value].join("=");this._map.has(n)&&this._map.delete(n)}})),e.addedNodes.forEach((t=>{"META"===t.nodeName&&this.metaDataFromNode(t)}))}}metaDataFromNode(t){const[e]=Array.from(t.attributes).filter((t=>"content"!==t.nodeName)),[n]=Array.from(t.attributes).filter((t=>"content"===t.nodeName)),i=[e.nodeName,e.value].join("=");this._map.set(i,null==n?void 0:n.value)}getMetaKey(t){let e;return e="string"==typeof t?`name=${t}`:t.join("="),e}getMetaContent(t){if(!t)return;let e;return e="string"==typeof t?t:t.map((t=>t.join("="))).join(", "),e}updateMetaElement(t,e){const n=document.querySelector(`meta[${t}]`)||document.createElement("meta"),i=t.split("=");n.setAttribute(...i),e?n.setAttribute("content",e):n.removeAttribute("content"),n.parentElement||document.head.appendChild(n)}}class r{constructor(t,e,n=!1,i=null){var s;this._metaData=new o,this._currentParams={},this.popStateListener=t=>{var e;this._routerId,this.history.state.get("routerId");const n=null===(e=r.rootNavigatorRef)||void 0===e?void 0:e.deref(),i=(null==n?void 0:n.routerId)===this.routerId;(null===this.history.state.get("routerId")&&i||this.history.state.get("routerId")===this._routerId)&&this.onPopState(t)},this.routerData=e,this._disableBrowserRouting=n,this._routerId=t;const a=null===(s=r.rootNavigatorRef)||void 0===s?void 0:s.deref();a&&a.isInDocument||(r.rootNavigatorRef=new WeakRef(this)),window.addEventListener("popstate",this.popStateListener)}destructor(){var t;const e=null===(t=r.rootNavigatorRef)||void 0===t?void 0:t.deref();(null==e?void 0:e.routerId)===this.routerId&&(r.rootNavigatorRef=null),window.removeEventListener("popstate",this.popStateListener)}addEventListener(t,e,n){var i,s;null===(s=(i=this.routerData).addEventListener)||void 0===s||s.call(i,t,e,n)}removeEventListener(t,e,n){var i,s;return null===(s=(i=this.routerData).removeEventListener)||void 0===s?void 0:s.call(i,t,e,n)}get disableBrowserRouting(){return this._disableBrowserRouting}get routerId(){return this._routerId}canGoBack(){return this.history.canGoBack()}getNavigatorById(t,e){var n;const i=null!=e?e:null===(n=r.rootNavigatorRef)||void 0===n?void 0:n.deref();return i.routerId===t?i:i.routerData.childRouterData?void this.getNavigatorById(t,i.routerData.childRouterData.navigation):null}prefetchRoute(t){return this.routerData.prefetchRoute(t)}get dispatchEvent(){return this.routerData.dispatchEvent}get paramsDeserializer(){return this.routerData.paramsDeserializer}get paramsSerializer(){return this.routerData.paramsSerializer}get history(){return this._history}get metaData(){return this._metaData}get isInDocument(){return Boolean(document.getElementById(`${this.routerId}`))}}r.rootNavigatorRef=null;var a=i(322),h=i(174);class l{constructor(){this._play=!0,this._isPlaying=!1,this._isStarted=!1,this._currentScreen=null,this._nextScreen=null,this._progressUpdateID=0,this._pseudoElementInAnimation=null,this._pseudoElementOutAnimation=null,this._inAnimation=null,this._outAnimation=null,this._playbackRate=1,this._gestureNavigating=!1,this._backNavigating=!1,this._onEnd=null,this._onProgress=null,this._shouldAnimate=!0,this._dispatchEvent=null,this._addEventListener=null}updateProgress(){var t,e,n,i;if(this._gestureNavigating&&!this._play)return void window.cancelAnimationFrame(this._progressUpdateID);(()=>{this._onProgress&&this._onProgress(this.progress)})(),this._progressUpdateID=window.requestAnimationFrame(this.updateProgress.bind(this));const s=()=>{window.cancelAnimationFrame(this._progressUpdateID);const t=this._gestureNavigating?0:100;this.progress!==t&&this._onProgress&&this._onProgress(t)};Promise.all([null===(t=this._inAnimation)||void 0===t?void 0:t.finished,null===(e=this._outAnimation)||void 0===e?void 0:e.finished,null===(n=this._pseudoElementInAnimation)||void 0===n?void 0:n.finished,null===(i=this._pseudoElementOutAnimation)||void 0===i?void 0:i.finished]).then(s).catch(s)}reset(){this._onEnd=null,this._playbackRate=1,this._play=!0,this._gestureNavigating=!1}finish(){var t,e,n,i;null===(t=this._inAnimation)||void 0===t||t.finish(),null===(e=this._outAnimation)||void 0===e||e.finish(),null===(n=this._pseudoElementInAnimation)||void 0===n||n.finish(),null===(i=this._pseudoElementOutAnimation)||void 0===i||i.finish()}cancel(){var t,e,n,i,s;null===(t=this._inAnimation)||void 0===t||t.cancel(),null===(e=this._outAnimation)||void 0===e||e.cancel(),null===(n=this._pseudoElementInAnimation)||void 0===n||n.cancel(),null===(i=this._pseudoElementOutAnimation)||void 0===i||i.cancel(),this.reset();const o=new CustomEvent("page-animation-cancel",{bubbles:!0});null===(s=this.dispatchEvent)||void 0===s||s.call(this,o)}cleanUpAnimation(t){t&&(t.commitStyles(),t.cancel())}async animate(){var t,e,n,i,s,o,r,a,l,u;if(this._isPlaying&&(this.cancel(),this._onEnd&&this._onEnd(),this.reset()),this._currentScreen&&this._nextScreen&&this._shouldAnimate){if(this._gestureNavigating&&await this._currentScreen.mounted(!0),this._backNavigating?(this._currentScreen.zIndex=1,this._nextScreen.zIndex=0):(this._currentScreen.zIndex=0,this._nextScreen.zIndex=1),this._onProgress&&this._onProgress(this.progress),this._onExit&&this._shouldAnimate&&this._onExit(),await this._nextScreen.mounted(!0),this._outAnimation=this._currentScreen.animation,this._pseudoElementOutAnimation=this._currentScreen.pseudoElementAnimation,this._inAnimation=this._nextScreen.animation,this._pseudoElementInAnimation=this._nextScreen.pseudoElementAnimation,this._isPlaying=!0,this._inAnimation&&this._outAnimation){if(!this._shouldAnimate)return this.finish(),this._isPlaying=!1,void(this._shouldAnimate=!0);if(this._inAnimation.playbackRate=this._playbackRate,this._outAnimation.playbackRate=this._playbackRate,this._pseudoElementInAnimation&&(this._pseudoElementInAnimation.playbackRate=this._playbackRate),this._pseudoElementOutAnimation&&(this._pseudoElementOutAnimation.playbackRate=this._playbackRate),this._gestureNavigating){const t=(0,h.V_)(this._inAnimation,this.duration),e=(0,h.V_)(this._outAnimation,this.duration);if(this._inAnimation.currentTime=t,this._outAnimation.currentTime=e,this._pseudoElementInAnimation){const t=(0,h.V_)(this._pseudoElementInAnimation,this.duration);this._pseudoElementInAnimation.currentTime=t}if(this._pseudoElementOutAnimation){const t=(0,h.V_)(this._pseudoElementOutAnimation,this.duration);this._pseudoElementOutAnimation.currentTime=t}}await Promise.all([this._inAnimation.ready,this._outAnimation.ready,null===(t=this._pseudoElementInAnimation)||void 0===t?void 0:t.ready,null===(e=this._pseudoElementOutAnimation)||void 0===e?void 0:e.ready]),this._play?(this._outAnimation.play(),this._inAnimation.play(),null===(s=this._pseudoElementInAnimation)||void 0===s||s.play(),null===(o=this._pseudoElementOutAnimation)||void 0===o||o.play()):(this._inAnimation.pause(),this._outAnimation.pause(),null===(n=this._pseudoElementInAnimation)||void 0===n||n.pause(),null===(i=this._pseudoElementOutAnimation)||void 0===i||i.pause(),this._isPlaying=!1),this._isStarted=!0;const c=new CustomEvent("page-animation-start",{bubbles:!0});null===(r=this.dispatchEvent)||void 0===r||r.call(this,c),this.updateProgress(),await Promise.all([this._outAnimation.finished,this._inAnimation.finished,null===(a=this._pseudoElementInAnimation)||void 0===a?void 0:a.finished,null===(l=this._pseudoElementOutAnimation)||void 0===l?void 0:l.finished]),this.cleanUpAnimation(this._inAnimation),this.cleanUpAnimation(this._outAnimation),this._inAnimation=null,this._outAnimation=null,this._isPlaying=!1;const d=new CustomEvent("page-animation-end",{bubbles:!0});null===(u=this.dispatchEvent)||void 0===u||u.call(this,d),this._gestureNavigating&&.5!==this._playbackRate?(this._nextScreen.zIndex=0,this._currentScreen.zIndex=1,await this._nextScreen.mounted(!1)):(this._currentScreen.zIndex=0,this._nextScreen.zIndex=1,this._currentScreen.mounted(!1)),this._onEnd&&this._onEnd(),this._isStarted=!1}}else this._shouldAnimate=!0}set onProgress(t){this._onProgress=t}set onEnd(t){this._onEnd=t}set shouldAnimate(t){this._shouldAnimate=t}set playbackRate(t){this._playbackRate=t,this._inAnimation&&this._outAnimation&&(this._inAnimation.playbackRate=this._playbackRate,this._outAnimation.playbackRate=this._playbackRate),this._pseudoElementInAnimation&&(this._pseudoElementInAnimation.playbackRate=this._playbackRate),this._pseudoElementOutAnimation&&(this._pseudoElementOutAnimation.playbackRate=this._playbackRate)}set gestureNavigating(t){this._gestureNavigating=t}set backNavigating(t){this._backNavigating=t}set play(t){var e,n,i,s,o,r,a,h;this._play!==t&&(this._play=t,this._play&&this._gestureNavigating&&this.updateProgress(),t?(null===(e=this._inAnimation)||void 0===e||e.play(),null===(n=this._outAnimation)||void 0===n||n.play(),null===(i=this._pseudoElementInAnimation)||void 0===i||i.play(),null===(s=this._pseudoElementOutAnimation)||void 0===s||s.play()):(null===(o=this._inAnimation)||void 0===o||o.pause(),null===(r=this._outAnimation)||void 0===r||r.pause(),null===(a=this._pseudoElementInAnimation)||void 0===a||a.pause(),null===(h=this._pseudoElementOutAnimation)||void 0===h||h.pause()))}set progress(t){this._onProgress&&this._onProgress(t);{let e=(0,h.V_)(this._inAnimation,this.duration);const n=t/100*Number(e);let i=(0,h.V_)(this._outAnimation,this.duration);const s=t/100*Number(i);this._inAnimation&&this._outAnimation&&(this._inAnimation.currentTime=n,this._outAnimation.currentTime=s)}{let e=(0,h.V_)(this._pseudoElementInAnimation,this.duration);const n=t/100*Number(e);let i=(0,h.V_)(this._pseudoElementOutAnimation,this.duration);const s=t/100*Number(i);this._pseudoElementInAnimation&&(this._pseudoElementInAnimation.currentTime=n),this._pseudoElementOutAnimation&&(this._pseudoElementOutAnimation.currentTime=s)}}set currentScreen(t){this._currentScreen=t}set nextScreen(t){this._nextScreen=t,this._currentScreen||(t.mounted(!0,!1),this._nextScreen=null)}set onExit(t){this._onExit=t}set addEventListener(t){this._addEventListener=t}set dispatchEvent(t){this._dispatchEvent=t}get addEventListener(){return this._addEventListener}get dispatchEvent(){return this._dispatchEvent}get duration(){var t,e,n,i;const s=null===(t=this._currentScreen)||void 0===t?void 0:t.duration,o=null===(e=this._nextScreen)||void 0===e?void 0:e.duration,r=null===(n=this._currentScreen)||void 0===n?void 0:n.pseudoElementDuration,a=null===(i=this._nextScreen)||void 0===i?void 0:i.pseudoElementDuration;return Math.max(Number(s),Number(o),Number(r),Number(a))||0}get progress(){var t,e,n,i,s,o,r,a,h,l,u,c,d,p,m,v;const g=null===(e=null===(t=this._outAnimation)||void 0===t?void 0:t.effect)||void 0===e?void 0:e.getComputedTiming().duration,f=null===(i=null===(n=this._inAnimation)||void 0===n?void 0:n.effect)||void 0===i?void 0:i.getComputedTiming().duration,y=null===(o=null===(s=this._pseudoElementOutAnimation)||void 0===s?void 0:s.effect)||void 0===o?void 0:o.getComputedTiming().duration,_=null===(a=null===(r=this._pseudoElementInAnimation)||void 0===r?void 0:r.effect)||void 0===a?void 0:a.getComputedTiming().duration,E=[Number(g),Number(f),Number(_),Number(y)],w=Math.max(...E.filter((t=>!isNaN(t))));let b;return w===Number(g)?b=null===(l=null===(h=this._outAnimation)||void 0===h?void 0:h.effect)||void 0===l?void 0:l.getComputedTiming().progress:w===Number(f)?b=null===(c=null===(u=this._inAnimation)||void 0===u?void 0:u.effect)||void 0===c?void 0:c.getComputedTiming().progress:w===Number(_)?b=null===(p=null===(d=this._pseudoElementInAnimation)||void 0===d?void 0:d.effect)||void 0===p?void 0:p.getComputedTiming().progress:w===Number(y)&&(b=null===(v=null===(m=this._pseudoElementOutAnimation)||void 0===m?void 0:m.effect)||void 0===v?void 0:v.getComputedTiming().progress),100*(Number(b)||0)}get gestureNavigating(){return this._gestureNavigating}get backNavigating(){return this._backNavigating}get isPlaying(){return this._isPlaying}get ready(){return new Promise((async(t,e)=>{var n,i,s,o;try{await Promise.all([null===(n=this._outAnimation)||void 0===n?void 0:n.ready,null===(i=this._inAnimation)||void 0===i?void 0:i.ready,null===(s=this._pseudoElementInAnimation)||void 0===s?void 0:s.ready,null===(o=this._pseudoElementOutAnimation)||void 0===o?void 0:o.ready]),t()}catch(t){e(t)}}))}get finished(){return new Promise((async(t,e)=>{var n,i,s,o;try{await this.started,await Promise.all([null===(n=this._outAnimation)||void 0===n?void 0:n.finished,null===(i=this._inAnimation)||void 0===i?void 0:i.finished,null===(s=this._pseudoElementInAnimation)||void 0===s?void 0:s.finished,null===(o=this._pseudoElementOutAnimation)||void 0===o?void 0:o.finished]),t()}catch(t){e(t)}}))}get started(){return this._isStarted?Promise.resolve():new Promise((async t=>{var e;null===(e=this.addEventListener)||void 0===e||e.call(this,"page-animation-start",(()=>{t()}),{once:!0})}))}}const u=(0,t.createContext)(new l);var c=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const d=(0,t.createContext)(0);function p(e,n,i,s){const{paths:o}=n;let r,a,l,u,c,d=!1,p=!1,m=null;n.paths.length&&(!(0,h.e1)(s,o)&&n.paths.includes(void 0)&&(s=void 0),null!==i&&!(0,h.e1)(i,o)&&n.paths.includes(void 0)&&(i=void 0));const v=[];let g;if(t.Children.forEach(n.children,(o=>{var r,a,l;if(null===i)return;if(!(0,t.isValidElement)(o))return;let u;if((0,h.QN)(o.props.resolvedPathname,s)&&(e.backNavigating||n.gestureNavigating)&&(null===(r=o.props.config)||void 0===r?void 0:r.keepAlive)&&(g=o.key||void 0),e.children===n.children?(null===(a=o.props.config)||void 0===a?void 0:a.keepAlive)&&(u=(0,h.QN)(o.props.path,i)):u=(0,h.QN)(o.props.resolvedPathname,i),u&&!p){let e={out:!0,in:!1};n.gestureNavigating&&(e={in:!0,out:!1}),p=!0,v.push((0,t.cloneElement)(o,Object.assign(Object.assign({},e),{resolvedPathname:u.matchedPathname,key:null!==(l=o.key)&&void 0!==l?l:Math.random()})))}})),t.Children.forEach(e.children,(e=>{if(!(0,t.isValidElement)(e))return;n.paths.length||o.push(e.props.path);const i=(0,h.QN)(e.props.path,s);if(i&&!d){d=!0;const{config:s}=e.props;r=null==s?void 0:s.swipeDirection,a=null==s?void 0:s.swipeAreaWidth,u=null==s?void 0:s.hysteresis,c=null==s?void 0:s.disableDiscovery,l=null==s?void 0:s.minFlingVelocity,m=e.props.name||null;let o={in:!0,out:!1};n.gestureNavigating&&(o={out:!0,in:!1});const h=g||Math.random();v.push((0,t.cloneElement)(e,Object.assign(Object.assign({},o),{resolvedPathname:i.matchedPathname,key:h})))}})),!t.Children.count(v)){return{children:t.Children.map(e.children,(e=>{var n;if((0,t.isValidElement)(e)&&(0,h.QN)(e.props.path,void 0)){const{config:i}=e.props;return r=null==i?void 0:i.swipeDirection,a=null==i?void 0:i.swipeAreaWidth,u=null==i?void 0:i.hysteresis,c=null==i?void 0:i.disableDiscovery,l=null==i?void 0:i.minFlingVelocity,m=null!==(n=e.props.name)&&void 0!==n?n:null,(0,t.cloneElement)(e,{in:!0,out:!1})}})),name:m,swipeDirection:r||e.swipeDirection,swipeAreaWidth:a||e.swipeAreaWidth,hysteresis:u||e.hysteresis,disableDiscovery:void 0===c?e.disableDiscovery:c,minFlingVelocity:l||e.minFlingVelocity}}return{paths:o,children:v,name:m,currentPath:e.currentPath,swipeDirection:r||e.swipeDirection,swipeAreaWidth:a||e.swipeAreaWidth,hysteresis:u||e.hysteresis,disableDiscovery:void 0===c?e.disableDiscovery:c,minFlingVelocity:l||e.minFlingVelocity}}class m extends t.Component{constructor(){super(...arguments),this.onSwipeStartListener=this.onSwipeStart.bind(this),this.onSwipeListener=this.onSwipe.bind(this),this.onSwipeEndListener=this.onSwipeEnd.bind(this),this.ref=null,this.state={currentPath:this.props.lastPath,children:this.props.children,progress:100,shouldPlay:!0,gestureNavigating:!1,shouldAnimate:!0,startX:0,startY:0,paths:[],swipeDirection:this.props.swipeDirection,swipeAreaWidth:this.props.swipeAreaWidth,minFlingVelocity:this.props.minFlingVelocity,hysteresis:this.props.hysteresis,disableDiscovery:!1},this.setRef=t=>{this.ref&&this.ref.removeEventListener("swipestart",this.onSwipeStartListener),this.ref=t,t&&t.addEventListener("swipestart",this.onSwipeStartListener)}}static getDerivedStateFromProps(t,e){if(t.currentPath!==e.currentPath){if(!e.shouldAnimate)return{currentPath:t.currentPath,shouldAnimate:!0};let n=t.currentPath;const i=p(t,e,e.currentPath,t.currentPath),{name:s}=i,o=c(i,["name"]);return o.children.sort(((t,e)=>(0,h.QN)(t.props.path,n)?1:-1)),t.onDocumentTitleChange(s),o}return null}componentDidMount(){this.context.onProgress=t=>{const e=this.props.backNavigating&&!this.state.gestureNavigating?99-t:t,n=(0,h.uZ)(e,0,100);this.setState({progress:n});const i=new CustomEvent("motion-progress",{detail:{progress:n}});this.props.dispatchEvent&&this.props.dispatchEvent(i)}}componentDidUpdate(t,e){t.currentPath!==this.state.currentPath&&(this.context.backNavigating=this.props.backNavigating,!this.state.gestureNavigating&&e.shouldAnimate&&(this.context.play=!0,this.context.animate()))}onGestureSuccess(t,e){this.props.onDocumentTitleChange(e),this.setState(t)}onSwipeStart(t){if(t.touches.length>1)return;if(this.state.disableDiscovery)return;if(this.context.isPlaying)return;if(0===this.context.duration)return;let e;switch(this.state.swipeDirection){case"left":case"right":e=t.x;break;case"up":case"down":e=t.y}if(t.direction===this.state.swipeDirection&&e<this.state.swipeAreaWidth){if(!this.props.lastPath)return;t.stopPropagation();for(let e of t.composedPath().reverse())if("classList"in e&&e.classList.length){if(e.classList.contains("gesture-region")&&"true"===e.dataset.disabled)return;if(e===t.gestureTarget)break}const e=p(this.props,Object.assign(Object.assign({},this.state),{gestureNavigating:!0}),this.props.currentPath,this.props.lastPath),{children:n,currentPath:i,paths:s,name:o}=e,r=c(e,["children","currentPath","paths","name"]);this.onGestureSuccess=this.onGestureSuccess.bind(this,r,o),this.props.navigation.addEventListener("go-back",this.onGestureSuccess,{once:!0}),this.props.onGestureNavigationStart(),this.setState({shouldPlay:!1,gestureNavigating:!0,children:n.sort((t=>(0,h.QN)(t.props.path,i)?-1:1)),startX:t.x,startY:t.y},(()=>{var t,e;const n=new CustomEvent("motion-progress-start");this.context.gestureNavigating=!0,this.context.playbackRate=-1,this.context.play=!1,this.context.backNavigating=this.props.backNavigating,this.context.animate(),this.props.dispatchEvent&&this.props.dispatchEvent(n),null===(t=this.ref)||void 0===t||t.addEventListener("swipe",this.onSwipeListener),null===(e=this.ref)||void 0===e||e.addEventListener("swipeend",this.onSwipeEndListener)}))}}onSwipe(t){if(this.state.shouldPlay)return;let e;switch(this.state.swipeDirection){case"left":case"right":{const n=window.innerWidth;e=-((0,h.uZ)(t.x-this.state.startX,10)-n)/n*100,"left"===this.state.swipeDirection&&(e=100-e);break}case"up":case"down":{const n=window.innerHeight;e=-((0,h.uZ)(t.y-this.state.startY,10)-n)/n*100,"up"===this.state.swipeDirection&&(e=100-e);break}}this.context.progress=(0,h.uZ)(e,.1,100)}onSwipeEnd(t){var e,n;if(this.state.shouldPlay)return;let i=null;const s=new CustomEvent("motion-progress-end");100-this.state.progress>this.state.hysteresis||t.velocity>this.state.minFlingVelocity?(t.velocity>=this.state.minFlingVelocity?this.context.playbackRate=-5:this.context.playbackRate=-1,i=()=>{this.context.reset(),this.props.onGestureNavigationEnd(),this.setState({gestureNavigating:!1}),this.props.dispatchEvent&&this.props.dispatchEvent(s)},this.setState({shouldPlay:!0,shouldAnimate:!1})):(this.context.playbackRate=.5,i=()=>{this.props.navigation.removeEventListener("go-back",this.onGestureSuccess),this.context.reset(),this.props.dispatchEvent&&this.props.dispatchEvent(s)},this.setState({shouldPlay:!0,gestureNavigating:!1})),this.setState({startX:0,startY:0}),this.context.onEnd=i,this.context.play=!0,null===(e=this.ref)||void 0===e||e.removeEventListener("swipe",this.onSwipeListener),null===(n=this.ref)||void 0===n||n.removeEventListener("swipeend",this.onSwipeEndListener)}render(){return(0,a.jsx)("div",Object.assign({className:"animation-layer",ref:this.setRef,style:{width:"100%",height:"100%",display:"grid",[`--${this.props.navigation.routerId}-motion-progress`]:this.state.progress}},{children:(0,a.jsx)(d.Provider,Object.assign({value:this.state.progress},{children:this.state.children}))}))}}m.contextType=u;class v extends t.Component{constructor(){super(...arguments),this.ref=null,this._currentScene=null,this._nextScene=null,this.onProgressStartListener=this.onProgressStart.bind(this),this.onProgressListener=this.onProgress.bind(this),this.onProgressEndListener=this.onProgressEnd.bind(this),this.state={transitioning:!1,playing:!0}}set currentScene(t){this._currentScene=t}set nextScene(t){this._nextScene=t,!this._currentScene||this._currentScene.isEmpty()||this._nextScene.isEmpty()?(this._currentScene=null,this._nextScene=null):this.sharedElementTransition(this._currentScene,this._nextScene)}finish(){var t;const e=(null===(t=this.ref)||void 0===t?void 0:t.getAnimations({subtree:!0}))||[];for(const t of e)t.finish()}sharedElementTransition(t,e){if(0===this.context.duration)return;if(this.state.transitioning)return void this.finish();const n=()=>{this.setState({transitioning:!1}),this._nextScene=null,this._currentScene=null},i=()=>{var t;const e=(null===(t=this.ref)||void 0===t?void 0:t.getAnimations({subtree:!0}))||[];for(const t of e)t.cancel();n()},s=queueMicrotask.bind(null,(async()=>{var s,o,r,a,l,u,c,d,p,m,v,g,f,y,_,E,w,b,x,S,P,A,L,R,k,D,O,N,I,T,C,j,$,M,U,F,V,z,Y,X,B,H,W,G,K,q,J;null===(s=this.ref)||void 0===s||s.showModal();for(const[n,i]of t.nodes)if(e.nodes.has(n)){const s=e.nodes.get(n).instance,Q=i.instance,Z=s.transitionType||Q.transitionType||"morph",tt=i.instance.node,et=e.nodes.get(n).instance.node;if(!tt||!et)continue;const nt=tt.firstElementChild,it=et.firstElementChild;if(!nt||!it)continue;const st=Q.clientRect,ot=s.clientRect;let rt,at,ht={},lt={};"morph"===Z&&([rt,ht]=Q.CSSData,[at,lt]=s.CSSData),rt=Q.CSSText,at=s.CSSText,nt.style.cssText=rt,"morph"!==Z&&(it.style.cssText=at,et.style.position="absolute",it.style.position="absolute",et.style.zIndex=it.style.zIndex,et.style.top="0",et.style.left="0"),tt.style.position="absolute",nt.style.position="absolute",tt.style.zIndex=nt.style.zIndex,tt.style.top="0",tt.style.left="0";const ut={id:Q.id,start:{x:{node:tt,delay:null!==(u=null!==(a=null===(r=null===(o=Q.props.config)||void 0===o?void 0:o.x)||void 0===r?void 0:r.delay)&&void 0!==a?a:null===(l=s.props.config)||void 0===l?void 0:l.delay)&&void 0!==u?u:0,duration:(null===(d=null===(c=Q.props.config)||void 0===c?void 0:c.x)||void 0===d?void 0:d.duration)||(null===(p=s.props.config)||void 0===p?void 0:p.duration)||this.context.duration,easingFunction:(null===(v=null===(m=Q.props.config)||void 0===m?void 0:m.x)||void 0===v?void 0:v.easingFunction)||(null===(g=Q.props.config)||void 0===g?void 0:g.easingFunction)||"ease",position:st.x},y:{node:nt,delay:null!==(w=null!==(_=null===(y=null===(f=Q.props.config)||void 0===f?void 0:f.y)||void 0===y?void 0:y.delay)&&void 0!==_?_:null===(E=s.props.config)||void 0===E?void 0:E.delay)&&void 0!==w?w:0,duration:(null===(x=null===(b=Q.props.config)||void 0===b?void 0:b.y)||void 0===x?void 0:x.duration)||(null===(S=s.props.config)||void 0===S?void 0:S.duration)||this.context.duration,easingFunction:(null===(A=null===(P=Q.props.config)||void 0===P?void 0:P.y)||void 0===A?void 0:A.easingFunction)||(null===(L=Q.props.config)||void 0===L?void 0:L.easingFunction)||"ease",position:st.y}},end:{x:{node:et,delay:null!==(N=null!==(D=null===(k=null===(R=s.props.config)||void 0===R?void 0:R.x)||void 0===k?void 0:k.delay)&&void 0!==D?D:null===(O=s.props.config)||void 0===O?void 0:O.delay)&&void 0!==N?N:0,duration:(null===(T=null===(I=s.props.config)||void 0===I?void 0:I.x)||void 0===T?void 0:T.duration)||(null===(C=s.props.config)||void 0===C?void 0:C.duration)||this.context.duration,easingFunction:(null===($=null===(j=s.props.config)||void 0===j?void 0:j.x)||void 0===$?void 0:$.easingFunction)||(null===(M=s.props.config)||void 0===M?void 0:M.easingFunction)||"ease",position:ot.x},y:{node:it,delay:null!==(Y=null!==(V=null===(F=null===(U=s.props.config)||void 0===U?void 0:U.y)||void 0===F?void 0:F.delay)&&void 0!==V?V:null===(z=s.props.config)||void 0===z?void 0:z.delay)&&void 0!==Y?Y:0,duration:(null===(B=null===(X=s.props.config)||void 0===X?void 0:X.y)||void 0===B?void 0:B.duration)||(null===(H=s.props.config)||void 0===H?void 0:H.duration)||this.context.duration,easingFunction:(null===(G=null===(W=s.props.config)||void 0===W?void 0:W.x)||void 0===G?void 0:G.easingFunction)||(null===(K=s.props.config)||void 0===K?void 0:K.easingFunction)||"ease",position:ot.y}}};if(tt.style.display="unset",null===(q=this.ref)||void 0===q||q.appendChild(tt),Q.onCloneAppended(tt),"morph"!==Z){const t=parseInt(tt.style.zIndex)||0,e=parseInt(et.style.zIndex)||0;et.style.zIndex=`${(0,h.uZ)(e,0,t-1)}`,et.style.display="unset",null===(J=this.ref)||void 0===J||J.appendChild(et),s.onCloneAppended(et)}else s.onCloneAppended(tt);let ct,dt,pt,mt;Q.hidden(!0),s.hidden(!0),tt.style.willChange="contents, transform, opacity","morph"!==Z&&(et.style.willChange="contents, transform, opacity"),"morph"===Z?(ct=ut.start.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`},{transform:`translate(${ut.end.x.position}px, 0px)`}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-start`}),dt=ut.start.y.node.animate([Object.assign(Object.assign({},ht),{transform:`translate(0px, ${ut.start.y.position}px)`}),Object.assign(Object.assign({},lt),{transform:`translate(0px, ${ut.end.y.position}px)`})],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-start`})):"fade"===Z?(ct=ut.start.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`,opacity:1},{transform:`translate(${ut.end.x.position}px, 0px)`,opacity:0}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-start`}),dt=ut.start.y.node.animate([{transform:`translate(0px, ${ut.start.y.position}px)`},{transform:`translate(0px, ${ut.end.y.position}px)`}],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-start`}),pt=ut.end.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`},{transform:`translate(${ut.end.x.position}px, 0px)`}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-end`}),mt=ut.end.y.node.animate([{transform:`translate(0px, ${ut.start.y.position}px)`},{transform:`translate(0px, ${ut.end.y.position}px)`}],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-end`})):"fade-through"===Z?(ct=ut.start.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`,opacity:1},{opacity:0,offset:.5},{transform:`translate(${ut.end.x.position}px, 0px)`,opacity:0}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-start`}),dt=ut.start.y.node.animate([{transform:`translate(0px, ${ut.start.y.position}px)`},{transform:`translate(0px, ${ut.end.y.position}px)`}],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-start`}),pt=ut.end.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`,opacity:0},{opacity:0,offset:.5},{transform:`translate(${ut.end.x.position}px, 0px)`,opacity:1}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-end`}),mt=ut.end.y.node.animate([{transform:`translate(0px, ${ut.start.y.position}px)`},{transform:`translate(0px, ${ut.end.y.position}px)`}],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-end`})):(ct=ut.start.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`,opacity:1},{transform:`translate(${ut.end.x.position}px, 0px)`,opacity:0}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-start`}),dt=ut.start.y.node.animate([{transform:`translate(0px, ${ut.start.y.position}px)`},{transform:`translate(0px, ${ut.end.y.position}px)`}],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-start`}),pt=ut.end.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`,opacity:0},{transform:`translate(${ut.end.x.position}px, 0px)`,opacity:1}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-end`}),mt=ut.end.y.node.animate([{transform:`translate(0px, ${ut.start.y.position}px)`},{transform:`translate(0px, ${ut.end.y.position}px)`}],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-end`}));const vt=[ct,dt,pt,mt];this.state.playing||vt.forEach((t=>{var e;if(!t)return;const n=this.context.duration;let i=null===(e=t.effect)||void 0===e?void 0:e.getComputedTiming().duration;"string"==typeof i&&(i=parseFloat(i)),i=i||n,t.currentTime=i,t.pause()}));const gt=async()=>{console.assert(n===s.id,"Not sure what happened here."),console.assert(n===Q.id,"Not sure what happened here."),tt.style.willChange="auto","morph"!==Z&&(et.style.willChange="auto"),await s.hidden(!1),t.keepAlive&&this.state.playing?Q.keepAlive(!0):(Q.keepAlive(!1),await Q.hidden(!1)),this.state.playing&&(Q.onCloneRemove(tt),"morph"!==Z?(s.onCloneRemove(et),et.remove()):s.onCloneRemove(tt),tt.remove())},ft=async()=>{tt.style.willChange="auto","morph"!==Z&&(et.style.willChange="auto"),await Q.hidden(!1),await s.hidden(!1)};Promise.all(vt.map((t=>null==t?void 0:t.finished))).then(gt).catch(ft)}this.ref&&Promise.all(this.ref.getAnimations({subtree:!0}).map((t=>t.finished))).then(n).catch(i)}));this.setState({transitioning:!0},s),this.props.navigation.addEventListener("page-animation-cancel",i,{once:!0})}componentDidMount(){this.props.instance&&this.props.instance(this),this.props.navigation.addEventListener("motion-progress-start",this.onProgressStartListener,{capture:!0}),this.props.navigation.addEventListener("motion-progress",this.onProgressListener,{capture:!0}),this.props.navigation.addEventListener("motion-progress-end",this.onProgressEndListener,{capture:!0})}componentWillUnmount(){this.props.navigation.removeEventListener("motion-progress-start",this.onProgressStartListener,{capture:!0}),this.props.navigation.removeEventListener("motion-progress",this.onProgressListener,{capture:!0}),this.props.navigation.removeEventListener("motion-progress-end",this.onProgressEndListener,{capture:!0})}onProgressStart(){this.setState({playing:!1})}onProgress(t){var e,n;if(!this.state.playing){const i=(null===(e=this.ref)||void 0===e?void 0:e.getAnimations({subtree:!0}))||[];for(const e of i){const i=t.detail.progress,s=this.context.duration;let o=null===(n=e.effect)||void 0===n?void 0:n.getComputedTiming().duration;"string"==typeof o&&(o=parseFloat(o)),o=o||s;const r=i/100*Number(o);e.currentTime=r}}}onProgressEnd(){this.state.playing||this.finish(),this.setState({playing:!0,transitioning:!1})}render(){return this.state.transitioning?(0,a.jsx)("dialog",Object.assign({id:"ghost-layer",ref:t=>this.ref=t,style:{position:"absolute",zIndex:h.dw,maxWidth:"unset",maxHeight:"unset",width:"100vw",height:"100vh",contain:"strict",padding:0,border:"none",backgroundColor:"transparent"}},{children:(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:"#ghost-layer::backdrop {display: none}"}})})):(0,a.jsx)(a.Fragment,{})}}v.contextType=u;class g extends t.Component{constructor(t){var e;super(t),this.animationLayerData=new l,this.ref=null,this.dispatchEvent=null,this.addEventListener=null,this.removeEventListener=null,this.state={currentPath:"",backNavigating:!1,gestureNavigating:!1,routesData:new Map,implicitBack:!1,defaultDocumentTitle:document.title},this.onDocumentTitleChange=t=>{document.title=t||this.state.defaultDocumentTitle},this.setRef=t=>{this.ref&&(this.dispatchEvent=null,this.addEventListener=null,this.removeEventListener=null,this.animationLayerData.dispatchEvent=this.dispatchEvent,this._routerData.dispatchEvent=this.dispatchEvent,this._routerData.addEventListener=this.addEventListener,this._routerData.removeEventListener=this.removeEventListener,this.removeNavigationEventListeners(this.ref)),t&&(this.dispatchEvent=e=>(0,h.Nu)(e,t),this.addEventListener=(e,n,i)=>t.addEventListener(e,n,i),this.removeEventListener=(e,n,i)=>t.removeEventListener(e,n,i),this.animationLayerData.dispatchEvent=this.dispatchEvent,this.animationLayerData.addEventListener=this.addEventListener,this._routerData.dispatchEvent=this.dispatchEvent,this._routerData.addEventListener=this.addEventListener,this._routerData.removeEventListener=this.removeEventListener,this.addNavigationEventListeners(t))},this._id=null!==(e=t.id)&&void 0!==e?e:Math.random().toString().replace(".","-"),t.config?this.config=t.config:this.config={animation:h.r2}}componentDidMount(){this._routerData.paramsDeserializer=this.props.config.paramsDeserializer,this._routerData.paramsSerializer=this.props.config.paramsSerializer,window.addEventListener("popstate",this.onPopStateListener)}componentWillUnmount(){this.navigation.destructor(),this._routerData.destructor(),this.ref&&this.removeNavigationEventListeners(this.ref),window.removeEventListener("popstate",this.onPopStateListener)}initialise(t){let e=t.location.pathname;const n=this._routerData.paramsDeserializer||null,i=(0,h.fJ)(window.location.search,n),s=this.state.routesData;this._routerData.routesData=this.state.routesData,i&&s.set(e,Object.assign(Object.assign({},this.state.routesData.get(e)),{params:i})),this.setState({currentPath:e,routesData:s}),this._routerData.currentPath=e}get id(){return this._id}get parentRouterData(){return this._routerData.parentRouterData}get baseURL(){var t;const e=window.location.origin,n=this.props.config.basePathname||"";if(this.parentRouterData){const e=this.parentRouterData.navigation.history.baseURL,i=(null===(t=this.parentRouterData.mountedScreen)||void 0===t?void 0:t.resolvedPathname)||"";return(0,h.PV)(n,(0,h.PV)(i,e))}return new URL(n,e)}addNavigationEventListeners(t){t.addEventListener("go-back",this.onBackListener),t.addEventListener("navigate",this.onNavigateListener)}removeNavigationEventListeners(t){t.removeEventListener("go-back",this.onBackListener),t.removeEventListener("navigate",this.onNavigateListener)}render(){return(0,a.jsx)("div",Object.assign({id:this._id.toString(),className:"react-motion-router",style:{width:"100%",height:"100%"},ref:this.setRef},{children:(0,a.jsx)(n.Consumer,{children:t=>(this._routerData.parentRouterData=t,(0,a.jsx)(n.Provider,Object.assign({value:this._routerData},{children:(0,a.jsxs)(u.Provider,Object.assign({value:this.animationLayerData},{children:[Boolean(this.navigation)&&(0,a.jsx)(v,{instance:t=>{this._routerData.ghostLayer=t},backNavigating:this.state.backNavigating,gestureNavigating:this.state.gestureNavigating,navigation:this._routerData.navigation,animationLayerData:this.animationLayerData}),Boolean(this.navigation)&&(0,a.jsx)(m,Object.assign({disableBrowserRouting:this.props.config.disableBrowserRouting||!1,disableDiscovery:this.props.config.disableDiscovery||!1,hysteresis:this.props.config.hysteresis||50,minFlingVelocity:this.props.config.minFlingVelocity||400,swipeAreaWidth:this.props.config.swipeAreaWidth||100,swipeDirection:this.props.config.swipeDirection||"right",navigation:this._routerData.navigation,backNavigating:this.state.backNavigating,currentPath:this.navigation.history.current,lastPath:this.navigation.history.previous,onGestureNavigationStart:this.onGestureNavigationStart,onGestureNavigationEnd:this.onGestureNavigationEnd,onDocumentTitleChange:this.onDocumentTitleChange,dispatchEvent:this.dispatchEvent},{children:this.props.children}))]}))})))})}))}}g.defaultProps={config:{animation:h.r2}};const f={"slide-right-in":[{transform:"translateX(100vw)"},{transform:"translateX(0vw)"}],"slide-back-right-in":[{transform:"translateX(50vw)"},{transform:"translateX(0vw)"}],"slide-right-out":[{transform:"translateX(0vw)"},{transform:"translateX(-50vw)"}],"slide-back-right-out":[{transform:"translateX(0vw)"},{transform:"translateX(-100vw)"}],"slide-left-in":[{transform:"translateX(-100vw)"},{transform:"translateX(0vw)"}],"slide-back-left-in":[{transform:"translateX(-50vw)"},{transform:"translateX(0vw)"}],"slide-left-out":[{transform:"translateX(0vw)"},{transform:"translateX(50vw)"}],"slide-back-left-out":[{transform:"translateX(0vw)"},{transform:"translateX(100vw)"}],"slide-up-in":[{transform:"translateY(100vh)"},{transform:"translateY(0vh)"}],"slide-back-up-in":[{transform:"translateY(50vh)"},{transform:"translateY(0vh)"}],"slide-up-out":[{transform:"translateY(0vh)"},{transform:"translateY(-50vh)"}],"slide-back-up-out":[{transform:"translateY(0vh)"},{transform:"translateY(-100vh)"}],"slide-down-in":[{transform:"translateY(-100vh)"},{transform:"translateY(0vh)"}],"slide-back-down-in":[{transform:"translateY(-50vh)"},{transform:"translateY(0vh)"}],"slide-down-out":[{transform:"translateY(0vh)"},{transform:"translateY(50vh)"}],"slide-back-down-out":[{transform:"translateY(0vh)"},{transform:"translateY(100vh)"}],"zoom-in-in":[{transform:"scale(0.85)",opacity:0},{transform:"scale(1)",opacity:1}],"zoom-in-out":[{transform:"scale(1)",opacity:1},{transform:"scale(1.15)",opacity:0}],"zoom-out-in":[{transform:"scale(1.15)",opacity:0},{transform:"scale(1)",opacity:1}],"zoom-out-out":[{transform:"scale(1)",opacity:1},{transform:"scale(0.85)",opacity:0}],"fade-in":[{opacity:0},{opacity:1}],"fade-out":[{opacity:1},{opacity:0}],none:[]},y={left:"right",right:"left",up:"down",down:"up",in:"out",out:"in"};class _ extends t.Component{constructor(){super(...arguments),this._animationLayerData=null,this.ref=null,this.onAnimationEnd=this.animationEnd.bind(this),this.onNavigate=this.navigate.bind(this),this.setRef=this.onRef.bind(this),this.state={mounted:this.props.out&&this.props.keepAlive,zIndex:this.props.in?1:0}}onRef(t){this.ref=t,this.props.onRef(t)}animationEnd(){this.ref&&(this.ref.style.willChange="auto",this.ref.style.pointerEvents="auto"),this.props.in&&this.props.onEntered()}navigate(){this.ref&&(this.ref.style.willChange="transform, opacity",this.ref.style.pointerEvents="none")}componentDidMount(){this.props.navigation.addEventListener("page-animation-start",this.onNavigate),this.props.navigation.addEventListener("motion-progress-start",this.onNavigate),this.props.navigation.addEventListener("page-animation-end",this.onAnimationEnd),this.props.navigation.addEventListener("motion-progress-end",this.onAnimationEnd),this.state.mounted&&(this.props.onEnter(),this.props.onEntered()),this._animationLayerData&&(this.props.in&&(this._animationLayerData.nextScreen=this),this.props.out&&!this.state.mounted&&(this._animationLayerData.onExit=this.props.onExit,this._animationLayerData.currentScreen=this))}componentDidUpdate(t){this._animationLayerData&&(this.props.out===t.out&&this.props.in===t.in||(this.props.out?(this._animationLayerData.onExit=this.props.onExit,this._animationLayerData.currentScreen=this):this.props.in&&(this._animationLayerData.nextScreen=this)))}componentWillUnmount(){this.props.navigation.removeEventListener("page-animation-start",this.onNavigate),this.props.navigation.removeEventListener("motion-progress-start",this.onNavigate),this.props.navigation.removeEventListener("page-animation-end",this.onAnimationEnd),this.props.navigation.removeEventListener("motion-progress-end",this.onAnimationEnd)}getAnimationConfig(t,e){"function"==typeof e&&(e=e());const n=e[t];if(!("type"in n))return n;{let e=n.direction,i="";switch(this.props.backNavigating&&e&&("zoom"!==n.type&&"slide"!==n.type||(e=y[e],i="back-")),n.type){case"slide":return"in"!==e&&"out"!==e||(e="left"),[`slide-${i}${e||"left"}-${t}`,n.duration,n.easingFunction];case"zoom":return"in"!==e&&"out"!==e&&(e="in"),[`zoom-${e||"in"}-${t}`,n.duration,n.easingFunction];case"fade":return[`fade-${t}`,n.duration,n.easingFunction];default:return["none",n.duration,void 0]}}}get pseudoElementInAnimation(){return this.props.pseudoElement?this.getAnimationConfig("in",this.props.pseudoElement.animation):null}get pseudoElementOutAnimation(){return this.props.pseudoElement?this.getAnimationConfig("out",this.props.pseudoElement.animation):null}get inAnimation(){return this.getAnimationConfig("in",this.props.animation)}get outAnimation(){return this.getAnimationConfig("out",this.props.animation)}get pseudoElementDuration(){var t;const e=this.props.in?this.pseudoElementInAnimation:this.pseudoElementOutAnimation;if(!e)return null;if(Array.isArray(e)){const[t,n]=e;return n}return"number"==typeof e.options?e.options:null===(t=e.options)||void 0===t?void 0:t.duration}get duration(){var t;const e=this.props.in?this.inAnimation:this.outAnimation;if(Array.isArray(e)){const[t,n]=e;return n}return"number"==typeof e.options?e.options:null===(t=e.options)||void 0===t?void 0:t.duration}get pseudoElementAnimation(){var t,e,n;if(!this.ref||!this.props.pseudoElement)return null;const i=this.props.pseudoElement.selector;let s=(null===(t=this._animationLayerData)||void 0===t?void 0:t.gestureNavigating)?"linear":"ease-out";if(this.props.in){if(Array.isArray(this.pseudoElementInAnimation)){const[t,e,n]=this.pseudoElementInAnimation;return new Animation(new KeyframeEffect(this.ref,f[t],{fill:"both",duration:e,easing:n||s,pseudoElement:i}))}{let{keyframes:t,options:n}=this.pseudoElementInAnimation;return n="number"==typeof n?{duration:n,easing:s,fill:"both",pseudoElement:i}:Object.assign(Object.assign({},n),{fill:(null==n?void 0:n.fill)||"both",duration:(null==n?void 0:n.duration)||(null===(e=this._animationLayerData)||void 0===e?void 0:e.duration),easing:(null==n?void 0:n.easing)||s,pseudoElement:i}),new Animation(new KeyframeEffect(this.ref,t,n))}}if(Array.isArray(this.pseudoElementOutAnimation)){const[t,e,n]=this.pseudoElementOutAnimation;return new Animation(new KeyframeEffect(this.ref,f[t],{fill:"both",duration:e,easing:n||s,pseudoElement:i}))}{let{keyframes:t,options:e}=this.pseudoElementOutAnimation;return e="number"==typeof e?{duration:e,easing:s,fill:"both",pseudoElement:i}:Object.assign(Object.assign({},e),{easing:(null==e?void 0:e.easing)||s,duration:(null==e?void 0:e.duration)||(null===(n=this._animationLayerData)||void 0===n?void 0:n.duration),fill:(null==e?void 0:e.fill)||"both",pseudoElement:i}),new Animation(new KeyframeEffect(this.ref,t,e))}}get animation(){var t,e,n;if(!this.ref)return null;let i=(null===(t=this._animationLayerData)||void 0===t?void 0:t.gestureNavigating)?"linear":"ease-out";if(this.props.in){if(Array.isArray(this.inAnimation)){const[t,e,n]=this.inAnimation;return new Animation(new KeyframeEffect(this.ref,f[t],{fill:"both",duration:e,easing:n||i}))}{let{keyframes:t,options:n}=this.inAnimation;return n="number"==typeof n?{duration:n,easing:i,fill:"both"}:Object.assign(Object.assign({},n),{fill:(null==n?void 0:n.fill)||"both",duration:(null==n?void 0:n.duration)||(null===(e=this._animationLayerData)||void 0===e?void 0:e.duration),easing:(null==n?void 0:n.easing)||i}),new Animation(new KeyframeEffect(this.ref,t,n))}}if(Array.isArray(this.outAnimation)){const[t,e,n]=this.outAnimation;return new Animation(new KeyframeEffect(this.ref,f[t],{fill:"both",duration:e,easing:n||i}))}{let{keyframes:t,options:e}=this.outAnimation;return e="number"==typeof e?{duration:e,easing:i,fill:"both"}:Object.assign(Object.assign({},e),{easing:(null==e?void 0:e.easing)||i,duration:(null==e?void 0:e.duration)||(null===(n=this._animationLayerData)||void 0===n?void 0:n.duration),fill:(null==e?void 0:e.fill)||"both"}),new Animation(new KeyframeEffect(this.ref,t,e))}}set zIndex(t){var e,n;0===t?null===(e=this.ref)||void 0===e||e.toggleAttribute("inert",!0):null===(n=this.ref)||void 0===n||n.toggleAttribute("inert",!1),this.setState({zIndex:t})}mounted(t,e=!0){return new Promise((n=>{const i=()=>{var i,s;if(t){e&&this.ref&&(this.ref.style.willChange="transform, opacity");const t=Boolean(this.props.in&&!(null===(i=this._animationLayerData)||void 0===i?void 0:i.gestureNavigating)||this.props.out&&(null===(s=this._animationLayerData)||void 0===s?void 0:s.gestureNavigating));this.props.onEnter&&this.props.onEnter(t)}else this.props.onExited();n()};this.props.keepAlive&&!t?n():this.setState({mounted:t},i)}))}render(){const t=this.props.renderAs;return(0,a.jsx)(t,Object.assign({id:`${this.props.name}-animation-provider`,className:"animation-provider",ref:this.setRef,tabIndex:this.state.zIndex-1,style:{gridArea:"1 / 1",width:"100%",height:"100%",transformOrigin:"center center",zIndex:this.state.zIndex}},{children:(0,a.jsx)(u.Consumer,{children:t=>(this._animationLayerData=t,this.state.mounted?this.props.children:(0,a.jsx)(a.Fragment,{}))})}))}}var E,w,b,x,S,P,A;function L(t){return null!==t&&("function"==typeof t||"object"==typeof t&&t.$$typeof===Symbol.for("react.lazy"))}!function(t){t[t.up=0]="up",t[t.down=1]="down",t[t.left=2]="left",t[t.right=3]="right",t[t.in=4]="in",t[t.out=5]="out"}(E||(E={})),function(t){t[t.slide=0]="slide",t[t.fade=1]="fade",t[t.zoom=2]="zoom",t[t.none=3]="none"}(w||(w={})),function(t){t[t.ease=0]="ease",t[t["ease-in"]=1]="ease-in",t[t["ease-in-out"]=2]="ease-in-out",t[t["ease-out"]=3]="ease-out",t[t.linear=4]="linear"}(b||(b={})),function(t){t[t.center=0]="center",t[t.top=1]="top",t[t.bottom=2]="bottom",t[t.left=3]="left",t[t.right=4]="right"}(x||(x={})),function(t){t[t.cap=0]="cap",t[t.ch=1]="ch",t[t.em=2]="em",t[t.ex=3]="ex",t[t.ic=4]="ic",t[t.lh=5]="lh",t[t.rem=6]="rem",t[t.rlh=7]="rlh",t[t.vh=8]="vh",t[t.vw=9]="vw",t[t.vi=10]="vi",t[t.vb=11]="vb",t[t.vmin=12]="vmin",t[t.vmax=13]="vmax",t[t.px=14]="px",t[t.cm=15]="cm",t[t.mm=16]="mm",t[t.Q=17]="Q",t[t.in=18]="in",t[t.pc=19]="pc",t[t.pt=20]="pt",t[t["%"]=21]="%"}(S||(S={})),function(t){t[t.inital=0]="inital",t[t.inherit=1]="inherit",t[t.revert=2]="revert",t[t.unset=3]="unset"}(P||(P={})),function(t){t[t.morph=0]="morph",t[t["fade-through"]=1]="fade-through",t[t.fade=2]="fade",t[t["cross-fade"]=3]="cross-fade"}(A||(A={}));class R{constructor(t){this._nodes=new Map,this._name="",this._scrollPos=null,this._getScreenRect=()=>new DOMRect,this._keepAlive=!1,this._name=t}addNode(t){t&&(console.assert(!this.nodes.has(t.id),`Duplicate Shared Element ID: ${t.id} in ${this._name}`),this._nodes.set(t.id,t))}removeNode(t){this._nodes.delete(t)}get xRatio(){const t=(this._getScreenRect().width/window.innerWidth).toFixed(2);return parseFloat(t)}get yRatio(){const t=(this._getScreenRect().height/window.innerHeight).toFixed(2);return parseFloat(t)}get nodes(){return this._nodes}get name(){return this._name}get scrollPos(){return this._scrollPos||{x:0,y:0}}get x(){return this._getScreenRect().x}get y(){return this._getScreenRect().y}get keepAlive(){return this._keepAlive}set scrollPos(t){this._scrollPos=t}set getScreenRect(t){this._getScreenRect=t}set keepAlive(t){this._keepAlive=t}isEmpty(){return!Boolean(this._nodes.size)}}const k=(0,t.createContext)(null);function D(t,e,n){const i=e.firstElementChild;return i?(n.props.config&&n.props.config.transformOrigin&&(i.style.transformOrigin=n.props.config.transformOrigin),{id:t,instance:n}):null}const O=["transform","top","left","right","bottom"];class N extends t.Component{constructor(){super(...arguments),this._id=this.props.id.toString(),this._ref=null,this._scene=null,this._mutationObserver=new MutationObserver(this.updateScene.bind(this)),this._callbackID=0,this._computedStyle=null,this._isMounted=!1,this.onRef=this.setRef.bind(this),this.state={hidden:!1,keepAlive:!1},this.onCloneAppended=t=>{},this.onCloneRemove=t=>{var e;if((null===(e=this._ref)||void 0===e?void 0:e.firstElementChild)instanceof HTMLVideoElement){const e=t.firstElementChild;this._ref.firstElementChild.currentTime=e.currentTime,e.paused||e.pause()}}}get scene(){return this._scene}get node(){var t;return this._ref?this._ref.firstElementChild instanceof HTMLVideoElement&&"morph"===(null!==(t=this.transitionType)&&void 0!==t?t:"morph")?this._ref:this._ref.cloneNode(!0):null}get clientRect(){if(this._ref&&this._ref.firstElementChild){return this._ref.firstElementChild.getBoundingClientRect()}return new DOMRect}get CSSData(){const t=this._computedStyle;return t?(0,h.hR)(t,O):["",{}]}get CSSText(){const t=this._computedStyle;if(t){const[e]=(0,h.hR)(t,O,!1);return e}return""}get id(){return this._id}get transitionType(){var t;return null===(t=this.props.config)||void 0===t?void 0:t.type}keepAlive(t){return new Promise((e=>{this.setState({keepAlive:t},(()=>e()))}))}hidden(t){return new Promise(((e,n)=>{this._isMounted?this.setState({hidden:t},(()=>{e()})):e()}))}setRef(t){var e,n;this._ref!==t&&(this._ref&&(null===(e=this.scene)||void 0===e||e.removeNode(this._id),this._mutationObserver.disconnect(),this._computedStyle=null),this._ref=t,t&&(null===(n=this.scene)||void 0===n||n.addNode(D(this._id,t,this)),t.firstElementChild&&(this._computedStyle=window.getComputedStyle(t.firstElementChild),this._mutationObserver.observe(t.firstElementChild,{attributes:!0,childList:!0,subtree:!0}))))}updateScene(){const t=window.cancelIdleCallback?window.cancelIdleCallback:window.clearTimeout,e=window.requestIdleCallback?window.requestIdleCallback:window.setTimeout;t(this._callbackID),this._callbackID=e((()=>{var t,e;this._ref&&(null===(t=this.scene)||void 0===t||t.removeNode(this._id),null===(e=this.scene)||void 0===e||e.addNode(D(this._id,this._ref,this))),this._callbackID=0}))}componentDidMount(){this._isMounted=!0}componentDidUpdate(){var t,e;this._id!==this.props.id.toString()&&this._ref&&(null===(t=this.scene)||void 0===t||t.removeNode(this._id),this._id=this.props.id.toString(),null===(e=this.scene)||void 0===e||e.addNode(D(this._id,this._ref,this)))}componentWillUnmount(){this._isMounted=!1}render(){return(0,a.jsx)(k.Consumer,{children:t=>(this._scene=t,(0,a.jsx)("div",Object.assign({ref:this.onRef,id:`shared-element-${this._id}`,style:{display:this.state.hidden&&!this.keepAlive?"block":"contents",visibility:this.state.hidden?"hidden":"visible"}},{children:this.props.children})))})}}const I=(0,t.createContext)({preloaded:!1,params:{},path:void 0});class T extends t.Component{constructor(){var t,e,n,i;super(...arguments),this.name=void 0===this.props.path?"not-found":(null===(t=this.props.path)||void 0===t?void 0:t.toString().slice(1).replace("/","-"))||"index",this.sharedElementScene=new R(this.name),this.ref=null,this.contextParams=null===(n=null===(e=this.context)||void 0===e?void 0:e.routesData.get(this.props.path))||void 0===n?void 0:n.params,this.onRef=this.setRef.bind(this),this.animation=h.r2,this.pseudoElementAnimation=h.r2,this.elementType="div",this.animationProviderRef=null,this.state={shouldKeepAlive:this.props.out&&(null===(i=this.props.config)||void 0===i?void 0:i.keepAlive)}}componentDidMount(){var t,e,n,i,s,o,r;this.sharedElementScene.getScreenRect=()=>{var t;return(null===(t=this.ref)||void 0===t?void 0:t.getBoundingClientRect())||new DOMRect},this.sharedElementScene.keepAlive=(null===(t=this.props.config)||void 0===t?void 0:t.keepAlive)||!1,this.animation=null!==(n=this.setupAnimation(null===(e=this.props.config)||void 0===e?void 0:e.animation))&&void 0!==n?n:this.context.animation,this.pseudoElementAnimation=null!==(o=this.setupAnimation(null===(s=null===(i=this.props.config)||void 0===i?void 0:i.pseudoElement)||void 0===s?void 0:s.animation))&&void 0!==o?o:h.r2,this.contextParams=null===(r=this.context.routesData.get(this.props.path))||void 0===r?void 0:r.params,this.context.mountedScreen=this,this.forceUpdate()}shouldComponentUpdate(t){var e,n;return(null===(e=this.context.routesData.get(this.props.path))||void 0===e?void 0:e.params)!==this.contextParams?(this.contextParams=null===(n=this.context.routesData.get(this.props.path))||void 0===n?void 0:n.params,!0):!(!t.out||t.in)||(!(!t.in||t.out)||(t.in!==this.props.in||t.out!==this.props.out))}componentDidUpdate(t){var e,n,i;(null===(e=t.config)||void 0===e?void 0:e.keepAlive)!==(null===(n=this.props.config)||void 0===n?void 0:n.keepAlive)&&(this.sharedElementScene.keepAlive=(null===(i=this.props.config)||void 0===i?void 0:i.keepAlive)||!1)}setupAnimation(t){return t?"function"==typeof t?this.animationFactory.bind(this,t):"in"in t?{in:t.in,out:t.out||t.in}:{in:t,out:t}:null}animationFactory(t){if("function"==typeof t){let e=this.context.navigation.history.next;this.context.backNavigating||(e=this.context.navigation.history.previous);const n=t(e||"",this.context.navigation.history.current,this.context.gestureNavigating);return"in"in n?{in:n.in,out:n.out||n.in}:{in:n,out:n}}return this.context.animation}onExited(){}onExit(){this.context.backNavigating?this.setState({shouldKeepAlive:!1}):this.setState({shouldKeepAlive:!0}),this.context.ghostLayer&&(this.context.ghostLayer.currentScene=this.sharedElementScene)}onEnter(){this.context.ghostLayer&&(this.context.ghostLayer.nextScene=this.sharedElementScene)}onEntered(){}setRef(t){this.ref!==t&&(this.ref=t)}get resolvedPathname(){return this.props.resolvedPathname}render(){var e,n,i,s,o,r,h,l,u;let c,d=this.props.component,p=null===(n=null===(e=this.props.config)||void 0===e?void 0:e.header)||void 0===n?void 0:n.component,m=!1,v=!1;"preloaded"in d&&d.preloaded&&(d=d.preloaded,m=!0),p&&"preloaded"in p&&p.preloaded&&(p=p.preloaded,v=!0),(null===(i=this.props.config)||void 0===i?void 0:i.pseudoElement)&&(c={selector:null===(s=this.props.config)||void 0===s?void 0:s.pseudoElement.selector,animation:this.pseudoElementAnimation});const g=Object.assign(Object.assign({},this.props.defaultParams),this.contextParams);return(0,a.jsx)(_,Object.assign({onRef:t=>this.animationProviderRef=t,renderAs:this.elementType,onExit:this.onExit.bind(this),onExited:this.onExited.bind(this),onEnter:this.onEnter.bind(this),onEntered:this.onEntered.bind(this),in:this.props.in||!1,out:this.props.out||!1,name:null!==(r=null===(o=this.props.name)||void 0===o?void 0:o.toLowerCase().replace(" ","-"))&&void 0!==r?r:this.name,resolvedPathname:this.props.resolvedPathname,animation:this.animation,pseudoElement:c,backNavigating:this.context.backNavigating,keepAlive:this.state.shouldKeepAlive&&(null===(h=this.props.config)||void 0===h?void 0:h.keepAlive)||!1,navigation:this.context.navigation},{children:(0,a.jsx)("div",Object.assign({id:this.name,ref:this.onRef,className:"screen",style:{height:"100%",width:"100%",display:"flex",flexDirection:"column",pointerEvents:"inherit"}},{children:(0,a.jsx)(k.Provider,Object.assign({value:this.sharedElementScene},{children:(0,a.jsxs)(I.Provider,Object.assign({value:{preloaded:m,path:this.props.path,params:g}},{children:[(0,a.jsx)(t.Suspense,Object.assign({fallback:(0,a.jsx)(C,{component:null===(u=null===(l=this.props.config)||void 0===l?void 0:l.header)||void 0===u?void 0:u.fallback})},{children:(0,a.jsx)(C,{component:p})})),(0,a.jsx)(t.Suspense,Object.assign({fallback:(0,a.jsx)(C,{component:this.props.fallback})},{children:(0,a.jsx)(C,{component:d})}))]}))}))}))}))}}function C({component:e}){const n=M(),i=F(),s=null!=e?e:null;return(0,t.isValidElement)(s)?(0,t.cloneElement)(s,{orientation:screen.orientation,navigation:n,route:i}):L(s)?(0,a.jsx)(s,{orientation:screen.orientation,navigation:n,route:i}):(0,a.jsx)(a.Fragment,{children:s})}T.contextType=n,T.defaultProps={route:{params:{}}};class j{constructor(t,e,n){var i;this._stack=[],this._routerId=t,window.history.replaceState(Object.assign(Object.assign({},history.state),{routerId:this._routerId}),"",window.location.toString()),n=n||new URL(window.location.toString()),n=new URL(n.href.replace(/\/$/,"")),this._baseURL=n,this._defaultRoute=e,this.state.has(this.baseURL.pathname)||this.state.set(this.baseURL.pathname,{});const s=null===(i=this.state.get(this.baseURL.pathname))||void 0===i?void 0:i.stack;s?this._stack=[...s.filter((t=>Boolean(t)))]:this.state.has(this.baseURL.pathname)&&(this.state.get(this.baseURL.pathname).stack=[...this._stack])}set defaultRoute(t){this._defaultRoute=t}get length(){return this._stack.length}get defaultRoute(){return this._defaultRoute||"/"}get isEmpty(){return!this._stack.length}get baseURL(){return this._baseURL}get state(){return{set:(t,e)=>!!window.history.state&&(window.history.state[t]=e,!0),get:t=>window.history.state&&window.history.state[t]||null,has:t=>!!window.history.state&&t in window.history.state,delete:t=>!!window.history.state&&delete window.history.state[t],keys:()=>Object.keys(window.history.state||{}),values:()=>Object.values(window.history.state||{}),clear(){return this.keys().forEach((t=>delete window.history.state[t]))},get length(){return this.keys().length}}}pushState(t,e,n){t=Object.assign(Object.assign({},window.history.state),{[this.baseURL.pathname]:Object.assign(Object.assign({},window.history.state[this.baseURL.pathname]),t),routerId:this._routerId}),window.history.pushState(t,e,n)}replaceState(t,e,n){t=Object.assign(Object.assign({},window.history.state),{[this.baseURL.pathname]:Object.assign(Object.assign({},window.history.state[this.baseURL.pathname]),t),routerId:this._routerId}),window.history.replaceState(t,e,n)}static getURL(t,e,n=""){e.pathname.match(/\/$/)||(e=new URL(e.href+"/")),t.match(/^\//)&&(t=t.slice(1));const i=new URL(t,e);return i.search=n,i}}function $(){const e=window.matchMedia("(prefers-reduced-motion: reduce)"),[n,i]=(0,t.useState)(e.matches);return e.onchange=()=>{i(e.matches)},n}function M(){const e=(0,t.useContext)(n);if(e)return e.navigation;throw new Error("RouterData is null. You may be trying to call useNavigation outside a Router.")}function U(){const[e,n]=(0,t.useState)((0,t.useContext)(d)),i=M();return(0,t.useEffect)((()=>{const t=({detail:t})=>{n(t.progress)};return i.addEventListener("motion-progress",t),()=>i.removeEventListener("motion-progress",t)}),[]),e}function F(){const e=(0,t.useContext)(I);if(e)return e;throw new Error("RouterData is null. You may be trying to call useRoute outside a Router.")}var V=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};function z(e){const i=(0,t.useContext)(n),s=M(),[o,r]=(0,t.useState)(""),[l,u]=(0,t.useState)(!1);(0,t.useEffect)((()=>{if(!s)return;let t,n;if("goBack"in e)t=Y(s),n="";else{const s=(null==i?void 0:i.paramsSerializer)||null;t=e.href,n=(0,h.Po)(e.params||{},s)||""}const o=new URL(t,s.location.origin);o.hash=e.hash||"",o.search=n,o.origin===s.location.origin?(u(!1),r(o.href.replace(s.location.origin,""))):(u(!0),r(o.href))}),[e.href,e.params]);const{href:c,goBack:d,hash:p,onClick:m,replace:v,params:g}=e,f=V(e,["href","goBack","hash","onClick","replace","params"]);return s?(0,a.jsx)("a",Object.assign({href:o,onClick:t=>{t.stopPropagation(),s&&(l||(t.preventDefault(),m&&m(t),d&&s.goBack(),c&&s.navigate(c,g,{hash:p,replace:v})))}},f,{children:e.children})):(0,a.jsx)(a.Fragment,{})}function Y(t){return t.canGoBack()?t.history.previous:t.parent?Y(t.parent):document.referrer}var X=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};function B(t){var{disabled:e,children:n}=t,i=X(t,["disabled","children"]);return(0,a.jsx)("div",Object.assign({className:"gesture-region","data-disabled":e,style:{display:"contents"}},i,{children:n}))}i(878);var H=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class W extends t.Component{constructor(t){super(t),this.ref=null,this.scrollPos={x:0,y:0},this.routerData=null,this._mounted=!1,this.onPageAnimationEnd=()=>{window.location.hash&&requestAnimationFrame(this.onHashChange.bind(this))},this.onHashChange=()=>{var t;if(this.ref){const e=location.hash;try{null===(t=this.ref.querySelector(e))||void 0===t||t.scrollIntoView(this.props.hashScrollConfig)}catch(t){}}},this.setRef=t=>{t&&(this.scrollPos={x:t.scrollLeft,y:t.scrollTop},this.ref=t,location.hash&&!this._mounted&&this.onHashChange(),this._mounted=!0)},this.onHashChange=this.onHashChange.bind(this)}componentDidMount(){var t,e;const n=null===(t=this.routerData)||void 0===t?void 0:t.scrollRestorationData.get(this.props.id);n&&(this.scrollPos=n),this.ref&&this.props.shouldRestore&&this.ref.scrollTo({left:this.scrollPos.x,top:this.scrollPos.y}),null===(e=this.routerData)||void 0===e||e.navigation.addEventListener("page-animation-end",this.onPageAnimationEnd),window.addEventListener("hashchange",this.onHashChange)}componentWillUnmount(){var t,e,n,i;const s={x:(null===(t=this.ref)||void 0===t?void 0:t.scrollLeft)||0,y:(null===(e=this.ref)||void 0===e?void 0:e.scrollTop)||0};null===(n=this.routerData)||void 0===n||n.scrollRestorationData.set(this.props.id,s),null===(i=this.routerData)||void 0===i||i.navigation.removeEventListener("page-animation-end",this.onPageAnimationEnd),window.removeEventListener("hashchange",this.onHashChange)}get scrollTop(){var t,e;return null!==(e=null===(t=this.ref)||void 0===t?void 0:t.scrollTop)&&void 0!==e?e:0}get scrollLeft(){var t,e;return null!==(e=null===(t=this.ref)||void 0===t?void 0:t.scrollLeft)&&void 0!==e?e:0}get scrollWidth(){var t,e;return null!==(e=null===(t=this.ref)||void 0===t?void 0:t.scrollWidth)&&void 0!==e?e:0}get scrollHeight(){var t,e;return null!==(e=null===(t=this.ref)||void 0===t?void 0:t.scrollHeight)&&void 0!==e?e:0}render(){return(0,a.jsx)(n.Consumer,{children:t=>{this.routerData=t;const e=this.props,{style:n,shouldRestore:i,hashScrollConfig:s}=e,o=H(e,["style","shouldRestore","hashScrollConfig"]);return(0,a.jsx)("div",Object.assign({},o,{ref:this.setRef,style:Object.assign(Object.assign({},n),{overflow:"scroll"})},{children:this.props.children}))}})}}var G=/[$_\p{ID_Start}]/u,K=/[$_\u200C\u200D\p{ID_Continue}]/u;function q(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function J(t,e=!1){const n=[];let i=0;for(;i<t.length;){const s=t[i],o=function(s){if(!e)throw new TypeError(s);n.push({type:"INVALID_CHAR",index:i,value:t[i++]})};if("*"!==s)if("+"!==s&&"?"!==s)if("\\"!==s)if("{"!==s)if("}"!==s)if(":"!==s)if("("!==s)n.push({type:"CHAR",index:i,value:t[i++]});else{let e=1,s="",r=i+1,a=!1;if("?"===t[r]){o(`Pattern cannot start with "?" at ${r}`);continue}for(;r<t.length;){if(!q(t[r],!1)){o(`Invalid character '${t[r]}' at ${r}.`),a=!0;break}if("\\"!==t[r]){if(")"===t[r]){if(e--,0===e){r++;break}}else if("("===t[r]&&(e++,"?"!==t[r+1])){o(`Capturing groups are not allowed at ${r}`),a=!0;break}s+=t[r++]}else s+=t[r++]+t[r++]}if(a)continue;if(e){o(`Unbalanced pattern at ${i}`);continue}if(!s){o(`Missing pattern at ${i}`);continue}n.push({type:"PATTERN",index:i,value:s}),i=r}else{let e="",s=i+1;for(;s<t.length;){const n=t.substr(s,1);if(!(s===i+1&&G.test(n)||s!==i+1&&K.test(n)))break;e+=t[s++]}if(!e){o(`Missing parameter name at ${i}`);continue}n.push({type:"NAME",index:i,value:e}),i=s}else n.push({type:"CLOSE",index:i,value:t[i++]});else n.push({type:"OPEN",index:i,value:t[i++]});else n.push({type:"ESCAPED_CHAR",index:i++,value:t[i++]});else n.push({type:"MODIFIER",index:i,value:t[i++]});else n.push({type:"ASTERISK",index:i,value:t[i++]})}return n.push({type:"END",index:i,value:""}),n}function Q(t,e={}){const n=J(t),{prefixes:i="./"}=e,s=`[^${Z(void 0===e.delimiter?"/#?":e.delimiter)}]+?`,o=[];let r=0,a=0,h="",l=new Set;const u=t=>{if(a<n.length&&n[a].type===t)return n[a++].value},c=()=>{const t=u("MODIFIER");return t||u("ASTERISK")},d=t=>{const e=u(t);if(void 0!==e)return e;const{type:i,index:s}=n[a];throw new TypeError(`Unexpected ${i} at ${s}, expected ${t}`)},p=()=>{let t,e="";for(;t=u("CHAR")||u("ESCAPED_CHAR");)e+=t;return e},m=e.encodePart||(t=>t);for(;a<n.length;){const t=u("CHAR"),e=u("NAME");let n=u("PATTERN");if(e||n||!u("ASTERISK")||(n=".*"),e||n){let a=t||"";-1===i.indexOf(a)&&(h+=a,a=""),h&&(o.push(m(h)),h="");const u=e||r++;if(l.has(u))throw new TypeError(`Duplicate name '${u}'.`);l.add(u),o.push({name:u,prefix:m(a),suffix:"",pattern:n||s,modifier:c()||""});continue}const a=t||u("ESCAPED_CHAR");if(a){h+=a;continue}if(u("OPEN")){const t=p(),e=u("NAME")||"";let n=u("PATTERN")||"";e||n||!u("ASTERISK")||(n=".*");const i=p();d("CLOSE");const a=c()||"";if(!e&&!n&&!a){h+=t;continue}if(!e&&!n&&!t)continue;h&&(o.push(m(h)),h=""),o.push({name:e||(n?r++:""),pattern:e&&!n?s:n,prefix:m(t),suffix:m(i),modifier:a})}else h&&(o.push(m(h)),h=""),d("END")}return o}function Z(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function tt(t){return t&&t.ignoreCase?"ui":"u"}function et(t,e,n={}){const{strict:i=!1,start:s=!0,end:o=!0,encode:r=(t=>t)}=n,a=`[${Z(void 0===n.endsWith?"":n.endsWith)}]|$`,h=`[${Z(void 0===n.delimiter?"/#?":n.delimiter)}]`;let l=s?"^":"";for(const n of t)if("string"==typeof n)l+=Z(r(n));else{const t=Z(r(n.prefix)),i=Z(r(n.suffix));if(n.pattern)if(e&&e.push(n),t||i)if("+"===n.modifier||"*"===n.modifier){const e="*"===n.modifier?"?":"";l+=`(?:${t}((?:${n.pattern})(?:${i}${t}(?:${n.pattern}))*)${i})${e}`}else l+=`(?:${t}(${n.pattern})${i})${n.modifier}`;else"+"===n.modifier||"*"===n.modifier?l+=`((?:${n.pattern})${n.modifier})`:l+=`(${n.pattern})${n.modifier}`;else l+=`(?:${t}${i})${n.modifier}`}if(o)i||(l+=`${h}?`),l+=n.endsWith?`(?=${a})`:"$";else{const e=t[t.length-1],n="string"==typeof e?h.indexOf(e[e.length-1])>-1:void 0===e;i||(l+=`(?:${h}(?=${a}))?`),n||(l+=`(?=${h}|${a})`)}return new RegExp(l,tt(n))}function nt(t,e,n){return t instanceof RegExp?function(t,e){if(!e)return t;const n=/\((?:\?<(.*?)>)?(?!\?)/g;let i=0,s=n.exec(t.source);for(;s;)e.push({name:s[1]||i++,prefix:"",suffix:"",modifier:"",pattern:""}),s=n.exec(t.source);return t}(t,e):Array.isArray(t)?function(t,e,n){const i=t.map((t=>nt(t,e,n).source));return new RegExp(`(?:${i.join("|")})`,tt(n))}(t,e,n):function(t,e,n){return et(Q(t,n),e,n)}(t,e,n)}var it={delimiter:"",prefixes:"",sensitive:!0,strict:!0},st={delimiter:".",prefixes:"",sensitive:!0,strict:!0},ot={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function rt(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function at(t){return!(!t||t.length<2)&&("["===t[0]||("\\"===t[0]||"{"===t[0])&&"["===t[1])}var ht=["ftp","file","http","https","ws","wss"];function lt(t){if(!t)return!0;for(const e of ht)if(t.test(e))return!0;return!1}function ut(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function ct(t){if(""===t)return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function dt(t){if(""===t)return t;const e=new URL("https://example.com");return e.username=t,e.username}function pt(t){if(""===t)return t;const e=new URL("https://example.com");return e.password=t,e.password}function mt(t){if(""===t)return t;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(t))throw new TypeError(`Invalid hostname '${t}'`);const e=new URL("https://example.com");return e.hostname=t,e.hostname}function vt(t){if(""===t)return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function gt(t){if(""===t)return t;if(/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function ft(t){if(""===t)return t;const e=new URL("https://example.com");return e.pathname="/"!==t[0]?"/-"+t:t,"/"!==t[0]?e.pathname.substring(2,e.pathname.length):e.pathname}function yt(t){if(""===t)return t;return new URL(`data:${t}`).pathname}function _t(t){if(""===t)return t;const e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function Et(t){if(""===t)return t;const e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}var wt=["protocol","username","password","hostname","port","pathname","search","hash"],bt="*";function xt(t,e){if("string"!=typeof t)throw new TypeError("parameter 1 is not of type 'string'.");const n=new URL(t,e);return{protocol:n.protocol.substring(0,n.protocol.length-1),username:n.username,password:n.password,hostname:n.hostname,port:n.port,pathname:n.pathname,search:""!=n.search?n.search.substring(1,n.search.length):void 0,hash:""!=n.hash?n.hash.substring(1,n.hash.length):void 0}}function St(t,e){return e?At(t):t}function Pt(t,e,n){let i;if("string"==typeof e.baseURL)try{i=new URL(e.baseURL),t.protocol=St(i.protocol.substring(0,i.protocol.length-1),n),t.username=St(i.username,n),t.password=St(i.password,n),t.hostname=St(i.hostname,n),t.port=St(i.port,n),t.pathname=St(i.pathname,n),t.search=St(i.search.substring(1,i.search.length),n),t.hash=St(i.hash.substring(1,i.hash.length),n)}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if("string"==typeof e.protocol&&(t.protocol=function(t,e){var n,i;return i=":",t=(n=t).endsWith(i)?n.substr(0,n.length-i.length):n,e||""===t?t:ct(t)}(e.protocol,n)),"string"==typeof e.username&&(t.username=function(t,e){if(e||""===t)return t;const n=new URL("https://example.com");return n.username=t,n.username}(e.username,n)),"string"==typeof e.password&&(t.password=function(t,e){if(e||""===t)return t;const n=new URL("https://example.com");return n.password=t,n.password}(e.password,n)),"string"==typeof e.hostname&&(t.hostname=function(t,e){return e||""===t?t:at(t)?vt(t):mt(t)}(e.hostname,n)),"string"==typeof e.port&&(t.port=function(t,e,n){return ut(e)===t&&(t=""),n||""===t?t:gt(t)}(e.port,t.protocol,n)),"string"==typeof e.pathname){if(t.pathname=e.pathname,i&&!function(t,e){return!(!t.length||"/"!==t[0]&&(!e||t.length<2||"\\"!=t[0]&&"{"!=t[0]||"/"!=t[1]))}(t.pathname,n)){const e=i.pathname.lastIndexOf("/");e>=0&&(t.pathname=St(i.pathname.substring(0,e+1),n)+t.pathname)}t.pathname=function(t,e,n){if(n||""===t)return t;if(e&&!ht.includes(e))return new URL(`${e}:${t}`).pathname;const i="/"==t[0];return t=new URL(i?t:"/-"+t,"https://example.com").pathname,i||(t=t.substring(2,t.length)),t}(t.pathname,t.protocol,n)}return"string"==typeof e.search&&(t.search=function(t,e){if(t=rt(t,"?"),e||""===t)return t;const n=new URL("https://example.com");return n.search=t,n.search?n.search.substring(1,n.search.length):""}(e.search,n)),"string"==typeof e.hash&&(t.hash=function(t,e){if(t=rt(t,"#"),e||""===t)return t;const n=new URL("https://example.com");return n.hash=t,n.hash?n.hash.substring(1,n.hash.length):""}(e.hash,n)),t}function At(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function Lt(t,e){const n=`[^${i=void 0===e.delimiter?"/#?":e.delimiter,i.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}]+?`;var i;const s=/[$_\u200C\u200D\p{ID_Continue}]/u;let o="";for(let i=0;i<t.length;++i){const r=t[i],a=i>0?t[i-1]:null,h=i<t.length-1?t[i+1]:null;if("string"==typeof r){o+=At(r);continue}if(""===r.pattern){if(""===r.modifier){o+=At(r.prefix);continue}o+=`{${At(r.prefix)}}${r.modifier}`;continue}const l="number"!=typeof r.name,u=void 0!==e.prefixes?e.prefixes:"./";let c=""!==r.suffix||""!==r.prefix&&(1!==r.prefix.length||!u.includes(r.prefix));if(!c&&l&&r.pattern===n&&""===r.modifier&&h&&!h.prefix&&!h.suffix)if("string"==typeof h){const t=h.length>0?h[0]:"";c=s.test(t)}else c="number"==typeof h.name;if(!c&&""===r.prefix&&a&&"string"==typeof a&&a.length>0){const t=a[a.length-1];c=u.includes(t)}c&&(o+="{"),o+=At(r.prefix),l&&(o+=`:${r.name}`),".*"===r.pattern?l||a&&"string"!=typeof a&&!a.modifier&&!c&&""===r.prefix?o+="(.*)":o+="*":r.pattern===n?l||(o+=`(${n})`):o+=`(${r.pattern})`,r.pattern===n&&l&&""!==r.suffix&&s.test(r.suffix[0])&&(o+="\\"),o+=At(r.suffix),c&&(o+="}"),o+=r.modifier}return o}var Rt=class{constructor(t={},e,n){this.regexp={},this.keys={},this.component_pattern={};try{let i;if("string"==typeof e?i=e:n=e,"string"==typeof t){const e=new class{constructor(t){this.tokenList=[],this.internalResult={},this.tokenIndex=0,this.tokenIncrement=1,this.componentStart=0,this.state=0,this.groupDepth=0,this.hostnameIPv6BracketDepth=0,this.shouldTreatAsStandardURL=!1,this.input=t}get result(){return this.internalResult}parse(){for(this.tokenList=J(this.input,!0);this.tokenIndex<this.tokenList.length;this.tokenIndex+=this.tokenIncrement){if(this.tokenIncrement=1,"END"===this.tokenList[this.tokenIndex].type){if(0===this.state){this.rewind(),this.isHashPrefix()?this.changeState(9,1):this.isSearchPrefix()?(this.changeState(8,1),this.internalResult.hash=""):(this.changeState(7,0),this.internalResult.search="",this.internalResult.hash="");continue}if(2===this.state){this.rewindAndSetState(5);continue}this.changeState(10,0);break}if(this.groupDepth>0){if(!this.isGroupClose())continue;this.groupDepth-=1}if(this.isGroupOpen())this.groupDepth+=1;else switch(this.state){case 0:this.isProtocolSuffix()&&(this.internalResult.username="",this.internalResult.password="",this.internalResult.hostname="",this.internalResult.port="",this.internalResult.pathname="",this.internalResult.search="",this.internalResult.hash="",this.rewindAndSetState(1));break;case 1:if(this.isProtocolSuffix()){this.computeShouldTreatAsStandardURL();let t=7,e=1;this.shouldTreatAsStandardURL&&(this.internalResult.pathname="/"),this.nextIsAuthoritySlashes()?(t=2,e=3):this.shouldTreatAsStandardURL&&(t=2),this.changeState(t,e)}break;case 2:this.isIdentityTerminator()?this.rewindAndSetState(3):(this.isPathnameStart()||this.isSearchPrefix()||this.isHashPrefix())&&this.rewindAndSetState(5);break;case 3:this.isPasswordPrefix()?this.changeState(4,1):this.isIdentityTerminator()&&this.changeState(5,1);break;case 4:this.isIdentityTerminator()&&this.changeState(5,1);break;case 5:this.isIPv6Open()?this.hostnameIPv6BracketDepth+=1:this.isIPv6Close()&&(this.hostnameIPv6BracketDepth-=1),this.isPortPrefix()&&!this.hostnameIPv6BracketDepth?this.changeState(6,1):this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 6:this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 7:this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 8:this.isHashPrefix()&&this.changeState(9,1)}}}changeState(t,e){switch(this.state){case 0:case 2:case 10:break;case 1:this.internalResult.protocol=this.makeComponentString();break;case 3:this.internalResult.username=this.makeComponentString();break;case 4:this.internalResult.password=this.makeComponentString();break;case 5:this.internalResult.hostname=this.makeComponentString();break;case 6:this.internalResult.port=this.makeComponentString();break;case 7:this.internalResult.pathname=this.makeComponentString();break;case 8:this.internalResult.search=this.makeComponentString();break;case 9:this.internalResult.hash=this.makeComponentString()}this.changeStateWithoutSettingComponent(t,e)}changeStateWithoutSettingComponent(t,e){this.state=t,this.componentStart=this.tokenIndex+e,this.tokenIndex+=e,this.tokenIncrement=0}rewind(){this.tokenIndex=this.componentStart,this.tokenIncrement=0}rewindAndSetState(t){this.rewind(),this.state=t}safeToken(t){return t<0&&(t=this.tokenList.length-t),t<this.tokenList.length?this.tokenList[t]:this.tokenList[this.tokenList.length-1]}isNonSpecialPatternChar(t,e){const n=this.safeToken(t);return n.value===e&&("CHAR"===n.type||"ESCAPED_CHAR"===n.type||"INVALID_CHAR"===n.type)}isProtocolSuffix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}nextIsAuthoritySlashes(){return this.isNonSpecialPatternChar(this.tokenIndex+1,"/")&&this.isNonSpecialPatternChar(this.tokenIndex+2,"/")}isIdentityTerminator(){return this.isNonSpecialPatternChar(this.tokenIndex,"@")}isPasswordPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPortPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPathnameStart(){return this.isNonSpecialPatternChar(this.tokenIndex,"/")}isSearchPrefix(){if(this.isNonSpecialPatternChar(this.tokenIndex,"?"))return!0;if("?"!==this.tokenList[this.tokenIndex].value)return!1;const t=this.safeToken(this.tokenIndex-1);return"NAME"!==t.type&&"PATTERN"!==t.type&&"CLOSE"!==t.type&&"ASTERISK"!==t.type}isHashPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,"#")}isGroupOpen(){return"OPEN"==this.tokenList[this.tokenIndex].type}isGroupClose(){return"CLOSE"==this.tokenList[this.tokenIndex].type}isIPv6Open(){return this.isNonSpecialPatternChar(this.tokenIndex,"[")}isIPv6Close(){return this.isNonSpecialPatternChar(this.tokenIndex,"]")}makeComponentString(){const t=this.tokenList[this.tokenIndex],e=this.safeToken(this.componentStart).index;return this.input.substring(e,t.index)}computeShouldTreatAsStandardURL(){const t={};Object.assign(t,it),t.encodePart=ct;const e=nt(this.makeComponentString(),void 0,t);this.shouldTreatAsStandardURL=lt(e)}}(t);if(e.parse(),t=e.result,void 0===i&&"string"!=typeof t.protocol)throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=i}else{if(!t||"object"!=typeof t)throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(i)throw new TypeError("parameter 1 is not of type 'string'.")}void 0===n&&(n={ignoreCase:!1});const s={ignoreCase:!0===n.ignoreCase},o={pathname:bt,protocol:bt,username:bt,password:bt,hostname:bt,port:bt,search:bt,hash:bt};let r;for(r of(this.pattern=Pt(o,t,!0),ut(this.pattern.protocol)===this.pattern.port&&(this.pattern.port=""),wt)){if(!(r in this.pattern))continue;const t={},e=this.pattern[r];switch(this.keys[r]=[],r){case"protocol":Object.assign(t,it),t.encodePart=ct;break;case"username":Object.assign(t,it),t.encodePart=dt;break;case"password":Object.assign(t,it),t.encodePart=pt;break;case"hostname":Object.assign(t,st),at(e)?t.encodePart=vt:t.encodePart=mt;break;case"port":Object.assign(t,it),t.encodePart=gt;break;case"pathname":lt(this.regexp.protocol)?(Object.assign(t,ot,s),t.encodePart=ft):(Object.assign(t,it,s),t.encodePart=yt);break;case"search":Object.assign(t,it,s),t.encodePart=_t;break;case"hash":Object.assign(t,it,s),t.encodePart=Et}try{const n=Q(e,t);this.regexp[r]=et(n,this.keys[r],t),this.component_pattern[r]=Lt(n,t)}catch{throw new TypeError(`invalid ${r} pattern '${this.pattern[r]}'.`)}}}catch(t){throw new TypeError(`Failed to construct 'URLPattern': ${t.message}`)}}test(t={},e){let n,i={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof t&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(void 0===t)return!1;try{i=Pt(i,"object"==typeof t?t:xt(t,e),!1)}catch(t){return!1}for(n of wt)if(!this.regexp[n].exec(i[n]))return!1;return!0}exec(t={},e){let n={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof t&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(void 0===t)return;try{n=Pt(n,"object"==typeof t?t:xt(t,e),!1)}catch(t){return null}let i,s={};for(i of(s.inputs=e?[t,e]:[t],wt)){let t=this.regexp[i].exec(n[i]);if(!t)return null;let e={};for(let[n,s]of this.keys[i].entries())if("string"==typeof s.name||"number"==typeof s.name){let i=t[n+1];e[s.name]=i}s[i]={input:n[i]||"",groups:e}}return s}get protocol(){return this.component_pattern.protocol}get username(){return this.component_pattern.username}get password(){return this.component_pattern.password}get hostname(){return this.component_pattern.hostname}get port(){return this.component_pattern.port}get pathname(){return this.component_pattern.pathname}get search(){return this.component_pattern.search}get hash(){return this.component_pattern.hash}};globalThis.URLPattern||(globalThis.URLPattern=Rt),globalThis.URLPattern||(globalThis.URLPattern=Rt),document.body.style.position="fixed",document.body.style.inset="0";const kt=document.head.querySelector("title");kt&&(kt.ariaLive="polite");let Dt=document.getElementById("root");Dt&&(Dt.style.width="100%",Dt.style.height="100%")})();var o=s.ee,r=s.r2,a=s.rN,h=s.PM,l=s.dw,u=s.y_,c=s.DC,d=s.GW,p=s.sV,m=s.RG,v=s.GI,g=s.rJ,f=s.uZ,y=s.PV,_=s.rL,E=s.Nu,w=s.V_,b=s.hR,x=s.cT,S=s.e1,P=s.Ef,A=s.Vo,L=s.QN,R=s.kI,k=s.Po,D=s.fJ,O=s.nc,N=s.HJ,I=s.JZ,T=s.yj;export{o as Anchor,r as DEFAULT_ANIMATION,a as GestureRegion,h as HistoryBase,l as MAX_Z_INDEX,u as Motion,c as NavigationBase,d as RouterBase,p as RouterData,m as ScreenBase,v as ScrollRestoration,g as SharedElement,f as clamp,y as concatenateURL,_ as defaultSearchParamsToObject,E as dispatchEvent,w as getAnimationDuration,b as getCSSData,x as getStyleObject,S as includesRoute,P as isValidComponentConstructor,A as lazy,L as matchRoute,R as prefetchRoute,k as searchParamsFromObject,D as searchParamsToObject,O as useMotion,N as useNavigation,I as useReducedMotion,T as useRoute};
2
+ import*as t from"react";var e={837:(t,e,n)=>{var i=n(810),s=Symbol.for("react.element"),o=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function l(t,e,n){var i,o={},l=null,u=null;for(i in void 0!==n&&(l=""+n),void 0!==e.key&&(l=""+e.key),void 0!==e.ref&&(u=e.ref),e)r.call(e,i)&&!h.hasOwnProperty(i)&&(o[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===o[i]&&(o[i]=e[i]);return{$$typeof:s,type:t,key:l,ref:u,props:o,_owner:a.current}}e.Fragment=o,e.jsx=l,e.jsxs=l},322:(t,e,n)=>{t.exports=n(837)},174:(t,e,n)=>{n.d(e,{Nu:()=>l,PV:()=>u,Po:()=>p,QN:()=>a,V_:()=>g,Vo:()=>m,cT:()=>o,dw:()=>y,e1:()=>h,fJ:()=>d,hR:()=>s,kI:()=>v,r2:()=>f,rL:()=>c,uZ:()=>r});var i=n(810);function s(t,e=[],n=!0){let i="";const s={};let o=0;for(let r in t)if(!e.includes(r)){if(o<t.length){const e=t[r];let n=t.getPropertyValue(e);if("visibility"===e)n="visible";i+=`${e}:${n};`}else{if(!n)break;let e=r,i=t[e];if("string"==typeof i&&"cssText"!==e&&!e.includes("webkit")&&!e.includes("grid")){switch(e){case"offset":e="cssOffset";break;case"float":e="cssFloat";break;case"visibility":i="visible"}s[e]=i}}o++}return[i,s]}function o(t,e=[]){const n={};for(const i in t)if(t[i]&&t[i].length&&"function"!=typeof t[i]){if(/^\d+$/.test(i))continue;if("offset"===i)continue;if(e.includes(i))continue;n[i]=t[i]}return n}function r(t,e,n){return t<e?e:n&&t>n?n:t}function a(t,e,n=window.location.origin){if(void 0===t||void 0===e)return t===e?{exact:!0,matchedPathname:e}:null;const i=new URLPattern(t,n),s=new URL(e,n),o=i.exec(s);let r="",a="";for(let t=0;t<i.pathname.length;t++){if(i.pathname[t]!==s.pathname[t]){a=s.pathname.substring(t);break}r+=i.pathname[t]}return o?{exact:t===e,matchedPathname:r,rest:a}:null}function h(t,e,n=window.location.origin){return e.some((e=>a(e,t,n)))}function l(t,e=window){return new Promise((n=>{queueMicrotask((()=>n(e.dispatchEvent(t))))}))}function u(t,e){return"string"==typeof e&&(e=new URL(e)),"string"!=typeof t&&(t=t.pathname),t=t.replace(/^\//,""),e.pathname.endsWith("/")||(e=new URL(e.href+"/")),new URL(t,e)}function c(t){const e=new URLSearchParams(decodeURI(t)).entries(),n={};for(const[t,i]of e){let e="";try{e=JSON.parse(i)}catch(t){console.warn("Non JSON serialisable value was passed as URL route param."),e=i}n[t]=e}return Object.keys(n).length?n:void 0}function d(t,e){return(e||c)(t)||{}}function p(t,e){try{return(e||function(t){return new URLSearchParams(t).toString()})(t)}catch(t){console.error(t),console.warn("Non JSON serialisable value was passed as route param to Anchor.")}return""}function m(t){const e=(0,i.lazy)(t);return e.preload=()=>{const n=t();return n.then((t=>e.preloaded=t.default)).catch(console.error),n},e}function v(t,e){let n=e;return new Promise(((s,o)=>{let r=!1;for(;n;){const h=n.routes;if(i.Children.forEach(h,(e=>{if(r)return;if(!(0,i.isValidElement)(e))return;a(e.props.path,t)&&(r=!0,queueMicrotask((async()=>{if("preload"in e.props.component)try{await e.props.component.preload(),s(r)}catch(t){o(t)}})))})),r)break;n=e.parentRouterData}r||s(!1)}))}function g(t,e=0){var n;const i=null===(n=null==t?void 0:t.effect)||void 0===n?void 0:n.getTiming().duration;return Number(i)||e}const f={in:{type:"none",duration:0},out:{type:"none",duration:0}},y=2147483647},623:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const s=i(n(813));class o extends s.default{constructor(t){super("doubletap",t)}}e.default=o},813:(t,e)=>{var n;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.tap=0]="tap",t[t.longpress=1]="longpress",t[t.pinchstart=2]="pinchstart",t[t.pinch=3]="pinch",t[t.pinchend=4]="pinchend",t[t.rotatestart=5]="rotatestart",t[t.rotate=6]="rotate",t[t.rotateend=7]="rotateend",t[t.swipestart=8]="swipestart",t[t.swipe=9]="swipe",t[t.swipeend=10]="swipeend",t[t.panstart=11]="panstart",t[t.pan=12]="pan",t[t.panend=13]="panend",t[t.doubletap=14]="doubletap"}(n||(n={})),void 0===window.TouchEvent&&(window.TouchEvent=PointerEvent);class i extends TouchEvent{constructor(t,e){if(super(t,{touches:Array.from(e.touches),targetTouches:Array.from(e.targetTouches),changedTouches:Array.from(e.changedTouches),ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,bubbles:!0,cancelable:!0}),t.includes("end")||e.type.includes("end"))return this.gestureTarget=e.changedTouches[0].target,this.x=e.changedTouches[0].clientX,void(this.y=e.changedTouches[0].clientY);this.gestureTarget=e.touches[0].target,this.x=e.touches[0].clientX,this.y=e.touches[0].clientY}}e.default=i},646:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const s=i(n(813));class o extends s.default{constructor(t,e){super("longpress",t),this.duration=0,this.duration=e}}e.default=o},577:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PanEndEvent=e.PanStartEvent=void 0;const s=i(n(813));var o;!function(t){t[t.start=0]="start",t[t.end=1]="end"}(o||(o={}));class r extends s.default{constructor(t,e,n){let i;switch(n){case"start":i="panstart";break;case"end":i="panend";break;default:i="pan"}super(i,t),this.velocity=e.velocity,this.translation={x:e.translation.x,y:e.translation.y,magnitude:e.translation.magnitude,clientX:e.translation.clientX,clientY:e.translation.clientY,clientMagnitude:e.translation.clientMagnitude}}}e.default=class extends r{constructor(t,e){super(t,e)}};e.PanStartEvent=class extends r{constructor(t,e){super(t,e,"start")}};e.PanEndEvent=class extends r{constructor(t,e){super(t,e,"end")}}},630:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PinchEndEvent=e.PinchStartEvent=void 0;const s=i(n(813));var o;!function(t){t[t.start=0]="start",t[t.end=1]="end"}(o||(o={}));class r extends s.default{constructor(t,e,n){let i;switch(n){case"start":i="pinchstart";break;case"end":i="pinchend";break;default:i="pinch"}super(i,t),Object.defineProperty(this,"scale",{value:e.scale,writable:!1})}}e.default=class extends r{constructor(t,e){super(t,e)}};e.PinchStartEvent=class extends r{constructor(t,e){super(t,e,"start")}};e.PinchEndEvent=class extends r{constructor(t,e){super(t,e,"end")}}},859:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.RotateEndEvent=e.RotateStartEvent=void 0;const s=i(n(813));var o;!function(t){t[t.start=0]="start",t[t.end=1]="end"}(o||(o={}));class r extends s.default{constructor(t,e,n){let i;switch(n){case"start":i="rotatestart";break;case"end":i="rotateend";break;default:i="rotate"}super(i,t),this.anchor={x:e.anchor.x,y:e.anchor.y,clientX:e.anchor.clientX,clientY:e.anchor.clientY},Object.defineProperty(this,"rotation",{value:e.rotation,writable:!1}),this.rotationDeg=e.rotationDeg}}e.default=class extends r{constructor(t,e){super(t,e)}};e.RotateStartEvent=class extends r{constructor(t,e){super(t,e,"start")}};e.RotateEndEvent=class extends r{constructor(t,e){super(t,e,"end")}}},224:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SwipeEndEvent=e.SwipeStartEvent=void 0;const s=i(n(813));var o;!function(t){t[t.start=0]="start",t[t.end=1]="end"}(o||(o={}));class r extends s.default{constructor(t,e,n){let i;switch(n){case"start":i="swipestart";break;case"end":i="swipeend";break;default:i="swipe"}super(i,t),this.velocity=e.velocity,this.direction=e.direction}}e.default=class extends r{constructor(t,e){super(t,e)}};e.SwipeStartEvent=class extends r{constructor(t,e){super(t,e,"start")}};e.SwipeEndEvent=class extends r{constructor(t,e){super(t,e,"end")}}},884:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const s=i(n(813));class o extends s.default{constructor(t){super("tap",t)}}e.default=o},878:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(e,n);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,s)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),s=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return s(e,t),e},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.RotateEndEvent=e.RotateEvent=e.RotateStartEvent=e.PinchEndEvent=e.PinchEvent=e.PinchStartEvent=e.PanEndEvent=e.PanEvent=e.PanStartEvent=e.SwipeEndEvent=e.SwipeEvent=e.SwipeStartEvent=e.DoubleTapEvent=e.LongPressEvent=e.GestureEvent=e.TapEvent=void 0;const a=r(n(813));e.GestureEvent=a.default;const h=r(n(646));e.LongPressEvent=h.default;const l=r(n(884));e.TapEvent=l.default;const u=r(n(623));e.DoubleTapEvent=u.default;const c=o(n(224));e.SwipeEvent=c.default,Object.defineProperty(e,"SwipeEndEvent",{enumerable:!0,get:function(){return c.SwipeEndEvent}}),Object.defineProperty(e,"SwipeStartEvent",{enumerable:!0,get:function(){return c.SwipeStartEvent}});const d=o(n(577));e.PanEvent=d.default,Object.defineProperty(e,"PanEndEvent",{enumerable:!0,get:function(){return d.PanEndEvent}}),Object.defineProperty(e,"PanStartEvent",{enumerable:!0,get:function(){return d.PanStartEvent}});const p=o(n(630));e.PinchEvent=p.default,Object.defineProperty(e,"PinchEndEvent",{enumerable:!0,get:function(){return p.PinchEndEvent}}),Object.defineProperty(e,"PinchStartEvent",{enumerable:!0,get:function(){return p.PinchStartEvent}});const m=o(n(859));e.RotateEvent=m.default,Object.defineProperty(e,"RotateEndEvent",{enumerable:!0,get:function(){return m.RotateEndEvent}}),Object.defineProperty(e,"RotateStartEvent",{enumerable:!0,get:function(){return m.RotateStartEvent}});const v=n(47);var g;!function(t){t[t.right=0]="right",t[t.up=1]="up",t[t.left=2]="left",t[t.down=3]="down"}(g||(g={}));class f{constructor(){this.touchStart=new TouchEvent("touchstart")||{},this.touchMove=new TouchEvent("touchmove")||{},this.touchEnd=new TouchEvent("touchend")||{},this.touchCancel=new TouchEvent("touchcancel")||{},this.velocity=0,this.dxDy=new v.Vec2(0,0),this.scale=1,this.rotation=0,this.rotationDeg=0,this.anchor=new v.Vec2(0,0),this.octant=0,this.isPanning=!1,this.isPinching=!1,this.isSwiping=!1,this.isRotating=!1,this.touchStartTime=0,this.touchEndTime=0,this.lastTouchTime=0,this.taps=0,this.scaleBase=0,this.touchMoved=!1,this.touchDown=!1,this.shouldFire=!1,this.pointers=0,this.isLongPress=!1,this.longPressTimeout=0,this.touchStartListener=this.onTouchStart.bind(this),this.touchMoveListener=this.onTouchMove.bind(this),this.touchEndListener=this.onTouchEnd.bind(this),this.touchCancelListener=this.onTouchCancel.bind(this),this.currentTarget=window,this.config={longPressDuration:500,tapDelay:500,minPointers:1,numberOfTaps:0},f.listening||(TouchEvent&&window.addEventListener("touchstart",this.touchStartListener,!0),f.listening=!0)}bind(t){this.unbind(this.currentTarget),t.addEventListener("touchmove",this.touchMoveListener,!0),t.addEventListener("touchend",this.touchEndListener,!0),t.addEventListener("touchcancel",this.touchCancelListener,!0),this.currentTarget=t}unbind(t){t.removeEventListener("touchmove",this.touchMoveListener),t.removeEventListener("touchend",this.touchEndListener),t.removeEventListener("touchcancel",this.touchCancelListener)}clean(){this.touchMoved=!1,this.touchStartTime=0,this.touchDown=!1,this.scaleBase=0,this.longPressTimeout&&!this.isLongPress&&(clearTimeout(this.longPressTimeout),this.longPressTimeout=0),this.isLongPress=!1}onPointerLeave(t){if(!t.touches.length){if(this.isSwiping){const e=new c.SwipeEndEvent(t,{velocity:this.velocity,direction:g[(0,v.closest)(this.octant,[0,1,2,3])]});this.dispatchEvent(e),this.isSwiping=!1}if(this.isPanning){const e=new d.PanEndEvent(t,{translation:this.dxDy,velocity:this.velocity});this.dispatchEvent(e),this.isPanning=!1}}if(1===t.touches.length){if(this.scaleBase=0,this.isPinching){const e=new p.PinchEndEvent(t,{scale:this.scale});this.dispatchEvent(e),this.isPinching=!1}if(this.isRotating){const e=new m.RotateEndEvent(t,{rotation:this.rotation,rotationDeg:this.rotationDeg,anchor:this.anchor});this.dispatchEvent(e),this.isRotating=!1}}}dispatchEvent(t){queueMicrotask((()=>{this.currentTarget.dispatchEvent(t)}))}onTouchStart(t){this.currentTarget!==t.touches[0].target&&(this.clean(),this.unbind(this.currentTarget),this.pointers=this.touchEnd.touches.length,this.taps=0),this.touchStart=t;const e=parseInt(t.touches[0].target.dataset.minpointers||"0")||this.config.minPointers;if(this.touchStart.touches.length<e)return void(this.shouldFire=!1);this.shouldFire=!0,this.touchStartTime=t.timeStamp,this.touchDown=!0,this.pointers||this.bind(t.touches[0].target),this.pointers=this.touchStart.touches.length;const n=parseFloat(this.currentTarget.dataset.longpressduration||"0")||this.config.longPressDuration;if(this.longPressTimeout||(this.longPressTimeout=setTimeout((()=>{if(!this.touchMoved&&this.touchDown){const t=Date.now()-this.touchStartTime,e=new h.default(this.touchStart,t);this.dispatchEvent(e),this.isLongPress=!0,this.longPressTimeout=0}}),n)),this.touchStart.touches.length>1){const t=new v.Vec2(this.touchStart.touches[0].clientX,this.touchStart.touches[0].clientY),e=new v.Vec2(this.touchStart.touches[1].clientX,this.touchStart.touches[1].clientY);this.scaleBase=t.substract(e).magnitude}else this.scaleBase=0}onTouchMove(t){if(!this.shouldFire)return;if(this.touchMoved=!0,this.touchMove=t,t.touches.length>1&&this.touchStart.touches.length>1&&(t.touches[1].clientX!==this.touchStart.touches[1].clientX||t.touches[1].clientY!==this.touchStart.touches[1].clientY)){const e=new v.Vec2(this.touchMove.touches[0].clientX,this.touchMove.touches[0].clientY),n=new v.Vec2(this.touchMove.touches[1].clientX,this.touchMove.touches[1].clientY),i=new v.Vec2(this.touchStart.touches[0].clientX,this.touchStart.touches[0].clientY),s=e.substract(n);if(this.scaleBase&&Math.abs(this.scaleBase-s.magnitude)>10){const e=s.magnitude/this.scaleBase;if(this.scale=e,this.isPinching){const n=new p.default(t,{scale:e});this.dispatchEvent(n)}else{const n=new p.PinchStartEvent(t,{scale:e});this.dispatchEvent(n),this.isPinching=!0}}this.anchor=e;let o=Math.atan2(i.clientY-n.clientY,i.clientX-n.clientX);if(o<0?o+=1.5708:o-=1.5708,this.rotation=o,this.rotationDeg=180*o/Math.PI,this.anchor=this.anchor,this.isRotating){const e=new m.default(t,{anchor:this.anchor,rotation:this.rotation,rotationDeg:this.rotationDeg});this.dispatchEvent(e)}else{const e=new m.RotateStartEvent(t,{anchor:this.anchor,rotation:this.rotation,rotationDeg:this.rotationDeg});this.dispatchEvent(e),this.isRotating=!0}}const e=new v.Vec2(this.touchStart.touches[0].clientX,this.touchStart.touches[0].clientY),n=new v.Vec2(this.touchMove.touches[0].clientX,this.touchMove.touches[0].clientY).substract(e),i=n.magnitude,s={x:n.x/i,y:n.y/i},o=Math.atan2(s.y,s.x);this.octant=Math.round(4*o/(2*Math.PI)+4)%4;const r=(t.timeStamp-this.touchStart.timeStamp)/1e3,a=n.magnitude/r;if(this.isSwiping){const e=new c.default(t,{direction:g[(0,v.closest)(this.octant,[0,1,2,3])],velocity:a});this.dispatchEvent(e)}else{const e=new c.SwipeStartEvent(t,{direction:g[(0,v.closest)(this.octant,[0,1,2,3])],velocity:a});this.dispatchEvent(e),this.isSwiping=!0}if(this.dxDy=n,this.velocity=a,this.isPanning){const e=new d.default(t,{translation:n,velocity:a});this.dispatchEvent(e)}else{const e=new d.PanStartEvent(t,{translation:n,velocity:a});this.dispatchEvent(e),this.isPanning=!0}}onTouchEnd(t){const e=parseInt(this.currentTarget.dataset.numberoftaps||"0")||this.config.numberOfTaps;if(this.taps++,this.shouldFire=Boolean(this.taps>e),this.shouldFire){this.touchEnd=t,this.touchEndTime=t.timeStamp;const n=parseFloat(this.currentTarget.dataset.tapdelay||"0")||this.config.tapDelay;if(!this.touchMoved&&!this.isLongPress)if(1===this.taps||this.touchEndTime-this.lastTouchTime<n){if(this.taps%2===e){const e=new u.default(t);this.dispatchEvent(e),this.taps=0}const n=new l.default(t);this.dispatchEvent(n)}else this.taps=0}this.pointers=this.touchEnd.touches.length,this.lastTouchTime=this.touchEndTime,this.onPointerLeave(t),this.unbind(this.currentTarget),this.clean()}onTouchCancel(t){this.shouldFire&&(this.touchCancel=t,this.unbind(this.currentTarget),this.clean())}}function y(t){const e=t.type;t.composedPath().forEach((n=>{if(n instanceof HTMLElement){const i=n[_[e]];if("function"!=typeof i)return;i.apply(n,[t])}}))}f.listening=!1,e.default=f,window.GLOBAL_EVENT_DISPATCHER||(window.addEventListener("tap",y,{passive:!0}),window.addEventListener("longpress",y,{passive:!0}),window.addEventListener("doubletap",y,{passive:!0}),window.addEventListener("swipestart",y,{passive:!0}),window.addEventListener("swipe",y,{passive:!0}),window.addEventListener("swipeend",y,{passive:!0}),window.addEventListener("panstart",y,{passive:!0}),window.addEventListener("pan",y,{passive:!0}),window.addEventListener("panend",y,{passive:!0}),window.addEventListener("pinchstart",y,{passive:!0}),window.addEventListener("pinch",y,{passive:!0}),window.addEventListener("pinchend",y,{passive:!0}),window.addEventListener("rotatestart",y,{passive:!0}),window.addEventListener("rotate",y,{passive:!0}),window.addEventListener("rotateend",y,{passive:!0}));const _={tap:"ontap",doubletap:"ondoubletap",longpress:"onlongpress",swipestart:"onswipestart",swipe:"onswipe",swipeend:"onswipeend",panstart:"onpanstart",pan:"onpan",panend:"onpanend",pinchstart:"onpinchstart",pinch:"onpinch",pinchend:"onpinchend",rotatestart:"onrotatestart",rotate:"onrotate",rotateend:"onrotateend"};TouchEvent&&(window.gestureProvider=new f),window.GLOBAL_EVENT_DISPATCHER||(window.GLOBAL_EVENT_DISPATCHER=y)},47:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.closest=e.Vec2=e.assert=void 0,e.assert=function(t,e){if(!t)throw new Error(e)};e.Vec2=class{constructor(t,e){this._x=0,this._y=0,this._clientX=0,this._clientY=0,this._clientX=t,this._clientY=e,this._x=this.translateX(t),this._y=this.translateY(e)}translateY(t){return-(t-window.innerHeight/2)}translateX(t){return t-window.innerWidth/2}get x(){return this._x}get y(){return this._y}get clientX(){return this._clientX}get clientY(){return this._clientY}set x(t){this._clientX=t,this._x=this.translateX(t)}set y(t){this._clientY=t,this._y=this.translateY(t)}add(t){return this._x+=t.x,this._y+=t.y,this._clientX+=t.clientX,this._clientY+=t.clientY,this}substract(t){return this._x-=t.x,this._y-=t.y,this._clientX-=t.clientX,this._clientY-=t.clientY,this}dot(t){return this._x*t.x+this._y*t.y}get magnitude(){return Math.sqrt(Math.pow(this._x,2)+Math.pow(this._y,2))}get clientMagnitude(){return Math.sqrt(Math.pow(this._clientX,2)+Math.pow(this._clientY,2))}},e.closest=function(t,e){return e.reduce(((e,n)=>{let i=Math.abs(e-t),s=Math.abs(n-t);return i===s?e>n?e:n:s<i?n:e}))}},810:e=>{e.exports=t}},n={};function i(t){var s=n[t];if(void 0!==s)return s.exports;var o=n[t]={exports:{}};return e[t].call(o.exports,o,o.exports,i),o.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var s={};(()=>{i.d(s,{ee:()=>z,r2:()=>h.r2,rN:()=>B,PM:()=>j,dw:()=>h.dw,y_:()=>d,DC:()=>r,GW:()=>g,sV:()=>e,RG:()=>T,GI:()=>W,rJ:()=>N,uZ:()=>h.uZ,PV:()=>h.PV,rL:()=>h.rL,Nu:()=>h.Nu,V_:()=>h.V_,hR:()=>h.hR,cT:()=>h.cT,e1:()=>h.e1,Ef:()=>L,Vo:()=>h.Vo,QN:()=>h.QN,kI:()=>h.kI,Po:()=>h.Po,fJ:()=>h.fJ,nc:()=>U,HJ:()=>M,JZ:()=>$,yj:()=>F});var t=i(810);class e{constructor(t,e){this._parentRouterData=null,this._childRouterData=null,this._dispatchEvent=null,this._addEventListener=null,this._removeEventListener=null,this._currentPath="",this._routesData=new Map,this._backNavigating=!1,this._gestureNavigating=!1,this._mountedScreen=null,this._animation=h.r2,this._ghostLayer=null,this.routerInstance=t,e&&(this.navigation=e)}destructor(){this.parentRouterData&&(this.parentRouterData.childRouterData=null)}prefetchRoute(t){return(0,h.kI)(t,this)}set parentRouterData(t){this._parentRouterData=t,this._parentRouterData&&(this._parentRouterData.childRouterData=this)}set childRouterData(t){var e;const n=null===(e=this._childRouterData)||void 0===e?void 0:e.deref();if(void 0!==n&&t&&t.routerId!==n.routerId)throw new Error("It looks like you have two navigators at the same level. Try simplifying your navigation structure by using a nested router instead.");this._childRouterData=t?new WeakRef(t):null}set dispatchEvent(t){this._dispatchEvent=t}set addEventListener(t){this._addEventListener=t}set removeEventListener(t){this._removeEventListener=t}set currentPath(t){this._currentPath=t}set routesData(t){this._routesData=t}set navigation(t){this._navigation=t}set animation(t){this._animation=t}set ghostLayer(t){this._ghostLayer=t}set backNavigating(t){this._backNavigating=t}set gestureNavigating(t){this._gestureNavigating=t}set paramsSerializer(t){this._paramsSerializer=t}set paramsDeserializer(t){this._paramsDeserializer=t}set mountedScreen(t){this._mountedScreen=t}get mountedScreen(){return this._mountedScreen}get routerId(){return this.routerInstance.id}get routes(){return this.routerInstance.props.children}get parentRouterData(){return this._parentRouterData}get childRouterData(){var t,e;return null!==(e=null===(t=this._childRouterData)||void 0===t?void 0:t.deref())&&void 0!==e?e:null}get dispatchEvent(){return this._dispatchEvent}get addEventListener(){return this._addEventListener}get removeEventListener(){return this._removeEventListener}get currentPath(){return this._currentPath}get routesData(){return this._routesData}get scrollRestorationData(){return e._scrollRestorationData}get navigation(){return this._navigation}get animation(){return this._animation}get ghostLayer(){return this._ghostLayer}get backNavigating(){return this._backNavigating}get gestureNavigating(){return this._gestureNavigating}get paramsSerializer(){return this._paramsSerializer}get paramsDeserializer(){return this._paramsDeserializer}}e._scrollRestorationData=new class{constructor(){this._map=new Map}set(t,e={x:0,y:0}){this._map.set(t,e)}get(t){return this._map.get(t)}};const n=(0,t.createContext)(null);class o{constructor(){this._map=new Map,this.mutationObserver=new MutationObserver(this.observeMutations.bind(this));const{head:t}=document;this.mutationObserver.observe(t,{childList:!0}),Array.from(t.querySelectorAll("meta")).forEach((t=>{this.mutationObserver.observe(t,{attributes:!0})})),Array.from(t.querySelectorAll("meta")).forEach(this.metaDataFromNode.bind(this))}get(t){const e=this.getMetaKey(t),n=this._map.get(e);if(!n)return;let i;return i=n.includes(",")&&n.includes("=")?n.split(/,\s*/).map((t=>t.split("="))):n,i}set(t,e){const n=this.getMetaKey(t),i=this.getMetaContent(e);this._map.set(n,i),this.updateMetaElement(n,i)}has(t){const e=this.getMetaKey(t);return this._map.has(e)}delete(t){var e;const n=this.getMetaKey(t);this._map.delete(n),null===(e=document.head.querySelector(`meta[${n}]`))||void 0===e||e.remove()}clear(){document.head.querySelectorAll("meta").forEach((t=>t.remove()))}entries(){return this._map.entries()}[Symbol.iterator](){return this.entries()}get size(){return this._map.size}observeMutations(t){for(const e of t){if("attributes"===e.type){const t=e.target;this.metaDataFromNode(t)}if("childList"!==e.type)return;e.removedNodes.forEach((t=>{if("META"===t.nodeName){const[e]=Array.from(t.attributes).filter((t=>"content"!==t.nodeName)),n=[e.nodeName,e.value].join("=");this._map.has(n)&&this._map.delete(n)}})),e.addedNodes.forEach((t=>{"META"===t.nodeName&&this.metaDataFromNode(t)}))}}metaDataFromNode(t){const[e]=Array.from(t.attributes).filter((t=>"content"!==t.nodeName)),[n]=Array.from(t.attributes).filter((t=>"content"===t.nodeName)),i=[e.nodeName,e.value].join("=");this._map.set(i,null==n?void 0:n.value)}getMetaKey(t){let e;return e="string"==typeof t?`name=${t}`:t.join("="),e}getMetaContent(t){if(!t)return;let e;return e="string"==typeof t?t:t.map((t=>t.join("="))).join(", "),e}updateMetaElement(t,e){const n=document.querySelector(`meta[${t}]`)||document.createElement("meta"),i=t.split("=");n.setAttribute(...i),e?n.setAttribute("content",e):n.removeAttribute("content"),n.parentElement||document.head.appendChild(n)}}class r{constructor(t,e,n=!1,i=null){var s;this._metaData=new o,this._currentParams={},this.popStateListener=t=>{var e;this._routerId,this.history.state.get("routerId");const n=null===(e=r.rootNavigatorRef)||void 0===e?void 0:e.deref(),i=(null==n?void 0:n.routerId)===this.routerId;(null===this.history.state.get("routerId")&&i||this.history.state.get("routerId")===this._routerId)&&this.onPopState(t)},this.routerData=e,this._disableBrowserRouting=n,this._routerId=t;const a=null===(s=r.rootNavigatorRef)||void 0===s?void 0:s.deref();a&&a.isInDocument||(r.rootNavigatorRef=new WeakRef(this)),window.addEventListener("popstate",this.popStateListener)}destructor(){var t;const e=null===(t=r.rootNavigatorRef)||void 0===t?void 0:t.deref();(null==e?void 0:e.routerId)===this.routerId&&(r.rootNavigatorRef=null),window.removeEventListener("popstate",this.popStateListener)}addEventListener(t,e,n){var i,s;null===(s=(i=this.routerData).addEventListener)||void 0===s||s.call(i,t,e,n)}removeEventListener(t,e,n){var i,s;return null===(s=(i=this.routerData).removeEventListener)||void 0===s?void 0:s.call(i,t,e,n)}get disableBrowserRouting(){return this._disableBrowserRouting}get routerId(){return this._routerId}canGoBack(){return this.history.canGoBack()}getNavigatorById(t,e){var n;const i=null!=e?e:null===(n=r.rootNavigatorRef)||void 0===n?void 0:n.deref();return i.routerId===t?i:i.routerData.childRouterData?void this.getNavigatorById(t,i.routerData.childRouterData.navigation):null}prefetchRoute(t){return this.routerData.prefetchRoute(t)}get dispatchEvent(){return this.routerData.dispatchEvent}get paramsDeserializer(){return this.routerData.paramsDeserializer}get paramsSerializer(){return this.routerData.paramsSerializer}get history(){return this._history}get metaData(){return this._metaData}get isInDocument(){return Boolean(document.getElementById(`${this.routerId}`))}}r.rootNavigatorRef=null;var a=i(322),h=i(174);class l{constructor(){this._play=!0,this._isPlaying=!1,this._isStarted=!1,this._currentScreen=null,this._nextScreen=null,this._progressUpdateID=0,this._pseudoElementInAnimation=null,this._pseudoElementOutAnimation=null,this._inAnimation=null,this._outAnimation=null,this._playbackRate=1,this._gestureNavigating=!1,this._backNavigating=!1,this._onEnd=null,this._onProgress=null,this._shouldAnimate=!0,this._dispatchEvent=null,this._addEventListener=null}updateProgress(){var t,e,n,i;if(this._gestureNavigating&&!this._play)return void window.cancelAnimationFrame(this._progressUpdateID);(()=>{this._onProgress&&this._onProgress(this.progress)})(),this._progressUpdateID=window.requestAnimationFrame(this.updateProgress.bind(this));const s=()=>{window.cancelAnimationFrame(this._progressUpdateID);const t=this._gestureNavigating?0:100;this.progress!==t&&this._onProgress&&this._onProgress(t)};Promise.all([null===(t=this._inAnimation)||void 0===t?void 0:t.finished,null===(e=this._outAnimation)||void 0===e?void 0:e.finished,null===(n=this._pseudoElementInAnimation)||void 0===n?void 0:n.finished,null===(i=this._pseudoElementOutAnimation)||void 0===i?void 0:i.finished]).then(s).catch(s)}reset(){this._onEnd=null,this._playbackRate=1,this._play=!0,this._gestureNavigating=!1}finish(){var t,e,n,i;null===(t=this._inAnimation)||void 0===t||t.finish(),null===(e=this._outAnimation)||void 0===e||e.finish(),null===(n=this._pseudoElementInAnimation)||void 0===n||n.finish(),null===(i=this._pseudoElementOutAnimation)||void 0===i||i.finish()}cancel(){var t,e,n,i,s;null===(t=this._inAnimation)||void 0===t||t.cancel(),null===(e=this._outAnimation)||void 0===e||e.cancel(),null===(n=this._pseudoElementInAnimation)||void 0===n||n.cancel(),null===(i=this._pseudoElementOutAnimation)||void 0===i||i.cancel(),this.reset();const o=new CustomEvent("page-animation-cancel",{bubbles:!0});null===(s=this.dispatchEvent)||void 0===s||s.call(this,o)}cleanUpAnimation(t){t&&(t.commitStyles(),t.cancel())}async animate(){var t,e,n,i,s,o,r,a,l,u;if(this._isPlaying&&(this.cancel(),this._onEnd&&this._onEnd(),this.reset()),this._currentScreen&&this._nextScreen&&this._shouldAnimate){if(this._gestureNavigating&&await this._currentScreen.mounted(!0),this._backNavigating?(this._currentScreen.zIndex=1,this._nextScreen.zIndex=0):(this._currentScreen.zIndex=0,this._nextScreen.zIndex=1),this._onProgress&&this._onProgress(this.progress),this._onExit&&this._shouldAnimate&&this._onExit(),await this._nextScreen.mounted(!0),this._outAnimation=this._currentScreen.animation,this._pseudoElementOutAnimation=this._currentScreen.pseudoElementAnimation,this._inAnimation=this._nextScreen.animation,this._pseudoElementInAnimation=this._nextScreen.pseudoElementAnimation,this._isPlaying=!0,this._inAnimation&&this._outAnimation){if(!this._shouldAnimate)return this.finish(),this._isPlaying=!1,void(this._shouldAnimate=!0);if(this._inAnimation.playbackRate=this._playbackRate,this._outAnimation.playbackRate=this._playbackRate,this._pseudoElementInAnimation&&(this._pseudoElementInAnimation.playbackRate=this._playbackRate),this._pseudoElementOutAnimation&&(this._pseudoElementOutAnimation.playbackRate=this._playbackRate),this._gestureNavigating){const t=(0,h.V_)(this._inAnimation,this.duration),e=(0,h.V_)(this._outAnimation,this.duration);if(this._inAnimation.currentTime=t,this._outAnimation.currentTime=e,this._pseudoElementInAnimation){const t=(0,h.V_)(this._pseudoElementInAnimation,this.duration);this._pseudoElementInAnimation.currentTime=t}if(this._pseudoElementOutAnimation){const t=(0,h.V_)(this._pseudoElementOutAnimation,this.duration);this._pseudoElementOutAnimation.currentTime=t}}await Promise.all([this._inAnimation.ready,this._outAnimation.ready,null===(t=this._pseudoElementInAnimation)||void 0===t?void 0:t.ready,null===(e=this._pseudoElementOutAnimation)||void 0===e?void 0:e.ready]),this._play?(this._outAnimation.play(),this._inAnimation.play(),null===(s=this._pseudoElementInAnimation)||void 0===s||s.play(),null===(o=this._pseudoElementOutAnimation)||void 0===o||o.play()):(this._inAnimation.pause(),this._outAnimation.pause(),null===(n=this._pseudoElementInAnimation)||void 0===n||n.pause(),null===(i=this._pseudoElementOutAnimation)||void 0===i||i.pause(),this._isPlaying=!1),this._isStarted=!0;const c=new CustomEvent("page-animation-start",{bubbles:!0});null===(r=this.dispatchEvent)||void 0===r||r.call(this,c),this.updateProgress(),await Promise.all([this._outAnimation.finished,this._inAnimation.finished,null===(a=this._pseudoElementInAnimation)||void 0===a?void 0:a.finished,null===(l=this._pseudoElementOutAnimation)||void 0===l?void 0:l.finished]),this.cleanUpAnimation(this._inAnimation),this.cleanUpAnimation(this._outAnimation),this._inAnimation=null,this._outAnimation=null,this._isPlaying=!1;const d=new CustomEvent("page-animation-end",{bubbles:!0});null===(u=this.dispatchEvent)||void 0===u||u.call(this,d),this._gestureNavigating&&.5!==this._playbackRate?(this._nextScreen.zIndex=0,this._currentScreen.zIndex=1,await this._nextScreen.mounted(!1)):(this._currentScreen.zIndex=0,this._nextScreen.zIndex=1,this._currentScreen.mounted(!1)),this._onEnd&&this._onEnd(),this._isStarted=!1}}else this._shouldAnimate=!0}set onProgress(t){this._onProgress=t}set onEnd(t){this._onEnd=t}set shouldAnimate(t){this._shouldAnimate=t}set playbackRate(t){this._playbackRate=t,this._inAnimation&&this._outAnimation&&(this._inAnimation.playbackRate=this._playbackRate,this._outAnimation.playbackRate=this._playbackRate),this._pseudoElementInAnimation&&(this._pseudoElementInAnimation.playbackRate=this._playbackRate),this._pseudoElementOutAnimation&&(this._pseudoElementOutAnimation.playbackRate=this._playbackRate)}set gestureNavigating(t){this._gestureNavigating=t}set backNavigating(t){this._backNavigating=t}set play(t){var e,n,i,s,o,r,a,h;this._play!==t&&(this._play=t,this._play&&this._gestureNavigating&&this.updateProgress(),t?(null===(e=this._inAnimation)||void 0===e||e.play(),null===(n=this._outAnimation)||void 0===n||n.play(),null===(i=this._pseudoElementInAnimation)||void 0===i||i.play(),null===(s=this._pseudoElementOutAnimation)||void 0===s||s.play()):(null===(o=this._inAnimation)||void 0===o||o.pause(),null===(r=this._outAnimation)||void 0===r||r.pause(),null===(a=this._pseudoElementInAnimation)||void 0===a||a.pause(),null===(h=this._pseudoElementOutAnimation)||void 0===h||h.pause()))}set progress(t){this._onProgress&&this._onProgress(t);{let e=(0,h.V_)(this._inAnimation,this.duration);const n=t/100*Number(e);let i=(0,h.V_)(this._outAnimation,this.duration);const s=t/100*Number(i);this._inAnimation&&this._outAnimation&&(this._inAnimation.currentTime=n,this._outAnimation.currentTime=s)}{let e=(0,h.V_)(this._pseudoElementInAnimation,this.duration);const n=t/100*Number(e);let i=(0,h.V_)(this._pseudoElementOutAnimation,this.duration);const s=t/100*Number(i);this._pseudoElementInAnimation&&(this._pseudoElementInAnimation.currentTime=n),this._pseudoElementOutAnimation&&(this._pseudoElementOutAnimation.currentTime=s)}}set currentScreen(t){this._currentScreen=t}set nextScreen(t){this._nextScreen=t,this._currentScreen||(t.mounted(!0,!1),this._nextScreen=null)}set onExit(t){this._onExit=t}set addEventListener(t){this._addEventListener=t}set dispatchEvent(t){this._dispatchEvent=t}get addEventListener(){return this._addEventListener}get dispatchEvent(){return this._dispatchEvent}get duration(){var t,e,n,i;const s=null===(t=this._currentScreen)||void 0===t?void 0:t.duration,o=null===(e=this._nextScreen)||void 0===e?void 0:e.duration,r=null===(n=this._currentScreen)||void 0===n?void 0:n.pseudoElementDuration,a=null===(i=this._nextScreen)||void 0===i?void 0:i.pseudoElementDuration;return Math.max(Number(s),Number(o),Number(r),Number(a))||0}get progress(){var t,e,n,i,s,o,r,a,h,l,u,c,d,p,m,v;const g=null===(e=null===(t=this._outAnimation)||void 0===t?void 0:t.effect)||void 0===e?void 0:e.getComputedTiming().duration,f=null===(i=null===(n=this._inAnimation)||void 0===n?void 0:n.effect)||void 0===i?void 0:i.getComputedTiming().duration,y=null===(o=null===(s=this._pseudoElementOutAnimation)||void 0===s?void 0:s.effect)||void 0===o?void 0:o.getComputedTiming().duration,_=null===(a=null===(r=this._pseudoElementInAnimation)||void 0===r?void 0:r.effect)||void 0===a?void 0:a.getComputedTiming().duration,E=[Number(g),Number(f),Number(_),Number(y)],w=Math.max(...E.filter((t=>!isNaN(t))));let b;return w===Number(g)?b=null===(l=null===(h=this._outAnimation)||void 0===h?void 0:h.effect)||void 0===l?void 0:l.getComputedTiming().progress:w===Number(f)?b=null===(c=null===(u=this._inAnimation)||void 0===u?void 0:u.effect)||void 0===c?void 0:c.getComputedTiming().progress:w===Number(_)?b=null===(p=null===(d=this._pseudoElementInAnimation)||void 0===d?void 0:d.effect)||void 0===p?void 0:p.getComputedTiming().progress:w===Number(y)&&(b=null===(v=null===(m=this._pseudoElementOutAnimation)||void 0===m?void 0:m.effect)||void 0===v?void 0:v.getComputedTiming().progress),100*(Number(b)||0)}get gestureNavigating(){return this._gestureNavigating}get backNavigating(){return this._backNavigating}get isPlaying(){return this._isPlaying}get ready(){return new Promise((async(t,e)=>{var n,i,s,o;try{await Promise.all([null===(n=this._outAnimation)||void 0===n?void 0:n.ready,null===(i=this._inAnimation)||void 0===i?void 0:i.ready,null===(s=this._pseudoElementInAnimation)||void 0===s?void 0:s.ready,null===(o=this._pseudoElementOutAnimation)||void 0===o?void 0:o.ready]),t()}catch(t){e(t)}}))}get finished(){return new Promise((async(t,e)=>{var n,i,s,o;try{await this.started,await Promise.all([null===(n=this._outAnimation)||void 0===n?void 0:n.finished,null===(i=this._inAnimation)||void 0===i?void 0:i.finished,null===(s=this._pseudoElementInAnimation)||void 0===s?void 0:s.finished,null===(o=this._pseudoElementOutAnimation)||void 0===o?void 0:o.finished]),t()}catch(t){e(t)}}))}get started(){return this._isStarted?Promise.resolve():new Promise((async t=>{var e;null===(e=this.addEventListener)||void 0===e||e.call(this,"page-animation-start",(()=>{t()}),{once:!0})}))}}const u=(0,t.createContext)(new l);var c=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const d=(0,t.createContext)(0);function p(e,n,i,s){const{paths:o}=n;let r,a,l,u,c,d=!1,p=!1,m=null;n.paths.length&&(!(0,h.e1)(s,o)&&n.paths.includes(void 0)&&(s=void 0),null!==i&&!(0,h.e1)(i,o)&&n.paths.includes(void 0)&&(i=void 0));const v=[];let g;if(t.Children.forEach(n.children,(o=>{var r,a,l;if(null===i)return;if(!(0,t.isValidElement)(o))return;let u;if((0,h.QN)(o.props.resolvedPathname,s)&&(e.backNavigating||n.gestureNavigating)&&(null===(r=o.props.config)||void 0===r?void 0:r.keepAlive)&&(g=o.key||void 0),e.children===n.children?(null===(a=o.props.config)||void 0===a?void 0:a.keepAlive)&&(u=(0,h.QN)(o.props.path,i)):u=(0,h.QN)(o.props.resolvedPathname,i),u&&!p){let e={out:!0,in:!1};n.gestureNavigating&&(e={in:!0,out:!1}),p=!0,v.push((0,t.cloneElement)(o,Object.assign(Object.assign({},e),{resolvedPathname:u.matchedPathname,key:null!==(l=o.key)&&void 0!==l?l:Math.random()})))}})),t.Children.forEach(e.children,(e=>{if(!(0,t.isValidElement)(e))return;n.paths.length||o.push(e.props.path);const i=(0,h.QN)(e.props.path,s);if(i&&!d){d=!0;const{config:s}=e.props;r=null==s?void 0:s.swipeDirection,a=null==s?void 0:s.swipeAreaWidth,u=null==s?void 0:s.hysteresis,c=null==s?void 0:s.disableDiscovery,l=null==s?void 0:s.minFlingVelocity,m=e.props.name||null;let o={in:!0,out:!1};n.gestureNavigating&&(o={out:!0,in:!1});const h=g||Math.random();v.push((0,t.cloneElement)(e,Object.assign(Object.assign({},o),{resolvedPathname:i.matchedPathname,key:h})))}})),!t.Children.count(v)){return{children:t.Children.map(e.children,(e=>{var n;if((0,t.isValidElement)(e)&&(0,h.QN)(e.props.path,void 0)){const{config:i}=e.props;return r=null==i?void 0:i.swipeDirection,a=null==i?void 0:i.swipeAreaWidth,u=null==i?void 0:i.hysteresis,c=null==i?void 0:i.disableDiscovery,l=null==i?void 0:i.minFlingVelocity,m=null!==(n=e.props.name)&&void 0!==n?n:null,(0,t.cloneElement)(e,{in:!0,out:!1})}})),name:m,swipeDirection:r||e.swipeDirection,swipeAreaWidth:a||e.swipeAreaWidth,hysteresis:u||e.hysteresis,disableDiscovery:void 0===c?e.disableDiscovery:c,minFlingVelocity:l||e.minFlingVelocity}}return{paths:o,children:v,name:m,currentPath:e.currentPath,swipeDirection:r||e.swipeDirection,swipeAreaWidth:a||e.swipeAreaWidth,hysteresis:u||e.hysteresis,disableDiscovery:void 0===c?e.disableDiscovery:c,minFlingVelocity:l||e.minFlingVelocity}}class m extends t.Component{constructor(){super(...arguments),this.onSwipeStartListener=this.onSwipeStart.bind(this),this.onSwipeListener=this.onSwipe.bind(this),this.onSwipeEndListener=this.onSwipeEnd.bind(this),this.ref=null,this.state={currentPath:this.props.lastPath,children:this.props.children,progress:100,shouldPlay:!0,gestureNavigating:!1,shouldAnimate:!0,startX:0,startY:0,paths:[],swipeDirection:this.props.swipeDirection,swipeAreaWidth:this.props.swipeAreaWidth,minFlingVelocity:this.props.minFlingVelocity,hysteresis:this.props.hysteresis,disableDiscovery:!1},this.setRef=t=>{this.ref&&this.ref.removeEventListener("swipestart",this.onSwipeStartListener),this.ref=t,t&&t.addEventListener("swipestart",this.onSwipeStartListener)}}static getDerivedStateFromProps(t,e){if(t.currentPath!==e.currentPath){if(!e.shouldAnimate)return{currentPath:t.currentPath,shouldAnimate:!0};let n=t.currentPath;const i=p(t,e,e.currentPath,t.currentPath),{name:s}=i,o=c(i,["name"]);return o.children.sort(((t,e)=>(0,h.QN)(t.props.path,n)?1:-1)),t.onDocumentTitleChange(s),o}return null}componentDidMount(){this.context.onProgress=t=>{const e=this.props.backNavigating&&!this.state.gestureNavigating?99-t:t,n=(0,h.uZ)(e,0,100);this.setState({progress:n});const i=new CustomEvent("motion-progress",{detail:{progress:n}});this.props.dispatchEvent&&this.props.dispatchEvent(i)}}componentDidUpdate(t,e){t.currentPath!==this.state.currentPath&&(this.context.backNavigating=this.props.backNavigating,!this.state.gestureNavigating&&e.shouldAnimate&&(this.context.play=!0,this.context.animate()))}onGestureSuccess(t,e){this.props.onDocumentTitleChange(e),this.setState(t)}onSwipeStart(t){if(t.touches.length>1)return;if(this.state.disableDiscovery)return;if(this.context.isPlaying)return;if(0===this.context.duration)return;let e;switch(this.state.swipeDirection){case"left":case"right":e=t.x;break;case"up":case"down":e=t.y}if(t.direction===this.state.swipeDirection&&e<this.state.swipeAreaWidth){if(!this.props.lastPath)return;t.stopPropagation();for(let e of t.composedPath().reverse())if("classList"in e&&e.classList.length){if(e.classList.contains("gesture-region")&&"true"===e.dataset.disabled)return;if(e===t.gestureTarget)break}const e=p(this.props,Object.assign(Object.assign({},this.state),{gestureNavigating:!0}),this.props.currentPath,this.props.lastPath),{children:n,currentPath:i,paths:s,name:o}=e,r=c(e,["children","currentPath","paths","name"]);this.onGestureSuccess=this.onGestureSuccess.bind(this,r,o),this.props.navigation.addEventListener("go-back",this.onGestureSuccess,{once:!0}),this.props.onGestureNavigationStart(),this.setState({shouldPlay:!1,gestureNavigating:!0,children:n.sort((t=>(0,h.QN)(t.props.path,i)?-1:1)),startX:t.x,startY:t.y},(()=>{var t,e;const n=new CustomEvent("motion-progress-start");this.context.gestureNavigating=!0,this.context.playbackRate=-1,this.context.play=!1,this.context.backNavigating=this.props.backNavigating,this.context.animate(),this.props.dispatchEvent&&this.props.dispatchEvent(n),null===(t=this.ref)||void 0===t||t.addEventListener("swipe",this.onSwipeListener),null===(e=this.ref)||void 0===e||e.addEventListener("swipeend",this.onSwipeEndListener)}))}}onSwipe(t){if(this.state.shouldPlay)return;let e;switch(this.state.swipeDirection){case"left":case"right":{const n=window.innerWidth;e=-((0,h.uZ)(t.x-this.state.startX,10)-n)/n*100,"left"===this.state.swipeDirection&&(e=100-e);break}case"up":case"down":{const n=window.innerHeight;e=-((0,h.uZ)(t.y-this.state.startY,10)-n)/n*100,"up"===this.state.swipeDirection&&(e=100-e);break}}this.context.progress=(0,h.uZ)(e,.1,100)}onSwipeEnd(t){var e,n;if(this.state.shouldPlay)return;let i=null;const s=new CustomEvent("motion-progress-end");100-this.state.progress>this.state.hysteresis||t.velocity>this.state.minFlingVelocity?(t.velocity>=this.state.minFlingVelocity?this.context.playbackRate=-5:this.context.playbackRate=-1,i=()=>{this.context.reset(),this.props.onGestureNavigationEnd(),this.setState({gestureNavigating:!1}),this.props.dispatchEvent&&this.props.dispatchEvent(s)},this.setState({shouldPlay:!0,shouldAnimate:!1})):(this.context.playbackRate=.5,i=()=>{this.props.navigation.removeEventListener("go-back",this.onGestureSuccess),this.context.reset(),this.props.dispatchEvent&&this.props.dispatchEvent(s)},this.setState({shouldPlay:!0,gestureNavigating:!1})),this.setState({startX:0,startY:0}),this.context.onEnd=i,this.context.play=!0,null===(e=this.ref)||void 0===e||e.removeEventListener("swipe",this.onSwipeListener),null===(n=this.ref)||void 0===n||n.removeEventListener("swipeend",this.onSwipeEndListener)}render(){return(0,a.jsx)("div",Object.assign({className:"animation-layer",ref:this.setRef,style:{width:"100%",height:"100%",display:"grid",[`--${this.props.navigation.routerId}-motion-progress`]:this.state.progress}},{children:(0,a.jsx)(d.Provider,Object.assign({value:this.state.progress},{children:this.state.children}))}))}}m.contextType=u;class v extends t.Component{constructor(){super(...arguments),this.ref=null,this._currentScene=null,this._nextScene=null,this.onProgressStartListener=this.onProgressStart.bind(this),this.onProgressListener=this.onProgress.bind(this),this.onProgressEndListener=this.onProgressEnd.bind(this),this.state={transitioning:!1,playing:!0}}set currentScene(t){this._currentScene=t}set nextScene(t){this._nextScene=t,!this._currentScene||this._currentScene.isEmpty()||this._nextScene.isEmpty()?(this._currentScene=null,this._nextScene=null):this.sharedElementTransition(this._currentScene,this._nextScene)}finish(){var t;const e=(null===(t=this.ref)||void 0===t?void 0:t.getAnimations({subtree:!0}))||[];for(const t of e)t.finish()}sharedElementTransition(t,e){if(0===this.context.duration)return;if(this.state.transitioning)return void this.finish();const n=()=>{this.setState({transitioning:!1}),this._nextScene=null,this._currentScene=null},i=()=>{var t;const e=(null===(t=this.ref)||void 0===t?void 0:t.getAnimations({subtree:!0}))||[];for(const t of e)t.cancel();n()},s=queueMicrotask.bind(null,(async()=>{var s,o,r,a,l,u,c,d,p,m,v,g,f,y,_,E,w,b,x,S,P,A,L,R,D,k,O,N,I,T,C,j,$,M,U,F,V,z,Y,X,B,H,W,G,K,q,J;null===(s=this.ref)||void 0===s||s.showModal();for(const[n,i]of t.nodes)if(e.nodes.has(n)){const s=e.nodes.get(n).instance,Q=i.instance,Z=s.transitionType||Q.transitionType||"morph",tt=i.instance.node,et=e.nodes.get(n).instance.node;if(!tt||!et)continue;const nt=tt.firstElementChild,it=et.firstElementChild;if(!nt||!it)continue;const st=Q.clientRect,ot=s.clientRect;let rt,at,ht={},lt={};"morph"===Z&&([rt,ht]=Q.CSSData,[at,lt]=s.CSSData),rt=Q.CSSText,at=s.CSSText,nt.style.cssText=rt,"morph"!==Z&&(it.style.cssText=at,et.style.position="absolute",it.style.position="absolute",et.style.zIndex=it.style.zIndex,et.style.top="0",et.style.left="0"),tt.style.position="absolute",nt.style.position="absolute",tt.style.zIndex=nt.style.zIndex,tt.style.top="0",tt.style.left="0";const ut={id:Q.id,start:{x:{node:tt,delay:null!==(u=null!==(a=null===(r=null===(o=Q.props.config)||void 0===o?void 0:o.x)||void 0===r?void 0:r.delay)&&void 0!==a?a:null===(l=s.props.config)||void 0===l?void 0:l.delay)&&void 0!==u?u:0,duration:(null===(d=null===(c=Q.props.config)||void 0===c?void 0:c.x)||void 0===d?void 0:d.duration)||(null===(p=s.props.config)||void 0===p?void 0:p.duration)||this.context.duration,easingFunction:(null===(v=null===(m=Q.props.config)||void 0===m?void 0:m.x)||void 0===v?void 0:v.easingFunction)||(null===(g=Q.props.config)||void 0===g?void 0:g.easingFunction)||"ease",position:st.x},y:{node:nt,delay:null!==(w=null!==(_=null===(y=null===(f=Q.props.config)||void 0===f?void 0:f.y)||void 0===y?void 0:y.delay)&&void 0!==_?_:null===(E=s.props.config)||void 0===E?void 0:E.delay)&&void 0!==w?w:0,duration:(null===(x=null===(b=Q.props.config)||void 0===b?void 0:b.y)||void 0===x?void 0:x.duration)||(null===(S=s.props.config)||void 0===S?void 0:S.duration)||this.context.duration,easingFunction:(null===(A=null===(P=Q.props.config)||void 0===P?void 0:P.y)||void 0===A?void 0:A.easingFunction)||(null===(L=Q.props.config)||void 0===L?void 0:L.easingFunction)||"ease",position:st.y}},end:{x:{node:et,delay:null!==(N=null!==(k=null===(D=null===(R=s.props.config)||void 0===R?void 0:R.x)||void 0===D?void 0:D.delay)&&void 0!==k?k:null===(O=s.props.config)||void 0===O?void 0:O.delay)&&void 0!==N?N:0,duration:(null===(T=null===(I=s.props.config)||void 0===I?void 0:I.x)||void 0===T?void 0:T.duration)||(null===(C=s.props.config)||void 0===C?void 0:C.duration)||this.context.duration,easingFunction:(null===($=null===(j=s.props.config)||void 0===j?void 0:j.x)||void 0===$?void 0:$.easingFunction)||(null===(M=s.props.config)||void 0===M?void 0:M.easingFunction)||"ease",position:ot.x},y:{node:it,delay:null!==(Y=null!==(V=null===(F=null===(U=s.props.config)||void 0===U?void 0:U.y)||void 0===F?void 0:F.delay)&&void 0!==V?V:null===(z=s.props.config)||void 0===z?void 0:z.delay)&&void 0!==Y?Y:0,duration:(null===(B=null===(X=s.props.config)||void 0===X?void 0:X.y)||void 0===B?void 0:B.duration)||(null===(H=s.props.config)||void 0===H?void 0:H.duration)||this.context.duration,easingFunction:(null===(G=null===(W=s.props.config)||void 0===W?void 0:W.x)||void 0===G?void 0:G.easingFunction)||(null===(K=s.props.config)||void 0===K?void 0:K.easingFunction)||"ease",position:ot.y}}};if(tt.style.display="unset",null===(q=this.ref)||void 0===q||q.appendChild(tt),Q.onCloneAppended(tt),"morph"!==Z){const t=parseInt(tt.style.zIndex)||0,e=parseInt(et.style.zIndex)||0;et.style.zIndex=`${(0,h.uZ)(e,0,t-1)}`,et.style.display="unset",null===(J=this.ref)||void 0===J||J.appendChild(et),s.onCloneAppended(et)}else s.onCloneAppended(tt);let ct,dt,pt,mt;Q.hidden(!0),s.hidden(!0),tt.style.willChange="contents, transform, opacity","morph"!==Z&&(et.style.willChange="contents, transform, opacity"),"morph"===Z?(ct=ut.start.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`},{transform:`translate(${ut.end.x.position}px, 0px)`}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-start`}),dt=ut.start.y.node.animate([Object.assign(Object.assign({},ht),{transform:`translate(0px, ${ut.start.y.position}px)`}),Object.assign(Object.assign({},lt),{transform:`translate(0px, ${ut.end.y.position}px)`})],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-start`})):"fade"===Z?(ct=ut.start.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`,opacity:1},{transform:`translate(${ut.end.x.position}px, 0px)`,opacity:0}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-start`}),dt=ut.start.y.node.animate([{transform:`translate(0px, ${ut.start.y.position}px)`},{transform:`translate(0px, ${ut.end.y.position}px)`}],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-start`}),pt=ut.end.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`},{transform:`translate(${ut.end.x.position}px, 0px)`}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-end`}),mt=ut.end.y.node.animate([{transform:`translate(0px, ${ut.start.y.position}px)`},{transform:`translate(0px, ${ut.end.y.position}px)`}],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-end`})):"fade-through"===Z?(ct=ut.start.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`,opacity:1},{opacity:0,offset:.5},{transform:`translate(${ut.end.x.position}px, 0px)`,opacity:0}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-start`}),dt=ut.start.y.node.animate([{transform:`translate(0px, ${ut.start.y.position}px)`},{transform:`translate(0px, ${ut.end.y.position}px)`}],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-start`}),pt=ut.end.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`,opacity:0},{opacity:0,offset:.5},{transform:`translate(${ut.end.x.position}px, 0px)`,opacity:1}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-end`}),mt=ut.end.y.node.animate([{transform:`translate(0px, ${ut.start.y.position}px)`},{transform:`translate(0px, ${ut.end.y.position}px)`}],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-end`})):(ct=ut.start.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`,opacity:1},{transform:`translate(${ut.end.x.position}px, 0px)`,opacity:0}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-start`}),dt=ut.start.y.node.animate([{transform:`translate(0px, ${ut.start.y.position}px)`},{transform:`translate(0px, ${ut.end.y.position}px)`}],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-start`}),pt=ut.end.x.node.animate([{transform:`translate(${ut.start.x.position}px, 0px)`,opacity:0},{transform:`translate(${ut.end.x.position}px, 0px)`,opacity:1}],{fill:"both",easing:ut.end.x.easingFunction,duration:ut.end.x.duration,delay:ut.end.x.delay,id:`${n}-x-end`}),mt=ut.end.y.node.animate([{transform:`translate(0px, ${ut.start.y.position}px)`},{transform:`translate(0px, ${ut.end.y.position}px)`}],{fill:"both",easing:ut.end.y.easingFunction,duration:ut.end.y.duration,delay:ut.end.y.delay,id:`${n}-y-end`}));const vt=[ct,dt,pt,mt];this.state.playing||vt.forEach((t=>{var e;if(!t)return;const n=this.context.duration;let i=null===(e=t.effect)||void 0===e?void 0:e.getComputedTiming().duration;"string"==typeof i&&(i=parseFloat(i)),i=i||n,t.currentTime=i,t.pause()}));const gt=async()=>{console.assert(n===s.id,"Not sure what happened here."),console.assert(n===Q.id,"Not sure what happened here."),tt.style.willChange="auto","morph"!==Z&&(et.style.willChange="auto"),await s.hidden(!1),t.keepAlive&&this.state.playing?Q.keepAlive(!0):(Q.keepAlive(!1),await Q.hidden(!1)),this.state.playing&&(Q.onCloneRemove(tt),"morph"!==Z?(s.onCloneRemove(et),et.remove()):s.onCloneRemove(tt),tt.remove())},ft=async()=>{tt.style.willChange="auto","morph"!==Z&&(et.style.willChange="auto"),await Q.hidden(!1),await s.hidden(!1)};Promise.all(vt.map((t=>null==t?void 0:t.finished))).then(gt).catch(ft)}this.ref&&Promise.all(this.ref.getAnimations({subtree:!0}).map((t=>t.finished))).then(n).catch(i)}));this.setState({transitioning:!0},s),this.props.navigation.addEventListener("page-animation-cancel",i,{once:!0})}componentDidMount(){this.props.instance&&this.props.instance(this),this.props.navigation.addEventListener("motion-progress-start",this.onProgressStartListener,{capture:!0}),this.props.navigation.addEventListener("motion-progress",this.onProgressListener,{capture:!0}),this.props.navigation.addEventListener("motion-progress-end",this.onProgressEndListener,{capture:!0})}componentWillUnmount(){this.props.navigation.removeEventListener("motion-progress-start",this.onProgressStartListener,{capture:!0}),this.props.navigation.removeEventListener("motion-progress",this.onProgressListener,{capture:!0}),this.props.navigation.removeEventListener("motion-progress-end",this.onProgressEndListener,{capture:!0})}onProgressStart(){this.setState({playing:!1})}onProgress(t){var e,n;if(!this.state.playing){const i=(null===(e=this.ref)||void 0===e?void 0:e.getAnimations({subtree:!0}))||[];for(const e of i){const i=t.detail.progress,s=this.context.duration;let o=null===(n=e.effect)||void 0===n?void 0:n.getComputedTiming().duration;"string"==typeof o&&(o=parseFloat(o)),o=o||s;const r=i/100*Number(o);e.currentTime=r}}}onProgressEnd(){this.state.playing||this.finish(),this.setState({playing:!0,transitioning:!1})}render(){return this.state.transitioning?(0,a.jsx)("dialog",Object.assign({id:"ghost-layer",ref:t=>this.ref=t,style:{position:"absolute",zIndex:h.dw,maxWidth:"unset",maxHeight:"unset",width:"100vw",height:"100vh",contain:"strict",padding:0,border:"none",backgroundColor:"transparent"}},{children:(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:"#ghost-layer::backdrop {display: none}"}})})):(0,a.jsx)(a.Fragment,{})}}v.contextType=u;class g extends t.Component{constructor(t){var e;super(t),this.animationLayerData=new l,this.ref=null,this.dispatchEvent=null,this.addEventListener=null,this.removeEventListener=null,this.state={currentPath:"",backNavigating:!1,gestureNavigating:!1,routesData:new Map,implicitBack:!1,defaultDocumentTitle:document.title},this.onDocumentTitleChange=t=>{document.title=t||this.state.defaultDocumentTitle},this.setRef=t=>{this.ref&&(this.dispatchEvent=null,this.addEventListener=null,this.removeEventListener=null,this.animationLayerData.dispatchEvent=this.dispatchEvent,this._routerData.dispatchEvent=this.dispatchEvent,this._routerData.addEventListener=this.addEventListener,this._routerData.removeEventListener=this.removeEventListener,this.removeNavigationEventListeners(this.ref)),t&&(this.dispatchEvent=e=>(0,h.Nu)(e,t),this.addEventListener=(e,n,i)=>t.addEventListener(e,n,i),this.removeEventListener=(e,n,i)=>t.removeEventListener(e,n,i),this.animationLayerData.dispatchEvent=this.dispatchEvent,this.animationLayerData.addEventListener=this.addEventListener,this._routerData.dispatchEvent=this.dispatchEvent,this._routerData.addEventListener=this.addEventListener,this._routerData.removeEventListener=this.removeEventListener,this.addNavigationEventListeners(t))},this._id=null!==(e=t.id)&&void 0!==e?e:Math.random().toString().replace(".","-"),t.config?this.config=t.config:this.config={animation:h.r2}}componentDidMount(){this._routerData.paramsDeserializer=this.props.config.paramsDeserializer,this._routerData.paramsSerializer=this.props.config.paramsSerializer,this.onPopStateListener=this.onPopStateListener.bind(this),window.addEventListener("popstate",this.onPopStateListener)}componentWillUnmount(){this.navigation.destructor(),this._routerData.destructor(),this.ref&&this.removeNavigationEventListeners(this.ref),window.removeEventListener("popstate",this.onPopStateListener)}initialise(t){let e=t.location.pathname;const n=this._routerData.paramsDeserializer||null,i=(0,h.fJ)(window.location.search,n),s=this.state.routesData;this._routerData.routesData=this.state.routesData,i&&s.set(e,Object.assign(Object.assign({},this.state.routesData.get(e)),{params:i})),this.setState({currentPath:e,routesData:s}),this._routerData.currentPath=e}get id(){return this._id}get parentRouterData(){return this._routerData.parentRouterData}get baseURL(){var t;const e=window.location.origin,n=this.props.config.basePathname||"";if(this.parentRouterData){const e=this.parentRouterData.navigation.history.baseURL,i=(null===(t=this.parentRouterData.mountedScreen)||void 0===t?void 0:t.resolvedPathname)||"";return(0,h.PV)(n,(0,h.PV)(i,e))}return new URL(n,e)}onPopStateListener(t){let e=this.navigation.location.pathname;const n=this._routerData.paramsDeserializer||null,i=(0,h.fJ)(window.location.search,n),s=this.state.routesData;this._routerData.routesData=this.state.routesData,i&&s.set(e,Object.assign(Object.assign({},this.state.routesData.get(e)),{params:i})),this.setState({routesData:s})}addNavigationEventListeners(t){t.addEventListener("go-back",this.onBackListener),t.addEventListener("navigate",this.onNavigateListener)}removeNavigationEventListeners(t){t.removeEventListener("go-back",this.onBackListener),t.removeEventListener("navigate",this.onNavigateListener)}render(){return(0,a.jsx)("div",Object.assign({id:this._id.toString(),className:"react-motion-router",style:{width:"100%",height:"100%"},ref:this.setRef},{children:(0,a.jsx)(n.Consumer,{children:t=>(this._routerData.parentRouterData=t,(0,a.jsx)(n.Provider,Object.assign({value:this._routerData},{children:(0,a.jsxs)(u.Provider,Object.assign({value:this.animationLayerData},{children:[Boolean(this.navigation)&&(0,a.jsx)(v,{instance:t=>{this._routerData.ghostLayer=t},backNavigating:this.state.backNavigating,gestureNavigating:this.state.gestureNavigating,navigation:this._routerData.navigation,animationLayerData:this.animationLayerData}),Boolean(this.navigation)&&(0,a.jsx)(m,Object.assign({disableBrowserRouting:this.props.config.disableBrowserRouting||!1,disableDiscovery:this.props.config.disableDiscovery||!1,hysteresis:this.props.config.hysteresis||50,minFlingVelocity:this.props.config.minFlingVelocity||400,swipeAreaWidth:this.props.config.swipeAreaWidth||100,swipeDirection:this.props.config.swipeDirection||"right",navigation:this._routerData.navigation,backNavigating:this.state.backNavigating,currentPath:this.navigation.history.current,lastPath:this.navigation.history.previous,onGestureNavigationStart:this.onGestureNavigationStart,onGestureNavigationEnd:this.onGestureNavigationEnd,onDocumentTitleChange:this.onDocumentTitleChange,dispatchEvent:this.dispatchEvent},{children:this.props.children}))]}))})))})}))}}g.defaultProps={config:{animation:h.r2}};const f={"slide-right-in":[{transform:"translateX(100vw)"},{transform:"translateX(0vw)"}],"slide-back-right-in":[{transform:"translateX(50vw)"},{transform:"translateX(0vw)"}],"slide-right-out":[{transform:"translateX(0vw)"},{transform:"translateX(-50vw)"}],"slide-back-right-out":[{transform:"translateX(0vw)"},{transform:"translateX(-100vw)"}],"slide-left-in":[{transform:"translateX(-100vw)"},{transform:"translateX(0vw)"}],"slide-back-left-in":[{transform:"translateX(-50vw)"},{transform:"translateX(0vw)"}],"slide-left-out":[{transform:"translateX(0vw)"},{transform:"translateX(50vw)"}],"slide-back-left-out":[{transform:"translateX(0vw)"},{transform:"translateX(100vw)"}],"slide-up-in":[{transform:"translateY(100vh)"},{transform:"translateY(0vh)"}],"slide-back-up-in":[{transform:"translateY(50vh)"},{transform:"translateY(0vh)"}],"slide-up-out":[{transform:"translateY(0vh)"},{transform:"translateY(-50vh)"}],"slide-back-up-out":[{transform:"translateY(0vh)"},{transform:"translateY(-100vh)"}],"slide-down-in":[{transform:"translateY(-100vh)"},{transform:"translateY(0vh)"}],"slide-back-down-in":[{transform:"translateY(-50vh)"},{transform:"translateY(0vh)"}],"slide-down-out":[{transform:"translateY(0vh)"},{transform:"translateY(50vh)"}],"slide-back-down-out":[{transform:"translateY(0vh)"},{transform:"translateY(100vh)"}],"zoom-in-in":[{transform:"scale(0.85)",opacity:0},{transform:"scale(1)",opacity:1}],"zoom-in-out":[{transform:"scale(1)",opacity:1},{transform:"scale(1.15)",opacity:0}],"zoom-out-in":[{transform:"scale(1.15)",opacity:0},{transform:"scale(1)",opacity:1}],"zoom-out-out":[{transform:"scale(1)",opacity:1},{transform:"scale(0.85)",opacity:0}],"fade-in":[{opacity:0},{opacity:1}],"fade-out":[{opacity:1},{opacity:0}],none:[]},y={left:"right",right:"left",up:"down",down:"up",in:"out",out:"in"};class _ extends t.Component{constructor(){super(...arguments),this._animationLayerData=null,this.ref=null,this.onAnimationEnd=this.animationEnd.bind(this),this.onNavigate=this.navigate.bind(this),this.setRef=this.onRef.bind(this),this.state={mounted:this.props.out&&this.props.keepAlive,zIndex:this.props.in?1:0}}onRef(t){this.ref=t,this.props.onRef(t)}animationEnd(){this.ref&&(this.ref.style.willChange="auto",this.ref.style.pointerEvents="auto"),this.props.in&&this.props.onEntered()}navigate(){this.ref&&(this.ref.style.willChange="transform, opacity",this.ref.style.pointerEvents="none")}componentDidMount(){this.props.navigation.addEventListener("page-animation-start",this.onNavigate),this.props.navigation.addEventListener("motion-progress-start",this.onNavigate),this.props.navigation.addEventListener("page-animation-end",this.onAnimationEnd),this.props.navigation.addEventListener("motion-progress-end",this.onAnimationEnd),this.state.mounted&&(this.props.onEnter(),this.props.onEntered()),this._animationLayerData&&(this.props.in&&(this._animationLayerData.nextScreen=this),this.props.out&&!this.state.mounted&&(this._animationLayerData.onExit=this.props.onExit,this._animationLayerData.currentScreen=this))}componentDidUpdate(t){this._animationLayerData&&(this.props.out===t.out&&this.props.in===t.in||(this.props.out?(this._animationLayerData.onExit=this.props.onExit,this._animationLayerData.currentScreen=this):this.props.in&&(this._animationLayerData.nextScreen=this)))}componentWillUnmount(){this.props.navigation.removeEventListener("page-animation-start",this.onNavigate),this.props.navigation.removeEventListener("motion-progress-start",this.onNavigate),this.props.navigation.removeEventListener("page-animation-end",this.onAnimationEnd),this.props.navigation.removeEventListener("motion-progress-end",this.onAnimationEnd)}getAnimationConfig(t,e){"function"==typeof e&&(e=e());const n=e[t];if(!("type"in n))return n;{let e=n.direction,i="";switch(this.props.backNavigating&&e&&("zoom"!==n.type&&"slide"!==n.type||(e=y[e],i="back-")),n.type){case"slide":return"in"!==e&&"out"!==e||(e="left"),[`slide-${i}${e||"left"}-${t}`,n.duration,n.easingFunction];case"zoom":return"in"!==e&&"out"!==e&&(e="in"),[`zoom-${e||"in"}-${t}`,n.duration,n.easingFunction];case"fade":return[`fade-${t}`,n.duration,n.easingFunction];default:return["none",n.duration,void 0]}}}get pseudoElementInAnimation(){return this.props.pseudoElement?this.getAnimationConfig("in",this.props.pseudoElement.animation):null}get pseudoElementOutAnimation(){return this.props.pseudoElement?this.getAnimationConfig("out",this.props.pseudoElement.animation):null}get inAnimation(){return this.getAnimationConfig("in",this.props.animation)}get outAnimation(){return this.getAnimationConfig("out",this.props.animation)}get pseudoElementDuration(){var t;const e=this.props.in?this.pseudoElementInAnimation:this.pseudoElementOutAnimation;if(!e)return null;if(Array.isArray(e)){const[t,n]=e;return n}return"number"==typeof e.options?e.options:null===(t=e.options)||void 0===t?void 0:t.duration}get duration(){var t;const e=this.props.in?this.inAnimation:this.outAnimation;if(Array.isArray(e)){const[t,n]=e;return n}return"number"==typeof e.options?e.options:null===(t=e.options)||void 0===t?void 0:t.duration}get pseudoElementAnimation(){var t,e,n;if(!this.ref||!this.props.pseudoElement)return null;const i=this.props.pseudoElement.selector;let s=(null===(t=this._animationLayerData)||void 0===t?void 0:t.gestureNavigating)?"linear":"ease-out";if(this.props.in){if(Array.isArray(this.pseudoElementInAnimation)){const[t,e,n]=this.pseudoElementInAnimation;return new Animation(new KeyframeEffect(this.ref,f[t],{fill:"both",duration:e,easing:n||s,pseudoElement:i}))}{let{keyframes:t,options:n}=this.pseudoElementInAnimation;return n="number"==typeof n?{duration:n,easing:s,fill:"both",pseudoElement:i}:Object.assign(Object.assign({},n),{fill:(null==n?void 0:n.fill)||"both",duration:(null==n?void 0:n.duration)||(null===(e=this._animationLayerData)||void 0===e?void 0:e.duration),easing:(null==n?void 0:n.easing)||s,pseudoElement:i}),new Animation(new KeyframeEffect(this.ref,t,n))}}if(Array.isArray(this.pseudoElementOutAnimation)){const[t,e,n]=this.pseudoElementOutAnimation;return new Animation(new KeyframeEffect(this.ref,f[t],{fill:"both",duration:e,easing:n||s,pseudoElement:i}))}{let{keyframes:t,options:e}=this.pseudoElementOutAnimation;return e="number"==typeof e?{duration:e,easing:s,fill:"both",pseudoElement:i}:Object.assign(Object.assign({},e),{easing:(null==e?void 0:e.easing)||s,duration:(null==e?void 0:e.duration)||(null===(n=this._animationLayerData)||void 0===n?void 0:n.duration),fill:(null==e?void 0:e.fill)||"both",pseudoElement:i}),new Animation(new KeyframeEffect(this.ref,t,e))}}get animation(){var t,e,n;if(!this.ref)return null;let i=(null===(t=this._animationLayerData)||void 0===t?void 0:t.gestureNavigating)?"linear":"ease-out";if(this.props.in){if(Array.isArray(this.inAnimation)){const[t,e,n]=this.inAnimation;return new Animation(new KeyframeEffect(this.ref,f[t],{fill:"both",duration:e,easing:n||i}))}{let{keyframes:t,options:n}=this.inAnimation;return n="number"==typeof n?{duration:n,easing:i,fill:"both"}:Object.assign(Object.assign({},n),{fill:(null==n?void 0:n.fill)||"both",duration:(null==n?void 0:n.duration)||(null===(e=this._animationLayerData)||void 0===e?void 0:e.duration),easing:(null==n?void 0:n.easing)||i}),new Animation(new KeyframeEffect(this.ref,t,n))}}if(Array.isArray(this.outAnimation)){const[t,e,n]=this.outAnimation;return new Animation(new KeyframeEffect(this.ref,f[t],{fill:"both",duration:e,easing:n||i}))}{let{keyframes:t,options:e}=this.outAnimation;return e="number"==typeof e?{duration:e,easing:i,fill:"both"}:Object.assign(Object.assign({},e),{easing:(null==e?void 0:e.easing)||i,duration:(null==e?void 0:e.duration)||(null===(n=this._animationLayerData)||void 0===n?void 0:n.duration),fill:(null==e?void 0:e.fill)||"both"}),new Animation(new KeyframeEffect(this.ref,t,e))}}set zIndex(t){var e,n;0===t?null===(e=this.ref)||void 0===e||e.toggleAttribute("inert",!0):null===(n=this.ref)||void 0===n||n.toggleAttribute("inert",!1),this.setState({zIndex:t})}mounted(t,e=!0){return new Promise((n=>{const i=()=>{var i,s;if(t){e&&this.ref&&(this.ref.style.willChange="transform, opacity");const t=Boolean(this.props.in&&!(null===(i=this._animationLayerData)||void 0===i?void 0:i.gestureNavigating)||this.props.out&&(null===(s=this._animationLayerData)||void 0===s?void 0:s.gestureNavigating));this.props.onEnter&&this.props.onEnter(t)}else this.props.onExited();n()};this.props.keepAlive&&!t?n():this.setState({mounted:t},i)}))}render(){const t=this.props.renderAs;return(0,a.jsx)(t,Object.assign({id:`${this.props.name}-animation-provider`,className:"animation-provider",ref:this.setRef,tabIndex:this.state.zIndex-1,style:{gridArea:"1 / 1",width:"100%",height:"100%",transformOrigin:"center center",zIndex:this.state.zIndex}},{children:(0,a.jsx)(u.Consumer,{children:t=>(this._animationLayerData=t,this.state.mounted?this.props.children:(0,a.jsx)(a.Fragment,{}))})}))}}var E,w,b,x,S,P,A;function L(t){return null!==t&&("function"==typeof t||"object"==typeof t&&t.$$typeof===Symbol.for("react.lazy"))}!function(t){t[t.up=0]="up",t[t.down=1]="down",t[t.left=2]="left",t[t.right=3]="right",t[t.in=4]="in",t[t.out=5]="out"}(E||(E={})),function(t){t[t.slide=0]="slide",t[t.fade=1]="fade",t[t.zoom=2]="zoom",t[t.none=3]="none"}(w||(w={})),function(t){t[t.ease=0]="ease",t[t["ease-in"]=1]="ease-in",t[t["ease-in-out"]=2]="ease-in-out",t[t["ease-out"]=3]="ease-out",t[t.linear=4]="linear"}(b||(b={})),function(t){t[t.center=0]="center",t[t.top=1]="top",t[t.bottom=2]="bottom",t[t.left=3]="left",t[t.right=4]="right"}(x||(x={})),function(t){t[t.cap=0]="cap",t[t.ch=1]="ch",t[t.em=2]="em",t[t.ex=3]="ex",t[t.ic=4]="ic",t[t.lh=5]="lh",t[t.rem=6]="rem",t[t.rlh=7]="rlh",t[t.vh=8]="vh",t[t.vw=9]="vw",t[t.vi=10]="vi",t[t.vb=11]="vb",t[t.vmin=12]="vmin",t[t.vmax=13]="vmax",t[t.px=14]="px",t[t.cm=15]="cm",t[t.mm=16]="mm",t[t.Q=17]="Q",t[t.in=18]="in",t[t.pc=19]="pc",t[t.pt=20]="pt",t[t["%"]=21]="%"}(S||(S={})),function(t){t[t.inital=0]="inital",t[t.inherit=1]="inherit",t[t.revert=2]="revert",t[t.unset=3]="unset"}(P||(P={})),function(t){t[t.morph=0]="morph",t[t["fade-through"]=1]="fade-through",t[t.fade=2]="fade",t[t["cross-fade"]=3]="cross-fade"}(A||(A={}));class R{constructor(t){this._nodes=new Map,this._name="",this._scrollPos=null,this._getScreenRect=()=>new DOMRect,this._keepAlive=!1,this._name=t}addNode(t){t&&(console.assert(!this.nodes.has(t.id),`Duplicate Shared Element ID: ${t.id} in ${this._name}`),this._nodes.set(t.id,t))}removeNode(t){this._nodes.delete(t)}get xRatio(){const t=(this._getScreenRect().width/window.innerWidth).toFixed(2);return parseFloat(t)}get yRatio(){const t=(this._getScreenRect().height/window.innerHeight).toFixed(2);return parseFloat(t)}get nodes(){return this._nodes}get name(){return this._name}get scrollPos(){return this._scrollPos||{x:0,y:0}}get x(){return this._getScreenRect().x}get y(){return this._getScreenRect().y}get keepAlive(){return this._keepAlive}set scrollPos(t){this._scrollPos=t}set getScreenRect(t){this._getScreenRect=t}set keepAlive(t){this._keepAlive=t}isEmpty(){return!Boolean(this._nodes.size)}}const D=(0,t.createContext)(null);function k(t,e,n){const i=e.firstElementChild;return i?(n.props.config&&n.props.config.transformOrigin&&(i.style.transformOrigin=n.props.config.transformOrigin),{id:t,instance:n}):null}const O=["transform","top","left","right","bottom"];class N extends t.Component{constructor(){super(...arguments),this._id=this.props.id.toString(),this._ref=null,this._scene=null,this._mutationObserver=new MutationObserver(this.updateScene.bind(this)),this._callbackID=0,this._computedStyle=null,this._isMounted=!1,this.onRef=this.setRef.bind(this),this.state={hidden:!1,keepAlive:!1},this.onCloneAppended=t=>{},this.onCloneRemove=t=>{var e;if((null===(e=this._ref)||void 0===e?void 0:e.firstElementChild)instanceof HTMLVideoElement){const e=t.firstElementChild;this._ref.firstElementChild.currentTime=e.currentTime,e.paused||e.pause()}}}get scene(){return this._scene}get node(){var t;return this._ref?this._ref.firstElementChild instanceof HTMLVideoElement&&"morph"===(null!==(t=this.transitionType)&&void 0!==t?t:"morph")?this._ref:this._ref.cloneNode(!0):null}get clientRect(){if(this._ref&&this._ref.firstElementChild){return this._ref.firstElementChild.getBoundingClientRect()}return new DOMRect}get CSSData(){const t=this._computedStyle;return t?(0,h.hR)(t,O):["",{}]}get CSSText(){const t=this._computedStyle;if(t){const[e]=(0,h.hR)(t,O,!1);return e}return""}get id(){return this._id}get transitionType(){var t;return null===(t=this.props.config)||void 0===t?void 0:t.type}keepAlive(t){return new Promise((e=>{this.setState({keepAlive:t},(()=>e()))}))}hidden(t){return new Promise(((e,n)=>{this._isMounted?this.setState({hidden:t},(()=>{e()})):e()}))}setRef(t){var e,n;this._ref!==t&&(this._ref&&(null===(e=this.scene)||void 0===e||e.removeNode(this._id),this._mutationObserver.disconnect(),this._computedStyle=null),this._ref=t,t&&(null===(n=this.scene)||void 0===n||n.addNode(k(this._id,t,this)),t.firstElementChild&&(this._computedStyle=window.getComputedStyle(t.firstElementChild),this._mutationObserver.observe(t.firstElementChild,{attributes:!0,childList:!0,subtree:!0}))))}updateScene(){const t=window.cancelIdleCallback?window.cancelIdleCallback:window.clearTimeout,e=window.requestIdleCallback?window.requestIdleCallback:window.setTimeout;t(this._callbackID),this._callbackID=e((()=>{var t,e;this._ref&&(null===(t=this.scene)||void 0===t||t.removeNode(this._id),null===(e=this.scene)||void 0===e||e.addNode(k(this._id,this._ref,this))),this._callbackID=0}))}componentDidMount(){this._isMounted=!0}componentDidUpdate(){var t,e;this._id!==this.props.id.toString()&&this._ref&&(null===(t=this.scene)||void 0===t||t.removeNode(this._id),this._id=this.props.id.toString(),null===(e=this.scene)||void 0===e||e.addNode(k(this._id,this._ref,this)))}componentWillUnmount(){this._isMounted=!1}render(){return(0,a.jsx)(D.Consumer,{children:t=>(this._scene=t,(0,a.jsx)("div",Object.assign({ref:this.onRef,id:`shared-element-${this._id}`,style:{display:this.state.hidden&&!this.keepAlive?"block":"contents",visibility:this.state.hidden?"hidden":"visible"}},{children:this.props.children})))})}}const I=(0,t.createContext)({preloaded:!1,params:{},path:void 0});class T extends t.Component{constructor(){var t,e;super(...arguments),this.name=void 0===this.props.path?"not-found":(null===(t=this.props.path)||void 0===t?void 0:t.toString().slice(1).replace("/","-"))||"index",this.sharedElementScene=new R(this.name),this.ref=null,this.onRef=this.setRef.bind(this),this.animation=h.r2,this.pseudoElementAnimation=h.r2,this.elementType="div",this.animationProviderRef=null,this.state={shouldKeepAlive:this.props.out&&(null===(e=this.props.config)||void 0===e?void 0:e.keepAlive)}}componentDidMount(){var t,e,n,i,s,o;this.sharedElementScene.getScreenRect=()=>{var t;return(null===(t=this.ref)||void 0===t?void 0:t.getBoundingClientRect())||new DOMRect},this.sharedElementScene.keepAlive=(null===(t=this.props.config)||void 0===t?void 0:t.keepAlive)||!1,this.animation=null!==(n=this.setupAnimation(null===(e=this.props.config)||void 0===e?void 0:e.animation))&&void 0!==n?n:this.context.animation,this.pseudoElementAnimation=null!==(o=this.setupAnimation(null===(s=null===(i=this.props.config)||void 0===i?void 0:i.pseudoElement)||void 0===s?void 0:s.animation))&&void 0!==o?o:h.r2,this.context.mountedScreen=this,this.forceUpdate()}shouldComponentUpdate(t){return!(!t.out||t.in)||(!(!t.in||t.out)||(t.in!==this.props.in||t.out!==this.props.out))}componentDidUpdate(t){var e,n,i;(null===(e=t.config)||void 0===e?void 0:e.keepAlive)!==(null===(n=this.props.config)||void 0===n?void 0:n.keepAlive)&&(this.sharedElementScene.keepAlive=(null===(i=this.props.config)||void 0===i?void 0:i.keepAlive)||!1)}setupAnimation(t){return t?"function"==typeof t?this.animationFactory.bind(this,t):"in"in t?{in:t.in,out:t.out||t.in}:{in:t,out:t}:null}animationFactory(t){if("function"==typeof t){let e=this.context.navigation.history.next;this.context.backNavigating||(e=this.context.navigation.history.previous);const n=t(e||"",this.context.navigation.history.current,this.context.gestureNavigating);return"in"in n?{in:n.in,out:n.out||n.in}:{in:n,out:n}}return this.context.animation}onExited(){}onExit(){this.context.backNavigating?this.setState({shouldKeepAlive:!1}):this.setState({shouldKeepAlive:!0}),this.context.ghostLayer&&(this.context.ghostLayer.currentScene=this.sharedElementScene)}onEnter(){this.context.ghostLayer&&(this.context.ghostLayer.nextScene=this.sharedElementScene)}onEntered(){}setRef(t){this.ref!==t&&(this.ref=t)}get resolvedPathname(){return this.props.resolvedPathname}render(){var e,n,i,s,o,r,h,l,u,c;let d,p=this.props.component,m=null===(n=null===(e=this.props.config)||void 0===e?void 0:e.header)||void 0===n?void 0:n.component,v=!1,g=!1;"preloaded"in p&&p.preloaded&&(p=p.preloaded,v=!0),m&&"preloaded"in m&&m.preloaded&&(m=m.preloaded,g=!0),(null===(i=this.props.config)||void 0===i?void 0:i.pseudoElement)&&(d={selector:null===(s=this.props.config)||void 0===s?void 0:s.pseudoElement.selector,animation:this.pseudoElementAnimation});const f=Object.assign(Object.assign({},this.props.defaultParams),null===(o=this.context.routesData.get(this.props.path))||void 0===o?void 0:o.params);return(0,a.jsx)(_,Object.assign({onRef:t=>this.animationProviderRef=t,renderAs:this.elementType,onExit:this.onExit.bind(this),onExited:this.onExited.bind(this),onEnter:this.onEnter.bind(this),onEntered:this.onEntered.bind(this),in:this.props.in||!1,out:this.props.out||!1,name:null!==(h=null===(r=this.props.name)||void 0===r?void 0:r.toLowerCase().replace(" ","-"))&&void 0!==h?h:this.name,resolvedPathname:this.props.resolvedPathname,animation:this.animation,pseudoElement:d,backNavigating:this.context.backNavigating,keepAlive:this.state.shouldKeepAlive&&(null===(l=this.props.config)||void 0===l?void 0:l.keepAlive)||!1,navigation:this.context.navigation},{children:(0,a.jsx)("div",Object.assign({id:this.name,ref:this.onRef,className:"screen",style:{height:"100%",width:"100%",display:"flex",flexDirection:"column",pointerEvents:"inherit"}},{children:(0,a.jsx)(D.Provider,Object.assign({value:this.sharedElementScene},{children:(0,a.jsxs)(I.Provider,Object.assign({value:{preloaded:v,path:this.props.path,params:f}},{children:[(0,a.jsx)(t.Suspense,Object.assign({fallback:(0,a.jsx)(C,{component:null===(c=null===(u=this.props.config)||void 0===u?void 0:u.header)||void 0===c?void 0:c.fallback})},{children:(0,a.jsx)(C,{component:m})})),(0,a.jsx)(t.Suspense,Object.assign({fallback:(0,a.jsx)(C,{component:this.props.fallback})},{children:(0,a.jsx)(C,{component:p})}))]}))}))}))}))}}function C({component:e}){const n=M(),i=F(),s=null!=e?e:null;return(0,t.isValidElement)(s)?(0,t.cloneElement)(s,{orientation:screen.orientation,navigation:n,route:i}):L(s)?(0,a.jsx)(s,{orientation:screen.orientation,navigation:n,route:i}):(0,a.jsx)(a.Fragment,{children:s})}T.contextType=n;class j{constructor(t,e,n){var i;this._stack=[],this._routerId=t,window.history.replaceState(Object.assign(Object.assign({},history.state),{routerId:this._routerId}),"",window.location.toString()),n=n||new URL(window.location.toString()),n=new URL(n.href.replace(/\/$/,"")),this._baseURL=n,this._defaultRoute=e,this.state.has(this.baseURL.pathname)||this.state.set(this.baseURL.pathname,{});const s=null===(i=this.state.get(this.baseURL.pathname))||void 0===i?void 0:i.stack;s?this._stack=[...s.filter((t=>Boolean(t)))]:this.state.has(this.baseURL.pathname)&&(this.state.get(this.baseURL.pathname).stack=[...this._stack])}set defaultRoute(t){this._defaultRoute=t}get length(){return this._stack.length}get defaultRoute(){return this._defaultRoute||"/"}get isEmpty(){return!this._stack.length}get baseURL(){return this._baseURL}get state(){return{set:(t,e)=>!!window.history.state&&(window.history.state[t]=e,!0),get:t=>window.history.state&&window.history.state[t]||null,has:t=>!!window.history.state&&t in window.history.state,delete:t=>!!window.history.state&&delete window.history.state[t],keys:()=>Object.keys(window.history.state||{}),values:()=>Object.values(window.history.state||{}),clear(){return this.keys().forEach((t=>delete window.history.state[t]))},get length(){return this.keys().length}}}pushState(t,e,n){t=Object.assign(Object.assign({},window.history.state),{[this.baseURL.pathname]:Object.assign(Object.assign({},window.history.state[this.baseURL.pathname]),t),routerId:this._routerId}),window.history.pushState(t,e,n)}replaceState(t,e,n){t=Object.assign(Object.assign({},window.history.state),{[this.baseURL.pathname]:Object.assign(Object.assign({},window.history.state[this.baseURL.pathname]),t),routerId:this._routerId}),window.history.replaceState(t,e,n)}static getURL(t,e,n=""){e.pathname.match(/\/$/)||(e=new URL(e.href+"/")),t.match(/^\//)&&(t=t.slice(1));const i=new URL(t,e);return i.search=n,i}}function $(){const e=window.matchMedia("(prefers-reduced-motion: reduce)"),[n,i]=(0,t.useState)(e.matches);return e.onchange=()=>{i(e.matches)},n}function M(){const e=(0,t.useContext)(n);if(e)return e.navigation;throw new Error("RouterData is null. You may be trying to call useNavigation outside a Router.")}function U(){const[e,n]=(0,t.useState)((0,t.useContext)(d)),i=M();return(0,t.useEffect)((()=>{const t=({detail:t})=>{n(t.progress)};return i.addEventListener("motion-progress",t),()=>i.removeEventListener("motion-progress",t)}),[]),e}function F(){const e=(0,t.useContext)(I);if(e)return e;throw new Error("RouterData is null. You may be trying to call useRoute outside a Router.")}var V=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};function z(e){const i=(0,t.useContext)(n),s=M(),[o,r]=(0,t.useState)(""),[l,u]=(0,t.useState)(!1);(0,t.useEffect)((()=>{if(!s)return;let t,n;if("goBack"in e)t=Y(s),n="";else{const s=(null==i?void 0:i.paramsSerializer)||null;t=e.href,n=(0,h.Po)(e.params||{},s)||""}const o=new URL(t,s.location.origin);o.hash=e.hash||"",o.search=n,o.origin===s.location.origin?(u(!1),r(o.href.replace(s.location.origin,""))):(u(!0),r(o.href))}),[e.href,e.params]);const{href:c,goBack:d,hash:p,onClick:m,replace:v,params:g}=e,f=V(e,["href","goBack","hash","onClick","replace","params"]);return s?(0,a.jsx)("a",Object.assign({href:o,onClick:t=>{t.stopPropagation(),s&&(l||(t.preventDefault(),m&&m(t),d&&s.goBack(),c&&s.navigate(c,g,{hash:p,replace:v})))}},f,{children:e.children})):(0,a.jsx)(a.Fragment,{})}function Y(t){return t.canGoBack()?t.history.previous:t.parent?Y(t.parent):document.referrer}var X=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};function B(t){var{disabled:e,children:n}=t,i=X(t,["disabled","children"]);return(0,a.jsx)("div",Object.assign({className:"gesture-region","data-disabled":e,style:{display:"contents"}},i,{children:n}))}i(878);var H=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class W extends t.Component{constructor(t){super(t),this.ref=null,this.scrollPos={x:0,y:0},this.routerData=null,this._mounted=!1,this.onPageAnimationEnd=()=>{window.location.hash&&requestAnimationFrame(this.onHashChange.bind(this))},this.onHashChange=()=>{var t;if(this.ref){const e=location.hash;try{null===(t=this.ref.querySelector(e))||void 0===t||t.scrollIntoView(this.props.hashScrollConfig)}catch(t){}}},this.setRef=t=>{t&&(this.scrollPos={x:t.scrollLeft,y:t.scrollTop},this.ref=t,location.hash&&!this._mounted&&this.onHashChange(),this._mounted=!0)},this.onHashChange=this.onHashChange.bind(this)}componentDidMount(){var t,e;const n=null===(t=this.routerData)||void 0===t?void 0:t.scrollRestorationData.get(this.props.id);n&&(this.scrollPos=n),this.ref&&this.props.shouldRestore&&this.ref.scrollTo({left:this.scrollPos.x,top:this.scrollPos.y}),null===(e=this.routerData)||void 0===e||e.navigation.addEventListener("page-animation-end",this.onPageAnimationEnd),window.addEventListener("hashchange",this.onHashChange)}componentWillUnmount(){var t,e,n,i;const s={x:(null===(t=this.ref)||void 0===t?void 0:t.scrollLeft)||0,y:(null===(e=this.ref)||void 0===e?void 0:e.scrollTop)||0};null===(n=this.routerData)||void 0===n||n.scrollRestorationData.set(this.props.id,s),null===(i=this.routerData)||void 0===i||i.navigation.removeEventListener("page-animation-end",this.onPageAnimationEnd),window.removeEventListener("hashchange",this.onHashChange)}get scrollTop(){var t,e;return null!==(e=null===(t=this.ref)||void 0===t?void 0:t.scrollTop)&&void 0!==e?e:0}get scrollLeft(){var t,e;return null!==(e=null===(t=this.ref)||void 0===t?void 0:t.scrollLeft)&&void 0!==e?e:0}get scrollWidth(){var t,e;return null!==(e=null===(t=this.ref)||void 0===t?void 0:t.scrollWidth)&&void 0!==e?e:0}get scrollHeight(){var t,e;return null!==(e=null===(t=this.ref)||void 0===t?void 0:t.scrollHeight)&&void 0!==e?e:0}render(){return(0,a.jsx)(n.Consumer,{children:t=>{this.routerData=t;const e=this.props,{style:n,shouldRestore:i,hashScrollConfig:s}=e,o=H(e,["style","shouldRestore","hashScrollConfig"]);return(0,a.jsx)("div",Object.assign({},o,{ref:this.setRef,style:Object.assign(Object.assign({},n),{overflow:"scroll"})},{children:this.props.children}))}})}}var G=/[$_\p{ID_Start}]/u,K=/[$_\u200C\u200D\p{ID_Continue}]/u;function q(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function J(t,e=!1){const n=[];let i=0;for(;i<t.length;){const s=t[i],o=function(s){if(!e)throw new TypeError(s);n.push({type:"INVALID_CHAR",index:i,value:t[i++]})};if("*"!==s)if("+"!==s&&"?"!==s)if("\\"!==s)if("{"!==s)if("}"!==s)if(":"!==s)if("("!==s)n.push({type:"CHAR",index:i,value:t[i++]});else{let e=1,s="",r=i+1,a=!1;if("?"===t[r]){o(`Pattern cannot start with "?" at ${r}`);continue}for(;r<t.length;){if(!q(t[r],!1)){o(`Invalid character '${t[r]}' at ${r}.`),a=!0;break}if("\\"!==t[r]){if(")"===t[r]){if(e--,0===e){r++;break}}else if("("===t[r]&&(e++,"?"!==t[r+1])){o(`Capturing groups are not allowed at ${r}`),a=!0;break}s+=t[r++]}else s+=t[r++]+t[r++]}if(a)continue;if(e){o(`Unbalanced pattern at ${i}`);continue}if(!s){o(`Missing pattern at ${i}`);continue}n.push({type:"PATTERN",index:i,value:s}),i=r}else{let e="",s=i+1;for(;s<t.length;){const n=t.substr(s,1);if(!(s===i+1&&G.test(n)||s!==i+1&&K.test(n)))break;e+=t[s++]}if(!e){o(`Missing parameter name at ${i}`);continue}n.push({type:"NAME",index:i,value:e}),i=s}else n.push({type:"CLOSE",index:i,value:t[i++]});else n.push({type:"OPEN",index:i,value:t[i++]});else n.push({type:"ESCAPED_CHAR",index:i++,value:t[i++]});else n.push({type:"MODIFIER",index:i,value:t[i++]});else n.push({type:"ASTERISK",index:i,value:t[i++]})}return n.push({type:"END",index:i,value:""}),n}function Q(t,e={}){const n=J(t),{prefixes:i="./"}=e,s=`[^${Z(void 0===e.delimiter?"/#?":e.delimiter)}]+?`,o=[];let r=0,a=0,h="",l=new Set;const u=t=>{if(a<n.length&&n[a].type===t)return n[a++].value},c=()=>{const t=u("MODIFIER");return t||u("ASTERISK")},d=t=>{const e=u(t);if(void 0!==e)return e;const{type:i,index:s}=n[a];throw new TypeError(`Unexpected ${i} at ${s}, expected ${t}`)},p=()=>{let t,e="";for(;t=u("CHAR")||u("ESCAPED_CHAR");)e+=t;return e},m=e.encodePart||(t=>t);for(;a<n.length;){const t=u("CHAR"),e=u("NAME");let n=u("PATTERN");if(e||n||!u("ASTERISK")||(n=".*"),e||n){let a=t||"";-1===i.indexOf(a)&&(h+=a,a=""),h&&(o.push(m(h)),h="");const u=e||r++;if(l.has(u))throw new TypeError(`Duplicate name '${u}'.`);l.add(u),o.push({name:u,prefix:m(a),suffix:"",pattern:n||s,modifier:c()||""});continue}const a=t||u("ESCAPED_CHAR");if(a){h+=a;continue}if(u("OPEN")){const t=p(),e=u("NAME")||"";let n=u("PATTERN")||"";e||n||!u("ASTERISK")||(n=".*");const i=p();d("CLOSE");const a=c()||"";if(!e&&!n&&!a){h+=t;continue}if(!e&&!n&&!t)continue;h&&(o.push(m(h)),h=""),o.push({name:e||(n?r++:""),pattern:e&&!n?s:n,prefix:m(t),suffix:m(i),modifier:a})}else h&&(o.push(m(h)),h=""),d("END")}return o}function Z(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function tt(t){return t&&t.ignoreCase?"ui":"u"}function et(t,e,n={}){const{strict:i=!1,start:s=!0,end:o=!0,encode:r=(t=>t)}=n,a=`[${Z(void 0===n.endsWith?"":n.endsWith)}]|$`,h=`[${Z(void 0===n.delimiter?"/#?":n.delimiter)}]`;let l=s?"^":"";for(const n of t)if("string"==typeof n)l+=Z(r(n));else{const t=Z(r(n.prefix)),i=Z(r(n.suffix));if(n.pattern)if(e&&e.push(n),t||i)if("+"===n.modifier||"*"===n.modifier){const e="*"===n.modifier?"?":"";l+=`(?:${t}((?:${n.pattern})(?:${i}${t}(?:${n.pattern}))*)${i})${e}`}else l+=`(?:${t}(${n.pattern})${i})${n.modifier}`;else"+"===n.modifier||"*"===n.modifier?l+=`((?:${n.pattern})${n.modifier})`:l+=`(${n.pattern})${n.modifier}`;else l+=`(?:${t}${i})${n.modifier}`}if(o)i||(l+=`${h}?`),l+=n.endsWith?`(?=${a})`:"$";else{const e=t[t.length-1],n="string"==typeof e?h.indexOf(e[e.length-1])>-1:void 0===e;i||(l+=`(?:${h}(?=${a}))?`),n||(l+=`(?=${h}|${a})`)}return new RegExp(l,tt(n))}function nt(t,e,n){return t instanceof RegExp?function(t,e){if(!e)return t;const n=/\((?:\?<(.*?)>)?(?!\?)/g;let i=0,s=n.exec(t.source);for(;s;)e.push({name:s[1]||i++,prefix:"",suffix:"",modifier:"",pattern:""}),s=n.exec(t.source);return t}(t,e):Array.isArray(t)?function(t,e,n){const i=t.map((t=>nt(t,e,n).source));return new RegExp(`(?:${i.join("|")})`,tt(n))}(t,e,n):function(t,e,n){return et(Q(t,n),e,n)}(t,e,n)}var it={delimiter:"",prefixes:"",sensitive:!0,strict:!0},st={delimiter:".",prefixes:"",sensitive:!0,strict:!0},ot={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function rt(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function at(t){return!(!t||t.length<2)&&("["===t[0]||("\\"===t[0]||"{"===t[0])&&"["===t[1])}var ht=["ftp","file","http","https","ws","wss"];function lt(t){if(!t)return!0;for(const e of ht)if(t.test(e))return!0;return!1}function ut(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function ct(t){if(""===t)return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function dt(t){if(""===t)return t;const e=new URL("https://example.com");return e.username=t,e.username}function pt(t){if(""===t)return t;const e=new URL("https://example.com");return e.password=t,e.password}function mt(t){if(""===t)return t;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(t))throw new TypeError(`Invalid hostname '${t}'`);const e=new URL("https://example.com");return e.hostname=t,e.hostname}function vt(t){if(""===t)return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function gt(t){if(""===t)return t;if(/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function ft(t){if(""===t)return t;const e=new URL("https://example.com");return e.pathname="/"!==t[0]?"/-"+t:t,"/"!==t[0]?e.pathname.substring(2,e.pathname.length):e.pathname}function yt(t){if(""===t)return t;return new URL(`data:${t}`).pathname}function _t(t){if(""===t)return t;const e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function Et(t){if(""===t)return t;const e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}var wt=["protocol","username","password","hostname","port","pathname","search","hash"],bt="*";function xt(t,e){if("string"!=typeof t)throw new TypeError("parameter 1 is not of type 'string'.");const n=new URL(t,e);return{protocol:n.protocol.substring(0,n.protocol.length-1),username:n.username,password:n.password,hostname:n.hostname,port:n.port,pathname:n.pathname,search:""!=n.search?n.search.substring(1,n.search.length):void 0,hash:""!=n.hash?n.hash.substring(1,n.hash.length):void 0}}function St(t,e){return e?At(t):t}function Pt(t,e,n){let i;if("string"==typeof e.baseURL)try{i=new URL(e.baseURL),t.protocol=St(i.protocol.substring(0,i.protocol.length-1),n),t.username=St(i.username,n),t.password=St(i.password,n),t.hostname=St(i.hostname,n),t.port=St(i.port,n),t.pathname=St(i.pathname,n),t.search=St(i.search.substring(1,i.search.length),n),t.hash=St(i.hash.substring(1,i.hash.length),n)}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if("string"==typeof e.protocol&&(t.protocol=function(t,e){var n,i;return i=":",t=(n=t).endsWith(i)?n.substr(0,n.length-i.length):n,e||""===t?t:ct(t)}(e.protocol,n)),"string"==typeof e.username&&(t.username=function(t,e){if(e||""===t)return t;const n=new URL("https://example.com");return n.username=t,n.username}(e.username,n)),"string"==typeof e.password&&(t.password=function(t,e){if(e||""===t)return t;const n=new URL("https://example.com");return n.password=t,n.password}(e.password,n)),"string"==typeof e.hostname&&(t.hostname=function(t,e){return e||""===t?t:at(t)?vt(t):mt(t)}(e.hostname,n)),"string"==typeof e.port&&(t.port=function(t,e,n){return ut(e)===t&&(t=""),n||""===t?t:gt(t)}(e.port,t.protocol,n)),"string"==typeof e.pathname){if(t.pathname=e.pathname,i&&!function(t,e){return!(!t.length||"/"!==t[0]&&(!e||t.length<2||"\\"!=t[0]&&"{"!=t[0]||"/"!=t[1]))}(t.pathname,n)){const e=i.pathname.lastIndexOf("/");e>=0&&(t.pathname=St(i.pathname.substring(0,e+1),n)+t.pathname)}t.pathname=function(t,e,n){if(n||""===t)return t;if(e&&!ht.includes(e))return new URL(`${e}:${t}`).pathname;const i="/"==t[0];return t=new URL(i?t:"/-"+t,"https://example.com").pathname,i||(t=t.substring(2,t.length)),t}(t.pathname,t.protocol,n)}return"string"==typeof e.search&&(t.search=function(t,e){if(t=rt(t,"?"),e||""===t)return t;const n=new URL("https://example.com");return n.search=t,n.search?n.search.substring(1,n.search.length):""}(e.search,n)),"string"==typeof e.hash&&(t.hash=function(t,e){if(t=rt(t,"#"),e||""===t)return t;const n=new URL("https://example.com");return n.hash=t,n.hash?n.hash.substring(1,n.hash.length):""}(e.hash,n)),t}function At(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function Lt(t,e){const n=`[^${i=void 0===e.delimiter?"/#?":e.delimiter,i.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}]+?`;var i;const s=/[$_\u200C\u200D\p{ID_Continue}]/u;let o="";for(let i=0;i<t.length;++i){const r=t[i],a=i>0?t[i-1]:null,h=i<t.length-1?t[i+1]:null;if("string"==typeof r){o+=At(r);continue}if(""===r.pattern){if(""===r.modifier){o+=At(r.prefix);continue}o+=`{${At(r.prefix)}}${r.modifier}`;continue}const l="number"!=typeof r.name,u=void 0!==e.prefixes?e.prefixes:"./";let c=""!==r.suffix||""!==r.prefix&&(1!==r.prefix.length||!u.includes(r.prefix));if(!c&&l&&r.pattern===n&&""===r.modifier&&h&&!h.prefix&&!h.suffix)if("string"==typeof h){const t=h.length>0?h[0]:"";c=s.test(t)}else c="number"==typeof h.name;if(!c&&""===r.prefix&&a&&"string"==typeof a&&a.length>0){const t=a[a.length-1];c=u.includes(t)}c&&(o+="{"),o+=At(r.prefix),l&&(o+=`:${r.name}`),".*"===r.pattern?l||a&&"string"!=typeof a&&!a.modifier&&!c&&""===r.prefix?o+="(.*)":o+="*":r.pattern===n?l||(o+=`(${n})`):o+=`(${r.pattern})`,r.pattern===n&&l&&""!==r.suffix&&s.test(r.suffix[0])&&(o+="\\"),o+=At(r.suffix),c&&(o+="}"),o+=r.modifier}return o}var Rt=class{constructor(t={},e,n){this.regexp={},this.keys={},this.component_pattern={};try{let i;if("string"==typeof e?i=e:n=e,"string"==typeof t){const e=new class{constructor(t){this.tokenList=[],this.internalResult={},this.tokenIndex=0,this.tokenIncrement=1,this.componentStart=0,this.state=0,this.groupDepth=0,this.hostnameIPv6BracketDepth=0,this.shouldTreatAsStandardURL=!1,this.input=t}get result(){return this.internalResult}parse(){for(this.tokenList=J(this.input,!0);this.tokenIndex<this.tokenList.length;this.tokenIndex+=this.tokenIncrement){if(this.tokenIncrement=1,"END"===this.tokenList[this.tokenIndex].type){if(0===this.state){this.rewind(),this.isHashPrefix()?this.changeState(9,1):this.isSearchPrefix()?(this.changeState(8,1),this.internalResult.hash=""):(this.changeState(7,0),this.internalResult.search="",this.internalResult.hash="");continue}if(2===this.state){this.rewindAndSetState(5);continue}this.changeState(10,0);break}if(this.groupDepth>0){if(!this.isGroupClose())continue;this.groupDepth-=1}if(this.isGroupOpen())this.groupDepth+=1;else switch(this.state){case 0:this.isProtocolSuffix()&&(this.internalResult.username="",this.internalResult.password="",this.internalResult.hostname="",this.internalResult.port="",this.internalResult.pathname="",this.internalResult.search="",this.internalResult.hash="",this.rewindAndSetState(1));break;case 1:if(this.isProtocolSuffix()){this.computeShouldTreatAsStandardURL();let t=7,e=1;this.shouldTreatAsStandardURL&&(this.internalResult.pathname="/"),this.nextIsAuthoritySlashes()?(t=2,e=3):this.shouldTreatAsStandardURL&&(t=2),this.changeState(t,e)}break;case 2:this.isIdentityTerminator()?this.rewindAndSetState(3):(this.isPathnameStart()||this.isSearchPrefix()||this.isHashPrefix())&&this.rewindAndSetState(5);break;case 3:this.isPasswordPrefix()?this.changeState(4,1):this.isIdentityTerminator()&&this.changeState(5,1);break;case 4:this.isIdentityTerminator()&&this.changeState(5,1);break;case 5:this.isIPv6Open()?this.hostnameIPv6BracketDepth+=1:this.isIPv6Close()&&(this.hostnameIPv6BracketDepth-=1),this.isPortPrefix()&&!this.hostnameIPv6BracketDepth?this.changeState(6,1):this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 6:this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 7:this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 8:this.isHashPrefix()&&this.changeState(9,1)}}}changeState(t,e){switch(this.state){case 0:case 2:case 10:break;case 1:this.internalResult.protocol=this.makeComponentString();break;case 3:this.internalResult.username=this.makeComponentString();break;case 4:this.internalResult.password=this.makeComponentString();break;case 5:this.internalResult.hostname=this.makeComponentString();break;case 6:this.internalResult.port=this.makeComponentString();break;case 7:this.internalResult.pathname=this.makeComponentString();break;case 8:this.internalResult.search=this.makeComponentString();break;case 9:this.internalResult.hash=this.makeComponentString()}this.changeStateWithoutSettingComponent(t,e)}changeStateWithoutSettingComponent(t,e){this.state=t,this.componentStart=this.tokenIndex+e,this.tokenIndex+=e,this.tokenIncrement=0}rewind(){this.tokenIndex=this.componentStart,this.tokenIncrement=0}rewindAndSetState(t){this.rewind(),this.state=t}safeToken(t){return t<0&&(t=this.tokenList.length-t),t<this.tokenList.length?this.tokenList[t]:this.tokenList[this.tokenList.length-1]}isNonSpecialPatternChar(t,e){const n=this.safeToken(t);return n.value===e&&("CHAR"===n.type||"ESCAPED_CHAR"===n.type||"INVALID_CHAR"===n.type)}isProtocolSuffix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}nextIsAuthoritySlashes(){return this.isNonSpecialPatternChar(this.tokenIndex+1,"/")&&this.isNonSpecialPatternChar(this.tokenIndex+2,"/")}isIdentityTerminator(){return this.isNonSpecialPatternChar(this.tokenIndex,"@")}isPasswordPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPortPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPathnameStart(){return this.isNonSpecialPatternChar(this.tokenIndex,"/")}isSearchPrefix(){if(this.isNonSpecialPatternChar(this.tokenIndex,"?"))return!0;if("?"!==this.tokenList[this.tokenIndex].value)return!1;const t=this.safeToken(this.tokenIndex-1);return"NAME"!==t.type&&"PATTERN"!==t.type&&"CLOSE"!==t.type&&"ASTERISK"!==t.type}isHashPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,"#")}isGroupOpen(){return"OPEN"==this.tokenList[this.tokenIndex].type}isGroupClose(){return"CLOSE"==this.tokenList[this.tokenIndex].type}isIPv6Open(){return this.isNonSpecialPatternChar(this.tokenIndex,"[")}isIPv6Close(){return this.isNonSpecialPatternChar(this.tokenIndex,"]")}makeComponentString(){const t=this.tokenList[this.tokenIndex],e=this.safeToken(this.componentStart).index;return this.input.substring(e,t.index)}computeShouldTreatAsStandardURL(){const t={};Object.assign(t,it),t.encodePart=ct;const e=nt(this.makeComponentString(),void 0,t);this.shouldTreatAsStandardURL=lt(e)}}(t);if(e.parse(),t=e.result,void 0===i&&"string"!=typeof t.protocol)throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=i}else{if(!t||"object"!=typeof t)throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(i)throw new TypeError("parameter 1 is not of type 'string'.")}void 0===n&&(n={ignoreCase:!1});const s={ignoreCase:!0===n.ignoreCase},o={pathname:bt,protocol:bt,username:bt,password:bt,hostname:bt,port:bt,search:bt,hash:bt};let r;for(r of(this.pattern=Pt(o,t,!0),ut(this.pattern.protocol)===this.pattern.port&&(this.pattern.port=""),wt)){if(!(r in this.pattern))continue;const t={},e=this.pattern[r];switch(this.keys[r]=[],r){case"protocol":Object.assign(t,it),t.encodePart=ct;break;case"username":Object.assign(t,it),t.encodePart=dt;break;case"password":Object.assign(t,it),t.encodePart=pt;break;case"hostname":Object.assign(t,st),at(e)?t.encodePart=vt:t.encodePart=mt;break;case"port":Object.assign(t,it),t.encodePart=gt;break;case"pathname":lt(this.regexp.protocol)?(Object.assign(t,ot,s),t.encodePart=ft):(Object.assign(t,it,s),t.encodePart=yt);break;case"search":Object.assign(t,it,s),t.encodePart=_t;break;case"hash":Object.assign(t,it,s),t.encodePart=Et}try{const n=Q(e,t);this.regexp[r]=et(n,this.keys[r],t),this.component_pattern[r]=Lt(n,t)}catch{throw new TypeError(`invalid ${r} pattern '${this.pattern[r]}'.`)}}}catch(t){throw new TypeError(`Failed to construct 'URLPattern': ${t.message}`)}}test(t={},e){let n,i={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof t&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(void 0===t)return!1;try{i=Pt(i,"object"==typeof t?t:xt(t,e),!1)}catch(t){return!1}for(n of wt)if(!this.regexp[n].exec(i[n]))return!1;return!0}exec(t={},e){let n={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof t&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(void 0===t)return;try{n=Pt(n,"object"==typeof t?t:xt(t,e),!1)}catch(t){return null}let i,s={};for(i of(s.inputs=e?[t,e]:[t],wt)){let t=this.regexp[i].exec(n[i]);if(!t)return null;let e={};for(let[n,s]of this.keys[i].entries())if("string"==typeof s.name||"number"==typeof s.name){let i=t[n+1];e[s.name]=i}s[i]={input:n[i]||"",groups:e}}return s}get protocol(){return this.component_pattern.protocol}get username(){return this.component_pattern.username}get password(){return this.component_pattern.password}get hostname(){return this.component_pattern.hostname}get port(){return this.component_pattern.port}get pathname(){return this.component_pattern.pathname}get search(){return this.component_pattern.search}get hash(){return this.component_pattern.hash}};globalThis.URLPattern||(globalThis.URLPattern=Rt),globalThis.URLPattern||(globalThis.URLPattern=Rt),document.body.style.position="fixed",document.body.style.inset="0";const Dt=document.head.querySelector("title");Dt&&(Dt.ariaLive="polite");let kt=document.getElementById("root");kt&&(kt.style.width="100%",kt.style.height="100%")})();var o=s.ee,r=s.r2,a=s.rN,h=s.PM,l=s.dw,u=s.y_,c=s.DC,d=s.GW,p=s.sV,m=s.RG,v=s.GI,g=s.rJ,f=s.uZ,y=s.PV,_=s.rL,E=s.Nu,w=s.V_,b=s.hR,x=s.cT,S=s.e1,P=s.Ef,A=s.Vo,L=s.QN,R=s.kI,D=s.Po,k=s.fJ,O=s.nc,N=s.HJ,I=s.JZ,T=s.yj;export{o as Anchor,r as DEFAULT_ANIMATION,a as GestureRegion,h as HistoryBase,l as MAX_Z_INDEX,u as Motion,c as NavigationBase,d as RouterBase,p as RouterData,m as ScreenBase,v as ScrollRestoration,g as SharedElement,f as clamp,y as concatenateURL,_ as defaultSearchParamsToObject,E as dispatchEvent,w as getAnimationDuration,b as getCSSData,x as getStyleObject,S as includesRoute,P as isValidComponentConstructor,A as lazy,L as matchRoute,R as prefetchRoute,D as searchParamsFromObject,k as searchParamsToObject,O as useMotion,N as useNavigation,I as useReducedMotion,T as useRoute};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-motion-router/core",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "main": "build/index.js",
5
5
  "publishConfig": {
6
6
  "access": "public"